@viji-dev/core 0.8.10 → 0.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global-p5.d.ts +1 -1
- package/dist/artist-global.d.ts +1 -1
- package/dist/assets/{viji.worker-BPZz310Z.js → viji.worker-dW7fkaOy.js} +509 -427
- package/dist/docs-api.js +2 -2
- package/dist/{essentia-wasm.web-C4eP4VfK.js → essentia-wasm.web-BAkt7bza.js} +2 -2
- package/dist/{index-zNlv_Ytu.js → index-DYUAz0BO.js} +18 -8
- package/dist/index.d.ts +25 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ function as(t) {
|
|
|
13
13
|
}
|
|
14
14
|
throw new Error(`Invalid color input: expected string or object, got ${typeof t}`);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function xn(t) {
|
|
17
17
|
const e = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);
|
|
18
18
|
if (!e)
|
|
19
19
|
throw new Error(`Expected canonical hex '#rrggbb', got: ${t}`);
|
|
@@ -24,7 +24,7 @@ function Sn(t) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
function fi(t) {
|
|
27
|
-
const { r: e, g: n, b: r } =
|
|
27
|
+
const { r: e, g: n, b: r } = xn(t), i = e / 255, o = n / 255, c = r / 255, u = Math.max(i, o, c), h = Math.min(i, o, c), f = u - h;
|
|
28
28
|
let m = 0;
|
|
29
29
|
f > 0 && (u === i ? m = (o - c) / f % 6 : u === o ? m = (c - i) / f + 2 : m = (i - o) / f + 4, m *= 60, m < 0 && (m += 360));
|
|
30
30
|
const g = u === 0 ? 0 : f / u * 100, v = u * 100;
|
|
@@ -35,10 +35,10 @@ function fi(t) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
function kc(t) {
|
|
38
|
-
const { r: e, g: n, b: r } =
|
|
38
|
+
const { r: e, g: n, b: r } = xn(t);
|
|
39
39
|
return [e / 255, n / 255, r / 255];
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function un(t, e, n) {
|
|
42
42
|
const r = Hr(t, "r"), i = Hr(e, "g"), o = Hr(n, "b");
|
|
43
43
|
return "#" + Gr(r) + Gr(i) + Gr(o);
|
|
44
44
|
}
|
|
@@ -53,7 +53,7 @@ function co(t, e, n) {
|
|
|
53
53
|
let f = 0, m = 0, g = 0;
|
|
54
54
|
u < 1 ? (f = c, m = h, g = 0) : u < 2 ? (f = h, m = c, g = 0) : u < 3 ? (f = 0, m = c, g = h) : u < 4 ? (f = 0, m = h, g = c) : u < 5 ? (f = h, m = 0, g = c) : (f = c, m = 0, g = h);
|
|
55
55
|
const v = o - c;
|
|
56
|
-
return
|
|
56
|
+
return un(
|
|
57
57
|
Math.round((f + v) * 255),
|
|
58
58
|
Math.round((m + v) * 255),
|
|
59
59
|
Math.round((g + v) * 255)
|
|
@@ -95,7 +95,7 @@ function Ec(t) {
|
|
|
95
95
|
if (e.length !== 3)
|
|
96
96
|
throw new Error(`rgb() requires 3 arguments, got ${e.length}: rgb(${t})`);
|
|
97
97
|
const n = Ge(e[0], "r"), r = Ge(e[1], "g"), i = Ge(e[2], "b");
|
|
98
|
-
return
|
|
98
|
+
return un(n, r, i);
|
|
99
99
|
}
|
|
100
100
|
function Tc(t) {
|
|
101
101
|
const e = $n(t);
|
|
@@ -118,7 +118,7 @@ function xc(t) {
|
|
|
118
118
|
const n = Ge(e[0], "r"), r = Ge(e[1], "g"), i = Ge(e[2], "b");
|
|
119
119
|
if (n < 0 || n > 1 || r < 0 || r > 1 || i < 0 || i > 1)
|
|
120
120
|
throw new Error(`vec3() components must be in 0..1, got: vec3(${n}, ${r}, ${i})`);
|
|
121
|
-
return
|
|
121
|
+
return un(
|
|
122
122
|
Math.round(n * 255),
|
|
123
123
|
Math.round(r * 255),
|
|
124
124
|
Math.round(i * 255)
|
|
@@ -126,7 +126,7 @@ function xc(t) {
|
|
|
126
126
|
}
|
|
127
127
|
function Ac(t) {
|
|
128
128
|
const e = Mt(t.r, "r"), n = Mt(t.g, "g"), r = Mt(t.b, "b");
|
|
129
|
-
return
|
|
129
|
+
return un(e, n, r);
|
|
130
130
|
}
|
|
131
131
|
function Ic(t) {
|
|
132
132
|
const e = Mt(t.h, "h"), n = Mt(t.s, "s"), r = Mt(t.b, "b");
|
|
@@ -141,7 +141,7 @@ function Rc(t, e, n) {
|
|
|
141
141
|
let f = 0, m = 0, g = 0;
|
|
142
142
|
u < 1 ? (f = c, m = h, g = 0) : u < 2 ? (f = h, m = c, g = 0) : u < 3 ? (f = 0, m = c, g = h) : u < 4 ? (f = 0, m = h, g = c) : u < 5 ? (f = h, m = 0, g = c) : (f = c, m = 0, g = h);
|
|
143
143
|
const v = o - c / 2;
|
|
144
|
-
return
|
|
144
|
+
return un(
|
|
145
145
|
Math.round((f + v) * 255),
|
|
146
146
|
Math.round((m + v) * 255),
|
|
147
147
|
Math.round((g + v) * 255)
|
|
@@ -244,7 +244,7 @@ class Cc {
|
|
|
244
244
|
createColorParameter(e, n) {
|
|
245
245
|
const r = n.label, i = as(e), o = {
|
|
246
246
|
value: i,
|
|
247
|
-
rgb: Object.freeze(
|
|
247
|
+
rgb: Object.freeze(xn(i)),
|
|
248
248
|
hsb: Object.freeze(fi(i)),
|
|
249
249
|
label: n.label,
|
|
250
250
|
description: n.description ?? "",
|
|
@@ -423,7 +423,7 @@ class Cc {
|
|
|
423
423
|
const u = this.parameterObjects.get(e);
|
|
424
424
|
if (u && (u.value = n, r.type === "color")) {
|
|
425
425
|
const h = n;
|
|
426
|
-
u.rgb = Object.freeze(
|
|
426
|
+
u.rgb = Object.freeze(xn(h)), u.hsb = Object.freeze(fi(h));
|
|
427
427
|
}
|
|
428
428
|
return !0;
|
|
429
429
|
}
|
|
@@ -826,6 +826,39 @@ function log(...args) {\r
|
|
|
826
826
|
// Asset config received from CVSystem via init message\r
|
|
827
827
|
let assetConfig = { wasmUrls: null };\r
|
|
828
828
|
\r
|
|
829
|
+
// ---------------------------------------------------------------------------\r
|
|
830
|
+
// WASM binary fetch shim.\r
|
|
831
|
+
//\r
|
|
832
|
+
// MediaPipe's Emscripten loader fetch()-es its wasm binary from the URL passed\r
|
|
833
|
+
// as \`wasmBinaryPath\`. The engine runs at an opaque origin, and WebKit (iOS\r
|
|
834
|
+
// Safari) refuses \`fetch()\` of an opaque \`blob:null/…\` URL with an\r
|
|
835
|
+
// access-control error — which breaks all CV on iOS. (Only Fetch-API loads are\r
|
|
836
|
+
// refused; \`importScripts\` and \`new Worker\` of the same blob URLs are not, so\r
|
|
837
|
+
// the loader JS can still be a blob URL.)\r
|
|
838
|
+
//\r
|
|
839
|
+
// Fix: CVSystem hands MediaPipe sentinel URLs as \`wasmBinaryPath\` and ships the\r
|
|
840
|
+
// binary bytes alongside. We register url -> bytes here and serve them from\r
|
|
841
|
+
// memory, so no opaque blob fetch ever happens. Every binary-load path in the\r
|
|
842
|
+
// Emscripten loader (instantiateStreaming AND the readAsync arrayBuffer\r
|
|
843
|
+
// fallback) funnels through self.fetch, so this single override covers them\r
|
|
844
|
+
// all. Non-matching URLs (e.g. the model .tflite from the CDN) pass through\r
|
|
845
|
+
// untouched. Runs identically on Chromium — one code path, no per-browser\r
|
|
846
|
+
// branch.\r
|
|
847
|
+
const wasmBinaryBytes = new Map();\r
|
|
848
|
+
const nativeFetch = self.fetch.bind(self);\r
|
|
849
|
+
self.fetch = (input, init) => {\r
|
|
850
|
+
const url = typeof input === 'string' ? input : (input && input.url);\r
|
|
851
|
+
const bytes = url != null ? wasmBinaryBytes.get(url) : undefined;\r
|
|
852
|
+
if (bytes !== undefined) {\r
|
|
853
|
+
// Fresh Response per call: a body is single-use and the loader may retry\r
|
|
854
|
+
// (streaming compile -> arrayBuffer fallback).\r
|
|
855
|
+
return Promise.resolve(new Response(bytes, {\r
|
|
856
|
+
headers: { 'Content-Type': 'application/wasm' }\r
|
|
857
|
+
}));\r
|
|
858
|
+
}\r
|
|
859
|
+
return nativeFetch(input, init);\r
|
|
860
|
+
};\r
|
|
861
|
+
\r
|
|
829
862
|
// Define CommonJS environment for MediaPipe bundle\r
|
|
830
863
|
self.exports = {};\r
|
|
831
864
|
self.module = { exports: {} };\r
|
|
@@ -1128,6 +1161,10 @@ async function initializeVision() {\r
|
|
|
1128
1161
|
const wasmFileset = simd\r
|
|
1129
1162
|
? { wasmLoaderPath: assetConfig.wasmUrls.simdLoaderJs, wasmBinaryPath: assetConfig.wasmUrls.simdBinary }\r
|
|
1130
1163
|
: { wasmLoaderPath: assetConfig.wasmUrls.nosimdLoaderJs, wasmBinaryPath: assetConfig.wasmUrls.nosimdBinary };\r
|
|
1164
|
+
\r
|
|
1165
|
+
// Free the unused variant's bytes; only the selected one may be re-fetched\r
|
|
1166
|
+
// as additional MediaPipe task graphs are created over the session.\r
|
|
1167
|
+
wasmBinaryBytes.delete(simd ? assetConfig.wasmUrls.nosimdBinary : assetConfig.wasmUrls.simdBinary);\r
|
|
1131
1168
|
\r
|
|
1132
1169
|
log('Using WASM fileset:', wasmFileset);\r
|
|
1133
1170
|
\r
|
|
@@ -1707,10 +1744,16 @@ self.onmessage = async (event) => {\r
|
|
|
1707
1744
|
\r
|
|
1708
1745
|
const visionCode = message.visionBundleCode;\r
|
|
1709
1746
|
assetConfig.wasmUrls = message.wasmUrls || null;\r
|
|
1747
|
+
const wasmBinaries = message.wasmBinaries || null;\r
|
|
1710
1748
|
\r
|
|
1711
|
-
if (!visionCode || !assetConfig.wasmUrls) {\r
|
|
1712
|
-
throw new Error('init message must include visionBundleCode and
|
|
1749
|
+
if (!visionCode || !assetConfig.wasmUrls || !wasmBinaries) {\r
|
|
1750
|
+
throw new Error('init message must include visionBundleCode, wasmUrls and wasmBinaries');\r
|
|
1713
1751
|
}\r
|
|
1752
|
+
\r
|
|
1753
|
+
// Register the binary bytes against the sentinel URLs we hand MediaPipe\r
|
|
1754
|
+
// as wasmBinaryPath; the fetch shim serves them from memory.\r
|
|
1755
|
+
wasmBinaryBytes.set(assetConfig.wasmUrls.simdBinary, wasmBinaries.simdBinary);\r
|
|
1756
|
+
wasmBinaryBytes.set(assetConfig.wasmUrls.nosimdBinary, wasmBinaries.nosimdBinary);\r
|
|
1714
1757
|
\r
|
|
1715
1758
|
log('WASM URLs received:', Object.keys(assetConfig.wasmUrls));\r
|
|
1716
1759
|
\r
|
|
@@ -1914,9 +1957,13 @@ class Dc {
|
|
|
1914
1957
|
actualCVFPS = 0;
|
|
1915
1958
|
debugMode = !1;
|
|
1916
1959
|
// Debug mode disabled for production
|
|
1917
|
-
// WASM URLs resolved on the main thread (where the consumer's bundler
|
|
1918
|
-
// and passed down via the message chain.
|
|
1960
|
+
// WASM loader URLs resolved on the main thread (where the consumer's bundler
|
|
1961
|
+
// operates) and passed down via the message chain. Binary entries are
|
|
1962
|
+
// sentinel URLs served from `cvWasmBinaries` by the cv-tasks fetch shim.
|
|
1919
1963
|
cvWasmUrls = null;
|
|
1964
|
+
// MediaPipe binary bytes, shipped to the cv-tasks worker (structured-cloned)
|
|
1965
|
+
// at init so its fetch shim can serve them in place of an opaque blob fetch.
|
|
1966
|
+
cvWasmBinaries = null;
|
|
1920
1967
|
// Monotonic correlation id for postToCV. Each request gets a unique id; the
|
|
1921
1968
|
// worker echoes it on its result message so the host can match responses to
|
|
1922
1969
|
// requests under burst (replaces the prior anonymous-listener bridge that
|
|
@@ -1941,11 +1988,11 @@ class Dc {
|
|
|
1941
1988
|
this.debugMode && console.log("🔧 [CVSystem]", ...e);
|
|
1942
1989
|
}
|
|
1943
1990
|
/**
|
|
1944
|
-
* Receive WASM
|
|
1991
|
+
* Receive WASM loader URLs and binary bytes resolved by the main thread.
|
|
1945
1992
|
* Must be called before any CV feature is enabled.
|
|
1946
1993
|
*/
|
|
1947
|
-
|
|
1948
|
-
this.cvWasmUrls = e, this.debugLog("WASM
|
|
1994
|
+
setCVWasmAssets(e, n) {
|
|
1995
|
+
this.cvWasmUrls = e, this.cvWasmBinaries = n, this.debugLog("WASM assets received from main thread");
|
|
1949
1996
|
}
|
|
1950
1997
|
setDebugMode(e) {
|
|
1951
1998
|
this.debugMode = e, this.debugLog(`Debug mode ${e ? "enabled" : "disabled"}`), this.cvWorker && this.cvWorker.postMessage({ type: "debug", enabled: e });
|
|
@@ -1971,13 +2018,14 @@ class Dc {
|
|
|
1971
2018
|
* core build time (via ?raw imports), so no external file fetch is needed
|
|
1972
2019
|
* for them. The worker is created from a Blob URL.
|
|
1973
2020
|
*
|
|
1974
|
-
* WASM
|
|
1975
|
-
* bundler can discover them) and passed here via
|
|
2021
|
+
* WASM loader URLs and binary bytes are resolved on the main thread (where
|
|
2022
|
+
* the consumer's bundler can discover them) and passed here via
|
|
2023
|
+
* setCVWasmAssets().
|
|
1976
2024
|
*/
|
|
1977
2025
|
async ensureCVWorker() {
|
|
1978
2026
|
if (!this.cvWorker) {
|
|
1979
|
-
if (!this.cvWasmUrls)
|
|
1980
|
-
throw new Error("CV WASM
|
|
2027
|
+
if (!this.cvWasmUrls || !this.cvWasmBinaries)
|
|
2028
|
+
throw new Error("CV WASM assets not set — setCVWasmAssets() must be called before enabling CV features");
|
|
1981
2029
|
try {
|
|
1982
2030
|
this.debugLog("🔧 Creating MediaPipe Tasks Vision worker...");
|
|
1983
2031
|
const e = new Blob([Fc], { type: "application/javascript" }), n = URL.createObjectURL(e);
|
|
@@ -1996,7 +2044,8 @@ class Dc {
|
|
|
1996
2044
|
this.debugLog("❌ CV worker message error", r), this.handleWorkerFailure("Worker message error");
|
|
1997
2045
|
}, this.cvWorker.postMessage({ type: "debug", enabled: this.debugMode }), this.debugLog("Sending init with inlined vision bundle and WASM URLs"), await this.postToCV("init", {
|
|
1998
2046
|
visionBundleCode: Pc,
|
|
1999
|
-
wasmUrls: this.cvWasmUrls
|
|
2047
|
+
wasmUrls: this.cvWasmUrls,
|
|
2048
|
+
wasmBinaries: this.cvWasmBinaries
|
|
2000
2049
|
}), this.debugLog("✅ CV worker initialized");
|
|
2001
2050
|
} catch (e) {
|
|
2002
2051
|
throw this.debugLog("❌ Failed to initialize CV worker:", e), e;
|
|
@@ -2574,7 +2623,7 @@ class Dc {
|
|
|
2574
2623
|
this.cvWorker && (this.cvWorker.terminate(), this.cvWorker = null), this.activeFeatures.clear(), this.faceMeshRequestedBy.clear(), this.workerRestartCount = 0, this.clearResults(), this.processing = !1, this.processingTimes = [], this.analysedCanvas = null, this.analysedCtx = null, this.pendingRequestIds.clear(), this.debugLog("✅ CVSystem cleanup complete");
|
|
2575
2624
|
}
|
|
2576
2625
|
}
|
|
2577
|
-
class
|
|
2626
|
+
class gn {
|
|
2578
2627
|
// ✅ CORRECT: Worker-owned OffscreenCanvas (transferred from host)
|
|
2579
2628
|
offscreenCanvas = null;
|
|
2580
2629
|
ctx = null;
|
|
@@ -2657,10 +2706,10 @@ class pn {
|
|
|
2657
2706
|
return this.cvSurface;
|
|
2658
2707
|
}
|
|
2659
2708
|
/**
|
|
2660
|
-
* Pass WASM URLs
|
|
2709
|
+
* Pass WASM loader URLs and binary bytes down to CVSystem.
|
|
2661
2710
|
*/
|
|
2662
|
-
|
|
2663
|
-
this.cvSystem.
|
|
2711
|
+
setCVWasmAssets(e, n) {
|
|
2712
|
+
this.cvSystem.setCVWasmAssets(e, n);
|
|
2664
2713
|
}
|
|
2665
2714
|
/**
|
|
2666
2715
|
* Set stream type and optional device ID
|
|
@@ -3375,7 +3424,7 @@ const cs = [
|
|
|
3375
3424
|
"poseDetection",
|
|
3376
3425
|
"bodySegmentation"
|
|
3377
3426
|
];
|
|
3378
|
-
class
|
|
3427
|
+
class yi {
|
|
3379
3428
|
/**
|
|
3380
3429
|
* Parse all parameter declarations from shader code
|
|
3381
3430
|
*/
|
|
@@ -3674,7 +3723,7 @@ class De {
|
|
|
3674
3723
|
*/
|
|
3675
3724
|
async init() {
|
|
3676
3725
|
try {
|
|
3677
|
-
this.parameters =
|
|
3726
|
+
this.parameters = yi.parseParameters(this.shaderCode);
|
|
3678
3727
|
for (const r of this.parameters)
|
|
3679
3728
|
r.type === "accumulator" && this.accumulatorValues.set(r.uniformName, r.config.default ?? 0);
|
|
3680
3729
|
for (const r of this.parameters) {
|
|
@@ -3744,7 +3793,7 @@ class De {
|
|
|
3744
3793
|
break;
|
|
3745
3794
|
}
|
|
3746
3795
|
}
|
|
3747
|
-
const o = this.findInjectionPoint(r), c = this.getBuiltInUniforms(), u = this.parameters.map((w) =>
|
|
3796
|
+
const o = this.findInjectionPoint(r), c = this.getBuiltInUniforms(), u = this.parameters.map((w) => yi.generateUniformDeclaration(w)).join(`
|
|
3748
3797
|
`), h = e.includes("fwidth");
|
|
3749
3798
|
h && this.glslVersion === "glsl100" && (this.gl.getExtension("OES_standard_derivatives") || console.warn("Shader uses fwidth() but OES_standard_derivatives extension is not supported. Shader may not compile."));
|
|
3750
3799
|
const f = [];
|
|
@@ -4380,136 +4429,136 @@ ${c}`);
|
|
|
4380
4429
|
*/
|
|
4381
4430
|
updateBuiltInUniforms(e) {
|
|
4382
4431
|
this.setUniform("u_resolution", "vec2", [e.width, e.height]), this.setUniform("u_time", "float", e.time), this.setUniform("u_deltaTime", "float", e.deltaTime), this.setUniform("u_frame", "int", e.frameCount), this.setUniform("u_fps", "float", e.fps), this.setUniform("u_mouse", "vec2", [e.mouse.x, e.height - e.mouse.y]), this.setUniform("u_mouseInCanvas", "bool", e.mouse.isInCanvas), this.setUniform("u_mousePressed", "bool", e.mouse.isPressed), this.setUniform("u_mouseLeft", "bool", e.mouse.leftButton), this.setUniform("u_mouseRight", "bool", e.mouse.rightButton), this.setUniform("u_mouseMiddle", "bool", e.mouse.middleButton), this.setUniform("u_mouseDelta", "vec2", [e.mouse.deltaX, -e.mouse.deltaY]), this.setUniform("u_mouseWheel", "float", e.mouse.wheelDelta), this.setUniform("u_mouseWasPressed", "bool", e.mouse.wasPressed), this.setUniform("u_mouseWasReleased", "bool", e.mouse.wasReleased), this.setUniform("u_keySpace", "bool", e.keyboard.isPressed(" ") || e.keyboard.isPressed("space")), this.setUniform("u_keyShift", "bool", e.keyboard.shift), this.setUniform("u_keyCtrl", "bool", e.keyboard.ctrl), this.setUniform("u_keyAlt", "bool", e.keyboard.alt), this.setUniform("u_keyW", "bool", e.keyboard.isPressed("w") || e.keyboard.isPressed("W")), this.setUniform("u_keyA", "bool", e.keyboard.isPressed("a") || e.keyboard.isPressed("A")), this.setUniform("u_keyS", "bool", e.keyboard.isPressed("s") || e.keyboard.isPressed("S")), this.setUniform("u_keyD", "bool", e.keyboard.isPressed("d") || e.keyboard.isPressed("D")), this.setUniform("u_keyUp", "bool", e.keyboard.isPressed("ArrowUp")), this.setUniform("u_keyDown", "bool", e.keyboard.isPressed("ArrowDown")), this.setUniform("u_keyLeft", "bool", e.keyboard.isPressed("ArrowLeft")), this.setUniform("u_keyRight", "bool", e.keyboard.isPressed("ArrowRight")), e.keyboard.textureData && this.updateKeyboardTexture(e.keyboard.textureData), this.setUniform("u_touchCount", "int", e.touches.count);
|
|
4383
|
-
for (let
|
|
4384
|
-
const
|
|
4385
|
-
|
|
4432
|
+
for (let b = 0; b < 5; b++) {
|
|
4433
|
+
const y = e.touches.points[b];
|
|
4434
|
+
y ? this.setUniform(`u_touch${b}`, "vec2", [y.x, e.height - y.y]) : this.setUniform(`u_touch${b}`, "vec2", [0, 0]);
|
|
4386
4435
|
}
|
|
4387
4436
|
this.setUniform("u_pointer", "vec2", [e.pointer.x, e.height - e.pointer.y]), this.setUniform("u_pointerDelta", "vec2", [e.pointer.deltaX, -e.pointer.deltaY]), this.setUniform("u_pointerDown", "bool", e.pointer.isDown), this.setUniform("u_pointerWasPressed", "bool", e.pointer.wasPressed), this.setUniform("u_pointerWasReleased", "bool", e.pointer.wasReleased), this.setUniform("u_pointerInCanvas", "bool", e.pointer.isInCanvas);
|
|
4388
4437
|
const n = e.audio;
|
|
4389
4438
|
if (this.setUniform("u_audioVolume", "float", n.volume?.current || 0), this.setUniform("u_audioPeak", "float", n.volume?.peak || 0), this.setUniform("u_audioVolumeSmoothed", "float", n.volume?.smoothed || 0), this.setUniform("u_audioLow", "float", n.bands?.low || 0), this.setUniform("u_audioLowMid", "float", n.bands?.lowMid || 0), this.setUniform("u_audioMid", "float", n.bands?.mid || 0), this.setUniform("u_audioHighMid", "float", n.bands?.highMid || 0), this.setUniform("u_audioHigh", "float", n.bands?.high || 0), this.setUniform("u_audioLowSmoothed", "float", n.bands?.lowSmoothed || 0), this.setUniform("u_audioLowMidSmoothed", "float", n.bands?.lowMidSmoothed || 0), this.setUniform("u_audioMidSmoothed", "float", n.bands?.midSmoothed || 0), this.setUniform("u_audioHighMidSmoothed", "float", n.bands?.highMidSmoothed || 0), this.setUniform("u_audioHighSmoothed", "float", n.bands?.highSmoothed || 0), this.setUniform("u_audioKick", "float", n.beat?.kick || 0), this.setUniform("u_audioSnare", "float", n.beat?.snare || 0), this.setUniform("u_audioHat", "float", n.beat?.hat || 0), this.setUniform("u_audioAny", "float", n.beat?.any || 0), this.setUniform("u_audioKickSmoothed", "float", n.beat?.kickSmoothed || 0), this.setUniform("u_audioSnareSmoothed", "float", n.beat?.snareSmoothed || 0), this.setUniform("u_audioHatSmoothed", "float", n.beat?.hatSmoothed || 0), this.setUniform("u_audioAnySmoothed", "float", n.beat?.anySmoothed || 0), this.setUniform("u_audioKickTrigger", "bool", n.beat?.triggers?.kick || !1), this.setUniform("u_audioSnareTrigger", "bool", n.beat?.triggers?.snare || !1), this.setUniform("u_audioHatTrigger", "bool", n.beat?.triggers?.hat || !1), this.setUniform("u_audioAnyTrigger", "bool", n.beat?.triggers?.any || !1), this.setUniform("u_audioBPM", "float", n.beat?.bpm || 120), this.setUniform("u_audioConfidence", "float", n.beat?.confidence || 0), this.setUniform("u_audioIsLocked", "bool", n.beat?.isLocked || !1), this.setUniform("u_audioBrightness", "float", n.spectral?.brightness || 0), this.setUniform("u_audioFlatness", "float", n.spectral?.flatness || 0), n.isConnected) {
|
|
4390
4439
|
this.updateAudioFFTTexture(n.getFrequencyData());
|
|
4391
|
-
const
|
|
4392
|
-
|
|
4440
|
+
const b = n.getWaveform();
|
|
4441
|
+
b.length > 0 && this.updateAudioWaveformTexture(b);
|
|
4393
4442
|
}
|
|
4394
4443
|
const r = e.video;
|
|
4395
4444
|
r.isConnected && r.currentFrame ? (this.updateVideoTexture(r.currentFrame), this.setUniform("u_videoResolution", "vec2", [r.frameWidth, r.frameHeight]), this.setUniform("u_videoFrameRate", "float", r.frameRate)) : (this.setUniform("u_videoResolution", "vec2", [0, 0]), this.setUniform("u_videoFrameRate", "float", 0)), r.cv?.analysedFrame instanceof OffscreenCanvas ? (this.updateAnalysedFrameTexture(r.cv.analysedFrame), this.setUniform("u_videoAnalysedAvailable", "bool", !0)) : (this.bindAnalysedFrameFallback(), this.setUniform("u_videoAnalysedAvailable", "bool", !1));
|
|
4396
4445
|
const i = e.videoStreams || [], o = Math.min(i.length, De.MAX_VIDEO_STREAMS);
|
|
4397
4446
|
this.setUniform("u_videoStreamCount", "int", o);
|
|
4398
|
-
for (let
|
|
4399
|
-
const
|
|
4400
|
-
|
|
4447
|
+
for (let b = 0; b < De.MAX_VIDEO_STREAMS; b++) {
|
|
4448
|
+
const y = `u_videoStream${b}Connected`, E = `u_videoStream${b}Resolution`;
|
|
4449
|
+
b < o && i[b]?.isConnected && i[b]?.currentFrame ? (this.updateVideoStreamTexture(b, i[b].currentFrame), this.setUniform(
|
|
4401
4450
|
E,
|
|
4402
4451
|
"vec2",
|
|
4403
|
-
[i[
|
|
4404
|
-
), this.setUniform(
|
|
4452
|
+
[i[b].frameWidth, i[b].frameHeight]
|
|
4453
|
+
), this.setUniform(y, "bool", !0)) : (this.setUniform(E, "vec2", [0, 0]), this.setUniform(y, "bool", !1));
|
|
4405
4454
|
}
|
|
4406
4455
|
const c = e.devices || [], u = Math.min(c.length, De.MAX_DEVICE_VIDEOS);
|
|
4407
4456
|
this.setUniform("u_deviceCount", "int", u);
|
|
4408
|
-
for (let
|
|
4409
|
-
const
|
|
4410
|
-
|
|
4457
|
+
for (let b = 0; b < De.MAX_DEVICE_VIDEOS; b++) {
|
|
4458
|
+
const y = `u_device${b}Connected`, E = `u_device${b}Resolution`;
|
|
4459
|
+
b < u && c[b]?.video?.isConnected && c[b].video.currentFrame ? (this.updateDeviceTexture(b, c[b].video.currentFrame), this.setUniform(
|
|
4411
4460
|
E,
|
|
4412
4461
|
"vec2",
|
|
4413
|
-
[c[
|
|
4414
|
-
), this.setUniform(
|
|
4462
|
+
[c[b].video.frameWidth, c[b].video.frameHeight]
|
|
4463
|
+
), this.setUniform(y, "bool", !0)) : (this.setUniform(E, "vec2", [0, 0]), this.setUniform(y, "bool", !1));
|
|
4415
4464
|
}
|
|
4416
4465
|
const h = e.audioStreams || [], f = Math.min(h.length, De.MAX_AUDIO_STREAMS);
|
|
4417
4466
|
this.setUniform("u_audioStreamCount", "int", f);
|
|
4418
|
-
for (let
|
|
4419
|
-
const
|
|
4420
|
-
if (
|
|
4421
|
-
const E = h[
|
|
4422
|
-
this.setUniform(`${
|
|
4467
|
+
for (let b = 0; b < De.MAX_AUDIO_STREAMS; b++) {
|
|
4468
|
+
const y = `u_audioStream${b}`;
|
|
4469
|
+
if (b < f && h[b]?.isConnected) {
|
|
4470
|
+
const E = h[b];
|
|
4471
|
+
this.setUniform(`${y}Connected`, "bool", !0), this.setUniform(`${y}Volume`, "float", E.volume?.current || 0), this.setUniform(`${y}Low`, "float", E.bands?.low || 0), this.setUniform(`${y}LowMid`, "float", E.bands?.lowMid || 0), this.setUniform(`${y}Mid`, "float", E.bands?.mid || 0), this.setUniform(`${y}HighMid`, "float", E.bands?.highMid || 0), this.setUniform(`${y}High`, "float", E.bands?.high || 0), this.setUniform(`${y}Brightness`, "float", E.spectral?.brightness || 0), this.setUniform(`${y}Flatness`, "float", E.spectral?.flatness || 0);
|
|
4423
4472
|
} else
|
|
4424
|
-
this.setUniform(`${
|
|
4473
|
+
this.setUniform(`${y}Connected`, "bool", !1), this.setUniform(`${y}Volume`, "float", 0), this.setUniform(`${y}Low`, "float", 0), this.setUniform(`${y}LowMid`, "float", 0), this.setUniform(`${y}Mid`, "float", 0), this.setUniform(`${y}HighMid`, "float", 0), this.setUniform(`${y}High`, "float", 0), this.setUniform(`${y}Brightness`, "float", 0), this.setUniform(`${y}Flatness`, "float", 0);
|
|
4425
4474
|
}
|
|
4426
4475
|
const m = r.cv?.faces || [], g = m[0], v = this.visibleFeatures.has("faceDetection") && !!g, w = this.visibleFeatures.has("faceMesh") && !!g, D = this.visibleFeatures.has("emotionDetection") && !!g;
|
|
4427
4476
|
if (this.setUniform("u_faceCount", "int", this.visibleFeatures.has("faceDetection") ? m.length : 0), v) {
|
|
4428
|
-
const
|
|
4429
|
-
this.setUniform("u_face0Bounds", "vec4", [
|
|
4477
|
+
const b = g.bounds, y = g.center?.x || 0, E = g.center?.y || 0;
|
|
4478
|
+
this.setUniform("u_face0Bounds", "vec4", [b?.x || 0, 1 - (b?.y || 0) - (b?.height || 0), b?.width || 0, b?.height || 0]), this.setUniform("u_face0Center", "vec2", [y, 1 - E]), this.setUniform("u_face0Confidence", "float", g.confidence || 0);
|
|
4430
4479
|
} else
|
|
4431
4480
|
this.setUniform("u_face0Bounds", "vec4", [0, 0, 0, 0]), this.setUniform("u_face0Center", "vec2", [0, 0]), this.setUniform("u_face0Confidence", "float", 0);
|
|
4432
4481
|
if (w) {
|
|
4433
|
-
const
|
|
4434
|
-
this.setUniform("u_face0HeadPose", "vec3", [
|
|
4482
|
+
const b = g.headPose || {};
|
|
4483
|
+
this.setUniform("u_face0HeadPose", "vec3", [b.pitch || 0, b.yaw || 0, -(b.roll || 0)]);
|
|
4435
4484
|
} else
|
|
4436
4485
|
this.setUniform("u_face0HeadPose", "vec3", [0, 0, 0]);
|
|
4437
4486
|
if (D) {
|
|
4438
|
-
const
|
|
4439
|
-
this.setUniform("u_face0Neutral", "float",
|
|
4487
|
+
const b = g.expressions || {}, y = g.blendshapes || {};
|
|
4488
|
+
this.setUniform("u_face0Neutral", "float", b.neutral || 0), this.setUniform("u_face0Happy", "float", b.happy || 0), this.setUniform("u_face0Sad", "float", b.sad || 0), this.setUniform("u_face0Angry", "float", b.angry || 0), this.setUniform("u_face0Surprised", "float", b.surprised || 0), this.setUniform("u_face0Disgusted", "float", b.disgusted || 0), this.setUniform("u_face0Fearful", "float", b.fearful || 0), this.setUniform("u_face0BrowDownLeft", "float", y.browDownLeft || 0), this.setUniform("u_face0BrowDownRight", "float", y.browDownRight || 0), this.setUniform("u_face0BrowInnerUp", "float", y.browInnerUp || 0), this.setUniform("u_face0BrowOuterUpLeft", "float", y.browOuterUpLeft || 0), this.setUniform("u_face0BrowOuterUpRight", "float", y.browOuterUpRight || 0), this.setUniform("u_face0CheekPuff", "float", y.cheekPuff || 0), this.setUniform("u_face0CheekSquintLeft", "float", y.cheekSquintLeft || 0), this.setUniform("u_face0CheekSquintRight", "float", y.cheekSquintRight || 0), this.setUniform("u_face0EyeBlinkLeft", "float", y.eyeBlinkLeft || 0), this.setUniform("u_face0EyeBlinkRight", "float", y.eyeBlinkRight || 0), this.setUniform("u_face0EyeLookDownLeft", "float", y.eyeLookDownLeft || 0), this.setUniform("u_face0EyeLookDownRight", "float", y.eyeLookDownRight || 0), this.setUniform("u_face0EyeLookInLeft", "float", y.eyeLookInLeft || 0), this.setUniform("u_face0EyeLookInRight", "float", y.eyeLookInRight || 0), this.setUniform("u_face0EyeLookOutLeft", "float", y.eyeLookOutLeft || 0), this.setUniform("u_face0EyeLookOutRight", "float", y.eyeLookOutRight || 0), this.setUniform("u_face0EyeLookUpLeft", "float", y.eyeLookUpLeft || 0), this.setUniform("u_face0EyeLookUpRight", "float", y.eyeLookUpRight || 0), this.setUniform("u_face0EyeSquintLeft", "float", y.eyeSquintLeft || 0), this.setUniform("u_face0EyeSquintRight", "float", y.eyeSquintRight || 0), this.setUniform("u_face0EyeWideLeft", "float", y.eyeWideLeft || 0), this.setUniform("u_face0EyeWideRight", "float", y.eyeWideRight || 0), this.setUniform("u_face0JawForward", "float", y.jawForward || 0), this.setUniform("u_face0JawLeft", "float", y.jawLeft || 0), this.setUniform("u_face0JawOpen", "float", y.jawOpen || 0), this.setUniform("u_face0JawRight", "float", y.jawRight || 0), this.setUniform("u_face0MouthClose", "float", y.mouthClose || 0), this.setUniform("u_face0MouthDimpleLeft", "float", y.mouthDimpleLeft || 0), this.setUniform("u_face0MouthDimpleRight", "float", y.mouthDimpleRight || 0), this.setUniform("u_face0MouthFrownLeft", "float", y.mouthFrownLeft || 0), this.setUniform("u_face0MouthFrownRight", "float", y.mouthFrownRight || 0), this.setUniform("u_face0MouthFunnel", "float", y.mouthFunnel || 0), this.setUniform("u_face0MouthLeft", "float", y.mouthLeft || 0), this.setUniform("u_face0MouthLowerDownLeft", "float", y.mouthLowerDownLeft || 0), this.setUniform("u_face0MouthLowerDownRight", "float", y.mouthLowerDownRight || 0), this.setUniform("u_face0MouthPressLeft", "float", y.mouthPressLeft || 0), this.setUniform("u_face0MouthPressRight", "float", y.mouthPressRight || 0), this.setUniform("u_face0MouthPucker", "float", y.mouthPucker || 0), this.setUniform("u_face0MouthRight", "float", y.mouthRight || 0), this.setUniform("u_face0MouthRollLower", "float", y.mouthRollLower || 0), this.setUniform("u_face0MouthRollUpper", "float", y.mouthRollUpper || 0), this.setUniform("u_face0MouthShrugLower", "float", y.mouthShrugLower || 0), this.setUniform("u_face0MouthShrugUpper", "float", y.mouthShrugUpper || 0), this.setUniform("u_face0MouthSmileLeft", "float", y.mouthSmileLeft || 0), this.setUniform("u_face0MouthSmileRight", "float", y.mouthSmileRight || 0), this.setUniform("u_face0MouthStretchLeft", "float", y.mouthStretchLeft || 0), this.setUniform("u_face0MouthStretchRight", "float", y.mouthStretchRight || 0), this.setUniform("u_face0MouthUpperUpLeft", "float", y.mouthUpperUpLeft || 0), this.setUniform("u_face0MouthUpperUpRight", "float", y.mouthUpperUpRight || 0), this.setUniform("u_face0NoseSneerLeft", "float", y.noseSneerLeft || 0), this.setUniform("u_face0NoseSneerRight", "float", y.noseSneerRight || 0), this.setUniform("u_face0TongueOut", "float", y.tongueOut || 0);
|
|
4440
4489
|
} else
|
|
4441
4490
|
this.setUniform("u_face0Neutral", "float", 0), this.setUniform("u_face0Happy", "float", 0), this.setUniform("u_face0Sad", "float", 0), this.setUniform("u_face0Angry", "float", 0), this.setUniform("u_face0Surprised", "float", 0), this.setUniform("u_face0Disgusted", "float", 0), this.setUniform("u_face0Fearful", "float", 0), this.setUniform("u_face0BrowDownLeft", "float", 0), this.setUniform("u_face0BrowDownRight", "float", 0), this.setUniform("u_face0BrowInnerUp", "float", 0), this.setUniform("u_face0BrowOuterUpLeft", "float", 0), this.setUniform("u_face0BrowOuterUpRight", "float", 0), this.setUniform("u_face0CheekPuff", "float", 0), this.setUniform("u_face0CheekSquintLeft", "float", 0), this.setUniform("u_face0CheekSquintRight", "float", 0), this.setUniform("u_face0EyeBlinkLeft", "float", 0), this.setUniform("u_face0EyeBlinkRight", "float", 0), this.setUniform("u_face0EyeLookDownLeft", "float", 0), this.setUniform("u_face0EyeLookDownRight", "float", 0), this.setUniform("u_face0EyeLookInLeft", "float", 0), this.setUniform("u_face0EyeLookInRight", "float", 0), this.setUniform("u_face0EyeLookOutLeft", "float", 0), this.setUniform("u_face0EyeLookOutRight", "float", 0), this.setUniform("u_face0EyeLookUpLeft", "float", 0), this.setUniform("u_face0EyeLookUpRight", "float", 0), this.setUniform("u_face0EyeSquintLeft", "float", 0), this.setUniform("u_face0EyeSquintRight", "float", 0), this.setUniform("u_face0EyeWideLeft", "float", 0), this.setUniform("u_face0EyeWideRight", "float", 0), this.setUniform("u_face0JawForward", "float", 0), this.setUniform("u_face0JawLeft", "float", 0), this.setUniform("u_face0JawOpen", "float", 0), this.setUniform("u_face0JawRight", "float", 0), this.setUniform("u_face0MouthClose", "float", 0), this.setUniform("u_face0MouthDimpleLeft", "float", 0), this.setUniform("u_face0MouthDimpleRight", "float", 0), this.setUniform("u_face0MouthFrownLeft", "float", 0), this.setUniform("u_face0MouthFrownRight", "float", 0), this.setUniform("u_face0MouthFunnel", "float", 0), this.setUniform("u_face0MouthLeft", "float", 0), this.setUniform("u_face0MouthLowerDownLeft", "float", 0), this.setUniform("u_face0MouthLowerDownRight", "float", 0), this.setUniform("u_face0MouthPressLeft", "float", 0), this.setUniform("u_face0MouthPressRight", "float", 0), this.setUniform("u_face0MouthPucker", "float", 0), this.setUniform("u_face0MouthRight", "float", 0), this.setUniform("u_face0MouthRollLower", "float", 0), this.setUniform("u_face0MouthRollUpper", "float", 0), this.setUniform("u_face0MouthShrugLower", "float", 0), this.setUniform("u_face0MouthShrugUpper", "float", 0), this.setUniform("u_face0MouthSmileLeft", "float", 0), this.setUniform("u_face0MouthSmileRight", "float", 0), this.setUniform("u_face0MouthStretchLeft", "float", 0), this.setUniform("u_face0MouthStretchRight", "float", 0), this.setUniform("u_face0MouthUpperUpLeft", "float", 0), this.setUniform("u_face0MouthUpperUpRight", "float", 0), this.setUniform("u_face0NoseSneerLeft", "float", 0), this.setUniform("u_face0NoseSneerRight", "float", 0), this.setUniform("u_face0TongueOut", "float", 0);
|
|
4442
4491
|
const N = r.cv?.hands || [], W = this.visibleFeatures.has("handTracking");
|
|
4443
4492
|
this.setUniform("u_handCount", "int", W ? N.length : 0);
|
|
4444
|
-
const K = W ? N.find((
|
|
4493
|
+
const K = W ? N.find((b) => b.handedness === "left") : void 0, L = W ? N.find((b) => b.handedness === "right") : void 0;
|
|
4445
4494
|
if (K) {
|
|
4446
|
-
const
|
|
4447
|
-
this.setUniform("u_leftHandPalm", "vec3", [
|
|
4495
|
+
const b = K.palm || K.landmarks?.[9], y = K.gestures || {}, E = K.bounds;
|
|
4496
|
+
this.setUniform("u_leftHandPalm", "vec3", [b?.x || 0, 1 - (b?.y || 0), b?.z || 0]), this.setUniform("u_leftHandConfidence", "float", K.confidence || 0), this.setUniform("u_leftHandBounds", "vec4", [E?.x || 0, 1 - (E?.y || 0) - (E?.height || 0), E?.width || 0, E?.height || 0]), this.setUniform("u_leftHandFist", "float", y.fist || 0), this.setUniform("u_leftHandOpen", "float", y.openPalm || 0), this.setUniform("u_leftHandPeace", "float", y.peace || 0), this.setUniform("u_leftHandThumbsUp", "float", y.thumbsUp || 0), this.setUniform("u_leftHandThumbsDown", "float", y.thumbsDown || 0), this.setUniform("u_leftHandPointing", "float", y.pointing || 0), this.setUniform("u_leftHandILoveYou", "float", y.iLoveYou || 0);
|
|
4448
4497
|
} else
|
|
4449
4498
|
this.setUniform("u_leftHandPalm", "vec3", [0, 0, 0]), this.setUniform("u_leftHandConfidence", "float", 0), this.setUniform("u_leftHandBounds", "vec4", [0, 0, 0, 0]), this.setUniform("u_leftHandFist", "float", 0), this.setUniform("u_leftHandOpen", "float", 0), this.setUniform("u_leftHandPeace", "float", 0), this.setUniform("u_leftHandThumbsUp", "float", 0), this.setUniform("u_leftHandThumbsDown", "float", 0), this.setUniform("u_leftHandPointing", "float", 0), this.setUniform("u_leftHandILoveYou", "float", 0);
|
|
4450
4499
|
if (L) {
|
|
4451
|
-
const
|
|
4452
|
-
this.setUniform("u_rightHandPalm", "vec3", [
|
|
4500
|
+
const b = L.palm || L.landmarks?.[9], y = L.gestures || {}, E = L.bounds;
|
|
4501
|
+
this.setUniform("u_rightHandPalm", "vec3", [b?.x || 0, 1 - (b?.y || 0), b?.z || 0]), this.setUniform("u_rightHandConfidence", "float", L.confidence || 0), this.setUniform("u_rightHandBounds", "vec4", [E?.x || 0, 1 - (E?.y || 0) - (E?.height || 0), E?.width || 0, E?.height || 0]), this.setUniform("u_rightHandFist", "float", y.fist || 0), this.setUniform("u_rightHandOpen", "float", y.openPalm || 0), this.setUniform("u_rightHandPeace", "float", y.peace || 0), this.setUniform("u_rightHandThumbsUp", "float", y.thumbsUp || 0), this.setUniform("u_rightHandThumbsDown", "float", y.thumbsDown || 0), this.setUniform("u_rightHandPointing", "float", y.pointing || 0), this.setUniform("u_rightHandILoveYou", "float", y.iLoveYou || 0);
|
|
4453
4502
|
} else
|
|
4454
4503
|
this.setUniform("u_rightHandPalm", "vec3", [0, 0, 0]), this.setUniform("u_rightHandConfidence", "float", 0), this.setUniform("u_rightHandBounds", "vec4", [0, 0, 0, 0]), this.setUniform("u_rightHandFist", "float", 0), this.setUniform("u_rightHandOpen", "float", 0), this.setUniform("u_rightHandPeace", "float", 0), this.setUniform("u_rightHandThumbsUp", "float", 0), this.setUniform("u_rightHandThumbsDown", "float", 0), this.setUniform("u_rightHandPointing", "float", 0), this.setUniform("u_rightHandILoveYou", "float", 0);
|
|
4455
4504
|
const O = this.visibleFeatures.has("poseDetection") ? r.cv?.pose ?? null : null;
|
|
4456
4505
|
if (this.setUniform("u_poseDetected", "bool", O !== null), O && O.landmarks) {
|
|
4457
|
-
const
|
|
4458
|
-
this.setUniform("u_poseConfidence", "float", O.confidence || 0), this.setUniform("u_nosePosition", "vec2", [
|
|
4506
|
+
const b = O.landmarks, y = (E) => 1 - (b[E]?.y || 0);
|
|
4507
|
+
this.setUniform("u_poseConfidence", "float", O.confidence || 0), this.setUniform("u_nosePosition", "vec2", [b[0]?.x || 0, y(0)]), this.setUniform("u_leftShoulderPosition", "vec2", [b[11]?.x || 0, y(11)]), this.setUniform("u_rightShoulderPosition", "vec2", [b[12]?.x || 0, y(12)]), this.setUniform("u_leftElbowPosition", "vec2", [b[13]?.x || 0, y(13)]), this.setUniform("u_rightElbowPosition", "vec2", [b[14]?.x || 0, y(14)]), this.setUniform("u_leftWristPosition", "vec2", [b[15]?.x || 0, y(15)]), this.setUniform("u_rightWristPosition", "vec2", [b[16]?.x || 0, y(16)]), this.setUniform("u_leftHipPosition", "vec2", [b[23]?.x || 0, y(23)]), this.setUniform("u_rightHipPosition", "vec2", [b[24]?.x || 0, y(24)]), this.setUniform("u_leftKneePosition", "vec2", [b[25]?.x || 0, y(25)]), this.setUniform("u_rightKneePosition", "vec2", [b[26]?.x || 0, y(26)]), this.setUniform("u_leftAnklePosition", "vec2", [b[27]?.x || 0, y(27)]), this.setUniform("u_rightAnklePosition", "vec2", [b[28]?.x || 0, y(28)]);
|
|
4459
4508
|
} else
|
|
4460
4509
|
this.setUniform("u_poseConfidence", "float", 0), this.setUniform("u_nosePosition", "vec2", [0, 0]), this.setUniform("u_leftShoulderPosition", "vec2", [0, 0]), this.setUniform("u_rightShoulderPosition", "vec2", [0, 0]), this.setUniform("u_leftElbowPosition", "vec2", [0, 0]), this.setUniform("u_rightElbowPosition", "vec2", [0, 0]), this.setUniform("u_leftWristPosition", "vec2", [0, 0]), this.setUniform("u_rightWristPosition", "vec2", [0, 0]), this.setUniform("u_leftHipPosition", "vec2", [0, 0]), this.setUniform("u_rightHipPosition", "vec2", [0, 0]), this.setUniform("u_leftKneePosition", "vec2", [0, 0]), this.setUniform("u_rightKneePosition", "vec2", [0, 0]), this.setUniform("u_leftAnklePosition", "vec2", [0, 0]), this.setUniform("u_rightAnklePosition", "vec2", [0, 0]);
|
|
4461
4510
|
const ae = this.visibleFeatures.has("bodySegmentation") ? r.cv?.segmentation ?? null : null;
|
|
4462
4511
|
ae ? (this.updateSegmentationTexture(ae.mask, ae.width, ae.height), this.setUniform("u_segmentationRes", "vec2", [ae.width, ae.height])) : this.setUniform("u_segmentationRes", "vec2", [0, 0]);
|
|
4463
4512
|
const ee = e.device;
|
|
4464
4513
|
if (ee) {
|
|
4465
|
-
const
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
]) : this.setUniform("u_deviceAcceleration", "vec3", [0, 0, 0]),
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
]) : this.setUniform("u_deviceAccelerationGravity", "vec3", [0, 0, 0]),
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4514
|
+
const b = ee.motion;
|
|
4515
|
+
b?.acceleration ? this.setUniform("u_deviceAcceleration", "vec3", [
|
|
4516
|
+
b.acceleration.x ?? 0,
|
|
4517
|
+
b.acceleration.y ?? 0,
|
|
4518
|
+
b.acceleration.z ?? 0
|
|
4519
|
+
]) : this.setUniform("u_deviceAcceleration", "vec3", [0, 0, 0]), b?.accelerationIncludingGravity ? this.setUniform("u_deviceAccelerationGravity", "vec3", [
|
|
4520
|
+
b.accelerationIncludingGravity.x ?? 0,
|
|
4521
|
+
b.accelerationIncludingGravity.y ?? 0,
|
|
4522
|
+
b.accelerationIncludingGravity.z ?? 0
|
|
4523
|
+
]) : this.setUniform("u_deviceAccelerationGravity", "vec3", [0, 0, 0]), b?.rotationRate ? this.setUniform("u_deviceRotationRate", "vec3", [
|
|
4524
|
+
b.rotationRate.alpha ?? 0,
|
|
4525
|
+
b.rotationRate.beta ?? 0,
|
|
4526
|
+
b.rotationRate.gamma ?? 0
|
|
4478
4527
|
]) : this.setUniform("u_deviceRotationRate", "vec3", [0, 0, 0]);
|
|
4479
|
-
const
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
]), this.setUniform("u_deviceOrientationAbsolute", "bool",
|
|
4528
|
+
const y = ee.orientation;
|
|
4529
|
+
y ? (this.setUniform("u_deviceOrientation", "vec3", [
|
|
4530
|
+
y.alpha ?? 0,
|
|
4531
|
+
y.beta ?? 0,
|
|
4532
|
+
y.gamma ?? 0
|
|
4533
|
+
]), this.setUniform("u_deviceOrientationAbsolute", "bool", y.absolute)) : (this.setUniform("u_deviceOrientation", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientationAbsolute", "bool", !1));
|
|
4485
4534
|
} else
|
|
4486
4535
|
this.setUniform("u_deviceAcceleration", "vec3", [0, 0, 0]), this.setUniform("u_deviceAccelerationGravity", "vec3", [0, 0, 0]), this.setUniform("u_deviceRotationRate", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientation", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientationAbsolute", "bool", !1);
|
|
4487
4536
|
const z = e.devices || [], me = Math.min(z.length, De.MAX_EXTERNAL_DEVICES);
|
|
4488
4537
|
this.setUniform("u_externalDeviceCount", "int", me);
|
|
4489
|
-
for (let
|
|
4490
|
-
if (
|
|
4491
|
-
const
|
|
4492
|
-
E?.acceleration ? this.setUniform(`u_device${
|
|
4538
|
+
for (let b = 0; b < De.MAX_EXTERNAL_DEVICES; b++)
|
|
4539
|
+
if (b < me) {
|
|
4540
|
+
const y = z[b], E = y.motion;
|
|
4541
|
+
E?.acceleration ? this.setUniform(`u_device${b}Acceleration`, "vec3", [
|
|
4493
4542
|
E.acceleration.x ?? 0,
|
|
4494
4543
|
E.acceleration.y ?? 0,
|
|
4495
4544
|
E.acceleration.z ?? 0
|
|
4496
|
-
]) : this.setUniform(`u_device${
|
|
4545
|
+
]) : this.setUniform(`u_device${b}Acceleration`, "vec3", [0, 0, 0]), E?.accelerationIncludingGravity ? this.setUniform(`u_device${b}AccelerationGravity`, "vec3", [
|
|
4497
4546
|
E.accelerationIncludingGravity.x ?? 0,
|
|
4498
4547
|
E.accelerationIncludingGravity.y ?? 0,
|
|
4499
4548
|
E.accelerationIncludingGravity.z ?? 0
|
|
4500
|
-
]) : this.setUniform(`u_device${
|
|
4549
|
+
]) : this.setUniform(`u_device${b}AccelerationGravity`, "vec3", [0, 0, 0]), E?.rotationRate ? this.setUniform(`u_device${b}RotationRate`, "vec3", [
|
|
4501
4550
|
E.rotationRate.alpha ?? 0,
|
|
4502
4551
|
E.rotationRate.beta ?? 0,
|
|
4503
4552
|
E.rotationRate.gamma ?? 0
|
|
4504
|
-
]) : this.setUniform(`u_device${
|
|
4505
|
-
const V =
|
|
4506
|
-
V ? this.setUniform(`u_device${
|
|
4553
|
+
]) : this.setUniform(`u_device${b}RotationRate`, "vec3", [0, 0, 0]);
|
|
4554
|
+
const V = y.orientation;
|
|
4555
|
+
V ? this.setUniform(`u_device${b}Orientation`, "vec3", [
|
|
4507
4556
|
V.alpha ?? 0,
|
|
4508
4557
|
V.beta ?? 0,
|
|
4509
4558
|
V.gamma ?? 0
|
|
4510
|
-
]) : this.setUniform(`u_device${
|
|
4559
|
+
]) : this.setUniform(`u_device${b}Orientation`, "vec3", [0, 0, 0]);
|
|
4511
4560
|
} else
|
|
4512
|
-
this.setUniform(`u_device${
|
|
4561
|
+
this.setUniform(`u_device${b}Acceleration`, "vec3", [0, 0, 0]), this.setUniform(`u_device${b}AccelerationGravity`, "vec3", [0, 0, 0]), this.setUniform(`u_device${b}RotationRate`, "vec3", [0, 0, 0]), this.setUniform(`u_device${b}Orientation`, "vec3", [0, 0, 0]);
|
|
4513
4562
|
}
|
|
4514
4563
|
/**
|
|
4515
4564
|
* Update accumulator uniforms — CPU-side phase accumulation for smooth animation.
|
|
@@ -4888,7 +4937,7 @@ function lo(t) {
|
|
|
4888
4937
|
if (t.blockLen < 1)
|
|
4889
4938
|
throw new Error('"blockLen" must be >= 1');
|
|
4890
4939
|
}
|
|
4891
|
-
function
|
|
4940
|
+
function An(t, e = !0) {
|
|
4892
4941
|
if (t.destroyed)
|
|
4893
4942
|
throw new Error("Hash instance has been destroyed");
|
|
4894
4943
|
if (e && t.finished)
|
|
@@ -4900,7 +4949,7 @@ function ho(t, e) {
|
|
|
4900
4949
|
if (t.length < n)
|
|
4901
4950
|
throw new RangeError('"digestInto() output" expected to be of length >=' + n);
|
|
4902
4951
|
}
|
|
4903
|
-
function
|
|
4952
|
+
function In(...t) {
|
|
4904
4953
|
for (let e = 0; e < t.length; e++)
|
|
4905
4954
|
t[e].fill(0);
|
|
4906
4955
|
}
|
|
@@ -4920,7 +4969,7 @@ function Ss(t) {
|
|
|
4920
4969
|
return e;
|
|
4921
4970
|
}
|
|
4922
4971
|
const st = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
4923
|
-
function
|
|
4972
|
+
function bi(t) {
|
|
4924
4973
|
if (t >= st._0 && t <= st._9)
|
|
4925
4974
|
return t - st._0;
|
|
4926
4975
|
if (t >= st.A && t <= st.F)
|
|
@@ -4942,7 +4991,7 @@ function mo(t) {
|
|
|
4942
4991
|
throw new RangeError("hex string expected, got unpadded hex of length " + e);
|
|
4943
4992
|
const r = new Uint8Array(n);
|
|
4944
4993
|
for (let i = 0, o = 0; i < n; i++, o += 2) {
|
|
4945
|
-
const c =
|
|
4994
|
+
const c = bi(t.charCodeAt(o)), u = bi(t.charCodeAt(o + 1));
|
|
4946
4995
|
if (c === void 0 || u === void 0) {
|
|
4947
4996
|
const h = t[o] + t[o + 1];
|
|
4948
4997
|
throw new RangeError('hex string expected, got non-hex character "' + h + '" at index ' + o);
|
|
@@ -5005,7 +5054,7 @@ class Hc {
|
|
|
5005
5054
|
this.blockLen = e, this.outputLen = n, this.padOffset = r, this.isLE = i, this.buffer = new Uint8Array(e), this.view = Yr(this.buffer);
|
|
5006
5055
|
}
|
|
5007
5056
|
update(e) {
|
|
5008
|
-
|
|
5057
|
+
An(this), Ct(e);
|
|
5009
5058
|
const { view: n, buffer: r, blockLen: i } = this, o = e.length;
|
|
5010
5059
|
for (let c = 0; c < o; ) {
|
|
5011
5060
|
const u = Math.min(i - this.pos, o - c);
|
|
@@ -5020,10 +5069,10 @@ class Hc {
|
|
|
5020
5069
|
return this.length += e.length, this.roundClean(), this;
|
|
5021
5070
|
}
|
|
5022
5071
|
digestInto(e) {
|
|
5023
|
-
|
|
5072
|
+
An(this), ho(e, this), this.finished = !0;
|
|
5024
5073
|
const { buffer: n, view: r, blockLen: i, isLE: o } = this;
|
|
5025
5074
|
let { pos: c } = this;
|
|
5026
|
-
n[c++] = 128,
|
|
5075
|
+
n[c++] = 128, In(this.buffer.subarray(c)), this.padOffset > i - c && (this.process(r, 0), c = 0);
|
|
5027
5076
|
for (let g = c; g < i; g++)
|
|
5028
5077
|
n[g] = 0;
|
|
5029
5078
|
r.setBigUint64(i - 8, BigInt(this.length * 8), o), this.process(r, 0);
|
|
@@ -5153,10 +5202,10 @@ class Xc extends Hc {
|
|
|
5153
5202
|
r = r + this.A | 0, i = i + this.B | 0, o = o + this.C | 0, c = c + this.D | 0, u = u + this.E | 0, h = h + this.F | 0, f = f + this.G | 0, m = m + this.H | 0, this.set(r, i, o, c, u, h, f, m);
|
|
5154
5203
|
}
|
|
5155
5204
|
roundClean() {
|
|
5156
|
-
|
|
5205
|
+
In(ut);
|
|
5157
5206
|
}
|
|
5158
5207
|
destroy() {
|
|
5159
|
-
this.destroyed = !0, this.set(0, 0, 0, 0, 0, 0, 0, 0),
|
|
5208
|
+
this.destroyed = !0, this.set(0, 0, 0, 0, 0, 0, 0, 0), In(this.buffer);
|
|
5160
5209
|
}
|
|
5161
5210
|
}
|
|
5162
5211
|
class zc extends Xc {
|
|
@@ -5179,8 +5228,8 @@ const Yc = /* @__PURE__ */ Vc(
|
|
|
5179
5228
|
/* @__PURE__ */ $c(1)
|
|
5180
5229
|
);
|
|
5181
5230
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5182
|
-
const Ce = (t, e, n) => Ct(t, e, n), po = St, go = Ss, ht = (...t) => Bc(...t), us = (t) => mo(t),
|
|
5183
|
-
function
|
|
5231
|
+
const Ce = (t, e, n) => Ct(t, e, n), po = St, go = Ss, ht = (...t) => Bc(...t), us = (t) => mo(t), yo = uo, bo = (t) => jc(t), Rn = /* @__PURE__ */ BigInt(0), ls = /* @__PURE__ */ BigInt(1);
|
|
5232
|
+
function Qt(t, e = "") {
|
|
5184
5233
|
if (typeof t != "boolean") {
|
|
5185
5234
|
const n = e && `"${e}" `;
|
|
5186
5235
|
throw new TypeError(n + "expected boolean, got type=" + typeof t);
|
|
@@ -5189,7 +5238,7 @@ function Zt(t, e = "") {
|
|
|
5189
5238
|
}
|
|
5190
5239
|
function xs(t) {
|
|
5191
5240
|
if (typeof t == "bigint") {
|
|
5192
|
-
if (!
|
|
5241
|
+
if (!vn(t))
|
|
5193
5242
|
throw new RangeError("positive bigint expected, got " + t);
|
|
5194
5243
|
} else
|
|
5195
5244
|
po(t);
|
|
@@ -5205,14 +5254,14 @@ function hs(t, e = "") {
|
|
|
5205
5254
|
throw new RangeError(n + "expected safe integer, got " + t);
|
|
5206
5255
|
}
|
|
5207
5256
|
}
|
|
5208
|
-
function
|
|
5257
|
+
function yn(t) {
|
|
5209
5258
|
const e = xs(t).toString(16);
|
|
5210
5259
|
return e.length & 1 ? "0" + e : e;
|
|
5211
5260
|
}
|
|
5212
5261
|
function _o(t) {
|
|
5213
5262
|
if (typeof t != "string")
|
|
5214
5263
|
throw new TypeError("hex string expected, got " + typeof t);
|
|
5215
|
-
return t === "" ?
|
|
5264
|
+
return t === "" ? Rn : BigInt("0x" + t);
|
|
5216
5265
|
}
|
|
5217
5266
|
function qn(t) {
|
|
5218
5267
|
return _o(Ss(t));
|
|
@@ -5235,19 +5284,19 @@ function vo(t, e) {
|
|
|
5235
5284
|
function Kc(t) {
|
|
5236
5285
|
return Uint8Array.from(Ce(t));
|
|
5237
5286
|
}
|
|
5238
|
-
const
|
|
5287
|
+
const vn = (t) => typeof t == "bigint" && Rn <= t;
|
|
5239
5288
|
function Zc(t, e, n) {
|
|
5240
|
-
return
|
|
5289
|
+
return vn(t) && vn(e) && vn(n) && e <= t && t < n;
|
|
5241
5290
|
}
|
|
5242
5291
|
function wo(t, e, n, r) {
|
|
5243
5292
|
if (!Zc(e, n, r))
|
|
5244
5293
|
throw new RangeError("expected valid " + t + ": " + n + " <= n < " + r + ", got " + e);
|
|
5245
5294
|
}
|
|
5246
5295
|
function Is(t) {
|
|
5247
|
-
if (t <
|
|
5296
|
+
if (t < Rn)
|
|
5248
5297
|
throw new Error("expected non-negative bigint, got " + t);
|
|
5249
5298
|
let e;
|
|
5250
|
-
for (e = 0; t >
|
|
5299
|
+
for (e = 0; t > Rn; t >>= ls, e += 1)
|
|
5251
5300
|
;
|
|
5252
5301
|
return e;
|
|
5253
5302
|
}
|
|
@@ -5554,7 +5603,7 @@ class Lo {
|
|
|
5554
5603
|
// We can't move this out because Fp6, Fp12 implement it
|
|
5555
5604
|
// and it's unclear what to return in there.
|
|
5556
5605
|
cmov(e, n, r) {
|
|
5557
|
-
return
|
|
5606
|
+
return Qt(r, "condition"), r ? n : e;
|
|
5558
5607
|
}
|
|
5559
5608
|
}
|
|
5560
5609
|
Object.freeze(Lo.prototype);
|
|
@@ -5583,7 +5632,7 @@ function c1(t, e, n = !1) {
|
|
|
5583
5632
|
}
|
|
5584
5633
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5585
5634
|
const Ot = /* @__PURE__ */ BigInt(0), wt = /* @__PURE__ */ BigInt(1);
|
|
5586
|
-
function
|
|
5635
|
+
function Cn(t, e) {
|
|
5587
5636
|
const n = e.negate();
|
|
5588
5637
|
return t ? n : e;
|
|
5589
5638
|
}
|
|
@@ -5667,7 +5716,7 @@ class u1 {
|
|
|
5667
5716
|
const c = Kr(e, this.bits);
|
|
5668
5717
|
for (let u = 0; u < c.windows; u++) {
|
|
5669
5718
|
const { nextN: h, offset: f, isZero: m, isNeg: g, isNegF: v, offsetF: w } = Ei(r, u, c);
|
|
5670
|
-
r = h, m ? o = o.add(
|
|
5719
|
+
r = h, m ? o = o.add(Cn(v, n[w])) : i = i.add(Cn(g, n[f]));
|
|
5671
5720
|
}
|
|
5672
5721
|
return Ti(r), { p: i, f: o };
|
|
5673
5722
|
}
|
|
@@ -5763,13 +5812,13 @@ class xi {
|
|
|
5763
5812
|
this.iHash.update(i), this.oHash = e.create();
|
|
5764
5813
|
for (let o = 0; o < i.length; o++)
|
|
5765
5814
|
i[o] ^= 106;
|
|
5766
|
-
this.oHash.update(i),
|
|
5815
|
+
this.oHash.update(i), In(i);
|
|
5767
5816
|
}
|
|
5768
5817
|
update(e) {
|
|
5769
|
-
return
|
|
5818
|
+
return An(this), this.iHash.update(e), this;
|
|
5770
5819
|
}
|
|
5771
5820
|
digestInto(e) {
|
|
5772
|
-
|
|
5821
|
+
An(this), ho(e, this), this.finished = !0;
|
|
5773
5822
|
const n = e.subarray(0, this.outputLen);
|
|
5774
5823
|
this.iHash.digestInto(n), this.oHash.update(n), this.oHash.digestInto(n), this.destroy();
|
|
5775
5824
|
}
|
|
@@ -5816,7 +5865,7 @@ function Jr(t, e) {
|
|
|
5816
5865
|
const n = {};
|
|
5817
5866
|
for (let r of Object.keys(e))
|
|
5818
5867
|
n[r] = t[r] === void 0 ? e[r] : t[r];
|
|
5819
|
-
return
|
|
5868
|
+
return Qt(n.lowS, "lowS"), Qt(n.prehash, "prehash"), n.format !== void 0 && fs(n.format), n;
|
|
5820
5869
|
}
|
|
5821
5870
|
class p1 extends Error {
|
|
5822
5871
|
constructor(e = "") {
|
|
@@ -5836,11 +5885,11 @@ const We = {
|
|
|
5836
5885
|
throw new TypeError('"data" expected string, got type=' + typeof e);
|
|
5837
5886
|
if (e.length & 1)
|
|
5838
5887
|
throw new n("tlv.encode: unpadded data");
|
|
5839
|
-
const r = e.length / 2, i =
|
|
5888
|
+
const r = e.length / 2, i = yn(r);
|
|
5840
5889
|
if (i.length / 2 & 128)
|
|
5841
5890
|
throw new n("tlv.encode: long form length too big");
|
|
5842
|
-
const o = r > 127 ?
|
|
5843
|
-
return
|
|
5891
|
+
const o = r > 127 ? yn(i.length / 2 | 128) : "";
|
|
5892
|
+
return yn(t) + o + i + e;
|
|
5844
5893
|
},
|
|
5845
5894
|
// v - value, l - left bytes (unparsed)
|
|
5846
5895
|
decode(t, e) {
|
|
@@ -5886,7 +5935,7 @@ const We = {
|
|
|
5886
5935
|
const { Err: e } = We;
|
|
5887
5936
|
if (xs(t), t < Qe)
|
|
5888
5937
|
throw new e("integer: negative integers are not allowed");
|
|
5889
|
-
let n =
|
|
5938
|
+
let n = yn(t);
|
|
5890
5939
|
if (Number.parseInt(n[0], 16) & 8 && (n = "00" + n), n.length & 1)
|
|
5891
5940
|
throw new e("unexpected DER parsing assertion: unpadded hex");
|
|
5892
5941
|
return n;
|
|
@@ -5920,7 +5969,7 @@ Object.freeze(We._tlv);
|
|
|
5920
5969
|
Object.freeze(We._int);
|
|
5921
5970
|
Object.freeze(We);
|
|
5922
5971
|
const Qe = /* @__PURE__ */ BigInt(0), ft = /* @__PURE__ */ BigInt(1), Mo = /* @__PURE__ */ BigInt(2), bn = /* @__PURE__ */ BigInt(3), g1 = /* @__PURE__ */ BigInt(4);
|
|
5923
|
-
function
|
|
5972
|
+
function y1(t, e = {}) {
|
|
5924
5973
|
const n = h1("weierstrass", t, e), r = n.Fp, i = n.Fn;
|
|
5925
5974
|
let o = n.CURVE;
|
|
5926
5975
|
const { h: c, n: u } = o;
|
|
@@ -5940,20 +5989,20 @@ function b1(t, e = {}) {
|
|
|
5940
5989
|
if (!r.isOdd)
|
|
5941
5990
|
throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
5942
5991
|
}
|
|
5943
|
-
function v(
|
|
5992
|
+
function v(y, E, V) {
|
|
5944
5993
|
if (f && E.is0())
|
|
5945
5994
|
return Uint8Array.of(0);
|
|
5946
5995
|
const { x: H, y: M } = E.toAffine(), R = r.toBytes(H);
|
|
5947
|
-
if (
|
|
5996
|
+
if (Qt(V, "isCompressed"), V) {
|
|
5948
5997
|
g();
|
|
5949
5998
|
const U = !r.isOdd(M);
|
|
5950
5999
|
return ht(No(U), R);
|
|
5951
6000
|
} else
|
|
5952
6001
|
return ht(Uint8Array.of(4), R, r.toBytes(M));
|
|
5953
6002
|
}
|
|
5954
|
-
function w(
|
|
5955
|
-
Ce(
|
|
5956
|
-
const { publicKey: E, publicKeyUncompressed: V } = m, H =
|
|
6003
|
+
function w(y) {
|
|
6004
|
+
Ce(y, void 0, "Point");
|
|
6005
|
+
const { publicKey: E, publicKeyUncompressed: V } = m, H = y.length, M = y[0], R = y.subarray(1);
|
|
5957
6006
|
if (f && H === 1 && M === 0)
|
|
5958
6007
|
return { x: r.ZERO, y: r.ZERO };
|
|
5959
6008
|
if (H === E && (M === 2 || M === 3)) {
|
|
@@ -5980,12 +6029,12 @@ function b1(t, e = {}) {
|
|
|
5980
6029
|
throw new Error(`bad point: got length ${H}, expected compressed=${E} or uncompressed=${V}`);
|
|
5981
6030
|
}
|
|
5982
6031
|
const D = e.toBytes === void 0 ? v : e.toBytes, N = e.fromBytes === void 0 ? w : e.fromBytes;
|
|
5983
|
-
function W(
|
|
5984
|
-
const E = r.sqr(
|
|
5985
|
-
return r.add(r.add(V, r.mul(
|
|
6032
|
+
function W(y) {
|
|
6033
|
+
const E = r.sqr(y), V = r.mul(E, y);
|
|
6034
|
+
return r.add(r.add(V, r.mul(y, o.a)), o.b);
|
|
5986
6035
|
}
|
|
5987
|
-
function K(
|
|
5988
|
-
const V = r.sqr(E), H = W(
|
|
6036
|
+
function K(y, E) {
|
|
6037
|
+
const V = r.sqr(E), H = W(y);
|
|
5989
6038
|
return r.eql(V, H);
|
|
5990
6039
|
}
|
|
5991
6040
|
if (!K(o.Gx, o.Gy))
|
|
@@ -5993,22 +6042,22 @@ function b1(t, e = {}) {
|
|
|
5993
6042
|
const L = r.mul(r.pow(o.a, bn), g1), j = r.mul(r.sqr(o.b), BigInt(27));
|
|
5994
6043
|
if (r.is0(r.add(L, j)))
|
|
5995
6044
|
throw new Error("bad curve params: a or b");
|
|
5996
|
-
function O(
|
|
6045
|
+
function O(y, E, V = !1) {
|
|
5997
6046
|
if (!r.isValid(E) || V && r.is0(E))
|
|
5998
|
-
throw new Error(`bad point coordinate ${
|
|
6047
|
+
throw new Error(`bad point coordinate ${y}`);
|
|
5999
6048
|
return E;
|
|
6000
6049
|
}
|
|
6001
|
-
function J(
|
|
6002
|
-
if (!(
|
|
6050
|
+
function J(y) {
|
|
6051
|
+
if (!(y instanceof z))
|
|
6003
6052
|
throw new Error("Weierstrass Point expected");
|
|
6004
6053
|
}
|
|
6005
|
-
function ae(
|
|
6054
|
+
function ae(y) {
|
|
6006
6055
|
if (!h || !h.basises)
|
|
6007
6056
|
throw new Error("no endo");
|
|
6008
|
-
return m1(
|
|
6057
|
+
return m1(y, h.basises, i.ORDER);
|
|
6009
6058
|
}
|
|
6010
|
-
function ee(
|
|
6011
|
-
return V = new z(r.mul(V.X,
|
|
6059
|
+
function ee(y, E, V, H, M) {
|
|
6060
|
+
return V = new z(r.mul(V.X, y), V.Y, V.Z), E = Cn(H, E), V = Cn(M, V), E.add(V);
|
|
6012
6061
|
}
|
|
6013
6062
|
class z {
|
|
6014
6063
|
// base / generator point
|
|
@@ -6059,7 +6108,7 @@ function b1(t, e = {}) {
|
|
|
6059
6108
|
* @returns
|
|
6060
6109
|
*/
|
|
6061
6110
|
precompute(E = 8, V = !0) {
|
|
6062
|
-
return
|
|
6111
|
+
return b.createCache(this, E), V || this.multiply(bn), this;
|
|
6063
6112
|
}
|
|
6064
6113
|
// TODO: return `this`
|
|
6065
6114
|
/** A point on curve is valid if it conforms to equation. */
|
|
@@ -6137,7 +6186,7 @@ function b1(t, e = {}) {
|
|
|
6137
6186
|
if (!i.isValidNot0(E))
|
|
6138
6187
|
throw new RangeError("invalid scalar: out of range");
|
|
6139
6188
|
let H, M;
|
|
6140
|
-
const R = (U) =>
|
|
6189
|
+
const R = (U) => b.cached(this, U, (P) => wi(z, P));
|
|
6141
6190
|
if (V) {
|
|
6142
6191
|
const { k1neg: U, k1: P, k2neg: B, k2: $ } = ae(E), { p: Y, f: oe } = R(P), { p: ce, f: ie } = R($);
|
|
6143
6192
|
M = oe.add(ie), H = ee(V.beta, Y, ce, U, B);
|
|
@@ -6160,13 +6209,13 @@ function b1(t, e = {}) {
|
|
|
6160
6209
|
return z.ZERO;
|
|
6161
6210
|
if (M === ft)
|
|
6162
6211
|
return H;
|
|
6163
|
-
if (
|
|
6212
|
+
if (b.hasCache(this))
|
|
6164
6213
|
return this.multiply(M);
|
|
6165
6214
|
if (V) {
|
|
6166
6215
|
const { k1neg: R, k1: U, k2neg: P, k2: B } = ae(M), { p1: $, p2: Y } = l1(z, H, U, B);
|
|
6167
6216
|
return ee(V.beta, $, Y, R, P);
|
|
6168
6217
|
} else
|
|
6169
|
-
return
|
|
6218
|
+
return b.unsafe(H, M);
|
|
6170
6219
|
}
|
|
6171
6220
|
/**
|
|
6172
6221
|
* Converts Projective point to affine (x, y) coordinates.
|
|
@@ -6194,7 +6243,7 @@ function b1(t, e = {}) {
|
|
|
6194
6243
|
*/
|
|
6195
6244
|
isTorsionFree() {
|
|
6196
6245
|
const { isTorsionFree: E } = e;
|
|
6197
|
-
return c === ft ? !0 : E ? E(z, this) :
|
|
6246
|
+
return c === ft ? !0 : E ? E(z, this) : b.unsafe(this, u).is0();
|
|
6198
6247
|
}
|
|
6199
6248
|
clearCofactor() {
|
|
6200
6249
|
const { clearCofactor: E } = e;
|
|
@@ -6204,7 +6253,7 @@ function b1(t, e = {}) {
|
|
|
6204
6253
|
return c === ft ? this.is0() : this.clearCofactor().is0();
|
|
6205
6254
|
}
|
|
6206
6255
|
toBytes(E = !0) {
|
|
6207
|
-
return
|
|
6256
|
+
return Qt(E, "isCompressed"), this.assertValidity(), D(z, this, E);
|
|
6208
6257
|
}
|
|
6209
6258
|
toHex(E = !0) {
|
|
6210
6259
|
return go(this.toBytes(E));
|
|
@@ -6213,7 +6262,7 @@ function b1(t, e = {}) {
|
|
|
6213
6262
|
return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
|
|
6214
6263
|
}
|
|
6215
6264
|
}
|
|
6216
|
-
const me = i.BITS,
|
|
6265
|
+
const me = i.BITS, b = new u1(z, e.endo ? Math.ceil(me / 2) : me);
|
|
6217
6266
|
return me >= 8 && z.BASE.precompute(8), Object.freeze(z.prototype), Object.freeze(z), z;
|
|
6218
6267
|
}
|
|
6219
6268
|
function No(t) {
|
|
@@ -6230,8 +6279,8 @@ function Oo(t, e) {
|
|
|
6230
6279
|
signature: 2 * e.BYTES
|
|
6231
6280
|
};
|
|
6232
6281
|
}
|
|
6233
|
-
function
|
|
6234
|
-
const { Fn: n } = t, r = e.randomBytes === void 0 ?
|
|
6282
|
+
function b1(t, e = {}) {
|
|
6283
|
+
const { Fn: n } = t, r = e.randomBytes === void 0 ? bo : e.randomBytes, i = Object.assign(Oo(t.Fp, n), {
|
|
6235
6284
|
seed: Math.max(Po(n.ORDER), 16)
|
|
6236
6285
|
});
|
|
6237
6286
|
function o(w) {
|
|
@@ -6259,7 +6308,7 @@ function y1(t, e = {}) {
|
|
|
6259
6308
|
}
|
|
6260
6309
|
function f(w) {
|
|
6261
6310
|
const { secretKey: D, publicKey: N, publicKeyUncompressed: W } = i, K = n._lengths;
|
|
6262
|
-
if (!
|
|
6311
|
+
if (!yo(w))
|
|
6263
6312
|
return;
|
|
6264
6313
|
const L = Ce(w, void 0, "key").length, j = L === N || L === W, O = L === D || !!K?.includes(L);
|
|
6265
6314
|
if (!(j && O))
|
|
@@ -6289,7 +6338,7 @@ function _1(t, e, n = {}) {
|
|
|
6289
6338
|
bits2int: "function",
|
|
6290
6339
|
bits2int_modN: "function"
|
|
6291
6340
|
}), n = Object.assign({}, n);
|
|
6292
|
-
const i = n.randomBytes === void 0 ?
|
|
6341
|
+
const i = n.randomBytes === void 0 ? bo : n.randomBytes, o = n.hmac === void 0 ? (M, R) => d1(r, M, R) : n.hmac, { Fp: c, Fn: u } = t, { ORDER: h, BITS: f } = u, { keygen: m, getPublicKey: g, getSharedSecret: v, utils: w, lengths: D } = b1(t, n), N = {
|
|
6293
6342
|
prehash: !0,
|
|
6294
6343
|
lowS: typeof n.lowS == "boolean" ? n.lowS : !0,
|
|
6295
6344
|
format: "compact",
|
|
@@ -6385,12 +6434,12 @@ function _1(t, e, n = {}) {
|
|
|
6385
6434
|
function me(M) {
|
|
6386
6435
|
return wo("num < 2^" + f, M, Qe, z), u.toBytes(M);
|
|
6387
6436
|
}
|
|
6388
|
-
function
|
|
6437
|
+
function b(M, R) {
|
|
6389
6438
|
return Ce(M, void 0, "message"), R ? Ce(r(M), void 0, "prehashed message") : M;
|
|
6390
6439
|
}
|
|
6391
|
-
function
|
|
6440
|
+
function y(M, R, U) {
|
|
6392
6441
|
const { lowS: P, prehash: B, extraEntropy: $ } = Jr(U, N);
|
|
6393
|
-
M =
|
|
6442
|
+
M = b(M, B);
|
|
6394
6443
|
const Y = ee(M), oe = u.fromBytes(R);
|
|
6395
6444
|
if (!u.isValidNot0(oe))
|
|
6396
6445
|
throw new Error("invalid private key");
|
|
@@ -6416,12 +6465,12 @@ function _1(t, e, n = {}) {
|
|
|
6416
6465
|
return { seed: ie, k2sig: x };
|
|
6417
6466
|
}
|
|
6418
6467
|
function E(M, R, U = {}) {
|
|
6419
|
-
const { seed: P, k2sig: B } =
|
|
6468
|
+
const { seed: P, k2sig: B } = y(M, R, U);
|
|
6420
6469
|
return Qc(r.outputLen, u.BYTES, o)(P, B).toBytes(U.format);
|
|
6421
6470
|
}
|
|
6422
6471
|
function V(M, R, U, P = {}) {
|
|
6423
6472
|
const { lowS: B, prehash: $, format: Y } = Jr(P, N);
|
|
6424
|
-
if (U = Ce(U, void 0, "publicKey"), R =
|
|
6473
|
+
if (U = Ce(U, void 0, "publicKey"), R = b(R, $), !yo(M)) {
|
|
6425
6474
|
const oe = M instanceof J ? ", use sig.toBytes()" : "";
|
|
6426
6475
|
throw new Error("verify expects Uint8Array signature" + oe);
|
|
6427
6476
|
}
|
|
@@ -6438,7 +6487,7 @@ function _1(t, e, n = {}) {
|
|
|
6438
6487
|
}
|
|
6439
6488
|
function H(M, R, U = {}) {
|
|
6440
6489
|
const { prehash: P } = Jr(U, N);
|
|
6441
|
-
return R =
|
|
6490
|
+
return R = b(R, P), J.fromBytes(M, "recovered").recoverPublicKey(R).toBytes();
|
|
6442
6491
|
}
|
|
6443
6492
|
return Object.freeze({
|
|
6444
6493
|
keygen: m,
|
|
@@ -6463,19 +6512,19 @@ const k1 = {
|
|
|
6463
6512
|
b: BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),
|
|
6464
6513
|
Gx: BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),
|
|
6465
6514
|
Gy: BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")
|
|
6466
|
-
}, v1 = /* @__PURE__ */
|
|
6515
|
+
}, v1 = /* @__PURE__ */ y1(k1), w1 = /* @__PURE__ */ _1(v1, Yc), Ii = {
|
|
6467
6516
|
x: "6bkPbVZXx-c08blVs6qIwm0gfSRLS2nnf2Tsz19ggtM",
|
|
6468
6517
|
y: "lhi486ASKQkS8TGbVee-FpdAu7qKaO3gad_4ScX8qJI"
|
|
6469
6518
|
}, E1 = 60;
|
|
6470
6519
|
let ds = null, Fs = !1, Et = null, Nt = 0;
|
|
6471
|
-
function
|
|
6520
|
+
function Ln(t) {
|
|
6472
6521
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = atob(e), r = new Uint8Array(n.length);
|
|
6473
6522
|
for (let i = 0; i < n.length; i++) r[i] = n.charCodeAt(i);
|
|
6474
6523
|
return r;
|
|
6475
6524
|
}
|
|
6476
6525
|
async function T1() {
|
|
6477
6526
|
try {
|
|
6478
|
-
const t =
|
|
6527
|
+
const t = Ln(Ii.x), e = Ln(Ii.y);
|
|
6479
6528
|
if (t.length !== 32 || e.length !== 32) throw new Error("bad key");
|
|
6480
6529
|
const n = new Uint8Array(65);
|
|
6481
6530
|
n[0] = 4, n.set(t, 1), n.set(e, 33), ds = n;
|
|
@@ -6491,12 +6540,12 @@ async function Ri(t) {
|
|
|
6491
6540
|
try {
|
|
6492
6541
|
const e = t.split(".");
|
|
6493
6542
|
if (e.length !== 3) throw new Error("malformed");
|
|
6494
|
-
const n = new TextEncoder().encode(e[0] + "." + e[1]), r =
|
|
6543
|
+
const n = new TextEncoder().encode(e[0] + "." + e[1]), r = Ln(e[2]);
|
|
6495
6544
|
if (r.length !== 64) throw new Error("invalid signature length");
|
|
6496
6545
|
if (!w1.verify(r, n, ds, {
|
|
6497
6546
|
lowS: !1
|
|
6498
6547
|
})) throw new Error("invalid signature");
|
|
6499
|
-
const o = JSON.parse(new TextDecoder().decode(
|
|
6548
|
+
const o = JSON.parse(new TextDecoder().decode(Ln(e[1])));
|
|
6500
6549
|
Et = o.c ?? {}, Nt = o.e ?? 0;
|
|
6501
6550
|
} catch {
|
|
6502
6551
|
Et = null, Nt = 0;
|
|
@@ -6508,7 +6557,7 @@ function S1(t, e) {
|
|
|
6508
6557
|
return Nt > 0 && Nt + E1 < n ? (Et = null, Nt = 0, e) : typeof Et[t] == "number" ? Et[t] : e;
|
|
6509
6558
|
}
|
|
6510
6559
|
const Ps = 44, Ds = 74, Us = 44, Ms = 23, Bo = "#F1F1F1";
|
|
6511
|
-
let
|
|
6560
|
+
let Jt = null, en = null, Vo = null, jo = null, Ue = null, zt = null, Fn = null, lt = null, it = -1, ot = -1, Ci = null, $o = 0;
|
|
6512
6561
|
const x1 = `
|
|
6513
6562
|
attribute vec2 a_pos;
|
|
6514
6563
|
attribute vec2 a_uv;
|
|
@@ -6532,10 +6581,10 @@ function R1(t) {
|
|
|
6532
6581
|
}
|
|
6533
6582
|
function C1(t) {
|
|
6534
6583
|
try {
|
|
6535
|
-
|
|
6536
|
-
const e =
|
|
6537
|
-
e && I1(e),
|
|
6538
|
-
const n =
|
|
6584
|
+
Jt = new OffscreenCanvas(Ps, Ds);
|
|
6585
|
+
const e = Jt.getContext("2d");
|
|
6586
|
+
e && I1(e), en = new OffscreenCanvas(Us, Ms);
|
|
6587
|
+
const n = en.getContext("2d");
|
|
6539
6588
|
n && R1(n);
|
|
6540
6589
|
} catch (e) {
|
|
6541
6590
|
console.warn("[Viji] overlay: init failed", e);
|
|
@@ -6545,7 +6594,7 @@ function Li(t) {
|
|
|
6545
6594
|
$o = t;
|
|
6546
6595
|
}
|
|
6547
6596
|
function L1(t, e, n, r, i = 1) {
|
|
6548
|
-
if (r >= 2 || !
|
|
6597
|
+
if (r >= 2 || !Jt && !en) return;
|
|
6549
6598
|
const o = $o === 1, c = i || 1;
|
|
6550
6599
|
e ? D1(e, o, t.width, c) : n && U1(n, t, o, c);
|
|
6551
6600
|
}
|
|
@@ -6572,7 +6621,7 @@ function Fi(t, e) {
|
|
|
6572
6621
|
}
|
|
6573
6622
|
function P1(t) {
|
|
6574
6623
|
if (Ci === t) return;
|
|
6575
|
-
Ci = t, Vo = Fi(t,
|
|
6624
|
+
Ci = t, Vo = Fi(t, Jt), jo = Fi(t, en);
|
|
6576
6625
|
const e = t.createShader(t.VERTEX_SHADER);
|
|
6577
6626
|
t.shaderSource(e, x1), t.compileShader(e);
|
|
6578
6627
|
const n = t.createShader(t.FRAGMENT_SHADER);
|
|
@@ -6582,7 +6631,7 @@ function P1(t) {
|
|
|
6582
6631
|
}
|
|
6583
6632
|
if (zt = t.createBuffer(), it = t.getAttribLocation(Ue, "a_pos"), ot = t.getAttribLocation(Ue, "a_uv"), lt = F1(t), lt) {
|
|
6584
6633
|
const r = t.getParameter(qo), i = t.getParameter(t.ARRAY_BUFFER_BINDING);
|
|
6585
|
-
|
|
6634
|
+
Fn = lt.create(), lt.bind(Fn), t.bindBuffer(t.ARRAY_BUFFER, zt), it >= 0 && (t.enableVertexAttribArray(it), t.vertexAttribPointer(it, 2, t.FLOAT, !1, 16, 0)), ot >= 0 && (t.enableVertexAttribArray(ot), t.vertexAttribPointer(ot, 2, t.FLOAT, !1, 16, 8)), lt.bind(r), t.bindBuffer(t.ARRAY_BUFFER, i);
|
|
6586
6635
|
}
|
|
6587
6636
|
}
|
|
6588
6637
|
function Pi(t, e) {
|
|
@@ -6602,7 +6651,7 @@ function Di(t, e) {
|
|
|
6602
6651
|
e.buffer && (t.bindBuffer(t.ARRAY_BUFFER, e.buffer), t.vertexAttribPointer(e.index, e.size, e.type, e.normalized, e.stride, e.offset)), e.enabled ? t.enableVertexAttribArray(e.index) : t.disableVertexAttribArray(e.index), t.vertexAttrib4f(e.index, e.currentValue[0], e.currentValue[1], e.currentValue[2], e.currentValue[3]);
|
|
6603
6652
|
}
|
|
6604
6653
|
function D1(t, e, n, r) {
|
|
6605
|
-
const i = e ?
|
|
6654
|
+
const i = e ? en : Jt;
|
|
6606
6655
|
if (!i) return;
|
|
6607
6656
|
const o = (e ? Us : Ps) * r, c = (e ? Ms : Ds) * r, u = Math.round(e ? (n - o) / 2 : 48 * r), h = Math.round((e ? 52 : 48) * r);
|
|
6608
6657
|
t.save(), t.globalAlpha = 0.85, t.drawImage(i, u, h, o, c), t.restore();
|
|
@@ -6611,9 +6660,9 @@ function U1(t, e, n, r) {
|
|
|
6611
6660
|
if (P1(t), !Ue || !zt) return;
|
|
6612
6661
|
const i = n ? jo : Vo;
|
|
6613
6662
|
if (!i) return;
|
|
6614
|
-
const o = (n ? Us : Ps) * r, c = (n ? Ms : Ds) * r, u = e.width, h = e.height, f = Math.round(n ? (u - o) / 2 : 48 * r), m = Math.round((n ? 52 : 48) * r), g = f / u * 2 - 1, v = 1 - (m + c) / h * 2, w = (f + o) / u * 2 - 1, D = 1 - m / h * 2, N = !!(lt &&
|
|
6663
|
+
const o = (n ? Us : Ps) * r, c = (n ? Ms : Ds) * r, u = e.width, h = e.height, f = Math.round(n ? (u - o) / 2 : 48 * r), m = Math.round((n ? 52 : 48) * r), g = f / u * 2 - 1, v = 1 - (m + c) / h * 2, w = (f + o) / u * 2 - 1, D = 1 - m / h * 2, N = !!(lt && Fn), W = t.getParameter(t.CURRENT_PROGRAM), K = t.getParameter(t.ACTIVE_TEXTURE);
|
|
6615
6664
|
t.activeTexture(t.TEXTURE0);
|
|
6616
|
-
const L = t.getParameter(t.TEXTURE_BINDING_2D), j = t.getParameter(t.ARRAY_BUFFER_BINDING), O = t.getParameter(t.FRAMEBUFFER_BINDING), J = t.getParameter(t.VIEWPORT), ae = t.isEnabled(t.BLEND), ee = t.getParameter(t.BLEND_SRC_RGB), z = t.getParameter(t.BLEND_DST_RGB), me = t.getParameter(t.BLEND_SRC_ALPHA),
|
|
6665
|
+
const L = t.getParameter(t.TEXTURE_BINDING_2D), j = t.getParameter(t.ARRAY_BUFFER_BINDING), O = t.getParameter(t.FRAMEBUFFER_BINDING), J = t.getParameter(t.VIEWPORT), ae = t.isEnabled(t.BLEND), ee = t.getParameter(t.BLEND_SRC_RGB), z = t.getParameter(t.BLEND_DST_RGB), me = t.getParameter(t.BLEND_SRC_ALPHA), b = t.getParameter(t.BLEND_DST_ALPHA), y = t.getParameter(t.BLEND_EQUATION_RGB), E = t.getParameter(t.BLEND_EQUATION_ALPHA), V = t.isEnabled(t.DEPTH_TEST), H = t.isEnabled(t.SCISSOR_TEST), M = t.isEnabled(t.STENCIL_TEST), R = t.isEnabled(t.CULL_FACE), U = t.getParameter(t.COLOR_WRITEMASK), P = t.getParameter(t.UNPACK_FLIP_Y_WEBGL), B = N ? t.getParameter(qo) : null, $ = !N && it >= 0 ? Pi(t, it) : null, Y = !N && ot >= 0 ? Pi(t, ot) : null;
|
|
6617
6666
|
t.bindFramebuffer(t.FRAMEBUFFER, null), t.viewport(0, 0, u, h), t.useProgram(Ue), t.enable(t.BLEND), t.blendEquation(t.FUNC_ADD), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA), t.disable(t.DEPTH_TEST), t.disable(t.SCISSOR_TEST), t.disable(t.STENCIL_TEST), t.disable(t.CULL_FACE), t.colorMask(!0, !0, !0, !0), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 0), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(t.getUniformLocation(Ue, "u_tex"), 0), t.uniform1f(t.getUniformLocation(Ue, "u_alpha"), 0.85);
|
|
6618
6667
|
const oe = new Float32Array([
|
|
6619
6668
|
g,
|
|
@@ -6641,9 +6690,9 @@ function U1(t, e, n, r) {
|
|
|
6641
6690
|
1,
|
|
6642
6691
|
1
|
|
6643
6692
|
]);
|
|
6644
|
-
N ? (lt.bind(
|
|
6693
|
+
N ? (lt.bind(Fn), t.bindBuffer(t.ARRAY_BUFFER, zt), t.bufferData(t.ARRAY_BUFFER, oe, t.DYNAMIC_DRAW)) : (t.bindBuffer(t.ARRAY_BUFFER, zt), t.bufferData(t.ARRAY_BUFFER, oe, t.DYNAMIC_DRAW), it >= 0 && (t.enableVertexAttribArray(it), t.vertexAttribPointer(it, 2, t.FLOAT, !1, 16, 0)), ot >= 0 && (t.enableVertexAttribArray(ot), t.vertexAttribPointer(ot, 2, t.FLOAT, !1, 16, 8))), t.drawArrays(t.TRIANGLES, 0, 6), N ? lt.bind(B) : (Y && Di(t, Y), $ && Di(t, $)), t.bindFramebuffer(t.FRAMEBUFFER, O), t.viewport(J[0], J[1], J[2], J[3]), t.bindBuffer(t.ARRAY_BUFFER, j), t.colorMask(U[0], U[1], U[2], U[3]), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, P ? 1 : 0), H ? t.enable(t.SCISSOR_TEST) : t.disable(t.SCISSOR_TEST), M ? t.enable(t.STENCIL_TEST) : t.disable(t.STENCIL_TEST), R ? t.enable(t.CULL_FACE) : t.disable(t.CULL_FACE), V ? t.enable(t.DEPTH_TEST) : t.disable(t.DEPTH_TEST), ae ? t.enable(t.BLEND) : t.disable(t.BLEND), t.blendFuncSeparate(ee, z, me, b), t.blendEquationSeparate(y, E), t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, L), t.activeTexture(K), t.useProgram(W);
|
|
6645
6694
|
}
|
|
6646
|
-
class
|
|
6695
|
+
class Yt {
|
|
6647
6696
|
canvas = null;
|
|
6648
6697
|
ctx = null;
|
|
6649
6698
|
gl = null;
|
|
@@ -6731,6 +6780,11 @@ class Fn {
|
|
|
6731
6780
|
// rendered frame is fenced (gl.finish) and recorded; steady-state reporting
|
|
6732
6781
|
// is suppressed for the duration. Cleared when frameCount frames are collected.
|
|
6733
6782
|
benchmark = null;
|
|
6783
|
+
// Per-frame budget for the 2D getImageData fence. A readback over this (WebKit's
|
|
6784
|
+
// pathological full-canvas readback) disables 2D fencing for the rest of the
|
|
6785
|
+
// session so the benchmark degrades to gpuMs:null instead of timing out.
|
|
6786
|
+
static FENCE_2D_BUDGET_MS = 100;
|
|
6787
|
+
fence2dDisabled = !1;
|
|
6734
6788
|
// Video systems (multi-stream) - sparse array with reserved index contract:
|
|
6735
6789
|
// Index 0: Reserved for main video (with CV) - may be undefined if no main video
|
|
6736
6790
|
// Index 1..N: Additional streams (no CV)
|
|
@@ -6739,6 +6793,11 @@ class Fn {
|
|
|
6739
6793
|
videoSystems = [];
|
|
6740
6794
|
// WASM URLs for CV (resolved on the main thread, relayed to VideoSystem/CVSystem)
|
|
6741
6795
|
cvWasmUrls;
|
|
6796
|
+
// Canonical MediaPipe binary bytes, retained for the worker's lifetime so
|
|
6797
|
+
// every cv-tasks worker (one per video stream, plus restarts) can be handed
|
|
6798
|
+
// a structured-clone copy at init. See handleInit for why these aren't blob
|
|
6799
|
+
// URLs.
|
|
6800
|
+
cvWasmBinaries;
|
|
6742
6801
|
// Auto-capture for frame sources
|
|
6743
6802
|
autoCaptureEnabled = !1;
|
|
6744
6803
|
autoCaptureFormat = { flipY: !0 };
|
|
@@ -6858,7 +6917,7 @@ class Fn {
|
|
|
6858
6917
|
constructor() {
|
|
6859
6918
|
this.parameterSystem = new Cc((e, n) => {
|
|
6860
6919
|
this.postMessage(e, n);
|
|
6861
|
-
}), this.interactionSystem = new Lc(), this.videoSystems[0] = new
|
|
6920
|
+
}), this.interactionSystem = new Lc(), this.videoSystems[0] = new gn(), this.viji.video.cv = this.videoSystems[0].getCvSurface(), Object.assign(this.viji, this.interactionSystem.getInteractionAPIs()), this.viji.audio.getFrequencyData = () => this.audioFrequencyData, this.viji.audio.getWaveform = () => this.audioWaveformData, this.capabilityMonitor.setTransitionCallback((e) => {
|
|
6862
6921
|
this.postMessage("capability-transition", e);
|
|
6863
6922
|
}), this.setupMessageHandling();
|
|
6864
6923
|
}
|
|
@@ -6923,6 +6982,18 @@ class Fn {
|
|
|
6923
6982
|
const e = this.canvas.getContext("webgl2") || this.canvas.getContext("webgl");
|
|
6924
6983
|
return e && e.finish(), e;
|
|
6925
6984
|
}
|
|
6985
|
+
/**
|
|
6986
|
+
* The canvas context the scene actually locked, read from the runtime's
|
|
6987
|
+
* tracked ctx/gl (kept current by the getContext interceptor installed in
|
|
6988
|
+
* handleInit, so it's authoritative regardless of how the context was
|
|
6989
|
+
* acquired — useContext, adapter, or direct canvas.getContext). Returns
|
|
6990
|
+
* undefined until a context is acquired (before the first render).
|
|
6991
|
+
*/
|
|
6992
|
+
detectContextType() {
|
|
6993
|
+
if (this.gl)
|
|
6994
|
+
return typeof WebGL2RenderingContext < "u" && this.gl instanceof WebGL2RenderingContext ? "webgl2" : "webgl";
|
|
6995
|
+
if (this.ctx) return "2d";
|
|
6996
|
+
}
|
|
6926
6997
|
/**
|
|
6927
6998
|
* 2D-canvas fence for the benchmark: `getImageData(0,0,1,1)` forces a
|
|
6928
6999
|
* synchronous flush of pending raster operations (the canvas2D analogue of
|
|
@@ -6930,16 +7001,24 @@ class Fn {
|
|
|
6930
7001
|
* only) and the WebGL fence miss. Returns the flush time in ms, or null if
|
|
6931
7002
|
* there is no 2D context (or readback is unavailable). Benchmark-only — the
|
|
6932
7003
|
* capture path's 2D branch does not need this.
|
|
7004
|
+
*
|
|
7005
|
+
* WebKit caveat: `getImageData` there forces a full-canvas GPU→CPU readback
|
|
7006
|
+
* that is pathologically slow (~4x inflation), so a single readback over the
|
|
7007
|
+
* budget disables 2D fencing for the rest of the session — `gpuMs` degrades to
|
|
7008
|
+
* `null` instead of repeating the slow readback and timing out the RPC. (Use
|
|
7009
|
+
* steady-state `frameIntervalMs` for 2D raster cost on WebKit.)
|
|
6933
7010
|
*/
|
|
6934
7011
|
fence2dCanvas() {
|
|
6935
|
-
if (!this.canvas) return null;
|
|
7012
|
+
if (this.fence2dDisabled || !this.canvas) return null;
|
|
6936
7013
|
const e = this.canvas.getContext("2d");
|
|
6937
7014
|
if (!e) return null;
|
|
6938
7015
|
try {
|
|
6939
7016
|
const n = performance.now();
|
|
6940
|
-
|
|
7017
|
+
e.getImageData(0, 0, 1, 1);
|
|
7018
|
+
const r = performance.now() - n;
|
|
7019
|
+
return r > Yt.FENCE_2D_BUDGET_MS ? (this.fence2dDisabled = !0, null) : r;
|
|
6941
7020
|
} catch {
|
|
6942
|
-
return null;
|
|
7021
|
+
return this.fence2dDisabled = !0, null;
|
|
6943
7022
|
}
|
|
6944
7023
|
}
|
|
6945
7024
|
/**
|
|
@@ -6973,7 +7052,7 @@ class Fn {
|
|
|
6973
7052
|
});
|
|
6974
7053
|
return;
|
|
6975
7054
|
}
|
|
6976
|
-
this.benchmark = { id: e.id, remaining: n, samples: [], lastTimestamp: null };
|
|
7055
|
+
this.fence2dDisabled = !1, this.benchmark = { id: e.id, remaining: n, samples: [], lastTimestamp: null };
|
|
6977
7056
|
}
|
|
6978
7057
|
/**
|
|
6979
7058
|
* Record one fenced benchmark frame: fence the GPU, capture fence-accurate
|
|
@@ -7113,7 +7192,7 @@ class Fn {
|
|
|
7113
7192
|
updateVijiAudioStreams() {
|
|
7114
7193
|
const e = [];
|
|
7115
7194
|
for (const [n, r] of this.audioStreamStates)
|
|
7116
|
-
n >=
|
|
7195
|
+
n >= Yt.AUDIO_ADDITIONAL_BASE && n < Yt.AUDIO_DEVICE_BASE && e.push({ index: n, ...r });
|
|
7117
7196
|
e.sort((n, r) => n.index - r.index), this.viji.audioStreams.length = e.length;
|
|
7118
7197
|
for (let n = 0; n < e.length; n++) {
|
|
7119
7198
|
const r = e[n], i = r.frequencyData, o = r.waveformData;
|
|
@@ -7253,10 +7332,10 @@ class Fn {
|
|
|
7253
7332
|
const r = e.data.cvWasmFiles;
|
|
7254
7333
|
this.cvWasmUrls = {
|
|
7255
7334
|
simdLoaderJs: URL.createObjectURL(new Blob([r.simdLoaderJs], { type: "application/javascript" })),
|
|
7256
|
-
simdBinary: URL.createObjectURL(new Blob([r.simdBinary], { type: "application/wasm" })),
|
|
7257
7335
|
nosimdLoaderJs: URL.createObjectURL(new Blob([r.nosimdLoaderJs], { type: "application/javascript" })),
|
|
7258
|
-
|
|
7259
|
-
|
|
7336
|
+
simdBinary: "viji-cv-wasm:simd",
|
|
7337
|
+
nosimdBinary: "viji-cv-wasm:nosimd"
|
|
7338
|
+
}, this.cvWasmBinaries = { simdBinary: r.simdBinary, nosimdBinary: r.nosimdBinary }, this.videoSystems[0] && this.videoSystems[0].setCVWasmAssets(this.cvWasmUrls, this.cvWasmBinaries);
|
|
7260
7339
|
}
|
|
7261
7340
|
e.data.controlPort && (this.controlPort = e.data.controlPort, this.controlPort.onmessage = (r) => {
|
|
7262
7341
|
this.dispatchMessage(r.data);
|
|
@@ -7323,6 +7402,9 @@ class Fn {
|
|
|
7323
7402
|
effectiveRefreshRate: i,
|
|
7324
7403
|
frameRateMode: this.frameRateMode,
|
|
7325
7404
|
screenRefreshRate: this.screenRefreshRate,
|
|
7405
|
+
// The locked canvas context (authoritative; undefined until the scene
|
|
7406
|
+
// acquires one). Backs getSceneData().contextType.
|
|
7407
|
+
contextType: this.detectContextType(),
|
|
7326
7408
|
// Include CV stats if available
|
|
7327
7409
|
cv: o ? {
|
|
7328
7410
|
activeFeatures: o.activeFeatures,
|
|
@@ -7433,7 +7515,7 @@ class Fn {
|
|
|
7433
7515
|
const { streamIndex: n, streamType: r, deviceId: i } = e.data, o = n || 0;
|
|
7434
7516
|
let c = this.videoSystems[o];
|
|
7435
7517
|
const u = !!c;
|
|
7436
|
-
switch (c || (c = new
|
|
7518
|
+
switch (c || (c = new gn(), c.setDebugMode(this.debugMode), this.cvWasmUrls && this.cvWasmBinaries && c.setCVWasmAssets(this.cvWasmUrls, this.cvWasmBinaries), this.videoSystems[o] = c), c.setStreamType(r, i), c.handleCanvasSetup({
|
|
7437
7519
|
offscreenCanvas: e.data.offscreenCanvas,
|
|
7438
7520
|
width: e.data.width,
|
|
7439
7521
|
height: e.data.height,
|
|
@@ -7502,13 +7584,13 @@ class Fn {
|
|
|
7502
7584
|
this.debugLog(`[Compositor] Preparing ${r} direct frame slot(s) at base index ${n}`);
|
|
7503
7585
|
for (let i = 0; i < r; i++) {
|
|
7504
7586
|
const o = n + i;
|
|
7505
|
-
this.videoSystems[o] || (this.videoSystems[o] = new
|
|
7587
|
+
this.videoSystems[o] || (this.videoSystems[o] = new gn()), this.videoSystems[o].setDebugMode(this.debugMode), this.videoSystems[o].initializeForDirectFrames(this.rendererType);
|
|
7506
7588
|
}
|
|
7507
7589
|
this.updateVijiVideoStreams(), this.debugLog(`[Compositor] Prepared ${r} direct frame slot(s)`);
|
|
7508
7590
|
}
|
|
7509
7591
|
handleVideoFrameDirect(e) {
|
|
7510
7592
|
const n = e.data.streamIndex || 0;
|
|
7511
|
-
this.videoSystems[n] || (this.debugLog(`[Compositor] Creating new VideoSystem at index ${n} for direct frames`), this.videoSystems[n] = new
|
|
7593
|
+
this.videoSystems[n] || (this.debugLog(`[Compositor] Creating new VideoSystem at index ${n} for direct frames`), this.videoSystems[n] = new gn(), this.videoSystems[n].setDebugMode(this.debugMode), this.videoSystems[n].initializeForDirectFrames(this.rendererType)), this.videoSystems[n].handleDirectFrame(e.data);
|
|
7512
7594
|
}
|
|
7513
7595
|
handlePerformanceUpdate(e) {
|
|
7514
7596
|
this.debugLog("Performance update:", e.data);
|
|
@@ -8284,11 +8366,11 @@ var d;
|
|
|
8284
8366
|
t[t._namespace = z] = "_namespace";
|
|
8285
8367
|
const me = z + 1;
|
|
8286
8368
|
t[t._of = me] = "_of";
|
|
8287
|
-
const
|
|
8288
|
-
t[t._opaque =
|
|
8289
|
-
const
|
|
8290
|
-
t[t._out =
|
|
8291
|
-
const E =
|
|
8369
|
+
const b = me + 1;
|
|
8370
|
+
t[t._opaque = b] = "_opaque";
|
|
8371
|
+
const y = b + 1;
|
|
8372
|
+
t[t._out = y] = "_out";
|
|
8373
|
+
const E = y + 1;
|
|
8292
8374
|
t[t._override = E] = "_override";
|
|
8293
8375
|
const V = E + 1;
|
|
8294
8376
|
t[t._private = V] = "_private";
|
|
@@ -8368,10 +8450,10 @@ var s;
|
|
|
8368
8450
|
t[t.semi = z] = "semi";
|
|
8369
8451
|
const me = 17408;
|
|
8370
8452
|
t[t.colon = me] = "colon";
|
|
8371
|
-
const
|
|
8372
|
-
t[t.doubleColon =
|
|
8373
|
-
const
|
|
8374
|
-
t[t.dot =
|
|
8453
|
+
const b = 18432;
|
|
8454
|
+
t[t.doubleColon = b] = "doubleColon";
|
|
8455
|
+
const y = 19456;
|
|
8456
|
+
t[t.dot = y] = "dot";
|
|
8375
8457
|
const E = 20480;
|
|
8376
8458
|
t[t.question = E] = "question";
|
|
8377
8459
|
const V = 21504;
|
|
@@ -8428,8 +8510,8 @@ var s;
|
|
|
8428
8510
|
t[t.bitShiftL = Ie] = "bitShiftL";
|
|
8429
8511
|
const Re = 48137;
|
|
8430
8512
|
t[t.bitShiftR = Re] = "bitShiftR";
|
|
8431
|
-
const
|
|
8432
|
-
t[t.plus =
|
|
8513
|
+
const bt = 49802;
|
|
8514
|
+
t[t.plus = bt] = "plus";
|
|
8433
8515
|
const Pt = 50826;
|
|
8434
8516
|
t[t.minus = Pt] = "minus";
|
|
8435
8517
|
const qt = 51723;
|
|
@@ -8470,10 +8552,10 @@ var s;
|
|
|
8470
8552
|
t[t._do = pr] = "_do";
|
|
8471
8553
|
const gr = 69648;
|
|
8472
8554
|
t[t._else = gr] = "_else";
|
|
8473
|
-
const
|
|
8474
|
-
t[t._finally =
|
|
8475
|
-
const
|
|
8476
|
-
t[t._for =
|
|
8555
|
+
const yr = 70672;
|
|
8556
|
+
t[t._finally = yr] = "_finally";
|
|
8557
|
+
const br = 71696;
|
|
8558
|
+
t[t._for = br] = "_for";
|
|
8477
8559
|
const _r = 73232;
|
|
8478
8560
|
t[t._function = _r] = "_function";
|
|
8479
8561
|
const kr = 73744;
|
|
@@ -8552,10 +8634,10 @@ var s;
|
|
|
8552
8634
|
t[t._override = pc] = "_override";
|
|
8553
8635
|
const gc = 112144;
|
|
8554
8636
|
t[t._as = gc] = "_as";
|
|
8555
|
-
const
|
|
8556
|
-
t[t._enum =
|
|
8557
|
-
const
|
|
8558
|
-
t[t._type =
|
|
8637
|
+
const yc = 113168;
|
|
8638
|
+
t[t._enum = yc] = "_enum";
|
|
8639
|
+
const bc = 114192;
|
|
8640
|
+
t[t._type = bc] = "_type";
|
|
8559
8641
|
const _c = 115216;
|
|
8560
8642
|
t[t._implements = _c] = "_implements";
|
|
8561
8643
|
})(s || (s = {}));
|
|
@@ -8931,10 +9013,10 @@ var p;
|
|
|
8931
9013
|
t[t.digit2 = z] = "digit2";
|
|
8932
9014
|
const me = 51;
|
|
8933
9015
|
t[t.digit3 = me] = "digit3";
|
|
8934
|
-
const
|
|
8935
|
-
t[t.digit4 =
|
|
8936
|
-
const
|
|
8937
|
-
t[t.digit5 =
|
|
9016
|
+
const b = 52;
|
|
9017
|
+
t[t.digit4 = b] = "digit4";
|
|
9018
|
+
const y = 53;
|
|
9019
|
+
t[t.digit5 = y] = "digit5";
|
|
8938
9020
|
const E = 54;
|
|
8939
9021
|
t[t.digit6 = E] = "digit6";
|
|
8940
9022
|
const V = 55;
|
|
@@ -8991,8 +9073,8 @@ var p;
|
|
|
8991
9073
|
t[t.uppercaseP = Ie] = "uppercaseP";
|
|
8992
9074
|
const Re = 81;
|
|
8993
9075
|
t[t.uppercaseQ = Re] = "uppercaseQ";
|
|
8994
|
-
const
|
|
8995
|
-
t[t.uppercaseR =
|
|
9076
|
+
const bt = 82;
|
|
9077
|
+
t[t.uppercaseR = bt] = "uppercaseR";
|
|
8996
9078
|
const Pt = 83;
|
|
8997
9079
|
t[t.uppercaseS = Pt] = "uppercaseS";
|
|
8998
9080
|
const qt = 84;
|
|
@@ -9033,10 +9115,10 @@ var p;
|
|
|
9033
9115
|
t[t.lowercaseE = pr] = "lowercaseE";
|
|
9034
9116
|
const gr = 102;
|
|
9035
9117
|
t[t.lowercaseF = gr] = "lowercaseF";
|
|
9036
|
-
const
|
|
9037
|
-
t[t.lowercaseG =
|
|
9038
|
-
const
|
|
9039
|
-
t[t.lowercaseH =
|
|
9118
|
+
const yr = 103;
|
|
9119
|
+
t[t.lowercaseG = yr] = "lowercaseG";
|
|
9120
|
+
const br = 104;
|
|
9121
|
+
t[t.lowercaseH = br] = "lowercaseH";
|
|
9040
9122
|
const _r = 105;
|
|
9041
9123
|
t[t.lowercaseI = _r] = "lowercaseI";
|
|
9042
9124
|
const kr = 106;
|
|
@@ -9091,7 +9173,7 @@ var p;
|
|
|
9091
9173
|
t[t.paragraphSeparator = Wr] = "paragraphSeparator";
|
|
9092
9174
|
})(p || (p = {}));
|
|
9093
9175
|
let Hn, le, he, a, C, Wo;
|
|
9094
|
-
function
|
|
9176
|
+
function tn() {
|
|
9095
9177
|
return Wo++;
|
|
9096
9178
|
}
|
|
9097
9179
|
function z1(t) {
|
|
@@ -9119,7 +9201,7 @@ function q(t) {
|
|
|
9119
9201
|
return a.contextualKeyword === t;
|
|
9120
9202
|
}
|
|
9121
9203
|
function Os(t) {
|
|
9122
|
-
const e =
|
|
9204
|
+
const e = hn();
|
|
9123
9205
|
return e.type === s.name && e.contextualKeyword === t;
|
|
9124
9206
|
}
|
|
9125
9207
|
function Ee(t) {
|
|
@@ -9152,7 +9234,7 @@ function Ho() {
|
|
|
9152
9234
|
function Je() {
|
|
9153
9235
|
return _(s.semi) || Oe();
|
|
9154
9236
|
}
|
|
9155
|
-
function
|
|
9237
|
+
function ye() {
|
|
9156
9238
|
Je() || ne('Unexpected token, expected ";"');
|
|
9157
9239
|
}
|
|
9158
9240
|
function T(t) {
|
|
@@ -9223,9 +9305,9 @@ for (const t of Go)
|
|
|
9223
9305
|
Xe[t] = 0;
|
|
9224
9306
|
Xe[8232] = 0;
|
|
9225
9307
|
Xe[8233] = 0;
|
|
9226
|
-
const
|
|
9308
|
+
const ln = Xe.slice();
|
|
9227
9309
|
for (let t = p.digit0; t <= p.digit9; t++)
|
|
9228
|
-
|
|
9310
|
+
ln[t] = 0;
|
|
9229
9311
|
const Oi = new Int32Array([
|
|
9230
9312
|
// ""
|
|
9231
9313
|
-1,
|
|
@@ -18638,7 +18720,7 @@ function dt() {
|
|
|
18638
18720
|
a.tokens.push(new Gn()), a.start = a.pos, ku();
|
|
18639
18721
|
}
|
|
18640
18722
|
function su() {
|
|
18641
|
-
a.type === s.assign && --a.pos,
|
|
18723
|
+
a.type === s.assign && --a.pos, yu();
|
|
18642
18724
|
}
|
|
18643
18725
|
function se(t) {
|
|
18644
18726
|
for (let n = a.tokens.length - t; n < a.tokens.length; n++)
|
|
@@ -18659,7 +18741,7 @@ function Ko(t) {
|
|
|
18659
18741
|
function l(t) {
|
|
18660
18742
|
return a.type === t;
|
|
18661
18743
|
}
|
|
18662
|
-
function
|
|
18744
|
+
function be() {
|
|
18663
18745
|
const t = a.snapshot();
|
|
18664
18746
|
S();
|
|
18665
18747
|
const e = a.type;
|
|
@@ -18670,7 +18752,7 @@ class iu {
|
|
|
18670
18752
|
this.type = e, this.contextualKeyword = n;
|
|
18671
18753
|
}
|
|
18672
18754
|
}
|
|
18673
|
-
function
|
|
18755
|
+
function hn() {
|
|
18674
18756
|
const t = a.snapshot();
|
|
18675
18757
|
S();
|
|
18676
18758
|
const e = a.type, n = a.contextualKeyword;
|
|
@@ -18696,7 +18778,7 @@ function Jo() {
|
|
|
18696
18778
|
ou(C.charCodeAt(a.pos));
|
|
18697
18779
|
}
|
|
18698
18780
|
function ou(t) {
|
|
18699
|
-
|
|
18781
|
+
ln[t] || t === p.backslash || t === p.atSign && C.charCodeAt(a.pos + 1) === p.atSign ? J1() : sa(t);
|
|
18700
18782
|
}
|
|
18701
18783
|
function au() {
|
|
18702
18784
|
for (; C.charCodeAt(a.pos) !== p.asterisk || C.charCodeAt(a.pos + 1) !== p.slash; )
|
|
@@ -18890,7 +18972,7 @@ function sa(t) {
|
|
|
18890
18972
|
case p.digit0: {
|
|
18891
18973
|
const e = C.charCodeAt(a.pos + 1);
|
|
18892
18974
|
if (e === p.lowercaseX || e === p.uppercaseX || e === p.lowercaseO || e === p.uppercaseO || e === p.lowercaseB || e === p.uppercaseB) {
|
|
18893
|
-
|
|
18975
|
+
bu();
|
|
18894
18976
|
return;
|
|
18895
18977
|
}
|
|
18896
18978
|
}
|
|
@@ -18946,7 +19028,7 @@ function sa(t) {
|
|
|
18946
19028
|
function fe(t, e) {
|
|
18947
19029
|
a.pos += e, te(t);
|
|
18948
19030
|
}
|
|
18949
|
-
function
|
|
19031
|
+
function yu() {
|
|
18950
19032
|
const t = a.pos;
|
|
18951
19033
|
let e = !1, n = !1;
|
|
18952
19034
|
for (; ; ) {
|
|
@@ -18979,7 +19061,7 @@ function ts() {
|
|
|
18979
19061
|
break;
|
|
18980
19062
|
}
|
|
18981
19063
|
}
|
|
18982
|
-
function
|
|
19064
|
+
function bu() {
|
|
18983
19065
|
for (a.pos += 2; ; ) {
|
|
18984
19066
|
const e = C.charCodeAt(a.pos);
|
|
18985
19067
|
if (e >= p.digit0 && e <= p.digit9 || e >= p.lowercaseA && e <= p.lowercaseF || e >= p.uppercaseA && e <= p.uppercaseF || e === p.underscore)
|
|
@@ -19055,9 +19137,9 @@ function vu() {
|
|
|
19055
19137
|
break;
|
|
19056
19138
|
}
|
|
19057
19139
|
}
|
|
19058
|
-
function
|
|
19140
|
+
function nn(t, e = t.currentIndex()) {
|
|
19059
19141
|
let n = e + 1;
|
|
19060
|
-
if (
|
|
19142
|
+
if (_n(t, n)) {
|
|
19061
19143
|
const r = t.identifierNameAtIndex(e);
|
|
19062
19144
|
return {
|
|
19063
19145
|
isType: !1,
|
|
@@ -19066,21 +19148,21 @@ function tn(t, e = t.currentIndex()) {
|
|
|
19066
19148
|
endIndex: n
|
|
19067
19149
|
};
|
|
19068
19150
|
}
|
|
19069
|
-
if (n++,
|
|
19151
|
+
if (n++, _n(t, n))
|
|
19070
19152
|
return {
|
|
19071
19153
|
isType: !0,
|
|
19072
19154
|
leftName: null,
|
|
19073
19155
|
rightName: null,
|
|
19074
19156
|
endIndex: n
|
|
19075
19157
|
};
|
|
19076
|
-
if (n++,
|
|
19158
|
+
if (n++, _n(t, n))
|
|
19077
19159
|
return {
|
|
19078
19160
|
isType: !1,
|
|
19079
19161
|
leftName: t.identifierNameAtIndex(e),
|
|
19080
19162
|
rightName: t.identifierNameAtIndex(e + 2),
|
|
19081
19163
|
endIndex: n
|
|
19082
19164
|
};
|
|
19083
|
-
if (n++,
|
|
19165
|
+
if (n++, _n(t, n))
|
|
19084
19166
|
return {
|
|
19085
19167
|
isType: !0,
|
|
19086
19168
|
leftName: null,
|
|
@@ -19089,7 +19171,7 @@ function tn(t, e = t.currentIndex()) {
|
|
|
19089
19171
|
};
|
|
19090
19172
|
throw new Error(`Unexpected import/export specifier at ${e}`);
|
|
19091
19173
|
}
|
|
19092
|
-
function
|
|
19174
|
+
function _n(t, e) {
|
|
19093
19175
|
const n = t.tokens[e];
|
|
19094
19176
|
return n.type === s.braceR || n.type === s.comma;
|
|
19095
19177
|
}
|
|
@@ -19931,7 +20013,7 @@ class kt {
|
|
|
19931
20013
|
e++;
|
|
19932
20014
|
break;
|
|
19933
20015
|
}
|
|
19934
|
-
const r =
|
|
20016
|
+
const r = nn(this.tokens, e);
|
|
19935
20017
|
if (e = r.endIndex, r.isType || n.push({
|
|
19936
20018
|
importedName: r.leftName,
|
|
19937
20019
|
localName: r.rightName
|
|
@@ -20120,23 +20202,23 @@ var xt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
20120
20202
|
function W(L, j) {
|
|
20121
20203
|
const O = j <= 4, J = L.path.split("/");
|
|
20122
20204
|
let ae = 1, ee = 0, z = !1;
|
|
20123
|
-
for (let
|
|
20124
|
-
const
|
|
20125
|
-
if (!
|
|
20205
|
+
for (let b = 1; b < J.length; b++) {
|
|
20206
|
+
const y = J[b];
|
|
20207
|
+
if (!y) {
|
|
20126
20208
|
z = !0;
|
|
20127
20209
|
continue;
|
|
20128
20210
|
}
|
|
20129
|
-
if (z = !1,
|
|
20130
|
-
if (
|
|
20131
|
-
ee ? (z = !0, ee--, ae--) : O && (J[ae++] =
|
|
20211
|
+
if (z = !1, y !== ".") {
|
|
20212
|
+
if (y === "..") {
|
|
20213
|
+
ee ? (z = !0, ee--, ae--) : O && (J[ae++] = y);
|
|
20132
20214
|
continue;
|
|
20133
20215
|
}
|
|
20134
|
-
J[ae++] =
|
|
20216
|
+
J[ae++] = y, ee++;
|
|
20135
20217
|
}
|
|
20136
20218
|
}
|
|
20137
20219
|
let me = "";
|
|
20138
|
-
for (let
|
|
20139
|
-
me += "/" + J[
|
|
20220
|
+
for (let b = 1; b < ae; b++)
|
|
20221
|
+
me += "/" + J[b];
|
|
20140
20222
|
(!me || z && !me.endsWith("/..")) && (me += "/"), L.path = me;
|
|
20141
20223
|
}
|
|
20142
20224
|
function K(L, j) {
|
|
@@ -20898,7 +20980,7 @@ var rl = (
|
|
|
20898
20980
|
});
|
|
20899
20981
|
}
|
|
20900
20982
|
function ee(k, x) {
|
|
20901
|
-
return x instanceof
|
|
20983
|
+
return x instanceof y ? new E(k, x.ttype, !0) : new E(k, i(x), !1);
|
|
20902
20984
|
}
|
|
20903
20985
|
function z(k, x) {
|
|
20904
20986
|
return new me(k, ae(x));
|
|
@@ -20928,14 +21010,14 @@ var rl = (
|
|
|
20928
21010
|
if (!Z[Re](ke, Ie))
|
|
20929
21011
|
return !1;
|
|
20930
21012
|
for (var Re = 0; Re < ue.length; Re++) {
|
|
20931
|
-
var
|
|
21013
|
+
var bt = G.props[Re].name, Pt = ke[bt];
|
|
20932
21014
|
if (Pt === void 0) {
|
|
20933
21015
|
if (de[Re])
|
|
20934
|
-
return Ie.fail(
|
|
21016
|
+
return Ie.fail(bt, "is missing", 1);
|
|
20935
21017
|
} else {
|
|
20936
21018
|
var qt = ue[Re](Pt, Ie);
|
|
20937
21019
|
if (!qt)
|
|
20938
|
-
return Ie.fail(
|
|
21020
|
+
return Ie.fail(bt, null, 1);
|
|
20939
21021
|
}
|
|
20940
21022
|
}
|
|
20941
21023
|
return !0;
|
|
@@ -20957,11 +21039,11 @@ var rl = (
|
|
|
20957
21039
|
}(r)
|
|
20958
21040
|
);
|
|
20959
21041
|
t.TIface = me;
|
|
20960
|
-
function
|
|
20961
|
-
return new
|
|
21042
|
+
function b(k) {
|
|
21043
|
+
return new y(i(k));
|
|
20962
21044
|
}
|
|
20963
|
-
t.opt =
|
|
20964
|
-
var
|
|
21045
|
+
t.opt = b;
|
|
21046
|
+
var y = (
|
|
20965
21047
|
/** @class */
|
|
20966
21048
|
function(k) {
|
|
20967
21049
|
e(x, k);
|
|
@@ -20977,7 +21059,7 @@ var rl = (
|
|
|
20977
21059
|
}, x;
|
|
20978
21060
|
}(r)
|
|
20979
21061
|
);
|
|
20980
|
-
t.TOptional =
|
|
21062
|
+
t.TOptional = y;
|
|
20981
21063
|
var E = (
|
|
20982
21064
|
/** @class */
|
|
20983
21065
|
/* @__PURE__ */ function() {
|
|
@@ -21329,7 +21411,7 @@ function ma() {
|
|
|
21329
21411
|
function pa(t) {
|
|
21330
21412
|
S(), Xn(t);
|
|
21331
21413
|
}
|
|
21332
|
-
function
|
|
21414
|
+
function yt(t) {
|
|
21333
21415
|
Q(), js(t);
|
|
21334
21416
|
}
|
|
21335
21417
|
function Dn() {
|
|
@@ -21348,7 +21430,7 @@ function Xn(t) {
|
|
|
21348
21430
|
}
|
|
21349
21431
|
case s._yield:
|
|
21350
21432
|
case s.name: {
|
|
21351
|
-
a.type = s.name,
|
|
21433
|
+
a.type = s.name, yt(t);
|
|
21352
21434
|
return;
|
|
21353
21435
|
}
|
|
21354
21436
|
case s.bracketL: {
|
|
@@ -21395,7 +21477,7 @@ function ll(t, e) {
|
|
|
21395
21477
|
);
|
|
21396
21478
|
}
|
|
21397
21479
|
function ga() {
|
|
21398
|
-
he ? Rf() : le &&
|
|
21480
|
+
he ? Rf() : le && bh();
|
|
21399
21481
|
}
|
|
21400
21482
|
function Un(t, e = !1) {
|
|
21401
21483
|
if (e || Xn(t), !_(s.eq))
|
|
@@ -21409,19 +21491,19 @@ function ps() {
|
|
|
21409
21491
|
function hl() {
|
|
21410
21492
|
return l(s.name) || !!(a.type & s.IS_KEYWORD) || l(s.string) || l(s.num) || l(s.bigint) || l(s.decimal);
|
|
21411
21493
|
}
|
|
21412
|
-
function
|
|
21494
|
+
function ya() {
|
|
21413
21495
|
const t = a.snapshot();
|
|
21414
21496
|
return S(), (l(s.bracketL) || l(s.braceL) || l(s.star) || l(s.ellipsis) || l(s.hash) || hl()) && !Fe() ? !0 : (a.restoreFromSnapshot(t), !1);
|
|
21415
21497
|
}
|
|
21416
21498
|
function qs(t) {
|
|
21417
|
-
for (;
|
|
21499
|
+
for (; ba(t) !== null; )
|
|
21418
21500
|
;
|
|
21419
21501
|
}
|
|
21420
|
-
function
|
|
21502
|
+
function ba(t) {
|
|
21421
21503
|
if (!l(s.name))
|
|
21422
21504
|
return null;
|
|
21423
21505
|
const e = a.contextualKeyword;
|
|
21424
|
-
if (t.indexOf(e) !== -1 &&
|
|
21506
|
+
if (t.indexOf(e) !== -1 && ya()) {
|
|
21425
21507
|
switch (e) {
|
|
21426
21508
|
case d._readonly:
|
|
21427
21509
|
a.tokens[a.tokens.length - 1].type = s._readonly;
|
|
@@ -21452,24 +21534,24 @@ function ya(t) {
|
|
|
21452
21534
|
}
|
|
21453
21535
|
return null;
|
|
21454
21536
|
}
|
|
21455
|
-
function
|
|
21537
|
+
function fn() {
|
|
21456
21538
|
for (Q(); _(s.dot); )
|
|
21457
21539
|
Q();
|
|
21458
21540
|
}
|
|
21459
21541
|
function fl() {
|
|
21460
|
-
|
|
21542
|
+
fn(), !Fe() && l(s.lessThan) && jt();
|
|
21461
21543
|
}
|
|
21462
21544
|
function dl() {
|
|
21463
|
-
S(),
|
|
21545
|
+
S(), dn();
|
|
21464
21546
|
}
|
|
21465
21547
|
function ml() {
|
|
21466
21548
|
S();
|
|
21467
21549
|
}
|
|
21468
21550
|
function pl() {
|
|
21469
|
-
T(s._typeof), l(s._import) ? _a() :
|
|
21551
|
+
T(s._typeof), l(s._import) ? _a() : fn(), !Fe() && l(s.lessThan) && jt();
|
|
21470
21552
|
}
|
|
21471
21553
|
function _a() {
|
|
21472
|
-
T(s._import), T(s.parenL), T(s.string), T(s.parenR), _(s.dot) &&
|
|
21554
|
+
T(s._import), T(s.parenL), T(s.string), T(s.parenR), _(s.dot) && fn(), l(s.lessThan) && jt();
|
|
21473
21555
|
}
|
|
21474
21556
|
function gl() {
|
|
21475
21557
|
_(s._const);
|
|
@@ -21487,31 +21569,31 @@ function zn() {
|
|
|
21487
21569
|
}
|
|
21488
21570
|
function Ws(t) {
|
|
21489
21571
|
const e = t === s.arrow;
|
|
21490
|
-
Lt(), T(s.parenL), a.scopeDepth++,
|
|
21572
|
+
Lt(), T(s.parenL), a.scopeDepth++, yl(
|
|
21491
21573
|
!1
|
|
21492
21574
|
/* isBlockScope */
|
|
21493
|
-
), a.scopeDepth--, (e || l(t)) &&
|
|
21575
|
+
), a.scopeDepth--, (e || l(t)) && rn(t);
|
|
21494
21576
|
}
|
|
21495
|
-
function
|
|
21577
|
+
function yl(t) {
|
|
21496
21578
|
$s(s.parenR, t);
|
|
21497
21579
|
}
|
|
21498
21580
|
function Mn() {
|
|
21499
|
-
_(s.comma) ||
|
|
21581
|
+
_(s.comma) || ye();
|
|
21500
21582
|
}
|
|
21501
21583
|
function Xi() {
|
|
21502
21584
|
Ws(s.colon), Mn();
|
|
21503
21585
|
}
|
|
21504
|
-
function
|
|
21586
|
+
function bl() {
|
|
21505
21587
|
const t = a.snapshot();
|
|
21506
21588
|
S();
|
|
21507
21589
|
const e = _(s.name) && l(s.colon);
|
|
21508
21590
|
return a.restoreFromSnapshot(t), e;
|
|
21509
21591
|
}
|
|
21510
21592
|
function ka() {
|
|
21511
|
-
if (!(l(s.bracketL) &&
|
|
21593
|
+
if (!(l(s.bracketL) && bl()))
|
|
21512
21594
|
return !1;
|
|
21513
21595
|
const t = se(0);
|
|
21514
|
-
return T(s.bracketL), Q(),
|
|
21596
|
+
return T(s.bracketL), Q(), dn(), T(s.bracketR), Vt(), Mn(), re(t), !0;
|
|
21515
21597
|
}
|
|
21516
21598
|
function zi(t) {
|
|
21517
21599
|
_(s.question), !t && (l(s.parenL) || l(s.lessThan)) ? (Ws(s.colon), Mn()) : (Vt(), Mn());
|
|
@@ -21525,8 +21607,8 @@ function _l() {
|
|
|
21525
21607
|
S(), l(s.parenL) || l(s.lessThan) ? Xi() : zi(!1);
|
|
21526
21608
|
return;
|
|
21527
21609
|
}
|
|
21528
|
-
const t = !!
|
|
21529
|
-
ka() || ((q(d._get) || q(d._set)) &&
|
|
21610
|
+
const t = !!ba([d._readonly]);
|
|
21611
|
+
ka() || ((q(d._get) || q(d._set)) && ya(), sn(
|
|
21530
21612
|
-1
|
|
21531
21613
|
/* Types don't need context IDs. */
|
|
21532
21614
|
), zi(t));
|
|
@@ -21549,7 +21631,7 @@ function El() {
|
|
|
21549
21631
|
Q(), T(s._in), _e();
|
|
21550
21632
|
}
|
|
21551
21633
|
function Tl() {
|
|
21552
|
-
T(s.braceL), l(s.plus) || l(s.minus) ? (S(), ve(d._readonly)) : Ee(d._readonly), T(s.bracketL), El(), Ee(d._as) && _e(), T(s.bracketR), l(s.plus) || l(s.minus) ? (S(), T(s.question)) : _(s.question), Ol(),
|
|
21634
|
+
T(s.braceL), l(s.plus) || l(s.minus) ? (S(), ve(d._readonly)) : Ee(d._readonly), T(s.bracketL), El(), Ee(d._as) && _e(), T(s.bracketR), l(s.plus) || l(s.minus) ? (S(), T(s.question)) : _(s.question), Ol(), ye(), T(s.braceR);
|
|
21553
21635
|
}
|
|
21554
21636
|
function Sl() {
|
|
21555
21637
|
for (T(s.bracketL); !_(s.bracketR) && !a.error; )
|
|
@@ -21683,15 +21765,15 @@ function Ul() {
|
|
|
21683
21765
|
function Ml() {
|
|
21684
21766
|
return S(), !!(l(s.parenR) || l(s.ellipsis) || Dl() && (l(s.colon) || l(s.comma) || l(s.question) || l(s.eq) || l(s.parenR) && (S(), l(s.arrow))));
|
|
21685
21767
|
}
|
|
21686
|
-
function
|
|
21768
|
+
function rn(t) {
|
|
21687
21769
|
const e = se(0);
|
|
21688
21770
|
T(t), Bl() || _e(), re(e);
|
|
21689
21771
|
}
|
|
21690
21772
|
function Nl() {
|
|
21691
|
-
l(s.colon) &&
|
|
21773
|
+
l(s.colon) && rn(s.colon);
|
|
21692
21774
|
}
|
|
21693
21775
|
function Vt() {
|
|
21694
|
-
l(s.colon) &&
|
|
21776
|
+
l(s.colon) && dn();
|
|
21695
21777
|
}
|
|
21696
21778
|
function Ol() {
|
|
21697
21779
|
_(s.colon) && _e();
|
|
@@ -21700,7 +21782,7 @@ function Bl() {
|
|
|
21700
21782
|
const t = a.snapshot();
|
|
21701
21783
|
return q(d._asserts) ? (S(), Ee(d._is) ? (_e(), !0) : ps() || l(s._this) ? (S(), Ee(d._is) && _e(), !0) : (a.restoreFromSnapshot(t), !1)) : ps() || l(s._this) ? (S(), q(d._is) && !Fe() ? (S(), _e(), !0) : (a.restoreFromSnapshot(t), !1)) : !1;
|
|
21702
21784
|
}
|
|
21703
|
-
function
|
|
21785
|
+
function dn() {
|
|
21704
21786
|
const t = se(0);
|
|
21705
21787
|
T(s.colon), _e(), re(t);
|
|
21706
21788
|
}
|
|
@@ -21711,7 +21793,7 @@ function _e() {
|
|
|
21711
21793
|
a.inDisallowConditionalTypesContext = !0, Ki(), a.inDisallowConditionalTypesContext = t, T(s.question), _e(), T(s.colon), _e();
|
|
21712
21794
|
}
|
|
21713
21795
|
function Vl() {
|
|
21714
|
-
return q(d._abstract) &&
|
|
21796
|
+
return q(d._abstract) && be() === s._new;
|
|
21715
21797
|
}
|
|
21716
21798
|
function Ki() {
|
|
21717
21799
|
if (Pl()) {
|
|
@@ -21729,7 +21811,7 @@ function Ki() {
|
|
|
21729
21811
|
}
|
|
21730
21812
|
function jl() {
|
|
21731
21813
|
const t = se(1);
|
|
21732
|
-
_e(), T(s.greaterThan), re(t),
|
|
21814
|
+
_e(), T(s.greaterThan), re(t), mn();
|
|
21733
21815
|
}
|
|
21734
21816
|
function $l() {
|
|
21735
21817
|
if (_(s.jsxTagStart)) {
|
|
@@ -21745,13 +21827,13 @@ function wa() {
|
|
|
21745
21827
|
ql(), _(s.comma);
|
|
21746
21828
|
}
|
|
21747
21829
|
function ql() {
|
|
21748
|
-
|
|
21830
|
+
fn(), l(s.lessThan) && jt();
|
|
21749
21831
|
}
|
|
21750
21832
|
function Wl() {
|
|
21751
|
-
|
|
21833
|
+
yt(!1), Lt(), _(s._extends) && wa(), va();
|
|
21752
21834
|
}
|
|
21753
21835
|
function Hl() {
|
|
21754
|
-
|
|
21836
|
+
yt(!1), Lt(), T(s.eq), _e(), ye();
|
|
21755
21837
|
}
|
|
21756
21838
|
function Gl() {
|
|
21757
21839
|
if (l(s.string) ? Bt() : Q(), _(s.eq)) {
|
|
@@ -21760,7 +21842,7 @@ function Gl() {
|
|
|
21760
21842
|
}
|
|
21761
21843
|
}
|
|
21762
21844
|
function Hs() {
|
|
21763
|
-
for (
|
|
21845
|
+
for (yt(!1), T(s.braceL); !_(s.braceR) && !a.error; )
|
|
21764
21846
|
Gl(), _(s.comma);
|
|
21765
21847
|
}
|
|
21766
21848
|
function Gs() {
|
|
@@ -21769,20 +21851,20 @@ function Gs() {
|
|
|
21769
21851
|
s.braceR
|
|
21770
21852
|
);
|
|
21771
21853
|
}
|
|
21772
|
-
function
|
|
21773
|
-
|
|
21854
|
+
function ys() {
|
|
21855
|
+
yt(!1), _(s.dot) ? ys() : Gs();
|
|
21774
21856
|
}
|
|
21775
21857
|
function Ea() {
|
|
21776
|
-
q(d._global) ? Q() : l(s.string) ? at() : ne(), l(s.braceL) ? Gs() :
|
|
21858
|
+
q(d._global) ? Q() : l(s.string) ? at() : ne(), l(s.braceL) ? Gs() : ye();
|
|
21777
21859
|
}
|
|
21778
|
-
function
|
|
21779
|
-
Dn(), T(s.eq), zl(),
|
|
21860
|
+
function bs() {
|
|
21861
|
+
Dn(), T(s.eq), zl(), ye();
|
|
21780
21862
|
}
|
|
21781
21863
|
function Xl() {
|
|
21782
|
-
return q(d._require) &&
|
|
21864
|
+
return q(d._require) && be() === s.parenL;
|
|
21783
21865
|
}
|
|
21784
21866
|
function zl() {
|
|
21785
|
-
Xl() ? Yl() :
|
|
21867
|
+
Xl() ? Yl() : fn();
|
|
21786
21868
|
}
|
|
21787
21869
|
function Yl() {
|
|
21788
21870
|
ve(d._require), T(s.parenL), l(s.string) || ne(), Bt(), T(s.parenR);
|
|
@@ -21818,7 +21900,7 @@ function Kl() {
|
|
|
21818
21900
|
case s._var:
|
|
21819
21901
|
case s._let: {
|
|
21820
21902
|
const t = se(1);
|
|
21821
|
-
return
|
|
21903
|
+
return Tn(a.type !== s._var), re(t), !0;
|
|
21822
21904
|
}
|
|
21823
21905
|
case s.name: {
|
|
21824
21906
|
const t = se(1), e = a.contextualKeyword;
|
|
@@ -21889,14 +21971,14 @@ function Yn(t, e) {
|
|
|
21889
21971
|
return Ea(), re(n), !0;
|
|
21890
21972
|
} else if (l(s.name)) {
|
|
21891
21973
|
const n = se(e ? 2 : 1);
|
|
21892
|
-
return
|
|
21974
|
+
return ys(), re(n), !0;
|
|
21893
21975
|
}
|
|
21894
21976
|
}
|
|
21895
21977
|
break;
|
|
21896
21978
|
case d._namespace:
|
|
21897
21979
|
if (Dt(e) && l(s.name)) {
|
|
21898
21980
|
const n = se(e ? 2 : 1);
|
|
21899
|
-
return
|
|
21981
|
+
return ys(), re(n), !0;
|
|
21900
21982
|
}
|
|
21901
21983
|
break;
|
|
21902
21984
|
case d._type:
|
|
@@ -21913,7 +21995,7 @@ function Dt(t) {
|
|
|
21913
21995
|
}
|
|
21914
21996
|
function Ql() {
|
|
21915
21997
|
const t = a.snapshot();
|
|
21916
|
-
return zn(), $t(), Nl(), T(s.arrow), a.error ? (a.restoreFromSnapshot(t), !1) : (
|
|
21998
|
+
return zn(), $t(), Nl(), T(s.arrow), a.error ? (a.restoreFromSnapshot(t), !1) : (pn(!0), !0);
|
|
21917
21999
|
}
|
|
21918
22000
|
function Xs() {
|
|
21919
22001
|
a.type === s.bitShiftL && (a.pos -= 1, te(s.lessThan)), jt();
|
|
@@ -21939,13 +22021,13 @@ function Ta() {
|
|
|
21939
22021
|
return !1;
|
|
21940
22022
|
}
|
|
21941
22023
|
function Jl(t, e) {
|
|
21942
|
-
if (l(s.colon) &&
|
|
22024
|
+
if (l(s.colon) && rn(s.colon), !l(s.braceL) && Je()) {
|
|
21943
22025
|
let n = a.tokens.length - 1;
|
|
21944
22026
|
for (; n >= 0 && (a.tokens[n].start >= t || a.tokens[n].type === s._default || a.tokens[n].type === s._export); )
|
|
21945
22027
|
a.tokens[n].isType = !0, n--;
|
|
21946
22028
|
return;
|
|
21947
22029
|
}
|
|
21948
|
-
|
|
22030
|
+
pn(!1, e);
|
|
21949
22031
|
}
|
|
21950
22032
|
function eh(t, e, n) {
|
|
21951
22033
|
if (!Fe() && _(s.bang)) {
|
|
@@ -21967,18 +22049,18 @@ function eh(t, e, n) {
|
|
|
21967
22049
|
a.restoreFromSnapshot(r);
|
|
21968
22050
|
else
|
|
21969
22051
|
return;
|
|
21970
|
-
} else !e && l(s.questionDot) &&
|
|
22052
|
+
} else !e && l(s.questionDot) && be() === s.lessThan && (S(), a.tokens[t].isOptionalChainStart = !0, a.tokens[a.tokens.length - 1].subscriptStartIndex = t, jt(), T(s.parenL), pt());
|
|
21971
22053
|
Ys(t, e, n);
|
|
21972
22054
|
}
|
|
21973
22055
|
function th() {
|
|
21974
22056
|
if (_(s._import))
|
|
21975
|
-
return q(d._type) &&
|
|
22057
|
+
return q(d._type) && be() !== s.eq && ve(d._type), bs(), !0;
|
|
21976
22058
|
if (_(s.eq))
|
|
21977
|
-
return xe(),
|
|
22059
|
+
return xe(), ye(), !0;
|
|
21978
22060
|
if (Ee(d._as))
|
|
21979
|
-
return ve(d._namespace), Q(),
|
|
22061
|
+
return ve(d._namespace), Q(), ye(), !0;
|
|
21980
22062
|
if (q(d._type)) {
|
|
21981
|
-
const t =
|
|
22063
|
+
const t = be();
|
|
21982
22064
|
(t === s.braceL || t === s.star) && S();
|
|
21983
22065
|
}
|
|
21984
22066
|
return !1;
|
|
@@ -22014,7 +22096,7 @@ function rh() {
|
|
|
22014
22096
|
Q(), a.tokens[a.tokens.length - 3].identifierRole = X.ExportAccess, a.tokens[a.tokens.length - 4].isType = !0, a.tokens[a.tokens.length - 3].isType = !0, a.tokens[a.tokens.length - 2].isType = !0, a.tokens[a.tokens.length - 1].isType = !0;
|
|
22015
22097
|
}
|
|
22016
22098
|
function sh() {
|
|
22017
|
-
if (q(d._abstract) &&
|
|
22099
|
+
if (q(d._abstract) && be() === s._class)
|
|
22018
22100
|
return a.type = s._abstract, S(), Rt(!0, !0), !0;
|
|
22019
22101
|
if (q(d._interface)) {
|
|
22020
22102
|
const t = se(2);
|
|
@@ -22024,7 +22106,7 @@ function sh() {
|
|
|
22024
22106
|
}
|
|
22025
22107
|
function ih() {
|
|
22026
22108
|
if (a.type === s._const) {
|
|
22027
|
-
const t =
|
|
22109
|
+
const t = hn();
|
|
22028
22110
|
if (t.type === s.name && t.contextualKeyword === d._enum)
|
|
22029
22111
|
return T(s._const), ve(d._enum), a.tokens[a.tokens.length - 1].type = s._enum, Hs(), !0;
|
|
22030
22112
|
}
|
|
@@ -22049,7 +22131,7 @@ function oh(t) {
|
|
|
22049
22131
|
return !1;
|
|
22050
22132
|
}
|
|
22051
22133
|
function ah(t) {
|
|
22052
|
-
Zl(t) ||
|
|
22134
|
+
Zl(t) || ye();
|
|
22053
22135
|
}
|
|
22054
22136
|
function ch() {
|
|
22055
22137
|
const t = Ee(d._declare);
|
|
@@ -22086,7 +22168,7 @@ function fh() {
|
|
|
22086
22168
|
Fe() || _(s.bang), Vt(), re(t);
|
|
22087
22169
|
}
|
|
22088
22170
|
function dh() {
|
|
22089
|
-
l(s.colon) &&
|
|
22171
|
+
l(s.colon) && dn();
|
|
22090
22172
|
}
|
|
22091
22173
|
function mh(t, e) {
|
|
22092
22174
|
return Hn ? ph(t, e) : gh(t, e);
|
|
@@ -22114,14 +22196,14 @@ function gh(t, e) {
|
|
|
22114
22196
|
return r;
|
|
22115
22197
|
return tt(t, e);
|
|
22116
22198
|
}
|
|
22117
|
-
function
|
|
22199
|
+
function yh() {
|
|
22118
22200
|
if (l(s.colon)) {
|
|
22119
22201
|
const t = a.snapshot();
|
|
22120
|
-
|
|
22202
|
+
rn(s.colon), Oe() && ne(), l(s.arrow) || ne(), a.error && a.restoreFromSnapshot(t);
|
|
22121
22203
|
}
|
|
22122
22204
|
return _(s.arrow);
|
|
22123
22205
|
}
|
|
22124
|
-
function
|
|
22206
|
+
function bh() {
|
|
22125
22207
|
const t = se(0);
|
|
22126
22208
|
_(s.question), Vt(), re(t);
|
|
22127
22209
|
}
|
|
@@ -22267,7 +22349,7 @@ function Ia() {
|
|
|
22267
22349
|
function je() {
|
|
22268
22350
|
a.tokens.push(new Gn()), ta(), a.start = a.pos;
|
|
22269
22351
|
const t = C.charCodeAt(a.pos);
|
|
22270
|
-
if (
|
|
22352
|
+
if (ln[t])
|
|
22271
22353
|
wh();
|
|
22272
22354
|
else if (t === p.quotationMark || t === p.apostrophe)
|
|
22273
22355
|
vh(t);
|
|
@@ -22303,14 +22385,14 @@ function Ut() {
|
|
|
22303
22385
|
}
|
|
22304
22386
|
function Ah(t) {
|
|
22305
22387
|
if (l(s.question)) {
|
|
22306
|
-
const e =
|
|
22388
|
+
const e = be();
|
|
22307
22389
|
if (e === s.colon || e === s.comma || e === s.parenR)
|
|
22308
22390
|
return;
|
|
22309
22391
|
}
|
|
22310
22392
|
Ra(t);
|
|
22311
22393
|
}
|
|
22312
22394
|
function Ih() {
|
|
22313
|
-
Ko(s.question), l(s.colon) && (le ?
|
|
22395
|
+
Ko(s.question), l(s.colon) && (le ? dn() : he && Ft());
|
|
22314
22396
|
}
|
|
22315
22397
|
class Rh {
|
|
22316
22398
|
constructor(e) {
|
|
@@ -22343,12 +22425,12 @@ function Ra(t) {
|
|
|
22343
22425
|
}
|
|
22344
22426
|
function Fh(t) {
|
|
22345
22427
|
const e = a.tokens.length;
|
|
22346
|
-
return
|
|
22428
|
+
return mn() ? !0 : (wn(e, -1, t), !1);
|
|
22347
22429
|
}
|
|
22348
|
-
function
|
|
22430
|
+
function wn(t, e, n) {
|
|
22349
22431
|
if (le && (s._in & s.PRECEDENCE_MASK) > e && !Fe() && (Ee(d._as) || Ee(d._satisfies))) {
|
|
22350
22432
|
const i = se(1);
|
|
22351
|
-
_e(), re(i), ra(),
|
|
22433
|
+
_e(), re(i), ra(), wn(t, e, n);
|
|
22352
22434
|
return;
|
|
22353
22435
|
}
|
|
22354
22436
|
const r = a.type & s.PRECEDENCE_MASK;
|
|
@@ -22356,16 +22438,16 @@ function vn(t, e, n) {
|
|
|
22356
22438
|
const i = a.type;
|
|
22357
22439
|
S(), i === s.nullishCoalescing && (a.tokens[a.tokens.length - 1].nullishStartIndex = t);
|
|
22358
22440
|
const o = a.tokens.length;
|
|
22359
|
-
|
|
22441
|
+
mn(), wn(o, i & s.IS_RIGHT_ASSOCIATIVE ? r - 1 : r, n), i === s.nullishCoalescing && (a.tokens[t].numNullishCoalesceStarts++, a.tokens[a.tokens.length - 1].numNullishCoalesceEnds++), wn(t, e, n);
|
|
22360
22442
|
}
|
|
22361
22443
|
}
|
|
22362
|
-
function
|
|
22444
|
+
function mn() {
|
|
22363
22445
|
if (le && !Hn && _(s.lessThan))
|
|
22364
22446
|
return jl(), !1;
|
|
22365
22447
|
if (q(d._module) && Qo() === p.leftCurlyBrace && !Ho())
|
|
22366
22448
|
return Gh(), !1;
|
|
22367
22449
|
if (a.type & s.IS_PREFIX)
|
|
22368
|
-
return S(),
|
|
22450
|
+
return S(), mn(), !1;
|
|
22369
22451
|
if (Ca())
|
|
22370
22452
|
return !0;
|
|
22371
22453
|
for (; a.type & s.IS_POSTFIX && !Oe(); )
|
|
@@ -22386,13 +22468,13 @@ function La(t, e = !1) {
|
|
|
22386
22468
|
while (!n.stop && !a.error);
|
|
22387
22469
|
}
|
|
22388
22470
|
function Ph(t, e, n) {
|
|
22389
|
-
le ? eh(t, e, n) : he ?
|
|
22471
|
+
le ? eh(t, e, n) : he ? yf(t, e, n) : Ys(t, e, n);
|
|
22390
22472
|
}
|
|
22391
22473
|
function Ys(t, e, n) {
|
|
22392
22474
|
if (!e && _(s.doubleColon))
|
|
22393
22475
|
Ks(), n.stop = !0, zs(t, e);
|
|
22394
22476
|
else if (l(s.questionDot)) {
|
|
22395
|
-
if (a.tokens[t].isOptionalChainStart = !0, e &&
|
|
22477
|
+
if (a.tokens[t].isOptionalChainStart = !0, e && be() === s.parenL) {
|
|
22396
22478
|
n.stop = !0;
|
|
22397
22479
|
return;
|
|
22398
22480
|
}
|
|
@@ -22405,11 +22487,11 @@ function Ys(t, e, n) {
|
|
|
22405
22487
|
if (Fa()) {
|
|
22406
22488
|
const r = a.snapshot(), i = a.tokens.length;
|
|
22407
22489
|
S(), a.tokens[a.tokens.length - 1].subscriptStartIndex = t;
|
|
22408
|
-
const o =
|
|
22490
|
+
const o = tn();
|
|
22409
22491
|
a.tokens[a.tokens.length - 1].contextId = o, pt(), a.tokens[a.tokens.length - 1].contextId = o, Dh() && (a.restoreFromSnapshot(r), n.stop = !0, a.scopeDepth++, $t(), Uh(i));
|
|
22410
22492
|
} else {
|
|
22411
22493
|
S(), a.tokens[a.tokens.length - 1].subscriptStartIndex = t;
|
|
22412
|
-
const r =
|
|
22494
|
+
const r = tn();
|
|
22413
22495
|
a.tokens[a.tokens.length - 1].contextId = r, pt(), a.tokens[a.tokens.length - 1].contextId = r;
|
|
22414
22496
|
}
|
|
22415
22497
|
else l(s.backQuote) ? Qs() : n.stop = !0;
|
|
@@ -22431,7 +22513,7 @@ function Dh() {
|
|
|
22431
22513
|
return l(s.colon) || l(s.arrow);
|
|
22432
22514
|
}
|
|
22433
22515
|
function Uh(t) {
|
|
22434
|
-
le ? dh() : he && Df(), T(s.arrow),
|
|
22516
|
+
le ? dh() : he && Df(), T(s.arrow), on(t);
|
|
22435
22517
|
}
|
|
22436
22518
|
function Ks() {
|
|
22437
22519
|
const t = a.tokens.length;
|
|
@@ -22464,7 +22546,7 @@ function at() {
|
|
|
22464
22546
|
return S(), l(s.dot) && (a.tokens[a.tokens.length - 1].type = s.name, S(), Q()), !1;
|
|
22465
22547
|
case s.name: {
|
|
22466
22548
|
const e = a.tokens.length, n = a.start, r = a.contextualKeyword;
|
|
22467
|
-
return Q(), r === d._await ? (Wh(), !1) : r === d._async && l(s._function) && !Oe() ? (S(), It(n, !1), !1) : t && r === d._async && !Oe() && l(s.name) ? (a.scopeDepth++,
|
|
22549
|
+
return Q(), r === d._await ? (Wh(), !1) : r === d._async && l(s._function) && !Oe() ? (S(), It(n, !1), !1) : t && r === d._async && !Oe() && l(s.name) ? (a.scopeDepth++, yt(!1), T(s.arrow), on(e), !0) : l(s._do) && !Oe() ? (S(), gt(), !1) : t && !Oe() && l(s.arrow) ? (a.scopeDepth++, js(!1), T(s.arrow), on(e), !0) : (a.tokens[a.tokens.length - 1].identifierRole = X.Access, !1);
|
|
22468
22550
|
}
|
|
22469
22551
|
case s._do:
|
|
22470
22552
|
return S(), gt(), !1;
|
|
@@ -22488,7 +22570,7 @@ function at() {
|
|
|
22488
22570
|
return S(), Ks(), !1;
|
|
22489
22571
|
case s.hash: {
|
|
22490
22572
|
const e = Qo();
|
|
22491
|
-
return
|
|
22573
|
+
return ln[e] || e === p.backslash ? Nn() : S(), !1;
|
|
22492
22574
|
}
|
|
22493
22575
|
default:
|
|
22494
22576
|
return ne(), !1;
|
|
@@ -22525,13 +22607,13 @@ function Pa(t) {
|
|
|
22525
22607
|
} else
|
|
22526
22608
|
Ae(!1, !0);
|
|
22527
22609
|
}
|
|
22528
|
-
return T(s.parenR), t && Nh() && ks() ? (a.restoreFromSnapshot(e), a.scopeDepth++, $t(), ks(),
|
|
22610
|
+
return T(s.parenR), t && Nh() && ks() ? (a.restoreFromSnapshot(e), a.scopeDepth++, $t(), ks(), on(n), a.error ? (a.restoreFromSnapshot(e), Pa(!1), !1) : !0) : !1;
|
|
22529
22611
|
}
|
|
22530
22612
|
function Nh() {
|
|
22531
22613
|
return l(s.colon) || !Oe();
|
|
22532
22614
|
}
|
|
22533
22615
|
function ks() {
|
|
22534
|
-
return le ?
|
|
22616
|
+
return le ? yh() : he ? Mf() : _(s.arrow);
|
|
22535
22617
|
}
|
|
22536
22618
|
function Zs() {
|
|
22537
22619
|
(le || he) && Ih();
|
|
@@ -22541,7 +22623,7 @@ function Oh() {
|
|
|
22541
22623
|
Q();
|
|
22542
22624
|
return;
|
|
22543
22625
|
}
|
|
22544
|
-
Bh(), he &&
|
|
22626
|
+
Bh(), he && bf(), _(s.parenL) && Ua(s.parenR);
|
|
22545
22627
|
}
|
|
22546
22628
|
function Bh() {
|
|
22547
22629
|
Ks(), _(s.questionDot);
|
|
@@ -22552,7 +22634,7 @@ function Qs() {
|
|
|
22552
22634
|
S();
|
|
22553
22635
|
}
|
|
22554
22636
|
function Js(t, e) {
|
|
22555
|
-
const n =
|
|
22637
|
+
const n = tn();
|
|
22556
22638
|
let r = !0;
|
|
22557
22639
|
for (S(), a.tokens[a.tokens.length - 1].contextId = n; !_(s.braceR) && !a.error; ) {
|
|
22558
22640
|
if (r)
|
|
@@ -22566,7 +22648,7 @@ function Js(t, e) {
|
|
|
22566
22648
|
break;
|
|
22567
22649
|
continue;
|
|
22568
22650
|
}
|
|
22569
|
-
t || (i = _(s.star)), !t && q(d._async) ? (i && ne(), Q(), l(s.colon) || l(s.parenL) || l(s.braceR) || l(s.eq) || l(s.comma) || (l(s.star) && (S(), i = !0),
|
|
22651
|
+
t || (i = _(s.star)), !t && q(d._async) ? (i && ne(), Q(), l(s.colon) || l(s.parenL) || l(s.braceR) || l(s.eq) || l(s.comma) || (l(s.star) && (S(), i = !0), sn(n))) : sn(n), qh(t, e, n);
|
|
22570
22652
|
}
|
|
22571
22653
|
a.tokens[a.tokens.length - 1].contextId = n;
|
|
22572
22654
|
}
|
|
@@ -22583,7 +22665,7 @@ function jh(t, e) {
|
|
|
22583
22665
|
n,
|
|
22584
22666
|
/* isConstructor */
|
|
22585
22667
|
!1
|
|
22586
|
-
), !0) : Vh(t) ? (
|
|
22668
|
+
), !0) : Vh(t) ? (sn(e), vs(
|
|
22587
22669
|
n,
|
|
22588
22670
|
/* isConstructor */
|
|
22589
22671
|
!1
|
|
@@ -22600,26 +22682,26 @@ function $h(t, e) {
|
|
|
22600
22682
|
function qh(t, e, n) {
|
|
22601
22683
|
le ? lh() : he && If(), jh(t, n) || $h(t, e);
|
|
22602
22684
|
}
|
|
22603
|
-
function
|
|
22685
|
+
function sn(t) {
|
|
22604
22686
|
he && ai(), _(s.bracketL) ? (a.tokens[a.tokens.length - 1].contextId = t, Ae(), T(s.bracketR), a.tokens[a.tokens.length - 1].contextId = t) : (l(s.num) || l(s.string) || l(s.bigint) || l(s.decimal) ? at() : Nn(), a.tokens[a.tokens.length - 1].identifierRole = X.ObjectKey, a.tokens[a.tokens.length - 1].contextId = t);
|
|
22605
22687
|
}
|
|
22606
22688
|
function vs(t, e) {
|
|
22607
|
-
const n =
|
|
22689
|
+
const n = tn();
|
|
22608
22690
|
a.scopeDepth++;
|
|
22609
22691
|
const r = a.tokens.length;
|
|
22610
22692
|
$t(e, n), Da(t, n);
|
|
22611
22693
|
const o = a.tokens.length;
|
|
22612
22694
|
a.scopes.push(new nt(r, o, !0)), a.scopeDepth--;
|
|
22613
22695
|
}
|
|
22614
|
-
function
|
|
22615
|
-
|
|
22696
|
+
function on(t) {
|
|
22697
|
+
pn(!0);
|
|
22616
22698
|
const e = a.tokens.length;
|
|
22617
22699
|
a.scopes.push(new nt(t, e, !0)), a.scopeDepth--;
|
|
22618
22700
|
}
|
|
22619
22701
|
function Da(t, e = 0) {
|
|
22620
|
-
le ? Jl(t, e) : he ? gf(e) :
|
|
22702
|
+
le ? Jl(t, e) : he ? gf(e) : pn(!1, e);
|
|
22621
22703
|
}
|
|
22622
|
-
function
|
|
22704
|
+
function pn(t, e = 0) {
|
|
22623
22705
|
t && !l(s.braceL) ? Ae() : gt(!0, e);
|
|
22624
22706
|
}
|
|
22625
22707
|
function Ua(t, e = !1) {
|
|
@@ -22638,7 +22720,7 @@ function Q() {
|
|
|
22638
22720
|
S(), a.tokens[a.tokens.length - 1].type = s.name;
|
|
22639
22721
|
}
|
|
22640
22722
|
function Wh() {
|
|
22641
|
-
|
|
22723
|
+
mn();
|
|
22642
22724
|
}
|
|
22643
22725
|
function Hh() {
|
|
22644
22726
|
S(), !l(s.semi) && !Oe() && (_(s.star), Ae());
|
|
@@ -22667,13 +22749,13 @@ function zh() {
|
|
|
22667
22749
|
);
|
|
22668
22750
|
}
|
|
22669
22751
|
function Yh() {
|
|
22670
|
-
S(), Q(), l(s.lessThan) && Ye(), T(s.parenL), Es(), T(s.parenR), ei(),
|
|
22752
|
+
S(), Q(), l(s.lessThan) && Ye(), T(s.parenL), Es(), T(s.parenR), ei(), ye();
|
|
22671
22753
|
}
|
|
22672
22754
|
function ws() {
|
|
22673
22755
|
l(s._class) ? zh() : l(s._function) ? Yh() : l(s._var) ? Kh() : Ee(d._module) ? _(s.dot) ? Jh() : Zh() : q(d._type) ? ef() : q(d._opaque) ? tf() : q(d._interface) ? nf() : l(s._export) ? Qh() : ne();
|
|
22674
22756
|
}
|
|
22675
22757
|
function Kh() {
|
|
22676
|
-
S(), Va(),
|
|
22758
|
+
S(), Va(), ye();
|
|
22677
22759
|
}
|
|
22678
22760
|
function Zh() {
|
|
22679
22761
|
for (l(s.string) ? at() : Q(), T(s.braceL); !l(s.braceR) && !a.error; )
|
|
@@ -22681,7 +22763,7 @@ function Zh() {
|
|
|
22681
22763
|
T(s.braceR);
|
|
22682
22764
|
}
|
|
22683
22765
|
function Qh() {
|
|
22684
|
-
T(s._export), _(s._default) ? l(s._function) || l(s._class) ? ws() : (Ne(),
|
|
22766
|
+
T(s._export), _(s._default) ? l(s._function) || l(s._class) ? ws() : (Ne(), ye()) : l(s._var) || // declare export var ...
|
|
22685
22767
|
l(s._function) || // declare export function ...
|
|
22686
22768
|
l(s._class) || // declare export class ...
|
|
22687
22769
|
q(d._opaque) ? ws() : l(s.star) || // declare export * from ''
|
|
@@ -22691,7 +22773,7 @@ function Qh() {
|
|
|
22691
22773
|
q(d._opaque) ? za() : ne();
|
|
22692
22774
|
}
|
|
22693
22775
|
function Jh() {
|
|
22694
|
-
ve(d._exports), Ft(),
|
|
22776
|
+
ve(d._exports), Ft(), ye();
|
|
22695
22777
|
}
|
|
22696
22778
|
function ef() {
|
|
22697
22779
|
S(), ri();
|
|
@@ -22705,23 +22787,23 @@ function nf() {
|
|
|
22705
22787
|
function ti(t = !1) {
|
|
22706
22788
|
if (Zn(), l(s.lessThan) && Ye(), _(s._extends))
|
|
22707
22789
|
do
|
|
22708
|
-
|
|
22790
|
+
En();
|
|
22709
22791
|
while (!t && _(s.comma));
|
|
22710
22792
|
if (q(d._mixins)) {
|
|
22711
22793
|
S();
|
|
22712
22794
|
do
|
|
22713
|
-
|
|
22795
|
+
En();
|
|
22714
22796
|
while (_(s.comma));
|
|
22715
22797
|
}
|
|
22716
22798
|
if (q(d._implements)) {
|
|
22717
22799
|
S();
|
|
22718
22800
|
do
|
|
22719
|
-
|
|
22801
|
+
En();
|
|
22720
22802
|
while (_(s.comma));
|
|
22721
22803
|
}
|
|
22722
22804
|
On(t, !1, t);
|
|
22723
22805
|
}
|
|
22724
|
-
function
|
|
22806
|
+
function En() {
|
|
22725
22807
|
Na(!1), l(s.lessThan) && At();
|
|
22726
22808
|
}
|
|
22727
22809
|
function ni() {
|
|
@@ -22731,10 +22813,10 @@ function Zn() {
|
|
|
22731
22813
|
Q();
|
|
22732
22814
|
}
|
|
22733
22815
|
function ri() {
|
|
22734
|
-
Zn(), l(s.lessThan) && Ye(), rt(s.eq),
|
|
22816
|
+
Zn(), l(s.lessThan) && Ye(), rt(s.eq), ye();
|
|
22735
22817
|
}
|
|
22736
22818
|
function si(t) {
|
|
22737
|
-
ve(d._type), Zn(), l(s.lessThan) && Ye(), l(s.colon) && rt(s.colon), t || rt(s.eq),
|
|
22819
|
+
ve(d._type), Zn(), l(s.lessThan) && Ye(), l(s.colon) && rt(s.colon), t || rt(s.eq), ye();
|
|
22738
22820
|
}
|
|
22739
22821
|
function rf() {
|
|
22740
22822
|
ai(), Va(), _(s.eq) && Ne();
|
|
@@ -22756,7 +22838,7 @@ function At() {
|
|
|
22756
22838
|
function sf() {
|
|
22757
22839
|
if (ve(d._interface), _(s._extends))
|
|
22758
22840
|
do
|
|
22759
|
-
|
|
22841
|
+
En();
|
|
22760
22842
|
while (_(s.comma));
|
|
22761
22843
|
On(!1, !1, !1);
|
|
22762
22844
|
}
|
|
@@ -22764,7 +22846,7 @@ function ii() {
|
|
|
22764
22846
|
l(s.num) || l(s.string) ? at() : Q();
|
|
22765
22847
|
}
|
|
22766
22848
|
function of() {
|
|
22767
|
-
|
|
22849
|
+
be() === s.colon ? (ii(), rt()) : Ne(), T(s.bracketR), rt();
|
|
22768
22850
|
}
|
|
22769
22851
|
function af() {
|
|
22770
22852
|
ii(), T(s.bracketR), T(s.bracketR), l(s.lessThan) || l(s.parenL) ? oi() : (_(s.question), rt());
|
|
@@ -22781,11 +22863,11 @@ function On(t, e, n) {
|
|
|
22781
22863
|
let r;
|
|
22782
22864
|
for (e && l(s.braceBarL) ? (T(s.braceBarL), r = s.braceBarR) : (T(s.braceL), r = s.braceR); !l(r) && !a.error; ) {
|
|
22783
22865
|
if (n && q(d._proto)) {
|
|
22784
|
-
const i =
|
|
22866
|
+
const i = be();
|
|
22785
22867
|
i !== s.colon && i !== s.question && (S(), t = !1);
|
|
22786
22868
|
}
|
|
22787
22869
|
if (t && q(d._static)) {
|
|
22788
|
-
const i =
|
|
22870
|
+
const i = be();
|
|
22789
22871
|
i !== s.colon && i !== s.question && S();
|
|
22790
22872
|
}
|
|
22791
22873
|
if (ai(), _(s.bracketL))
|
|
@@ -22794,7 +22876,7 @@ function On(t, e, n) {
|
|
|
22794
22876
|
cf();
|
|
22795
22877
|
else {
|
|
22796
22878
|
if (q(d._get) || q(d._set)) {
|
|
22797
|
-
const i =
|
|
22879
|
+
const i = be();
|
|
22798
22880
|
(i === s.name || i === s.string || i === s.num) && S();
|
|
22799
22881
|
}
|
|
22800
22882
|
uf();
|
|
@@ -22830,7 +22912,7 @@ function df() {
|
|
|
22830
22912
|
T(s.bracketR);
|
|
22831
22913
|
}
|
|
22832
22914
|
function Bn() {
|
|
22833
|
-
const t =
|
|
22915
|
+
const t = be();
|
|
22834
22916
|
t === s.colon || t === s.question ? (Q(), _(s.question), rt()) : Ne();
|
|
22835
22917
|
}
|
|
22836
22918
|
function Es() {
|
|
@@ -22865,12 +22947,12 @@ function Oa() {
|
|
|
22865
22947
|
case s.parenL:
|
|
22866
22948
|
if (S(), !l(s.parenR) && !l(s.ellipsis))
|
|
22867
22949
|
if (l(s.name)) {
|
|
22868
|
-
const n =
|
|
22950
|
+
const n = be();
|
|
22869
22951
|
t = n !== s.question && n !== s.colon;
|
|
22870
22952
|
} else
|
|
22871
22953
|
t = !0;
|
|
22872
22954
|
if (t)
|
|
22873
|
-
if (a.noAnonFunctionType = !1, Ne(), a.noAnonFunctionType = e, a.noAnonFunctionType || !(l(s.comma) || l(s.parenR) &&
|
|
22955
|
+
if (a.noAnonFunctionType = !1, Ne(), a.noAnonFunctionType = e, a.noAnonFunctionType || !(l(s.comma) || l(s.parenR) && be() === s.arrow)) {
|
|
22874
22956
|
T(s.parenR);
|
|
22875
22957
|
return;
|
|
22876
22958
|
} else
|
|
@@ -22932,10 +23014,10 @@ function ai() {
|
|
|
22932
23014
|
(l(s.plus) || l(s.minus)) && (S(), a.tokens[a.tokens.length - 1].isType = !0);
|
|
22933
23015
|
}
|
|
22934
23016
|
function gf(t) {
|
|
22935
|
-
l(s.colon) && ei(),
|
|
23017
|
+
l(s.colon) && ei(), pn(!1, t);
|
|
22936
23018
|
}
|
|
22937
|
-
function
|
|
22938
|
-
if (l(s.questionDot) &&
|
|
23019
|
+
function yf(t, e, n) {
|
|
23020
|
+
if (l(s.questionDot) && be() === s.lessThan) {
|
|
22939
23021
|
if (e) {
|
|
22940
23022
|
n.stop = !0;
|
|
22941
23023
|
return;
|
|
@@ -22951,7 +23033,7 @@ function bf(t, e, n) {
|
|
|
22951
23033
|
}
|
|
22952
23034
|
Ys(t, e, n);
|
|
22953
23035
|
}
|
|
22954
|
-
function
|
|
23036
|
+
function bf() {
|
|
22955
23037
|
if (l(s.lessThan)) {
|
|
22956
23038
|
const t = a.snapshot();
|
|
22957
23039
|
At(), a.error && a.restoreFromSnapshot(t);
|
|
@@ -22986,7 +23068,7 @@ function vf(t) {
|
|
|
22986
23068
|
si(!1), re(e);
|
|
22987
23069
|
}
|
|
22988
23070
|
}
|
|
22989
|
-
|
|
23071
|
+
ye();
|
|
22990
23072
|
}
|
|
22991
23073
|
function wf() {
|
|
22992
23074
|
return q(d._type) || q(d._interface) || q(d._opaque) || q(d._enum);
|
|
@@ -22997,7 +23079,7 @@ function Ef() {
|
|
|
22997
23079
|
function Tf() {
|
|
22998
23080
|
if (q(d._type)) {
|
|
22999
23081
|
const t = se(1);
|
|
23000
|
-
S(), l(s.braceL) ? (ui(),
|
|
23082
|
+
S(), l(s.braceL) ? (ui(), an()) : ri(), re(t);
|
|
23001
23083
|
} else if (q(d._opaque)) {
|
|
23002
23084
|
const t = se(1);
|
|
23003
23085
|
S(), si(!1), re(t);
|
|
@@ -23008,7 +23090,7 @@ function Tf() {
|
|
|
23008
23090
|
Be(!0);
|
|
23009
23091
|
}
|
|
23010
23092
|
function Sf() {
|
|
23011
|
-
return l(s.star) || q(d._type) &&
|
|
23093
|
+
return l(s.star) || q(d._type) && be() === s.star;
|
|
23012
23094
|
}
|
|
23013
23095
|
function xf() {
|
|
23014
23096
|
if (Ee(d._type)) {
|
|
@@ -23036,7 +23118,7 @@ function Rf() {
|
|
|
23036
23118
|
}
|
|
23037
23119
|
function Cf() {
|
|
23038
23120
|
if (l(s._typeof) || q(d._type)) {
|
|
23039
|
-
const t =
|
|
23121
|
+
const t = hn();
|
|
23040
23122
|
(Xh(t) || t.type === s.braceL || t.type === s.star) && S();
|
|
23041
23123
|
}
|
|
23042
23124
|
}
|
|
@@ -23093,7 +23175,7 @@ function Nf(t, e = !1) {
|
|
|
23093
23175
|
function Of() {
|
|
23094
23176
|
a.scopeDepth++;
|
|
23095
23177
|
const t = a.tokens.length;
|
|
23096
|
-
return $t(), ks() ? (
|
|
23178
|
+
return $t(), ks() ? (on(t), !0) : !1;
|
|
23097
23179
|
}
|
|
23098
23180
|
function ja() {
|
|
23099
23181
|
ve(d._enum), a.tokens[a.tokens.length - 1].type = s._enum, Q(), Bf();
|
|
@@ -23135,7 +23217,7 @@ function qf(t) {
|
|
|
23135
23217
|
zf();
|
|
23136
23218
|
return;
|
|
23137
23219
|
case s._function:
|
|
23138
|
-
if (
|
|
23220
|
+
if (be() === s.dot) break;
|
|
23139
23221
|
t || ne(), Zf();
|
|
23140
23222
|
return;
|
|
23141
23223
|
case s._class:
|
|
@@ -23160,7 +23242,7 @@ function qf(t) {
|
|
|
23160
23242
|
case s._const:
|
|
23161
23243
|
t || ne();
|
|
23162
23244
|
case s._var:
|
|
23163
|
-
|
|
23245
|
+
Tn(e !== s._var);
|
|
23164
23246
|
return;
|
|
23165
23247
|
case s._while:
|
|
23166
23248
|
sd();
|
|
@@ -23173,7 +23255,7 @@ function qf(t) {
|
|
|
23173
23255
|
return;
|
|
23174
23256
|
case s._export:
|
|
23175
23257
|
case s._import: {
|
|
23176
|
-
const i =
|
|
23258
|
+
const i = be();
|
|
23177
23259
|
if (i === s.parenL || i === s.dot)
|
|
23178
23260
|
break;
|
|
23179
23261
|
S(), e === s._import ? Ka() : za();
|
|
@@ -23189,11 +23271,11 @@ function qf(t) {
|
|
|
23189
23271
|
a.restoreFromSnapshot(o);
|
|
23190
23272
|
} else if (a.contextualKeyword === d._using && !Ho() && // Statements like `using[0]` and `using in foo` aren't actual using
|
|
23191
23273
|
// declarations.
|
|
23192
|
-
|
|
23193
|
-
|
|
23274
|
+
be() === s.name) {
|
|
23275
|
+
Tn(!0);
|
|
23194
23276
|
return;
|
|
23195
23277
|
} else if ($a()) {
|
|
23196
|
-
ve(d._await),
|
|
23278
|
+
ve(d._await), Tn(!0);
|
|
23197
23279
|
return;
|
|
23198
23280
|
}
|
|
23199
23281
|
}
|
|
@@ -23205,7 +23287,7 @@ function qf(t) {
|
|
|
23205
23287
|
i.type === s.name && (r = i.contextualKeyword);
|
|
23206
23288
|
}
|
|
23207
23289
|
if (r == null) {
|
|
23208
|
-
|
|
23290
|
+
ye();
|
|
23209
23291
|
return;
|
|
23210
23292
|
}
|
|
23211
23293
|
_(s.colon) ? od() : ad(r);
|
|
@@ -23236,10 +23318,10 @@ function Wa() {
|
|
|
23236
23318
|
_(s.parenL) && pt();
|
|
23237
23319
|
}
|
|
23238
23320
|
function Hf() {
|
|
23239
|
-
S(), Je() || (Q(),
|
|
23321
|
+
S(), Je() || (Q(), ye());
|
|
23240
23322
|
}
|
|
23241
23323
|
function Gf() {
|
|
23242
|
-
S(),
|
|
23324
|
+
S(), ye();
|
|
23243
23325
|
}
|
|
23244
23326
|
function Xf() {
|
|
23245
23327
|
S(), Be(!1), T(s._while), Kn(), _(s.semi);
|
|
@@ -23284,7 +23366,7 @@ function Qf() {
|
|
|
23284
23366
|
S(), Kn(), Be(!1), _(s._else) && Be(!1);
|
|
23285
23367
|
}
|
|
23286
23368
|
function Jf() {
|
|
23287
|
-
S(), Je() || (xe(),
|
|
23369
|
+
S(), Je() || (xe(), ye());
|
|
23288
23370
|
}
|
|
23289
23371
|
function ed() {
|
|
23290
23372
|
S(), Kn(), a.scopeDepth++;
|
|
@@ -23300,7 +23382,7 @@ function ed() {
|
|
|
23300
23382
|
a.scopes.push(new nt(t, e, !1)), a.scopeDepth--;
|
|
23301
23383
|
}
|
|
23302
23384
|
function td() {
|
|
23303
|
-
S(), xe(),
|
|
23385
|
+
S(), xe(), ye();
|
|
23304
23386
|
}
|
|
23305
23387
|
function nd() {
|
|
23306
23388
|
Xn(
|
|
@@ -23319,8 +23401,8 @@ function rd() {
|
|
|
23319
23401
|
}
|
|
23320
23402
|
_(s._finally) && gt();
|
|
23321
23403
|
}
|
|
23322
|
-
function
|
|
23323
|
-
S(), Ha(!1, t),
|
|
23404
|
+
function Tn(t) {
|
|
23405
|
+
S(), Ha(!1, t), ye();
|
|
23324
23406
|
}
|
|
23325
23407
|
function sd() {
|
|
23326
23408
|
S(), Kn(), Be(!1);
|
|
@@ -23332,7 +23414,7 @@ function od() {
|
|
|
23332
23414
|
Be(!0);
|
|
23333
23415
|
}
|
|
23334
23416
|
function ad(t) {
|
|
23335
|
-
le ? ah(t) : he ? vf(t) :
|
|
23417
|
+
le ? ah(t) : he ? vf(t) : ye();
|
|
23336
23418
|
}
|
|
23337
23419
|
function gt(t = !1, e = 0) {
|
|
23338
23420
|
const n = a.tokens.length;
|
|
@@ -23366,7 +23448,7 @@ function cd(t) {
|
|
|
23366
23448
|
function It(t, e, n = !1) {
|
|
23367
23449
|
l(s.star) && S(), e && !n && !l(s.name) && !l(s._yield) && ne();
|
|
23368
23450
|
let r = null;
|
|
23369
|
-
l(s.name) && (e || (r = a.tokens.length, a.scopeDepth++),
|
|
23451
|
+
l(s.name) && (e || (r = a.tokens.length, a.scopeDepth++), yt(!1));
|
|
23370
23452
|
const i = a.tokens.length;
|
|
23371
23453
|
a.scopeDepth++, $t(), Da(t);
|
|
23372
23454
|
const o = a.tokens.length;
|
|
@@ -23382,7 +23464,7 @@ function $t(t = !1, e = 0) {
|
|
|
23382
23464
|
), e && (a.tokens[a.tokens.length - 1].contextId = e);
|
|
23383
23465
|
}
|
|
23384
23466
|
function Rt(t, e = !1) {
|
|
23385
|
-
const n =
|
|
23467
|
+
const n = tn();
|
|
23386
23468
|
S(), a.tokens[a.tokens.length - 1].contextId = n, a.tokens[a.tokens.length - 1].isExpression = !t;
|
|
23387
23469
|
let r = null;
|
|
23388
23470
|
t || (r = a.tokens.length, a.scopeDepth++), fd(t, e), dd();
|
|
@@ -23428,7 +23510,7 @@ function ld(t, e) {
|
|
|
23428
23510
|
);
|
|
23429
23511
|
return;
|
|
23430
23512
|
} else if (Ga()) {
|
|
23431
|
-
|
|
23513
|
+
Sn();
|
|
23432
23514
|
return;
|
|
23433
23515
|
}
|
|
23434
23516
|
if (a.tokens[a.tokens.length - 1].type = s._static, n = !0, l(s.braceL)) {
|
|
@@ -23452,7 +23534,7 @@ function hd(t, e, n) {
|
|
|
23452
23534
|
Gt(n);
|
|
23453
23535
|
let r = !1;
|
|
23454
23536
|
const i = a.tokens[a.tokens.length - 1];
|
|
23455
|
-
i.contextualKeyword === d._constructor && (r = !0), no(), Xa() ? Xt(t, r) : Ga() ?
|
|
23537
|
+
i.contextualKeyword === d._constructor && (r = !0), no(), Xa() ? Xt(t, r) : Ga() ? Sn() : i.contextualKeyword === d._async && !Je() ? (a.tokens[a.tokens.length - 1].type = s._async, l(s.star) && S(), Gt(n), no(), Xt(
|
|
23456
23538
|
t,
|
|
23457
23539
|
!1
|
|
23458
23540
|
/* isConstructor */
|
|
@@ -23460,13 +23542,13 @@ function hd(t, e, n) {
|
|
|
23460
23542
|
t,
|
|
23461
23543
|
/* isConstructor */
|
|
23462
23544
|
!1
|
|
23463
|
-
)) : i.contextualKeyword === d._accessor && !Je() ? (Gt(n),
|
|
23545
|
+
)) : i.contextualKeyword === d._accessor && !Je() ? (Gt(n), Sn()) : Je() ? Sn() : ne();
|
|
23464
23546
|
}
|
|
23465
23547
|
function Xt(t, e) {
|
|
23466
23548
|
le ? Lt() : he && l(s.lessThan) && Ye(), vs(t, e);
|
|
23467
23549
|
}
|
|
23468
23550
|
function Gt(t) {
|
|
23469
|
-
|
|
23551
|
+
sn(t);
|
|
23470
23552
|
}
|
|
23471
23553
|
function no() {
|
|
23472
23554
|
if (le) {
|
|
@@ -23474,15 +23556,15 @@ function no() {
|
|
|
23474
23556
|
_(s.question), re(t);
|
|
23475
23557
|
}
|
|
23476
23558
|
}
|
|
23477
|
-
function
|
|
23559
|
+
function Sn() {
|
|
23478
23560
|
if (le ? (Ko(s.bang), Vt()) : he && l(s.colon) && Ft(), l(s.eq)) {
|
|
23479
23561
|
const t = a.tokens.length;
|
|
23480
23562
|
S(), Ae(), a.tokens[t].rhsEndIndex = a.tokens.length;
|
|
23481
23563
|
}
|
|
23482
|
-
|
|
23564
|
+
ye();
|
|
23483
23565
|
}
|
|
23484
23566
|
function fd(t, e = !1) {
|
|
23485
|
-
le && (!t || e) && q(d._implements) || (l(s.name) &&
|
|
23567
|
+
le && (!t || e) && q(d._implements) || (l(s.name) && yt(!0), le ? Lt() : he && l(s.lessThan) && Ye());
|
|
23486
23568
|
}
|
|
23487
23569
|
function dd() {
|
|
23488
23570
|
let t = !1;
|
|
@@ -23490,13 +23572,13 @@ function dd() {
|
|
|
23490
23572
|
}
|
|
23491
23573
|
function za() {
|
|
23492
23574
|
const t = a.tokens.length - 1;
|
|
23493
|
-
le && th() || (
|
|
23575
|
+
le && th() || (yd() ? bd() : gd() ? (Q(), l(s.comma) && be() === s.star ? (T(s.comma), T(s.star), ve(d._as), Q()) : Ya(), an()) : _(s._default) ? md() : kd() ? pd() : (ui(), an()), a.tokens[t].rhsEndIndex = a.tokens.length);
|
|
23494
23576
|
}
|
|
23495
23577
|
function md() {
|
|
23496
23578
|
if (le && sh() || he && kf())
|
|
23497
23579
|
return;
|
|
23498
23580
|
const t = a.start;
|
|
23499
|
-
_(s._function) ? It(t, !0, !0) : q(d._async) &&
|
|
23581
|
+
_(s._function) ? It(t, !0, !0) : q(d._async) && be() === s._function ? (Ee(d._async), _(s._function), It(t, !0, !0)) : l(s._class) ? Rt(!0, !0) : l(s.at) ? (ci(), Rt(!0, !0)) : (Ae(), ye());
|
|
23500
23582
|
}
|
|
23501
23583
|
function pd() {
|
|
23502
23584
|
le ? ch() : he ? Tf() : Be(!0);
|
|
@@ -23510,7 +23592,7 @@ function gd() {
|
|
|
23510
23592
|
return a.contextualKeyword !== d._async;
|
|
23511
23593
|
if (!l(s._default))
|
|
23512
23594
|
return !1;
|
|
23513
|
-
const t = Bs(), e =
|
|
23595
|
+
const t = Bs(), e = hn(), n = e.type === s.name && e.contextualKeyword === d._from;
|
|
23514
23596
|
if (e.type === s.comma)
|
|
23515
23597
|
return !0;
|
|
23516
23598
|
if (n) {
|
|
@@ -23522,20 +23604,20 @@ function gd() {
|
|
|
23522
23604
|
function Ya() {
|
|
23523
23605
|
_(s.comma) && ui();
|
|
23524
23606
|
}
|
|
23525
|
-
function
|
|
23526
|
-
Ee(d._from) && (at(), Za()),
|
|
23607
|
+
function an() {
|
|
23608
|
+
Ee(d._from) && (at(), Za()), ye();
|
|
23527
23609
|
}
|
|
23528
|
-
function
|
|
23610
|
+
function yd() {
|
|
23529
23611
|
return he ? Sf() : l(s.star);
|
|
23530
23612
|
}
|
|
23531
|
-
function
|
|
23613
|
+
function bd() {
|
|
23532
23614
|
he ? xf() : Ts();
|
|
23533
23615
|
}
|
|
23534
23616
|
function Ts() {
|
|
23535
|
-
T(s.star), q(d._as) ? _d() :
|
|
23617
|
+
T(s.star), q(d._as) ? _d() : an();
|
|
23536
23618
|
}
|
|
23537
23619
|
function _d() {
|
|
23538
|
-
S(), a.tokens[a.tokens.length - 1].type = s._as, Q(), Ya(),
|
|
23620
|
+
S(), a.tokens[a.tokens.length - 1].type = s._as, Q(), Ya(), an();
|
|
23539
23621
|
}
|
|
23540
23622
|
function kd() {
|
|
23541
23623
|
return le && Ta() || he && wf() || a.type === s._var || a.type === s._const || a.type === s._let || a.type === s._function || a.type === s._class || q(d._async) || l(s.at);
|
|
@@ -23565,20 +23647,20 @@ function Ed() {
|
|
|
23565
23647
|
q(d._module) && wd() && S();
|
|
23566
23648
|
}
|
|
23567
23649
|
function Ka() {
|
|
23568
|
-
if (le && l(s.name) &&
|
|
23569
|
-
|
|
23650
|
+
if (le && l(s.name) && be() === s.eq) {
|
|
23651
|
+
bs();
|
|
23570
23652
|
return;
|
|
23571
23653
|
}
|
|
23572
23654
|
if (le && q(d._type)) {
|
|
23573
|
-
const t =
|
|
23655
|
+
const t = hn();
|
|
23574
23656
|
if (t.type === s.name && t.contextualKeyword !== d._from) {
|
|
23575
|
-
if (ve(d._type),
|
|
23576
|
-
|
|
23657
|
+
if (ve(d._type), be() === s.eq) {
|
|
23658
|
+
bs();
|
|
23577
23659
|
return;
|
|
23578
23660
|
}
|
|
23579
23661
|
} else (t.type === s.star || t.type === s.braceL) && ve(d._type);
|
|
23580
23662
|
}
|
|
23581
|
-
l(s.string) || (Ed(), Sd(), ve(d._from)), at(), Za(),
|
|
23663
|
+
l(s.string) || (Ed(), Sd(), ve(d._from)), at(), Za(), ye();
|
|
23582
23664
|
}
|
|
23583
23665
|
function Td() {
|
|
23584
23666
|
return l(s.name);
|
|
@@ -23647,7 +23729,7 @@ function Cd(t) {
|
|
|
23647
23729
|
} while (n > 0 && e < t.tokens.length);
|
|
23648
23730
|
return !1;
|
|
23649
23731
|
}
|
|
23650
|
-
class
|
|
23732
|
+
class Kt {
|
|
23651
23733
|
__init() {
|
|
23652
23734
|
this.resultCode = "";
|
|
23653
23735
|
}
|
|
@@ -23660,7 +23742,7 @@ class Yt {
|
|
|
23660
23742
|
this.tokenIndex = 0;
|
|
23661
23743
|
}
|
|
23662
23744
|
constructor(e, n, r, i, o) {
|
|
23663
|
-
this.code = e, this.tokens = n, this.isFlowEnabled = r, this.disableESTransforms = i, this.helperManager = o,
|
|
23745
|
+
this.code = e, this.tokens = n, this.isFlowEnabled = r, this.disableESTransforms = i, this.helperManager = o, Kt.prototype.__init.call(this), Kt.prototype.__init2.call(this), Kt.prototype.__init3.call(this);
|
|
23664
23746
|
}
|
|
23665
23747
|
/**
|
|
23666
23748
|
* Snapshot the token state in a way that can be restored later, useful for
|
|
@@ -24052,7 +24134,7 @@ function nc(t, e, n, r) {
|
|
|
24052
24134
|
const u = n.identifierNameForToken(c);
|
|
24053
24135
|
return r.typeDeclarations.has(u) && !r.valueDeclarations.has(u);
|
|
24054
24136
|
}
|
|
24055
|
-
class
|
|
24137
|
+
class Zt extends ze {
|
|
24056
24138
|
__init() {
|
|
24057
24139
|
this.hadExport = !1;
|
|
24058
24140
|
}
|
|
@@ -24063,7 +24145,7 @@ class Kt extends ze {
|
|
|
24063
24145
|
this.hadDefaultExport = !1;
|
|
24064
24146
|
}
|
|
24065
24147
|
constructor(e, n, r, i, o, c, u, h, f, m, g, v) {
|
|
24066
|
-
super(), this.rootTransformer = e, this.tokens = n, this.importProcessor = r, this.nameManager = i, this.helperManager = o, this.reactHotLoaderTransformer = c, this.enableLegacyBabel5ModuleInterop = u, this.enableLegacyTypeScriptModuleInterop = h, this.isTypeScriptTransformEnabled = f, this.isFlowTransformEnabled = m, this.preserveDynamicImport = g, this.keepUnusedImports = v,
|
|
24148
|
+
super(), this.rootTransformer = e, this.tokens = n, this.importProcessor = r, this.nameManager = i, this.helperManager = o, this.reactHotLoaderTransformer = c, this.enableLegacyBabel5ModuleInterop = u, this.enableLegacyTypeScriptModuleInterop = h, this.isTypeScriptTransformEnabled = f, this.isFlowTransformEnabled = m, this.preserveDynamicImport = g, this.keepUnusedImports = v, Zt.prototype.__init.call(this), Zt.prototype.__init2.call(this), Zt.prototype.__init3.call(this), this.declarationInfo = f ? ec(n) : Ja;
|
|
24067
24149
|
}
|
|
24068
24150
|
getPrefixCode() {
|
|
24069
24151
|
let e = "";
|
|
@@ -24440,7 +24522,7 @@ module.exports = exports.default;
|
|
|
24440
24522
|
this.tokens.removeToken();
|
|
24441
24523
|
break;
|
|
24442
24524
|
}
|
|
24443
|
-
const r =
|
|
24525
|
+
const r = nn(this.tokens);
|
|
24444
24526
|
for (; this.tokens.currentIndex() < r.endIndex; )
|
|
24445
24527
|
this.tokens.removeToken();
|
|
24446
24528
|
if (!(r.isType || !e && this.shouldElideExportedIdentifier(r.leftName))) {
|
|
@@ -24550,7 +24632,7 @@ class Dd extends ze {
|
|
|
24550
24632
|
else if (this.tokens.matches1(s.braceL)) {
|
|
24551
24633
|
for (r && this.tokens.appendCode(","), this.tokens.copyToken(); !this.tokens.matches1(s.braceR); ) {
|
|
24552
24634
|
n = !0;
|
|
24553
|
-
const i =
|
|
24635
|
+
const i = nn(this.tokens);
|
|
24554
24636
|
if (i.isType || this.shouldAutomaticallyElideImportedName(i.rightName)) {
|
|
24555
24637
|
for (; this.tokens.currentIndex() < i.endIndex; )
|
|
24556
24638
|
this.tokens.removeToken();
|
|
@@ -24603,7 +24685,7 @@ class Dd extends ze {
|
|
|
24603
24685
|
const e = tc(this.tokens);
|
|
24604
24686
|
let n = !1;
|
|
24605
24687
|
for (; !this.tokens.matches1(s.braceR); ) {
|
|
24606
|
-
const r =
|
|
24688
|
+
const r = nn(this.tokens);
|
|
24607
24689
|
if (r.isType || !e && this.shouldElideExportedName(r.leftName)) {
|
|
24608
24690
|
for (; this.tokens.currentIndex() < r.endIndex; )
|
|
24609
24691
|
this.tokens.removeToken();
|
|
@@ -24743,7 +24825,7 @@ function Md(t) {
|
|
|
24743
24825
|
}
|
|
24744
24826
|
return n;
|
|
24745
24827
|
}
|
|
24746
|
-
const
|
|
24828
|
+
const kn = "jest", Nd = ["mock", "unmock", "enableAutomock", "disableAutomock"];
|
|
24747
24829
|
class li extends ze {
|
|
24748
24830
|
__init() {
|
|
24749
24831
|
this.hoistedFunctionNames = [];
|
|
@@ -24752,7 +24834,7 @@ class li extends ze {
|
|
|
24752
24834
|
super(), this.rootTransformer = e, this.tokens = n, this.nameManager = r, this.importProcessor = i, li.prototype.__init.call(this);
|
|
24753
24835
|
}
|
|
24754
24836
|
process() {
|
|
24755
|
-
return this.tokens.currentToken().scopeDepth === 0 && this.tokens.matches4(s.name, s.dot, s.name, s.parenL) && this.tokens.identifierName() ===
|
|
24837
|
+
return this.tokens.currentToken().scopeDepth === 0 && this.tokens.matches4(s.name, s.dot, s.name, s.parenL) && this.tokens.identifierName() === kn ? Md([this, "access", (e) => e.importProcessor, "optionalAccess", (e) => e.getGlobalNames, "call", (e) => e(), "optionalAccess", (e) => e.has, "call", (e) => e(kn)]) ? !1 : this.extractHoistedCalls() : !1;
|
|
24756
24838
|
}
|
|
24757
24839
|
getHoistedCode() {
|
|
24758
24840
|
return this.hoistedFunctionNames.length > 0 ? this.hoistedFunctionNames.map((e) => `${e}();`).join("") : "";
|
|
@@ -24772,9 +24854,9 @@ class li extends ze {
|
|
|
24772
24854
|
const n = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);
|
|
24773
24855
|
if (Nd.includes(n)) {
|
|
24774
24856
|
const i = this.nameManager.claimFreeName("__jestHoist");
|
|
24775
|
-
this.hoistedFunctionNames.push(i), this.tokens.replaceToken(`function ${i}(){${
|
|
24857
|
+
this.hoistedFunctionNames.push(i), this.tokens.replaceToken(`function ${i}(){${kn}.`), this.tokens.copyToken(), this.tokens.copyToken(), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(s.parenR), this.tokens.appendCode(";}"), e = !1;
|
|
24776
24858
|
} else
|
|
24777
|
-
e ? this.tokens.copyToken() : this.tokens.replaceToken(`${
|
|
24859
|
+
e ? this.tokens.copyToken() : this.tokens.replaceToken(`${kn}.`), this.tokens.copyToken(), this.tokens.copyToken(), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(s.parenR), e = !0;
|
|
24778
24860
|
}
|
|
24779
24861
|
return !0;
|
|
24780
24862
|
}
|
|
@@ -25033,7 +25115,7 @@ const $d = /* @__PURE__ */ new Set([
|
|
|
25033
25115
|
"true"
|
|
25034
25116
|
]);
|
|
25035
25117
|
function io(t) {
|
|
25036
|
-
if (t.length === 0 || !
|
|
25118
|
+
if (t.length === 0 || !ln[t.charCodeAt(0)])
|
|
25037
25119
|
return !1;
|
|
25038
25120
|
for (let e = 1; e < t.length; e++)
|
|
25039
25121
|
if (!Xe[t.charCodeAt(e)])
|
|
@@ -25218,7 +25300,7 @@ class jn {
|
|
|
25218
25300
|
if (c === null)
|
|
25219
25301
|
throw new Error("Expected non-null importProcessor with imports transform enabled.");
|
|
25220
25302
|
this.transformers.push(
|
|
25221
|
-
new
|
|
25303
|
+
new Zt(
|
|
25222
25304
|
this,
|
|
25223
25305
|
o,
|
|
25224
25306
|
c,
|
|
@@ -25515,7 +25597,7 @@ function Xd(t, e, n) {
|
|
|
25515
25597
|
for (; ; ) {
|
|
25516
25598
|
if (t.matches1AtIndex(e, s.braceR))
|
|
25517
25599
|
return;
|
|
25518
|
-
const r =
|
|
25600
|
+
const r = nn(t, e);
|
|
25519
25601
|
if (e = r.endIndex, r.isType || n.add(r.rightName), t.matches2AtIndex(e, s.comma, s.braceR))
|
|
25520
25602
|
return;
|
|
25521
25603
|
if (t.matches1AtIndex(e, s.braceR))
|
|
@@ -25556,7 +25638,7 @@ function zd(t, e) {
|
|
|
25556
25638
|
}
|
|
25557
25639
|
}
|
|
25558
25640
|
function Yd(t, e) {
|
|
25559
|
-
const n = e.transforms.includes("jsx"), r = e.transforms.includes("typescript"), i = e.transforms.includes("flow"), o = e.disableESTransforms === !0, c = Rd(t, n, r, i), u = c.tokens, h = c.scopes, f = new Vs(t, u), m = new Pn(f), g = new
|
|
25641
|
+
const n = e.transforms.includes("jsx"), r = e.transforms.includes("typescript"), i = e.transforms.includes("flow"), o = e.disableESTransforms === !0, c = Rd(t, n, r, i), u = c.tokens, h = c.scopes, f = new Vs(t, u), m = new Pn(f), g = new Kt(
|
|
25560
25642
|
t,
|
|
25561
25643
|
u,
|
|
25562
25644
|
i,
|
|
@@ -25582,10 +25664,10 @@ function rc(t) {
|
|
|
25582
25664
|
data: t
|
|
25583
25665
|
});
|
|
25584
25666
|
}
|
|
25585
|
-
const
|
|
25667
|
+
const cn = { current: null };
|
|
25586
25668
|
self.addEventListener("error", (t) => {
|
|
25587
25669
|
const e = t.error, n = e?.stack, r = e?.message ?? t.message ?? String(t);
|
|
25588
|
-
|
|
25670
|
+
cn.current ? cn.current.reportSceneError({
|
|
25589
25671
|
message: r,
|
|
25590
25672
|
...n !== void 0 && { stack: n },
|
|
25591
25673
|
code: "UNCAUGHT_ERROR"
|
|
@@ -25597,7 +25679,7 @@ self.addEventListener("error", (t) => {
|
|
|
25597
25679
|
});
|
|
25598
25680
|
self.addEventListener("unhandledrejection", (t) => {
|
|
25599
25681
|
const e = t.reason, n = e?.stack, r = e?.message ?? String(t.reason);
|
|
25600
|
-
|
|
25682
|
+
cn.current ? cn.current.reportSceneError({
|
|
25601
25683
|
message: r,
|
|
25602
25684
|
...n !== void 0 && { stack: n },
|
|
25603
25685
|
code: "UNHANDLED_REJECTION"
|
|
@@ -25607,8 +25689,8 @@ self.addEventListener("unhandledrejection", (t) => {
|
|
|
25607
25689
|
...n !== void 0 && { stack: n }
|
|
25608
25690
|
}), t.preventDefault();
|
|
25609
25691
|
});
|
|
25610
|
-
const $e = new
|
|
25611
|
-
|
|
25692
|
+
const $e = new Yt(), Ve = new q1((t) => self.postMessage(t));
|
|
25693
|
+
cn.current = Ve;
|
|
25612
25694
|
$e.setSceneErrorReporter(Ve);
|
|
25613
25695
|
let oo = null;
|
|
25614
25696
|
function ao(t) {
|
|
@@ -25699,4 +25781,4 @@ throw new Error("Scene code must define a render function");`, c = Object.getPro
|
|
|
25699
25781
|
}
|
|
25700
25782
|
}
|
|
25701
25783
|
self.setSceneCode = Kd;
|
|
25702
|
-
//# sourceMappingURL=viji.worker-
|
|
25784
|
+
//# sourceMappingURL=viji.worker-dW7fkaOy.js.map
|