@gremlin/mcp-server 2.2.0 → 2.2.1
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/build/main.mjs +449 -1996
- package/package.json +2 -2
package/build/main.mjs
CHANGED
|
@@ -43,8 +43,8 @@ var require_uri_all = __commonJS({
|
|
|
43
43
|
if (sets.length > 1) {
|
|
44
44
|
sets[0] = sets[0].slice(0, -1);
|
|
45
45
|
var xl = sets.length - 1;
|
|
46
|
-
for (var
|
|
47
|
-
sets[
|
|
46
|
+
for (var x = 1; x < xl; ++x) {
|
|
47
|
+
sets[x] = sets[x].slice(1, -1);
|
|
48
48
|
}
|
|
49
49
|
sets[xl] = sets[xl].slice(1);
|
|
50
50
|
return sets.join("");
|
|
@@ -55,8 +55,8 @@ var require_uri_all = __commonJS({
|
|
|
55
55
|
function subexp(str) {
|
|
56
56
|
return "(?:" + str + ")";
|
|
57
57
|
}
|
|
58
|
-
function typeOf(
|
|
59
|
-
return
|
|
58
|
+
function typeOf(o) {
|
|
59
|
+
return o === void 0 ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
|
|
60
60
|
}
|
|
61
61
|
function toUpperCase(str) {
|
|
62
62
|
return str.toUpperCase();
|
|
@@ -240,16 +240,16 @@ var require_uri_all = __commonJS({
|
|
|
240
240
|
if (basic < 0) {
|
|
241
241
|
basic = 0;
|
|
242
242
|
}
|
|
243
|
-
for (var
|
|
244
|
-
if (input.charCodeAt(
|
|
243
|
+
for (var j = 0; j < basic; ++j) {
|
|
244
|
+
if (input.charCodeAt(j) >= 128) {
|
|
245
245
|
error$1("not-basic");
|
|
246
246
|
}
|
|
247
|
-
output.push(input.charCodeAt(
|
|
247
|
+
output.push(input.charCodeAt(j));
|
|
248
248
|
}
|
|
249
249
|
for (var index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
|
250
250
|
var oldi = i;
|
|
251
251
|
for (
|
|
252
|
-
var
|
|
252
|
+
var w = 1, k = base;
|
|
253
253
|
;
|
|
254
254
|
/* no condition */
|
|
255
255
|
k += base
|
|
@@ -258,19 +258,19 @@ var require_uri_all = __commonJS({
|
|
|
258
258
|
error$1("invalid-input");
|
|
259
259
|
}
|
|
260
260
|
var digit = basicToDigit(input.charCodeAt(index++));
|
|
261
|
-
if (digit >= base || digit > floor((maxInt - i) /
|
|
261
|
+
if (digit >= base || digit > floor((maxInt - i) / w)) {
|
|
262
262
|
error$1("overflow");
|
|
263
263
|
}
|
|
264
|
-
i += digit *
|
|
264
|
+
i += digit * w;
|
|
265
265
|
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
266
266
|
if (digit < t) {
|
|
267
267
|
break;
|
|
268
268
|
}
|
|
269
269
|
var baseMinusT = base - t;
|
|
270
|
-
if (
|
|
270
|
+
if (w > floor(maxInt / baseMinusT)) {
|
|
271
271
|
error$1("overflow");
|
|
272
272
|
}
|
|
273
|
-
|
|
273
|
+
w *= baseMinusT;
|
|
274
274
|
}
|
|
275
275
|
var out = output.length + 1;
|
|
276
276
|
bias = adapt(i - oldi, out, oldi == 0);
|
|
@@ -320,15 +320,15 @@ var require_uri_all = __commonJS({
|
|
|
320
320
|
output.push(delimiter);
|
|
321
321
|
}
|
|
322
322
|
while (handledCPCount < inputLength) {
|
|
323
|
-
var
|
|
323
|
+
var m = maxInt;
|
|
324
324
|
var _iteratorNormalCompletion2 = true;
|
|
325
325
|
var _didIteratorError2 = false;
|
|
326
326
|
var _iteratorError2 = void 0;
|
|
327
327
|
try {
|
|
328
328
|
for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
329
329
|
var currentValue = _step2.value;
|
|
330
|
-
if (currentValue >= n && currentValue <
|
|
331
|
-
|
|
330
|
+
if (currentValue >= n && currentValue < m) {
|
|
331
|
+
m = currentValue;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
} catch (err) {
|
|
@@ -346,11 +346,11 @@ var require_uri_all = __commonJS({
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
var handledCPCountPlusOne = handledCPCount + 1;
|
|
349
|
-
if (
|
|
349
|
+
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
|
350
350
|
error$1("overflow");
|
|
351
351
|
}
|
|
352
|
-
delta += (
|
|
353
|
-
n =
|
|
352
|
+
delta += (m - n) * handledCPCountPlusOne;
|
|
353
|
+
n = m;
|
|
354
354
|
var _iteratorNormalCompletion3 = true;
|
|
355
355
|
var _didIteratorError3 = false;
|
|
356
356
|
var _iteratorError3 = void 0;
|
|
@@ -514,8 +514,8 @@ var require_uri_all = __commonJS({
|
|
|
514
514
|
var fieldCount = isLastFieldIPv4Address ? 7 : 8;
|
|
515
515
|
var lastFieldsStart = lastFields.length - fieldCount;
|
|
516
516
|
var fields = Array(fieldCount);
|
|
517
|
-
for (var
|
|
518
|
-
fields[
|
|
517
|
+
for (var x = 0; x < fieldCount; ++x) {
|
|
518
|
+
fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || "";
|
|
519
519
|
}
|
|
520
520
|
if (isLastFieldIPv4Address) {
|
|
521
521
|
fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
|
|
@@ -531,8 +531,8 @@ var require_uri_all = __commonJS({
|
|
|
531
531
|
}
|
|
532
532
|
return acc;
|
|
533
533
|
}, []);
|
|
534
|
-
var longestZeroFields = allZeroFields.sort(function(
|
|
535
|
-
return
|
|
534
|
+
var longestZeroFields = allZeroFields.sort(function(a, b) {
|
|
535
|
+
return b.length - a.length;
|
|
536
536
|
})[0];
|
|
537
537
|
var newHost = void 0;
|
|
538
538
|
if (longestZeroFields && longestZeroFields.length > 1) {
|
|
@@ -626,7 +626,7 @@ var require_uri_all = __commonJS({
|
|
|
626
626
|
uriTokens.push("@");
|
|
627
627
|
}
|
|
628
628
|
if (components.host !== void 0) {
|
|
629
|
-
uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(
|
|
629
|
+
uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(_, $1, $2) {
|
|
630
630
|
return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
|
|
631
631
|
}));
|
|
632
632
|
}
|
|
@@ -866,7 +866,7 @@ var require_uri_all = __commonJS({
|
|
|
866
866
|
parse: handler$2.parse,
|
|
867
867
|
serialize: handler$2.serialize
|
|
868
868
|
};
|
|
869
|
-
var
|
|
869
|
+
var O = {};
|
|
870
870
|
var isIRI = true;
|
|
871
871
|
var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
|
|
872
872
|
var HEXDIG$$ = "[0-9A-Fa-f]";
|
|
@@ -894,8 +894,8 @@ var require_uri_all = __commonJS({
|
|
|
894
894
|
var unknownHeaders = false;
|
|
895
895
|
var headers = {};
|
|
896
896
|
var hfields = mailtoComponents.query.split("&");
|
|
897
|
-
for (var
|
|
898
|
-
var hfield = hfields[
|
|
897
|
+
for (var x = 0, xl = hfields.length; x < xl; ++x) {
|
|
898
|
+
var hfield = hfields[x].split("=");
|
|
899
899
|
switch (hfield[0]) {
|
|
900
900
|
case "to":
|
|
901
901
|
var toAddrs = hfield[1].split(",");
|
|
@@ -938,8 +938,8 @@ var require_uri_all = __commonJS({
|
|
|
938
938
|
var components = mailtoComponents;
|
|
939
939
|
var to = toArray(mailtoComponents.to);
|
|
940
940
|
if (to) {
|
|
941
|
-
for (var
|
|
942
|
-
var toAddr = String(to[
|
|
941
|
+
for (var x = 0, xl = to.length; x < xl; ++x) {
|
|
942
|
+
var toAddr = String(to[x]);
|
|
943
943
|
var atIdx = toAddr.lastIndexOf("@");
|
|
944
944
|
var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
|
|
945
945
|
var domain = toAddr.slice(atIdx + 1);
|
|
@@ -948,7 +948,7 @@ var require_uri_all = __commonJS({
|
|
|
948
948
|
} catch (e) {
|
|
949
949
|
components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
|
|
950
950
|
}
|
|
951
|
-
to[
|
|
951
|
+
to[x] = localPart + "@" + domain;
|
|
952
952
|
}
|
|
953
953
|
components.path = to.join(",");
|
|
954
954
|
}
|
|
@@ -957,7 +957,7 @@ var require_uri_all = __commonJS({
|
|
|
957
957
|
if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
|
|
958
958
|
var fields = [];
|
|
959
959
|
for (var name in headers) {
|
|
960
|
-
if (headers[name] !==
|
|
960
|
+
if (headers[name] !== O[name]) {
|
|
961
961
|
fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
|
|
962
962
|
}
|
|
963
963
|
}
|
|
@@ -1050,33 +1050,33 @@ var require_uri_all = __commonJS({
|
|
|
1050
1050
|
var require_fast_deep_equal = __commonJS({
|
|
1051
1051
|
"node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
1052
1052
|
"use strict";
|
|
1053
|
-
module.exports = function equal(
|
|
1054
|
-
if (
|
|
1055
|
-
if (
|
|
1056
|
-
if (
|
|
1053
|
+
module.exports = function equal(a, b) {
|
|
1054
|
+
if (a === b) return true;
|
|
1055
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
1056
|
+
if (a.constructor !== b.constructor) return false;
|
|
1057
1057
|
var length, i, keys;
|
|
1058
|
-
if (Array.isArray(
|
|
1059
|
-
length =
|
|
1060
|
-
if (length !=
|
|
1058
|
+
if (Array.isArray(a)) {
|
|
1059
|
+
length = a.length;
|
|
1060
|
+
if (length != b.length) return false;
|
|
1061
1061
|
for (i = length; i-- !== 0; )
|
|
1062
|
-
if (!equal(
|
|
1062
|
+
if (!equal(a[i], b[i])) return false;
|
|
1063
1063
|
return true;
|
|
1064
1064
|
}
|
|
1065
|
-
if (
|
|
1066
|
-
if (
|
|
1067
|
-
if (
|
|
1068
|
-
keys = Object.keys(
|
|
1065
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
1066
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
1067
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
1068
|
+
keys = Object.keys(a);
|
|
1069
1069
|
length = keys.length;
|
|
1070
|
-
if (length !== Object.keys(
|
|
1070
|
+
if (length !== Object.keys(b).length) return false;
|
|
1071
1071
|
for (i = length; i-- !== 0; )
|
|
1072
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1072
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
1073
1073
|
for (i = length; i-- !== 0; ) {
|
|
1074
1074
|
var key = keys[i];
|
|
1075
|
-
if (!equal(
|
|
1075
|
+
if (!equal(a[key], b[key])) return false;
|
|
1076
1076
|
}
|
|
1077
1077
|
return true;
|
|
1078
1078
|
}
|
|
1079
|
-
return
|
|
1079
|
+
return a !== a && b !== b;
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
1082
|
});
|
|
@@ -1128,9 +1128,9 @@ var require_util = __commonJS({
|
|
|
1128
1128
|
escapeFragment,
|
|
1129
1129
|
escapeJsonPointer
|
|
1130
1130
|
};
|
|
1131
|
-
function copy(
|
|
1131
|
+
function copy(o, to) {
|
|
1132
1132
|
to = to || {};
|
|
1133
|
-
for (var key in
|
|
1133
|
+
for (var key in o) to[key] = o[key];
|
|
1134
1134
|
return to;
|
|
1135
1135
|
}
|
|
1136
1136
|
function checkDataType(dataType, data, strictNumbers, negate) {
|
|
@@ -1265,9 +1265,9 @@ var require_util = __commonJS({
|
|
|
1265
1265
|
}
|
|
1266
1266
|
return expr;
|
|
1267
1267
|
}
|
|
1268
|
-
function joinPaths(
|
|
1269
|
-
if (
|
|
1270
|
-
return (
|
|
1268
|
+
function joinPaths(a, b) {
|
|
1269
|
+
if (a == '""') return b;
|
|
1270
|
+
return (a + " + " + b).replace(/([^\\])' \+ '/g, "$1");
|
|
1271
1271
|
}
|
|
1272
1272
|
function unescapeFragment(str) {
|
|
1273
1273
|
return unescapeJsonPointer(decodeURIComponent(str));
|
|
@@ -1407,18 +1407,18 @@ var require_resolve = __commonJS({
|
|
|
1407
1407
|
return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal);
|
|
1408
1408
|
}
|
|
1409
1409
|
var res = resolveSchema.call(this, root, ref);
|
|
1410
|
-
var schema,
|
|
1410
|
+
var schema, v, baseId;
|
|
1411
1411
|
if (res) {
|
|
1412
1412
|
schema = res.schema;
|
|
1413
1413
|
root = res.root;
|
|
1414
1414
|
baseId = res.baseId;
|
|
1415
1415
|
}
|
|
1416
1416
|
if (schema instanceof SchemaObject) {
|
|
1417
|
-
|
|
1417
|
+
v = schema.validate || compile.call(this, schema.schema, root, void 0, baseId);
|
|
1418
1418
|
} else if (schema !== void 0) {
|
|
1419
|
-
|
|
1419
|
+
v = inlineRef(schema, this._opts.inlineRefs) ? schema : compile.call(this, schema, root, void 0, baseId);
|
|
1420
1420
|
}
|
|
1421
|
-
return
|
|
1421
|
+
return v;
|
|
1422
1422
|
}
|
|
1423
1423
|
function resolveSchema(root, ref) {
|
|
1424
1424
|
var p = URI.parse(ref), refPath = _getFullPath(p), baseId = getFullPath(this._getId(root.schema));
|
|
@@ -1641,9 +1641,9 @@ var require_fast_json_stable_stringify = __commonJS({
|
|
|
1641
1641
|
var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
|
|
1642
1642
|
var cmp = opts.cmp && /* @__PURE__ */ function(f) {
|
|
1643
1643
|
return function(node) {
|
|
1644
|
-
return function(
|
|
1645
|
-
var aobj = { key:
|
|
1646
|
-
var bobj = { key:
|
|
1644
|
+
return function(a, b) {
|
|
1645
|
+
var aobj = { key: a, value: node[a] };
|
|
1646
|
+
var bobj = { key: b, value: node[b] };
|
|
1647
1647
|
return f(aobj, bobj);
|
|
1648
1648
|
};
|
|
1649
1649
|
};
|
|
@@ -2167,19 +2167,19 @@ var require_compile = __commonJS({
|
|
|
2167
2167
|
var formats = this._formats;
|
|
2168
2168
|
var RULES = this.RULES;
|
|
2169
2169
|
try {
|
|
2170
|
-
var
|
|
2171
|
-
compilation.validate =
|
|
2170
|
+
var v = localCompile(schema, root, localRefs, baseId);
|
|
2171
|
+
compilation.validate = v;
|
|
2172
2172
|
var cv = compilation.callValidate;
|
|
2173
2173
|
if (cv) {
|
|
2174
|
-
cv.schema =
|
|
2174
|
+
cv.schema = v.schema;
|
|
2175
2175
|
cv.errors = null;
|
|
2176
|
-
cv.refs =
|
|
2177
|
-
cv.refVal =
|
|
2178
|
-
cv.root =
|
|
2179
|
-
cv.$async =
|
|
2180
|
-
if (opts.sourceCode) cv.source =
|
|
2176
|
+
cv.refs = v.refs;
|
|
2177
|
+
cv.refVal = v.refVal;
|
|
2178
|
+
cv.root = v.root;
|
|
2179
|
+
cv.$async = v.$async;
|
|
2180
|
+
if (opts.sourceCode) cv.source = v.source;
|
|
2181
2181
|
}
|
|
2182
|
-
return
|
|
2182
|
+
return v;
|
|
2183
2183
|
} finally {
|
|
2184
2184
|
endCompiling.call(this, schema, root, baseId);
|
|
2185
2185
|
}
|
|
@@ -2284,32 +2284,32 @@ var require_compile = __commonJS({
|
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
2286
2286
|
refCode = addLocalRef(ref);
|
|
2287
|
-
var
|
|
2288
|
-
if (
|
|
2287
|
+
var v2 = resolve.call(self, localCompile, root, ref);
|
|
2288
|
+
if (v2 === void 0) {
|
|
2289
2289
|
var localSchema = localRefs && localRefs[ref];
|
|
2290
2290
|
if (localSchema) {
|
|
2291
|
-
|
|
2291
|
+
v2 = resolve.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId2);
|
|
2292
2292
|
}
|
|
2293
2293
|
}
|
|
2294
|
-
if (
|
|
2294
|
+
if (v2 === void 0) {
|
|
2295
2295
|
removeLocalRef(ref);
|
|
2296
2296
|
} else {
|
|
2297
|
-
replaceLocalRef(ref,
|
|
2298
|
-
return resolvedRef(
|
|
2297
|
+
replaceLocalRef(ref, v2);
|
|
2298
|
+
return resolvedRef(v2, refCode);
|
|
2299
2299
|
}
|
|
2300
2300
|
}
|
|
2301
|
-
function addLocalRef(ref,
|
|
2301
|
+
function addLocalRef(ref, v2) {
|
|
2302
2302
|
var refId = refVal.length;
|
|
2303
|
-
refVal[refId] =
|
|
2303
|
+
refVal[refId] = v2;
|
|
2304
2304
|
refs[ref] = refId;
|
|
2305
2305
|
return "refVal" + refId;
|
|
2306
2306
|
}
|
|
2307
2307
|
function removeLocalRef(ref) {
|
|
2308
2308
|
delete refs[ref];
|
|
2309
2309
|
}
|
|
2310
|
-
function replaceLocalRef(ref,
|
|
2310
|
+
function replaceLocalRef(ref, v2) {
|
|
2311
2311
|
var refId = refs[ref];
|
|
2312
|
-
refVal[refId] =
|
|
2312
|
+
refVal[refId] = v2;
|
|
2313
2313
|
}
|
|
2314
2314
|
function resolvedRef(refVal2, code) {
|
|
2315
2315
|
return typeof refVal2 == "object" || typeof refVal2 == "boolean" ? { code, schema: refVal2, inline: true } : { code, $async: refVal2 && !!refVal2.$async };
|
|
@@ -2428,19 +2428,19 @@ var require_compile = __commonJS({
|
|
|
2428
2428
|
var require_cache = __commonJS({
|
|
2429
2429
|
"node_modules/ajv/lib/cache.js"(exports, module) {
|
|
2430
2430
|
"use strict";
|
|
2431
|
-
var
|
|
2431
|
+
var Cache = module.exports = function Cache2() {
|
|
2432
2432
|
this._cache = {};
|
|
2433
2433
|
};
|
|
2434
|
-
|
|
2434
|
+
Cache.prototype.put = function Cache_put(key, value) {
|
|
2435
2435
|
this._cache[key] = value;
|
|
2436
2436
|
};
|
|
2437
|
-
|
|
2437
|
+
Cache.prototype.get = function Cache_get(key) {
|
|
2438
2438
|
return this._cache[key];
|
|
2439
2439
|
};
|
|
2440
|
-
|
|
2440
|
+
Cache.prototype.del = function Cache_del(key) {
|
|
2441
2441
|
delete this._cache[key];
|
|
2442
2442
|
};
|
|
2443
|
-
|
|
2443
|
+
Cache.prototype.clear = function Cache_clear() {
|
|
2444
2444
|
this._cache = {};
|
|
2445
2445
|
};
|
|
2446
2446
|
}
|
|
@@ -5243,11 +5243,11 @@ var require_data = __commonJS({
|
|
|
5243
5243
|
metaSchema = JSON.parse(JSON.stringify(metaSchema));
|
|
5244
5244
|
var segments = keywordsJsonPointers[i].split("/");
|
|
5245
5245
|
var keywords = metaSchema;
|
|
5246
|
-
var
|
|
5247
|
-
for (
|
|
5248
|
-
keywords = keywords[segments[
|
|
5249
|
-
for (
|
|
5250
|
-
var key = KEYWORDS[
|
|
5246
|
+
var j;
|
|
5247
|
+
for (j = 1; j < segments.length; j++)
|
|
5248
|
+
keywords = keywords[segments[j]];
|
|
5249
|
+
for (j = 0; j < KEYWORDS.length; j++) {
|
|
5250
|
+
var key = KEYWORDS[j];
|
|
5251
5251
|
var schema = keywords[key];
|
|
5252
5252
|
if (schema) {
|
|
5253
5253
|
keywords[key] = {
|
|
@@ -5284,8 +5284,8 @@ var require_async = __commonJS({
|
|
|
5284
5284
|
});
|
|
5285
5285
|
if (callback) {
|
|
5286
5286
|
p.then(
|
|
5287
|
-
function(
|
|
5288
|
-
callback(null,
|
|
5287
|
+
function(v) {
|
|
5288
|
+
callback(null, v);
|
|
5289
5289
|
},
|
|
5290
5290
|
callback
|
|
5291
5291
|
);
|
|
@@ -5848,9 +5848,9 @@ var require_keyword = __commonJS({
|
|
|
5848
5848
|
delete RULES.custom[keyword];
|
|
5849
5849
|
for (var i = 0; i < RULES.length; i++) {
|
|
5850
5850
|
var rules = RULES[i].rules;
|
|
5851
|
-
for (var
|
|
5852
|
-
if (rules[
|
|
5853
|
-
rules.splice(
|
|
5851
|
+
for (var j = 0; j < rules.length; j++) {
|
|
5852
|
+
if (rules[j].keyword == keyword) {
|
|
5853
|
+
rules.splice(j, 1);
|
|
5854
5854
|
break;
|
|
5855
5855
|
}
|
|
5856
5856
|
}
|
|
@@ -5859,11 +5859,11 @@ var require_keyword = __commonJS({
|
|
|
5859
5859
|
}
|
|
5860
5860
|
function validateKeyword(definition, throwError) {
|
|
5861
5861
|
validateKeyword.errors = null;
|
|
5862
|
-
var
|
|
5863
|
-
if (
|
|
5864
|
-
validateKeyword.errors =
|
|
5862
|
+
var v = this._validateKeyword = this._validateKeyword || this.compile(definitionSchema, true);
|
|
5863
|
+
if (v(definition)) return true;
|
|
5864
|
+
validateKeyword.errors = v.errors;
|
|
5865
5865
|
if (throwError)
|
|
5866
|
-
throw new Error("custom keyword definition is invalid: " + this.errorsText(
|
|
5866
|
+
throw new Error("custom keyword definition is invalid: " + this.errorsText(v.errors));
|
|
5867
5867
|
else
|
|
5868
5868
|
return false;
|
|
5869
5869
|
}
|
|
@@ -5899,7 +5899,7 @@ var require_ajv = __commonJS({
|
|
|
5899
5899
|
"use strict";
|
|
5900
5900
|
var compileSchema = require_compile();
|
|
5901
5901
|
var resolve = require_resolve();
|
|
5902
|
-
var
|
|
5902
|
+
var Cache = require_cache();
|
|
5903
5903
|
var SchemaObject = require_schema_obj();
|
|
5904
5904
|
var stableStringify = require_fast_json_stable_stringify();
|
|
5905
5905
|
var formats = require_formats();
|
|
@@ -5939,7 +5939,7 @@ var require_ajv = __commonJS({
|
|
|
5939
5939
|
this._refs = {};
|
|
5940
5940
|
this._fragments = {};
|
|
5941
5941
|
this._formats = formats(opts.format);
|
|
5942
|
-
this._cache = opts.cache || new
|
|
5942
|
+
this._cache = opts.cache || new Cache();
|
|
5943
5943
|
this._loadingSchemas = {};
|
|
5944
5944
|
this._compilations = [];
|
|
5945
5945
|
this.RULES = rules();
|
|
@@ -5956,16 +5956,16 @@ var require_ajv = __commonJS({
|
|
|
5956
5956
|
addInitialSchemas(this);
|
|
5957
5957
|
}
|
|
5958
5958
|
function validate(schemaKeyRef, data) {
|
|
5959
|
-
var
|
|
5959
|
+
var v;
|
|
5960
5960
|
if (typeof schemaKeyRef == "string") {
|
|
5961
|
-
|
|
5962
|
-
if (!
|
|
5961
|
+
v = this.getSchema(schemaKeyRef);
|
|
5962
|
+
if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"');
|
|
5963
5963
|
} else {
|
|
5964
5964
|
var schemaObj = this._addSchema(schemaKeyRef);
|
|
5965
|
-
|
|
5965
|
+
v = schemaObj.validate || this._compile(schemaObj);
|
|
5966
5966
|
}
|
|
5967
|
-
var valid =
|
|
5968
|
-
if (
|
|
5967
|
+
var valid = v(data);
|
|
5968
|
+
if (v.$async !== true) this.errors = v.errors;
|
|
5969
5969
|
return valid;
|
|
5970
5970
|
}
|
|
5971
5971
|
function compile(schema, _meta) {
|
|
@@ -6027,16 +6027,16 @@ var require_ajv = __commonJS({
|
|
|
6027
6027
|
var res = resolve.schema.call(self, { schema: {} }, ref);
|
|
6028
6028
|
if (res) {
|
|
6029
6029
|
var schema = res.schema, root = res.root, baseId = res.baseId;
|
|
6030
|
-
var
|
|
6030
|
+
var v = compileSchema.call(self, schema, root, void 0, baseId);
|
|
6031
6031
|
self._fragments[ref] = new SchemaObject({
|
|
6032
6032
|
ref,
|
|
6033
6033
|
fragment: true,
|
|
6034
6034
|
schema,
|
|
6035
6035
|
root,
|
|
6036
6036
|
baseId,
|
|
6037
|
-
validate:
|
|
6037
|
+
validate: v
|
|
6038
6038
|
});
|
|
6039
|
-
return
|
|
6039
|
+
return v;
|
|
6040
6040
|
}
|
|
6041
6041
|
}
|
|
6042
6042
|
function _getSchemaObj(self, keyRef) {
|
|
@@ -6126,9 +6126,9 @@ var require_ajv = __commonJS({
|
|
|
6126
6126
|
currentOpts = this._opts;
|
|
6127
6127
|
this._opts = this._metaOpts;
|
|
6128
6128
|
}
|
|
6129
|
-
var
|
|
6129
|
+
var v;
|
|
6130
6130
|
try {
|
|
6131
|
-
|
|
6131
|
+
v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs);
|
|
6132
6132
|
} catch (e) {
|
|
6133
6133
|
delete schemaObj.validate;
|
|
6134
6134
|
throw e;
|
|
@@ -6136,11 +6136,11 @@ var require_ajv = __commonJS({
|
|
|
6136
6136
|
schemaObj.compiling = false;
|
|
6137
6137
|
if (schemaObj.meta) this._opts = currentOpts;
|
|
6138
6138
|
}
|
|
6139
|
-
schemaObj.validate =
|
|
6140
|
-
schemaObj.refs =
|
|
6141
|
-
schemaObj.refVal =
|
|
6142
|
-
schemaObj.root =
|
|
6143
|
-
return
|
|
6139
|
+
schemaObj.validate = v;
|
|
6140
|
+
schemaObj.refs = v.refs;
|
|
6141
|
+
schemaObj.refVal = v.refVal;
|
|
6142
|
+
schemaObj.root = v.root;
|
|
6143
|
+
return v;
|
|
6144
6144
|
function callValidate() {
|
|
6145
6145
|
var _validate = schemaObj.validate;
|
|
6146
6146
|
var result = _validate.apply(this, arguments);
|
|
@@ -6245,6 +6245,275 @@ var require_ajv = __commonJS({
|
|
|
6245
6245
|
}
|
|
6246
6246
|
});
|
|
6247
6247
|
|
|
6248
|
+
// node_modules/@isaacs/ttlcache/index.js
|
|
6249
|
+
var require_ttlcache = __commonJS({
|
|
6250
|
+
"node_modules/@isaacs/ttlcache/index.js"(exports, module) {
|
|
6251
|
+
var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
6252
|
+
var now = () => perf.now();
|
|
6253
|
+
var isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
|
|
6254
|
+
var isPosIntOrInf = (n) => n === Infinity || isPosInt(n);
|
|
6255
|
+
var TTLCache2 = class _TTLCache {
|
|
6256
|
+
constructor({
|
|
6257
|
+
max = Infinity,
|
|
6258
|
+
ttl,
|
|
6259
|
+
updateAgeOnGet = false,
|
|
6260
|
+
checkAgeOnGet = false,
|
|
6261
|
+
noUpdateTTL = false,
|
|
6262
|
+
dispose,
|
|
6263
|
+
noDisposeOnSet = false
|
|
6264
|
+
} = {}) {
|
|
6265
|
+
this.expirations = /* @__PURE__ */ Object.create(null);
|
|
6266
|
+
this.data = /* @__PURE__ */ new Map();
|
|
6267
|
+
this.expirationMap = /* @__PURE__ */ new Map();
|
|
6268
|
+
if (ttl !== void 0 && !isPosIntOrInf(ttl)) {
|
|
6269
|
+
throw new TypeError(
|
|
6270
|
+
"ttl must be positive integer or Infinity if set"
|
|
6271
|
+
);
|
|
6272
|
+
}
|
|
6273
|
+
if (!isPosIntOrInf(max)) {
|
|
6274
|
+
throw new TypeError("max must be positive integer or Infinity");
|
|
6275
|
+
}
|
|
6276
|
+
this.ttl = ttl;
|
|
6277
|
+
this.max = max;
|
|
6278
|
+
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
6279
|
+
this.checkAgeOnGet = !!checkAgeOnGet;
|
|
6280
|
+
this.noUpdateTTL = !!noUpdateTTL;
|
|
6281
|
+
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
6282
|
+
if (dispose !== void 0) {
|
|
6283
|
+
if (typeof dispose !== "function") {
|
|
6284
|
+
throw new TypeError("dispose must be function if set");
|
|
6285
|
+
}
|
|
6286
|
+
this.dispose = dispose;
|
|
6287
|
+
}
|
|
6288
|
+
this.timer = void 0;
|
|
6289
|
+
this.timerExpiration = void 0;
|
|
6290
|
+
}
|
|
6291
|
+
setTimer(expiration, ttl) {
|
|
6292
|
+
if (this.timerExpiration < expiration) {
|
|
6293
|
+
return;
|
|
6294
|
+
}
|
|
6295
|
+
if (this.timer) {
|
|
6296
|
+
clearTimeout(this.timer);
|
|
6297
|
+
}
|
|
6298
|
+
const t = setTimeout(() => {
|
|
6299
|
+
this.timer = void 0;
|
|
6300
|
+
this.timerExpiration = void 0;
|
|
6301
|
+
this.purgeStale();
|
|
6302
|
+
for (const exp in this.expirations) {
|
|
6303
|
+
this.setTimer(exp, exp - now());
|
|
6304
|
+
break;
|
|
6305
|
+
}
|
|
6306
|
+
}, ttl);
|
|
6307
|
+
if (t.unref) t.unref();
|
|
6308
|
+
this.timerExpiration = expiration;
|
|
6309
|
+
this.timer = t;
|
|
6310
|
+
}
|
|
6311
|
+
// hang onto the timer so we can clearTimeout if all items
|
|
6312
|
+
// are deleted. Deno doesn't have Timer.unref(), so it
|
|
6313
|
+
// hangs otherwise.
|
|
6314
|
+
cancelTimer() {
|
|
6315
|
+
if (this.timer) {
|
|
6316
|
+
clearTimeout(this.timer);
|
|
6317
|
+
this.timerExpiration = void 0;
|
|
6318
|
+
this.timer = void 0;
|
|
6319
|
+
}
|
|
6320
|
+
}
|
|
6321
|
+
/* istanbul ignore next */
|
|
6322
|
+
cancelTimers() {
|
|
6323
|
+
process.emitWarning(
|
|
6324
|
+
'TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'
|
|
6325
|
+
);
|
|
6326
|
+
return this.cancelTimer();
|
|
6327
|
+
}
|
|
6328
|
+
clear() {
|
|
6329
|
+
const entries = this.dispose !== _TTLCache.prototype.dispose ? [...this] : [];
|
|
6330
|
+
this.data.clear();
|
|
6331
|
+
this.expirationMap.clear();
|
|
6332
|
+
this.cancelTimer();
|
|
6333
|
+
this.expirations = /* @__PURE__ */ Object.create(null);
|
|
6334
|
+
for (const [key, val] of entries) {
|
|
6335
|
+
this.dispose(val, key, "delete");
|
|
6336
|
+
}
|
|
6337
|
+
}
|
|
6338
|
+
setTTL(key, ttl = this.ttl) {
|
|
6339
|
+
const current = this.expirationMap.get(key);
|
|
6340
|
+
if (current !== void 0) {
|
|
6341
|
+
const exp = this.expirations[current];
|
|
6342
|
+
if (!exp || exp.length <= 1) {
|
|
6343
|
+
delete this.expirations[current];
|
|
6344
|
+
} else {
|
|
6345
|
+
this.expirations[current] = exp.filter((k) => k !== key);
|
|
6346
|
+
}
|
|
6347
|
+
}
|
|
6348
|
+
if (ttl !== Infinity) {
|
|
6349
|
+
const expiration = Math.floor(now() + ttl);
|
|
6350
|
+
this.expirationMap.set(key, expiration);
|
|
6351
|
+
if (!this.expirations[expiration]) {
|
|
6352
|
+
this.expirations[expiration] = [];
|
|
6353
|
+
this.setTimer(expiration, ttl);
|
|
6354
|
+
}
|
|
6355
|
+
this.expirations[expiration].push(key);
|
|
6356
|
+
} else {
|
|
6357
|
+
this.expirationMap.set(key, Infinity);
|
|
6358
|
+
}
|
|
6359
|
+
}
|
|
6360
|
+
set(key, val, {
|
|
6361
|
+
ttl = this.ttl,
|
|
6362
|
+
noUpdateTTL = this.noUpdateTTL,
|
|
6363
|
+
noDisposeOnSet = this.noDisposeOnSet
|
|
6364
|
+
} = {}) {
|
|
6365
|
+
if (!isPosIntOrInf(ttl)) {
|
|
6366
|
+
throw new TypeError("ttl must be positive integer or Infinity");
|
|
6367
|
+
}
|
|
6368
|
+
if (this.expirationMap.has(key)) {
|
|
6369
|
+
if (!noUpdateTTL) {
|
|
6370
|
+
this.setTTL(key, ttl);
|
|
6371
|
+
}
|
|
6372
|
+
const oldValue = this.data.get(key);
|
|
6373
|
+
if (oldValue !== val) {
|
|
6374
|
+
this.data.set(key, val);
|
|
6375
|
+
if (!noDisposeOnSet) {
|
|
6376
|
+
this.dispose(oldValue, key, "set");
|
|
6377
|
+
}
|
|
6378
|
+
}
|
|
6379
|
+
} else {
|
|
6380
|
+
this.setTTL(key, ttl);
|
|
6381
|
+
this.data.set(key, val);
|
|
6382
|
+
}
|
|
6383
|
+
while (this.size > this.max) {
|
|
6384
|
+
this.purgeToCapacity();
|
|
6385
|
+
}
|
|
6386
|
+
return this;
|
|
6387
|
+
}
|
|
6388
|
+
has(key) {
|
|
6389
|
+
return this.data.has(key);
|
|
6390
|
+
}
|
|
6391
|
+
getRemainingTTL(key) {
|
|
6392
|
+
const expiration = this.expirationMap.get(key);
|
|
6393
|
+
return expiration === Infinity ? expiration : expiration !== void 0 ? Math.max(0, Math.ceil(expiration - now())) : 0;
|
|
6394
|
+
}
|
|
6395
|
+
get(key, {
|
|
6396
|
+
updateAgeOnGet = this.updateAgeOnGet,
|
|
6397
|
+
ttl = this.ttl,
|
|
6398
|
+
checkAgeOnGet = this.checkAgeOnGet
|
|
6399
|
+
} = {}) {
|
|
6400
|
+
const val = this.data.get(key);
|
|
6401
|
+
if (checkAgeOnGet && this.getRemainingTTL(key) === 0) {
|
|
6402
|
+
this.delete(key);
|
|
6403
|
+
return void 0;
|
|
6404
|
+
}
|
|
6405
|
+
if (updateAgeOnGet) {
|
|
6406
|
+
this.setTTL(key, ttl);
|
|
6407
|
+
}
|
|
6408
|
+
return val;
|
|
6409
|
+
}
|
|
6410
|
+
dispose(_, __) {
|
|
6411
|
+
}
|
|
6412
|
+
delete(key) {
|
|
6413
|
+
const current = this.expirationMap.get(key);
|
|
6414
|
+
if (current !== void 0) {
|
|
6415
|
+
const value = this.data.get(key);
|
|
6416
|
+
this.data.delete(key);
|
|
6417
|
+
this.expirationMap.delete(key);
|
|
6418
|
+
const exp = this.expirations[current];
|
|
6419
|
+
if (exp) {
|
|
6420
|
+
if (exp.length <= 1) {
|
|
6421
|
+
delete this.expirations[current];
|
|
6422
|
+
} else {
|
|
6423
|
+
this.expirations[current] = exp.filter((k) => k !== key);
|
|
6424
|
+
}
|
|
6425
|
+
}
|
|
6426
|
+
this.dispose(value, key, "delete");
|
|
6427
|
+
if (this.size === 0) {
|
|
6428
|
+
this.cancelTimer();
|
|
6429
|
+
}
|
|
6430
|
+
return true;
|
|
6431
|
+
}
|
|
6432
|
+
return false;
|
|
6433
|
+
}
|
|
6434
|
+
purgeToCapacity() {
|
|
6435
|
+
for (const exp in this.expirations) {
|
|
6436
|
+
const keys = this.expirations[exp];
|
|
6437
|
+
if (this.size - keys.length >= this.max) {
|
|
6438
|
+
delete this.expirations[exp];
|
|
6439
|
+
const entries = [];
|
|
6440
|
+
for (const key of keys) {
|
|
6441
|
+
entries.push([key, this.data.get(key)]);
|
|
6442
|
+
this.data.delete(key);
|
|
6443
|
+
this.expirationMap.delete(key);
|
|
6444
|
+
}
|
|
6445
|
+
for (const [key, val] of entries) {
|
|
6446
|
+
this.dispose(val, key, "evict");
|
|
6447
|
+
}
|
|
6448
|
+
} else {
|
|
6449
|
+
const s = this.size - this.max;
|
|
6450
|
+
const entries = [];
|
|
6451
|
+
for (const key of keys.splice(0, s)) {
|
|
6452
|
+
entries.push([key, this.data.get(key)]);
|
|
6453
|
+
this.data.delete(key);
|
|
6454
|
+
this.expirationMap.delete(key);
|
|
6455
|
+
}
|
|
6456
|
+
for (const [key, val] of entries) {
|
|
6457
|
+
this.dispose(val, key, "evict");
|
|
6458
|
+
}
|
|
6459
|
+
return;
|
|
6460
|
+
}
|
|
6461
|
+
}
|
|
6462
|
+
}
|
|
6463
|
+
get size() {
|
|
6464
|
+
return this.data.size;
|
|
6465
|
+
}
|
|
6466
|
+
purgeStale() {
|
|
6467
|
+
const n = Math.ceil(now());
|
|
6468
|
+
for (const exp in this.expirations) {
|
|
6469
|
+
if (exp === "Infinity" || exp > n) {
|
|
6470
|
+
return;
|
|
6471
|
+
}
|
|
6472
|
+
const keys = [...this.expirations[exp] || []];
|
|
6473
|
+
const entries = [];
|
|
6474
|
+
delete this.expirations[exp];
|
|
6475
|
+
for (const key of keys) {
|
|
6476
|
+
entries.push([key, this.data.get(key)]);
|
|
6477
|
+
this.data.delete(key);
|
|
6478
|
+
this.expirationMap.delete(key);
|
|
6479
|
+
}
|
|
6480
|
+
for (const [key, val] of entries) {
|
|
6481
|
+
this.dispose(val, key, "stale");
|
|
6482
|
+
}
|
|
6483
|
+
}
|
|
6484
|
+
if (this.size === 0) {
|
|
6485
|
+
this.cancelTimer();
|
|
6486
|
+
}
|
|
6487
|
+
}
|
|
6488
|
+
*entries() {
|
|
6489
|
+
for (const exp in this.expirations) {
|
|
6490
|
+
for (const key of this.expirations[exp]) {
|
|
6491
|
+
yield [key, this.data.get(key)];
|
|
6492
|
+
}
|
|
6493
|
+
}
|
|
6494
|
+
}
|
|
6495
|
+
*keys() {
|
|
6496
|
+
for (const exp in this.expirations) {
|
|
6497
|
+
for (const key of this.expirations[exp]) {
|
|
6498
|
+
yield key;
|
|
6499
|
+
}
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6502
|
+
*values() {
|
|
6503
|
+
for (const exp in this.expirations) {
|
|
6504
|
+
for (const key of this.expirations[exp]) {
|
|
6505
|
+
yield this.data.get(key);
|
|
6506
|
+
}
|
|
6507
|
+
}
|
|
6508
|
+
}
|
|
6509
|
+
[Symbol.iterator]() {
|
|
6510
|
+
return this.entries();
|
|
6511
|
+
}
|
|
6512
|
+
};
|
|
6513
|
+
module.exports = TTLCache2;
|
|
6514
|
+
}
|
|
6515
|
+
});
|
|
6516
|
+
|
|
6248
6517
|
// node_modules/zod/v3/external.js
|
|
6249
6518
|
var external_exports = {};
|
|
6250
6519
|
__export(external_exports, {
|
|
@@ -6360,7 +6629,7 @@ __export(external_exports, {
|
|
|
6360
6629
|
// node_modules/zod/v3/helpers/util.js
|
|
6361
6630
|
var util;
|
|
6362
6631
|
(function(util2) {
|
|
6363
|
-
util2.assertEqual = (
|
|
6632
|
+
util2.assertEqual = (_) => {
|
|
6364
6633
|
};
|
|
6365
6634
|
function assertIs(_arg) {
|
|
6366
6635
|
}
|
|
@@ -6410,7 +6679,7 @@ var util;
|
|
|
6410
6679
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
6411
6680
|
}
|
|
6412
6681
|
util2.joinValues = joinValues;
|
|
6413
|
-
util2.jsonStringifyReplacer = (
|
|
6682
|
+
util2.jsonStringifyReplacer = (_, value) => {
|
|
6414
6683
|
if (typeof value === "bigint") {
|
|
6415
6684
|
return value.toString();
|
|
6416
6685
|
}
|
|
@@ -6737,7 +7006,7 @@ var makeIssue = (params) => {
|
|
|
6737
7006
|
};
|
|
6738
7007
|
}
|
|
6739
7008
|
let errorMessage = "";
|
|
6740
|
-
const maps = errorMaps.filter((
|
|
7009
|
+
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
6741
7010
|
for (const map of maps) {
|
|
6742
7011
|
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
|
|
6743
7012
|
}
|
|
@@ -6763,7 +7032,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
6763
7032
|
// then global override map
|
|
6764
7033
|
overrideMap === en_default ? void 0 : en_default
|
|
6765
7034
|
// then global default map
|
|
6766
|
-
].filter((
|
|
7035
|
+
].filter((x) => !!x)
|
|
6767
7036
|
});
|
|
6768
7037
|
ctx.common.issues.push(issue);
|
|
6769
7038
|
}
|
|
@@ -6826,10 +7095,10 @@ var INVALID = Object.freeze({
|
|
|
6826
7095
|
});
|
|
6827
7096
|
var DIRTY = (value) => ({ status: "dirty", value });
|
|
6828
7097
|
var OK = (value) => ({ status: "valid", value });
|
|
6829
|
-
var isAborted = (
|
|
6830
|
-
var isDirty = (
|
|
6831
|
-
var isValid = (
|
|
6832
|
-
var isAsync = (
|
|
7098
|
+
var isAborted = (x) => x.status === "aborted";
|
|
7099
|
+
var isDirty = (x) => x.status === "dirty";
|
|
7100
|
+
var isValid = (x) => x.status === "valid";
|
|
7101
|
+
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
6833
7102
|
|
|
6834
7103
|
// node_modules/zod/v3/helpers/errorUtil.js
|
|
6835
7104
|
var errorUtil;
|
|
@@ -9149,17 +9418,17 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
|
9149
9418
|
});
|
|
9150
9419
|
}
|
|
9151
9420
|
};
|
|
9152
|
-
function mergeValues(
|
|
9153
|
-
const aType = getParsedType(
|
|
9154
|
-
const bType = getParsedType(
|
|
9155
|
-
if (
|
|
9156
|
-
return { valid: true, data:
|
|
9421
|
+
function mergeValues(a, b) {
|
|
9422
|
+
const aType = getParsedType(a);
|
|
9423
|
+
const bType = getParsedType(b);
|
|
9424
|
+
if (a === b) {
|
|
9425
|
+
return { valid: true, data: a };
|
|
9157
9426
|
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
|
9158
|
-
const bKeys = util.objectKeys(
|
|
9159
|
-
const sharedKeys = util.objectKeys(
|
|
9160
|
-
const newObj = { ...
|
|
9427
|
+
const bKeys = util.objectKeys(b);
|
|
9428
|
+
const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
9429
|
+
const newObj = { ...a, ...b };
|
|
9161
9430
|
for (const key of sharedKeys) {
|
|
9162
|
-
const sharedValue = mergeValues(
|
|
9431
|
+
const sharedValue = mergeValues(a[key], b[key]);
|
|
9163
9432
|
if (!sharedValue.valid) {
|
|
9164
9433
|
return { valid: false };
|
|
9165
9434
|
}
|
|
@@ -9167,13 +9436,13 @@ function mergeValues(a2, b3) {
|
|
|
9167
9436
|
}
|
|
9168
9437
|
return { valid: true, data: newObj };
|
|
9169
9438
|
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
|
9170
|
-
if (
|
|
9439
|
+
if (a.length !== b.length) {
|
|
9171
9440
|
return { valid: false };
|
|
9172
9441
|
}
|
|
9173
9442
|
const newArray = [];
|
|
9174
|
-
for (let index = 0; index <
|
|
9175
|
-
const itemA =
|
|
9176
|
-
const itemB =
|
|
9443
|
+
for (let index = 0; index < a.length; index++) {
|
|
9444
|
+
const itemA = a[index];
|
|
9445
|
+
const itemB = b[index];
|
|
9177
9446
|
const sharedValue = mergeValues(itemA, itemB);
|
|
9178
9447
|
if (!sharedValue.valid) {
|
|
9179
9448
|
return { valid: false };
|
|
@@ -9181,8 +9450,8 @@ function mergeValues(a2, b3) {
|
|
|
9181
9450
|
newArray.push(sharedValue.data);
|
|
9182
9451
|
}
|
|
9183
9452
|
return { valid: true, data: newArray };
|
|
9184
|
-
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +
|
|
9185
|
-
return { valid: true, data:
|
|
9453
|
+
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
|
|
9454
|
+
return { valid: true, data: a };
|
|
9186
9455
|
} else {
|
|
9187
9456
|
return { valid: false };
|
|
9188
9457
|
}
|
|
@@ -9277,7 +9546,7 @@ var ZodTuple = class _ZodTuple extends ZodType {
|
|
|
9277
9546
|
if (!schema)
|
|
9278
9547
|
return null;
|
|
9279
9548
|
return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
9280
|
-
}).filter((
|
|
9549
|
+
}).filter((x) => !!x);
|
|
9281
9550
|
if (ctx.common.async) {
|
|
9282
9551
|
return Promise.all(items).then((results) => {
|
|
9283
9552
|
return ParseStatus.mergeArray(status, results);
|
|
@@ -9530,7 +9799,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
9530
9799
|
return makeIssue({
|
|
9531
9800
|
data: args,
|
|
9532
9801
|
path: ctx.path,
|
|
9533
|
-
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((
|
|
9802
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
9534
9803
|
issueData: {
|
|
9535
9804
|
code: ZodIssueCode.invalid_arguments,
|
|
9536
9805
|
argumentsError: error
|
|
@@ -9541,7 +9810,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
9541
9810
|
return makeIssue({
|
|
9542
9811
|
data: returns,
|
|
9543
9812
|
path: ctx.path,
|
|
9544
|
-
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((
|
|
9813
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
9545
9814
|
issueData: {
|
|
9546
9815
|
code: ZodIssueCode.invalid_return_type,
|
|
9547
9816
|
returnTypeError: error
|
|
@@ -10135,10 +10404,10 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
|
|
|
10135
10404
|
}
|
|
10136
10405
|
}
|
|
10137
10406
|
}
|
|
10138
|
-
static create(
|
|
10407
|
+
static create(a, b) {
|
|
10139
10408
|
return new _ZodPipeline({
|
|
10140
|
-
in:
|
|
10141
|
-
out:
|
|
10409
|
+
in: a,
|
|
10410
|
+
out: b,
|
|
10142
10411
|
typeName: ZodFirstPartyTypeKind.ZodPipeline
|
|
10143
10412
|
});
|
|
10144
10413
|
}
|
|
@@ -12058,7 +12327,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
12058
12327
|
...refs,
|
|
12059
12328
|
currentPath: [...refs.currentPath, "allOf", "1"]
|
|
12060
12329
|
})
|
|
12061
|
-
].filter((
|
|
12330
|
+
].filter((x) => !!x);
|
|
12062
12331
|
let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
|
|
12063
12332
|
const mergedAllOf = [];
|
|
12064
12333
|
allOf.forEach((schema) => {
|
|
@@ -12276,7 +12545,7 @@ function parseStringDef(def, refs) {
|
|
|
12276
12545
|
case "trim":
|
|
12277
12546
|
break;
|
|
12278
12547
|
default:
|
|
12279
|
-
/* @__PURE__ */ ((
|
|
12548
|
+
/* @__PURE__ */ ((_) => {
|
|
12280
12549
|
})(check);
|
|
12281
12550
|
}
|
|
12282
12551
|
}
|
|
@@ -12298,7 +12567,7 @@ function escapeNonAlphaNumeric(source) {
|
|
|
12298
12567
|
return result;
|
|
12299
12568
|
}
|
|
12300
12569
|
function addFormat(schema, value, message, refs) {
|
|
12301
|
-
if (schema.format || schema.anyOf?.some((
|
|
12570
|
+
if (schema.format || schema.anyOf?.some((x) => x.format)) {
|
|
12302
12571
|
if (!schema.anyOf) {
|
|
12303
12572
|
schema.anyOf = [];
|
|
12304
12573
|
}
|
|
@@ -12326,7 +12595,7 @@ function addFormat(schema, value, message, refs) {
|
|
|
12326
12595
|
}
|
|
12327
12596
|
}
|
|
12328
12597
|
function addPattern(schema, regex, message, refs) {
|
|
12329
|
-
if (schema.pattern || schema.allOf?.some((
|
|
12598
|
+
if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
|
|
12330
12599
|
if (!schema.allOf) {
|
|
12331
12600
|
schema.allOf = [];
|
|
12332
12601
|
}
|
|
@@ -12552,17 +12821,17 @@ function parseUnionDef(def, refs) {
|
|
|
12552
12821
|
if (refs.target === "openApi3")
|
|
12553
12822
|
return asAnyOf(def, refs);
|
|
12554
12823
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
12555
|
-
if (options.every((
|
|
12556
|
-
const types = options.reduce((types2,
|
|
12557
|
-
const type = primitiveMappings[
|
|
12824
|
+
if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
|
|
12825
|
+
const types = options.reduce((types2, x) => {
|
|
12826
|
+
const type = primitiveMappings[x._def.typeName];
|
|
12558
12827
|
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
12559
12828
|
}, []);
|
|
12560
12829
|
return {
|
|
12561
12830
|
type: types.length > 1 ? types : types[0]
|
|
12562
12831
|
};
|
|
12563
|
-
} else if (options.every((
|
|
12564
|
-
const types = options.reduce((acc,
|
|
12565
|
-
const type = typeof
|
|
12832
|
+
} else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
|
|
12833
|
+
const types = options.reduce((acc, x) => {
|
|
12834
|
+
const type = typeof x._def.value;
|
|
12566
12835
|
switch (type) {
|
|
12567
12836
|
case "string":
|
|
12568
12837
|
case "number":
|
|
@@ -12571,7 +12840,7 @@ function parseUnionDef(def, refs) {
|
|
|
12571
12840
|
case "bigint":
|
|
12572
12841
|
return [...acc, "integer"];
|
|
12573
12842
|
case "object":
|
|
12574
|
-
if (
|
|
12843
|
+
if (x._def.value === null)
|
|
12575
12844
|
return [...acc, "null"];
|
|
12576
12845
|
case "symbol":
|
|
12577
12846
|
case "undefined":
|
|
@@ -12581,30 +12850,30 @@ function parseUnionDef(def, refs) {
|
|
|
12581
12850
|
}
|
|
12582
12851
|
}, []);
|
|
12583
12852
|
if (types.length === options.length) {
|
|
12584
|
-
const uniqueTypes = types.filter((
|
|
12853
|
+
const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
|
|
12585
12854
|
return {
|
|
12586
12855
|
type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
|
|
12587
|
-
enum: options.reduce((acc,
|
|
12588
|
-
return acc.includes(
|
|
12856
|
+
enum: options.reduce((acc, x) => {
|
|
12857
|
+
return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
|
|
12589
12858
|
}, [])
|
|
12590
12859
|
};
|
|
12591
12860
|
}
|
|
12592
|
-
} else if (options.every((
|
|
12861
|
+
} else if (options.every((x) => x._def.typeName === "ZodEnum")) {
|
|
12593
12862
|
return {
|
|
12594
12863
|
type: "string",
|
|
12595
|
-
enum: options.reduce((acc,
|
|
12864
|
+
enum: options.reduce((acc, x) => [
|
|
12596
12865
|
...acc,
|
|
12597
|
-
...
|
|
12866
|
+
...x._def.values.filter((x2) => !acc.includes(x2))
|
|
12598
12867
|
], [])
|
|
12599
12868
|
};
|
|
12600
12869
|
}
|
|
12601
12870
|
return asAnyOf(def, refs);
|
|
12602
12871
|
}
|
|
12603
12872
|
var asAnyOf = (def, refs) => {
|
|
12604
|
-
const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((
|
|
12873
|
+
const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {
|
|
12605
12874
|
...refs,
|
|
12606
12875
|
currentPath: [...refs.currentPath, "anyOf", `${i}`]
|
|
12607
|
-
})).filter((
|
|
12876
|
+
})).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0));
|
|
12608
12877
|
return anyOf.length ? { anyOf } : void 0;
|
|
12609
12878
|
};
|
|
12610
12879
|
|
|
@@ -12785,16 +13054,16 @@ var parsePipelineDef = (def, refs) => {
|
|
|
12785
13054
|
} else if (refs.pipeStrategy === "output") {
|
|
12786
13055
|
return parseDef(def.out._def, refs);
|
|
12787
13056
|
}
|
|
12788
|
-
const
|
|
13057
|
+
const a = parseDef(def.in._def, {
|
|
12789
13058
|
...refs,
|
|
12790
13059
|
currentPath: [...refs.currentPath, "allOf", "0"]
|
|
12791
13060
|
});
|
|
12792
|
-
const
|
|
13061
|
+
const b = parseDef(def.out._def, {
|
|
12793
13062
|
...refs,
|
|
12794
|
-
currentPath: [...refs.currentPath, "allOf",
|
|
13063
|
+
currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
|
|
12795
13064
|
});
|
|
12796
13065
|
return {
|
|
12797
|
-
allOf: [
|
|
13066
|
+
allOf: [a, b].filter((x) => x !== void 0)
|
|
12798
13067
|
};
|
|
12799
13068
|
};
|
|
12800
13069
|
|
|
@@ -12829,10 +13098,10 @@ function parseTupleDef(def, refs) {
|
|
|
12829
13098
|
return {
|
|
12830
13099
|
type: "array",
|
|
12831
13100
|
minItems: def.items.length,
|
|
12832
|
-
items: def.items.map((
|
|
13101
|
+
items: def.items.map((x, i) => parseDef(x._def, {
|
|
12833
13102
|
...refs,
|
|
12834
13103
|
currentPath: [...refs.currentPath, "items", `${i}`]
|
|
12835
|
-
})).reduce((acc,
|
|
13104
|
+
})).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
|
|
12836
13105
|
additionalItems: parseDef(def.rest._def, {
|
|
12837
13106
|
...refs,
|
|
12838
13107
|
currentPath: [...refs.currentPath, "additionalItems"]
|
|
@@ -12843,10 +13112,10 @@ function parseTupleDef(def, refs) {
|
|
|
12843
13112
|
type: "array",
|
|
12844
13113
|
minItems: def.items.length,
|
|
12845
13114
|
maxItems: def.items.length,
|
|
12846
|
-
items: def.items.map((
|
|
13115
|
+
items: def.items.map((x, i) => parseDef(x._def, {
|
|
12847
13116
|
...refs,
|
|
12848
13117
|
currentPath: [...refs.currentPath, "items", `${i}`]
|
|
12849
|
-
})).reduce((acc,
|
|
13118
|
+
})).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
|
|
12850
13119
|
};
|
|
12851
13120
|
}
|
|
12852
13121
|
}
|
|
@@ -12940,7 +13209,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
12940
13209
|
case ZodFirstPartyTypeKind.ZodSymbol:
|
|
12941
13210
|
return void 0;
|
|
12942
13211
|
default:
|
|
12943
|
-
return /* @__PURE__ */ ((
|
|
13212
|
+
return /* @__PURE__ */ ((_) => void 0)(typeName);
|
|
12944
13213
|
}
|
|
12945
13214
|
};
|
|
12946
13215
|
|
|
@@ -13203,7 +13472,7 @@ var UriTemplate = class _UriTemplate {
|
|
|
13203
13472
|
const value2 = variables[name];
|
|
13204
13473
|
if (value2 === void 0)
|
|
13205
13474
|
return "";
|
|
13206
|
-
const encoded2 = Array.isArray(value2) ? value2.map((
|
|
13475
|
+
const encoded2 = Array.isArray(value2) ? value2.map((v) => this.encodeValue(v, part.operator)).join(",") : this.encodeValue(value2.toString(), part.operator);
|
|
13207
13476
|
return `${name}=${encoded2}`;
|
|
13208
13477
|
}).filter((pair) => pair.length > 0);
|
|
13209
13478
|
if (pairs.length === 0)
|
|
@@ -13212,16 +13481,16 @@ var UriTemplate = class _UriTemplate {
|
|
|
13212
13481
|
return separator + pairs.join("&");
|
|
13213
13482
|
}
|
|
13214
13483
|
if (part.names.length > 1) {
|
|
13215
|
-
const values2 = part.names.map((name) => variables[name]).filter((
|
|
13484
|
+
const values2 = part.names.map((name) => variables[name]).filter((v) => v !== void 0);
|
|
13216
13485
|
if (values2.length === 0)
|
|
13217
13486
|
return "";
|
|
13218
|
-
return values2.map((
|
|
13487
|
+
return values2.map((v) => Array.isArray(v) ? v[0] : v).join(",");
|
|
13219
13488
|
}
|
|
13220
13489
|
const value = variables[part.name];
|
|
13221
13490
|
if (value === void 0)
|
|
13222
13491
|
return "";
|
|
13223
13492
|
const values = Array.isArray(value) ? value : [value];
|
|
13224
|
-
const encoded = values.map((
|
|
13493
|
+
const encoded = values.map((v) => this.encodeValue(v, part.operator));
|
|
13225
13494
|
switch (part.operator) {
|
|
13226
13495
|
case "":
|
|
13227
13496
|
return encoded.join(",");
|
|
@@ -13516,7 +13785,7 @@ var McpServer = class {
|
|
|
13516
13785
|
}
|
|
13517
13786
|
});
|
|
13518
13787
|
this.server.setRequestHandler(ListResourcesRequestSchema, async (request, extra) => {
|
|
13519
|
-
const resources = Object.entries(this._registeredResources).filter(([
|
|
13788
|
+
const resources = Object.entries(this._registeredResources).filter(([_, resource]) => resource.enabled).map(([uri, resource]) => ({
|
|
13520
13789
|
uri,
|
|
13521
13790
|
name: resource.name,
|
|
13522
13791
|
...resource.metadata
|
|
@@ -14044,1820 +14313,13 @@ var StdioServerTransport = class {
|
|
|
14044
14313
|
}
|
|
14045
14314
|
};
|
|
14046
14315
|
|
|
14047
|
-
// node_modules/@stacksjs/ts-cache/dist/index.js
|
|
14048
|
-
var __create2 = Object.create;
|
|
14049
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
14050
|
-
var __defProp2 = Object.defineProperty;
|
|
14051
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
14052
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
14053
|
-
var __toESM2 = (mod, isNodeMode, target) => {
|
|
14054
|
-
target = mod != null ? __create2(__getProtoOf2(mod)) : {};
|
|
14055
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target;
|
|
14056
|
-
for (let key of __getOwnPropNames2(mod))
|
|
14057
|
-
if (!__hasOwnProp2.call(to, key))
|
|
14058
|
-
__defProp2(to, key, {
|
|
14059
|
-
get: () => mod[key],
|
|
14060
|
-
enumerable: true
|
|
14061
|
-
});
|
|
14062
|
-
return to;
|
|
14063
|
-
};
|
|
14064
|
-
var __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
14065
|
-
var require_clone = __commonJS2((exports, module) => {
|
|
14066
|
-
var clone = function() {
|
|
14067
|
-
function _instanceof(obj, type) {
|
|
14068
|
-
return type != null && obj instanceof type;
|
|
14069
|
-
}
|
|
14070
|
-
var nativeMap;
|
|
14071
|
-
try {
|
|
14072
|
-
nativeMap = Map;
|
|
14073
|
-
} catch (_2) {
|
|
14074
|
-
nativeMap = function() {
|
|
14075
|
-
};
|
|
14076
|
-
}
|
|
14077
|
-
var nativeSet;
|
|
14078
|
-
try {
|
|
14079
|
-
nativeSet = Set;
|
|
14080
|
-
} catch (_2) {
|
|
14081
|
-
nativeSet = function() {
|
|
14082
|
-
};
|
|
14083
|
-
}
|
|
14084
|
-
var nativePromise;
|
|
14085
|
-
try {
|
|
14086
|
-
nativePromise = Promise;
|
|
14087
|
-
} catch (_2) {
|
|
14088
|
-
nativePromise = function() {
|
|
14089
|
-
};
|
|
14090
|
-
}
|
|
14091
|
-
function clone2(parent, circular, depth, prototype, includeNonEnumerable) {
|
|
14092
|
-
if (typeof circular === "object") {
|
|
14093
|
-
depth = circular.depth;
|
|
14094
|
-
prototype = circular.prototype;
|
|
14095
|
-
includeNonEnumerable = circular.includeNonEnumerable;
|
|
14096
|
-
circular = circular.circular;
|
|
14097
|
-
}
|
|
14098
|
-
var allParents = [];
|
|
14099
|
-
var allChildren = [];
|
|
14100
|
-
var useBuffer = typeof Buffer != "undefined";
|
|
14101
|
-
if (typeof circular == "undefined")
|
|
14102
|
-
circular = true;
|
|
14103
|
-
if (typeof depth == "undefined")
|
|
14104
|
-
depth = Infinity;
|
|
14105
|
-
function _clone(parent2, depth2) {
|
|
14106
|
-
if (parent2 === null)
|
|
14107
|
-
return null;
|
|
14108
|
-
if (depth2 === 0)
|
|
14109
|
-
return parent2;
|
|
14110
|
-
var child;
|
|
14111
|
-
var proto;
|
|
14112
|
-
if (typeof parent2 != "object") {
|
|
14113
|
-
return parent2;
|
|
14114
|
-
}
|
|
14115
|
-
if (_instanceof(parent2, nativeMap)) {
|
|
14116
|
-
child = new nativeMap();
|
|
14117
|
-
} else if (_instanceof(parent2, nativeSet)) {
|
|
14118
|
-
child = new nativeSet();
|
|
14119
|
-
} else if (_instanceof(parent2, nativePromise)) {
|
|
14120
|
-
child = new nativePromise(function(resolve, reject) {
|
|
14121
|
-
parent2.then(function(value) {
|
|
14122
|
-
resolve(_clone(value, depth2 - 1));
|
|
14123
|
-
}, function(err) {
|
|
14124
|
-
reject(_clone(err, depth2 - 1));
|
|
14125
|
-
});
|
|
14126
|
-
});
|
|
14127
|
-
} else if (clone2.__isArray(parent2)) {
|
|
14128
|
-
child = [];
|
|
14129
|
-
} else if (clone2.__isRegExp(parent2)) {
|
|
14130
|
-
child = new RegExp(parent2.source, __getRegExpFlags(parent2));
|
|
14131
|
-
if (parent2.lastIndex)
|
|
14132
|
-
child.lastIndex = parent2.lastIndex;
|
|
14133
|
-
} else if (clone2.__isDate(parent2)) {
|
|
14134
|
-
child = new Date(parent2.getTime());
|
|
14135
|
-
} else if (useBuffer && Buffer.isBuffer(parent2)) {
|
|
14136
|
-
if (Buffer.allocUnsafe) {
|
|
14137
|
-
child = Buffer.allocUnsafe(parent2.length);
|
|
14138
|
-
} else {
|
|
14139
|
-
child = new Buffer(parent2.length);
|
|
14140
|
-
}
|
|
14141
|
-
parent2.copy(child);
|
|
14142
|
-
return child;
|
|
14143
|
-
} else if (_instanceof(parent2, Error)) {
|
|
14144
|
-
child = Object.create(parent2);
|
|
14145
|
-
} else {
|
|
14146
|
-
if (typeof prototype == "undefined") {
|
|
14147
|
-
proto = Object.getPrototypeOf(parent2);
|
|
14148
|
-
child = Object.create(proto);
|
|
14149
|
-
} else {
|
|
14150
|
-
child = Object.create(prototype);
|
|
14151
|
-
proto = prototype;
|
|
14152
|
-
}
|
|
14153
|
-
}
|
|
14154
|
-
if (circular) {
|
|
14155
|
-
var index = allParents.indexOf(parent2);
|
|
14156
|
-
if (index != -1) {
|
|
14157
|
-
return allChildren[index];
|
|
14158
|
-
}
|
|
14159
|
-
allParents.push(parent2);
|
|
14160
|
-
allChildren.push(child);
|
|
14161
|
-
}
|
|
14162
|
-
if (_instanceof(parent2, nativeMap)) {
|
|
14163
|
-
parent2.forEach(function(value, key) {
|
|
14164
|
-
var keyChild = _clone(key, depth2 - 1);
|
|
14165
|
-
var valueChild = _clone(value, depth2 - 1);
|
|
14166
|
-
child.set(keyChild, valueChild);
|
|
14167
|
-
});
|
|
14168
|
-
}
|
|
14169
|
-
if (_instanceof(parent2, nativeSet)) {
|
|
14170
|
-
parent2.forEach(function(value) {
|
|
14171
|
-
var entryChild = _clone(value, depth2 - 1);
|
|
14172
|
-
child.add(entryChild);
|
|
14173
|
-
});
|
|
14174
|
-
}
|
|
14175
|
-
for (var i in parent2) {
|
|
14176
|
-
var attrs;
|
|
14177
|
-
if (proto) {
|
|
14178
|
-
attrs = Object.getOwnPropertyDescriptor(proto, i);
|
|
14179
|
-
}
|
|
14180
|
-
if (attrs && attrs.set == null) {
|
|
14181
|
-
continue;
|
|
14182
|
-
}
|
|
14183
|
-
child[i] = _clone(parent2[i], depth2 - 1);
|
|
14184
|
-
}
|
|
14185
|
-
if (Object.getOwnPropertySymbols) {
|
|
14186
|
-
var symbols = Object.getOwnPropertySymbols(parent2);
|
|
14187
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
14188
|
-
var symbol = symbols[i];
|
|
14189
|
-
var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
|
|
14190
|
-
if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
|
|
14191
|
-
continue;
|
|
14192
|
-
}
|
|
14193
|
-
child[symbol] = _clone(parent2[symbol], depth2 - 1);
|
|
14194
|
-
if (!descriptor.enumerable) {
|
|
14195
|
-
Object.defineProperty(child, symbol, {
|
|
14196
|
-
enumerable: false
|
|
14197
|
-
});
|
|
14198
|
-
}
|
|
14199
|
-
}
|
|
14200
|
-
}
|
|
14201
|
-
if (includeNonEnumerable) {
|
|
14202
|
-
var allPropertyNames = Object.getOwnPropertyNames(parent2);
|
|
14203
|
-
for (var i = 0; i < allPropertyNames.length; i++) {
|
|
14204
|
-
var propertyName = allPropertyNames[i];
|
|
14205
|
-
var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName);
|
|
14206
|
-
if (descriptor && descriptor.enumerable) {
|
|
14207
|
-
continue;
|
|
14208
|
-
}
|
|
14209
|
-
child[propertyName] = _clone(parent2[propertyName], depth2 - 1);
|
|
14210
|
-
Object.defineProperty(child, propertyName, {
|
|
14211
|
-
enumerable: false
|
|
14212
|
-
});
|
|
14213
|
-
}
|
|
14214
|
-
}
|
|
14215
|
-
return child;
|
|
14216
|
-
}
|
|
14217
|
-
return _clone(parent, depth);
|
|
14218
|
-
}
|
|
14219
|
-
clone2.clonePrototype = function clonePrototype(parent) {
|
|
14220
|
-
if (parent === null)
|
|
14221
|
-
return null;
|
|
14222
|
-
var c = function() {
|
|
14223
|
-
};
|
|
14224
|
-
c.prototype = parent;
|
|
14225
|
-
return new c();
|
|
14226
|
-
};
|
|
14227
|
-
function __objToStr(o2) {
|
|
14228
|
-
return Object.prototype.toString.call(o2);
|
|
14229
|
-
}
|
|
14230
|
-
clone2.__objToStr = __objToStr;
|
|
14231
|
-
function __isDate(o2) {
|
|
14232
|
-
return typeof o2 === "object" && __objToStr(o2) === "[object Date]";
|
|
14233
|
-
}
|
|
14234
|
-
clone2.__isDate = __isDate;
|
|
14235
|
-
function __isArray(o2) {
|
|
14236
|
-
return typeof o2 === "object" && __objToStr(o2) === "[object Array]";
|
|
14237
|
-
}
|
|
14238
|
-
clone2.__isArray = __isArray;
|
|
14239
|
-
function __isRegExp(o2) {
|
|
14240
|
-
return typeof o2 === "object" && __objToStr(o2) === "[object RegExp]";
|
|
14241
|
-
}
|
|
14242
|
-
clone2.__isRegExp = __isRegExp;
|
|
14243
|
-
function __getRegExpFlags(re) {
|
|
14244
|
-
var flags = "";
|
|
14245
|
-
if (re.global)
|
|
14246
|
-
flags += "g";
|
|
14247
|
-
if (re.ignoreCase)
|
|
14248
|
-
flags += "i";
|
|
14249
|
-
if (re.multiline)
|
|
14250
|
-
flags += "m";
|
|
14251
|
-
return flags;
|
|
14252
|
-
}
|
|
14253
|
-
clone2.__getRegExpFlags = __getRegExpFlags;
|
|
14254
|
-
return clone2;
|
|
14255
|
-
}();
|
|
14256
|
-
if (typeof module === "object" && module.exports) {
|
|
14257
|
-
module.exports = clone;
|
|
14258
|
-
}
|
|
14259
|
-
});
|
|
14260
|
-
var gr = Object.create;
|
|
14261
|
-
var $ = Object.defineProperty;
|
|
14262
|
-
var mr = Object.getOwnPropertyDescriptor;
|
|
14263
|
-
var Ir = Object.getOwnPropertyNames;
|
|
14264
|
-
var Fr = Object.getPrototypeOf;
|
|
14265
|
-
var Ar = Object.prototype.hasOwnProperty;
|
|
14266
|
-
var P = (i, r) => () => (r || i((r = { exports: {} }).exports, r), r.exports);
|
|
14267
|
-
var Ur = (i, r) => {
|
|
14268
|
-
for (var t in r)
|
|
14269
|
-
$(i, t, { get: r[t], enumerable: true });
|
|
14270
|
-
};
|
|
14271
|
-
var D = (i, r, t, e) => {
|
|
14272
|
-
if (r && typeof r == "object" || typeof r == "function")
|
|
14273
|
-
for (let n of Ir(r))
|
|
14274
|
-
!Ar.call(i, n) && n !== t && $(i, n, { get: () => r[n], enumerable: !(e = mr(r, n)) || e.enumerable });
|
|
14275
|
-
return i;
|
|
14276
|
-
};
|
|
14277
|
-
var w = (i, r, t) => (D(i, r, "default"), t && D(t, r, "default"));
|
|
14278
|
-
var O = (i, r, t) => (t = i != null ? gr(Fr(i)) : {}, D(r || !i || !i.__esModule ? $(t, "default", { value: i, enumerable: true }) : t, i));
|
|
14279
|
-
var v = P((L2) => {
|
|
14280
|
-
L2.byteLength = Tr;
|
|
14281
|
-
L2.toByteArray = _r;
|
|
14282
|
-
L2.fromByteArray = Nr;
|
|
14283
|
-
var d2 = [], B = [], Rr = typeof Uint8Array < "u" ? Uint8Array : Array, G = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
14284
|
-
for (F = 0, Z = G.length; F < Z; ++F)
|
|
14285
|
-
d2[F] = G[F], B[G.charCodeAt(F)] = F;
|
|
14286
|
-
var F, Z;
|
|
14287
|
-
B[45] = 62;
|
|
14288
|
-
B[95] = 63;
|
|
14289
|
-
function Q(i) {
|
|
14290
|
-
var r = i.length;
|
|
14291
|
-
if (r % 4 > 0)
|
|
14292
|
-
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
14293
|
-
var t = i.indexOf("=");
|
|
14294
|
-
t === -1 && (t = r);
|
|
14295
|
-
var e = t === r ? 0 : 4 - t % 4;
|
|
14296
|
-
return [t, e];
|
|
14297
|
-
}
|
|
14298
|
-
function Tr(i) {
|
|
14299
|
-
var r = Q(i), t = r[0], e = r[1];
|
|
14300
|
-
return (t + e) * 3 / 4 - e;
|
|
14301
|
-
}
|
|
14302
|
-
function Cr(i, r, t) {
|
|
14303
|
-
return (r + t) * 3 / 4 - t;
|
|
14304
|
-
}
|
|
14305
|
-
function _r(i) {
|
|
14306
|
-
var r, t = Q(i), e = t[0], n = t[1], o2 = new Rr(Cr(i, e, n)), u = 0, f = n > 0 ? e - 4 : e, c;
|
|
14307
|
-
for (c = 0; c < f; c += 4)
|
|
14308
|
-
r = B[i.charCodeAt(c)] << 18 | B[i.charCodeAt(c + 1)] << 12 | B[i.charCodeAt(c + 2)] << 6 | B[i.charCodeAt(c + 3)], o2[u++] = r >> 16 & 255, o2[u++] = r >> 8 & 255, o2[u++] = r & 255;
|
|
14309
|
-
return n === 2 && (r = B[i.charCodeAt(c)] << 2 | B[i.charCodeAt(c + 1)] >> 4, o2[u++] = r & 255), n === 1 && (r = B[i.charCodeAt(c)] << 10 | B[i.charCodeAt(c + 1)] << 4 | B[i.charCodeAt(c + 2)] >> 2, o2[u++] = r >> 8 & 255, o2[u++] = r & 255), o2;
|
|
14310
|
-
}
|
|
14311
|
-
function Sr(i) {
|
|
14312
|
-
return d2[i >> 18 & 63] + d2[i >> 12 & 63] + d2[i >> 6 & 63] + d2[i & 63];
|
|
14313
|
-
}
|
|
14314
|
-
function Lr(i, r, t) {
|
|
14315
|
-
for (var e, n = [], o2 = r; o2 < t; o2 += 3)
|
|
14316
|
-
e = (i[o2] << 16 & 16711680) + (i[o2 + 1] << 8 & 65280) + (i[o2 + 2] & 255), n.push(Sr(e));
|
|
14317
|
-
return n.join("");
|
|
14318
|
-
}
|
|
14319
|
-
function Nr(i) {
|
|
14320
|
-
for (var r, t = i.length, e = t % 3, n = [], o2 = 16383, u = 0, f = t - e; u < f; u += o2)
|
|
14321
|
-
n.push(Lr(i, u, u + o2 > f ? f : u + o2));
|
|
14322
|
-
return e === 1 ? (r = i[t - 1], n.push(d2[r >> 2] + d2[r << 4 & 63] + "==")) : e === 2 && (r = (i[t - 2] << 8) + i[t - 1], n.push(d2[r >> 10] + d2[r >> 4 & 63] + d2[r << 2 & 63] + "=")), n.join("");
|
|
14323
|
-
}
|
|
14324
|
-
});
|
|
14325
|
-
var rr = P((Y) => {
|
|
14326
|
-
Y.read = function(i, r, t, e, n) {
|
|
14327
|
-
var o2, u, f = n * 8 - e - 1, c = (1 << f) - 1, l2 = c >> 1, s = -7, p = t ? n - 1 : 0, U = t ? -1 : 1, E = i[r + p];
|
|
14328
|
-
for (p += U, o2 = E & (1 << -s) - 1, E >>= -s, s += f; s > 0; o2 = o2 * 256 + i[r + p], p += U, s -= 8)
|
|
14329
|
-
;
|
|
14330
|
-
for (u = o2 & (1 << -s) - 1, o2 >>= -s, s += e; s > 0; u = u * 256 + i[r + p], p += U, s -= 8)
|
|
14331
|
-
;
|
|
14332
|
-
if (o2 === 0)
|
|
14333
|
-
o2 = 1 - l2;
|
|
14334
|
-
else {
|
|
14335
|
-
if (o2 === c)
|
|
14336
|
-
return u ? NaN : (E ? -1 : 1) * (1 / 0);
|
|
14337
|
-
u = u + Math.pow(2, e), o2 = o2 - l2;
|
|
14338
|
-
}
|
|
14339
|
-
return (E ? -1 : 1) * u * Math.pow(2, o2 - e);
|
|
14340
|
-
};
|
|
14341
|
-
Y.write = function(i, r, t, e, n, o2) {
|
|
14342
|
-
var u, f, c, l2 = o2 * 8 - n - 1, s = (1 << l2) - 1, p = s >> 1, U = n === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, E = e ? 0 : o2 - 1, k = e ? 1 : -1, dr = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
|
|
14343
|
-
for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (f = isNaN(r) ? 1 : 0, u = s) : (u = Math.floor(Math.log(r) / Math.LN2), r * (c = Math.pow(2, -u)) < 1 && (u--, c *= 2), u + p >= 1 ? r += U / c : r += U * Math.pow(2, 1 - p), r * c >= 2 && (u++, c /= 2), u + p >= s ? (f = 0, u = s) : u + p >= 1 ? (f = (r * c - 1) * Math.pow(2, n), u = u + p) : (f = r * Math.pow(2, p - 1) * Math.pow(2, n), u = 0)); n >= 8; i[t + E] = f & 255, E += k, f /= 256, n -= 8)
|
|
14344
|
-
;
|
|
14345
|
-
for (u = u << n | f, l2 += n; l2 > 0; i[t + E] = u & 255, E += k, u /= 256, l2 -= 8)
|
|
14346
|
-
;
|
|
14347
|
-
i[t + E - k] |= dr * 128;
|
|
14348
|
-
};
|
|
14349
|
-
});
|
|
14350
|
-
var b = P((_2) => {
|
|
14351
|
-
var j2 = v(), T = rr(), tr = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
14352
|
-
_2.Buffer = h2;
|
|
14353
|
-
_2.SlowBuffer = Pr;
|
|
14354
|
-
_2.INSPECT_MAX_BYTES = 50;
|
|
14355
|
-
var N = 2147483647;
|
|
14356
|
-
_2.kMaxLength = N;
|
|
14357
|
-
h2.TYPED_ARRAY_SUPPORT = Mr();
|
|
14358
|
-
!h2.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.");
|
|
14359
|
-
function Mr() {
|
|
14360
|
-
try {
|
|
14361
|
-
let i = new Uint8Array(1), r = { foo: function() {
|
|
14362
|
-
return 42;
|
|
14363
|
-
} };
|
|
14364
|
-
return Object.setPrototypeOf(r, Uint8Array.prototype), Object.setPrototypeOf(i, r), i.foo() === 42;
|
|
14365
|
-
} catch {
|
|
14366
|
-
return false;
|
|
14367
|
-
}
|
|
14368
|
-
}
|
|
14369
|
-
Object.defineProperty(h2.prototype, "parent", { enumerable: true, get: function() {
|
|
14370
|
-
if (!!h2.isBuffer(this))
|
|
14371
|
-
return this.buffer;
|
|
14372
|
-
} });
|
|
14373
|
-
Object.defineProperty(h2.prototype, "offset", { enumerable: true, get: function() {
|
|
14374
|
-
if (!!h2.isBuffer(this))
|
|
14375
|
-
return this.byteOffset;
|
|
14376
|
-
} });
|
|
14377
|
-
function m2(i) {
|
|
14378
|
-
if (i > N)
|
|
14379
|
-
throw new RangeError('The value "' + i + '" is invalid for option "size"');
|
|
14380
|
-
let r = new Uint8Array(i);
|
|
14381
|
-
return Object.setPrototypeOf(r, h2.prototype), r;
|
|
14382
|
-
}
|
|
14383
|
-
function h2(i, r, t) {
|
|
14384
|
-
if (typeof i == "number") {
|
|
14385
|
-
if (typeof r == "string")
|
|
14386
|
-
throw new TypeError('The "string" argument must be of type string. Received type number');
|
|
14387
|
-
return X(i);
|
|
14388
|
-
}
|
|
14389
|
-
return or(i, r, t);
|
|
14390
|
-
}
|
|
14391
|
-
h2.poolSize = 8192;
|
|
14392
|
-
function or(i, r, t) {
|
|
14393
|
-
if (typeof i == "string")
|
|
14394
|
-
return kr(i, r);
|
|
14395
|
-
if (ArrayBuffer.isView(i))
|
|
14396
|
-
return Dr(i);
|
|
14397
|
-
if (i == null)
|
|
14398
|
-
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i);
|
|
14399
|
-
if (g2(i, ArrayBuffer) || i && g2(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (g2(i, SharedArrayBuffer) || i && g2(i.buffer, SharedArrayBuffer)))
|
|
14400
|
-
return W(i, r, t);
|
|
14401
|
-
if (typeof i == "number")
|
|
14402
|
-
throw new TypeError('The "value" argument must not be of type number. Received type number');
|
|
14403
|
-
let e = i.valueOf && i.valueOf();
|
|
14404
|
-
if (e != null && e !== i)
|
|
14405
|
-
return h2.from(e, r, t);
|
|
14406
|
-
let n = $r(i);
|
|
14407
|
-
if (n)
|
|
14408
|
-
return n;
|
|
14409
|
-
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
|
|
14410
|
-
return h2.from(i[Symbol.toPrimitive]("string"), r, t);
|
|
14411
|
-
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i);
|
|
14412
|
-
}
|
|
14413
|
-
h2.from = function(i, r, t) {
|
|
14414
|
-
return or(i, r, t);
|
|
14415
|
-
};
|
|
14416
|
-
Object.setPrototypeOf(h2.prototype, Uint8Array.prototype);
|
|
14417
|
-
Object.setPrototypeOf(h2, Uint8Array);
|
|
14418
|
-
function ur(i) {
|
|
14419
|
-
if (typeof i != "number")
|
|
14420
|
-
throw new TypeError('"size" argument must be of type number');
|
|
14421
|
-
if (i < 0)
|
|
14422
|
-
throw new RangeError('The value "' + i + '" is invalid for option "size"');
|
|
14423
|
-
}
|
|
14424
|
-
function br(i, r, t) {
|
|
14425
|
-
return ur(i), i <= 0 ? m2(i) : r !== void 0 ? typeof t == "string" ? m2(i).fill(r, t) : m2(i).fill(r) : m2(i);
|
|
14426
|
-
}
|
|
14427
|
-
h2.alloc = function(i, r, t) {
|
|
14428
|
-
return br(i, r, t);
|
|
14429
|
-
};
|
|
14430
|
-
function X(i) {
|
|
14431
|
-
return ur(i), m2(i < 0 ? 0 : V(i) | 0);
|
|
14432
|
-
}
|
|
14433
|
-
h2.allocUnsafe = function(i) {
|
|
14434
|
-
return X(i);
|
|
14435
|
-
};
|
|
14436
|
-
h2.allocUnsafeSlow = function(i) {
|
|
14437
|
-
return X(i);
|
|
14438
|
-
};
|
|
14439
|
-
function kr(i, r) {
|
|
14440
|
-
if ((typeof r != "string" || r === "") && (r = "utf8"), !h2.isEncoding(r))
|
|
14441
|
-
throw new TypeError("Unknown encoding: " + r);
|
|
14442
|
-
let t = hr(i, r) | 0, e = m2(t), n = e.write(i, r);
|
|
14443
|
-
return n !== t && (e = e.slice(0, n)), e;
|
|
14444
|
-
}
|
|
14445
|
-
function q(i) {
|
|
14446
|
-
let r = i.length < 0 ? 0 : V(i.length) | 0, t = m2(r);
|
|
14447
|
-
for (let e = 0; e < r; e += 1)
|
|
14448
|
-
t[e] = i[e] & 255;
|
|
14449
|
-
return t;
|
|
14450
|
-
}
|
|
14451
|
-
function Dr(i) {
|
|
14452
|
-
if (g2(i, Uint8Array)) {
|
|
14453
|
-
let r = new Uint8Array(i);
|
|
14454
|
-
return W(r.buffer, r.byteOffset, r.byteLength);
|
|
14455
|
-
}
|
|
14456
|
-
return q(i);
|
|
14457
|
-
}
|
|
14458
|
-
function W(i, r, t) {
|
|
14459
|
-
if (r < 0 || i.byteLength < r)
|
|
14460
|
-
throw new RangeError('"offset" is outside of buffer bounds');
|
|
14461
|
-
if (i.byteLength < r + (t || 0))
|
|
14462
|
-
throw new RangeError('"length" is outside of buffer bounds');
|
|
14463
|
-
let e;
|
|
14464
|
-
return r === void 0 && t === void 0 ? e = new Uint8Array(i) : t === void 0 ? e = new Uint8Array(i, r) : e = new Uint8Array(i, r, t), Object.setPrototypeOf(e, h2.prototype), e;
|
|
14465
|
-
}
|
|
14466
|
-
function $r(i) {
|
|
14467
|
-
if (h2.isBuffer(i)) {
|
|
14468
|
-
let r = V(i.length) | 0, t = m2(r);
|
|
14469
|
-
return t.length === 0 || i.copy(t, 0, 0, r), t;
|
|
14470
|
-
}
|
|
14471
|
-
if (i.length !== void 0)
|
|
14472
|
-
return typeof i.length != "number" || J(i.length) ? m2(0) : q(i);
|
|
14473
|
-
if (i.type === "Buffer" && Array.isArray(i.data))
|
|
14474
|
-
return q(i.data);
|
|
14475
|
-
}
|
|
14476
|
-
function V(i) {
|
|
14477
|
-
if (i >= N)
|
|
14478
|
-
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + N.toString(16) + " bytes");
|
|
14479
|
-
return i | 0;
|
|
14480
|
-
}
|
|
14481
|
-
function Pr(i) {
|
|
14482
|
-
return +i != i && (i = 0), h2.alloc(+i);
|
|
14483
|
-
}
|
|
14484
|
-
h2.isBuffer = function(r) {
|
|
14485
|
-
return r != null && r._isBuffer === true && r !== h2.prototype;
|
|
14486
|
-
};
|
|
14487
|
-
h2.compare = function(r, t) {
|
|
14488
|
-
if (g2(r, Uint8Array) && (r = h2.from(r, r.offset, r.byteLength)), g2(t, Uint8Array) && (t = h2.from(t, t.offset, t.byteLength)), !h2.isBuffer(r) || !h2.isBuffer(t))
|
|
14489
|
-
throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
|
|
14490
|
-
if (r === t)
|
|
14491
|
-
return 0;
|
|
14492
|
-
let e = r.length, n = t.length;
|
|
14493
|
-
for (let o2 = 0, u = Math.min(e, n); o2 < u; ++o2)
|
|
14494
|
-
if (r[o2] !== t[o2]) {
|
|
14495
|
-
e = r[o2], n = t[o2];
|
|
14496
|
-
break;
|
|
14497
|
-
}
|
|
14498
|
-
return e < n ? -1 : n < e ? 1 : 0;
|
|
14499
|
-
};
|
|
14500
|
-
h2.isEncoding = function(r) {
|
|
14501
|
-
switch (String(r).toLowerCase()) {
|
|
14502
|
-
case "hex":
|
|
14503
|
-
case "utf8":
|
|
14504
|
-
case "utf-8":
|
|
14505
|
-
case "ascii":
|
|
14506
|
-
case "latin1":
|
|
14507
|
-
case "binary":
|
|
14508
|
-
case "base64":
|
|
14509
|
-
case "ucs2":
|
|
14510
|
-
case "ucs-2":
|
|
14511
|
-
case "utf16le":
|
|
14512
|
-
case "utf-16le":
|
|
14513
|
-
return true;
|
|
14514
|
-
default:
|
|
14515
|
-
return false;
|
|
14516
|
-
}
|
|
14517
|
-
};
|
|
14518
|
-
h2.concat = function(r, t) {
|
|
14519
|
-
if (!Array.isArray(r))
|
|
14520
|
-
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
14521
|
-
if (r.length === 0)
|
|
14522
|
-
return h2.alloc(0);
|
|
14523
|
-
let e;
|
|
14524
|
-
if (t === void 0)
|
|
14525
|
-
for (t = 0, e = 0; e < r.length; ++e)
|
|
14526
|
-
t += r[e].length;
|
|
14527
|
-
let n = h2.allocUnsafe(t), o2 = 0;
|
|
14528
|
-
for (e = 0; e < r.length; ++e) {
|
|
14529
|
-
let u = r[e];
|
|
14530
|
-
if (g2(u, Uint8Array))
|
|
14531
|
-
o2 + u.length > n.length ? (h2.isBuffer(u) || (u = h2.from(u)), u.copy(n, o2)) : Uint8Array.prototype.set.call(n, u, o2);
|
|
14532
|
-
else if (h2.isBuffer(u))
|
|
14533
|
-
u.copy(n, o2);
|
|
14534
|
-
else
|
|
14535
|
-
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
14536
|
-
o2 += u.length;
|
|
14537
|
-
}
|
|
14538
|
-
return n;
|
|
14539
|
-
};
|
|
14540
|
-
function hr(i, r) {
|
|
14541
|
-
if (h2.isBuffer(i))
|
|
14542
|
-
return i.length;
|
|
14543
|
-
if (ArrayBuffer.isView(i) || g2(i, ArrayBuffer))
|
|
14544
|
-
return i.byteLength;
|
|
14545
|
-
if (typeof i != "string")
|
|
14546
|
-
throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i);
|
|
14547
|
-
let t = i.length, e = arguments.length > 2 && arguments[2] === true;
|
|
14548
|
-
if (!e && t === 0)
|
|
14549
|
-
return 0;
|
|
14550
|
-
let n = false;
|
|
14551
|
-
for (; ; )
|
|
14552
|
-
switch (r) {
|
|
14553
|
-
case "ascii":
|
|
14554
|
-
case "latin1":
|
|
14555
|
-
case "binary":
|
|
14556
|
-
return t;
|
|
14557
|
-
case "utf8":
|
|
14558
|
-
case "utf-8":
|
|
14559
|
-
return H(i).length;
|
|
14560
|
-
case "ucs2":
|
|
14561
|
-
case "ucs-2":
|
|
14562
|
-
case "utf16le":
|
|
14563
|
-
case "utf-16le":
|
|
14564
|
-
return t * 2;
|
|
14565
|
-
case "hex":
|
|
14566
|
-
return t >>> 1;
|
|
14567
|
-
case "base64":
|
|
14568
|
-
return xr(i).length;
|
|
14569
|
-
default:
|
|
14570
|
-
if (n)
|
|
14571
|
-
return e ? -1 : H(i).length;
|
|
14572
|
-
r = ("" + r).toLowerCase(), n = true;
|
|
14573
|
-
}
|
|
14574
|
-
}
|
|
14575
|
-
h2.byteLength = hr;
|
|
14576
|
-
function Or(i, r, t) {
|
|
14577
|
-
let e = false;
|
|
14578
|
-
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))
|
|
14579
|
-
return "";
|
|
14580
|
-
for (i || (i = "utf8"); ; )
|
|
14581
|
-
switch (i) {
|
|
14582
|
-
case "hex":
|
|
14583
|
-
return Jr(this, r, t);
|
|
14584
|
-
case "utf8":
|
|
14585
|
-
case "utf-8":
|
|
14586
|
-
return cr(this, r, t);
|
|
14587
|
-
case "ascii":
|
|
14588
|
-
return Vr(this, r, t);
|
|
14589
|
-
case "latin1":
|
|
14590
|
-
case "binary":
|
|
14591
|
-
return zr(this, r, t);
|
|
14592
|
-
case "base64":
|
|
14593
|
-
return Hr(this, r, t);
|
|
14594
|
-
case "ucs2":
|
|
14595
|
-
case "ucs-2":
|
|
14596
|
-
case "utf16le":
|
|
14597
|
-
case "utf-16le":
|
|
14598
|
-
return Kr(this, r, t);
|
|
14599
|
-
default:
|
|
14600
|
-
if (e)
|
|
14601
|
-
throw new TypeError("Unknown encoding: " + i);
|
|
14602
|
-
i = (i + "").toLowerCase(), e = true;
|
|
14603
|
-
}
|
|
14604
|
-
}
|
|
14605
|
-
h2.prototype._isBuffer = true;
|
|
14606
|
-
function A(i, r, t) {
|
|
14607
|
-
let e = i[r];
|
|
14608
|
-
i[r] = i[t], i[t] = e;
|
|
14609
|
-
}
|
|
14610
|
-
h2.prototype.swap16 = function() {
|
|
14611
|
-
let r = this.length;
|
|
14612
|
-
if (r % 2 !== 0)
|
|
14613
|
-
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
14614
|
-
for (let t = 0; t < r; t += 2)
|
|
14615
|
-
A(this, t, t + 1);
|
|
14616
|
-
return this;
|
|
14617
|
-
};
|
|
14618
|
-
h2.prototype.swap32 = function() {
|
|
14619
|
-
let r = this.length;
|
|
14620
|
-
if (r % 4 !== 0)
|
|
14621
|
-
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
14622
|
-
for (let t = 0; t < r; t += 4)
|
|
14623
|
-
A(this, t, t + 3), A(this, t + 1, t + 2);
|
|
14624
|
-
return this;
|
|
14625
|
-
};
|
|
14626
|
-
h2.prototype.swap64 = function() {
|
|
14627
|
-
let r = this.length;
|
|
14628
|
-
if (r % 8 !== 0)
|
|
14629
|
-
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
14630
|
-
for (let t = 0; t < r; t += 8)
|
|
14631
|
-
A(this, t, t + 7), A(this, t + 1, t + 6), A(this, t + 2, t + 5), A(this, t + 3, t + 4);
|
|
14632
|
-
return this;
|
|
14633
|
-
};
|
|
14634
|
-
h2.prototype.toString = function() {
|
|
14635
|
-
let r = this.length;
|
|
14636
|
-
return r === 0 ? "" : arguments.length === 0 ? cr(this, 0, r) : Or.apply(this, arguments);
|
|
14637
|
-
};
|
|
14638
|
-
h2.prototype.toLocaleString = h2.prototype.toString;
|
|
14639
|
-
h2.prototype.equals = function(r) {
|
|
14640
|
-
if (!h2.isBuffer(r))
|
|
14641
|
-
throw new TypeError("Argument must be a Buffer");
|
|
14642
|
-
return this === r ? true : h2.compare(this, r) === 0;
|
|
14643
|
-
};
|
|
14644
|
-
h2.prototype.inspect = function() {
|
|
14645
|
-
let r = "", t = _2.INSPECT_MAX_BYTES;
|
|
14646
|
-
return r = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (r += " ... "), "<Buffer " + r + ">";
|
|
14647
|
-
};
|
|
14648
|
-
tr && (h2.prototype[tr] = h2.prototype.inspect);
|
|
14649
|
-
h2.prototype.compare = function(r, t, e, n, o2) {
|
|
14650
|
-
if (g2(r, Uint8Array) && (r = h2.from(r, r.offset, r.byteLength)), !h2.isBuffer(r))
|
|
14651
|
-
throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof r);
|
|
14652
|
-
if (t === void 0 && (t = 0), e === void 0 && (e = r ? r.length : 0), n === void 0 && (n = 0), o2 === void 0 && (o2 = this.length), t < 0 || e > r.length || n < 0 || o2 > this.length)
|
|
14653
|
-
throw new RangeError("out of range index");
|
|
14654
|
-
if (n >= o2 && t >= e)
|
|
14655
|
-
return 0;
|
|
14656
|
-
if (n >= o2)
|
|
14657
|
-
return -1;
|
|
14658
|
-
if (t >= e)
|
|
14659
|
-
return 1;
|
|
14660
|
-
if (t >>>= 0, e >>>= 0, n >>>= 0, o2 >>>= 0, this === r)
|
|
14661
|
-
return 0;
|
|
14662
|
-
let u = o2 - n, f = e - t, c = Math.min(u, f), l2 = this.slice(n, o2), s = r.slice(t, e);
|
|
14663
|
-
for (let p = 0; p < c; ++p)
|
|
14664
|
-
if (l2[p] !== s[p]) {
|
|
14665
|
-
u = l2[p], f = s[p];
|
|
14666
|
-
break;
|
|
14667
|
-
}
|
|
14668
|
-
return u < f ? -1 : f < u ? 1 : 0;
|
|
14669
|
-
};
|
|
14670
|
-
function fr(i, r, t, e, n) {
|
|
14671
|
-
if (i.length === 0)
|
|
14672
|
-
return -1;
|
|
14673
|
-
if (typeof t == "string" ? (e = t, t = 0) : t > 2147483647 ? t = 2147483647 : t < -2147483648 && (t = -2147483648), t = +t, J(t) && (t = n ? 0 : i.length - 1), t < 0 && (t = i.length + t), t >= i.length) {
|
|
14674
|
-
if (n)
|
|
14675
|
-
return -1;
|
|
14676
|
-
t = i.length - 1;
|
|
14677
|
-
} else if (t < 0)
|
|
14678
|
-
if (n)
|
|
14679
|
-
t = 0;
|
|
14680
|
-
else
|
|
14681
|
-
return -1;
|
|
14682
|
-
if (typeof r == "string" && (r = h2.from(r, e)), h2.isBuffer(r))
|
|
14683
|
-
return r.length === 0 ? -1 : ir(i, r, t, e, n);
|
|
14684
|
-
if (typeof r == "number")
|
|
14685
|
-
return r = r & 255, typeof Uint8Array.prototype.indexOf == "function" ? n ? Uint8Array.prototype.indexOf.call(i, r, t) : Uint8Array.prototype.lastIndexOf.call(i, r, t) : ir(i, [r], t, e, n);
|
|
14686
|
-
throw new TypeError("val must be string, number or Buffer");
|
|
14687
|
-
}
|
|
14688
|
-
function ir(i, r, t, e, n) {
|
|
14689
|
-
let o2 = 1, u = i.length, f = r.length;
|
|
14690
|
-
if (e !== void 0 && (e = String(e).toLowerCase(), e === "ucs2" || e === "ucs-2" || e === "utf16le" || e === "utf-16le")) {
|
|
14691
|
-
if (i.length < 2 || r.length < 2)
|
|
14692
|
-
return -1;
|
|
14693
|
-
o2 = 2, u /= 2, f /= 2, t /= 2;
|
|
14694
|
-
}
|
|
14695
|
-
function c(s, p) {
|
|
14696
|
-
return o2 === 1 ? s[p] : s.readUInt16BE(p * o2);
|
|
14697
|
-
}
|
|
14698
|
-
let l2;
|
|
14699
|
-
if (n) {
|
|
14700
|
-
let s = -1;
|
|
14701
|
-
for (l2 = t; l2 < u; l2++)
|
|
14702
|
-
if (c(i, l2) === c(r, s === -1 ? 0 : l2 - s)) {
|
|
14703
|
-
if (s === -1 && (s = l2), l2 - s + 1 === f)
|
|
14704
|
-
return s * o2;
|
|
14705
|
-
} else
|
|
14706
|
-
s !== -1 && (l2 -= l2 - s), s = -1;
|
|
14707
|
-
} else
|
|
14708
|
-
for (t + f > u && (t = u - f), l2 = t; l2 >= 0; l2--) {
|
|
14709
|
-
let s = true;
|
|
14710
|
-
for (let p = 0; p < f; p++)
|
|
14711
|
-
if (c(i, l2 + p) !== c(r, p)) {
|
|
14712
|
-
s = false;
|
|
14713
|
-
break;
|
|
14714
|
-
}
|
|
14715
|
-
if (s)
|
|
14716
|
-
return l2;
|
|
14717
|
-
}
|
|
14718
|
-
return -1;
|
|
14719
|
-
}
|
|
14720
|
-
h2.prototype.includes = function(r, t, e) {
|
|
14721
|
-
return this.indexOf(r, t, e) !== -1;
|
|
14722
|
-
};
|
|
14723
|
-
h2.prototype.indexOf = function(r, t, e) {
|
|
14724
|
-
return fr(this, r, t, e, true);
|
|
14725
|
-
};
|
|
14726
|
-
h2.prototype.lastIndexOf = function(r, t, e) {
|
|
14727
|
-
return fr(this, r, t, e, false);
|
|
14728
|
-
};
|
|
14729
|
-
function Gr(i, r, t, e) {
|
|
14730
|
-
t = Number(t) || 0;
|
|
14731
|
-
let n = i.length - t;
|
|
14732
|
-
e ? (e = Number(e), e > n && (e = n)) : e = n;
|
|
14733
|
-
let o2 = r.length;
|
|
14734
|
-
e > o2 / 2 && (e = o2 / 2);
|
|
14735
|
-
let u;
|
|
14736
|
-
for (u = 0; u < e; ++u) {
|
|
14737
|
-
let f = parseInt(r.substr(u * 2, 2), 16);
|
|
14738
|
-
if (J(f))
|
|
14739
|
-
return u;
|
|
14740
|
-
i[t + u] = f;
|
|
14741
|
-
}
|
|
14742
|
-
return u;
|
|
14743
|
-
}
|
|
14744
|
-
function Yr(i, r, t, e) {
|
|
14745
|
-
return M(H(r, i.length - t), i, t, e);
|
|
14746
|
-
}
|
|
14747
|
-
function jr(i, r, t, e) {
|
|
14748
|
-
return M(rt(r), i, t, e);
|
|
14749
|
-
}
|
|
14750
|
-
function qr(i, r, t, e) {
|
|
14751
|
-
return M(xr(r), i, t, e);
|
|
14752
|
-
}
|
|
14753
|
-
function Wr(i, r, t, e) {
|
|
14754
|
-
return M(tt(r, i.length - t), i, t, e);
|
|
14755
|
-
}
|
|
14756
|
-
h2.prototype.write = function(r, t, e, n) {
|
|
14757
|
-
if (t === void 0)
|
|
14758
|
-
n = "utf8", e = this.length, t = 0;
|
|
14759
|
-
else if (e === void 0 && typeof t == "string")
|
|
14760
|
-
n = t, e = this.length, t = 0;
|
|
14761
|
-
else if (isFinite(t))
|
|
14762
|
-
t = t >>> 0, isFinite(e) ? (e = e >>> 0, n === void 0 && (n = "utf8")) : (n = e, e = void 0);
|
|
14763
|
-
else
|
|
14764
|
-
throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
|
|
14765
|
-
let o2 = this.length - t;
|
|
14766
|
-
if ((e === void 0 || e > o2) && (e = o2), r.length > 0 && (e < 0 || t < 0) || t > this.length)
|
|
14767
|
-
throw new RangeError("Attempt to write outside buffer bounds");
|
|
14768
|
-
n || (n = "utf8");
|
|
14769
|
-
let u = false;
|
|
14770
|
-
for (; ; )
|
|
14771
|
-
switch (n) {
|
|
14772
|
-
case "hex":
|
|
14773
|
-
return Gr(this, r, t, e);
|
|
14774
|
-
case "utf8":
|
|
14775
|
-
case "utf-8":
|
|
14776
|
-
return Yr(this, r, t, e);
|
|
14777
|
-
case "ascii":
|
|
14778
|
-
case "latin1":
|
|
14779
|
-
case "binary":
|
|
14780
|
-
return jr(this, r, t, e);
|
|
14781
|
-
case "base64":
|
|
14782
|
-
return qr(this, r, t, e);
|
|
14783
|
-
case "ucs2":
|
|
14784
|
-
case "ucs-2":
|
|
14785
|
-
case "utf16le":
|
|
14786
|
-
case "utf-16le":
|
|
14787
|
-
return Wr(this, r, t, e);
|
|
14788
|
-
default:
|
|
14789
|
-
if (u)
|
|
14790
|
-
throw new TypeError("Unknown encoding: " + n);
|
|
14791
|
-
n = ("" + n).toLowerCase(), u = true;
|
|
14792
|
-
}
|
|
14793
|
-
};
|
|
14794
|
-
h2.prototype.toJSON = function() {
|
|
14795
|
-
return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
|
|
14796
|
-
};
|
|
14797
|
-
function Hr(i, r, t) {
|
|
14798
|
-
return r === 0 && t === i.length ? j2.fromByteArray(i) : j2.fromByteArray(i.slice(r, t));
|
|
14799
|
-
}
|
|
14800
|
-
function cr(i, r, t) {
|
|
14801
|
-
t = Math.min(i.length, t);
|
|
14802
|
-
let e = [], n = r;
|
|
14803
|
-
for (; n < t; ) {
|
|
14804
|
-
let o2 = i[n], u = null, f = o2 > 239 ? 4 : o2 > 223 ? 3 : o2 > 191 ? 2 : 1;
|
|
14805
|
-
if (n + f <= t) {
|
|
14806
|
-
let c, l2, s, p;
|
|
14807
|
-
switch (f) {
|
|
14808
|
-
case 1:
|
|
14809
|
-
o2 < 128 && (u = o2);
|
|
14810
|
-
break;
|
|
14811
|
-
case 2:
|
|
14812
|
-
c = i[n + 1], (c & 192) === 128 && (p = (o2 & 31) << 6 | c & 63, p > 127 && (u = p));
|
|
14813
|
-
break;
|
|
14814
|
-
case 3:
|
|
14815
|
-
c = i[n + 1], l2 = i[n + 2], (c & 192) === 128 && (l2 & 192) === 128 && (p = (o2 & 15) << 12 | (c & 63) << 6 | l2 & 63, p > 2047 && (p < 55296 || p > 57343) && (u = p));
|
|
14816
|
-
break;
|
|
14817
|
-
case 4:
|
|
14818
|
-
c = i[n + 1], l2 = i[n + 2], s = i[n + 3], (c & 192) === 128 && (l2 & 192) === 128 && (s & 192) === 128 && (p = (o2 & 15) << 18 | (c & 63) << 12 | (l2 & 63) << 6 | s & 63, p > 65535 && p < 1114112 && (u = p));
|
|
14819
|
-
}
|
|
14820
|
-
}
|
|
14821
|
-
u === null ? (u = 65533, f = 1) : u > 65535 && (u -= 65536, e.push(u >>> 10 & 1023 | 55296), u = 56320 | u & 1023), e.push(u), n += f;
|
|
14822
|
-
}
|
|
14823
|
-
return Xr(e);
|
|
14824
|
-
}
|
|
14825
|
-
var er = 4096;
|
|
14826
|
-
function Xr(i) {
|
|
14827
|
-
let r = i.length;
|
|
14828
|
-
if (r <= er)
|
|
14829
|
-
return String.fromCharCode.apply(String, i);
|
|
14830
|
-
let t = "", e = 0;
|
|
14831
|
-
for (; e < r; )
|
|
14832
|
-
t += String.fromCharCode.apply(String, i.slice(e, e += er));
|
|
14833
|
-
return t;
|
|
14834
|
-
}
|
|
14835
|
-
function Vr(i, r, t) {
|
|
14836
|
-
let e = "";
|
|
14837
|
-
t = Math.min(i.length, t);
|
|
14838
|
-
for (let n = r; n < t; ++n)
|
|
14839
|
-
e += String.fromCharCode(i[n] & 127);
|
|
14840
|
-
return e;
|
|
14841
|
-
}
|
|
14842
|
-
function zr(i, r, t) {
|
|
14843
|
-
let e = "";
|
|
14844
|
-
t = Math.min(i.length, t);
|
|
14845
|
-
for (let n = r; n < t; ++n)
|
|
14846
|
-
e += String.fromCharCode(i[n]);
|
|
14847
|
-
return e;
|
|
14848
|
-
}
|
|
14849
|
-
function Jr(i, r, t) {
|
|
14850
|
-
let e = i.length;
|
|
14851
|
-
(!r || r < 0) && (r = 0), (!t || t < 0 || t > e) && (t = e);
|
|
14852
|
-
let n = "";
|
|
14853
|
-
for (let o2 = r; o2 < t; ++o2)
|
|
14854
|
-
n += it[i[o2]];
|
|
14855
|
-
return n;
|
|
14856
|
-
}
|
|
14857
|
-
function Kr(i, r, t) {
|
|
14858
|
-
let e = i.slice(r, t), n = "";
|
|
14859
|
-
for (let o2 = 0; o2 < e.length - 1; o2 += 2)
|
|
14860
|
-
n += String.fromCharCode(e[o2] + e[o2 + 1] * 256);
|
|
14861
|
-
return n;
|
|
14862
|
-
}
|
|
14863
|
-
h2.prototype.slice = function(r, t) {
|
|
14864
|
-
let e = this.length;
|
|
14865
|
-
r = ~~r, t = t === void 0 ? e : ~~t, r < 0 ? (r += e, r < 0 && (r = 0)) : r > e && (r = e), t < 0 ? (t += e, t < 0 && (t = 0)) : t > e && (t = e), t < r && (t = r);
|
|
14866
|
-
let n = this.subarray(r, t);
|
|
14867
|
-
return Object.setPrototypeOf(n, h2.prototype), n;
|
|
14868
|
-
};
|
|
14869
|
-
function a2(i, r, t) {
|
|
14870
|
-
if (i % 1 !== 0 || i < 0)
|
|
14871
|
-
throw new RangeError("offset is not uint");
|
|
14872
|
-
if (i + r > t)
|
|
14873
|
-
throw new RangeError("Trying to access beyond buffer length");
|
|
14874
|
-
}
|
|
14875
|
-
h2.prototype.readUintLE = h2.prototype.readUIntLE = function(r, t, e) {
|
|
14876
|
-
r = r >>> 0, t = t >>> 0, e || a2(r, t, this.length);
|
|
14877
|
-
let n = this[r], o2 = 1, u = 0;
|
|
14878
|
-
for (; ++u < t && (o2 *= 256); )
|
|
14879
|
-
n += this[r + u] * o2;
|
|
14880
|
-
return n;
|
|
14881
|
-
};
|
|
14882
|
-
h2.prototype.readUintBE = h2.prototype.readUIntBE = function(r, t, e) {
|
|
14883
|
-
r = r >>> 0, t = t >>> 0, e || a2(r, t, this.length);
|
|
14884
|
-
let n = this[r + --t], o2 = 1;
|
|
14885
|
-
for (; t > 0 && (o2 *= 256); )
|
|
14886
|
-
n += this[r + --t] * o2;
|
|
14887
|
-
return n;
|
|
14888
|
-
};
|
|
14889
|
-
h2.prototype.readUint8 = h2.prototype.readUInt8 = function(r, t) {
|
|
14890
|
-
return r = r >>> 0, t || a2(r, 1, this.length), this[r];
|
|
14891
|
-
};
|
|
14892
|
-
h2.prototype.readUint16LE = h2.prototype.readUInt16LE = function(r, t) {
|
|
14893
|
-
return r = r >>> 0, t || a2(r, 2, this.length), this[r] | this[r + 1] << 8;
|
|
14894
|
-
};
|
|
14895
|
-
h2.prototype.readUint16BE = h2.prototype.readUInt16BE = function(r, t) {
|
|
14896
|
-
return r = r >>> 0, t || a2(r, 2, this.length), this[r] << 8 | this[r + 1];
|
|
14897
|
-
};
|
|
14898
|
-
h2.prototype.readUint32LE = h2.prototype.readUInt32LE = function(r, t) {
|
|
14899
|
-
return r = r >>> 0, t || a2(r, 4, this.length), (this[r] | this[r + 1] << 8 | this[r + 2] << 16) + this[r + 3] * 16777216;
|
|
14900
|
-
};
|
|
14901
|
-
h2.prototype.readUint32BE = h2.prototype.readUInt32BE = function(r, t) {
|
|
14902
|
-
return r = r >>> 0, t || a2(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
|
|
14903
|
-
};
|
|
14904
|
-
h2.prototype.readBigUInt64LE = I(function(r) {
|
|
14905
|
-
r = r >>> 0, C2(r, "offset");
|
|
14906
|
-
let t = this[r], e = this[r + 7];
|
|
14907
|
-
(t === void 0 || e === void 0) && S(r, this.length - 8);
|
|
14908
|
-
let n = t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, o2 = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + e * 2 ** 24;
|
|
14909
|
-
return BigInt(n) + (BigInt(o2) << BigInt(32));
|
|
14910
|
-
});
|
|
14911
|
-
h2.prototype.readBigUInt64BE = I(function(r) {
|
|
14912
|
-
r = r >>> 0, C2(r, "offset");
|
|
14913
|
-
let t = this[r], e = this[r + 7];
|
|
14914
|
-
(t === void 0 || e === void 0) && S(r, this.length - 8);
|
|
14915
|
-
let n = t * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r], o2 = this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + e;
|
|
14916
|
-
return (BigInt(n) << BigInt(32)) + BigInt(o2);
|
|
14917
|
-
});
|
|
14918
|
-
h2.prototype.readIntLE = function(r, t, e) {
|
|
14919
|
-
r = r >>> 0, t = t >>> 0, e || a2(r, t, this.length);
|
|
14920
|
-
let n = this[r], o2 = 1, u = 0;
|
|
14921
|
-
for (; ++u < t && (o2 *= 256); )
|
|
14922
|
-
n += this[r + u] * o2;
|
|
14923
|
-
return o2 *= 128, n >= o2 && (n -= Math.pow(2, 8 * t)), n;
|
|
14924
|
-
};
|
|
14925
|
-
h2.prototype.readIntBE = function(r, t, e) {
|
|
14926
|
-
r = r >>> 0, t = t >>> 0, e || a2(r, t, this.length);
|
|
14927
|
-
let n = t, o2 = 1, u = this[r + --n];
|
|
14928
|
-
for (; n > 0 && (o2 *= 256); )
|
|
14929
|
-
u += this[r + --n] * o2;
|
|
14930
|
-
return o2 *= 128, u >= o2 && (u -= Math.pow(2, 8 * t)), u;
|
|
14931
|
-
};
|
|
14932
|
-
h2.prototype.readInt8 = function(r, t) {
|
|
14933
|
-
return r = r >>> 0, t || a2(r, 1, this.length), this[r] & 128 ? (255 - this[r] + 1) * -1 : this[r];
|
|
14934
|
-
};
|
|
14935
|
-
h2.prototype.readInt16LE = function(r, t) {
|
|
14936
|
-
r = r >>> 0, t || a2(r, 2, this.length);
|
|
14937
|
-
let e = this[r] | this[r + 1] << 8;
|
|
14938
|
-
return e & 32768 ? e | 4294901760 : e;
|
|
14939
|
-
};
|
|
14940
|
-
h2.prototype.readInt16BE = function(r, t) {
|
|
14941
|
-
r = r >>> 0, t || a2(r, 2, this.length);
|
|
14942
|
-
let e = this[r + 1] | this[r] << 8;
|
|
14943
|
-
return e & 32768 ? e | 4294901760 : e;
|
|
14944
|
-
};
|
|
14945
|
-
h2.prototype.readInt32LE = function(r, t) {
|
|
14946
|
-
return r = r >>> 0, t || a2(r, 4, this.length), this[r] | this[r + 1] << 8 | this[r + 2] << 16 | this[r + 3] << 24;
|
|
14947
|
-
};
|
|
14948
|
-
h2.prototype.readInt32BE = function(r, t) {
|
|
14949
|
-
return r = r >>> 0, t || a2(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
|
|
14950
|
-
};
|
|
14951
|
-
h2.prototype.readBigInt64LE = I(function(r) {
|
|
14952
|
-
r = r >>> 0, C2(r, "offset");
|
|
14953
|
-
let t = this[r], e = this[r + 7];
|
|
14954
|
-
(t === void 0 || e === void 0) && S(r, this.length - 8);
|
|
14955
|
-
let n = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (e << 24);
|
|
14956
|
-
return (BigInt(n) << BigInt(32)) + BigInt(t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
|
|
14957
|
-
});
|
|
14958
|
-
h2.prototype.readBigInt64BE = I(function(r) {
|
|
14959
|
-
r = r >>> 0, C2(r, "offset");
|
|
14960
|
-
let t = this[r], e = this[r + 7];
|
|
14961
|
-
(t === void 0 || e === void 0) && S(r, this.length - 8);
|
|
14962
|
-
let n = (t << 24) + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r];
|
|
14963
|
-
return (BigInt(n) << BigInt(32)) + BigInt(this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + e);
|
|
14964
|
-
});
|
|
14965
|
-
h2.prototype.readFloatLE = function(r, t) {
|
|
14966
|
-
return r = r >>> 0, t || a2(r, 4, this.length), T.read(this, r, true, 23, 4);
|
|
14967
|
-
};
|
|
14968
|
-
h2.prototype.readFloatBE = function(r, t) {
|
|
14969
|
-
return r = r >>> 0, t || a2(r, 4, this.length), T.read(this, r, false, 23, 4);
|
|
14970
|
-
};
|
|
14971
|
-
h2.prototype.readDoubleLE = function(r, t) {
|
|
14972
|
-
return r = r >>> 0, t || a2(r, 8, this.length), T.read(this, r, true, 52, 8);
|
|
14973
|
-
};
|
|
14974
|
-
h2.prototype.readDoubleBE = function(r, t) {
|
|
14975
|
-
return r = r >>> 0, t || a2(r, 8, this.length), T.read(this, r, false, 52, 8);
|
|
14976
|
-
};
|
|
14977
|
-
function x2(i, r, t, e, n, o2) {
|
|
14978
|
-
if (!h2.isBuffer(i))
|
|
14979
|
-
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
14980
|
-
if (r > n || r < o2)
|
|
14981
|
-
throw new RangeError('"value" argument is out of bounds');
|
|
14982
|
-
if (t + e > i.length)
|
|
14983
|
-
throw new RangeError("Index out of range");
|
|
14984
|
-
}
|
|
14985
|
-
h2.prototype.writeUintLE = h2.prototype.writeUIntLE = function(r, t, e, n) {
|
|
14986
|
-
if (r = +r, t = t >>> 0, e = e >>> 0, !n) {
|
|
14987
|
-
let f = Math.pow(2, 8 * e) - 1;
|
|
14988
|
-
x2(this, r, t, e, f, 0);
|
|
14989
|
-
}
|
|
14990
|
-
let o2 = 1, u = 0;
|
|
14991
|
-
for (this[t] = r & 255; ++u < e && (o2 *= 256); )
|
|
14992
|
-
this[t + u] = r / o2 & 255;
|
|
14993
|
-
return t + e;
|
|
14994
|
-
};
|
|
14995
|
-
h2.prototype.writeUintBE = h2.prototype.writeUIntBE = function(r, t, e, n) {
|
|
14996
|
-
if (r = +r, t = t >>> 0, e = e >>> 0, !n) {
|
|
14997
|
-
let f = Math.pow(2, 8 * e) - 1;
|
|
14998
|
-
x2(this, r, t, e, f, 0);
|
|
14999
|
-
}
|
|
15000
|
-
let o2 = e - 1, u = 1;
|
|
15001
|
-
for (this[t + o2] = r & 255; --o2 >= 0 && (u *= 256); )
|
|
15002
|
-
this[t + o2] = r / u & 255;
|
|
15003
|
-
return t + e;
|
|
15004
|
-
};
|
|
15005
|
-
h2.prototype.writeUint8 = h2.prototype.writeUInt8 = function(r, t, e) {
|
|
15006
|
-
return r = +r, t = t >>> 0, e || x2(this, r, t, 1, 255, 0), this[t] = r & 255, t + 1;
|
|
15007
|
-
};
|
|
15008
|
-
h2.prototype.writeUint16LE = h2.prototype.writeUInt16LE = function(r, t, e) {
|
|
15009
|
-
return r = +r, t = t >>> 0, e || x2(this, r, t, 2, 65535, 0), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
|
|
15010
|
-
};
|
|
15011
|
-
h2.prototype.writeUint16BE = h2.prototype.writeUInt16BE = function(r, t, e) {
|
|
15012
|
-
return r = +r, t = t >>> 0, e || x2(this, r, t, 2, 65535, 0), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
|
|
15013
|
-
};
|
|
15014
|
-
h2.prototype.writeUint32LE = h2.prototype.writeUInt32LE = function(r, t, e) {
|
|
15015
|
-
return r = +r, t = t >>> 0, e || x2(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;
|
|
15016
|
-
};
|
|
15017
|
-
h2.prototype.writeUint32BE = h2.prototype.writeUInt32BE = function(r, t, e) {
|
|
15018
|
-
return r = +r, t = t >>> 0, e || x2(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;
|
|
15019
|
-
};
|
|
15020
|
-
function pr(i, r, t, e, n) {
|
|
15021
|
-
wr(r, e, n, i, t, 7);
|
|
15022
|
-
let o2 = Number(r & BigInt(4294967295));
|
|
15023
|
-
i[t++] = o2, o2 = o2 >> 8, i[t++] = o2, o2 = o2 >> 8, i[t++] = o2, o2 = o2 >> 8, i[t++] = o2;
|
|
15024
|
-
let u = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
15025
|
-
return i[t++] = u, u = u >> 8, i[t++] = u, u = u >> 8, i[t++] = u, u = u >> 8, i[t++] = u, t;
|
|
15026
|
-
}
|
|
15027
|
-
function sr(i, r, t, e, n) {
|
|
15028
|
-
wr(r, e, n, i, t, 7);
|
|
15029
|
-
let o2 = Number(r & BigInt(4294967295));
|
|
15030
|
-
i[t + 7] = o2, o2 = o2 >> 8, i[t + 6] = o2, o2 = o2 >> 8, i[t + 5] = o2, o2 = o2 >> 8, i[t + 4] = o2;
|
|
15031
|
-
let u = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
15032
|
-
return i[t + 3] = u, u = u >> 8, i[t + 2] = u, u = u >> 8, i[t + 1] = u, u = u >> 8, i[t] = u, t + 8;
|
|
15033
|
-
}
|
|
15034
|
-
h2.prototype.writeBigUInt64LE = I(function(r, t = 0) {
|
|
15035
|
-
return pr(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
15036
|
-
});
|
|
15037
|
-
h2.prototype.writeBigUInt64BE = I(function(r, t = 0) {
|
|
15038
|
-
return sr(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
15039
|
-
});
|
|
15040
|
-
h2.prototype.writeIntLE = function(r, t, e, n) {
|
|
15041
|
-
if (r = +r, t = t >>> 0, !n) {
|
|
15042
|
-
let c = Math.pow(2, 8 * e - 1);
|
|
15043
|
-
x2(this, r, t, e, c - 1, -c);
|
|
15044
|
-
}
|
|
15045
|
-
let o2 = 0, u = 1, f = 0;
|
|
15046
|
-
for (this[t] = r & 255; ++o2 < e && (u *= 256); )
|
|
15047
|
-
r < 0 && f === 0 && this[t + o2 - 1] !== 0 && (f = 1), this[t + o2] = (r / u >> 0) - f & 255;
|
|
15048
|
-
return t + e;
|
|
15049
|
-
};
|
|
15050
|
-
h2.prototype.writeIntBE = function(r, t, e, n) {
|
|
15051
|
-
if (r = +r, t = t >>> 0, !n) {
|
|
15052
|
-
let c = Math.pow(2, 8 * e - 1);
|
|
15053
|
-
x2(this, r, t, e, c - 1, -c);
|
|
15054
|
-
}
|
|
15055
|
-
let o2 = e - 1, u = 1, f = 0;
|
|
15056
|
-
for (this[t + o2] = r & 255; --o2 >= 0 && (u *= 256); )
|
|
15057
|
-
r < 0 && f === 0 && this[t + o2 + 1] !== 0 && (f = 1), this[t + o2] = (r / u >> 0) - f & 255;
|
|
15058
|
-
return t + e;
|
|
15059
|
-
};
|
|
15060
|
-
h2.prototype.writeInt8 = function(r, t, e) {
|
|
15061
|
-
return r = +r, t = t >>> 0, e || x2(this, r, t, 1, 127, -128), r < 0 && (r = 255 + r + 1), this[t] = r & 255, t + 1;
|
|
15062
|
-
};
|
|
15063
|
-
h2.prototype.writeInt16LE = function(r, t, e) {
|
|
15064
|
-
return r = +r, t = t >>> 0, e || x2(this, r, t, 2, 32767, -32768), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
|
|
15065
|
-
};
|
|
15066
|
-
h2.prototype.writeInt16BE = function(r, t, e) {
|
|
15067
|
-
return r = +r, t = t >>> 0, e || x2(this, r, t, 2, 32767, -32768), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
|
|
15068
|
-
};
|
|
15069
|
-
h2.prototype.writeInt32LE = function(r, t, e) {
|
|
15070
|
-
return r = +r, t = t >>> 0, e || x2(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;
|
|
15071
|
-
};
|
|
15072
|
-
h2.prototype.writeInt32BE = function(r, t, e) {
|
|
15073
|
-
return r = +r, t = t >>> 0, e || x2(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;
|
|
15074
|
-
};
|
|
15075
|
-
h2.prototype.writeBigInt64LE = I(function(r, t = 0) {
|
|
15076
|
-
return pr(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
15077
|
-
});
|
|
15078
|
-
h2.prototype.writeBigInt64BE = I(function(r, t = 0) {
|
|
15079
|
-
return sr(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
15080
|
-
});
|
|
15081
|
-
function lr(i, r, t, e, n, o2) {
|
|
15082
|
-
if (t + e > i.length)
|
|
15083
|
-
throw new RangeError("Index out of range");
|
|
15084
|
-
if (t < 0)
|
|
15085
|
-
throw new RangeError("Index out of range");
|
|
15086
|
-
}
|
|
15087
|
-
function ar(i, r, t, e, n) {
|
|
15088
|
-
return r = +r, t = t >>> 0, n || lr(i, r, t, 4, 34028234663852886e22, -34028234663852886e22), T.write(i, r, t, e, 23, 4), t + 4;
|
|
15089
|
-
}
|
|
15090
|
-
h2.prototype.writeFloatLE = function(r, t, e) {
|
|
15091
|
-
return ar(this, r, t, true, e);
|
|
15092
|
-
};
|
|
15093
|
-
h2.prototype.writeFloatBE = function(r, t, e) {
|
|
15094
|
-
return ar(this, r, t, false, e);
|
|
15095
|
-
};
|
|
15096
|
-
function yr(i, r, t, e, n) {
|
|
15097
|
-
return r = +r, t = t >>> 0, n || lr(i, r, t, 8, 17976931348623157e292, -17976931348623157e292), T.write(i, r, t, e, 52, 8), t + 8;
|
|
15098
|
-
}
|
|
15099
|
-
h2.prototype.writeDoubleLE = function(r, t, e) {
|
|
15100
|
-
return yr(this, r, t, true, e);
|
|
15101
|
-
};
|
|
15102
|
-
h2.prototype.writeDoubleBE = function(r, t, e) {
|
|
15103
|
-
return yr(this, r, t, false, e);
|
|
15104
|
-
};
|
|
15105
|
-
h2.prototype.copy = function(r, t, e, n) {
|
|
15106
|
-
if (!h2.isBuffer(r))
|
|
15107
|
-
throw new TypeError("argument should be a Buffer");
|
|
15108
|
-
if (e || (e = 0), !n && n !== 0 && (n = this.length), t >= r.length && (t = r.length), t || (t = 0), n > 0 && n < e && (n = e), n === e || r.length === 0 || this.length === 0)
|
|
15109
|
-
return 0;
|
|
15110
|
-
if (t < 0)
|
|
15111
|
-
throw new RangeError("targetStart out of bounds");
|
|
15112
|
-
if (e < 0 || e >= this.length)
|
|
15113
|
-
throw new RangeError("Index out of range");
|
|
15114
|
-
if (n < 0)
|
|
15115
|
-
throw new RangeError("sourceEnd out of bounds");
|
|
15116
|
-
n > this.length && (n = this.length), r.length - t < n - e && (n = r.length - t + e);
|
|
15117
|
-
let o2 = n - e;
|
|
15118
|
-
return this === r && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(t, e, n) : Uint8Array.prototype.set.call(r, this.subarray(e, n), t), o2;
|
|
15119
|
-
};
|
|
15120
|
-
h2.prototype.fill = function(r, t, e, n) {
|
|
15121
|
-
if (typeof r == "string") {
|
|
15122
|
-
if (typeof t == "string" ? (n = t, t = 0, e = this.length) : typeof e == "string" && (n = e, e = this.length), n !== void 0 && typeof n != "string")
|
|
15123
|
-
throw new TypeError("encoding must be a string");
|
|
15124
|
-
if (typeof n == "string" && !h2.isEncoding(n))
|
|
15125
|
-
throw new TypeError("Unknown encoding: " + n);
|
|
15126
|
-
if (r.length === 1) {
|
|
15127
|
-
let u = r.charCodeAt(0);
|
|
15128
|
-
(n === "utf8" && u < 128 || n === "latin1") && (r = u);
|
|
15129
|
-
}
|
|
15130
|
-
} else
|
|
15131
|
-
typeof r == "number" ? r = r & 255 : typeof r == "boolean" && (r = Number(r));
|
|
15132
|
-
if (t < 0 || this.length < t || this.length < e)
|
|
15133
|
-
throw new RangeError("Out of range index");
|
|
15134
|
-
if (e <= t)
|
|
15135
|
-
return this;
|
|
15136
|
-
t = t >>> 0, e = e === void 0 ? this.length : e >>> 0, r || (r = 0);
|
|
15137
|
-
let o2;
|
|
15138
|
-
if (typeof r == "number")
|
|
15139
|
-
for (o2 = t; o2 < e; ++o2)
|
|
15140
|
-
this[o2] = r;
|
|
15141
|
-
else {
|
|
15142
|
-
let u = h2.isBuffer(r) ? r : h2.from(r, n), f = u.length;
|
|
15143
|
-
if (f === 0)
|
|
15144
|
-
throw new TypeError('The value "' + r + '" is invalid for argument "value"');
|
|
15145
|
-
for (o2 = 0; o2 < e - t; ++o2)
|
|
15146
|
-
this[o2 + t] = u[o2 % f];
|
|
15147
|
-
}
|
|
15148
|
-
return this;
|
|
15149
|
-
};
|
|
15150
|
-
var R2 = {};
|
|
15151
|
-
function z(i, r, t) {
|
|
15152
|
-
R2[i] = class extends t {
|
|
15153
|
-
constructor() {
|
|
15154
|
-
super(), Object.defineProperty(this, "message", { value: r.apply(this, arguments), writable: true, configurable: true }), this.name = `${this.name} [${i}]`, this.stack, delete this.name;
|
|
15155
|
-
}
|
|
15156
|
-
get code() {
|
|
15157
|
-
return i;
|
|
15158
|
-
}
|
|
15159
|
-
set code(n) {
|
|
15160
|
-
Object.defineProperty(this, "code", { configurable: true, enumerable: true, value: n, writable: true });
|
|
15161
|
-
}
|
|
15162
|
-
toString() {
|
|
15163
|
-
return `${this.name} [${i}]: ${this.message}`;
|
|
15164
|
-
}
|
|
15165
|
-
};
|
|
15166
|
-
}
|
|
15167
|
-
z("ERR_BUFFER_OUT_OF_BOUNDS", function(i) {
|
|
15168
|
-
return i ? `${i} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
15169
|
-
}, RangeError);
|
|
15170
|
-
z("ERR_INVALID_ARG_TYPE", function(i, r) {
|
|
15171
|
-
return `The "${i}" argument must be of type number. Received type ${typeof r}`;
|
|
15172
|
-
}, TypeError);
|
|
15173
|
-
z("ERR_OUT_OF_RANGE", function(i, r, t) {
|
|
15174
|
-
let e = `The value of "${i}" is out of range.`, n = t;
|
|
15175
|
-
return Number.isInteger(t) && Math.abs(t) > 2 ** 32 ? n = nr(String(t)) : typeof t == "bigint" && (n = String(t), (t > BigInt(2) ** BigInt(32) || t < -(BigInt(2) ** BigInt(32))) && (n = nr(n)), n += "n"), e += ` It must be ${r}. Received ${n}`, e;
|
|
15176
|
-
}, RangeError);
|
|
15177
|
-
function nr(i) {
|
|
15178
|
-
let r = "", t = i.length, e = i[0] === "-" ? 1 : 0;
|
|
15179
|
-
for (; t >= e + 4; t -= 3)
|
|
15180
|
-
r = `_${i.slice(t - 3, t)}${r}`;
|
|
15181
|
-
return `${i.slice(0, t)}${r}`;
|
|
15182
|
-
}
|
|
15183
|
-
function Zr(i, r, t) {
|
|
15184
|
-
C2(r, "offset"), (i[r] === void 0 || i[r + t] === void 0) && S(r, i.length - (t + 1));
|
|
15185
|
-
}
|
|
15186
|
-
function wr(i, r, t, e, n, o2) {
|
|
15187
|
-
if (i > t || i < r) {
|
|
15188
|
-
let u = typeof r == "bigint" ? "n" : "", f;
|
|
15189
|
-
throw o2 > 3 ? r === 0 || r === BigInt(0) ? f = `>= 0${u} and < 2${u} ** ${(o2 + 1) * 8}${u}` : f = `>= -(2${u} ** ${(o2 + 1) * 8 - 1}${u}) and < 2 ** ${(o2 + 1) * 8 - 1}${u}` : f = `>= ${r}${u} and <= ${t}${u}`, new R2.ERR_OUT_OF_RANGE("value", f, i);
|
|
15190
|
-
}
|
|
15191
|
-
Zr(e, n, o2);
|
|
15192
|
-
}
|
|
15193
|
-
function C2(i, r) {
|
|
15194
|
-
if (typeof i != "number")
|
|
15195
|
-
throw new R2.ERR_INVALID_ARG_TYPE(r, "number", i);
|
|
15196
|
-
}
|
|
15197
|
-
function S(i, r, t) {
|
|
15198
|
-
throw Math.floor(i) !== i ? (C2(i, t), new R2.ERR_OUT_OF_RANGE(t || "offset", "an integer", i)) : r < 0 ? new R2.ERR_BUFFER_OUT_OF_BOUNDS() : new R2.ERR_OUT_OF_RANGE(t || "offset", `>= ${t ? 1 : 0} and <= ${r}`, i);
|
|
15199
|
-
}
|
|
15200
|
-
var Qr = /[^+/0-9A-Za-z-_]/g;
|
|
15201
|
-
function vr(i) {
|
|
15202
|
-
if (i = i.split("=")[0], i = i.trim().replace(Qr, ""), i.length < 2)
|
|
15203
|
-
return "";
|
|
15204
|
-
for (; i.length % 4 !== 0; )
|
|
15205
|
-
i = i + "=";
|
|
15206
|
-
return i;
|
|
15207
|
-
}
|
|
15208
|
-
function H(i, r) {
|
|
15209
|
-
r = r || 1 / 0;
|
|
15210
|
-
let t, e = i.length, n = null, o2 = [];
|
|
15211
|
-
for (let u = 0; u < e; ++u) {
|
|
15212
|
-
if (t = i.charCodeAt(u), t > 55295 && t < 57344) {
|
|
15213
|
-
if (!n) {
|
|
15214
|
-
if (t > 56319) {
|
|
15215
|
-
(r -= 3) > -1 && o2.push(239, 191, 189);
|
|
15216
|
-
continue;
|
|
15217
|
-
} else if (u + 1 === e) {
|
|
15218
|
-
(r -= 3) > -1 && o2.push(239, 191, 189);
|
|
15219
|
-
continue;
|
|
15220
|
-
}
|
|
15221
|
-
n = t;
|
|
15222
|
-
continue;
|
|
15223
|
-
}
|
|
15224
|
-
if (t < 56320) {
|
|
15225
|
-
(r -= 3) > -1 && o2.push(239, 191, 189), n = t;
|
|
15226
|
-
continue;
|
|
15227
|
-
}
|
|
15228
|
-
t = (n - 55296 << 10 | t - 56320) + 65536;
|
|
15229
|
-
} else
|
|
15230
|
-
n && (r -= 3) > -1 && o2.push(239, 191, 189);
|
|
15231
|
-
if (n = null, t < 128) {
|
|
15232
|
-
if ((r -= 1) < 0)
|
|
15233
|
-
break;
|
|
15234
|
-
o2.push(t);
|
|
15235
|
-
} else if (t < 2048) {
|
|
15236
|
-
if ((r -= 2) < 0)
|
|
15237
|
-
break;
|
|
15238
|
-
o2.push(t >> 6 | 192, t & 63 | 128);
|
|
15239
|
-
} else if (t < 65536) {
|
|
15240
|
-
if ((r -= 3) < 0)
|
|
15241
|
-
break;
|
|
15242
|
-
o2.push(t >> 12 | 224, t >> 6 & 63 | 128, t & 63 | 128);
|
|
15243
|
-
} else if (t < 1114112) {
|
|
15244
|
-
if ((r -= 4) < 0)
|
|
15245
|
-
break;
|
|
15246
|
-
o2.push(t >> 18 | 240, t >> 12 & 63 | 128, t >> 6 & 63 | 128, t & 63 | 128);
|
|
15247
|
-
} else
|
|
15248
|
-
throw new Error("Invalid code point");
|
|
15249
|
-
}
|
|
15250
|
-
return o2;
|
|
15251
|
-
}
|
|
15252
|
-
function rt(i) {
|
|
15253
|
-
let r = [];
|
|
15254
|
-
for (let t = 0; t < i.length; ++t)
|
|
15255
|
-
r.push(i.charCodeAt(t) & 255);
|
|
15256
|
-
return r;
|
|
15257
|
-
}
|
|
15258
|
-
function tt(i, r) {
|
|
15259
|
-
let t, e, n, o2 = [];
|
|
15260
|
-
for (let u = 0; u < i.length && !((r -= 2) < 0); ++u)
|
|
15261
|
-
t = i.charCodeAt(u), e = t >> 8, n = t % 256, o2.push(n), o2.push(e);
|
|
15262
|
-
return o2;
|
|
15263
|
-
}
|
|
15264
|
-
function xr(i) {
|
|
15265
|
-
return j2.toByteArray(vr(i));
|
|
15266
|
-
}
|
|
15267
|
-
function M(i, r, t, e) {
|
|
15268
|
-
let n;
|
|
15269
|
-
for (n = 0; n < e && !(n + t >= r.length || n >= i.length); ++n)
|
|
15270
|
-
r[n + t] = i[n];
|
|
15271
|
-
return n;
|
|
15272
|
-
}
|
|
15273
|
-
function g2(i, r) {
|
|
15274
|
-
return i instanceof r || i != null && i.constructor != null && i.constructor.name != null && i.constructor.name === r.name;
|
|
15275
|
-
}
|
|
15276
|
-
function J(i) {
|
|
15277
|
-
return i !== i;
|
|
15278
|
-
}
|
|
15279
|
-
var it = function() {
|
|
15280
|
-
let i = "0123456789abcdef", r = new Array(256);
|
|
15281
|
-
for (let t = 0; t < 16; ++t) {
|
|
15282
|
-
let e = t * 16;
|
|
15283
|
-
for (let n = 0; n < 16; ++n)
|
|
15284
|
-
r[e + n] = i[t] + i[n];
|
|
15285
|
-
}
|
|
15286
|
-
return r;
|
|
15287
|
-
}();
|
|
15288
|
-
function I(i) {
|
|
15289
|
-
return typeof BigInt > "u" ? et : i;
|
|
15290
|
-
}
|
|
15291
|
-
function et() {
|
|
15292
|
-
throw new Error("BigInt not supported");
|
|
15293
|
-
}
|
|
15294
|
-
});
|
|
15295
|
-
var y = {};
|
|
15296
|
-
Ur(y, { Blob: () => ot, Buffer: () => Er.Buffer, File: () => ut, atob: () => ht, btoa: () => ft, constants: () => lt, createObjectURL: () => ct, default: () => Br.Buffer, isAscii: () => pt, isUtf8: () => st, kMaxLength: () => nt, kStringMaxLength: () => K, resolveObjectURL: () => at, transcode: () => yt });
|
|
15297
|
-
w(y, O(b()));
|
|
15298
|
-
var Br = O(b());
|
|
15299
|
-
var Er = O(b());
|
|
15300
|
-
var K = 2 ** 32 - 1;
|
|
15301
|
-
var nt = 9007199254740991;
|
|
15302
|
-
var { Blob: ot, File: ut, atob: ht, btoa: ft } = globalThis;
|
|
15303
|
-
var { createObjectURL: ct } = URL;
|
|
15304
|
-
var pt = (i) => ArrayBuffer.isView(i) ? i.every((r) => r < 128) : i.split("").every((r) => r.charCodeAt(0) < 128);
|
|
15305
|
-
var st = (i) => {
|
|
15306
|
-
throw new Error("Not implemented");
|
|
15307
|
-
};
|
|
15308
|
-
var lt = { __proto__: null, MAX_LENGTH: K, MAX_STRING_LENGTH: K, BYTES_PER_ELEMENT: 1 };
|
|
15309
|
-
function at(i) {
|
|
15310
|
-
throw new Error("Not implemented");
|
|
15311
|
-
}
|
|
15312
|
-
function yt(i, r, t) {
|
|
15313
|
-
throw new Error("Not implemented");
|
|
15314
|
-
}
|
|
15315
|
-
var export_Buffer = Er.Buffer;
|
|
15316
|
-
var export_default = Br.Buffer;
|
|
15317
|
-
var a = typeof Reflect == "object" ? Reflect : null;
|
|
15318
|
-
var d = a && typeof a.apply == "function" ? a.apply : function(e, n, r) {
|
|
15319
|
-
return Function.prototype.apply.call(e, n, r);
|
|
15320
|
-
};
|
|
15321
|
-
var l;
|
|
15322
|
-
a && typeof a.ownKeys == "function" ? l = a.ownKeys : Object.getOwnPropertySymbols ? l = function(e) {
|
|
15323
|
-
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
15324
|
-
} : l = function(e) {
|
|
15325
|
-
return Object.getOwnPropertyNames(e);
|
|
15326
|
-
};
|
|
15327
|
-
function x(t) {
|
|
15328
|
-
console && console.warn && console.warn(t);
|
|
15329
|
-
}
|
|
15330
|
-
var L = Number.isNaN || function(e) {
|
|
15331
|
-
return e !== e;
|
|
15332
|
-
};
|
|
15333
|
-
function o() {
|
|
15334
|
-
o.init.call(this);
|
|
15335
|
-
}
|
|
15336
|
-
o.EventEmitter = o;
|
|
15337
|
-
o.prototype._events = void 0;
|
|
15338
|
-
o.prototype._eventsCount = 0;
|
|
15339
|
-
o.prototype._maxListeners = void 0;
|
|
15340
|
-
var h = 10;
|
|
15341
|
-
function v2(t) {
|
|
15342
|
-
if (typeof t != "function")
|
|
15343
|
-
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
|
|
15344
|
-
}
|
|
15345
|
-
Object.defineProperty(o, "defaultMaxListeners", { enumerable: true, get: function() {
|
|
15346
|
-
return h;
|
|
15347
|
-
}, set: function(t) {
|
|
15348
|
-
if (typeof t != "number" || t < 0 || L(t))
|
|
15349
|
-
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
|
|
15350
|
-
h = t;
|
|
15351
|
-
} });
|
|
15352
|
-
o.init = function() {
|
|
15353
|
-
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
15354
|
-
};
|
|
15355
|
-
o.prototype.setMaxListeners = function(e) {
|
|
15356
|
-
if (typeof e != "number" || e < 0 || L(e))
|
|
15357
|
-
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
15358
|
-
return this._maxListeners = e, this;
|
|
15359
|
-
};
|
|
15360
|
-
function m(t) {
|
|
15361
|
-
return t._maxListeners === void 0 ? o.defaultMaxListeners : t._maxListeners;
|
|
15362
|
-
}
|
|
15363
|
-
o.prototype.getMaxListeners = function() {
|
|
15364
|
-
return m(this);
|
|
15365
|
-
};
|
|
15366
|
-
o.prototype.emit = function(e) {
|
|
15367
|
-
for (var n = [], r = 1; r < arguments.length; r++)
|
|
15368
|
-
n.push(arguments[r]);
|
|
15369
|
-
var i = e === "error", f = this._events;
|
|
15370
|
-
if (f !== void 0)
|
|
15371
|
-
i = i && f.error === void 0;
|
|
15372
|
-
else if (!i)
|
|
15373
|
-
return false;
|
|
15374
|
-
if (i) {
|
|
15375
|
-
var s;
|
|
15376
|
-
if (n.length > 0 && (s = n[0]), s instanceof Error)
|
|
15377
|
-
throw s;
|
|
15378
|
-
var u = new Error("Unhandled error." + (s ? " (" + s.message + ")" : ""));
|
|
15379
|
-
throw u.context = s, u;
|
|
15380
|
-
}
|
|
15381
|
-
var c = f[e];
|
|
15382
|
-
if (c === void 0)
|
|
15383
|
-
return false;
|
|
15384
|
-
if (typeof c == "function")
|
|
15385
|
-
d(c, this, n);
|
|
15386
|
-
else
|
|
15387
|
-
for (var p = c.length, O2 = b2(c, p), r = 0; r < p; ++r)
|
|
15388
|
-
d(O2[r], this, n);
|
|
15389
|
-
return true;
|
|
15390
|
-
};
|
|
15391
|
-
function y2(t, e, n, r) {
|
|
15392
|
-
var i, f, s;
|
|
15393
|
-
if (v2(n), f = t._events, f === void 0 ? (f = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (f.newListener !== void 0 && (t.emit("newListener", e, n.listener ? n.listener : n), f = t._events), s = f[e]), s === void 0)
|
|
15394
|
-
s = f[e] = n, ++t._eventsCount;
|
|
15395
|
-
else if (typeof s == "function" ? s = f[e] = r ? [n, s] : [s, n] : r ? s.unshift(n) : s.push(n), i = m(t), i > 0 && s.length > i && !s.warned) {
|
|
15396
|
-
s.warned = true;
|
|
15397
|
-
var u = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
15398
|
-
u.name = "MaxListenersExceededWarning", u.emitter = t, u.type = e, u.count = s.length, x(u);
|
|
15399
|
-
}
|
|
15400
|
-
return t;
|
|
15401
|
-
}
|
|
15402
|
-
o.prototype.addListener = function(e, n) {
|
|
15403
|
-
return y2(this, e, n, false);
|
|
15404
|
-
};
|
|
15405
|
-
o.prototype.on = o.prototype.addListener;
|
|
15406
|
-
o.prototype.prependListener = function(e, n) {
|
|
15407
|
-
return y2(this, e, n, true);
|
|
15408
|
-
};
|
|
15409
|
-
function C() {
|
|
15410
|
-
if (!this.fired)
|
|
15411
|
-
return this.target.removeListener(this.type, this.wrapFn), this.fired = true, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
15412
|
-
}
|
|
15413
|
-
function g(t, e, n) {
|
|
15414
|
-
var r = { fired: false, wrapFn: void 0, target: t, type: e, listener: n }, i = C.bind(r);
|
|
15415
|
-
return i.listener = n, r.wrapFn = i, i;
|
|
15416
|
-
}
|
|
15417
|
-
o.prototype.once = function(e, n) {
|
|
15418
|
-
return v2(n), this.on(e, g(this, e, n)), this;
|
|
15419
|
-
};
|
|
15420
|
-
o.prototype.prependOnceListener = function(e, n) {
|
|
15421
|
-
return v2(n), this.prependListener(e, g(this, e, n)), this;
|
|
15422
|
-
};
|
|
15423
|
-
o.prototype.removeListener = function(e, n) {
|
|
15424
|
-
var r, i, f, s, u;
|
|
15425
|
-
if (v2(n), i = this._events, i === void 0)
|
|
15426
|
-
return this;
|
|
15427
|
-
if (r = i[e], r === void 0)
|
|
15428
|
-
return this;
|
|
15429
|
-
if (r === n || r.listener === n)
|
|
15430
|
-
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete i[e], i.removeListener && this.emit("removeListener", e, r.listener || n));
|
|
15431
|
-
else if (typeof r != "function") {
|
|
15432
|
-
for (f = -1, s = r.length - 1; s >= 0; s--)
|
|
15433
|
-
if (r[s] === n || r[s].listener === n) {
|
|
15434
|
-
u = r[s].listener, f = s;
|
|
15435
|
-
break;
|
|
15436
|
-
}
|
|
15437
|
-
if (f < 0)
|
|
15438
|
-
return this;
|
|
15439
|
-
f === 0 ? r.shift() : j(r, f), r.length === 1 && (i[e] = r[0]), i.removeListener !== void 0 && this.emit("removeListener", e, u || n);
|
|
15440
|
-
}
|
|
15441
|
-
return this;
|
|
15442
|
-
};
|
|
15443
|
-
o.prototype.off = o.prototype.removeListener;
|
|
15444
|
-
o.prototype.removeAllListeners = function(e) {
|
|
15445
|
-
var n, r, i;
|
|
15446
|
-
if (r = this._events, r === void 0)
|
|
15447
|
-
return this;
|
|
15448
|
-
if (r.removeListener === void 0)
|
|
15449
|
-
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : r[e] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete r[e]), this;
|
|
15450
|
-
if (arguments.length === 0) {
|
|
15451
|
-
var f = Object.keys(r), s;
|
|
15452
|
-
for (i = 0; i < f.length; ++i)
|
|
15453
|
-
s = f[i], s !== "removeListener" && this.removeAllListeners(s);
|
|
15454
|
-
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
15455
|
-
}
|
|
15456
|
-
if (n = r[e], typeof n == "function")
|
|
15457
|
-
this.removeListener(e, n);
|
|
15458
|
-
else if (n !== void 0)
|
|
15459
|
-
for (i = n.length - 1; i >= 0; i--)
|
|
15460
|
-
this.removeListener(e, n[i]);
|
|
15461
|
-
return this;
|
|
15462
|
-
};
|
|
15463
|
-
function _(t, e, n) {
|
|
15464
|
-
var r = t._events;
|
|
15465
|
-
if (r === void 0)
|
|
15466
|
-
return [];
|
|
15467
|
-
var i = r[e];
|
|
15468
|
-
return i === void 0 ? [] : typeof i == "function" ? n ? [i.listener || i] : [i] : n ? R(i) : b2(i, i.length);
|
|
15469
|
-
}
|
|
15470
|
-
o.prototype.listeners = function(e) {
|
|
15471
|
-
return _(this, e, true);
|
|
15472
|
-
};
|
|
15473
|
-
o.prototype.rawListeners = function(e) {
|
|
15474
|
-
return _(this, e, false);
|
|
15475
|
-
};
|
|
15476
|
-
o.listenerCount = function(t, e) {
|
|
15477
|
-
return typeof t.listenerCount == "function" ? t.listenerCount(e) : w2.call(t, e);
|
|
15478
|
-
};
|
|
15479
|
-
o.prototype.listenerCount = w2;
|
|
15480
|
-
function w2(t) {
|
|
15481
|
-
var e = this._events;
|
|
15482
|
-
if (e !== void 0) {
|
|
15483
|
-
var n = e[t];
|
|
15484
|
-
if (typeof n == "function")
|
|
15485
|
-
return 1;
|
|
15486
|
-
if (n !== void 0)
|
|
15487
|
-
return n.length;
|
|
15488
|
-
}
|
|
15489
|
-
return 0;
|
|
15490
|
-
}
|
|
15491
|
-
o.prototype.eventNames = function() {
|
|
15492
|
-
return this._eventsCount > 0 ? l(this._events) : [];
|
|
15493
|
-
};
|
|
15494
|
-
function b2(t, e) {
|
|
15495
|
-
for (var n = new Array(e), r = 0; r < e; ++r)
|
|
15496
|
-
n[r] = t[r];
|
|
15497
|
-
return n;
|
|
15498
|
-
}
|
|
15499
|
-
function j(t, e) {
|
|
15500
|
-
for (; e + 1 < t.length; e++)
|
|
15501
|
-
t[e] = t[e + 1];
|
|
15502
|
-
t.pop();
|
|
15503
|
-
}
|
|
15504
|
-
function R(t) {
|
|
15505
|
-
for (var e = new Array(t.length), n = 0; n < e.length; ++n)
|
|
15506
|
-
e[n] = t[n].listener || t[n];
|
|
15507
|
-
return e;
|
|
15508
|
-
}
|
|
15509
|
-
var P2 = o.prototype;
|
|
15510
|
-
var import_clone = __toESM2(require_clone(), 1);
|
|
15511
|
-
var DEFAULT_OPTIONS = {
|
|
15512
|
-
forceString: false,
|
|
15513
|
-
objectValueSize: 80,
|
|
15514
|
-
promiseValueSize: 80,
|
|
15515
|
-
arrayValueSize: 40,
|
|
15516
|
-
stdTTL: 0,
|
|
15517
|
-
checkPeriod: 600,
|
|
15518
|
-
useClones: true,
|
|
15519
|
-
deleteOnExpire: true,
|
|
15520
|
-
enableLegacyCallbacks: false,
|
|
15521
|
-
maxKeys: -1
|
|
15522
|
-
};
|
|
15523
|
-
var ERROR_MESSAGES = {
|
|
15524
|
-
ENOTFOUND: "Key `__key` not found",
|
|
15525
|
-
ECACHEFULL: "Cache max keys amount exceeded",
|
|
15526
|
-
EKEYTYPE: "The key argument has to be of type `string` or `number`. Found: `__key`",
|
|
15527
|
-
EKEYSTYPE: "The keys argument has to be an array.",
|
|
15528
|
-
ETTLTYPE: "The ttl argument has to be a number."
|
|
15529
|
-
};
|
|
15530
|
-
var Cache = class extends o {
|
|
15531
|
-
data = {};
|
|
15532
|
-
options;
|
|
15533
|
-
stats = {
|
|
15534
|
-
hits: 0,
|
|
15535
|
-
misses: 0,
|
|
15536
|
-
keys: 0,
|
|
15537
|
-
ksize: 0,
|
|
15538
|
-
vsize: 0
|
|
15539
|
-
};
|
|
15540
|
-
validKeyTypes = ["string", "number"];
|
|
15541
|
-
checkTimeout;
|
|
15542
|
-
constructor(options = {}) {
|
|
15543
|
-
super();
|
|
15544
|
-
this.options = Object.assign({}, DEFAULT_OPTIONS, options);
|
|
15545
|
-
this._checkData();
|
|
15546
|
-
}
|
|
15547
|
-
get(key) {
|
|
15548
|
-
const err = this._isInvalidKey(key);
|
|
15549
|
-
if (err)
|
|
15550
|
-
throw err;
|
|
15551
|
-
const keyStr = key.toString();
|
|
15552
|
-
if (this.data[keyStr] && this._check(keyStr, this.data[keyStr])) {
|
|
15553
|
-
this.stats.hits++;
|
|
15554
|
-
return this._unwrap(this.data[keyStr]);
|
|
15555
|
-
} else {
|
|
15556
|
-
this.stats.misses++;
|
|
15557
|
-
return;
|
|
15558
|
-
}
|
|
15559
|
-
}
|
|
15560
|
-
mget(keys) {
|
|
15561
|
-
if (!Array.isArray(keys)) {
|
|
15562
|
-
const err = this._error("EKEYSTYPE");
|
|
15563
|
-
throw err;
|
|
15564
|
-
}
|
|
15565
|
-
const result = {};
|
|
15566
|
-
for (const key of keys) {
|
|
15567
|
-
const err = this._isInvalidKey(key);
|
|
15568
|
-
if (err)
|
|
15569
|
-
throw err;
|
|
15570
|
-
const keyStr = key.toString();
|
|
15571
|
-
if (this.data[keyStr] && this._check(keyStr, this.data[keyStr])) {
|
|
15572
|
-
this.stats.hits++;
|
|
15573
|
-
result[keyStr] = this._unwrap(this.data[keyStr]);
|
|
15574
|
-
} else {
|
|
15575
|
-
this.stats.misses++;
|
|
15576
|
-
}
|
|
15577
|
-
}
|
|
15578
|
-
return result;
|
|
15579
|
-
}
|
|
15580
|
-
set(key, value, ttl) {
|
|
15581
|
-
if (this.options.maxKeys && this.options.maxKeys > -1 && this.stats.keys >= this.options.maxKeys) {
|
|
15582
|
-
const err2 = this._error("ECACHEFULL");
|
|
15583
|
-
throw err2;
|
|
15584
|
-
}
|
|
15585
|
-
let valueToStore = value;
|
|
15586
|
-
if (this.options.forceString && typeof value !== "string") {
|
|
15587
|
-
valueToStore = JSON.stringify(value);
|
|
15588
|
-
}
|
|
15589
|
-
let ttlValue;
|
|
15590
|
-
if (typeof ttl === "string") {
|
|
15591
|
-
ttlValue = Number.parseInt(ttl, 10);
|
|
15592
|
-
} else {
|
|
15593
|
-
ttlValue = ttl;
|
|
15594
|
-
}
|
|
15595
|
-
const err = this._isInvalidKey(key);
|
|
15596
|
-
if (err)
|
|
15597
|
-
throw err;
|
|
15598
|
-
let existent = false;
|
|
15599
|
-
const keyStr = key.toString();
|
|
15600
|
-
if (this.data[keyStr]) {
|
|
15601
|
-
existent = true;
|
|
15602
|
-
this.stats.vsize -= this._getValLength(this._unwrap(this.data[keyStr], false));
|
|
15603
|
-
}
|
|
15604
|
-
this.data[keyStr] = this._wrap(valueToStore, ttlValue);
|
|
15605
|
-
this.stats.vsize += this._getValLength(valueToStore);
|
|
15606
|
-
if (!existent) {
|
|
15607
|
-
this.stats.ksize += this._getKeyLength(key);
|
|
15608
|
-
this.stats.keys++;
|
|
15609
|
-
}
|
|
15610
|
-
this.emit("set", key, value);
|
|
15611
|
-
return true;
|
|
15612
|
-
}
|
|
15613
|
-
fetch(key, ttlOrValue, value) {
|
|
15614
|
-
if (this.has(key)) {
|
|
15615
|
-
return this.get(key);
|
|
15616
|
-
}
|
|
15617
|
-
let ttl;
|
|
15618
|
-
let valueToFetch;
|
|
15619
|
-
if (typeof value === "undefined") {
|
|
15620
|
-
valueToFetch = ttlOrValue;
|
|
15621
|
-
ttl = void 0;
|
|
15622
|
-
} else {
|
|
15623
|
-
ttl = ttlOrValue;
|
|
15624
|
-
valueToFetch = value;
|
|
15625
|
-
}
|
|
15626
|
-
const resultValue = typeof valueToFetch === "function" ? valueToFetch() : valueToFetch;
|
|
15627
|
-
this.set(key, resultValue, ttl);
|
|
15628
|
-
return resultValue;
|
|
15629
|
-
}
|
|
15630
|
-
mset(keyValueSet) {
|
|
15631
|
-
if (this.options.maxKeys && this.options.maxKeys > -1 && this.stats.keys + keyValueSet.length >= this.options.maxKeys) {
|
|
15632
|
-
const err = this._error("ECACHEFULL");
|
|
15633
|
-
throw err;
|
|
15634
|
-
}
|
|
15635
|
-
for (const keyValuePair of keyValueSet) {
|
|
15636
|
-
const { key, ttl } = keyValuePair;
|
|
15637
|
-
if (ttl && typeof ttl !== "number") {
|
|
15638
|
-
const err2 = this._error("ETTLTYPE");
|
|
15639
|
-
throw err2;
|
|
15640
|
-
}
|
|
15641
|
-
const err = this._isInvalidKey(key);
|
|
15642
|
-
if (err)
|
|
15643
|
-
throw err;
|
|
15644
|
-
}
|
|
15645
|
-
for (const keyValuePair of keyValueSet) {
|
|
15646
|
-
const { key, val, ttl } = keyValuePair;
|
|
15647
|
-
this.set(key, val, ttl);
|
|
15648
|
-
}
|
|
15649
|
-
return true;
|
|
15650
|
-
}
|
|
15651
|
-
del(keys) {
|
|
15652
|
-
const keysArray = Array.isArray(keys) ? keys : [keys];
|
|
15653
|
-
let delCount = 0;
|
|
15654
|
-
for (const key of keysArray) {
|
|
15655
|
-
const err = this._isInvalidKey(key);
|
|
15656
|
-
if (err)
|
|
15657
|
-
throw err;
|
|
15658
|
-
const keyStr = key.toString();
|
|
15659
|
-
if (this.data[keyStr]) {
|
|
15660
|
-
this.stats.vsize -= this._getValLength(this._unwrap(this.data[keyStr], false));
|
|
15661
|
-
this.stats.ksize -= this._getKeyLength(key);
|
|
15662
|
-
this.stats.keys--;
|
|
15663
|
-
delCount++;
|
|
15664
|
-
const oldVal = this.data[keyStr];
|
|
15665
|
-
delete this.data[keyStr];
|
|
15666
|
-
this.emit("del", key, oldVal.v);
|
|
15667
|
-
}
|
|
15668
|
-
}
|
|
15669
|
-
return delCount;
|
|
15670
|
-
}
|
|
15671
|
-
take(key) {
|
|
15672
|
-
const value = this.get(key);
|
|
15673
|
-
if (value !== void 0) {
|
|
15674
|
-
this.del(key);
|
|
15675
|
-
}
|
|
15676
|
-
return value;
|
|
15677
|
-
}
|
|
15678
|
-
ttl(key, ttl) {
|
|
15679
|
-
const ttlValue = ttl ?? this.options.stdTTL;
|
|
15680
|
-
if (!key) {
|
|
15681
|
-
return false;
|
|
15682
|
-
}
|
|
15683
|
-
const err = this._isInvalidKey(key);
|
|
15684
|
-
if (err)
|
|
15685
|
-
throw err;
|
|
15686
|
-
const keyStr = key.toString();
|
|
15687
|
-
if (this.data[keyStr] && this._check(keyStr, this.data[keyStr])) {
|
|
15688
|
-
if (ttlValue && ttlValue >= 0) {
|
|
15689
|
-
this.data[keyStr] = this._wrap(this.data[keyStr].v, ttlValue, false);
|
|
15690
|
-
} else {
|
|
15691
|
-
this.del(key);
|
|
15692
|
-
}
|
|
15693
|
-
return true;
|
|
15694
|
-
} else {
|
|
15695
|
-
return false;
|
|
15696
|
-
}
|
|
15697
|
-
}
|
|
15698
|
-
getTtl(key) {
|
|
15699
|
-
if (!key) {
|
|
15700
|
-
return;
|
|
15701
|
-
}
|
|
15702
|
-
const err = this._isInvalidKey(key);
|
|
15703
|
-
if (err)
|
|
15704
|
-
throw err;
|
|
15705
|
-
const keyStr = key.toString();
|
|
15706
|
-
if (this.data[keyStr] && this._check(keyStr, this.data[keyStr])) {
|
|
15707
|
-
return this.data[keyStr].t;
|
|
15708
|
-
} else {
|
|
15709
|
-
return;
|
|
15710
|
-
}
|
|
15711
|
-
}
|
|
15712
|
-
keys() {
|
|
15713
|
-
return Object.keys(this.data);
|
|
15714
|
-
}
|
|
15715
|
-
has(key) {
|
|
15716
|
-
const keyStr = key.toString();
|
|
15717
|
-
return !!(this.data[keyStr] && this._check(keyStr, this.data[keyStr]));
|
|
15718
|
-
}
|
|
15719
|
-
getStats() {
|
|
15720
|
-
return this.stats;
|
|
15721
|
-
}
|
|
15722
|
-
flushAll(startPeriod = true) {
|
|
15723
|
-
this.data = {};
|
|
15724
|
-
this.stats = {
|
|
15725
|
-
hits: 0,
|
|
15726
|
-
misses: 0,
|
|
15727
|
-
keys: 0,
|
|
15728
|
-
ksize: 0,
|
|
15729
|
-
vsize: 0
|
|
15730
|
-
};
|
|
15731
|
-
this._killCheckPeriod();
|
|
15732
|
-
this._checkData(startPeriod);
|
|
15733
|
-
this.emit("flush");
|
|
15734
|
-
}
|
|
15735
|
-
flushStats() {
|
|
15736
|
-
this.stats = {
|
|
15737
|
-
hits: 0,
|
|
15738
|
-
misses: 0,
|
|
15739
|
-
keys: 0,
|
|
15740
|
-
ksize: 0,
|
|
15741
|
-
vsize: 0
|
|
15742
|
-
};
|
|
15743
|
-
this.emit("flush_stats");
|
|
15744
|
-
}
|
|
15745
|
-
close() {
|
|
15746
|
-
this._killCheckPeriod();
|
|
15747
|
-
}
|
|
15748
|
-
_checkData(startPeriod = true) {
|
|
15749
|
-
for (const key in this.data) {
|
|
15750
|
-
this._check(key, this.data[key]);
|
|
15751
|
-
}
|
|
15752
|
-
if (startPeriod && this.options.checkPeriod && this.options.checkPeriod > 0) {
|
|
15753
|
-
this.checkTimeout = setTimeout(() => {
|
|
15754
|
-
this._checkData(startPeriod);
|
|
15755
|
-
}, this.options.checkPeriod * 1e3);
|
|
15756
|
-
if (this.checkTimeout && typeof this.checkTimeout.unref === "function") {
|
|
15757
|
-
this.checkTimeout.unref();
|
|
15758
|
-
}
|
|
15759
|
-
}
|
|
15760
|
-
}
|
|
15761
|
-
_killCheckPeriod() {
|
|
15762
|
-
if (this.checkTimeout) {
|
|
15763
|
-
clearTimeout(this.checkTimeout);
|
|
15764
|
-
}
|
|
15765
|
-
}
|
|
15766
|
-
_check(key, data) {
|
|
15767
|
-
let result = true;
|
|
15768
|
-
if (data.t !== 0 && data.t < Date.now()) {
|
|
15769
|
-
if (this.options.deleteOnExpire) {
|
|
15770
|
-
result = false;
|
|
15771
|
-
this.del(key);
|
|
15772
|
-
}
|
|
15773
|
-
this.emit("expired", key, this._unwrap(data));
|
|
15774
|
-
}
|
|
15775
|
-
return result;
|
|
15776
|
-
}
|
|
15777
|
-
_isInvalidKey(key) {
|
|
15778
|
-
if (!this.validKeyTypes.includes(typeof key)) {
|
|
15779
|
-
return this._error("EKEYTYPE", { type: typeof key });
|
|
15780
|
-
}
|
|
15781
|
-
return;
|
|
15782
|
-
}
|
|
15783
|
-
_wrap(value, ttl, asClone = true) {
|
|
15784
|
-
if (!this.options.useClones) {
|
|
15785
|
-
asClone = false;
|
|
15786
|
-
}
|
|
15787
|
-
const now = Date.now();
|
|
15788
|
-
let livetime = 0;
|
|
15789
|
-
const ttlMultiplicator = 1e3;
|
|
15790
|
-
if (ttl === 0) {
|
|
15791
|
-
livetime = 0;
|
|
15792
|
-
} else if (ttl) {
|
|
15793
|
-
livetime = now + ttl * ttlMultiplicator;
|
|
15794
|
-
} else {
|
|
15795
|
-
if (this.options.stdTTL === 0) {
|
|
15796
|
-
livetime = this.options.stdTTL;
|
|
15797
|
-
} else {
|
|
15798
|
-
livetime = now + this.options.stdTTL * ttlMultiplicator;
|
|
15799
|
-
}
|
|
15800
|
-
}
|
|
15801
|
-
return {
|
|
15802
|
-
t: livetime,
|
|
15803
|
-
v: asClone ? import_clone.default(value) : value
|
|
15804
|
-
};
|
|
15805
|
-
}
|
|
15806
|
-
_unwrap(value, asClone = true) {
|
|
15807
|
-
if (!this.options.useClones) {
|
|
15808
|
-
asClone = false;
|
|
15809
|
-
}
|
|
15810
|
-
if (value.v !== void 0) {
|
|
15811
|
-
return asClone ? import_clone.default(value.v) : value.v;
|
|
15812
|
-
}
|
|
15813
|
-
return null;
|
|
15814
|
-
}
|
|
15815
|
-
_getKeyLength(key) {
|
|
15816
|
-
return key.toString().length;
|
|
15817
|
-
}
|
|
15818
|
-
_getValLength(value) {
|
|
15819
|
-
if (typeof value === "string") {
|
|
15820
|
-
return value.length;
|
|
15821
|
-
} else if (this.options.forceString) {
|
|
15822
|
-
return JSON.stringify(value).length;
|
|
15823
|
-
} else if (Array.isArray(value)) {
|
|
15824
|
-
return this.options.arrayValueSize * value.length;
|
|
15825
|
-
} else if (typeof value === "number") {
|
|
15826
|
-
return 8;
|
|
15827
|
-
} else if (typeof value?.then === "function") {
|
|
15828
|
-
return this.options.promiseValueSize;
|
|
15829
|
-
} else if (export_Buffer && export_Buffer.isBuffer(value)) {
|
|
15830
|
-
return value.length;
|
|
15831
|
-
} else if (value && typeof value === "object") {
|
|
15832
|
-
return this.options.objectValueSize * Object.keys(value).length;
|
|
15833
|
-
} else if (typeof value === "boolean") {
|
|
15834
|
-
return 8;
|
|
15835
|
-
} else {
|
|
15836
|
-
return 0;
|
|
15837
|
-
}
|
|
15838
|
-
}
|
|
15839
|
-
_error(type, data = {}) {
|
|
15840
|
-
const error = new Error(`Cache error: ${type}`);
|
|
15841
|
-
error.name = type;
|
|
15842
|
-
error.errorcode = type;
|
|
15843
|
-
error.message = this._createErrorMessage(ERROR_MESSAGES[type])(data);
|
|
15844
|
-
error.data = data;
|
|
15845
|
-
return error;
|
|
15846
|
-
}
|
|
15847
|
-
_createErrorMessage(errMsg) {
|
|
15848
|
-
return (args) => errMsg.replace("__key", args?.type);
|
|
15849
|
-
}
|
|
15850
|
-
};
|
|
15851
|
-
var cache = new Cache();
|
|
15852
|
-
|
|
15853
14316
|
// src/client/gremlin.ts
|
|
14317
|
+
var import_ttlcache = __toESM(require_ttlcache(), 1);
|
|
15854
14318
|
var GremlinApi = class {
|
|
15855
14319
|
constructor() {
|
|
15856
14320
|
this.baseUrl = "https://api.gremlin.com/v1";
|
|
15857
14321
|
this.userAgent = "@gremlin/gremlin-mcp/2.2.0";
|
|
15858
|
-
this.cache = new
|
|
15859
|
-
useClones: true
|
|
15860
|
-
});
|
|
14322
|
+
this.cache = new import_ttlcache.default();
|
|
15861
14323
|
}
|
|
15862
14324
|
async listUsers() {
|
|
15863
14325
|
return this.requestWithRetry("users", {
|
|
@@ -16064,7 +14526,7 @@ var GremlinApi = class {
|
|
|
16064
14526
|
}
|
|
16065
14527
|
const responseData = await response.json();
|
|
16066
14528
|
if (!skipCache) {
|
|
16067
|
-
this.cache.set(urlString, responseData, 60 *
|
|
14529
|
+
this.cache.set(urlString, responseData, { ttl: 10 * 60 * 1e3 });
|
|
16068
14530
|
}
|
|
16069
14531
|
return responseData;
|
|
16070
14532
|
} catch (error) {
|
|
@@ -16633,7 +15095,7 @@ function searchSpec(spec, query, methodFilter, tagFilter, topN = 10) {
|
|
|
16633
15095
|
});
|
|
16634
15096
|
}
|
|
16635
15097
|
}
|
|
16636
|
-
return scored.sort((
|
|
15098
|
+
return scored.sort((a, b) => b.score - a.score).slice(0, topN).map((s) => s.match);
|
|
16637
15099
|
}
|
|
16638
15100
|
|
|
16639
15101
|
// src/tools/openapi.ts
|
|
@@ -16868,13 +15330,4 @@ server.connect(transport);
|
|
|
16868
15330
|
|
|
16869
15331
|
uri-js/dist/es5/uri.all.js:
|
|
16870
15332
|
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
|
|
16871
|
-
|
|
16872
|
-
@stacksjs/ts-cache/dist/index.js:
|
|
16873
|
-
(*!
|
|
16874
|
-
* The buffer module from node.js, for the browser.
|
|
16875
|
-
*
|
|
16876
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
16877
|
-
* @license MIT
|
|
16878
|
-
*)
|
|
16879
|
-
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
16880
15333
|
*/
|