@richard.fadiora/liveness-detection 5.0.2 → 5.0.4

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.
@@ -1,3815 +0,0 @@
1
- var ue = typeof self < "u" ? self : {};
2
- function je(t, e) {
3
- t: {
4
- for (var n = ["CLOSURE_FLAGS"], s = ue, r = 0; r < n.length; r++) if ((s = s[n[r]]) == null) {
5
- n = null;
6
- break t;
7
- }
8
- n = s;
9
- }
10
- return (t = n && n[t]) != null ? t : e;
11
- }
12
- function Ht() {
13
- throw Error("Invalid UTF8");
14
- }
15
- function lr(t, e) {
16
- return e = String.fromCharCode.apply(null, e), t == null ? e : t + e;
17
- }
18
- let en, Vn;
19
- const ga = typeof TextDecoder < "u";
20
- let ma;
21
- const ya = typeof TextEncoder < "u";
22
- function pi(t) {
23
- if (ya) t = (ma || (ma = new TextEncoder())).encode(t);
24
- else {
25
- let n = 0;
26
- const s = new Uint8Array(3 * t.length);
27
- for (let r = 0; r < t.length; r++) {
28
- var e = t.charCodeAt(r);
29
- if (e < 128) s[n++] = e;
30
- else {
31
- if (e < 2048) s[n++] = e >> 6 | 192;
32
- else {
33
- if (e >= 55296 && e <= 57343) {
34
- if (e <= 56319 && r < t.length) {
35
- const i = t.charCodeAt(++r);
36
- if (i >= 56320 && i <= 57343) {
37
- e = 1024 * (e - 55296) + i - 56320 + 65536, s[n++] = e >> 18 | 240, s[n++] = e >> 12 & 63 | 128, s[n++] = e >> 6 & 63 | 128, s[n++] = 63 & e | 128;
38
- continue;
39
- }
40
- r--;
41
- }
42
- e = 65533;
43
- }
44
- s[n++] = e >> 12 | 224, s[n++] = e >> 6 & 63 | 128;
45
- }
46
- s[n++] = 63 & e | 128;
47
- }
48
- }
49
- t = n === s.length ? s : s.subarray(0, n);
50
- }
51
- return t;
52
- }
53
- function gi(t) {
54
- ue.setTimeout(() => {
55
- throw t;
56
- }, 0);
57
- }
58
- var Xn, _a = je(610401301, !1), fr = je(748402147, !0), ps = je(824648567, !0), gs = je(824656860, je(1, !0));
59
- function dr() {
60
- var t = ue.navigator;
61
- return t && (t = t.userAgent) ? t : "";
62
- }
63
- const pr = ue.navigator;
64
- function gn(t) {
65
- return gn[" "](t), t;
66
- }
67
- Xn = pr && pr.userAgentData || null, gn[" "] = function() {
68
- };
69
- const mi = {};
70
- let Be = null;
71
- function va(t) {
72
- const e = t.length;
73
- let n = 3 * e / 4;
74
- n % 3 ? n = Math.floor(n) : "=.".indexOf(t[e - 1]) != -1 && (n = "=.".indexOf(t[e - 2]) != -1 ? n - 2 : n - 1);
75
- const s = new Uint8Array(n);
76
- let r = 0;
77
- return function(i, o) {
78
- function a(u) {
79
- for (; c < i.length; ) {
80
- const h = i.charAt(c++), f = Be[h];
81
- if (f != null) return f;
82
- if (!/^[\s\xa0]*$/.test(h)) throw Error("Unknown base64 encoding at char: " + h);
83
- }
84
- return u;
85
- }
86
- yi();
87
- let c = 0;
88
- for (; ; ) {
89
- const u = a(-1), h = a(0), f = a(64), _ = a(64);
90
- if (_ === 64 && u === -1) break;
91
- o(u << 2 | h >> 4), f != 64 && (o(h << 4 & 240 | f >> 2), _ != 64 && o(f << 6 & 192 | _));
92
- }
93
- }(t, function(i) {
94
- s[r++] = i;
95
- }), r !== n ? s.subarray(0, r) : s;
96
- }
97
- function yi() {
98
- if (!Be) {
99
- Be = {};
100
- var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""), e = ["+/=", "+/", "-_=", "-_.", "-_"];
101
- for (let n = 0; n < 5; n++) {
102
- const s = t.concat(e[n].split(""));
103
- mi[n] = s;
104
- for (let r = 0; r < s.length; r++) {
105
- const i = s[r];
106
- Be[i] === void 0 && (Be[i] = r);
107
- }
108
- }
109
- }
110
- }
111
- var wa = typeof Uint8Array < "u", _i = !(!(_a && Xn && Xn.brands.length > 0) && (dr().indexOf("Trident") != -1 || dr().indexOf("MSIE") != -1)) && typeof btoa == "function";
112
- const gr = /[-_.]/g, ba = { "-": "+", _: "/", ".": "=" };
113
- function Aa(t) {
114
- return ba[t] || "";
115
- }
116
- function vi(t) {
117
- if (!_i) return va(t);
118
- t = gr.test(t) ? t.replace(gr, Aa) : t, t = atob(t);
119
- const e = new Uint8Array(t.length);
120
- for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);
121
- return e;
122
- }
123
- function ms(t) {
124
- return wa && t != null && t instanceof Uint8Array;
125
- }
126
- var le = {};
127
- function Qt() {
128
- return Ea || (Ea = new Et(null, le));
129
- }
130
- function ys(t) {
131
- wi(le);
132
- var e = t.g;
133
- return (e = e == null || ms(e) ? e : typeof e == "string" ? vi(e) : null) == null ? e : t.g = e;
134
- }
135
- var Et = class {
136
- h() {
137
- return new Uint8Array(ys(this) || 0);
138
- }
139
- constructor(t, e) {
140
- if (wi(e), this.g = t, t != null && t.length === 0) throw Error("ByteString should be constructed with non-empty values");
141
- }
142
- };
143
- let Ea, ka;
144
- function wi(t) {
145
- if (t !== le) throw Error("illegal external caller");
146
- }
147
- function bi(t, e) {
148
- t.__closure__error__context__984382 || (t.__closure__error__context__984382 = {}), t.__closure__error__context__984382.severity = e;
149
- }
150
- function $n(t) {
151
- return bi(t = Error(t), "warning"), t;
152
- }
153
- function fe(t, e) {
154
- if (t != null) {
155
- var n = ka ?? (ka = {}), s = n[t] || 0;
156
- s >= e || (n[t] = s + 1, bi(t = Error(), "incident"), gi(t));
157
- }
158
- }
159
- function Ae() {
160
- return typeof BigInt == "function";
161
- }
162
- var Ee = typeof Symbol == "function" && typeof Symbol() == "symbol";
163
- function kt(t, e, n = !1) {
164
- return typeof Symbol == "function" && typeof Symbol() == "symbol" ? n && Symbol.for && t ? Symbol.for(t) : t != null ? Symbol(t) : Symbol() : e;
165
- }
166
- var Sa = kt("jas", void 0, !0), mr = kt(void 0, "0di"), Re = kt(void 0, "1oa"), nt = kt(void 0, Symbol()), La = kt(void 0, "0ub"), Ta = kt(void 0, "0ubs"), Jn = kt(void 0, "0ubsb"), Ma = kt(void 0, "0actk"), de = kt("m_m", "Pa", !0), yr = kt();
167
- const Ai = { Ga: { value: 0, configurable: !0, writable: !0, enumerable: !1 } }, Ei = Object.defineProperties, d = Ee ? Sa : "Ga";
168
- var ee;
169
- const _r = [];
170
- function ze(t, e) {
171
- Ee || d in t || Ei(t, Ai), t[d] |= e;
172
- }
173
- function G(t, e) {
174
- Ee || d in t || Ei(t, Ai), t[d] = e;
175
- }
176
- function Ye(t) {
177
- return ze(t, 34), t;
178
- }
179
- function He(t) {
180
- return ze(t, 8192), t;
181
- }
182
- G(_r, 7), ee = Object.freeze(_r);
183
- var pe = {};
184
- function rt(t, e) {
185
- return e === void 0 ? t.h !== Zt && !!(2 & (0 | t.v[d])) : !!(2 & e) && t.h !== Zt;
186
- }
187
- const Zt = {};
188
- function _s(t, e) {
189
- if (t != null) {
190
- if (typeof t == "string") t = t ? new Et(t, le) : Qt();
191
- else if (t.constructor !== Et) if (ms(t)) t = t.length ? new Et(new Uint8Array(t), le) : Qt();
192
- else {
193
- if (!e) throw Error();
194
- t = void 0;
195
- }
196
- }
197
- return t;
198
- }
199
- class vr {
200
- constructor(e, n, s) {
201
- this.g = e, this.h = n, this.l = s;
202
- }
203
- next() {
204
- const e = this.g.next();
205
- return e.done || (e.value = this.h.call(this.l, e.value)), e;
206
- }
207
- [Symbol.iterator]() {
208
- return this;
209
- }
210
- }
211
- var Fa = Object.freeze({});
212
- function ki(t, e, n) {
213
- const s = 128 & e ? 0 : -1, r = t.length;
214
- var i;
215
- (i = !!r) && (i = (i = t[r - 1]) != null && typeof i == "object" && i.constructor === Object);
216
- const o = r + (i ? -1 : 0);
217
- for (e = 128 & e ? 1 : 0; e < o; e++) n(e - s, t[e]);
218
- if (i) {
219
- t = t[r - 1];
220
- for (const a in t) !isNaN(a) && n(+a, t[a]);
221
- }
222
- }
223
- var Si = {};
224
- function ke(t) {
225
- return 128 & t ? Si : void 0;
226
- }
227
- function mn(t) {
228
- return t.Na = !0, t;
229
- }
230
- var Ia = mn((t) => typeof t == "number"), wr = mn((t) => typeof t == "string"), Pa = mn((t) => typeof t == "boolean"), yn = typeof ue.BigInt == "function" && typeof ue.BigInt(0) == "bigint";
231
- function st(t) {
232
- var e = t;
233
- if (wr(e)) {
234
- if (!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e)) throw Error(String(e));
235
- } else if (Ia(e) && !Number.isSafeInteger(e)) throw Error(String(e));
236
- return yn ? BigInt(t) : t = Pa(t) ? t ? "1" : "0" : wr(t) ? t.trim() || "0" : String(t);
237
- }
238
- var Qn = mn((t) => yn ? t >= xa && t <= Ra : t[0] === "-" ? br(t, Oa) : br(t, Na));
239
- const Oa = Number.MIN_SAFE_INTEGER.toString(), xa = yn ? BigInt(Number.MIN_SAFE_INTEGER) : void 0, Na = Number.MAX_SAFE_INTEGER.toString(), Ra = yn ? BigInt(Number.MAX_SAFE_INTEGER) : void 0;
240
- function br(t, e) {
241
- if (t.length > e.length) return !1;
242
- if (t.length < e.length || t === e) return !0;
243
- for (let n = 0; n < t.length; n++) {
244
- const s = t[n], r = e[n];
245
- if (s > r) return !1;
246
- if (s < r) return !0;
247
- }
248
- }
249
- const Ca = typeof Uint8Array.prototype.slice == "function";
250
- let Ba, I = 0, C = 0;
251
- function Ar(t) {
252
- const e = t >>> 0;
253
- I = e, C = (t - e) / 4294967296 >>> 0;
254
- }
255
- function ge(t) {
256
- if (t < 0) {
257
- Ar(-t);
258
- const [e, n] = As(I, C);
259
- I = e >>> 0, C = n >>> 0;
260
- } else Ar(t);
261
- }
262
- function vs(t) {
263
- const e = Ba || (Ba = new DataView(new ArrayBuffer(8)));
264
- e.setFloat32(0, +t, !0), C = 0, I = e.getUint32(0, !0);
265
- }
266
- function Zn(t, e) {
267
- const n = 4294967296 * e + (t >>> 0);
268
- return Number.isSafeInteger(n) ? n : Ke(t, e);
269
- }
270
- function Da(t, e) {
271
- return st(Ae() ? BigInt.asUintN(64, (BigInt(e >>> 0) << BigInt(32)) + BigInt(t >>> 0)) : Ke(t, e));
272
- }
273
- function ws(t, e) {
274
- const n = 2147483648 & e;
275
- return n && (e = ~e >>> 0, (t = 1 + ~t >>> 0) == 0 && (e = e + 1 >>> 0)), typeof (t = Zn(t, e)) == "number" ? n ? -t : t : n ? "-" + t : t;
276
- }
277
- function Li(t, e) {
278
- return Ae() ? st(BigInt.asIntN(64, (BigInt.asUintN(32, BigInt(e)) << BigInt(32)) + BigInt.asUintN(32, BigInt(t)))) : st(bs(t, e));
279
- }
280
- function Ke(t, e) {
281
- if (t >>>= 0, (e >>>= 0) <= 2097151) var n = "" + (4294967296 * e + t);
282
- else Ae() ? n = "" + (BigInt(e) << BigInt(32) | BigInt(t)) : (t = (16777215 & t) + 6777216 * (n = 16777215 & (t >>> 24 | e << 8)) + 6710656 * (e = e >> 16 & 65535), n += 8147497 * e, e *= 2, t >= 1e7 && (n += t / 1e7 >>> 0, t %= 1e7), n >= 1e7 && (e += n / 1e7 >>> 0, n %= 1e7), n = e + Er(n) + Er(t));
283
- return n;
284
- }
285
- function Er(t) {
286
- return t = String(t), "0000000".slice(t.length) + t;
287
- }
288
- function bs(t, e) {
289
- if (2147483648 & e) if (Ae()) t = "" + (BigInt(0 | e) << BigInt(32) | BigInt(t >>> 0));
290
- else {
291
- const [n, s] = As(t, e);
292
- t = "-" + Ke(n, s);
293
- }
294
- else t = Ke(t, e);
295
- return t;
296
- }
297
- function _n(t) {
298
- if (t.length < 16) ge(Number(t));
299
- else if (Ae()) t = BigInt(t), I = Number(t & BigInt(4294967295)) >>> 0, C = Number(t >> BigInt(32) & BigInt(4294967295));
300
- else {
301
- const e = +(t[0] === "-");
302
- C = I = 0;
303
- const n = t.length;
304
- for (let s = e, r = (n - e) % 6 + e; r <= n; s = r, r += 6) {
305
- const i = Number(t.slice(s, r));
306
- C *= 1e6, I = 1e6 * I + i, I >= 4294967296 && (C += Math.trunc(I / 4294967296), C >>>= 0, I >>>= 0);
307
- }
308
- if (e) {
309
- const [s, r] = As(I, C);
310
- I = s, C = r;
311
- }
312
- }
313
- }
314
- function As(t, e) {
315
- return e = ~e, t ? t = 1 + ~t : e += 1, [t, e];
316
- }
317
- function mt(t) {
318
- return Array.prototype.slice.call(t);
319
- }
320
- const Xe = typeof BigInt == "function" ? BigInt.asIntN : void 0, Ua = typeof BigInt == "function" ? BigInt.asUintN : void 0, te = Number.isSafeInteger, vn = Number.isFinite, me = Math.trunc, Va = st(0);
321
- function De(t) {
322
- if (t != null && typeof t != "number") throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);
323
- return t;
324
- }
325
- function At(t) {
326
- return t == null || typeof t == "number" ? t : t === "NaN" || t === "Infinity" || t === "-Infinity" ? Number(t) : void 0;
327
- }
328
- function We(t) {
329
- if (t != null && typeof t != "boolean") {
330
- var e = typeof t;
331
- throw Error(`Expected boolean but got ${e != "object" ? e : t ? Array.isArray(t) ? "array" : e : "null"}: ${t}`);
332
- }
333
- return t;
334
- }
335
- function Ti(t) {
336
- return t == null || typeof t == "boolean" ? t : typeof t == "number" ? !!t : void 0;
337
- }
338
- const Ga = /^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;
339
- function $e(t) {
340
- switch (typeof t) {
341
- case "bigint":
342
- return !0;
343
- case "number":
344
- return vn(t);
345
- case "string":
346
- return Ga.test(t);
347
- default:
348
- return !1;
349
- }
350
- }
351
- function Se(t) {
352
- if (t == null) return t;
353
- if (typeof t == "string" && t) t = +t;
354
- else if (typeof t != "number") return;
355
- return vn(t) ? 0 | t : void 0;
356
- }
357
- function Mi(t) {
358
- if (t == null) return t;
359
- if (typeof t == "string" && t) t = +t;
360
- else if (typeof t != "number") return;
361
- return vn(t) ? t >>> 0 : void 0;
362
- }
363
- function Fi(t) {
364
- const e = t.length;
365
- return (t[0] === "-" ? e < 20 || e === 20 && t <= "-9223372036854775808" : e < 19 || e === 19 && t <= "9223372036854775807") ? t : (_n(t), bs(I, C));
366
- }
367
- function Es(t) {
368
- return t = me(t), te(t) || (ge(t), t = ws(I, C)), t;
369
- }
370
- function Ii(t) {
371
- var e = me(Number(t));
372
- return te(e) ? String(e) : ((e = t.indexOf(".")) !== -1 && (t = t.substring(0, e)), Fi(t));
373
- }
374
- function Pi(t) {
375
- var e = me(Number(t));
376
- return te(e) ? st(e) : ((e = t.indexOf(".")) !== -1 && (t = t.substring(0, e)), Ae() ? st(Xe(64, BigInt(t))) : st(Fi(t)));
377
- }
378
- function Oi(t) {
379
- return te(t) ? t = st(Es(t)) : (t = me(t), te(t) ? t = String(t) : (ge(t), t = bs(I, C)), t = st(t)), t;
380
- }
381
- function ja(t) {
382
- return t == null ? t : typeof t == "bigint" ? (Qn(t) ? t = Number(t) : (t = Xe(64, t), t = Qn(t) ? Number(t) : String(t)), t) : $e(t) ? typeof t == "number" ? Es(t) : Ii(t) : void 0;
383
- }
384
- function cn(t) {
385
- const e = typeof t;
386
- return t == null ? t : e === "bigint" ? st(Xe(64, t)) : $e(t) ? e === "string" ? Pi(t) : Oi(t) : void 0;
387
- }
388
- function xi(t) {
389
- if (typeof t != "string") throw Error();
390
- return t;
391
- }
392
- function Je(t) {
393
- if (t != null && typeof t != "string") throw Error();
394
- return t;
395
- }
396
- function z(t) {
397
- return t == null || typeof t == "string" ? t : void 0;
398
- }
399
- function ks(t, e, n, s) {
400
- return t != null && t[de] === pe ? t : Array.isArray(t) ? ((s = (n = 0 | t[d]) | 32 & s | 2 & s) !== n && G(t, s), new e(t)) : (n ? 2 & s ? ((t = e[mr]) || (Ye((t = new e()).v), t = e[mr] = t), e = t) : e = new e() : e = void 0, e);
401
- }
402
- function Ha(t, e, n) {
403
- if (e) t: {
404
- if (!$e(e = t)) throw $n("int64");
405
- switch (typeof e) {
406
- case "string":
407
- e = Pi(e);
408
- break t;
409
- case "bigint":
410
- e = st(Xe(64, e));
411
- break t;
412
- default:
413
- e = Oi(e);
414
- }
415
- }
416
- else e = cn(t);
417
- return (t = e) == null ? n ? Va : void 0 : t;
418
- }
419
- const Ka = {};
420
- let Wa = function() {
421
- try {
422
- return gn(new class extends Map {
423
- constructor() {
424
- super();
425
- }
426
- }()), !1;
427
- } catch {
428
- return !0;
429
- }
430
- }();
431
- class Gn {
432
- constructor() {
433
- this.g = /* @__PURE__ */ new Map();
434
- }
435
- get(e) {
436
- return this.g.get(e);
437
- }
438
- set(e, n) {
439
- return this.g.set(e, n), this.size = this.g.size, this;
440
- }
441
- delete(e) {
442
- return e = this.g.delete(e), this.size = this.g.size, e;
443
- }
444
- clear() {
445
- this.g.clear(), this.size = this.g.size;
446
- }
447
- has(e) {
448
- return this.g.has(e);
449
- }
450
- entries() {
451
- return this.g.entries();
452
- }
453
- keys() {
454
- return this.g.keys();
455
- }
456
- values() {
457
- return this.g.values();
458
- }
459
- forEach(e, n) {
460
- return this.g.forEach(e, n);
461
- }
462
- [Symbol.iterator]() {
463
- return this.entries();
464
- }
465
- }
466
- const qa = Wa ? (Object.setPrototypeOf(Gn.prototype, Map.prototype), Object.defineProperties(Gn.prototype, { size: { value: 0, configurable: !0, enumerable: !0, writable: !0 } }), Gn) : class extends Map {
467
- constructor() {
468
- super();
469
- }
470
- };
471
- function kr(t) {
472
- return t;
473
- }
474
- function jn(t) {
475
- if (2 & t.J) throw Error("Cannot mutate an immutable Map");
476
- }
477
- var It = class extends qa {
478
- constructor(t, e, n = kr, s = kr) {
479
- super(), this.J = 0 | t[d], this.K = e, this.S = n, this.fa = this.K ? za : s;
480
- for (let r = 0; r < t.length; r++) {
481
- const i = t[r], o = n(i[0], !1, !0);
482
- let a = i[1];
483
- e ? a === void 0 && (a = null) : a = s(i[1], !1, !0, void 0, void 0, this.J), super.set(o, a);
484
- }
485
- }
486
- V(t) {
487
- return He(Array.from(super.entries(), t));
488
- }
489
- clear() {
490
- jn(this), super.clear();
491
- }
492
- delete(t) {
493
- return jn(this), super.delete(this.S(t, !0, !1));
494
- }
495
- entries() {
496
- if (this.K) {
497
- var t = super.keys();
498
- t = new vr(t, Ya, this);
499
- } else t = super.entries();
500
- return t;
501
- }
502
- values() {
503
- if (this.K) {
504
- var t = super.keys();
505
- t = new vr(t, It.prototype.get, this);
506
- } else t = super.values();
507
- return t;
508
- }
509
- forEach(t, e) {
510
- this.K ? super.forEach((n, s, r) => {
511
- t.call(e, r.get(s), s, r);
512
- }) : super.forEach(t, e);
513
- }
514
- set(t, e) {
515
- return jn(this), (t = this.S(t, !0, !1)) == null ? this : e == null ? (super.delete(t), this) : super.set(t, this.fa(e, !0, !0, this.K, !1, this.J));
516
- }
517
- Ma(t) {
518
- const e = this.S(t[0], !1, !0);
519
- t = t[1], t = this.K ? t === void 0 ? null : t : this.fa(t, !1, !0, void 0, !1, this.J), super.set(e, t);
520
- }
521
- has(t) {
522
- return super.has(this.S(t, !1, !1));
523
- }
524
- get(t) {
525
- t = this.S(t, !1, !1);
526
- const e = super.get(t);
527
- if (e !== void 0) {
528
- var n = this.K;
529
- return n ? ((n = this.fa(e, !1, !0, n, this.ra, this.J)) !== e && super.set(t, n), n) : e;
530
- }
531
- }
532
- [Symbol.iterator]() {
533
- return this.entries();
534
- }
535
- };
536
- function za(t, e, n, s, r, i) {
537
- return t = ks(t, s, n, i), r && (t = Ls(t)), t;
538
- }
539
- function Ya(t) {
540
- return [t, this.get(t)];
541
- }
542
- let Xa;
543
- function Sr() {
544
- return Xa || (Xa = new It(Ye([]), void 0, void 0, void 0, Ka));
545
- }
546
- function wn(t) {
547
- return nt ? t[nt] : void 0;
548
- }
549
- function hn(t, e) {
550
- for (const n in t) !isNaN(n) && e(t, +n, t[n]);
551
- }
552
- It.prototype.toJSON = void 0;
553
- var ts = class {
554
- };
555
- const $a = { Ka: !0 };
556
- function Ja(t, e) {
557
- e < 100 || fe(Ta, 1);
558
- }
559
- function bn(t, e, n, s) {
560
- const r = s !== void 0;
561
- s = !!s;
562
- var i, o = nt;
563
- !r && Ee && o && (i = t[o]) && hn(i, Ja), o = [];
564
- var a = t.length;
565
- let c;
566
- i = 4294967295;
567
- let u = !1;
568
- const h = !!(64 & e), f = h ? 128 & e ? 0 : -1 : void 0;
569
- 1 & e || (c = a && t[a - 1], c != null && typeof c == "object" && c.constructor === Object ? i = --a : c = void 0, !h || 128 & e || r || (u = !0, i = i - f + f)), e = void 0;
570
- for (var _ = 0; _ < a; _++) {
571
- let v = t[_];
572
- if (v != null && (v = n(v, s)) != null) if (h && _ >= i) {
573
- const j = _ - f;
574
- (e ?? (e = {}))[j] = v;
575
- } else o[_] = v;
576
- }
577
- if (c) for (let v in c) {
578
- if ((a = c[v]) == null || (a = n(a, s)) == null) continue;
579
- let j;
580
- _ = +v, h && !Number.isNaN(_) && (j = _ + f) < i ? o[j] = a : (e ?? (e = {}))[v] = a;
581
- }
582
- return e && (u ? o.push(e) : o[i] = e), r && nt && (t = wn(t)) && t instanceof ts && (o[nt] = function(v) {
583
- const j = new ts();
584
- return hn(v, (Dn, re, Ne) => {
585
- j[re] = mt(Ne);
586
- }), j.da = v.da, j;
587
- }(t)), o;
588
- }
589
- function Qa(t) {
590
- return t[0] = qe(t[0]), t[1] = qe(t[1]), t;
591
- }
592
- function qe(t) {
593
- switch (typeof t) {
594
- case "number":
595
- return Number.isFinite(t) ? t : "" + t;
596
- case "bigint":
597
- return Qn(t) ? Number(t) : "" + t;
598
- case "boolean":
599
- return t ? 1 : 0;
600
- case "object":
601
- if (Array.isArray(t)) {
602
- var e = 0 | t[d];
603
- return t.length === 0 && 1 & e ? void 0 : bn(t, e, qe);
604
- }
605
- if (t != null && t[de] === pe) return Ni(t);
606
- if (t instanceof Et) {
607
- if ((e = t.g) == null) t = "";
608
- else if (typeof e == "string") t = e;
609
- else {
610
- if (_i) {
611
- for (var n = "", s = 0, r = e.length - 10240; s < r; ) n += String.fromCharCode.apply(null, e.subarray(s, s += 10240));
612
- n += String.fromCharCode.apply(null, s ? e.subarray(s) : e), e = btoa(n);
613
- } else {
614
- n === void 0 && (n = 0), yi(), n = mi[n], s = Array(Math.floor(e.length / 3)), r = n[64] || "";
615
- let u = 0, h = 0;
616
- for (; u < e.length - 2; u += 3) {
617
- var i = e[u], o = e[u + 1], a = e[u + 2], c = n[i >> 2];
618
- i = n[(3 & i) << 4 | o >> 4], o = n[(15 & o) << 2 | a >> 6], a = n[63 & a], s[h++] = c + i + o + a;
619
- }
620
- switch (c = 0, a = r, e.length - u) {
621
- case 2:
622
- a = n[(15 & (c = e[u + 1])) << 2] || r;
623
- case 1:
624
- e = e[u], s[h] = n[e >> 2] + n[(3 & e) << 4 | c >> 4] + a + r;
625
- }
626
- e = s.join("");
627
- }
628
- t = t.g = e;
629
- }
630
- return t;
631
- }
632
- return t instanceof It ? t = t.size !== 0 ? t.V(Qa) : void 0 : void 0;
633
- }
634
- return t;
635
- }
636
- function Ni(t) {
637
- return bn(t = t.v, 0 | t[d], qe);
638
- }
639
- let Za, t2;
640
- function zt(t, e) {
641
- return Ri(t, e[0], e[1]);
642
- }
643
- function Ri(t, e, n, s = 0) {
644
- if (t == null) {
645
- var r = 32;
646
- n ? (t = [n], r |= 128) : t = [], e && (r = -16760833 & r | (1023 & e) << 14);
647
- } else {
648
- if (!Array.isArray(t)) throw Error("narr");
649
- if (r = 0 | t[d], fr && 1 & r) throw Error("rfarr");
650
- if (2048 & r && !(2 & r) && function() {
651
- if (fr) throw Error("carr");
652
- fe(Ma, 5);
653
- }(), 256 & r) throw Error("farr");
654
- if (64 & r) return (r | s) !== r && G(t, r | s), t;
655
- if (n && (r |= 128, n !== t[0])) throw Error("mid");
656
- t: {
657
- r |= 64;
658
- var i = (n = t).length;
659
- if (i) {
660
- var o = i - 1;
661
- const c = n[o];
662
- if (c != null && typeof c == "object" && c.constructor === Object) {
663
- if ((o -= e = 128 & r ? 0 : -1) >= 1024) throw Error("pvtlmt");
664
- for (var a in c) (i = +a) < o && (n[i + e] = c[a], delete c[a]);
665
- r = -16760833 & r | (1023 & o) << 14;
666
- break t;
667
- }
668
- }
669
- if (e) {
670
- if ((a = Math.max(e, i - (128 & r ? 0 : -1))) > 1024) throw Error("spvt");
671
- r = -16760833 & r | (1023 & a) << 14;
672
- }
673
- }
674
- }
675
- return G(t, 64 | r | s), t;
676
- }
677
- function e2(t, e) {
678
- if (typeof t != "object") return t;
679
- if (Array.isArray(t)) {
680
- var n = 0 | t[d];
681
- return t.length === 0 && 1 & n ? void 0 : Lr(t, n, e);
682
- }
683
- if (t != null && t[de] === pe) return Tr(t);
684
- if (t instanceof It) {
685
- if (2 & (e = t.J)) return t;
686
- if (!t.size) return;
687
- if (n = Ye(t.V()), t.K) for (t = 0; t < n.length; t++) {
688
- const s = n[t];
689
- let r = s[1];
690
- r = r == null || typeof r != "object" ? void 0 : r != null && r[de] === pe ? Tr(r) : Array.isArray(r) ? Lr(r, 0 | r[d], !!(32 & e)) : void 0, s[1] = r;
691
- }
692
- return n;
693
- }
694
- return t instanceof Et ? t : void 0;
695
- }
696
- function Lr(t, e, n) {
697
- return 2 & e || (!n || 4096 & e || 16 & e ? t = Le(t, e, !1, n && !(16 & e)) : (ze(t, 34), 4 & e && Object.freeze(t))), t;
698
- }
699
- function Ss(t, e, n) {
700
- return t = new t.constructor(e), n && (t.h = Zt), t.m = Zt, t;
701
- }
702
- function Tr(t) {
703
- const e = t.v, n = 0 | e[d];
704
- return rt(t, n) ? t : Ts(t, e, n) ? Ss(t, e) : Le(e, n);
705
- }
706
- function Le(t, e, n, s) {
707
- return s ?? (s = !!(34 & e)), t = bn(t, e, e2, s), s = 32, n && (s |= 2), G(t, e = 16769217 & e | s), t;
708
- }
709
- function Ls(t) {
710
- const e = t.v, n = 0 | e[d];
711
- return rt(t, n) ? Ts(t, e, n) ? Ss(t, e, !0) : new t.constructor(Le(e, n, !1)) : t;
712
- }
713
- function Te(t) {
714
- if (t.h !== Zt) return !1;
715
- var e = t.v;
716
- return ze(e = Le(e, 0 | e[d]), 2048), t.v = e, t.h = void 0, t.m = void 0, !0;
717
- }
718
- function Me(t) {
719
- if (!Te(t) && rt(t, 0 | t.v[d])) throw Error();
720
- }
721
- function ne(t, e) {
722
- e === void 0 && (e = 0 | t[d]), 32 & e && !(4096 & e) && G(t, 4096 | e);
723
- }
724
- function Ts(t, e, n) {
725
- return !!(2 & n) || !(!(32 & n) || 4096 & n) && (G(e, 2 | n), t.h = Zt, !0);
726
- }
727
- const n2 = st(0), Rt = {};
728
- function T(t, e, n, s, r) {
729
- if ((e = Pt(t.v, e, n, r)) !== null || s && t.m !== Zt) return e;
730
- }
731
- function Pt(t, e, n, s) {
732
- if (e === -1) return null;
733
- const r = e + (n ? 0 : -1), i = t.length - 1;
734
- let o, a;
735
- if (!(i < 1 + (n ? 0 : -1))) {
736
- if (r >= i) if (o = t[i], o != null && typeof o == "object" && o.constructor === Object) n = o[e], a = !0;
737
- else {
738
- if (r !== i) return;
739
- n = o;
740
- }
741
- else n = t[r];
742
- if (s && n != null) {
743
- if ((s = s(n)) == null) return s;
744
- if (!Object.is(s, n)) return a ? o[e] = s : t[r] = s, s;
745
- }
746
- return n;
747
- }
748
- }
749
- function k(t, e, n, s) {
750
- Me(t), U(t = t.v, 0 | t[d], e, n, s);
751
- }
752
- function U(t, e, n, s, r) {
753
- const i = n + (r ? 0 : -1);
754
- var o = t.length - 1;
755
- if (o >= 1 + (r ? 0 : -1) && i >= o) {
756
- const a = t[o];
757
- if (a != null && typeof a == "object" && a.constructor === Object) return a[n] = s, e;
758
- }
759
- return i <= o ? (t[i] = s, e) : (s !== void 0 && (n >= (o = (e ?? (e = 0 | t[d])) >> 14 & 1023 || 536870912) ? s != null && (t[o + (r ? 0 : -1)] = { [n]: s }) : t[i] = s), e);
760
- }
761
- function Wt() {
762
- return Fa === void 0 ? 2 : 4;
763
- }
764
- function qt(t, e, n, s, r) {
765
- let i = t.v, o = 0 | i[d];
766
- s = rt(t, o) ? 1 : s, r = !!r || s === 3, s === 2 && Te(t) && (i = t.v, o = 0 | i[d]);
767
- let a = (t = Ms(i, e)) === ee ? 7 : 0 | t[d], c = Fs(a, o);
768
- var u = !(4 & c);
769
- if (u) {
770
- 4 & c && (t = mt(t), a = 0, c = Xt(c, o), o = U(i, o, e, t));
771
- let h = 0, f = 0;
772
- for (; h < t.length; h++) {
773
- const _ = n(t[h]);
774
- _ != null && (t[f++] = _);
775
- }
776
- f < h && (t.length = f), n = -513 & (4 | c), c = n &= -1025, c &= -4097;
777
- }
778
- return c !== a && (G(t, c), 2 & c && Object.freeze(t)), Ci(t, c, i, o, e, s, u, r);
779
- }
780
- function Ci(t, e, n, s, r, i, o, a) {
781
- let c = e;
782
- return i === 1 || i === 4 && (2 & e || !(16 & e) && 32 & s) ? Yt(e) || ((e |= !t.length || o && !(4096 & e) || 32 & s && !(4096 & e || 16 & e) ? 2 : 256) !== c && G(t, e), Object.freeze(t)) : (i === 2 && Yt(e) && (t = mt(t), c = 0, e = Xt(e, s), s = U(n, s, r, t)), Yt(e) || (a || (e |= 16), e !== c && G(t, e))), 2 & e || !(4096 & e || 16 & e) || ne(n, s), t;
783
- }
784
- function Ms(t, e, n) {
785
- return t = Pt(t, e, n), Array.isArray(t) ? t : ee;
786
- }
787
- function Fs(t, e) {
788
- return 2 & e && (t |= 2), 1 | t;
789
- }
790
- function Yt(t) {
791
- return !!(2 & t) && !!(4 & t) || !!(256 & t);
792
- }
793
- function Bi(t) {
794
- return _s(t, !0);
795
- }
796
- function Di(t) {
797
- t = mt(t);
798
- for (let e = 0; e < t.length; e++) {
799
- const n = t[e] = mt(t[e]);
800
- Array.isArray(n[1]) && (n[1] = Ye(n[1]));
801
- }
802
- return He(t);
803
- }
804
- function Bt(t, e, n, s) {
805
- Me(t), U(t = t.v, 0 | t[d], e, (s === "0" ? Number(n) === 0 : n === s) ? void 0 : n);
806
- }
807
- function Fe(t, e, n) {
808
- if (2 & e) throw Error();
809
- const s = ke(e);
810
- let r = Ms(t, n, s), i = r === ee ? 7 : 0 | r[d], o = Fs(i, e);
811
- return (2 & o || Yt(o) || 16 & o) && (o === i || Yt(o) || G(r, o), r = mt(r), i = 0, o = Xt(o, e), U(t, e, n, r, s)), o &= -13, o !== i && G(r, o), r;
812
- }
813
- function Hn(t, e) {
814
- var n = Po;
815
- return Ps(Is(t = t.v), t, void 0, n) === e ? e : -1;
816
- }
817
- function Is(t) {
818
- if (Ee) return t[Re] ?? (t[Re] = /* @__PURE__ */ new Map());
819
- if (Re in t) return t[Re];
820
- const e = /* @__PURE__ */ new Map();
821
- return Object.defineProperty(t, Re, { value: e }), e;
822
- }
823
- function Ui(t, e, n, s, r) {
824
- const i = Is(t), o = Ps(i, t, e, n, r);
825
- return o !== s && (o && (e = U(t, e, o, void 0, r)), i.set(n, s)), e;
826
- }
827
- function Ps(t, e, n, s, r) {
828
- let i = t.get(s);
829
- if (i != null) return i;
830
- i = 0;
831
- for (let o = 0; o < s.length; o++) {
832
- const a = s[o];
833
- Pt(e, a, r) != null && (i !== 0 && (n = U(e, n, i, void 0, r)), i = a);
834
- }
835
- return t.set(s, i), i;
836
- }
837
- function Os(t, e, n) {
838
- let s = 0 | t[d];
839
- const r = ke(s), i = Pt(t, n, r);
840
- let o;
841
- if (i != null && i[de] === pe) {
842
- if (!rt(i)) return Te(i), i.v;
843
- o = i.v;
844
- } else Array.isArray(i) && (o = i);
845
- if (o) {
846
- const a = 0 | o[d];
847
- 2 & a && (o = Le(o, a));
848
- }
849
- return o = zt(o, e), o !== i && U(t, s, n, o, r), o;
850
- }
851
- function Vi(t, e, n, s, r) {
852
- let i = !1;
853
- if ((s = Pt(t, s, r, (o) => {
854
- const a = ks(o, n, !1, e);
855
- return i = a !== o && a != null, a;
856
- })) != null) return i && !rt(s) && ne(t, e), s;
857
- }
858
- function A(t, e, n, s) {
859
- let r = t.v, i = 0 | r[d];
860
- if ((e = Vi(r, i, e, n, s)) == null) return e;
861
- if (i = 0 | r[d], !rt(t, i)) {
862
- const o = Ls(e);
863
- o !== e && (Te(t) && (r = t.v, i = 0 | r[d]), i = U(r, i, n, e = o, s), ne(r, i));
864
- }
865
- return e;
866
- }
867
- function Gi(t, e, n, s, r, i, o, a) {
868
- var c = rt(t, n);
869
- i = c ? 1 : i, o = !!o || i === 3, c = a && !c, (i === 2 || c) && Te(t) && (n = 0 | (e = t.v)[d]);
870
- var u = (t = Ms(e, r)) === ee ? 7 : 0 | t[d], h = Fs(u, n);
871
- if (a = !(4 & h)) {
872
- var f = t, _ = n;
873
- const v = !!(2 & h);
874
- v && (_ |= 2);
875
- let j = !v, Dn = !0, re = 0, Ne = 0;
876
- for (; re < f.length; re++) {
877
- const Un = ks(f[re], s, !1, _);
878
- if (Un instanceof s) {
879
- if (!v) {
880
- const ur = rt(Un);
881
- j && (j = !ur), Dn && (Dn = ur);
882
- }
883
- f[Ne++] = Un;
884
- }
885
- }
886
- Ne < re && (f.length = Ne), h |= 4, h = Dn ? -4097 & h : 4096 | h, h = j ? 8 | h : -9 & h;
887
- }
888
- if (h !== u && (G(t, h), 2 & h && Object.freeze(t)), c && !(8 & h || !t.length && (i === 1 || i === 4 && (2 & h || !(16 & h) && 32 & n)))) {
889
- for (Yt(h) && (t = mt(t), h = Xt(h, n), n = U(e, n, r, t)), s = t, c = h, u = 0; u < s.length; u++) (f = s[u]) !== (h = Ls(f)) && (s[u] = h);
890
- c |= 8, G(t, h = c = s.length ? 4096 | c : -4097 & c);
891
- }
892
- return Ci(t, h, e, n, r, i, a, o);
893
- }
894
- function Ot(t, e, n) {
895
- const s = t.v;
896
- return Gi(t, s, 0 | s[d], e, n, Wt(), !1, !0);
897
- }
898
- function ji(t) {
899
- return t == null && (t = void 0), t;
900
- }
901
- function y(t, e, n, s, r) {
902
- return k(t, n, s = ji(s), r), s && !rt(s) && ne(t.v), t;
903
- }
904
- function Ue(t, e, n, s) {
905
- t: {
906
- var r = s = ji(s);
907
- Me(t);
908
- const i = t.v;
909
- let o = 0 | i[d];
910
- if (r == null) {
911
- const a = Is(i);
912
- if (Ps(a, i, o, n) !== e) break t;
913
- a.set(n, 0);
914
- } else o = Ui(i, o, n, e);
915
- U(i, o, e, r);
916
- }
917
- s && !rt(s) && ne(t.v);
918
- }
919
- function Xt(t, e) {
920
- return -273 & (2 & e ? 2 | t : -3 & t);
921
- }
922
- function xs(t, e, n, s) {
923
- var r = s;
924
- Me(t), t = Gi(t, s = t.v, 0 | s[d], n, e, 2, !0), r = r ?? new n(), t.push(r), e = n = t === ee ? 7 : 0 | t[d], (r = rt(r)) ? (n &= -9, t.length === 1 && (n &= -4097)) : n |= 4096, n !== e && G(t, n), r || ne(s);
925
- }
926
- function dt(t, e, n) {
927
- return Se(T(t, e, void 0, n));
928
- }
929
- function Hi(t) {
930
- return (gs ? T(t, 2, void 0, void 0, cn) : cn(T(t, 2))) ?? n2;
931
- }
932
- function N(t, e) {
933
- return T(t, e, void 0, void 0, At) ?? 0;
934
- }
935
- function xt(t, e, n) {
936
- if (n != null) {
937
- if (typeof n != "number" || !vn(n)) throw $n("int32");
938
- n |= 0;
939
- }
940
- k(t, e, n);
941
- }
942
- function m(t, e, n) {
943
- k(t, e, De(n));
944
- }
945
- function it(t, e, n) {
946
- Bt(t, e, Je(n), "");
947
- }
948
- function un(t, e, n) {
949
- {
950
- Me(t);
951
- const o = t.v;
952
- let a = 0 | o[d];
953
- if (n == null) U(o, a, e);
954
- else {
955
- var s = t = n === ee ? 7 : 0 | n[d], r = Yt(t), i = r || Object.isFrozen(n);
956
- for (r || (t = 0), i || (n = mt(n), s = 0, t = Xt(t, a), i = !1), t |= 5, t |= (4 & t ? 512 & t ? 512 : 1024 & t ? 1024 : 0 : void 0) ?? (gs ? 1024 : 0), r = 0; r < n.length; r++) {
957
- const c = n[r], u = xi(c);
958
- Object.is(c, u) || (i && (n = mt(n), s = 0, t = Xt(t, a), i = !1), n[r] = u);
959
- }
960
- t !== s && (i && (n = mt(n), t = Xt(t, a)), G(n, t)), U(o, a, e, n);
961
- }
962
- }
963
- }
964
- function An(t, e, n) {
965
- Me(t), qt(t, e, z, 2, !0).push(xi(n));
966
- }
967
- var ie = class {
968
- constructor(t, e, n) {
969
- if (this.buffer = t, n && !e) throw Error();
970
- this.g = e;
971
- }
972
- };
973
- function Ns(t, e) {
974
- if (typeof t == "string") return new ie(vi(t), e);
975
- if (Array.isArray(t)) return new ie(new Uint8Array(t), e);
976
- if (t.constructor === Uint8Array) return new ie(t, !1);
977
- if (t.constructor === ArrayBuffer) return t = new Uint8Array(t), new ie(t, !1);
978
- if (t.constructor === Et) return e = ys(t) || new Uint8Array(0), new ie(e, !0, t);
979
- if (t instanceof Uint8Array) return t = t.constructor === Uint8Array ? t : new Uint8Array(t.buffer, t.byteOffset, t.byteLength), new ie(t, !1);
980
- throw Error();
981
- }
982
- function ye(t, e) {
983
- let n, s = 0, r = 0, i = 0;
984
- const o = t.h;
985
- let a = t.g;
986
- do
987
- n = o[a++], s |= (127 & n) << i, i += 7;
988
- while (i < 32 && 128 & n);
989
- if (i > 32) for (r |= (127 & n) >> 4, i = 3; i < 32 && 128 & n; i += 7) n = o[a++], r |= (127 & n) << i;
990
- if ($t(t, a), !(128 & n)) return e(s >>> 0, r >>> 0);
991
- throw Error();
992
- }
993
- function Rs(t) {
994
- let e = 0, n = t.g;
995
- const s = n + 10, r = t.h;
996
- for (; n < s; ) {
997
- const i = r[n++];
998
- if (e |= i, (128 & i) == 0) return $t(t, n), !!(127 & e);
999
- }
1000
- throw Error();
1001
- }
1002
- function Vt(t) {
1003
- const e = t.h;
1004
- let n = t.g, s = e[n++], r = 127 & s;
1005
- if (128 & s && (s = e[n++], r |= (127 & s) << 7, 128 & s && (s = e[n++], r |= (127 & s) << 14, 128 & s && (s = e[n++], r |= (127 & s) << 21, 128 & s && (s = e[n++], r |= s << 28, 128 & s && 128 & e[n++] && 128 & e[n++] && 128 & e[n++] && 128 & e[n++] && 128 & e[n++]))))) throw Error();
1006
- return $t(t, n), r;
1007
- }
1008
- function Nt(t) {
1009
- return Vt(t) >>> 0;
1010
- }
1011
- function ln(t) {
1012
- var e = t.h;
1013
- const n = t.g;
1014
- var s = e[n], r = e[n + 1];
1015
- const i = e[n + 2];
1016
- return e = e[n + 3], $t(t, t.g + 4), t = 2 * ((r = (s << 0 | r << 8 | i << 16 | e << 24) >>> 0) >> 31) + 1, s = r >>> 23 & 255, r &= 8388607, s == 255 ? r ? NaN : t * (1 / 0) : s == 0 ? 1401298464324817e-60 * t * r : t * Math.pow(2, s - 150) * (r + 8388608);
1017
- }
1018
- function s2(t) {
1019
- return Vt(t);
1020
- }
1021
- function $t(t, e) {
1022
- if (t.g = e, e > t.l) throw Error();
1023
- }
1024
- function Ki(t, e) {
1025
- if (e < 0) throw Error();
1026
- const n = t.g;
1027
- if ((e = n + e) > t.l) throw Error();
1028
- return t.g = e, n;
1029
- }
1030
- function Wi(t, e) {
1031
- if (e == 0) return Qt();
1032
- var n = Ki(t, e);
1033
- return t.Y && t.j ? n = t.h.subarray(n, n + e) : (t = t.h, n = n === (e = n + e) ? new Uint8Array(0) : Ca ? t.slice(n, e) : new Uint8Array(t.subarray(n, e))), n.length == 0 ? Qt() : new Et(n, le);
1034
- }
1035
- var Mr = [];
1036
- function qi(t, e, n, s) {
1037
- if (fn.length) {
1038
- const r = fn.pop();
1039
- return r.o(s), r.g.init(t, e, n, s), r;
1040
- }
1041
- return new r2(t, e, n, s);
1042
- }
1043
- function zi(t) {
1044
- t.g.clear(), t.l = -1, t.h = -1, fn.length < 100 && fn.push(t);
1045
- }
1046
- function Yi(t) {
1047
- var e = t.g;
1048
- if (e.g == e.l) return !1;
1049
- t.m = t.g.g;
1050
- var n = Nt(t.g);
1051
- if (e = n >>> 3, !((n &= 7) >= 0 && n <= 5) || e < 1) throw Error();
1052
- return t.l = e, t.h = n, !0;
1053
- }
1054
- function on(t) {
1055
- switch (t.h) {
1056
- case 0:
1057
- t.h != 0 ? on(t) : Rs(t.g);
1058
- break;
1059
- case 1:
1060
- $t(t = t.g, t.g + 8);
1061
- break;
1062
- case 2:
1063
- if (t.h != 2) on(t);
1064
- else {
1065
- var e = Nt(t.g);
1066
- $t(t = t.g, t.g + e);
1067
- }
1068
- break;
1069
- case 5:
1070
- $t(t = t.g, t.g + 4);
1071
- break;
1072
- case 3:
1073
- for (e = t.l; ; ) {
1074
- if (!Yi(t)) throw Error();
1075
- if (t.h == 4) {
1076
- if (t.l != e) throw Error();
1077
- break;
1078
- }
1079
- on(t);
1080
- }
1081
- break;
1082
- default:
1083
- throw Error();
1084
- }
1085
- }
1086
- function Qe(t, e, n) {
1087
- const s = t.g.l;
1088
- var r = Nt(t.g);
1089
- let i = (r = t.g.g + r) - s;
1090
- if (i <= 0 && (t.g.l = r, n(e, t, void 0, void 0, void 0), i = r - t.g.g), i) throw Error();
1091
- return t.g.g = r, t.g.l = s, e;
1092
- }
1093
- function Cs(t) {
1094
- var e = Nt(t.g), n = Ki(t = t.g, e);
1095
- if (t = t.h, ga) {
1096
- var s, r = t;
1097
- (s = Vn) || (s = Vn = new TextDecoder("utf-8", { fatal: !0 })), e = n + e, r = n === 0 && e === r.length ? r : r.subarray(n, e);
1098
- try {
1099
- var i = s.decode(r);
1100
- } catch (a) {
1101
- if (en === void 0) {
1102
- try {
1103
- s.decode(new Uint8Array([128]));
1104
- } catch {
1105
- }
1106
- try {
1107
- s.decode(new Uint8Array([97])), en = !0;
1108
- } catch {
1109
- en = !1;
1110
- }
1111
- }
1112
- throw !en && (Vn = void 0), a;
1113
- }
1114
- } else {
1115
- e = (i = n) + e, n = [];
1116
- let a, c = null;
1117
- for (; i < e; ) {
1118
- var o = t[i++];
1119
- o < 128 ? n.push(o) : o < 224 ? i >= e ? Ht() : (a = t[i++], o < 194 || (192 & a) != 128 ? (i--, Ht()) : n.push((31 & o) << 6 | 63 & a)) : o < 240 ? i >= e - 1 ? Ht() : (a = t[i++], (192 & a) != 128 || o === 224 && a < 160 || o === 237 && a >= 160 || (192 & (s = t[i++])) != 128 ? (i--, Ht()) : n.push((15 & o) << 12 | (63 & a) << 6 | 63 & s)) : o <= 244 ? i >= e - 2 ? Ht() : (a = t[i++], (192 & a) != 128 || a - 144 + (o << 28) >> 30 || (192 & (s = t[i++])) != 128 || (192 & (r = t[i++])) != 128 ? (i--, Ht()) : (o = (7 & o) << 18 | (63 & a) << 12 | (63 & s) << 6 | 63 & r, o -= 65536, n.push(55296 + (o >> 10 & 1023), 56320 + (1023 & o)))) : Ht(), n.length >= 8192 && (c = lr(c, n), n.length = 0);
1120
- }
1121
- i = lr(c, n);
1122
- }
1123
- return i;
1124
- }
1125
- function Xi(t) {
1126
- const e = Nt(t.g);
1127
- return Wi(t.g, e);
1128
- }
1129
- function En(t, e, n) {
1130
- var s = Nt(t.g);
1131
- for (s = t.g.g + s; t.g.g < s; ) n.push(e(t.g));
1132
- }
1133
- var r2 = class {
1134
- constructor(t, e, n, s) {
1135
- if (Mr.length) {
1136
- const r = Mr.pop();
1137
- r.init(t, e, n, s), t = r;
1138
- } else t = new class {
1139
- constructor(r, i, o, a) {
1140
- this.h = null, this.j = !1, this.g = this.l = this.m = 0, this.init(r, i, o, a);
1141
- }
1142
- init(r, i, o, { Y: a = !1, ea: c = !1 } = {}) {
1143
- this.Y = a, this.ea = c, r && (r = Ns(r, this.ea), this.h = r.buffer, this.j = r.g, this.m = i || 0, this.l = o !== void 0 ? this.m + o : this.h.length, this.g = this.m);
1144
- }
1145
- clear() {
1146
- this.h = null, this.j = !1, this.g = this.l = this.m = 0, this.Y = !1;
1147
- }
1148
- }(t, e, n, s);
1149
- this.g = t, this.m = this.g.g, this.h = this.l = -1, this.o(s);
1150
- }
1151
- o({ ha: t = !1 } = {}) {
1152
- this.ha = t;
1153
- }
1154
- }, fn = [];
1155
- function Fr(t) {
1156
- return t ? /^\d+$/.test(t) ? (_n(t), new es(I, C)) : null : i2 || (i2 = new es(0, 0));
1157
- }
1158
- var es = class {
1159
- constructor(t, e) {
1160
- this.h = t >>> 0, this.g = e >>> 0;
1161
- }
1162
- };
1163
- let i2;
1164
- function Ir(t) {
1165
- return t ? /^-?\d+$/.test(t) ? (_n(t), new ns(I, C)) : null : o2 || (o2 = new ns(0, 0));
1166
- }
1167
- var ns = class {
1168
- constructor(t, e) {
1169
- this.h = t >>> 0, this.g = e >>> 0;
1170
- }
1171
- };
1172
- let o2;
1173
- function ce(t, e, n) {
1174
- for (; n > 0 || e > 127; ) t.g.push(127 & e | 128), e = (e >>> 7 | n << 25) >>> 0, n >>>= 7;
1175
- t.g.push(e);
1176
- }
1177
- function Ie(t, e) {
1178
- for (; e > 127; ) t.g.push(127 & e | 128), e >>>= 7;
1179
- t.g.push(e);
1180
- }
1181
- function kn(t, e) {
1182
- if (e >= 0) Ie(t, e);
1183
- else {
1184
- for (let n = 0; n < 9; n++) t.g.push(127 & e | 128), e >>= 7;
1185
- t.g.push(1);
1186
- }
1187
- }
1188
- function Bs(t) {
1189
- var e = I;
1190
- t.g.push(e >>> 0 & 255), t.g.push(e >>> 8 & 255), t.g.push(e >>> 16 & 255), t.g.push(e >>> 24 & 255);
1191
- }
1192
- function _e(t, e) {
1193
- e.length !== 0 && (t.l.push(e), t.h += e.length);
1194
- }
1195
- function pt(t, e, n) {
1196
- Ie(t.g, 8 * e + n);
1197
- }
1198
- function Ds(t, e) {
1199
- return pt(t, e, 2), e = t.g.end(), _e(t, e), e.push(t.h), e;
1200
- }
1201
- function Us(t, e) {
1202
- var n = e.pop();
1203
- for (n = t.h + t.g.length() - n; n > 127; ) e.push(127 & n | 128), n >>>= 7, t.h++;
1204
- e.push(n), t.h++;
1205
- }
1206
- function Sn(t, e, n) {
1207
- pt(t, e, 2), Ie(t.g, n.length), _e(t, t.g.end()), _e(t, n);
1208
- }
1209
- function dn(t, e, n, s) {
1210
- n != null && (e = Ds(t, e), s(n, t), Us(t, e));
1211
- }
1212
- function St() {
1213
- const t = class {
1214
- constructor() {
1215
- throw Error();
1216
- }
1217
- };
1218
- return Object.setPrototypeOf(t, t.prototype), t;
1219
- }
1220
- var Vs = St(), $i = St(), Gs = St(), js = St(), Ji = St(), Qi = St(), a2 = St(), Ln = St(), Zi = St(), to = St();
1221
- function Lt(t, e, n) {
1222
- var s = t.v;
1223
- nt && nt in s && (s = s[nt]) && delete s[e.g], e.h ? e.j(t, e.h, e.g, n, e.l) : e.j(t, e.g, n, e.l);
1224
- }
1225
- var p = class {
1226
- constructor(t, e) {
1227
- this.v = Ri(t, e, void 0, 2048);
1228
- }
1229
- toJSON() {
1230
- return Ni(this);
1231
- }
1232
- j() {
1233
- var r;
1234
- var t = H2, e = this.v, n = t.g, s = nt;
1235
- if (Ee && s && ((r = e[s]) == null ? void 0 : r[n]) != null && fe(La, 3), e = t.g, yr && nt && yr === void 0 && (s = (n = this.v)[nt]) && (s = s.da)) try {
1236
- s(n, e, $a);
1237
- } catch (i) {
1238
- gi(i);
1239
- }
1240
- return t.h ? t.m(this, t.h, t.g, t.l) : t.m(this, t.g, t.defaultValue, t.l);
1241
- }
1242
- clone() {
1243
- const t = this.v, e = 0 | t[d];
1244
- return Ts(this, t, e) ? Ss(this, t, !0) : new this.constructor(Le(t, e, !1));
1245
- }
1246
- };
1247
- p.prototype[de] = pe, p.prototype.toString = function() {
1248
- return this.v.toString();
1249
- };
1250
- var Pe = class {
1251
- constructor(t, e, n) {
1252
- this.g = t, this.h = e, t = Vs, this.l = !!t && n === t || !1;
1253
- }
1254
- };
1255
- function Tn(t, e) {
1256
- return new Pe(t, e, Vs);
1257
- }
1258
- function eo(t, e, n, s, r) {
1259
- dn(t, n, io(e, s), r);
1260
- }
1261
- const c2 = Tn(function(t, e, n, s, r) {
1262
- return t.h === 2 && (Qe(t, Os(e, s, n), r), !0);
1263
- }, eo), h2 = Tn(function(t, e, n, s, r) {
1264
- return t.h === 2 && (Qe(t, Os(e, s, n), r), !0);
1265
- }, eo);
1266
- var Mn = Symbol(), Fn = Symbol(), ss = Symbol(), Pr = Symbol(), Or = Symbol();
1267
- let no, so;
1268
- function se(t, e, n, s) {
1269
- var r = s[t];
1270
- if (r) return r;
1271
- (r = {}).qa = s, r.T = function(f) {
1272
- switch (typeof f) {
1273
- case "boolean":
1274
- return Za || (Za = [0, void 0, !0]);
1275
- case "number":
1276
- return f > 0 ? void 0 : f === 0 ? t2 || (t2 = [0, void 0]) : [-f, void 0];
1277
- case "string":
1278
- return [0, f];
1279
- case "object":
1280
- return f;
1281
- }
1282
- }(s[0]);
1283
- var i = s[1];
1284
- let o = 1;
1285
- i && i.constructor === Object && (r.ba = i, typeof (i = s[++o]) == "function" && (r.ma = !0, no ?? (no = i), so ?? (so = s[o + 1]), i = s[o += 2]));
1286
- const a = {};
1287
- for (; i && Array.isArray(i) && i.length && typeof i[0] == "number" && i[0] > 0; ) {
1288
- for (var c = 0; c < i.length; c++) a[i[c]] = i;
1289
- i = s[++o];
1290
- }
1291
- for (c = 1; i !== void 0; ) {
1292
- let f;
1293
- typeof i == "number" && (c += i, i = s[++o]);
1294
- var u = void 0;
1295
- if (i instanceof Pe ? f = i : (f = c2, o--), f == null ? void 0 : f.l) {
1296
- i = s[++o], u = s;
1297
- var h = o;
1298
- typeof i == "function" && (i = i(), u[h] = i), u = i;
1299
- }
1300
- for (h = c + 1, typeof (i = s[++o]) == "number" && i < 0 && (h -= i, i = s[++o]); c < h; c++) {
1301
- const _ = a[c];
1302
- u ? n(r, c, f, u, _) : e(r, c, f, _);
1303
- }
1304
- }
1305
- return s[t] = r;
1306
- }
1307
- function ro(t) {
1308
- return Array.isArray(t) ? t[0] instanceof Pe ? t : [h2, t] : [t, void 0];
1309
- }
1310
- function io(t, e) {
1311
- return t instanceof p ? t.v : Array.isArray(t) ? zt(t, e) : void 0;
1312
- }
1313
- function Hs(t, e, n, s) {
1314
- const r = n.g;
1315
- t[e] = s ? (i, o, a) => r(i, o, a, s) : r;
1316
- }
1317
- function Ks(t, e, n, s, r) {
1318
- const i = n.g;
1319
- let o, a;
1320
- t[e] = (c, u, h) => i(c, u, h, a || (a = se(Fn, Hs, Ks, s).T), o || (o = Ws(s)), r);
1321
- }
1322
- function Ws(t) {
1323
- let e = t[ss];
1324
- if (e != null) return e;
1325
- const n = se(Fn, Hs, Ks, t);
1326
- return e = n.ma ? (s, r) => no(s, r, n) : (s, r) => {
1327
- for (; Yi(r) && r.h != 4; ) {
1328
- var i = r.l, o = n[i];
1329
- if (o == null) {
1330
- var a = n.ba;
1331
- a && (a = a[i]) && (a = l2(a)) != null && (o = n[i] = a);
1332
- }
1333
- if (o == null || !o(r, s, i)) {
1334
- if (o = (a = r).m, on(a), a.ha) var c = void 0;
1335
- else c = a.g.g - o, a.g.g = o, c = Wi(a.g, c);
1336
- o = void 0, a = s, c && ((o = a[nt] ?? (a[nt] = new ts()))[i] ?? (o[i] = [])).push(c);
1337
- }
1338
- }
1339
- return (s = wn(s)) && (s.da = n.qa[Or]), !0;
1340
- }, t[ss] = e, t[Or] = u2.bind(t), e;
1341
- }
1342
- function u2(t, e, n, s) {
1343
- var r = this[Fn];
1344
- const i = this[ss], o = zt(void 0, r.T), a = wn(t);
1345
- if (a) {
1346
- var c = !1, u = r.ba;
1347
- if (u) {
1348
- if (r = (h, f, _) => {
1349
- if (_.length !== 0) if (u[f]) for (const v of _) {
1350
- h = qi(v);
1351
- try {
1352
- c = !0, i(o, h);
1353
- } finally {
1354
- zi(h);
1355
- }
1356
- }
1357
- else s == null || s(t, f, _);
1358
- }, e == null) hn(a, r);
1359
- else if (a != null) {
1360
- const h = a[e];
1361
- h && r(a, e, h);
1362
- }
1363
- if (c) {
1364
- let h = 0 | t[d];
1365
- if (2 & h && 2048 & h && !(n != null && n.Ka)) throw Error();
1366
- const f = ke(h), _ = (v, j) => {
1367
- if (Pt(t, v, f) != null) {
1368
- if ((n == null ? void 0 : n.Qa) === 1) return;
1369
- throw Error();
1370
- }
1371
- j != null && (h = U(t, h, v, j, f)), delete a[v];
1372
- };
1373
- e == null ? ki(o, 0 | o[d], (v, j) => {
1374
- _(v, j);
1375
- }) : _(e, Pt(o, e, f));
1376
- }
1377
- }
1378
- }
1379
- }
1380
- function l2(t) {
1381
- const e = (t = ro(t))[0].g;
1382
- if (t = t[1]) {
1383
- const n = Ws(t), s = se(Fn, Hs, Ks, t).T;
1384
- return (r, i, o) => e(r, i, o, s, n);
1385
- }
1386
- return e;
1387
- }
1388
- function In(t, e, n) {
1389
- t[e] = n.h;
1390
- }
1391
- function Pn(t, e, n, s) {
1392
- let r, i;
1393
- const o = n.h;
1394
- t[e] = (a, c, u) => o(a, c, u, i || (i = se(Mn, In, Pn, s).T), r || (r = oo(s)));
1395
- }
1396
- function oo(t) {
1397
- let e = t[Pr];
1398
- if (!e) {
1399
- const n = se(Mn, In, Pn, t);
1400
- e = (s, r) => ao(s, r, n), t[Pr] = e;
1401
- }
1402
- return e;
1403
- }
1404
- function ao(t, e, n) {
1405
- ki(t, 0 | t[d], (s, r) => {
1406
- if (r != null) {
1407
- var i = function(o, a) {
1408
- var c = o[a];
1409
- if (c) return c;
1410
- if ((c = o.ba) && (c = c[a])) {
1411
- var u = (c = ro(c))[0].h;
1412
- if (c = c[1]) {
1413
- const h = oo(c), f = se(Mn, In, Pn, c).T;
1414
- c = o.ma ? so(f, h) : (_, v, j) => u(_, v, j, f, h);
1415
- } else c = u;
1416
- return o[a] = c;
1417
- }
1418
- }(n, s);
1419
- i ? i(e, r, s) : s < 500 || fe(Jn, 3);
1420
- }
1421
- }), (t = wn(t)) && hn(t, (s, r, i) => {
1422
- for (_e(e, e.g.end()), s = 0; s < i.length; s++) _e(e, ys(i[s]) || new Uint8Array(0));
1423
- });
1424
- }
1425
- const f2 = st(0);
1426
- function Oe(t, e) {
1427
- if (Array.isArray(e)) {
1428
- var n = 0 | e[d];
1429
- if (4 & n) return e;
1430
- for (var s = 0, r = 0; s < e.length; s++) {
1431
- const i = t(e[s]);
1432
- i != null && (e[r++] = i);
1433
- }
1434
- return r < s && (e.length = r), (t = -1537 & (5 | n)) !== n && G(e, t), 2 & t && Object.freeze(e), e;
1435
- }
1436
- }
1437
- function X(t, e, n) {
1438
- return new Pe(t, e, n);
1439
- }
1440
- function xe(t, e, n) {
1441
- return new Pe(t, e, n);
1442
- }
1443
- function q(t, e, n) {
1444
- U(t, 0 | t[d], e, n, ke(0 | t[d]));
1445
- }
1446
- var d2 = Tn(function(t, e, n, s, r) {
1447
- if (t.h !== 2) return !1;
1448
- if (t = mt(t = Qe(t, zt([void 0, void 0], s), r)), r = ke(s = 0 | e[d]), 2 & s) throw Error();
1449
- let i = Pt(e, n, r);
1450
- if (i instanceof It) 2 & i.J ? (i = i.V(), i.push(t), U(e, s, n, i, r)) : i.Ma(t);
1451
- else if (Array.isArray(i)) {
1452
- var o = 0 | i[d];
1453
- 8192 & o || G(i, o |= 8192), 2 & o && (i = Di(i), U(e, s, n, i, r)), i.push(t);
1454
- } else U(e, s, n, He([t]), r);
1455
- return !0;
1456
- }, function(t, e, n, s, r) {
1457
- if (e instanceof It) e.forEach((i, o) => {
1458
- dn(t, n, zt([o, i], s), r);
1459
- });
1460
- else if (Array.isArray(e)) {
1461
- for (let i = 0; i < e.length; i++) {
1462
- const o = e[i];
1463
- Array.isArray(o) && dn(t, n, zt(o, s), r);
1464
- }
1465
- He(e);
1466
- }
1467
- });
1468
- function co(t, e, n) {
1469
- (e = At(e)) != null && (pt(t, n, 5), t = t.g, vs(e), Bs(t));
1470
- }
1471
- function ho(t, e, n) {
1472
- if (e = function(s) {
1473
- if (s == null) return s;
1474
- const r = typeof s;
1475
- if (r === "bigint") return String(Xe(64, s));
1476
- if ($e(s)) {
1477
- if (r === "string") return Ii(s);
1478
- if (r === "number") return Es(s);
1479
- }
1480
- }(e), e != null && (typeof e == "string" && Ir(e), e != null))
1481
- switch (pt(t, n, 0), typeof e) {
1482
- case "number":
1483
- t = t.g, ge(e), ce(t, I, C);
1484
- break;
1485
- case "bigint":
1486
- n = BigInt.asUintN(64, e), n = new ns(Number(n & BigInt(4294967295)), Number(n >> BigInt(32))), ce(t.g, n.h, n.g);
1487
- break;
1488
- default:
1489
- n = Ir(e), ce(t.g, n.h, n.g);
1490
- }
1491
- }
1492
- function uo(t, e, n) {
1493
- (e = Se(e)) != null && e != null && (pt(t, n, 0), kn(t.g, e));
1494
- }
1495
- function lo(t, e, n) {
1496
- (e = Ti(e)) != null && (pt(t, n, 0), t.g.g.push(e ? 1 : 0));
1497
- }
1498
- function fo(t, e, n) {
1499
- (e = z(e)) != null && Sn(t, n, pi(e));
1500
- }
1501
- function po(t, e, n, s, r) {
1502
- dn(t, n, io(e, s), r);
1503
- }
1504
- function go(t, e, n) {
1505
- (e = e == null || typeof e == "string" || e instanceof Et ? e : void 0) != null && Sn(t, n, Ns(e, !0).buffer);
1506
- }
1507
- function mo(t, e, n) {
1508
- return (t.h === 5 || t.h === 2) && (e = Fe(e, 0 | e[d], n), t.h == 2 ? En(t, ln, e) : e.push(ln(t.g)), !0);
1509
- }
1510
- var B = X(function(t, e, n) {
1511
- return t.h === 5 && (q(e, n, ln(t.g)), !0);
1512
- }, co, Ln), p2 = xe(mo, function(t, e, n) {
1513
- if ((e = Oe(At, e)) != null) for (let o = 0; o < e.length; o++) {
1514
- var s = t, r = n, i = e[o];
1515
- i != null && (pt(s, r, 5), s = s.g, vs(i), Bs(s));
1516
- }
1517
- }, Ln), qs = xe(mo, function(t, e, n) {
1518
- if ((e = Oe(At, e)) != null && e.length) {
1519
- pt(t, n, 2), Ie(t.g, 4 * e.length);
1520
- for (let s = 0; s < e.length; s++) n = t.g, vs(e[s]), Bs(n);
1521
- }
1522
- }, Ln), g2 = X(function(t, e, n) {
1523
- return t.h === 5 && (q(e, n, (t = ln(t.g)) === 0 ? void 0 : t), !0);
1524
- }, co, Ln), Gt = X(function(t, e, n) {
1525
- return ps ? (t.h !== 0 ? t = !1 : (q(e, n, ye(t.g, Li)), t = !0), t) : t.h === 0 && (q(e, n, ye(t.g, ws)), !0);
1526
- }, ho, Qi), Kn = X(function(t, e, n) {
1527
- return ps ? (t.h !== 0 ? e = !1 : (q(e, n, (t = ye(t.g, Li)) === f2 ? void 0 : t), e = !0), e) : t.h === 0 && (q(e, n, (t = ye(t.g, ws)) === 0 ? void 0 : t), !0);
1528
- }, ho, Qi), m2 = X(function(t, e, n) {
1529
- return ps ? (t.h !== 0 ? t = !1 : (q(e, n, ye(t.g, Da)), t = !0), t) : t.h === 0 && (q(e, n, ye(t.g, Zn)), !0);
1530
- }, function(t, e, n) {
1531
- if (e = function(s) {
1532
- if (s == null) return s;
1533
- var r = typeof s;
1534
- if (r === "bigint") return String(Ua(64, s));
1535
- if ($e(s)) {
1536
- if (r === "string") return r = me(Number(s)), te(r) && r >= 0 ? s = String(r) : ((r = s.indexOf(".")) !== -1 && (s = s.substring(0, r)), (r = s[0] !== "-" && ((r = s.length) < 20 || r === 20 && s <= "18446744073709551615")) || (_n(s), s = Ke(I, C))), s;
1537
- if (r === "number") return (s = me(s)) >= 0 && te(s) || (ge(s), s = Zn(I, C)), s;
1538
- }
1539
- }(e), e != null && (typeof e == "string" && Fr(e), e != null))
1540
- switch (pt(t, n, 0), typeof e) {
1541
- case "number":
1542
- t = t.g, ge(e), ce(t, I, C);
1543
- break;
1544
- case "bigint":
1545
- n = BigInt.asUintN(64, e), n = new es(Number(n & BigInt(4294967295)), Number(n >> BigInt(32))), ce(t.g, n.h, n.g);
1546
- break;
1547
- default:
1548
- n = Fr(e), ce(t.g, n.h, n.g);
1549
- }
1550
- }, a2), W = X(function(t, e, n) {
1551
- return t.h === 0 && (q(e, n, Vt(t.g)), !0);
1552
- }, uo, js), Ze = xe(function(t, e, n) {
1553
- return (t.h === 0 || t.h === 2) && (e = Fe(e, 0 | e[d], n), t.h == 2 ? En(t, Vt, e) : e.push(Vt(t.g)), !0);
1554
- }, function(t, e, n) {
1555
- if ((e = Oe(Se, e)) != null && e.length) {
1556
- n = Ds(t, n);
1557
- for (let s = 0; s < e.length; s++) kn(t.g, e[s]);
1558
- Us(t, n);
1559
- }
1560
- }, js), ae = X(function(t, e, n) {
1561
- return t.h === 0 && (q(e, n, (t = Vt(t.g)) === 0 ? void 0 : t), !0);
1562
- }, uo, js), R = X(function(t, e, n) {
1563
- return t.h === 0 && (q(e, n, Rs(t.g)), !0);
1564
- }, lo, $i), Jt = X(function(t, e, n) {
1565
- return t.h === 0 && (q(e, n, (t = Rs(t.g)) === !1 ? void 0 : t), !0);
1566
- }, lo, $i), Y = xe(function(t, e, n) {
1567
- return t.h === 2 && (t = Cs(t), Fe(e, 0 | e[d], n).push(t), !0);
1568
- }, function(t, e, n) {
1569
- if ((e = Oe(z, e)) != null) for (let o = 0; o < e.length; o++) {
1570
- var s = t, r = n, i = e[o];
1571
- i != null && Sn(s, r, pi(i));
1572
- }
1573
- }, Gs), Dt = X(function(t, e, n) {
1574
- return t.h === 2 && (q(e, n, (t = Cs(t)) === "" ? void 0 : t), !0);
1575
- }, fo, Gs), S = X(function(t, e, n) {
1576
- return t.h === 2 && (q(e, n, Cs(t)), !0);
1577
- }, fo, Gs), K = function(t, e, n = Vs) {
1578
- return new Pe(t, e, n);
1579
- }(function(t, e, n, s, r) {
1580
- return t.h === 2 && (s = zt(void 0, s), Fe(e, 0 | e[d], n).push(s), Qe(t, s, r), !0);
1581
- }, function(t, e, n, s, r) {
1582
- if (Array.isArray(e)) {
1583
- for (let i = 0; i < e.length; i++) po(t, e[i], n, s, r);
1584
- 1 & (t = 0 | e[d]) || G(e, 1 | t);
1585
- }
1586
- }), x = Tn(function(t, e, n, s, r, i) {
1587
- if (t.h !== 2) return !1;
1588
- let o = 0 | e[d];
1589
- return Ui(e, o, i, n, ke(o)), Qe(t, e = Os(e, s, n), r), !0;
1590
- }, po), yo = X(function(t, e, n) {
1591
- return t.h === 2 && (q(e, n, Xi(t)), !0);
1592
- }, go, Zi), y2 = xe(function(t, e, n) {
1593
- return (t.h === 0 || t.h === 2) && (e = Fe(e, 0 | e[d], n), t.h == 2 ? En(t, Nt, e) : e.push(Nt(t.g)), !0);
1594
- }, function(t, e, n) {
1595
- if ((e = Oe(Mi, e)) != null) for (let o = 0; o < e.length; o++) {
1596
- var s = t, r = n, i = e[o];
1597
- i != null && (pt(s, r, 0), Ie(s.g, i));
1598
- }
1599
- }, Ji), _2 = X(function(t, e, n) {
1600
- return t.h === 0 && (q(e, n, (t = Nt(t.g)) === 0 ? void 0 : t), !0);
1601
- }, function(t, e, n) {
1602
- (e = Mi(e)) != null && e != null && (pt(t, n, 0), Ie(t.g, e));
1603
- }, Ji), ot = X(function(t, e, n) {
1604
- return t.h === 0 && (q(e, n, Vt(t.g)), !0);
1605
- }, function(t, e, n) {
1606
- (e = Se(e)) != null && (e = parseInt(e, 10), pt(t, n, 0), kn(t.g, e));
1607
- }, to);
1608
- class v2 {
1609
- constructor(e, n) {
1610
- var s = ct;
1611
- this.g = e, this.h = n, this.m = A, this.j = y, this.defaultValue = void 0, this.l = s.Oa != null ? Si : void 0;
1612
- }
1613
- register() {
1614
- gn(this);
1615
- }
1616
- }
1617
- function Tt(t, e) {
1618
- return new v2(t, e);
1619
- }
1620
- function jt(t, e) {
1621
- return (n, s) => {
1622
- {
1623
- const i = { ea: !0 };
1624
- s && Object.assign(i, s), n = qi(n, void 0, void 0, i);
1625
- try {
1626
- const o = new t(), a = o.v;
1627
- Ws(e)(a, n);
1628
- var r = o;
1629
- } finally {
1630
- zi(n);
1631
- }
1632
- }
1633
- return r;
1634
- };
1635
- }
1636
- function On(t) {
1637
- return function() {
1638
- const e = new class {
1639
- constructor() {
1640
- this.l = [], this.h = 0, this.g = new class {
1641
- constructor() {
1642
- this.g = [];
1643
- }
1644
- length() {
1645
- return this.g.length;
1646
- }
1647
- end() {
1648
- const o = this.g;
1649
- return this.g = [], o;
1650
- }
1651
- }();
1652
- }
1653
- }();
1654
- ao(this.v, e, se(Mn, In, Pn, t)), _e(e, e.g.end());
1655
- const n = new Uint8Array(e.h), s = e.l, r = s.length;
1656
- let i = 0;
1657
- for (let o = 0; o < r; o++) {
1658
- const a = s[o];
1659
- n.set(a, i), i += a.length;
1660
- }
1661
- return e.l = [n], n;
1662
- };
1663
- }
1664
- var xr = class extends p {
1665
- constructor(t) {
1666
- super(t);
1667
- }
1668
- }, Nr = [0, Dt, X(function(t, e, n) {
1669
- return t.h === 2 && (q(e, n, (t = Xi(t)) === Qt() ? void 0 : t), !0);
1670
- }, function(t, e, n) {
1671
- if (e != null) {
1672
- if (e instanceof p) {
1673
- const s = e.Ra;
1674
- return void (s ? (e = s(e), e != null && Sn(t, n, Ns(e, !0).buffer)) : fe(Jn, 3));
1675
- }
1676
- if (Array.isArray(e)) return void fe(Jn, 3);
1677
- }
1678
- go(t, e, n);
1679
- }, Zi)];
1680
- let Wn, Rr = globalThis.trustedTypes;
1681
- function Cr(t) {
1682
- var e;
1683
- return Wn === void 0 && (Wn = function() {
1684
- let n = null;
1685
- if (!Rr) return n;
1686
- try {
1687
- const s = (r) => r;
1688
- n = Rr.createPolicy("goog#html", { createHTML: s, createScript: s, createScriptURL: s });
1689
- } catch {
1690
- }
1691
- return n;
1692
- }()), t = (e = Wn) ? e.createScriptURL(t) : t, new class {
1693
- constructor(n) {
1694
- this.g = n;
1695
- }
1696
- toString() {
1697
- return this.g + "";
1698
- }
1699
- }(t);
1700
- }
1701
- function w2(t, ...e) {
1702
- if (e.length === 0) return Cr(t[0]);
1703
- let n = t[0];
1704
- for (let s = 0; s < e.length; s++) n += encodeURIComponent(e[s]) + t[s + 1];
1705
- return Cr(n);
1706
- }
1707
- var _o = [0, W, ot, R, -1, Ze, ot, -1, R], b2 = class extends p {
1708
- constructor(t) {
1709
- super(t);
1710
- }
1711
- }, vo = [0, R, S, R, ot, -1, xe(function(t, e, n) {
1712
- return (t.h === 0 || t.h === 2) && (e = Fe(e, 0 | e[d], n), t.h == 2 ? En(t, s2, e) : e.push(Vt(t.g)), !0);
1713
- }, function(t, e, n) {
1714
- if ((e = Oe(Se, e)) != null && e.length) {
1715
- n = Ds(t, n);
1716
- for (let s = 0; s < e.length; s++) kn(t.g, e[s]);
1717
- Us(t, n);
1718
- }
1719
- }, to), S, -1, [0, R, -1], ot, R, -1], wo = [0, 3, R, -1, 2, [0, W], [0, ot, R], [0, S, -1], [0]], bo = [0, S, -2], Br = class extends p {
1720
- constructor(t) {
1721
- super(t);
1722
- }
1723
- }, Ao = [0], Eo = [0, W, R, 1, R, -4], ct = class extends p {
1724
- constructor(t) {
1725
- super(t, 2);
1726
- }
1727
- }, V = {};
1728
- V[336783863] = [0, S, R, -1, W, [0, [1, 2, 3, 4, 5, 6, 7, 8, 9], x, Ao, x, vo, x, bo, x, Eo, x, _o, x, [0, S, -2], x, [0, S, ot], x, wo, x, [0, ot, -1, R]], [0, S], R, [0, [1, 3], [2, 4], x, [0, Ze], -1, x, [0, Y], -1, K, [0, S, -1]], S];
1729
- var Dr = [0, Kn, -1, Jt, -3, Kn, Ze, Dt, ae, Kn, -1, Jt, ae, Jt, -2, Dt];
1730
- function M(t, e) {
1731
- An(t, 3, e);
1732
- }
1733
- function w(t, e) {
1734
- An(t, 4, e);
1735
- }
1736
- var Q = class extends p {
1737
- constructor(t) {
1738
- super(t, 500);
1739
- }
1740
- o(t) {
1741
- return y(this, 0, 7, t);
1742
- }
1743
- }, Ve = [-1, {}], Ur = [0, S, 1, Ve], Vr = [0, S, Y, Ve];
1744
- function gt(t, e) {
1745
- xs(t, 1, Q, e);
1746
- }
1747
- function P(t, e) {
1748
- An(t, 10, e);
1749
- }
1750
- function E(t, e) {
1751
- An(t, 15, e);
1752
- }
1753
- var ht = class extends p {
1754
- constructor(t) {
1755
- super(t, 500);
1756
- }
1757
- o(t) {
1758
- return y(this, 0, 1001, t);
1759
- }
1760
- }, ko = [-500, K, [-500, Dt, -1, Y, -3, [-2, V, R], K, Nr, ae, -1, Ur, Vr, K, [0, Dt, Jt], Dt, Dr, ae, Y, 987, Y], 4, K, [-500, S, -1, [-1, {}], 998, S], K, [-500, S, Y, -1, [-2, {}, R], 997, Y, -1], ae, K, [-500, S, Y, Ve, 998, Y], Y, ae, Ur, Vr, K, [0, Dt, -1, Ve], Y, -2, Dr, Dt, -1, Jt, [0, Jt, _2], 978, Ve, K, Nr];
1761
- ht.prototype.g = On(ko);
1762
- var A2 = jt(ht, ko), E2 = class extends p {
1763
- constructor(t) {
1764
- super(t);
1765
- }
1766
- }, So = class extends p {
1767
- constructor(t) {
1768
- super(t);
1769
- }
1770
- g() {
1771
- return Ot(this, E2, 1);
1772
- }
1773
- }, Lo = [0, K, [0, W, B, S, -1]], xn = jt(So, Lo), k2 = class extends p {
1774
- constructor(t) {
1775
- super(t);
1776
- }
1777
- }, S2 = class extends p {
1778
- constructor(t) {
1779
- super(t);
1780
- }
1781
- }, qn = class extends p {
1782
- constructor(t) {
1783
- super(t);
1784
- }
1785
- l() {
1786
- return A(this, k2, 2);
1787
- }
1788
- g() {
1789
- return Ot(this, S2, 5);
1790
- }
1791
- }, To = jt(class extends p {
1792
- constructor(t) {
1793
- super(t);
1794
- }
1795
- }, [0, Y, Ze, qs, [0, ot, [0, W, -3], [0, B, -3], [0, W, -1, [0, K, [0, W, -2]]], K, [0, B, -1, S, B]], S, -1, Gt, K, [0, W, B], Y, Gt]), Mo = class extends p {
1796
- constructor(t) {
1797
- super(t);
1798
- }
1799
- }, he = jt(class extends p {
1800
- constructor(t) {
1801
- super(t);
1802
- }
1803
- }, [0, K, [0, B, -4]]), Fo = class extends p {
1804
- constructor(t) {
1805
- super(t);
1806
- }
1807
- }, tn = jt(class extends p {
1808
- constructor(t) {
1809
- super(t);
1810
- }
1811
- }, [0, K, [0, B, -4]]), L2 = class extends p {
1812
- constructor(t) {
1813
- super(t);
1814
- }
1815
- }, T2 = [0, W, -1, qs, ot], Io = class extends p {
1816
- constructor(t) {
1817
- super(t);
1818
- }
1819
- };
1820
- Io.prototype.g = On([0, B, -4, Gt]);
1821
- var M2 = class extends p {
1822
- constructor(t) {
1823
- super(t);
1824
- }
1825
- }, F2 = jt(class extends p {
1826
- constructor(t) {
1827
- super(t);
1828
- }
1829
- }, [0, K, [0, 1, W, S, Lo], Gt]), Gr = class extends p {
1830
- constructor(t) {
1831
- super(t);
1832
- }
1833
- }, I2 = class extends p {
1834
- constructor(t) {
1835
- super(t);
1836
- }
1837
- na() {
1838
- const t = T(this, 1, void 0, void 0, Bi);
1839
- return t ?? Qt();
1840
- }
1841
- }, P2 = class extends p {
1842
- constructor(t) {
1843
- super(t);
1844
- }
1845
- }, Po = [1, 2], O2 = jt(class extends p {
1846
- constructor(t) {
1847
- super(t);
1848
- }
1849
- }, [0, K, [0, Po, x, [0, qs], x, [0, yo], W, S], Gt]), zs = class extends p {
1850
- constructor(t) {
1851
- super(t);
1852
- }
1853
- }, Oo = [0, S, W, B, Y, -1], jr = class extends p {
1854
- constructor(t) {
1855
- super(t);
1856
- }
1857
- }, x2 = [0, R, -1], Hr = class extends p {
1858
- constructor(t) {
1859
- super(t);
1860
- }
1861
- }, an = [1, 2, 3, 4, 5, 6], pn = class extends p {
1862
- constructor(t) {
1863
- super(t);
1864
- }
1865
- g() {
1866
- return T(this, 1, void 0, void 0, Bi) != null;
1867
- }
1868
- l() {
1869
- return z(T(this, 2)) != null;
1870
- }
1871
- }, O = class extends p {
1872
- constructor(t) {
1873
- super(t);
1874
- }
1875
- g() {
1876
- return Ti(T(this, 2)) ?? !1;
1877
- }
1878
- }, xo = [0, yo, S, [0, W, Gt, -1], [0, m2, Gt]], D = [0, xo, R, [0, an, x, Eo, x, vo, x, _o, x, Ao, x, bo, x, wo], ot], Nn = class extends p {
1879
- constructor(t) {
1880
- super(t);
1881
- }
1882
- }, Ys = [0, D, B, -1, W], N2 = Tt(502141897, Nn);
1883
- V[502141897] = Ys;
1884
- var R2 = jt(class extends p {
1885
- constructor(t) {
1886
- super(t);
1887
- }
1888
- }, [0, [0, ot, -1, p2, y2], T2]), No = class extends p {
1889
- constructor(t) {
1890
- super(t);
1891
- }
1892
- }, Ro = class extends p {
1893
- constructor(t) {
1894
- super(t);
1895
- }
1896
- }, rs = [0, D, B, [0, D], R], C2 = Tt(508968150, Ro);
1897
- V[508968150] = [0, D, Ys, rs, B, [0, [0, xo]]], V[508968149] = rs;
1898
- var oe = class extends p {
1899
- constructor(t) {
1900
- super(t);
1901
- }
1902
- l() {
1903
- return A(this, zs, 2);
1904
- }
1905
- g() {
1906
- k(this, 2);
1907
- }
1908
- }, Co = [0, D, Oo];
1909
- V[478825465] = Co;
1910
- var B2 = class extends p {
1911
- constructor(t) {
1912
- super(t);
1913
- }
1914
- }, Bo = class extends p {
1915
- constructor(t) {
1916
- super(t);
1917
- }
1918
- }, Xs = class extends p {
1919
- constructor(t) {
1920
- super(t);
1921
- }
1922
- }, $s = class extends p {
1923
- constructor(t) {
1924
- super(t);
1925
- }
1926
- }, Do = class extends p {
1927
- constructor(t) {
1928
- super(t);
1929
- }
1930
- }, Kr = [0, D, [0, D], Co, -1], Uo = [0, D, B, W], Js = [0, D, B], Vo = [0, D, Uo, Js, B], D2 = Tt(479097054, Do);
1931
- V[479097054] = [0, D, Vo, Kr], V[463370452] = Kr, V[464864288] = Uo;
1932
- var U2 = Tt(462713202, $s);
1933
- V[462713202] = Vo, V[474472470] = Js;
1934
- var V2 = class extends p {
1935
- constructor(t) {
1936
- super(t);
1937
- }
1938
- }, Go = class extends p {
1939
- constructor(t) {
1940
- super(t);
1941
- }
1942
- }, jo = class extends p {
1943
- constructor(t) {
1944
- super(t);
1945
- }
1946
- }, Ho = class extends p {
1947
- constructor(t) {
1948
- super(t);
1949
- }
1950
- }, Qs = [0, D, B, -1, W], is = [0, D, B, R];
1951
- Ho.prototype.g = On([0, D, Js, [0, D], Ys, rs, Qs, is]);
1952
- var Ko = class extends p {
1953
- constructor(t) {
1954
- super(t);
1955
- }
1956
- }, G2 = Tt(456383383, Ko);
1957
- V[456383383] = [0, D, Oo];
1958
- var Wo = class extends p {
1959
- constructor(t) {
1960
- super(t);
1961
- }
1962
- }, j2 = Tt(476348187, Wo);
1963
- V[476348187] = [0, D, x2];
1964
- var qo = class extends p {
1965
- constructor(t) {
1966
- super(t);
1967
- }
1968
- }, Wr = class extends p {
1969
- constructor(t) {
1970
- super(t);
1971
- }
1972
- }, zo = [0, ot, -1], H2 = Tt(458105876, class extends p {
1973
- constructor(t) {
1974
- super(t);
1975
- }
1976
- g() {
1977
- let t;
1978
- var e = this.v;
1979
- const n = 0 | e[d];
1980
- return t = rt(this, n), e = function(s, r, i, o) {
1981
- var a = Wr;
1982
- !o && Te(s) && (i = 0 | (r = s.v)[d]);
1983
- var c = Pt(r, 2);
1984
- if (s = !1, c == null) {
1985
- if (o) return Sr();
1986
- c = [];
1987
- } else if (c.constructor === It) {
1988
- if (!(2 & c.J) || o) return c;
1989
- c = c.V();
1990
- } else Array.isArray(c) ? s = !!(2 & (0 | c[d])) : c = [];
1991
- if (o) {
1992
- if (!c.length) return Sr();
1993
- s || (s = !0, Ye(c));
1994
- } else s && (s = !1, He(c), c = Di(c));
1995
- return !s && 32 & i && ze(c, 32), i = U(r, i, 2, o = new It(c, a, Ha, void 0)), s || ne(r, i), o;
1996
- }(this, e, n, t), !t && Wr && (e.ra = !0), e;
1997
- }
1998
- });
1999
- V[458105876] = [0, zo, d2, [!0, Gt, [0, S, -1, Y]], [0, Ze, R, ot]];
2000
- var Zs = class extends p {
2001
- constructor(t) {
2002
- super(t);
2003
- }
2004
- }, Yo = Tt(458105758, Zs);
2005
- V[458105758] = [0, D, S, zo];
2006
- var zn = class extends p {
2007
- constructor(t) {
2008
- super(t);
2009
- }
2010
- }, qr = [0, g2, -1, Jt], K2 = class extends p {
2011
- constructor(t) {
2012
- super(t);
2013
- }
2014
- }, Xo = class extends p {
2015
- constructor(t) {
2016
- super(t);
2017
- }
2018
- }, os = [1, 2];
2019
- Xo.prototype.g = On([0, os, x, qr, x, [0, K, qr]]);
2020
- var $o = class extends p {
2021
- constructor(t) {
2022
- super(t);
2023
- }
2024
- }, W2 = Tt(443442058, $o);
2025
- V[443442058] = [0, D, S, W, B, Y, -1, R, B], V[514774813] = Qs;
2026
- var Jo = class extends p {
2027
- constructor(t) {
2028
- super(t);
2029
- }
2030
- }, q2 = Tt(516587230, Jo);
2031
- function as(t, e) {
2032
- return e = e ? e.clone() : new zs(), t.displayNamesLocale !== void 0 ? k(e, 1, Je(t.displayNamesLocale)) : t.displayNamesLocale === void 0 && k(e, 1), t.maxResults !== void 0 ? xt(e, 2, t.maxResults) : "maxResults" in t && k(e, 2), t.scoreThreshold !== void 0 ? m(e, 3, t.scoreThreshold) : "scoreThreshold" in t && k(e, 3), t.categoryAllowlist !== void 0 ? un(e, 4, t.categoryAllowlist) : "categoryAllowlist" in t && k(e, 4), t.categoryDenylist !== void 0 ? un(e, 5, t.categoryDenylist) : "categoryDenylist" in t && k(e, 5), e;
2033
- }
2034
- function Qo(t) {
2035
- const e = Number(t);
2036
- return Number.isSafeInteger(e) ? e : String(t);
2037
- }
2038
- function tr(t, e = -1, n = "") {
2039
- return { categories: t.map((s) => ({ index: dt(s, 1) ?? 0 ?? -1, score: N(s, 2) ?? 0, categoryName: z(T(s, 3)) ?? "" ?? "", displayName: z(T(s, 4)) ?? "" ?? "" })), headIndex: e, headName: n };
2040
- }
2041
- function z2(t) {
2042
- const e = { classifications: Ot(t, M2, 1).map((n) => {
2043
- var s;
2044
- return tr(((s = A(n, So, 4)) == null ? void 0 : s.g()) ?? [], dt(n, 2) ?? 0, z(T(n, 3)) ?? "");
2045
- }) };
2046
- return function(n) {
2047
- return ja(gs ? T(n, 2, void 0, void 0, cn) : T(n, 2));
2048
- }(t) != null && (e.timestampMs = Qo(Hi(t))), e;
2049
- }
2050
- function Zo(t) {
2051
- var o, a;
2052
- var e = qt(t, 3, At, Wt()), n = qt(t, 2, Se, Wt()), s = qt(t, 1, z, Wt()), r = qt(t, 9, z, Wt());
2053
- const i = { categories: [], keypoints: [] };
2054
- for (let c = 0; c < e.length; c++) i.categories.push({ score: e[c], index: n[c] ?? -1, categoryName: s[c] ?? "", displayName: r[c] ?? "" });
2055
- if ((e = (o = A(t, qn, 4)) == null ? void 0 : o.l()) && (i.boundingBox = { originX: dt(e, 1, Rt) ?? 0, originY: dt(e, 2, Rt) ?? 0, width: dt(e, 3, Rt) ?? 0, height: dt(e, 4, Rt) ?? 0, angle: 0 }), (a = A(t, qn, 4)) == null ? void 0 : a.g().length) for (const c of A(t, qn, 4).g()) i.keypoints.push({ x: T(c, 1, void 0, Rt, At) ?? 0, y: T(c, 2, void 0, Rt, At) ?? 0, score: T(c, 4, void 0, Rt, At) ?? 0, label: z(T(c, 3, void 0, Rt)) ?? "" });
2056
- return i;
2057
- }
2058
- function Rn(t) {
2059
- const e = [];
2060
- for (const n of Ot(t, Fo, 1)) e.push({ x: N(n, 1) ?? 0, y: N(n, 2) ?? 0, z: N(n, 3) ?? 0, visibility: N(n, 4) ?? 0 });
2061
- return e;
2062
- }
2063
- function Ge(t) {
2064
- const e = [];
2065
- for (const n of Ot(t, Mo, 1)) e.push({ x: N(n, 1) ?? 0, y: N(n, 2) ?? 0, z: N(n, 3) ?? 0, visibility: N(n, 4) ?? 0 });
2066
- return e;
2067
- }
2068
- function zr(t) {
2069
- return Array.from(t, (e) => e > 127 ? e - 256 : e);
2070
- }
2071
- function Yr(t, e) {
2072
- if (t.length !== e.length) throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);
2073
- let n = 0, s = 0, r = 0;
2074
- for (let i = 0; i < t.length; i++) n += t[i] * e[i], s += t[i] * t[i], r += e[i] * e[i];
2075
- if (s <= 0 || r <= 0) throw Error("Cannot compute cosine similarity on embedding with 0 norm.");
2076
- return n / Math.sqrt(s * r);
2077
- }
2078
- let nn;
2079
- V[516587230] = [0, D, Qs, is, B], V[518928384] = is;
2080
- const Y2 = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11]);
2081
- async function ta() {
2082
- if (nn === void 0) try {
2083
- await WebAssembly.instantiate(Y2), nn = !0;
2084
- } catch {
2085
- nn = !1;
2086
- }
2087
- return nn;
2088
- }
2089
- async function Ce(t, e = w2``) {
2090
- const n = await ta() ? "wasm_internal" : "wasm_nosimd_internal";
2091
- return { wasmLoaderPath: `${e}/${t}_${n}.js`, wasmBinaryPath: `${e}/${t}_${n}.wasm` };
2092
- }
2093
- var Kt = class {
2094
- };
2095
- function ea() {
2096
- var t = navigator;
2097
- return typeof OffscreenCanvas < "u" && (!function(e = navigator) {
2098
- return (e = e.userAgent).includes("Safari") && !e.includes("Chrome");
2099
- }(t) || !!((t = t.userAgent.match(/Version\/([\d]+).*Safari/)) && t.length >= 1 && Number(t[1]) >= 17));
2100
- }
2101
- async function Xr(t) {
2102
- if (typeof importScripts != "function") {
2103
- const e = document.createElement("script");
2104
- return e.src = t.toString(), e.crossOrigin = "anonymous", new Promise((n, s) => {
2105
- e.addEventListener("load", () => {
2106
- n();
2107
- }, !1), e.addEventListener("error", (r) => {
2108
- s(r);
2109
- }, !1), document.body.appendChild(e);
2110
- });
2111
- }
2112
- try {
2113
- importScripts(t.toString());
2114
- } catch (e) {
2115
- if (!(e instanceof TypeError)) throw e;
2116
- await self.import(t.toString());
2117
- }
2118
- }
2119
- function na(t) {
2120
- return t.videoWidth !== void 0 ? [t.videoWidth, t.videoHeight] : t.naturalWidth !== void 0 ? [t.naturalWidth, t.naturalHeight] : t.displayWidth !== void 0 ? [t.displayWidth, t.displayHeight] : [t.width, t.height];
2121
- }
2122
- function g(t, e, n) {
2123
- t.m || console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"), n(e = t.i.stringToNewUTF8(e)), t.i._free(e);
2124
- }
2125
- function $r(t, e, n) {
2126
- if (!t.i.canvas) throw Error("No OpenGL canvas configured.");
2127
- if (n ? t.i._bindTextureToStream(n) : t.i._bindTextureToCanvas(), !(n = t.i.canvas.getContext("webgl2") || t.i.canvas.getContext("webgl"))) throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");
2128
- t.i.gpuOriginForWebTexturesIsBottomLeft && n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, !0), n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, n.RGBA, n.UNSIGNED_BYTE, e), t.i.gpuOriginForWebTexturesIsBottomLeft && n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, !1);
2129
- const [s, r] = na(e);
2130
- return !t.l || s === t.i.canvas.width && r === t.i.canvas.height || (t.i.canvas.width = s, t.i.canvas.height = r), [s, r];
2131
- }
2132
- function Jr(t, e, n) {
2133
- t.m || console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");
2134
- const s = new Uint32Array(e.length);
2135
- for (let r = 0; r < e.length; r++) s[r] = t.i.stringToNewUTF8(e[r]);
2136
- e = t.i._malloc(4 * s.length), t.i.HEAPU32.set(s, e >> 2), n(e);
2137
- for (const r of s) t.i._free(r);
2138
- t.i._free(e);
2139
- }
2140
- function wt(t, e, n) {
2141
- t.i.simpleListeners = t.i.simpleListeners || {}, t.i.simpleListeners[e] = n;
2142
- }
2143
- function Ct(t, e, n) {
2144
- let s = [];
2145
- t.i.simpleListeners = t.i.simpleListeners || {}, t.i.simpleListeners[e] = (r, i, o) => {
2146
- i ? (n(s, o), s = []) : s.push(r);
2147
- };
2148
- }
2149
- Kt.forVisionTasks = function(t) {
2150
- return Ce("vision", t);
2151
- }, Kt.forTextTasks = function(t) {
2152
- return Ce("text", t);
2153
- }, Kt.forGenAiExperimentalTasks = function(t) {
2154
- return Ce("genai_experimental", t);
2155
- }, Kt.forGenAiTasks = function(t) {
2156
- return Ce("genai", t);
2157
- }, Kt.forAudioTasks = function(t) {
2158
- return Ce("audio", t);
2159
- }, Kt.isSimdSupported = function() {
2160
- return ta();
2161
- };
2162
- async function X2(t, e, n, s) {
2163
- return t = await (async (r, i, o, a, c) => {
2164
- if (i && await Xr(i), !self.ModuleFactory || o && (await Xr(o), !self.ModuleFactory)) throw Error("ModuleFactory not set.");
2165
- return self.Module && c && ((i = self.Module).locateFile = c.locateFile, c.mainScriptUrlOrBlob && (i.mainScriptUrlOrBlob = c.mainScriptUrlOrBlob)), c = await self.ModuleFactory(self.Module || c), self.ModuleFactory = self.Module = void 0, new r(c, a);
2166
- })(t, n.wasmLoaderPath, n.assetLoaderPath, e, { locateFile: (r) => r.endsWith(".wasm") ? n.wasmBinaryPath.toString() : n.assetBinaryPath && r.endsWith(".data") ? n.assetBinaryPath.toString() : r }), await t.o(s), t;
2167
- }
2168
- function Yn(t, e) {
2169
- const n = A(t.baseOptions, pn, 1) || new pn();
2170
- typeof e == "string" ? (k(n, 2, Je(e)), k(n, 1)) : e instanceof Uint8Array && (k(n, 1, _s(e, !1)), k(n, 2)), y(t.baseOptions, 0, 1, n);
2171
- }
2172
- function Qr(t) {
2173
- try {
2174
- const e = t.H.length;
2175
- if (e === 1) throw Error(t.H[0].message);
2176
- if (e > 1) throw Error("Encountered multiple errors: " + t.H.map((n) => n.message).join(", "));
2177
- } finally {
2178
- t.H = [];
2179
- }
2180
- }
2181
- function l(t, e) {
2182
- t.C = Math.max(t.C, e);
2183
- }
2184
- function Cn(t, e) {
2185
- t.B = new Q(), it(t.B, 2, "PassThroughCalculator"), M(t.B, "free_memory"), w(t.B, "free_memory_unused_out"), P(e, "free_memory"), gt(e, t.B);
2186
- }
2187
- function ve(t, e) {
2188
- M(t.B, e), w(t.B, e + "_unused_out");
2189
- }
2190
- function Bn(t) {
2191
- t.g.addBoolToStream(!0, "free_memory", t.C);
2192
- }
2193
- var cs = class {
2194
- constructor(t) {
2195
- this.g = t, this.H = [], this.C = 0, this.g.setAutoRenderToScreen(!1);
2196
- }
2197
- l(t, e = !0) {
2198
- var n, s, r, i, o, a;
2199
- if (e) {
2200
- const c = t.baseOptions || {};
2201
- if ((n = t.baseOptions) != null && n.modelAssetBuffer && ((s = t.baseOptions) != null && s.modelAssetPath)) throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");
2202
- if (!((r = A(this.baseOptions, pn, 1)) != null && r.g() || (i = A(this.baseOptions, pn, 1)) != null && i.l() || (o = t.baseOptions) != null && o.modelAssetBuffer || (a = t.baseOptions) != null && a.modelAssetPath)) throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");
2203
- if (function(u, h) {
2204
- let f = A(u.baseOptions, Hr, 3);
2205
- if (!f) {
2206
- var _ = f = new Hr(), v = new Br();
2207
- Ue(_, 4, an, v);
2208
- }
2209
- "delegate" in h && (h.delegate === "GPU" ? (h = f, _ = new b2(), Ue(h, 2, an, _)) : (h = f, _ = new Br(), Ue(h, 4, an, _))), y(u.baseOptions, 0, 3, f);
2210
- }(this, c), c.modelAssetPath) return fetch(c.modelAssetPath.toString()).then((u) => {
2211
- if (u.ok) return u.arrayBuffer();
2212
- throw Error(`Failed to fetch model: ${c.modelAssetPath} (${u.status})`);
2213
- }).then((u) => {
2214
- try {
2215
- this.g.i.FS_unlink("/model.dat");
2216
- } catch {
2217
- }
2218
- this.g.i.FS_createDataFile("/", "model.dat", new Uint8Array(u), !0, !1, !1), Yn(this, "/model.dat"), this.m(), this.L();
2219
- });
2220
- if (c.modelAssetBuffer instanceof Uint8Array) Yn(this, c.modelAssetBuffer);
2221
- else if (c.modelAssetBuffer) return async function(u) {
2222
- const h = [];
2223
- for (var f = 0; ; ) {
2224
- const { done: _, value: v } = await u.read();
2225
- if (_) break;
2226
- h.push(v), f += v.length;
2227
- }
2228
- if (h.length === 0) return new Uint8Array(0);
2229
- if (h.length === 1) return h[0];
2230
- u = new Uint8Array(f), f = 0;
2231
- for (const _ of h) u.set(_, f), f += _.length;
2232
- return u;
2233
- }(c.modelAssetBuffer).then((u) => {
2234
- Yn(this, u), this.m(), this.L();
2235
- });
2236
- }
2237
- return this.m(), this.L(), Promise.resolve();
2238
- }
2239
- L() {
2240
- }
2241
- ca() {
2242
- let t;
2243
- if (this.g.ca((e) => {
2244
- t = A2(e);
2245
- }), !t) throw Error("Failed to retrieve CalculatorGraphConfig");
2246
- return t;
2247
- }
2248
- setGraph(t, e) {
2249
- this.g.attachErrorListener((n, s) => {
2250
- this.H.push(Error(s));
2251
- }), this.g.Ja(), this.g.setGraph(t, e), this.B = void 0, Qr(this);
2252
- }
2253
- finishProcessing() {
2254
- this.g.finishProcessing(), Qr(this);
2255
- }
2256
- close() {
2257
- this.B = void 0, this.g.closeGraph();
2258
- }
2259
- };
2260
- function Ut(t, e) {
2261
- if (!t) throw Error(`Unable to obtain required WebGL resource: ${e}`);
2262
- return t;
2263
- }
2264
- cs.prototype.close = cs.prototype.close;
2265
- class $2 {
2266
- constructor(e, n, s, r) {
2267
- this.g = e, this.h = n, this.m = s, this.l = r;
2268
- }
2269
- bind() {
2270
- this.g.bindVertexArray(this.h);
2271
- }
2272
- close() {
2273
- this.g.deleteVertexArray(this.h), this.g.deleteBuffer(this.m), this.g.deleteBuffer(this.l);
2274
- }
2275
- }
2276
- function Zr(t, e, n) {
2277
- const s = t.g;
2278
- if (n = Ut(s.createShader(n), "Failed to create WebGL shader"), s.shaderSource(n, e), s.compileShader(n), !s.getShaderParameter(n, s.COMPILE_STATUS)) throw Error(`Could not compile WebGL shader: ${s.getShaderInfoLog(n)}`);
2279
- return s.attachShader(t.h, n), n;
2280
- }
2281
- function ti(t, e) {
2282
- const n = t.g, s = Ut(n.createVertexArray(), "Failed to create vertex array");
2283
- n.bindVertexArray(s);
2284
- const r = Ut(n.createBuffer(), "Failed to create buffer");
2285
- n.bindBuffer(n.ARRAY_BUFFER, r), n.enableVertexAttribArray(t.O), n.vertexAttribPointer(t.O, 2, n.FLOAT, !1, 0, 0), n.bufferData(n.ARRAY_BUFFER, new Float32Array([-1, -1, -1, 1, 1, 1, 1, -1]), n.STATIC_DRAW);
2286
- const i = Ut(n.createBuffer(), "Failed to create buffer");
2287
- return n.bindBuffer(n.ARRAY_BUFFER, i), n.enableVertexAttribArray(t.L), n.vertexAttribPointer(t.L, 2, n.FLOAT, !1, 0, 0), n.bufferData(n.ARRAY_BUFFER, new Float32Array(e ? [0, 1, 0, 0, 1, 0, 1, 1] : [0, 0, 0, 1, 1, 1, 1, 0]), n.STATIC_DRAW), n.bindBuffer(n.ARRAY_BUFFER, null), n.bindVertexArray(null), new $2(n, s, r, i);
2288
- }
2289
- function er(t, e) {
2290
- if (t.g) {
2291
- if (e !== t.g) throw Error("Cannot change GL context once initialized");
2292
- } else t.g = e;
2293
- }
2294
- function J2(t, e, n, s) {
2295
- return er(t, e), t.h || (t.m(), t.D()), n ? (t.u || (t.u = ti(t, !0)), n = t.u) : (t.A || (t.A = ti(t, !1)), n = t.A), e.useProgram(t.h), n.bind(), t.l(), t = s(), n.g.bindVertexArray(null), t;
2296
- }
2297
- function sa(t, e, n) {
2298
- return er(t, e), t = Ut(e.createTexture(), "Failed to create texture"), e.bindTexture(e.TEXTURE_2D, t), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, n ?? e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, n ?? e.LINEAR), e.bindTexture(e.TEXTURE_2D, null), t;
2299
- }
2300
- function ra(t, e, n) {
2301
- er(t, e), t.B || (t.B = Ut(e.createFramebuffer(), "Failed to create framebuffe.")), e.bindFramebuffer(e.FRAMEBUFFER, t.B), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, n, 0);
2302
- }
2303
- function Q2(t) {
2304
- var e;
2305
- (e = t.g) == null || e.bindFramebuffer(t.g.FRAMEBUFFER, null);
2306
- }
2307
- var ia = class {
2308
- H() {
2309
- return `
2310
- precision mediump float;
2311
- varying vec2 vTex;
2312
- uniform sampler2D inputTexture;
2313
- void main() {
2314
- gl_FragColor = texture2D(inputTexture, vTex);
2315
- }
2316
- `;
2317
- }
2318
- m() {
2319
- const t = this.g;
2320
- if (this.h = Ut(t.createProgram(), "Failed to create WebGL program"), this.X = Zr(this, `
2321
- attribute vec2 aVertex;
2322
- attribute vec2 aTex;
2323
- varying vec2 vTex;
2324
- void main(void) {
2325
- gl_Position = vec4(aVertex, 0.0, 1.0);
2326
- vTex = aTex;
2327
- }`, t.VERTEX_SHADER), this.W = Zr(this, this.H(), t.FRAGMENT_SHADER), t.linkProgram(this.h), !t.getProgramParameter(this.h, t.LINK_STATUS)) throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);
2328
- this.O = t.getAttribLocation(this.h, "aVertex"), this.L = t.getAttribLocation(this.h, "aTex");
2329
- }
2330
- D() {
2331
- }
2332
- l() {
2333
- }
2334
- close() {
2335
- if (this.h) {
2336
- const t = this.g;
2337
- t.deleteProgram(this.h), t.deleteShader(this.X), t.deleteShader(this.W);
2338
- }
2339
- this.B && this.g.deleteFramebuffer(this.B), this.A && this.A.close(), this.u && this.u.close();
2340
- }
2341
- };
2342
- function Ft(t, e) {
2343
- switch (e) {
2344
- case 0:
2345
- return t.g.find((n) => n instanceof Uint8Array);
2346
- case 1:
2347
- return t.g.find((n) => n instanceof Float32Array);
2348
- case 2:
2349
- return t.g.find((n) => typeof WebGLTexture < "u" && n instanceof WebGLTexture);
2350
- default:
2351
- throw Error(`Type is not supported: ${e}`);
2352
- }
2353
- }
2354
- function hs(t) {
2355
- var e = Ft(t, 1);
2356
- if (!e) {
2357
- if (e = Ft(t, 0)) e = new Float32Array(e).map((s) => s / 255);
2358
- else {
2359
- e = new Float32Array(t.width * t.height);
2360
- const s = we(t);
2361
- var n = nr(t);
2362
- if (ra(n, s, oa(t)), "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform) || navigator.userAgent.includes("Mac") && "document" in self && "ontouchend" in self.document) {
2363
- n = new Float32Array(t.width * t.height * 4), s.readPixels(0, 0, t.width, t.height, s.RGBA, s.FLOAT, n);
2364
- for (let r = 0, i = 0; r < e.length; ++r, i += 4) e[r] = n[i];
2365
- } else s.readPixels(0, 0, t.width, t.height, s.RED, s.FLOAT, e);
2366
- }
2367
- t.g.push(e);
2368
- }
2369
- return e;
2370
- }
2371
- function oa(t) {
2372
- let e = Ft(t, 2);
2373
- if (!e) {
2374
- const n = we(t);
2375
- e = ca(t);
2376
- const s = hs(t), r = aa(t);
2377
- n.texImage2D(n.TEXTURE_2D, 0, r, t.width, t.height, 0, n.RED, n.FLOAT, s), us(t);
2378
- }
2379
- return e;
2380
- }
2381
- function we(t) {
2382
- if (!t.canvas) throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");
2383
- return t.h || (t.h = Ut(t.canvas.getContext("webgl2"), "You cannot use a canvas that is already bound to a different type of rendering context.")), t.h;
2384
- }
2385
- function aa(t) {
2386
- if (t = we(t), !sn) if (t.getExtension("EXT_color_buffer_float") && t.getExtension("OES_texture_float_linear") && t.getExtension("EXT_float_blend")) sn = t.R32F;
2387
- else {
2388
- if (!t.getExtension("EXT_color_buffer_half_float")) throw Error("GPU does not fully support 4-channel float32 or float16 formats");
2389
- sn = t.R16F;
2390
- }
2391
- return sn;
2392
- }
2393
- function nr(t) {
2394
- return t.l || (t.l = new ia()), t.l;
2395
- }
2396
- function ca(t) {
2397
- const e = we(t);
2398
- e.viewport(0, 0, t.width, t.height), e.activeTexture(e.TEXTURE0);
2399
- let n = Ft(t, 2);
2400
- return n || (n = sa(nr(t), e, t.m ? e.LINEAR : e.NEAREST), t.g.push(n), t.j = !0), e.bindTexture(e.TEXTURE_2D, n), n;
2401
- }
2402
- function us(t) {
2403
- t.h.bindTexture(t.h.TEXTURE_2D, null);
2404
- }
2405
- var sn, H = class {
2406
- constructor(t, e, n, s, r, i, o) {
2407
- this.g = t, this.m = e, this.j = n, this.canvas = s, this.l = r, this.width = i, this.height = o, this.j && --ei === 0 && console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.");
2408
- }
2409
- Fa() {
2410
- return !!Ft(this, 0);
2411
- }
2412
- ka() {
2413
- return !!Ft(this, 1);
2414
- }
2415
- R() {
2416
- return !!Ft(this, 2);
2417
- }
2418
- ja() {
2419
- return (e = Ft(t = this, 0)) || (e = hs(t), e = new Uint8Array(e.map((n) => Math.round(255 * n))), t.g.push(e)), e;
2420
- var t, e;
2421
- }
2422
- ia() {
2423
- return hs(this);
2424
- }
2425
- N() {
2426
- return oa(this);
2427
- }
2428
- clone() {
2429
- const t = [];
2430
- for (const e of this.g) {
2431
- let n;
2432
- if (e instanceof Uint8Array) n = new Uint8Array(e);
2433
- else if (e instanceof Float32Array) n = new Float32Array(e);
2434
- else {
2435
- if (!(e instanceof WebGLTexture)) throw Error(`Type is not supported: ${e}`);
2436
- {
2437
- const s = we(this), r = nr(this);
2438
- s.activeTexture(s.TEXTURE1), n = sa(r, s, this.m ? s.LINEAR : s.NEAREST), s.bindTexture(s.TEXTURE_2D, n);
2439
- const i = aa(this);
2440
- s.texImage2D(s.TEXTURE_2D, 0, i, this.width, this.height, 0, s.RED, s.FLOAT, null), s.bindTexture(s.TEXTURE_2D, null), ra(r, s, n), J2(r, s, !1, () => {
2441
- ca(this), s.clearColor(0, 0, 0, 0), s.clear(s.COLOR_BUFFER_BIT), s.drawArrays(s.TRIANGLE_FAN, 0, 4), us(this);
2442
- }), Q2(r), us(this);
2443
- }
2444
- }
2445
- t.push(n);
2446
- }
2447
- return new H(t, this.m, this.R(), this.canvas, this.l, this.width, this.height);
2448
- }
2449
- close() {
2450
- this.j && we(this).deleteTexture(Ft(this, 2)), ei = -1;
2451
- }
2452
- };
2453
- H.prototype.close = H.prototype.close, H.prototype.clone = H.prototype.clone, H.prototype.getAsWebGLTexture = H.prototype.N, H.prototype.getAsFloat32Array = H.prototype.ia, H.prototype.getAsUint8Array = H.prototype.ja, H.prototype.hasWebGLTexture = H.prototype.R, H.prototype.hasFloat32Array = H.prototype.ka, H.prototype.hasUint8Array = H.prototype.Fa;
2454
- var ei = 250;
2455
- function yt(...t) {
2456
- return t.map(([e, n]) => ({ start: e, end: n }));
2457
- }
2458
- const Z2 = /* @__PURE__ */ function(t) {
2459
- return class extends t {
2460
- Ja() {
2461
- this.i._registerModelResourcesGraphService();
2462
- }
2463
- };
2464
- }((ni = class {
2465
- constructor(t, e) {
2466
- this.l = !0, this.i = t, this.g = null, this.h = 0, this.m = typeof this.i._addIntToInputStream == "function", e !== void 0 ? this.i.canvas = e : ea() ? this.i.canvas = new OffscreenCanvas(1, 1) : (console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."), this.i.canvas = document.createElement("canvas"));
2467
- }
2468
- async initializeGraph(t) {
2469
- const e = await (await fetch(t)).arrayBuffer();
2470
- t = !(t.endsWith(".pbtxt") || t.endsWith(".textproto")), this.setGraph(new Uint8Array(e), t);
2471
- }
2472
- setGraphFromString(t) {
2473
- this.setGraph(new TextEncoder().encode(t), !1);
2474
- }
2475
- setGraph(t, e) {
2476
- const n = t.length, s = this.i._malloc(n);
2477
- this.i.HEAPU8.set(t, s), e ? this.i._changeBinaryGraph(n, s) : this.i._changeTextGraph(n, s), this.i._free(s);
2478
- }
2479
- configureAudio(t, e, n, s, r) {
2480
- this.i._configureAudio || console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'), g(this, s || "input_audio", (i) => {
2481
- g(this, r = r || "audio_header", (o) => {
2482
- this.i._configureAudio(i, o, t, e ?? 0, n);
2483
- });
2484
- });
2485
- }
2486
- setAutoResizeCanvas(t) {
2487
- this.l = t;
2488
- }
2489
- setAutoRenderToScreen(t) {
2490
- this.i._setAutoRenderToScreen(t);
2491
- }
2492
- setGpuBufferVerticalFlip(t) {
2493
- this.i.gpuOriginForWebTexturesIsBottomLeft = t;
2494
- }
2495
- ca(t) {
2496
- wt(this, "__graph_config__", (e) => {
2497
- t(e);
2498
- }), g(this, "__graph_config__", (e) => {
2499
- this.i._getGraphConfig(e, void 0);
2500
- }), delete this.i.simpleListeners.__graph_config__;
2501
- }
2502
- attachErrorListener(t) {
2503
- this.i.errorListener = t;
2504
- }
2505
- attachEmptyPacketListener(t, e) {
2506
- this.i.emptyPacketListeners = this.i.emptyPacketListeners || {}, this.i.emptyPacketListeners[t] = e;
2507
- }
2508
- addAudioToStream(t, e, n) {
2509
- this.addAudioToStreamWithShape(t, 0, 0, e, n);
2510
- }
2511
- addAudioToStreamWithShape(t, e, n, s, r) {
2512
- const i = 4 * t.length;
2513
- this.h !== i && (this.g && this.i._free(this.g), this.g = this.i._malloc(i), this.h = i), this.i.HEAPF32.set(t, this.g / 4), g(this, s, (o) => {
2514
- this.i._addAudioToInputStream(this.g, e, n, o, r);
2515
- });
2516
- }
2517
- addGpuBufferToStream(t, e, n) {
2518
- g(this, e, (s) => {
2519
- const [r, i] = $r(this, t, s);
2520
- this.i._addBoundTextureToStream(s, r, i, n);
2521
- });
2522
- }
2523
- addBoolToStream(t, e, n) {
2524
- g(this, e, (s) => {
2525
- this.i._addBoolToInputStream(t, s, n);
2526
- });
2527
- }
2528
- addDoubleToStream(t, e, n) {
2529
- g(this, e, (s) => {
2530
- this.i._addDoubleToInputStream(t, s, n);
2531
- });
2532
- }
2533
- addFloatToStream(t, e, n) {
2534
- g(this, e, (s) => {
2535
- this.i._addFloatToInputStream(t, s, n);
2536
- });
2537
- }
2538
- addIntToStream(t, e, n) {
2539
- g(this, e, (s) => {
2540
- this.i._addIntToInputStream(t, s, n);
2541
- });
2542
- }
2543
- addUintToStream(t, e, n) {
2544
- g(this, e, (s) => {
2545
- this.i._addUintToInputStream(t, s, n);
2546
- });
2547
- }
2548
- addStringToStream(t, e, n) {
2549
- g(this, e, (s) => {
2550
- g(this, t, (r) => {
2551
- this.i._addStringToInputStream(r, s, n);
2552
- });
2553
- });
2554
- }
2555
- addStringRecordToStream(t, e, n) {
2556
- g(this, e, (s) => {
2557
- Jr(this, Object.keys(t), (r) => {
2558
- Jr(this, Object.values(t), (i) => {
2559
- this.i._addFlatHashMapToInputStream(r, i, Object.keys(t).length, s, n);
2560
- });
2561
- });
2562
- });
2563
- }
2564
- addProtoToStream(t, e, n, s) {
2565
- g(this, n, (r) => {
2566
- g(this, e, (i) => {
2567
- const o = this.i._malloc(t.length);
2568
- this.i.HEAPU8.set(t, o), this.i._addProtoToInputStream(o, t.length, i, r, s), this.i._free(o);
2569
- });
2570
- });
2571
- }
2572
- addEmptyPacketToStream(t, e) {
2573
- g(this, t, (n) => {
2574
- this.i._addEmptyPacketToInputStream(n, e);
2575
- });
2576
- }
2577
- addBoolVectorToStream(t, e, n) {
2578
- g(this, e, (s) => {
2579
- const r = this.i._allocateBoolVector(t.length);
2580
- if (!r) throw Error("Unable to allocate new bool vector on heap.");
2581
- for (const i of t) this.i._addBoolVectorEntry(r, i);
2582
- this.i._addBoolVectorToInputStream(r, s, n);
2583
- });
2584
- }
2585
- addDoubleVectorToStream(t, e, n) {
2586
- g(this, e, (s) => {
2587
- const r = this.i._allocateDoubleVector(t.length);
2588
- if (!r) throw Error("Unable to allocate new double vector on heap.");
2589
- for (const i of t) this.i._addDoubleVectorEntry(r, i);
2590
- this.i._addDoubleVectorToInputStream(r, s, n);
2591
- });
2592
- }
2593
- addFloatVectorToStream(t, e, n) {
2594
- g(this, e, (s) => {
2595
- const r = this.i._allocateFloatVector(t.length);
2596
- if (!r) throw Error("Unable to allocate new float vector on heap.");
2597
- for (const i of t) this.i._addFloatVectorEntry(r, i);
2598
- this.i._addFloatVectorToInputStream(r, s, n);
2599
- });
2600
- }
2601
- addIntVectorToStream(t, e, n) {
2602
- g(this, e, (s) => {
2603
- const r = this.i._allocateIntVector(t.length);
2604
- if (!r) throw Error("Unable to allocate new int vector on heap.");
2605
- for (const i of t) this.i._addIntVectorEntry(r, i);
2606
- this.i._addIntVectorToInputStream(r, s, n);
2607
- });
2608
- }
2609
- addUintVectorToStream(t, e, n) {
2610
- g(this, e, (s) => {
2611
- const r = this.i._allocateUintVector(t.length);
2612
- if (!r) throw Error("Unable to allocate new unsigned int vector on heap.");
2613
- for (const i of t) this.i._addUintVectorEntry(r, i);
2614
- this.i._addUintVectorToInputStream(r, s, n);
2615
- });
2616
- }
2617
- addStringVectorToStream(t, e, n) {
2618
- g(this, e, (s) => {
2619
- const r = this.i._allocateStringVector(t.length);
2620
- if (!r) throw Error("Unable to allocate new string vector on heap.");
2621
- for (const i of t) g(this, i, (o) => {
2622
- this.i._addStringVectorEntry(r, o);
2623
- });
2624
- this.i._addStringVectorToInputStream(r, s, n);
2625
- });
2626
- }
2627
- addBoolToInputSidePacket(t, e) {
2628
- g(this, e, (n) => {
2629
- this.i._addBoolToInputSidePacket(t, n);
2630
- });
2631
- }
2632
- addDoubleToInputSidePacket(t, e) {
2633
- g(this, e, (n) => {
2634
- this.i._addDoubleToInputSidePacket(t, n);
2635
- });
2636
- }
2637
- addFloatToInputSidePacket(t, e) {
2638
- g(this, e, (n) => {
2639
- this.i._addFloatToInputSidePacket(t, n);
2640
- });
2641
- }
2642
- addIntToInputSidePacket(t, e) {
2643
- g(this, e, (n) => {
2644
- this.i._addIntToInputSidePacket(t, n);
2645
- });
2646
- }
2647
- addUintToInputSidePacket(t, e) {
2648
- g(this, e, (n) => {
2649
- this.i._addUintToInputSidePacket(t, n);
2650
- });
2651
- }
2652
- addStringToInputSidePacket(t, e) {
2653
- g(this, e, (n) => {
2654
- g(this, t, (s) => {
2655
- this.i._addStringToInputSidePacket(s, n);
2656
- });
2657
- });
2658
- }
2659
- addProtoToInputSidePacket(t, e, n) {
2660
- g(this, n, (s) => {
2661
- g(this, e, (r) => {
2662
- const i = this.i._malloc(t.length);
2663
- this.i.HEAPU8.set(t, i), this.i._addProtoToInputSidePacket(i, t.length, r, s), this.i._free(i);
2664
- });
2665
- });
2666
- }
2667
- addBoolVectorToInputSidePacket(t, e) {
2668
- g(this, e, (n) => {
2669
- const s = this.i._allocateBoolVector(t.length);
2670
- if (!s) throw Error("Unable to allocate new bool vector on heap.");
2671
- for (const r of t) this.i._addBoolVectorEntry(s, r);
2672
- this.i._addBoolVectorToInputSidePacket(s, n);
2673
- });
2674
- }
2675
- addDoubleVectorToInputSidePacket(t, e) {
2676
- g(this, e, (n) => {
2677
- const s = this.i._allocateDoubleVector(t.length);
2678
- if (!s) throw Error("Unable to allocate new double vector on heap.");
2679
- for (const r of t) this.i._addDoubleVectorEntry(s, r);
2680
- this.i._addDoubleVectorToInputSidePacket(s, n);
2681
- });
2682
- }
2683
- addFloatVectorToInputSidePacket(t, e) {
2684
- g(this, e, (n) => {
2685
- const s = this.i._allocateFloatVector(t.length);
2686
- if (!s) throw Error("Unable to allocate new float vector on heap.");
2687
- for (const r of t) this.i._addFloatVectorEntry(s, r);
2688
- this.i._addFloatVectorToInputSidePacket(s, n);
2689
- });
2690
- }
2691
- addIntVectorToInputSidePacket(t, e) {
2692
- g(this, e, (n) => {
2693
- const s = this.i._allocateIntVector(t.length);
2694
- if (!s) throw Error("Unable to allocate new int vector on heap.");
2695
- for (const r of t) this.i._addIntVectorEntry(s, r);
2696
- this.i._addIntVectorToInputSidePacket(s, n);
2697
- });
2698
- }
2699
- addUintVectorToInputSidePacket(t, e) {
2700
- g(this, e, (n) => {
2701
- const s = this.i._allocateUintVector(t.length);
2702
- if (!s) throw Error("Unable to allocate new unsigned int vector on heap.");
2703
- for (const r of t) this.i._addUintVectorEntry(s, r);
2704
- this.i._addUintVectorToInputSidePacket(s, n);
2705
- });
2706
- }
2707
- addStringVectorToInputSidePacket(t, e) {
2708
- g(this, e, (n) => {
2709
- const s = this.i._allocateStringVector(t.length);
2710
- if (!s) throw Error("Unable to allocate new string vector on heap.");
2711
- for (const r of t) g(this, r, (i) => {
2712
- this.i._addStringVectorEntry(s, i);
2713
- });
2714
- this.i._addStringVectorToInputSidePacket(s, n);
2715
- });
2716
- }
2717
- attachBoolListener(t, e) {
2718
- wt(this, t, e), g(this, t, (n) => {
2719
- this.i._attachBoolListener(n);
2720
- });
2721
- }
2722
- attachBoolVectorListener(t, e) {
2723
- Ct(this, t, e), g(this, t, (n) => {
2724
- this.i._attachBoolVectorListener(n);
2725
- });
2726
- }
2727
- attachIntListener(t, e) {
2728
- wt(this, t, e), g(this, t, (n) => {
2729
- this.i._attachIntListener(n);
2730
- });
2731
- }
2732
- attachIntVectorListener(t, e) {
2733
- Ct(this, t, e), g(this, t, (n) => {
2734
- this.i._attachIntVectorListener(n);
2735
- });
2736
- }
2737
- attachUintListener(t, e) {
2738
- wt(this, t, e), g(this, t, (n) => {
2739
- this.i._attachUintListener(n);
2740
- });
2741
- }
2742
- attachUintVectorListener(t, e) {
2743
- Ct(this, t, e), g(this, t, (n) => {
2744
- this.i._attachUintVectorListener(n);
2745
- });
2746
- }
2747
- attachDoubleListener(t, e) {
2748
- wt(this, t, e), g(this, t, (n) => {
2749
- this.i._attachDoubleListener(n);
2750
- });
2751
- }
2752
- attachDoubleVectorListener(t, e) {
2753
- Ct(this, t, e), g(this, t, (n) => {
2754
- this.i._attachDoubleVectorListener(n);
2755
- });
2756
- }
2757
- attachFloatListener(t, e) {
2758
- wt(this, t, e), g(this, t, (n) => {
2759
- this.i._attachFloatListener(n);
2760
- });
2761
- }
2762
- attachFloatVectorListener(t, e) {
2763
- Ct(this, t, e), g(this, t, (n) => {
2764
- this.i._attachFloatVectorListener(n);
2765
- });
2766
- }
2767
- attachStringListener(t, e) {
2768
- wt(this, t, e), g(this, t, (n) => {
2769
- this.i._attachStringListener(n);
2770
- });
2771
- }
2772
- attachStringVectorListener(t, e) {
2773
- Ct(this, t, e), g(this, t, (n) => {
2774
- this.i._attachStringVectorListener(n);
2775
- });
2776
- }
2777
- attachProtoListener(t, e, n) {
2778
- wt(this, t, e), g(this, t, (s) => {
2779
- this.i._attachProtoListener(s, n || !1);
2780
- });
2781
- }
2782
- attachProtoVectorListener(t, e, n) {
2783
- Ct(this, t, e), g(this, t, (s) => {
2784
- this.i._attachProtoVectorListener(s, n || !1);
2785
- });
2786
- }
2787
- attachAudioListener(t, e, n) {
2788
- this.i._attachAudioListener || console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'), wt(this, t, (s, r) => {
2789
- s = new Float32Array(s.buffer, s.byteOffset, s.length / 4), e(s, r);
2790
- }), g(this, t, (s) => {
2791
- this.i._attachAudioListener(s, n || !1);
2792
- });
2793
- }
2794
- finishProcessing() {
2795
- this.i._waitUntilIdle();
2796
- }
2797
- closeGraph() {
2798
- this.i._closeGraph(), this.i.simpleListeners = void 0, this.i.emptyPacketListeners = void 0;
2799
- }
2800
- }, class extends ni {
2801
- get ga() {
2802
- return this.i;
2803
- }
2804
- pa(t, e, n) {
2805
- g(this, e, (s) => {
2806
- const [r, i] = $r(this, t, s);
2807
- this.ga._addBoundTextureAsImageToStream(s, r, i, n);
2808
- });
2809
- }
2810
- Z(t, e) {
2811
- wt(this, t, e), g(this, t, (n) => {
2812
- this.ga._attachImageListener(n);
2813
- });
2814
- }
2815
- aa(t, e) {
2816
- Ct(this, t, e), g(this, t, (n) => {
2817
- this.ga._attachImageVectorListener(n);
2818
- });
2819
- }
2820
- }));
2821
- var ni, _t = class extends Z2 {
2822
- };
2823
- async function b(t, e, n) {
2824
- return async function(s, r, i, o) {
2825
- return X2(s, r, i, o);
2826
- }(t, n.canvas ?? (ea() ? void 0 : document.createElement("canvas")), e, n);
2827
- }
2828
- function ha(t, e, n, s) {
2829
- if (t.U) {
2830
- const i = new Io();
2831
- if (n != null && n.regionOfInterest) {
2832
- if (!t.oa) throw Error("This task doesn't support region-of-interest.");
2833
- var r = n.regionOfInterest;
2834
- if (r.left >= r.right || r.top >= r.bottom) throw Error("Expected RectF with left < right and top < bottom.");
2835
- if (r.left < 0 || r.top < 0 || r.right > 1 || r.bottom > 1) throw Error("Expected RectF values to be in [0,1].");
2836
- m(i, 1, (r.left + r.right) / 2), m(i, 2, (r.top + r.bottom) / 2), m(i, 4, r.right - r.left), m(i, 3, r.bottom - r.top);
2837
- } else m(i, 1, 0.5), m(i, 2, 0.5), m(i, 4, 1), m(i, 3, 1);
2838
- if (n != null && n.rotationDegrees) {
2839
- if ((n == null ? void 0 : n.rotationDegrees) % 90 != 0) throw Error("Expected rotation to be a multiple of 90°.");
2840
- if (m(i, 5, -Math.PI * n.rotationDegrees / 180), (n == null ? void 0 : n.rotationDegrees) % 180 != 0) {
2841
- const [o, a] = na(e);
2842
- n = N(i, 3) * a / o, r = N(i, 4) * o / a, m(i, 4, n), m(i, 3, r);
2843
- }
2844
- }
2845
- t.g.addProtoToStream(i.g(), "mediapipe.NormalizedRect", t.U, s);
2846
- }
2847
- t.g.pa(e, t.X, s ?? performance.now()), t.finishProcessing();
2848
- }
2849
- function vt(t, e, n) {
2850
- var s;
2851
- if ((s = t.baseOptions) != null && s.g()) throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");
2852
- ha(t, e, n, t.C + 1);
2853
- }
2854
- function Mt(t, e, n, s) {
2855
- var r;
2856
- if (!((r = t.baseOptions) != null && r.g())) throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");
2857
- ha(t, e, n, s);
2858
- }
2859
- function be(t, e, n, s) {
2860
- var r = e.data;
2861
- const i = e.width, o = i * (e = e.height);
2862
- if ((r instanceof Uint8Array || r instanceof Float32Array) && r.length !== o) throw Error("Unsupported channel count: " + r.length / o);
2863
- return t = new H([r], n, !1, t.g.i.canvas, t.P, i, e), s ? t.clone() : t;
2864
- }
2865
- var at = class extends cs {
2866
- constructor(t, e, n, s) {
2867
- super(t), this.g = t, this.X = e, this.U = n, this.oa = s, this.P = new ia();
2868
- }
2869
- l(t, e = !0) {
2870
- if ("runningMode" in t && k(this.baseOptions, 2, We(!!t.runningMode && t.runningMode !== "IMAGE")), t.canvas !== void 0 && this.g.i.canvas !== t.canvas) throw Error("You must create a new task to reset the canvas.");
2871
- return super.l(t, e);
2872
- }
2873
- close() {
2874
- this.P.close(), super.close();
2875
- }
2876
- };
2877
- at.prototype.close = at.prototype.close;
2878
- var ut = class extends at {
2879
- constructor(t, e) {
2880
- super(new _t(t, e), "image_in", "norm_rect_in", !1), this.j = { detections: [] }, y(t = this.h = new Nn(), 0, 1, e = new O()), m(this.h, 2, 0.5), m(this.h, 3, 0.3);
2881
- }
2882
- get baseOptions() {
2883
- return A(this.h, O, 1);
2884
- }
2885
- set baseOptions(t) {
2886
- y(this.h, 0, 1, t);
2887
- }
2888
- o(t) {
2889
- return "minDetectionConfidence" in t && m(this.h, 2, t.minDetectionConfidence ?? 0.5), "minSuppressionThreshold" in t && m(this.h, 3, t.minSuppressionThreshold ?? 0.3), this.l(t);
2890
- }
2891
- F(t, e) {
2892
- return this.j = { detections: [] }, vt(this, t, e), this.j;
2893
- }
2894
- G(t, e, n) {
2895
- return this.j = { detections: [] }, Mt(this, t, n, e), this.j;
2896
- }
2897
- m() {
2898
- var t = new ht();
2899
- P(t, "image_in"), P(t, "norm_rect_in"), E(t, "detections");
2900
- const e = new ct();
2901
- Lt(e, N2, this.h);
2902
- const n = new Q();
2903
- it(n, 2, "mediapipe.tasks.vision.face_detector.FaceDetectorGraph"), M(n, "IMAGE:image_in"), M(n, "NORM_RECT:norm_rect_in"), w(n, "DETECTIONS:detections"), n.o(e), gt(t, n), this.g.attachProtoVectorListener("detections", (s, r) => {
2904
- for (const i of s) s = To(i), this.j.detections.push(Zo(s));
2905
- l(this, r);
2906
- }), this.g.attachEmptyPacketListener("detections", (s) => {
2907
- l(this, s);
2908
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
2909
- }
2910
- };
2911
- ut.prototype.detectForVideo = ut.prototype.G, ut.prototype.detect = ut.prototype.F, ut.prototype.setOptions = ut.prototype.o, ut.createFromModelPath = async function(t, e) {
2912
- return b(ut, t, { baseOptions: { modelAssetPath: e } });
2913
- }, ut.createFromModelBuffer = function(t, e) {
2914
- return b(ut, t, { baseOptions: { modelAssetBuffer: e } });
2915
- }, ut.createFromOptions = function(t, e) {
2916
- return b(ut, t, e);
2917
- };
2918
- var sr = yt([61, 146], [146, 91], [91, 181], [181, 84], [84, 17], [17, 314], [314, 405], [405, 321], [321, 375], [375, 291], [61, 185], [185, 40], [40, 39], [39, 37], [37, 0], [0, 267], [267, 269], [269, 270], [270, 409], [409, 291], [78, 95], [95, 88], [88, 178], [178, 87], [87, 14], [14, 317], [317, 402], [402, 318], [318, 324], [324, 308], [78, 191], [191, 80], [80, 81], [81, 82], [82, 13], [13, 312], [312, 311], [311, 310], [310, 415], [415, 308]), rr = yt([263, 249], [249, 390], [390, 373], [373, 374], [374, 380], [380, 381], [381, 382], [382, 362], [263, 466], [466, 388], [388, 387], [387, 386], [386, 385], [385, 384], [384, 398], [398, 362]), ir = yt([276, 283], [283, 282], [282, 295], [295, 285], [300, 293], [293, 334], [334, 296], [296, 336]), ua = yt([474, 475], [475, 476], [476, 477], [477, 474]), or = yt([33, 7], [7, 163], [163, 144], [144, 145], [145, 153], [153, 154], [154, 155], [155, 133], [33, 246], [246, 161], [161, 160], [160, 159], [159, 158], [158, 157], [157, 173], [173, 133]), ar = yt([46, 53], [53, 52], [52, 65], [65, 55], [70, 63], [63, 105], [105, 66], [66, 107]), la = yt([469, 470], [470, 471], [471, 472], [472, 469]), cr = yt([10, 338], [338, 297], [297, 332], [332, 284], [284, 251], [251, 389], [389, 356], [356, 454], [454, 323], [323, 361], [361, 288], [288, 397], [397, 365], [365, 379], [379, 378], [378, 400], [400, 377], [377, 152], [152, 148], [148, 176], [176, 149], [149, 150], [150, 136], [136, 172], [172, 58], [58, 132], [132, 93], [93, 234], [234, 127], [127, 162], [162, 21], [21, 54], [54, 103], [103, 67], [67, 109], [109, 10]), fa = [...sr, ...rr, ...ir, ...or, ...ar, ...cr], da = yt([127, 34], [34, 139], [139, 127], [11, 0], [0, 37], [37, 11], [232, 231], [231, 120], [120, 232], [72, 37], [37, 39], [39, 72], [128, 121], [121, 47], [47, 128], [232, 121], [121, 128], [128, 232], [104, 69], [69, 67], [67, 104], [175, 171], [171, 148], [148, 175], [118, 50], [50, 101], [101, 118], [73, 39], [39, 40], [40, 73], [9, 151], [151, 108], [108, 9], [48, 115], [115, 131], [131, 48], [194, 204], [204, 211], [211, 194], [74, 40], [40, 185], [185, 74], [80, 42], [42, 183], [183, 80], [40, 92], [92, 186], [186, 40], [230, 229], [229, 118], [118, 230], [202, 212], [212, 214], [214, 202], [83, 18], [18, 17], [17, 83], [76, 61], [61, 146], [146, 76], [160, 29], [29, 30], [30, 160], [56, 157], [157, 173], [173, 56], [106, 204], [204, 194], [194, 106], [135, 214], [214, 192], [192, 135], [203, 165], [165, 98], [98, 203], [21, 71], [71, 68], [68, 21], [51, 45], [45, 4], [4, 51], [144, 24], [24, 23], [23, 144], [77, 146], [146, 91], [91, 77], [205, 50], [50, 187], [187, 205], [201, 200], [200, 18], [18, 201], [91, 106], [106, 182], [182, 91], [90, 91], [91, 181], [181, 90], [85, 84], [84, 17], [17, 85], [206, 203], [203, 36], [36, 206], [148, 171], [171, 140], [140, 148], [92, 40], [40, 39], [39, 92], [193, 189], [189, 244], [244, 193], [159, 158], [158, 28], [28, 159], [247, 246], [246, 161], [161, 247], [236, 3], [3, 196], [196, 236], [54, 68], [68, 104], [104, 54], [193, 168], [168, 8], [8, 193], [117, 228], [228, 31], [31, 117], [189, 193], [193, 55], [55, 189], [98, 97], [97, 99], [99, 98], [126, 47], [47, 100], [100, 126], [166, 79], [79, 218], [218, 166], [155, 154], [154, 26], [26, 155], [209, 49], [49, 131], [131, 209], [135, 136], [136, 150], [150, 135], [47, 126], [126, 217], [217, 47], [223, 52], [52, 53], [53, 223], [45, 51], [51, 134], [134, 45], [211, 170], [170, 140], [140, 211], [67, 69], [69, 108], [108, 67], [43, 106], [106, 91], [91, 43], [230, 119], [119, 120], [120, 230], [226, 130], [130, 247], [247, 226], [63, 53], [53, 52], [52, 63], [238, 20], [20, 242], [242, 238], [46, 70], [70, 156], [156, 46], [78, 62], [62, 96], [96, 78], [46, 53], [53, 63], [63, 46], [143, 34], [34, 227], [227, 143], [123, 117], [117, 111], [111, 123], [44, 125], [125, 19], [19, 44], [236, 134], [134, 51], [51, 236], [216, 206], [206, 205], [205, 216], [154, 153], [153, 22], [22, 154], [39, 37], [37, 167], [167, 39], [200, 201], [201, 208], [208, 200], [36, 142], [142, 100], [100, 36], [57, 212], [212, 202], [202, 57], [20, 60], [60, 99], [99, 20], [28, 158], [158, 157], [157, 28], [35, 226], [226, 113], [113, 35], [160, 159], [159, 27], [27, 160], [204, 202], [202, 210], [210, 204], [113, 225], [225, 46], [46, 113], [43, 202], [202, 204], [204, 43], [62, 76], [76, 77], [77, 62], [137, 123], [123, 116], [116, 137], [41, 38], [38, 72], [72, 41], [203, 129], [129, 142], [142, 203], [64, 98], [98, 240], [240, 64], [49, 102], [102, 64], [64, 49], [41, 73], [73, 74], [74, 41], [212, 216], [216, 207], [207, 212], [42, 74], [74, 184], [184, 42], [169, 170], [170, 211], [211, 169], [170, 149], [149, 176], [176, 170], [105, 66], [66, 69], [69, 105], [122, 6], [6, 168], [168, 122], [123, 147], [147, 187], [187, 123], [96, 77], [77, 90], [90, 96], [65, 55], [55, 107], [107, 65], [89, 90], [90, 180], [180, 89], [101, 100], [100, 120], [120, 101], [63, 105], [105, 104], [104, 63], [93, 137], [137, 227], [227, 93], [15, 86], [86, 85], [85, 15], [129, 102], [102, 49], [49, 129], [14, 87], [87, 86], [86, 14], [55, 8], [8, 9], [9, 55], [100, 47], [47, 121], [121, 100], [145, 23], [23, 22], [22, 145], [88, 89], [89, 179], [179, 88], [6, 122], [122, 196], [196, 6], [88, 95], [95, 96], [96, 88], [138, 172], [172, 136], [136, 138], [215, 58], [58, 172], [172, 215], [115, 48], [48, 219], [219, 115], [42, 80], [80, 81], [81, 42], [195, 3], [3, 51], [51, 195], [43, 146], [146, 61], [61, 43], [171, 175], [175, 199], [199, 171], [81, 82], [82, 38], [38, 81], [53, 46], [46, 225], [225, 53], [144, 163], [163, 110], [110, 144], [52, 65], [65, 66], [66, 52], [229, 228], [228, 117], [117, 229], [34, 127], [127, 234], [234, 34], [107, 108], [108, 69], [69, 107], [109, 108], [108, 151], [151, 109], [48, 64], [64, 235], [235, 48], [62, 78], [78, 191], [191, 62], [129, 209], [209, 126], [126, 129], [111, 35], [35, 143], [143, 111], [117, 123], [123, 50], [50, 117], [222, 65], [65, 52], [52, 222], [19, 125], [125, 141], [141, 19], [221, 55], [55, 65], [65, 221], [3, 195], [195, 197], [197, 3], [25, 7], [7, 33], [33, 25], [220, 237], [237, 44], [44, 220], [70, 71], [71, 139], [139, 70], [122, 193], [193, 245], [245, 122], [247, 130], [130, 33], [33, 247], [71, 21], [21, 162], [162, 71], [170, 169], [169, 150], [150, 170], [188, 174], [174, 196], [196, 188], [216, 186], [186, 92], [92, 216], [2, 97], [97, 167], [167, 2], [141, 125], [125, 241], [241, 141], [164, 167], [167, 37], [37, 164], [72, 38], [38, 12], [12, 72], [38, 82], [82, 13], [13, 38], [63, 68], [68, 71], [71, 63], [226, 35], [35, 111], [111, 226], [101, 50], [50, 205], [205, 101], [206, 92], [92, 165], [165, 206], [209, 198], [198, 217], [217, 209], [165, 167], [167, 97], [97, 165], [220, 115], [115, 218], [218, 220], [133, 112], [112, 243], [243, 133], [239, 238], [238, 241], [241, 239], [214, 135], [135, 169], [169, 214], [190, 173], [173, 133], [133, 190], [171, 208], [208, 32], [32, 171], [125, 44], [44, 237], [237, 125], [86, 87], [87, 178], [178, 86], [85, 86], [86, 179], [179, 85], [84, 85], [85, 180], [180, 84], [83, 84], [84, 181], [181, 83], [201, 83], [83, 182], [182, 201], [137, 93], [93, 132], [132, 137], [76, 62], [62, 183], [183, 76], [61, 76], [76, 184], [184, 61], [57, 61], [61, 185], [185, 57], [212, 57], [57, 186], [186, 212], [214, 207], [207, 187], [187, 214], [34, 143], [143, 156], [156, 34], [79, 239], [239, 237], [237, 79], [123, 137], [137, 177], [177, 123], [44, 1], [1, 4], [4, 44], [201, 194], [194, 32], [32, 201], [64, 102], [102, 129], [129, 64], [213, 215], [215, 138], [138, 213], [59, 166], [166, 219], [219, 59], [242, 99], [99, 97], [97, 242], [2, 94], [94, 141], [141, 2], [75, 59], [59, 235], [235, 75], [24, 110], [110, 228], [228, 24], [25, 130], [130, 226], [226, 25], [23, 24], [24, 229], [229, 23], [22, 23], [23, 230], [230, 22], [26, 22], [22, 231], [231, 26], [112, 26], [26, 232], [232, 112], [189, 190], [190, 243], [243, 189], [221, 56], [56, 190], [190, 221], [28, 56], [56, 221], [221, 28], [27, 28], [28, 222], [222, 27], [29, 27], [27, 223], [223, 29], [30, 29], [29, 224], [224, 30], [247, 30], [30, 225], [225, 247], [238, 79], [79, 20], [20, 238], [166, 59], [59, 75], [75, 166], [60, 75], [75, 240], [240, 60], [147, 177], [177, 215], [215, 147], [20, 79], [79, 166], [166, 20], [187, 147], [147, 213], [213, 187], [112, 233], [233, 244], [244, 112], [233, 128], [128, 245], [245, 233], [128, 114], [114, 188], [188, 128], [114, 217], [217, 174], [174, 114], [131, 115], [115, 220], [220, 131], [217, 198], [198, 236], [236, 217], [198, 131], [131, 134], [134, 198], [177, 132], [132, 58], [58, 177], [143, 35], [35, 124], [124, 143], [110, 163], [163, 7], [7, 110], [228, 110], [110, 25], [25, 228], [356, 389], [389, 368], [368, 356], [11, 302], [302, 267], [267, 11], [452, 350], [350, 349], [349, 452], [302, 303], [303, 269], [269, 302], [357, 343], [343, 277], [277, 357], [452, 453], [453, 357], [357, 452], [333, 332], [332, 297], [297, 333], [175, 152], [152, 377], [377, 175], [347, 348], [348, 330], [330, 347], [303, 304], [304, 270], [270, 303], [9, 336], [336, 337], [337, 9], [278, 279], [279, 360], [360, 278], [418, 262], [262, 431], [431, 418], [304, 408], [408, 409], [409, 304], [310, 415], [415, 407], [407, 310], [270, 409], [409, 410], [410, 270], [450, 348], [348, 347], [347, 450], [422, 430], [430, 434], [434, 422], [313, 314], [314, 17], [17, 313], [306, 307], [307, 375], [375, 306], [387, 388], [388, 260], [260, 387], [286, 414], [414, 398], [398, 286], [335, 406], [406, 418], [418, 335], [364, 367], [367, 416], [416, 364], [423, 358], [358, 327], [327, 423], [251, 284], [284, 298], [298, 251], [281, 5], [5, 4], [4, 281], [373, 374], [374, 253], [253, 373], [307, 320], [320, 321], [321, 307], [425, 427], [427, 411], [411, 425], [421, 313], [313, 18], [18, 421], [321, 405], [405, 406], [406, 321], [320, 404], [404, 405], [405, 320], [315, 16], [16, 17], [17, 315], [426, 425], [425, 266], [266, 426], [377, 400], [400, 369], [369, 377], [322, 391], [391, 269], [269, 322], [417, 465], [465, 464], [464, 417], [386, 257], [257, 258], [258, 386], [466, 260], [260, 388], [388, 466], [456, 399], [399, 419], [419, 456], [284, 332], [332, 333], [333, 284], [417, 285], [285, 8], [8, 417], [346, 340], [340, 261], [261, 346], [413, 441], [441, 285], [285, 413], [327, 460], [460, 328], [328, 327], [355, 371], [371, 329], [329, 355], [392, 439], [439, 438], [438, 392], [382, 341], [341, 256], [256, 382], [429, 420], [420, 360], [360, 429], [364, 394], [394, 379], [379, 364], [277, 343], [343, 437], [437, 277], [443, 444], [444, 283], [283, 443], [275, 440], [440, 363], [363, 275], [431, 262], [262, 369], [369, 431], [297, 338], [338, 337], [337, 297], [273, 375], [375, 321], [321, 273], [450, 451], [451, 349], [349, 450], [446, 342], [342, 467], [467, 446], [293, 334], [334, 282], [282, 293], [458, 461], [461, 462], [462, 458], [276, 353], [353, 383], [383, 276], [308, 324], [324, 325], [325, 308], [276, 300], [300, 293], [293, 276], [372, 345], [345, 447], [447, 372], [352, 345], [345, 340], [340, 352], [274, 1], [1, 19], [19, 274], [456, 248], [248, 281], [281, 456], [436, 427], [427, 425], [425, 436], [381, 256], [256, 252], [252, 381], [269, 391], [391, 393], [393, 269], [200, 199], [199, 428], [428, 200], [266, 330], [330, 329], [329, 266], [287, 273], [273, 422], [422, 287], [250, 462], [462, 328], [328, 250], [258, 286], [286, 384], [384, 258], [265, 353], [353, 342], [342, 265], [387, 259], [259, 257], [257, 387], [424, 431], [431, 430], [430, 424], [342, 353], [353, 276], [276, 342], [273, 335], [335, 424], [424, 273], [292, 325], [325, 307], [307, 292], [366, 447], [447, 345], [345, 366], [271, 303], [303, 302], [302, 271], [423, 266], [266, 371], [371, 423], [294, 455], [455, 460], [460, 294], [279, 278], [278, 294], [294, 279], [271, 272], [272, 304], [304, 271], [432, 434], [434, 427], [427, 432], [272, 407], [407, 408], [408, 272], [394, 430], [430, 431], [431, 394], [395, 369], [369, 400], [400, 395], [334, 333], [333, 299], [299, 334], [351, 417], [417, 168], [168, 351], [352, 280], [280, 411], [411, 352], [325, 319], [319, 320], [320, 325], [295, 296], [296, 336], [336, 295], [319, 403], [403, 404], [404, 319], [330, 348], [348, 349], [349, 330], [293, 298], [298, 333], [333, 293], [323, 454], [454, 447], [447, 323], [15, 16], [16, 315], [315, 15], [358, 429], [429, 279], [279, 358], [14, 15], [15, 316], [316, 14], [285, 336], [336, 9], [9, 285], [329, 349], [349, 350], [350, 329], [374, 380], [380, 252], [252, 374], [318, 402], [402, 403], [403, 318], [6, 197], [197, 419], [419, 6], [318, 319], [319, 325], [325, 318], [367, 364], [364, 365], [365, 367], [435, 367], [367, 397], [397, 435], [344, 438], [438, 439], [439, 344], [272, 271], [271, 311], [311, 272], [195, 5], [5, 281], [281, 195], [273, 287], [287, 291], [291, 273], [396, 428], [428, 199], [199, 396], [311, 271], [271, 268], [268, 311], [283, 444], [444, 445], [445, 283], [373, 254], [254, 339], [339, 373], [282, 334], [334, 296], [296, 282], [449, 347], [347, 346], [346, 449], [264, 447], [447, 454], [454, 264], [336, 296], [296, 299], [299, 336], [338, 10], [10, 151], [151, 338], [278, 439], [439, 455], [455, 278], [292, 407], [407, 415], [415, 292], [358, 371], [371, 355], [355, 358], [340, 345], [345, 372], [372, 340], [346, 347], [347, 280], [280, 346], [442, 443], [443, 282], [282, 442], [19, 94], [94, 370], [370, 19], [441, 442], [442, 295], [295, 441], [248, 419], [419, 197], [197, 248], [263, 255], [255, 359], [359, 263], [440, 275], [275, 274], [274, 440], [300, 383], [383, 368], [368, 300], [351, 412], [412, 465], [465, 351], [263, 467], [467, 466], [466, 263], [301, 368], [368, 389], [389, 301], [395, 378], [378, 379], [379, 395], [412, 351], [351, 419], [419, 412], [436, 426], [426, 322], [322, 436], [2, 164], [164, 393], [393, 2], [370, 462], [462, 461], [461, 370], [164, 0], [0, 267], [267, 164], [302, 11], [11, 12], [12, 302], [268, 12], [12, 13], [13, 268], [293, 300], [300, 301], [301, 293], [446, 261], [261, 340], [340, 446], [330, 266], [266, 425], [425, 330], [426, 423], [423, 391], [391, 426], [429, 355], [355, 437], [437, 429], [391, 327], [327, 326], [326, 391], [440, 457], [457, 438], [438, 440], [341, 382], [382, 362], [362, 341], [459, 457], [457, 461], [461, 459], [434, 430], [430, 394], [394, 434], [414, 463], [463, 362], [362, 414], [396, 369], [369, 262], [262, 396], [354, 461], [461, 457], [457, 354], [316, 403], [403, 402], [402, 316], [315, 404], [404, 403], [403, 315], [314, 405], [405, 404], [404, 314], [313, 406], [406, 405], [405, 313], [421, 418], [418, 406], [406, 421], [366, 401], [401, 361], [361, 366], [306, 408], [408, 407], [407, 306], [291, 409], [409, 408], [408, 291], [287, 410], [410, 409], [409, 287], [432, 436], [436, 410], [410, 432], [434, 416], [416, 411], [411, 434], [264, 368], [368, 383], [383, 264], [309, 438], [438, 457], [457, 309], [352, 376], [376, 401], [401, 352], [274, 275], [275, 4], [4, 274], [421, 428], [428, 262], [262, 421], [294, 327], [327, 358], [358, 294], [433, 416], [416, 367], [367, 433], [289, 455], [455, 439], [439, 289], [462, 370], [370, 326], [326, 462], [2, 326], [326, 370], [370, 2], [305, 460], [460, 455], [455, 305], [254, 449], [449, 448], [448, 254], [255, 261], [261, 446], [446, 255], [253, 450], [450, 449], [449, 253], [252, 451], [451, 450], [450, 252], [256, 452], [452, 451], [451, 256], [341, 453], [453, 452], [452, 341], [413, 464], [464, 463], [463, 413], [441, 413], [413, 414], [414, 441], [258, 442], [442, 441], [441, 258], [257, 443], [443, 442], [442, 257], [259, 444], [444, 443], [443, 259], [260, 445], [445, 444], [444, 260], [467, 342], [342, 445], [445, 467], [459, 458], [458, 250], [250, 459], [289, 392], [392, 290], [290, 289], [290, 328], [328, 460], [460, 290], [376, 433], [433, 435], [435, 376], [250, 290], [290, 392], [392, 250], [411, 416], [416, 433], [433, 411], [341, 463], [463, 464], [464, 341], [453, 464], [464, 465], [465, 453], [357, 465], [465, 412], [412, 357], [343, 412], [412, 399], [399, 343], [360, 363], [363, 440], [440, 360], [437, 399], [399, 456], [456, 437], [420, 456], [456, 363], [363, 420], [401, 435], [435, 288], [288, 401], [372, 383], [383, 353], [353, 372], [339, 255], [255, 249], [249, 339], [448, 261], [261, 255], [255, 448], [133, 243], [243, 190], [190, 133], [133, 155], [155, 112], [112, 133], [33, 246], [246, 247], [247, 33], [33, 130], [130, 25], [25, 33], [398, 384], [384, 286], [286, 398], [362, 398], [398, 414], [414, 362], [362, 463], [463, 341], [341, 362], [263, 359], [359, 467], [467, 263], [263, 249], [249, 255], [255, 263], [466, 467], [467, 260], [260, 466], [75, 60], [60, 166], [166, 75], [238, 239], [239, 79], [79, 238], [162, 127], [127, 139], [139, 162], [72, 11], [11, 37], [37, 72], [121, 232], [232, 120], [120, 121], [73, 72], [72, 39], [39, 73], [114, 128], [128, 47], [47, 114], [233, 232], [232, 128], [128, 233], [103, 104], [104, 67], [67, 103], [152, 175], [175, 148], [148, 152], [119, 118], [118, 101], [101, 119], [74, 73], [73, 40], [40, 74], [107, 9], [9, 108], [108, 107], [49, 48], [48, 131], [131, 49], [32, 194], [194, 211], [211, 32], [184, 74], [74, 185], [185, 184], [191, 80], [80, 183], [183, 191], [185, 40], [40, 186], [186, 185], [119, 230], [230, 118], [118, 119], [210, 202], [202, 214], [214, 210], [84, 83], [83, 17], [17, 84], [77, 76], [76, 146], [146, 77], [161, 160], [160, 30], [30, 161], [190, 56], [56, 173], [173, 190], [182, 106], [106, 194], [194, 182], [138, 135], [135, 192], [192, 138], [129, 203], [203, 98], [98, 129], [54, 21], [21, 68], [68, 54], [5, 51], [51, 4], [4, 5], [145, 144], [144, 23], [23, 145], [90, 77], [77, 91], [91, 90], [207, 205], [205, 187], [187, 207], [83, 201], [201, 18], [18, 83], [181, 91], [91, 182], [182, 181], [180, 90], [90, 181], [181, 180], [16, 85], [85, 17], [17, 16], [205, 206], [206, 36], [36, 205], [176, 148], [148, 140], [140, 176], [165, 92], [92, 39], [39, 165], [245, 193], [193, 244], [244, 245], [27, 159], [159, 28], [28, 27], [30, 247], [247, 161], [161, 30], [174, 236], [236, 196], [196, 174], [103, 54], [54, 104], [104, 103], [55, 193], [193, 8], [8, 55], [111, 117], [117, 31], [31, 111], [221, 189], [189, 55], [55, 221], [240, 98], [98, 99], [99, 240], [142, 126], [126, 100], [100, 142], [219, 166], [166, 218], [218, 219], [112, 155], [155, 26], [26, 112], [198, 209], [209, 131], [131, 198], [169, 135], [135, 150], [150, 169], [114, 47], [47, 217], [217, 114], [224, 223], [223, 53], [53, 224], [220, 45], [45, 134], [134, 220], [32, 211], [211, 140], [140, 32], [109, 67], [67, 108], [108, 109], [146, 43], [43, 91], [91, 146], [231, 230], [230, 120], [120, 231], [113, 226], [226, 247], [247, 113], [105, 63], [63, 52], [52, 105], [241, 238], [238, 242], [242, 241], [124, 46], [46, 156], [156, 124], [95, 78], [78, 96], [96, 95], [70, 46], [46, 63], [63, 70], [116, 143], [143, 227], [227, 116], [116, 123], [123, 111], [111, 116], [1, 44], [44, 19], [19, 1], [3, 236], [236, 51], [51, 3], [207, 216], [216, 205], [205, 207], [26, 154], [154, 22], [22, 26], [165, 39], [39, 167], [167, 165], [199, 200], [200, 208], [208, 199], [101, 36], [36, 100], [100, 101], [43, 57], [57, 202], [202, 43], [242, 20], [20, 99], [99, 242], [56, 28], [28, 157], [157, 56], [124, 35], [35, 113], [113, 124], [29, 160], [160, 27], [27, 29], [211, 204], [204, 210], [210, 211], [124, 113], [113, 46], [46, 124], [106, 43], [43, 204], [204, 106], [96, 62], [62, 77], [77, 96], [227, 137], [137, 116], [116, 227], [73, 41], [41, 72], [72, 73], [36, 203], [203, 142], [142, 36], [235, 64], [64, 240], [240, 235], [48, 49], [49, 64], [64, 48], [42, 41], [41, 74], [74, 42], [214, 212], [212, 207], [207, 214], [183, 42], [42, 184], [184, 183], [210, 169], [169, 211], [211, 210], [140, 170], [170, 176], [176, 140], [104, 105], [105, 69], [69, 104], [193, 122], [122, 168], [168, 193], [50, 123], [123, 187], [187, 50], [89, 96], [96, 90], [90, 89], [66, 65], [65, 107], [107, 66], [179, 89], [89, 180], [180, 179], [119, 101], [101, 120], [120, 119], [68, 63], [63, 104], [104, 68], [234, 93], [93, 227], [227, 234], [16, 15], [15, 85], [85, 16], [209, 129], [129, 49], [49, 209], [15, 14], [14, 86], [86, 15], [107, 55], [55, 9], [9, 107], [120, 100], [100, 121], [121, 120], [153, 145], [145, 22], [22, 153], [178, 88], [88, 179], [179, 178], [197, 6], [6, 196], [196, 197], [89, 88], [88, 96], [96, 89], [135, 138], [138, 136], [136, 135], [138, 215], [215, 172], [172, 138], [218, 115], [115, 219], [219, 218], [41, 42], [42, 81], [81, 41], [5, 195], [195, 51], [51, 5], [57, 43], [43, 61], [61, 57], [208, 171], [171, 199], [199, 208], [41, 81], [81, 38], [38, 41], [224, 53], [53, 225], [225, 224], [24, 144], [144, 110], [110, 24], [105, 52], [52, 66], [66, 105], [118, 229], [229, 117], [117, 118], [227, 34], [34, 234], [234, 227], [66, 107], [107, 69], [69, 66], [10, 109], [109, 151], [151, 10], [219, 48], [48, 235], [235, 219], [183, 62], [62, 191], [191, 183], [142, 129], [129, 126], [126, 142], [116, 111], [111, 143], [143, 116], [118, 117], [117, 50], [50, 118], [223, 222], [222, 52], [52, 223], [94, 19], [19, 141], [141, 94], [222, 221], [221, 65], [65, 222], [196, 3], [3, 197], [197, 196], [45, 220], [220, 44], [44, 45], [156, 70], [70, 139], [139, 156], [188, 122], [122, 245], [245, 188], [139, 71], [71, 162], [162, 139], [149, 170], [170, 150], [150, 149], [122, 188], [188, 196], [196, 122], [206, 216], [216, 92], [92, 206], [164, 2], [2, 167], [167, 164], [242, 141], [141, 241], [241, 242], [0, 164], [164, 37], [37, 0], [11, 72], [72, 12], [12, 11], [12, 38], [38, 13], [13, 12], [70, 63], [63, 71], [71, 70], [31, 226], [226, 111], [111, 31], [36, 101], [101, 205], [205, 36], [203, 206], [206, 165], [165, 203], [126, 209], [209, 217], [217, 126], [98, 165], [165, 97], [97, 98], [237, 220], [220, 218], [218, 237], [237, 239], [239, 241], [241, 237], [210, 214], [214, 169], [169, 210], [140, 171], [171, 32], [32, 140], [241, 125], [125, 237], [237, 241], [179, 86], [86, 178], [178, 179], [180, 85], [85, 179], [179, 180], [181, 84], [84, 180], [180, 181], [182, 83], [83, 181], [181, 182], [194, 201], [201, 182], [182, 194], [177, 137], [137, 132], [132, 177], [184, 76], [76, 183], [183, 184], [185, 61], [61, 184], [184, 185], [186, 57], [57, 185], [185, 186], [216, 212], [212, 186], [186, 216], [192, 214], [214, 187], [187, 192], [139, 34], [34, 156], [156, 139], [218, 79], [79, 237], [237, 218], [147, 123], [123, 177], [177, 147], [45, 44], [44, 4], [4, 45], [208, 201], [201, 32], [32, 208], [98, 64], [64, 129], [129, 98], [192, 213], [213, 138], [138, 192], [235, 59], [59, 219], [219, 235], [141, 242], [242, 97], [97, 141], [97, 2], [2, 141], [141, 97], [240, 75], [75, 235], [235, 240], [229, 24], [24, 228], [228, 229], [31, 25], [25, 226], [226, 31], [230, 23], [23, 229], [229, 230], [231, 22], [22, 230], [230, 231], [232, 26], [26, 231], [231, 232], [233, 112], [112, 232], [232, 233], [244, 189], [189, 243], [243, 244], [189, 221], [221, 190], [190, 189], [222, 28], [28, 221], [221, 222], [223, 27], [27, 222], [222, 223], [224, 29], [29, 223], [223, 224], [225, 30], [30, 224], [224, 225], [113, 247], [247, 225], [225, 113], [99, 60], [60, 240], [240, 99], [213, 147], [147, 215], [215, 213], [60, 20], [20, 166], [166, 60], [192, 187], [187, 213], [213, 192], [243, 112], [112, 244], [244, 243], [244, 233], [233, 245], [245, 244], [245, 128], [128, 188], [188, 245], [188, 114], [114, 174], [174, 188], [134, 131], [131, 220], [220, 134], [174, 217], [217, 236], [236, 174], [236, 198], [198, 134], [134, 236], [215, 177], [177, 58], [58, 215], [156, 143], [143, 124], [124, 156], [25, 110], [110, 7], [7, 25], [31, 228], [228, 25], [25, 31], [264, 356], [356, 368], [368, 264], [0, 11], [11, 267], [267, 0], [451, 452], [452, 349], [349, 451], [267, 302], [302, 269], [269, 267], [350, 357], [357, 277], [277, 350], [350, 452], [452, 357], [357, 350], [299, 333], [333, 297], [297, 299], [396, 175], [175, 377], [377, 396], [280, 347], [347, 330], [330, 280], [269, 303], [303, 270], [270, 269], [151, 9], [9, 337], [337, 151], [344, 278], [278, 360], [360, 344], [424, 418], [418, 431], [431, 424], [270, 304], [304, 409], [409, 270], [272, 310], [310, 407], [407, 272], [322, 270], [270, 410], [410, 322], [449, 450], [450, 347], [347, 449], [432, 422], [422, 434], [434, 432], [18, 313], [313, 17], [17, 18], [291, 306], [306, 375], [375, 291], [259, 387], [387, 260], [260, 259], [424, 335], [335, 418], [418, 424], [434, 364], [364, 416], [416, 434], [391, 423], [423, 327], [327, 391], [301, 251], [251, 298], [298, 301], [275, 281], [281, 4], [4, 275], [254, 373], [373, 253], [253, 254], [375, 307], [307, 321], [321, 375], [280, 425], [425, 411], [411, 280], [200, 421], [421, 18], [18, 200], [335, 321], [321, 406], [406, 335], [321, 320], [320, 405], [405, 321], [314, 315], [315, 17], [17, 314], [423, 426], [426, 266], [266, 423], [396, 377], [377, 369], [369, 396], [270, 322], [322, 269], [269, 270], [413, 417], [417, 464], [464, 413], [385, 386], [386, 258], [258, 385], [248, 456], [456, 419], [419, 248], [298, 284], [284, 333], [333, 298], [168, 417], [417, 8], [8, 168], [448, 346], [346, 261], [261, 448], [417, 413], [413, 285], [285, 417], [326, 327], [327, 328], [328, 326], [277, 355], [355, 329], [329, 277], [309, 392], [392, 438], [438, 309], [381, 382], [382, 256], [256, 381], [279, 429], [429, 360], [360, 279], [365, 364], [364, 379], [379, 365], [355, 277], [277, 437], [437, 355], [282, 443], [443, 283], [283, 282], [281, 275], [275, 363], [363, 281], [395, 431], [431, 369], [369, 395], [299, 297], [297, 337], [337, 299], [335, 273], [273, 321], [321, 335], [348, 450], [450, 349], [349, 348], [359, 446], [446, 467], [467, 359], [283, 293], [293, 282], [282, 283], [250, 458], [458, 462], [462, 250], [300, 276], [276, 383], [383, 300], [292, 308], [308, 325], [325, 292], [283, 276], [276, 293], [293, 283], [264, 372], [372, 447], [447, 264], [346, 352], [352, 340], [340, 346], [354, 274], [274, 19], [19, 354], [363, 456], [456, 281], [281, 363], [426, 436], [436, 425], [425, 426], [380, 381], [381, 252], [252, 380], [267, 269], [269, 393], [393, 267], [421, 200], [200, 428], [428, 421], [371, 266], [266, 329], [329, 371], [432, 287], [287, 422], [422, 432], [290, 250], [250, 328], [328, 290], [385, 258], [258, 384], [384, 385], [446, 265], [265, 342], [342, 446], [386, 387], [387, 257], [257, 386], [422, 424], [424, 430], [430, 422], [445, 342], [342, 276], [276, 445], [422, 273], [273, 424], [424, 422], [306, 292], [292, 307], [307, 306], [352, 366], [366, 345], [345, 352], [268, 271], [271, 302], [302, 268], [358, 423], [423, 371], [371, 358], [327, 294], [294, 460], [460, 327], [331, 279], [279, 294], [294, 331], [303, 271], [271, 304], [304, 303], [436, 432], [432, 427], [427, 436], [304, 272], [272, 408], [408, 304], [395, 394], [394, 431], [431, 395], [378, 395], [395, 400], [400, 378], [296, 334], [334, 299], [299, 296], [6, 351], [351, 168], [168, 6], [376, 352], [352, 411], [411, 376], [307, 325], [325, 320], [320, 307], [285, 295], [295, 336], [336, 285], [320, 319], [319, 404], [404, 320], [329, 330], [330, 349], [349, 329], [334, 293], [293, 333], [333, 334], [366, 323], [323, 447], [447, 366], [316, 15], [15, 315], [315, 316], [331, 358], [358, 279], [279, 331], [317, 14], [14, 316], [316, 317], [8, 285], [285, 9], [9, 8], [277, 329], [329, 350], [350, 277], [253, 374], [374, 252], [252, 253], [319, 318], [318, 403], [403, 319], [351, 6], [6, 419], [419, 351], [324, 318], [318, 325], [325, 324], [397, 367], [367, 365], [365, 397], [288, 435], [435, 397], [397, 288], [278, 344], [344, 439], [439, 278], [310, 272], [272, 311], [311, 310], [248, 195], [195, 281], [281, 248], [375, 273], [273, 291], [291, 375], [175, 396], [396, 199], [199, 175], [312, 311], [311, 268], [268, 312], [276, 283], [283, 445], [445, 276], [390, 373], [373, 339], [339, 390], [295, 282], [282, 296], [296, 295], [448, 449], [449, 346], [346, 448], [356, 264], [264, 454], [454, 356], [337, 336], [336, 299], [299, 337], [337, 338], [338, 151], [151, 337], [294, 278], [278, 455], [455, 294], [308, 292], [292, 415], [415, 308], [429, 358], [358, 355], [355, 429], [265, 340], [340, 372], [372, 265], [352, 346], [346, 280], [280, 352], [295, 442], [442, 282], [282, 295], [354, 19], [19, 370], [370, 354], [285, 441], [441, 295], [295, 285], [195, 248], [248, 197], [197, 195], [457, 440], [440, 274], [274, 457], [301, 300], [300, 368], [368, 301], [417, 351], [351, 465], [465, 417], [251, 301], [301, 389], [389, 251], [394, 395], [395, 379], [379, 394], [399, 412], [412, 419], [419, 399], [410, 436], [436, 322], [322, 410], [326, 2], [2, 393], [393, 326], [354, 370], [370, 461], [461, 354], [393, 164], [164, 267], [267, 393], [268, 302], [302, 12], [12, 268], [312, 268], [268, 13], [13, 312], [298, 293], [293, 301], [301, 298], [265, 446], [446, 340], [340, 265], [280, 330], [330, 425], [425, 280], [322, 426], [426, 391], [391, 322], [420, 429], [429, 437], [437, 420], [393, 391], [391, 326], [326, 393], [344, 440], [440, 438], [438, 344], [458, 459], [459, 461], [461, 458], [364, 434], [434, 394], [394, 364], [428, 396], [396, 262], [262, 428], [274, 354], [354, 457], [457, 274], [317, 316], [316, 402], [402, 317], [316, 315], [315, 403], [403, 316], [315, 314], [314, 404], [404, 315], [314, 313], [313, 405], [405, 314], [313, 421], [421, 406], [406, 313], [323, 366], [366, 361], [361, 323], [292, 306], [306, 407], [407, 292], [306, 291], [291, 408], [408, 306], [291, 287], [287, 409], [409, 291], [287, 432], [432, 410], [410, 287], [427, 434], [434, 411], [411, 427], [372, 264], [264, 383], [383, 372], [459, 309], [309, 457], [457, 459], [366, 352], [352, 401], [401, 366], [1, 274], [274, 4], [4, 1], [418, 421], [421, 262], [262, 418], [331, 294], [294, 358], [358, 331], [435, 433], [433, 367], [367, 435], [392, 289], [289, 439], [439, 392], [328, 462], [462, 326], [326, 328], [94, 2], [2, 370], [370, 94], [289, 305], [305, 455], [455, 289], [339, 254], [254, 448], [448, 339], [359, 255], [255, 446], [446, 359], [254, 253], [253, 449], [449, 254], [253, 252], [252, 450], [450, 253], [252, 256], [256, 451], [451, 252], [256, 341], [341, 452], [452, 256], [414, 413], [413, 463], [463, 414], [286, 441], [441, 414], [414, 286], [286, 258], [258, 441], [441, 286], [258, 257], [257, 442], [442, 258], [257, 259], [259, 443], [443, 257], [259, 260], [260, 444], [444, 259], [260, 467], [467, 445], [445, 260], [309, 459], [459, 250], [250, 309], [305, 289], [289, 290], [290, 305], [305, 290], [290, 460], [460, 305], [401, 376], [376, 435], [435, 401], [309, 250], [250, 392], [392, 309], [376, 411], [411, 433], [433, 376], [453, 341], [341, 464], [464, 453], [357, 453], [453, 465], [465, 357], [343, 357], [357, 412], [412, 343], [437, 343], [343, 399], [399, 437], [344, 360], [360, 440], [440, 344], [420, 437], [437, 456], [456, 420], [360, 420], [420, 363], [363, 360], [361, 401], [401, 288], [288, 361], [265, 372], [372, 353], [353, 265], [390, 339], [339, 249], [249, 390], [339, 448], [448, 255], [255, 339]);
2919
- function si(t) {
2920
- t.j = { faceLandmarks: [], faceBlendshapes: [], facialTransformationMatrixes: [] };
2921
- }
2922
- var F = class extends at {
2923
- constructor(t, e) {
2924
- super(new _t(t, e), "image_in", "norm_rect", !1), this.j = { faceLandmarks: [], faceBlendshapes: [], facialTransformationMatrixes: [] }, this.outputFacialTransformationMatrixes = this.outputFaceBlendshapes = !1, y(t = this.h = new Ro(), 0, 1, e = new O()), this.A = new No(), y(this.h, 0, 3, this.A), this.u = new Nn(), y(this.h, 0, 2, this.u), xt(this.u, 4, 1), m(this.u, 2, 0.5), m(this.A, 2, 0.5), m(this.h, 4, 0.5);
2925
- }
2926
- get baseOptions() {
2927
- return A(this.h, O, 1);
2928
- }
2929
- set baseOptions(t) {
2930
- y(this.h, 0, 1, t);
2931
- }
2932
- o(t) {
2933
- return "numFaces" in t && xt(this.u, 4, t.numFaces ?? 1), "minFaceDetectionConfidence" in t && m(this.u, 2, t.minFaceDetectionConfidence ?? 0.5), "minTrackingConfidence" in t && m(this.h, 4, t.minTrackingConfidence ?? 0.5), "minFacePresenceConfidence" in t && m(this.A, 2, t.minFacePresenceConfidence ?? 0.5), "outputFaceBlendshapes" in t && (this.outputFaceBlendshapes = !!t.outputFaceBlendshapes), "outputFacialTransformationMatrixes" in t && (this.outputFacialTransformationMatrixes = !!t.outputFacialTransformationMatrixes), this.l(t);
2934
- }
2935
- F(t, e) {
2936
- return si(this), vt(this, t, e), this.j;
2937
- }
2938
- G(t, e, n) {
2939
- return si(this), Mt(this, t, n, e), this.j;
2940
- }
2941
- m() {
2942
- var t = new ht();
2943
- P(t, "image_in"), P(t, "norm_rect"), E(t, "face_landmarks");
2944
- const e = new ct();
2945
- Lt(e, C2, this.h);
2946
- const n = new Q();
2947
- it(n, 2, "mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"), M(n, "IMAGE:image_in"), M(n, "NORM_RECT:norm_rect"), w(n, "NORM_LANDMARKS:face_landmarks"), n.o(e), gt(t, n), this.g.attachProtoVectorListener("face_landmarks", (s, r) => {
2948
- for (const i of s) s = tn(i), this.j.faceLandmarks.push(Rn(s));
2949
- l(this, r);
2950
- }), this.g.attachEmptyPacketListener("face_landmarks", (s) => {
2951
- l(this, s);
2952
- }), this.outputFaceBlendshapes && (E(t, "blendshapes"), w(n, "BLENDSHAPES:blendshapes"), this.g.attachProtoVectorListener("blendshapes", (s, r) => {
2953
- if (this.outputFaceBlendshapes) for (const i of s) s = xn(i), this.j.faceBlendshapes.push(tr(s.g() ?? []));
2954
- l(this, r);
2955
- }), this.g.attachEmptyPacketListener("blendshapes", (s) => {
2956
- l(this, s);
2957
- })), this.outputFacialTransformationMatrixes && (E(t, "face_geometry"), w(n, "FACE_GEOMETRY:face_geometry"), this.g.attachProtoVectorListener("face_geometry", (s, r) => {
2958
- if (this.outputFacialTransformationMatrixes) for (const i of s) (s = A(s = R2(i), L2, 2)) && this.j.facialTransformationMatrixes.push({ rows: dt(s, 1) ?? 0 ?? 0, columns: dt(s, 2) ?? 0 ?? 0, data: qt(s, 3, At, Wt()).slice() ?? [] });
2959
- l(this, r);
2960
- }), this.g.attachEmptyPacketListener("face_geometry", (s) => {
2961
- l(this, s);
2962
- })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
2963
- }
2964
- };
2965
- F.prototype.detectForVideo = F.prototype.G, F.prototype.detect = F.prototype.F, F.prototype.setOptions = F.prototype.o, F.createFromModelPath = function(t, e) {
2966
- return b(F, t, { baseOptions: { modelAssetPath: e } });
2967
- }, F.createFromModelBuffer = function(t, e) {
2968
- return b(F, t, { baseOptions: { modelAssetBuffer: e } });
2969
- }, F.createFromOptions = function(t, e) {
2970
- return b(F, t, e);
2971
- }, F.FACE_LANDMARKS_LIPS = sr, F.FACE_LANDMARKS_LEFT_EYE = rr, F.FACE_LANDMARKS_LEFT_EYEBROW = ir, F.FACE_LANDMARKS_LEFT_IRIS = ua, F.FACE_LANDMARKS_RIGHT_EYE = or, F.FACE_LANDMARKS_RIGHT_EYEBROW = ar, F.FACE_LANDMARKS_RIGHT_IRIS = la, F.FACE_LANDMARKS_FACE_OVAL = cr, F.FACE_LANDMARKS_CONTOURS = fa, F.FACE_LANDMARKS_TESSELATION = da;
2972
- var hr = yt([0, 1], [1, 2], [2, 3], [3, 4], [0, 5], [5, 6], [6, 7], [7, 8], [5, 9], [9, 10], [10, 11], [11, 12], [9, 13], [13, 14], [14, 15], [15, 16], [13, 17], [0, 17], [17, 18], [18, 19], [19, 20]);
2973
- function ri(t) {
2974
- t.gestures = [], t.landmarks = [], t.worldLandmarks = [], t.handedness = [];
2975
- }
2976
- function ii(t) {
2977
- return t.gestures.length === 0 ? { gestures: [], landmarks: [], worldLandmarks: [], handedness: [], handednesses: [] } : { gestures: t.gestures, landmarks: t.landmarks, worldLandmarks: t.worldLandmarks, handedness: t.handedness, handednesses: t.handedness };
2978
- }
2979
- function oi(t, e = !0) {
2980
- const n = [];
2981
- for (const r of t) {
2982
- var s = xn(r);
2983
- t = [];
2984
- for (const i of s.g()) s = e && dt(i, 1) != null ? dt(i, 1) ?? 0 : -1, t.push({ score: N(i, 2) ?? 0, index: s, categoryName: z(T(i, 3)) ?? "" ?? "", displayName: z(T(i, 4)) ?? "" ?? "" });
2985
- n.push(t);
2986
- }
2987
- return n;
2988
- }
2989
- var Z = class extends at {
2990
- constructor(t, e) {
2991
- super(new _t(t, e), "image_in", "norm_rect", !1), this.gestures = [], this.landmarks = [], this.worldLandmarks = [], this.handedness = [], y(t = this.j = new Do(), 0, 1, e = new O()), this.u = new $s(), y(this.j, 0, 2, this.u), this.D = new Xs(), y(this.u, 0, 3, this.D), this.A = new Bo(), y(this.u, 0, 2, this.A), this.h = new B2(), y(this.j, 0, 3, this.h), m(this.A, 2, 0.5), m(this.u, 4, 0.5), m(this.D, 2, 0.5);
2992
- }
2993
- get baseOptions() {
2994
- return A(this.j, O, 1);
2995
- }
2996
- set baseOptions(t) {
2997
- y(this.j, 0, 1, t);
2998
- }
2999
- o(t) {
3000
- var r, i, o, a;
3001
- if (xt(this.A, 3, t.numHands ?? 1), "minHandDetectionConfidence" in t && m(this.A, 2, t.minHandDetectionConfidence ?? 0.5), "minTrackingConfidence" in t && m(this.u, 4, t.minTrackingConfidence ?? 0.5), "minHandPresenceConfidence" in t && m(this.D, 2, t.minHandPresenceConfidence ?? 0.5), t.cannedGesturesClassifierOptions) {
3002
- var e = new oe(), n = e, s = as(t.cannedGesturesClassifierOptions, (r = A(this.h, oe, 3)) == null ? void 0 : r.l());
3003
- y(n, 0, 2, s), y(this.h, 0, 3, e);
3004
- } else t.cannedGesturesClassifierOptions === void 0 && ((i = A(this.h, oe, 3)) == null || i.g());
3005
- return t.customGesturesClassifierOptions ? (y(n = e = new oe(), 0, 2, s = as(t.customGesturesClassifierOptions, (o = A(this.h, oe, 4)) == null ? void 0 : o.l())), y(this.h, 0, 4, e)) : t.customGesturesClassifierOptions === void 0 && ((a = A(this.h, oe, 4)) == null || a.g()), this.l(t);
3006
- }
3007
- Ha(t, e) {
3008
- return ri(this), vt(this, t, e), ii(this);
3009
- }
3010
- Ia(t, e, n) {
3011
- return ri(this), Mt(this, t, n, e), ii(this);
3012
- }
3013
- m() {
3014
- var t = new ht();
3015
- P(t, "image_in"), P(t, "norm_rect"), E(t, "hand_gestures"), E(t, "hand_landmarks"), E(t, "world_hand_landmarks"), E(t, "handedness");
3016
- const e = new ct();
3017
- Lt(e, D2, this.j);
3018
- const n = new Q();
3019
- it(n, 2, "mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"), M(n, "IMAGE:image_in"), M(n, "NORM_RECT:norm_rect"), w(n, "HAND_GESTURES:hand_gestures"), w(n, "LANDMARKS:hand_landmarks"), w(n, "WORLD_LANDMARKS:world_hand_landmarks"), w(n, "HANDEDNESS:handedness"), n.o(e), gt(t, n), this.g.attachProtoVectorListener("hand_landmarks", (s, r) => {
3020
- for (const i of s) {
3021
- s = tn(i);
3022
- const o = [];
3023
- for (const a of Ot(s, Fo, 1)) o.push({ x: N(a, 1) ?? 0, y: N(a, 2) ?? 0, z: N(a, 3) ?? 0, visibility: N(a, 4) ?? 0 });
3024
- this.landmarks.push(o);
3025
- }
3026
- l(this, r);
3027
- }), this.g.attachEmptyPacketListener("hand_landmarks", (s) => {
3028
- l(this, s);
3029
- }), this.g.attachProtoVectorListener("world_hand_landmarks", (s, r) => {
3030
- for (const i of s) {
3031
- s = he(i);
3032
- const o = [];
3033
- for (const a of Ot(s, Mo, 1)) o.push({ x: N(a, 1) ?? 0, y: N(a, 2) ?? 0, z: N(a, 3) ?? 0, visibility: N(a, 4) ?? 0 });
3034
- this.worldLandmarks.push(o);
3035
- }
3036
- l(this, r);
3037
- }), this.g.attachEmptyPacketListener("world_hand_landmarks", (s) => {
3038
- l(this, s);
3039
- }), this.g.attachProtoVectorListener("hand_gestures", (s, r) => {
3040
- this.gestures.push(...oi(s, !1)), l(this, r);
3041
- }), this.g.attachEmptyPacketListener("hand_gestures", (s) => {
3042
- l(this, s);
3043
- }), this.g.attachProtoVectorListener("handedness", (s, r) => {
3044
- this.handedness.push(...oi(s)), l(this, r);
3045
- }), this.g.attachEmptyPacketListener("handedness", (s) => {
3046
- l(this, s);
3047
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3048
- }
3049
- };
3050
- function ai(t) {
3051
- return { landmarks: t.landmarks, worldLandmarks: t.worldLandmarks, handednesses: t.handedness, handedness: t.handedness };
3052
- }
3053
- Z.prototype.recognizeForVideo = Z.prototype.Ia, Z.prototype.recognize = Z.prototype.Ha, Z.prototype.setOptions = Z.prototype.o, Z.createFromModelPath = function(t, e) {
3054
- return b(Z, t, { baseOptions: { modelAssetPath: e } });
3055
- }, Z.createFromModelBuffer = function(t, e) {
3056
- return b(Z, t, { baseOptions: { modelAssetBuffer: e } });
3057
- }, Z.createFromOptions = function(t, e) {
3058
- return b(Z, t, e);
3059
- }, Z.HAND_CONNECTIONS = hr;
3060
- var J = class extends at {
3061
- constructor(t, e) {
3062
- super(new _t(t, e), "image_in", "norm_rect", !1), this.landmarks = [], this.worldLandmarks = [], this.handedness = [], y(t = this.h = new $s(), 0, 1, e = new O()), this.u = new Xs(), y(this.h, 0, 3, this.u), this.j = new Bo(), y(this.h, 0, 2, this.j), xt(this.j, 3, 1), m(this.j, 2, 0.5), m(this.u, 2, 0.5), m(this.h, 4, 0.5);
3063
- }
3064
- get baseOptions() {
3065
- return A(this.h, O, 1);
3066
- }
3067
- set baseOptions(t) {
3068
- y(this.h, 0, 1, t);
3069
- }
3070
- o(t) {
3071
- return "numHands" in t && xt(this.j, 3, t.numHands ?? 1), "minHandDetectionConfidence" in t && m(this.j, 2, t.minHandDetectionConfidence ?? 0.5), "minTrackingConfidence" in t && m(this.h, 4, t.minTrackingConfidence ?? 0.5), "minHandPresenceConfidence" in t && m(this.u, 2, t.minHandPresenceConfidence ?? 0.5), this.l(t);
3072
- }
3073
- F(t, e) {
3074
- return this.landmarks = [], this.worldLandmarks = [], this.handedness = [], vt(this, t, e), ai(this);
3075
- }
3076
- G(t, e, n) {
3077
- return this.landmarks = [], this.worldLandmarks = [], this.handedness = [], Mt(this, t, n, e), ai(this);
3078
- }
3079
- m() {
3080
- var t = new ht();
3081
- P(t, "image_in"), P(t, "norm_rect"), E(t, "hand_landmarks"), E(t, "world_hand_landmarks"), E(t, "handedness");
3082
- const e = new ct();
3083
- Lt(e, U2, this.h);
3084
- const n = new Q();
3085
- it(n, 2, "mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"), M(n, "IMAGE:image_in"), M(n, "NORM_RECT:norm_rect"), w(n, "LANDMARKS:hand_landmarks"), w(n, "WORLD_LANDMARKS:world_hand_landmarks"), w(n, "HANDEDNESS:handedness"), n.o(e), gt(t, n), this.g.attachProtoVectorListener("hand_landmarks", (s, r) => {
3086
- for (const i of s) s = tn(i), this.landmarks.push(Rn(s));
3087
- l(this, r);
3088
- }), this.g.attachEmptyPacketListener("hand_landmarks", (s) => {
3089
- l(this, s);
3090
- }), this.g.attachProtoVectorListener("world_hand_landmarks", (s, r) => {
3091
- for (const i of s) s = he(i), this.worldLandmarks.push(Ge(s));
3092
- l(this, r);
3093
- }), this.g.attachEmptyPacketListener("world_hand_landmarks", (s) => {
3094
- l(this, s);
3095
- }), this.g.attachProtoVectorListener("handedness", (s, r) => {
3096
- var i = this.handedness, o = i.push;
3097
- const a = [];
3098
- for (const c of s) {
3099
- s = xn(c);
3100
- const u = [];
3101
- for (const h of s.g()) u.push({ score: N(h, 2) ?? 0, index: dt(h, 1) ?? 0 ?? -1, categoryName: z(T(h, 3)) ?? "" ?? "", displayName: z(T(h, 4)) ?? "" ?? "" });
3102
- a.push(u);
3103
- }
3104
- o.call(i, ...a), l(this, r);
3105
- }), this.g.attachEmptyPacketListener("handedness", (s) => {
3106
- l(this, s);
3107
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3108
- }
3109
- };
3110
- J.prototype.detectForVideo = J.prototype.G, J.prototype.detect = J.prototype.F, J.prototype.setOptions = J.prototype.o, J.createFromModelPath = function(t, e) {
3111
- return b(J, t, { baseOptions: { modelAssetPath: e } });
3112
- }, J.createFromModelBuffer = function(t, e) {
3113
- return b(J, t, { baseOptions: { modelAssetBuffer: e } });
3114
- }, J.createFromOptions = function(t, e) {
3115
- return b(J, t, e);
3116
- }, J.HAND_CONNECTIONS = hr;
3117
- var pa = yt([0, 1], [1, 2], [2, 3], [3, 7], [0, 4], [4, 5], [5, 6], [6, 8], [9, 10], [11, 12], [11, 13], [13, 15], [15, 17], [15, 19], [15, 21], [17, 19], [12, 14], [14, 16], [16, 18], [16, 20], [16, 22], [18, 20], [11, 23], [12, 24], [23, 24], [23, 25], [24, 26], [25, 27], [26, 28], [27, 29], [28, 30], [29, 31], [30, 32], [27, 31], [28, 32]);
3118
- function ci(t) {
3119
- t.h = { faceLandmarks: [], faceBlendshapes: [], poseLandmarks: [], poseWorldLandmarks: [], poseSegmentationMasks: [], leftHandLandmarks: [], leftHandWorldLandmarks: [], rightHandLandmarks: [], rightHandWorldLandmarks: [] };
3120
- }
3121
- function hi(t) {
3122
- try {
3123
- if (!t.D) return t.h;
3124
- t.D(t.h);
3125
- } finally {
3126
- Bn(t);
3127
- }
3128
- }
3129
- function rn(t, e) {
3130
- t = tn(t), e.push(Rn(t));
3131
- }
3132
- var L = class extends at {
3133
- constructor(t, e) {
3134
- super(new _t(t, e), "input_frames_image", null, !1), this.h = { faceLandmarks: [], faceBlendshapes: [], poseLandmarks: [], poseWorldLandmarks: [], poseSegmentationMasks: [], leftHandLandmarks: [], leftHandWorldLandmarks: [], rightHandLandmarks: [], rightHandWorldLandmarks: [] }, this.outputPoseSegmentationMasks = this.outputFaceBlendshapes = !1, y(t = this.j = new Ho(), 0, 1, e = new O()), this.I = new Xs(), y(this.j, 0, 2, this.I), this.W = new V2(), y(this.j, 0, 3, this.W), this.u = new Nn(), y(this.j, 0, 4, this.u), this.O = new No(), y(this.j, 0, 5, this.O), this.A = new Go(), y(this.j, 0, 6, this.A), this.M = new jo(), y(this.j, 0, 7, this.M), m(this.u, 2, 0.5), m(this.u, 3, 0.3), m(this.O, 2, 0.5), m(this.A, 2, 0.5), m(this.A, 3, 0.3), m(this.M, 2, 0.5), m(this.I, 2, 0.5);
3135
- }
3136
- get baseOptions() {
3137
- return A(this.j, O, 1);
3138
- }
3139
- set baseOptions(t) {
3140
- y(this.j, 0, 1, t);
3141
- }
3142
- o(t) {
3143
- return "minFaceDetectionConfidence" in t && m(this.u, 2, t.minFaceDetectionConfidence ?? 0.5), "minFaceSuppressionThreshold" in t && m(this.u, 3, t.minFaceSuppressionThreshold ?? 0.3), "minFacePresenceConfidence" in t && m(this.O, 2, t.minFacePresenceConfidence ?? 0.5), "outputFaceBlendshapes" in t && (this.outputFaceBlendshapes = !!t.outputFaceBlendshapes), "minPoseDetectionConfidence" in t && m(this.A, 2, t.minPoseDetectionConfidence ?? 0.5), "minPoseSuppressionThreshold" in t && m(this.A, 3, t.minPoseSuppressionThreshold ?? 0.3), "minPosePresenceConfidence" in t && m(this.M, 2, t.minPosePresenceConfidence ?? 0.5), "outputPoseSegmentationMasks" in t && (this.outputPoseSegmentationMasks = !!t.outputPoseSegmentationMasks), "minHandLandmarksConfidence" in t && m(this.I, 2, t.minHandLandmarksConfidence ?? 0.5), this.l(t);
3144
- }
3145
- F(t, e, n) {
3146
- const s = typeof e != "function" ? e : {};
3147
- return this.D = typeof e == "function" ? e : n, ci(this), vt(this, t, s), hi(this);
3148
- }
3149
- G(t, e, n, s) {
3150
- const r = typeof n != "function" ? n : {};
3151
- return this.D = typeof n == "function" ? n : s, ci(this), Mt(this, t, r, e), hi(this);
3152
- }
3153
- m() {
3154
- var t = new ht();
3155
- P(t, "input_frames_image"), E(t, "pose_landmarks"), E(t, "pose_world_landmarks"), E(t, "face_landmarks"), E(t, "left_hand_landmarks"), E(t, "left_hand_world_landmarks"), E(t, "right_hand_landmarks"), E(t, "right_hand_world_landmarks");
3156
- const e = new ct(), n = new xr();
3157
- it(n, 1, "type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"), function(r, i) {
3158
- if (i != null) if (Array.isArray(i)) k(r, 2, bn(i, 0, qe));
3159
- else {
3160
- if (!(typeof i == "string" || i instanceof Et || ms(i))) throw Error("invalid value in Any.value field: " + i + " expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");
3161
- Bt(r, 2, _s(i, !1), Qt());
3162
- }
3163
- }(n, this.j.g());
3164
- const s = new Q();
3165
- it(s, 2, "mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"), xs(s, 8, xr, n), M(s, "IMAGE:input_frames_image"), w(s, "POSE_LANDMARKS:pose_landmarks"), w(s, "POSE_WORLD_LANDMARKS:pose_world_landmarks"), w(s, "FACE_LANDMARKS:face_landmarks"), w(s, "LEFT_HAND_LANDMARKS:left_hand_landmarks"), w(s, "LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"), w(s, "RIGHT_HAND_LANDMARKS:right_hand_landmarks"), w(s, "RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"), s.o(e), gt(t, s), Cn(this, t), this.g.attachProtoListener("pose_landmarks", (r, i) => {
3166
- rn(r, this.h.poseLandmarks), l(this, i);
3167
- }), this.g.attachEmptyPacketListener("pose_landmarks", (r) => {
3168
- l(this, r);
3169
- }), this.g.attachProtoListener("pose_world_landmarks", (r, i) => {
3170
- var o = this.h.poseWorldLandmarks;
3171
- r = he(r), o.push(Ge(r)), l(this, i);
3172
- }), this.g.attachEmptyPacketListener("pose_world_landmarks", (r) => {
3173
- l(this, r);
3174
- }), this.outputPoseSegmentationMasks && (w(s, "POSE_SEGMENTATION_MASK:pose_segmentation_mask"), ve(this, "pose_segmentation_mask"), this.g.Z("pose_segmentation_mask", (r, i) => {
3175
- this.h.poseSegmentationMasks = [be(this, r, !0, !this.D)], l(this, i);
3176
- }), this.g.attachEmptyPacketListener("pose_segmentation_mask", (r) => {
3177
- this.h.poseSegmentationMasks = [], l(this, r);
3178
- })), this.g.attachProtoListener("face_landmarks", (r, i) => {
3179
- rn(r, this.h.faceLandmarks), l(this, i);
3180
- }), this.g.attachEmptyPacketListener("face_landmarks", (r) => {
3181
- l(this, r);
3182
- }), this.outputFaceBlendshapes && (E(t, "extra_blendshapes"), w(s, "FACE_BLENDSHAPES:extra_blendshapes"), this.g.attachProtoListener("extra_blendshapes", (r, i) => {
3183
- var o = this.h.faceBlendshapes;
3184
- this.outputFaceBlendshapes && (r = xn(r), o.push(tr(r.g() ?? []))), l(this, i);
3185
- }), this.g.attachEmptyPacketListener("extra_blendshapes", (r) => {
3186
- l(this, r);
3187
- })), this.g.attachProtoListener("left_hand_landmarks", (r, i) => {
3188
- rn(r, this.h.leftHandLandmarks), l(this, i);
3189
- }), this.g.attachEmptyPacketListener("left_hand_landmarks", (r) => {
3190
- l(this, r);
3191
- }), this.g.attachProtoListener("left_hand_world_landmarks", (r, i) => {
3192
- var o = this.h.leftHandWorldLandmarks;
3193
- r = he(r), o.push(Ge(r)), l(this, i);
3194
- }), this.g.attachEmptyPacketListener("left_hand_world_landmarks", (r) => {
3195
- l(this, r);
3196
- }), this.g.attachProtoListener("right_hand_landmarks", (r, i) => {
3197
- rn(r, this.h.rightHandLandmarks), l(this, i);
3198
- }), this.g.attachEmptyPacketListener("right_hand_landmarks", (r) => {
3199
- l(this, r);
3200
- }), this.g.attachProtoListener("right_hand_world_landmarks", (r, i) => {
3201
- var o = this.h.rightHandWorldLandmarks;
3202
- r = he(r), o.push(Ge(r)), l(this, i);
3203
- }), this.g.attachEmptyPacketListener("right_hand_world_landmarks", (r) => {
3204
- l(this, r);
3205
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3206
- }
3207
- };
3208
- L.prototype.detectForVideo = L.prototype.G, L.prototype.detect = L.prototype.F, L.prototype.setOptions = L.prototype.o, L.createFromModelPath = function(t, e) {
3209
- return b(L, t, { baseOptions: { modelAssetPath: e } });
3210
- }, L.createFromModelBuffer = function(t, e) {
3211
- return b(L, t, { baseOptions: { modelAssetBuffer: e } });
3212
- }, L.createFromOptions = function(t, e) {
3213
- return b(L, t, e);
3214
- }, L.HAND_CONNECTIONS = hr, L.POSE_CONNECTIONS = pa, L.FACE_LANDMARKS_LIPS = sr, L.FACE_LANDMARKS_LEFT_EYE = rr, L.FACE_LANDMARKS_LEFT_EYEBROW = ir, L.FACE_LANDMARKS_LEFT_IRIS = ua, L.FACE_LANDMARKS_RIGHT_EYE = or, L.FACE_LANDMARKS_RIGHT_EYEBROW = ar, L.FACE_LANDMARKS_RIGHT_IRIS = la, L.FACE_LANDMARKS_FACE_OVAL = cr, L.FACE_LANDMARKS_CONTOURS = fa, L.FACE_LANDMARKS_TESSELATION = da;
3215
- var lt = class extends at {
3216
- constructor(t, e) {
3217
- super(new _t(t, e), "input_image", "norm_rect", !0), this.j = { classifications: [] }, y(t = this.h = new Ko(), 0, 1, e = new O());
3218
- }
3219
- get baseOptions() {
3220
- return A(this.h, O, 1);
3221
- }
3222
- set baseOptions(t) {
3223
- y(this.h, 0, 1, t);
3224
- }
3225
- o(t) {
3226
- return y(this.h, 0, 2, as(t, A(this.h, zs, 2))), this.l(t);
3227
- }
3228
- sa(t, e) {
3229
- return this.j = { classifications: [] }, vt(this, t, e), this.j;
3230
- }
3231
- ta(t, e, n) {
3232
- return this.j = { classifications: [] }, Mt(this, t, n, e), this.j;
3233
- }
3234
- m() {
3235
- var t = new ht();
3236
- P(t, "input_image"), P(t, "norm_rect"), E(t, "classifications");
3237
- const e = new ct();
3238
- Lt(e, G2, this.h);
3239
- const n = new Q();
3240
- it(n, 2, "mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"), M(n, "IMAGE:input_image"), M(n, "NORM_RECT:norm_rect"), w(n, "CLASSIFICATIONS:classifications"), n.o(e), gt(t, n), this.g.attachProtoListener("classifications", (s, r) => {
3241
- this.j = z2(F2(s)), l(this, r);
3242
- }), this.g.attachEmptyPacketListener("classifications", (s) => {
3243
- l(this, s);
3244
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3245
- }
3246
- };
3247
- lt.prototype.classifyForVideo = lt.prototype.ta, lt.prototype.classify = lt.prototype.sa, lt.prototype.setOptions = lt.prototype.o, lt.createFromModelPath = function(t, e) {
3248
- return b(lt, t, { baseOptions: { modelAssetPath: e } });
3249
- }, lt.createFromModelBuffer = function(t, e) {
3250
- return b(lt, t, { baseOptions: { modelAssetBuffer: e } });
3251
- }, lt.createFromOptions = function(t, e) {
3252
- return b(lt, t, e);
3253
- };
3254
- var tt = class extends at {
3255
- constructor(t, e) {
3256
- super(new _t(t, e), "image_in", "norm_rect", !0), this.h = new Wo(), this.embeddings = { embeddings: [] }, y(t = this.h, 0, 1, e = new O());
3257
- }
3258
- get baseOptions() {
3259
- return A(this.h, O, 1);
3260
- }
3261
- set baseOptions(t) {
3262
- y(this.h, 0, 1, t);
3263
- }
3264
- o(t) {
3265
- var e = this.h, n = A(this.h, jr, 2);
3266
- return n = n ? n.clone() : new jr(), t.l2Normalize !== void 0 ? k(n, 1, We(t.l2Normalize)) : "l2Normalize" in t && k(n, 1), t.quantize !== void 0 ? k(n, 2, We(t.quantize)) : "quantize" in t && k(n, 2), y(e, 0, 2, n), this.l(t);
3267
- }
3268
- za(t, e) {
3269
- return vt(this, t, e), this.embeddings;
3270
- }
3271
- Aa(t, e, n) {
3272
- return Mt(this, t, n, e), this.embeddings;
3273
- }
3274
- m() {
3275
- var t = new ht();
3276
- P(t, "image_in"), P(t, "norm_rect"), E(t, "embeddings_out");
3277
- const e = new ct();
3278
- Lt(e, j2, this.h);
3279
- const n = new Q();
3280
- it(n, 2, "mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"), M(n, "IMAGE:image_in"), M(n, "NORM_RECT:norm_rect"), w(n, "EMBEDDINGS:embeddings_out"), n.o(e), gt(t, n), this.g.attachProtoListener("embeddings_out", (s, r) => {
3281
- s = O2(s), this.embeddings = function(i) {
3282
- return { embeddings: Ot(i, P2, 1).map((o) => {
3283
- var u, h;
3284
- const a = { headIndex: dt(o, 3) ?? 0 ?? -1, headName: z(T(o, 4)) ?? "" ?? "" };
3285
- var c = o.v;
3286
- return Vi(c, 0 | c[d], Gr, Hn(o, 1)) !== void 0 ? (o = qt(o = A(o, Gr, Hn(o, 1), void 0), 1, At, Wt()), a.floatEmbedding = o.slice()) : (c = new Uint8Array(0), a.quantizedEmbedding = ((h = (u = A(o, I2, Hn(o, 2), void 0)) == null ? void 0 : u.na()) == null ? void 0 : h.h()) ?? c), a;
3287
- }), timestampMs: Qo(Hi(i)) };
3288
- }(s), l(this, r);
3289
- }), this.g.attachEmptyPacketListener("embeddings_out", (s) => {
3290
- l(this, s);
3291
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3292
- }
3293
- };
3294
- tt.cosineSimilarity = function(t, e) {
3295
- if (t.floatEmbedding && e.floatEmbedding) t = Yr(t.floatEmbedding, e.floatEmbedding);
3296
- else {
3297
- if (!t.quantizedEmbedding || !e.quantizedEmbedding) throw Error("Cannot compute cosine similarity between quantized and float embeddings.");
3298
- t = Yr(zr(t.quantizedEmbedding), zr(e.quantizedEmbedding));
3299
- }
3300
- return t;
3301
- }, tt.prototype.embedForVideo = tt.prototype.Aa, tt.prototype.embed = tt.prototype.za, tt.prototype.setOptions = tt.prototype.o, tt.createFromModelPath = function(t, e) {
3302
- return b(tt, t, { baseOptions: { modelAssetPath: e } });
3303
- }, tt.createFromModelBuffer = function(t, e) {
3304
- return b(tt, t, { baseOptions: { modelAssetBuffer: e } });
3305
- }, tt.createFromOptions = function(t, e) {
3306
- return b(tt, t, e);
3307
- };
3308
- var ls = class {
3309
- constructor(t, e, n) {
3310
- this.confidenceMasks = t, this.categoryMask = e, this.qualityScores = n;
3311
- }
3312
- close() {
3313
- var t, e;
3314
- (t = this.confidenceMasks) == null || t.forEach((n) => {
3315
- n.close();
3316
- }), (e = this.categoryMask) == null || e.close();
3317
- }
3318
- };
3319
- function t1(t) {
3320
- var n, s;
3321
- const e = function(r) {
3322
- return Ot(r, Q, 1);
3323
- }(t.ca()).filter((r) => (z(T(r, 1)) ?? "").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));
3324
- if (t.u = [], e.length > 1) throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");
3325
- e.length === 1 && (((s = (n = A(e[0], ct, 7)) == null ? void 0 : n.j()) == null ? void 0 : s.g()) ?? /* @__PURE__ */ new Map()).forEach((r, i) => {
3326
- t.u[Number(i)] = z(T(r, 1)) ?? "";
3327
- });
3328
- }
3329
- function ui(t) {
3330
- t.categoryMask = void 0, t.confidenceMasks = void 0, t.qualityScores = void 0;
3331
- }
3332
- function li(t) {
3333
- try {
3334
- const e = new ls(t.confidenceMasks, t.categoryMask, t.qualityScores);
3335
- if (!t.j) return e;
3336
- t.j(e);
3337
- } finally {
3338
- Bn(t);
3339
- }
3340
- }
3341
- ls.prototype.close = ls.prototype.close;
3342
- var $ = class extends at {
3343
- constructor(t, e) {
3344
- super(new _t(t, e), "image_in", "norm_rect", !1), this.u = [], this.outputCategoryMask = !1, this.outputConfidenceMasks = !0, this.h = new Zs(), this.A = new qo(), y(this.h, 0, 3, this.A), y(t = this.h, 0, 1, e = new O());
3345
- }
3346
- get baseOptions() {
3347
- return A(this.h, O, 1);
3348
- }
3349
- set baseOptions(t) {
3350
- y(this.h, 0, 1, t);
3351
- }
3352
- o(t) {
3353
- return t.displayNamesLocale !== void 0 ? k(this.h, 2, Je(t.displayNamesLocale)) : "displayNamesLocale" in t && k(this.h, 2), "outputCategoryMask" in t && (this.outputCategoryMask = t.outputCategoryMask ?? !1), "outputConfidenceMasks" in t && (this.outputConfidenceMasks = t.outputConfidenceMasks ?? !0), super.l(t);
3354
- }
3355
- L() {
3356
- t1(this);
3357
- }
3358
- segment(t, e, n) {
3359
- const s = typeof e != "function" ? e : {};
3360
- return this.j = typeof e == "function" ? e : n, ui(this), vt(this, t, s), li(this);
3361
- }
3362
- La(t, e, n, s) {
3363
- const r = typeof n != "function" ? n : {};
3364
- return this.j = typeof n == "function" ? n : s, ui(this), Mt(this, t, r, e), li(this);
3365
- }
3366
- Da() {
3367
- return this.u;
3368
- }
3369
- m() {
3370
- var t = new ht();
3371
- P(t, "image_in"), P(t, "norm_rect");
3372
- const e = new ct();
3373
- Lt(e, Yo, this.h);
3374
- const n = new Q();
3375
- it(n, 2, "mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"), M(n, "IMAGE:image_in"), M(n, "NORM_RECT:norm_rect"), n.o(e), gt(t, n), Cn(this, t), this.outputConfidenceMasks && (E(t, "confidence_masks"), w(n, "CONFIDENCE_MASKS:confidence_masks"), ve(this, "confidence_masks"), this.g.aa("confidence_masks", (s, r) => {
3376
- this.confidenceMasks = s.map((i) => be(this, i, !0, !this.j)), l(this, r);
3377
- }), this.g.attachEmptyPacketListener("confidence_masks", (s) => {
3378
- this.confidenceMasks = [], l(this, s);
3379
- })), this.outputCategoryMask && (E(t, "category_mask"), w(n, "CATEGORY_MASK:category_mask"), ve(this, "category_mask"), this.g.Z("category_mask", (s, r) => {
3380
- this.categoryMask = be(this, s, !1, !this.j), l(this, r);
3381
- }), this.g.attachEmptyPacketListener("category_mask", (s) => {
3382
- this.categoryMask = void 0, l(this, s);
3383
- })), E(t, "quality_scores"), w(n, "QUALITY_SCORES:quality_scores"), this.g.attachFloatVectorListener("quality_scores", (s, r) => {
3384
- this.qualityScores = s, l(this, r);
3385
- }), this.g.attachEmptyPacketListener("quality_scores", (s) => {
3386
- this.categoryMask = void 0, l(this, s);
3387
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3388
- }
3389
- };
3390
- $.prototype.getLabels = $.prototype.Da, $.prototype.segmentForVideo = $.prototype.La, $.prototype.segment = $.prototype.segment, $.prototype.setOptions = $.prototype.o, $.createFromModelPath = function(t, e) {
3391
- return b($, t, { baseOptions: { modelAssetPath: e } });
3392
- }, $.createFromModelBuffer = function(t, e) {
3393
- return b($, t, { baseOptions: { modelAssetBuffer: e } });
3394
- }, $.createFromOptions = function(t, e) {
3395
- return b($, t, e);
3396
- };
3397
- var fs = class {
3398
- constructor(t, e, n) {
3399
- this.confidenceMasks = t, this.categoryMask = e, this.qualityScores = n;
3400
- }
3401
- close() {
3402
- var t, e;
3403
- (t = this.confidenceMasks) == null || t.forEach((n) => {
3404
- n.close();
3405
- }), (e = this.categoryMask) == null || e.close();
3406
- }
3407
- };
3408
- fs.prototype.close = fs.prototype.close;
3409
- var bt = class extends at {
3410
- constructor(t, e) {
3411
- super(new _t(t, e), "image_in", "norm_rect_in", !1), this.outputCategoryMask = !1, this.outputConfidenceMasks = !0, this.h = new Zs(), this.u = new qo(), y(this.h, 0, 3, this.u), y(t = this.h, 0, 1, e = new O());
3412
- }
3413
- get baseOptions() {
3414
- return A(this.h, O, 1);
3415
- }
3416
- set baseOptions(t) {
3417
- y(this.h, 0, 1, t);
3418
- }
3419
- o(t) {
3420
- return "outputCategoryMask" in t && (this.outputCategoryMask = t.outputCategoryMask ?? !1), "outputConfidenceMasks" in t && (this.outputConfidenceMasks = t.outputConfidenceMasks ?? !0), super.l(t);
3421
- }
3422
- segment(t, e, n, s) {
3423
- const r = typeof n != "function" ? n : {};
3424
- if (this.j = typeof n == "function" ? n : s, this.qualityScores = this.categoryMask = this.confidenceMasks = void 0, n = this.C + 1, s = new Xo(), e.keypoint && e.scribble) throw Error("Cannot provide both keypoint and scribble.");
3425
- if (e.keypoint) {
3426
- var i = new zn();
3427
- Bt(i, 3, We(!0), !1), Bt(i, 1, De(e.keypoint.x), 0), Bt(i, 2, De(e.keypoint.y), 0), Ue(s, 1, os, i);
3428
- } else {
3429
- if (!e.scribble) throw Error("Must provide either a keypoint or a scribble.");
3430
- {
3431
- const a = new K2();
3432
- for (i of e.scribble) Bt(e = new zn(), 3, We(!0), !1), Bt(e, 1, De(i.x), 0), Bt(e, 2, De(i.y), 0), xs(a, 1, zn, e);
3433
- Ue(s, 2, os, a);
3434
- }
3435
- }
3436
- this.g.addProtoToStream(s.g(), "mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest", "roi_in", n), vt(this, t, r);
3437
- t: {
3438
- try {
3439
- const a = new fs(this.confidenceMasks, this.categoryMask, this.qualityScores);
3440
- if (!this.j) {
3441
- var o = a;
3442
- break t;
3443
- }
3444
- this.j(a);
3445
- } finally {
3446
- Bn(this);
3447
- }
3448
- o = void 0;
3449
- }
3450
- return o;
3451
- }
3452
- m() {
3453
- var t = new ht();
3454
- P(t, "image_in"), P(t, "roi_in"), P(t, "norm_rect_in");
3455
- const e = new ct();
3456
- Lt(e, Yo, this.h);
3457
- const n = new Q();
3458
- it(n, 2, "mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"), M(n, "IMAGE:image_in"), M(n, "ROI:roi_in"), M(n, "NORM_RECT:norm_rect_in"), n.o(e), gt(t, n), Cn(this, t), this.outputConfidenceMasks && (E(t, "confidence_masks"), w(n, "CONFIDENCE_MASKS:confidence_masks"), ve(this, "confidence_masks"), this.g.aa("confidence_masks", (s, r) => {
3459
- this.confidenceMasks = s.map((i) => be(this, i, !0, !this.j)), l(this, r);
3460
- }), this.g.attachEmptyPacketListener("confidence_masks", (s) => {
3461
- this.confidenceMasks = [], l(this, s);
3462
- })), this.outputCategoryMask && (E(t, "category_mask"), w(n, "CATEGORY_MASK:category_mask"), ve(this, "category_mask"), this.g.Z("category_mask", (s, r) => {
3463
- this.categoryMask = be(this, s, !1, !this.j), l(this, r);
3464
- }), this.g.attachEmptyPacketListener("category_mask", (s) => {
3465
- this.categoryMask = void 0, l(this, s);
3466
- })), E(t, "quality_scores"), w(n, "QUALITY_SCORES:quality_scores"), this.g.attachFloatVectorListener("quality_scores", (s, r) => {
3467
- this.qualityScores = s, l(this, r);
3468
- }), this.g.attachEmptyPacketListener("quality_scores", (s) => {
3469
- this.categoryMask = void 0, l(this, s);
3470
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3471
- }
3472
- };
3473
- bt.prototype.segment = bt.prototype.segment, bt.prototype.setOptions = bt.prototype.o, bt.createFromModelPath = function(t, e) {
3474
- return b(bt, t, { baseOptions: { modelAssetPath: e } });
3475
- }, bt.createFromModelBuffer = function(t, e) {
3476
- return b(bt, t, { baseOptions: { modelAssetBuffer: e } });
3477
- }, bt.createFromOptions = function(t, e) {
3478
- return b(bt, t, e);
3479
- };
3480
- var ft = class extends at {
3481
- constructor(t, e) {
3482
- super(new _t(t, e), "input_frame_gpu", "norm_rect", !1), this.j = { detections: [] }, y(t = this.h = new $o(), 0, 1, e = new O());
3483
- }
3484
- get baseOptions() {
3485
- return A(this.h, O, 1);
3486
- }
3487
- set baseOptions(t) {
3488
- y(this.h, 0, 1, t);
3489
- }
3490
- o(t) {
3491
- return t.displayNamesLocale !== void 0 ? k(this.h, 2, Je(t.displayNamesLocale)) : "displayNamesLocale" in t && k(this.h, 2), t.maxResults !== void 0 ? xt(this.h, 3, t.maxResults) : "maxResults" in t && k(this.h, 3), t.scoreThreshold !== void 0 ? m(this.h, 4, t.scoreThreshold) : "scoreThreshold" in t && k(this.h, 4), t.categoryAllowlist !== void 0 ? un(this.h, 5, t.categoryAllowlist) : "categoryAllowlist" in t && k(this.h, 5), t.categoryDenylist !== void 0 ? un(this.h, 6, t.categoryDenylist) : "categoryDenylist" in t && k(this.h, 6), this.l(t);
3492
- }
3493
- F(t, e) {
3494
- return this.j = { detections: [] }, vt(this, t, e), this.j;
3495
- }
3496
- G(t, e, n) {
3497
- return this.j = { detections: [] }, Mt(this, t, n, e), this.j;
3498
- }
3499
- m() {
3500
- var t = new ht();
3501
- P(t, "input_frame_gpu"), P(t, "norm_rect"), E(t, "detections");
3502
- const e = new ct();
3503
- Lt(e, W2, this.h);
3504
- const n = new Q();
3505
- it(n, 2, "mediapipe.tasks.vision.ObjectDetectorGraph"), M(n, "IMAGE:input_frame_gpu"), M(n, "NORM_RECT:norm_rect"), w(n, "DETECTIONS:detections"), n.o(e), gt(t, n), this.g.attachProtoVectorListener("detections", (s, r) => {
3506
- for (const i of s) s = To(i), this.j.detections.push(Zo(s));
3507
- l(this, r);
3508
- }), this.g.attachEmptyPacketListener("detections", (s) => {
3509
- l(this, s);
3510
- }), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3511
- }
3512
- };
3513
- ft.prototype.detectForVideo = ft.prototype.G, ft.prototype.detect = ft.prototype.F, ft.prototype.setOptions = ft.prototype.o, ft.createFromModelPath = async function(t, e) {
3514
- return b(ft, t, { baseOptions: { modelAssetPath: e } });
3515
- }, ft.createFromModelBuffer = function(t, e) {
3516
- return b(ft, t, { baseOptions: { modelAssetBuffer: e } });
3517
- }, ft.createFromOptions = function(t, e) {
3518
- return b(ft, t, e);
3519
- };
3520
- var ds = class {
3521
- constructor(t, e, n) {
3522
- this.landmarks = t, this.worldLandmarks = e, this.segmentationMasks = n;
3523
- }
3524
- close() {
3525
- var t;
3526
- (t = this.segmentationMasks) == null || t.forEach((e) => {
3527
- e.close();
3528
- });
3529
- }
3530
- };
3531
- function fi(t) {
3532
- t.landmarks = [], t.worldLandmarks = [], t.segmentationMasks = void 0;
3533
- }
3534
- function di(t) {
3535
- try {
3536
- const e = new ds(t.landmarks, t.worldLandmarks, t.segmentationMasks);
3537
- if (!t.u) return e;
3538
- t.u(e);
3539
- } finally {
3540
- Bn(t);
3541
- }
3542
- }
3543
- ds.prototype.close = ds.prototype.close;
3544
- var et = class extends at {
3545
- constructor(t, e) {
3546
- super(new _t(t, e), "image_in", "norm_rect", !1), this.landmarks = [], this.worldLandmarks = [], this.outputSegmentationMasks = !1, y(t = this.h = new Jo(), 0, 1, e = new O()), this.A = new jo(), y(this.h, 0, 3, this.A), this.j = new Go(), y(this.h, 0, 2, this.j), xt(this.j, 4, 1), m(this.j, 2, 0.5), m(this.A, 2, 0.5), m(this.h, 4, 0.5);
3547
- }
3548
- get baseOptions() {
3549
- return A(this.h, O, 1);
3550
- }
3551
- set baseOptions(t) {
3552
- y(this.h, 0, 1, t);
3553
- }
3554
- o(t) {
3555
- return "numPoses" in t && xt(this.j, 4, t.numPoses ?? 1), "minPoseDetectionConfidence" in t && m(this.j, 2, t.minPoseDetectionConfidence ?? 0.5), "minTrackingConfidence" in t && m(this.h, 4, t.minTrackingConfidence ?? 0.5), "minPosePresenceConfidence" in t && m(this.A, 2, t.minPosePresenceConfidence ?? 0.5), "outputSegmentationMasks" in t && (this.outputSegmentationMasks = t.outputSegmentationMasks ?? !1), this.l(t);
3556
- }
3557
- F(t, e, n) {
3558
- const s = typeof e != "function" ? e : {};
3559
- return this.u = typeof e == "function" ? e : n, fi(this), vt(this, t, s), di(this);
3560
- }
3561
- G(t, e, n, s) {
3562
- const r = typeof n != "function" ? n : {};
3563
- return this.u = typeof n == "function" ? n : s, fi(this), Mt(this, t, r, e), di(this);
3564
- }
3565
- m() {
3566
- var t = new ht();
3567
- P(t, "image_in"), P(t, "norm_rect"), E(t, "normalized_landmarks"), E(t, "world_landmarks"), E(t, "segmentation_masks");
3568
- const e = new ct();
3569
- Lt(e, q2, this.h);
3570
- const n = new Q();
3571
- it(n, 2, "mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"), M(n, "IMAGE:image_in"), M(n, "NORM_RECT:norm_rect"), w(n, "NORM_LANDMARKS:normalized_landmarks"), w(n, "WORLD_LANDMARKS:world_landmarks"), n.o(e), gt(t, n), Cn(this, t), this.g.attachProtoVectorListener("normalized_landmarks", (s, r) => {
3572
- this.landmarks = [];
3573
- for (const i of s) s = tn(i), this.landmarks.push(Rn(s));
3574
- l(this, r);
3575
- }), this.g.attachEmptyPacketListener("normalized_landmarks", (s) => {
3576
- this.landmarks = [], l(this, s);
3577
- }), this.g.attachProtoVectorListener("world_landmarks", (s, r) => {
3578
- this.worldLandmarks = [];
3579
- for (const i of s) s = he(i), this.worldLandmarks.push(Ge(s));
3580
- l(this, r);
3581
- }), this.g.attachEmptyPacketListener("world_landmarks", (s) => {
3582
- this.worldLandmarks = [], l(this, s);
3583
- }), this.outputSegmentationMasks && (w(n, "SEGMENTATION_MASK:segmentation_masks"), ve(this, "segmentation_masks"), this.g.aa("segmentation_masks", (s, r) => {
3584
- this.segmentationMasks = s.map((i) => be(this, i, !0, !this.u)), l(this, r);
3585
- }), this.g.attachEmptyPacketListener("segmentation_masks", (s) => {
3586
- this.segmentationMasks = [], l(this, s);
3587
- })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3588
- }
3589
- };
3590
- et.prototype.detectForVideo = et.prototype.G, et.prototype.detect = et.prototype.F, et.prototype.setOptions = et.prototype.o, et.createFromModelPath = function(t, e) {
3591
- return b(et, t, { baseOptions: { modelAssetPath: e } });
3592
- }, et.createFromModelBuffer = function(t, e) {
3593
- return b(et, t, { baseOptions: { modelAssetBuffer: e } });
3594
- }, et.createFromOptions = function(t, e) {
3595
- return b(et, t, e);
3596
- }, et.POSE_CONNECTIONS = pa;
3597
- class e1 {
3598
- constructor(e) {
3599
- this.models = { face: null, hand: null }, this.webcam = null, this.currentStepRef = 0, this.isStepTransitioningRef = !1, this.timerId = null, this.requestId = null, this.heartbeatId = null, this.anchorRatios = null, this.lastNosePos = null, this.consecutiveMissingFrames = 0, this.MAX_GAP = 15, this.LIVENESS_LOCK_KEY = "liveness_active_session", this.stabilityFrames = 0, this.REQUIRED_STABILITY = 10, this.offscreenCanvas = document.createElement("canvas"), this.CHALLENGE_POOL = ["Smile", "Blink", "Turn_Head", "Thumbs_Up"], this.attachVideo = (n) => {
3600
- this.webcam = n, console.log("[LivenessEngine] Video stream attached.");
3601
- }, this.start = () => {
3602
- const n = localStorage.getItem(this.LIVENESS_LOCK_KEY);
3603
- if (n && Date.now() - parseInt(n) < 5e3) {
3604
- this.failInstantly("Another session is active.");
3605
- return;
3606
- }
3607
- if (this.heartbeatId = setInterval(() => {
3608
- localStorage.setItem(this.LIVENESS_LOCK_KEY, Date.now().toString());
3609
- }, 1e3), this.state.status !== "ready" || !this.webcam) {
3610
- console.warn("[LivenessEngine] Engine not ready or video missing.");
3611
- return;
3612
- }
3613
- console.log("[LivenessEngine] Session Starting..."), this.state.status = "capturing", this.updateState({ status: "capturing" }), this.startTimer(), this.detectLoop();
3614
- }, this.stop = () => {
3615
- this.timerId && clearInterval(this.timerId), this.heartbeatId && clearInterval(this.heartbeatId), this.requestId && cancelAnimationFrame(this.requestId), localStorage.removeItem(this.LIVENESS_LOCK_KEY), this.timerId = null, this.heartbeatId = null, this.requestId = null;
3616
- }, this.reset = () => {
3617
- this.stop(), this.currentStepRef = 0, this.isStepTransitioningRef = !1, this.anchorRatios = null, this.lastNosePos = null, this.consecutiveMissingFrames = 0, this.stabilityFrames = 0, this.generateSequence(), this.updateState({
3618
- status: "ready",
3619
- currentStep: 0,
3620
- timeLeft: this.config.duration,
3621
- isStepTransitioning: !1,
3622
- errorMsg: "",
3623
- snapshots: []
3624
- });
3625
- }, this.detectLoop = () => {
3626
- var s, r;
3627
- if (this.state.status !== "capturing" || !this.webcam || !this.models.face) return;
3628
- const n = performance.now();
3629
- try {
3630
- const i = this.models.face.detectForVideo(this.webcam, n);
3631
- if (i.faceLandmarks && i.faceLandmarks.length > 1) {
3632
- console.warn("[LivenessEngine] Security Alert: Multiple faces detected!"), this.failInstantly("Multiple faces detected. Please ensure only one person is in frame.");
3633
- return;
3634
- }
3635
- const o = (s = i.faceLandmarks) == null ? void 0 : s[0];
3636
- if (o) {
3637
- if (this.consecutiveMissingFrames = 0, this.anchorRatios === null)
3638
- this.stabilityFrames++, this.stabilityFrames >= this.REQUIRED_STABILITY && this.verifyIdentity(o);
3639
- else if (!this.verifyIdentity(o) || !this.checkMovement(o)) {
3640
- this.failInstantly("Security violation: Identity mismatch.");
3641
- return;
3642
- }
3643
- const a = this.state.sequence[this.currentStepRef], c = (r = this.models.hand) == null ? void 0 : r.detectForVideo(this.webcam, n);
3644
- if (this.checkAction(i, c, a)) {
3645
- this.handleStepSuccess(o);
3646
- return;
3647
- }
3648
- } else if (this.consecutiveMissingFrames++, this.consecutiveMissingFrames > this.MAX_GAP)
3649
- return this.failInstantly("Face lost. Session reset.");
3650
- this.requestId = requestAnimationFrame(this.detectLoop);
3651
- } catch (i) {
3652
- console.error("[LivenessEngine] Loop detection error:", i), this.requestId = requestAnimationFrame(this.detectLoop);
3653
- }
3654
- }, this.config = {
3655
- apiUrl: e.apiUrl,
3656
- duration: e.duration ?? 60,
3657
- smileThreshold: e.smileThreshold ?? 0.2,
3658
- blinkThreshold: e.blinkThreshold ?? 0.012,
3659
- minturnHeadThreshold: e.minturnHeadThreshold ?? 0.15,
3660
- maxturnHeadThreshold: e.maxturnHeadThreshold ?? 0.85,
3661
- onStateChange: e.onStateChange || (() => {
3662
- }),
3663
- onComplete: e.onComplete || (() => {
3664
- }),
3665
- onError: e.onError || (() => {
3666
- })
3667
- }, this.state = {
3668
- status: "loading",
3669
- sequence: [],
3670
- currentStep: 0,
3671
- timeLeft: this.config.duration,
3672
- isStepTransitioning: !1,
3673
- errorMsg: "",
3674
- snapshots: []
3675
- }, this.offscreenCanvas.width = 224, this.offscreenCanvas.height = 224;
3676
- }
3677
- /**
3678
- * Phase 1: Load AI Assets (Call this immediately on mount)
3679
- */
3680
- async loadModels() {
3681
- console.log("[LivenessEngine] Loading AI Models...");
3682
- try {
3683
- const e = await Kt.forVisionTasks(
3684
- "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm"
3685
- );
3686
- this.models.face = await F.createFromOptions(e, {
3687
- baseOptions: {
3688
- modelAssetPath: "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",
3689
- delegate: "GPU"
3690
- },
3691
- outputFaceBlendshapes: !0,
3692
- runningMode: "VIDEO"
3693
- }), this.models.hand = await J.createFromOptions(e, {
3694
- baseOptions: {
3695
- modelAssetPath: "https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task",
3696
- delegate: "GPU"
3697
- },
3698
- runningMode: "VIDEO",
3699
- numHands: 1
3700
- }), this.generateSequence(), this.updateState({ status: "ready" }), console.log("[LivenessEngine] Models Loaded.");
3701
- } catch (e) {
3702
- console.error("[LivenessEngine] Init Error:", e), this.updateState({ status: "error", errorMsg: "Failed to load security assets." });
3703
- }
3704
- }
3705
- // --- NEW SECURITY METHODS ---
3706
- verifyIdentity(e) {
3707
- const n = Math.sqrt(
3708
- Math.pow(e[33].x - e[263].x, 2) + Math.pow(e[33].y - e[263].y, 2)
3709
- ), s = Math.abs(e[1].y - e[13].y), r = n / (s || 1);
3710
- return this.anchorRatios === null ? (this.anchorRatios = r, !0) : Math.abs(this.anchorRatios - r) / this.anchorRatios < 0.5;
3711
- }
3712
- checkMovement(e) {
3713
- const n = { x: e[1].x, y: e[1].y };
3714
- return this.lastNosePos && Math.sqrt(
3715
- Math.pow(n.x - this.lastNosePos.x, 2) + Math.pow(n.y - this.lastNosePos.y, 2)
3716
- ) > 0.3 ? !1 : (this.lastNosePos = n, !0);
3717
- }
3718
- failInstantly(e) {
3719
- this.stop(), this.updateState({ status: "error", errorMsg: e, isStepTransitioning: !1 }), this.config.onError({ success: !1, reason: e });
3720
- }
3721
- updateState(e) {
3722
- this.state = { ...this.state, ...e }, this.config.onStateChange(this.state);
3723
- }
3724
- generateSequence() {
3725
- const e = [...this.CHALLENGE_POOL].sort(() => 0.5 - Math.random()).slice(0, 3);
3726
- return this.state.sequence = e, e;
3727
- }
3728
- startTimer() {
3729
- this.timerId && clearInterval(this.timerId), this.timerId = setInterval(() => {
3730
- this.state.timeLeft > 0 ? this.updateState({ timeLeft: this.state.timeLeft - 1 }) : (this.stop(), this.updateState({ status: "expired" }));
3731
- }, 1e3);
3732
- }
3733
- handleStepSuccess(e) {
3734
- if (this.isStepTransitioningRef) return;
3735
- this.isStepTransitioningRef = !0;
3736
- const n = this.getFaceCrop(this.webcam, e), s = {
3737
- challenge: this.state.sequence[this.currentStepRef],
3738
- image: n.toDataURL("image/jpeg", 0.7),
3739
- timestamp: Date.now()
3740
- }, r = [...this.state.snapshots, s];
3741
- this.updateState({ isStepTransitioning: !0, snapshots: r }), setTimeout(() => {
3742
- this.state.status === "capturing" && (this.currentStepRef < this.state.sequence.length - 1 ? (this.currentStepRef++, this.isStepTransitioningRef = !1, this.updateState({
3743
- currentStep: this.currentStepRef,
3744
- isStepTransitioning: !1,
3745
- snapshots: r
3746
- }), this.requestId = requestAnimationFrame(this.detectLoop)) : (this.updateState({ snapshots: r }), this.sendFinalProof()));
3747
- }, 1500);
3748
- }
3749
- checkAction(e, n, s) {
3750
- var r, i;
3751
- if (this.isStepTransitioningRef) return !1;
3752
- if (s === "Thumbs_Up" && ((r = n == null ? void 0 : n.landmarks) == null ? void 0 : r.length) > 0) {
3753
- const o = n.landmarks[0];
3754
- return o[4].y < o[2].y && [8, 12, 16, 20].every((a) => o[a].y > o[a - 2].y);
3755
- }
3756
- if (((i = e == null ? void 0 : e.faceLandmarks) == null ? void 0 : i.length) > 0) {
3757
- const o = e.faceLandmarks[0];
3758
- switch (s) {
3759
- case "Smile":
3760
- return o[291].x - o[61].x > this.config.smileThreshold;
3761
- case "Blink":
3762
- const a = Math.abs(o[159].y - o[145].y), c = Math.abs(o[386].y - o[374].y);
3763
- return (a + c) / 2 < this.config.blinkThreshold;
3764
- case "Turn_Head":
3765
- const u = (o[1].x - o[33].x) / (o[263].x - o[33].x);
3766
- return u < this.config.minturnHeadThreshold || u > this.config.maxturnHeadThreshold;
3767
- default:
3768
- return !1;
3769
- }
3770
- }
3771
- return !1;
3772
- }
3773
- async sendFinalProof() {
3774
- var e, n;
3775
- this.stop(), this.updateState({ status: "verifying" });
3776
- try {
3777
- const s = [];
3778
- let r = "";
3779
- for (let a = 0; a < 5 && this.webcam; a++) {
3780
- const c = (e = this.models.face) == null ? void 0 : e.detectForVideo(this.webcam, performance.now());
3781
- if ((n = c == null ? void 0 : c.faceLandmarks) != null && n[0]) {
3782
- const u = this.getFaceCrop(this.webcam, c.faceLandmarks[0]), h = await new Promise((f) => u.toBlob(f, "image/jpeg", 0.9));
3783
- h && s.push(h), a === 4 && (r = u.toDataURL("image/jpeg"));
3784
- }
3785
- await new Promise((u) => setTimeout(u, 100));
3786
- }
3787
- const { verifyLiveness: i } = await import("./api-BpiDoGOd.js"), o = await i(this.config.apiUrl, s, this.state.sequence);
3788
- if (o.is_live)
3789
- this.updateState({ status: "success" }), this.config.onComplete({ success: !0, image: r, skinConfidence: o.skin_confidence });
3790
- else {
3791
- const a = o.reason || "Liveness check failed";
3792
- this.updateState({ status: "error", errorMsg: a }), this.config.onError({ success: !1, reason: a });
3793
- }
3794
- } catch {
3795
- this.updateState({ status: "error", errorMsg: "Verification failed." }), this.config.onError({ success: !1, reason: "Network error" });
3796
- }
3797
- }
3798
- getFaceCrop(e, n) {
3799
- const s = this.offscreenCanvas.getContext("2d"), r = n.map((v) => v.x * e.videoWidth), i = n.map((v) => v.y * e.videoHeight), o = Math.min(...r), a = Math.max(...r), c = Math.min(...i), u = Math.max(...i), h = a - o, f = u - c, _ = h * 0.3;
3800
- return s.clearRect(0, 0, 224, 224), s.drawImage(
3801
- e,
3802
- o - _,
3803
- c - _,
3804
- h + _ * 2,
3805
- f + _ * 2,
3806
- 0,
3807
- 0,
3808
- 224,
3809
- 224
3810
- ), this.offscreenCanvas;
3811
- }
3812
- }
3813
- export {
3814
- e1 as L
3815
- };