@gardenfi/core 0.2.0-beta.52 → 0.2.0-beta.54

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
@@ -1,7 +1,7 @@
1
1
  var $s = Object.defineProperty;
2
2
  var Hs = (e, t, r) => t in e ? $s(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var pt = (e, t, r) => Hs(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { Ok as fe, Err as N, Fetcher as mt, trim0x as nt } from "@catalogfi/utils";
4
+ import { Ok as fe, Err as M, Fetcher as mt, trim0x as nt } from "@catalogfi/utils";
5
5
  import { EthereumLocalnet as zs, ArbitrumLocalnet as Gs, Orderbook as js, isMainnet as rr, isBitcoin as nr, getBlockchainType as Lt, BlockchainType as ke } from "@gardenfi/orderbook";
6
6
  import { Url as pn, fetchEVMBlockNumber as Zr, with0x as fr, checkAllowanceAndApprove as Ws, Authorization as Cn, sleep as qs, fetchBitcoinBlockNumber as Ln } from "@gardenfi/utils";
7
7
  import { createWalletClient as kn, custom as Fn, getContract as Vs, sha256 as ir } from "viem";
@@ -188,7 +188,7 @@ function oo(e, t = {}) {
188
188
  const r = new Uint8Array(1);
189
189
  return r[0] = Number(e), typeof t.size == "number" ? (At(r, { size: t.size }), It(r, { size: t.size })) : r;
190
190
  }
191
- const Me = {
191
+ const Ne = {
192
192
  zero: 48,
193
193
  nine: 57,
194
194
  A: 65,
@@ -196,13 +196,13 @@ const Me = {
196
196
  a: 97,
197
197
  f: 102
198
198
  };
199
- function Nn(e) {
200
- if (e >= Me.zero && e <= Me.nine)
201
- return e - Me.zero;
202
- if (e >= Me.A && e <= Me.F)
203
- return e - (Me.A - 10);
204
- if (e >= Me.a && e <= Me.f)
205
- return e - (Me.a - 10);
199
+ function Mn(e) {
200
+ if (e >= Ne.zero && e <= Ne.nine)
201
+ return e - Ne.zero;
202
+ if (e >= Ne.A && e <= Ne.F)
203
+ return e - (Ne.A - 10);
204
+ if (e >= Ne.a && e <= Ne.f)
205
+ return e - (Ne.a - 10);
206
206
  }
207
207
  function st(e, t = {}) {
208
208
  let r = e;
@@ -211,7 +211,7 @@ function st(e, t = {}) {
211
211
  n.length % 2 && (n = `0${n}`);
212
212
  const i = n.length / 2, a = new Uint8Array(i);
213
213
  for (let f = 0, u = 0; f < i; f++) {
214
- const l = Nn(n.charCodeAt(u++)), y = Nn(n.charCodeAt(u++));
214
+ const l = Mn(n.charCodeAt(u++)), y = Mn(n.charCodeAt(u++));
215
215
  if (l === void 0 || y === void 0)
216
216
  throw new X(`Invalid byte sequence ("${n[u - 2]}${n[u - 1]}" in "${n}").`);
217
217
  a[f] = l * 16 + y;
@@ -368,7 +368,7 @@ const yo = /* @__PURE__ */ bn("transactionReceipt", bo), gn = 2n ** 256n - 1n;
368
368
  function Kt(e) {
369
369
  return `0x${e.reduce((t, r) => t + r.replace("0x", ""), "")}`;
370
370
  }
371
- class Mn extends X {
371
+ class Nn extends X {
372
372
  constructor({ offset: t }) {
373
373
  super(`Offset \`${t}\` cannot be negative.`, {
374
374
  name: "NegativeOffsetError"
@@ -408,7 +408,7 @@ const wo = {
408
408
  },
409
409
  decrementPosition(e) {
410
410
  if (e < 0)
411
- throw new Mn({ offset: e });
411
+ throw new Nn({ offset: e });
412
412
  const t = this.position - e;
413
413
  this.assertPosition(t), this.position = t;
414
414
  },
@@ -417,7 +417,7 @@ const wo = {
417
417
  },
418
418
  incrementPosition(e) {
419
419
  if (e < 0)
420
- throw new Mn({ offset: e });
420
+ throw new Nn({ offset: e });
421
421
  const t = this.position + e;
422
422
  this.assertPosition(t), this.position = t;
423
423
  },
@@ -610,7 +610,7 @@ function Oi(e) {
610
610
  i.push(Uint8Array.from(t.blobToKzgCommitment(a)));
611
611
  return r === "bytes" ? i : i.map((a) => Qe(a));
612
612
  }
613
- function Ni(e) {
613
+ function Mi(e) {
614
614
  const { kzg: t } = e, r = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), n = typeof e.blobs[0] == "string" ? e.blobs.map((f) => st(f)) : e.blobs, i = typeof e.commitments[0] == "string" ? e.commitments.map((f) => st(f)) : e.commitments, a = [];
615
615
  for (let f = 0; f < n.length; f++) {
616
616
  const u = n[f], l = i[f];
@@ -637,7 +637,7 @@ function dr(e, t = !0) {
637
637
  if (t && e.finished)
638
638
  throw new Error("Hash#digest() has already been called");
639
639
  }
640
- function Mi(e, t) {
640
+ function Ni(e, t) {
641
641
  mn(e);
642
642
  const r = t.outputLen;
643
643
  if (e.length < r)
@@ -696,12 +696,12 @@ class Uo extends Di {
696
696
  return this.length += t.length, this.roundClean(), this;
697
697
  }
698
698
  digestInto(t) {
699
- dr(this), Mi(t, this), this.finished = !0;
699
+ dr(this), Ni(t, this), this.finished = !0;
700
700
  const { buffer: r, view: n, blockLen: i, isLE: a } = this;
701
701
  let { pos: f } = this;
702
702
  r[f++] = 128, this.buffer.subarray(f).fill(0), this.padOffset > i - f && (this.process(n, 0), f = 0);
703
- for (let m = f; m < i; m++)
704
- r[m] = 0;
703
+ for (let w = f; w < i; w++)
704
+ r[w] = 0;
705
705
  Lo(n, i - 8, BigInt(this.length * 8), a), this.process(n, 0);
706
706
  const u = Fr(t), l = this.outputLen;
707
707
  if (l % 4)
@@ -709,8 +709,8 @@ class Uo extends Di {
709
709
  const y = l / 4, g = this.get();
710
710
  if (y > g.length)
711
711
  throw new Error("_sha2: outputLen bigger than state");
712
- for (let m = 0; m < y; m++)
713
- u.setUint32(4 * m, g[m], a);
712
+ for (let w = 0; w < y; w++)
713
+ u.setUint32(4 * w, g[w], a);
714
714
  }
715
715
  digest() {
716
716
  const { buffer: t, outputLen: r } = this;
@@ -799,7 +799,7 @@ const Oo = /* @__PURE__ */ new Uint32Array([
799
799
  528734635,
800
800
  1541459225
801
801
  ]), Ye = /* @__PURE__ */ new Uint32Array(64);
802
- class No extends Uo {
802
+ class Mo extends Uo {
803
803
  constructor() {
804
804
  super(64, 32, 8, !1), this.A = Ke[0] | 0, this.B = Ke[1] | 0, this.C = Ke[2] | 0, this.D = Ke[3] | 0, this.E = Ke[4] | 0, this.F = Ke[5] | 0, this.G = Ke[6] | 0, this.H = Ke[7] | 0;
805
805
  }
@@ -812,15 +812,15 @@ class No extends Uo {
812
812
  this.A = t | 0, this.B = r | 0, this.C = n | 0, this.D = i | 0, this.E = a | 0, this.F = f | 0, this.G = u | 0, this.H = l | 0;
813
813
  }
814
814
  process(t, r) {
815
- for (let m = 0; m < 16; m++, r += 4)
816
- Ye[m] = t.getUint32(r, !1);
817
- for (let m = 16; m < 64; m++) {
818
- const E = Ye[m - 15], I = Ye[m - 2], v = Fe(E, 7) ^ Fe(E, 18) ^ E >>> 3, P = Fe(I, 17) ^ Fe(I, 19) ^ I >>> 10;
819
- Ye[m] = P + Ye[m - 7] + v + Ye[m - 16] | 0;
815
+ for (let w = 0; w < 16; w++, r += 4)
816
+ Ye[w] = t.getUint32(r, !1);
817
+ for (let w = 16; w < 64; w++) {
818
+ const E = Ye[w - 15], I = Ye[w - 2], v = Fe(E, 7) ^ Fe(E, 18) ^ E >>> 3, P = Fe(I, 17) ^ Fe(I, 19) ^ I >>> 10;
819
+ Ye[w] = P + Ye[w - 7] + v + Ye[w - 16] | 0;
820
820
  }
821
821
  let { A: n, B: i, C: a, D: f, E: u, F: l, G: y, H: g } = this;
822
- for (let m = 0; m < 64; m++) {
823
- const E = Fe(u, 6) ^ Fe(u, 11) ^ Fe(u, 25), I = g + E + ko(u, l, y) + Oo[m] + Ye[m] | 0, P = (Fe(n, 2) ^ Fe(n, 13) ^ Fe(n, 22)) + Fo(n, i, a) | 0;
822
+ for (let w = 0; w < 64; w++) {
823
+ const E = Fe(u, 6) ^ Fe(u, 11) ^ Fe(u, 25), I = g + E + ko(u, l, y) + Oo[w] + Ye[w] | 0, P = (Fe(n, 2) ^ Fe(n, 13) ^ Fe(n, 22)) + Fo(n, i, a) | 0;
824
824
  g = y, y = l, l = u, u = f + I | 0, f = a, a = i, i = n, n = I + P | 0;
825
825
  }
826
826
  n = n + this.A | 0, i = i + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, u = u + this.E | 0, l = l + this.F | 0, y = y + this.G | 0, g = g + this.H | 0, this.set(n, i, a, f, u, l, y, g);
@@ -832,9 +832,9 @@ class No extends Uo {
832
832
  this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
833
833
  }
834
834
  }
835
- const Mo = /* @__PURE__ */ $i(() => new No());
835
+ const No = /* @__PURE__ */ $i(() => new Mo());
836
836
  function Do(e, t) {
837
- return Mo(Vt(e, { strict: !1 }) ? Pi(e) : e);
837
+ return No(Vt(e, { strict: !1 }) ? Pi(e) : e);
838
838
  }
839
839
  function $o(e) {
840
840
  const { commitment: t, version: r = 1 } = e, n = e.to ?? (typeof t == "string" ? "hex" : "bytes"), i = Do(t);
@@ -912,7 +912,7 @@ function Wo(e) {
912
912
  return t === "bytes" ? i.map((u) => u.bytes) : i.map((u) => Qe(u.bytes));
913
913
  }
914
914
  function qo(e) {
915
- const { data: t, kzg: r, to: n } = e, i = e.blobs ?? Wo({ data: t, to: n }), a = e.commitments ?? Oi({ blobs: i, kzg: r, to: n }), f = e.proofs ?? Ni({ blobs: i, commitments: a, kzg: r, to: n }), u = [];
915
+ const { data: t, kzg: r, to: n } = e, i = e.blobs ?? Wo({ data: t, to: n }), a = e.commitments ?? Oi({ blobs: i, kzg: r, to: n }), f = e.proofs ?? Mi({ blobs: i, commitments: a, kzg: r, to: n }), u = [];
916
916
  for (let l = 0; l < i.length; l++)
917
917
  u.push({
918
918
  blob: i[l],
@@ -1031,9 +1031,9 @@ function aa(e, t = 24) {
1031
1031
  for (let f = 0; f < 10; f++)
1032
1032
  r[f] = e[f] ^ e[f + 10] ^ e[f + 20] ^ e[f + 30] ^ e[f + 40];
1033
1033
  for (let f = 0; f < 10; f += 2) {
1034
- const u = (f + 8) % 10, l = (f + 2) % 10, y = r[l], g = r[l + 1], m = Wn(y, g, 1) ^ r[u], E = qn(y, g, 1) ^ r[u + 1];
1034
+ const u = (f + 8) % 10, l = (f + 2) % 10, y = r[l], g = r[l + 1], w = Wn(y, g, 1) ^ r[u], E = qn(y, g, 1) ^ r[u + 1];
1035
1035
  for (let I = 0; I < 50; I += 10)
1036
- e[f + I] ^= m, e[f + I + 1] ^= E;
1036
+ e[f + I] ^= w, e[f + I + 1] ^= E;
1037
1037
  }
1038
1038
  let i = e[2], a = e[3];
1039
1039
  for (let f = 0; f < 24; f++) {
@@ -1099,7 +1099,7 @@ class xn extends Di {
1099
1099
  return Dn(t), this.xofInto(new Uint8Array(t));
1100
1100
  }
1101
1101
  digestInto(t) {
1102
- if (Mi(t, this), this.finished)
1102
+ if (Ni(t, this), this.finished)
1103
1103
  throw new Error("digest() was already called");
1104
1104
  return this.writeInto(t), this.destroy(), t;
1105
1105
  }
@@ -1255,7 +1255,7 @@ function xa(e, t) {
1255
1255
  return r === "eip1559" ? Ba(e, t) : r === "eip2930" ? Sa(e, t) : r === "eip4844" ? Ea(e, t) : r === "eip7702" ? va(e, t) : Ia(e, t);
1256
1256
  }
1257
1257
  function va(e, t) {
1258
- const { authorizationList: r, chainId: n, gas: i, nonce: a, to: f, value: u, maxFeePerGas: l, maxPriorityFeePerGas: y, accessList: g, data: m } = e;
1258
+ const { authorizationList: r, chainId: n, gas: i, nonce: a, to: f, value: u, maxFeePerGas: l, maxPriorityFeePerGas: y, accessList: g, data: w } = e;
1259
1259
  ya(e);
1260
1260
  const E = xr(g), I = Vo(r);
1261
1261
  return Kt([
@@ -1268,7 +1268,7 @@ function va(e, t) {
1268
1268
  i ? W(i) : "0x",
1269
1269
  f ?? "0x",
1270
1270
  u ? W(u) : "0x",
1271
- m ?? "0x",
1271
+ w ?? "0x",
1272
1272
  E,
1273
1273
  I,
1274
1274
  ...Yt(e, t)
@@ -1276,7 +1276,7 @@ function va(e, t) {
1276
1276
  ]);
1277
1277
  }
1278
1278
  function Ea(e, t) {
1279
- const { chainId: r, gas: n, nonce: i, to: a, value: f, maxFeePerBlobGas: u, maxFeePerGas: l, maxPriorityFeePerGas: y, accessList: g, data: m } = e;
1279
+ const { chainId: r, gas: n, nonce: i, to: a, value: f, maxFeePerBlobGas: u, maxFeePerGas: l, maxPriorityFeePerGas: y, accessList: g, data: w } = e;
1280
1280
  ga(e);
1281
1281
  let E = e.blobVersionedHashes, I = e.sidecars;
1282
1282
  if (e.blobs && (typeof E > "u" || typeof I > "u")) {
@@ -1287,7 +1287,7 @@ function Ea(e, t) {
1287
1287
  if (typeof E > "u" && (E = Ho({
1288
1288
  commitments: U
1289
1289
  })), typeof I > "u") {
1290
- const S = Ni({ blobs: k, commitments: U, kzg: L });
1290
+ const S = Mi({ blobs: k, commitments: U, kzg: L });
1291
1291
  I = qo({ blobs: k, commitments: U, proofs: S });
1292
1292
  }
1293
1293
  }
@@ -1299,7 +1299,7 @@ function Ea(e, t) {
1299
1299
  n ? W(n) : "0x",
1300
1300
  a ?? "0x",
1301
1301
  f ? W(f) : "0x",
1302
- m ?? "0x",
1302
+ w ?? "0x",
1303
1303
  v,
1304
1304
  u ? W(u) : "0x",
1305
1305
  E ?? [],
@@ -1319,7 +1319,7 @@ function Ea(e, t) {
1319
1319
  function Ba(e, t) {
1320
1320
  const { chainId: r, gas: n, nonce: i, to: a, value: f, maxFeePerGas: u, maxPriorityFeePerGas: l, accessList: y, data: g } = e;
1321
1321
  vn(e);
1322
- const m = xr(y), E = [
1322
+ const w = xr(y), E = [
1323
1323
  W(r),
1324
1324
  i ? W(i) : "0x",
1325
1325
  l ? W(l) : "0x",
@@ -1328,7 +1328,7 @@ function Ba(e, t) {
1328
1328
  a ?? "0x",
1329
1329
  f ? W(f) : "0x",
1330
1330
  g ?? "0x",
1331
- m,
1331
+ w,
1332
1332
  ...Yt(e, t)
1333
1333
  ];
1334
1334
  return Kt([
@@ -1339,7 +1339,7 @@ function Ba(e, t) {
1339
1339
  function Sa(e, t) {
1340
1340
  const { chainId: r, gas: n, data: i, nonce: a, to: f, value: u, accessList: l, gasPrice: y } = e;
1341
1341
  ma(e);
1342
- const g = xr(l), m = [
1342
+ const g = xr(l), w = [
1343
1343
  W(r),
1344
1344
  a ? W(a) : "0x",
1345
1345
  y ? W(y) : "0x",
@@ -1352,7 +1352,7 @@ function Sa(e, t) {
1352
1352
  ];
1353
1353
  return Kt([
1354
1354
  "0x01",
1355
- ot(m)
1355
+ ot(w)
1356
1356
  ]);
1357
1357
  }
1358
1358
  function Ia(e, t) {
@@ -1376,11 +1376,11 @@ function Ia(e, t) {
1376
1376
  if (t.v !== I)
1377
1377
  throw new So({ v: t.v });
1378
1378
  return I;
1379
- })(), m = lr(t.r), E = lr(t.s);
1379
+ })(), w = lr(t.r), E = lr(t.s);
1380
1380
  y = [
1381
1381
  ...y,
1382
1382
  W(g),
1383
- m === "0x00" ? "0x" : m,
1383
+ w === "0x00" ? "0x" : w,
1384
1384
  E === "0x00" ? "0x" : E
1385
1385
  ];
1386
1386
  } else r > 0 && (y = [
@@ -1580,7 +1580,7 @@ const Vn = {
1580
1580
  },
1581
1581
  testnet: !0,
1582
1582
  sourceId: Ut
1583
- }), Na = /* @__PURE__ */ qt({
1583
+ }), Ma = /* @__PURE__ */ qt({
1584
1584
  id: 1,
1585
1585
  name: "Ethereum",
1586
1586
  nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
@@ -1609,7 +1609,7 @@ const Vn = {
1609
1609
  blockCreated: 14353601
1610
1610
  }
1611
1611
  }
1612
- }), Ma = /* @__PURE__ */ qt({
1612
+ }), Na = /* @__PURE__ */ qt({
1613
1613
  id: 11155111,
1614
1614
  name: "Sepolia",
1615
1615
  nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
@@ -1670,14 +1670,14 @@ const Ot = (e) => e.length === 64 ? e : e.slice(2), za = (e) => {
1670
1670
  return !1;
1671
1671
  }
1672
1672
  }, Ga = {
1673
- ethereum: Na,
1673
+ ethereum: Ma,
1674
1674
  ethereum_arbitrum: Fa,
1675
- ethereum_sepolia: Ma,
1675
+ ethereum_sepolia: Na,
1676
1676
  arbitrum_sepolia: Ua,
1677
1677
  ethereum_localnet: zs,
1678
1678
  arbitrum_localnet: Gs,
1679
1679
  base_sepolia: Oa
1680
- }, cl = async (e, t) => {
1680
+ }, c0 = async (e, t) => {
1681
1681
  var n;
1682
1682
  const r = Ga[e];
1683
1683
  if (r)
@@ -1708,13 +1708,13 @@ const Ot = (e) => e.length === 64 ? e : e.slice(2), za = (e) => {
1708
1708
  walletClient: a
1709
1709
  });
1710
1710
  } catch {
1711
- return N("Failed to add network");
1711
+ return M("Failed to add network");
1712
1712
  }
1713
1713
  else
1714
- return N("Failed to switch network");
1714
+ return M("Failed to switch network");
1715
1715
  }
1716
1716
  else
1717
- return N("Chain not supported");
1717
+ return M("Chain not supported");
1718
1718
  }, ja = (e) => typeof e == "object" && e !== null && "code" in e && e.code === 4902, Wa = (e, t, r, n) => e + ":" + t.toLowerCase() + "::" + r + ":" + n.toLowerCase();
1719
1719
  var ie = /* @__PURE__ */ ((e) => (e.Created = "Created", e.Matched = "Matched", e.InitiateDetected = "InitiateDetected", e.Initiated = "Initiated", e.CounterPartyInitiateDetected = "CounterPartyInitiateDetected", e.CounterPartyInitiated = "CounterPartyInitiated", e.RedeemDetected = "RedeemDetected", e.Redeemed = "Redeemed", e.CounterPartyRedeemDetected = "CounterPartyRedeemDetected", e.CounterPartyRedeemed = "CounterPartyRedeemed", e.Completed = "Completed", e.CounterPartySwapExpired = "CounterPartySwapExpired", e.Expired = "Expired", e.RefundDetected = "RefundDetected", e.Refunded = "Refunded", e.CounterPartyRefundDetected = "CounterPartyRefundDetected", e.CounterPartyRefunded = "CounterPartyRefunded", e.Cancelled = "Cancelled", e.DeadLineExceeded = "DeadLineExceeded", e))(ie || {}), te = /* @__PURE__ */ ((e) => (e.Idle = "Idle", e.InitiateDetected = "InitiateDetected", e.Initiated = "Initiated", e.RedeemDetected = "RedeemDetected", e.Redeemed = "Redeemed", e.RefundDetected = "RefundDetected", e.Refunded = "Refunded", e.Expired = "Expired", e))(te || {});
1720
1720
  const qa = (e, t, r) => {
@@ -2173,37 +2173,37 @@ class Ya {
2173
2173
  this.url = new pn("/relayer", r), this.auth = n, this.order = t;
2174
2174
  }
2175
2175
  async init(t, r) {
2176
- if (!t.account) return N("No account found");
2176
+ if (!t.account) return M("No account found");
2177
2177
  if (t.account.address.toLowerCase() !== this.order.source_swap.initiator.toLowerCase())
2178
- return N("Account address and order initiator mismatch");
2178
+ return M("Account address and order initiator mismatch");
2179
2179
  if (!r) {
2180
2180
  const g = await Zr(t);
2181
- if (g.error) return N(g.error);
2181
+ if (g.error) return M(g.error);
2182
2182
  r = g.val;
2183
2183
  }
2184
2184
  if (nn(
2185
2185
  this.order.source_swap,
2186
2186
  r
2187
- ) !== te.Idle) return N("Invalid swap status");
2187
+ ) !== te.Idle) return M("Invalid swap status");
2188
2188
  const { create_order: i, source_swap: a } = this.order;
2189
2189
  if (!a.amount || !a.redeemer || !i.timelock || !i.secret_hash)
2190
- return N("Invalid order");
2190
+ return M("Invalid order");
2191
2191
  const f = fr(i.secret_hash), u = BigInt(i.timelock), l = fr(a.redeemer), y = BigInt(a.amount);
2192
2192
  try {
2193
2193
  const g = await this.auth.getToken();
2194
- if (g.error) return N(g.error);
2195
- const m = Vs({
2194
+ if (g.error) return M(g.error);
2195
+ const w = Vs({
2196
2196
  address: fr(this.order.source_swap.asset),
2197
2197
  abi: Ka,
2198
2198
  client: t
2199
- }), E = await m.read.token(), I = await Ws(
2199
+ }), E = await w.read.token(), I = await Ws(
2200
2200
  Number(y),
2201
2201
  E,
2202
2202
  this.order.source_swap.asset,
2203
2203
  t
2204
2204
  );
2205
- if (I.error) return N(I.error);
2206
- const v = await m.read.eip712Domain(), P = await t.signTypedData({
2205
+ if (I.error) return M(I.error);
2206
+ const v = await w.read.eip712Domain(), P = await t.signTypedData({
2207
2207
  account: t.account,
2208
2208
  domain: {
2209
2209
  name: v[1],
@@ -2240,15 +2240,15 @@ class Ya {
2240
2240
  }
2241
2241
  }
2242
2242
  );
2243
- return T.error ? N(T.error) : T.result ? fe(T.result) : N("Init: No result found");
2243
+ return T.error ? M(T.error) : T.result ? fe(T.result) : M("Init: No result found");
2244
2244
  } catch (g) {
2245
- return console.log("init error :", g), N(String(g));
2245
+ return console.log("init error :", g), M(String(g));
2246
2246
  }
2247
2247
  }
2248
2248
  async redeem(t, r) {
2249
2249
  try {
2250
2250
  const n = await this.auth.getToken();
2251
- if (n.error) return N(n.error);
2251
+ if (n.error) return M(n.error);
2252
2252
  const i = await mt.post(
2253
2253
  this.url.endpoint("redeem"),
2254
2254
  {
@@ -2263,9 +2263,9 @@ class Ya {
2263
2263
  }
2264
2264
  }
2265
2265
  );
2266
- return i.error ? N(i.error) : i.result ? fe(i.result) : N("Redeem: No result found");
2266
+ return i.error ? M(i.error) : i.result ? fe(i.result) : M("Redeem: No result found");
2267
2267
  } catch (n) {
2268
- return N(String(n));
2268
+ return M(String(n));
2269
2269
  }
2270
2270
  }
2271
2271
  }
@@ -2375,11 +2375,11 @@ class pr {
2375
2375
  for (const l of this.utxoHashes) {
2376
2376
  const y = await a.getTransaction(l);
2377
2377
  for (let g = 0; g < y.vout.length; g++) {
2378
- const m = y.vout[g];
2379
- m.scriptpubkey_address === i && f.push({
2378
+ const w = y.vout[g];
2379
+ w.scriptpubkey_address === i && f.push({
2380
2380
  txid: y.txid,
2381
2381
  vout: g,
2382
- value: m.value,
2382
+ value: w.value,
2383
2383
  status: { confirmed: !1 }
2384
2384
  });
2385
2385
  }
@@ -2423,16 +2423,16 @@ class pr {
2423
2423
  async instantRefund(t, r) {
2424
2424
  bt(t.length > 0, me.noCounterpartySigs);
2425
2425
  const { tx: n, usedUtxos: i } = await this.buildRawTx(r);
2426
- for (const m of i)
2427
- if (!t.find((E) => E.utxo === m.txid))
2428
- throw new Error(me.counterPartySigNotFound(m.txid));
2426
+ for (const w of i)
2427
+ if (!t.find((E) => E.utxo === w.txid))
2428
+ throw new Error(me.counterPartySigNotFound(w.txid));
2429
2429
  const a = this.getOutputScript(), f = be.Transaction.SIGHASH_DEFAULT, u = this.leafHash(
2430
2430
  2
2431
2431
  /* INSTANT_REFUND */
2432
- ), l = i.map((m) => m.value), y = Nr(a, i.length);
2433
- for (let m = 0; m < n.ins.length; m++) {
2432
+ ), l = i.map((w) => w.value), y = Mr(a, i.length);
2433
+ for (let w = 0; w < n.ins.length; w++) {
2434
2434
  const E = n.hashForWitnessV1(
2435
- m,
2435
+ w,
2436
2436
  y,
2437
2437
  l,
2438
2438
  f,
@@ -2441,15 +2441,15 @@ class pr {
2441
2441
  if (!xt.verifySchnorr(
2442
2442
  E,
2443
2443
  Buffer.from(this.redeemerPubkey, "hex"),
2444
- Buffer.from(t[m].sig, "hex")
2444
+ Buffer.from(t[w].sig, "hex")
2445
2445
  ))
2446
2446
  throw new Error(
2447
- me.invalidCounterpartySigForUTXO(t[m].utxo)
2447
+ me.invalidCounterpartySigForUTXO(t[w].utxo)
2448
2448
  );
2449
- const I = await this.signer.signSchnorr(E), v = Buffer.from(n.ins[m].hash).reverse().toString("hex"), P = t.find((T) => T.utxo === v);
2449
+ const I = await this.signer.signSchnorr(E), v = Buffer.from(n.ins[w].hash).reverse().toString("hex"), P = t.find((T) => T.utxo === v);
2450
2450
  if (!P)
2451
2451
  throw new Error(me.counterPartySigNotFound(v));
2452
- n.setWitness(m, [
2452
+ n.setWitness(w, [
2453
2453
  Buffer.from(P.sig, "hex"),
2454
2454
  I,
2455
2455
  this.instantRefundLeaf(),
@@ -2475,16 +2475,16 @@ class pr {
2475
2475
  ), f = this.leafHash(
2476
2476
  1
2477
2477
  /* REDEEM */
2478
- ), u = a.map((m) => m.value), l = Nr(this.getOutputScript(), a.length), y = be.Transaction.SIGHASH_DEFAULT;
2479
- for (let m = 0; m < i.ins.length; m++) {
2478
+ ), u = a.map((w) => w.value), l = Mr(this.getOutputScript(), a.length), y = be.Transaction.SIGHASH_DEFAULT;
2479
+ for (let w = 0; w < i.ins.length; w++) {
2480
2480
  const E = i.hashForWitnessV1(
2481
- m,
2481
+ w,
2482
2482
  l,
2483
2483
  u,
2484
2484
  y,
2485
2485
  f
2486
2486
  ), I = await this.signer.signSchnorr(E);
2487
- i.setWitness(m, [
2487
+ i.setWitness(w, [
2488
2488
  I,
2489
2489
  Buffer.from(t, "hex"),
2490
2490
  this.redeemLeaf(),
@@ -2509,7 +2509,7 @@ class pr {
2509
2509
  const u = this.leafHash(
2510
2510
  0
2511
2511
  /* REFUND */
2512
- ), l = i.map((E) => E.value), y = Nr(this.getOutputScript(), i.length), g = be.Transaction.SIGHASH_DEFAULT;
2512
+ ), l = i.map((E) => E.value), y = Mr(this.getOutputScript(), i.length), g = be.Transaction.SIGHASH_DEFAULT;
2513
2513
  for (let E = 0; E < n.ins.length; E++) {
2514
2514
  n.ins[E].sequence = this.expiry;
2515
2515
  const I = n.hashForWitnessV1(
@@ -2671,7 +2671,7 @@ class pr {
2671
2671
  }
2672
2672
  }
2673
2673
  }
2674
- function Nr(e, t) {
2674
+ function Mr(e, t) {
2675
2675
  const r = [];
2676
2676
  for (let n = 0; n < t; n++)
2677
2677
  r.push(e);
@@ -2701,16 +2701,15 @@ class rf {
2701
2701
  this.url = new pn("/blocknumber/" + r, t);
2702
2702
  }
2703
2703
  async fetchBlockNumbers() {
2704
- console.log("this.url :", this.url.toString());
2705
2704
  try {
2706
2705
  const t = await mt.get(this.url);
2707
2706
  return fe(t);
2708
2707
  } catch (t) {
2709
- return N("Failed to fetch block numbers", t);
2708
+ return M("Failed to fetch block numbers", t);
2710
2709
  }
2711
2710
  }
2712
2711
  }
2713
- class ll {
2712
+ class l0 {
2714
2713
  constructor(t) {
2715
2714
  if (this.eventListeners = /* @__PURE__ */ new Map(), this.getOrderThreshold = 20, this.pendingOrdersCount = 0, this.useRelay = !0, this.orderBook = new js({
2716
2715
  url: t.orderbookURl,
@@ -2731,12 +2730,12 @@ class ll {
2731
2730
  }
2732
2731
  async swap(t) {
2733
2732
  const r = await this.validateAndFillParams(t);
2734
- if (r.error) return N(r.error);
2733
+ if (r.error) return M(r.error);
2735
2734
  const { sendAddress: n, receiveAddress: i, timelock: a } = r.val, f = await this.orderBook.getOrdersCount(this.evmAddress);
2736
- if (f.error) return N(f.error);
2735
+ if (f.error) return M(f.error);
2737
2736
  const u = f.val + 1, l = this.secretManager.generateSecret(u);
2738
- if (l.error) return N(l.error);
2739
- const { strategyId: y, btcAddress: g } = t.additionalData, m = {
2737
+ if (l.error) return M(l.error);
2738
+ const { strategyId: y, btcAddress: g } = t.additionalData, w = {
2740
2739
  strategy_id: y,
2741
2740
  ...g && {
2742
2741
  bitcoin_optional_recipient: g
@@ -2755,66 +2754,66 @@ class ll {
2755
2754
  timelock: a,
2756
2755
  secret_hash: nt(l.val.secretHash),
2757
2756
  min_destination_confirmations: t.minDestinationConfirmations ?? 0,
2758
- additional_data: m
2757
+ additional_data: w
2759
2758
  }, I = await this.quote.getAttestedQuote(E);
2760
- if (I.error) return N(I.error);
2759
+ if (I.error) return M(I.error);
2761
2760
  const v = await this.orderBook.createOrder(I.val);
2762
- if (v.error) return N(v.error);
2761
+ if (v.error) return M(v.error);
2763
2762
  const P = await this.pollOrder(v.val);
2764
- return P.error ? N(P.error) : fe(P.val);
2763
+ return P.error ? M(P.error) : fe(P.val);
2765
2764
  }
2766
2765
  async validateAndFillParams(t) {
2767
2766
  if (t.fromAsset.chain === t.toAsset.chain && t.fromAsset.atomicSwapAddress === t.toAsset.atomicSwapAddress)
2768
- return N("Source and destination assets cannot be the same");
2767
+ return M("Source and destination assets cannot be the same");
2769
2768
  if (rr(t.fromAsset.chain) && !rr(t.toAsset.chain) || !rr(t.fromAsset.chain) && rr(t.toAsset.chain))
2770
- return N(
2769
+ return M(
2771
2770
  "Both assets should be on the same network (either mainnet or testnet)"
2772
2771
  );
2773
2772
  if (nr(t.fromAsset.chain) || nr(t.toAsset.chain)) {
2774
2773
  if (!this.wallets.btcWallet)
2775
- return N(
2774
+ return M(
2776
2775
  "btcWallet is required for bitcoin chain. Please provide btcWallet in the constructor"
2777
2776
  );
2778
2777
  if (!t.additionalData.btcAddress)
2779
- return N(
2778
+ return M(
2780
2779
  "btcAddress in additionalData is required for bitcoin chain"
2781
2780
  );
2782
2781
  }
2783
2782
  const r = await this.getAddresses(t.fromAsset.chain);
2784
- if (r.error) return N(r.error);
2783
+ if (r.error) return M(r.error);
2785
2784
  const n = await this.getAddresses(t.toAsset.chain);
2786
- if (n.error) return N(n.error);
2785
+ if (n.error) return M(n.error);
2787
2786
  const i = this.validateAmount(t.sendAmount);
2788
- if (i.error) return N(i.error);
2787
+ if (i.error) return M(i.error);
2789
2788
  const a = this.validateAmount(t.receiveAmount);
2790
- if (a.error) return N(a.error);
2789
+ if (a.error) return M(a.error);
2791
2790
  if (i < a)
2792
- return N("Send amount should be greater than receive amount");
2791
+ return M("Send amount should be greater than receive amount");
2793
2792
  const f = this.getTimelock(t.fromAsset.chain);
2794
2793
  return f ? fe({
2795
2794
  sendAddress: r.val,
2796
2795
  receiveAddress: n.val,
2797
2796
  timelock: t.timelock ?? f
2798
- }) : N("Unsupported chain for timelock");
2797
+ }) : M("Unsupported chain for timelock");
2799
2798
  }
2800
2799
  async getAddresses(t) {
2801
2800
  var n;
2802
2801
  switch (Lt(t)) {
2803
2802
  case ke.EVM:
2804
- return this.wallets.evmWallet.account ? fe(this.wallets.evmWallet.account.address) : N("EVM Wallet not found");
2803
+ return this.wallets.evmWallet.account ? fe(this.wallets.evmWallet.account.address) : M("EVM Wallet not found");
2805
2804
  case ke.Bitcoin: {
2806
2805
  const i = await ((n = this.wallets.btcWallet) == null ? void 0 : n.getPublicKey());
2807
- return !i || !za(i) ? N("Invalid btc public key") : fe(Ot(i));
2806
+ return !i || !za(i) ? M("Invalid btc public key") : fe(Ot(i));
2808
2807
  }
2809
2808
  default:
2810
- return N("Unsupported chain");
2809
+ return M("Unsupported chain");
2811
2810
  }
2812
2811
  }
2813
2812
  validateAmount(t) {
2814
2813
  if (t == null || t.includes("."))
2815
- return N("Invalid amount ", t);
2814
+ return M("Invalid amount ", t);
2816
2815
  const r = new Ys(t);
2817
- return !r.isInteger() || r.isNaN() || r.lt(0) || r.isLessThanOrEqualTo(0) ? N("Invalid amount ", t) : fe(r);
2816
+ return !r.isInteger() || r.isNaN() || r.lt(0) || r.isLessThanOrEqualTo(0) ? M("Invalid amount ", t) : fe(r);
2818
2817
  }
2819
2818
  getTimelock(t) {
2820
2819
  switch (Lt(t)) {
@@ -2831,12 +2830,12 @@ class ll {
2831
2830
  for (; n < this.getOrderThreshold; ) {
2832
2831
  if (await qs(1e3), n++, r.error) {
2833
2832
  if (!r.error.includes("result is undefined"))
2834
- return N(r.error);
2833
+ return M(r.error);
2835
2834
  } else if (r.val && r.val.create_order.create_id.toLowerCase() === t.toLowerCase())
2836
2835
  return fe(r.val);
2837
2836
  r = await this.orderBook.getOrder(t, !0);
2838
2837
  }
2839
- return N(`Order not found, createOrder id: ${t}`);
2838
+ return M(`Order not found, createOrder id: ${t}`);
2840
2839
  }
2841
2840
  emit(t, ...r) {
2842
2841
  (this.eventListeners.get(t) ?? []).forEach((i) => {
@@ -2861,16 +2860,8 @@ class ll {
2861
2860
  );
2862
2861
  return;
2863
2862
  }
2864
- let m = n == null ? void 0 : n.val[u], E = n == null ? void 0 : n.val[l];
2865
- if (console.log("orderId: ", f.create_order.create_id), n && console.log("blockNumbers :", n.val), console.log(
2866
- "sourceChainBlockNumber :",
2867
- u,
2868
- m
2869
- ), console.log(
2870
- "destinationChainBlockNumber :",
2871
- l,
2872
- E
2873
- ), !m || !E) {
2863
+ let w = n == null ? void 0 : n.val[u], E = n == null ? void 0 : n.val[l];
2864
+ if (!w || !E) {
2874
2865
  const v = await this.fetchCurrentBlockNumbers(f, {
2875
2866
  source: y.val,
2876
2867
  destination: g.val
@@ -2883,11 +2874,11 @@ class ll {
2883
2874
  );
2884
2875
  return;
2885
2876
  }
2886
- m = v.val.source, E = v.val.destination;
2877
+ w = v.val.source, E = v.val.destination;
2887
2878
  }
2888
2879
  switch (Va(
2889
2880
  f,
2890
- m,
2881
+ w,
2891
2882
  E
2892
2883
  )) {
2893
2884
  case ye.Redeem: {
@@ -3034,7 +3025,7 @@ class ll {
3034
3025
  case ke.Bitcoin:
3035
3026
  return fe(this.wallets.btcWallet);
3036
3027
  default:
3037
- return N("Unsupported chain for wallet");
3028
+ return M("Unsupported chain for wallet");
3038
3029
  }
3039
3030
  }
3040
3031
  on(t, r) {
@@ -3047,15 +3038,15 @@ class ll {
3047
3038
  }
3048
3039
  async fetchCurrentBlockNumbers(t, r) {
3049
3040
  if (!r || !r.source || !r.destination)
3050
- return N("Provide wallets to fetch the current block number");
3041
+ return M("Provide wallets to fetch the current block number");
3051
3042
  const n = nr(t.source_swap.chain) ? await Ln(
3052
3043
  await r.source.getProvider()
3053
3044
  ) : await Zr(r.source);
3054
- if (n.error) return N(n.error);
3045
+ if (n.error) return M(n.error);
3055
3046
  const i = nr(t.destination_swap.chain) ? await Ln(
3056
3047
  await r.destination.getProvider()
3057
3048
  ) : await Zr(r.destination);
3058
- return i.error ? N(i.error) : fe({
3049
+ return i.error ? M(i.error) : fe({
3059
3050
  source: n.val,
3060
3051
  destination: i.val
3061
3052
  });
@@ -3198,9 +3189,9 @@ var ts = {
3198
3189
  tfSubError: ff,
3199
3190
  tfJSON: br,
3200
3191
  getValueTypeName: Bn
3201
- }, Mr, Xn;
3192
+ }, Nr, Xn;
3202
3193
  function uf() {
3203
- if (Xn) return Mr;
3194
+ if (Xn) return Nr;
3204
3195
  Xn = 1;
3205
3196
  var e = En, t = ts;
3206
3197
  function r(S) {
@@ -3210,28 +3201,28 @@ function uf() {
3210
3201
  return typeof S == "string" && /^([0-9a-f]{2})+$/i.test(S);
3211
3202
  }
3212
3203
  function i(S, z) {
3213
- var M = S.toJSON();
3204
+ var N = S.toJSON();
3214
3205
  function $(se) {
3215
3206
  if (!S(se)) return !1;
3216
3207
  if (se.length === z) return !0;
3217
- throw t.tfCustomError(M + "(Length: " + z + ")", M + "(Length: " + se.length + ")");
3208
+ throw t.tfCustomError(N + "(Length: " + z + ")", N + "(Length: " + se.length + ")");
3218
3209
  }
3219
3210
  return $.toJSON = function() {
3220
- return M;
3211
+ return N;
3221
3212
  }, $;
3222
3213
  }
3223
3214
  var a = i.bind(null, e.Array), f = i.bind(null, r), u = i.bind(null, n), l = i.bind(null, e.String);
3224
- function y(S, z, M) {
3225
- M = M || e.Number;
3215
+ function y(S, z, N) {
3216
+ N = N || e.Number;
3226
3217
  function $(se, Te) {
3227
- return M(se, Te) && se > S && se < z;
3218
+ return N(se, Te) && se > S && se < z;
3228
3219
  }
3229
3220
  return $.toJSON = function() {
3230
- return `${M.toJSON()} between [${S}, ${z}]`;
3221
+ return `${N.toJSON()} between [${S}, ${z}]`;
3231
3222
  }, $;
3232
3223
  }
3233
3224
  var g = Math.pow(2, 53) - 1;
3234
- function m(S) {
3225
+ function w(S) {
3235
3226
  return typeof S == "number" && isFinite(S);
3236
3227
  }
3237
3228
  function E(S) {
@@ -3262,7 +3253,7 @@ function uf() {
3262
3253
  ArrayN: a,
3263
3254
  Buffer: r,
3264
3255
  BufferN: f,
3265
- Finite: m,
3256
+ Finite: w,
3266
3257
  Hex: n,
3267
3258
  HexN: u,
3268
3259
  Int8: E,
@@ -3280,9 +3271,9 @@ function uf() {
3280
3271
  L[U].toJSON = (function(S) {
3281
3272
  return S;
3282
3273
  }).bind(null, U);
3283
- return Mr = L, Mr;
3274
+ return Nr = L, Nr;
3284
3275
  }
3285
- var Jt = ts, ce = En, De = Jt.tfJSON, rs = Jt.TfTypeError, ns = Jt.TfPropertyTypeError, Nt = Jt.tfSubError, cf = Jt.getValueTypeName, $e = {
3276
+ var Jt = ts, ce = En, De = Jt.tfJSON, rs = Jt.TfTypeError, ns = Jt.TfPropertyTypeError, Mt = Jt.tfSubError, cf = Jt.getValueTypeName, $e = {
3286
3277
  arrayOf: function(t, r) {
3287
3278
  t = Ue(t), r = r || {};
3288
3279
  function n(i, a) {
@@ -3290,7 +3281,7 @@ var Jt = ts, ce = En, De = Jt.tfJSON, rs = Jt.TfTypeError, ns = Jt.TfPropertyTyp
3290
3281
  try {
3291
3282
  return _e(t, f, a);
3292
3283
  } catch (l) {
3293
- throw Nt(l, u);
3284
+ throw Mt(l, u);
3294
3285
  }
3295
3286
  });
3296
3287
  }
@@ -3316,13 +3307,13 @@ var Jt = ts, ce = En, De = Jt.tfJSON, rs = Jt.TfTypeError, ns = Jt.TfPropertyTyp
3316
3307
  try {
3317
3308
  r && _e(r, f, a);
3318
3309
  } catch (l) {
3319
- throw Nt(l, f, "key");
3310
+ throw Mt(l, f, "key");
3320
3311
  }
3321
3312
  try {
3322
3313
  var u = i[f];
3323
3314
  _e(t, u, a);
3324
3315
  } catch (l) {
3325
- throw Nt(l, f);
3316
+ throw Mt(l, f);
3326
3317
  }
3327
3318
  }
3328
3319
  return !0;
@@ -3346,7 +3337,7 @@ var Jt = ts, ce = En, De = Jt.tfJSON, rs = Jt.TfTypeError, ns = Jt.TfPropertyTyp
3346
3337
  _e(l, y, f);
3347
3338
  }
3348
3339
  } catch (g) {
3349
- throw Nt(g, u);
3340
+ throw Mt(g, u);
3350
3341
  }
3351
3342
  if (f) {
3352
3343
  for (u in a)
@@ -3404,7 +3395,7 @@ var Jt = ts, ce = En, De = Jt.tfJSON, rs = Jt.TfTypeError, ns = Jt.TfPropertyTyp
3404
3395
  try {
3405
3396
  return _e(a, n[f], i);
3406
3397
  } catch (u) {
3407
- throw Nt(u, f);
3398
+ throw Mt(u, f);
3408
3399
  }
3409
3400
  });
3410
3401
  }
@@ -3519,10 +3510,10 @@ function wf(e) {
3519
3510
  var In = {};
3520
3511
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3521
3512
  In.read = function(e, t, r, n, i) {
3522
- var a, f, u = i * 8 - n - 1, l = (1 << u) - 1, y = l >> 1, g = -7, m = r ? i - 1 : 0, E = r ? -1 : 1, I = e[t + m];
3523
- for (m += E, a = I & (1 << -g) - 1, I >>= -g, g += u; g > 0; a = a * 256 + e[t + m], m += E, g -= 8)
3513
+ var a, f, u = i * 8 - n - 1, l = (1 << u) - 1, y = l >> 1, g = -7, w = r ? i - 1 : 0, E = r ? -1 : 1, I = e[t + w];
3514
+ for (w += E, a = I & (1 << -g) - 1, I >>= -g, g += u; g > 0; a = a * 256 + e[t + w], w += E, g -= 8)
3524
3515
  ;
3525
- for (f = a & (1 << -g) - 1, a >>= -g, g += n; g > 0; f = f * 256 + e[t + m], m += E, g -= 8)
3516
+ for (f = a & (1 << -g) - 1, a >>= -g, g += n; g > 0; f = f * 256 + e[t + w], w += E, g -= 8)
3526
3517
  ;
3527
3518
  if (a === 0)
3528
3519
  a = 1 - y;
@@ -3534,8 +3525,8 @@ In.read = function(e, t, r, n, i) {
3534
3525
  return (I ? -1 : 1) * f * Math.pow(2, a - n);
3535
3526
  };
3536
3527
  In.write = function(e, t, r, n, i, a) {
3537
- var f, u, l, y = a * 8 - i - 1, g = (1 << y) - 1, m = g >> 1, E = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, I = n ? 0 : a - 1, v = n ? 1 : -1, P = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
3538
- for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (u = isNaN(t) ? 1 : 0, f = g) : (f = Math.floor(Math.log(t) / Math.LN2), t * (l = Math.pow(2, -f)) < 1 && (f--, l *= 2), f + m >= 1 ? t += E / l : t += E * Math.pow(2, 1 - m), t * l >= 2 && (f++, l /= 2), f + m >= g ? (u = 0, f = g) : f + m >= 1 ? (u = (t * l - 1) * Math.pow(2, i), f = f + m) : (u = t * Math.pow(2, m - 1) * Math.pow(2, i), f = 0)); i >= 8; e[r + I] = u & 255, I += v, u /= 256, i -= 8)
3528
+ var f, u, l, y = a * 8 - i - 1, g = (1 << y) - 1, w = g >> 1, E = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, I = n ? 0 : a - 1, v = n ? 1 : -1, P = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
3529
+ for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (u = isNaN(t) ? 1 : 0, f = g) : (f = Math.floor(Math.log(t) / Math.LN2), t * (l = Math.pow(2, -f)) < 1 && (f--, l *= 2), f + w >= 1 ? t += E / l : t += E * Math.pow(2, 1 - w), t * l >= 2 && (f++, l /= 2), f + w >= g ? (u = 0, f = g) : f + w >= 1 ? (u = (t * l - 1) * Math.pow(2, i), f = f + w) : (u = t * Math.pow(2, w - 1) * Math.pow(2, i), f = 0)); i >= 8; e[r + I] = u & 255, I += v, u /= 256, i -= 8)
3539
3530
  ;
3540
3531
  for (f = f << i | u, y += i; y > 0; e[r + I] = f & 255, I += v, f /= 256, y -= 8)
3541
3532
  ;
@@ -3589,7 +3580,7 @@ In.write = function(e, t, r, n, i, a) {
3589
3580
  throw new TypeError(
3590
3581
  'The "string" argument must be of type string. Received type number'
3591
3582
  );
3592
- return m(c);
3583
+ return w(c);
3593
3584
  }
3594
3585
  return l(c, s, o);
3595
3586
  }
@@ -3635,13 +3626,13 @@ In.write = function(e, t, r, n, i, a) {
3635
3626
  u.alloc = function(c, s, o) {
3636
3627
  return g(c, s, o);
3637
3628
  };
3638
- function m(c) {
3629
+ function w(c) {
3639
3630
  return y(c), f(c < 0 ? 0 : C(c) | 0);
3640
3631
  }
3641
3632
  u.allocUnsafe = function(c) {
3642
- return m(c);
3633
+ return w(c);
3643
3634
  }, u.allocUnsafeSlow = function(c) {
3644
- return m(c);
3635
+ return w(c);
3645
3636
  };
3646
3637
  function E(c, s) {
3647
3638
  if ((typeof s != "string" || s === "") && (s = "utf8"), !u.isEncoding(s))
@@ -3924,7 +3915,7 @@ In.write = function(e, t, r, n, i, a) {
3924
3915
  }, u.prototype.lastIndexOf = function(s, o, h) {
3925
3916
  return S(this, s, o, h, !1);
3926
3917
  };
3927
- function M(c, s, o, h) {
3918
+ function N(c, s, o, h) {
3928
3919
  o = Number(o) || 0;
3929
3920
  const b = c.length - o;
3930
3921
  h ? (h = Number(h), h > b && (h = b)) : h = b;
@@ -3969,7 +3960,7 @@ In.write = function(e, t, r, n, i, a) {
3969
3960
  for (; ; )
3970
3961
  switch (b) {
3971
3962
  case "hex":
3972
- return M(this, s, o, h);
3963
+ return N(this, s, o, h);
3973
3964
  case "utf8":
3974
3965
  case "utf-8":
3975
3966
  return $(this, s, o, h);
@@ -4243,25 +4234,25 @@ In.write = function(e, t, r, n, i, a) {
4243
4234
  }), u.prototype.writeBigInt64BE = Ie(function(s, o = 0) {
4244
4235
  return qe(this, s, o, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
4245
4236
  });
4246
- function Ne(c, s, o, h, b, x) {
4237
+ function Me(c, s, o, h, b, x) {
4247
4238
  if (o + h > c.length) throw new RangeError("Index out of range");
4248
4239
  if (o < 0) throw new RangeError("Index out of range");
4249
4240
  }
4250
4241
  function _(c, s, o, h, b) {
4251
- return s = +s, o = o >>> 0, b || Ne(c, s, o, 4), r.write(c, s, o, h, 23, 4), o + 4;
4242
+ return s = +s, o = o >>> 0, b || Me(c, s, o, 4), r.write(c, s, o, h, 23, 4), o + 4;
4252
4243
  }
4253
4244
  u.prototype.writeFloatLE = function(s, o, h) {
4254
4245
  return _(this, s, o, !0, h);
4255
4246
  }, u.prototype.writeFloatBE = function(s, o, h) {
4256
4247
  return _(this, s, o, !1, h);
4257
4248
  };
4258
- function w(c, s, o, h, b) {
4259
- return s = +s, o = o >>> 0, b || Ne(c, s, o, 8), r.write(c, s, o, h, 52, 8), o + 8;
4249
+ function m(c, s, o, h, b) {
4250
+ return s = +s, o = o >>> 0, b || Me(c, s, o, 8), r.write(c, s, o, h, 52, 8), o + 8;
4260
4251
  }
4261
4252
  u.prototype.writeDoubleLE = function(s, o, h) {
4262
- return w(this, s, o, !0, h);
4253
+ return m(this, s, o, !0, h);
4263
4254
  }, u.prototype.writeDoubleBE = function(s, o, h) {
4264
- return w(this, s, o, !1, h);
4255
+ return m(this, s, o, !1, h);
4265
4256
  }, u.prototype.copy = function(s, o, h, b) {
4266
4257
  if (!u.isBuffer(s)) throw new TypeError("argument should be a Buffer");
4267
4258
  if (h || (h = 0), !b && b !== 0 && (b = this.length), o >= s.length && (o = s.length), o || (o = 0), b > 0 && b < h && (b = h), b === h || s.length === 0 || this.length === 0) return 0;
@@ -4836,7 +4827,7 @@ function kf() {
4836
4827
  }
4837
4828
  return (P === "string" ? String : Number)(v);
4838
4829
  }
4839
- var l = Rt, y = l.Buffer, g = Rn, m = g.inspect, E = m && m.custom || "inspect";
4830
+ var l = Rt, y = l.Buffer, g = Rn, w = g.inspect, E = w && w.custom || "inspect";
4840
4831
  function I(v, P, T) {
4841
4832
  y.prototype.copy.call(v, P, T);
4842
4833
  }
@@ -4936,7 +4927,7 @@ function kf() {
4936
4927
  }, {
4937
4928
  key: E,
4938
4929
  value: function(T, C) {
4939
- return m(this, t(t({}, C), {}, {
4930
+ return w(this, t(t({}, C), {}, {
4940
4931
  // Only inspect one level.
4941
4932
  depth: 0,
4942
4933
  // It should not recurse.
@@ -4973,7 +4964,7 @@ var bs = {
4973
4964
  undestroy: Uf,
4974
4965
  errorOrDestroy: Of
4975
4966
  }, ct = {};
4976
- function Nf(e, t) {
4967
+ function Mf(e, t) {
4977
4968
  e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e.__proto__ = t;
4978
4969
  }
4979
4970
  var ys = {};
@@ -4983,7 +4974,7 @@ function Re(e, t, r) {
4983
4974
  return typeof t == "string" ? t : t(a, f, u);
4984
4975
  }
4985
4976
  var i = /* @__PURE__ */ function(a) {
4986
- Nf(f, a);
4977
+ Mf(f, a);
4987
4978
  function f(u, l, y) {
4988
4979
  return a.call(this, n(u, l, y)) || this;
4989
4980
  }
@@ -5000,7 +4991,7 @@ function ni(e, t) {
5000
4991
  } else
5001
4992
  return "of ".concat(t, " ").concat(String(e));
5002
4993
  }
5003
- function Mf(e, t, r) {
4994
+ function Nf(e, t, r) {
5004
4995
  return e.substr(0, t.length) === t;
5005
4996
  }
5006
4997
  function Df(e, t, r) {
@@ -5014,7 +5005,7 @@ Re("ERR_INVALID_OPT_VALUE", function(e, t) {
5014
5005
  }, TypeError);
5015
5006
  Re("ERR_INVALID_ARG_TYPE", function(e, t, r) {
5016
5007
  var n;
5017
- typeof t == "string" && Mf(t, "not ") ? (n = "must not be", t = t.replace(/^not /, "")) : n = "must be";
5008
+ typeof t == "string" && Nf(t, "not ") ? (n = "must not be", t = t.replace(/^not /, "")) : n = "must be";
5018
5009
  var i;
5019
5010
  if (Df(e, " argument"))
5020
5011
  i = "The ".concat(e, " ").concat(n, " ").concat(ni(t, "type"));
@@ -5085,15 +5076,15 @@ function zr(e) {
5085
5076
  var Gr, ii;
5086
5077
  function ms() {
5087
5078
  if (ii) return Gr;
5088
- ii = 1, Gr = M;
5079
+ ii = 1, Gr = N;
5089
5080
  function e(_) {
5090
- var w = this;
5081
+ var m = this;
5091
5082
  this.next = null, this.entry = null, this.finish = function() {
5092
- Ne(w, _);
5083
+ Me(m, _);
5093
5084
  };
5094
5085
  }
5095
5086
  var t;
5096
- M.WritableState = S;
5087
+ N.WritableState = S;
5097
5088
  var r = {
5098
5089
  deprecate: jf
5099
5090
  }, n = ps, i = Rt.Buffer, a = (typeof Xe < "u" ? Xe : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
@@ -5104,20 +5095,20 @@ function ms() {
5104
5095
  function u(_) {
5105
5096
  return i.isBuffer(_) || _ instanceof a;
5106
5097
  }
5107
- var l = bs, y = gs, g = y.getHighWaterMark, m = ct.codes, E = m.ERR_INVALID_ARG_TYPE, I = m.ERR_METHOD_NOT_IMPLEMENTED, v = m.ERR_MULTIPLE_CALLBACK, P = m.ERR_STREAM_CANNOT_PIPE, T = m.ERR_STREAM_DESTROYED, C = m.ERR_STREAM_NULL_VALUES, F = m.ERR_STREAM_WRITE_AFTER_END, k = m.ERR_UNKNOWN_ENCODING, L = l.errorOrDestroy;
5108
- ge(M, n);
5098
+ var l = bs, y = gs, g = y.getHighWaterMark, w = ct.codes, E = w.ERR_INVALID_ARG_TYPE, I = w.ERR_METHOD_NOT_IMPLEMENTED, v = w.ERR_MULTIPLE_CALLBACK, P = w.ERR_STREAM_CANNOT_PIPE, T = w.ERR_STREAM_DESTROYED, C = w.ERR_STREAM_NULL_VALUES, F = w.ERR_STREAM_WRITE_AFTER_END, k = w.ERR_UNKNOWN_ENCODING, L = l.errorOrDestroy;
5099
+ ge(N, n);
5109
5100
  function U() {
5110
5101
  }
5111
- function S(_, w, R) {
5112
- t = t || St(), _ = _ || {}, typeof R != "boolean" && (R = w instanceof t), this.objectMode = !!_.objectMode, R && (this.objectMode = this.objectMode || !!_.writableObjectMode), this.highWaterMark = g(this, _, "writableHighWaterMark", R), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
5102
+ function S(_, m, R) {
5103
+ t = t || St(), _ = _ || {}, typeof R != "boolean" && (R = m instanceof t), this.objectMode = !!_.objectMode, R && (this.objectMode = this.objectMode || !!_.writableObjectMode), this.highWaterMark = g(this, _, "writableHighWaterMark", R), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
5113
5104
  var D = _.decodeStrings === !1;
5114
5105
  this.decodeStrings = !D, this.defaultEncoding = _.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(G) {
5115
- et(w, G);
5106
+ et(m, G);
5116
5107
  }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = _.emitClose !== !1, this.autoDestroy = !!_.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e(this);
5117
5108
  }
5118
5109
  S.prototype.getBuffer = function() {
5119
- for (var w = this.bufferedRequest, R = []; w; )
5120
- R.push(w), w = w.next;
5110
+ for (var m = this.bufferedRequest, R = []; m; )
5111
+ R.push(m), m = m.next;
5121
5112
  return R;
5122
5113
  }, function() {
5123
5114
  try {
@@ -5130,42 +5121,42 @@ function ms() {
5130
5121
  }
5131
5122
  }();
5132
5123
  var z;
5133
- typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (z = Function.prototype[Symbol.hasInstance], Object.defineProperty(M, Symbol.hasInstance, {
5134
- value: function(w) {
5135
- return z.call(this, w) ? !0 : this !== M ? !1 : w && w._writableState instanceof S;
5124
+ typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (z = Function.prototype[Symbol.hasInstance], Object.defineProperty(N, Symbol.hasInstance, {
5125
+ value: function(m) {
5126
+ return z.call(this, m) ? !0 : this !== N ? !1 : m && m._writableState instanceof S;
5136
5127
  }
5137
- })) : z = function(w) {
5138
- return w instanceof this;
5128
+ })) : z = function(m) {
5129
+ return m instanceof this;
5139
5130
  };
5140
- function M(_) {
5131
+ function N(_) {
5141
5132
  t = t || St();
5142
- var w = this instanceof t;
5143
- if (!w && !z.call(M, this)) return new M(_);
5144
- this._writableState = new S(_, this, w), this.writable = !0, _ && (typeof _.write == "function" && (this._write = _.write), typeof _.writev == "function" && (this._writev = _.writev), typeof _.destroy == "function" && (this._destroy = _.destroy), typeof _.final == "function" && (this._final = _.final)), n.call(this);
5133
+ var m = this instanceof t;
5134
+ if (!m && !z.call(N, this)) return new N(_);
5135
+ this._writableState = new S(_, this, m), this.writable = !0, _ && (typeof _.write == "function" && (this._write = _.write), typeof _.writev == "function" && (this._writev = _.writev), typeof _.destroy == "function" && (this._destroy = _.destroy), typeof _.final == "function" && (this._final = _.final)), n.call(this);
5145
5136
  }
5146
- M.prototype.pipe = function() {
5137
+ N.prototype.pipe = function() {
5147
5138
  L(this, new P());
5148
5139
  };
5149
- function $(_, w) {
5140
+ function $(_, m) {
5150
5141
  var R = new F();
5151
- L(_, R), process.nextTick(w, R);
5142
+ L(_, R), process.nextTick(m, R);
5152
5143
  }
5153
- function se(_, w, R, D) {
5144
+ function se(_, m, R, D) {
5154
5145
  var G;
5155
- return R === null ? G = new C() : typeof R != "string" && !w.objectMode && (G = new E("chunk", ["string", "Buffer"], R)), G ? (L(_, G), process.nextTick(D, G), !1) : !0;
5146
+ return R === null ? G = new C() : typeof R != "string" && !m.objectMode && (G = new E("chunk", ["string", "Buffer"], R)), G ? (L(_, G), process.nextTick(D, G), !1) : !0;
5156
5147
  }
5157
- M.prototype.write = function(_, w, R) {
5148
+ N.prototype.write = function(_, m, R) {
5158
5149
  var D = this._writableState, G = !1, d = !D.objectMode && u(_);
5159
- return d && !i.isBuffer(_) && (_ = f(_)), typeof w == "function" && (R = w, w = null), d ? w = "buffer" : w || (w = D.defaultEncoding), typeof R != "function" && (R = U), D.ending ? $(this, R) : (d || se(this, D, _, R)) && (D.pendingcb++, G = Ge(this, D, d, _, w, R)), G;
5160
- }, M.prototype.cork = function() {
5150
+ return d && !i.isBuffer(_) && (_ = f(_)), typeof m == "function" && (R = m, m = null), d ? m = "buffer" : m || (m = D.defaultEncoding), typeof R != "function" && (R = U), D.ending ? $(this, R) : (d || se(this, D, _, R)) && (D.pendingcb++, G = Ge(this, D, d, _, m, R)), G;
5151
+ }, N.prototype.cork = function() {
5161
5152
  this._writableState.corked++;
5162
- }, M.prototype.uncork = function() {
5153
+ }, N.prototype.uncork = function() {
5163
5154
  var _ = this._writableState;
5164
5155
  _.corked && (_.corked--, !_.writing && !_.corked && !_.bufferProcessing && _.bufferedRequest && Ce(this, _));
5165
- }, M.prototype.setDefaultEncoding = function(w) {
5166
- if (typeof w == "string" && (w = w.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((w + "").toLowerCase()) > -1)) throw new k(w);
5167
- return this._writableState.defaultEncoding = w, this;
5168
- }, Object.defineProperty(M.prototype, "writableBuffer", {
5156
+ }, N.prototype.setDefaultEncoding = function(m) {
5157
+ if (typeof m == "string" && (m = m.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((m + "").toLowerCase()) > -1)) throw new k(m);
5158
+ return this._writableState.defaultEncoding = m, this;
5159
+ }, Object.defineProperty(N.prototype, "writableBuffer", {
5169
5160
  // making it explicit this property is not enumerable
5170
5161
  // because otherwise some prototype manipulation in
5171
5162
  // userland will fail
@@ -5174,10 +5165,10 @@ function ms() {
5174
5165
  return this._writableState && this._writableState.getBuffer();
5175
5166
  }
5176
5167
  });
5177
- function Te(_, w, R) {
5178
- return !_.objectMode && _.decodeStrings !== !1 && typeof w == "string" && (w = i.from(w, R)), w;
5168
+ function Te(_, m, R) {
5169
+ return !_.objectMode && _.decodeStrings !== !1 && typeof m == "string" && (m = i.from(m, R)), m;
5179
5170
  }
5180
- Object.defineProperty(M.prototype, "writableHighWaterMark", {
5171
+ Object.defineProperty(N.prototype, "writableHighWaterMark", {
5181
5172
  // making it explicit this property is not enumerable
5182
5173
  // because otherwise some prototype manipulation in
5183
5174
  // userland will fail
@@ -5186,76 +5177,76 @@ function ms() {
5186
5177
  return this._writableState.highWaterMark;
5187
5178
  }
5188
5179
  });
5189
- function Ge(_, w, R, D, G, d) {
5180
+ function Ge(_, m, R, D, G, d) {
5190
5181
  if (!R) {
5191
- var p = Te(w, D, G);
5182
+ var p = Te(m, D, G);
5192
5183
  D !== p && (R = !0, G = "buffer", D = p);
5193
5184
  }
5194
- var A = w.objectMode ? 1 : D.length;
5195
- w.length += A;
5196
- var O = w.length < w.highWaterMark;
5197
- if (O || (w.needDrain = !0), w.writing || w.corked) {
5198
- var Z = w.lastBufferedRequest;
5199
- w.lastBufferedRequest = {
5185
+ var A = m.objectMode ? 1 : D.length;
5186
+ m.length += A;
5187
+ var O = m.length < m.highWaterMark;
5188
+ if (O || (m.needDrain = !0), m.writing || m.corked) {
5189
+ var Z = m.lastBufferedRequest;
5190
+ m.lastBufferedRequest = {
5200
5191
  chunk: D,
5201
5192
  encoding: G,
5202
5193
  isBuf: R,
5203
5194
  callback: d,
5204
5195
  next: null
5205
- }, Z ? Z.next = w.lastBufferedRequest : w.bufferedRequest = w.lastBufferedRequest, w.bufferedRequestCount += 1;
5196
+ }, Z ? Z.next = m.lastBufferedRequest : m.bufferedRequest = m.lastBufferedRequest, m.bufferedRequestCount += 1;
5206
5197
  } else
5207
- ae(_, w, !1, A, D, G, d);
5198
+ ae(_, m, !1, A, D, G, d);
5208
5199
  return O;
5209
5200
  }
5210
- function ae(_, w, R, D, G, d, p) {
5211
- w.writelen = D, w.writecb = p, w.writing = !0, w.sync = !0, w.destroyed ? w.onwrite(new T("write")) : R ? _._writev(G, w.onwrite) : _._write(G, d, w.onwrite), w.sync = !1;
5201
+ function ae(_, m, R, D, G, d, p) {
5202
+ m.writelen = D, m.writecb = p, m.writing = !0, m.sync = !0, m.destroyed ? m.onwrite(new T("write")) : R ? _._writev(G, m.onwrite) : _._write(G, d, m.onwrite), m.sync = !1;
5212
5203
  }
5213
- function xe(_, w, R, D, G) {
5214
- --w.pendingcb, R ? (process.nextTick(G, D), process.nextTick(Be, _, w), _._writableState.errorEmitted = !0, L(_, D)) : (G(D), _._writableState.errorEmitted = !0, L(_, D), Be(_, w));
5204
+ function xe(_, m, R, D, G) {
5205
+ --m.pendingcb, R ? (process.nextTick(G, D), process.nextTick(Be, _, m), _._writableState.errorEmitted = !0, L(_, D)) : (G(D), _._writableState.errorEmitted = !0, L(_, D), Be(_, m));
5215
5206
  }
5216
5207
  function ve(_) {
5217
5208
  _.writing = !1, _.writecb = null, _.length -= _.writelen, _.writelen = 0;
5218
5209
  }
5219
- function et(_, w) {
5210
+ function et(_, m) {
5220
5211
  var R = _._writableState, D = R.sync, G = R.writecb;
5221
5212
  if (typeof G != "function") throw new v();
5222
- if (ve(R), w) xe(_, R, D, w, G);
5213
+ if (ve(R), m) xe(_, R, D, m, G);
5223
5214
  else {
5224
5215
  var d = We(R) || _.destroyed;
5225
5216
  !d && !R.corked && !R.bufferProcessing && R.bufferedRequest && Ce(_, R), D ? process.nextTick(Pe, _, R, d, G) : Pe(_, R, d, G);
5226
5217
  }
5227
5218
  }
5228
- function Pe(_, w, R, D) {
5229
- R || je(_, w), w.pendingcb--, D(), Be(_, w);
5219
+ function Pe(_, m, R, D) {
5220
+ R || je(_, m), m.pendingcb--, D(), Be(_, m);
5230
5221
  }
5231
- function je(_, w) {
5232
- w.length === 0 && w.needDrain && (w.needDrain = !1, _.emit("drain"));
5222
+ function je(_, m) {
5223
+ m.length === 0 && m.needDrain && (m.needDrain = !1, _.emit("drain"));
5233
5224
  }
5234
- function Ce(_, w) {
5235
- w.bufferProcessing = !0;
5236
- var R = w.bufferedRequest;
5225
+ function Ce(_, m) {
5226
+ m.bufferProcessing = !0;
5227
+ var R = m.bufferedRequest;
5237
5228
  if (_._writev && R && R.next) {
5238
- var D = w.bufferedRequestCount, G = new Array(D), d = w.corkedRequestsFree;
5229
+ var D = m.bufferedRequestCount, G = new Array(D), d = m.corkedRequestsFree;
5239
5230
  d.entry = R;
5240
5231
  for (var p = 0, A = !0; R; )
5241
5232
  G[p] = R, R.isBuf || (A = !1), R = R.next, p += 1;
5242
- G.allBuffers = A, ae(_, w, !0, w.length, G, "", d.finish), w.pendingcb++, w.lastBufferedRequest = null, d.next ? (w.corkedRequestsFree = d.next, d.next = null) : w.corkedRequestsFree = new e(w), w.bufferedRequestCount = 0;
5233
+ G.allBuffers = A, ae(_, m, !0, m.length, G, "", d.finish), m.pendingcb++, m.lastBufferedRequest = null, d.next ? (m.corkedRequestsFree = d.next, d.next = null) : m.corkedRequestsFree = new e(m), m.bufferedRequestCount = 0;
5243
5234
  } else {
5244
5235
  for (; R; ) {
5245
- var O = R.chunk, Z = R.encoding, j = R.callback, V = w.objectMode ? 1 : O.length;
5246
- if (ae(_, w, !1, V, O, Z, j), R = R.next, w.bufferedRequestCount--, w.writing)
5236
+ var O = R.chunk, Z = R.encoding, j = R.callback, V = m.objectMode ? 1 : O.length;
5237
+ if (ae(_, m, !1, V, O, Z, j), R = R.next, m.bufferedRequestCount--, m.writing)
5247
5238
  break;
5248
5239
  }
5249
- R === null && (w.lastBufferedRequest = null);
5240
+ R === null && (m.lastBufferedRequest = null);
5250
5241
  }
5251
- w.bufferedRequest = R, w.bufferProcessing = !1;
5242
+ m.bufferedRequest = R, m.bufferProcessing = !1;
5252
5243
  }
5253
- M.prototype._write = function(_, w, R) {
5244
+ N.prototype._write = function(_, m, R) {
5254
5245
  R(new I("_write()"));
5255
- }, M.prototype._writev = null, M.prototype.end = function(_, w, R) {
5246
+ }, N.prototype._writev = null, N.prototype.end = function(_, m, R) {
5256
5247
  var D = this._writableState;
5257
- return typeof _ == "function" ? (R = _, _ = null, w = null) : typeof w == "function" && (R = w, w = null), _ != null && this.write(_, w), D.corked && (D.corked = 1, this.uncork()), D.ending || qe(this, D, R), this;
5258
- }, Object.defineProperty(M.prototype, "writableLength", {
5248
+ return typeof _ == "function" ? (R = _, _ = null, m = null) : typeof m == "function" && (R = m, m = null), _ != null && this.write(_, m), D.corked && (D.corked = 1, this.uncork()), D.ending || qe(this, D, R), this;
5249
+ }, Object.defineProperty(N.prototype, "writableLength", {
5259
5250
  // making it explicit this property is not enumerable
5260
5251
  // because otherwise some prototype manipulation in
5261
5252
  // userland will fail
@@ -5267,34 +5258,34 @@ function ms() {
5267
5258
  function We(_) {
5268
5259
  return _.ending && _.length === 0 && _.bufferedRequest === null && !_.finished && !_.writing;
5269
5260
  }
5270
- function Q(_, w) {
5261
+ function Q(_, m) {
5271
5262
  _._final(function(R) {
5272
- w.pendingcb--, R && L(_, R), w.prefinished = !0, _.emit("prefinish"), Be(_, w);
5263
+ m.pendingcb--, R && L(_, R), m.prefinished = !0, _.emit("prefinish"), Be(_, m);
5273
5264
  });
5274
5265
  }
5275
- function oe(_, w) {
5276
- !w.prefinished && !w.finalCalled && (typeof _._final == "function" && !w.destroyed ? (w.pendingcb++, w.finalCalled = !0, process.nextTick(Q, _, w)) : (w.prefinished = !0, _.emit("prefinish")));
5266
+ function oe(_, m) {
5267
+ !m.prefinished && !m.finalCalled && (typeof _._final == "function" && !m.destroyed ? (m.pendingcb++, m.finalCalled = !0, process.nextTick(Q, _, m)) : (m.prefinished = !0, _.emit("prefinish")));
5277
5268
  }
5278
- function Be(_, w) {
5279
- var R = We(w);
5280
- if (R && (oe(_, w), w.pendingcb === 0 && (w.finished = !0, _.emit("finish"), w.autoDestroy))) {
5269
+ function Be(_, m) {
5270
+ var R = We(m);
5271
+ if (R && (oe(_, m), m.pendingcb === 0 && (m.finished = !0, _.emit("finish"), m.autoDestroy))) {
5281
5272
  var D = _._readableState;
5282
5273
  (!D || D.autoDestroy && D.endEmitted) && _.destroy();
5283
5274
  }
5284
5275
  return R;
5285
5276
  }
5286
- function qe(_, w, R) {
5287
- w.ending = !0, Be(_, w), R && (w.finished ? process.nextTick(R) : _.once("finish", R)), w.ended = !0, _.writable = !1;
5277
+ function qe(_, m, R) {
5278
+ m.ending = !0, Be(_, m), R && (m.finished ? process.nextTick(R) : _.once("finish", R)), m.ended = !0, _.writable = !1;
5288
5279
  }
5289
- function Ne(_, w, R) {
5280
+ function Me(_, m, R) {
5290
5281
  var D = _.entry;
5291
5282
  for (_.entry = null; D; ) {
5292
5283
  var G = D.callback;
5293
- w.pendingcb--, G(R), D = D.next;
5284
+ m.pendingcb--, G(R), D = D.next;
5294
5285
  }
5295
- w.corkedRequestsFree.next = _;
5286
+ m.corkedRequestsFree.next = _;
5296
5287
  }
5297
- return Object.defineProperty(M.prototype, "destroyed", {
5288
+ return Object.defineProperty(N.prototype, "destroyed", {
5298
5289
  // making it explicit this property is not enumerable
5299
5290
  // because otherwise some prototype manipulation in
5300
5291
  // userland will fail
@@ -5302,11 +5293,11 @@ function ms() {
5302
5293
  get: function() {
5303
5294
  return this._writableState === void 0 ? !1 : this._writableState.destroyed;
5304
5295
  },
5305
- set: function(w) {
5306
- this._writableState && (this._writableState.destroyed = w);
5296
+ set: function(m) {
5297
+ this._writableState && (this._writableState.destroyed = m);
5307
5298
  }
5308
- }), M.prototype.destroy = l.destroy, M.prototype._undestroy = l.undestroy, M.prototype._destroy = function(_, w) {
5309
- w(_);
5299
+ }), N.prototype.destroy = l.destroy, N.prototype._undestroy = l.undestroy, N.prototype._destroy = function(_, m) {
5300
+ m(_);
5310
5301
  }, Gr;
5311
5302
  }
5312
5303
  var jr, si;
@@ -5315,7 +5306,7 @@ function St() {
5315
5306
  si = 1;
5316
5307
  var e = Object.keys || function(y) {
5317
5308
  var g = [];
5318
- for (var m in y) g.push(m);
5309
+ for (var w in y) g.push(w);
5319
5310
  return g;
5320
5311
  };
5321
5312
  jr = f;
@@ -5556,7 +5547,7 @@ function ws(e, t, r) {
5556
5547
  n = !1, l = !0, i || r.call(e);
5557
5548
  }, g = function(v) {
5558
5549
  r.call(e, v);
5559
- }, m = function() {
5550
+ }, w = function() {
5560
5551
  var v;
5561
5552
  if (n && !l)
5562
5553
  return (!e._readableState || !e._readableState.ended) && (v = new ai()), r.call(e, v);
@@ -5565,8 +5556,8 @@ function ws(e, t, r) {
5565
5556
  }, E = function() {
5566
5557
  e.req.on("finish", u);
5567
5558
  };
5568
- return au(e) ? (e.on("complete", u), e.on("abort", m), e.req ? E() : e.on("request", E)) : i && !e._writableState && (e.on("end", a), e.on("close", a)), e.on("end", y), e.on("finish", u), t.error !== !1 && e.on("error", g), e.on("close", m), function() {
5569
- e.removeListener("complete", u), e.removeListener("abort", m), e.removeListener("request", E), e.req && e.req.removeListener("finish", u), e.removeListener("end", a), e.removeListener("close", a), e.removeListener("finish", u), e.removeListener("end", y), e.removeListener("error", g), e.removeListener("close", m);
5559
+ return au(e) ? (e.on("complete", u), e.on("abort", w), e.req ? E() : e.on("request", E)) : i && !e._writableState && (e.on("end", a), e.on("close", a)), e.on("end", y), e.on("finish", u), t.error !== !1 && e.on("error", g), e.on("close", w), function() {
5560
+ e.removeListener("complete", u), e.removeListener("abort", w), e.removeListener("request", E), e.req && e.req.removeListener("finish", u), e.removeListener("end", a), e.removeListener("close", a), e.removeListener("finish", u), e.removeListener("end", y), e.removeListener("error", g), e.removeListener("close", w);
5570
5561
  };
5571
5562
  }
5572
5563
  var Pn = ws, qr, fi;
@@ -5591,7 +5582,7 @@ function fu() {
5591
5582
  }
5592
5583
  return (L === "string" ? String : Number)(k);
5593
5584
  }
5594
- var i = Pn, a = Symbol("lastResolve"), f = Symbol("lastReject"), u = Symbol("error"), l = Symbol("ended"), y = Symbol("lastPromise"), g = Symbol("handlePromise"), m = Symbol("stream");
5585
+ var i = Pn, a = Symbol("lastResolve"), f = Symbol("lastReject"), u = Symbol("error"), l = Symbol("ended"), y = Symbol("lastPromise"), g = Symbol("handlePromise"), w = Symbol("stream");
5595
5586
  function E(k, L) {
5596
5587
  return {
5597
5588
  value: k,
@@ -5601,7 +5592,7 @@ function fu() {
5601
5592
  function I(k) {
5602
5593
  var L = k[a];
5603
5594
  if (L !== null) {
5604
- var U = k[m].read();
5595
+ var U = k[w].read();
5605
5596
  U !== null && (k[y] = null, k[a] = null, k[f] = null, L(E(U, !1)));
5606
5597
  }
5607
5598
  }
@@ -5622,7 +5613,7 @@ function fu() {
5622
5613
  var T = Object.getPrototypeOf(function() {
5623
5614
  }), C = Object.setPrototypeOf((e = {
5624
5615
  get stream() {
5625
- return this[m];
5616
+ return this[w];
5626
5617
  },
5627
5618
  next: function() {
5628
5619
  var L = this, U = this[u];
@@ -5630,7 +5621,7 @@ function fu() {
5630
5621
  return Promise.reject(U);
5631
5622
  if (this[l])
5632
5623
  return Promise.resolve(E(void 0, !0));
5633
- if (this[m].destroyed)
5624
+ if (this[w].destroyed)
5634
5625
  return new Promise(function($, se) {
5635
5626
  process.nextTick(function() {
5636
5627
  L[u] ? se(L[u]) : $(E(void 0, !0));
@@ -5640,9 +5631,9 @@ function fu() {
5640
5631
  if (S)
5641
5632
  z = new Promise(P(S, this));
5642
5633
  else {
5643
- var M = this[m].read();
5644
- if (M !== null)
5645
- return Promise.resolve(E(M, !1));
5634
+ var N = this[w].read();
5635
+ if (N !== null)
5636
+ return Promise.resolve(E(N, !1));
5646
5637
  z = new Promise(this[g]);
5647
5638
  }
5648
5639
  return this[y] = z, z;
@@ -5652,7 +5643,7 @@ function fu() {
5652
5643
  }), t(e, "return", function() {
5653
5644
  var L = this;
5654
5645
  return new Promise(function(U, S) {
5655
- L[m].destroy(null, function(z) {
5646
+ L[w].destroy(null, function(z) {
5656
5647
  if (z) {
5657
5648
  S(z);
5658
5649
  return;
@@ -5661,7 +5652,7 @@ function fu() {
5661
5652
  });
5662
5653
  });
5663
5654
  }), e), T), F = function(L) {
5664
- var U, S = Object.create(C, (U = {}, t(U, m, {
5655
+ var U, S = Object.create(C, (U = {}, t(U, w, {
5665
5656
  value: L,
5666
5657
  writable: !0
5667
5658
  }), t(U, a, {
@@ -5677,16 +5668,16 @@ function fu() {
5677
5668
  value: L._readableState.endEmitted,
5678
5669
  writable: !0
5679
5670
  }), t(U, g, {
5680
- value: function(M, $) {
5681
- var se = S[m].read();
5682
- se ? (S[y] = null, S[a] = null, S[f] = null, M(E(se, !1))) : (S[a] = M, S[f] = $);
5671
+ value: function(N, $) {
5672
+ var se = S[w].read();
5673
+ se ? (S[y] = null, S[a] = null, S[f] = null, N(E(se, !1))) : (S[a] = N, S[f] = $);
5683
5674
  },
5684
5675
  writable: !0
5685
5676
  }), U));
5686
5677
  return S[y] = null, i(L, function(z) {
5687
5678
  if (z && z.code !== "ERR_STREAM_PREMATURE_CLOSE") {
5688
- var M = S[f];
5689
- M !== null && (S[y] = null, S[a] = null, S[f] = null, M(z)), S[u] = z;
5679
+ var N = S[f];
5680
+ N !== null && (S[y] = null, S[a] = null, S[f] = null, N(z)), S[u] = z;
5690
5681
  return;
5691
5682
  }
5692
5683
  var $ = S[a];
@@ -5706,7 +5697,7 @@ function _s() {
5706
5697
  if (ci) return Kr;
5707
5698
  ci = 1, Kr = $;
5708
5699
  var e;
5709
- $.ReadableState = M, ds.EventEmitter;
5700
+ $.ReadableState = N, ds.EventEmitter;
5710
5701
  var t = function(p, A) {
5711
5702
  return p.listeners(A).length;
5712
5703
  }, r = ps, n = Rt.Buffer, i = (typeof Xe < "u" ? Xe : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
@@ -5720,20 +5711,20 @@ function _s() {
5720
5711
  var u = Rn, l;
5721
5712
  u && u.debuglog ? l = u.debuglog("stream") : l = function() {
5722
5713
  };
5723
- var y = kf(), g = bs, m = gs, E = m.getHighWaterMark, I = ct.codes, v = I.ERR_INVALID_ARG_TYPE, P = I.ERR_STREAM_PUSH_AFTER_EOF, T = I.ERR_METHOD_NOT_IMPLEMENTED, C = I.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, F, k, L;
5714
+ var y = kf(), g = bs, w = gs, E = w.getHighWaterMark, I = ct.codes, v = I.ERR_INVALID_ARG_TYPE, P = I.ERR_STREAM_PUSH_AFTER_EOF, T = I.ERR_METHOD_NOT_IMPLEMENTED, C = I.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, F, k, L;
5724
5715
  ge($, r);
5725
5716
  var U = g.errorOrDestroy, S = ["error", "close", "destroy", "pause", "resume"];
5726
5717
  function z(d, p, A) {
5727
5718
  if (typeof d.prependListener == "function") return d.prependListener(p, A);
5728
5719
  !d._events || !d._events[p] ? d.on(p, A) : Array.isArray(d._events[p]) ? d._events[p].unshift(A) : d._events[p] = [A, d._events[p]];
5729
5720
  }
5730
- function M(d, p, A) {
5721
+ function N(d, p, A) {
5731
5722
  e = e || St(), d = d || {}, typeof A != "boolean" && (A = p instanceof e), this.objectMode = !!d.objectMode, A && (this.objectMode = this.objectMode || !!d.readableObjectMode), this.highWaterMark = E(this, d, "readableHighWaterMark", A), this.buffer = new y(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = d.emitClose !== !1, this.autoDestroy = !!d.autoDestroy, this.destroyed = !1, this.defaultEncoding = d.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, d.encoding && (F || (F = gr.StringDecoder), this.decoder = new F(d.encoding), this.encoding = d.encoding);
5732
5723
  }
5733
5724
  function $(d) {
5734
5725
  if (e = e || St(), !(this instanceof $)) return new $(d);
5735
5726
  var p = this instanceof e;
5736
- this._readableState = new M(d, this, p), this.readable = !0, d && (typeof d.read == "function" && (this._read = d.read), typeof d.destroy == "function" && (this._destroy = d.destroy)), r.call(this);
5727
+ this._readableState = new N(d, this, p), this.readable = !0, d && (typeof d.read == "function" && (this._read = d.read), typeof d.destroy == "function" && (this._destroy = d.destroy)), r.call(this);
5737
5728
  }
5738
5729
  Object.defineProperty($.prototype, "destroyed", {
5739
5730
  // making it explicit this property is not enumerable
@@ -5811,7 +5802,7 @@ function _s() {
5811
5802
  var O = p.needReadable;
5812
5803
  l("need readable", O), (p.length === 0 || p.length - d < p.highWaterMark) && (O = !0, l("length less than watermark", O)), p.ended || p.reading ? (O = !1, l("reading or ended", O)) : O && (l("do read"), p.reading = !0, p.sync = !0, p.length === 0 && (p.needReadable = !0), this._read(p.highWaterMark), p.sync = !1, p.reading || (d = ve(A, p)));
5813
5804
  var Z;
5814
- return d > 0 ? Z = w(d, p) : Z = null, Z === null ? (p.needReadable = p.length <= p.highWaterMark, d = 0) : (p.length -= d, p.awaitDrain = 0), p.length === 0 && (p.ended || (p.needReadable = !0), A !== d && p.ended && R(this)), Z !== null && this.emit("data", Z), Z;
5805
+ return d > 0 ? Z = m(d, p) : Z = null, Z === null ? (p.needReadable = p.length <= p.highWaterMark, d = 0) : (p.length -= d, p.awaitDrain = 0), p.length === 0 && (p.ended || (p.needReadable = !0), A !== d && p.ended && R(this)), Z !== null && this.emit("data", Z), Z;
5815
5806
  };
5816
5807
  function et(d, p) {
5817
5808
  if (l("onEofChunk"), !p.ended) {
@@ -5939,9 +5930,9 @@ function _s() {
5939
5930
  return d.flowing || (l("resume"), d.flowing = !d.readableListening, qe(this, d)), d.paused = !1, this;
5940
5931
  };
5941
5932
  function qe(d, p) {
5942
- p.resumeScheduled || (p.resumeScheduled = !0, process.nextTick(Ne, d, p));
5933
+ p.resumeScheduled || (p.resumeScheduled = !0, process.nextTick(Me, d, p));
5943
5934
  }
5944
- function Ne(d, p) {
5935
+ function Me(d, p) {
5945
5936
  l("resume", p.reading), p.reading || d.read(0), p.resumeScheduled = !1, d.emit("resume"), _(d), p.flowing && !p.reading && d.read(0);
5946
5937
  }
5947
5938
  $.prototype.pause = function() {
@@ -6005,7 +5996,7 @@ function _s() {
6005
5996
  set: function(p) {
6006
5997
  this._readableState && (this._readableState.flowing = p);
6007
5998
  }
6008
- }), $._fromList = w, Object.defineProperty($.prototype, "readableLength", {
5999
+ }), $._fromList = m, Object.defineProperty($.prototype, "readableLength", {
6009
6000
  // making it explicit this property is not enumerable
6010
6001
  // because otherwise some prototype manipulation in
6011
6002
  // userland will fail
@@ -6014,7 +6005,7 @@ function _s() {
6014
6005
  return this._readableState.length;
6015
6006
  }
6016
6007
  });
6017
- function w(d, p) {
6008
+ function m(d, p) {
6018
6009
  if (p.length === 0) return null;
6019
6010
  var A;
6020
6011
  return p.objectMode ? A = p.buffer.shift() : !d || d >= p.length ? (p.decoder ? A = p.buffer.join("") : p.buffer.length === 1 ? A = p.buffer.first() : A = p.buffer.concat(p.length), p.buffer.clear()) : A = p.buffer.consume(d, p.decoder), A;
@@ -6250,7 +6241,7 @@ function de(e, t, r, n, i, a, f) {
6250
6241
  function pe(e, t, r, n, i, a, f) {
6251
6242
  return Ar(e + (r ^ (t | ~n)) + i + a | 0, f) + t | 0;
6252
6243
  }
6253
- var Lu = Ir, Jr = Rt.Buffer, ku = ge, As = Ss, Fu = new Array(16), Mt = [
6244
+ var Lu = Ir, Jr = Rt.Buffer, ku = ge, As = Ss, Fu = new Array(16), Nt = [
6254
6245
  0,
6255
6246
  1,
6256
6247
  2,
@@ -6581,12 +6572,12 @@ function Rr() {
6581
6572
  ku(Rr, As);
6582
6573
  Rr.prototype._update = function() {
6583
6574
  for (var e = Fu, t = 0; t < 16; ++t) e[t] = this._block.readInt32LE(t * 4);
6584
- for (var r = this._a | 0, n = this._b | 0, i = this._c | 0, a = this._d | 0, f = this._e | 0, u = this._a | 0, l = this._b | 0, y = this._c | 0, g = this._d | 0, m = this._e | 0, E = 0; E < 80; E += 1) {
6575
+ for (var r = this._a | 0, n = this._b | 0, i = this._c | 0, a = this._d | 0, f = this._e | 0, u = this._a | 0, l = this._b | 0, y = this._c | 0, g = this._d | 0, w = this._e | 0, E = 0; E < 80; E += 1) {
6585
6576
  var I, v;
6586
- E < 16 ? (I = pi(r, n, i, a, f, e[Mt[E]], zt[0], $t[E]), v = mi(u, l, y, g, m, e[Dt[E]], Gt[0], Ht[E])) : E < 32 ? (I = bi(r, n, i, a, f, e[Mt[E]], zt[1], $t[E]), v = gi(u, l, y, g, m, e[Dt[E]], Gt[1], Ht[E])) : E < 48 ? (I = yi(r, n, i, a, f, e[Mt[E]], zt[2], $t[E]), v = yi(u, l, y, g, m, e[Dt[E]], Gt[2], Ht[E])) : E < 64 ? (I = gi(r, n, i, a, f, e[Mt[E]], zt[3], $t[E]), v = bi(u, l, y, g, m, e[Dt[E]], Gt[3], Ht[E])) : (I = mi(r, n, i, a, f, e[Mt[E]], zt[4], $t[E]), v = pi(u, l, y, g, m, e[Dt[E]], Gt[4], Ht[E])), r = f, f = a, a = ut(i, 10), i = n, n = I, u = m, m = g, g = ut(y, 10), y = l, l = v;
6577
+ E < 16 ? (I = pi(r, n, i, a, f, e[Nt[E]], zt[0], $t[E]), v = mi(u, l, y, g, w, e[Dt[E]], Gt[0], Ht[E])) : E < 32 ? (I = bi(r, n, i, a, f, e[Nt[E]], zt[1], $t[E]), v = gi(u, l, y, g, w, e[Dt[E]], Gt[1], Ht[E])) : E < 48 ? (I = yi(r, n, i, a, f, e[Nt[E]], zt[2], $t[E]), v = yi(u, l, y, g, w, e[Dt[E]], Gt[2], Ht[E])) : E < 64 ? (I = gi(r, n, i, a, f, e[Nt[E]], zt[3], $t[E]), v = bi(u, l, y, g, w, e[Dt[E]], Gt[3], Ht[E])) : (I = mi(r, n, i, a, f, e[Nt[E]], zt[4], $t[E]), v = pi(u, l, y, g, w, e[Dt[E]], Gt[4], Ht[E])), r = f, f = a, a = ut(i, 10), i = n, n = I, u = w, w = g, g = ut(y, 10), y = l, l = v;
6587
6578
  }
6588
6579
  var P = this._b + i + g | 0;
6589
- this._b = this._c + a + m | 0, this._c = this._d + f + u | 0, this._d = this._e + r + l | 0, this._e = this._a + n + y | 0, this._a = P;
6580
+ this._b = this._c + a + w | 0, this._c = this._d + f + u | 0, this._d = this._e + r + l | 0, this._e = this._a + n + y | 0, this._a = P;
6590
6581
  };
6591
6582
  Rr.prototype._digest = function() {
6592
6583
  this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
@@ -6641,7 +6632,7 @@ Tr.prototype.digest = function(e) {
6641
6632
  Tr.prototype._update = function() {
6642
6633
  throw new Error("_update must be implemented by subclass");
6643
6634
  };
6644
- var Tt = Tr, Ou = ge, Ps = Tt, Nu = Ee.Buffer, Mu = [
6635
+ var Tt = Tr, Ou = ge, Ps = Tt, Mu = Ee.Buffer, Nu = [
6645
6636
  1518500249,
6646
6637
  1859775393,
6647
6638
  -1894007588,
@@ -6667,13 +6658,13 @@ Qt.prototype._update = function(e) {
6667
6658
  for (var t = this._w, r = this._a | 0, n = this._b | 0, i = this._c | 0, a = this._d | 0, f = this._e | 0, u = 0; u < 16; ++u) t[u] = e.readInt32BE(u * 4);
6668
6659
  for (; u < 80; ++u) t[u] = t[u - 3] ^ t[u - 8] ^ t[u - 14] ^ t[u - 16];
6669
6660
  for (var l = 0; l < 80; ++l) {
6670
- var y = ~~(l / 20), g = $u(r) + zu(y, n, i, a) + f + t[l] + Mu[y] | 0;
6661
+ var y = ~~(l / 20), g = $u(r) + zu(y, n, i, a) + f + t[l] + Nu[y] | 0;
6671
6662
  f = a, a = i, i = Hu(n), n = r, r = g;
6672
6663
  }
6673
6664
  this._a = r + this._a | 0, this._b = n + this._b | 0, this._c = i + this._c | 0, this._d = a + this._d | 0, this._e = f + this._e | 0;
6674
6665
  };
6675
6666
  Qt.prototype._hash = function() {
6676
- var e = Nu.allocUnsafe(20);
6667
+ var e = Mu.allocUnsafe(20);
6677
6668
  return e.writeInt32BE(this._a | 0, 0), e.writeInt32BE(this._b | 0, 4), e.writeInt32BE(this._c | 0, 8), e.writeInt32BE(this._d | 0, 12), e.writeInt32BE(this._e | 0, 16), e;
6678
6669
  };
6679
6670
  var Gu = Qt, ju = ge, Cs = Tt, Wu = Ee.Buffer, qu = [
@@ -6808,8 +6799,8 @@ function fc(e) {
6808
6799
  er.prototype._update = function(e) {
6809
6800
  for (var t = this._w, r = this._a | 0, n = this._b | 0, i = this._c | 0, a = this._d | 0, f = this._e | 0, u = this._f | 0, l = this._g | 0, y = this._h | 0, g = 0; g < 16; ++g) t[g] = e.readInt32BE(g * 4);
6810
6801
  for (; g < 64; ++g) t[g] = fc(t[g - 2]) + t[g - 7] + ac(t[g - 15]) + t[g - 16] | 0;
6811
- for (var m = 0; m < 64; ++m) {
6812
- var E = y + oc(f) + nc(f, u, l) + tc[m] + t[m] | 0, I = sc(r) + ic(r, n, i) | 0;
6802
+ for (var w = 0; w < 64; ++w) {
6803
+ var E = y + oc(f) + nc(f, u, l) + tc[w] + t[w] | 0, I = sc(r) + ic(r, n, i) | 0;
6813
6804
  y = l, l = u, u = f, f = a + E | 0, a = i, i = n, n = r, r = E + I | 0;
6814
6805
  }
6815
6806
  this._a = r + this._a | 0, this._b = n + this._b | 0, this._c = i + this._c | 0, this._d = a + this._d | 0, this._e = f + this._e | 0, this._f = u + this._f | 0, this._g = l + this._g | 0, this._h = y + this._h | 0;
@@ -7027,22 +7018,22 @@ function ue(e, t) {
7027
7018
  return e >>> 0 < t >>> 0 ? 1 : 0;
7028
7019
  }
7029
7020
  tr.prototype._update = function(e) {
7030
- for (var t = this._w, r = this._ah | 0, n = this._bh | 0, i = this._ch | 0, a = this._dh | 0, f = this._eh | 0, u = this._fh | 0, l = this._gh | 0, y = this._hh | 0, g = this._al | 0, m = this._bl | 0, E = this._cl | 0, I = this._dl | 0, v = this._el | 0, P = this._fl | 0, T = this._gl | 0, C = this._hl | 0, F = 0; F < 32; F += 2)
7021
+ for (var t = this._w, r = this._ah | 0, n = this._bh | 0, i = this._ch | 0, a = this._dh | 0, f = this._eh | 0, u = this._fh | 0, l = this._gh | 0, y = this._hh | 0, g = this._al | 0, w = this._bl | 0, E = this._cl | 0, I = this._dl | 0, v = this._el | 0, P = this._fl | 0, T = this._gl | 0, C = this._hl | 0, F = 0; F < 32; F += 2)
7031
7022
  t[F] = e.readInt32BE(F * 4), t[F + 1] = e.readInt32BE(F * 4 + 4);
7032
7023
  for (; F < 160; F += 2) {
7033
7024
  var k = t[F - 30], L = t[F - 15 * 2 + 1], U = mc(k, L), S = wc(L, k);
7034
7025
  k = t[F - 2 * 2], L = t[F - 2 * 2 + 1];
7035
- var z = _c(k, L), M = xc(L, k), $ = t[F - 7 * 2], se = t[F - 7 * 2 + 1], Te = t[F - 16 * 2], Ge = t[F - 16 * 2 + 1], ae = S + se | 0, xe = U + $ + ue(ae, S) | 0;
7036
- ae = ae + M | 0, xe = xe + z + ue(ae, M) | 0, ae = ae + Ge | 0, xe = xe + Te + ue(ae, Ge) | 0, t[F] = xe, t[F + 1] = ae;
7026
+ var z = _c(k, L), N = xc(L, k), $ = t[F - 7 * 2], se = t[F - 7 * 2 + 1], Te = t[F - 16 * 2], Ge = t[F - 16 * 2 + 1], ae = S + se | 0, xe = U + $ + ue(ae, S) | 0;
7027
+ ae = ae + N | 0, xe = xe + z + ue(ae, N) | 0, ae = ae + Ge | 0, xe = xe + Te + ue(ae, Ge) | 0, t[F] = xe, t[F + 1] = ae;
7037
7028
  }
7038
7029
  for (var ve = 0; ve < 160; ve += 2) {
7039
7030
  xe = t[ve], ae = t[ve + 1];
7040
- var et = xi(r, n, i), Pe = xi(g, m, E), je = vi(r, g), Ce = vi(g, r), We = Ei(f, v), Q = Ei(v, f), oe = wi[ve], Be = wi[ve + 1], qe = _i(f, u, l), Ne = _i(v, P, T), _ = C + Q | 0, w = y + We + ue(_, C) | 0;
7041
- _ = _ + Ne | 0, w = w + qe + ue(_, Ne) | 0, _ = _ + Be | 0, w = w + oe + ue(_, Be) | 0, _ = _ + ae | 0, w = w + xe + ue(_, ae) | 0;
7031
+ var et = xi(r, n, i), Pe = xi(g, w, E), je = vi(r, g), Ce = vi(g, r), We = Ei(f, v), Q = Ei(v, f), oe = wi[ve], Be = wi[ve + 1], qe = _i(f, u, l), Me = _i(v, P, T), _ = C + Q | 0, m = y + We + ue(_, C) | 0;
7032
+ _ = _ + Me | 0, m = m + qe + ue(_, Me) | 0, _ = _ + Be | 0, m = m + oe + ue(_, Be) | 0, _ = _ + ae | 0, m = m + xe + ue(_, ae) | 0;
7042
7033
  var R = Ce + Pe | 0, D = je + et + ue(R, Ce) | 0;
7043
- y = l, C = T, l = u, T = P, u = f, P = v, v = I + _ | 0, f = a + w + ue(v, I) | 0, a = i, I = E, i = n, E = m, n = r, m = g, g = _ + R | 0, r = w + D + ue(g, _) | 0;
7034
+ y = l, C = T, l = u, T = P, u = f, P = v, v = I + _ | 0, f = a + m + ue(v, I) | 0, a = i, I = E, i = n, E = w, n = r, w = g, g = _ + R | 0, r = m + D + ue(g, _) | 0;
7044
7035
  }
7045
- this._al = this._al + g | 0, this._bl = this._bl + m | 0, this._cl = this._cl + E | 0, this._dl = this._dl + I | 0, this._el = this._el + v | 0, this._fl = this._fl + P | 0, this._gl = this._gl + T | 0, this._hl = this._hl + C | 0, this._ah = this._ah + r + ue(this._al, g) | 0, this._bh = this._bh + n + ue(this._bl, m) | 0, this._ch = this._ch + i + ue(this._cl, E) | 0, this._dh = this._dh + a + ue(this._dl, I) | 0, this._eh = this._eh + f + ue(this._el, v) | 0, this._fh = this._fh + u + ue(this._fl, P) | 0, this._gh = this._gh + l + ue(this._gl, T) | 0, this._hh = this._hh + y + ue(this._hl, C) | 0;
7036
+ this._al = this._al + g | 0, this._bl = this._bl + w | 0, this._cl = this._cl + E | 0, this._dl = this._dl + I | 0, this._el = this._el + v | 0, this._fl = this._fl + P | 0, this._gl = this._gl + T | 0, this._hl = this._hl + C | 0, this._ah = this._ah + r + ue(this._al, g) | 0, this._bh = this._bh + n + ue(this._bl, w) | 0, this._ch = this._ch + i + ue(this._cl, E) | 0, this._dh = this._dh + a + ue(this._dl, I) | 0, this._eh = this._eh + f + ue(this._el, v) | 0, this._fh = this._fh + u + ue(this._fl, P) | 0, this._gh = this._gh + l + ue(this._gl, T) | 0, this._hh = this._hh + y + ue(this._hl, C) | 0;
7046
7037
  };
7047
7038
  tr.prototype._hash = function() {
7048
7039
  var e = yc.allocUnsafe(64);
@@ -7078,11 +7069,11 @@ lt.sha224 = pc;
7078
7069
  lt.sha256 = ks;
7079
7070
  lt.sha384 = Ac;
7080
7071
  lt.sha512 = Us;
7081
- var Rc = Rs.exports, Os = Ee.Buffer, Ns = Rn.Transform, Tc = gr.StringDecoder, Pc = ge;
7072
+ var Rc = Rs.exports, Os = Ee.Buffer, Ms = Rn.Transform, Tc = gr.StringDecoder, Pc = ge;
7082
7073
  function Le(e) {
7083
- Ns.call(this), this.hashMode = typeof e == "string", this.hashMode ? this[e] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
7074
+ Ms.call(this), this.hashMode = typeof e == "string", this.hashMode ? this[e] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
7084
7075
  }
7085
- Pc(Le, Ns);
7076
+ Pc(Le, Ms);
7086
7077
  Le.prototype.update = function(e, t, r) {
7087
7078
  typeof e == "string" && (e = Os.from(e, t));
7088
7079
  var n = this._update(e);
@@ -7127,11 +7118,11 @@ Le.prototype._toString = function(e, t, r) {
7127
7118
  var n = this._decoder.write(e);
7128
7119
  return r && (n += this._decoder.end()), n;
7129
7120
  };
7130
- var Cc = Le, Lc = ge, kc = Lu, Fc = Uu, Uc = Rc, Ms = Cc;
7121
+ var Cc = Le, Lc = ge, kc = Lu, Fc = Uu, Uc = Rc, Ns = Cc;
7131
7122
  function Lr(e) {
7132
- Ms.call(this, "digest"), this._hash = e;
7123
+ Ns.call(this, "digest"), this._hash = e;
7133
7124
  }
7134
- Lc(Lr, Ms);
7125
+ Lc(Lr, Ns);
7135
7126
  Lr.prototype._update = function(e) {
7136
7127
  this._hash.update(e);
7137
7128
  };
@@ -7141,7 +7132,7 @@ Lr.prototype._final = function() {
7141
7132
  var Oc = function(t) {
7142
7133
  return t = t.toLowerCase(), t === "md5" ? new kc() : t === "rmd160" || t === "ripemd160" ? new Fc() : new Lr(Uc(t));
7143
7134
  }, ar = Ee.Buffer;
7144
- function Nc(e) {
7135
+ function Mc(e) {
7145
7136
  if (e.length >= 255)
7146
7137
  throw new TypeError("Alphabet too long");
7147
7138
  for (var t = new Uint8Array(256), r = 0; r < t.length; r++)
@@ -7169,11 +7160,11 @@ function Nc(e) {
7169
7160
  }
7170
7161
  for (var z = F - P; z !== F && k[z] === 0; )
7171
7162
  z++;
7172
- for (var M = u.repeat(v); z < F; ++z)
7173
- M += e.charAt(k[z]);
7174
- return M;
7163
+ for (var N = u.repeat(v); z < F; ++z)
7164
+ N += e.charAt(k[z]);
7165
+ return N;
7175
7166
  }
7176
- function m(I) {
7167
+ function w(I) {
7177
7168
  if (typeof I != "string")
7178
7169
  throw new TypeError("Expected String");
7179
7170
  if (I.length === 0)
@@ -7194,23 +7185,23 @@ function Nc(e) {
7194
7185
  S++;
7195
7186
  var z = ar.allocUnsafe(P + (C - S));
7196
7187
  z.fill(0, 0, P);
7197
- for (var M = P; S !== C; )
7198
- z[M++] = F[S++];
7188
+ for (var N = P; S !== C; )
7189
+ z[N++] = F[S++];
7199
7190
  return z;
7200
7191
  }
7201
7192
  function E(I) {
7202
- var v = m(I);
7193
+ var v = w(I);
7203
7194
  if (v)
7204
7195
  return v;
7205
7196
  throw new Error("Non-base" + f + " character");
7206
7197
  }
7207
7198
  return {
7208
7199
  encode: g,
7209
- decodeUnsafe: m,
7200
+ decodeUnsafe: w,
7210
7201
  decode: E
7211
7202
  };
7212
7203
  }
7213
- var Mc = Nc, Dc = Mc, $c = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", Hc = Dc($c), Xr = Hc, zc = Ee.Buffer, Gc = function(e) {
7204
+ var Nc = Mc, Dc = Nc, $c = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", Hc = Dc($c), Xr = Hc, zc = Ee.Buffer, Gc = function(e) {
7214
7205
  function t(a) {
7215
7206
  var f = e(a);
7216
7207
  return Xr.encode(zc.concat([
@@ -7489,7 +7480,7 @@ const we = Qi, Xc = Bf, Si = Yc, Qc = kr, Qr = we.typeforce.maybe(
7489
7480
  network: we.maybe(we.Network)
7490
7481
  })
7491
7482
  ), Zc = (e) => e.length === 32 ? e : e.slice(1, 33);
7492
- function el(e) {
7483
+ function e0(e) {
7493
7484
  (0, Qc.testEcc)(e);
7494
7485
  function t(u) {
7495
7486
  return e.isPoint(u);
@@ -7505,7 +7496,7 @@ function el(e) {
7505
7496
  function i(u, l) {
7506
7497
  const y = Si.decode(u), g = y.version;
7507
7498
  if (we.Array(l)) {
7508
- if (l = l.filter((m) => g === m.wif).pop(), !l) throw new Error("Unknown network version");
7499
+ if (l = l.filter((w) => g === w.wif).pop(), !l) throw new Error("Unknown network version");
7509
7500
  } else if (l = l || hn.bitcoin, g !== l.wif) throw new Error("Invalid network version");
7510
7501
  return r(y.privateKey, {
7511
7502
  compressed: y.compressed,
@@ -7553,10 +7544,10 @@ function el(e) {
7553
7544
  return Buffer.from(e.sign(l, this.__D));
7554
7545
  {
7555
7546
  let g = e.sign(l, this.__D);
7556
- const m = Buffer.alloc(32, 0);
7547
+ const w = Buffer.alloc(32, 0);
7557
7548
  let E = 0;
7558
7549
  for (; g[0] > 127; )
7559
- E++, m.writeUIntLE(E, 0, 6), g = e.sign(l, this.__D, m);
7550
+ E++, w.writeUIntLE(E, 0, 6), g = e.sign(l, this.__D, w);
7560
7551
  return Buffer.from(g);
7561
7552
  }
7562
7553
  }
@@ -7578,18 +7569,18 @@ function el(e) {
7578
7569
  const y = Zc(this.publicKey), g = e.xOnlyPointAddTweak(y, l);
7579
7570
  if (!g || g.xOnlyPubkey === null)
7580
7571
  throw new Error("Cannot tweak public key!");
7581
- const m = Buffer.from([
7572
+ const w = Buffer.from([
7582
7573
  g.parity === 0 ? 2 : 3
7583
7574
  ]);
7584
7575
  return n(
7585
- Buffer.concat([m, g.xOnlyPubkey]),
7576
+ Buffer.concat([w, g.xOnlyPubkey]),
7586
7577
  { network: this.network, compressed: this.compressed }
7587
7578
  );
7588
7579
  }
7589
7580
  tweakFromPrivateKey(l) {
7590
- const g = this.publicKey[0] === 3 || this.publicKey[0] === 4 && (this.publicKey[64] & 1) === 1 ? e.privateNegate(this.privateKey) : this.privateKey, m = e.privateAdd(g, l);
7591
- if (!m) throw new Error("Invalid tweaked private key!");
7592
- return r(Buffer.from(m), {
7581
+ const g = this.publicKey[0] === 3 || this.publicKey[0] === 4 && (this.publicKey[64] & 1) === 1 ? e.privateNegate(this.privateKey) : this.privateKey, w = e.privateAdd(g, l);
7582
+ if (!w) throw new Error("Invalid tweaked private key!");
7583
+ return r(Buffer.from(w), {
7593
7584
  network: this.network,
7594
7585
  compressed: this.compressed
7595
7586
  });
@@ -7603,7 +7594,7 @@ function el(e) {
7603
7594
  makeRandom: a
7604
7595
  };
7605
7596
  }
7606
- Et.ECPairFactory = el;
7597
+ Et.ECPairFactory = e0;
7607
7598
  (function(e) {
7608
7599
  Object.defineProperty(e, "__esModule", { value: !0 }), e.networks = e.ECPairFactory = e.default = void 0;
7609
7600
  var t = Et;
@@ -7632,7 +7623,7 @@ class dn {
7632
7623
  return new dn(nt(t));
7633
7624
  }
7634
7625
  static async fromWalletClient(t) {
7635
- if (!t.account) return N("No account found");
7626
+ if (!t.account) return M("No account found");
7636
7627
  try {
7637
7628
  const r = await t.signTypedData({
7638
7629
  account: t.account,
@@ -7660,7 +7651,7 @@ class dn {
7660
7651
  });
7661
7652
  return fe(new dn(nt(ir(r))));
7662
7653
  } catch (r) {
7663
- return N("Failed to initialize: " + r);
7654
+ return M("Failed to initialize: " + r);
7664
7655
  }
7665
7656
  }
7666
7657
  getMasterPrivKey() {
@@ -7677,7 +7668,7 @@ class dn {
7677
7668
  return r.fromPrivateKey(f).sign(Buffer.from(nt(a), "hex")).toString("hex");
7678
7669
  }
7679
7670
  }
7680
- class dl {
7671
+ class d0 {
7681
7672
  constructor(t) {
7682
7673
  this.quoteUrl = new pn("/quote", t);
7683
7674
  }
@@ -7688,9 +7679,9 @@ class dl {
7688
7679
  amount: r.toString(),
7689
7680
  exact_out: n.toString()
7690
7681
  }), a = await mt.get(i);
7691
- return a.error ? N(a.error) : a.result ? fe(a.result) : N("GetQuote: Unexpected error, result is undefined");
7682
+ return a.error ? M(a.error) : a.result ? fe(a.result) : M("GetQuote: Unexpected error, result is undefined");
7692
7683
  } catch (i) {
7693
- return N("GetQuote:", String(i));
7684
+ return M("GetQuote:", String(i));
7694
7685
  }
7695
7686
  }
7696
7687
  async getAttestedQuote(t) {
@@ -7701,9 +7692,9 @@ class dl {
7701
7692
  "Content-Type": "application/json"
7702
7693
  }
7703
7694
  });
7704
- return r.error ? N(r.error) : r.result ? fe(r.result) : N("GetAttestedQuote: Unexpected error, result is undefined");
7695
+ return r.error ? M(r.error) : r.result ? fe(r.result) : M("GetAttestedQuote: Unexpected error, result is undefined");
7705
7696
  } catch (r) {
7706
- return console.log("error :", r), N("GetAttestedQuote:", String(r));
7697
+ return console.log("error :", r), M("GetAttestedQuote:", String(r));
7707
7698
  }
7708
7699
  }
7709
7700
  async getStrategies() {
@@ -7711,9 +7702,9 @@ class dl {
7711
7702
  const t = await mt.get(
7712
7703
  this.quoteUrl.endpoint("/strategies")
7713
7704
  );
7714
- if (t.error) return N(t.error);
7705
+ if (t.error) return M(t.error);
7715
7706
  if (!t.result)
7716
- return N("GetStrategies: Unexpected error, result is undefined");
7707
+ return M("GetStrategies: Unexpected error, result is undefined");
7717
7708
  const r = {};
7718
7709
  for (const n of Object.values(t.result)) {
7719
7710
  const i = Wa(
@@ -7730,23 +7721,23 @@ class dl {
7730
7721
  }
7731
7722
  return fe(r);
7732
7723
  } catch (t) {
7733
- return N("GetStrategies:", String(t));
7724
+ return M("GetStrategies:", String(t));
7734
7725
  }
7735
7726
  }
7736
7727
  }
7737
7728
  export {
7738
7729
  rf as BlockNumberFetcher,
7739
7730
  Ya as EvmRelay,
7740
- ll as Garden,
7731
+ l0 as Garden,
7741
7732
  ye as OrderActions,
7742
7733
  ie as OrderStatus,
7743
7734
  qa as ParseOrderStatus,
7744
7735
  nn as ParseSwapStatus,
7745
- dl as Quote,
7736
+ d0 as Quote,
7746
7737
  dn as SecretManager,
7747
7738
  te as SwapStatus,
7748
7739
  en as TimeLocks,
7749
7740
  Wa as constructOrderPair,
7750
7741
  Va as parseAction,
7751
- cl as switchOrAddNetwork
7742
+ c0 as switchOrAddNetwork
7752
7743
  };