@wasm-oj/core 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +57 -30
- package/dist/index.d.ts +36 -148
- package/dist/index.js +312 -451
- package/licenses/quickjs-node-stdlib-LICENSES.txt +259 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -97,37 +97,37 @@ var CLANG_COMPRESSED_PACKAGE_SHA256 = "7f10d90b8e52b270f04874641a1d0bf9e94e85b4f
|
|
|
97
97
|
/** SHA-256 after browser-side gzip decompression. */
|
|
98
98
|
var CLANG_PACKAGE_SHA256 = "21ded33b9c6d4e1aaad5528c940bdaf6c3e84be77ea8f522f018ca7289a2a224";
|
|
99
99
|
/** SHA-256 of the pinned cc1/wasm-ld argv manifest; regenerated by scripts/pin-clang-cc1-argv.mjs. */
|
|
100
|
-
var CLANG_CC1_PINS_SHA256 = "
|
|
100
|
+
var CLANG_CC1_PINS_SHA256 = "895eee17c63b1112c84adcc4ddbcb38e0c18e53bff15f50a8689b9b82d87b1ff";
|
|
101
101
|
var CLANG_MANIFEST_SHA256 = "6382dcdfb6a2da49032a0e08da3b1fb490eb24432be85c3c12e3e871a5065273";
|
|
102
102
|
/** Updated atomically with the generated toolchain-admitted PCH assets. */
|
|
103
|
-
var CLANG_LIBCXX_PCH_MANIFEST_SHA256 = "
|
|
103
|
+
var CLANG_LIBCXX_PCH_MANIFEST_SHA256 = "9bbe41d77c786f1c36169369c909268530b05726e1581683f6edd9a2983eebd0";
|
|
104
104
|
var CLANG_LIBCXX_PCH = Object.freeze({
|
|
105
105
|
"cpp-debug": Object.freeze({
|
|
106
106
|
path: CLANG_LIBCXX_PCH_DEBUG_ASSET_PATH,
|
|
107
|
-
sha256: "
|
|
108
|
-
compressedSha256: "
|
|
107
|
+
sha256: "c420c4643c48826643e75585d5bfdc281f11883d4bda28b283e3c706f3046b3a",
|
|
108
|
+
compressedSha256: "a3811351bae3289caf096f2d4bb6d2ee5db84b97e05514e87190d36b65c500cf"
|
|
109
109
|
}),
|
|
110
110
|
"cpp-release": Object.freeze({
|
|
111
111
|
path: CLANG_LIBCXX_PCH_RELEASE_ASSET_PATH,
|
|
112
|
-
sha256: "
|
|
113
|
-
compressedSha256: "
|
|
112
|
+
sha256: "c4b2132cc6d698e97dd1386431fdb54faaaf38b35b2528c7bc854f860d1f64b1",
|
|
113
|
+
compressedSha256: "ef004fc05ec50af697a37f7c9c814bf62e9676d0de162d6ac35305533939f93f"
|
|
114
114
|
})
|
|
115
115
|
});
|
|
116
|
-
var PYTHON_VERSION = "3.14.
|
|
117
|
-
var PYTHON_PACKAGE_SHA256 = "
|
|
116
|
+
var PYTHON_VERSION = "3.14.7";
|
|
117
|
+
var PYTHON_PACKAGE_SHA256 = "a42c98f5f00582638c8e445440c506bbf94d5e55b3415d1f8d82d11c56cd4b56";
|
|
118
118
|
var PYTHON_PACKAGE = `${`wasm-oj/cpython@${PYTHON_VERSION}`}#sha256:${PYTHON_PACKAGE_SHA256}`;
|
|
119
119
|
var PYTHON_PACKAGE_ASSET_PATH = `/toolchains/python-${PYTHON_VERSION}-wasip1.webc.gz.bin`;
|
|
120
120
|
var PYTHON_PACKAGE_MANIFEST_ASSET_PATH = `/toolchains/python-${PYTHON_VERSION}-wasip1.manifest.json`;
|
|
121
|
-
var PYTHON_COMPRESSED_PACKAGE_SHA256 = "
|
|
122
|
-
var PYTHON_PACKAGE_MANIFEST_SHA256 = "
|
|
123
|
-
var PYTHON_RUNTIME_FILES_ARCHIVE_SHA256 = "
|
|
121
|
+
var PYTHON_COMPRESSED_PACKAGE_SHA256 = "10027f0e32c77dfa0ce1c413b6cb27307d6744fe5e18e6da8cea738bd020260c";
|
|
122
|
+
var PYTHON_PACKAGE_MANIFEST_SHA256 = "53a24b258363a8494af164121111a34b49c85fa0e054627fe131feba6f359cd5";
|
|
123
|
+
var PYTHON_RUNTIME_FILES_ARCHIVE_SHA256 = "c1acac884af1c86833db5b65f8cc0a2304fce74dea0a05d9b40bde0a4e3e7c0e";
|
|
124
124
|
var QUICKJS_VERSION = "0.15.1";
|
|
125
125
|
var QUICKJS_PACKAGE = `wasm-oj/quickjs-ng@${QUICKJS_VERSION}`;
|
|
126
126
|
var QUICKJS_ASSET_PATH = `/toolchains/quickjs-${QUICKJS_VERSION}.wasm.gz.bin`;
|
|
127
|
-
var QUICKJS_ASSET_SHA256 = "
|
|
127
|
+
var QUICKJS_ASSET_SHA256 = "dc6e02e8610269e61b341331661515616451cec929fd534fa96d1c4f47fbcc9a";
|
|
128
128
|
var TYPESCRIPT_VERSION = "7.0.2";
|
|
129
129
|
var TYPESCRIPT_ASSET_PATH = `/toolchains/typescript-${TYPESCRIPT_VERSION}.wasm.gz.bin`;
|
|
130
|
-
var TYPESCRIPT_ASSET_SHA256 = "
|
|
130
|
+
var TYPESCRIPT_ASSET_SHA256 = "29c6ee0e46151e2644049ae96162b1b1d46dcb13310e2a928114bb9030c3ea92";
|
|
131
131
|
var RUST_VERSION = "1.91.1-dev";
|
|
132
132
|
var RUST_PACKAGE_ASSET_PATH = `/toolchains/rust-${RUST_VERSION}.webc.gz.bin`;
|
|
133
133
|
var RUST_PACKAGE_MANIFEST_ASSET_PATH = `/toolchains/rust-${RUST_VERSION}.manifest.json`;
|
|
@@ -146,16 +146,14 @@ var GO_COMPRESSED_STANDARD_LIBRARY_SHA256 = "aeffc384fdc624544f174ba5fc3c2239571
|
|
|
146
146
|
var GO_STANDARD_LIBRARY_SHA256 = "e1ec64b08efd02b35b7ffdaf3970875aaae98325fa4795eafca94ebae2d0d192";
|
|
147
147
|
var GO_COMPILER_SHA256 = "9e557f5b86961fd604217d7521461c5d2b7322e383fa30dead5669b77db12201";
|
|
148
148
|
var GO_LINKER_SHA256 = "2eefca10af935a307ab7946447146bd30e0ea0fb5460be54dc1c55844d155580";
|
|
149
|
-
var JAVA_VERSION = "teavm-0.13.1-
|
|
149
|
+
var JAVA_VERSION = "teavm-0.13.1-wasmgc-wasip1";
|
|
150
150
|
var JAVA_COMPILER_PACKAGE = `wasm-oj/java-teavm@${JAVA_VERSION}`;
|
|
151
|
-
var JAVA_COMPILER_ASSET_PATH = "/toolchains/java-teavm-0.13.1.
|
|
151
|
+
var JAVA_COMPILER_ASSET_PATH = "/toolchains/java-teavm-0.13.1.compiler.wasm";
|
|
152
152
|
var JAVA_COMPILE_CLASSLIB_ASSET_PATH = "/toolchains/java-teavm-0.13.1.compile-classlib.bin";
|
|
153
153
|
var JAVA_RUNTIME_CLASSLIB_ASSET_PATH = "/toolchains/java-teavm-0.13.1.runtime-classlib.bin";
|
|
154
|
-
var
|
|
155
|
-
var
|
|
156
|
-
var
|
|
157
|
-
var JAVA_COMPILE_CLASSLIB_SHA256 = "acfe3fb09e5f2c0c7c8dc2339c66fcdadc1f8e1bf1c74be446926175ef770868";
|
|
158
|
-
var JAVA_RUNTIME_CLASSLIB_SHA256 = "21a9394586e416af2fca4eb0ed08521cbc8924e1d1afaa07863a59a3cfae54ab";
|
|
154
|
+
var JAVA_COMPILER_SHA256 = "8c37bce1c6fceeaffeffe93e10834309b67c8b6fb58c6f8a24547afe8be67f5d";
|
|
155
|
+
var JAVA_COMPILE_CLASSLIB_SHA256 = "738a82b7d7e7ff8d98b07bb076785da7035847a166afb8446fd150c4efce6103";
|
|
156
|
+
var JAVA_RUNTIME_CLASSLIB_SHA256 = "0ed234b66cdde19cb29e6c2865a3636d792d3cf72f102e73a7b3fdede80b79e6";
|
|
159
157
|
var PINNED_TOOLCHAIN_ASSET_SHA256 = Object.freeze({
|
|
160
158
|
[CLANG_PACKAGE_ASSET_PATH]: CLANG_COMPRESSED_PACKAGE_SHA256,
|
|
161
159
|
[CLANG_CC1_PINS_ASSET_PATH]: CLANG_CC1_PINS_SHA256,
|
|
@@ -172,7 +170,7 @@ var PINNED_TOOLCHAIN_ASSET_SHA256 = Object.freeze({
|
|
|
172
170
|
[GO_PACKAGE_ASSET_PATH]: GO_COMPRESSED_PACKAGE_SHA256,
|
|
173
171
|
[GO_PACKAGE_MANIFEST_ASSET_PATH]: GO_PACKAGE_MANIFEST_SHA256,
|
|
174
172
|
[GO_STANDARD_LIBRARY_ASSET_PATH]: GO_COMPRESSED_STANDARD_LIBRARY_SHA256,
|
|
175
|
-
[JAVA_COMPILER_ASSET_PATH]:
|
|
173
|
+
[JAVA_COMPILER_ASSET_PATH]: JAVA_COMPILER_SHA256,
|
|
176
174
|
[JAVA_COMPILE_CLASSLIB_ASSET_PATH]: JAVA_COMPILE_CLASSLIB_SHA256,
|
|
177
175
|
[JAVA_RUNTIME_CLASSLIB_ASSET_PATH]: JAVA_RUNTIME_CLASSLIB_SHA256
|
|
178
176
|
});
|
|
@@ -215,8 +213,6 @@ var TOOLCHAIN_CONTENT_SHA256 = Object.freeze({
|
|
|
215
213
|
/** Exact executable/compiler content used by cache keys and cost calibration. */
|
|
216
214
|
function toolchainContentIdentity(language) {
|
|
217
215
|
if (language === "java") return [
|
|
218
|
-
JAVA_COMPILER_COMPRESSED_PACKAGE_SHA256,
|
|
219
|
-
JAVA_COMPILER_PACKAGE_SHA256,
|
|
220
216
|
JAVA_COMPILER_SHA256,
|
|
221
217
|
JAVA_COMPILE_CLASSLIB_SHA256,
|
|
222
218
|
JAVA_RUNTIME_CLASSLIB_SHA256
|
|
@@ -267,7 +263,7 @@ var TOOLCHAINS = Object.freeze({
|
|
|
267
263
|
runtimePackage: PYTHON_PACKAGE,
|
|
268
264
|
targets: ["wasip1"],
|
|
269
265
|
version: PYTHON_VERSION,
|
|
270
|
-
note: "
|
|
266
|
+
note: "Python source files executed by the source-built CPython wasm32-wasip1 interpreter and standard library."
|
|
271
267
|
}),
|
|
272
268
|
javascript: freezeToolchain({
|
|
273
269
|
language: "javascript",
|
|
@@ -351,8 +347,8 @@ async function sha256Hex$1(value) {
|
|
|
351
347
|
//#region src/core/runtime-identity.ts
|
|
352
348
|
/** Executable runtime components covered by deterministic cost calibration. */
|
|
353
349
|
var WASM_OJ_RUNTIME_COMPONENTS = Object.freeze({
|
|
354
|
-
runtimeCoreWasmSha256: "
|
|
355
|
-
runtimeSourceRootSha256: "
|
|
350
|
+
runtimeCoreWasmSha256: "1e297ad276694e9fb8a23afdc6ccc0b2ae56a223ced19d5cae26fe4661daa11e",
|
|
351
|
+
runtimeSourceRootSha256: "27c52cb1887aa8a7e0d8a238514fc8881cf86c68267e2a1691f110423692e2b6",
|
|
356
352
|
wasmerNativeVersion: "7.2.1",
|
|
357
353
|
wasmerSdkVersion: "0.10.0",
|
|
358
354
|
wasmerSdkWasmSha256: "49a6646209f5ab5e7c737eac33407d87d9a9959ac83e5ecaaab9261b2323589e",
|
|
@@ -363,13 +359,13 @@ var WASM_OJ_RUNTIME_COMPONENTS = Object.freeze({
|
|
|
363
359
|
* Release verification independently checks the component bytes before this
|
|
364
360
|
* identity is admitted into a calibrated release.
|
|
365
361
|
*/
|
|
366
|
-
var WASM_OJ_RUNTIME_IDENTITY_SHA256 = "
|
|
362
|
+
var WASM_OJ_RUNTIME_IDENTITY_SHA256 = "d3e44cafdc1c17a7e6bd4591ef04ec8161af805a519b5bbff437b15e5accd442";
|
|
367
363
|
/** Exact canonical serialization hashed by `WASM_OJ_RUNTIME_IDENTITY_SHA256`. */
|
|
368
364
|
function runtimeIdentityBytes() {
|
|
369
365
|
return canonicalJsonBytes(WASM_OJ_RUNTIME_COMPONENTS);
|
|
370
366
|
}
|
|
371
367
|
async function verifyRuntimeIdentity() {
|
|
372
|
-
if (await sha256Hex$1(runtimeIdentityBytes()) !== "
|
|
368
|
+
if (await sha256Hex$1(runtimeIdentityBytes()) !== "d3e44cafdc1c17a7e6bd4591ef04ec8161af805a519b5bbff437b15e5accd442") throw new Error("WASM-OJ runtime identity declaration does not match its digest.");
|
|
373
369
|
}
|
|
374
370
|
//#endregion
|
|
375
371
|
//#region src/core/cost-profile.ts
|
|
@@ -404,12 +400,15 @@ function isCostProfileFor(profile, language, target, optimization) {
|
|
|
404
400
|
//#endregion
|
|
405
401
|
//#region src/core/cost-baselines.ts
|
|
406
402
|
/** Measured weighted cost of an empty Java main for the pinned TeaVM profile. */
|
|
407
|
-
var JAVA_EMPTY_PROGRAM_BASELINE_COST =
|
|
403
|
+
var JAVA_EMPTY_PROGRAM_BASELINE_COST = Object.freeze({
|
|
404
|
+
debug: 2907,
|
|
405
|
+
release: 2419
|
|
406
|
+
});
|
|
408
407
|
var javaContent = toolchainContentIdentity("java");
|
|
409
408
|
/** Default baselines shipped with this exact compiler/runtime distribution. */
|
|
410
409
|
var DEFAULT_COST_BASELINES = Object.freeze({
|
|
411
|
-
[costProfileId("java", "wasip1", "debug", javaContent)]: JAVA_EMPTY_PROGRAM_BASELINE_COST,
|
|
412
|
-
[costProfileId("java", "wasip1", "release", javaContent)]: JAVA_EMPTY_PROGRAM_BASELINE_COST
|
|
410
|
+
[costProfileId("java", "wasip1", "debug", javaContent)]: JAVA_EMPTY_PROGRAM_BASELINE_COST.debug,
|
|
411
|
+
[costProfileId("java", "wasip1", "release", javaContent)]: JAVA_EMPTY_PROGRAM_BASELINE_COST.release
|
|
413
412
|
});
|
|
414
413
|
//#endregion
|
|
415
414
|
//#region src/core/cost.ts
|
|
@@ -511,249 +510,6 @@ function assertNonNegativeMetric(value, label) {
|
|
|
511
510
|
if (!Number.isSafeInteger(value) || value < 0) throw new RangeError(`${label} must be a non-negative safe integer.`);
|
|
512
511
|
}
|
|
513
512
|
//#endregion
|
|
514
|
-
//#region src/release-manifest.ts
|
|
515
|
-
var SHA256$6 = /^[0-9a-f]{64}$/;
|
|
516
|
-
var OCI_DIGEST = /^sha256:[0-9a-f]{64}$/;
|
|
517
|
-
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
518
|
-
var SEMVER = /^[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
519
|
-
var VERSION = /^[0-9A-Za-z][0-9A-Za-z._+-]{0,127}$/;
|
|
520
|
-
var IDENTITY = /^[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,511}$/;
|
|
521
|
-
var WASM_OJ_RELEASE_MANIFEST_SCHEMA = WASM_OJ_SCHEMAS$1.releaseManifest;
|
|
522
|
-
var WASM_OJ_CONTAINER_PROTOCOL_VERSION = "wasm-oj-container-v2";
|
|
523
|
-
function record$5(value, label) {
|
|
524
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError(`${label} must be an object.`);
|
|
525
|
-
return value;
|
|
526
|
-
}
|
|
527
|
-
function exact$4(value, required, optional, label) {
|
|
528
|
-
const allowed = /* @__PURE__ */ new Set([...required, ...optional]);
|
|
529
|
-
if (required.some((key) => !Object.hasOwn(value, key)) || Object.keys(value).some((key) => !allowed.has(key))) throw new TypeError(`${label} has an invalid shape.`);
|
|
530
|
-
}
|
|
531
|
-
function digest$1(value, label) {
|
|
532
|
-
if (typeof value !== "string" || !SHA256$6.test(value)) throw new TypeError(`${label} must be a lowercase SHA-256 digest.`);
|
|
533
|
-
return value;
|
|
534
|
-
}
|
|
535
|
-
function version(value, label) {
|
|
536
|
-
if (typeof value !== "string" || !VERSION.test(value)) throw new TypeError(`${label} is invalid.`);
|
|
537
|
-
return value;
|
|
538
|
-
}
|
|
539
|
-
function artifact(value, label) {
|
|
540
|
-
const item = record$5(value, label);
|
|
541
|
-
exact$4(item, ["bytes", "sha256"], [], label);
|
|
542
|
-
if (!Number.isSafeInteger(item.bytes) || item.bytes < 1) throw new TypeError(`${label}.bytes must be a positive safe integer.`);
|
|
543
|
-
return {
|
|
544
|
-
bytes: item.bytes,
|
|
545
|
-
sha256: digest$1(item.sha256, `${label}.sha256`)
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
function timestamp(value) {
|
|
549
|
-
if (typeof value !== "string" || new Date(value).toISOString() !== value) throw new TypeError("createdAt must be a canonical ISO timestamp.");
|
|
550
|
-
return value;
|
|
551
|
-
}
|
|
552
|
-
function sourceRepository(value) {
|
|
553
|
-
if (typeof value !== "string") throw new TypeError("source.repository must be a GitHub HTTPS URL.");
|
|
554
|
-
let url;
|
|
555
|
-
try {
|
|
556
|
-
url = new URL(value);
|
|
557
|
-
} catch (error) {
|
|
558
|
-
throw new TypeError("source.repository must be a GitHub HTTPS URL.", { cause: error });
|
|
559
|
-
}
|
|
560
|
-
if (url.protocol !== "https:" || url.hostname !== "github.com" || url.username || url.password || url.search || url.hash || url.pathname.split("/").filter(Boolean).length !== 2) throw new TypeError("source.repository must identify one credential-free GitHub repository.");
|
|
561
|
-
return url.toString().replace(/\/$/, "");
|
|
562
|
-
}
|
|
563
|
-
function parseReleaseManifest(value) {
|
|
564
|
-
const manifest = record$5(value, "release manifest");
|
|
565
|
-
exact$4(manifest, [
|
|
566
|
-
"artifacts",
|
|
567
|
-
"build",
|
|
568
|
-
"cost",
|
|
569
|
-
"createdAt",
|
|
570
|
-
"evidence",
|
|
571
|
-
"wasmOjContract",
|
|
572
|
-
"migrations",
|
|
573
|
-
"provenance",
|
|
574
|
-
"releaseId",
|
|
575
|
-
"runtime",
|
|
576
|
-
"schema",
|
|
577
|
-
"source",
|
|
578
|
-
"toolchains",
|
|
579
|
-
"version"
|
|
580
|
-
], [], "release manifest");
|
|
581
|
-
if (manifest.schema !== WASM_OJ_RELEASE_MANIFEST_SCHEMA) throw new TypeError("Release manifest schema is unsupported.");
|
|
582
|
-
if (manifest.wasmOjContract !== WASM_OJ_CONTRACT_VERSION$1) throw new TypeError("Release manifest uses another WASM-OJ contract.");
|
|
583
|
-
if (typeof manifest.releaseId !== "string" || !UUID.test(manifest.releaseId)) throw new TypeError("releaseId must be a UUID.");
|
|
584
|
-
if (typeof manifest.version !== "string" || !SEMVER.test(manifest.version)) throw new TypeError("version must be semantic versioning.");
|
|
585
|
-
const source = record$5(manifest.source, "source");
|
|
586
|
-
exact$4(source, [
|
|
587
|
-
"commit",
|
|
588
|
-
"repository",
|
|
589
|
-
"sourceTreeSha256"
|
|
590
|
-
], ["tag"], "source");
|
|
591
|
-
if (typeof source.commit !== "string" || !/^[0-9a-f]{40}$/.test(source.commit)) throw new TypeError("source.commit must be an exact Git commit SHA.");
|
|
592
|
-
if (source.tag !== void 0 && (typeof source.tag !== "string" || !VERSION.test(source.tag))) throw new TypeError("source.tag is invalid.");
|
|
593
|
-
const build = record$5(manifest.build, "build");
|
|
594
|
-
exact$4(build, [
|
|
595
|
-
"auditSha256",
|
|
596
|
-
"licensesSha256",
|
|
597
|
-
"lockSha256",
|
|
598
|
-
"nodeVersion",
|
|
599
|
-
"pnpmVersion",
|
|
600
|
-
"rustVersion",
|
|
601
|
-
"sbomSha256"
|
|
602
|
-
], [], "build");
|
|
603
|
-
const artifacts = record$5(manifest.artifacts, "artifacts");
|
|
604
|
-
exact$4(artifacts, [
|
|
605
|
-
"containerImage",
|
|
606
|
-
"npmPackage",
|
|
607
|
-
"staticAssets",
|
|
608
|
-
"workerBundle"
|
|
609
|
-
], [], "artifacts");
|
|
610
|
-
const container = record$5(artifacts.containerImage, "artifacts.containerImage");
|
|
611
|
-
exact$4(container, [
|
|
612
|
-
"baseImages",
|
|
613
|
-
"digest",
|
|
614
|
-
"dockerfileSha256",
|
|
615
|
-
"identitySha256",
|
|
616
|
-
"platform",
|
|
617
|
-
"registry"
|
|
618
|
-
], [], "artifacts.containerImage");
|
|
619
|
-
if (typeof container.registry !== "string" || !IDENTITY.test(container.registry)) throw new TypeError("Container registry identity is invalid.");
|
|
620
|
-
if (typeof container.digest !== "string" || !OCI_DIGEST.test(container.digest) || container.platform !== "linux/amd64") throw new TypeError("Container image identity is invalid.");
|
|
621
|
-
if (!Array.isArray(container.baseImages) || container.baseImages.length !== 3) throw new TypeError("Container base image inventory is invalid.");
|
|
622
|
-
const expectedStages = [
|
|
623
|
-
"node-build",
|
|
624
|
-
"rust-build",
|
|
625
|
-
"judge"
|
|
626
|
-
];
|
|
627
|
-
const baseImages = container.baseImages.map((value, index) => {
|
|
628
|
-
const base = record$5(value, `container base image ${index}`);
|
|
629
|
-
exact$4(base, [
|
|
630
|
-
"digest",
|
|
631
|
-
"image",
|
|
632
|
-
"stage"
|
|
633
|
-
], [], `container base image ${index}`);
|
|
634
|
-
if (base.stage !== expectedStages[index] || typeof base.image !== "string" || !IDENTITY.test(base.image) || typeof base.digest !== "string" || !OCI_DIGEST.test(base.digest)) throw new TypeError("Container base image inventory is invalid.");
|
|
635
|
-
return {
|
|
636
|
-
stage: base.stage,
|
|
637
|
-
image: base.image,
|
|
638
|
-
digest: base.digest
|
|
639
|
-
};
|
|
640
|
-
});
|
|
641
|
-
const runtime = record$5(manifest.runtime, "runtime");
|
|
642
|
-
exact$4(runtime, [
|
|
643
|
-
"compilerSha256",
|
|
644
|
-
"executionRootSha256",
|
|
645
|
-
"protocolVersion",
|
|
646
|
-
"rootSha256",
|
|
647
|
-
"runnerSha256",
|
|
648
|
-
"runtimeCoreSha256",
|
|
649
|
-
"runtimeIdentitySha256",
|
|
650
|
-
"wasmerSha256",
|
|
651
|
-
"wasmerVersion"
|
|
652
|
-
], [], "runtime");
|
|
653
|
-
if (runtime.protocolVersion !== "wasm-oj-container-v2") throw new TypeError("Container protocol is unsupported.");
|
|
654
|
-
if (runtime.runtimeIdentitySha256 !== "24c0bcff9820fbfd1fd4db1c57e2a866b83041409dd22b5b725688739bd3e223") throw new TypeError("Release runtime identity does not match this WASM-OJ build.");
|
|
655
|
-
const toolchains = record$5(manifest.toolchains, "toolchains");
|
|
656
|
-
exact$4(toolchains, ["manifestSha256", "rootSha256"], [], "toolchains");
|
|
657
|
-
const cost = record$5(manifest.cost, "cost");
|
|
658
|
-
exact$4(cost, [
|
|
659
|
-
"baselineSha256",
|
|
660
|
-
"model",
|
|
661
|
-
"profileRootSha256"
|
|
662
|
-
], [], "cost");
|
|
663
|
-
if (cost.model !== "weighted") throw new TypeError("Release cost model is unsupported.");
|
|
664
|
-
const evidence = record$5(manifest.evidence, "evidence");
|
|
665
|
-
exact$4(evidence, [
|
|
666
|
-
"conformanceSha256",
|
|
667
|
-
"costCalibrationSha256",
|
|
668
|
-
"testsSha256"
|
|
669
|
-
], [], "evidence");
|
|
670
|
-
const migrations = record$5(manifest.migrations, "migrations");
|
|
671
|
-
exact$4(migrations, ["databaseSha256"], [], "migrations");
|
|
672
|
-
const provenance = record$5(manifest.provenance, "provenance");
|
|
673
|
-
exact$4(provenance, ["issuer", "subject"], [], "provenance");
|
|
674
|
-
if (typeof provenance.issuer !== "string" || !IDENTITY.test(provenance.issuer) || typeof provenance.subject !== "string" || !IDENTITY.test(provenance.subject)) throw new TypeError("Release provenance identity is invalid.");
|
|
675
|
-
return {
|
|
676
|
-
schema: WASM_OJ_RELEASE_MANIFEST_SCHEMA,
|
|
677
|
-
releaseId: manifest.releaseId,
|
|
678
|
-
version: manifest.version,
|
|
679
|
-
wasmOjContract: WASM_OJ_CONTRACT_VERSION$1,
|
|
680
|
-
createdAt: timestamp(manifest.createdAt),
|
|
681
|
-
source: {
|
|
682
|
-
repository: sourceRepository(source.repository),
|
|
683
|
-
commit: source.commit,
|
|
684
|
-
sourceTreeSha256: digest$1(source.sourceTreeSha256, "source.sourceTreeSha256"),
|
|
685
|
-
...source.tag === void 0 ? {} : { tag: source.tag }
|
|
686
|
-
},
|
|
687
|
-
build: {
|
|
688
|
-
nodeVersion: version(build.nodeVersion, "build.nodeVersion"),
|
|
689
|
-
pnpmVersion: version(build.pnpmVersion, "build.pnpmVersion"),
|
|
690
|
-
rustVersion: version(build.rustVersion, "build.rustVersion"),
|
|
691
|
-
lockSha256: digest$1(build.lockSha256, "build.lockSha256"),
|
|
692
|
-
sbomSha256: digest$1(build.sbomSha256, "build.sbomSha256"),
|
|
693
|
-
licensesSha256: digest$1(build.licensesSha256, "build.licensesSha256"),
|
|
694
|
-
auditSha256: digest$1(build.auditSha256, "build.auditSha256")
|
|
695
|
-
},
|
|
696
|
-
artifacts: {
|
|
697
|
-
npmPackage: artifact(artifacts.npmPackage, "artifacts.npmPackage"),
|
|
698
|
-
workerBundle: artifact(artifacts.workerBundle, "artifacts.workerBundle"),
|
|
699
|
-
staticAssets: artifact(artifacts.staticAssets, "artifacts.staticAssets"),
|
|
700
|
-
containerImage: {
|
|
701
|
-
registry: container.registry,
|
|
702
|
-
digest: container.digest,
|
|
703
|
-
identitySha256: digest$1(container.identitySha256, "artifacts.containerImage.identitySha256"),
|
|
704
|
-
platform: "linux/amd64",
|
|
705
|
-
dockerfileSha256: digest$1(container.dockerfileSha256, "artifacts.containerImage.dockerfileSha256"),
|
|
706
|
-
baseImages
|
|
707
|
-
}
|
|
708
|
-
},
|
|
709
|
-
runtime: {
|
|
710
|
-
protocolVersion: WASM_OJ_CONTAINER_PROTOCOL_VERSION,
|
|
711
|
-
executionRootSha256: digest$1(runtime.executionRootSha256, "runtime.executionRootSha256"),
|
|
712
|
-
rootSha256: digest$1(runtime.rootSha256, "runtime.rootSha256"),
|
|
713
|
-
runtimeIdentitySha256: WASM_OJ_RUNTIME_IDENTITY_SHA256,
|
|
714
|
-
runtimeCoreSha256: digest$1(runtime.runtimeCoreSha256, "runtime.runtimeCoreSha256"),
|
|
715
|
-
wasmerVersion: version(runtime.wasmerVersion, "runtime.wasmerVersion"),
|
|
716
|
-
wasmerSha256: digest$1(runtime.wasmerSha256, "runtime.wasmerSha256"),
|
|
717
|
-
compilerSha256: digest$1(runtime.compilerSha256, "runtime.compilerSha256"),
|
|
718
|
-
runnerSha256: digest$1(runtime.runnerSha256, "runtime.runnerSha256")
|
|
719
|
-
},
|
|
720
|
-
toolchains: {
|
|
721
|
-
rootSha256: digest$1(toolchains.rootSha256, "toolchains.rootSha256"),
|
|
722
|
-
manifestSha256: digest$1(toolchains.manifestSha256, "toolchains.manifestSha256")
|
|
723
|
-
},
|
|
724
|
-
cost: {
|
|
725
|
-
model: WEIGHTED_METER_MODEL,
|
|
726
|
-
profileRootSha256: digest$1(cost.profileRootSha256, "cost.profileRootSha256"),
|
|
727
|
-
baselineSha256: digest$1(cost.baselineSha256, "cost.baselineSha256")
|
|
728
|
-
},
|
|
729
|
-
evidence: {
|
|
730
|
-
conformanceSha256: digest$1(evidence.conformanceSha256, "evidence.conformanceSha256"),
|
|
731
|
-
testsSha256: digest$1(evidence.testsSha256, "evidence.testsSha256"),
|
|
732
|
-
costCalibrationSha256: digest$1(evidence.costCalibrationSha256, "evidence.costCalibrationSha256")
|
|
733
|
-
},
|
|
734
|
-
migrations: { databaseSha256: digest$1(migrations.databaseSha256, "migrations.databaseSha256") },
|
|
735
|
-
provenance: {
|
|
736
|
-
issuer: provenance.issuer,
|
|
737
|
-
subject: provenance.subject
|
|
738
|
-
}
|
|
739
|
-
};
|
|
740
|
-
}
|
|
741
|
-
function createReleaseManifest(value) {
|
|
742
|
-
return parseReleaseManifest(value);
|
|
743
|
-
}
|
|
744
|
-
function releaseManifestBytes(value) {
|
|
745
|
-
return canonicalJsonBytes(parseReleaseManifest(value));
|
|
746
|
-
}
|
|
747
|
-
async function releaseManifestSha256(value) {
|
|
748
|
-
return sha256Hex$1(releaseManifestBytes(value));
|
|
749
|
-
}
|
|
750
|
-
async function verifyReleaseManifestBytes(bytes, expectedSha256) {
|
|
751
|
-
if (expectedSha256 !== void 0) {
|
|
752
|
-
if (digest$1(expectedSha256, "expected release manifest digest") !== await sha256Hex$1(bytes)) throw new TypeError("Release manifest bytes do not match the expected digest.");
|
|
753
|
-
}
|
|
754
|
-
return parseReleaseManifest(parseCanonicalJsonBytes(bytes, "release manifest"));
|
|
755
|
-
}
|
|
756
|
-
//#endregion
|
|
757
513
|
//#region src/core/project-files.ts
|
|
758
514
|
var PROJECT_SOURCE_LIMITS = Object.freeze({
|
|
759
515
|
files: 256,
|
|
@@ -807,7 +563,7 @@ function canonicalFileEntries(files) {
|
|
|
807
563
|
//#endregion
|
|
808
564
|
//#region src/core/dependencies.ts
|
|
809
565
|
var MIB = 1048576;
|
|
810
|
-
var SHA256$
|
|
566
|
+
var SHA256$3 = /^[0-9a-f]{64}$/;
|
|
811
567
|
/** Contract-level admission limits shared by dependency hosts and compilers. */
|
|
812
568
|
var DEPENDENCY_RESOLUTION_LIMITS = Object.freeze({
|
|
813
569
|
requirements: 128,
|
|
@@ -999,7 +755,7 @@ function assertSortedUnique(values, label) {
|
|
|
999
755
|
for (let index = 1; index < values.length; index += 1) if (values[index - 1] >= values[index]) throw new Error(`${label} must be sorted and unique.`);
|
|
1000
756
|
}
|
|
1001
757
|
function requireSha256$2(value, label) {
|
|
1002
|
-
if (typeof value !== "string" || !SHA256$
|
|
758
|
+
if (typeof value !== "string" || !SHA256$3.test(value)) throw new Error(`${label} SHA-256 must be lowercase hexadecimal.`);
|
|
1003
759
|
}
|
|
1004
760
|
function isRecord$4(value) {
|
|
1005
761
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -1235,7 +991,7 @@ function expectedBuiltinArtifactName(project) {
|
|
|
1235
991
|
function expectedRuntimeEntry(project) {
|
|
1236
992
|
if (project.config.language === "python") {
|
|
1237
993
|
if (!project.config.entry.endsWith(".py")) throw new Error("Python entry files must end in '.py'.");
|
|
1238
|
-
return
|
|
994
|
+
return project.config.entry;
|
|
1239
995
|
}
|
|
1240
996
|
if (project.config.language === "typescript") {
|
|
1241
997
|
if (!project.config.entry.endsWith(".ts")) throw new Error("TypeScript entry files must end in '.ts'.");
|
|
@@ -4808,14 +4564,14 @@ var WASM_OJ_LIBCXX_PCH_HEADER = `#pragma once
|
|
|
4808
4564
|
var decoder = new TextDecoder();
|
|
4809
4565
|
async function decodeLibcxxPchManifest(bytes) {
|
|
4810
4566
|
const digest = await sha256Hex$1(bytes);
|
|
4811
|
-
if (digest !== "
|
|
4567
|
+
if (digest !== "9bbe41d77c786f1c36169369c909268530b05726e1581683f6edd9a2983eebd0") throw new Error(`Pinned libc++ PCH manifest digest mismatch: expected ${CLANG_LIBCXX_PCH_MANIFEST_SHA256}, received ${digest}.`);
|
|
4812
4568
|
let value;
|
|
4813
4569
|
try {
|
|
4814
4570
|
value = JSON.parse(decoder.decode(bytes));
|
|
4815
4571
|
} catch (error) {
|
|
4816
4572
|
throw new Error("Pinned libc++ PCH manifest is not valid JSON.", { cause: error });
|
|
4817
4573
|
}
|
|
4818
|
-
if (!isRecord$2(value) || value.schema !== WASM_OJ_SCHEMAS$1.clangLibcxxPch || value.version !== "22.0.0-git20542-10" || value.clangPackageSha256 !== "21ded33b9c6d4e1aaad5528c940bdaf6c3e84be77ea8f522f018ca7289a2a224" || value.clangPinsSha256 !== "
|
|
4574
|
+
if (!isRecord$2(value) || value.schema !== WASM_OJ_SCHEMAS$1.clangLibcxxPch || value.version !== "22.0.0-git20542-10" || value.clangPackageSha256 !== "21ded33b9c6d4e1aaad5528c940bdaf6c3e84be77ea8f522f018ca7289a2a224" || value.clangPinsSha256 !== "895eee17c63b1112c84adcc4ddbcb38e0c18e53bff15f50a8689b9b82d87b1ff" || value.header !== WASM_OJ_LIBCXX_PCH_HEADER || !isRecord$2(value.profiles)) throw new Error("Pinned libc++ PCH manifest is not admitted by the active Clang toolchain contract.");
|
|
4819
4575
|
if (value.headerSha256 !== await sha256Hex$1(WASM_OJ_LIBCXX_PCH_HEADER)) throw new Error("Pinned libc++ PCH header digest does not match its canonical source.");
|
|
4820
4576
|
const manifestProfiles = value.profiles;
|
|
4821
4577
|
const profiles = Object.fromEntries(await Promise.all(["cpp-debug", "cpp-release"].map(async (profile) => {
|
|
@@ -5012,6 +4768,9 @@ function assertCompilerContract(compiler) {
|
|
|
5012
4768
|
"dispose"
|
|
5013
4769
|
]) if (typeof compiler[method] !== "function") throw new TypeError(`Compiler must implement ${method}().`);
|
|
5014
4770
|
}
|
|
4771
|
+
//#endregion
|
|
4772
|
+
//#region src/runtime/quickjs/stdlib.generated.ts
|
|
4773
|
+
var QUICKJS_NODE_STDLIB = "var __nodeStdio=(function(nt){Object.defineProperty(nt,Symbol.toStringTag,{value:\"Module\"});var jt=Object.create,Ge=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyNames,qt=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty,Ht=(E,d,s)=>()=>{if(s)throw s[0];try{return E&&(d=E(E=0)),d}catch(c){throw s=[c],c}},Ee=(E,d)=>()=>(d||(E((d={exports:{}}).exports,d),E=null),d.exports),Gt=(E,d)=>{let s={};for(var c in E)Ge(s,c,{get:E[c],enumerable:!0});return d||Ge(s,Symbol.toStringTag,{value:\"Module\"}),s},gt=(E,d,s,c)=>{if(d&&typeof d==\"object\"||typeof d==\"function\")for(var _=$t(d),A=0,R=_.length,n;A<R;A++)n=_[A],!it.call(E,n)&&n!==s&&Ge(E,n,{get:(C=>d[C]).bind(null,n),enumerable:!(c=Ft(d,n))||c.enumerable});return E},Vt=(E,d,s)=>(s=E!=null?jt(qt(E)):{},gt(d||!E||!E.__esModule||!it.call(E,\"default\")?Ge(s,\"default\",{value:E,enumerable:!0}):s,E)),Yt=E=>it.call(E,\"module.exports\")?E[\"module.exports\"]:gt(Ge({},\"__esModule\",{value:!0}),E),Kt=Ee((E=>{E.byteLength=C,E.toByteArray=W,E.fromByteArray=$;for(var d=[],s=[],c=typeof Uint8Array<\"u\"?Uint8Array:Array,_=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",A=0,R=_.length;A<R;++A)d[A]=_[A],s[_.charCodeAt(A)]=A;s[45]=62,s[95]=63;function n(P){var Y=P.length;if(Y%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var k=P.indexOf(\"=\");k===-1&&(k=Y);var D=k===Y?0:4-k%4;return[k,D]}function C(P){var Y=n(P),k=Y[0],D=Y[1];return(k+D)*3/4-D}function T(P,Y,k){return(Y+k)*3/4-k}function W(P){var Y,k=n(P),D=k[0],l=k[1],w=new c(T(P,D,l)),S=0,y=l>0?D-4:D,f;for(f=0;f<y;f+=4)Y=s[P.charCodeAt(f)]<<18|s[P.charCodeAt(f+1)]<<12|s[P.charCodeAt(f+2)]<<6|s[P.charCodeAt(f+3)],w[S++]=Y>>16&255,w[S++]=Y>>8&255,w[S++]=Y&255;return l===2&&(Y=s[P.charCodeAt(f)]<<2|s[P.charCodeAt(f+1)]>>4,w[S++]=Y&255),l===1&&(Y=s[P.charCodeAt(f)]<<10|s[P.charCodeAt(f+1)]<<4|s[P.charCodeAt(f+2)]>>2,w[S++]=Y>>8&255,w[S++]=Y&255),w}function L(P){return d[P>>18&63]+d[P>>12&63]+d[P>>6&63]+d[P&63]}function O(P,Y,k){for(var D,l=[],w=Y;w<k;w+=3)D=(P[w]<<16&16711680)+(P[w+1]<<8&65280)+(P[w+2]&255),l.push(L(D));return l.join(\"\")}function $(P){for(var Y,k=P.length,D=k%3,l=[],w=16383,S=0,y=k-D;S<y;S+=w)l.push(O(P,S,S+w>y?y:S+w));return D===1?(Y=P[k-1],l.push(d[Y>>2]+d[Y<<4&63]+\"==\")):D===2&&(Y=(P[k-2]<<8)+P[k-1],l.push(d[Y>>10]+d[Y>>4&63]+d[Y<<2&63]+\"=\")),l.join(\"\")}})),zt=Ee((E=>{E.read=function(d,s,c,_,A){var R,n,C=A*8-_-1,T=(1<<C)-1,W=T>>1,L=-7,O=c?A-1:0,$=c?-1:1,P=d[s+O];for(O+=$,R=P&(1<<-L)-1,P>>=-L,L+=C;L>0;R=R*256+d[s+O],O+=$,L-=8);for(n=R&(1<<-L)-1,R>>=-L,L+=_;L>0;n=n*256+d[s+O],O+=$,L-=8);if(R===0)R=1-W;else{if(R===T)return n?NaN:(P?-1:1)*(1/0);n=n+Math.pow(2,_),R=R-W}return(P?-1:1)*n*Math.pow(2,R-_)},E.write=function(d,s,c,_,A,R){var n,C,T,W=R*8-A-1,L=(1<<W)-1,O=L>>1,$=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=_?0:R-1,Y=_?1:-1,k=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(C=isNaN(s)?1:0,n=L):(n=Math.floor(Math.log(s)/Math.LN2),s*(T=Math.pow(2,-n))<1&&(n--,T*=2),n+O>=1?s+=$/T:s+=$*Math.pow(2,1-O),s*T>=2&&(n++,T/=2),n+O>=L?(C=0,n=L):n+O>=1?(C=(s*T-1)*Math.pow(2,A),n=n+O):(C=s*Math.pow(2,O-1)*Math.pow(2,A),n=0));A>=8;d[c+P]=C&255,P+=Y,C/=256,A-=8);for(n=n<<A|C,W+=A;W>0;d[c+P]=n&255,P+=Y,n/=256,W-=8);d[c+P-Y]|=k*128}})),Oe=Ee((E=>{var d=Kt(),s=zt(),c=typeof Symbol==\"function\"&&typeof Symbol.for==\"function\"?Symbol.for(\"nodejs.util.inspect.custom\"):null;E.Buffer=n,E.SlowBuffer=l,E.INSPECT_MAX_BYTES=50;var _=2147483647;E.kMaxLength=_,n.TYPED_ARRAY_SUPPORT=A(),!n.TYPED_ARRAY_SUPPORT&&typeof console<\"u\"&&typeof console.error==\"function\"&&console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\");function A(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(n.prototype,\"parent\",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,\"offset\",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}});function R(r){if(r>_)throw new RangeError('The value \"'+r+'\" is invalid for option \"size\"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,n.prototype),e}function n(r,e,t){if(typeof r==\"number\"){if(typeof e==\"string\")throw new TypeError('The \"string\" argument must be of type string. Received type number');return L(r)}return C(r,e,t)}n.poolSize=8192;function C(r,e,t){if(typeof r==\"string\")return O(r,e);if(ArrayBuffer.isView(r))return P(r);if(r==null)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof r);if(q(r,ArrayBuffer)||r&&q(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<\"u\"&&(q(r,SharedArrayBuffer)||r&&q(r.buffer,SharedArrayBuffer)))return Y(r,e,t);if(typeof r==\"number\")throw new TypeError('The \"value\" argument must not be of type number. Received type number');const i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return n.from(i,e,t);const p=k(r);if(p)return p;if(typeof Symbol<\"u\"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]==\"function\")return n.from(r[Symbol.toPrimitive](\"string\"),e,t);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof r)}n.from=function(r,e,t){return C(r,e,t)},Object.setPrototypeOf(n.prototype,Uint8Array.prototype),Object.setPrototypeOf(n,Uint8Array);function T(r){if(typeof r!=\"number\")throw new TypeError('\"size\" argument must be of type number');if(r<0)throw new RangeError('The value \"'+r+'\" is invalid for option \"size\"')}function W(r,e,t){return T(r),r<=0?R(r):e!==void 0?typeof t==\"string\"?R(r).fill(e,t):R(r).fill(e):R(r)}n.alloc=function(r,e,t){return W(r,e,t)};function L(r){return T(r),R(r<0?0:D(r)|0)}n.allocUnsafe=function(r){return L(r)},n.allocUnsafeSlow=function(r){return L(r)};function O(r,e){if((typeof e!=\"string\"||e===\"\")&&(e=\"utf8\"),!n.isEncoding(e))throw new TypeError(\"Unknown encoding: \"+e);const t=w(r,e)|0;let i=R(t);const p=i.write(r,e);return p!==t&&(i=i.slice(0,p)),i}function $(r){const e=r.length<0?0:D(r.length)|0,t=R(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}function P(r){if(q(r,Uint8Array)){const e=new Uint8Array(r);return Y(e.buffer,e.byteOffset,e.byteLength)}return $(r)}function Y(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('\"offset\" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('\"length\" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,n.prototype),i}function k(r){if(n.isBuffer(r)){const e=D(r.length)|0,t=R(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!=\"number\"||oe(r.length)?R(0):$(r);if(r.type===\"Buffer\"&&Array.isArray(r.data))return $(r.data)}function D(r){if(r>=_)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+_.toString(16)+\" bytes\");return r|0}function l(r){return+r!=r&&(r=0),n.alloc(+r)}n.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==n.prototype},n.compare=function(e,t){if(q(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),!n.isBuffer(e)||!n.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,p=t.length;for(let B=0,j=Math.min(i,p);B<j;++B)if(e[B]!==t[B]){i=e[B],p=t[B];break}return i<p?-1:p<i?1:0},n.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},n.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(e.length===0)return n.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const p=n.allocUnsafe(t);let B=0;for(i=0;i<e.length;++i){let j=e[i];if(q(j,Uint8Array))B+j.length>p.length?(n.isBuffer(j)||(j=n.from(j)),j.copy(p,B)):Uint8Array.prototype.set.call(p,j,B);else if(n.isBuffer(j))j.copy(p,B);else throw new TypeError('\"list\" argument must be an Array of Buffers');B+=j.length}return p};function w(r,e){if(n.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||q(r,ArrayBuffer))return r.byteLength;if(typeof r!=\"string\")throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let p=!1;for(;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return t;case\"utf8\":case\"utf-8\":return M(r).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return t*2;case\"hex\":return t>>>1;case\"base64\":return Z(r).length;default:if(p)return i?-1:M(r).length;e=(\"\"+e).toLowerCase(),p=!0}}n.byteLength=w;function S(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return\"\";for(r||(r=\"utf8\");;)switch(r){case\"hex\":return _e(this,e,t);case\"utf8\":case\"utf-8\":return V(this,e,t);case\"ascii\":return se(this,e,t);case\"latin1\":case\"binary\":return he(this,e,t);case\"base64\":return N(this,e,t);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return H(this,e,t);default:if(i)throw new TypeError(\"Unknown encoding: \"+r);r=(r+\"\").toLowerCase(),i=!0}}n.prototype._isBuffer=!0;function y(r,e,t){const i=r[e];r[e]=r[t],r[t]=i}n.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},n.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},n.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},n.prototype.toString=function(){const e=this.length;return e===0?\"\":arguments.length===0?V(this,0,e):S.apply(this,arguments)},n.prototype.toLocaleString=n.prototype.toString,n.prototype.equals=function(e){if(!n.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e?!0:n.compare(this,e)===0},n.prototype.inspect=function(){let e=\"\";const t=E.INSPECT_MAX_BYTES;return e=this.toString(\"hex\",0,t).replace(/(.{2})/g,\"$1 \").trim(),this.length>t&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},c&&(n.prototype[c]=n.prototype.inspect),n.prototype.compare=function(e,t,i,p,B){if(q(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),p===void 0&&(p=0),B===void 0&&(B=this.length),t<0||i>e.length||p<0||B>this.length)throw new RangeError(\"out of range index\");if(p>=B&&t>=i)return 0;if(p>=B)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,p>>>=0,B>>>=0,this===e)return 0;let j=B-p,ge=i-t;const Re=Math.min(j,ge),me=this.slice(p,B),Te=e.slice(t,i);for(let Se=0;Se<Re;++Se)if(me[Se]!==Te[Se]){j=me[Se],ge=Te[Se];break}return j<ge?-1:ge<j?1:0};function f(r,e,t,i,p){if(r.length===0)return-1;if(typeof t==\"string\"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,oe(t)&&(t=p?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(p)return-1;t=r.length-1}else if(t<0)if(p)t=0;else return-1;if(typeof e==\"string\"&&(e=n.from(e,i)),n.isBuffer(e))return e.length===0?-1:h(r,e,t,i,p);if(typeof e==\"number\")return e=e&255,typeof Uint8Array.prototype.indexOf==\"function\"?p?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):h(r,[e],t,i,p);throw new TypeError(\"val must be string, number or Buffer\")}function h(r,e,t,i,p){let B=1,j=r.length,ge=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i===\"ucs2\"||i===\"ucs-2\"||i===\"utf16le\"||i===\"utf-16le\")){if(r.length<2||e.length<2)return-1;B=2,j/=2,ge/=2,t/=2}function Re(Te,Se){return B===1?Te[Se]:Te.readUInt16BE(Se*B)}let me;if(p){let Te=-1;for(me=t;me<j;me++)if(Re(r,me)===Re(e,Te===-1?0:me-Te)){if(Te===-1&&(Te=me),me-Te+1===ge)return Te*B}else Te!==-1&&(me-=me-Te),Te=-1}else for(t+ge>j&&(t=j-ge),me=t;me>=0;me--){let Te=!0;for(let Se=0;Se<ge;Se++)if(Re(r,me+Se)!==Re(e,Se)){Te=!1;break}if(Te)return me}return-1}n.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1},n.prototype.indexOf=function(e,t,i){return f(this,e,t,i,!0)},n.prototype.lastIndexOf=function(e,t,i){return f(this,e,t,i,!1)};function x(r,e,t,i){t=Number(t)||0;const p=r.length-t;i?(i=Number(i),i>p&&(i=p)):i=p;const B=e.length;i>B/2&&(i=B/2);let j;for(j=0;j<i;++j){const ge=parseInt(e.substr(j*2,2),16);if(oe(ge))return j;r[t+j]=ge}return j}function z(r,e,t,i){return b(M(e,r.length-t),r,t,i)}function U(r,e,t,i){return b(Q(e),r,t,i)}function ue(r,e,t,i){return b(Z(e),r,t,i)}function m(r,e,t,i){return b(ee(e,r.length-t),r,t,i)}n.prototype.write=function(e,t,i,p){if(t===void 0)p=\"utf8\",i=this.length,t=0;else if(i===void 0&&typeof t==\"string\")p=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,p===void 0&&(p=\"utf8\")):(p=i,i=void 0);else throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");const B=this.length-t;if((i===void 0||i>B)&&(i=B),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");p||(p=\"utf8\");let j=!1;for(;;)switch(p){case\"hex\":return x(this,e,t,i);case\"utf8\":case\"utf-8\":return z(this,e,t,i);case\"ascii\":case\"latin1\":case\"binary\":return U(this,e,t,i);case\"base64\":return ue(this,e,t,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return m(this,e,t,i);default:if(j)throw new TypeError(\"Unknown encoding: \"+p);p=(\"\"+p).toLowerCase(),j=!0}},n.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};function N(r,e,t){return e===0&&t===r.length?d.fromByteArray(r):d.fromByteArray(r.slice(e,t))}function V(r,e,t){t=Math.min(r.length,t);const i=[];let p=e;for(;p<t;){const B=r[p];let j=null,ge=B>239?4:B>223?3:B>191?2:1;if(p+ge<=t){let Re,me,Te,Se;switch(ge){case 1:B<128&&(j=B);break;case 2:Re=r[p+1],(Re&192)===128&&(Se=(B&31)<<6|Re&63,Se>127&&(j=Se));break;case 3:Re=r[p+1],me=r[p+2],(Re&192)===128&&(me&192)===128&&(Se=(B&15)<<12|(Re&63)<<6|me&63,Se>2047&&(Se<55296||Se>57343)&&(j=Se));break;case 4:Re=r[p+1],me=r[p+2],Te=r[p+3],(Re&192)===128&&(me&192)===128&&(Te&192)===128&&(Se=(B&15)<<18|(Re&63)<<12|(me&63)<<6|Te&63,Se>65535&&Se<1114112&&(j=Se))}}j===null?(j=65533,ge=1):j>65535&&(j-=65536,i.push(j>>>10&1023|55296),j=56320|j&1023),i.push(j),p+=ge}return ae(i)}var I=4096;function ae(r){const e=r.length;if(e<=I)return String.fromCharCode.apply(String,r);let t=\"\",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=I));return t}function se(r,e,t){let i=\"\";t=Math.min(r.length,t);for(let p=e;p<t;++p)i+=String.fromCharCode(r[p]&127);return i}function he(r,e,t){let i=\"\";t=Math.min(r.length,t);for(let p=e;p<t;++p)i+=String.fromCharCode(r[p]);return i}function _e(r,e,t){const i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let p=\"\";for(let B=e;B<t;++B)p+=J[r[B]];return p}function H(r,e,t){const i=r.slice(e,t);let p=\"\";for(let B=0;B<i.length-1;B+=2)p+=String.fromCharCode(i[B]+i[B+1]*256);return p}n.prototype.slice=function(e,t){const i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);const p=this.subarray(e,t);return Object.setPrototypeOf(p,n.prototype),p};function ie(r,e,t){if(r%1!==0||r<0)throw new RangeError(\"offset is not uint\");if(r+e>t)throw new RangeError(\"Trying to access beyond buffer length\")}n.prototype.readUintLE=n.prototype.readUIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||ie(e,t,this.length);let p=this[e],B=1,j=0;for(;++j<t&&(B*=256);)p+=this[e+j]*B;return p},n.prototype.readUintBE=n.prototype.readUIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||ie(e,t,this.length);let p=this[e+--t],B=1;for(;t>0&&(B*=256);)p+=this[e+--t]*B;return p},n.prototype.readUint8=n.prototype.readUInt8=function(e,t){return e=e>>>0,t||ie(e,1,this.length),this[e]},n.prototype.readUint16LE=n.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||ie(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUint16BE=n.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||ie(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUint32LE=n.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},n.prototype.readUint32BE=n.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readBigUInt64LE=fe(function(e){e=e>>>0,pe(e,\"offset\");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ye(e,this.length-8);const p=t+this[++e]*256+this[++e]*2**16+this[++e]*2**24,B=this[++e]+this[++e]*256+this[++e]*2**16+i*2**24;return BigInt(p)+(BigInt(B)<<BigInt(32))}),n.prototype.readBigUInt64BE=fe(function(e){e=e>>>0,pe(e,\"offset\");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ye(e,this.length-8);const p=t*2**24+this[++e]*2**16+this[++e]*256+this[++e],B=this[++e]*2**24+this[++e]*2**16+this[++e]*256+i;return(BigInt(p)<<BigInt(32))+BigInt(B)}),n.prototype.readIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||ie(e,t,this.length);let p=this[e],B=1,j=0;for(;++j<t&&(B*=256);)p+=this[e+j]*B;return B*=128,p>=B&&(p-=Math.pow(2,8*t)),p},n.prototype.readIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||ie(e,t,this.length);let p=t,B=1,j=this[e+--p];for(;p>0&&(B*=256);)j+=this[e+--p]*B;return B*=128,j>=B&&(j-=Math.pow(2,8*t)),j},n.prototype.readInt8=function(e,t){return e=e>>>0,t||ie(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},n.prototype.readInt16LE=function(e,t){e=e>>>0,t||ie(e,2,this.length);const i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},n.prototype.readInt16BE=function(e,t){e=e>>>0,t||ie(e,2,this.length);const i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},n.prototype.readInt32LE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readBigInt64LE=fe(function(e){e=e>>>0,pe(e,\"offset\");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ye(e,this.length-8);const p=this[e+4]+this[e+5]*256+this[e+6]*2**16+(i<<24);return(BigInt(p)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*2**16+this[++e]*2**24)}),n.prototype.readBigInt64BE=fe(function(e){e=e>>>0,pe(e,\"offset\");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ye(e,this.length-8);const p=(t<<24)+this[++e]*2**16+this[++e]*256+this[++e];return(BigInt(p)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*256+i)}),n.prototype.readFloatLE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),s.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),s.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||ie(e,8,this.length),s.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||ie(e,8,this.length),s.read(this,e,!1,52,8)};function u(r,e,t,i,p,B){if(!n.isBuffer(r))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(e>p||e<B)throw new RangeError('\"value\" argument is out of bounds');if(t+i>r.length)throw new RangeError(\"Index out of range\")}n.prototype.writeUintLE=n.prototype.writeUIntLE=function(e,t,i,p){if(e=+e,t=t>>>0,i=i>>>0,!p){const ge=Math.pow(2,8*i)-1;u(this,e,t,i,ge,0)}let B=1,j=0;for(this[t]=e&255;++j<i&&(B*=256);)this[t+j]=e/B&255;return t+i},n.prototype.writeUintBE=n.prototype.writeUIntBE=function(e,t,i,p){if(e=+e,t=t>>>0,i=i>>>0,!p){const ge=Math.pow(2,8*i)-1;u(this,e,t,i,ge,0)}let B=i-1,j=1;for(this[t+B]=e&255;--B>=0&&(j*=256);)this[t+B]=e/j&255;return t+i},n.prototype.writeUint8=n.prototype.writeUInt8=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,1,255,0),this[t]=e&255,t+1},n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function X(r,e,t,i,p){ne(e,i,p,r,t,7);let B=Number(e&BigInt(4294967295));r[t++]=B,B=B>>8,r[t++]=B,B=B>>8,r[t++]=B,B=B>>8,r[t++]=B;let j=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=j,j=j>>8,r[t++]=j,j=j>>8,r[t++]=j,j=j>>8,r[t++]=j,t}function le(r,e,t,i,p){ne(e,i,p,r,t,7);let B=Number(e&BigInt(4294967295));r[t+7]=B,B=B>>8,r[t+6]=B,B=B>>8,r[t+5]=B,B=B>>8,r[t+4]=B;let j=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=j,j=j>>8,r[t+2]=j,j=j>>8,r[t+1]=j,j=j>>8,r[t]=j,t+8}n.prototype.writeBigUInt64LE=fe(function(e,t=0){return X(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),n.prototype.writeBigUInt64BE=fe(function(e,t=0){return le(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),n.prototype.writeIntLE=function(e,t,i,p){if(e=+e,t=t>>>0,!p){const Re=Math.pow(2,8*i-1);u(this,e,t,i,Re-1,-Re)}let B=0,j=1,ge=0;for(this[t]=e&255;++B<i&&(j*=256);)e<0&&ge===0&&this[t+B-1]!==0&&(ge=1),this[t+B]=(e/j>>0)-ge&255;return t+i},n.prototype.writeIntBE=function(e,t,i,p){if(e=+e,t=t>>>0,!p){const Re=Math.pow(2,8*i-1);u(this,e,t,i,Re-1,-Re)}let B=i-1,j=1,ge=0;for(this[t+B]=e&255;--B>=0&&(j*=256);)e<0&&ge===0&&this[t+B+1]!==0&&(ge=1),this[t+B]=(e/j>>0)-ge&255;return t+i},n.prototype.writeInt8=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},n.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},n.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},n.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},n.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||u(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},n.prototype.writeBigInt64LE=fe(function(e,t=0){return X(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),n.prototype.writeBigInt64BE=fe(function(e,t=0){return le(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))});function F(r,e,t,i,p,B){if(t+i>r.length)throw new RangeError(\"Index out of range\");if(t<0)throw new RangeError(\"Index out of range\")}function de(r,e,t,i,p){return e=+e,t=t>>>0,p||F(r,e,t,4,34028234663852886e22,-34028234663852886e22),s.write(r,e,t,i,23,4),t+4}n.prototype.writeFloatLE=function(e,t,i){return de(this,e,t,!0,i)},n.prototype.writeFloatBE=function(e,t,i){return de(this,e,t,!1,i)};function be(r,e,t,i,p){return e=+e,t=t>>>0,p||F(r,e,t,8,17976931348623157e292,-17976931348623157e292),s.write(r,e,t,i,52,8),t+8}n.prototype.writeDoubleLE=function(e,t,i){return be(this,e,t,!0,i)},n.prototype.writeDoubleBE=function(e,t,i){return be(this,e,t,!1,i)},n.prototype.copy=function(e,t,i,p){if(!n.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(i||(i=0),!p&&p!==0&&(p=this.length),t>=e.length&&(t=e.length),t||(t=0),p>0&&p<i&&(p=i),p===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(i<0||i>=this.length)throw new RangeError(\"Index out of range\");if(p<0)throw new RangeError(\"sourceEnd out of bounds\");p>this.length&&(p=this.length),e.length-t<p-i&&(p=e.length-t+i);const B=p-i;return this===e&&typeof Uint8Array.prototype.copyWithin==\"function\"?this.copyWithin(t,i,p):Uint8Array.prototype.set.call(e,this.subarray(i,p),t),B},n.prototype.fill=function(e,t,i,p){if(typeof e==\"string\"){if(typeof t==\"string\"?(p=t,t=0,i=this.length):typeof i==\"string\"&&(p=i,i=this.length),p!==void 0&&typeof p!=\"string\")throw new TypeError(\"encoding must be a string\");if(typeof p==\"string\"&&!n.isEncoding(p))throw new TypeError(\"Unknown encoding: \"+p);if(e.length===1){const j=e.charCodeAt(0);(p===\"utf8\"&&j<128||p===\"latin1\")&&(e=j)}}else typeof e==\"number\"?e=e&255:typeof e==\"boolean\"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError(\"Out of range index\");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let B;if(typeof e==\"number\")for(B=t;B<i;++B)this[B]=e;else{const j=n.isBuffer(e)?e:n.from(e,p),ge=j.length;if(ge===0)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(B=0;B<i-t;++B)this[B+t]=j[B%ge]}return this};var ve={};function we(r,e,t){ve[r]=class extends t{constructor(){super(),Object.defineProperty(this,\"message\",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(p){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:p,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}we(\"ERR_BUFFER_OUT_OF_BOUNDS\",function(r){return r?`${r} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"},RangeError),we(\"ERR_INVALID_ARG_TYPE\",function(r,e){return`The \"${r}\" argument must be of type number. Received type ${typeof e}`},TypeError),we(\"ERR_OUT_OF_RANGE\",function(r,e,t){let i=`The value of \"${r}\" is out of range.`,p=t;return Number.isInteger(t)&&Math.abs(t)>2**32?p=K(String(t)):typeof t==\"bigint\"&&(p=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(p=K(p)),p+=\"n\"),i+=` It must be ${e}. Received ${p}`,i},RangeError);function K(r){let e=\"\",t=r.length;const i=r[0]===\"-\"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function G(r,e,t){pe(e,\"offset\"),(r[e]===void 0||r[e+t]===void 0)&&ye(e,r.length-(t+1))}function ne(r,e,t,i,p,B){if(r>t||r<e){const j=typeof e==\"bigint\"?\"n\":\"\";let ge;throw B>3?e===0||e===BigInt(0)?ge=`>= 0${j} and < 2${j} ** ${(B+1)*8}${j}`:ge=`>= -(2${j} ** ${(B+1)*8-1}${j}) and < 2 ** ${(B+1)*8-1}${j}`:ge=`>= ${e}${j} and <= ${t}${j}`,new ve.ERR_OUT_OF_RANGE(\"value\",ge,r)}G(i,p,B)}function pe(r,e){if(typeof r!=\"number\")throw new ve.ERR_INVALID_ARG_TYPE(e,\"number\",r)}function ye(r,e,t){throw Math.floor(r)!==r?(pe(r,t),new ve.ERR_OUT_OF_RANGE(t||\"offset\",\"an integer\",r)):e<0?new ve.ERR_BUFFER_OUT_OF_BOUNDS:new ve.ERR_OUT_OF_RANGE(t||\"offset\",`>= ${t?1:0} and <= ${e}`,r)}var g=/[^+/0-9A-Za-z-_]/g;function v(r){if(r=r.split(\"=\")[0],r=r.trim().replace(g,\"\"),r.length<2)return\"\";for(;r.length%4!==0;)r=r+\"=\";return r}function M(r,e){e=e||1/0;let t;const i=r.length;let p=null;const B=[];for(let j=0;j<i;++j){if(t=r.charCodeAt(j),t>55295&&t<57344){if(!p){if(t>56319){(e-=3)>-1&&B.push(239,191,189);continue}else if(j+1===i){(e-=3)>-1&&B.push(239,191,189);continue}p=t;continue}if(t<56320){(e-=3)>-1&&B.push(239,191,189),p=t;continue}t=(p-55296<<10|t-56320)+65536}else p&&(e-=3)>-1&&B.push(239,191,189);if(p=null,t<128){if((e-=1)<0)break;B.push(t)}else if(t<2048){if((e-=2)<0)break;B.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;B.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;B.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error(\"Invalid code point\")}return B}function Q(r){const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function ee(r,e){let t,i,p;const B=[];for(let j=0;j<r.length&&!((e-=2)<0);++j)t=r.charCodeAt(j),i=t>>8,p=t%256,B.push(p),B.push(i);return B}function Z(r){return d.toByteArray(v(r))}function b(r,e,t,i){let p;for(p=0;p<i&&!(p+t>=e.length||p>=r.length);++p)e[p+t]=r[p];return p}function q(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function oe(r){return r!==r}var J=(function(){const r=\"0123456789abcdef\",e=new Array(256);for(let t=0;t<16;++t){const i=t*16;for(let p=0;p<16;++p)e[i+p]=r[t]+r[p]}return e})();function fe(r){return typeof BigInt>\"u\"?Le:r}function Le(){throw new Error(\"BigInt not supported\")}})),Ie=Ee(((E,d)=>{var s=class extends Error{constructor(c){if(!Array.isArray(c))throw new TypeError(`Expected input to be an Array, got ${typeof c}`);let _=\"\";for(let A=0;A<c.length;A++)_+=` ${c[A].stack}\n`;super(_),this.name=\"AggregateError\",this.errors=c}};d.exports={AggregateError:s,ArrayIsArray(c){return Array.isArray(c)},ArrayPrototypeIncludes(c,_){return c.includes(_)},ArrayPrototypeIndexOf(c,_){return c.indexOf(_)},ArrayPrototypeJoin(c,_){return c.join(_)},ArrayPrototypeMap(c,_){return c.map(_)},ArrayPrototypePop(c,_){return c.pop(_)},ArrayPrototypePush(c,_){return c.push(_)},ArrayPrototypeSlice(c,_,A){return c.slice(_,A)},Error,FunctionPrototypeCall(c,_,...A){return c.call(_,...A)},FunctionPrototypeSymbolHasInstance(c,_){return Function.prototype[Symbol.hasInstance].call(c,_)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(c,_){return Object.defineProperties(c,_)},ObjectDefineProperty(c,_,A){return Object.defineProperty(c,_,A)},ObjectGetOwnPropertyDescriptor(c,_){return Object.getOwnPropertyDescriptor(c,_)},ObjectKeys(c){return Object.keys(c)},ObjectSetPrototypeOf(c,_){return Object.setPrototypeOf(c,_)},Promise,PromisePrototypeCatch(c,_){return c.catch(_)},PromisePrototypeThen(c,_,A){return c.then(_,A)},PromiseReject(c){return Promise.reject(c)},PromiseResolve(c){return Promise.resolve(c)},ReflectApply:Reflect.apply,RegExpPrototypeTest(c,_){return c.test(_)},SafeSet:Set,String,StringPrototypeSlice(c,_,A){return c.slice(_,A)},StringPrototypeToLowerCase(c){return c.toLowerCase()},StringPrototypeToUpperCase(c){return c.toUpperCase()},StringPrototypeTrim(c){return c.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol(\"Symbol.dispose\"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol(\"Symbol.asyncDispose\"),TypedArrayPrototypeSet(c,_,A){return c.set(_,A)},Boolean,Uint8Array}})),_t=Ee(((E,d)=>{d.exports={format(s,...c){return s.replace(/%([sdifj])/g,function(...[_,A]){const R=c.shift();return A===\"f\"?R.toFixed(6):A===\"j\"?JSON.stringify(R):A===\"s\"&&typeof R==\"object\"?`${R.constructor!==Object?R.constructor.name:\"\"} {}`.trim():R.toString()})},inspect(s){switch(typeof s){case\"string\":if(s.includes(\"'\"))if(s.includes('\"')){if(!s.includes(\"`\")&&!s.includes(\"${\"))return`\\`${s}\\``}else return`\"${s}\"`;return`'${s}'`;case\"number\":return isNaN(s)?\"NaN\":Object.is(s,-0)?String(s):s;case\"bigint\":return`${String(s)}n`;case\"boolean\":case\"undefined\":return String(s);case\"object\":return\"{}\"}}}})),xe=Ee(((E,d)=>{var{format:s,inspect:c}=_t(),{AggregateError:_}=Ie(),A=globalThis.AggregateError||_,R=Symbol(\"kIsNodeError\"),n=[\"string\",\"function\",\"number\",\"object\",\"Function\",\"Object\",\"boolean\",\"bigint\",\"symbol\"],C=/^([A-Z][a-z0-9]*)+$/,T=\"__node_internal_\",W={};function L(l,w){if(!l)throw new W.ERR_INTERNAL_ASSERTION(w)}function O(l){let w=\"\",S=l.length;const y=l[0]===\"-\"?1:0;for(;S>=y+4;S-=3)w=`_${l.slice(S-3,S)}${w}`;return`${l.slice(0,S)}${w}`}function $(l,w,S){if(typeof w==\"function\")return L(w.length<=S.length,`Code: ${l}; The provided arguments length (${S.length}) does not match the required ones (${w.length}).`),w(...S);const y=(w.match(/%[dfijoOs]/g)||[]).length;return L(y===S.length,`Code: ${l}; The provided arguments length (${S.length}) does not match the required ones (${y}).`),S.length===0?w:s(w,...S)}function P(l,w,S){S||(S=Error);class y extends S{constructor(...h){super($(l,w,h))}toString(){return`${this.name} [${l}]: ${this.message}`}}Object.defineProperties(y.prototype,{name:{value:S.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${l}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),y.prototype.code=l,y.prototype[R]=!0,W[l]=y}function Y(l){const w=T+l.name;return Object.defineProperty(l,\"name\",{value:w}),l}function k(l,w){if(l&&w&&l!==w){if(Array.isArray(w.errors))return w.errors.push(l),w;const S=new A([w,l],w.message);return S.code=w.code,S}return l||w}var D=class extends Error{constructor(l=\"The operation was aborted\",w=void 0){if(w!==void 0&&typeof w!=\"object\")throw new W.ERR_INVALID_ARG_TYPE(\"options\",\"Object\",w);super(l,w),this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};P(\"ERR_ASSERTION\",\"%s\",Error),P(\"ERR_INVALID_ARG_TYPE\",(l,w,S)=>{L(typeof l==\"string\",\"'name' must be a string\"),Array.isArray(w)||(w=[w]);let y=\"The \";l.endsWith(\" argument\")?y+=`${l} `:y+=`\"${l}\" ${l.includes(\".\")?\"property\":\"argument\"} `,y+=\"must be \";const f=[],h=[],x=[];for(const U of w)L(typeof U==\"string\",\"All expected entries have to be of type string\"),n.includes(U)?f.push(U.toLowerCase()):C.test(U)?h.push(U):(L(U!==\"object\",'The value \"object\" should be written as \"Object\"'),x.push(U));if(h.length>0){const U=f.indexOf(\"object\");U!==-1&&(f.splice(f,U,1),h.push(\"Object\"))}if(f.length>0){switch(f.length){case 1:y+=`of type ${f[0]}`;break;case 2:y+=`one of type ${f[0]} or ${f[1]}`;break;default:{const U=f.pop();y+=`one of type ${f.join(\", \")}, or ${U}`}}(h.length>0||x.length>0)&&(y+=\" or \")}if(h.length>0){switch(h.length){case 1:y+=`an instance of ${h[0]}`;break;case 2:y+=`an instance of ${h[0]} or ${h[1]}`;break;default:{const U=h.pop();y+=`an instance of ${h.join(\", \")}, or ${U}`}}x.length>0&&(y+=\" or \")}switch(x.length){case 0:break;case 1:x[0].toLowerCase()!==x[0]&&(y+=\"an \"),y+=`${x[0]}`;break;case 2:y+=`one of ${x[0]} or ${x[1]}`;break;default:{const U=x.pop();y+=`one of ${x.join(\", \")}, or ${U}`}}if(S==null)y+=`. Received ${S}`;else if(typeof S==\"function\"&&S.name)y+=`. Received function ${S.name}`;else if(typeof S==\"object\"){var z;if((z=S.constructor)!==null&&z!==void 0&&z.name)y+=`. Received an instance of ${S.constructor.name}`;else{const U=c(S,{depth:-1});y+=`. Received ${U}`}}else{let U=c(S,{colors:!1});U.length>25&&(U=`${U.slice(0,25)}...`),y+=`. Received type ${typeof S} (${U})`}return y},TypeError),P(\"ERR_INVALID_ARG_VALUE\",(l,w,S=\"is invalid\")=>{let y=c(w);return y.length>128&&(y=y.slice(0,128)+\"...\"),`The ${l.includes(\".\")?\"property\":\"argument\"} '${l}' ${S}. Received ${y}`},TypeError),P(\"ERR_INVALID_RETURN_VALUE\",(l,w,S)=>{var y;return`Expected ${l} to be returned from the \"${w}\" function but got ${S!=null&&(y=S.constructor)!==null&&y!==void 0&&y.name?`instance of ${S.constructor.name}`:`type ${typeof S}`}.`},TypeError),P(\"ERR_MISSING_ARGS\",(...l)=>{L(l.length>0,\"At least one arg needs to be specified\");let w;const S=l.length;switch(l=(Array.isArray(l)?l:[l]).map(y=>`\"${y}\"`).join(\" or \"),S){case 1:w+=`The ${l[0]} argument`;break;case 2:w+=`The ${l[0]} and ${l[1]} arguments`;break;default:{const y=l.pop();w+=`The ${l.join(\", \")}, and ${y} arguments`}}return`${w} must be specified`},TypeError),P(\"ERR_OUT_OF_RANGE\",(l,w,S)=>{L(w,'Missing \"range\" argument');let y;if(Number.isInteger(S)&&Math.abs(S)>2**32)y=O(String(S));else if(typeof S==\"bigint\"){y=String(S);const f=BigInt(2)**BigInt(32);(S>f||S<-f)&&(y=O(y)),y+=\"n\"}else y=c(S);return`The value of \"${l}\" is out of range. It must be ${w}. Received ${y}`},RangeError),P(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\",Error),P(\"ERR_METHOD_NOT_IMPLEMENTED\",\"The %s method is not implemented\",Error),P(\"ERR_STREAM_ALREADY_FINISHED\",\"Cannot call %s after a stream was finished\",Error),P(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\",Error),P(\"ERR_STREAM_DESTROYED\",\"Cannot call %s after a stream was destroyed\",Error),P(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),P(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\",Error),P(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\",Error),P(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\",Error),P(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\",Error),P(\"ERR_UNKNOWN_ENCODING\",\"Unknown encoding: %s\",TypeError),d.exports={AbortError:D,aggregateTwoErrors:Y(k),hideStackFrames:Y,codes:W}})),Xt=Gt({EventTarget:()=>Me,default:()=>Me,defineEventAttribute:()=>At});function Ae(E){const d=ot.get(E);return console.assert(d!=null,\"'this' is expected an Event object, but got\",E),d}function vt(E){if(E.passiveListener!=null){typeof console<\"u\"&&typeof console.error==\"function\"&&console.error(\"Unable to preventDefault inside passive event listener invocation.\",E.passiveListener);return}E.event.cancelable&&(E.canceled=!0,typeof E.event.preventDefault==\"function\"&&E.event.preventDefault())}function qe(E,d){ot.set(this,{eventTarget:E,event:d,eventPhase:2,currentTarget:E,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:d.timeStamp||Date.now()}),Object.defineProperty(this,\"isTrusted\",{value:!1,enumerable:!0});const s=Object.keys(d);for(let c=0;c<s.length;++c){const _=s[c];_ in this||Object.defineProperty(this,_,Et(_))}}function Et(E){return{get(){return Ae(this).event[E]},set(d){Ae(this).event[E]=d},configurable:!0,enumerable:!0}}function Jt(E){return{value(){const d=Ae(this).event;return d[E].apply(d,arguments)},configurable:!0,enumerable:!0}}function Zt(E,d){const s=Object.keys(d);if(s.length===0)return E;function c(_,A){E.call(this,_,A)}c.prototype=Object.create(E.prototype,{constructor:{value:c,configurable:!0,writable:!0}});for(let _=0;_<s.length;++_){const A=s[_];if(!(A in E.prototype)){const R=typeof Object.getOwnPropertyDescriptor(d,A).value==\"function\";Object.defineProperty(c.prototype,A,R?Jt(A):Et(A))}}return c}function St(E){if(E==null||E===Object.prototype)return qe;let d=Qe.get(E);return d==null&&(d=Zt(St(Object.getPrototypeOf(E)),E),Qe.set(E,d)),d}function Qt(E,d){return new(St(Object.getPrototypeOf(d)))(E,d)}function er(E){return Ae(E).immediateStopped}function tr(E,d){Ae(E).eventPhase=d}function rr(E,d){Ae(E).currentTarget=d}function mt(E,d){Ae(E).passiveListener=d}function Ze(E){return E!==null&&typeof E==\"object\"}function Ve(E){const d=lt.get(E);if(d==null)throw new TypeError(\"'this' is expected an EventTarget object, but got another value.\");return d}function nr(E){return{get(){let d=Ve(this).get(E);for(;d!=null;){if(d.listenerType===Ye)return d.listener;d=d.next}return null},set(d){typeof d!=\"function\"&&!Ze(d)&&(d=null);const s=Ve(this);let c=null,_=s.get(E);for(;_!=null;)_.listenerType===Ye?c!==null?c.next=_.next:_.next!==null?s.set(E,_.next):s.delete(E):c=_,_=_.next;if(d!==null){const A={listener:d,listenerType:Ye,passive:!1,once:!1,next:null};c===null?s.set(E,A):c.next=A}},configurable:!0,enumerable:!0}}function At(E,d){Object.defineProperty(E,`on${d}`,nr(d))}function Rt(E){function d(){Me.call(this)}d.prototype=Object.create(Me.prototype,{constructor:{value:d,configurable:!0,writable:!0}});for(let s=0;s<E.length;++s)At(d.prototype,E[s]);return d}function Me(){if(this instanceof Me){lt.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Rt(arguments[0]);if(arguments.length>0){const E=new Array(arguments.length);for(let d=0;d<arguments.length;++d)E[d]=arguments[d];return Rt(E)}throw new TypeError(\"Cannot call a class as a function\")}var ot,Qe,lt,at,st,Ye,ir=Ht((()=>{ot=new WeakMap,Qe=new WeakMap,qe.prototype={get type(){return Ae(this).event.type},get target(){return Ae(this).eventTarget},get currentTarget(){return Ae(this).currentTarget},composedPath(){const E=Ae(this).currentTarget;return E==null?[]:[E]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return Ae(this).eventPhase},stopPropagation(){const E=Ae(this);E.stopped=!0,typeof E.event.stopPropagation==\"function\"&&E.event.stopPropagation()},stopImmediatePropagation(){const E=Ae(this);E.stopped=!0,E.immediateStopped=!0,typeof E.event.stopImmediatePropagation==\"function\"&&E.event.stopImmediatePropagation()},get bubbles(){return!!Ae(this).event.bubbles},get cancelable(){return!!Ae(this).event.cancelable},preventDefault(){vt(Ae(this))},get defaultPrevented(){return Ae(this).canceled},get composed(){return!!Ae(this).event.composed},get timeStamp(){return Ae(this).timeStamp},get srcElement(){return Ae(this).eventTarget},get cancelBubble(){return Ae(this).stopped},set cancelBubble(E){if(!E)return;const d=Ae(this);d.stopped=!0,typeof d.event.cancelBubble==\"boolean\"&&(d.event.cancelBubble=!0)},get returnValue(){return!Ae(this).canceled},set returnValue(E){E||vt(Ae(this))},initEvent(){}},Object.defineProperty(qe.prototype,\"constructor\",{value:qe,configurable:!0,writable:!0}),typeof window<\"u\"&&typeof window.Event<\"u\"&&(Object.setPrototypeOf(qe.prototype,window.Event.prototype),Qe.set(window.Event.prototype,qe)),lt=new WeakMap,at=1,st=2,Ye=3,Me.prototype={addEventListener(E,d,s){if(d==null)return;if(typeof d!=\"function\"&&!Ze(d))throw new TypeError(\"'listener' should be a function or an object.\");const c=Ve(this),_=Ze(s),A=(_?s.capture:s)?at:st,R={listener:d,listenerType:A,passive:_&&!!s.passive,once:_&&!!s.once,next:null};let n=c.get(E);if(n===void 0){c.set(E,R);return}let C=null;for(;n!=null;){if(n.listener===d&&n.listenerType===A)return;C=n,n=n.next}C.next=R},removeEventListener(E,d,s){if(d==null)return;const c=Ve(this),_=(Ze(s)?s.capture:s)?at:st;let A=null,R=c.get(E);for(;R!=null;){if(R.listener===d&&R.listenerType===_){A!==null?A.next=R.next:R.next!==null?c.set(E,R.next):c.delete(E);return}A=R,R=R.next}},dispatchEvent(E){if(E==null||typeof E.type!=\"string\")throw new TypeError('\"event.type\" should be a string.');const d=Ve(this),s=E.type;let c=d.get(s);if(c==null)return!0;const _=Qt(this,E);let A=null;for(;c!=null;){if(c.once?A!==null?A.next=c.next:c.next!==null?d.set(s,c.next):d.delete(s):A=c,mt(_,c.passive?c.listener:null),typeof c.listener==\"function\")try{c.listener.call(this,_)}catch(R){typeof console<\"u\"&&typeof console.error==\"function\"&&console.error(R)}else c.listenerType!==Ye&&typeof c.listener.handleEvent==\"function\"&&c.listener.handleEvent(_);if(er(_))break;c=c.next}return mt(_,null),tr(_,0),rr(_,null),!_.defaultPrevented}},Object.defineProperty(Me.prototype,\"constructor\",{value:Me,configurable:!0,writable:!0}),typeof window<\"u\"&&typeof window.EventTarget<\"u\"&&Object.setPrototypeOf(Me.prototype,window.EventTarget.prototype)})),Ke=Ee(((E,d)=>{Object.defineProperty(E,\"__esModule\",{value:!0});var s=(ir(),Yt(Xt)),c=class extends s.EventTarget{constructor(){throw super(),new TypeError(\"AbortSignal cannot be constructed directly\")}get aborted(){const W=R.get(this);if(typeof W!=\"boolean\")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?\"null\":typeof this}`);return W}};s.defineEventAttribute(c.prototype,\"abort\");function _(){const W=Object.create(c.prototype);return s.EventTarget.call(W),R.set(W,!1),W}function A(W){R.get(W)===!1&&(R.set(W,!0),W.dispatchEvent({type:\"abort\"}))}var R=new WeakMap;Object.defineProperties(c.prototype,{aborted:{enumerable:!0}}),typeof Symbol==\"function\"&&typeof Symbol.toStringTag==\"symbol\"&&Object.defineProperty(c.prototype,Symbol.toStringTag,{configurable:!0,value:\"AbortSignal\"});var n=class{constructor(){C.set(this,_())}get signal(){return T(this)}abort(){A(T(this))}},C=new WeakMap;function T(W){const L=C.get(W);if(L==null)throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${W===null?\"null\":typeof W}`);return L}Object.defineProperties(n.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==\"function\"&&typeof Symbol.toStringTag==\"symbol\"&&Object.defineProperty(n.prototype,Symbol.toStringTag,{configurable:!0,value:\"AbortController\"}),E.AbortController=n,E.AbortSignal=c,E.default=n,d.exports=n,d.exports.AbortController=d.exports.default=n,d.exports.AbortSignal=c})),ze=Ee(((E,d)=>{var s=typeof Reflect==\"object\"?Reflect:null,c=s&&typeof s.apply==\"function\"?s.apply:function(h,x,z){return Function.prototype.apply.call(h,x,z)},_;s&&typeof s.ownKeys==\"function\"?_=s.ownKeys:Object.getOwnPropertySymbols?_=function(h){return Object.getOwnPropertyNames(h).concat(Object.getOwnPropertySymbols(h))}:_=function(h){return Object.getOwnPropertyNames(h)};function A(f){console&&console.warn&&console.warn(f)}var R=Number.isNaN||function(h){return h!==h};function n(){n.init.call(this)}d.exports=n,d.exports.once=w,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var C=10;function T(f){if(typeof f!=\"function\")throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(n,\"defaultMaxListeners\",{enumerable:!0,get:function(){return C},set:function(f){if(typeof f!=\"number\"||f<0||R(f))throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received '+f+\".\");C=f}}),n.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(h){if(typeof h!=\"number\"||h<0||R(h))throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received '+h+\".\");return this._maxListeners=h,this};function W(f){return f._maxListeners===void 0?n.defaultMaxListeners:f._maxListeners}n.prototype.getMaxListeners=function(){return W(this)},n.prototype.emit=function(h){for(var x=[],z=1;z<arguments.length;z++)x.push(arguments[z]);var U=h===\"error\",ue=this._events;if(ue!==void 0)U=U&&ue.error===void 0;else if(!U)return!1;if(U){var m;if(x.length>0&&(m=x[0]),m instanceof Error)throw m;var N=new Error(\"Unhandled error.\"+(m?\" (\"+m.message+\")\":\"\"));throw N.context=m,N}var V=ue[h];if(V===void 0)return!1;if(typeof V==\"function\")c(V,this,x);else for(var I=V.length,ae=k(V,I),z=0;z<I;++z)c(ae[z],this,x);return!0};function L(f,h,x,z){var U,ue,m;if(T(x),ue=f._events,ue===void 0?(ue=f._events=Object.create(null),f._eventsCount=0):(ue.newListener!==void 0&&(f.emit(\"newListener\",h,x.listener?x.listener:x),ue=f._events),m=ue[h]),m===void 0)m=ue[h]=x,++f._eventsCount;else if(typeof m==\"function\"?m=ue[h]=z?[x,m]:[m,x]:z?m.unshift(x):m.push(x),U=W(f),U>0&&m.length>U&&!m.warned){m.warned=!0;var N=new Error(\"Possible EventEmitter memory leak detected. \"+m.length+\" \"+String(h)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");N.name=\"MaxListenersExceededWarning\",N.emitter=f,N.type=h,N.count=m.length,A(N)}return f}n.prototype.addListener=function(h,x){return L(this,h,x,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(h,x){return L(this,h,x,!0)};function O(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function $(f,h,x){var z={fired:!1,wrapFn:void 0,target:f,type:h,listener:x},U=O.bind(z);return U.listener=x,z.wrapFn=U,U}n.prototype.once=function(h,x){return T(x),this.on(h,$(this,h,x)),this},n.prototype.prependOnceListener=function(h,x){return T(x),this.prependListener(h,$(this,h,x)),this},n.prototype.removeListener=function(h,x){var z,U,ue,m,N;if(T(x),U=this._events,U===void 0)return this;if(z=U[h],z===void 0)return this;if(z===x||z.listener===x)--this._eventsCount===0?this._events=Object.create(null):(delete U[h],U.removeListener&&this.emit(\"removeListener\",h,z.listener||x));else if(typeof z!=\"function\"){for(ue=-1,m=z.length-1;m>=0;m--)if(z[m]===x||z[m].listener===x){N=z[m].listener,ue=m;break}if(ue<0)return this;ue===0?z.shift():D(z,ue),z.length===1&&(U[h]=z[0]),U.removeListener!==void 0&&this.emit(\"removeListener\",h,N||x)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(h){var x,z=this._events,U;if(z===void 0)return this;if(z.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):z[h]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete z[h]),this;if(arguments.length===0){var ue=Object.keys(z),m;for(U=0;U<ue.length;++U)m=ue[U],m!==\"removeListener\"&&this.removeAllListeners(m);return this.removeAllListeners(\"removeListener\"),this._events=Object.create(null),this._eventsCount=0,this}if(x=z[h],typeof x==\"function\")this.removeListener(h,x);else if(x!==void 0)for(U=x.length-1;U>=0;U--)this.removeListener(h,x[U]);return this};function P(f,h,x){var z=f._events;if(z===void 0)return[];var U=z[h];return U===void 0?[]:typeof U==\"function\"?x?[U.listener||U]:[U]:x?l(U):k(U,U.length)}n.prototype.listeners=function(h){return P(this,h,!0)},n.prototype.rawListeners=function(h){return P(this,h,!1)},n.listenerCount=function(f,h){return typeof f.listenerCount==\"function\"?f.listenerCount(h):Y.call(f,h)},n.prototype.listenerCount=Y;function Y(f){var h=this._events;if(h!==void 0){var x=h[f];if(typeof x==\"function\")return 1;if(x!==void 0)return x.length}return 0}n.prototype.eventNames=function(){return this._eventsCount>0?_(this._events):[]};function k(f,h){for(var x=new Array(h),z=0;z<h;++z)x[z]=f[z];return x}function D(f,h){for(;h+1<f.length;h++)f[h]=f[h+1];f.pop()}function l(f){for(var h=new Array(f.length),x=0;x<h.length;++x)h[x]=f[x].listener||f[x];return h}function w(f,h){return new Promise(function(x,z){function U(m){f.removeListener(h,ue),z(m)}function ue(){typeof f.removeListener==\"function\"&&f.removeListener(\"error\",U),x([].slice.call(arguments))}y(f,h,ue,{once:!0}),h!==\"error\"&&S(f,U,{once:!0})})}function S(f,h,x){typeof f.on==\"function\"&&y(f,\"error\",h,x)}function y(f,h,x,z){if(typeof f.on==\"function\")z.once?f.once(h,x):f.on(h,x);else if(typeof f.addEventListener==\"function\")f.addEventListener(h,function U(ue){z.once&&f.removeEventListener(h,U),x(ue)});else throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type '+typeof f)}})),Ne=Ee(((E,d)=>{var s=Oe(),{format:c,inspect:_}=_t(),{codes:{ERR_INVALID_ARG_TYPE:A}}=xe(),{kResistStopPropagation:R,AggregateError:n,SymbolDispose:C}=Ie(),T=globalThis.AbortSignal||Ke().AbortSignal,W=globalThis.AbortController||Ke().AbortController,L=Object.getPrototypeOf(async function(){}).constructor,O=globalThis.Blob||s.Blob,$=typeof O<\"u\"?function(D){return D instanceof O}:function(D){return!1},P=(k,D)=>{if(k!==void 0&&(k===null||typeof k!=\"object\"||!(\"aborted\"in k)))throw new A(D,\"AbortSignal\",k)},Y=(k,D)=>{if(typeof k!=\"function\")throw new A(D,\"Function\",k)};d.exports={AggregateError:n,kEmptyObject:Object.freeze({}),once(k){let D=!1;return function(...l){D||(D=!0,k.apply(this,l))}},createDeferredPromise:function(){let k,D;return{promise:new Promise((l,w)=>{k=l,D=w}),resolve:k,reject:D}},promisify(k){return new Promise((D,l)=>{k((w,...S)=>w?l(w):D(...S))})},debuglog(){return function(){}},format:c,inspect:_,types:{isAsyncFunction(k){return k instanceof L},isArrayBufferView(k){return ArrayBuffer.isView(k)}},isBlob:$,deprecate(k,D){return k},addAbortListener:ze().addAbortListener||function(D,l){if(D===void 0)throw new A(\"signal\",\"AbortSignal\",D);P(D,\"signal\"),Y(l,\"listener\");let w;return D.aborted?queueMicrotask(()=>l()):(D.addEventListener(\"abort\",l,{__proto__:null,once:!0,[R]:!0}),w=()=>{D.removeEventListener(\"abort\",l)}),{__proto__:null,[C](){var S;(S=w)===null||S===void 0||S()}}},AbortSignalAny:T.any||function(D){if(D.length===1)return D[0];const l=new W,w=()=>l.abort();return D.forEach(S=>{P(S,\"signals\"),S.addEventListener(\"abort\",w,{once:!0})}),l.signal.addEventListener(\"abort\",()=>{D.forEach(S=>S.removeEventListener(\"abort\",w))},{once:!0}),l.signal}},d.exports.promisify.custom=Symbol.for(\"nodejs.util.promisify.custom\")})),Xe=Ee(((E,d)=>{var{ArrayIsArray:s,ArrayPrototypeIncludes:c,ArrayPrototypeJoin:_,ArrayPrototypeMap:A,NumberIsInteger:R,NumberIsNaN:n,NumberMAX_SAFE_INTEGER:C,NumberMIN_SAFE_INTEGER:T,NumberParseInt:W,ObjectPrototypeHasOwnProperty:L,RegExpPrototypeExec:O,String:$,StringPrototypeToUpperCase:P,StringPrototypeTrim:Y}=Ie(),{hideStackFrames:k,codes:{ERR_SOCKET_BAD_PORT:D,ERR_INVALID_ARG_TYPE:l,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:S,ERR_UNKNOWN_SIGNAL:y}}=xe(),{normalizeEncoding:f}=Ne(),{isAsyncFunction:h,isArrayBufferView:x}=Ne().types,z={};function U(b){return b===(b|0)}function ue(b){return b===b>>>0}var m=/^[0-7]+$/,N=\"must be a 32-bit unsigned integer or an octal string\";function V(b,q,oe){if(typeof b>\"u\"&&(b=oe),typeof b==\"string\"){if(O(m,b)===null)throw new w(q,b,N);b=W(b,8)}return se(b,q),b}var I=k((b,q,oe=T,J=C)=>{if(typeof b!=\"number\")throw new l(q,\"number\",b);if(!R(b))throw new S(q,\"an integer\",b);if(b<oe||b>J)throw new S(q,`>= ${oe} && <= ${J}`,b)}),ae=k((b,q,oe=-2147483648,J=2147483647)=>{if(typeof b!=\"number\")throw new l(q,\"number\",b);if(!R(b))throw new S(q,\"an integer\",b);if(b<oe||b>J)throw new S(q,`>= ${oe} && <= ${J}`,b)}),se=k((b,q,oe=!1)=>{if(typeof b!=\"number\")throw new l(q,\"number\",b);if(!R(b))throw new S(q,\"an integer\",b);const J=oe?1:0,fe=4294967295;if(b<J||b>fe)throw new S(q,`>= ${J} && <= ${fe}`,b)});function he(b,q){if(typeof b!=\"string\")throw new l(q,\"string\",b)}function _e(b,q,oe=void 0,J){if(typeof b!=\"number\")throw new l(q,\"number\",b);if(oe!=null&&b<oe||J!=null&&b>J||(oe!=null||J!=null)&&n(b))throw new S(q,`${oe!=null?`>= ${oe}`:\"\"}${oe!=null&&J!=null?\" && \":\"\"}${J!=null?`<= ${J}`:\"\"}`,b)}var H=k((b,q,oe)=>{if(!c(oe,b)){const J=\"must be one of: \"+_(A(oe,fe=>typeof fe==\"string\"?`'${fe}'`:$(fe)),\", \");throw new w(q,b,J)}});function ie(b,q){if(typeof b!=\"boolean\")throw new l(q,\"boolean\",b)}function u(b,q,oe){return b==null||!L(b,q)?oe:b[q]}var X=k((b,q,oe=null)=>{const J=u(oe,\"allowArray\",!1),fe=u(oe,\"allowFunction\",!1);if(!u(oe,\"nullable\",!1)&&b===null||!J&&s(b)||typeof b!=\"object\"&&(!fe||typeof b!=\"function\"))throw new l(q,\"Object\",b)}),le=k((b,q)=>{if(b!=null&&typeof b!=\"object\"&&typeof b!=\"function\")throw new l(q,\"a dictionary\",b)}),F=k((b,q,oe=0)=>{if(!s(b))throw new l(q,\"Array\",b);if(b.length<oe){const J=`must be longer than ${oe}`;throw new w(q,b,J)}});function de(b,q){F(b,q);for(let oe=0;oe<b.length;oe++)he(b[oe],`${q}[${oe}]`)}function be(b,q){F(b,q);for(let oe=0;oe<b.length;oe++)ie(b[oe],`${q}[${oe}]`)}function ve(b,q){F(b,q);for(let oe=0;oe<b.length;oe++){const J=b[oe],fe=`${q}[${oe}]`;if(J==null)throw new l(fe,\"AbortSignal\",J);pe(J,fe)}}function we(b,q=\"signal\"){if(he(b,q),z[b]===void 0)throw z[P(b)]!==void 0?new y(b+\" (signals must use all capital letters)\"):new y(b)}var K=k((b,q=\"buffer\")=>{if(!x(b))throw new l(q,[\"Buffer\",\"TypedArray\",\"DataView\"],b)});function G(b,q){const oe=f(q),J=b.length;if(oe===\"hex\"&&J%2!==0)throw new w(\"encoding\",q,`is invalid for data of length ${J}`)}function ne(b,q=\"Port\",oe=!0){if(typeof b!=\"number\"&&typeof b!=\"string\"||typeof b==\"string\"&&Y(b).length===0||+b!==+b>>>0||b>65535||b===0&&!oe)throw new D(q,b,oe);return b|0}var pe=k((b,q)=>{if(b!==void 0&&(b===null||typeof b!=\"object\"||!(\"aborted\"in b)))throw new l(q,\"AbortSignal\",b)}),ye=k((b,q)=>{if(typeof b!=\"function\")throw new l(q,\"Function\",b)}),g=k((b,q)=>{if(typeof b!=\"function\"||h(b))throw new l(q,\"Function\",b)}),v=k((b,q)=>{if(b!==void 0)throw new l(q,\"undefined\",b)});function M(b,q,oe){if(!c(oe,b))throw new l(q,`('${_(oe,\"|\")}')`,b)}var Q=/^(?:<[^>]*>)(?:\\s*;\\s*[^;\"\\s]+(?:=(\")?[^;\"\\s]*\\1)?)*$/;function ee(b,q){if(typeof b>\"u\"||!O(Q,b))throw new w(q,b,'must be an array or string of format \"</styles.css>; rel=preload; as=style\"')}function Z(b){if(typeof b==\"string\")return ee(b,\"hints\"),b;if(s(b)){const q=b.length;let oe=\"\";if(q===0)return oe;for(let J=0;J<q;J++){const fe=b[J];ee(fe,\"hints\"),oe+=fe,J!==q-1&&(oe+=\", \")}return oe}throw new w(\"hints\",b,'must be an array or string of format \"</styles.css>; rel=preload; as=style\"')}d.exports={isInt32:U,isUint32:ue,parseFileMode:V,validateArray:F,validateStringArray:de,validateBooleanArray:be,validateAbortSignalArray:ve,validateBoolean:ie,validateBuffer:K,validateDictionary:le,validateEncoding:G,validateFunction:ye,validateInt32:ae,validateInteger:I,validateNumber:_e,validateObject:X,validateOneOf:H,validatePlainFunction:g,validatePort:ne,validateSignalName:we,validateString:he,validateUint32:se,validateUndefined:v,validateUnion:M,validateAbortSignal:pe,validateLinkHeaderValue:Z}})),Ue=Ee(((E,d)=>{var s=[],c=!1;function _(){try{for(;s.length;){const[R,n]=s.shift();R(...n)}}finally{c=!1}}var A={env:{},nextTick(R,...n){if(typeof R!=\"function\")throw new TypeError(\"callback must be a function\");s.push([R,n]),c||(c=!0,Promise.resolve().then(_))}};d.exports=A})),ke=Ee(((E,d)=>{var{SymbolAsyncIterator:s,SymbolIterator:c,SymbolFor:_}=Ie(),A=_(\"nodejs.stream.destroyed\"),R=_(\"nodejs.stream.errored\"),n=_(\"nodejs.stream.readable\"),C=_(\"nodejs.stream.writable\"),T=_(\"nodejs.stream.disturbed\"),W=_(\"nodejs.webstream.isClosedPromise\"),L=_(\"nodejs.webstream.controllerErrorFunction\");function O(u,X=!1){var le;return!!(u&&typeof u.pipe==\"function\"&&typeof u.on==\"function\"&&(!X||typeof u.pause==\"function\"&&typeof u.resume==\"function\")&&(!u._writableState||((le=u._readableState)===null||le===void 0?void 0:le.readable)!==!1)&&(!u._writableState||u._readableState))}function $(u){var X;return!!(u&&typeof u.write==\"function\"&&typeof u.on==\"function\"&&(!u._readableState||((X=u._writableState)===null||X===void 0?void 0:X.writable)!==!1))}function P(u){return!!(u&&typeof u.pipe==\"function\"&&u._readableState&&typeof u.on==\"function\"&&typeof u.write==\"function\")}function Y(u){return u&&(u._readableState||u._writableState||typeof u.write==\"function\"&&typeof u.on==\"function\"||typeof u.pipe==\"function\"&&typeof u.on==\"function\")}function k(u){return!!(u&&!Y(u)&&typeof u.pipeThrough==\"function\"&&typeof u.getReader==\"function\"&&typeof u.cancel==\"function\")}function D(u){return!!(u&&!Y(u)&&typeof u.getWriter==\"function\"&&typeof u.abort==\"function\")}function l(u){return!!(u&&!Y(u)&&typeof u.readable==\"object\"&&typeof u.writable==\"object\")}function w(u){return k(u)||D(u)||l(u)}function S(u,X){return u==null?!1:X===!0?typeof u[s]==\"function\":X===!1?typeof u[c]==\"function\":typeof u[s]==\"function\"||typeof u[c]==\"function\"}function y(u){if(!Y(u))return null;const X=u._writableState,le=u._readableState,F=X||le;return!!(u.destroyed||u[A]||F!=null&&F.destroyed)}function f(u){if(!$(u))return null;if(u.writableEnded===!0)return!0;const X=u._writableState;return X!=null&&X.errored?!1:typeof X?.ended!=\"boolean\"?null:X.ended}function h(u,X){if(!$(u))return null;if(u.writableFinished===!0)return!0;const le=u._writableState;return le!=null&&le.errored?!1:typeof le?.finished!=\"boolean\"?null:!!(le.finished||X===!1&&le.ended===!0&&le.length===0)}function x(u){if(!O(u))return null;if(u.readableEnded===!0)return!0;const X=u._readableState;return!X||X.errored?!1:typeof X?.ended!=\"boolean\"?null:X.ended}function z(u,X){if(!O(u))return null;const le=u._readableState;return le!=null&&le.errored?!1:typeof le?.endEmitted!=\"boolean\"?null:!!(le.endEmitted||X===!1&&le.ended===!0&&le.length===0)}function U(u){return u&&u[n]!=null?u[n]:typeof u?.readable!=\"boolean\"?null:y(u)?!1:O(u)&&u.readable&&!z(u)}function ue(u){return u&&u[C]!=null?u[C]:typeof u?.writable!=\"boolean\"?null:y(u)?!1:$(u)&&u.writable&&!f(u)}function m(u,X){return Y(u)?y(u)?!0:!(X?.readable!==!1&&U(u)||X?.writable!==!1&&ue(u)):null}function N(u){var X,le;return Y(u)?u.writableErrored?u.writableErrored:(X=(le=u._writableState)===null||le===void 0?void 0:le.errored)!==null&&X!==void 0?X:null:null}function V(u){var X,le;return Y(u)?u.readableErrored?u.readableErrored:(X=(le=u._readableState)===null||le===void 0?void 0:le.errored)!==null&&X!==void 0?X:null:null}function I(u){if(!Y(u))return null;if(typeof u.closed==\"boolean\")return u.closed;const X=u._writableState,le=u._readableState;return typeof X?.closed==\"boolean\"||typeof le?.closed==\"boolean\"?X?.closed||le?.closed:typeof u._closed==\"boolean\"&&ae(u)?u._closed:null}function ae(u){return typeof u._closed==\"boolean\"&&typeof u._defaultKeepAlive==\"boolean\"&&typeof u._removedConnection==\"boolean\"&&typeof u._removedContLen==\"boolean\"}function se(u){return typeof u._sent100==\"boolean\"&&ae(u)}function he(u){var X;return typeof u._consuming==\"boolean\"&&typeof u._dumped==\"boolean\"&&((X=u.req)===null||X===void 0?void 0:X.upgradeOrConnect)===void 0}function _e(u){if(!Y(u))return null;const X=u._writableState,le=u._readableState,F=X||le;return!F&&se(u)||!!(F&&F.autoDestroy&&F.emitClose&&F.closed===!1)}function H(u){var X;return!!(u&&((X=u[T])!==null&&X!==void 0?X:u.readableDidRead||u.readableAborted))}function ie(u){var X,le,F,de,be,ve,we,K,G,ne;return!!(u&&((X=(le=(F=(de=(be=(ve=u[R])!==null&&ve!==void 0?ve:u.readableErrored)!==null&&be!==void 0?be:u.writableErrored)!==null&&de!==void 0?de:(we=u._readableState)===null||we===void 0?void 0:we.errorEmitted)!==null&&F!==void 0?F:(K=u._writableState)===null||K===void 0?void 0:K.errorEmitted)!==null&&le!==void 0?le:(G=u._readableState)===null||G===void 0?void 0:G.errored)!==null&&X!==void 0?X:!((ne=u._writableState)===null||ne===void 0)&&ne.errored))}d.exports={isDestroyed:y,kIsDestroyed:A,isDisturbed:H,kIsDisturbed:T,isErrored:ie,kIsErrored:R,isReadable:U,kIsReadable:n,kIsClosedPromise:W,kControllerErrorFunction:L,kIsWritable:C,isClosed:I,isDuplexNodeStream:P,isFinished:m,isIterable:S,isReadableNodeStream:O,isReadableStream:k,isReadableEnded:x,isReadableFinished:z,isReadableErrored:V,isNodeStream:Y,isWebStream:w,isWritable:ue,isWritableNodeStream:$,isWritableStream:D,isWritableEnded:f,isWritableFinished:h,isWritableErrored:N,isServerRequest:he,isServerResponse:se,willEmitClose:_e,isTransformStream:l}})),We=Ee(((E,d)=>{var s=Ue(),{AbortError:c,codes:_}=xe(),{ERR_INVALID_ARG_TYPE:A,ERR_STREAM_PREMATURE_CLOSE:R}=_,{kEmptyObject:n,once:C}=Ne(),{validateAbortSignal:T,validateFunction:W,validateObject:L,validateBoolean:O}=Xe(),{Promise:$,PromisePrototypeThen:P,SymbolDispose:Y}=Ie(),{isClosed:k,isReadable:D,isReadableNodeStream:l,isReadableStream:w,isReadableFinished:S,isReadableErrored:y,isWritable:f,isWritableNodeStream:h,isWritableStream:x,isWritableFinished:z,isWritableErrored:U,isNodeStream:ue,willEmitClose:m,kIsClosedPromise:N}=ke(),V;function I(H){return H.setHeader&&typeof H.abort==\"function\"}var ae=()=>{};function se(H,ie,u){var X,le;if(arguments.length===2?(u=ie,ie=n):ie==null?ie=n:L(ie,\"options\"),W(u,\"callback\"),T(ie.signal,\"options.signal\"),u=C(u),w(H)||x(H))return he(H,ie,u);if(!ue(H))throw new A(\"stream\",[\"ReadableStream\",\"WritableStream\",\"Stream\"],H);const F=(X=ie.readable)!==null&&X!==void 0?X:l(H),de=(le=ie.writable)!==null&&le!==void 0?le:h(H),be=H._writableState,ve=H._readableState,we=()=>{H.writable||ne()};let K=m(H)&&l(H)===F&&h(H)===de,G=z(H,!1);const ne=()=>{G=!0,H.destroyed&&(K=!1),!(K&&(!H.readable||F))&&(!F||pe)&&u.call(H)};let pe=S(H,!1);const ye=()=>{pe=!0,H.destroyed&&(K=!1),!(K&&(!H.writable||de))&&(!de||G)&&u.call(H)},g=b=>{u.call(H,b)};let v=k(H);const M=()=>{v=!0;const b=U(H)||y(H);if(b&&typeof b!=\"boolean\")return u.call(H,b);if(F&&!pe&&l(H,!0)&&!S(H,!1))return u.call(H,new R);if(de&&!G&&!z(H,!1))return u.call(H,new R);u.call(H)},Q=()=>{v=!0;const b=U(H)||y(H);if(b&&typeof b!=\"boolean\")return u.call(H,b);u.call(H)},ee=()=>{H.req.on(\"finish\",ne)};I(H)?(H.on(\"complete\",ne),K||H.on(\"abort\",M),H.req?ee():H.on(\"request\",ee)):de&&!be&&(H.on(\"end\",we),H.on(\"close\",we)),!K&&typeof H.aborted==\"boolean\"&&H.on(\"aborted\",M),H.on(\"end\",ye),H.on(\"finish\",ne),ie.error!==!1&&H.on(\"error\",g),H.on(\"close\",M),v?s.nextTick(M):be!=null&&be.errorEmitted||ve!=null&&ve.errorEmitted?K||s.nextTick(Q):(!F&&(!K||D(H))&&(G||f(H)===!1)||!de&&(!K||f(H))&&(pe||D(H)===!1)||ve&&H.req&&H.aborted)&&s.nextTick(Q);const Z=()=>{u=ae,H.removeListener(\"aborted\",M),H.removeListener(\"complete\",ne),H.removeListener(\"abort\",M),H.removeListener(\"request\",ee),H.req&&H.req.removeListener(\"finish\",ne),H.removeListener(\"end\",we),H.removeListener(\"close\",we),H.removeListener(\"finish\",ne),H.removeListener(\"end\",ye),H.removeListener(\"error\",g),H.removeListener(\"close\",M)};if(ie.signal&&!v){const b=()=>{const q=u;Z(),q.call(H,new c(void 0,{cause:ie.signal.reason}))};if(ie.signal.aborted)s.nextTick(b);else{V=V||Ne().addAbortListener;const q=V(ie.signal,b),oe=u;u=C((...J)=>{q[Y](),oe.apply(H,J)})}}return Z}function he(H,ie,u){let X=!1,le=ae;if(ie.signal)if(le=()=>{X=!0,u.call(H,new c(void 0,{cause:ie.signal.reason}))},ie.signal.aborted)s.nextTick(le);else{V=V||Ne().addAbortListener;const de=V(ie.signal,le),be=u;u=C((...ve)=>{de[Y](),be.apply(H,ve)})}const F=(...de)=>{X||s.nextTick(()=>u.apply(H,de))};return P(H[N].promise,F,F),ae}function _e(H,ie){var u;let X=!1;return ie===null&&(ie=n),(u=ie)!==null&&u!==void 0&&u.cleanup&&(O(ie.cleanup,\"cleanup\"),X=ie.cleanup),new $((le,F)=>{const de=se(H,ie,be=>{X&&de(),be?F(be):le()})})}d.exports=se,d.exports.finished=_e})),He=Ee(((E,d)=>{var s=Ue(),{aggregateTwoErrors:c,codes:{ERR_MULTIPLE_CALLBACK:_},AbortError:A}=xe(),{Symbol:R}=Ie(),{kIsDestroyed:n,isDestroyed:C,isFinished:T,isServerRequest:W}=ke(),L=R(\"kDestroy\"),O=R(\"kConstruct\");function $(m,N,V){m&&(m.stack,N&&!N.errored&&(N.errored=m),V&&!V.errored&&(V.errored=m))}function P(m,N){const V=this._readableState,I=this._writableState,ae=I||V;return I!=null&&I.destroyed||V!=null&&V.destroyed?(typeof N==\"function\"&&N(),this):($(m,I,V),I&&(I.destroyed=!0),V&&(V.destroyed=!0),ae.constructed?Y(this,m,N):this.once(L,function(se){Y(this,c(se,m),N)}),this)}function Y(m,N,V){let I=!1;function ae(se){if(I)return;I=!0;const he=m._readableState,_e=m._writableState;$(se,_e,he),_e&&(_e.closed=!0),he&&(he.closed=!0),typeof V==\"function\"&&V(se),se?s.nextTick(k,m,se):s.nextTick(D,m)}try{m._destroy(N||null,ae)}catch(se){ae(se)}}function k(m,N){l(m,N),D(m)}function D(m){const N=m._readableState,V=m._writableState;V&&(V.closeEmitted=!0),N&&(N.closeEmitted=!0),(V!=null&&V.emitClose||N!=null&&N.emitClose)&&m.emit(\"close\")}function l(m,N){const V=m._readableState,I=m._writableState;I!=null&&I.errorEmitted||V!=null&&V.errorEmitted||(I&&(I.errorEmitted=!0),V&&(V.errorEmitted=!0),m.emit(\"error\",N))}function w(){const m=this._readableState,N=this._writableState;m&&(m.constructed=!0,m.closed=!1,m.closeEmitted=!1,m.destroyed=!1,m.errored=null,m.errorEmitted=!1,m.reading=!1,m.ended=m.readable===!1,m.endEmitted=m.readable===!1),N&&(N.constructed=!0,N.destroyed=!1,N.closed=!1,N.closeEmitted=!1,N.errored=null,N.errorEmitted=!1,N.finalCalled=!1,N.prefinished=!1,N.ended=N.writable===!1,N.ending=N.writable===!1,N.finished=N.writable===!1)}function S(m,N,V){const I=m._readableState,ae=m._writableState;if(ae!=null&&ae.destroyed||I!=null&&I.destroyed)return this;I!=null&&I.autoDestroy||ae!=null&&ae.autoDestroy?m.destroy(N):N&&(N.stack,ae&&!ae.errored&&(ae.errored=N),I&&!I.errored&&(I.errored=N),V?s.nextTick(l,m,N):l(m,N))}function y(m,N){if(typeof m._construct!=\"function\")return;const V=m._readableState,I=m._writableState;V&&(V.constructed=!1),I&&(I.constructed=!1),m.once(O,N),!(m.listenerCount(O)>1)&&s.nextTick(f,m)}function f(m){let N=!1;function V(I){if(N){S(m,I??new _);return}N=!0;const ae=m._readableState,se=m._writableState,he=se||ae;ae&&(ae.constructed=!0),se&&(se.constructed=!0),he.destroyed?m.emit(L,I):I?S(m,I,!0):s.nextTick(h,m)}try{m._construct(I=>{s.nextTick(V,I)})}catch(I){s.nextTick(V,I)}}function h(m){m.emit(O)}function x(m){return m?.setHeader&&typeof m.abort==\"function\"}function z(m){m.emit(\"close\")}function U(m,N){m.emit(\"error\",N),s.nextTick(z,m)}function ue(m,N){!m||C(m)||(!N&&!T(m)&&(N=new A),W(m)?(m.socket=null,m.destroy(N)):x(m)?m.abort():x(m.req)?m.req.abort():typeof m.destroy==\"function\"?m.destroy(N):typeof m.close==\"function\"?m.close():N?s.nextTick(U,m,N):s.nextTick(z,m),m.destroyed||(m[n]=!0))}d.exports={construct:y,destroyer:ue,destroy:P,undestroy:w,errorOrDestroy:S}})),ut=Ee(((E,d)=>{var{ArrayIsArray:s,ObjectSetPrototypeOf:c}=Ie(),{EventEmitter:_}=ze();function A(n){_.call(this,n)}c(A.prototype,_.prototype),c(A,_),A.prototype.pipe=function(n,C){const T=this;function W(D){n.writable&&n.write(D)===!1&&T.pause&&T.pause()}T.on(\"data\",W);function L(){T.readable&&T.resume&&T.resume()}n.on(\"drain\",L),!n._isStdio&&(!C||C.end!==!1)&&(T.on(\"end\",$),T.on(\"close\",P));let O=!1;function $(){O||(O=!0,n.end())}function P(){O||(O=!0,typeof n.destroy==\"function\"&&n.destroy())}function Y(D){k(),_.listenerCount(this,\"error\")===0&&this.emit(\"error\",D)}R(T,\"error\",Y),R(n,\"error\",Y);function k(){T.removeListener(\"data\",W),n.removeListener(\"drain\",L),T.removeListener(\"end\",$),T.removeListener(\"close\",P),T.removeListener(\"error\",Y),n.removeListener(\"error\",Y),T.removeListener(\"end\",k),T.removeListener(\"close\",k),n.removeListener(\"close\",k)}return T.on(\"end\",k),T.on(\"close\",k),n.on(\"close\",k),n.emit(\"pipe\",T),n};function R(n,C,T){if(typeof n.prependListener==\"function\")return n.prependListener(C,T);!n._events||!n._events[C]?n.on(C,T):s(n._events[C])?n._events[C].unshift(T):n._events[C]=[T,n._events[C]]}d.exports={Stream:A,prependListener:R}})),et=Ee(((E,d)=>{var{SymbolDispose:s}=Ie(),{AbortError:c,codes:_}=xe(),{isNodeStream:A,isWebStream:R,kControllerErrorFunction:n}=ke(),C=We(),{ERR_INVALID_ARG_TYPE:T}=_,W,L=(O,$)=>{if(typeof O!=\"object\"||!(\"aborted\"in O))throw new T($,\"AbortSignal\",O)};d.exports.addAbortSignal=function($,P){if(L($,\"signal\"),!A(P)&&!R(P))throw new T(\"stream\",[\"ReadableStream\",\"WritableStream\",\"Stream\"],P);return d.exports.addAbortSignalNoValidate($,P)},d.exports.addAbortSignalNoValidate=function(O,$){if(typeof O!=\"object\"||!(\"aborted\"in O))return $;const P=A($)?()=>{$.destroy(new c(void 0,{cause:O.reason}))}:()=>{$[n](new c(void 0,{cause:O.reason}))};if(O.aborted)P();else{W=W||Ne().addAbortListener;const Y=W(O,P);C($,Y[s])}return $}})),or=Ee(((E,d)=>{var{StringPrototypeSlice:s,SymbolIterator:c,TypedArrayPrototypeSet:_,Uint8Array:A}=Ie(),{Buffer:R}=Oe(),{inspect:n}=Ne();d.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(T){const W={data:T,next:null};this.length>0?this.tail.next=W:this.head=W,this.tail=W,++this.length}unshift(T){const W={data:T,next:this.head};this.length===0&&(this.tail=W),this.head=W,++this.length}shift(){if(this.length===0)return;const T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}clear(){this.head=this.tail=null,this.length=0}join(T){if(this.length===0)return\"\";let W=this.head,L=\"\"+W.data;for(;(W=W.next)!==null;)L+=T+W.data;return L}concat(T){if(this.length===0)return R.alloc(0);const W=R.allocUnsafe(T>>>0);let L=this.head,O=0;for(;L;)_(W,L.data,O),O+=L.data.length,L=L.next;return W}consume(T,W){const L=this.head.data;if(T<L.length){const O=L.slice(0,T);return this.head.data=L.slice(T),O}return T===L.length?this.shift():W?this._getString(T):this._getBuffer(T)}first(){return this.head.data}*[c](){for(let T=this.head;T;T=T.next)yield T.data}_getString(T){let W=\"\",L=this.head,O=0;do{const $=L.data;if(T>$.length)W+=$,T-=$.length;else{T===$.length?(W+=$,++O,L.next?this.head=L.next:this.head=this.tail=null):(W+=s($,0,T),this.head=L,L.data=s($,T));break}++O}while((L=L.next)!==null);return this.length-=O,W}_getBuffer(T){const W=R.allocUnsafe(T),L=T;let O=this.head,$=0;do{const P=O.data;if(T>P.length)_(W,P,L-T),T-=P.length;else{T===P.length?(_(W,P,L-T),++$,O.next?this.head=O.next:this.head=this.tail=null):(_(W,new A(P.buffer,P.byteOffset,T),L-T),this.head=O,O.data=P.slice(T));break}++$}while((O=O.next)!==null);return this.length-=$,W}[Symbol.for(\"nodejs.util.inspect.custom\")](T,W){return n(this,{...W,depth:0,customInspect:!1})}}})),tt=Ee(((E,d)=>{var{MathFloor:s,NumberIsInteger:c}=Ie(),{validateInteger:_}=Xe(),{ERR_INVALID_ARG_VALUE:A}=xe().codes,R=16384,n=16;function C(O,$,P){return O.highWaterMark!=null?O.highWaterMark:$?O[P]:null}function T(O){return O?n:R}function W(O,$){_($,\"value\",0),O?n=$:R=$}function L(O,$,P,Y){const k=C($,Y,P);if(k!=null){if(!c(k)||k<0){const D=Y?`options.${P}`:\"options.highWaterMark\";throw new A(D,k)}return s(k)}return T(O.objectMode)}d.exports={getHighWaterMark:L,getDefaultHighWaterMark:T,setDefaultHighWaterMark:W}})),lr=Ee(((E,d)=>{var s=Oe(),c=s.Buffer;function _(R,n){for(var C in R)n[C]=R[C]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?d.exports=s:(_(s,E),E.Buffer=A);function A(R,n,C){return c(R,n,C)}A.prototype=Object.create(c.prototype),_(c,A),A.from=function(R,n,C){if(typeof R==\"number\")throw new TypeError(\"Argument must not be a number\");return c(R,n,C)},A.alloc=function(R,n,C){if(typeof R!=\"number\")throw new TypeError(\"Argument must be a number\");var T=c(R);return n!==void 0?typeof C==\"string\"?T.fill(n,C):T.fill(n):T.fill(0),T},A.allocUnsafe=function(R){if(typeof R!=\"number\")throw new TypeError(\"Argument must be a number\");return c(R)},A.allocUnsafeSlow=function(R){if(typeof R!=\"number\")throw new TypeError(\"Argument must be a number\");return s.SlowBuffer(R)}})),ar=Ee((E=>{var d=lr().Buffer,s=d.isEncoding||function(l){switch(l=\"\"+l,l&&l.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1}};function c(l){if(!l)return\"utf8\";for(var w;;)switch(l){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return l;default:if(w)return;l=(\"\"+l).toLowerCase(),w=!0}}function _(l){var w=c(l);if(typeof w!=\"string\"&&(d.isEncoding===s||!s(l)))throw new Error(\"Unknown encoding: \"+l);return w||l}E.StringDecoder=A;function A(l){this.encoding=_(l);var w;switch(this.encoding){case\"utf16le\":this.text=O,this.end=$,w=4;break;case\"utf8\":this.fillLast=T,w=4;break;case\"base64\":this.text=P,this.end=Y,w=3;break;default:this.write=k,this.end=D;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=d.allocUnsafe(w)}A.prototype.write=function(l){if(l.length===0)return\"\";var w,S;if(this.lastNeed){if(w=this.fillLast(l),w===void 0)return\"\";S=this.lastNeed,this.lastNeed=0}else S=0;return S<l.length?w?w+this.text(l,S):this.text(l,S):w||\"\"},A.prototype.end=L,A.prototype.text=W,A.prototype.fillLast=function(l){if(this.lastNeed<=l.length)return l.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);l.copy(this.lastChar,this.lastTotal-this.lastNeed,0,l.length),this.lastNeed-=l.length};function R(l){return l<=127?0:l>>5===6?2:l>>4===14?3:l>>3===30?4:l>>6===2?-1:-2}function n(l,w,S){var y=w.length-1;if(y<S)return 0;var f=R(w[y]);return f>=0?(f>0&&(l.lastNeed=f-1),f):--y<S||f===-2?0:(f=R(w[y]),f>=0?(f>0&&(l.lastNeed=f-2),f):--y<S||f===-2?0:(f=R(w[y]),f>=0?(f>0&&(f===2?f=0:l.lastNeed=f-3),f):0))}function C(l,w,S){if((w[0]&192)!==128)return l.lastNeed=0,\"�\";if(l.lastNeed>1&&w.length>1){if((w[1]&192)!==128)return l.lastNeed=1,\"�\";if(l.lastNeed>2&&w.length>2&&(w[2]&192)!==128)return l.lastNeed=2,\"�\"}}function T(l){var w=this.lastTotal-this.lastNeed,S=C(this,l,w);if(S!==void 0)return S;if(this.lastNeed<=l.length)return l.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);l.copy(this.lastChar,w,0,l.length),this.lastNeed-=l.length}function W(l,w){var S=n(this,l,w);if(!this.lastNeed)return l.toString(\"utf8\",w);this.lastTotal=S;var y=l.length-(S-this.lastNeed);return l.copy(this.lastChar,0,y),l.toString(\"utf8\",w,y)}function L(l){var w=l&&l.length?this.write(l):\"\";return this.lastNeed?w+\"�\":w}function O(l,w){if((l.length-w)%2===0){var S=l.toString(\"utf16le\",w);if(S){var y=S.charCodeAt(S.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=l[l.length-2],this.lastChar[1]=l[l.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=l[l.length-1],l.toString(\"utf16le\",w,l.length-1)}function $(l){var w=l&&l.length?this.write(l):\"\";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return w+this.lastChar.toString(\"utf16le\",0,S)}return w}function P(l,w){var S=(l.length-w)%3;return S===0?l.toString(\"base64\",w):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=l[l.length-1]:(this.lastChar[0]=l[l.length-2],this.lastChar[1]=l[l.length-1]),l.toString(\"base64\",w,l.length-S))}function Y(l){var w=l&&l.length?this.write(l):\"\";return this.lastNeed?w+this.lastChar.toString(\"base64\",0,3-this.lastNeed):w}function k(l){return l.toString(this.encoding)}function D(l){return l&&l.length?this.write(l):\"\"}})),Tt=Ee(((E,d)=>{var s=Ue(),{PromisePrototypeThen:c,SymbolAsyncIterator:_,SymbolIterator:A}=Ie(),{Buffer:R}=Oe(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_NULL_VALUES:C}=xe().codes;function T(W,L,O){let $;if(typeof L==\"string\"||L instanceof R)return new W({objectMode:!0,...O,read(){this.push(L),this.push(null)}});let P;if(L&&L[_])P=!0,$=L[_]();else if(L&&L[A])P=!1,$=L[A]();else throw new n(\"iterable\",[\"Iterable\"],L);const Y=new W({objectMode:!0,highWaterMark:1,...O});let k=!1;Y._read=function(){k||(k=!0,l())},Y._destroy=function(w,S){c(D(w),()=>s.nextTick(S,w),y=>s.nextTick(S,y||w))};async function D(w){const S=w!=null,y=typeof $.throw==\"function\";if(S&&y){const{value:f,done:h}=await $.throw(w);if(await f,h)return}if(typeof $.return==\"function\"){const{value:f}=await $.return();await f}}async function l(){for(;;){try{const{value:w,done:S}=P?await $.next():$.next();if(S)Y.push(null);else{const y=w&&typeof w.then==\"function\"?await w:w;if(y===null)throw k=!1,new C;if(Y.push(y))continue;k=!1}}catch(w){Y.destroy(w)}break}}return Y}d.exports=T})),rt=Ee(((E,d)=>{var s=Ue(),{ArrayPrototypeIndexOf:c,NumberIsInteger:_,NumberIsNaN:A,NumberParseInt:R,ObjectDefineProperties:n,ObjectKeys:C,ObjectSetPrototypeOf:T,Promise:W,SafeSet:L,SymbolAsyncDispose:O,SymbolAsyncIterator:$,Symbol:P}=Ie();d.exports=J,J.ReadableState=oe;var{EventEmitter:Y}=ze(),{Stream:k,prependListener:D}=ut(),{Buffer:l}=Oe(),{addAbortSignal:w}=et(),S=We(),y=Ne().debuglog(\"stream\",o=>{y=o}),f=or(),h=He(),{getHighWaterMark:x,getDefaultHighWaterMark:z}=tt(),{aggregateTwoErrors:U,codes:{ERR_INVALID_ARG_TYPE:ue,ERR_METHOD_NOT_IMPLEMENTED:m,ERR_OUT_OF_RANGE:N,ERR_STREAM_PUSH_AFTER_EOF:V,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:I},AbortError:ae}=xe(),{validateObject:se}=Xe(),he=P(\"kPaused\"),{StringDecoder:_e}=ar(),H=Tt();T(J.prototype,k.prototype),T(J,k);var ie=()=>{},{errorOrDestroy:u}=h,X=1,le=2,F=4,de=8,be=16,ve=32,we=64,K=128,G=256,ne=512,pe=1024,ye=2048,g=4096,v=8192,M=16384,Q=32768,ee=65536,Z=1<<17,b=1<<18;function q(o){return{enumerable:!1,get(){return(this.state&o)!==0},set(a){a?this.state|=o:this.state&=~o}}}n(oe.prototype,{objectMode:q(X),ended:q(le),endEmitted:q(F),reading:q(de),constructed:q(be),sync:q(ve),needReadable:q(we),emittedReadable:q(K),readableListening:q(G),resumeScheduled:q(ne),errorEmitted:q(pe),emitClose:q(ye),autoDestroy:q(g),destroyed:q(v),closed:q(M),closeEmitted:q(Q),multiAwaitDrain:q(ee),readingMore:q(Z),dataEmitted:q(b)});function oe(o,a,te){typeof te!=\"boolean\"&&(te=a instanceof Ce()),this.state=6192,o&&o.objectMode&&(this.state|=X),te&&o&&o.readableObjectMode&&(this.state|=X),this.highWaterMark=o?x(this,o,\"readableHighWaterMark\",te):z(!1),this.buffer=new f,this.length=0,this.pipes=[],this.flowing=null,this[he]=null,o&&o.emitClose===!1&&(this.state&=-2049),o&&o.autoDestroy===!1&&(this.state&=-4097),this.errored=null,this.defaultEncoding=o&&o.defaultEncoding||\"utf8\",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,o&&o.encoding&&(this.decoder=new _e(o.encoding),this.encoding=o.encoding)}function J(o){if(!(this instanceof J))return new J(o);const a=this instanceof Ce();this._readableState=new oe(o,this,a),o&&(typeof o.read==\"function\"&&(this._read=o.read),typeof o.destroy==\"function\"&&(this._destroy=o.destroy),typeof o.construct==\"function\"&&(this._construct=o.construct),o.signal&&!a&&w(o.signal,this)),k.call(this,o),h.construct(this,()=>{this._readableState.needReadable&&j(this,this._readableState)})}J.prototype.destroy=h.destroy,J.prototype._undestroy=h.undestroy,J.prototype._destroy=function(o,a){a(o)},J.prototype[Y.captureRejectionSymbol]=function(o){this.destroy(o)},J.prototype[O]=function(){let o;return this.destroyed||(o=this.readableEnded?null:new ae,this.destroy(o)),new W((a,te)=>S(this,re=>re&&re!==o?te(re):a(null)))},J.prototype.push=function(o,a){return fe(this,o,a,!1)},J.prototype.unshift=function(o,a){return fe(this,o,a,!0)};function fe(o,a,te,re){y(\"readableAddChunk\",a);const ce=o._readableState;let Be;if((ce.state&X)===0&&(typeof a==\"string\"?(te=te||ce.defaultEncoding,ce.encoding!==te&&(re&&ce.encoding?a=l.from(a,te).toString(ce.encoding):(a=l.from(a,te),te=\"\"))):a instanceof l?te=\"\":k._isUint8Array(a)?(a=k._uint8ArrayToBuffer(a),te=\"\"):a!=null&&(Be=new ue(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],a))),Be)u(o,Be);else if(a===null)ce.state&=-9,i(o,ce);else if((ce.state&X)!==0||a&&a.length>0)if(re)if((ce.state&F)!==0)u(o,new I);else{if(ce.destroyed||ce.errored)return!1;Le(o,ce,a,!0)}else if(ce.ended)u(o,new V);else{if(ce.destroyed||ce.errored)return!1;ce.state&=-9,ce.decoder&&!te?(a=ce.decoder.write(a),ce.objectMode||a.length!==0?Le(o,ce,a,!1):j(o,ce)):Le(o,ce,a,!1)}else re||(ce.state&=-9,j(o,ce));return!ce.ended&&(ce.length<ce.highWaterMark||ce.length===0)}function Le(o,a,te,re){a.flowing&&a.length===0&&!a.sync&&o.listenerCount(\"data\")>0?((a.state&ee)!==0?a.awaitDrainWriters.clear():a.awaitDrainWriters=null,a.dataEmitted=!0,o.emit(\"data\",te)):(a.length+=a.objectMode?1:te.length,re?a.buffer.unshift(te):a.buffer.push(te),(a.state&we)!==0&&p(o)),j(o,a)}J.prototype.isPaused=function(){const o=this._readableState;return o[he]===!0||o.flowing===!1},J.prototype.setEncoding=function(o){const a=new _e(o);this._readableState.decoder=a,this._readableState.encoding=this._readableState.decoder.encoding;const te=this._readableState.buffer;let re=\"\";for(const ce of te)re+=a.write(ce);return te.clear(),re!==\"\"&&te.push(re),this._readableState.length=re.length,this};var r=1073741824;function e(o){if(o>r)throw new N(\"size\",\"<= 1GiB\",o);return o--,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o++,o}function t(o,a){return o<=0||a.length===0&&a.ended?0:(a.state&X)!==0?1:A(o)?a.flowing&&a.length?a.buffer.first().length:a.length:o<=a.length?o:a.ended?a.length:0}J.prototype.read=function(o){y(\"read\",o),o===void 0?o=NaN:_(o)||(o=R(o,10));const a=this._readableState,te=o;if(o>a.highWaterMark&&(a.highWaterMark=e(o)),o!==0&&(a.state&=-129),o===0&&a.needReadable&&((a.highWaterMark!==0?a.length>=a.highWaterMark:a.length>0)||a.ended))return y(\"read: emitReadable\",a.length,a.ended),a.length===0&&a.ended?ht(this):p(this),null;if(o=t(o,a),o===0&&a.ended)return a.length===0&&ht(this),null;let re=(a.state&we)!==0;if(y(\"need readable\",re),(a.length===0||a.length-o<a.highWaterMark)&&(re=!0,y(\"length less than watermark\",re)),a.ended||a.reading||a.destroyed||a.errored||!a.constructed)re=!1,y(\"reading, ended or constructing\",re);else if(re){y(\"do read\"),a.state|=40,a.length===0&&(a.state|=we);try{this._read(a.highWaterMark)}catch(Be){u(this,Be)}a.state&=-33,a.reading||(o=t(te,a))}let ce;return o>0?ce=kt(o,a):ce=null,ce===null?(a.needReadable=a.length<=a.highWaterMark,o=0):(a.length-=o,a.multiAwaitDrain?a.awaitDrainWriters.clear():a.awaitDrainWriters=null),a.length===0&&(a.ended||(a.needReadable=!0),te!==o&&a.ended&&ht(this)),ce!==null&&!a.errorEmitted&&!a.closeEmitted&&(a.dataEmitted=!0,this.emit(\"data\",ce)),ce};function i(o,a){if(y(\"onEofChunk\"),!a.ended){if(a.decoder){const te=a.decoder.end();te&&te.length&&(a.buffer.push(te),a.length+=a.objectMode?1:te.length)}a.ended=!0,a.sync?p(o):(a.needReadable=!1,a.emittedReadable=!0,B(o))}}function p(o){const a=o._readableState;y(\"emitReadable\",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(y(\"emitReadable\",a.flowing),a.emittedReadable=!0,s.nextTick(B,o))}function B(o){const a=o._readableState;y(\"emitReadable_\",a.destroyed,a.length,a.ended),!a.destroyed&&!a.errored&&(a.length||a.ended)&&(o.emit(\"readable\"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,Ot(o)}function j(o,a){!a.readingMore&&a.constructed&&(a.readingMore=!0,s.nextTick(ge,o,a))}function ge(o,a){for(;!a.reading&&!a.ended&&(a.length<a.highWaterMark||a.flowing&&a.length===0);){const te=a.length;if(y(\"maybeReadMore read 0\"),o.read(0),te===a.length)break}a.readingMore=!1}J.prototype._read=function(o){throw new m(\"_read()\")},J.prototype.pipe=function(o,a){const te=this,re=this._readableState;re.pipes.length===1&&(re.multiAwaitDrain||(re.multiAwaitDrain=!0,re.awaitDrainWriters=new L(re.awaitDrainWriters?[re.awaitDrainWriters]:[]))),re.pipes.push(o),y(\"pipe count=%d opts=%j\",re.pipes.length,a);const ce=(!a||a.end!==!1)&&o!==s.stdout&&o!==s.stderr?Pe:Je;re.endEmitted?s.nextTick(ce):te.once(\"end\",ce),o.on(\"unpipe\",Be);function Be($e,De){y(\"onunpipe\"),$e===te&&De&&De.hasUnpiped===!1&&(De.hasUnpiped=!0,wr())}function Pe(){y(\"onend\"),o.end()}let Fe,Dt=!1;function wr(){y(\"cleanup\"),o.removeListener(\"close\",bt),o.removeListener(\"finish\",wt),Fe&&o.removeListener(\"drain\",Fe),o.removeListener(\"error\",yt),o.removeListener(\"unpipe\",Be),te.removeListener(\"end\",Pe),te.removeListener(\"end\",Je),te.removeListener(\"data\",Wt),Dt=!0,Fe&&re.awaitDrainWriters&&(!o._writableState||o._writableState.needDrain)&&Fe()}function Ut(){Dt||(re.pipes.length===1&&re.pipes[0]===o?(y(\"false write response, pause\",0),re.awaitDrainWriters=o,re.multiAwaitDrain=!1):re.pipes.length>1&&re.pipes.includes(o)&&(y(\"false write response, pause\",re.awaitDrainWriters.size),re.awaitDrainWriters.add(o)),te.pause()),Fe||(Fe=Re(te,o),o.on(\"drain\",Fe))}te.on(\"data\",Wt);function Wt($e){y(\"ondata\");const De=o.write($e);y(\"dest.write\",De),De===!1&&Ut()}function yt($e){if(y(\"onerror\",$e),Je(),o.removeListener(\"error\",yt),o.listenerCount(\"error\")===0){const De=o._writableState||o._readableState;De&&!De.errorEmitted?u(o,$e):o.emit(\"error\",$e)}}D(o,\"error\",yt);function bt(){o.removeListener(\"finish\",wt),Je()}o.once(\"close\",bt);function wt(){y(\"onfinish\"),o.removeListener(\"close\",bt),Je()}o.once(\"finish\",wt);function Je(){y(\"unpipe\"),te.unpipe(o)}return o.emit(\"pipe\",te),o.writableNeedDrain===!0?Ut():re.flowing||(y(\"pipe resume\"),te.resume()),o};function Re(o,a){return function(){const re=o._readableState;re.awaitDrainWriters===a?(y(\"pipeOnDrain\",1),re.awaitDrainWriters=null):re.multiAwaitDrain&&(y(\"pipeOnDrain\",re.awaitDrainWriters.size),re.awaitDrainWriters.delete(a)),(!re.awaitDrainWriters||re.awaitDrainWriters.size===0)&&o.listenerCount(\"data\")&&o.resume()}}J.prototype.unpipe=function(o){const a=this._readableState,te={hasUnpiped:!1};if(a.pipes.length===0)return this;if(!o){const ce=a.pipes;a.pipes=[],this.pause();for(let Be=0;Be<ce.length;Be++)ce[Be].emit(\"unpipe\",this,{hasUnpiped:!1});return this}const re=c(a.pipes,o);return re===-1?this:(a.pipes.splice(re,1),a.pipes.length===0&&this.pause(),o.emit(\"unpipe\",this,te),this)},J.prototype.on=function(o,a){const te=k.prototype.on.call(this,o,a),re=this._readableState;return o===\"data\"?(re.readableListening=this.listenerCount(\"readable\")>0,re.flowing!==!1&&this.resume()):o===\"readable\"&&!re.endEmitted&&!re.readableListening&&(re.readableListening=re.needReadable=!0,re.flowing=!1,re.emittedReadable=!1,y(\"on readable\",re.length,re.reading),re.length?p(this):re.reading||s.nextTick(Te,this)),te},J.prototype.addListener=J.prototype.on,J.prototype.removeListener=function(o,a){const te=k.prototype.removeListener.call(this,o,a);return o===\"readable\"&&s.nextTick(me,this),te},J.prototype.off=J.prototype.removeListener,J.prototype.removeAllListeners=function(o){const a=k.prototype.removeAllListeners.apply(this,arguments);return(o===\"readable\"||o===void 0)&&s.nextTick(me,this),a};function me(o){const a=o._readableState;a.readableListening=o.listenerCount(\"readable\")>0,a.resumeScheduled&&a[he]===!1?a.flowing=!0:o.listenerCount(\"data\")>0?o.resume():a.readableListening||(a.flowing=null)}function Te(o){y(\"readable nexttick read 0\"),o.read(0)}J.prototype.resume=function(){const o=this._readableState;return o.flowing||(y(\"resume\"),o.flowing=!o.readableListening,Se(this,o)),o[he]=!1,this};function Se(o,a){a.resumeScheduled||(a.resumeScheduled=!0,s.nextTick(hr,o,a))}function hr(o,a){y(\"resume\",a.reading),a.reading||o.read(0),a.resumeScheduled=!1,o.emit(\"resume\"),Ot(o),a.flowing&&!a.reading&&o.read(0)}J.prototype.pause=function(){return y(\"call pause flowing=%j\",this._readableState.flowing),this._readableState.flowing!==!1&&(y(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState[he]=!0,this};function Ot(o){const a=o._readableState;for(y(\"flow\",a.flowing);a.flowing&&o.read()!==null;);}J.prototype.wrap=function(o){let a=!1;o.on(\"data\",re=>{!this.push(re)&&o.pause&&(a=!0,o.pause())}),o.on(\"end\",()=>{this.push(null)}),o.on(\"error\",re=>{u(this,re)}),o.on(\"close\",()=>{this.destroy()}),o.on(\"destroy\",()=>{this.destroy()}),this._read=()=>{a&&o.resume&&(a=!1,o.resume())};const te=C(o);for(let re=1;re<te.length;re++){const ce=te[re];this[ce]===void 0&&typeof o[ce]==\"function\"&&(this[ce]=o[ce].bind(o))}return this},J.prototype[$]=function(){return Mt(this)},J.prototype.iterator=function(o){return o!==void 0&&se(o,\"options\"),Mt(this,o)};function Mt(o,a){typeof o.read!=\"function\"&&(o=J.wrap(o,{objectMode:!0}));const te=pr(o,a);return te.stream=o,te}async function*pr(o,a){let te=ie;function re(Pe){this===o?(te(),te=ie):te=Pe}o.on(\"readable\",re);let ce;const Be=S(o,{writable:!1},Pe=>{ce=Pe?U(ce,Pe):null,te(),te=ie});try{for(;;){const Pe=o.destroyed?null:o.read();if(Pe!==null)yield Pe;else{if(ce)throw ce;if(ce===null)return;await new W(re)}}}catch(Pe){throw ce=U(ce,Pe),ce}finally{(ce||a?.destroyOnReturn!==!1)&&(ce===void 0||o._readableState.autoDestroy)?h.destroyer(o,null):(o.off(\"readable\",re),Be())}}n(J.prototype,{readable:{__proto__:null,get(){const o=this._readableState;return!!o&&o.readable!==!1&&!o.destroyed&&!o.errorEmitted&&!o.endEmitted},set(o){this._readableState&&(this._readableState.readable=!!o)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(o){this._readableState&&(this._readableState.flowing=o)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(o){this._readableState&&(this._readableState.destroyed=o)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),n(oe.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[he]!==!1},set(o){this[he]=!!o}}}),J._fromList=kt;function kt(o,a){if(a.length===0)return null;let te;return a.objectMode?te=a.buffer.shift():!o||o>=a.length?(a.decoder?te=a.buffer.join(\"\"):a.buffer.length===1?te=a.buffer.first():te=a.buffer.concat(a.length),a.buffer.clear()):te=a.buffer.consume(o,a.decoder),te}function ht(o){const a=o._readableState;y(\"endReadable\",a.endEmitted),a.endEmitted||(a.ended=!0,s.nextTick(yr,a,o))}function yr(o,a){if(y(\"endReadableNT\",o.endEmitted,o.length),!o.errored&&!o.closeEmitted&&!o.endEmitted&&o.length===0){if(o.endEmitted=!0,a.emit(\"end\"),a.writable&&a.allowHalfOpen===!1)s.nextTick(br,a);else if(o.autoDestroy){const te=a._writableState;(!te||te.autoDestroy&&(te.finished||te.writable===!1))&&a.destroy()}}}function br(o){o.writable&&!o.writableEnded&&!o.destroyed&&o.end()}J.from=function(o,a){return H(J,o,a)};var pt;function Ct(){return pt===void 0&&(pt={}),pt}J.fromWeb=function(o,a){return Ct().newStreamReadableFromReadableStream(o,a)},J.toWeb=function(o,a){return Ct().newReadableStreamFromStreamReadable(o,a)},J.wrap=function(o,a){var te,re;return new J({objectMode:(te=(re=o.readableObjectMode)!==null&&re!==void 0?re:o.objectMode)!==null&&te!==void 0?te:!0,...a,destroy(ce,Be){h.destroyer(o,ce),Be(ce)}}).wrap(o)}})),ft=Ee(((E,d)=>{var s=Ue(),{ArrayPrototypeSlice:c,Error:_,FunctionPrototypeSymbolHasInstance:A,ObjectDefineProperty:R,ObjectDefineProperties:n,ObjectSetPrototypeOf:C,StringPrototypeToLowerCase:T,Symbol:W,SymbolHasInstance:L}=Ie();d.exports=se,se.WritableState=I;var{EventEmitter:O}=ze(),$=ut().Stream,{Buffer:P}=Oe(),Y=He(),{addAbortSignal:k}=et(),{getHighWaterMark:D,getDefaultHighWaterMark:l}=tt(),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:f,ERR_STREAM_DESTROYED:h,ERR_STREAM_ALREADY_FINISHED:x,ERR_STREAM_NULL_VALUES:z,ERR_STREAM_WRITE_AFTER_END:U,ERR_UNKNOWN_ENCODING:ue}=xe().codes,{errorOrDestroy:m}=Y;C(se.prototype,$.prototype),C(se,$);function N(){}var V=W(\"kOnFinished\");function I(g,v,M){typeof M!=\"boolean\"&&(M=v instanceof Ce()),this.objectMode=!!(g&&g.objectMode),M&&(this.objectMode=this.objectMode||!!(g&&g.writableObjectMode)),this.highWaterMark=g?D(this,g,\"writableHighWaterMark\",M):l(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const Q=!!(g&&g.decodeStrings===!1);this.decodeStrings=!Q,this.defaultEncoding=g&&g.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=u.bind(void 0,v),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ae(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!g||g.emitClose!==!1,this.autoDestroy=!g||g.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[V]=[]}function ae(g){g.buffered=[],g.bufferedIndex=0,g.allBuffers=!0,g.allNoop=!0}I.prototype.getBuffer=function(){return c(this.buffered,this.bufferedIndex)},R(I.prototype,\"bufferedRequestCount\",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(g){const v=this instanceof Ce();if(!v&&!A(se,this))return new se(g);this._writableState=new I(g,this,v),g&&(typeof g.write==\"function\"&&(this._write=g.write),typeof g.writev==\"function\"&&(this._writev=g.writev),typeof g.destroy==\"function\"&&(this._destroy=g.destroy),typeof g.final==\"function\"&&(this._final=g.final),typeof g.construct==\"function\"&&(this._construct=g.construct),g.signal&&k(g.signal,this)),$.call(this,g),Y.construct(this,()=>{const M=this._writableState;M.writing||de(this,M),K(this,M)})}R(se,L,{__proto__:null,value:function(g){return A(this,g)?!0:this!==se?!1:g&&g._writableState instanceof I}}),se.prototype.pipe=function(){m(this,new f)};function he(g,v,M,Q){const ee=g._writableState;if(typeof M==\"function\")Q=M,M=ee.defaultEncoding;else{if(!M)M=ee.defaultEncoding;else if(M!==\"buffer\"&&!P.isEncoding(M))throw new ue(M);typeof Q!=\"function\"&&(Q=N)}if(v===null)throw new z;if(!ee.objectMode)if(typeof v==\"string\")ee.decodeStrings!==!1&&(v=P.from(v,M),M=\"buffer\");else if(v instanceof P)M=\"buffer\";else if($._isUint8Array(v))v=$._uint8ArrayToBuffer(v),M=\"buffer\";else throw new w(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],v);let Z;return ee.ending?Z=new U:ee.destroyed&&(Z=new h(\"write\")),Z?(s.nextTick(Q,Z),m(g,Z,!0),Z):(ee.pendingcb++,_e(g,ee,v,M,Q))}se.prototype.write=function(g,v,M){return he(this,g,v,M)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){const g=this._writableState;g.corked&&(g.corked--,g.writing||de(this,g))},se.prototype.setDefaultEncoding=function(v){if(typeof v==\"string\"&&(v=T(v)),!P.isEncoding(v))throw new ue(v);return this._writableState.defaultEncoding=v,this};function _e(g,v,M,Q,ee){const Z=v.objectMode?1:M.length;v.length+=Z;const b=v.length<v.highWaterMark;return b||(v.needDrain=!0),v.writing||v.corked||v.errored||!v.constructed?(v.buffered.push({chunk:M,encoding:Q,callback:ee}),v.allBuffers&&Q!==\"buffer\"&&(v.allBuffers=!1),v.allNoop&&ee!==N&&(v.allNoop=!1)):(v.writelen=Z,v.writecb=ee,v.writing=!0,v.sync=!0,g._write(M,Q,v.onwrite),v.sync=!1),b&&!v.errored&&!v.destroyed}function H(g,v,M,Q,ee,Z,b){v.writelen=Q,v.writecb=b,v.writing=!0,v.sync=!0,v.destroyed?v.onwrite(new h(\"write\")):M?g._writev(ee,v.onwrite):g._write(ee,Z,v.onwrite),v.sync=!1}function ie(g,v,M,Q){--v.pendingcb,Q(M),F(v),m(g,M)}function u(g,v){const M=g._writableState,Q=M.sync,ee=M.writecb;if(typeof ee!=\"function\"){m(g,new y);return}M.writing=!1,M.writecb=null,M.length-=M.writelen,M.writelen=0,v?(v.stack,M.errored||(M.errored=v),g._readableState&&!g._readableState.errored&&(g._readableState.errored=v),Q?s.nextTick(ie,g,M,v,ee):ie(g,M,v,ee)):(M.buffered.length>M.bufferedIndex&&de(g,M),Q?M.afterWriteTickInfo!==null&&M.afterWriteTickInfo.cb===ee?M.afterWriteTickInfo.count++:(M.afterWriteTickInfo={count:1,cb:ee,stream:g,state:M},s.nextTick(X,M.afterWriteTickInfo)):le(g,M,1,ee))}function X({stream:g,state:v,count:M,cb:Q}){return v.afterWriteTickInfo=null,le(g,v,M,Q)}function le(g,v,M,Q){for(!v.ending&&!g.destroyed&&v.length===0&&v.needDrain&&(v.needDrain=!1,g.emit(\"drain\"));M-- >0;)v.pendingcb--,Q();v.destroyed&&F(v),K(g,v)}function F(g){if(g.writing)return;for(let ee=g.bufferedIndex;ee<g.buffered.length;++ee){var v;const{chunk:Z,callback:b}=g.buffered[ee],q=g.objectMode?1:Z.length;g.length-=q,b((v=g.errored)!==null&&v!==void 0?v:new h(\"write\"))}const M=g[V].splice(0);for(let ee=0;ee<M.length;ee++){var Q;M[ee]((Q=g.errored)!==null&&Q!==void 0?Q:new h(\"end\"))}ae(g)}function de(g,v){if(v.corked||v.bufferProcessing||v.destroyed||!v.constructed)return;const{buffered:M,bufferedIndex:Q,objectMode:ee}=v,Z=M.length-Q;if(!Z)return;let b=Q;if(v.bufferProcessing=!0,Z>1&&g._writev){v.pendingcb-=Z-1;const q=v.allNoop?N:J=>{for(let fe=b;fe<M.length;++fe)M[fe].callback(J)},oe=v.allNoop&&b===0?M:c(M,b);oe.allBuffers=v.allBuffers,H(g,v,!0,v.length,oe,\"\",q),ae(v)}else{do{const{chunk:q,encoding:oe,callback:J}=M[b];M[b++]=null,H(g,v,!1,ee?1:q.length,q,oe,J)}while(b<M.length&&!v.writing);b===M.length?ae(v):b>256?(M.splice(0,b),v.bufferedIndex=0):v.bufferedIndex=b}v.bufferProcessing=!1}se.prototype._write=function(g,v,M){if(this._writev)this._writev([{chunk:g,encoding:v}],M);else throw new S(\"_write()\")},se.prototype._writev=null,se.prototype.end=function(g,v,M){const Q=this._writableState;typeof g==\"function\"?(M=g,g=null,v=null):typeof v==\"function\"&&(M=v,v=null);let ee;if(g!=null){const Z=he(this,g,v);Z instanceof _&&(ee=Z)}return Q.corked&&(Q.corked=1,this.uncork()),ee||(!Q.errored&&!Q.ending?(Q.ending=!0,K(this,Q,!0),Q.ended=!0):Q.finished?ee=new x(\"end\"):Q.destroyed&&(ee=new h(\"end\"))),typeof M==\"function\"&&(ee||Q.finished?s.nextTick(M,ee):Q[V].push(M)),this};function be(g){return g.ending&&!g.destroyed&&g.constructed&&g.length===0&&!g.errored&&g.buffered.length===0&&!g.finished&&!g.writing&&!g.errorEmitted&&!g.closeEmitted}function ve(g,v){let M=!1;function Q(ee){if(M){m(g,ee??y());return}if(M=!0,v.pendingcb--,ee){const Z=v[V].splice(0);for(let b=0;b<Z.length;b++)Z[b](ee);m(g,ee,v.sync)}else be(v)&&(v.prefinished=!0,g.emit(\"prefinish\"),v.pendingcb++,s.nextTick(G,g,v))}v.sync=!0,v.pendingcb++;try{g._final(Q)}catch(ee){Q(ee)}v.sync=!1}function we(g,v){!v.prefinished&&!v.finalCalled&&(typeof g._final==\"function\"&&!v.destroyed?(v.finalCalled=!0,ve(g,v)):(v.prefinished=!0,g.emit(\"prefinish\")))}function K(g,v,M){be(v)&&(we(g,v),v.pendingcb===0&&(M?(v.pendingcb++,s.nextTick((Q,ee)=>{be(ee)?G(Q,ee):ee.pendingcb--},g,v)):be(v)&&(v.pendingcb++,G(g,v))))}function G(g,v){v.pendingcb--,v.finished=!0;const M=v[V].splice(0);for(let Q=0;Q<M.length;Q++)M[Q]();if(g.emit(\"finish\"),v.autoDestroy){const Q=g._readableState;(!Q||Q.autoDestroy&&(Q.endEmitted||Q.readable===!1))&&g.destroy()}}n(se.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(g){this._writableState&&(this._writableState.destroyed=g)}},writable:{__proto__:null,get(){const g=this._writableState;return!!g&&g.writable!==!1&&!g.destroyed&&!g.errored&&!g.ending&&!g.ended},set(g){this._writableState&&(this._writableState.writable=!!g)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const g=this._writableState;return g?!g.destroyed&&!g.ending&&g.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var ne=Y.destroy;se.prototype.destroy=function(g,v){const M=this._writableState;return!M.destroyed&&(M.bufferedIndex<M.buffered.length||M[V].length)&&s.nextTick(F,M),ne.call(this,g,v),this},se.prototype._undestroy=Y.undestroy,se.prototype._destroy=function(g,v){v(g)},se.prototype[O.captureRejectionSymbol]=function(g){this.destroy(g)};var pe;function ye(){return pe===void 0&&(pe={}),pe}se.fromWeb=function(g,v){return ye().newStreamWritableFromWritableStream(g,v)},se.toWeb=function(g){return ye().newWritableStreamFromStreamWritable(g)}})),sr=Ee(((E,d)=>{var s=Ue(),c=Oe(),{isReadable:_,isWritable:A,isIterable:R,isNodeStream:n,isReadableNodeStream:C,isWritableNodeStream:T,isDuplexNodeStream:W,isReadableStream:L,isWritableStream:O}=ke(),$=We(),{AbortError:P,codes:{ERR_INVALID_ARG_TYPE:Y,ERR_INVALID_RETURN_VALUE:k}}=xe(),{destroyer:D}=He(),l=Ce(),w=rt(),S=ft(),{createDeferredPromise:y}=Ne(),f=Tt(),h=globalThis.Blob||c.Blob,x=typeof h<\"u\"?function(I){return I instanceof h}:function(I){return!1},z=globalThis.AbortController||Ke().AbortController,{FunctionPrototypeCall:U}=Ie(),ue=class extends l{constructor(V){super(V),V?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),V?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};d.exports=function V(I,ae){if(W(I))return I;if(C(I))return N({readable:I});if(T(I))return N({writable:I});if(n(I))return N({writable:!1,readable:!1});if(L(I))return N({readable:w.fromWeb(I)});if(O(I))return N({writable:S.fromWeb(I)});if(typeof I==\"function\"){const{value:he,write:_e,final:H,destroy:ie}=m(I);if(R(he))return f(ue,he,{objectMode:!0,write:_e,final:H,destroy:ie});const u=he?.then;if(typeof u==\"function\"){let X;const le=U(u,he,F=>{if(F!=null)throw new k(\"nully\",\"body\",F)},F=>{D(X,F)});return X=new ue({objectMode:!0,readable:!1,write:_e,final(F){H(async()=>{try{await le,s.nextTick(F,null)}catch(de){s.nextTick(F,de)}})},destroy:ie})}throw new k(\"Iterable, AsyncIterable or AsyncFunction\",ae,he)}if(x(I))return V(I.arrayBuffer());if(R(I))return f(ue,I,{objectMode:!0,writable:!1});if(L(I?.readable)&&O(I?.writable))return ue.fromWeb(I);if(typeof I?.writable==\"object\"||typeof I?.readable==\"object\")return N({readable:I!=null&&I.readable?C(I?.readable)?I?.readable:V(I.readable):void 0,writable:I!=null&&I.writable?T(I?.writable)?I?.writable:V(I.writable):void 0});const se=I?.then;if(typeof se==\"function\"){let he;return U(se,I,_e=>{_e!=null&&he.push(_e),he.push(null)},_e=>{D(he,_e)}),he=new ue({objectMode:!0,writable:!1,read(){}})}throw new Y(ae,[\"Blob\",\"ReadableStream\",\"WritableStream\",\"Stream\",\"Iterable\",\"AsyncIterable\",\"Function\",\"{ readable, writable } pair\",\"Promise\"],I)};function m(V){let{promise:I,resolve:ae}=y();const se=new z,he=se.signal;return{value:V((async function*(){for(;;){const _e=I;I=null;const{chunk:H,done:ie,cb:u}=await _e;if(s.nextTick(u),ie)return;if(he.aborted)throw new P(void 0,{cause:he.reason});({promise:I,resolve:ae}=y()),yield H}})(),{signal:he}),write(_e,H,ie){const u=ae;ae=null,u({chunk:_e,done:!1,cb:ie})},final(_e){const H=ae;ae=null,H({done:!0,cb:_e})},destroy(_e,H){se.abort(),H(_e)}}}function N(V){const I=V.readable&&typeof V.readable.read!=\"function\"?w.wrap(V.readable):V.readable,ae=V.writable;let se=!!_(I),he=!!A(ae),_e,H,ie,u,X;function le(F){const de=u;u=null,de?de(F):F&&X.destroy(F)}return X=new ue({readableObjectMode:!!(I!=null&&I.readableObjectMode),writableObjectMode:!!(ae!=null&&ae.writableObjectMode),readable:se,writable:he}),he&&($(ae,F=>{he=!1,F&&D(I,F),le(F)}),X._write=function(F,de,be){ae.write(F,de)?be():_e=be},X._final=function(F){ae.end(),H=F},ae.on(\"drain\",function(){if(_e){const F=_e;_e=null,F()}}),ae.on(\"finish\",function(){if(H){const F=H;H=null,F()}})),se&&($(I,F=>{se=!1,F&&D(I,F),le(F)}),I.on(\"readable\",function(){if(ie){const F=ie;ie=null,F()}}),I.on(\"end\",function(){X.push(null)}),X._read=function(){for(;;){const F=I.read();if(F===null){ie=X._read;return}if(!X.push(F))return}}),X._destroy=function(F,de){!F&&u!==null&&(F=new P),ie=null,_e=null,H=null,u===null?de(F):(u=de,D(ae,F),D(I,F))},X}})),Ce=Ee(((E,d)=>{var{ObjectDefineProperties:s,ObjectGetOwnPropertyDescriptor:c,ObjectKeys:_,ObjectSetPrototypeOf:A}=Ie();d.exports=C;var R=rt(),n=ft();A(C.prototype,R.prototype),A(C,R);{const O=_(n.prototype);for(let $=0;$<O.length;$++){const P=O[$];C.prototype[P]||(C.prototype[P]=n.prototype[P])}}function C(O){if(!(this instanceof C))return new C(O);R.call(this,O),n.call(this,O),O?(this.allowHalfOpen=O.allowHalfOpen!==!1,O.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),O.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(C.prototype,{writable:{__proto__:null,...c(n.prototype,\"writable\")},writableHighWaterMark:{__proto__:null,...c(n.prototype,\"writableHighWaterMark\")},writableObjectMode:{__proto__:null,...c(n.prototype,\"writableObjectMode\")},writableBuffer:{__proto__:null,...c(n.prototype,\"writableBuffer\")},writableLength:{__proto__:null,...c(n.prototype,\"writableLength\")},writableFinished:{__proto__:null,...c(n.prototype,\"writableFinished\")},writableCorked:{__proto__:null,...c(n.prototype,\"writableCorked\")},writableEnded:{__proto__:null,...c(n.prototype,\"writableEnded\")},writableNeedDrain:{__proto__:null,...c(n.prototype,\"writableNeedDrain\")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(O){this._readableState&&this._writableState&&(this._readableState.destroyed=O,this._writableState.destroyed=O)}}});var T;function W(){return T===void 0&&(T={}),T}C.fromWeb=function(O,$){return W().newStreamDuplexFromReadableWritablePair(O,$)},C.toWeb=function(O){return W().newReadableWritablePairFromDuplex(O)};var L;C.from=function(O){return L||(L=sr()),L(O,\"body\")}})),It=Ee(((E,d)=>{var{ObjectSetPrototypeOf:s,Symbol:c}=Ie();d.exports=C;var{ERR_METHOD_NOT_IMPLEMENTED:_}=xe().codes,A=Ce(),{getHighWaterMark:R}=tt();s(C.prototype,A.prototype),s(C,A);var n=c(\"kCallback\");function C(L){if(!(this instanceof C))return new C(L);const O=L?R(this,L,\"readableHighWaterMark\",!0):null;O===0&&(L={...L,highWaterMark:null,readableHighWaterMark:O,writableHighWaterMark:L.writableHighWaterMark||0}),A.call(this,L),this._readableState.sync=!1,this[n]=null,L&&(typeof L.transform==\"function\"&&(this._transform=L.transform),typeof L.flush==\"function\"&&(this._flush=L.flush)),this.on(\"prefinish\",W)}function T(L){typeof this._flush==\"function\"&&!this.destroyed?this._flush((O,$)=>{if(O){L?L(O):this.destroy(O);return}$!=null&&this.push($),this.push(null),L&&L()}):(this.push(null),L&&L())}function W(){this._final!==T&&T.call(this)}C.prototype._final=T,C.prototype._transform=function(L,O,$){throw new _(\"_transform()\")},C.prototype._write=function(L,O,$){const P=this._readableState,Y=this._writableState,k=P.length;this._transform(L,O,(D,l)=>{if(D){$(D);return}l!=null&&this.push(l),Y.ended||k===P.length||P.length<P.highWaterMark?$():this[n]=$})},C.prototype._read=function(){if(this[n]){const L=this[n];this[n]=null,L()}}})),Bt=Ee(((E,d)=>{var{ObjectSetPrototypeOf:s}=Ie();d.exports=_;var c=It();s(_.prototype,c.prototype),s(_,c);function _(A){if(!(this instanceof _))return new _(A);c.call(this,A)}_.prototype._transform=function(A,R,n){n(null,A)}})),ct=Ee(((E,d)=>{var s=Ue(),{ArrayIsArray:c,Promise:_,SymbolAsyncIterator:A,SymbolDispose:R}=Ie(),n=We(),{once:C}=Ne(),T=He(),W=Ce(),{aggregateTwoErrors:L,codes:{ERR_INVALID_ARG_TYPE:O,ERR_INVALID_RETURN_VALUE:$,ERR_MISSING_ARGS:P,ERR_STREAM_DESTROYED:Y,ERR_STREAM_PREMATURE_CLOSE:k},AbortError:D}=xe(),{validateFunction:l,validateAbortSignal:w}=Xe(),{isIterable:S,isReadable:y,isReadableNodeStream:f,isNodeStream:h,isTransformStream:x,isWebStream:z,isReadableStream:U,isReadableFinished:ue}=ke(),m=globalThis.AbortController||Ke().AbortController,N,V,I;function ae(F,de,be){let ve=!1;return F.on(\"close\",()=>{ve=!0}),{destroy:we=>{ve||(ve=!0,T.destroyer(F,we||new Y(\"pipe\")))},cleanup:n(F,{readable:de,writable:be},we=>{ve=!we})}}function se(F){return l(F[F.length-1],\"streams[stream.length - 1]\"),F.pop()}function he(F){if(S(F))return F;if(f(F))return _e(F);throw new O(\"val\",[\"Readable\",\"Iterable\",\"AsyncIterable\"],F)}async function*_e(F){V||(V=rt()),yield*V.prototype[A].call(F)}async function H(F,de,be,{end:ve}){let we,K=null;const G=ye=>{if(ye&&(we=ye),K){const g=K;K=null,g()}},ne=()=>new _((ye,g)=>{we?g(we):K=()=>{we?g(we):ye()}});de.on(\"drain\",G);const pe=n(de,{readable:!1},G);try{de.writableNeedDrain&&await ne();for await(const ye of F)de.write(ye)||await ne();ve&&(de.end(),await ne()),be()}catch(ye){be(we!==ye?L(we,ye):ye)}finally{pe(),de.off(\"drain\",G)}}async function ie(F,de,be,{end:ve}){x(de)&&(de=de.writable);const we=de.getWriter();try{for await(const K of F)await we.ready,we.write(K).catch(()=>{});await we.ready,ve&&await we.close(),be()}catch(K){try{await we.abort(K),be(K)}catch(G){be(G)}}}function u(...F){return X(F,C(se(F)))}function X(F,de,be){if(F.length===1&&c(F[0])&&(F=F[0]),F.length<2)throw new P(\"streams\");const ve=new m,we=ve.signal,K=be?.signal,G=[];w(K,\"options.signal\");function ne(){ee(new D)}I=I||Ne().addAbortListener;let pe;K&&(pe=I(K,ne));let ye,g;const v=[];let M=0;function Q(J){ee(J,--M===0)}function ee(J,fe){var Le;if(J&&(!ye||ye.code===\"ERR_STREAM_PREMATURE_CLOSE\")&&(ye=J),!(!ye&&!fe)){for(;v.length;)v.shift()(ye);(Le=pe)===null||Le===void 0||Le[R](),ve.abort(),fe&&(ye||G.forEach(r=>r()),s.nextTick(de,ye,g))}}let Z;for(let J=0;J<F.length;J++){const fe=F[J],Le=J<F.length-1,r=J>0,e=Le||be?.end!==!1,t=J===F.length-1;if(h(fe)){let i=function(p){p&&p.name!==\"AbortError\"&&p.code!==\"ERR_STREAM_PREMATURE_CLOSE\"&&Q(p)};var oe=i;if(e){const{destroy:p,cleanup:B}=ae(fe,Le,r);v.push(p),y(fe)&&t&&G.push(B)}fe.on(\"error\",i),y(fe)&&t&&G.push(()=>{fe.removeListener(\"error\",i)})}if(J===0)if(typeof fe==\"function\"){if(Z=fe({signal:we}),!S(Z))throw new $(\"Iterable, AsyncIterable or Stream\",\"source\",Z)}else S(fe)||f(fe)||x(fe)?Z=fe:Z=W.from(fe);else if(typeof fe==\"function\"){if(x(Z)){var b;Z=he((b=Z)===null||b===void 0?void 0:b.readable)}else Z=he(Z);if(Z=fe(Z,{signal:we}),Le){if(!S(Z,!0))throw new $(\"AsyncIterable\",`transform[${J-1}]`,Z)}else{var q;N||(N=Bt());const i=new N({objectMode:!0}),p=(q=Z)===null||q===void 0?void 0:q.then;if(typeof p==\"function\")M++,p.call(Z,ge=>{g=ge,ge!=null&&i.write(ge),e&&i.end(),s.nextTick(Q)},ge=>{i.destroy(ge),s.nextTick(Q,ge)});else if(S(Z,!0))M++,H(Z,i,Q,{end:e});else if(U(Z)||x(Z)){const ge=Z.readable||Z;M++,H(ge,i,Q,{end:e})}else throw new $(\"AsyncIterable or Promise\",\"destination\",Z);Z=i;const{destroy:B,cleanup:j}=ae(Z,!1,!0);v.push(B),t&&G.push(j)}}else if(h(fe)){if(f(Z)){M+=2;const i=le(Z,fe,Q,{end:e});y(fe)&&t&&G.push(i)}else if(x(Z)||U(Z)){const i=Z.readable||Z;M++,H(i,fe,Q,{end:e})}else if(S(Z))M++,H(Z,fe,Q,{end:e});else throw new O(\"val\",[\"Readable\",\"Iterable\",\"AsyncIterable\",\"ReadableStream\",\"TransformStream\"],Z);Z=fe}else if(z(fe)){if(f(Z))M++,ie(he(Z),fe,Q,{end:e});else if(U(Z)||S(Z))M++,ie(Z,fe,Q,{end:e});else if(x(Z))M++,ie(Z.readable,fe,Q,{end:e});else throw new O(\"val\",[\"Readable\",\"Iterable\",\"AsyncIterable\",\"ReadableStream\",\"TransformStream\"],Z);Z=fe}else Z=W.from(fe)}return(we!=null&&we.aborted||K!=null&&K.aborted)&&s.nextTick(ne),Z}function le(F,de,be,{end:ve}){let we=!1;if(de.on(\"close\",()=>{we||be(new k)}),F.pipe(de,{end:!1}),ve){let G=function(){we=!0,de.end()};var K=G;ue(F)?s.nextTick(G):F.once(\"end\",G)}else be();return n(F,{readable:!0,writable:!1},G=>{const ne=F._readableState;G&&G.code===\"ERR_STREAM_PREMATURE_CLOSE\"&&ne&&ne.ended&&!ne.errored&&!ne.errorEmitted?F.once(\"end\",be).once(\"error\",be):be(G)}),n(de,{readable:!1,writable:!0},be)}d.exports={pipelineImpl:X,pipeline:u}})),xt=Ee(((E,d)=>{var{pipeline:s}=ct(),c=Ce(),{destroyer:_}=He(),{isNodeStream:A,isReadable:R,isWritable:n,isWebStream:C,isTransformStream:T,isWritableStream:W,isReadableStream:L}=ke(),{AbortError:O,codes:{ERR_INVALID_ARG_VALUE:$,ERR_MISSING_ARGS:P}}=xe(),Y=We();d.exports=function(...D){if(D.length===0)throw new P(\"streams\");if(D.length===1)return c.from(D[0]);const l=[...D];if(typeof D[0]==\"function\"&&(D[0]=c.from(D[0])),typeof D[D.length-1]==\"function\"){const N=D.length-1;D[N]=c.from(D[N])}for(let N=0;N<D.length;++N)if(!(!A(D[N])&&!C(D[N]))){if(N<D.length-1&&!(R(D[N])||L(D[N])||T(D[N])))throw new $(`streams[${N}]`,l[N],\"must be readable\");if(N>0&&!(n(D[N])||W(D[N])||T(D[N])))throw new $(`streams[${N}]`,l[N],\"must be writable\")}let w,S,y,f,h;function x(N){const V=f;f=null,V?V(N):N?h.destroy(N):!m&&!ue&&h.destroy()}const z=D[0],U=s(D,x),ue=!!(n(z)||W(z)||T(z)),m=!!(R(U)||L(U)||T(U));if(h=new c({writableObjectMode:!!(z!=null&&z.writableObjectMode),readableObjectMode:!!(U!=null&&U.readableObjectMode),writable:ue,readable:m}),ue){if(A(z))h._write=function(V,I,ae){z.write(V,I)?ae():w=ae},h._final=function(V){z.end(),S=V},z.on(\"drain\",function(){if(w){const V=w;w=null,V()}});else if(C(z)){const V=(T(z)?z.writable:z).getWriter();h._write=async function(I,ae,se){try{await V.ready,V.write(I).catch(()=>{}),se()}catch(he){se(he)}},h._final=async function(I){try{await V.ready,V.close().catch(()=>{}),S=I}catch(ae){I(ae)}}}const N=T(U)?U.readable:U;Y(N,()=>{if(S){const V=S;S=null,V()}})}if(m){if(A(U))U.on(\"readable\",function(){if(y){const N=y;y=null,N()}}),U.on(\"end\",function(){h.push(null)}),h._read=function(){for(;;){const N=U.read();if(N===null){y=h._read;return}if(!h.push(N))return}};else if(C(U)){const N=(T(U)?U.readable:U).getReader();h._read=async function(){for(;;)try{const{value:V,done:I}=await N.read();if(!h.push(V))return;if(I){h.push(null);return}}catch{return}}}}return h._destroy=function(N,V){!N&&f!==null&&(N=new O),y=null,w=null,S=null,f===null?V(N):(f=V,A(U)&&_(U,N))},h}})),ur=Ee(((E,d)=>{var s=globalThis.AbortController||Ke().AbortController,{codes:{ERR_INVALID_ARG_VALUE:c,ERR_INVALID_ARG_TYPE:_,ERR_MISSING_ARGS:A,ERR_OUT_OF_RANGE:R},AbortError:n}=xe(),{validateAbortSignal:C,validateInteger:T,validateObject:W}=Xe(),L=Ie().Symbol(\"kWeak\"),O=Ie().Symbol(\"kResistStopPropagation\"),{finished:$}=We(),P=xt(),{addAbortSignalNoValidate:Y}=et(),{isWritable:k,isNodeStream:D}=ke(),{deprecate:l}=Ne(),{ArrayPrototypePush:w,Boolean:S,MathFloor:y,Number:f,NumberIsNaN:h,Promise:x,PromiseReject:z,PromiseResolve:U,PromisePrototypeThen:ue,Symbol:m}=Ie(),N=m(\"kEmpty\"),V=m(\"kEof\");function I(K,G){if(G!=null&&W(G,\"options\"),G?.signal!=null&&C(G.signal,\"options.signal\"),D(K)&&!k(K))throw new c(\"stream\",K,\"must be writable\");const ne=P(this,K);return G!=null&&G.signal&&Y(G.signal,ne),ne}function ae(K,G){if(typeof K!=\"function\")throw new _(\"fn\",[\"Function\",\"AsyncFunction\"],K);G!=null&&W(G,\"options\"),G?.signal!=null&&C(G.signal,\"options.signal\");let ne=1;G?.concurrency!=null&&(ne=y(G.concurrency));let pe=ne-1;return G?.highWaterMark!=null&&(pe=y(G.highWaterMark)),T(ne,\"options.concurrency\",1),T(pe,\"options.highWaterMark\",0),pe+=ne,async function*(){const g=Ne().AbortSignalAny([G?.signal].filter(S)),v=this,M=[],Q={signal:g};let ee,Z,b=!1,q=0;function oe(){b=!0,J()}function J(){q-=1,fe()}function fe(){Z&&!b&&q<ne&&M.length<pe&&(Z(),Z=null)}async function Le(){try{for await(let r of v){if(b)return;if(g.aborted)throw new n;try{if(r=K(r,Q),r===N)continue;r=U(r)}catch(e){r=z(e)}q+=1,ue(r,J,oe),M.push(r),ee&&(ee(),ee=null),!b&&(M.length>=pe||q>=ne)&&await new x(e=>{Z=e})}M.push(V)}catch(r){const e=z(r);ue(e,J,oe),M.push(e)}finally{b=!0,ee&&(ee(),ee=null)}}Le();try{for(;;){for(;M.length>0;){const r=await M[0];if(r===V)return;if(g.aborted)throw new n;r!==N&&(yield r),M.shift(),fe()}await new x(r=>{ee=r})}}finally{b=!0,Z&&(Z(),Z=null)}}.call(this)}function se(K=void 0){return K!=null&&W(K,\"options\"),K?.signal!=null&&C(K.signal,\"options.signal\"),async function*(){let ne=0;for await(const ye of this){var pe;if(K!=null&&(pe=K.signal)!==null&&pe!==void 0&&pe.aborted)throw new n({cause:K.signal.reason});yield[ne++,ye]}}.call(this)}async function he(K,G=void 0){for await(const ne of u.call(this,K,G))return!0;return!1}async function _e(K,G=void 0){if(typeof K!=\"function\")throw new _(\"fn\",[\"Function\",\"AsyncFunction\"],K);return!await he.call(this,async(...ne)=>!await K(...ne),G)}async function H(K,G){for await(const ne of u.call(this,K,G))return ne}async function ie(K,G){if(typeof K!=\"function\")throw new _(\"fn\",[\"Function\",\"AsyncFunction\"],K);async function ne(pe,ye){return await K(pe,ye),N}for await(const pe of ae.call(this,ne,G));}function u(K,G){if(typeof K!=\"function\")throw new _(\"fn\",[\"Function\",\"AsyncFunction\"],K);async function ne(pe,ye){return await K(pe,ye)?pe:N}return ae.call(this,ne,G)}var X=class extends A{constructor(){super(\"reduce\"),this.message=\"Reduce of an empty stream requires an initial value\"}};async function le(K,G,ne){var pe;if(typeof K!=\"function\")throw new _(\"reducer\",[\"Function\",\"AsyncFunction\"],K);ne!=null&&W(ne,\"options\"),ne?.signal!=null&&C(ne.signal,\"options.signal\");let ye=arguments.length>1;if(ne!=null&&(pe=ne.signal)!==null&&pe!==void 0&&pe.aborted){const ee=new n(void 0,{cause:ne.signal.reason});throw this.once(\"error\",()=>{}),await $(this.destroy(ee)),ee}const g=new s,v=g.signal;if(ne!=null&&ne.signal){const ee={once:!0,[L]:this,[O]:!0};ne.signal.addEventListener(\"abort\",()=>g.abort(),ee)}let M=!1;try{for await(const ee of this){var Q;if(M=!0,ne!=null&&(Q=ne.signal)!==null&&Q!==void 0&&Q.aborted)throw new n;ye?G=await K(G,ee,{signal:v}):(G=ee,ye=!0)}if(!M&&!ye)throw new X}finally{g.abort()}return G}async function F(K){K!=null&&W(K,\"options\"),K?.signal!=null&&C(K.signal,\"options.signal\");const G=[];for await(const pe of this){var ne;if(K!=null&&(ne=K.signal)!==null&&ne!==void 0&&ne.aborted)throw new n(void 0,{cause:K.signal.reason});w(G,pe)}return G}function de(K,G){const ne=ae.call(this,K,G);return async function*(){for await(const ye of ne)yield*ye}.call(this)}function be(K){if(K=f(K),h(K))return 0;if(K<0)throw new R(\"number\",\">= 0\",K);return K}function ve(K,G=void 0){return G!=null&&W(G,\"options\"),G?.signal!=null&&C(G.signal,\"options.signal\"),K=be(K),async function*(){var pe;if(G!=null&&(pe=G.signal)!==null&&pe!==void 0&&pe.aborted)throw new n;for await(const g of this){var ye;if(G!=null&&(ye=G.signal)!==null&&ye!==void 0&&ye.aborted)throw new n;K--<=0&&(yield g)}}.call(this)}function we(K,G=void 0){return G!=null&&W(G,\"options\"),G?.signal!=null&&C(G.signal,\"options.signal\"),K=be(K),async function*(){var pe;if(G!=null&&(pe=G.signal)!==null&&pe!==void 0&&pe.aborted)throw new n;for await(const g of this){var ye;if(G!=null&&(ye=G.signal)!==null&&ye!==void 0&&ye.aborted)throw new n;if(K-- >0&&(yield g),K<=0)return}}.call(this)}d.exports.streamReturningOperators={asIndexedPairs:l(se,\"readable.asIndexedPairs will be removed in a future version.\"),drop:ve,filter:u,flatMap:de,map:ae,take:we,compose:I},d.exports.promiseReturningOperators={every:_e,forEach:ie,reduce:le,toArray:F,some:he,find:H}})),Lt=Ee(((E,d)=>{var{ArrayPrototypePop:s,Promise:c}=Ie(),{isIterable:_,isNodeStream:A,isWebStream:R}=ke(),{pipelineImpl:n}=ct(),{finished:C}=We();Nt();function T(...W){return new c((L,O)=>{let $,P;const Y=W[W.length-1];if(Y&&typeof Y==\"object\"&&!A(Y)&&!_(Y)&&!R(Y)){const k=s(W);$=k.signal,P=k.end}n(W,(k,D)=>{k?O(k):L(D)},{signal:$,end:P})})}d.exports={finished:C,pipeline:T}})),Nt=Ee(((E,d)=>{var{Buffer:s}=Oe(),{ObjectDefineProperty:c,ObjectKeys:_,ReflectApply:A}=Ie(),{promisify:{custom:R}}=Ne(),{streamReturningOperators:n,promiseReturningOperators:C}=ur(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:T}}=xe(),W=xt(),{setDefaultHighWaterMark:L,getDefaultHighWaterMark:O}=tt(),{pipeline:$}=ct(),{destroyer:P}=He(),Y=We(),k=Lt(),D=ke(),l=d.exports=ut().Stream;l.isDestroyed=D.isDestroyed,l.isDisturbed=D.isDisturbed,l.isErrored=D.isErrored,l.isReadable=D.isReadable,l.isWritable=D.isWritable,l.Readable=rt();for(const y of _(n)){let h=function(...x){if(new.target)throw T();return l.Readable.from(A(f,this,x))};var S=h;const f=n[y];c(h,\"name\",{__proto__:null,value:f.name}),c(h,\"length\",{__proto__:null,value:f.length}),c(l.Readable.prototype,y,{__proto__:null,value:h,enumerable:!1,configurable:!0,writable:!0})}for(const y of _(C)){let h=function(...z){if(new.target)throw T();return A(f,this,z)};var S=h;const f=C[y];c(h,\"name\",{__proto__:null,value:f.name}),c(h,\"length\",{__proto__:null,value:f.length}),c(l.Readable.prototype,y,{__proto__:null,value:h,enumerable:!1,configurable:!0,writable:!0})}l.Writable=ft(),l.Duplex=Ce(),l.Transform=It(),l.PassThrough=Bt(),l.pipeline=$;var{addAbortSignal:w}=et();l.addAbortSignal=w,l.finished=Y,l.destroy=P,l.compose=W,l.setDefaultHighWaterMark=L,l.getDefaultHighWaterMark=O,c(l,\"promises\",{__proto__:null,configurable:!0,enumerable:!0,get(){return k}}),c($,R,{__proto__:null,enumerable:!0,get(){return k.pipeline}}),c(Y,R,{__proto__:null,enumerable:!0,get(){return k.finished}}),l.Stream=l,l._isUint8Array=function(f){return f instanceof Uint8Array},l._uint8ArrayToBuffer=function(f){return s.from(f.buffer,f.byteOffset,f.byteLength)}})),fr=Ee(((E,d)=>{var s=Nt(),c=Lt(),_=s.Readable.destroy;d.exports=s.Readable,d.exports._uint8ArrayToBuffer=s._uint8ArrayToBuffer,d.exports._isUint8Array=s._isUint8Array,d.exports.isDisturbed=s.isDisturbed,d.exports.isErrored=s.isErrored,d.exports.isReadable=s.isReadable,d.exports.Readable=s.Readable,d.exports.Writable=s.Writable,d.exports.Duplex=s.Duplex,d.exports.Transform=s.Transform,d.exports.PassThrough=s.PassThrough,d.exports.addAbortSignal=s.addAbortSignal,d.exports.finished=s.finished,d.exports.destroy=s.destroy,d.exports.destroy=_,d.exports.pipeline=s.pipeline,d.exports.compose=s.compose,Object.defineProperty(s,\"promises\",{configurable:!0,enumerable:!0,get(){return c}}),d.exports.Stream=s.Stream,d.exports.default=d.exports})),je=Oe(),Pt=fr(),cr=ze(),dt=Vt(Ue(),1);function dr(E,d,s,c,_){const A=je.Buffer.from(E);let R=0;const n=(y,f)=>Object.assign(new Error(f),{code:y});function C(y){if(y===\"/dev/stdin\")return 0;if(y===\"/dev/stdout\")return 1;if(y===\"/dev/stderr\")return 2;if(y===0||y===1||y===2)return y;throw n(\"ENOSYS\",\"Only standard input/output file descriptors are supported by this runtime.\")}function T(y,f){if(C(y)!==0)throw n(\"EBADF\",\"File descriptor is not readable\");const h=typeof f==\"string\"?f:f?.encoding;if(h!=null&&!je.Buffer.isEncoding(h))throw new TypeError(\"Unknown encoding: \"+h);const x=je.Buffer.from(A.subarray(R));return R=A.length,h==null?x:x.toString(h)}function W(y,f,h=0,x=f.byteLength-h,z=null){if(C(y)!==0)throw n(\"EBADF\",\"File descriptor is not readable\");if(!ArrayBuffer.isView(f))throw new TypeError(\"buffer must be an ArrayBuffer view\");if(z!=null&&z!==-1)throw n(\"ESPIPE\",\"Standard input is not seekable\");if(!Number.isInteger(h)||!Number.isInteger(x)||h<0||x<0||h+x>f.byteLength)throw new RangeError(\"Read range is outside the buffer\");const U=Math.min(x,A.length-R);return new Uint8Array(f.buffer,f.byteOffset,f.byteLength).set(A.subarray(R,R+U),h),R+=U,U}function L(y,f){const h=C(y);if(h===0)throw n(\"EBADF\",\"File descriptor is not writable\");const x=Uint8Array.from(f);return(h===1?d:s)(x.buffer),x.byteLength}function O(y,f,h){const x=typeof h==\"string\"?h:h?.encoding;if(typeof f!=\"string\"&&!ArrayBuffer.isView(f))throw new TypeError(\"data must be a string or ArrayBuffer view\");L(y,typeof f==\"string\"?je.Buffer.from(f,x):new Uint8Array(f.buffer,f.byteOffset,f.byteLength))}function $(y,f,h,x,z){if(typeof f==\"string\"){if(h!=null&&h!==-1)throw n(\"ESPIPE\",\"Standard output is not seekable\");return L(y,je.Buffer.from(f,typeof x==\"string\"?x:\"utf8\"))}if(!ArrayBuffer.isView(f))throw new TypeError(\"buffer must be an ArrayBuffer view\");if(z!=null&&z!==-1)throw n(\"ESPIPE\",\"Standard output is not seekable\");if(h??(h=0),x??(x=f.byteLength-h),!Number.isInteger(h)||!Number.isInteger(x)||h<0||x<0||h+x>f.byteLength)throw new RangeError(\"Write range is outside the buffer\");return L(y,new Uint8Array(f.buffer,f.byteOffset+h,x))}const P=new Pt.Readable({read(y){if(R===A.length){this.push(null);return}const f=Math.min(A.length,R+y),h=je.Buffer.from(A.subarray(R,f));R=f,this.push(h)}});function Y(y){return new Pt.Writable({write(f,h,x){try{L(y,f),x()}catch(z){x(z)}}})}Object.assign(dt.default,{stdin:P,stdout:Y(1),stderr:Y(2),env:c,argv:_});class k extends cr.EventEmitter{constructor(f){if(super(),!f?.input||f.terminal)throw n(\"ENOSYS\",\"readline supports nonterminal input streams only\");this.input=f.input,this.closed=!1;let h=[],x=!1;this.onData=z=>{const U=typeof z==\"string\"?z:z.toString(\"utf8\");let ue=x&&U.startsWith(`\n`)?1:0;x=!1;const m=/\\r\\n|\\n|\\r/g;m.lastIndex=ue;let N;for(;(N=m.exec(U))!==null;)h.push(U.slice(ue,N.index)),this.emit(\"line\",h.join(\"\")),h=[],ue=m.lastIndex,x=N[0]===\"\\r\"&&ue===U.length;ue<U.length&&h.push(U.slice(ue))},this.onEnd=()=>{h.length&&this.emit(\"line\",h.join(\"\")),this.close()},this.onError=z=>this.emit(\"error\",z),this.input.setEncoding(\"utf8\"),this.input.on(\"data\",this.onData),this.input.on(\"end\",this.onEnd),this.input.on(\"error\",this.onError)}close(){this.closed||(this.closed=!0,this.input.pause(),this.input.removeListener(\"data\",this.onData),this.input.removeListener(\"end\",this.onEnd),this.input.removeListener(\"error\",this.onError),this.emit(\"close\"))}pause(){return this.input.pause(),this.emit(\"pause\"),this}resume(){return this.input.resume(),this.emit(\"resume\"),this}[Symbol.asyncIterator](){const f=[],h=[];return this.on(\"line\",x=>h.length?h.shift()({value:x,done:!1}):f.push(x)),this.on(\"close\",()=>{for(const x of h.splice(0))x({value:void 0,done:!0})}),{next:()=>f.length?Promise.resolve({value:f.shift(),done:!1}):this.closed?Promise.resolve({value:void 0,done:!0}):new Promise(x=>h.push(x)),return:async()=>(this.close(),{value:void 0,done:!0})}}}const D={readFileSync:T,readSync:W,writeFileSync:O,writeSync:$},l={createInterface:y=>new k(y),Interface:k},w={Buffer:je.Buffer},S=Object.create(null);for(const[y,f]of Object.entries({fs:D,process:dt.default,readline:l,buffer:w}))f.default=f,S[y]=f,S[\"node:\"+y]=f;return globalThis.Buffer=je.Buffer,globalThis.process=dt.default,{builtins:S,readAsString:()=>T(0,\"utf8\")}}return nt.createNodeStdio=dr,nt})({});\n";
|
|
5015
4774
|
Object.freeze({
|
|
5016
4775
|
c: "cpp",
|
|
5017
4776
|
cpp: "cpp",
|
|
@@ -5159,6 +4918,7 @@ if hasattr(_os, "getrandom"):
|
|
|
5159
4918
|
|
|
5160
4919
|
_entry = _sys.argv[1]
|
|
5161
4920
|
_sys.argv = [_entry, *_sys.argv[2:]]
|
|
4921
|
+
_sys.path[0] = _os.path.dirname(_entry)
|
|
5162
4922
|
_runpy.run_path(_entry, run_name="__main__")
|
|
5163
4923
|
`;
|
|
5164
4924
|
function quickJsDeterminismPrelude(config) {
|
|
@@ -5227,7 +4987,7 @@ const __wasmOjDeterminism = (() => {
|
|
|
5227
4987
|
`;
|
|
5228
4988
|
}
|
|
5229
4989
|
new TextEncoder().encode("WOJFS002");
|
|
5230
|
-
var PYTHON_RUNTIME_FILES_CACHE_KEY = `${WASM_OJ_STORAGE$1.runtimeFilesCache}:cpython-3.14.
|
|
4990
|
+
var PYTHON_RUNTIME_FILES_CACHE_KEY = `${WASM_OJ_STORAGE$1.runtimeFilesCache}:cpython-3.14.7-wasip1-stdlib-stored-zip`;
|
|
5231
4991
|
var PYTHON_RUNTIME_FILES_EXPORT_SCRIPT = String.raw`
|
|
5232
4992
|
import io
|
|
5233
4993
|
import os
|
|
@@ -5341,15 +5101,20 @@ function quickJsBundle(artifact, stdin, config) {
|
|
|
5341
5101
|
${quickJsDeterminismPrelude(config.determinism)}
|
|
5342
5102
|
const __modules = ${JSON.stringify(modules)};
|
|
5343
5103
|
const __packageManifests = ${JSON.stringify(packageManifests)};
|
|
5344
|
-
|
|
5104
|
+
${QUICKJS_NODE_STDLIB}
|
|
5105
|
+
const __node = __nodeStdio.createNodeStdio(${JSON.stringify(stdin)}, __wasm_oj_write_stdout, __wasm_oj_write_stderr, ${JSON.stringify(config.env)}, ${JSON.stringify([
|
|
5106
|
+
"qjs",
|
|
5107
|
+
"/project/" + artifact.entry,
|
|
5108
|
+
...config.args
|
|
5109
|
+
])});
|
|
5345
5110
|
const __cache = Object.create(null);
|
|
5346
5111
|
const __std = {
|
|
5347
|
-
in: { readAsString:
|
|
5112
|
+
in: { readAsString: __node.readAsString },
|
|
5348
5113
|
out: { puts: (value) => __wasm_oj_write_stdout(String(value)) },
|
|
5349
5114
|
err: { puts: (value) => __wasm_oj_write_stderr(String(value)) },
|
|
5350
5115
|
};
|
|
5351
5116
|
function __resolve(request, parent) {
|
|
5352
|
-
if (request === "std") return request;
|
|
5117
|
+
if (request === "std" || Object.hasOwn(__node.builtins, request)) return request;
|
|
5353
5118
|
if (request.includes("\\")) throw new Error("Module paths must use canonical forward slashes.");
|
|
5354
5119
|
let parts;
|
|
5355
5120
|
let requestedParts;
|
|
@@ -5389,6 +5154,7 @@ function __resolve(request, parent) {
|
|
|
5389
5154
|
}
|
|
5390
5155
|
function __load(id) {
|
|
5391
5156
|
if (id === "std") return __std;
|
|
5157
|
+
if (Object.hasOwn(__node.builtins, id)) return __node.builtins[id];
|
|
5392
5158
|
if (__cache[id]) return __cache[id].exports;
|
|
5393
5159
|
const module = { exports: {} };
|
|
5394
5160
|
__cache[id] = module;
|
|
@@ -5396,7 +5162,23 @@ function __load(id) {
|
|
|
5396
5162
|
factory((request) => __load(__resolve(request, id)), module, module.exports);
|
|
5397
5163
|
return module.exports;
|
|
5398
5164
|
}
|
|
5399
|
-
|
|
5165
|
+
globalThis.__wasm_oj_builtins = { ...__node.builtins, std: __std };
|
|
5166
|
+
globalThis.__wasm_oj_resolve = __resolve;
|
|
5167
|
+
globalThis.__wasm_oj_module_source = (id) => {
|
|
5168
|
+
if (Object.hasOwn(globalThis.__wasm_oj_builtins, id)) {
|
|
5169
|
+
const value = globalThis.__wasm_oj_builtins[id];
|
|
5170
|
+
const names = Object.keys(value).filter(name => name !== "default");
|
|
5171
|
+
return "const value=globalThis.__wasm_oj_builtins[" + JSON.stringify(id) + "];export default value;" + names.map((name, index) => "const e" + index + "=value[" + JSON.stringify(name) + "];export {e" + index + " as " + JSON.stringify(name) + "};").join("");
|
|
5172
|
+
}
|
|
5173
|
+
if (${JSON.stringify(artifact.language === "typescript")} || id.endsWith(".cjs") || (id.startsWith("node_modules/") && !Object.entries(__packageManifests).some(([path, manifest]) => id.startsWith(path.slice(0, -12)) && manifest.type === "module"))) {
|
|
5174
|
+
const value = __load(id);
|
|
5175
|
+
globalThis.__wasm_oj_builtins[id] = value;
|
|
5176
|
+
return globalThis.__wasm_oj_module_source(id);
|
|
5177
|
+
}
|
|
5178
|
+
if (!Object.hasOwn(__modules, id)) throw new Error("Module '" + id + "' was not found.");
|
|
5179
|
+
return __modules[id];
|
|
5180
|
+
};
|
|
5181
|
+
__wasm_oj_eval_module(${JSON.stringify(artifact.entry)});
|
|
5400
5182
|
`;
|
|
5401
5183
|
}
|
|
5402
5184
|
function createDefaultRuntimeDrivers(costBaselines = createDefaultCostBaselineRegistry()) {
|
|
@@ -5435,8 +5217,7 @@ function createDefaultRuntimeDrivers(costBaselines = createDefaultCostBaselineRe
|
|
|
5435
5217
|
request.env = {
|
|
5436
5218
|
...request.env,
|
|
5437
5219
|
PYTHONHOME: "/cpython",
|
|
5438
|
-
|
|
5439
|
-
PYTHONPATH: "/project/build/site-packages:/project/site-packages:/project/src:/project",
|
|
5220
|
+
PYTHONPATH: "/project/site-packages",
|
|
5440
5221
|
PYTHONDONTWRITEBYTECODE: "1"
|
|
5441
5222
|
};
|
|
5442
5223
|
const runtimeFiles = await resolver.packageFileSystem({
|
|
@@ -6079,124 +5860,12 @@ function observedJudgeDataMetrics(data, language, result) {
|
|
|
6079
5860
|
return observed;
|
|
6080
5861
|
}
|
|
6081
5862
|
//#endregion
|
|
6082
|
-
//#region src/online-judge/compile-profiles.ts
|
|
6083
|
-
function record$4(value, label) {
|
|
6084
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError(`${label} must be an object.`);
|
|
6085
|
-
return value;
|
|
6086
|
-
}
|
|
6087
|
-
function parseJudgeAllowedProfiles(value, label = "allowedProfiles") {
|
|
6088
|
-
const profiles = record$4(value, label);
|
|
6089
|
-
const entries = Object.entries(profiles).sort(([left], [right]) => left.localeCompare(right));
|
|
6090
|
-
if (entries.length < 1) throw new TypeError(`${label} must contain at least one compile profile.`);
|
|
6091
|
-
const result = {};
|
|
6092
|
-
for (const [language, candidate] of entries) {
|
|
6093
|
-
if (!isBuiltinLanguage$1(language)) throw new TypeError(`${label} language '${language}' is unsupported.`);
|
|
6094
|
-
const profile = record$4(candidate, `${label}.${language}`);
|
|
6095
|
-
if (JSON.stringify(Object.keys(profile).sort()) !== JSON.stringify(["optimization", "target"])) throw new TypeError(`${label}.${language} has an invalid shape.`);
|
|
6096
|
-
if (profile.target !== "wasip1" && profile.target !== "wasix") throw new TypeError(`${label}.${language}.target is unsupported.`);
|
|
6097
|
-
if (profile.optimization !== "debug" && profile.optimization !== "release") throw new TypeError(`${label}.${language}.optimization is unsupported.`);
|
|
6098
|
-
result[language] = {
|
|
6099
|
-
target: profile.target,
|
|
6100
|
-
optimization: profile.optimization
|
|
6101
|
-
};
|
|
6102
|
-
}
|
|
6103
|
-
return result;
|
|
6104
|
-
}
|
|
6105
|
-
//#endregion
|
|
6106
|
-
//#region src/online-judge/managed-collection.ts
|
|
6107
|
-
var MANAGED_COLLECTION_SCHEMA = "wasm-oj-platform/managed-collection/v2";
|
|
6108
|
-
var SHA256$4 = /^[0-9a-f]{64}$/;
|
|
6109
|
-
var SLUG$1 = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
6110
|
-
var PATH$1 = /^(?!\/)(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?!.*\/\/)(?!.*\\)(?!.*\/$)[^\u0000]+$/;
|
|
6111
|
-
var MAX_MANAGED_COLLECTION_BYTES = 2097152;
|
|
6112
|
-
var MAX_PROJECTION_BYTES = 33554432;
|
|
6113
|
-
function record$3(value, label) {
|
|
6114
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError(`${label} must be an object.`);
|
|
6115
|
-
return value;
|
|
6116
|
-
}
|
|
6117
|
-
function exact$3(value, expected, label) {
|
|
6118
|
-
const actual = Object.keys(value).sort();
|
|
6119
|
-
const wanted = [...expected].sort();
|
|
6120
|
-
if (JSON.stringify(actual) !== JSON.stringify(wanted)) throw new TypeError(`${label} must contain exactly: ${wanted.join(", ")}.`);
|
|
6121
|
-
}
|
|
6122
|
-
function repositoryObject(value, label, maximum) {
|
|
6123
|
-
const object = record$3(value, label);
|
|
6124
|
-
exact$3(object, [
|
|
6125
|
-
"bytes",
|
|
6126
|
-
"repositoryPath",
|
|
6127
|
-
"sha256"
|
|
6128
|
-
], label);
|
|
6129
|
-
if (typeof object.repositoryPath !== "string" || object.repositoryPath.length < 1 || object.repositoryPath.length > 512 || !PATH$1.test(object.repositoryPath)) throw new TypeError(`${label}.repositoryPath must be a normalized relative POSIX path.`);
|
|
6130
|
-
if (!Number.isSafeInteger(object.bytes) || object.bytes < 1 || object.bytes > maximum) throw new TypeError(`${label}.bytes is outside its publication limit.`);
|
|
6131
|
-
if (typeof object.sha256 !== "string" || !SHA256$4.test(object.sha256)) throw new TypeError(`${label}.sha256 must be a lowercase SHA-256 digest.`);
|
|
6132
|
-
return {
|
|
6133
|
-
repositoryPath: object.repositoryPath,
|
|
6134
|
-
bytes: object.bytes,
|
|
6135
|
-
sha256: object.sha256
|
|
6136
|
-
};
|
|
6137
|
-
}
|
|
6138
|
-
/** Parse the value form used by the authoring CLI after JSON decoding. */
|
|
6139
|
-
function parseManagedCollectionValueV2(value) {
|
|
6140
|
-
const collection = record$3(value, "managed collection");
|
|
6141
|
-
exact$3(collection, [
|
|
6142
|
-
"collectionRevision",
|
|
6143
|
-
"problems",
|
|
6144
|
-
"schema"
|
|
6145
|
-
], "managed collection");
|
|
6146
|
-
if (collection.schema !== "wasm-oj-platform/managed-collection/v2") throw new TypeError(`Managed collection schema must be '${MANAGED_COLLECTION_SCHEMA}'.`);
|
|
6147
|
-
if (typeof collection.collectionRevision !== "string" || !SHA256$4.test(collection.collectionRevision)) throw new TypeError("Managed collection revision must be a lowercase SHA-256 digest.");
|
|
6148
|
-
if (!Array.isArray(collection.problems) || collection.problems.length < 1 || collection.problems.length > 1e3) throw new TypeError("Managed collection must contain between 1 and 1000 problems.");
|
|
6149
|
-
const slugs = /* @__PURE__ */ new Set();
|
|
6150
|
-
const paths = /* @__PURE__ */ new Set();
|
|
6151
|
-
const problems = collection.problems.map((candidate, index) => {
|
|
6152
|
-
const problem = record$3(candidate, `managed problem ${index + 1}`);
|
|
6153
|
-
exact$3(problem, [
|
|
6154
|
-
"allowedProfiles",
|
|
6155
|
-
"contestPublic",
|
|
6156
|
-
"judgePackage",
|
|
6157
|
-
"slug"
|
|
6158
|
-
], `managed problem ${index + 1}`);
|
|
6159
|
-
if (typeof problem.slug !== "string" || !SLUG$1.test(problem.slug) || slugs.has(problem.slug)) throw new TypeError(`Managed problem ${index + 1} has an invalid or duplicate slug.`);
|
|
6160
|
-
slugs.add(problem.slug);
|
|
6161
|
-
const allowedProfiles = parseJudgeAllowedProfiles(problem.allowedProfiles, `managed problem '${problem.slug}' allowedProfiles`);
|
|
6162
|
-
const contestPublic = repositoryObject(problem.contestPublic, `managed problem '${problem.slug}' contestPublic`, 8388608);
|
|
6163
|
-
const judgePackage = repositoryObject(problem.judgePackage, `managed problem '${problem.slug}' judgePackage`, MAX_PROJECTION_BYTES);
|
|
6164
|
-
for (const path of [contestPublic.repositoryPath, judgePackage.repositoryPath]) {
|
|
6165
|
-
if (paths.has(path)) throw new TypeError(`Managed publication path '${path}' is declared more than once.`);
|
|
6166
|
-
paths.add(path);
|
|
6167
|
-
}
|
|
6168
|
-
return {
|
|
6169
|
-
slug: problem.slug,
|
|
6170
|
-
allowedProfiles,
|
|
6171
|
-
contestPublic,
|
|
6172
|
-
judgePackage
|
|
6173
|
-
};
|
|
6174
|
-
});
|
|
6175
|
-
return {
|
|
6176
|
-
schema: MANAGED_COLLECTION_SCHEMA,
|
|
6177
|
-
collectionRevision: collection.collectionRevision,
|
|
6178
|
-
problems
|
|
6179
|
-
};
|
|
6180
|
-
}
|
|
6181
|
-
/**
|
|
6182
|
-
* Stable platform boundary for generated collection/managed.json bytes.
|
|
6183
|
-
* Published managed contracts must use WASM-OJ canonical JSON; author-only
|
|
6184
|
-
* managed-source documents are intentionally not accepted here.
|
|
6185
|
-
*/
|
|
6186
|
-
function parseManagedCollectionV2(bytes) {
|
|
6187
|
-
if (!(bytes instanceof Uint8Array) || bytes.byteLength < 1 || bytes.byteLength > MAX_MANAGED_COLLECTION_BYTES) throw new TypeError("Managed collection bytes are outside the 2 MiB limit.");
|
|
6188
|
-
return parseManagedCollectionValueV2(parseCanonicalJsonBytes(bytes, "managed collection"));
|
|
6189
|
-
}
|
|
6190
|
-
/** Same v2-only value parser retained as the environment-neutral library entry point. */
|
|
6191
|
-
var parseManagedCollectionContract = parseManagedCollectionValueV2;
|
|
6192
|
-
//#endregion
|
|
6193
5863
|
//#region src/online-judge/contest-public.ts
|
|
6194
5864
|
var CONTEST_PUBLIC_PROJECTION_SCHEMA = "wasm-oj-platform/contest-public-problem-projection/v1";
|
|
6195
|
-
var SHA256$3 = /^[0-9a-f]{64}$/;
|
|
6196
5865
|
/**
|
|
6197
|
-
* The
|
|
6198
|
-
*
|
|
6199
|
-
*
|
|
5866
|
+
* The repository practice bundle is safe to fetch for every practice visitor.
|
|
5867
|
+
* Hidden cases and their expected answers exist only in the immutable judge
|
|
5868
|
+
* package built from the authoring source.
|
|
6200
5869
|
*/
|
|
6201
5870
|
function derivePracticePublic(authored) {
|
|
6202
5871
|
return {
|
|
@@ -6216,16 +5885,38 @@ function deriveContestPublic(practice) {
|
|
|
6216
5885
|
judgeCases: practice.judgeCases.filter((testCase) => testCase.kind === "sample").map((testCase) => structuredClone(testCase))
|
|
6217
5886
|
};
|
|
6218
5887
|
}
|
|
6219
|
-
function createContestPublicProjection(practice
|
|
6220
|
-
if (typeof problemBundleSha256 !== "string" || !SHA256$3.test(problemBundleSha256)) throw new TypeError("Contest-public projection digest must be a lowercase SHA-256 digest.");
|
|
5888
|
+
function createContestPublicProjection(practice) {
|
|
6221
5889
|
return {
|
|
6222
5890
|
schema: CONTEST_PUBLIC_PROJECTION_SCHEMA,
|
|
6223
|
-
problem: deriveContestPublic(practice)
|
|
6224
|
-
digest: problemBundleSha256
|
|
5891
|
+
problem: deriveContestPublic(practice)
|
|
6225
5892
|
};
|
|
6226
5893
|
}
|
|
6227
|
-
function contestPublicProjectionBytes(practice
|
|
6228
|
-
return canonicalJsonBytes(createContestPublicProjection(practice
|
|
5894
|
+
function contestPublicProjectionBytes(practice) {
|
|
5895
|
+
return canonicalJsonBytes(createContestPublicProjection(practice));
|
|
5896
|
+
}
|
|
5897
|
+
//#endregion
|
|
5898
|
+
//#region src/online-judge/compile-profiles.ts
|
|
5899
|
+
function record$3(value, label) {
|
|
5900
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError(`${label} must be an object.`);
|
|
5901
|
+
return value;
|
|
5902
|
+
}
|
|
5903
|
+
function parseJudgeAllowedProfiles(value, label = "allowedProfiles") {
|
|
5904
|
+
const profiles = record$3(value, label);
|
|
5905
|
+
const entries = Object.entries(profiles).sort(([left], [right]) => left.localeCompare(right));
|
|
5906
|
+
if (entries.length < 1) throw new TypeError(`${label} must contain at least one compile profile.`);
|
|
5907
|
+
const result = {};
|
|
5908
|
+
for (const [language, candidate] of entries) {
|
|
5909
|
+
if (!isBuiltinLanguage$1(language)) throw new TypeError(`${label} language '${language}' is unsupported.`);
|
|
5910
|
+
const profile = record$3(candidate, `${label}.${language}`);
|
|
5911
|
+
if (JSON.stringify(Object.keys(profile).sort()) !== JSON.stringify(["optimization", "target"])) throw new TypeError(`${label}.${language} has an invalid shape.`);
|
|
5912
|
+
if (profile.target !== "wasip1" && profile.target !== "wasix") throw new TypeError(`${label}.${language}.target is unsupported.`);
|
|
5913
|
+
if (profile.optimization !== "debug" && profile.optimization !== "release") throw new TypeError(`${label}.${language}.optimization is unsupported.`);
|
|
5914
|
+
result[language] = {
|
|
5915
|
+
target: profile.target,
|
|
5916
|
+
optimization: profile.optimization
|
|
5917
|
+
};
|
|
5918
|
+
}
|
|
5919
|
+
return result;
|
|
6229
5920
|
}
|
|
6230
5921
|
//#endregion
|
|
6231
5922
|
//#region src/online-judge/unicode-scalar.ts
|
|
@@ -6767,8 +6458,8 @@ async function validateJudgePackage(source, options = {}) {
|
|
|
6767
6458
|
}
|
|
6768
6459
|
}
|
|
6769
6460
|
const completed = await reader.finish();
|
|
6770
|
-
if (options.expectedBytes !== void 0 && completed.bytes !== options.expectedBytes) throw new TypeError("Judge package byte length disagrees with its
|
|
6771
|
-
if (options.expectedSha256 !== void 0 && completed.sha256 !== options.expectedSha256) throw new TypeError("Judge package digest disagrees with its
|
|
6461
|
+
if (options.expectedBytes !== void 0 && completed.bytes !== options.expectedBytes) throw new TypeError("Judge package byte length disagrees with its descriptor.");
|
|
6462
|
+
if (options.expectedSha256 !== void 0 && completed.sha256 !== options.expectedSha256) throw new TypeError("Judge package digest disagrees with its descriptor.");
|
|
6772
6463
|
if (!judgeData) throw new TypeError("Judge package is missing its judgeData blob.");
|
|
6773
6464
|
return {
|
|
6774
6465
|
manifest,
|
|
@@ -6988,8 +6679,8 @@ var IncrementalSha256 = class {
|
|
|
6988
6679
|
}
|
|
6989
6680
|
};
|
|
6990
6681
|
//#endregion
|
|
6991
|
-
//#region src/online-judge/
|
|
6992
|
-
var
|
|
6682
|
+
//#region src/online-judge/repository-authoring.ts
|
|
6683
|
+
var REPOSITORY_AUTHORING_JUDGES_SCHEMA = "wasm-oj-platform/repository-authoring-judges/v1";
|
|
6993
6684
|
var SHA256$1 = /^[0-9a-f]{64}$/;
|
|
6994
6685
|
var SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
6995
6686
|
var PATH = /^(?!\/)(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?!.*\/\/)(?!.*\\)(?!.*\/$)[^\u0000]+$/;
|
|
@@ -7001,9 +6692,7 @@ function record(value, label) {
|
|
|
7001
6692
|
return value;
|
|
7002
6693
|
}
|
|
7003
6694
|
function exact(value, keys, label) {
|
|
7004
|
-
|
|
7005
|
-
const expected = [...keys].sort();
|
|
7006
|
-
if (JSON.stringify(actual) !== JSON.stringify(expected)) throw new TypeError(`${label} has an invalid shape.`);
|
|
6695
|
+
if (Object.keys(value).sort().join("\0") !== [...keys].sort().join("\0")) throw new TypeError(`${label} has an invalid shape.`);
|
|
7007
6696
|
}
|
|
7008
6697
|
function sourceObject(value, label, maximum) {
|
|
7009
6698
|
const object = record(value, label);
|
|
@@ -7021,16 +6710,13 @@ function sourceObject(value, label, maximum) {
|
|
|
7021
6710
|
sha256: object.sha256
|
|
7022
6711
|
};
|
|
7023
6712
|
}
|
|
7024
|
-
function profiles(value, slug) {
|
|
7025
|
-
return parseJudgeAllowedProfiles(value, `managed source '${slug}' allowedProfiles`);
|
|
7026
|
-
}
|
|
7027
6713
|
function judge(value, slug) {
|
|
7028
|
-
const input = record(value, `
|
|
6714
|
+
const input = record(value, `repository authoring '${slug}' judge`);
|
|
7029
6715
|
if (input.kind === "text") {
|
|
7030
|
-
exact(input, ["kind"], `
|
|
6716
|
+
exact(input, ["kind"], `repository authoring '${slug}' text judge`);
|
|
7031
6717
|
return { kind: "text" };
|
|
7032
6718
|
}
|
|
7033
|
-
if (input.kind !== "checker" && input.kind !== "interactive") throw new TypeError(`
|
|
6719
|
+
if (input.kind !== "checker" && input.kind !== "interactive") throw new TypeError(`Repository authoring '${slug}' judge kind is unsupported.`);
|
|
7034
6720
|
exact(input, input.kind === "checker" ? [
|
|
7035
6721
|
"args",
|
|
7036
6722
|
"artifact",
|
|
@@ -7042,86 +6728,86 @@ function judge(value, slug) {
|
|
|
7042
6728
|
"assets",
|
|
7043
6729
|
"inputPath",
|
|
7044
6730
|
"kind"
|
|
7045
|
-
], `
|
|
7046
|
-
const artifactValue = record(input.artifact, `
|
|
6731
|
+
], `repository authoring '${slug}' ${input.kind}`);
|
|
6732
|
+
const artifactValue = record(input.artifact, `repository authoring '${slug}' ${input.kind} artifact`);
|
|
7047
6733
|
exact(artifactValue, [
|
|
7048
6734
|
"bytes",
|
|
7049
6735
|
"path",
|
|
7050
6736
|
"runtimeProfile",
|
|
7051
6737
|
"sha256"
|
|
7052
|
-
], `
|
|
7053
|
-
if (typeof artifactValue.runtimeProfile !== "string" || !TRUSTED_JUDGE_RUNTIME_PROFILES.has(artifactValue.runtimeProfile)) throw new TypeError(`
|
|
6738
|
+
], `repository authoring '${slug}' ${input.kind} artifact`);
|
|
6739
|
+
if (typeof artifactValue.runtimeProfile !== "string" || !TRUSTED_JUDGE_RUNTIME_PROFILES.has(artifactValue.runtimeProfile)) throw new TypeError(`Repository authoring '${slug}' ${input.kind} runtimeProfile is unsupported.`);
|
|
7054
6740
|
const artifact = {
|
|
7055
6741
|
...sourceObject({
|
|
7056
6742
|
bytes: artifactValue.bytes,
|
|
7057
6743
|
path: artifactValue.path,
|
|
7058
6744
|
sha256: artifactValue.sha256
|
|
7059
|
-
}, `
|
|
6745
|
+
}, `repository authoring '${slug}' ${input.kind} artifact`, TRUSTED_JUDGE_WASM_MAX_BYTES),
|
|
7060
6746
|
runtimeProfile: artifactValue.runtimeProfile
|
|
7061
6747
|
};
|
|
7062
|
-
if (!artifact.path.endsWith(".wasm")) throw new TypeError(`
|
|
7063
|
-
if (!Array.isArray(input.assets) || input.assets.length > 256) throw new TypeError(`
|
|
6748
|
+
if (!artifact.path.endsWith(".wasm")) throw new TypeError(`Repository authoring '${slug}' ${input.kind} artifact path must end in '.wasm'.`);
|
|
6749
|
+
if (!Array.isArray(input.assets) || input.assets.length > 256) throw new TypeError(`Repository authoring '${slug}' ${input.kind} assets are invalid.`);
|
|
7064
6750
|
const namespace = input.kind === "checker" ? "/checker/assets/" : "/interactor/assets/";
|
|
7065
6751
|
const assets = input.assets.map((candidate, index) => {
|
|
7066
|
-
const asset = record(candidate, `
|
|
6752
|
+
const asset = record(candidate, `repository authoring '${slug}' ${input.kind} asset ${index}`);
|
|
7067
6753
|
exact(asset, [
|
|
7068
6754
|
"bytes",
|
|
7069
6755
|
"guestPath",
|
|
7070
6756
|
"path",
|
|
7071
6757
|
"sha256"
|
|
7072
|
-
], `
|
|
7073
|
-
if (typeof asset.guestPath !== "string" || !GUEST_PATH.test(asset.guestPath) || !asset.guestPath.startsWith(namespace)) throw new TypeError(`
|
|
6758
|
+
], `repository authoring '${slug}' ${input.kind} asset ${index}`);
|
|
6759
|
+
if (typeof asset.guestPath !== "string" || !GUEST_PATH.test(asset.guestPath) || !asset.guestPath.startsWith(namespace)) throw new TypeError(`Repository authoring '${slug}' ${input.kind} asset ${index} guestPath must be inside '${namespace}'.`);
|
|
7074
6760
|
return {
|
|
7075
6761
|
...sourceObject({
|
|
7076
6762
|
bytes: asset.bytes,
|
|
7077
6763
|
path: asset.path,
|
|
7078
6764
|
sha256: asset.sha256
|
|
7079
|
-
}, `
|
|
6765
|
+
}, `repository authoring '${slug}' ${input.kind} asset ${index}`, MAX_ASSET_BYTES),
|
|
7080
6766
|
guestPath: asset.guestPath
|
|
7081
6767
|
};
|
|
7082
6768
|
});
|
|
7083
6769
|
const guestPaths = assets.map((asset) => asset.guestPath);
|
|
7084
6770
|
const repositoryPaths = [artifact.path, ...assets.map((asset) => asset.path)];
|
|
7085
|
-
if (new Set(guestPaths).size !== guestPaths.length || new Set(repositoryPaths).size !== repositoryPaths.length) throw new TypeError(`
|
|
7086
|
-
if (assets.reduce((total, asset) => total + asset.bytes, 0) > MAX_ASSET_TOTAL_BYTES) throw new TypeError(`
|
|
7087
|
-
if (!Array.isArray(input.args) || input.args.length > 64 || input.args.some((argument) => typeof argument !== "string" || argument.includes("\0") || new TextEncoder().encode(argument).byteLength > 4096)) throw new TypeError(`
|
|
7088
|
-
const
|
|
6771
|
+
if (new Set(guestPaths).size !== guestPaths.length || new Set(repositoryPaths).size !== repositoryPaths.length) throw new TypeError(`Repository authoring '${slug}' ${input.kind} repeats an asset or repository path.`);
|
|
6772
|
+
if (assets.reduce((total, asset) => total + asset.bytes, 0) > MAX_ASSET_TOTAL_BYTES) throw new TypeError(`Repository authoring '${slug}' ${input.kind} assets exceed 4 MiB.`);
|
|
6773
|
+
if (!Array.isArray(input.args) || input.args.length > 64 || input.args.some((argument) => typeof argument !== "string" || argument.includes("\0") || new TextEncoder().encode(argument).byteLength > 4096)) throw new TypeError(`Repository authoring '${slug}' ${input.kind} args are invalid.`);
|
|
6774
|
+
const args = [...input.args];
|
|
7089
6775
|
if (input.kind === "checker") return {
|
|
7090
6776
|
kind: "checker",
|
|
7091
6777
|
artifact,
|
|
7092
6778
|
assets,
|
|
7093
|
-
args
|
|
6779
|
+
args
|
|
7094
6780
|
};
|
|
7095
|
-
if (typeof input.inputPath !== "string" || !GUEST_PATH.test(input.inputPath) || !input.inputPath.startsWith("/interactor/input/")) throw new TypeError(`
|
|
6781
|
+
if (typeof input.inputPath !== "string" || !GUEST_PATH.test(input.inputPath) || !input.inputPath.startsWith("/interactor/input/")) throw new TypeError(`Repository authoring '${slug}' interactive inputPath must be inside '/interactor/input/'.`);
|
|
7096
6782
|
return {
|
|
7097
6783
|
kind: "interactive",
|
|
7098
6784
|
artifact,
|
|
7099
6785
|
assets,
|
|
7100
|
-
args
|
|
6786
|
+
args,
|
|
7101
6787
|
inputPath: input.inputPath
|
|
7102
6788
|
};
|
|
7103
6789
|
}
|
|
7104
|
-
/** Author-only
|
|
7105
|
-
function
|
|
7106
|
-
const source = record(value, "
|
|
7107
|
-
exact(source, ["problems", "schema"], "
|
|
7108
|
-
if (source.schema !== "wasm-oj-platform/
|
|
7109
|
-
if (!Array.isArray(source.problems) || source.problems.length < 1 || source.problems.length > 1e3) throw new TypeError("
|
|
6790
|
+
/** Author-only input used by collection build; never accepted by the platform sync boundary. */
|
|
6791
|
+
function parseRepositoryAuthoringJudges(value) {
|
|
6792
|
+
const source = record(value, "repository authoring judges");
|
|
6793
|
+
exact(source, ["problems", "schema"], "repository authoring judges");
|
|
6794
|
+
if (source.schema !== "wasm-oj-platform/repository-authoring-judges/v1") throw new TypeError(`Repository authoring judge schema must be '${REPOSITORY_AUTHORING_JUDGES_SCHEMA}'.`);
|
|
6795
|
+
if (!Array.isArray(source.problems) || source.problems.length < 1 || source.problems.length > 1e3) throw new TypeError("Repository authoring judges must contain between 1 and 1000 problems.");
|
|
7110
6796
|
const slugs = /* @__PURE__ */ new Set();
|
|
7111
6797
|
return {
|
|
7112
|
-
schema:
|
|
6798
|
+
schema: REPOSITORY_AUTHORING_JUDGES_SCHEMA,
|
|
7113
6799
|
problems: source.problems.map((candidate, index) => {
|
|
7114
|
-
const problem = record(candidate, `
|
|
6800
|
+
const problem = record(candidate, `repository authoring judge problem ${index + 1}`);
|
|
7115
6801
|
exact(problem, [
|
|
7116
6802
|
"allowedProfiles",
|
|
7117
6803
|
"judge",
|
|
7118
6804
|
"slug"
|
|
7119
|
-
], `
|
|
7120
|
-
if (typeof problem.slug !== "string" || !SLUG.test(problem.slug) || slugs.has(problem.slug)) throw new TypeError(`
|
|
6805
|
+
], `repository authoring judge problem ${index + 1}`);
|
|
6806
|
+
if (typeof problem.slug !== "string" || !SLUG.test(problem.slug) || slugs.has(problem.slug)) throw new TypeError(`Repository authoring judge problem ${index + 1} has an invalid or duplicate slug.`);
|
|
7121
6807
|
slugs.add(problem.slug);
|
|
7122
6808
|
return {
|
|
7123
6809
|
slug: problem.slug,
|
|
7124
|
-
allowedProfiles:
|
|
6810
|
+
allowedProfiles: parseJudgeAllowedProfiles(problem.allowedProfiles, `repository authoring '${problem.slug}' allowedProfiles`),
|
|
7125
6811
|
judge: judge(problem.judge, problem.slug)
|
|
7126
6812
|
};
|
|
7127
6813
|
})
|
|
@@ -8394,6 +8080,129 @@ function requireSha256(value) {
|
|
|
8394
8080
|
if (!/^[0-9a-f]{64}$/.test(value)) throw new Error("Dependency integrity must be lowercase SHA-256 hexadecimal.");
|
|
8395
8081
|
}
|
|
8396
8082
|
//#endregion
|
|
8083
|
+
//#region src/conformance/stdio-cases.ts
|
|
8084
|
+
var programs = [
|
|
8085
|
+
{
|
|
8086
|
+
language: "c",
|
|
8087
|
+
entry: "main.c",
|
|
8088
|
+
source: "#include <stdio.h>\nint main(){int c;while((c=getchar())!=EOF)printf(\"%02x\",(unsigned)c);puts(\"\");return 0;}"
|
|
8089
|
+
},
|
|
8090
|
+
{
|
|
8091
|
+
language: "cpp",
|
|
8092
|
+
entry: "main.cpp",
|
|
8093
|
+
source: "#include <iostream>\n#include <cstdio>\nint main(){char c;while(std::cin.get(c))printf(\"%02x\",(unsigned char)c);puts(\"\");}"
|
|
8094
|
+
},
|
|
8095
|
+
{
|
|
8096
|
+
language: "python",
|
|
8097
|
+
entry: "main.py",
|
|
8098
|
+
source: "import sys\nprint(sys.stdin.buffer.read().hex())\n"
|
|
8099
|
+
},
|
|
8100
|
+
{
|
|
8101
|
+
language: "rust",
|
|
8102
|
+
entry: "main.rs",
|
|
8103
|
+
source: "use std::io::{self,Read};fn main(){let mut b=Vec::new();io::stdin().read_to_end(&mut b).unwrap();for x in b{print!(\"{:02x}\",x);}println!();}"
|
|
8104
|
+
},
|
|
8105
|
+
{
|
|
8106
|
+
language: "go",
|
|
8107
|
+
entry: "main.go",
|
|
8108
|
+
source: "package main\nimport(\"fmt\";\"io\";\"os\")\nfunc main(){b,_:=io.ReadAll(os.Stdin);fmt.Printf(\"%x\\n\",b)}"
|
|
8109
|
+
},
|
|
8110
|
+
{
|
|
8111
|
+
language: "java",
|
|
8112
|
+
entry: "Main.java",
|
|
8113
|
+
source: "import java.io.*;public class Main{public static void main(String[]args)throws Exception{BufferedReader r=new BufferedReader(new InputStreamReader(System.in));String s;while((s=r.readLine())!=null)System.out.println(\"[\"+s+\"]\");System.out.println(\"EOF\");}}"
|
|
8114
|
+
},
|
|
8115
|
+
{
|
|
8116
|
+
language: "javascript",
|
|
8117
|
+
entry: "main.js",
|
|
8118
|
+
source: "import * as std from \"std\";const s=std.in.readAsString();console.log(Array.from(unescape(encodeURIComponent(s)),c=>c.charCodeAt(0).toString(16).padStart(2,\"0\")).join(\"\"));if(std.in.readAsString()!==\"\")throw Error(\"Repeated stdin\");"
|
|
8119
|
+
},
|
|
8120
|
+
{
|
|
8121
|
+
language: "typescript",
|
|
8122
|
+
entry: "main.ts",
|
|
8123
|
+
source: "import * as std from \"std\";const s=std.in.readAsString();console.log(Array.from(unescape(encodeURIComponent(s)),c=>c.charCodeAt(0).toString(16).padStart(2,\"0\")).join(\"\"));if(std.in.readAsString()!==\"\")throw Error(\"Repeated stdin\");"
|
|
8124
|
+
}
|
|
8125
|
+
];
|
|
8126
|
+
var inputs = [
|
|
8127
|
+
{
|
|
8128
|
+
id: "empty",
|
|
8129
|
+
stdin: ""
|
|
8130
|
+
},
|
|
8131
|
+
{
|
|
8132
|
+
id: "lf",
|
|
8133
|
+
stdin: "\n"
|
|
8134
|
+
},
|
|
8135
|
+
{
|
|
8136
|
+
id: "one-byte",
|
|
8137
|
+
stdin: "x"
|
|
8138
|
+
},
|
|
8139
|
+
{
|
|
8140
|
+
id: "no-final-lf",
|
|
8141
|
+
stdin: "abc"
|
|
8142
|
+
},
|
|
8143
|
+
{
|
|
8144
|
+
id: "final-lf",
|
|
8145
|
+
stdin: "abc\n"
|
|
8146
|
+
},
|
|
8147
|
+
{
|
|
8148
|
+
id: "multiple-lf",
|
|
8149
|
+
stdin: "abc\n\n"
|
|
8150
|
+
},
|
|
8151
|
+
{
|
|
8152
|
+
id: "crlf",
|
|
8153
|
+
stdin: "abc\r\nx\r\n"
|
|
8154
|
+
},
|
|
8155
|
+
{
|
|
8156
|
+
id: "bare-cr",
|
|
8157
|
+
stdin: "abc\rx"
|
|
8158
|
+
},
|
|
8159
|
+
{
|
|
8160
|
+
id: "spaces",
|
|
8161
|
+
stdin: " abc \n x "
|
|
8162
|
+
},
|
|
8163
|
+
{
|
|
8164
|
+
id: "unicode",
|
|
8165
|
+
stdin: "中文🙂\n終"
|
|
8166
|
+
},
|
|
8167
|
+
{
|
|
8168
|
+
id: "bom",
|
|
8169
|
+
stdin: "abc\n"
|
|
8170
|
+
},
|
|
8171
|
+
{
|
|
8172
|
+
id: "nul",
|
|
8173
|
+
stdin: "a\0b\n"
|
|
8174
|
+
},
|
|
8175
|
+
{
|
|
8176
|
+
id: "long-line",
|
|
8177
|
+
stdin: "x".repeat(8193)
|
|
8178
|
+
},
|
|
8179
|
+
{
|
|
8180
|
+
id: "last-line",
|
|
8181
|
+
stdin: "first\nlast"
|
|
8182
|
+
}
|
|
8183
|
+
];
|
|
8184
|
+
var STDIO_CONFORMANCE_CASES = programs.flatMap((program) => inputs.map(({ id, stdin }) => {
|
|
8185
|
+
const lines = stdin === "" ? [] : stdin.split(/\r\n|\r|\n/);
|
|
8186
|
+
if (/[\r\n]$/.test(stdin)) lines.pop();
|
|
8187
|
+
return {
|
|
8188
|
+
id: `${program.language}-wasip1-stdio-${id}`,
|
|
8189
|
+
label: `${program.language} / wasip1 / stdin ${id}`,
|
|
8190
|
+
input: {
|
|
8191
|
+
language: program.language,
|
|
8192
|
+
target: "wasip1",
|
|
8193
|
+
entry: program.entry,
|
|
8194
|
+
files: { [program.entry]: program.source }
|
|
8195
|
+
},
|
|
8196
|
+
run: { stdin },
|
|
8197
|
+
expect: {
|
|
8198
|
+
code: 0,
|
|
8199
|
+
stdout: program.language === "java" ? `${lines.map((line) => `[${line}]\n`).join("")}EOF\n` : `${Array.from(new TextEncoder().encode(stdin), (byte) => byte.toString(16).padStart(2, "0")).join("")}\n`,
|
|
8200
|
+
stderr: "",
|
|
8201
|
+
termination: "exited"
|
|
8202
|
+
}
|
|
8203
|
+
};
|
|
8204
|
+
}));
|
|
8205
|
+
//#endregion
|
|
8397
8206
|
//#region src/conformance/cases.ts
|
|
8398
8207
|
var DEFAULT_CONFORMANCE_CASES = deepFreeze([
|
|
8399
8208
|
{
|
|
@@ -8619,6 +8428,54 @@ var DEFAULT_CONFORMANCE_CASES = deepFreeze([
|
|
|
8619
8428
|
termination: "exited"
|
|
8620
8429
|
}
|
|
8621
8430
|
},
|
|
8431
|
+
{
|
|
8432
|
+
id: "python-wasip1-stdin-eof",
|
|
8433
|
+
label: "Python / wasip1 / redirected input at EOF",
|
|
8434
|
+
input: {
|
|
8435
|
+
language: "python",
|
|
8436
|
+
target: "wasip1",
|
|
8437
|
+
entry: "src/main.py",
|
|
8438
|
+
files: { "src/main.py": [
|
|
8439
|
+
"import os, sys",
|
|
8440
|
+
"assert not any(os.isatty(fd) for fd in range(3))",
|
|
8441
|
+
"assert not any(stream.isatty() for stream in (sys.stdin, sys.stdout, sys.stderr))",
|
|
8442
|
+
"assert input() == 'abc\\r'",
|
|
8443
|
+
"assert input() == 'x'",
|
|
8444
|
+
"assert input() == '終'",
|
|
8445
|
+
"try:",
|
|
8446
|
+
" input()",
|
|
8447
|
+
"except EOFError:",
|
|
8448
|
+
" print('OK')",
|
|
8449
|
+
"else:",
|
|
8450
|
+
" raise AssertionError('Expected EOFError')",
|
|
8451
|
+
""
|
|
8452
|
+
].join("\n") }
|
|
8453
|
+
},
|
|
8454
|
+
run: { stdin: "abc\r\nx\n終" },
|
|
8455
|
+
expect: {
|
|
8456
|
+
code: 0,
|
|
8457
|
+
stdout: "OK\n",
|
|
8458
|
+
stderr: "",
|
|
8459
|
+
termination: "exited"
|
|
8460
|
+
}
|
|
8461
|
+
},
|
|
8462
|
+
{
|
|
8463
|
+
id: "python-wasip1-stdin-bytes",
|
|
8464
|
+
label: "Python / wasip1 / exact input bytes",
|
|
8465
|
+
input: {
|
|
8466
|
+
language: "python",
|
|
8467
|
+
target: "wasip1",
|
|
8468
|
+
entry: "src/main.py",
|
|
8469
|
+
files: { "src/main.py": "import sys\nassert sys.stdin.buffer.read() == b'abc\\r\\nx'\nprint('OK')\n" }
|
|
8470
|
+
},
|
|
8471
|
+
run: { stdin: "abc\r\nx" },
|
|
8472
|
+
expect: {
|
|
8473
|
+
code: 0,
|
|
8474
|
+
stdout: "OK\n",
|
|
8475
|
+
stderr: "",
|
|
8476
|
+
termination: "exited"
|
|
8477
|
+
}
|
|
8478
|
+
},
|
|
8622
8479
|
{
|
|
8623
8480
|
id: "javascript-wasip1",
|
|
8624
8481
|
label: "JavaScript / wasip1",
|
|
@@ -8968,11 +8825,15 @@ var CPP_STDLIB_CONFORMANCE_CASE = deepFreeze({
|
|
|
8968
8825
|
termination: "exited"
|
|
8969
8826
|
}
|
|
8970
8827
|
});
|
|
8971
|
-
var FULL_CONFORMANCE_CASES = deepFreeze([
|
|
8828
|
+
var FULL_CONFORMANCE_CASES = deepFreeze([
|
|
8829
|
+
...DEFAULT_CONFORMANCE_CASES,
|
|
8830
|
+
...STDIO_CONFORMANCE_CASES,
|
|
8831
|
+
CPP_STDLIB_CONFORMANCE_CASE
|
|
8832
|
+
]);
|
|
8972
8833
|
function deepFreeze(value) {
|
|
8973
8834
|
if (typeof value !== "object" || value === null || Object.isFrozen(value)) return value;
|
|
8974
8835
|
for (const child of Object.values(value)) deepFreeze(child);
|
|
8975
8836
|
return Object.freeze(value);
|
|
8976
8837
|
}
|
|
8977
8838
|
//#endregion
|
|
8978
|
-
export { BROWSER_COLLECTION_SCHEMA, BROWSER_PROBLEM_SCHEMA, BrowserDependencyNetworkConsent, CONTEST_PUBLIC_PROJECTION_SCHEMA, CPP_STDLIB_CONFORMANCE_CASE, CargoLockDependencyResolver, CompilerRegistry, CostBaselineRegistry, CppLockDependencyResolver, DEFAULT_CONFORMANCE_CASES, DEFAULT_DETERMINISM, DEFAULT_RESOURCE_POLICY, DEPENDENCY_BUILD_LIMITS, DependencyManager, DependencyNetworkError, Engine, FULL_CONFORMANCE_CASES, GoLockDependencyResolver, JudgeEngine, LANGUAGES,
|
|
8839
|
+
export { BROWSER_COLLECTION_SCHEMA, BROWSER_PROBLEM_SCHEMA, BrowserDependencyNetworkConsent, CONTEST_PUBLIC_PROJECTION_SCHEMA, CPP_STDLIB_CONFORMANCE_CASE, CargoLockDependencyResolver, CompilerRegistry, CostBaselineRegistry, CppLockDependencyResolver, DEFAULT_CONFORMANCE_CASES, DEFAULT_DETERMINISM, DEFAULT_RESOURCE_POLICY, DEPENDENCY_BUILD_LIMITS, DependencyManager, DependencyNetworkError, Engine, FULL_CONFORMANCE_CASES, GoLockDependencyResolver, JudgeEngine, LANGUAGES, MemoryDependencyCache, NpmLockDependencyResolver, PROBLEM_STARTER_LIMITS, PROJECT_SOURCE_LIMITS, PyPiLockDependencyResolver, REPOSITORY_AUTHORING_JUDGES_SCHEMA, RuntimeDriverRegistry, TRUSTED_JUDGE_RUNTIME_PROFILES, TRUSTED_JUDGE_WASIP1_IMPORTS, TRUSTED_JUDGE_WASM_MAX_BYTES, WASM_OJ_CONTRACT_ID, WASM_OJ_CONTRACT_VERSION, WASM_OJ_ERROR_CODES, WASM_OJ_ERROR_STAGES, WASM_OJ_JUDGE_DATA_SCHEMA, WASM_OJ_JUDGE_PACKAGE_MAGIC, WASM_OJ_JUDGE_PACKAGE_MAX_BYTES, WASM_OJ_JUDGE_PACKAGE_SCHEMA, WASM_OJ_LIBCXX_PCH_HEADER, WASM_OJ_RUNTIME_COMPONENTS, WASM_OJ_RUNTIME_IDENTITY_SHA256, WASM_OJ_SCHEMAS, WASM_OJ_STORAGE, WEIGHTED_METER_MODEL, WasmOjError, asWasmOjError, assertCompilerCacheKey, assertJudgeDataCostProfile, assertJudgeDataMatchesPracticePublic, assertJudgeGuestFilePath, assertLanguageIdentifier, assertProblemCostProfile, assertValidBuildArtifact, assertValidDependencyBuildBundle, assertValidDependencyLock, assertValidProject, assertValidReplayBundle, browserToolchainAssetBaseUrl, browserToolchainAssetUrl, canonicalJsonBytes, compareConformanceSnapshots, contestPublicProjectionBytes, costProfileId, createContestPublicProjection, createDefaultCostBaselineRegistry, createDefaultDependencyBuildAdapters, createDefaultDependencyManager, createDefaultDependencyResolvers, createDefaultRuntimeDrivers, createDependencyBuildBundle, createDependencyLock, createEngine, createExtendedCostBaselineRegistry, createJudgeExecutor, createReplayBundle, createRuntimeBundleManifest, createSdkProject, decodeJudgePackageForExecution, decodeLibcxxPchManifest, decodeReplayBundle, dependencyFileTreeSha256, dependencyLockSha256, dependencyManifestSha256, deriveContestPublic, deriveJudgeData, derivePracticePublic, deterministicTranscript, encodeJudgePackage, encodeReplayBundle, fileMatcher, floatMatcher, goModuleZipHash, isBuiltinLanguage, isCostProfileFor, isToolchainLibcxxPchHeader, judgePackageSemanticDigest, judgeTranscript, normalizeDependencyNetworkAccess, normalizeDependencyNetworkScope, normalizeExecutionMetrics, normalizeOutput, parseCanonicalJsonBytes, parseJudgeAllowedProfiles, parseJudgeData, parseJudgePackageManifest, parseProblemBundle, parseProblemCollectionIndex, parseRepositoryAuthoringJudges, parseStandaloneProblemBundle, prepareArtifactInteraction, prepareArtifactRun, prepareTrustedJudgeRun, problemCollectionRevision, readJudgePackageManifest, replayBundle, replayBundleSha256, resolveArtifactCostBudget, resolveCostBudget, resolveDeterminism, resolveResourcePolicy, runConformanceHost, runConformanceMatrix, runtimeIdentityBytes, scoreJudgeDataResults, scoreProblemResults, setMatcher, sha256Matcher, snapshotBrowserToolchainSources, summarizeProblemPolicies, textMatcher, tokenMatcher, toolchainAssetSource, toolchainCacheIdentity, toolchainProfileSource, trustedJudgeSpec, unavailableExecutionMetrics, validateBrowserToolchainSources, validateJudgePackage, validateJudgeSpec, validateServerToolchainSources, validateToolchainDescriptors, validateTrustedJudgeWasm, verifyDependencyBuildBundle, verifyProblemBundleBytes, verifyProblemCollectionRevision, verifyRuntimeIdentity, wasmCheckerMatcher };
|