@genai-fi/nanogpt 0.20.6 → 0.21.0

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 (208) hide show
  1. package/dist/{BaseTokeniser-DSg9zcYq.js → BaseTokeniser-C9TSv4th.js} +1 -1
  2. package/dist/{DatasetBuilder-DgURD85T.js → DatasetBuilder-B9UGNQT5.js} +82 -88
  3. package/dist/Generator.js +1 -1
  4. package/dist/{RealDiv-DBu0FQqT.js → RealDiv-CNsvC4AU.js} +6 -6
  5. package/dist/{Reshape-DqO3r8BC.js → Reshape-CwxdaU8n.js} +1 -1
  6. package/dist/{Reshape-CABOPB9d.js → Reshape-dnm9bO3B.js} +2 -2
  7. package/dist/TeachableLLM.js +1 -1
  8. package/dist/Trainer.js +1 -1
  9. package/dist/backend.js +2 -2
  10. package/dist/{backend_util-Cg-roD1p.js → backend_util-DAV0I34P.js} +5 -5
  11. package/dist/checks/appendCache.js +1 -1
  12. package/dist/checks/attentionMask.js +1 -1
  13. package/dist/checks/gelu.js +1 -1
  14. package/dist/checks/matMulGelu.js +1 -1
  15. package/dist/checks/normRMS.js +1 -1
  16. package/dist/checks/normRMSGrad.js +1 -1
  17. package/dist/checks/packUnpack.js +1 -1
  18. package/dist/checks/qkv.js +1 -1
  19. package/dist/checks/rope.js +6 -6
  20. package/dist/{chunk-BPntVaq0.js → chunk-CWhphoD1.js} +5 -5
  21. package/dist/{concat_util-CWDZCBlA.js → concat_util-CWzvQQlK.js} +1 -1
  22. package/dist/data/docx.js +58 -59
  23. package/dist/data/pdf.js +1 -1
  24. package/dist/data/textLoader.js +1 -1
  25. package/dist/{dist-DVmq73nz.js → dist-9wGF4ci9.js} +10 -10
  26. package/dist/{dist-VEU5mfO0.js → dist-BqAU9-yi.js} +4 -4
  27. package/dist/{dist-BewPQWjc.js → dist-Da20xy8E.js} +1874 -3071
  28. package/dist/{gelu-Bf1HW1RY.js → gelu-B6637MKa.js} +1 -1
  29. package/dist/{gpgpu_math-DvLcCH6u.js → gpgpu_math-DBYEAAdI.js} +2 -2
  30. package/dist/{kernel_funcs_utils-HiXOOx3f.js → kernel_funcs_utils-D-mATnGR.js} +3 -3
  31. package/dist/layers/BaseLayer.js +1 -1
  32. package/dist/layers/CausalSelfAttention.js +4 -4
  33. package/dist/layers/LoRA.js +3 -3
  34. package/dist/layers/MLP.js +2 -2
  35. package/dist/layers/PositionEmbedding.js +2 -2
  36. package/dist/layers/RMSNorm.js +1 -1
  37. package/dist/layers/RoPECache.js +1 -1
  38. package/dist/layers/TiedEmbedding.js +3 -3
  39. package/dist/layers/TransformerBlock.js +1 -1
  40. package/dist/layers/WeightStore.js +3 -3
  41. package/dist/loader/load.js +1 -1
  42. package/dist/loader/loadHF.js +1 -1
  43. package/dist/loader/loadTransformers.js +1 -1
  44. package/dist/loader/loadZipMeta.js +1 -1
  45. package/dist/loader/newZipLoad.js +1 -1
  46. package/dist/loader/oldZipLoad.js +1 -1
  47. package/dist/loader/save.d.ts +1 -0
  48. package/dist/loader/save.js +1 -1
  49. package/dist/{main-C0YUnw98.js → main-DdsoTJAW.js} +2012 -2015
  50. package/dist/main.js +1 -1
  51. package/dist/{matMul16-BNfZSnNM.js → matMul16-DGtlziMn.js} +3 -3
  52. package/dist/{matMulGelu-CPTntosE.js → matMulGelu-BAIgQaRx.js} +3 -3
  53. package/dist/models/NanoGPTV1.js +1 -1
  54. package/dist/models/NanoGPTV2.js +1 -1
  55. package/dist/models/factory.js +1 -1
  56. package/dist/models/model.js +1 -1
  57. package/dist/ops/adamAdjust.js +1 -1
  58. package/dist/ops/adamMoments.js +1 -1
  59. package/dist/ops/add16.js +1 -1
  60. package/dist/ops/appendCache.js +1 -1
  61. package/dist/ops/attentionMask.js +1 -1
  62. package/dist/ops/concat16.js +1 -1
  63. package/dist/ops/cpu/adamAdjust.js +1 -1
  64. package/dist/ops/cpu/adamMoments.js +1 -1
  65. package/dist/ops/cpu/appendCache.js +1 -1
  66. package/dist/ops/cpu/attentionMask.js +1 -1
  67. package/dist/ops/cpu/fusedSoftmax.js +1 -1
  68. package/dist/ops/cpu/gatherSub.js +1 -1
  69. package/dist/ops/cpu/gelu.js +1 -1
  70. package/dist/ops/cpu/matMul16.js +1 -1
  71. package/dist/ops/cpu/matMulGelu.js +2 -2
  72. package/dist/ops/cpu/matMulMul.js +1 -1
  73. package/dist/ops/cpu/mulDropout.js +1 -1
  74. package/dist/ops/cpu/normRMS.js +1 -1
  75. package/dist/ops/cpu/qkv.js +1 -1
  76. package/dist/ops/cpu/rope.js +1 -1
  77. package/dist/ops/cpu/scatterSub.js +1 -1
  78. package/dist/ops/dot16.js +2 -2
  79. package/dist/ops/dropout.js +1 -1
  80. package/dist/ops/dropout16.js +1 -1
  81. package/dist/ops/gatherSub.js +1 -1
  82. package/dist/ops/gelu.js +1 -1
  83. package/dist/ops/globalNorm.js +1 -1
  84. package/dist/ops/grads/add16.js +1 -1
  85. package/dist/ops/grads/attentionMask.js +2 -2
  86. package/dist/ops/grads/gelu.js +1 -1
  87. package/dist/ops/grads/matMul16.js +1 -1
  88. package/dist/ops/grads/matMulGelu.js +1 -1
  89. package/dist/ops/grads/normRMS.js +1 -1
  90. package/dist/ops/grads/pack16.js +1 -1
  91. package/dist/ops/grads/qkv.js +2 -2
  92. package/dist/ops/grads/rope.js +1 -1
  93. package/dist/ops/grads/softmax16.js +1 -1
  94. package/dist/ops/grads/unpack16.js +1 -1
  95. package/dist/ops/matMul16.js +1 -1
  96. package/dist/ops/matMulGelu.js +2 -2
  97. package/dist/ops/matMulMul.js +1 -1
  98. package/dist/ops/mul16.js +1 -1
  99. package/dist/ops/mulDrop.js +1 -1
  100. package/dist/ops/normRMS.js +1 -1
  101. package/dist/ops/pack16.js +1 -1
  102. package/dist/ops/qkv.js +1 -1
  103. package/dist/ops/reshape16.js +1 -1
  104. package/dist/ops/rope.js +1 -1
  105. package/dist/ops/scatterSub.js +1 -1
  106. package/dist/ops/slice16.js +1 -1
  107. package/dist/ops/softmax16.js +1 -1
  108. package/dist/ops/sub16.js +1 -1
  109. package/dist/ops/sum16.js +1 -1
  110. package/dist/ops/transpose16.js +1 -1
  111. package/dist/ops/unpack16.js +1 -1
  112. package/dist/ops/webgl/adamAdjust.js +2 -2
  113. package/dist/ops/webgl/adamMoments.js +3 -3
  114. package/dist/ops/webgl/appendCache.js +1 -1
  115. package/dist/ops/webgl/attentionMask.js +1 -1
  116. package/dist/ops/webgl/dropout16.js +1 -1
  117. package/dist/ops/webgl/fusedSoftmax.js +3 -3
  118. package/dist/ops/webgl/gatherSub.js +1 -1
  119. package/dist/ops/webgl/gelu.js +2 -2
  120. package/dist/ops/webgl/log.js +3 -3
  121. package/dist/ops/webgl/matMul16.js +8 -4
  122. package/dist/ops/webgl/matMulGelu.js +1 -1
  123. package/dist/ops/webgl/matMulMul.js +2 -2
  124. package/dist/ops/webgl/mulDropout.js +1 -1
  125. package/dist/ops/webgl/normRMS.js +1 -1
  126. package/dist/ops/webgl/qkv.js +1 -1
  127. package/dist/ops/webgl/rope.js +1 -1
  128. package/dist/ops/webgl/scatterSub.js +1 -1
  129. package/dist/ops/webgpu/adamAdjust.js +3 -3
  130. package/dist/ops/webgpu/adamMoments.js +3 -3
  131. package/dist/ops/webgpu/add16.js +1 -1
  132. package/dist/ops/webgpu/appendCache.js +3 -3
  133. package/dist/ops/webgpu/attentionMask.js +2 -2
  134. package/dist/ops/webgpu/attentionMask32_program.js +2 -2
  135. package/dist/ops/webgpu/clipScale.js +1 -1
  136. package/dist/ops/webgpu/concat16.js +5 -5
  137. package/dist/ops/webgpu/dropout16.js +3 -3
  138. package/dist/ops/webgpu/gatherSub.js +3 -3
  139. package/dist/ops/webgpu/gelu.js +3 -3
  140. package/dist/ops/webgpu/matMul16.js +8 -4
  141. package/dist/ops/webgpu/matMul16_program.js +7 -7
  142. package/dist/ops/webgpu/mul16.js +1 -1
  143. package/dist/ops/webgpu/norm2.js +1 -1
  144. package/dist/ops/webgpu/normRMS.js +3 -3
  145. package/dist/ops/webgpu/normRMSGrad.js +4 -4
  146. package/dist/ops/webgpu/pack16.js +1 -1
  147. package/dist/ops/webgpu/pack16_program.js +2 -2
  148. package/dist/ops/webgpu/qkv.js +2 -2
  149. package/dist/ops/webgpu/rope.js +3 -3
  150. package/dist/ops/webgpu/scatterSub.js +3 -3
  151. package/dist/ops/webgpu/slice16.js +4 -4
  152. package/dist/ops/webgpu/softmax16.js +1 -1
  153. package/dist/ops/webgpu/softmax16_program.js +2 -2
  154. package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
  155. package/dist/ops/webgpu/softmax16grad.js +1 -1
  156. package/dist/ops/webgpu/sub16.js +1 -1
  157. package/dist/ops/webgpu/sum16.js +15 -15
  158. package/dist/ops/webgpu/transpose16.js +1 -1
  159. package/dist/ops/webgpu/transpose16_program.js +2 -2
  160. package/dist/ops/webgpu/transpose16_shared_program.js +3 -3
  161. package/dist/ops/webgpu/unpack16.js +3 -3
  162. package/dist/ops/webgpu/utils/binary_op.js +3 -3
  163. package/dist/ops/webgpu/utils/reductions.js +3 -3
  164. package/dist/{pack16-Ck-spx_F.js → pack16-BhuXNUS7.js} +1 -1
  165. package/dist/patches/webgpu_backend.js +3 -3
  166. package/dist/patches/webgpu_base.js +1 -1
  167. package/dist/patches/webgpu_program.js +4 -4
  168. package/dist/{pdf-UoDqCYzz.js → pdf-CdmW8ikl.js} +1159 -1160
  169. package/dist/{picomatch-3tUnMMbd.js → picomatch-BO4HbNfo.js} +125 -127
  170. package/dist/{rope-CbeGlsV8.js → rope-C8EAiSGY.js} +1 -1
  171. package/dist/{selu_util-zkAx5doH.js → selu_util-B_AFEfoz.js} +1 -1
  172. package/dist/{shared-D1coEFea.js → shared-24EoeHJl.js} +4 -4
  173. package/dist/{shared-DOgWaqvL.js → shared-CfTzpULd.js} +1 -1
  174. package/dist/{slice_util-Dgb3ANWI.js → slice_util-Dve4TkDn.js} +2 -2
  175. package/dist/{tfjs_backend-BjuQ5FqB.js → tfjs_backend-CydPRQTc.js} +2 -2
  176. package/dist/tokeniser/BaseTokeniser.js +1 -1
  177. package/dist/tokeniser/CharTokeniser.js +1 -1
  178. package/dist/tokeniser/bpe.js +1 -1
  179. package/dist/training/AdamW.js +1 -1
  180. package/dist/training/BasicTrainer.js +2 -2
  181. package/dist/training/DatasetBuilder.d.ts +0 -1
  182. package/dist/training/DatasetBuilder.js +2 -2
  183. package/dist/training/Evaluator.js +1 -1
  184. package/dist/training/PreTrainer.js +1 -1
  185. package/dist/training/SFTTrainer.js +1 -1
  186. package/dist/training/loss.js +2 -2
  187. package/dist/training/orthoGrad.js +1 -1
  188. package/dist/training/sparseCrossEntropy.js +1 -1
  189. package/dist/training/tasks/ConversationTask.js +1 -1
  190. package/dist/training/validation.js +1 -1
  191. package/dist/utilities/arrayClose.d.ts +1 -0
  192. package/dist/utilities/arrayClose.js +13 -1
  193. package/dist/utilities/dummy.js +1 -1
  194. package/dist/utilities/float16.d.ts +3 -0
  195. package/dist/utilities/float16.js +46 -0
  196. package/dist/utilities/multinomialCPU.js +1 -1
  197. package/dist/utilities/packed.js +1 -1
  198. package/dist/utilities/performance.js +1 -1
  199. package/dist/utilities/profile.js +1 -1
  200. package/dist/utilities/safetensors.d.ts +3 -1
  201. package/dist/utilities/safetensors.js +46 -36
  202. package/dist/utilities/sentences.js +1 -1
  203. package/dist/utilities/weights.js +1 -1
  204. package/dist/{webgpu-Dt7BMzWz.js → webgpu-B19Tw8Nd.js} +3 -3
  205. package/dist/{webgpu_program-WOyIVMlZ.js → webgpu_program-B0PokuRJ.js} +1 -1
  206. package/dist/{webgpu_util-B_F3SShA.js → webgpu_util-DfODg6XI.js} +1 -1
  207. package/package.json +5 -5
  208. package/dist/dist-DXwIvKxl.js +0 -896
