@btc-vision/bitcoin 6.4.11 → 6.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/browser/chunks/crypto-0PweVewC.js +2033 -0
  2. package/browser/chunks/payments-CgasufRS.js +1047 -0
  3. package/browser/chunks/psbt-BIwOrKer.js +4096 -0
  4. package/browser/chunks/script-CROJPzz_.js +318 -0
  5. package/browser/chunks/transaction-DchBu35N.js +432 -0
  6. package/browser/chunks/utils-CO5kmxe9.js +761 -0
  7. package/browser/crypto/crypto.d.ts +1 -1
  8. package/browser/crypto.d.ts +1 -1
  9. package/browser/hooks/HookedSigner.d.ts +1 -1
  10. package/browser/index.d.ts +6 -4
  11. package/browser/index.js +92 -2
  12. package/browser/payments/index.d.ts +2 -2
  13. package/browser/payments/lazy.d.ts +1 -1
  14. package/browser/psbt/bip371.d.ts +5 -1
  15. package/browser/psbt.d.ts +1 -1
  16. package/browser/typeforce.d.ts +38 -0
  17. package/browser/types.d.ts +22 -20
  18. package/build/address.js +2 -2
  19. package/build/bip66.js +2 -2
  20. package/build/block.js +2 -2
  21. package/build/crypto.d.ts +1 -1
  22. package/build/crypto.js +2 -3
  23. package/build/hooks/HookedSigner.d.ts +1 -1
  24. package/build/index.d.ts +6 -4
  25. package/build/index.js +2 -2
  26. package/build/payments/bip341.js +1 -1
  27. package/build/payments/index.d.ts +2 -2
  28. package/build/payments/lazy.d.ts +1 -1
  29. package/build/payments/p2op.js +3 -3
  30. package/build/payments/p2pk.js +1 -1
  31. package/build/payments/p2pkh.js +3 -3
  32. package/build/payments/p2sh.js +3 -3
  33. package/build/payments/p2tr.js +9 -5
  34. package/build/payments/p2wpkh.js +3 -3
  35. package/build/payments/p2wsh.js +2 -2
  36. package/build/psbt/bip371.d.ts +5 -1
  37. package/build/psbt/bip371.js +10 -7
  38. package/build/psbt/psbtutils.js +5 -4
  39. package/build/psbt.d.ts +1 -1
  40. package/build/psbt.js +78 -45
  41. package/build/script.js +2 -2
  42. package/build/script_signature.js +7 -7
  43. package/build/transaction.js +22 -10
  44. package/build/tsconfig.tsbuildinfo +1 -0
  45. package/build/types.d.ts +22 -20
  46. package/build/types.js +10 -9
  47. package/package.json +37 -63
  48. package/src/address.ts +2 -2
  49. package/src/bip66.ts +2 -2
  50. package/src/block.ts +8 -5
  51. package/src/crypto.ts +3 -4
  52. package/src/ecc_lib.ts +1 -1
  53. package/src/hooks/HookedSigner.ts +1 -1
  54. package/src/index.ts +6 -6
  55. package/src/payments/bip341.ts +1 -1
  56. package/src/payments/embed.ts +1 -2
  57. package/src/payments/index.ts +4 -4
  58. package/src/payments/lazy.ts +3 -3
  59. package/src/payments/p2op.ts +4 -3
  60. package/src/payments/p2pk.ts +1 -1
  61. package/src/payments/p2pkh.ts +3 -3
  62. package/src/payments/p2sh.ts +13 -5
  63. package/src/payments/p2tr.ts +8 -9
  64. package/src/payments/p2wpkh.ts +3 -3
  65. package/src/payments/p2wsh.ts +4 -4
  66. package/src/psbt/bip371.ts +22 -13
  67. package/src/psbt/psbtutils.ts +8 -5
  68. package/src/psbt.ts +127 -80
  69. package/src/script.ts +4 -4
  70. package/src/script_signature.ts +7 -7
  71. package/src/transaction.ts +31 -18
  72. package/src/typeforce.d.ts +38 -0
  73. package/src/types.ts +34 -29
  74. package/test/address.spec.ts +12 -4
  75. package/test/bitcoin.core.spec.ts +1 -1
  76. package/test/block.spec.ts +1 -1
  77. package/test/bufferutils.spec.ts +1 -1
  78. package/test/crypto.spec.ts +3 -2
  79. package/test/fixtures/address.json +1 -1
  80. package/test/integration/addresses.spec.ts +1 -1
  81. package/test/integration/bip32.spec.ts +2 -2
  82. package/test/integration/blocks.spec.ts +1 -1
  83. package/test/integration/cltv.spec.ts +3 -3
  84. package/test/integration/csv.spec.ts +3 -3
  85. package/test/integration/payments.spec.ts +1 -1
  86. package/test/integration/taproot.spec.ts +8 -7
  87. package/test/integration/transactions.spec.ts +2 -2
  88. package/test/payments.spec.ts +4 -3
  89. package/test/psbt.spec.ts +106 -74
  90. package/test/script.spec.ts +73 -7
  91. package/test/script_number.spec.ts +1 -1
  92. package/test/script_signature.spec.ts +1 -1
  93. package/test/transaction.spec.ts +1 -1
  94. package/test/tsconfig.json +1 -1
  95. package/test/types.spec.ts +1 -1
  96. package/vite.config.browser.ts +93 -0
  97. package/vitest.config.ts +16 -0
  98. package/.babelrc +0 -4
  99. package/.mocharc.json +0 -13
  100. package/browser/index.js.LICENSE.txt +0 -14
  101. package/cjs/package.json +0 -3
  102. package/gulpfile.js +0 -42
  103. package/src/crypto/crypto-browser.js +0 -75
  104. package/test/ts-node-register.js +0 -7
  105. package/webpack.config.js +0 -79
