@agicash/qr-scanner 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/worker.js ADDED
@@ -0,0 +1,1785 @@
1
+ // node_modules/zxing-wasm/dist/es/share.js
2
+ var m = [
3
+ ["Aztec", "M"],
4
+ ["Codabar", "L"],
5
+ ["Code39", "L"],
6
+ ["Code93", "L"],
7
+ ["Code128", "L"],
8
+ ["DataBar", "L"],
9
+ ["DataBarExpanded", "L"],
10
+ ["DataMatrix", "M"],
11
+ ["EAN-8", "L"],
12
+ ["EAN-13", "L"],
13
+ ["ITF", "L"],
14
+ ["MaxiCode", "M"],
15
+ ["PDF417", "M"],
16
+ ["QRCode", "M"],
17
+ ["UPC-A", "L"],
18
+ ["UPC-E", "L"],
19
+ ["MicroQRCode", "M"],
20
+ ["rMQRCode", "M"],
21
+ ["DXFilmEdge", "L"],
22
+ ["DataBarLimited", "L"]
23
+ ];
24
+ var O = m.map(([e]) => e);
25
+ var b = O.filter(
26
+ (e, t) => m[t][1] === "L"
27
+ );
28
+ var L = O.filter(
29
+ (e, t) => m[t][1] === "M"
30
+ );
31
+ function l(e) {
32
+ switch (e) {
33
+ case "Linear-Codes":
34
+ return b.reduce((t, r) => t | l(r), 0);
35
+ case "Matrix-Codes":
36
+ return L.reduce((t, r) => t | l(r), 0);
37
+ case "Any":
38
+ return (1 << m.length) - 1;
39
+ case "None":
40
+ return 0;
41
+ default:
42
+ return 1 << O.indexOf(e);
43
+ }
44
+ }
45
+ function w(e) {
46
+ if (e === 0)
47
+ return "None";
48
+ const t = 31 - Math.clz32(e);
49
+ return O[t];
50
+ }
51
+ function E(e) {
52
+ return e.reduce((t, r) => t | l(r), 0);
53
+ }
54
+ var M = [
55
+ "LocalAverage",
56
+ "GlobalHistogram",
57
+ "FixedThreshold",
58
+ "BoolCast"
59
+ ];
60
+ function x(e) {
61
+ return M.indexOf(e);
62
+ }
63
+ var y = [
64
+ "Unknown",
65
+ "ASCII",
66
+ "ISO8859_1",
67
+ "ISO8859_2",
68
+ "ISO8859_3",
69
+ "ISO8859_4",
70
+ "ISO8859_5",
71
+ "ISO8859_6",
72
+ "ISO8859_7",
73
+ "ISO8859_8",
74
+ "ISO8859_9",
75
+ "ISO8859_10",
76
+ "ISO8859_11",
77
+ "ISO8859_13",
78
+ "ISO8859_14",
79
+ "ISO8859_15",
80
+ "ISO8859_16",
81
+ "Cp437",
82
+ "Cp1250",
83
+ "Cp1251",
84
+ "Cp1252",
85
+ "Cp1256",
86
+ "Shift_JIS",
87
+ "Big5",
88
+ "GB2312",
89
+ "GB18030",
90
+ "EUC_JP",
91
+ "EUC_KR",
92
+ "UTF16BE",
93
+ /**
94
+ * UnicodeBig [[deprecated]]
95
+ */
96
+ "UTF16BE",
97
+ "UTF8",
98
+ "UTF16LE",
99
+ "UTF32BE",
100
+ "UTF32LE",
101
+ "BINARY"
102
+ ];
103
+ function B(e) {
104
+ return e === "UnicodeBig" ? y.indexOf("UTF16BE") : y.indexOf(e);
105
+ }
106
+ var F = [
107
+ "Text",
108
+ "Binary",
109
+ "Mixed",
110
+ "GS1",
111
+ "ISO15434",
112
+ "UnknownECI"
113
+ ];
114
+ function T(e) {
115
+ return F[e];
116
+ }
117
+ var A = ["Ignore", "Read", "Require"];
118
+ function U(e) {
119
+ return A.indexOf(e);
120
+ }
121
+ var R = ["Plain", "ECI", "HRI", "Hex", "Escaped"];
122
+ function p(e) {
123
+ return R.indexOf(e);
124
+ }
125
+ var u = {
126
+ formats: [],
127
+ tryHarder: true,
128
+ tryRotate: true,
129
+ tryInvert: true,
130
+ tryDownscale: true,
131
+ tryDenoise: false,
132
+ binarizer: "LocalAverage",
133
+ isPure: false,
134
+ downscaleFactor: 3,
135
+ downscaleThreshold: 500,
136
+ minLineCount: 2,
137
+ maxNumberOfSymbols: 255,
138
+ tryCode39ExtendedMode: true,
139
+ returnErrors: false,
140
+ eanAddOnSymbol: "Ignore",
141
+ textMode: "HRI",
142
+ characterSet: "Unknown"
143
+ };
144
+ function I(e) {
145
+ return {
146
+ ...e,
147
+ formats: E(e.formats),
148
+ binarizer: x(e.binarizer),
149
+ eanAddOnSymbol: U(e.eanAddOnSymbol),
150
+ textMode: p(e.textMode),
151
+ characterSet: B(e.characterSet)
152
+ };
153
+ }
154
+ function P(e) {
155
+ return {
156
+ ...e,
157
+ format: w(e.format),
158
+ contentType: T(e.contentType),
159
+ eccLevel: e.ecLevel
160
+ };
161
+ }
162
+ var h = {
163
+ format: "QRCode",
164
+ readerInit: false,
165
+ forceSquareDataMatrix: false,
166
+ ecLevel: "",
167
+ scale: 0,
168
+ sizeHint: 0,
169
+ rotate: 0,
170
+ withHRT: false,
171
+ withQuietZones: true,
172
+ options: ""
173
+ };
174
+ var W = {
175
+ locateFile: (e, t) => {
176
+ const r = e.match(/_(.+?)\.wasm$/);
177
+ return r ? `https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.4/dist/${r[1]}/${e}` : t + e;
178
+ }
179
+ };
180
+ var f = /* @__PURE__ */ new WeakMap();
181
+ function D(e, t) {
182
+ return Object.is(e, t) || Object.keys(e).length === Object.keys(t).length && Object.keys(e).every(
183
+ (r) => Object.hasOwn(t, r) && e[r] === t[r]
184
+ );
185
+ }
186
+ function S(e, {
187
+ overrides: t,
188
+ equalityFn: r = D,
189
+ fireImmediately: d = false
190
+ } = {}) {
191
+ var a;
192
+ const [o, s] = (a = f.get(e)) != null ? a : [W], n = t != null ? t : o;
193
+ let i;
194
+ if (d) {
195
+ if (s && (i = r(o, n)))
196
+ return s;
197
+ const c = e({
198
+ ...n
199
+ });
200
+ return f.set(e, [n, c]), c;
201
+ }
202
+ (i != null ? i : r(o, n)) || f.set(e, [n]);
203
+ }
204
+ async function Z(e, t, r = u) {
205
+ const d = {
206
+ ...u,
207
+ ...r
208
+ }, o = await S(e, {
209
+ fireImmediately: true
210
+ });
211
+ let s, n;
212
+ if ("width" in t && "height" in t && "data" in t) {
213
+ const {
214
+ data: a,
215
+ data: { byteLength: c },
216
+ width: g,
217
+ height: C
218
+ } = t;
219
+ n = o._malloc(c), o.HEAPU8.set(a, n), s = o.readBarcodesFromPixmap(
220
+ n,
221
+ g,
222
+ C,
223
+ I(d)
224
+ );
225
+ } else {
226
+ let a, c;
227
+ if ("buffer" in t)
228
+ [a, c] = [t.byteLength, t];
229
+ else if ("byteLength" in t)
230
+ [a, c] = [t.byteLength, new Uint8Array(t)];
231
+ else if ("size" in t)
232
+ [a, c] = [t.size, new Uint8Array(await t.arrayBuffer())];
233
+ else
234
+ throw new TypeError("Invalid input type");
235
+ n = o._malloc(a), o.HEAPU8.set(c, n), s = o.readBarcodesFromImage(
236
+ n,
237
+ a,
238
+ I(d)
239
+ );
240
+ }
241
+ o._free(n);
242
+ const i = [];
243
+ for (let a = 0; a < s.size(); ++a)
244
+ i.push(
245
+ P(s.get(a))
246
+ );
247
+ return i;
248
+ }
249
+ var j = {
250
+ ...u,
251
+ formats: [...u.formats]
252
+ };
253
+ var G = { ...h };
254
+
255
+ // node_modules/zxing-wasm/dist/es/reader/index.js
256
+ async function Wr(F2 = {}) {
257
+ var O2, N2, _r, l2 = F2, ke = !!globalThis.window, Oe = typeof Bun < "u", Dr = !!globalThis.WorkerGlobalScope;
258
+ !((N2 = globalThis.process) === null || N2 === void 0 || (N2 = N2.versions) === null || N2 === void 0) && N2.node && ((_r = globalThis.process) === null || _r === void 0 ? void 0 : _r.type) != "renderer";
259
+ var Mr = "./this.program", je, gr = "";
260
+ function Ee(r) {
261
+ return l2.locateFile ? l2.locateFile(r, gr) : gr + r;
262
+ }
263
+ var Ur, yr;
264
+ if (ke || Dr || Oe) {
265
+ try {
266
+ gr = new URL(".", je).href;
267
+ } catch {
268
+ }
269
+ Dr && (yr = (r) => {
270
+ var e = new XMLHttpRequest();
271
+ return e.open("GET", r, false), e.responseType = "arraybuffer", e.send(null), new Uint8Array(e.response);
272
+ }), Ur = async (r) => {
273
+ var e = await fetch(r, {
274
+ credentials: "same-origin"
275
+ });
276
+ if (e.ok)
277
+ return e.arrayBuffer();
278
+ throw new Error(e.status + " : " + e.url);
279
+ };
280
+ }
281
+ var Ir = console.log.bind(console), x2 = console.error.bind(console), X, Vr = false, Hr, Br, U2, j2, tr, G2, q, m2, Nr, xr, zr = false;
282
+ function Zr() {
283
+ var r = dr.buffer;
284
+ U2 = new Int8Array(r), tr = new Int16Array(r), l2.HEAPU8 = j2 = new Uint8Array(r), G2 = new Uint16Array(r), q = new Int32Array(r), m2 = new Uint32Array(r), Nr = new Float32Array(r), xr = new Float64Array(r);
285
+ }
286
+ function We() {
287
+ if (l2.preRun)
288
+ for (typeof l2.preRun == "function" && (l2.preRun = [l2.preRun]); l2.preRun.length; )
289
+ Ze(l2.preRun.shift());
290
+ Lr(Gr);
291
+ }
292
+ function De() {
293
+ zr = true, rr.xa();
294
+ }
295
+ function Me() {
296
+ if (l2.postRun)
297
+ for (typeof l2.postRun == "function" && (l2.postRun = [l2.postRun]); l2.postRun.length; )
298
+ ze(l2.postRun.shift());
299
+ Lr(Xr);
300
+ }
301
+ function mr(r) {
302
+ var e, t;
303
+ (e = l2.onAbort) === null || e === void 0 || e.call(l2, r), r = "Aborted(" + r + ")", x2(r), Vr = true, r += ". Build with -sASSERTIONS for more info.";
304
+ var n = new WebAssembly.RuntimeError(r);
305
+ throw (t = Br) === null || t === void 0 || t(n), n;
306
+ }
307
+ var z;
308
+ function Ue() {
309
+ return Ee("zxing_reader.wasm");
310
+ }
311
+ function Ie(r) {
312
+ if (r == z && X)
313
+ return new Uint8Array(X);
314
+ if (yr)
315
+ return yr(r);
316
+ throw "both async and sync fetching of the wasm failed";
317
+ }
318
+ async function Ve(r) {
319
+ if (!X)
320
+ try {
321
+ var e = await Ur(r);
322
+ return new Uint8Array(e);
323
+ } catch {
324
+ }
325
+ return Ie(r);
326
+ }
327
+ async function He(r, e) {
328
+ try {
329
+ var t = await Ve(r), n = await WebAssembly.instantiate(t, e);
330
+ return n;
331
+ } catch (i) {
332
+ x2(`failed to asynchronously prepare wasm: ${i}`), mr(i);
333
+ }
334
+ }
335
+ async function Be(r, e, t) {
336
+ if (!r && WebAssembly.instantiateStreaming)
337
+ try {
338
+ var n = fetch(e, {
339
+ credentials: "same-origin"
340
+ }), i = await WebAssembly.instantiateStreaming(n, t);
341
+ return i;
342
+ } catch (a) {
343
+ x2(`wasm streaming compile failed: ${a}`), x2("falling back to ArrayBuffer instantiation");
344
+ }
345
+ return He(e, t);
346
+ }
347
+ function Ne() {
348
+ var r = {
349
+ a: Pn
350
+ };
351
+ return r;
352
+ }
353
+ async function xe() {
354
+ function r(a, s) {
355
+ return rr = a.exports, Tn(rr), Zr(), rr;
356
+ }
357
+ function e(a) {
358
+ return r(a.instance);
359
+ }
360
+ var t = Ne();
361
+ if (l2.instantiateWasm)
362
+ return new Promise((a, s) => {
363
+ l2.instantiateWasm(t, (o, u2) => {
364
+ a(r(o));
365
+ });
366
+ });
367
+ z != null || (z = Ue());
368
+ var n = await Be(X, z, t), i = e(n);
369
+ return i;
370
+ }
371
+ var Lr = (r) => {
372
+ for (; r.length > 0; )
373
+ r.shift()(l2);
374
+ }, Xr = [], ze = (r) => Xr.push(r), Gr = [], Ze = (r) => Gr.push(r), p2 = (r) => _e(r), h2 = () => ge(), nr = [], ir = 0, Le = (r) => {
375
+ var e = new br(r);
376
+ return e.get_caught() || (e.set_caught(true), ir--), e.set_rethrown(false), nr.push(e), me(r), pe(r);
377
+ }, E2 = 0, Xe = () => {
378
+ d(0, 0);
379
+ var r = nr.pop();
380
+ ye(r.excPtr), E2 = 0;
381
+ };
382
+ class br {
383
+ constructor(e) {
384
+ this.excPtr = e, this.ptr = e - 24;
385
+ }
386
+ set_type(e) {
387
+ m2[this.ptr + 4 >> 2] = e;
388
+ }
389
+ get_type() {
390
+ return m2[this.ptr + 4 >> 2];
391
+ }
392
+ set_destructor(e) {
393
+ m2[this.ptr + 8 >> 2] = e;
394
+ }
395
+ get_destructor() {
396
+ return m2[this.ptr + 8 >> 2];
397
+ }
398
+ set_caught(e) {
399
+ e = e ? 1 : 0, U2[this.ptr + 12] = e;
400
+ }
401
+ get_caught() {
402
+ return U2[this.ptr + 12] != 0;
403
+ }
404
+ set_rethrown(e) {
405
+ e = e ? 1 : 0, U2[this.ptr + 13] = e;
406
+ }
407
+ get_rethrown() {
408
+ return U2[this.ptr + 13] != 0;
409
+ }
410
+ init(e, t) {
411
+ this.set_adjusted_ptr(0), this.set_type(e), this.set_destructor(t);
412
+ }
413
+ set_adjusted_ptr(e) {
414
+ m2[this.ptr + 16 >> 2] = e;
415
+ }
416
+ get_adjusted_ptr() {
417
+ return m2[this.ptr + 16 >> 2];
418
+ }
419
+ }
420
+ var ar = (r) => he(r), wr = (r) => {
421
+ var e = E2;
422
+ if (!e)
423
+ return ar(0), 0;
424
+ var t = new br(e);
425
+ t.set_adjusted_ptr(e);
426
+ var n = t.get_type();
427
+ if (!n)
428
+ return ar(0), e;
429
+ for (var i of r) {
430
+ if (i === 0 || i === n)
431
+ break;
432
+ var a = t.ptr + 16;
433
+ if (be(i, n, a))
434
+ return ar(i), e;
435
+ }
436
+ return ar(n), e;
437
+ }, Ge = () => wr([]), qe = (r) => wr([r]), Ye = (r, e) => wr([r, e]), Ke = () => {
438
+ var r = nr.pop();
439
+ r || mr("no exception to throw");
440
+ var e = r.excPtr;
441
+ throw r.get_rethrown() || (nr.push(r), r.set_rethrown(true), r.set_caught(false), ir++), E2 = e, E2;
442
+ }, Je = (r, e, t) => {
443
+ var n = new br(r);
444
+ throw n.init(e, t), E2 = r, ir++, E2;
445
+ }, Qe = () => ir, rt = (r) => {
446
+ throw E2 || (E2 = r), E2;
447
+ }, et = () => mr(""), sr = {}, $r = (r) => {
448
+ for (; r.length; ) {
449
+ var e = r.pop(), t = r.pop();
450
+ t(e);
451
+ }
452
+ };
453
+ function Y(r) {
454
+ return this.fromWireType(m2[r >> 2]);
455
+ }
456
+ var Z2 = {}, I2 = {}, or = {}, tt = class extends Error {
457
+ constructor(e) {
458
+ super(e), this.name = "InternalError";
459
+ }
460
+ }, ur = (r) => {
461
+ throw new tt(r);
462
+ }, V = (r, e, t) => {
463
+ r.forEach((o) => or[o] = e);
464
+ function n(o) {
465
+ var u2 = t(o);
466
+ u2.length !== r.length && ur("Mismatched type converter count");
467
+ for (var f2 = 0; f2 < r.length; ++f2)
468
+ S2(r[f2], u2[f2]);
469
+ }
470
+ var i = new Array(e.length), a = [], s = 0;
471
+ {
472
+ const o = e;
473
+ for (let u2 = 0; u2 < o.length; ++u2) {
474
+ const f2 = o[u2];
475
+ I2.hasOwnProperty(f2) ? i[u2] = I2[f2] : (a.push(f2), Z2.hasOwnProperty(f2) || (Z2[f2] = []), Z2[f2].push(() => {
476
+ i[u2] = I2[f2], ++s, s === a.length && n(i);
477
+ }));
478
+ }
479
+ }
480
+ a.length === 0 && n(i);
481
+ }, nt = (r) => {
482
+ var e = sr[r];
483
+ delete sr[r];
484
+ var t = e.rawConstructor, n = e.rawDestructor, i = e.fields, a = i.map((s) => s.getterReturnType).concat(i.map((s) => s.setterArgumentType));
485
+ V([r], a, (s) => {
486
+ var o = {};
487
+ {
488
+ const u2 = i;
489
+ for (let f2 = 0; f2 < u2.length; ++f2) {
490
+ const c = u2[f2], v2 = s[f2], y2 = c.getter, w2 = c.getterContext, P2 = s[f2 + i.length], T2 = c.setter, $ = c.setterContext;
491
+ o[c.fieldName] = {
492
+ read: (b2) => v2.fromWireType(y2(w2, b2)),
493
+ write: (b2, B2) => {
494
+ var R2 = [];
495
+ T2($, b2, P2.toWireType(R2, B2)), $r(R2);
496
+ },
497
+ optional: v2.optional
498
+ };
499
+ }
500
+ }
501
+ return [{
502
+ name: e.name,
503
+ fromWireType: (u2) => {
504
+ var f2 = {};
505
+ for (var c in o)
506
+ f2[c] = o[c].read(u2);
507
+ return n(u2), f2;
508
+ },
509
+ toWireType: (u2, f2) => {
510
+ for (var c in o)
511
+ if (!(c in f2) && !o[c].optional)
512
+ throw new TypeError(`Missing field: "${c}"`);
513
+ var v2 = t();
514
+ for (c in o)
515
+ o[c].write(v2, f2[c]);
516
+ return u2 !== null && u2.push(n, v2), v2;
517
+ },
518
+ readValueFromPointer: Y,
519
+ destructorFunction: n
520
+ }];
521
+ });
522
+ }, it = (r, e, t, n, i) => {
523
+ }, C = (r) => {
524
+ for (var e = ""; ; ) {
525
+ var t = j2[r++];
526
+ if (!t) return e;
527
+ e += String.fromCharCode(t);
528
+ }
529
+ }, K = class extends Error {
530
+ constructor(e) {
531
+ super(e), this.name = "BindingError";
532
+ }
533
+ }, g = (r) => {
534
+ throw new K(r);
535
+ };
536
+ function at(r, e) {
537
+ let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
538
+ var n = e.name;
539
+ if (r || g(`type "${n}" must have a positive integer typeid pointer`), I2.hasOwnProperty(r)) {
540
+ if (t.ignoreDuplicateRegistrations)
541
+ return;
542
+ g(`Cannot register type '${n}' twice`);
543
+ }
544
+ if (I2[r] = e, delete or[r], Z2.hasOwnProperty(r)) {
545
+ var i = Z2[r];
546
+ delete Z2[r], i.forEach((a) => a());
547
+ }
548
+ }
549
+ function S2(r, e) {
550
+ let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
551
+ return at(r, e, t);
552
+ }
553
+ var st = (r, e, t, n) => {
554
+ e = C(e), S2(r, {
555
+ name: e,
556
+ fromWireType: function(i) {
557
+ return !!i;
558
+ },
559
+ toWireType: function(i, a) {
560
+ return a ? t : n;
561
+ },
562
+ readValueFromPointer: function(i) {
563
+ return this.fromWireType(j2[i]);
564
+ },
565
+ destructorFunction: null
566
+ });
567
+ }, ot = (r) => ({
568
+ count: r.count,
569
+ deleteScheduled: r.deleteScheduled,
570
+ preservePointerOnDelete: r.preservePointerOnDelete,
571
+ ptr: r.ptr,
572
+ ptrType: r.ptrType,
573
+ smartPtr: r.smartPtr,
574
+ smartPtrType: r.smartPtrType
575
+ }), Tr = (r) => {
576
+ function e(t) {
577
+ return t.$$.ptrType.registeredClass.name;
578
+ }
579
+ g(e(r) + " instance already deleted");
580
+ }, Pr = false, qr = (r) => {
581
+ }, ut = (r) => {
582
+ r.smartPtr ? r.smartPtrType.rawDestructor(r.smartPtr) : r.ptrType.registeredClass.rawDestructor(r.ptr);
583
+ }, Yr = (r) => {
584
+ r.count.value -= 1;
585
+ var e = r.count.value === 0;
586
+ e && ut(r);
587
+ }, J = (r) => globalThis.FinalizationRegistry ? (Pr = new FinalizationRegistry((e) => {
588
+ Yr(e.$$);
589
+ }), J = (e) => {
590
+ var t = e.$$, n = !!t.smartPtr;
591
+ if (n) {
592
+ var i = {
593
+ $$: t
594
+ };
595
+ Pr.register(e, i, e);
596
+ }
597
+ return e;
598
+ }, qr = (e) => Pr.unregister(e), J(r)) : (J = (e) => e, r), ft = () => {
599
+ let r = fr.prototype;
600
+ Object.assign(r, {
601
+ isAliasOf(t) {
602
+ if (!(this instanceof fr) || !(t instanceof fr))
603
+ return false;
604
+ var n = this.$$.ptrType.registeredClass, i = this.$$.ptr;
605
+ t.$$ = t.$$;
606
+ for (var a = t.$$.ptrType.registeredClass, s = t.$$.ptr; n.baseClass; )
607
+ i = n.upcast(i), n = n.baseClass;
608
+ for (; a.baseClass; )
609
+ s = a.upcast(s), a = a.baseClass;
610
+ return n === a && i === s;
611
+ },
612
+ clone() {
613
+ if (this.$$.ptr || Tr(this), this.$$.preservePointerOnDelete)
614
+ return this.$$.count.value += 1, this;
615
+ var t = J(Object.create(Object.getPrototypeOf(this), {
616
+ $$: {
617
+ value: ot(this.$$)
618
+ }
619
+ }));
620
+ return t.$$.count.value += 1, t.$$.deleteScheduled = false, t;
621
+ },
622
+ delete() {
623
+ this.$$.ptr || Tr(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && g("Object already scheduled for deletion"), qr(this), Yr(this.$$), this.$$.preservePointerOnDelete || (this.$$.smartPtr = void 0, this.$$.ptr = void 0);
624
+ },
625
+ isDeleted() {
626
+ return !this.$$.ptr;
627
+ },
628
+ deleteLater() {
629
+ return this.$$.ptr || Tr(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && g("Object already scheduled for deletion"), this.$$.deleteScheduled = true, this;
630
+ }
631
+ });
632
+ const e = Symbol.dispose;
633
+ e && (r[e] = r.delete);
634
+ };
635
+ function fr() {
636
+ }
637
+ var Cr = (r, e) => Object.defineProperty(e, "name", {
638
+ value: r
639
+ }), Kr = {}, Jr = (r, e, t) => {
640
+ if (r[e].overloadTable === void 0) {
641
+ var n = r[e];
642
+ r[e] = function() {
643
+ for (var i = arguments.length, a = new Array(i), s = 0; s < i; s++)
644
+ a[s] = arguments[s];
645
+ return r[e].overloadTable.hasOwnProperty(a.length) || g(`Function '${t}' called with an invalid number of arguments (${a.length}) - expects one of (${r[e].overloadTable})!`), r[e].overloadTable[a.length].apply(this, a);
646
+ }, r[e].overloadTable = [], r[e].overloadTable[n.argCount] = n;
647
+ }
648
+ }, Qr = (r, e, t) => {
649
+ l2.hasOwnProperty(r) ? ((t === void 0 || l2[r].overloadTable !== void 0 && l2[r].overloadTable[t] !== void 0) && g(`Cannot register public name '${r}' twice`), Jr(l2, r, r), l2[r].overloadTable.hasOwnProperty(t) && g(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`), l2[r].overloadTable[t] = e) : (l2[r] = e, l2[r].argCount = t);
650
+ }, lt = 48, ct = 57, vt = (r) => {
651
+ r = r.replace(/[^a-zA-Z0-9_]/g, "$");
652
+ var e = r.charCodeAt(0);
653
+ return e >= lt && e <= ct ? `_${r}` : r;
654
+ };
655
+ function dt(r, e, t, n, i, a, s, o) {
656
+ this.name = r, this.constructor = e, this.instancePrototype = t, this.rawDestructor = n, this.baseClass = i, this.getActualType = a, this.upcast = s, this.downcast = o, this.pureVirtualFunctions = [];
657
+ }
658
+ var Rr = (r, e, t) => {
659
+ for (; e !== t; )
660
+ e.upcast || g(`Expected null or instance of ${t.name}, got an instance of ${e.name}`), r = e.upcast(r), e = e.baseClass;
661
+ return r;
662
+ }, Fr = (r) => {
663
+ if (r === null)
664
+ return "null";
665
+ var e = typeof r;
666
+ return e === "object" || e === "array" || e === "function" ? r.toString() : "" + r;
667
+ };
668
+ function pt(r, e) {
669
+ if (e === null)
670
+ return this.isReference && g(`null is not a valid ${this.name}`), 0;
671
+ e.$$ || g(`Cannot pass "${Fr(e)}" as a ${this.name}`), e.$$.ptr || g(`Cannot pass deleted object as a pointer of type ${this.name}`);
672
+ var t = e.$$.ptrType.registeredClass, n = Rr(e.$$.ptr, t, this.registeredClass);
673
+ return n;
674
+ }
675
+ function ht(r, e) {
676
+ var t;
677
+ if (e === null)
678
+ return this.isReference && g(`null is not a valid ${this.name}`), this.isSmartPointer ? (t = this.rawConstructor(), r !== null && r.push(this.rawDestructor, t), t) : 0;
679
+ (!e || !e.$$) && g(`Cannot pass "${Fr(e)}" as a ${this.name}`), e.$$.ptr || g(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && e.$$.ptrType.isConst && g(`Cannot convert argument of type ${e.$$.smartPtrType ? e.$$.smartPtrType.name : e.$$.ptrType.name} to parameter type ${this.name}`);
680
+ var n = e.$$.ptrType.registeredClass;
681
+ if (t = Rr(e.$$.ptr, n, this.registeredClass), this.isSmartPointer)
682
+ switch (e.$$.smartPtr === void 0 && g("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
683
+ case 0:
684
+ e.$$.smartPtrType === this ? t = e.$$.smartPtr : g(`Cannot convert argument of type ${e.$$.smartPtrType ? e.$$.smartPtrType.name : e.$$.ptrType.name} to parameter type ${this.name}`);
685
+ break;
686
+ case 1:
687
+ t = e.$$.smartPtr;
688
+ break;
689
+ case 2:
690
+ if (e.$$.smartPtrType === this)
691
+ t = e.$$.smartPtr;
692
+ else {
693
+ var i = e.clone();
694
+ t = this.rawShare(t, k.toHandle(() => i.delete())), r !== null && r.push(this.rawDestructor, t);
695
+ }
696
+ break;
697
+ default:
698
+ g("Unsupporting sharing policy");
699
+ }
700
+ return t;
701
+ }
702
+ function _t(r, e) {
703
+ if (e === null)
704
+ return this.isReference && g(`null is not a valid ${this.name}`), 0;
705
+ e.$$ || g(`Cannot pass "${Fr(e)}" as a ${this.name}`), e.$$.ptr || g(`Cannot pass deleted object as a pointer of type ${this.name}`), e.$$.ptrType.isConst && g(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);
706
+ var t = e.$$.ptrType.registeredClass, n = Rr(e.$$.ptr, t, this.registeredClass);
707
+ return n;
708
+ }
709
+ var re = (r, e, t) => {
710
+ if (e === t)
711
+ return r;
712
+ if (t.baseClass === void 0)
713
+ return null;
714
+ var n = re(r, e, t.baseClass);
715
+ return n === null ? null : t.downcast(n);
716
+ }, gt = {}, yt = (r, e) => {
717
+ for (e === void 0 && g("ptr should not be undefined"); r.baseClass; )
718
+ e = r.upcast(e), r = r.baseClass;
719
+ return e;
720
+ }, mt = (r, e) => (e = yt(r, e), gt[e]), lr = (r, e) => {
721
+ (!e.ptrType || !e.ptr) && ur("makeClassHandle requires ptr and ptrType");
722
+ var t = !!e.smartPtrType, n = !!e.smartPtr;
723
+ return t !== n && ur("Both smartPtrType and smartPtr must be specified"), e.count = {
724
+ value: 1
725
+ }, J(Object.create(r, {
726
+ $$: {
727
+ value: e,
728
+ writable: true
729
+ }
730
+ }));
731
+ };
732
+ function bt(r) {
733
+ var e = this.getPointee(r);
734
+ if (!e)
735
+ return this.destructor(r), null;
736
+ var t = mt(this.registeredClass, e);
737
+ if (t !== void 0) {
738
+ if (t.$$.count.value === 0)
739
+ return t.$$.ptr = e, t.$$.smartPtr = r, t.clone();
740
+ var n = t.clone();
741
+ return this.destructor(r), n;
742
+ }
743
+ function i() {
744
+ return this.isSmartPointer ? lr(this.registeredClass.instancePrototype, {
745
+ ptrType: this.pointeeType,
746
+ ptr: e,
747
+ smartPtrType: this,
748
+ smartPtr: r
749
+ }) : lr(this.registeredClass.instancePrototype, {
750
+ ptrType: this,
751
+ ptr: r
752
+ });
753
+ }
754
+ var a = this.registeredClass.getActualType(e), s = Kr[a];
755
+ if (!s)
756
+ return i.call(this);
757
+ var o;
758
+ this.isConst ? o = s.constPointerType : o = s.pointerType;
759
+ var u2 = re(e, this.registeredClass, o.registeredClass);
760
+ return u2 === null ? i.call(this) : this.isSmartPointer ? lr(o.registeredClass.instancePrototype, {
761
+ ptrType: o,
762
+ ptr: u2,
763
+ smartPtrType: this,
764
+ smartPtr: r
765
+ }) : lr(o.registeredClass.instancePrototype, {
766
+ ptrType: o,
767
+ ptr: u2
768
+ });
769
+ }
770
+ var wt = () => {
771
+ Object.assign(cr.prototype, {
772
+ getPointee(r) {
773
+ return this.rawGetPointee && (r = this.rawGetPointee(r)), r;
774
+ },
775
+ destructor(r) {
776
+ var e;
777
+ (e = this.rawDestructor) === null || e === void 0 || e.call(this, r);
778
+ },
779
+ readValueFromPointer: Y,
780
+ fromWireType: bt
781
+ });
782
+ };
783
+ function cr(r, e, t, n, i, a, s, o, u2, f2, c) {
784
+ this.name = r, this.registeredClass = e, this.isReference = t, this.isConst = n, this.isSmartPointer = i, this.pointeeType = a, this.sharingPolicy = s, this.rawGetPointee = o, this.rawConstructor = u2, this.rawShare = f2, this.rawDestructor = c, !i && e.baseClass === void 0 ? n ? (this.toWireType = pt, this.destructorFunction = null) : (this.toWireType = _t, this.destructorFunction = null) : this.toWireType = ht;
785
+ }
786
+ var ee = (r, e, t) => {
787
+ l2.hasOwnProperty(r) || ur("Replacing nonexistent public symbol"), l2[r].overloadTable !== void 0 && t !== void 0 ? l2[r].overloadTable[t] = e : (l2[r] = e, l2[r].argCount = t);
788
+ }, D2 = {}, $t = (r, e, t) => {
789
+ r = r.replace(/p/g, "i");
790
+ var n = D2[r];
791
+ return n(e, ...t);
792
+ }, te = [], _ = (r) => {
793
+ var e = te[r];
794
+ return e || (te[r] = e = Te.get(r)), e;
795
+ }, Tt = function(r, e) {
796
+ let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
797
+ if (r.includes("j"))
798
+ return $t(r, e, t);
799
+ var n = _(e), i = n(...t);
800
+ function a(s) {
801
+ return s;
802
+ }
803
+ return i;
804
+ }, Pt = function(r, e) {
805
+ let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
806
+ return function() {
807
+ for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++)
808
+ i[a] = arguments[a];
809
+ return Tt(r, e, i, t);
810
+ };
811
+ }, A2 = function(r, e) {
812
+ r = C(r);
813
+ function t() {
814
+ if (r.includes("j"))
815
+ return Pt(r, e);
816
+ var i = _(e);
817
+ return i;
818
+ }
819
+ var n = t();
820
+ return typeof n != "function" && g(`unknown function pointer with signature ${r}: ${e}`), n;
821
+ };
822
+ class Ct extends Error {
823
+ }
824
+ var ne = (r) => {
825
+ var e = de(r), t = C(e);
826
+ return M2(e), t;
827
+ }, vr = (r, e) => {
828
+ var t = [], n = {};
829
+ function i(a) {
830
+ if (!n[a] && !I2[a]) {
831
+ if (or[a]) {
832
+ or[a].forEach(i);
833
+ return;
834
+ }
835
+ t.push(a), n[a] = true;
836
+ }
837
+ }
838
+ throw e.forEach(i), new Ct(`${r}: ` + t.map(ne).join([", "]));
839
+ }, Rt = (r, e, t, n, i, a, s, o, u2, f2, c, v2, y2) => {
840
+ c = C(c), a = A2(i, a), o && (o = A2(s, o)), f2 && (f2 = A2(u2, f2)), y2 = A2(v2, y2);
841
+ var w2 = vt(c);
842
+ Qr(w2, function() {
843
+ vr(`Cannot construct ${c} due to unbound types`, [n]);
844
+ }), V([r, e, t], n ? [n] : [], (P2) => {
845
+ P2 = P2[0];
846
+ var T2, $;
847
+ n ? (T2 = P2.registeredClass, $ = T2.instancePrototype) : $ = fr.prototype;
848
+ var b2 = Cr(c, function() {
849
+ if (Object.getPrototypeOf(this) !== B2)
850
+ throw new K(`Use 'new' to construct ${c}`);
851
+ if (R2.constructor_body === void 0)
852
+ throw new K(`${c} has no accessible constructor`);
853
+ for (var Re = arguments.length, pr = new Array(Re), hr = 0; hr < Re; hr++)
854
+ pr[hr] = arguments[hr];
855
+ var Fe = R2.constructor_body[pr.length];
856
+ if (Fe === void 0)
857
+ throw new K(`Tried to invoke ctor of ${c} with invalid number of parameters (${pr.length}) - expected (${Object.keys(R2.constructor_body).toString()}) parameters instead!`);
858
+ return Fe.apply(this, pr);
859
+ }), B2 = Object.create($, {
860
+ constructor: {
861
+ value: b2
862
+ }
863
+ });
864
+ b2.prototype = B2;
865
+ var R2 = new dt(c, b2, B2, y2, T2, a, o, f2);
866
+ if (R2.baseClass) {
867
+ var W2, er;
868
+ (er = (W2 = R2.baseClass).__derivedClasses) !== null && er !== void 0 || (W2.__derivedClasses = []), R2.baseClass.__derivedClasses.push(R2);
869
+ }
870
+ var oi = new cr(c, R2, true, false, false), Pe = new cr(c + "*", R2, false, false, false), Ce = new cr(c + " const*", R2, false, true, false);
871
+ return Kr[r] = {
872
+ pointerType: Pe,
873
+ constPointerType: Ce
874
+ }, ee(w2, b2), [oi, Pe, Ce];
875
+ });
876
+ }, Ar = (r, e) => {
877
+ for (var t = [], n = 0; n < r; n++)
878
+ t.push(m2[e + n * 4 >> 2]);
879
+ return t;
880
+ };
881
+ function Ft(r) {
882
+ for (var e = 1; e < r.length; ++e)
883
+ if (r[e] !== null && r[e].destructorFunction === void 0)
884
+ return true;
885
+ return false;
886
+ }
887
+ function Sr(r, e, t, n, i, a) {
888
+ var s = e.length;
889
+ s < 2 && g("argTypes array size mismatch! Must at least get return value and 'this' types!");
890
+ var o = e[1] !== null && t !== null, u2 = Ft(e), f2 = !e[0].isVoid, c = s - 2, v2 = new Array(c), y2 = [], w2 = [], P2 = function() {
891
+ w2.length = 0;
892
+ var T2;
893
+ y2.length = o ? 2 : 1, y2[0] = i, o && (T2 = e[1].toWireType(w2, this), y2[1] = T2);
894
+ for (var $ = 0; $ < c; ++$)
895
+ v2[$] = e[$ + 2].toWireType(w2, $ < 0 || arguments.length <= $ ? void 0 : arguments[$]), y2.push(v2[$]);
896
+ var b2 = n(...y2);
897
+ function B2(R2) {
898
+ if (u2)
899
+ $r(w2);
900
+ else
901
+ for (var W2 = o ? 1 : 2; W2 < e.length; W2++) {
902
+ var er = W2 === 1 ? T2 : v2[W2 - 2];
903
+ e[W2].destructorFunction !== null && e[W2].destructorFunction(er);
904
+ }
905
+ if (f2)
906
+ return e[0].fromWireType(R2);
907
+ }
908
+ return B2(b2);
909
+ };
910
+ return Cr(r, P2);
911
+ }
912
+ var At = (r, e, t, n, i, a) => {
913
+ var s = Ar(e, t);
914
+ i = A2(n, i), V([], [r], (o) => {
915
+ o = o[0];
916
+ var u2 = `constructor ${o.name}`;
917
+ if (o.registeredClass.constructor_body === void 0 && (o.registeredClass.constructor_body = []), o.registeredClass.constructor_body[e - 1] !== void 0)
918
+ throw new K(`Cannot register multiple constructors with identical number of parameters (${e - 1}) for class '${o.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
919
+ return o.registeredClass.constructor_body[e - 1] = () => {
920
+ vr(`Cannot construct ${o.name} due to unbound types`, s);
921
+ }, V([], s, (f2) => (f2.splice(1, 0, null), o.registeredClass.constructor_body[e - 1] = Sr(u2, f2, null, i, a), [])), [];
922
+ });
923
+ }, ie = (r) => {
924
+ r = r.trim();
925
+ const e = r.indexOf("(");
926
+ return e === -1 ? r : r.slice(0, e);
927
+ }, St = (r, e, t, n, i, a, s, o, u2, f2) => {
928
+ var c = Ar(t, n);
929
+ e = C(e), e = ie(e), a = A2(i, a), V([], [r], (v2) => {
930
+ v2 = v2[0];
931
+ var y2 = `${v2.name}.${e}`;
932
+ e.startsWith("@@") && (e = Symbol[e.substring(2)]), o && v2.registeredClass.pureVirtualFunctions.push(e);
933
+ function w2() {
934
+ vr(`Cannot call ${y2} due to unbound types`, c);
935
+ }
936
+ var P2 = v2.registeredClass.instancePrototype, T2 = P2[e];
937
+ return T2 === void 0 || T2.overloadTable === void 0 && T2.className !== v2.name && T2.argCount === t - 2 ? (w2.argCount = t - 2, w2.className = v2.name, P2[e] = w2) : (Jr(P2, e, y2), P2[e].overloadTable[t - 2] = w2), V([], c, ($) => {
938
+ var b2 = Sr(y2, $, v2, a, s);
939
+ return P2[e].overloadTable === void 0 ? (b2.argCount = t - 2, P2[e] = b2) : P2[e].overloadTable[t - 2] = b2, [];
940
+ }), [];
941
+ });
942
+ }, ae = [], H2 = [0, 1, , 1, null, 1, true, 1, false, 1], kr = (r) => {
943
+ r > 9 && --H2[r + 1] === 0 && (H2[r] = void 0, ae.push(r));
944
+ }, k = {
945
+ toValue: (r) => (r || g(`Cannot use deleted val. handle = ${r}`), H2[r]),
946
+ toHandle: (r) => {
947
+ switch (r) {
948
+ case void 0:
949
+ return 2;
950
+ case null:
951
+ return 4;
952
+ case true:
953
+ return 6;
954
+ case false:
955
+ return 8;
956
+ default: {
957
+ const e = ae.pop() || H2.length;
958
+ return H2[e] = r, H2[e + 1] = 1, e;
959
+ }
960
+ }
961
+ }
962
+ }, se = {
963
+ name: "emscripten::val",
964
+ fromWireType: (r) => {
965
+ var e = k.toValue(r);
966
+ return kr(r), e;
967
+ },
968
+ toWireType: (r, e) => k.toHandle(e),
969
+ readValueFromPointer: Y,
970
+ destructorFunction: null
971
+ }, kt = (r) => S2(r, se), Ot = (r, e) => {
972
+ switch (e) {
973
+ case 4:
974
+ return function(t) {
975
+ return this.fromWireType(Nr[t >> 2]);
976
+ };
977
+ case 8:
978
+ return function(t) {
979
+ return this.fromWireType(xr[t >> 3]);
980
+ };
981
+ default:
982
+ throw new TypeError(`invalid float width (${e}): ${r}`);
983
+ }
984
+ }, jt = (r, e, t) => {
985
+ e = C(e), S2(r, {
986
+ name: e,
987
+ fromWireType: (n) => n,
988
+ toWireType: (n, i) => i,
989
+ readValueFromPointer: Ot(e, t),
990
+ destructorFunction: null
991
+ });
992
+ }, Et = (r, e, t, n, i, a, s, o) => {
993
+ var u2 = Ar(e, t);
994
+ r = C(r), r = ie(r), i = A2(n, i), Qr(r, function() {
995
+ vr(`Cannot call ${r} due to unbound types`, u2);
996
+ }, e - 1), V([], u2, (f2) => {
997
+ var c = [f2[0], null].concat(f2.slice(1));
998
+ return ee(r, Sr(r, c, null, i, a), e - 1), [];
999
+ });
1000
+ }, Wt = (r, e, t) => {
1001
+ switch (e) {
1002
+ case 1:
1003
+ return t ? (n) => U2[n] : (n) => j2[n];
1004
+ case 2:
1005
+ return t ? (n) => tr[n >> 1] : (n) => G2[n >> 1];
1006
+ case 4:
1007
+ return t ? (n) => q[n >> 2] : (n) => m2[n >> 2];
1008
+ default:
1009
+ throw new TypeError(`invalid integer width (${e}): ${r}`);
1010
+ }
1011
+ }, Dt = (r, e, t, n, i) => {
1012
+ e = C(e);
1013
+ const a = n === 0;
1014
+ let s = (u2) => u2;
1015
+ if (a) {
1016
+ var o = 32 - 8 * t;
1017
+ s = (u2) => u2 << o >>> o, i = s(i);
1018
+ }
1019
+ S2(r, {
1020
+ name: e,
1021
+ fromWireType: s,
1022
+ toWireType: (u2, f2) => f2,
1023
+ readValueFromPointer: Wt(e, t, n !== 0),
1024
+ destructorFunction: null
1025
+ });
1026
+ }, Mt = (r, e, t) => {
1027
+ var n = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], i = n[e];
1028
+ function a(s) {
1029
+ var o = m2[s >> 2], u2 = m2[s + 4 >> 2];
1030
+ return new i(U2.buffer, u2, o);
1031
+ }
1032
+ t = C(t), S2(r, {
1033
+ name: t,
1034
+ fromWireType: a,
1035
+ readValueFromPointer: a
1036
+ }, {
1037
+ ignoreDuplicateRegistrations: true
1038
+ });
1039
+ }, Ut = Object.assign({
1040
+ optional: true
1041
+ }, se), It = (r, e) => {
1042
+ S2(r, Ut);
1043
+ }, Vt = (r, e, t, n) => {
1044
+ if (!(n > 0)) return 0;
1045
+ for (var i = t, a = t + n - 1, s = 0; s < r.length; ++s) {
1046
+ var o = r.codePointAt(s);
1047
+ if (o <= 127) {
1048
+ if (t >= a) break;
1049
+ e[t++] = o;
1050
+ } else if (o <= 2047) {
1051
+ if (t + 1 >= a) break;
1052
+ e[t++] = 192 | o >> 6, e[t++] = 128 | o & 63;
1053
+ } else if (o <= 65535) {
1054
+ if (t + 2 >= a) break;
1055
+ e[t++] = 224 | o >> 12, e[t++] = 128 | o >> 6 & 63, e[t++] = 128 | o & 63;
1056
+ } else {
1057
+ if (t + 3 >= a) break;
1058
+ e[t++] = 240 | o >> 18, e[t++] = 128 | o >> 12 & 63, e[t++] = 128 | o >> 6 & 63, e[t++] = 128 | o & 63, s++;
1059
+ }
1060
+ }
1061
+ return e[t] = 0, t - i;
1062
+ }, L2 = (r, e, t) => Vt(r, j2, e, t), oe = (r) => {
1063
+ for (var e = 0, t = 0; t < r.length; ++t) {
1064
+ var n = r.charCodeAt(t);
1065
+ n <= 127 ? e++ : n <= 2047 ? e += 2 : n >= 55296 && n <= 57343 ? (e += 4, ++t) : e += 3;
1066
+ }
1067
+ return e;
1068
+ }, ue = globalThis.TextDecoder && new TextDecoder(), fe = (r, e, t, n) => {
1069
+ var i = e + t;
1070
+ if (n) return i;
1071
+ for (; r[e] && !(e >= i); ) ++e;
1072
+ return e;
1073
+ }, le = function(r) {
1074
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, t = arguments.length > 2 ? arguments[2] : void 0, n = arguments.length > 3 ? arguments[3] : void 0;
1075
+ var i = fe(r, e, t, n);
1076
+ if (i - e > 16 && r.buffer && ue)
1077
+ return ue.decode(r.subarray(e, i));
1078
+ for (var a = ""; e < i; ) {
1079
+ var s = r[e++];
1080
+ if (!(s & 128)) {
1081
+ a += String.fromCharCode(s);
1082
+ continue;
1083
+ }
1084
+ var o = r[e++] & 63;
1085
+ if ((s & 224) == 192) {
1086
+ a += String.fromCharCode((s & 31) << 6 | o);
1087
+ continue;
1088
+ }
1089
+ var u2 = r[e++] & 63;
1090
+ if ((s & 240) == 224 ? s = (s & 15) << 12 | o << 6 | u2 : s = (s & 7) << 18 | o << 12 | u2 << 6 | r[e++] & 63, s < 65536)
1091
+ a += String.fromCharCode(s);
1092
+ else {
1093
+ var f2 = s - 65536;
1094
+ a += String.fromCharCode(55296 | f2 >> 10, 56320 | f2 & 1023);
1095
+ }
1096
+ }
1097
+ return a;
1098
+ }, Ht = (r, e, t) => r ? le(j2, r, e, t) : "", Bt = (r, e) => {
1099
+ e = C(e), S2(r, {
1100
+ name: e,
1101
+ fromWireType(t) {
1102
+ var n = m2[t >> 2], i = t + 4, a;
1103
+ return a = Ht(i, n, true), M2(t), a;
1104
+ },
1105
+ toWireType(t, n) {
1106
+ n instanceof ArrayBuffer && (n = new Uint8Array(n));
1107
+ var i, a = typeof n == "string";
1108
+ a || ArrayBuffer.isView(n) && n.BYTES_PER_ELEMENT == 1 || g("Cannot pass non-string to std::string"), a ? i = oe(n) : i = n.length;
1109
+ var s = Er(4 + i + 1), o = s + 4;
1110
+ return m2[s >> 2] = i, a ? L2(n, o, i + 1) : j2.set(n, o), t !== null && t.push(M2, s), s;
1111
+ },
1112
+ readValueFromPointer: Y,
1113
+ destructorFunction(t) {
1114
+ M2(t);
1115
+ }
1116
+ });
1117
+ }, ce = globalThis.TextDecoder ? new TextDecoder("utf-16le") : void 0, Nt = (r, e, t) => {
1118
+ var n = r >> 1, i = fe(G2, n, e / 2, t);
1119
+ if (i - n > 16 && ce) return ce.decode(G2.subarray(n, i));
1120
+ for (var a = "", s = n; s < i; ++s) {
1121
+ var o = G2[s];
1122
+ a += String.fromCharCode(o);
1123
+ }
1124
+ return a;
1125
+ }, xt = (r, e, t) => {
1126
+ if (t != null || (t = 2147483647), t < 2) return 0;
1127
+ t -= 2;
1128
+ for (var n = e, i = t < r.length * 2 ? t / 2 : r.length, a = 0; a < i; ++a) {
1129
+ var s = r.charCodeAt(a);
1130
+ tr[e >> 1] = s, e += 2;
1131
+ }
1132
+ return tr[e >> 1] = 0, e - n;
1133
+ }, zt = (r) => r.length * 2, Zt = (r, e, t) => {
1134
+ for (var n = "", i = r >> 2, a = 0; !(a >= e / 4); a++) {
1135
+ var s = m2[i + a];
1136
+ if (!s && !t) break;
1137
+ n += String.fromCodePoint(s);
1138
+ }
1139
+ return n;
1140
+ }, Lt = (r, e, t) => {
1141
+ if (t != null || (t = 2147483647), t < 4) return 0;
1142
+ for (var n = e, i = n + t - 4, a = 0; a < r.length; ++a) {
1143
+ var s = r.codePointAt(a);
1144
+ if (s > 65535 && a++, q[e >> 2] = s, e += 4, e + 4 > i) break;
1145
+ }
1146
+ return q[e >> 2] = 0, e - n;
1147
+ }, Xt = (r) => {
1148
+ for (var e = 0, t = 0; t < r.length; ++t) {
1149
+ var n = r.codePointAt(t);
1150
+ n > 65535 && t++, e += 4;
1151
+ }
1152
+ return e;
1153
+ }, Gt = (r, e, t) => {
1154
+ t = C(t);
1155
+ var n, i, a;
1156
+ e === 2 ? (n = Nt, i = xt, a = zt) : (n = Zt, i = Lt, a = Xt), S2(r, {
1157
+ name: t,
1158
+ fromWireType: (s) => {
1159
+ var o = m2[s >> 2], u2 = n(s + 4, o * e, true);
1160
+ return M2(s), u2;
1161
+ },
1162
+ toWireType: (s, o) => {
1163
+ typeof o != "string" && g(`Cannot pass non-string to C++ string type ${t}`);
1164
+ var u2 = a(o), f2 = Er(4 + u2 + e);
1165
+ return m2[f2 >> 2] = u2 / e, i(o, f2 + 4, u2 + e), s !== null && s.push(M2, f2), f2;
1166
+ },
1167
+ readValueFromPointer: Y,
1168
+ destructorFunction(s) {
1169
+ M2(s);
1170
+ }
1171
+ });
1172
+ }, qt = (r, e, t, n, i, a) => {
1173
+ sr[r] = {
1174
+ name: C(e),
1175
+ rawConstructor: A2(t, n),
1176
+ rawDestructor: A2(i, a),
1177
+ fields: []
1178
+ };
1179
+ }, Yt = (r, e, t, n, i, a, s, o, u2, f2) => {
1180
+ sr[r].fields.push({
1181
+ fieldName: C(e),
1182
+ getterReturnType: t,
1183
+ getter: A2(n, i),
1184
+ getterContext: a,
1185
+ setterArgumentType: s,
1186
+ setter: A2(o, u2),
1187
+ setterContext: f2
1188
+ });
1189
+ }, Kt = (r, e) => {
1190
+ e = C(e), S2(r, {
1191
+ isVoid: true,
1192
+ name: e,
1193
+ fromWireType: () => {
1194
+ },
1195
+ toWireType: (t, n) => {
1196
+ }
1197
+ });
1198
+ }, Or = [], Jt = (r) => {
1199
+ var e = Or.length;
1200
+ return Or.push(r), e;
1201
+ }, Qt = (r, e) => {
1202
+ var t = I2[r];
1203
+ return t === void 0 && g(`${e} has unknown type ${ne(r)}`), t;
1204
+ }, rn = (r, e) => {
1205
+ for (var t = new Array(r), n = 0; n < r; ++n)
1206
+ t[n] = Qt(m2[e + n * 4 >> 2], `parameter ${n}`);
1207
+ return t;
1208
+ }, en = (r, e, t) => {
1209
+ var n = [], i = r(n, t);
1210
+ return n.length && (m2[e >> 2] = k.toHandle(n)), i;
1211
+ }, tn = {}, ve = (r) => {
1212
+ var e = tn[r];
1213
+ return e === void 0 ? C(r) : e;
1214
+ }, nn = (r, e, t) => {
1215
+ var n = 8, [i, ...a] = rn(r, e), s = i.toWireType.bind(i), o = a.map((v2) => v2.readValueFromPointer.bind(v2));
1216
+ r--;
1217
+ var u2 = new Array(r), f2 = (v2, y2, w2, P2) => {
1218
+ for (var T2 = 0, $ = 0; $ < r; ++$)
1219
+ u2[$] = o[$](P2 + T2), T2 += n;
1220
+ var b2;
1221
+ switch (t) {
1222
+ case 0:
1223
+ b2 = k.toValue(v2).apply(null, u2);
1224
+ break;
1225
+ case 2:
1226
+ b2 = Reflect.construct(k.toValue(v2), u2);
1227
+ break;
1228
+ case 3:
1229
+ b2 = u2[0];
1230
+ break;
1231
+ case 1:
1232
+ b2 = k.toValue(v2)[ve(y2)](...u2);
1233
+ break;
1234
+ }
1235
+ return en(s, w2, b2);
1236
+ }, c = `methodCaller<(${a.map((v2) => v2.name)}) => ${i.name}>`;
1237
+ return Jt(Cr(c, f2));
1238
+ }, an = (r) => r ? (r = ve(r), k.toHandle(globalThis[r])) : k.toHandle(globalThis), sn = (r) => {
1239
+ r > 9 && (H2[r + 1] += 1);
1240
+ }, on = (r, e, t, n, i) => Or[r](e, t, n, i), un = (r) => {
1241
+ var e = k.toValue(r);
1242
+ $r(e), kr(r);
1243
+ }, fn = (r, e, t, n) => {
1244
+ var i = (/* @__PURE__ */ new Date()).getFullYear(), a = new Date(i, 0, 1), s = new Date(i, 6, 1), o = a.getTimezoneOffset(), u2 = s.getTimezoneOffset(), f2 = Math.max(o, u2);
1245
+ m2[r >> 2] = f2 * 60, q[e >> 2] = +(o != u2);
1246
+ var c = (w2) => {
1247
+ var P2 = w2 >= 0 ? "-" : "+", T2 = Math.abs(w2), $ = String(Math.floor(T2 / 60)).padStart(2, "0"), b2 = String(T2 % 60).padStart(2, "0");
1248
+ return `UTC${P2}${$}${b2}`;
1249
+ }, v2 = c(o), y2 = c(u2);
1250
+ u2 < o ? (L2(v2, t, 17), L2(y2, n, 17)) : (L2(v2, n, 17), L2(y2, t, 17));
1251
+ }, ln = () => 2147483648, cn = (r, e) => Math.ceil(r / e) * e, vn = (r) => {
1252
+ var e = dr.buffer.byteLength, t = (r - e + 65535) / 65536 | 0;
1253
+ try {
1254
+ return dr.grow(t), Zr(), 1;
1255
+ } catch {
1256
+ }
1257
+ }, dn = (r) => {
1258
+ var e = j2.length;
1259
+ r >>>= 0;
1260
+ var t = ln();
1261
+ if (r > t)
1262
+ return false;
1263
+ for (var n = 1; n <= 4; n *= 2) {
1264
+ var i = e * (1 + 0.2 / n);
1265
+ i = Math.min(i, r + 100663296);
1266
+ var a = Math.min(t, cn(Math.max(r, i), 65536)), s = vn(a);
1267
+ if (s)
1268
+ return true;
1269
+ }
1270
+ return false;
1271
+ }, jr = {}, pn = () => Mr || "./this.program", Q = () => {
1272
+ if (!Q.strings) {
1273
+ var r = (typeof navigator == "object" && navigator.language || "C").replace("-", "_") + ".UTF-8", e = {
1274
+ USER: "web_user",
1275
+ LOGNAME: "web_user",
1276
+ PATH: "/",
1277
+ PWD: "/",
1278
+ HOME: "/home/web_user",
1279
+ LANG: r,
1280
+ _: pn()
1281
+ };
1282
+ for (var t in jr)
1283
+ jr[t] === void 0 ? delete e[t] : e[t] = jr[t];
1284
+ var n = [];
1285
+ for (var t in e)
1286
+ n.push(`${t}=${e[t]}`);
1287
+ Q.strings = n;
1288
+ }
1289
+ return Q.strings;
1290
+ }, hn = (r, e) => {
1291
+ var t = 0, n = 0;
1292
+ for (var i of Q()) {
1293
+ var a = e + t;
1294
+ m2[r + n >> 2] = a, t += L2(i, a, 1 / 0) + 1, n += 4;
1295
+ }
1296
+ return 0;
1297
+ }, _n = (r, e) => {
1298
+ var t = Q();
1299
+ m2[r >> 2] = t.length;
1300
+ var n = 0;
1301
+ for (var i of t)
1302
+ n += oe(i) + 1;
1303
+ return m2[e >> 2] = n, 0;
1304
+ }, gn = (r) => 52;
1305
+ function yn(r, e, t, n, i) {
1306
+ return 70;
1307
+ }
1308
+ var mn = [null, [], []], bn = (r, e) => {
1309
+ var t = mn[r];
1310
+ e === 0 || e === 10 ? ((r === 1 ? Ir : x2)(le(t)), t.length = 0) : t.push(e);
1311
+ }, wn = (r, e, t, n) => {
1312
+ for (var i = 0, a = 0; a < t; a++) {
1313
+ var s = m2[e >> 2], o = m2[e + 4 >> 2];
1314
+ e += 8;
1315
+ for (var u2 = 0; u2 < o; u2++)
1316
+ bn(r, j2[s + u2]);
1317
+ i += o;
1318
+ }
1319
+ return m2[n >> 2] = i, 0;
1320
+ }, $n = (r) => r;
1321
+ if (ft(), wt(), l2.noExitRuntime && l2.noExitRuntime, l2.print && (Ir = l2.print), l2.printErr && (x2 = l2.printErr), l2.wasmBinary && (X = l2.wasmBinary), l2.arguments && l2.arguments, l2.thisProgram && (Mr = l2.thisProgram), l2.preInit)
1322
+ for (typeof l2.preInit == "function" && (l2.preInit = [l2.preInit]); l2.preInit.length > 0; )
1323
+ l2.preInit.shift()();
1324
+ var de, M2, Er, pe, d, he, _e, ge, ye, me, be, we, $e, dr, Te;
1325
+ function Tn(r) {
1326
+ de = r.ya, M2 = l2._free = r.za, Er = l2._malloc = r.Ba, pe = r.Ca, d = r.Da, he = r.Ea, _e = r.Fa, ge = r.Ga, ye = r.Ha, me = r.Ia, be = r.Ja, D2.viijii = r.Ka, we = D2.iiijj = r.La, D2.jiji = r.Ma, $e = D2.jiiii = r.Na, D2.iiiiij = r.Oa, D2.iiiiijj = r.Pa, D2.iiiiiijj = r.Qa, dr = r.wa, Te = r.Aa;
1327
+ }
1328
+ var Pn = {
1329
+ s: Le,
1330
+ w: Xe,
1331
+ a: Ge,
1332
+ j: qe,
1333
+ m: Ye,
1334
+ Q: Ke,
1335
+ p: Je,
1336
+ U: Qe,
1337
+ d: rt,
1338
+ ca: et,
1339
+ ta: nt,
1340
+ ba: it,
1341
+ oa: st,
1342
+ ra: Rt,
1343
+ qa: At,
1344
+ H: St,
1345
+ ma: kt,
1346
+ X: jt,
1347
+ Y: Et,
1348
+ x: Dt,
1349
+ t: Mt,
1350
+ sa: It,
1351
+ na: Bt,
1352
+ R: Gt,
1353
+ I: qt,
1354
+ ua: Yt,
1355
+ pa: Kt,
1356
+ N: nn,
1357
+ va: kr,
1358
+ D: an,
1359
+ S: sn,
1360
+ M: on,
1361
+ ia: un,
1362
+ da: fn,
1363
+ ga: dn,
1364
+ ea: hn,
1365
+ fa: _n,
1366
+ ha: gn,
1367
+ $: yn,
1368
+ V: wn,
1369
+ K: Xn,
1370
+ C: Yn,
1371
+ Z: On,
1372
+ T: ti,
1373
+ r: xn,
1374
+ b: Sn,
1375
+ E: Ln,
1376
+ ka: Jn,
1377
+ c: jn,
1378
+ ja: Qn,
1379
+ h: kn,
1380
+ i: Dn,
1381
+ q: Vn,
1382
+ P: Zn,
1383
+ v: Bn,
1384
+ F: Nn,
1385
+ L: zn,
1386
+ z: Kn,
1387
+ J: ni,
1388
+ aa: ii,
1389
+ _: ai,
1390
+ f: En,
1391
+ l: Cn,
1392
+ e: An,
1393
+ g: Fn,
1394
+ O: ei,
1395
+ k: Rn,
1396
+ la: Gn,
1397
+ o: Hn,
1398
+ B: Mn,
1399
+ u: qn,
1400
+ W: In,
1401
+ A: ri,
1402
+ n: Wn,
1403
+ G: Un,
1404
+ y: $n
1405
+ };
1406
+ function Cn(r, e) {
1407
+ var t = h2();
1408
+ try {
1409
+ _(r)(e);
1410
+ } catch (n) {
1411
+ if (p2(t), n !== n + 0) throw n;
1412
+ d(1, 0);
1413
+ }
1414
+ }
1415
+ function Rn(r, e, t, n, i) {
1416
+ var a = h2();
1417
+ try {
1418
+ _(r)(e, t, n, i);
1419
+ } catch (s) {
1420
+ if (p2(a), s !== s + 0) throw s;
1421
+ d(1, 0);
1422
+ }
1423
+ }
1424
+ function Fn(r, e, t, n) {
1425
+ var i = h2();
1426
+ try {
1427
+ _(r)(e, t, n);
1428
+ } catch (a) {
1429
+ if (p2(i), a !== a + 0) throw a;
1430
+ d(1, 0);
1431
+ }
1432
+ }
1433
+ function An(r, e, t) {
1434
+ var n = h2();
1435
+ try {
1436
+ _(r)(e, t);
1437
+ } catch (i) {
1438
+ if (p2(n), i !== i + 0) throw i;
1439
+ d(1, 0);
1440
+ }
1441
+ }
1442
+ function Sn(r, e) {
1443
+ var t = h2();
1444
+ try {
1445
+ return _(r)(e);
1446
+ } catch (n) {
1447
+ if (p2(t), n !== n + 0) throw n;
1448
+ d(1, 0);
1449
+ }
1450
+ }
1451
+ function kn(r, e, t, n) {
1452
+ var i = h2();
1453
+ try {
1454
+ return _(r)(e, t, n);
1455
+ } catch (a) {
1456
+ if (p2(i), a !== a + 0) throw a;
1457
+ d(1, 0);
1458
+ }
1459
+ }
1460
+ function On(r, e, t, n, i, a) {
1461
+ var s = h2();
1462
+ try {
1463
+ return _(r)(e, t, n, i, a);
1464
+ } catch (o) {
1465
+ if (p2(s), o !== o + 0) throw o;
1466
+ d(1, 0);
1467
+ }
1468
+ }
1469
+ function jn(r, e, t) {
1470
+ var n = h2();
1471
+ try {
1472
+ return _(r)(e, t);
1473
+ } catch (i) {
1474
+ if (p2(n), i !== i + 0) throw i;
1475
+ d(1, 0);
1476
+ }
1477
+ }
1478
+ function En(r) {
1479
+ var e = h2();
1480
+ try {
1481
+ _(r)();
1482
+ } catch (t) {
1483
+ if (p2(e), t !== t + 0) throw t;
1484
+ d(1, 0);
1485
+ }
1486
+ }
1487
+ function Wn(r, e, t, n, i, a, s, o, u2, f2, c) {
1488
+ var v2 = h2();
1489
+ try {
1490
+ _(r)(e, t, n, i, a, s, o, u2, f2, c);
1491
+ } catch (y2) {
1492
+ if (p2(v2), y2 !== y2 + 0) throw y2;
1493
+ d(1, 0);
1494
+ }
1495
+ }
1496
+ function Dn(r, e, t, n, i) {
1497
+ var a = h2();
1498
+ try {
1499
+ return _(r)(e, t, n, i);
1500
+ } catch (s) {
1501
+ if (p2(a), s !== s + 0) throw s;
1502
+ d(1, 0);
1503
+ }
1504
+ }
1505
+ function Mn(r, e, t, n, i, a, s) {
1506
+ var o = h2();
1507
+ try {
1508
+ _(r)(e, t, n, i, a, s);
1509
+ } catch (u2) {
1510
+ if (p2(o), u2 !== u2 + 0) throw u2;
1511
+ d(1, 0);
1512
+ }
1513
+ }
1514
+ function Un(r, e, t, n, i, a, s, o, u2, f2, c, v2, y2, w2, P2, T2) {
1515
+ var $ = h2();
1516
+ try {
1517
+ _(r)(e, t, n, i, a, s, o, u2, f2, c, v2, y2, w2, P2, T2);
1518
+ } catch (b2) {
1519
+ if (p2($), b2 !== b2 + 0) throw b2;
1520
+ d(1, 0);
1521
+ }
1522
+ }
1523
+ function In(r, e, t, n, i, a, s, o, u2) {
1524
+ var f2 = h2();
1525
+ try {
1526
+ _(r)(e, t, n, i, a, s, o, u2);
1527
+ } catch (c) {
1528
+ if (p2(f2), c !== c + 0) throw c;
1529
+ d(1, 0);
1530
+ }
1531
+ }
1532
+ function Vn(r, e, t, n, i, a) {
1533
+ var s = h2();
1534
+ try {
1535
+ return _(r)(e, t, n, i, a);
1536
+ } catch (o) {
1537
+ if (p2(s), o !== o + 0) throw o;
1538
+ d(1, 0);
1539
+ }
1540
+ }
1541
+ function Hn(r, e, t, n, i, a) {
1542
+ var s = h2();
1543
+ try {
1544
+ _(r)(e, t, n, i, a);
1545
+ } catch (o) {
1546
+ if (p2(s), o !== o + 0) throw o;
1547
+ d(1, 0);
1548
+ }
1549
+ }
1550
+ function Bn(r, e, t, n, i, a, s) {
1551
+ var o = h2();
1552
+ try {
1553
+ return _(r)(e, t, n, i, a, s);
1554
+ } catch (u2) {
1555
+ if (p2(o), u2 !== u2 + 0) throw u2;
1556
+ d(1, 0);
1557
+ }
1558
+ }
1559
+ function Nn(r, e, t, n, i, a, s, o) {
1560
+ var u2 = h2();
1561
+ try {
1562
+ return _(r)(e, t, n, i, a, s, o);
1563
+ } catch (f2) {
1564
+ if (p2(u2), f2 !== f2 + 0) throw f2;
1565
+ d(1, 0);
1566
+ }
1567
+ }
1568
+ function xn(r) {
1569
+ var e = h2();
1570
+ try {
1571
+ return _(r)();
1572
+ } catch (t) {
1573
+ if (p2(e), t !== t + 0) throw t;
1574
+ d(1, 0);
1575
+ }
1576
+ }
1577
+ function zn(r, e, t, n, i, a, s, o, u2) {
1578
+ var f2 = h2();
1579
+ try {
1580
+ return _(r)(e, t, n, i, a, s, o, u2);
1581
+ } catch (c) {
1582
+ if (p2(f2), c !== c + 0) throw c;
1583
+ d(1, 0);
1584
+ }
1585
+ }
1586
+ function Zn(r, e, t, n, i, a, s) {
1587
+ var o = h2();
1588
+ try {
1589
+ return _(r)(e, t, n, i, a, s);
1590
+ } catch (u2) {
1591
+ if (p2(o), u2 !== u2 + 0) throw u2;
1592
+ d(1, 0);
1593
+ }
1594
+ }
1595
+ function Ln(r, e, t, n) {
1596
+ var i = h2();
1597
+ try {
1598
+ return _(r)(e, t, n);
1599
+ } catch (a) {
1600
+ if (p2(i), a !== a + 0) throw a;
1601
+ d(1, 0);
1602
+ }
1603
+ }
1604
+ function Xn(r, e, t, n) {
1605
+ var i = h2();
1606
+ try {
1607
+ return _(r)(e, t, n);
1608
+ } catch (a) {
1609
+ if (p2(i), a !== a + 0) throw a;
1610
+ d(1, 0);
1611
+ }
1612
+ }
1613
+ function Gn(r, e, t, n, i, a, s, o) {
1614
+ var u2 = h2();
1615
+ try {
1616
+ _(r)(e, t, n, i, a, s, o);
1617
+ } catch (f2) {
1618
+ if (p2(u2), f2 !== f2 + 0) throw f2;
1619
+ d(1, 0);
1620
+ }
1621
+ }
1622
+ function qn(r, e, t, n, i, a, s, o) {
1623
+ var u2 = h2();
1624
+ try {
1625
+ _(r)(e, t, n, i, a, s, o);
1626
+ } catch (f2) {
1627
+ if (p2(u2), f2 !== f2 + 0) throw f2;
1628
+ d(1, 0);
1629
+ }
1630
+ }
1631
+ function Yn(r, e, t, n, i, a) {
1632
+ var s = h2();
1633
+ try {
1634
+ return _(r)(e, t, n, i, a);
1635
+ } catch (o) {
1636
+ if (p2(s), o !== o + 0) throw o;
1637
+ d(1, 0);
1638
+ }
1639
+ }
1640
+ function Kn(r, e, t, n, i, a, s, o, u2, f2) {
1641
+ var c = h2();
1642
+ try {
1643
+ return _(r)(e, t, n, i, a, s, o, u2, f2);
1644
+ } catch (v2) {
1645
+ if (p2(c), v2 !== v2 + 0) throw v2;
1646
+ d(1, 0);
1647
+ }
1648
+ }
1649
+ function Jn(r, e, t) {
1650
+ var n = h2();
1651
+ try {
1652
+ return _(r)(e, t);
1653
+ } catch (i) {
1654
+ if (p2(n), i !== i + 0) throw i;
1655
+ d(1, 0);
1656
+ }
1657
+ }
1658
+ function Qn(r, e, t, n, i) {
1659
+ var a = h2();
1660
+ try {
1661
+ return _(r)(e, t, n, i);
1662
+ } catch (s) {
1663
+ if (p2(a), s !== s + 0) throw s;
1664
+ d(1, 0);
1665
+ }
1666
+ }
1667
+ function ri(r, e, t, n, i, a, s, o, u2, f2) {
1668
+ var c = h2();
1669
+ try {
1670
+ _(r)(e, t, n, i, a, s, o, u2, f2);
1671
+ } catch (v2) {
1672
+ if (p2(c), v2 !== v2 + 0) throw v2;
1673
+ d(1, 0);
1674
+ }
1675
+ }
1676
+ function ei(r, e, t, n, i, a, s) {
1677
+ var o = h2();
1678
+ try {
1679
+ _(r)(e, t, n, i, a, s);
1680
+ } catch (u2) {
1681
+ if (p2(o), u2 !== u2 + 0) throw u2;
1682
+ d(1, 0);
1683
+ }
1684
+ }
1685
+ function ti(r, e, t, n) {
1686
+ var i = h2();
1687
+ try {
1688
+ return _(r)(e, t, n);
1689
+ } catch (a) {
1690
+ if (p2(i), a !== a + 0) throw a;
1691
+ d(1, 0);
1692
+ }
1693
+ }
1694
+ function ni(r, e, t, n, i, a, s, o, u2, f2, c, v2) {
1695
+ var y2 = h2();
1696
+ try {
1697
+ return _(r)(e, t, n, i, a, s, o, u2, f2, c, v2);
1698
+ } catch (w2) {
1699
+ if (p2(y2), w2 !== w2 + 0) throw w2;
1700
+ d(1, 0);
1701
+ }
1702
+ }
1703
+ function ii(r, e, t, n, i, a, s) {
1704
+ var o = h2();
1705
+ try {
1706
+ return we(r, e, t, n, i, a, s);
1707
+ } catch (u2) {
1708
+ if (p2(o), u2 !== u2 + 0) throw u2;
1709
+ d(1, 0);
1710
+ }
1711
+ }
1712
+ function ai(r, e, t, n, i) {
1713
+ var a = h2();
1714
+ try {
1715
+ return $e(r, e, t, n, i);
1716
+ } catch (s) {
1717
+ if (p2(a), s !== s + 0) throw s;
1718
+ d(1, 0);
1719
+ }
1720
+ }
1721
+ function si() {
1722
+ We();
1723
+ function r() {
1724
+ var e, t;
1725
+ l2.calledRun = true, !Vr && (De(), (e = Hr) === null || e === void 0 || e(l2), (t = l2.onRuntimeInitialized) === null || t === void 0 || t.call(l2), Me());
1726
+ }
1727
+ l2.setStatus ? (l2.setStatus("Running..."), setTimeout(() => {
1728
+ setTimeout(() => l2.setStatus(""), 1), r();
1729
+ }, 1)) : r();
1730
+ }
1731
+ var rr;
1732
+ return rr = await xe(), si(), zr ? O2 = l2 : O2 = new Promise((r, e) => {
1733
+ Hr = r, Br = e;
1734
+ }), O2;
1735
+ }
1736
+ async function Se(F2, O2) {
1737
+ return Z(Wr, F2, O2);
1738
+ }
1739
+
1740
+ // src/worker.ts
1741
+ var defaultOptions = {
1742
+ formats: ["QRCode"],
1743
+ tryHarder: true,
1744
+ tryInvert: true,
1745
+ tryRotate: true,
1746
+ tryDenoise: false,
1747
+ tryDownscale: true,
1748
+ maxNumberOfSymbols: 1
1749
+ };
1750
+ var currentOptions = { ...defaultOptions };
1751
+ function mapPosition(position) {
1752
+ return [
1753
+ position.topLeft,
1754
+ position.topRight,
1755
+ position.bottomRight,
1756
+ position.bottomLeft
1757
+ ];
1758
+ }
1759
+ self.onmessage = async (e) => {
1760
+ const { data } = e;
1761
+ if (data.type === "configure") {
1762
+ currentOptions = { ...defaultOptions, ...data.options, formats: ["QRCode"] };
1763
+ return;
1764
+ }
1765
+ if (data.type === "decode") {
1766
+ try {
1767
+ const results = await Se(data.imageData, currentOptions);
1768
+ const mapped = results.filter((r) => r.isValid).map((r) => ({
1769
+ data: r.text,
1770
+ cornerPoints: mapPosition(r.position)
1771
+ }));
1772
+ const response = { type: "result", results: mapped };
1773
+ self.postMessage(response);
1774
+ } catch (err) {
1775
+ const response = {
1776
+ type: "error",
1777
+ message: err instanceof Error ? err.message : String(err)
1778
+ };
1779
+ self.postMessage(response);
1780
+ }
1781
+ }
1782
+ };
1783
+ var readyResponse = { type: "ready" };
1784
+ self.postMessage(readyResponse);
1785
+ //# sourceMappingURL=worker.js.map