@@ -1,896 +0,0 @@
1
- import { n as e } from "./chunk-BPntVaq0.js";
2
- //#region node_modules/vite-plugin-node-polyfills/shims/global/dist/index.js
3
- var t, n = e((() => {
4
- t = globalThis || self;
5
- }));
6
- //#endregion
7
- //#region node_modules/vite-plugin-node-polyfills/shims/process/dist/index.js
8
- function r(e) {
9
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
10
- }
11
- function i() {
12
- throw Error("setTimeout has not been defined");
13
- }
14
- function a() {
15
- throw Error("clearTimeout has not been defined");
16
- }
17
- function o(e) {
18
- if (m === setTimeout) return setTimeout(e, 0);
19
- if ((m === i || !m) && setTimeout) return m = setTimeout, setTimeout(e, 0);
20
- try {
21
- return m(e, 0);
22
- } catch {
23
- try {
24
- return m.call(null, e, 0);
25
- } catch {
26
- return m.call(this, e, 0);
27
- }
28
- }
29
- }
30
- function s(e) {
31
- if (h === clearTimeout) return clearTimeout(e);
32
- if ((h === a || !h) && clearTimeout) return h = clearTimeout, clearTimeout(e);
33
- try {
34
- return h(e);
35
- } catch {
36
- try {
37
- return h.call(null, e);
38
- } catch {
39
- return h.call(this, e);
40
- }
41
- }
42
- }
43
- function c() {
44
- !_ || !v || (_ = !1, v.length ? g = v.concat(g) : y = -1, g.length && l());
45
- }
46
- function l() {
47
- if (!_) {
48
- var e = o(c);
49
- _ = !0;
50
- for (var t = g.length; t;) {
51
- for (v = g, g = []; ++y < t;) v && v[y].run();
52
- y = -1, t = g.length;
53
- }
54
- v = null, _ = !1, s(e);
55
- }
56
- }
57
- function u(e, t) {
58
- this.fun = e, this.array = t;
59
- }
60
- function d() {}
61
- var f, p, m, h, g, _, v, y, b, x, S = e((() => {
62
- f = { exports: {} }, p = f.exports = {}, (function() {
63
- try {
64
- m = typeof setTimeout == "function" ? setTimeout : i;
65
- } catch {
66
- m = i;
67
- }
68
- try {
69
- h = typeof clearTimeout == "function" ? clearTimeout : a;
70
- } catch {
71
- h = a;
72
- }
73
- })(), g = [], _ = !1, y = -1, p.nextTick = function(e) {
74
- var t = Array(arguments.length - 1);
75
- if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
76
- g.push(new u(e, t)), g.length === 1 && !_ && o(l);
77
- }, u.prototype.run = function() {
78
- this.fun.apply(null, this.array);
79
- }, p.title = "browser", p.browser = !0, p.env = {}, p.argv = [], p.version = "", p.versions = {}, p.on = d, p.addListener = d, p.once = d, p.off = d, p.removeListener = d, p.removeAllListeners = d, p.emit = d, p.prependListener = d, p.prependOnceListener = d, p.listeners = function(e) {
80
- return [];
81
- }, p.binding = function(e) {
82
- throw Error("process.binding is not supported");
83
- }, p.cwd = function() {
84
- return "/";
85
- }, p.chdir = function(e) {
86
- throw Error("process.chdir is not supported");
87
- }, p.umask = function() {
88
- return 0;
89
- }, b = f.exports, x = /*@__PURE__*/ r(b);
90
- }));
91
- //#endregion
92
- //#region node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js
93
- function C(e) {
94
- var t = e.length;
95
- if (t % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
96
- var n = e.indexOf("=");
97
- n === -1 && (n = t);
98
- var r = n === t ? 0 : 4 - n % 4;
99
- return [n, r];
100
- }
101
- function w(e) {
102
- var t = C(e), n = t[0], r = t[1];
103
- return (n + r) * 3 / 4 - r;
104
- }
105
- function T(e, t, n) {
106
- return (t + n) * 3 / 4 - n;
107
- }
108
- function E(e) {
109
- var t, n = C(e), r = n[0], i = n[1], a = new N(T(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
110
- for (c = 0; c < s; c += 4) t = M[e.charCodeAt(c)] << 18 | M[e.charCodeAt(c + 1)] << 12 | M[e.charCodeAt(c + 2)] << 6 | M[e.charCodeAt(c + 3)], a[o++] = t >> 16 & 255, a[o++] = t >> 8 & 255, a[o++] = t & 255;
111
- return i === 2 && (t = M[e.charCodeAt(c)] << 2 | M[e.charCodeAt(c + 1)] >> 4, a[o++] = t & 255), i === 1 && (t = M[e.charCodeAt(c)] << 10 | M[e.charCodeAt(c + 1)] << 4 | M[e.charCodeAt(c + 2)] >> 2, a[o++] = t >> 8 & 255, a[o++] = t & 255), a;
112
- }
113
- function ee(e) {
114
- return j[e >> 18 & 63] + j[e >> 12 & 63] + j[e >> 6 & 63] + j[e & 63];
115
- }
116
- function D(e, t, n) {
117
- for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(ee(r));
118
- return i.join("");
119
- }
120
- function O(e) {
121
- for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(D(e, o, o + a > s ? s : o + a));
122
- return r === 1 ? (t = e[n - 1], i.push(j[t >> 2] + j[t << 4 & 63] + "==")) : r === 2 && (t = (e[n - 2] << 8) + e[n - 1], i.push(j[t >> 10] + j[t >> 4 & 63] + j[t << 2 & 63] + "=")), i.join("");
123
- }
124
- var k, A, j, M, N, P, F, I, L, R, z = e((() => {
125
- for (k = {}, A = {}, A.byteLength = w, A.toByteArray = E, A.fromByteArray = O, j = [], M = [], N = typeof Uint8Array < "u" ? Uint8Array : Array, P = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", F = 0, I = P.length; F < I; ++F) j[F] = P[F], M[P.charCodeAt(F)] = F;
126
- M[45] = 62, M[95] = 63, L = {}, L.read = function(e, t, n, r, i) {
127
- var a, o, s = i * 8 - r - 1, c = (1 << s) - 1, l = c >> 1, u = -7, d = n ? i - 1 : 0, f = n ? -1 : 1, p = e[t + d];
128
- for (d += f, a = p & (1 << -u) - 1, p >>= -u, u += s; u > 0; a = a * 256 + e[t + d], d += f, u -= 8);
129
- for (o = a & (1 << -u) - 1, a >>= -u, u += r; u > 0; o = o * 256 + e[t + d], d += f, u -= 8);
130
- if (a === 0) a = 1 - l;
131
- else if (a === c) return o ? NaN : (p ? -1 : 1) * Infinity;
132
- else o += 2 ** r, a -= l;
133
- return (p ? -1 : 1) * o * 2 ** (a - r);
134
- }, L.write = function(e, t, n, r, i, a) {
135
- var o, s, c, l = a * 8 - i - 1, u = (1 << l) - 1, d = u >> 1, f = i === 23 ? 2 ** -24 - 2 ** -77 : 0, p = r ? 0 : a - 1, m = r ? 1 : -1, h = +(t < 0 || t === 0 && 1 / t < 0);
136
- for (t = Math.abs(t), isNaN(t) || t === Infinity ? (s = +!!isNaN(t), o = u) : (o = Math.floor(Math.log(t) / Math.LN2), t * (c = 2 ** -o) < 1 && (o--, c *= 2), o + d >= 1 ? t += f / c : t += f * 2 ** (1 - d), t * c >= 2 && (o++, c /= 2), o + d >= u ? (s = 0, o = u) : o + d >= 1 ? (s = (t * c - 1) * 2 ** i, o += d) : (s = t * 2 ** (d - 1) * 2 ** i, o = 0)); i >= 8; e[n + p] = s & 255, p += m, s /= 256, i -= 8);
137
- for (o = o << i | s, l += i; l > 0; e[n + p] = o & 255, p += m, o /= 256, l -= 8);
138
- e[n + p - m] |= h * 128;
139
- }, (function(e) {
140
- let t = A, n = L, r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
141
- e.Buffer = u, e.SlowBuffer = x, e.INSPECT_MAX_BYTES = 50;
142
- let i = 2147483647;
143
- e.kMaxLength = i;
144
- let { Uint8Array: a, ArrayBuffer: o, SharedArrayBuffer: s } = globalThis;
145
- u.TYPED_ARRAY_SUPPORT = c(), !u.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
146
- function c() {
147
- try {
148
- let e = new a(1), t = { foo: function() {
149
- return 42;
150
- } };
151
- return Object.setPrototypeOf(t, a.prototype), Object.setPrototypeOf(e, t), e.foo() === 42;
152
- } catch {
153
- return !1;
154
- }
155
- }
156
- Object.defineProperty(u.prototype, "parent", {
157
- enumerable: !0,
158
- get: function() {
159
- if (u.isBuffer(this)) return this.buffer;
160
- }
161
- }), Object.defineProperty(u.prototype, "offset", {
162
- enumerable: !0,
163
- get: function() {
164
- if (u.isBuffer(this)) return this.byteOffset;
165
- }
166
- });
167
- function l(e) {
168
- if (e > i) throw RangeError("The value \"" + e + "\" is invalid for option \"size\"");
169
- let t = new a(e);
170
- return Object.setPrototypeOf(t, u.prototype), t;
171
- }
172
- function u(e, t, n) {
173
- if (typeof e == "number") {
174
- if (typeof t == "string") throw TypeError("The \"string\" argument must be of type string. Received type number");
175
- return m(e);
176
- }
177
- return d(e, t, n);
178
- }
179
- u.poolSize = 8192;
180
- function d(e, t, n) {
181
- if (typeof e == "string") return h(e, t);
182
- if (o.isView(e)) return _(e);
183
- if (e == null) throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
184
- if (Z(e, o) || e && Z(e.buffer, o) || s !== void 0 && (Z(e, s) || e && Z(e.buffer, s))) return v(e, t, n);
185
- if (typeof e == "number") throw TypeError("The \"value\" argument must not be of type number. Received type number");
186
- let r = e.valueOf && e.valueOf();
187
- if (r != null && r !== e) return u.from(r, t, n);
188
- let i = y(e);
189
- if (i) return i;
190
- if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof e[Symbol.toPrimitive] == "function") return u.from(e[Symbol.toPrimitive]("string"), t, n);
191
- throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
192
- }
193
- u.from = function(e, t, n) {
194
- return d(e, t, n);
195
- }, Object.setPrototypeOf(u.prototype, a.prototype), Object.setPrototypeOf(u, a);
196
- function f(e) {
197
- if (typeof e != "number") throw TypeError("\"size\" argument must be of type number");
198
- if (e < 0) throw RangeError("The value \"" + e + "\" is invalid for option \"size\"");
199
- }
200
- function p(e, t, n) {
201
- return f(e), e <= 0 || t === void 0 ? l(e) : typeof n == "string" ? l(e).fill(t, n) : l(e).fill(t);
202
- }
203
- u.alloc = function(e, t, n) {
204
- return p(e, t, n);
205
- };
206
- function m(e) {
207
- return f(e), l(e < 0 ? 0 : b(e) | 0);
208
- }
209
- u.allocUnsafe = function(e) {
210
- return m(e);
211
- }, u.allocUnsafeSlow = function(e) {
212
- return m(e);
213
- };
214
- function h(e, t) {
215
- if ((typeof t != "string" || t === "") && (t = "utf8"), !u.isEncoding(t)) throw TypeError("Unknown encoding: " + t);
216
- let n = S(e, t) | 0, r = l(n), i = r.write(e, t);
217
- return i !== n && (r = r.slice(0, i)), r;
218
- }
219
- function g(e) {
220
- let t = e.length < 0 ? 0 : b(e.length) | 0, n = l(t);
221
- for (let r = 0; r < t; r += 1) n[r] = e[r] & 255;
222
- return n;
223
- }
224
- function _(e) {
225
- if (Z(e, a)) {
226
- let t = new a(e);
227
- return v(t.buffer, t.byteOffset, t.byteLength);
228
- }
229
- return g(e);
230
- }
231
- function v(e, t, n) {
232
- if (t < 0 || e.byteLength < t) throw RangeError("\"offset\" is outside of buffer bounds");
233
- if (e.byteLength < t + (n || 0)) throw RangeError("\"length\" is outside of buffer bounds");
234
- let r;
235
- return r = t === void 0 && n === void 0 ? new a(e) : n === void 0 ? new a(e, t) : new a(e, t, n), Object.setPrototypeOf(r, u.prototype), r;
236
- }
237
- function y(e) {
238
- if (u.isBuffer(e)) {
239
- let t = b(e.length) | 0, n = l(t);
240
- return n.length === 0 || e.copy(n, 0, 0, t), n;
241
- }
242
- if (e.length !== void 0) return typeof e.length != "number" || Q(e.length) ? l(0) : g(e);
243
- if (e.type === "Buffer" && Array.isArray(e.data)) return g(e.data);
244
- }
245
- function b(e) {
246
- if (e >= i) throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i.toString(16) + " bytes");
247
- return e | 0;
248
- }
249
- function x(e) {
250
- return +e != e && (e = 0), u.alloc(+e);
251
- }
252
- u.isBuffer = function(e) {
253
- return e != null && e._isBuffer === !0 && e !== u.prototype;
254
- }, u.compare = function(e, t) {
255
- if (Z(e, a) && (e = u.from(e, e.offset, e.byteLength)), Z(t, a) && (t = u.from(t, t.offset, t.byteLength)), !u.isBuffer(e) || !u.isBuffer(t)) throw TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
256
- if (e === t) return 0;
257
- let n = e.length, r = t.length;
258
- for (let i = 0, a = Math.min(n, r); i < a; ++i) if (e[i] !== t[i]) {
259
- n = e[i], r = t[i];
260
- break;
261
- }
262
- return n < r ? -1 : +(r < n);
263
- }, u.isEncoding = function(e) {
264
- switch (String(e).toLowerCase()) {
265
- case "hex":
266
- case "utf8":
267
- case "utf-8":
268
- case "ascii":
269
- case "latin1":
270
- case "binary":
271
- case "base64":
272
- case "ucs2":
273
- case "ucs-2":
274
- case "utf16le":
275
- case "utf-16le": return !0;
276
- default: return !1;
277
- }
278
- }, u.concat = function(e, t) {
279
- if (!Array.isArray(e)) throw TypeError("\"list\" argument must be an Array of Buffers");
280
- if (e.length === 0) return u.alloc(0);
281
- let n;
282
- if (t === void 0) for (t = 0, n = 0; n < e.length; ++n) t += e[n].length;
283
- let r = u.allocUnsafe(t), i = 0;
284
- for (n = 0; n < e.length; ++n) {
285
- let t = e[n];
286
- if (Z(t, a)) i + t.length > r.length ? (u.isBuffer(t) || (t = u.from(t)), t.copy(r, i)) : a.prototype.set.call(r, t, i);
287
- else if (u.isBuffer(t)) t.copy(r, i);
288
- else throw TypeError("\"list\" argument must be an Array of Buffers");
289
- i += t.length;
290
- }
291
- return r;
292
- };
293
- function S(e, t) {
294
- if (u.isBuffer(e)) return e.length;
295
- if (o.isView(e) || Z(e, o)) return e.byteLength;
296
- if (typeof e != "string") throw TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof e);
297
- let n = e.length, r = arguments.length > 2 && arguments[2] === !0;
298
- if (!r && n === 0) return 0;
299
- let i = !1;
300
- for (;;) switch (t) {
301
- case "ascii":
302
- case "latin1":
303
- case "binary": return n;
304
- case "utf8":
305
- case "utf-8": return Y(e).length;
306
- case "ucs2":
307
- case "ucs-2":
308
- case "utf16le":
309
- case "utf-16le": return n * 2;
310
- case "hex": return n >>> 1;
311
- case "base64": return de(e).length;
312
- default:
313
- if (i) return r ? -1 : Y(e).length;
314
- t = ("" + t).toLowerCase(), i = !0;
315
- }
316
- }
317
- u.byteLength = S;
318
- function C(e, t, n) {
319
- let r = !1;
320
- if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, t >>>= 0, n <= t)) return "";
321
- for (e ||= "utf8";;) switch (e) {
322
- case "hex": return z(this, t, n);
323
- case "utf8":
324
- case "utf-8": return N(this, t, n);
325
- case "ascii": return I(this, t, n);
326
- case "latin1":
327
- case "binary": return R(this, t, n);
328
- case "base64": return M(this, t, n);
329
- case "ucs2":
330
- case "ucs-2":
331
- case "utf16le":
332
- case "utf-16le": return te(this, t, n);
333
- default:
334
- if (r) throw TypeError("Unknown encoding: " + e);
335
- e = (e + "").toLowerCase(), r = !0;
336
- }
337
- }
338
- u.prototype._isBuffer = !0;
339
- function w(e, t, n) {
340
- let r = e[t];
341
- e[t] = e[n], e[n] = r;
342
- }
343
- u.prototype.swap16 = function() {
344
- let e = this.length;
345
- if (e % 2 != 0) throw RangeError("Buffer size must be a multiple of 16-bits");
346
- for (let t = 0; t < e; t += 2) w(this, t, t + 1);
347
- return this;
348
- }, u.prototype.swap32 = function() {
349
- let e = this.length;
350
- if (e % 4 != 0) throw RangeError("Buffer size must be a multiple of 32-bits");
351
- for (let t = 0; t < e; t += 4) w(this, t, t + 3), w(this, t + 1, t + 2);
352
- return this;
353
- }, u.prototype.swap64 = function() {
354
- let e = this.length;
355
- if (e % 8 != 0) throw RangeError("Buffer size must be a multiple of 64-bits");
356
- for (let t = 0; t < e; t += 8) w(this, t, t + 7), w(this, t + 1, t + 6), w(this, t + 2, t + 5), w(this, t + 3, t + 4);
357
- return this;
358
- }, u.prototype.toString = function() {
359
- let e = this.length;
360
- return e === 0 ? "" : arguments.length === 0 ? N(this, 0, e) : C.apply(this, arguments);
361
- }, u.prototype.toLocaleString = u.prototype.toString, u.prototype.equals = function(e) {
362
- if (!u.isBuffer(e)) throw TypeError("Argument must be a Buffer");
363
- return this === e ? !0 : u.compare(this, e) === 0;
364
- }, u.prototype.inspect = function() {
365
- let t = "", n = e.INSPECT_MAX_BYTES;
366
- return t = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (t += " ... "), "<Buffer " + t + ">";
367
- }, r && (u.prototype[r] = u.prototype.inspect), u.prototype.compare = function(e, t, n, r, i) {
368
- if (Z(e, a) && (e = u.from(e, e.offset, e.byteLength)), !u.isBuffer(e)) throw TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof e);
369
- if (t === void 0 && (t = 0), n === void 0 && (n = e ? e.length : 0), r === void 0 && (r = 0), i === void 0 && (i = this.length), t < 0 || n > e.length || r < 0 || i > this.length) throw RangeError("out of range index");
370
- if (r >= i && t >= n) return 0;
371
- if (r >= i) return -1;
372
- if (t >= n) return 1;
373
- if (t >>>= 0, n >>>= 0, r >>>= 0, i >>>= 0, this === e) return 0;
374
- let o = i - r, s = n - t, c = Math.min(o, s), l = this.slice(r, i), d = e.slice(t, n);
375
- for (let e = 0; e < c; ++e) if (l[e] !== d[e]) {
376
- o = l[e], s = d[e];
377
- break;
378
- }
379
- return o < s ? -1 : +(s < o);
380
- };
381
- function T(e, t, n, r, i) {
382
- if (e.length === 0) return -1;
383
- if (typeof n == "string" ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, Q(n) && (n = i ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
384
- if (i) return -1;
385
- n = e.length - 1;
386
- } else if (n < 0) if (i) n = 0;
387
- else return -1;
388
- if (typeof t == "string" && (t = u.from(t, r)), u.isBuffer(t)) return t.length === 0 ? -1 : E(e, t, n, r, i);
389
- if (typeof t == "number") return t &= 255, typeof a.prototype.indexOf == "function" ? i ? a.prototype.indexOf.call(e, t, n) : a.prototype.lastIndexOf.call(e, t, n) : E(e, [t], n, r, i);
390
- throw TypeError("val must be string, number or Buffer");
391
- }
392
- function E(e, t, n, r, i) {
393
- let a = 1, o = e.length, s = t.length;
394
- if (r !== void 0 && (r = String(r).toLowerCase(), r === "ucs2" || r === "ucs-2" || r === "utf16le" || r === "utf-16le")) {
395
- if (e.length < 2 || t.length < 2) return -1;
396
- a = 2, o /= 2, s /= 2, n /= 2;
397
- }
398
- function c(e, t) {
399
- return a === 1 ? e[t] : e.readUInt16BE(t * a);
400
- }
401
- let l;
402
- if (i) {
403
- let r = -1;
404
- for (l = n; l < o; l++) if (c(e, l) === c(t, r === -1 ? 0 : l - r)) {
405
- if (r === -1 && (r = l), l - r + 1 === s) return r * a;
406
- } else r !== -1 && (l -= l - r), r = -1;
407
- } else for (n + s > o && (n = o - s), l = n; l >= 0; l--) {
408
- let n = !0;
409
- for (let r = 0; r < s; r++) if (c(e, l + r) !== c(t, r)) {
410
- n = !1;
411
- break;
412
- }
413
- if (n) return l;
414
- }
415
- return -1;
416
- }
417
- u.prototype.includes = function(e, t, n) {
418
- return this.indexOf(e, t, n) !== -1;
419
- }, u.prototype.indexOf = function(e, t, n) {
420
- return T(this, e, t, n, !0);
421
- }, u.prototype.lastIndexOf = function(e, t, n) {
422
- return T(this, e, t, n, !1);
423
- };
424
- function ee(e, t, n, r) {
425
- n = Number(n) || 0;
426
- let i = e.length - n;
427
- r ? (r = Number(r), r > i && (r = i)) : r = i;
428
- let a = t.length;
429
- r > a / 2 && (r = a / 2);
430
- let o;
431
- for (o = 0; o < r; ++o) {
432
- let r = parseInt(t.substr(o * 2, 2), 16);
433
- if (Q(r)) return o;
434
- e[n + o] = r;
435
- }
436
- return o;
437
- }
438
- function D(e, t, n, r) {
439
- return X(Y(t, e.length - n), e, n, r);
440
- }
441
- function O(e, t, n, r) {
442
- return X(le(t), e, n, r);
443
- }
444
- function k(e, t, n, r) {
445
- return X(de(t), e, n, r);
446
- }
447
- function j(e, t, n, r) {
448
- return X(ue(t, e.length - n), e, n, r);
449
- }
450
- u.prototype.write = function(e, t, n, r) {
451
- if (t === void 0) r = "utf8", n = this.length, t = 0;
452
- else if (n === void 0 && typeof t == "string") r = t, n = this.length, t = 0;
453
- else if (isFinite(t)) t >>>= 0, isFinite(n) ? (n >>>= 0, r === void 0 && (r = "utf8")) : (r = n, n = void 0);
454
- else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
455
- let i = this.length - t;
456
- if ((n === void 0 || n > i) && (n = i), e.length > 0 && (n < 0 || t < 0) || t > this.length) throw RangeError("Attempt to write outside buffer bounds");
457
- r ||= "utf8";
458
- let a = !1;
459
- for (;;) switch (r) {
460
- case "hex": return ee(this, e, t, n);
461
- case "utf8":
462
- case "utf-8": return D(this, e, t, n);
463
- case "ascii":
464
- case "latin1":
465
- case "binary": return O(this, e, t, n);
466
- case "base64": return k(this, e, t, n);
467
- case "ucs2":
468
- case "ucs-2":
469
- case "utf16le":
470
- case "utf-16le": return j(this, e, t, n);
471
- default:
472
- if (a) throw TypeError("Unknown encoding: " + r);
473
- r = ("" + r).toLowerCase(), a = !0;
474
- }
475
- }, u.prototype.toJSON = function() {
476
- return {
477
- type: "Buffer",
478
- data: Array.prototype.slice.call(this._arr || this, 0)
479
- };
480
- };
481
- function M(e, n, r) {
482
- return n === 0 && r === e.length ? t.fromByteArray(e) : t.fromByteArray(e.slice(n, r));
483
- }
484
- function N(e, t, n) {
485
- n = Math.min(e.length, n);
486
- let r = [], i = t;
487
- for (; i < n;) {
488
- let t = e[i], a = null, o = t > 239 ? 4 : t > 223 ? 3 : t > 191 ? 2 : 1;
489
- if (i + o <= n) {
490
- let n, r, s, c;
491
- switch (o) {
492
- case 1:
493
- t < 128 && (a = t);
494
- break;
495
- case 2:
496
- n = e[i + 1], (n & 192) == 128 && (c = (t & 31) << 6 | n & 63, c > 127 && (a = c));
497
- break;
498
- case 3:
499
- n = e[i + 1], r = e[i + 2], (n & 192) == 128 && (r & 192) == 128 && (c = (t & 15) << 12 | (n & 63) << 6 | r & 63, c > 2047 && (c < 55296 || c > 57343) && (a = c));
500
- break;
501
- case 4: n = e[i + 1], r = e[i + 2], s = e[i + 3], (n & 192) == 128 && (r & 192) == 128 && (s & 192) == 128 && (c = (t & 15) << 18 | (n & 63) << 12 | (r & 63) << 6 | s & 63, c > 65535 && c < 1114112 && (a = c));
502
- }
503
- }
504
- a === null ? (a = 65533, o = 1) : a > 65535 && (a -= 65536, r.push(a >>> 10 & 1023 | 55296), a = 56320 | a & 1023), r.push(a), i += o;
505
- }
506
- return F(r);
507
- }
508
- let P = 4096;
509
- function F(e) {
510
- let t = e.length;
511
- if (t <= P) return String.fromCharCode.apply(String, e);
512
- let n = "", r = 0;
513
- for (; r < t;) n += String.fromCharCode.apply(String, e.slice(r, r += P));
514
- return n;
515
- }
516
- function I(e, t, n) {
517
- let r = "";
518
- n = Math.min(e.length, n);
519
- for (let i = t; i < n; ++i) r += String.fromCharCode(e[i] & 127);
520
- return r;
521
- }
522
- function R(e, t, n) {
523
- let r = "";
524
- n = Math.min(e.length, n);
525
- for (let i = t; i < n; ++i) r += String.fromCharCode(e[i]);
526
- return r;
527
- }
528
- function z(e, t, n) {
529
- let r = e.length;
530
- (!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r);
531
- let i = "";
532
- for (let r = t; r < n; ++r) i += fe[e[r]];
533
- return i;
534
- }
535
- function te(e, t, n) {
536
- let r = e.slice(t, n), i = "";
537
- for (let e = 0; e < r.length - 1; e += 2) i += String.fromCharCode(r[e] + r[e + 1] * 256);
538
- return i;
539
- }
540
- u.prototype.slice = function(e, t) {
541
- let n = this.length;
542
- e = ~~e, t = t === void 0 ? n : ~~t, e < 0 ? (e += n, e < 0 && (e = 0)) : e > n && (e = n), t < 0 ? (t += n, t < 0 && (t = 0)) : t > n && (t = n), t < e && (t = e);
543
- let r = this.subarray(e, t);
544
- return Object.setPrototypeOf(r, u.prototype), r;
545
- };
546
- function B(e, t, n) {
547
- if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
548
- if (e + t > n) throw RangeError("Trying to access beyond buffer length");
549
- }
550
- u.prototype.readUintLE = u.prototype.readUIntLE = function(e, t, n) {
551
- e >>>= 0, t >>>= 0, n || B(e, t, this.length);
552
- let r = this[e], i = 1, a = 0;
553
- for (; ++a < t && (i *= 256);) r += this[e + a] * i;
554
- return r;
555
- }, u.prototype.readUintBE = u.prototype.readUIntBE = function(e, t, n) {
556
- e >>>= 0, t >>>= 0, n || B(e, t, this.length);
557
- let r = this[e + --t], i = 1;
558
- for (; t > 0 && (i *= 256);) r += this[e + --t] * i;
559
- return r;
560
- }, u.prototype.readUint8 = u.prototype.readUInt8 = function(e, t) {
561
- return e >>>= 0, t || B(e, 1, this.length), this[e];
562
- }, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(e, t) {
563
- return e >>>= 0, t || B(e, 2, this.length), this[e] | this[e + 1] << 8;
564
- }, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(e, t) {
565
- return e >>>= 0, t || B(e, 2, this.length), this[e] << 8 | this[e + 1];
566
- }, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(e, t) {
567
- return e >>>= 0, t || B(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
568
- }, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(e, t) {
569
- return e >>>= 0, t || B(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
570
- }, u.prototype.readBigUInt64LE = $(function(e) {
571
- e >>>= 0, q(e, "offset");
572
- let t = this[e], n = this[e + 7];
573
- (t === void 0 || n === void 0) && J(e, this.length - 8);
574
- let r = t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, i = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + n * 2 ** 24;
575
- return BigInt(r) + (BigInt(i) << BigInt(32));
576
- }), u.prototype.readBigUInt64BE = $(function(e) {
577
- e >>>= 0, q(e, "offset");
578
- let t = this[e], n = this[e + 7];
579
- (t === void 0 || n === void 0) && J(e, this.length - 8);
580
- let r = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], i = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n;
581
- return (BigInt(r) << BigInt(32)) + BigInt(i);
582
- }), u.prototype.readIntLE = function(e, t, n) {
583
- e >>>= 0, t >>>= 0, n || B(e, t, this.length);
584
- let r = this[e], i = 1, a = 0;
585
- for (; ++a < t && (i *= 256);) r += this[e + a] * i;
586
- return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
587
- }, u.prototype.readIntBE = function(e, t, n) {
588
- e >>>= 0, t >>>= 0, n || B(e, t, this.length);
589
- let r = t, i = 1, a = this[e + --r];
590
- for (; r > 0 && (i *= 256);) a += this[e + --r] * i;
591
- return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
592
- }, u.prototype.readInt8 = function(e, t) {
593
- return e >>>= 0, t || B(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
594
- }, u.prototype.readInt16LE = function(e, t) {
595
- e >>>= 0, t || B(e, 2, this.length);
596
- let n = this[e] | this[e + 1] << 8;
597
- return n & 32768 ? n | 4294901760 : n;
598
- }, u.prototype.readInt16BE = function(e, t) {
599
- e >>>= 0, t || B(e, 2, this.length);
600
- let n = this[e + 1] | this[e] << 8;
601
- return n & 32768 ? n | 4294901760 : n;
602
- }, u.prototype.readInt32LE = function(e, t) {
603
- return e >>>= 0, t || B(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
604
- }, u.prototype.readInt32BE = function(e, t) {
605
- return e >>>= 0, t || B(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
606
- }, u.prototype.readBigInt64LE = $(function(e) {
607
- e >>>= 0, q(e, "offset");
608
- let t = this[e], n = this[e + 7];
609
- (t === void 0 || n === void 0) && J(e, this.length - 8);
610
- let r = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (n << 24);
611
- return (BigInt(r) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
612
- }), u.prototype.readBigInt64BE = $(function(e) {
613
- e >>>= 0, q(e, "offset");
614
- let t = this[e], n = this[e + 7];
615
- (t === void 0 || n === void 0) && J(e, this.length - 8);
616
- let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
617
- return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
618
- }), u.prototype.readFloatLE = function(e, t) {
619
- return e >>>= 0, t || B(e, 4, this.length), n.read(this, e, !0, 23, 4);
620
- }, u.prototype.readFloatBE = function(e, t) {
621
- return e >>>= 0, t || B(e, 4, this.length), n.read(this, e, !1, 23, 4);
622
- }, u.prototype.readDoubleLE = function(e, t) {
623
- return e >>>= 0, t || B(e, 8, this.length), n.read(this, e, !0, 52, 8);
624
- }, u.prototype.readDoubleBE = function(e, t) {
625
- return e >>>= 0, t || B(e, 8, this.length), n.read(this, e, !1, 52, 8);
626
- };
627
- function V(e, t, n, r, i, a) {
628
- if (!u.isBuffer(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
629
- if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
630
- if (n + r > e.length) throw RangeError("Index out of range");
631
- }
632
- u.prototype.writeUintLE = u.prototype.writeUIntLE = function(e, t, n, r) {
633
- if (e = +e, t >>>= 0, n >>>= 0, !r) {
634
- let r = 2 ** (8 * n) - 1;
635
- V(this, e, t, n, r, 0);
636
- }
637
- let i = 1, a = 0;
638
- for (this[t] = e & 255; ++a < n && (i *= 256);) this[t + a] = e / i & 255;
639
- return t + n;
640
- }, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(e, t, n, r) {
641
- if (e = +e, t >>>= 0, n >>>= 0, !r) {
642
- let r = 2 ** (8 * n) - 1;
643
- V(this, e, t, n, r, 0);
644
- }
645
- let i = n - 1, a = 1;
646
- for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) this[t + i] = e / a & 255;
647
- return t + n;
648
- }, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(e, t, n) {
649
- return e = +e, t >>>= 0, n || V(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
650
- }, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(e, t, n) {
651
- return e = +e, t >>>= 0, n || V(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
652
- }, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(e, t, n) {
653
- return e = +e, t >>>= 0, n || V(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
654
- }, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(e, t, n) {
655
- return e = +e, t >>>= 0, n || V(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
656
- }, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(e, t, n) {
657
- return e = +e, t >>>= 0, n || V(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
658
- };
659
- function ne(e, t, n, r, i) {
660
- K(t, r, i, e, n, 7);
661
- let a = Number(t & BigInt(4294967295));
662
- e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a;
663
- let o = Number(t >> BigInt(32) & BigInt(4294967295));
664
- return e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, n;
665
- }
666
- function H(e, t, n, r, i) {
667
- K(t, r, i, e, n, 7);
668
- let a = Number(t & BigInt(4294967295));
669
- e[n + 7] = a, a >>= 8, e[n + 6] = a, a >>= 8, e[n + 5] = a, a >>= 8, e[n + 4] = a;
670
- let o = Number(t >> BigInt(32) & BigInt(4294967295));
671
- return e[n + 3] = o, o >>= 8, e[n + 2] = o, o >>= 8, e[n + 1] = o, o >>= 8, e[n] = o, n + 8;
672
- }
673
- u.prototype.writeBigUInt64LE = $(function(e, t = 0) {
674
- return ne(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
675
- }), u.prototype.writeBigUInt64BE = $(function(e, t = 0) {
676
- return H(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
677
- }), u.prototype.writeIntLE = function(e, t, n, r) {
678
- if (e = +e, t >>>= 0, !r) {
679
- let r = 2 ** (8 * n - 1);
680
- V(this, e, t, n, r - 1, -r);
681
- }
682
- let i = 0, a = 1, o = 0;
683
- for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
684
- return t + n;
685
- }, u.prototype.writeIntBE = function(e, t, n, r) {
686
- if (e = +e, t >>>= 0, !r) {
687
- let r = 2 ** (8 * n - 1);
688
- V(this, e, t, n, r - 1, -r);
689
- }
690
- let i = n - 1, a = 1, o = 0;
691
- for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
692
- return t + n;
693
- }, u.prototype.writeInt8 = function(e, t, n) {
694
- return e = +e, t >>>= 0, n || V(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
695
- }, u.prototype.writeInt16LE = function(e, t, n) {
696
- return e = +e, t >>>= 0, n || V(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
697
- }, u.prototype.writeInt16BE = function(e, t, n) {
698
- return e = +e, t >>>= 0, n || V(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
699
- }, u.prototype.writeInt32LE = function(e, t, n) {
700
- return e = +e, t >>>= 0, n || V(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
701
- }, u.prototype.writeInt32BE = function(e, t, n) {
702
- return e = +e, t >>>= 0, n || V(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
703
- }, u.prototype.writeBigInt64LE = $(function(e, t = 0) {
704
- return ne(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
705
- }), u.prototype.writeBigInt64BE = $(function(e, t = 0) {
706
- return H(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
707
- });
708
- function re(e, t, n, r, i, a) {
709
- if (n + r > e.length || n < 0) throw RangeError("Index out of range");
710
- }
711
- function ie(e, t, r, i, a) {
712
- return t = +t, r >>>= 0, a || re(e, t, r, 4), n.write(e, t, r, i, 23, 4), r + 4;
713
- }
714
- u.prototype.writeFloatLE = function(e, t, n) {
715
- return ie(this, e, t, !0, n);
716
- }, u.prototype.writeFloatBE = function(e, t, n) {
717
- return ie(this, e, t, !1, n);
718
- };
719
- function ae(e, t, r, i, a) {
720
- return t = +t, r >>>= 0, a || re(e, t, r, 8), n.write(e, t, r, i, 52, 8), r + 8;
721
- }
722
- u.prototype.writeDoubleLE = function(e, t, n) {
723
- return ae(this, e, t, !0, n);
724
- }, u.prototype.writeDoubleBE = function(e, t, n) {
725
- return ae(this, e, t, !1, n);
726
- }, u.prototype.copy = function(e, t, n, r) {
727
- if (!u.isBuffer(e)) throw TypeError("argument should be a Buffer");
728
- if (n ||= 0, !r && r !== 0 && (r = this.length), t >= e.length && (t = e.length), t ||= 0, r > 0 && r < n && (r = n), r === n || e.length === 0 || this.length === 0) return 0;
729
- if (t < 0) throw RangeError("targetStart out of bounds");
730
- if (n < 0 || n >= this.length) throw RangeError("Index out of range");
731
- if (r < 0) throw RangeError("sourceEnd out of bounds");
732
- r > this.length && (r = this.length), e.length - t < r - n && (r = e.length - t + n);
733
- let i = r - n;
734
- return this === e && typeof a.prototype.copyWithin == "function" ? this.copyWithin(t, n, r) : a.prototype.set.call(e, this.subarray(n, r), t), i;
735
- }, u.prototype.fill = function(e, t, n, r) {
736
- if (typeof e == "string") {
737
- if (typeof t == "string" ? (r = t, t = 0, n = this.length) : typeof n == "string" && (r = n, n = this.length), r !== void 0 && typeof r != "string") throw TypeError("encoding must be a string");
738
- if (typeof r == "string" && !u.isEncoding(r)) throw TypeError("Unknown encoding: " + r);
739
- if (e.length === 1) {
740
- let t = e.charCodeAt(0);
741
- (r === "utf8" && t < 128 || r === "latin1") && (e = t);
742
- }
743
- } else typeof e == "number" ? e &= 255 : typeof e == "boolean" && (e = Number(e));
744
- if (t < 0 || this.length < t || this.length < n) throw RangeError("Out of range index");
745
- if (n <= t) return this;
746
- t >>>= 0, n = n === void 0 ? this.length : n >>> 0, e ||= 0;
747
- let i;
748
- if (typeof e == "number") for (i = t; i < n; ++i) this[i] = e;
749
- else {
750
- let a = u.isBuffer(e) ? e : u.from(e, r), o = a.length;
751
- if (o === 0) throw TypeError("The value \"" + e + "\" is invalid for argument \"value\"");
752
- for (i = 0; i < n - t; ++i) this[i + t] = a[i % o];
753
- }
754
- return this;
755
- };
756
- let U = {};
757
- function W(e, t, n) {
758
- U[e] = class extends n {
759
- constructor() {
760
- super(), Object.defineProperty(this, "message", {
761
- value: t.apply(this, arguments),
762
- writable: !0,
763
- configurable: !0
764
- }), this.name = `${this.name} [${e}]`, this.stack, delete this.name;
765
- }
766
- get code() {
767
- return e;
768
- }
769
- set code(e) {
770
- Object.defineProperty(this, "code", {
771
- configurable: !0,
772
- enumerable: !0,
773
- value: e,
774
- writable: !0
775
- });
776
- }
777
- toString() {
778
- return `${this.name} [${e}]: ${this.message}`;
779
- }
780
- };
781
- }
782
- W("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
783
- return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
784
- }, RangeError), W("ERR_INVALID_ARG_TYPE", function(e, t) {
785
- return `The "${e}" argument must be of type number. Received type ${typeof t}`;
786
- }, TypeError), W("ERR_OUT_OF_RANGE", function(e, t, n) {
787
- let r = `The value of "${e}" is out of range.`, i = n;
788
- return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = G(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = G(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
789
- }, RangeError);
790
- function G(e) {
791
- let t = "", n = e.length, r = +(e[0] === "-");
792
- for (; n >= r + 4; n -= 3) t = `_${e.slice(n - 3, n)}${t}`;
793
- return `${e.slice(0, n)}${t}`;
794
- }
795
- function oe(e, t, n) {
796
- q(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && J(t, e.length - (n + 1));
797
- }
798
- function K(e, t, n, r, i, a) {
799
- if (e > n || e < t) {
800
- let r = typeof t == "bigint" ? "n" : "", i;
801
- throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new U.ERR_OUT_OF_RANGE("value", i, e);
802
- }
803
- oe(r, i, a);
804
- }
805
- function q(e, t) {
806
- if (typeof e != "number") throw new U.ERR_INVALID_ARG_TYPE(t, "number", e);
807
- }
808
- function J(e, t, n) {
809
- throw Math.floor(e) === e ? t < 0 ? new U.ERR_BUFFER_OUT_OF_BOUNDS() : new U.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (q(e, n), new U.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
810
- }
811
- let se = /[^+/0-9A-Za-z-_]/g;
812
- function ce(e) {
813
- if (e = e.split("=")[0], e = e.trim().replace(se, ""), e.length < 2) return "";
814
- for (; e.length % 4 != 0;) e += "=";
815
- return e;
816
- }
817
- function Y(e, t) {
818
- t ||= Infinity;
819
- let n, r = e.length, i = null, a = [];
820
- for (let o = 0; o < r; ++o) {
821
- if (n = e.charCodeAt(o), n > 55295 && n < 57344) {
822
- if (!i) {
823
- if (n > 56319) {
824
- (t -= 3) > -1 && a.push(239, 191, 189);
825
- continue;
826
- } else if (o + 1 === r) {
827
- (t -= 3) > -1 && a.push(239, 191, 189);
828
- continue;
829
- }
830
- i = n;
831
- continue;
832
- }
833
- if (n < 56320) {
834
- (t -= 3) > -1 && a.push(239, 191, 189), i = n;
835
- continue;
836
- }
837
- n = (i - 55296 << 10 | n - 56320) + 65536;
838
- } else i && (t -= 3) > -1 && a.push(239, 191, 189);
839
- if (i = null, n < 128) {
840
- if (--t < 0) break;
841
- a.push(n);
842
- } else if (n < 2048) {
843
- if ((t -= 2) < 0) break;
844
- a.push(n >> 6 | 192, n & 63 | 128);
845
- } else if (n < 65536) {
846
- if ((t -= 3) < 0) break;
847
- a.push(n >> 12 | 224, n >> 6 & 63 | 128, n & 63 | 128);
848
- } else if (n < 1114112) {
849
- if ((t -= 4) < 0) break;
850
- a.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, n & 63 | 128);
851
- } else throw Error("Invalid code point");
852
- }
853
- return a;
854
- }
855
- function le(e) {
856
- let t = [];
857
- for (let n = 0; n < e.length; ++n) t.push(e.charCodeAt(n) & 255);
858
- return t;
859
- }
860
- function ue(e, t) {
861
- let n, r, i, a = [];
862
- for (let o = 0; o < e.length && !((t -= 2) < 0); ++o) n = e.charCodeAt(o), r = n >> 8, i = n % 256, a.push(i), a.push(r);
863
- return a;
864
- }
865
- function de(e) {
866
- return t.toByteArray(ce(e));
867
- }
868
- function X(e, t, n, r) {
869
- let i;
870
- for (i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i];
871
- return i;
872
- }
873
- function Z(e, t) {
874
- return e instanceof t || e != null && e.constructor != null && e.constructor.name != null && e.constructor.name === t.name;
875
- }
876
- function Q(e) {
877
- return e !== e;
878
- }
879
- let fe = (function() {
880
- let e = "0123456789abcdef", t = Array(256);
881
- for (let n = 0; n < 16; ++n) {
882
- let r = n * 16;
883
- for (let i = 0; i < 16; ++i) t[r + i] = e[n] + e[i];
884
- }
885
- return t;
886
- })();
887
- function $(e) {
888
- return typeof BigInt > "u" ? pe : e;
889
- }
890
- function pe() {
891
- throw Error("BigInt not supported");
892
- }
893
- })(k), R = k.Buffer, k.Blob, k.BlobOptions, k.Buffer, k.File, k.FileOptions, k.INSPECT_MAX_BYTES, k.SlowBuffer, k.TranscodeEncoding, k.atob, k.btoa, k.constants, k.isAscii, k.isUtf8, k.kMaxLength, k.kStringMaxLength, k.resolveObjectURL, k.transcode;
894
- }));
895
- //#endregion
896
- export { t as a, x as i, z as n, n as o, S as r, R as t };