libav-wasm 0.3.1 → 0.3.3
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/build/index.d.ts +3 -3
- package/build/libav.wasm +0 -0
- package/build/utils.d.ts +0 -31
- package/build/worker.d.ts +2 -2
- package/build/worker.js +260 -255
- package/package.json +1 -1
package/build/worker.js
CHANGED
|
@@ -24,23 +24,23 @@ const Na = "osra-message", Wa = ({
|
|
|
24
24
|
const { port1: u, port2: _ } = new MessageChannel();
|
|
25
25
|
return u.addEventListener("message", async (h) => {
|
|
26
26
|
try {
|
|
27
|
-
const I = await c(...h.data), i =
|
|
27
|
+
const I = await c(...h.data), i = xe(I), k = Zt(i);
|
|
28
28
|
u.postMessage({ result: i }, { transfer: k });
|
|
29
29
|
} catch (I) {
|
|
30
30
|
u.postMessage({ error: I });
|
|
31
31
|
}
|
|
32
32
|
}), u.start(), _;
|
|
33
|
-
},
|
|
33
|
+
}, xe = (c) => qt(c) || Kt(c) ? c : typeof c == "function" ? { [Gt]: Ha(c) } : Array.isArray(c) ? c.map(xe) : c && typeof c == "object" ? Object.fromEntries(
|
|
34
34
|
Object.entries(c).map(([u, _]) => [
|
|
35
35
|
u,
|
|
36
|
-
|
|
36
|
+
xe(_)
|
|
37
37
|
])
|
|
38
38
|
) : c, Ya = (c) => (...u) => new Promise((_, h) => {
|
|
39
|
-
const I =
|
|
39
|
+
const I = xe(u), i = Zt(I), k = ($) => {
|
|
40
40
|
$.data.error ? h($.data.error) : _(Xt($.data.result)), c.removeEventListener("message", k);
|
|
41
41
|
};
|
|
42
42
|
c.addEventListener("message", k), c.start(), c.postMessage(I, { transfer: i });
|
|
43
|
-
}), Xt = (c) => qt(c) || Kt(c) ? c : c && typeof c == "object" && c[Gt] ? Ya(c[Gt]) : Array.isArray(c) ? c.map(
|
|
43
|
+
}), Xt = (c) => qt(c) || Kt(c) ? c : c && typeof c == "object" && c[Gt] ? Ya(c[Gt]) : Array.isArray(c) ? c.map(xe) : c && typeof c == "object" ? Object.fromEntries(
|
|
44
44
|
Object.entries(c).map(([u, _]) => [
|
|
45
45
|
u,
|
|
46
46
|
Xt(_)
|
|
@@ -48,7 +48,7 @@ const Na = "osra-message", Wa = ({
|
|
|
48
48
|
) : c, ja = (c) => async (u, _) => {
|
|
49
49
|
const { port: h } = _, I = Xt(u);
|
|
50
50
|
try {
|
|
51
|
-
const i = await c(I, _), k =
|
|
51
|
+
const i = await c(I, _), k = xe(i), $ = Zt(k);
|
|
52
52
|
return h.postMessage({ result: k }, { transfer: $ }), h.close(), i;
|
|
53
53
|
} catch (i) {
|
|
54
54
|
throw h.postMessage({ error: i }), h.close(), i;
|
|
@@ -81,35 +81,35 @@ var Qt = {}, za = {
|
|
|
81
81
|
if (i.ENVIRONMENT)
|
|
82
82
|
throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");
|
|
83
83
|
var H = "";
|
|
84
|
-
function
|
|
84
|
+
function p(e) {
|
|
85
85
|
return i.locateFile ? i.locateFile(e, H) : H + e;
|
|
86
86
|
}
|
|
87
87
|
var N;
|
|
88
88
|
if (typeof document < "u" && document.currentScript && (H = document.currentScript.src), h && (H = h), H.indexOf("blob:") !== 0 ? H = H.substr(0, H.replace(/[?#].*/, "").lastIndexOf("/") + 1) : H = "", !(typeof window == "object" || typeof importScripts == "function"))
|
|
89
89
|
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
90
90
|
var W = i.print || console.log.bind(console), C = i.printErr || console.error.bind(console);
|
|
91
|
-
Object.assign(i, E), E = null, Ea(), i.arguments && i.arguments, ve("arguments", "arguments_"), i.thisProgram && (S = i.thisProgram), ve("thisProgram", "thisProgram"), i.quit && (F = i.quit), ve("quit", "quit_"),
|
|
91
|
+
Object.assign(i, E), E = null, Ea(), i.arguments && i.arguments, ve("arguments", "arguments_"), i.thisProgram && (S = i.thisProgram), ve("thisProgram", "thisProgram"), i.quit && (F = i.quit), ve("quit", "quit_"), g(typeof i.memoryInitializerPrefixURL > "u", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"), g(typeof i.pthreadMainPrefixURL > "u", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"), g(typeof i.cdInitializerPrefixURL > "u", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"), g(typeof i.filePackagePrefixURL > "u", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"), g(typeof i.read > "u", "Module.read option was removed (modify read_ in JS)"), g(typeof i.readAsync > "u", "Module.readAsync option was removed (modify readAsync in JS)"), g(typeof i.readBinary > "u", "Module.readBinary option was removed (modify readBinary in JS)"), g(typeof i.setWindowTitle > "u", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"), g(typeof i.TOTAL_MEMORY > "u", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"), ve("read", "read_"), ve("readAsync", "readAsync"), ve("readBinary", "readBinary"), ve("setWindowTitle", "setWindowTitle"), g(!Q, "worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."), g(!z, "node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."), g(!L, "shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");
|
|
92
92
|
var oe;
|
|
93
93
|
i.wasmBinary && (oe = i.wasmBinary), ve("wasmBinary", "wasmBinary");
|
|
94
94
|
var de = i.noExitRuntime || !0;
|
|
95
95
|
ve("noExitRuntime", "noExitRuntime"), typeof WebAssembly != "object" && J("no native wasm support detected");
|
|
96
|
-
var
|
|
97
|
-
function
|
|
96
|
+
var Se, _e = !1, Ue;
|
|
97
|
+
function g(e, t) {
|
|
98
98
|
e || J("Assertion failed" + (t ? ": " + t : ""));
|
|
99
99
|
}
|
|
100
|
-
var se, te,
|
|
100
|
+
var se, te, Fe, rt, b, x, er, tr;
|
|
101
101
|
function rr() {
|
|
102
|
-
var e =
|
|
103
|
-
i.HEAP8 = se = new Int8Array(e), i.HEAP16 =
|
|
102
|
+
var e = Se.buffer;
|
|
103
|
+
i.HEAP8 = se = new Int8Array(e), i.HEAP16 = Fe = new Int16Array(e), i.HEAP32 = b = new Int32Array(e), i.HEAPU8 = te = new Uint8Array(e), i.HEAPU16 = rt = new Uint16Array(e), i.HEAPU32 = x = new Uint32Array(e), i.HEAPF32 = er = new Float32Array(e), i.HEAPF64 = tr = new Float64Array(e);
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
g(!i.STACK_SIZE, "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"), g(
|
|
106
106
|
typeof Int32Array < "u" && typeof Float64Array < "u" && Int32Array.prototype.subarray != null && Int32Array.prototype.set != null,
|
|
107
107
|
"JS engine does not provide full typed array support"
|
|
108
|
-
),
|
|
108
|
+
), g(!i.wasmMemory, "Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"), g(!i.INITIAL_MEMORY, "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");
|
|
109
109
|
var nr;
|
|
110
110
|
function Xr() {
|
|
111
111
|
var e = Je();
|
|
112
|
-
|
|
112
|
+
g((e & 3) == 0), e == 0 && (e += 4), x[e >> 2] = 34821223, M(34821223), x[e + 4 >> 2] = 2310721022, M(2310721022), x[0] = 1668509029, M(1668509029);
|
|
113
113
|
}
|
|
114
114
|
function Le() {
|
|
115
115
|
if (!_e) {
|
|
@@ -135,7 +135,7 @@ var Qt = {}, za = {
|
|
|
135
135
|
it(wt);
|
|
136
136
|
}
|
|
137
137
|
function rn() {
|
|
138
|
-
|
|
138
|
+
g(!Tt), Tt = !0, Le(), Pn(), it(ir);
|
|
139
139
|
}
|
|
140
140
|
function nn() {
|
|
141
141
|
Le(), it(en);
|
|
@@ -155,12 +155,12 @@ var Qt = {}, za = {
|
|
|
155
155
|
function ln(e) {
|
|
156
156
|
ar.unshift(e);
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
var be = 0,
|
|
158
|
+
g(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), g(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), g(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), g(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");
|
|
159
|
+
var be = 0, Pe = null, Ne = null, We = {};
|
|
160
160
|
function un(e) {
|
|
161
|
-
be++, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (
|
|
161
|
+
be++, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (g(!We[e]), We[e] = 1, Pe === null && typeof setInterval < "u" && (Pe = setInterval(() => {
|
|
162
162
|
if (_e) {
|
|
163
|
-
clearInterval(
|
|
163
|
+
clearInterval(Pe), Pe = null;
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
var t = !1;
|
|
@@ -170,7 +170,7 @@ var Qt = {}, za = {
|
|
|
170
170
|
}, 1e4))) : C("warning: run dependency added without ID");
|
|
171
171
|
}
|
|
172
172
|
function cn(e) {
|
|
173
|
-
if (be--, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (
|
|
173
|
+
if (be--, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (g(We[e]), delete We[e]) : C("warning: run dependency removed without ID"), be == 0 && (Pe !== null && (clearInterval(Pe), Pe = null), Ne)) {
|
|
174
174
|
var t = Ne;
|
|
175
175
|
Ne = null, t();
|
|
176
176
|
}
|
|
@@ -223,11 +223,11 @@ var Qt = {}, za = {
|
|
|
223
223
|
function D(e, t) {
|
|
224
224
|
return function() {
|
|
225
225
|
var r = e, n = t;
|
|
226
|
-
return t || (n = i.asm),
|
|
226
|
+
return t || (n = i.asm), g(Tt, "native function `" + r + "` called before runtime initialization"), n[e] || g(n[e], "exported native function `" + r + "` not found"), n[e].apply(null, arguments);
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
229
|
var we;
|
|
230
|
-
we = "libav.wasm", sr(we) || (we =
|
|
230
|
+
we = "libav.wasm", sr(we) || (we = p(we));
|
|
231
231
|
function lr(e) {
|
|
232
232
|
try {
|
|
233
233
|
if (e == we && oe)
|
|
@@ -267,12 +267,12 @@ var Qt = {}, za = {
|
|
|
267
267
|
};
|
|
268
268
|
function t(a, s) {
|
|
269
269
|
var o = a.exports;
|
|
270
|
-
return o =
|
|
270
|
+
return o = y.instrumentWasmExports(o), i.asm = o, Se = i.asm.memory, g(Se, "memory not found in wasm exports"), rr(), nr = i.asm.__indirect_function_table, g(nr, "table not found in wasm exports"), sn(i.asm.__wasm_call_ctors), cn("wasm-instantiate"), o;
|
|
271
271
|
}
|
|
272
272
|
un("wasm-instantiate");
|
|
273
273
|
var r = i;
|
|
274
274
|
function n(a) {
|
|
275
|
-
|
|
275
|
+
g(i === r, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"), r = null, t(a.instance);
|
|
276
276
|
}
|
|
277
277
|
if (i.instantiateWasm)
|
|
278
278
|
try {
|
|
@@ -282,7 +282,7 @@ var Qt = {}, za = {
|
|
|
282
282
|
}
|
|
283
283
|
return vn(oe, we, e, n).catch($), {};
|
|
284
284
|
}
|
|
285
|
-
var ie,
|
|
285
|
+
var ie, Me;
|
|
286
286
|
function ve(e, t) {
|
|
287
287
|
Object.getOwnPropertyDescriptor(i, e) || Object.defineProperty(i, e, {
|
|
288
288
|
configurable: !0,
|
|
@@ -326,7 +326,7 @@ var Qt = {}, za = {
|
|
|
326
326
|
}
|
|
327
327
|
var yn = 2 ** 8 - 1, bn = 2 ** 16 - 1, wn = 2 ** 32 - 1, Tn = 2 ** 64 - 1, Cn = -(2 ** (8 - 1)) + 1, En = -(2 ** (16 - 1)) + 1, Sn = -(2 ** (32 - 1)) + 1, Fn = -(2 ** (64 - 1)) + 1;
|
|
328
328
|
function nt(e, t, r, n) {
|
|
329
|
-
|
|
329
|
+
g(Number.isInteger(Number(e)), "attempt to write non-integer (" + e + ") into integer heap"), g(e <= n, "value (" + e + ") too large to write as " + t + "-bit value"), g(e >= r, "value (" + e + ") too small to write as " + t + "-bit value");
|
|
330
330
|
}
|
|
331
331
|
var He = (e) => nt(e, 8, Cn, yn), Et = (e) => nt(e, 16, En, bn), M = (e) => nt(e, 32, Sn, wn), dr = (e) => nt(e, 64, Fn, Tn);
|
|
332
332
|
function _r(e) {
|
|
@@ -335,7 +335,7 @@ var Qt = {}, za = {
|
|
|
335
335
|
var it = (e) => {
|
|
336
336
|
for (; e.length > 0; )
|
|
337
337
|
e.shift()(i);
|
|
338
|
-
}, he = (e) => (
|
|
338
|
+
}, he = (e) => (g(typeof e == "number"), "0x" + e.toString(16).padStart(8, "0")), Pn = () => {
|
|
339
339
|
var e = zt(), t = Je();
|
|
340
340
|
Ia(e, t);
|
|
341
341
|
}, ce = (e) => {
|
|
@@ -374,7 +374,7 @@ var Qt = {}, za = {
|
|
|
374
374
|
}
|
|
375
375
|
function In(e, t, r) {
|
|
376
376
|
var n = new An(e);
|
|
377
|
-
n.init(t, r),
|
|
377
|
+
n.init(t, r), g(!1, "Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.");
|
|
378
378
|
}
|
|
379
379
|
var Dn = (e) => {
|
|
380
380
|
e = e >>> 0;
|
|
@@ -405,7 +405,7 @@ var Qt = {}, za = {
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
return s;
|
|
408
|
-
}, St = (e, t) => (
|
|
408
|
+
}, St = (e, t) => (g(typeof e == "number"), e ? hr(te, e, t) : "");
|
|
409
409
|
function Mn(e, t, r) {
|
|
410
410
|
return 0;
|
|
411
411
|
}
|
|
@@ -420,9 +420,9 @@ var Qt = {}, za = {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
function Ye(e) {
|
|
423
|
-
return this.fromWireType(
|
|
423
|
+
return this.fromWireType(b[e >> 2]);
|
|
424
424
|
}
|
|
425
|
-
var
|
|
425
|
+
var $e = {}, Ae = {}, ot = {}, On = 48, Rn = 57;
|
|
426
426
|
function Pt(e) {
|
|
427
427
|
if (e === void 0)
|
|
428
428
|
return "_unknown";
|
|
@@ -452,7 +452,7 @@ var Qt = {}, za = {
|
|
|
452
452
|
function st(e) {
|
|
453
453
|
throw new mr(e);
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Oe(e, t, r) {
|
|
456
456
|
e.forEach(function(l) {
|
|
457
457
|
ot[l] = t;
|
|
458
458
|
});
|
|
@@ -464,8 +464,8 @@ var Qt = {}, za = {
|
|
|
464
464
|
}
|
|
465
465
|
var a = new Array(t.length), s = [], o = 0;
|
|
466
466
|
t.forEach((l, d) => {
|
|
467
|
-
|
|
468
|
-
a[d] =
|
|
467
|
+
Ae.hasOwnProperty(l) ? a[d] = Ae[l] : (s.push(l), $e.hasOwnProperty(l) || ($e[l] = []), $e[l].push(() => {
|
|
468
|
+
a[d] = Ae[l], ++o, o === s.length && n(a);
|
|
469
469
|
}));
|
|
470
470
|
}), s.length === 0 && n(a);
|
|
471
471
|
}
|
|
@@ -473,7 +473,7 @@ var Qt = {}, za = {
|
|
|
473
473
|
var t = at[e];
|
|
474
474
|
delete at[e];
|
|
475
475
|
var r = t.rawConstructor, n = t.rawDestructor, a = t.fields, s = a.map((o) => o.getterReturnType).concat(a.map((o) => o.setterArgumentType));
|
|
476
|
-
|
|
476
|
+
Oe([e], s, (o) => {
|
|
477
477
|
var l = {};
|
|
478
478
|
return a.forEach((d, f) => {
|
|
479
479
|
var m = d.fieldName, P = o[f], A = d.getter, R = d.getterContext, j = o[f + a.length], V = d.setter, G = d.setterContext;
|
|
@@ -536,22 +536,22 @@ var Qt = {}, za = {
|
|
|
536
536
|
t += pr[te[r++]];
|
|
537
537
|
return t;
|
|
538
538
|
}
|
|
539
|
-
var
|
|
539
|
+
var Re = void 0;
|
|
540
540
|
function U(e) {
|
|
541
|
-
throw new
|
|
541
|
+
throw new Re(e);
|
|
542
542
|
}
|
|
543
543
|
function me(e, t, r = {}) {
|
|
544
544
|
if (!("argPackAdvance" in t))
|
|
545
545
|
throw new TypeError("registerType registeredInstance requires argPackAdvance");
|
|
546
546
|
var n = t.name;
|
|
547
|
-
if (e || U(`type "${n}" must have a positive integer typeid pointer`),
|
|
547
|
+
if (e || U(`type "${n}" must have a positive integer typeid pointer`), Ae.hasOwnProperty(e)) {
|
|
548
548
|
if (r.ignoreDuplicateRegistrations)
|
|
549
549
|
return;
|
|
550
550
|
U(`Cannot register type '${n}' twice`);
|
|
551
551
|
}
|
|
552
|
-
if (
|
|
553
|
-
var a =
|
|
554
|
-
delete
|
|
552
|
+
if (Ae[e] = t, delete ot[e], $e.hasOwnProperty(e)) {
|
|
553
|
+
var a = $e[e];
|
|
554
|
+
delete $e[e], a.forEach((s) => s());
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
function Ln(e, t, r, n, a) {
|
|
@@ -570,9 +570,9 @@ var Qt = {}, za = {
|
|
|
570
570
|
if (r === 1)
|
|
571
571
|
l = se;
|
|
572
572
|
else if (r === 2)
|
|
573
|
-
l =
|
|
573
|
+
l = Fe;
|
|
574
574
|
else if (r === 4)
|
|
575
|
-
l =
|
|
575
|
+
l = b;
|
|
576
576
|
else
|
|
577
577
|
throw new TypeError("Unknown boolean type size: " + t);
|
|
578
578
|
return this.fromWireType(l[o >> s]);
|
|
@@ -770,7 +770,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
770
770
|
function ti(e, t) {
|
|
771
771
|
if (t === null)
|
|
772
772
|
return this.isReference && U(`null is not a valid ${this.name}`), 0;
|
|
773
|
-
t.$$ || U(`Cannot pass "${
|
|
773
|
+
t.$$ || U(`Cannot pass "${ke(t)}" as a ${this.name}`), t.$$.ptr || U(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
774
774
|
var r = t.$$.ptrType.registeredClass, n = Rt(t.$$.ptr, r, this.registeredClass);
|
|
775
775
|
return n;
|
|
776
776
|
}
|
|
@@ -778,7 +778,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
778
778
|
var r;
|
|
779
779
|
if (t === null)
|
|
780
780
|
return this.isReference && U(`null is not a valid ${this.name}`), this.isSmartPointer ? (r = this.rawConstructor(), e !== null && e.push(this.rawDestructor, r), r) : 0;
|
|
781
|
-
t.$$ || U(`Cannot pass "${
|
|
781
|
+
t.$$ || U(`Cannot pass "${ke(t)}" as a ${this.name}`), t.$$.ptr || U(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && t.$$.ptrType.isConst && U(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
|
|
782
782
|
var n = t.$$.ptrType.registeredClass;
|
|
783
783
|
if (r = Rt(t.$$.ptr, n, this.registeredClass), this.isSmartPointer)
|
|
784
784
|
switch (t.$$.smartPtr === void 0 && U("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
|
|
@@ -809,7 +809,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
809
809
|
function ni(e, t) {
|
|
810
810
|
if (t === null)
|
|
811
811
|
return this.isReference && U(`null is not a valid ${this.name}`), 0;
|
|
812
|
-
t.$$ || U(`Cannot pass "${
|
|
812
|
+
t.$$ || U(`Cannot pass "${ke(t)}" as a ${this.name}`), t.$$.ptr || U(`Cannot pass deleted object as a pointer of type ${this.name}`), t.$$.ptrType.isConst && U(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);
|
|
813
813
|
var r = t.$$.ptrType.registeredClass, n = Rt(t.$$.ptr, r, this.registeredClass);
|
|
814
814
|
return n;
|
|
815
815
|
}
|
|
@@ -832,7 +832,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
832
832
|
i.hasOwnProperty(e) || st("Replacing nonexistant public symbol"), i[e].overloadTable !== void 0 && r !== void 0 ? i[e].overloadTable[r] = t : (i[e] = t, i[e].argCount = r);
|
|
833
833
|
}
|
|
834
834
|
var ui = (e, t, r) => {
|
|
835
|
-
|
|
835
|
+
g("dynCall_" + e in i, `bad function pointer type - dynCall function not found for sig '${e}'`), r && r.length ? g(r.length === e.substring(1).replace(/j/g, "--").length) : g(e.length == 1);
|
|
836
836
|
var n = i["dynCall_" + e];
|
|
837
837
|
return r && r.length ? n.apply(null, [t].concat(r)) : n.call(null, t);
|
|
838
838
|
}, ci = (e, t, r) => ui(e, t, r), fi = (e, t) => {
|
|
@@ -857,7 +857,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
857
857
|
function kt(e, t) {
|
|
858
858
|
var r = [], n = {};
|
|
859
859
|
function a(s) {
|
|
860
|
-
if (!n[s] && !
|
|
860
|
+
if (!n[s] && !Ae[s]) {
|
|
861
861
|
if (ot[s]) {
|
|
862
862
|
ot[s].forEach(a);
|
|
863
863
|
return;
|
|
@@ -872,7 +872,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
872
872
|
var R = Pt(m);
|
|
873
873
|
Xn(R, function() {
|
|
874
874
|
kt(`Cannot construct ${m} due to unbound types`, [n]);
|
|
875
|
-
}),
|
|
875
|
+
}), Oe(
|
|
876
876
|
[e, t, r],
|
|
877
877
|
n ? [n] : [],
|
|
878
878
|
function(j) {
|
|
@@ -881,12 +881,12 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
881
881
|
n ? (V = j.registeredClass, G = V.instancePrototype) : G = Te.prototype;
|
|
882
882
|
var K = At(R, function() {
|
|
883
883
|
if (Object.getPrototypeOf(this) !== v)
|
|
884
|
-
throw new
|
|
884
|
+
throw new Re("Use 'new' to construct " + m);
|
|
885
885
|
if (T.constructor_body === void 0)
|
|
886
|
-
throw new
|
|
886
|
+
throw new Re(m + " has no accessible constructor");
|
|
887
887
|
var _t = T.constructor_body[arguments.length];
|
|
888
888
|
if (_t === void 0)
|
|
889
|
-
throw new
|
|
889
|
+
throw new Re(`Tried to invoke ctor of ${m} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(T.constructor_body).toString()}) parameters instead!`);
|
|
890
890
|
return _t.apply(this, arguments);
|
|
891
891
|
}), v = Object.create(G, {
|
|
892
892
|
constructor: { value: K }
|
|
@@ -915,7 +915,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
915
915
|
!1,
|
|
916
916
|
!1,
|
|
917
917
|
!1
|
|
918
|
-
),
|
|
918
|
+
), Ie = new pe(
|
|
919
919
|
m + " const*",
|
|
920
920
|
T,
|
|
921
921
|
!1,
|
|
@@ -924,8 +924,8 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
924
924
|
);
|
|
925
925
|
return wr[e] = {
|
|
926
926
|
pointerType: q,
|
|
927
|
-
constPointerType:
|
|
928
|
-
}, li(R, K), [ee, q,
|
|
927
|
+
constPointerType: Ie
|
|
928
|
+
}, li(R, K), [ee, q, Ie];
|
|
929
929
|
}
|
|
930
930
|
);
|
|
931
931
|
}
|
|
@@ -979,7 +979,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
979
979
|
} catch (t) {
|
|
980
980
|
xt(t);
|
|
981
981
|
}
|
|
982
|
-
},
|
|
982
|
+
}, y = { instrumentWasmImports: function(e) {
|
|
983
983
|
var t = [/^invoke_.*$/, /^fd_sync$/, /^__wasi_fd_sync$/, /^__asyncjs__.*$/, /^emscripten_promise_await$/, /^emscripten_idb_load$/, /^emscripten_idb_store$/, /^emscripten_idb_delete$/, /^emscripten_idb_exists$/, /^emscripten_idb_load_blob$/, /^emscripten_idb_store_blob$/, /^emscripten_sleep$/, /^emscripten_wget$/, /^emscripten_wget_data$/, /^emscripten_scan_registers$/, /^emscripten_lazy_load_code$/, /^_load_secondary_module$/, /^emscripten_fiber_swap$/, /^SDL_Delay$/, /^_emval_await$/];
|
|
984
984
|
for (var r in e)
|
|
985
985
|
(function(n) {
|
|
@@ -987,12 +987,12 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
987
987
|
if (a.sig, typeof a == "function") {
|
|
988
988
|
var s = a.isAsync || t.some((o) => !!n.match(o));
|
|
989
989
|
e[n] = function() {
|
|
990
|
-
var o =
|
|
990
|
+
var o = y.state;
|
|
991
991
|
try {
|
|
992
992
|
return a.apply(null, arguments);
|
|
993
993
|
} finally {
|
|
994
|
-
var l = o ===
|
|
995
|
-
if (
|
|
994
|
+
var l = o === y.State.Normal && y.state === y.State.Disabled, d = n.startsWith("invoke_") && !0;
|
|
995
|
+
if (y.state !== o && !s && !l && !d)
|
|
996
996
|
throw new Error(`import ${n} was not in ASYNCIFY_IMPORTS, but changed the state`);
|
|
997
997
|
}
|
|
998
998
|
};
|
|
@@ -1004,82 +1004,82 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
1004
1004
|
(function(n) {
|
|
1005
1005
|
var a = e[n];
|
|
1006
1006
|
typeof a == "function" ? t[n] = function() {
|
|
1007
|
-
|
|
1007
|
+
y.exportCallStack.push(n);
|
|
1008
1008
|
try {
|
|
1009
1009
|
return a.apply(null, arguments);
|
|
1010
1010
|
} finally {
|
|
1011
1011
|
if (!_e) {
|
|
1012
|
-
var s =
|
|
1013
|
-
|
|
1012
|
+
var s = y.exportCallStack.pop();
|
|
1013
|
+
g(s === n), y.maybeStopUnwind();
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
1016
|
} : t[n] = a;
|
|
1017
1017
|
})(r);
|
|
1018
1018
|
return t;
|
|
1019
1019
|
}, State: { Normal: 0, Unwinding: 1, Rewinding: 2, Disabled: 3 }, state: 0, StackSize: 4096, currData: null, handleSleepReturnValue: 0, exportCallStack: [], callStackNameToId: {}, callStackIdToName: {}, callStackId: 0, asyncPromiseHandlers: null, sleepCallbacks: [], getCallStackId: function(e) {
|
|
1020
|
-
var t =
|
|
1021
|
-
return t === void 0 && (t =
|
|
1020
|
+
var t = y.callStackNameToId[e];
|
|
1021
|
+
return t === void 0 && (t = y.callStackId++, y.callStackNameToId[e] = t, y.callStackIdToName[t] = e), t;
|
|
1022
1022
|
}, maybeStopUnwind: function() {
|
|
1023
|
-
|
|
1023
|
+
y.currData && y.state === y.State.Unwinding && y.exportCallStack.length === 0 && (y.state = y.State.Normal, ut(Ma), typeof Fibers < "u" && Fibers.trampoline());
|
|
1024
1024
|
}, whenDone: function() {
|
|
1025
|
-
return
|
|
1026
|
-
|
|
1025
|
+
return g(y.currData, "Tried to wait for an async operation when none is in progress."), g(!y.asyncPromiseHandlers, "Cannot have multiple async operations in flight at once"), new Promise((e, t) => {
|
|
1026
|
+
y.asyncPromiseHandlers = { resolve: e, reject: t };
|
|
1027
1027
|
});
|
|
1028
1028
|
}, allocateData: function() {
|
|
1029
|
-
var e = ft(12 +
|
|
1030
|
-
return
|
|
1029
|
+
var e = ft(12 + y.StackSize);
|
|
1030
|
+
return y.setDataHeader(e, e + 12, y.StackSize), y.setDataRewindFunc(e), e;
|
|
1031
1031
|
}, setDataHeader: function(e, t, r) {
|
|
1032
|
-
|
|
1032
|
+
b[e >> 2] = t, M(t), b[e + 4 >> 2] = t + r, M(t + r);
|
|
1033
1033
|
}, setDataRewindFunc: function(e) {
|
|
1034
|
-
var t =
|
|
1035
|
-
|
|
1034
|
+
var t = y.exportCallStack[0], r = y.getCallStackId(t);
|
|
1035
|
+
b[e + 8 >> 2] = r, M(r);
|
|
1036
1036
|
}, getDataRewindFunc: function(e) {
|
|
1037
|
-
var t =
|
|
1037
|
+
var t = b[e + 8 >> 2], r = y.callStackIdToName[t], n = i.asm[r];
|
|
1038
1038
|
return n;
|
|
1039
1039
|
}, doRewind: function(e) {
|
|
1040
|
-
var t =
|
|
1040
|
+
var t = y.getDataRewindFunc(e);
|
|
1041
1041
|
return t();
|
|
1042
1042
|
}, handleSleep: function(e) {
|
|
1043
|
-
if (
|
|
1044
|
-
if (
|
|
1043
|
+
if (g(y.state !== y.State.Disabled, "Asyncify cannot be done during or after the runtime exits"), !_e) {
|
|
1044
|
+
if (y.state === y.State.Normal) {
|
|
1045
1045
|
var t = !1, r = !1;
|
|
1046
1046
|
e((n = 0) => {
|
|
1047
|
-
if (
|
|
1048
|
-
|
|
1047
|
+
if (g(!n || typeof n == "number" || typeof n == "boolean"), !_e && (y.handleSleepReturnValue = n, t = !0, !!r)) {
|
|
1048
|
+
g(!y.exportCallStack.length, "Waking up (starting to rewind) must be done from JS, without compiled code on the stack."), y.state = y.State.Rewinding, ut(() => $a(y.currData)), typeof Browser < "u" && Browser.mainLoop.func && Browser.mainLoop.resume();
|
|
1049
1049
|
var a, s = !1;
|
|
1050
1050
|
try {
|
|
1051
|
-
a =
|
|
1051
|
+
a = y.doRewind(y.currData);
|
|
1052
1052
|
} catch (d) {
|
|
1053
1053
|
a = d, s = !0;
|
|
1054
1054
|
}
|
|
1055
1055
|
var o = !1;
|
|
1056
|
-
if (!
|
|
1057
|
-
var l =
|
|
1058
|
-
l && (
|
|
1056
|
+
if (!y.currData) {
|
|
1057
|
+
var l = y.asyncPromiseHandlers;
|
|
1058
|
+
l && (y.asyncPromiseHandlers = null, (s ? l.reject : l.resolve)(a), o = !0);
|
|
1059
1059
|
}
|
|
1060
1060
|
if (s && !o)
|
|
1061
1061
|
throw a;
|
|
1062
1062
|
}
|
|
1063
|
-
}), r = !0, t || (
|
|
1063
|
+
}), r = !0, t || (y.state = y.State.Unwinding, y.currData = y.allocateData(), typeof Browser < "u" && Browser.mainLoop.func && Browser.mainLoop.pause(), ut(() => Da(y.currData)));
|
|
1064
1064
|
} else
|
|
1065
|
-
|
|
1066
|
-
return
|
|
1065
|
+
y.state === y.State.Rewinding ? (y.state = y.State.Normal, ut(Oa), ge(y.currData), y.currData = null, y.sleepCallbacks.forEach((n) => pi(n))) : J(`invalid state: ${y.state}`);
|
|
1066
|
+
return y.handleSleepReturnValue;
|
|
1067
1067
|
}
|
|
1068
1068
|
}, handleAsync: function(e) {
|
|
1069
|
-
return
|
|
1069
|
+
return y.handleSleep((t) => {
|
|
1070
1070
|
e().then(t);
|
|
1071
1071
|
});
|
|
1072
1072
|
} };
|
|
1073
1073
|
function Ar(e, t, r, n, a, s) {
|
|
1074
1074
|
var o = t.length;
|
|
1075
|
-
o < 2 && U("argTypes array size mismatch! Must at least get return value and 'this' types!"),
|
|
1075
|
+
o < 2 && U("argTypes array size mismatch! Must at least get return value and 'this' types!"), g(!s, "Async bindings are only supported with JSPI.");
|
|
1076
1076
|
for (var l = t[1] !== null && r !== null, d = !1, f = 1; f < t.length; ++f)
|
|
1077
1077
|
if (t[f] !== null && t[f].destructorFunction === void 0) {
|
|
1078
1078
|
d = !0;
|
|
1079
1079
|
break;
|
|
1080
1080
|
}
|
|
1081
1081
|
var m = t[0].name !== "void";
|
|
1082
|
-
s && (n =
|
|
1082
|
+
s && (n = y.makeAsyncFunction(n));
|
|
1083
1083
|
for (var P = "", A = "", f = 0; f < o - 2; ++f)
|
|
1084
1084
|
P += (f !== 0 ? ", " : "") + "arg" + f, A += (f !== 0 ? ", " : "") + "arg" + f + "Wired";
|
|
1085
1085
|
var R = `
|
|
@@ -1096,7 +1096,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
1096
1096
|
R += "var arg" + f + "Wired = argType" + f + ".toWireType(" + j + ", arg" + f + "); // " + t[f + 2].name + `
|
|
1097
1097
|
`, V.push("argType" + f), G.push(t[f + 2]);
|
|
1098
1098
|
if (l && (A = "thisWired" + (A.length > 0 ? ", " : "") + A), R += (m || s ? "var rv = " : "") + "invoker(fn" + (A.length > 0 ? ", " : "") + A + `);
|
|
1099
|
-
`, V.push("Asyncify"), G.push(
|
|
1099
|
+
`, V.push("Asyncify"), G.push(y), R += "function onDone(" + (m ? "rv" : "") + `) {
|
|
1100
1100
|
`, d)
|
|
1101
1101
|
R += `runDestructors(destructors);
|
|
1102
1102
|
`;
|
|
@@ -1114,23 +1114,23 @@ return ret;
|
|
|
1114
1114
|
`, V.push(R), _i(Function, V).apply(null, G);
|
|
1115
1115
|
}
|
|
1116
1116
|
function gi(e, t, r, n, a, s) {
|
|
1117
|
-
|
|
1117
|
+
g(t > 0);
|
|
1118
1118
|
var o = Fr(t, r);
|
|
1119
|
-
a = fe(n, a),
|
|
1119
|
+
a = fe(n, a), Oe([], [e], function(l) {
|
|
1120
1120
|
l = l[0];
|
|
1121
1121
|
var d = `constructor ${l.name}`;
|
|
1122
1122
|
if (l.registeredClass.constructor_body === void 0 && (l.registeredClass.constructor_body = []), l.registeredClass.constructor_body[t - 1] !== void 0)
|
|
1123
|
-
throw new
|
|
1123
|
+
throw new Re(`Cannot register multiple constructors with identical number of parameters (${t - 1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
1124
1124
|
return l.registeredClass.constructor_body[t - 1] = () => {
|
|
1125
1125
|
kt(`Cannot construct ${l.name} due to unbound types`, o);
|
|
1126
|
-
},
|
|
1126
|
+
}, Oe([], o, function(f) {
|
|
1127
1127
|
return f.splice(1, 0, null), l.registeredClass.constructor_body[t - 1] = Ar(d, f, null, a, s), [];
|
|
1128
1128
|
}), [];
|
|
1129
1129
|
});
|
|
1130
1130
|
}
|
|
1131
1131
|
function yi(e, t, r, n, a, s, o, l, d) {
|
|
1132
1132
|
var f = Fr(r, n);
|
|
1133
|
-
t = Z(t), s = fe(a, s),
|
|
1133
|
+
t = Z(t), s = fe(a, s), Oe([], [e], function(m) {
|
|
1134
1134
|
m = m[0];
|
|
1135
1135
|
var P = `${m.name}.${t}`;
|
|
1136
1136
|
t.startsWith("@@") && (t = Symbol[t.substring(2)]), l && m.registeredClass.pureVirtualFunctions.push(t);
|
|
@@ -1138,7 +1138,7 @@ return ret;
|
|
|
1138
1138
|
kt(`Cannot call ${P} due to unbound types`, f);
|
|
1139
1139
|
}
|
|
1140
1140
|
var R = m.registeredClass.instancePrototype, j = R[t];
|
|
1141
|
-
return j === void 0 || j.overloadTable === void 0 && j.className !== m.name && j.argCount === r - 2 ? (A.argCount = r - 2, A.className = m.name, R[t] = A) : (Cr(R, t, P), R[t].overloadTable[r - 2] = A),
|
|
1141
|
+
return j === void 0 || j.overloadTable === void 0 && j.className !== m.name && j.argCount === r - 2 ? (A.argCount = r - 2, A.className = m.name, R[t] = A) : (Cr(R, t, P), R[t].overloadTable[r - 2] = A), Oe([], f, function(V) {
|
|
1142
1142
|
var G = Ar(P, V, m, s, o, d);
|
|
1143
1143
|
return R[t].overloadTable === void 0 ? (G.argCount = r - 2, R[t] = G) : R[t].overloadTable[r - 2] = G, [];
|
|
1144
1144
|
}), [];
|
|
@@ -1146,14 +1146,14 @@ return ret;
|
|
|
1146
1146
|
}
|
|
1147
1147
|
function bi() {
|
|
1148
1148
|
this.allocated = [void 0], this.freelist = [], this.get = function(e) {
|
|
1149
|
-
return
|
|
1149
|
+
return g(this.allocated[e] !== void 0, `invalid handle: ${e}`), this.allocated[e];
|
|
1150
1150
|
}, this.has = function(e) {
|
|
1151
1151
|
return this.allocated[e] !== void 0;
|
|
1152
1152
|
}, this.allocate = function(e) {
|
|
1153
1153
|
var t = this.freelist.pop() || this.allocated.length;
|
|
1154
1154
|
return this.allocated[t] = e, t;
|
|
1155
1155
|
}, this.free = function(e) {
|
|
1156
|
-
|
|
1156
|
+
g(this.allocated[e] !== void 0), this.allocated[e] = void 0, this.freelist.push(e);
|
|
1157
1157
|
};
|
|
1158
1158
|
}
|
|
1159
1159
|
var ae = new bi();
|
|
@@ -1202,7 +1202,7 @@ return ret;
|
|
|
1202
1202
|
destructorFunction: null
|
|
1203
1203
|
});
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function ke(e) {
|
|
1206
1206
|
if (e === null)
|
|
1207
1207
|
return "null";
|
|
1208
1208
|
var t = typeof e;
|
|
@@ -1231,7 +1231,7 @@ return ret;
|
|
|
1231
1231
|
},
|
|
1232
1232
|
toWireType: function(a, s) {
|
|
1233
1233
|
if (typeof s != "number" && typeof s != "boolean")
|
|
1234
|
-
throw new TypeError(`Cannot convert ${
|
|
1234
|
+
throw new TypeError(`Cannot convert ${ke(s)} to ${this.name}`);
|
|
1235
1235
|
return s;
|
|
1236
1236
|
},
|
|
1237
1237
|
argPackAdvance: 8,
|
|
@@ -1249,13 +1249,13 @@ return ret;
|
|
|
1249
1249
|
};
|
|
1250
1250
|
case 1:
|
|
1251
1251
|
return r ? function(a) {
|
|
1252
|
-
return
|
|
1252
|
+
return Fe[a >> 1];
|
|
1253
1253
|
} : function(a) {
|
|
1254
1254
|
return rt[a >> 1];
|
|
1255
1255
|
};
|
|
1256
1256
|
case 2:
|
|
1257
1257
|
return r ? function(a) {
|
|
1258
|
-
return
|
|
1258
|
+
return b[a >> 2];
|
|
1259
1259
|
} : function(a) {
|
|
1260
1260
|
return x[a >> 2];
|
|
1261
1261
|
};
|
|
@@ -1272,9 +1272,9 @@ return ret;
|
|
|
1272
1272
|
}
|
|
1273
1273
|
var d = t.includes("unsigned"), f = (P, A) => {
|
|
1274
1274
|
if (typeof P != "number" && typeof P != "boolean")
|
|
1275
|
-
throw new TypeError(`Cannot convert "${
|
|
1275
|
+
throw new TypeError(`Cannot convert "${ke(P)}" to ${A}`);
|
|
1276
1276
|
if (P < n || P > a)
|
|
1277
|
-
throw new TypeError(`Passing a number "${
|
|
1277
|
+
throw new TypeError(`Passing a number "${ke(P)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${a}]!`);
|
|
1278
1278
|
}, m;
|
|
1279
1279
|
d ? m = function(P, A) {
|
|
1280
1280
|
return f(A, this.name), A >>> 0;
|
|
@@ -1315,7 +1315,7 @@ return ret;
|
|
|
1315
1315
|
});
|
|
1316
1316
|
}
|
|
1317
1317
|
var Ir = (e, t, r, n) => {
|
|
1318
|
-
if (
|
|
1318
|
+
if (g(typeof e == "string"), !(n > 0))
|
|
1319
1319
|
return 0;
|
|
1320
1320
|
for (var a = r, s = r + n - 1, o = 0; o < e.length; ++o) {
|
|
1321
1321
|
var l = e.charCodeAt(o);
|
|
@@ -1342,7 +1342,7 @@ return ret;
|
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
return t[r] = 0, r - a;
|
|
1345
|
-
}, Dr = (e, t, r) => (
|
|
1345
|
+
}, Dr = (e, t, r) => (g(typeof r == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), Ir(e, te, t, r)), Lt = (e) => {
|
|
1346
1346
|
for (var t = 0, r = 0; r < e.length; ++r) {
|
|
1347
1347
|
var n = e.charCodeAt(r);
|
|
1348
1348
|
n <= 127 ? t++ : n <= 2047 ? t += 2 : n >= 55296 && n <= 57343 ? (t += 4, ++r) : t += 3;
|
|
@@ -1396,31 +1396,31 @@ return ret;
|
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
1398
|
var Mr = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Di = (e, t) => {
|
|
1399
|
-
|
|
1399
|
+
g(e % 2 == 0, "Pointer passed to UTF16ToString must be aligned to two bytes!");
|
|
1400
1400
|
for (var r = e, n = r >> 1, a = n + t / 2; !(n >= a) && rt[n]; )
|
|
1401
1401
|
++n;
|
|
1402
1402
|
if (r = n << 1, r - e > 32 && Mr)
|
|
1403
1403
|
return Mr.decode(te.subarray(e, r));
|
|
1404
1404
|
for (var s = "", o = 0; !(o >= t / 2); ++o) {
|
|
1405
|
-
var l =
|
|
1405
|
+
var l = Fe[e + o * 2 >> 1];
|
|
1406
1406
|
if (l == 0)
|
|
1407
1407
|
break;
|
|
1408
1408
|
s += String.fromCharCode(l);
|
|
1409
1409
|
}
|
|
1410
1410
|
return s;
|
|
1411
1411
|
}, Mi = (e, t, r) => {
|
|
1412
|
-
if (
|
|
1412
|
+
if (g(t % 2 == 0, "Pointer passed to stringToUTF16 must be aligned to two bytes!"), g(typeof r == "number", "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r === void 0 && (r = 2147483647), r < 2)
|
|
1413
1413
|
return 0;
|
|
1414
1414
|
r -= 2;
|
|
1415
1415
|
for (var n = t, a = r < e.length * 2 ? r / 2 : e.length, s = 0; s < a; ++s) {
|
|
1416
1416
|
var o = e.charCodeAt(s);
|
|
1417
|
-
|
|
1417
|
+
Fe[t >> 1] = o, Et(o), t += 2;
|
|
1418
1418
|
}
|
|
1419
|
-
return
|
|
1419
|
+
return Fe[t >> 1] = 0, Et(0), t - n;
|
|
1420
1420
|
}, $i = (e) => e.length * 2, Oi = (e, t) => {
|
|
1421
|
-
|
|
1421
|
+
g(e % 4 == 0, "Pointer passed to UTF32ToString must be aligned to four bytes!");
|
|
1422
1422
|
for (var r = 0, n = ""; !(r >= t / 4); ) {
|
|
1423
|
-
var a =
|
|
1423
|
+
var a = b[e + r * 4 >> 2];
|
|
1424
1424
|
if (a == 0)
|
|
1425
1425
|
break;
|
|
1426
1426
|
if (++r, a >= 65536) {
|
|
@@ -1431,7 +1431,7 @@ return ret;
|
|
|
1431
1431
|
}
|
|
1432
1432
|
return n;
|
|
1433
1433
|
}, Ri = (e, t, r) => {
|
|
1434
|
-
if (
|
|
1434
|
+
if (g(t % 4 == 0, "Pointer passed to stringToUTF32 must be aligned to four bytes!"), g(typeof r == "number", "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r === void 0 && (r = 2147483647), r < 4)
|
|
1435
1435
|
return 0;
|
|
1436
1436
|
for (var n = t, a = n + r - 4, s = 0; s < e.length; ++s) {
|
|
1437
1437
|
var o = e.charCodeAt(s);
|
|
@@ -1439,10 +1439,10 @@ return ret;
|
|
|
1439
1439
|
var l = e.charCodeAt(++s);
|
|
1440
1440
|
o = 65536 + ((o & 1023) << 10) | l & 1023;
|
|
1441
1441
|
}
|
|
1442
|
-
if (
|
|
1442
|
+
if (b[t >> 2] = o, M(o), t += 4, t + 4 > a)
|
|
1443
1443
|
break;
|
|
1444
1444
|
}
|
|
1445
|
-
return
|
|
1445
|
+
return b[t >> 2] = 0, M(0), t - n;
|
|
1446
1446
|
}, ki = (e) => {
|
|
1447
1447
|
for (var t = 0, r = 0; r < e.length; ++r) {
|
|
1448
1448
|
var n = e.charCodeAt(r);
|
|
@@ -1508,7 +1508,7 @@ return ret;
|
|
|
1508
1508
|
}
|
|
1509
1509
|
var Wi = !0, Hi = () => Wi;
|
|
1510
1510
|
function Nt(e, t) {
|
|
1511
|
-
var r =
|
|
1511
|
+
var r = Ae[e];
|
|
1512
1512
|
return r === void 0 && U(t + " has unknown type " + Sr(e)), r;
|
|
1513
1513
|
}
|
|
1514
1514
|
function Yi(e, t, r) {
|
|
@@ -1517,7 +1517,7 @@ return ret;
|
|
|
1517
1517
|
return x[r >> 2] = a, t.toWireType(n, e);
|
|
1518
1518
|
}
|
|
1519
1519
|
var $r = function(e) {
|
|
1520
|
-
return
|
|
1520
|
+
return y.handleAsync(() => (e = X.toValue(e), e.then(X.toHandle)));
|
|
1521
1521
|
};
|
|
1522
1522
|
$r.isAsync = !0;
|
|
1523
1523
|
function ji(e, t) {
|
|
@@ -1561,48 +1561,48 @@ return ret;
|
|
|
1561
1561
|
return X.toHandle(r);
|
|
1562
1562
|
}
|
|
1563
1563
|
function Or(e) {
|
|
1564
|
-
return x[e >> 2] +
|
|
1564
|
+
return x[e >> 2] + b[e + 4 >> 2] * 4294967296;
|
|
1565
1565
|
}
|
|
1566
1566
|
var Zi = (e, t) => {
|
|
1567
1567
|
var r = new Date(Or(e) * 1e3);
|
|
1568
|
-
|
|
1568
|
+
b[t >> 2] = r.getUTCSeconds(), M(r.getUTCSeconds()), b[t + 4 >> 2] = r.getUTCMinutes(), M(r.getUTCMinutes()), b[t + 8 >> 2] = r.getUTCHours(), M(r.getUTCHours()), b[t + 12 >> 2] = r.getUTCDate(), M(r.getUTCDate()), b[t + 16 >> 2] = r.getUTCMonth(), M(r.getUTCMonth()), b[t + 20 >> 2] = r.getUTCFullYear() - 1900, M(r.getUTCFullYear() - 1900), b[t + 24 >> 2] = r.getUTCDay(), M(r.getUTCDay());
|
|
1569
1569
|
var n = Date.UTC(r.getUTCFullYear(), 0, 1, 0, 0, 0, 0), a = (r.getTime() - n) / (1e3 * 60 * 60 * 24) | 0;
|
|
1570
|
-
|
|
1570
|
+
b[t + 28 >> 2] = a, M(a);
|
|
1571
1571
|
}, Ge = (e) => e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0), Xi = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], ea = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Rr = (e) => {
|
|
1572
1572
|
var t = Ge(e.getFullYear()), r = t ? Xi : ea, n = r[e.getMonth()] + e.getDate() - 1;
|
|
1573
1573
|
return n;
|
|
1574
1574
|
}, ta = (e, t) => {
|
|
1575
1575
|
var r = new Date(Or(e) * 1e3);
|
|
1576
|
-
|
|
1576
|
+
b[t >> 2] = r.getSeconds(), M(r.getSeconds()), b[t + 4 >> 2] = r.getMinutes(), M(r.getMinutes()), b[t + 8 >> 2] = r.getHours(), M(r.getHours()), b[t + 12 >> 2] = r.getDate(), M(r.getDate()), b[t + 16 >> 2] = r.getMonth(), M(r.getMonth()), b[t + 20 >> 2] = r.getFullYear() - 1900, M(r.getFullYear() - 1900), b[t + 24 >> 2] = r.getDay(), M(r.getDay());
|
|
1577
1577
|
var n = Rr(r) | 0;
|
|
1578
|
-
|
|
1578
|
+
b[t + 28 >> 2] = n, M(n), b[t + 36 >> 2] = -(r.getTimezoneOffset() * 60), M(-(r.getTimezoneOffset() * 60));
|
|
1579
1579
|
var a = new Date(r.getFullYear(), 0, 1), s = new Date(r.getFullYear(), 6, 1).getTimezoneOffset(), o = a.getTimezoneOffset(), l = (s != o && r.getTimezoneOffset() == Math.min(o, s)) | 0;
|
|
1580
|
-
|
|
1580
|
+
b[t + 32 >> 2] = l, M(l);
|
|
1581
1581
|
}, ra = (e) => {
|
|
1582
1582
|
var t = new Date(
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1583
|
+
b[e + 20 >> 2] + 1900,
|
|
1584
|
+
b[e + 16 >> 2],
|
|
1585
|
+
b[e + 12 >> 2],
|
|
1586
|
+
b[e + 8 >> 2],
|
|
1587
|
+
b[e + 4 >> 2],
|
|
1588
|
+
b[e >> 2],
|
|
1589
1589
|
0
|
|
1590
|
-
), r =
|
|
1590
|
+
), r = b[e + 32 >> 2], n = t.getTimezoneOffset(), a = new Date(t.getFullYear(), 0, 1), s = new Date(t.getFullYear(), 6, 1).getTimezoneOffset(), o = a.getTimezoneOffset(), l = Math.min(o, s);
|
|
1591
1591
|
if (r < 0)
|
|
1592
|
-
|
|
1592
|
+
b[e + 32 >> 2] = Number(s != o && l == n), M(Number(s != o && l == n));
|
|
1593
1593
|
else if (r > 0 != (l == n)) {
|
|
1594
1594
|
var d = Math.max(o, s), f = r > 0 ? l : d;
|
|
1595
1595
|
t.setTime(t.getTime() + (f - n) * 6e4);
|
|
1596
1596
|
}
|
|
1597
|
-
|
|
1597
|
+
b[e + 24 >> 2] = t.getDay(), M(t.getDay());
|
|
1598
1598
|
var m = Rr(t) | 0;
|
|
1599
|
-
return
|
|
1599
|
+
return b[e + 28 >> 2] = m, M(m), b[e >> 2] = t.getSeconds(), M(t.getSeconds()), b[e + 4 >> 2] = t.getMinutes(), M(t.getMinutes()), b[e + 8 >> 2] = t.getHours(), M(t.getHours()), b[e + 12 >> 2] = t.getDate(), M(t.getDate()), b[e + 16 >> 2] = t.getMonth(), M(t.getMonth()), b[e + 20 >> 2] = t.getYear(), M(t.getYear()), t.getTime() / 1e3 | 0;
|
|
1600
1600
|
}, kr = (e) => {
|
|
1601
1601
|
var t = Lt(e) + 1, r = ft(t);
|
|
1602
1602
|
return r && Dr(e, r, t), r;
|
|
1603
1603
|
}, na = (e, t, r) => {
|
|
1604
1604
|
var n = new Date().getFullYear(), a = new Date(n, 0, 1), s = new Date(n, 6, 1), o = a.getTimezoneOffset(), l = s.getTimezoneOffset(), d = Math.max(o, l);
|
|
1605
|
-
x[e >> 2] = d * 60, M(d * 60),
|
|
1605
|
+
x[e >> 2] = d * 60, M(d * 60), b[t >> 2] = Number(o != l), M(Number(o != l));
|
|
1606
1606
|
function f(j) {
|
|
1607
1607
|
var V = j.toTimeString().match(/\(([A-Za-z ]+)\)$/);
|
|
1608
1608
|
return V ? V[1] : "GMT";
|
|
@@ -1618,15 +1618,15 @@ return ret;
|
|
|
1618
1618
|
var xr = () => 2147483648, oa = () => xr(), ct;
|
|
1619
1619
|
ct = () => performance.now();
|
|
1620
1620
|
var sa = (e) => {
|
|
1621
|
-
var t =
|
|
1621
|
+
var t = Se.buffer, r = e - t.byteLength + 65535 >>> 16;
|
|
1622
1622
|
try {
|
|
1623
|
-
return
|
|
1623
|
+
return Se.grow(r), rr(), 1;
|
|
1624
1624
|
} catch (n) {
|
|
1625
1625
|
C(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${n}`);
|
|
1626
1626
|
}
|
|
1627
1627
|
}, la = (e) => {
|
|
1628
1628
|
var t = te.length;
|
|
1629
|
-
e = e >>> 0,
|
|
1629
|
+
e = e >>> 0, g(e > t);
|
|
1630
1630
|
var r = xr();
|
|
1631
1631
|
if (e > r)
|
|
1632
1632
|
return C(`Cannot enlarge memory, asked to go up to ${e} bytes, but the limit is ${r} bytes!`), !1;
|
|
@@ -1659,7 +1659,7 @@ return ret;
|
|
|
1659
1659
|
return Qe.strings;
|
|
1660
1660
|
}, ca = (e, t) => {
|
|
1661
1661
|
for (var r = 0; r < e.length; ++r)
|
|
1662
|
-
|
|
1662
|
+
g(e.charCodeAt(r) === (e.charCodeAt(r) & 255)), se[t++ >> 0] = e.charCodeAt(r), He(e.charCodeAt(r));
|
|
1663
1663
|
se[t >> 0] = 0, He(0);
|
|
1664
1664
|
}, fa = (e, t) => {
|
|
1665
1665
|
var r = 0;
|
|
@@ -1679,16 +1679,16 @@ return ret;
|
|
|
1679
1679
|
}, va = (e, t) => {
|
|
1680
1680
|
var r = 0, n = 0, a = 0;
|
|
1681
1681
|
{
|
|
1682
|
-
|
|
1682
|
+
g(e == 0 || e == 1 || e == 2);
|
|
1683
1683
|
var s = 2;
|
|
1684
1684
|
e == 0 ? r = 2 : (e == 1 || e == 2) && (r = 64), a = 1;
|
|
1685
1685
|
}
|
|
1686
|
-
return se[t >> 0] = s, He(s),
|
|
1686
|
+
return se[t >> 0] = s, He(s), Fe[t + 2 >> 1] = a, Et(a), Me = [r >>> 0, (ie = r, +Math.abs(ie) >= 1 ? ie > 0 ? +Math.floor(ie / 4294967296) >>> 0 : ~~+Math.ceil((ie - +(~~ie >>> 0)) / 4294967296) >>> 0 : 0)], b[t + 8 >> 2] = Me[0], b[t + 12 >> 2] = Me[1], dr(r), Me = [n >>> 0, (ie = n, +Math.abs(ie) >= 1 ? ie > 0 ? +Math.floor(ie / 4294967296) >>> 0 : ~~+Math.ceil((ie - +(~~ie >>> 0)) / 4294967296) >>> 0 : 0)], b[t + 16 >> 2] = Me[0], b[t + 20 >> 2] = Me[1], dr(n), 0;
|
|
1687
1687
|
}, ha = (e, t, r, n) => {
|
|
1688
1688
|
J("fd_read called without SYSCALLS_REQUIRE_FILESYSTEM");
|
|
1689
1689
|
}, ma = (e, t, r, n, a) => 70, Ht = [null, [], []], Yt = (e, t) => {
|
|
1690
1690
|
var r = Ht[e];
|
|
1691
|
-
|
|
1691
|
+
g(r), t === 0 || t === 10 ? ((e === 1 ? W : C)(hr(r, 0)), r.length = 0) : r.push(t);
|
|
1692
1692
|
}, pa = () => {
|
|
1693
1693
|
Pa(0), Ht[1].length && Yt(1, 10), Ht[2].length && Yt(2, 10);
|
|
1694
1694
|
}, ga = (e, t, r, n) => {
|
|
@@ -1719,19 +1719,19 @@ return ret;
|
|
|
1719
1719
|
return t && (a.length = s), a;
|
|
1720
1720
|
}
|
|
1721
1721
|
var Ta = (e, t) => {
|
|
1722
|
-
|
|
1722
|
+
g(e.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"), se.set(e, t);
|
|
1723
1723
|
}, Ca = (e, t, r, n) => {
|
|
1724
|
-
var a =
|
|
1725
|
-
tm_sec:
|
|
1726
|
-
tm_min:
|
|
1727
|
-
tm_hour:
|
|
1728
|
-
tm_mday:
|
|
1729
|
-
tm_mon:
|
|
1730
|
-
tm_year:
|
|
1731
|
-
tm_wday:
|
|
1732
|
-
tm_yday:
|
|
1733
|
-
tm_isdst:
|
|
1734
|
-
tm_gmtoff:
|
|
1724
|
+
var a = b[n + 40 >> 2], s = {
|
|
1725
|
+
tm_sec: b[n >> 2],
|
|
1726
|
+
tm_min: b[n + 4 >> 2],
|
|
1727
|
+
tm_hour: b[n + 8 >> 2],
|
|
1728
|
+
tm_mday: b[n + 12 >> 2],
|
|
1729
|
+
tm_mon: b[n + 16 >> 2],
|
|
1730
|
+
tm_year: b[n + 20 >> 2],
|
|
1731
|
+
tm_wday: b[n + 24 >> 2],
|
|
1732
|
+
tm_yday: b[n + 28 >> 2],
|
|
1733
|
+
tm_isdst: b[n + 32 >> 2],
|
|
1734
|
+
tm_gmtoff: b[n + 36 >> 2],
|
|
1735
1735
|
tm_zone: a ? St(a) : ""
|
|
1736
1736
|
}, o = St(r), l = {
|
|
1737
1737
|
"%c": "%a %b %d %H:%M:%S %Y",
|
|
@@ -1775,8 +1775,8 @@ return ret;
|
|
|
1775
1775
|
return P(v, T, "0");
|
|
1776
1776
|
}
|
|
1777
1777
|
function R(v, T) {
|
|
1778
|
-
function ee(
|
|
1779
|
-
return
|
|
1778
|
+
function ee(Ie) {
|
|
1779
|
+
return Ie < 0 ? -1 : Ie > 0 ? 1 : 0;
|
|
1780
1780
|
}
|
|
1781
1781
|
var q;
|
|
1782
1782
|
return (q = ee(v.getFullYear() - T.getFullYear())) === 0 && (q = ee(v.getMonth() - T.getMonth())) === 0 && (q = ee(v.getDate() - T.getDate())), q;
|
|
@@ -1800,8 +1800,8 @@ return ret;
|
|
|
1800
1800
|
}
|
|
1801
1801
|
}
|
|
1802
1802
|
function V(v) {
|
|
1803
|
-
var T = ba(new Date(v.tm_year + 1900, 0, 1), v.tm_yday), ee = new Date(T.getFullYear(), 0, 4), q = new Date(T.getFullYear() + 1, 0, 4),
|
|
1804
|
-
return R(
|
|
1803
|
+
var T = ba(new Date(v.tm_year + 1900, 0, 1), v.tm_yday), ee = new Date(T.getFullYear(), 0, 4), q = new Date(T.getFullYear() + 1, 0, 4), Ie = j(ee), _t = j(q);
|
|
1804
|
+
return R(Ie, T) <= 0 ? R(_t, T) <= 0 ? T.getFullYear() + 1 : T.getFullYear() : T.getFullYear() - 1;
|
|
1805
1805
|
}
|
|
1806
1806
|
var G = {
|
|
1807
1807
|
"%a": (v) => f[v.tm_wday].substring(0, 3),
|
|
@@ -1869,7 +1869,7 @@ return ret;
|
|
|
1869
1869
|
var K = wa(o, !1);
|
|
1870
1870
|
return K.length > t ? 0 : (Ta(K, e), K.length - 1);
|
|
1871
1871
|
};
|
|
1872
|
-
mr = i.InternalError = It(Error, "InternalError"), Un(),
|
|
1872
|
+
mr = i.InternalError = It(Error, "InternalError"), Un(), Re = i.BindingError = It(Error, "BindingError"), Zn(), Vn(), si(), Er = i.UnboundTypeError = It(Error, "UnboundTypeError"), Ti();
|
|
1873
1873
|
function Ea() {
|
|
1874
1874
|
mn("fetchSettings");
|
|
1875
1875
|
}
|
|
@@ -1921,7 +1921,7 @@ return ret;
|
|
|
1921
1921
|
fd_write: ga,
|
|
1922
1922
|
strftime: Ca
|
|
1923
1923
|
};
|
|
1924
|
-
|
|
1924
|
+
y.instrumentWasmImports(jt), hn();
|
|
1925
1925
|
var ge = D("free"), ft = D("malloc"), Sa = i._main = D("main"), Fa = D("__getTypeName");
|
|
1926
1926
|
i.__embind_initialize_bindings = D("_embind_initialize_bindings");
|
|
1927
1927
|
var Pa = i._fflush = D("fflush"), Nr = function() {
|
|
@@ -2308,7 +2308,7 @@ return ret;
|
|
|
2308
2308
|
dt || Hr(), dt || (Ne = e);
|
|
2309
2309
|
};
|
|
2310
2310
|
function xa() {
|
|
2311
|
-
|
|
2311
|
+
g(be == 0, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'), g(wt.length == 0, "cannot call main when preRun functions remain to be called");
|
|
2312
2312
|
var e = Sa, t = 0, r = 0;
|
|
2313
2313
|
try {
|
|
2314
2314
|
var n = e(t, r);
|
|
@@ -2404,46 +2404,46 @@ var Jt = {}, Ba = {
|
|
|
2404
2404
|
var H = _ ? _ + S : S;
|
|
2405
2405
|
if (!this._events[H])
|
|
2406
2406
|
return !1;
|
|
2407
|
-
var
|
|
2408
|
-
if (
|
|
2409
|
-
switch (
|
|
2407
|
+
var p = this._events[H], N = arguments.length, W, C;
|
|
2408
|
+
if (p.fn) {
|
|
2409
|
+
switch (p.once && this.removeListener(S, p.fn, void 0, !0), N) {
|
|
2410
2410
|
case 1:
|
|
2411
|
-
return
|
|
2411
|
+
return p.fn.call(p.context), !0;
|
|
2412
2412
|
case 2:
|
|
2413
|
-
return
|
|
2413
|
+
return p.fn.call(p.context, F), !0;
|
|
2414
2414
|
case 3:
|
|
2415
|
-
return
|
|
2415
|
+
return p.fn.call(p.context, F, O), !0;
|
|
2416
2416
|
case 4:
|
|
2417
|
-
return
|
|
2417
|
+
return p.fn.call(p.context, F, O, Q), !0;
|
|
2418
2418
|
case 5:
|
|
2419
|
-
return
|
|
2419
|
+
return p.fn.call(p.context, F, O, Q, z), !0;
|
|
2420
2420
|
case 6:
|
|
2421
|
-
return
|
|
2421
|
+
return p.fn.call(p.context, F, O, Q, z, L), !0;
|
|
2422
2422
|
}
|
|
2423
2423
|
for (C = 1, W = new Array(N - 1); C < N; C++)
|
|
2424
2424
|
W[C - 1] = arguments[C];
|
|
2425
|
-
|
|
2425
|
+
p.fn.apply(p.context, W);
|
|
2426
2426
|
} else {
|
|
2427
|
-
var oe =
|
|
2427
|
+
var oe = p.length, de;
|
|
2428
2428
|
for (C = 0; C < oe; C++)
|
|
2429
|
-
switch (
|
|
2429
|
+
switch (p[C].once && this.removeListener(S, p[C].fn, void 0, !0), N) {
|
|
2430
2430
|
case 1:
|
|
2431
|
-
|
|
2431
|
+
p[C].fn.call(p[C].context);
|
|
2432
2432
|
break;
|
|
2433
2433
|
case 2:
|
|
2434
|
-
|
|
2434
|
+
p[C].fn.call(p[C].context, F);
|
|
2435
2435
|
break;
|
|
2436
2436
|
case 3:
|
|
2437
|
-
|
|
2437
|
+
p[C].fn.call(p[C].context, F, O);
|
|
2438
2438
|
break;
|
|
2439
2439
|
case 4:
|
|
2440
|
-
|
|
2440
|
+
p[C].fn.call(p[C].context, F, O, Q);
|
|
2441
2441
|
break;
|
|
2442
2442
|
default:
|
|
2443
2443
|
if (!W)
|
|
2444
2444
|
for (de = 1, W = new Array(N - 1); de < N; de++)
|
|
2445
2445
|
W[de - 1] = arguments[de];
|
|
2446
|
-
|
|
2446
|
+
p[C].fn.apply(p[C].context, W);
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
2449
|
return !0;
|
|
@@ -2461,9 +2461,9 @@ var Jt = {}, Ba = {
|
|
|
2461
2461
|
if (L.fn)
|
|
2462
2462
|
L.fn === F && (!Q || L.once) && (!O || L.context === O) && k(this, z);
|
|
2463
2463
|
else {
|
|
2464
|
-
for (var H = 0,
|
|
2465
|
-
(L[H].fn !== F || Q && !L[H].once || O && L[H].context !== O) &&
|
|
2466
|
-
|
|
2464
|
+
for (var H = 0, p = [], N = L.length; H < N; H++)
|
|
2465
|
+
(L[H].fn !== F || Q && !L[H].once || O && L[H].context !== O) && p.push(L[H]);
|
|
2466
|
+
p.length ? this._events[z] = p.length === 1 ? p[0] : p : k(this, z);
|
|
2467
2467
|
}
|
|
2468
2468
|
return this;
|
|
2469
2469
|
}, $.prototype.removeAllListeners = function(S) {
|
|
@@ -2538,7 +2538,7 @@ function qa(c, u, _) {
|
|
|
2538
2538
|
}
|
|
2539
2539
|
return h;
|
|
2540
2540
|
}
|
|
2541
|
-
var
|
|
2541
|
+
var De = globalThis && globalThis.__classPrivateFieldGet || function(c, u, _, h) {
|
|
2542
2542
|
if (_ === "a" && !h)
|
|
2543
2543
|
throw new TypeError("Private accessor was defined without a getter");
|
|
2544
2544
|
if (typeof u == "function" ? c !== u || !h : !u.has(c))
|
|
@@ -2558,22 +2558,22 @@ class Ka {
|
|
|
2558
2558
|
priority: _.priority,
|
|
2559
2559
|
run: u
|
|
2560
2560
|
};
|
|
2561
|
-
if (this.size &&
|
|
2562
|
-
|
|
2561
|
+
if (this.size && De(this, ye, "f")[this.size - 1].priority >= _.priority) {
|
|
2562
|
+
De(this, ye, "f").push(h);
|
|
2563
2563
|
return;
|
|
2564
2564
|
}
|
|
2565
|
-
const I = qa(
|
|
2566
|
-
|
|
2565
|
+
const I = qa(De(this, ye, "f"), h, (i, k) => k.priority - i.priority);
|
|
2566
|
+
De(this, ye, "f").splice(I, 0, h);
|
|
2567
2567
|
}
|
|
2568
2568
|
dequeue() {
|
|
2569
|
-
const u =
|
|
2569
|
+
const u = De(this, ye, "f").shift();
|
|
2570
2570
|
return u?.run;
|
|
2571
2571
|
}
|
|
2572
2572
|
filter(u) {
|
|
2573
|
-
return
|
|
2573
|
+
return De(this, ye, "f").filter((_) => _.priority === u.priority).map((_) => _.run);
|
|
2574
2574
|
}
|
|
2575
2575
|
get size() {
|
|
2576
|
-
return
|
|
2576
|
+
return De(this, ye, "f").length;
|
|
2577
2577
|
}
|
|
2578
2578
|
}
|
|
2579
2579
|
ye = /* @__PURE__ */ new WeakMap();
|
|
@@ -2585,7 +2585,7 @@ var Y = globalThis && globalThis.__classPrivateFieldSet || function(c, u, _, h,
|
|
|
2585
2585
|
if (typeof u == "function" ? c !== u || !I : !u.has(c))
|
|
2586
2586
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2587
2587
|
return h === "a" ? I.call(c, _) : I ? I.value = _ : u.set(c, _), _;
|
|
2588
|
-
},
|
|
2588
|
+
}, w = globalThis && globalThis.__classPrivateFieldGet || function(c, u, _, h) {
|
|
2589
2589
|
if (_ === "a" && !h)
|
|
2590
2590
|
throw new TypeError("Private accessor was defined without a getter");
|
|
2591
2591
|
if (typeof u == "function" ? c !== u || !h : !u.has(c))
|
|
@@ -2618,111 +2618,111 @@ class eo extends Ga {
|
|
|
2618
2618
|
Y(this, Ze, u.carryoverConcurrencyCount, "f"), Y(this, Xe, u.intervalCap === Number.POSITIVE_INFINITY || u.interval === 0, "f"), Y(this, yt, u.intervalCap, "f"), Y(this, et, u.interval, "f"), Y(this, re, new u.queueClass(), "f"), Y(this, ht, u.queueClass, "f"), this.concurrency = u.concurrency, this.timeout = u.timeout, Y(this, mt, u.throwOnTimeout === !0, "f"), Y(this, Ce, u.autoStart === !1, "f");
|
|
2619
2619
|
}
|
|
2620
2620
|
get concurrency() {
|
|
2621
|
-
return
|
|
2621
|
+
return w(this, tt, "f");
|
|
2622
2622
|
}
|
|
2623
2623
|
set concurrency(u) {
|
|
2624
2624
|
if (!(typeof u == "number" && u >= 1))
|
|
2625
2625
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${u}\` (${typeof u})`);
|
|
2626
|
-
Y(this, tt, u, "f"),
|
|
2626
|
+
Y(this, tt, u, "f"), w(this, B, "m", bt).call(this);
|
|
2627
2627
|
}
|
|
2628
2628
|
async add(u, _ = {}) {
|
|
2629
2629
|
return new Promise((h, I) => {
|
|
2630
2630
|
const i = async () => {
|
|
2631
2631
|
var k, $, E;
|
|
2632
|
-
Y(this, ne, ($ =
|
|
2632
|
+
Y(this, ne, ($ = w(this, ne, "f"), $++, $), "f"), Y(this, Ee, (E = w(this, Ee, "f"), E++, E), "f");
|
|
2633
2633
|
try {
|
|
2634
2634
|
if (!((k = _.signal) === null || k === void 0) && k.aborted) {
|
|
2635
2635
|
I(new Xa("The task was aborted."));
|
|
2636
2636
|
return;
|
|
2637
2637
|
}
|
|
2638
2638
|
const F = await (this.timeout === void 0 && _.timeout === void 0 ? u({ signal: _.signal }) : Ja(Promise.resolve(u({ signal: _.signal })), _.timeout === void 0 ? this.timeout : _.timeout, () => {
|
|
2639
|
-
(_.throwOnTimeout === void 0 ?
|
|
2639
|
+
(_.throwOnTimeout === void 0 ? w(this, mt, "f") : _.throwOnTimeout) && I(Za);
|
|
2640
2640
|
}));
|
|
2641
2641
|
h(F), this.emit("completed", F);
|
|
2642
2642
|
} catch (S) {
|
|
2643
2643
|
I(S), this.emit("error", S);
|
|
2644
2644
|
}
|
|
2645
|
-
|
|
2645
|
+
w(this, B, "m", Zr).call(this);
|
|
2646
2646
|
};
|
|
2647
|
-
|
|
2647
|
+
w(this, re, "f").enqueue(i, _), w(this, B, "m", pt).call(this), this.emit("add");
|
|
2648
2648
|
});
|
|
2649
2649
|
}
|
|
2650
2650
|
async addAll(u, _) {
|
|
2651
2651
|
return Promise.all(u.map(async (h) => this.add(h, _)));
|
|
2652
2652
|
}
|
|
2653
2653
|
start() {
|
|
2654
|
-
return
|
|
2654
|
+
return w(this, Ce, "f") ? (Y(this, Ce, !1, "f"), w(this, B, "m", bt).call(this), this) : this;
|
|
2655
2655
|
}
|
|
2656
2656
|
pause() {
|
|
2657
2657
|
Y(this, Ce, !0, "f");
|
|
2658
2658
|
}
|
|
2659
2659
|
clear() {
|
|
2660
|
-
Y(this, re, new (
|
|
2660
|
+
Y(this, re, new (w(this, ht, "f"))(), "f");
|
|
2661
2661
|
}
|
|
2662
2662
|
async onEmpty() {
|
|
2663
|
-
|
|
2663
|
+
w(this, re, "f").size !== 0 && await w(this, B, "m", gt).call(this, "empty");
|
|
2664
2664
|
}
|
|
2665
2665
|
async onSizeLessThan(u) {
|
|
2666
|
-
|
|
2666
|
+
w(this, re, "f").size < u || await w(this, B, "m", gt).call(this, "next", () => w(this, re, "f").size < u);
|
|
2667
2667
|
}
|
|
2668
2668
|
async onIdle() {
|
|
2669
|
-
|
|
2669
|
+
w(this, ne, "f") === 0 && w(this, re, "f").size === 0 || await w(this, B, "m", gt).call(this, "idle");
|
|
2670
2670
|
}
|
|
2671
2671
|
get size() {
|
|
2672
|
-
return
|
|
2672
|
+
return w(this, re, "f").size;
|
|
2673
2673
|
}
|
|
2674
2674
|
sizeBy(u) {
|
|
2675
|
-
return
|
|
2675
|
+
return w(this, re, "f").filter(u).length;
|
|
2676
2676
|
}
|
|
2677
2677
|
get pending() {
|
|
2678
|
-
return
|
|
2678
|
+
return w(this, ne, "f");
|
|
2679
2679
|
}
|
|
2680
2680
|
get isPaused() {
|
|
2681
|
-
return
|
|
2681
|
+
return w(this, Ce, "f");
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
2684
|
Ze = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet(), Vr = function() {
|
|
2685
|
-
return
|
|
2685
|
+
return w(this, Xe, "f") || w(this, Ee, "f") < w(this, yt, "f");
|
|
2686
2686
|
}, Br = function() {
|
|
2687
|
-
return
|
|
2687
|
+
return w(this, ne, "f") < w(this, tt, "f");
|
|
2688
2688
|
}, Zr = function() {
|
|
2689
2689
|
var u;
|
|
2690
|
-
Y(this, ne, (u =
|
|
2690
|
+
Y(this, ne, (u = w(this, ne, "f"), u--, u), "f"), w(this, B, "m", pt).call(this), this.emit("next");
|
|
2691
2691
|
}, Gr = function() {
|
|
2692
|
-
this.emit("empty"),
|
|
2692
|
+
this.emit("empty"), w(this, ne, "f") === 0 && this.emit("idle");
|
|
2693
2693
|
}, Qr = function() {
|
|
2694
|
-
|
|
2694
|
+
w(this, B, "m", Bt).call(this), w(this, B, "m", Vt).call(this), Y(this, Ke, void 0, "f");
|
|
2695
2695
|
}, Jr = function() {
|
|
2696
2696
|
const u = Date.now();
|
|
2697
|
-
if (
|
|
2698
|
-
const _ =
|
|
2697
|
+
if (w(this, ue, "f") === void 0) {
|
|
2698
|
+
const _ = w(this, vt, "f") - u;
|
|
2699
2699
|
if (_ < 0)
|
|
2700
|
-
Y(this, Ee,
|
|
2700
|
+
Y(this, Ee, w(this, Ze, "f") ? w(this, ne, "f") : 0, "f");
|
|
2701
2701
|
else
|
|
2702
|
-
return
|
|
2703
|
-
|
|
2702
|
+
return w(this, Ke, "f") === void 0 && Y(this, Ke, setTimeout(() => {
|
|
2703
|
+
w(this, B, "m", Qr).call(this);
|
|
2704
2704
|
}, _), "f"), !0;
|
|
2705
2705
|
}
|
|
2706
2706
|
return !1;
|
|
2707
2707
|
}, pt = function() {
|
|
2708
|
-
if (
|
|
2709
|
-
return
|
|
2710
|
-
if (!
|
|
2711
|
-
const u = !
|
|
2712
|
-
if (
|
|
2713
|
-
const _ =
|
|
2714
|
-
return _ ? (this.emit("active"), _(), u &&
|
|
2708
|
+
if (w(this, re, "f").size === 0)
|
|
2709
|
+
return w(this, ue, "f") && clearInterval(w(this, ue, "f")), Y(this, ue, void 0, "f"), w(this, B, "m", Gr).call(this), !1;
|
|
2710
|
+
if (!w(this, Ce, "f")) {
|
|
2711
|
+
const u = !w(this, B, "a", Jr);
|
|
2712
|
+
if (w(this, B, "a", Vr) && w(this, B, "a", Br)) {
|
|
2713
|
+
const _ = w(this, re, "f").dequeue();
|
|
2714
|
+
return _ ? (this.emit("active"), _(), u && w(this, B, "m", Vt).call(this), !0) : !1;
|
|
2715
2715
|
}
|
|
2716
2716
|
}
|
|
2717
2717
|
return !1;
|
|
2718
2718
|
}, Vt = function() {
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
},
|
|
2719
|
+
w(this, Xe, "f") || w(this, ue, "f") !== void 0 || (Y(this, ue, setInterval(() => {
|
|
2720
|
+
w(this, B, "m", Bt).call(this);
|
|
2721
|
+
}, w(this, et, "f")), "f"), Y(this, vt, Date.now() + w(this, et, "f"), "f"));
|
|
2722
2722
|
}, Bt = function() {
|
|
2723
|
-
|
|
2723
|
+
w(this, Ee, "f") === 0 && w(this, ne, "f") === 0 && w(this, ue, "f") && (clearInterval(w(this, ue, "f")), Y(this, ue, void 0, "f")), Y(this, Ee, w(this, Ze, "f") ? w(this, ne, "f") : 0, "f"), w(this, B, "m", bt).call(this);
|
|
2724
2724
|
}, bt = function() {
|
|
2725
|
-
for (;
|
|
2725
|
+
for (; w(this, B, "m", pt).call(this); )
|
|
2726
2726
|
;
|
|
2727
2727
|
}, gt = async function(u, _) {
|
|
2728
2728
|
return new Promise((h) => {
|
|
@@ -2740,25 +2740,23 @@ let qe;
|
|
|
2740
2740
|
const to = ja(async ({ publicPath: c, length: u, bufferSize: _, randomRead: h, streamRead: I, clearStream: i, attachment: k, subtitle: $ }) => {
|
|
2741
2741
|
qe || (qe = await qr(c));
|
|
2742
2742
|
let E = new Uint8Array(0), S, F, O;
|
|
2743
|
-
const Q = () => {
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
}));
|
|
2747
|
-
}, z = () => new qe.Remuxer({
|
|
2743
|
+
const Q = () => O || (O = new Promise((p, N) => {
|
|
2744
|
+
S = p, F = N;
|
|
2745
|
+
}), O), z = () => new qe.Remuxer({
|
|
2748
2746
|
promise: Promise.resolve(),
|
|
2749
2747
|
length: u,
|
|
2750
2748
|
bufferSize: _,
|
|
2751
|
-
error: (
|
|
2752
|
-
console.log("worker error",
|
|
2749
|
+
error: (p, N) => {
|
|
2750
|
+
console.log("worker error", p, N);
|
|
2753
2751
|
},
|
|
2754
|
-
subtitle: (
|
|
2755
|
-
$(
|
|
2752
|
+
subtitle: (p, N, W, ...C) => {
|
|
2753
|
+
$(p, N, W, ...C);
|
|
2756
2754
|
},
|
|
2757
|
-
attachment: (
|
|
2755
|
+
attachment: (p, N, W) => {
|
|
2758
2756
|
const C = new Uint8Array(W), oe = C.buffer.slice(C.byteOffset, C.byteOffset + C.byteLength);
|
|
2759
|
-
k(
|
|
2757
|
+
k(p, N, oe);
|
|
2760
2758
|
},
|
|
2761
|
-
streamRead: async (
|
|
2759
|
+
streamRead: async (p) => Promise.race([
|
|
2762
2760
|
new Promise((N) => {
|
|
2763
2761
|
H.on("add", function W() {
|
|
2764
2762
|
H.size !== 0 && (N(void 0), H.off("add", W));
|
|
@@ -2768,51 +2766,58 @@ const to = ja(async ({ publicPath: c, length: u, bufferSize: _, randomRead: h, s
|
|
|
2768
2766
|
done: !1,
|
|
2769
2767
|
cancelled: !0
|
|
2770
2768
|
})),
|
|
2771
|
-
I(Number(
|
|
2769
|
+
I(Number(p)).then(({ buffer: N, done: W, cancelled: C }) => ({
|
|
2772
2770
|
buffer: N ? new Uint8Array(N) : void 0,
|
|
2773
2771
|
done: W,
|
|
2774
2772
|
cancelled: C
|
|
2775
2773
|
}))
|
|
2776
2774
|
]),
|
|
2777
2775
|
clearStream: () => i(),
|
|
2778
|
-
randomRead: async (
|
|
2776
|
+
randomRead: async (p, N) => h(Number(p), N).then((W) => ({
|
|
2779
2777
|
buffer: W ? new Uint8Array(W) : void 0,
|
|
2780
2778
|
done: !1,
|
|
2781
2779
|
cancelled: !1
|
|
2782
2780
|
})),
|
|
2783
|
-
write: (
|
|
2784
|
-
const N = new Uint8Array(E.byteLength +
|
|
2785
|
-
N.set(E), N.set(new Uint8Array(
|
|
2781
|
+
write: (p) => {
|
|
2782
|
+
const N = new Uint8Array(E.byteLength + p.byteLength);
|
|
2783
|
+
N.set(E), N.set(new Uint8Array(p), E.byteLength), E = N;
|
|
2786
2784
|
},
|
|
2787
|
-
flush: async (
|
|
2788
|
-
const
|
|
2785
|
+
flush: async (p, N, W, C, oe) => {
|
|
2786
|
+
const de = Number(p), Se = Number(N);
|
|
2789
2787
|
if (!E.byteLength)
|
|
2790
2788
|
return !0;
|
|
2791
2789
|
if (!S)
|
|
2792
2790
|
throw new Error("No readResultPromiseResolve on libav flush");
|
|
2793
2791
|
return S({
|
|
2794
|
-
|
|
2795
|
-
offset:
|
|
2792
|
+
isTrailer: oe,
|
|
2793
|
+
offset: de,
|
|
2796
2794
|
buffer: E.buffer,
|
|
2797
|
-
pos:
|
|
2795
|
+
pos: Se,
|
|
2798
2796
|
pts: W,
|
|
2799
2797
|
duration: C
|
|
2800
2798
|
}), S = void 0, F = void 0, O = void 0, E = new Uint8Array(0), !1;
|
|
2801
2799
|
},
|
|
2802
2800
|
exit: () => {
|
|
2803
|
-
const
|
|
2804
|
-
S = void 0, F = void 0, O = void 0,
|
|
2801
|
+
const p = F;
|
|
2802
|
+
S = void 0, F = void 0, O = void 0, p?.(new Error("exit"));
|
|
2805
2803
|
}
|
|
2806
2804
|
});
|
|
2807
2805
|
let L = z();
|
|
2808
2806
|
const H = new eo({ concurrency: 1 });
|
|
2809
2807
|
return {
|
|
2810
|
-
init: async () =>
|
|
2808
|
+
init: async () => {
|
|
2809
|
+
E = new Uint8Array(0), qe = await qr(c), L = z();
|
|
2810
|
+
const p = Q();
|
|
2811
|
+
return L.init(), p;
|
|
2812
|
+
},
|
|
2811
2813
|
destroy: () => {
|
|
2812
2814
|
L.destroy(), L = void 0, qe = void 0, E = new Uint8Array(0);
|
|
2813
2815
|
},
|
|
2814
|
-
seek: (
|
|
2815
|
-
read: () => H.add(async () =>
|
|
2816
|
+
seek: (p) => H.add(() => L.seek(p)),
|
|
2817
|
+
read: () => H.add(async () => {
|
|
2818
|
+
const p = Q();
|
|
2819
|
+
return L.read(), p;
|
|
2820
|
+
}),
|
|
2816
2821
|
getInfo: async () => L.getInfo()
|
|
2817
2822
|
};
|
|
2818
2823
|
}), ro = {
|