nostr-double-ratchet 0.0.4 → 0.0.5

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.
@@ -1,7 +1,7 @@
1
1
  var oi = Object.defineProperty;
2
2
  var si = (e, t, n) => t in e ? oi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var ee = (e, t, n) => si(e, typeof t != "symbol" ? t + "" : t, n);
4
- function En(e) {
4
+ function mn(e) {
5
5
  if (!Number.isSafeInteger(e) || e < 0)
6
6
  throw new Error(`Wrong positive integer: ${e}`);
7
7
  }
@@ -14,7 +14,7 @@ function Pn(e, ...t) {
14
14
  function ai(e) {
15
15
  if (typeof e != "function" || typeof e.create != "function")
16
16
  throw new Error("Hash should be wrapped by utils.wrapConstructor");
17
- En(e.outputLen), En(e.blockLen);
17
+ mn(e.outputLen), mn(e.blockLen);
18
18
  }
19
19
  function rt(e, t = !0) {
20
20
  if (e.destroyed)
@@ -38,7 +38,7 @@ function ui(e) {
38
38
  throw new Error(`utf8ToBytes expected string, got ${typeof e}`);
39
39
  return new Uint8Array(new TextEncoder().encode(e));
40
40
  }
41
- function zt(e) {
41
+ function Vt(e) {
42
42
  if (typeof e == "string" && (e = ui(e)), !On(e))
43
43
  throw new Error(`expected Uint8Array, got ${typeof e}`);
44
44
  return e;
@@ -59,7 +59,7 @@ let Mn = class {
59
59
  }
60
60
  };
61
61
  function hi(e) {
62
- const t = (r) => e().update(zt(r)).digest(), n = e();
62
+ const t = (r) => e().update(Vt(r)).digest(), n = e();
63
63
  return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
64
64
  }
65
65
  function Hn(e = 32) {
@@ -80,7 +80,7 @@ let yi = class extends Mn {
80
80
  update(t) {
81
81
  rt(this);
82
82
  const { view: n, buffer: r, blockLen: i } = this;
83
- t = zt(t);
83
+ t = Vt(t);
84
84
  const o = t.length;
85
85
  for (let s = 0; s < o; ) {
86
86
  const c = Math.min(i - this.pos, o - s);
@@ -123,7 +123,7 @@ let yi = class extends Mn {
123
123
  return t.length = i, t.pos = c, t.finished = o, t.destroyed = s, i % n && t.buffer.set(r), t;
124
124
  }
125
125
  };
126
- const gi = (e, t, n) => e & t ^ ~e & n, pi = (e, t, n) => e & t ^ e & n ^ t & n, wi = /* @__PURE__ */ new Uint32Array([
126
+ const pi = (e, t, n) => e & t ^ ~e & n, gi = (e, t, n) => e & t ^ e & n ^ t & n, wi = /* @__PURE__ */ new Uint32Array([
127
127
  1116352408,
128
128
  1899447441,
129
129
  3049323471,
@@ -188,7 +188,7 @@ const gi = (e, t, n) => e & t ^ ~e & n, pi = (e, t, n) => e & t ^ e & n ^ t & n,
188
188
  2756734187,
189
189
  3204031479,
190
190
  3329325298
191
- ]), pe = /* @__PURE__ */ new Uint32Array([
191
+ ]), ge = /* @__PURE__ */ new Uint32Array([
192
192
  1779033703,
193
193
  3144134277,
194
194
  1013904242,
@@ -200,7 +200,7 @@ const gi = (e, t, n) => e & t ^ ~e & n, pi = (e, t, n) => e & t ^ e & n ^ t & n,
200
200
  ]), we = /* @__PURE__ */ new Uint32Array(64);
201
201
  let bi = class extends yi {
202
202
  constructor() {
203
- super(64, 32, 8, !1), this.A = pe[0] | 0, this.B = pe[1] | 0, this.C = pe[2] | 0, this.D = pe[3] | 0, this.E = pe[4] | 0, this.F = pe[5] | 0, this.G = pe[6] | 0, this.H = pe[7] | 0;
203
+ super(64, 32, 8, !1), this.A = ge[0] | 0, this.B = ge[1] | 0, this.C = ge[2] | 0, this.D = ge[3] | 0, this.E = ge[4] | 0, this.F = ge[5] | 0, this.G = ge[6] | 0, this.H = ge[7] | 0;
204
204
  }
205
205
  get() {
206
206
  const { A: t, B: n, C: r, D: i, E: o, F: s, G: c, H: a } = this;
@@ -214,13 +214,13 @@ let bi = class extends yi {
214
214
  for (let u = 0; u < 16; u++, n += 4)
215
215
  we[u] = t.getUint32(n, !1);
216
216
  for (let u = 16; u < 64; u++) {
217
- const d = we[u - 15], g = we[u - 2], p = ne(d, 7) ^ ne(d, 18) ^ d >>> 3, h = ne(g, 17) ^ ne(g, 19) ^ g >>> 10;
218
- we[u] = h + we[u - 7] + p + we[u - 16] | 0;
217
+ const d = we[u - 15], p = we[u - 2], g = ne(d, 7) ^ ne(d, 18) ^ d >>> 3, h = ne(p, 17) ^ ne(p, 19) ^ p >>> 10;
218
+ we[u] = h + we[u - 7] + g + we[u - 16] | 0;
219
219
  }
220
220
  let { A: r, B: i, C: o, D: s, E: c, F: a, G: l, H: f } = this;
221
221
  for (let u = 0; u < 64; u++) {
222
- const d = ne(c, 6) ^ ne(c, 11) ^ ne(c, 25), g = f + d + gi(c, a, l) + wi[u] + we[u] | 0, h = (ne(r, 2) ^ ne(r, 13) ^ ne(r, 22)) + pi(r, i, o) | 0;
223
- f = l, l = a, a = c, c = s + g | 0, s = o, o = i, i = r, r = g + h | 0;
222
+ const d = ne(c, 6) ^ ne(c, 11) ^ ne(c, 25), p = f + d + pi(c, a, l) + wi[u] + we[u] | 0, h = (ne(r, 2) ^ ne(r, 13) ^ ne(r, 22)) + gi(r, i, o) | 0;
223
+ f = l, l = a, a = c, c = s + p | 0, s = o, o = i, i = r, r = p + h | 0;
224
224
  }
225
225
  r = r + this.A | 0, i = i + this.B | 0, o = o + this.C | 0, s = s + this.D | 0, c = c + this.E | 0, a = a + this.F | 0, l = l + this.G | 0, f = f + this.H | 0, this.set(r, i, o, s, c, a, l, f);
226
226
  }
@@ -233,13 +233,13 @@ let bi = class extends yi {
233
233
  };
234
234
  const Lt = /* @__PURE__ */ hi(() => new bi());
235
235
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
236
- const qn = BigInt(0), lt = BigInt(1), vi = BigInt(2), ut = (e) => e instanceof Uint8Array, Ei = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
236
+ const qn = BigInt(0), lt = BigInt(1), vi = BigInt(2), ut = (e) => e instanceof Uint8Array, mi = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
237
237
  function He(e) {
238
238
  if (!ut(e))
239
239
  throw new Error("Uint8Array expected");
240
240
  let t = "";
241
241
  for (let n = 0; n < e.length; n++)
242
- t += Ei[e[n]];
242
+ t += mi[e[n]];
243
243
  return t;
244
244
  }
245
245
  function Dn(e) {
@@ -280,7 +280,7 @@ function xe(e, t) {
280
280
  function Wt(e, t) {
281
281
  return xe(e, t).reverse();
282
282
  }
283
- function mi(e) {
283
+ function Ei(e) {
284
284
  return qe(Dn(e));
285
285
  }
286
286
  function Z(e, t, n) {
@@ -331,7 +331,7 @@ function Si(e) {
331
331
  function Ki(e, t) {
332
332
  return e >> BigInt(t) & lt;
333
333
  }
334
- const Bi = (e, t, n) => e | (n ? lt : qn) << BigInt(t), Gt = (e) => (vi << BigInt(e - 1)) - lt, Kt = (e) => new Uint8Array(e), mn = (e) => Uint8Array.from(e);
334
+ const Bi = (e, t, n) => e | (n ? lt : qn) << BigInt(t), Gt = (e) => (vi << BigInt(e - 1)) - lt, Kt = (e) => new Uint8Array(e), En = (e) => Uint8Array.from(e);
335
335
  function jn(e, t, n) {
336
336
  if (typeof e != "number" || e < 2)
337
337
  throw new Error("hashLen must be a number");
@@ -343,7 +343,7 @@ function jn(e, t, n) {
343
343
  const s = () => {
344
344
  r.fill(1), i.fill(0), o = 0;
345
345
  }, c = (...u) => n(i, r, ...u), a = (u = Kt()) => {
346
- i = c(mn([0]), u), r = c(), u.length !== 0 && (i = c(mn([1]), u), r = c());
346
+ i = c(En([0]), u), r = c(), u.length !== 0 && (i = c(En([1]), u), r = c());
347
347
  }, l = () => {
348
348
  if (o++ >= 1e3)
349
349
  throw new Error("drbg: tried 1000 values");
@@ -351,17 +351,17 @@ function jn(e, t, n) {
351
351
  const d = [];
352
352
  for (; u < t; ) {
353
353
  r = c();
354
- const g = r.slice();
355
- d.push(g), u += r.length;
354
+ const p = r.slice();
355
+ d.push(p), u += r.length;
356
356
  }
357
357
  return Ie(...d);
358
358
  };
359
359
  return (u, d) => {
360
360
  s(), a(u);
361
- let g;
362
- for (; !(g = d(l())); )
361
+ let p;
362
+ for (; !(p = d(l())); )
363
363
  a();
364
- return s(), g;
364
+ return s(), p;
365
365
  };
366
366
  }
367
367
  const Ni = {
@@ -408,7 +408,7 @@ const Ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
408
408
  numberToBytesBE: xe,
409
409
  numberToBytesLE: Wt,
410
410
  numberToHexUnpadded: Dn,
411
- numberToVarBytesBE: mi,
411
+ numberToVarBytesBE: Ei,
412
412
  utf8ToBytes: Ai,
413
413
  validateObject: Je
414
414
  }, Symbol.toStringTag, { value: "Module" }));
@@ -416,7 +416,7 @@ const Ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
416
416
  const j = BigInt(0), q = BigInt(1), Be = BigInt(2), Ii = BigInt(3), $t = BigInt(4), xn = BigInt(5), An = BigInt(8);
417
417
  BigInt(9);
418
418
  BigInt(16);
419
- function z(e, t) {
419
+ function V(e, t) {
420
420
  const n = e % t;
421
421
  return n >= j ? n : t + n;
422
422
  }
@@ -439,16 +439,16 @@ function J(e, t, n) {
439
439
  function Tt(e, t) {
440
440
  if (e === j || t <= j)
441
441
  throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);
442
- let n = z(e, t), r = t, i = j, o = q;
442
+ let n = V(e, t), r = t, i = j, o = q;
443
443
  for (; n !== j; ) {
444
444
  const c = r / n, a = r % n, l = i - o * c;
445
445
  r = n, n = a, i = o, o = l;
446
446
  }
447
447
  if (r !== q)
448
448
  throw new Error("invert: does not exist");
449
- return z(i, t);
449
+ return V(i, t);
450
450
  }
451
- function _i(e) {
451
+ function ki(e) {
452
452
  const t = (e - q) / Be;
453
453
  let n, r, i;
454
454
  for (n = e - q, r = 0; n % Be === j; n /= Be, r++)
@@ -472,16 +472,16 @@ function _i(e) {
472
472
  for (; !c.eql(d, c.ONE); ) {
473
473
  if (c.eql(d, c.ZERO))
474
474
  return c.ZERO;
475
- let g = 1;
476
- for (let h = c.sqr(d); g < l && !c.eql(h, c.ONE); g++)
475
+ let p = 1;
476
+ for (let h = c.sqr(d); p < l && !c.eql(h, c.ONE); p++)
477
477
  h = c.sqr(h);
478
- const p = c.pow(f, q << BigInt(l - g - 1));
479
- f = c.sqr(p), u = c.mul(u, p), d = c.mul(d, f), l = g;
478
+ const g = c.pow(f, q << BigInt(l - p - 1));
479
+ f = c.sqr(g), u = c.mul(u, g), d = c.mul(d, f), l = p;
480
480
  }
481
481
  return u;
482
482
  };
483
483
  }
484
- function ki(e) {
484
+ function _i(e) {
485
485
  if (e % $t === Ii) {
486
486
  const t = (e + q) / $t;
487
487
  return function(r, i) {
@@ -500,7 +500,7 @@ function ki(e) {
500
500
  return l;
501
501
  };
502
502
  }
503
- return _i(e);
503
+ return ki(e);
504
504
  }
505
505
  const Li = [
506
506
  "create",
@@ -546,24 +546,24 @@ function Ri(e, t) {
546
546
  const n = new Array(t.length), r = t.reduce((o, s, c) => e.is0(s) ? o : (n[c] = o, e.mul(o, s)), e.ONE), i = e.inv(r);
547
547
  return t.reduceRight((o, s, c) => e.is0(s) ? o : (n[c] = e.mul(o, n[c]), e.mul(o, s)), i), n;
548
548
  }
549
- function Vn(e, t) {
549
+ function zn(e, t) {
550
550
  const n = t !== void 0 ? t : e.toString(2).length, r = Math.ceil(n / 8);
551
551
  return { nBitLength: n, nByteLength: r };
552
552
  }
553
553
  function Pi(e, t, n = !1, r = {}) {
554
554
  if (e <= j)
555
555
  throw new Error(`Expected Field ORDER > 0, got ${e}`);
556
- const { nBitLength: i, nByteLength: o } = Vn(e, t);
556
+ const { nBitLength: i, nByteLength: o } = zn(e, t);
557
557
  if (o > 2048)
558
558
  throw new Error("Field lengths over 2048 bytes are not supported");
559
- const s = ki(e), c = Object.freeze({
559
+ const s = _i(e), c = Object.freeze({
560
560
  ORDER: e,
561
561
  BITS: i,
562
562
  BYTES: o,
563
563
  MASK: Gt(i),
564
564
  ZERO: j,
565
565
  ONE: q,
566
- create: (a) => z(a, e),
566
+ create: (a) => V(a, e),
567
567
  isValid: (a) => {
568
568
  if (typeof a != "bigint")
569
569
  throw new Error(`Invalid field element: expected bigint, got ${typeof a}`);
@@ -571,14 +571,14 @@ function Pi(e, t, n = !1, r = {}) {
571
571
  },
572
572
  is0: (a) => a === j,
573
573
  isOdd: (a) => (a & q) === q,
574
- neg: (a) => z(-a, e),
574
+ neg: (a) => V(-a, e),
575
575
  eql: (a, l) => a === l,
576
- sqr: (a) => z(a * a, e),
577
- add: (a, l) => z(a + l, e),
578
- sub: (a, l) => z(a - l, e),
579
- mul: (a, l) => z(a * l, e),
576
+ sqr: (a) => V(a * a, e),
577
+ add: (a, l) => V(a + l, e),
578
+ sub: (a, l) => V(a - l, e),
579
+ mul: (a, l) => V(a * l, e),
580
580
  pow: (a, l) => Ti(c, a, l),
581
- div: (a, l) => z(a * Tt(l, e), e),
581
+ div: (a, l) => V(a * Tt(l, e), e),
582
582
  // Same as above, but doesn't normalize
583
583
  sqrN: (a) => a * a,
584
584
  addN: (a, l) => a + l,
@@ -599,21 +599,21 @@ function Pi(e, t, n = !1, r = {}) {
599
599
  });
600
600
  return Object.freeze(c);
601
601
  }
602
- function zn(e) {
602
+ function Vn(e) {
603
603
  if (typeof e != "bigint")
604
604
  throw new Error("field order must be bigint");
605
605
  const t = e.toString(2).length;
606
606
  return Math.ceil(t / 8);
607
607
  }
608
608
  function Zn(e) {
609
- const t = zn(e);
609
+ const t = Vn(e);
610
610
  return t + Math.ceil(t / 2);
611
611
  }
612
612
  function Oi(e, t, n = !1) {
613
- const r = e.length, i = zn(t), o = Zn(t);
613
+ const r = e.length, i = Vn(t), o = Zn(t);
614
614
  if (r < 16 || r < o || r > 1024)
615
615
  throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);
616
- const s = n ? G(e) : Ft(e), c = z(s, t - q) + q;
616
+ const s = n ? G(e) : Ft(e), c = V(s, t - q) + q;
617
617
  return n ? Wt(c, i) : xe(c, i);
618
618
  }
619
619
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -666,13 +666,13 @@ function Hi(e, t) {
666
666
  wNAF(i, o, s) {
667
667
  const { windows: c, windowSize: a } = r(i);
668
668
  let l = e.ZERO, f = e.BASE;
669
- const u = BigInt(2 ** i - 1), d = 2 ** i, g = BigInt(i);
670
- for (let p = 0; p < c; p++) {
671
- const h = p * a;
669
+ const u = BigInt(2 ** i - 1), d = 2 ** i, p = BigInt(i);
670
+ for (let g = 0; g < c; g++) {
671
+ const h = g * a;
672
672
  let y = Number(s & u);
673
- s >>= g, y > a && (y -= d, s += Bt);
674
- const w = h, m = h + Math.abs(y) - 1, K = p % 2 !== 0, _ = y < 0;
675
- y === 0 ? f = f.add(n(K, o[w])) : l = l.add(n(_, o[m]));
673
+ s >>= p, y > a && (y -= d, s += Bt);
674
+ const w = h, E = h + Math.abs(y) - 1, K = g % 2 !== 0, k = y < 0;
675
+ y === 0 ? f = f.add(n(K, o[w])) : l = l.add(n(k, o[E]));
676
676
  }
677
677
  return { p: l, f };
678
678
  },
@@ -693,7 +693,7 @@ function Fn(e) {
693
693
  nBitLength: "isSafeInteger",
694
694
  nByteLength: "isSafeInteger"
695
695
  }), Object.freeze({
696
- ...Vn(e.n, e.nBitLength),
696
+ ...zn(e.n, e.nBitLength),
697
697
  ...e,
698
698
  p: e.Fp.ORDER
699
699
  });
@@ -767,45 +767,45 @@ const { bytesToNumberBE: Di, hexToBytes: ji } = Ci, Ne = {
767
767
  BigInt(2);
768
768
  const Sn = BigInt(3);
769
769
  BigInt(4);
770
- function Vi(e) {
771
- const t = qi(e), { Fp: n } = t, r = t.toBytes || ((p, h, y) => {
770
+ function zi(e) {
771
+ const t = qi(e), { Fp: n } = t, r = t.toBytes || ((g, h, y) => {
772
772
  const w = h.toAffine();
773
773
  return Ie(Uint8Array.from([4]), n.toBytes(w.x), n.toBytes(w.y));
774
- }), i = t.fromBytes || ((p) => {
775
- const h = p.subarray(1), y = n.fromBytes(h.subarray(0, n.BYTES)), w = n.fromBytes(h.subarray(n.BYTES, 2 * n.BYTES));
774
+ }), i = t.fromBytes || ((g) => {
775
+ const h = g.subarray(1), y = n.fromBytes(h.subarray(0, n.BYTES)), w = n.fromBytes(h.subarray(n.BYTES, 2 * n.BYTES));
776
776
  return { x: y, y: w };
777
777
  });
778
- function o(p) {
779
- const { a: h, b: y } = t, w = n.sqr(p), m = n.mul(w, p);
780
- return n.add(n.add(m, n.mul(p, h)), y);
778
+ function o(g) {
779
+ const { a: h, b: y } = t, w = n.sqr(g), E = n.mul(w, g);
780
+ return n.add(n.add(E, n.mul(g, h)), y);
781
781
  }
782
782
  if (!n.eql(n.sqr(t.Gy), o(t.Gx)))
783
783
  throw new Error("bad generator point: equation left != right");
784
- function s(p) {
785
- return typeof p == "bigint" && ce < p && p < t.n;
784
+ function s(g) {
785
+ return typeof g == "bigint" && ce < g && g < t.n;
786
786
  }
787
- function c(p) {
788
- if (!s(p))
787
+ function c(g) {
788
+ if (!s(g))
789
789
  throw new Error("Expected valid bigint: 0 < bigint < curve.n");
790
790
  }
791
- function a(p) {
792
- const { allowedPrivateKeyLengths: h, nByteLength: y, wrapPrivateKey: w, n: m } = t;
793
- if (h && typeof p != "bigint") {
794
- if (p instanceof Uint8Array && (p = He(p)), typeof p != "string" || !h.includes(p.length))
791
+ function a(g) {
792
+ const { allowedPrivateKeyLengths: h, nByteLength: y, wrapPrivateKey: w, n: E } = t;
793
+ if (h && typeof g != "bigint") {
794
+ if (g instanceof Uint8Array && (g = He(g)), typeof g != "string" || !h.includes(g.length))
795
795
  throw new Error("Invalid key");
796
- p = p.padStart(y * 2, "0");
796
+ g = g.padStart(y * 2, "0");
797
797
  }
798
798
  let K;
799
799
  try {
800
- K = typeof p == "bigint" ? p : G(Z("private key", p, y));
800
+ K = typeof g == "bigint" ? g : G(Z("private key", g, y));
801
801
  } catch {
802
- throw new Error(`private key must be ${y} bytes, hex or bigint, not ${typeof p}`);
802
+ throw new Error(`private key must be ${y} bytes, hex or bigint, not ${typeof g}`);
803
803
  }
804
- return w && (K = z(K, m)), c(K), K;
804
+ return w && (K = V(K, E)), c(K), K;
805
805
  }
806
806
  const l = /* @__PURE__ */ new Map();
807
- function f(p) {
808
- if (!(p instanceof u))
807
+ function f(g) {
808
+ if (!(g instanceof u))
809
809
  throw new Error("ProjectivePoint expected");
810
810
  }
811
811
  class u {
@@ -825,8 +825,8 @@ function Vi(e) {
825
825
  throw new Error("invalid affine point");
826
826
  if (h instanceof u)
827
827
  throw new Error("projective point not allowed");
828
- const m = (K) => n.eql(K, n.ZERO);
829
- return m(y) && m(w) ? u.ZERO : new u(y, w, n.ONE);
828
+ const E = (K) => n.eql(K, n.ZERO);
829
+ return E(y) && E(w) ? u.ZERO : new u(y, w, n.ONE);
830
830
  }
831
831
  get x() {
832
832
  return this.toAffine().x;
@@ -842,7 +842,7 @@ function Vi(e) {
842
842
  */
843
843
  static normalizeZ(h) {
844
844
  const y = n.invertBatch(h.map((w) => w.pz));
845
- return h.map((w, m) => w.toAffine(y[m])).map(u.fromAffine);
845
+ return h.map((w, E) => w.toAffine(y[E])).map(u.fromAffine);
846
846
  }
847
847
  /**
848
848
  * Converts hash string or Uint8Array to Point.
@@ -870,8 +870,8 @@ function Vi(e) {
870
870
  const { x: h, y } = this.toAffine();
871
871
  if (!n.isValid(h) || !n.isValid(y))
872
872
  throw new Error("bad point: x or y not FE");
873
- const w = n.sqr(y), m = o(h);
874
- if (!n.eql(w, m))
873
+ const w = n.sqr(y), E = o(h);
874
+ if (!n.eql(w, E))
875
875
  throw new Error("bad point: equation left != right");
876
876
  if (!this.isTorsionFree())
877
877
  throw new Error("bad point: not in prime-order subgroup");
@@ -887,8 +887,8 @@ function Vi(e) {
887
887
  */
888
888
  equals(h) {
889
889
  f(h);
890
- const { px: y, py: w, pz: m } = this, { px: K, py: _, pz: C } = h, E = n.eql(n.mul(y, C), n.mul(K, m)), x = n.eql(n.mul(w, C), n.mul(_, m));
891
- return E && x;
890
+ const { px: y, py: w, pz: E } = this, { px: K, py: k, pz: C } = h, m = n.eql(n.mul(y, C), n.mul(K, E)), x = n.eql(n.mul(w, C), n.mul(k, E));
891
+ return m && x;
892
892
  }
893
893
  /**
894
894
  * Flips point to one corresponding to (x, -y) in Affine coordinates.
@@ -901,9 +901,9 @@ function Vi(e) {
901
901
  // https://eprint.iacr.org/2015/1060, algorithm 3
902
902
  // Cost: 8M + 3S + 3*a + 2*b3 + 15add.
903
903
  double() {
904
- const { a: h, b: y } = t, w = n.mul(y, Sn), { px: m, py: K, pz: _ } = this;
905
- let C = n.ZERO, E = n.ZERO, x = n.ZERO, A = n.mul(m, m), O = n.mul(K, K), U = n.mul(_, _), B = n.mul(m, K);
906
- return B = n.add(B, B), x = n.mul(m, _), x = n.add(x, x), C = n.mul(h, x), E = n.mul(w, U), E = n.add(C, E), C = n.sub(O, E), E = n.add(O, E), E = n.mul(C, E), C = n.mul(B, C), x = n.mul(w, x), U = n.mul(h, U), B = n.sub(A, U), B = n.mul(h, B), B = n.add(B, x), x = n.add(A, A), A = n.add(x, A), A = n.add(A, U), A = n.mul(A, B), E = n.add(E, A), U = n.mul(K, _), U = n.add(U, U), A = n.mul(U, B), C = n.sub(C, A), x = n.mul(U, O), x = n.add(x, x), x = n.add(x, x), new u(C, E, x);
904
+ const { a: h, b: y } = t, w = n.mul(y, Sn), { px: E, py: K, pz: k } = this;
905
+ let C = n.ZERO, m = n.ZERO, x = n.ZERO, A = n.mul(E, E), O = n.mul(K, K), U = n.mul(k, k), B = n.mul(E, K);
906
+ return B = n.add(B, B), x = n.mul(E, k), x = n.add(x, x), C = n.mul(h, x), m = n.mul(w, U), m = n.add(C, m), C = n.sub(O, m), m = n.add(O, m), m = n.mul(C, m), C = n.mul(B, C), x = n.mul(w, x), U = n.mul(h, U), B = n.sub(A, U), B = n.mul(h, B), B = n.add(B, x), x = n.add(A, A), A = n.add(x, A), A = n.add(A, U), A = n.mul(A, B), m = n.add(m, A), U = n.mul(K, k), U = n.add(U, U), A = n.mul(U, B), C = n.sub(C, A), x = n.mul(U, O), x = n.add(x, x), x = n.add(x, x), new u(C, m, x);
907
907
  }
908
908
  // Renes-Costello-Batina exception-free addition formula.
909
909
  // There is 30% faster Jacobian formula, but it is not complete.
@@ -911,13 +911,13 @@ function Vi(e) {
911
911
  // Cost: 12M + 0S + 3*a + 3*b3 + 23add.
912
912
  add(h) {
913
913
  f(h);
914
- const { px: y, py: w, pz: m } = this, { px: K, py: _, pz: C } = h;
915
- let E = n.ZERO, x = n.ZERO, A = n.ZERO;
914
+ const { px: y, py: w, pz: E } = this, { px: K, py: k, pz: C } = h;
915
+ let m = n.ZERO, x = n.ZERO, A = n.ZERO;
916
916
  const O = t.a, U = n.mul(t.b, Sn);
917
- let B = n.mul(y, K), T = n.mul(w, _), R = n.mul(m, C), H = n.add(y, w), b = n.add(K, _);
918
- H = n.mul(H, b), b = n.add(B, T), H = n.sub(H, b), b = n.add(y, m);
917
+ let B = n.mul(y, K), T = n.mul(w, k), R = n.mul(E, C), H = n.add(y, w), b = n.add(K, k);
918
+ H = n.mul(H, b), b = n.add(B, T), H = n.sub(H, b), b = n.add(y, E);
919
919
  let v = n.add(K, C);
920
- return b = n.mul(b, v), v = n.add(B, R), b = n.sub(b, v), v = n.add(w, m), E = n.add(_, C), v = n.mul(v, E), E = n.add(T, R), v = n.sub(v, E), A = n.mul(O, b), E = n.mul(U, R), A = n.add(E, A), E = n.sub(T, A), A = n.add(T, A), x = n.mul(E, A), T = n.add(B, B), T = n.add(T, B), R = n.mul(O, R), b = n.mul(U, b), T = n.add(T, R), R = n.sub(B, R), R = n.mul(O, R), b = n.add(b, R), B = n.mul(T, b), x = n.add(x, B), B = n.mul(v, b), E = n.mul(H, E), E = n.sub(E, B), B = n.mul(H, T), A = n.mul(v, A), A = n.add(A, B), new u(E, x, A);
920
+ return b = n.mul(b, v), v = n.add(B, R), b = n.sub(b, v), v = n.add(w, E), m = n.add(k, C), v = n.mul(v, m), m = n.add(T, R), v = n.sub(v, m), A = n.mul(O, b), m = n.mul(U, R), A = n.add(m, A), m = n.sub(T, A), A = n.add(T, A), x = n.mul(m, A), T = n.add(B, B), T = n.add(T, B), R = n.mul(O, R), b = n.mul(U, b), T = n.add(T, R), R = n.sub(B, R), R = n.mul(O, R), b = n.add(b, R), B = n.mul(T, b), x = n.add(x, B), B = n.mul(v, b), m = n.mul(H, m), m = n.sub(m, B), B = n.mul(H, T), A = n.mul(v, A), A = n.add(A, B), new u(m, x, A);
921
921
  }
922
922
  subtract(h) {
923
923
  return this.add(h.negate());
@@ -926,9 +926,9 @@ function Vi(e) {
926
926
  return this.equals(u.ZERO);
927
927
  }
928
928
  wNAF(h) {
929
- return g.wNAFCached(this, l, h, (y) => {
930
- const w = n.invertBatch(y.map((m) => m.pz));
931
- return y.map((m, K) => m.toAffine(w[K])).map(u.fromAffine);
929
+ return p.wNAFCached(this, l, h, (y) => {
930
+ const w = n.invertBatch(y.map((E) => E.pz));
931
+ return y.map((E, K) => E.toAffine(w[K])).map(u.fromAffine);
932
932
  });
933
933
  }
934
934
  /**
@@ -944,11 +944,11 @@ function Vi(e) {
944
944
  return this;
945
945
  const { endo: w } = t;
946
946
  if (!w)
947
- return g.unsafeLadder(this, h);
948
- let { k1neg: m, k1: K, k2neg: _, k2: C } = w.splitScalar(h), E = y, x = y, A = this;
947
+ return p.unsafeLadder(this, h);
948
+ let { k1neg: E, k1: K, k2neg: k, k2: C } = w.splitScalar(h), m = y, x = y, A = this;
949
949
  for (; K > ce || C > ce; )
950
- K & Y && (E = E.add(A)), C & Y && (x = x.add(A)), A = A.double(), K >>= Y, C >>= Y;
951
- return m && (E = E.negate()), _ && (x = x.negate()), x = new u(n.mul(x.px, w.beta), x.py, x.pz), E.add(x);
950
+ K & Y && (m = m.add(A)), C & Y && (x = x.add(A)), A = A.double(), K >>= Y, C >>= Y;
951
+ return E && (m = m.negate()), k && (x = x.negate()), x = new u(n.mul(x.px, w.beta), x.py, x.pz), m.add(x);
952
952
  }
953
953
  /**
954
954
  * Constant time multiplication.
@@ -961,17 +961,17 @@ function Vi(e) {
961
961
  */
962
962
  multiply(h) {
963
963
  c(h);
964
- let y = h, w, m;
964
+ let y = h, w, E;
965
965
  const { endo: K } = t;
966
966
  if (K) {
967
- const { k1neg: _, k1: C, k2neg: E, k2: x } = K.splitScalar(y);
967
+ const { k1neg: k, k1: C, k2neg: m, k2: x } = K.splitScalar(y);
968
968
  let { p: A, f: O } = this.wNAF(C), { p: U, f: B } = this.wNAF(x);
969
- A = g.constTimeNegate(_, A), U = g.constTimeNegate(E, U), U = new u(n.mul(U.px, K.beta), U.py, U.pz), w = A.add(U), m = O.add(B);
969
+ A = p.constTimeNegate(k, A), U = p.constTimeNegate(m, U), U = new u(n.mul(U.px, K.beta), U.py, U.pz), w = A.add(U), E = O.add(B);
970
970
  } else {
971
- const { p: _, f: C } = this.wNAF(y);
972
- w = _, m = C;
971
+ const { p: k, f: C } = this.wNAF(y);
972
+ w = k, E = C;
973
973
  }
974
- return u.normalizeZ([w, m])[0];
974
+ return u.normalizeZ([w, E])[0];
975
975
  }
976
976
  /**
977
977
  * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.
@@ -980,21 +980,21 @@ function Vi(e) {
980
980
  * @returns non-zero affine point
981
981
  */
982
982
  multiplyAndAddUnsafe(h, y, w) {
983
- const m = u.BASE, K = (C, E) => E === ce || E === Y || !C.equals(m) ? C.multiplyUnsafe(E) : C.multiply(E), _ = K(this, y).add(K(h, w));
984
- return _.is0() ? void 0 : _;
983
+ const E = u.BASE, K = (C, m) => m === ce || m === Y || !C.equals(E) ? C.multiplyUnsafe(m) : C.multiply(m), k = K(this, y).add(K(h, w));
984
+ return k.is0() ? void 0 : k;
985
985
  }
986
986
  // Converts Projective point to affine (x, y) coordinates.
987
987
  // Can accept precomputed Z^-1 - for example, from invertBatch.
988
988
  // (x, y, z) ∋ (x=x/z, y=y/z)
989
989
  toAffine(h) {
990
- const { px: y, py: w, pz: m } = this, K = this.is0();
991
- h == null && (h = K ? n.ONE : n.inv(m));
992
- const _ = n.mul(y, h), C = n.mul(w, h), E = n.mul(m, h);
990
+ const { px: y, py: w, pz: E } = this, K = this.is0();
991
+ h == null && (h = K ? n.ONE : n.inv(E));
992
+ const k = n.mul(y, h), C = n.mul(w, h), m = n.mul(E, h);
993
993
  if (K)
994
994
  return { x: n.ZERO, y: n.ZERO };
995
- if (!n.eql(E, n.ONE))
995
+ if (!n.eql(m, n.ONE))
996
996
  throw new Error("invZ was invalid");
997
- return { x: _, y: C };
997
+ return { x: k, y: C };
998
998
  }
999
999
  isTorsionFree() {
1000
1000
  const { h, isTorsionFree: y } = t;
@@ -1016,7 +1016,7 @@ function Vi(e) {
1016
1016
  }
1017
1017
  }
1018
1018
  u.BASE = new u(t.Gx, t.Gy, n.ONE), u.ZERO = new u(n.ZERO, n.ONE, n.ZERO);
1019
- const d = t.nBitLength, g = Hi(u, t.endo ? Math.ceil(d / 2) : d);
1019
+ const d = t.nBitLength, p = Hi(u, t.endo ? Math.ceil(d / 2) : d);
1020
1020
  return {
1021
1021
  CURVE: t,
1022
1022
  ProjectivePoint: u,
@@ -1025,7 +1025,7 @@ function Vi(e) {
1025
1025
  isWithinCurveOrder: s
1026
1026
  };
1027
1027
  }
1028
- function zi(e) {
1028
+ function Vi(e) {
1029
1029
  const t = Fn(e);
1030
1030
  return Je(t, {
1031
1031
  hash: "hash",
@@ -1038,21 +1038,21 @@ function zi(e) {
1038
1038
  }), Object.freeze({ lowS: !0, ...t });
1039
1039
  }
1040
1040
  function Zi(e) {
1041
- const t = zi(e), { Fp: n, n: r } = t, i = n.BYTES + 1, o = 2 * n.BYTES + 1;
1041
+ const t = Vi(e), { Fp: n, n: r } = t, i = n.BYTES + 1, o = 2 * n.BYTES + 1;
1042
1042
  function s(b) {
1043
1043
  return ce < b && b < n.ORDER;
1044
1044
  }
1045
1045
  function c(b) {
1046
- return z(b, r);
1046
+ return V(b, r);
1047
1047
  }
1048
1048
  function a(b) {
1049
1049
  return Tt(b, r);
1050
1050
  }
1051
- const { ProjectivePoint: l, normPrivateKeyToScalar: f, weierstrassEquation: u, isWithinCurveOrder: d } = Vi({
1051
+ const { ProjectivePoint: l, normPrivateKeyToScalar: f, weierstrassEquation: u, isWithinCurveOrder: d } = zi({
1052
1052
  ...t,
1053
1053
  toBytes(b, v, S) {
1054
- const I = v.toAffine(), N = n.toBytes(I.x), k = Ie;
1055
- return S ? k(Uint8Array.from([v.hasEvenY() ? 2 : 3]), N) : k(Uint8Array.from([4]), N, n.toBytes(I.y));
1054
+ const I = v.toAffine(), N = n.toBytes(I.x), _ = Ie;
1055
+ return S ? _(Uint8Array.from([v.hasEvenY() ? 2 : 3]), N) : _(Uint8Array.from([4]), N, n.toBytes(I.y));
1056
1056
  },
1057
1057
  fromBytes(b) {
1058
1058
  const v = b.length, S = b[0], I = b.subarray(1);
@@ -1060,23 +1060,23 @@ function Zi(e) {
1060
1060
  const N = G(I);
1061
1061
  if (!s(N))
1062
1062
  throw new Error("Point is not on curve");
1063
- const k = u(N);
1064
- let P = n.sqrt(k);
1063
+ const _ = u(N);
1064
+ let P = n.sqrt(_);
1065
1065
  const $ = (P & Y) === Y;
1066
1066
  return (S & 1) === 1 !== $ && (P = n.neg(P)), { x: N, y: P };
1067
1067
  } else if (v === o && S === 4) {
1068
- const N = n.fromBytes(I.subarray(0, n.BYTES)), k = n.fromBytes(I.subarray(n.BYTES, 2 * n.BYTES));
1069
- return { x: N, y: k };
1068
+ const N = n.fromBytes(I.subarray(0, n.BYTES)), _ = n.fromBytes(I.subarray(n.BYTES, 2 * n.BYTES));
1069
+ return { x: N, y: _ };
1070
1070
  } else
1071
1071
  throw new Error(`Point of length ${v} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`);
1072
1072
  }
1073
- }), g = (b) => He(xe(b, t.nByteLength));
1074
- function p(b) {
1073
+ }), p = (b) => He(xe(b, t.nByteLength));
1074
+ function g(b) {
1075
1075
  const v = r >> Y;
1076
1076
  return b > v;
1077
1077
  }
1078
1078
  function h(b) {
1079
- return p(b) ? c(-b) : b;
1079
+ return g(b) ? c(-b) : b;
1080
1080
  }
1081
1081
  const y = (b, v, S) => G(b.slice(v, S));
1082
1082
  class w {
@@ -1104,20 +1104,20 @@ function Zi(e) {
1104
1104
  return new w(this.r, this.s, v);
1105
1105
  }
1106
1106
  recoverPublicKey(v) {
1107
- const { r: S, s: I, recovery: N } = this, k = x(Z("msgHash", v));
1107
+ const { r: S, s: I, recovery: N } = this, _ = x(Z("msgHash", v));
1108
1108
  if (N == null || ![0, 1, 2, 3].includes(N))
1109
1109
  throw new Error("recovery id invalid");
1110
1110
  const P = N === 2 || N === 3 ? S + t.n : S;
1111
1111
  if (P >= n.ORDER)
1112
1112
  throw new Error("recovery id 2 or 3 invalid");
1113
- const $ = N & 1 ? "03" : "02", X = l.fromHex($ + g(P)), ye = a(P), _e = c(-k * ye), Ve = c(I * ye), ge = l.BASE.multiplyAndAddUnsafe(X, _e, Ve);
1114
- if (!ge)
1113
+ const $ = N & 1 ? "03" : "02", X = l.fromHex($ + p(P)), ye = a(P), ke = c(-_ * ye), ze = c(I * ye), pe = l.BASE.multiplyAndAddUnsafe(X, ke, ze);
1114
+ if (!pe)
1115
1115
  throw new Error("point at infinify");
1116
- return ge.assertValidity(), ge;
1116
+ return pe.assertValidity(), pe;
1117
1117
  }
1118
1118
  // Signatures should be low-s, to prevent malleability.
1119
1119
  hasHighS() {
1120
- return p(this.s);
1120
+ return g(this.s);
1121
1121
  }
1122
1122
  normalizeS() {
1123
1123
  return this.hasHighS() ? new w(this.r, c(-this.s), this.recovery) : this;
@@ -1134,10 +1134,10 @@ function Zi(e) {
1134
1134
  return qe(this.toCompactHex());
1135
1135
  }
1136
1136
  toCompactHex() {
1137
- return g(this.r) + g(this.s);
1137
+ return p(this.r) + p(this.s);
1138
1138
  }
1139
1139
  }
1140
- const m = {
1140
+ const E = {
1141
1141
  isValidPrivateKey(b) {
1142
1142
  try {
1143
1143
  return f(b), !0;
@@ -1169,22 +1169,22 @@ function Zi(e) {
1169
1169
  function K(b, v = !0) {
1170
1170
  return l.fromPrivateKey(b).toRawBytes(v);
1171
1171
  }
1172
- function _(b) {
1172
+ function k(b) {
1173
1173
  const v = b instanceof Uint8Array, S = typeof b == "string", I = (v || S) && b.length;
1174
1174
  return v ? I === i || I === o : S ? I === 2 * i || I === 2 * o : b instanceof l;
1175
1175
  }
1176
1176
  function C(b, v, S = !0) {
1177
- if (_(b))
1177
+ if (k(b))
1178
1178
  throw new Error("first arg must be private key");
1179
- if (!_(v))
1179
+ if (!k(v))
1180
1180
  throw new Error("second arg must be public key");
1181
1181
  return l.fromHex(v).multiply(f(b)).toRawBytes(S);
1182
1182
  }
1183
- const E = t.bits2int || function(b) {
1183
+ const m = t.bits2int || function(b) {
1184
1184
  const v = G(b), S = b.length * 8 - t.nBitLength;
1185
1185
  return S > 0 ? v >> BigInt(S) : v;
1186
1186
  }, x = t.bits2int_modN || function(b) {
1187
- return c(E(b));
1187
+ return c(m(b));
1188
1188
  }, A = Gt(t.nBitLength);
1189
1189
  function O(b) {
1190
1190
  if (typeof b != "bigint")
@@ -1197,33 +1197,33 @@ function Zi(e) {
1197
1197
  if (["recovered", "canonical"].some((Ke) => Ke in S))
1198
1198
  throw new Error("sign() legacy options not supported");
1199
1199
  const { hash: I, randomBytes: N } = t;
1200
- let { lowS: k, prehash: P, extraEntropy: $ } = S;
1201
- k == null && (k = !0), b = Z("msgHash", b), P && (b = Z("prehashed msgHash", I(b)));
1202
- const X = x(b), ye = f(v), _e = [O(ye), O(X)];
1200
+ let { lowS: _, prehash: P, extraEntropy: $ } = S;
1201
+ _ == null && (_ = !0), b = Z("msgHash", b), P && (b = Z("prehashed msgHash", I(b)));
1202
+ const X = x(b), ye = f(v), ke = [O(ye), O(X)];
1203
1203
  if ($ != null) {
1204
1204
  const Ke = $ === !0 ? N(n.BYTES) : $;
1205
- _e.push(Z("extraEntropy", Ke));
1205
+ ke.push(Z("extraEntropy", Ke));
1206
1206
  }
1207
- const Ve = Ie(..._e), ge = X;
1207
+ const ze = Ie(...ke), pe = X;
1208
1208
  function xt(Ke) {
1209
- const ke = E(Ke);
1210
- if (!d(ke))
1209
+ const _e = m(Ke);
1210
+ if (!d(_e))
1211
1211
  return;
1212
- const wn = a(ke), Le = l.BASE.multiply(ke).toAffine(), Q = c(Le.x);
1212
+ const wn = a(_e), Le = l.BASE.multiply(_e).toAffine(), Q = c(Le.x);
1213
1213
  if (Q === ce)
1214
1214
  return;
1215
- const $e = c(wn * c(ge + Q * ye));
1215
+ const $e = c(wn * c(pe + Q * ye));
1216
1216
  if ($e === ce)
1217
1217
  return;
1218
1218
  let bn = (Le.x === Q ? 0 : 2) | Number(Le.y & Y), vn = $e;
1219
- return k && p($e) && (vn = h($e), bn ^= 1), new w(Q, vn, bn);
1219
+ return _ && g($e) && (vn = h($e), bn ^= 1), new w(Q, vn, bn);
1220
1220
  }
1221
- return { seed: Ve, k2sig: xt };
1221
+ return { seed: ze, k2sig: xt };
1222
1222
  }
1223
1223
  const B = { lowS: t.lowS, prehash: !1 }, T = { lowS: t.lowS, prehash: !1 };
1224
1224
  function R(b, v, S = B) {
1225
- const { seed: I, k2sig: N } = U(b, v, S), k = t;
1226
- return jn(k.hash.outputLen, k.nByteLength, k.hmac)(I, N);
1225
+ const { seed: I, k2sig: N } = U(b, v, S), _ = t;
1226
+ return jn(_.hash.outputLen, _.nByteLength, _.hmac)(I, N);
1227
1227
  }
1228
1228
  l.BASE._setWindowSize(8);
1229
1229
  function H(b, v, S, I = T) {
@@ -1231,7 +1231,7 @@ function Zi(e) {
1231
1231
  const N = b;
1232
1232
  if (v = Z("msgHash", v), S = Z("publicKey", S), "strict" in I)
1233
1233
  throw new Error("options.strict was renamed to lowS");
1234
- const { lowS: k, prehash: P } = I;
1234
+ const { lowS: _, prehash: P } = I;
1235
1235
  let $, X;
1236
1236
  try {
1237
1237
  if (typeof N == "string" || N instanceof Uint8Array)
@@ -1253,11 +1253,11 @@ function Zi(e) {
1253
1253
  throw new Error("signature must be Signature instance, Uint8Array or hex string");
1254
1254
  return !1;
1255
1255
  }
1256
- if (k && $.hasHighS())
1256
+ if (_ && $.hasHighS())
1257
1257
  return !1;
1258
1258
  P && (v = t.hash(v));
1259
- const { r: ye, s: _e } = $, Ve = x(v), ge = a(_e), xt = c(Ve * ge), Ke = c(ye * ge), ke = (Le = l.BASE.multiplyAndAddUnsafe(X, xt, Ke)) == null ? void 0 : Le.toAffine();
1260
- return ke ? c(ke.x) === ye : !1;
1259
+ const { r: ye, s: ke } = $, ze = x(v), pe = a(ke), xt = c(ze * pe), Ke = c(ye * pe), _e = (Le = l.BASE.multiplyAndAddUnsafe(X, xt, Ke)) == null ? void 0 : Le.toAffine();
1260
+ return _e ? c(_e.x) === ye : !1;
1261
1261
  }
1262
1262
  return {
1263
1263
  CURVE: t,
@@ -1267,13 +1267,13 @@ function Zi(e) {
1267
1267
  verify: H,
1268
1268
  ProjectivePoint: l,
1269
1269
  Signature: w,
1270
- utils: m
1270
+ utils: E
1271
1271
  };
1272
1272
  }
1273
1273
  let Wn = class extends Mn {
1274
1274
  constructor(t, n) {
1275
1275
  super(), this.finished = !1, this.destroyed = !1, ai(t);
1276
- const r = zt(n);
1276
+ const r = Vt(n);
1277
1277
  if (this.iHash = t.create(), typeof this.iHash.update != "function")
1278
1278
  throw new Error("Expected instance of class which extends utils.Hash");
1279
1279
  this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
@@ -1322,10 +1322,10 @@ function Wi(e, t) {
1322
1322
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
1323
1323
  const ft = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), it = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), Jn = BigInt(1), ot = BigInt(2), Kn = (e, t) => (e + t / ot) / t;
1324
1324
  function Yn(e) {
1325
- const t = ft, n = BigInt(3), r = BigInt(6), i = BigInt(11), o = BigInt(22), s = BigInt(23), c = BigInt(44), a = BigInt(88), l = e * e * e % t, f = l * l * e % t, u = J(f, n, t) * f % t, d = J(u, n, t) * f % t, g = J(d, ot, t) * l % t, p = J(g, i, t) * g % t, h = J(p, o, t) * p % t, y = J(h, c, t) * h % t, w = J(y, a, t) * y % t, m = J(w, c, t) * h % t, K = J(m, n, t) * f % t, _ = J(K, s, t) * p % t, C = J(_, r, t) * l % t, E = J(C, ot, t);
1326
- if (!Rt.eql(Rt.sqr(E), e))
1325
+ const t = ft, n = BigInt(3), r = BigInt(6), i = BigInt(11), o = BigInt(22), s = BigInt(23), c = BigInt(44), a = BigInt(88), l = e * e * e % t, f = l * l * e % t, u = J(f, n, t) * f % t, d = J(u, n, t) * f % t, p = J(d, ot, t) * l % t, g = J(p, i, t) * p % t, h = J(g, o, t) * g % t, y = J(h, c, t) * h % t, w = J(y, a, t) * y % t, E = J(w, c, t) * h % t, K = J(E, n, t) * f % t, k = J(K, s, t) * g % t, C = J(k, r, t) * l % t, m = J(C, ot, t);
1326
+ if (!Rt.eql(Rt.sqr(m), e))
1327
1327
  throw new Error("Cannot find square root");
1328
- return E;
1328
+ return m;
1329
1329
  }
1330
1330
  const Rt = Pi(ft, void 0, void 0, { sqrt: Yn }), Ue = Wi({
1331
1331
  a: BigInt(0),
@@ -1347,7 +1347,7 @@ const Rt = Pi(ft, void 0, void 0, { sqrt: Yn }), Ue = Wi({
1347
1347
  beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
1348
1348
  splitScalar: (e) => {
1349
1349
  const t = it, n = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), r = -Jn * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), i = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), o = n, s = BigInt("0x100000000000000000000000000000000"), c = Kn(o * e, t), a = Kn(-r * e, t);
1350
- let l = z(e - c * n - a * i, t), f = z(-c * r - a * o, t);
1350
+ let l = V(e - c * n - a * i, t), f = V(-c * r - a * o, t);
1351
1351
  const u = l > s, d = f > s;
1352
1352
  if (u && (l = t - l), d && (f = t - f), l > s || f > s)
1353
1353
  throw new Error("splitScalar: Endomorphism failed, k=" + e);
@@ -1363,7 +1363,7 @@ function st(e, ...t) {
1363
1363
  }
1364
1364
  return Lt(Ie(n, ...t));
1365
1365
  }
1366
- const Jt = (e) => e.toRawBytes(!0).slice(1), Pt = (e) => xe(e, 32), Nt = (e) => z(e, ft), We = (e) => z(e, it), Yt = Ue.ProjectivePoint, Ji = (e, t, n) => Yt.BASE.multiplyAndAddUnsafe(e, t, n);
1366
+ const Jt = (e) => e.toRawBytes(!0).slice(1), Pt = (e) => xe(e, 32), Nt = (e) => V(e, ft), We = (e) => V(e, it), Yt = Ue.ProjectivePoint, Ji = (e, t, n) => Yt.BASE.multiplyAndAddUnsafe(e, t, n);
1367
1367
  function Ot(e) {
1368
1368
  let t = Ue.utils.normPrivateKeyToScalar(e), n = Yt.fromPrivateKey(t);
1369
1369
  return { scalar: n.hasEvenY() ? t : We(-t), bytes: Jt(n) };
@@ -1387,10 +1387,10 @@ function Xi(e, t, n = Hn(32)) {
1387
1387
  const r = Z("message", e), { bytes: i, scalar: o } = Ot(t), s = Z("auxRand", n, 32), c = Pt(o ^ G(st("BIP0340/aux", s))), a = st("BIP0340/nonce", c, i, r), l = We(G(a));
1388
1388
  if (l === ht)
1389
1389
  throw new Error("sign failed: k is zero");
1390
- const { bytes: f, scalar: u } = Ot(l), d = er(f, i, r), g = new Uint8Array(64);
1391
- if (g.set(f, 0), g.set(Pt(We(u + d * o)), 32), !tr(g, r, i))
1390
+ const { bytes: f, scalar: u } = Ot(l), d = er(f, i, r), p = new Uint8Array(64);
1391
+ if (p.set(f, 0), p.set(Pt(We(u + d * o)), 32), !tr(p, r, i))
1392
1392
  throw new Error("sign: Invalid signature produced");
1393
- return g;
1393
+ return p;
1394
1394
  }
1395
1395
  function tr(e, t, n) {
1396
1396
  const r = Z("signature", e, 64), i = Z("message", t), o = Z("publicKey", n, 32);
@@ -1407,7 +1407,7 @@ function tr(e, t, n) {
1407
1407
  return !1;
1408
1408
  }
1409
1409
  }
1410
- const ze = {
1410
+ const Ve = {
1411
1411
  getPublicKey: Yi,
1412
1412
  sign: Xi,
1413
1413
  verify: tr,
@@ -1418,7 +1418,7 @@ const ze = {
1418
1418
  numberToBytesBE: xe,
1419
1419
  bytesToNumberBE: G,
1420
1420
  taggedHash: st,
1421
- mod: z
1421
+ mod: V
1422
1422
  }
1423
1423
  }, Ct = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
1424
1424
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1669,13 +1669,13 @@ class sr extends ao {
1669
1669
  for (let u = 0; u < 16; u++, n += 4)
1670
1670
  ve[u] = t.getUint32(n, !1);
1671
1671
  for (let u = 16; u < 64; u++) {
1672
- const d = ve[u - 15], g = ve[u - 2], p = re(d, 7) ^ re(d, 18) ^ d >>> 3, h = re(g, 17) ^ re(g, 19) ^ g >>> 10;
1673
- ve[u] = h + ve[u - 7] + p + ve[u - 16] | 0;
1672
+ const d = ve[u - 15], p = ve[u - 2], g = re(d, 7) ^ re(d, 18) ^ d >>> 3, h = re(p, 17) ^ re(p, 19) ^ p >>> 10;
1673
+ ve[u] = h + ve[u - 7] + g + ve[u - 16] | 0;
1674
1674
  }
1675
1675
  let { A: r, B: i, C: o, D: s, E: c, F: a, G: l, H: f } = this;
1676
1676
  for (let u = 0; u < 64; u++) {
1677
- const d = re(c, 6) ^ re(c, 11) ^ re(c, 25), g = f + d + co(c, a, l) + uo[u] + ve[u] | 0, h = (re(r, 2) ^ re(r, 13) ^ re(r, 22)) + lo(r, i, o) | 0;
1678
- f = l, l = a, a = c, c = s + g | 0, s = o, o = i, i = r, r = g + h | 0;
1677
+ const d = re(c, 6) ^ re(c, 11) ^ re(c, 25), p = f + d + co(c, a, l) + uo[u] + ve[u] | 0, h = (re(r, 2) ^ re(r, 13) ^ re(r, 22)) + lo(r, i, o) | 0;
1678
+ f = l, l = a, a = c, c = s + p | 0, s = o, o = i, i = r, r = p + h | 0;
1679
1679
  }
1680
1680
  r = r + this.A | 0, i = i + this.B | 0, o = o + this.C | 0, s = s + this.D | 0, c = c + this.E | 0, a = a + this.F | 0, l = l + this.G | 0, f = f + this.H | 0, this.set(r, i, o, s, c, a, l, f);
1681
1681
  }
@@ -1883,10 +1883,10 @@ function Cn(e) {
1883
1883
  }
1884
1884
  };
1885
1885
  }
1886
- const yo = fe(Se(4), he("0123456789ABCDEF"), de("")), go = fe(Se(5), he("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), yt(5), de(""));
1886
+ const yo = fe(Se(4), he("0123456789ABCDEF"), de("")), po = fe(Se(5), he("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), yt(5), de(""));
1887
1887
  fe(Se(5), he("0123456789ABCDEFGHIJKLMNOPQRSTUV"), yt(5), de(""));
1888
1888
  fe(Se(5), he("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), de(""), ar((e) => e.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1")));
1889
- const ue = fe(Se(6), he("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), yt(6), de("")), po = fe(Se(6), he("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), yt(6), de("")), Qt = (e) => fe(ho(58), he(e), de("")), qt = Qt("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
1889
+ const ue = fe(Se(6), he("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), yt(6), de("")), go = fe(Se(6), he("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), yt(6), de("")), Qt = (e) => fe(ho(58), he(e), de("")), qt = Qt("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
1890
1890
  Qt("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");
1891
1891
  Qt("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");
1892
1892
  const In = [0, 2, 3, 5, 6, 7, 9, 10, 11], wo = {
@@ -1917,7 +1917,7 @@ function Ze(e) {
1917
1917
  (t >> r & 1) === 1 && (n ^= Un[r]);
1918
1918
  return n;
1919
1919
  }
1920
- function _n(e, t, n = 1) {
1920
+ function kn(e, t, n = 1) {
1921
1921
  const r = e.length;
1922
1922
  let i = 1;
1923
1923
  for (let o = 0; o < r; o++) {
@@ -1942,10 +1942,10 @@ function lr(e) {
1942
1942
  throw new Error(`bech32.encode prefix should be string, not ${typeof f}`);
1943
1943
  if (!Array.isArray(u) || u.length && typeof u[0] != "number")
1944
1944
  throw new Error(`bech32.encode words should be array of numbers, not ${typeof u}`);
1945
- const g = f.length + 7 + u.length;
1946
- if (d !== !1 && g > d)
1947
- throw new TypeError(`Length ${g} exceeds limit ${d}`);
1948
- return f = f.toLowerCase(), `${f}1${Dt.encode(u)}${_n(f, u, t)}`;
1945
+ const p = f.length + 7 + u.length;
1946
+ if (d !== !1 && p > d)
1947
+ throw new TypeError(`Length ${p} exceeds limit ${d}`);
1948
+ return f = f.toLowerCase(), `${f}1${Dt.encode(u)}${kn(f, u, t)}`;
1949
1949
  }
1950
1950
  function c(f, u = 90) {
1951
1951
  if (typeof f != "string")
@@ -1956,16 +1956,16 @@ function lr(e) {
1956
1956
  if (f !== d && f !== f.toUpperCase())
1957
1957
  throw new Error("String must be lowercase or uppercase");
1958
1958
  f = d;
1959
- const g = f.lastIndexOf("1");
1960
- if (g === 0 || g === -1)
1959
+ const p = f.lastIndexOf("1");
1960
+ if (p === 0 || p === -1)
1961
1961
  throw new Error('Letter "1" must be present between prefix and data only');
1962
- const p = f.slice(0, g), h = f.slice(g + 1);
1962
+ const g = f.slice(0, p), h = f.slice(p + 1);
1963
1963
  if (h.length < 6)
1964
1964
  throw new Error("Data must be at least 6 characters long");
1965
- const y = Dt.decode(h).slice(0, -6), w = _n(p, y, t);
1965
+ const y = Dt.decode(h).slice(0, -6), w = kn(g, y, t);
1966
1966
  if (!h.endsWith(w))
1967
1967
  throw new Error(`Invalid checksum in ${f}: expected "${w}"`);
1968
- return { prefix: p, words: y };
1968
+ return { prefix: g, words: y };
1969
1969
  }
1970
1970
  const a = Cn(c);
1971
1971
  function l(f) {
@@ -1983,30 +1983,30 @@ const bo = {
1983
1983
  if (typeof e != "string" || e.length % 2)
1984
1984
  throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);
1985
1985
  return e.toLowerCase();
1986
- })), Eo = {
1986
+ })), mo = {
1987
1987
  utf8: bo,
1988
1988
  hex: vo,
1989
1989
  base16: yo,
1990
- base32: go,
1990
+ base32: po,
1991
1991
  base64: ue,
1992
- base64url: po,
1992
+ base64url: go,
1993
1993
  base58: qt,
1994
1994
  base58xmr: wo
1995
1995
  };
1996
- `${Object.keys(Eo).join(", ")}`;
1996
+ `${Object.keys(mo).join(", ")}`;
1997
1997
  function Ut(e) {
1998
1998
  if (!Number.isSafeInteger(e) || e < 0)
1999
1999
  throw new Error(`positive integer expected, not ${e}`);
2000
2000
  }
2001
- function kn(e) {
2001
+ function _n(e) {
2002
2002
  if (typeof e != "boolean")
2003
2003
  throw new Error(`boolean expected, not ${e}`);
2004
2004
  }
2005
- function mo(e) {
2005
+ function Eo(e) {
2006
2006
  return e instanceof Uint8Array || e != null && typeof e == "object" && e.constructor.name === "Uint8Array";
2007
2007
  }
2008
2008
  function le(e, ...t) {
2009
- if (!mo(e))
2009
+ if (!Eo(e))
2010
2010
  throw new Error("Uint8Array expected");
2011
2011
  if (t.length > 0 && !t.includes(e.length))
2012
2012
  throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`);
@@ -2028,7 +2028,7 @@ function So(e, t) {
2028
2028
  n |= e[r] ^ t[r];
2029
2029
  return n === 0;
2030
2030
  }
2031
- const Ko = /* @__NO_SIDE_EFFECTS__ */ (e, t) => (Object.assign(t, e), t), me = 16, Bo = 283;
2031
+ const Ko = /* @__NO_SIDE_EFFECTS__ */ (e, t) => (Object.assign(t, e), t), Ee = 16, Bo = 283;
2032
2032
  function en(e) {
2033
2033
  return e << 1 ^ Bo & -(e >> 7);
2034
2034
  }
@@ -2049,11 +2049,11 @@ const jt = /* @__PURE__ */ (() => {
2049
2049
  r |= r << 8, t[e[n]] = (r ^ r >> 4 ^ r >> 5 ^ r >> 6 ^ r >> 7 ^ 99) & 255;
2050
2050
  }
2051
2051
  return t;
2052
- })(), No = /* @__PURE__ */ jt.map((e, t) => jt.indexOf(t)), Co = (e) => e << 24 | e >>> 8, _t = (e) => e << 8 | e >>> 24;
2052
+ })(), No = /* @__PURE__ */ jt.map((e, t) => jt.indexOf(t)), Co = (e) => e << 24 | e >>> 8, kt = (e) => e << 8 | e >>> 24;
2053
2053
  function ur(e, t) {
2054
2054
  if (e.length !== 256)
2055
2055
  throw new Error("Wrong sbox length");
2056
- const n = new Uint32Array(256).map((l, f) => t(e[f])), r = n.map(_t), i = r.map(_t), o = i.map(_t), s = new Uint32Array(256 * 256), c = new Uint32Array(256 * 256), a = new Uint16Array(256 * 256);
2056
+ const n = new Uint32Array(256).map((l, f) => t(e[f])), r = n.map(kt), i = r.map(kt), o = i.map(kt), s = new Uint32Array(256 * 256), c = new Uint32Array(256 * 256), a = new Uint16Array(256 * 256);
2057
2057
  for (let l = 0; l < 256; l++)
2058
2058
  for (let f = 0; f < 256; f++) {
2059
2059
  const u = l * 256 + f;
@@ -2092,7 +2092,7 @@ function Uo(e) {
2092
2092
  }
2093
2093
  return n;
2094
2094
  }
2095
- function Ee(e, t, n, r, i, o) {
2095
+ function me(e, t, n, r, i, o) {
2096
2096
  return e[n << 8 & 65280 | r >>> 8 & 255] ^ t[i >>> 8 & 65280 | o >>> 24 & 255];
2097
2097
  }
2098
2098
  function se(e, t, n, r, i) {
@@ -2103,24 +2103,24 @@ function Ln(e, t, n, r, i) {
2103
2103
  let a = 0;
2104
2104
  t ^= e[a++], n ^= e[a++], r ^= e[a++], i ^= e[a++];
2105
2105
  const l = e.length / 4 - 2;
2106
- for (let p = 0; p < l; p++) {
2107
- const h = e[a++] ^ Ee(s, c, t, n, r, i), y = e[a++] ^ Ee(s, c, n, r, i, t), w = e[a++] ^ Ee(s, c, r, i, t, n), m = e[a++] ^ Ee(s, c, i, t, n, r);
2108
- t = h, n = y, r = w, i = m;
2106
+ for (let g = 0; g < l; g++) {
2107
+ const h = e[a++] ^ me(s, c, t, n, r, i), y = e[a++] ^ me(s, c, n, r, i, t), w = e[a++] ^ me(s, c, r, i, t, n), E = e[a++] ^ me(s, c, i, t, n, r);
2108
+ t = h, n = y, r = w, i = E;
2109
2109
  }
2110
- const f = e[a++] ^ se(o, t, n, r, i), u = e[a++] ^ se(o, n, r, i, t), d = e[a++] ^ se(o, r, i, t, n), g = e[a++] ^ se(o, i, t, n, r);
2111
- return { s0: f, s1: u, s2: d, s3: g };
2110
+ const f = e[a++] ^ se(o, t, n, r, i), u = e[a++] ^ se(o, n, r, i, t), d = e[a++] ^ se(o, r, i, t, n), p = e[a++] ^ se(o, i, t, n, r);
2111
+ return { s0: f, s1: u, s2: d, s3: p };
2112
2112
  }
2113
- function _o(e, t, n, r, i) {
2113
+ function ko(e, t, n, r, i) {
2114
2114
  const { sbox2: o, T01: s, T23: c } = fr;
2115
2115
  let a = 0;
2116
2116
  t ^= e[a++], n ^= e[a++], r ^= e[a++], i ^= e[a++];
2117
2117
  const l = e.length / 4 - 2;
2118
- for (let p = 0; p < l; p++) {
2119
- const h = e[a++] ^ Ee(s, c, t, i, r, n), y = e[a++] ^ Ee(s, c, n, t, i, r), w = e[a++] ^ Ee(s, c, r, n, t, i), m = e[a++] ^ Ee(s, c, i, r, n, t);
2120
- t = h, n = y, r = w, i = m;
2118
+ for (let g = 0; g < l; g++) {
2119
+ const h = e[a++] ^ me(s, c, t, i, r, n), y = e[a++] ^ me(s, c, n, t, i, r), w = e[a++] ^ me(s, c, r, n, t, i), E = e[a++] ^ me(s, c, i, r, n, t);
2120
+ t = h, n = y, r = w, i = E;
2121
2121
  }
2122
- const f = e[a++] ^ se(o, t, i, r, n), u = e[a++] ^ se(o, n, t, i, r), d = e[a++] ^ se(o, r, n, t, i), g = e[a++] ^ se(o, i, r, n, t);
2123
- return { s0: f, s1: u, s2: d, s3: g };
2122
+ const f = e[a++] ^ se(o, t, i, r, n), u = e[a++] ^ se(o, n, t, i, r), d = e[a++] ^ se(o, r, n, t, i), p = e[a++] ^ se(o, i, r, n, t);
2123
+ return { s0: f, s1: u, s2: d, s3: p };
2124
2124
  }
2125
2125
  function dr(e, t) {
2126
2126
  if (!t)
@@ -2129,19 +2129,19 @@ function dr(e, t) {
2129
2129
  throw new Error(`aes: wrong destination length, expected at least ${e}, got: ${t.length}`);
2130
2130
  return t;
2131
2131
  }
2132
- function ko(e) {
2133
- if (le(e), e.length % me !== 0)
2134
- throw new Error(`aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size ${me}`);
2132
+ function _o(e) {
2133
+ if (le(e), e.length % Ee !== 0)
2134
+ throw new Error(`aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size ${Ee}`);
2135
2135
  }
2136
2136
  function Lo(e, t, n) {
2137
2137
  let r = e.length;
2138
- const i = r % me;
2138
+ const i = r % Ee;
2139
2139
  if (!t && i !== 0)
2140
2140
  throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");
2141
2141
  const o = F(e);
2142
2142
  if (t) {
2143
- let a = me - i;
2144
- a || (a = me), r = r + a;
2143
+ let a = Ee - i;
2144
+ a || (a = Ee), r = r + a;
2145
2145
  }
2146
2146
  const s = dr(r, n), c = F(s);
2147
2147
  return { b: o, o: c, out: s };
@@ -2164,8 +2164,8 @@ function $o(e, t) {
2164
2164
  function To(e) {
2165
2165
  const t = new Uint8Array(16), n = F(t);
2166
2166
  t.set(e);
2167
- const r = me - e.length;
2168
- for (let i = me - r; i < me; i++)
2167
+ const r = Ee - e.length;
2168
+ for (let i = Ee - r; i < Ee; i++)
2169
2169
  t[i] = r;
2170
2170
  return n;
2171
2171
  }
@@ -2175,102 +2175,102 @@ const yr = /* @__PURE__ */ Ko({ blockSize: 16, nonceLength: 16 }, function(t, n,
2175
2175
  return {
2176
2176
  encrypt: (o, s) => {
2177
2177
  const c = hr(t), { b: a, o: l, out: f } = Lo(o, i, s), u = F(n);
2178
- let d = u[0], g = u[1], p = u[2], h = u[3], y = 0;
2178
+ let d = u[0], p = u[1], g = u[2], h = u[3], y = 0;
2179
2179
  for (; y + 4 <= a.length; )
2180
- d ^= a[y + 0], g ^= a[y + 1], p ^= a[y + 2], h ^= a[y + 3], { s0: d, s1: g, s2: p, s3: h } = Ln(c, d, g, p, h), l[y++] = d, l[y++] = g, l[y++] = p, l[y++] = h;
2180
+ d ^= a[y + 0], p ^= a[y + 1], g ^= a[y + 2], h ^= a[y + 3], { s0: d, s1: p, s2: g, s3: h } = Ln(c, d, p, g, h), l[y++] = d, l[y++] = p, l[y++] = g, l[y++] = h;
2181
2181
  if (i) {
2182
2182
  const w = To(o.subarray(y * 4));
2183
- d ^= w[0], g ^= w[1], p ^= w[2], h ^= w[3], { s0: d, s1: g, s2: p, s3: h } = Ln(c, d, g, p, h), l[y++] = d, l[y++] = g, l[y++] = p, l[y++] = h;
2183
+ d ^= w[0], p ^= w[1], g ^= w[2], h ^= w[3], { s0: d, s1: p, s2: g, s3: h } = Ln(c, d, p, g, h), l[y++] = d, l[y++] = p, l[y++] = g, l[y++] = h;
2184
2184
  }
2185
2185
  return c.fill(0), f;
2186
2186
  },
2187
2187
  decrypt: (o, s) => {
2188
- ko(o);
2188
+ _o(o);
2189
2189
  const c = Uo(t), a = F(n), l = dr(o.length, s), f = F(o), u = F(l);
2190
- let d = a[0], g = a[1], p = a[2], h = a[3];
2190
+ let d = a[0], p = a[1], g = a[2], h = a[3];
2191
2191
  for (let y = 0; y + 4 <= f.length; ) {
2192
- const w = d, m = g, K = p, _ = h;
2193
- d = f[y + 0], g = f[y + 1], p = f[y + 2], h = f[y + 3];
2194
- const { s0: C, s1: E, s2: x, s3: A } = _o(c, d, g, p, h);
2195
- u[y++] = C ^ w, u[y++] = E ^ m, u[y++] = x ^ K, u[y++] = A ^ _;
2192
+ const w = d, E = p, K = g, k = h;
2193
+ d = f[y + 0], p = f[y + 1], g = f[y + 2], h = f[y + 3];
2194
+ const { s0: C, s1: m, s2: x, s3: A } = ko(c, d, p, g, h);
2195
+ u[y++] = C ^ w, u[y++] = m ^ E, u[y++] = x ^ K, u[y++] = A ^ k;
2196
2196
  }
2197
2197
  return c.fill(0), $o(l, i);
2198
2198
  }
2199
2199
  };
2200
- }), gr = (e) => Uint8Array.from(e.split("").map((t) => t.charCodeAt(0))), Ro = gr("expand 16-byte k"), Po = gr("expand 32-byte k"), Oo = F(Ro), pr = F(Po);
2201
- pr.slice();
2200
+ }), pr = (e) => Uint8Array.from(e.split("").map((t) => t.charCodeAt(0))), Ro = pr("expand 16-byte k"), Po = pr("expand 32-byte k"), Oo = F(Ro), gr = F(Po);
2201
+ gr.slice();
2202
2202
  function L(e, t) {
2203
2203
  return e << t | e >>> 32 - t;
2204
2204
  }
2205
- function Vt(e) {
2205
+ function zt(e) {
2206
2206
  return e.byteOffset % 4 === 0;
2207
2207
  }
2208
2208
  const Xe = 64, Mo = 16, wr = 2 ** 32 - 1, $n = new Uint32Array();
2209
2209
  function Ho(e, t, n, r, i, o, s, c) {
2210
- const a = i.length, l = new Uint8Array(Xe), f = F(l), u = Vt(i) && Vt(o), d = u ? F(i) : $n, g = u ? F(o) : $n;
2211
- for (let p = 0; p < a; s++) {
2210
+ const a = i.length, l = new Uint8Array(Xe), f = F(l), u = zt(i) && zt(o), d = u ? F(i) : $n, p = u ? F(o) : $n;
2211
+ for (let g = 0; g < a; s++) {
2212
2212
  if (e(t, n, r, f, s, c), s >= wr)
2213
2213
  throw new Error("arx: counter overflow");
2214
- const h = Math.min(Xe, a - p);
2214
+ const h = Math.min(Xe, a - g);
2215
2215
  if (u && h === Xe) {
2216
- const y = p / 4;
2217
- if (p % 4 !== 0)
2216
+ const y = g / 4;
2217
+ if (g % 4 !== 0)
2218
2218
  throw new Error("arx: invalid block position");
2219
- for (let w = 0, m; w < Mo; w++)
2220
- m = y + w, g[m] = d[m] ^ f[w];
2221
- p += Xe;
2219
+ for (let w = 0, E; w < Mo; w++)
2220
+ E = y + w, p[E] = d[E] ^ f[w];
2221
+ g += Xe;
2222
2222
  continue;
2223
2223
  }
2224
2224
  for (let y = 0, w; y < h; y++)
2225
- w = p + y, o[w] = i[w] ^ l[y];
2226
- p += h;
2225
+ w = g + y, o[w] = i[w] ^ l[y];
2226
+ g += h;
2227
2227
  }
2228
2228
  }
2229
2229
  function qo(e, t) {
2230
2230
  const { allowShortKeys: n, extendNonceFn: r, counterLength: i, counterRight: o, rounds: s } = Ao({ allowShortKeys: !1, counterLength: 8, counterRight: !1, rounds: 20 }, t);
2231
2231
  if (typeof e != "function")
2232
2232
  throw new Error("core must be a function");
2233
- return Ut(i), Ut(s), kn(o), kn(n), (c, a, l, f, u = 0) => {
2233
+ return Ut(i), Ut(s), _n(o), _n(n), (c, a, l, f, u = 0) => {
2234
2234
  le(c), le(a), le(l);
2235
2235
  const d = l.length;
2236
2236
  if (f || (f = new Uint8Array(d)), le(f), Ut(u), u < 0 || u >= wr)
2237
2237
  throw new Error("arx: counter overflow");
2238
2238
  if (f.length < d)
2239
2239
  throw new Error(`arx: output (${f.length}) is shorter than data (${d})`);
2240
- const g = [];
2241
- let p = c.length, h, y;
2242
- if (p === 32)
2243
- h = c.slice(), g.push(h), y = pr;
2244
- else if (p === 16 && n)
2245
- h = new Uint8Array(32), h.set(c), h.set(c, 16), y = Oo, g.push(h);
2240
+ const p = [];
2241
+ let g = c.length, h, y;
2242
+ if (g === 32)
2243
+ h = c.slice(), p.push(h), y = gr;
2244
+ else if (g === 16 && n)
2245
+ h = new Uint8Array(32), h.set(c), h.set(c, 16), y = Oo, p.push(h);
2246
2246
  else
2247
- throw new Error(`arx: invalid 32-byte key, got length=${p}`);
2248
- Vt(a) || (a = a.slice(), g.push(a));
2247
+ throw new Error(`arx: invalid 32-byte key, got length=${g}`);
2248
+ zt(a) || (a = a.slice(), p.push(a));
2249
2249
  const w = F(h);
2250
2250
  if (r) {
2251
2251
  if (a.length !== 24)
2252
2252
  throw new Error("arx: extended nonce must be 24 bytes");
2253
2253
  r(y, w, F(a.subarray(0, 16)), w), a = a.subarray(16);
2254
2254
  }
2255
- const m = 16 - i;
2256
- if (m !== a.length)
2257
- throw new Error(`arx: nonce must be ${m} or 16 bytes`);
2258
- if (m !== 12) {
2259
- const _ = new Uint8Array(12);
2260
- _.set(a, o ? 0 : 12 - a.length), a = _, g.push(a);
2255
+ const E = 16 - i;
2256
+ if (E !== a.length)
2257
+ throw new Error(`arx: nonce must be ${E} or 16 bytes`);
2258
+ if (E !== 12) {
2259
+ const k = new Uint8Array(12);
2260
+ k.set(a, o ? 0 : 12 - a.length), a = k, p.push(a);
2261
2261
  }
2262
2262
  const K = F(a);
2263
- for (Ho(e, y, w, K, l, f, u, s); g.length > 0; )
2264
- g.pop().fill(0);
2263
+ for (Ho(e, y, w, K, l, f, u, s); p.length > 0; )
2264
+ p.pop().fill(0);
2265
2265
  return f;
2266
2266
  };
2267
2267
  }
2268
2268
  function Do(e, t, n, r, i, o = 20) {
2269
- let s = e[0], c = e[1], a = e[2], l = e[3], f = t[0], u = t[1], d = t[2], g = t[3], p = t[4], h = t[5], y = t[6], w = t[7], m = i, K = n[0], _ = n[1], C = n[2], E = s, x = c, A = a, O = l, U = f, B = u, T = d, R = g, H = p, b = h, v = y, S = w, I = m, N = K, k = _, P = C;
2269
+ let s = e[0], c = e[1], a = e[2], l = e[3], f = t[0], u = t[1], d = t[2], p = t[3], g = t[4], h = t[5], y = t[6], w = t[7], E = i, K = n[0], k = n[1], C = n[2], m = s, x = c, A = a, O = l, U = f, B = u, T = d, R = p, H = g, b = h, v = y, S = w, I = E, N = K, _ = k, P = C;
2270
2270
  for (let X = 0; X < o; X += 2)
2271
- E = E + U | 0, I = L(I ^ E, 16), H = H + I | 0, U = L(U ^ H, 12), E = E + U | 0, I = L(I ^ E, 8), H = H + I | 0, U = L(U ^ H, 7), x = x + B | 0, N = L(N ^ x, 16), b = b + N | 0, B = L(B ^ b, 12), x = x + B | 0, N = L(N ^ x, 8), b = b + N | 0, B = L(B ^ b, 7), A = A + T | 0, k = L(k ^ A, 16), v = v + k | 0, T = L(T ^ v, 12), A = A + T | 0, k = L(k ^ A, 8), v = v + k | 0, T = L(T ^ v, 7), O = O + R | 0, P = L(P ^ O, 16), S = S + P | 0, R = L(R ^ S, 12), O = O + R | 0, P = L(P ^ O, 8), S = S + P | 0, R = L(R ^ S, 7), E = E + B | 0, P = L(P ^ E, 16), v = v + P | 0, B = L(B ^ v, 12), E = E + B | 0, P = L(P ^ E, 8), v = v + P | 0, B = L(B ^ v, 7), x = x + T | 0, I = L(I ^ x, 16), S = S + I | 0, T = L(T ^ S, 12), x = x + T | 0, I = L(I ^ x, 8), S = S + I | 0, T = L(T ^ S, 7), A = A + R | 0, N = L(N ^ A, 16), H = H + N | 0, R = L(R ^ H, 12), A = A + R | 0, N = L(N ^ A, 8), H = H + N | 0, R = L(R ^ H, 7), O = O + U | 0, k = L(k ^ O, 16), b = b + k | 0, U = L(U ^ b, 12), O = O + U | 0, k = L(k ^ O, 8), b = b + k | 0, U = L(U ^ b, 7);
2271
+ m = m + U | 0, I = L(I ^ m, 16), H = H + I | 0, U = L(U ^ H, 12), m = m + U | 0, I = L(I ^ m, 8), H = H + I | 0, U = L(U ^ H, 7), x = x + B | 0, N = L(N ^ x, 16), b = b + N | 0, B = L(B ^ b, 12), x = x + B | 0, N = L(N ^ x, 8), b = b + N | 0, B = L(B ^ b, 7), A = A + T | 0, _ = L(_ ^ A, 16), v = v + _ | 0, T = L(T ^ v, 12), A = A + T | 0, _ = L(_ ^ A, 8), v = v + _ | 0, T = L(T ^ v, 7), O = O + R | 0, P = L(P ^ O, 16), S = S + P | 0, R = L(R ^ S, 12), O = O + R | 0, P = L(P ^ O, 8), S = S + P | 0, R = L(R ^ S, 7), m = m + B | 0, P = L(P ^ m, 16), v = v + P | 0, B = L(B ^ v, 12), m = m + B | 0, P = L(P ^ m, 8), v = v + P | 0, B = L(B ^ v, 7), x = x + T | 0, I = L(I ^ x, 16), S = S + I | 0, T = L(T ^ S, 12), x = x + T | 0, I = L(I ^ x, 8), S = S + I | 0, T = L(T ^ S, 7), A = A + R | 0, N = L(N ^ A, 16), H = H + N | 0, R = L(R ^ H, 12), A = A + R | 0, N = L(N ^ A, 8), H = H + N | 0, R = L(R ^ H, 7), O = O + U | 0, _ = L(_ ^ O, 16), b = b + _ | 0, U = L(U ^ b, 12), O = O + U | 0, _ = L(_ ^ O, 8), b = b + _ | 0, U = L(U ^ b, 7);
2272
2272
  let $ = 0;
2273
- r[$++] = s + E | 0, r[$++] = c + x | 0, r[$++] = a + A | 0, r[$++] = l + O | 0, r[$++] = f + U | 0, r[$++] = u + B | 0, r[$++] = d + T | 0, r[$++] = g + R | 0, r[$++] = p + H | 0, r[$++] = h + b | 0, r[$++] = y + v | 0, r[$++] = w + S | 0, r[$++] = m + I | 0, r[$++] = K + N | 0, r[$++] = _ + k | 0, r[$++] = C + P | 0;
2273
+ r[$++] = s + m | 0, r[$++] = c + x | 0, r[$++] = a + A | 0, r[$++] = l + O | 0, r[$++] = f + U | 0, r[$++] = u + B | 0, r[$++] = d + T | 0, r[$++] = p + R | 0, r[$++] = g + H | 0, r[$++] = h + b | 0, r[$++] = y + v | 0, r[$++] = w + S | 0, r[$++] = E + I | 0, r[$++] = K + N | 0, r[$++] = k + _ | 0, r[$++] = C + P | 0;
2274
2274
  }
2275
2275
  const br = /* @__PURE__ */ qo(Do, {
2276
2276
  counterRight: !1,
@@ -2312,28 +2312,28 @@ class vr extends nr {
2312
2312
  this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
2313
2313
  }
2314
2314
  }
2315
- const gt = (e, t, n) => new vr(e, t).update(n).digest();
2316
- gt.create = (e, t) => new vr(e, t);
2315
+ const pt = (e, t, n) => new vr(e, t).update(n).digest();
2316
+ pt.create = (e, t) => new vr(e, t);
2317
2317
  function nn(e, t, n) {
2318
- return oe.hash(e), n === void 0 && (n = new Uint8Array(e.outputLen)), gt(e, Ge(n), Ge(t));
2318
+ return oe.hash(e), n === void 0 && (n = new Uint8Array(e.outputLen)), pt(e, Ge(n), Ge(t));
2319
2319
  }
2320
- const kt = new Uint8Array([0]), Tn = new Uint8Array();
2321
- function Er(e, t, n, r = 32) {
2320
+ const _t = new Uint8Array([0]), Tn = new Uint8Array();
2321
+ function mr(e, t, n, r = 32) {
2322
2322
  if (oe.hash(e), oe.number(r), r > 255 * e.outputLen)
2323
2323
  throw new Error("Length should be <= 255*HashLen");
2324
2324
  const i = Math.ceil(r / e.outputLen);
2325
2325
  n === void 0 && (n = Tn);
2326
- const o = new Uint8Array(i * e.outputLen), s = gt.create(e, t), c = s._cloneInto(), a = new Uint8Array(s.outputLen);
2326
+ const o = new Uint8Array(i * e.outputLen), s = pt.create(e, t), c = s._cloneInto(), a = new Uint8Array(s.outputLen);
2327
2327
  for (let l = 0; l < i; l++)
2328
- kt[0] = l + 1, c.update(l === 0 ? Tn : a).update(n).update(kt).digestInto(a), o.set(a, e.outputLen * l), s._cloneInto(c);
2329
- return s.destroy(), c.destroy(), a.fill(0), kt.fill(0), o.slice(0, r);
2328
+ _t[0] = l + 1, c.update(l === 0 ? Tn : a).update(n).update(_t).digestInto(a), o.set(a, e.outputLen * l), s._cloneInto(c);
2329
+ return s.destroy(), c.destroy(), a.fill(0), _t.fill(0), o.slice(0, r);
2330
2330
  }
2331
2331
  var jo = Object.defineProperty, D = (e, t) => {
2332
2332
  for (var n in t)
2333
2333
  jo(e, n, { get: t[n], enumerable: !0 });
2334
- }, Te = Symbol("verified"), Vo = (e) => e instanceof Object;
2335
- function mr(e) {
2336
- if (!Vo(e) || typeof e.kind != "number" || typeof e.content != "string" || typeof e.created_at != "number" || typeof e.pubkey != "string" || !e.pubkey.match(/^[a-f0-9]{64}$/) || !Array.isArray(e.tags))
2334
+ }, Te = Symbol("verified"), zo = (e) => e instanceof Object;
2335
+ function Er(e) {
2336
+ if (!zo(e) || typeof e.kind != "number" || typeof e.content != "string" || typeof e.created_at != "number" || typeof e.pubkey != "string" || !e.pubkey.match(/^[a-f0-9]{64}$/) || !Array.isArray(e.tags))
2337
2337
  return !1;
2338
2338
  for (let t = 0; t < e.tags.length; t++) {
2339
2339
  let n = e.tags[t];
@@ -2345,8 +2345,8 @@ function mr(e) {
2345
2345
  }
2346
2346
  return !0;
2347
2347
  }
2348
- var zo = {};
2349
- D(zo, {
2348
+ var Vo = {};
2349
+ D(Vo, {
2350
2350
  Queue: () => Go,
2351
2351
  QueueNode: () => xr,
2352
2352
  binarySearch: () => rn,
@@ -2409,14 +2409,14 @@ var xr = class {
2409
2409
  }
2410
2410
  }, Jo = class {
2411
2411
  generateSecretKey() {
2412
- return ze.utils.randomPrivateKey();
2412
+ return Ve.utils.randomPrivateKey();
2413
2413
  }
2414
2414
  getPublicKey(e) {
2415
- return M(ze.getPublicKey(e));
2415
+ return M(Ve.getPublicKey(e));
2416
2416
  }
2417
2417
  finalizeEvent(e, t) {
2418
2418
  const n = e;
2419
- return n.pubkey = M(ze.getPublicKey(t)), n.id = tt(n), n.sig = M(ze.sign(tt(n), t)), n[Te] = !0, n;
2419
+ return n.pubkey = M(Ve.getPublicKey(t)), n.id = tt(n), n.sig = M(Ve.sign(tt(n), t)), n[Te] = !0, n;
2420
2420
  }
2421
2421
  verifyEvent(e) {
2422
2422
  if (typeof e[Te] == "boolean")
@@ -2425,7 +2425,7 @@ var xr = class {
2425
2425
  if (t !== e.id)
2426
2426
  return e[Te] = !1, !1;
2427
2427
  try {
2428
- const n = ze.verify(e.sig, t, e.pubkey);
2428
+ const n = Ve.verify(e.sig, t, e.pubkey);
2429
2429
  return e[Te] = n, n;
2430
2430
  } catch {
2431
2431
  return e[Te] = !1, !1;
@@ -2433,7 +2433,7 @@ var xr = class {
2433
2433
  }
2434
2434
  };
2435
2435
  function Yo(e) {
2436
- if (!mr(e))
2436
+ if (!Er(e))
2437
2437
  throw new Error("can't serialize event with wrong or missing properties");
2438
2438
  return JSON.stringify([0, e.pubkey, e.created_at, e.kind, e.tags, e.content]);
2439
2439
  }
@@ -2441,11 +2441,11 @@ function tt(e) {
2441
2441
  let t = Ae(te.encode(Yo(e)));
2442
2442
  return M(t);
2443
2443
  }
2444
- var pt = new Jo(), Oe = pt.generateSecretKey, Ce = pt.getPublicKey, ae = pt.finalizeEvent, on = pt.verifyEvent, Xo = {};
2444
+ var gt = new Jo(), Oe = gt.generateSecretKey, Ce = gt.getPublicKey, ae = gt.finalizeEvent, on = gt.verifyEvent, Xo = {};
2445
2445
  D(Xo, {
2446
2446
  Application: () => Xs,
2447
2447
  BadgeAward: () => as,
2448
- BadgeDefinition: () => zs,
2448
+ BadgeDefinition: () => Vs,
2449
2449
  BlockedRelaysList: () => Us,
2450
2450
  BookmarkList: () => Ns,
2451
2451
  Bookmarksets: () => Ds,
@@ -2455,12 +2455,12 @@ D(Xo, {
2455
2455
  ChannelHideMessage: () => Ur,
2456
2456
  ChannelMessage: () => Ir,
2457
2457
  ChannelMetadata: () => Cr,
2458
- ChannelMuteUser: () => _r,
2458
+ ChannelMuteUser: () => kr,
2459
2459
  ClassifiedListing: () => ta,
2460
- ClientAuth: () => kr,
2460
+ ClientAuth: () => _r,
2461
2461
  CommunitiesList: () => Cs,
2462
2462
  CommunityDefinition: () => la,
2463
- CommunityPostApproval: () => ps,
2463
+ CommunityPostApproval: () => gs,
2464
2464
  Contacts: () => rs,
2465
2465
  CreateOrUpdateProduct: () => Ws,
2466
2466
  CreateOrUpdateStall: () => Fs,
@@ -2481,12 +2481,12 @@ D(Xo, {
2481
2481
  Handlerinformation: () => ca,
2482
2482
  Handlerrecommendation: () => aa,
2483
2483
  Highlights: () => As,
2484
- InterestsList: () => ks,
2484
+ InterestsList: () => _s,
2485
2485
  Interestsets: () => Zs,
2486
2486
  JobFeedback: () => vs,
2487
2487
  JobRequest: () => ws,
2488
2488
  JobResult: () => bs,
2489
- Label: () => gs,
2489
+ Label: () => ps,
2490
2490
  LightningPubRPC: () => Rs,
2491
2491
  LiveChatMessage: () => fs,
2492
2492
  LiveEvent: () => Qs,
@@ -2500,7 +2500,7 @@ D(Xo, {
2500
2500
  OpenTimestamps: () => ls,
2501
2501
  Pinlist: () => Ks,
2502
2502
  ProblemTracker: () => hs,
2503
- ProfileBadges: () => Vs,
2503
+ ProfileBadges: () => zs,
2504
2504
  PublicChatsList: () => Is,
2505
2505
  Reaction: () => an,
2506
2506
  RecommendRelay: () => ns,
@@ -2509,14 +2509,14 @@ D(Xo, {
2509
2509
  Report: () => ds,
2510
2510
  Reporting: () => ys,
2511
2511
  Repost: () => sn,
2512
- SearchRelaysList: () => _s,
2512
+ SearchRelaysList: () => ks,
2513
2513
  ShortTextNote: () => ts,
2514
2514
  Time: () => ia,
2515
2515
  UserEmojiList: () => Ls,
2516
2516
  UserStatuses: () => ea,
2517
2517
  Zap: () => xs,
2518
- ZapGoal: () => Es,
2519
- ZapRequest: () => ms,
2518
+ ZapGoal: () => ms,
2519
+ ZapRequest: () => Es,
2520
2520
  classifyKind: () => Qo,
2521
2521
  isEphemeralKind: () => Kr,
2522
2522
  isParameterizedReplaceableKind: () => Br,
@@ -2538,7 +2538,7 @@ function Br(e) {
2538
2538
  function Qo(e) {
2539
2539
  return Ar(e) ? "regular" : Sr(e) ? "replaceable" : Kr(e) ? "ephemeral" : Br(e) ? "parameterized" : "unknown";
2540
2540
  }
2541
- var es = 0, ts = 1, ns = 2, rs = 3, is = 4, os = 4, ss = 5, sn = 6, an = 7, as = 8, cs = 16, Nr = 40, Cr = 41, Ir = 42, Ur = 43, _r = 44, ls = 1040, us = 1063, fs = 1311, hs = 1971, ds = 1984, ys = 1984, gs = 1985, ps = 4550, ws = 5999, bs = 6999, vs = 7e3, Es = 9041, ms = 9734, xs = 9735, As = 9802, Ss = 1e4, Ks = 10001, Bs = 10002, Ns = 10003, Cs = 10004, Is = 10005, Us = 10006, _s = 10007, ks = 10015, Ls = 10030, $s = 10096, Ts = 13194, Rs = 21e3, kr = 22242, Lr = 23194, Ps = 23195, Os = 24133, cn = 27235, Ms = 3e4, Hs = 30001, qs = 30002, Ds = 30003, js = 30004, Vs = 30008, zs = 30009, Zs = 30015, Fs = 30017, Ws = 30018, Gs = 30023, Js = 30024, Ys = 30030, Xs = 30078, Qs = 30311, ea = 30315, ta = 30402, na = 30403, ra = 31922, ia = 31923, oa = 31924, sa = 31925, aa = 31989, ca = 31990, la = 34550, ua = {};
2541
+ var es = 0, ts = 1, ns = 2, rs = 3, is = 4, os = 4, ss = 5, sn = 6, an = 7, as = 8, cs = 16, Nr = 40, Cr = 41, Ir = 42, Ur = 43, kr = 44, ls = 1040, us = 1063, fs = 1311, hs = 1971, ds = 1984, ys = 1984, ps = 1985, gs = 4550, ws = 5999, bs = 6999, vs = 7e3, ms = 9041, Es = 9734, xs = 9735, As = 9802, Ss = 1e4, Ks = 10001, Bs = 10002, Ns = 10003, Cs = 10004, Is = 10005, Us = 10006, ks = 10007, _s = 10015, Ls = 10030, $s = 10096, Ts = 13194, Rs = 21e3, _r = 22242, Lr = 23194, Ps = 23195, Os = 24133, cn = 27235, Ms = 3e4, Hs = 30001, qs = 30002, Ds = 30003, js = 30004, zs = 30008, Vs = 30009, Zs = 30015, Fs = 30017, Ws = 30018, Gs = 30023, Js = 30024, Ys = 30030, Xs = 30078, Qs = 30311, ea = 30315, ta = 30402, na = 30403, ra = 31922, ia = 31923, oa = 31924, sa = 31925, aa = 31989, ca = 31990, la = 34550, ua = {};
2542
2542
  D(ua, {
2543
2543
  getHex64: () => ln,
2544
2544
  getInt: () => $r,
@@ -2577,13 +2577,13 @@ function da(e, t) {
2577
2577
  function ya(e, t) {
2578
2578
  return t === $r(e, "kind");
2579
2579
  }
2580
- var ga = {};
2581
- D(ga, {
2582
- makeAuthEvent: () => pa
2580
+ var pa = {};
2581
+ D(pa, {
2582
+ makeAuthEvent: () => ga
2583
2583
  });
2584
- function pa(e, t) {
2584
+ function ga(e, t) {
2585
2585
  return {
2586
- kind: kr,
2586
+ kind: _r,
2587
2587
  created_at: Math.floor(Date.now() / 1e3),
2588
2588
  tags: [
2589
2589
  ["relay", e],
@@ -2612,9 +2612,9 @@ D(Fe, {
2612
2612
  neventEncode: () => Sa,
2613
2613
  noteEncode: () => xa,
2614
2614
  nprofileEncode: () => Aa,
2615
- npubEncode: () => ma,
2615
+ npubEncode: () => Ea,
2616
2616
  nrelayEncode: () => Ba,
2617
- nsecEncode: () => Ea
2617
+ nsecEncode: () => ma
2618
2618
  });
2619
2619
  var un = 5e3, Tr = /[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;
2620
2620
  function va(e) {
@@ -2635,7 +2635,7 @@ function wt(e) {
2635
2635
  type: "nprofile",
2636
2636
  data: {
2637
2637
  pubkey: M(d[0][0]),
2638
- relays: d[1] ? d[1].map((g) => ie.decode(g)) : []
2638
+ relays: d[1] ? d[1].map((p) => ie.decode(p)) : []
2639
2639
  }
2640
2640
  };
2641
2641
  }
@@ -2653,7 +2653,7 @@ function wt(e) {
2653
2653
  type: "nevent",
2654
2654
  data: {
2655
2655
  id: M(d[0][0]),
2656
- relays: d[1] ? d[1].map((g) => ie.decode(g)) : [],
2656
+ relays: d[1] ? d[1].map((p) => ie.decode(p)) : [],
2657
2657
  author: (s = d[2]) != null && s[0] ? M(d[2][0]) : void 0,
2658
2658
  kind: (c = d[3]) != null && c[0] ? parseInt(M(d[3][0]), 16) : void 0
2659
2659
  }
@@ -2677,7 +2677,7 @@ function wt(e) {
2677
2677
  identifier: ie.decode(d[0][0]),
2678
2678
  pubkey: M(d[2][0]),
2679
2679
  kind: parseInt(M(d[3][0]), 16),
2680
- relays: d[1] ? d[1].map((g) => ie.decode(g)) : []
2680
+ relays: d[1] ? d[1].map((p) => ie.decode(p)) : []
2681
2681
  }
2682
2682
  };
2683
2683
  }
@@ -2709,10 +2709,10 @@ function Qe(e) {
2709
2709
  }
2710
2710
  return t;
2711
2711
  }
2712
- function Ea(e) {
2712
+ function ma(e) {
2713
2713
  return bt("nsec", e);
2714
2714
  }
2715
- function ma(e) {
2715
+ function Ea(e) {
2716
2716
  return bt("npub", W(e));
2717
2717
  }
2718
2718
  function xa(e) {
@@ -2790,23 +2790,23 @@ function Pr(e) {
2790
2790
  var Ia = {};
2791
2791
  D(Ia, {
2792
2792
  NIP05_REGEX: () => Or,
2793
- isValid: () => ka,
2793
+ isValid: () => _a,
2794
2794
  queryProfile: () => Mr,
2795
- searchDomain: () => _a,
2795
+ searchDomain: () => ka,
2796
2796
  useFetchImplementation: () => Ua
2797
2797
  });
2798
- var Or = /^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/, Et;
2798
+ var Or = /^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/, mt;
2799
2799
  try {
2800
- Et = fetch;
2800
+ mt = fetch;
2801
2801
  } catch {
2802
2802
  }
2803
2803
  function Ua(e) {
2804
- Et = e;
2804
+ mt = e;
2805
2805
  }
2806
- async function _a(e, t = "") {
2806
+ async function ka(e, t = "") {
2807
2807
  try {
2808
2808
  const n = `https://${e}/.well-known/nostr.json?name=${t}`;
2809
- return (await (await Et(n, { redirect: "error" })).json()).names;
2809
+ return (await (await mt(n, { redirect: "error" })).json()).names;
2810
2810
  } catch {
2811
2811
  return {};
2812
2812
  }
@@ -2818,14 +2818,14 @@ async function Mr(e) {
2818
2818
  return null;
2819
2819
  const [n, r = "_", i] = t;
2820
2820
  try {
2821
- const s = `https://${i}/.well-known/nostr.json?name=${r}`, c = await (await Et(s, { redirect: "error" })).json();
2821
+ const s = `https://${i}/.well-known/nostr.json?name=${r}`, c = await (await mt(s, { redirect: "error" })).json();
2822
2822
  let a = c.names[r];
2823
2823
  return a ? { pubkey: a, relays: (o = c.relays) == null ? void 0 : o[a] } : null;
2824
2824
  } catch {
2825
2825
  return null;
2826
2826
  }
2827
2827
  }
2828
- async function ka(e, t) {
2828
+ async function _a(e, t) {
2829
2829
  let n = await Mr(t);
2830
2830
  return n ? n.pubkey === e : !1;
2831
2831
  }
@@ -2967,16 +2967,16 @@ function Da(e, { skipVerification: t } = {}) {
2967
2967
  }
2968
2968
  var ja = {};
2969
2969
  D(ja, {
2970
- NOSTR_URI_REGEX: () => mt,
2971
- parse: () => za,
2972
- test: () => Va
2970
+ NOSTR_URI_REGEX: () => Et,
2971
+ parse: () => Va,
2972
+ test: () => za
2973
2973
  });
2974
- var mt = new RegExp(`nostr:(${Tr.source})`);
2975
- function Va(e) {
2976
- return typeof e == "string" && new RegExp(`^${mt.source}$`).test(e);
2977
- }
2974
+ var Et = new RegExp(`nostr:(${Tr.source})`);
2978
2975
  function za(e) {
2979
- const t = e.match(new RegExp(`^${mt.source}$`));
2976
+ return typeof e == "string" && new RegExp(`^${Et.source}$`).test(e);
2977
+ }
2978
+ function Va(e) {
2979
+ const t = e.match(new RegExp(`^${Et.source}$`));
2980
2980
  if (!t)
2981
2981
  throw new Error(`Invalid Nostr URI: ${e}`);
2982
2982
  return {
@@ -3023,7 +3023,7 @@ D(Ga, {
3023
3023
  regex: () => fn,
3024
3024
  replaceAll: () => Ya
3025
3025
  });
3026
- var fn = () => new RegExp(`\\b${mt.source}\\b`, "g");
3026
+ var fn = () => new RegExp(`\\b${Et.source}\\b`, "g");
3027
3027
  function* Ja(e) {
3028
3028
  const t = e.matchAll(fn());
3029
3029
  for (const n of t)
@@ -3126,7 +3126,7 @@ var Qa = (e, t) => {
3126
3126
  return;
3127
3127
  return ae(
3128
3128
  {
3129
- kind: _r,
3129
+ kind: kr,
3130
3130
  tags: [["p", e.pubkey_to_mute], ...e.tags ?? []],
3131
3131
  content: n,
3132
3132
  created_at: e.created_at
@@ -3181,20 +3181,20 @@ async function lc(e, t, n) {
3181
3181
  return !1;
3182
3182
  }
3183
3183
  }
3184
- var V = {};
3185
- D(V, {
3184
+ var z = {};
3185
+ D(z, {
3186
3186
  decrypt: () => Jr,
3187
3187
  encrypt: () => Gr,
3188
3188
  getConversationKey: () => Zr,
3189
3189
  v2: () => yc
3190
3190
  });
3191
- var Vr = 1, zr = 65535;
3191
+ var zr = 1, Vr = 65535;
3192
3192
  function Zr(e, t) {
3193
3193
  const n = Ue.getSharedSecret(e, "02" + t).subarray(1, 33);
3194
3194
  return nn(Ae, n, "nip44-v2");
3195
3195
  }
3196
3196
  function Fr(e, t) {
3197
- const n = Er(Ae, e, t, 76);
3197
+ const n = mr(Ae, e, t, 76);
3198
3198
  return {
3199
3199
  chacha_key: n.subarray(0, 32),
3200
3200
  chacha_nonce: n.subarray(32, 44),
@@ -3210,7 +3210,7 @@ function yn(e) {
3210
3210
  return n * (Math.floor((e - 1) / n) + 1);
3211
3211
  }
3212
3212
  function uc(e) {
3213
- if (!Number.isSafeInteger(e) || e < Vr || e > zr)
3213
+ if (!Number.isSafeInteger(e) || e < zr || e > Vr)
3214
3214
  throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");
3215
3215
  const t = new Uint8Array(2);
3216
3216
  return new DataView(t.buffer).setUint16(0, e, !1), t;
@@ -3221,7 +3221,7 @@ function fc(e) {
3221
3221
  }
3222
3222
  function hc(e) {
3223
3223
  const t = new DataView(e.buffer).getUint16(0), n = e.subarray(2, 2 + t);
3224
- if (t < Vr || t > zr || n.length !== t || e.length !== 2 + yn(t))
3224
+ if (t < zr || t > Vr || n.length !== t || e.length !== 2 + yn(t))
3225
3225
  throw new Error("invalid padding");
3226
3226
  return ie.decode(n);
3227
3227
  }
@@ -3229,7 +3229,7 @@ function Wr(e, t, n) {
3229
3229
  if (n.length !== 32)
3230
3230
  throw new Error("AAD associated data must be 32 bytes");
3231
3231
  const r = dt(n, t);
3232
- return gt(Ae, e, r);
3232
+ return pt(Ae, e, r);
3233
3233
  }
3234
3234
  function dc(e) {
3235
3235
  if (typeof e != "string")
@@ -3275,12 +3275,12 @@ var yc = {
3275
3275
  },
3276
3276
  encrypt: Gr,
3277
3277
  decrypt: Jr
3278
- }, gc = {};
3279
- D(gc, {
3278
+ }, pc = {};
3279
+ D(pc, {
3280
3280
  makeNwcRequestEvent: () => wc,
3281
- parseConnectionString: () => pc
3281
+ parseConnectionString: () => gc
3282
3282
  });
3283
- function pc(e) {
3283
+ function gc(e) {
3284
3284
  const { pathname: t, searchParams: n } = new URL(e), r = t, i = n.get("relay"), o = n.get("secret");
3285
3285
  if (!r || !i || !o)
3286
3286
  throw new Error("invalid connection string");
@@ -3302,21 +3302,21 @@ async function wc(e, t, n) {
3302
3302
  }
3303
3303
  var bc = {};
3304
3304
  D(bc, {
3305
- getZapEndpoint: () => Ec,
3305
+ getZapEndpoint: () => mc,
3306
3306
  makeZapReceipt: () => Ac,
3307
- makeZapRequest: () => mc,
3307
+ makeZapRequest: () => Ec,
3308
3308
  useFetchImplementation: () => vc,
3309
3309
  validateZapRequest: () => xc
3310
3310
  });
3311
- var gn;
3311
+ var pn;
3312
3312
  try {
3313
- gn = fetch;
3313
+ pn = fetch;
3314
3314
  } catch {
3315
3315
  }
3316
3316
  function vc(e) {
3317
- gn = e;
3317
+ pn = e;
3318
3318
  }
3319
- async function Ec(e) {
3319
+ async function mc(e) {
3320
3320
  try {
3321
3321
  let t = "", { lud06: n, lud16: r } = JSON.parse(e.content);
3322
3322
  if (n) {
@@ -3327,14 +3327,14 @@ async function Ec(e) {
3327
3327
  t = new URL(`/.well-known/lnurlp/${s}`, `https://${c}`).toString();
3328
3328
  } else
3329
3329
  return null;
3330
- let o = await (await gn(t)).json();
3330
+ let o = await (await pn(t)).json();
3331
3331
  if (o.allowsNostr && o.nostrPubkey)
3332
3332
  return o.callback;
3333
3333
  } catch {
3334
3334
  }
3335
3335
  return null;
3336
3336
  }
3337
- function mc({
3337
+ function Ec({
3338
3338
  profile: e,
3339
3339
  event: t,
3340
3340
  amount: n,
@@ -3364,7 +3364,7 @@ function xc(e) {
3364
3364
  } catch {
3365
3365
  return "Invalid zap request JSON.";
3366
3366
  }
3367
- if (!mr(t))
3367
+ if (!Er(t))
3368
3368
  return "Zap request is not a valid Nostr event.";
3369
3369
  if (!on(t))
3370
3370
  return "Invalid signature on zap request.";
@@ -3393,7 +3393,7 @@ function Ac({
3393
3393
  var Sc = {};
3394
3394
  D(Sc, {
3395
3395
  getToken: () => Kc,
3396
- hashPayload: () => pn,
3396
+ hashPayload: () => gn,
3397
3397
  unpackEventFromToken: () => Xr,
3398
3398
  validateEvent: () => ii,
3399
3399
  validateEventKind: () => ei,
@@ -3414,7 +3414,7 @@ async function Kc(e, t, n, r = !1, i) {
3414
3414
  created_at: Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3),
3415
3415
  content: ""
3416
3416
  };
3417
- i && o.tags.push(["payload", pn(i)]);
3417
+ i && o.tags.push(["payload", gn(i)]);
3418
3418
  const s = await n(o);
3419
3419
  return (r ? Yr : "") + ue.encode(te.encode(JSON.stringify(s)));
3420
3420
  }
@@ -3449,7 +3449,7 @@ function ni(e, t) {
3449
3449
  const n = e.tags.find((r) => r[0] === "method");
3450
3450
  return n ? n.length > 0 && n[1].toLowerCase() === t.toLowerCase() : !1;
3451
3451
  }
3452
- function pn(e) {
3452
+ function gn(e) {
3453
3453
  const t = Ae(te.encode(JSON.stringify(e)));
3454
3454
  return M(t);
3455
3455
  }
@@ -3457,7 +3457,7 @@ function ri(e, t) {
3457
3457
  const n = e.tags.find((i) => i[0] === "payload");
3458
3458
  if (!n)
3459
3459
  return !1;
3460
- const r = pn(t);
3460
+ const r = gn(t);
3461
3461
  return n.length > 0 && n[1] === r;
3462
3462
  }
3463
3463
  async function ii(e, t, n, r) {
@@ -3546,7 +3546,7 @@ async function* Oc(e) {
3546
3546
  function Re(e, t = new Uint8Array(32), n = 1) {
3547
3547
  const r = nn(Ae, e, t), i = [];
3548
3548
  for (let o = 1; o <= n; o++)
3549
- i.push(Er(Ae, r, new Uint8Array([o]), 32));
3549
+ i.push(mr(Ae, r, new Uint8Array([o]), 32));
3550
3550
  return i;
3551
3551
  }
3552
3552
  function Rn(e, t) {
@@ -3574,7 +3574,7 @@ class ct {
3574
3574
  * @returns A new Channel instance
3575
3575
  */
3576
3576
  static init(t, n, r, i, o, s) {
3577
- const c = Oe(), [a, l] = Re(o, V.getConversationKey(c, n), 2);
3577
+ const c = Oe(), [a, l] = Re(o, z.getConversationKey(c, n), 2);
3578
3578
  let f, u;
3579
3579
  i ? (f = { publicKey: Ce(r), privateKey: r }, u = { publicKey: Ce(c), privateKey: c }) : u = { publicKey: Ce(r), privateKey: r };
3580
3580
  const d = {
@@ -3588,8 +3588,8 @@ class ct {
3588
3588
  receivingChainMessageNumber: 0,
3589
3589
  previousSendingChainMessageCount: 0,
3590
3590
  skippedMessageKeys: {}
3591
- }, g = new ct(t, d);
3592
- return s && (g.name = s), g;
3591
+ }, p = new ct(t, d);
3592
+ return s && (p.name = s), p;
3593
3593
  }
3594
3594
  /**
3595
3595
  * Sends an encrypted message through the channel
@@ -3600,7 +3600,7 @@ class ct {
3600
3600
  send(t) {
3601
3601
  if (!this.state.theirNostrPublicKey || !this.state.ourCurrentNostrKey)
3602
3602
  throw new Error("we are not the initiator, so we can't send the first message");
3603
- const [n, r] = this.ratchetEncrypt(t), i = V.getConversationKey(this.state.ourCurrentNostrKey.privateKey, this.state.theirNostrPublicKey), o = V.encrypt(JSON.stringify(n), i);
3603
+ const [n, r] = this.ratchetEncrypt(t), i = z.getConversationKey(this.state.ourCurrentNostrKey.privateKey, this.state.theirNostrPublicKey), o = z.encrypt(JSON.stringify(n), i);
3604
3604
  return ae({
3605
3605
  content: r,
3606
3606
  kind: Me,
@@ -3625,7 +3625,7 @@ class ct {
3625
3625
  nextPublicKey: this.state.ourNextNostrKey.publicKey,
3626
3626
  time: Date.now(),
3627
3627
  previousChainLength: this.state.previousSendingChainMessageCount
3628
- }, V.encrypt(t, r)];
3628
+ }, z.encrypt(t, r)];
3629
3629
  }
3630
3630
  ratchetDecrypt(t, n, r) {
3631
3631
  const i = this.trySkippedMessageKeys(t, n, r);
@@ -3634,7 +3634,7 @@ class ct {
3634
3634
  const [o, s] = Re(this.state.receivingChainKey, new Uint8Array([1]), 2);
3635
3635
  this.state.receivingChainKey = o, this.state.receivingChainMessageNumber++;
3636
3636
  try {
3637
- return V.decrypt(n, s);
3637
+ return z.decrypt(n, s);
3638
3638
  } catch (c) {
3639
3639
  throw console.error(this.name, "Decryption failed:", c, {
3640
3640
  messageKey: M(s).slice(0, 4),
@@ -3646,14 +3646,14 @@ class ct {
3646
3646
  }
3647
3647
  ratchetStep(t) {
3648
3648
  this.state.previousSendingChainMessageCount = this.state.sendingChainMessageNumber, this.state.sendingChainMessageNumber = 0, this.state.receivingChainMessageNumber = 0, this.state.theirNostrPublicKey = t;
3649
- const n = V.getConversationKey(this.state.ourNextNostrKey.privateKey, this.state.theirNostrPublicKey), [r, i] = Re(this.state.rootKey, n, 2);
3649
+ const n = z.getConversationKey(this.state.ourNextNostrKey.privateKey, this.state.theirNostrPublicKey), [r, i] = Re(this.state.rootKey, n, 2);
3650
3650
  this.state.receivingChainKey = i, this.state.ourCurrentNostrKey = this.state.ourNextNostrKey;
3651
3651
  const o = Oe();
3652
3652
  this.state.ourNextNostrKey = {
3653
3653
  publicKey: Ce(o),
3654
3654
  privateKey: o
3655
3655
  };
3656
- const s = V.getConversationKey(this.state.ourNextNostrKey.privateKey, this.state.theirNostrPublicKey), [c, a] = Re(r, s, 2);
3656
+ const s = z.getConversationKey(this.state.ourNextNostrKey.privateKey, this.state.theirNostrPublicKey), [c, a] = Re(r, s, 2);
3657
3657
  this.state.rootKey = c, this.state.sendingChainKey = a;
3658
3658
  }
3659
3659
  // 3. MESSAGE KEY FUNCTIONS
@@ -3671,7 +3671,7 @@ class ct {
3671
3671
  const i = Rn(r, t.number);
3672
3672
  if (i in this.state.skippedMessageKeys) {
3673
3673
  const o = this.state.skippedMessageKeys[i];
3674
- return delete this.state.skippedMessageKeys[i], V.decrypt(n, o);
3674
+ return delete this.state.skippedMessageKeys[i], z.decrypt(n, o);
3675
3675
  }
3676
3676
  return null;
3677
3677
  }
@@ -3679,15 +3679,15 @@ class ct {
3679
3679
  decryptHeader(t) {
3680
3680
  const n = t.tags[0][1];
3681
3681
  if (this.state.ourCurrentNostrKey) {
3682
- const i = V.getConversationKey(this.state.ourCurrentNostrKey.privateKey, t.pubkey);
3682
+ const i = z.getConversationKey(this.state.ourCurrentNostrKey.privateKey, t.pubkey);
3683
3683
  try {
3684
- return [JSON.parse(V.decrypt(n, i)), !1];
3684
+ return [JSON.parse(z.decrypt(n, i)), !1];
3685
3685
  } catch {
3686
3686
  }
3687
3687
  }
3688
- const r = V.getConversationKey(this.state.ourNextNostrKey.privateKey, t.pubkey);
3688
+ const r = z.getConversationKey(this.state.ourNextNostrKey.privateKey, t.pubkey);
3689
3689
  try {
3690
- return [JSON.parse(V.decrypt(n, r)), !0];
3690
+ return [JSON.parse(z.decrypt(n, r)), !0];
3691
3691
  } catch {
3692
3692
  }
3693
3693
  throw new Error("Failed to decrypt header with both current and next secrets");
@@ -3703,12 +3703,19 @@ class ct {
3703
3703
  this.internalSubscriptions.forEach((s) => s({ id: t.id, data: i, pubkey: n.nextPublicKey, time: n.time }));
3704
3704
  }
3705
3705
  subscribeToNostrEvents() {
3706
- this.nostrNextUnsubscribe || (this.state.theirNostrPublicKey && (this.nostrUnsubscribe = this.nostrSubscribe(
3706
+ if (this.nostrNextUnsubscribe) return;
3707
+ this.nostrNextUnsubscribe = this.nostrSubscribe(
3707
3708
  { authors: [this.state.theirNostrPublicKey], kinds: [Me] },
3708
- (t) => this.handleNostrEvent(t)
3709
- )), this.nostrNextUnsubscribe = this.nostrSubscribe(
3710
- { authors: [this.state.theirNostrPublicKey], kinds: [Me] },
3711
- (t) => this.handleNostrEvent(t)
3709
+ (n) => this.handleNostrEvent(n)
3710
+ );
3711
+ const t = /* @__PURE__ */ new Set();
3712
+ for (const n of Object.keys(this.state.skippedMessageKeys)) {
3713
+ const [r] = n.split(":");
3714
+ r !== this.state.theirNostrPublicKey && t.add(r);
3715
+ }
3716
+ t.size > 0 && (this.nostrUnsubscribe = this.nostrSubscribe(
3717
+ { authors: Array.from(t), kinds: [Me] },
3718
+ (n) => this.handleNostrEvent(n)
3712
3719
  ));
3713
3720
  }
3714
3721
  }
@@ -3790,19 +3797,19 @@ class nt {
3790
3797
  * so the inviter can create the channel on their side.
3791
3798
  */
3792
3799
  async acceptInvite(t, n, r) {
3793
- const i = Oe(), o = Ce(i), s = this.inviter || this.inviterSessionPublicKey, c = W(this.linkSecret), a = ct.init(t, this.inviterSessionPublicKey, i, !0, c, void 0), l = Oe(), f = Ce(l), u = typeof r == "function" ? r : (p, h) => Promise.resolve(V.encrypt(p, et(r, h))), d = {
3800
+ const i = Oe(), o = Ce(i), s = this.inviter || this.inviterSessionPublicKey, c = W(this.linkSecret), a = ct.init(t, this.inviterSessionPublicKey, i, !0, c, void 0), l = Oe(), f = Ce(l), u = typeof r == "function" ? r : (g, h) => Promise.resolve(z.encrypt(g, et(r, h))), d = {
3794
3801
  pubkey: n,
3795
3802
  tags: [["secret", this.linkSecret]],
3796
3803
  content: await u(o, s),
3797
3804
  created_at: Math.floor(Date.now() / 1e3)
3798
- }, g = {
3805
+ }, p = {
3799
3806
  kind: Me,
3800
3807
  pubkey: f,
3801
- content: V.encrypt(JSON.stringify(d), et(l, this.inviterSessionPublicKey)),
3808
+ content: z.encrypt(JSON.stringify(d), et(l, this.inviterSessionPublicKey)),
3802
3809
  created_at: Math.floor(Date.now() / 1e3),
3803
3810
  tags: [["p", this.inviterSessionPublicKey]]
3804
3811
  };
3805
- return { channel: a, event: ae(g, l) };
3812
+ return { channel: a, event: ae(p, l) };
3806
3813
  }
3807
3814
  listen(t, n, r) {
3808
3815
  if (!this.inviterSessionPrivateKey)
@@ -3813,12 +3820,12 @@ class nt {
3813
3820
  };
3814
3821
  return n(i, async (o) => {
3815
3822
  try {
3816
- const s = await V.decrypt(o.content, et(this.inviterSessionPrivateKey, o.pubkey)), c = JSON.parse(s);
3817
- if (!c.tags || !c.tags.some(([g, p]) => g === "secret" && p === this.linkSecret)) {
3823
+ const s = await z.decrypt(o.content, et(this.inviterSessionPrivateKey, o.pubkey)), c = JSON.parse(s);
3824
+ if (!c.tags || !c.tags.some(([p, g]) => p === "secret" && g === this.linkSecret)) {
3818
3825
  console.error("Invalid secret from event", o);
3819
3826
  return;
3820
3827
  }
3821
- const l = await (typeof t == "function" ? t : (g, p) => Promise.resolve(V.decrypt(g, et(t, p))))(c.content, c.pubkey), f = W(this.linkSecret), u = o.id, d = ct.init(n, l, this.inviterSessionPrivateKey, !1, f, u);
3828
+ const l = await (typeof t == "function" ? t : (p, g) => Promise.resolve(z.decrypt(p, et(t, g))))(c.content, c.pubkey), f = W(this.linkSecret), u = o.id, d = ct.init(n, l, this.inviterSessionPrivateKey, !1, f, u);
3822
3829
  r(d, c.pubkey);
3823
3830
  } catch (s) {
3824
3831
  console.error("Error processing invite message:", s);