gestament 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/dist/displaySession.d.ts +18 -0
- package/dist/displaySession.d.ts.map +1 -0
- package/dist/element.d.ts +2 -2
- package/dist/errors-6gj5YuLw.cjs +36 -0
- package/dist/errors-6gj5YuLw.cjs.map +1 -0
- package/dist/errors-CCW4ATME.js +37 -0
- package/dist/errors-CCW4ATME.js.map +1 -0
- package/dist/errors.d.ts +2 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/generated/packageMetadata.d.ts +4 -4
- package/dist/gestament-config.d.ts +2 -2
- package/dist/gestament-launcher-driver.cjs +656 -0
- package/dist/gestament-launcher-driver.cjs.map +1 -0
- package/dist/gestament-launcher-driver.d.ts +13 -0
- package/dist/gestament-launcher-driver.d.ts.map +1 -0
- package/dist/gestament-launcher-driver.mjs +655 -0
- package/dist/gestament-launcher-driver.mjs.map +1 -0
- package/dist/gestament-tray-host.cjs +1 -1
- package/dist/gestament-tray-host.d.ts +2 -2
- package/dist/gestament-tray-host.mjs +1 -1
- package/dist/gestament-xvfb-pool-probe.cjs +29 -0
- package/dist/gestament-xvfb-pool-probe.cjs.map +1 -0
- package/dist/gestament-xvfb-pool-probe.d.ts +13 -0
- package/dist/gestament-xvfb-pool-probe.d.ts.map +1 -0
- package/dist/gestament-xvfb-pool-probe.mjs +28 -0
- package/dist/gestament-xvfb-pool-probe.mjs.map +1 -0
- package/dist/gestament-xvfb-worker.d.ts +2 -2
- package/dist/gestament-xvfb.cjs +8 -2
- package/dist/gestament-xvfb.cjs.map +1 -1
- package/dist/gestament-xvfb.d.ts +2 -2
- package/dist/gestament-xvfb.mjs +8 -2
- package/dist/gestament-xvfb.mjs.map +1 -1
- package/dist/index.cjs +4 -1074
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +4 -1074
- package/dist/index.mjs.map +1 -1
- package/dist/launchGtkApp-BIO_5Xjn.cjs +2479 -0
- package/dist/launchGtkApp-BIO_5Xjn.cjs.map +1 -0
- package/dist/launchGtkApp-qi1qm5G4.js +2479 -0
- package/dist/launchGtkApp-qi1qm5G4.js.map +1 -0
- package/dist/launchGtkApp.d.ts +2 -2
- package/dist/launchGtkApp.d.ts.map +1 -1
- package/dist/launcherDriverProtocol.d.ts +107 -0
- package/dist/launcherDriverProtocol.d.ts.map +1 -0
- package/dist/{native-BRnrsqMn.cjs → native-CBXaFWP-.cjs} +14 -40
- package/dist/native-CBXaFWP-.cjs.map +1 -0
- package/dist/{native-DAhTiLnf.js → native-CWdUmdty.js} +48 -74
- package/dist/native-CWdUmdty.js.map +1 -0
- package/dist/native.d.ts +4 -2
- package/dist/native.d.ts.map +1 -1
- package/dist/prerequisites-BuZST2Dy.cjs +15 -0
- package/dist/prerequisites-BuZST2Dy.cjs.map +1 -0
- package/dist/prerequisites-JB0SKPVd.js +16 -0
- package/dist/prerequisites-JB0SKPVd.js.map +1 -0
- package/dist/prerequisites.d.ts +23 -0
- package/dist/prerequisites.d.ts.map +1 -0
- package/dist/testing.cjs +3 -0
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.ts +4 -2
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.mjs +4 -1
- package/dist/testing.mjs.map +1 -1
- package/dist/tray.d.ts +2 -2
- package/dist/types.d.ts +84 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/wait-DV5gkXs8.js +113 -0
- package/dist/wait-DV5gkXs8.js.map +1 -0
- package/dist/wait-eOIz4nZm.cjs +112 -0
- package/dist/wait-eOIz4nZm.cjs.map +1 -0
- package/dist/wait.d.ts +67 -0
- package/dist/wait.d.ts.map +1 -0
- package/package.json +8 -8
- package/prebuilds/linux-arm/gtk3/node.napi.armv7.glibc.node +0 -0
- package/prebuilds/linux-arm/gtk4/node.napi.armv7.glibc.node +0 -0
- package/prebuilds/linux-arm64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-arm64/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-ia32/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-ia32/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-riscv64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-riscv64/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/gtk4/node.napi.glibc.node +0 -0
- package/dist/native-BRnrsqMn.cjs.map +0 -1
- package/dist/native-DAhTiLnf.js.map +0 -1
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;;;;;;;AAOA,gEAAgE;AAChE,MAAM,MAAM,sBAAsB,GAC9B,YAAY,GACZ,mBAAmB,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,kBAAkB,GAClB,eAAe,GACf,SAAS,GACT,uBAAuB,CAAC;AAE5B,8CAA8C;AAC9C,MAAM,WAAW,kBAAmB,SAAQ,KAAK;IAC/C,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;CACvC;AAID;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC;;OAEG;IACH,QAAQ,CAA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GAAG,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAChE"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { e as createGtkOperationTimeoutError, f as createGtkInvalidArgumentError } from "./errors-CCW4ATME.js";
|
|
3
|
+
/*!
|
|
4
|
+
* name: async-primitives
|
|
5
|
+
* version: 1.7.0
|
|
6
|
+
* description: A collection of primitive functions for asynchronous operations
|
|
7
|
+
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
8
|
+
* license: MIT
|
|
9
|
+
* repository.url: https://github.com/kekyo/async-primitives.git
|
|
10
|
+
* git.commit.hash: 9472fbd5310b92690d84aaafb897429a04c013c5
|
|
11
|
+
*/
|
|
12
|
+
var delay = (msec, signal) => {
|
|
13
|
+
return new Promise((resolve) => {
|
|
14
|
+
setTimeout(resolve, msec);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
const defaultTimeoutMs = 1e4;
|
|
18
|
+
const defaultIntervalMs = 50;
|
|
19
|
+
const waitContext = new AsyncLocalStorage();
|
|
20
|
+
const immediateFailureCodes = /* @__PURE__ */ new Set([
|
|
21
|
+
"APP_EXITED",
|
|
22
|
+
"INVALID_ARGUMENT",
|
|
23
|
+
"NATIVE_LOAD_FAILED",
|
|
24
|
+
"UNSUPPORTED_INTERFACE"
|
|
25
|
+
]);
|
|
26
|
+
const validateNonNegativeFiniteNumber = (name, value) => {
|
|
27
|
+
if (!Number.isFinite(value) || value < 0) {
|
|
28
|
+
throw createGtkInvalidArgumentError(
|
|
29
|
+
`${name} must be a non-negative finite number.`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const validatePositiveFiniteNumber = (name, value) => {
|
|
34
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
35
|
+
throw createGtkInvalidArgumentError(
|
|
36
|
+
`${name} must be a positive finite number.`
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const errorCode = (error) => {
|
|
41
|
+
const code = error.code;
|
|
42
|
+
return typeof code === "string" ? code : void 0;
|
|
43
|
+
};
|
|
44
|
+
const errorLabel = (error) => {
|
|
45
|
+
if (error instanceof Error) {
|
|
46
|
+
const code = errorCode(error);
|
|
47
|
+
return code === void 0 ? `${error.name}: ${error.message}` : `${error.name} [${code}]: ${error.message}`;
|
|
48
|
+
}
|
|
49
|
+
return String(error);
|
|
50
|
+
};
|
|
51
|
+
const waitTimeoutMessage = (timeoutMs, message, lastError) => {
|
|
52
|
+
const base = message ?? "Timed out waiting for GTK condition.";
|
|
53
|
+
const last = lastError === void 0 ? "" : ` Last error: ${errorLabel(lastError)}`;
|
|
54
|
+
return `${base} Timeout: ${timeoutMs}ms.${last}`;
|
|
55
|
+
};
|
|
56
|
+
const retryableError = (error) => !immediateFailureCodes.has(errorCode(error) ?? "");
|
|
57
|
+
const resolveWaitDeadlineMs = (startedAtMs, timeoutMs) => {
|
|
58
|
+
const requestedDeadlineMs = startedAtMs + timeoutMs;
|
|
59
|
+
const parentDeadlineMs = waitContext.getStore()?.deadlineMs;
|
|
60
|
+
return parentDeadlineMs === void 0 ? requestedDeadlineMs : Math.min(requestedDeadlineMs, parentDeadlineMs);
|
|
61
|
+
};
|
|
62
|
+
const currentWaitDeadlineMs = () => waitContext.getStore()?.deadlineMs;
|
|
63
|
+
const effectiveWaitTimeoutMs = (fallbackTimeoutMs) => {
|
|
64
|
+
const deadlineMs = currentWaitDeadlineMs();
|
|
65
|
+
if (deadlineMs === void 0) {
|
|
66
|
+
return fallbackTimeoutMs;
|
|
67
|
+
}
|
|
68
|
+
return Math.min(fallbackTimeoutMs, Math.max(0, deadlineMs - Date.now()));
|
|
69
|
+
};
|
|
70
|
+
const runWithWaitDeadline = async (deadlineMs, operation) => waitContext.run({ deadlineMs }, async () => operation());
|
|
71
|
+
const waitForResult = async (probe, options) => {
|
|
72
|
+
const timeoutMs = options?.timeoutMs ?? defaultTimeoutMs;
|
|
73
|
+
const intervalMs = options?.intervalMs ?? defaultIntervalMs;
|
|
74
|
+
validateNonNegativeFiniteNumber("timeoutMs", timeoutMs);
|
|
75
|
+
validatePositiveFiniteNumber("intervalMs", intervalMs);
|
|
76
|
+
const startedAtMs = Date.now();
|
|
77
|
+
const deadlineMs = resolveWaitDeadlineMs(startedAtMs, timeoutMs);
|
|
78
|
+
const effectiveTimeoutMs = Math.max(0, deadlineMs - startedAtMs);
|
|
79
|
+
return waitContext.run({ deadlineMs }, async () => {
|
|
80
|
+
let lastError;
|
|
81
|
+
while (true) {
|
|
82
|
+
try {
|
|
83
|
+
return await probe();
|
|
84
|
+
} catch (error) {
|
|
85
|
+
if (!retryableError(error)) {
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
lastError = error;
|
|
89
|
+
}
|
|
90
|
+
const remainingMs = deadlineMs - Date.now();
|
|
91
|
+
if (remainingMs <= 0) {
|
|
92
|
+
throw createGtkOperationTimeoutError(
|
|
93
|
+
waitTimeoutMessage(effectiveTimeoutMs, options?.message, lastError)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
await delay(Math.min(intervalMs, remainingMs));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
const toPass = async (probe, options) => {
|
|
101
|
+
await waitForResult(async () => {
|
|
102
|
+
await probe();
|
|
103
|
+
}, options);
|
|
104
|
+
};
|
|
105
|
+
export {
|
|
106
|
+
currentWaitDeadlineMs as c,
|
|
107
|
+
delay as d,
|
|
108
|
+
effectiveWaitTimeoutMs as e,
|
|
109
|
+
runWithWaitDeadline as r,
|
|
110
|
+
toPass as t,
|
|
111
|
+
waitForResult as w
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=wait-DV5gkXs8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait-DV5gkXs8.js","sources":["../node_modules/async-primitives/dist/index.mjs","../src/wait.ts"],"sourcesContent":["/*!\n* name: async-primitives\n* version: 1.7.0\n* description: A collection of primitive functions for asynchronous operations\n* author: Kouji Matsui (@kekyo@mi.kekyo.net)\n* license: MIT\n* repository.url: https://github.com/kekyo/async-primitives.git\n* git.commit.hash: 9472fbd5310b92690d84aaafb897429a04c013c5\n*/\n//#region src/primitives/internal/utils.ts\n/**\n* A no-op Releasable object that does nothing when released or disposed\n*/\nvar __NOOP_HANDLER = () => {};\nvar __NOOP_RELEASABLE = {\n\trelease: __NOOP_HANDLER,\n\t[Symbol.dispose]: __NOOP_HANDLER\n};\n//#endregion\n//#region src/primitives/abort-hook.ts\nvar toAbortError = (reason) => {\n\tif (reason instanceof Error) return reason;\n\tif (typeof reason === \"string\") return new Error(reason);\n\treturn /* @__PURE__ */ new Error(\"Operation aborted\");\n};\n/**\n* Hooks up an abort handler to an AbortSignal and returns a handle for early cleanup\n* @param signal - The AbortSignal to hook up to\n* @param callback - The callback to call when the signal is aborted\n* @returns A Releasable handle that can be used to remove the abort listener early\n*/\nvar onAbort = (signal, callback) => {\n\tif (!signal) return __NOOP_RELEASABLE;\n\tif (signal.aborted) {\n\t\ttry {\n\t\t\tcallback(toAbortError(signal.reason));\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"AbortHook callback error: \", error);\n\t\t}\n\t\treturn __NOOP_RELEASABLE;\n\t}\n\tlet abortHandler = () => {\n\t\tif (abortHandler) {\n\t\t\tconst reason = signal.reason;\n\t\t\tsignal.removeEventListener(\"abort\", abortHandler);\n\t\t\tabortHandler = void 0;\n\t\t\ttry {\n\t\t\t\tcallback(toAbortError(reason));\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn(\"AbortHook callback error: \", error);\n\t\t\t}\n\t\t}\n\t};\n\tconst release = () => {\n\t\tif (abortHandler) {\n\t\t\tsignal.removeEventListener(\"abort\", abortHandler);\n\t\t\tabortHandler = void 0;\n\t\t}\n\t};\n\tsignal.addEventListener(\"abort\", abortHandler, { once: true });\n\treturn {\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\n//#endregion\n//#region src/primitives/delay.ts\n/**\n* Helper function to create a delay\n* @param msec - The number of milliseconds to delay\n* @param signal - Optional AbortSignal to cancel the delay\n* @returns A promise that resolves after the delay or rejects if aborted\n*/\nvar delay = (msec, signal) => {\n\tif (signal) {\n\t\tif (signal.aborted) throw new Error(\"Delay was aborted\");\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\treject(/* @__PURE__ */ new Error(\"Delay was aborted\"));\n\t\t\t});\n\t\t\tconst timeoutId = setTimeout(() => {\n\t\t\t\tabortHandle.release();\n\t\t\t\tresolve();\n\t\t\t}, msec);\n\t\t});\n\t} else return new Promise((resolve) => {\n\t\tsetTimeout(resolve, msec);\n\t});\n};\n//#endregion\n//#region src/primitives/defer.ts\nvar runtimeGlobal$1 = globalThis;\nvar defer = (fn) => {\n\tconst setImmediateHandler = runtimeGlobal$1.setImmediate;\n\tif (typeof setImmediateHandler === \"function\") {\n\t\tsetImmediateHandler(fn);\n\t\treturn;\n\t}\n\tglobalThis.setTimeout(fn, 0);\n};\n//#endregion\n//#region src/primitives/mutex.ts\nvar ABORTED_ERROR$2 = () => /* @__PURE__ */ new Error(\"Lock acquisition was aborted\");\n/**\n* Creates a new LockHandle instance\n* @param releaseCallback Callback function to release the lock\n* @returns A LockHandle object with release and dispose functionality\n*/\nvar createLockHandle = (releaseCallback) => {\n\tlet isActive = true;\n\tconst release = () => {\n\t\tif (!isActive) return;\n\t\tisActive = false;\n\t\treleaseCallback();\n\t};\n\treturn {\n\t\tget isActive() {\n\t\t\treturn isActive;\n\t\t},\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\n/**\n* Creates a new Mutex instance\n* @param maxConsecutiveCalls - The maximum number of consecutive calls to the lockAsync method before yielding control to the next item in the queue\n* @returns A new Mutex for promise-based mutex operations\n*/\nvar createMutex = (maxConsecutiveCalls = 20) => {\n\tlet isLocked = false;\n\tconst queue = [];\n\tlet count = 0;\n\tconst processQueue = () => {\n\t\tvar _item$signal;\n\t\tif (isLocked || queue.length === 0) return;\n\t\tconst item = queue.shift();\n\t\tif ((_item$signal = item.signal) === null || _item$signal === void 0 ? void 0 : _item$signal.aborted) {\n\t\t\titem.reject(ABORTED_ERROR$2());\n\t\t\tscheduleNextProcess();\n\t\t\treturn;\n\t\t}\n\t\tisLocked = true;\n\t\tconst lockHandle = createLockHandle(releaseLock);\n\t\titem.resolve(lockHandle);\n\t};\n\tconst scheduleNextProcess = () => {\n\t\tcount++;\n\t\tif (count >= maxConsecutiveCalls) {\n\t\t\tcount = 0;\n\t\t\tdefer(processQueue);\n\t\t} else processQueue();\n\t};\n\tconst releaseLock = () => {\n\t\tif (!isLocked) return;\n\t\tisLocked = false;\n\t\tscheduleNextProcess();\n\t};\n\tconst removeFromQueue = (item) => {\n\t\tconst index = queue.indexOf(item);\n\t\tif (index !== -1) queue.splice(index, 1);\n\t};\n\tconst lock = async (signal) => {\n\t\tif (signal) {\n\t\t\tif (signal.aborted) throw ABORTED_ERROR$2();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst queueItem = {\n\t\t\t\t\tresolve: void 0,\n\t\t\t\t\treject: void 0,\n\t\t\t\t\tsignal\n\t\t\t\t};\n\t\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\t\tremoveFromQueue(queueItem);\n\t\t\t\t\treject(ABORTED_ERROR$2());\n\t\t\t\t});\n\t\t\t\tqueueItem.resolve = (handle) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\tresolve(handle);\n\t\t\t\t};\n\t\t\t\tqueueItem.reject = (error) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\treject(error);\n\t\t\t\t};\n\t\t\t\tqueue.push(queueItem);\n\t\t\t\tprocessQueue();\n\t\t\t});\n\t\t} else return new Promise((resolve, reject) => {\n\t\t\tqueue.push({\n\t\t\t\tresolve,\n\t\t\t\treject\n\t\t\t});\n\t\t\tprocessQueue();\n\t\t});\n\t};\n\treturn {\n\t\tlock,\n\t\twaiter: { wait: lock },\n\t\tget isLocked() {\n\t\t\treturn isLocked;\n\t\t},\n\t\tget pendingCount() {\n\t\t\treturn queue.length;\n\t\t}\n\t};\n};\n//#endregion\n//#region src/primitives/deferred.ts\n/**\n* Creates a new deferred object\n* @param T - The type of the result\n* @param signal - Optional AbortSignal for cancelling the wait\n* @returns A deferred object with a promise, resolve, and reject methods\n*/\nvar createDeferred = (signal) => {\n\tlet resolve;\n\tlet reject;\n\tconst promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\tconst disposer = onAbort(signal, () => {\n\t\tconst _reject = reject;\n\t\tif (_reject) {\n\t\t\tresolve = void 0;\n\t\t\treject = void 0;\n\t\t\t_reject(/* @__PURE__ */ new Error(\"Deferred aborted\"));\n\t\t}\n\t});\n\treturn {\n\t\tpromise,\n\t\tresolve: (value) => {\n\t\t\tconst _resolve = resolve;\n\t\t\tif (_resolve) {\n\t\t\t\tresolve = void 0;\n\t\t\t\treject = void 0;\n\t\t\t\tdisposer.release();\n\t\t\t\t_resolve(value);\n\t\t\t}\n\t\t},\n\t\treject: (error) => {\n\t\t\tconst _reject = reject;\n\t\t\tif (_reject) {\n\t\t\t\tresolve = void 0;\n\t\t\t\treject = void 0;\n\t\t\t\tdisposer.release();\n\t\t\t\t_reject(error);\n\t\t\t}\n\t\t}\n\t};\n};\n//#endregion\n//#region src/primitives/conditional.ts\nvar __NOOP_DUMMY_HANDLE = {\n\tget isActive() {\n\t\treturn false;\n\t},\n\trelease: __NOOP_HANDLER,\n\t[Symbol.dispose]: __NOOP_HANDLER\n};\n/**\n* Creates a conditional that can be automatically triggered\n* @returns A conditional that can be automatically triggered\n*/\nvar createConditional = () => {\n\tconst waiters = [];\n\tconst trigger = () => {\n\t\tif (waiters.length >= 1) waiters.shift().resolve();\n\t};\n\tconst wait = async (signal) => {\n\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) throw new Error(\"Conditional aborted\");\n\t\tconst waiter = createDeferred();\n\t\twaiters.push(waiter);\n\t\tconst disposer = onAbort(signal, () => {\n\t\t\twaiters.splice(waiters.indexOf(waiter), 1);\n\t\t\twaiter.reject(/* @__PURE__ */ new Error(\"Conditional aborted\"));\n\t\t});\n\t\ttry {\n\t\t\tawait waiter.promise;\n\t\t} finally {\n\t\t\tdisposer.release();\n\t\t}\n\t\treturn __NOOP_DUMMY_HANDLE;\n\t};\n\treturn {\n\t\ttrigger,\n\t\twait,\n\t\twaiter: { wait }\n\t};\n};\n/**\n* Creates a conditional that can be manually set and reset\n* @param initialState - Optional initial state of the conditional (Default: false, dropped)\n* @returns A conditional that can be manually set and reset\n*/\nvar createManuallyConditional = (initialState) => {\n\tconst waiters = [];\n\tlet raised = initialState !== null && initialState !== void 0 ? initialState : false;\n\tconst trigger = () => {\n\t\traised = false;\n\t\tconst waiter = waiters.shift();\n\t\tif (waiter) {\n\t\t\twaiter.resolve();\n\t\t\traised = false;\n\t\t}\n\t};\n\tconst raise = () => {\n\t\twhile (waiters.length >= 1) {\n\t\t\traised = true;\n\t\t\twaiters.shift().resolve();\n\t\t}\n\t\traised = true;\n\t};\n\tconst drop = () => {\n\t\traised = false;\n\t};\n\tconst wait = async (signal) => {\n\t\tif (raised) return __NOOP_DUMMY_HANDLE;\n\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) throw new Error(\"Conditional aborted\");\n\t\tconst waiter = createDeferred();\n\t\twaiters.push(waiter);\n\t\tconst disposer = onAbort(signal, () => {\n\t\t\twaiters.splice(waiters.indexOf(waiter), 1);\n\t\t\twaiter.reject(/* @__PURE__ */ new Error(\"Conditional aborted\"));\n\t\t});\n\t\ttry {\n\t\t\tawait waiter.promise;\n\t\t} finally {\n\t\t\tdisposer.release();\n\t\t}\n\t\treturn __NOOP_DUMMY_HANDLE;\n\t};\n\treturn {\n\t\ttrigger,\n\t\traise,\n\t\tdrop,\n\t\twait,\n\t\twaiter: { wait }\n\t};\n};\n//#endregion\n//#region src/primitives/deferred-generator.ts\n/**\n* Creates a new deferred generator object\n* @param T - The type of the yielded values\n* @param options - Optional options for the deferred generator\n* @returns A deferred generator object with an async generator and control functions\n*/\nvar createDeferredGenerator = (options) => {\n\tconst maxItemReserved = options === null || options === void 0 ? void 0 : options.maxItemReserved;\n\tconst signal = options === null || options === void 0 ? void 0 : options.signal;\n\tconst queue = [];\n\tconst arrived = createManuallyConditional();\n\tconst canReserve = maxItemReserved ? createManuallyConditional(true) : void 0;\n\tconst generator = (async function* () {\n\t\twhile (true) {\n\t\t\twhile (true) {\n\t\t\t\tconst item = queue.shift();\n\t\t\t\tif (maxItemReserved && queue.length === maxItemReserved - 1) canReserve.raise();\n\t\t\t\tif (!item) break;\n\t\t\t\tswitch (item.kind) {\n\t\t\t\t\tcase \"value\":\n\t\t\t\t\t\tyield item.value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"completed\": return;\n\t\t\t\t\tcase \"error\": throw item.error;\n\t\t\t\t}\n\t\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) throw new Error(\"Deferred generator aborted\");\n\t\t\t}\n\t\t\tarrived.drop();\n\t\t\ttry {\n\t\t\t\tawait arrived.wait(signal);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error && error.message === \"Conditional aborted\") error.message = \"Deferred generator aborted\";\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t})();\n\tconst enqueue = async (item, signal) => {\n\t\twhile (true) {\n\t\t\tif (!maxItemReserved || queue.length < maxItemReserved) {\n\t\t\t\tconst remains = queue.push(item);\n\t\t\t\tif (remains === 1) arrived.raise();\n\t\t\t\tif (remains === maxItemReserved) canReserve.drop();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait canReserve.wait(signal);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error && error.message === \"Conditional aborted\") error.message = \"Deferred generator aborted\";\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t};\n\treturn {\n\t\tgenerator,\n\t\tyield: (value, signal) => enqueue({\n\t\t\tkind: \"value\",\n\t\t\tvalue\n\t\t}, signal),\n\t\treturn: (signal) => enqueue({ kind: \"completed\" }, signal),\n\t\tthrow: (error, signal) => enqueue({\n\t\t\tkind: \"error\",\n\t\t\terror\n\t\t}, signal)\n\t};\n};\n//#endregion\n//#region src/primitives/internal/logical-context.ts\nvar runtimeGlobal = globalThis;\nvar LOGICAL_CONTEXT_HOOK = Symbol(\"logical-context-hook\");\nvar isHooked = (callback) => {\n\treturn callback[LOGICAL_CONTEXT_HOOK] === true;\n};\nvar markAsHooked = (callback) => {\n\tcallback[LOGICAL_CONTEXT_HOOK] = true;\n\treturn callback;\n};\nvar createLogicalContext = (id) => {\n\treturn {\n\t\tid,\n\t\tdata: /* @__PURE__ */ new Map()\n\t};\n};\nvar currentLogicalContext = createLogicalContext(Symbol(\"[root]\"));\nvar setCurrentLogicalContext = (context) => {\n\tcurrentLogicalContext = context;\n};\nvar trampoline = (adjustment, callback, thisArg, ...args) => {\n\tconst previousLogicalContext = currentLogicalContext;\n\tcurrentLogicalContext = adjustment.contextToUse;\n\ttry {\n\t\treturn callback.call(thisArg, ...args);\n\t} finally {\n\t\tadjustment.contextAfter = currentLogicalContext;\n\t\tcurrentLogicalContext = previousLogicalContext;\n\t}\n};\nvar isPrepared = false;\nvar prepareRuntimeHooks = () => {\n\tif (typeof globalThis.setTimeout !== \"undefined\" && !isHooked(globalThis.setTimeout)) {\n\t\tconst __setTimeout = globalThis.setTimeout;\n\t\tglobalThis.setTimeout = markAsHooked(((handler, timeout, ...args) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __setTimeout((...callbackArgs) => {\n\t\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, handler, void 0, ...callbackArgs);\n\t\t\t}, timeout, ...args);\n\t\t}));\n\t}\n\tif (typeof globalThis.setInterval !== \"undefined\" && !isHooked(globalThis.setInterval)) {\n\t\tconst __setInterval = globalThis.setInterval;\n\t\tglobalThis.setInterval = markAsHooked(((handler, timeout, ...args) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __setInterval((...callbackArgs) => {\n\t\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, handler, void 0, ...callbackArgs);\n\t\t\t}, timeout, ...args);\n\t\t}));\n\t}\n\tif (typeof globalThis.queueMicrotask !== \"undefined\" && !isHooked(globalThis.queueMicrotask)) {\n\t\tconst __queueMicrotask = globalThis.queueMicrotask;\n\t\tglobalThis.queueMicrotask = markAsHooked((callback) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __queueMicrotask(() => {\n\t\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, callback, void 0);\n\t\t\t});\n\t\t});\n\t}\n\tconst __setImmediate = runtimeGlobal.setImmediate;\n\tif (typeof __setImmediate === \"function\" && !isHooked(__setImmediate)) runtimeGlobal.setImmediate = markAsHooked(((callback, ...args) => {\n\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\treturn __setImmediate((...callbackArgs) => {\n\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, callback, void 0, ...callbackArgs);\n\t\t}, ...args);\n\t}));\n\tconst runtimeProcess = runtimeGlobal.process;\n\tif (runtimeProcess && typeof runtimeProcess.nextTick === \"function\" && !isHooked(runtimeProcess.nextTick)) {\n\t\tconst __nextTick = runtimeProcess.nextTick;\n\t\truntimeProcess.nextTick = markAsHooked((callback, ...args) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __nextTick(() => {\n\t\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, callback, void 0, ...args);\n\t\t\t});\n\t\t});\n\t}\n\tif (typeof globalThis.requestAnimationFrame !== \"undefined\" && !isHooked(globalThis.requestAnimationFrame)) {\n\t\tconst __requestAnimationFrame = globalThis.requestAnimationFrame;\n\t\tglobalThis.requestAnimationFrame = markAsHooked((callback) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __requestAnimationFrame((time) => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, callback, void 0, time);\n\t\t\t});\n\t\t});\n\t}\n};\nvar prepare = () => {\n\tprepareRuntimeHooks();\n\tif (isPrepared) return;\n\tisPrepared = true;\n\tif (typeof Promise !== \"undefined\") {\n\t\tconst __then = Promise.prototype.then;\n\t\tconst __catch = Promise.prototype.catch;\n\t\tconst __finally = Promise.prototype.finally;\n\t\tPromise.prototype.then = function(onFulfilled, onRejected) {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __then.call(this, onFulfilled ? (value) => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, onFulfilled, void 0, value);\n\t\t\t} : void 0, onRejected ? (reason) => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, onRejected, void 0, reason);\n\t\t\t} : void 0);\n\t\t};\n\t\tPromise.prototype.catch = function(onRejected) {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __catch.call(this, onRejected ? (reason) => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, onRejected, void 0, reason);\n\t\t\t} : void 0);\n\t\t};\n\t\tPromise.prototype.finally = function(onFinally) {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __finally.call(this, onFinally ? () => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, onFinally, void 0);\n\t\t\t} : void 0);\n\t\t};\n\t}\n\tif (typeof EventTarget !== \"undefined\" && EventTarget.prototype && EventTarget.prototype.addEventListener) {\n\t\tconst __eventTargetAddEventListener = EventTarget.prototype.addEventListener;\n\t\tEventTarget.prototype.addEventListener = function(type, listener, options) {\n\t\t\tif (listener === null || listener === void 0) return __eventTargetAddEventListener.call(this, type, listener, options);\n\t\t\tif (typeof listener === \"function\") {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t};\n\t\t\t\treturn __eventTargetAddEventListener.call(this, type, wrappedListener, options);\n\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\treturn __eventTargetAddEventListener.call(this, type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t}\n\t\t\treturn __eventTargetAddEventListener.call(this, type, listener, options);\n\t\t};\n\t}\n\tif (typeof Element !== \"undefined\" && Element.prototype && Element.prototype.addEventListener) {\n\t\tconst __elementAddEventListener = Element.prototype.addEventListener;\n\t\tElement.prototype.addEventListener = function(type, listener, options) {\n\t\t\tif (listener === null || listener === void 0) return __elementAddEventListener.call(this, type, listener, options);\n\t\t\tif (typeof listener === \"function\") {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t};\n\t\t\t\treturn __elementAddEventListener.call(this, type, wrappedListener, options);\n\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\treturn __elementAddEventListener.call(this, type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t}\n\t\t\treturn __elementAddEventListener.call(this, type, listener, options);\n\t\t};\n\t}\n\tif (typeof globalThis.XMLHttpRequest !== \"undefined\") {\n\t\tconst __XMLHttpRequest = globalThis.XMLHttpRequest;\n\t\tglobalThis.XMLHttpRequest = class extends __XMLHttpRequest {\n\t\t\tconstructor() {\n\t\t\t\tsuper();\n\t\t\t\tthis._userHandlers = /* @__PURE__ */ new Map();\n\t\t\t\t[\n\t\t\t\t\t\"onreadystatechange\",\n\t\t\t\t\t\"onloadstart\",\n\t\t\t\t\t\"onprogress\",\n\t\t\t\t\t\"onabort\",\n\t\t\t\t\t\"onerror\",\n\t\t\t\t\t\"onload\",\n\t\t\t\t\t\"ontimeout\",\n\t\t\t\t\t\"onloadend\"\n\t\t\t\t].forEach((prop) => {\n\t\t\t\t\tObject.defineProperty(this, prop, {\n\t\t\t\t\t\tget: () => this._userHandlers.get(prop) || null,\n\t\t\t\t\t\tset: (newHandler) => {\n\t\t\t\t\t\t\tthis._userHandlers.set(prop, newHandler);\n\t\t\t\t\t\t\tif (newHandler && typeof newHandler === \"function\") {\n\t\t\t\t\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\t\t\t\t\tconst wrappedHandler = function(event) {\n\t\t\t\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, newHandler, this, event);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, wrappedHandler);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = wrappedHandler;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, null);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\taddEventListener(type, listener, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tif (!listener) return super.addEventListener(type, listener, options);\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t\t};\n\t\t\t\t\treturn super.addEventListener(type, wrappedListener, options);\n\t\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) return super.addEventListener(type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t\treturn super.addEventListener(type, listener, options);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.WebSocket !== \"undefined\") {\n\t\tconst __WebSocket = globalThis.WebSocket;\n\t\tglobalThis.WebSocket = class extends __WebSocket {\n\t\t\tconstructor(url, protocols) {\n\t\t\t\tsuper(url, protocols);\n\t\t\t\tthis._userHandlers = /* @__PURE__ */ new Map();\n\t\t\t\t[\n\t\t\t\t\t\"onopen\",\n\t\t\t\t\t\"onmessage\",\n\t\t\t\t\t\"onerror\",\n\t\t\t\t\t\"onclose\"\n\t\t\t\t].forEach((prop) => {\n\t\t\t\t\tObject.defineProperty(this, prop, {\n\t\t\t\t\t\tget: () => this._userHandlers.get(prop) || null,\n\t\t\t\t\t\tset: (newHandler) => {\n\t\t\t\t\t\t\tthis._userHandlers.set(prop, newHandler);\n\t\t\t\t\t\t\tif (newHandler && typeof newHandler === \"function\") {\n\t\t\t\t\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\t\t\t\t\tconst wrappedHandler = function(event) {\n\t\t\t\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, newHandler, this, event);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, wrappedHandler);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = wrappedHandler;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, null);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\taddEventListener(type, listener, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tif (!listener) return super.addEventListener(type, listener, options);\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t\t};\n\t\t\t\t\treturn super.addEventListener(type, wrappedListener, options);\n\t\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) return super.addEventListener(type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t\treturn super.addEventListener(type, listener, options);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.MutationObserver !== \"undefined\") {\n\t\tconst __MutationObserver = globalThis.MutationObserver;\n\t\tglobalThis.MutationObserver = class extends __MutationObserver {\n\t\t\tconstructor(callback) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedCallback = (mutations, observer) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, callback, void 0, mutations, observer);\n\t\t\t\t};\n\t\t\t\tsuper(wrappedCallback);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.ResizeObserver !== \"undefined\") {\n\t\tconst __ResizeObserver = globalThis.ResizeObserver;\n\t\tglobalThis.ResizeObserver = class extends __ResizeObserver {\n\t\t\tconstructor(callback) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedCallback = (entries, observer) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, callback, void 0, entries, observer);\n\t\t\t\t};\n\t\t\t\tsuper(wrappedCallback);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.IntersectionObserver !== \"undefined\") {\n\t\tconst __IntersectionObserver = globalThis.IntersectionObserver;\n\t\tglobalThis.IntersectionObserver = class extends __IntersectionObserver {\n\t\t\tconstructor(callback, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedCallback = (entries, observer) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, callback, void 0, entries, observer);\n\t\t\t\t};\n\t\t\t\tsuper(wrappedCallback, options);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.Worker !== \"undefined\") {\n\t\tconst __Worker = globalThis.Worker;\n\t\tglobalThis.Worker = class extends __Worker {\n\t\t\tconstructor(scriptURL, options) {\n\t\t\t\tsuper(scriptURL, options);\n\t\t\t\tthis._userHandlers = /* @__PURE__ */ new Map();\n\t\t\t\t[\n\t\t\t\t\t\"onmessage\",\n\t\t\t\t\t\"onmessageerror\",\n\t\t\t\t\t\"onerror\"\n\t\t\t\t].forEach((prop) => {\n\t\t\t\t\tObject.defineProperty(this, prop, {\n\t\t\t\t\t\tget: () => this._userHandlers.get(prop) || null,\n\t\t\t\t\t\tset: (newHandler) => {\n\t\t\t\t\t\t\tthis._userHandlers.set(prop, newHandler);\n\t\t\t\t\t\t\tif (newHandler && typeof newHandler === \"function\") {\n\t\t\t\t\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\t\t\t\t\tconst wrappedHandler = function(event) {\n\t\t\t\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, newHandler, this, event);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, wrappedHandler);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = wrappedHandler;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, null);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\taddEventListener(type, listener, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tif (!listener) return super.addEventListener(type, listener, options);\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t\t};\n\t\t\t\t\treturn super.addEventListener(type, wrappedListener, options);\n\t\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) return super.addEventListener(type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t\treturn super.addEventListener(type, listener, options);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.MessagePort !== \"undefined\") {\n\t\tconst __MessagePort = globalThis.MessagePort;\n\t\tconst createMessagePortWrapper = (originalPort) => {\n\t\t\tconst _userHandlers = /* @__PURE__ */ new Map();\n\t\t\t[\"onmessage\", \"onmessageerror\"].forEach((prop) => {\n\t\t\t\tObject.defineProperty(originalPort, prop, {\n\t\t\t\t\tget: () => _userHandlers.get(prop) || null,\n\t\t\t\t\tset: (newHandler) => {\n\t\t\t\t\t\t_userHandlers.set(prop, newHandler);\n\t\t\t\t\t\tif (newHandler && typeof newHandler === \"function\") {\n\t\t\t\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\t\t\t\tconst wrappedHandler = function(event) {\n\t\t\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, newHandler, this, event);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(__MessagePort.prototype, prop);\n\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(originalPort, wrappedHandler);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(__MessagePort.prototype, prop);\n\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(originalPort, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst originalAddEventListener = originalPort.addEventListener;\n\t\t\toriginalPort.addEventListener = function(type, listener, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tif (!listener) return originalAddEventListener.call(this, type, listener, options);\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t\t};\n\t\t\t\t\treturn originalAddEventListener.call(this, type, wrappedListener, options);\n\t\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) return originalAddEventListener.call(this, type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t\treturn originalAddEventListener.call(this, type, listener, options);\n\t\t\t};\n\t\t\treturn originalPort;\n\t\t};\n\t\tif (typeof globalThis.MessageChannel !== \"undefined\") {\n\t\t\tconst __MessageChannel = globalThis.MessageChannel;\n\t\t\tglobalThis.MessageChannel = class extends __MessageChannel {\n\t\t\t\tconstructor() {\n\t\t\t\t\tsuper();\n\t\t\t\t\tcreateMessagePortWrapper(this.port1);\n\t\t\t\t\tcreateMessagePortWrapper(this.port2);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n};\n//#endregion\n//#region src/primitives/logical-context.ts\n/**\n* Set a value in the current logical context\n* @param key The symbol key for the value\n* @param value The value to store\n*/\nvar setLogicalContextValue = (key, value) => {\n\tprepare();\n\tif (value !== void 0) currentLogicalContext.data.set(key, value);\n\telse currentLogicalContext.data.delete(key);\n};\n/**\n* Get a value from the current logical context\n* @param key The symbol key for the value\n* @returns The stored value or undefined if not found\n*/\nvar getLogicalContextValue = (key) => {\n\tprepare();\n\treturn currentLogicalContext.data.get(key);\n};\n/**\n* Run a handler on a new logical context\n* @param prefix The prefix for the new logical context\n* @param handler The handler to run\n* @returns The result of the handler\n*/\nvar runOnNewLogicalContext = (prefix, handler) => {\n\tconst previousLogicalContext = currentLogicalContext;\n\tsetCurrentLogicalContext(createLogicalContext(Symbol(`${prefix}-${crypto.randomUUID()}`)));\n\ttry {\n\t\treturn handler();\n\t} finally {\n\t\tsetCurrentLogicalContext(previousLogicalContext);\n\t}\n};\n/**\n* Get the current logical context id\n* @returns The current logical context id\n*/\nvar getCurrentLogicalContextId = () => {\n\tprepare();\n\treturn currentLogicalContext.id;\n};\n//#endregion\n//#region src/primitives/async-local.ts\n/**\n* Creates a new AsyncLocal instance\n* @template T The type of the value to store in the async context\n* @returns A new AsyncLocal instance\n*/\nvar createAsyncLocal = () => {\n\tconst key = Symbol(`async-local-${crypto.randomUUID()}`);\n\treturn {\n\t\tsetValue: (value) => {\n\t\t\tsetLogicalContextValue(key, value);\n\t\t},\n\t\tgetValue: () => {\n\t\t\treturn getLogicalContextValue(key);\n\t\t}\n\t};\n};\n//#endregion\n//#region src/primitives/semaphore.ts\nvar ABORTED_ERROR$1 = () => /* @__PURE__ */ new Error(\"Semaphore acquisition was aborted\");\nvar INVALID_COUNT_ERROR = () => /* @__PURE__ */ new Error(\"Semaphore count must be greater than 0\");\n/**\n* Creates a new SemaphoreHandle instance\n* @param releaseCallback Callback function to release the semaphore resource\n* @returns A SemaphoreHandle object with release and dispose functionality\n*/\nvar createSemaphoreHandle = (releaseCallback) => {\n\tlet isActive = true;\n\tconst release = () => {\n\t\tif (!isActive) return;\n\t\tisActive = false;\n\t\treleaseCallback();\n\t};\n\treturn {\n\t\tget isActive() {\n\t\t\treturn isActive;\n\t\t},\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\n/**\n* Creates a new Semaphore instance for managing limited concurrent access\n* @param count The maximum number of concurrent acquisitions allowed (must be greater than 0)\n* @param maxConsecutiveCalls The maximum number of consecutive calls before yielding control\n* @returns A new Semaphore for managing concurrent resource access\n*/\nvar createSemaphore = (count, maxConsecutiveCalls = 20) => {\n\tif (count < 1) throw INVALID_COUNT_ERROR();\n\tlet availableCount = count;\n\tconst queue = [];\n\tlet consecutiveCallCount = 0;\n\tconst processQueue = () => {\n\t\twhile (availableCount > 0 && queue.length > 0) {\n\t\t\tvar _item$signal;\n\t\t\tconst item = queue.shift();\n\t\t\tif ((_item$signal = item.signal) === null || _item$signal === void 0 ? void 0 : _item$signal.aborted) {\n\t\t\t\titem.reject(ABORTED_ERROR$1());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tavailableCount--;\n\t\t\tconst semaphoreHandle = createSemaphoreHandle(releaseSemaphore);\n\t\t\titem.resolve(semaphoreHandle);\n\t\t}\n\t};\n\tconst scheduleNextProcess = () => {\n\t\tconsecutiveCallCount++;\n\t\tif (consecutiveCallCount >= maxConsecutiveCalls) {\n\t\t\tconsecutiveCallCount = 0;\n\t\t\tdefer(processQueue);\n\t\t} else processQueue();\n\t};\n\tconst releaseSemaphore = () => {\n\t\tavailableCount++;\n\t\tscheduleNextProcess();\n\t};\n\tconst removeFromQueue = (item) => {\n\t\tconst index = queue.indexOf(item);\n\t\tif (index !== -1) queue.splice(index, 1);\n\t};\n\tconst acquire = async (signal) => {\n\t\tif (signal) {\n\t\t\tif (signal.aborted) throw ABORTED_ERROR$1();\n\t\t\tif (availableCount > 0) {\n\t\t\t\tavailableCount--;\n\t\t\t\treturn createSemaphoreHandle(releaseSemaphore);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst queueItem = {\n\t\t\t\t\tresolve: void 0,\n\t\t\t\t\treject: void 0,\n\t\t\t\t\tsignal\n\t\t\t\t};\n\t\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\t\tremoveFromQueue(queueItem);\n\t\t\t\t\treject(ABORTED_ERROR$1());\n\t\t\t\t});\n\t\t\t\tqueueItem.resolve = (handle) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\tresolve(handle);\n\t\t\t\t};\n\t\t\t\tqueueItem.reject = (error) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\treject(error);\n\t\t\t\t};\n\t\t\t\tqueue.push(queueItem);\n\t\t\t\tprocessQueue();\n\t\t\t});\n\t\t} else {\n\t\t\tif (availableCount > 0) {\n\t\t\t\tavailableCount--;\n\t\t\t\treturn createSemaphoreHandle(releaseSemaphore);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tqueue.push({\n\t\t\t\t\tresolve,\n\t\t\t\t\treject\n\t\t\t\t});\n\t\t\t\tprocessQueue();\n\t\t\t});\n\t\t}\n\t};\n\treturn {\n\t\tacquire,\n\t\twaiter: { wait: acquire },\n\t\tget availableCount() {\n\t\t\treturn availableCount;\n\t\t},\n\t\tget pendingCount() {\n\t\t\treturn queue.length;\n\t\t}\n\t};\n};\n//#endregion\n//#region src/primitives/reader-writer-lock.ts\nvar ABORTED_ERROR = () => /* @__PURE__ */ new Error(\"Lock acquisition was aborted\");\n/**\n* Creates a new ReadLockHandle instance\n* @param releaseCallback Callback function to release the read lock\n* @returns A ReadLockHandle object with release and dispose functionality\n*/\nvar createReadLockHandle = (releaseCallback) => {\n\tlet isActive = true;\n\tconst release = () => {\n\t\tif (!isActive) return;\n\t\tisActive = false;\n\t\treleaseCallback();\n\t};\n\treturn {\n\t\tget isActive() {\n\t\t\treturn isActive;\n\t\t},\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\n/**\n* Creates a new WriteLockHandle instance\n* @param releaseCallback Callback function to release the write lock\n* @returns A WriteLockHandle object with release and dispose functionality\n*/\nvar createWriteLockHandle = (releaseCallback) => {\n\tlet isActive = true;\n\tconst release = () => {\n\t\tif (!isActive) return;\n\t\tisActive = false;\n\t\treleaseCallback();\n\t};\n\treturn {\n\t\tget isActive() {\n\t\t\treturn isActive;\n\t\t},\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\nfunction createReaderWriterLock(optionsOrMaxCalls) {\n\tlet policy = \"write-preferring\";\n\tlet maxConsecutiveCalls = 20;\n\tif (typeof optionsOrMaxCalls === \"number\") maxConsecutiveCalls = optionsOrMaxCalls;\n\telse if (optionsOrMaxCalls) {\n\t\tvar _optionsOrMaxCalls$po, _optionsOrMaxCalls$ma;\n\t\tpolicy = (_optionsOrMaxCalls$po = optionsOrMaxCalls.policy) !== null && _optionsOrMaxCalls$po !== void 0 ? _optionsOrMaxCalls$po : \"write-preferring\";\n\t\tmaxConsecutiveCalls = (_optionsOrMaxCalls$ma = optionsOrMaxCalls.maxConsecutiveCalls) !== null && _optionsOrMaxCalls$ma !== void 0 ? _optionsOrMaxCalls$ma : 20;\n\t}\n\tlet currentReaders = 0;\n\tlet hasWriter = false;\n\tconst readQueue = [];\n\tconst writeQueue = [];\n\tlet consecutiveCallCount = 0;\n\tconst processQueues = () => {\n\t\tif (policy === \"write-preferring\") {\n\t\t\tif (!hasWriter && currentReaders === 0 && writeQueue.length > 0) {\n\t\t\t\tvar _item$signal;\n\t\t\t\tconst item = writeQueue.shift();\n\t\t\t\tif ((_item$signal = item.signal) === null || _item$signal === void 0 ? void 0 : _item$signal.aborted) {\n\t\t\t\t\titem.reject(ABORTED_ERROR());\n\t\t\t\t\tscheduleNextProcess();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasWriter = true;\n\t\t\t\tconst writeLockHandle = createWriteLockHandle(releaseWriteLock);\n\t\t\t\titem.resolve(writeLockHandle);\n\t\t\t} else if (!hasWriter && writeQueue.length === 0 && readQueue.length > 0) {\n\t\t\t\tconst readersToProcess = [];\n\t\t\t\twhile (readQueue.length > 0) {\n\t\t\t\t\tvar _item$signal2;\n\t\t\t\t\tconst item = readQueue.shift();\n\t\t\t\t\tif ((_item$signal2 = item.signal) === null || _item$signal2 === void 0 ? void 0 : _item$signal2.aborted) item.reject(ABORTED_ERROR());\n\t\t\t\t\telse readersToProcess.push(item);\n\t\t\t\t}\n\t\t\t\tfor (const item of readersToProcess) {\n\t\t\t\t\tcurrentReaders++;\n\t\t\t\t\tconst readLockHandle = createReadLockHandle(releaseReadLock);\n\t\t\t\t\titem.resolve(readLockHandle);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!hasWriter && readQueue.length > 0) {\n\t\t\tconst readersToProcess = [];\n\t\t\twhile (readQueue.length > 0) {\n\t\t\t\tvar _item$signal3;\n\t\t\t\tconst item = readQueue.shift();\n\t\t\t\tif ((_item$signal3 = item.signal) === null || _item$signal3 === void 0 ? void 0 : _item$signal3.aborted) item.reject(ABORTED_ERROR());\n\t\t\t\telse readersToProcess.push(item);\n\t\t\t}\n\t\t\tfor (const item of readersToProcess) {\n\t\t\t\tcurrentReaders++;\n\t\t\t\tconst readLockHandle = createReadLockHandle(releaseReadLock);\n\t\t\t\titem.resolve(readLockHandle);\n\t\t\t}\n\t\t} else if (!hasWriter && currentReaders === 0 && writeQueue.length > 0) {\n\t\t\tvar _item$signal4;\n\t\t\tconst item = writeQueue.shift();\n\t\t\tif ((_item$signal4 = item.signal) === null || _item$signal4 === void 0 ? void 0 : _item$signal4.aborted) {\n\t\t\t\titem.reject(ABORTED_ERROR());\n\t\t\t\tscheduleNextProcess();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thasWriter = true;\n\t\t\tconst writeLockHandle = createWriteLockHandle(releaseWriteLock);\n\t\t\titem.resolve(writeLockHandle);\n\t\t}\n\t};\n\tconst scheduleNextProcess = () => {\n\t\tconsecutiveCallCount++;\n\t\tif (consecutiveCallCount >= maxConsecutiveCalls) {\n\t\t\tconsecutiveCallCount = 0;\n\t\t\tdefer(processQueues);\n\t\t} else processQueues();\n\t};\n\tconst releaseReadLock = () => {\n\t\tif (currentReaders > 0) {\n\t\t\tcurrentReaders--;\n\t\t\tif (currentReaders === 0) scheduleNextProcess();\n\t\t}\n\t};\n\tconst releaseWriteLock = () => {\n\t\tif (hasWriter) {\n\t\t\thasWriter = false;\n\t\t\tscheduleNextProcess();\n\t\t}\n\t};\n\tconst removeFromReadQueue = (item) => {\n\t\tconst index = readQueue.indexOf(item);\n\t\tif (index !== -1) readQueue.splice(index, 1);\n\t};\n\tconst removeFromWriteQueue = (item) => {\n\t\tconst index = writeQueue.indexOf(item);\n\t\tif (index !== -1) writeQueue.splice(index, 1);\n\t};\n\tconst readLock = async (signal) => {\n\t\tif (signal) {\n\t\t\tif (signal.aborted) throw ABORTED_ERROR();\n\t\t\tif (policy === \"read-preferring\" ? !hasWriter : !hasWriter && writeQueue.length === 0) {\n\t\t\t\tcurrentReaders++;\n\t\t\t\treturn createReadLockHandle(releaseReadLock);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst queueItem = {\n\t\t\t\t\tresolve: void 0,\n\t\t\t\t\treject: void 0,\n\t\t\t\t\tsignal\n\t\t\t\t};\n\t\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\t\tremoveFromReadQueue(queueItem);\n\t\t\t\t\treject(ABORTED_ERROR());\n\t\t\t\t});\n\t\t\t\tqueueItem.resolve = (handle) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\tresolve(handle);\n\t\t\t\t};\n\t\t\t\tqueueItem.reject = (error) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\treject(error);\n\t\t\t\t};\n\t\t\t\treadQueue.push(queueItem);\n\t\t\t\tprocessQueues();\n\t\t\t});\n\t\t} else {\n\t\t\tif (policy === \"read-preferring\" ? !hasWriter : !hasWriter && writeQueue.length === 0) {\n\t\t\t\tcurrentReaders++;\n\t\t\t\treturn createReadLockHandle(releaseReadLock);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treadQueue.push({\n\t\t\t\t\tresolve,\n\t\t\t\t\treject\n\t\t\t\t});\n\t\t\t\tprocessQueues();\n\t\t\t});\n\t\t}\n\t};\n\tconst writeLock = async (signal) => {\n\t\tif (signal) {\n\t\t\tif (signal.aborted) throw ABORTED_ERROR();\n\t\t\tif (!hasWriter && currentReaders === 0) {\n\t\t\t\thasWriter = true;\n\t\t\t\treturn createWriteLockHandle(releaseWriteLock);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst queueItem = {\n\t\t\t\t\tresolve: void 0,\n\t\t\t\t\treject: void 0,\n\t\t\t\t\tsignal\n\t\t\t\t};\n\t\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\t\tremoveFromWriteQueue(queueItem);\n\t\t\t\t\treject(ABORTED_ERROR());\n\t\t\t\t});\n\t\t\t\tqueueItem.resolve = (handle) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\tresolve(handle);\n\t\t\t\t};\n\t\t\t\tqueueItem.reject = (error) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\treject(error);\n\t\t\t\t};\n\t\t\t\twriteQueue.push(queueItem);\n\t\t\t\tprocessQueues();\n\t\t\t});\n\t\t} else {\n\t\t\tif (!hasWriter && currentReaders === 0) {\n\t\t\t\thasWriter = true;\n\t\t\t\treturn createWriteLockHandle(releaseWriteLock);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\twriteQueue.push({\n\t\t\t\t\tresolve,\n\t\t\t\t\treject\n\t\t\t\t});\n\t\t\t\tprocessQueues();\n\t\t\t});\n\t\t}\n\t};\n\treturn {\n\t\treadLock,\n\t\twriteLock,\n\t\treadWaiter: { wait: readLock },\n\t\twriteWaiter: { wait: writeLock },\n\t\tget currentReaders() {\n\t\t\treturn currentReaders;\n\t\t},\n\t\tget hasWriter() {\n\t\t\treturn hasWriter;\n\t\t},\n\t\tget pendingReadersCount() {\n\t\t\treturn readQueue.length;\n\t\t},\n\t\tget pendingWritersCount() {\n\t\t\treturn writeQueue.length;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/primitives/async-operator.ts\nvar __NO_INITIAL_VALUE = Symbol(\"no-initial-value\");\nvar __LINEAR_SKIP = Symbol(\"linear-skip\");\nvar __LINEAR_STOP = Symbol(\"linear-stop\");\nvar createAsyncIterable = (iteratorFactory) => ({ [Symbol.asyncIterator]: iteratorFactory });\nvar createSyncIterable = (iteratorFactory) => ({ [Symbol.iterator]: iteratorFactory });\nvar createIteratorFactories = (source) => isAsyncIterable(source) ? {\n\tsyncFactory: void 0,\n\tasyncFactory: () => toAsyncIterable(source)\n} : {\n\tsyncFactory: () => source,\n\tasyncFactory: () => toAsyncIterable(source)\n};\nvar createAsyncOnlyFactories = (asyncFactory) => ({\n\tsyncFactory: void 0,\n\tasyncFactory\n});\nvar normalizeIteratorFactories = (iteratorFactoriesOrAsyncFactory) => typeof iteratorFactoriesOrAsyncFactory === \"function\" ? createAsyncOnlyFactories(iteratorFactoriesOrAsyncFactory) : iteratorFactoriesOrAsyncFactory;\nvar identity = (value) => value;\nvar sameValueZero = (left, right) => left === right || left !== left && right !== right;\nvar isArraySource = (source) => Array.isArray(source);\nvar isPromiseLike = (value) => (typeof value === \"object\" && value !== null || typeof value === \"function\") && typeof value.then === \"function\";\nvar isAsyncIterable = (source) => typeof source[Symbol.asyncIterator] === \"function\";\nvar toAsyncIterable = (source) => createAsyncIterable(async function* () {\n\tif (isAsyncIterable(source)) for await (const value of source) yield value;\n\telse for (const value of source) yield isPromiseLike(value) ? await value : value;\n});\nvar toIntegerOrInfinity = (value) => {\n\tif (Number.isNaN(value) || value === 0) return 0;\n\tif (!Number.isFinite(value)) return value;\n\treturn Math.trunc(value);\n};\nvar normalizeCount = (count) => {\n\tif (Number.isNaN(count) || count <= 0) return 0;\n\treturn Math.trunc(count);\n};\nvar normalizeRequiredCount = (count, name) => {\n\tif (!Number.isFinite(count) || count <= 0) throw new RangeError(`${name} must be greater than 0`);\n\treturn Math.trunc(count);\n};\nvar isNonNullish = (value) => value !== null && value !== void 0;\nvar compareValues = (left, right) => {\n\tif (left < right) return -1;\n\tif (left > right) return 1;\n\treturn 0;\n};\nvar createLinearRuntimeState = (operation) => {\n\tswitch (operation.kind) {\n\t\tcase \"map\":\n\t\tcase \"filter\":\n\t\tcase \"choose\":\n\t\tcase \"takeWhile\": return {\n\t\t\tkind: operation.kind,\n\t\t\tindex: 0\n\t\t};\n\t\tcase \"skipWhile\": return {\n\t\t\tkind: operation.kind,\n\t\t\tindex: 0,\n\t\t\tskipping: true\n\t\t};\n\t}\n};\nvar createLinearPipelineFactories = (pipeline) => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\tconst runtimeStates = pipeline.operations.map(createLinearRuntimeState);\n\tconst applyOperations = async (input) => {\n\t\tlet current = input;\n\t\tfor (let operationIndex = 0; operationIndex < pipeline.operations.length; operationIndex++) {\n\t\t\tconst operation = pipeline.operations[operationIndex];\n\t\t\tconst runtimeState = runtimeStates[operationIndex];\n\t\t\tswitch (operation.kind) {\n\t\t\t\tcase \"map\": {\n\t\t\t\t\tconst selected = operation.selector(current, runtimeState.index);\n\t\t\t\t\tcurrent = isPromiseLike(selected) ? await selected : selected;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"filter\": {\n\t\t\t\t\tconst result = operation.predicate(current, runtimeState.index);\n\t\t\t\t\tconst included = isPromiseLike(result) ? await result : result;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tif (!included) return __LINEAR_SKIP;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"choose\": {\n\t\t\t\t\tconst result = operation.selector(current, runtimeState.index);\n\t\t\t\t\tconst selected = isPromiseLike(result) ? await result : result;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tif (!isNonNullish(selected)) return __LINEAR_SKIP;\n\t\t\t\t\tcurrent = selected;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"skipWhile\": {\n\t\t\t\t\tconst skipState = runtimeState;\n\t\t\t\t\tconst result = operation.predicate(current, runtimeState.index);\n\t\t\t\t\tconst shouldSkip = isPromiseLike(result) ? await result : result;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tif (skipState.skipping && shouldSkip) return __LINEAR_SKIP;\n\t\t\t\t\tskipState.skipping = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"takeWhile\": {\n\t\t\t\t\tconst result = operation.predicate(current, runtimeState.index);\n\t\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return __LINEAR_STOP;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn current;\n\t};\n\tconst { syncFactory, asyncFactory } = pipeline.sourceFactories;\n\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\tconst processedValue = await applyOperations(isPromiseLike(value) ? await value : value);\n\t\tif (processedValue === __LINEAR_STOP) return;\n\t\tif (processedValue !== __LINEAR_SKIP) yield processedValue;\n\t}\n\telse for await (const value of asyncFactory()) {\n\t\tconst processedValue = await applyOperations(value);\n\t\tif (processedValue === __LINEAR_STOP) return;\n\t\tif (processedValue !== __LINEAR_SKIP) yield processedValue;\n\t}\n}));\nvar collectKeysFromSource = async (source, selector) => {\n\tconst { syncFactory, asyncFactory } = createIteratorFactories(source);\n\tlet index = 0;\n\tconst keys = /* @__PURE__ */ new Set();\n\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\tconst key = selector(isPromiseLike(value) ? await value : value, index);\n\t\tkeys.add(isPromiseLike(key) ? await key : key);\n\t\tindex++;\n\t}\n\telse for await (const value of asyncFactory()) {\n\t\tconst key = selector(value, index);\n\t\tkeys.add(isPromiseLike(key) ? await key : key);\n\t\tindex++;\n\t}\n\treturn keys;\n};\nvar collectValuesFromSource = async (source) => {\n\tconst { syncFactory, asyncFactory } = createIteratorFactories(source);\n\tconst values = /* @__PURE__ */ new Set();\n\tif (syncFactory !== void 0) for (const value of syncFactory()) values.add(isPromiseLike(value) ? await value : value);\n\telse for await (const value of asyncFactory()) values.add(value);\n\treturn values;\n};\nvar materializeValues = async (iteratorFactories) => {\n\tconst { syncFactory, asyncFactory } = iteratorFactories;\n\tconst values = [];\n\tif (syncFactory !== void 0) for (const value of syncFactory()) values.push(isPromiseLike(value) ? await value : value);\n\telse for await (const value of asyncFactory()) values.push(value);\n\treturn values;\n};\nvar findExtremeBy = async (iteratorFactories, selector, direction) => {\n\tconst { syncFactory, asyncFactory } = iteratorFactories;\n\tlet index = 0;\n\tlet hasBestValue = false;\n\tlet bestValue;\n\tlet bestKey;\n\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\tconst selectedKey = selector(resolvedValue, index);\n\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\tif (!hasBestValue || (direction === \"min\" ? compareValues(key, bestKey) < 0 : compareValues(key, bestKey) > 0)) {\n\t\t\thasBestValue = true;\n\t\t\tbestValue = resolvedValue;\n\t\t\tbestKey = key;\n\t\t}\n\t\tindex++;\n\t}\n\telse for await (const value of asyncFactory()) {\n\t\tconst selectedKey = selector(value, index);\n\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\tif (!hasBestValue || (direction === \"min\" ? compareValues(key, bestKey) < 0 : compareValues(key, bestKey) > 0)) {\n\t\t\thasBestValue = true;\n\t\t\tbestValue = value;\n\t\t\tbestKey = key;\n\t\t}\n\t\tindex++;\n\t}\n\treturn bestValue;\n};\nvar createAsyncOperator = (iteratorFactoriesOrAsyncFactory, linearPipeline) => {\n\tconst iteratorFactories = normalizeIteratorFactories(iteratorFactoriesOrAsyncFactory);\n\tconst { syncFactory, asyncFactory } = iteratorFactories;\n\tconst iterableFactory = asyncFactory;\n\tconst appendLinearOperation = (operation, createFallbackIteratorFactories) => {\n\t\tconst nextLinearPipeline = linearPipeline === void 0 ? {\n\t\t\tsourceFactories: iteratorFactories,\n\t\t\toperations: [operation]\n\t\t} : {\n\t\t\tsourceFactories: linearPipeline.sourceFactories,\n\t\t\toperations: [...linearPipeline.operations, operation]\n\t\t};\n\t\treturn createAsyncOperator(linearPipeline === void 0 ? createFallbackIteratorFactories() : createLinearPipelineFactories(nextLinearPipeline), nextLinearPipeline);\n\t};\n\tconst reduce = (async (...args) => {\n\t\tconst [reducer] = args;\n\t\tlet accumulator = args.length === 2 ? args[1] : __NO_INITIAL_VALUE;\n\t\tlet index = 0;\n\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\tif (accumulator === __NO_INITIAL_VALUE) accumulator = resolvedValue;\n\t\t\telse {\n\t\t\t\tconst reduced = reducer(accumulator, resolvedValue, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\telse for await (const value of asyncFactory()) {\n\t\t\tif (accumulator === __NO_INITIAL_VALUE) accumulator = value;\n\t\t\telse {\n\t\t\t\tconst reduced = reducer(accumulator, value, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\tif (accumulator === __NO_INITIAL_VALUE) throw new TypeError(\"Reduce of empty AsyncOperator with no initial value\");\n\t\treturn accumulator;\n\t});\n\tconst reduceRight = (async (...args) => {\n\t\tconst [reducer] = args;\n\t\tconst hasInitialValue = args.length === 2;\n\t\tconst values = await materializeValues(iteratorFactories);\n\t\tlet accumulator = hasInitialValue ? args[1] : __NO_INITIAL_VALUE;\n\t\tfor (let index = values.length - 1; index >= 0; index--) {\n\t\t\tconst value = values[index];\n\t\t\tif (accumulator === __NO_INITIAL_VALUE) accumulator = value;\n\t\t\telse {\n\t\t\t\tconst reduced = reducer(accumulator, value, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t}\n\t\t}\n\t\tif (accumulator === __NO_INITIAL_VALUE) throw new TypeError(\"ReduceRight of empty AsyncOperator with no initial value\");\n\t\treturn accumulator;\n\t});\n\tconst flat = ((depth) => createAsyncOperator(createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\tconst values = await materializeValues(iteratorFactories);\n\t\tfor (const value of values.flat(depth)) yield value;\n\t}))));\n\treturn {\n\t\t[Symbol.asyncIterator]: () => asyncFactory()[Symbol.asyncIterator](),\n\t\tmap: (selector) => appendLinearOperation({\n\t\t\tkind: \"map\",\n\t\t\tselector\n\t\t}, () => {\n\t\t\tconst mappedSyncFactory = syncFactory === void 0 ? void 0 : () => createSyncIterable(function* () {\n\t\t\t\tlet index = 0;\n\t\t\t\tfor (const value of syncFactory()) {\n\t\t\t\t\tconst currentIndex = index;\n\t\t\t\t\tif (isPromiseLike(value)) yield value.then((resolvedValue) => selector(resolvedValue, currentIndex));\n\t\t\t\t\telse yield selector(value, currentIndex);\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (mappedSyncFactory !== void 0) return {\n\t\t\t\tsyncFactory: mappedSyncFactory,\n\t\t\t\tasyncFactory: () => toAsyncIterable(mappedSyncFactory())\n\t\t\t};\n\t\t\treturn createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\t\tlet index = 0;\n\t\t\t\tfor await (const value of iterableFactory()) {\n\t\t\t\t\tconst selected = selector(value, index);\n\t\t\t\t\tyield isPromiseLike(selected) ? await selected : selected;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t}));\n\t\t}),\n\t\tflatMap: (selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) {\n\t\t\t\tconst source = syncFactory();\n\t\t\t\tif (Array.isArray(source)) for (let outerIndex = 0; outerIndex < source.length; outerIndex++) {\n\t\t\t\t\tconst value = source[outerIndex];\n\t\t\t\t\tconst selected = selector(isPromiseLike(value) ? await value : value, index);\n\t\t\t\t\tconst innerSource = isPromiseLike(selected) ? await selected : selected;\n\t\t\t\t\tif (isArraySource(innerSource)) for (let innerIndex = 0; innerIndex < innerSource.length; innerIndex++) {\n\t\t\t\t\t\tconst innerValue = innerSource[innerIndex];\n\t\t\t\t\t\tyield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t\t}\n\t\t\t\t\telse if (isAsyncIterable(innerSource)) for await (const innerValue of innerSource) yield innerValue;\n\t\t\t\t\telse for (const innerValue of innerSource) yield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\telse for (const value of source) {\n\t\t\t\t\tconst selected = selector(isPromiseLike(value) ? await value : value, index);\n\t\t\t\t\tconst innerSource = isPromiseLike(selected) ? await selected : selected;\n\t\t\t\t\tif (isArraySource(innerSource)) for (let innerIndex = 0; innerIndex < innerSource.length; innerIndex++) {\n\t\t\t\t\t\tconst innerValue = innerSource[innerIndex];\n\t\t\t\t\t\tyield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t\t}\n\t\t\t\t\telse if (isAsyncIterable(innerSource)) for await (const innerValue of innerSource) yield innerValue;\n\t\t\t\t\telse for (const innerValue of innerSource) yield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t} else for await (const value of iterableFactory()) {\n\t\t\t\tconst selected = selector(value, index);\n\t\t\t\tconst innerSource = isPromiseLike(selected) ? await selected : selected;\n\t\t\t\tif (isArraySource(innerSource)) for (let innerIndex = 0; innerIndex < innerSource.length; innerIndex++) {\n\t\t\t\t\tconst innerValue = innerSource[innerIndex];\n\t\t\t\t\tyield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t}\n\t\t\t\telse if (isAsyncIterable(innerSource)) for await (const innerValue of innerSource) yield innerValue;\n\t\t\t\telse for (const innerValue of innerSource) yield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tfilter: (predicate) => appendLinearOperation({\n\t\t\tkind: \"filter\",\n\t\t\tpredicate\n\t\t}, () => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) yield resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) yield value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}))),\n\t\tconcat: (...sources) => {\n\t\t\tconst concatenatedSyncFactory = syncFactory !== void 0 && sources.every((source) => !isAsyncIterable(source)) ? () => createSyncIterable(function* () {\n\t\t\t\tfor (const value of syncFactory()) yield value;\n\t\t\t\tfor (const source of sources) for (const value of source) yield value;\n\t\t\t}) : void 0;\n\t\t\tif (concatenatedSyncFactory !== void 0) return createAsyncOperator({\n\t\t\t\tsyncFactory: concatenatedSyncFactory,\n\t\t\t\tasyncFactory: () => toAsyncIterable(concatenatedSyncFactory())\n\t\t\t});\n\t\t\treturn createAsyncOperator(createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) yield isPromiseLike(value) ? await value : value;\n\t\t\t\telse for await (const value of iterableFactory()) yield value;\n\t\t\t\tfor (const source of sources) if (isAsyncIterable(source)) for await (const value of source) yield value;\n\t\t\t\telse for (const value of source) yield isPromiseLike(value) ? await value : value;\n\t\t\t})));\n\t\t},\n\t\tchoose: (selector) => appendLinearOperation({\n\t\t\tkind: \"choose\",\n\t\t\tselector\n\t\t}, () => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = selector(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tconst selected = isPromiseLike(result) ? await result : result;\n\t\t\t\tif (isNonNullish(selected)) yield selected;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = selector(value, index);\n\t\t\t\tconst selected = isPromiseLike(result) ? await result : result;\n\t\t\t\tif (isNonNullish(selected)) yield selected;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}))),\n\t\tslice: (start, end) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedStart = toIntegerOrInfinity(start);\n\t\t\tconst normalizedEnd = end === void 0 ? void 0 : toIntegerOrInfinity(end);\n\t\t\tif (normalizedStart < 0 || normalizedEnd !== void 0 && normalizedEnd < 0) {\n\t\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\t\tfor (const value of values.slice(start, end)) yield value;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst startIndex = Math.max(normalizedStart, 0);\n\t\t\tif (startIndex === Infinity) return;\n\t\t\tconst endIndex = normalizedEnd === void 0 ? void 0 : Math.max(normalizedEnd, 0);\n\t\t\tif (endIndex !== void 0 && endIndex !== Infinity && endIndex <= startIndex) return;\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) {\n\t\t\t\tconst iterator = syncFactory()[Symbol.iterator]();\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (endIndex !== void 0 && endIndex !== Infinity && index >= endIndex) return;\n\t\t\t\t\tconst result = iterator.next();\n\t\t\t\t\tif (result.done) return;\n\t\t\t\t\tconst value = result.value;\n\t\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\t\tif (index >= startIndex) yield resolvedValue;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst iterator = iterableFactory()[Symbol.asyncIterator]();\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (endIndex !== void 0 && endIndex !== Infinity && index >= endIndex) return;\n\t\t\t\t\tconst result = await iterator.next();\n\t\t\t\t\tif (result.done) return;\n\t\t\t\t\tconst value = result.value;\n\t\t\t\t\tif (index >= startIndex) yield value;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t}\n\t\t})),\n\t\tdistinct: () => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!seenValues.has(resolvedValue)) {\n\t\t\t\t\tseenValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) if (!seenValues.has(value)) {\n\t\t\t\tseenValues.add(value);\n\t\t\t\tyield value;\n\t\t\t}\n\t\t})),\n\t\tdistinctBy: (selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tconst seenKeys = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tskip: (count) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedCount = normalizeCount(count);\n\t\t\tlet skippedCount = 0;\n\t\t\tfor await (const value of iterableFactory()) {\n\t\t\t\tif (skippedCount < normalizedCount) {\n\t\t\t\t\tskippedCount++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tyield value;\n\t\t\t}\n\t\t})),\n\t\tskipWhile: (predicate) => appendLinearOperation({\n\t\t\tkind: \"skipWhile\",\n\t\t\tpredicate\n\t\t}, () => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tlet skipping = true;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (skipping && (isPromiseLike(result) ? await result : result)) {\n\t\t\t\t\tindex++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tskipping = false;\n\t\t\t\tyield resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (skipping && (isPromiseLike(result) ? await result : result)) {\n\t\t\t\t\tindex++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tskipping = false;\n\t\t\t\tyield value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}))),\n\t\ttake: (count) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedCount = normalizeCount(count);\n\t\t\tif (normalizedCount === 0) return;\n\t\t\tlet takenCount = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tyield isPromiseLike(value) ? await value : value;\n\t\t\t\ttakenCount++;\n\t\t\t\tif (takenCount >= normalizedCount) return;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tyield value;\n\t\t\t\ttakenCount++;\n\t\t\t\tif (takenCount >= normalizedCount) return;\n\t\t\t}\n\t\t})),\n\t\ttakeWhile: (predicate) => appendLinearOperation({\n\t\t\tkind: \"takeWhile\",\n\t\t\tpredicate\n\t\t}, () => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return;\n\t\t\t\tyield resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return;\n\t\t\t\tyield value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}))),\n\t\tpairwise: () => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tlet hasPreviousValue = false;\n\t\t\tlet previousValue;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (hasPreviousValue) yield [previousValue, resolvedValue];\n\t\t\t\tpreviousValue = resolvedValue;\n\t\t\t\thasPreviousValue = true;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tif (hasPreviousValue) yield [previousValue, value];\n\t\t\t\tpreviousValue = value;\n\t\t\t\thasPreviousValue = true;\n\t\t\t}\n\t\t})),\n\t\tzip: (source) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tif (isAsyncIterable(source)) {\n\t\t\t\tconst otherIterator = source[Symbol.asyncIterator]();\n\t\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\t\tconst otherResult = await otherIterator.next();\n\t\t\t\t\tif (otherResult.done) return;\n\t\t\t\t\tyield [isPromiseLike(value) ? await value : value, otherResult.value];\n\t\t\t\t}\n\t\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\t\tconst otherResult = await otherIterator.next();\n\t\t\t\t\tif (otherResult.done) return;\n\t\t\t\t\tyield [value, otherResult.value];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst otherIterator = source[Symbol.iterator]();\n\t\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\t\tconst otherResult = otherIterator.next();\n\t\t\t\t\tif (otherResult.done) return;\n\t\t\t\t\tyield [isPromiseLike(value) ? await value : value, isPromiseLike(otherResult.value) ? await otherResult.value : otherResult.value];\n\t\t\t\t}\n\t\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\t\tconst otherResult = otherIterator.next();\n\t\t\t\t\tif (otherResult.done) return;\n\t\t\t\t\tyield [value, isPromiseLike(otherResult.value) ? await otherResult.value : otherResult.value];\n\t\t\t\t}\n\t\t\t}\n\t\t})),\n\t\tscan: (reducer, initialValue) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tlet accumulator = initialValue;\n\t\t\tlet index = 0;\n\t\t\tyield accumulator;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst reduced = reducer(accumulator, resolvedValue, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t\tyield accumulator;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst reduced = reducer(accumulator, value, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t\tyield accumulator;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tunion: (source) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!seenValues.has(resolvedValue)) {\n\t\t\t\t\tseenValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) if (!seenValues.has(value)) {\n\t\t\t\tseenValues.add(value);\n\t\t\t\tyield value;\n\t\t\t}\n\t\t\tif (isAsyncIterable(source)) {\n\t\t\t\tfor await (const value of source) if (!seenValues.has(value)) {\n\t\t\t\t\tseenValues.add(value);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t} else for (const value of source) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!seenValues.has(resolvedValue)) {\n\t\t\t\t\tseenValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t})),\n\t\tunionBy: (source, selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst seenKeys = /* @__PURE__ */ new Set();\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tindex = 0;\n\t\t\tif (isAsyncIterable(source)) for await (const value of source) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for (const value of source) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tintersect: (source) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst rightValues = await collectValuesFromSource(source);\n\t\t\tconst yieldedValues = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (rightValues.has(resolvedValue) && !yieldedValues.has(resolvedValue)) {\n\t\t\t\t\tyieldedValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) if (rightValues.has(value) && !yieldedValues.has(value)) {\n\t\t\t\tyieldedValues.add(value);\n\t\t\t\tyield value;\n\t\t\t}\n\t\t})),\n\t\tintersectBy: (source, selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst rightKeys = await collectKeysFromSource(source, selector);\n\t\t\tconst yieldedKeys = /* @__PURE__ */ new Set();\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (rightKeys.has(key) && !yieldedKeys.has(key)) {\n\t\t\t\t\tyieldedKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (rightKeys.has(key) && !yieldedKeys.has(key)) {\n\t\t\t\t\tyieldedKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\texcept: (source) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst excludedValues = await collectValuesFromSource(source);\n\t\t\tconst yieldedValues = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!excludedValues.has(resolvedValue) && !yieldedValues.has(resolvedValue)) {\n\t\t\t\t\tyieldedValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) if (!excludedValues.has(value) && !yieldedValues.has(value)) {\n\t\t\t\tyieldedValues.add(value);\n\t\t\t\tyield value;\n\t\t\t}\n\t\t})),\n\t\texceptBy: (source, selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst excludedKeys = await collectKeysFromSource(source, selector);\n\t\t\tconst yieldedKeys = /* @__PURE__ */ new Set();\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!excludedKeys.has(key) && !yieldedKeys.has(key)) {\n\t\t\t\t\tyieldedKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!excludedKeys.has(key) && !yieldedKeys.has(key)) {\n\t\t\t\t\tyieldedKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tchunkBySize: (size) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedSize = normalizeRequiredCount(size, \"Chunk size\");\n\t\t\tlet chunk = [];\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tchunk.push(isPromiseLike(value) ? await value : value);\n\t\t\t\tif (chunk.length >= normalizedSize) {\n\t\t\t\t\tyield chunk;\n\t\t\t\t\tchunk = [];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tchunk.push(value);\n\t\t\t\tif (chunk.length >= normalizedSize) {\n\t\t\t\t\tyield chunk;\n\t\t\t\t\tchunk = [];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (chunk.length > 0) yield chunk;\n\t\t})),\n\t\twindowed: (size) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedSize = normalizeRequiredCount(size, \"Window size\");\n\t\t\tconst buffer = new Array(normalizedSize);\n\t\t\tlet count = 0;\n\t\t\tlet nextIndex = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tbuffer[nextIndex] = isPromiseLike(value) ? await value : value;\n\t\t\t\tnextIndex = (nextIndex + 1) % normalizedSize;\n\t\t\t\tcount = Math.min(count + 1, normalizedSize);\n\t\t\t\tif (count < normalizedSize) continue;\n\t\t\t\tconst window = new Array(normalizedSize);\n\t\t\t\tfor (let index = 0; index < normalizedSize; index++) window[index] = buffer[(nextIndex + index) % normalizedSize];\n\t\t\t\tyield window;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tbuffer[nextIndex] = value;\n\t\t\t\tnextIndex = (nextIndex + 1) % normalizedSize;\n\t\t\t\tcount = Math.min(count + 1, normalizedSize);\n\t\t\t\tif (count < normalizedSize) continue;\n\t\t\t\tconst window = new Array(normalizedSize);\n\t\t\t\tfor (let index = 0; index < normalizedSize; index++) window[index] = buffer[(nextIndex + index) % normalizedSize];\n\t\t\t\tyield window;\n\t\t\t}\n\t\t})),\n\t\tflat,\n\t\treverse: () => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\tvalues.reverse();\n\t\t\tfor (const value of values) yield value;\n\t\t})),\n\t\ttoReversed: () => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\tfor (const value of [...values].reverse()) yield value;\n\t\t})),\n\t\tsort: (compareFn) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\tcompareFn === void 0 ? values.sort() : values.sort(compareFn);\n\t\t\tfor (const value of values) yield value;\n\t\t})),\n\t\ttoSorted: (compareFn) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst sortedValues = [...await materializeValues(iteratorFactories)];\n\t\t\tcompareFn === void 0 ? sortedValues.sort() : sortedValues.sort(compareFn);\n\t\t\tfor (const value of sortedValues) yield value;\n\t\t})),\n\t\tforEach: async (action) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = action(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (isPromiseLike(result)) await result;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = action(value, index);\n\t\t\t\tif (isPromiseLike(result)) await result;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t},\n\t\treduce,\n\t\treduceRight,\n\t\tsome: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = predicate(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return true;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return true;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tevery: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = predicate(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return false;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return false;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tfind: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t},\n\t\tfindIndex: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = predicate(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn -1;\n\t\t},\n\t\tat: async (index) => {\n\t\t\tconst normalizedIndex = toIntegerOrInfinity(index);\n\t\t\tif (normalizedIndex >= 0) {\n\t\t\t\tif (normalizedIndex === Infinity) return;\n\t\t\t\tlet currentIndex = 0;\n\t\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\t\tif (currentIndex === normalizedIndex) return resolvedValue;\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\t\tif (currentIndex === normalizedIndex) return value;\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (normalizedIndex === -Infinity) return;\n\t\t\tconst lookback = Math.abs(normalizedIndex);\n\t\t\tconst buffer = new Array(lookback);\n\t\t\tlet count = 0;\n\t\t\tlet nextIndex = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tbuffer[nextIndex] = isPromiseLike(value) ? await value : value;\n\t\t\t\tnextIndex = (nextIndex + 1) % lookback;\n\t\t\t\tcount = Math.min(count + 1, lookback);\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tbuffer[nextIndex] = value;\n\t\t\t\tnextIndex = (nextIndex + 1) % lookback;\n\t\t\t\tcount = Math.min(count + 1, lookback);\n\t\t\t}\n\t\t\treturn count === lookback ? buffer[nextIndex] : void 0;\n\t\t},\n\t\tincludes: async (searchElement, fromIndex) => {\n\t\t\tconst normalizedFromIndex = toIntegerOrInfinity(fromIndex !== null && fromIndex !== void 0 ? fromIndex : 0);\n\t\t\tif (normalizedFromIndex < 0) return (await materializeValues(iteratorFactories)).includes(searchElement, normalizedFromIndex);\n\t\t\tif (normalizedFromIndex === Infinity) return false;\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (index >= normalizedFromIndex && sameValueZero(resolvedValue, searchElement)) return true;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tif (index >= normalizedFromIndex && sameValueZero(value, searchElement)) return true;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tindexOf: async (searchElement, fromIndex) => {\n\t\t\tconst normalizedFromIndex = toIntegerOrInfinity(fromIndex !== null && fromIndex !== void 0 ? fromIndex : 0);\n\t\t\tif (normalizedFromIndex < 0) return (await materializeValues(iteratorFactories)).indexOf(searchElement, normalizedFromIndex);\n\t\t\tif (normalizedFromIndex === Infinity) return -1;\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (index >= normalizedFromIndex && resolvedValue === searchElement) return index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tif (index >= normalizedFromIndex && value === searchElement) return index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn -1;\n\t\t},\n\t\tlastIndexOf: async (searchElement, fromIndex) => {\n\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\treturn fromIndex === void 0 ? values.lastIndexOf(searchElement) : values.lastIndexOf(searchElement, fromIndex);\n\t\t},\n\t\tfindLast: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tlet foundValue;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) foundValue = resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) foundValue = value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn foundValue;\n\t\t},\n\t\tfindLastIndex: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tlet foundIndex = -1;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = predicate(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) foundIndex = index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) foundIndex = index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn foundIndex;\n\t\t},\n\t\tmin: async () => findExtremeBy(iteratorFactories, identity, \"min\"),\n\t\tminBy: async (selector) => findExtremeBy(iteratorFactories, selector, \"min\"),\n\t\tmax: async () => findExtremeBy(iteratorFactories, (value) => value, \"max\"),\n\t\tmaxBy: async (selector) => findExtremeBy(iteratorFactories, selector, \"max\"),\n\t\tgroupBy: async (selector) => {\n\t\t\tlet index = 0;\n\t\t\tconst groupedValues = /* @__PURE__ */ new Map();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tconst existingGroup = groupedValues.get(key);\n\t\t\t\tif (existingGroup) existingGroup.push(resolvedValue);\n\t\t\t\telse groupedValues.set(key, [resolvedValue]);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tconst existingGroup = groupedValues.get(key);\n\t\t\t\tif (existingGroup) existingGroup.push(value);\n\t\t\t\telse groupedValues.set(key, [value]);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn groupedValues;\n\t\t},\n\t\tcountBy: async (selector) => {\n\t\t\tlet index = 0;\n\t\t\tconst counts = /* @__PURE__ */ new Map();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tvar _counts$get;\n\t\t\t\tconst selectedKey = selector(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tcounts.set(key, ((_counts$get = counts.get(key)) !== null && _counts$get !== void 0 ? _counts$get : 0) + 1);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tvar _counts$get2;\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tcounts.set(key, ((_counts$get2 = counts.get(key)) !== null && _counts$get2 !== void 0 ? _counts$get2 : 0) + 1);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn counts;\n\t\t},\n\t\tjoin: async (separator) => {\n\t\t\tconst normalizedSeparator = separator !== null && separator !== void 0 ? separator : \",\";\n\t\t\tlet isFirst = true;\n\t\t\tlet result = \"\";\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!isFirst) result += normalizedSeparator;\n\t\t\t\tresult += resolvedValue == null ? \"\" : String(resolvedValue);\n\t\t\t\tisFirst = false;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tif (!isFirst) result += normalizedSeparator;\n\t\t\t\tresult += value == null ? \"\" : String(value);\n\t\t\t\tisFirst = false;\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\ttoArray: async () => materializeValues(iteratorFactories)\n\t};\n};\n/**\n* Creates a chainable async operator pipeline from an iterable of values or promise-like values\n* @param source - Source iterable to resolve\n* @returns A lazy async operator pipeline\n*/\nvar from = (source) => createAsyncOperator(createIteratorFactories(source));\n//#endregion\nexport { createAsyncLocal, createMutex as createAsyncLock, createMutex, createConditional, createConditional as createSignal, createDeferred, createDeferredGenerator, createManuallyConditional, createManuallyConditional as createManuallySignal, createReaderWriterLock, createSemaphore, defer, delay, from, getCurrentLogicalContextId, getLogicalContextValue, onAbort, runOnNewLogicalContext, setLogicalContextValue };\n\n//# sourceMappingURL=index.mjs.map","// gestament - TypeScript based test driver for GTK.\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/gestament\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { delay } from 'async-primitives';\n\nimport {\n createGtkInvalidArgumentError,\n createGtkOperationTimeoutError,\n} from './errors';\n\n/////////////////////////////////////////////////////////////////////////////////////////\n\n/** Options shared by GTK wait helpers. */\nexport interface GtkWaitOptions {\n /**\n * Maximum time to retry in milliseconds.\n *\n * @remarks Default is 10000.\n */\n readonly timeoutMs?: number | undefined;\n\n /**\n * Delay between retry attempts in milliseconds.\n *\n * @remarks Default is 50.\n */\n readonly intervalMs?: number | undefined;\n\n /**\n * Message included in the timeout error.\n */\n readonly message?: string | undefined;\n}\n\ninterface GtkWaitContext {\n readonly deadlineMs: number;\n}\n\nconst defaultTimeoutMs = 10_000;\nconst defaultIntervalMs = 50;\n\nconst waitContext = new AsyncLocalStorage<GtkWaitContext>();\n\nconst immediateFailureCodes = new Set([\n 'APP_EXITED',\n 'INVALID_ARGUMENT',\n 'NATIVE_LOAD_FAILED',\n 'UNSUPPORTED_INTERFACE',\n]);\n\nconst validateNonNegativeFiniteNumber = (name: string, value: number): void => {\n if (!Number.isFinite(value) || value < 0) {\n throw createGtkInvalidArgumentError(\n `${name} must be a non-negative finite number.`\n );\n }\n};\n\nconst validatePositiveFiniteNumber = (name: string, value: number): void => {\n if (!Number.isFinite(value) || value <= 0) {\n throw createGtkInvalidArgumentError(\n `${name} must be a positive finite number.`\n );\n }\n};\n\nconst errorCode = (error: unknown): string | undefined => {\n const code = (error as { code?: unknown }).code;\n return typeof code === 'string' ? code : undefined;\n};\n\nconst errorLabel = (error: unknown): string => {\n if (error instanceof Error) {\n const code = errorCode(error);\n return code === undefined\n ? `${error.name}: ${error.message}`\n : `${error.name} [${code}]: ${error.message}`;\n }\n return String(error);\n};\n\nconst waitTimeoutMessage = (\n timeoutMs: number,\n message: string | undefined,\n lastError: unknown\n): string => {\n const base = message ?? 'Timed out waiting for GTK condition.';\n const last =\n lastError === undefined ? '' : ` Last error: ${errorLabel(lastError)}`;\n return `${base} Timeout: ${timeoutMs}ms.${last}`;\n};\n\nconst retryableError = (error: unknown): boolean =>\n !immediateFailureCodes.has(errorCode(error) ?? '');\n\nconst resolveWaitDeadlineMs = (\n startedAtMs: number,\n timeoutMs: number\n): number => {\n const requestedDeadlineMs = startedAtMs + timeoutMs;\n const parentDeadlineMs = waitContext.getStore()?.deadlineMs;\n return parentDeadlineMs === undefined\n ? requestedDeadlineMs\n : Math.min(requestedDeadlineMs, parentDeadlineMs);\n};\n\n/**\n * Returns the current absolute wait deadline.\n *\n * @returns The current deadline in Date.now() milliseconds, or undefined outside wait helpers.\n */\nexport const currentWaitDeadlineMs = (): number | undefined =>\n waitContext.getStore()?.deadlineMs;\n\n/**\n * Limits a wait timeout to the current shared wait deadline.\n *\n * @param fallbackTimeoutMs Timeout to use outside a shared wait context.\n * @returns Effective timeout in milliseconds.\n */\nexport const effectiveWaitTimeoutMs = (fallbackTimeoutMs: number): number => {\n const deadlineMs = currentWaitDeadlineMs();\n if (deadlineMs === undefined) {\n return fallbackTimeoutMs;\n }\n return Math.min(fallbackTimeoutMs, Math.max(0, deadlineMs - Date.now()));\n};\n\n/**\n * Runs a callback inside an existing absolute GTK wait deadline.\n *\n * @param deadlineMs Absolute deadline in Date.now() milliseconds.\n * @param operation Operation to execute.\n * @returns The operation result.\n */\nexport const runWithWaitDeadline = async <Result>(\n deadlineMs: number,\n operation: () => Result | Promise<Result>\n): Promise<Result> => waitContext.run({ deadlineMs }, async () => operation());\n\n/**\n * Repeats a probe until it returns a result or the timeout expires.\n *\n * @param probe Operation to retry.\n * @param options Wait options.\n * @returns The first successful probe result.\n */\nexport const waitForResult = async <Result>(\n probe: () => Result | Promise<Result>,\n options?: GtkWaitOptions\n): Promise<Result> => {\n const timeoutMs = options?.timeoutMs ?? defaultTimeoutMs;\n const intervalMs = options?.intervalMs ?? defaultIntervalMs;\n validateNonNegativeFiniteNumber('timeoutMs', timeoutMs);\n validatePositiveFiniteNumber('intervalMs', intervalMs);\n\n const startedAtMs = Date.now();\n const deadlineMs = resolveWaitDeadlineMs(startedAtMs, timeoutMs);\n const effectiveTimeoutMs = Math.max(0, deadlineMs - startedAtMs);\n return waitContext.run({ deadlineMs }, async (): Promise<Result> => {\n let lastError: unknown;\n\n while (true) {\n try {\n return await probe();\n } catch (error) {\n if (!retryableError(error)) {\n throw error;\n }\n\n lastError = error;\n }\n\n const remainingMs = deadlineMs - Date.now();\n if (remainingMs <= 0) {\n throw createGtkOperationTimeoutError(\n waitTimeoutMessage(effectiveTimeoutMs, options?.message, lastError)\n );\n }\n\n await delay(Math.min(intervalMs, remainingMs));\n }\n });\n};\n\n/**\n * Repeats an assertion block until it succeeds or the timeout expires.\n *\n * @param probe Assertion block to retry.\n * @param options Wait options.\n * @returns Promise resolved when the assertion block passes.\n */\nexport const toPass = async (\n probe: () => void | Promise<void>,\n options?: GtkWaitOptions\n): Promise<void> => {\n await waitForResult(async () => {\n await probe();\n }, options);\n};\n"],"names":[],"mappings":";;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEG,IAAC,QAAQ,CAAC,MAAM,WAAW;AAatB,SAAO,IAAI,QAAQ,CAAC,YAAY;AACtC,eAAW,SAAS,IAAI;AAAA,EACzB,CAAC;AACF;AChDA,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAE1B,MAAM,cAAc,IAAI,kBAAA;AAExB,MAAM,4CAA4B,IAAI;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,kCAAkC,CAAC,MAAc,UAAwB;AAC7E,MAAI,CAAC,OAAO,SAAS,KAAK,KAAK,QAAQ,GAAG;AACxC,UAAM;AAAA,MACJ,GAAG,IAAI;AAAA,IAAA;AAAA,EAEX;AACF;AAEA,MAAM,+BAA+B,CAAC,MAAc,UAAwB;AAC1E,MAAI,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,GAAG;AACzC,UAAM;AAAA,MACJ,GAAG,IAAI;AAAA,IAAA;AAAA,EAEX;AACF;AAEA,MAAM,YAAY,CAAC,UAAuC;AACxD,QAAM,OAAQ,MAA6B;AAC3C,SAAO,OAAO,SAAS,WAAW,OAAO;AAC3C;AAEA,MAAM,aAAa,CAAC,UAA2B;AAC7C,MAAI,iBAAiB,OAAO;AAC1B,UAAM,OAAO,UAAU,KAAK;AAC5B,WAAO,SAAS,SACZ,GAAG,MAAM,IAAI,KAAK,MAAM,OAAO,KAC/B,GAAG,MAAM,IAAI,KAAK,IAAI,MAAM,MAAM,OAAO;AAAA,EAC/C;AACA,SAAO,OAAO,KAAK;AACrB;AAEA,MAAM,qBAAqB,CACzB,WACA,SACA,cACW;AACX,QAAM,OAAO,WAAW;AACxB,QAAM,OACJ,cAAc,SAAY,KAAK,gBAAgB,WAAW,SAAS,CAAC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AAA,QAAA;AAAA,MAEtE;AAEA,YAAM,MAAM,KAAK,IAAI,YAAY,WAAW,CAAC;AAAA,IAC/C;AAAA,EACF,CAAC;AACH;AASO,MAAM,SAAS,OACpB,OACA,YACkB;AAClB,QAAM,cAAc,YAAY;AAC9B,UAAM,MAAA;AAAA,EACR,GAAG,OAAO;AACZ;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const node_async_hooks = require("node:async_hooks");
|
|
3
|
+
const errors = require("./errors-6gj5YuLw.cjs");
|
|
4
|
+
/*!
|
|
5
|
+
* name: async-primitives
|
|
6
|
+
* version: 1.7.0
|
|
7
|
+
* description: A collection of primitive functions for asynchronous operations
|
|
8
|
+
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
9
|
+
* license: MIT
|
|
10
|
+
* repository.url: https://github.com/kekyo/async-primitives.git
|
|
11
|
+
* git.commit.hash: 9472fbd5310b92690d84aaafb897429a04c013c5
|
|
12
|
+
*/
|
|
13
|
+
var delay = (msec, signal) => {
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
|
+
setTimeout(resolve, msec);
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const defaultTimeoutMs = 1e4;
|
|
19
|
+
const defaultIntervalMs = 50;
|
|
20
|
+
const waitContext = new node_async_hooks.AsyncLocalStorage();
|
|
21
|
+
const immediateFailureCodes = /* @__PURE__ */ new Set([
|
|
22
|
+
"APP_EXITED",
|
|
23
|
+
"INVALID_ARGUMENT",
|
|
24
|
+
"NATIVE_LOAD_FAILED",
|
|
25
|
+
"UNSUPPORTED_INTERFACE"
|
|
26
|
+
]);
|
|
27
|
+
const validateNonNegativeFiniteNumber = (name, value) => {
|
|
28
|
+
if (!Number.isFinite(value) || value < 0) {
|
|
29
|
+
throw errors.createGtkInvalidArgumentError(
|
|
30
|
+
`${name} must be a non-negative finite number.`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const validatePositiveFiniteNumber = (name, value) => {
|
|
35
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
36
|
+
throw errors.createGtkInvalidArgumentError(
|
|
37
|
+
`${name} must be a positive finite number.`
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const errorCode = (error) => {
|
|
42
|
+
const code = error.code;
|
|
43
|
+
return typeof code === "string" ? code : void 0;
|
|
44
|
+
};
|
|
45
|
+
const errorLabel = (error) => {
|
|
46
|
+
if (error instanceof Error) {
|
|
47
|
+
const code = errorCode(error);
|
|
48
|
+
return code === void 0 ? `${error.name}: ${error.message}` : `${error.name} [${code}]: ${error.message}`;
|
|
49
|
+
}
|
|
50
|
+
return String(error);
|
|
51
|
+
};
|
|
52
|
+
const waitTimeoutMessage = (timeoutMs, message, lastError) => {
|
|
53
|
+
const base = message ?? "Timed out waiting for GTK condition.";
|
|
54
|
+
const last = lastError === void 0 ? "" : ` Last error: ${errorLabel(lastError)}`;
|
|
55
|
+
return `${base} Timeout: ${timeoutMs}ms.${last}`;
|
|
56
|
+
};
|
|
57
|
+
const retryableError = (error) => !immediateFailureCodes.has(errorCode(error) ?? "");
|
|
58
|
+
const resolveWaitDeadlineMs = (startedAtMs, timeoutMs) => {
|
|
59
|
+
const requestedDeadlineMs = startedAtMs + timeoutMs;
|
|
60
|
+
const parentDeadlineMs = waitContext.getStore()?.deadlineMs;
|
|
61
|
+
return parentDeadlineMs === void 0 ? requestedDeadlineMs : Math.min(requestedDeadlineMs, parentDeadlineMs);
|
|
62
|
+
};
|
|
63
|
+
const currentWaitDeadlineMs = () => waitContext.getStore()?.deadlineMs;
|
|
64
|
+
const effectiveWaitTimeoutMs = (fallbackTimeoutMs) => {
|
|
65
|
+
const deadlineMs = currentWaitDeadlineMs();
|
|
66
|
+
if (deadlineMs === void 0) {
|
|
67
|
+
return fallbackTimeoutMs;
|
|
68
|
+
}
|
|
69
|
+
return Math.min(fallbackTimeoutMs, Math.max(0, deadlineMs - Date.now()));
|
|
70
|
+
};
|
|
71
|
+
const runWithWaitDeadline = async (deadlineMs, operation) => waitContext.run({ deadlineMs }, async () => operation());
|
|
72
|
+
const waitForResult = async (probe, options) => {
|
|
73
|
+
const timeoutMs = options?.timeoutMs ?? defaultTimeoutMs;
|
|
74
|
+
const intervalMs = options?.intervalMs ?? defaultIntervalMs;
|
|
75
|
+
validateNonNegativeFiniteNumber("timeoutMs", timeoutMs);
|
|
76
|
+
validatePositiveFiniteNumber("intervalMs", intervalMs);
|
|
77
|
+
const startedAtMs = Date.now();
|
|
78
|
+
const deadlineMs = resolveWaitDeadlineMs(startedAtMs, timeoutMs);
|
|
79
|
+
const effectiveTimeoutMs = Math.max(0, deadlineMs - startedAtMs);
|
|
80
|
+
return waitContext.run({ deadlineMs }, async () => {
|
|
81
|
+
let lastError;
|
|
82
|
+
while (true) {
|
|
83
|
+
try {
|
|
84
|
+
return await probe();
|
|
85
|
+
} catch (error) {
|
|
86
|
+
if (!retryableError(error)) {
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
lastError = error;
|
|
90
|
+
}
|
|
91
|
+
const remainingMs = deadlineMs - Date.now();
|
|
92
|
+
if (remainingMs <= 0) {
|
|
93
|
+
throw errors.createGtkOperationTimeoutError(
|
|
94
|
+
waitTimeoutMessage(effectiveTimeoutMs, options?.message, lastError)
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
await delay(Math.min(intervalMs, remainingMs));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const toPass = async (probe, options) => {
|
|
102
|
+
await waitForResult(async () => {
|
|
103
|
+
await probe();
|
|
104
|
+
}, options);
|
|
105
|
+
};
|
|
106
|
+
exports.currentWaitDeadlineMs = currentWaitDeadlineMs;
|
|
107
|
+
exports.delay = delay;
|
|
108
|
+
exports.effectiveWaitTimeoutMs = effectiveWaitTimeoutMs;
|
|
109
|
+
exports.runWithWaitDeadline = runWithWaitDeadline;
|
|
110
|
+
exports.toPass = toPass;
|
|
111
|
+
exports.waitForResult = waitForResult;
|
|
112
|
+
//# sourceMappingURL=wait-eOIz4nZm.cjs.map
|