@har-analyzer/components 0.0.9 → 0.0.11

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 (61) hide show
  1. package/README.md +125 -43
  2. package/dist/chunks/har.js +27 -27
  3. package/dist/chunks/index.js +186 -44
  4. package/dist/chunks/json.js +10 -0
  5. package/dist/components/collapsible-key-value-list.d.ts +9 -0
  6. package/dist/components/collapsible-section.d.ts +5 -0
  7. package/dist/components/enhanced-board/constants/i18n.d.ts +21 -0
  8. package/dist/components/enhanced-board/index.d.ts +15 -0
  9. package/dist/components/enhanced-table.d.ts +47 -0
  10. package/dist/components/enhanced-top-navigation.d.ts +7 -0
  11. package/dist/components/error-boundary.d.ts +1 -0
  12. package/dist/components/horizontal-gap.d.ts +6 -0
  13. package/dist/components/json-viewer.d.ts +3 -0
  14. package/dist/components/simple-app-layout.d.ts +6 -0
  15. package/dist/components/simple-app-preferences/content-width-switcher.d.ts +1 -0
  16. package/dist/components/simple-app-preferences/index.d.ts +1 -0
  17. package/dist/components/simple-app-preferences/theme-switcher.d.ts +1 -0
  18. package/dist/components/vertical-gap.d.ts +6 -0
  19. package/dist/features/har-analyzer/index.d.ts +5 -0
  20. package/dist/features/har-analyzer-preferences/index.d.ts +7 -0
  21. package/dist/features/har-entries-viewer/components/har-entries-filters/components/content-type-filter.d.ts +7 -0
  22. package/dist/features/har-entries-viewer/components/har-entries-filters/components/errors-filter.d.ts +6 -0
  23. package/dist/features/har-entries-viewer/components/har-entries-filters/index.d.ts +1 -0
  24. package/dist/features/har-entries-viewer/hooks/preferences.d.ts +2 -0
  25. package/dist/features/har-entries-viewer/index.d.ts +7 -0
  26. package/dist/features/har-file-uploader/file-upload-error.d.ts +5 -0
  27. package/dist/features/har-file-uploader/index.d.ts +8 -0
  28. package/dist/features/list-har-entries/index.d.ts +8 -0
  29. package/dist/features/view-har-entry/components/content-viewer.d.ts +7 -0
  30. package/dist/features/view-har-entry/components/headers-viewer.d.ts +6 -0
  31. package/dist/features/view-har-entry/components/payload-viewer.d.ts +6 -0
  32. package/dist/features/view-har-entry/components/response-viewer.d.ts +6 -0
  33. package/dist/features/view-har-entry/index.d.ts +5 -0
  34. package/dist/har-analyzer-preferences.js +21 -93
  35. package/dist/har-analyzer.js +72 -75
  36. package/dist/har-entries-viewer.js +7 -2117
  37. package/dist/har-file-uploader.js +18 -18
  38. package/dist/hooks/app-preferences.d.ts +2 -0
  39. package/dist/hooks/board-preferences.d.ts +2 -0
  40. package/dist/hooks/table-preferences.d.ts +12 -0
  41. package/dist/index.d.ts +8 -77
  42. package/dist/index.js +17 -16
  43. package/dist/list-har-entries.js +2131 -0
  44. package/dist/utils/common.d.ts +2 -0
  45. package/dist/utils/content-type.d.ts +4 -0
  46. package/dist/utils/date.d.ts +2 -0
  47. package/dist/utils/file-upload.d.ts +3 -0
  48. package/dist/utils/har.d.ts +17 -0
  49. package/dist/utils/json.d.ts +1 -0
  50. package/dist/view-har-entry.js +3130 -0
  51. package/package.json +3 -3
  52. package/dist/har-analyzer-preferences.d.ts +0 -18
  53. package/dist/har-analyzer.d.ts +0 -11
  54. package/dist/har-content-viewer.d.ts +0 -14
  55. package/dist/har-content-viewer.js +0 -150
  56. package/dist/har-entries-filters.d.ts +0 -23
  57. package/dist/har-entries-filters.js +0 -7
  58. package/dist/har-entries-viewer.d.ts +0 -26
  59. package/dist/har-entry-viewer.d.ts +0 -24
  60. package/dist/har-entry-viewer.js +0 -1145
  61. package/dist/har-file-uploader.d.ts +0 -16
