@powercred/liveness-web 0.0.0-stage → 0.1.0

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