@automerge/automerge-repo-react-hooks 2.0.0-alpha.6 → 2.0.0-alpha.7

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 CHANGED
@@ -8,19 +8,19 @@ function bt() {
8
8
  function jn(e) {
9
9
  const t = bt(), r = e ? t.find(e) : null, n = Nt(r);
10
10
  r !== n.current && (n.current = r);
11
- const [, s] = $t(0), o = () => s((c) => c + 1);
11
+ const [, i] = $t(0), o = () => i((f) => f + 1);
12
12
  _e(() => !e || !r ? void 0 : (n.current = r, r.doc().then(() => {
13
13
  o();
14
- }).catch((f) => console.error(f)), r.on("change", o), r.on("delete", o), () => {
14
+ }).catch((a) => console.error(a)), 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 = pr(
18
- (c, f) => {
19
- r && r.change(c, f);
17
+ const s = pr(
18
+ (f, a) => {
19
+ r && r.change(f, a);
20
20
  },
21
21
  [r]
22
22
  );
23
- return [r?.docSync(), i];
23
+ return [r?.docSync(), s];
24
24
  }
25
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
26
  class be {
@@ -215,8 +215,8 @@ class vr {
215
215
  }
216
216
  }
217
217
  class Ar extends vr {
218
- constructor(t, r, n, s, o) {
219
- super(t), this.context = r, this.path = n, this.objectId = s, this.key = o;
218
+ constructor(t, r, n, i, o) {
219
+ super(t), this.context = r, this.path = n, this.objectId = i, this.key = o;
220
220
  }
221
221
  /**
222
222
  * Increases the value of the counter by `delta`. If `delta` is not given,
@@ -233,8 +233,8 @@ class Ar extends vr {
233
233
  return this.increment(typeof t == "number" ? -t : -1);
234
234
  }
235
235
  }
236
- function Cr(e, t, r, n, s) {
237
- return new Ar(e, t, r, n, s);
236
+ function Cr(e, t, r, n, i) {
237
+ return new Ar(e, t, r, n, i);
238
238
  }
239
239
  class Er {
240
240
  constructor(t) {
@@ -258,47 +258,47 @@ function ae(e) {
258
258
  return e;
259
259
  }
260
260
  function re(e, t) {
261
- const { context: r, objectId: n, path: s, textV2: o } = e, i = r.getWithType(n, t);
262
- if (i === null)
261
+ const { context: r, objectId: n, path: i, textV2: o } = e, s = r.getWithType(n, t);
262
+ if (s === null)
263
263
  return;
264
- const c = i[0], f = i[1];
265
- switch (c) {
264
+ const f = s[0], a = s[1];
265
+ switch (f) {
266
266
  case void 0:
267
267
  return;
268
268
  case "map":
269
- return He(r, f, o, [...s, t]);
269
+ return He(r, a, o, [...i, t]);
270
270
  case "list":
271
- return Ke(r, f, o, [...s, t]);
271
+ return Ke(r, a, o, [...i, t]);
272
272
  case "text":
273
- return o ? r.text(f) : Ue(r, f, [
274
- ...s,
273
+ return o ? r.text(a) : Ue(r, a, [
274
+ ...i,
275
275
  t
276
276
  ]);
277
277
  case "str":
278
- return f;
278
+ return a;
279
279
  case "uint":
280
- return f;
280
+ return a;
281
281
  case "int":
282
- return f;
282
+ return a;
283
283
  case "f64":
284
- return f;
284
+ return a;
285
285
  case "boolean":
286
- return f;
286
+ return a;
287
287
  case "null":
288
288
  return null;
289
289
  case "bytes":
290
- return f;
290
+ return a;
291
291
  case "timestamp":
292
- return f;
292
+ return a;
293
293
  case "counter":
294
- return Cr(f, r, s, n, t);
294
+ return Cr(a, r, i, n, t);
295
295
  default:
296
- throw RangeError(`datatype ${c} unimplemented`);
296
+ throw RangeError(`datatype ${f} unimplemented`);
297
297
  }
298
298
  }
299
299
  function Pe(e, t, r, n) {
300
- const s = typeof e;
301
- switch (s) {
300
+ const i = typeof e;
301
+ switch (i) {
302
302
  case "object":
303
303
  if (e == null)
304
304
  return [null, "null"];
@@ -338,9 +338,9 @@ function Pe(e, t, r, n) {
338
338
  ].join(""));
339
339
  default:
340
340
  throw new RangeError([
341
- `Cannot assign ${s} value at ${Ot(r)}. `,
341
+ `Cannot assign ${i} value at ${Ot(r)}. `,
342
342
  "All JSON primitive datatypes (object, array, string, number, boolean, null) ",
343
- `are supported in an Automerge document; ${s} values are not. `
343
+ `are supported in an Automerge document; ${i} values are not. `
344
344
  ].join(""));
345
345
  }
346
346
  }
@@ -350,43 +350,43 @@ function ze(e, t) {
350
350
  }
351
351
  const _r = {
352
352
  get(e, t) {
353
- const { context: r, objectId: n, cache: s } = e;
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]);
353
+ const { context: r, objectId: n, cache: i } = e;
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 } : (i[t] || (i[t] = re(e, t)), i[t]);
355
355
  },
356
356
  set(e, t, r) {
357
- const { context: n, objectId: s, path: o, textV2: i } = e;
357
+ const { context: n, objectId: i, path: o, textV2: s } = e;
358
358
  if (e.cache = {}, ze(r, n))
359
359
  throw new RangeError("Cannot create a reference to an existing document object");
360
360
  if (t === Oe)
361
361
  return e.trace = r, !0;
362
362
  if (t === zt)
363
363
  return !0;
364
- const [c, f] = Pe(r, i, [...o, t], n);
365
- switch (f) {
364
+ const [f, a] = Pe(r, s, [...o, t], n);
365
+ switch (a) {
366
366
  case "list": {
367
- const p = n.putObject(s, t, []), d = Ke(n, p, i, [...o, t]);
368
- for (let h = 0; h < c.length; h++)
369
- d[h] = c[h];
367
+ const p = n.putObject(i, t, []), d = Ke(n, p, s, [...o, t]);
368
+ for (let h = 0; h < f.length; h++)
369
+ d[h] = f[h];
370
370
  break;
371
371
  }
372
372
  case "text": {
373
- if (i)
374
- Le(c), n.putObject(s, t, c);
373
+ if (s)
374
+ Le(f), n.putObject(i, t, f);
375
375
  else {
376
- wt(c);
377
- const p = n.putObject(s, t, "");
378
- Ue(n, p, [...o, t]).splice(0, 0, ...c);
376
+ wt(f);
377
+ const p = n.putObject(i, t, "");
378
+ Ue(n, p, [...o, t]).splice(0, 0, ...f);
379
379
  }
380
380
  break;
381
381
  }
382
382
  case "map": {
383
- const p = n.putObject(s, t, {}), d = He(n, p, i, [...o, t]);
384
- for (const h in c)
385
- d[h] = c[h];
383
+ const p = n.putObject(i, t, {}), d = He(n, p, s, [...o, t]);
384
+ for (const h in f)
385
+ d[h] = f[h];
386
386
  break;
387
387
  }
388
388
  default:
389
- n.put(s, t, c, f);
389
+ n.put(i, t, f, a);
390
390
  }
391
391
  return !0;
392
392
  },
@@ -413,10 +413,10 @@ const _r = {
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 === 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];
416
+ return t = ae(t), t === Symbol.hasInstance ? (i) => Array.isArray(i) : 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
- const { context: n, objectId: s, path: o, textV2: i } = e;
419
+ const { context: n, objectId: i, path: o, textV2: s } = e;
420
420
  if (t = ae(t), ze(r, n))
421
421
  throw new RangeError("Cannot create a reference to an existing document object");
422
422
  if (t === zt)
@@ -425,40 +425,40 @@ const _r = {
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, f] = Pe(r, i, [...o, t], n);
429
- switch (f) {
428
+ const [f, a] = Pe(r, s, [...o, t], n);
429
+ switch (a) {
430
430
  case "list": {
431
431
  let p;
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);
432
+ t >= n.length(i) ? p = n.insertObject(i, t, []) : p = n.putObject(i, t, []), Ke(n, p, s, [...o, t]).splice(0, 0, ...f);
433
433
  break;
434
434
  }
435
435
  case "text": {
436
- if (i)
437
- Le(c), t >= n.length(s) ? n.insertObject(s, t, c) : n.putObject(s, t, c);
436
+ if (s)
437
+ Le(f), t >= n.length(i) ? n.insertObject(i, t, f) : n.putObject(i, t, f);
438
438
  else {
439
439
  let p;
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);
440
+ wt(f), t >= n.length(i) ? p = n.insertObject(i, t, "") : p = n.putObject(i, t, ""), Ue(n, p, [...o, t]).splice(0, 0, ...f);
441
441
  }
442
442
  break;
443
443
  }
444
444
  case "map": {
445
445
  let p;
446
- t >= n.length(s) ? p = n.insertObject(s, t, {}) : p = n.putObject(s, t, {});
447
- const d = He(n, p, i, [...o, t]);
448
- for (const h in c)
449
- d[h] = c[h];
446
+ t >= n.length(i) ? p = n.insertObject(i, t, {}) : p = n.putObject(i, t, {});
447
+ const d = He(n, p, s, [...o, t]);
448
+ for (const h in f)
449
+ d[h] = f[h];
450
450
  break;
451
451
  }
452
452
  default:
453
- t >= n.length(s) ? n.insert(s, t, c, f) : n.put(s, t, c, f);
453
+ t >= n.length(i) ? n.insert(i, t, f, a) : n.put(i, t, f, a);
454
454
  }
455
455
  return !0;
456
456
  },
457
457
  deleteProperty(e, t) {
458
458
  const { context: r, objectId: n } = e;
459
459
  t = ae(t);
460
- const s = r.get(n, t);
461
- if (s != null && s[0] == "counter")
460
+ const i = r.get(n, t);
461
+ if (i != null && i[0] == "counter")
462
462
  throw new TypeError("Unsupported operation: deleting a counter from a list");
463
463
  return r.delete(n, t), !0;
464
464
  },
@@ -480,31 +480,31 @@ const _r = {
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 === 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];
483
+ return t = ae(t), t === Symbol.hasInstance ? (i) => Array.isArray(i) : 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
486
  return Object.getPrototypeOf(new be());
487
487
  }
488
488
  });
489
489
  function He(e, t, r, n) {
490
- const s = {
490
+ const i = {
491
491
  context: e,
492
492
  objectId: t,
493
493
  path: n || [],
494
494
  cache: {},
495
495
  textV2: r
496
496
  }, o = {};
497
- return Object.assign(o, s), new Proxy(o, _r);
497
+ return Object.assign(o, i), new Proxy(o, _r);
498
498
  }
499
499
  function Ke(e, t, r, n) {
500
- const s = {
500
+ const i = {
501
501
  context: e,
502
502
  objectId: t,
503
503
  path: n || [],
504
504
  cache: {},
505
505
  textV2: r
506
506
  }, o = [];
507
- return Object.assign(o, s), new Proxy(o, Kt);
507
+ return Object.assign(o, i), new Proxy(o, Kt);
508
508
  }
509
509
  function Ue(e, t, r) {
510
510
  const n = {
@@ -513,23 +513,23 @@ function Ue(e, t, r) {
513
513
  path: r || [],
514
514
  cache: {},
515
515
  textV2: !1
516
- }, s = {};
517
- return Object.assign(s, n), new Proxy(s, Or);
516
+ }, i = {};
517
+ return Object.assign(i, n), new Proxy(i, Or);
518
518
  }
519
519
  function xt(e) {
520
- const { context: t, objectId: r, path: n, textV2: s } = e;
520
+ const { context: t, objectId: r, path: n, textV2: i } = e;
521
521
  return {
522
- deleteAt(i, c) {
523
- return typeof c == "number" ? t.splice(r, i, c) : t.delete(r, i), this;
522
+ deleteAt(s, f) {
523
+ return typeof f == "number" ? t.splice(r, s, f) : t.delete(r, s), this;
524
524
  },
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++)
525
+ fill(s, f, a) {
526
+ const [p, d] = Pe(s, i, [...n, f], t), h = t.length(r);
527
+ f = ae(f || 0), a = ae(a || h);
528
+ for (let g = f; g < Math.min(a, h); g++)
529
529
  if (d === "list" || d === "map")
530
530
  t.putObject(r, g, p);
531
531
  else if (d === "text")
532
- if (s)
532
+ if (i)
533
533
  Le(p), t.putObject(r, g, p);
534
534
  else {
535
535
  wt(p);
@@ -541,48 +541,48 @@ function xt(e) {
541
541
  t.put(r, g, p, d);
542
542
  return this;
543
543
  },
544
- indexOf(i, c = 0) {
545
- const f = t.length(r);
546
- for (let p = c; p < f; p++) {
544
+ indexOf(s, f = 0) {
545
+ const a = t.length(r);
546
+ for (let p = f; p < a; p++) {
547
547
  const d = t.getWithType(r, p);
548
- if (d && (d[1] === i[Ie] || d[1] === i))
548
+ if (d && (d[1] === s[Ie] || d[1] === s))
549
549
  return p;
550
550
  }
551
551
  return -1;
552
552
  },
553
- insertAt(i, ...c) {
554
- return this.splice(i, 0, ...c), this;
553
+ insertAt(s, ...f) {
554
+ return this.splice(s, 0, ...f), this;
555
555
  },
556
556
  pop() {
557
- const i = t.length(r);
558
- if (i == 0)
557
+ const s = t.length(r);
558
+ if (s == 0)
559
559
  return;
560
- const c = re(e, i - 1);
561
- return t.delete(r, i - 1), c;
560
+ const f = re(e, s - 1);
561
+ return t.delete(r, s - 1), f;
562
562
  },
563
- push(...i) {
564
- const c = t.length(r);
565
- return this.splice(c, 0, ...i), t.length(r);
563
+ push(...s) {
564
+ const f = t.length(r);
565
+ return this.splice(f, 0, ...s), t.length(r);
566
566
  },
567
567
  shift() {
568
568
  if (t.length(r) == 0)
569
569
  return;
570
- const i = re(e, 0);
571
- return t.delete(r, 0), i;
570
+ const s = re(e, 0);
571
+ return t.delete(r, 0), s;
572
572
  },
573
- splice(i, c, ...f) {
574
- i = ae(i), typeof c != "number" && (c = t.length(r) - i), c = ae(c);
575
- for (const h of f)
573
+ splice(s, f, ...a) {
574
+ s = ae(s), typeof f != "number" && (f = t.length(r) - s), f = ae(f);
575
+ for (const h of a)
576
576
  if (ze(h, t))
577
577
  throw new RangeError("Cannot create a reference to an existing document object");
578
578
  const p = [];
579
- for (let h = 0; h < c; h++) {
580
- const g = re(e, i);
581
- g !== void 0 && p.push(g), t.delete(r, i);
579
+ for (let h = 0; h < f; h++) {
580
+ const g = re(e, s);
581
+ g !== void 0 && p.push(g), t.delete(r, s);
582
582
  }
583
- const d = f.map((h, g) => {
583
+ const d = a.map((h, g) => {
584
584
  try {
585
- return Pe(h, s, [...n], t);
585
+ return Pe(h, i, [...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
  }
@@ -590,41 +590,41 @@ function xt(e) {
590
590
  for (const [h, g] of d) {
591
591
  switch (g) {
592
592
  case "list": {
593
- const u = t.insertObject(r, i, []);
594
- Ke(t, u, s, [...n, i]).splice(0, 0, ...h);
593
+ const u = t.insertObject(r, s, []);
594
+ Ke(t, u, i, [...n, s]).splice(0, 0, ...h);
595
595
  break;
596
596
  }
597
597
  case "text": {
598
- if (s)
599
- Le(h), t.insertObject(r, i, h);
598
+ if (i)
599
+ Le(h), t.insertObject(r, s, h);
600
600
  else {
601
- const u = t.insertObject(r, i, "");
602
- Ue(t, u, [...n, i]).splice(0, 0, ...h);
601
+ const u = t.insertObject(r, s, "");
602
+ Ue(t, u, [...n, s]).splice(0, 0, ...h);
603
603
  }
604
604
  break;
605
605
  }
606
606
  case "map": {
607
- const u = t.insertObject(r, i, {}), b = He(t, u, s, [...n, i]);
607
+ const u = t.insertObject(r, s, {}), b = He(t, u, i, [...n, s]);
608
608
  for (const x in h)
609
609
  b[x] = h[x];
610
610
  break;
611
611
  }
612
612
  default:
613
- t.insert(r, i, h, g);
613
+ t.insert(r, s, h, g);
614
614
  }
615
- i += 1;
615
+ s += 1;
616
616
  }
617
617
  return p;
618
618
  },
619
- unshift(...i) {
620
- return this.splice(0, 0, ...i), t.length(r);
619
+ unshift(...s) {
620
+ return this.splice(0, 0, ...s), t.length(r);
621
621
  },
622
622
  entries() {
623
- let i = 0;
623
+ let s = 0;
624
624
  return {
625
625
  next: () => {
626
- const f = re(e, i);
627
- return f === void 0 ? { value: void 0, done: !0 } : { value: [i++, f], done: !1 };
626
+ const a = re(e, s);
627
+ return a === void 0 ? { value: void 0, done: !0 } : { value: [s++, a], done: !1 };
628
628
  },
629
629
  [Symbol.iterator]() {
630
630
  return this;
@@ -632,21 +632,21 @@ function xt(e) {
632
632
  };
633
633
  },
634
634
  keys() {
635
- let i = 0;
636
- const c = t.length(r);
635
+ let s = 0;
636
+ const f = t.length(r);
637
637
  return {
638
- next: () => i < c ? { value: i++, done: !1 } : { value: void 0, done: !0 },
638
+ next: () => s < f ? { value: s++, done: !1 } : { value: void 0, done: !0 },
639
639
  [Symbol.iterator]() {
640
640
  return this;
641
641
  }
642
642
  };
643
643
  },
644
644
  values() {
645
- let i = 0;
645
+ let s = 0;
646
646
  return {
647
647
  next: () => {
648
- const f = re(e, i++);
649
- return f === void 0 ? { value: void 0, done: !0 } : { value: f, done: !1 };
648
+ const a = re(e, s++);
649
+ return a === void 0 ? { value: void 0, done: !0 } : { value: a, done: !1 };
650
650
  },
651
651
  [Symbol.iterator]() {
652
652
  return this;
@@ -654,15 +654,15 @@ function xt(e) {
654
654
  };
655
655
  },
656
656
  toArray() {
657
- const i = [];
658
- let c;
657
+ const s = [];
658
+ let f;
659
659
  do
660
- c = re(e, i.length), c !== void 0 && i.push(c);
661
- while (c !== void 0);
662
- return i;
660
+ f = re(e, s.length), f !== void 0 && s.push(f);
661
+ while (f !== void 0);
662
+ return s;
663
663
  },
664
- map(i) {
665
- return this.toArray().map(i);
664
+ map(s) {
665
+ return this.toArray().map(s);
666
666
  },
667
667
  toString() {
668
668
  return this.toArray().toString();
@@ -670,100 +670,100 @@ function xt(e) {
670
670
  toLocaleString() {
671
671
  return this.toArray().toLocaleString();
672
672
  },
673
- forEach(i) {
674
- return this.toArray().forEach(i);
673
+ forEach(s) {
674
+ return this.toArray().forEach(s);
675
675
  },
676
676
  // todo: real concat function is different
677
- concat(i) {
678
- return this.toArray().concat(i);
677
+ concat(s) {
678
+ return this.toArray().concat(s);
679
679
  },
680
- every(i) {
681
- return this.toArray().every(i);
680
+ every(s) {
681
+ return this.toArray().every(s);
682
682
  },
683
- filter(i) {
684
- return this.toArray().filter(i);
683
+ filter(s) {
684
+ return this.toArray().filter(s);
685
685
  },
686
- find(i) {
687
- let c = 0;
688
- for (const f of this) {
689
- if (i(f, c))
690
- return f;
691
- c += 1;
686
+ find(s) {
687
+ let f = 0;
688
+ for (const a of this) {
689
+ if (s(a, f))
690
+ return a;
691
+ f += 1;
692
692
  }
693
693
  },
694
- findIndex(i) {
695
- let c = 0;
696
- for (const f of this) {
697
- if (i(f, c))
698
- return c;
699
- c += 1;
694
+ findIndex(s) {
695
+ let f = 0;
696
+ for (const a of this) {
697
+ if (s(a, f))
698
+ return f;
699
+ f += 1;
700
700
  }
701
701
  return -1;
702
702
  },
703
- includes(i) {
704
- return this.find((c) => c === i) !== void 0;
703
+ includes(s) {
704
+ return this.find((f) => f === s) !== void 0;
705
705
  },
706
- join(i) {
707
- return this.toArray().join(i);
706
+ join(s) {
707
+ return this.toArray().join(s);
708
708
  },
709
- reduce(i, c) {
710
- return this.toArray().reduce(i, c);
709
+ reduce(s, f) {
710
+ return this.toArray().reduce(s, f);
711
711
  },
712
- reduceRight(i, c) {
713
- return this.toArray().reduceRight(i, c);
712
+ reduceRight(s, f) {
713
+ return this.toArray().reduceRight(s, f);
714
714
  },
715
- lastIndexOf(i, c = 1 / 0) {
716
- return this.toArray().lastIndexOf(i, c);
715
+ lastIndexOf(s, f = 1 / 0) {
716
+ return this.toArray().lastIndexOf(s, f);
717
717
  },
718
- slice(i, c) {
719
- return this.toArray().slice(i, c);
718
+ slice(s, f) {
719
+ return this.toArray().slice(s, f);
720
720
  },
721
- some(i) {
722
- let c = 0;
723
- for (const f of this) {
724
- if (i(f, c))
721
+ some(s) {
722
+ let f = 0;
723
+ for (const a of this) {
724
+ if (s(a, f))
725
725
  return !0;
726
- c += 1;
726
+ f += 1;
727
727
  }
728
728
  return !1;
729
729
  },
730
730
  [Symbol.iterator]: function* () {
731
- let i = 0, c = re(e, i);
732
- for (; c !== void 0; )
733
- yield c, i += 1, c = re(e, i);
731
+ let s = 0, f = re(e, s);
732
+ for (; f !== void 0; )
733
+ yield f, s += 1, f = re(e, s);
734
734
  }
735
735
  };
736
736
  }
737
737
  function Ir(e) {
738
738
  const { context: t, objectId: r } = e;
739
739
  return {
740
- set(s, o) {
741
- return this[s] = o;
740
+ set(i, o) {
741
+ return this[i] = o;
742
742
  },
743
- get(s) {
744
- return this[s];
743
+ get(i) {
744
+ return this[i];
745
745
  },
746
746
  toString() {
747
747
  return t.text(r).replace(//g, "");
748
748
  },
749
749
  toSpans() {
750
- const s = [];
750
+ const i = [];
751
751
  let o = "";
752
- const i = t.length(r);
753
- for (let c = 0; c < i; c++) {
754
- const f = this[c];
755
- typeof f == "string" ? o += f : (o.length > 0 && (s.push(o), o = ""), s.push(f));
752
+ const s = t.length(r);
753
+ for (let f = 0; f < s; f++) {
754
+ const a = this[f];
755
+ typeof a == "string" ? o += a : (o.length > 0 && (i.push(o), o = ""), i.push(a));
756
756
  }
757
- return o.length > 0 && s.push(o), s;
757
+ return o.length > 0 && i.push(o), i;
758
758
  },
759
759
  toJSON() {
760
760
  return this.toString();
761
761
  },
762
- indexOf(s, o = 0) {
763
- return t.text(r).indexOf(s, o);
762
+ indexOf(i, o = 0) {
763
+ return t.text(r).indexOf(i, o);
764
764
  },
765
- insertAt(s, ...o) {
766
- o.every((i) => typeof i == "string") ? t.splice(r, s, 0, o.join("")) : xt(e).insertAt(s, ...o);
765
+ insertAt(i, ...o) {
766
+ o.every((s) => typeof s == "string") ? t.splice(r, i, 0, o.join("")) : xt(e).insertAt(i, ...o);
767
767
  }
768
768
  };
769
769
  }
@@ -822,19 +822,19 @@ var it = { exports: {} }, qe, It;
822
822
  function Rr() {
823
823
  if (It) return qe;
824
824
  It = 1;
825
- var e = 1e3, t = e * 60, r = t * 60, n = r * 24, s = n * 7, o = n * 365.25;
825
+ var e = 1e3, t = e * 60, r = t * 60, n = r * 24, i = 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
- return i(d);
830
+ return s(d);
831
831
  if (g === "number" && isFinite(d))
832
- return h.long ? f(d) : c(d);
832
+ return h.long ? a(d) : f(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
  );
836
836
  };
837
- function i(d) {
837
+ function s(d) {
838
838
  if (d = String(d), !(d.length > 100)) {
839
839
  var h = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
840
840
  d
@@ -851,7 +851,7 @@ function Rr() {
851
851
  case "weeks":
852
852
  case "week":
853
853
  case "w":
854
- return g * s;
854
+ return g * i;
855
855
  case "days":
856
856
  case "day":
857
857
  case "d":
@@ -886,11 +886,11 @@ function Rr() {
886
886
  }
887
887
  }
888
888
  }
889
- function c(d) {
889
+ function f(d) {
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 f(d) {
893
+ function a(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
  }
@@ -901,7 +901,7 @@ function Rr() {
901
901
  return qe;
902
902
  }
903
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) => {
904
+ r.debug = r, r.default = r, r.coerce = a, r.disable = o, r.enable = i, r.enabled = s, 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) {
@@ -944,7 +944,7 @@ function Br(e) {
944
944
  const g = r(this.namespace + (typeof h > "u" ? ":" : h) + d);
945
945
  return g.log = this.log, g;
946
946
  }
947
- function s(d) {
947
+ function i(d) {
948
948
  r.save(d), r.namespaces = d, r.names = [], r.skips = [];
949
949
  let h;
950
950
  const g = (typeof d == "string" ? d : "").split(/[\s,]+/), u = g.length;
@@ -953,12 +953,12 @@ function Br(e) {
953
953
  }
954
954
  function o() {
955
955
  const d = [
956
- ...r.names.map(c),
957
- ...r.skips.map(c).map((h) => "-" + h)
956
+ ...r.names.map(f),
957
+ ...r.skips.map(f).map((h) => "-" + h)
958
958
  ].join(",");
959
959
  return r.enable(""), d;
960
960
  }
961
- function i(d) {
961
+ function s(d) {
962
962
  if (d[d.length - 1] === "*")
963
963
  return !0;
964
964
  let h, g;
@@ -970,10 +970,10 @@ function Br(e) {
970
970
  return !0;
971
971
  return !1;
972
972
  }
973
- function c(d) {
973
+ function f(d) {
974
974
  return d.toString().substring(2, d.toString().length - 2).replace(/\.\*\?$/, "*");
975
975
  }
976
- function f(d) {
976
+ function a(d) {
977
977
  return d instanceof Error ? d.stack || d.message : d;
978
978
  }
979
979
  function p() {
@@ -983,10 +983,10 @@ function Br(e) {
983
983
  }
984
984
  var Tr = Br;
985
985
  (function(e, t) {
986
- t.formatArgs = n, t.save = s, t.load = o, t.useColors = r, t.storage = i(), t.destroy = /* @__PURE__ */ (() => {
987
- let f = !1;
986
+ t.formatArgs = n, t.save = i, t.load = o, t.useColors = r, t.storage = s(), t.destroy = /* @__PURE__ */ (() => {
987
+ let a = !1;
988
988
  return () => {
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`."));
989
+ a || (a = !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",
@@ -1071,50 +1071,50 @@ var Tr = Br;
1071
1071
  return !0;
1072
1072
  if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
1073
1073
  return !1;
1074
- let f;
1074
+ let a;
1075
1075
  return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
1076
1076
  typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
1077
1077
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
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
1078
+ typeof navigator < "u" && navigator.userAgent && (a = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(a[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
1079
1079
  typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
1080
1080
  }
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)
1081
+ function n(a) {
1082
+ if (a[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + a[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff), !this.useColors)
1083
1083
  return;
1084
1084
  const p = "color: " + this.color;
1085
- f.splice(1, 0, p, "color: inherit");
1085
+ a.splice(1, 0, p, "color: inherit");
1086
1086
  let d = 0, h = 0;
1087
- f[0].replace(/%[a-zA-Z%]/g, (g) => {
1087
+ a[0].replace(/%[a-zA-Z%]/g, (g) => {
1088
1088
  g !== "%%" && (d++, g === "%c" && (h = d));
1089
- }), f.splice(h, 0, p);
1089
+ }), a.splice(h, 0, p);
1090
1090
  }
1091
1091
  t.log = console.debug || console.log || (() => {
1092
1092
  });
1093
- function s(f) {
1093
+ function i(a) {
1094
1094
  try {
1095
- f ? t.storage.setItem("debug", f) : t.storage.removeItem("debug");
1095
+ a ? t.storage.setItem("debug", a) : t.storage.removeItem("debug");
1096
1096
  } catch {
1097
1097
  }
1098
1098
  }
1099
1099
  function o() {
1100
- let f;
1100
+ let a;
1101
1101
  try {
1102
- f = t.storage.getItem("debug");
1102
+ a = t.storage.getItem("debug");
1103
1103
  } catch {
1104
1104
  }
1105
- return !f && typeof process < "u" && "env" in process && (f = process.env.DEBUG), f;
1105
+ return !a && typeof process < "u" && "env" in process && (a = process.env.DEBUG), a;
1106
1106
  }
1107
- function i() {
1107
+ function s() {
1108
1108
  try {
1109
1109
  return localStorage;
1110
1110
  } catch {
1111
1111
  }
1112
1112
  }
1113
1113
  e.exports = Tr(t);
1114
- const { formatters: c } = e.exports;
1115
- c.j = function(f) {
1114
+ const { formatters: f } = e.exports;
1115
+ f.j = function(a) {
1116
1116
  try {
1117
- return JSON.stringify(f);
1117
+ return JSON.stringify(a);
1118
1118
  } catch (p) {
1119
1119
  return "[UnexpectedJSONParseError]: " + p.message;
1120
1120
  }
@@ -1128,38 +1128,38 @@ var Xt = { exports: {} };
1128
1128
  function n() {
1129
1129
  }
1130
1130
  Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (r = !1));
1131
- function s(f, p, d) {
1132
- this.fn = f, this.context = p, this.once = d || !1;
1131
+ function i(a, p, d) {
1132
+ this.fn = a, this.context = p, this.once = d || !1;
1133
1133
  }
1134
- function o(f, p, d, h, g) {
1134
+ function o(a, p, d, h, g) {
1135
1135
  if (typeof d != "function")
1136
1136
  throw new TypeError("The listener must be a function");
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;
1137
+ var u = new i(d, h || a, g), b = r ? r + p : p;
1138
+ return a._events[b] ? a._events[b].fn ? a._events[b] = [a._events[b], u] : a._events[b].push(u) : (a._events[b] = u, a._eventsCount++), a;
1139
1139
  }
1140
- function i(f, p) {
1141
- --f._eventsCount === 0 ? f._events = new n() : delete f._events[p];
1140
+ function s(a, p) {
1141
+ --a._eventsCount === 0 ? a._events = new n() : delete a._events[p];
1142
1142
  }
1143
- function c() {
1143
+ function f() {
1144
1144
  this._events = new n(), this._eventsCount = 0;
1145
1145
  }
1146
- c.prototype.eventNames = function() {
1146
+ f.prototype.eventNames = function() {
1147
1147
  var p = [], d, h;
1148
1148
  if (this._eventsCount === 0) return p;
1149
1149
  for (h in d = this._events)
1150
1150
  t.call(d, h) && p.push(r ? h.slice(1) : h);
1151
1151
  return Object.getOwnPropertySymbols ? p.concat(Object.getOwnPropertySymbols(d)) : p;
1152
- }, c.prototype.listeners = function(p) {
1152
+ }, f.prototype.listeners = function(p) {
1153
1153
  var d = r ? r + p : p, h = this._events[d];
1154
1154
  if (!h) return [];
1155
1155
  if (h.fn) return [h.fn];
1156
1156
  for (var g = 0, u = h.length, b = new Array(u); g < u; g++)
1157
1157
  b[g] = h[g].fn;
1158
1158
  return b;
1159
- }, c.prototype.listenerCount = function(p) {
1159
+ }, f.prototype.listenerCount = function(p) {
1160
1160
  var d = r ? r + p : p, h = this._events[d];
1161
1161
  return h ? h.fn ? 1 : h.length : 0;
1162
- }, c.prototype.emit = function(p, d, h, g, u, b) {
1162
+ }, f.prototype.emit = function(p, d, h, g, u, b) {
1163
1163
  var x = r ? r + p : p;
1164
1164
  if (!this._events[x]) return !1;
1165
1165
  var C = this._events[x], I = arguments.length, U, v;
@@ -1204,28 +1204,28 @@ var Xt = { exports: {} };
1204
1204
  }
1205
1205
  }
1206
1206
  return !0;
1207
- }, c.prototype.on = function(p, d, h) {
1207
+ }, f.prototype.on = function(p, d, h) {
1208
1208
  return o(this, p, d, h, !1);
1209
- }, c.prototype.once = function(p, d, h) {
1209
+ }, f.prototype.once = function(p, d, h) {
1210
1210
  return o(this, p, d, h, !0);
1211
- }, c.prototype.removeListener = function(p, d, h, g) {
1211
+ }, f.prototype.removeListener = function(p, d, h, g) {
1212
1212
  var u = r ? r + p : p;
1213
1213
  if (!this._events[u]) return this;
1214
1214
  if (!d)
1215
- return i(this, u), this;
1215
+ return s(this, u), this;
1216
1216
  var b = this._events[u];
1217
1217
  if (b.fn)
1218
- b.fn === d && (!g || b.once) && (!h || b.context === h) && i(this, u);
1218
+ b.fn === d && (!g || b.once) && (!h || b.context === h) && s(this, u);
1219
1219
  else {
1220
1220
  for (var x = 0, C = [], I = b.length; x < I; x++)
1221
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);
1222
+ C.length ? this._events[u] = C.length === 1 ? C[0] : C : s(this, u);
1223
1223
  }
1224
1224
  return this;
1225
- }, c.prototype.removeAllListeners = function(p) {
1225
+ }, f.prototype.removeAllListeners = function(p) {
1226
1226
  var d;
1227
- return p ? (d = r ? r + p : p, this._events[d] && i(this, d)) : (this._events = new n(), this._eventsCount = 0), this;
1228
- }, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = r, c.EventEmitter = c, e.exports = c;
1227
+ return p ? (d = r ? r + p : p, this._events[d] && s(this, d)) : (this._events = new n(), this._eventsCount = 0), this;
1228
+ }, f.prototype.off = f.prototype.removeListener, f.prototype.addListener = f.prototype.on, f.prefixed = r, f.EventEmitter = f, e.exports = f;
1229
1229
  })(Xt);
1230
1230
  var Lr = Xt.exports;
1231
1231
  const Vr = /* @__PURE__ */ We(Lr);
@@ -1287,16 +1287,16 @@ Je.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
1287
1287
  return E instanceof Uint8Array || E != null && typeof E == "object" && E.constructor.name === "Uint8Array";
1288
1288
  }
1289
1289
  e.isBytes = n;
1290
- const s = (E) => new Uint8Array(E.buffer, E.byteOffset, E.byteLength);
1291
- e.u8 = s;
1290
+ const i = (E) => new Uint8Array(E.buffer, E.byteOffset, E.byteLength);
1291
+ e.u8 = i;
1292
1292
  const o = (E) => new Uint32Array(E.buffer, E.byteOffset, Math.floor(E.byteLength / 4));
1293
1293
  e.u32 = o;
1294
- const i = (E) => new DataView(E.buffer, E.byteOffset, E.byteLength);
1295
- e.createView = i;
1296
- const c = (E, l) => E << 32 - l | E >>> l;
1297
- e.rotr = c;
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;
1294
+ const s = (E) => new DataView(E.buffer, E.byteOffset, E.byteLength);
1295
+ e.createView = s;
1296
+ const f = (E, l) => E << 32 - l | E >>> l;
1297
+ e.rotr = f;
1298
+ const a = (E, l) => E << l | E >>> 32 - l >>> 0;
1299
+ e.rotl = a, e.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
1300
1300
  const p = (E) => E << 24 & 4278190080 | E << 8 & 16711680 | E >>> 8 & 65280 | E >>> 24 & 255;
1301
1301
  e.byteSwap = p, e.byteSwapIfBE = e.isLE ? (E) => E : (E) => (0, e.byteSwap)(E);
1302
1302
  function d(E) {
@@ -1418,50 +1418,50 @@ const Ze = q, Ae = St;
1418
1418
  function $r(e, t, r, n) {
1419
1419
  if (typeof e.setBigUint64 == "function")
1420
1420
  return e.setBigUint64(t, r, n);
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);
1421
+ const i = BigInt(32), o = BigInt(4294967295), s = Number(r >> i & o), f = Number(r & o), a = n ? 4 : 0, p = n ? 0 : 4;
1422
+ e.setUint32(t + a, s, n), e.setUint32(t + p, f, n);
1423
1423
  }
1424
1424
  const zr = (e, t, r) => e & t ^ ~e & r;
1425
1425
  de.Chi = zr;
1426
1426
  const Hr = (e, t, r) => e & t ^ e & r ^ t & r;
1427
1427
  de.Maj = Hr;
1428
1428
  class Kr extends Ae.Hash {
1429
- constructor(t, r, n, s) {
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);
1429
+ constructor(t, r, n, i) {
1430
+ super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = i, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = (0, Ae.createView)(this.buffer);
1431
1431
  }
1432
1432
  update(t) {
1433
1433
  (0, Ze.exists)(this);
1434
- const { view: r, buffer: n, blockLen: s } = this;
1434
+ const { view: r, buffer: n, blockLen: i } = this;
1435
1435
  t = (0, Ae.toBytes)(t);
1436
1436
  const o = t.length;
1437
- for (let i = 0; i < o; ) {
1438
- const c = Math.min(s - this.pos, o - i);
1439
- if (c === s) {
1440
- const f = (0, Ae.createView)(t);
1441
- for (; s <= o - i; i += s)
1442
- this.process(f, i);
1437
+ for (let s = 0; s < o; ) {
1438
+ const f = Math.min(i - this.pos, o - s);
1439
+ if (f === i) {
1440
+ const a = (0, Ae.createView)(t);
1441
+ for (; i <= o - s; s += i)
1442
+ this.process(a, s);
1443
1443
  continue;
1444
1444
  }
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);
1445
+ n.set(t.subarray(s, s + f), this.pos), this.pos += f, s += f, this.pos === i && (this.process(r, 0), this.pos = 0);
1446
1446
  }
1447
1447
  return this.length += t.length, this.roundClean(), this;
1448
1448
  }
1449
1449
  digestInto(t) {
1450
1450
  (0, Ze.exists)(this), (0, Ze.output)(t, this), this.finished = !0;
1451
- const { buffer: r, view: n, blockLen: s, isLE: o } = this;
1452
- let { pos: i } = this;
1453
- r[i++] = 128, this.buffer.subarray(i).fill(0), this.padOffset > s - i && (this.process(n, 0), i = 0);
1454
- for (let h = i; h < s; h++)
1451
+ const { buffer: r, view: n, blockLen: i, isLE: o } = this;
1452
+ let { pos: s } = this;
1453
+ r[s++] = 128, this.buffer.subarray(s).fill(0), this.padOffset > i - s && (this.process(n, 0), s = 0);
1454
+ for (let h = s; h < i; h++)
1455
1455
  r[h] = 0;
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)
1456
+ $r(n, i - 8, BigInt(this.length * 8), o), this.process(n, 0);
1457
+ const f = (0, Ae.createView)(t), a = this.outputLen;
1458
+ if (a % 4)
1459
1459
  throw new Error("_sha2: outputLen should be aligned to 32bit");
1460
- const p = f / 4, d = this.get();
1460
+ const p = a / 4, d = this.get();
1461
1461
  if (p > d.length)
1462
1462
  throw new Error("_sha2: outputLen bigger than state");
1463
1463
  for (let h = 0; h < p; h++)
1464
- c.setUint32(4 * h, d[h], o);
1464
+ f.setUint32(4 * h, d[h], o);
1465
1465
  }
1466
1466
  digest() {
1467
1467
  const { buffer: t, outputLen: r } = this;
@@ -1471,8 +1471,8 @@ class Kr extends Ae.Hash {
1471
1471
  }
1472
1472
  _cloneInto(t) {
1473
1473
  t || (t = new this.constructor()), t.set(...this.get());
1474
- const { blockLen: r, buffer: n, length: s, finished: o, destroyed: i, pos: c } = this;
1475
- return t.length = s, t.pos = c, t.finished = o, t.destroyed = i, s % r && t.buffer.set(n), t;
1474
+ const { blockLen: r, buffer: n, length: i, finished: o, destroyed: s, pos: f } = this;
1475
+ return t.length = i, t.pos = f, t.finished = o, t.destroyed = s, i % r && t.buffer.set(n), t;
1476
1476
  }
1477
1477
  }
1478
1478
  de.HashMD = Kr;
@@ -1558,12 +1558,12 @@ class tr extends Ye.HashMD {
1558
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;
1559
1559
  }
1560
1560
  get() {
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];
1561
+ const { A: t, B: r, C: n, D: i, E: o, F: s, G: f, H: a } = this;
1562
+ return [t, r, n, i, o, s, f, a];
1563
1563
  }
1564
1564
  // prettier-ignore
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;
1565
+ set(t, r, n, i, o, s, f, a) {
1566
+ this.A = t | 0, this.B = r | 0, this.C = n | 0, this.D = i | 0, this.E = o | 0, this.F = s | 0, this.G = f | 0, this.H = a | 0;
1567
1567
  }
1568
1568
  process(t, r) {
1569
1569
  for (let h = 0; h < 16; h++, r += 4)
@@ -1572,12 +1572,12 @@ class tr extends Ye.HashMD {
1572
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
1573
  ue[h] = x + ue[h - 7] + b + ue[h - 16] | 0;
1574
1574
  }
1575
- let { A: n, B: s, C: o, D: i, E: c, F: f, G: p, H: d } = this;
1575
+ let { A: n, B: i, C: o, D: s, E: f, F: a, G: p, H: d } = this;
1576
1576
  for (let h = 0; h < 64; h++) {
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;
1577
+ const g = (0, te.rotr)(f, 6) ^ (0, te.rotr)(f, 11) ^ (0, te.rotr)(f, 25), u = d + g + (0, Ye.Chi)(f, a, 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, i, o) | 0;
1578
+ d = p, p = a, a = f, f = s + u | 0, s = o, o = i, i = n, n = u + x | 0;
1579
1579
  }
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);
1580
+ n = n + this.A | 0, i = i + this.B | 0, o = o + this.C | 0, s = s + this.D | 0, f = f + this.E | 0, a = a + this.F | 0, p = p + this.G | 0, d = d + this.H | 0, this.set(n, i, o, s, f, a, p, d);
1581
1581
  }
1582
1582
  roundClean() {
1583
1583
  ue.fill(0);
@@ -1599,12 +1599,12 @@ function Gr(e) {
1599
1599
  for (var t = new Uint8Array(256), r = 0; r < t.length; r++)
1600
1600
  t[r] = 255;
1601
1601
  for (var n = 0; n < e.length; n++) {
1602
- var s = e.charAt(n), o = s.charCodeAt(0);
1602
+ var i = e.charAt(n), o = i.charCodeAt(0);
1603
1603
  if (t[o] !== 255)
1604
- throw new TypeError(s + " is ambiguous");
1604
+ throw new TypeError(i + " is ambiguous");
1605
1605
  t[o] = n;
1606
1606
  }
1607
- var i = e.length, c = e.charAt(0), f = Math.log(i) / Math.log(256), p = Math.log(256) / Math.log(i);
1607
+ var s = e.length, f = e.charAt(0), a = Math.log(s) / Math.log(256), p = Math.log(256) / Math.log(s);
1608
1608
  function d(u) {
1609
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))
1610
1610
  throw new TypeError("Expected Uint8Array");
@@ -1614,14 +1614,14 @@ function Gr(e) {
1614
1614
  C++, b++;
1615
1615
  for (var U = (I - C) * p + 1 >>> 0, v = new Uint8Array(U); C !== I; ) {
1616
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;
1617
+ B += 256 * v[F] >>> 0, v[F] = B % s >>> 0, B = B / s >>> 0;
1618
1618
  if (B !== 0)
1619
1619
  throw new Error("Non-zero carry");
1620
1620
  x = M, C++;
1621
1621
  }
1622
1622
  for (var N = U - x; N !== U && v[N] === 0; )
1623
1623
  N++;
1624
- for (var P = c.repeat(b); N < U; ++N)
1624
+ for (var P = f.repeat(b); N < U; ++N)
1625
1625
  P += e.charAt(v[N]);
1626
1626
  return P;
1627
1627
  }
@@ -1630,14 +1630,14 @@ function Gr(e) {
1630
1630
  throw new TypeError("Expected String");
1631
1631
  if (u.length === 0)
1632
1632
  return new Uint8Array();
1633
- for (var b = 0, x = 0, C = 0; u[b] === c; )
1633
+ for (var b = 0, x = 0, C = 0; u[b] === f; )
1634
1634
  x++, b++;
1635
- for (var I = (u.length - b) * f + 1 >>> 0, U = new Uint8Array(I); u[b]; ) {
1635
+ for (var I = (u.length - b) * a + 1 >>> 0, U = new Uint8Array(I); u[b]; ) {
1636
1636
  var v = t[u.charCodeAt(b)];
1637
1637
  if (v === 255)
1638
1638
  return;
1639
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;
1640
+ v += s * U[M] >>> 0, U[M] = v % 256 >>> 0, v = v / 256 >>> 0;
1641
1641
  if (v !== 0)
1642
1642
  throw new Error("Non-zero carry");
1643
1643
  C = B, b++;
@@ -1652,7 +1652,7 @@ function Gr(e) {
1652
1652
  var b = h(u);
1653
1653
  if (b)
1654
1654
  return b;
1655
- throw new Error("Non-base" + i + " character");
1655
+ throw new Error("Non-base" + s + " character");
1656
1656
  }
1657
1657
  return {
1658
1658
  encode: d,
@@ -1664,27 +1664,27 @@ var Xr = Gr;
1664
1664
  const qr = Xr, Zr = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
1665
1665
  var Yr = qr(Zr), Qe = Yr, Qr = function(e) {
1666
1666
  function t(o) {
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);
1667
+ var s = Uint8Array.from(o), f = e(s), a = s.length + 4, p = new Uint8Array(a);
1668
+ return p.set(s, 0), p.set(f.subarray(0, 4), s.length), Qe.encode(p, a);
1669
1669
  }
1670
1670
  function r(o) {
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]))
1673
- return i;
1671
+ var s = o.slice(0, -4), f = o.slice(-4), a = e(s);
1672
+ if (!(f[0] ^ a[0] | f[1] ^ a[1] | f[2] ^ a[2] | f[3] ^ a[3]))
1673
+ return s;
1674
1674
  }
1675
1675
  function n(o) {
1676
- var i = Qe.decodeUnsafe(o);
1677
- if (i)
1678
- return r(i);
1676
+ var s = Qe.decodeUnsafe(o);
1677
+ if (s)
1678
+ return r(s);
1679
1679
  }
1680
- function s(o) {
1681
- var i = Qe.decode(o), c = r(i);
1682
- if (!c) throw new Error("Invalid checksum");
1683
- return c;
1680
+ function i(o) {
1681
+ var s = Qe.decode(o), f = r(s);
1682
+ if (!f) throw new Error("Invalid checksum");
1683
+ return f;
1684
1684
  }
1685
1685
  return {
1686
1686
  encode: t,
1687
- decode: s,
1687
+ decode: i,
1688
1688
  decodeUnsafe: n
1689
1689
  };
1690
1690
  }, { sha256: Ut } = ve, en = Qr;
@@ -1693,12 +1693,12 @@ function tn(e) {
1693
1693
  }
1694
1694
  var rn = en(tn);
1695
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);
1697
- if (!s)
1696
+ const t = new RegExp(`^${rr}(\\w+)$`), [, r] = e.match(t) || [], n = r, i = sr(n);
1697
+ if (!i)
1698
1698
  throw new Error("Invalid document URL: " + e);
1699
1699
  return {
1700
1700
  /** unencoded DocumentId */
1701
- binaryDocumentId: s,
1701
+ binaryDocumentId: i,
1702
1702
  /** encoded DocumentId */
1703
1703
  documentId: n
1704
1704
  };
@@ -1761,24 +1761,24 @@ class je {
1761
1761
  encodeKeys(t) {
1762
1762
  if (!this._keyMap) return t;
1763
1763
  let r = /* @__PURE__ */ new Map();
1764
- for (let [n, s] of Object.entries(t)) r.set(this._keyMap.hasOwnProperty(n) ? this._keyMap[n] : n, s);
1764
+ for (let [n, i] of Object.entries(t)) r.set(this._keyMap.hasOwnProperty(n) ? this._keyMap[n] : n, i);
1765
1765
  return r;
1766
1766
  }
1767
1767
  decodeKeys(t) {
1768
1768
  if (!this._keyMap || t.constructor.name != "Map") return t;
1769
1769
  if (!this._mapKey) {
1770
1770
  this._mapKey = /* @__PURE__ */ new Map();
1771
- for (let [n, s] of Object.entries(this._keyMap)) this._mapKey.set(s, n);
1771
+ for (let [n, i] of Object.entries(this._keyMap)) this._mapKey.set(i, n);
1772
1772
  }
1773
1773
  let r = {};
1774
- return t.forEach((n, s) => r[se(this._mapKey.has(s) ? this._mapKey.get(s) : s)] = n), r;
1774
+ return t.forEach((n, i) => r[se(this._mapKey.has(i) ? this._mapKey.get(i) : i)] = n), r;
1775
1775
  }
1776
1776
  mapDecode(t, r) {
1777
1777
  let n = this.decode(t);
1778
1778
  if (this._keyMap)
1779
1779
  switch (n.constructor.name) {
1780
1780
  case "Array":
1781
- return n.map((s) => this.decodeKeys(s));
1781
+ return n.map((i) => this.decodeKeys(i));
1782
1782
  }
1783
1783
  return n;
1784
1784
  }
@@ -1800,24 +1800,24 @@ class je {
1800
1800
  return Re();
1801
1801
  }
1802
1802
  decodeMultiple(t, r) {
1803
- let n, s = 0;
1803
+ let n, i = 0;
1804
1804
  try {
1805
1805
  let o = t.length;
1806
1806
  ke = !0;
1807
- let i = this ? this.decode(t, o) : Ct.decode(t, o);
1807
+ let s = this ? this.decode(t, o) : Ct.decode(t, o);
1808
1808
  if (r) {
1809
- if (r(i) === !1)
1809
+ if (r(s) === !1)
1810
1810
  return;
1811
1811
  for (; w < o; )
1812
- if (s = w, r(Re()) === !1)
1812
+ if (i = w, r(Re()) === !1)
1813
1813
  return;
1814
1814
  } else {
1815
- for (n = [i]; w < o; )
1816
- s = w, n.push(Re());
1815
+ for (n = [s]; w < o; )
1816
+ i = w, n.push(Re());
1817
1817
  return n;
1818
1818
  }
1819
1819
  } catch (o) {
1820
- throw o.lastPosition = s, o.values = n, o;
1820
+ throw o.lastPosition = i, o.values = n, o;
1821
1821
  } finally {
1822
1822
  ke = !1, ut();
1823
1823
  }
@@ -1886,46 +1886,46 @@ function L() {
1886
1886
  case 3:
1887
1887
  throw new Error("Indefinite length not supported for byte or text strings");
1888
1888
  case 4:
1889
- let r = [], n, s = 0;
1889
+ let r = [], n, i = 0;
1890
1890
  for (; (n = L()) != we; ) {
1891
- if (s >= Ce) throw new Error(`Array length exceeds ${Ce}`);
1892
- r[s++] = n;
1891
+ if (i >= Ce) throw new Error(`Array length exceeds ${Ce}`);
1892
+ r[i++] = n;
1893
1893
  }
1894
1894
  return t == 4 ? r : t == 3 ? r.join("") : Buffer.concat(r);
1895
1895
  case 5:
1896
1896
  let o;
1897
1897
  if (D.mapsAsObjects) {
1898
- let i = {}, c = 0;
1898
+ let s = {}, f = 0;
1899
1899
  if (D.keyMap)
1900
1900
  for (; (o = L()) != we; ) {
1901
- if (c++ >= ce) throw new Error(`Property count exceeds ${ce}`);
1902
- i[se(D.decodeKey(o))] = L();
1901
+ if (f++ >= ce) throw new Error(`Property count exceeds ${ce}`);
1902
+ s[se(D.decodeKey(o))] = L();
1903
1903
  }
1904
1904
  else
1905
1905
  for (; (o = L()) != we; ) {
1906
- if (c++ >= ce) throw new Error(`Property count exceeds ${ce}`);
1907
- i[se(o)] = L();
1906
+ if (f++ >= ce) throw new Error(`Property count exceeds ${ce}`);
1907
+ s[se(o)] = L();
1908
1908
  }
1909
- return i;
1909
+ return s;
1910
1910
  } else {
1911
1911
  Ee && (D.mapsAsObjects = !0, Ee = !1);
1912
- let i = /* @__PURE__ */ new Map();
1912
+ let s = /* @__PURE__ */ new Map();
1913
1913
  if (D.keyMap) {
1914
- let c = 0;
1914
+ let f = 0;
1915
1915
  for (; (o = L()) != we; ) {
1916
- if (c++ >= ce)
1916
+ if (f++ >= ce)
1917
1917
  throw new Error(`Map size exceeds ${ce}`);
1918
- i.set(D.decodeKey(o), L());
1918
+ s.set(D.decodeKey(o), L());
1919
1919
  }
1920
1920
  } else {
1921
- let c = 0;
1921
+ let f = 0;
1922
1922
  for (; (o = L()) != we; ) {
1923
- if (c++ >= ce)
1923
+ if (f++ >= ce)
1924
1924
  throw new Error(`Map size exceeds ${ce}`);
1925
- i.set(o, L());
1925
+ s.set(o, L());
1926
1926
  }
1927
1927
  }
1928
- return i;
1928
+ return s;
1929
1929
  }
1930
1930
  case 7:
1931
1931
  return we;
@@ -1946,71 +1946,71 @@ function L() {
1946
1946
  if (Fe >= w)
1947
1947
  return Ne.slice(w - $e, (w += e) - $e);
1948
1948
  if (Fe == 0 && ge < 140 && e < 32) {
1949
- let s = e < 16 ? or(e) : un(e);
1950
- if (s != null)
1951
- return s;
1949
+ let i = e < 16 ? or(e) : un(e);
1950
+ if (i != null)
1951
+ return i;
1952
1952
  }
1953
1953
  return ln(e);
1954
1954
  case 4:
1955
1955
  if (e >= Ce) throw new Error(`Array length exceeds ${Ce}`);
1956
1956
  let r = new Array(e);
1957
- for (let s = 0; s < e; s++) r[s] = L();
1957
+ for (let i = 0; i < e; i++) r[i] = L();
1958
1958
  return r;
1959
1959
  case 5:
1960
1960
  if (e >= ce) throw new Error(`Map size exceeds ${Ce}`);
1961
1961
  if (D.mapsAsObjects) {
1962
- let s = {};
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();
1965
- return s;
1962
+ let i = {};
1963
+ if (D.keyMap) for (let o = 0; o < e; o++) i[se(D.decodeKey(L()))] = L();
1964
+ else for (let o = 0; o < e; o++) i[se(L())] = L();
1965
+ return i;
1966
1966
  } else {
1967
1967
  Ee && (D.mapsAsObjects = !0, Ee = !1);
1968
- let s = /* @__PURE__ */ new Map();
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());
1971
- return s;
1968
+ let i = /* @__PURE__ */ new Map();
1969
+ if (D.keyMap) for (let o = 0; o < e; o++) i.set(D.decodeKey(L()), L());
1970
+ else for (let o = 0; o < e; o++) i.set(L(), L());
1971
+ return i;
1972
1972
  }
1973
1973
  case 6:
1974
1974
  if (e >= Ft) {
1975
- let s = K[e & 8191];
1976
- if (s)
1977
- return s.read || (s.read = at(s)), s.read();
1975
+ let i = K[e & 8191];
1976
+ if (i)
1977
+ return i.read || (i.read = at(i)), i.read();
1978
1978
  if (e < 65536) {
1979
1979
  if (e == cn) {
1980
- let o = Se(), i = L(), c = L();
1981
- lt(i, c);
1982
- let f = {};
1980
+ let o = Se(), s = L(), f = L();
1981
+ lt(s, f);
1982
+ let a = {};
1983
1983
  if (D.keyMap) for (let p = 2; p < o; p++) {
1984
- let d = D.decodeKey(c[p - 2]);
1985
- f[se(d)] = L();
1984
+ let d = D.decodeKey(f[p - 2]);
1985
+ a[se(d)] = L();
1986
1986
  }
1987
1987
  else for (let p = 2; p < o; p++) {
1988
- let d = c[p - 2];
1989
- f[se(d)] = L();
1988
+ let d = f[p - 2];
1989
+ a[se(d)] = L();
1990
1990
  }
1991
- return f;
1991
+ return a;
1992
1992
  } else if (e == an) {
1993
- let o = Se(), i = L();
1994
- for (let c = 2; c < o; c++)
1995
- lt(i++, L());
1993
+ let o = Se(), s = L();
1994
+ for (let f = 2; f < o; f++)
1995
+ lt(s++, L());
1996
1996
  return L();
1997
1997
  } else if (e == Ft)
1998
1998
  return wn();
1999
- if (D.getShared && (vt(), s = K[e & 8191], s))
2000
- return s.read || (s.read = at(s)), s.read();
1999
+ if (D.getShared && (vt(), i = K[e & 8191], i))
2000
+ return i.read || (i.read = at(i)), i.read();
2001
2001
  }
2002
2002
  }
2003
2003
  let n = W[e];
2004
2004
  if (n)
2005
2005
  return n.handlesRead ? n(L) : n(L());
2006
2006
  {
2007
- let s = L();
2007
+ let i = L();
2008
2008
  for (let o = 0; o < ft.length; o++) {
2009
- let i = ft[o](e, s);
2010
- if (i !== void 0)
2011
- return i;
2009
+ let s = ft[o](e, i);
2010
+ if (s !== void 0)
2011
+ return s;
2012
2012
  }
2013
- return new xe(s, e);
2013
+ return new xe(i, e);
2014
2014
  }
2015
2015
  case 7:
2016
2016
  switch (e) {
@@ -2024,15 +2024,15 @@ function L() {
2024
2024
  return;
2025
2025
  case 31:
2026
2026
  default:
2027
- let s = (Q || ye())[e];
2028
- if (s !== void 0)
2029
- return s;
2027
+ let i = (Q || ye())[e];
2028
+ if (i !== void 0)
2029
+ return i;
2030
2030
  throw new Error("Unknown token " + e);
2031
2031
  }
2032
2032
  default:
2033
2033
  if (isNaN(e)) {
2034
- let s = new Error("Unexpected end of CBOR data");
2035
- throw s.incomplete = !0, s;
2034
+ let i = new Error("Unexpected end of CBOR data");
2035
+ throw i.incomplete = !0, i;
2036
2036
  }
2037
2037
  throw new Error("Unknown CBOR token " + e);
2038
2038
  }
@@ -2064,13 +2064,13 @@ function at(e) {
2064
2064
  }
2065
2065
  if (this.slowReads++ >= ir) {
2066
2066
  let o = this.length == r ? this : this.slice(0, r);
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);
2067
+ return n = D.keyMap ? new Function("r", "return {" + o.map((s) => D.decodeKey(s)).map((s) => Mt.test(s) ? se(s) + ":r()" : "[" + JSON.stringify(s) + "]:r()").join(",") + "}") : new Function("r", "return {" + o.map((s) => Mt.test(s) ? se(s) + ":r()" : "[" + JSON.stringify(s) + "]:r()").join(",") + "}"), this.compiledReader && (n.next = this.compiledReader), n.propertyCount = r, this.compiledReader = n, n(L);
2068
2068
  }
2069
- let s = {};
2070
- if (D.keyMap) for (let o = 0; o < r; o++) s[se(D.decodeKey(this[o]))] = L();
2069
+ let i = {};
2070
+ if (D.keyMap) for (let o = 0; o < r; o++) i[se(D.decodeKey(this[o]))] = L();
2071
2071
  else for (let o = 0; o < r; o++)
2072
- s[se(this[o])] = L();
2073
- return s;
2072
+ i[se(this[o])] = L();
2073
+ return i;
2074
2074
  }
2075
2075
  return e.slowReads = 0, t;
2076
2076
  }
@@ -2089,21 +2089,21 @@ function ct(e) {
2089
2089
  return ot.decode(O.subarray(w, w += e));
2090
2090
  const r = w + e, n = [];
2091
2091
  for (t = ""; w < r; ) {
2092
- const s = O[w++];
2093
- if (!(s & 128))
2094
- n.push(s);
2095
- else if ((s & 224) === 192) {
2092
+ const i = O[w++];
2093
+ if (!(i & 128))
2094
+ n.push(i);
2095
+ else if ((i & 224) === 192) {
2096
2096
  const o = O[w++] & 63;
2097
- n.push((s & 31) << 6 | o);
2098
- } else if ((s & 240) === 224) {
2099
- const o = O[w++] & 63, i = O[w++] & 63;
2100
- n.push((s & 31) << 12 | o << 6 | i);
2101
- } else if ((s & 248) === 240) {
2102
- const o = O[w++] & 63, i = O[w++] & 63, c = O[w++] & 63;
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);
2097
+ n.push((i & 31) << 6 | o);
2098
+ } else if ((i & 240) === 224) {
2099
+ const o = O[w++] & 63, s = O[w++] & 63;
2100
+ n.push((i & 31) << 12 | o << 6 | s);
2101
+ } else if ((i & 248) === 240) {
2102
+ const o = O[w++] & 63, s = O[w++] & 63, f = O[w++] & 63;
2103
+ let a = (i & 7) << 18 | o << 12 | s << 6 | f;
2104
+ a > 65535 && (a -= 65536, n.push(a >>> 10 & 1023 | 55296), a = 56320 | a & 1023), n.push(a);
2105
2105
  } else
2106
- n.push(s);
2106
+ n.push(i);
2107
2107
  n.length >= 4096 && (t += X.apply(String, n), n.length = 0);
2108
2108
  }
2109
2109
  return n.length > 0 && (t += X.apply(String, n)), t;
@@ -2112,12 +2112,12 @@ let X = String.fromCharCode;
2112
2112
  function un(e) {
2113
2113
  let t = w, r = new Array(e);
2114
2114
  for (let n = 0; n < e; n++) {
2115
- const s = O[w++];
2116
- if ((s & 128) > 0) {
2115
+ const i = O[w++];
2116
+ if ((i & 128) > 0) {
2117
2117
  w = t;
2118
2118
  return;
2119
2119
  }
2120
- r[n] = s;
2120
+ r[n] = i;
2121
2121
  }
2122
2122
  return X.apply(String, r);
2123
2123
  }
@@ -2150,52 +2150,52 @@ function or(e) {
2150
2150
  return X(t, r, n);
2151
2151
  }
2152
2152
  else {
2153
- let t = O[w++], r = O[w++], n = O[w++], s = O[w++];
2154
- if ((t & 128) > 0 || (r & 128) > 0 || (n & 128) > 0 || (s & 128) > 0) {
2153
+ let t = O[w++], r = O[w++], n = O[w++], i = O[w++];
2154
+ if ((t & 128) > 0 || (r & 128) > 0 || (n & 128) > 0 || (i & 128) > 0) {
2155
2155
  w -= 4;
2156
2156
  return;
2157
2157
  }
2158
2158
  if (e < 6) {
2159
2159
  if (e === 4)
2160
- return X(t, r, n, s);
2160
+ return X(t, r, n, i);
2161
2161
  {
2162
2162
  let o = O[w++];
2163
2163
  if ((o & 128) > 0) {
2164
2164
  w -= 5;
2165
2165
  return;
2166
2166
  }
2167
- return X(t, r, n, s, o);
2167
+ return X(t, r, n, i, o);
2168
2168
  }
2169
2169
  } else if (e < 8) {
2170
- let o = O[w++], i = O[w++];
2171
- if ((o & 128) > 0 || (i & 128) > 0) {
2170
+ let o = O[w++], s = O[w++];
2171
+ if ((o & 128) > 0 || (s & 128) > 0) {
2172
2172
  w -= 6;
2173
2173
  return;
2174
2174
  }
2175
2175
  if (e < 7)
2176
- return X(t, r, n, s, o, i);
2177
- let c = O[w++];
2178
- if ((c & 128) > 0) {
2176
+ return X(t, r, n, i, o, s);
2177
+ let f = O[w++];
2178
+ if ((f & 128) > 0) {
2179
2179
  w -= 7;
2180
2180
  return;
2181
2181
  }
2182
- return X(t, r, n, s, o, i, c);
2182
+ return X(t, r, n, i, o, s, f);
2183
2183
  } else {
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) {
2184
+ let o = O[w++], s = O[w++], f = O[w++], a = O[w++];
2185
+ if ((o & 128) > 0 || (s & 128) > 0 || (f & 128) > 0 || (a & 128) > 0) {
2186
2186
  w -= 8;
2187
2187
  return;
2188
2188
  }
2189
2189
  if (e < 10) {
2190
2190
  if (e === 8)
2191
- return X(t, r, n, s, o, i, c, f);
2191
+ return X(t, r, n, i, o, s, f, a);
2192
2192
  {
2193
2193
  let p = O[w++];
2194
2194
  if ((p & 128) > 0) {
2195
2195
  w -= 9;
2196
2196
  return;
2197
2197
  }
2198
- return X(t, r, n, s, o, i, c, f, p);
2198
+ return X(t, r, n, i, o, s, f, a, p);
2199
2199
  }
2200
2200
  } else if (e < 12) {
2201
2201
  let p = O[w++], d = O[w++];
@@ -2204,13 +2204,13 @@ function or(e) {
2204
2204
  return;
2205
2205
  }
2206
2206
  if (e < 11)
2207
- return X(t, r, n, s, o, i, c, f, p, d);
2207
+ return X(t, r, n, i, o, s, f, a, p, d);
2208
2208
  let h = O[w++];
2209
2209
  if ((h & 128) > 0) {
2210
2210
  w -= 11;
2211
2211
  return;
2212
2212
  }
2213
- return X(t, r, n, s, o, i, c, f, p, d, h);
2213
+ return X(t, r, n, i, o, s, f, a, p, d, h);
2214
2214
  } else {
2215
2215
  let p = O[w++], d = O[w++], h = O[w++], g = O[w++];
2216
2216
  if ((p & 128) > 0 || (d & 128) > 0 || (h & 128) > 0 || (g & 128) > 0) {
@@ -2219,14 +2219,14 @@ function or(e) {
2219
2219
  }
2220
2220
  if (e < 14) {
2221
2221
  if (e === 12)
2222
- return X(t, r, n, s, o, i, c, f, p, d, h, g);
2222
+ return X(t, r, n, i, o, s, f, a, p, d, h, g);
2223
2223
  {
2224
2224
  let u = O[w++];
2225
2225
  if ((u & 128) > 0) {
2226
2226
  w -= 13;
2227
2227
  return;
2228
2228
  }
2229
- return X(t, r, n, s, o, i, c, f, p, d, h, g, u);
2229
+ return X(t, r, n, i, o, s, f, a, p, d, h, g, u);
2230
2230
  }
2231
2231
  } else {
2232
2232
  let u = O[w++], b = O[w++];
@@ -2235,13 +2235,13 @@ function or(e) {
2235
2235
  return;
2236
2236
  }
2237
2237
  if (e < 15)
2238
- return X(t, r, n, s, o, i, c, f, p, d, h, g, u, b);
2238
+ return X(t, r, n, i, o, s, f, a, p, d, h, g, u, b);
2239
2239
  let x = O[w++];
2240
2240
  if ((x & 128) > 0) {
2241
2241
  w -= 15;
2242
2242
  return;
2243
2243
  }
2244
- return X(t, r, n, s, o, i, c, f, p, d, h, g, u, b, x);
2244
+ return X(t, r, n, i, o, s, f, a, p, d, h, g, u, b, x);
2245
2245
  }
2246
2246
  }
2247
2247
  }
@@ -2292,9 +2292,9 @@ W[fn] = (e) => {
2292
2292
  let t = e.length, r = e[1];
2293
2293
  lt(e[0], r);
2294
2294
  let n = {};
2295
- for (let s = 2; s < t; s++) {
2296
- let o = r[s - 2];
2297
- n[se(o)] = e[s];
2295
+ for (let i = 2; i < t; i++) {
2296
+ let o = r[i - 2];
2297
+ n[se(o)] = e[i];
2298
2298
  }
2299
2299
  return n;
2300
2300
  };
@@ -2329,12 +2329,12 @@ W[kt] = (e) => {
2329
2329
  };
2330
2330
  W[28] = (e) => {
2331
2331
  ne || (ne = /* @__PURE__ */ new Map(), ne.id = 0);
2332
- let t = ne.id++, r = w, n = O[w], s;
2333
- n >> 5 == 4 ? s = [] : s = {};
2334
- let o = { target: s };
2332
+ let t = ne.id++, r = w, n = O[w], i;
2333
+ n >> 5 == 4 ? i = [] : i = {};
2334
+ let o = { target: i };
2335
2335
  ne.set(t, o);
2336
- let i = e();
2337
- return o.used ? (Object.getPrototypeOf(s) !== Object.getPrototypeOf(i) && (w = r, s = i, ne.set(t, { target: s }), i = e()), Object.assign(s, i)) : (o.target = i, i);
2336
+ let s = e();
2337
+ return o.used ? (Object.getPrototypeOf(i) !== Object.getPrototypeOf(s) && (w = r, i = s, ne.set(t, { target: i }), s = e()), Object.assign(i, s)) : (o.target = s, s);
2338
2338
  };
2339
2339
  W[28].handlesRead = !0;
2340
2340
  W[29] = (e) => {
@@ -2395,20 +2395,20 @@ for (let e = 0; e < Rt.length; e++)
2395
2395
  function xn(e, t) {
2396
2396
  let r = "get" + e.name.slice(0, -5), n;
2397
2397
  typeof e == "function" ? n = e.BYTES_PER_ELEMENT : e = null;
2398
- for (let s = 0; s < 2; s++) {
2399
- if (!s && n == 1)
2398
+ for (let i = 0; i < 2; i++) {
2399
+ if (!i && n == 1)
2400
2400
  continue;
2401
2401
  let o = n == 2 ? 1 : n == 4 ? 2 : n == 8 ? 3 : 0;
2402
- W[s ? t : t - 4] = n == 1 || s == bn ? (i) => {
2402
+ W[i ? t : t - 4] = n == 1 || i == bn ? (s) => {
2403
2403
  if (!e)
2404
2404
  throw new Error("Could not find typed array for code " + t);
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);
2406
- } : (i) => {
2405
+ return !D.copyBuffers && (n === 1 || n === 2 && !(s.byteOffset & 1) || n === 4 && !(s.byteOffset & 3) || n === 8 && !(s.byteOffset & 7)) ? new e(s.buffer, s.byteOffset, s.byteLength >> o) : new e(Uint8Array.prototype.slice.call(s, 0).buffer);
2406
+ } : (s) => {
2407
2407
  if (!e)
2408
2408
  throw new Error("Could not find typed array for code " + t);
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++)
2411
- p[h] = d.call(c, h << o, s);
2409
+ let f = new DataView(s.buffer, s.byteOffset, s.byteLength), a = s.length >> o, p = new e(a), d = f[r];
2410
+ for (let h = 0; h < a; h++)
2411
+ p[h] = d.call(f, h << o, i);
2412
2412
  return p;
2413
2413
  };
2414
2414
  }
@@ -2416,8 +2416,8 @@ function xn(e, t) {
2416
2416
  function wn() {
2417
2417
  let e = Se(), t = w + L();
2418
2418
  for (let n = 2; n < e; n++) {
2419
- let s = Se();
2420
- w += s;
2419
+ let i = Se();
2420
+ w += i;
2421
2421
  }
2422
2422
  let r = w;
2423
2423
  return w = t, G = [ct(Se()), ct(Se())], G.position0 = 0, G.position1 = 0, G.postBundlePosition = w, w = r, L();
@@ -2445,8 +2445,8 @@ function vt() {
2445
2445
  }
2446
2446
  }
2447
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;
2448
+ let t = ge, r = w, n = $e, i = Fe, o = Ne, s = ne, f = G, a = new Uint8Array(O.slice(0, ge)), p = K, d = D, h = ke, g = e();
2449
+ return ge = t, w = r, $e = n, Fe = i, Ne = o, ne = s, G = f, O = a, ke = h, K = p, D = d, Y = new DataView(O.buffer, O.byteOffset, O.byteLength), g;
2450
2450
  }
2451
2451
  function ut() {
2452
2452
  O = null, ne = null, K = null;
@@ -2464,18 +2464,18 @@ try {
2464
2464
  }
2465
2465
  let ht, lr;
2466
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;
2467
+ let tt, y, H, c = 0, he, J = null;
2468
2468
  const mn = 61440, Sn = /[\u0080-\uFFFF]/, ee = Symbol("record-id");
2469
2469
  class vn extends je {
2470
2470
  constructor(t) {
2471
2471
  super(t), this.offset = 0;
2472
- let r, n, s, o, i;
2472
+ let r, n, i, o, s;
2473
2473
  t = t || {};
2474
- let c = Bt.prototype.utf8Write ? function(l, _, m) {
2474
+ let f = Bt.prototype.utf8Write ? function(l, _, m) {
2475
2475
  return y.utf8Write(l, _, m);
2476
2476
  } : Te && Te.encodeInto ? function(l, _) {
2477
2477
  return Te.encodeInto(l, y.subarray(_)).written;
2478
- } : !1, f = this, p = t.structures || t.saveStructures, d = t.maxSharedStructures;
2478
+ } : !1, a = this, p = t.structures || t.saveStructures, d = t.maxSharedStructures;
2479
2479
  if (d == null && (d = p ? 128 : 0), d > 8190)
2480
2480
  throw new Error("Maximum maxSharedStructure is 8190");
2481
2481
  let h = t.sequential;
@@ -2496,11 +2496,11 @@ class vn extends je {
2496
2496
  }
2497
2497
  return this.encode(l, _);
2498
2498
  }, this.encode = function(l, _) {
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) {
2499
+ if (y || (y = new et(8192), H = new DataView(y.buffer, 0, 8192), c = 0), he = y.length - 10, he - c < 2048 ? (y = new et(y.length), H = new DataView(y.buffer, 0, y.length), he = y.length - 10, c = 0) : _ === Vt && (c = c + 7 & 2147483640), r = c, a.useSelfDescribedHeader && (H.setUint32(c, 3654940416), c += 3), s = a.structuredClone ? /* @__PURE__ */ new Map() : null, a.bundleStrings && typeof l != "string" ? (J = [], J.size = 1 / 0) : J = null, n = a.structures, n) {
2500
2500
  if (n.uninitialized) {
2501
- let A = f.getShared() || {};
2502
- f.structures = n = A.structures || [], f.sharedVersion = A.version;
2503
- let S = f.sharedValues = A.packedValues;
2501
+ let A = a.getShared() || {};
2502
+ a.structures = n = A.structures || [], a.sharedVersion = A.version;
2503
+ let S = a.sharedValues = A.packedValues;
2504
2504
  if (S) {
2505
2505
  x = {};
2506
2506
  for (let k = 0, j = S.length; k < j; k++)
@@ -2525,10 +2525,10 @@ class vn extends je {
2525
2525
  }
2526
2526
  h || (n.nextId = m);
2527
2527
  }
2528
- if (s && (s = !1), o = n || [], u = x, t.pack) {
2528
+ if (i && (i = !1), o = n || [], u = x, t.pack) {
2529
2529
  let m = /* @__PURE__ */ new Map();
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);
2530
+ if (m.values = [], m.encoder = a, m.maxValues = t.maxPrivatePackedValues || (x ? 16 : 1 / 0), m.objectMap = x || !1, m.samplingPackedValues = g, De(l, m), m.values.length > 0) {
2531
+ y[c++] = 216, y[c++] = 51, fe(4);
2532
2532
  let A = m.values;
2533
2533
  v(A), fe(0), fe(0), u = Object.create(x || null);
2534
2534
  for (let S = 0, k = A.length; S < k; S++)
@@ -2539,12 +2539,12 @@ class vn extends je {
2539
2539
  try {
2540
2540
  if (tt)
2541
2541
  return;
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);
2545
- return i = null, m;
2542
+ if (v(l), J && Lt(r, v), a.offset = c, s && s.idsToInsert) {
2543
+ c += s.idsToInsert.length * 2, c > he && M(c), a.offset = c;
2544
+ let m = En(y.subarray(r, c), s.idsToInsert);
2545
+ return s = null, m;
2546
2546
  }
2547
- return _ & Vt ? (y.start = r, y.end = a, y) : y.subarray(r, a);
2547
+ return _ & Vt ? (y.start = r, y.end = c, y) : y.subarray(r, c);
2548
2548
  } finally {
2549
2549
  if (n) {
2550
2550
  if (U < 10 && U++, n.length > d && (n.length = d), I > 1e4)
@@ -2555,30 +2555,30 @@ class vn extends je {
2555
2555
  C = [];
2556
2556
  }
2557
2557
  }
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;
2558
+ if (i && a.saveShared) {
2559
+ a.structures.length > d && (a.structures = a.structures.slice(0, d));
2560
+ let m = y.subarray(r, c);
2561
+ return a.updateSharedData() === !1 ? a.encode(l) : m;
2562
2562
  }
2563
- _ & _n && (a = r);
2563
+ _ & _n && (c = r);
2564
2564
  }
2565
2565
  }, this.findCommonStringsToPack = () => (g = /* @__PURE__ */ new Map(), x || (x = /* @__PURE__ */ Object.create(null)), (l) => {
2566
2566
  let _ = l && l.threshold || 4, m = this.pack ? l.maxPrivatePackedValues || 16 : 0;
2567
2567
  b || (b = this.sharedValues = []);
2568
2568
  for (let [A, S] of g)
2569
- S.count > _ && (x[A] = m++, b.push(A), s = !0);
2569
+ S.count > _ && (x[A] = m++, b.push(A), i = !0);
2570
2570
  for (; this.saveShared && this.updateSharedData() === !1; )
2571
2571
  ;
2572
2572
  g = null;
2573
2573
  });
2574
2574
  const v = (l) => {
2575
- a > he && (y = M(a));
2575
+ c > he && (y = M(c));
2576
2576
  var _ = typeof l, m;
2577
2577
  if (_ === "string") {
2578
2578
  if (u) {
2579
2579
  let j = u[l];
2580
2580
  if (j >= 0) {
2581
- j < 16 ? y[a++] = j + 224 : (y[a++] = 198, j & 1 ? v(15 - j >> 1) : v(j - 16 >> 1));
2581
+ j < 16 ? y[c++] = j + 224 : (y[c++] = 198, j & 1 ? v(15 - j >> 1) : v(j - 16 >> 1));
2582
2582
  return;
2583
2583
  } else if (g && !t.pack) {
2584
2584
  let R = g.get(l);
@@ -2591,69 +2591,69 @@ class vn extends je {
2591
2591
  if (J && A >= 4 && A < 1024) {
2592
2592
  if ((J.size += A) > mn) {
2593
2593
  let R, T = (J[0] ? J[0].length * 3 + J[1].length : 0) + 10;
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;
2594
+ c + T > he && (y = M(c + T)), y[c++] = 217, y[c++] = 223, y[c++] = 249, y[c++] = J.position ? 132 : 130, y[c++] = 26, R = c - r, c += 4, J.position && Lt(r, v), J = ["", ""], J.size = 0, J.position = R;
2595
2595
  }
2596
2596
  let j = Sn.test(l);
2597
- J[j ? 0 : 1] += l, y[a++] = j ? 206 : 207, v(A);
2597
+ J[j ? 0 : 1] += l, y[c++] = j ? 206 : 207, v(A);
2598
2598
  return;
2599
2599
  }
2600
2600
  let S;
2601
2601
  A < 32 ? S = 1 : A < 256 ? S = 2 : A < 65536 ? S = 3 : S = 5;
2602
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;
2603
+ if (c + k > he && (y = M(c + k)), A < 64 || !f) {
2604
+ let j, R, T, V = c + S;
2605
2605
  for (j = 0; j < A; j++)
2606
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;
2607
+ m = V - c - S;
2608
2608
  } else
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;
2609
+ m = f(l, c + S, k);
2610
+ m < 24 ? y[c++] = 96 | m : m < 256 ? (S < 2 && y.copyWithin(c + 2, c + 1, c + 1 + m), y[c++] = 120, y[c++] = m) : m < 65536 ? (S < 3 && y.copyWithin(c + 3, c + 2, c + 2 + m), y[c++] = 121, y[c++] = m >> 8, y[c++] = m & 255) : (S < 5 && y.copyWithin(c + 5, c + 3, c + 3 + m), y[c++] = 122, H.setUint32(c, m), c += 4), c += m;
2611
2611
  } else if (_ === "number")
2612
2612
  if (!this.alwaysUseFloat && l >>> 0 === l)
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);
2613
+ l < 24 ? y[c++] = l : l < 256 ? (y[c++] = 24, y[c++] = l) : l < 65536 ? (y[c++] = 25, y[c++] = l >> 8, y[c++] = l & 255) : (y[c++] = 26, H.setUint32(c, l), c += 4);
2614
2614
  else if (!this.alwaysUseFloat && l >> 0 === l)
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);
2615
+ l >= -24 ? y[c++] = 31 - l : l >= -256 ? (y[c++] = 56, y[c++] = ~l) : l >= -65536 ? (y[c++] = 57, H.setUint16(c, ~l), c += 2) : (y[c++] = 58, H.setUint32(c, ~l), c += 4);
2616
2616
  else {
2617
2617
  let A;
2618
2618
  if ((A = this.useFloat32) > 0 && l < 4294967296 && l >= -2147483648) {
2619
- y[a++] = 250, H.setFloat32(a, l);
2619
+ y[c++] = 250, H.setFloat32(c, l);
2620
2620
  let S;
2621
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;
2622
+ (S = l * At[(y[c] & 127) << 1 | y[c + 1] >> 7]) >> 0 === S) {
2623
+ c += 4;
2624
2624
  return;
2625
2625
  } else
2626
- a--;
2626
+ c--;
2627
2627
  }
2628
- y[a++] = 251, H.setFloat64(a, l), a += 8;
2628
+ y[c++] = 251, H.setFloat64(c, l), c += 8;
2629
2629
  }
2630
2630
  else if (_ === "object")
2631
2631
  if (!l)
2632
- y[a++] = 246;
2632
+ y[c++] = 246;
2633
2633
  else {
2634
- if (i) {
2635
- let S = i.get(l);
2634
+ if (s) {
2635
+ let S = s.get(l);
2636
2636
  if (S) {
2637
- if (y[a++] = 216, y[a++] = 29, y[a++] = 25, !S.references) {
2638
- let k = i.idsToInsert || (i.idsToInsert = []);
2637
+ if (y[c++] = 216, y[c++] = 29, y[c++] = 25, !S.references) {
2638
+ let k = s.idsToInsert || (s.idsToInsert = []);
2639
2639
  S.references = [], k.push(S);
2640
2640
  }
2641
- S.references.push(a - r), a += 2;
2641
+ S.references.push(c - r), c += 2;
2642
2642
  return;
2643
2643
  } else
2644
- i.set(l, { offset: a - r });
2644
+ s.set(l, { offset: c - r });
2645
2645
  }
2646
2646
  let A = l.constructor;
2647
2647
  if (A === Object)
2648
2648
  B(l);
2649
2649
  else if (A === Array) {
2650
- m = l.length, m < 24 ? y[a++] = 128 | m : fe(m);
2650
+ m = l.length, m < 24 ? y[c++] = 128 | m : fe(m);
2651
2651
  for (let S = 0; S < m; S++)
2652
2652
  v(l[S]);
2653
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)
2654
+ if ((this.mapsAsObjects ? this.useTag259ForMaps !== !1 : this.useTag259ForMaps) && (y[c++] = 217, y[c++] = 1, y[c++] = 3), m = l.size, m < 24 ? y[c++] = 160 | m : m < 256 ? (y[c++] = 184, y[c++] = m) : m < 65536 ? (y[c++] = 185, y[c++] = m >> 8, y[c++] = m & 255) : (y[c++] = 186, H.setUint32(c, m), c += 4), a.keyMap)
2655
2655
  for (let [S, k] of l)
2656
- v(f.encodeKey(S)), v(k);
2656
+ v(a.encodeKey(S)), v(k);
2657
2657
  else
2658
2658
  for (let [S, k] of l)
2659
2659
  v(S), v(k);
@@ -2662,7 +2662,7 @@ class vn extends je {
2662
2662
  let j = lr[S];
2663
2663
  if (l instanceof j) {
2664
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);
2665
+ T == null && (T = R.getTag && R.getTag.call(this, l)), T < 24 ? y[c++] = 192 | T : T < 256 ? (y[c++] = 216, y[c++] = T) : T < 65536 ? (y[c++] = 217, y[c++] = T >> 8, y[c++] = T & 255) : T > -1 && (y[c++] = 218, H.setUint32(c, T), c += 4), R.encode.call(this, l, v, M);
2666
2666
  return;
2667
2667
  }
2668
2668
  }
@@ -2671,10 +2671,10 @@ class vn extends je {
2671
2671
  let S = new Error("Iterable should be serialized as iterator");
2672
2672
  throw S.iteratorNotHandled = !0, S;
2673
2673
  }
2674
- y[a++] = 159;
2674
+ y[c++] = 159;
2675
2675
  for (let S of l)
2676
2676
  v(S);
2677
- y[a++] = 255;
2677
+ y[c++] = 255;
2678
2678
  return;
2679
2679
  }
2680
2680
  if (l[Symbol.asyncIterator] || rt(l)) {
@@ -2690,42 +2690,42 @@ class vn extends je {
2690
2690
  }
2691
2691
  }
2692
2692
  else if (_ === "boolean")
2693
- y[a++] = l ? 245 : 244;
2693
+ y[c++] = l ? 245 : 244;
2694
2694
  else if (_ === "bigint") {
2695
2695
  if (l < BigInt(1) << BigInt(64) && l >= 0)
2696
- y[a++] = 27, H.setBigUint64(a, l);
2696
+ y[c++] = 27, H.setBigUint64(c, l);
2697
2697
  else if (l > -(BigInt(1) << BigInt(64)) && l < 0)
2698
- y[a++] = 59, H.setBigUint64(a, -l - BigInt(1));
2698
+ y[c++] = 59, H.setBigUint64(c, -l - BigInt(1));
2699
2699
  else if (this.largeBigIntToFloat)
2700
- y[a++] = 251, H.setFloat64(a, Number(l));
2700
+ y[c++] = 251, H.setFloat64(c, Number(l));
2701
2701
  else {
2702
- l >= BigInt(0) ? y[a++] = 194 : (y[a++] = 195, l = BigInt(-1) - l);
2702
+ l >= BigInt(0) ? y[c++] = 194 : (y[c++] = 195, l = BigInt(-1) - l);
2703
2703
  let A = [];
2704
2704
  for (; l; )
2705
2705
  A.push(Number(l & BigInt(255))), l >>= BigInt(8);
2706
2706
  dt(new Uint8Array(A.reverse()), M);
2707
2707
  return;
2708
2708
  }
2709
- a += 8;
2709
+ c += 8;
2710
2710
  } else if (_ === "undefined")
2711
- y[a++] = 247;
2711
+ y[c++] = 247;
2712
2712
  else
2713
2713
  throw new Error("Unknown type: " + _);
2714
2714
  }, B = this.useRecords === !1 ? this.variableMapSize ? (l) => {
2715
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)
2716
+ if (A < 24 ? y[c++] = 160 | A : A < 256 ? (y[c++] = 184, y[c++] = A) : A < 65536 ? (y[c++] = 185, y[c++] = A >> 8, y[c++] = A & 255) : (y[c++] = 186, H.setUint32(c, A), c += 4), a.keyMap)
2717
2717
  for (let S = 0; S < A; S++)
2718
- v(f.encodeKey(_[S])), v(m[S]);
2718
+ v(a.encodeKey(_[S])), v(m[S]);
2719
2719
  else
2720
2720
  for (let S = 0; S < A; S++)
2721
2721
  v(_[S]), v(m[S]);
2722
2722
  } : (l) => {
2723
- y[a++] = 185;
2724
- let _ = a - r;
2725
- a += 2;
2723
+ y[c++] = 185;
2724
+ let _ = c - r;
2725
+ c += 2;
2726
2726
  let m = 0;
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++);
2727
+ if (a.keyMap)
2728
+ for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(a.encodeKey(A)), v(l[A]), m++);
2729
2729
  else
2730
2730
  for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(A), v(l[A]), m++);
2731
2731
  y[_++ + r] = m >> 8, y[_ + r] = m & 255;
@@ -2741,19 +2741,19 @@ class vn extends je {
2741
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
2742
  let T = A[ee];
2743
2743
  if (T !== void 0)
2744
- T &= 65535, y[a++] = 217, y[a++] = T >> 8 | 224, y[a++] = T & 255;
2744
+ T &= 65535, y[c++] = 217, y[c++] = T >> 8 | 224, y[c++] = T & 255;
2745
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;
2746
+ y[c++] = 217, y[c++] = T >> 8 | 224, y[c++] = T & 255, A = o.transitions;
2747
2747
  for (let V = 0; V < k; V++)
2748
2748
  (A[ee] === void 0 || A[ee] & 1048576) && (A[ee] = T), A = A[R[V]];
2749
- A[ee] = T | 1048576, s = !0;
2749
+ A[ee] = T | 1048576, i = !0;
2750
2750
  } else {
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;
2751
+ if (A[ee] = T, H.setUint32(c, 3655335680), c += 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;
2752
2752
  for (let V in l)
2753
2753
  (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && v(l[V]);
2754
2754
  return;
2755
2755
  }
2756
- if (k < 24 ? y[a++] = 128 | k : fe(k), !_)
2756
+ if (k < 24 ? y[c++] = 128 | k : fe(k), !_)
2757
2757
  for (let V in l)
2758
2758
  (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && v(l[V]);
2759
2759
  }, M = (l) => {
@@ -2768,7 +2768,7 @@ class vn extends je {
2768
2768
  } else
2769
2769
  _ = (Math.max(l - r << 2, y.length - 1) >> 12) + 1 << 12;
2770
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;
2771
+ return H = new DataView(m.buffer, 0, _), y.copy ? y.copy(m, 0, r, l) : m.set(y.slice(r, l)), c -= r, r = 0, he = m.length - 10, y = m;
2772
2772
  };
2773
2773
  let F = 100, N = 1e3;
2774
2774
  this.encodeAsIterable = function(l, _) {
@@ -2779,7 +2779,7 @@ class vn extends je {
2779
2779
  function* P(l, _, m) {
2780
2780
  let A = l.constructor;
2781
2781
  if (A === Object) {
2782
- let S = f.useRecords !== !1;
2782
+ let S = a.useRecords !== !1;
2783
2783
  S ? B(l, !0) : Pt(Object.keys(l).length, 160);
2784
2784
  for (let k in l) {
2785
2785
  let j = l[k];
@@ -2790,31 +2790,31 @@ class vn extends je {
2790
2790
  fe(S);
2791
2791
  for (let k = 0; k < S; k++) {
2792
2792
  let j = l[k];
2793
- j && (typeof j == "object" || a - r > F) ? _.element ? yield* P(j, _.element) : yield* z(j, _, "element") : v(j);
2793
+ j && (typeof j == "object" || c - r > F) ? _.element ? yield* P(j, _.element) : yield* z(j, _, "element") : v(j);
2794
2794
  }
2795
2795
  } else if (l[Symbol.iterator] && !l.buffer) {
2796
- y[a++] = 159;
2796
+ y[c++] = 159;
2797
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), $());
2798
+ S && (typeof S == "object" || c - r > F) ? _.element ? yield* P(S, _.element) : yield* z(S, _, "element") : v(S);
2799
+ y[c++] = 255;
2800
+ } else rt(l) ? (Pt(l.size, 64), yield y.subarray(r, c), yield l, $()) : l[Symbol.asyncIterator] ? (y[c++] = 159, yield y.subarray(r, c), yield l, $(), y[c++] = 255) : v(l);
2801
+ m && c > r ? yield y.subarray(r, c) : c - r > F && (yield y.subarray(r, c), $());
2802
2802
  }
2803
2803
  function* z(l, _, m) {
2804
- let A = a - r;
2804
+ let A = c - r;
2805
2805
  try {
2806
- v(l), a - r > F && (yield y.subarray(r, a), $());
2806
+ v(l), c - r > F && (yield y.subarray(r, c), $());
2807
2807
  } catch (S) {
2808
2808
  if (S.iteratorNotHandled)
2809
- _[m] = {}, a = r + A, yield* P.call(this, l, _[m]);
2809
+ _[m] = {}, c = r + A, yield* P.call(this, l, _[m]);
2810
2810
  else throw S;
2811
2811
  }
2812
2812
  }
2813
2813
  function $() {
2814
- F = N, f.encode(null, nt);
2814
+ F = N, a.encode(null, nt);
2815
2815
  }
2816
2816
  function ie(l, _, m) {
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)];
2817
+ return _ && _.chunkThreshold ? F = N = _.chunkThreshold : F = 100, l && typeof l == "object" ? (a.encode(null, nt), m(l, a.iterateProperties || (a.iterateProperties = {}), !0)) : [a.encode(l)];
2818
2818
  }
2819
2819
  async function* E(l, _) {
2820
2820
  for (let m of P(l, _, !0)) {
@@ -2827,14 +2827,14 @@ class vn extends je {
2827
2827
  yield k.value;
2828
2828
  } else if (m[Symbol.asyncIterator])
2829
2829
  for await (let S of m)
2830
- $(), S ? yield* E(S, _.async || (_.async = {})) : yield f.encode(S);
2830
+ $(), S ? yield* E(S, _.async || (_.async = {})) : yield a.encode(S);
2831
2831
  else
2832
2832
  yield m;
2833
2833
  }
2834
2834
  }
2835
2835
  }
2836
2836
  useBuffer(t) {
2837
- y = t, H = new DataView(y.buffer, y.byteOffset, y.byteLength), a = 0;
2837
+ y = t, H = new DataView(y.buffer, y.byteOffset, y.byteLength), c = 0;
2838
2838
  }
2839
2839
  clearSharedData() {
2840
2840
  this.structures && (this.structures = []), this.sharedValues && (this.sharedValues = void 0);
@@ -2842,15 +2842,15 @@ class vn extends je {
2842
2842
  updateSharedData() {
2843
2843
  let t = this.sharedVersion || 0;
2844
2844
  this.sharedVersion = t + 1;
2845
- let r = this.structures.slice(0), n = new ur(r, this.sharedValues, this.sharedVersion), s = this.saveShared(
2845
+ let r = this.structures.slice(0), n = new ur(r, this.sharedValues, this.sharedVersion), i = this.saveShared(
2846
2846
  n,
2847
2847
  (o) => (o && o.version || 0) == t
2848
2848
  );
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;
2849
+ return i === !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, s) => this.structures[s] = o), i;
2850
2850
  }
2851
2851
  }
2852
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);
2853
+ e < 24 ? y[c++] = t | e : e < 256 ? (y[c++] = t | 24, y[c++] = e) : e < 65536 ? (y[c++] = t | 25, y[c++] = e >> 8, y[c++] = e & 255) : (y[c++] = t | 26, H.setUint32(c, e), c += 4);
2854
2854
  }
2855
2855
  class ur {
2856
2856
  constructor(t, r, n) {
@@ -2858,7 +2858,7 @@ class ur {
2858
2858
  }
2859
2859
  }
2860
2860
  function fe(e) {
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);
2861
+ e < 24 ? y[c++] = 128 | e : e < 256 ? (y[c++] = 152, y[c++] = e) : e < 65536 ? (y[c++] = 153, y[c++] = e >> 8, y[c++] = e & 255) : (y[c++] = 154, H.setUint32(c, e), c += 4);
2862
2862
  }
2863
2863
  const An = typeof Blob > "u" ? function() {
2864
2864
  } : Blob;
@@ -2880,8 +2880,8 @@ function De(e, t) {
2880
2880
  else if (t.set(e, {
2881
2881
  count: 1
2882
2882
  }), t.samplingPackedValues) {
2883
- let s = t.samplingPackedValues.get(e);
2884
- s ? s.count++ : t.samplingPackedValues.set(e, {
2883
+ let i = t.samplingPackedValues.get(e);
2884
+ i ? i.count++ : t.samplingPackedValues.set(e, {
2885
2885
  count: 1
2886
2886
  });
2887
2887
  }
@@ -2890,7 +2890,7 @@ function De(e, t) {
2890
2890
  case "object":
2891
2891
  if (e)
2892
2892
  if (e instanceof Array)
2893
- for (let n = 0, s = e.length; n < s; n++)
2893
+ for (let n = 0, i = e.length; n < i; n++)
2894
2894
  De(e[n], t);
2895
2895
  else {
2896
2896
  let n = !t.encoder.useRecords;
@@ -2931,7 +2931,7 @@ ht = [
2931
2931
  tag: 1,
2932
2932
  encode(e, t) {
2933
2933
  let r = e.getTime() / 1e3;
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);
2934
+ (this.useTimestamp32 || e.getMilliseconds() === 0) && r >= 0 && r < 4294967296 ? (y[c++] = 26, H.setUint32(c, r), c += 4) : (y[c++] = 251, H.setFloat64(c, r), c += 8);
2935
2935
  }
2936
2936
  },
2937
2937
  {
@@ -2998,16 +2998,16 @@ ht = [
2998
2998
  encode(e, t) {
2999
2999
  let r = e.packedValues || [], n = e.structures || [];
3000
3000
  if (r.values.length > 0) {
3001
- y[a++] = 216, y[a++] = 51, fe(4);
3002
- let s = r.values;
3003
- t(s), fe(0), fe(0), packedObjectMap = Object.create(sharedPackedObjectMap || null);
3004
- for (let o = 0, i = s.length; o < i; o++)
3005
- packedObjectMap[s[o]] = o;
3001
+ y[c++] = 216, y[c++] = 51, fe(4);
3002
+ let i = r.values;
3003
+ t(i), fe(0), fe(0), packedObjectMap = Object.create(sharedPackedObjectMap || null);
3004
+ for (let o = 0, s = i.length; o < s; o++)
3005
+ packedObjectMap[i[o]] = o;
3006
3006
  }
3007
3007
  if (n) {
3008
- H.setUint32(a, 3655335424), a += 3;
3009
- let s = n.slice(0);
3010
- s.unshift(57344), s.push(new xe(e.version, 1399353956)), t(s);
3008
+ H.setUint32(c, 3655335424), c += 3;
3009
+ let i = n.slice(0);
3010
+ i.unshift(57344), i.push(new xe(e.version, 1399353956)), t(i);
3011
3011
  } else
3012
3012
  t(new xe(e.version, 1399353956));
3013
3013
  }
@@ -3016,35 +3016,35 @@ ht = [
3016
3016
  function oe(e, t) {
3017
3017
  return !Cn && t > 1 && (e -= 4), {
3018
3018
  tag: e,
3019
- encode: function(n, s) {
3020
- let o = n.byteLength, i = n.byteOffset || 0, c = n.buffer || n;
3021
- s(Me ? Ge.from(c, i, o) : new Uint8Array(c, i, o));
3019
+ encode: function(n, i) {
3020
+ let o = n.byteLength, s = n.byteOffset || 0, f = n.buffer || n;
3021
+ i(Me ? Ge.from(f, s, o) : new Uint8Array(f, s, o));
3022
3022
  }
3023
3023
  };
3024
3024
  }
3025
3025
  function dt(e, t) {
3026
3026
  let r = e.byteLength;
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;
3027
+ r < 24 ? y[c++] = 64 + r : r < 256 ? (y[c++] = 88, y[c++] = r) : r < 65536 ? (y[c++] = 89, y[c++] = r >> 8, y[c++] = r & 255) : (y[c++] = 90, H.setUint32(c, r), c += 4), c + r >= y.length && t(c + r), y.set(e.buffer ? e : new Uint8Array(e), c), c += r;
3028
3028
  }
3029
3029
  function En(e, t) {
3030
- let r, n = t.length * 2, s = e.length - n;
3031
- t.sort((o, i) => o.offset > i.offset ? 1 : -1);
3030
+ let r, n = t.length * 2, i = e.length - n;
3031
+ t.sort((o, s) => o.offset > s.offset ? 1 : -1);
3032
3032
  for (let o = 0; o < t.length; o++) {
3033
- let i = t[o];
3034
- i.id = o;
3035
- for (let c of i.references)
3036
- e[c++] = o >> 8, e[c] = o & 255;
3033
+ let s = t[o];
3034
+ s.id = o;
3035
+ for (let f of s.references)
3036
+ e[f++] = o >> 8, e[f] = o & 255;
3037
3037
  }
3038
3038
  for (; r = t.pop(); ) {
3039
3039
  let o = r.offset;
3040
- e.copyWithin(o + n, o, s), n -= 2;
3041
- let i = o + n;
3042
- e[i++] = 216, e[i++] = 28, s = o;
3040
+ e.copyWithin(o + n, o, i), n -= 2;
3041
+ let s = o + n;
3042
+ e[s++] = 216, e[s++] = 28, i = o;
3043
3043
  }
3044
3044
  return e;
3045
3045
  }
3046
3046
  function Lt(e, t) {
3047
- H.setUint32(J.position + e, a - J.position - e + 1);
3047
+ H.setUint32(J.position + e, c - J.position - e + 1);
3048
3048
  let r = J;
3049
3049
  J = null, t(r[0]), t(r[1]);
3050
3050
  }
@@ -3058,10 +3058,10 @@ var On = { exports: {} };
3058
3058
  (function(t, r) {
3059
3059
  var n = {};
3060
3060
  r(n);
3061
- var s = n.default;
3061
+ var i = n.default;
3062
3062
  for (var o in n)
3063
- s[o] = n[o];
3064
- e.exports = s;
3063
+ i[o] = n[o];
3064
+ e.exports = i;
3065
3065
  })(Mr, function(t) {
3066
3066
  t.__esModule = !0, t.digestLength = 32, t.blockSize = 64;
3067
3067
  var r = new Uint32Array([
@@ -3142,7 +3142,7 @@ var On = { exports: {} };
3142
3142
  }
3143
3143
  return x;
3144
3144
  }
3145
- var s = (
3145
+ var i = (
3146
3146
  /** @class */
3147
3147
  function() {
3148
3148
  function g() {
@@ -3192,15 +3192,15 @@ var On = { exports: {} };
3192
3192
  }, g;
3193
3193
  }()
3194
3194
  );
3195
- t.Hash = s;
3195
+ t.Hash = i;
3196
3196
  var o = (
3197
3197
  /** @class */
3198
3198
  function() {
3199
3199
  function g(u) {
3200
- this.inner = new s(), this.outer = new s(), this.blockSize = this.inner.blockSize, this.digestLength = this.inner.digestLength;
3200
+ this.inner = new i(), this.outer = new i(), this.blockSize = this.inner.blockSize, this.digestLength = this.inner.digestLength;
3201
3201
  var b = new Uint8Array(this.blockSize);
3202
3202
  if (u.length > this.blockSize)
3203
- new s().update(u).finish(b).clean();
3203
+ new i().update(u).finish(b).clean();
3204
3204
  else
3205
3205
  for (var x = 0; x < u.length; x++)
3206
3206
  b[x] = u[x];
@@ -3230,17 +3230,17 @@ var On = { exports: {} };
3230
3230
  }()
3231
3231
  );
3232
3232
  t.HMAC = o;
3233
- function i(g) {
3234
- var u = new s().update(g), b = u.digest();
3233
+ function s(g) {
3234
+ var u = new i().update(g), b = u.digest();
3235
3235
  return u.clean(), b;
3236
3236
  }
3237
- t.hash = i, t.default = i;
3238
- function c(g, u) {
3237
+ t.hash = s, t.default = s;
3238
+ function f(g, u) {
3239
3239
  var b = new o(g).update(u), x = b.digest();
3240
3240
  return b.clean(), x;
3241
3241
  }
3242
- t.hmac = c;
3243
- function f(g, u, b, x) {
3242
+ t.hmac = f;
3243
+ function a(g, u, b, x) {
3244
3244
  var C = x[0];
3245
3245
  if (C === 0)
3246
3246
  throw new Error("hkdf: cannot expand more");
@@ -3249,8 +3249,8 @@ var On = { exports: {} };
3249
3249
  var p = new Uint8Array(t.digestLength);
3250
3250
  function d(g, u, b, x) {
3251
3251
  u === void 0 && (u = p), x === void 0 && (x = 32);
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++];
3252
+ for (var C = new Uint8Array([1]), I = f(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 && (a(v, U, b, C), B = 0), M[F] = v[B++];
3254
3254
  return U.clean(), v.fill(0), C.fill(0), M;
3255
3255
  }
3256
3256
  t.hkdf = d;
@@ -3279,51 +3279,54 @@ var On = { exports: {} };
3279
3279
  })(On);
3280
3280
  Pr("automerge-repo:collectionsync");
3281
3281
  const Mn = (e) => {
3282
- const [t, r] = $t({}), n = bt(), s = br(
3283
- () => e?.map((i) => {
3284
- if (sn(i)) {
3285
- const { documentId: c } = nr(i);
3286
- return c;
3282
+ const t = bt(), r = br(
3283
+ () => e?.map((s) => {
3284
+ if (sn(s)) {
3285
+ const { documentId: f } = nr(s);
3286
+ return f;
3287
3287
  } else
3288
- return i;
3288
+ return s;
3289
3289
  }) ?? [],
3290
3290
  [e]
3291
- ), o = Nt([]);
3291
+ ), n = Nt([]), [i, o] = $t(() => r.reduce((s, f) => {
3292
+ const p = t.find(f).docSync();
3293
+ return p && (s[f] = p), s;
3294
+ }, {}));
3292
3295
  return _e(() => {
3293
- const i = {}, c = (u, b) => {
3294
- b && r((x) => ({ ...x, [u]: b }));
3295
- }, f = (u) => {
3296
+ const s = {}, f = (u, b) => {
3297
+ b && o((x) => ({ ...x, [u]: b }));
3298
+ }, a = (u) => {
3296
3299
  const b = u.documentId, x = {
3297
- change: ({ doc: C }) => c(b, C),
3300
+ change: ({ doc: C }) => f(b, C),
3298
3301
  delete: () => p(b)
3299
3302
  };
3300
- u.on("change", x.change), u.on("delete", x.delete), i[b] = x;
3303
+ u.on("change", x.change), u.on("delete", x.delete), s[b] = x;
3301
3304
  }, p = (u) => {
3302
- r((b) => {
3305
+ o((b) => {
3303
3306
  const { [u]: x, ...C } = b;
3304
3307
  return C;
3305
3308
  });
3306
3309
  }, d = (u) => {
3307
- const b = n.find(u);
3308
- b.docSync() ? (c(u, b.docSync()), f(b)) : b.doc().then((x) => {
3309
- c(u, x), f(b);
3310
+ const b = t.find(u);
3311
+ b.docSync() ? (f(u, b.docSync()), a(b)) : b.doc().then((x) => {
3312
+ f(u, x), a(b);
3310
3313
  }).catch((x) => {
3311
3314
  console.error(`Error loading document ${u} in useDocuments: `, x);
3312
3315
  });
3313
3316
  }, h = () => {
3314
- Object.entries(i).forEach(([u, b]) => {
3315
- const x = n.find(u);
3317
+ Object.entries(s).forEach(([u, b]) => {
3318
+ const x = t.find(u);
3316
3319
  x.off("change", b.change), x.off("delete", b.delete);
3317
3320
  });
3318
3321
  };
3319
- if (!s)
3322
+ if (!r)
3320
3323
  return h;
3321
- for (const u of s) {
3322
- const b = n.find(u);
3323
- o.current.includes(u) ? f(b) : d(u);
3324
+ for (const u of r) {
3325
+ const b = t.find(u);
3326
+ n.current.includes(u) ? a(b) : d(u);
3324
3327
  }
3325
- return o.current.filter((u) => !s.includes(u)).forEach(p), o.current = s, h;
3326
- }, [s, n]), t;
3328
+ return n.current.filter((u) => !r.includes(u)).forEach(p), n.current = r, h;
3329
+ }, [r, t]), i;
3327
3330
  };
3328
3331
  function Rn(e) {
3329
3332
  const t = bt();
@@ -3332,10 +3335,10 @@ function Rn(e) {
3332
3335
  var st = hr, In = function(e) {
3333
3336
  return typeof e == "function";
3334
3337
  }, 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);
3338
+ var t = st.useState(e), r = t[0], n = t[1], i = st.useRef(r), o = st.useCallback(function(s) {
3339
+ i.current = In(s) ? s(i.current) : s, n(i.current);
3337
3340
  }, []);
3338
- return [r, o, s];
3341
+ return [r, o, i];
3339
3342
  }, Fn = Un;
3340
3343
  const yt = /* @__PURE__ */ We(Fn), pt = new Vr(), Bn = ({
3341
3344
  handle: e,
@@ -3343,22 +3346,22 @@ const yt = /* @__PURE__ */ We(Fn), pt = new Vr(), Bn = ({
3343
3346
  offlineTimeout: r = 3e4,
3344
3347
  getTime: n = () => (/* @__PURE__ */ new Date()).getTime()
3345
3348
  }) => {
3346
- const [s, o, i] = yt({}), [c, f, p] = yt({});
3349
+ const [i, o, s] = yt({}), [f, a, p] = yt({});
3347
3350
  return _e(() => {
3348
3351
  const d = (u) => {
3349
3352
  const [b, x] = u.message;
3350
3353
  b !== t && (p.current[b] || pt.emit("new_peer", u), o({
3351
- ...i.current,
3354
+ ...s.current,
3352
3355
  [b]: x
3353
- }), f({
3356
+ }), a({
3354
3357
  ...p.current,
3355
3358
  [b]: n()
3356
3359
  }));
3357
3360
  }, h = () => {
3358
- const u = i.current, b = p.current, x = n();
3361
+ const u = s.current, b = p.current, x = n();
3359
3362
  for (const C in b)
3360
3363
  x - b[C] > r && (delete u[C], delete b[C]);
3361
- o(u), f(b);
3364
+ o(u), a(b);
3362
3365
  };
3363
3366
  e.on("ephemeral-message", d);
3364
3367
  const g = setInterval(
@@ -3368,37 +3371,37 @@ const yt = /* @__PURE__ */ We(Fn), pt = new Vr(), Bn = ({
3368
3371
  return () => {
3369
3372
  e.removeListener("ephemeral-message", d), clearInterval(g);
3370
3373
  };
3371
- }, [e, t, r, n]), [s, c];
3374
+ }, [e, t, r, n]), [i, f];
3372
3375
  }, Tn = ({
3373
3376
  handle: e,
3374
3377
  userId: t,
3375
3378
  initialState: r,
3376
3379
  heartbeatTime: n = 15e3
3377
3380
  }) => {
3378
- const [s, o, i] = yt(r), c = (f) => {
3379
- const p = typeof f == "function" ? f(i.current) : f;
3381
+ const [i, o, s] = yt(r), f = (a) => {
3382
+ const p = typeof a == "function" ? a(s.current) : a;
3380
3383
  o(p), e.broadcast([t, p]);
3381
3384
  };
3382
3385
  return _e(() => {
3383
3386
  if (!t)
3384
3387
  return;
3385
- const f = () => void e.broadcast([t, i.current]);
3386
- f();
3387
- const p = setInterval(f, n);
3388
+ const a = () => void e.broadcast([t, s.current]);
3389
+ a();
3390
+ const p = setInterval(a, n);
3388
3391
  return () => void clearInterval(p);
3389
3392
  }, [e, t, n]), _e(() => {
3390
- let f;
3393
+ let a;
3391
3394
  const p = pt.on("new_peer", () => {
3392
- f = setTimeout(
3393
- () => e.broadcast([t, i.current]),
3395
+ a = setTimeout(
3396
+ () => e.broadcast([t, s.current]),
3394
3397
  500
3395
3398
  // Wait for the peer to be ready
3396
3399
  );
3397
3400
  });
3398
3401
  return () => {
3399
- p.off("new_peer"), f && clearTimeout(f);
3402
+ p.off("new_peer"), a && clearTimeout(a);
3400
3403
  };
3401
- }, [e, t, pt]), [s, c];
3404
+ }, [e, t, pt]), [i, f];
3402
3405
  };
3403
3406
  export {
3404
3407
  gr as RepoContext,