@@ -1,1145 +0,0 @@
1
- import { jsx as F, jsxs as Q } from "react/jsx-runtime";
2
- import Mr from "@cloudscape-design/components/tabs";
3
- import kr from "@cloudscape-design/code-view/code-view";
4
- import Dr from "@cloudscape-design/components/copy-to-clipboard";
5
- import { g as Pr, a as $r } from "./chunks/content-type.js";
6
- import K from "@cloudscape-design/components/box";
7
- import Or from "@cloudscape-design/components/column-layout";
8
- import qr from "@cloudscape-design/components/expandable-section";
9
- import { V as wr } from "./chunks/vertical-gap.js";
10
- var z = {}, H = {}, lr;
11
- function Gr() {
12
- if (lr) return H;
13
- lr = 1, H.byteLength = o, H.toByteArray = M, H.fromByteArray = k;
14
- for (var c = [], f = [], w = typeof Uint8Array < "u" ? Uint8Array : Array, I = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", y = 0, m = I.length; y < m; ++y)
15
- c[y] = I[y], f[I.charCodeAt(y)] = y;
16
- f[45] = 62, f[95] = 63;
17
- function s(p) {
18
- var a = p.length;
19
- if (a % 4 > 0)
20
- throw new Error("Invalid string. Length must be a multiple of 4");
21
- var x = p.indexOf("=");
22
- x === -1 && (x = a);
23
- var S = x === a ? 0 : 4 - x % 4;
24
- return [x, S];
25
- }
26
- function o(p) {
27
- var a = s(p), x = a[0], S = a[1];
28
- return (x + S) * 3 / 4 - S;
29
- }
30
- function L(p, a, x) {
31
- return (a + x) * 3 / 4 - x;
32
- }
33
- function M(p) {
34
- var a, x = s(p), S = x[0], b = x[1], T = new w(L(p, S, b)), _ = 0, $ = b > 0 ? S - 4 : S, A;
35
- for (A = 0; A < $; A += 4)
36
- a = f[p.charCodeAt(A)] << 18 | f[p.charCodeAt(A + 1)] << 12 | f[p.charCodeAt(A + 2)] << 6 | f[p.charCodeAt(A + 3)], T[_++] = a >> 16 & 255, T[_++] = a >> 8 & 255, T[_++] = a & 255;
37
- return b === 2 && (a = f[p.charCodeAt(A)] << 2 | f[p.charCodeAt(A + 1)] >> 4, T[_++] = a & 255), b === 1 && (a = f[p.charCodeAt(A)] << 10 | f[p.charCodeAt(A + 1)] << 4 | f[p.charCodeAt(A + 2)] >> 2, T[_++] = a >> 8 & 255, T[_++] = a & 255), T;
38
- }
39
- function U(p) {
40
- return c[p >> 18 & 63] + c[p >> 12 & 63] + c[p >> 6 & 63] + c[p & 63];
41
- }
42
- function R(p, a, x) {
43
- for (var S, b = [], T = a; T < x; T += 3)
44
- S = (p[T] << 16 & 16711680) + (p[T + 1] << 8 & 65280) + (p[T + 2] & 255), b.push(U(S));
45
- return b.join("");
46
- }
47
- function k(p) {
48
- for (var a, x = p.length, S = x % 3, b = [], T = 16383, _ = 0, $ = x - S; _ < $; _ += T)
49
- b.push(R(p, _, _ + T > $ ? $ : _ + T));
50
- return S === 1 ? (a = p[x - 1], b.push(
51
- c[a >> 2] + c[a << 4 & 63] + "=="
52
- )) : S === 2 && (a = (p[x - 2] << 8) + p[x - 1], b.push(
53
- c[a >> 10] + c[a >> 4 & 63] + c[a << 2 & 63] + "="
54
- )), b.join("");
55
- }
56
- return H;
57
- }
58
- var J = {};
59
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
60
- var ar;
61
- function Hr() {
62
- return ar || (ar = 1, J.read = function(c, f, w, I, y) {
63
- var m, s, o = y * 8 - I - 1, L = (1 << o) - 1, M = L >> 1, U = -7, R = w ? y - 1 : 0, k = w ? -1 : 1, p = c[f + R];
64
- for (R += k, m = p & (1 << -U) - 1, p >>= -U, U += o; U > 0; m = m * 256 + c[f + R], R += k, U -= 8)
65
- ;
66
- for (s = m & (1 << -U) - 1, m >>= -U, U += I; U > 0; s = s * 256 + c[f + R], R += k, U -= 8)
67
- ;
68
- if (m === 0)
69
- m = 1 - M;
70
- else {
71
- if (m === L)
72
- return s ? NaN : (p ? -1 : 1) * (1 / 0);
73
- s = s + Math.pow(2, I), m = m - M;
74
- }
75
- return (p ? -1 : 1) * s * Math.pow(2, m - I);
76
- }, J.write = function(c, f, w, I, y, m) {
77
- var s, o, L, M = m * 8 - y - 1, U = (1 << M) - 1, R = U >> 1, k = y === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = I ? 0 : m - 1, a = I ? 1 : -1, x = f < 0 || f === 0 && 1 / f < 0 ? 1 : 0;
78
- for (f = Math.abs(f), isNaN(f) || f === 1 / 0 ? (o = isNaN(f) ? 1 : 0, s = U) : (s = Math.floor(Math.log(f) / Math.LN2), f * (L = Math.pow(2, -s)) < 1 && (s--, L *= 2), s + R >= 1 ? f += k / L : f += k * Math.pow(2, 1 - R), f * L >= 2 && (s++, L /= 2), s + R >= U ? (o = 0, s = U) : s + R >= 1 ? (o = (f * L - 1) * Math.pow(2, y), s = s + R) : (o = f * Math.pow(2, R - 1) * Math.pow(2, y), s = 0)); y >= 8; c[w + p] = o & 255, p += a, o /= 256, y -= 8)
79
- ;
80
- for (s = s << y | o, M += y; M > 0; c[w + p] = s & 255, p += a, s /= 256, M -= 8)
81
- ;
82
- c[w + p - a] |= x * 128;
83
- }), J;
84
- }
85
- /*!
86
- * The buffer module from node.js, for the browser.
87
- *
88
- * @author Feross Aboukhadijeh <https://feross.org>
89
- * @license MIT
90
- */
91
- var yr;
92
- function Vr() {
93
- return yr || (yr = 1, function(c) {
94
- const f = Gr(), w = Hr(), I = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
95
- c.Buffer = o, c.SlowBuffer = T, c.INSPECT_MAX_BYTES = 50;
96
- const y = 2147483647;
97
- c.kMaxLength = y, o.TYPED_ARRAY_SUPPORT = m(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
98
- "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
99
- );
100
- function m() {
101
- try {
102
- const e = new Uint8Array(1), r = { foo: function() {
103
- return 42;
104
- } };
105
- return Object.setPrototypeOf(r, Uint8Array.prototype), Object.setPrototypeOf(e, r), e.foo() === 42;
106
- } catch {
107
- return !1;
108
- }
109
- }
110
- Object.defineProperty(o.prototype, "parent", {
111
- enumerable: !0,
112
- get: function() {
113
- if (o.isBuffer(this))
114
- return this.buffer;
115
- }
116
- }), Object.defineProperty(o.prototype, "offset", {
117
- enumerable: !0,
118
- get: function() {
119
- if (o.isBuffer(this))
120
- return this.byteOffset;
121
- }
122
- });
123
- function s(e) {
124
- if (e > y)
125
- throw new RangeError('The value "' + e + '" is invalid for option "size"');
126
- const r = new Uint8Array(e);
127
- return Object.setPrototypeOf(r, o.prototype), r;
128
- }
129
- function o(e, r, t) {
130
- if (typeof e == "number") {
131
- if (typeof r == "string")
132
- throw new TypeError(
133
- 'The "string" argument must be of type string. Received type number'
134
- );
135
- return R(e);
136
- }
137
- return L(e, r, t);
138
- }
139
- o.poolSize = 8192;
140
- function L(e, r, t) {
141
- if (typeof e == "string")
142
- return k(e, r);
143
- if (ArrayBuffer.isView(e))
144
- return a(e);
145
- if (e == null)
146
- throw new TypeError(
147
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e
148
- );
149
- if (D(e, ArrayBuffer) || e && D(e.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (D(e, SharedArrayBuffer) || e && D(e.buffer, SharedArrayBuffer)))
150
- return x(e, r, t);
151
- if (typeof e == "number")
152
- throw new TypeError(
153
- 'The "value" argument must not be of type number. Received type number'
154
- );
155
- const i = e.valueOf && e.valueOf();
156
- if (i != null && i !== e)
157
- return o.from(i, r, t);
158
- const n = S(e);
159
- if (n) return n;
160
- if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof e[Symbol.toPrimitive] == "function")
161
- return o.from(e[Symbol.toPrimitive]("string"), r, t);
162
- throw new TypeError(
163
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e
164
- );
165
- }
166
- o.from = function(e, r, t) {
167
- return L(e, r, t);
168
- }, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array);
169
- function M(e) {
170
- if (typeof e != "number")
171
- throw new TypeError('"size" argument must be of type number');
172
- if (e < 0)
173
- throw new RangeError('The value "' + e + '" is invalid for option "size"');
174
- }
175
- function U(e, r, t) {
176
- return M(e), e <= 0 ? s(e) : r !== void 0 ? typeof t == "string" ? s(e).fill(r, t) : s(e).fill(r) : s(e);
177
- }
178
- o.alloc = function(e, r, t) {
179
- return U(e, r, t);
180
- };
181
- function R(e) {
182
- return M(e), s(e < 0 ? 0 : b(e) | 0);
183
- }
184
- o.allocUnsafe = function(e) {
185
- return R(e);
186
- }, o.allocUnsafeSlow = function(e) {
187
- return R(e);
188
- };
189
- function k(e, r) {
190
- if ((typeof r != "string" || r === "") && (r = "utf8"), !o.isEncoding(r))
191
- throw new TypeError("Unknown encoding: " + r);
192
- const t = _(e, r) | 0;
193
- let i = s(t);
194
- const n = i.write(e, r);
195
- return n !== t && (i = i.slice(0, n)), i;
196
- }
197
- function p(e) {
198
- const r = e.length < 0 ? 0 : b(e.length) | 0, t = s(r);
199
- for (let i = 0; i < r; i += 1)
200
- t[i] = e[i] & 255;
201
- return t;
202
- }
203
- function a(e) {
204
- if (D(e, Uint8Array)) {
205
- const r = new Uint8Array(e);
206
- return x(r.buffer, r.byteOffset, r.byteLength);
207
- }
208
- return p(e);
209
- }
210
- function x(e, r, t) {
211
- if (r < 0 || e.byteLength < r)
212
- throw new RangeError('"offset" is outside of buffer bounds');
213
- if (e.byteLength < r + (t || 0))
214
- throw new RangeError('"length" is outside of buffer bounds');
215
- let i;
216
- return r === void 0 && t === void 0 ? i = new Uint8Array(e) : t === void 0 ? i = new Uint8Array(e, r) : i = new Uint8Array(e, r, t), Object.setPrototypeOf(i, o.prototype), i;
217
- }
218
- function S(e) {
219
- if (o.isBuffer(e)) {
220
- const r = b(e.length) | 0, t = s(r);
221
- return t.length === 0 || e.copy(t, 0, 0, r), t;
222
- }
223
- if (e.length !== void 0)
224
- return typeof e.length != "number" || X(e.length) ? s(0) : p(e);
225
- if (e.type === "Buffer" && Array.isArray(e.data))
226
- return p(e.data);
227
- }
228
- function b(e) {
229
- if (e >= y)
230
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + y.toString(16) + " bytes");
231
- return e | 0;
232
- }
233
- function T(e) {
234
- return +e != e && (e = 0), o.alloc(+e);
235
- }
236
- o.isBuffer = function(r) {
237
- return r != null && r._isBuffer === !0 && r !== o.prototype;
238
- }, o.compare = function(r, t) {
239
- if (D(r, Uint8Array) && (r = o.from(r, r.offset, r.byteLength)), D(t, Uint8Array) && (t = o.from(t, t.offset, t.byteLength)), !o.isBuffer(r) || !o.isBuffer(t))
240
- throw new TypeError(
241
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
242
- );
243
- if (r === t) return 0;
244
- let i = r.length, n = t.length;
245
- for (let u = 0, h = Math.min(i, n); u < h; ++u)
246
- if (r[u] !== t[u]) {
247
- i = r[u], n = t[u];
248
- break;
249
- }
250
- return i < n ? -1 : n < i ? 1 : 0;
251
- }, o.isEncoding = function(r) {
252
- switch (String(r).toLowerCase()) {
253
- case "hex":
254
- case "utf8":
255
- case "utf-8":
256
- case "ascii":
257
- case "latin1":
258
- case "binary":
259
- case "base64":
260
- case "ucs2":
261
- case "ucs-2":
262
- case "utf16le":
263
- case "utf-16le":
264
- return !0;
265
- default:
266
- return !1;
267
- }
268
- }, o.concat = function(r, t) {
269
- if (!Array.isArray(r))
270
- throw new TypeError('"list" argument must be an Array of Buffers');
271
- if (r.length === 0)
272
- return o.alloc(0);
273
- let i;
274
- if (t === void 0)
275
- for (t = 0, i = 0; i < r.length; ++i)
276
- t += r[i].length;
277
- const n = o.allocUnsafe(t);
278
- let u = 0;
279
- for (i = 0; i < r.length; ++i) {
280
- let h = r[i];
281
- if (D(h, Uint8Array))
282
- u + h.length > n.length ? (o.isBuffer(h) || (h = o.from(h)), h.copy(n, u)) : Uint8Array.prototype.set.call(
283
- n,
284
- h,
285
- u
286
- );
287
- else if (o.isBuffer(h))
288
- h.copy(n, u);
289
- else
290
- throw new TypeError('"list" argument must be an Array of Buffers');
291
- u += h.length;
292
- }
293
- return n;
294
- };
295
- function _(e, r) {
296
- if (o.isBuffer(e))
297
- return e.length;
298
- if (ArrayBuffer.isView(e) || D(e, ArrayBuffer))
299
- return e.byteLength;
300
- if (typeof e != "string")
301
- throw new TypeError(
302
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof e
303
- );
304
- const t = e.length, i = arguments.length > 2 && arguments[2] === !0;
305
- if (!i && t === 0) return 0;
306
- let n = !1;
307
- for (; ; )
308
- switch (r) {
309
- case "ascii":
310
- case "latin1":
311
- case "binary":
312
- return t;
313
- case "utf8":
314
- case "utf-8":
315
- return Y(e).length;
316
- case "ucs2":
317
- case "ucs-2":
318
- case "utf16le":
319
- case "utf-16le":
320
- return t * 2;
321
- case "hex":
322
- return t >>> 1;
323
- case "base64":
324
- return sr(e).length;
325
- default:
326
- if (n)
327
- return i ? -1 : Y(e).length;
328
- r = ("" + r).toLowerCase(), n = !0;
329
- }
330
- }
331
- o.byteLength = _;
332
- function $(e, r, t) {
333
- let i = !1;
334
- if ((r === void 0 || r < 0) && (r = 0), r > this.length || ((t === void 0 || t > this.length) && (t = this.length), t <= 0) || (t >>>= 0, r >>>= 0, t <= r))
335
- return "";
336
- for (e || (e = "utf8"); ; )
337
- switch (e) {
338
- case "hex":
339
- return Ur(this, r, t);
340
- case "utf8":
341
- case "utf-8":
342
- return er(this, r, t);
343
- case "ascii":
344
- return Fr(this, r, t);
345
- case "latin1":
346
- case "binary":
347
- return Ar(this, r, t);
348
- case "base64":
349
- return gr(this, r, t);
350
- case "ucs2":
351
- case "ucs-2":
352
- case "utf16le":
353
- case "utf-16le":
354
- return Rr(this, r, t);
355
- default:
356
- if (i) throw new TypeError("Unknown encoding: " + e);
357
- e = (e + "").toLowerCase(), i = !0;
358
- }
359
- }
360
- o.prototype._isBuffer = !0;
361
- function A(e, r, t) {
362
- const i = e[r];
363
- e[r] = e[t], e[t] = i;
364
- }
365
- o.prototype.swap16 = function() {
366
- const r = this.length;
367
- if (r % 2 !== 0)
368
- throw new RangeError("Buffer size must be a multiple of 16-bits");
369
- for (let t = 0; t < r; t += 2)
370
- A(this, t, t + 1);
371
- return this;
372
- }, o.prototype.swap32 = function() {
373
- const r = this.length;
374
- if (r % 4 !== 0)
375
- throw new RangeError("Buffer size must be a multiple of 32-bits");
376
- for (let t = 0; t < r; t += 4)
377
- A(this, t, t + 3), A(this, t + 1, t + 2);
378
- return this;
379
- }, o.prototype.swap64 = function() {
380
- const r = this.length;
381
- if (r % 8 !== 0)
382
- throw new RangeError("Buffer size must be a multiple of 64-bits");
383
- for (let t = 0; t < r; t += 8)
384
- A(this, t, t + 7), A(this, t + 1, t + 6), A(this, t + 2, t + 5), A(this, t + 3, t + 4);
385
- return this;
386
- }, o.prototype.toString = function() {
387
- const r = this.length;
388
- return r === 0 ? "" : arguments.length === 0 ? er(this, 0, r) : $.apply(this, arguments);
389
- }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(r) {
390
- if (!o.isBuffer(r)) throw new TypeError("Argument must be a Buffer");
391
- return this === r ? !0 : o.compare(this, r) === 0;
392
- }, o.prototype.inspect = function() {
393
- let r = "";
394
- const t = c.INSPECT_MAX_BYTES;
395
- return r = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (r += " ... "), "<Buffer " + r + ">";
396
- }, I && (o.prototype[I] = o.prototype.inspect), o.prototype.compare = function(r, t, i, n, u) {
397
- if (D(r, Uint8Array) && (r = o.from(r, r.offset, r.byteLength)), !o.isBuffer(r))
398
- throw new TypeError(
399
- 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof r
400
- );
401
- if (t === void 0 && (t = 0), i === void 0 && (i = r ? r.length : 0), n === void 0 && (n = 0), u === void 0 && (u = this.length), t < 0 || i > r.length || n < 0 || u > this.length)
402
- throw new RangeError("out of range index");
403
- if (n >= u && t >= i)
404
- return 0;
405
- if (n >= u)
406
- return -1;
407
- if (t >= i)
408
- return 1;
409
- if (t >>>= 0, i >>>= 0, n >>>= 0, u >>>= 0, this === r) return 0;
410
- let h = u - n, l = i - t;
411
- const E = Math.min(h, l), B = this.slice(n, u), g = r.slice(t, i);
412
- for (let d = 0; d < E; ++d)
413
- if (B[d] !== g[d]) {
414
- h = B[d], l = g[d];
415
- break;
416
- }
417
- return h < l ? -1 : l < h ? 1 : 0;
418
- };
419
- function rr(e, r, t, i, n) {
420
- if (e.length === 0) return -1;
421
- if (typeof t == "string" ? (i = t, t = 0) : t > 2147483647 ? t = 2147483647 : t < -2147483648 && (t = -2147483648), t = +t, X(t) && (t = n ? 0 : e.length - 1), t < 0 && (t = e.length + t), t >= e.length) {
422
- if (n) return -1;
423
- t = e.length - 1;
424
- } else if (t < 0)
425
- if (n) t = 0;
426
- else return -1;
427
- if (typeof r == "string" && (r = o.from(r, i)), o.isBuffer(r))
428
- return r.length === 0 ? -1 : tr(e, r, t, i, n);
429
- if (typeof r == "number")
430
- return r = r & 255, typeof Uint8Array.prototype.indexOf == "function" ? n ? Uint8Array.prototype.indexOf.call(e, r, t) : Uint8Array.prototype.lastIndexOf.call(e, r, t) : tr(e, [r], t, i, n);
431
- throw new TypeError("val must be string, number or Buffer");
432
- }
433
- function tr(e, r, t, i, n) {
434
- let u = 1, h = e.length, l = r.length;
435
- if (i !== void 0 && (i = String(i).toLowerCase(), i === "ucs2" || i === "ucs-2" || i === "utf16le" || i === "utf-16le")) {
436
- if (e.length < 2 || r.length < 2)
437
- return -1;
438
- u = 2, h /= 2, l /= 2, t /= 2;
439
- }
440
- function E(g, d) {
441
- return u === 1 ? g[d] : g.readUInt16BE(d * u);
442
- }
443
- let B;
444
- if (n) {
445
- let g = -1;
446
- for (B = t; B < h; B++)
447
- if (E(e, B) === E(r, g === -1 ? 0 : B - g)) {
448
- if (g === -1 && (g = B), B - g + 1 === l) return g * u;
449
- } else
450
- g !== -1 && (B -= B - g), g = -1;
451
- } else
452
- for (t + l > h && (t = h - l), B = t; B >= 0; B--) {
453
- let g = !0;
454
- for (let d = 0; d < l; d++)
455
- if (E(e, B + d) !== E(r, d)) {
456
- g = !1;
457
- break;
458
- }
459
- if (g) return B;
460
- }
461
- return -1;
462
- }
463
- o.prototype.includes = function(r, t, i) {
464
- return this.indexOf(r, t, i) !== -1;
465
- }, o.prototype.indexOf = function(r, t, i) {
466
- return rr(this, r, t, i, !0);
467
- }, o.prototype.lastIndexOf = function(r, t, i) {
468
- return rr(this, r, t, i, !1);
469
- };
470
- function xr(e, r, t, i) {
471
- t = Number(t) || 0;
472
- const n = e.length - t;
473
- i ? (i = Number(i), i > n && (i = n)) : i = n;
474
- const u = r.length;
475
- i > u / 2 && (i = u / 2);
476
- let h;
477
- for (h = 0; h < i; ++h) {
478
- const l = parseInt(r.substr(h * 2, 2), 16);
479
- if (X(l)) return h;
480
- e[t + h] = l;
481
- }
482
- return h;
483
- }
484
- function dr(e, r, t, i) {
485
- return V(Y(r, e.length - t), e, t, i);
486
- }
487
- function Br(e, r, t, i) {
488
- return V(br(r), e, t, i);
489
- }
490
- function mr(e, r, t, i) {
491
- return V(sr(r), e, t, i);
492
- }
493
- function Er(e, r, t, i) {
494
- return V(_r(r, e.length - t), e, t, i);
495
- }
496
- o.prototype.write = function(r, t, i, n) {
497
- if (t === void 0)
498
- n = "utf8", i = this.length, t = 0;
499
- else if (i === void 0 && typeof t == "string")
500
- n = t, i = this.length, t = 0;
501
- else if (isFinite(t))
502
- t = t >>> 0, isFinite(i) ? (i = i >>> 0, n === void 0 && (n = "utf8")) : (n = i, i = void 0);
503
- else
504
- throw new Error(
505
- "Buffer.write(string, encoding, offset[, length]) is no longer supported"
506
- );
507
- const u = this.length - t;
508
- if ((i === void 0 || i > u) && (i = u), r.length > 0 && (i < 0 || t < 0) || t > this.length)
509
- throw new RangeError("Attempt to write outside buffer bounds");
510
- n || (n = "utf8");
511
- let h = !1;
512
- for (; ; )
513
- switch (n) {
514
- case "hex":
515
- return xr(this, r, t, i);
516
- case "utf8":
517
- case "utf-8":
518
- return dr(this, r, t, i);
519
- case "ascii":
520
- case "latin1":
521
- case "binary":
522
- return Br(this, r, t, i);
523
- case "base64":
524
- return mr(this, r, t, i);
525
- case "ucs2":
526
- case "ucs-2":
527
- case "utf16le":
528
- case "utf-16le":
529
- return Er(this, r, t, i);
530
- default:
531
- if (h) throw new TypeError("Unknown encoding: " + n);
532
- n = ("" + n).toLowerCase(), h = !0;
533
- }
534
- }, o.prototype.toJSON = function() {
535
- return {
536
- type: "Buffer",
537
- data: Array.prototype.slice.call(this._arr || this, 0)
538
- };
539
- };
540
- function gr(e, r, t) {
541
- return r === 0 && t === e.length ? f.fromByteArray(e) : f.fromByteArray(e.slice(r, t));
542
- }
543
- function er(e, r, t) {
544
- t = Math.min(e.length, t);
545
- const i = [];
546
- let n = r;
547
- for (; n < t; ) {
548
- const u = e[n];
549
- let h = null, l = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1;
550
- if (n + l <= t) {
551
- let E, B, g, d;
552
- switch (l) {
553
- case 1:
554
- u < 128 && (h = u);
555
- break;
556
- case 2:
557
- E = e[n + 1], (E & 192) === 128 && (d = (u & 31) << 6 | E & 63, d > 127 && (h = d));
558
- break;
559
- case 3:
560
- E = e[n + 1], B = e[n + 2], (E & 192) === 128 && (B & 192) === 128 && (d = (u & 15) << 12 | (E & 63) << 6 | B & 63, d > 2047 && (d < 55296 || d > 57343) && (h = d));
561
- break;
562
- case 4:
563
- E = e[n + 1], B = e[n + 2], g = e[n + 3], (E & 192) === 128 && (B & 192) === 128 && (g & 192) === 128 && (d = (u & 15) << 18 | (E & 63) << 12 | (B & 63) << 6 | g & 63, d > 65535 && d < 1114112 && (h = d));
564
- }
565
- }
566
- h === null ? (h = 65533, l = 1) : h > 65535 && (h -= 65536, i.push(h >>> 10 & 1023 | 55296), h = 56320 | h & 1023), i.push(h), n += l;
567
- }
568
- return Ir(i);
569
- }
570
- const ir = 4096;
571
- function Ir(e) {
572
- const r = e.length;
573
- if (r <= ir)
574
- return String.fromCharCode.apply(String, e);
575
- let t = "", i = 0;
576
- for (; i < r; )
577
- t += String.fromCharCode.apply(
578
- String,
579
- e.slice(i, i += ir)
580
- );
581
- return t;
582
- }
583
- function Fr(e, r, t) {
584
- let i = "";
585
- t = Math.min(e.length, t);
586
- for (let n = r; n < t; ++n)
587
- i += String.fromCharCode(e[n] & 127);
588
- return i;
589
- }
590
- function Ar(e, r, t) {
591
- let i = "";
592
- t = Math.min(e.length, t);
593
- for (let n = r; n < t; ++n)
594
- i += String.fromCharCode(e[n]);
595
- return i;
596
- }
597
- function Ur(e, r, t) {
598
- const i = e.length;
599
- (!r || r < 0) && (r = 0), (!t || t < 0 || t > i) && (t = i);
600
- let n = "";
601
- for (let u = r; u < t; ++u)
602
- n += Lr[e[u]];
603
- return n;
604
- }
605
- function Rr(e, r, t) {
606
- const i = e.slice(r, t);
607
- let n = "";
608
- for (let u = 0; u < i.length - 1; u += 2)
609
- n += String.fromCharCode(i[u] + i[u + 1] * 256);
610
- return n;
611
- }
612
- o.prototype.slice = function(r, t) {
613
- const i = this.length;
614
- r = ~~r, t = t === void 0 ? i : ~~t, r < 0 ? (r += i, r < 0 && (r = 0)) : r > i && (r = i), t < 0 ? (t += i, t < 0 && (t = 0)) : t > i && (t = i), t < r && (t = r);
615
- const n = this.subarray(r, t);
616
- return Object.setPrototypeOf(n, o.prototype), n;
617
- };
618
- function C(e, r, t) {
619
- if (e % 1 !== 0 || e < 0) throw new RangeError("offset is not uint");
620
- if (e + r > t) throw new RangeError("Trying to access beyond buffer length");
621
- }
622
- o.prototype.readUintLE = o.prototype.readUIntLE = function(r, t, i) {
623
- r = r >>> 0, t = t >>> 0, i || C(r, t, this.length);
624
- let n = this[r], u = 1, h = 0;
625
- for (; ++h < t && (u *= 256); )
626
- n += this[r + h] * u;
627
- return n;
628
- }, o.prototype.readUintBE = o.prototype.readUIntBE = function(r, t, i) {
629
- r = r >>> 0, t = t >>> 0, i || C(r, t, this.length);
630
- let n = this[r + --t], u = 1;
631
- for (; t > 0 && (u *= 256); )
632
- n += this[r + --t] * u;
633
- return n;
634
- }, o.prototype.readUint8 = o.prototype.readUInt8 = function(r, t) {
635
- return r = r >>> 0, t || C(r, 1, this.length), this[r];
636
- }, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(r, t) {
637
- return r = r >>> 0, t || C(r, 2, this.length), this[r] | this[r + 1] << 8;
638
- }, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(r, t) {
639
- return r = r >>> 0, t || C(r, 2, this.length), this[r] << 8 | this[r + 1];
640
- }, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(r, t) {
641
- return r = r >>> 0, t || C(r, 4, this.length), (this[r] | this[r + 1] << 8 | this[r + 2] << 16) + this[r + 3] * 16777216;
642
- }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(r, t) {
643
- return r = r >>> 0, t || C(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
644
- }, o.prototype.readBigUInt64LE = P(function(r) {
645
- r = r >>> 0, q(r, "offset");
646
- const t = this[r], i = this[r + 7];
647
- (t === void 0 || i === void 0) && G(r, this.length - 8);
648
- const n = t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, u = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + i * 2 ** 24;
649
- return BigInt(n) + (BigInt(u) << BigInt(32));
650
- }), o.prototype.readBigUInt64BE = P(function(r) {
651
- r = r >>> 0, q(r, "offset");
652
- const t = this[r], i = this[r + 7];
653
- (t === void 0 || i === void 0) && G(r, this.length - 8);
654
- const n = t * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r], u = this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + i;
655
- return (BigInt(n) << BigInt(32)) + BigInt(u);
656
- }), o.prototype.readIntLE = function(r, t, i) {
657
- r = r >>> 0, t = t >>> 0, i || C(r, t, this.length);
658
- let n = this[r], u = 1, h = 0;
659
- for (; ++h < t && (u *= 256); )
660
- n += this[r + h] * u;
661
- return u *= 128, n >= u && (n -= Math.pow(2, 8 * t)), n;
662
- }, o.prototype.readIntBE = function(r, t, i) {
663
- r = r >>> 0, t = t >>> 0, i || C(r, t, this.length);
664
- let n = t, u = 1, h = this[r + --n];
665
- for (; n > 0 && (u *= 256); )
666
- h += this[r + --n] * u;
667
- return u *= 128, h >= u && (h -= Math.pow(2, 8 * t)), h;
668
- }, o.prototype.readInt8 = function(r, t) {
669
- return r = r >>> 0, t || C(r, 1, this.length), this[r] & 128 ? (255 - this[r] + 1) * -1 : this[r];
670
- }, o.prototype.readInt16LE = function(r, t) {
671
- r = r >>> 0, t || C(r, 2, this.length);
672
- const i = this[r] | this[r + 1] << 8;
673
- return i & 32768 ? i | 4294901760 : i;
674
- }, o.prototype.readInt16BE = function(r, t) {
675
- r = r >>> 0, t || C(r, 2, this.length);
676
- const i = this[r + 1] | this[r] << 8;
677
- return i & 32768 ? i | 4294901760 : i;
678
- }, o.prototype.readInt32LE = function(r, t) {
679
- return r = r >>> 0, t || C(r, 4, this.length), this[r] | this[r + 1] << 8 | this[r + 2] << 16 | this[r + 3] << 24;
680
- }, o.prototype.readInt32BE = function(r, t) {
681
- return r = r >>> 0, t || C(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
682
- }, o.prototype.readBigInt64LE = P(function(r) {
683
- r = r >>> 0, q(r, "offset");
684
- const t = this[r], i = this[r + 7];
685
- (t === void 0 || i === void 0) && G(r, this.length - 8);
686
- const n = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (i << 24);
687
- return (BigInt(n) << BigInt(32)) + BigInt(t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
688
- }), o.prototype.readBigInt64BE = P(function(r) {
689
- r = r >>> 0, q(r, "offset");
690
- const t = this[r], i = this[r + 7];
691
- (t === void 0 || i === void 0) && G(r, this.length - 8);
692
- const n = (t << 24) + // Overflow
693
- this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r];
694
- return (BigInt(n) << BigInt(32)) + BigInt(this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + i);
695
- }), o.prototype.readFloatLE = function(r, t) {
696
- return r = r >>> 0, t || C(r, 4, this.length), w.read(this, r, !0, 23, 4);
697
- }, o.prototype.readFloatBE = function(r, t) {
698
- return r = r >>> 0, t || C(r, 4, this.length), w.read(this, r, !1, 23, 4);
699
- }, o.prototype.readDoubleLE = function(r, t) {
700
- return r = r >>> 0, t || C(r, 8, this.length), w.read(this, r, !0, 52, 8);
701
- }, o.prototype.readDoubleBE = function(r, t) {
702
- return r = r >>> 0, t || C(r, 8, this.length), w.read(this, r, !1, 52, 8);
703
- };
704
- function N(e, r, t, i, n, u) {
705
- if (!o.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
706
- if (r > n || r < u) throw new RangeError('"value" argument is out of bounds');
707
- if (t + i > e.length) throw new RangeError("Index out of range");
708
- }
709
- o.prototype.writeUintLE = o.prototype.writeUIntLE = function(r, t, i, n) {
710
- if (r = +r, t = t >>> 0, i = i >>> 0, !n) {
711
- const l = Math.pow(2, 8 * i) - 1;
712
- N(this, r, t, i, l, 0);
713
- }
714
- let u = 1, h = 0;
715
- for (this[t] = r & 255; ++h < i && (u *= 256); )
716
- this[t + h] = r / u & 255;
717
- return t + i;
718
- }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(r, t, i, n) {
719
- if (r = +r, t = t >>> 0, i = i >>> 0, !n) {
720
- const l = Math.pow(2, 8 * i) - 1;
721
- N(this, r, t, i, l, 0);
722
- }
723
- let u = i - 1, h = 1;
724
- for (this[t + u] = r & 255; --u >= 0 && (h *= 256); )
725
- this[t + u] = r / h & 255;
726
- return t + i;
727
- }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(r, t, i) {
728
- return r = +r, t = t >>> 0, i || N(this, r, t, 1, 255, 0), this[t] = r & 255, t + 1;
729
- }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(r, t, i) {
730
- return r = +r, t = t >>> 0, i || N(this, r, t, 2, 65535, 0), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
731
- }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(r, t, i) {
732
- return r = +r, t = t >>> 0, i || N(this, r, t, 2, 65535, 0), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
733
- }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(r, t, i) {
734
- return r = +r, t = t >>> 0, i || N(this, r, t, 4, 4294967295, 0), this[t + 3] = r >>> 24, this[t + 2] = r >>> 16, this[t + 1] = r >>> 8, this[t] = r & 255, t + 4;
735
- }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(r, t, i) {
736
- return r = +r, t = t >>> 0, i || N(this, r, t, 4, 4294967295, 0), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
737
- };
738
- function nr(e, r, t, i, n) {
739
- pr(r, i, n, e, t, 7);
740
- let u = Number(r & BigInt(4294967295));
741
- e[t++] = u, u = u >> 8, e[t++] = u, u = u >> 8, e[t++] = u, u = u >> 8, e[t++] = u;
742
- let h = Number(r >> BigInt(32) & BigInt(4294967295));
743
- return e[t++] = h, h = h >> 8, e[t++] = h, h = h >> 8, e[t++] = h, h = h >> 8, e[t++] = h, t;
744
- }
745
- function or(e, r, t, i, n) {
746
- pr(r, i, n, e, t, 7);
747
- let u = Number(r & BigInt(4294967295));
748
- e[t + 7] = u, u = u >> 8, e[t + 6] = u, u = u >> 8, e[t + 5] = u, u = u >> 8, e[t + 4] = u;
749
- let h = Number(r >> BigInt(32) & BigInt(4294967295));
750
- return e[t + 3] = h, h = h >> 8, e[t + 2] = h, h = h >> 8, e[t + 1] = h, h = h >> 8, e[t] = h, t + 8;
751
- }
752
- o.prototype.writeBigUInt64LE = P(function(r, t = 0) {
753
- return nr(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
754
- }), o.prototype.writeBigUInt64BE = P(function(r, t = 0) {
755
- return or(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
756
- }), o.prototype.writeIntLE = function(r, t, i, n) {
757
- if (r = +r, t = t >>> 0, !n) {
758
- const E = Math.pow(2, 8 * i - 1);
759
- N(this, r, t, i, E - 1, -E);
760
- }
761
- let u = 0, h = 1, l = 0;
762
- for (this[t] = r & 255; ++u < i && (h *= 256); )
763
- r < 0 && l === 0 && this[t + u - 1] !== 0 && (l = 1), this[t + u] = (r / h >> 0) - l & 255;
764
- return t + i;
765
- }, o.prototype.writeIntBE = function(r, t, i, n) {
766
- if (r = +r, t = t >>> 0, !n) {
767
- const E = Math.pow(2, 8 * i - 1);
768
- N(this, r, t, i, E - 1, -E);
769
- }
770
- let u = i - 1, h = 1, l = 0;
771
- for (this[t + u] = r & 255; --u >= 0 && (h *= 256); )
772
- r < 0 && l === 0 && this[t + u + 1] !== 0 && (l = 1), this[t + u] = (r / h >> 0) - l & 255;
773
- return t + i;
774
- }, o.prototype.writeInt8 = function(r, t, i) {
775
- return r = +r, t = t >>> 0, i || N(this, r, t, 1, 127, -128), r < 0 && (r = 255 + r + 1), this[t] = r & 255, t + 1;
776
- }, o.prototype.writeInt16LE = function(r, t, i) {
777
- return r = +r, t = t >>> 0, i || N(this, r, t, 2, 32767, -32768), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
778
- }, o.prototype.writeInt16BE = function(r, t, i) {
779
- return r = +r, t = t >>> 0, i || N(this, r, t, 2, 32767, -32768), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
780
- }, o.prototype.writeInt32LE = function(r, t, i) {
781
- return r = +r, t = t >>> 0, i || N(this, r, t, 4, 2147483647, -2147483648), this[t] = r & 255, this[t + 1] = r >>> 8, this[t + 2] = r >>> 16, this[t + 3] = r >>> 24, t + 4;
782
- }, o.prototype.writeInt32BE = function(r, t, i) {
783
- return r = +r, t = t >>> 0, i || N(this, r, t, 4, 2147483647, -2147483648), r < 0 && (r = 4294967295 + r + 1), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
784
- }, o.prototype.writeBigInt64LE = P(function(r, t = 0) {
785
- return nr(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
786
- }), o.prototype.writeBigInt64BE = P(function(r, t = 0) {
787
- return or(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
788
- });
789
- function ur(e, r, t, i, n, u) {
790
- if (t + i > e.length) throw new RangeError("Index out of range");
791
- if (t < 0) throw new RangeError("Index out of range");
792
- }
793
- function hr(e, r, t, i, n) {
794
- return r = +r, t = t >>> 0, n || ur(e, r, t, 4), w.write(e, r, t, i, 23, 4), t + 4;
795
- }
796
- o.prototype.writeFloatLE = function(r, t, i) {
797
- return hr(this, r, t, !0, i);
798
- }, o.prototype.writeFloatBE = function(r, t, i) {
799
- return hr(this, r, t, !1, i);
800
- };
801
- function cr(e, r, t, i, n) {
802
- return r = +r, t = t >>> 0, n || ur(e, r, t, 8), w.write(e, r, t, i, 52, 8), t + 8;
803
- }
804
- o.prototype.writeDoubleLE = function(r, t, i) {
805
- return cr(this, r, t, !0, i);
806
- }, o.prototype.writeDoubleBE = function(r, t, i) {
807
- return cr(this, r, t, !1, i);
808
- }, o.prototype.copy = function(r, t, i, n) {
809
- if (!o.isBuffer(r)) throw new TypeError("argument should be a Buffer");
810
- if (i || (i = 0), !n && n !== 0 && (n = this.length), t >= r.length && (t = r.length), t || (t = 0), n > 0 && n < i && (n = i), n === i || r.length === 0 || this.length === 0) return 0;
811
- if (t < 0)
812
- throw new RangeError("targetStart out of bounds");
813
- if (i < 0 || i >= this.length) throw new RangeError("Index out of range");
814
- if (n < 0) throw new RangeError("sourceEnd out of bounds");
815
- n > this.length && (n = this.length), r.length - t < n - i && (n = r.length - t + i);
816
- const u = n - i;
817
- return this === r && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(t, i, n) : Uint8Array.prototype.set.call(
818
- r,
819
- this.subarray(i, n),
820
- t
821
- ), u;
822
- }, o.prototype.fill = function(r, t, i, n) {
823
- if (typeof r == "string") {
824
- if (typeof t == "string" ? (n = t, t = 0, i = this.length) : typeof i == "string" && (n = i, i = this.length), n !== void 0 && typeof n != "string")
825
- throw new TypeError("encoding must be a string");
826
- if (typeof n == "string" && !o.isEncoding(n))
827
- throw new TypeError("Unknown encoding: " + n);
828
- if (r.length === 1) {
829
- const h = r.charCodeAt(0);
830
- (n === "utf8" && h < 128 || n === "latin1") && (r = h);
831
- }
832
- } else typeof r == "number" ? r = r & 255 : typeof r == "boolean" && (r = Number(r));
833
- if (t < 0 || this.length < t || this.length < i)
834
- throw new RangeError("Out of range index");
835
- if (i <= t)
836
- return this;
837
- t = t >>> 0, i = i === void 0 ? this.length : i >>> 0, r || (r = 0);
838
- let u;
839
- if (typeof r == "number")
840
- for (u = t; u < i; ++u)
841
- this[u] = r;
842
- else {
843
- const h = o.isBuffer(r) ? r : o.from(r, n), l = h.length;
844
- if (l === 0)
845
- throw new TypeError('The value "' + r + '" is invalid for argument "value"');
846
- for (u = 0; u < i - t; ++u)
847
- this[u + t] = h[u % l];
848
- }
849
- return this;
850
- };
851
- const O = {};
852
- function W(e, r, t) {
853
- O[e] = class extends t {
854
- constructor() {
855
- super(), Object.defineProperty(this, "message", {
856
- value: r.apply(this, arguments),
857
- writable: !0,
858
- configurable: !0
859
- }), this.name = `${this.name} [${e}]`, this.stack, delete this.name;
860
- }
861
- get code() {
862
- return e;
863
- }
864
- set code(n) {
865
- Object.defineProperty(this, "code", {
866
- configurable: !0,
867
- enumerable: !0,
868
- value: n,
869
- writable: !0
870
- });
871
- }
872
- toString() {
873
- return `${this.name} [${e}]: ${this.message}`;
874
- }
875
- };
876
- }
877
- W(
878
- "ERR_BUFFER_OUT_OF_BOUNDS",
879
- function(e) {
880
- return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
881
- },
882
- RangeError
883
- ), W(
884
- "ERR_INVALID_ARG_TYPE",
885
- function(e, r) {
886
- return `The "${e}" argument must be of type number. Received type ${typeof r}`;
887
- },
888
- TypeError
889
- ), W(
890
- "ERR_OUT_OF_RANGE",
891
- function(e, r, t) {
892
- let i = `The value of "${e}" is out of range.`, n = t;
893
- return Number.isInteger(t) && Math.abs(t) > 2 ** 32 ? n = fr(String(t)) : typeof t == "bigint" && (n = String(t), (t > BigInt(2) ** BigInt(32) || t < -(BigInt(2) ** BigInt(32))) && (n = fr(n)), n += "n"), i += ` It must be ${r}. Received ${n}`, i;
894
- },
895
- RangeError
896
- );
897
- function fr(e) {
898
- let r = "", t = e.length;
899
- const i = e[0] === "-" ? 1 : 0;
900
- for (; t >= i + 4; t -= 3)
901
- r = `_${e.slice(t - 3, t)}${r}`;
902
- return `${e.slice(0, t)}${r}`;
903
- }
904
- function Tr(e, r, t) {
905
- q(r, "offset"), (e[r] === void 0 || e[r + t] === void 0) && G(r, e.length - (t + 1));
906
- }
907
- function pr(e, r, t, i, n, u) {
908
- if (e > t || e < r) {
909
- const h = typeof r == "bigint" ? "n" : "";
910
- let l;
911
- throw r === 0 || r === BigInt(0) ? l = `>= 0${h} and < 2${h} ** ${(u + 1) * 8}${h}` : l = `>= -(2${h} ** ${(u + 1) * 8 - 1}${h}) and < 2 ** ${(u + 1) * 8 - 1}${h}`, new O.ERR_OUT_OF_RANGE("value", l, e);
912
- }
913
- Tr(i, n, u);
914
- }
915
- function q(e, r) {
916
- if (typeof e != "number")
917
- throw new O.ERR_INVALID_ARG_TYPE(r, "number", e);
918
- }
919
- function G(e, r, t) {
920
- throw Math.floor(e) !== e ? (q(e, t), new O.ERR_OUT_OF_RANGE("offset", "an integer", e)) : r < 0 ? new O.ERR_BUFFER_OUT_OF_BOUNDS() : new O.ERR_OUT_OF_RANGE(
921
- "offset",
922
- `>= 0 and <= ${r}`,
923
- e
924
- );
925
- }
926
- const Cr = /[^+/0-9A-Za-z-_]/g;
927
- function Sr(e) {
928
- if (e = e.split("=")[0], e = e.trim().replace(Cr, ""), e.length < 2) return "";
929
- for (; e.length % 4 !== 0; )
930
- e = e + "=";
931
- return e;
932
- }
933
- function Y(e, r) {
934
- r = r || 1 / 0;
935
- let t;
936
- const i = e.length;
937
- let n = null;
938
- const u = [];
939
- for (let h = 0; h < i; ++h) {
940
- if (t = e.charCodeAt(h), t > 55295 && t < 57344) {
941
- if (!n) {
942
- if (t > 56319) {
943
- (r -= 3) > -1 && u.push(239, 191, 189);
944
- continue;
945
- } else if (h + 1 === i) {
946
- (r -= 3) > -1 && u.push(239, 191, 189);
947
- continue;
948
- }
949
- n = t;
950
- continue;
951
- }
952
- if (t < 56320) {
953
- (r -= 3) > -1 && u.push(239, 191, 189), n = t;
954
- continue;
955
- }
956
- t = (n - 55296 << 10 | t - 56320) + 65536;
957
- } else n && (r -= 3) > -1 && u.push(239, 191, 189);
958
- if (n = null, t < 128) {
959
- if ((r -= 1) < 0) break;
960
- u.push(t);
961
- } else if (t < 2048) {
962
- if ((r -= 2) < 0) break;
963
- u.push(
964
- t >> 6 | 192,
965
- t & 63 | 128
966
- );
967
- } else if (t < 65536) {
968
- if ((r -= 3) < 0) break;
969
- u.push(
970
- t >> 12 | 224,
971
- t >> 6 & 63 | 128,
972
- t & 63 | 128
973
- );
974
- } else if (t < 1114112) {
975
- if ((r -= 4) < 0) break;
976
- u.push(
977
- t >> 18 | 240,
978
- t >> 12 & 63 | 128,
979
- t >> 6 & 63 | 128,
980
- t & 63 | 128
981
- );
982
- } else
983
- throw new Error("Invalid code point");
984
- }
985
- return u;
986
- }
987
- function br(e) {
988
- const r = [];
989
- for (let t = 0; t < e.length; ++t)
990
- r.push(e.charCodeAt(t) & 255);
991
- return r;
992
- }
993
- function _r(e, r) {
994
- let t, i, n;
995
- const u = [];
996
- for (let h = 0; h < e.length && !((r -= 2) < 0); ++h)
997
- t = e.charCodeAt(h), i = t >> 8, n = t % 256, u.push(n), u.push(i);
998
- return u;
999
- }
1000
- function sr(e) {
1001
- return f.toByteArray(Sr(e));
1002
- }
1003
- function V(e, r, t, i) {
1004
- let n;
1005
- for (n = 0; n < i && !(n + t >= r.length || n >= e.length); ++n)
1006
- r[n + t] = e[n];
1007
- return n;
1008
- }
1009
- function D(e, r) {
1010
- return e instanceof r || e != null && e.constructor != null && e.constructor.name != null && e.constructor.name === r.name;
1011
- }
1012
- function X(e) {
1013
- return e !== e;
1014
- }
1015
- const Lr = function() {
1016
- const e = "0123456789abcdef", r = new Array(256);
1017
- for (let t = 0; t < 16; ++t) {
1018
- const i = t * 16;
1019
- for (let n = 0; n < 16; ++n)
1020
- r[i + n] = e[t] + e[n];
1021
- }
1022
- return r;
1023
- }();
1024
- function P(e) {
1025
- return typeof BigInt > "u" ? Nr : e;
1026
- }
1027
- function Nr() {
1028
- throw new Error("BigInt not supported");
1029
- }
1030
- }(z)), z;
1031
- }
1032
- var Jr = Vr();
1033
- function Z({
1034
- content: c,
1035
- encoding: f,
1036
- mimeType: w
1037
- }) {
1038
- const I = Pr(w);
1039
- if (I === "Img")
1040
- return /* @__PURE__ */ F(
1041
- "img",
1042
- {
1043
- src: `data:${w};base64,${c}`,
1044
- alt: "HAR entry content",
1045
- style: { maxWidth: "100%", maxHeight: 400 }
1046
- }
1047
- );
1048
- let y = c;
1049
- f === "base64" && (y = Jr.Buffer.from(c, f).toString("utf8"));
1050
- let m = y;
1051
- if (I === "JSON")
1052
- try {
1053
- m = JSON.stringify(JSON.parse(y), null, 2);
1054
- } catch (o) {
1055
- console.error("Failed to parse JSON content", o);
1056
- }
1057
- const s = $r(w);
1058
- return /* @__PURE__ */ F(
1059
- kr,
1060
- {
1061
- lineNumbers: !0,
1062
- content: m,
1063
- highlight: s,
1064
- actions: /* @__PURE__ */ F(Dr, { copyErrorText: "Copy failed", copySuccessText: "Copied", textToCopy: m })
1065
- }
1066
- );
1067
- }
1068
- function v({ title: c, children: f }) {
1069
- return /* @__PURE__ */ Q(qr, { variant: "container", headerText: c, defaultExpanded: !0, children: [
1070
- /* @__PURE__ */ F(K, { margin: { top: "s" } }),
1071
- f
1072
- ] });
1073
- }
1074
- function j({ title: c, items: f = [] }) {
1075
- return /* @__PURE__ */ F(v, { title: c, children: /* @__PURE__ */ F(Or, { borders: "horizontal", columns: 2, children: f.reduce((w, { name: I, value: y }) => (w.push(/* @__PURE__ */ F(K, { variant: "awsui-key-label", children: I })), w.push(/* @__PURE__ */ F(K, { variant: "p", children: y || "-" })), w), []) }) });
1076
- }
1077
- function jr({ harEntry: c }) {
1078
- return /* @__PURE__ */ Q(wr, { children: [
1079
- /* @__PURE__ */ F(
1080
- j,
1081
- {
1082
- title: "General",
1083
- items: [
1084
- {
1085
- name: "URL",
1086
- value: c.request.url
1087
- },
1088
- {
1089
- name: "Method",
1090
- value: c.request.method
1091
- },
1092
- {
1093
- name: "Status",
1094
- value: `${c.response.status}`
1095
- }
1096
- ]
1097
- }
1098
- ),
1099
- /* @__PURE__ */ F(j, { title: "Request Headers", items: c.request.headers }),
1100
- /* @__PURE__ */ F(j, { title: "Response Headers", items: c.response.headers })
1101
- ] });
1102
- }
1103
- function Wr({ harEntry: c }) {
1104
- const f = c.request.postData?.text ?? "", w = c.request.postData?.mimeType;
1105
- return /* @__PURE__ */ Q(wr, { children: [
1106
- /* @__PURE__ */ F(j, { title: "Query Parameters", items: c.request.queryString }),
1107
- /* @__PURE__ */ F(v, { title: "Request Payload", children: /* @__PURE__ */ F(Z, { content: f, mimeType: w }) })
1108
- ] });
1109
- }
1110
- function Yr({ harEntry: c }) {
1111
- const f = c.response.content.text ?? "", w = c.response.content.encoding, I = c.response.content.mimeType;
1112
- return /* @__PURE__ */ F(v, { title: "Response", children: /* @__PURE__ */ F(Z, { content: f, encoding: w, mimeType: I }) });
1113
- }
1114
- function nt({ harEntry: c }) {
1115
- return /* @__PURE__ */ F(
1116
- Mr,
1117
- {
1118
- tabs: [
1119
- {
1120
- label: "Headers",
1121
- id: "headers",
1122
- content: /* @__PURE__ */ F(jr, { harEntry: c })
1123
- },
1124
- {
1125
- label: "Payload",
1126
- id: "payload",
1127
- content: /* @__PURE__ */ F(Wr, { harEntry: c })
1128
- },
1129
- {
1130
- label: "Response",
1131
- id: "response",
1132
- content: /* @__PURE__ */ F(Yr, { harEntry: c })
1133
- },
1134
- {
1135
- label: "HAR Entry",
1136
- id: "har-entry",
1137
- content: /* @__PURE__ */ F(Z, { content: JSON.stringify(c), mimeType: "json" })
1138
- }
1139
- ]
1140
- }
1141
- );
1142
- }
1143
- export {
1144
- nt as default
1145
- };