@automerge/automerge-repo-react-hooks 2.0.0-alpha.2 → 2.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +879 -842
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const e =
|
|
1
|
+
import hr, { createContext as dr, useContext as yr, useRef as Nt, useState as $t, useEffect as _e, useCallback as pr, useMemo as br } from "react";
|
|
2
|
+
const gr = dr(null);
|
|
3
|
+
function bt() {
|
|
4
|
+
const e = yr(gr);
|
|
5
5
|
if (!e) throw new Error("Repo was not found on RepoContext.");
|
|
6
6
|
return e;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const t =
|
|
8
|
+
function jn(e) {
|
|
9
|
+
const t = bt(), r = e ? t.find(e) : null, n = Nt(r);
|
|
10
10
|
r !== n.current && (n.current = r);
|
|
11
|
-
const [, s] =
|
|
12
|
-
|
|
11
|
+
const [, s] = $t(0), o = () => s((c) => c + 1);
|
|
12
|
+
_e(() => !e || !r ? void 0 : (n.current = r, r.doc().then(() => {
|
|
13
13
|
o();
|
|
14
|
-
}).catch((
|
|
14
|
+
}).catch((f) => console.error(f)), r.on("change", o), r.on("delete", o), () => {
|
|
15
15
|
r.removeListener("change", o), r.removeListener("delete", o);
|
|
16
16
|
}), [e, r]);
|
|
17
|
-
const i =
|
|
18
|
-
(c,
|
|
19
|
-
r && r.change(c,
|
|
17
|
+
const i = pr(
|
|
18
|
+
(c, f) => {
|
|
19
|
+
r && r.change(c, f);
|
|
20
20
|
},
|
|
21
21
|
[r]
|
|
22
22
|
);
|
|
23
23
|
return [r?.docSync(), i];
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
class
|
|
25
|
+
const pe = Symbol.for("_am_meta"), Oe = Symbol.for("_am_trace"), Ie = Symbol.for("_am_objectId"), gt = Symbol.for("_am_isProxy"), zt = Symbol.for("_am_clearCache"), xr = Symbol.for("_am_uint"), wr = Symbol.for("_am_int"), mr = Symbol.for("_am_f64"), Ht = Symbol.for("_am_counter"), Sr = Symbol.for("_am_text");
|
|
26
|
+
class be {
|
|
27
27
|
constructor(t) {
|
|
28
28
|
if (typeof t == "string")
|
|
29
29
|
this.elems = [...t];
|
|
@@ -33,7 +33,7 @@ class pe {
|
|
|
33
33
|
this.elems = [];
|
|
34
34
|
else
|
|
35
35
|
throw new TypeError(`Unsupported initial value for Text: ${t}`);
|
|
36
|
-
Reflect.defineProperty(this,
|
|
36
|
+
Reflect.defineProperty(this, Sr, { value: !0 });
|
|
37
37
|
}
|
|
38
38
|
get length() {
|
|
39
39
|
return this.elems.length;
|
|
@@ -95,7 +95,7 @@ class pe {
|
|
|
95
95
|
* Updates the list item at position `index` to a new value `value`.
|
|
96
96
|
*/
|
|
97
97
|
set(t, r) {
|
|
98
|
-
if (this[
|
|
98
|
+
if (this[pe])
|
|
99
99
|
throw new RangeError("object cannot be modified outside of a change block");
|
|
100
100
|
this.elems[t] = r;
|
|
101
101
|
}
|
|
@@ -103,7 +103,7 @@ class pe {
|
|
|
103
103
|
* Inserts new list items `values` starting at position `index`.
|
|
104
104
|
*/
|
|
105
105
|
insertAt(t, ...r) {
|
|
106
|
-
if (this[
|
|
106
|
+
if (this[pe])
|
|
107
107
|
throw new RangeError("object cannot be modified outside of a change block");
|
|
108
108
|
r.every((n) => typeof n == "string") ? this.elems.splice(t, 0, ...r.join("")) : this.elems.splice(t, 0, ...r);
|
|
109
109
|
}
|
|
@@ -112,7 +112,7 @@ class pe {
|
|
|
112
112
|
* if `numDelete` is not given, one item is deleted.
|
|
113
113
|
*/
|
|
114
114
|
deleteAt(t, r = 1) {
|
|
115
|
-
if (this[
|
|
115
|
+
if (this[pe])
|
|
116
116
|
throw new RangeError("object cannot be modified outside of a change block");
|
|
117
117
|
this.elems.splice(t, r);
|
|
118
118
|
}
|
|
@@ -123,13 +123,13 @@ class pe {
|
|
|
123
123
|
this.elems.lastIndexOf(t, r);
|
|
124
124
|
}
|
|
125
125
|
concat(t) {
|
|
126
|
-
return new
|
|
126
|
+
return new be(this.elems.concat(t.elems));
|
|
127
127
|
}
|
|
128
128
|
every(t) {
|
|
129
129
|
return this.elems.every(t);
|
|
130
130
|
}
|
|
131
131
|
filter(t) {
|
|
132
|
-
return new
|
|
132
|
+
return new be(this.elems.filter(t));
|
|
133
133
|
}
|
|
134
134
|
find(t) {
|
|
135
135
|
return this.elems.find(t);
|
|
@@ -156,7 +156,7 @@ class pe {
|
|
|
156
156
|
this.elems.reduceRight(t);
|
|
157
157
|
}
|
|
158
158
|
slice(t, r) {
|
|
159
|
-
return new
|
|
159
|
+
return new be(this.elems.slice(t, r));
|
|
160
160
|
}
|
|
161
161
|
some(t) {
|
|
162
162
|
return this.elems.some(t);
|
|
@@ -165,7 +165,7 @@ class pe {
|
|
|
165
165
|
this.toString();
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
class
|
|
168
|
+
class vr {
|
|
169
169
|
constructor(t) {
|
|
170
170
|
this.value = t || 0, Reflect.defineProperty(this, Ht, { value: !0 });
|
|
171
171
|
}
|
|
@@ -214,7 +214,7 @@ class mr {
|
|
|
214
214
|
throw new Error("Counters should not be decremented outside of a change callback");
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
class
|
|
217
|
+
class Ar extends vr {
|
|
218
218
|
constructor(t, r, n, s, o) {
|
|
219
219
|
super(t), this.context = r, this.path = n, this.objectId = s, this.key = o;
|
|
220
220
|
}
|
|
@@ -233,10 +233,10 @@ class vr extends mr {
|
|
|
233
233
|
return this.increment(typeof t == "number" ? -t : -1);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
return new
|
|
236
|
+
function Cr(e, t, r, n, s) {
|
|
237
|
+
return new Ar(e, t, r, n, s);
|
|
238
238
|
}
|
|
239
|
-
class
|
|
239
|
+
class Er {
|
|
240
240
|
constructor(t) {
|
|
241
241
|
this.val = t;
|
|
242
242
|
}
|
|
@@ -261,60 +261,60 @@ function re(e, t) {
|
|
|
261
261
|
const { context: r, objectId: n, path: s, textV2: o } = e, i = r.getWithType(n, t);
|
|
262
262
|
if (i === null)
|
|
263
263
|
return;
|
|
264
|
-
const c = i[0],
|
|
264
|
+
const c = i[0], f = i[1];
|
|
265
265
|
switch (c) {
|
|
266
266
|
case void 0:
|
|
267
267
|
return;
|
|
268
268
|
case "map":
|
|
269
|
-
return He(r,
|
|
269
|
+
return He(r, f, o, [...s, t]);
|
|
270
270
|
case "list":
|
|
271
|
-
return
|
|
271
|
+
return Ke(r, f, o, [...s, t]);
|
|
272
272
|
case "text":
|
|
273
|
-
return o ? r.text(
|
|
273
|
+
return o ? r.text(f) : Ue(r, f, [
|
|
274
274
|
...s,
|
|
275
275
|
t
|
|
276
276
|
]);
|
|
277
277
|
case "str":
|
|
278
|
-
return
|
|
278
|
+
return f;
|
|
279
279
|
case "uint":
|
|
280
|
-
return
|
|
280
|
+
return f;
|
|
281
281
|
case "int":
|
|
282
|
-
return
|
|
282
|
+
return f;
|
|
283
283
|
case "f64":
|
|
284
|
-
return
|
|
284
|
+
return f;
|
|
285
285
|
case "boolean":
|
|
286
|
-
return
|
|
286
|
+
return f;
|
|
287
287
|
case "null":
|
|
288
288
|
return null;
|
|
289
289
|
case "bytes":
|
|
290
|
-
return
|
|
290
|
+
return f;
|
|
291
291
|
case "timestamp":
|
|
292
|
-
return
|
|
292
|
+
return f;
|
|
293
293
|
case "counter":
|
|
294
|
-
return
|
|
294
|
+
return Cr(f, r, s, n, t);
|
|
295
295
|
default:
|
|
296
296
|
throw RangeError(`datatype ${c} unimplemented`);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Pe(e, t, r, n) {
|
|
300
300
|
const s = typeof e;
|
|
301
301
|
switch (s) {
|
|
302
302
|
case "object":
|
|
303
303
|
if (e == null)
|
|
304
304
|
return [null, "null"];
|
|
305
|
-
if (e[
|
|
305
|
+
if (e[xr])
|
|
306
306
|
return [e.value, "uint"];
|
|
307
|
-
if (e[
|
|
307
|
+
if (e[wr])
|
|
308
308
|
return [e.value, "int"];
|
|
309
|
-
if (e[
|
|
309
|
+
if (e[mr])
|
|
310
310
|
return [e.value, "f64"];
|
|
311
311
|
if (e[Ht])
|
|
312
312
|
return [e.value, "counter"];
|
|
313
313
|
if (e instanceof Date)
|
|
314
314
|
return [e.getTime(), "timestamp"];
|
|
315
|
-
if (e instanceof
|
|
315
|
+
if (e instanceof Er)
|
|
316
316
|
return [e.toString(), "str"];
|
|
317
|
-
if (e instanceof
|
|
317
|
+
if (e instanceof be)
|
|
318
318
|
return [e, "text"];
|
|
319
319
|
if (e instanceof Uint8Array)
|
|
320
320
|
return [e, "bytes"];
|
|
@@ -322,7 +322,7 @@ function Te(e, t, r, n) {
|
|
|
322
322
|
return [e, "list"];
|
|
323
323
|
if (Object.prototype.toString.call(e) === "[object Object]")
|
|
324
324
|
return [e, "map"];
|
|
325
|
-
throw
|
|
325
|
+
throw ze(e, n) ? new RangeError("Cannot create a reference to an existing document object") : new RangeError(`Cannot assign unknown object: ${e}`);
|
|
326
326
|
case "boolean":
|
|
327
327
|
return [e, "boolean"];
|
|
328
328
|
case "number":
|
|
@@ -331,51 +331,51 @@ function Te(e, t, r, n) {
|
|
|
331
331
|
return t ? [e, "text"] : [e, "str"];
|
|
332
332
|
case "undefined":
|
|
333
333
|
throw new RangeError([
|
|
334
|
-
`Cannot assign undefined value at ${
|
|
334
|
+
`Cannot assign undefined value at ${Ot(r)}, `,
|
|
335
335
|
"because `undefined` is not a valid JSON data type. ",
|
|
336
336
|
"You might consider setting the property's value to `null`, ",
|
|
337
337
|
"or using `delete` to remove it altogether."
|
|
338
338
|
].join(""));
|
|
339
339
|
default:
|
|
340
340
|
throw new RangeError([
|
|
341
|
-
`Cannot assign ${s} value at ${
|
|
341
|
+
`Cannot assign ${s} value at ${Ot(r)}. `,
|
|
342
342
|
"All JSON primitive datatypes (object, array, string, number, boolean, null) ",
|
|
343
343
|
`are supported in an Automerge document; ${s} values are not. `
|
|
344
344
|
].join(""));
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function ze(e, t) {
|
|
348
348
|
var r, n;
|
|
349
|
-
return e instanceof Date ? !1 : !!(e && ((n = (r = e[
|
|
349
|
+
return e instanceof Date ? !1 : !!(e && ((n = (r = e[pe]) === null || r === void 0 ? void 0 : r.handle) === null || n === void 0 ? void 0 : n.__wbg_ptr) === t.__wbg_ptr);
|
|
350
350
|
}
|
|
351
|
-
const
|
|
351
|
+
const _r = {
|
|
352
352
|
get(e, t) {
|
|
353
353
|
const { context: r, objectId: n, cache: s } = e;
|
|
354
|
-
return t === Symbol.toStringTag ? e[Symbol.toStringTag] : t ===
|
|
354
|
+
return t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r, textV2: e.textV2 } : (s[t] || (s[t] = re(e, t)), s[t]);
|
|
355
355
|
},
|
|
356
356
|
set(e, t, r) {
|
|
357
357
|
const { context: n, objectId: s, path: o, textV2: i } = e;
|
|
358
|
-
if (e.cache = {},
|
|
358
|
+
if (e.cache = {}, ze(r, n))
|
|
359
359
|
throw new RangeError("Cannot create a reference to an existing document object");
|
|
360
|
-
if (t ===
|
|
360
|
+
if (t === Oe)
|
|
361
361
|
return e.trace = r, !0;
|
|
362
|
-
if (t ===
|
|
362
|
+
if (t === zt)
|
|
363
363
|
return !0;
|
|
364
|
-
const [c,
|
|
365
|
-
switch (
|
|
364
|
+
const [c, f] = Pe(r, i, [...o, t], n);
|
|
365
|
+
switch (f) {
|
|
366
366
|
case "list": {
|
|
367
|
-
const p = n.putObject(s, t, []), d =
|
|
367
|
+
const p = n.putObject(s, t, []), d = Ke(n, p, i, [...o, t]);
|
|
368
368
|
for (let h = 0; h < c.length; h++)
|
|
369
369
|
d[h] = c[h];
|
|
370
370
|
break;
|
|
371
371
|
}
|
|
372
372
|
case "text": {
|
|
373
373
|
if (i)
|
|
374
|
-
|
|
374
|
+
Le(c), n.putObject(s, t, c);
|
|
375
375
|
else {
|
|
376
|
-
|
|
376
|
+
wt(c);
|
|
377
377
|
const p = n.putObject(s, t, "");
|
|
378
|
-
|
|
378
|
+
Ue(n, p, [...o, t]).splice(0, 0, ...c);
|
|
379
379
|
}
|
|
380
380
|
break;
|
|
381
381
|
}
|
|
@@ -386,7 +386,7 @@ const Cr = {
|
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
388
|
default:
|
|
389
|
-
n.put(s, t, c,
|
|
389
|
+
n.put(s, t, c, f);
|
|
390
390
|
}
|
|
391
391
|
return !0;
|
|
392
392
|
},
|
|
@@ -410,34 +410,34 @@ const Cr = {
|
|
|
410
410
|
const { context: t, objectId: r } = e, n = t.keys(r);
|
|
411
411
|
return [...new Set(n)];
|
|
412
412
|
}
|
|
413
|
-
},
|
|
413
|
+
}, Kt = {
|
|
414
414
|
get(e, t) {
|
|
415
415
|
const { context: r, objectId: n } = e;
|
|
416
|
-
return t = ae(t), t === Symbol.hasInstance ? (s) => Array.isArray(s) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t ===
|
|
416
|
+
return t = ae(t), t === Symbol.hasInstance ? (s) => Array.isArray(s) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? re(e, t) : xt(e)[t];
|
|
417
417
|
},
|
|
418
418
|
set(e, t, r) {
|
|
419
419
|
const { context: n, objectId: s, path: o, textV2: i } = e;
|
|
420
|
-
if (t = ae(t),
|
|
420
|
+
if (t = ae(t), ze(r, n))
|
|
421
421
|
throw new RangeError("Cannot create a reference to an existing document object");
|
|
422
|
-
if (t ===
|
|
422
|
+
if (t === zt)
|
|
423
423
|
return !0;
|
|
424
|
-
if (t ===
|
|
424
|
+
if (t === Oe)
|
|
425
425
|
return e.trace = r, !0;
|
|
426
426
|
if (typeof t == "string")
|
|
427
427
|
throw new RangeError("list index must be a number");
|
|
428
|
-
const [c,
|
|
429
|
-
switch (
|
|
428
|
+
const [c, f] = Pe(r, i, [...o, t], n);
|
|
429
|
+
switch (f) {
|
|
430
430
|
case "list": {
|
|
431
431
|
let p;
|
|
432
|
-
t >= n.length(s) ? p = n.insertObject(s, t, []) : p = n.putObject(s, t, []),
|
|
432
|
+
t >= n.length(s) ? p = n.insertObject(s, t, []) : p = n.putObject(s, t, []), Ke(n, p, i, [...o, t]).splice(0, 0, ...c);
|
|
433
433
|
break;
|
|
434
434
|
}
|
|
435
435
|
case "text": {
|
|
436
436
|
if (i)
|
|
437
|
-
|
|
437
|
+
Le(c), t >= n.length(s) ? n.insertObject(s, t, c) : n.putObject(s, t, c);
|
|
438
438
|
else {
|
|
439
439
|
let p;
|
|
440
|
-
|
|
440
|
+
wt(c), t >= n.length(s) ? p = n.insertObject(s, t, "") : p = n.putObject(s, t, ""), Ue(n, p, [...o, t]).splice(0, 0, ...c);
|
|
441
441
|
}
|
|
442
442
|
break;
|
|
443
443
|
}
|
|
@@ -450,7 +450,7 @@ const Cr = {
|
|
|
450
450
|
break;
|
|
451
451
|
}
|
|
452
452
|
default:
|
|
453
|
-
t >= n.length(s) ? n.insert(s, t, c,
|
|
453
|
+
t >= n.length(s) ? n.insert(s, t, c, f) : n.put(s, t, c, f);
|
|
454
454
|
}
|
|
455
455
|
return !0;
|
|
456
456
|
},
|
|
@@ -468,7 +468,7 @@ const Cr = {
|
|
|
468
468
|
},
|
|
469
469
|
getOwnPropertyDescriptor(e, t) {
|
|
470
470
|
const { context: r, objectId: n } = e;
|
|
471
|
-
return t === "length" ? { writable: !0, value: r.length(n) } : t ===
|
|
471
|
+
return t === "length" ? { writable: !0, value: r.length(n) } : t === Ie ? { configurable: !1, enumerable: !1, value: n } : (t = ae(t), { configurable: !0, enumerable: !0, value: re(e, t) });
|
|
472
472
|
},
|
|
473
473
|
getPrototypeOf(e) {
|
|
474
474
|
return Object.getPrototypeOf(e);
|
|
@@ -477,13 +477,13 @@ const Cr = {
|
|
|
477
477
|
const e = [];
|
|
478
478
|
return e.push("length"), e;
|
|
479
479
|
}
|
|
480
|
-
},
|
|
480
|
+
}, Or = Object.assign({}, Kt, {
|
|
481
481
|
get(e, t) {
|
|
482
482
|
const { context: r, objectId: n } = e;
|
|
483
|
-
return t = ae(t), t === Symbol.hasInstance ? (s) => Array.isArray(s) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t ===
|
|
483
|
+
return t = ae(t), t === Symbol.hasInstance ? (s) => Array.isArray(s) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? re(e, t) : Ir(e)[t] || xt(e)[t];
|
|
484
484
|
},
|
|
485
485
|
getPrototypeOf() {
|
|
486
|
-
return Object.getPrototypeOf(new
|
|
486
|
+
return Object.getPrototypeOf(new be());
|
|
487
487
|
}
|
|
488
488
|
});
|
|
489
489
|
function He(e, t, r, n) {
|
|
@@ -494,9 +494,9 @@ function He(e, t, r, n) {
|
|
|
494
494
|
cache: {},
|
|
495
495
|
textV2: r
|
|
496
496
|
}, o = {};
|
|
497
|
-
return Object.assign(o, s), new Proxy(o,
|
|
497
|
+
return Object.assign(o, s), new Proxy(o, _r);
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Ke(e, t, r, n) {
|
|
500
500
|
const s = {
|
|
501
501
|
context: e,
|
|
502
502
|
objectId: t,
|
|
@@ -504,9 +504,9 @@ function $e(e, t, r, n) {
|
|
|
504
504
|
cache: {},
|
|
505
505
|
textV2: r
|
|
506
506
|
}, o = [];
|
|
507
|
-
return Object.assign(o, s), new Proxy(o,
|
|
507
|
+
return Object.assign(o, s), new Proxy(o, Kt);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Ue(e, t, r) {
|
|
510
510
|
const n = {
|
|
511
511
|
context: e,
|
|
512
512
|
objectId: t,
|
|
@@ -514,26 +514,26 @@ function Oe(e, t, r) {
|
|
|
514
514
|
cache: {},
|
|
515
515
|
textV2: !1
|
|
516
516
|
}, s = {};
|
|
517
|
-
return Object.assign(s, n), new Proxy(s,
|
|
517
|
+
return Object.assign(s, n), new Proxy(s, Or);
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function xt(e) {
|
|
520
520
|
const { context: t, objectId: r, path: n, textV2: s } = e;
|
|
521
521
|
return {
|
|
522
522
|
deleteAt(i, c) {
|
|
523
523
|
return typeof c == "number" ? t.splice(r, i, c) : t.delete(r, i), this;
|
|
524
524
|
},
|
|
525
|
-
fill(i, c,
|
|
526
|
-
const [p, d] =
|
|
527
|
-
c = ae(c || 0),
|
|
528
|
-
for (let g = c; g < Math.min(
|
|
525
|
+
fill(i, c, f) {
|
|
526
|
+
const [p, d] = Pe(i, s, [...n, c], t), h = t.length(r);
|
|
527
|
+
c = ae(c || 0), f = ae(f || h);
|
|
528
|
+
for (let g = c; g < Math.min(f, h); g++)
|
|
529
529
|
if (d === "list" || d === "map")
|
|
530
530
|
t.putObject(r, g, p);
|
|
531
531
|
else if (d === "text")
|
|
532
532
|
if (s)
|
|
533
|
-
|
|
533
|
+
Le(p), t.putObject(r, g, p);
|
|
534
534
|
else {
|
|
535
|
-
|
|
536
|
-
const u = t.putObject(r, g, ""), b =
|
|
535
|
+
wt(p);
|
|
536
|
+
const u = t.putObject(r, g, ""), b = Ue(t, u, [...n, g]);
|
|
537
537
|
for (let x = 0; x < p.length; x++)
|
|
538
538
|
b[x] = p.get(x);
|
|
539
539
|
}
|
|
@@ -542,10 +542,10 @@ function pt(e) {
|
|
|
542
542
|
return this;
|
|
543
543
|
},
|
|
544
544
|
indexOf(i, c = 0) {
|
|
545
|
-
const
|
|
546
|
-
for (let p = c; p <
|
|
545
|
+
const f = t.length(r);
|
|
546
|
+
for (let p = c; p < f; p++) {
|
|
547
547
|
const d = t.getWithType(r, p);
|
|
548
|
-
if (d && (d[1] === i[
|
|
548
|
+
if (d && (d[1] === i[Ie] || d[1] === i))
|
|
549
549
|
return p;
|
|
550
550
|
}
|
|
551
551
|
return -1;
|
|
@@ -570,19 +570,19 @@ function pt(e) {
|
|
|
570
570
|
const i = re(e, 0);
|
|
571
571
|
return t.delete(r, 0), i;
|
|
572
572
|
},
|
|
573
|
-
splice(i, c, ...
|
|
573
|
+
splice(i, c, ...f) {
|
|
574
574
|
i = ae(i), typeof c != "number" && (c = t.length(r) - i), c = ae(c);
|
|
575
|
-
for (const h of
|
|
576
|
-
if (
|
|
575
|
+
for (const h of f)
|
|
576
|
+
if (ze(h, t))
|
|
577
577
|
throw new RangeError("Cannot create a reference to an existing document object");
|
|
578
578
|
const p = [];
|
|
579
579
|
for (let h = 0; h < c; h++) {
|
|
580
580
|
const g = re(e, i);
|
|
581
581
|
g !== void 0 && p.push(g), t.delete(r, i);
|
|
582
582
|
}
|
|
583
|
-
const d =
|
|
583
|
+
const d = f.map((h, g) => {
|
|
584
584
|
try {
|
|
585
|
-
return
|
|
585
|
+
return Pe(h, s, [...n], t);
|
|
586
586
|
} catch (u) {
|
|
587
587
|
throw u instanceof RangeError ? new RangeError(`${u.message} (at index ${g} in the input)`) : u;
|
|
588
588
|
}
|
|
@@ -591,15 +591,15 @@ function pt(e) {
|
|
|
591
591
|
switch (g) {
|
|
592
592
|
case "list": {
|
|
593
593
|
const u = t.insertObject(r, i, []);
|
|
594
|
-
|
|
594
|
+
Ke(t, u, s, [...n, i]).splice(0, 0, ...h);
|
|
595
595
|
break;
|
|
596
596
|
}
|
|
597
597
|
case "text": {
|
|
598
598
|
if (s)
|
|
599
|
-
|
|
599
|
+
Le(h), t.insertObject(r, i, h);
|
|
600
600
|
else {
|
|
601
601
|
const u = t.insertObject(r, i, "");
|
|
602
|
-
|
|
602
|
+
Ue(t, u, [...n, i]).splice(0, 0, ...h);
|
|
603
603
|
}
|
|
604
604
|
break;
|
|
605
605
|
}
|
|
@@ -623,8 +623,8 @@ function pt(e) {
|
|
|
623
623
|
let i = 0;
|
|
624
624
|
return {
|
|
625
625
|
next: () => {
|
|
626
|
-
const
|
|
627
|
-
return
|
|
626
|
+
const f = re(e, i);
|
|
627
|
+
return f === void 0 ? { value: void 0, done: !0 } : { value: [i++, f], done: !1 };
|
|
628
628
|
},
|
|
629
629
|
[Symbol.iterator]() {
|
|
630
630
|
return this;
|
|
@@ -645,8 +645,8 @@ function pt(e) {
|
|
|
645
645
|
let i = 0;
|
|
646
646
|
return {
|
|
647
647
|
next: () => {
|
|
648
|
-
const
|
|
649
|
-
return
|
|
648
|
+
const f = re(e, i++);
|
|
649
|
+
return f === void 0 ? { value: void 0, done: !0 } : { value: f, done: !1 };
|
|
650
650
|
},
|
|
651
651
|
[Symbol.iterator]() {
|
|
652
652
|
return this;
|
|
@@ -685,16 +685,16 @@ function pt(e) {
|
|
|
685
685
|
},
|
|
686
686
|
find(i) {
|
|
687
687
|
let c = 0;
|
|
688
|
-
for (const
|
|
689
|
-
if (i(
|
|
690
|
-
return
|
|
688
|
+
for (const f of this) {
|
|
689
|
+
if (i(f, c))
|
|
690
|
+
return f;
|
|
691
691
|
c += 1;
|
|
692
692
|
}
|
|
693
693
|
},
|
|
694
694
|
findIndex(i) {
|
|
695
695
|
let c = 0;
|
|
696
|
-
for (const
|
|
697
|
-
if (i(
|
|
696
|
+
for (const f of this) {
|
|
697
|
+
if (i(f, c))
|
|
698
698
|
return c;
|
|
699
699
|
c += 1;
|
|
700
700
|
}
|
|
@@ -720,8 +720,8 @@ function pt(e) {
|
|
|
720
720
|
},
|
|
721
721
|
some(i) {
|
|
722
722
|
let c = 0;
|
|
723
|
-
for (const
|
|
724
|
-
if (i(
|
|
723
|
+
for (const f of this) {
|
|
724
|
+
if (i(f, c))
|
|
725
725
|
return !0;
|
|
726
726
|
c += 1;
|
|
727
727
|
}
|
|
@@ -734,7 +734,7 @@ function pt(e) {
|
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function Ir(e) {
|
|
738
738
|
const { context: t, objectId: r } = e;
|
|
739
739
|
return {
|
|
740
740
|
set(s, o) {
|
|
@@ -751,8 +751,8 @@ function _r(e) {
|
|
|
751
751
|
let o = "";
|
|
752
752
|
const i = t.length(r);
|
|
753
753
|
for (let c = 0; c < i; c++) {
|
|
754
|
-
const
|
|
755
|
-
typeof
|
|
754
|
+
const f = this[c];
|
|
755
|
+
typeof f == "string" ? o += f : (o.length > 0 && (s.push(o), o = ""), s.push(f));
|
|
756
756
|
}
|
|
757
757
|
return o.length > 0 && s.push(o), s;
|
|
758
758
|
},
|
|
@@ -763,19 +763,19 @@ function _r(e) {
|
|
|
763
763
|
return t.text(r).indexOf(s, o);
|
|
764
764
|
},
|
|
765
765
|
insertAt(s, ...o) {
|
|
766
|
-
o.every((i) => typeof i == "string") ? t.splice(r, s, 0, o.join("")) :
|
|
766
|
+
o.every((i) => typeof i == "string") ? t.splice(r, s, 0, o.join("")) : xt(e).insertAt(s, ...o);
|
|
767
767
|
}
|
|
768
768
|
};
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
if (!(e instanceof
|
|
770
|
+
function wt(e) {
|
|
771
|
+
if (!(e instanceof be))
|
|
772
772
|
throw new Error("value was not a Text instance");
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function Le(e) {
|
|
775
775
|
if (typeof e != "string")
|
|
776
776
|
throw new Error("value was not a string");
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function Ot(e) {
|
|
779
779
|
const t = e.map((r) => {
|
|
780
780
|
if (typeof r == "number")
|
|
781
781
|
return r.toString();
|
|
@@ -784,52 +784,52 @@ function Ct(e) {
|
|
|
784
784
|
});
|
|
785
785
|
return e.length === 0 ? "" : "/" + t.join("/");
|
|
786
786
|
}
|
|
787
|
-
const
|
|
788
|
-
function
|
|
789
|
-
return typeof e == "string" &&
|
|
787
|
+
const Ur = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
788
|
+
function Wt(e) {
|
|
789
|
+
return typeof e == "string" && Ur.test(e);
|
|
790
790
|
}
|
|
791
791
|
const Z = [];
|
|
792
792
|
for (let e = 0; e < 256; ++e)
|
|
793
793
|
Z.push((e + 256).toString(16).slice(1));
|
|
794
|
-
function
|
|
794
|
+
function Fr(e, t = 0) {
|
|
795
795
|
return Z[e[t + 0]] + Z[e[t + 1]] + Z[e[t + 2]] + Z[e[t + 3]] + "-" + Z[e[t + 4]] + Z[e[t + 5]] + "-" + Z[e[t + 6]] + Z[e[t + 7]] + "-" + Z[e[t + 8]] + Z[e[t + 9]] + "-" + Z[e[t + 10]] + Z[e[t + 11]] + Z[e[t + 12]] + Z[e[t + 13]] + Z[e[t + 14]] + Z[e[t + 15]];
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
const r =
|
|
799
|
-
if (!
|
|
797
|
+
function kr(e, t = 0) {
|
|
798
|
+
const r = Fr(e, t);
|
|
799
|
+
if (!Wt(r))
|
|
800
800
|
throw TypeError("Stringified UUID is invalid");
|
|
801
801
|
return r;
|
|
802
802
|
}
|
|
803
|
-
let
|
|
804
|
-
const
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
const
|
|
803
|
+
let Jt;
|
|
804
|
+
const Gt = new Array(128).fill(void 0);
|
|
805
|
+
Gt.push(void 0, null, !0, !1);
|
|
806
|
+
Gt.length;
|
|
807
|
+
const Xe = typeof TextEncoder < "u" ? new TextEncoder("utf-8") : { encode: () => {
|
|
808
808
|
throw Error("TextEncoder not available");
|
|
809
809
|
} };
|
|
810
|
-
|
|
811
|
-
const
|
|
810
|
+
Xe.encodeInto;
|
|
811
|
+
const jr = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
|
|
812
812
|
throw Error("TextDecoder not available");
|
|
813
813
|
} };
|
|
814
|
-
typeof TextDecoder < "u" &&
|
|
815
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) =>
|
|
816
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) =>
|
|
817
|
-
var
|
|
818
|
-
function
|
|
814
|
+
typeof TextDecoder < "u" && jr.decode();
|
|
815
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => Jt.__wbg_automerge_free(e >>> 0));
|
|
816
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => Jt.__wbg_syncstate_free(e >>> 0));
|
|
817
|
+
var Mr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
818
|
+
function We(e) {
|
|
819
819
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
820
820
|
}
|
|
821
|
-
var
|
|
822
|
-
function
|
|
823
|
-
if (
|
|
824
|
-
|
|
821
|
+
var it = { exports: {} }, qe, It;
|
|
822
|
+
function Rr() {
|
|
823
|
+
if (It) return qe;
|
|
824
|
+
It = 1;
|
|
825
825
|
var e = 1e3, t = e * 60, r = t * 60, n = r * 24, s = n * 7, o = n * 365.25;
|
|
826
|
-
|
|
826
|
+
qe = function(d, h) {
|
|
827
827
|
h = h || {};
|
|
828
828
|
var g = typeof d;
|
|
829
829
|
if (g === "string" && d.length > 0)
|
|
830
830
|
return i(d);
|
|
831
831
|
if (g === "number" && isFinite(d))
|
|
832
|
-
return h.long ?
|
|
832
|
+
return h.long ? f(d) : c(d);
|
|
833
833
|
throw new Error(
|
|
834
834
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(d)
|
|
835
835
|
);
|
|
@@ -890,7 +890,7 @@ function kr() {
|
|
|
890
890
|
var h = Math.abs(d);
|
|
891
891
|
return h >= n ? Math.round(d / n) + "d" : h >= r ? Math.round(d / r) + "h" : h >= t ? Math.round(d / t) + "m" : h >= e ? Math.round(d / e) + "s" : d + "ms";
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function f(d) {
|
|
894
894
|
var h = Math.abs(d);
|
|
895
895
|
return h >= n ? p(d, h, n, "day") : h >= r ? p(d, h, r, "hour") : h >= t ? p(d, h, t, "minute") : h >= e ? p(d, h, e, "second") : d + " ms";
|
|
896
896
|
}
|
|
@@ -898,10 +898,10 @@ function kr() {
|
|
|
898
898
|
var b = h >= g * 1.5;
|
|
899
899
|
return Math.round(d / g) + " " + u + (b ? "s" : "");
|
|
900
900
|
}
|
|
901
|
-
return
|
|
901
|
+
return qe;
|
|
902
902
|
}
|
|
903
|
-
function
|
|
904
|
-
r.debug = r, r.default = r, r.coerce =
|
|
903
|
+
function Br(e) {
|
|
904
|
+
r.debug = r, r.default = r, r.coerce = f, r.disable = o, r.enable = s, r.enabled = i, r.humanize = Rr(), r.destroy = p, Object.keys(e).forEach((d) => {
|
|
905
905
|
r[d] = e[d];
|
|
906
906
|
}), r.names = [], r.skips = [], r.formatters = {};
|
|
907
907
|
function t(d) {
|
|
@@ -913,30 +913,30 @@ function Mr(e) {
|
|
|
913
913
|
r.selectColor = t;
|
|
914
914
|
function r(d) {
|
|
915
915
|
let h, g = null, u, b;
|
|
916
|
-
function x(...
|
|
916
|
+
function x(...C) {
|
|
917
917
|
if (!x.enabled)
|
|
918
918
|
return;
|
|
919
|
-
const I = x, U = Number(/* @__PURE__ */ new Date()),
|
|
920
|
-
I.diff =
|
|
919
|
+
const I = x, U = Number(/* @__PURE__ */ new Date()), v = U - (h || U);
|
|
920
|
+
I.diff = v, I.prev = h, I.curr = U, h = U, C[0] = r.coerce(C[0]), typeof C[0] != "string" && C.unshift("%O");
|
|
921
921
|
let B = 0;
|
|
922
|
-
|
|
922
|
+
C[0] = C[0].replace(/%([a-zA-Z%])/g, (F, N) => {
|
|
923
923
|
if (F === "%%")
|
|
924
924
|
return "%";
|
|
925
925
|
B++;
|
|
926
|
-
const
|
|
927
|
-
if (typeof
|
|
928
|
-
const
|
|
929
|
-
F =
|
|
926
|
+
const P = r.formatters[N];
|
|
927
|
+
if (typeof P == "function") {
|
|
928
|
+
const z = C[B];
|
|
929
|
+
F = P.call(I, z), C.splice(B, 1), B--;
|
|
930
930
|
}
|
|
931
931
|
return F;
|
|
932
|
-
}), r.formatArgs.call(I,
|
|
932
|
+
}), r.formatArgs.call(I, C), (I.log || r.log).apply(I, C);
|
|
933
933
|
}
|
|
934
934
|
return x.namespace = d, x.useColors = r.useColors(), x.color = r.selectColor(d), x.extend = n, x.destroy = r.destroy, Object.defineProperty(x, "enabled", {
|
|
935
935
|
enumerable: !0,
|
|
936
936
|
configurable: !1,
|
|
937
937
|
get: () => g !== null ? g : (u !== r.namespaces && (u = r.namespaces, b = r.enabled(d)), b),
|
|
938
|
-
set: (
|
|
939
|
-
g =
|
|
938
|
+
set: (C) => {
|
|
939
|
+
g = C;
|
|
940
940
|
}
|
|
941
941
|
}), typeof r.init == "function" && r.init(x), x;
|
|
942
942
|
}
|
|
@@ -973,7 +973,7 @@ function Mr(e) {
|
|
|
973
973
|
function c(d) {
|
|
974
974
|
return d.toString().substring(2, d.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function f(d) {
|
|
977
977
|
return d instanceof Error ? d.stack || d.message : d;
|
|
978
978
|
}
|
|
979
979
|
function p() {
|
|
@@ -981,12 +981,12 @@ function Mr(e) {
|
|
|
981
981
|
}
|
|
982
982
|
return r.enable(r.load()), r;
|
|
983
983
|
}
|
|
984
|
-
var
|
|
984
|
+
var Tr = Br;
|
|
985
985
|
(function(e, t) {
|
|
986
986
|
t.formatArgs = n, t.save = s, t.load = o, t.useColors = r, t.storage = i(), t.destroy = /* @__PURE__ */ (() => {
|
|
987
|
-
let
|
|
987
|
+
let f = !1;
|
|
988
988
|
return () => {
|
|
989
|
-
|
|
989
|
+
f || (f = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
|
|
990
990
|
};
|
|
991
991
|
})(), t.colors = [
|
|
992
992
|
"#0000CC",
|
|
@@ -1067,37 +1067,42 @@ var Rr = Mr;
|
|
|
1067
1067
|
"#FFCC33"
|
|
1068
1068
|
];
|
|
1069
1069
|
function r() {
|
|
1070
|
-
|
|
1070
|
+
if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs))
|
|
1071
|
+
return !0;
|
|
1072
|
+
if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
|
|
1073
|
+
return !1;
|
|
1074
|
+
let f;
|
|
1075
|
+
return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
1071
1076
|
typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
1072
1077
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
1073
|
-
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(
|
|
1078
|
+
typeof navigator < "u" && navigator.userAgent && (f = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(f[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
1074
1079
|
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
1075
1080
|
}
|
|
1076
|
-
function n(
|
|
1077
|
-
if (
|
|
1081
|
+
function n(f) {
|
|
1082
|
+
if (f[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + f[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff), !this.useColors)
|
|
1078
1083
|
return;
|
|
1079
1084
|
const p = "color: " + this.color;
|
|
1080
|
-
|
|
1085
|
+
f.splice(1, 0, p, "color: inherit");
|
|
1081
1086
|
let d = 0, h = 0;
|
|
1082
|
-
|
|
1087
|
+
f[0].replace(/%[a-zA-Z%]/g, (g) => {
|
|
1083
1088
|
g !== "%%" && (d++, g === "%c" && (h = d));
|
|
1084
|
-
}),
|
|
1089
|
+
}), f.splice(h, 0, p);
|
|
1085
1090
|
}
|
|
1086
1091
|
t.log = console.debug || console.log || (() => {
|
|
1087
1092
|
});
|
|
1088
|
-
function s(
|
|
1093
|
+
function s(f) {
|
|
1089
1094
|
try {
|
|
1090
|
-
|
|
1095
|
+
f ? t.storage.setItem("debug", f) : t.storage.removeItem("debug");
|
|
1091
1096
|
} catch {
|
|
1092
1097
|
}
|
|
1093
1098
|
}
|
|
1094
1099
|
function o() {
|
|
1095
|
-
let
|
|
1100
|
+
let f;
|
|
1096
1101
|
try {
|
|
1097
|
-
|
|
1102
|
+
f = t.storage.getItem("debug");
|
|
1098
1103
|
} catch {
|
|
1099
1104
|
}
|
|
1100
|
-
return !
|
|
1105
|
+
return !f && typeof process < "u" && "env" in process && (f = process.env.DEBUG), f;
|
|
1101
1106
|
}
|
|
1102
1107
|
function i() {
|
|
1103
1108
|
try {
|
|
@@ -1105,35 +1110,35 @@ var Rr = Mr;
|
|
|
1105
1110
|
} catch {
|
|
1106
1111
|
}
|
|
1107
1112
|
}
|
|
1108
|
-
e.exports =
|
|
1113
|
+
e.exports = Tr(t);
|
|
1109
1114
|
const { formatters: c } = e.exports;
|
|
1110
|
-
c.j = function(
|
|
1115
|
+
c.j = function(f) {
|
|
1111
1116
|
try {
|
|
1112
|
-
return JSON.stringify(
|
|
1117
|
+
return JSON.stringify(f);
|
|
1113
1118
|
} catch (p) {
|
|
1114
1119
|
return "[UnexpectedJSONParseError]: " + p.message;
|
|
1115
1120
|
}
|
|
1116
1121
|
};
|
|
1117
|
-
})(
|
|
1118
|
-
var
|
|
1119
|
-
const
|
|
1120
|
-
var
|
|
1122
|
+
})(it, it.exports);
|
|
1123
|
+
var Dr = it.exports;
|
|
1124
|
+
const Pr = /* @__PURE__ */ We(Dr);
|
|
1125
|
+
var Xt = { exports: {} };
|
|
1121
1126
|
(function(e) {
|
|
1122
1127
|
var t = Object.prototype.hasOwnProperty, r = "~";
|
|
1123
1128
|
function n() {
|
|
1124
1129
|
}
|
|
1125
1130
|
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (r = !1));
|
|
1126
|
-
function s(
|
|
1127
|
-
this.fn =
|
|
1131
|
+
function s(f, p, d) {
|
|
1132
|
+
this.fn = f, this.context = p, this.once = d || !1;
|
|
1128
1133
|
}
|
|
1129
|
-
function o(
|
|
1134
|
+
function o(f, p, d, h, g) {
|
|
1130
1135
|
if (typeof d != "function")
|
|
1131
1136
|
throw new TypeError("The listener must be a function");
|
|
1132
|
-
var u = new s(d, h ||
|
|
1133
|
-
return
|
|
1137
|
+
var u = new s(d, h || f, g), b = r ? r + p : p;
|
|
1138
|
+
return f._events[b] ? f._events[b].fn ? f._events[b] = [f._events[b], u] : f._events[b].push(u) : (f._events[b] = u, f._eventsCount++), f;
|
|
1134
1139
|
}
|
|
1135
|
-
function i(
|
|
1136
|
-
--
|
|
1140
|
+
function i(f, p) {
|
|
1141
|
+
--f._eventsCount === 0 ? f._events = new n() : delete f._events[p];
|
|
1137
1142
|
}
|
|
1138
1143
|
function c() {
|
|
1139
1144
|
this._events = new n(), this._eventsCount = 0;
|
|
@@ -1157,45 +1162,45 @@ var Jt = { exports: {} };
|
|
|
1157
1162
|
}, c.prototype.emit = function(p, d, h, g, u, b) {
|
|
1158
1163
|
var x = r ? r + p : p;
|
|
1159
1164
|
if (!this._events[x]) return !1;
|
|
1160
|
-
var
|
|
1161
|
-
if (
|
|
1162
|
-
switch (
|
|
1165
|
+
var C = this._events[x], I = arguments.length, U, v;
|
|
1166
|
+
if (C.fn) {
|
|
1167
|
+
switch (C.once && this.removeListener(p, C.fn, void 0, !0), I) {
|
|
1163
1168
|
case 1:
|
|
1164
|
-
return
|
|
1169
|
+
return C.fn.call(C.context), !0;
|
|
1165
1170
|
case 2:
|
|
1166
|
-
return
|
|
1171
|
+
return C.fn.call(C.context, d), !0;
|
|
1167
1172
|
case 3:
|
|
1168
|
-
return
|
|
1173
|
+
return C.fn.call(C.context, d, h), !0;
|
|
1169
1174
|
case 4:
|
|
1170
|
-
return
|
|
1175
|
+
return C.fn.call(C.context, d, h, g), !0;
|
|
1171
1176
|
case 5:
|
|
1172
|
-
return
|
|
1177
|
+
return C.fn.call(C.context, d, h, g, u), !0;
|
|
1173
1178
|
case 6:
|
|
1174
|
-
return
|
|
1179
|
+
return C.fn.call(C.context, d, h, g, u, b), !0;
|
|
1175
1180
|
}
|
|
1176
|
-
for (
|
|
1177
|
-
U[
|
|
1178
|
-
|
|
1181
|
+
for (v = 1, U = new Array(I - 1); v < I; v++)
|
|
1182
|
+
U[v - 1] = arguments[v];
|
|
1183
|
+
C.fn.apply(C.context, U);
|
|
1179
1184
|
} else {
|
|
1180
|
-
var B =
|
|
1181
|
-
for (
|
|
1182
|
-
switch (
|
|
1185
|
+
var B = C.length, M;
|
|
1186
|
+
for (v = 0; v < B; v++)
|
|
1187
|
+
switch (C[v].once && this.removeListener(p, C[v].fn, void 0, !0), I) {
|
|
1183
1188
|
case 1:
|
|
1184
|
-
|
|
1189
|
+
C[v].fn.call(C[v].context);
|
|
1185
1190
|
break;
|
|
1186
1191
|
case 2:
|
|
1187
|
-
|
|
1192
|
+
C[v].fn.call(C[v].context, d);
|
|
1188
1193
|
break;
|
|
1189
1194
|
case 3:
|
|
1190
|
-
|
|
1195
|
+
C[v].fn.call(C[v].context, d, h);
|
|
1191
1196
|
break;
|
|
1192
1197
|
case 4:
|
|
1193
|
-
|
|
1198
|
+
C[v].fn.call(C[v].context, d, h, g);
|
|
1194
1199
|
break;
|
|
1195
1200
|
default:
|
|
1196
1201
|
if (!U) for (M = 1, U = new Array(I - 1); M < I; M++)
|
|
1197
1202
|
U[M - 1] = arguments[M];
|
|
1198
|
-
|
|
1203
|
+
C[v].fn.apply(C[v].context, U);
|
|
1199
1204
|
}
|
|
1200
1205
|
}
|
|
1201
1206
|
return !0;
|
|
@@ -1212,72 +1217,72 @@ var Jt = { exports: {} };
|
|
|
1212
1217
|
if (b.fn)
|
|
1213
1218
|
b.fn === d && (!g || b.once) && (!h || b.context === h) && i(this, u);
|
|
1214
1219
|
else {
|
|
1215
|
-
for (var x = 0,
|
|
1216
|
-
(b[x].fn !== d || g && !b[x].once || h && b[x].context !== h) &&
|
|
1217
|
-
|
|
1220
|
+
for (var x = 0, C = [], I = b.length; x < I; x++)
|
|
1221
|
+
(b[x].fn !== d || g && !b[x].once || h && b[x].context !== h) && C.push(b[x]);
|
|
1222
|
+
C.length ? this._events[u] = C.length === 1 ? C[0] : C : i(this, u);
|
|
1218
1223
|
}
|
|
1219
1224
|
return this;
|
|
1220
1225
|
}, c.prototype.removeAllListeners = function(p) {
|
|
1221
1226
|
var d;
|
|
1222
1227
|
return p ? (d = r ? r + p : p, this._events[d] && i(this, d)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
1223
1228
|
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = r, c.EventEmitter = c, e.exports = c;
|
|
1224
|
-
})(
|
|
1225
|
-
var
|
|
1226
|
-
const
|
|
1227
|
-
var ve = {},
|
|
1229
|
+
})(Xt);
|
|
1230
|
+
var Lr = Xt.exports;
|
|
1231
|
+
const Vr = /* @__PURE__ */ We(Lr);
|
|
1232
|
+
var ve = {}, de = {}, q = {};
|
|
1228
1233
|
Object.defineProperty(q, "__esModule", { value: !0 });
|
|
1229
1234
|
q.output = q.exists = q.hash = q.bytes = q.bool = q.number = q.isBytes = void 0;
|
|
1230
|
-
function
|
|
1235
|
+
function Ve(e) {
|
|
1231
1236
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
1232
1237
|
throw new Error(`positive integer expected, not ${e}`);
|
|
1233
1238
|
}
|
|
1234
|
-
q.number =
|
|
1235
|
-
function
|
|
1239
|
+
q.number = Ve;
|
|
1240
|
+
function qt(e) {
|
|
1236
1241
|
if (typeof e != "boolean")
|
|
1237
1242
|
throw new Error(`boolean expected, not ${e}`);
|
|
1238
1243
|
}
|
|
1239
|
-
q.bool =
|
|
1240
|
-
function
|
|
1244
|
+
q.bool = qt;
|
|
1245
|
+
function Zt(e) {
|
|
1241
1246
|
return e instanceof Uint8Array || e != null && typeof e == "object" && e.constructor.name === "Uint8Array";
|
|
1242
1247
|
}
|
|
1243
|
-
q.isBytes =
|
|
1244
|
-
function
|
|
1245
|
-
if (!
|
|
1248
|
+
q.isBytes = Zt;
|
|
1249
|
+
function mt(e, ...t) {
|
|
1250
|
+
if (!Zt(e))
|
|
1246
1251
|
throw new Error("Uint8Array expected");
|
|
1247
1252
|
if (t.length > 0 && !t.includes(e.length))
|
|
1248
1253
|
throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`);
|
|
1249
1254
|
}
|
|
1250
|
-
q.bytes =
|
|
1251
|
-
function
|
|
1255
|
+
q.bytes = mt;
|
|
1256
|
+
function Yt(e) {
|
|
1252
1257
|
if (typeof e != "function" || typeof e.create != "function")
|
|
1253
1258
|
throw new Error("Hash should be wrapped by utils.wrapConstructor");
|
|
1254
|
-
|
|
1259
|
+
Ve(e.outputLen), Ve(e.blockLen);
|
|
1255
1260
|
}
|
|
1256
|
-
q.hash =
|
|
1257
|
-
function
|
|
1261
|
+
q.hash = Yt;
|
|
1262
|
+
function Qt(e, t = !0) {
|
|
1258
1263
|
if (e.destroyed)
|
|
1259
1264
|
throw new Error("Hash instance has been destroyed");
|
|
1260
1265
|
if (t && e.finished)
|
|
1261
1266
|
throw new Error("Hash#digest() has already been called");
|
|
1262
1267
|
}
|
|
1263
|
-
q.exists =
|
|
1264
|
-
function
|
|
1265
|
-
|
|
1268
|
+
q.exists = Qt;
|
|
1269
|
+
function er(e, t) {
|
|
1270
|
+
mt(e);
|
|
1266
1271
|
const r = t.outputLen;
|
|
1267
1272
|
if (e.length < r)
|
|
1268
1273
|
throw new Error(`digestInto() expects output buffer of length at least ${r}`);
|
|
1269
1274
|
}
|
|
1270
|
-
q.output =
|
|
1271
|
-
const
|
|
1272
|
-
q.default =
|
|
1273
|
-
var
|
|
1274
|
-
Object.defineProperty(
|
|
1275
|
-
|
|
1276
|
-
|
|
1275
|
+
q.output = er;
|
|
1276
|
+
const Nr = { number: Ve, bool: qt, bytes: mt, hash: Yt, exists: Qt, output: er };
|
|
1277
|
+
q.default = Nr;
|
|
1278
|
+
var St = {}, Je = {};
|
|
1279
|
+
Object.defineProperty(Je, "__esModule", { value: !0 });
|
|
1280
|
+
Je.crypto = void 0;
|
|
1281
|
+
Je.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
|
|
1277
1282
|
(function(e) {
|
|
1278
1283
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1279
1284
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.randomBytes = e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.checkOpts = e.Hash = e.concatBytes = e.toBytes = e.utf8ToBytes = e.asyncLoop = e.nextTick = e.hexToBytes = e.bytesToHex = e.byteSwap32 = e.byteSwapIfBE = e.byteSwap = e.isLE = e.rotl = e.rotr = e.createView = e.u32 = e.u8 = e.isBytes = void 0;
|
|
1280
|
-
const t =
|
|
1285
|
+
const t = Je, r = q;
|
|
1281
1286
|
function n(E) {
|
|
1282
1287
|
return E instanceof Uint8Array || E != null && typeof E == "object" && E.constructor.name === "Uint8Array";
|
|
1283
1288
|
}
|
|
@@ -1290,8 +1295,8 @@ Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
1290
1295
|
e.createView = i;
|
|
1291
1296
|
const c = (E, l) => E << 32 - l | E >>> l;
|
|
1292
1297
|
e.rotr = c;
|
|
1293
|
-
const
|
|
1294
|
-
e.rotl =
|
|
1298
|
+
const f = (E, l) => E << l | E >>> 32 - l >>> 0;
|
|
1299
|
+
e.rotl = f, e.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
1295
1300
|
const p = (E) => E << 24 & 4278190080 | E << 8 & 16711680 | E >>> 8 & 65280 | E >>> 24 & 255;
|
|
1296
1301
|
e.byteSwap = p, e.byteSwapIfBE = e.isLE ? (E) => E : (E) => (0, e.byteSwap)(E);
|
|
1297
1302
|
function d(E) {
|
|
@@ -1324,26 +1329,26 @@ Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
1324
1329
|
if (l % 2)
|
|
1325
1330
|
throw new Error("padded hex string expected, got unpadded hex of length " + l);
|
|
1326
1331
|
const m = new Uint8Array(_);
|
|
1327
|
-
for (let
|
|
1328
|
-
const
|
|
1329
|
-
if (
|
|
1330
|
-
const R = E[
|
|
1331
|
-
throw new Error('hex string expected, got non-hex character "' + R + '" at index ' +
|
|
1332
|
+
for (let A = 0, S = 0; A < _; A++, S += 2) {
|
|
1333
|
+
const k = b(E.charCodeAt(S)), j = b(E.charCodeAt(S + 1));
|
|
1334
|
+
if (k === void 0 || j === void 0) {
|
|
1335
|
+
const R = E[S] + E[S + 1];
|
|
1336
|
+
throw new Error('hex string expected, got non-hex character "' + R + '" at index ' + S);
|
|
1332
1337
|
}
|
|
1333
|
-
m[
|
|
1338
|
+
m[A] = k * 16 + j;
|
|
1334
1339
|
}
|
|
1335
1340
|
return m;
|
|
1336
1341
|
}
|
|
1337
1342
|
e.hexToBytes = x;
|
|
1338
|
-
const
|
|
1343
|
+
const C = async () => {
|
|
1339
1344
|
};
|
|
1340
|
-
e.nextTick =
|
|
1345
|
+
e.nextTick = C;
|
|
1341
1346
|
async function I(E, l, _) {
|
|
1342
1347
|
let m = Date.now();
|
|
1343
|
-
for (let
|
|
1344
|
-
_(
|
|
1345
|
-
const
|
|
1346
|
-
|
|
1348
|
+
for (let A = 0; A < E; A++) {
|
|
1349
|
+
_(A);
|
|
1350
|
+
const S = Date.now() - m;
|
|
1351
|
+
S >= 0 && S < l || (await (0, e.nextTick)(), m += S);
|
|
1347
1352
|
}
|
|
1348
1353
|
}
|
|
1349
1354
|
e.asyncLoop = I;
|
|
@@ -1353,20 +1358,20 @@ Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
1353
1358
|
return new Uint8Array(new TextEncoder().encode(E));
|
|
1354
1359
|
}
|
|
1355
1360
|
e.utf8ToBytes = U;
|
|
1356
|
-
function
|
|
1361
|
+
function v(E) {
|
|
1357
1362
|
return typeof E == "string" && (E = U(E)), (0, r.bytes)(E), E;
|
|
1358
1363
|
}
|
|
1359
|
-
e.toBytes =
|
|
1364
|
+
e.toBytes = v;
|
|
1360
1365
|
function B(...E) {
|
|
1361
1366
|
let l = 0;
|
|
1362
1367
|
for (let m = 0; m < E.length; m++) {
|
|
1363
|
-
const
|
|
1364
|
-
(0, r.bytes)(
|
|
1368
|
+
const A = E[m];
|
|
1369
|
+
(0, r.bytes)(A), l += A.length;
|
|
1365
1370
|
}
|
|
1366
1371
|
const _ = new Uint8Array(l);
|
|
1367
|
-
for (let m = 0,
|
|
1368
|
-
const
|
|
1369
|
-
_.set(
|
|
1372
|
+
for (let m = 0, A = 0; m < E.length; m++) {
|
|
1373
|
+
const S = E[m];
|
|
1374
|
+
_.set(S, A), A += S.length;
|
|
1370
1375
|
}
|
|
1371
1376
|
return _;
|
|
1372
1377
|
}
|
|
@@ -1385,56 +1390,56 @@ Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
|
|
|
1385
1390
|
return Object.assign(E, l);
|
|
1386
1391
|
}
|
|
1387
1392
|
e.checkOpts = N;
|
|
1388
|
-
function
|
|
1389
|
-
const l = (m) => E().update(
|
|
1393
|
+
function P(E) {
|
|
1394
|
+
const l = (m) => E().update(v(m)).digest(), _ = E();
|
|
1390
1395
|
return l.outputLen = _.outputLen, l.blockLen = _.blockLen, l.create = () => E(), l;
|
|
1391
1396
|
}
|
|
1392
|
-
e.wrapConstructor =
|
|
1393
|
-
function
|
|
1394
|
-
const l = (m,
|
|
1397
|
+
e.wrapConstructor = P;
|
|
1398
|
+
function z(E) {
|
|
1399
|
+
const l = (m, A) => E(A).update(v(m)).digest(), _ = E({});
|
|
1395
1400
|
return l.outputLen = _.outputLen, l.blockLen = _.blockLen, l.create = (m) => E(m), l;
|
|
1396
1401
|
}
|
|
1397
|
-
e.wrapConstructorWithOpts =
|
|
1398
|
-
function
|
|
1399
|
-
const l = (m,
|
|
1402
|
+
e.wrapConstructorWithOpts = z;
|
|
1403
|
+
function $(E) {
|
|
1404
|
+
const l = (m, A) => E(A).update(v(m)).digest(), _ = E({});
|
|
1400
1405
|
return l.outputLen = _.outputLen, l.blockLen = _.blockLen, l.create = (m) => E(m), l;
|
|
1401
1406
|
}
|
|
1402
|
-
e.wrapXOFConstructorWithOpts =
|
|
1407
|
+
e.wrapXOFConstructorWithOpts = $;
|
|
1403
1408
|
function ie(E = 32) {
|
|
1404
1409
|
if (t.crypto && typeof t.crypto.getRandomValues == "function")
|
|
1405
1410
|
return t.crypto.getRandomValues(new Uint8Array(E));
|
|
1406
1411
|
throw new Error("crypto.getRandomValues must be defined");
|
|
1407
1412
|
}
|
|
1408
1413
|
e.randomBytes = ie;
|
|
1409
|
-
})(
|
|
1410
|
-
Object.defineProperty(
|
|
1411
|
-
|
|
1412
|
-
const
|
|
1413
|
-
function
|
|
1414
|
+
})(St);
|
|
1415
|
+
Object.defineProperty(de, "__esModule", { value: !0 });
|
|
1416
|
+
de.HashMD = de.Maj = de.Chi = void 0;
|
|
1417
|
+
const Ze = q, Ae = St;
|
|
1418
|
+
function $r(e, t, r, n) {
|
|
1414
1419
|
if (typeof e.setBigUint64 == "function")
|
|
1415
1420
|
return e.setBigUint64(t, r, n);
|
|
1416
|
-
const s = BigInt(32), o = BigInt(4294967295), i = Number(r >> s & o), c = Number(r & o),
|
|
1417
|
-
e.setUint32(t +
|
|
1421
|
+
const s = BigInt(32), o = BigInt(4294967295), i = Number(r >> s & o), c = Number(r & o), f = n ? 4 : 0, p = n ? 0 : 4;
|
|
1422
|
+
e.setUint32(t + f, i, n), e.setUint32(t + p, c, n);
|
|
1418
1423
|
}
|
|
1419
|
-
const
|
|
1420
|
-
|
|
1424
|
+
const zr = (e, t, r) => e & t ^ ~e & r;
|
|
1425
|
+
de.Chi = zr;
|
|
1421
1426
|
const Hr = (e, t, r) => e & t ^ e & r ^ t & r;
|
|
1422
|
-
|
|
1423
|
-
class
|
|
1427
|
+
de.Maj = Hr;
|
|
1428
|
+
class Kr extends Ae.Hash {
|
|
1424
1429
|
constructor(t, r, n, s) {
|
|
1425
|
-
super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = s, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = (0,
|
|
1430
|
+
super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = s, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = (0, Ae.createView)(this.buffer);
|
|
1426
1431
|
}
|
|
1427
1432
|
update(t) {
|
|
1428
|
-
(0,
|
|
1433
|
+
(0, Ze.exists)(this);
|
|
1429
1434
|
const { view: r, buffer: n, blockLen: s } = this;
|
|
1430
|
-
t = (0,
|
|
1435
|
+
t = (0, Ae.toBytes)(t);
|
|
1431
1436
|
const o = t.length;
|
|
1432
1437
|
for (let i = 0; i < o; ) {
|
|
1433
1438
|
const c = Math.min(s - this.pos, o - i);
|
|
1434
1439
|
if (c === s) {
|
|
1435
|
-
const
|
|
1440
|
+
const f = (0, Ae.createView)(t);
|
|
1436
1441
|
for (; s <= o - i; i += s)
|
|
1437
|
-
this.process(
|
|
1442
|
+
this.process(f, i);
|
|
1438
1443
|
continue;
|
|
1439
1444
|
}
|
|
1440
1445
|
n.set(t.subarray(i, i + c), this.pos), this.pos += c, i += c, this.pos === s && (this.process(r, 0), this.pos = 0);
|
|
@@ -1442,17 +1447,17 @@ class $r extends Se.Hash {
|
|
|
1442
1447
|
return this.length += t.length, this.roundClean(), this;
|
|
1443
1448
|
}
|
|
1444
1449
|
digestInto(t) {
|
|
1445
|
-
(0,
|
|
1450
|
+
(0, Ze.exists)(this), (0, Ze.output)(t, this), this.finished = !0;
|
|
1446
1451
|
const { buffer: r, view: n, blockLen: s, isLE: o } = this;
|
|
1447
1452
|
let { pos: i } = this;
|
|
1448
1453
|
r[i++] = 128, this.buffer.subarray(i).fill(0), this.padOffset > s - i && (this.process(n, 0), i = 0);
|
|
1449
1454
|
for (let h = i; h < s; h++)
|
|
1450
1455
|
r[h] = 0;
|
|
1451
|
-
|
|
1452
|
-
const c = (0,
|
|
1453
|
-
if (
|
|
1456
|
+
$r(n, s - 8, BigInt(this.length * 8), o), this.process(n, 0);
|
|
1457
|
+
const c = (0, Ae.createView)(t), f = this.outputLen;
|
|
1458
|
+
if (f % 4)
|
|
1454
1459
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
1455
|
-
const p =
|
|
1460
|
+
const p = f / 4, d = this.get();
|
|
1456
1461
|
if (p > d.length)
|
|
1457
1462
|
throw new Error("_sha2: outputLen bigger than state");
|
|
1458
1463
|
for (let h = 0; h < p; h++)
|
|
@@ -1470,10 +1475,10 @@ class $r extends Se.Hash {
|
|
|
1470
1475
|
return t.length = s, t.pos = c, t.finished = o, t.destroyed = i, s % r && t.buffer.set(n), t;
|
|
1471
1476
|
}
|
|
1472
1477
|
}
|
|
1473
|
-
|
|
1478
|
+
de.HashMD = Kr;
|
|
1474
1479
|
Object.defineProperty(ve, "__esModule", { value: !0 });
|
|
1475
1480
|
ve.sha224 = ve.sha256 = void 0;
|
|
1476
|
-
const
|
|
1481
|
+
const Ye = de, te = St, Wr = /* @__PURE__ */ new Uint32Array([
|
|
1477
1482
|
1116352408,
|
|
1478
1483
|
1899447441,
|
|
1479
1484
|
3049323471,
|
|
@@ -1538,7 +1543,7 @@ const qe = he, te = xt, zr = /* @__PURE__ */ new Uint32Array([
|
|
|
1538
1543
|
2756734187,
|
|
1539
1544
|
3204031479,
|
|
1540
1545
|
3329325298
|
|
1541
|
-
]),
|
|
1546
|
+
]), le = /* @__PURE__ */ new Uint32Array([
|
|
1542
1547
|
1779033703,
|
|
1543
1548
|
3144134277,
|
|
1544
1549
|
1013904242,
|
|
@@ -1547,48 +1552,48 @@ const qe = he, te = xt, zr = /* @__PURE__ */ new Uint32Array([
|
|
|
1547
1552
|
2600822924,
|
|
1548
1553
|
528734635,
|
|
1549
1554
|
1541459225
|
|
1550
|
-
]),
|
|
1551
|
-
class
|
|
1555
|
+
]), ue = /* @__PURE__ */ new Uint32Array(64);
|
|
1556
|
+
class tr extends Ye.HashMD {
|
|
1552
1557
|
constructor() {
|
|
1553
|
-
super(64, 32, 8, !1), this.A =
|
|
1558
|
+
super(64, 32, 8, !1), this.A = le[0] | 0, this.B = le[1] | 0, this.C = le[2] | 0, this.D = le[3] | 0, this.E = le[4] | 0, this.F = le[5] | 0, this.G = le[6] | 0, this.H = le[7] | 0;
|
|
1554
1559
|
}
|
|
1555
1560
|
get() {
|
|
1556
|
-
const { A: t, B: r, C: n, D: s, E: o, F: i, G: c, H:
|
|
1557
|
-
return [t, r, n, s, o, i, c,
|
|
1561
|
+
const { A: t, B: r, C: n, D: s, E: o, F: i, G: c, H: f } = this;
|
|
1562
|
+
return [t, r, n, s, o, i, c, f];
|
|
1558
1563
|
}
|
|
1559
1564
|
// prettier-ignore
|
|
1560
|
-
set(t, r, n, s, o, i, c,
|
|
1561
|
-
this.A = t | 0, this.B = r | 0, this.C = n | 0, this.D = s | 0, this.E = o | 0, this.F = i | 0, this.G = c | 0, this.H =
|
|
1565
|
+
set(t, r, n, s, o, i, c, f) {
|
|
1566
|
+
this.A = t | 0, this.B = r | 0, this.C = n | 0, this.D = s | 0, this.E = o | 0, this.F = i | 0, this.G = c | 0, this.H = f | 0;
|
|
1562
1567
|
}
|
|
1563
1568
|
process(t, r) {
|
|
1564
1569
|
for (let h = 0; h < 16; h++, r += 4)
|
|
1565
|
-
|
|
1570
|
+
ue[h] = t.getUint32(r, !1);
|
|
1566
1571
|
for (let h = 16; h < 64; h++) {
|
|
1567
|
-
const g =
|
|
1568
|
-
|
|
1572
|
+
const g = ue[h - 15], u = ue[h - 2], b = (0, te.rotr)(g, 7) ^ (0, te.rotr)(g, 18) ^ g >>> 3, x = (0, te.rotr)(u, 17) ^ (0, te.rotr)(u, 19) ^ u >>> 10;
|
|
1573
|
+
ue[h] = x + ue[h - 7] + b + ue[h - 16] | 0;
|
|
1569
1574
|
}
|
|
1570
|
-
let { A: n, B: s, C: o, D: i, E: c, F:
|
|
1575
|
+
let { A: n, B: s, C: o, D: i, E: c, F: f, G: p, H: d } = this;
|
|
1571
1576
|
for (let h = 0; h < 64; h++) {
|
|
1572
|
-
const g = (0, te.rotr)(c, 6) ^ (0, te.rotr)(c, 11) ^ (0, te.rotr)(c, 25), u = d + g + (0,
|
|
1573
|
-
d = p, p =
|
|
1577
|
+
const g = (0, te.rotr)(c, 6) ^ (0, te.rotr)(c, 11) ^ (0, te.rotr)(c, 25), u = d + g + (0, Ye.Chi)(c, f, p) + Wr[h] + ue[h] | 0, x = ((0, te.rotr)(n, 2) ^ (0, te.rotr)(n, 13) ^ (0, te.rotr)(n, 22)) + (0, Ye.Maj)(n, s, o) | 0;
|
|
1578
|
+
d = p, p = f, f = c, c = i + u | 0, i = o, o = s, s = n, n = u + x | 0;
|
|
1574
1579
|
}
|
|
1575
|
-
n = n + this.A | 0, s = s + this.B | 0, o = o + this.C | 0, i = i + this.D | 0, c = c + this.E | 0,
|
|
1580
|
+
n = n + this.A | 0, s = s + this.B | 0, o = o + this.C | 0, i = i + this.D | 0, c = c + this.E | 0, f = f + this.F | 0, p = p + this.G | 0, d = d + this.H | 0, this.set(n, s, o, i, c, f, p, d);
|
|
1576
1581
|
}
|
|
1577
1582
|
roundClean() {
|
|
1578
|
-
|
|
1583
|
+
ue.fill(0);
|
|
1579
1584
|
}
|
|
1580
1585
|
destroy() {
|
|
1581
1586
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
|
|
1582
1587
|
}
|
|
1583
1588
|
}
|
|
1584
|
-
class
|
|
1589
|
+
class Jr extends tr {
|
|
1585
1590
|
constructor() {
|
|
1586
1591
|
super(), this.A = -1056596264, this.B = 914150663, this.C = 812702999, this.D = -150054599, this.E = -4191439, this.F = 1750603025, this.G = 1694076839, this.H = -1090891868, this.outputLen = 28;
|
|
1587
1592
|
}
|
|
1588
1593
|
}
|
|
1589
|
-
ve.sha256 = (0, te.wrapConstructor)(() => new
|
|
1590
|
-
ve.sha224 = (0, te.wrapConstructor)(() => new
|
|
1591
|
-
function
|
|
1594
|
+
ve.sha256 = (0, te.wrapConstructor)(() => new tr());
|
|
1595
|
+
ve.sha224 = (0, te.wrapConstructor)(() => new Jr());
|
|
1596
|
+
function Gr(e) {
|
|
1592
1597
|
if (e.length >= 255)
|
|
1593
1598
|
throw new TypeError("Alphabet too long");
|
|
1594
1599
|
for (var t = new Uint8Array(256), r = 0; r < t.length; r++)
|
|
@@ -1599,48 +1604,48 @@ function Wr(e) {
|
|
|
1599
1604
|
throw new TypeError(s + " is ambiguous");
|
|
1600
1605
|
t[o] = n;
|
|
1601
1606
|
}
|
|
1602
|
-
var i = e.length, c = e.charAt(0),
|
|
1607
|
+
var i = e.length, c = e.charAt(0), f = Math.log(i) / Math.log(256), p = Math.log(256) / Math.log(i);
|
|
1603
1608
|
function d(u) {
|
|
1604
1609
|
if (u instanceof Uint8Array || (ArrayBuffer.isView(u) ? u = new Uint8Array(u.buffer, u.byteOffset, u.byteLength) : Array.isArray(u) && (u = Uint8Array.from(u))), !(u instanceof Uint8Array))
|
|
1605
1610
|
throw new TypeError("Expected Uint8Array");
|
|
1606
1611
|
if (u.length === 0)
|
|
1607
1612
|
return "";
|
|
1608
|
-
for (var b = 0, x = 0,
|
|
1609
|
-
|
|
1610
|
-
for (var U = (I -
|
|
1611
|
-
for (var B = u[
|
|
1612
|
-
B += 256 *
|
|
1613
|
+
for (var b = 0, x = 0, C = 0, I = u.length; C !== I && u[C] === 0; )
|
|
1614
|
+
C++, b++;
|
|
1615
|
+
for (var U = (I - C) * p + 1 >>> 0, v = new Uint8Array(U); C !== I; ) {
|
|
1616
|
+
for (var B = u[C], M = 0, F = U - 1; (B !== 0 || M < x) && F !== -1; F--, M++)
|
|
1617
|
+
B += 256 * v[F] >>> 0, v[F] = B % i >>> 0, B = B / i >>> 0;
|
|
1613
1618
|
if (B !== 0)
|
|
1614
1619
|
throw new Error("Non-zero carry");
|
|
1615
|
-
x = M,
|
|
1620
|
+
x = M, C++;
|
|
1616
1621
|
}
|
|
1617
|
-
for (var N = U - x; N !== U &&
|
|
1622
|
+
for (var N = U - x; N !== U && v[N] === 0; )
|
|
1618
1623
|
N++;
|
|
1619
|
-
for (var
|
|
1620
|
-
|
|
1621
|
-
return
|
|
1624
|
+
for (var P = c.repeat(b); N < U; ++N)
|
|
1625
|
+
P += e.charAt(v[N]);
|
|
1626
|
+
return P;
|
|
1622
1627
|
}
|
|
1623
1628
|
function h(u) {
|
|
1624
1629
|
if (typeof u != "string")
|
|
1625
1630
|
throw new TypeError("Expected String");
|
|
1626
1631
|
if (u.length === 0)
|
|
1627
1632
|
return new Uint8Array();
|
|
1628
|
-
for (var b = 0, x = 0,
|
|
1633
|
+
for (var b = 0, x = 0, C = 0; u[b] === c; )
|
|
1629
1634
|
x++, b++;
|
|
1630
|
-
for (var I = (u.length - b) *
|
|
1631
|
-
var
|
|
1632
|
-
if (
|
|
1635
|
+
for (var I = (u.length - b) * f + 1 >>> 0, U = new Uint8Array(I); u[b]; ) {
|
|
1636
|
+
var v = t[u.charCodeAt(b)];
|
|
1637
|
+
if (v === 255)
|
|
1633
1638
|
return;
|
|
1634
|
-
for (var B = 0, M = I - 1; (
|
|
1635
|
-
|
|
1636
|
-
if (
|
|
1639
|
+
for (var B = 0, M = I - 1; (v !== 0 || B < C) && M !== -1; M--, B++)
|
|
1640
|
+
v += i * U[M] >>> 0, U[M] = v % 256 >>> 0, v = v / 256 >>> 0;
|
|
1641
|
+
if (v !== 0)
|
|
1637
1642
|
throw new Error("Non-zero carry");
|
|
1638
|
-
|
|
1643
|
+
C = B, b++;
|
|
1639
1644
|
}
|
|
1640
|
-
for (var F = I -
|
|
1645
|
+
for (var F = I - C; F !== I && U[F] === 0; )
|
|
1641
1646
|
F++;
|
|
1642
|
-
for (var N = new Uint8Array(x + (I - F)),
|
|
1643
|
-
N[
|
|
1647
|
+
for (var N = new Uint8Array(x + (I - F)), P = x; F !== I; )
|
|
1648
|
+
N[P++] = U[F++];
|
|
1644
1649
|
return N;
|
|
1645
1650
|
}
|
|
1646
1651
|
function g(u) {
|
|
@@ -1655,25 +1660,25 @@ function Wr(e) {
|
|
|
1655
1660
|
decode: g
|
|
1656
1661
|
};
|
|
1657
1662
|
}
|
|
1658
|
-
var
|
|
1659
|
-
const
|
|
1660
|
-
var
|
|
1663
|
+
var Xr = Gr;
|
|
1664
|
+
const qr = Xr, Zr = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
1665
|
+
var Yr = qr(Zr), Qe = Yr, Qr = function(e) {
|
|
1661
1666
|
function t(o) {
|
|
1662
|
-
var i = Uint8Array.from(o), c = e(i),
|
|
1663
|
-
return p.set(i, 0), p.set(c.subarray(0, 4), i.length),
|
|
1667
|
+
var i = Uint8Array.from(o), c = e(i), f = i.length + 4, p = new Uint8Array(f);
|
|
1668
|
+
return p.set(i, 0), p.set(c.subarray(0, 4), i.length), Qe.encode(p, f);
|
|
1664
1669
|
}
|
|
1665
1670
|
function r(o) {
|
|
1666
|
-
var i = o.slice(0, -4), c = o.slice(-4),
|
|
1667
|
-
if (!(c[0] ^
|
|
1671
|
+
var i = o.slice(0, -4), c = o.slice(-4), f = e(i);
|
|
1672
|
+
if (!(c[0] ^ f[0] | c[1] ^ f[1] | c[2] ^ f[2] | c[3] ^ f[3]))
|
|
1668
1673
|
return i;
|
|
1669
1674
|
}
|
|
1670
1675
|
function n(o) {
|
|
1671
|
-
var i =
|
|
1676
|
+
var i = Qe.decodeUnsafe(o);
|
|
1672
1677
|
if (i)
|
|
1673
1678
|
return r(i);
|
|
1674
1679
|
}
|
|
1675
1680
|
function s(o) {
|
|
1676
|
-
var i =
|
|
1681
|
+
var i = Qe.decode(o), c = r(i);
|
|
1677
1682
|
if (!c) throw new Error("Invalid checksum");
|
|
1678
1683
|
return c;
|
|
1679
1684
|
}
|
|
@@ -1682,13 +1687,13 @@ var qr = Gr(Xr), Ze = qr, Zr = function(e) {
|
|
|
1682
1687
|
decode: s,
|
|
1683
1688
|
decodeUnsafe: n
|
|
1684
1689
|
};
|
|
1685
|
-
}, { sha256:
|
|
1686
|
-
function
|
|
1687
|
-
return
|
|
1690
|
+
}, { sha256: Ut } = ve, en = Qr;
|
|
1691
|
+
function tn(e) {
|
|
1692
|
+
return Ut(Ut(e));
|
|
1688
1693
|
}
|
|
1689
|
-
var
|
|
1690
|
-
const
|
|
1691
|
-
const t = new RegExp(`^${
|
|
1694
|
+
var rn = en(tn);
|
|
1695
|
+
const nn = /* @__PURE__ */ We(rn), rr = "automerge:", nr = (e) => {
|
|
1696
|
+
const t = new RegExp(`^${rr}(\\w+)$`), [, r] = e.match(t) || [], n = r, s = sr(n);
|
|
1692
1697
|
if (!s)
|
|
1693
1698
|
throw new Error("Invalid document URL: " + e);
|
|
1694
1699
|
return {
|
|
@@ -1697,42 +1702,42 @@ const tn = /* @__PURE__ */ ze(en), er = "automerge:", tr = (e) => {
|
|
|
1697
1702
|
/** encoded DocumentId */
|
|
1698
1703
|
documentId: n
|
|
1699
1704
|
};
|
|
1700
|
-
},
|
|
1701
|
-
if (typeof e != "string" || !e || !e.startsWith(
|
|
1705
|
+
}, sn = (e) => {
|
|
1706
|
+
if (typeof e != "string" || !e || !e.startsWith(rr))
|
|
1702
1707
|
return !1;
|
|
1703
1708
|
const t = e;
|
|
1704
1709
|
try {
|
|
1705
|
-
const { documentId: r } =
|
|
1706
|
-
return
|
|
1710
|
+
const { documentId: r } = nr(t);
|
|
1711
|
+
return on(r);
|
|
1707
1712
|
} catch {
|
|
1708
1713
|
return !1;
|
|
1709
1714
|
}
|
|
1710
|
-
},
|
|
1715
|
+
}, on = (e) => {
|
|
1711
1716
|
if (typeof e != "string")
|
|
1712
1717
|
return !1;
|
|
1713
|
-
const t =
|
|
1718
|
+
const t = sr(e);
|
|
1714
1719
|
if (t === void 0)
|
|
1715
1720
|
return !1;
|
|
1716
|
-
const r =
|
|
1717
|
-
return
|
|
1718
|
-
},
|
|
1719
|
-
let
|
|
1721
|
+
const r = kr(t);
|
|
1722
|
+
return Wt(r);
|
|
1723
|
+
}, sr = (e) => nn.decodeUnsafe(e);
|
|
1724
|
+
let ot;
|
|
1720
1725
|
try {
|
|
1721
|
-
|
|
1726
|
+
ot = new TextDecoder();
|
|
1722
1727
|
} catch {
|
|
1723
1728
|
}
|
|
1724
|
-
let O,
|
|
1725
|
-
const
|
|
1726
|
-
let D = {}, K,
|
|
1729
|
+
let O, ge, w = 0;
|
|
1730
|
+
const fn = 105, an = 57342, cn = 57343, Ft = 57337, kt = 6, we = {};
|
|
1731
|
+
let Ce = 11281e4, ce = 1681e4, D = {}, K, Ne, $e = 0, Fe = 0, G, ne, W = [], ft = [], Q, Y, Ee, jt = {
|
|
1727
1732
|
useRecords: !1,
|
|
1728
1733
|
mapsAsObjects: !0
|
|
1729
|
-
},
|
|
1734
|
+
}, ke = !1, ir = 2;
|
|
1730
1735
|
try {
|
|
1731
1736
|
new Function("");
|
|
1732
1737
|
} catch {
|
|
1733
|
-
|
|
1738
|
+
ir = 1 / 0;
|
|
1734
1739
|
}
|
|
1735
|
-
class
|
|
1740
|
+
class je {
|
|
1736
1741
|
constructor(t) {
|
|
1737
1742
|
if (t && ((t.keyMap || t._keyMap) && !t.useRecords && (t.useRecords = !1, t.mapsAsObjects = !0), t.useRecords === !1 && t.mapsAsObjects === void 0 && (t.mapsAsObjects = !0), t.getStructures && (t.getShared = t.getStructures), t.getShared && !t.structures && ((t.structures = []).uninitialized = !0), t.keyMap)) {
|
|
1738
1743
|
this.mapKey = /* @__PURE__ */ new Map();
|
|
@@ -1779,48 +1784,48 @@ class Fe {
|
|
|
1779
1784
|
}
|
|
1780
1785
|
decode(t, r) {
|
|
1781
1786
|
if (O)
|
|
1782
|
-
return
|
|
1783
|
-
|
|
1787
|
+
return cr(() => (ut(), this ? this.decode(t, r) : je.prototype.decode.call(jt, t, r)));
|
|
1788
|
+
ge = r > -1 ? r : t.length, w = 0, Fe = 0, Ne = null, G = null, O = t;
|
|
1784
1789
|
try {
|
|
1785
1790
|
Y = t.dataView || (t.dataView = new DataView(t.buffer, t.byteOffset, t.byteLength));
|
|
1786
1791
|
} catch (n) {
|
|
1787
1792
|
throw O = null, t instanceof Uint8Array ? n : new Error("Source must be a Uint8Array or Buffer but was a " + (t && typeof t == "object" ? t.constructor.name : typeof t));
|
|
1788
1793
|
}
|
|
1789
|
-
if (this instanceof
|
|
1794
|
+
if (this instanceof je) {
|
|
1790
1795
|
if (D = this, Q = this.sharedValues && (this.pack ? new Array(this.maxPrivatePackedValues || 16).concat(this.sharedValues) : this.sharedValues), this.structures)
|
|
1791
|
-
return K = this.structures,
|
|
1796
|
+
return K = this.structures, Re();
|
|
1792
1797
|
(!K || K.length > 0) && (K = []);
|
|
1793
1798
|
} else
|
|
1794
|
-
D =
|
|
1795
|
-
return
|
|
1799
|
+
D = jt, (!K || K.length > 0) && (K = []), Q = null;
|
|
1800
|
+
return Re();
|
|
1796
1801
|
}
|
|
1797
1802
|
decodeMultiple(t, r) {
|
|
1798
1803
|
let n, s = 0;
|
|
1799
1804
|
try {
|
|
1800
1805
|
let o = t.length;
|
|
1801
|
-
|
|
1802
|
-
let i = this ? this.decode(t, o) :
|
|
1806
|
+
ke = !0;
|
|
1807
|
+
let i = this ? this.decode(t, o) : Ct.decode(t, o);
|
|
1803
1808
|
if (r) {
|
|
1804
1809
|
if (r(i) === !1)
|
|
1805
1810
|
return;
|
|
1806
1811
|
for (; w < o; )
|
|
1807
|
-
if (s = w, r(
|
|
1812
|
+
if (s = w, r(Re()) === !1)
|
|
1808
1813
|
return;
|
|
1809
1814
|
} else {
|
|
1810
1815
|
for (n = [i]; w < o; )
|
|
1811
|
-
s = w, n.push(
|
|
1816
|
+
s = w, n.push(Re());
|
|
1812
1817
|
return n;
|
|
1813
1818
|
}
|
|
1814
1819
|
} catch (o) {
|
|
1815
1820
|
throw o.lastPosition = s, o.values = n, o;
|
|
1816
1821
|
} finally {
|
|
1817
|
-
|
|
1822
|
+
ke = !1, ut();
|
|
1818
1823
|
}
|
|
1819
1824
|
}
|
|
1820
1825
|
}
|
|
1821
|
-
function
|
|
1826
|
+
function Re() {
|
|
1822
1827
|
try {
|
|
1823
|
-
let e =
|
|
1828
|
+
let e = L();
|
|
1824
1829
|
if (G) {
|
|
1825
1830
|
if (w >= G.postBundlePosition) {
|
|
1826
1831
|
let t = new Error("Unexpected bundle position");
|
|
@@ -1828,19 +1833,19 @@ function ke() {
|
|
|
1828
1833
|
}
|
|
1829
1834
|
w = G.postBundlePosition, G = null;
|
|
1830
1835
|
}
|
|
1831
|
-
if (w ==
|
|
1836
|
+
if (w == ge)
|
|
1832
1837
|
K = null, O = null, ne && (ne = null);
|
|
1833
|
-
else if (w >
|
|
1838
|
+
else if (w > ge) {
|
|
1834
1839
|
let t = new Error("Unexpected end of CBOR data");
|
|
1835
1840
|
throw t.incomplete = !0, t;
|
|
1836
|
-
} else if (!
|
|
1841
|
+
} else if (!ke)
|
|
1837
1842
|
throw new Error("Data read, but end of buffer not reached");
|
|
1838
1843
|
return e;
|
|
1839
1844
|
} catch (e) {
|
|
1840
|
-
throw
|
|
1845
|
+
throw ut(), (e instanceof RangeError || e.message.startsWith("Unexpected end of buffer")) && (e.incomplete = !0), e;
|
|
1841
1846
|
}
|
|
1842
1847
|
}
|
|
1843
|
-
function
|
|
1848
|
+
function L() {
|
|
1844
1849
|
let e = O[w++], t = e >> 5;
|
|
1845
1850
|
if (e = e & 31, e > 23)
|
|
1846
1851
|
switch (e) {
|
|
@@ -1849,14 +1854,14 @@ function P() {
|
|
|
1849
1854
|
break;
|
|
1850
1855
|
case 25:
|
|
1851
1856
|
if (t == 7)
|
|
1852
|
-
return
|
|
1857
|
+
return dn();
|
|
1853
1858
|
e = Y.getUint16(w), w += 2;
|
|
1854
1859
|
break;
|
|
1855
1860
|
case 26:
|
|
1856
1861
|
if (t == 7) {
|
|
1857
1862
|
let r = Y.getFloat32(w);
|
|
1858
1863
|
if (D.useFloat32 > 2) {
|
|
1859
|
-
let n =
|
|
1864
|
+
let n = At[(O[w] & 127) << 1 | O[w + 1] >> 7];
|
|
1860
1865
|
return w += 4, (n * r + (r > 0 ? 0.5 : -0.5) >> 0) / n;
|
|
1861
1866
|
}
|
|
1862
1867
|
return w += 4, r;
|
|
@@ -1882,25 +1887,48 @@ function P() {
|
|
|
1882
1887
|
throw new Error("Indefinite length not supported for byte or text strings");
|
|
1883
1888
|
case 4:
|
|
1884
1889
|
let r = [], n, s = 0;
|
|
1885
|
-
for (; (n =
|
|
1890
|
+
for (; (n = L()) != we; ) {
|
|
1891
|
+
if (s >= Ce) throw new Error(`Array length exceeds ${Ce}`);
|
|
1886
1892
|
r[s++] = n;
|
|
1893
|
+
}
|
|
1887
1894
|
return t == 4 ? r : t == 3 ? r.join("") : Buffer.concat(r);
|
|
1888
1895
|
case 5:
|
|
1889
1896
|
let o;
|
|
1890
1897
|
if (D.mapsAsObjects) {
|
|
1891
|
-
let i = {};
|
|
1892
|
-
if (D.keyMap)
|
|
1893
|
-
|
|
1898
|
+
let i = {}, c = 0;
|
|
1899
|
+
if (D.keyMap)
|
|
1900
|
+
for (; (o = L()) != we; ) {
|
|
1901
|
+
if (c++ >= ce) throw new Error(`Property count exceeds ${ce}`);
|
|
1902
|
+
i[se(D.decodeKey(o))] = L();
|
|
1903
|
+
}
|
|
1904
|
+
else
|
|
1905
|
+
for (; (o = L()) != we; ) {
|
|
1906
|
+
if (c++ >= ce) throw new Error(`Property count exceeds ${ce}`);
|
|
1907
|
+
i[se(o)] = L();
|
|
1908
|
+
}
|
|
1894
1909
|
return i;
|
|
1895
1910
|
} else {
|
|
1896
|
-
|
|
1911
|
+
Ee && (D.mapsAsObjects = !0, Ee = !1);
|
|
1897
1912
|
let i = /* @__PURE__ */ new Map();
|
|
1898
|
-
if (D.keyMap)
|
|
1899
|
-
|
|
1913
|
+
if (D.keyMap) {
|
|
1914
|
+
let c = 0;
|
|
1915
|
+
for (; (o = L()) != we; ) {
|
|
1916
|
+
if (c++ >= ce)
|
|
1917
|
+
throw new Error(`Map size exceeds ${ce}`);
|
|
1918
|
+
i.set(D.decodeKey(o), L());
|
|
1919
|
+
}
|
|
1920
|
+
} else {
|
|
1921
|
+
let c = 0;
|
|
1922
|
+
for (; (o = L()) != we; ) {
|
|
1923
|
+
if (c++ >= ce)
|
|
1924
|
+
throw new Error(`Map size exceeds ${ce}`);
|
|
1925
|
+
i.set(o, L());
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1900
1928
|
return i;
|
|
1901
1929
|
}
|
|
1902
1930
|
case 7:
|
|
1903
|
-
return
|
|
1931
|
+
return we;
|
|
1904
1932
|
default:
|
|
1905
1933
|
throw new Error("Invalid major type for indefinite length " + t);
|
|
1906
1934
|
}
|
|
@@ -1913,74 +1941,76 @@ function P() {
|
|
|
1913
1941
|
case 1:
|
|
1914
1942
|
return ~e;
|
|
1915
1943
|
case 2:
|
|
1916
|
-
return
|
|
1944
|
+
return hn(e);
|
|
1917
1945
|
case 3:
|
|
1918
|
-
if (
|
|
1919
|
-
return
|
|
1920
|
-
if (
|
|
1921
|
-
let s = e < 16 ?
|
|
1946
|
+
if (Fe >= w)
|
|
1947
|
+
return Ne.slice(w - $e, (w += e) - $e);
|
|
1948
|
+
if (Fe == 0 && ge < 140 && e < 32) {
|
|
1949
|
+
let s = e < 16 ? or(e) : un(e);
|
|
1922
1950
|
if (s != null)
|
|
1923
1951
|
return s;
|
|
1924
1952
|
}
|
|
1925
|
-
return
|
|
1953
|
+
return ln(e);
|
|
1926
1954
|
case 4:
|
|
1955
|
+
if (e >= Ce) throw new Error(`Array length exceeds ${Ce}`);
|
|
1927
1956
|
let r = new Array(e);
|
|
1928
|
-
for (let s = 0; s < e; s++) r[s] =
|
|
1957
|
+
for (let s = 0; s < e; s++) r[s] = L();
|
|
1929
1958
|
return r;
|
|
1930
1959
|
case 5:
|
|
1960
|
+
if (e >= ce) throw new Error(`Map size exceeds ${Ce}`);
|
|
1931
1961
|
if (D.mapsAsObjects) {
|
|
1932
1962
|
let s = {};
|
|
1933
|
-
if (D.keyMap) for (let o = 0; o < e; o++) s[se(D.decodeKey(
|
|
1934
|
-
else for (let o = 0; o < e; o++) s[se(
|
|
1963
|
+
if (D.keyMap) for (let o = 0; o < e; o++) s[se(D.decodeKey(L()))] = L();
|
|
1964
|
+
else for (let o = 0; o < e; o++) s[se(L())] = L();
|
|
1935
1965
|
return s;
|
|
1936
1966
|
} else {
|
|
1937
|
-
|
|
1967
|
+
Ee && (D.mapsAsObjects = !0, Ee = !1);
|
|
1938
1968
|
let s = /* @__PURE__ */ new Map();
|
|
1939
|
-
if (D.keyMap) for (let o = 0; o < e; o++) s.set(D.decodeKey(
|
|
1940
|
-
else for (let o = 0; o < e; o++) s.set(
|
|
1969
|
+
if (D.keyMap) for (let o = 0; o < e; o++) s.set(D.decodeKey(L()), L());
|
|
1970
|
+
else for (let o = 0; o < e; o++) s.set(L(), L());
|
|
1941
1971
|
return s;
|
|
1942
1972
|
}
|
|
1943
1973
|
case 6:
|
|
1944
|
-
if (e >=
|
|
1974
|
+
if (e >= Ft) {
|
|
1945
1975
|
let s = K[e & 8191];
|
|
1946
1976
|
if (s)
|
|
1947
|
-
return s.read || (s.read =
|
|
1977
|
+
return s.read || (s.read = at(s)), s.read();
|
|
1948
1978
|
if (e < 65536) {
|
|
1949
|
-
if (e ==
|
|
1950
|
-
let o =
|
|
1951
|
-
|
|
1952
|
-
let
|
|
1979
|
+
if (e == cn) {
|
|
1980
|
+
let o = Se(), i = L(), c = L();
|
|
1981
|
+
lt(i, c);
|
|
1982
|
+
let f = {};
|
|
1953
1983
|
if (D.keyMap) for (let p = 2; p < o; p++) {
|
|
1954
1984
|
let d = D.decodeKey(c[p - 2]);
|
|
1955
|
-
|
|
1985
|
+
f[se(d)] = L();
|
|
1956
1986
|
}
|
|
1957
1987
|
else for (let p = 2; p < o; p++) {
|
|
1958
1988
|
let d = c[p - 2];
|
|
1959
|
-
|
|
1989
|
+
f[se(d)] = L();
|
|
1960
1990
|
}
|
|
1961
|
-
return
|
|
1962
|
-
} else if (e ==
|
|
1963
|
-
let o =
|
|
1991
|
+
return f;
|
|
1992
|
+
} else if (e == an) {
|
|
1993
|
+
let o = Se(), i = L();
|
|
1964
1994
|
for (let c = 2; c < o; c++)
|
|
1965
|
-
|
|
1966
|
-
return
|
|
1967
|
-
} else if (e ==
|
|
1968
|
-
return
|
|
1969
|
-
if (D.getShared && (
|
|
1970
|
-
return s.read || (s.read =
|
|
1995
|
+
lt(i++, L());
|
|
1996
|
+
return L();
|
|
1997
|
+
} else if (e == Ft)
|
|
1998
|
+
return wn();
|
|
1999
|
+
if (D.getShared && (vt(), s = K[e & 8191], s))
|
|
2000
|
+
return s.read || (s.read = at(s)), s.read();
|
|
1971
2001
|
}
|
|
1972
2002
|
}
|
|
1973
2003
|
let n = W[e];
|
|
1974
2004
|
if (n)
|
|
1975
|
-
return n.handlesRead ? n(
|
|
2005
|
+
return n.handlesRead ? n(L) : n(L());
|
|
1976
2006
|
{
|
|
1977
|
-
let s =
|
|
1978
|
-
for (let o = 0; o <
|
|
1979
|
-
let i =
|
|
2007
|
+
let s = L();
|
|
2008
|
+
for (let o = 0; o < ft.length; o++) {
|
|
2009
|
+
let i = ft[o](e, s);
|
|
1980
2010
|
if (i !== void 0)
|
|
1981
2011
|
return i;
|
|
1982
2012
|
}
|
|
1983
|
-
return new
|
|
2013
|
+
return new xe(s, e);
|
|
1984
2014
|
}
|
|
1985
2015
|
case 7:
|
|
1986
2016
|
switch (e) {
|
|
@@ -1994,7 +2024,7 @@ function P() {
|
|
|
1994
2024
|
return;
|
|
1995
2025
|
case 31:
|
|
1996
2026
|
default:
|
|
1997
|
-
let s = (Q ||
|
|
2027
|
+
let s = (Q || ye())[e];
|
|
1998
2028
|
if (s !== void 0)
|
|
1999
2029
|
return s;
|
|
2000
2030
|
throw new Error("Unknown token " + e);
|
|
@@ -2007,8 +2037,9 @@ function P() {
|
|
|
2007
2037
|
throw new Error("Unknown CBOR token " + e);
|
|
2008
2038
|
}
|
|
2009
2039
|
}
|
|
2010
|
-
const
|
|
2011
|
-
function
|
|
2040
|
+
const Mt = /^[a-zA-Z_$][a-zA-Z\d_$]*$/;
|
|
2041
|
+
function at(e) {
|
|
2042
|
+
if (!e) throw new Error("Structure is required in record definition");
|
|
2012
2043
|
function t() {
|
|
2013
2044
|
let r = O[w++];
|
|
2014
2045
|
if (r = r & 31, r > 23)
|
|
@@ -2028,17 +2059,17 @@ function ot(e) {
|
|
|
2028
2059
|
let n = this.compiledReader;
|
|
2029
2060
|
for (; n; ) {
|
|
2030
2061
|
if (n.propertyCount === r)
|
|
2031
|
-
return n(
|
|
2062
|
+
return n(L);
|
|
2032
2063
|
n = n.next;
|
|
2033
2064
|
}
|
|
2034
|
-
if (this.slowReads++ >=
|
|
2065
|
+
if (this.slowReads++ >= ir) {
|
|
2035
2066
|
let o = this.length == r ? this : this.slice(0, r);
|
|
2036
|
-
return n = D.keyMap ? new Function("r", "return {" + o.map((i) => D.decodeKey(i)).map((i) =>
|
|
2067
|
+
return n = D.keyMap ? new Function("r", "return {" + o.map((i) => D.decodeKey(i)).map((i) => Mt.test(i) ? se(i) + ":r()" : "[" + JSON.stringify(i) + "]:r()").join(",") + "}") : new Function("r", "return {" + o.map((i) => Mt.test(i) ? se(i) + ":r()" : "[" + JSON.stringify(i) + "]:r()").join(",") + "}"), this.compiledReader && (n.next = this.compiledReader), n.propertyCount = r, this.compiledReader = n, n(L);
|
|
2037
2068
|
}
|
|
2038
2069
|
let s = {};
|
|
2039
|
-
if (D.keyMap) for (let o = 0; o < r; o++) s[se(D.decodeKey(this[o]))] =
|
|
2070
|
+
if (D.keyMap) for (let o = 0; o < r; o++) s[se(D.decodeKey(this[o]))] = L();
|
|
2040
2071
|
else for (let o = 0; o < r; o++)
|
|
2041
|
-
s[se(this[o])] =
|
|
2072
|
+
s[se(this[o])] = L();
|
|
2042
2073
|
return s;
|
|
2043
2074
|
}
|
|
2044
2075
|
return e.slowReads = 0, t;
|
|
@@ -2049,13 +2080,13 @@ function se(e) {
|
|
|
2049
2080
|
if (e == null) return e + "";
|
|
2050
2081
|
throw new Error("Invalid property name type " + typeof e);
|
|
2051
2082
|
}
|
|
2052
|
-
let
|
|
2053
|
-
function
|
|
2083
|
+
let ln = ct;
|
|
2084
|
+
function ct(e) {
|
|
2054
2085
|
let t;
|
|
2055
|
-
if (e < 16 && (t =
|
|
2086
|
+
if (e < 16 && (t = or(e)))
|
|
2056
2087
|
return t;
|
|
2057
|
-
if (e > 64 &&
|
|
2058
|
-
return
|
|
2088
|
+
if (e > 64 && ot)
|
|
2089
|
+
return ot.decode(O.subarray(w, w += e));
|
|
2059
2090
|
const r = w + e, n = [];
|
|
2060
2091
|
for (t = ""; w < r; ) {
|
|
2061
2092
|
const s = O[w++];
|
|
@@ -2069,8 +2100,8 @@ function ft(e) {
|
|
|
2069
2100
|
n.push((s & 31) << 12 | o << 6 | i);
|
|
2070
2101
|
} else if ((s & 248) === 240) {
|
|
2071
2102
|
const o = O[w++] & 63, i = O[w++] & 63, c = O[w++] & 63;
|
|
2072
|
-
let
|
|
2073
|
-
|
|
2103
|
+
let f = (s & 7) << 18 | o << 12 | i << 6 | c;
|
|
2104
|
+
f > 65535 && (f -= 65536, n.push(f >>> 10 & 1023 | 55296), f = 56320 | f & 1023), n.push(f);
|
|
2074
2105
|
} else
|
|
2075
2106
|
n.push(s);
|
|
2076
2107
|
n.length >= 4096 && (t += X.apply(String, n), n.length = 0);
|
|
@@ -2078,7 +2109,7 @@ function ft(e) {
|
|
|
2078
2109
|
return n.length > 0 && (t += X.apply(String, n)), t;
|
|
2079
2110
|
}
|
|
2080
2111
|
let X = String.fromCharCode;
|
|
2081
|
-
function
|
|
2112
|
+
function un(e) {
|
|
2082
2113
|
let t = w, r = new Array(e);
|
|
2083
2114
|
for (let n = 0; n < e; n++) {
|
|
2084
2115
|
const s = O[w++];
|
|
@@ -2090,7 +2121,7 @@ function cn(e) {
|
|
|
2090
2121
|
}
|
|
2091
2122
|
return X.apply(String, r);
|
|
2092
2123
|
}
|
|
2093
|
-
function
|
|
2124
|
+
function or(e) {
|
|
2094
2125
|
if (e < 4)
|
|
2095
2126
|
if (e < 2) {
|
|
2096
2127
|
if (e === 0)
|
|
@@ -2150,21 +2181,21 @@ function sr(e) {
|
|
|
2150
2181
|
}
|
|
2151
2182
|
return X(t, r, n, s, o, i, c);
|
|
2152
2183
|
} else {
|
|
2153
|
-
let o = O[w++], i = O[w++], c = O[w++],
|
|
2154
|
-
if ((o & 128) > 0 || (i & 128) > 0 || (c & 128) > 0 || (
|
|
2184
|
+
let o = O[w++], i = O[w++], c = O[w++], f = O[w++];
|
|
2185
|
+
if ((o & 128) > 0 || (i & 128) > 0 || (c & 128) > 0 || (f & 128) > 0) {
|
|
2155
2186
|
w -= 8;
|
|
2156
2187
|
return;
|
|
2157
2188
|
}
|
|
2158
2189
|
if (e < 10) {
|
|
2159
2190
|
if (e === 8)
|
|
2160
|
-
return X(t, r, n, s, o, i, c,
|
|
2191
|
+
return X(t, r, n, s, o, i, c, f);
|
|
2161
2192
|
{
|
|
2162
2193
|
let p = O[w++];
|
|
2163
2194
|
if ((p & 128) > 0) {
|
|
2164
2195
|
w -= 9;
|
|
2165
2196
|
return;
|
|
2166
2197
|
}
|
|
2167
|
-
return X(t, r, n, s, o, i, c,
|
|
2198
|
+
return X(t, r, n, s, o, i, c, f, p);
|
|
2168
2199
|
}
|
|
2169
2200
|
} else if (e < 12) {
|
|
2170
2201
|
let p = O[w++], d = O[w++];
|
|
@@ -2173,13 +2204,13 @@ function sr(e) {
|
|
|
2173
2204
|
return;
|
|
2174
2205
|
}
|
|
2175
2206
|
if (e < 11)
|
|
2176
|
-
return X(t, r, n, s, o, i, c,
|
|
2207
|
+
return X(t, r, n, s, o, i, c, f, p, d);
|
|
2177
2208
|
let h = O[w++];
|
|
2178
2209
|
if ((h & 128) > 0) {
|
|
2179
2210
|
w -= 11;
|
|
2180
2211
|
return;
|
|
2181
2212
|
}
|
|
2182
|
-
return X(t, r, n, s, o, i, c,
|
|
2213
|
+
return X(t, r, n, s, o, i, c, f, p, d, h);
|
|
2183
2214
|
} else {
|
|
2184
2215
|
let p = O[w++], d = O[w++], h = O[w++], g = O[w++];
|
|
2185
2216
|
if ((p & 128) > 0 || (d & 128) > 0 || (h & 128) > 0 || (g & 128) > 0) {
|
|
@@ -2188,14 +2219,14 @@ function sr(e) {
|
|
|
2188
2219
|
}
|
|
2189
2220
|
if (e < 14) {
|
|
2190
2221
|
if (e === 12)
|
|
2191
|
-
return X(t, r, n, s, o, i, c,
|
|
2222
|
+
return X(t, r, n, s, o, i, c, f, p, d, h, g);
|
|
2192
2223
|
{
|
|
2193
2224
|
let u = O[w++];
|
|
2194
2225
|
if ((u & 128) > 0) {
|
|
2195
2226
|
w -= 13;
|
|
2196
2227
|
return;
|
|
2197
2228
|
}
|
|
2198
|
-
return X(t, r, n, s, o, i, c,
|
|
2229
|
+
return X(t, r, n, s, o, i, c, f, p, d, h, g, u);
|
|
2199
2230
|
}
|
|
2200
2231
|
} else {
|
|
2201
2232
|
let u = O[w++], b = O[w++];
|
|
@@ -2204,26 +2235,26 @@ function sr(e) {
|
|
|
2204
2235
|
return;
|
|
2205
2236
|
}
|
|
2206
2237
|
if (e < 15)
|
|
2207
|
-
return X(t, r, n, s, o, i, c,
|
|
2238
|
+
return X(t, r, n, s, o, i, c, f, p, d, h, g, u, b);
|
|
2208
2239
|
let x = O[w++];
|
|
2209
2240
|
if ((x & 128) > 0) {
|
|
2210
2241
|
w -= 15;
|
|
2211
2242
|
return;
|
|
2212
2243
|
}
|
|
2213
|
-
return X(t, r, n, s, o, i, c,
|
|
2244
|
+
return X(t, r, n, s, o, i, c, f, p, d, h, g, u, b, x);
|
|
2214
2245
|
}
|
|
2215
2246
|
}
|
|
2216
2247
|
}
|
|
2217
2248
|
}
|
|
2218
2249
|
}
|
|
2219
|
-
function
|
|
2250
|
+
function hn(e) {
|
|
2220
2251
|
return D.copyBuffers ? (
|
|
2221
2252
|
// specifically use the copying slice (not the node one)
|
|
2222
2253
|
Uint8Array.prototype.slice.call(O, w, w += e)
|
|
2223
2254
|
) : O.subarray(w, w += e);
|
|
2224
2255
|
}
|
|
2225
|
-
let
|
|
2226
|
-
function
|
|
2256
|
+
let fr = new Float32Array(1), Be = new Uint8Array(fr.buffer, 0, 4);
|
|
2257
|
+
function dn() {
|
|
2227
2258
|
let e = O[w++], t = O[w++], r = (e & 127) >> 2;
|
|
2228
2259
|
if (r === 31)
|
|
2229
2260
|
return t || e & 3 ? NaN : e & 128 ? -1 / 0 : 1 / 0;
|
|
@@ -2231,12 +2262,12 @@ function un() {
|
|
|
2231
2262
|
let n = ((e & 3) << 8 | t) / 16777216;
|
|
2232
2263
|
return e & 128 ? -n : n;
|
|
2233
2264
|
}
|
|
2234
|
-
return
|
|
2235
|
-
(r >> 1) + 56,
|
|
2236
|
-
t >> 3,
|
|
2265
|
+
return Be[3] = e & 128 | // sign bit
|
|
2266
|
+
(r >> 1) + 56, Be[2] = (e & 7) << 5 | // last exponent bit and first two mantissa bits
|
|
2267
|
+
t >> 3, Be[1] = t << 5, Be[0] = 0, fr[0];
|
|
2237
2268
|
}
|
|
2238
2269
|
new Array(4096);
|
|
2239
|
-
class
|
|
2270
|
+
class xe {
|
|
2240
2271
|
constructor(t, r) {
|
|
2241
2272
|
this.value = t, this.tag = r;
|
|
2242
2273
|
}
|
|
@@ -2246,20 +2277,20 @@ W[1] = (e) => new Date(Math.round(e * 1e3));
|
|
|
2246
2277
|
W[2] = (e) => {
|
|
2247
2278
|
let t = BigInt(0);
|
|
2248
2279
|
for (let r = 0, n = e.byteLength; r < n; r++)
|
|
2249
|
-
t = BigInt(e[r]) + t << BigInt(8);
|
|
2280
|
+
t = BigInt(e[r]) + (t << BigInt(8));
|
|
2250
2281
|
return t;
|
|
2251
2282
|
};
|
|
2252
2283
|
W[3] = (e) => BigInt(-1) - W[2](e);
|
|
2253
2284
|
W[4] = (e) => +(e[1] + "e" + e[0]);
|
|
2254
2285
|
W[5] = (e) => e[1] * Math.exp(e[0] * Math.log(2));
|
|
2255
|
-
const
|
|
2286
|
+
const lt = (e, t) => {
|
|
2256
2287
|
e = e - 57344;
|
|
2257
2288
|
let r = K[e];
|
|
2258
|
-
r && r.isShared && ((K.restoreStructures || (K.restoreStructures = []))[e] = r), K[e] = t, t.read =
|
|
2289
|
+
r && r.isShared && ((K.restoreStructures || (K.restoreStructures = []))[e] = r), K[e] = t, t.read = at(t);
|
|
2259
2290
|
};
|
|
2260
|
-
W[
|
|
2291
|
+
W[fn] = (e) => {
|
|
2261
2292
|
let t = e.length, r = e[1];
|
|
2262
|
-
|
|
2293
|
+
lt(e[0], r);
|
|
2263
2294
|
let n = {};
|
|
2264
2295
|
for (let s = 2; s < t; s++) {
|
|
2265
2296
|
let o = r[s - 2];
|
|
@@ -2267,11 +2298,11 @@ W[sn] = (e) => {
|
|
|
2267
2298
|
}
|
|
2268
2299
|
return n;
|
|
2269
2300
|
};
|
|
2270
|
-
W[14] = (e) => G ? G[0].slice(G.position0, G.position0 += e) : new
|
|
2271
|
-
W[15] = (e) => G ? G[1].slice(G.position1, G.position1 += e) : new
|
|
2272
|
-
let
|
|
2273
|
-
W[27] = (e) => (
|
|
2274
|
-
const
|
|
2301
|
+
W[14] = (e) => G ? G[0].slice(G.position0, G.position0 += e) : new xe(e, 14);
|
|
2302
|
+
W[15] = (e) => G ? G[1].slice(G.position1, G.position1 += e) : new xe(e, 15);
|
|
2303
|
+
let yn = { Error, RegExp };
|
|
2304
|
+
W[27] = (e) => (yn[e[0]] || Error)(e[1], e[2]);
|
|
2305
|
+
const ar = (e) => {
|
|
2275
2306
|
if (O[w++] != 132) {
|
|
2276
2307
|
let r = new Error("Packed values structure must be followed by a 4 element array");
|
|
2277
2308
|
throw O.length < w && (r.incomplete = !0), r;
|
|
@@ -2283,14 +2314,14 @@ const or = (e) => {
|
|
|
2283
2314
|
}
|
|
2284
2315
|
return Q = Q ? t.concat(Q.slice(t.length)) : t, Q.prefixes = e(), Q.suffixes = e(), e();
|
|
2285
2316
|
};
|
|
2286
|
-
|
|
2287
|
-
W[51] =
|
|
2288
|
-
W[
|
|
2317
|
+
ar.handlesRead = !0;
|
|
2318
|
+
W[51] = ar;
|
|
2319
|
+
W[kt] = (e) => {
|
|
2289
2320
|
if (!Q)
|
|
2290
2321
|
if (D.getShared)
|
|
2291
|
-
|
|
2322
|
+
vt();
|
|
2292
2323
|
else
|
|
2293
|
-
return new
|
|
2324
|
+
return new xe(e, kt);
|
|
2294
2325
|
if (typeof e == "number")
|
|
2295
2326
|
return Q[16 + (e >= 0 ? 2 * e : -2 * e - 1)];
|
|
2296
2327
|
let t = new Error("No support for non-integer packed references yet");
|
|
@@ -2311,33 +2342,33 @@ W[29] = (e) => {
|
|
|
2311
2342
|
return t.used = !0, t.target;
|
|
2312
2343
|
};
|
|
2313
2344
|
W[258] = (e) => new Set(e);
|
|
2314
|
-
(W[259] = (e) => (D.mapsAsObjects && (D.mapsAsObjects = !1,
|
|
2315
|
-
function
|
|
2345
|
+
(W[259] = (e) => (D.mapsAsObjects && (D.mapsAsObjects = !1, Ee = !0), e())).handlesRead = !0;
|
|
2346
|
+
function me(e, t) {
|
|
2316
2347
|
return typeof e == "string" ? e + t : e instanceof Array ? e.concat(t) : Object.assign({}, e, t);
|
|
2317
2348
|
}
|
|
2318
|
-
function
|
|
2349
|
+
function ye() {
|
|
2319
2350
|
if (!Q)
|
|
2320
2351
|
if (D.getShared)
|
|
2321
|
-
|
|
2352
|
+
vt();
|
|
2322
2353
|
else
|
|
2323
2354
|
throw new Error("No packed values available");
|
|
2324
2355
|
return Q;
|
|
2325
2356
|
}
|
|
2326
|
-
const
|
|
2327
|
-
|
|
2357
|
+
const pn = 1399353956;
|
|
2358
|
+
ft.push((e, t) => {
|
|
2328
2359
|
if (e >= 225 && e <= 255)
|
|
2329
|
-
return
|
|
2360
|
+
return me(ye().prefixes[e - 224], t);
|
|
2330
2361
|
if (e >= 28704 && e <= 32767)
|
|
2331
|
-
return
|
|
2362
|
+
return me(ye().prefixes[e - 28672], t);
|
|
2332
2363
|
if (e >= 1879052288 && e <= 2147483647)
|
|
2333
|
-
return
|
|
2364
|
+
return me(ye().prefixes[e - 1879048192], t);
|
|
2334
2365
|
if (e >= 216 && e <= 223)
|
|
2335
|
-
return
|
|
2366
|
+
return me(t, ye().suffixes[e - 216]);
|
|
2336
2367
|
if (e >= 27647 && e <= 28671)
|
|
2337
|
-
return
|
|
2368
|
+
return me(t, ye().suffixes[e - 27639]);
|
|
2338
2369
|
if (e >= 1811940352 && e <= 1879048191)
|
|
2339
|
-
return
|
|
2340
|
-
if (e ==
|
|
2370
|
+
return me(t, ye().suffixes[e - 1811939328]);
|
|
2371
|
+
if (e == pn)
|
|
2341
2372
|
return {
|
|
2342
2373
|
packedValues: Q,
|
|
2343
2374
|
structures: K.slice(0),
|
|
@@ -2346,7 +2377,7 @@ it.push((e, t) => {
|
|
|
2346
2377
|
if (e == 55799)
|
|
2347
2378
|
return t;
|
|
2348
2379
|
});
|
|
2349
|
-
const
|
|
2380
|
+
const bn = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1, Rt = [
|
|
2350
2381
|
Uint8Array,
|
|
2351
2382
|
Uint8ClampedArray,
|
|
2352
2383
|
Uint16Array,
|
|
@@ -2358,40 +2389,40 @@ const yn = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1, jt = [
|
|
|
2358
2389
|
typeof BigInt64Array > "u" ? { name: "BigInt64Array" } : BigInt64Array,
|
|
2359
2390
|
Float32Array,
|
|
2360
2391
|
Float64Array
|
|
2361
|
-
],
|
|
2362
|
-
for (let e = 0; e <
|
|
2363
|
-
|
|
2364
|
-
function
|
|
2392
|
+
], gn = [64, 68, 69, 70, 71, 72, 77, 78, 79, 85, 86];
|
|
2393
|
+
for (let e = 0; e < Rt.length; e++)
|
|
2394
|
+
xn(Rt[e], gn[e]);
|
|
2395
|
+
function xn(e, t) {
|
|
2365
2396
|
let r = "get" + e.name.slice(0, -5), n;
|
|
2366
2397
|
typeof e == "function" ? n = e.BYTES_PER_ELEMENT : e = null;
|
|
2367
2398
|
for (let s = 0; s < 2; s++) {
|
|
2368
2399
|
if (!s && n == 1)
|
|
2369
2400
|
continue;
|
|
2370
2401
|
let o = n == 2 ? 1 : n == 4 ? 2 : n == 8 ? 3 : 0;
|
|
2371
|
-
W[s ? t : t - 4] = n == 1 || s ==
|
|
2402
|
+
W[s ? t : t - 4] = n == 1 || s == bn ? (i) => {
|
|
2372
2403
|
if (!e)
|
|
2373
2404
|
throw new Error("Could not find typed array for code " + t);
|
|
2374
2405
|
return !D.copyBuffers && (n === 1 || n === 2 && !(i.byteOffset & 1) || n === 4 && !(i.byteOffset & 3) || n === 8 && !(i.byteOffset & 7)) ? new e(i.buffer, i.byteOffset, i.byteLength >> o) : new e(Uint8Array.prototype.slice.call(i, 0).buffer);
|
|
2375
2406
|
} : (i) => {
|
|
2376
2407
|
if (!e)
|
|
2377
2408
|
throw new Error("Could not find typed array for code " + t);
|
|
2378
|
-
let c = new DataView(i.buffer, i.byteOffset, i.byteLength),
|
|
2379
|
-
for (let h = 0; h <
|
|
2409
|
+
let c = new DataView(i.buffer, i.byteOffset, i.byteLength), f = i.length >> o, p = new e(f), d = c[r];
|
|
2410
|
+
for (let h = 0; h < f; h++)
|
|
2380
2411
|
p[h] = d.call(c, h << o, s);
|
|
2381
2412
|
return p;
|
|
2382
2413
|
};
|
|
2383
2414
|
}
|
|
2384
2415
|
}
|
|
2385
|
-
function
|
|
2386
|
-
let e =
|
|
2416
|
+
function wn() {
|
|
2417
|
+
let e = Se(), t = w + L();
|
|
2387
2418
|
for (let n = 2; n < e; n++) {
|
|
2388
|
-
let s =
|
|
2419
|
+
let s = Se();
|
|
2389
2420
|
w += s;
|
|
2390
2421
|
}
|
|
2391
2422
|
let r = w;
|
|
2392
|
-
return w = t, G = [
|
|
2423
|
+
return w = t, G = [ct(Se()), ct(Se())], G.position0 = 0, G.position1 = 0, G.postBundlePosition = w, w = r, L();
|
|
2393
2424
|
}
|
|
2394
|
-
function
|
|
2425
|
+
function Se() {
|
|
2395
2426
|
let e = O[w++] & 31;
|
|
2396
2427
|
if (e > 23)
|
|
2397
2428
|
switch (e) {
|
|
@@ -2407,44 +2438,44 @@ function me() {
|
|
|
2407
2438
|
}
|
|
2408
2439
|
return e;
|
|
2409
2440
|
}
|
|
2410
|
-
function
|
|
2441
|
+
function vt() {
|
|
2411
2442
|
if (D.getShared) {
|
|
2412
|
-
let e =
|
|
2443
|
+
let e = cr(() => (O = null, D.getShared())) || {}, t = e.structures || [];
|
|
2413
2444
|
D.sharedVersion = e.version, Q = D.sharedValues = e.packedValues, K === !0 ? D.structures = K = t : K.splice.apply(K, [0, t.length].concat(t));
|
|
2414
2445
|
}
|
|
2415
2446
|
}
|
|
2416
|
-
function
|
|
2417
|
-
let t =
|
|
2418
|
-
return
|
|
2447
|
+
function cr(e) {
|
|
2448
|
+
let t = ge, r = w, n = $e, s = Fe, o = Ne, i = ne, c = G, f = new Uint8Array(O.slice(0, ge)), p = K, d = D, h = ke, g = e();
|
|
2449
|
+
return ge = t, w = r, $e = n, Fe = s, Ne = o, ne = i, G = c, O = f, ke = h, K = p, D = d, Y = new DataView(O.buffer, O.byteOffset, O.byteLength), g;
|
|
2419
2450
|
}
|
|
2420
|
-
function
|
|
2451
|
+
function ut() {
|
|
2421
2452
|
O = null, ne = null, K = null;
|
|
2422
2453
|
}
|
|
2423
|
-
const
|
|
2454
|
+
const At = new Array(147);
|
|
2424
2455
|
for (let e = 0; e < 256; e++)
|
|
2425
|
-
|
|
2426
|
-
let
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
let
|
|
2456
|
+
At[e] = +("1e" + Math.floor(45.15 - e * 0.30103));
|
|
2457
|
+
let Ct = new je({ useRecords: !1 });
|
|
2458
|
+
Ct.decode;
|
|
2459
|
+
Ct.decodeMultiple;
|
|
2460
|
+
let Te;
|
|
2430
2461
|
try {
|
|
2431
|
-
|
|
2462
|
+
Te = new TextEncoder();
|
|
2432
2463
|
} catch {
|
|
2433
2464
|
}
|
|
2434
|
-
let
|
|
2435
|
-
const
|
|
2436
|
-
let
|
|
2437
|
-
const
|
|
2438
|
-
class
|
|
2465
|
+
let ht, lr;
|
|
2466
|
+
const Ge = typeof globalThis == "object" && globalThis.Buffer, Me = typeof Ge < "u", et = Me ? Ge.allocUnsafeSlow : Uint8Array, Bt = Me ? Ge : Uint8Array, Tt = 256, Dt = Me ? 4294967296 : 2144337920;
|
|
2467
|
+
let tt, y, H, a = 0, he, J = null;
|
|
2468
|
+
const mn = 61440, Sn = /[\u0080-\uFFFF]/, ee = Symbol("record-id");
|
|
2469
|
+
class vn extends je {
|
|
2439
2470
|
constructor(t) {
|
|
2440
2471
|
super(t), this.offset = 0;
|
|
2441
2472
|
let r, n, s, o, i;
|
|
2442
2473
|
t = t || {};
|
|
2443
|
-
let c =
|
|
2474
|
+
let c = Bt.prototype.utf8Write ? function(l, _, m) {
|
|
2444
2475
|
return y.utf8Write(l, _, m);
|
|
2445
|
-
} :
|
|
2446
|
-
return
|
|
2447
|
-
} : !1,
|
|
2476
|
+
} : Te && Te.encodeInto ? function(l, _) {
|
|
2477
|
+
return Te.encodeInto(l, y.subarray(_)).written;
|
|
2478
|
+
} : !1, f = this, p = t.structures || t.saveStructures, d = t.maxSharedStructures;
|
|
2448
2479
|
if (d == null && (d = p ? 128 : 0), d > 8190)
|
|
2449
2480
|
throw new Error("Maximum maxSharedStructure is 8190");
|
|
2450
2481
|
let h = t.sequential;
|
|
@@ -2455,7 +2486,7 @@ class mn extends Fe {
|
|
|
2455
2486
|
for (let l = 0, _ = b.length; l < _; l++)
|
|
2456
2487
|
x[b[l]] = l;
|
|
2457
2488
|
}
|
|
2458
|
-
let
|
|
2489
|
+
let C = [], I = 0, U = 0;
|
|
2459
2490
|
this.mapEncode = function(l, _) {
|
|
2460
2491
|
if (this._keyMap && !this._mapped)
|
|
2461
2492
|
switch (l.constructor.name) {
|
|
@@ -2465,89 +2496,89 @@ class mn extends Fe {
|
|
|
2465
2496
|
}
|
|
2466
2497
|
return this.encode(l, _);
|
|
2467
2498
|
}, this.encode = function(l, _) {
|
|
2468
|
-
if (y || (y = new
|
|
2499
|
+
if (y || (y = new et(8192), H = new DataView(y.buffer, 0, 8192), a = 0), he = y.length - 10, he - a < 2048 ? (y = new et(y.length), H = new DataView(y.buffer, 0, y.length), he = y.length - 10, a = 0) : _ === Vt && (a = a + 7 & 2147483640), r = a, f.useSelfDescribedHeader && (H.setUint32(a, 3654940416), a += 3), i = f.structuredClone ? /* @__PURE__ */ new Map() : null, f.bundleStrings && typeof l != "string" ? (J = [], J.size = 1 / 0) : J = null, n = f.structures, n) {
|
|
2469
2500
|
if (n.uninitialized) {
|
|
2470
|
-
let
|
|
2471
|
-
|
|
2472
|
-
let
|
|
2473
|
-
if (
|
|
2501
|
+
let A = f.getShared() || {};
|
|
2502
|
+
f.structures = n = A.structures || [], f.sharedVersion = A.version;
|
|
2503
|
+
let S = f.sharedValues = A.packedValues;
|
|
2504
|
+
if (S) {
|
|
2474
2505
|
x = {};
|
|
2475
|
-
for (let
|
|
2476
|
-
x[
|
|
2506
|
+
for (let k = 0, j = S.length; k < j; k++)
|
|
2507
|
+
x[S[k]] = k;
|
|
2477
2508
|
}
|
|
2478
2509
|
}
|
|
2479
2510
|
let m = n.length;
|
|
2480
2511
|
if (m > d && !h && (m = d), !n.transitions) {
|
|
2481
2512
|
n.transitions = /* @__PURE__ */ Object.create(null);
|
|
2482
|
-
for (let
|
|
2483
|
-
let
|
|
2484
|
-
if (!
|
|
2513
|
+
for (let A = 0; A < m; A++) {
|
|
2514
|
+
let S = n[A];
|
|
2515
|
+
if (!S)
|
|
2485
2516
|
continue;
|
|
2486
|
-
let
|
|
2487
|
-
for (let R = 0, T =
|
|
2488
|
-
|
|
2489
|
-
let V =
|
|
2490
|
-
|
|
2517
|
+
let k, j = n.transitions;
|
|
2518
|
+
for (let R = 0, T = S.length; R < T; R++) {
|
|
2519
|
+
j[ee] === void 0 && (j[ee] = A);
|
|
2520
|
+
let V = S[R];
|
|
2521
|
+
k = j[V], k || (k = j[V] = /* @__PURE__ */ Object.create(null)), j = k;
|
|
2491
2522
|
}
|
|
2492
|
-
|
|
2523
|
+
j[ee] = A | 1048576;
|
|
2493
2524
|
}
|
|
2494
2525
|
}
|
|
2495
2526
|
h || (n.nextId = m);
|
|
2496
2527
|
}
|
|
2497
2528
|
if (s && (s = !1), o = n || [], u = x, t.pack) {
|
|
2498
2529
|
let m = /* @__PURE__ */ new Map();
|
|
2499
|
-
if (m.values = [], m.encoder =
|
|
2500
|
-
y[
|
|
2501
|
-
let
|
|
2502
|
-
|
|
2503
|
-
for (let
|
|
2504
|
-
u[
|
|
2530
|
+
if (m.values = [], m.encoder = f, m.maxValues = t.maxPrivatePackedValues || (x ? 16 : 1 / 0), m.objectMap = x || !1, m.samplingPackedValues = g, De(l, m), m.values.length > 0) {
|
|
2531
|
+
y[a++] = 216, y[a++] = 51, fe(4);
|
|
2532
|
+
let A = m.values;
|
|
2533
|
+
v(A), fe(0), fe(0), u = Object.create(x || null);
|
|
2534
|
+
for (let S = 0, k = A.length; S < k; S++)
|
|
2535
|
+
u[A[S]] = S;
|
|
2505
2536
|
}
|
|
2506
2537
|
}
|
|
2507
|
-
|
|
2538
|
+
tt = _ & nt;
|
|
2508
2539
|
try {
|
|
2509
|
-
if (
|
|
2540
|
+
if (tt)
|
|
2510
2541
|
return;
|
|
2511
|
-
if (
|
|
2512
|
-
|
|
2513
|
-
let m =
|
|
2542
|
+
if (v(l), J && Lt(r, v), f.offset = a, i && i.idsToInsert) {
|
|
2543
|
+
a += i.idsToInsert.length * 2, a > he && M(a), f.offset = a;
|
|
2544
|
+
let m = En(y.subarray(r, a), i.idsToInsert);
|
|
2514
2545
|
return i = null, m;
|
|
2515
2546
|
}
|
|
2516
|
-
return _ &
|
|
2547
|
+
return _ & Vt ? (y.start = r, y.end = a, y) : y.subarray(r, a);
|
|
2517
2548
|
} finally {
|
|
2518
2549
|
if (n) {
|
|
2519
2550
|
if (U < 10 && U++, n.length > d && (n.length = d), I > 1e4)
|
|
2520
|
-
n.transitions = null, U = 0, I = 0,
|
|
2521
|
-
else if (
|
|
2522
|
-
for (let m = 0,
|
|
2523
|
-
|
|
2524
|
-
|
|
2551
|
+
n.transitions = null, U = 0, I = 0, C.length > 0 && (C = []);
|
|
2552
|
+
else if (C.length > 0 && !h) {
|
|
2553
|
+
for (let m = 0, A = C.length; m < A; m++)
|
|
2554
|
+
C[m][ee] = void 0;
|
|
2555
|
+
C = [];
|
|
2525
2556
|
}
|
|
2526
2557
|
}
|
|
2527
|
-
if (s &&
|
|
2528
|
-
|
|
2529
|
-
let m = y.subarray(r,
|
|
2530
|
-
return
|
|
2558
|
+
if (s && f.saveShared) {
|
|
2559
|
+
f.structures.length > d && (f.structures = f.structures.slice(0, d));
|
|
2560
|
+
let m = y.subarray(r, a);
|
|
2561
|
+
return f.updateSharedData() === !1 ? f.encode(l) : m;
|
|
2531
2562
|
}
|
|
2532
|
-
_ &
|
|
2563
|
+
_ & _n && (a = r);
|
|
2533
2564
|
}
|
|
2534
2565
|
}, this.findCommonStringsToPack = () => (g = /* @__PURE__ */ new Map(), x || (x = /* @__PURE__ */ Object.create(null)), (l) => {
|
|
2535
2566
|
let _ = l && l.threshold || 4, m = this.pack ? l.maxPrivatePackedValues || 16 : 0;
|
|
2536
2567
|
b || (b = this.sharedValues = []);
|
|
2537
|
-
for (let [
|
|
2538
|
-
|
|
2568
|
+
for (let [A, S] of g)
|
|
2569
|
+
S.count > _ && (x[A] = m++, b.push(A), s = !0);
|
|
2539
2570
|
for (; this.saveShared && this.updateSharedData() === !1; )
|
|
2540
2571
|
;
|
|
2541
2572
|
g = null;
|
|
2542
2573
|
});
|
|
2543
|
-
const
|
|
2544
|
-
|
|
2574
|
+
const v = (l) => {
|
|
2575
|
+
a > he && (y = M(a));
|
|
2545
2576
|
var _ = typeof l, m;
|
|
2546
2577
|
if (_ === "string") {
|
|
2547
2578
|
if (u) {
|
|
2548
|
-
let
|
|
2549
|
-
if (
|
|
2550
|
-
|
|
2579
|
+
let j = u[l];
|
|
2580
|
+
if (j >= 0) {
|
|
2581
|
+
j < 16 ? y[a++] = j + 224 : (y[a++] = 198, j & 1 ? v(15 - j >> 1) : v(j - 16 >> 1));
|
|
2551
2582
|
return;
|
|
2552
2583
|
} else if (g && !t.pack) {
|
|
2553
2584
|
let R = g.get(l);
|
|
@@ -2556,248 +2587,254 @@ class mn extends Fe {
|
|
|
2556
2587
|
});
|
|
2557
2588
|
}
|
|
2558
2589
|
}
|
|
2559
|
-
let
|
|
2560
|
-
if (J &&
|
|
2561
|
-
if ((J.size +=
|
|
2590
|
+
let A = l.length;
|
|
2591
|
+
if (J && A >= 4 && A < 1024) {
|
|
2592
|
+
if ((J.size += A) > mn) {
|
|
2562
2593
|
let R, T = (J[0] ? J[0].length * 3 + J[1].length : 0) + 10;
|
|
2563
|
-
|
|
2594
|
+
a + T > he && (y = M(a + T)), y[a++] = 217, y[a++] = 223, y[a++] = 249, y[a++] = J.position ? 132 : 130, y[a++] = 26, R = a - r, a += 4, J.position && Lt(r, v), J = ["", ""], J.size = 0, J.position = R;
|
|
2564
2595
|
}
|
|
2565
|
-
let
|
|
2566
|
-
J[
|
|
2596
|
+
let j = Sn.test(l);
|
|
2597
|
+
J[j ? 0 : 1] += l, y[a++] = j ? 206 : 207, v(A);
|
|
2567
2598
|
return;
|
|
2568
2599
|
}
|
|
2569
|
-
let
|
|
2570
|
-
|
|
2571
|
-
let
|
|
2572
|
-
if (
|
|
2573
|
-
let
|
|
2574
|
-
for (
|
|
2575
|
-
R = l.charCodeAt(
|
|
2576
|
-
m = V -
|
|
2600
|
+
let S;
|
|
2601
|
+
A < 32 ? S = 1 : A < 256 ? S = 2 : A < 65536 ? S = 3 : S = 5;
|
|
2602
|
+
let k = A * 3;
|
|
2603
|
+
if (a + k > he && (y = M(a + k)), A < 64 || !c) {
|
|
2604
|
+
let j, R, T, V = a + S;
|
|
2605
|
+
for (j = 0; j < A; j++)
|
|
2606
|
+
R = l.charCodeAt(j), R < 128 ? y[V++] = R : R < 2048 ? (y[V++] = R >> 6 | 192, y[V++] = R & 63 | 128) : (R & 64512) === 55296 && ((T = l.charCodeAt(j + 1)) & 64512) === 56320 ? (R = 65536 + ((R & 1023) << 10) + (T & 1023), j++, y[V++] = R >> 18 | 240, y[V++] = R >> 12 & 63 | 128, y[V++] = R >> 6 & 63 | 128, y[V++] = R & 63 | 128) : (y[V++] = R >> 12 | 224, y[V++] = R >> 6 & 63 | 128, y[V++] = R & 63 | 128);
|
|
2607
|
+
m = V - a - S;
|
|
2577
2608
|
} else
|
|
2578
|
-
m = c(l,
|
|
2579
|
-
m < 24 ? y[
|
|
2609
|
+
m = c(l, a + S, k);
|
|
2610
|
+
m < 24 ? y[a++] = 96 | m : m < 256 ? (S < 2 && y.copyWithin(a + 2, a + 1, a + 1 + m), y[a++] = 120, y[a++] = m) : m < 65536 ? (S < 3 && y.copyWithin(a + 3, a + 2, a + 2 + m), y[a++] = 121, y[a++] = m >> 8, y[a++] = m & 255) : (S < 5 && y.copyWithin(a + 5, a + 3, a + 3 + m), y[a++] = 122, H.setUint32(a, m), a += 4), a += m;
|
|
2580
2611
|
} else if (_ === "number")
|
|
2581
2612
|
if (!this.alwaysUseFloat && l >>> 0 === l)
|
|
2582
|
-
l < 24 ? y[
|
|
2613
|
+
l < 24 ? y[a++] = l : l < 256 ? (y[a++] = 24, y[a++] = l) : l < 65536 ? (y[a++] = 25, y[a++] = l >> 8, y[a++] = l & 255) : (y[a++] = 26, H.setUint32(a, l), a += 4);
|
|
2583
2614
|
else if (!this.alwaysUseFloat && l >> 0 === l)
|
|
2584
|
-
l >= -24 ? y[
|
|
2615
|
+
l >= -24 ? y[a++] = 31 - l : l >= -256 ? (y[a++] = 56, y[a++] = ~l) : l >= -65536 ? (y[a++] = 57, H.setUint16(a, ~l), a += 2) : (y[a++] = 58, H.setUint32(a, ~l), a += 4);
|
|
2585
2616
|
else {
|
|
2586
|
-
let
|
|
2587
|
-
if ((
|
|
2588
|
-
y[
|
|
2589
|
-
let
|
|
2590
|
-
if (
|
|
2591
|
-
(
|
|
2592
|
-
|
|
2617
|
+
let A;
|
|
2618
|
+
if ((A = this.useFloat32) > 0 && l < 4294967296 && l >= -2147483648) {
|
|
2619
|
+
y[a++] = 250, H.setFloat32(a, l);
|
|
2620
|
+
let S;
|
|
2621
|
+
if (A < 4 || // this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
|
|
2622
|
+
(S = l * At[(y[a] & 127) << 1 | y[a + 1] >> 7]) >> 0 === S) {
|
|
2623
|
+
a += 4;
|
|
2593
2624
|
return;
|
|
2594
2625
|
} else
|
|
2595
|
-
|
|
2626
|
+
a--;
|
|
2596
2627
|
}
|
|
2597
|
-
y[
|
|
2628
|
+
y[a++] = 251, H.setFloat64(a, l), a += 8;
|
|
2598
2629
|
}
|
|
2599
2630
|
else if (_ === "object")
|
|
2600
2631
|
if (!l)
|
|
2601
|
-
y[
|
|
2632
|
+
y[a++] = 246;
|
|
2602
2633
|
else {
|
|
2603
2634
|
if (i) {
|
|
2604
|
-
let
|
|
2605
|
-
if (
|
|
2606
|
-
if (y[
|
|
2607
|
-
let
|
|
2608
|
-
|
|
2635
|
+
let S = i.get(l);
|
|
2636
|
+
if (S) {
|
|
2637
|
+
if (y[a++] = 216, y[a++] = 29, y[a++] = 25, !S.references) {
|
|
2638
|
+
let k = i.idsToInsert || (i.idsToInsert = []);
|
|
2639
|
+
S.references = [], k.push(S);
|
|
2609
2640
|
}
|
|
2610
|
-
|
|
2641
|
+
S.references.push(a - r), a += 2;
|
|
2611
2642
|
return;
|
|
2612
2643
|
} else
|
|
2613
|
-
i.set(l, { offset:
|
|
2644
|
+
i.set(l, { offset: a - r });
|
|
2614
2645
|
}
|
|
2615
|
-
let
|
|
2616
|
-
if (
|
|
2646
|
+
let A = l.constructor;
|
|
2647
|
+
if (A === Object)
|
|
2617
2648
|
B(l);
|
|
2618
|
-
else if (
|
|
2619
|
-
m = l.length, m < 24 ? y[
|
|
2620
|
-
for (let
|
|
2621
|
-
|
|
2622
|
-
} else if (
|
|
2623
|
-
if ((this.mapsAsObjects ? this.useTag259ForMaps !== !1 : this.useTag259ForMaps) && (y[
|
|
2624
|
-
for (let [
|
|
2625
|
-
|
|
2649
|
+
else if (A === Array) {
|
|
2650
|
+
m = l.length, m < 24 ? y[a++] = 128 | m : fe(m);
|
|
2651
|
+
for (let S = 0; S < m; S++)
|
|
2652
|
+
v(l[S]);
|
|
2653
|
+
} else if (A === Map)
|
|
2654
|
+
if ((this.mapsAsObjects ? this.useTag259ForMaps !== !1 : this.useTag259ForMaps) && (y[a++] = 217, y[a++] = 1, y[a++] = 3), m = l.size, m < 24 ? y[a++] = 160 | m : m < 256 ? (y[a++] = 184, y[a++] = m) : m < 65536 ? (y[a++] = 185, y[a++] = m >> 8, y[a++] = m & 255) : (y[a++] = 186, H.setUint32(a, m), a += 4), f.keyMap)
|
|
2655
|
+
for (let [S, k] of l)
|
|
2656
|
+
v(f.encodeKey(S)), v(k);
|
|
2626
2657
|
else
|
|
2627
|
-
for (let [
|
|
2628
|
-
S
|
|
2658
|
+
for (let [S, k] of l)
|
|
2659
|
+
v(S), v(k);
|
|
2629
2660
|
else {
|
|
2630
|
-
for (let
|
|
2631
|
-
let
|
|
2632
|
-
if (l instanceof
|
|
2633
|
-
let R =
|
|
2634
|
-
T == null && (T = R.getTag && R.getTag.call(this, l)), T < 24 ? y[
|
|
2661
|
+
for (let S = 0, k = ht.length; S < k; S++) {
|
|
2662
|
+
let j = lr[S];
|
|
2663
|
+
if (l instanceof j) {
|
|
2664
|
+
let R = ht[S], T = R.tag;
|
|
2665
|
+
T == null && (T = R.getTag && R.getTag.call(this, l)), T < 24 ? y[a++] = 192 | T : T < 256 ? (y[a++] = 216, y[a++] = T) : T < 65536 ? (y[a++] = 217, y[a++] = T >> 8, y[a++] = T & 255) : T > -1 && (y[a++] = 218, H.setUint32(a, T), a += 4), R.encode.call(this, l, v, M);
|
|
2635
2666
|
return;
|
|
2636
2667
|
}
|
|
2637
2668
|
}
|
|
2638
2669
|
if (l[Symbol.iterator]) {
|
|
2639
|
-
if (
|
|
2640
|
-
let
|
|
2641
|
-
throw
|
|
2670
|
+
if (tt) {
|
|
2671
|
+
let S = new Error("Iterable should be serialized as iterator");
|
|
2672
|
+
throw S.iteratorNotHandled = !0, S;
|
|
2642
2673
|
}
|
|
2643
|
-
y[
|
|
2644
|
-
for (let
|
|
2645
|
-
S
|
|
2646
|
-
y[
|
|
2674
|
+
y[a++] = 159;
|
|
2675
|
+
for (let S of l)
|
|
2676
|
+
v(S);
|
|
2677
|
+
y[a++] = 255;
|
|
2647
2678
|
return;
|
|
2648
2679
|
}
|
|
2649
|
-
if (l[Symbol.asyncIterator] ||
|
|
2650
|
-
let
|
|
2651
|
-
throw
|
|
2680
|
+
if (l[Symbol.asyncIterator] || rt(l)) {
|
|
2681
|
+
let S = new Error("Iterable/blob should be serialized as iterator");
|
|
2682
|
+
throw S.iteratorNotHandled = !0, S;
|
|
2652
2683
|
}
|
|
2653
2684
|
if (this.useToJSON && l.toJSON) {
|
|
2654
|
-
const
|
|
2655
|
-
if (
|
|
2656
|
-
return S
|
|
2685
|
+
const S = l.toJSON();
|
|
2686
|
+
if (S !== l)
|
|
2687
|
+
return v(S);
|
|
2657
2688
|
}
|
|
2658
2689
|
B(l);
|
|
2659
2690
|
}
|
|
2660
2691
|
}
|
|
2661
2692
|
else if (_ === "boolean")
|
|
2662
|
-
y[
|
|
2693
|
+
y[a++] = l ? 245 : 244;
|
|
2663
2694
|
else if (_ === "bigint") {
|
|
2664
2695
|
if (l < BigInt(1) << BigInt(64) && l >= 0)
|
|
2665
|
-
y[
|
|
2696
|
+
y[a++] = 27, H.setBigUint64(a, l);
|
|
2666
2697
|
else if (l > -(BigInt(1) << BigInt(64)) && l < 0)
|
|
2667
|
-
y[
|
|
2698
|
+
y[a++] = 59, H.setBigUint64(a, -l - BigInt(1));
|
|
2668
2699
|
else if (this.largeBigIntToFloat)
|
|
2669
|
-
y[
|
|
2670
|
-
else
|
|
2671
|
-
|
|
2672
|
-
|
|
2700
|
+
y[a++] = 251, H.setFloat64(a, Number(l));
|
|
2701
|
+
else {
|
|
2702
|
+
l >= BigInt(0) ? y[a++] = 194 : (y[a++] = 195, l = BigInt(-1) - l);
|
|
2703
|
+
let A = [];
|
|
2704
|
+
for (; l; )
|
|
2705
|
+
A.push(Number(l & BigInt(255))), l >>= BigInt(8);
|
|
2706
|
+
dt(new Uint8Array(A.reverse()), M);
|
|
2707
|
+
return;
|
|
2708
|
+
}
|
|
2709
|
+
a += 8;
|
|
2673
2710
|
} else if (_ === "undefined")
|
|
2674
|
-
y[
|
|
2711
|
+
y[a++] = 247;
|
|
2675
2712
|
else
|
|
2676
2713
|
throw new Error("Unknown type: " + _);
|
|
2677
2714
|
}, B = this.useRecords === !1 ? this.variableMapSize ? (l) => {
|
|
2678
|
-
let _ = Object.keys(l), m = Object.values(l),
|
|
2679
|
-
if (
|
|
2680
|
-
for (let
|
|
2681
|
-
|
|
2715
|
+
let _ = Object.keys(l), m = Object.values(l), A = _.length;
|
|
2716
|
+
if (A < 24 ? y[a++] = 160 | A : A < 256 ? (y[a++] = 184, y[a++] = A) : A < 65536 ? (y[a++] = 185, y[a++] = A >> 8, y[a++] = A & 255) : (y[a++] = 186, H.setUint32(a, A), a += 4), f.keyMap)
|
|
2717
|
+
for (let S = 0; S < A; S++)
|
|
2718
|
+
v(f.encodeKey(_[S])), v(m[S]);
|
|
2682
2719
|
else
|
|
2683
|
-
for (let
|
|
2684
|
-
|
|
2720
|
+
for (let S = 0; S < A; S++)
|
|
2721
|
+
v(_[S]), v(m[S]);
|
|
2685
2722
|
} : (l) => {
|
|
2686
|
-
y[
|
|
2687
|
-
let _ =
|
|
2688
|
-
|
|
2723
|
+
y[a++] = 185;
|
|
2724
|
+
let _ = a - r;
|
|
2725
|
+
a += 2;
|
|
2689
2726
|
let m = 0;
|
|
2690
|
-
if (
|
|
2691
|
-
for (let
|
|
2727
|
+
if (f.keyMap)
|
|
2728
|
+
for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(f.encodeKey(A)), v(l[A]), m++);
|
|
2692
2729
|
else
|
|
2693
|
-
for (let
|
|
2730
|
+
for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(A), v(l[A]), m++);
|
|
2694
2731
|
y[_++ + r] = m >> 8, y[_ + r] = m & 255;
|
|
2695
2732
|
} : (l, _) => {
|
|
2696
|
-
let m,
|
|
2733
|
+
let m, A = o.transitions || (o.transitions = /* @__PURE__ */ Object.create(null)), S = 0, k = 0, j, R;
|
|
2697
2734
|
if (this.keyMap) {
|
|
2698
|
-
R = Object.keys(l).map((V) => this.encodeKey(V)),
|
|
2699
|
-
for (let V = 0; V <
|
|
2700
|
-
let
|
|
2701
|
-
m =
|
|
2735
|
+
R = Object.keys(l).map((V) => this.encodeKey(V)), k = R.length;
|
|
2736
|
+
for (let V = 0; V < k; V++) {
|
|
2737
|
+
let _t = R[V];
|
|
2738
|
+
m = A[_t], m || (m = A[_t] = /* @__PURE__ */ Object.create(null), S++), A = m;
|
|
2702
2739
|
}
|
|
2703
2740
|
} else
|
|
2704
|
-
for (let V in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && (m =
|
|
2705
|
-
let T =
|
|
2741
|
+
for (let V in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && (m = A[V], m || (A[ee] & 1048576 && (j = A[ee] & 65535), m = A[V] = /* @__PURE__ */ Object.create(null), S++), A = m, k++);
|
|
2742
|
+
let T = A[ee];
|
|
2706
2743
|
if (T !== void 0)
|
|
2707
|
-
T &= 65535, y[
|
|
2708
|
-
else if (R || (R =
|
|
2709
|
-
y[
|
|
2710
|
-
for (let V = 0; V <
|
|
2711
|
-
(
|
|
2712
|
-
|
|
2744
|
+
T &= 65535, y[a++] = 217, y[a++] = T >> 8 | 224, y[a++] = T & 255;
|
|
2745
|
+
else if (R || (R = A.__keys__ || (A.__keys__ = Object.keys(l))), j === void 0 ? (T = o.nextId++, T || (T = 0, o.nextId = 1), T >= Tt && (o.nextId = (T = d) + 1)) : T = j, o[T] = R, T < d) {
|
|
2746
|
+
y[a++] = 217, y[a++] = T >> 8 | 224, y[a++] = T & 255, A = o.transitions;
|
|
2747
|
+
for (let V = 0; V < k; V++)
|
|
2748
|
+
(A[ee] === void 0 || A[ee] & 1048576) && (A[ee] = T), A = A[R[V]];
|
|
2749
|
+
A[ee] = T | 1048576, s = !0;
|
|
2713
2750
|
} else {
|
|
2714
|
-
if (
|
|
2751
|
+
if (A[ee] = T, H.setUint32(a, 3655335680), a += 3, S && (I += U * S), C.length >= Tt - d && (C.shift()[ee] = void 0), C.push(A), fe(k + 2), v(57344 + T), v(R), _) return;
|
|
2715
2752
|
for (let V in l)
|
|
2716
|
-
(typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) &&
|
|
2753
|
+
(typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && v(l[V]);
|
|
2717
2754
|
return;
|
|
2718
2755
|
}
|
|
2719
|
-
if (
|
|
2756
|
+
if (k < 24 ? y[a++] = 128 | k : fe(k), !_)
|
|
2720
2757
|
for (let V in l)
|
|
2721
|
-
(typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) &&
|
|
2758
|
+
(typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && v(l[V]);
|
|
2722
2759
|
}, M = (l) => {
|
|
2723
2760
|
let _;
|
|
2724
2761
|
if (l > 16777216) {
|
|
2725
|
-
if (l - r >
|
|
2762
|
+
if (l - r > Dt)
|
|
2726
2763
|
throw new Error("Encoded buffer would be larger than maximum buffer size");
|
|
2727
2764
|
_ = Math.min(
|
|
2728
|
-
|
|
2765
|
+
Dt,
|
|
2729
2766
|
Math.round(Math.max((l - r) * (l > 67108864 ? 1.25 : 2), 4194304) / 4096) * 4096
|
|
2730
2767
|
);
|
|
2731
2768
|
} else
|
|
2732
2769
|
_ = (Math.max(l - r << 2, y.length - 1) >> 12) + 1 << 12;
|
|
2733
|
-
let m = new
|
|
2734
|
-
return
|
|
2770
|
+
let m = new et(_);
|
|
2771
|
+
return H = new DataView(m.buffer, 0, _), y.copy ? y.copy(m, 0, r, l) : m.set(y.slice(r, l)), a -= r, r = 0, he = m.length - 10, y = m;
|
|
2735
2772
|
};
|
|
2736
2773
|
let F = 100, N = 1e3;
|
|
2737
2774
|
this.encodeAsIterable = function(l, _) {
|
|
2738
|
-
return ie(l, _,
|
|
2775
|
+
return ie(l, _, P);
|
|
2739
2776
|
}, this.encodeAsAsyncIterable = function(l, _) {
|
|
2740
2777
|
return ie(l, _, E);
|
|
2741
2778
|
};
|
|
2742
|
-
function*
|
|
2743
|
-
let
|
|
2744
|
-
if (
|
|
2745
|
-
let
|
|
2746
|
-
|
|
2747
|
-
for (let
|
|
2748
|
-
let
|
|
2749
|
-
|
|
2779
|
+
function* P(l, _, m) {
|
|
2780
|
+
let A = l.constructor;
|
|
2781
|
+
if (A === Object) {
|
|
2782
|
+
let S = f.useRecords !== !1;
|
|
2783
|
+
S ? B(l, !0) : Pt(Object.keys(l).length, 160);
|
|
2784
|
+
for (let k in l) {
|
|
2785
|
+
let j = l[k];
|
|
2786
|
+
S || v(k), j && typeof j == "object" ? _[k] ? yield* P(j, _[k]) : yield* z(j, _, k) : v(j);
|
|
2750
2787
|
}
|
|
2751
|
-
} else if (
|
|
2752
|
-
let
|
|
2753
|
-
fe(
|
|
2754
|
-
for (let
|
|
2755
|
-
let
|
|
2756
|
-
|
|
2788
|
+
} else if (A === Array) {
|
|
2789
|
+
let S = l.length;
|
|
2790
|
+
fe(S);
|
|
2791
|
+
for (let k = 0; k < S; k++) {
|
|
2792
|
+
let j = l[k];
|
|
2793
|
+
j && (typeof j == "object" || a - r > F) ? _.element ? yield* P(j, _.element) : yield* z(j, _, "element") : v(j);
|
|
2757
2794
|
}
|
|
2758
|
-
} else if (l[Symbol.iterator]) {
|
|
2759
|
-
y[
|
|
2760
|
-
for (let
|
|
2761
|
-
|
|
2762
|
-
y[
|
|
2763
|
-
} else
|
|
2764
|
-
m &&
|
|
2795
|
+
} else if (l[Symbol.iterator] && !l.buffer) {
|
|
2796
|
+
y[a++] = 159;
|
|
2797
|
+
for (let S of l)
|
|
2798
|
+
S && (typeof S == "object" || a - r > F) ? _.element ? yield* P(S, _.element) : yield* z(S, _, "element") : v(S);
|
|
2799
|
+
y[a++] = 255;
|
|
2800
|
+
} else rt(l) ? (Pt(l.size, 64), yield y.subarray(r, a), yield l, $()) : l[Symbol.asyncIterator] ? (y[a++] = 159, yield y.subarray(r, a), yield l, $(), y[a++] = 255) : v(l);
|
|
2801
|
+
m && a > r ? yield y.subarray(r, a) : a - r > F && (yield y.subarray(r, a), $());
|
|
2765
2802
|
}
|
|
2766
|
-
function*
|
|
2767
|
-
let
|
|
2803
|
+
function* z(l, _, m) {
|
|
2804
|
+
let A = a - r;
|
|
2768
2805
|
try {
|
|
2769
|
-
|
|
2770
|
-
} catch (
|
|
2771
|
-
if (
|
|
2772
|
-
_[m] = {},
|
|
2773
|
-
else throw
|
|
2806
|
+
v(l), a - r > F && (yield y.subarray(r, a), $());
|
|
2807
|
+
} catch (S) {
|
|
2808
|
+
if (S.iteratorNotHandled)
|
|
2809
|
+
_[m] = {}, a = r + A, yield* P.call(this, l, _[m]);
|
|
2810
|
+
else throw S;
|
|
2774
2811
|
}
|
|
2775
2812
|
}
|
|
2776
|
-
function
|
|
2777
|
-
F = N,
|
|
2813
|
+
function $() {
|
|
2814
|
+
F = N, f.encode(null, nt);
|
|
2778
2815
|
}
|
|
2779
2816
|
function ie(l, _, m) {
|
|
2780
|
-
return _ && _.chunkThreshold ? F = N = _.chunkThreshold : F = 100, l && typeof l == "object" ? (
|
|
2817
|
+
return _ && _.chunkThreshold ? F = N = _.chunkThreshold : F = 100, l && typeof l == "object" ? (f.encode(null, nt), m(l, f.iterateProperties || (f.iterateProperties = {}), !0)) : [f.encode(l)];
|
|
2781
2818
|
}
|
|
2782
2819
|
async function* E(l, _) {
|
|
2783
|
-
for (let m of
|
|
2784
|
-
let
|
|
2785
|
-
if (
|
|
2820
|
+
for (let m of P(l, _, !0)) {
|
|
2821
|
+
let A = m.constructor;
|
|
2822
|
+
if (A === Bt || A === Uint8Array)
|
|
2786
2823
|
yield m;
|
|
2787
|
-
else if (
|
|
2788
|
-
let
|
|
2789
|
-
for (; !(
|
|
2790
|
-
yield
|
|
2824
|
+
else if (rt(m)) {
|
|
2825
|
+
let S = m.stream().getReader(), k;
|
|
2826
|
+
for (; !(k = await S.read()).done; )
|
|
2827
|
+
yield k.value;
|
|
2791
2828
|
} else if (m[Symbol.asyncIterator])
|
|
2792
|
-
for await (let
|
|
2793
|
-
|
|
2829
|
+
for await (let S of m)
|
|
2830
|
+
$(), S ? yield* E(S, _.async || (_.async = {})) : yield f.encode(S);
|
|
2794
2831
|
else
|
|
2795
2832
|
yield m;
|
|
2796
2833
|
}
|
|
2797
2834
|
}
|
|
2798
2835
|
}
|
|
2799
2836
|
useBuffer(t) {
|
|
2800
|
-
y = t,
|
|
2837
|
+
y = t, H = new DataView(y.buffer, y.byteOffset, y.byteLength), a = 0;
|
|
2801
2838
|
}
|
|
2802
2839
|
clearSharedData() {
|
|
2803
2840
|
this.structures && (this.structures = []), this.sharedValues && (this.sharedValues = void 0);
|
|
@@ -2805,33 +2842,33 @@ class mn extends Fe {
|
|
|
2805
2842
|
updateSharedData() {
|
|
2806
2843
|
let t = this.sharedVersion || 0;
|
|
2807
2844
|
this.sharedVersion = t + 1;
|
|
2808
|
-
let r = this.structures.slice(0), n = new
|
|
2845
|
+
let r = this.structures.slice(0), n = new ur(r, this.sharedValues, this.sharedVersion), s = this.saveShared(
|
|
2809
2846
|
n,
|
|
2810
2847
|
(o) => (o && o.version || 0) == t
|
|
2811
2848
|
);
|
|
2812
2849
|
return s === !1 ? (n = this.getShared() || {}, this.structures = n.structures || [], this.sharedValues = n.packedValues, this.sharedVersion = n.version, this.structures.nextId = this.structures.length) : r.forEach((o, i) => this.structures[i] = o), s;
|
|
2813
2850
|
}
|
|
2814
2851
|
}
|
|
2815
|
-
function
|
|
2816
|
-
e < 24 ? y[
|
|
2852
|
+
function Pt(e, t) {
|
|
2853
|
+
e < 24 ? y[a++] = t | e : e < 256 ? (y[a++] = t | 24, y[a++] = e) : e < 65536 ? (y[a++] = t | 25, y[a++] = e >> 8, y[a++] = e & 255) : (y[a++] = t | 26, H.setUint32(a, e), a += 4);
|
|
2817
2854
|
}
|
|
2818
|
-
class
|
|
2855
|
+
class ur {
|
|
2819
2856
|
constructor(t, r, n) {
|
|
2820
2857
|
this.structures = t, this.packedValues = r, this.version = n;
|
|
2821
2858
|
}
|
|
2822
2859
|
}
|
|
2823
2860
|
function fe(e) {
|
|
2824
|
-
e < 24 ? y[
|
|
2861
|
+
e < 24 ? y[a++] = 128 | e : e < 256 ? (y[a++] = 152, y[a++] = e) : e < 65536 ? (y[a++] = 153, y[a++] = e >> 8, y[a++] = e & 255) : (y[a++] = 154, H.setUint32(a, e), a += 4);
|
|
2825
2862
|
}
|
|
2826
|
-
const
|
|
2863
|
+
const An = typeof Blob > "u" ? function() {
|
|
2827
2864
|
} : Blob;
|
|
2828
|
-
function
|
|
2829
|
-
if (e instanceof
|
|
2865
|
+
function rt(e) {
|
|
2866
|
+
if (e instanceof An)
|
|
2830
2867
|
return !0;
|
|
2831
2868
|
let t = e[Symbol.toStringTag];
|
|
2832
2869
|
return t === "Blob" || t === "File";
|
|
2833
2870
|
}
|
|
2834
|
-
function
|
|
2871
|
+
function De(e, t) {
|
|
2835
2872
|
switch (typeof e) {
|
|
2836
2873
|
case "string":
|
|
2837
2874
|
if (e.length > 3) {
|
|
@@ -2854,24 +2891,24 @@ function Be(e, t) {
|
|
|
2854
2891
|
if (e)
|
|
2855
2892
|
if (e instanceof Array)
|
|
2856
2893
|
for (let n = 0, s = e.length; n < s; n++)
|
|
2857
|
-
|
|
2894
|
+
De(e[n], t);
|
|
2858
2895
|
else {
|
|
2859
2896
|
let n = !t.encoder.useRecords;
|
|
2860
2897
|
for (var r in e)
|
|
2861
|
-
e.hasOwnProperty(r) && (n &&
|
|
2898
|
+
e.hasOwnProperty(r) && (n && De(r, t), De(e[r], t));
|
|
2862
2899
|
}
|
|
2863
2900
|
break;
|
|
2864
2901
|
case "function":
|
|
2865
2902
|
console.log(e);
|
|
2866
2903
|
}
|
|
2867
2904
|
}
|
|
2868
|
-
const
|
|
2869
|
-
|
|
2905
|
+
const Cn = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1;
|
|
2906
|
+
lr = [
|
|
2870
2907
|
Date,
|
|
2871
2908
|
Set,
|
|
2872
2909
|
Error,
|
|
2873
2910
|
RegExp,
|
|
2874
|
-
|
|
2911
|
+
xe,
|
|
2875
2912
|
ArrayBuffer,
|
|
2876
2913
|
Uint8Array,
|
|
2877
2914
|
Uint8ClampedArray,
|
|
@@ -2886,15 +2923,15 @@ ar = [
|
|
|
2886
2923
|
} : BigInt64Array,
|
|
2887
2924
|
Float32Array,
|
|
2888
2925
|
Float64Array,
|
|
2889
|
-
|
|
2926
|
+
ur
|
|
2890
2927
|
];
|
|
2891
|
-
|
|
2928
|
+
ht = [
|
|
2892
2929
|
{
|
|
2893
2930
|
// Date
|
|
2894
2931
|
tag: 1,
|
|
2895
2932
|
encode(e, t) {
|
|
2896
2933
|
let r = e.getTime() / 1e3;
|
|
2897
|
-
(this.useTimestamp32 || e.getMilliseconds() === 0) && r >= 0 && r < 4294967296 ? (y[
|
|
2934
|
+
(this.useTimestamp32 || e.getMilliseconds() === 0) && r >= 0 && r < 4294967296 ? (y[a++] = 26, H.setUint32(a, r), a += 4) : (y[a++] = 251, H.setFloat64(a, r), a += 8);
|
|
2898
2935
|
}
|
|
2899
2936
|
},
|
|
2900
2937
|
{
|
|
@@ -2934,17 +2971,17 @@ lt = [
|
|
|
2934
2971
|
{
|
|
2935
2972
|
// ArrayBuffer
|
|
2936
2973
|
encode(e, t, r) {
|
|
2937
|
-
|
|
2974
|
+
dt(e, r);
|
|
2938
2975
|
}
|
|
2939
2976
|
},
|
|
2940
2977
|
{
|
|
2941
2978
|
// Uint8Array
|
|
2942
2979
|
getTag(e) {
|
|
2943
|
-
if (e.constructor === Uint8Array && (this.tagUint8Array ||
|
|
2980
|
+
if (e.constructor === Uint8Array && (this.tagUint8Array || Me && this.tagUint8Array !== !1))
|
|
2944
2981
|
return 64;
|
|
2945
2982
|
},
|
|
2946
2983
|
encode(e, t, r) {
|
|
2947
|
-
|
|
2984
|
+
dt(e, r);
|
|
2948
2985
|
}
|
|
2949
2986
|
},
|
|
2950
2987
|
oe(68, 1),
|
|
@@ -2961,35 +2998,35 @@ lt = [
|
|
|
2961
2998
|
encode(e, t) {
|
|
2962
2999
|
let r = e.packedValues || [], n = e.structures || [];
|
|
2963
3000
|
if (r.values.length > 0) {
|
|
2964
|
-
y[
|
|
3001
|
+
y[a++] = 216, y[a++] = 51, fe(4);
|
|
2965
3002
|
let s = r.values;
|
|
2966
3003
|
t(s), fe(0), fe(0), packedObjectMap = Object.create(sharedPackedObjectMap || null);
|
|
2967
3004
|
for (let o = 0, i = s.length; o < i; o++)
|
|
2968
3005
|
packedObjectMap[s[o]] = o;
|
|
2969
3006
|
}
|
|
2970
3007
|
if (n) {
|
|
2971
|
-
|
|
3008
|
+
H.setUint32(a, 3655335424), a += 3;
|
|
2972
3009
|
let s = n.slice(0);
|
|
2973
|
-
s.unshift(57344), s.push(new
|
|
3010
|
+
s.unshift(57344), s.push(new xe(e.version, 1399353956)), t(s);
|
|
2974
3011
|
} else
|
|
2975
|
-
t(new
|
|
3012
|
+
t(new xe(e.version, 1399353956));
|
|
2976
3013
|
}
|
|
2977
3014
|
}
|
|
2978
3015
|
];
|
|
2979
3016
|
function oe(e, t) {
|
|
2980
|
-
return !
|
|
3017
|
+
return !Cn && t > 1 && (e -= 4), {
|
|
2981
3018
|
tag: e,
|
|
2982
3019
|
encode: function(n, s) {
|
|
2983
3020
|
let o = n.byteLength, i = n.byteOffset || 0, c = n.buffer || n;
|
|
2984
|
-
s(
|
|
3021
|
+
s(Me ? Ge.from(c, i, o) : new Uint8Array(c, i, o));
|
|
2985
3022
|
}
|
|
2986
3023
|
};
|
|
2987
3024
|
}
|
|
2988
|
-
function
|
|
3025
|
+
function dt(e, t) {
|
|
2989
3026
|
let r = e.byteLength;
|
|
2990
|
-
r < 24 ? y[
|
|
3027
|
+
r < 24 ? y[a++] = 64 + r : r < 256 ? (y[a++] = 88, y[a++] = r) : r < 65536 ? (y[a++] = 89, y[a++] = r >> 8, y[a++] = r & 255) : (y[a++] = 90, H.setUint32(a, r), a += 4), a + r >= y.length && t(a + r), y.set(e.buffer ? e : new Uint8Array(e), a), a += r;
|
|
2991
3028
|
}
|
|
2992
|
-
function
|
|
3029
|
+
function En(e, t) {
|
|
2993
3030
|
let r, n = t.length * 2, s = e.length - n;
|
|
2994
3031
|
t.sort((o, i) => o.offset > i.offset ? 1 : -1);
|
|
2995
3032
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -3006,17 +3043,17 @@ function An(e, t) {
|
|
|
3006
3043
|
}
|
|
3007
3044
|
return e;
|
|
3008
3045
|
}
|
|
3009
|
-
function
|
|
3010
|
-
|
|
3046
|
+
function Lt(e, t) {
|
|
3047
|
+
H.setUint32(J.position + e, a - J.position - e + 1);
|
|
3011
3048
|
let r = J;
|
|
3012
3049
|
J = null, t(r[0]), t(r[1]);
|
|
3013
3050
|
}
|
|
3014
|
-
let
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
const
|
|
3019
|
-
var
|
|
3051
|
+
let Et = new vn({ useRecords: !1 });
|
|
3052
|
+
Et.encode;
|
|
3053
|
+
Et.encodeAsIterable;
|
|
3054
|
+
Et.encodeAsAsyncIterable;
|
|
3055
|
+
const Vt = 512, _n = 1024, nt = 2048;
|
|
3056
|
+
var On = { exports: {} };
|
|
3020
3057
|
(function(e) {
|
|
3021
3058
|
(function(t, r) {
|
|
3022
3059
|
var n = {};
|
|
@@ -3025,7 +3062,7 @@ var En = { exports: {} };
|
|
|
3025
3062
|
for (var o in n)
|
|
3026
3063
|
s[o] = n[o];
|
|
3027
3064
|
e.exports = s;
|
|
3028
|
-
})(
|
|
3065
|
+
})(Mr, function(t) {
|
|
3029
3066
|
t.__esModule = !0, t.digestLength = 32, t.blockSize = 64;
|
|
3030
3067
|
var r = new Uint32Array([
|
|
3031
3068
|
1116352408,
|
|
@@ -3093,15 +3130,15 @@ var En = { exports: {} };
|
|
|
3093
3130
|
3204031479,
|
|
3094
3131
|
3329325298
|
|
3095
3132
|
]);
|
|
3096
|
-
function n(g, u, b, x,
|
|
3097
|
-
for (var I, U,
|
|
3098
|
-
for (I = u[0], U = u[1],
|
|
3099
|
-
ie = x +
|
|
3100
|
-
for (
|
|
3101
|
-
|
|
3102
|
-
for (
|
|
3103
|
-
E = (((M >>> 6 | M << 26) ^ (M >>> 11 | M << 21) ^ (M >>> 25 | M << 7)) + (M & F ^ ~M & N) | 0) + (
|
|
3104
|
-
u[0] += I, u[1] += U, u[2] +=
|
|
3133
|
+
function n(g, u, b, x, C) {
|
|
3134
|
+
for (var I, U, v, B, M, F, N, P, z, $, ie, E, l; C >= 64; ) {
|
|
3135
|
+
for (I = u[0], U = u[1], v = u[2], B = u[3], M = u[4], F = u[5], N = u[6], P = u[7], $ = 0; $ < 16; $++)
|
|
3136
|
+
ie = x + $ * 4, g[$] = (b[ie] & 255) << 24 | (b[ie + 1] & 255) << 16 | (b[ie + 2] & 255) << 8 | b[ie + 3] & 255;
|
|
3137
|
+
for ($ = 16; $ < 64; $++)
|
|
3138
|
+
z = g[$ - 2], E = (z >>> 17 | z << 15) ^ (z >>> 19 | z << 13) ^ z >>> 10, z = g[$ - 15], l = (z >>> 7 | z << 25) ^ (z >>> 18 | z << 14) ^ z >>> 3, g[$] = (E + g[$ - 7] | 0) + (l + g[$ - 16] | 0);
|
|
3139
|
+
for ($ = 0; $ < 64; $++)
|
|
3140
|
+
E = (((M >>> 6 | M << 26) ^ (M >>> 11 | M << 21) ^ (M >>> 25 | M << 7)) + (M & F ^ ~M & N) | 0) + (P + (r[$] + g[$] | 0) | 0) | 0, l = ((I >>> 2 | I << 30) ^ (I >>> 13 | I << 19) ^ (I >>> 22 | I << 10)) + (I & U ^ I & v ^ U & v) | 0, P = N, N = F, F = M, M = B + E | 0, B = v, v = U, U = I, I = E + l | 0;
|
|
3141
|
+
u[0] += I, u[1] += U, u[2] += v, u[3] += B, u[4] += M, u[5] += F, u[6] += N, u[7] += P, x += 64, C -= 64;
|
|
3105
3142
|
}
|
|
3106
3143
|
return x;
|
|
3107
3144
|
}
|
|
@@ -3133,14 +3170,14 @@ var En = { exports: {} };
|
|
|
3133
3170
|
return this;
|
|
3134
3171
|
}, g.prototype.finish = function(u) {
|
|
3135
3172
|
if (!this.finished) {
|
|
3136
|
-
var b = this.bytesHashed, x = this.bufferLength,
|
|
3173
|
+
var b = this.bytesHashed, x = this.bufferLength, C = b / 536870912 | 0, I = b << 3, U = b % 64 < 56 ? 64 : 128;
|
|
3137
3174
|
this.buffer[x] = 128;
|
|
3138
|
-
for (var
|
|
3139
|
-
this.buffer[
|
|
3140
|
-
this.buffer[U - 8] =
|
|
3175
|
+
for (var v = x + 1; v < U - 8; v++)
|
|
3176
|
+
this.buffer[v] = 0;
|
|
3177
|
+
this.buffer[U - 8] = C >>> 24 & 255, this.buffer[U - 7] = C >>> 16 & 255, this.buffer[U - 6] = C >>> 8 & 255, this.buffer[U - 5] = C >>> 0 & 255, this.buffer[U - 4] = I >>> 24 & 255, this.buffer[U - 3] = I >>> 16 & 255, this.buffer[U - 2] = I >>> 8 & 255, this.buffer[U - 1] = I >>> 0 & 255, n(this.temp, this.state, this.buffer, 0, U), this.finished = !0;
|
|
3141
3178
|
}
|
|
3142
|
-
for (var
|
|
3143
|
-
u[
|
|
3179
|
+
for (var v = 0; v < 8; v++)
|
|
3180
|
+
u[v * 4 + 0] = this.state[v] >>> 24 & 255, u[v * 4 + 1] = this.state[v] >>> 16 & 255, u[v * 4 + 2] = this.state[v] >>> 8 & 255, u[v * 4 + 3] = this.state[v] >>> 0 & 255;
|
|
3144
3181
|
return this;
|
|
3145
3182
|
}, g.prototype.digest = function() {
|
|
3146
3183
|
var u = new Uint8Array(this.digestLength);
|
|
@@ -3203,73 +3240,73 @@ var En = { exports: {} };
|
|
|
3203
3240
|
return b.clean(), x;
|
|
3204
3241
|
}
|
|
3205
3242
|
t.hmac = c;
|
|
3206
|
-
function
|
|
3207
|
-
var
|
|
3208
|
-
if (
|
|
3243
|
+
function f(g, u, b, x) {
|
|
3244
|
+
var C = x[0];
|
|
3245
|
+
if (C === 0)
|
|
3209
3246
|
throw new Error("hkdf: cannot expand more");
|
|
3210
|
-
u.reset(),
|
|
3247
|
+
u.reset(), C > 1 && u.update(g), b && u.update(b), u.update(x), u.finish(g), x[0]++;
|
|
3211
3248
|
}
|
|
3212
3249
|
var p = new Uint8Array(t.digestLength);
|
|
3213
3250
|
function d(g, u, b, x) {
|
|
3214
3251
|
u === void 0 && (u = p), x === void 0 && (x = 32);
|
|
3215
|
-
for (var
|
|
3216
|
-
B ===
|
|
3217
|
-
return U.clean(),
|
|
3252
|
+
for (var C = new Uint8Array([1]), I = c(u, g), U = new o(I), v = new Uint8Array(U.digestLength), B = v.length, M = new Uint8Array(x), F = 0; F < x; F++)
|
|
3253
|
+
B === v.length && (f(v, U, b, C), B = 0), M[F] = v[B++];
|
|
3254
|
+
return U.clean(), v.fill(0), C.fill(0), M;
|
|
3218
3255
|
}
|
|
3219
3256
|
t.hkdf = d;
|
|
3220
3257
|
function h(g, u, b, x) {
|
|
3221
|
-
for (var
|
|
3258
|
+
for (var C = new o(g), I = C.digestLength, U = new Uint8Array(4), v = new Uint8Array(I), B = new Uint8Array(I), M = new Uint8Array(x), F = 0; F * I < x; F++) {
|
|
3222
3259
|
var N = F + 1;
|
|
3223
|
-
U[0] = N >>> 24 & 255, U[1] = N >>> 16 & 255, U[2] = N >>> 8 & 255, U[3] = N >>> 0 & 255,
|
|
3224
|
-
for (var
|
|
3225
|
-
|
|
3226
|
-
for (var
|
|
3227
|
-
|
|
3228
|
-
for (var
|
|
3229
|
-
|
|
3260
|
+
U[0] = N >>> 24 & 255, U[1] = N >>> 16 & 255, U[2] = N >>> 8 & 255, U[3] = N >>> 0 & 255, C.reset(), C.update(u), C.update(U), C.finish(B);
|
|
3261
|
+
for (var P = 0; P < I; P++)
|
|
3262
|
+
v[P] = B[P];
|
|
3263
|
+
for (var P = 2; P <= b; P++) {
|
|
3264
|
+
C.reset(), C.update(B).finish(B);
|
|
3265
|
+
for (var z = 0; z < I; z++)
|
|
3266
|
+
v[z] ^= B[z];
|
|
3230
3267
|
}
|
|
3231
|
-
for (var
|
|
3232
|
-
M[F * I +
|
|
3268
|
+
for (var P = 0; P < I && F * I + P < x; P++)
|
|
3269
|
+
M[F * I + P] = v[P];
|
|
3233
3270
|
}
|
|
3234
3271
|
for (var F = 0; F < I; F++)
|
|
3235
|
-
|
|
3272
|
+
v[F] = B[F] = 0;
|
|
3236
3273
|
for (var F = 0; F < 4; F++)
|
|
3237
3274
|
U[F] = 0;
|
|
3238
|
-
return
|
|
3275
|
+
return C.clean(), M;
|
|
3239
3276
|
}
|
|
3240
3277
|
t.pbkdf2 = h;
|
|
3241
3278
|
});
|
|
3242
|
-
})(
|
|
3243
|
-
|
|
3244
|
-
const
|
|
3245
|
-
const [t, r] =
|
|
3279
|
+
})(On);
|
|
3280
|
+
Pr("automerge-repo:collectionsync");
|
|
3281
|
+
const Mn = (e) => {
|
|
3282
|
+
const [t, r] = $t({}), n = bt(), s = br(
|
|
3246
3283
|
() => e?.map((i) => {
|
|
3247
|
-
if (
|
|
3248
|
-
const { documentId: c } =
|
|
3284
|
+
if (sn(i)) {
|
|
3285
|
+
const { documentId: c } = nr(i);
|
|
3249
3286
|
return c;
|
|
3250
3287
|
} else
|
|
3251
3288
|
return i;
|
|
3252
3289
|
}) ?? [],
|
|
3253
3290
|
[e]
|
|
3254
|
-
), o =
|
|
3255
|
-
return
|
|
3291
|
+
), o = Nt([]);
|
|
3292
|
+
return _e(() => {
|
|
3256
3293
|
const i = {}, c = (u, b) => {
|
|
3257
3294
|
b && r((x) => ({ ...x, [u]: b }));
|
|
3258
|
-
},
|
|
3295
|
+
}, f = (u) => {
|
|
3259
3296
|
const b = u.documentId, x = {
|
|
3260
|
-
change: ({ doc:
|
|
3297
|
+
change: ({ doc: C }) => c(b, C),
|
|
3261
3298
|
delete: () => p(b)
|
|
3262
3299
|
};
|
|
3263
3300
|
u.on("change", x.change), u.on("delete", x.delete), i[b] = x;
|
|
3264
3301
|
}, p = (u) => {
|
|
3265
3302
|
r((b) => {
|
|
3266
|
-
const { [u]: x, ...
|
|
3267
|
-
return
|
|
3303
|
+
const { [u]: x, ...C } = b;
|
|
3304
|
+
return C;
|
|
3268
3305
|
});
|
|
3269
3306
|
}, d = (u) => {
|
|
3270
3307
|
const b = n.find(u);
|
|
3271
|
-
b.docSync() ? (c(u, b.docSync()),
|
|
3272
|
-
c(u, x),
|
|
3308
|
+
b.docSync() ? (c(u, b.docSync()), f(b)) : b.doc().then((x) => {
|
|
3309
|
+
c(u, x), f(b);
|
|
3273
3310
|
}).catch((x) => {
|
|
3274
3311
|
console.error(`Error loading document ${u} in useDocuments: `, x);
|
|
3275
3312
|
});
|
|
@@ -3283,45 +3320,45 @@ const jn = (e) => {
|
|
|
3283
3320
|
return h;
|
|
3284
3321
|
for (const u of s) {
|
|
3285
3322
|
const b = n.find(u);
|
|
3286
|
-
o.current.includes(u) ?
|
|
3323
|
+
o.current.includes(u) ? f(b) : d(u);
|
|
3287
3324
|
}
|
|
3288
3325
|
return o.current.filter((u) => !s.includes(u)).forEach(p), o.current = s, h;
|
|
3289
3326
|
}, [s, n]), t;
|
|
3290
3327
|
};
|
|
3291
|
-
function
|
|
3292
|
-
const t =
|
|
3328
|
+
function Rn(e) {
|
|
3329
|
+
const t = bt();
|
|
3293
3330
|
return e ? t.find(e) : void 0;
|
|
3294
3331
|
}
|
|
3295
|
-
var
|
|
3332
|
+
var st = hr, In = function(e) {
|
|
3296
3333
|
return typeof e == "function";
|
|
3297
|
-
},
|
|
3298
|
-
var t =
|
|
3299
|
-
s.current =
|
|
3334
|
+
}, Un = function(e) {
|
|
3335
|
+
var t = st.useState(e), r = t[0], n = t[1], s = st.useRef(r), o = st.useCallback(function(i) {
|
|
3336
|
+
s.current = In(i) ? i(s.current) : i, n(s.current);
|
|
3300
3337
|
}, []);
|
|
3301
3338
|
return [r, o, s];
|
|
3302
|
-
},
|
|
3303
|
-
const
|
|
3339
|
+
}, Fn = Un;
|
|
3340
|
+
const yt = /* @__PURE__ */ We(Fn), pt = new Vr(), Bn = ({
|
|
3304
3341
|
handle: e,
|
|
3305
3342
|
localUserId: t,
|
|
3306
3343
|
offlineTimeout: r = 3e4,
|
|
3307
3344
|
getTime: n = () => (/* @__PURE__ */ new Date()).getTime()
|
|
3308
3345
|
}) => {
|
|
3309
|
-
const [s, o, i] =
|
|
3310
|
-
return
|
|
3346
|
+
const [s, o, i] = yt({}), [c, f, p] = yt({});
|
|
3347
|
+
return _e(() => {
|
|
3311
3348
|
const d = (u) => {
|
|
3312
3349
|
const [b, x] = u.message;
|
|
3313
|
-
b !== t && (p.current[b] ||
|
|
3350
|
+
b !== t && (p.current[b] || pt.emit("new_peer", u), o({
|
|
3314
3351
|
...i.current,
|
|
3315
3352
|
[b]: x
|
|
3316
|
-
}),
|
|
3353
|
+
}), f({
|
|
3317
3354
|
...p.current,
|
|
3318
3355
|
[b]: n()
|
|
3319
3356
|
}));
|
|
3320
3357
|
}, h = () => {
|
|
3321
3358
|
const u = i.current, b = p.current, x = n();
|
|
3322
|
-
for (const
|
|
3323
|
-
x - b[
|
|
3324
|
-
o(u),
|
|
3359
|
+
for (const C in b)
|
|
3360
|
+
x - b[C] > r && (delete u[C], delete b[C]);
|
|
3361
|
+
o(u), f(b);
|
|
3325
3362
|
};
|
|
3326
3363
|
e.on("ephemeral-message", d);
|
|
3327
3364
|
const g = setInterval(
|
|
@@ -3332,43 +3369,43 @@ const ut = /* @__PURE__ */ ze(In), ht = new Lr(), Mn = ({
|
|
|
3332
3369
|
e.removeListener("ephemeral-message", d), clearInterval(g);
|
|
3333
3370
|
};
|
|
3334
3371
|
}, [e, t, r, n]), [s, c];
|
|
3335
|
-
},
|
|
3372
|
+
}, Tn = ({
|
|
3336
3373
|
handle: e,
|
|
3337
3374
|
userId: t,
|
|
3338
3375
|
initialState: r,
|
|
3339
3376
|
heartbeatTime: n = 15e3
|
|
3340
3377
|
}) => {
|
|
3341
|
-
const [s, o, i] =
|
|
3342
|
-
const p = typeof
|
|
3378
|
+
const [s, o, i] = yt(r), c = (f) => {
|
|
3379
|
+
const p = typeof f == "function" ? f(i.current) : f;
|
|
3343
3380
|
o(p), e.broadcast([t, p]);
|
|
3344
3381
|
};
|
|
3345
|
-
return
|
|
3382
|
+
return _e(() => {
|
|
3346
3383
|
if (!t)
|
|
3347
3384
|
return;
|
|
3348
|
-
const
|
|
3349
|
-
|
|
3350
|
-
const p = setInterval(
|
|
3385
|
+
const f = () => void e.broadcast([t, i.current]);
|
|
3386
|
+
f();
|
|
3387
|
+
const p = setInterval(f, n);
|
|
3351
3388
|
return () => void clearInterval(p);
|
|
3352
|
-
}, [e, t, n]),
|
|
3353
|
-
let
|
|
3354
|
-
const p =
|
|
3355
|
-
|
|
3389
|
+
}, [e, t, n]), _e(() => {
|
|
3390
|
+
let f;
|
|
3391
|
+
const p = pt.on("new_peer", () => {
|
|
3392
|
+
f = setTimeout(
|
|
3356
3393
|
() => e.broadcast([t, i.current]),
|
|
3357
3394
|
500
|
|
3358
3395
|
// Wait for the peer to be ready
|
|
3359
3396
|
);
|
|
3360
3397
|
});
|
|
3361
3398
|
return () => {
|
|
3362
|
-
p.off("new_peer"),
|
|
3399
|
+
p.off("new_peer"), f && clearTimeout(f);
|
|
3363
3400
|
};
|
|
3364
|
-
}, [e, t,
|
|
3401
|
+
}, [e, t, pt]), [s, c];
|
|
3365
3402
|
};
|
|
3366
3403
|
export {
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3404
|
+
gr as RepoContext,
|
|
3405
|
+
jn as useDocument,
|
|
3406
|
+
Mn as useDocuments,
|
|
3407
|
+
Rn as useHandle,
|
|
3408
|
+
Tn as useLocalAwareness,
|
|
3409
|
+
Bn as useRemoteAwareness,
|
|
3410
|
+
bt as useRepo
|
|
3374
3411
|
};
|