@lingoace/lingo-trtc-rtc 0.0.21 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/audioProcessor-wasm.js +1 -0
- package/assets/debug-dialog.js +17 -0
- package/assets/denoiser-wasm-nosimd.js +1 -0
- package/assets/denoiser-wasm.js +1 -0
- package/assets/mediapipe/blaze_face_short_range.tflite +0 -0
- package/assets/mediapipe/selfie_segmenter_landscape.tflite +0 -0
- package/assets/mediapipe/vision.js +4723 -0
- package/assets/mediapipe/vision_wasm_internal.js.gz +0 -0
- package/assets/mediapipe/vision_wasm_internal.wasm.gz +0 -0
- package/assets/mediapipe/vision_wasm_nosimd_internal.js.gz +0 -0
- package/assets/mediapipe/vision_wasm_nosimd_internal.wasm.gz +0 -0
- package/assets/videodec.wasm +0 -0
- package/assets/videodec_simd.wasm +0 -0
- package/index.d.ts +28 -15
- package/package.json +3 -3
- package/trtc-lingo.js +227 -537
|
@@ -0,0 +1,4723 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var Vision = (() => {
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to2, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to2, key) && key !== except)
|
|
16
|
+
__defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to2;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
|
|
23
|
+
// ../sdk-core/src/manager/vision.ts
|
|
24
|
+
var vision_exports = {};
|
|
25
|
+
__export(vision_exports, {
|
|
26
|
+
VisionTaskRegistry: () => VisionTaskRegistry,
|
|
27
|
+
VisionTaskType: () => VisionTaskType
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// ../../node_modules/.pnpm/@mediapipe+tasks-vision@0.10.22-rc.20250304/node_modules/@mediapipe/tasks-vision/vision_bundle.mjs
|
|
31
|
+
var t = "undefined" != typeof self ? self : {};
|
|
32
|
+
function e() {
|
|
33
|
+
throw Error("Invalid UTF8");
|
|
34
|
+
}
|
|
35
|
+
function n(t2, e2) {
|
|
36
|
+
return e2 = String.fromCharCode.apply(null, e2), null == t2 ? e2 : t2 + e2;
|
|
37
|
+
}
|
|
38
|
+
var r;
|
|
39
|
+
var i;
|
|
40
|
+
var s = "undefined" != typeof TextDecoder;
|
|
41
|
+
var o;
|
|
42
|
+
var a = "undefined" != typeof TextEncoder;
|
|
43
|
+
function c(t2) {
|
|
44
|
+
if (a) t2 = (o || (o = new TextEncoder())).encode(t2);
|
|
45
|
+
else {
|
|
46
|
+
let n2 = 0;
|
|
47
|
+
const r2 = new Uint8Array(3 * t2.length);
|
|
48
|
+
for (let i2 = 0; i2 < t2.length; i2++) {
|
|
49
|
+
var e2 = t2.charCodeAt(i2);
|
|
50
|
+
if (e2 < 128) r2[n2++] = e2;
|
|
51
|
+
else {
|
|
52
|
+
if (e2 < 2048) r2[n2++] = e2 >> 6 | 192;
|
|
53
|
+
else {
|
|
54
|
+
if (e2 >= 55296 && e2 <= 57343) {
|
|
55
|
+
if (e2 <= 56319 && i2 < t2.length) {
|
|
56
|
+
const s2 = t2.charCodeAt(++i2);
|
|
57
|
+
if (s2 >= 56320 && s2 <= 57343) {
|
|
58
|
+
e2 = 1024 * (e2 - 55296) + s2 - 56320 + 65536, r2[n2++] = e2 >> 18 | 240, r2[n2++] = e2 >> 12 & 63 | 128, r2[n2++] = e2 >> 6 & 63 | 128, r2[n2++] = 63 & e2 | 128;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
i2--;
|
|
62
|
+
}
|
|
63
|
+
e2 = 65533;
|
|
64
|
+
}
|
|
65
|
+
r2[n2++] = e2 >> 12 | 224, r2[n2++] = e2 >> 6 & 63 | 128;
|
|
66
|
+
}
|
|
67
|
+
r2[n2++] = 63 & e2 | 128;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
t2 = n2 === r2.length ? r2 : r2.subarray(0, n2);
|
|
71
|
+
}
|
|
72
|
+
return t2;
|
|
73
|
+
}
|
|
74
|
+
var h;
|
|
75
|
+
var u;
|
|
76
|
+
t: {
|
|
77
|
+
for (l = ["CLOSURE_FLAGS"], d = t, f = 0; f < l.length; f++) if (null == (d = d[l[f]])) {
|
|
78
|
+
u = null;
|
|
79
|
+
break t;
|
|
80
|
+
}
|
|
81
|
+
u = d;
|
|
82
|
+
}
|
|
83
|
+
var l;
|
|
84
|
+
var d;
|
|
85
|
+
var f;
|
|
86
|
+
var p;
|
|
87
|
+
var g = u && u[610401301];
|
|
88
|
+
h = null != g && g;
|
|
89
|
+
var m = t.navigator;
|
|
90
|
+
function y(t2) {
|
|
91
|
+
return !!h && (!!p && p.brands.some((({ brand: e2 }) => e2 && -1 != e2.indexOf(t2))));
|
|
92
|
+
}
|
|
93
|
+
function _(e2) {
|
|
94
|
+
var n2;
|
|
95
|
+
return (n2 = t.navigator) && (n2 = n2.userAgent) || (n2 = ""), -1 != n2.indexOf(e2);
|
|
96
|
+
}
|
|
97
|
+
function v() {
|
|
98
|
+
return !!h && (!!p && p.brands.length > 0);
|
|
99
|
+
}
|
|
100
|
+
function E() {
|
|
101
|
+
return v() ? y("Chromium") : (_("Chrome") || _("CriOS")) && !(!v() && _("Edge")) || _("Silk");
|
|
102
|
+
}
|
|
103
|
+
function w(t2) {
|
|
104
|
+
return w[" "](t2), t2;
|
|
105
|
+
}
|
|
106
|
+
p = m && m.userAgentData || null, w[" "] = function() {
|
|
107
|
+
};
|
|
108
|
+
var T = !v() && (_("Trident") || _("MSIE"));
|
|
109
|
+
!_("Android") || E(), E(), _("Safari") && (E() || !v() && _("Coast") || !v() && _("Opera") || !v() && _("Edge") || (v() ? y("Microsoft Edge") : _("Edg/")) || v() && y("Opera"));
|
|
110
|
+
var A = {};
|
|
111
|
+
var b = null;
|
|
112
|
+
function k(t2) {
|
|
113
|
+
const e2 = t2.length;
|
|
114
|
+
let n2 = 3 * e2 / 4;
|
|
115
|
+
n2 % 3 ? n2 = Math.floor(n2) : -1 != "=.".indexOf(t2[e2 - 1]) && (n2 = -1 != "=.".indexOf(t2[e2 - 2]) ? n2 - 2 : n2 - 1);
|
|
116
|
+
const r2 = new Uint8Array(n2);
|
|
117
|
+
let i2 = 0;
|
|
118
|
+
return (function(t3, e3) {
|
|
119
|
+
function n3(e4) {
|
|
120
|
+
for (; r3 < t3.length; ) {
|
|
121
|
+
const e5 = t3.charAt(r3++), n4 = b[e5];
|
|
122
|
+
if (null != n4) return n4;
|
|
123
|
+
if (!/^[\s\xa0]*$/.test(e5)) throw Error("Unknown base64 encoding at char: " + e5);
|
|
124
|
+
}
|
|
125
|
+
return e4;
|
|
126
|
+
}
|
|
127
|
+
S();
|
|
128
|
+
let r3 = 0;
|
|
129
|
+
for (; ; ) {
|
|
130
|
+
const t4 = n3(-1), r4 = n3(0), i3 = n3(64), s2 = n3(64);
|
|
131
|
+
if (64 === s2 && -1 === t4) break;
|
|
132
|
+
e3(t4 << 2 | r4 >> 4), 64 != i3 && (e3(r4 << 4 & 240 | i3 >> 2), 64 != s2 && e3(i3 << 6 & 192 | s2));
|
|
133
|
+
}
|
|
134
|
+
})(t2, (function(t3) {
|
|
135
|
+
r2[i2++] = t3;
|
|
136
|
+
})), i2 !== n2 ? r2.subarray(0, i2) : r2;
|
|
137
|
+
}
|
|
138
|
+
function S() {
|
|
139
|
+
if (!b) {
|
|
140
|
+
b = {};
|
|
141
|
+
var t2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""), e2 = ["+/=", "+/", "-_=", "-_.", "-_"];
|
|
142
|
+
for (let n2 = 0; n2 < 5; n2++) {
|
|
143
|
+
const r2 = t2.concat(e2[n2].split(""));
|
|
144
|
+
A[n2] = r2;
|
|
145
|
+
for (let t3 = 0; t3 < r2.length; t3++) {
|
|
146
|
+
const e3 = r2[t3];
|
|
147
|
+
void 0 === b[e3] && (b[e3] = t3);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
var x = "undefined" != typeof Uint8Array;
|
|
153
|
+
var L = !T && "function" == typeof btoa;
|
|
154
|
+
function R(t2) {
|
|
155
|
+
if (!L) {
|
|
156
|
+
var e2;
|
|
157
|
+
void 0 === e2 && (e2 = 0), S(), e2 = A[e2];
|
|
158
|
+
var n2 = Array(Math.floor(t2.length / 3)), r2 = e2[64] || "";
|
|
159
|
+
let c2 = 0, h2 = 0;
|
|
160
|
+
for (; c2 < t2.length - 2; c2 += 3) {
|
|
161
|
+
var i2 = t2[c2], s2 = t2[c2 + 1], o2 = t2[c2 + 2], a2 = e2[i2 >> 2];
|
|
162
|
+
i2 = e2[(3 & i2) << 4 | s2 >> 4], s2 = e2[(15 & s2) << 2 | o2 >> 6], o2 = e2[63 & o2], n2[h2++] = a2 + i2 + s2 + o2;
|
|
163
|
+
}
|
|
164
|
+
switch (a2 = 0, o2 = r2, t2.length - c2) {
|
|
165
|
+
case 2:
|
|
166
|
+
o2 = e2[(15 & (a2 = t2[c2 + 1])) << 2] || r2;
|
|
167
|
+
case 1:
|
|
168
|
+
t2 = t2[c2], n2[h2] = e2[t2 >> 2] + e2[(3 & t2) << 4 | a2 >> 4] + o2 + r2;
|
|
169
|
+
}
|
|
170
|
+
return n2.join("");
|
|
171
|
+
}
|
|
172
|
+
for (e2 = "", n2 = 0, r2 = t2.length - 10240; n2 < r2; ) e2 += String.fromCharCode.apply(null, t2.subarray(n2, n2 += 10240));
|
|
173
|
+
return e2 += String.fromCharCode.apply(null, n2 ? t2.subarray(n2) : t2), btoa(e2);
|
|
174
|
+
}
|
|
175
|
+
var F = /[-_.]/g;
|
|
176
|
+
var I = { "-": "+", _: "/", ".": "=" };
|
|
177
|
+
function M(t2) {
|
|
178
|
+
return I[t2] || "";
|
|
179
|
+
}
|
|
180
|
+
function P(t2) {
|
|
181
|
+
if (!L) return k(t2);
|
|
182
|
+
F.test(t2) && (t2 = t2.replace(F, M)), t2 = atob(t2);
|
|
183
|
+
const e2 = new Uint8Array(t2.length);
|
|
184
|
+
for (let n2 = 0; n2 < t2.length; n2++) e2[n2] = t2.charCodeAt(n2);
|
|
185
|
+
return e2;
|
|
186
|
+
}
|
|
187
|
+
function C(t2) {
|
|
188
|
+
return x && null != t2 && t2 instanceof Uint8Array;
|
|
189
|
+
}
|
|
190
|
+
var O = {};
|
|
191
|
+
function U() {
|
|
192
|
+
return B || (B = new N(null, O));
|
|
193
|
+
}
|
|
194
|
+
function D(t2) {
|
|
195
|
+
j(O);
|
|
196
|
+
var e2 = t2.g;
|
|
197
|
+
return null == (e2 = null == e2 || C(e2) ? e2 : "string" == typeof e2 ? P(e2) : null) ? e2 : t2.g = e2;
|
|
198
|
+
}
|
|
199
|
+
var N = class {
|
|
200
|
+
h() {
|
|
201
|
+
return new Uint8Array(D(this) || 0);
|
|
202
|
+
}
|
|
203
|
+
constructor(t2, e2) {
|
|
204
|
+
if (j(e2), this.g = t2, null != t2 && 0 === t2.length) throw Error("ByteString should be constructed with non-empty values");
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
var B;
|
|
208
|
+
var G;
|
|
209
|
+
function j(t2) {
|
|
210
|
+
if (t2 !== O) throw Error("illegal external caller");
|
|
211
|
+
}
|
|
212
|
+
function V(t2, e2) {
|
|
213
|
+
t2.__closure__error__context__984382 || (t2.__closure__error__context__984382 = {}), t2.__closure__error__context__984382.severity = e2;
|
|
214
|
+
}
|
|
215
|
+
function X(t2) {
|
|
216
|
+
return V(t2 = Error(t2), "warning"), t2;
|
|
217
|
+
}
|
|
218
|
+
function H(e2) {
|
|
219
|
+
if (null != e2) {
|
|
220
|
+
var n2 = G ?? (G = {}), r2 = n2[e2] || 0;
|
|
221
|
+
r2 >= 5 || (n2[e2] = r2 + 1, V(e2 = Error(), "incident"), (function(e3) {
|
|
222
|
+
t.setTimeout((() => {
|
|
223
|
+
throw e3;
|
|
224
|
+
}), 0);
|
|
225
|
+
})(e2));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
var W = "function" == typeof Symbol && "symbol" == typeof Symbol();
|
|
229
|
+
function z(t2, e2, n2 = false) {
|
|
230
|
+
return "function" == typeof Symbol && "symbol" == typeof Symbol() ? n2 && Symbol.for && t2 ? Symbol.for(t2) : null != t2 ? Symbol(t2) : Symbol() : e2;
|
|
231
|
+
}
|
|
232
|
+
var K = z("jas", void 0, true);
|
|
233
|
+
var Y = z(void 0, "0di");
|
|
234
|
+
var $ = z(void 0, "1oa");
|
|
235
|
+
var q = z(void 0, Symbol());
|
|
236
|
+
var J = z(void 0, "0actk");
|
|
237
|
+
var Z = z(void 0, "8utk");
|
|
238
|
+
var Q = W ? K : "Ea";
|
|
239
|
+
var tt = { Ea: { value: 0, configurable: true, writable: true, enumerable: false } };
|
|
240
|
+
var et = Object.defineProperties;
|
|
241
|
+
function nt(t2, e2) {
|
|
242
|
+
W || Q in t2 || et(t2, tt), t2[Q] |= e2;
|
|
243
|
+
}
|
|
244
|
+
function rt(t2, e2) {
|
|
245
|
+
W || Q in t2 || et(t2, tt), t2[Q] = e2;
|
|
246
|
+
}
|
|
247
|
+
function it(t2) {
|
|
248
|
+
return nt(t2, 34), t2;
|
|
249
|
+
}
|
|
250
|
+
function st(t2, e2) {
|
|
251
|
+
rt(e2, -15615 & (0 | t2));
|
|
252
|
+
}
|
|
253
|
+
function ot(t2, e2) {
|
|
254
|
+
rt(e2, -15581 & (34 | t2));
|
|
255
|
+
}
|
|
256
|
+
function at() {
|
|
257
|
+
return "function" == typeof BigInt;
|
|
258
|
+
}
|
|
259
|
+
function ct(t2) {
|
|
260
|
+
return Array.prototype.slice.call(t2);
|
|
261
|
+
}
|
|
262
|
+
var ht;
|
|
263
|
+
var ut = {};
|
|
264
|
+
function lt(t2) {
|
|
265
|
+
return null !== t2 && "object" == typeof t2 && !Array.isArray(t2) && t2.constructor === Object;
|
|
266
|
+
}
|
|
267
|
+
function dt(t2, e2) {
|
|
268
|
+
if (null != t2) {
|
|
269
|
+
if ("string" == typeof t2) t2 = t2 ? new N(t2, O) : U();
|
|
270
|
+
else if (t2.constructor !== N) if (C(t2)) t2 = t2.length ? new N(new Uint8Array(t2), O) : U();
|
|
271
|
+
else {
|
|
272
|
+
if (!e2) throw Error();
|
|
273
|
+
t2 = void 0;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return t2;
|
|
277
|
+
}
|
|
278
|
+
var ft = [];
|
|
279
|
+
function pt(t2) {
|
|
280
|
+
if (2 & t2) throw Error();
|
|
281
|
+
}
|
|
282
|
+
rt(ft, 55), ht = Object.freeze(ft);
|
|
283
|
+
var gt = class {
|
|
284
|
+
constructor(t2, e2, n2) {
|
|
285
|
+
this.g = t2, this.h = e2, this.l = n2;
|
|
286
|
+
}
|
|
287
|
+
next() {
|
|
288
|
+
const t2 = this.g.next();
|
|
289
|
+
return t2.done || (t2.value = this.h.call(this.l, t2.value)), t2;
|
|
290
|
+
}
|
|
291
|
+
[Symbol.iterator]() {
|
|
292
|
+
return this;
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
function mt(t2) {
|
|
296
|
+
return q ? t2[q] : void 0;
|
|
297
|
+
}
|
|
298
|
+
var yt = Object.freeze({});
|
|
299
|
+
function _t(t2) {
|
|
300
|
+
return t2.Na = true, t2;
|
|
301
|
+
}
|
|
302
|
+
var vt = _t(((t2) => "number" == typeof t2));
|
|
303
|
+
var Et = _t(((t2) => "string" == typeof t2));
|
|
304
|
+
var wt = _t(((t2) => "boolean" == typeof t2));
|
|
305
|
+
var Tt = "function" == typeof t.BigInt && "bigint" == typeof t.BigInt(0);
|
|
306
|
+
function At(t2) {
|
|
307
|
+
var e2 = t2;
|
|
308
|
+
if (Et(e2)) {
|
|
309
|
+
if (!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e2)) throw Error(String(e2));
|
|
310
|
+
} else if (vt(e2) && !Number.isSafeInteger(e2)) throw Error(String(e2));
|
|
311
|
+
return Tt ? BigInt(t2) : t2 = wt(t2) ? t2 ? "1" : "0" : Et(t2) ? t2.trim() || "0" : String(t2);
|
|
312
|
+
}
|
|
313
|
+
var bt = _t(((t2) => Tt ? t2 >= St && t2 <= Lt : "-" === t2[0] ? Rt(t2, kt) : Rt(t2, xt)));
|
|
314
|
+
var kt = Number.MIN_SAFE_INTEGER.toString();
|
|
315
|
+
var St = Tt ? BigInt(Number.MIN_SAFE_INTEGER) : void 0;
|
|
316
|
+
var xt = Number.MAX_SAFE_INTEGER.toString();
|
|
317
|
+
var Lt = Tt ? BigInt(Number.MAX_SAFE_INTEGER) : void 0;
|
|
318
|
+
function Rt(t2, e2) {
|
|
319
|
+
if (t2.length > e2.length) return false;
|
|
320
|
+
if (t2.length < e2.length || t2 === e2) return true;
|
|
321
|
+
for (let n2 = 0; n2 < t2.length; n2++) {
|
|
322
|
+
const r2 = t2[n2], i2 = e2[n2];
|
|
323
|
+
if (r2 > i2) return false;
|
|
324
|
+
if (r2 < i2) return true;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
var Ft = "function" == typeof Uint8Array.prototype.slice;
|
|
328
|
+
var It;
|
|
329
|
+
var Mt = 0;
|
|
330
|
+
var Pt = 0;
|
|
331
|
+
function Ct(t2) {
|
|
332
|
+
const e2 = t2 >>> 0;
|
|
333
|
+
Mt = e2, Pt = (t2 - e2) / 4294967296 >>> 0;
|
|
334
|
+
}
|
|
335
|
+
function Ot(t2) {
|
|
336
|
+
if (t2 < 0) {
|
|
337
|
+
Ct(-t2);
|
|
338
|
+
const [e2, n2] = Xt(Mt, Pt);
|
|
339
|
+
Mt = e2 >>> 0, Pt = n2 >>> 0;
|
|
340
|
+
} else Ct(t2);
|
|
341
|
+
}
|
|
342
|
+
function Ut(t2) {
|
|
343
|
+
const e2 = It || (It = new DataView(new ArrayBuffer(8)));
|
|
344
|
+
e2.setFloat32(0, +t2, true), Pt = 0, Mt = e2.getUint32(0, true);
|
|
345
|
+
}
|
|
346
|
+
function Dt(t2, e2) {
|
|
347
|
+
const n2 = 4294967296 * e2 + (t2 >>> 0);
|
|
348
|
+
return Number.isSafeInteger(n2) ? n2 : Bt(t2, e2);
|
|
349
|
+
}
|
|
350
|
+
function Nt(t2, e2) {
|
|
351
|
+
const n2 = 2147483648 & e2;
|
|
352
|
+
return n2 && (e2 = ~e2 >>> 0, 0 == (t2 = 1 + ~t2 >>> 0) && (e2 = e2 + 1 >>> 0)), "number" == typeof (t2 = Dt(t2, e2)) ? n2 ? -t2 : t2 : n2 ? "-" + t2 : t2;
|
|
353
|
+
}
|
|
354
|
+
function Bt(t2, e2) {
|
|
355
|
+
if (t2 >>>= 0, (e2 >>>= 0) <= 2097151) var n2 = "" + (4294967296 * e2 + t2);
|
|
356
|
+
else at() ? n2 = "" + (BigInt(e2) << BigInt(32) | BigInt(t2)) : (t2 = (16777215 & t2) + 6777216 * (n2 = 16777215 & (t2 >>> 24 | e2 << 8)) + 6710656 * (e2 = e2 >> 16 & 65535), n2 += 8147497 * e2, e2 *= 2, t2 >= 1e7 && (n2 += t2 / 1e7 >>> 0, t2 %= 1e7), n2 >= 1e7 && (e2 += n2 / 1e7 >>> 0, n2 %= 1e7), n2 = e2 + Gt(n2) + Gt(t2));
|
|
357
|
+
return n2;
|
|
358
|
+
}
|
|
359
|
+
function Gt(t2) {
|
|
360
|
+
return t2 = String(t2), "0000000".slice(t2.length) + t2;
|
|
361
|
+
}
|
|
362
|
+
function jt() {
|
|
363
|
+
var t2 = Mt, e2 = Pt;
|
|
364
|
+
if (2147483648 & e2) if (at()) t2 = "" + (BigInt(0 | e2) << BigInt(32) | BigInt(t2 >>> 0));
|
|
365
|
+
else {
|
|
366
|
+
const [n2, r2] = Xt(t2, e2);
|
|
367
|
+
t2 = "-" + Bt(n2, r2);
|
|
368
|
+
}
|
|
369
|
+
else t2 = Bt(t2, e2);
|
|
370
|
+
return t2;
|
|
371
|
+
}
|
|
372
|
+
function Vt(t2) {
|
|
373
|
+
if (t2.length < 16) Ot(Number(t2));
|
|
374
|
+
else if (at()) t2 = BigInt(t2), Mt = Number(t2 & BigInt(4294967295)) >>> 0, Pt = Number(t2 >> BigInt(32) & BigInt(4294967295));
|
|
375
|
+
else {
|
|
376
|
+
const e2 = +("-" === t2[0]);
|
|
377
|
+
Pt = Mt = 0;
|
|
378
|
+
const n2 = t2.length;
|
|
379
|
+
for (let r2 = e2, i2 = (n2 - e2) % 6 + e2; i2 <= n2; r2 = i2, i2 += 6) {
|
|
380
|
+
const e3 = Number(t2.slice(r2, i2));
|
|
381
|
+
Pt *= 1e6, Mt = 1e6 * Mt + e3, Mt >= 4294967296 && (Pt += Math.trunc(Mt / 4294967296), Pt >>>= 0, Mt >>>= 0);
|
|
382
|
+
}
|
|
383
|
+
if (e2) {
|
|
384
|
+
const [t3, e3] = Xt(Mt, Pt);
|
|
385
|
+
Mt = t3, Pt = e3;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function Xt(t2, e2) {
|
|
390
|
+
return e2 = ~e2, t2 ? t2 = 1 + ~t2 : e2 += 1, [t2, e2];
|
|
391
|
+
}
|
|
392
|
+
var Ht = "function" == typeof BigInt ? BigInt.asIntN : void 0;
|
|
393
|
+
var Wt = "function" == typeof BigInt ? BigInt.asUintN : void 0;
|
|
394
|
+
var zt = Number.isSafeInteger;
|
|
395
|
+
var Kt = Number.isFinite;
|
|
396
|
+
var Yt = Math.trunc;
|
|
397
|
+
var $t = At(0);
|
|
398
|
+
function qt(t2) {
|
|
399
|
+
return null == t2 || "number" == typeof t2 ? t2 : "NaN" === t2 || "Infinity" === t2 || "-Infinity" === t2 ? Number(t2) : void 0;
|
|
400
|
+
}
|
|
401
|
+
function Jt(t2) {
|
|
402
|
+
return null == t2 || "boolean" == typeof t2 ? t2 : "number" == typeof t2 ? !!t2 : void 0;
|
|
403
|
+
}
|
|
404
|
+
var Zt = /^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;
|
|
405
|
+
function Qt(t2) {
|
|
406
|
+
switch (typeof t2) {
|
|
407
|
+
case "bigint":
|
|
408
|
+
return true;
|
|
409
|
+
case "number":
|
|
410
|
+
return Kt(t2);
|
|
411
|
+
case "string":
|
|
412
|
+
return Zt.test(t2);
|
|
413
|
+
default:
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function te(t2) {
|
|
418
|
+
if (null == t2) return t2;
|
|
419
|
+
if ("string" == typeof t2 && t2) t2 = +t2;
|
|
420
|
+
else if ("number" != typeof t2) return;
|
|
421
|
+
return Kt(t2) ? 0 | t2 : void 0;
|
|
422
|
+
}
|
|
423
|
+
function ee(t2) {
|
|
424
|
+
if (null == t2) return t2;
|
|
425
|
+
if ("string" == typeof t2 && t2) t2 = +t2;
|
|
426
|
+
else if ("number" != typeof t2) return;
|
|
427
|
+
return Kt(t2) ? t2 >>> 0 : void 0;
|
|
428
|
+
}
|
|
429
|
+
function ne(t2) {
|
|
430
|
+
if ("-" === t2[0]) return false;
|
|
431
|
+
const e2 = t2.length;
|
|
432
|
+
return e2 < 20 || 20 === e2 && Number(t2.substring(0, 6)) < 184467;
|
|
433
|
+
}
|
|
434
|
+
function re(t2) {
|
|
435
|
+
const e2 = t2.length;
|
|
436
|
+
return "-" === t2[0] ? e2 < 20 || 20 === e2 && Number(t2.substring(0, 7)) > -922337 : e2 < 19 || 19 === e2 && Number(t2.substring(0, 6)) < 922337;
|
|
437
|
+
}
|
|
438
|
+
function ie(t2) {
|
|
439
|
+
return re(t2) ? t2 : (Vt(t2), jt());
|
|
440
|
+
}
|
|
441
|
+
function se(t2) {
|
|
442
|
+
return t2 = Yt(t2), zt(t2) || (Ot(t2), t2 = Nt(Mt, Pt)), t2;
|
|
443
|
+
}
|
|
444
|
+
function oe(t2) {
|
|
445
|
+
var e2 = Yt(Number(t2));
|
|
446
|
+
return zt(e2) ? String(e2) : (-1 !== (e2 = t2.indexOf(".")) && (t2 = t2.substring(0, e2)), ie(t2));
|
|
447
|
+
}
|
|
448
|
+
function ae(t2) {
|
|
449
|
+
var e2 = Yt(Number(t2));
|
|
450
|
+
return zt(e2) ? At(e2) : (-1 !== (e2 = t2.indexOf(".")) && (t2 = t2.substring(0, e2)), at() ? At(Ht(64, BigInt(t2))) : At(ie(t2)));
|
|
451
|
+
}
|
|
452
|
+
function ce(t2) {
|
|
453
|
+
if (zt(t2)) t2 = At(se(t2));
|
|
454
|
+
else {
|
|
455
|
+
if (t2 = Yt(t2), zt(t2)) t2 = String(t2);
|
|
456
|
+
else {
|
|
457
|
+
const e2 = String(t2);
|
|
458
|
+
re(e2) ? t2 = e2 : (Ot(t2), t2 = jt());
|
|
459
|
+
}
|
|
460
|
+
t2 = At(t2);
|
|
461
|
+
}
|
|
462
|
+
return t2;
|
|
463
|
+
}
|
|
464
|
+
function he(t2) {
|
|
465
|
+
return null == t2 ? t2 : "bigint" == typeof t2 ? (bt(t2) ? t2 = Number(t2) : (t2 = Ht(64, t2), t2 = bt(t2) ? Number(t2) : String(t2)), t2) : Qt(t2) ? "number" == typeof t2 ? se(t2) : oe(t2) : void 0;
|
|
466
|
+
}
|
|
467
|
+
function ue(t2) {
|
|
468
|
+
if (null == t2) return t2;
|
|
469
|
+
var e2 = typeof t2;
|
|
470
|
+
if ("bigint" === e2) return String(Wt(64, t2));
|
|
471
|
+
if (Qt(t2)) {
|
|
472
|
+
if ("string" === e2) return e2 = Yt(Number(t2)), zt(e2) && e2 >= 0 ? t2 = String(e2) : (-1 !== (e2 = t2.indexOf(".")) && (t2 = t2.substring(0, e2)), ne(t2) || (Vt(t2), t2 = Bt(Mt, Pt))), t2;
|
|
473
|
+
if ("number" === e2) return (t2 = Yt(t2)) >= 0 && zt(t2) ? t2 : (function(t3) {
|
|
474
|
+
if (t3 < 0) {
|
|
475
|
+
Ot(t3);
|
|
476
|
+
var e3 = Bt(Mt, Pt);
|
|
477
|
+
return t3 = Number(e3), zt(t3) ? t3 : e3;
|
|
478
|
+
}
|
|
479
|
+
return ne(e3 = String(t3)) ? e3 : (Ot(t3), Dt(Mt, Pt));
|
|
480
|
+
})(t2);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
function le(t2) {
|
|
484
|
+
if ("string" != typeof t2) throw Error();
|
|
485
|
+
return t2;
|
|
486
|
+
}
|
|
487
|
+
function de(t2) {
|
|
488
|
+
if (null != t2 && "string" != typeof t2) throw Error();
|
|
489
|
+
return t2;
|
|
490
|
+
}
|
|
491
|
+
function fe(t2) {
|
|
492
|
+
return null == t2 || "string" == typeof t2 ? t2 : void 0;
|
|
493
|
+
}
|
|
494
|
+
function pe(t2, e2, n2, r2) {
|
|
495
|
+
if (null != t2 && "object" == typeof t2 && t2.W === ut) return t2;
|
|
496
|
+
if (!Array.isArray(t2)) return n2 ? 2 & r2 ? ((t2 = e2[Y]) || (it((t2 = new e2()).u), t2 = e2[Y] = t2), e2 = t2) : e2 = new e2() : e2 = void 0, e2;
|
|
497
|
+
let i2 = n2 = 0 | t2[Q];
|
|
498
|
+
return 0 === i2 && (i2 |= 32 & r2), i2 |= 2 & r2, i2 !== n2 && rt(t2, i2), new e2(t2);
|
|
499
|
+
}
|
|
500
|
+
function ge(t2, e2, n2) {
|
|
501
|
+
if (e2) t: {
|
|
502
|
+
if (!Qt(e2 = t2)) throw X("int64");
|
|
503
|
+
switch (typeof e2) {
|
|
504
|
+
case "string":
|
|
505
|
+
e2 = ae(e2);
|
|
506
|
+
break t;
|
|
507
|
+
case "bigint":
|
|
508
|
+
e2 = At(Ht(64, e2));
|
|
509
|
+
break t;
|
|
510
|
+
default:
|
|
511
|
+
e2 = ce(e2);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
else t2 = typeof (e2 = t2), e2 = null == e2 ? e2 : "bigint" === t2 ? At(Ht(64, e2)) : Qt(e2) ? "string" === t2 ? ae(e2) : ce(e2) : void 0;
|
|
515
|
+
return null == (t2 = e2) ? n2 ? $t : void 0 : t2;
|
|
516
|
+
}
|
|
517
|
+
function me(t2) {
|
|
518
|
+
return t2;
|
|
519
|
+
}
|
|
520
|
+
var ye = {};
|
|
521
|
+
var _e = (function() {
|
|
522
|
+
try {
|
|
523
|
+
return w(new class extends Map {
|
|
524
|
+
constructor() {
|
|
525
|
+
super();
|
|
526
|
+
}
|
|
527
|
+
}()), false;
|
|
528
|
+
} catch {
|
|
529
|
+
return true;
|
|
530
|
+
}
|
|
531
|
+
})();
|
|
532
|
+
var ve = class {
|
|
533
|
+
constructor() {
|
|
534
|
+
this.g = /* @__PURE__ */ new Map();
|
|
535
|
+
}
|
|
536
|
+
get(t2) {
|
|
537
|
+
return this.g.get(t2);
|
|
538
|
+
}
|
|
539
|
+
set(t2, e2) {
|
|
540
|
+
return this.g.set(t2, e2), this.size = this.g.size, this;
|
|
541
|
+
}
|
|
542
|
+
delete(t2) {
|
|
543
|
+
return t2 = this.g.delete(t2), this.size = this.g.size, t2;
|
|
544
|
+
}
|
|
545
|
+
clear() {
|
|
546
|
+
this.g.clear(), this.size = this.g.size;
|
|
547
|
+
}
|
|
548
|
+
has(t2) {
|
|
549
|
+
return this.g.has(t2);
|
|
550
|
+
}
|
|
551
|
+
entries() {
|
|
552
|
+
return this.g.entries();
|
|
553
|
+
}
|
|
554
|
+
keys() {
|
|
555
|
+
return this.g.keys();
|
|
556
|
+
}
|
|
557
|
+
values() {
|
|
558
|
+
return this.g.values();
|
|
559
|
+
}
|
|
560
|
+
forEach(t2, e2) {
|
|
561
|
+
return this.g.forEach(t2, e2);
|
|
562
|
+
}
|
|
563
|
+
[Symbol.iterator]() {
|
|
564
|
+
return this.entries();
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
var Ee = _e ? (Object.setPrototypeOf(ve.prototype, Map.prototype), Object.defineProperties(ve.prototype, { size: { value: 0, configurable: true, enumerable: true, writable: true } }), ve) : class extends Map {
|
|
568
|
+
constructor() {
|
|
569
|
+
super();
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
function we(t2) {
|
|
573
|
+
return t2;
|
|
574
|
+
}
|
|
575
|
+
function Te(t2) {
|
|
576
|
+
if (2 & t2.M) throw Error("Cannot mutate an immutable Map");
|
|
577
|
+
}
|
|
578
|
+
var Ae = class extends Ee {
|
|
579
|
+
constructor(t2, e2, n2 = we, r2 = we) {
|
|
580
|
+
super();
|
|
581
|
+
let i2 = 0 | t2[Q];
|
|
582
|
+
i2 |= 64, rt(t2, i2), this.M = i2, this.I = e2, this.S = n2, this.X = this.I ? be : r2;
|
|
583
|
+
for (let s2 = 0; s2 < t2.length; s2++) {
|
|
584
|
+
const o2 = t2[s2], a2 = n2(o2[0], false, true);
|
|
585
|
+
let c2 = o2[1];
|
|
586
|
+
e2 ? void 0 === c2 && (c2 = null) : c2 = r2(o2[1], false, true, void 0, void 0, i2), super.set(a2, c2);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
La() {
|
|
590
|
+
var t2 = Ce;
|
|
591
|
+
if (0 !== this.size) return Array.from(super.entries(), ((e2) => (e2[0] = t2(e2[0]), e2[1] = t2(e2[1]), e2)));
|
|
592
|
+
}
|
|
593
|
+
da(t2 = ke) {
|
|
594
|
+
const e2 = [], n2 = super.entries();
|
|
595
|
+
for (var r2; !(r2 = n2.next()).done; ) (r2 = r2.value)[0] = t2(r2[0]), r2[1] = t2(r2[1]), e2.push(r2);
|
|
596
|
+
return e2;
|
|
597
|
+
}
|
|
598
|
+
clear() {
|
|
599
|
+
Te(this), super.clear();
|
|
600
|
+
}
|
|
601
|
+
delete(t2) {
|
|
602
|
+
return Te(this), super.delete(this.S(t2, true, false));
|
|
603
|
+
}
|
|
604
|
+
entries() {
|
|
605
|
+
if (this.I) {
|
|
606
|
+
var t2 = super.keys();
|
|
607
|
+
t2 = new gt(t2, Se, this);
|
|
608
|
+
} else t2 = super.entries();
|
|
609
|
+
return t2;
|
|
610
|
+
}
|
|
611
|
+
values() {
|
|
612
|
+
if (this.I) {
|
|
613
|
+
var t2 = super.keys();
|
|
614
|
+
t2 = new gt(t2, Ae.prototype.get, this);
|
|
615
|
+
} else t2 = super.values();
|
|
616
|
+
return t2;
|
|
617
|
+
}
|
|
618
|
+
forEach(t2, e2) {
|
|
619
|
+
this.I ? super.forEach(((n2, r2, i2) => {
|
|
620
|
+
t2.call(e2, i2.get(r2), r2, i2);
|
|
621
|
+
})) : super.forEach(t2, e2);
|
|
622
|
+
}
|
|
623
|
+
set(t2, e2) {
|
|
624
|
+
return Te(this), null == (t2 = this.S(t2, true, false)) ? this : null == e2 ? (super.delete(t2), this) : super.set(t2, this.X(e2, true, true, this.I, false, this.M));
|
|
625
|
+
}
|
|
626
|
+
Ja(t2) {
|
|
627
|
+
const e2 = this.S(t2[0], false, true);
|
|
628
|
+
t2 = t2[1], t2 = this.I ? void 0 === t2 ? null : t2 : this.X(t2, false, true, void 0, false, this.M), super.set(e2, t2);
|
|
629
|
+
}
|
|
630
|
+
has(t2) {
|
|
631
|
+
return super.has(this.S(t2, false, false));
|
|
632
|
+
}
|
|
633
|
+
get(t2) {
|
|
634
|
+
t2 = this.S(t2, false, false);
|
|
635
|
+
const e2 = super.get(t2);
|
|
636
|
+
if (void 0 !== e2) {
|
|
637
|
+
var n2 = this.I;
|
|
638
|
+
return n2 ? ((n2 = this.X(e2, false, true, n2, this.pa, this.M)) !== e2 && super.set(t2, n2), n2) : e2;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
[Symbol.iterator]() {
|
|
642
|
+
return this.entries();
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
function be(t2, e2, n2, r2, i2, s2) {
|
|
646
|
+
return t2 = pe(t2, r2, n2, s2), i2 && (t2 = je(t2)), t2;
|
|
647
|
+
}
|
|
648
|
+
function ke(t2) {
|
|
649
|
+
return t2;
|
|
650
|
+
}
|
|
651
|
+
function Se(t2) {
|
|
652
|
+
return [t2, this.get(t2)];
|
|
653
|
+
}
|
|
654
|
+
var xe;
|
|
655
|
+
var Le;
|
|
656
|
+
var Re;
|
|
657
|
+
var Fe;
|
|
658
|
+
function Ie() {
|
|
659
|
+
return xe || (xe = new Ae(it([]), void 0, void 0, void 0, ye));
|
|
660
|
+
}
|
|
661
|
+
function Me(t2, e2, n2, r2, i2) {
|
|
662
|
+
if (null != t2) {
|
|
663
|
+
if (Array.isArray(t2)) {
|
|
664
|
+
const s2 = 0 | t2[Q];
|
|
665
|
+
return 0 === t2.length && 1 & s2 ? void 0 : i2 && 2 & s2 ? t2 : Pe(t2, e2, n2, void 0 !== r2, i2);
|
|
666
|
+
}
|
|
667
|
+
return e2(t2, r2);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
function Pe(t2, e2, n2, r2, i2) {
|
|
671
|
+
const s2 = r2 || n2 ? 0 | t2[Q] : 0, o2 = r2 ? !!(32 & s2) : void 0;
|
|
672
|
+
let a2 = 0;
|
|
673
|
+
const c2 = (r2 = ct(t2)).length;
|
|
674
|
+
for (let t3 = 0; t3 < c2; t3++) {
|
|
675
|
+
var h2 = r2[t3];
|
|
676
|
+
if (t3 === c2 - 1 && lt(h2)) {
|
|
677
|
+
var u2 = e2, l = n2, d = o2, f = i2;
|
|
678
|
+
let t4;
|
|
679
|
+
for (let e3 in h2) {
|
|
680
|
+
const n3 = Me(h2[e3], u2, l, d, f);
|
|
681
|
+
null != n3 && ((t4 ?? (t4 = {}))[e3] = n3);
|
|
682
|
+
}
|
|
683
|
+
h2 = t4;
|
|
684
|
+
} else h2 = Me(r2[t3], e2, n2, o2, i2);
|
|
685
|
+
r2[t3] = h2, null != h2 && (a2 = t3 + 1);
|
|
686
|
+
}
|
|
687
|
+
return a2 < c2 && (r2.length = a2), n2 && ((t2 = mt(t2)) && (r2[q] = ct(t2)), n2(s2, r2)), r2;
|
|
688
|
+
}
|
|
689
|
+
function Ce(t2) {
|
|
690
|
+
return Me(t2, Oe, void 0, void 0, false);
|
|
691
|
+
}
|
|
692
|
+
function Oe(t2) {
|
|
693
|
+
switch (typeof t2) {
|
|
694
|
+
case "number":
|
|
695
|
+
return Number.isFinite(t2) ? t2 : "" + t2;
|
|
696
|
+
case "bigint":
|
|
697
|
+
return bt(t2) ? Number(t2) : "" + t2;
|
|
698
|
+
case "boolean":
|
|
699
|
+
return t2 ? 1 : 0;
|
|
700
|
+
case "object":
|
|
701
|
+
if (C(t2)) return C(t2) && H(Z), R(t2);
|
|
702
|
+
if (t2.W === ut) return Ue(t2);
|
|
703
|
+
if (t2 instanceof N) {
|
|
704
|
+
const e2 = t2.g;
|
|
705
|
+
return null == e2 ? "" : "string" == typeof e2 ? e2 : t2.g = R(e2);
|
|
706
|
+
}
|
|
707
|
+
return t2 instanceof Ae ? t2.La() : void 0;
|
|
708
|
+
}
|
|
709
|
+
return t2;
|
|
710
|
+
}
|
|
711
|
+
function Ue(t2) {
|
|
712
|
+
var e2 = t2.u;
|
|
713
|
+
t2 = Pe(e2, Oe, void 0, void 0, false);
|
|
714
|
+
var n2 = 0 | e2[Q];
|
|
715
|
+
if ((e2 = t2.length) && !(512 & n2)) {
|
|
716
|
+
var r2 = t2[e2 - 1], i2 = false;
|
|
717
|
+
lt(r2) ? (e2--, i2 = true) : r2 = void 0;
|
|
718
|
+
var s2 = e2 - (n2 = 512 & n2 ? 0 : -1), o2 = (Le ?? me)(s2, n2, t2, r2);
|
|
719
|
+
if (r2 && (t2[e2] = void 0), s2 < o2 && r2) {
|
|
720
|
+
for (var a2 in s2 = true, r2) {
|
|
721
|
+
const c2 = +a2;
|
|
722
|
+
c2 <= o2 ? (t2[i2 = c2 + n2] = r2[a2], e2 = Math.max(i2 + 1, e2), i2 = false, delete r2[a2]) : s2 = false;
|
|
723
|
+
}
|
|
724
|
+
s2 && (r2 = void 0);
|
|
725
|
+
}
|
|
726
|
+
for (s2 = e2 - 1; e2 > 0; s2 = e2 - 1) if (null == (a2 = t2[s2])) e2--, i2 = true;
|
|
727
|
+
else {
|
|
728
|
+
if (!((s2 -= n2) >= o2)) break;
|
|
729
|
+
(r2 ?? (r2 = {}))[s2] = a2, e2--, i2 = true;
|
|
730
|
+
}
|
|
731
|
+
i2 && (t2.length = e2), r2 && t2.push(r2);
|
|
732
|
+
}
|
|
733
|
+
return t2;
|
|
734
|
+
}
|
|
735
|
+
function De(t2, e2, n2) {
|
|
736
|
+
return t2 = Ne(t2, e2[0], e2[1], n2 ? 1 : 2), e2 !== Re && n2 && nt(t2, 8192), t2;
|
|
737
|
+
}
|
|
738
|
+
function Ne(t2, e2, n2, r2) {
|
|
739
|
+
if (null == t2) {
|
|
740
|
+
var i2 = 96;
|
|
741
|
+
n2 ? (t2 = [n2], i2 |= 512) : t2 = [], e2 && (i2 = -16760833 & i2 | (1023 & e2) << 14);
|
|
742
|
+
} else {
|
|
743
|
+
if (!Array.isArray(t2)) throw Error("narr");
|
|
744
|
+
if (8192 & (i2 = 0 | t2[Q]) || !(64 & i2) || 2 & i2 || H(J), 1024 & i2) throw Error("farr");
|
|
745
|
+
if (64 & i2) return t2;
|
|
746
|
+
if (1 === r2 || 2 === r2 || (i2 |= 64), n2 && (i2 |= 512, n2 !== t2[0])) throw Error("mid");
|
|
747
|
+
t: {
|
|
748
|
+
var s2 = (n2 = t2).length;
|
|
749
|
+
if (s2) {
|
|
750
|
+
var o2 = s2 - 1;
|
|
751
|
+
if (lt(r2 = n2[o2])) {
|
|
752
|
+
if ((o2 -= e2 = 512 & (i2 |= 256) ? 0 : -1) >= 1024) throw Error("pvtlmt");
|
|
753
|
+
for (var a2 in r2) (s2 = +a2) < o2 && (n2[s2 + e2] = r2[a2], delete r2[a2]);
|
|
754
|
+
i2 = -16760833 & i2 | (1023 & o2) << 14;
|
|
755
|
+
break t;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
if (e2) {
|
|
759
|
+
if ((a2 = Math.max(e2, s2 - (512 & i2 ? 0 : -1))) > 1024) throw Error("spvt");
|
|
760
|
+
i2 = -16760833 & i2 | (1023 & a2) << 14;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
return rt(t2, i2), t2;
|
|
765
|
+
}
|
|
766
|
+
function Be(t2, e2, n2 = ot) {
|
|
767
|
+
if (null != t2) {
|
|
768
|
+
if (x && t2 instanceof Uint8Array) return e2 ? t2 : new Uint8Array(t2);
|
|
769
|
+
if (Array.isArray(t2)) {
|
|
770
|
+
var r2 = 0 | t2[Q];
|
|
771
|
+
return 2 & r2 ? t2 : (e2 && (e2 = 0 === r2 || !!(32 & r2) && !(64 & r2 || !(16 & r2))), e2 ? (rt(t2, 34 | r2), 4 & r2 && Object.freeze(t2), t2) : Pe(t2, Be, 4 & r2 ? ot : n2, true, true));
|
|
772
|
+
}
|
|
773
|
+
return t2.W === ut ? t2 = 2 & (r2 = 0 | (n2 = t2.u)[Q]) ? t2 : new t2.constructor(Ge(n2, r2, true)) : t2 instanceof Ae && !(2 & t2.M) && (n2 = it(t2.da(Be)), t2 = new Ae(n2, t2.I, t2.S, t2.X)), t2;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
function Ge(t2, e2, n2) {
|
|
777
|
+
const r2 = n2 || 2 & e2 ? ot : st, i2 = !!(32 & e2);
|
|
778
|
+
return t2 = (function(t3, e3, n3) {
|
|
779
|
+
const r3 = ct(t3);
|
|
780
|
+
var i3 = r3.length;
|
|
781
|
+
const s2 = 256 & e3 ? r3[i3 - 1] : void 0;
|
|
782
|
+
for (i3 += s2 ? -1 : 0, e3 = 512 & e3 ? 1 : 0; e3 < i3; e3++) r3[e3] = n3(r3[e3]);
|
|
783
|
+
if (s2) {
|
|
784
|
+
e3 = r3[e3] = {};
|
|
785
|
+
for (const t4 in s2) e3[t4] = n3(s2[t4]);
|
|
786
|
+
}
|
|
787
|
+
return (t3 = mt(t3)) && (r3[q] = ct(t3)), r3;
|
|
788
|
+
})(t2, e2, ((t3) => Be(t3, i2, r2))), nt(t2, 32 | (n2 ? 2 : 0)), t2;
|
|
789
|
+
}
|
|
790
|
+
function je(t2) {
|
|
791
|
+
const e2 = t2.u, n2 = 0 | e2[Q];
|
|
792
|
+
return 2 & n2 ? new t2.constructor(Ge(e2, n2, false)) : t2;
|
|
793
|
+
}
|
|
794
|
+
function Ve(t2, e2) {
|
|
795
|
+
return Xe(t2 = t2.u, 0 | t2[Q], e2);
|
|
796
|
+
}
|
|
797
|
+
function Xe(t2, e2, n2) {
|
|
798
|
+
if (-1 === n2) return null;
|
|
799
|
+
const r2 = n2 + (512 & e2 ? 0 : -1), i2 = t2.length - 1;
|
|
800
|
+
return r2 >= i2 && 256 & e2 ? t2[i2][n2] : r2 <= i2 ? t2[r2] : void 0;
|
|
801
|
+
}
|
|
802
|
+
function He(t2, e2, n2) {
|
|
803
|
+
const r2 = t2.u;
|
|
804
|
+
let i2 = 0 | r2[Q];
|
|
805
|
+
return pt(i2), We(r2, i2, e2, n2), t2;
|
|
806
|
+
}
|
|
807
|
+
function We(t2, e2, n2, r2) {
|
|
808
|
+
const i2 = 512 & e2 ? 0 : -1, s2 = n2 + i2;
|
|
809
|
+
var o2 = t2.length - 1;
|
|
810
|
+
return s2 >= o2 && 256 & e2 ? (t2[o2][n2] = r2, e2) : s2 <= o2 ? (t2[s2] = r2, e2) : (void 0 !== r2 && (n2 >= (o2 = e2 >> 14 & 1023 || 536870912) ? null != r2 && (t2[o2 + i2] = { [n2]: r2 }, rt(t2, e2 |= 256)) : t2[s2] = r2), e2);
|
|
811
|
+
}
|
|
812
|
+
function ze(t2, e2) {
|
|
813
|
+
let n2 = 0 | (t2 = t2.u)[Q];
|
|
814
|
+
const r2 = Xe(t2, n2, e2), i2 = qt(r2);
|
|
815
|
+
return null != i2 && i2 !== r2 && We(t2, n2, e2, i2), i2;
|
|
816
|
+
}
|
|
817
|
+
function Ke(t2) {
|
|
818
|
+
let e2 = 0 | (t2 = t2.u)[Q];
|
|
819
|
+
const n2 = Xe(t2, e2, 1), r2 = dt(n2, true);
|
|
820
|
+
return null != r2 && r2 !== n2 && We(t2, e2, 1, r2), r2;
|
|
821
|
+
}
|
|
822
|
+
function Ye() {
|
|
823
|
+
return void 0 === yt ? 2 : 4;
|
|
824
|
+
}
|
|
825
|
+
function $e(t2, e2, n2, r2, i2) {
|
|
826
|
+
const s2 = t2.u, o2 = 2 & (t2 = 0 | s2[Q]) ? 1 : r2;
|
|
827
|
+
i2 = !!i2;
|
|
828
|
+
let a2 = 0 | (r2 = qe(s2, t2, e2))[Q];
|
|
829
|
+
if (!(4 & a2)) {
|
|
830
|
+
4 & a2 && (r2 = ct(r2), a2 = pn(a2, t2), t2 = We(s2, t2, e2, r2));
|
|
831
|
+
let i3 = 0, o3 = 0;
|
|
832
|
+
for (; i3 < r2.length; i3++) {
|
|
833
|
+
const t3 = n2(r2[i3]);
|
|
834
|
+
null != t3 && (r2[o3++] = t3);
|
|
835
|
+
}
|
|
836
|
+
o3 < i3 && (r2.length = o3), a2 = Je(a2, t2), n2 = -2049 & (20 | a2), a2 = n2 &= -4097, rt(r2, a2), 2 & a2 && Object.freeze(r2);
|
|
837
|
+
}
|
|
838
|
+
return 1 === o2 || 4 === o2 && 32 & a2 ? Ze(a2) || (i2 = a2, a2 |= 2, a2 !== i2 && rt(r2, a2), Object.freeze(r2)) : (2 === o2 && Ze(a2) && (r2 = ct(r2), a2 = pn(a2, t2), a2 = gn(a2, t2, i2), rt(r2, a2), t2 = We(s2, t2, e2, r2)), Ze(a2) || (e2 = a2, a2 = gn(a2, t2, i2), a2 !== e2 && rt(r2, a2))), r2;
|
|
839
|
+
}
|
|
840
|
+
function qe(t2, e2, n2) {
|
|
841
|
+
return t2 = Xe(t2, e2, n2), Array.isArray(t2) ? t2 : ht;
|
|
842
|
+
}
|
|
843
|
+
function Je(t2, e2) {
|
|
844
|
+
return 0 === t2 && (t2 = pn(t2, e2)), 1 | t2;
|
|
845
|
+
}
|
|
846
|
+
function Ze(t2) {
|
|
847
|
+
return !!(2 & t2) && !!(4 & t2) || !!(1024 & t2);
|
|
848
|
+
}
|
|
849
|
+
function Qe(t2) {
|
|
850
|
+
t2 = ct(t2);
|
|
851
|
+
for (let e2 = 0; e2 < t2.length; e2++) {
|
|
852
|
+
const n2 = t2[e2] = ct(t2[e2]);
|
|
853
|
+
Array.isArray(n2[1]) && (n2[1] = it(n2[1]));
|
|
854
|
+
}
|
|
855
|
+
return t2;
|
|
856
|
+
}
|
|
857
|
+
function tn(t2, e2, n2, r2) {
|
|
858
|
+
let i2 = 0 | (t2 = t2.u)[Q];
|
|
859
|
+
pt(i2), We(t2, i2, e2, ("0" === r2 ? 0 === Number(n2) : n2 === r2) ? void 0 : n2);
|
|
860
|
+
}
|
|
861
|
+
function en(t2, e2, n2, r2) {
|
|
862
|
+
pt(e2);
|
|
863
|
+
let i2 = qe(t2, e2, n2);
|
|
864
|
+
const s2 = i2 !== ht;
|
|
865
|
+
if (64 & e2 || !(8192 & e2) || !s2) {
|
|
866
|
+
const o2 = s2 ? 0 | i2[Q] : 0;
|
|
867
|
+
let a2 = o2;
|
|
868
|
+
(!s2 || 2 & a2 || Ze(a2) || 4 & a2 && !(32 & a2)) && (i2 = ct(i2), a2 = pn(a2, e2), e2 = We(t2, e2, n2, i2)), a2 = -13 & Je(a2, e2), a2 = gn(r2 ? -17 & a2 : 16 | a2, e2, true), a2 !== o2 && rt(i2, a2);
|
|
869
|
+
}
|
|
870
|
+
return i2;
|
|
871
|
+
}
|
|
872
|
+
function nn(t2, e2) {
|
|
873
|
+
var n2 = Ts;
|
|
874
|
+
return on(rn(t2 = t2.u), t2, 0 | t2[Q], n2) === e2 ? e2 : -1;
|
|
875
|
+
}
|
|
876
|
+
function rn(t2) {
|
|
877
|
+
if (W) return t2[$] ?? (t2[$] = /* @__PURE__ */ new Map());
|
|
878
|
+
if ($ in t2) return t2[$];
|
|
879
|
+
const e2 = /* @__PURE__ */ new Map();
|
|
880
|
+
return Object.defineProperty(t2, $, { value: e2 }), e2;
|
|
881
|
+
}
|
|
882
|
+
function sn(t2, e2, n2, r2) {
|
|
883
|
+
const i2 = rn(t2), s2 = on(i2, t2, e2, n2);
|
|
884
|
+
return s2 !== r2 && (s2 && (e2 = We(t2, e2, s2)), i2.set(n2, r2)), e2;
|
|
885
|
+
}
|
|
886
|
+
function on(t2, e2, n2, r2) {
|
|
887
|
+
let i2 = t2.get(r2);
|
|
888
|
+
if (null != i2) return i2;
|
|
889
|
+
i2 = 0;
|
|
890
|
+
for (let t3 = 0; t3 < r2.length; t3++) {
|
|
891
|
+
const s2 = r2[t3];
|
|
892
|
+
null != Xe(e2, n2, s2) && (0 !== i2 && (n2 = We(e2, n2, i2)), i2 = s2);
|
|
893
|
+
}
|
|
894
|
+
return t2.set(r2, i2), i2;
|
|
895
|
+
}
|
|
896
|
+
function an(t2, e2, n2) {
|
|
897
|
+
let r2 = 0 | t2[Q];
|
|
898
|
+
const i2 = Xe(t2, r2, n2);
|
|
899
|
+
let s2;
|
|
900
|
+
if (null != i2 && i2.W === ut) return (e2 = je(i2)) !== i2 && We(t2, r2, n2, e2), e2.u;
|
|
901
|
+
if (Array.isArray(i2)) {
|
|
902
|
+
const t3 = 0 | i2[Q];
|
|
903
|
+
s2 = 2 & t3 ? De(Ge(i2, t3, false), e2, true) : 64 & t3 ? i2 : De(s2, e2, true);
|
|
904
|
+
} else s2 = De(void 0, e2, true);
|
|
905
|
+
return s2 !== i2 && We(t2, r2, n2, s2), s2;
|
|
906
|
+
}
|
|
907
|
+
function cn(t2, e2, n2) {
|
|
908
|
+
let r2 = 0 | (t2 = t2.u)[Q];
|
|
909
|
+
const i2 = Xe(t2, r2, n2);
|
|
910
|
+
return (e2 = pe(i2, e2, false, r2)) !== i2 && null != e2 && We(t2, r2, n2, e2), e2;
|
|
911
|
+
}
|
|
912
|
+
function hn(t2, e2, n2) {
|
|
913
|
+
if (null == (e2 = cn(t2, e2, n2))) return e2;
|
|
914
|
+
let r2 = 0 | (t2 = t2.u)[Q];
|
|
915
|
+
if (!(2 & r2)) {
|
|
916
|
+
const i2 = je(e2);
|
|
917
|
+
i2 !== e2 && We(t2, r2, n2, e2 = i2);
|
|
918
|
+
}
|
|
919
|
+
return e2;
|
|
920
|
+
}
|
|
921
|
+
function un(t2, e2, n2, r2, i2, s2, o2) {
|
|
922
|
+
t2 = t2.u;
|
|
923
|
+
var a2 = !!(2 & e2);
|
|
924
|
+
const c2 = a2 ? 1 : i2;
|
|
925
|
+
s2 = !!s2, o2 && (o2 = !a2);
|
|
926
|
+
var h2 = 0 | (i2 = qe(t2, e2, r2))[Q];
|
|
927
|
+
if (!(a2 = !!(4 & h2))) {
|
|
928
|
+
var u2 = i2, l = e2;
|
|
929
|
+
const t3 = !!(2 & (h2 = Je(h2, e2)));
|
|
930
|
+
t3 && (l |= 2);
|
|
931
|
+
let r3 = !t3, s3 = true, o3 = 0, a3 = 0;
|
|
932
|
+
for (; o3 < u2.length; o3++) {
|
|
933
|
+
const e3 = pe(u2[o3], n2, false, l);
|
|
934
|
+
if (e3 instanceof n2) {
|
|
935
|
+
if (!t3) {
|
|
936
|
+
const t4 = !!(2 & (0 | e3.u[Q]));
|
|
937
|
+
r3 && (r3 = !t4), s3 && (s3 = t4);
|
|
938
|
+
}
|
|
939
|
+
u2[a3++] = e3;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
a3 < o3 && (u2.length = a3), h2 |= 4, h2 = s3 ? 16 | h2 : -17 & h2, rt(u2, h2 = r3 ? 8 | h2 : -9 & h2), t3 && Object.freeze(u2);
|
|
943
|
+
}
|
|
944
|
+
if (o2 && !(8 & h2 || !i2.length && (1 === c2 || 4 === c2 && 32 & h2))) {
|
|
945
|
+
for (Ze(h2) && (i2 = ct(i2), h2 = pn(h2, e2), e2 = We(t2, e2, r2, i2)), n2 = i2, o2 = h2, u2 = 0; u2 < n2.length; u2++) (h2 = n2[u2]) !== (l = je(h2)) && (n2[u2] = l);
|
|
946
|
+
o2 |= 8, rt(n2, o2 = n2.length ? -17 & o2 : 16 | o2), h2 = o2;
|
|
947
|
+
}
|
|
948
|
+
return 1 === c2 || 4 === c2 && 32 & h2 ? Ze(h2) || (e2 = h2, (h2 |= !i2.length || 16 & h2 && (!a2 || 32 & h2) ? 2 : 1024) !== e2 && rt(i2, h2), Object.freeze(i2)) : (2 === c2 && Ze(h2) && (rt(i2 = ct(i2), h2 = gn(h2 = pn(h2, e2), e2, s2)), e2 = We(t2, e2, r2, i2)), Ze(h2) || (r2 = h2, (h2 = gn(h2, e2, s2)) !== r2 && rt(i2, h2))), i2;
|
|
949
|
+
}
|
|
950
|
+
function ln(t2, e2, n2) {
|
|
951
|
+
const r2 = 0 | t2.u[Q];
|
|
952
|
+
return un(t2, r2, e2, n2, Ye(), false, !(2 & r2));
|
|
953
|
+
}
|
|
954
|
+
function dn(t2, e2, n2, r2) {
|
|
955
|
+
return null == r2 && (r2 = void 0), He(t2, n2, r2);
|
|
956
|
+
}
|
|
957
|
+
function fn(t2, e2, n2, r2) {
|
|
958
|
+
null == r2 && (r2 = void 0);
|
|
959
|
+
t: {
|
|
960
|
+
let i2 = 0 | (t2 = t2.u)[Q];
|
|
961
|
+
if (pt(i2), null == r2) {
|
|
962
|
+
const r3 = rn(t2);
|
|
963
|
+
if (on(r3, t2, i2, n2) !== e2) break t;
|
|
964
|
+
r3.set(n2, 0);
|
|
965
|
+
} else i2 = sn(t2, i2, n2, e2);
|
|
966
|
+
We(t2, i2, e2, r2);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
function pn(t2, e2) {
|
|
970
|
+
return -1025 & (t2 = 32 | (2 & e2 ? 2 | t2 : -3 & t2));
|
|
971
|
+
}
|
|
972
|
+
function gn(t2, e2, n2) {
|
|
973
|
+
return 32 & e2 && n2 || (t2 &= -33), t2;
|
|
974
|
+
}
|
|
975
|
+
function mn(t2, e2, n2) {
|
|
976
|
+
pt(0 | t2.u[Q]), $e(t2, e2, fe, 2, true).push(le(n2));
|
|
977
|
+
}
|
|
978
|
+
function yn(t2, e2, n2, r2) {
|
|
979
|
+
const i2 = 0 | t2.u[Q];
|
|
980
|
+
pt(i2), t2 = un(t2, i2, n2, e2, 2, true), r2 = null != r2 ? r2 : new n2(), t2.push(r2), t2[Q] = 2 & (0 | r2.u[Q]) ? -9 & t2[Q] : -17 & t2[Q];
|
|
981
|
+
}
|
|
982
|
+
function _n(t2, e2) {
|
|
983
|
+
return te(Ve(t2, e2));
|
|
984
|
+
}
|
|
985
|
+
function vn(t2, e2) {
|
|
986
|
+
return fe(Ve(t2, e2));
|
|
987
|
+
}
|
|
988
|
+
function En(t2, e2) {
|
|
989
|
+
return ze(t2, e2) ?? 0;
|
|
990
|
+
}
|
|
991
|
+
function wn(t2, e2, n2) {
|
|
992
|
+
if (null != n2 && "boolean" != typeof n2) throw t2 = typeof n2, Error(`Expected boolean but got ${"object" != t2 ? t2 : n2 ? Array.isArray(n2) ? "array" : t2 : "null"}: ${n2}`);
|
|
993
|
+
He(t2, e2, n2);
|
|
994
|
+
}
|
|
995
|
+
function Tn(t2, e2, n2) {
|
|
996
|
+
if (null != n2) {
|
|
997
|
+
if ("number" != typeof n2) throw X("int32");
|
|
998
|
+
if (!Kt(n2)) throw X("int32");
|
|
999
|
+
n2 |= 0;
|
|
1000
|
+
}
|
|
1001
|
+
He(t2, e2, n2);
|
|
1002
|
+
}
|
|
1003
|
+
function An(t2, e2, n2) {
|
|
1004
|
+
if (null != n2 && "number" != typeof n2) throw Error(`Value of float/double field must be a number, found ${typeof n2}: ${n2}`);
|
|
1005
|
+
He(t2, e2, n2);
|
|
1006
|
+
}
|
|
1007
|
+
function bn(t2, e2, n2) {
|
|
1008
|
+
{
|
|
1009
|
+
const o2 = t2.u;
|
|
1010
|
+
let a2 = 0 | o2[Q];
|
|
1011
|
+
if (pt(a2), null == n2) We(o2, a2, e2);
|
|
1012
|
+
else {
|
|
1013
|
+
var r2 = t2 = 0 | n2[Q], i2 = Ze(t2), s2 = i2 || Object.isFrozen(n2);
|
|
1014
|
+
for (i2 || (t2 = 0), s2 || (n2 = ct(n2), r2 = 0, t2 = gn(t2 = pn(t2, a2), a2, true), s2 = false), t2 |= 21, i2 = 0; i2 < n2.length; i2++) {
|
|
1015
|
+
const e3 = n2[i2], o3 = le(e3);
|
|
1016
|
+
Object.is(e3, o3) || (s2 && (n2 = ct(n2), r2 = 0, t2 = gn(t2 = pn(t2, a2), a2, true), s2 = false), n2[i2] = o3);
|
|
1017
|
+
}
|
|
1018
|
+
t2 !== r2 && (s2 && (n2 = ct(n2), t2 = gn(t2 = pn(t2, a2), a2, true)), rt(n2, t2)), We(o2, a2, e2, n2);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
function kn(t2, e2) {
|
|
1023
|
+
return Error(`Invalid wire type: ${t2} (at position ${e2})`);
|
|
1024
|
+
}
|
|
1025
|
+
function Sn() {
|
|
1026
|
+
return Error("Failed to read varint, encoding is invalid.");
|
|
1027
|
+
}
|
|
1028
|
+
function xn(t2, e2) {
|
|
1029
|
+
return Error(`Tried to read past the end of the data ${e2} > ${t2}`);
|
|
1030
|
+
}
|
|
1031
|
+
function Ln(t2) {
|
|
1032
|
+
if ("string" == typeof t2) return { buffer: P(t2), O: false };
|
|
1033
|
+
if (Array.isArray(t2)) return { buffer: new Uint8Array(t2), O: false };
|
|
1034
|
+
if (t2.constructor === Uint8Array) return { buffer: t2, O: false };
|
|
1035
|
+
if (t2.constructor === ArrayBuffer) return { buffer: new Uint8Array(t2), O: false };
|
|
1036
|
+
if (t2.constructor === N) return { buffer: D(t2) || new Uint8Array(0), O: true };
|
|
1037
|
+
if (t2 instanceof Uint8Array) return { buffer: new Uint8Array(t2.buffer, t2.byteOffset, t2.byteLength), O: false };
|
|
1038
|
+
throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers");
|
|
1039
|
+
}
|
|
1040
|
+
function Rn(t2, e2) {
|
|
1041
|
+
let n2, r2 = 0, i2 = 0, s2 = 0;
|
|
1042
|
+
const o2 = t2.h;
|
|
1043
|
+
let a2 = t2.g;
|
|
1044
|
+
do {
|
|
1045
|
+
n2 = o2[a2++], r2 |= (127 & n2) << s2, s2 += 7;
|
|
1046
|
+
} while (s2 < 32 && 128 & n2);
|
|
1047
|
+
for (s2 > 32 && (i2 |= (127 & n2) >> 4), s2 = 3; s2 < 32 && 128 & n2; s2 += 7) n2 = o2[a2++], i2 |= (127 & n2) << s2;
|
|
1048
|
+
if (Dn(t2, a2), n2 < 128) return e2(r2 >>> 0, i2 >>> 0);
|
|
1049
|
+
throw Sn();
|
|
1050
|
+
}
|
|
1051
|
+
function Fn(t2) {
|
|
1052
|
+
let e2 = 0, n2 = t2.g;
|
|
1053
|
+
const r2 = n2 + 10, i2 = t2.h;
|
|
1054
|
+
for (; n2 < r2; ) {
|
|
1055
|
+
const r3 = i2[n2++];
|
|
1056
|
+
if (e2 |= r3, 0 == (128 & r3)) return Dn(t2, n2), !!(127 & e2);
|
|
1057
|
+
}
|
|
1058
|
+
throw Sn();
|
|
1059
|
+
}
|
|
1060
|
+
function In(t2) {
|
|
1061
|
+
const e2 = t2.h;
|
|
1062
|
+
let n2 = t2.g, r2 = e2[n2++], i2 = 127 & r2;
|
|
1063
|
+
if (128 & r2 && (r2 = e2[n2++], i2 |= (127 & r2) << 7, 128 & r2 && (r2 = e2[n2++], i2 |= (127 & r2) << 14, 128 & r2 && (r2 = e2[n2++], i2 |= (127 & r2) << 21, 128 & r2 && (r2 = e2[n2++], i2 |= r2 << 28, 128 & r2 && 128 & e2[n2++] && 128 & e2[n2++] && 128 & e2[n2++] && 128 & e2[n2++] && 128 & e2[n2++]))))) throw Sn();
|
|
1064
|
+
return Dn(t2, n2), i2;
|
|
1065
|
+
}
|
|
1066
|
+
function Mn(t2) {
|
|
1067
|
+
return In(t2) >>> 0;
|
|
1068
|
+
}
|
|
1069
|
+
function Pn(t2) {
|
|
1070
|
+
var e2 = t2.h;
|
|
1071
|
+
const n2 = t2.g, r2 = e2[n2], i2 = e2[n2 + 1], s2 = e2[n2 + 2];
|
|
1072
|
+
return e2 = e2[n2 + 3], Dn(t2, t2.g + 4), (r2 << 0 | i2 << 8 | s2 << 16 | e2 << 24) >>> 0;
|
|
1073
|
+
}
|
|
1074
|
+
function Cn(t2) {
|
|
1075
|
+
var e2 = Pn(t2);
|
|
1076
|
+
t2 = 2 * (e2 >> 31) + 1;
|
|
1077
|
+
const n2 = e2 >>> 23 & 255;
|
|
1078
|
+
return e2 &= 8388607, 255 == n2 ? e2 ? NaN : t2 * (1 / 0) : 0 == n2 ? 1401298464324817e-60 * t2 * e2 : t2 * Math.pow(2, n2 - 150) * (e2 + 8388608);
|
|
1079
|
+
}
|
|
1080
|
+
function On(t2) {
|
|
1081
|
+
return In(t2);
|
|
1082
|
+
}
|
|
1083
|
+
function Un(t2, e2, { aa: n2 = false } = {}) {
|
|
1084
|
+
t2.aa = n2, e2 && (e2 = Ln(e2), t2.h = e2.buffer, t2.m = e2.O, t2.j = 0, t2.l = t2.h.length, t2.g = t2.j);
|
|
1085
|
+
}
|
|
1086
|
+
function Dn(t2, e2) {
|
|
1087
|
+
if (t2.g = e2, e2 > t2.l) throw xn(t2.l, e2);
|
|
1088
|
+
}
|
|
1089
|
+
function Nn(t2, e2) {
|
|
1090
|
+
if (e2 < 0) throw Error(`Tried to read a negative byte length: ${e2}`);
|
|
1091
|
+
const n2 = t2.g, r2 = n2 + e2;
|
|
1092
|
+
if (r2 > t2.l) throw xn(e2, t2.l - n2);
|
|
1093
|
+
return t2.g = r2, n2;
|
|
1094
|
+
}
|
|
1095
|
+
function Bn(t2, e2) {
|
|
1096
|
+
if (0 == e2) return U();
|
|
1097
|
+
var n2 = Nn(t2, e2);
|
|
1098
|
+
return t2.aa && t2.m ? n2 = t2.h.subarray(n2, n2 + e2) : (t2 = t2.h, n2 = n2 === (e2 = n2 + e2) ? new Uint8Array(0) : Ft ? t2.slice(n2, e2) : new Uint8Array(t2.subarray(n2, e2))), 0 == n2.length ? U() : new N(n2, O);
|
|
1099
|
+
}
|
|
1100
|
+
Ae.prototype.toJSON = void 0;
|
|
1101
|
+
var Gn = [];
|
|
1102
|
+
function jn(t2) {
|
|
1103
|
+
var e2 = t2.g;
|
|
1104
|
+
if (e2.g == e2.l) return false;
|
|
1105
|
+
t2.l = t2.g.g;
|
|
1106
|
+
var n2 = Mn(t2.g);
|
|
1107
|
+
if (e2 = n2 >>> 3, !((n2 &= 7) >= 0 && n2 <= 5)) throw kn(n2, t2.l);
|
|
1108
|
+
if (e2 < 1) throw Error(`Invalid field number: ${e2} (at position ${t2.l})`);
|
|
1109
|
+
return t2.m = e2, t2.h = n2, true;
|
|
1110
|
+
}
|
|
1111
|
+
function Vn(t2) {
|
|
1112
|
+
switch (t2.h) {
|
|
1113
|
+
case 0:
|
|
1114
|
+
0 != t2.h ? Vn(t2) : Fn(t2.g);
|
|
1115
|
+
break;
|
|
1116
|
+
case 1:
|
|
1117
|
+
Dn(t2 = t2.g, t2.g + 8);
|
|
1118
|
+
break;
|
|
1119
|
+
case 2:
|
|
1120
|
+
if (2 != t2.h) Vn(t2);
|
|
1121
|
+
else {
|
|
1122
|
+
var e2 = Mn(t2.g);
|
|
1123
|
+
Dn(t2 = t2.g, t2.g + e2);
|
|
1124
|
+
}
|
|
1125
|
+
break;
|
|
1126
|
+
case 5:
|
|
1127
|
+
Dn(t2 = t2.g, t2.g + 4);
|
|
1128
|
+
break;
|
|
1129
|
+
case 3:
|
|
1130
|
+
for (e2 = t2.m; ; ) {
|
|
1131
|
+
if (!jn(t2)) throw Error("Unmatched start-group tag: stream EOF");
|
|
1132
|
+
if (4 == t2.h) {
|
|
1133
|
+
if (t2.m != e2) throw Error("Unmatched end-group tag");
|
|
1134
|
+
break;
|
|
1135
|
+
}
|
|
1136
|
+
Vn(t2);
|
|
1137
|
+
}
|
|
1138
|
+
break;
|
|
1139
|
+
default:
|
|
1140
|
+
throw kn(t2.h, t2.l);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
function Xn(t2, e2, n2) {
|
|
1144
|
+
const r2 = t2.g.l, i2 = Mn(t2.g), s2 = t2.g.g + i2;
|
|
1145
|
+
let o2 = s2 - r2;
|
|
1146
|
+
if (o2 <= 0 && (t2.g.l = s2, n2(e2, t2, void 0, void 0, void 0), o2 = s2 - t2.g.g), o2) throw Error(`Message parsing ended unexpectedly. Expected to read ${i2} bytes, instead read ${i2 - o2} bytes, either the data ended unexpectedly or the message misreported its own length`);
|
|
1147
|
+
return t2.g.g = s2, t2.g.l = r2, e2;
|
|
1148
|
+
}
|
|
1149
|
+
function Hn(t2) {
|
|
1150
|
+
var o2 = Mn(t2.g), a2 = Nn(t2 = t2.g, o2);
|
|
1151
|
+
if (t2 = t2.h, s) {
|
|
1152
|
+
var c2, h2 = t2;
|
|
1153
|
+
(c2 = i) || (c2 = i = new TextDecoder("utf-8", { fatal: true })), o2 = a2 + o2, h2 = 0 === a2 && o2 === h2.length ? h2 : h2.subarray(a2, o2);
|
|
1154
|
+
try {
|
|
1155
|
+
var u2 = c2.decode(h2);
|
|
1156
|
+
} catch (t3) {
|
|
1157
|
+
if (void 0 === r) {
|
|
1158
|
+
try {
|
|
1159
|
+
c2.decode(new Uint8Array([128]));
|
|
1160
|
+
} catch (t4) {
|
|
1161
|
+
}
|
|
1162
|
+
try {
|
|
1163
|
+
c2.decode(new Uint8Array([97])), r = true;
|
|
1164
|
+
} catch (t4) {
|
|
1165
|
+
r = false;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
throw !r && (i = void 0), t3;
|
|
1169
|
+
}
|
|
1170
|
+
} else {
|
|
1171
|
+
o2 = (u2 = a2) + o2, a2 = [];
|
|
1172
|
+
let r2, i2 = null;
|
|
1173
|
+
for (; u2 < o2; ) {
|
|
1174
|
+
var l = t2[u2++];
|
|
1175
|
+
l < 128 ? a2.push(l) : l < 224 ? u2 >= o2 ? e() : (r2 = t2[u2++], l < 194 || 128 != (192 & r2) ? (u2--, e()) : a2.push((31 & l) << 6 | 63 & r2)) : l < 240 ? u2 >= o2 - 1 ? e() : (r2 = t2[u2++], 128 != (192 & r2) || 224 === l && r2 < 160 || 237 === l && r2 >= 160 || 128 != (192 & (c2 = t2[u2++])) ? (u2--, e()) : a2.push((15 & l) << 12 | (63 & r2) << 6 | 63 & c2)) : l <= 244 ? u2 >= o2 - 2 ? e() : (r2 = t2[u2++], 128 != (192 & r2) || r2 - 144 + (l << 28) >> 30 != 0 || 128 != (192 & (c2 = t2[u2++])) || 128 != (192 & (h2 = t2[u2++])) ? (u2--, e()) : (l = (7 & l) << 18 | (63 & r2) << 12 | (63 & c2) << 6 | 63 & h2, l -= 65536, a2.push(55296 + (l >> 10 & 1023), 56320 + (1023 & l)))) : e(), a2.length >= 8192 && (i2 = n(i2, a2), a2.length = 0);
|
|
1176
|
+
}
|
|
1177
|
+
u2 = n(i2, a2);
|
|
1178
|
+
}
|
|
1179
|
+
return u2;
|
|
1180
|
+
}
|
|
1181
|
+
function Wn(t2) {
|
|
1182
|
+
const e2 = Mn(t2.g);
|
|
1183
|
+
return Bn(t2.g, e2);
|
|
1184
|
+
}
|
|
1185
|
+
function zn(t2, e2, n2) {
|
|
1186
|
+
var r2 = Mn(t2.g);
|
|
1187
|
+
for (r2 = t2.g.g + r2; t2.g.g < r2; ) n2.push(e2(t2.g));
|
|
1188
|
+
}
|
|
1189
|
+
var Kn = [];
|
|
1190
|
+
function Yn(t2, e2, n2) {
|
|
1191
|
+
e2.g ? e2.m(t2, e2.g, e2.h, n2) : e2.m(t2, e2.h, n2);
|
|
1192
|
+
}
|
|
1193
|
+
var $n = class {
|
|
1194
|
+
constructor(t2, e2) {
|
|
1195
|
+
this.u = Ne(t2, e2);
|
|
1196
|
+
}
|
|
1197
|
+
toJSON() {
|
|
1198
|
+
try {
|
|
1199
|
+
var t2 = Ue(this);
|
|
1200
|
+
} finally {
|
|
1201
|
+
Le = void 0;
|
|
1202
|
+
}
|
|
1203
|
+
return t2;
|
|
1204
|
+
}
|
|
1205
|
+
l() {
|
|
1206
|
+
var t2 = _o;
|
|
1207
|
+
return t2.g ? t2.l(this, t2.g, t2.h) : t2.l(this, t2.h, t2.defaultValue);
|
|
1208
|
+
}
|
|
1209
|
+
clone() {
|
|
1210
|
+
const t2 = this.u;
|
|
1211
|
+
return new this.constructor(Ge(t2, 0 | t2[Q], false));
|
|
1212
|
+
}
|
|
1213
|
+
O() {
|
|
1214
|
+
return !!(2 & (0 | this.u[Q]));
|
|
1215
|
+
}
|
|
1216
|
+
};
|
|
1217
|
+
function qn(t2) {
|
|
1218
|
+
return t2 ? /^\d+$/.test(t2) ? (Vt(t2), new Jn(Mt, Pt)) : null : Zn || (Zn = new Jn(0, 0));
|
|
1219
|
+
}
|
|
1220
|
+
$n.prototype.W = ut, $n.prototype.toString = function() {
|
|
1221
|
+
return this.u.toString();
|
|
1222
|
+
};
|
|
1223
|
+
var Jn = class {
|
|
1224
|
+
constructor(t2, e2) {
|
|
1225
|
+
this.h = t2 >>> 0, this.g = e2 >>> 0;
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
var Zn;
|
|
1229
|
+
function Qn(t2) {
|
|
1230
|
+
return t2 ? /^-?\d+$/.test(t2) ? (Vt(t2), new tr(Mt, Pt)) : null : er || (er = new tr(0, 0));
|
|
1231
|
+
}
|
|
1232
|
+
var tr = class {
|
|
1233
|
+
constructor(t2, e2) {
|
|
1234
|
+
this.h = t2 >>> 0, this.g = e2 >>> 0;
|
|
1235
|
+
}
|
|
1236
|
+
};
|
|
1237
|
+
var er;
|
|
1238
|
+
function nr(t2, e2, n2) {
|
|
1239
|
+
for (; n2 > 0 || e2 > 127; ) t2.g.push(127 & e2 | 128), e2 = (e2 >>> 7 | n2 << 25) >>> 0, n2 >>>= 7;
|
|
1240
|
+
t2.g.push(e2);
|
|
1241
|
+
}
|
|
1242
|
+
function rr(t2, e2) {
|
|
1243
|
+
for (; e2 > 127; ) t2.g.push(127 & e2 | 128), e2 >>>= 7;
|
|
1244
|
+
t2.g.push(e2);
|
|
1245
|
+
}
|
|
1246
|
+
function ir(t2, e2) {
|
|
1247
|
+
if (e2 >= 0) rr(t2, e2);
|
|
1248
|
+
else {
|
|
1249
|
+
for (let n2 = 0; n2 < 9; n2++) t2.g.push(127 & e2 | 128), e2 >>= 7;
|
|
1250
|
+
t2.g.push(1);
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
function sr(t2, e2) {
|
|
1254
|
+
t2.g.push(e2 >>> 0 & 255), t2.g.push(e2 >>> 8 & 255), t2.g.push(e2 >>> 16 & 255), t2.g.push(e2 >>> 24 & 255);
|
|
1255
|
+
}
|
|
1256
|
+
function or(t2, e2) {
|
|
1257
|
+
0 !== e2.length && (t2.l.push(e2), t2.h += e2.length);
|
|
1258
|
+
}
|
|
1259
|
+
function ar(t2, e2, n2) {
|
|
1260
|
+
rr(t2.g, 8 * e2 + n2);
|
|
1261
|
+
}
|
|
1262
|
+
function cr(t2, e2) {
|
|
1263
|
+
return ar(t2, e2, 2), e2 = t2.g.end(), or(t2, e2), e2.push(t2.h), e2;
|
|
1264
|
+
}
|
|
1265
|
+
function hr(t2, e2) {
|
|
1266
|
+
var n2 = e2.pop();
|
|
1267
|
+
for (n2 = t2.h + t2.g.length() - n2; n2 > 127; ) e2.push(127 & n2 | 128), n2 >>>= 7, t2.h++;
|
|
1268
|
+
e2.push(n2), t2.h++;
|
|
1269
|
+
}
|
|
1270
|
+
function ur(t2, e2, n2) {
|
|
1271
|
+
ar(t2, e2, 2), rr(t2.g, n2.length), or(t2, t2.g.end()), or(t2, n2);
|
|
1272
|
+
}
|
|
1273
|
+
function lr(t2, e2, n2, r2) {
|
|
1274
|
+
null != n2 && (e2 = cr(t2, e2), r2(n2, t2), hr(t2, e2));
|
|
1275
|
+
}
|
|
1276
|
+
function dr() {
|
|
1277
|
+
const t2 = class {
|
|
1278
|
+
constructor() {
|
|
1279
|
+
throw Error();
|
|
1280
|
+
}
|
|
1281
|
+
};
|
|
1282
|
+
return Object.setPrototypeOf(t2, t2.prototype), t2;
|
|
1283
|
+
}
|
|
1284
|
+
var fr = dr();
|
|
1285
|
+
var pr = dr();
|
|
1286
|
+
var gr = dr();
|
|
1287
|
+
var mr = dr();
|
|
1288
|
+
var yr = dr();
|
|
1289
|
+
var _r = dr();
|
|
1290
|
+
var vr = dr();
|
|
1291
|
+
var Er = dr();
|
|
1292
|
+
var wr = dr();
|
|
1293
|
+
var Tr = class {
|
|
1294
|
+
constructor(t2, e2, n2) {
|
|
1295
|
+
this.g = t2, this.h = e2, t2 = fr, this.l = !!t2 && n2 === t2 || false;
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
function Ar(t2, e2) {
|
|
1299
|
+
return new Tr(t2, e2, fr);
|
|
1300
|
+
}
|
|
1301
|
+
function br(t2, e2, n2, r2, i2) {
|
|
1302
|
+
lr(t2, n2, Or(e2, r2), i2);
|
|
1303
|
+
}
|
|
1304
|
+
var kr = Ar((function(t2, e2, n2, r2, i2) {
|
|
1305
|
+
return 2 === t2.h && (Xn(t2, an(e2, r2, n2), i2), true);
|
|
1306
|
+
}), br);
|
|
1307
|
+
var Sr = Ar((function(t2, e2, n2, r2, i2) {
|
|
1308
|
+
return 2 === t2.h && (Xn(t2, an(e2, r2, n2), i2), true);
|
|
1309
|
+
}), br);
|
|
1310
|
+
var xr = Symbol();
|
|
1311
|
+
var Lr = Symbol();
|
|
1312
|
+
var Rr = Symbol();
|
|
1313
|
+
var Fr = Symbol();
|
|
1314
|
+
var Ir;
|
|
1315
|
+
var Mr;
|
|
1316
|
+
function Pr(t2, e2, n2, r2) {
|
|
1317
|
+
var i2 = r2[t2];
|
|
1318
|
+
if (i2) return i2;
|
|
1319
|
+
(i2 = {}).Ma = r2, i2.T = (function(t3) {
|
|
1320
|
+
switch (typeof t3) {
|
|
1321
|
+
case "boolean":
|
|
1322
|
+
return Re || (Re = [0, void 0, true]);
|
|
1323
|
+
case "number":
|
|
1324
|
+
return t3 > 0 ? void 0 : 0 === t3 ? Fe || (Fe = [0, void 0]) : [-t3, void 0];
|
|
1325
|
+
case "string":
|
|
1326
|
+
return [0, t3];
|
|
1327
|
+
case "object":
|
|
1328
|
+
return t3;
|
|
1329
|
+
}
|
|
1330
|
+
})(r2[0]);
|
|
1331
|
+
var s2 = r2[1];
|
|
1332
|
+
let o2 = 1;
|
|
1333
|
+
s2 && s2.constructor === Object && (i2.ga = s2, "function" == typeof (s2 = r2[++o2]) && (i2.la = true, Ir ?? (Ir = s2), Mr ?? (Mr = r2[o2 + 1]), s2 = r2[o2 += 2]));
|
|
1334
|
+
const a2 = {};
|
|
1335
|
+
for (; s2 && Array.isArray(s2) && s2.length && "number" == typeof s2[0] && s2[0] > 0; ) {
|
|
1336
|
+
for (var c2 = 0; c2 < s2.length; c2++) a2[s2[c2]] = s2;
|
|
1337
|
+
s2 = r2[++o2];
|
|
1338
|
+
}
|
|
1339
|
+
for (c2 = 1; void 0 !== s2; ) {
|
|
1340
|
+
let t3;
|
|
1341
|
+
"number" == typeof s2 && (c2 += s2, s2 = r2[++o2]);
|
|
1342
|
+
var h2 = void 0;
|
|
1343
|
+
if (s2 instanceof Tr ? t3 = s2 : (t3 = kr, o2--), t3?.l) {
|
|
1344
|
+
s2 = r2[++o2], h2 = r2;
|
|
1345
|
+
var u2 = o2;
|
|
1346
|
+
"function" == typeof s2 && (s2 = s2(), h2[u2] = s2), h2 = s2;
|
|
1347
|
+
}
|
|
1348
|
+
for (u2 = c2 + 1, "number" == typeof (s2 = r2[++o2]) && s2 < 0 && (u2 -= s2, s2 = r2[++o2]); c2 < u2; c2++) {
|
|
1349
|
+
const r3 = a2[c2];
|
|
1350
|
+
h2 ? n2(i2, c2, t3, h2, r3) : e2(i2, c2, t3, r3);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
return r2[t2] = i2;
|
|
1354
|
+
}
|
|
1355
|
+
function Cr(t2) {
|
|
1356
|
+
return Array.isArray(t2) ? t2[0] instanceof Tr ? t2 : [Sr, t2] : [t2, void 0];
|
|
1357
|
+
}
|
|
1358
|
+
function Or(t2, e2) {
|
|
1359
|
+
return t2 instanceof $n ? t2.u : Array.isArray(t2) ? De(t2, e2, false) : void 0;
|
|
1360
|
+
}
|
|
1361
|
+
function Ur(t2, e2, n2, r2) {
|
|
1362
|
+
const i2 = n2.g;
|
|
1363
|
+
t2[e2] = r2 ? (t3, e3, n3) => i2(t3, e3, n3, r2) : i2;
|
|
1364
|
+
}
|
|
1365
|
+
function Dr(t2, e2, n2, r2, i2) {
|
|
1366
|
+
const s2 = n2.g;
|
|
1367
|
+
let o2, a2;
|
|
1368
|
+
t2[e2] = (t3, e3, n3) => s2(t3, e3, n3, a2 || (a2 = Pr(Lr, Ur, Dr, r2).T), o2 || (o2 = Nr(r2)), i2);
|
|
1369
|
+
}
|
|
1370
|
+
function Nr(t2) {
|
|
1371
|
+
let e2 = t2[Rr];
|
|
1372
|
+
if (null != e2) return e2;
|
|
1373
|
+
const n2 = Pr(Lr, Ur, Dr, t2);
|
|
1374
|
+
return e2 = n2.la ? (t3, e3) => Ir(t3, e3, n2) : (t3, e3) => {
|
|
1375
|
+
const r2 = 0 | t3[Q];
|
|
1376
|
+
for (; jn(e3) && 4 != e3.h; ) {
|
|
1377
|
+
var i2 = e3.m, s2 = n2[i2];
|
|
1378
|
+
if (null == s2) {
|
|
1379
|
+
var o2 = n2.ga;
|
|
1380
|
+
o2 && (o2 = o2[i2]) && (null != (o2 = Br(o2)) && (s2 = n2[i2] = o2));
|
|
1381
|
+
}
|
|
1382
|
+
null != s2 && s2(e3, t3, i2) || (i2 = (s2 = e3).l, Vn(s2), s2.fa ? s2 = void 0 : (o2 = s2.g.g - i2, s2.g.g = i2, s2 = Bn(s2.g, o2)), i2 = t3, s2 && ((o2 = i2[q]) ? o2.push(s2) : i2[q] = [s2]));
|
|
1383
|
+
}
|
|
1384
|
+
return 8192 & r2 && it(t3), true;
|
|
1385
|
+
}, t2[Rr] = e2;
|
|
1386
|
+
}
|
|
1387
|
+
function Br(t2) {
|
|
1388
|
+
const e2 = (t2 = Cr(t2))[0].g;
|
|
1389
|
+
if (t2 = t2[1]) {
|
|
1390
|
+
const n2 = Nr(t2), r2 = Pr(Lr, Ur, Dr, t2).T;
|
|
1391
|
+
return (t3, i2, s2) => e2(t3, i2, s2, r2, n2);
|
|
1392
|
+
}
|
|
1393
|
+
return e2;
|
|
1394
|
+
}
|
|
1395
|
+
function Gr(t2, e2, n2) {
|
|
1396
|
+
t2[e2] = n2.h;
|
|
1397
|
+
}
|
|
1398
|
+
function jr(t2, e2, n2, r2) {
|
|
1399
|
+
let i2, s2;
|
|
1400
|
+
const o2 = n2.h;
|
|
1401
|
+
t2[e2] = (t3, e3, n3) => o2(t3, e3, n3, s2 || (s2 = Pr(xr, Gr, jr, r2).T), i2 || (i2 = Vr(r2)));
|
|
1402
|
+
}
|
|
1403
|
+
function Vr(t2) {
|
|
1404
|
+
let e2 = t2[Fr];
|
|
1405
|
+
if (!e2) {
|
|
1406
|
+
const n2 = Pr(xr, Gr, jr, t2);
|
|
1407
|
+
e2 = (t3, e3) => Xr(t3, e3, n2), t2[Fr] = e2;
|
|
1408
|
+
}
|
|
1409
|
+
return e2;
|
|
1410
|
+
}
|
|
1411
|
+
function Xr(t2, e2, n2) {
|
|
1412
|
+
!(function(t3, e3, n3) {
|
|
1413
|
+
const r2 = 512 & e3 ? 0 : -1, i2 = t3.length, s2 = i2 + ((e3 = 64 & e3 ? 256 & e3 : !!i2 && lt(t3[i2 - 1])) ? -1 : 0);
|
|
1414
|
+
for (let e4 = 0; e4 < s2; e4++) n3(e4 - r2, t3[e4]);
|
|
1415
|
+
if (e3) {
|
|
1416
|
+
t3 = t3[i2 - 1];
|
|
1417
|
+
for (const e4 in t3) !isNaN(e4) && n3(+e4, t3[e4]);
|
|
1418
|
+
}
|
|
1419
|
+
})(t2, 0 | t2[Q] | (n2.T[1] ? 512 : 0), ((t3, r2) => {
|
|
1420
|
+
if (null != r2) {
|
|
1421
|
+
var i2 = (function(t4, e3) {
|
|
1422
|
+
var n3 = t4[e3];
|
|
1423
|
+
if (n3) return n3;
|
|
1424
|
+
if ((n3 = t4.ga) && (n3 = n3[e3])) {
|
|
1425
|
+
var r3 = (n3 = Cr(n3))[0].h;
|
|
1426
|
+
if (n3 = n3[1]) {
|
|
1427
|
+
const e4 = Vr(n3), i3 = Pr(xr, Gr, jr, n3).T;
|
|
1428
|
+
n3 = t4.la ? Mr(i3, e4) : (t5, n4, s2) => r3(t5, n4, s2, i3, e4);
|
|
1429
|
+
} else n3 = r3;
|
|
1430
|
+
return t4[e3] = n3;
|
|
1431
|
+
}
|
|
1432
|
+
})(n2, t3);
|
|
1433
|
+
i2 && i2(e2, r2, t3);
|
|
1434
|
+
}
|
|
1435
|
+
})), (t2 = mt(t2)) && (function(t3, e3) {
|
|
1436
|
+
or(t3, t3.g.end());
|
|
1437
|
+
for (let n3 = 0; n3 < e3.length; n3++) or(t3, D(e3[n3]) || new Uint8Array(0));
|
|
1438
|
+
})(e2, t2);
|
|
1439
|
+
}
|
|
1440
|
+
function Hr(t2, e2) {
|
|
1441
|
+
if (Array.isArray(e2)) {
|
|
1442
|
+
var n2 = 0 | e2[Q];
|
|
1443
|
+
if (4 & n2) return e2;
|
|
1444
|
+
for (var r2 = 0, i2 = 0; r2 < e2.length; r2++) {
|
|
1445
|
+
const n3 = t2(e2[r2]);
|
|
1446
|
+
null != n3 && (e2[i2++] = n3);
|
|
1447
|
+
}
|
|
1448
|
+
return i2 < r2 && (e2.length = i2), rt(e2, -6145 & (5 | n2)), 2 & n2 && Object.freeze(e2), e2;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
function Wr(t2, e2, n2) {
|
|
1452
|
+
return new Tr(t2, e2, n2);
|
|
1453
|
+
}
|
|
1454
|
+
function zr(t2, e2, n2) {
|
|
1455
|
+
return new Tr(t2, e2, n2);
|
|
1456
|
+
}
|
|
1457
|
+
function Kr(t2, e2, n2) {
|
|
1458
|
+
We(t2, 0 | t2[Q], e2, n2);
|
|
1459
|
+
}
|
|
1460
|
+
var Yr = Ar((function(t2, e2, n2, r2, i2) {
|
|
1461
|
+
return 2 === t2.h && (t2 = Xn(t2, De([void 0, void 0], r2, true), i2), pt(r2 = 0 | e2[Q]), (i2 = Xe(e2, r2, n2)) instanceof Ae ? 0 != (2 & i2.M) ? ((i2 = i2.da()).push(t2), We(e2, r2, n2, i2)) : i2.Ja(t2) : Array.isArray(i2) ? (2 & (0 | i2[Q]) && We(e2, r2, n2, i2 = Qe(i2)), i2.push(t2)) : We(e2, r2, n2, [t2]), true);
|
|
1462
|
+
}), (function(t2, e2, n2, r2, i2) {
|
|
1463
|
+
if (e2 instanceof Ae) e2.forEach(((e3, s2) => {
|
|
1464
|
+
lr(t2, n2, De([s2, e3], r2, false), i2);
|
|
1465
|
+
}));
|
|
1466
|
+
else if (Array.isArray(e2)) for (let s2 = 0; s2 < e2.length; s2++) {
|
|
1467
|
+
const o2 = e2[s2];
|
|
1468
|
+
Array.isArray(o2) && lr(t2, n2, De(o2, r2, false), i2);
|
|
1469
|
+
}
|
|
1470
|
+
}));
|
|
1471
|
+
function $r(t2, e2, n2) {
|
|
1472
|
+
if (e2 = (function(t3) {
|
|
1473
|
+
if (null == t3) return t3;
|
|
1474
|
+
const e3 = typeof t3;
|
|
1475
|
+
if ("bigint" === e3) return String(Ht(64, t3));
|
|
1476
|
+
if (Qt(t3)) {
|
|
1477
|
+
if ("string" === e3) return oe(t3);
|
|
1478
|
+
if ("number" === e3) return se(t3);
|
|
1479
|
+
}
|
|
1480
|
+
})(e2), null != e2) {
|
|
1481
|
+
if ("string" == typeof e2) Qn(e2);
|
|
1482
|
+
if (null != e2) switch (ar(t2, n2, 0), typeof e2) {
|
|
1483
|
+
case "number":
|
|
1484
|
+
t2 = t2.g, Ot(e2), nr(t2, Mt, Pt);
|
|
1485
|
+
break;
|
|
1486
|
+
case "bigint":
|
|
1487
|
+
n2 = BigInt.asUintN(64, e2), n2 = new tr(Number(n2 & BigInt(4294967295)), Number(n2 >> BigInt(32))), nr(t2.g, n2.h, n2.g);
|
|
1488
|
+
break;
|
|
1489
|
+
default:
|
|
1490
|
+
n2 = Qn(e2), nr(t2.g, n2.h, n2.g);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
function qr(t2, e2, n2) {
|
|
1495
|
+
null != (e2 = te(e2)) && null != e2 && (ar(t2, n2, 0), ir(t2.g, e2));
|
|
1496
|
+
}
|
|
1497
|
+
function Jr(t2, e2, n2) {
|
|
1498
|
+
null != (e2 = Jt(e2)) && (ar(t2, n2, 0), t2.g.g.push(e2 ? 1 : 0));
|
|
1499
|
+
}
|
|
1500
|
+
function Zr(t2, e2, n2) {
|
|
1501
|
+
null != (e2 = fe(e2)) && ur(t2, n2, c(e2));
|
|
1502
|
+
}
|
|
1503
|
+
function Qr(t2, e2, n2, r2, i2) {
|
|
1504
|
+
lr(t2, n2, Or(e2, r2), i2);
|
|
1505
|
+
}
|
|
1506
|
+
function ti(t2, e2, n2) {
|
|
1507
|
+
null == e2 || "string" == typeof e2 || e2 instanceof N || (C(e2) ? C(e2) && H(Z) : e2 = void 0), null != e2 && ur(t2, n2, Ln(e2).buffer);
|
|
1508
|
+
}
|
|
1509
|
+
function ei(t2, e2, n2) {
|
|
1510
|
+
return (5 === t2.h || 2 === t2.h) && (e2 = en(e2, 0 | e2[Q], n2, false), 2 == t2.h ? zn(t2, Cn, e2) : e2.push(Cn(t2.g)), true);
|
|
1511
|
+
}
|
|
1512
|
+
var ni = Wr((function(t2, e2, n2) {
|
|
1513
|
+
if (1 !== t2.h) return false;
|
|
1514
|
+
var r2 = t2.g;
|
|
1515
|
+
t2 = Pn(r2);
|
|
1516
|
+
const i2 = Pn(r2);
|
|
1517
|
+
r2 = 2 * (i2 >> 31) + 1;
|
|
1518
|
+
const s2 = i2 >>> 20 & 2047;
|
|
1519
|
+
return t2 = 4294967296 * (1048575 & i2) + t2, Kr(e2, n2, 2047 == s2 ? t2 ? NaN : r2 * (1 / 0) : 0 == s2 ? 5e-324 * r2 * t2 : r2 * Math.pow(2, s2 - 1075) * (t2 + 4503599627370496)), true;
|
|
1520
|
+
}), (function(t2, e2, n2) {
|
|
1521
|
+
null != (e2 = qt(e2)) && (ar(t2, n2, 1), t2 = t2.g, (n2 = It || (It = new DataView(new ArrayBuffer(8)))).setFloat64(0, +e2, true), Mt = n2.getUint32(0, true), Pt = n2.getUint32(4, true), sr(t2, Mt), sr(t2, Pt));
|
|
1522
|
+
}), dr());
|
|
1523
|
+
var ri = Wr((function(t2, e2, n2) {
|
|
1524
|
+
return 5 === t2.h && (Kr(e2, n2, Cn(t2.g)), true);
|
|
1525
|
+
}), (function(t2, e2, n2) {
|
|
1526
|
+
null != (e2 = qt(e2)) && (ar(t2, n2, 5), t2 = t2.g, Ut(e2), sr(t2, Mt));
|
|
1527
|
+
}), vr);
|
|
1528
|
+
var ii = zr(ei, (function(t2, e2, n2) {
|
|
1529
|
+
if (null != (e2 = Hr(qt, e2))) for (let o2 = 0; o2 < e2.length; o2++) {
|
|
1530
|
+
var r2 = t2, i2 = n2, s2 = e2[o2];
|
|
1531
|
+
null != s2 && (ar(r2, i2, 5), r2 = r2.g, Ut(s2), sr(r2, Mt));
|
|
1532
|
+
}
|
|
1533
|
+
}), vr);
|
|
1534
|
+
var si = zr(ei, (function(t2, e2, n2) {
|
|
1535
|
+
if (null != (e2 = Hr(qt, e2)) && e2.length) {
|
|
1536
|
+
ar(t2, n2, 2), rr(t2.g, 4 * e2.length);
|
|
1537
|
+
for (let r2 = 0; r2 < e2.length; r2++) n2 = t2.g, Ut(e2[r2]), sr(n2, Mt);
|
|
1538
|
+
}
|
|
1539
|
+
}), vr);
|
|
1540
|
+
var oi = Wr((function(t2, e2, n2) {
|
|
1541
|
+
return 0 === t2.h && (Kr(e2, n2, Rn(t2.g, Nt)), true);
|
|
1542
|
+
}), $r, _r);
|
|
1543
|
+
var ai = Wr((function(t2, e2, n2) {
|
|
1544
|
+
return 0 === t2.h && (Kr(e2, n2, 0 === (t2 = Rn(t2.g, Nt)) ? void 0 : t2), true);
|
|
1545
|
+
}), $r, _r);
|
|
1546
|
+
var ci = Wr((function(t2, e2, n2) {
|
|
1547
|
+
return 0 === t2.h && (Kr(e2, n2, Rn(t2.g, Dt)), true);
|
|
1548
|
+
}), (function(t2, e2, n2) {
|
|
1549
|
+
if (null != (e2 = ue(e2))) {
|
|
1550
|
+
if ("string" == typeof e2) qn(e2);
|
|
1551
|
+
if (null != e2) switch (ar(t2, n2, 0), typeof e2) {
|
|
1552
|
+
case "number":
|
|
1553
|
+
t2 = t2.g, Ot(e2), nr(t2, Mt, Pt);
|
|
1554
|
+
break;
|
|
1555
|
+
case "bigint":
|
|
1556
|
+
n2 = BigInt.asUintN(64, e2), n2 = new Jn(Number(n2 & BigInt(4294967295)), Number(n2 >> BigInt(32))), nr(t2.g, n2.h, n2.g);
|
|
1557
|
+
break;
|
|
1558
|
+
default:
|
|
1559
|
+
n2 = qn(e2), nr(t2.g, n2.h, n2.g);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
}), dr());
|
|
1563
|
+
var hi = Wr((function(t2, e2, n2) {
|
|
1564
|
+
return 0 === t2.h && (Kr(e2, n2, In(t2.g)), true);
|
|
1565
|
+
}), qr, mr);
|
|
1566
|
+
var ui = zr((function(t2, e2, n2) {
|
|
1567
|
+
return (0 === t2.h || 2 === t2.h) && (e2 = en(e2, 0 | e2[Q], n2, false), 2 == t2.h ? zn(t2, In, e2) : e2.push(In(t2.g)), true);
|
|
1568
|
+
}), (function(t2, e2, n2) {
|
|
1569
|
+
if (null != (e2 = Hr(te, e2)) && e2.length) {
|
|
1570
|
+
n2 = cr(t2, n2);
|
|
1571
|
+
for (let n3 = 0; n3 < e2.length; n3++) ir(t2.g, e2[n3]);
|
|
1572
|
+
hr(t2, n2);
|
|
1573
|
+
}
|
|
1574
|
+
}), mr);
|
|
1575
|
+
var li = Wr((function(t2, e2, n2) {
|
|
1576
|
+
return 0 === t2.h && (Kr(e2, n2, 0 === (t2 = In(t2.g)) ? void 0 : t2), true);
|
|
1577
|
+
}), qr, mr);
|
|
1578
|
+
var di = Wr((function(t2, e2, n2) {
|
|
1579
|
+
return 0 === t2.h && (Kr(e2, n2, Fn(t2.g)), true);
|
|
1580
|
+
}), Jr, pr);
|
|
1581
|
+
var fi = Wr((function(t2, e2, n2) {
|
|
1582
|
+
return 0 === t2.h && (Kr(e2, n2, false === (t2 = Fn(t2.g)) ? void 0 : t2), true);
|
|
1583
|
+
}), Jr, pr);
|
|
1584
|
+
var pi = zr((function(t2, e2, n2) {
|
|
1585
|
+
return 2 === t2.h && (t2 = Hn(t2), en(e2, 0 | e2[Q], n2, false).push(t2), true);
|
|
1586
|
+
}), (function(t2, e2, n2) {
|
|
1587
|
+
if (null != (e2 = Hr(fe, e2))) for (let o2 = 0; o2 < e2.length; o2++) {
|
|
1588
|
+
var r2 = t2, i2 = n2, s2 = e2[o2];
|
|
1589
|
+
null != s2 && ur(r2, i2, c(s2));
|
|
1590
|
+
}
|
|
1591
|
+
}), gr);
|
|
1592
|
+
var gi = Wr((function(t2, e2, n2) {
|
|
1593
|
+
return 2 === t2.h && (Kr(e2, n2, "" === (t2 = Hn(t2)) ? void 0 : t2), true);
|
|
1594
|
+
}), Zr, gr);
|
|
1595
|
+
var mi = Wr((function(t2, e2, n2) {
|
|
1596
|
+
return 2 === t2.h && (Kr(e2, n2, Hn(t2)), true);
|
|
1597
|
+
}), Zr, gr);
|
|
1598
|
+
var yi = (function(t2, e2, n2 = fr) {
|
|
1599
|
+
return new Tr(t2, e2, n2);
|
|
1600
|
+
})((function(t2, e2, n2, r2, i2) {
|
|
1601
|
+
return 2 === t2.h && (r2 = De(void 0, r2, true), en(e2, 0 | e2[Q], n2, true).push(r2), Xn(t2, r2, i2), true);
|
|
1602
|
+
}), (function(t2, e2, n2, r2, i2) {
|
|
1603
|
+
if (Array.isArray(e2)) for (let s2 = 0; s2 < e2.length; s2++) Qr(t2, e2[s2], n2, r2, i2);
|
|
1604
|
+
}));
|
|
1605
|
+
var _i = Ar((function(t2, e2, n2, r2, i2, s2) {
|
|
1606
|
+
return 2 === t2.h && (sn(e2, 0 | e2[Q], s2, n2), Xn(t2, e2 = an(e2, r2, n2), i2), true);
|
|
1607
|
+
}), Qr);
|
|
1608
|
+
var vi = Wr((function(t2, e2, n2) {
|
|
1609
|
+
return 2 === t2.h && (Kr(e2, n2, Wn(t2)), true);
|
|
1610
|
+
}), ti, Er);
|
|
1611
|
+
var Ei = zr((function(t2, e2, n2) {
|
|
1612
|
+
return (0 === t2.h || 2 === t2.h) && (e2 = en(e2, 0 | e2[Q], n2, false), 2 == t2.h ? zn(t2, Mn, e2) : e2.push(Mn(t2.g)), true);
|
|
1613
|
+
}), (function(t2, e2, n2) {
|
|
1614
|
+
if (null != (e2 = Hr(ee, e2))) for (let o2 = 0; o2 < e2.length; o2++) {
|
|
1615
|
+
var r2 = t2, i2 = n2, s2 = e2[o2];
|
|
1616
|
+
null != s2 && (ar(r2, i2, 0), rr(r2.g, s2));
|
|
1617
|
+
}
|
|
1618
|
+
}), yr);
|
|
1619
|
+
var wi = Wr((function(t2, e2, n2) {
|
|
1620
|
+
return 0 === t2.h && (Kr(e2, n2, 0 === (t2 = Mn(t2.g)) ? void 0 : t2), true);
|
|
1621
|
+
}), (function(t2, e2, n2) {
|
|
1622
|
+
null != (e2 = ee(e2)) && null != e2 && (ar(t2, n2, 0), rr(t2.g, e2));
|
|
1623
|
+
}), yr);
|
|
1624
|
+
var Ti = Wr((function(t2, e2, n2) {
|
|
1625
|
+
return 0 === t2.h && (Kr(e2, n2, In(t2.g)), true);
|
|
1626
|
+
}), (function(t2, e2, n2) {
|
|
1627
|
+
null != (e2 = te(e2)) && (e2 = parseInt(e2, 10), ar(t2, n2, 0), ir(t2.g, e2));
|
|
1628
|
+
}), wr);
|
|
1629
|
+
var Ai = class {
|
|
1630
|
+
constructor(t2, e2) {
|
|
1631
|
+
this.h = t2, this.g = e2, this.l = hn, this.m = dn, this.defaultValue = void 0;
|
|
1632
|
+
}
|
|
1633
|
+
register() {
|
|
1634
|
+
w(this);
|
|
1635
|
+
}
|
|
1636
|
+
};
|
|
1637
|
+
function bi(t2, e2) {
|
|
1638
|
+
return new Ai(t2, e2);
|
|
1639
|
+
}
|
|
1640
|
+
function ki(t2, e2) {
|
|
1641
|
+
return (n2, r2) => {
|
|
1642
|
+
if (Kn.length) {
|
|
1643
|
+
const t3 = Kn.pop();
|
|
1644
|
+
t3.o(r2), Un(t3.g, n2, r2), n2 = t3;
|
|
1645
|
+
} else n2 = new class {
|
|
1646
|
+
constructor(t3, e3) {
|
|
1647
|
+
if (Gn.length) {
|
|
1648
|
+
const n3 = Gn.pop();
|
|
1649
|
+
Un(n3, t3, e3), t3 = n3;
|
|
1650
|
+
} else t3 = new class {
|
|
1651
|
+
constructor(t4, e4) {
|
|
1652
|
+
this.h = null, this.m = false, this.g = this.l = this.j = 0, Un(this, t4, e4);
|
|
1653
|
+
}
|
|
1654
|
+
clear() {
|
|
1655
|
+
this.h = null, this.m = false, this.g = this.l = this.j = 0, this.aa = false;
|
|
1656
|
+
}
|
|
1657
|
+
}(t3, e3);
|
|
1658
|
+
this.g = t3, this.l = this.g.g, this.h = this.m = -1, this.o(e3);
|
|
1659
|
+
}
|
|
1660
|
+
o({ fa: t3 = false } = {}) {
|
|
1661
|
+
this.fa = t3;
|
|
1662
|
+
}
|
|
1663
|
+
}(n2, r2);
|
|
1664
|
+
try {
|
|
1665
|
+
const r3 = new t2(), s2 = r3.u;
|
|
1666
|
+
Nr(e2)(s2, n2);
|
|
1667
|
+
var i2 = r3;
|
|
1668
|
+
} finally {
|
|
1669
|
+
n2.g.clear(), n2.m = -1, n2.h = -1, Kn.length < 100 && Kn.push(n2);
|
|
1670
|
+
}
|
|
1671
|
+
return i2;
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
function Si(t2) {
|
|
1675
|
+
return function() {
|
|
1676
|
+
const e2 = new class {
|
|
1677
|
+
constructor() {
|
|
1678
|
+
this.l = [], this.h = 0, this.g = new class {
|
|
1679
|
+
constructor() {
|
|
1680
|
+
this.g = [];
|
|
1681
|
+
}
|
|
1682
|
+
length() {
|
|
1683
|
+
return this.g.length;
|
|
1684
|
+
}
|
|
1685
|
+
end() {
|
|
1686
|
+
const t3 = this.g;
|
|
1687
|
+
return this.g = [], t3;
|
|
1688
|
+
}
|
|
1689
|
+
}();
|
|
1690
|
+
}
|
|
1691
|
+
}();
|
|
1692
|
+
Xr(this.u, e2, Pr(xr, Gr, jr, t2)), or(e2, e2.g.end());
|
|
1693
|
+
const n2 = new Uint8Array(e2.h), r2 = e2.l, i2 = r2.length;
|
|
1694
|
+
let s2 = 0;
|
|
1695
|
+
for (let t3 = 0; t3 < i2; t3++) {
|
|
1696
|
+
const e3 = r2[t3];
|
|
1697
|
+
n2.set(e3, s2), s2 += e3.length;
|
|
1698
|
+
}
|
|
1699
|
+
return e2.l = [n2], n2;
|
|
1700
|
+
};
|
|
1701
|
+
}
|
|
1702
|
+
var xi = class extends $n {
|
|
1703
|
+
constructor(t2) {
|
|
1704
|
+
super(t2);
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
var Li = [0, gi, Wr((function(t2, e2, n2) {
|
|
1708
|
+
return 2 === t2.h && (Kr(e2, n2, (t2 = Wn(t2)) === U() ? void 0 : t2), true);
|
|
1709
|
+
}), (function(t2, e2, n2) {
|
|
1710
|
+
if (null != e2) {
|
|
1711
|
+
if (e2 instanceof $n) {
|
|
1712
|
+
const r2 = e2.Oa;
|
|
1713
|
+
return void (r2 && (e2 = r2(e2), null != e2 && ur(t2, n2, Ln(e2).buffer)));
|
|
1714
|
+
}
|
|
1715
|
+
if (Array.isArray(e2)) return;
|
|
1716
|
+
}
|
|
1717
|
+
ti(t2, e2, n2);
|
|
1718
|
+
}), Er)];
|
|
1719
|
+
var Ri;
|
|
1720
|
+
var Fi = globalThis.trustedTypes;
|
|
1721
|
+
function Ii(t2) {
|
|
1722
|
+
void 0 === Ri && (Ri = (function() {
|
|
1723
|
+
let t3 = null;
|
|
1724
|
+
if (!Fi) return t3;
|
|
1725
|
+
try {
|
|
1726
|
+
const e3 = (t4) => t4;
|
|
1727
|
+
t3 = Fi.createPolicy("goog#html", { createHTML: e3, createScript: e3, createScriptURL: e3 });
|
|
1728
|
+
} catch (t4) {
|
|
1729
|
+
}
|
|
1730
|
+
return t3;
|
|
1731
|
+
})());
|
|
1732
|
+
var e2 = Ri;
|
|
1733
|
+
return new class {
|
|
1734
|
+
constructor(t3) {
|
|
1735
|
+
this.g = t3;
|
|
1736
|
+
}
|
|
1737
|
+
toString() {
|
|
1738
|
+
return this.g + "";
|
|
1739
|
+
}
|
|
1740
|
+
}(e2 ? e2.createScriptURL(t2) : t2);
|
|
1741
|
+
}
|
|
1742
|
+
function Mi(t2, ...e2) {
|
|
1743
|
+
if (0 === e2.length) return Ii(t2[0]);
|
|
1744
|
+
let n2 = t2[0];
|
|
1745
|
+
for (let r2 = 0; r2 < e2.length; r2++) n2 += encodeURIComponent(e2[r2]) + t2[r2 + 1];
|
|
1746
|
+
return Ii(n2);
|
|
1747
|
+
}
|
|
1748
|
+
var Pi = [0, hi, Ti, di, -1, ui, Ti, -1];
|
|
1749
|
+
var Ci = class extends $n {
|
|
1750
|
+
constructor(t2) {
|
|
1751
|
+
super(t2);
|
|
1752
|
+
}
|
|
1753
|
+
};
|
|
1754
|
+
var Oi = [0, di, mi, di, Ti, -1, zr((function(t2, e2, n2) {
|
|
1755
|
+
return (0 === t2.h || 2 === t2.h) && (e2 = en(e2, 0 | e2[Q], n2, false), 2 == t2.h ? zn(t2, On, e2) : e2.push(In(t2.g)), true);
|
|
1756
|
+
}), (function(t2, e2, n2) {
|
|
1757
|
+
if (null != (e2 = Hr(te, e2)) && e2.length) {
|
|
1758
|
+
n2 = cr(t2, n2);
|
|
1759
|
+
for (let n3 = 0; n3 < e2.length; n3++) ir(t2.g, e2[n3]);
|
|
1760
|
+
hr(t2, n2);
|
|
1761
|
+
}
|
|
1762
|
+
}), wr), mi, -1, [0, di, -1], Ti, di, -1];
|
|
1763
|
+
var Ui = [0, mi, -2];
|
|
1764
|
+
var Di = class extends $n {
|
|
1765
|
+
constructor(t2) {
|
|
1766
|
+
super(t2);
|
|
1767
|
+
}
|
|
1768
|
+
};
|
|
1769
|
+
var Ni = [0];
|
|
1770
|
+
var Bi = [0, hi, di, 1, di, -3];
|
|
1771
|
+
var Gi = class extends $n {
|
|
1772
|
+
constructor(t2) {
|
|
1773
|
+
super(t2, 2);
|
|
1774
|
+
}
|
|
1775
|
+
};
|
|
1776
|
+
var ji = {};
|
|
1777
|
+
ji[336783863] = [0, mi, di, -1, hi, [0, [1, 2, 3, 4, 5, 6, 7, 8, 9], _i, Ni, _i, Oi, _i, Ui, _i, Bi, _i, Pi, _i, [0, mi, -2], _i, [0, mi, Ti], _i, [0, Ti, mi, -1], _i, [0, Ti, -1]], [0, mi], di, [0, [1, 3], [2, 4], _i, [0, ui], -1, _i, [0, pi], -1, yi, [0, mi, -1]], mi];
|
|
1778
|
+
var Vi = [0, ai, -1, fi, -3, ai, ui, gi, li, ai, -1, fi, li, fi, -2, gi];
|
|
1779
|
+
function Xi(t2, e2) {
|
|
1780
|
+
tn(t2, 2, de(e2), "");
|
|
1781
|
+
}
|
|
1782
|
+
function Hi(t2, e2) {
|
|
1783
|
+
mn(t2, 3, e2);
|
|
1784
|
+
}
|
|
1785
|
+
function Wi(t2, e2) {
|
|
1786
|
+
mn(t2, 4, e2);
|
|
1787
|
+
}
|
|
1788
|
+
var zi = class extends $n {
|
|
1789
|
+
constructor(t2) {
|
|
1790
|
+
super(t2, 500);
|
|
1791
|
+
}
|
|
1792
|
+
o(t2) {
|
|
1793
|
+
return dn(this, 0, 7, t2);
|
|
1794
|
+
}
|
|
1795
|
+
};
|
|
1796
|
+
var Ki = [-1, {}];
|
|
1797
|
+
var Yi = [0, mi, 1, Ki];
|
|
1798
|
+
var $i = [0, mi, pi, Ki];
|
|
1799
|
+
function qi(t2, e2) {
|
|
1800
|
+
yn(t2, 1, zi, e2);
|
|
1801
|
+
}
|
|
1802
|
+
function Ji(t2, e2) {
|
|
1803
|
+
mn(t2, 10, e2);
|
|
1804
|
+
}
|
|
1805
|
+
function Zi(t2, e2) {
|
|
1806
|
+
mn(t2, 15, e2);
|
|
1807
|
+
}
|
|
1808
|
+
var Qi = class extends $n {
|
|
1809
|
+
constructor(t2) {
|
|
1810
|
+
super(t2, 500);
|
|
1811
|
+
}
|
|
1812
|
+
o(t2) {
|
|
1813
|
+
return dn(this, 0, 1001, t2);
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
var ts = [-500, yi, [-500, gi, -1, pi, -3, [-2, ji, di], yi, Li, li, -1, Yi, $i, yi, [0, gi, fi], gi, Vi, li, pi, 987, pi], 4, yi, [-500, mi, -1, [-1, {}], 998, mi], yi, [-500, mi, pi, -1, [-2, {}, di], 997, pi, -1], li, yi, [-500, mi, pi, Ki, 998, pi], pi, li, Yi, $i, yi, [0, gi, -1, Ki], pi, -2, Vi, gi, -1, fi, [0, fi, wi], 978, Ki, yi, Li];
|
|
1817
|
+
Qi.prototype.g = Si(ts);
|
|
1818
|
+
var es = ki(Qi, ts);
|
|
1819
|
+
var ns = class extends $n {
|
|
1820
|
+
constructor(t2) {
|
|
1821
|
+
super(t2);
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1824
|
+
var rs = class extends $n {
|
|
1825
|
+
constructor(t2) {
|
|
1826
|
+
super(t2);
|
|
1827
|
+
}
|
|
1828
|
+
g() {
|
|
1829
|
+
return ln(this, ns, 1);
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
var is = [0, yi, [0, hi, ri, mi, -1]];
|
|
1833
|
+
var ss = ki(rs, is);
|
|
1834
|
+
var os = class extends $n {
|
|
1835
|
+
constructor(t2) {
|
|
1836
|
+
super(t2);
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
var as = class extends $n {
|
|
1840
|
+
constructor(t2) {
|
|
1841
|
+
super(t2);
|
|
1842
|
+
}
|
|
1843
|
+
};
|
|
1844
|
+
var cs = class extends $n {
|
|
1845
|
+
constructor(t2) {
|
|
1846
|
+
super(t2);
|
|
1847
|
+
}
|
|
1848
|
+
h() {
|
|
1849
|
+
return hn(this, os, 2);
|
|
1850
|
+
}
|
|
1851
|
+
g() {
|
|
1852
|
+
return ln(this, as, 5);
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
1855
|
+
var hs = ki(class extends $n {
|
|
1856
|
+
constructor(t2) {
|
|
1857
|
+
super(t2);
|
|
1858
|
+
}
|
|
1859
|
+
}, [0, pi, ui, si, [0, Ti, [0, hi, -3], [0, ri, -3], [0, hi, -1, [0, yi, [0, hi, -2]]], yi, [0, ri, -1, mi, ri]], mi, -1, oi, yi, [0, hi, ri], pi, oi]);
|
|
1860
|
+
var us = class extends $n {
|
|
1861
|
+
constructor(t2) {
|
|
1862
|
+
super(t2);
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
var ls = ki(class extends $n {
|
|
1866
|
+
constructor(t2) {
|
|
1867
|
+
super(t2);
|
|
1868
|
+
}
|
|
1869
|
+
}, [0, yi, [0, ri, -4]]);
|
|
1870
|
+
var ds = class extends $n {
|
|
1871
|
+
constructor(t2) {
|
|
1872
|
+
super(t2);
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1875
|
+
var fs = ki(class extends $n {
|
|
1876
|
+
constructor(t2) {
|
|
1877
|
+
super(t2);
|
|
1878
|
+
}
|
|
1879
|
+
}, [0, yi, [0, ri, -4]]);
|
|
1880
|
+
var ps = class extends $n {
|
|
1881
|
+
constructor(t2) {
|
|
1882
|
+
super(t2);
|
|
1883
|
+
}
|
|
1884
|
+
};
|
|
1885
|
+
var gs = [0, hi, -1, si, Ti];
|
|
1886
|
+
var ms = class extends $n {
|
|
1887
|
+
constructor(t2) {
|
|
1888
|
+
super(t2);
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
ms.prototype.g = Si([0, ri, -4, oi]);
|
|
1892
|
+
var ys = class extends $n {
|
|
1893
|
+
constructor(t2) {
|
|
1894
|
+
super(t2);
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
var _s = ki(class extends $n {
|
|
1898
|
+
constructor(t2) {
|
|
1899
|
+
super(t2);
|
|
1900
|
+
}
|
|
1901
|
+
}, [0, yi, [0, 1, hi, mi, is], oi]);
|
|
1902
|
+
var vs = class extends $n {
|
|
1903
|
+
constructor(t2) {
|
|
1904
|
+
super(t2);
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
var Es = class extends $n {
|
|
1908
|
+
constructor(t2) {
|
|
1909
|
+
super(t2);
|
|
1910
|
+
}
|
|
1911
|
+
ma() {
|
|
1912
|
+
const t2 = Ke(this);
|
|
1913
|
+
return null == t2 ? U() : t2;
|
|
1914
|
+
}
|
|
1915
|
+
};
|
|
1916
|
+
var ws = class extends $n {
|
|
1917
|
+
constructor(t2) {
|
|
1918
|
+
super(t2);
|
|
1919
|
+
}
|
|
1920
|
+
};
|
|
1921
|
+
var Ts = [1, 2];
|
|
1922
|
+
var As = ki(class extends $n {
|
|
1923
|
+
constructor(t2) {
|
|
1924
|
+
super(t2);
|
|
1925
|
+
}
|
|
1926
|
+
}, [0, yi, [0, Ts, _i, [0, si], _i, [0, vi], hi, mi], oi]);
|
|
1927
|
+
var bs = class extends $n {
|
|
1928
|
+
constructor(t2) {
|
|
1929
|
+
super(t2);
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
var ks = [0, mi, hi, ri, pi, -1];
|
|
1933
|
+
var Ss = class extends $n {
|
|
1934
|
+
constructor(t2) {
|
|
1935
|
+
super(t2);
|
|
1936
|
+
}
|
|
1937
|
+
};
|
|
1938
|
+
var xs = [0, di, -1];
|
|
1939
|
+
var Ls = class extends $n {
|
|
1940
|
+
constructor(t2) {
|
|
1941
|
+
super(t2);
|
|
1942
|
+
}
|
|
1943
|
+
};
|
|
1944
|
+
var Rs = [1, 2, 3, 4, 5];
|
|
1945
|
+
var Fs = class extends $n {
|
|
1946
|
+
constructor(t2) {
|
|
1947
|
+
super(t2);
|
|
1948
|
+
}
|
|
1949
|
+
g() {
|
|
1950
|
+
return null != Ke(this);
|
|
1951
|
+
}
|
|
1952
|
+
h() {
|
|
1953
|
+
return null != vn(this, 2);
|
|
1954
|
+
}
|
|
1955
|
+
};
|
|
1956
|
+
var Is = class extends $n {
|
|
1957
|
+
constructor(t2) {
|
|
1958
|
+
super(t2);
|
|
1959
|
+
}
|
|
1960
|
+
g() {
|
|
1961
|
+
return Jt(Ve(this, 2)) ?? false;
|
|
1962
|
+
}
|
|
1963
|
+
};
|
|
1964
|
+
var Ms = [0, vi, mi, [0, hi, oi, -1], [0, ci, oi]];
|
|
1965
|
+
var Ps = [0, Ms, di, [0, Rs, _i, Bi, _i, Oi, _i, Pi, _i, Ni, _i, Ui], Ti];
|
|
1966
|
+
var Cs = class extends $n {
|
|
1967
|
+
constructor(t2) {
|
|
1968
|
+
super(t2);
|
|
1969
|
+
}
|
|
1970
|
+
};
|
|
1971
|
+
var Os = [0, Ps, ri, -1, hi];
|
|
1972
|
+
var Us = bi(502141897, Cs);
|
|
1973
|
+
ji[502141897] = Os;
|
|
1974
|
+
var Ds = ki(class extends $n {
|
|
1975
|
+
constructor(t2) {
|
|
1976
|
+
super(t2);
|
|
1977
|
+
}
|
|
1978
|
+
}, [0, [0, Ti, -1, ii, Ei], gs]);
|
|
1979
|
+
var Ns = class extends $n {
|
|
1980
|
+
constructor(t2) {
|
|
1981
|
+
super(t2);
|
|
1982
|
+
}
|
|
1983
|
+
};
|
|
1984
|
+
var Bs = class extends $n {
|
|
1985
|
+
constructor(t2) {
|
|
1986
|
+
super(t2);
|
|
1987
|
+
}
|
|
1988
|
+
};
|
|
1989
|
+
var Gs = [0, Ps, ri, [0, Ps], di];
|
|
1990
|
+
var js = [0, Ps, Os, Gs, ri, [0, [0, Ms]]];
|
|
1991
|
+
var Vs = bi(508968150, Bs);
|
|
1992
|
+
ji[508968150] = js, ji[508968149] = Gs;
|
|
1993
|
+
var Xs = class extends $n {
|
|
1994
|
+
constructor(t2) {
|
|
1995
|
+
super(t2);
|
|
1996
|
+
}
|
|
1997
|
+
};
|
|
1998
|
+
var Hs = bi(513916220, Xs);
|
|
1999
|
+
ji[513916220] = [0, Ps, js, hi];
|
|
2000
|
+
var Ws = class extends $n {
|
|
2001
|
+
constructor(t2) {
|
|
2002
|
+
super(t2);
|
|
2003
|
+
}
|
|
2004
|
+
h() {
|
|
2005
|
+
return hn(this, bs, 2);
|
|
2006
|
+
}
|
|
2007
|
+
g() {
|
|
2008
|
+
He(this, 2);
|
|
2009
|
+
}
|
|
2010
|
+
};
|
|
2011
|
+
var zs = [0, Ps, ks];
|
|
2012
|
+
ji[478825465] = zs;
|
|
2013
|
+
var Ks = class extends $n {
|
|
2014
|
+
constructor(t2) {
|
|
2015
|
+
super(t2);
|
|
2016
|
+
}
|
|
2017
|
+
};
|
|
2018
|
+
var Ys = class extends $n {
|
|
2019
|
+
constructor(t2) {
|
|
2020
|
+
super(t2);
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
2023
|
+
var $s = class extends $n {
|
|
2024
|
+
constructor(t2) {
|
|
2025
|
+
super(t2);
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
var qs = class extends $n {
|
|
2029
|
+
constructor(t2) {
|
|
2030
|
+
super(t2);
|
|
2031
|
+
}
|
|
2032
|
+
};
|
|
2033
|
+
var Js = class extends $n {
|
|
2034
|
+
constructor(t2) {
|
|
2035
|
+
super(t2);
|
|
2036
|
+
}
|
|
2037
|
+
};
|
|
2038
|
+
var Zs = [0, Ps, [0, Ps], zs, -1];
|
|
2039
|
+
var Qs = [0, Ps, ri, hi];
|
|
2040
|
+
var to = [0, Ps, ri];
|
|
2041
|
+
var eo = [0, Ps, Qs, to, ri];
|
|
2042
|
+
var no = bi(479097054, Js);
|
|
2043
|
+
ji[479097054] = [0, Ps, eo, Zs], ji[463370452] = Zs, ji[464864288] = Qs;
|
|
2044
|
+
var ro = bi(462713202, qs);
|
|
2045
|
+
ji[462713202] = eo, ji[474472470] = to;
|
|
2046
|
+
var io = class extends $n {
|
|
2047
|
+
constructor(t2) {
|
|
2048
|
+
super(t2);
|
|
2049
|
+
}
|
|
2050
|
+
};
|
|
2051
|
+
var so = class extends $n {
|
|
2052
|
+
constructor(t2) {
|
|
2053
|
+
super(t2);
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
var oo = class extends $n {
|
|
2057
|
+
constructor(t2) {
|
|
2058
|
+
super(t2);
|
|
2059
|
+
}
|
|
2060
|
+
};
|
|
2061
|
+
var ao = class extends $n {
|
|
2062
|
+
constructor(t2) {
|
|
2063
|
+
super(t2);
|
|
2064
|
+
}
|
|
2065
|
+
};
|
|
2066
|
+
var co = [0, Ps, ri, -1, hi];
|
|
2067
|
+
var ho = [0, Ps, ri, di];
|
|
2068
|
+
ao.prototype.g = Si([0, Ps, to, [0, Ps], Os, Gs, co, ho]);
|
|
2069
|
+
var uo = class extends $n {
|
|
2070
|
+
constructor(t2) {
|
|
2071
|
+
super(t2);
|
|
2072
|
+
}
|
|
2073
|
+
};
|
|
2074
|
+
var lo = bi(456383383, uo);
|
|
2075
|
+
ji[456383383] = [0, Ps, ks];
|
|
2076
|
+
var fo = class extends $n {
|
|
2077
|
+
constructor(t2) {
|
|
2078
|
+
super(t2);
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
var po = bi(476348187, fo);
|
|
2082
|
+
ji[476348187] = [0, Ps, xs];
|
|
2083
|
+
var go = class extends $n {
|
|
2084
|
+
constructor(t2) {
|
|
2085
|
+
super(t2);
|
|
2086
|
+
}
|
|
2087
|
+
};
|
|
2088
|
+
var mo = class extends $n {
|
|
2089
|
+
constructor(t2) {
|
|
2090
|
+
super(t2);
|
|
2091
|
+
}
|
|
2092
|
+
};
|
|
2093
|
+
var yo = [0, Ti, -1];
|
|
2094
|
+
var _o = bi(458105876, class extends $n {
|
|
2095
|
+
constructor(t2) {
|
|
2096
|
+
super(t2);
|
|
2097
|
+
}
|
|
2098
|
+
g() {
|
|
2099
|
+
var t2 = this.u;
|
|
2100
|
+
const e2 = 0 | t2[Q], n2 = 2 & e2;
|
|
2101
|
+
return t2 = (function(t3, e3, n3) {
|
|
2102
|
+
var r2 = mo;
|
|
2103
|
+
const i2 = 2 & e3;
|
|
2104
|
+
let s2 = false;
|
|
2105
|
+
if (null == n3) {
|
|
2106
|
+
if (i2) return Ie();
|
|
2107
|
+
n3 = [];
|
|
2108
|
+
} else if (n3.constructor === Ae) {
|
|
2109
|
+
if (0 == (2 & n3.M) || i2) return n3;
|
|
2110
|
+
n3 = n3.da();
|
|
2111
|
+
} else Array.isArray(n3) ? s2 = !!(2 & (0 | n3[Q])) : n3 = [];
|
|
2112
|
+
if (i2) {
|
|
2113
|
+
if (!n3.length) return Ie();
|
|
2114
|
+
s2 || (s2 = true, it(n3));
|
|
2115
|
+
} else s2 && (s2 = false, n3 = Qe(n3));
|
|
2116
|
+
return s2 || (64 & (0 | n3[Q]) ? n3[Q] &= -33 : 32 & e3 && nt(n3, 32)), We(t3, e3, 2, r2 = new Ae(n3, r2, ge, void 0)), r2;
|
|
2117
|
+
})(t2, e2, Xe(t2, e2, 2)), !n2 && mo && (t2.pa = true), t2;
|
|
2118
|
+
}
|
|
2119
|
+
});
|
|
2120
|
+
ji[458105876] = [0, yo, Yr, [true, oi, [0, mi, -1, pi]]];
|
|
2121
|
+
var vo = class extends $n {
|
|
2122
|
+
constructor(t2) {
|
|
2123
|
+
super(t2);
|
|
2124
|
+
}
|
|
2125
|
+
};
|
|
2126
|
+
var Eo = bi(458105758, vo);
|
|
2127
|
+
ji[458105758] = [0, Ps, mi, yo];
|
|
2128
|
+
var wo = class extends $n {
|
|
2129
|
+
constructor(t2) {
|
|
2130
|
+
super(t2);
|
|
2131
|
+
}
|
|
2132
|
+
};
|
|
2133
|
+
var To = bi(443442058, wo);
|
|
2134
|
+
ji[443442058] = [0, Ps, mi, hi, ri, pi, -1, di, ri], ji[514774813] = co;
|
|
2135
|
+
var Ao = class extends $n {
|
|
2136
|
+
constructor(t2) {
|
|
2137
|
+
super(t2);
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
var bo = bi(516587230, Ao);
|
|
2141
|
+
function ko(t2, e2) {
|
|
2142
|
+
return e2 = e2 ? e2.clone() : new bs(), void 0 !== t2.displayNamesLocale ? He(e2, 1, de(t2.displayNamesLocale)) : void 0 === t2.displayNamesLocale && He(e2, 1), void 0 !== t2.maxResults ? Tn(e2, 2, t2.maxResults) : "maxResults" in t2 && He(e2, 2), void 0 !== t2.scoreThreshold ? An(e2, 3, t2.scoreThreshold) : "scoreThreshold" in t2 && He(e2, 3), void 0 !== t2.categoryAllowlist ? bn(e2, 4, t2.categoryAllowlist) : "categoryAllowlist" in t2 && He(e2, 4), void 0 !== t2.categoryDenylist ? bn(e2, 5, t2.categoryDenylist) : "categoryDenylist" in t2 && He(e2, 5), e2;
|
|
2143
|
+
}
|
|
2144
|
+
function So(t2, e2 = -1, n2 = "") {
|
|
2145
|
+
return { categories: t2.map(((t3) => ({ index: _n(t3, 1) ?? 0 ?? -1, score: En(t3, 2) ?? 0, categoryName: vn(t3, 3) ?? "" ?? "", displayName: vn(t3, 4) ?? "" ?? "" }))), headIndex: e2, headName: n2 };
|
|
2146
|
+
}
|
|
2147
|
+
function xo(t2) {
|
|
2148
|
+
var e2 = $e(t2, 3, qt, Ye()), n2 = $e(t2, 2, te, Ye()), r2 = $e(t2, 1, fe, Ye()), i2 = $e(t2, 9, fe, Ye());
|
|
2149
|
+
const s2 = { categories: [], keypoints: [] };
|
|
2150
|
+
for (let t3 = 0; t3 < e2.length; t3++) s2.categories.push({ score: e2[t3], index: n2[t3] ?? -1, categoryName: r2[t3] ?? "", displayName: i2[t3] ?? "" });
|
|
2151
|
+
if ((e2 = hn(t2, cs, 4)?.h()) && (s2.boundingBox = { originX: _n(e2, 1) ?? 0, originY: _n(e2, 2) ?? 0, width: _n(e2, 3) ?? 0, height: _n(e2, 4) ?? 0, angle: 0 }), hn(t2, cs, 4)?.g().length) for (const e3 of hn(t2, cs, 4).g()) s2.keypoints.push({ x: ze(e3, 1) ?? 0, y: ze(e3, 2) ?? 0, score: ze(e3, 4) ?? 0, label: vn(e3, 3) ?? "" });
|
|
2152
|
+
return s2;
|
|
2153
|
+
}
|
|
2154
|
+
function Lo(t2) {
|
|
2155
|
+
const e2 = [];
|
|
2156
|
+
for (const n2 of ln(t2, ds, 1)) e2.push({ x: En(n2, 1) ?? 0, y: En(n2, 2) ?? 0, z: En(n2, 3) ?? 0, visibility: En(n2, 4) ?? 0 });
|
|
2157
|
+
return e2;
|
|
2158
|
+
}
|
|
2159
|
+
function Ro(t2) {
|
|
2160
|
+
const e2 = [];
|
|
2161
|
+
for (const n2 of ln(t2, us, 1)) e2.push({ x: En(n2, 1) ?? 0, y: En(n2, 2) ?? 0, z: En(n2, 3) ?? 0, visibility: En(n2, 4) ?? 0 });
|
|
2162
|
+
return e2;
|
|
2163
|
+
}
|
|
2164
|
+
function Fo(t2) {
|
|
2165
|
+
return Array.from(t2, ((t3) => t3 > 127 ? t3 - 256 : t3));
|
|
2166
|
+
}
|
|
2167
|
+
function Io(t2, e2) {
|
|
2168
|
+
if (t2.length !== e2.length) throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t2.length} vs. ${e2.length}).`);
|
|
2169
|
+
let n2 = 0, r2 = 0, i2 = 0;
|
|
2170
|
+
for (let s2 = 0; s2 < t2.length; s2++) n2 += t2[s2] * e2[s2], r2 += t2[s2] * t2[s2], i2 += e2[s2] * e2[s2];
|
|
2171
|
+
if (r2 <= 0 || i2 <= 0) throw Error("Cannot compute cosine similarity on embedding with 0 norm.");
|
|
2172
|
+
return n2 / Math.sqrt(r2 * i2);
|
|
2173
|
+
}
|
|
2174
|
+
var Mo;
|
|
2175
|
+
ji[516587230] = [0, Ps, co, ho, ri], ji[518928384] = ho;
|
|
2176
|
+
var Po = 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]);
|
|
2177
|
+
async function Co() {
|
|
2178
|
+
if (void 0 === Mo) try {
|
|
2179
|
+
await WebAssembly.instantiate(Po), Mo = true;
|
|
2180
|
+
} catch {
|
|
2181
|
+
Mo = false;
|
|
2182
|
+
}
|
|
2183
|
+
return Mo;
|
|
2184
|
+
}
|
|
2185
|
+
async function Oo(t2, e2 = Mi``) {
|
|
2186
|
+
const n2 = await Co() ? "wasm_internal" : "wasm_nosimd_internal";
|
|
2187
|
+
return { wasmLoaderPath: `${e2}/${t2}_${n2}.js`, wasmBinaryPath: `${e2}/${t2}_${n2}.wasm` };
|
|
2188
|
+
}
|
|
2189
|
+
var Uo = class {
|
|
2190
|
+
};
|
|
2191
|
+
function Do() {
|
|
2192
|
+
var t2 = navigator;
|
|
2193
|
+
return "undefined" != typeof OffscreenCanvas && (!(function(t3 = navigator) {
|
|
2194
|
+
return (t3 = t3.userAgent).includes("Safari") && !t3.includes("Chrome");
|
|
2195
|
+
})(t2) || !!((t2 = t2.userAgent.match(/Version\/([\d]+).*Safari/)) && t2.length >= 1 && Number(t2[1]) >= 17));
|
|
2196
|
+
}
|
|
2197
|
+
async function No(t2) {
|
|
2198
|
+
if ("function" != typeof importScripts) {
|
|
2199
|
+
const e2 = document.createElement("script");
|
|
2200
|
+
return e2.src = t2.toString(), e2.crossOrigin = "anonymous", new Promise(((t3, n2) => {
|
|
2201
|
+
e2.addEventListener("load", (() => {
|
|
2202
|
+
t3();
|
|
2203
|
+
}), false), e2.addEventListener("error", ((t4) => {
|
|
2204
|
+
n2(t4);
|
|
2205
|
+
}), false), document.body.appendChild(e2);
|
|
2206
|
+
}));
|
|
2207
|
+
}
|
|
2208
|
+
importScripts(t2.toString());
|
|
2209
|
+
}
|
|
2210
|
+
function Bo(t2) {
|
|
2211
|
+
return void 0 !== t2.videoWidth ? [t2.videoWidth, t2.videoHeight] : void 0 !== t2.naturalWidth ? [t2.naturalWidth, t2.naturalHeight] : void 0 !== t2.displayWidth ? [t2.displayWidth, t2.displayHeight] : [t2.width, t2.height];
|
|
2212
|
+
}
|
|
2213
|
+
function Go(t2, e2, n2) {
|
|
2214
|
+
t2.m || console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"), n2(e2 = t2.i.stringToNewUTF8(e2)), t2.i._free(e2);
|
|
2215
|
+
}
|
|
2216
|
+
function jo(t2, e2, n2) {
|
|
2217
|
+
if (!t2.i.canvas) throw Error("No OpenGL canvas configured.");
|
|
2218
|
+
if (n2 ? t2.i._bindTextureToStream(n2) : t2.i._bindTextureToCanvas(), !(n2 = t2.i.canvas.getContext("webgl2") || t2.i.canvas.getContext("webgl"))) throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");
|
|
2219
|
+
t2.i.gpuOriginForWebTexturesIsBottomLeft && n2.pixelStorei(n2.UNPACK_FLIP_Y_WEBGL, true), n2.texImage2D(n2.TEXTURE_2D, 0, n2.RGBA, n2.RGBA, n2.UNSIGNED_BYTE, e2), t2.i.gpuOriginForWebTexturesIsBottomLeft && n2.pixelStorei(n2.UNPACK_FLIP_Y_WEBGL, false);
|
|
2220
|
+
const [r2, i2] = Bo(e2);
|
|
2221
|
+
return !t2.l || r2 === t2.i.canvas.width && i2 === t2.i.canvas.height || (t2.i.canvas.width = r2, t2.i.canvas.height = i2), [r2, i2];
|
|
2222
|
+
}
|
|
2223
|
+
function Vo(t2, e2, n2) {
|
|
2224
|
+
t2.m || console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");
|
|
2225
|
+
const r2 = new Uint32Array(e2.length);
|
|
2226
|
+
for (let n3 = 0; n3 < e2.length; n3++) r2[n3] = t2.i.stringToNewUTF8(e2[n3]);
|
|
2227
|
+
e2 = t2.i._malloc(4 * r2.length), t2.i.HEAPU32.set(r2, e2 >> 2), n2(e2);
|
|
2228
|
+
for (const e3 of r2) t2.i._free(e3);
|
|
2229
|
+
t2.i._free(e2);
|
|
2230
|
+
}
|
|
2231
|
+
function Xo(t2, e2, n2) {
|
|
2232
|
+
t2.i.simpleListeners = t2.i.simpleListeners || {}, t2.i.simpleListeners[e2] = n2;
|
|
2233
|
+
}
|
|
2234
|
+
function Ho(t2, e2, n2) {
|
|
2235
|
+
let r2 = [];
|
|
2236
|
+
t2.i.simpleListeners = t2.i.simpleListeners || {}, t2.i.simpleListeners[e2] = (t3, e3, i2) => {
|
|
2237
|
+
e3 ? (n2(r2, i2), r2 = []) : r2.push(t3);
|
|
2238
|
+
};
|
|
2239
|
+
}
|
|
2240
|
+
Uo.forVisionTasks = function(t2) {
|
|
2241
|
+
return Oo("vision", t2);
|
|
2242
|
+
}, Uo.forTextTasks = function(t2) {
|
|
2243
|
+
return Oo("text", t2);
|
|
2244
|
+
}, Uo.forGenAiExperimentalTasks = function(t2) {
|
|
2245
|
+
return Oo("genai_experimental", t2);
|
|
2246
|
+
}, Uo.forGenAiTasks = function(t2) {
|
|
2247
|
+
return Oo("genai", t2);
|
|
2248
|
+
}, Uo.forAudioTasks = function(t2) {
|
|
2249
|
+
return Oo("audio", t2);
|
|
2250
|
+
}, Uo.isSimdSupported = function() {
|
|
2251
|
+
return Co();
|
|
2252
|
+
};
|
|
2253
|
+
async function Wo(t2, e2, n2, r2) {
|
|
2254
|
+
return t2 = await (async (t3, e3, n3, r3, i2) => {
|
|
2255
|
+
if (e3 && await No(e3), !self.ModuleFactory) throw Error("ModuleFactory not set.");
|
|
2256
|
+
if (n3 && (await No(n3), !self.ModuleFactory)) throw Error("ModuleFactory not set.");
|
|
2257
|
+
return self.Module && i2 && ((e3 = self.Module).locateFile = i2.locateFile, i2.mainScriptUrlOrBlob && (e3.mainScriptUrlOrBlob = i2.mainScriptUrlOrBlob)), i2 = await self.ModuleFactory(self.Module || i2), self.ModuleFactory = self.Module = void 0, new t3(i2, r3);
|
|
2258
|
+
})(t2, n2.wasmLoaderPath, n2.assetLoaderPath, e2, { locateFile: (t3) => t3.endsWith(".wasm") ? n2.wasmBinaryPath.toString() : n2.assetBinaryPath && t3.endsWith(".data") ? n2.assetBinaryPath.toString() : t3 }), await t2.o(r2), t2;
|
|
2259
|
+
}
|
|
2260
|
+
function zo(t2, e2) {
|
|
2261
|
+
const n2 = hn(t2.baseOptions, Fs, 1) || new Fs();
|
|
2262
|
+
"string" == typeof e2 ? (He(n2, 2, de(e2)), He(n2, 1)) : e2 instanceof Uint8Array && (He(n2, 1, dt(e2, false)), He(n2, 2)), dn(t2.baseOptions, 0, 1, n2);
|
|
2263
|
+
}
|
|
2264
|
+
function Ko(t2) {
|
|
2265
|
+
try {
|
|
2266
|
+
const e2 = t2.G.length;
|
|
2267
|
+
if (1 === e2) throw Error(t2.G[0].message);
|
|
2268
|
+
if (e2 > 1) throw Error("Encountered multiple errors: " + t2.G.map(((t3) => t3.message)).join(", "));
|
|
2269
|
+
} finally {
|
|
2270
|
+
t2.G = [];
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
function Yo(t2, e2) {
|
|
2274
|
+
t2.B = Math.max(t2.B, e2);
|
|
2275
|
+
}
|
|
2276
|
+
function $o(t2, e2) {
|
|
2277
|
+
t2.A = new zi(), Xi(t2.A, "PassThroughCalculator"), Hi(t2.A, "free_memory"), Wi(t2.A, "free_memory_unused_out"), Ji(e2, "free_memory"), qi(e2, t2.A);
|
|
2278
|
+
}
|
|
2279
|
+
function qo(t2, e2) {
|
|
2280
|
+
Hi(t2.A, e2), Wi(t2.A, e2 + "_unused_out");
|
|
2281
|
+
}
|
|
2282
|
+
function Jo(t2) {
|
|
2283
|
+
t2.g.addBoolToStream(true, "free_memory", t2.B);
|
|
2284
|
+
}
|
|
2285
|
+
var Zo = class {
|
|
2286
|
+
constructor(t2) {
|
|
2287
|
+
this.g = t2, this.G = [], this.B = 0, this.g.setAutoRenderToScreen(false);
|
|
2288
|
+
}
|
|
2289
|
+
l(t2, e2 = true) {
|
|
2290
|
+
if (e2) {
|
|
2291
|
+
const e3 = t2.baseOptions || {};
|
|
2292
|
+
if (t2.baseOptions?.modelAssetBuffer && t2.baseOptions?.modelAssetPath) throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");
|
|
2293
|
+
if (!(hn(this.baseOptions, Fs, 1)?.g() || hn(this.baseOptions, Fs, 1)?.h() || t2.baseOptions?.modelAssetBuffer || t2.baseOptions?.modelAssetPath)) throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");
|
|
2294
|
+
if ((function(t3, e4) {
|
|
2295
|
+
let n2 = hn(t3.baseOptions, Ls, 3);
|
|
2296
|
+
if (!n2) {
|
|
2297
|
+
var r2 = n2 = new Ls(), i2 = new Di();
|
|
2298
|
+
fn(r2, 4, Rs, i2);
|
|
2299
|
+
}
|
|
2300
|
+
"delegate" in e4 && ("GPU" === e4.delegate ? (e4 = n2, r2 = new Ci(), fn(e4, 2, Rs, r2)) : (e4 = n2, r2 = new Di(), fn(e4, 4, Rs, r2))), dn(t3.baseOptions, 0, 3, n2);
|
|
2301
|
+
})(this, e3), e3.modelAssetPath) return fetch(e3.modelAssetPath.toString()).then(((t3) => {
|
|
2302
|
+
if (t3.ok) return t3.arrayBuffer();
|
|
2303
|
+
throw Error(`Failed to fetch model: ${e3.modelAssetPath} (${t3.status})`);
|
|
2304
|
+
})).then(((t3) => {
|
|
2305
|
+
try {
|
|
2306
|
+
this.g.i.FS_unlink("/model.dat");
|
|
2307
|
+
} catch {
|
|
2308
|
+
}
|
|
2309
|
+
this.g.i.FS_createDataFile("/", "model.dat", new Uint8Array(t3), true, false, false), zo(this, "/model.dat"), this.m(), this.J();
|
|
2310
|
+
}));
|
|
2311
|
+
if (e3.modelAssetBuffer instanceof Uint8Array) zo(this, e3.modelAssetBuffer);
|
|
2312
|
+
else if (e3.modelAssetBuffer) return (async function(t3) {
|
|
2313
|
+
const e4 = [];
|
|
2314
|
+
for (var n2 = 0; ; ) {
|
|
2315
|
+
const { done: r2, value: i2 } = await t3.read();
|
|
2316
|
+
if (r2) break;
|
|
2317
|
+
e4.push(i2), n2 += i2.length;
|
|
2318
|
+
}
|
|
2319
|
+
if (0 === e4.length) return new Uint8Array(0);
|
|
2320
|
+
if (1 === e4.length) return e4[0];
|
|
2321
|
+
t3 = new Uint8Array(n2), n2 = 0;
|
|
2322
|
+
for (const r2 of e4) t3.set(r2, n2), n2 += r2.length;
|
|
2323
|
+
return t3;
|
|
2324
|
+
})(e3.modelAssetBuffer).then(((t3) => {
|
|
2325
|
+
zo(this, t3), this.m(), this.J();
|
|
2326
|
+
}));
|
|
2327
|
+
}
|
|
2328
|
+
return this.m(), this.J(), Promise.resolve();
|
|
2329
|
+
}
|
|
2330
|
+
J() {
|
|
2331
|
+
}
|
|
2332
|
+
ca() {
|
|
2333
|
+
let t2;
|
|
2334
|
+
if (this.g.ca(((e2) => {
|
|
2335
|
+
t2 = es(e2);
|
|
2336
|
+
})), !t2) throw Error("Failed to retrieve CalculatorGraphConfig");
|
|
2337
|
+
return t2;
|
|
2338
|
+
}
|
|
2339
|
+
setGraph(t2, e2) {
|
|
2340
|
+
this.g.attachErrorListener(((t3, e3) => {
|
|
2341
|
+
this.G.push(Error(e3));
|
|
2342
|
+
})), this.g.Ha(), this.g.setGraph(t2, e2), this.A = void 0, Ko(this);
|
|
2343
|
+
}
|
|
2344
|
+
finishProcessing() {
|
|
2345
|
+
this.g.finishProcessing(), Ko(this);
|
|
2346
|
+
}
|
|
2347
|
+
close() {
|
|
2348
|
+
this.A = void 0, this.g.closeGraph();
|
|
2349
|
+
}
|
|
2350
|
+
};
|
|
2351
|
+
function Qo(t2, e2) {
|
|
2352
|
+
if (!t2) throw Error(`Unable to obtain required WebGL resource: ${e2}`);
|
|
2353
|
+
return t2;
|
|
2354
|
+
}
|
|
2355
|
+
Zo.prototype.close = Zo.prototype.close;
|
|
2356
|
+
var ta = class {
|
|
2357
|
+
constructor(t2, e2, n2, r2) {
|
|
2358
|
+
this.g = t2, this.h = e2, this.m = n2, this.l = r2;
|
|
2359
|
+
}
|
|
2360
|
+
bind() {
|
|
2361
|
+
this.g.bindVertexArray(this.h);
|
|
2362
|
+
}
|
|
2363
|
+
close() {
|
|
2364
|
+
this.g.deleteVertexArray(this.h), this.g.deleteBuffer(this.m), this.g.deleteBuffer(this.l);
|
|
2365
|
+
}
|
|
2366
|
+
};
|
|
2367
|
+
function ea(t2, e2, n2) {
|
|
2368
|
+
const r2 = t2.g;
|
|
2369
|
+
if (n2 = Qo(r2.createShader(n2), "Failed to create WebGL shader"), r2.shaderSource(n2, e2), r2.compileShader(n2), !r2.getShaderParameter(n2, r2.COMPILE_STATUS)) throw Error(`Could not compile WebGL shader: ${r2.getShaderInfoLog(n2)}`);
|
|
2370
|
+
return r2.attachShader(t2.h, n2), n2;
|
|
2371
|
+
}
|
|
2372
|
+
function na(t2, e2) {
|
|
2373
|
+
const n2 = t2.g, r2 = Qo(n2.createVertexArray(), "Failed to create vertex array");
|
|
2374
|
+
n2.bindVertexArray(r2);
|
|
2375
|
+
const i2 = Qo(n2.createBuffer(), "Failed to create buffer");
|
|
2376
|
+
n2.bindBuffer(n2.ARRAY_BUFFER, i2), n2.enableVertexAttribArray(t2.P), n2.vertexAttribPointer(t2.P, 2, n2.FLOAT, false, 0, 0), n2.bufferData(n2.ARRAY_BUFFER, new Float32Array([-1, -1, -1, 1, 1, 1, 1, -1]), n2.STATIC_DRAW);
|
|
2377
|
+
const s2 = Qo(n2.createBuffer(), "Failed to create buffer");
|
|
2378
|
+
return n2.bindBuffer(n2.ARRAY_BUFFER, s2), n2.enableVertexAttribArray(t2.J), n2.vertexAttribPointer(t2.J, 2, n2.FLOAT, false, 0, 0), n2.bufferData(n2.ARRAY_BUFFER, new Float32Array(e2 ? [0, 1, 0, 0, 1, 0, 1, 1] : [0, 0, 0, 1, 1, 1, 1, 0]), n2.STATIC_DRAW), n2.bindBuffer(n2.ARRAY_BUFFER, null), n2.bindVertexArray(null), new ta(n2, r2, i2, s2);
|
|
2379
|
+
}
|
|
2380
|
+
function ra(t2, e2) {
|
|
2381
|
+
if (t2.g) {
|
|
2382
|
+
if (e2 !== t2.g) throw Error("Cannot change GL context once initialized");
|
|
2383
|
+
} else t2.g = e2;
|
|
2384
|
+
}
|
|
2385
|
+
function ia(t2, e2, n2, r2) {
|
|
2386
|
+
return ra(t2, e2), t2.h || (t2.m(), t2.C()), n2 ? (t2.s || (t2.s = na(t2, true)), n2 = t2.s) : (t2.v || (t2.v = na(t2, false)), n2 = t2.v), e2.useProgram(t2.h), n2.bind(), t2.l(), t2 = r2(), n2.g.bindVertexArray(null), t2;
|
|
2387
|
+
}
|
|
2388
|
+
function sa(t2, e2, n2) {
|
|
2389
|
+
return ra(t2, e2), t2 = Qo(e2.createTexture(), "Failed to create texture"), e2.bindTexture(e2.TEXTURE_2D, t2), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_WRAP_S, e2.CLAMP_TO_EDGE), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_WRAP_T, e2.CLAMP_TO_EDGE), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_MIN_FILTER, n2 ?? e2.LINEAR), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_MAG_FILTER, n2 ?? e2.LINEAR), e2.bindTexture(e2.TEXTURE_2D, null), t2;
|
|
2390
|
+
}
|
|
2391
|
+
function oa(t2, e2, n2) {
|
|
2392
|
+
ra(t2, e2), t2.A || (t2.A = Qo(e2.createFramebuffer(), "Failed to create framebuffe.")), e2.bindFramebuffer(e2.FRAMEBUFFER, t2.A), e2.framebufferTexture2D(e2.FRAMEBUFFER, e2.COLOR_ATTACHMENT0, e2.TEXTURE_2D, n2, 0);
|
|
2393
|
+
}
|
|
2394
|
+
function aa(t2) {
|
|
2395
|
+
t2.g?.bindFramebuffer(t2.g.FRAMEBUFFER, null);
|
|
2396
|
+
}
|
|
2397
|
+
var ca = class {
|
|
2398
|
+
G() {
|
|
2399
|
+
return "\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n ";
|
|
2400
|
+
}
|
|
2401
|
+
m() {
|
|
2402
|
+
const t2 = this.g;
|
|
2403
|
+
if (this.h = Qo(t2.createProgram(), "Failed to create WebGL program"), this.Z = ea(this, "\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }", t2.VERTEX_SHADER), this.Y = ea(this, this.G(), t2.FRAGMENT_SHADER), t2.linkProgram(this.h), !t2.getProgramParameter(this.h, t2.LINK_STATUS)) throw Error(`Error during program linking: ${t2.getProgramInfoLog(this.h)}`);
|
|
2404
|
+
this.P = t2.getAttribLocation(this.h, "aVertex"), this.J = t2.getAttribLocation(this.h, "aTex");
|
|
2405
|
+
}
|
|
2406
|
+
C() {
|
|
2407
|
+
}
|
|
2408
|
+
l() {
|
|
2409
|
+
}
|
|
2410
|
+
close() {
|
|
2411
|
+
if (this.h) {
|
|
2412
|
+
const t2 = this.g;
|
|
2413
|
+
t2.deleteProgram(this.h), t2.deleteShader(this.Z), t2.deleteShader(this.Y);
|
|
2414
|
+
}
|
|
2415
|
+
this.A && this.g.deleteFramebuffer(this.A), this.v && this.v.close(), this.s && this.s.close();
|
|
2416
|
+
}
|
|
2417
|
+
};
|
|
2418
|
+
var ha = class extends ca {
|
|
2419
|
+
G() {
|
|
2420
|
+
return "\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n ";
|
|
2421
|
+
}
|
|
2422
|
+
C() {
|
|
2423
|
+
const t2 = this.g;
|
|
2424
|
+
t2.activeTexture(t2.TEXTURE1), this.B = sa(this, t2, t2.LINEAR), t2.activeTexture(t2.TEXTURE2), this.j = sa(this, t2, t2.NEAREST);
|
|
2425
|
+
}
|
|
2426
|
+
m() {
|
|
2427
|
+
super.m();
|
|
2428
|
+
const t2 = this.g;
|
|
2429
|
+
this.L = Qo(t2.getUniformLocation(this.h, "backgroundTexture"), "Uniform location"), this.U = Qo(t2.getUniformLocation(this.h, "colorMappingTexture"), "Uniform location"), this.K = Qo(t2.getUniformLocation(this.h, "maskTexture"), "Uniform location");
|
|
2430
|
+
}
|
|
2431
|
+
l() {
|
|
2432
|
+
super.l();
|
|
2433
|
+
const t2 = this.g;
|
|
2434
|
+
t2.uniform1i(this.K, 0), t2.uniform1i(this.L, 1), t2.uniform1i(this.U, 2);
|
|
2435
|
+
}
|
|
2436
|
+
close() {
|
|
2437
|
+
this.B && this.g.deleteTexture(this.B), this.j && this.g.deleteTexture(this.j), super.close();
|
|
2438
|
+
}
|
|
2439
|
+
};
|
|
2440
|
+
var ua = class extends ca {
|
|
2441
|
+
G() {
|
|
2442
|
+
return "\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n ";
|
|
2443
|
+
}
|
|
2444
|
+
C() {
|
|
2445
|
+
const t2 = this.g;
|
|
2446
|
+
t2.activeTexture(t2.TEXTURE1), this.j = sa(this, t2), t2.activeTexture(t2.TEXTURE2), this.B = sa(this, t2);
|
|
2447
|
+
}
|
|
2448
|
+
m() {
|
|
2449
|
+
super.m();
|
|
2450
|
+
const t2 = this.g;
|
|
2451
|
+
this.K = Qo(t2.getUniformLocation(this.h, "defaultTexture"), "Uniform location"), this.L = Qo(t2.getUniformLocation(this.h, "overlayTexture"), "Uniform location"), this.H = Qo(t2.getUniformLocation(this.h, "maskTexture"), "Uniform location");
|
|
2452
|
+
}
|
|
2453
|
+
l() {
|
|
2454
|
+
super.l();
|
|
2455
|
+
const t2 = this.g;
|
|
2456
|
+
t2.uniform1i(this.H, 0), t2.uniform1i(this.K, 1), t2.uniform1i(this.L, 2);
|
|
2457
|
+
}
|
|
2458
|
+
close() {
|
|
2459
|
+
this.j && this.g.deleteTexture(this.j), this.B && this.g.deleteTexture(this.B), super.close();
|
|
2460
|
+
}
|
|
2461
|
+
};
|
|
2462
|
+
function la(t2, e2) {
|
|
2463
|
+
switch (e2) {
|
|
2464
|
+
case 0:
|
|
2465
|
+
return t2.g.find(((t3) => t3 instanceof Uint8Array));
|
|
2466
|
+
case 1:
|
|
2467
|
+
return t2.g.find(((t3) => t3 instanceof Float32Array));
|
|
2468
|
+
case 2:
|
|
2469
|
+
return t2.g.find(((t3) => "undefined" != typeof WebGLTexture && t3 instanceof WebGLTexture));
|
|
2470
|
+
default:
|
|
2471
|
+
throw Error(`Type is not supported: ${e2}`);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
function da(t2) {
|
|
2475
|
+
var e2 = la(t2, 1);
|
|
2476
|
+
if (!e2) {
|
|
2477
|
+
if (e2 = la(t2, 0)) e2 = new Float32Array(e2).map(((t3) => t3 / 255));
|
|
2478
|
+
else {
|
|
2479
|
+
e2 = new Float32Array(t2.width * t2.height);
|
|
2480
|
+
const r2 = pa(t2);
|
|
2481
|
+
var n2 = ma(t2);
|
|
2482
|
+
if (oa(n2, r2, fa(t2)), "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform) || navigator.userAgent.includes("Mac") && "document" in self && "ontouchend" in self.document) {
|
|
2483
|
+
n2 = new Float32Array(t2.width * t2.height * 4), r2.readPixels(0, 0, t2.width, t2.height, r2.RGBA, r2.FLOAT, n2);
|
|
2484
|
+
for (let t3 = 0, r3 = 0; t3 < e2.length; ++t3, r3 += 4) e2[t3] = n2[r3];
|
|
2485
|
+
} else r2.readPixels(0, 0, t2.width, t2.height, r2.RED, r2.FLOAT, e2);
|
|
2486
|
+
}
|
|
2487
|
+
t2.g.push(e2);
|
|
2488
|
+
}
|
|
2489
|
+
return e2;
|
|
2490
|
+
}
|
|
2491
|
+
function fa(t2) {
|
|
2492
|
+
let e2 = la(t2, 2);
|
|
2493
|
+
if (!e2) {
|
|
2494
|
+
const n2 = pa(t2);
|
|
2495
|
+
e2 = ya(t2);
|
|
2496
|
+
const r2 = da(t2), i2 = ga(t2);
|
|
2497
|
+
n2.texImage2D(n2.TEXTURE_2D, 0, i2, t2.width, t2.height, 0, n2.RED, n2.FLOAT, r2), _a(t2);
|
|
2498
|
+
}
|
|
2499
|
+
return e2;
|
|
2500
|
+
}
|
|
2501
|
+
function pa(t2) {
|
|
2502
|
+
if (!t2.canvas) throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");
|
|
2503
|
+
return t2.h || (t2.h = Qo(t2.canvas.getContext("webgl2"), "You cannot use a canvas that is already bound to a different type of rendering context.")), t2.h;
|
|
2504
|
+
}
|
|
2505
|
+
function ga(t2) {
|
|
2506
|
+
if (t2 = pa(t2), !va) if (t2.getExtension("EXT_color_buffer_float") && t2.getExtension("OES_texture_float_linear") && t2.getExtension("EXT_float_blend")) va = t2.R32F;
|
|
2507
|
+
else {
|
|
2508
|
+
if (!t2.getExtension("EXT_color_buffer_half_float")) throw Error("GPU does not fully support 4-channel float32 or float16 formats");
|
|
2509
|
+
va = t2.R16F;
|
|
2510
|
+
}
|
|
2511
|
+
return va;
|
|
2512
|
+
}
|
|
2513
|
+
function ma(t2) {
|
|
2514
|
+
return t2.l || (t2.l = new ca()), t2.l;
|
|
2515
|
+
}
|
|
2516
|
+
function ya(t2) {
|
|
2517
|
+
const e2 = pa(t2);
|
|
2518
|
+
e2.viewport(0, 0, t2.width, t2.height), e2.activeTexture(e2.TEXTURE0);
|
|
2519
|
+
let n2 = la(t2, 2);
|
|
2520
|
+
return n2 || (n2 = sa(ma(t2), e2, t2.m ? e2.LINEAR : e2.NEAREST), t2.g.push(n2), t2.j = true), e2.bindTexture(e2.TEXTURE_2D, n2), n2;
|
|
2521
|
+
}
|
|
2522
|
+
function _a(t2) {
|
|
2523
|
+
t2.h.bindTexture(t2.h.TEXTURE_2D, null);
|
|
2524
|
+
}
|
|
2525
|
+
var va;
|
|
2526
|
+
var Ea = class {
|
|
2527
|
+
constructor(t2, e2, n2, r2, i2, s2, o2) {
|
|
2528
|
+
this.g = t2, this.m = e2, this.j = n2, this.canvas = r2, this.l = i2, this.width = s2, this.height = o2, this.j && (0 === --wa && console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."));
|
|
2529
|
+
}
|
|
2530
|
+
Da() {
|
|
2531
|
+
return !!la(this, 0);
|
|
2532
|
+
}
|
|
2533
|
+
ja() {
|
|
2534
|
+
return !!la(this, 1);
|
|
2535
|
+
}
|
|
2536
|
+
R() {
|
|
2537
|
+
return !!la(this, 2);
|
|
2538
|
+
}
|
|
2539
|
+
ia() {
|
|
2540
|
+
return (e2 = la(t2 = this, 0)) || (e2 = da(t2), e2 = new Uint8Array(e2.map(((t3) => 255 * t3))), t2.g.push(e2)), e2;
|
|
2541
|
+
var t2, e2;
|
|
2542
|
+
}
|
|
2543
|
+
ha() {
|
|
2544
|
+
return da(this);
|
|
2545
|
+
}
|
|
2546
|
+
N() {
|
|
2547
|
+
return fa(this);
|
|
2548
|
+
}
|
|
2549
|
+
clone() {
|
|
2550
|
+
const t2 = [];
|
|
2551
|
+
for (const e2 of this.g) {
|
|
2552
|
+
let n2;
|
|
2553
|
+
if (e2 instanceof Uint8Array) n2 = new Uint8Array(e2);
|
|
2554
|
+
else if (e2 instanceof Float32Array) n2 = new Float32Array(e2);
|
|
2555
|
+
else {
|
|
2556
|
+
if (!(e2 instanceof WebGLTexture)) throw Error(`Type is not supported: ${e2}`);
|
|
2557
|
+
{
|
|
2558
|
+
const t3 = pa(this), e3 = ma(this);
|
|
2559
|
+
t3.activeTexture(t3.TEXTURE1), n2 = sa(e3, t3, this.m ? t3.LINEAR : t3.NEAREST), t3.bindTexture(t3.TEXTURE_2D, n2);
|
|
2560
|
+
const r2 = ga(this);
|
|
2561
|
+
t3.texImage2D(t3.TEXTURE_2D, 0, r2, this.width, this.height, 0, t3.RED, t3.FLOAT, null), t3.bindTexture(t3.TEXTURE_2D, null), oa(e3, t3, n2), ia(e3, t3, false, (() => {
|
|
2562
|
+
ya(this), t3.clearColor(0, 0, 0, 0), t3.clear(t3.COLOR_BUFFER_BIT), t3.drawArrays(t3.TRIANGLE_FAN, 0, 4), _a(this);
|
|
2563
|
+
})), aa(e3), _a(this);
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
t2.push(n2);
|
|
2567
|
+
}
|
|
2568
|
+
return new Ea(t2, this.m, this.R(), this.canvas, this.l, this.width, this.height);
|
|
2569
|
+
}
|
|
2570
|
+
close() {
|
|
2571
|
+
this.j && pa(this).deleteTexture(la(this, 2)), wa = -1;
|
|
2572
|
+
}
|
|
2573
|
+
};
|
|
2574
|
+
Ea.prototype.close = Ea.prototype.close, Ea.prototype.clone = Ea.prototype.clone, Ea.prototype.getAsWebGLTexture = Ea.prototype.N, Ea.prototype.getAsFloat32Array = Ea.prototype.ha, Ea.prototype.getAsUint8Array = Ea.prototype.ia, Ea.prototype.hasWebGLTexture = Ea.prototype.R, Ea.prototype.hasFloat32Array = Ea.prototype.ja, Ea.prototype.hasUint8Array = Ea.prototype.Da;
|
|
2575
|
+
var wa = 250;
|
|
2576
|
+
var Ta = { color: "white", lineWidth: 4, radius: 6 };
|
|
2577
|
+
function Aa(t2) {
|
|
2578
|
+
return { ...Ta, fillColor: (t2 = t2 || {}).color, ...t2 };
|
|
2579
|
+
}
|
|
2580
|
+
function ba(t2, e2) {
|
|
2581
|
+
return t2 instanceof Function ? t2(e2) : t2;
|
|
2582
|
+
}
|
|
2583
|
+
function ka(t2, e2, n2) {
|
|
2584
|
+
return Math.max(Math.min(e2, n2), Math.min(Math.max(e2, n2), t2));
|
|
2585
|
+
}
|
|
2586
|
+
function Sa(t2) {
|
|
2587
|
+
if (!t2.l) throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");
|
|
2588
|
+
return t2.l;
|
|
2589
|
+
}
|
|
2590
|
+
function xa(t2) {
|
|
2591
|
+
if (!t2.j) throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");
|
|
2592
|
+
return t2.j;
|
|
2593
|
+
}
|
|
2594
|
+
function La(t2, e2, n2) {
|
|
2595
|
+
if (e2.R()) n2(e2.N());
|
|
2596
|
+
else {
|
|
2597
|
+
const r2 = e2.ja() ? e2.ha() : e2.ia();
|
|
2598
|
+
t2.m = t2.m ?? new ca();
|
|
2599
|
+
const i2 = xa(t2);
|
|
2600
|
+
n2((t2 = new Ea([r2], e2.m, false, i2.canvas, t2.m, e2.width, e2.height)).N()), t2.close();
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
function Ra(t2, e2, n2, r2) {
|
|
2604
|
+
const i2 = (function(t3) {
|
|
2605
|
+
return t3.g || (t3.g = new ha()), t3.g;
|
|
2606
|
+
})(t2), s2 = xa(t2), o2 = Array.isArray(n2) ? new ImageData(new Uint8ClampedArray(n2), 1, 1) : n2;
|
|
2607
|
+
ia(i2, s2, true, (() => {
|
|
2608
|
+
!(function(t4, e3, n3, r3) {
|
|
2609
|
+
const i3 = t4.g;
|
|
2610
|
+
if (i3.activeTexture(i3.TEXTURE0), i3.bindTexture(i3.TEXTURE_2D, e3), i3.activeTexture(i3.TEXTURE1), i3.bindTexture(i3.TEXTURE_2D, t4.B), i3.texImage2D(i3.TEXTURE_2D, 0, i3.RGBA, i3.RGBA, i3.UNSIGNED_BYTE, n3), t4.H && (function(t5, e4) {
|
|
2611
|
+
if (t5 !== e4) return false;
|
|
2612
|
+
t5 = t5.entries(), e4 = e4.entries();
|
|
2613
|
+
for (const [r4, i4] of t5) {
|
|
2614
|
+
t5 = r4;
|
|
2615
|
+
const s3 = i4;
|
|
2616
|
+
var n4 = e4.next();
|
|
2617
|
+
if (n4.done) return false;
|
|
2618
|
+
const [o3, a2] = n4.value;
|
|
2619
|
+
if (n4 = a2, t5 !== o3 || s3[0] !== n4[0] || s3[1] !== n4[1] || s3[2] !== n4[2] || s3[3] !== n4[3]) return false;
|
|
2620
|
+
}
|
|
2621
|
+
return !!e4.next().done;
|
|
2622
|
+
})(t4.H, r3)) i3.activeTexture(i3.TEXTURE2), i3.bindTexture(i3.TEXTURE_2D, t4.j);
|
|
2623
|
+
else {
|
|
2624
|
+
t4.H = r3;
|
|
2625
|
+
const e4 = Array(1024).fill(0);
|
|
2626
|
+
r3.forEach(((t5, n4) => {
|
|
2627
|
+
if (4 !== t5.length) throw Error(`Color at index ${n4} is not a four-channel value.`);
|
|
2628
|
+
e4[4 * n4] = t5[0], e4[4 * n4 + 1] = t5[1], e4[4 * n4 + 2] = t5[2], e4[4 * n4 + 3] = t5[3];
|
|
2629
|
+
})), i3.activeTexture(i3.TEXTURE2), i3.bindTexture(i3.TEXTURE_2D, t4.j), i3.texImage2D(i3.TEXTURE_2D, 0, i3.RGBA, 256, 1, 0, i3.RGBA, i3.UNSIGNED_BYTE, new Uint8Array(e4));
|
|
2630
|
+
}
|
|
2631
|
+
})(i2, e2, o2, r2), s2.clearColor(0, 0, 0, 0), s2.clear(s2.COLOR_BUFFER_BIT), s2.drawArrays(s2.TRIANGLE_FAN, 0, 4);
|
|
2632
|
+
const t3 = i2.g;
|
|
2633
|
+
t3.activeTexture(t3.TEXTURE0), t3.bindTexture(t3.TEXTURE_2D, null), t3.activeTexture(t3.TEXTURE1), t3.bindTexture(t3.TEXTURE_2D, null), t3.activeTexture(t3.TEXTURE2), t3.bindTexture(t3.TEXTURE_2D, null);
|
|
2634
|
+
}));
|
|
2635
|
+
}
|
|
2636
|
+
function Fa(t2, e2, n2, r2) {
|
|
2637
|
+
const i2 = xa(t2), s2 = (function(t3) {
|
|
2638
|
+
return t3.h || (t3.h = new ua()), t3.h;
|
|
2639
|
+
})(t2), o2 = Array.isArray(n2) ? new ImageData(new Uint8ClampedArray(n2), 1, 1) : n2, a2 = Array.isArray(r2) ? new ImageData(new Uint8ClampedArray(r2), 1, 1) : r2;
|
|
2640
|
+
ia(s2, i2, true, (() => {
|
|
2641
|
+
var t3 = s2.g;
|
|
2642
|
+
t3.activeTexture(t3.TEXTURE0), t3.bindTexture(t3.TEXTURE_2D, e2), t3.activeTexture(t3.TEXTURE1), t3.bindTexture(t3.TEXTURE_2D, s2.j), t3.texImage2D(t3.TEXTURE_2D, 0, t3.RGBA, t3.RGBA, t3.UNSIGNED_BYTE, o2), t3.activeTexture(t3.TEXTURE2), t3.bindTexture(t3.TEXTURE_2D, s2.B), t3.texImage2D(t3.TEXTURE_2D, 0, t3.RGBA, t3.RGBA, t3.UNSIGNED_BYTE, a2), i2.clearColor(0, 0, 0, 0), i2.clear(i2.COLOR_BUFFER_BIT), i2.drawArrays(i2.TRIANGLE_FAN, 0, 4), i2.bindTexture(i2.TEXTURE_2D, null), (t3 = s2.g).activeTexture(t3.TEXTURE0), t3.bindTexture(t3.TEXTURE_2D, null), t3.activeTexture(t3.TEXTURE1), t3.bindTexture(t3.TEXTURE_2D, null), t3.activeTexture(t3.TEXTURE2), t3.bindTexture(t3.TEXTURE_2D, null);
|
|
2643
|
+
}));
|
|
2644
|
+
}
|
|
2645
|
+
var Ia = class {
|
|
2646
|
+
constructor(t2, e2) {
|
|
2647
|
+
"undefined" != typeof CanvasRenderingContext2D && t2 instanceof CanvasRenderingContext2D || t2 instanceof OffscreenCanvasRenderingContext2D ? (this.l = t2, this.j = e2) : this.j = t2;
|
|
2648
|
+
}
|
|
2649
|
+
wa(t2, e2) {
|
|
2650
|
+
if (t2) {
|
|
2651
|
+
var n2 = Sa(this);
|
|
2652
|
+
e2 = Aa(e2), n2.save();
|
|
2653
|
+
var r2 = n2.canvas, i2 = 0;
|
|
2654
|
+
for (const s2 of t2) n2.fillStyle = ba(e2.fillColor, { index: i2, from: s2 }), n2.strokeStyle = ba(e2.color, { index: i2, from: s2 }), n2.lineWidth = ba(e2.lineWidth, { index: i2, from: s2 }), (t2 = new Path2D()).arc(s2.x * r2.width, s2.y * r2.height, ba(e2.radius, { index: i2, from: s2 }), 0, 2 * Math.PI), n2.fill(t2), n2.stroke(t2), ++i2;
|
|
2655
|
+
n2.restore();
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
va(t2, e2, n2) {
|
|
2659
|
+
if (t2 && e2) {
|
|
2660
|
+
var r2 = Sa(this);
|
|
2661
|
+
n2 = Aa(n2), r2.save();
|
|
2662
|
+
var i2 = r2.canvas, s2 = 0;
|
|
2663
|
+
for (const o2 of e2) {
|
|
2664
|
+
r2.beginPath(), e2 = t2[o2.start];
|
|
2665
|
+
const a2 = t2[o2.end];
|
|
2666
|
+
e2 && a2 && (r2.strokeStyle = ba(n2.color, { index: s2, from: e2, to: a2 }), r2.lineWidth = ba(n2.lineWidth, { index: s2, from: e2, to: a2 }), r2.moveTo(e2.x * i2.width, e2.y * i2.height), r2.lineTo(a2.x * i2.width, a2.y * i2.height)), ++s2, r2.stroke();
|
|
2667
|
+
}
|
|
2668
|
+
r2.restore();
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
sa(t2, e2) {
|
|
2672
|
+
const n2 = Sa(this);
|
|
2673
|
+
e2 = Aa(e2), n2.save(), n2.beginPath(), n2.lineWidth = ba(e2.lineWidth, {}), n2.strokeStyle = ba(e2.color, {}), n2.fillStyle = ba(e2.fillColor, {}), n2.moveTo(t2.originX, t2.originY), n2.lineTo(t2.originX + t2.width, t2.originY), n2.lineTo(t2.originX + t2.width, t2.originY + t2.height), n2.lineTo(t2.originX, t2.originY + t2.height), n2.lineTo(t2.originX, t2.originY), n2.stroke(), n2.fill(), n2.restore();
|
|
2674
|
+
}
|
|
2675
|
+
ta(t2, e2, n2 = [0, 0, 0, 255]) {
|
|
2676
|
+
this.l ? (function(t3, e3, n3, r2) {
|
|
2677
|
+
const i2 = xa(t3);
|
|
2678
|
+
La(t3, e3, ((e4) => {
|
|
2679
|
+
Ra(t3, e4, n3, r2), (e4 = Sa(t3)).drawImage(i2.canvas, 0, 0, e4.canvas.width, e4.canvas.height);
|
|
2680
|
+
}));
|
|
2681
|
+
})(this, t2, n2, e2) : Ra(this, t2.N(), n2, e2);
|
|
2682
|
+
}
|
|
2683
|
+
ua(t2, e2, n2) {
|
|
2684
|
+
this.l ? (function(t3, e3, n3, r2) {
|
|
2685
|
+
const i2 = xa(t3);
|
|
2686
|
+
La(t3, e3, ((e4) => {
|
|
2687
|
+
Fa(t3, e4, n3, r2), (e4 = Sa(t3)).drawImage(i2.canvas, 0, 0, e4.canvas.width, e4.canvas.height);
|
|
2688
|
+
}));
|
|
2689
|
+
})(this, t2, e2, n2) : Fa(this, t2.N(), e2, n2);
|
|
2690
|
+
}
|
|
2691
|
+
close() {
|
|
2692
|
+
this.g?.close(), this.g = void 0, this.h?.close(), this.h = void 0, this.m?.close(), this.m = void 0;
|
|
2693
|
+
}
|
|
2694
|
+
};
|
|
2695
|
+
function Ma(t2, e2) {
|
|
2696
|
+
switch (e2) {
|
|
2697
|
+
case 0:
|
|
2698
|
+
return t2.g.find(((t3) => t3 instanceof ImageData));
|
|
2699
|
+
case 1:
|
|
2700
|
+
return t2.g.find(((t3) => "undefined" != typeof ImageBitmap && t3 instanceof ImageBitmap));
|
|
2701
|
+
case 2:
|
|
2702
|
+
return t2.g.find(((t3) => "undefined" != typeof WebGLTexture && t3 instanceof WebGLTexture));
|
|
2703
|
+
default:
|
|
2704
|
+
throw Error(`Type is not supported: ${e2}`);
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
function Pa(t2) {
|
|
2708
|
+
var e2 = Ma(t2, 0);
|
|
2709
|
+
if (!e2) {
|
|
2710
|
+
e2 = Oa(t2);
|
|
2711
|
+
const n2 = Ua(t2), r2 = new Uint8Array(t2.width * t2.height * 4);
|
|
2712
|
+
oa(n2, e2, Ca(t2)), e2.readPixels(0, 0, t2.width, t2.height, e2.RGBA, e2.UNSIGNED_BYTE, r2), aa(n2), e2 = new ImageData(new Uint8ClampedArray(r2.buffer), t2.width, t2.height), t2.g.push(e2);
|
|
2713
|
+
}
|
|
2714
|
+
return e2;
|
|
2715
|
+
}
|
|
2716
|
+
function Ca(t2) {
|
|
2717
|
+
let e2 = Ma(t2, 2);
|
|
2718
|
+
if (!e2) {
|
|
2719
|
+
const n2 = Oa(t2);
|
|
2720
|
+
e2 = Da(t2);
|
|
2721
|
+
const r2 = Ma(t2, 1) || Pa(t2);
|
|
2722
|
+
n2.texImage2D(n2.TEXTURE_2D, 0, n2.RGBA, n2.RGBA, n2.UNSIGNED_BYTE, r2), Na(t2);
|
|
2723
|
+
}
|
|
2724
|
+
return e2;
|
|
2725
|
+
}
|
|
2726
|
+
function Oa(t2) {
|
|
2727
|
+
if (!t2.canvas) throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");
|
|
2728
|
+
return t2.h || (t2.h = Qo(t2.canvas.getContext("webgl2"), "You cannot use a canvas that is already bound to a different type of rendering context.")), t2.h;
|
|
2729
|
+
}
|
|
2730
|
+
function Ua(t2) {
|
|
2731
|
+
return t2.l || (t2.l = new ca()), t2.l;
|
|
2732
|
+
}
|
|
2733
|
+
function Da(t2) {
|
|
2734
|
+
const e2 = Oa(t2);
|
|
2735
|
+
e2.viewport(0, 0, t2.width, t2.height), e2.activeTexture(e2.TEXTURE0);
|
|
2736
|
+
let n2 = Ma(t2, 2);
|
|
2737
|
+
return n2 || (n2 = sa(Ua(t2), e2), t2.g.push(n2), t2.m = true), e2.bindTexture(e2.TEXTURE_2D, n2), n2;
|
|
2738
|
+
}
|
|
2739
|
+
function Na(t2) {
|
|
2740
|
+
t2.h.bindTexture(t2.h.TEXTURE_2D, null);
|
|
2741
|
+
}
|
|
2742
|
+
function Ba(t2) {
|
|
2743
|
+
const e2 = Oa(t2);
|
|
2744
|
+
return ia(Ua(t2), e2, true, (() => (function(t3, e3) {
|
|
2745
|
+
const n2 = t3.canvas;
|
|
2746
|
+
if (n2.width === t3.width && n2.height === t3.height) return e3();
|
|
2747
|
+
const r2 = n2.width, i2 = n2.height;
|
|
2748
|
+
return n2.width = t3.width, n2.height = t3.height, t3 = e3(), n2.width = r2, n2.height = i2, t3;
|
|
2749
|
+
})(t2, (() => {
|
|
2750
|
+
if (e2.bindFramebuffer(e2.FRAMEBUFFER, null), e2.clearColor(0, 0, 0, 0), e2.clear(e2.COLOR_BUFFER_BIT), e2.drawArrays(e2.TRIANGLE_FAN, 0, 4), !(t2.canvas instanceof OffscreenCanvas)) throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");
|
|
2751
|
+
return t2.canvas.transferToImageBitmap();
|
|
2752
|
+
}))));
|
|
2753
|
+
}
|
|
2754
|
+
Ia.prototype.close = Ia.prototype.close, Ia.prototype.drawConfidenceMask = Ia.prototype.ua, Ia.prototype.drawCategoryMask = Ia.prototype.ta, Ia.prototype.drawBoundingBox = Ia.prototype.sa, Ia.prototype.drawConnectors = Ia.prototype.va, Ia.prototype.drawLandmarks = Ia.prototype.wa, Ia.lerp = function(t2, e2, n2, r2, i2) {
|
|
2755
|
+
return ka(r2 * (1 - (t2 - e2) / (n2 - e2)) + i2 * (1 - (n2 - t2) / (n2 - e2)), r2, i2);
|
|
2756
|
+
}, Ia.clamp = ka;
|
|
2757
|
+
var Ga = class {
|
|
2758
|
+
constructor(t2, e2, n2, r2, i2, s2, o2) {
|
|
2759
|
+
this.g = t2, this.j = e2, this.m = n2, this.canvas = r2, this.l = i2, this.width = s2, this.height = o2, (this.j || this.m) && (0 === --ja && console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."));
|
|
2760
|
+
}
|
|
2761
|
+
Ca() {
|
|
2762
|
+
return !!Ma(this, 0);
|
|
2763
|
+
}
|
|
2764
|
+
ka() {
|
|
2765
|
+
return !!Ma(this, 1);
|
|
2766
|
+
}
|
|
2767
|
+
R() {
|
|
2768
|
+
return !!Ma(this, 2);
|
|
2769
|
+
}
|
|
2770
|
+
Aa() {
|
|
2771
|
+
return Pa(this);
|
|
2772
|
+
}
|
|
2773
|
+
za() {
|
|
2774
|
+
var t2 = Ma(this, 1);
|
|
2775
|
+
return t2 || (Ca(this), Da(this), t2 = Ba(this), Na(this), this.g.push(t2), this.j = true), t2;
|
|
2776
|
+
}
|
|
2777
|
+
N() {
|
|
2778
|
+
return Ca(this);
|
|
2779
|
+
}
|
|
2780
|
+
clone() {
|
|
2781
|
+
const t2 = [];
|
|
2782
|
+
for (const e2 of this.g) {
|
|
2783
|
+
let n2;
|
|
2784
|
+
if (e2 instanceof ImageData) n2 = new ImageData(e2.data, this.width, this.height);
|
|
2785
|
+
else if (e2 instanceof WebGLTexture) {
|
|
2786
|
+
const t3 = Oa(this), e3 = Ua(this);
|
|
2787
|
+
t3.activeTexture(t3.TEXTURE1), n2 = sa(e3, t3), t3.bindTexture(t3.TEXTURE_2D, n2), t3.texImage2D(t3.TEXTURE_2D, 0, t3.RGBA, this.width, this.height, 0, t3.RGBA, t3.UNSIGNED_BYTE, null), t3.bindTexture(t3.TEXTURE_2D, null), oa(e3, t3, n2), ia(e3, t3, false, (() => {
|
|
2788
|
+
Da(this), t3.clearColor(0, 0, 0, 0), t3.clear(t3.COLOR_BUFFER_BIT), t3.drawArrays(t3.TRIANGLE_FAN, 0, 4), Na(this);
|
|
2789
|
+
})), aa(e3), Na(this);
|
|
2790
|
+
} else {
|
|
2791
|
+
if (!(e2 instanceof ImageBitmap)) throw Error(`Type is not supported: ${e2}`);
|
|
2792
|
+
Ca(this), Da(this), n2 = Ba(this), Na(this);
|
|
2793
|
+
}
|
|
2794
|
+
t2.push(n2);
|
|
2795
|
+
}
|
|
2796
|
+
return new Ga(t2, this.ka(), this.R(), this.canvas, this.l, this.width, this.height);
|
|
2797
|
+
}
|
|
2798
|
+
close() {
|
|
2799
|
+
this.j && Ma(this, 1).close(), this.m && Oa(this).deleteTexture(Ma(this, 2)), ja = -1;
|
|
2800
|
+
}
|
|
2801
|
+
};
|
|
2802
|
+
Ga.prototype.close = Ga.prototype.close, Ga.prototype.clone = Ga.prototype.clone, Ga.prototype.getAsWebGLTexture = Ga.prototype.N, Ga.prototype.getAsImageBitmap = Ga.prototype.za, Ga.prototype.getAsImageData = Ga.prototype.Aa, Ga.prototype.hasWebGLTexture = Ga.prototype.R, Ga.prototype.hasImageBitmap = Ga.prototype.ka, Ga.prototype.hasImageData = Ga.prototype.Ca;
|
|
2803
|
+
var ja = 250;
|
|
2804
|
+
function Va(...t2) {
|
|
2805
|
+
return t2.map((([t3, e2]) => ({ start: t3, end: e2 })));
|
|
2806
|
+
}
|
|
2807
|
+
var Xa = /* @__PURE__ */ (function(t2) {
|
|
2808
|
+
return class extends t2 {
|
|
2809
|
+
Ha() {
|
|
2810
|
+
this.i._registerModelResourcesGraphService();
|
|
2811
|
+
}
|
|
2812
|
+
};
|
|
2813
|
+
})((Ha = class {
|
|
2814
|
+
constructor(t2, e2) {
|
|
2815
|
+
this.l = true, this.i = t2, this.g = null, this.h = 0, this.m = "function" == typeof this.i._addIntToInputStream, void 0 !== e2 ? this.i.canvas = e2 : Do() ? 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"));
|
|
2816
|
+
}
|
|
2817
|
+
async initializeGraph(t2) {
|
|
2818
|
+
const e2 = await (await fetch(t2)).arrayBuffer();
|
|
2819
|
+
t2 = !(t2.endsWith(".pbtxt") || t2.endsWith(".textproto")), this.setGraph(new Uint8Array(e2), t2);
|
|
2820
|
+
}
|
|
2821
|
+
setGraphFromString(t2) {
|
|
2822
|
+
this.setGraph(new TextEncoder().encode(t2), false);
|
|
2823
|
+
}
|
|
2824
|
+
setGraph(t2, e2) {
|
|
2825
|
+
const n2 = t2.length, r2 = this.i._malloc(n2);
|
|
2826
|
+
this.i.HEAPU8.set(t2, r2), e2 ? this.i._changeBinaryGraph(n2, r2) : this.i._changeTextGraph(n2, r2), this.i._free(r2);
|
|
2827
|
+
}
|
|
2828
|
+
configureAudio(t2, e2, n2, r2, i2) {
|
|
2829
|
+
this.i._configureAudio || console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'), Go(this, r2 || "input_audio", ((r3) => {
|
|
2830
|
+
Go(this, i2 = i2 || "audio_header", ((i3) => {
|
|
2831
|
+
this.i._configureAudio(r3, i3, t2, e2 ?? 0, n2);
|
|
2832
|
+
}));
|
|
2833
|
+
}));
|
|
2834
|
+
}
|
|
2835
|
+
setAutoResizeCanvas(t2) {
|
|
2836
|
+
this.l = t2;
|
|
2837
|
+
}
|
|
2838
|
+
setAutoRenderToScreen(t2) {
|
|
2839
|
+
this.i._setAutoRenderToScreen(t2);
|
|
2840
|
+
}
|
|
2841
|
+
setGpuBufferVerticalFlip(t2) {
|
|
2842
|
+
this.i.gpuOriginForWebTexturesIsBottomLeft = t2;
|
|
2843
|
+
}
|
|
2844
|
+
ca(t2) {
|
|
2845
|
+
Xo(this, "__graph_config__", ((e2) => {
|
|
2846
|
+
t2(e2);
|
|
2847
|
+
})), Go(this, "__graph_config__", ((t3) => {
|
|
2848
|
+
this.i._getGraphConfig(t3, void 0);
|
|
2849
|
+
})), delete this.i.simpleListeners.__graph_config__;
|
|
2850
|
+
}
|
|
2851
|
+
attachErrorListener(t2) {
|
|
2852
|
+
this.i.errorListener = t2;
|
|
2853
|
+
}
|
|
2854
|
+
attachEmptyPacketListener(t2, e2) {
|
|
2855
|
+
this.i.emptyPacketListeners = this.i.emptyPacketListeners || {}, this.i.emptyPacketListeners[t2] = e2;
|
|
2856
|
+
}
|
|
2857
|
+
addAudioToStream(t2, e2, n2) {
|
|
2858
|
+
this.addAudioToStreamWithShape(t2, 0, 0, e2, n2);
|
|
2859
|
+
}
|
|
2860
|
+
addAudioToStreamWithShape(t2, e2, n2, r2, i2) {
|
|
2861
|
+
const s2 = 4 * t2.length;
|
|
2862
|
+
this.h !== s2 && (this.g && this.i._free(this.g), this.g = this.i._malloc(s2), this.h = s2), this.i.HEAPF32.set(t2, this.g / 4), Go(this, r2, ((t3) => {
|
|
2863
|
+
this.i._addAudioToInputStream(this.g, e2, n2, t3, i2);
|
|
2864
|
+
}));
|
|
2865
|
+
}
|
|
2866
|
+
addGpuBufferToStream(t2, e2, n2) {
|
|
2867
|
+
Go(this, e2, ((e3) => {
|
|
2868
|
+
const [r2, i2] = jo(this, t2, e3);
|
|
2869
|
+
this.i._addBoundTextureToStream(e3, r2, i2, n2);
|
|
2870
|
+
}));
|
|
2871
|
+
}
|
|
2872
|
+
addBoolToStream(t2, e2, n2) {
|
|
2873
|
+
Go(this, e2, ((e3) => {
|
|
2874
|
+
this.i._addBoolToInputStream(t2, e3, n2);
|
|
2875
|
+
}));
|
|
2876
|
+
}
|
|
2877
|
+
addDoubleToStream(t2, e2, n2) {
|
|
2878
|
+
Go(this, e2, ((e3) => {
|
|
2879
|
+
this.i._addDoubleToInputStream(t2, e3, n2);
|
|
2880
|
+
}));
|
|
2881
|
+
}
|
|
2882
|
+
addFloatToStream(t2, e2, n2) {
|
|
2883
|
+
Go(this, e2, ((e3) => {
|
|
2884
|
+
this.i._addFloatToInputStream(t2, e3, n2);
|
|
2885
|
+
}));
|
|
2886
|
+
}
|
|
2887
|
+
addIntToStream(t2, e2, n2) {
|
|
2888
|
+
Go(this, e2, ((e3) => {
|
|
2889
|
+
this.i._addIntToInputStream(t2, e3, n2);
|
|
2890
|
+
}));
|
|
2891
|
+
}
|
|
2892
|
+
addUintToStream(t2, e2, n2) {
|
|
2893
|
+
Go(this, e2, ((e3) => {
|
|
2894
|
+
this.i._addUintToInputStream(t2, e3, n2);
|
|
2895
|
+
}));
|
|
2896
|
+
}
|
|
2897
|
+
addStringToStream(t2, e2, n2) {
|
|
2898
|
+
Go(this, e2, ((e3) => {
|
|
2899
|
+
Go(this, t2, ((t3) => {
|
|
2900
|
+
this.i._addStringToInputStream(t3, e3, n2);
|
|
2901
|
+
}));
|
|
2902
|
+
}));
|
|
2903
|
+
}
|
|
2904
|
+
addStringRecordToStream(t2, e2, n2) {
|
|
2905
|
+
Go(this, e2, ((e3) => {
|
|
2906
|
+
Vo(this, Object.keys(t2), ((r2) => {
|
|
2907
|
+
Vo(this, Object.values(t2), ((i2) => {
|
|
2908
|
+
this.i._addFlatHashMapToInputStream(r2, i2, Object.keys(t2).length, e3, n2);
|
|
2909
|
+
}));
|
|
2910
|
+
}));
|
|
2911
|
+
}));
|
|
2912
|
+
}
|
|
2913
|
+
addProtoToStream(t2, e2, n2, r2) {
|
|
2914
|
+
Go(this, n2, ((n3) => {
|
|
2915
|
+
Go(this, e2, ((e3) => {
|
|
2916
|
+
const i2 = this.i._malloc(t2.length);
|
|
2917
|
+
this.i.HEAPU8.set(t2, i2), this.i._addProtoToInputStream(i2, t2.length, e3, n3, r2), this.i._free(i2);
|
|
2918
|
+
}));
|
|
2919
|
+
}));
|
|
2920
|
+
}
|
|
2921
|
+
addEmptyPacketToStream(t2, e2) {
|
|
2922
|
+
Go(this, t2, ((t3) => {
|
|
2923
|
+
this.i._addEmptyPacketToInputStream(t3, e2);
|
|
2924
|
+
}));
|
|
2925
|
+
}
|
|
2926
|
+
addBoolVectorToStream(t2, e2, n2) {
|
|
2927
|
+
Go(this, e2, ((e3) => {
|
|
2928
|
+
const r2 = this.i._allocateBoolVector(t2.length);
|
|
2929
|
+
if (!r2) throw Error("Unable to allocate new bool vector on heap.");
|
|
2930
|
+
for (const e4 of t2) this.i._addBoolVectorEntry(r2, e4);
|
|
2931
|
+
this.i._addBoolVectorToInputStream(r2, e3, n2);
|
|
2932
|
+
}));
|
|
2933
|
+
}
|
|
2934
|
+
addDoubleVectorToStream(t2, e2, n2) {
|
|
2935
|
+
Go(this, e2, ((e3) => {
|
|
2936
|
+
const r2 = this.i._allocateDoubleVector(t2.length);
|
|
2937
|
+
if (!r2) throw Error("Unable to allocate new double vector on heap.");
|
|
2938
|
+
for (const e4 of t2) this.i._addDoubleVectorEntry(r2, e4);
|
|
2939
|
+
this.i._addDoubleVectorToInputStream(r2, e3, n2);
|
|
2940
|
+
}));
|
|
2941
|
+
}
|
|
2942
|
+
addFloatVectorToStream(t2, e2, n2) {
|
|
2943
|
+
Go(this, e2, ((e3) => {
|
|
2944
|
+
const r2 = this.i._allocateFloatVector(t2.length);
|
|
2945
|
+
if (!r2) throw Error("Unable to allocate new float vector on heap.");
|
|
2946
|
+
for (const e4 of t2) this.i._addFloatVectorEntry(r2, e4);
|
|
2947
|
+
this.i._addFloatVectorToInputStream(r2, e3, n2);
|
|
2948
|
+
}));
|
|
2949
|
+
}
|
|
2950
|
+
addIntVectorToStream(t2, e2, n2) {
|
|
2951
|
+
Go(this, e2, ((e3) => {
|
|
2952
|
+
const r2 = this.i._allocateIntVector(t2.length);
|
|
2953
|
+
if (!r2) throw Error("Unable to allocate new int vector on heap.");
|
|
2954
|
+
for (const e4 of t2) this.i._addIntVectorEntry(r2, e4);
|
|
2955
|
+
this.i._addIntVectorToInputStream(r2, e3, n2);
|
|
2956
|
+
}));
|
|
2957
|
+
}
|
|
2958
|
+
addUintVectorToStream(t2, e2, n2) {
|
|
2959
|
+
Go(this, e2, ((e3) => {
|
|
2960
|
+
const r2 = this.i._allocateUintVector(t2.length);
|
|
2961
|
+
if (!r2) throw Error("Unable to allocate new unsigned int vector on heap.");
|
|
2962
|
+
for (const e4 of t2) this.i._addUintVectorEntry(r2, e4);
|
|
2963
|
+
this.i._addUintVectorToInputStream(r2, e3, n2);
|
|
2964
|
+
}));
|
|
2965
|
+
}
|
|
2966
|
+
addStringVectorToStream(t2, e2, n2) {
|
|
2967
|
+
Go(this, e2, ((e3) => {
|
|
2968
|
+
const r2 = this.i._allocateStringVector(t2.length);
|
|
2969
|
+
if (!r2) throw Error("Unable to allocate new string vector on heap.");
|
|
2970
|
+
for (const e4 of t2) Go(this, e4, ((t3) => {
|
|
2971
|
+
this.i._addStringVectorEntry(r2, t3);
|
|
2972
|
+
}));
|
|
2973
|
+
this.i._addStringVectorToInputStream(r2, e3, n2);
|
|
2974
|
+
}));
|
|
2975
|
+
}
|
|
2976
|
+
addBoolToInputSidePacket(t2, e2) {
|
|
2977
|
+
Go(this, e2, ((e3) => {
|
|
2978
|
+
this.i._addBoolToInputSidePacket(t2, e3);
|
|
2979
|
+
}));
|
|
2980
|
+
}
|
|
2981
|
+
addDoubleToInputSidePacket(t2, e2) {
|
|
2982
|
+
Go(this, e2, ((e3) => {
|
|
2983
|
+
this.i._addDoubleToInputSidePacket(t2, e3);
|
|
2984
|
+
}));
|
|
2985
|
+
}
|
|
2986
|
+
addFloatToInputSidePacket(t2, e2) {
|
|
2987
|
+
Go(this, e2, ((e3) => {
|
|
2988
|
+
this.i._addFloatToInputSidePacket(t2, e3);
|
|
2989
|
+
}));
|
|
2990
|
+
}
|
|
2991
|
+
addIntToInputSidePacket(t2, e2) {
|
|
2992
|
+
Go(this, e2, ((e3) => {
|
|
2993
|
+
this.i._addIntToInputSidePacket(t2, e3);
|
|
2994
|
+
}));
|
|
2995
|
+
}
|
|
2996
|
+
addUintToInputSidePacket(t2, e2) {
|
|
2997
|
+
Go(this, e2, ((e3) => {
|
|
2998
|
+
this.i._addUintToInputSidePacket(t2, e3);
|
|
2999
|
+
}));
|
|
3000
|
+
}
|
|
3001
|
+
addStringToInputSidePacket(t2, e2) {
|
|
3002
|
+
Go(this, e2, ((e3) => {
|
|
3003
|
+
Go(this, t2, ((t3) => {
|
|
3004
|
+
this.i._addStringToInputSidePacket(t3, e3);
|
|
3005
|
+
}));
|
|
3006
|
+
}));
|
|
3007
|
+
}
|
|
3008
|
+
addProtoToInputSidePacket(t2, e2, n2) {
|
|
3009
|
+
Go(this, n2, ((n3) => {
|
|
3010
|
+
Go(this, e2, ((e3) => {
|
|
3011
|
+
const r2 = this.i._malloc(t2.length);
|
|
3012
|
+
this.i.HEAPU8.set(t2, r2), this.i._addProtoToInputSidePacket(r2, t2.length, e3, n3), this.i._free(r2);
|
|
3013
|
+
}));
|
|
3014
|
+
}));
|
|
3015
|
+
}
|
|
3016
|
+
addBoolVectorToInputSidePacket(t2, e2) {
|
|
3017
|
+
Go(this, e2, ((e3) => {
|
|
3018
|
+
const n2 = this.i._allocateBoolVector(t2.length);
|
|
3019
|
+
if (!n2) throw Error("Unable to allocate new bool vector on heap.");
|
|
3020
|
+
for (const e4 of t2) this.i._addBoolVectorEntry(n2, e4);
|
|
3021
|
+
this.i._addBoolVectorToInputSidePacket(n2, e3);
|
|
3022
|
+
}));
|
|
3023
|
+
}
|
|
3024
|
+
addDoubleVectorToInputSidePacket(t2, e2) {
|
|
3025
|
+
Go(this, e2, ((e3) => {
|
|
3026
|
+
const n2 = this.i._allocateDoubleVector(t2.length);
|
|
3027
|
+
if (!n2) throw Error("Unable to allocate new double vector on heap.");
|
|
3028
|
+
for (const e4 of t2) this.i._addDoubleVectorEntry(n2, e4);
|
|
3029
|
+
this.i._addDoubleVectorToInputSidePacket(n2, e3);
|
|
3030
|
+
}));
|
|
3031
|
+
}
|
|
3032
|
+
addFloatVectorToInputSidePacket(t2, e2) {
|
|
3033
|
+
Go(this, e2, ((e3) => {
|
|
3034
|
+
const n2 = this.i._allocateFloatVector(t2.length);
|
|
3035
|
+
if (!n2) throw Error("Unable to allocate new float vector on heap.");
|
|
3036
|
+
for (const e4 of t2) this.i._addFloatVectorEntry(n2, e4);
|
|
3037
|
+
this.i._addFloatVectorToInputSidePacket(n2, e3);
|
|
3038
|
+
}));
|
|
3039
|
+
}
|
|
3040
|
+
addIntVectorToInputSidePacket(t2, e2) {
|
|
3041
|
+
Go(this, e2, ((e3) => {
|
|
3042
|
+
const n2 = this.i._allocateIntVector(t2.length);
|
|
3043
|
+
if (!n2) throw Error("Unable to allocate new int vector on heap.");
|
|
3044
|
+
for (const e4 of t2) this.i._addIntVectorEntry(n2, e4);
|
|
3045
|
+
this.i._addIntVectorToInputSidePacket(n2, e3);
|
|
3046
|
+
}));
|
|
3047
|
+
}
|
|
3048
|
+
addUintVectorToInputSidePacket(t2, e2) {
|
|
3049
|
+
Go(this, e2, ((e3) => {
|
|
3050
|
+
const n2 = this.i._allocateUintVector(t2.length);
|
|
3051
|
+
if (!n2) throw Error("Unable to allocate new unsigned int vector on heap.");
|
|
3052
|
+
for (const e4 of t2) this.i._addUintVectorEntry(n2, e4);
|
|
3053
|
+
this.i._addUintVectorToInputSidePacket(n2, e3);
|
|
3054
|
+
}));
|
|
3055
|
+
}
|
|
3056
|
+
addStringVectorToInputSidePacket(t2, e2) {
|
|
3057
|
+
Go(this, e2, ((e3) => {
|
|
3058
|
+
const n2 = this.i._allocateStringVector(t2.length);
|
|
3059
|
+
if (!n2) throw Error("Unable to allocate new string vector on heap.");
|
|
3060
|
+
for (const e4 of t2) Go(this, e4, ((t3) => {
|
|
3061
|
+
this.i._addStringVectorEntry(n2, t3);
|
|
3062
|
+
}));
|
|
3063
|
+
this.i._addStringVectorToInputSidePacket(n2, e3);
|
|
3064
|
+
}));
|
|
3065
|
+
}
|
|
3066
|
+
attachBoolListener(t2, e2) {
|
|
3067
|
+
Xo(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3068
|
+
this.i._attachBoolListener(t3);
|
|
3069
|
+
}));
|
|
3070
|
+
}
|
|
3071
|
+
attachBoolVectorListener(t2, e2) {
|
|
3072
|
+
Ho(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3073
|
+
this.i._attachBoolVectorListener(t3);
|
|
3074
|
+
}));
|
|
3075
|
+
}
|
|
3076
|
+
attachIntListener(t2, e2) {
|
|
3077
|
+
Xo(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3078
|
+
this.i._attachIntListener(t3);
|
|
3079
|
+
}));
|
|
3080
|
+
}
|
|
3081
|
+
attachIntVectorListener(t2, e2) {
|
|
3082
|
+
Ho(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3083
|
+
this.i._attachIntVectorListener(t3);
|
|
3084
|
+
}));
|
|
3085
|
+
}
|
|
3086
|
+
attachUintListener(t2, e2) {
|
|
3087
|
+
Xo(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3088
|
+
this.i._attachUintListener(t3);
|
|
3089
|
+
}));
|
|
3090
|
+
}
|
|
3091
|
+
attachUintVectorListener(t2, e2) {
|
|
3092
|
+
Ho(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3093
|
+
this.i._attachUintVectorListener(t3);
|
|
3094
|
+
}));
|
|
3095
|
+
}
|
|
3096
|
+
attachDoubleListener(t2, e2) {
|
|
3097
|
+
Xo(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3098
|
+
this.i._attachDoubleListener(t3);
|
|
3099
|
+
}));
|
|
3100
|
+
}
|
|
3101
|
+
attachDoubleVectorListener(t2, e2) {
|
|
3102
|
+
Ho(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3103
|
+
this.i._attachDoubleVectorListener(t3);
|
|
3104
|
+
}));
|
|
3105
|
+
}
|
|
3106
|
+
attachFloatListener(t2, e2) {
|
|
3107
|
+
Xo(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3108
|
+
this.i._attachFloatListener(t3);
|
|
3109
|
+
}));
|
|
3110
|
+
}
|
|
3111
|
+
attachFloatVectorListener(t2, e2) {
|
|
3112
|
+
Ho(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3113
|
+
this.i._attachFloatVectorListener(t3);
|
|
3114
|
+
}));
|
|
3115
|
+
}
|
|
3116
|
+
attachStringListener(t2, e2) {
|
|
3117
|
+
Xo(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3118
|
+
this.i._attachStringListener(t3);
|
|
3119
|
+
}));
|
|
3120
|
+
}
|
|
3121
|
+
attachStringVectorListener(t2, e2) {
|
|
3122
|
+
Ho(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3123
|
+
this.i._attachStringVectorListener(t3);
|
|
3124
|
+
}));
|
|
3125
|
+
}
|
|
3126
|
+
attachProtoListener(t2, e2, n2) {
|
|
3127
|
+
Xo(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3128
|
+
this.i._attachProtoListener(t3, n2 || false);
|
|
3129
|
+
}));
|
|
3130
|
+
}
|
|
3131
|
+
attachProtoVectorListener(t2, e2, n2) {
|
|
3132
|
+
Ho(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3133
|
+
this.i._attachProtoVectorListener(t3, n2 || false);
|
|
3134
|
+
}));
|
|
3135
|
+
}
|
|
3136
|
+
attachAudioListener(t2, e2, n2) {
|
|
3137
|
+
this.i._attachAudioListener || console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'), Xo(this, t2, ((t3, n3) => {
|
|
3138
|
+
t3 = new Float32Array(t3.buffer, t3.byteOffset, t3.length / 4), e2(t3, n3);
|
|
3139
|
+
})), Go(this, t2, ((t3) => {
|
|
3140
|
+
this.i._attachAudioListener(t3, n2 || false);
|
|
3141
|
+
}));
|
|
3142
|
+
}
|
|
3143
|
+
finishProcessing() {
|
|
3144
|
+
this.i._waitUntilIdle();
|
|
3145
|
+
}
|
|
3146
|
+
closeGraph() {
|
|
3147
|
+
this.i._closeGraph(), this.i.simpleListeners = void 0, this.i.emptyPacketListeners = void 0;
|
|
3148
|
+
}
|
|
3149
|
+
}, class extends Ha {
|
|
3150
|
+
get ea() {
|
|
3151
|
+
return this.i;
|
|
3152
|
+
}
|
|
3153
|
+
oa(t2, e2, n2) {
|
|
3154
|
+
Go(this, e2, ((e3) => {
|
|
3155
|
+
const [r2, i2] = jo(this, t2, e3);
|
|
3156
|
+
this.ea._addBoundTextureAsImageToStream(e3, r2, i2, n2);
|
|
3157
|
+
}));
|
|
3158
|
+
}
|
|
3159
|
+
V(t2, e2) {
|
|
3160
|
+
Xo(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3161
|
+
this.ea._attachImageListener(t3);
|
|
3162
|
+
}));
|
|
3163
|
+
}
|
|
3164
|
+
ba(t2, e2) {
|
|
3165
|
+
Ho(this, t2, e2), Go(this, t2, ((t3) => {
|
|
3166
|
+
this.ea._attachImageVectorListener(t3);
|
|
3167
|
+
}));
|
|
3168
|
+
}
|
|
3169
|
+
}));
|
|
3170
|
+
var Ha;
|
|
3171
|
+
var Wa = class extends Xa {
|
|
3172
|
+
};
|
|
3173
|
+
async function za(t2, e2, n2) {
|
|
3174
|
+
return (async function(t3, e3, n3, r2) {
|
|
3175
|
+
return Wo(t3, e3, n3, r2);
|
|
3176
|
+
})(t2, n2.canvas ?? (Do() ? void 0 : document.createElement("canvas")), e2, n2);
|
|
3177
|
+
}
|
|
3178
|
+
function Ka(t2, e2, n2, r2) {
|
|
3179
|
+
if (t2.U) {
|
|
3180
|
+
const s2 = new ms();
|
|
3181
|
+
if (n2?.regionOfInterest) {
|
|
3182
|
+
if (!t2.na) throw Error("This task doesn't support region-of-interest.");
|
|
3183
|
+
var i2 = n2.regionOfInterest;
|
|
3184
|
+
if (i2.left >= i2.right || i2.top >= i2.bottom) throw Error("Expected RectF with left < right and top < bottom.");
|
|
3185
|
+
if (i2.left < 0 || i2.top < 0 || i2.right > 1 || i2.bottom > 1) throw Error("Expected RectF values to be in [0,1].");
|
|
3186
|
+
An(s2, 1, (i2.left + i2.right) / 2), An(s2, 2, (i2.top + i2.bottom) / 2), An(s2, 4, i2.right - i2.left), An(s2, 3, i2.bottom - i2.top);
|
|
3187
|
+
} else An(s2, 1, 0.5), An(s2, 2, 0.5), An(s2, 4, 1), An(s2, 3, 1);
|
|
3188
|
+
if (n2?.rotationDegrees) {
|
|
3189
|
+
if (n2?.rotationDegrees % 90 != 0) throw Error("Expected rotation to be a multiple of 90\xB0.");
|
|
3190
|
+
if (An(s2, 5, -Math.PI * n2.rotationDegrees / 180), n2?.rotationDegrees % 180 != 0) {
|
|
3191
|
+
const [t3, r3] = Bo(e2);
|
|
3192
|
+
n2 = En(s2, 3) * r3 / t3, i2 = En(s2, 4) * t3 / r3, An(s2, 4, n2), An(s2, 3, i2);
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
t2.g.addProtoToStream(s2.g(), "mediapipe.NormalizedRect", t2.U, r2);
|
|
3196
|
+
}
|
|
3197
|
+
t2.g.oa(e2, t2.Z, r2 ?? performance.now()), t2.finishProcessing();
|
|
3198
|
+
}
|
|
3199
|
+
function Ya(t2, e2, n2) {
|
|
3200
|
+
if (t2.baseOptions?.g()) throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");
|
|
3201
|
+
Ka(t2, e2, n2, t2.B + 1);
|
|
3202
|
+
}
|
|
3203
|
+
function $a(t2, e2, n2, r2) {
|
|
3204
|
+
if (!t2.baseOptions?.g()) throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");
|
|
3205
|
+
Ka(t2, e2, n2, r2);
|
|
3206
|
+
}
|
|
3207
|
+
function qa(t2, e2, n2, r2) {
|
|
3208
|
+
var i2 = e2.data;
|
|
3209
|
+
const s2 = e2.width, o2 = s2 * (e2 = e2.height);
|
|
3210
|
+
if ((i2 instanceof Uint8Array || i2 instanceof Float32Array) && i2.length !== o2) throw Error("Unsupported channel count: " + i2.length / o2);
|
|
3211
|
+
return t2 = new Ea([i2], n2, false, t2.g.i.canvas, t2.P, s2, e2), r2 ? t2.clone() : t2;
|
|
3212
|
+
}
|
|
3213
|
+
var Ja = class extends Zo {
|
|
3214
|
+
constructor(t2, e2, n2, r2) {
|
|
3215
|
+
super(t2), this.g = t2, this.Z = e2, this.U = n2, this.na = r2, this.P = new ca();
|
|
3216
|
+
}
|
|
3217
|
+
l(t2, e2 = true) {
|
|
3218
|
+
if ("runningMode" in t2 && wn(this.baseOptions, 2, !!t2.runningMode && "IMAGE" !== t2.runningMode), void 0 !== t2.canvas && this.g.i.canvas !== t2.canvas) throw Error("You must create a new task to reset the canvas.");
|
|
3219
|
+
return super.l(t2, e2);
|
|
3220
|
+
}
|
|
3221
|
+
close() {
|
|
3222
|
+
this.P.close(), super.close();
|
|
3223
|
+
}
|
|
3224
|
+
};
|
|
3225
|
+
Ja.prototype.close = Ja.prototype.close;
|
|
3226
|
+
var Za = class extends Ja {
|
|
3227
|
+
constructor(t2, e2) {
|
|
3228
|
+
super(new Wa(t2, e2), "image_in", "norm_rect_in", false), this.j = { detections: [] }, dn(t2 = this.h = new Cs(), 0, 1, e2 = new Is()), An(this.h, 2, 0.5), An(this.h, 3, 0.3);
|
|
3229
|
+
}
|
|
3230
|
+
get baseOptions() {
|
|
3231
|
+
return hn(this.h, Is, 1);
|
|
3232
|
+
}
|
|
3233
|
+
set baseOptions(t2) {
|
|
3234
|
+
dn(this.h, 0, 1, t2);
|
|
3235
|
+
}
|
|
3236
|
+
o(t2) {
|
|
3237
|
+
return "minDetectionConfidence" in t2 && An(this.h, 2, t2.minDetectionConfidence ?? 0.5), "minSuppressionThreshold" in t2 && An(this.h, 3, t2.minSuppressionThreshold ?? 0.3), this.l(t2);
|
|
3238
|
+
}
|
|
3239
|
+
D(t2, e2) {
|
|
3240
|
+
return this.j = { detections: [] }, Ya(this, t2, e2), this.j;
|
|
3241
|
+
}
|
|
3242
|
+
F(t2, e2, n2) {
|
|
3243
|
+
return this.j = { detections: [] }, $a(this, t2, n2, e2), this.j;
|
|
3244
|
+
}
|
|
3245
|
+
m() {
|
|
3246
|
+
var t2 = new Qi();
|
|
3247
|
+
Ji(t2, "image_in"), Ji(t2, "norm_rect_in"), Zi(t2, "detections");
|
|
3248
|
+
const e2 = new Gi();
|
|
3249
|
+
Yn(e2, Us, this.h);
|
|
3250
|
+
const n2 = new zi();
|
|
3251
|
+
Xi(n2, "mediapipe.tasks.vision.face_detector.FaceDetectorGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "NORM_RECT:norm_rect_in"), Wi(n2, "DETECTIONS:detections"), n2.o(e2), qi(t2, n2), this.g.attachProtoVectorListener("detections", ((t3, e3) => {
|
|
3252
|
+
for (const e4 of t3) t3 = hs(e4), this.j.detections.push(xo(t3));
|
|
3253
|
+
Yo(this, e3);
|
|
3254
|
+
})), this.g.attachEmptyPacketListener("detections", ((t3) => {
|
|
3255
|
+
Yo(this, t3);
|
|
3256
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3257
|
+
}
|
|
3258
|
+
};
|
|
3259
|
+
Za.prototype.detectForVideo = Za.prototype.F, Za.prototype.detect = Za.prototype.D, Za.prototype.setOptions = Za.prototype.o, Za.createFromModelPath = async function(t2, e2) {
|
|
3260
|
+
return za(Za, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3261
|
+
}, Za.createFromModelBuffer = function(t2, e2) {
|
|
3262
|
+
return za(Za, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3263
|
+
}, Za.createFromOptions = function(t2, e2) {
|
|
3264
|
+
return za(Za, t2, e2);
|
|
3265
|
+
};
|
|
3266
|
+
var Qa = Va([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]);
|
|
3267
|
+
var tc = Va([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]);
|
|
3268
|
+
var ec = Va([276, 283], [283, 282], [282, 295], [295, 285], [300, 293], [293, 334], [334, 296], [296, 336]);
|
|
3269
|
+
var nc = Va([474, 475], [475, 476], [476, 477], [477, 474]);
|
|
3270
|
+
var rc = Va([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]);
|
|
3271
|
+
var ic = Va([46, 53], [53, 52], [52, 65], [65, 55], [70, 63], [63, 105], [105, 66], [66, 107]);
|
|
3272
|
+
var sc = Va([469, 470], [470, 471], [471, 472], [472, 469]);
|
|
3273
|
+
var oc = Va([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]);
|
|
3274
|
+
var ac = [...Qa, ...tc, ...ec, ...rc, ...ic, ...oc];
|
|
3275
|
+
var cc = Va([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]);
|
|
3276
|
+
function hc(t2) {
|
|
3277
|
+
t2.j = { faceLandmarks: [], faceBlendshapes: [], facialTransformationMatrixes: [] };
|
|
3278
|
+
}
|
|
3279
|
+
var uc = class extends Ja {
|
|
3280
|
+
constructor(t2, e2) {
|
|
3281
|
+
super(new Wa(t2, e2), "image_in", "norm_rect", false), this.j = { faceLandmarks: [], faceBlendshapes: [], facialTransformationMatrixes: [] }, this.outputFacialTransformationMatrixes = this.outputFaceBlendshapes = false, dn(t2 = this.h = new Bs(), 0, 1, e2 = new Is()), this.v = new Ns(), dn(this.h, 0, 3, this.v), this.s = new Cs(), dn(this.h, 0, 2, this.s), Tn(this.s, 4, 1), An(this.s, 2, 0.5), An(this.v, 2, 0.5), An(this.h, 4, 0.5);
|
|
3282
|
+
}
|
|
3283
|
+
get baseOptions() {
|
|
3284
|
+
return hn(this.h, Is, 1);
|
|
3285
|
+
}
|
|
3286
|
+
set baseOptions(t2) {
|
|
3287
|
+
dn(this.h, 0, 1, t2);
|
|
3288
|
+
}
|
|
3289
|
+
o(t2) {
|
|
3290
|
+
return "numFaces" in t2 && Tn(this.s, 4, t2.numFaces ?? 1), "minFaceDetectionConfidence" in t2 && An(this.s, 2, t2.minFaceDetectionConfidence ?? 0.5), "minTrackingConfidence" in t2 && An(this.h, 4, t2.minTrackingConfidence ?? 0.5), "minFacePresenceConfidence" in t2 && An(this.v, 2, t2.minFacePresenceConfidence ?? 0.5), "outputFaceBlendshapes" in t2 && (this.outputFaceBlendshapes = !!t2.outputFaceBlendshapes), "outputFacialTransformationMatrixes" in t2 && (this.outputFacialTransformationMatrixes = !!t2.outputFacialTransformationMatrixes), this.l(t2);
|
|
3291
|
+
}
|
|
3292
|
+
D(t2, e2) {
|
|
3293
|
+
return hc(this), Ya(this, t2, e2), this.j;
|
|
3294
|
+
}
|
|
3295
|
+
F(t2, e2, n2) {
|
|
3296
|
+
return hc(this), $a(this, t2, n2, e2), this.j;
|
|
3297
|
+
}
|
|
3298
|
+
m() {
|
|
3299
|
+
var t2 = new Qi();
|
|
3300
|
+
Ji(t2, "image_in"), Ji(t2, "norm_rect"), Zi(t2, "face_landmarks");
|
|
3301
|
+
const e2 = new Gi();
|
|
3302
|
+
Yn(e2, Vs, this.h);
|
|
3303
|
+
const n2 = new zi();
|
|
3304
|
+
Xi(n2, "mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "NORM_RECT:norm_rect"), Wi(n2, "NORM_LANDMARKS:face_landmarks"), n2.o(e2), qi(t2, n2), this.g.attachProtoVectorListener("face_landmarks", ((t3, e3) => {
|
|
3305
|
+
for (const e4 of t3) t3 = fs(e4), this.j.faceLandmarks.push(Lo(t3));
|
|
3306
|
+
Yo(this, e3);
|
|
3307
|
+
})), this.g.attachEmptyPacketListener("face_landmarks", ((t3) => {
|
|
3308
|
+
Yo(this, t3);
|
|
3309
|
+
})), this.outputFaceBlendshapes && (Zi(t2, "blendshapes"), Wi(n2, "BLENDSHAPES:blendshapes"), this.g.attachProtoVectorListener("blendshapes", ((t3, e3) => {
|
|
3310
|
+
if (this.outputFaceBlendshapes) for (const e4 of t3) t3 = ss(e4), this.j.faceBlendshapes.push(So(t3.g() ?? []));
|
|
3311
|
+
Yo(this, e3);
|
|
3312
|
+
})), this.g.attachEmptyPacketListener("blendshapes", ((t3) => {
|
|
3313
|
+
Yo(this, t3);
|
|
3314
|
+
}))), this.outputFacialTransformationMatrixes && (Zi(t2, "face_geometry"), Wi(n2, "FACE_GEOMETRY:face_geometry"), this.g.attachProtoVectorListener("face_geometry", ((t3, e3) => {
|
|
3315
|
+
if (this.outputFacialTransformationMatrixes) for (const e4 of t3) (t3 = hn(Ds(e4), ps, 2)) && this.j.facialTransformationMatrixes.push({ rows: _n(t3, 1) ?? 0 ?? 0, columns: _n(t3, 2) ?? 0 ?? 0, data: $e(t3, 3, qt, Ye()).slice() ?? [] });
|
|
3316
|
+
Yo(this, e3);
|
|
3317
|
+
})), this.g.attachEmptyPacketListener("face_geometry", ((t3) => {
|
|
3318
|
+
Yo(this, t3);
|
|
3319
|
+
}))), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3320
|
+
}
|
|
3321
|
+
};
|
|
3322
|
+
uc.prototype.detectForVideo = uc.prototype.F, uc.prototype.detect = uc.prototype.D, uc.prototype.setOptions = uc.prototype.o, uc.createFromModelPath = function(t2, e2) {
|
|
3323
|
+
return za(uc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3324
|
+
}, uc.createFromModelBuffer = function(t2, e2) {
|
|
3325
|
+
return za(uc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3326
|
+
}, uc.createFromOptions = function(t2, e2) {
|
|
3327
|
+
return za(uc, t2, e2);
|
|
3328
|
+
}, uc.FACE_LANDMARKS_LIPS = Qa, uc.FACE_LANDMARKS_LEFT_EYE = tc, uc.FACE_LANDMARKS_LEFT_EYEBROW = ec, uc.FACE_LANDMARKS_LEFT_IRIS = nc, uc.FACE_LANDMARKS_RIGHT_EYE = rc, uc.FACE_LANDMARKS_RIGHT_EYEBROW = ic, uc.FACE_LANDMARKS_RIGHT_IRIS = sc, uc.FACE_LANDMARKS_FACE_OVAL = oc, uc.FACE_LANDMARKS_CONTOURS = ac, uc.FACE_LANDMARKS_TESSELATION = cc;
|
|
3329
|
+
var lc = class extends Ja {
|
|
3330
|
+
constructor(t2, e2) {
|
|
3331
|
+
super(new Wa(t2, e2), "image_in", "norm_rect", true), dn(t2 = this.j = new Xs(), 0, 1, e2 = new Is());
|
|
3332
|
+
}
|
|
3333
|
+
get baseOptions() {
|
|
3334
|
+
return hn(this.j, Is, 1);
|
|
3335
|
+
}
|
|
3336
|
+
set baseOptions(t2) {
|
|
3337
|
+
dn(this.j, 0, 1, t2);
|
|
3338
|
+
}
|
|
3339
|
+
o(t2) {
|
|
3340
|
+
return super.l(t2);
|
|
3341
|
+
}
|
|
3342
|
+
Ka(t2, e2, n2) {
|
|
3343
|
+
const r2 = "function" != typeof e2 ? e2 : {};
|
|
3344
|
+
if (this.h = "function" == typeof e2 ? e2 : n2, Ya(this, t2, r2 ?? {}), !this.h) return this.s;
|
|
3345
|
+
}
|
|
3346
|
+
m() {
|
|
3347
|
+
var t2 = new Qi();
|
|
3348
|
+
Ji(t2, "image_in"), Ji(t2, "norm_rect"), Zi(t2, "stylized_image");
|
|
3349
|
+
const e2 = new Gi();
|
|
3350
|
+
Yn(e2, Hs, this.j);
|
|
3351
|
+
const n2 = new zi();
|
|
3352
|
+
Xi(n2, "mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "NORM_RECT:norm_rect"), Wi(n2, "STYLIZED_IMAGE:stylized_image"), n2.o(e2), qi(t2, n2), this.g.V("stylized_image", ((t3, e3) => {
|
|
3353
|
+
var n3 = !this.h, r2 = t3.data, i2 = t3.width;
|
|
3354
|
+
const s2 = i2 * (t3 = t3.height);
|
|
3355
|
+
if (r2 instanceof Uint8Array) if (r2.length === 3 * s2) {
|
|
3356
|
+
const e4 = new Uint8ClampedArray(4 * s2);
|
|
3357
|
+
for (let t4 = 0; t4 < s2; ++t4) e4[4 * t4] = r2[3 * t4], e4[4 * t4 + 1] = r2[3 * t4 + 1], e4[4 * t4 + 2] = r2[3 * t4 + 2], e4[4 * t4 + 3] = 255;
|
|
3358
|
+
r2 = new ImageData(e4, i2, t3);
|
|
3359
|
+
} else {
|
|
3360
|
+
if (r2.length !== 4 * s2) throw Error("Unsupported channel count: " + r2.length / s2);
|
|
3361
|
+
r2 = new ImageData(new Uint8ClampedArray(r2.buffer, r2.byteOffset, r2.length), i2, t3);
|
|
3362
|
+
}
|
|
3363
|
+
else if (!(r2 instanceof WebGLTexture)) throw Error(`Unsupported format: ${r2.constructor.name}`);
|
|
3364
|
+
i2 = new Ga([r2], false, false, this.g.i.canvas, this.P, i2, t3), this.s = n3 = n3 ? i2.clone() : i2, this.h && this.h(n3), Yo(this, e3);
|
|
3365
|
+
})), this.g.attachEmptyPacketListener("stylized_image", ((t3) => {
|
|
3366
|
+
this.s = null, this.h && this.h(null), Yo(this, t3);
|
|
3367
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3368
|
+
}
|
|
3369
|
+
};
|
|
3370
|
+
lc.prototype.stylize = lc.prototype.Ka, lc.prototype.setOptions = lc.prototype.o, lc.createFromModelPath = function(t2, e2) {
|
|
3371
|
+
return za(lc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3372
|
+
}, lc.createFromModelBuffer = function(t2, e2) {
|
|
3373
|
+
return za(lc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3374
|
+
}, lc.createFromOptions = function(t2, e2) {
|
|
3375
|
+
return za(lc, t2, e2);
|
|
3376
|
+
};
|
|
3377
|
+
var dc = Va([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]);
|
|
3378
|
+
function fc(t2) {
|
|
3379
|
+
t2.gestures = [], t2.landmarks = [], t2.worldLandmarks = [], t2.handedness = [];
|
|
3380
|
+
}
|
|
3381
|
+
function pc(t2) {
|
|
3382
|
+
return 0 === t2.gestures.length ? { gestures: [], landmarks: [], worldLandmarks: [], handedness: [], handednesses: [] } : { gestures: t2.gestures, landmarks: t2.landmarks, worldLandmarks: t2.worldLandmarks, handedness: t2.handedness, handednesses: t2.handedness };
|
|
3383
|
+
}
|
|
3384
|
+
function gc(t2, e2 = true) {
|
|
3385
|
+
const n2 = [];
|
|
3386
|
+
for (const i2 of t2) {
|
|
3387
|
+
var r2 = ss(i2);
|
|
3388
|
+
t2 = [];
|
|
3389
|
+
for (const n3 of r2.g()) r2 = e2 && null != _n(n3, 1) ? _n(n3, 1) ?? 0 : -1, t2.push({ score: En(n3, 2) ?? 0, index: r2, categoryName: vn(n3, 3) ?? "" ?? "", displayName: vn(n3, 4) ?? "" ?? "" });
|
|
3390
|
+
n2.push(t2);
|
|
3391
|
+
}
|
|
3392
|
+
return n2;
|
|
3393
|
+
}
|
|
3394
|
+
var mc = class extends Ja {
|
|
3395
|
+
constructor(t2, e2) {
|
|
3396
|
+
super(new Wa(t2, e2), "image_in", "norm_rect", false), this.gestures = [], this.landmarks = [], this.worldLandmarks = [], this.handedness = [], dn(t2 = this.j = new Js(), 0, 1, e2 = new Is()), this.s = new qs(), dn(this.j, 0, 2, this.s), this.C = new $s(), dn(this.s, 0, 3, this.C), this.v = new Ys(), dn(this.s, 0, 2, this.v), this.h = new Ks(), dn(this.j, 0, 3, this.h), An(this.v, 2, 0.5), An(this.s, 4, 0.5), An(this.C, 2, 0.5);
|
|
3397
|
+
}
|
|
3398
|
+
get baseOptions() {
|
|
3399
|
+
return hn(this.j, Is, 1);
|
|
3400
|
+
}
|
|
3401
|
+
set baseOptions(t2) {
|
|
3402
|
+
dn(this.j, 0, 1, t2);
|
|
3403
|
+
}
|
|
3404
|
+
o(t2) {
|
|
3405
|
+
if (Tn(this.v, 3, t2.numHands ?? 1), "minHandDetectionConfidence" in t2 && An(this.v, 2, t2.minHandDetectionConfidence ?? 0.5), "minTrackingConfidence" in t2 && An(this.s, 4, t2.minTrackingConfidence ?? 0.5), "minHandPresenceConfidence" in t2 && An(this.C, 2, t2.minHandPresenceConfidence ?? 0.5), t2.cannedGesturesClassifierOptions) {
|
|
3406
|
+
var e2 = new Ws(), n2 = e2, r2 = ko(t2.cannedGesturesClassifierOptions, hn(this.h, Ws, 3)?.h());
|
|
3407
|
+
dn(n2, 0, 2, r2), dn(this.h, 0, 3, e2);
|
|
3408
|
+
} else void 0 === t2.cannedGesturesClassifierOptions && hn(this.h, Ws, 3)?.g();
|
|
3409
|
+
return t2.customGesturesClassifierOptions ? (dn(n2 = e2 = new Ws(), 0, 2, r2 = ko(t2.customGesturesClassifierOptions, hn(this.h, Ws, 4)?.h())), dn(this.h, 0, 4, e2)) : void 0 === t2.customGesturesClassifierOptions && hn(this.h, Ws, 4)?.g(), this.l(t2);
|
|
3410
|
+
}
|
|
3411
|
+
Fa(t2, e2) {
|
|
3412
|
+
return fc(this), Ya(this, t2, e2), pc(this);
|
|
3413
|
+
}
|
|
3414
|
+
Ga(t2, e2, n2) {
|
|
3415
|
+
return fc(this), $a(this, t2, n2, e2), pc(this);
|
|
3416
|
+
}
|
|
3417
|
+
m() {
|
|
3418
|
+
var t2 = new Qi();
|
|
3419
|
+
Ji(t2, "image_in"), Ji(t2, "norm_rect"), Zi(t2, "hand_gestures"), Zi(t2, "hand_landmarks"), Zi(t2, "world_hand_landmarks"), Zi(t2, "handedness");
|
|
3420
|
+
const e2 = new Gi();
|
|
3421
|
+
Yn(e2, no, this.j);
|
|
3422
|
+
const n2 = new zi();
|
|
3423
|
+
Xi(n2, "mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "NORM_RECT:norm_rect"), Wi(n2, "HAND_GESTURES:hand_gestures"), Wi(n2, "LANDMARKS:hand_landmarks"), Wi(n2, "WORLD_LANDMARKS:world_hand_landmarks"), Wi(n2, "HANDEDNESS:handedness"), n2.o(e2), qi(t2, n2), this.g.attachProtoVectorListener("hand_landmarks", ((t3, e3) => {
|
|
3424
|
+
for (const e4 of t3) {
|
|
3425
|
+
t3 = fs(e4);
|
|
3426
|
+
const n3 = [];
|
|
3427
|
+
for (const e5 of ln(t3, ds, 1)) n3.push({ x: En(e5, 1) ?? 0, y: En(e5, 2) ?? 0, z: En(e5, 3) ?? 0, visibility: En(e5, 4) ?? 0 });
|
|
3428
|
+
this.landmarks.push(n3);
|
|
3429
|
+
}
|
|
3430
|
+
Yo(this, e3);
|
|
3431
|
+
})), this.g.attachEmptyPacketListener("hand_landmarks", ((t3) => {
|
|
3432
|
+
Yo(this, t3);
|
|
3433
|
+
})), this.g.attachProtoVectorListener("world_hand_landmarks", ((t3, e3) => {
|
|
3434
|
+
for (const e4 of t3) {
|
|
3435
|
+
t3 = ls(e4);
|
|
3436
|
+
const n3 = [];
|
|
3437
|
+
for (const e5 of ln(t3, us, 1)) n3.push({ x: En(e5, 1) ?? 0, y: En(e5, 2) ?? 0, z: En(e5, 3) ?? 0, visibility: En(e5, 4) ?? 0 });
|
|
3438
|
+
this.worldLandmarks.push(n3);
|
|
3439
|
+
}
|
|
3440
|
+
Yo(this, e3);
|
|
3441
|
+
})), this.g.attachEmptyPacketListener("world_hand_landmarks", ((t3) => {
|
|
3442
|
+
Yo(this, t3);
|
|
3443
|
+
})), this.g.attachProtoVectorListener("hand_gestures", ((t3, e3) => {
|
|
3444
|
+
this.gestures.push(...gc(t3, false)), Yo(this, e3);
|
|
3445
|
+
})), this.g.attachEmptyPacketListener("hand_gestures", ((t3) => {
|
|
3446
|
+
Yo(this, t3);
|
|
3447
|
+
})), this.g.attachProtoVectorListener("handedness", ((t3, e3) => {
|
|
3448
|
+
this.handedness.push(...gc(t3)), Yo(this, e3);
|
|
3449
|
+
})), this.g.attachEmptyPacketListener("handedness", ((t3) => {
|
|
3450
|
+
Yo(this, t3);
|
|
3451
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3452
|
+
}
|
|
3453
|
+
};
|
|
3454
|
+
function yc(t2) {
|
|
3455
|
+
return { landmarks: t2.landmarks, worldLandmarks: t2.worldLandmarks, handednesses: t2.handedness, handedness: t2.handedness };
|
|
3456
|
+
}
|
|
3457
|
+
mc.prototype.recognizeForVideo = mc.prototype.Ga, mc.prototype.recognize = mc.prototype.Fa, mc.prototype.setOptions = mc.prototype.o, mc.createFromModelPath = function(t2, e2) {
|
|
3458
|
+
return za(mc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3459
|
+
}, mc.createFromModelBuffer = function(t2, e2) {
|
|
3460
|
+
return za(mc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3461
|
+
}, mc.createFromOptions = function(t2, e2) {
|
|
3462
|
+
return za(mc, t2, e2);
|
|
3463
|
+
}, mc.HAND_CONNECTIONS = dc;
|
|
3464
|
+
var _c = class extends Ja {
|
|
3465
|
+
constructor(t2, e2) {
|
|
3466
|
+
super(new Wa(t2, e2), "image_in", "norm_rect", false), this.landmarks = [], this.worldLandmarks = [], this.handedness = [], dn(t2 = this.h = new qs(), 0, 1, e2 = new Is()), this.s = new $s(), dn(this.h, 0, 3, this.s), this.j = new Ys(), dn(this.h, 0, 2, this.j), Tn(this.j, 3, 1), An(this.j, 2, 0.5), An(this.s, 2, 0.5), An(this.h, 4, 0.5);
|
|
3467
|
+
}
|
|
3468
|
+
get baseOptions() {
|
|
3469
|
+
return hn(this.h, Is, 1);
|
|
3470
|
+
}
|
|
3471
|
+
set baseOptions(t2) {
|
|
3472
|
+
dn(this.h, 0, 1, t2);
|
|
3473
|
+
}
|
|
3474
|
+
o(t2) {
|
|
3475
|
+
return "numHands" in t2 && Tn(this.j, 3, t2.numHands ?? 1), "minHandDetectionConfidence" in t2 && An(this.j, 2, t2.minHandDetectionConfidence ?? 0.5), "minTrackingConfidence" in t2 && An(this.h, 4, t2.minTrackingConfidence ?? 0.5), "minHandPresenceConfidence" in t2 && An(this.s, 2, t2.minHandPresenceConfidence ?? 0.5), this.l(t2);
|
|
3476
|
+
}
|
|
3477
|
+
D(t2, e2) {
|
|
3478
|
+
return this.landmarks = [], this.worldLandmarks = [], this.handedness = [], Ya(this, t2, e2), yc(this);
|
|
3479
|
+
}
|
|
3480
|
+
F(t2, e2, n2) {
|
|
3481
|
+
return this.landmarks = [], this.worldLandmarks = [], this.handedness = [], $a(this, t2, n2, e2), yc(this);
|
|
3482
|
+
}
|
|
3483
|
+
m() {
|
|
3484
|
+
var t2 = new Qi();
|
|
3485
|
+
Ji(t2, "image_in"), Ji(t2, "norm_rect"), Zi(t2, "hand_landmarks"), Zi(t2, "world_hand_landmarks"), Zi(t2, "handedness");
|
|
3486
|
+
const e2 = new Gi();
|
|
3487
|
+
Yn(e2, ro, this.h);
|
|
3488
|
+
const n2 = new zi();
|
|
3489
|
+
Xi(n2, "mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "NORM_RECT:norm_rect"), Wi(n2, "LANDMARKS:hand_landmarks"), Wi(n2, "WORLD_LANDMARKS:world_hand_landmarks"), Wi(n2, "HANDEDNESS:handedness"), n2.o(e2), qi(t2, n2), this.g.attachProtoVectorListener("hand_landmarks", ((t3, e3) => {
|
|
3490
|
+
for (const e4 of t3) t3 = fs(e4), this.landmarks.push(Lo(t3));
|
|
3491
|
+
Yo(this, e3);
|
|
3492
|
+
})), this.g.attachEmptyPacketListener("hand_landmarks", ((t3) => {
|
|
3493
|
+
Yo(this, t3);
|
|
3494
|
+
})), this.g.attachProtoVectorListener("world_hand_landmarks", ((t3, e3) => {
|
|
3495
|
+
for (const e4 of t3) t3 = ls(e4), this.worldLandmarks.push(Ro(t3));
|
|
3496
|
+
Yo(this, e3);
|
|
3497
|
+
})), this.g.attachEmptyPacketListener("world_hand_landmarks", ((t3) => {
|
|
3498
|
+
Yo(this, t3);
|
|
3499
|
+
})), this.g.attachProtoVectorListener("handedness", ((t3, e3) => {
|
|
3500
|
+
var n3 = this.handedness, r2 = n3.push;
|
|
3501
|
+
const i2 = [];
|
|
3502
|
+
for (const e4 of t3) {
|
|
3503
|
+
t3 = ss(e4);
|
|
3504
|
+
const n4 = [];
|
|
3505
|
+
for (const e5 of t3.g()) n4.push({ score: En(e5, 2) ?? 0, index: _n(e5, 1) ?? 0 ?? -1, categoryName: vn(e5, 3) ?? "" ?? "", displayName: vn(e5, 4) ?? "" ?? "" });
|
|
3506
|
+
i2.push(n4);
|
|
3507
|
+
}
|
|
3508
|
+
r2.call(n3, ...i2), Yo(this, e3);
|
|
3509
|
+
})), this.g.attachEmptyPacketListener("handedness", ((t3) => {
|
|
3510
|
+
Yo(this, t3);
|
|
3511
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3512
|
+
}
|
|
3513
|
+
};
|
|
3514
|
+
_c.prototype.detectForVideo = _c.prototype.F, _c.prototype.detect = _c.prototype.D, _c.prototype.setOptions = _c.prototype.o, _c.createFromModelPath = function(t2, e2) {
|
|
3515
|
+
return za(_c, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3516
|
+
}, _c.createFromModelBuffer = function(t2, e2) {
|
|
3517
|
+
return za(_c, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3518
|
+
}, _c.createFromOptions = function(t2, e2) {
|
|
3519
|
+
return za(_c, t2, e2);
|
|
3520
|
+
}, _c.HAND_CONNECTIONS = dc;
|
|
3521
|
+
var vc = Va([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]);
|
|
3522
|
+
function Ec(t2) {
|
|
3523
|
+
t2.h = { faceLandmarks: [], faceBlendshapes: [], poseLandmarks: [], poseWorldLandmarks: [], poseSegmentationMasks: [], leftHandLandmarks: [], leftHandWorldLandmarks: [], rightHandLandmarks: [], rightHandWorldLandmarks: [] };
|
|
3524
|
+
}
|
|
3525
|
+
function wc(t2) {
|
|
3526
|
+
try {
|
|
3527
|
+
if (!t2.C) return t2.h;
|
|
3528
|
+
t2.C(t2.h);
|
|
3529
|
+
} finally {
|
|
3530
|
+
Jo(t2);
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
function Tc(t2, e2) {
|
|
3534
|
+
t2 = fs(t2), e2.push(Lo(t2));
|
|
3535
|
+
}
|
|
3536
|
+
var Ac = class extends Ja {
|
|
3537
|
+
constructor(t2, e2) {
|
|
3538
|
+
super(new Wa(t2, e2), "input_frames_image", null, false), this.h = { faceLandmarks: [], faceBlendshapes: [], poseLandmarks: [], poseWorldLandmarks: [], poseSegmentationMasks: [], leftHandLandmarks: [], leftHandWorldLandmarks: [], rightHandLandmarks: [], rightHandWorldLandmarks: [] }, this.outputPoseSegmentationMasks = this.outputFaceBlendshapes = false, dn(t2 = this.j = new ao(), 0, 1, e2 = new Is()), this.K = new $s(), dn(this.j, 0, 2, this.K), this.Y = new io(), dn(this.j, 0, 3, this.Y), this.s = new Cs(), dn(this.j, 0, 4, this.s), this.H = new Ns(), dn(this.j, 0, 5, this.H), this.v = new so(), dn(this.j, 0, 6, this.v), this.L = new oo(), dn(this.j, 0, 7, this.L), An(this.s, 2, 0.5), An(this.s, 3, 0.3), An(this.H, 2, 0.5), An(this.v, 2, 0.5), An(this.v, 3, 0.3), An(this.L, 2, 0.5), An(this.K, 2, 0.5);
|
|
3539
|
+
}
|
|
3540
|
+
get baseOptions() {
|
|
3541
|
+
return hn(this.j, Is, 1);
|
|
3542
|
+
}
|
|
3543
|
+
set baseOptions(t2) {
|
|
3544
|
+
dn(this.j, 0, 1, t2);
|
|
3545
|
+
}
|
|
3546
|
+
o(t2) {
|
|
3547
|
+
return "minFaceDetectionConfidence" in t2 && An(this.s, 2, t2.minFaceDetectionConfidence ?? 0.5), "minFaceSuppressionThreshold" in t2 && An(this.s, 3, t2.minFaceSuppressionThreshold ?? 0.3), "minFacePresenceConfidence" in t2 && An(this.H, 2, t2.minFacePresenceConfidence ?? 0.5), "outputFaceBlendshapes" in t2 && (this.outputFaceBlendshapes = !!t2.outputFaceBlendshapes), "minPoseDetectionConfidence" in t2 && An(this.v, 2, t2.minPoseDetectionConfidence ?? 0.5), "minPoseSuppressionThreshold" in t2 && An(this.v, 3, t2.minPoseSuppressionThreshold ?? 0.3), "minPosePresenceConfidence" in t2 && An(this.L, 2, t2.minPosePresenceConfidence ?? 0.5), "outputPoseSegmentationMasks" in t2 && (this.outputPoseSegmentationMasks = !!t2.outputPoseSegmentationMasks), "minHandLandmarksConfidence" in t2 && An(this.K, 2, t2.minHandLandmarksConfidence ?? 0.5), this.l(t2);
|
|
3548
|
+
}
|
|
3549
|
+
D(t2, e2, n2) {
|
|
3550
|
+
const r2 = "function" != typeof e2 ? e2 : {};
|
|
3551
|
+
return this.C = "function" == typeof e2 ? e2 : n2, Ec(this), Ya(this, t2, r2), wc(this);
|
|
3552
|
+
}
|
|
3553
|
+
F(t2, e2, n2, r2) {
|
|
3554
|
+
const i2 = "function" != typeof n2 ? n2 : {};
|
|
3555
|
+
return this.C = "function" == typeof n2 ? n2 : r2, Ec(this), $a(this, t2, i2, e2), wc(this);
|
|
3556
|
+
}
|
|
3557
|
+
m() {
|
|
3558
|
+
var t2 = new Qi();
|
|
3559
|
+
Ji(t2, "input_frames_image"), Zi(t2, "pose_landmarks"), Zi(t2, "pose_world_landmarks"), Zi(t2, "face_landmarks"), Zi(t2, "left_hand_landmarks"), Zi(t2, "left_hand_world_landmarks"), Zi(t2, "right_hand_landmarks"), Zi(t2, "right_hand_world_landmarks");
|
|
3560
|
+
const e2 = new Gi(), n2 = new xi();
|
|
3561
|
+
tn(n2, 1, de("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"), ""), (function(t3, e3) {
|
|
3562
|
+
if (null != e3) if (Array.isArray(e3)) He(t3, 2, Pe(e3, Oe, void 0, void 0, false));
|
|
3563
|
+
else {
|
|
3564
|
+
if (!("string" == typeof e3 || e3 instanceof N || C(e3))) throw Error("invalid value in Any.value field: " + e3 + " expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");
|
|
3565
|
+
tn(t3, 2, dt(e3, false), U());
|
|
3566
|
+
}
|
|
3567
|
+
})(n2, this.j.g());
|
|
3568
|
+
const r2 = new zi();
|
|
3569
|
+
Xi(r2, "mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"), yn(r2, 8, xi, n2), Hi(r2, "IMAGE:input_frames_image"), Wi(r2, "POSE_LANDMARKS:pose_landmarks"), Wi(r2, "POSE_WORLD_LANDMARKS:pose_world_landmarks"), Wi(r2, "FACE_LANDMARKS:face_landmarks"), Wi(r2, "LEFT_HAND_LANDMARKS:left_hand_landmarks"), Wi(r2, "LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"), Wi(r2, "RIGHT_HAND_LANDMARKS:right_hand_landmarks"), Wi(r2, "RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"), r2.o(e2), qi(t2, r2), $o(this, t2), this.g.attachProtoListener("pose_landmarks", ((t3, e3) => {
|
|
3570
|
+
Tc(t3, this.h.poseLandmarks), Yo(this, e3);
|
|
3571
|
+
})), this.g.attachEmptyPacketListener("pose_landmarks", ((t3) => {
|
|
3572
|
+
Yo(this, t3);
|
|
3573
|
+
})), this.g.attachProtoListener("pose_world_landmarks", ((t3, e3) => {
|
|
3574
|
+
var n3 = this.h.poseWorldLandmarks;
|
|
3575
|
+
t3 = ls(t3), n3.push(Ro(t3)), Yo(this, e3);
|
|
3576
|
+
})), this.g.attachEmptyPacketListener("pose_world_landmarks", ((t3) => {
|
|
3577
|
+
Yo(this, t3);
|
|
3578
|
+
})), this.outputPoseSegmentationMasks && (Wi(r2, "POSE_SEGMENTATION_MASK:pose_segmentation_mask"), qo(this, "pose_segmentation_mask"), this.g.V("pose_segmentation_mask", ((t3, e3) => {
|
|
3579
|
+
this.h.poseSegmentationMasks = [qa(this, t3, true, !this.C)], Yo(this, e3);
|
|
3580
|
+
})), this.g.attachEmptyPacketListener("pose_segmentation_mask", ((t3) => {
|
|
3581
|
+
this.h.poseSegmentationMasks = [], Yo(this, t3);
|
|
3582
|
+
}))), this.g.attachProtoListener("face_landmarks", ((t3, e3) => {
|
|
3583
|
+
Tc(t3, this.h.faceLandmarks), Yo(this, e3);
|
|
3584
|
+
})), this.g.attachEmptyPacketListener("face_landmarks", ((t3) => {
|
|
3585
|
+
Yo(this, t3);
|
|
3586
|
+
})), this.outputFaceBlendshapes && (Zi(t2, "extra_blendshapes"), Wi(r2, "FACE_BLENDSHAPES:extra_blendshapes"), this.g.attachProtoListener("extra_blendshapes", ((t3, e3) => {
|
|
3587
|
+
var n3 = this.h.faceBlendshapes;
|
|
3588
|
+
this.outputFaceBlendshapes && (t3 = ss(t3), n3.push(So(t3.g() ?? []))), Yo(this, e3);
|
|
3589
|
+
})), this.g.attachEmptyPacketListener("extra_blendshapes", ((t3) => {
|
|
3590
|
+
Yo(this, t3);
|
|
3591
|
+
}))), this.g.attachProtoListener("left_hand_landmarks", ((t3, e3) => {
|
|
3592
|
+
Tc(t3, this.h.leftHandLandmarks), Yo(this, e3);
|
|
3593
|
+
})), this.g.attachEmptyPacketListener("left_hand_landmarks", ((t3) => {
|
|
3594
|
+
Yo(this, t3);
|
|
3595
|
+
})), this.g.attachProtoListener("left_hand_world_landmarks", ((t3, e3) => {
|
|
3596
|
+
var n3 = this.h.leftHandWorldLandmarks;
|
|
3597
|
+
t3 = ls(t3), n3.push(Ro(t3)), Yo(this, e3);
|
|
3598
|
+
})), this.g.attachEmptyPacketListener("left_hand_world_landmarks", ((t3) => {
|
|
3599
|
+
Yo(this, t3);
|
|
3600
|
+
})), this.g.attachProtoListener("right_hand_landmarks", ((t3, e3) => {
|
|
3601
|
+
Tc(t3, this.h.rightHandLandmarks), Yo(this, e3);
|
|
3602
|
+
})), this.g.attachEmptyPacketListener("right_hand_landmarks", ((t3) => {
|
|
3603
|
+
Yo(this, t3);
|
|
3604
|
+
})), this.g.attachProtoListener("right_hand_world_landmarks", ((t3, e3) => {
|
|
3605
|
+
var n3 = this.h.rightHandWorldLandmarks;
|
|
3606
|
+
t3 = ls(t3), n3.push(Ro(t3)), Yo(this, e3);
|
|
3607
|
+
})), this.g.attachEmptyPacketListener("right_hand_world_landmarks", ((t3) => {
|
|
3608
|
+
Yo(this, t3);
|
|
3609
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3610
|
+
}
|
|
3611
|
+
};
|
|
3612
|
+
Ac.prototype.detectForVideo = Ac.prototype.F, Ac.prototype.detect = Ac.prototype.D, Ac.prototype.setOptions = Ac.prototype.o, Ac.createFromModelPath = function(t2, e2) {
|
|
3613
|
+
return za(Ac, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3614
|
+
}, Ac.createFromModelBuffer = function(t2, e2) {
|
|
3615
|
+
return za(Ac, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3616
|
+
}, Ac.createFromOptions = function(t2, e2) {
|
|
3617
|
+
return za(Ac, t2, e2);
|
|
3618
|
+
}, Ac.HAND_CONNECTIONS = dc, Ac.POSE_CONNECTIONS = vc, Ac.FACE_LANDMARKS_LIPS = Qa, Ac.FACE_LANDMARKS_LEFT_EYE = tc, Ac.FACE_LANDMARKS_LEFT_EYEBROW = ec, Ac.FACE_LANDMARKS_LEFT_IRIS = nc, Ac.FACE_LANDMARKS_RIGHT_EYE = rc, Ac.FACE_LANDMARKS_RIGHT_EYEBROW = ic, Ac.FACE_LANDMARKS_RIGHT_IRIS = sc, Ac.FACE_LANDMARKS_FACE_OVAL = oc, Ac.FACE_LANDMARKS_CONTOURS = ac, Ac.FACE_LANDMARKS_TESSELATION = cc;
|
|
3619
|
+
var bc = class extends Ja {
|
|
3620
|
+
constructor(t2, e2) {
|
|
3621
|
+
super(new Wa(t2, e2), "input_image", "norm_rect", true), this.j = { classifications: [] }, dn(t2 = this.h = new uo(), 0, 1, e2 = new Is());
|
|
3622
|
+
}
|
|
3623
|
+
get baseOptions() {
|
|
3624
|
+
return hn(this.h, Is, 1);
|
|
3625
|
+
}
|
|
3626
|
+
set baseOptions(t2) {
|
|
3627
|
+
dn(this.h, 0, 1, t2);
|
|
3628
|
+
}
|
|
3629
|
+
o(t2) {
|
|
3630
|
+
return dn(this.h, 0, 2, ko(t2, hn(this.h, bs, 2))), this.l(t2);
|
|
3631
|
+
}
|
|
3632
|
+
qa(t2, e2) {
|
|
3633
|
+
return this.j = { classifications: [] }, Ya(this, t2, e2), this.j;
|
|
3634
|
+
}
|
|
3635
|
+
ra(t2, e2, n2) {
|
|
3636
|
+
return this.j = { classifications: [] }, $a(this, t2, n2, e2), this.j;
|
|
3637
|
+
}
|
|
3638
|
+
m() {
|
|
3639
|
+
var t2 = new Qi();
|
|
3640
|
+
Ji(t2, "input_image"), Ji(t2, "norm_rect"), Zi(t2, "classifications");
|
|
3641
|
+
const e2 = new Gi();
|
|
3642
|
+
Yn(e2, lo, this.h);
|
|
3643
|
+
const n2 = new zi();
|
|
3644
|
+
Xi(n2, "mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"), Hi(n2, "IMAGE:input_image"), Hi(n2, "NORM_RECT:norm_rect"), Wi(n2, "CLASSIFICATIONS:classifications"), n2.o(e2), qi(t2, n2), this.g.attachProtoListener("classifications", ((t3, e3) => {
|
|
3645
|
+
this.j = (function(t4) {
|
|
3646
|
+
const e4 = { classifications: ln(t4, ys, 1).map(((t5) => So(hn(t5, rs, 4)?.g() ?? [], _n(t5, 2) ?? 0, vn(t5, 3) ?? ""))) };
|
|
3647
|
+
return null != he(Ve(t4, 2)) && (e4.timestampMs = he(Ve(t4, 2)) ?? 0), e4;
|
|
3648
|
+
})(_s(t3)), Yo(this, e3);
|
|
3649
|
+
})), this.g.attachEmptyPacketListener("classifications", ((t3) => {
|
|
3650
|
+
Yo(this, t3);
|
|
3651
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3652
|
+
}
|
|
3653
|
+
};
|
|
3654
|
+
bc.prototype.classifyForVideo = bc.prototype.ra, bc.prototype.classify = bc.prototype.qa, bc.prototype.setOptions = bc.prototype.o, bc.createFromModelPath = function(t2, e2) {
|
|
3655
|
+
return za(bc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3656
|
+
}, bc.createFromModelBuffer = function(t2, e2) {
|
|
3657
|
+
return za(bc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3658
|
+
}, bc.createFromOptions = function(t2, e2) {
|
|
3659
|
+
return za(bc, t2, e2);
|
|
3660
|
+
};
|
|
3661
|
+
var kc = class extends Ja {
|
|
3662
|
+
constructor(t2, e2) {
|
|
3663
|
+
super(new Wa(t2, e2), "image_in", "norm_rect", true), this.h = new fo(), this.embeddings = { embeddings: [] }, dn(t2 = this.h, 0, 1, e2 = new Is());
|
|
3664
|
+
}
|
|
3665
|
+
get baseOptions() {
|
|
3666
|
+
return hn(this.h, Is, 1);
|
|
3667
|
+
}
|
|
3668
|
+
set baseOptions(t2) {
|
|
3669
|
+
dn(this.h, 0, 1, t2);
|
|
3670
|
+
}
|
|
3671
|
+
o(t2) {
|
|
3672
|
+
var e2 = this.h, n2 = hn(this.h, Ss, 2);
|
|
3673
|
+
return n2 = n2 ? n2.clone() : new Ss(), void 0 !== t2.l2Normalize ? wn(n2, 1, t2.l2Normalize) : "l2Normalize" in t2 && He(n2, 1), void 0 !== t2.quantize ? wn(n2, 2, t2.quantize) : "quantize" in t2 && He(n2, 2), dn(e2, 0, 2, n2), this.l(t2);
|
|
3674
|
+
}
|
|
3675
|
+
xa(t2, e2) {
|
|
3676
|
+
return Ya(this, t2, e2), this.embeddings;
|
|
3677
|
+
}
|
|
3678
|
+
ya(t2, e2, n2) {
|
|
3679
|
+
return $a(this, t2, n2, e2), this.embeddings;
|
|
3680
|
+
}
|
|
3681
|
+
m() {
|
|
3682
|
+
var t2 = new Qi();
|
|
3683
|
+
Ji(t2, "image_in"), Ji(t2, "norm_rect"), Zi(t2, "embeddings_out");
|
|
3684
|
+
const e2 = new Gi();
|
|
3685
|
+
Yn(e2, po, this.h);
|
|
3686
|
+
const n2 = new zi();
|
|
3687
|
+
Xi(n2, "mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "NORM_RECT:norm_rect"), Wi(n2, "EMBEDDINGS:embeddings_out"), n2.o(e2), qi(t2, n2), this.g.attachProtoListener("embeddings_out", ((t3, e3) => {
|
|
3688
|
+
t3 = As(t3), this.embeddings = (function(t4) {
|
|
3689
|
+
return { embeddings: ln(t4, ws, 1).map(((t5) => {
|
|
3690
|
+
const e4 = { headIndex: _n(t5, 3) ?? 0 ?? -1, headName: vn(t5, 4) ?? "" ?? "" };
|
|
3691
|
+
if (void 0 !== cn(t5, vs, nn(t5, 1))) t5 = $e(t5 = hn(t5, vs, nn(t5, 1)), 1, qt, Ye()), e4.floatEmbedding = t5.slice();
|
|
3692
|
+
else {
|
|
3693
|
+
const n3 = new Uint8Array(0);
|
|
3694
|
+
e4.quantizedEmbedding = hn(t5, Es, nn(t5, 2))?.ma()?.h() ?? n3;
|
|
3695
|
+
}
|
|
3696
|
+
return e4;
|
|
3697
|
+
})), timestampMs: he(Ve(t4, 2)) ?? 0 };
|
|
3698
|
+
})(t3), Yo(this, e3);
|
|
3699
|
+
})), this.g.attachEmptyPacketListener("embeddings_out", ((t3) => {
|
|
3700
|
+
Yo(this, t3);
|
|
3701
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3702
|
+
}
|
|
3703
|
+
};
|
|
3704
|
+
kc.cosineSimilarity = function(t2, e2) {
|
|
3705
|
+
if (t2.floatEmbedding && e2.floatEmbedding) t2 = Io(t2.floatEmbedding, e2.floatEmbedding);
|
|
3706
|
+
else {
|
|
3707
|
+
if (!t2.quantizedEmbedding || !e2.quantizedEmbedding) throw Error("Cannot compute cosine similarity between quantized and float embeddings.");
|
|
3708
|
+
t2 = Io(Fo(t2.quantizedEmbedding), Fo(e2.quantizedEmbedding));
|
|
3709
|
+
}
|
|
3710
|
+
return t2;
|
|
3711
|
+
}, kc.prototype.embedForVideo = kc.prototype.ya, kc.prototype.embed = kc.prototype.xa, kc.prototype.setOptions = kc.prototype.o, kc.createFromModelPath = function(t2, e2) {
|
|
3712
|
+
return za(kc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3713
|
+
}, kc.createFromModelBuffer = function(t2, e2) {
|
|
3714
|
+
return za(kc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3715
|
+
}, kc.createFromOptions = function(t2, e2) {
|
|
3716
|
+
return za(kc, t2, e2);
|
|
3717
|
+
};
|
|
3718
|
+
var Sc = class {
|
|
3719
|
+
constructor(t2, e2, n2) {
|
|
3720
|
+
this.confidenceMasks = t2, this.categoryMask = e2, this.qualityScores = n2;
|
|
3721
|
+
}
|
|
3722
|
+
close() {
|
|
3723
|
+
this.confidenceMasks?.forEach(((t2) => {
|
|
3724
|
+
t2.close();
|
|
3725
|
+
})), this.categoryMask?.close();
|
|
3726
|
+
}
|
|
3727
|
+
};
|
|
3728
|
+
function xc(t2) {
|
|
3729
|
+
t2.categoryMask = void 0, t2.confidenceMasks = void 0, t2.qualityScores = void 0;
|
|
3730
|
+
}
|
|
3731
|
+
function Lc(t2) {
|
|
3732
|
+
try {
|
|
3733
|
+
const e2 = new Sc(t2.confidenceMasks, t2.categoryMask, t2.qualityScores);
|
|
3734
|
+
if (!t2.j) return e2;
|
|
3735
|
+
t2.j(e2);
|
|
3736
|
+
} finally {
|
|
3737
|
+
Jo(t2);
|
|
3738
|
+
}
|
|
3739
|
+
}
|
|
3740
|
+
Sc.prototype.close = Sc.prototype.close;
|
|
3741
|
+
var Rc = class extends Ja {
|
|
3742
|
+
constructor(t2, e2) {
|
|
3743
|
+
super(new Wa(t2, e2), "image_in", "norm_rect", false), this.s = [], this.outputCategoryMask = false, this.outputConfidenceMasks = true, this.h = new vo(), this.v = new go(), dn(this.h, 0, 3, this.v), dn(t2 = this.h, 0, 1, e2 = new Is());
|
|
3744
|
+
}
|
|
3745
|
+
get baseOptions() {
|
|
3746
|
+
return hn(this.h, Is, 1);
|
|
3747
|
+
}
|
|
3748
|
+
set baseOptions(t2) {
|
|
3749
|
+
dn(this.h, 0, 1, t2);
|
|
3750
|
+
}
|
|
3751
|
+
o(t2) {
|
|
3752
|
+
return void 0 !== t2.displayNamesLocale ? He(this.h, 2, de(t2.displayNamesLocale)) : "displayNamesLocale" in t2 && He(this.h, 2), "outputCategoryMask" in t2 && (this.outputCategoryMask = t2.outputCategoryMask ?? false), "outputConfidenceMasks" in t2 && (this.outputConfidenceMasks = t2.outputConfidenceMasks ?? true), super.l(t2);
|
|
3753
|
+
}
|
|
3754
|
+
J() {
|
|
3755
|
+
!(function(t2) {
|
|
3756
|
+
const e2 = ln(t2.ca(), zi, 1).filter(((t3) => (vn(t3, 1) ?? "").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));
|
|
3757
|
+
if (t2.s = [], e2.length > 1) throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");
|
|
3758
|
+
1 === e2.length && (hn(e2[0], Gi, 7)?.l()?.g() ?? /* @__PURE__ */ new Map()).forEach(((e3, n2) => {
|
|
3759
|
+
t2.s[Number(n2)] = vn(e3, 1) ?? "";
|
|
3760
|
+
}));
|
|
3761
|
+
})(this);
|
|
3762
|
+
}
|
|
3763
|
+
segment(t2, e2, n2) {
|
|
3764
|
+
const r2 = "function" != typeof e2 ? e2 : {};
|
|
3765
|
+
return this.j = "function" == typeof e2 ? e2 : n2, xc(this), Ya(this, t2, r2), Lc(this);
|
|
3766
|
+
}
|
|
3767
|
+
Ia(t2, e2, n2, r2) {
|
|
3768
|
+
const i2 = "function" != typeof n2 ? n2 : {};
|
|
3769
|
+
return this.j = "function" == typeof n2 ? n2 : r2, xc(this), $a(this, t2, i2, e2), Lc(this);
|
|
3770
|
+
}
|
|
3771
|
+
Ba() {
|
|
3772
|
+
return this.s;
|
|
3773
|
+
}
|
|
3774
|
+
m() {
|
|
3775
|
+
var t2 = new Qi();
|
|
3776
|
+
Ji(t2, "image_in"), Ji(t2, "norm_rect");
|
|
3777
|
+
const e2 = new Gi();
|
|
3778
|
+
Yn(e2, Eo, this.h);
|
|
3779
|
+
const n2 = new zi();
|
|
3780
|
+
Xi(n2, "mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "NORM_RECT:norm_rect"), n2.o(e2), qi(t2, n2), $o(this, t2), this.outputConfidenceMasks && (Zi(t2, "confidence_masks"), Wi(n2, "CONFIDENCE_MASKS:confidence_masks"), qo(this, "confidence_masks"), this.g.ba("confidence_masks", ((t3, e3) => {
|
|
3781
|
+
this.confidenceMasks = t3.map(((t4) => qa(this, t4, true, !this.j))), Yo(this, e3);
|
|
3782
|
+
})), this.g.attachEmptyPacketListener("confidence_masks", ((t3) => {
|
|
3783
|
+
this.confidenceMasks = [], Yo(this, t3);
|
|
3784
|
+
}))), this.outputCategoryMask && (Zi(t2, "category_mask"), Wi(n2, "CATEGORY_MASK:category_mask"), qo(this, "category_mask"), this.g.V("category_mask", ((t3, e3) => {
|
|
3785
|
+
this.categoryMask = qa(this, t3, false, !this.j), Yo(this, e3);
|
|
3786
|
+
})), this.g.attachEmptyPacketListener("category_mask", ((t3) => {
|
|
3787
|
+
this.categoryMask = void 0, Yo(this, t3);
|
|
3788
|
+
}))), Zi(t2, "quality_scores"), Wi(n2, "QUALITY_SCORES:quality_scores"), this.g.attachFloatVectorListener("quality_scores", ((t3, e3) => {
|
|
3789
|
+
this.qualityScores = t3, Yo(this, e3);
|
|
3790
|
+
})), this.g.attachEmptyPacketListener("quality_scores", ((t3) => {
|
|
3791
|
+
this.categoryMask = void 0, Yo(this, t3);
|
|
3792
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3793
|
+
}
|
|
3794
|
+
};
|
|
3795
|
+
Rc.prototype.getLabels = Rc.prototype.Ba, Rc.prototype.segmentForVideo = Rc.prototype.Ia, Rc.prototype.segment = Rc.prototype.segment, Rc.prototype.setOptions = Rc.prototype.o, Rc.createFromModelPath = function(t2, e2) {
|
|
3796
|
+
return za(Rc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3797
|
+
}, Rc.createFromModelBuffer = function(t2, e2) {
|
|
3798
|
+
return za(Rc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3799
|
+
}, Rc.createFromOptions = function(t2, e2) {
|
|
3800
|
+
return za(Rc, t2, e2);
|
|
3801
|
+
};
|
|
3802
|
+
var Fc = class {
|
|
3803
|
+
constructor(t2, e2, n2) {
|
|
3804
|
+
this.confidenceMasks = t2, this.categoryMask = e2, this.qualityScores = n2;
|
|
3805
|
+
}
|
|
3806
|
+
close() {
|
|
3807
|
+
this.confidenceMasks?.forEach(((t2) => {
|
|
3808
|
+
t2.close();
|
|
3809
|
+
})), this.categoryMask?.close();
|
|
3810
|
+
}
|
|
3811
|
+
};
|
|
3812
|
+
Fc.prototype.close = Fc.prototype.close;
|
|
3813
|
+
var Ic = class extends $n {
|
|
3814
|
+
constructor(t2) {
|
|
3815
|
+
super(t2);
|
|
3816
|
+
}
|
|
3817
|
+
};
|
|
3818
|
+
var Mc = [0, hi, -2];
|
|
3819
|
+
var Pc = [0, ni, -3, di, ni, -1];
|
|
3820
|
+
var Cc = [0, Pc];
|
|
3821
|
+
var Oc = [0, Pc, hi, -1];
|
|
3822
|
+
var Uc = class extends $n {
|
|
3823
|
+
constructor(t2) {
|
|
3824
|
+
super(t2);
|
|
3825
|
+
}
|
|
3826
|
+
};
|
|
3827
|
+
var Dc = [0, ni, -1, di];
|
|
3828
|
+
var Nc = class extends $n {
|
|
3829
|
+
constructor(t2) {
|
|
3830
|
+
super(t2);
|
|
3831
|
+
}
|
|
3832
|
+
};
|
|
3833
|
+
var Bc = class extends $n {
|
|
3834
|
+
constructor(t2) {
|
|
3835
|
+
super(t2);
|
|
3836
|
+
}
|
|
3837
|
+
};
|
|
3838
|
+
var Gc = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15];
|
|
3839
|
+
var jc = class extends $n {
|
|
3840
|
+
constructor(t2) {
|
|
3841
|
+
super(t2);
|
|
3842
|
+
}
|
|
3843
|
+
};
|
|
3844
|
+
jc.prototype.g = Si([0, yi, [0, Gc, _i, Pc, _i, [0, Pc, Mc], _i, Cc, _i, [0, Cc, Mc], _i, Dc, _i, [0, ni, -3, di, Ti], _i, [0, ni, -3, di], _i, [0, mi, ni, -2, di, hi, di, -1, 2, ni, Mc], _i, Oc, _i, [0, Oc, Mc], ni, Mc, mi, _i, [0, ni, -3, di, Mc, -1], _i, [0, yi, Dc]], mi, [0, mi, hi, -1, di]]);
|
|
3845
|
+
var Vc = class extends Ja {
|
|
3846
|
+
constructor(t2, e2) {
|
|
3847
|
+
super(new Wa(t2, e2), "image_in", "norm_rect_in", false), this.outputCategoryMask = false, this.outputConfidenceMasks = true, this.h = new vo(), this.s = new go(), dn(this.h, 0, 3, this.s), dn(t2 = this.h, 0, 1, e2 = new Is());
|
|
3848
|
+
}
|
|
3849
|
+
get baseOptions() {
|
|
3850
|
+
return hn(this.h, Is, 1);
|
|
3851
|
+
}
|
|
3852
|
+
set baseOptions(t2) {
|
|
3853
|
+
dn(this.h, 0, 1, t2);
|
|
3854
|
+
}
|
|
3855
|
+
o(t2) {
|
|
3856
|
+
return "outputCategoryMask" in t2 && (this.outputCategoryMask = t2.outputCategoryMask ?? false), "outputConfidenceMasks" in t2 && (this.outputConfidenceMasks = t2.outputConfidenceMasks ?? true), super.l(t2);
|
|
3857
|
+
}
|
|
3858
|
+
segment(t2, e2, n2, r2) {
|
|
3859
|
+
const i2 = "function" != typeof n2 ? n2 : {};
|
|
3860
|
+
this.j = "function" == typeof n2 ? n2 : r2, this.qualityScores = this.categoryMask = this.confidenceMasks = void 0, n2 = this.B + 1, r2 = new jc();
|
|
3861
|
+
const s2 = new Bc();
|
|
3862
|
+
var o2 = new Ic();
|
|
3863
|
+
if (Tn(o2, 1, 255), dn(s2, 0, 12, o2), e2.keypoint && e2.scribble) throw Error("Cannot provide both keypoint and scribble.");
|
|
3864
|
+
if (e2.keypoint) {
|
|
3865
|
+
var a2 = new Uc();
|
|
3866
|
+
wn(a2, 3, true), An(a2, 1, e2.keypoint.x), An(a2, 2, e2.keypoint.y), fn(s2, 5, Gc, a2);
|
|
3867
|
+
} else {
|
|
3868
|
+
if (!e2.scribble) throw Error("Must provide either a keypoint or a scribble.");
|
|
3869
|
+
for (a2 of (o2 = new Nc(), e2.scribble)) wn(e2 = new Uc(), 3, true), An(e2, 1, a2.x), An(e2, 2, a2.y), yn(o2, 1, Uc, e2);
|
|
3870
|
+
fn(s2, 15, Gc, o2);
|
|
3871
|
+
}
|
|
3872
|
+
yn(r2, 1, Bc, s2), this.g.addProtoToStream(r2.g(), "drishti.RenderData", "roi_in", n2), Ya(this, t2, i2);
|
|
3873
|
+
t: {
|
|
3874
|
+
try {
|
|
3875
|
+
const t3 = new Fc(this.confidenceMasks, this.categoryMask, this.qualityScores);
|
|
3876
|
+
if (!this.j) {
|
|
3877
|
+
var c2 = t3;
|
|
3878
|
+
break t;
|
|
3879
|
+
}
|
|
3880
|
+
this.j(t3);
|
|
3881
|
+
} finally {
|
|
3882
|
+
Jo(this);
|
|
3883
|
+
}
|
|
3884
|
+
c2 = void 0;
|
|
3885
|
+
}
|
|
3886
|
+
return c2;
|
|
3887
|
+
}
|
|
3888
|
+
m() {
|
|
3889
|
+
var t2 = new Qi();
|
|
3890
|
+
Ji(t2, "image_in"), Ji(t2, "roi_in"), Ji(t2, "norm_rect_in");
|
|
3891
|
+
const e2 = new Gi();
|
|
3892
|
+
Yn(e2, Eo, this.h);
|
|
3893
|
+
const n2 = new zi();
|
|
3894
|
+
Xi(n2, "mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "ROI:roi_in"), Hi(n2, "NORM_RECT:norm_rect_in"), n2.o(e2), qi(t2, n2), $o(this, t2), this.outputConfidenceMasks && (Zi(t2, "confidence_masks"), Wi(n2, "CONFIDENCE_MASKS:confidence_masks"), qo(this, "confidence_masks"), this.g.ba("confidence_masks", ((t3, e3) => {
|
|
3895
|
+
this.confidenceMasks = t3.map(((t4) => qa(this, t4, true, !this.j))), Yo(this, e3);
|
|
3896
|
+
})), this.g.attachEmptyPacketListener("confidence_masks", ((t3) => {
|
|
3897
|
+
this.confidenceMasks = [], Yo(this, t3);
|
|
3898
|
+
}))), this.outputCategoryMask && (Zi(t2, "category_mask"), Wi(n2, "CATEGORY_MASK:category_mask"), qo(this, "category_mask"), this.g.V("category_mask", ((t3, e3) => {
|
|
3899
|
+
this.categoryMask = qa(this, t3, false, !this.j), Yo(this, e3);
|
|
3900
|
+
})), this.g.attachEmptyPacketListener("category_mask", ((t3) => {
|
|
3901
|
+
this.categoryMask = void 0, Yo(this, t3);
|
|
3902
|
+
}))), Zi(t2, "quality_scores"), Wi(n2, "QUALITY_SCORES:quality_scores"), this.g.attachFloatVectorListener("quality_scores", ((t3, e3) => {
|
|
3903
|
+
this.qualityScores = t3, Yo(this, e3);
|
|
3904
|
+
})), this.g.attachEmptyPacketListener("quality_scores", ((t3) => {
|
|
3905
|
+
this.categoryMask = void 0, Yo(this, t3);
|
|
3906
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3907
|
+
}
|
|
3908
|
+
};
|
|
3909
|
+
Vc.prototype.segment = Vc.prototype.segment, Vc.prototype.setOptions = Vc.prototype.o, Vc.createFromModelPath = function(t2, e2) {
|
|
3910
|
+
return za(Vc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3911
|
+
}, Vc.createFromModelBuffer = function(t2, e2) {
|
|
3912
|
+
return za(Vc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3913
|
+
}, Vc.createFromOptions = function(t2, e2) {
|
|
3914
|
+
return za(Vc, t2, e2);
|
|
3915
|
+
};
|
|
3916
|
+
var Xc = class extends Ja {
|
|
3917
|
+
constructor(t2, e2) {
|
|
3918
|
+
super(new Wa(t2, e2), "input_frame_gpu", "norm_rect", false), this.j = { detections: [] }, dn(t2 = this.h = new wo(), 0, 1, e2 = new Is());
|
|
3919
|
+
}
|
|
3920
|
+
get baseOptions() {
|
|
3921
|
+
return hn(this.h, Is, 1);
|
|
3922
|
+
}
|
|
3923
|
+
set baseOptions(t2) {
|
|
3924
|
+
dn(this.h, 0, 1, t2);
|
|
3925
|
+
}
|
|
3926
|
+
o(t2) {
|
|
3927
|
+
return void 0 !== t2.displayNamesLocale ? He(this.h, 2, de(t2.displayNamesLocale)) : "displayNamesLocale" in t2 && He(this.h, 2), void 0 !== t2.maxResults ? Tn(this.h, 3, t2.maxResults) : "maxResults" in t2 && He(this.h, 3), void 0 !== t2.scoreThreshold ? An(this.h, 4, t2.scoreThreshold) : "scoreThreshold" in t2 && He(this.h, 4), void 0 !== t2.categoryAllowlist ? bn(this.h, 5, t2.categoryAllowlist) : "categoryAllowlist" in t2 && He(this.h, 5), void 0 !== t2.categoryDenylist ? bn(this.h, 6, t2.categoryDenylist) : "categoryDenylist" in t2 && He(this.h, 6), this.l(t2);
|
|
3928
|
+
}
|
|
3929
|
+
D(t2, e2) {
|
|
3930
|
+
return this.j = { detections: [] }, Ya(this, t2, e2), this.j;
|
|
3931
|
+
}
|
|
3932
|
+
F(t2, e2, n2) {
|
|
3933
|
+
return this.j = { detections: [] }, $a(this, t2, n2, e2), this.j;
|
|
3934
|
+
}
|
|
3935
|
+
m() {
|
|
3936
|
+
var t2 = new Qi();
|
|
3937
|
+
Ji(t2, "input_frame_gpu"), Ji(t2, "norm_rect"), Zi(t2, "detections");
|
|
3938
|
+
const e2 = new Gi();
|
|
3939
|
+
Yn(e2, To, this.h);
|
|
3940
|
+
const n2 = new zi();
|
|
3941
|
+
Xi(n2, "mediapipe.tasks.vision.ObjectDetectorGraph"), Hi(n2, "IMAGE:input_frame_gpu"), Hi(n2, "NORM_RECT:norm_rect"), Wi(n2, "DETECTIONS:detections"), n2.o(e2), qi(t2, n2), this.g.attachProtoVectorListener("detections", ((t3, e3) => {
|
|
3942
|
+
for (const e4 of t3) t3 = hs(e4), this.j.detections.push(xo(t3));
|
|
3943
|
+
Yo(this, e3);
|
|
3944
|
+
})), this.g.attachEmptyPacketListener("detections", ((t3) => {
|
|
3945
|
+
Yo(this, t3);
|
|
3946
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3947
|
+
}
|
|
3948
|
+
};
|
|
3949
|
+
Xc.prototype.detectForVideo = Xc.prototype.F, Xc.prototype.detect = Xc.prototype.D, Xc.prototype.setOptions = Xc.prototype.o, Xc.createFromModelPath = async function(t2, e2) {
|
|
3950
|
+
return za(Xc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3951
|
+
}, Xc.createFromModelBuffer = function(t2, e2) {
|
|
3952
|
+
return za(Xc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3953
|
+
}, Xc.createFromOptions = function(t2, e2) {
|
|
3954
|
+
return za(Xc, t2, e2);
|
|
3955
|
+
};
|
|
3956
|
+
var Hc = class {
|
|
3957
|
+
constructor(t2, e2, n2) {
|
|
3958
|
+
this.landmarks = t2, this.worldLandmarks = e2, this.segmentationMasks = n2;
|
|
3959
|
+
}
|
|
3960
|
+
close() {
|
|
3961
|
+
this.segmentationMasks?.forEach(((t2) => {
|
|
3962
|
+
t2.close();
|
|
3963
|
+
}));
|
|
3964
|
+
}
|
|
3965
|
+
};
|
|
3966
|
+
function Wc(t2) {
|
|
3967
|
+
t2.landmarks = [], t2.worldLandmarks = [], t2.segmentationMasks = void 0;
|
|
3968
|
+
}
|
|
3969
|
+
function zc(t2) {
|
|
3970
|
+
try {
|
|
3971
|
+
const e2 = new Hc(t2.landmarks, t2.worldLandmarks, t2.segmentationMasks);
|
|
3972
|
+
if (!t2.s) return e2;
|
|
3973
|
+
t2.s(e2);
|
|
3974
|
+
} finally {
|
|
3975
|
+
Jo(t2);
|
|
3976
|
+
}
|
|
3977
|
+
}
|
|
3978
|
+
Hc.prototype.close = Hc.prototype.close;
|
|
3979
|
+
var Kc = class extends Ja {
|
|
3980
|
+
constructor(t2, e2) {
|
|
3981
|
+
super(new Wa(t2, e2), "image_in", "norm_rect", false), this.landmarks = [], this.worldLandmarks = [], this.outputSegmentationMasks = false, dn(t2 = this.h = new Ao(), 0, 1, e2 = new Is()), this.v = new oo(), dn(this.h, 0, 3, this.v), this.j = new so(), dn(this.h, 0, 2, this.j), Tn(this.j, 4, 1), An(this.j, 2, 0.5), An(this.v, 2, 0.5), An(this.h, 4, 0.5);
|
|
3982
|
+
}
|
|
3983
|
+
get baseOptions() {
|
|
3984
|
+
return hn(this.h, Is, 1);
|
|
3985
|
+
}
|
|
3986
|
+
set baseOptions(t2) {
|
|
3987
|
+
dn(this.h, 0, 1, t2);
|
|
3988
|
+
}
|
|
3989
|
+
o(t2) {
|
|
3990
|
+
return "numPoses" in t2 && Tn(this.j, 4, t2.numPoses ?? 1), "minPoseDetectionConfidence" in t2 && An(this.j, 2, t2.minPoseDetectionConfidence ?? 0.5), "minTrackingConfidence" in t2 && An(this.h, 4, t2.minTrackingConfidence ?? 0.5), "minPosePresenceConfidence" in t2 && An(this.v, 2, t2.minPosePresenceConfidence ?? 0.5), "outputSegmentationMasks" in t2 && (this.outputSegmentationMasks = t2.outputSegmentationMasks ?? false), this.l(t2);
|
|
3991
|
+
}
|
|
3992
|
+
D(t2, e2, n2) {
|
|
3993
|
+
const r2 = "function" != typeof e2 ? e2 : {};
|
|
3994
|
+
return this.s = "function" == typeof e2 ? e2 : n2, Wc(this), Ya(this, t2, r2), zc(this);
|
|
3995
|
+
}
|
|
3996
|
+
F(t2, e2, n2, r2) {
|
|
3997
|
+
const i2 = "function" != typeof n2 ? n2 : {};
|
|
3998
|
+
return this.s = "function" == typeof n2 ? n2 : r2, Wc(this), $a(this, t2, i2, e2), zc(this);
|
|
3999
|
+
}
|
|
4000
|
+
m() {
|
|
4001
|
+
var t2 = new Qi();
|
|
4002
|
+
Ji(t2, "image_in"), Ji(t2, "norm_rect"), Zi(t2, "normalized_landmarks"), Zi(t2, "world_landmarks"), Zi(t2, "segmentation_masks");
|
|
4003
|
+
const e2 = new Gi();
|
|
4004
|
+
Yn(e2, bo, this.h);
|
|
4005
|
+
const n2 = new zi();
|
|
4006
|
+
Xi(n2, "mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"), Hi(n2, "IMAGE:image_in"), Hi(n2, "NORM_RECT:norm_rect"), Wi(n2, "NORM_LANDMARKS:normalized_landmarks"), Wi(n2, "WORLD_LANDMARKS:world_landmarks"), n2.o(e2), qi(t2, n2), $o(this, t2), this.g.attachProtoVectorListener("normalized_landmarks", ((t3, e3) => {
|
|
4007
|
+
this.landmarks = [];
|
|
4008
|
+
for (const e4 of t3) t3 = fs(e4), this.landmarks.push(Lo(t3));
|
|
4009
|
+
Yo(this, e3);
|
|
4010
|
+
})), this.g.attachEmptyPacketListener("normalized_landmarks", ((t3) => {
|
|
4011
|
+
this.landmarks = [], Yo(this, t3);
|
|
4012
|
+
})), this.g.attachProtoVectorListener("world_landmarks", ((t3, e3) => {
|
|
4013
|
+
this.worldLandmarks = [];
|
|
4014
|
+
for (const e4 of t3) t3 = ls(e4), this.worldLandmarks.push(Ro(t3));
|
|
4015
|
+
Yo(this, e3);
|
|
4016
|
+
})), this.g.attachEmptyPacketListener("world_landmarks", ((t3) => {
|
|
4017
|
+
this.worldLandmarks = [], Yo(this, t3);
|
|
4018
|
+
})), this.outputSegmentationMasks && (Wi(n2, "SEGMENTATION_MASK:segmentation_masks"), qo(this, "segmentation_masks"), this.g.ba("segmentation_masks", ((t3, e3) => {
|
|
4019
|
+
this.segmentationMasks = t3.map(((t4) => qa(this, t4, true, !this.s))), Yo(this, e3);
|
|
4020
|
+
})), this.g.attachEmptyPacketListener("segmentation_masks", ((t3) => {
|
|
4021
|
+
this.segmentationMasks = [], Yo(this, t3);
|
|
4022
|
+
}))), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
4023
|
+
}
|
|
4024
|
+
};
|
|
4025
|
+
Kc.prototype.detectForVideo = Kc.prototype.F, Kc.prototype.detect = Kc.prototype.D, Kc.prototype.setOptions = Kc.prototype.o, Kc.createFromModelPath = function(t2, e2) {
|
|
4026
|
+
return za(Kc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
4027
|
+
}, Kc.createFromModelBuffer = function(t2, e2) {
|
|
4028
|
+
return za(Kc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
4029
|
+
}, Kc.createFromOptions = function(t2, e2) {
|
|
4030
|
+
return za(Kc, t2, e2);
|
|
4031
|
+
}, Kc.POSE_CONNECTIONS = vc;
|
|
4032
|
+
|
|
4033
|
+
// ../../node_modules/.pnpm/fflate@0.8.2/node_modules/fflate/esm/browser.js
|
|
4034
|
+
var ch2 = {};
|
|
4035
|
+
var wk = (function(c2, id, msg, transfer, cb) {
|
|
4036
|
+
var w2 = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([
|
|
4037
|
+
c2 + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
|
|
4038
|
+
], { type: "text/javascript" }))));
|
|
4039
|
+
w2.onmessage = function(e2) {
|
|
4040
|
+
var d = e2.data, ed = d.$e$;
|
|
4041
|
+
if (ed) {
|
|
4042
|
+
var err2 = new Error(ed[0]);
|
|
4043
|
+
err2["code"] = ed[1];
|
|
4044
|
+
err2.stack = ed[2];
|
|
4045
|
+
cb(err2, null);
|
|
4046
|
+
} else
|
|
4047
|
+
cb(null, d);
|
|
4048
|
+
};
|
|
4049
|
+
w2.postMessage(msg, transfer);
|
|
4050
|
+
return w2;
|
|
4051
|
+
});
|
|
4052
|
+
var u8 = Uint8Array;
|
|
4053
|
+
var u16 = Uint16Array;
|
|
4054
|
+
var i32 = Int32Array;
|
|
4055
|
+
var fleb = new u8([
|
|
4056
|
+
0,
|
|
4057
|
+
0,
|
|
4058
|
+
0,
|
|
4059
|
+
0,
|
|
4060
|
+
0,
|
|
4061
|
+
0,
|
|
4062
|
+
0,
|
|
4063
|
+
0,
|
|
4064
|
+
1,
|
|
4065
|
+
1,
|
|
4066
|
+
1,
|
|
4067
|
+
1,
|
|
4068
|
+
2,
|
|
4069
|
+
2,
|
|
4070
|
+
2,
|
|
4071
|
+
2,
|
|
4072
|
+
3,
|
|
4073
|
+
3,
|
|
4074
|
+
3,
|
|
4075
|
+
3,
|
|
4076
|
+
4,
|
|
4077
|
+
4,
|
|
4078
|
+
4,
|
|
4079
|
+
4,
|
|
4080
|
+
5,
|
|
4081
|
+
5,
|
|
4082
|
+
5,
|
|
4083
|
+
5,
|
|
4084
|
+
0,
|
|
4085
|
+
/* unused */
|
|
4086
|
+
0,
|
|
4087
|
+
0,
|
|
4088
|
+
/* impossible */
|
|
4089
|
+
0
|
|
4090
|
+
]);
|
|
4091
|
+
var fdeb = new u8([
|
|
4092
|
+
0,
|
|
4093
|
+
0,
|
|
4094
|
+
0,
|
|
4095
|
+
0,
|
|
4096
|
+
1,
|
|
4097
|
+
1,
|
|
4098
|
+
2,
|
|
4099
|
+
2,
|
|
4100
|
+
3,
|
|
4101
|
+
3,
|
|
4102
|
+
4,
|
|
4103
|
+
4,
|
|
4104
|
+
5,
|
|
4105
|
+
5,
|
|
4106
|
+
6,
|
|
4107
|
+
6,
|
|
4108
|
+
7,
|
|
4109
|
+
7,
|
|
4110
|
+
8,
|
|
4111
|
+
8,
|
|
4112
|
+
9,
|
|
4113
|
+
9,
|
|
4114
|
+
10,
|
|
4115
|
+
10,
|
|
4116
|
+
11,
|
|
4117
|
+
11,
|
|
4118
|
+
12,
|
|
4119
|
+
12,
|
|
4120
|
+
13,
|
|
4121
|
+
13,
|
|
4122
|
+
/* unused */
|
|
4123
|
+
0,
|
|
4124
|
+
0
|
|
4125
|
+
]);
|
|
4126
|
+
var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
|
|
4127
|
+
var freb = function(eb, start) {
|
|
4128
|
+
var b2 = new u16(31);
|
|
4129
|
+
for (var i2 = 0; i2 < 31; ++i2) {
|
|
4130
|
+
b2[i2] = start += 1 << eb[i2 - 1];
|
|
4131
|
+
}
|
|
4132
|
+
var r2 = new i32(b2[30]);
|
|
4133
|
+
for (var i2 = 1; i2 < 30; ++i2) {
|
|
4134
|
+
for (var j2 = b2[i2]; j2 < b2[i2 + 1]; ++j2) {
|
|
4135
|
+
r2[j2] = j2 - b2[i2] << 5 | i2;
|
|
4136
|
+
}
|
|
4137
|
+
}
|
|
4138
|
+
return { b: b2, r: r2 };
|
|
4139
|
+
};
|
|
4140
|
+
var _a2 = freb(fleb, 2);
|
|
4141
|
+
var fl = _a2.b;
|
|
4142
|
+
var revfl = _a2.r;
|
|
4143
|
+
fl[28] = 258, revfl[258] = 28;
|
|
4144
|
+
var _b = freb(fdeb, 0);
|
|
4145
|
+
var fd = _b.b;
|
|
4146
|
+
var revfd = _b.r;
|
|
4147
|
+
var rev = new u16(32768);
|
|
4148
|
+
for (i2 = 0; i2 < 32768; ++i2) {
|
|
4149
|
+
x2 = (i2 & 43690) >> 1 | (i2 & 21845) << 1;
|
|
4150
|
+
x2 = (x2 & 52428) >> 2 | (x2 & 13107) << 2;
|
|
4151
|
+
x2 = (x2 & 61680) >> 4 | (x2 & 3855) << 4;
|
|
4152
|
+
rev[i2] = ((x2 & 65280) >> 8 | (x2 & 255) << 8) >> 1;
|
|
4153
|
+
}
|
|
4154
|
+
var x2;
|
|
4155
|
+
var i2;
|
|
4156
|
+
var hMap = (function(cd, mb, r2) {
|
|
4157
|
+
var s2 = cd.length;
|
|
4158
|
+
var i2 = 0;
|
|
4159
|
+
var l = new u16(mb);
|
|
4160
|
+
for (; i2 < s2; ++i2) {
|
|
4161
|
+
if (cd[i2])
|
|
4162
|
+
++l[cd[i2] - 1];
|
|
4163
|
+
}
|
|
4164
|
+
var le2 = new u16(mb);
|
|
4165
|
+
for (i2 = 1; i2 < mb; ++i2) {
|
|
4166
|
+
le2[i2] = le2[i2 - 1] + l[i2 - 1] << 1;
|
|
4167
|
+
}
|
|
4168
|
+
var co2;
|
|
4169
|
+
if (r2) {
|
|
4170
|
+
co2 = new u16(1 << mb);
|
|
4171
|
+
var rvb = 15 - mb;
|
|
4172
|
+
for (i2 = 0; i2 < s2; ++i2) {
|
|
4173
|
+
if (cd[i2]) {
|
|
4174
|
+
var sv = i2 << 4 | cd[i2];
|
|
4175
|
+
var r_1 = mb - cd[i2];
|
|
4176
|
+
var v2 = le2[cd[i2] - 1]++ << r_1;
|
|
4177
|
+
for (var m2 = v2 | (1 << r_1) - 1; v2 <= m2; ++v2) {
|
|
4178
|
+
co2[rev[v2] >> rvb] = sv;
|
|
4179
|
+
}
|
|
4180
|
+
}
|
|
4181
|
+
}
|
|
4182
|
+
} else {
|
|
4183
|
+
co2 = new u16(s2);
|
|
4184
|
+
for (i2 = 0; i2 < s2; ++i2) {
|
|
4185
|
+
if (cd[i2]) {
|
|
4186
|
+
co2[i2] = rev[le2[cd[i2] - 1]++] >> 15 - cd[i2];
|
|
4187
|
+
}
|
|
4188
|
+
}
|
|
4189
|
+
}
|
|
4190
|
+
return co2;
|
|
4191
|
+
});
|
|
4192
|
+
var flt = new u8(288);
|
|
4193
|
+
for (i2 = 0; i2 < 144; ++i2)
|
|
4194
|
+
flt[i2] = 8;
|
|
4195
|
+
var i2;
|
|
4196
|
+
for (i2 = 144; i2 < 256; ++i2)
|
|
4197
|
+
flt[i2] = 9;
|
|
4198
|
+
var i2;
|
|
4199
|
+
for (i2 = 256; i2 < 280; ++i2)
|
|
4200
|
+
flt[i2] = 7;
|
|
4201
|
+
var i2;
|
|
4202
|
+
for (i2 = 280; i2 < 288; ++i2)
|
|
4203
|
+
flt[i2] = 8;
|
|
4204
|
+
var i2;
|
|
4205
|
+
var fdt = new u8(32);
|
|
4206
|
+
for (i2 = 0; i2 < 32; ++i2)
|
|
4207
|
+
fdt[i2] = 5;
|
|
4208
|
+
var i2;
|
|
4209
|
+
var flrm = /* @__PURE__ */ hMap(flt, 9, 1);
|
|
4210
|
+
var fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
|
|
4211
|
+
var max = function(a2) {
|
|
4212
|
+
var m2 = a2[0];
|
|
4213
|
+
for (var i2 = 1; i2 < a2.length; ++i2) {
|
|
4214
|
+
if (a2[i2] > m2)
|
|
4215
|
+
m2 = a2[i2];
|
|
4216
|
+
}
|
|
4217
|
+
return m2;
|
|
4218
|
+
};
|
|
4219
|
+
var bits = function(d, p2, m2) {
|
|
4220
|
+
var o2 = p2 / 8 | 0;
|
|
4221
|
+
return (d[o2] | d[o2 + 1] << 8) >> (p2 & 7) & m2;
|
|
4222
|
+
};
|
|
4223
|
+
var bits16 = function(d, p2) {
|
|
4224
|
+
var o2 = p2 / 8 | 0;
|
|
4225
|
+
return (d[o2] | d[o2 + 1] << 8 | d[o2 + 2] << 16) >> (p2 & 7);
|
|
4226
|
+
};
|
|
4227
|
+
var shft = function(p2) {
|
|
4228
|
+
return (p2 + 7) / 8 | 0;
|
|
4229
|
+
};
|
|
4230
|
+
var slc = function(v2, s2, e2) {
|
|
4231
|
+
if (s2 == null || s2 < 0)
|
|
4232
|
+
s2 = 0;
|
|
4233
|
+
if (e2 == null || e2 > v2.length)
|
|
4234
|
+
e2 = v2.length;
|
|
4235
|
+
return new u8(v2.subarray(s2, e2));
|
|
4236
|
+
};
|
|
4237
|
+
var ec2 = [
|
|
4238
|
+
"unexpected EOF",
|
|
4239
|
+
"invalid block type",
|
|
4240
|
+
"invalid length/literal",
|
|
4241
|
+
"invalid distance",
|
|
4242
|
+
"stream finished",
|
|
4243
|
+
"no stream handler",
|
|
4244
|
+
,
|
|
4245
|
+
"no callback",
|
|
4246
|
+
"invalid UTF-8 data",
|
|
4247
|
+
"extra field too long",
|
|
4248
|
+
"date not in range 1980-2099",
|
|
4249
|
+
"filename too long",
|
|
4250
|
+
"stream finishing",
|
|
4251
|
+
"invalid zip data"
|
|
4252
|
+
// determined by unknown compression method
|
|
4253
|
+
];
|
|
4254
|
+
var err = function(ind, msg, nt2) {
|
|
4255
|
+
var e2 = new Error(msg || ec2[ind]);
|
|
4256
|
+
e2.code = ind;
|
|
4257
|
+
if (Error.captureStackTrace)
|
|
4258
|
+
Error.captureStackTrace(e2, err);
|
|
4259
|
+
if (!nt2)
|
|
4260
|
+
throw e2;
|
|
4261
|
+
return e2;
|
|
4262
|
+
};
|
|
4263
|
+
var inflt = function(dat, st2, buf, dict) {
|
|
4264
|
+
var sl = dat.length, dl = dict ? dict.length : 0;
|
|
4265
|
+
if (!sl || st2.f && !st2.l)
|
|
4266
|
+
return buf || new u8(0);
|
|
4267
|
+
var noBuf = !buf;
|
|
4268
|
+
var resize = noBuf || st2.i != 2;
|
|
4269
|
+
var noSt = st2.i;
|
|
4270
|
+
if (noBuf)
|
|
4271
|
+
buf = new u8(sl * 3);
|
|
4272
|
+
var cbuf = function(l2) {
|
|
4273
|
+
var bl = buf.length;
|
|
4274
|
+
if (l2 > bl) {
|
|
4275
|
+
var nbuf = new u8(Math.max(bl * 2, l2));
|
|
4276
|
+
nbuf.set(buf);
|
|
4277
|
+
buf = nbuf;
|
|
4278
|
+
}
|
|
4279
|
+
};
|
|
4280
|
+
var final = st2.f || 0, pos = st2.p || 0, bt2 = st2.b || 0, lm = st2.l, dm = st2.d, lbt = st2.m, dbt = st2.n;
|
|
4281
|
+
var tbts = sl * 8;
|
|
4282
|
+
do {
|
|
4283
|
+
if (!lm) {
|
|
4284
|
+
final = bits(dat, pos, 1);
|
|
4285
|
+
var type = bits(dat, pos + 1, 3);
|
|
4286
|
+
pos += 3;
|
|
4287
|
+
if (!type) {
|
|
4288
|
+
var s2 = shft(pos) + 4, l = dat[s2 - 4] | dat[s2 - 3] << 8, t2 = s2 + l;
|
|
4289
|
+
if (t2 > sl) {
|
|
4290
|
+
if (noSt)
|
|
4291
|
+
err(0);
|
|
4292
|
+
break;
|
|
4293
|
+
}
|
|
4294
|
+
if (resize)
|
|
4295
|
+
cbuf(bt2 + l);
|
|
4296
|
+
buf.set(dat.subarray(s2, t2), bt2);
|
|
4297
|
+
st2.b = bt2 += l, st2.p = pos = t2 * 8, st2.f = final;
|
|
4298
|
+
continue;
|
|
4299
|
+
} else if (type == 1)
|
|
4300
|
+
lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
|
|
4301
|
+
else if (type == 2) {
|
|
4302
|
+
var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
|
|
4303
|
+
var tl = hLit + bits(dat, pos + 5, 31) + 1;
|
|
4304
|
+
pos += 14;
|
|
4305
|
+
var ldt = new u8(tl);
|
|
4306
|
+
var clt = new u8(19);
|
|
4307
|
+
for (var i2 = 0; i2 < hcLen; ++i2) {
|
|
4308
|
+
clt[clim[i2]] = bits(dat, pos + i2 * 3, 7);
|
|
4309
|
+
}
|
|
4310
|
+
pos += hcLen * 3;
|
|
4311
|
+
var clb = max(clt), clbmsk = (1 << clb) - 1;
|
|
4312
|
+
var clm = hMap(clt, clb, 1);
|
|
4313
|
+
for (var i2 = 0; i2 < tl; ) {
|
|
4314
|
+
var r2 = clm[bits(dat, pos, clbmsk)];
|
|
4315
|
+
pos += r2 & 15;
|
|
4316
|
+
var s2 = r2 >> 4;
|
|
4317
|
+
if (s2 < 16) {
|
|
4318
|
+
ldt[i2++] = s2;
|
|
4319
|
+
} else {
|
|
4320
|
+
var c2 = 0, n2 = 0;
|
|
4321
|
+
if (s2 == 16)
|
|
4322
|
+
n2 = 3 + bits(dat, pos, 3), pos += 2, c2 = ldt[i2 - 1];
|
|
4323
|
+
else if (s2 == 17)
|
|
4324
|
+
n2 = 3 + bits(dat, pos, 7), pos += 3;
|
|
4325
|
+
else if (s2 == 18)
|
|
4326
|
+
n2 = 11 + bits(dat, pos, 127), pos += 7;
|
|
4327
|
+
while (n2--)
|
|
4328
|
+
ldt[i2++] = c2;
|
|
4329
|
+
}
|
|
4330
|
+
}
|
|
4331
|
+
var lt2 = ldt.subarray(0, hLit), dt2 = ldt.subarray(hLit);
|
|
4332
|
+
lbt = max(lt2);
|
|
4333
|
+
dbt = max(dt2);
|
|
4334
|
+
lm = hMap(lt2, lbt, 1);
|
|
4335
|
+
dm = hMap(dt2, dbt, 1);
|
|
4336
|
+
} else
|
|
4337
|
+
err(1);
|
|
4338
|
+
if (pos > tbts) {
|
|
4339
|
+
if (noSt)
|
|
4340
|
+
err(0);
|
|
4341
|
+
break;
|
|
4342
|
+
}
|
|
4343
|
+
}
|
|
4344
|
+
if (resize)
|
|
4345
|
+
cbuf(bt2 + 131072);
|
|
4346
|
+
var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
|
|
4347
|
+
var lpos = pos;
|
|
4348
|
+
for (; ; lpos = pos) {
|
|
4349
|
+
var c2 = lm[bits16(dat, pos) & lms], sym = c2 >> 4;
|
|
4350
|
+
pos += c2 & 15;
|
|
4351
|
+
if (pos > tbts) {
|
|
4352
|
+
if (noSt)
|
|
4353
|
+
err(0);
|
|
4354
|
+
break;
|
|
4355
|
+
}
|
|
4356
|
+
if (!c2)
|
|
4357
|
+
err(2);
|
|
4358
|
+
if (sym < 256)
|
|
4359
|
+
buf[bt2++] = sym;
|
|
4360
|
+
else if (sym == 256) {
|
|
4361
|
+
lpos = pos, lm = null;
|
|
4362
|
+
break;
|
|
4363
|
+
} else {
|
|
4364
|
+
var add = sym - 254;
|
|
4365
|
+
if (sym > 264) {
|
|
4366
|
+
var i2 = sym - 257, b2 = fleb[i2];
|
|
4367
|
+
add = bits(dat, pos, (1 << b2) - 1) + fl[i2];
|
|
4368
|
+
pos += b2;
|
|
4369
|
+
}
|
|
4370
|
+
var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
|
|
4371
|
+
if (!d)
|
|
4372
|
+
err(3);
|
|
4373
|
+
pos += d & 15;
|
|
4374
|
+
var dt2 = fd[dsym];
|
|
4375
|
+
if (dsym > 3) {
|
|
4376
|
+
var b2 = fdeb[dsym];
|
|
4377
|
+
dt2 += bits16(dat, pos) & (1 << b2) - 1, pos += b2;
|
|
4378
|
+
}
|
|
4379
|
+
if (pos > tbts) {
|
|
4380
|
+
if (noSt)
|
|
4381
|
+
err(0);
|
|
4382
|
+
break;
|
|
4383
|
+
}
|
|
4384
|
+
if (resize)
|
|
4385
|
+
cbuf(bt2 + 131072);
|
|
4386
|
+
var end = bt2 + add;
|
|
4387
|
+
if (bt2 < dt2) {
|
|
4388
|
+
var shift = dl - dt2, dend = Math.min(dt2, end);
|
|
4389
|
+
if (shift + bt2 < 0)
|
|
4390
|
+
err(3);
|
|
4391
|
+
for (; bt2 < dend; ++bt2)
|
|
4392
|
+
buf[bt2] = dict[shift + bt2];
|
|
4393
|
+
}
|
|
4394
|
+
for (; bt2 < end; ++bt2)
|
|
4395
|
+
buf[bt2] = buf[bt2 - dt2];
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
st2.l = lm, st2.p = lpos, st2.b = bt2, st2.f = final;
|
|
4399
|
+
if (lm)
|
|
4400
|
+
final = 1, st2.m = lbt, st2.d = dm, st2.n = dbt;
|
|
4401
|
+
} while (!final);
|
|
4402
|
+
return bt2 != buf.length && noBuf ? slc(buf, 0, bt2) : buf.subarray(0, bt2);
|
|
4403
|
+
};
|
|
4404
|
+
var et2 = /* @__PURE__ */ new u8(0);
|
|
4405
|
+
var mrg = function(a2, b2) {
|
|
4406
|
+
var o2 = {};
|
|
4407
|
+
for (var k2 in a2)
|
|
4408
|
+
o2[k2] = a2[k2];
|
|
4409
|
+
for (var k2 in b2)
|
|
4410
|
+
o2[k2] = b2[k2];
|
|
4411
|
+
return o2;
|
|
4412
|
+
};
|
|
4413
|
+
var wcln = function(fn2, fnStr, td2) {
|
|
4414
|
+
var dt2 = fn2();
|
|
4415
|
+
var st2 = fn2.toString();
|
|
4416
|
+
var ks2 = st2.slice(st2.indexOf("[") + 1, st2.lastIndexOf("]")).replace(/\s+/g, "").split(",");
|
|
4417
|
+
for (var i2 = 0; i2 < dt2.length; ++i2) {
|
|
4418
|
+
var v2 = dt2[i2], k2 = ks2[i2];
|
|
4419
|
+
if (typeof v2 == "function") {
|
|
4420
|
+
fnStr += ";" + k2 + "=";
|
|
4421
|
+
var st_1 = v2.toString();
|
|
4422
|
+
if (v2.prototype) {
|
|
4423
|
+
if (st_1.indexOf("[native code]") != -1) {
|
|
4424
|
+
var spInd = st_1.indexOf(" ", 8) + 1;
|
|
4425
|
+
fnStr += st_1.slice(spInd, st_1.indexOf("(", spInd));
|
|
4426
|
+
} else {
|
|
4427
|
+
fnStr += st_1;
|
|
4428
|
+
for (var t2 in v2.prototype)
|
|
4429
|
+
fnStr += ";" + k2 + ".prototype." + t2 + "=" + v2.prototype[t2].toString();
|
|
4430
|
+
}
|
|
4431
|
+
} else
|
|
4432
|
+
fnStr += st_1;
|
|
4433
|
+
} else
|
|
4434
|
+
td2[k2] = v2;
|
|
4435
|
+
}
|
|
4436
|
+
return fnStr;
|
|
4437
|
+
};
|
|
4438
|
+
var ch = [];
|
|
4439
|
+
var cbfs = function(v2) {
|
|
4440
|
+
var tl = [];
|
|
4441
|
+
for (var k2 in v2) {
|
|
4442
|
+
if (v2[k2].buffer) {
|
|
4443
|
+
tl.push((v2[k2] = new v2[k2].constructor(v2[k2])).buffer);
|
|
4444
|
+
}
|
|
4445
|
+
}
|
|
4446
|
+
return tl;
|
|
4447
|
+
};
|
|
4448
|
+
var wrkr = function(fns, init, id, cb) {
|
|
4449
|
+
if (!ch[id]) {
|
|
4450
|
+
var fnStr = "", td_1 = {}, m2 = fns.length - 1;
|
|
4451
|
+
for (var i2 = 0; i2 < m2; ++i2)
|
|
4452
|
+
fnStr = wcln(fns[i2], fnStr, td_1);
|
|
4453
|
+
ch[id] = { c: wcln(fns[m2], fnStr, td_1), e: td_1 };
|
|
4454
|
+
}
|
|
4455
|
+
var td2 = mrg({}, ch[id].e);
|
|
4456
|
+
return wk(ch[id].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + init.toString() + "}", id, td2, cbfs(td2), cb);
|
|
4457
|
+
};
|
|
4458
|
+
var bInflt = function() {
|
|
4459
|
+
return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec2, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt];
|
|
4460
|
+
};
|
|
4461
|
+
var guze = function() {
|
|
4462
|
+
return [gzs, gzl];
|
|
4463
|
+
};
|
|
4464
|
+
var pbf = function(msg) {
|
|
4465
|
+
return postMessage(msg, [msg.buffer]);
|
|
4466
|
+
};
|
|
4467
|
+
var gopt = function(o2) {
|
|
4468
|
+
return o2 && {
|
|
4469
|
+
out: o2.size && new u8(o2.size),
|
|
4470
|
+
dictionary: o2.dictionary
|
|
4471
|
+
};
|
|
4472
|
+
};
|
|
4473
|
+
var cbify = function(dat, opts, fns, init, id, cb) {
|
|
4474
|
+
var w2 = wrkr(fns, init, id, function(err2, dat2) {
|
|
4475
|
+
w2.terminate();
|
|
4476
|
+
cb(err2, dat2);
|
|
4477
|
+
});
|
|
4478
|
+
w2.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);
|
|
4479
|
+
return function() {
|
|
4480
|
+
w2.terminate();
|
|
4481
|
+
};
|
|
4482
|
+
};
|
|
4483
|
+
var gzs = function(d) {
|
|
4484
|
+
if (d[0] != 31 || d[1] != 139 || d[2] != 8)
|
|
4485
|
+
err(6, "invalid gzip data");
|
|
4486
|
+
var flg = d[3];
|
|
4487
|
+
var st2 = 10;
|
|
4488
|
+
if (flg & 4)
|
|
4489
|
+
st2 += (d[10] | d[11] << 8) + 2;
|
|
4490
|
+
for (var zs2 = (flg >> 3 & 1) + (flg >> 4 & 1); zs2 > 0; zs2 -= !d[st2++])
|
|
4491
|
+
;
|
|
4492
|
+
return st2 + (flg & 2);
|
|
4493
|
+
};
|
|
4494
|
+
var gzl = function(d) {
|
|
4495
|
+
var l = d.length;
|
|
4496
|
+
return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;
|
|
4497
|
+
};
|
|
4498
|
+
function inflateSync(data, opts) {
|
|
4499
|
+
return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
|
|
4500
|
+
}
|
|
4501
|
+
function gunzip(data, opts, cb) {
|
|
4502
|
+
if (!cb)
|
|
4503
|
+
cb = opts, opts = {};
|
|
4504
|
+
if (typeof cb != "function")
|
|
4505
|
+
err(7);
|
|
4506
|
+
return cbify(data, opts, [
|
|
4507
|
+
bInflt,
|
|
4508
|
+
guze,
|
|
4509
|
+
function() {
|
|
4510
|
+
return [gunzipSync];
|
|
4511
|
+
}
|
|
4512
|
+
], function(ev) {
|
|
4513
|
+
return pbf(gunzipSync(ev.data[0], ev.data[1]));
|
|
4514
|
+
}, 3, cb);
|
|
4515
|
+
}
|
|
4516
|
+
function gunzipSync(data, opts) {
|
|
4517
|
+
var st2 = gzs(data);
|
|
4518
|
+
if (st2 + 8 > data.length)
|
|
4519
|
+
err(6, "invalid gzip data");
|
|
4520
|
+
return inflt(data.subarray(st2, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);
|
|
4521
|
+
}
|
|
4522
|
+
var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder();
|
|
4523
|
+
var tds = 0;
|
|
4524
|
+
try {
|
|
4525
|
+
td.decode(et2, { stream: true });
|
|
4526
|
+
tds = 1;
|
|
4527
|
+
} catch (e2) {
|
|
4528
|
+
}
|
|
4529
|
+
|
|
4530
|
+
// ../sdk-core/src/manager/vision.ts
|
|
4531
|
+
var VisionTaskType = /* @__PURE__ */ ((VisionTaskType2) => {
|
|
4532
|
+
VisionTaskType2["FaceDetector"] = "FaceDetector";
|
|
4533
|
+
VisionTaskType2["ImageSegmenter"] = "ImageSegmenter";
|
|
4534
|
+
return VisionTaskType2;
|
|
4535
|
+
})(VisionTaskType || {});
|
|
4536
|
+
var TaskDefinitions = {
|
|
4537
|
+
["FaceDetector" /* FaceDetector */]: [
|
|
4538
|
+
Za,
|
|
4539
|
+
(instance) => instance.detectForVideo.bind(instance),
|
|
4540
|
+
"blaze_face_short_range.tflite"
|
|
4541
|
+
],
|
|
4542
|
+
["ImageSegmenter" /* ImageSegmenter */]: [
|
|
4543
|
+
Rc,
|
|
4544
|
+
(instance) => instance.segmentForVideo.bind(instance),
|
|
4545
|
+
"selfie_segmenter_landscape.tflite"
|
|
4546
|
+
]
|
|
4547
|
+
};
|
|
4548
|
+
var _VisionTaskRegistry = class _VisionTaskRegistry {
|
|
4549
|
+
constructor(path) {
|
|
4550
|
+
this.path = path;
|
|
4551
|
+
__publicField(this, "hashTasks");
|
|
4552
|
+
__publicField(this, "hashResults");
|
|
4553
|
+
__publicField(this, "taskModels");
|
|
4554
|
+
__publicField(this, "vision");
|
|
4555
|
+
this.hashTasks = /* @__PURE__ */ new Map();
|
|
4556
|
+
this.hashResults = /* @__PURE__ */ new Map();
|
|
4557
|
+
this.taskModels = /* @__PURE__ */ new Map();
|
|
4558
|
+
}
|
|
4559
|
+
get basePath() {
|
|
4560
|
+
return this.path;
|
|
4561
|
+
}
|
|
4562
|
+
get models() {
|
|
4563
|
+
return this.taskModels;
|
|
4564
|
+
}
|
|
4565
|
+
get visionWasm() {
|
|
4566
|
+
return this.vision;
|
|
4567
|
+
}
|
|
4568
|
+
setVideo(hashKey, video) {
|
|
4569
|
+
this.hashTasks.get(hashKey)[2] = video;
|
|
4570
|
+
}
|
|
4571
|
+
static async getInstance(path) {
|
|
4572
|
+
if (path) {
|
|
4573
|
+
if (_VisionTaskRegistry.instance?.path === path && _VisionTaskRegistry.instance.vision) {
|
|
4574
|
+
return _VisionTaskRegistry.instance;
|
|
4575
|
+
}
|
|
4576
|
+
if (_VisionTaskRegistry.instance?.path === path && _VisionTaskRegistry.initPromise) {
|
|
4577
|
+
return _VisionTaskRegistry.initPromise;
|
|
4578
|
+
}
|
|
4579
|
+
_VisionTaskRegistry.instance = new _VisionTaskRegistry(path);
|
|
4580
|
+
_VisionTaskRegistry.initPromise = _VisionTaskRegistry.instance.initVision().then(() => _VisionTaskRegistry.instance).catch((error) => {
|
|
4581
|
+
_VisionTaskRegistry.initPromise = null;
|
|
4582
|
+
_VisionTaskRegistry.instance = void 0;
|
|
4583
|
+
throw error;
|
|
4584
|
+
});
|
|
4585
|
+
return _VisionTaskRegistry.initPromise;
|
|
4586
|
+
}
|
|
4587
|
+
if (_VisionTaskRegistry.initPromise) return _VisionTaskRegistry.initPromise;
|
|
4588
|
+
return _VisionTaskRegistry.instance;
|
|
4589
|
+
}
|
|
4590
|
+
async preloadModels(taskTypes) {
|
|
4591
|
+
return await Promise.all(taskTypes.map(async (taskType) => {
|
|
4592
|
+
const url = this.getFinalUrl(`/mediapipe/${TaskDefinitions[taskType][2]}`);
|
|
4593
|
+
const blobUrl = await this.getBlobUrl(url, false);
|
|
4594
|
+
this.taskModels.set(taskType, blobUrl);
|
|
4595
|
+
})).catch((e2) => {
|
|
4596
|
+
throw new Error(`models: ${taskTypes}. preloadModels error: ${e2}`);
|
|
4597
|
+
});
|
|
4598
|
+
}
|
|
4599
|
+
async generateHash(taskType, options) {
|
|
4600
|
+
try {
|
|
4601
|
+
const normalizedOptions = this.normalizeOptions(options);
|
|
4602
|
+
const configString = JSON.stringify({ taskType, options: normalizedOptions });
|
|
4603
|
+
return await crypto.subtle.digest("SHA-256", new TextEncoder().encode(configString)).then((hashBuffer) => this.bufferToHex(hashBuffer));
|
|
4604
|
+
} catch (e2) {
|
|
4605
|
+
throw new Error(`GenerateHash error: ${e2}`);
|
|
4606
|
+
}
|
|
4607
|
+
}
|
|
4608
|
+
normalizeOptions(options) {
|
|
4609
|
+
const normalized = {};
|
|
4610
|
+
for (const key of Object.keys(options).sort()) {
|
|
4611
|
+
const value = options[key];
|
|
4612
|
+
if (value instanceof HTMLCanvasElement) {
|
|
4613
|
+
normalized[key] = {
|
|
4614
|
+
id: value.id
|
|
4615
|
+
};
|
|
4616
|
+
} else if (typeof value === "object" && value !== null) {
|
|
4617
|
+
normalized[key] = this.normalizeOptions(value);
|
|
4618
|
+
} else {
|
|
4619
|
+
normalized[key] = value;
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
return normalized;
|
|
4623
|
+
}
|
|
4624
|
+
bufferToHex(buffer) {
|
|
4625
|
+
return Array.from(new Uint8Array(buffer)).map((b2) => b2.toString(16).padStart(2, "0")).join("");
|
|
4626
|
+
}
|
|
4627
|
+
async register(taskType, inputOptions) {
|
|
4628
|
+
try {
|
|
4629
|
+
const options = {
|
|
4630
|
+
baseOptions: {
|
|
4631
|
+
modelAssetPath: this.getModelUrl(taskType),
|
|
4632
|
+
delegate: "GPU"
|
|
4633
|
+
},
|
|
4634
|
+
runningMode: "VIDEO"
|
|
4635
|
+
};
|
|
4636
|
+
if (inputOptions?.path && options.baseOptions) options.baseOptions.modelAssetPath = inputOptions.path;
|
|
4637
|
+
if (inputOptions?.canvas) options.canvas = inputOptions.canvas;
|
|
4638
|
+
const hashKey = await this.generateHash(taskType, options);
|
|
4639
|
+
if (!this.hashTasks.has(hashKey)) {
|
|
4640
|
+
const [InstanceClass, getReasoning] = TaskDefinitions[taskType];
|
|
4641
|
+
const instance = await InstanceClass.createFromOptions(this.vision, options);
|
|
4642
|
+
const reasoning = getReasoning(instance);
|
|
4643
|
+
this.hashTasks.set(hashKey, [instance, reasoning]);
|
|
4644
|
+
}
|
|
4645
|
+
return hashKey;
|
|
4646
|
+
} catch (e2) {
|
|
4647
|
+
throw new Error(`Register error: ${e2}`);
|
|
4648
|
+
}
|
|
4649
|
+
}
|
|
4650
|
+
getResult(hashKey) {
|
|
4651
|
+
try {
|
|
4652
|
+
if (!this.hashResults.has(hashKey)) {
|
|
4653
|
+
if (!this.hashTasks.get(hashKey)) throw new Error("Unregistered hash");
|
|
4654
|
+
this.hashResults.set(hashKey, this.reasoning(hashKey));
|
|
4655
|
+
}
|
|
4656
|
+
return this.hashResults.get(hashKey);
|
|
4657
|
+
} catch (e2) {
|
|
4658
|
+
throw new Error(`GetResult error: ${e2}`);
|
|
4659
|
+
}
|
|
4660
|
+
}
|
|
4661
|
+
reasoning(hashKey) {
|
|
4662
|
+
const reasoning = this.hashTasks.get(hashKey)[1];
|
|
4663
|
+
return reasoning(this.hashTasks.get(hashKey)[2], performance.now());
|
|
4664
|
+
}
|
|
4665
|
+
getModelUrl(taskType) {
|
|
4666
|
+
return this.taskModels.get(taskType);
|
|
4667
|
+
}
|
|
4668
|
+
getFinalUrl(file) {
|
|
4669
|
+
return `${this.path}/${file}`.replace(/([^:]\/)\/+/g, "$1");
|
|
4670
|
+
}
|
|
4671
|
+
async initVision() {
|
|
4672
|
+
try {
|
|
4673
|
+
const name = await Uo.isSimdSupported() ? "vision_wasm_internal" : "vision_wasm_nosimd_internal";
|
|
4674
|
+
const baseUrl = this.getFinalUrl(`/mediapipe/${name}`);
|
|
4675
|
+
const [gzUrl, jsUrl] = [`${baseUrl}.wasm.gz`, `${baseUrl}.js.gz`];
|
|
4676
|
+
const [gzBlobUrl, jsBlobUrl] = await Promise.all([this.getBlobUrl(gzUrl), this.getBlobUrl(jsUrl)]);
|
|
4677
|
+
this.vision = await Uo.forVisionTasks("");
|
|
4678
|
+
this.vision.wasmBinaryPath = gzBlobUrl;
|
|
4679
|
+
this.vision.wasmLoaderPath = jsBlobUrl;
|
|
4680
|
+
} catch (error) {
|
|
4681
|
+
throw new Error(`initVision error: ${error}`);
|
|
4682
|
+
}
|
|
4683
|
+
}
|
|
4684
|
+
async getBlobUrl(url, isGz = true) {
|
|
4685
|
+
const response = await fetch(url);
|
|
4686
|
+
if (!response.ok) throw new Error(`Failed to fetch ${url}: ${response.status} ${response.statusText};`);
|
|
4687
|
+
let decompressed;
|
|
4688
|
+
if (isGz) {
|
|
4689
|
+
const gzBuffer = await response.arrayBuffer();
|
|
4690
|
+
decompressed = await new Promise((resolve, reject) => {
|
|
4691
|
+
gunzip(new Uint8Array(gzBuffer), (err2, decompressed2) => {
|
|
4692
|
+
if (err2) reject(err2);
|
|
4693
|
+
resolve(new Blob([decompressed2], { type: this.isWasmFile(decompressed2) ? "application/wasm" : "application/javascript" }));
|
|
4694
|
+
});
|
|
4695
|
+
});
|
|
4696
|
+
} else {
|
|
4697
|
+
const modelBlob = await response.blob();
|
|
4698
|
+
if (!await this.isTfliteFile(modelBlob)) throw new Error("The file is not a valid TFLite model file, please check the assetsPath");
|
|
4699
|
+
decompressed = modelBlob;
|
|
4700
|
+
}
|
|
4701
|
+
if (!(decompressed instanceof Blob)) throw new Error("Decompressed data is not a valid Blob");
|
|
4702
|
+
return URL.createObjectURL(decompressed);
|
|
4703
|
+
}
|
|
4704
|
+
isWasmFile(buffer) {
|
|
4705
|
+
return buffer.length >= 4 && buffer[0] === 0 && buffer[1] === 97 && buffer[2] === 115 && buffer[3] === 109;
|
|
4706
|
+
}
|
|
4707
|
+
async isTfliteFile(blob) {
|
|
4708
|
+
if (blob.size < 8) return false;
|
|
4709
|
+
const header = new Uint8Array(await blob.slice(4, 8).arrayBuffer());
|
|
4710
|
+
return header[0] === 84 && header[1] === 70 && header[2] === 76 && header[3] === 51;
|
|
4711
|
+
}
|
|
4712
|
+
resetHashResults() {
|
|
4713
|
+
this.hashResults = /* @__PURE__ */ new Map();
|
|
4714
|
+
}
|
|
4715
|
+
};
|
|
4716
|
+
__publicField(_VisionTaskRegistry, "instance");
|
|
4717
|
+
/** Cached init promise — any caller awaiting getInstance() shares the same flight */
|
|
4718
|
+
__publicField(_VisionTaskRegistry, "initPromise", null);
|
|
4719
|
+
var VisionTaskRegistry = _VisionTaskRegistry;
|
|
4720
|
+
window.VisionTaskType = VisionTaskType;
|
|
4721
|
+
window.VisionTaskRegistry = VisionTaskRegistry;
|
|
4722
|
+
return __toCommonJS(vision_exports);
|
|
4723
|
+
})();
|