@@ -0,0 +1,2033 @@
1
+ var ut = {}, rt = {};
2
+ rt.byteLength = sr;
3
+ rt.toByteArray = cr;
4
+ rt.fromByteArray = pr;
5
+ var N = [], S = [], nr = typeof Uint8Array < "u" ? Uint8Array : Array, ht = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
6
+ for (var Y = 0, or = ht.length; Y < or; ++Y)
7
+ N[Y] = ht[Y], S[ht.charCodeAt(Y)] = Y;
8
+ S[45] = 62;
9
+ S[95] = 63;
10
+ function Lt(c) {
11
+ var h = c.length;
12
+ if (h % 4 > 0)
13
+ throw new Error("Invalid string. Length must be a multiple of 4");
14
+ var p = c.indexOf("=");
15
+ p === -1 && (p = h);
16
+ var f = p === h ? 0 : 4 - p % 4;
17
+ return [p, f];
18
+ }
19
+ function sr(c) {
20
+ var h = Lt(c), p = h[0], f = h[1];
21
+ return (p + f) * 3 / 4 - f;
22
+ }
23
+ function hr(c, h, p) {
24
+ return (h + p) * 3 / 4 - p;
25
+ }
26
+ function cr(c) {
27
+ var h, p = Lt(c), f = p[0], y = p[1], a = new nr(hr(c, f, y)), l = 0, d = y > 0 ? f - 4 : f, w;
28
+ for (w = 0; w < d; w += 4)
29
+ h = S[c.charCodeAt(w)] << 18 | S[c.charCodeAt(w + 1)] << 12 | S[c.charCodeAt(w + 2)] << 6 | S[c.charCodeAt(w + 3)], a[l++] = h >> 16 & 255, a[l++] = h >> 8 & 255, a[l++] = h & 255;
30
+ return y === 2 && (h = S[c.charCodeAt(w)] << 2 | S[c.charCodeAt(w + 1)] >> 4, a[l++] = h & 255), y === 1 && (h = S[c.charCodeAt(w)] << 10 | S[c.charCodeAt(w + 1)] << 4 | S[c.charCodeAt(w + 2)] >> 2, a[l++] = h >> 8 & 255, a[l++] = h & 255), a;
31
+ }
32
+ function ur(c) {
33
+ return N[c >> 18 & 63] + N[c >> 12 & 63] + N[c >> 6 & 63] + N[c & 63];
34
+ }
35
+ function ar(c, h, p) {
36
+ for (var f, y = [], a = h; a < p; a += 3)
37
+ f = (c[a] << 16 & 16711680) + (c[a + 1] << 8 & 65280) + (c[a + 2] & 255), y.push(ur(f));
38
+ return y.join("");
39
+ }
40
+ function pr(c) {
41
+ for (var h, p = c.length, f = p % 3, y = [], a = 16383, l = 0, d = p - f; l < d; l += a)
42
+ y.push(ar(c, l, l + a > d ? d : l + a));
43
+ return f === 1 ? (h = c[p - 1], y.push(
44
+ N[h >> 2] + N[h << 4 & 63] + "=="
45
+ )) : f === 2 && (h = (c[p - 2] << 8) + c[p - 1], y.push(
46
+ N[h >> 10] + N[h >> 4 & 63] + N[h << 2 & 63] + "="
47
+ )), y.join("");
48
+ }
49
+ var at = {};
50
+ at.read = function(c, h, p, f, y) {
51
+ var a, l, d = y * 8 - f - 1, w = (1 << d) - 1, g = w >> 1, o = -7, B = p ? y - 1 : 0, U = p ? -1 : 1, m = c[h + B];
52
+ for (B += U, a = m & (1 << -o) - 1, m >>= -o, o += d; o > 0; a = a * 256 + c[h + B], B += U, o -= 8)
53
+ ;
54
+ for (l = a & (1 << -o) - 1, a >>= -o, o += f; o > 0; l = l * 256 + c[h + B], B += U, o -= 8)
55
+ ;
56
+ if (a === 0)
57
+ a = 1 - g;
58
+ else {
59
+ if (a === w)
60
+ return l ? NaN : (m ? -1 : 1) * (1 / 0);
61
+ l = l + Math.pow(2, f), a = a - g;
62
+ }
63
+ return (m ? -1 : 1) * l * Math.pow(2, a - f);
64
+ };
65
+ at.write = function(c, h, p, f, y, a) {
66
+ var l, d, w, g = a * 8 - y - 1, o = (1 << g) - 1, B = o >> 1, U = y === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = f ? 0 : a - 1, _ = f ? 1 : -1, P = h < 0 || h === 0 && 1 / h < 0 ? 1 : 0;
67
+ for (h = Math.abs(h), isNaN(h) || h === 1 / 0 ? (d = isNaN(h) ? 1 : 0, l = o) : (l = Math.floor(Math.log(h) / Math.LN2), h * (w = Math.pow(2, -l)) < 1 && (l--, w *= 2), l + B >= 1 ? h += U / w : h += U * Math.pow(2, 1 - B), h * w >= 2 && (l++, w /= 2), l + B >= o ? (d = 0, l = o) : l + B >= 1 ? (d = (h * w - 1) * Math.pow(2, y), l = l + B) : (d = h * Math.pow(2, B - 1) * Math.pow(2, y), l = 0)); y >= 8; c[p + m] = d & 255, m += _, d /= 256, y -= 8)
68
+ ;
69
+ for (l = l << y | d, g += y; g > 0; c[p + m] = l & 255, m += _, l /= 256, g -= 8)
70
+ ;
71
+ c[p + m - _] |= P * 128;
72
+ };
73
+ (function(c) {
74
+ const h = rt, p = at, f = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
75
+ c.Buffer = o, c.SlowBuffer = C, c.INSPECT_MAX_BYTES = 50;
76
+ const y = 2147483647;
77
+ c.kMaxLength = y;
78
+ const { Uint8Array: a, ArrayBuffer: l, SharedArrayBuffer: d } = globalThis;
79
+ o.TYPED_ARRAY_SUPPORT = w(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
80
+ "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
81
+ );
82
+ function w() {
83
+ try {
84
+ const e = new a(1), t = { foo: function() {
85
+ return 42;
86
+ } };
87
+ return Object.setPrototypeOf(t, a.prototype), Object.setPrototypeOf(e, t), e.foo() === 42;
88
+ } catch {
89
+ return !1;
90
+ }
91
+ }
92
+ Object.defineProperty(o.prototype, "parent", {
93
+ enumerable: !0,
94
+ get: function() {
95
+ if (o.isBuffer(this))
96
+ return this.buffer;
97
+ }
98
+ }), Object.defineProperty(o.prototype, "offset", {
99
+ enumerable: !0,
100
+ get: function() {
101
+ if (o.isBuffer(this))
102
+ return this.byteOffset;
103
+ }
104
+ });
105
+ function g(e) {
106
+ if (e > y)
107
+ throw new RangeError('The value "' + e + '" is invalid for option "size"');
108
+ const t = new a(e);
109
+ return Object.setPrototypeOf(t, o.prototype), t;
110
+ }
111
+ function o(e, t, r) {
112
+ if (typeof e == "number") {
113
+ if (typeof t == "string")
114
+ throw new TypeError(
115
+ 'The "string" argument must be of type string. Received type number'
116
+ );
117
+ return _(e);
118
+ }
119
+ return B(e, t, r);
120
+ }
121
+ o.poolSize = 8192;
122
+ function B(e, t, r) {
123
+ if (typeof e == "string")
124
+ return P(e, t);
125
+ if (l.isView(e))
126
+ return et(e);
127
+ if (e == null)
128
+ throw new TypeError(
129
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e
130
+ );
131
+ if (k(e, l) || e && k(e.buffer, l) || typeof d < "u" && (k(e, d) || e && k(e.buffer, d)))
132
+ return X(e, t, r);
133
+ if (typeof e == "number")
134
+ throw new TypeError(
135
+ 'The "value" argument must not be of type number. Received type number'
136
+ );
137
+ const i = e.valueOf && e.valueOf();
138
+ if (i != null && i !== e)
139
+ return o.from(i, t, r);
140
+ const n = it(e);
141
+ if (n) return n;
142
+ if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof e[Symbol.toPrimitive] == "function")
143
+ return o.from(e[Symbol.toPrimitive]("string"), t, r);
144
+ throw new TypeError(
145
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e
146
+ );
147
+ }
148
+ o.from = function(e, t, r) {
149
+ return B(e, t, r);
150
+ }, Object.setPrototypeOf(o.prototype, a.prototype), Object.setPrototypeOf(o, a);
151
+ function U(e) {
152
+ if (typeof e != "number")
153
+ throw new TypeError('"size" argument must be of type number');
154
+ if (e < 0)
155
+ throw new RangeError('The value "' + e + '" is invalid for option "size"');
156
+ }
157
+ function m(e, t, r) {
158
+ return U(e), e <= 0 ? g(e) : t !== void 0 ? typeof r == "string" ? g(e).fill(t, r) : g(e).fill(t) : g(e);
159
+ }
160
+ o.alloc = function(e, t, r) {
161
+ return m(e, t, r);
162
+ };
163
+ function _(e) {
164
+ return U(e), g(e < 0 ? 0 : J(e) | 0);
165
+ }
166
+ o.allocUnsafe = function(e) {
167
+ return _(e);
168
+ }, o.allocUnsafeSlow = function(e) {
169
+ return _(e);
170
+ };
171
+ function P(e, t) {
172
+ if ((typeof t != "string" || t === "") && (t = "utf8"), !o.isEncoding(t))
173
+ throw new TypeError("Unknown encoding: " + t);
174
+ const r = W(e, t) | 0;
175
+ let i = g(r);
176
+ const n = i.write(e, t);
177
+ return n !== r && (i = i.slice(0, n)), i;
178
+ }
179
+ function q(e) {
180
+ const t = e.length < 0 ? 0 : J(e.length) | 0, r = g(t);
181
+ for (let i = 0; i < t; i += 1)
182
+ r[i] = e[i] & 255;
183
+ return r;
184
+ }
185
+ function et(e) {
186
+ if (k(e, a)) {
187
+ const t = new a(e);
188
+ return X(t.buffer, t.byteOffset, t.byteLength);
189
+ }
190
+ return q(e);
191
+ }
192
+ function X(e, t, r) {
193
+ if (t < 0 || e.byteLength < t)
194
+ throw new RangeError('"offset" is outside of buffer bounds');
195
+ if (e.byteLength < t + (r || 0))
196
+ throw new RangeError('"length" is outside of buffer bounds');
197
+ let i;
198
+ return t === void 0 && r === void 0 ? i = new a(e) : r === void 0 ? i = new a(e, t) : i = new a(e, t, r), Object.setPrototypeOf(i, o.prototype), i;
199
+ }
200
+ function it(e) {
201
+ if (o.isBuffer(e)) {
202
+ const t = J(e.length) | 0, r = g(t);
203
+ return r.length === 0 || e.copy(r, 0, 0, t), r;
204
+ }
205
+ if (e.length !== void 0)
206
+ return typeof e.length != "number" || st(e.length) ? g(0) : q(e);
207
+ if (e.type === "Buffer" && Array.isArray(e.data))
208
+ return q(e.data);
209
+ }
210
+ function J(e) {
211
+ if (e >= y)
212
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + y.toString(16) + " bytes");
213
+ return e | 0;
214
+ }
215
+ function C(e) {
216
+ return +e != e && (e = 0), o.alloc(+e);
217
+ }
218
+ o.isBuffer = function(t) {
219
+ return t != null && t._isBuffer === !0 && t !== o.prototype;
220
+ }, o.compare = function(t, r) {
221
+ if (k(t, a) && (t = o.from(t, t.offset, t.byteLength)), k(r, a) && (r = o.from(r, r.offset, r.byteLength)), !o.isBuffer(t) || !o.isBuffer(r))
222
+ throw new TypeError(
223
+ 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
224
+ );
225
+ if (t === r) return 0;
226
+ let i = t.length, n = r.length;
227
+ for (let s = 0, u = Math.min(i, n); s < u; ++s)
228
+ if (t[s] !== r[s]) {
229
+ i = t[s], n = r[s];
230
+ break;
231
+ }
232
+ return i < n ? -1 : n < i ? 1 : 0;
233
+ }, o.isEncoding = function(t) {
234
+ switch (String(t).toLowerCase()) {
235
+ case "hex":
236
+ case "utf8":
237
+ case "utf-8":
238
+ case "ascii":
239
+ case "latin1":
240
+ case "binary":
241
+ case "base64":
242
+ case "ucs2":
243
+ case "ucs-2":
244
+ case "utf16le":
245
+ case "utf-16le":
246
+ return !0;
247
+ default:
248
+ return !1;
249
+ }
250
+ }, o.concat = function(t, r) {
251
+ if (!Array.isArray(t))
252
+ throw new TypeError('"list" argument must be an Array of Buffers');
253
+ if (t.length === 0)
254
+ return o.alloc(0);
255
+ let i;
256
+ if (r === void 0)
257
+ for (r = 0, i = 0; i < t.length; ++i)
258
+ r += t[i].length;
259
+ const n = o.allocUnsafe(r);
260
+ let s = 0;
261
+ for (i = 0; i < t.length; ++i) {
262
+ let u = t[i];
263
+ if (k(u, a))
264
+ s + u.length > n.length ? (o.isBuffer(u) || (u = o.from(u)), u.copy(n, s)) : a.prototype.set.call(
265
+ n,
266
+ u,
267
+ s
268
+ );
269
+ else if (o.isBuffer(u))
270
+ u.copy(n, s);
271
+ else
272
+ throw new TypeError('"list" argument must be an Array of Buffers');
273
+ s += u.length;
274
+ }
275
+ return n;
276
+ };
277
+ function W(e, t) {
278
+ if (o.isBuffer(e))
279
+ return e.length;
280
+ if (l.isView(e) || k(e, l))
281
+ return e.byteLength;
282
+ if (typeof e != "string")
283
+ throw new TypeError(
284
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof e
285
+ );
286
+ const r = e.length, i = arguments.length > 2 && arguments[2] === !0;
287
+ if (!i && r === 0) return 0;
288
+ let n = !1;
289
+ for (; ; )
290
+ switch (t) {
291
+ case "ascii":
292
+ case "latin1":
293
+ case "binary":
294
+ return r;
295
+ case "utf8":
296
+ case "utf-8":
297
+ return ot(e).length;
298
+ case "ucs2":
299
+ case "ucs-2":
300
+ case "utf16le":
301
+ case "utf-16le":
302
+ return r * 2;
303
+ case "hex":
304
+ return r >>> 1;
305
+ case "base64":
306
+ return bt(e).length;
307
+ default:
308
+ if (n)
309
+ return i ? -1 : ot(e).length;
310
+ t = ("" + t).toLowerCase(), n = !0;
311
+ }
312
+ }
313
+ o.byteLength = W;
314
+ function Ot(e, t, r) {
315
+ let i = !1;
316
+ if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, t >>>= 0, r <= t))
317
+ return "";
318
+ for (e || (e = "utf8"); ; )
319
+ switch (e) {
320
+ case "hex":
321
+ return Jt(this, t, r);
322
+ case "utf8":
323
+ case "utf-8":
324
+ return wt(this, t, r);
325
+ case "ascii":
326
+ return qt(this, t, r);
327
+ case "latin1":
328
+ case "binary":
329
+ return Xt(this, t, r);
330
+ case "base64":
331
+ return Kt(this, t, r);
332
+ case "ucs2":
333
+ case "ucs-2":
334
+ case "utf16le":
335
+ case "utf-16le":
336
+ return Zt(this, t, r);
337
+ default:
338
+ if (i) throw new TypeError("Unknown encoding: " + e);
339
+ e = (e + "").toLowerCase(), i = !0;
340
+ }
341
+ }
342
+ o.prototype._isBuffer = !0;
343
+ function H(e, t, r) {
344
+ const i = e[t];
345
+ e[t] = e[r], e[r] = i;
346
+ }
347
+ o.prototype.swap16 = function() {
348
+ const t = this.length;
349
+ if (t % 2 !== 0)
350
+ throw new RangeError("Buffer size must be a multiple of 16-bits");
351
+ for (let r = 0; r < t; r += 2)
352
+ H(this, r, r + 1);
353
+ return this;
354
+ }, o.prototype.swap32 = function() {
355
+ const t = this.length;
356
+ if (t % 4 !== 0)
357
+ throw new RangeError("Buffer size must be a multiple of 32-bits");
358
+ for (let r = 0; r < t; r += 4)
359
+ H(this, r, r + 3), H(this, r + 1, r + 2);
360
+ return this;
361
+ }, o.prototype.swap64 = function() {
362
+ const t = this.length;
363
+ if (t % 8 !== 0)
364
+ throw new RangeError("Buffer size must be a multiple of 64-bits");
365
+ for (let r = 0; r < t; r += 8)
366
+ H(this, r, r + 7), H(this, r + 1, r + 6), H(this, r + 2, r + 5), H(this, r + 3, r + 4);
367
+ return this;
368
+ }, o.prototype.toString = function() {
369
+ const t = this.length;
370
+ return t === 0 ? "" : arguments.length === 0 ? wt(this, 0, t) : Ot.apply(this, arguments);
371
+ }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(t) {
372
+ if (!o.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
373
+ return this === t ? !0 : o.compare(this, t) === 0;
374
+ }, o.prototype.inspect = function() {
375
+ let t = "";
376
+ const r = c.INSPECT_MAX_BYTES;
377
+ return t = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (t += " ... "), "<Buffer " + t + ">";
378
+ }, f && (o.prototype[f] = o.prototype.inspect), o.prototype.compare = function(t, r, i, n, s) {
379
+ if (k(t, a) && (t = o.from(t, t.offset, t.byteLength)), !o.isBuffer(t))
380
+ throw new TypeError(
381
+ 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
382
+ );
383
+ if (r === void 0 && (r = 0), i === void 0 && (i = t ? t.length : 0), n === void 0 && (n = 0), s === void 0 && (s = this.length), r < 0 || i > t.length || n < 0 || s > this.length)
384
+ throw new RangeError("out of range index");
385
+ if (n >= s && r >= i)
386
+ return 0;
387
+ if (n >= s)
388
+ return -1;
389
+ if (r >= i)
390
+ return 1;
391
+ if (r >>>= 0, i >>>= 0, n >>>= 0, s >>>= 0, this === t) return 0;
392
+ let u = s - n, E = i - r;
393
+ const A = Math.min(u, E), x = this.slice(n, s), b = t.slice(r, i);
394
+ for (let I = 0; I < A; ++I)
395
+ if (x[I] !== b[I]) {
396
+ u = x[I], E = b[I];
397
+ break;
398
+ }
399
+ return u < E ? -1 : E < u ? 1 : 0;
400
+ };
401
+ function lt(e, t, r, i, n) {
402
+ if (e.length === 0) return -1;
403
+ if (typeof r == "string" ? (i = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, st(r) && (r = n ? 0 : e.length - 1), r < 0 && (r = e.length + r), r >= e.length) {
404
+ if (n) return -1;
405
+ r = e.length - 1;
406
+ } else if (r < 0)
407
+ if (n) r = 0;
408
+ else return -1;
409
+ if (typeof t == "string" && (t = o.from(t, i)), o.isBuffer(t))
410
+ return t.length === 0 ? -1 : yt(e, t, r, i, n);
411
+ if (typeof t == "number")
412
+ return t = t & 255, typeof a.prototype.indexOf == "function" ? n ? a.prototype.indexOf.call(e, t, r) : a.prototype.lastIndexOf.call(e, t, r) : yt(e, [t], r, i, n);
413
+ throw new TypeError("val must be string, number or Buffer");
414
+ }
415
+ function yt(e, t, r, i, n) {
416
+ let s = 1, u = e.length, E = t.length;
417
+ if (i !== void 0 && (i = String(i).toLowerCase(), i === "ucs2" || i === "ucs-2" || i === "utf16le" || i === "utf-16le")) {
418
+ if (e.length < 2 || t.length < 2)
419
+ return -1;
420
+ s = 2, u /= 2, E /= 2, r /= 2;
421
+ }
422
+ function A(b, I) {
423
+ return s === 1 ? b[I] : b.readUInt16BE(I * s);
424
+ }
425
+ let x;
426
+ if (n) {
427
+ let b = -1;
428
+ for (x = r; x < u; x++)
429
+ if (A(e, x) === A(t, b === -1 ? 0 : x - b)) {
430
+ if (b === -1 && (b = x), x - b + 1 === E) return b * s;
431
+ } else
432
+ b !== -1 && (x -= x - b), b = -1;
433
+ } else
434
+ for (r + E > u && (r = u - E), x = r; x >= 0; x--) {
435
+ let b = !0;
436
+ for (let I = 0; I < E; I++)
437
+ if (A(e, x + I) !== A(t, I)) {
438
+ b = !1;
439
+ break;
440
+ }
441
+ if (b) return x;
442
+ }
443
+ return -1;
444
+ }
445
+ o.prototype.includes = function(t, r, i) {
446
+ return this.indexOf(t, r, i) !== -1;
447
+ }, o.prototype.indexOf = function(t, r, i) {
448
+ return lt(this, t, r, i, !0);
449
+ }, o.prototype.lastIndexOf = function(t, r, i) {
450
+ return lt(this, t, r, i, !1);
451
+ };
452
+ function Ht(e, t, r, i) {
453
+ r = Number(r) || 0;
454
+ const n = e.length - r;
455
+ i ? (i = Number(i), i > n && (i = n)) : i = n;
456
+ const s = t.length;
457
+ i > s / 2 && (i = s / 2);
458
+ let u;
459
+ for (u = 0; u < i; ++u) {
460
+ const E = parseInt(t.substr(u * 2, 2), 16);
461
+ if (st(E)) return u;
462
+ e[r + u] = E;
463
+ }
464
+ return u;
465
+ }
466
+ function Gt(e, t, r, i) {
467
+ return z(ot(t, e.length - r), e, r, i);
468
+ }
469
+ function jt(e, t, r, i) {
470
+ return z(tr(t), e, r, i);
471
+ }
472
+ function Wt(e, t, r, i) {
473
+ return z(bt(t), e, r, i);
474
+ }
475
+ function Vt(e, t, r, i) {
476
+ return z(rr(t, e.length - r), e, r, i);
477
+ }
478
+ o.prototype.write = function(t, r, i, n) {
479
+ if (r === void 0)
480
+ n = "utf8", i = this.length, r = 0;
481
+ else if (i === void 0 && typeof r == "string")
482
+ n = r, i = this.length, r = 0;
483
+ else if (isFinite(r))
484
+ r = r >>> 0, isFinite(i) ? (i = i >>> 0, n === void 0 && (n = "utf8")) : (n = i, i = void 0);
485
+ else
486
+ throw new Error(
487
+ "Buffer.write(string, encoding, offset[, length]) is no longer supported"
488
+ );
489
+ const s = this.length - r;
490
+ if ((i === void 0 || i > s) && (i = s), t.length > 0 && (i < 0 || r < 0) || r > this.length)
491
+ throw new RangeError("Attempt to write outside buffer bounds");
492
+ n || (n = "utf8");
493
+ let u = !1;
494
+ for (; ; )
495
+ switch (n) {
496
+ case "hex":
497
+ return Ht(this, t, r, i);
498
+ case "utf8":
499
+ case "utf-8":
500
+ return Gt(this, t, r, i);
501
+ case "ascii":
502
+ case "latin1":
503
+ case "binary":
504
+ return jt(this, t, r, i);
505
+ case "base64":
506
+ return Wt(this, t, r, i);
507
+ case "ucs2":
508
+ case "ucs-2":
509
+ case "utf16le":
510
+ case "utf-16le":
511
+ return Vt(this, t, r, i);
512
+ default:
513
+ if (u) throw new TypeError("Unknown encoding: " + n);
514
+ n = ("" + n).toLowerCase(), u = !0;
515
+ }
516
+ }, o.prototype.toJSON = function() {
517
+ return {
518
+ type: "Buffer",
519
+ data: Array.prototype.slice.call(this._arr || this, 0)
520
+ };
521
+ };
522
+ function Kt(e, t, r) {
523
+ return t === 0 && r === e.length ? h.fromByteArray(e) : h.fromByteArray(e.slice(t, r));
524
+ }
525
+ function wt(e, t, r) {
526
+ r = Math.min(e.length, r);
527
+ const i = [];
528
+ let n = t;
529
+ for (; n < r; ) {
530
+ const s = e[n];
531
+ let u = null, E = s > 239 ? 4 : s > 223 ? 3 : s > 191 ? 2 : 1;
532
+ if (n + E <= r) {
533
+ let A, x, b, I;
534
+ switch (E) {
535
+ case 1:
536
+ s < 128 && (u = s);
537
+ break;
538
+ case 2:
539
+ A = e[n + 1], (A & 192) === 128 && (I = (s & 31) << 6 | A & 63, I > 127 && (u = I));
540
+ break;
541
+ case 3:
542
+ A = e[n + 1], x = e[n + 2], (A & 192) === 128 && (x & 192) === 128 && (I = (s & 15) << 12 | (A & 63) << 6 | x & 63, I > 2047 && (I < 55296 || I > 57343) && (u = I));
543
+ break;
544
+ case 4:
545
+ A = e[n + 1], x = e[n + 2], b = e[n + 3], (A & 192) === 128 && (x & 192) === 128 && (b & 192) === 128 && (I = (s & 15) << 18 | (A & 63) << 12 | (x & 63) << 6 | b & 63, I > 65535 && I < 1114112 && (u = I));
546
+ }
547
+ }
548
+ u === null ? (u = 65533, E = 1) : u > 65535 && (u -= 65536, i.push(u >>> 10 & 1023 | 55296), u = 56320 | u & 1023), i.push(u), n += E;
549
+ }
550
+ return Yt(i);
551
+ }
552
+ const dt = 4096;
553
+ function Yt(e) {
554
+ const t = e.length;
555
+ if (t <= dt)
556
+ return String.fromCharCode.apply(String, e);
557
+ let r = "", i = 0;
558
+ for (; i < t; )
559
+ r += String.fromCharCode.apply(
560
+ String,
561
+ e.slice(i, i += dt)
562
+ );
563
+ return r;
564
+ }
565
+ function qt(e, t, r) {
566
+ let i = "";
567
+ r = Math.min(e.length, r);
568
+ for (let n = t; n < r; ++n)
569
+ i += String.fromCharCode(e[n] & 127);
570
+ return i;
571
+ }
572
+ function Xt(e, t, r) {
573
+ let i = "";
574
+ r = Math.min(e.length, r);
575
+ for (let n = t; n < r; ++n)
576
+ i += String.fromCharCode(e[n]);
577
+ return i;
578
+ }
579
+ function Jt(e, t, r) {
580
+ const i = e.length;
581
+ (!t || t < 0) && (t = 0), (!r || r < 0 || r > i) && (r = i);
582
+ let n = "";
583
+ for (let s = t; s < r; ++s)
584
+ n += er[e[s]];
585
+ return n;
586
+ }
587
+ function Zt(e, t, r) {
588
+ const i = e.slice(t, r);
589
+ let n = "";
590
+ for (let s = 0; s < i.length - 1; s += 2)
591
+ n += String.fromCharCode(i[s] + i[s + 1] * 256);
592
+ return n;
593
+ }
594
+ o.prototype.slice = function(t, r) {
595
+ const i = this.length;
596
+ t = ~~t, r = r === void 0 ? i : ~~r, t < 0 ? (t += i, t < 0 && (t = 0)) : t > i && (t = i), r < 0 ? (r += i, r < 0 && (r = 0)) : r > i && (r = i), r < t && (r = t);
597
+ const n = this.subarray(t, r);
598
+ return Object.setPrototypeOf(n, o.prototype), n;
599
+ };
600
+ function T(e, t, r) {
601
+ if (e % 1 !== 0 || e < 0) throw new RangeError("offset is not uint");
602
+ if (e + t > r) throw new RangeError("Trying to access beyond buffer length");
603
+ }
604
+ o.prototype.readUintLE = o.prototype.readUIntLE = function(t, r, i) {
605
+ t = t >>> 0, r = r >>> 0, i || T(t, r, this.length);
606
+ let n = this[t], s = 1, u = 0;
607
+ for (; ++u < r && (s *= 256); )
608
+ n += this[t + u] * s;
609
+ return n;
610
+ }, o.prototype.readUintBE = o.prototype.readUIntBE = function(t, r, i) {
611
+ t = t >>> 0, r = r >>> 0, i || T(t, r, this.length);
612
+ let n = this[t + --r], s = 1;
613
+ for (; r > 0 && (s *= 256); )
614
+ n += this[t + --r] * s;
615
+ return n;
616
+ }, o.prototype.readUint8 = o.prototype.readUInt8 = function(t, r) {
617
+ return t = t >>> 0, r || T(t, 1, this.length), this[t];
618
+ }, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(t, r) {
619
+ return t = t >>> 0, r || T(t, 2, this.length), this[t] | this[t + 1] << 8;
620
+ }, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(t, r) {
621
+ return t = t >>> 0, r || T(t, 2, this.length), this[t] << 8 | this[t + 1];
622
+ }, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(t, r) {
623
+ return t = t >>> 0, r || T(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
624
+ }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(t, r) {
625
+ return t = t >>> 0, r || T(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
626
+ }, o.prototype.readBigUInt64LE = D(function(t) {
627
+ t = t >>> 0, K(t, "offset");
628
+ const r = this[t], i = this[t + 7];
629
+ (r === void 0 || i === void 0) && Z(t, this.length - 8);
630
+ const n = r + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + this[++t] * 2 ** 24, s = this[++t] + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + i * 2 ** 24;
631
+ return BigInt(n) + (BigInt(s) << BigInt(32));
632
+ }), o.prototype.readBigUInt64BE = D(function(t) {
633
+ t = t >>> 0, K(t, "offset");
634
+ const r = this[t], i = this[t + 7];
635
+ (r === void 0 || i === void 0) && Z(t, this.length - 8);
636
+ const n = r * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + this[++t], s = this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + i;
637
+ return (BigInt(n) << BigInt(32)) + BigInt(s);
638
+ }), o.prototype.readIntLE = function(t, r, i) {
639
+ t = t >>> 0, r = r >>> 0, i || T(t, r, this.length);
640
+ let n = this[t], s = 1, u = 0;
641
+ for (; ++u < r && (s *= 256); )
642
+ n += this[t + u] * s;
643
+ return s *= 128, n >= s && (n -= Math.pow(2, 8 * r)), n;
644
+ }, o.prototype.readIntBE = function(t, r, i) {
645
+ t = t >>> 0, r = r >>> 0, i || T(t, r, this.length);
646
+ let n = r, s = 1, u = this[t + --n];
647
+ for (; n > 0 && (s *= 256); )
648
+ u += this[t + --n] * s;
649
+ return s *= 128, u >= s && (u -= Math.pow(2, 8 * r)), u;
650
+ }, o.prototype.readInt8 = function(t, r) {
651
+ return t = t >>> 0, r || T(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
652
+ }, o.prototype.readInt16LE = function(t, r) {
653
+ t = t >>> 0, r || T(t, 2, this.length);
654
+ const i = this[t] | this[t + 1] << 8;
655
+ return i & 32768 ? i | 4294901760 : i;
656
+ }, o.prototype.readInt16BE = function(t, r) {
657
+ t = t >>> 0, r || T(t, 2, this.length);
658
+ const i = this[t + 1] | this[t] << 8;
659
+ return i & 32768 ? i | 4294901760 : i;
660
+ }, o.prototype.readInt32LE = function(t, r) {
661
+ return t = t >>> 0, r || T(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
662
+ }, o.prototype.readInt32BE = function(t, r) {
663
+ return t = t >>> 0, r || T(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
664
+ }, o.prototype.readBigInt64LE = D(function(t) {
665
+ t = t >>> 0, K(t, "offset");
666
+ const r = this[t], i = this[t + 7];
667
+ (r === void 0 || i === void 0) && Z(t, this.length - 8);
668
+ const n = this[t + 4] + this[t + 5] * 2 ** 8 + this[t + 6] * 2 ** 16 + (i << 24);
669
+ return (BigInt(n) << BigInt(32)) + BigInt(r + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + this[++t] * 2 ** 24);
670
+ }), o.prototype.readBigInt64BE = D(function(t) {
671
+ t = t >>> 0, K(t, "offset");
672
+ const r = this[t], i = this[t + 7];
673
+ (r === void 0 || i === void 0) && Z(t, this.length - 8);
674
+ const n = (r << 24) + // Overflow
675
+ this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + this[++t];
676
+ return (BigInt(n) << BigInt(32)) + BigInt(this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + i);
677
+ }), o.prototype.readFloatLE = function(t, r) {
678
+ return t = t >>> 0, r || T(t, 4, this.length), p.read(this, t, !0, 23, 4);
679
+ }, o.prototype.readFloatBE = function(t, r) {
680
+ return t = t >>> 0, r || T(t, 4, this.length), p.read(this, t, !1, 23, 4);
681
+ }, o.prototype.readDoubleLE = function(t, r) {
682
+ return t = t >>> 0, r || T(t, 8, this.length), p.read(this, t, !0, 52, 8);
683
+ }, o.prototype.readDoubleBE = function(t, r) {
684
+ return t = t >>> 0, r || T(t, 8, this.length), p.read(this, t, !1, 52, 8);
685
+ };
686
+ function R(e, t, r, i, n, s) {
687
+ if (!o.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
688
+ if (t > n || t < s) throw new RangeError('"value" argument is out of bounds');
689
+ if (r + i > e.length) throw new RangeError("Index out of range");
690
+ }
691
+ o.prototype.writeUintLE = o.prototype.writeUIntLE = function(t, r, i, n) {
692
+ if (t = +t, r = r >>> 0, i = i >>> 0, !n) {
693
+ const E = Math.pow(2, 8 * i) - 1;
694
+ R(this, t, r, i, E, 0);
695
+ }
696
+ let s = 1, u = 0;
697
+ for (this[r] = t & 255; ++u < i && (s *= 256); )
698
+ this[r + u] = t / s & 255;
699
+ return r + i;
700
+ }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(t, r, i, n) {
701
+ if (t = +t, r = r >>> 0, i = i >>> 0, !n) {
702
+ const E = Math.pow(2, 8 * i) - 1;
703
+ R(this, t, r, i, E, 0);
704
+ }
705
+ let s = i - 1, u = 1;
706
+ for (this[r + s] = t & 255; --s >= 0 && (u *= 256); )
707
+ this[r + s] = t / u & 255;
708
+ return r + i;
709
+ }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(t, r, i) {
710
+ return t = +t, r = r >>> 0, i || R(this, t, r, 1, 255, 0), this[r] = t & 255, r + 1;
711
+ }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(t, r, i) {
712
+ return t = +t, r = r >>> 0, i || R(this, t, r, 2, 65535, 0), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
713
+ }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(t, r, i) {
714
+ return t = +t, r = r >>> 0, i || R(this, t, r, 2, 65535, 0), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
715
+ }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(t, r, i) {
716
+ return t = +t, r = r >>> 0, i || R(this, t, r, 4, 4294967295, 0), this[r + 3] = t >>> 24, this[r + 2] = t >>> 16, this[r + 1] = t >>> 8, this[r] = t & 255, r + 4;
717
+ }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(t, r, i) {
718
+ return t = +t, r = r >>> 0, i || R(this, t, r, 4, 4294967295, 0), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
719
+ };
720
+ function Bt(e, t, r, i, n) {
721
+ At(t, i, n, e, r, 7);
722
+ let s = Number(t & BigInt(4294967295));
723
+ e[r++] = s, s = s >> 8, e[r++] = s, s = s >> 8, e[r++] = s, s = s >> 8, e[r++] = s;
724
+ let u = Number(t >> BigInt(32) & BigInt(4294967295));
725
+ return e[r++] = u, u = u >> 8, e[r++] = u, u = u >> 8, e[r++] = u, u = u >> 8, e[r++] = u, r;
726
+ }
727
+ function gt(e, t, r, i, n) {
728
+ At(t, i, n, e, r, 7);
729
+ let s = Number(t & BigInt(4294967295));
730
+ e[r + 7] = s, s = s >> 8, e[r + 6] = s, s = s >> 8, e[r + 5] = s, s = s >> 8, e[r + 4] = s;
731
+ let u = Number(t >> BigInt(32) & BigInt(4294967295));
732
+ return e[r + 3] = u, u = u >> 8, e[r + 2] = u, u = u >> 8, e[r + 1] = u, u = u >> 8, e[r] = u, r + 8;
733
+ }
734
+ o.prototype.writeBigUInt64LE = D(function(t, r = 0) {
735
+ return Bt(this, t, r, BigInt(0), BigInt("0xffffffffffffffff"));
736
+ }), o.prototype.writeBigUInt64BE = D(function(t, r = 0) {
737
+ return gt(this, t, r, BigInt(0), BigInt("0xffffffffffffffff"));
738
+ }), o.prototype.writeIntLE = function(t, r, i, n) {
739
+ if (t = +t, r = r >>> 0, !n) {
740
+ const A = Math.pow(2, 8 * i - 1);
741
+ R(this, t, r, i, A - 1, -A);
742
+ }
743
+ let s = 0, u = 1, E = 0;
744
+ for (this[r] = t & 255; ++s < i && (u *= 256); )
745
+ t < 0 && E === 0 && this[r + s - 1] !== 0 && (E = 1), this[r + s] = (t / u >> 0) - E & 255;
746
+ return r + i;
747
+ }, o.prototype.writeIntBE = function(t, r, i, n) {
748
+ if (t = +t, r = r >>> 0, !n) {
749
+ const A = Math.pow(2, 8 * i - 1);
750
+ R(this, t, r, i, A - 1, -A);
751
+ }
752
+ let s = i - 1, u = 1, E = 0;
753
+ for (this[r + s] = t & 255; --s >= 0 && (u *= 256); )
754
+ t < 0 && E === 0 && this[r + s + 1] !== 0 && (E = 1), this[r + s] = (t / u >> 0) - E & 255;
755
+ return r + i;
756
+ }, o.prototype.writeInt8 = function(t, r, i) {
757
+ return t = +t, r = r >>> 0, i || R(this, t, r, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[r] = t & 255, r + 1;
758
+ }, o.prototype.writeInt16LE = function(t, r, i) {
759
+ return t = +t, r = r >>> 0, i || R(this, t, r, 2, 32767, -32768), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
760
+ }, o.prototype.writeInt16BE = function(t, r, i) {
761
+ return t = +t, r = r >>> 0, i || R(this, t, r, 2, 32767, -32768), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
762
+ }, o.prototype.writeInt32LE = function(t, r, i) {
763
+ return t = +t, r = r >>> 0, i || R(this, t, r, 4, 2147483647, -2147483648), this[r] = t & 255, this[r + 1] = t >>> 8, this[r + 2] = t >>> 16, this[r + 3] = t >>> 24, r + 4;
764
+ }, o.prototype.writeInt32BE = function(t, r, i) {
765
+ return t = +t, r = r >>> 0, i || R(this, t, r, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
766
+ }, o.prototype.writeBigInt64LE = D(function(t, r = 0) {
767
+ return Bt(this, t, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
768
+ }), o.prototype.writeBigInt64BE = D(function(t, r = 0) {
769
+ return gt(this, t, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
770
+ });
771
+ function Et(e, t, r, i, n, s) {
772
+ if (r + i > e.length) throw new RangeError("Index out of range");
773
+ if (r < 0) throw new RangeError("Index out of range");
774
+ }
775
+ function mt(e, t, r, i, n) {
776
+ return t = +t, r = r >>> 0, n || Et(e, t, r, 4), p.write(e, t, r, i, 23, 4), r + 4;
777
+ }
778
+ o.prototype.writeFloatLE = function(t, r, i) {
779
+ return mt(this, t, r, !0, i);
780
+ }, o.prototype.writeFloatBE = function(t, r, i) {
781
+ return mt(this, t, r, !1, i);
782
+ };
783
+ function It(e, t, r, i, n) {
784
+ return t = +t, r = r >>> 0, n || Et(e, t, r, 8), p.write(e, t, r, i, 52, 8), r + 8;
785
+ }
786
+ o.prototype.writeDoubleLE = function(t, r, i) {
787
+ return It(this, t, r, !0, i);
788
+ }, o.prototype.writeDoubleBE = function(t, r, i) {
789
+ return It(this, t, r, !1, i);
790
+ }, o.prototype.copy = function(t, r, i, n) {
791
+ if (!o.isBuffer(t)) throw new TypeError("argument should be a Buffer");
792
+ if (i || (i = 0), !n && n !== 0 && (n = this.length), r >= t.length && (r = t.length), r || (r = 0), n > 0 && n < i && (n = i), n === i || t.length === 0 || this.length === 0) return 0;
793
+ if (r < 0)
794
+ throw new RangeError("targetStart out of bounds");
795
+ if (i < 0 || i >= this.length) throw new RangeError("Index out of range");
796
+ if (n < 0) throw new RangeError("sourceEnd out of bounds");
797
+ n > this.length && (n = this.length), t.length - r < n - i && (n = t.length - r + i);
798
+ const s = n - i;
799
+ return this === t && typeof a.prototype.copyWithin == "function" ? this.copyWithin(r, i, n) : a.prototype.set.call(
800
+ t,
801
+ this.subarray(i, n),
802
+ r
803
+ ), s;
804
+ }, o.prototype.fill = function(t, r, i, n) {
805
+ if (typeof t == "string") {
806
+ if (typeof r == "string" ? (n = r, r = 0, i = this.length) : typeof i == "string" && (n = i, i = this.length), n !== void 0 && typeof n != "string")
807
+ throw new TypeError("encoding must be a string");
808
+ if (typeof n == "string" && !o.isEncoding(n))
809
+ throw new TypeError("Unknown encoding: " + n);
810
+ if (t.length === 1) {
811
+ const u = t.charCodeAt(0);
812
+ (n === "utf8" && u < 128 || n === "latin1") && (t = u);
813
+ }
814
+ } else typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
815
+ if (r < 0 || this.length < r || this.length < i)
816
+ throw new RangeError("Out of range index");
817
+ if (i <= r)
818
+ return this;
819
+ r = r >>> 0, i = i === void 0 ? this.length : i >>> 0, t || (t = 0);
820
+ let s;
821
+ if (typeof t == "number")
822
+ for (s = r; s < i; ++s)
823
+ this[s] = t;
824
+ else {
825
+ const u = o.isBuffer(t) ? t : o.from(t, n), E = u.length;
826
+ if (E === 0)
827
+ throw new TypeError('The value "' + t + '" is invalid for argument "value"');
828
+ for (s = 0; s < i - r; ++s)
829
+ this[s + r] = u[s % E];
830
+ }
831
+ return this;
832
+ };
833
+ const V = {};
834
+ function nt(e, t, r) {
835
+ V[e] = class extends r {
836
+ constructor() {
837
+ super(), Object.defineProperty(this, "message", {
838
+ value: t.apply(this, arguments),
839
+ writable: !0,
840
+ configurable: !0
841
+ }), this.name = `${this.name} [${e}]`, this.stack, delete this.name;
842
+ }
843
+ get code() {
844
+ return e;
845
+ }
846
+ set code(n) {
847
+ Object.defineProperty(this, "code", {
848
+ configurable: !0,
849
+ enumerable: !0,
850
+ value: n,
851
+ writable: !0
852
+ });
853
+ }
854
+ toString() {
855
+ return `${this.name} [${e}]: ${this.message}`;
856
+ }
857
+ };
858
+ }
859
+ nt(
860
+ "ERR_BUFFER_OUT_OF_BOUNDS",
861
+ function(e) {
862
+ return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
863
+ },
864
+ RangeError
865
+ ), nt(
866
+ "ERR_INVALID_ARG_TYPE",
867
+ function(e, t) {
868
+ return `The "${e}" argument must be of type number. Received type ${typeof t}`;
869
+ },
870
+ TypeError
871
+ ), nt(
872
+ "ERR_OUT_OF_RANGE",
873
+ function(e, t, r) {
874
+ let i = `The value of "${e}" is out of range.`, n = r;
875
+ return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? n = xt(String(r)) : typeof r == "bigint" && (n = String(r), (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) && (n = xt(n)), n += "n"), i += ` It must be ${t}. Received ${n}`, i;
876
+ },
877
+ RangeError
878
+ );
879
+ function xt(e) {
880
+ let t = "", r = e.length;
881
+ const i = e[0] === "-" ? 1 : 0;
882
+ for (; r >= i + 4; r -= 3)
883
+ t = `_${e.slice(r - 3, r)}${t}`;
884
+ return `${e.slice(0, r)}${t}`;
885
+ }
886
+ function Qt(e, t, r) {
887
+ K(t, "offset"), (e[t] === void 0 || e[t + r] === void 0) && Z(t, e.length - (r + 1));
888
+ }
889
+ function At(e, t, r, i, n, s) {
890
+ if (e > r || e < t) {
891
+ const u = typeof t == "bigint" ? "n" : "";
892
+ let E;
893
+ throw t === 0 || t === BigInt(0) ? E = `>= 0${u} and < 2${u} ** ${(s + 1) * 8}${u}` : E = `>= -(2${u} ** ${(s + 1) * 8 - 1}${u}) and < 2 ** ${(s + 1) * 8 - 1}${u}`, new V.ERR_OUT_OF_RANGE("value", E, e);
894
+ }
895
+ Qt(i, n, s);
896
+ }
897
+ function K(e, t) {
898
+ if (typeof e != "number")
899
+ throw new V.ERR_INVALID_ARG_TYPE(t, "number", e);
900
+ }
901
+ function Z(e, t, r) {
902
+ throw Math.floor(e) !== e ? (K(e, r), new V.ERR_OUT_OF_RANGE("offset", "an integer", e)) : t < 0 ? new V.ERR_BUFFER_OUT_OF_BOUNDS() : new V.ERR_OUT_OF_RANGE(
903
+ "offset",
904
+ `>= 0 and <= ${t}`,
905
+ e
906
+ );
907
+ }
908
+ const zt = /[^+/0-9A-Za-z-_]/g;
909
+ function vt(e) {
910
+ if (e = e.split("=")[0], e = e.trim().replace(zt, ""), e.length < 2) return "";
911
+ for (; e.length % 4 !== 0; )
912
+ e = e + "=";
913
+ return e;
914
+ }
915
+ function ot(e, t) {
916
+ t = t || 1 / 0;
917
+ let r;
918
+ const i = e.length;
919
+ let n = null;
920
+ const s = [];
921
+ for (let u = 0; u < i; ++u) {
922
+ if (r = e.charCodeAt(u), r > 55295 && r < 57344) {
923
+ if (!n) {
924
+ if (r > 56319) {
925
+ (t -= 3) > -1 && s.push(239, 191, 189);
926
+ continue;
927
+ } else if (u + 1 === i) {
928
+ (t -= 3) > -1 && s.push(239, 191, 189);
929
+ continue;
930
+ }
931
+ n = r;
932
+ continue;
933
+ }
934
+ if (r < 56320) {
935
+ (t -= 3) > -1 && s.push(239, 191, 189), n = r;
936
+ continue;
937
+ }
938
+ r = (n - 55296 << 10 | r - 56320) + 65536;
939
+ } else n && (t -= 3) > -1 && s.push(239, 191, 189);
940
+ if (n = null, r < 128) {
941
+ if ((t -= 1) < 0) break;
942
+ s.push(r);
943
+ } else if (r < 2048) {
944
+ if ((t -= 2) < 0) break;
945
+ s.push(
946
+ r >> 6 | 192,
947
+ r & 63 | 128
948
+ );
949
+ } else if (r < 65536) {
950
+ if ((t -= 3) < 0) break;
951
+ s.push(
952
+ r >> 12 | 224,
953
+ r >> 6 & 63 | 128,
954
+ r & 63 | 128
955
+ );
956
+ } else if (r < 1114112) {
957
+ if ((t -= 4) < 0) break;
958
+ s.push(
959
+ r >> 18 | 240,
960
+ r >> 12 & 63 | 128,
961
+ r >> 6 & 63 | 128,
962
+ r & 63 | 128
963
+ );
964
+ } else
965
+ throw new Error("Invalid code point");
966
+ }
967
+ return s;
968
+ }
969
+ function tr(e) {
970
+ const t = [];
971
+ for (let r = 0; r < e.length; ++r)
972
+ t.push(e.charCodeAt(r) & 255);
973
+ return t;
974
+ }
975
+ function rr(e, t) {
976
+ let r, i, n;
977
+ const s = [];
978
+ for (let u = 0; u < e.length && !((t -= 2) < 0); ++u)
979
+ r = e.charCodeAt(u), i = r >> 8, n = r % 256, s.push(n), s.push(i);
980
+ return s;
981
+ }
982
+ function bt(e) {
983
+ return h.toByteArray(vt(e));
984
+ }
985
+ function z(e, t, r, i) {
986
+ let n;
987
+ for (n = 0; n < i && !(n + r >= t.length || n >= e.length); ++n)
988
+ t[n + r] = e[n];
989
+ return n;
990
+ }
991
+ function k(e, t) {
992
+ return e instanceof t || e != null && e.constructor != null && e.constructor.name != null && e.constructor.name === t.name;
993
+ }
994
+ function st(e) {
995
+ return e !== e;
996
+ }
997
+ const er = (function() {
998
+ const e = "0123456789abcdef", t = new Array(256);
999
+ for (let r = 0; r < 16; ++r) {
1000
+ const i = r * 16;
1001
+ for (let n = 0; n < 16; ++n)
1002
+ t[i + n] = e[r] + e[n];
1003
+ }
1004
+ return t;
1005
+ })();
1006
+ function D(e) {
1007
+ return typeof BigInt > "u" ? ir : e;
1008
+ }
1009
+ function ir() {
1010
+ throw new Error("BigInt not supported");
1011
+ }
1012
+ })(ut);
1013
+ const L = ut.Buffer, Nr = ut.Buffer;
1014
+ function Pr(c) {
1015
+ return c && c.__esModule && Object.prototype.hasOwnProperty.call(c, "default") ? c.default : c;
1016
+ }
1017
+ function fr(c) {
1018
+ return c instanceof Uint8Array || ArrayBuffer.isView(c) && c.constructor.name === "Uint8Array";
1019
+ }
1020
+ function Rt(c, h, p = "") {
1021
+ const f = fr(c), y = c?.length;
1022
+ if (!f || h !== void 0) {
1023
+ const l = p && `"${p}" `, d = "", w = f ? `length=${y}` : `type=${typeof c}`;
1024
+ throw new Error(l + "expected Uint8Array" + d + ", got " + w);
1025
+ }
1026
+ return c;
1027
+ }
1028
+ function Ut(c, h = !0) {
1029
+ if (c.destroyed)
1030
+ throw new Error("Hash instance has been destroyed");
1031
+ if (h && c.finished)
1032
+ throw new Error("Hash#digest() has already been called");
1033
+ }
1034
+ function lr(c, h) {
1035
+ Rt(c, void 0, "digestInto() output");
1036
+ const p = h.outputLen;
1037
+ if (c.length < p)
1038
+ throw new Error('"digestInto() output" expected to be of length >=' + p);
1039
+ }
1040
+ function j(...c) {
1041
+ for (let h = 0; h < c.length; h++)
1042
+ c[h].fill(0);
1043
+ }
1044
+ function ct(c) {
1045
+ return new DataView(c.buffer, c.byteOffset, c.byteLength);
1046
+ }
1047
+ function M(c, h) {
1048
+ return c << 32 - h | c >>> h;
1049
+ }
1050
+ function G(c, h) {
1051
+ return c << h | c >>> 32 - h >>> 0;
1052
+ }
1053
+ function pt(c, h = {}) {
1054
+ const p = (y, a) => c(a).update(y).digest(), f = c(void 0);
1055
+ return p.outputLen = f.outputLen, p.blockLen = f.blockLen, p.create = (y) => c(y), Object.assign(p, h), Object.freeze(p);
1056
+ }
1057
+ const yr = (c) => ({
1058
+ oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, c])
1059
+ });
1060
+ function _t(c, h, p) {
1061
+ return c & h ^ ~c & p;
1062
+ }
1063
+ function St(c, h, p) {
1064
+ return c & h ^ c & p ^ h & p;
1065
+ }
1066
+ class ft {
1067
+ blockLen;
1068
+ outputLen;
1069
+ padOffset;
1070
+ isLE;
1071
+ // For partial updates less than block size
1072
+ buffer;
1073
+ view;
1074
+ finished = !1;
1075
+ length = 0;
1076
+ pos = 0;
1077
+ destroyed = !1;
1078
+ constructor(h, p, f, y) {
1079
+ this.blockLen = h, this.outputLen = p, this.padOffset = f, this.isLE = y, this.buffer = new Uint8Array(h), this.view = ct(this.buffer);
1080
+ }
1081
+ update(h) {
1082
+ Ut(this), Rt(h);
1083
+ const { view: p, buffer: f, blockLen: y } = this, a = h.length;
1084
+ for (let l = 0; l < a; ) {
1085
+ const d = Math.min(y - this.pos, a - l);
1086
+ if (d === y) {
1087
+ const w = ct(h);
1088
+ for (; y <= a - l; l += y)
1089
+ this.process(w, l);
1090
+ continue;
1091
+ }
1092
+ f.set(h.subarray(l, l + d), this.pos), this.pos += d, l += d, this.pos === y && (this.process(p, 0), this.pos = 0);
1093
+ }
1094
+ return this.length += h.length, this.roundClean(), this;
1095
+ }
1096
+ digestInto(h) {
1097
+ Ut(this), lr(h, this), this.finished = !0;
1098
+ const { buffer: p, view: f, blockLen: y, isLE: a } = this;
1099
+ let { pos: l } = this;
1100
+ p[l++] = 128, j(this.buffer.subarray(l)), this.padOffset > y - l && (this.process(f, 0), l = 0);
1101
+ for (let B = l; B < y; B++)
1102
+ p[B] = 0;
1103
+ f.setBigUint64(y - 8, BigInt(this.length * 8), a), this.process(f, 0);
1104
+ const d = ct(h), w = this.outputLen;
1105
+ if (w % 4)
1106
+ throw new Error("_sha2: outputLen must be aligned to 32bit");
1107
+ const g = w / 4, o = this.get();
1108
+ if (g > o.length)
1109
+ throw new Error("_sha2: outputLen bigger than state");
1110
+ for (let B = 0; B < g; B++)
1111
+ d.setUint32(4 * B, o[B], a);
1112
+ }
1113
+ digest() {
1114
+ const { buffer: h, outputLen: p } = this;
1115
+ this.digestInto(h);
1116
+ const f = h.slice(0, p);
1117
+ return this.destroy(), f;
1118
+ }
1119
+ _cloneInto(h) {
1120
+ h ||= new this.constructor(), h.set(...this.get());
1121
+ const { blockLen: p, buffer: f, length: y, finished: a, destroyed: l, pos: d } = this;
1122
+ return h.destroyed = l, h.finished = a, h.length = y, h.pos = d, y % p && h.buffer.set(f), h;
1123
+ }
1124
+ clone() {
1125
+ return this._cloneInto();
1126
+ }
1127
+ }
1128
+ const F = /* @__PURE__ */ Uint32Array.from([
1129
+ 1779033703,
1130
+ 3144134277,
1131
+ 1013904242,
1132
+ 2773480762,
1133
+ 1359893119,
1134
+ 2600822924,
1135
+ 528734635,
1136
+ 1541459225
1137
+ ]), Q = /* @__PURE__ */ Uint32Array.from([
1138
+ 1732584193,
1139
+ 4023233417,
1140
+ 2562383102,
1141
+ 271733878,
1142
+ 3285377520
1143
+ ]), $ = /* @__PURE__ */ new Uint32Array(80);
1144
+ class wr extends ft {
1145
+ A = Q[0] | 0;
1146
+ B = Q[1] | 0;
1147
+ C = Q[2] | 0;
1148
+ D = Q[3] | 0;
1149
+ E = Q[4] | 0;
1150
+ constructor() {
1151
+ super(64, 20, 8, !1);
1152
+ }
1153
+ get() {
1154
+ const { A: h, B: p, C: f, D: y, E: a } = this;
1155
+ return [h, p, f, y, a];
1156
+ }
1157
+ set(h, p, f, y, a) {
1158
+ this.A = h | 0, this.B = p | 0, this.C = f | 0, this.D = y | 0, this.E = a | 0;
1159
+ }
1160
+ process(h, p) {
1161
+ for (let w = 0; w < 16; w++, p += 4)
1162
+ $[w] = h.getUint32(p, !1);
1163
+ for (let w = 16; w < 80; w++)
1164
+ $[w] = G($[w - 3] ^ $[w - 8] ^ $[w - 14] ^ $[w - 16], 1);
1165
+ let { A: f, B: y, C: a, D: l, E: d } = this;
1166
+ for (let w = 0; w < 80; w++) {
1167
+ let g, o;
1168
+ w < 20 ? (g = _t(y, a, l), o = 1518500249) : w < 40 ? (g = y ^ a ^ l, o = 1859775393) : w < 60 ? (g = St(y, a, l), o = 2400959708) : (g = y ^ a ^ l, o = 3395469782);
1169
+ const B = G(f, 5) + g + d + o + $[w] | 0;
1170
+ d = l, l = a, a = G(y, 30), y = f, f = B;
1171
+ }
1172
+ f = f + this.A | 0, y = y + this.B | 0, a = a + this.C | 0, l = l + this.D | 0, d = d + this.E | 0, this.set(f, y, a, l, d);
1173
+ }
1174
+ roundClean() {
1175
+ j($);
1176
+ }
1177
+ destroy() {
1178
+ this.set(0, 0, 0, 0, 0), j(this.buffer);
1179
+ }
1180
+ }
1181
+ const dr = /* @__PURE__ */ pt(() => new wr()), Br = /* @__PURE__ */ Uint8Array.from([
1182
+ 7,
1183
+ 4,
1184
+ 13,
1185
+ 1,
1186
+ 10,
1187
+ 6,
1188
+ 15,
1189
+ 3,
1190
+ 12,
1191
+ 0,
1192
+ 9,
1193
+ 5,
1194
+ 2,
1195
+ 14,
1196
+ 11,
1197
+ 8
1198
+ ]), Ct = Uint8Array.from(new Array(16).fill(0).map((c, h) => h)), gr = Ct.map((c) => (9 * c + 5) % 16), kt = /* @__PURE__ */ (() => {
1199
+ const p = [[Ct], [gr]];
1200
+ for (let f = 0; f < 4; f++)
1201
+ for (let y of p)
1202
+ y.push(y[f].map((a) => Br[a]));
1203
+ return p;
1204
+ })(), Mt = kt[0], Nt = kt[1], Pt = /* @__PURE__ */ [
1205
+ [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
1206
+ [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
1207
+ [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
1208
+ [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
1209
+ [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
1210
+ ].map((c) => Uint8Array.from(c)), Er = /* @__PURE__ */ Mt.map((c, h) => c.map((p) => Pt[h][p])), mr = /* @__PURE__ */ Nt.map((c, h) => c.map((p) => Pt[h][p])), Ir = /* @__PURE__ */ Uint32Array.from([
1211
+ 0,
1212
+ 1518500249,
1213
+ 1859775393,
1214
+ 2400959708,
1215
+ 2840853838
1216
+ ]), xr = /* @__PURE__ */ Uint32Array.from([
1217
+ 1352829926,
1218
+ 1548603684,
1219
+ 1836072691,
1220
+ 2053994217,
1221
+ 0
1222
+ ]);
1223
+ function Tt(c, h, p, f) {
1224
+ return c === 0 ? h ^ p ^ f : c === 1 ? h & p | ~h & f : c === 2 ? (h | ~p) ^ f : c === 3 ? h & f | p & ~f : h ^ (p | ~f);
1225
+ }
1226
+ const v = /* @__PURE__ */ new Uint32Array(16);
1227
+ class Ar extends ft {
1228
+ h0 = 1732584193;
1229
+ h1 = -271733879;
1230
+ h2 = -1732584194;
1231
+ h3 = 271733878;
1232
+ h4 = -1009589776;
1233
+ constructor() {
1234
+ super(64, 20, 8, !0);
1235
+ }
1236
+ get() {
1237
+ const { h0: h, h1: p, h2: f, h3: y, h4: a } = this;
1238
+ return [h, p, f, y, a];
1239
+ }
1240
+ set(h, p, f, y, a) {
1241
+ this.h0 = h | 0, this.h1 = p | 0, this.h2 = f | 0, this.h3 = y | 0, this.h4 = a | 0;
1242
+ }
1243
+ process(h, p) {
1244
+ for (let m = 0; m < 16; m++, p += 4)
1245
+ v[m] = h.getUint32(p, !0);
1246
+ let f = this.h0 | 0, y = f, a = this.h1 | 0, l = a, d = this.h2 | 0, w = d, g = this.h3 | 0, o = g, B = this.h4 | 0, U = B;
1247
+ for (let m = 0; m < 5; m++) {
1248
+ const _ = 4 - m, P = Ir[m], q = xr[m], et = Mt[m], X = Nt[m], it = Er[m], J = mr[m];
1249
+ for (let C = 0; C < 16; C++) {
1250
+ const W = G(f + Tt(m, a, d, g) + v[et[C]] + P, it[C]) + B | 0;
1251
+ f = B, B = g, g = G(d, 10) | 0, d = a, a = W;
1252
+ }
1253
+ for (let C = 0; C < 16; C++) {
1254
+ const W = G(y + Tt(_, l, w, o) + v[X[C]] + q, J[C]) + U | 0;
1255
+ y = U, U = o, o = G(w, 10) | 0, w = l, l = W;
1256
+ }
1257
+ }
1258
+ this.set(this.h1 + d + o | 0, this.h2 + g + U | 0, this.h3 + B + y | 0, this.h4 + f + l | 0, this.h0 + a + w | 0);
1259
+ }
1260
+ roundClean() {
1261
+ j(v);
1262
+ }
1263
+ destroy() {
1264
+ this.destroyed = !0, j(this.buffer), this.set(0, 0, 0, 0, 0);
1265
+ }
1266
+ }
1267
+ const Dt = /* @__PURE__ */ pt(() => new Ar()), br = /* @__PURE__ */ Uint32Array.from([
1268
+ 1116352408,
1269
+ 1899447441,
1270
+ 3049323471,
1271
+ 3921009573,
1272
+ 961987163,
1273
+ 1508970993,
1274
+ 2453635748,
1275
+ 2870763221,
1276
+ 3624381080,
1277
+ 310598401,
1278
+ 607225278,
1279
+ 1426881987,
1280
+ 1925078388,
1281
+ 2162078206,
1282
+ 2614888103,
1283
+ 3248222580,
1284
+ 3835390401,
1285
+ 4022224774,
1286
+ 264347078,
1287
+ 604807628,
1288
+ 770255983,
1289
+ 1249150122,
1290
+ 1555081692,
1291
+ 1996064986,
1292
+ 2554220882,
1293
+ 2821834349,
1294
+ 2952996808,
1295
+ 3210313671,
1296
+ 3336571891,
1297
+ 3584528711,
1298
+ 113926993,
1299
+ 338241895,
1300
+ 666307205,
1301
+ 773529912,
1302
+ 1294757372,
1303
+ 1396182291,
1304
+ 1695183700,
1305
+ 1986661051,
1306
+ 2177026350,
1307
+ 2456956037,
1308
+ 2730485921,
1309
+ 2820302411,
1310
+ 3259730800,
1311
+ 3345764771,
1312
+ 3516065817,
1313
+ 3600352804,
1314
+ 4094571909,
1315
+ 275423344,
1316
+ 430227734,
1317
+ 506948616,
1318
+ 659060556,
1319
+ 883997877,
1320
+ 958139571,
1321
+ 1322822218,
1322
+ 1537002063,
1323
+ 1747873779,
1324
+ 1955562222,
1325
+ 2024104815,
1326
+ 2227730452,
1327
+ 2361852424,
1328
+ 2428436474,
1329
+ 2756734187,
1330
+ 3204031479,
1331
+ 3329325298
1332
+ ]), O = /* @__PURE__ */ new Uint32Array(64);
1333
+ class Ur extends ft {
1334
+ constructor(h) {
1335
+ super(64, h, 8, !1);
1336
+ }
1337
+ get() {
1338
+ const { A: h, B: p, C: f, D: y, E: a, F: l, G: d, H: w } = this;
1339
+ return [h, p, f, y, a, l, d, w];
1340
+ }
1341
+ // prettier-ignore
1342
+ set(h, p, f, y, a, l, d, w) {
1343
+ this.A = h | 0, this.B = p | 0, this.C = f | 0, this.D = y | 0, this.E = a | 0, this.F = l | 0, this.G = d | 0, this.H = w | 0;
1344
+ }
1345
+ process(h, p) {
1346
+ for (let B = 0; B < 16; B++, p += 4)
1347
+ O[B] = h.getUint32(p, !1);
1348
+ for (let B = 16; B < 64; B++) {
1349
+ const U = O[B - 15], m = O[B - 2], _ = M(U, 7) ^ M(U, 18) ^ U >>> 3, P = M(m, 17) ^ M(m, 19) ^ m >>> 10;
1350
+ O[B] = P + O[B - 7] + _ + O[B - 16] | 0;
1351
+ }
1352
+ let { A: f, B: y, C: a, D: l, E: d, F: w, G: g, H: o } = this;
1353
+ for (let B = 0; B < 64; B++) {
1354
+ const U = M(d, 6) ^ M(d, 11) ^ M(d, 25), m = o + U + _t(d, w, g) + br[B] + O[B] | 0, P = (M(f, 2) ^ M(f, 13) ^ M(f, 22)) + St(f, y, a) | 0;
1355
+ o = g, g = w, w = d, d = l + m | 0, l = a, a = y, y = f, f = m + P | 0;
1356
+ }
1357
+ f = f + this.A | 0, y = y + this.B | 0, a = a + this.C | 0, l = l + this.D | 0, d = d + this.E | 0, w = w + this.F | 0, g = g + this.G | 0, o = o + this.H | 0, this.set(f, y, a, l, d, w, g, o);
1358
+ }
1359
+ roundClean() {
1360
+ j(O);
1361
+ }
1362
+ destroy() {
1363
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), j(this.buffer);
1364
+ }
1365
+ }
1366
+ class Tr extends Ur {
1367
+ // We cannot use array here since array allows indexing by variable
1368
+ // which means optimizer/compiler cannot use registers.
1369
+ A = F[0] | 0;
1370
+ B = F[1] | 0;
1371
+ C = F[2] | 0;
1372
+ D = F[3] | 0;
1373
+ E = F[4] | 0;
1374
+ F = F[5] | 0;
1375
+ G = F[6] | 0;
1376
+ H = F[7] | 0;
1377
+ constructor() {
1378
+ super(32);
1379
+ }
1380
+ }
1381
+ const tt = /* @__PURE__ */ pt(
1382
+ () => new Tr(),
1383
+ /* @__PURE__ */ yr(1)
1384
+ );
1385
+ function Lr(c) {
1386
+ return L.from(Dt(Uint8Array.from(c)));
1387
+ }
1388
+ function Rr(c) {
1389
+ return L.from(dr(Uint8Array.from(c)));
1390
+ }
1391
+ function Ft(c) {
1392
+ return L.from(tt(Uint8Array.from(c)));
1393
+ }
1394
+ function _r(c) {
1395
+ return L.from(Dt(tt(Uint8Array.from(c))));
1396
+ }
1397
+ function Sr(c) {
1398
+ return L.from(tt(tt(Uint8Array.from(c))));
1399
+ }
1400
+ const Cr = [
1401
+ "BIP0340/challenge",
1402
+ "BIP0340/aux",
1403
+ "BIP0340/nonce",
1404
+ "TapLeaf",
1405
+ "TapBranch",
1406
+ "TapSighash",
1407
+ "TapTweak",
1408
+ "KeyAgg list",
1409
+ "KeyAgg coefficient"
1410
+ ], $t = {
1411
+ "BIP0340/challenge": L.from([
1412
+ 123,
1413
+ 181,
1414
+ 45,
1415
+ 122,
1416
+ 159,
1417
+ 239,
1418
+ 88,
1419
+ 50,
1420
+ 62,
1421
+ 177,
1422
+ 191,
1423
+ 122,
1424
+ 64,
1425
+ 125,
1426
+ 179,
1427
+ 130,
1428
+ 210,
1429
+ 243,
1430
+ 242,
1431
+ 216,
1432
+ 27,
1433
+ 177,
1434
+ 34,
1435
+ 79,
1436
+ 73,
1437
+ 254,
1438
+ 81,
1439
+ 143,
1440
+ 109,
1441
+ 72,
1442
+ 211,
1443
+ 124,
1444
+ 123,
1445
+ 181,
1446
+ 45,
1447
+ 122,
1448
+ 159,
1449
+ 239,
1450
+ 88,
1451
+ 50,
1452
+ 62,
1453
+ 177,
1454
+ 191,
1455
+ 122,
1456
+ 64,
1457
+ 125,
1458
+ 179,
1459
+ 130,
1460
+ 210,
1461
+ 243,
1462
+ 242,
1463
+ 216,
1464
+ 27,
1465
+ 177,
1466
+ 34,
1467
+ 79,
1468
+ 73,
1469
+ 254,
1470
+ 81,
1471
+ 143,
1472
+ 109,
1473
+ 72,
1474
+ 211,
1475
+ 124
1476
+ ]),
1477
+ "BIP0340/aux": L.from([
1478
+ 241,
1479
+ 239,
1480
+ 78,
1481
+ 94,
1482
+ 192,
1483
+ 99,
1484
+ 202,
1485
+ 218,
1486
+ 109,
1487
+ 148,
1488
+ 202,
1489
+ 250,
1490
+ 157,
1491
+ 152,
1492
+ 126,
1493
+ 160,
1494
+ 105,
1495
+ 38,
1496
+ 88,
1497
+ 57,
1498
+ 236,
1499
+ 193,
1500
+ 31,
1501
+ 151,
1502
+ 45,
1503
+ 119,
1504
+ 165,
1505
+ 46,
1506
+ 216,
1507
+ 193,
1508
+ 204,
1509
+ 144,
1510
+ 241,
1511
+ 239,
1512
+ 78,
1513
+ 94,
1514
+ 192,
1515
+ 99,
1516
+ 202,
1517
+ 218,
1518
+ 109,
1519
+ 148,
1520
+ 202,
1521
+ 250,
1522
+ 157,
1523
+ 152,
1524
+ 126,
1525
+ 160,
1526
+ 105,
1527
+ 38,
1528
+ 88,
1529
+ 57,
1530
+ 236,
1531
+ 193,
1532
+ 31,
1533
+ 151,
1534
+ 45,
1535
+ 119,
1536
+ 165,
1537
+ 46,
1538
+ 216,
1539
+ 193,
1540
+ 204,
1541
+ 144
1542
+ ]),
1543
+ "BIP0340/nonce": L.from([
1544
+ 7,
1545
+ 73,
1546
+ 119,
1547
+ 52,
1548
+ 167,
1549
+ 155,
1550
+ 203,
1551
+ 53,
1552
+ 91,
1553
+ 155,
1554
+ 140,
1555
+ 125,
1556
+ 3,
1557
+ 79,
1558
+ 18,
1559
+ 28,
1560
+ 244,
1561
+ 52,
1562
+ 215,
1563
+ 62,
1564
+ 247,
1565
+ 45,
1566
+ 218,
1567
+ 25,
1568
+ 135,
1569
+ 0,
1570
+ 97,
1571
+ 251,
1572
+ 82,
1573
+ 191,
1574
+ 235,
1575
+ 47,
1576
+ 7,
1577
+ 73,
1578
+ 119,
1579
+ 52,
1580
+ 167,
1581
+ 155,
1582
+ 203,
1583
+ 53,
1584
+ 91,
1585
+ 155,
1586
+ 140,
1587
+ 125,
1588
+ 3,
1589
+ 79,
1590
+ 18,
1591
+ 28,
1592
+ 244,
1593
+ 52,
1594
+ 215,
1595
+ 62,
1596
+ 247,
1597
+ 45,
1598
+ 218,
1599
+ 25,
1600
+ 135,
1601
+ 0,
1602
+ 97,
1603
+ 251,
1604
+ 82,
1605
+ 191,
1606
+ 235,
1607
+ 47
1608
+ ]),
1609
+ TapLeaf: L.from([
1610
+ 174,
1611
+ 234,
1612
+ 143,
1613
+ 220,
1614
+ 66,
1615
+ 8,
1616
+ 152,
1617
+ 49,
1618
+ 5,
1619
+ 115,
1620
+ 75,
1621
+ 88,
1622
+ 8,
1623
+ 29,
1624
+ 30,
1625
+ 38,
1626
+ 56,
1627
+ 211,
1628
+ 95,
1629
+ 28,
1630
+ 181,
1631
+ 64,
1632
+ 8,
1633
+ 212,
1634
+ 211,
1635
+ 87,
1636
+ 202,
1637
+ 3,
1638
+ 190,
1639
+ 120,
1640
+ 233,
1641
+ 238,
1642
+ 174,
1643
+ 234,
1644
+ 143,
1645
+ 220,
1646
+ 66,
1647
+ 8,
1648
+ 152,
1649
+ 49,
1650
+ 5,
1651
+ 115,
1652
+ 75,
1653
+ 88,
1654
+ 8,
1655
+ 29,
1656
+ 30,
1657
+ 38,
1658
+ 56,
1659
+ 211,
1660
+ 95,
1661
+ 28,
1662
+ 181,
1663
+ 64,
1664
+ 8,
1665
+ 212,
1666
+ 211,
1667
+ 87,
1668
+ 202,
1669
+ 3,
1670
+ 190,
1671
+ 120,
1672
+ 233,
1673
+ 238
1674
+ ]),
1675
+ TapBranch: L.from([
1676
+ 25,
1677
+ 65,
1678
+ 161,
1679
+ 242,
1680
+ 229,
1681
+ 110,
1682
+ 185,
1683
+ 95,
1684
+ 162,
1685
+ 169,
1686
+ 241,
1687
+ 148,
1688
+ 190,
1689
+ 92,
1690
+ 1,
1691
+ 247,
1692
+ 33,
1693
+ 111,
1694
+ 51,
1695
+ 237,
1696
+ 130,
1697
+ 176,
1698
+ 145,
1699
+ 70,
1700
+ 52,
1701
+ 144,
1702
+ 208,
1703
+ 91,
1704
+ 245,
1705
+ 22,
1706
+ 160,
1707
+ 21,
1708
+ 25,
1709
+ 65,
1710
+ 161,
1711
+ 242,
1712
+ 229,
1713
+ 110,
1714
+ 185,
1715
+ 95,
1716
+ 162,
1717
+ 169,
1718
+ 241,
1719
+ 148,
1720
+ 190,
1721
+ 92,
1722
+ 1,
1723
+ 247,
1724
+ 33,
1725
+ 111,
1726
+ 51,
1727
+ 237,
1728
+ 130,
1729
+ 176,
1730
+ 145,
1731
+ 70,
1732
+ 52,
1733
+ 144,
1734
+ 208,
1735
+ 91,
1736
+ 245,
1737
+ 22,
1738
+ 160,
1739
+ 21
1740
+ ]),
1741
+ TapSighash: L.from([
1742
+ 244,
1743
+ 10,
1744
+ 72,
1745
+ 223,
1746
+ 75,
1747
+ 42,
1748
+ 112,
1749
+ 200,
1750
+ 180,
1751
+ 146,
1752
+ 75,
1753
+ 242,
1754
+ 101,
1755
+ 70,
1756
+ 97,
1757
+ 237,
1758
+ 61,
1759
+ 149,
1760
+ 253,
1761
+ 102,
1762
+ 163,
1763
+ 19,
1764
+ 235,
1765
+ 135,
1766
+ 35,
1767
+ 117,
1768
+ 151,
1769
+ 198,
1770
+ 40,
1771
+ 228,
1772
+ 160,
1773
+ 49,
1774
+ 244,
1775
+ 10,
1776
+ 72,
1777
+ 223,
1778
+ 75,
1779
+ 42,
1780
+ 112,
1781
+ 200,
1782
+ 180,
1783
+ 146,
1784
+ 75,
1785
+ 242,
1786
+ 101,
1787
+ 70,
1788
+ 97,
1789
+ 237,
1790
+ 61,
1791
+ 149,
1792
+ 253,
1793
+ 102,
1794
+ 163,
1795
+ 19,
1796
+ 235,
1797
+ 135,
1798
+ 35,
1799
+ 117,
1800
+ 151,
1801
+ 198,
1802
+ 40,
1803
+ 228,
1804
+ 160,
1805
+ 49
1806
+ ]),
1807
+ TapTweak: L.from([
1808
+ 232,
1809
+ 15,
1810
+ 225,
1811
+ 99,
1812
+ 156,
1813
+ 156,
1814
+ 160,
1815
+ 80,
1816
+ 227,
1817
+ 175,
1818
+ 27,
1819
+ 57,
1820
+ 193,
1821
+ 67,
1822
+ 198,
1823
+ 62,
1824
+ 66,
1825
+ 156,
1826
+ 188,
1827
+ 235,
1828
+ 21,
1829
+ 217,
1830
+ 64,
1831
+ 251,
1832
+ 181,
1833
+ 197,
1834
+ 161,
1835
+ 244,
1836
+ 175,
1837
+ 87,
1838
+ 197,
1839
+ 233,
1840
+ 232,
1841
+ 15,
1842
+ 225,
1843
+ 99,
1844
+ 156,
1845
+ 156,
1846
+ 160,
1847
+ 80,
1848
+ 227,
1849
+ 175,
1850
+ 27,
1851
+ 57,
1852
+ 193,
1853
+ 67,
1854
+ 198,
1855
+ 62,
1856
+ 66,
1857
+ 156,
1858
+ 188,
1859
+ 235,
1860
+ 21,
1861
+ 217,
1862
+ 64,
1863
+ 251,
1864
+ 181,
1865
+ 197,
1866
+ 161,
1867
+ 244,
1868
+ 175,
1869
+ 87,
1870
+ 197,
1871
+ 233
1872
+ ]),
1873
+ "KeyAgg list": L.from([
1874
+ 72,
1875
+ 28,
1876
+ 151,
1877
+ 28,
1878
+ 60,
1879
+ 11,
1880
+ 70,
1881
+ 215,
1882
+ 240,
1883
+ 178,
1884
+ 117,
1885
+ 174,
1886
+ 89,
1887
+ 141,
1888
+ 78,
1889
+ 44,
1890
+ 126,
1891
+ 215,
1892
+ 49,
1893
+ 156,
1894
+ 89,
1895
+ 74,
1896
+ 92,
1897
+ 110,
1898
+ 199,
1899
+ 158,
1900
+ 160,
1901
+ 212,
1902
+ 153,
1903
+ 2,
1904
+ 148,
1905
+ 240,
1906
+ 72,
1907
+ 28,
1908
+ 151,
1909
+ 28,
1910
+ 60,
1911
+ 11,
1912
+ 70,
1913
+ 215,
1914
+ 240,
1915
+ 178,
1916
+ 117,
1917
+ 174,
1918
+ 89,
1919
+ 141,
1920
+ 78,
1921
+ 44,
1922
+ 126,
1923
+ 215,
1924
+ 49,
1925
+ 156,
1926
+ 89,
1927
+ 74,
1928
+ 92,
1929
+ 110,
1930
+ 199,
1931
+ 158,
1932
+ 160,
1933
+ 212,
1934
+ 153,
1935
+ 2,
1936
+ 148,
1937
+ 240
1938
+ ]),
1939
+ "KeyAgg coefficient": L.from([
1940
+ 191,
1941
+ 201,
1942
+ 4,
1943
+ 3,
1944
+ 77,
1945
+ 28,
1946
+ 136,
1947
+ 232,
1948
+ 200,
1949
+ 14,
1950
+ 34,
1951
+ 229,
1952
+ 61,
1953
+ 36,
1954
+ 86,
1955
+ 109,
1956
+ 100,
1957
+ 130,
1958
+ 78,
1959
+ 214,
1960
+ 66,
1961
+ 114,
1962
+ 129,
1963
+ 192,
1964
+ 145,
1965
+ 0,
1966
+ 249,
1967
+ 77,
1968
+ 205,
1969
+ 82,
1970
+ 201,
1971
+ 129,
1972
+ 191,
1973
+ 201,
1974
+ 4,
1975
+ 3,
1976
+ 77,
1977
+ 28,
1978
+ 136,
1979
+ 232,
1980
+ 200,
1981
+ 14,
1982
+ 34,
1983
+ 229,
1984
+ 61,
1985
+ 36,
1986
+ 86,
1987
+ 109,
1988
+ 100,
1989
+ 130,
1990
+ 78,
1991
+ 214,
1992
+ 66,
1993
+ 114,
1994
+ 129,
1995
+ 192,
1996
+ 145,
1997
+ 0,
1998
+ 249,
1999
+ 77,
2000
+ 205,
2001
+ 82,
2002
+ 201,
2003
+ 129
2004
+ ])
2005
+ };
2006
+ function kr(c, h) {
2007
+ return Ft(L.concat([$t[c], h]));
2008
+ }
2009
+ const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2010
+ __proto__: null,
2011
+ TAGGED_HASH_PREFIXES: $t,
2012
+ TAGS: Cr,
2013
+ hash160: _r,
2014
+ hash256: Sr,
2015
+ ripemd160: Lr,
2016
+ sha1: Rr,
2017
+ sha256: Ft,
2018
+ taggedHash: kr
2019
+ }, Symbol.toStringTag, { value: "Module" }));
2020
+ export {
2021
+ L as B,
2022
+ Cr as T,
2023
+ Ft as a,
2024
+ Sr as b,
2025
+ Dr as c,
2026
+ $t as d,
2027
+ Nr as e,
2028
+ Pr as g,
2029
+ _r as h,
2030
+ Lr as r,
2031
+ Rr as s,
2032
+ kr as t
2033
+ };