@credenza3/scanner-lib 0.0.1 → 0.0.2
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/.turbo/turbo-build.log +30 -13
- package/dist/scanner.es.js +2922 -1593
- package/dist/scanner.umd.js +4 -3
- package/package.json +20 -20
package/dist/scanner.es.js
CHANGED
|
@@ -1,1461 +1,2823 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
|
|
2
|
+
let Le = !1, Kr = !1;
|
|
3
|
+
function Jr() {
|
|
4
|
+
Le = !0;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Jr();
|
|
7
|
+
const Xr = 2, Zr = 4, en = 8, tn = 1, rn = 2, N = Symbol(), nn = "http://www.w3.org/1999/xhtml", tr = !1;
|
|
8
|
+
var on = Array.isArray, sn = Array.prototype.indexOf, an = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, rr = Object.getOwnPropertyDescriptors, ln = Object.prototype, un = Array.prototype, _t = Object.getPrototypeOf;
|
|
9
|
+
function fn(n) {
|
|
10
|
+
return n();
|
|
8
11
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
12
|
+
function ot(n) {
|
|
13
|
+
for (var t = 0; t < n.length; t++)
|
|
14
|
+
n[t]();
|
|
11
15
|
}
|
|
12
|
-
function
|
|
13
|
-
s
|
|
16
|
+
function nr() {
|
|
17
|
+
var n, t, i = new Promise((s, l) => {
|
|
18
|
+
n = s, t = l;
|
|
19
|
+
});
|
|
20
|
+
return { promise: i, resolve: n, reject: t };
|
|
14
21
|
}
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
const W = 2, yt = 4, vt = 8, oe = 16, se = 32, Ae = 64, gt = 128, q = 1024, z = 2048, ae = 4096, ee = 8192, ne = 16384, wt = 32768, Oe = 65536, $t = 1 << 17, cn = 1 << 18, Ze = 1 << 19, ir = 1 << 20, Q = 256, Ye = 512, Ge = 32768, st = 1 << 21, mt = 1 << 22, ve = 1 << 23, Re = Symbol("$state"), hn = Symbol("legacy props"), Ie = new class extends Error {
|
|
23
|
+
name = "StaleReactionError";
|
|
24
|
+
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
25
|
+
}();
|
|
26
|
+
function or(n) {
|
|
27
|
+
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
17
28
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
29
|
+
function dn() {
|
|
30
|
+
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
20
31
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
32
|
+
function pn(n) {
|
|
33
|
+
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
23
34
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
35
|
+
function _n() {
|
|
36
|
+
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
26
37
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
function yn(n) {
|
|
39
|
+
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
40
|
+
}
|
|
41
|
+
function vn() {
|
|
42
|
+
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
43
|
+
}
|
|
44
|
+
function gn() {
|
|
45
|
+
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
46
|
+
}
|
|
47
|
+
function wn() {
|
|
48
|
+
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
49
|
+
}
|
|
50
|
+
function mn() {
|
|
51
|
+
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
33
52
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
return document;
|
|
37
|
-
const r = s.getRootNode ? s.getRootNode() : s.ownerDocument;
|
|
38
|
-
return r && /** @type {ShadowRoot} */
|
|
39
|
-
r.host ? (
|
|
40
|
-
/** @type {ShadowRoot} */
|
|
41
|
-
r
|
|
42
|
-
) : s.ownerDocument;
|
|
53
|
+
function sr(n) {
|
|
54
|
+
return n === this.v;
|
|
43
55
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
46
|
-
/** @type {Document} */
|
|
47
|
-
s.head || s,
|
|
48
|
-
r
|
|
49
|
-
), r.sheet;
|
|
56
|
+
function En(n, t) {
|
|
57
|
+
return n != n ? t == t : n !== t || n !== null && typeof n == "object" || typeof n == "function";
|
|
50
58
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
59
|
+
function xn(n) {
|
|
60
|
+
return !En(n, this.v);
|
|
53
61
|
}
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
let $ = null;
|
|
63
|
+
function Qe(n) {
|
|
64
|
+
$ = n;
|
|
56
65
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
66
|
+
function Bn(n, t = !1, i) {
|
|
67
|
+
$ = {
|
|
68
|
+
p: $,
|
|
69
|
+
i: !1,
|
|
70
|
+
c: null,
|
|
71
|
+
e: null,
|
|
72
|
+
s: n,
|
|
73
|
+
x: null,
|
|
74
|
+
l: Le && !t ? { s: null, u: null, $: [] } : null
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function In(n) {
|
|
78
|
+
var t = (
|
|
79
|
+
/** @type {ComponentContext} */
|
|
80
|
+
$
|
|
81
|
+
), i = t.e;
|
|
82
|
+
if (i !== null) {
|
|
83
|
+
t.e = null;
|
|
84
|
+
for (var s of i)
|
|
85
|
+
gr(s);
|
|
86
|
+
}
|
|
87
|
+
return t.i = !0, $ = t.p, /** @type {T} */
|
|
88
|
+
{};
|
|
89
|
+
}
|
|
90
|
+
function Pe() {
|
|
91
|
+
return !Le || $ !== null && $.l === null;
|
|
59
92
|
}
|
|
60
|
-
|
|
61
|
-
|
|
93
|
+
let Se = [];
|
|
94
|
+
function Sn() {
|
|
95
|
+
var n = Se;
|
|
96
|
+
Se = [], ot(n);
|
|
62
97
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
98
|
+
function ar(n) {
|
|
99
|
+
if (Se.length === 0) {
|
|
100
|
+
var t = Se;
|
|
101
|
+
queueMicrotask(() => {
|
|
102
|
+
t === Se && Sn();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
Se.push(n);
|
|
65
106
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
107
|
+
function Fn(n) {
|
|
108
|
+
var t = b;
|
|
109
|
+
if (t === null)
|
|
110
|
+
return R.f |= ve, n;
|
|
111
|
+
if ((t.f & wt) === 0) {
|
|
112
|
+
if ((t.f & gt) === 0)
|
|
113
|
+
throw n;
|
|
114
|
+
t.b.error(n);
|
|
115
|
+
} else
|
|
116
|
+
Ke(n, t);
|
|
68
117
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
118
|
+
function Ke(n, t) {
|
|
119
|
+
for (; t !== null; ) {
|
|
120
|
+
if ((t.f & gt) !== 0)
|
|
121
|
+
try {
|
|
122
|
+
t.b.error(n);
|
|
123
|
+
return;
|
|
124
|
+
} catch (i) {
|
|
125
|
+
n = i;
|
|
126
|
+
}
|
|
127
|
+
t = t.parent;
|
|
128
|
+
}
|
|
129
|
+
throw n;
|
|
130
|
+
}
|
|
131
|
+
const qe = /* @__PURE__ */ new Set();
|
|
132
|
+
let P = null, K = null, ce = [], Et = null, at = !1;
|
|
133
|
+
class Ue {
|
|
134
|
+
committed = !1;
|
|
135
|
+
/**
|
|
136
|
+
* The current values of any sources that are updated in this batch
|
|
137
|
+
* They keys of this map are identical to `this.#previous`
|
|
138
|
+
* @type {Map<Source, any>}
|
|
139
|
+
*/
|
|
140
|
+
current = /* @__PURE__ */ new Map();
|
|
141
|
+
/**
|
|
142
|
+
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
143
|
+
* They keys of this map are identical to `this.#current`
|
|
144
|
+
* @type {Map<Source, any>}
|
|
145
|
+
*/
|
|
146
|
+
previous = /* @__PURE__ */ new Map();
|
|
147
|
+
/**
|
|
148
|
+
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
149
|
+
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
150
|
+
* @type {Set<() => void>}
|
|
151
|
+
*/
|
|
152
|
+
#t = /* @__PURE__ */ new Set();
|
|
153
|
+
/**
|
|
154
|
+
* If a fork is discarded, we need to destroy any effects that are no longer needed
|
|
155
|
+
* @type {Set<(batch: Batch) => void>}
|
|
156
|
+
*/
|
|
157
|
+
#r = /* @__PURE__ */ new Set();
|
|
158
|
+
/**
|
|
159
|
+
* The number of async effects that are currently in flight
|
|
160
|
+
*/
|
|
161
|
+
#e = 0;
|
|
162
|
+
/**
|
|
163
|
+
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
164
|
+
*/
|
|
165
|
+
#n = 0;
|
|
166
|
+
/**
|
|
167
|
+
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
168
|
+
* TODO replace with Promise.withResolvers once supported widely enough
|
|
169
|
+
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
170
|
+
*/
|
|
171
|
+
#o = null;
|
|
172
|
+
/**
|
|
173
|
+
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
174
|
+
* @type {Effect[]}
|
|
175
|
+
*/
|
|
176
|
+
#s = [];
|
|
177
|
+
/**
|
|
178
|
+
* Deferred effects that are MAYBE_DIRTY
|
|
179
|
+
* @type {Effect[]}
|
|
180
|
+
*/
|
|
181
|
+
#a = [];
|
|
182
|
+
/**
|
|
183
|
+
* A set of branches that still exist, but will be destroyed when this batch
|
|
184
|
+
* is committed — we skip over these during `process`
|
|
185
|
+
* @type {Set<Effect>}
|
|
186
|
+
*/
|
|
187
|
+
skipped_effects = /* @__PURE__ */ new Set();
|
|
188
|
+
is_fork = !1;
|
|
189
|
+
/**
|
|
190
|
+
*
|
|
191
|
+
* @param {Effect[]} root_effects
|
|
192
|
+
*/
|
|
193
|
+
process(t) {
|
|
194
|
+
ce = [], this.apply();
|
|
195
|
+
var i = {
|
|
196
|
+
parent: null,
|
|
197
|
+
effect: null,
|
|
198
|
+
effects: [],
|
|
199
|
+
render_effects: [],
|
|
200
|
+
block_effects: []
|
|
201
|
+
};
|
|
202
|
+
for (const s of t)
|
|
203
|
+
this.#l(s, i);
|
|
204
|
+
this.is_fork || this.#u(), this.#n > 0 || this.is_fork ? (this.#i(i.effects), this.#i(i.render_effects), this.#i(i.block_effects)) : (P = null, Nt(i.render_effects), Nt(i.effects), this.#o?.resolve()), K = null;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Traverse the effect tree, executing effects or stashing
|
|
208
|
+
* them for later execution as appropriate
|
|
209
|
+
* @param {Effect} root
|
|
210
|
+
* @param {EffectTarget} target
|
|
211
|
+
*/
|
|
212
|
+
#l(t, i) {
|
|
213
|
+
t.f ^= q;
|
|
214
|
+
for (var s = t.first; s !== null; ) {
|
|
215
|
+
var l = s.f, c = (l & (se | Ae)) !== 0, h = c && (l & q) !== 0, u = h || (l & ee) !== 0 || this.skipped_effects.has(s);
|
|
216
|
+
if ((s.f & gt) !== 0 && s.b?.is_pending() && (i = {
|
|
217
|
+
parent: i,
|
|
218
|
+
effect: s,
|
|
219
|
+
effects: [],
|
|
220
|
+
render_effects: [],
|
|
221
|
+
block_effects: []
|
|
222
|
+
}), !u && s.fn !== null) {
|
|
223
|
+
c ? s.f ^= q : (l & yt) !== 0 ? i.effects.push(s) : $e(s) && ((s.f & oe) !== 0 && i.block_effects.push(s), ke(s));
|
|
224
|
+
var p = s.first;
|
|
225
|
+
if (p !== null) {
|
|
226
|
+
s = p;
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
var _ = s.parent;
|
|
231
|
+
for (s = s.next; s === null && _ !== null; )
|
|
232
|
+
_ === i.effect && (this.#i(i.effects), this.#i(i.render_effects), this.#i(i.block_effects), i = /** @type {EffectTarget} */
|
|
233
|
+
i.parent), s = _.next, _ = _.parent;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @param {Effect[]} effects
|
|
238
|
+
*/
|
|
239
|
+
#i(t) {
|
|
240
|
+
for (const i of t)
|
|
241
|
+
((i.f & z) !== 0 ? this.#s : this.#a).push(i), j(i, q);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Associate a change to a given source with the current
|
|
245
|
+
* batch, noting its previous and current values
|
|
246
|
+
* @param {Source} source
|
|
247
|
+
* @param {any} value
|
|
248
|
+
*/
|
|
249
|
+
capture(t, i) {
|
|
250
|
+
this.previous.has(t) || this.previous.set(t, i), this.current.set(t, t.v), K?.set(t, t.v);
|
|
251
|
+
}
|
|
252
|
+
activate() {
|
|
253
|
+
P = this;
|
|
254
|
+
}
|
|
255
|
+
deactivate() {
|
|
256
|
+
P = null, K = null;
|
|
257
|
+
}
|
|
258
|
+
flush() {
|
|
259
|
+
if (this.activate(), ce.length > 0) {
|
|
260
|
+
if (Rn(), P !== null && P !== this)
|
|
261
|
+
return;
|
|
262
|
+
} else this.#e === 0 && this.process([]);
|
|
263
|
+
this.deactivate();
|
|
264
|
+
}
|
|
265
|
+
discard() {
|
|
266
|
+
for (const t of this.#r) t(this);
|
|
267
|
+
this.#r.clear();
|
|
268
|
+
}
|
|
269
|
+
#u() {
|
|
270
|
+
if (this.#n === 0) {
|
|
271
|
+
for (const t of this.#t) t();
|
|
272
|
+
this.#t.clear();
|
|
273
|
+
}
|
|
274
|
+
this.#e === 0 && this.#f();
|
|
275
|
+
}
|
|
276
|
+
#f() {
|
|
277
|
+
if (qe.size > 1) {
|
|
278
|
+
this.previous.clear();
|
|
279
|
+
var t = K, i = !0, s = {
|
|
280
|
+
parent: null,
|
|
281
|
+
effect: null,
|
|
282
|
+
effects: [],
|
|
283
|
+
render_effects: [],
|
|
284
|
+
block_effects: []
|
|
285
|
+
};
|
|
286
|
+
for (const l of qe) {
|
|
287
|
+
if (l === this) {
|
|
288
|
+
i = !1;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
const c = [];
|
|
292
|
+
for (const [u, p] of this.current) {
|
|
293
|
+
if (l.current.has(u))
|
|
294
|
+
if (i && p !== l.current.get(u))
|
|
295
|
+
l.current.set(u, p);
|
|
296
|
+
else
|
|
297
|
+
continue;
|
|
298
|
+
c.push(u);
|
|
299
|
+
}
|
|
300
|
+
if (c.length === 0)
|
|
301
|
+
continue;
|
|
302
|
+
const h = [...l.current.keys()].filter((u) => !this.current.has(u));
|
|
303
|
+
if (h.length > 0) {
|
|
304
|
+
const u = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Map();
|
|
305
|
+
for (const _ of c)
|
|
306
|
+
lr(_, h, u, p);
|
|
307
|
+
if (ce.length > 0) {
|
|
308
|
+
P = l, l.apply();
|
|
309
|
+
for (const _ of ce)
|
|
310
|
+
l.#l(_, s);
|
|
311
|
+
ce = [], l.deactivate();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
P = null, K = t;
|
|
316
|
+
}
|
|
317
|
+
this.committed = !0, qe.delete(this);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
*
|
|
321
|
+
* @param {boolean} blocking
|
|
322
|
+
*/
|
|
323
|
+
increment(t) {
|
|
324
|
+
this.#e += 1, t && (this.#n += 1);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
*
|
|
328
|
+
* @param {boolean} blocking
|
|
329
|
+
*/
|
|
330
|
+
decrement(t) {
|
|
331
|
+
this.#e -= 1, t && (this.#n -= 1), this.revive();
|
|
332
|
+
}
|
|
333
|
+
revive() {
|
|
334
|
+
for (const t of this.#s)
|
|
335
|
+
j(t, z), we(t);
|
|
336
|
+
for (const t of this.#a)
|
|
337
|
+
j(t, ae), we(t);
|
|
338
|
+
this.#s = [], this.#a = [], this.flush();
|
|
339
|
+
}
|
|
340
|
+
/** @param {() => void} fn */
|
|
341
|
+
oncommit(t) {
|
|
342
|
+
this.#t.add(t);
|
|
343
|
+
}
|
|
344
|
+
/** @param {(batch: Batch) => void} fn */
|
|
345
|
+
ondiscard(t) {
|
|
346
|
+
this.#r.add(t);
|
|
347
|
+
}
|
|
348
|
+
settled() {
|
|
349
|
+
return (this.#o ??= nr()).promise;
|
|
350
|
+
}
|
|
351
|
+
static ensure() {
|
|
352
|
+
if (P === null) {
|
|
353
|
+
const t = P = new Ue();
|
|
354
|
+
qe.add(P), Ue.enqueue(() => {
|
|
355
|
+
P === t && t.flush();
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
return P;
|
|
359
|
+
}
|
|
360
|
+
/** @param {() => void} task */
|
|
361
|
+
static enqueue(t) {
|
|
362
|
+
ar(t);
|
|
363
|
+
}
|
|
364
|
+
apply() {
|
|
365
|
+
}
|
|
71
366
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
367
|
+
function Rn() {
|
|
368
|
+
var n = be;
|
|
369
|
+
at = !0;
|
|
370
|
+
try {
|
|
371
|
+
var t = 0;
|
|
372
|
+
for (Wt(!0); ce.length > 0; ) {
|
|
373
|
+
var i = Ue.ensure();
|
|
374
|
+
if (t++ > 1e3) {
|
|
375
|
+
var s, l;
|
|
376
|
+
bn();
|
|
377
|
+
}
|
|
378
|
+
i.process(ce), de.clear();
|
|
379
|
+
}
|
|
380
|
+
} finally {
|
|
381
|
+
at = !1, Wt(n), Et = null;
|
|
382
|
+
}
|
|
74
383
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
384
|
+
function bn() {
|
|
385
|
+
try {
|
|
386
|
+
vn();
|
|
387
|
+
} catch (n) {
|
|
388
|
+
Ke(n, Et);
|
|
389
|
+
}
|
|
78
390
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
391
|
+
let re = null;
|
|
392
|
+
function Nt(n) {
|
|
393
|
+
var t = n.length;
|
|
394
|
+
if (t !== 0) {
|
|
395
|
+
for (var i = 0; i < t; ) {
|
|
396
|
+
var s = n[i++];
|
|
397
|
+
if ((s.f & (ne | ee)) === 0 && $e(s) && (re = /* @__PURE__ */ new Set(), ke(s), s.deps === null && s.first === null && s.nodes_start === null && (s.teardown === null && s.ac === null ? Er(s) : s.fn = null), re?.size > 0)) {
|
|
398
|
+
de.clear();
|
|
399
|
+
for (const l of re) {
|
|
400
|
+
if ((l.f & (ne | ee)) !== 0) continue;
|
|
401
|
+
const c = [l];
|
|
402
|
+
let h = l.parent;
|
|
403
|
+
for (; h !== null; )
|
|
404
|
+
re.has(h) && (re.delete(h), c.push(h)), h = h.parent;
|
|
405
|
+
for (let u = c.length - 1; u >= 0; u--) {
|
|
406
|
+
const p = c[u];
|
|
407
|
+
(p.f & (ne | ee)) === 0 && ke(p);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
re.clear();
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
re = null;
|
|
414
|
+
}
|
|
83
415
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
416
|
+
function lr(n, t, i, s) {
|
|
417
|
+
if (!i.has(n) && (i.add(n), n.reactions !== null))
|
|
418
|
+
for (const l of n.reactions) {
|
|
419
|
+
const c = l.f;
|
|
420
|
+
(c & W) !== 0 ? lr(
|
|
421
|
+
/** @type {Derived} */
|
|
422
|
+
l,
|
|
423
|
+
t,
|
|
424
|
+
i,
|
|
425
|
+
s
|
|
426
|
+
) : (c & (mt | oe)) !== 0 && (c & z) === 0 && // we may have scheduled this one already
|
|
427
|
+
ur(l, t, s) && (j(l, z), we(
|
|
428
|
+
/** @type {Effect} */
|
|
429
|
+
l
|
|
430
|
+
));
|
|
431
|
+
}
|
|
86
432
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
433
|
+
function ur(n, t, i) {
|
|
434
|
+
const s = i.get(n);
|
|
435
|
+
if (s !== void 0) return s;
|
|
436
|
+
if (n.deps !== null)
|
|
437
|
+
for (const l of n.deps) {
|
|
438
|
+
if (t.includes(l))
|
|
439
|
+
return !0;
|
|
440
|
+
if ((l.f & W) !== 0 && ur(
|
|
441
|
+
/** @type {Derived} */
|
|
442
|
+
l,
|
|
443
|
+
t,
|
|
444
|
+
i
|
|
445
|
+
))
|
|
446
|
+
return i.set(
|
|
447
|
+
/** @type {Derived} */
|
|
448
|
+
l,
|
|
449
|
+
!0
|
|
450
|
+
), !0;
|
|
451
|
+
}
|
|
452
|
+
return i.set(n, !1), !1;
|
|
93
453
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
454
|
+
function we(n) {
|
|
455
|
+
for (var t = Et = n; t.parent !== null; ) {
|
|
456
|
+
t = t.parent;
|
|
457
|
+
var i = t.f;
|
|
458
|
+
if (at && t === b && (i & oe) !== 0)
|
|
459
|
+
return;
|
|
460
|
+
if ((i & (Ae | se)) !== 0) {
|
|
461
|
+
if ((i & q) === 0) return;
|
|
462
|
+
t.f ^= q;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
ce.push(t);
|
|
96
466
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
467
|
+
function An(n, t, i, s) {
|
|
468
|
+
const l = Pe() ? xt : fr;
|
|
469
|
+
if (i.length === 0 && n.length === 0) {
|
|
470
|
+
s(t.map(l));
|
|
101
471
|
return;
|
|
102
|
-
|
|
103
|
-
|
|
472
|
+
}
|
|
473
|
+
var c = P, h = (
|
|
474
|
+
/** @type {Effect} */
|
|
475
|
+
b
|
|
476
|
+
), u = Cn();
|
|
477
|
+
function p() {
|
|
478
|
+
Promise.all(i.map((_) => /* @__PURE__ */ Tn(_))).then((_) => {
|
|
479
|
+
u();
|
|
480
|
+
try {
|
|
481
|
+
s([...t.map(l), ..._]);
|
|
482
|
+
} catch (g) {
|
|
483
|
+
(h.f & ne) === 0 && Ke(g, h);
|
|
484
|
+
}
|
|
485
|
+
c?.deactivate(), Je();
|
|
486
|
+
}).catch((_) => {
|
|
487
|
+
Ke(_, h);
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
n.length > 0 ? Promise.all(n).then(() => {
|
|
491
|
+
u();
|
|
492
|
+
try {
|
|
493
|
+
return p();
|
|
494
|
+
} finally {
|
|
495
|
+
c?.deactivate(), Je();
|
|
496
|
+
}
|
|
497
|
+
}) : p();
|
|
498
|
+
}
|
|
499
|
+
function Cn() {
|
|
500
|
+
var n = b, t = R, i = $, s = P;
|
|
501
|
+
return function(c = !0) {
|
|
502
|
+
_e(n), te(t), Qe(i), c && s?.activate();
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
function Je() {
|
|
506
|
+
_e(null), te(null), Qe(null);
|
|
507
|
+
}
|
|
508
|
+
// @__NO_SIDE_EFFECTS__
|
|
509
|
+
function xt(n) {
|
|
510
|
+
var t = W | z, i = R !== null && (R.f & W) !== 0 ? (
|
|
511
|
+
/** @type {Derived} */
|
|
512
|
+
R
|
|
513
|
+
) : null;
|
|
514
|
+
return b === null || i !== null && (i.f & Q) !== 0 ? t |= Q : b.f |= Ze, {
|
|
515
|
+
ctx: $,
|
|
516
|
+
deps: null,
|
|
517
|
+
effects: null,
|
|
518
|
+
equals: sr,
|
|
519
|
+
f: t,
|
|
520
|
+
fn: n,
|
|
521
|
+
reactions: null,
|
|
522
|
+
rv: 0,
|
|
523
|
+
v: (
|
|
524
|
+
/** @type {V} */
|
|
525
|
+
N
|
|
526
|
+
),
|
|
527
|
+
wv: 0,
|
|
528
|
+
parent: i ?? b,
|
|
529
|
+
ac: null
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
// @__NO_SIDE_EFFECTS__
|
|
533
|
+
function Tn(n, t) {
|
|
534
|
+
let i = (
|
|
535
|
+
/** @type {Effect | null} */
|
|
536
|
+
b
|
|
537
|
+
);
|
|
538
|
+
i === null && dn();
|
|
539
|
+
var s = (
|
|
540
|
+
/** @type {Boundary} */
|
|
541
|
+
i.b
|
|
542
|
+
), l = (
|
|
543
|
+
/** @type {Promise<V>} */
|
|
544
|
+
/** @type {unknown} */
|
|
545
|
+
void 0
|
|
546
|
+
), c = pr(
|
|
547
|
+
/** @type {V} */
|
|
548
|
+
N
|
|
549
|
+
), h = !R, u = /* @__PURE__ */ new Map();
|
|
550
|
+
return Wn(() => {
|
|
551
|
+
var p = nr();
|
|
552
|
+
l = p.promise;
|
|
104
553
|
try {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
554
|
+
Promise.resolve(n()).then(p.resolve, p.reject).then(() => {
|
|
555
|
+
_ === P && _.committed && _.deactivate(), Je();
|
|
556
|
+
});
|
|
557
|
+
} catch (m) {
|
|
558
|
+
p.reject(m), Je();
|
|
559
|
+
}
|
|
560
|
+
var _ = (
|
|
561
|
+
/** @type {Batch} */
|
|
562
|
+
P
|
|
563
|
+
);
|
|
564
|
+
if (h) {
|
|
565
|
+
var g = !s.is_pending();
|
|
566
|
+
s.update_pending_count(1), _.increment(g), u.get(_)?.reject(Ie), u.delete(_), u.set(_, p);
|
|
567
|
+
}
|
|
568
|
+
const E = (m, v = void 0) => {
|
|
569
|
+
if (_.activate(), v)
|
|
570
|
+
v !== Ie && (c.f |= ve, ut(c, v));
|
|
571
|
+
else {
|
|
572
|
+
(c.f & ve) !== 0 && (c.f ^= ve), ut(c, m);
|
|
573
|
+
for (const [w, x] of u) {
|
|
574
|
+
if (u.delete(w), w === _) break;
|
|
575
|
+
x.reject(Ie);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
h && (s.update_pending_count(-1), _.decrement(g));
|
|
579
|
+
};
|
|
580
|
+
p.promise.then(E, (m) => E(null, m || "unknown"));
|
|
581
|
+
}), vr(() => {
|
|
582
|
+
for (const p of u.values())
|
|
583
|
+
p.reject(Ie);
|
|
584
|
+
}), new Promise((p) => {
|
|
585
|
+
function _(g) {
|
|
586
|
+
function E() {
|
|
587
|
+
g === l ? p(c) : _(l);
|
|
108
588
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
589
|
+
g.then(E, E);
|
|
590
|
+
}
|
|
591
|
+
_(l);
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
// @__NO_SIDE_EFFECTS__
|
|
595
|
+
function fr(n) {
|
|
596
|
+
const t = /* @__PURE__ */ xt(n);
|
|
597
|
+
return t.equals = xn, t;
|
|
598
|
+
}
|
|
599
|
+
function cr(n) {
|
|
600
|
+
var t = n.effects;
|
|
601
|
+
if (t !== null) {
|
|
602
|
+
n.effects = null;
|
|
603
|
+
for (var i = 0; i < t.length; i += 1)
|
|
604
|
+
pe(
|
|
605
|
+
/** @type {Effect} */
|
|
606
|
+
t[i]
|
|
607
|
+
);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
function On(n) {
|
|
611
|
+
for (var t = n.parent; t !== null; ) {
|
|
612
|
+
if ((t.f & W) === 0)
|
|
613
|
+
return (
|
|
614
|
+
/** @type {Effect} */
|
|
615
|
+
t
|
|
616
|
+
);
|
|
617
|
+
t = t.parent;
|
|
618
|
+
}
|
|
619
|
+
return null;
|
|
620
|
+
}
|
|
621
|
+
function Bt(n) {
|
|
622
|
+
var t, i = b;
|
|
623
|
+
_e(On(n));
|
|
624
|
+
try {
|
|
625
|
+
n.f &= ~Ge, cr(n), t = Rr(n);
|
|
626
|
+
} finally {
|
|
627
|
+
_e(i);
|
|
628
|
+
}
|
|
629
|
+
return t;
|
|
630
|
+
}
|
|
631
|
+
function hr(n) {
|
|
632
|
+
var t = Bt(n);
|
|
633
|
+
if (n.equals(t) || (n.v = t, n.wv = Sr()), !me)
|
|
634
|
+
if (K !== null)
|
|
635
|
+
K.set(n, n.v);
|
|
636
|
+
else {
|
|
637
|
+
var i = (he || (n.f & Q) !== 0) && n.deps !== null ? ae : q;
|
|
638
|
+
j(n, i);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
let lt = /* @__PURE__ */ new Set();
|
|
642
|
+
const de = /* @__PURE__ */ new Map();
|
|
643
|
+
let dr = !1;
|
|
644
|
+
function pr(n, t) {
|
|
645
|
+
var i = {
|
|
646
|
+
f: 0,
|
|
647
|
+
// TODO ideally we could skip this altogether, but it causes type errors
|
|
648
|
+
v: n,
|
|
649
|
+
reactions: null,
|
|
650
|
+
equals: sr,
|
|
651
|
+
rv: 0,
|
|
652
|
+
wv: 0
|
|
143
653
|
};
|
|
654
|
+
return i;
|
|
144
655
|
}
|
|
145
|
-
|
|
146
|
-
|
|
656
|
+
// @__NO_SIDE_EFFECTS__
|
|
657
|
+
function ue(n, t) {
|
|
658
|
+
const i = pr(n);
|
|
659
|
+
return Xn(i), i;
|
|
147
660
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
661
|
+
function fe(n, t, i = !1) {
|
|
662
|
+
R !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
663
|
+
// to ensure we error if state is set inside an inspect effect
|
|
664
|
+
(!X || (R.f & $t) !== 0) && Pe() && (R.f & (W | oe | mt | $t)) !== 0 && !ie?.includes(n) && mn();
|
|
665
|
+
let s = i ? Fe(t) : t;
|
|
666
|
+
return ut(n, s);
|
|
150
667
|
}
|
|
151
|
-
function
|
|
152
|
-
if (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
668
|
+
function ut(n, t) {
|
|
669
|
+
if (!n.equals(t)) {
|
|
670
|
+
var i = n.v;
|
|
671
|
+
me ? de.set(n, t) : de.set(n, i), n.v = t;
|
|
672
|
+
var s = Ue.ensure();
|
|
673
|
+
s.capture(n, i), (n.f & W) !== 0 && ((n.f & z) !== 0 && Bt(
|
|
674
|
+
/** @type {Derived} */
|
|
675
|
+
n
|
|
676
|
+
), j(n, (n.f & Q) === 0 ? q : ae)), n.wv = Sr(), _r(n, z), Pe() && b !== null && (b.f & q) !== 0 && (b.f & (se | Ae)) === 0 && (G === null ? Zn([n]) : G.push(n)), !s.is_fork && lt.size > 0 && !dr && Un();
|
|
677
|
+
}
|
|
678
|
+
return t;
|
|
679
|
+
}
|
|
680
|
+
function Un() {
|
|
681
|
+
dr = !1;
|
|
682
|
+
const n = Array.from(lt);
|
|
683
|
+
for (const t of n)
|
|
684
|
+
(t.f & q) !== 0 && j(t, ae), $e(t) && ke(t);
|
|
685
|
+
lt.clear();
|
|
686
|
+
}
|
|
687
|
+
function nt(n) {
|
|
688
|
+
fe(n, n.v + 1);
|
|
689
|
+
}
|
|
690
|
+
function _r(n, t) {
|
|
691
|
+
var i = n.reactions;
|
|
692
|
+
if (i !== null)
|
|
693
|
+
for (var s = Pe(), l = i.length, c = 0; c < l; c++) {
|
|
694
|
+
var h = i[c], u = h.f;
|
|
695
|
+
if (!(!s && h === b)) {
|
|
696
|
+
var p = (u & z) === 0;
|
|
697
|
+
p && j(h, t), (u & W) !== 0 ? (u & Ge) === 0 && (h.f |= Ge, _r(
|
|
698
|
+
/** @type {Derived} */
|
|
699
|
+
h,
|
|
700
|
+
ae
|
|
701
|
+
)) : p && ((u & oe) !== 0 && re !== null && re.add(
|
|
702
|
+
/** @type {Effect} */
|
|
703
|
+
h
|
|
704
|
+
), we(
|
|
705
|
+
/** @type {Effect} */
|
|
706
|
+
h
|
|
707
|
+
));
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
function Fe(n) {
|
|
712
|
+
if (typeof n != "object" || n === null || Re in n)
|
|
713
|
+
return n;
|
|
714
|
+
const t = _t(n);
|
|
715
|
+
if (t !== ln && t !== un)
|
|
716
|
+
return n;
|
|
717
|
+
var i = /* @__PURE__ */ new Map(), s = on(n), l = /* @__PURE__ */ ue(0), c = ge, h = (u) => {
|
|
718
|
+
if (ge === c)
|
|
719
|
+
return u();
|
|
720
|
+
var p = R, _ = ge;
|
|
721
|
+
te(null), Ht(c);
|
|
722
|
+
var g = u();
|
|
723
|
+
return te(p), Ht(_), g;
|
|
201
724
|
};
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
725
|
+
return s && i.set("length", /* @__PURE__ */ ue(
|
|
726
|
+
/** @type {any[]} */
|
|
727
|
+
n.length
|
|
728
|
+
)), new Proxy(
|
|
729
|
+
/** @type {any} */
|
|
730
|
+
n,
|
|
731
|
+
{
|
|
732
|
+
defineProperty(u, p, _) {
|
|
733
|
+
(!("value" in _) || _.configurable === !1 || _.enumerable === !1 || _.writable === !1) && gn();
|
|
734
|
+
var g = i.get(p);
|
|
735
|
+
return g === void 0 ? g = h(() => {
|
|
736
|
+
var E = /* @__PURE__ */ ue(_.value);
|
|
737
|
+
return i.set(p, E), E;
|
|
738
|
+
}) : fe(g, _.value, !0), !0;
|
|
739
|
+
},
|
|
740
|
+
deleteProperty(u, p) {
|
|
741
|
+
var _ = i.get(p);
|
|
742
|
+
if (_ === void 0) {
|
|
743
|
+
if (p in u) {
|
|
744
|
+
const g = h(() => /* @__PURE__ */ ue(N));
|
|
745
|
+
i.set(p, g), nt(l);
|
|
746
|
+
}
|
|
747
|
+
} else
|
|
748
|
+
fe(_, N), nt(l);
|
|
749
|
+
return !0;
|
|
750
|
+
},
|
|
751
|
+
get(u, p, _) {
|
|
752
|
+
if (p === Re)
|
|
753
|
+
return n;
|
|
754
|
+
var g = i.get(p), E = p in u;
|
|
755
|
+
if (g === void 0 && (!E || Ve(u, p)?.writable) && (g = h(() => {
|
|
756
|
+
var v = Fe(E ? u[p] : N), w = /* @__PURE__ */ ue(v);
|
|
757
|
+
return w;
|
|
758
|
+
}), i.set(p, g)), g !== void 0) {
|
|
759
|
+
var m = Z(g);
|
|
760
|
+
return m === N ? void 0 : m;
|
|
761
|
+
}
|
|
762
|
+
return Reflect.get(u, p, _);
|
|
763
|
+
},
|
|
764
|
+
getOwnPropertyDescriptor(u, p) {
|
|
765
|
+
var _ = Reflect.getOwnPropertyDescriptor(u, p);
|
|
766
|
+
if (_ && "value" in _) {
|
|
767
|
+
var g = i.get(p);
|
|
768
|
+
g && (_.value = Z(g));
|
|
769
|
+
} else if (_ === void 0) {
|
|
770
|
+
var E = i.get(p), m = E?.v;
|
|
771
|
+
if (E !== void 0 && m !== N)
|
|
772
|
+
return {
|
|
773
|
+
enumerable: !0,
|
|
774
|
+
configurable: !0,
|
|
775
|
+
value: m,
|
|
776
|
+
writable: !0
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
return _;
|
|
780
|
+
},
|
|
781
|
+
has(u, p) {
|
|
782
|
+
if (p === Re)
|
|
783
|
+
return !0;
|
|
784
|
+
var _ = i.get(p), g = _ !== void 0 && _.v !== N || Reflect.has(u, p);
|
|
785
|
+
if (_ !== void 0 || b !== null && (!g || Ve(u, p)?.writable)) {
|
|
786
|
+
_ === void 0 && (_ = h(() => {
|
|
787
|
+
var m = g ? Fe(u[p]) : N, v = /* @__PURE__ */ ue(m);
|
|
788
|
+
return v;
|
|
789
|
+
}), i.set(p, _));
|
|
790
|
+
var E = Z(_);
|
|
791
|
+
if (E === N)
|
|
792
|
+
return !1;
|
|
793
|
+
}
|
|
794
|
+
return g;
|
|
795
|
+
},
|
|
796
|
+
set(u, p, _, g) {
|
|
797
|
+
var E = i.get(p), m = p in u;
|
|
798
|
+
if (s && p === "length")
|
|
799
|
+
for (var v = _; v < /** @type {Source<number>} */
|
|
800
|
+
E.v; v += 1) {
|
|
801
|
+
var w = i.get(v + "");
|
|
802
|
+
w !== void 0 ? fe(w, N) : v in u && (w = h(() => /* @__PURE__ */ ue(N)), i.set(v + "", w));
|
|
803
|
+
}
|
|
804
|
+
if (E === void 0)
|
|
805
|
+
(!m || Ve(u, p)?.writable) && (E = h(() => /* @__PURE__ */ ue(void 0)), fe(E, Fe(_)), i.set(p, E));
|
|
806
|
+
else {
|
|
807
|
+
m = E.v !== N;
|
|
808
|
+
var x = h(() => Fe(_));
|
|
809
|
+
fe(E, x);
|
|
810
|
+
}
|
|
811
|
+
var S = Reflect.getOwnPropertyDescriptor(u, p);
|
|
812
|
+
if (S?.set && S.set.call(g, _), !m) {
|
|
813
|
+
if (s && typeof p == "string") {
|
|
814
|
+
var A = (
|
|
815
|
+
/** @type {Source<number>} */
|
|
816
|
+
i.get("length")
|
|
817
|
+
), B = Number(p);
|
|
818
|
+
Number.isInteger(B) && B >= A.v && fe(A, B + 1);
|
|
819
|
+
}
|
|
820
|
+
nt(l);
|
|
821
|
+
}
|
|
822
|
+
return !0;
|
|
823
|
+
},
|
|
824
|
+
ownKeys(u) {
|
|
825
|
+
Z(l);
|
|
826
|
+
var p = Reflect.ownKeys(u).filter((E) => {
|
|
827
|
+
var m = i.get(E);
|
|
828
|
+
return m === void 0 || m.v !== N;
|
|
829
|
+
});
|
|
830
|
+
for (var [_, g] of i)
|
|
831
|
+
g.v !== N && !(_ in u) && p.push(_);
|
|
832
|
+
return p;
|
|
833
|
+
},
|
|
834
|
+
setPrototypeOf() {
|
|
835
|
+
wn();
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
var Dn, kn, Mn;
|
|
841
|
+
function qt(n = "") {
|
|
842
|
+
return document.createTextNode(n);
|
|
843
|
+
}
|
|
844
|
+
// @__NO_SIDE_EFFECTS__
|
|
845
|
+
function ft(n) {
|
|
846
|
+
return kn.call(n);
|
|
847
|
+
}
|
|
848
|
+
// @__NO_SIDE_EFFECTS__
|
|
849
|
+
function It(n) {
|
|
850
|
+
return Mn.call(n);
|
|
851
|
+
}
|
|
852
|
+
function Ln(n, t) {
|
|
853
|
+
return /* @__PURE__ */ ft(n);
|
|
854
|
+
}
|
|
855
|
+
function Pn(n, t = 1, i = !1) {
|
|
856
|
+
let s = n;
|
|
857
|
+
for (; t--; )
|
|
858
|
+
s = /** @type {TemplateNode} */
|
|
859
|
+
/* @__PURE__ */ It(s);
|
|
860
|
+
return s;
|
|
861
|
+
}
|
|
862
|
+
function $n() {
|
|
863
|
+
return !1;
|
|
864
|
+
}
|
|
865
|
+
function St(n) {
|
|
866
|
+
var t = R, i = b;
|
|
867
|
+
te(null), _e(null);
|
|
868
|
+
try {
|
|
869
|
+
return n();
|
|
870
|
+
} finally {
|
|
871
|
+
te(t), _e(i);
|
|
239
872
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
873
|
+
}
|
|
874
|
+
function yr(n) {
|
|
875
|
+
b === null && R === null && yn(), R !== null && (R.f & Q) !== 0 && b === null && _n(), me && pn();
|
|
876
|
+
}
|
|
877
|
+
function Nn(n, t) {
|
|
878
|
+
var i = t.last;
|
|
879
|
+
i === null ? t.last = t.first = n : (i.next = n, n.prev = i, t.last = n);
|
|
880
|
+
}
|
|
881
|
+
function ye(n, t, i, s = !0) {
|
|
882
|
+
var l = b;
|
|
883
|
+
l !== null && (l.f & ee) !== 0 && (n |= ee);
|
|
884
|
+
var c = {
|
|
885
|
+
ctx: $,
|
|
886
|
+
deps: null,
|
|
887
|
+
nodes_start: null,
|
|
888
|
+
nodes_end: null,
|
|
889
|
+
f: n | z,
|
|
890
|
+
first: null,
|
|
891
|
+
fn: t,
|
|
892
|
+
last: null,
|
|
893
|
+
next: null,
|
|
894
|
+
parent: l,
|
|
895
|
+
b: l && l.b,
|
|
896
|
+
prev: null,
|
|
897
|
+
teardown: null,
|
|
898
|
+
transitions: null,
|
|
899
|
+
wv: 0,
|
|
900
|
+
ac: null
|
|
901
|
+
};
|
|
902
|
+
if (i)
|
|
903
|
+
try {
|
|
904
|
+
ke(c), c.f |= wt;
|
|
905
|
+
} catch (p) {
|
|
906
|
+
throw pe(c), p;
|
|
907
|
+
}
|
|
908
|
+
else t !== null && we(c);
|
|
909
|
+
if (s) {
|
|
910
|
+
var h = c;
|
|
911
|
+
if (i && h.deps === null && h.teardown === null && h.nodes_start === null && h.first === h.last && // either `null`, or a singular child
|
|
912
|
+
(h.f & Ze) === 0 && (h = h.first, (n & oe) !== 0 && (n & Oe) !== 0 && h !== null && (h.f |= Oe)), h !== null && (h.parent = l, l !== null && Nn(h, l), R !== null && (R.f & W) !== 0 && (n & Ae) === 0)) {
|
|
913
|
+
var u = (
|
|
914
|
+
/** @type {Derived} */
|
|
915
|
+
R
|
|
916
|
+
);
|
|
917
|
+
(u.effects ??= []).push(h);
|
|
918
|
+
}
|
|
254
919
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
920
|
+
return c;
|
|
921
|
+
}
|
|
922
|
+
function vr(n) {
|
|
923
|
+
const t = ye(vt, null, !1);
|
|
924
|
+
return j(t, q), t.teardown = n, t;
|
|
925
|
+
}
|
|
926
|
+
function ct(n) {
|
|
927
|
+
yr();
|
|
928
|
+
var t = (
|
|
929
|
+
/** @type {Effect} */
|
|
930
|
+
b.f
|
|
931
|
+
), i = !R && (t & se) !== 0 && (t & wt) === 0;
|
|
932
|
+
if (i) {
|
|
933
|
+
var s = (
|
|
934
|
+
/** @type {ComponentContext} */
|
|
935
|
+
$
|
|
936
|
+
);
|
|
937
|
+
(s.e ??= []).push(n);
|
|
938
|
+
} else
|
|
939
|
+
return gr(n);
|
|
940
|
+
}
|
|
941
|
+
function gr(n) {
|
|
942
|
+
return ye(yt | ir, n, !1);
|
|
943
|
+
}
|
|
944
|
+
function qn(n) {
|
|
945
|
+
return yr(), ye(vt | ir, n, !0);
|
|
946
|
+
}
|
|
947
|
+
function jn(n) {
|
|
948
|
+
return ye(yt, n, !1);
|
|
949
|
+
}
|
|
950
|
+
function Wn(n) {
|
|
951
|
+
return ye(mt | Ze, n, !0);
|
|
952
|
+
}
|
|
953
|
+
function Vn(n, t = [], i = [], s = []) {
|
|
954
|
+
An(s, t, i, (l) => {
|
|
955
|
+
ye(vt, () => n(...l.map(Z)), !0);
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
function Hn(n, t = 0) {
|
|
959
|
+
var i = ye(oe | t, n, !0);
|
|
960
|
+
return i;
|
|
961
|
+
}
|
|
962
|
+
function jt(n, t = !0) {
|
|
963
|
+
return ye(se | Ze, n, !0, t);
|
|
964
|
+
}
|
|
965
|
+
function wr(n) {
|
|
966
|
+
var t = n.teardown;
|
|
967
|
+
if (t !== null) {
|
|
968
|
+
const i = me, s = R;
|
|
969
|
+
Vt(!0), te(null);
|
|
970
|
+
try {
|
|
971
|
+
t.call(null);
|
|
972
|
+
} finally {
|
|
973
|
+
Vt(i), te(s);
|
|
974
|
+
}
|
|
261
975
|
}
|
|
262
976
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
977
|
+
function mr(n, t = !1) {
|
|
978
|
+
var i = n.first;
|
|
979
|
+
for (n.first = n.last = null; i !== null; ) {
|
|
980
|
+
const l = i.ac;
|
|
981
|
+
l !== null && St(() => {
|
|
982
|
+
l.abort(Ie);
|
|
983
|
+
});
|
|
984
|
+
var s = i.next;
|
|
985
|
+
(i.f & Ae) !== 0 ? i.parent = null : pe(i, t), i = s;
|
|
986
|
+
}
|
|
267
987
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
988
|
+
function zn(n) {
|
|
989
|
+
for (var t = n.first; t !== null; ) {
|
|
990
|
+
var i = t.next;
|
|
991
|
+
(t.f & se) === 0 && pe(t), t = i;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
function pe(n, t = !0) {
|
|
995
|
+
var i = !1;
|
|
996
|
+
(t || (n.f & cn) !== 0) && n.nodes_start !== null && n.nodes_end !== null && (Yn(
|
|
997
|
+
n.nodes_start,
|
|
998
|
+
/** @type {TemplateNode} */
|
|
999
|
+
n.nodes_end
|
|
1000
|
+
), i = !0), mr(n, t && !i), Xe(n, 0), j(n, ne);
|
|
1001
|
+
var s = n.transitions;
|
|
1002
|
+
if (s !== null)
|
|
1003
|
+
for (const c of s)
|
|
1004
|
+
c.stop();
|
|
1005
|
+
wr(n);
|
|
1006
|
+
var l = n.parent;
|
|
1007
|
+
l !== null && l.first !== null && Er(n), n.next = n.prev = n.teardown = n.ctx = n.deps = n.fn = n.nodes_start = n.nodes_end = n.ac = null;
|
|
1008
|
+
}
|
|
1009
|
+
function Yn(n, t) {
|
|
1010
|
+
for (; n !== null; ) {
|
|
1011
|
+
var i = n === t ? null : (
|
|
1012
|
+
/** @type {TemplateNode} */
|
|
1013
|
+
/* @__PURE__ */ It(n)
|
|
1014
|
+
);
|
|
1015
|
+
n.remove(), n = i;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
function Er(n) {
|
|
1019
|
+
var t = n.parent, i = n.prev, s = n.next;
|
|
1020
|
+
i !== null && (i.next = s), s !== null && (s.prev = i), t !== null && (t.first === n && (t.first = s), t.last === n && (t.last = i));
|
|
1021
|
+
}
|
|
1022
|
+
function Gn(n, t, i = !0) {
|
|
1023
|
+
var s = [];
|
|
1024
|
+
xr(n, s, !0), Qn(s, () => {
|
|
1025
|
+
i && pe(n), t && t();
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
function Qn(n, t) {
|
|
1029
|
+
var i = n.length;
|
|
1030
|
+
if (i > 0) {
|
|
1031
|
+
var s = () => --i || t();
|
|
1032
|
+
for (var l of n)
|
|
1033
|
+
l.out(s);
|
|
1034
|
+
} else
|
|
1035
|
+
t();
|
|
1036
|
+
}
|
|
1037
|
+
function xr(n, t, i) {
|
|
1038
|
+
if ((n.f & ee) === 0) {
|
|
1039
|
+
if (n.f ^= ee, n.transitions !== null)
|
|
1040
|
+
for (const h of n.transitions)
|
|
1041
|
+
(h.is_global || i) && t.push(h);
|
|
1042
|
+
for (var s = n.first; s !== null; ) {
|
|
1043
|
+
var l = s.next, c = (s.f & Oe) !== 0 || // If this is a branch effect without a block effect parent,
|
|
1044
|
+
// it means the parent block effect was pruned. In that case,
|
|
1045
|
+
// transparency information was transferred to the branch effect.
|
|
1046
|
+
(s.f & se) !== 0 && (n.f & oe) !== 0;
|
|
1047
|
+
xr(s, t, c ? i : !1), s = l;
|
|
289
1048
|
}
|
|
290
|
-
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
function Kn(n) {
|
|
1052
|
+
Br(n, !0);
|
|
1053
|
+
}
|
|
1054
|
+
function Br(n, t) {
|
|
1055
|
+
if ((n.f & ee) !== 0) {
|
|
1056
|
+
n.f ^= ee, (n.f & q) === 0 && (j(n, z), we(n));
|
|
1057
|
+
for (var i = n.first; i !== null; ) {
|
|
1058
|
+
var s = i.next, l = (i.f & Oe) !== 0 || (i.f & se) !== 0;
|
|
1059
|
+
Br(i, l ? t : !1), i = s;
|
|
1060
|
+
}
|
|
1061
|
+
if (n.transitions !== null)
|
|
1062
|
+
for (const c of n.transitions)
|
|
1063
|
+
(c.is_global || t) && c.in();
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
function Jn(n, t) {
|
|
1067
|
+
for (var i = n.nodes_start, s = n.nodes_end; i !== null; ) {
|
|
1068
|
+
var l = i === s ? null : (
|
|
1069
|
+
/** @type {TemplateNode} */
|
|
1070
|
+
/* @__PURE__ */ It(i)
|
|
1071
|
+
);
|
|
1072
|
+
t.append(i), i = l;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
let be = !1;
|
|
1076
|
+
function Wt(n) {
|
|
1077
|
+
be = n;
|
|
1078
|
+
}
|
|
1079
|
+
let me = !1;
|
|
1080
|
+
function Vt(n) {
|
|
1081
|
+
me = n;
|
|
1082
|
+
}
|
|
1083
|
+
let R = null, X = !1;
|
|
1084
|
+
function te(n) {
|
|
1085
|
+
R = n;
|
|
1086
|
+
}
|
|
1087
|
+
let b = null;
|
|
1088
|
+
function _e(n) {
|
|
1089
|
+
b = n;
|
|
1090
|
+
}
|
|
1091
|
+
let ie = null;
|
|
1092
|
+
function Xn(n) {
|
|
1093
|
+
R !== null && (ie === null ? ie = [n] : ie.push(n));
|
|
291
1094
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
1095
|
+
let V = null, Y = 0, G = null;
|
|
1096
|
+
function Zn(n) {
|
|
1097
|
+
G = n;
|
|
1098
|
+
}
|
|
1099
|
+
let Ir = 1, De = 0, ge = De;
|
|
1100
|
+
function Ht(n) {
|
|
1101
|
+
ge = n;
|
|
1102
|
+
}
|
|
1103
|
+
let he = !1;
|
|
1104
|
+
function Sr() {
|
|
1105
|
+
return ++Ir;
|
|
1106
|
+
}
|
|
1107
|
+
function $e(n) {
|
|
1108
|
+
var t = n.f;
|
|
1109
|
+
if ((t & z) !== 0)
|
|
1110
|
+
return !0;
|
|
1111
|
+
if ((t & ae) !== 0) {
|
|
1112
|
+
var i = n.deps, s = (t & Q) !== 0;
|
|
1113
|
+
if (t & W && (n.f &= ~Ge), i !== null) {
|
|
1114
|
+
var l, c, h = (t & Ye) !== 0, u = s && b !== null && !he, p = i.length;
|
|
1115
|
+
if ((h || u) && (b === null || (b.f & ne) === 0)) {
|
|
1116
|
+
var _ = (
|
|
1117
|
+
/** @type {Derived} */
|
|
1118
|
+
n
|
|
1119
|
+
), g = _.parent;
|
|
1120
|
+
for (l = 0; l < p; l++)
|
|
1121
|
+
c = i[l], (h || !c?.reactions?.includes(_)) && (c.reactions ??= []).push(_);
|
|
1122
|
+
h && (_.f ^= Ye), u && g !== null && (g.f & Q) === 0 && (_.f ^= Q);
|
|
1123
|
+
}
|
|
1124
|
+
for (l = 0; l < p; l++)
|
|
1125
|
+
if (c = i[l], $e(
|
|
1126
|
+
/** @type {Derived} */
|
|
1127
|
+
c
|
|
1128
|
+
) && hr(
|
|
1129
|
+
/** @type {Derived} */
|
|
1130
|
+
c
|
|
1131
|
+
), c.wv > n.wv)
|
|
1132
|
+
return !0;
|
|
1133
|
+
}
|
|
1134
|
+
(!s || b !== null && !he) && j(n, q);
|
|
1135
|
+
}
|
|
1136
|
+
return !1;
|
|
1137
|
+
}
|
|
1138
|
+
function Fr(n, t, i = !0) {
|
|
1139
|
+
var s = n.reactions;
|
|
1140
|
+
if (s !== null && !ie?.includes(n))
|
|
1141
|
+
for (var l = 0; l < s.length; l++) {
|
|
1142
|
+
var c = s[l];
|
|
1143
|
+
(c.f & W) !== 0 ? Fr(
|
|
1144
|
+
/** @type {Derived} */
|
|
1145
|
+
c,
|
|
1146
|
+
t,
|
|
1147
|
+
!1
|
|
1148
|
+
) : t === c && (i ? j(c, z) : (c.f & q) !== 0 && j(c, ae), we(
|
|
1149
|
+
/** @type {Effect} */
|
|
1150
|
+
c
|
|
1151
|
+
));
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
function Rr(n) {
|
|
1155
|
+
var t = V, i = Y, s = G, l = R, c = he, h = ie, u = $, p = X, _ = ge, g = n.f;
|
|
1156
|
+
V = /** @type {null | Value[]} */
|
|
1157
|
+
null, Y = 0, G = null, he = (g & Q) !== 0 && (X || !be || R === null), R = (g & (se | Ae)) === 0 ? n : null, ie = null, Qe(n.ctx), X = !1, ge = ++De, n.ac !== null && (St(() => {
|
|
1158
|
+
n.ac.abort(Ie);
|
|
1159
|
+
}), n.ac = null);
|
|
1160
|
+
try {
|
|
1161
|
+
n.f |= st;
|
|
1162
|
+
var E = (
|
|
1163
|
+
/** @type {Function} */
|
|
1164
|
+
n.fn
|
|
1165
|
+
), m = E(), v = n.deps;
|
|
1166
|
+
if (V !== null) {
|
|
1167
|
+
var w;
|
|
1168
|
+
if (Xe(n, Y), v !== null && Y > 0)
|
|
1169
|
+
for (v.length = Y + V.length, w = 0; w < V.length; w++)
|
|
1170
|
+
v[Y + w] = V[w];
|
|
1171
|
+
else
|
|
1172
|
+
n.deps = v = V;
|
|
1173
|
+
if (!he || // Deriveds that already have reactions can cleanup, so we still add them as reactions
|
|
1174
|
+
(g & W) !== 0 && /** @type {import('#client').Derived} */
|
|
1175
|
+
n.reactions !== null)
|
|
1176
|
+
for (w = Y; w < v.length; w++)
|
|
1177
|
+
(v[w].reactions ??= []).push(n);
|
|
1178
|
+
} else v !== null && Y < v.length && (Xe(n, Y), v.length = Y);
|
|
1179
|
+
if (Pe() && G !== null && !X && v !== null && (n.f & (W | ae | z)) === 0)
|
|
1180
|
+
for (w = 0; w < /** @type {Source[]} */
|
|
1181
|
+
G.length; w++)
|
|
1182
|
+
Fr(
|
|
1183
|
+
G[w],
|
|
1184
|
+
/** @type {Effect} */
|
|
1185
|
+
n
|
|
1186
|
+
);
|
|
1187
|
+
return l !== null && l !== n && (De++, G !== null && (s === null ? s = G : s.push(.../** @type {Source[]} */
|
|
1188
|
+
G))), (n.f & ve) !== 0 && (n.f ^= ve), m;
|
|
1189
|
+
} catch (x) {
|
|
1190
|
+
return Fn(x);
|
|
1191
|
+
} finally {
|
|
1192
|
+
n.f ^= st, V = t, Y = i, G = s, R = l, he = c, ie = h, Qe(u), X = p, ge = _;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
function ei(n, t) {
|
|
1196
|
+
let i = t.reactions;
|
|
1197
|
+
if (i !== null) {
|
|
1198
|
+
var s = sn.call(i, n);
|
|
1199
|
+
if (s !== -1) {
|
|
1200
|
+
var l = i.length - 1;
|
|
1201
|
+
l === 0 ? i = t.reactions = null : (i[s] = i[l], i.pop());
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
i === null && (t.f & W) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1205
|
+
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1206
|
+
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1207
|
+
(V === null || !V.includes(t)) && (j(t, ae), (t.f & (Q | Ye)) === 0 && (t.f ^= Ye), cr(
|
|
1208
|
+
/** @type {Derived} **/
|
|
1209
|
+
t
|
|
1210
|
+
), Xe(
|
|
1211
|
+
/** @type {Derived} **/
|
|
1212
|
+
t,
|
|
1213
|
+
0
|
|
1214
|
+
));
|
|
1215
|
+
}
|
|
1216
|
+
function Xe(n, t) {
|
|
1217
|
+
var i = n.deps;
|
|
1218
|
+
if (i !== null)
|
|
1219
|
+
for (var s = t; s < i.length; s++)
|
|
1220
|
+
ei(n, i[s]);
|
|
1221
|
+
}
|
|
1222
|
+
function ke(n) {
|
|
1223
|
+
var t = n.f;
|
|
1224
|
+
if ((t & ne) === 0) {
|
|
1225
|
+
j(n, q);
|
|
1226
|
+
var i = b, s = be;
|
|
1227
|
+
b = n, be = !0;
|
|
1228
|
+
try {
|
|
1229
|
+
(t & oe) !== 0 ? zn(n) : mr(n), wr(n);
|
|
1230
|
+
var l = Rr(n);
|
|
1231
|
+
n.teardown = typeof l == "function" ? l : null, n.wv = Ir;
|
|
1232
|
+
var c;
|
|
1233
|
+
tr && Kr && (n.f & z) !== 0 && n.deps;
|
|
1234
|
+
} finally {
|
|
1235
|
+
be = s, b = i;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
function Z(n) {
|
|
1240
|
+
var t = n.f, i = (t & W) !== 0;
|
|
1241
|
+
if (R !== null && !X) {
|
|
1242
|
+
var s = b !== null && (b.f & ne) !== 0;
|
|
1243
|
+
if (!s && !ie?.includes(n)) {
|
|
1244
|
+
var l = R.deps;
|
|
1245
|
+
if ((R.f & st) !== 0)
|
|
1246
|
+
n.rv < De && (n.rv = De, V === null && l !== null && l[Y] === n ? Y++ : V === null ? V = [n] : (!he || !V.includes(n)) && V.push(n));
|
|
1247
|
+
else {
|
|
1248
|
+
(R.deps ??= []).push(n);
|
|
1249
|
+
var c = n.reactions;
|
|
1250
|
+
c === null ? n.reactions = [R] : c.includes(R) || c.push(R);
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
} else if (i && /** @type {Derived} */
|
|
1254
|
+
n.deps === null && /** @type {Derived} */
|
|
1255
|
+
n.effects === null) {
|
|
1256
|
+
var h = (
|
|
1257
|
+
/** @type {Derived} */
|
|
1258
|
+
n
|
|
1259
|
+
), u = h.parent;
|
|
1260
|
+
u !== null && (u.f & Q) === 0 && (h.f ^= Q);
|
|
1261
|
+
}
|
|
1262
|
+
if (me) {
|
|
1263
|
+
if (de.has(n))
|
|
1264
|
+
return de.get(n);
|
|
1265
|
+
if (i) {
|
|
1266
|
+
h = /** @type {Derived} */
|
|
1267
|
+
n;
|
|
1268
|
+
var p = h.v;
|
|
1269
|
+
return ((h.f & q) === 0 && h.reactions !== null || br(h)) && (p = Bt(h)), de.set(h, p), p;
|
|
1270
|
+
}
|
|
1271
|
+
} else if (i) {
|
|
1272
|
+
if (h = /** @type {Derived} */
|
|
1273
|
+
n, K?.has(h))
|
|
1274
|
+
return K.get(h);
|
|
1275
|
+
$e(h) && hr(h);
|
|
1276
|
+
}
|
|
1277
|
+
if (K?.has(n))
|
|
1278
|
+
return K.get(n);
|
|
1279
|
+
if ((n.f & ve) !== 0)
|
|
1280
|
+
throw n.v;
|
|
1281
|
+
return n.v;
|
|
1282
|
+
}
|
|
1283
|
+
function br(n) {
|
|
1284
|
+
if (n.v === N) return !0;
|
|
1285
|
+
if (n.deps === null) return !1;
|
|
1286
|
+
for (const t of n.deps)
|
|
1287
|
+
if (de.has(t) || (t.f & W) !== 0 && br(
|
|
1288
|
+
/** @type {Derived} */
|
|
1289
|
+
t
|
|
1290
|
+
))
|
|
1291
|
+
return !0;
|
|
1292
|
+
return !1;
|
|
1293
|
+
}
|
|
1294
|
+
function Me(n) {
|
|
1295
|
+
var t = X;
|
|
1296
|
+
try {
|
|
1297
|
+
return X = !0, n();
|
|
1298
|
+
} finally {
|
|
1299
|
+
X = t;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
const ti = -7169;
|
|
1303
|
+
function j(n, t) {
|
|
1304
|
+
n.f = n.f & ti | t;
|
|
1305
|
+
}
|
|
1306
|
+
function ht(n) {
|
|
1307
|
+
if (!(typeof n != "object" || !n || n instanceof EventTarget)) {
|
|
1308
|
+
if (Re in n)
|
|
1309
|
+
dt(n);
|
|
1310
|
+
else if (!Array.isArray(n))
|
|
1311
|
+
for (let t in n) {
|
|
1312
|
+
const i = n[t];
|
|
1313
|
+
typeof i == "object" && i && Re in i && dt(i);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
function dt(n, t = /* @__PURE__ */ new Set()) {
|
|
1318
|
+
if (typeof n == "object" && n !== null && // We don't want to traverse DOM elements
|
|
1319
|
+
!(n instanceof EventTarget) && !t.has(n)) {
|
|
1320
|
+
t.add(n), n instanceof Date && n.getTime();
|
|
1321
|
+
for (let s in n)
|
|
1322
|
+
try {
|
|
1323
|
+
dt(n[s], t);
|
|
1324
|
+
} catch {
|
|
1325
|
+
}
|
|
1326
|
+
const i = _t(n);
|
|
1327
|
+
if (i !== Object.prototype && i !== Array.prototype && i !== Map.prototype && i !== Set.prototype && i !== Date.prototype) {
|
|
1328
|
+
const s = rr(i);
|
|
1329
|
+
for (let l in s) {
|
|
1330
|
+
const c = s[l].get;
|
|
1331
|
+
if (c)
|
|
1332
|
+
try {
|
|
1333
|
+
c.call(n);
|
|
1334
|
+
} catch {
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
function ri(n, t, i, s = {}) {
|
|
1341
|
+
function l(c) {
|
|
1342
|
+
if (s.capture || ii.call(t, c), !c.cancelBubble)
|
|
1343
|
+
return St(() => i?.call(this, c));
|
|
1344
|
+
}
|
|
1345
|
+
return n.startsWith("pointer") || n.startsWith("touch") || n === "wheel" ? ar(() => {
|
|
1346
|
+
t.addEventListener(n, l, s);
|
|
1347
|
+
}) : t.addEventListener(n, l, s), l;
|
|
1348
|
+
}
|
|
1349
|
+
function ni(n, t, i, s, l) {
|
|
1350
|
+
var c = { capture: s, passive: l }, h = ri(n, t, i, c);
|
|
1351
|
+
(t === document.body || // @ts-ignore
|
|
1352
|
+
t === window || // @ts-ignore
|
|
1353
|
+
t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
|
|
1354
|
+
t instanceof HTMLMediaElement) && vr(() => {
|
|
1355
|
+
t.removeEventListener(n, h, c);
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
let zt = null;
|
|
1359
|
+
function ii(n) {
|
|
1360
|
+
var t = this, i = (
|
|
1361
|
+
/** @type {Node} */
|
|
1362
|
+
t.ownerDocument
|
|
1363
|
+
), s = n.type, l = n.composedPath?.() || [], c = (
|
|
1364
|
+
/** @type {null | Element} */
|
|
1365
|
+
l[0] || n.target
|
|
1366
|
+
);
|
|
1367
|
+
zt = n;
|
|
1368
|
+
var h = 0, u = zt === n && n.__root;
|
|
1369
|
+
if (u) {
|
|
1370
|
+
var p = l.indexOf(u);
|
|
1371
|
+
if (p !== -1 && (t === document || t === /** @type {any} */
|
|
1372
|
+
window)) {
|
|
1373
|
+
n.__root = t;
|
|
1374
|
+
return;
|
|
332
1375
|
}
|
|
1376
|
+
var _ = l.indexOf(t);
|
|
1377
|
+
if (_ === -1)
|
|
1378
|
+
return;
|
|
1379
|
+
p <= _ && (h = p);
|
|
1380
|
+
}
|
|
1381
|
+
if (c = /** @type {Element} */
|
|
1382
|
+
l[h] || n.target, c !== t) {
|
|
1383
|
+
an(n, "currentTarget", {
|
|
1384
|
+
configurable: !0,
|
|
1385
|
+
get() {
|
|
1386
|
+
return c || i;
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
var g = R, E = b;
|
|
1390
|
+
te(null), _e(null);
|
|
1391
|
+
try {
|
|
1392
|
+
for (var m, v = []; c !== null; ) {
|
|
1393
|
+
var w = c.assignedSlot || c.parentNode || /** @type {any} */
|
|
1394
|
+
c.host || null;
|
|
1395
|
+
try {
|
|
1396
|
+
var x = c["__" + s];
|
|
1397
|
+
x != null && (!/** @type {any} */
|
|
1398
|
+
c.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1399
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
1400
|
+
n.target === c) && x.call(c, n);
|
|
1401
|
+
} catch (S) {
|
|
1402
|
+
m ? v.push(S) : m = S;
|
|
1403
|
+
}
|
|
1404
|
+
if (n.cancelBubble || w === t || w === null)
|
|
1405
|
+
break;
|
|
1406
|
+
c = w;
|
|
1407
|
+
}
|
|
1408
|
+
if (m) {
|
|
1409
|
+
for (let S of v)
|
|
1410
|
+
queueMicrotask(() => {
|
|
1411
|
+
throw S;
|
|
1412
|
+
});
|
|
1413
|
+
throw m;
|
|
1414
|
+
}
|
|
1415
|
+
} finally {
|
|
1416
|
+
n.__root = t, delete n.currentTarget, te(g), _e(E);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
function oi(n) {
|
|
1421
|
+
var t = document.createElement("template");
|
|
1422
|
+
return t.innerHTML = n.replaceAll("<!>", "<!---->"), t.content;
|
|
1423
|
+
}
|
|
1424
|
+
function Yt(n, t) {
|
|
1425
|
+
var i = (
|
|
1426
|
+
/** @type {Effect} */
|
|
1427
|
+
b
|
|
1428
|
+
);
|
|
1429
|
+
i.nodes_start === null && (i.nodes_start = n, i.nodes_end = t);
|
|
1430
|
+
}
|
|
1431
|
+
// @__NO_SIDE_EFFECTS__
|
|
1432
|
+
function Ar(n, t) {
|
|
1433
|
+
var i = (t & tn) !== 0, s = (t & rn) !== 0, l, c = !n.startsWith("<!>");
|
|
1434
|
+
return () => {
|
|
1435
|
+
l === void 0 && (l = oi(c ? n : "<!>" + n), i || (l = /** @type {Node} */
|
|
1436
|
+
/* @__PURE__ */ ft(l)));
|
|
1437
|
+
var h = (
|
|
1438
|
+
/** @type {TemplateNode} */
|
|
1439
|
+
s || Dn ? document.importNode(l, !0) : l.cloneNode(!0)
|
|
1440
|
+
);
|
|
1441
|
+
if (i) {
|
|
1442
|
+
var u = (
|
|
1443
|
+
/** @type {TemplateNode} */
|
|
1444
|
+
/* @__PURE__ */ ft(h)
|
|
1445
|
+
), p = (
|
|
1446
|
+
/** @type {TemplateNode} */
|
|
1447
|
+
h.lastChild
|
|
1448
|
+
);
|
|
1449
|
+
Yt(u, p);
|
|
1450
|
+
} else
|
|
1451
|
+
Yt(h, h);
|
|
1452
|
+
return h;
|
|
333
1453
|
};
|
|
334
1454
|
}
|
|
335
|
-
function
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
1455
|
+
function Cr(n, t) {
|
|
1456
|
+
n !== null && n.before(
|
|
1457
|
+
/** @type {Node} */
|
|
1458
|
+
t
|
|
339
1459
|
);
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
i
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
1460
|
+
}
|
|
1461
|
+
class si {
|
|
1462
|
+
/** @type {TemplateNode} */
|
|
1463
|
+
anchor;
|
|
1464
|
+
/** @type {Map<Batch, Key>} */
|
|
1465
|
+
#t = /* @__PURE__ */ new Map();
|
|
1466
|
+
/** @type {Map<Key, Effect>} */
|
|
1467
|
+
#r = /* @__PURE__ */ new Map();
|
|
1468
|
+
/** @type {Map<Key, Branch>} */
|
|
1469
|
+
#e = /* @__PURE__ */ new Map();
|
|
1470
|
+
/**
|
|
1471
|
+
* Whether to pause (i.e. outro) on change, or destroy immediately.
|
|
1472
|
+
* This is necessary for `<svelte:element>`
|
|
1473
|
+
*/
|
|
1474
|
+
#n = !0;
|
|
1475
|
+
/**
|
|
1476
|
+
* @param {TemplateNode} anchor
|
|
1477
|
+
* @param {boolean} transition
|
|
1478
|
+
*/
|
|
1479
|
+
constructor(t, i = !0) {
|
|
1480
|
+
this.anchor = t, this.#n = i;
|
|
1481
|
+
}
|
|
1482
|
+
#o = () => {
|
|
1483
|
+
var t = (
|
|
1484
|
+
/** @type {Batch} */
|
|
1485
|
+
P
|
|
1486
|
+
);
|
|
1487
|
+
if (this.#t.has(t)) {
|
|
1488
|
+
var i = (
|
|
1489
|
+
/** @type {Key} */
|
|
1490
|
+
this.#t.get(t)
|
|
1491
|
+
), s = this.#r.get(i);
|
|
1492
|
+
if (s)
|
|
1493
|
+
Kn(s);
|
|
1494
|
+
else {
|
|
1495
|
+
var l = this.#e.get(i);
|
|
1496
|
+
l && (this.#r.set(i, l.effect), this.#e.delete(i), l.fragment.lastChild.remove(), this.anchor.before(l.fragment), s = l.effect);
|
|
1497
|
+
}
|
|
1498
|
+
for (const [c, h] of this.#t) {
|
|
1499
|
+
if (this.#t.delete(c), c === t)
|
|
1500
|
+
break;
|
|
1501
|
+
const u = this.#e.get(h);
|
|
1502
|
+
u && (pe(u.effect), this.#e.delete(h));
|
|
1503
|
+
}
|
|
1504
|
+
for (const [c, h] of this.#r) {
|
|
1505
|
+
if (c === i) continue;
|
|
1506
|
+
const u = () => {
|
|
1507
|
+
if (Array.from(this.#t.values()).includes(c)) {
|
|
1508
|
+
var _ = document.createDocumentFragment();
|
|
1509
|
+
Jn(h, _), _.append(qt()), this.#e.set(c, { effect: h, fragment: _ });
|
|
1510
|
+
} else
|
|
1511
|
+
pe(h);
|
|
1512
|
+
this.#r.delete(c);
|
|
1513
|
+
};
|
|
1514
|
+
this.#n || !s ? Gn(h, u, !1) : u();
|
|
1515
|
+
}
|
|
368
1516
|
}
|
|
369
1517
|
};
|
|
1518
|
+
/**
|
|
1519
|
+
* @param {Batch} batch
|
|
1520
|
+
*/
|
|
1521
|
+
#s = (t) => {
|
|
1522
|
+
this.#t.delete(t);
|
|
1523
|
+
const i = Array.from(this.#t.values());
|
|
1524
|
+
for (const [s, l] of this.#e)
|
|
1525
|
+
i.includes(s) || (pe(l.effect), this.#e.delete(s));
|
|
1526
|
+
};
|
|
1527
|
+
/**
|
|
1528
|
+
*
|
|
1529
|
+
* @param {any} key
|
|
1530
|
+
* @param {null | ((target: TemplateNode) => void)} fn
|
|
1531
|
+
*/
|
|
1532
|
+
ensure(t, i) {
|
|
1533
|
+
var s = (
|
|
1534
|
+
/** @type {Batch} */
|
|
1535
|
+
P
|
|
1536
|
+
), l = $n();
|
|
1537
|
+
if (i && !this.#r.has(t) && !this.#e.has(t))
|
|
1538
|
+
if (l) {
|
|
1539
|
+
var c = document.createDocumentFragment(), h = qt();
|
|
1540
|
+
c.append(h), this.#e.set(t, {
|
|
1541
|
+
effect: jt(() => i(h)),
|
|
1542
|
+
fragment: c
|
|
1543
|
+
});
|
|
1544
|
+
} else
|
|
1545
|
+
this.#r.set(
|
|
1546
|
+
t,
|
|
1547
|
+
jt(() => i(this.anchor))
|
|
1548
|
+
);
|
|
1549
|
+
if (this.#t.set(s, t), l) {
|
|
1550
|
+
for (const [u, p] of this.#r)
|
|
1551
|
+
u === t ? s.skipped_effects.delete(p) : s.skipped_effects.add(p);
|
|
1552
|
+
for (const [u, p] of this.#e)
|
|
1553
|
+
u === t ? s.skipped_effects.delete(p.effect) : s.skipped_effects.add(p.effect);
|
|
1554
|
+
s.oncommit(this.#o), s.ondiscard(this.#s);
|
|
1555
|
+
} else
|
|
1556
|
+
this.#o();
|
|
1557
|
+
}
|
|
370
1558
|
}
|
|
371
|
-
function
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
class Nt extends Qe {
|
|
378
|
-
constructor(r) {
|
|
379
|
-
super(), ze(
|
|
380
|
-
this,
|
|
381
|
-
r,
|
|
382
|
-
Pt,
|
|
383
|
-
kt,
|
|
384
|
-
Ne,
|
|
385
|
-
{
|
|
386
|
-
close: 0,
|
|
387
|
-
isCloseButton: 1,
|
|
388
|
-
scannerElements: 2
|
|
389
|
-
},
|
|
390
|
-
bt
|
|
1559
|
+
function ai(n) {
|
|
1560
|
+
$ === null && or(), Le && $.l !== null ? ui($).m.push(n) : ct(() => {
|
|
1561
|
+
const t = Me(n);
|
|
1562
|
+
if (typeof t == "function") return (
|
|
1563
|
+
/** @type {() => void} */
|
|
1564
|
+
t
|
|
391
1565
|
);
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
function li(n) {
|
|
1569
|
+
$ === null && or(), ai(() => () => Me(n));
|
|
1570
|
+
}
|
|
1571
|
+
function ui(n) {
|
|
1572
|
+
var t = (
|
|
1573
|
+
/** @type {ComponentContextLegacy} */
|
|
1574
|
+
n.l
|
|
1575
|
+
);
|
|
1576
|
+
return t.u ??= { a: [], b: [], m: [] };
|
|
1577
|
+
}
|
|
1578
|
+
function fi(n, t, i = !1) {
|
|
1579
|
+
var s = new si(n), l = i ? Oe : 0;
|
|
1580
|
+
function c(h, u) {
|
|
1581
|
+
s.ensure(h, u);
|
|
1582
|
+
}
|
|
1583
|
+
Hn(() => {
|
|
1584
|
+
var h = !1;
|
|
1585
|
+
t((u, p = !0) => {
|
|
1586
|
+
h = !0, c(p, u);
|
|
1587
|
+
}), h || c(!1, null);
|
|
1588
|
+
}, l);
|
|
1589
|
+
}
|
|
1590
|
+
function Tr(n, t) {
|
|
1591
|
+
jn(() => {
|
|
1592
|
+
var i = n.getRootNode(), s = (
|
|
1593
|
+
/** @type {ShadowRoot} */
|
|
1594
|
+
i.host ? (
|
|
1595
|
+
/** @type {ShadowRoot} */
|
|
1596
|
+
i
|
|
1597
|
+
) : (
|
|
1598
|
+
/** @type {Document} */
|
|
1599
|
+
i.head ?? /** @type {Document} */
|
|
1600
|
+
i.ownerDocument.head
|
|
1601
|
+
)
|
|
1602
|
+
);
|
|
1603
|
+
if (!s.querySelector("#" + t.hash)) {
|
|
1604
|
+
const l = document.createElement("style");
|
|
1605
|
+
l.id = t.hash, l.textContent = t.code, s.appendChild(l);
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
const ci = Symbol("is custom element"), hi = Symbol("is html");
|
|
1610
|
+
function Gt(n, t, i, s) {
|
|
1611
|
+
var l = di(n);
|
|
1612
|
+
l[t] !== (l[t] = i) && (i == null ? n.removeAttribute(t) : typeof i != "string" && pi(n).includes(t) ? n[t] = i : n.setAttribute(t, i));
|
|
1613
|
+
}
|
|
1614
|
+
function di(n) {
|
|
1615
|
+
return (
|
|
1616
|
+
/** @type {Record<string | symbol, unknown>} **/
|
|
1617
|
+
// @ts-expect-error
|
|
1618
|
+
n.__attributes ??= {
|
|
1619
|
+
[ci]: n.nodeName.includes("-"),
|
|
1620
|
+
[hi]: n.namespaceURI === nn
|
|
1621
|
+
}
|
|
1622
|
+
);
|
|
1623
|
+
}
|
|
1624
|
+
var Qt = /* @__PURE__ */ new Map();
|
|
1625
|
+
function pi(n) {
|
|
1626
|
+
var t = n.getAttribute("is") || n.nodeName, i = Qt.get(t);
|
|
1627
|
+
if (i) return i;
|
|
1628
|
+
Qt.set(t, i = []);
|
|
1629
|
+
for (var s, l = n, c = Element.prototype; c !== l; ) {
|
|
1630
|
+
s = rr(l);
|
|
1631
|
+
for (var h in s)
|
|
1632
|
+
s[h].set && i.push(h);
|
|
1633
|
+
l = _t(l);
|
|
1634
|
+
}
|
|
1635
|
+
return i;
|
|
1636
|
+
}
|
|
1637
|
+
function _i(n = !1) {
|
|
1638
|
+
const t = (
|
|
1639
|
+
/** @type {ComponentContextLegacy} */
|
|
1640
|
+
$
|
|
1641
|
+
), i = t.l.u;
|
|
1642
|
+
if (!i) return;
|
|
1643
|
+
let s = () => ht(t.s);
|
|
1644
|
+
if (n) {
|
|
1645
|
+
let l = 0, c = (
|
|
1646
|
+
/** @type {Record<string, any>} */
|
|
1647
|
+
{}
|
|
1648
|
+
);
|
|
1649
|
+
const h = /* @__PURE__ */ xt(() => {
|
|
1650
|
+
let u = !1;
|
|
1651
|
+
const p = t.s;
|
|
1652
|
+
for (const _ in p)
|
|
1653
|
+
p[_] !== c[_] && (c[_] = p[_], u = !0);
|
|
1654
|
+
return u && l++, l;
|
|
1655
|
+
});
|
|
1656
|
+
s = () => Z(h);
|
|
1657
|
+
}
|
|
1658
|
+
i.b.length && qn(() => {
|
|
1659
|
+
Kt(t, s), ot(i.b);
|
|
1660
|
+
}), ct(() => {
|
|
1661
|
+
const l = Me(() => i.m.map(fn));
|
|
1662
|
+
return () => {
|
|
1663
|
+
for (const c of l)
|
|
1664
|
+
typeof c == "function" && c();
|
|
1665
|
+
};
|
|
1666
|
+
}), i.a.length && ct(() => {
|
|
1667
|
+
Kt(t, s), ot(i.a);
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
function Kt(n, t) {
|
|
1671
|
+
if (n.l.s)
|
|
1672
|
+
for (const i of n.l.s) Z(i);
|
|
1673
|
+
t();
|
|
1674
|
+
}
|
|
1675
|
+
let je = !1;
|
|
1676
|
+
function yi(n) {
|
|
1677
|
+
var t = je;
|
|
1678
|
+
try {
|
|
1679
|
+
return je = !1, [n(), je];
|
|
1680
|
+
} finally {
|
|
1681
|
+
je = t;
|
|
392
1682
|
}
|
|
393
1683
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
return (B ? -1 : 1) * p * Math.pow(2, d - h);
|
|
1684
|
+
function He(n, t, i, s) {
|
|
1685
|
+
var l = !Le || (i & Xr) !== 0, c = (i & en) !== 0, h = (
|
|
1686
|
+
/** @type {V} */
|
|
1687
|
+
s
|
|
1688
|
+
), u = !0, p = () => (u && (u = !1, h = /** @type {V} */
|
|
1689
|
+
s), h), _;
|
|
1690
|
+
{
|
|
1691
|
+
var g = Re in n || hn in n;
|
|
1692
|
+
_ = Ve(n, t)?.set ?? (g && t in n ? (B) => n[t] = B : void 0);
|
|
1693
|
+
}
|
|
1694
|
+
var E, m = !1;
|
|
1695
|
+
[E, m] = yi(() => (
|
|
1696
|
+
/** @type {V} */
|
|
1697
|
+
n[t]
|
|
1698
|
+
));
|
|
1699
|
+
var v;
|
|
1700
|
+
if (l ? v = () => {
|
|
1701
|
+
var B = (
|
|
1702
|
+
/** @type {V} */
|
|
1703
|
+
n[t]
|
|
1704
|
+
);
|
|
1705
|
+
return B === void 0 ? p() : (u = !0, B);
|
|
1706
|
+
} : v = () => {
|
|
1707
|
+
var B = (
|
|
1708
|
+
/** @type {V} */
|
|
1709
|
+
n[t]
|
|
1710
|
+
);
|
|
1711
|
+
return B !== void 0 && (h = /** @type {V} */
|
|
1712
|
+
void 0), B === void 0 ? h : B;
|
|
1713
|
+
}, l && (i & Zr) === 0)
|
|
1714
|
+
return v;
|
|
1715
|
+
if (_) {
|
|
1716
|
+
var w = n.$$legacy;
|
|
1717
|
+
return (
|
|
1718
|
+
/** @type {() => V} */
|
|
1719
|
+
(function(B, T) {
|
|
1720
|
+
return arguments.length > 0 ? ((!l || !T || w || m) && _(T ? v() : B), B) : v();
|
|
1721
|
+
})
|
|
1722
|
+
);
|
|
1723
|
+
}
|
|
1724
|
+
var x = !1, S = /* @__PURE__ */ fr(() => (x = !1, v()));
|
|
1725
|
+
Z(S);
|
|
1726
|
+
var A = (
|
|
1727
|
+
/** @type {Effect} */
|
|
1728
|
+
b
|
|
1729
|
+
);
|
|
1730
|
+
return (
|
|
1731
|
+
/** @type {() => V} */
|
|
1732
|
+
(function(B, T) {
|
|
1733
|
+
if (arguments.length > 0) {
|
|
1734
|
+
const M = T ? Z(S) : l && c ? Fe(B) : B;
|
|
1735
|
+
return fe(S, M), x = !0, h !== void 0 && (h = M), B;
|
|
1736
|
+
}
|
|
1737
|
+
return me && x || (A.f & ne) !== 0 ? S.v : Z(S);
|
|
1738
|
+
})
|
|
1739
|
+
);
|
|
1740
|
+
}
|
|
1741
|
+
var vi = /* @__PURE__ */ Ar('<div class="cscanapp-close svelte-degygl" role="button" tabindex="0"></div>');
|
|
1742
|
+
const gi = {
|
|
1743
|
+
hash: "svelte-degygl",
|
|
1744
|
+
code: `.cscanapp-close.svelte-degygl {position:absolute;z-index:10;right:5px;top:5px;width:32px;height:32px;opacity:0.3;cursor:pointer;}.cscanapp-close.svelte-degygl:hover {opacity:1;}.cscanapp-close.svelte-degygl:before,
|
|
1745
|
+
.cscanapp-close.svelte-degygl:after {position:absolute;left:15px;content:' ';height:33px;width:2px;background-color:#000;}.cscanapp-close.svelte-degygl:before {transform:rotate(45deg);}.cscanapp-close.svelte-degygl:after {transform:rotate(-45deg);}`
|
|
458
1746
|
};
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
;
|
|
465
|
-
|
|
1747
|
+
function wi(n, t) {
|
|
1748
|
+
Tr(n, gi);
|
|
1749
|
+
let i = He(t, "close", 8);
|
|
1750
|
+
var s = vi();
|
|
1751
|
+
ni("click", s, function(...l) {
|
|
1752
|
+
i()?.apply(this, l);
|
|
1753
|
+
}), Cr(n, s);
|
|
1754
|
+
}
|
|
1755
|
+
var mi = /* @__PURE__ */ Ar('<div class="cscanapp svelte-168e0l4"><!> <video class="svelte-168e0l4"></video></div>', 2);
|
|
1756
|
+
const Ei = {
|
|
1757
|
+
hash: "svelte-168e0l4",
|
|
1758
|
+
code: ".cscanapp.svelte-168e0l4 {position:relative;width:100%;height:100%;border-radius:inherit;}.cscanapp.svelte-168e0l4 video:where(.svelte-168e0l4) {width:100%;height:100%;object-fit:cover;position:absolute;border-radius:inherit;display:block;}"
|
|
466
1759
|
};
|
|
1760
|
+
function xi(n, t) {
|
|
1761
|
+
Bn(t, !1), Tr(n, Ei);
|
|
1762
|
+
let i = He(t, "close", 8), s = He(t, "isCloseButton", 8), l = He(t, "scannerElements", 8);
|
|
1763
|
+
li(i()), _i();
|
|
1764
|
+
var c = mi(), h = Ln(c);
|
|
1765
|
+
{
|
|
1766
|
+
var u = (_) => {
|
|
1767
|
+
wi(_, {
|
|
1768
|
+
get close() {
|
|
1769
|
+
return i();
|
|
1770
|
+
}
|
|
1771
|
+
});
|
|
1772
|
+
};
|
|
1773
|
+
fi(h, (_) => {
|
|
1774
|
+
s() && _(u);
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
var p = Pn(h, 2);
|
|
1778
|
+
Vn(() => {
|
|
1779
|
+
Gt(c, "id", (ht(l()), Me(() => l().ROOT))), Gt(p, "id", (ht(l()), Me(() => l().VIDEO)));
|
|
1780
|
+
}), Cr(n, c), In();
|
|
1781
|
+
}
|
|
1782
|
+
var Be = /* @__PURE__ */ ((n) => (n.CAPTURE = "capture", n.ERROR = "error", n.CANCEL = "cancel", n))(Be || {}), ze = /* @__PURE__ */ ((n) => (n.ROOT = "cscanapp", n.VIDEO = "cscanappVideo", n))(ze || {}), it = {}, Te = {}, Jt;
|
|
1783
|
+
function Bi() {
|
|
1784
|
+
if (Jt) return Te;
|
|
1785
|
+
Jt = 1, Te.byteLength = u, Te.toByteArray = _, Te.fromByteArray = m;
|
|
1786
|
+
for (var n = [], t = [], i = typeof Uint8Array < "u" ? Uint8Array : Array, s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = 0, c = s.length; l < c; ++l)
|
|
1787
|
+
n[l] = s[l], t[s.charCodeAt(l)] = l;
|
|
1788
|
+
t[45] = 62, t[95] = 63;
|
|
1789
|
+
function h(v) {
|
|
1790
|
+
var w = v.length;
|
|
1791
|
+
if (w % 4 > 0)
|
|
1792
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
1793
|
+
var x = v.indexOf("=");
|
|
1794
|
+
x === -1 && (x = w);
|
|
1795
|
+
var S = x === w ? 0 : 4 - x % 4;
|
|
1796
|
+
return [x, S];
|
|
1797
|
+
}
|
|
1798
|
+
function u(v) {
|
|
1799
|
+
var w = h(v), x = w[0], S = w[1];
|
|
1800
|
+
return (x + S) * 3 / 4 - S;
|
|
1801
|
+
}
|
|
1802
|
+
function p(v, w, x) {
|
|
1803
|
+
return (w + x) * 3 / 4 - x;
|
|
1804
|
+
}
|
|
1805
|
+
function _(v) {
|
|
1806
|
+
var w, x = h(v), S = x[0], A = x[1], B = new i(p(v, S, A)), T = 0, M = A > 0 ? S - 4 : S, k;
|
|
1807
|
+
for (k = 0; k < M; k += 4)
|
|
1808
|
+
w = t[v.charCodeAt(k)] << 18 | t[v.charCodeAt(k + 1)] << 12 | t[v.charCodeAt(k + 2)] << 6 | t[v.charCodeAt(k + 3)], B[T++] = w >> 16 & 255, B[T++] = w >> 8 & 255, B[T++] = w & 255;
|
|
1809
|
+
return A === 2 && (w = t[v.charCodeAt(k)] << 2 | t[v.charCodeAt(k + 1)] >> 4, B[T++] = w & 255), A === 1 && (w = t[v.charCodeAt(k)] << 10 | t[v.charCodeAt(k + 1)] << 4 | t[v.charCodeAt(k + 2)] >> 2, B[T++] = w >> 8 & 255, B[T++] = w & 255), B;
|
|
1810
|
+
}
|
|
1811
|
+
function g(v) {
|
|
1812
|
+
return n[v >> 18 & 63] + n[v >> 12 & 63] + n[v >> 6 & 63] + n[v & 63];
|
|
1813
|
+
}
|
|
1814
|
+
function E(v, w, x) {
|
|
1815
|
+
for (var S, A = [], B = w; B < x; B += 3)
|
|
1816
|
+
S = (v[B] << 16 & 16711680) + (v[B + 1] << 8 & 65280) + (v[B + 2] & 255), A.push(g(S));
|
|
1817
|
+
return A.join("");
|
|
1818
|
+
}
|
|
1819
|
+
function m(v) {
|
|
1820
|
+
for (var w, x = v.length, S = x % 3, A = [], B = 16383, T = 0, M = x - S; T < M; T += B)
|
|
1821
|
+
A.push(E(v, T, T + B > M ? M : T + B));
|
|
1822
|
+
return S === 1 ? (w = v[x - 1], A.push(
|
|
1823
|
+
n[w >> 2] + n[w << 4 & 63] + "=="
|
|
1824
|
+
)) : S === 2 && (w = (v[x - 2] << 8) + v[x - 1], A.push(
|
|
1825
|
+
n[w >> 10] + n[w >> 4 & 63] + n[w << 2 & 63] + "="
|
|
1826
|
+
)), A.join("");
|
|
1827
|
+
}
|
|
1828
|
+
return Te;
|
|
1829
|
+
}
|
|
1830
|
+
var We = {};
|
|
1831
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1832
|
+
var Xt;
|
|
1833
|
+
function Ii() {
|
|
1834
|
+
return Xt || (Xt = 1, We.read = function(n, t, i, s, l) {
|
|
1835
|
+
var c, h, u = l * 8 - s - 1, p = (1 << u) - 1, _ = p >> 1, g = -7, E = i ? l - 1 : 0, m = i ? -1 : 1, v = n[t + E];
|
|
1836
|
+
for (E += m, c = v & (1 << -g) - 1, v >>= -g, g += u; g > 0; c = c * 256 + n[t + E], E += m, g -= 8)
|
|
1837
|
+
;
|
|
1838
|
+
for (h = c & (1 << -g) - 1, c >>= -g, g += s; g > 0; h = h * 256 + n[t + E], E += m, g -= 8)
|
|
1839
|
+
;
|
|
1840
|
+
if (c === 0)
|
|
1841
|
+
c = 1 - _;
|
|
1842
|
+
else {
|
|
1843
|
+
if (c === p)
|
|
1844
|
+
return h ? NaN : (v ? -1 : 1) * (1 / 0);
|
|
1845
|
+
h = h + Math.pow(2, s), c = c - _;
|
|
1846
|
+
}
|
|
1847
|
+
return (v ? -1 : 1) * h * Math.pow(2, c - s);
|
|
1848
|
+
}, We.write = function(n, t, i, s, l, c) {
|
|
1849
|
+
var h, u, p, _ = c * 8 - l - 1, g = (1 << _) - 1, E = g >> 1, m = l === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, v = s ? 0 : c - 1, w = s ? 1 : -1, x = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
|
|
1850
|
+
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (u = isNaN(t) ? 1 : 0, h = g) : (h = Math.floor(Math.log(t) / Math.LN2), t * (p = Math.pow(2, -h)) < 1 && (h--, p *= 2), h + E >= 1 ? t += m / p : t += m * Math.pow(2, 1 - E), t * p >= 2 && (h++, p /= 2), h + E >= g ? (u = 0, h = g) : h + E >= 1 ? (u = (t * p - 1) * Math.pow(2, l), h = h + E) : (u = t * Math.pow(2, E - 1) * Math.pow(2, l), h = 0)); l >= 8; n[i + v] = u & 255, v += w, u /= 256, l -= 8)
|
|
1851
|
+
;
|
|
1852
|
+
for (h = h << l | u, _ += l; _ > 0; n[i + v] = h & 255, v += w, h /= 256, _ -= 8)
|
|
1853
|
+
;
|
|
1854
|
+
n[i + v - w] |= x * 128;
|
|
1855
|
+
}), We;
|
|
1856
|
+
}
|
|
467
1857
|
/*!
|
|
468
1858
|
* The buffer module from node.js, for the browser.
|
|
469
1859
|
*
|
|
470
1860
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
471
1861
|
* @license MIT
|
|
472
1862
|
*/
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
1863
|
+
var Zt;
|
|
1864
|
+
function Si() {
|
|
1865
|
+
return Zt || (Zt = 1, (function(n) {
|
|
1866
|
+
const t = Bi(), i = Ii(), s = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
1867
|
+
n.Buffer = u, n.SlowBuffer = B, n.INSPECT_MAX_BYTES = 50;
|
|
1868
|
+
const l = 2147483647;
|
|
1869
|
+
n.kMaxLength = l, u.TYPED_ARRAY_SUPPORT = c(), !u.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
1870
|
+
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
1871
|
+
);
|
|
1872
|
+
function c() {
|
|
1873
|
+
try {
|
|
1874
|
+
const o = new Uint8Array(1), e = { foo: function() {
|
|
1875
|
+
return 42;
|
|
1876
|
+
} };
|
|
1877
|
+
return Object.setPrototypeOf(e, Uint8Array.prototype), Object.setPrototypeOf(o, e), o.foo() === 42;
|
|
1878
|
+
} catch {
|
|
1879
|
+
return !1;
|
|
1880
|
+
}
|
|
488
1881
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
1882
|
+
Object.defineProperty(u.prototype, "parent", {
|
|
1883
|
+
enumerable: !0,
|
|
1884
|
+
get: function() {
|
|
1885
|
+
if (u.isBuffer(this))
|
|
1886
|
+
return this.buffer;
|
|
1887
|
+
}
|
|
1888
|
+
}), Object.defineProperty(u.prototype, "offset", {
|
|
1889
|
+
enumerable: !0,
|
|
1890
|
+
get: function() {
|
|
1891
|
+
if (u.isBuffer(this))
|
|
1892
|
+
return this.byteOffset;
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
function h(o) {
|
|
1896
|
+
if (o > l)
|
|
1897
|
+
throw new RangeError('The value "' + o + '" is invalid for option "size"');
|
|
1898
|
+
const e = new Uint8Array(o);
|
|
1899
|
+
return Object.setPrototypeOf(e, u.prototype), e;
|
|
495
1900
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
1901
|
+
function u(o, e, r) {
|
|
1902
|
+
if (typeof o == "number") {
|
|
1903
|
+
if (typeof e == "string")
|
|
1904
|
+
throw new TypeError(
|
|
1905
|
+
'The "string" argument must be of type string. Received type number'
|
|
1906
|
+
);
|
|
1907
|
+
return E(o);
|
|
1908
|
+
}
|
|
1909
|
+
return p(o, e, r);
|
|
501
1910
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
function a(i, e, t) {
|
|
510
|
-
if (typeof i == "number") {
|
|
511
|
-
if (typeof e == "string")
|
|
1911
|
+
u.poolSize = 8192;
|
|
1912
|
+
function p(o, e, r) {
|
|
1913
|
+
if (typeof o == "string")
|
|
1914
|
+
return m(o, e);
|
|
1915
|
+
if (ArrayBuffer.isView(o))
|
|
1916
|
+
return w(o);
|
|
1917
|
+
if (o == null)
|
|
512
1918
|
throw new TypeError(
|
|
513
|
-
|
|
1919
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof o
|
|
514
1920
|
);
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
"
|
|
528
|
-
);
|
|
529
|
-
if (D(i, ArrayBuffer) || i && D(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (D(i, SharedArrayBuffer) || i && D(i.buffer, SharedArrayBuffer)))
|
|
530
|
-
return O(i, e, t);
|
|
531
|
-
if (typeof i == "number")
|
|
532
|
-
throw new TypeError(
|
|
533
|
-
'The "value" argument must not be of type number. Received type number'
|
|
534
|
-
);
|
|
535
|
-
const n = i.valueOf && i.valueOf();
|
|
536
|
-
if (n != null && n !== i)
|
|
537
|
-
return a.from(n, e, t);
|
|
538
|
-
const c = b(i);
|
|
539
|
-
if (c)
|
|
540
|
-
return c;
|
|
541
|
-
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
|
|
542
|
-
return a.from(i[Symbol.toPrimitive]("string"), e, t);
|
|
543
|
-
throw new TypeError(
|
|
544
|
-
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
|
|
545
|
-
);
|
|
546
|
-
}
|
|
547
|
-
a.from = function(i, e, t) {
|
|
548
|
-
return y(i, e, t);
|
|
549
|
-
}, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
|
|
550
|
-
function g(i) {
|
|
551
|
-
if (typeof i != "number")
|
|
552
|
-
throw new TypeError('"size" argument must be of type number');
|
|
553
|
-
if (i < 0)
|
|
554
|
-
throw new RangeError('The value "' + i + '" is invalid for option "size"');
|
|
555
|
-
}
|
|
556
|
-
function m(i, e, t) {
|
|
557
|
-
return g(i), i <= 0 ? p(i) : e !== void 0 ? typeof t == "string" ? p(i).fill(e, t) : p(i).fill(e) : p(i);
|
|
558
|
-
}
|
|
559
|
-
a.alloc = function(i, e, t) {
|
|
560
|
-
return m(i, e, t);
|
|
561
|
-
};
|
|
562
|
-
function E(i) {
|
|
563
|
-
return g(i), p(i < 0 ? 0 : A(i) | 0);
|
|
564
|
-
}
|
|
565
|
-
a.allocUnsafe = function(i) {
|
|
566
|
-
return E(i);
|
|
567
|
-
}, a.allocUnsafeSlow = function(i) {
|
|
568
|
-
return E(i);
|
|
569
|
-
};
|
|
570
|
-
function w(i, e) {
|
|
571
|
-
if ((typeof e != "string" || e === "") && (e = "utf8"), !a.isEncoding(e))
|
|
572
|
-
throw new TypeError("Unknown encoding: " + e);
|
|
573
|
-
const t = k(i, e) | 0;
|
|
574
|
-
let n = p(t);
|
|
575
|
-
const c = n.write(i, e);
|
|
576
|
-
return c !== t && (n = n.slice(0, c)), n;
|
|
577
|
-
}
|
|
578
|
-
function B(i) {
|
|
579
|
-
const e = i.length < 0 ? 0 : A(i.length) | 0, t = p(e);
|
|
580
|
-
for (let n = 0; n < e; n += 1)
|
|
581
|
-
t[n] = i[n] & 255;
|
|
582
|
-
return t;
|
|
583
|
-
}
|
|
584
|
-
function R(i) {
|
|
585
|
-
if (D(i, Uint8Array)) {
|
|
586
|
-
const e = new Uint8Array(i);
|
|
587
|
-
return O(e.buffer, e.byteOffset, e.byteLength);
|
|
588
|
-
}
|
|
589
|
-
return B(i);
|
|
590
|
-
}
|
|
591
|
-
function O(i, e, t) {
|
|
592
|
-
if (e < 0 || i.byteLength < e)
|
|
593
|
-
throw new RangeError('"offset" is outside of buffer bounds');
|
|
594
|
-
if (i.byteLength < e + (t || 0))
|
|
595
|
-
throw new RangeError('"length" is outside of buffer bounds');
|
|
596
|
-
let n;
|
|
597
|
-
return e === void 0 && t === void 0 ? n = new Uint8Array(i) : t === void 0 ? n = new Uint8Array(i, e) : n = new Uint8Array(i, e, t), Object.setPrototypeOf(n, a.prototype), n;
|
|
598
|
-
}
|
|
599
|
-
function b(i) {
|
|
600
|
-
if (a.isBuffer(i)) {
|
|
601
|
-
const e = A(i.length) | 0, t = p(e);
|
|
602
|
-
return t.length === 0 || i.copy(t, 0, 0, e), t;
|
|
603
|
-
}
|
|
604
|
-
if (i.length !== void 0)
|
|
605
|
-
return typeof i.length != "number" || he(i.length) ? p(0) : B(i);
|
|
606
|
-
if (i.type === "Buffer" && Array.isArray(i.data))
|
|
607
|
-
return B(i.data);
|
|
608
|
-
}
|
|
609
|
-
function A(i) {
|
|
610
|
-
if (i >= l)
|
|
611
|
-
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + l.toString(16) + " bytes");
|
|
612
|
-
return i | 0;
|
|
613
|
-
}
|
|
614
|
-
function W(i) {
|
|
615
|
-
return +i != i && (i = 0), a.alloc(+i);
|
|
616
|
-
}
|
|
617
|
-
a.isBuffer = function(e) {
|
|
618
|
-
return e != null && e._isBuffer === !0 && e !== a.prototype;
|
|
619
|
-
}, a.compare = function(e, t) {
|
|
620
|
-
if (D(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), D(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(e) || !a.isBuffer(t))
|
|
1921
|
+
if (J(o, ArrayBuffer) || o && J(o.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (J(o, SharedArrayBuffer) || o && J(o.buffer, SharedArrayBuffer)))
|
|
1922
|
+
return x(o, e, r);
|
|
1923
|
+
if (typeof o == "number")
|
|
1924
|
+
throw new TypeError(
|
|
1925
|
+
'The "value" argument must not be of type number. Received type number'
|
|
1926
|
+
);
|
|
1927
|
+
const a = o.valueOf && o.valueOf();
|
|
1928
|
+
if (a != null && a !== o)
|
|
1929
|
+
return u.from(a, e, r);
|
|
1930
|
+
const f = S(o);
|
|
1931
|
+
if (f) return f;
|
|
1932
|
+
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof o[Symbol.toPrimitive] == "function")
|
|
1933
|
+
return u.from(o[Symbol.toPrimitive]("string"), e, r);
|
|
621
1934
|
throw new TypeError(
|
|
622
|
-
|
|
1935
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof o
|
|
623
1936
|
);
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
1937
|
+
}
|
|
1938
|
+
u.from = function(o, e, r) {
|
|
1939
|
+
return p(o, e, r);
|
|
1940
|
+
}, Object.setPrototypeOf(u.prototype, Uint8Array.prototype), Object.setPrototypeOf(u, Uint8Array);
|
|
1941
|
+
function _(o) {
|
|
1942
|
+
if (typeof o != "number")
|
|
1943
|
+
throw new TypeError('"size" argument must be of type number');
|
|
1944
|
+
if (o < 0)
|
|
1945
|
+
throw new RangeError('The value "' + o + '" is invalid for option "size"');
|
|
1946
|
+
}
|
|
1947
|
+
function g(o, e, r) {
|
|
1948
|
+
return _(o), o <= 0 ? h(o) : e !== void 0 ? typeof r == "string" ? h(o).fill(e, r) : h(o).fill(e) : h(o);
|
|
1949
|
+
}
|
|
1950
|
+
u.alloc = function(o, e, r) {
|
|
1951
|
+
return g(o, e, r);
|
|
1952
|
+
};
|
|
1953
|
+
function E(o) {
|
|
1954
|
+
return _(o), h(o < 0 ? 0 : A(o) | 0);
|
|
1955
|
+
}
|
|
1956
|
+
u.allocUnsafe = function(o) {
|
|
1957
|
+
return E(o);
|
|
1958
|
+
}, u.allocUnsafeSlow = function(o) {
|
|
1959
|
+
return E(o);
|
|
1960
|
+
};
|
|
1961
|
+
function m(o, e) {
|
|
1962
|
+
if ((typeof e != "string" || e === "") && (e = "utf8"), !u.isEncoding(e))
|
|
1963
|
+
throw new TypeError("Unknown encoding: " + e);
|
|
1964
|
+
const r = T(o, e) | 0;
|
|
1965
|
+
let a = h(r);
|
|
1966
|
+
const f = a.write(o, e);
|
|
1967
|
+
return f !== r && (a = a.slice(0, f)), a;
|
|
1968
|
+
}
|
|
1969
|
+
function v(o) {
|
|
1970
|
+
const e = o.length < 0 ? 0 : A(o.length) | 0, r = h(e);
|
|
1971
|
+
for (let a = 0; a < e; a += 1)
|
|
1972
|
+
r[a] = o[a] & 255;
|
|
1973
|
+
return r;
|
|
1974
|
+
}
|
|
1975
|
+
function w(o) {
|
|
1976
|
+
if (J(o, Uint8Array)) {
|
|
1977
|
+
const e = new Uint8Array(o);
|
|
1978
|
+
return x(e.buffer, e.byteOffset, e.byteLength);
|
|
631
1979
|
}
|
|
632
|
-
|
|
633
|
-
}, a.isEncoding = function(e) {
|
|
634
|
-
switch (String(e).toLowerCase()) {
|
|
635
|
-
case "hex":
|
|
636
|
-
case "utf8":
|
|
637
|
-
case "utf-8":
|
|
638
|
-
case "ascii":
|
|
639
|
-
case "latin1":
|
|
640
|
-
case "binary":
|
|
641
|
-
case "base64":
|
|
642
|
-
case "ucs2":
|
|
643
|
-
case "ucs-2":
|
|
644
|
-
case "utf16le":
|
|
645
|
-
case "utf-16le":
|
|
646
|
-
return !0;
|
|
647
|
-
default:
|
|
648
|
-
return !1;
|
|
1980
|
+
return v(o);
|
|
649
1981
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
for (t = 0, n = 0; n < e.length; ++n)
|
|
658
|
-
t += e[n].length;
|
|
659
|
-
const c = a.allocUnsafe(t);
|
|
660
|
-
let u = 0;
|
|
661
|
-
for (n = 0; n < e.length; ++n) {
|
|
662
|
-
let f = e[n];
|
|
663
|
-
if (D(f, Uint8Array))
|
|
664
|
-
u + f.length > c.length ? (a.isBuffer(f) || (f = a.from(f)), f.copy(c, u)) : Uint8Array.prototype.set.call(
|
|
665
|
-
c,
|
|
666
|
-
f,
|
|
667
|
-
u
|
|
668
|
-
);
|
|
669
|
-
else if (a.isBuffer(f))
|
|
670
|
-
f.copy(c, u);
|
|
671
|
-
else
|
|
672
|
-
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
673
|
-
u += f.length;
|
|
1982
|
+
function x(o, e, r) {
|
|
1983
|
+
if (e < 0 || o.byteLength < e)
|
|
1984
|
+
throw new RangeError('"offset" is outside of buffer bounds');
|
|
1985
|
+
if (o.byteLength < e + (r || 0))
|
|
1986
|
+
throw new RangeError('"length" is outside of buffer bounds');
|
|
1987
|
+
let a;
|
|
1988
|
+
return e === void 0 && r === void 0 ? a = new Uint8Array(o) : r === void 0 ? a = new Uint8Array(o, e) : a = new Uint8Array(o, e, r), Object.setPrototypeOf(a, u.prototype), a;
|
|
674
1989
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
return i.length;
|
|
680
|
-
if (ArrayBuffer.isView(i) || D(i, ArrayBuffer))
|
|
681
|
-
return i.byteLength;
|
|
682
|
-
if (typeof i != "string")
|
|
683
|
-
throw new TypeError(
|
|
684
|
-
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
|
|
685
|
-
);
|
|
686
|
-
const t = i.length, n = arguments.length > 2 && arguments[2] === !0;
|
|
687
|
-
if (!n && t === 0)
|
|
688
|
-
return 0;
|
|
689
|
-
let c = !1;
|
|
690
|
-
for (; ; )
|
|
691
|
-
switch (e) {
|
|
692
|
-
case "ascii":
|
|
693
|
-
case "latin1":
|
|
694
|
-
case "binary":
|
|
695
|
-
return t;
|
|
696
|
-
case "utf8":
|
|
697
|
-
case "utf-8":
|
|
698
|
-
return ce(i).length;
|
|
699
|
-
case "ucs2":
|
|
700
|
-
case "ucs-2":
|
|
701
|
-
case "utf16le":
|
|
702
|
-
case "utf-16le":
|
|
703
|
-
return t * 2;
|
|
704
|
-
case "hex":
|
|
705
|
-
return t >>> 1;
|
|
706
|
-
case "base64":
|
|
707
|
-
return De(i).length;
|
|
708
|
-
default:
|
|
709
|
-
if (c)
|
|
710
|
-
return n ? -1 : ce(i).length;
|
|
711
|
-
e = ("" + e).toLowerCase(), c = !0;
|
|
1990
|
+
function S(o) {
|
|
1991
|
+
if (u.isBuffer(o)) {
|
|
1992
|
+
const e = A(o.length) | 0, r = h(e);
|
|
1993
|
+
return r.length === 0 || o.copy(r, 0, 0, e), r;
|
|
712
1994
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
1995
|
+
if (o.length !== void 0)
|
|
1996
|
+
return typeof o.length != "number" || rt(o.length) ? h(0) : v(o);
|
|
1997
|
+
if (o.type === "Buffer" && Array.isArray(o.data))
|
|
1998
|
+
return v(o.data);
|
|
1999
|
+
}
|
|
2000
|
+
function A(o) {
|
|
2001
|
+
if (o >= l)
|
|
2002
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + l.toString(16) + " bytes");
|
|
2003
|
+
return o | 0;
|
|
2004
|
+
}
|
|
2005
|
+
function B(o) {
|
|
2006
|
+
return +o != o && (o = 0), u.alloc(+o);
|
|
2007
|
+
}
|
|
2008
|
+
u.isBuffer = function(e) {
|
|
2009
|
+
return e != null && e._isBuffer === !0 && e !== u.prototype;
|
|
2010
|
+
}, u.compare = function(e, r) {
|
|
2011
|
+
if (J(e, Uint8Array) && (e = u.from(e, e.offset, e.byteLength)), J(r, Uint8Array) && (r = u.from(r, r.offset, r.byteLength)), !u.isBuffer(e) || !u.isBuffer(r))
|
|
2012
|
+
throw new TypeError(
|
|
2013
|
+
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
2014
|
+
);
|
|
2015
|
+
if (e === r) return 0;
|
|
2016
|
+
let a = e.length, f = r.length;
|
|
2017
|
+
for (let d = 0, y = Math.min(a, f); d < y; ++d)
|
|
2018
|
+
if (e[d] !== r[d]) {
|
|
2019
|
+
a = e[d], f = r[d];
|
|
2020
|
+
break;
|
|
2021
|
+
}
|
|
2022
|
+
return a < f ? -1 : f < a ? 1 : 0;
|
|
2023
|
+
}, u.isEncoding = function(e) {
|
|
2024
|
+
switch (String(e).toLowerCase()) {
|
|
721
2025
|
case "hex":
|
|
722
|
-
return nt(this, e, t);
|
|
723
2026
|
case "utf8":
|
|
724
2027
|
case "utf-8":
|
|
725
|
-
return Fe(this, e, t);
|
|
726
2028
|
case "ascii":
|
|
727
|
-
return it(this, e, t);
|
|
728
2029
|
case "latin1":
|
|
729
2030
|
case "binary":
|
|
730
|
-
return rt(this, e, t);
|
|
731
2031
|
case "base64":
|
|
732
|
-
return et(this, e, t);
|
|
733
2032
|
case "ucs2":
|
|
734
2033
|
case "ucs-2":
|
|
735
2034
|
case "utf16le":
|
|
736
2035
|
case "utf-16le":
|
|
737
|
-
return
|
|
2036
|
+
return !0;
|
|
738
2037
|
default:
|
|
739
|
-
|
|
740
|
-
throw new TypeError("Unknown encoding: " + i);
|
|
741
|
-
i = (i + "").toLowerCase(), n = !0;
|
|
2038
|
+
return !1;
|
|
742
2039
|
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
for (let t = 0; t < e; t += 8)
|
|
768
|
-
N(this, t, t + 7), N(this, t + 1, t + 6), N(this, t + 2, t + 5), N(this, t + 3, t + 4);
|
|
769
|
-
return this;
|
|
770
|
-
}, a.prototype.toString = function() {
|
|
771
|
-
const e = this.length;
|
|
772
|
-
return e === 0 ? "" : arguments.length === 0 ? Fe(this, 0, e) : T.apply(this, arguments);
|
|
773
|
-
}, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(e) {
|
|
774
|
-
if (!a.isBuffer(e))
|
|
775
|
-
throw new TypeError("Argument must be a Buffer");
|
|
776
|
-
return this === e ? !0 : a.compare(this, e) === 0;
|
|
777
|
-
}, a.prototype.inspect = function() {
|
|
778
|
-
let e = "";
|
|
779
|
-
const t = s.INSPECT_MAX_BYTES;
|
|
780
|
-
return e = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (e += " ... "), "<Buffer " + e + ">";
|
|
781
|
-
}, h && (a.prototype[h] = a.prototype.inspect), a.prototype.compare = function(e, t, n, c, u) {
|
|
782
|
-
if (D(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), !a.isBuffer(e))
|
|
783
|
-
throw new TypeError(
|
|
784
|
-
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e
|
|
785
|
-
);
|
|
786
|
-
if (t === void 0 && (t = 0), n === void 0 && (n = e ? e.length : 0), c === void 0 && (c = 0), u === void 0 && (u = this.length), t < 0 || n > e.length || c < 0 || u > this.length)
|
|
787
|
-
throw new RangeError("out of range index");
|
|
788
|
-
if (c >= u && t >= n)
|
|
789
|
-
return 0;
|
|
790
|
-
if (c >= u)
|
|
791
|
-
return -1;
|
|
792
|
-
if (t >= n)
|
|
793
|
-
return 1;
|
|
794
|
-
if (t >>>= 0, n >>>= 0, c >>>= 0, u >>>= 0, this === e)
|
|
795
|
-
return 0;
|
|
796
|
-
let f = u - c, _ = n - t;
|
|
797
|
-
const F = Math.min(f, _), I = this.slice(c, u), S = e.slice(t, n);
|
|
798
|
-
for (let v = 0; v < F; ++v)
|
|
799
|
-
if (I[v] !== S[v]) {
|
|
800
|
-
f = I[v], _ = S[v];
|
|
801
|
-
break;
|
|
2040
|
+
}, u.concat = function(e, r) {
|
|
2041
|
+
if (!Array.isArray(e))
|
|
2042
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
2043
|
+
if (e.length === 0)
|
|
2044
|
+
return u.alloc(0);
|
|
2045
|
+
let a;
|
|
2046
|
+
if (r === void 0)
|
|
2047
|
+
for (r = 0, a = 0; a < e.length; ++a)
|
|
2048
|
+
r += e[a].length;
|
|
2049
|
+
const f = u.allocUnsafe(r);
|
|
2050
|
+
let d = 0;
|
|
2051
|
+
for (a = 0; a < e.length; ++a) {
|
|
2052
|
+
let y = e[a];
|
|
2053
|
+
if (J(y, Uint8Array))
|
|
2054
|
+
d + y.length > f.length ? (u.isBuffer(y) || (y = u.from(y)), y.copy(f, d)) : Uint8Array.prototype.set.call(
|
|
2055
|
+
f,
|
|
2056
|
+
y,
|
|
2057
|
+
d
|
|
2058
|
+
);
|
|
2059
|
+
else if (u.isBuffer(y))
|
|
2060
|
+
y.copy(f, d);
|
|
2061
|
+
else
|
|
2062
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
2063
|
+
d += y.length;
|
|
802
2064
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
2065
|
+
return f;
|
|
2066
|
+
};
|
|
2067
|
+
function T(o, e) {
|
|
2068
|
+
if (u.isBuffer(o))
|
|
2069
|
+
return o.length;
|
|
2070
|
+
if (ArrayBuffer.isView(o) || J(o, ArrayBuffer))
|
|
2071
|
+
return o.byteLength;
|
|
2072
|
+
if (typeof o != "string")
|
|
2073
|
+
throw new TypeError(
|
|
2074
|
+
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof o
|
|
2075
|
+
);
|
|
2076
|
+
const r = o.length, a = arguments.length > 2 && arguments[2] === !0;
|
|
2077
|
+
if (!a && r === 0) return 0;
|
|
2078
|
+
let f = !1;
|
|
2079
|
+
for (; ; )
|
|
2080
|
+
switch (e) {
|
|
2081
|
+
case "ascii":
|
|
2082
|
+
case "latin1":
|
|
2083
|
+
case "binary":
|
|
2084
|
+
return r;
|
|
2085
|
+
case "utf8":
|
|
2086
|
+
case "utf-8":
|
|
2087
|
+
return tt(o).length;
|
|
2088
|
+
case "ucs2":
|
|
2089
|
+
case "ucs-2":
|
|
2090
|
+
case "utf16le":
|
|
2091
|
+
case "utf-16le":
|
|
2092
|
+
return r * 2;
|
|
2093
|
+
case "hex":
|
|
2094
|
+
return r >>> 1;
|
|
2095
|
+
case "base64":
|
|
2096
|
+
return Pt(o).length;
|
|
2097
|
+
default:
|
|
2098
|
+
if (f)
|
|
2099
|
+
return a ? -1 : tt(o).length;
|
|
2100
|
+
e = ("" + e).toLowerCase(), f = !0;
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
u.byteLength = T;
|
|
2104
|
+
function M(o, e, r) {
|
|
2105
|
+
let a = !1;
|
|
2106
|
+
if ((e === void 0 || e < 0) && (e = 0), e > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, e >>>= 0, r <= e))
|
|
2107
|
+
return "";
|
|
2108
|
+
for (o || (o = "utf8"); ; )
|
|
2109
|
+
switch (o) {
|
|
2110
|
+
case "hex":
|
|
2111
|
+
return qr(this, e, r);
|
|
2112
|
+
case "utf8":
|
|
2113
|
+
case "utf-8":
|
|
2114
|
+
return At(this, e, r);
|
|
2115
|
+
case "ascii":
|
|
2116
|
+
return $r(this, e, r);
|
|
2117
|
+
case "latin1":
|
|
2118
|
+
case "binary":
|
|
2119
|
+
return Nr(this, e, r);
|
|
2120
|
+
case "base64":
|
|
2121
|
+
return Lr(this, e, r);
|
|
2122
|
+
case "ucs2":
|
|
2123
|
+
case "ucs-2":
|
|
2124
|
+
case "utf16le":
|
|
2125
|
+
case "utf-16le":
|
|
2126
|
+
return jr(this, e, r);
|
|
2127
|
+
default:
|
|
2128
|
+
if (a) throw new TypeError("Unknown encoding: " + o);
|
|
2129
|
+
o = (o + "").toLowerCase(), a = !0;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
u.prototype._isBuffer = !0;
|
|
2133
|
+
function k(o, e, r) {
|
|
2134
|
+
const a = o[e];
|
|
2135
|
+
o[e] = o[r], o[r] = a;
|
|
2136
|
+
}
|
|
2137
|
+
u.prototype.swap16 = function() {
|
|
2138
|
+
const e = this.length;
|
|
2139
|
+
if (e % 2 !== 0)
|
|
2140
|
+
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
2141
|
+
for (let r = 0; r < e; r += 2)
|
|
2142
|
+
k(this, r, r + 1);
|
|
2143
|
+
return this;
|
|
2144
|
+
}, u.prototype.swap32 = function() {
|
|
2145
|
+
const e = this.length;
|
|
2146
|
+
if (e % 4 !== 0)
|
|
2147
|
+
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
2148
|
+
for (let r = 0; r < e; r += 4)
|
|
2149
|
+
k(this, r, r + 3), k(this, r + 1, r + 2);
|
|
2150
|
+
return this;
|
|
2151
|
+
}, u.prototype.swap64 = function() {
|
|
2152
|
+
const e = this.length;
|
|
2153
|
+
if (e % 8 !== 0)
|
|
2154
|
+
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
2155
|
+
for (let r = 0; r < e; r += 8)
|
|
2156
|
+
k(this, r, r + 7), k(this, r + 1, r + 6), k(this, r + 2, r + 5), k(this, r + 3, r + 4);
|
|
2157
|
+
return this;
|
|
2158
|
+
}, u.prototype.toString = function() {
|
|
2159
|
+
const e = this.length;
|
|
2160
|
+
return e === 0 ? "" : arguments.length === 0 ? At(this, 0, e) : M.apply(this, arguments);
|
|
2161
|
+
}, u.prototype.toLocaleString = u.prototype.toString, u.prototype.equals = function(e) {
|
|
2162
|
+
if (!u.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
|
|
2163
|
+
return this === e ? !0 : u.compare(this, e) === 0;
|
|
2164
|
+
}, u.prototype.inspect = function() {
|
|
2165
|
+
let e = "";
|
|
2166
|
+
const r = n.INSPECT_MAX_BYTES;
|
|
2167
|
+
return e = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (e += " ... "), "<Buffer " + e + ">";
|
|
2168
|
+
}, s && (u.prototype[s] = u.prototype.inspect), u.prototype.compare = function(e, r, a, f, d) {
|
|
2169
|
+
if (J(e, Uint8Array) && (e = u.from(e, e.offset, e.byteLength)), !u.isBuffer(e))
|
|
2170
|
+
throw new TypeError(
|
|
2171
|
+
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e
|
|
2172
|
+
);
|
|
2173
|
+
if (r === void 0 && (r = 0), a === void 0 && (a = e ? e.length : 0), f === void 0 && (f = 0), d === void 0 && (d = this.length), r < 0 || a > e.length || f < 0 || d > this.length)
|
|
2174
|
+
throw new RangeError("out of range index");
|
|
2175
|
+
if (f >= d && r >= a)
|
|
2176
|
+
return 0;
|
|
2177
|
+
if (f >= d)
|
|
827
2178
|
return -1;
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
2179
|
+
if (r >= a)
|
|
2180
|
+
return 1;
|
|
2181
|
+
if (r >>>= 0, a >>>= 0, f >>>= 0, d >>>= 0, this === e) return 0;
|
|
2182
|
+
let y = d - f, F = a - r;
|
|
2183
|
+
const U = Math.min(y, F), O = this.slice(f, d), D = e.slice(r, a);
|
|
2184
|
+
for (let C = 0; C < U; ++C)
|
|
2185
|
+
if (O[C] !== D[C]) {
|
|
2186
|
+
y = O[C], F = D[C];
|
|
2187
|
+
break;
|
|
2188
|
+
}
|
|
2189
|
+
return y < F ? -1 : F < y ? 1 : 0;
|
|
2190
|
+
};
|
|
2191
|
+
function Rt(o, e, r, a, f) {
|
|
2192
|
+
if (o.length === 0) return -1;
|
|
2193
|
+
if (typeof r == "string" ? (a = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, rt(r) && (r = f ? 0 : o.length - 1), r < 0 && (r = o.length + r), r >= o.length) {
|
|
2194
|
+
if (f) return -1;
|
|
2195
|
+
r = o.length - 1;
|
|
2196
|
+
} else if (r < 0)
|
|
2197
|
+
if (f) r = 0;
|
|
2198
|
+
else return -1;
|
|
2199
|
+
if (typeof e == "string" && (e = u.from(e, a)), u.isBuffer(e))
|
|
2200
|
+
return e.length === 0 ? -1 : bt(o, e, r, a, f);
|
|
2201
|
+
if (typeof e == "number")
|
|
2202
|
+
return e = e & 255, typeof Uint8Array.prototype.indexOf == "function" ? f ? Uint8Array.prototype.indexOf.call(o, e, r) : Uint8Array.prototype.lastIndexOf.call(o, e, r) : bt(o, [e], r, a, f);
|
|
2203
|
+
throw new TypeError("val must be string, number or Buffer");
|
|
2204
|
+
}
|
|
2205
|
+
function bt(o, e, r, a, f) {
|
|
2206
|
+
let d = 1, y = o.length, F = e.length;
|
|
2207
|
+
if (a !== void 0 && (a = String(a).toLowerCase(), a === "ucs2" || a === "ucs-2" || a === "utf16le" || a === "utf-16le")) {
|
|
2208
|
+
if (o.length < 2 || e.length < 2)
|
|
2209
|
+
return -1;
|
|
2210
|
+
d = 2, y /= 2, F /= 2, r /= 2;
|
|
852
2211
|
}
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
a.prototype.includes = function(e, t, n) {
|
|
856
|
-
return this.indexOf(e, t, n) !== -1;
|
|
857
|
-
}, a.prototype.indexOf = function(e, t, n) {
|
|
858
|
-
return ve(this, e, t, n, !0);
|
|
859
|
-
}, a.prototype.lastIndexOf = function(e, t, n) {
|
|
860
|
-
return ve(this, e, t, n, !1);
|
|
861
|
-
};
|
|
862
|
-
function Ye(i, e, t, n) {
|
|
863
|
-
t = Number(t) || 0;
|
|
864
|
-
const c = i.length - t;
|
|
865
|
-
n ? (n = Number(n), n > c && (n = c)) : n = c;
|
|
866
|
-
const u = e.length;
|
|
867
|
-
n > u / 2 && (n = u / 2);
|
|
868
|
-
let f;
|
|
869
|
-
for (f = 0; f < n; ++f) {
|
|
870
|
-
const _ = parseInt(e.substr(f * 2, 2), 16);
|
|
871
|
-
if (he(_))
|
|
872
|
-
return f;
|
|
873
|
-
i[t + f] = _;
|
|
874
|
-
}
|
|
875
|
-
return f;
|
|
876
|
-
}
|
|
877
|
-
function Xe(i, e, t, n) {
|
|
878
|
-
return ie(ce(e, i.length - t), i, t, n);
|
|
879
|
-
}
|
|
880
|
-
function Je(i, e, t, n) {
|
|
881
|
-
return ie(ht(e), i, t, n);
|
|
882
|
-
}
|
|
883
|
-
function Ke(i, e, t, n) {
|
|
884
|
-
return ie(De(e), i, t, n);
|
|
885
|
-
}
|
|
886
|
-
function Ze(i, e, t, n) {
|
|
887
|
-
return ie(ut(e, i.length - t), i, t, n);
|
|
888
|
-
}
|
|
889
|
-
a.prototype.write = function(e, t, n, c) {
|
|
890
|
-
if (t === void 0)
|
|
891
|
-
c = "utf8", n = this.length, t = 0;
|
|
892
|
-
else if (n === void 0 && typeof t == "string")
|
|
893
|
-
c = t, n = this.length, t = 0;
|
|
894
|
-
else if (isFinite(t))
|
|
895
|
-
t = t >>> 0, isFinite(n) ? (n = n >>> 0, c === void 0 && (c = "utf8")) : (c = n, n = void 0);
|
|
896
|
-
else
|
|
897
|
-
throw new Error(
|
|
898
|
-
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
899
|
-
);
|
|
900
|
-
const u = this.length - t;
|
|
901
|
-
if ((n === void 0 || n > u) && (n = u), e.length > 0 && (n < 0 || t < 0) || t > this.length)
|
|
902
|
-
throw new RangeError("Attempt to write outside buffer bounds");
|
|
903
|
-
c || (c = "utf8");
|
|
904
|
-
let f = !1;
|
|
905
|
-
for (; ; )
|
|
906
|
-
switch (c) {
|
|
907
|
-
case "hex":
|
|
908
|
-
return Ye(this, e, t, n);
|
|
909
|
-
case "utf8":
|
|
910
|
-
case "utf-8":
|
|
911
|
-
return Xe(this, e, t, n);
|
|
912
|
-
case "ascii":
|
|
913
|
-
case "latin1":
|
|
914
|
-
case "binary":
|
|
915
|
-
return Je(this, e, t, n);
|
|
916
|
-
case "base64":
|
|
917
|
-
return Ke(this, e, t, n);
|
|
918
|
-
case "ucs2":
|
|
919
|
-
case "ucs-2":
|
|
920
|
-
case "utf16le":
|
|
921
|
-
case "utf-16le":
|
|
922
|
-
return Ze(this, e, t, n);
|
|
923
|
-
default:
|
|
924
|
-
if (f)
|
|
925
|
-
throw new TypeError("Unknown encoding: " + c);
|
|
926
|
-
c = ("" + c).toLowerCase(), f = !0;
|
|
2212
|
+
function U(D, C) {
|
|
2213
|
+
return d === 1 ? D[C] : D.readUInt16BE(C * d);
|
|
927
2214
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
let F, I, S, v;
|
|
946
|
-
switch (_) {
|
|
947
|
-
case 1:
|
|
948
|
-
u < 128 && (f = u);
|
|
949
|
-
break;
|
|
950
|
-
case 2:
|
|
951
|
-
F = i[c + 1], (F & 192) === 128 && (v = (u & 31) << 6 | F & 63, v > 127 && (f = v));
|
|
952
|
-
break;
|
|
953
|
-
case 3:
|
|
954
|
-
F = i[c + 1], I = i[c + 2], (F & 192) === 128 && (I & 192) === 128 && (v = (u & 15) << 12 | (F & 63) << 6 | I & 63, v > 2047 && (v < 55296 || v > 57343) && (f = v));
|
|
955
|
-
break;
|
|
956
|
-
case 4:
|
|
957
|
-
F = i[c + 1], I = i[c + 2], S = i[c + 3], (F & 192) === 128 && (I & 192) === 128 && (S & 192) === 128 && (v = (u & 15) << 18 | (F & 63) << 12 | (I & 63) << 6 | S & 63, v > 65535 && v < 1114112 && (f = v));
|
|
2215
|
+
let O;
|
|
2216
|
+
if (f) {
|
|
2217
|
+
let D = -1;
|
|
2218
|
+
for (O = r; O < y; O++)
|
|
2219
|
+
if (U(o, O) === U(e, D === -1 ? 0 : O - D)) {
|
|
2220
|
+
if (D === -1 && (D = O), O - D + 1 === F) return D * d;
|
|
2221
|
+
} else
|
|
2222
|
+
D !== -1 && (O -= O - D), D = -1;
|
|
2223
|
+
} else
|
|
2224
|
+
for (r + F > y && (r = y - F), O = r; O >= 0; O--) {
|
|
2225
|
+
let D = !0;
|
|
2226
|
+
for (let C = 0; C < F; C++)
|
|
2227
|
+
if (U(o, O + C) !== U(e, C)) {
|
|
2228
|
+
D = !1;
|
|
2229
|
+
break;
|
|
2230
|
+
}
|
|
2231
|
+
if (D) return O;
|
|
958
2232
|
}
|
|
2233
|
+
return -1;
|
|
2234
|
+
}
|
|
2235
|
+
u.prototype.includes = function(e, r, a) {
|
|
2236
|
+
return this.indexOf(e, r, a) !== -1;
|
|
2237
|
+
}, u.prototype.indexOf = function(e, r, a) {
|
|
2238
|
+
return Rt(this, e, r, a, !0);
|
|
2239
|
+
}, u.prototype.lastIndexOf = function(e, r, a) {
|
|
2240
|
+
return Rt(this, e, r, a, !1);
|
|
2241
|
+
};
|
|
2242
|
+
function Or(o, e, r, a) {
|
|
2243
|
+
r = Number(r) || 0;
|
|
2244
|
+
const f = o.length - r;
|
|
2245
|
+
a ? (a = Number(a), a > f && (a = f)) : a = f;
|
|
2246
|
+
const d = e.length;
|
|
2247
|
+
a > d / 2 && (a = d / 2);
|
|
2248
|
+
let y;
|
|
2249
|
+
for (y = 0; y < a; ++y) {
|
|
2250
|
+
const F = parseInt(e.substr(y * 2, 2), 16);
|
|
2251
|
+
if (rt(F)) return y;
|
|
2252
|
+
o[r + y] = F;
|
|
959
2253
|
}
|
|
960
|
-
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
return BigInt(c) + (BigInt(u) << BigInt(32));
|
|
1046
|
-
}), a.prototype.readBigUInt64BE = P(function(e) {
|
|
1047
|
-
e = e >>> 0, H(e, "offset");
|
|
1048
|
-
const t = this[e], n = this[e + 7];
|
|
1049
|
-
(t === void 0 || n === void 0) && X(e, this.length - 8);
|
|
1050
|
-
const c = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], u = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n;
|
|
1051
|
-
return (BigInt(c) << BigInt(32)) + BigInt(u);
|
|
1052
|
-
}), a.prototype.readIntLE = function(e, t, n) {
|
|
1053
|
-
e = e >>> 0, t = t >>> 0, n || C(e, t, this.length);
|
|
1054
|
-
let c = this[e], u = 1, f = 0;
|
|
1055
|
-
for (; ++f < t && (u *= 256); )
|
|
1056
|
-
c += this[e + f] * u;
|
|
1057
|
-
return u *= 128, c >= u && (c -= Math.pow(2, 8 * t)), c;
|
|
1058
|
-
}, a.prototype.readIntBE = function(e, t, n) {
|
|
1059
|
-
e = e >>> 0, t = t >>> 0, n || C(e, t, this.length);
|
|
1060
|
-
let c = t, u = 1, f = this[e + --c];
|
|
1061
|
-
for (; c > 0 && (u *= 256); )
|
|
1062
|
-
f += this[e + --c] * u;
|
|
1063
|
-
return u *= 128, f >= u && (f -= Math.pow(2, 8 * t)), f;
|
|
1064
|
-
}, a.prototype.readInt8 = function(e, t) {
|
|
1065
|
-
return e = e >>> 0, t || C(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
1066
|
-
}, a.prototype.readInt16LE = function(e, t) {
|
|
1067
|
-
e = e >>> 0, t || C(e, 2, this.length);
|
|
1068
|
-
const n = this[e] | this[e + 1] << 8;
|
|
1069
|
-
return n & 32768 ? n | 4294901760 : n;
|
|
1070
|
-
}, a.prototype.readInt16BE = function(e, t) {
|
|
1071
|
-
e = e >>> 0, t || C(e, 2, this.length);
|
|
1072
|
-
const n = this[e + 1] | this[e] << 8;
|
|
1073
|
-
return n & 32768 ? n | 4294901760 : n;
|
|
1074
|
-
}, a.prototype.readInt32LE = function(e, t) {
|
|
1075
|
-
return e = e >>> 0, t || C(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
1076
|
-
}, a.prototype.readInt32BE = function(e, t) {
|
|
1077
|
-
return e = e >>> 0, t || C(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
1078
|
-
}, a.prototype.readBigInt64LE = P(function(e) {
|
|
1079
|
-
e = e >>> 0, H(e, "offset");
|
|
1080
|
-
const t = this[e], n = this[e + 7];
|
|
1081
|
-
(t === void 0 || n === void 0) && X(e, this.length - 8);
|
|
1082
|
-
const c = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (n << 24);
|
|
1083
|
-
return (BigInt(c) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
|
|
1084
|
-
}), a.prototype.readBigInt64BE = P(function(e) {
|
|
1085
|
-
e = e >>> 0, H(e, "offset");
|
|
1086
|
-
const t = this[e], n = this[e + 7];
|
|
1087
|
-
(t === void 0 || n === void 0) && X(e, this.length - 8);
|
|
1088
|
-
const c = (t << 24) + // Overflow
|
|
1089
|
-
this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
|
|
1090
|
-
return (BigInt(c) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
|
|
1091
|
-
}), a.prototype.readFloatLE = function(e, t) {
|
|
1092
|
-
return e = e >>> 0, t || C(e, 4, this.length), o.read(this, e, !0, 23, 4);
|
|
1093
|
-
}, a.prototype.readFloatBE = function(e, t) {
|
|
1094
|
-
return e = e >>> 0, t || C(e, 4, this.length), o.read(this, e, !1, 23, 4);
|
|
1095
|
-
}, a.prototype.readDoubleLE = function(e, t) {
|
|
1096
|
-
return e = e >>> 0, t || C(e, 8, this.length), o.read(this, e, !0, 52, 8);
|
|
1097
|
-
}, a.prototype.readDoubleBE = function(e, t) {
|
|
1098
|
-
return e = e >>> 0, t || C(e, 8, this.length), o.read(this, e, !1, 52, 8);
|
|
1099
|
-
};
|
|
1100
|
-
function $(i, e, t, n, c, u) {
|
|
1101
|
-
if (!a.isBuffer(i))
|
|
1102
|
-
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1103
|
-
if (e > c || e < u)
|
|
1104
|
-
throw new RangeError('"value" argument is out of bounds');
|
|
1105
|
-
if (t + n > i.length)
|
|
1106
|
-
throw new RangeError("Index out of range");
|
|
1107
|
-
}
|
|
1108
|
-
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(e, t, n, c) {
|
|
1109
|
-
if (e = +e, t = t >>> 0, n = n >>> 0, !c) {
|
|
1110
|
-
const _ = Math.pow(2, 8 * n) - 1;
|
|
1111
|
-
$(this, e, t, n, _, 0);
|
|
1112
|
-
}
|
|
1113
|
-
let u = 1, f = 0;
|
|
1114
|
-
for (this[t] = e & 255; ++f < n && (u *= 256); )
|
|
1115
|
-
this[t + f] = e / u & 255;
|
|
1116
|
-
return t + n;
|
|
1117
|
-
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(e, t, n, c) {
|
|
1118
|
-
if (e = +e, t = t >>> 0, n = n >>> 0, !c) {
|
|
1119
|
-
const _ = Math.pow(2, 8 * n) - 1;
|
|
1120
|
-
$(this, e, t, n, _, 0);
|
|
1121
|
-
}
|
|
1122
|
-
let u = n - 1, f = 1;
|
|
1123
|
-
for (this[t + u] = e & 255; --u >= 0 && (f *= 256); )
|
|
1124
|
-
this[t + u] = e / f & 255;
|
|
1125
|
-
return t + n;
|
|
1126
|
-
}, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(e, t, n) {
|
|
1127
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
|
|
1128
|
-
}, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(e, t, n) {
|
|
1129
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
1130
|
-
}, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(e, t, n) {
|
|
1131
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
1132
|
-
}, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(e, t, n) {
|
|
1133
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
|
|
1134
|
-
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(e, t, n) {
|
|
1135
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
1136
|
-
};
|
|
1137
|
-
function Ce(i, e, t, n, c) {
|
|
1138
|
-
Te(e, n, c, i, t, 7);
|
|
1139
|
-
let u = Number(e & BigInt(4294967295));
|
|
1140
|
-
i[t++] = u, u = u >> 8, i[t++] = u, u = u >> 8, i[t++] = u, u = u >> 8, i[t++] = u;
|
|
1141
|
-
let f = Number(e >> BigInt(32) & BigInt(4294967295));
|
|
1142
|
-
return i[t++] = f, f = f >> 8, i[t++] = f, f = f >> 8, i[t++] = f, f = f >> 8, i[t++] = f, t;
|
|
1143
|
-
}
|
|
1144
|
-
function Re(i, e, t, n, c) {
|
|
1145
|
-
Te(e, n, c, i, t, 7);
|
|
1146
|
-
let u = Number(e & BigInt(4294967295));
|
|
1147
|
-
i[t + 7] = u, u = u >> 8, i[t + 6] = u, u = u >> 8, i[t + 5] = u, u = u >> 8, i[t + 4] = u;
|
|
1148
|
-
let f = Number(e >> BigInt(32) & BigInt(4294967295));
|
|
1149
|
-
return i[t + 3] = f, f = f >> 8, i[t + 2] = f, f = f >> 8, i[t + 1] = f, f = f >> 8, i[t] = f, t + 8;
|
|
1150
|
-
}
|
|
1151
|
-
a.prototype.writeBigUInt64LE = P(function(e, t = 0) {
|
|
1152
|
-
return Ce(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1153
|
-
}), a.prototype.writeBigUInt64BE = P(function(e, t = 0) {
|
|
1154
|
-
return Re(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1155
|
-
}), a.prototype.writeIntLE = function(e, t, n, c) {
|
|
1156
|
-
if (e = +e, t = t >>> 0, !c) {
|
|
1157
|
-
const F = Math.pow(2, 8 * n - 1);
|
|
1158
|
-
$(this, e, t, n, F - 1, -F);
|
|
1159
|
-
}
|
|
1160
|
-
let u = 0, f = 1, _ = 0;
|
|
1161
|
-
for (this[t] = e & 255; ++u < n && (f *= 256); )
|
|
1162
|
-
e < 0 && _ === 0 && this[t + u - 1] !== 0 && (_ = 1), this[t + u] = (e / f >> 0) - _ & 255;
|
|
1163
|
-
return t + n;
|
|
1164
|
-
}, a.prototype.writeIntBE = function(e, t, n, c) {
|
|
1165
|
-
if (e = +e, t = t >>> 0, !c) {
|
|
1166
|
-
const F = Math.pow(2, 8 * n - 1);
|
|
1167
|
-
$(this, e, t, n, F - 1, -F);
|
|
1168
|
-
}
|
|
1169
|
-
let u = n - 1, f = 1, _ = 0;
|
|
1170
|
-
for (this[t + u] = e & 255; --u >= 0 && (f *= 256); )
|
|
1171
|
-
e < 0 && _ === 0 && this[t + u + 1] !== 0 && (_ = 1), this[t + u] = (e / f >> 0) - _ & 255;
|
|
1172
|
-
return t + n;
|
|
1173
|
-
}, a.prototype.writeInt8 = function(e, t, n) {
|
|
1174
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
|
|
1175
|
-
}, a.prototype.writeInt16LE = function(e, t, n) {
|
|
1176
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
1177
|
-
}, a.prototype.writeInt16BE = function(e, t, n) {
|
|
1178
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
1179
|
-
}, a.prototype.writeInt32LE = function(e, t, n) {
|
|
1180
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
|
|
1181
|
-
}, a.prototype.writeInt32BE = function(e, t, n) {
|
|
1182
|
-
return e = +e, t = t >>> 0, n || $(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
1183
|
-
}, a.prototype.writeBigInt64LE = P(function(e, t = 0) {
|
|
1184
|
-
return Ce(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1185
|
-
}), a.prototype.writeBigInt64BE = P(function(e, t = 0) {
|
|
1186
|
-
return Re(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1187
|
-
});
|
|
1188
|
-
function $e(i, e, t, n, c, u) {
|
|
1189
|
-
if (t + n > i.length)
|
|
1190
|
-
throw new RangeError("Index out of range");
|
|
1191
|
-
if (t < 0)
|
|
1192
|
-
throw new RangeError("Index out of range");
|
|
1193
|
-
}
|
|
1194
|
-
function Ae(i, e, t, n, c) {
|
|
1195
|
-
return e = +e, t = t >>> 0, c || $e(i, e, t, 4), o.write(i, e, t, n, 23, 4), t + 4;
|
|
1196
|
-
}
|
|
1197
|
-
a.prototype.writeFloatLE = function(e, t, n) {
|
|
1198
|
-
return Ae(this, e, t, !0, n);
|
|
1199
|
-
}, a.prototype.writeFloatBE = function(e, t, n) {
|
|
1200
|
-
return Ae(this, e, t, !1, n);
|
|
1201
|
-
};
|
|
1202
|
-
function Ue(i, e, t, n, c) {
|
|
1203
|
-
return e = +e, t = t >>> 0, c || $e(i, e, t, 8), o.write(i, e, t, n, 52, 8), t + 8;
|
|
1204
|
-
}
|
|
1205
|
-
a.prototype.writeDoubleLE = function(e, t, n) {
|
|
1206
|
-
return Ue(this, e, t, !0, n);
|
|
1207
|
-
}, a.prototype.writeDoubleBE = function(e, t, n) {
|
|
1208
|
-
return Ue(this, e, t, !1, n);
|
|
1209
|
-
}, a.prototype.copy = function(e, t, n, c) {
|
|
1210
|
-
if (!a.isBuffer(e))
|
|
1211
|
-
throw new TypeError("argument should be a Buffer");
|
|
1212
|
-
if (n || (n = 0), !c && c !== 0 && (c = this.length), t >= e.length && (t = e.length), t || (t = 0), c > 0 && c < n && (c = n), c === n || e.length === 0 || this.length === 0)
|
|
1213
|
-
return 0;
|
|
1214
|
-
if (t < 0)
|
|
1215
|
-
throw new RangeError("targetStart out of bounds");
|
|
1216
|
-
if (n < 0 || n >= this.length)
|
|
1217
|
-
throw new RangeError("Index out of range");
|
|
1218
|
-
if (c < 0)
|
|
1219
|
-
throw new RangeError("sourceEnd out of bounds");
|
|
1220
|
-
c > this.length && (c = this.length), e.length - t < c - n && (c = e.length - t + n);
|
|
1221
|
-
const u = c - n;
|
|
1222
|
-
return this === e && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(t, n, c) : Uint8Array.prototype.set.call(
|
|
1223
|
-
e,
|
|
1224
|
-
this.subarray(n, c),
|
|
1225
|
-
t
|
|
1226
|
-
), u;
|
|
1227
|
-
}, a.prototype.fill = function(e, t, n, c) {
|
|
1228
|
-
if (typeof e == "string") {
|
|
1229
|
-
if (typeof t == "string" ? (c = t, t = 0, n = this.length) : typeof n == "string" && (c = n, n = this.length), c !== void 0 && typeof c != "string")
|
|
1230
|
-
throw new TypeError("encoding must be a string");
|
|
1231
|
-
if (typeof c == "string" && !a.isEncoding(c))
|
|
1232
|
-
throw new TypeError("Unknown encoding: " + c);
|
|
1233
|
-
if (e.length === 1) {
|
|
1234
|
-
const f = e.charCodeAt(0);
|
|
1235
|
-
(c === "utf8" && f < 128 || c === "latin1") && (e = f);
|
|
2254
|
+
return y;
|
|
2255
|
+
}
|
|
2256
|
+
function Ur(o, e, r, a) {
|
|
2257
|
+
return Ne(tt(e, o.length - r), o, r, a);
|
|
2258
|
+
}
|
|
2259
|
+
function Dr(o, e, r, a) {
|
|
2260
|
+
return Ne(zr(e), o, r, a);
|
|
2261
|
+
}
|
|
2262
|
+
function kr(o, e, r, a) {
|
|
2263
|
+
return Ne(Pt(e), o, r, a);
|
|
2264
|
+
}
|
|
2265
|
+
function Mr(o, e, r, a) {
|
|
2266
|
+
return Ne(Yr(e, o.length - r), o, r, a);
|
|
2267
|
+
}
|
|
2268
|
+
u.prototype.write = function(e, r, a, f) {
|
|
2269
|
+
if (r === void 0)
|
|
2270
|
+
f = "utf8", a = this.length, r = 0;
|
|
2271
|
+
else if (a === void 0 && typeof r == "string")
|
|
2272
|
+
f = r, a = this.length, r = 0;
|
|
2273
|
+
else if (isFinite(r))
|
|
2274
|
+
r = r >>> 0, isFinite(a) ? (a = a >>> 0, f === void 0 && (f = "utf8")) : (f = a, a = void 0);
|
|
2275
|
+
else
|
|
2276
|
+
throw new Error(
|
|
2277
|
+
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
2278
|
+
);
|
|
2279
|
+
const d = this.length - r;
|
|
2280
|
+
if ((a === void 0 || a > d) && (a = d), e.length > 0 && (a < 0 || r < 0) || r > this.length)
|
|
2281
|
+
throw new RangeError("Attempt to write outside buffer bounds");
|
|
2282
|
+
f || (f = "utf8");
|
|
2283
|
+
let y = !1;
|
|
2284
|
+
for (; ; )
|
|
2285
|
+
switch (f) {
|
|
2286
|
+
case "hex":
|
|
2287
|
+
return Or(this, e, r, a);
|
|
2288
|
+
case "utf8":
|
|
2289
|
+
case "utf-8":
|
|
2290
|
+
return Ur(this, e, r, a);
|
|
2291
|
+
case "ascii":
|
|
2292
|
+
case "latin1":
|
|
2293
|
+
case "binary":
|
|
2294
|
+
return Dr(this, e, r, a);
|
|
2295
|
+
case "base64":
|
|
2296
|
+
return kr(this, e, r, a);
|
|
2297
|
+
case "ucs2":
|
|
2298
|
+
case "ucs-2":
|
|
2299
|
+
case "utf16le":
|
|
2300
|
+
case "utf-16le":
|
|
2301
|
+
return Mr(this, e, r, a);
|
|
2302
|
+
default:
|
|
2303
|
+
if (y) throw new TypeError("Unknown encoding: " + f);
|
|
2304
|
+
f = ("" + f).toLowerCase(), y = !0;
|
|
2305
|
+
}
|
|
2306
|
+
}, u.prototype.toJSON = function() {
|
|
2307
|
+
return {
|
|
2308
|
+
type: "Buffer",
|
|
2309
|
+
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
2310
|
+
};
|
|
2311
|
+
};
|
|
2312
|
+
function Lr(o, e, r) {
|
|
2313
|
+
return e === 0 && r === o.length ? t.fromByteArray(o) : t.fromByteArray(o.slice(e, r));
|
|
2314
|
+
}
|
|
2315
|
+
function At(o, e, r) {
|
|
2316
|
+
r = Math.min(o.length, r);
|
|
2317
|
+
const a = [];
|
|
2318
|
+
let f = e;
|
|
2319
|
+
for (; f < r; ) {
|
|
2320
|
+
const d = o[f];
|
|
2321
|
+
let y = null, F = d > 239 ? 4 : d > 223 ? 3 : d > 191 ? 2 : 1;
|
|
2322
|
+
if (f + F <= r) {
|
|
2323
|
+
let U, O, D, C;
|
|
2324
|
+
switch (F) {
|
|
2325
|
+
case 1:
|
|
2326
|
+
d < 128 && (y = d);
|
|
2327
|
+
break;
|
|
2328
|
+
case 2:
|
|
2329
|
+
U = o[f + 1], (U & 192) === 128 && (C = (d & 31) << 6 | U & 63, C > 127 && (y = C));
|
|
2330
|
+
break;
|
|
2331
|
+
case 3:
|
|
2332
|
+
U = o[f + 1], O = o[f + 2], (U & 192) === 128 && (O & 192) === 128 && (C = (d & 15) << 12 | (U & 63) << 6 | O & 63, C > 2047 && (C < 55296 || C > 57343) && (y = C));
|
|
2333
|
+
break;
|
|
2334
|
+
case 4:
|
|
2335
|
+
U = o[f + 1], O = o[f + 2], D = o[f + 3], (U & 192) === 128 && (O & 192) === 128 && (D & 192) === 128 && (C = (d & 15) << 18 | (U & 63) << 12 | (O & 63) << 6 | D & 63, C > 65535 && C < 1114112 && (y = C));
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
y === null ? (y = 65533, F = 1) : y > 65535 && (y -= 65536, a.push(y >>> 10 & 1023 | 55296), y = 56320 | y & 1023), a.push(y), f += F;
|
|
1236
2339
|
}
|
|
1237
|
-
|
|
1238
|
-
typeof e == "number" ? e = e & 255 : typeof e == "boolean" && (e = Number(e));
|
|
1239
|
-
if (t < 0 || this.length < t || this.length < n)
|
|
1240
|
-
throw new RangeError("Out of range index");
|
|
1241
|
-
if (n <= t)
|
|
1242
|
-
return this;
|
|
1243
|
-
t = t >>> 0, n = n === void 0 ? this.length : n >>> 0, e || (e = 0);
|
|
1244
|
-
let u;
|
|
1245
|
-
if (typeof e == "number")
|
|
1246
|
-
for (u = t; u < n; ++u)
|
|
1247
|
-
this[u] = e;
|
|
1248
|
-
else {
|
|
1249
|
-
const f = a.isBuffer(e) ? e : a.from(e, c), _ = f.length;
|
|
1250
|
-
if (_ === 0)
|
|
1251
|
-
throw new TypeError('The value "' + e + '" is invalid for argument "value"');
|
|
1252
|
-
for (u = 0; u < n - t; ++u)
|
|
1253
|
-
this[u + t] = f[u % _];
|
|
2340
|
+
return Pr(a);
|
|
1254
2341
|
}
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
2342
|
+
const Ct = 4096;
|
|
2343
|
+
function Pr(o) {
|
|
2344
|
+
const e = o.length;
|
|
2345
|
+
if (e <= Ct)
|
|
2346
|
+
return String.fromCharCode.apply(String, o);
|
|
2347
|
+
let r = "", a = 0;
|
|
2348
|
+
for (; a < e; )
|
|
2349
|
+
r += String.fromCharCode.apply(
|
|
2350
|
+
String,
|
|
2351
|
+
o.slice(a, a += Ct)
|
|
2352
|
+
);
|
|
2353
|
+
return r;
|
|
2354
|
+
}
|
|
2355
|
+
function $r(o, e, r) {
|
|
2356
|
+
let a = "";
|
|
2357
|
+
r = Math.min(o.length, r);
|
|
2358
|
+
for (let f = e; f < r; ++f)
|
|
2359
|
+
a += String.fromCharCode(o[f] & 127);
|
|
2360
|
+
return a;
|
|
2361
|
+
}
|
|
2362
|
+
function Nr(o, e, r) {
|
|
2363
|
+
let a = "";
|
|
2364
|
+
r = Math.min(o.length, r);
|
|
2365
|
+
for (let f = e; f < r; ++f)
|
|
2366
|
+
a += String.fromCharCode(o[f]);
|
|
2367
|
+
return a;
|
|
2368
|
+
}
|
|
2369
|
+
function qr(o, e, r) {
|
|
2370
|
+
const a = o.length;
|
|
2371
|
+
(!e || e < 0) && (e = 0), (!r || r < 0 || r > a) && (r = a);
|
|
2372
|
+
let f = "";
|
|
2373
|
+
for (let d = e; d < r; ++d)
|
|
2374
|
+
f += Gr[o[d]];
|
|
2375
|
+
return f;
|
|
2376
|
+
}
|
|
2377
|
+
function jr(o, e, r) {
|
|
2378
|
+
const a = o.slice(e, r);
|
|
2379
|
+
let f = "";
|
|
2380
|
+
for (let d = 0; d < a.length - 1; d += 2)
|
|
2381
|
+
f += String.fromCharCode(a[d] + a[d + 1] * 256);
|
|
2382
|
+
return f;
|
|
2383
|
+
}
|
|
2384
|
+
u.prototype.slice = function(e, r) {
|
|
2385
|
+
const a = this.length;
|
|
2386
|
+
e = ~~e, r = r === void 0 ? a : ~~r, e < 0 ? (e += a, e < 0 && (e = 0)) : e > a && (e = a), r < 0 ? (r += a, r < 0 && (r = 0)) : r > a && (r = a), r < e && (r = e);
|
|
2387
|
+
const f = this.subarray(e, r);
|
|
2388
|
+
return Object.setPrototypeOf(f, u.prototype), f;
|
|
2389
|
+
};
|
|
2390
|
+
function L(o, e, r) {
|
|
2391
|
+
if (o % 1 !== 0 || o < 0) throw new RangeError("offset is not uint");
|
|
2392
|
+
if (o + e > r) throw new RangeError("Trying to access beyond buffer length");
|
|
2393
|
+
}
|
|
2394
|
+
u.prototype.readUintLE = u.prototype.readUIntLE = function(e, r, a) {
|
|
2395
|
+
e = e >>> 0, r = r >>> 0, a || L(e, r, this.length);
|
|
2396
|
+
let f = this[e], d = 1, y = 0;
|
|
2397
|
+
for (; ++y < r && (d *= 256); )
|
|
2398
|
+
f += this[e + y] * d;
|
|
2399
|
+
return f;
|
|
2400
|
+
}, u.prototype.readUintBE = u.prototype.readUIntBE = function(e, r, a) {
|
|
2401
|
+
e = e >>> 0, r = r >>> 0, a || L(e, r, this.length);
|
|
2402
|
+
let f = this[e + --r], d = 1;
|
|
2403
|
+
for (; r > 0 && (d *= 256); )
|
|
2404
|
+
f += this[e + --r] * d;
|
|
2405
|
+
return f;
|
|
2406
|
+
}, u.prototype.readUint8 = u.prototype.readUInt8 = function(e, r) {
|
|
2407
|
+
return e = e >>> 0, r || L(e, 1, this.length), this[e];
|
|
2408
|
+
}, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(e, r) {
|
|
2409
|
+
return e = e >>> 0, r || L(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
2410
|
+
}, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(e, r) {
|
|
2411
|
+
return e = e >>> 0, r || L(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
2412
|
+
}, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(e, r) {
|
|
2413
|
+
return e = e >>> 0, r || L(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
2414
|
+
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(e, r) {
|
|
2415
|
+
return e = e >>> 0, r || L(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
2416
|
+
}, u.prototype.readBigUInt64LE = le(function(e) {
|
|
2417
|
+
e = e >>> 0, xe(e, "offset");
|
|
2418
|
+
const r = this[e], a = this[e + 7];
|
|
2419
|
+
(r === void 0 || a === void 0) && Ce(e, this.length - 8);
|
|
2420
|
+
const f = r + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, d = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + a * 2 ** 24;
|
|
2421
|
+
return BigInt(f) + (BigInt(d) << BigInt(32));
|
|
2422
|
+
}), u.prototype.readBigUInt64BE = le(function(e) {
|
|
2423
|
+
e = e >>> 0, xe(e, "offset");
|
|
2424
|
+
const r = this[e], a = this[e + 7];
|
|
2425
|
+
(r === void 0 || a === void 0) && Ce(e, this.length - 8);
|
|
2426
|
+
const f = r * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], d = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + a;
|
|
2427
|
+
return (BigInt(f) << BigInt(32)) + BigInt(d);
|
|
2428
|
+
}), u.prototype.readIntLE = function(e, r, a) {
|
|
2429
|
+
e = e >>> 0, r = r >>> 0, a || L(e, r, this.length);
|
|
2430
|
+
let f = this[e], d = 1, y = 0;
|
|
2431
|
+
for (; ++y < r && (d *= 256); )
|
|
2432
|
+
f += this[e + y] * d;
|
|
2433
|
+
return d *= 128, f >= d && (f -= Math.pow(2, 8 * r)), f;
|
|
2434
|
+
}, u.prototype.readIntBE = function(e, r, a) {
|
|
2435
|
+
e = e >>> 0, r = r >>> 0, a || L(e, r, this.length);
|
|
2436
|
+
let f = r, d = 1, y = this[e + --f];
|
|
2437
|
+
for (; f > 0 && (d *= 256); )
|
|
2438
|
+
y += this[e + --f] * d;
|
|
2439
|
+
return d *= 128, y >= d && (y -= Math.pow(2, 8 * r)), y;
|
|
2440
|
+
}, u.prototype.readInt8 = function(e, r) {
|
|
2441
|
+
return e = e >>> 0, r || L(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
2442
|
+
}, u.prototype.readInt16LE = function(e, r) {
|
|
2443
|
+
e = e >>> 0, r || L(e, 2, this.length);
|
|
2444
|
+
const a = this[e] | this[e + 1] << 8;
|
|
2445
|
+
return a & 32768 ? a | 4294901760 : a;
|
|
2446
|
+
}, u.prototype.readInt16BE = function(e, r) {
|
|
2447
|
+
e = e >>> 0, r || L(e, 2, this.length);
|
|
2448
|
+
const a = this[e + 1] | this[e] << 8;
|
|
2449
|
+
return a & 32768 ? a | 4294901760 : a;
|
|
2450
|
+
}, u.prototype.readInt32LE = function(e, r) {
|
|
2451
|
+
return e = e >>> 0, r || L(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
2452
|
+
}, u.prototype.readInt32BE = function(e, r) {
|
|
2453
|
+
return e = e >>> 0, r || L(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
2454
|
+
}, u.prototype.readBigInt64LE = le(function(e) {
|
|
2455
|
+
e = e >>> 0, xe(e, "offset");
|
|
2456
|
+
const r = this[e], a = this[e + 7];
|
|
2457
|
+
(r === void 0 || a === void 0) && Ce(e, this.length - 8);
|
|
2458
|
+
const f = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (a << 24);
|
|
2459
|
+
return (BigInt(f) << BigInt(32)) + BigInt(r + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
|
|
2460
|
+
}), u.prototype.readBigInt64BE = le(function(e) {
|
|
2461
|
+
e = e >>> 0, xe(e, "offset");
|
|
2462
|
+
const r = this[e], a = this[e + 7];
|
|
2463
|
+
(r === void 0 || a === void 0) && Ce(e, this.length - 8);
|
|
2464
|
+
const f = (r << 24) + // Overflow
|
|
2465
|
+
this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
|
|
2466
|
+
return (BigInt(f) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + a);
|
|
2467
|
+
}), u.prototype.readFloatLE = function(e, r) {
|
|
2468
|
+
return e = e >>> 0, r || L(e, 4, this.length), i.read(this, e, !0, 23, 4);
|
|
2469
|
+
}, u.prototype.readFloatBE = function(e, r) {
|
|
2470
|
+
return e = e >>> 0, r || L(e, 4, this.length), i.read(this, e, !1, 23, 4);
|
|
2471
|
+
}, u.prototype.readDoubleLE = function(e, r) {
|
|
2472
|
+
return e = e >>> 0, r || L(e, 8, this.length), i.read(this, e, !0, 52, 8);
|
|
2473
|
+
}, u.prototype.readDoubleBE = function(e, r) {
|
|
2474
|
+
return e = e >>> 0, r || L(e, 8, this.length), i.read(this, e, !1, 52, 8);
|
|
2475
|
+
};
|
|
2476
|
+
function H(o, e, r, a, f, d) {
|
|
2477
|
+
if (!u.isBuffer(o)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
2478
|
+
if (e > f || e < d) throw new RangeError('"value" argument is out of bounds');
|
|
2479
|
+
if (r + a > o.length) throw new RangeError("Index out of range");
|
|
2480
|
+
}
|
|
2481
|
+
u.prototype.writeUintLE = u.prototype.writeUIntLE = function(e, r, a, f) {
|
|
2482
|
+
if (e = +e, r = r >>> 0, a = a >>> 0, !f) {
|
|
2483
|
+
const F = Math.pow(2, 8 * a) - 1;
|
|
2484
|
+
H(this, e, r, a, F, 0);
|
|
1266
2485
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
2486
|
+
let d = 1, y = 0;
|
|
2487
|
+
for (this[r] = e & 255; ++y < a && (d *= 256); )
|
|
2488
|
+
this[r + y] = e / d & 255;
|
|
2489
|
+
return r + a;
|
|
2490
|
+
}, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(e, r, a, f) {
|
|
2491
|
+
if (e = +e, r = r >>> 0, a = a >>> 0, !f) {
|
|
2492
|
+
const F = Math.pow(2, 8 * a) - 1;
|
|
2493
|
+
H(this, e, r, a, F, 0);
|
|
1269
2494
|
}
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
2495
|
+
let d = a - 1, y = 1;
|
|
2496
|
+
for (this[r + d] = e & 255; --d >= 0 && (y *= 256); )
|
|
2497
|
+
this[r + d] = e / y & 255;
|
|
2498
|
+
return r + a;
|
|
2499
|
+
}, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(e, r, a) {
|
|
2500
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 1, 255, 0), this[r] = e & 255, r + 1;
|
|
2501
|
+
}, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(e, r, a) {
|
|
2502
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 2, 65535, 0), this[r] = e & 255, this[r + 1] = e >>> 8, r + 2;
|
|
2503
|
+
}, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(e, r, a) {
|
|
2504
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 2, 65535, 0), this[r] = e >>> 8, this[r + 1] = e & 255, r + 2;
|
|
2505
|
+
}, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(e, r, a) {
|
|
2506
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 4, 4294967295, 0), this[r + 3] = e >>> 24, this[r + 2] = e >>> 16, this[r + 1] = e >>> 8, this[r] = e & 255, r + 4;
|
|
2507
|
+
}, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(e, r, a) {
|
|
2508
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 4, 4294967295, 0), this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255, r + 4;
|
|
2509
|
+
};
|
|
2510
|
+
function Tt(o, e, r, a, f) {
|
|
2511
|
+
Lt(e, a, f, o, r, 7);
|
|
2512
|
+
let d = Number(e & BigInt(4294967295));
|
|
2513
|
+
o[r++] = d, d = d >> 8, o[r++] = d, d = d >> 8, o[r++] = d, d = d >> 8, o[r++] = d;
|
|
2514
|
+
let y = Number(e >> BigInt(32) & BigInt(4294967295));
|
|
2515
|
+
return o[r++] = y, y = y >> 8, o[r++] = y, y = y >> 8, o[r++] = y, y = y >> 8, o[r++] = y, r;
|
|
2516
|
+
}
|
|
2517
|
+
function Ot(o, e, r, a, f) {
|
|
2518
|
+
Lt(e, a, f, o, r, 7);
|
|
2519
|
+
let d = Number(e & BigInt(4294967295));
|
|
2520
|
+
o[r + 7] = d, d = d >> 8, o[r + 6] = d, d = d >> 8, o[r + 5] = d, d = d >> 8, o[r + 4] = d;
|
|
2521
|
+
let y = Number(e >> BigInt(32) & BigInt(4294967295));
|
|
2522
|
+
return o[r + 3] = y, y = y >> 8, o[r + 2] = y, y = y >> 8, o[r + 1] = y, y = y >> 8, o[r] = y, r + 8;
|
|
2523
|
+
}
|
|
2524
|
+
u.prototype.writeBigUInt64LE = le(function(e, r = 0) {
|
|
2525
|
+
return Tt(this, e, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2526
|
+
}), u.prototype.writeBigUInt64BE = le(function(e, r = 0) {
|
|
2527
|
+
return Ot(this, e, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2528
|
+
}), u.prototype.writeIntLE = function(e, r, a, f) {
|
|
2529
|
+
if (e = +e, r = r >>> 0, !f) {
|
|
2530
|
+
const U = Math.pow(2, 8 * a - 1);
|
|
2531
|
+
H(this, e, r, a, U - 1, -U);
|
|
1277
2532
|
}
|
|
1278
|
-
|
|
1279
|
-
|
|
2533
|
+
let d = 0, y = 1, F = 0;
|
|
2534
|
+
for (this[r] = e & 255; ++d < a && (y *= 256); )
|
|
2535
|
+
e < 0 && F === 0 && this[r + d - 1] !== 0 && (F = 1), this[r + d] = (e / y >> 0) - F & 255;
|
|
2536
|
+
return r + a;
|
|
2537
|
+
}, u.prototype.writeIntBE = function(e, r, a, f) {
|
|
2538
|
+
if (e = +e, r = r >>> 0, !f) {
|
|
2539
|
+
const U = Math.pow(2, 8 * a - 1);
|
|
2540
|
+
H(this, e, r, a, U - 1, -U);
|
|
1280
2541
|
}
|
|
2542
|
+
let d = a - 1, y = 1, F = 0;
|
|
2543
|
+
for (this[r + d] = e & 255; --d >= 0 && (y *= 256); )
|
|
2544
|
+
e < 0 && F === 0 && this[r + d + 1] !== 0 && (F = 1), this[r + d] = (e / y >> 0) - F & 255;
|
|
2545
|
+
return r + a;
|
|
2546
|
+
}, u.prototype.writeInt8 = function(e, r, a) {
|
|
2547
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[r] = e & 255, r + 1;
|
|
2548
|
+
}, u.prototype.writeInt16LE = function(e, r, a) {
|
|
2549
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 2, 32767, -32768), this[r] = e & 255, this[r + 1] = e >>> 8, r + 2;
|
|
2550
|
+
}, u.prototype.writeInt16BE = function(e, r, a) {
|
|
2551
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 2, 32767, -32768), this[r] = e >>> 8, this[r + 1] = e & 255, r + 2;
|
|
2552
|
+
}, u.prototype.writeInt32LE = function(e, r, a) {
|
|
2553
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 4, 2147483647, -2147483648), this[r] = e & 255, this[r + 1] = e >>> 8, this[r + 2] = e >>> 16, this[r + 3] = e >>> 24, r + 4;
|
|
2554
|
+
}, u.prototype.writeInt32BE = function(e, r, a) {
|
|
2555
|
+
return e = +e, r = r >>> 0, a || H(this, e, r, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255, r + 4;
|
|
2556
|
+
}, u.prototype.writeBigInt64LE = le(function(e, r = 0) {
|
|
2557
|
+
return Tt(this, e, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2558
|
+
}), u.prototype.writeBigInt64BE = le(function(e, r = 0) {
|
|
2559
|
+
return Ot(this, e, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2560
|
+
});
|
|
2561
|
+
function Ut(o, e, r, a, f, d) {
|
|
2562
|
+
if (r + a > o.length) throw new RangeError("Index out of range");
|
|
2563
|
+
if (r < 0) throw new RangeError("Index out of range");
|
|
2564
|
+
}
|
|
2565
|
+
function Dt(o, e, r, a, f) {
|
|
2566
|
+
return e = +e, r = r >>> 0, f || Ut(o, e, r, 4), i.write(o, e, r, a, 23, 4), r + 4;
|
|
2567
|
+
}
|
|
2568
|
+
u.prototype.writeFloatLE = function(e, r, a) {
|
|
2569
|
+
return Dt(this, e, r, !0, a);
|
|
2570
|
+
}, u.prototype.writeFloatBE = function(e, r, a) {
|
|
2571
|
+
return Dt(this, e, r, !1, a);
|
|
1281
2572
|
};
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
function(
|
|
1286
|
-
return
|
|
1287
|
-
},
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
2573
|
+
function kt(o, e, r, a, f) {
|
|
2574
|
+
return e = +e, r = r >>> 0, f || Ut(o, e, r, 8), i.write(o, e, r, a, 52, 8), r + 8;
|
|
2575
|
+
}
|
|
2576
|
+
u.prototype.writeDoubleLE = function(e, r, a) {
|
|
2577
|
+
return kt(this, e, r, !0, a);
|
|
2578
|
+
}, u.prototype.writeDoubleBE = function(e, r, a) {
|
|
2579
|
+
return kt(this, e, r, !1, a);
|
|
2580
|
+
}, u.prototype.copy = function(e, r, a, f) {
|
|
2581
|
+
if (!u.isBuffer(e)) throw new TypeError("argument should be a Buffer");
|
|
2582
|
+
if (a || (a = 0), !f && f !== 0 && (f = this.length), r >= e.length && (r = e.length), r || (r = 0), f > 0 && f < a && (f = a), f === a || e.length === 0 || this.length === 0) return 0;
|
|
2583
|
+
if (r < 0)
|
|
2584
|
+
throw new RangeError("targetStart out of bounds");
|
|
2585
|
+
if (a < 0 || a >= this.length) throw new RangeError("Index out of range");
|
|
2586
|
+
if (f < 0) throw new RangeError("sourceEnd out of bounds");
|
|
2587
|
+
f > this.length && (f = this.length), e.length - r < f - a && (f = e.length - r + a);
|
|
2588
|
+
const d = f - a;
|
|
2589
|
+
return this === e && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(r, a, f) : Uint8Array.prototype.set.call(
|
|
2590
|
+
e,
|
|
2591
|
+
this.subarray(a, f),
|
|
2592
|
+
r
|
|
2593
|
+
), d;
|
|
2594
|
+
}, u.prototype.fill = function(e, r, a, f) {
|
|
2595
|
+
if (typeof e == "string") {
|
|
2596
|
+
if (typeof r == "string" ? (f = r, r = 0, a = this.length) : typeof a == "string" && (f = a, a = this.length), f !== void 0 && typeof f != "string")
|
|
2597
|
+
throw new TypeError("encoding must be a string");
|
|
2598
|
+
if (typeof f == "string" && !u.isEncoding(f))
|
|
2599
|
+
throw new TypeError("Unknown encoding: " + f);
|
|
2600
|
+
if (e.length === 1) {
|
|
2601
|
+
const y = e.charCodeAt(0);
|
|
2602
|
+
(f === "utf8" && y < 128 || f === "latin1") && (e = y);
|
|
2603
|
+
}
|
|
2604
|
+
} else typeof e == "number" ? e = e & 255 : typeof e == "boolean" && (e = Number(e));
|
|
2605
|
+
if (r < 0 || this.length < r || this.length < a)
|
|
2606
|
+
throw new RangeError("Out of range index");
|
|
2607
|
+
if (a <= r)
|
|
2608
|
+
return this;
|
|
2609
|
+
r = r >>> 0, a = a === void 0 ? this.length : a >>> 0, e || (e = 0);
|
|
2610
|
+
let d;
|
|
2611
|
+
if (typeof e == "number")
|
|
2612
|
+
for (d = r; d < a; ++d)
|
|
2613
|
+
this[d] = e;
|
|
2614
|
+
else {
|
|
2615
|
+
const y = u.isBuffer(e) ? e : u.from(e, f), F = y.length;
|
|
2616
|
+
if (F === 0)
|
|
2617
|
+
throw new TypeError('The value "' + e + '" is invalid for argument "value"');
|
|
2618
|
+
for (d = 0; d < a - r; ++d)
|
|
2619
|
+
this[d + r] = y[d % F];
|
|
2620
|
+
}
|
|
2621
|
+
return this;
|
|
2622
|
+
};
|
|
2623
|
+
const Ee = {};
|
|
2624
|
+
function et(o, e, r) {
|
|
2625
|
+
Ee[o] = class extends r {
|
|
2626
|
+
constructor() {
|
|
2627
|
+
super(), Object.defineProperty(this, "message", {
|
|
2628
|
+
value: e.apply(this, arguments),
|
|
2629
|
+
writable: !0,
|
|
2630
|
+
configurable: !0
|
|
2631
|
+
}), this.name = `${this.name} [${o}]`, this.stack, delete this.name;
|
|
2632
|
+
}
|
|
2633
|
+
get code() {
|
|
2634
|
+
return o;
|
|
2635
|
+
}
|
|
2636
|
+
set code(f) {
|
|
2637
|
+
Object.defineProperty(this, "code", {
|
|
2638
|
+
configurable: !0,
|
|
2639
|
+
enumerable: !0,
|
|
2640
|
+
value: f,
|
|
2641
|
+
writable: !0
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
toString() {
|
|
2645
|
+
return `${this.name} [${o}]: ${this.message}`;
|
|
2646
|
+
}
|
|
2647
|
+
};
|
|
2648
|
+
}
|
|
2649
|
+
et(
|
|
2650
|
+
"ERR_BUFFER_OUT_OF_BOUNDS",
|
|
2651
|
+
function(o) {
|
|
2652
|
+
return o ? `${o} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
2653
|
+
},
|
|
2654
|
+
RangeError
|
|
2655
|
+
), et(
|
|
2656
|
+
"ERR_INVALID_ARG_TYPE",
|
|
2657
|
+
function(o, e) {
|
|
2658
|
+
return `The "${o}" argument must be of type number. Received type ${typeof e}`;
|
|
2659
|
+
},
|
|
2660
|
+
TypeError
|
|
2661
|
+
), et(
|
|
2662
|
+
"ERR_OUT_OF_RANGE",
|
|
2663
|
+
function(o, e, r) {
|
|
2664
|
+
let a = `The value of "${o}" is out of range.`, f = r;
|
|
2665
|
+
return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? f = Mt(String(r)) : typeof r == "bigint" && (f = String(r), (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) && (f = Mt(f)), f += "n"), a += ` It must be ${e}. Received ${f}`, a;
|
|
2666
|
+
},
|
|
2667
|
+
RangeError
|
|
1330
2668
|
);
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
2669
|
+
function Mt(o) {
|
|
2670
|
+
let e = "", r = o.length;
|
|
2671
|
+
const a = o[0] === "-" ? 1 : 0;
|
|
2672
|
+
for (; r >= a + 4; r -= 3)
|
|
2673
|
+
e = `_${o.slice(r - 3, r)}${e}`;
|
|
2674
|
+
return `${o.slice(0, r)}${e}`;
|
|
2675
|
+
}
|
|
2676
|
+
function Wr(o, e, r) {
|
|
2677
|
+
xe(e, "offset"), (o[e] === void 0 || o[e + r] === void 0) && Ce(e, o.length - (r + 1));
|
|
2678
|
+
}
|
|
2679
|
+
function Lt(o, e, r, a, f, d) {
|
|
2680
|
+
if (o > r || o < e) {
|
|
2681
|
+
const y = typeof e == "bigint" ? "n" : "";
|
|
2682
|
+
let F;
|
|
2683
|
+
throw e === 0 || e === BigInt(0) ? F = `>= 0${y} and < 2${y} ** ${(d + 1) * 8}${y}` : F = `>= -(2${y} ** ${(d + 1) * 8 - 1}${y}) and < 2 ** ${(d + 1) * 8 - 1}${y}`, new Ee.ERR_OUT_OF_RANGE("value", F, o);
|
|
2684
|
+
}
|
|
2685
|
+
Wr(a, f, d);
|
|
2686
|
+
}
|
|
2687
|
+
function xe(o, e) {
|
|
2688
|
+
if (typeof o != "number")
|
|
2689
|
+
throw new Ee.ERR_INVALID_ARG_TYPE(e, "number", o);
|
|
2690
|
+
}
|
|
2691
|
+
function Ce(o, e, r) {
|
|
2692
|
+
throw Math.floor(o) !== o ? (xe(o, r), new Ee.ERR_OUT_OF_RANGE("offset", "an integer", o)) : e < 0 ? new Ee.ERR_BUFFER_OUT_OF_BOUNDS() : new Ee.ERR_OUT_OF_RANGE(
|
|
2693
|
+
"offset",
|
|
2694
|
+
`>= 0 and <= ${e}`,
|
|
2695
|
+
o
|
|
2696
|
+
);
|
|
2697
|
+
}
|
|
2698
|
+
const Vr = /[^+/0-9A-Za-z-_]/g;
|
|
2699
|
+
function Hr(o) {
|
|
2700
|
+
if (o = o.split("=")[0], o = o.trim().replace(Vr, ""), o.length < 2) return "";
|
|
2701
|
+
for (; o.length % 4 !== 0; )
|
|
2702
|
+
o = o + "=";
|
|
2703
|
+
return o;
|
|
2704
|
+
}
|
|
2705
|
+
function tt(o, e) {
|
|
2706
|
+
e = e || 1 / 0;
|
|
2707
|
+
let r;
|
|
2708
|
+
const a = o.length;
|
|
2709
|
+
let f = null;
|
|
2710
|
+
const d = [];
|
|
2711
|
+
for (let y = 0; y < a; ++y) {
|
|
2712
|
+
if (r = o.charCodeAt(y), r > 55295 && r < 57344) {
|
|
2713
|
+
if (!f) {
|
|
2714
|
+
if (r > 56319) {
|
|
2715
|
+
(e -= 3) > -1 && d.push(239, 191, 189);
|
|
2716
|
+
continue;
|
|
2717
|
+
} else if (y + 1 === a) {
|
|
2718
|
+
(e -= 3) > -1 && d.push(239, 191, 189);
|
|
2719
|
+
continue;
|
|
2720
|
+
}
|
|
2721
|
+
f = r;
|
|
1351
2722
|
continue;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
2723
|
+
}
|
|
2724
|
+
if (r < 56320) {
|
|
2725
|
+
(e -= 3) > -1 && d.push(239, 191, 189), f = r;
|
|
1354
2726
|
continue;
|
|
1355
2727
|
}
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
if (
|
|
1368
|
-
break;
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
}
|
|
1439
|
-
function ft() {
|
|
1440
|
-
throw new Error("BigInt not supported");
|
|
1441
|
-
}
|
|
1442
|
-
})(me);
|
|
1443
|
-
const Yt = (s) => {
|
|
1444
|
-
const r = me.Buffer.from(s, "base64").toString("utf8"), o = me.Buffer.from(r, "binary").toString("base64");
|
|
1445
|
-
return s === o ? r : s;
|
|
1446
|
-
}, Xt = async (s) => {
|
|
1447
|
-
const r = Yt(s), o = JSON.parse(r);
|
|
2728
|
+
r = (f - 55296 << 10 | r - 56320) + 65536;
|
|
2729
|
+
} else f && (e -= 3) > -1 && d.push(239, 191, 189);
|
|
2730
|
+
if (f = null, r < 128) {
|
|
2731
|
+
if ((e -= 1) < 0) break;
|
|
2732
|
+
d.push(r);
|
|
2733
|
+
} else if (r < 2048) {
|
|
2734
|
+
if ((e -= 2) < 0) break;
|
|
2735
|
+
d.push(
|
|
2736
|
+
r >> 6 | 192,
|
|
2737
|
+
r & 63 | 128
|
|
2738
|
+
);
|
|
2739
|
+
} else if (r < 65536) {
|
|
2740
|
+
if ((e -= 3) < 0) break;
|
|
2741
|
+
d.push(
|
|
2742
|
+
r >> 12 | 224,
|
|
2743
|
+
r >> 6 & 63 | 128,
|
|
2744
|
+
r & 63 | 128
|
|
2745
|
+
);
|
|
2746
|
+
} else if (r < 1114112) {
|
|
2747
|
+
if ((e -= 4) < 0) break;
|
|
2748
|
+
d.push(
|
|
2749
|
+
r >> 18 | 240,
|
|
2750
|
+
r >> 12 & 63 | 128,
|
|
2751
|
+
r >> 6 & 63 | 128,
|
|
2752
|
+
r & 63 | 128
|
|
2753
|
+
);
|
|
2754
|
+
} else
|
|
2755
|
+
throw new Error("Invalid code point");
|
|
2756
|
+
}
|
|
2757
|
+
return d;
|
|
2758
|
+
}
|
|
2759
|
+
function zr(o) {
|
|
2760
|
+
const e = [];
|
|
2761
|
+
for (let r = 0; r < o.length; ++r)
|
|
2762
|
+
e.push(o.charCodeAt(r) & 255);
|
|
2763
|
+
return e;
|
|
2764
|
+
}
|
|
2765
|
+
function Yr(o, e) {
|
|
2766
|
+
let r, a, f;
|
|
2767
|
+
const d = [];
|
|
2768
|
+
for (let y = 0; y < o.length && !((e -= 2) < 0); ++y)
|
|
2769
|
+
r = o.charCodeAt(y), a = r >> 8, f = r % 256, d.push(f), d.push(a);
|
|
2770
|
+
return d;
|
|
2771
|
+
}
|
|
2772
|
+
function Pt(o) {
|
|
2773
|
+
return t.toByteArray(Hr(o));
|
|
2774
|
+
}
|
|
2775
|
+
function Ne(o, e, r, a) {
|
|
2776
|
+
let f;
|
|
2777
|
+
for (f = 0; f < a && !(f + r >= e.length || f >= o.length); ++f)
|
|
2778
|
+
e[f + r] = o[f];
|
|
2779
|
+
return f;
|
|
2780
|
+
}
|
|
2781
|
+
function J(o, e) {
|
|
2782
|
+
return o instanceof e || o != null && o.constructor != null && o.constructor.name != null && o.constructor.name === e.name;
|
|
2783
|
+
}
|
|
2784
|
+
function rt(o) {
|
|
2785
|
+
return o !== o;
|
|
2786
|
+
}
|
|
2787
|
+
const Gr = (function() {
|
|
2788
|
+
const o = "0123456789abcdef", e = new Array(256);
|
|
2789
|
+
for (let r = 0; r < 16; ++r) {
|
|
2790
|
+
const a = r * 16;
|
|
2791
|
+
for (let f = 0; f < 16; ++f)
|
|
2792
|
+
e[a + f] = o[r] + o[f];
|
|
2793
|
+
}
|
|
2794
|
+
return e;
|
|
2795
|
+
})();
|
|
2796
|
+
function le(o) {
|
|
2797
|
+
return typeof BigInt > "u" ? Qr : o;
|
|
2798
|
+
}
|
|
2799
|
+
function Qr() {
|
|
2800
|
+
throw new Error("BigInt not supported");
|
|
2801
|
+
}
|
|
2802
|
+
})(it)), it;
|
|
2803
|
+
}
|
|
2804
|
+
var er = Si();
|
|
2805
|
+
const Fi = (n) => {
|
|
2806
|
+
const t = er.Buffer.from(n, "base64").toString("utf8"), i = er.Buffer.from(t, "binary").toString("base64");
|
|
2807
|
+
return n === i ? t : n;
|
|
2808
|
+
}, Ri = async (n) => {
|
|
2809
|
+
const t = Fi(n), i = JSON.parse(t);
|
|
1448
2810
|
return {
|
|
1449
|
-
message:
|
|
1450
|
-
...
|
|
2811
|
+
message: t,
|
|
2812
|
+
...i
|
|
1451
2813
|
};
|
|
1452
2814
|
};
|
|
1453
|
-
class
|
|
1454
|
-
constructor(
|
|
1455
|
-
this._legacyCanvasSize =
|
|
1456
|
-
let
|
|
1457
|
-
if (
|
|
1458
|
-
if (l = !!
|
|
2815
|
+
class I {
|
|
2816
|
+
constructor(t, i, s, l, c) {
|
|
2817
|
+
this._legacyCanvasSize = I.DEFAULT_CANVAS_SIZE, this._preferredCamera = "environment", this._maxScansPerSecond = 25, this._lastScanTimestamp = -1, this._destroyed = this._flashOn = this._paused = this._active = !1, this.$video = t, this.$canvas = document.createElement("canvas"), s && typeof s == "object" ? this._onDecode = i : (console.warn(s || l || c ? "You're using a deprecated version of the QrScanner constructor which will be removed in the future" : "Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."), this._legacyOnDecode = i), i = typeof s == "object" ? s : {}, this._onDecodeError = i.onDecodeError || (typeof s == "function" ? s : this._onDecodeError), this._calculateScanRegion = i.calculateScanRegion || (typeof l == "function" ? l : this._calculateScanRegion), this._preferredCamera = i.preferredCamera || c || this._preferredCamera, this._legacyCanvasSize = typeof s == "number" ? s : typeof l == "number" ? l : this._legacyCanvasSize, this._maxScansPerSecond = i.maxScansPerSecond || this._maxScansPerSecond, this._onPlay = this._onPlay.bind(this), this._onLoadedMetaData = this._onLoadedMetaData.bind(this), this._onVisibilityChange = this._onVisibilityChange.bind(this), this._updateOverlay = this._updateOverlay.bind(this), t.disablePictureInPicture = !0, t.playsInline = !0, t.muted = !0;
|
|
2818
|
+
let h = !1;
|
|
2819
|
+
if (t.hidden && (t.hidden = !1, h = !0), document.body.contains(t) || (document.body.appendChild(t), h = !0), s = t.parentElement, i.highlightScanRegion || i.highlightCodeOutline) {
|
|
2820
|
+
if (l = !!i.overlay, this.$overlay = i.overlay || document.createElement("div"), c = this.$overlay.style, c.position = "absolute", c.display = "none", c.pointerEvents = "none", this.$overlay.classList.add("scan-region-highlight"), !l && i.highlightScanRegion) {
|
|
1459
2821
|
this.$overlay.innerHTML = '<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';
|
|
1460
2822
|
try {
|
|
1461
2823
|
this.$overlay.firstElementChild.animate({ transform: [
|
|
@@ -1464,53 +2826,50 @@ class x {
|
|
|
1464
2826
|
] }, { duration: 400, iterations: 1 / 0, direction: "alternate", easing: "ease-in-out" });
|
|
1465
2827
|
} catch {
|
|
1466
2828
|
}
|
|
1467
|
-
|
|
2829
|
+
s.insertBefore(this.$overlay, this.$video.nextSibling);
|
|
1468
2830
|
}
|
|
1469
|
-
|
|
2831
|
+
i.highlightCodeOutline && (this.$overlay.insertAdjacentHTML("beforeend", '<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'), this.$codeOutlineHighlight = this.$overlay.lastElementChild);
|
|
1470
2832
|
}
|
|
1471
|
-
this._scanRegion = this._calculateScanRegion(
|
|
1472
|
-
let
|
|
1473
|
-
|
|
1474
|
-
}),
|
|
2833
|
+
this._scanRegion = this._calculateScanRegion(t), requestAnimationFrame(() => {
|
|
2834
|
+
let u = window.getComputedStyle(t);
|
|
2835
|
+
u.display === "none" && (t.style.setProperty("display", "block", "important"), h = !0), u.visibility !== "visible" && (t.style.setProperty("visibility", "visible", "important"), h = !0), h && (console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."), t.style.opacity = "0", t.style.width = "0", t.style.height = "0", this.$overlay && this.$overlay.parentElement && this.$overlay.parentElement.removeChild(this.$overlay), delete this.$overlay, delete this.$codeOutlineHighlight), this.$overlay && this._updateOverlay();
|
|
2836
|
+
}), t.addEventListener("play", this._onPlay), t.addEventListener("loadedmetadata", this._onLoadedMetaData), document.addEventListener("visibilitychange", this._onVisibilityChange), window.addEventListener("resize", this._updateOverlay), this._qrEnginePromise = I.createQrEngine();
|
|
1475
2837
|
}
|
|
1476
|
-
static set WORKER_PATH(
|
|
2838
|
+
static set WORKER_PATH(t) {
|
|
1477
2839
|
console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.");
|
|
1478
2840
|
}
|
|
1479
2841
|
static async hasCamera() {
|
|
1480
2842
|
try {
|
|
1481
|
-
return !!(await
|
|
2843
|
+
return !!(await I.listCameras(!1)).length;
|
|
1482
2844
|
} catch {
|
|
1483
2845
|
return !1;
|
|
1484
2846
|
}
|
|
1485
2847
|
}
|
|
1486
|
-
static async listCameras(
|
|
1487
|
-
if (!navigator.mediaDevices)
|
|
1488
|
-
|
|
1489
|
-
let o = async () => (await navigator.mediaDevices.enumerateDevices()).filter((l) => l.kind === "videoinput"), h;
|
|
2848
|
+
static async listCameras(t = !1) {
|
|
2849
|
+
if (!navigator.mediaDevices) return [];
|
|
2850
|
+
let i = async () => (await navigator.mediaDevices.enumerateDevices()).filter((l) => l.kind === "videoinput"), s;
|
|
1490
2851
|
try {
|
|
1491
|
-
|
|
2852
|
+
t && (await i()).every((l) => !l.label) && (s = await navigator.mediaDevices.getUserMedia({ audio: !1, video: !0 }));
|
|
1492
2853
|
} catch {
|
|
1493
2854
|
}
|
|
1494
2855
|
try {
|
|
1495
|
-
return (await
|
|
2856
|
+
return (await i()).map((l, c) => ({ id: l.deviceId, label: l.label || (c === 0 ? "Default Camera" : `Camera ${c + 1}`) }));
|
|
1496
2857
|
} finally {
|
|
1497
|
-
|
|
2858
|
+
s && (console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"), I._stopVideoStream(s));
|
|
1498
2859
|
}
|
|
1499
2860
|
}
|
|
1500
2861
|
async hasFlash() {
|
|
1501
|
-
let
|
|
2862
|
+
let t;
|
|
1502
2863
|
try {
|
|
1503
2864
|
if (this.$video.srcObject) {
|
|
1504
|
-
if (!(this.$video.srcObject instanceof MediaStream))
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
r = (await this._getCameraStream()).stream;
|
|
1509
|
-
return "torch" in r.getVideoTracks()[0].getSettings();
|
|
2865
|
+
if (!(this.$video.srcObject instanceof MediaStream)) return !1;
|
|
2866
|
+
t = this.$video.srcObject;
|
|
2867
|
+
} else t = (await this._getCameraStream()).stream;
|
|
2868
|
+
return "torch" in t.getVideoTracks()[0].getSettings();
|
|
1510
2869
|
} catch {
|
|
1511
2870
|
return !1;
|
|
1512
2871
|
} finally {
|
|
1513
|
-
|
|
2872
|
+
t && t !== this.$video.srcObject && (console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"), I._stopVideoStream(t));
|
|
1514
2873
|
}
|
|
1515
2874
|
}
|
|
1516
2875
|
isFlashOn() {
|
|
@@ -1520,14 +2879,12 @@ class x {
|
|
|
1520
2879
|
this._flashOn ? await this.turnFlashOff() : await this.turnFlashOn();
|
|
1521
2880
|
}
|
|
1522
2881
|
async turnFlashOn() {
|
|
1523
|
-
if (!this._flashOn && !this._destroyed && (this._flashOn = !0, this._active && !this._paused))
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
throw this._flashOn = !1, r;
|
|
1530
|
-
}
|
|
2882
|
+
if (!this._flashOn && !this._destroyed && (this._flashOn = !0, this._active && !this._paused)) try {
|
|
2883
|
+
if (!await this.hasFlash()) throw "No flash available";
|
|
2884
|
+
await this.$video.srcObject.getVideoTracks()[0].applyConstraints({ advanced: [{ torch: !0 }] });
|
|
2885
|
+
} catch (t) {
|
|
2886
|
+
throw this._flashOn = !1, t;
|
|
2887
|
+
}
|
|
1531
2888
|
}
|
|
1532
2889
|
async turnFlashOff() {
|
|
1533
2890
|
this._flashOn && (this._flashOn = !1, await this._restartVideoStream());
|
|
@@ -1536,97 +2893,86 @@ class x {
|
|
|
1536
2893
|
this.$video.removeEventListener("loadedmetadata", this._onLoadedMetaData), this.$video.removeEventListener("play", this._onPlay), document.removeEventListener(
|
|
1537
2894
|
"visibilitychange",
|
|
1538
2895
|
this._onVisibilityChange
|
|
1539
|
-
), window.removeEventListener("resize", this._updateOverlay), this._destroyed = !0, this._flashOn = !1, this.stop(),
|
|
2896
|
+
), window.removeEventListener("resize", this._updateOverlay), this._destroyed = !0, this._flashOn = !1, this.stop(), I._postWorkerMessage(this._qrEnginePromise, "close");
|
|
1540
2897
|
}
|
|
1541
2898
|
async start() {
|
|
1542
|
-
if (this._destroyed)
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
})));
|
|
1552
|
-
} catch (r) {
|
|
1553
|
-
if (!this._paused)
|
|
1554
|
-
throw this._active = !1, r;
|
|
1555
|
-
}
|
|
2899
|
+
if (this._destroyed) throw Error("The QR scanner can not be started as it had been destroyed.");
|
|
2900
|
+
if ((!this._active || this._paused) && (window.location.protocol !== "https:" && console.warn("The camera stream is only accessible if the page is transferred via https."), this._active = !0, !document.hidden)) if (this._paused = !1, this.$video.srcObject) await this.$video.play();
|
|
2901
|
+
else try {
|
|
2902
|
+
let { stream: t, facingMode: i } = await this._getCameraStream();
|
|
2903
|
+
!this._active || this._paused ? I._stopVideoStream(t) : (this._setVideoMirror(i), this.$video.srcObject = t, await this.$video.play(), this._flashOn && (this._flashOn = !1, this.turnFlashOn().catch(() => {
|
|
2904
|
+
})));
|
|
2905
|
+
} catch (t) {
|
|
2906
|
+
if (!this._paused) throw this._active = !1, t;
|
|
2907
|
+
}
|
|
1556
2908
|
}
|
|
1557
2909
|
stop() {
|
|
1558
2910
|
this.pause(), this._active = !1;
|
|
1559
2911
|
}
|
|
1560
|
-
async pause(
|
|
1561
|
-
if (this._paused = !0, !this._active)
|
|
1562
|
-
return !0;
|
|
2912
|
+
async pause(t = !1) {
|
|
2913
|
+
if (this._paused = !0, !this._active) return !0;
|
|
1563
2914
|
this.$video.pause(), this.$overlay && (this.$overlay.style.display = "none");
|
|
1564
|
-
let
|
|
1565
|
-
this.$video.srcObject instanceof MediaStream && (
|
|
2915
|
+
let i = () => {
|
|
2916
|
+
this.$video.srcObject instanceof MediaStream && (I._stopVideoStream(this.$video.srcObject), this.$video.srcObject = null);
|
|
1566
2917
|
};
|
|
1567
|
-
return
|
|
2918
|
+
return t ? (i(), !0) : (await new Promise((s) => setTimeout(s, 300)), this._paused ? (i(), !0) : !1);
|
|
1568
2919
|
}
|
|
1569
|
-
async setCamera(
|
|
1570
|
-
|
|
2920
|
+
async setCamera(t) {
|
|
2921
|
+
t !== this._preferredCamera && (this._preferredCamera = t, await this._restartVideoStream());
|
|
1571
2922
|
}
|
|
1572
|
-
static async scanImage(
|
|
1573
|
-
let
|
|
1574
|
-
|
|
2923
|
+
static async scanImage(t, i, s, l, c = !1, h = !1) {
|
|
2924
|
+
let u, p = !1;
|
|
2925
|
+
i && ("scanRegion" in i || "qrEngine" in i || "canvas" in i || "disallowCanvasResizing" in i || "alsoTryWithoutScanRegion" in i || "returnDetailedScanResult" in i) ? (u = i.scanRegion, s = i.qrEngine, l = i.canvas, c = i.disallowCanvasResizing || !1, h = i.alsoTryWithoutScanRegion || !1, p = !0) : console.warn(i || s || l || c || h ? "You're using a deprecated api for scanImage which will be removed in the future." : "Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."), i = !!s;
|
|
1575
2926
|
try {
|
|
1576
|
-
let
|
|
1577
|
-
[
|
|
2927
|
+
let _, g;
|
|
2928
|
+
[s, _] = await Promise.all([s || I.createQrEngine(), I._loadImage(t)]), [l, g] = I._drawToCanvas(_, u, l, c);
|
|
1578
2929
|
let E;
|
|
1579
|
-
if (
|
|
1580
|
-
let
|
|
1581
|
-
|
|
1582
|
-
let
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
}, A = (
|
|
1586
|
-
|
|
1587
|
-
},
|
|
1588
|
-
let
|
|
1589
|
-
|
|
2930
|
+
if (s instanceof Worker) {
|
|
2931
|
+
let m = s;
|
|
2932
|
+
i || I._postWorkerMessageSync(m, "inversionMode", "both"), E = await new Promise((v, w) => {
|
|
2933
|
+
let x, S, A, B = -1;
|
|
2934
|
+
S = (M) => {
|
|
2935
|
+
M.data.id === B && (m.removeEventListener("message", S), m.removeEventListener("error", A), clearTimeout(x), M.data.data !== null ? v({ data: M.data.data, cornerPoints: I._convertPoints(M.data.cornerPoints, u) }) : w(I.NO_QR_CODE_FOUND));
|
|
2936
|
+
}, A = (M) => {
|
|
2937
|
+
m.removeEventListener("message", S), m.removeEventListener("error", A), clearTimeout(x), w("Scanner error: " + (M ? M.message || M : "Unknown Error"));
|
|
2938
|
+
}, m.addEventListener("message", S), m.addEventListener("error", A), x = setTimeout(() => A("timeout"), 1e4);
|
|
2939
|
+
let T = g.getImageData(0, 0, l.width, l.height);
|
|
2940
|
+
B = I._postWorkerMessageSync(m, "decode", T, [T.data.buffer]);
|
|
1590
2941
|
});
|
|
1591
|
-
} else
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
if (!a || !p)
|
|
1607
|
-
throw g;
|
|
1608
|
-
let m = await x.scanImage(r, { qrEngine: h, canvas: l, disallowCanvasResizing: d });
|
|
1609
|
-
return y ? m : m.data;
|
|
2942
|
+
} else E = await Promise.race([new Promise((m, v) => window.setTimeout(() => v("Scanner error: timeout"), 1e4)), (async () => {
|
|
2943
|
+
try {
|
|
2944
|
+
var [m] = await s.detect(l);
|
|
2945
|
+
if (!m) throw I.NO_QR_CODE_FOUND;
|
|
2946
|
+
return { data: m.rawValue, cornerPoints: I._convertPoints(m.cornerPoints, u) };
|
|
2947
|
+
} catch (v) {
|
|
2948
|
+
if (m = v.message || v, /not implemented|service unavailable/.test(m)) return I._disableBarcodeDetector = !0, I.scanImage(t, { scanRegion: u, canvas: l, disallowCanvasResizing: c, alsoTryWithoutScanRegion: h });
|
|
2949
|
+
throw `Scanner error: ${m}`;
|
|
2950
|
+
}
|
|
2951
|
+
})()]);
|
|
2952
|
+
return p ? E : E.data;
|
|
2953
|
+
} catch (_) {
|
|
2954
|
+
if (!u || !h) throw _;
|
|
2955
|
+
let g = await I.scanImage(t, { qrEngine: s, canvas: l, disallowCanvasResizing: c });
|
|
2956
|
+
return p ? g : g.data;
|
|
1610
2957
|
} finally {
|
|
1611
|
-
|
|
2958
|
+
i || I._postWorkerMessage(s, "close");
|
|
1612
2959
|
}
|
|
1613
2960
|
}
|
|
1614
|
-
setGrayscaleWeights(
|
|
1615
|
-
|
|
1616
|
-
red:
|
|
1617
|
-
green:
|
|
1618
|
-
blue:
|
|
2961
|
+
setGrayscaleWeights(t, i, s, l = !0) {
|
|
2962
|
+
I._postWorkerMessage(this._qrEnginePromise, "grayscaleWeights", {
|
|
2963
|
+
red: t,
|
|
2964
|
+
green: i,
|
|
2965
|
+
blue: s,
|
|
1619
2966
|
useIntegerApproximation: l
|
|
1620
2967
|
});
|
|
1621
2968
|
}
|
|
1622
|
-
setInversionMode(
|
|
1623
|
-
|
|
2969
|
+
setInversionMode(t) {
|
|
2970
|
+
I._postWorkerMessage(this._qrEnginePromise, "inversionMode", t);
|
|
1624
2971
|
}
|
|
1625
|
-
static async createQrEngine(
|
|
1626
|
-
if (
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
return o && o.brands.some(({ brand: h }) => /Chromium/i.test(h)) && /mac ?OS/i.test(o.platform) && await o.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: h, platformVersion: l }) => /arm/i.test(h || "arm") && 13 <= parseInt(l || "13")).catch(() => !0) ? r() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
2972
|
+
static async createQrEngine(t) {
|
|
2973
|
+
if (t && console.warn("Specifying a worker path is not required and not supported anymore."), t = () => import("./qr-scanner-worker.min-DpjUkzFK.js").then((s) => s.createWorker()), !(!I._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return t();
|
|
2974
|
+
let i = navigator.userAgentData;
|
|
2975
|
+
return i && i.brands.some(({ brand: s }) => /Chromium/i.test(s)) && /mac ?OS/i.test(i.platform) && await i.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: s, platformVersion: l }) => /arm/i.test(s || "arm") && 13 <= parseInt(l || "13")).catch(() => !0) ? t() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
1630
2976
|
}
|
|
1631
2977
|
_onPlay() {
|
|
1632
2978
|
this._scanRegion = this._calculateScanRegion(this.$video), this._updateOverlay(), this.$overlay && (this.$overlay.style.display = ""), this._scanFrame();
|
|
@@ -1637,221 +2983,204 @@ class x {
|
|
|
1637
2983
|
_onVisibilityChange() {
|
|
1638
2984
|
document.hidden ? this.pause() : this._active && this.start();
|
|
1639
2985
|
}
|
|
1640
|
-
_calculateScanRegion(
|
|
1641
|
-
let
|
|
1642
|
-
return { x: Math.round((
|
|
2986
|
+
_calculateScanRegion(t) {
|
|
2987
|
+
let i = Math.round(0.6666666666666666 * Math.min(t.videoWidth, t.videoHeight));
|
|
2988
|
+
return { x: Math.round((t.videoWidth - i) / 2), y: Math.round((t.videoHeight - i) / 2), width: i, height: i, downScaledWidth: this._legacyCanvasSize, downScaledHeight: this._legacyCanvasSize };
|
|
1643
2989
|
}
|
|
1644
2990
|
_updateOverlay() {
|
|
1645
2991
|
requestAnimationFrame(() => {
|
|
1646
2992
|
if (this.$overlay) {
|
|
1647
|
-
var
|
|
1648
|
-
switch (
|
|
2993
|
+
var t = this.$video, i = t.videoWidth, s = t.videoHeight, l = t.offsetWidth, c = t.offsetHeight, h = t.offsetLeft, u = t.offsetTop, p = window.getComputedStyle(t), _ = p.objectFit, g = i / s, E = l / c;
|
|
2994
|
+
switch (_) {
|
|
1649
2995
|
case "none":
|
|
1650
|
-
var
|
|
2996
|
+
var m = i, v = s;
|
|
1651
2997
|
break;
|
|
1652
2998
|
case "fill":
|
|
1653
|
-
|
|
2999
|
+
m = l, v = c;
|
|
1654
3000
|
break;
|
|
1655
3001
|
default:
|
|
1656
|
-
(
|
|
3002
|
+
(_ === "cover" ? g > E : g < E) ? (v = c, m = v * g) : (m = l, v = m / g), _ === "scale-down" && (m = Math.min(m, i), v = Math.min(v, s));
|
|
1657
3003
|
}
|
|
1658
|
-
var [
|
|
1659
|
-
const
|
|
1660
|
-
return A.endsWith("%") ? (
|
|
3004
|
+
var [w, x] = p.objectPosition.split(" ").map((A, B) => {
|
|
3005
|
+
const T = parseFloat(A);
|
|
3006
|
+
return A.endsWith("%") ? (B ? c - v : l - m) * T / 100 : T;
|
|
1661
3007
|
});
|
|
1662
|
-
|
|
1663
|
-
var
|
|
1664
|
-
|
|
3008
|
+
p = this._scanRegion.width || i, E = this._scanRegion.height || s, _ = this._scanRegion.x || 0;
|
|
3009
|
+
var S = this._scanRegion.y || 0;
|
|
3010
|
+
g = this.$overlay.style, g.width = `${p / i * m}px`, g.height = `${E / s * v}px`, g.top = `${u + x + S / s * v}px`, s = /scaleX\(-1\)/.test(t.style.transform), g.left = `${h + (s ? l - w - m : w) + (s ? i - _ - p : _) / i * m}px`, g.transform = t.style.transform;
|
|
1665
3011
|
}
|
|
1666
3012
|
});
|
|
1667
3013
|
}
|
|
1668
|
-
static _convertPoints(
|
|
1669
|
-
if (!
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
p.x = p.x * d + h, p.y = p.y * o + l;
|
|
1675
|
-
return r;
|
|
3014
|
+
static _convertPoints(t, i) {
|
|
3015
|
+
if (!i) return t;
|
|
3016
|
+
let s = i.x || 0, l = i.y || 0, c = i.width && i.downScaledWidth ? i.width / i.downScaledWidth : 1;
|
|
3017
|
+
i = i.height && i.downScaledHeight ? i.height / i.downScaledHeight : 1;
|
|
3018
|
+
for (let h of t) h.x = h.x * c + s, h.y = h.y * i + l;
|
|
3019
|
+
return t;
|
|
1676
3020
|
}
|
|
1677
3021
|
_scanFrame() {
|
|
1678
3022
|
!this._active || this.$video.paused || this.$video.ended || ("requestVideoFrameCallback" in this.$video ? this.$video.requestVideoFrameCallback.bind(this.$video) : requestAnimationFrame)(async () => {
|
|
1679
3023
|
if (!(1 >= this.$video.readyState)) {
|
|
1680
|
-
var
|
|
1681
|
-
|
|
3024
|
+
var t = Date.now() - this._lastScanTimestamp, i = 1e3 / this._maxScansPerSecond;
|
|
3025
|
+
t < i && await new Promise((l) => setTimeout(l, i - t)), this._lastScanTimestamp = Date.now();
|
|
1682
3026
|
try {
|
|
1683
|
-
var
|
|
3027
|
+
var s = await I.scanImage(this.$video, { scanRegion: this._scanRegion, qrEngine: this._qrEnginePromise, canvas: this.$canvas });
|
|
1684
3028
|
} catch (l) {
|
|
1685
|
-
if (!this._active)
|
|
1686
|
-
return;
|
|
3029
|
+
if (!this._active) return;
|
|
1687
3030
|
this._onDecodeError(l);
|
|
1688
3031
|
}
|
|
1689
|
-
!
|
|
3032
|
+
!I._disableBarcodeDetector || await this._qrEnginePromise instanceof Worker || (this._qrEnginePromise = I.createQrEngine()), s ? (this._onDecode ? this._onDecode(s) : this._legacyOnDecode && this._legacyOnDecode(s.data), this.$codeOutlineHighlight && (clearTimeout(this._codeOutlineHighlightRemovalTimeout), this._codeOutlineHighlightRemovalTimeout = void 0, this.$codeOutlineHighlight.setAttribute("viewBox", `${this._scanRegion.x || 0} ${this._scanRegion.y || 0} ${this._scanRegion.width || this.$video.videoWidth} ${this._scanRegion.height || this.$video.videoHeight}`), this.$codeOutlineHighlight.firstElementChild.setAttribute(
|
|
1690
3033
|
"points",
|
|
1691
|
-
|
|
3034
|
+
s.cornerPoints.map(({ x: l, y: c }) => `${l},${c}`).join(" ")
|
|
1692
3035
|
), this.$codeOutlineHighlight.style.display = "")) : this.$codeOutlineHighlight && !this._codeOutlineHighlightRemovalTimeout && (this._codeOutlineHighlightRemovalTimeout = setTimeout(() => this.$codeOutlineHighlight.style.display = "none", 100));
|
|
1693
3036
|
}
|
|
1694
3037
|
this._scanFrame();
|
|
1695
3038
|
});
|
|
1696
3039
|
}
|
|
1697
|
-
_onDecodeError(
|
|
1698
|
-
|
|
3040
|
+
_onDecodeError(t) {
|
|
3041
|
+
t !== I.NO_QR_CODE_FOUND && console.log(t);
|
|
1699
3042
|
}
|
|
1700
3043
|
async _getCameraStream() {
|
|
1701
|
-
if (!navigator.mediaDevices)
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
} catch {
|
|
1709
|
-
}
|
|
3044
|
+
if (!navigator.mediaDevices) throw "Camera not found.";
|
|
3045
|
+
let t = /^(environment|user)$/.test(this._preferredCamera) ? "facingMode" : "deviceId", i = [{ width: { min: 1024 } }, { width: { min: 768 } }, {}], s = i.map((l) => Object.assign({}, l, { [t]: { exact: this._preferredCamera } }));
|
|
3046
|
+
for (let l of [...s, ...i]) try {
|
|
3047
|
+
let c = await navigator.mediaDevices.getUserMedia({ video: l, audio: !1 }), h = this._getFacingMode(c) || (l.facingMode ? this._preferredCamera : this._preferredCamera === "environment" ? "user" : "environment");
|
|
3048
|
+
return { stream: c, facingMode: h };
|
|
3049
|
+
} catch {
|
|
3050
|
+
}
|
|
1710
3051
|
throw "Camera not found.";
|
|
1711
3052
|
}
|
|
1712
3053
|
async _restartVideoStream() {
|
|
1713
|
-
let
|
|
1714
|
-
await this.pause(!0) && !
|
|
3054
|
+
let t = this._paused;
|
|
3055
|
+
await this.pause(!0) && !t && this._active && await this.start();
|
|
1715
3056
|
}
|
|
1716
|
-
static _stopVideoStream(
|
|
1717
|
-
for (let
|
|
1718
|
-
o.stop(), r.removeTrack(o);
|
|
3057
|
+
static _stopVideoStream(t) {
|
|
3058
|
+
for (let i of t.getTracks()) i.stop(), t.removeTrack(i);
|
|
1719
3059
|
}
|
|
1720
|
-
_setVideoMirror(
|
|
1721
|
-
this.$video.style.transform = "scaleX(" + (
|
|
3060
|
+
_setVideoMirror(t) {
|
|
3061
|
+
this.$video.style.transform = "scaleX(" + (t === "user" ? -1 : 1) + ")";
|
|
1722
3062
|
}
|
|
1723
|
-
_getFacingMode(
|
|
1724
|
-
return (
|
|
3063
|
+
_getFacingMode(t) {
|
|
3064
|
+
return (t = t.getVideoTracks()[0]) ? /rear|back|environment/i.test(t.label) ? "environment" : /front|user|face/i.test(t.label) ? "user" : null : null;
|
|
1725
3065
|
}
|
|
1726
|
-
static _drawToCanvas(
|
|
1727
|
-
|
|
1728
|
-
let
|
|
1729
|
-
return l || (l =
|
|
3066
|
+
static _drawToCanvas(t, i, s, l = !1) {
|
|
3067
|
+
s = s || document.createElement("canvas");
|
|
3068
|
+
let c = i && i.x ? i.x : 0, h = i && i.y ? i.y : 0, u = i && i.width ? i.width : t.videoWidth || t.width, p = i && i.height ? i.height : t.videoHeight || t.height;
|
|
3069
|
+
return l || (l = i && i.downScaledWidth ? i.downScaledWidth : u, i = i && i.downScaledHeight ? i.downScaledHeight : p, s.width !== l && (s.width = l), s.height !== i && (s.height = i)), i = s.getContext("2d", { alpha: !1 }), i.imageSmoothingEnabled = !1, i.drawImage(t, c, h, u, p, 0, 0, s.width, s.height), [s, i];
|
|
1730
3070
|
}
|
|
1731
|
-
static async _loadImage(
|
|
1732
|
-
if (
|
|
1733
|
-
|
|
1734
|
-
if (
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
let o = new Image();
|
|
1738
|
-
o.src = r instanceof File || r instanceof Blob ? URL.createObjectURL(r) : r.toString();
|
|
3071
|
+
static async _loadImage(t) {
|
|
3072
|
+
if (t instanceof Image) return await I._awaitImageLoad(t), t;
|
|
3073
|
+
if (t instanceof HTMLVideoElement || t instanceof HTMLCanvasElement || t instanceof SVGImageElement || "OffscreenCanvas" in window && t instanceof OffscreenCanvas || "ImageBitmap" in window && t instanceof ImageBitmap) return t;
|
|
3074
|
+
if (t instanceof File || t instanceof Blob || t instanceof URL || typeof t == "string") {
|
|
3075
|
+
let i = new Image();
|
|
3076
|
+
i.src = t instanceof File || t instanceof Blob ? URL.createObjectURL(t) : t.toString();
|
|
1739
3077
|
try {
|
|
1740
|
-
return await
|
|
3078
|
+
return await I._awaitImageLoad(i), i;
|
|
1741
3079
|
} finally {
|
|
1742
|
-
(
|
|
3080
|
+
(t instanceof File || t instanceof Blob) && URL.revokeObjectURL(i.src);
|
|
1743
3081
|
}
|
|
1744
|
-
} else
|
|
1745
|
-
throw "Unsupported image type.";
|
|
3082
|
+
} else throw "Unsupported image type.";
|
|
1746
3083
|
}
|
|
1747
|
-
static async _awaitImageLoad(
|
|
1748
|
-
|
|
1749
|
-
let l = (
|
|
1750
|
-
|
|
3084
|
+
static async _awaitImageLoad(t) {
|
|
3085
|
+
t.complete && t.naturalWidth !== 0 || await new Promise((i, s) => {
|
|
3086
|
+
let l = (c) => {
|
|
3087
|
+
t.removeEventListener("load", l), t.removeEventListener("error", l), c instanceof ErrorEvent ? s("Image load error") : i();
|
|
1751
3088
|
};
|
|
1752
|
-
|
|
3089
|
+
t.addEventListener("load", l), t.addEventListener("error", l);
|
|
1753
3090
|
});
|
|
1754
3091
|
}
|
|
1755
|
-
static async _postWorkerMessage(
|
|
1756
|
-
return
|
|
3092
|
+
static async _postWorkerMessage(t, i, s, l) {
|
|
3093
|
+
return I._postWorkerMessageSync(await t, i, s, l);
|
|
1757
3094
|
}
|
|
1758
|
-
static _postWorkerMessageSync(
|
|
1759
|
-
if (!(
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
return r.postMessage({ id: d, type: o, data: h }, l), d;
|
|
3095
|
+
static _postWorkerMessageSync(t, i, s, l) {
|
|
3096
|
+
if (!(t instanceof Worker)) return -1;
|
|
3097
|
+
let c = I._workerMessageId++;
|
|
3098
|
+
return t.postMessage({ id: c, type: i, data: s }, l), c;
|
|
1763
3099
|
}
|
|
1764
3100
|
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
const
|
|
1770
|
-
constructor(
|
|
3101
|
+
I.DEFAULT_CANVAS_SIZE = 400;
|
|
3102
|
+
I.NO_QR_CODE_FOUND = "No QR code found";
|
|
3103
|
+
I._disableBarcodeDetector = !1;
|
|
3104
|
+
I._workerMessageId = 0;
|
|
3105
|
+
const Ft = class Ft {
|
|
3106
|
+
constructor(t, i, s) {
|
|
1771
3107
|
this.events = {};
|
|
1772
|
-
const l = document.querySelector(
|
|
3108
|
+
const l = document.querySelector(t.target);
|
|
1773
3109
|
if (!l)
|
|
1774
|
-
throw new Error(`Target element '${
|
|
1775
|
-
this.targetElement = l, this.decode =
|
|
3110
|
+
throw new Error(`Target element '${t.target}' is not found`);
|
|
3111
|
+
this.targetElement = l, this.decode = i, this.scannerElements = s;
|
|
1776
3112
|
}
|
|
1777
|
-
async _initializeScanner(
|
|
1778
|
-
var h, l, d, p;
|
|
3113
|
+
async _initializeScanner(t, i = 25) {
|
|
1779
3114
|
try {
|
|
1780
|
-
if (!
|
|
1781
|
-
const
|
|
1782
|
-
|
|
3115
|
+
if (!t) {
|
|
3116
|
+
const s = await this.listVideoInputDevices();
|
|
3117
|
+
t = this._getMainCameraDeviceId(s);
|
|
1783
3118
|
}
|
|
1784
|
-
this.qrScanner = new
|
|
3119
|
+
this.qrScanner = new I(
|
|
1785
3120
|
document.getElementById(
|
|
1786
3121
|
`${this.scannerElements.VIDEO}`
|
|
1787
3122
|
),
|
|
1788
|
-
async (
|
|
1789
|
-
|
|
1790
|
-
if (this.previousScanText !== a.data)
|
|
3123
|
+
async (s) => {
|
|
3124
|
+
if (this.previousScanText !== s.data)
|
|
1791
3125
|
try {
|
|
1792
|
-
this.previousScanText =
|
|
1793
|
-
|
|
1794
|
-
await this.decode(a.data)
|
|
3126
|
+
this.previousScanText = s.data, this.events?.[Be.CAPTURE]?.(
|
|
3127
|
+
await this.decode(s.data)
|
|
1795
3128
|
);
|
|
1796
|
-
} catch (
|
|
1797
|
-
|
|
3129
|
+
} catch (l) {
|
|
3130
|
+
this.events?.[Be.ERROR]?.(l);
|
|
1798
3131
|
}
|
|
1799
3132
|
},
|
|
1800
3133
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1801
3134
|
// @ts-ignore
|
|
1802
3135
|
{
|
|
1803
3136
|
returnDetailedScanResult: !0,
|
|
1804
|
-
maxScansPerSecond:
|
|
1805
|
-
preferredCamera:
|
|
3137
|
+
maxScansPerSecond: i,
|
|
3138
|
+
preferredCamera: t,
|
|
1806
3139
|
highlightScanRegion: !0,
|
|
1807
3140
|
highlightCodeOutline: !0,
|
|
1808
3141
|
onDecodeError: () => {
|
|
1809
3142
|
}
|
|
1810
3143
|
}
|
|
1811
3144
|
), await this.qrScanner.start();
|
|
1812
|
-
} catch (
|
|
1813
|
-
|
|
3145
|
+
} catch (s) {
|
|
3146
|
+
this.events?.[Be.ERROR]?.(s), this.qrScanner?.stop(), this.rootElement?.remove();
|
|
1814
3147
|
}
|
|
1815
3148
|
}
|
|
1816
3149
|
async listVideoInputDevices() {
|
|
1817
|
-
return
|
|
1818
|
-
}
|
|
1819
|
-
_getMainCameraDeviceId(
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
});
|
|
1827
|
-
return (h == null ? void 0 : h.id) || ((l = r[1]) == null ? void 0 : l.id) || ((d = r[0]) == null ? void 0 : d.id);
|
|
3150
|
+
return I.listCameras(!0);
|
|
3151
|
+
}
|
|
3152
|
+
_getMainCameraDeviceId(t) {
|
|
3153
|
+
if (!t?.length) throw new Error("No video input devices available");
|
|
3154
|
+
const i = ["back", "задня"];
|
|
3155
|
+
return t.find((l) => {
|
|
3156
|
+
const c = l.label.toLowerCase();
|
|
3157
|
+
return c.includes(i[0]) || c.includes(i[1]);
|
|
3158
|
+
})?.id || t[1]?.id || t[0]?.id;
|
|
1828
3159
|
}
|
|
1829
3160
|
close() {
|
|
1830
|
-
|
|
1831
|
-
this.previousScanText = null, (o = (r = this.events) == null ? void 0 : r[G.CANCEL]) == null || o.call(r), (h = this.qrScanner) == null || h.stop(), (l = this.rootElement) == null || l.remove();
|
|
3161
|
+
this.previousScanText = null, this.events?.[Be.CANCEL]?.(), this.qrScanner?.stop(), this.rootElement?.remove();
|
|
1832
3162
|
}
|
|
1833
|
-
on(
|
|
1834
|
-
this.events[
|
|
3163
|
+
on(t, i) {
|
|
3164
|
+
this.events[t] = i;
|
|
1835
3165
|
}
|
|
1836
|
-
off(
|
|
1837
|
-
this.events[
|
|
3166
|
+
off(t) {
|
|
3167
|
+
this.events[t] = void 0;
|
|
1838
3168
|
}
|
|
1839
3169
|
};
|
|
1840
|
-
|
|
1841
|
-
let
|
|
1842
|
-
class
|
|
1843
|
-
constructor(
|
|
1844
|
-
super(
|
|
1845
|
-
}
|
|
1846
|
-
async scan({ deviceId:
|
|
1847
|
-
|
|
1848
|
-
h === void 0 && (h = !0), (l = this.qrScanner) == null || l.stop(), (d = this.rootElement) == null || d.remove(), new Nt({
|
|
3170
|
+
Ft.events = Be;
|
|
3171
|
+
let pt = Ft;
|
|
3172
|
+
class bi extends pt {
|
|
3173
|
+
constructor(t) {
|
|
3174
|
+
super(t, Ri, ze);
|
|
3175
|
+
}
|
|
3176
|
+
async scan({ deviceId: t, maxScansPerSecond: i, isCloseButton: s } = {}) {
|
|
3177
|
+
s === void 0 && (s = !0), this.qrScanner?.stop(), this.rootElement?.remove(), new xi({
|
|
1849
3178
|
target: this.targetElement,
|
|
1850
|
-
props: { close: this.close.bind(this), isCloseButton:
|
|
1851
|
-
}), this.rootElement = document.getElementById(
|
|
3179
|
+
props: { close: this.close.bind(this), isCloseButton: s, scannerElements: ze }
|
|
3180
|
+
}), this.rootElement = document.getElementById(ze.ROOT), await this._initializeScanner(t, i);
|
|
1852
3181
|
}
|
|
1853
3182
|
}
|
|
1854
|
-
typeof window < "u" && (window.CredenzaScanner =
|
|
3183
|
+
typeof window < "u" && (window.CredenzaScanner = bi);
|
|
1855
3184
|
export {
|
|
1856
|
-
|
|
3185
|
+
bi as Scanner
|
|
1857
3186
|
};
|