mudlet-map-editor 0.7.0 → 0.9.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.
- package/dist-lib/ScriptCodeEditor-DYiJp5Tn.js +845 -0
- package/dist-lib/assets/editor.worker-CEcbUcrJ.js +26 -0
- package/dist-lib/assets/ts.worker-C20_IzgO.js +67719 -0
- package/dist-lib/components/panels/MapPanel.d.ts +36 -0
- package/dist-lib/components/panels/ScriptCodeEditor.d.ts +9 -0
- package/dist-lib/components/panels/ScriptHelpModal.d.ts +5 -0
- package/dist-lib/components/panels/ScriptLibraryModal.d.ts +14 -0
- package/dist-lib/components/panels/ScriptPanel.d.ts +8 -0
- package/dist-lib/components/panels/StubPanel.d.ts +14 -0
- package/dist-lib/dist-AeNML5QP.js +811 -0
- package/dist-lib/editor/clipboard.d.ts +24 -0
- package/dist-lib/editor/hitTest.d.ts +9 -0
- package/dist-lib/editor/script.d.ts +20 -0
- package/dist-lib/editor/scriptAiPrompt.d.ts +1 -0
- package/dist-lib/editor/scriptApiDocs.d.ts +29 -0
- package/dist-lib/editor/scriptTypes.d.ts +8 -0
- package/dist-lib/editor/store.d.ts +25 -1
- package/dist-lib/editor/types.d.ts +17 -0
- package/dist-lib/editor.api2-PX2PsJx9.js +113491 -0
- package/dist-lib/index.js +12477 -8218
- package/dist-lib/javascript-DJweRxI1.js +272 -0
- package/dist-lib/monaco.contribution-CRzon75s.js +116 -0
- package/dist-lib/styles.css +1 -1
- package/dist-lib/tsMode-J2Knw729.js +611 -0
- package/package.json +9 -5
|
@@ -0,0 +1,811 @@
|
|
|
1
|
+
//#region node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js
|
|
2
|
+
var e = {}, t = {};
|
|
3
|
+
t.byteLength = l, t.toByteArray = d, t.fromByteArray = m;
|
|
4
|
+
for (var n = [], r = [], i = typeof Uint8Array < "u" ? Uint8Array : Array, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", o = 0, s = a.length; o < s; ++o) n[o] = a[o], r[a.charCodeAt(o)] = o;
|
|
5
|
+
r[45] = 62, r[95] = 63;
|
|
6
|
+
function c(e) {
|
|
7
|
+
var t = e.length;
|
|
8
|
+
if (t % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
|
|
9
|
+
var n = e.indexOf("=");
|
|
10
|
+
n === -1 && (n = t);
|
|
11
|
+
var r = n === t ? 0 : 4 - n % 4;
|
|
12
|
+
return [n, r];
|
|
13
|
+
}
|
|
14
|
+
function l(e) {
|
|
15
|
+
var t = c(e), n = t[0], r = t[1];
|
|
16
|
+
return (n + r) * 3 / 4 - r;
|
|
17
|
+
}
|
|
18
|
+
function u(e, t, n) {
|
|
19
|
+
return (t + n) * 3 / 4 - n;
|
|
20
|
+
}
|
|
21
|
+
function d(e) {
|
|
22
|
+
var t, n = c(e), a = n[0], o = n[1], s = new i(u(e, a, o)), l = 0, d = o > 0 ? a - 4 : a, f;
|
|
23
|
+
for (f = 0; f < d; f += 4) t = r[e.charCodeAt(f)] << 18 | r[e.charCodeAt(f + 1)] << 12 | r[e.charCodeAt(f + 2)] << 6 | r[e.charCodeAt(f + 3)], s[l++] = t >> 16 & 255, s[l++] = t >> 8 & 255, s[l++] = t & 255;
|
|
24
|
+
return o === 2 && (t = r[e.charCodeAt(f)] << 2 | r[e.charCodeAt(f + 1)] >> 4, s[l++] = t & 255), o === 1 && (t = r[e.charCodeAt(f)] << 10 | r[e.charCodeAt(f + 1)] << 4 | r[e.charCodeAt(f + 2)] >> 2, s[l++] = t >> 8 & 255, s[l++] = t & 255), s;
|
|
25
|
+
}
|
|
26
|
+
function f(e) {
|
|
27
|
+
return n[e >> 18 & 63] + n[e >> 12 & 63] + n[e >> 6 & 63] + n[e & 63];
|
|
28
|
+
}
|
|
29
|
+
function p(e, t, n) {
|
|
30
|
+
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(f(r));
|
|
31
|
+
return i.join("");
|
|
32
|
+
}
|
|
33
|
+
function m(e) {
|
|
34
|
+
for (var t, r = e.length, i = r % 3, a = [], o = 16383, s = 0, c = r - i; s < c; s += o) a.push(p(e, s, s + o > c ? c : s + o));
|
|
35
|
+
return i === 1 ? (t = e[r - 1], a.push(n[t >> 2] + n[t << 4 & 63] + "==")) : i === 2 && (t = (e[r - 2] << 8) + e[r - 1], a.push(n[t >> 10] + n[t >> 4 & 63] + n[t << 2 & 63] + "=")), a.join("");
|
|
36
|
+
}
|
|
37
|
+
var h = {};
|
|
38
|
+
h.read = function(e, t, n, r, i) {
|
|
39
|
+
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];
|
|
40
|
+
for (d += f, a = p & (1 << -u) - 1, p >>= -u, u += s; u > 0; a = a * 256 + e[t + d], d += f, u -= 8);
|
|
41
|
+
for (o = a & (1 << -u) - 1, a >>= -u, u += r; u > 0; o = o * 256 + e[t + d], d += f, u -= 8);
|
|
42
|
+
if (a === 0) a = 1 - l;
|
|
43
|
+
else if (a === c) return o ? NaN : (p ? -1 : 1) * Infinity;
|
|
44
|
+
else o += 2 ** r, a -= l;
|
|
45
|
+
return (p ? -1 : 1) * o * 2 ** (a - r);
|
|
46
|
+
}, h.write = function(e, t, n, r, i, a) {
|
|
47
|
+
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);
|
|
48
|
+
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);
|
|
49
|
+
for (o = o << i | s, l += i; l > 0; e[n + p] = o & 255, p += m, o /= 256, l -= 8);
|
|
50
|
+
e[n + p - m] |= h * 128;
|
|
51
|
+
}, (function(e) {
|
|
52
|
+
let n = t, r = h, i = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
53
|
+
e.Buffer = d, e.SlowBuffer = te, e.INSPECT_MAX_BYTES = 50;
|
|
54
|
+
let a = 2147483647;
|
|
55
|
+
e.kMaxLength = a;
|
|
56
|
+
let { Uint8Array: o, ArrayBuffer: s, SharedArrayBuffer: c } = globalThis;
|
|
57
|
+
d.TYPED_ARRAY_SUPPORT = l(), !d.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.");
|
|
58
|
+
function l() {
|
|
59
|
+
try {
|
|
60
|
+
let e = new o(1), t = { foo: function() {
|
|
61
|
+
return 42;
|
|
62
|
+
} };
|
|
63
|
+
return Object.setPrototypeOf(t, o.prototype), Object.setPrototypeOf(e, t), e.foo() === 42;
|
|
64
|
+
} catch {
|
|
65
|
+
return !1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
Object.defineProperty(d.prototype, "parent", {
|
|
69
|
+
enumerable: !0,
|
|
70
|
+
get: function() {
|
|
71
|
+
if (d.isBuffer(this)) return this.buffer;
|
|
72
|
+
}
|
|
73
|
+
}), Object.defineProperty(d.prototype, "offset", {
|
|
74
|
+
enumerable: !0,
|
|
75
|
+
get: function() {
|
|
76
|
+
if (d.isBuffer(this)) return this.byteOffset;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
function u(e) {
|
|
80
|
+
if (e > a) throw RangeError("The value \"" + e + "\" is invalid for option \"size\"");
|
|
81
|
+
let t = new o(e);
|
|
82
|
+
return Object.setPrototypeOf(t, d.prototype), t;
|
|
83
|
+
}
|
|
84
|
+
function d(e, t, n) {
|
|
85
|
+
if (typeof e == "number") {
|
|
86
|
+
if (typeof t == "string") throw TypeError("The \"string\" argument must be of type string. Received type number");
|
|
87
|
+
return g(e);
|
|
88
|
+
}
|
|
89
|
+
return f(e, t, n);
|
|
90
|
+
}
|
|
91
|
+
d.poolSize = 8192;
|
|
92
|
+
function f(e, t, n) {
|
|
93
|
+
if (typeof e == "string") return _(e, t);
|
|
94
|
+
if (s.isView(e)) return y(e);
|
|
95
|
+
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);
|
|
96
|
+
if (Z(e, s) || e && Z(e.buffer, s) || c !== void 0 && (Z(e, c) || e && Z(e.buffer, c))) return b(e, t, n);
|
|
97
|
+
if (typeof e == "number") throw TypeError("The \"value\" argument must not be of type number. Received type number");
|
|
98
|
+
let r = e.valueOf && e.valueOf();
|
|
99
|
+
if (r != null && r !== e) return d.from(r, t, n);
|
|
100
|
+
let i = ee(e);
|
|
101
|
+
if (i) return i;
|
|
102
|
+
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof e[Symbol.toPrimitive] == "function") return d.from(e[Symbol.toPrimitive]("string"), t, n);
|
|
103
|
+
throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
|
|
104
|
+
}
|
|
105
|
+
d.from = function(e, t, n) {
|
|
106
|
+
return f(e, t, n);
|
|
107
|
+
}, Object.setPrototypeOf(d.prototype, o.prototype), Object.setPrototypeOf(d, o);
|
|
108
|
+
function p(e) {
|
|
109
|
+
if (typeof e != "number") throw TypeError("\"size\" argument must be of type number");
|
|
110
|
+
if (e < 0) throw RangeError("The value \"" + e + "\" is invalid for option \"size\"");
|
|
111
|
+
}
|
|
112
|
+
function m(e, t, n) {
|
|
113
|
+
return p(e), e <= 0 || t === void 0 ? u(e) : typeof n == "string" ? u(e).fill(t, n) : u(e).fill(t);
|
|
114
|
+
}
|
|
115
|
+
d.alloc = function(e, t, n) {
|
|
116
|
+
return m(e, t, n);
|
|
117
|
+
};
|
|
118
|
+
function g(e) {
|
|
119
|
+
return p(e), u(e < 0 ? 0 : x(e) | 0);
|
|
120
|
+
}
|
|
121
|
+
d.allocUnsafe = function(e) {
|
|
122
|
+
return g(e);
|
|
123
|
+
}, d.allocUnsafeSlow = function(e) {
|
|
124
|
+
return g(e);
|
|
125
|
+
};
|
|
126
|
+
function _(e, t) {
|
|
127
|
+
if ((typeof t != "string" || t === "") && (t = "utf8"), !d.isEncoding(t)) throw TypeError("Unknown encoding: " + t);
|
|
128
|
+
let n = S(e, t) | 0, r = u(n), i = r.write(e, t);
|
|
129
|
+
return i !== n && (r = r.slice(0, i)), r;
|
|
130
|
+
}
|
|
131
|
+
function v(e) {
|
|
132
|
+
let t = e.length < 0 ? 0 : x(e.length) | 0, n = u(t);
|
|
133
|
+
for (let r = 0; r < t; r += 1) n[r] = e[r] & 255;
|
|
134
|
+
return n;
|
|
135
|
+
}
|
|
136
|
+
function y(e) {
|
|
137
|
+
if (Z(e, o)) {
|
|
138
|
+
let t = new o(e);
|
|
139
|
+
return b(t.buffer, t.byteOffset, t.byteLength);
|
|
140
|
+
}
|
|
141
|
+
return v(e);
|
|
142
|
+
}
|
|
143
|
+
function b(e, t, n) {
|
|
144
|
+
if (t < 0 || e.byteLength < t) throw RangeError("\"offset\" is outside of buffer bounds");
|
|
145
|
+
if (e.byteLength < t + (n || 0)) throw RangeError("\"length\" is outside of buffer bounds");
|
|
146
|
+
let r;
|
|
147
|
+
return r = t === void 0 && n === void 0 ? new o(e) : n === void 0 ? new o(e, t) : new o(e, t, n), Object.setPrototypeOf(r, d.prototype), r;
|
|
148
|
+
}
|
|
149
|
+
function ee(e) {
|
|
150
|
+
if (d.isBuffer(e)) {
|
|
151
|
+
let t = x(e.length) | 0, n = u(t);
|
|
152
|
+
return n.length === 0 || e.copy(n, 0, 0, t), n;
|
|
153
|
+
}
|
|
154
|
+
if (e.length !== void 0) return typeof e.length != "number" || Q(e.length) ? u(0) : v(e);
|
|
155
|
+
if (e.type === "Buffer" && Array.isArray(e.data)) return v(e.data);
|
|
156
|
+
}
|
|
157
|
+
function x(e) {
|
|
158
|
+
if (e >= a) throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a.toString(16) + " bytes");
|
|
159
|
+
return e | 0;
|
|
160
|
+
}
|
|
161
|
+
function te(e) {
|
|
162
|
+
return +e != e && (e = 0), d.alloc(+e);
|
|
163
|
+
}
|
|
164
|
+
d.isBuffer = function(e) {
|
|
165
|
+
return e != null && e._isBuffer === !0 && e !== d.prototype;
|
|
166
|
+
}, d.compare = function(e, t) {
|
|
167
|
+
if (Z(e, o) && (e = d.from(e, e.offset, e.byteLength)), Z(t, o) && (t = d.from(t, t.offset, t.byteLength)), !d.isBuffer(e) || !d.isBuffer(t)) throw TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
|
|
168
|
+
if (e === t) return 0;
|
|
169
|
+
let n = e.length, r = t.length;
|
|
170
|
+
for (let i = 0, a = Math.min(n, r); i < a; ++i) if (e[i] !== t[i]) {
|
|
171
|
+
n = e[i], r = t[i];
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
return n < r ? -1 : +(r < n);
|
|
175
|
+
}, d.isEncoding = function(e) {
|
|
176
|
+
switch (String(e).toLowerCase()) {
|
|
177
|
+
case "hex":
|
|
178
|
+
case "utf8":
|
|
179
|
+
case "utf-8":
|
|
180
|
+
case "ascii":
|
|
181
|
+
case "latin1":
|
|
182
|
+
case "binary":
|
|
183
|
+
case "base64":
|
|
184
|
+
case "ucs2":
|
|
185
|
+
case "ucs-2":
|
|
186
|
+
case "utf16le":
|
|
187
|
+
case "utf-16le": return !0;
|
|
188
|
+
default: return !1;
|
|
189
|
+
}
|
|
190
|
+
}, d.concat = function(e, t) {
|
|
191
|
+
if (!Array.isArray(e)) throw TypeError("\"list\" argument must be an Array of Buffers");
|
|
192
|
+
if (e.length === 0) return d.alloc(0);
|
|
193
|
+
let n;
|
|
194
|
+
if (t === void 0) for (t = 0, n = 0; n < e.length; ++n) t += e[n].length;
|
|
195
|
+
let r = d.allocUnsafe(t), i = 0;
|
|
196
|
+
for (n = 0; n < e.length; ++n) {
|
|
197
|
+
let t = e[n];
|
|
198
|
+
if (Z(t, o)) i + t.length > r.length ? (d.isBuffer(t) || (t = d.from(t)), t.copy(r, i)) : o.prototype.set.call(r, t, i);
|
|
199
|
+
else if (d.isBuffer(t)) t.copy(r, i);
|
|
200
|
+
else throw TypeError("\"list\" argument must be an Array of Buffers");
|
|
201
|
+
i += t.length;
|
|
202
|
+
}
|
|
203
|
+
return r;
|
|
204
|
+
};
|
|
205
|
+
function S(e, t) {
|
|
206
|
+
if (d.isBuffer(e)) return e.length;
|
|
207
|
+
if (s.isView(e) || Z(e, s)) return e.byteLength;
|
|
208
|
+
if (typeof e != "string") throw TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof e);
|
|
209
|
+
let n = e.length, r = arguments.length > 2 && arguments[2] === !0;
|
|
210
|
+
if (!r && n === 0) return 0;
|
|
211
|
+
let i = !1;
|
|
212
|
+
for (;;) switch (t) {
|
|
213
|
+
case "ascii":
|
|
214
|
+
case "latin1":
|
|
215
|
+
case "binary": return n;
|
|
216
|
+
case "utf8":
|
|
217
|
+
case "utf-8": return q(e).length;
|
|
218
|
+
case "ucs2":
|
|
219
|
+
case "ucs-2":
|
|
220
|
+
case "utf16le":
|
|
221
|
+
case "utf-16le": return n * 2;
|
|
222
|
+
case "hex": return n >>> 1;
|
|
223
|
+
case "base64": return Y(e).length;
|
|
224
|
+
default:
|
|
225
|
+
if (i) return r ? -1 : q(e).length;
|
|
226
|
+
t = ("" + t).toLowerCase(), i = !0;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
d.byteLength = S;
|
|
230
|
+
function C(e, t, n) {
|
|
231
|
+
let r = !1;
|
|
232
|
+
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 "";
|
|
233
|
+
for (e ||= "utf8";;) switch (e) {
|
|
234
|
+
case "hex": return se(this, t, n);
|
|
235
|
+
case "utf8":
|
|
236
|
+
case "utf-8": return A(this, t, n);
|
|
237
|
+
case "ascii": return ae(this, t, n);
|
|
238
|
+
case "latin1":
|
|
239
|
+
case "binary": return oe(this, t, n);
|
|
240
|
+
case "base64": return k(this, t, n);
|
|
241
|
+
case "ucs2":
|
|
242
|
+
case "ucs-2":
|
|
243
|
+
case "utf16le":
|
|
244
|
+
case "utf-16le": return ce(this, t, n);
|
|
245
|
+
default:
|
|
246
|
+
if (r) throw TypeError("Unknown encoding: " + e);
|
|
247
|
+
e = (e + "").toLowerCase(), r = !0;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
d.prototype._isBuffer = !0;
|
|
251
|
+
function w(e, t, n) {
|
|
252
|
+
let r = e[t];
|
|
253
|
+
e[t] = e[n], e[n] = r;
|
|
254
|
+
}
|
|
255
|
+
d.prototype.swap16 = function() {
|
|
256
|
+
let e = this.length;
|
|
257
|
+
if (e % 2 != 0) throw RangeError("Buffer size must be a multiple of 16-bits");
|
|
258
|
+
for (let t = 0; t < e; t += 2) w(this, t, t + 1);
|
|
259
|
+
return this;
|
|
260
|
+
}, d.prototype.swap32 = function() {
|
|
261
|
+
let e = this.length;
|
|
262
|
+
if (e % 4 != 0) throw RangeError("Buffer size must be a multiple of 32-bits");
|
|
263
|
+
for (let t = 0; t < e; t += 4) w(this, t, t + 3), w(this, t + 1, t + 2);
|
|
264
|
+
return this;
|
|
265
|
+
}, d.prototype.swap64 = function() {
|
|
266
|
+
let e = this.length;
|
|
267
|
+
if (e % 8 != 0) throw RangeError("Buffer size must be a multiple of 64-bits");
|
|
268
|
+
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);
|
|
269
|
+
return this;
|
|
270
|
+
}, d.prototype.toString = function() {
|
|
271
|
+
let e = this.length;
|
|
272
|
+
return e === 0 ? "" : arguments.length === 0 ? A(this, 0, e) : C.apply(this, arguments);
|
|
273
|
+
}, d.prototype.toLocaleString = d.prototype.toString, d.prototype.equals = function(e) {
|
|
274
|
+
if (!d.isBuffer(e)) throw TypeError("Argument must be a Buffer");
|
|
275
|
+
return this === e ? !0 : d.compare(this, e) === 0;
|
|
276
|
+
}, d.prototype.inspect = function() {
|
|
277
|
+
let t = "", n = e.INSPECT_MAX_BYTES;
|
|
278
|
+
return t = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (t += " ... "), "<Buffer " + t + ">";
|
|
279
|
+
}, i && (d.prototype[i] = d.prototype.inspect), d.prototype.compare = function(e, t, n, r, i) {
|
|
280
|
+
if (Z(e, o) && (e = d.from(e, e.offset, e.byteLength)), !d.isBuffer(e)) throw TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof e);
|
|
281
|
+
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");
|
|
282
|
+
if (r >= i && t >= n) return 0;
|
|
283
|
+
if (r >= i) return -1;
|
|
284
|
+
if (t >= n) return 1;
|
|
285
|
+
if (t >>>= 0, n >>>= 0, r >>>= 0, i >>>= 0, this === e) return 0;
|
|
286
|
+
let a = i - r, s = n - t, c = Math.min(a, s), l = this.slice(r, i), u = e.slice(t, n);
|
|
287
|
+
for (let e = 0; e < c; ++e) if (l[e] !== u[e]) {
|
|
288
|
+
a = l[e], s = u[e];
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
return a < s ? -1 : +(s < a);
|
|
292
|
+
};
|
|
293
|
+
function T(e, t, n, r, i) {
|
|
294
|
+
if (e.length === 0) return -1;
|
|
295
|
+
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) {
|
|
296
|
+
if (i) return -1;
|
|
297
|
+
n = e.length - 1;
|
|
298
|
+
} else if (n < 0) if (i) n = 0;
|
|
299
|
+
else return -1;
|
|
300
|
+
if (typeof t == "string" && (t = d.from(t, r)), d.isBuffer(t)) return t.length === 0 ? -1 : E(e, t, n, r, i);
|
|
301
|
+
if (typeof t == "number") return t &= 255, typeof o.prototype.indexOf == "function" ? i ? o.prototype.indexOf.call(e, t, n) : o.prototype.lastIndexOf.call(e, t, n) : E(e, [t], n, r, i);
|
|
302
|
+
throw TypeError("val must be string, number or Buffer");
|
|
303
|
+
}
|
|
304
|
+
function E(e, t, n, r, i) {
|
|
305
|
+
let a = 1, o = e.length, s = t.length;
|
|
306
|
+
if (r !== void 0 && (r = String(r).toLowerCase(), r === "ucs2" || r === "ucs-2" || r === "utf16le" || r === "utf-16le")) {
|
|
307
|
+
if (e.length < 2 || t.length < 2) return -1;
|
|
308
|
+
a = 2, o /= 2, s /= 2, n /= 2;
|
|
309
|
+
}
|
|
310
|
+
function c(e, t) {
|
|
311
|
+
return a === 1 ? e[t] : e.readUInt16BE(t * a);
|
|
312
|
+
}
|
|
313
|
+
let l;
|
|
314
|
+
if (i) {
|
|
315
|
+
let r = -1;
|
|
316
|
+
for (l = n; l < o; l++) if (c(e, l) === c(t, r === -1 ? 0 : l - r)) {
|
|
317
|
+
if (r === -1 && (r = l), l - r + 1 === s) return r * a;
|
|
318
|
+
} else r !== -1 && (l -= l - r), r = -1;
|
|
319
|
+
} else for (n + s > o && (n = o - s), l = n; l >= 0; l--) {
|
|
320
|
+
let n = !0;
|
|
321
|
+
for (let r = 0; r < s; r++) if (c(e, l + r) !== c(t, r)) {
|
|
322
|
+
n = !1;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
if (n) return l;
|
|
326
|
+
}
|
|
327
|
+
return -1;
|
|
328
|
+
}
|
|
329
|
+
d.prototype.includes = function(e, t, n) {
|
|
330
|
+
return this.indexOf(e, t, n) !== -1;
|
|
331
|
+
}, d.prototype.indexOf = function(e, t, n) {
|
|
332
|
+
return T(this, e, t, n, !0);
|
|
333
|
+
}, d.prototype.lastIndexOf = function(e, t, n) {
|
|
334
|
+
return T(this, e, t, n, !1);
|
|
335
|
+
};
|
|
336
|
+
function ne(e, t, n, r) {
|
|
337
|
+
n = Number(n) || 0;
|
|
338
|
+
let i = e.length - n;
|
|
339
|
+
r ? (r = Number(r), r > i && (r = i)) : r = i;
|
|
340
|
+
let a = t.length;
|
|
341
|
+
r > a / 2 && (r = a / 2);
|
|
342
|
+
let o;
|
|
343
|
+
for (o = 0; o < r; ++o) {
|
|
344
|
+
let r = parseInt(t.substr(o * 2, 2), 16);
|
|
345
|
+
if (Q(r)) return o;
|
|
346
|
+
e[n + o] = r;
|
|
347
|
+
}
|
|
348
|
+
return o;
|
|
349
|
+
}
|
|
350
|
+
function re(e, t, n, r) {
|
|
351
|
+
return X(q(t, e.length - n), e, n, r);
|
|
352
|
+
}
|
|
353
|
+
function ie(e, t, n, r) {
|
|
354
|
+
return X(de(t), e, n, r);
|
|
355
|
+
}
|
|
356
|
+
function D(e, t, n, r) {
|
|
357
|
+
return X(Y(t), e, n, r);
|
|
358
|
+
}
|
|
359
|
+
function O(e, t, n, r) {
|
|
360
|
+
return X(J(t, e.length - n), e, n, r);
|
|
361
|
+
}
|
|
362
|
+
d.prototype.write = function(e, t, n, r) {
|
|
363
|
+
if (t === void 0) r = "utf8", n = this.length, t = 0;
|
|
364
|
+
else if (n === void 0 && typeof t == "string") r = t, n = this.length, t = 0;
|
|
365
|
+
else if (isFinite(t)) t >>>= 0, isFinite(n) ? (n >>>= 0, r === void 0 && (r = "utf8")) : (r = n, n = void 0);
|
|
366
|
+
else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
|
|
367
|
+
let i = this.length - t;
|
|
368
|
+
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");
|
|
369
|
+
r ||= "utf8";
|
|
370
|
+
let a = !1;
|
|
371
|
+
for (;;) switch (r) {
|
|
372
|
+
case "hex": return ne(this, e, t, n);
|
|
373
|
+
case "utf8":
|
|
374
|
+
case "utf-8": return re(this, e, t, n);
|
|
375
|
+
case "ascii":
|
|
376
|
+
case "latin1":
|
|
377
|
+
case "binary": return ie(this, e, t, n);
|
|
378
|
+
case "base64": return D(this, e, t, n);
|
|
379
|
+
case "ucs2":
|
|
380
|
+
case "ucs-2":
|
|
381
|
+
case "utf16le":
|
|
382
|
+
case "utf-16le": return O(this, e, t, n);
|
|
383
|
+
default:
|
|
384
|
+
if (a) throw TypeError("Unknown encoding: " + r);
|
|
385
|
+
r = ("" + r).toLowerCase(), a = !0;
|
|
386
|
+
}
|
|
387
|
+
}, d.prototype.toJSON = function() {
|
|
388
|
+
return {
|
|
389
|
+
type: "Buffer",
|
|
390
|
+
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
function k(e, t, r) {
|
|
394
|
+
return t === 0 && r === e.length ? n.fromByteArray(e) : n.fromByteArray(e.slice(t, r));
|
|
395
|
+
}
|
|
396
|
+
function A(e, t, n) {
|
|
397
|
+
n = Math.min(e.length, n);
|
|
398
|
+
let r = [], i = t;
|
|
399
|
+
for (; i < n;) {
|
|
400
|
+
let t = e[i], a = null, o = t > 239 ? 4 : t > 223 ? 3 : t > 191 ? 2 : 1;
|
|
401
|
+
if (i + o <= n) {
|
|
402
|
+
let n, r, s, c;
|
|
403
|
+
switch (o) {
|
|
404
|
+
case 1:
|
|
405
|
+
t < 128 && (a = t);
|
|
406
|
+
break;
|
|
407
|
+
case 2:
|
|
408
|
+
n = e[i + 1], (n & 192) == 128 && (c = (t & 31) << 6 | n & 63, c > 127 && (a = c));
|
|
409
|
+
break;
|
|
410
|
+
case 3:
|
|
411
|
+
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));
|
|
412
|
+
break;
|
|
413
|
+
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));
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
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;
|
|
417
|
+
}
|
|
418
|
+
return M(r);
|
|
419
|
+
}
|
|
420
|
+
let j = 4096;
|
|
421
|
+
function M(e) {
|
|
422
|
+
let t = e.length;
|
|
423
|
+
if (t <= j) return String.fromCharCode.apply(String, e);
|
|
424
|
+
let n = "", r = 0;
|
|
425
|
+
for (; r < t;) n += String.fromCharCode.apply(String, e.slice(r, r += j));
|
|
426
|
+
return n;
|
|
427
|
+
}
|
|
428
|
+
function ae(e, t, n) {
|
|
429
|
+
let r = "";
|
|
430
|
+
n = Math.min(e.length, n);
|
|
431
|
+
for (let i = t; i < n; ++i) r += String.fromCharCode(e[i] & 127);
|
|
432
|
+
return r;
|
|
433
|
+
}
|
|
434
|
+
function oe(e, t, n) {
|
|
435
|
+
let r = "";
|
|
436
|
+
n = Math.min(e.length, n);
|
|
437
|
+
for (let i = t; i < n; ++i) r += String.fromCharCode(e[i]);
|
|
438
|
+
return r;
|
|
439
|
+
}
|
|
440
|
+
function se(e, t, n) {
|
|
441
|
+
let r = e.length;
|
|
442
|
+
(!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r);
|
|
443
|
+
let i = "";
|
|
444
|
+
for (let r = t; r < n; ++r) i += fe[e[r]];
|
|
445
|
+
return i;
|
|
446
|
+
}
|
|
447
|
+
function ce(e, t, n) {
|
|
448
|
+
let r = e.slice(t, n), i = "";
|
|
449
|
+
for (let e = 0; e < r.length - 1; e += 2) i += String.fromCharCode(r[e] + r[e + 1] * 256);
|
|
450
|
+
return i;
|
|
451
|
+
}
|
|
452
|
+
d.prototype.slice = function(e, t) {
|
|
453
|
+
let n = this.length;
|
|
454
|
+
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);
|
|
455
|
+
let r = this.subarray(e, t);
|
|
456
|
+
return Object.setPrototypeOf(r, d.prototype), r;
|
|
457
|
+
};
|
|
458
|
+
function N(e, t, n) {
|
|
459
|
+
if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
|
|
460
|
+
if (e + t > n) throw RangeError("Trying to access beyond buffer length");
|
|
461
|
+
}
|
|
462
|
+
d.prototype.readUintLE = d.prototype.readUIntLE = function(e, t, n) {
|
|
463
|
+
e >>>= 0, t >>>= 0, n || N(e, t, this.length);
|
|
464
|
+
let r = this[e], i = 1, a = 0;
|
|
465
|
+
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
466
|
+
return r;
|
|
467
|
+
}, d.prototype.readUintBE = d.prototype.readUIntBE = function(e, t, n) {
|
|
468
|
+
e >>>= 0, t >>>= 0, n || N(e, t, this.length);
|
|
469
|
+
let r = this[e + --t], i = 1;
|
|
470
|
+
for (; t > 0 && (i *= 256);) r += this[e + --t] * i;
|
|
471
|
+
return r;
|
|
472
|
+
}, d.prototype.readUint8 = d.prototype.readUInt8 = function(e, t) {
|
|
473
|
+
return e >>>= 0, t || N(e, 1, this.length), this[e];
|
|
474
|
+
}, d.prototype.readUint16LE = d.prototype.readUInt16LE = function(e, t) {
|
|
475
|
+
return e >>>= 0, t || N(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
476
|
+
}, d.prototype.readUint16BE = d.prototype.readUInt16BE = function(e, t) {
|
|
477
|
+
return e >>>= 0, t || N(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
478
|
+
}, d.prototype.readUint32LE = d.prototype.readUInt32LE = function(e, t) {
|
|
479
|
+
return e >>>= 0, t || N(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
480
|
+
}, d.prototype.readUint32BE = d.prototype.readUInt32BE = function(e, t) {
|
|
481
|
+
return e >>>= 0, t || N(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
482
|
+
}, d.prototype.readBigUInt64LE = $(function(e) {
|
|
483
|
+
e >>>= 0, G(e, "offset");
|
|
484
|
+
let t = this[e], n = this[e + 7];
|
|
485
|
+
(t === void 0 || n === void 0) && K(e, this.length - 8);
|
|
486
|
+
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;
|
|
487
|
+
return BigInt(r) + (BigInt(i) << BigInt(32));
|
|
488
|
+
}), d.prototype.readBigUInt64BE = $(function(e) {
|
|
489
|
+
e >>>= 0, G(e, "offset");
|
|
490
|
+
let t = this[e], n = this[e + 7];
|
|
491
|
+
(t === void 0 || n === void 0) && K(e, this.length - 8);
|
|
492
|
+
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;
|
|
493
|
+
return (BigInt(r) << BigInt(32)) + BigInt(i);
|
|
494
|
+
}), d.prototype.readIntLE = function(e, t, n) {
|
|
495
|
+
e >>>= 0, t >>>= 0, n || N(e, t, this.length);
|
|
496
|
+
let r = this[e], i = 1, a = 0;
|
|
497
|
+
for (; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
498
|
+
return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
|
|
499
|
+
}, d.prototype.readIntBE = function(e, t, n) {
|
|
500
|
+
e >>>= 0, t >>>= 0, n || N(e, t, this.length);
|
|
501
|
+
let r = t, i = 1, a = this[e + --r];
|
|
502
|
+
for (; r > 0 && (i *= 256);) a += this[e + --r] * i;
|
|
503
|
+
return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
|
|
504
|
+
}, d.prototype.readInt8 = function(e, t) {
|
|
505
|
+
return e >>>= 0, t || N(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
506
|
+
}, d.prototype.readInt16LE = function(e, t) {
|
|
507
|
+
e >>>= 0, t || N(e, 2, this.length);
|
|
508
|
+
let n = this[e] | this[e + 1] << 8;
|
|
509
|
+
return n & 32768 ? n | 4294901760 : n;
|
|
510
|
+
}, d.prototype.readInt16BE = function(e, t) {
|
|
511
|
+
e >>>= 0, t || N(e, 2, this.length);
|
|
512
|
+
let n = this[e + 1] | this[e] << 8;
|
|
513
|
+
return n & 32768 ? n | 4294901760 : n;
|
|
514
|
+
}, d.prototype.readInt32LE = function(e, t) {
|
|
515
|
+
return e >>>= 0, t || N(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
516
|
+
}, d.prototype.readInt32BE = function(e, t) {
|
|
517
|
+
return e >>>= 0, t || N(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
518
|
+
}, d.prototype.readBigInt64LE = $(function(e) {
|
|
519
|
+
e >>>= 0, G(e, "offset");
|
|
520
|
+
let t = this[e], n = this[e + 7];
|
|
521
|
+
(t === void 0 || n === void 0) && K(e, this.length - 8);
|
|
522
|
+
let r = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (n << 24);
|
|
523
|
+
return (BigInt(r) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
|
|
524
|
+
}), d.prototype.readBigInt64BE = $(function(e) {
|
|
525
|
+
e >>>= 0, G(e, "offset");
|
|
526
|
+
let t = this[e], n = this[e + 7];
|
|
527
|
+
(t === void 0 || n === void 0) && K(e, this.length - 8);
|
|
528
|
+
let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
|
|
529
|
+
return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
|
|
530
|
+
}), d.prototype.readFloatLE = function(e, t) {
|
|
531
|
+
return e >>>= 0, t || N(e, 4, this.length), r.read(this, e, !0, 23, 4);
|
|
532
|
+
}, d.prototype.readFloatBE = function(e, t) {
|
|
533
|
+
return e >>>= 0, t || N(e, 4, this.length), r.read(this, e, !1, 23, 4);
|
|
534
|
+
}, d.prototype.readDoubleLE = function(e, t) {
|
|
535
|
+
return e >>>= 0, t || N(e, 8, this.length), r.read(this, e, !0, 52, 8);
|
|
536
|
+
}, d.prototype.readDoubleBE = function(e, t) {
|
|
537
|
+
return e >>>= 0, t || N(e, 8, this.length), r.read(this, e, !1, 52, 8);
|
|
538
|
+
};
|
|
539
|
+
function P(e, t, n, r, i, a) {
|
|
540
|
+
if (!d.isBuffer(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
|
|
541
|
+
if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
|
|
542
|
+
if (n + r > e.length) throw RangeError("Index out of range");
|
|
543
|
+
}
|
|
544
|
+
d.prototype.writeUintLE = d.prototype.writeUIntLE = function(e, t, n, r) {
|
|
545
|
+
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
546
|
+
let r = 2 ** (8 * n) - 1;
|
|
547
|
+
P(this, e, t, n, r, 0);
|
|
548
|
+
}
|
|
549
|
+
let i = 1, a = 0;
|
|
550
|
+
for (this[t] = e & 255; ++a < n && (i *= 256);) this[t + a] = e / i & 255;
|
|
551
|
+
return t + n;
|
|
552
|
+
}, d.prototype.writeUintBE = d.prototype.writeUIntBE = function(e, t, n, r) {
|
|
553
|
+
if (e = +e, t >>>= 0, n >>>= 0, !r) {
|
|
554
|
+
let r = 2 ** (8 * n) - 1;
|
|
555
|
+
P(this, e, t, n, r, 0);
|
|
556
|
+
}
|
|
557
|
+
let i = n - 1, a = 1;
|
|
558
|
+
for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) this[t + i] = e / a & 255;
|
|
559
|
+
return t + n;
|
|
560
|
+
}, d.prototype.writeUint8 = d.prototype.writeUInt8 = function(e, t, n) {
|
|
561
|
+
return e = +e, t >>>= 0, n || P(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
|
|
562
|
+
}, d.prototype.writeUint16LE = d.prototype.writeUInt16LE = function(e, t, n) {
|
|
563
|
+
return e = +e, t >>>= 0, n || P(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
564
|
+
}, d.prototype.writeUint16BE = d.prototype.writeUInt16BE = function(e, t, n) {
|
|
565
|
+
return e = +e, t >>>= 0, n || P(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
566
|
+
}, d.prototype.writeUint32LE = d.prototype.writeUInt32LE = function(e, t, n) {
|
|
567
|
+
return e = +e, t >>>= 0, n || P(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;
|
|
568
|
+
}, d.prototype.writeUint32BE = d.prototype.writeUInt32BE = function(e, t, n) {
|
|
569
|
+
return e = +e, t >>>= 0, n || P(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;
|
|
570
|
+
};
|
|
571
|
+
function F(e, t, n, r, i) {
|
|
572
|
+
W(t, r, i, e, n, 7);
|
|
573
|
+
let a = Number(t & BigInt(4294967295));
|
|
574
|
+
e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a;
|
|
575
|
+
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
576
|
+
return e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, n;
|
|
577
|
+
}
|
|
578
|
+
function I(e, t, n, r, i) {
|
|
579
|
+
W(t, r, i, e, n, 7);
|
|
580
|
+
let a = Number(t & BigInt(4294967295));
|
|
581
|
+
e[n + 7] = a, a >>= 8, e[n + 6] = a, a >>= 8, e[n + 5] = a, a >>= 8, e[n + 4] = a;
|
|
582
|
+
let o = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
583
|
+
return e[n + 3] = o, o >>= 8, e[n + 2] = o, o >>= 8, e[n + 1] = o, o >>= 8, e[n] = o, n + 8;
|
|
584
|
+
}
|
|
585
|
+
d.prototype.writeBigUInt64LE = $(function(e, t = 0) {
|
|
586
|
+
return F(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
587
|
+
}), d.prototype.writeBigUInt64BE = $(function(e, t = 0) {
|
|
588
|
+
return I(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
589
|
+
}), d.prototype.writeIntLE = function(e, t, n, r) {
|
|
590
|
+
if (e = +e, t >>>= 0, !r) {
|
|
591
|
+
let r = 2 ** (8 * n - 1);
|
|
592
|
+
P(this, e, t, n, r - 1, -r);
|
|
593
|
+
}
|
|
594
|
+
let i = 0, a = 1, o = 0;
|
|
595
|
+
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;
|
|
596
|
+
return t + n;
|
|
597
|
+
}, d.prototype.writeIntBE = function(e, t, n, r) {
|
|
598
|
+
if (e = +e, t >>>= 0, !r) {
|
|
599
|
+
let r = 2 ** (8 * n - 1);
|
|
600
|
+
P(this, e, t, n, r - 1, -r);
|
|
601
|
+
}
|
|
602
|
+
let i = n - 1, a = 1, o = 0;
|
|
603
|
+
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;
|
|
604
|
+
return t + n;
|
|
605
|
+
}, d.prototype.writeInt8 = function(e, t, n) {
|
|
606
|
+
return e = +e, t >>>= 0, n || P(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
|
|
607
|
+
}, d.prototype.writeInt16LE = function(e, t, n) {
|
|
608
|
+
return e = +e, t >>>= 0, n || P(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
609
|
+
}, d.prototype.writeInt16BE = function(e, t, n) {
|
|
610
|
+
return e = +e, t >>>= 0, n || P(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
611
|
+
}, d.prototype.writeInt32LE = function(e, t, n) {
|
|
612
|
+
return e = +e, t >>>= 0, n || P(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;
|
|
613
|
+
}, d.prototype.writeInt32BE = function(e, t, n) {
|
|
614
|
+
return e = +e, t >>>= 0, n || P(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;
|
|
615
|
+
}, d.prototype.writeBigInt64LE = $(function(e, t = 0) {
|
|
616
|
+
return F(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
617
|
+
}), d.prototype.writeBigInt64BE = $(function(e, t = 0) {
|
|
618
|
+
return I(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
619
|
+
});
|
|
620
|
+
function L(e, t, n, r, i, a) {
|
|
621
|
+
if (n + r > e.length || n < 0) throw RangeError("Index out of range");
|
|
622
|
+
}
|
|
623
|
+
function R(e, t, n, i, a) {
|
|
624
|
+
return t = +t, n >>>= 0, a || L(e, t, n, 4), r.write(e, t, n, i, 23, 4), n + 4;
|
|
625
|
+
}
|
|
626
|
+
d.prototype.writeFloatLE = function(e, t, n) {
|
|
627
|
+
return R(this, e, t, !0, n);
|
|
628
|
+
}, d.prototype.writeFloatBE = function(e, t, n) {
|
|
629
|
+
return R(this, e, t, !1, n);
|
|
630
|
+
};
|
|
631
|
+
function z(e, t, n, i, a) {
|
|
632
|
+
return t = +t, n >>>= 0, a || L(e, t, n, 8), r.write(e, t, n, i, 52, 8), n + 8;
|
|
633
|
+
}
|
|
634
|
+
d.prototype.writeDoubleLE = function(e, t, n) {
|
|
635
|
+
return z(this, e, t, !0, n);
|
|
636
|
+
}, d.prototype.writeDoubleBE = function(e, t, n) {
|
|
637
|
+
return z(this, e, t, !1, n);
|
|
638
|
+
}, d.prototype.copy = function(e, t, n, r) {
|
|
639
|
+
if (!d.isBuffer(e)) throw TypeError("argument should be a Buffer");
|
|
640
|
+
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;
|
|
641
|
+
if (t < 0) throw RangeError("targetStart out of bounds");
|
|
642
|
+
if (n < 0 || n >= this.length) throw RangeError("Index out of range");
|
|
643
|
+
if (r < 0) throw RangeError("sourceEnd out of bounds");
|
|
644
|
+
r > this.length && (r = this.length), e.length - t < r - n && (r = e.length - t + n);
|
|
645
|
+
let i = r - n;
|
|
646
|
+
return this === e && typeof o.prototype.copyWithin == "function" ? this.copyWithin(t, n, r) : o.prototype.set.call(e, this.subarray(n, r), t), i;
|
|
647
|
+
}, d.prototype.fill = function(e, t, n, r) {
|
|
648
|
+
if (typeof e == "string") {
|
|
649
|
+
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");
|
|
650
|
+
if (typeof r == "string" && !d.isEncoding(r)) throw TypeError("Unknown encoding: " + r);
|
|
651
|
+
if (e.length === 1) {
|
|
652
|
+
let t = e.charCodeAt(0);
|
|
653
|
+
(r === "utf8" && t < 128 || r === "latin1") && (e = t);
|
|
654
|
+
}
|
|
655
|
+
} else typeof e == "number" ? e &= 255 : typeof e == "boolean" && (e = Number(e));
|
|
656
|
+
if (t < 0 || this.length < t || this.length < n) throw RangeError("Out of range index");
|
|
657
|
+
if (n <= t) return this;
|
|
658
|
+
t >>>= 0, n = n === void 0 ? this.length : n >>> 0, e ||= 0;
|
|
659
|
+
let i;
|
|
660
|
+
if (typeof e == "number") for (i = t; i < n; ++i) this[i] = e;
|
|
661
|
+
else {
|
|
662
|
+
let a = d.isBuffer(e) ? e : d.from(e, r), o = a.length;
|
|
663
|
+
if (o === 0) throw TypeError("The value \"" + e + "\" is invalid for argument \"value\"");
|
|
664
|
+
for (i = 0; i < n - t; ++i) this[i + t] = a[i % o];
|
|
665
|
+
}
|
|
666
|
+
return this;
|
|
667
|
+
};
|
|
668
|
+
let B = {};
|
|
669
|
+
function V(e, t, n) {
|
|
670
|
+
B[e] = class extends n {
|
|
671
|
+
constructor() {
|
|
672
|
+
super(), Object.defineProperty(this, "message", {
|
|
673
|
+
value: t.apply(this, arguments),
|
|
674
|
+
writable: !0,
|
|
675
|
+
configurable: !0
|
|
676
|
+
}), this.name = `${this.name} [${e}]`, this.stack, delete this.name;
|
|
677
|
+
}
|
|
678
|
+
get code() {
|
|
679
|
+
return e;
|
|
680
|
+
}
|
|
681
|
+
set code(e) {
|
|
682
|
+
Object.defineProperty(this, "code", {
|
|
683
|
+
configurable: !0,
|
|
684
|
+
enumerable: !0,
|
|
685
|
+
value: e,
|
|
686
|
+
writable: !0
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
toString() {
|
|
690
|
+
return `${this.name} [${e}]: ${this.message}`;
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
V("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
|
|
695
|
+
return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
696
|
+
}, RangeError), V("ERR_INVALID_ARG_TYPE", function(e, t) {
|
|
697
|
+
return `The "${e}" argument must be of type number. Received type ${typeof t}`;
|
|
698
|
+
}, TypeError), V("ERR_OUT_OF_RANGE", function(e, t, n) {
|
|
699
|
+
let r = `The value of "${e}" is out of range.`, i = n;
|
|
700
|
+
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = H(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = H(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
|
|
701
|
+
}, RangeError);
|
|
702
|
+
function H(e) {
|
|
703
|
+
let t = "", n = e.length, r = +(e[0] === "-");
|
|
704
|
+
for (; n >= r + 4; n -= 3) t = `_${e.slice(n - 3, n)}${t}`;
|
|
705
|
+
return `${e.slice(0, n)}${t}`;
|
|
706
|
+
}
|
|
707
|
+
function U(e, t, n) {
|
|
708
|
+
G(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && K(t, e.length - (n + 1));
|
|
709
|
+
}
|
|
710
|
+
function W(e, t, n, r, i, a) {
|
|
711
|
+
if (e > n || e < t) {
|
|
712
|
+
let r = typeof t == "bigint" ? "n" : "", i;
|
|
713
|
+
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 B.ERR_OUT_OF_RANGE("value", i, e);
|
|
714
|
+
}
|
|
715
|
+
U(r, i, a);
|
|
716
|
+
}
|
|
717
|
+
function G(e, t) {
|
|
718
|
+
if (typeof e != "number") throw new B.ERR_INVALID_ARG_TYPE(t, "number", e);
|
|
719
|
+
}
|
|
720
|
+
function K(e, t, n) {
|
|
721
|
+
throw Math.floor(e) === e ? t < 0 ? new B.ERR_BUFFER_OUT_OF_BOUNDS() : new B.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (G(e, n), new B.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
|
|
722
|
+
}
|
|
723
|
+
let le = /[^+/0-9A-Za-z-_]/g;
|
|
724
|
+
function ue(e) {
|
|
725
|
+
if (e = e.split("=")[0], e = e.trim().replace(le, ""), e.length < 2) return "";
|
|
726
|
+
for (; e.length % 4 != 0;) e += "=";
|
|
727
|
+
return e;
|
|
728
|
+
}
|
|
729
|
+
function q(e, t) {
|
|
730
|
+
t ||= Infinity;
|
|
731
|
+
let n, r = e.length, i = null, a = [];
|
|
732
|
+
for (let o = 0; o < r; ++o) {
|
|
733
|
+
if (n = e.charCodeAt(o), n > 55295 && n < 57344) {
|
|
734
|
+
if (!i) {
|
|
735
|
+
if (n > 56319) {
|
|
736
|
+
(t -= 3) > -1 && a.push(239, 191, 189);
|
|
737
|
+
continue;
|
|
738
|
+
} else if (o + 1 === r) {
|
|
739
|
+
(t -= 3) > -1 && a.push(239, 191, 189);
|
|
740
|
+
continue;
|
|
741
|
+
}
|
|
742
|
+
i = n;
|
|
743
|
+
continue;
|
|
744
|
+
}
|
|
745
|
+
if (n < 56320) {
|
|
746
|
+
(t -= 3) > -1 && a.push(239, 191, 189), i = n;
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
n = (i - 55296 << 10 | n - 56320) + 65536;
|
|
750
|
+
} else i && (t -= 3) > -1 && a.push(239, 191, 189);
|
|
751
|
+
if (i = null, n < 128) {
|
|
752
|
+
if (--t < 0) break;
|
|
753
|
+
a.push(n);
|
|
754
|
+
} else if (n < 2048) {
|
|
755
|
+
if ((t -= 2) < 0) break;
|
|
756
|
+
a.push(n >> 6 | 192, n & 63 | 128);
|
|
757
|
+
} else if (n < 65536) {
|
|
758
|
+
if ((t -= 3) < 0) break;
|
|
759
|
+
a.push(n >> 12 | 224, n >> 6 & 63 | 128, n & 63 | 128);
|
|
760
|
+
} else if (n < 1114112) {
|
|
761
|
+
if ((t -= 4) < 0) break;
|
|
762
|
+
a.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, n & 63 | 128);
|
|
763
|
+
} else throw Error("Invalid code point");
|
|
764
|
+
}
|
|
765
|
+
return a;
|
|
766
|
+
}
|
|
767
|
+
function de(e) {
|
|
768
|
+
let t = [];
|
|
769
|
+
for (let n = 0; n < e.length; ++n) t.push(e.charCodeAt(n) & 255);
|
|
770
|
+
return t;
|
|
771
|
+
}
|
|
772
|
+
function J(e, t) {
|
|
773
|
+
let n, r, i, a = [];
|
|
774
|
+
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);
|
|
775
|
+
return a;
|
|
776
|
+
}
|
|
777
|
+
function Y(e) {
|
|
778
|
+
return n.toByteArray(ue(e));
|
|
779
|
+
}
|
|
780
|
+
function X(e, t, n, r) {
|
|
781
|
+
let i;
|
|
782
|
+
for (i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i];
|
|
783
|
+
return i;
|
|
784
|
+
}
|
|
785
|
+
function Z(e, t) {
|
|
786
|
+
return e instanceof t || e != null && e.constructor != null && e.constructor.name != null && e.constructor.name === t.name;
|
|
787
|
+
}
|
|
788
|
+
function Q(e) {
|
|
789
|
+
return e !== e;
|
|
790
|
+
}
|
|
791
|
+
let fe = (function() {
|
|
792
|
+
let e = "0123456789abcdef", t = Array(256);
|
|
793
|
+
for (let n = 0; n < 16; ++n) {
|
|
794
|
+
let r = n * 16;
|
|
795
|
+
for (let i = 0; i < 16; ++i) t[r + i] = e[n] + e[i];
|
|
796
|
+
}
|
|
797
|
+
return t;
|
|
798
|
+
})();
|
|
799
|
+
function $(e) {
|
|
800
|
+
return typeof BigInt > "u" ? pe : e;
|
|
801
|
+
}
|
|
802
|
+
function pe() {
|
|
803
|
+
throw Error("BigInt not supported");
|
|
804
|
+
}
|
|
805
|
+
})(e);
|
|
806
|
+
var g = e.Buffer;
|
|
807
|
+
e.Blob, e.BlobOptions;
|
|
808
|
+
var _ = e.Buffer;
|
|
809
|
+
e.File, e.FileOptions, e.INSPECT_MAX_BYTES, e.SlowBuffer, e.TranscodeEncoding, e.atob, e.btoa, e.constants, e.isAscii, e.isUtf8, e.kMaxLength, e.kStringMaxLength, e.resolveObjectURL, e.transcode;
|
|
810
|
+
//#endregion
|
|
811
|
+
export { _ as n, g as t };
|