@wzyjs/utils 0.2.67 → 0.2.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs.js +556 -496
- package/dist/browser.esm.js +556 -496
- package/dist/node/cron/index.d.ts +1 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node.cjs.js +1277 -296
- package/dist/node.esm.js +1279 -296
- package/package.json +2 -2
package/dist/browser.esm.js
CHANGED
|
@@ -5450,8 +5450,8 @@ __p += '`;
|
|
|
5450
5450
|
|
|
5451
5451
|
// ../../node_modules/json5/dist/index.js
|
|
5452
5452
|
var require_dist = __commonJS((exports, module) => {
|
|
5453
|
-
(function(global2,
|
|
5454
|
-
typeof exports === "object" && typeof module !== "undefined" ? module.exports =
|
|
5453
|
+
(function(global2, factory2) {
|
|
5454
|
+
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory2() : typeof define === "function" && define.amd ? define(factory2) : global2.JSON5 = factory2();
|
|
5455
5455
|
})(exports, function() {
|
|
5456
5456
|
function createCommonjsModule(fn, module2) {
|
|
5457
5457
|
return module2 = { exports: {} }, fn(module2, module2.exports), module2.exports;
|
|
@@ -5581,14 +5581,14 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
5581
5581
|
return _functionToString.call(it);
|
|
5582
5582
|
};
|
|
5583
5583
|
(module2.exports = function(O, key2, val, safe) {
|
|
5584
|
-
var
|
|
5585
|
-
if (
|
|
5584
|
+
var isFunction3 = typeof val == "function";
|
|
5585
|
+
if (isFunction3) {
|
|
5586
5586
|
_has(val, "name") || _hide(val, "name", key2);
|
|
5587
5587
|
}
|
|
5588
5588
|
if (O[key2] === val) {
|
|
5589
5589
|
return;
|
|
5590
5590
|
}
|
|
5591
|
-
if (
|
|
5591
|
+
if (isFunction3) {
|
|
5592
5592
|
_has(val, SRC) || _hide(val, SRC, O[key2] ? "" + O[key2] : TPL.join(String(key2)));
|
|
5593
5593
|
}
|
|
5594
5594
|
if (O === _global2) {
|
|
@@ -7639,17 +7639,17 @@ var require_utc = __commonJS((exports, module) => {
|
|
|
7639
7639
|
}, u.local = function() {
|
|
7640
7640
|
return n(this.toDate(), { locale: this.$L, utc: false });
|
|
7641
7641
|
};
|
|
7642
|
-
var
|
|
7642
|
+
var r = u.parse;
|
|
7643
7643
|
u.parse = function(t2) {
|
|
7644
|
-
t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset),
|
|
7644
|
+
t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), r.call(this, t2);
|
|
7645
7645
|
};
|
|
7646
|
-
var
|
|
7646
|
+
var o = u.init;
|
|
7647
7647
|
u.init = function() {
|
|
7648
7648
|
if (this.$u) {
|
|
7649
7649
|
var t2 = this.$d;
|
|
7650
7650
|
this.$y = t2.getUTCFullYear(), this.$M = t2.getUTCMonth(), this.$D = t2.getUTCDate(), this.$W = t2.getUTCDay(), this.$H = t2.getUTCHours(), this.$m = t2.getUTCMinutes(), this.$s = t2.getUTCSeconds(), this.$ms = t2.getUTCMilliseconds();
|
|
7651
7651
|
} else
|
|
7652
|
-
|
|
7652
|
+
o.call(this);
|
|
7653
7653
|
};
|
|
7654
7654
|
var a = u.utcOffset;
|
|
7655
7655
|
u.utcOffset = function(s2, f2) {
|
|
@@ -7665,15 +7665,14 @@ var require_utc = __commonJS((exports, module) => {
|
|
|
7665
7665
|
return u3 === 0 ? 0 : n3 === "+" ? u3 : -u3;
|
|
7666
7666
|
}(s2), s2 === null))
|
|
7667
7667
|
return this;
|
|
7668
|
-
var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2
|
|
7668
|
+
var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
|
|
7669
|
+
if (u2 === 0)
|
|
7670
|
+
return this.utc(f2);
|
|
7671
|
+
var r2 = this.clone();
|
|
7669
7672
|
if (f2)
|
|
7670
|
-
return
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
(o2 = this.local().add(u2 + r2, t)).$offset = u2, o2.$x.$localOffset = r2;
|
|
7674
|
-
} else
|
|
7675
|
-
o2 = this.utc();
|
|
7676
|
-
return o2;
|
|
7673
|
+
return r2.$offset = u2, r2.$u = false, r2;
|
|
7674
|
+
var o2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
7675
|
+
return (r2 = this.local().add(u2 + o2, t)).$offset = u2, r2.$x.$localOffset = o2, r2;
|
|
7677
7676
|
};
|
|
7678
7677
|
var h = u.format;
|
|
7679
7678
|
u.format = function(t2) {
|
|
@@ -8918,7 +8917,7 @@ var require_localforage = __commonJS((exports, module) => {
|
|
|
8918
8917
|
executeCallback(promise, callback);
|
|
8919
8918
|
return promise;
|
|
8920
8919
|
}
|
|
8921
|
-
function iterate(
|
|
8920
|
+
function iterate(iterator2, callback) {
|
|
8922
8921
|
var self2 = this;
|
|
8923
8922
|
var promise = new Promise$1(function(resolve, reject) {
|
|
8924
8923
|
self2.ready().then(function() {
|
|
@@ -8937,7 +8936,7 @@ var require_localforage = __commonJS((exports, module) => {
|
|
|
8937
8936
|
if (_isEncodedBlob(value)) {
|
|
8938
8937
|
value = _decodeBlob(value);
|
|
8939
8938
|
}
|
|
8940
|
-
var result =
|
|
8939
|
+
var result = iterator2(value, cursor.key, iterationNumber++);
|
|
8941
8940
|
if (result !== undefined) {
|
|
8942
8941
|
resolve(result);
|
|
8943
8942
|
} else {
|
|
@@ -9525,7 +9524,7 @@ var require_localforage = __commonJS((exports, module) => {
|
|
|
9525
9524
|
executeCallback(promise, callback);
|
|
9526
9525
|
return promise;
|
|
9527
9526
|
}
|
|
9528
|
-
function iterate$1(
|
|
9527
|
+
function iterate$1(iterator2, callback) {
|
|
9529
9528
|
var self2 = this;
|
|
9530
9529
|
var promise = new Promise$1(function(resolve, reject) {
|
|
9531
9530
|
self2.ready().then(function() {
|
|
@@ -9540,7 +9539,7 @@ var require_localforage = __commonJS((exports, module) => {
|
|
|
9540
9539
|
if (result) {
|
|
9541
9540
|
result = dbInfo.serializer.deserialize(result);
|
|
9542
9541
|
}
|
|
9543
|
-
result =
|
|
9542
|
+
result = iterator2(result, item.key, i + 1);
|
|
9544
9543
|
if (result !== undefined) {
|
|
9545
9544
|
resolve(result);
|
|
9546
9545
|
return;
|
|
@@ -9850,7 +9849,7 @@ var require_localforage = __commonJS((exports, module) => {
|
|
|
9850
9849
|
executeCallback(promise, callback);
|
|
9851
9850
|
return promise;
|
|
9852
9851
|
}
|
|
9853
|
-
function iterate$2(
|
|
9852
|
+
function iterate$2(iterator2, callback) {
|
|
9854
9853
|
var self2 = this;
|
|
9855
9854
|
var promise = self2.ready().then(function() {
|
|
9856
9855
|
var dbInfo = self2._dbInfo;
|
|
@@ -9867,7 +9866,7 @@ var require_localforage = __commonJS((exports, module) => {
|
|
|
9867
9866
|
if (value) {
|
|
9868
9867
|
value = dbInfo.serializer.deserialize(value);
|
|
9869
9868
|
}
|
|
9870
|
-
value =
|
|
9869
|
+
value = iterator2(value, key2.substring(keyPrefixLength), iterationNumber++);
|
|
9871
9870
|
if (value !== undefined) {
|
|
9872
9871
|
return value;
|
|
9873
9872
|
}
|
|
@@ -10294,6 +10293,7 @@ function bind(fn, thisArg) {
|
|
|
10294
10293
|
// ../../node_modules/axios/lib/utils.js
|
|
10295
10294
|
var { toString } = Object.prototype;
|
|
10296
10295
|
var { getPrototypeOf } = Object;
|
|
10296
|
+
var { iterator, toStringTag } = Symbol;
|
|
10297
10297
|
var kindOf = ((cache) => (thing) => {
|
|
10298
10298
|
const str = toString.call(thing);
|
|
10299
10299
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -10328,7 +10328,17 @@ var isPlainObject = (val) => {
|
|
|
10328
10328
|
return false;
|
|
10329
10329
|
}
|
|
10330
10330
|
const prototype = getPrototypeOf(val);
|
|
10331
|
-
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(
|
|
10331
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
|
10332
|
+
};
|
|
10333
|
+
var isEmptyObject = (val) => {
|
|
10334
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
10335
|
+
return false;
|
|
10336
|
+
}
|
|
10337
|
+
try {
|
|
10338
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
10339
|
+
} catch (e) {
|
|
10340
|
+
return false;
|
|
10341
|
+
}
|
|
10332
10342
|
};
|
|
10333
10343
|
var isDate = kindOfTest("Date");
|
|
10334
10344
|
var isFile = kindOfTest("File");
|
|
@@ -10356,6 +10366,9 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
10356
10366
|
fn.call(null, obj[i], i, obj);
|
|
10357
10367
|
}
|
|
10358
10368
|
} else {
|
|
10369
|
+
if (isBuffer(obj)) {
|
|
10370
|
+
return;
|
|
10371
|
+
}
|
|
10359
10372
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
10360
10373
|
const len = keys.length;
|
|
10361
10374
|
let key;
|
|
@@ -10366,6 +10379,9 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
10366
10379
|
}
|
|
10367
10380
|
}
|
|
10368
10381
|
function findKey(obj, key) {
|
|
10382
|
+
if (isBuffer(obj)) {
|
|
10383
|
+
return null;
|
|
10384
|
+
}
|
|
10369
10385
|
key = key.toLowerCase();
|
|
10370
10386
|
const keys = Object.keys(obj);
|
|
10371
10387
|
let i = keys.length;
|
|
@@ -10385,7 +10401,7 @@ var _global = (() => {
|
|
|
10385
10401
|
})();
|
|
10386
10402
|
var isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
10387
10403
|
function merge() {
|
|
10388
|
-
const { caseless } = isContextDefined(this) && this || {};
|
|
10404
|
+
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
10389
10405
|
const result = {};
|
|
10390
10406
|
const assignValue = (val, key) => {
|
|
10391
10407
|
const targetKey = caseless && findKey(result, key) || key;
|
|
@@ -10395,7 +10411,7 @@ function merge() {
|
|
|
10395
10411
|
result[targetKey] = merge({}, val);
|
|
10396
10412
|
} else if (isArray(val)) {
|
|
10397
10413
|
result[targetKey] = val.slice();
|
|
10398
|
-
} else {
|
|
10414
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
10399
10415
|
result[targetKey] = val;
|
|
10400
10416
|
}
|
|
10401
10417
|
};
|
|
@@ -10479,10 +10495,10 @@ var isTypedArray = ((TypedArray) => {
|
|
|
10479
10495
|
};
|
|
10480
10496
|
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
10481
10497
|
var forEachEntry = (obj, fn) => {
|
|
10482
|
-
const generator = obj && obj[
|
|
10483
|
-
const
|
|
10498
|
+
const generator = obj && obj[iterator];
|
|
10499
|
+
const _iterator = generator.call(obj);
|
|
10484
10500
|
let result;
|
|
10485
|
-
while ((result =
|
|
10501
|
+
while ((result = _iterator.next()) && !result.done) {
|
|
10486
10502
|
const pair = result.value;
|
|
10487
10503
|
fn.call(obj, pair[0], pair[1]);
|
|
10488
10504
|
}
|
|
@@ -10549,7 +10565,7 @@ var toFiniteNumber = (value, defaultValue) => {
|
|
|
10549
10565
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
10550
10566
|
};
|
|
10551
10567
|
function isSpecCompliantForm(thing) {
|
|
10552
|
-
return !!(thing && isFunction(thing.append) && thing[
|
|
10568
|
+
return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
10553
10569
|
}
|
|
10554
10570
|
var toJSONObject = (obj) => {
|
|
10555
10571
|
const stack = new Array(10);
|
|
@@ -10558,6 +10574,9 @@ var toJSONObject = (obj) => {
|
|
|
10558
10574
|
if (stack.indexOf(source) >= 0) {
|
|
10559
10575
|
return;
|
|
10560
10576
|
}
|
|
10577
|
+
if (isBuffer(source)) {
|
|
10578
|
+
return source;
|
|
10579
|
+
}
|
|
10561
10580
|
if (!("toJSON" in source)) {
|
|
10562
10581
|
stack[i] = source;
|
|
10563
10582
|
const target = isArray(source) ? [] : {};
|
|
@@ -10592,6 +10611,7 @@ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
10592
10611
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
10593
10612
|
})(typeof setImmediate === "function", isFunction(_global.postMessage));
|
|
10594
10613
|
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
10614
|
+
var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
10595
10615
|
var utils_default = {
|
|
10596
10616
|
isArray,
|
|
10597
10617
|
isArrayBuffer,
|
|
@@ -10603,6 +10623,7 @@ var utils_default = {
|
|
|
10603
10623
|
isBoolean,
|
|
10604
10624
|
isObject,
|
|
10605
10625
|
isPlainObject,
|
|
10626
|
+
isEmptyObject,
|
|
10606
10627
|
isReadableStream,
|
|
10607
10628
|
isRequest,
|
|
10608
10629
|
isResponse,
|
|
@@ -10647,7 +10668,8 @@ var utils_default = {
|
|
|
10647
10668
|
isAsyncFn,
|
|
10648
10669
|
isThenable,
|
|
10649
10670
|
setImmediate: _setImmediate,
|
|
10650
|
-
asap
|
|
10671
|
+
asap,
|
|
10672
|
+
isIterable
|
|
10651
10673
|
};
|
|
10652
10674
|
|
|
10653
10675
|
// ../../node_modules/axios/lib/core/AxiosError.js
|
|
@@ -10712,9 +10734,13 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
|
10712
10734
|
}, (prop) => {
|
|
10713
10735
|
return prop !== "isAxiosError";
|
|
10714
10736
|
});
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
axiosError
|
|
10737
|
+
const msg = error && error.message ? error.message : "Error";
|
|
10738
|
+
const errCode = code == null && error ? error.code : code;
|
|
10739
|
+
AxiosError.call(axiosError, msg, errCode, config, request, response);
|
|
10740
|
+
if (error && axiosError.cause == null) {
|
|
10741
|
+
Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
|
|
10742
|
+
}
|
|
10743
|
+
axiosError.name = error && error.name || "Error";
|
|
10718
10744
|
customProps && Object.assign(axiosError, customProps);
|
|
10719
10745
|
return axiosError;
|
|
10720
10746
|
};
|
|
@@ -10771,6 +10797,9 @@ function toFormData(obj, formData, options) {
|
|
|
10771
10797
|
if (utils_default.isDate(value)) {
|
|
10772
10798
|
return value.toISOString();
|
|
10773
10799
|
}
|
|
10800
|
+
if (utils_default.isBoolean(value)) {
|
|
10801
|
+
return value.toString();
|
|
10802
|
+
}
|
|
10774
10803
|
if (!useBlob && utils_default.isBlob(value)) {
|
|
10775
10804
|
throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
|
|
10776
10805
|
}
|
|
@@ -10863,7 +10892,7 @@ var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
|
10863
10892
|
|
|
10864
10893
|
// ../../node_modules/axios/lib/helpers/buildURL.js
|
|
10865
10894
|
function encode2(val) {
|
|
10866
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+")
|
|
10895
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
10867
10896
|
}
|
|
10868
10897
|
function buildURL(url, params, options) {
|
|
10869
10898
|
if (!params) {
|
|
@@ -10978,15 +11007,16 @@ var platform_default = {
|
|
|
10978
11007
|
|
|
10979
11008
|
// ../../node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
10980
11009
|
function toURLEncodedForm(data, options) {
|
|
10981
|
-
return toFormData_default(data, new platform_default.classes.URLSearchParams,
|
|
11010
|
+
return toFormData_default(data, new platform_default.classes.URLSearchParams, {
|
|
10982
11011
|
visitor: function(value, key, path, helpers) {
|
|
10983
11012
|
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
10984
11013
|
this.append(key, value.toString("base64"));
|
|
10985
11014
|
return false;
|
|
10986
11015
|
}
|
|
10987
11016
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
10988
|
-
}
|
|
10989
|
-
|
|
11017
|
+
},
|
|
11018
|
+
...options
|
|
11019
|
+
});
|
|
10990
11020
|
}
|
|
10991
11021
|
|
|
10992
11022
|
// ../../node_modules/axios/lib/helpers/formDataToJSON.js
|
|
@@ -11108,7 +11138,7 @@ var defaults = {
|
|
|
11108
11138
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
11109
11139
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
11110
11140
|
try {
|
|
11111
|
-
return JSON.parse(data);
|
|
11141
|
+
return JSON.parse(data, this.parseReviver);
|
|
11112
11142
|
} catch (e) {
|
|
11113
11143
|
if (strictJSONParsing) {
|
|
11114
11144
|
if (e.name === "SyntaxError") {
|
|
@@ -11265,10 +11295,15 @@ class AxiosHeaders {
|
|
|
11265
11295
|
setHeaders(header, valueOrRewrite);
|
|
11266
11296
|
} else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
11267
11297
|
setHeaders(parseHeaders_default(header), valueOrRewrite);
|
|
11268
|
-
} else if (utils_default.
|
|
11269
|
-
|
|
11270
|
-
|
|
11298
|
+
} else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
|
|
11299
|
+
let obj = {}, dest, key;
|
|
11300
|
+
for (const entry of header) {
|
|
11301
|
+
if (!utils_default.isArray(entry)) {
|
|
11302
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
11303
|
+
}
|
|
11304
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
11271
11305
|
}
|
|
11306
|
+
setHeaders(obj, valueOrRewrite);
|
|
11272
11307
|
} else {
|
|
11273
11308
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
11274
11309
|
}
|
|
@@ -11373,6 +11408,9 @@ class AxiosHeaders {
|
|
|
11373
11408
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join(`
|
|
11374
11409
|
`);
|
|
11375
11410
|
}
|
|
11411
|
+
getSetCookie() {
|
|
11412
|
+
return this.get("set-cookie") || [];
|
|
11413
|
+
}
|
|
11376
11414
|
get [Symbol.toStringTag]() {
|
|
11377
11415
|
return "AxiosHeaders";
|
|
11378
11416
|
}
|
|
@@ -11507,7 +11545,7 @@ function throttle(fn, freq) {
|
|
|
11507
11545
|
clearTimeout(timer);
|
|
11508
11546
|
timer = null;
|
|
11509
11547
|
}
|
|
11510
|
-
fn
|
|
11548
|
+
fn(...args);
|
|
11511
11549
|
};
|
|
11512
11550
|
const throttled = (...args) => {
|
|
11513
11551
|
const now = Date.now();
|
|
@@ -11608,7 +11646,7 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
11608
11646
|
// ../../node_modules/axios/lib/core/buildFullPath.js
|
|
11609
11647
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
11610
11648
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
11611
|
-
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
|
|
11649
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
11612
11650
|
return combineURLs(baseURL, requestedURL);
|
|
11613
11651
|
}
|
|
11614
11652
|
return requestedURL;
|
|
@@ -11686,7 +11724,7 @@ function mergeConfig(config1, config2) {
|
|
|
11686
11724
|
validateStatus: mergeDirectKeys,
|
|
11687
11725
|
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
11688
11726
|
};
|
|
11689
|
-
utils_default.forEach(Object.keys(
|
|
11727
|
+
utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
11690
11728
|
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
11691
11729
|
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
11692
11730
|
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
@@ -11703,13 +11741,17 @@ var resolveConfig_default = (config) => {
|
|
|
11703
11741
|
if (auth) {
|
|
11704
11742
|
headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
|
|
11705
11743
|
}
|
|
11706
|
-
let contentType;
|
|
11707
11744
|
if (utils_default.isFormData(data)) {
|
|
11708
11745
|
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
|
|
11709
11746
|
headers.setContentType(undefined);
|
|
11710
|
-
} else if ((
|
|
11711
|
-
const
|
|
11712
|
-
|
|
11747
|
+
} else if (utils_default.isFunction(data.getHeaders)) {
|
|
11748
|
+
const formHeaders = data.getHeaders();
|
|
11749
|
+
const allowedHeaders = ["content-type", "content-length"];
|
|
11750
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
11751
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
11752
|
+
headers.set(key, val);
|
|
11753
|
+
}
|
|
11754
|
+
});
|
|
11713
11755
|
}
|
|
11714
11756
|
}
|
|
11715
11757
|
if (platform_default.hasStandardBrowserEnv) {
|
|
@@ -11787,8 +11829,11 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
11787
11829
|
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
|
|
11788
11830
|
request = null;
|
|
11789
11831
|
};
|
|
11790
|
-
request.onerror = function handleError() {
|
|
11791
|
-
|
|
11832
|
+
request.onerror = function handleError(event) {
|
|
11833
|
+
const msg = event && event.message ? event.message : "Network Error";
|
|
11834
|
+
const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
|
|
11835
|
+
err.event = event || null;
|
|
11836
|
+
reject(err);
|
|
11792
11837
|
request = null;
|
|
11793
11838
|
};
|
|
11794
11839
|
request.ontimeout = function handleTimeout() {
|
|
@@ -11919,7 +11964,7 @@ var readStream = async function* (stream) {
|
|
|
11919
11964
|
}
|
|
11920
11965
|
};
|
|
11921
11966
|
var trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
11922
|
-
const
|
|
11967
|
+
const iterator2 = readBytes(stream, chunkSize);
|
|
11923
11968
|
let bytes = 0;
|
|
11924
11969
|
let done;
|
|
11925
11970
|
let _onFinish = (e) => {
|
|
@@ -11931,7 +11976,7 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
11931
11976
|
return new ReadableStream({
|
|
11932
11977
|
async pull(controller) {
|
|
11933
11978
|
try {
|
|
11934
|
-
const { done: done2, value } = await
|
|
11979
|
+
const { done: done2, value } = await iterator2.next();
|
|
11935
11980
|
if (done2) {
|
|
11936
11981
|
_onFinish();
|
|
11937
11982
|
controller.close();
|
|
@@ -11950,7 +11995,7 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
11950
11995
|
},
|
|
11951
11996
|
cancel(reason) {
|
|
11952
11997
|
_onFinish(reason);
|
|
11953
|
-
return
|
|
11998
|
+
return iterator2.return();
|
|
11954
11999
|
}
|
|
11955
12000
|
}, {
|
|
11956
12001
|
highWaterMark: 2
|
|
@@ -11958,9 +12003,16 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
11958
12003
|
};
|
|
11959
12004
|
|
|
11960
12005
|
// ../../node_modules/axios/lib/adapters/fetch.js
|
|
11961
|
-
var
|
|
11962
|
-
var
|
|
11963
|
-
var
|
|
12006
|
+
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
12007
|
+
var { isFunction: isFunction2 } = utils_default;
|
|
12008
|
+
var globalFetchAPI = (({ Request, Response }) => ({
|
|
12009
|
+
Request,
|
|
12010
|
+
Response
|
|
12011
|
+
}))(utils_default.global);
|
|
12012
|
+
var {
|
|
12013
|
+
ReadableStream: ReadableStream2,
|
|
12014
|
+
TextEncoder
|
|
12015
|
+
} = utils_default.global;
|
|
11964
12016
|
var test = (fn, ...args) => {
|
|
11965
12017
|
try {
|
|
11966
12018
|
return !!fn(...args);
|
|
@@ -11968,152 +12020,192 @@ var test = (fn, ...args) => {
|
|
|
11968
12020
|
return false;
|
|
11969
12021
|
}
|
|
11970
12022
|
};
|
|
11971
|
-
var
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
return duplexAccessed && !hasContentType;
|
|
11982
|
-
});
|
|
11983
|
-
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
11984
|
-
var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
11985
|
-
var resolvers = {
|
|
11986
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
11987
|
-
};
|
|
11988
|
-
isFetchSupported && ((res) => {
|
|
11989
|
-
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
11990
|
-
!resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
|
|
11991
|
-
throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
|
|
11992
|
-
});
|
|
11993
|
-
});
|
|
11994
|
-
})(new Response);
|
|
11995
|
-
var getBodyLength = async (body) => {
|
|
11996
|
-
if (body == null) {
|
|
11997
|
-
return 0;
|
|
11998
|
-
}
|
|
11999
|
-
if (utils_default.isBlob(body)) {
|
|
12000
|
-
return body.size;
|
|
12023
|
+
var factory = (env) => {
|
|
12024
|
+
env = utils_default.merge.call({
|
|
12025
|
+
skipUndefined: true
|
|
12026
|
+
}, globalFetchAPI, env);
|
|
12027
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
12028
|
+
const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
|
|
12029
|
+
const isRequestSupported = isFunction2(Request);
|
|
12030
|
+
const isResponseSupported = isFunction2(Response);
|
|
12031
|
+
if (!isFetchSupported) {
|
|
12032
|
+
return false;
|
|
12001
12033
|
}
|
|
12002
|
-
|
|
12003
|
-
|
|
12034
|
+
const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
|
|
12035
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
12036
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
12037
|
+
let duplexAccessed = false;
|
|
12038
|
+
const hasContentType = new Request(platform_default.origin, {
|
|
12039
|
+
body: new ReadableStream2,
|
|
12004
12040
|
method: "POST",
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
return
|
|
12011
|
-
}
|
|
12012
|
-
if (utils_default.isURLSearchParams(body)) {
|
|
12013
|
-
body = body + "";
|
|
12014
|
-
}
|
|
12015
|
-
if (utils_default.isString(body)) {
|
|
12016
|
-
return (await encodeText(body)).byteLength;
|
|
12017
|
-
}
|
|
12018
|
-
};
|
|
12019
|
-
var resolveBodyLength = async (headers, body) => {
|
|
12020
|
-
const length = utils_default.toFiniteNumber(headers.getContentLength());
|
|
12021
|
-
return length == null ? getBodyLength(body) : length;
|
|
12022
|
-
};
|
|
12023
|
-
var fetch_default = isFetchSupported && (async (config) => {
|
|
12024
|
-
let {
|
|
12025
|
-
url,
|
|
12026
|
-
method,
|
|
12027
|
-
data,
|
|
12028
|
-
signal,
|
|
12029
|
-
cancelToken,
|
|
12030
|
-
timeout,
|
|
12031
|
-
onDownloadProgress,
|
|
12032
|
-
onUploadProgress,
|
|
12033
|
-
responseType,
|
|
12034
|
-
headers,
|
|
12035
|
-
withCredentials = "same-origin",
|
|
12036
|
-
fetchOptions
|
|
12037
|
-
} = resolveConfig_default(config);
|
|
12038
|
-
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
12039
|
-
let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
12040
|
-
let request;
|
|
12041
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
12042
|
-
composedSignal.unsubscribe();
|
|
12041
|
+
get duplex() {
|
|
12042
|
+
duplexAccessed = true;
|
|
12043
|
+
return "half";
|
|
12044
|
+
}
|
|
12045
|
+
}).headers.has("Content-Type");
|
|
12046
|
+
return duplexAccessed && !hasContentType;
|
|
12043
12047
|
});
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12048
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
12049
|
+
const resolvers = {
|
|
12050
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
12051
|
+
};
|
|
12052
|
+
isFetchSupported && (() => {
|
|
12053
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
12054
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
12055
|
+
let method = res && res[type];
|
|
12056
|
+
if (method) {
|
|
12057
|
+
return method.call(res);
|
|
12058
|
+
}
|
|
12059
|
+
throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
|
|
12051
12060
|
});
|
|
12052
|
-
let contentTypeHeader;
|
|
12053
|
-
if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
12054
|
-
headers.setContentType(contentTypeHeader);
|
|
12055
|
-
}
|
|
12056
|
-
if (_request.body) {
|
|
12057
|
-
const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
|
|
12058
|
-
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
12059
|
-
}
|
|
12060
|
-
}
|
|
12061
|
-
if (!utils_default.isString(withCredentials)) {
|
|
12062
|
-
withCredentials = withCredentials ? "include" : "omit";
|
|
12063
|
-
}
|
|
12064
|
-
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
12065
|
-
request = new Request(url, {
|
|
12066
|
-
...fetchOptions,
|
|
12067
|
-
signal: composedSignal,
|
|
12068
|
-
method: method.toUpperCase(),
|
|
12069
|
-
headers: headers.normalize().toJSON(),
|
|
12070
|
-
body: data,
|
|
12071
|
-
duplex: "half",
|
|
12072
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
12073
12061
|
});
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
if (
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
|
|
12083
|
-
|
|
12084
|
-
|
|
12085
|
-
|
|
12086
|
-
}), options);
|
|
12087
|
-
}
|
|
12088
|
-
responseType = responseType || "text";
|
|
12089
|
-
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
|
|
12090
|
-
!isStreamResponse && unsubscribe && unsubscribe();
|
|
12091
|
-
return await new Promise((resolve, reject) => {
|
|
12092
|
-
settle(resolve, reject, {
|
|
12093
|
-
data: responseData,
|
|
12094
|
-
headers: AxiosHeaders_default.from(response.headers),
|
|
12095
|
-
status: response.status,
|
|
12096
|
-
statusText: response.statusText,
|
|
12097
|
-
config,
|
|
12098
|
-
request
|
|
12062
|
+
})();
|
|
12063
|
+
const getBodyLength = async (body) => {
|
|
12064
|
+
if (body == null) {
|
|
12065
|
+
return 0;
|
|
12066
|
+
}
|
|
12067
|
+
if (utils_default.isBlob(body)) {
|
|
12068
|
+
return body.size;
|
|
12069
|
+
}
|
|
12070
|
+
if (utils_default.isSpecCompliantForm(body)) {
|
|
12071
|
+
const _request = new Request(platform_default.origin, {
|
|
12072
|
+
method: "POST",
|
|
12073
|
+
body
|
|
12099
12074
|
});
|
|
12075
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
12076
|
+
}
|
|
12077
|
+
if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
|
|
12078
|
+
return body.byteLength;
|
|
12079
|
+
}
|
|
12080
|
+
if (utils_default.isURLSearchParams(body)) {
|
|
12081
|
+
body = body + "";
|
|
12082
|
+
}
|
|
12083
|
+
if (utils_default.isString(body)) {
|
|
12084
|
+
return (await encodeText(body)).byteLength;
|
|
12085
|
+
}
|
|
12086
|
+
};
|
|
12087
|
+
const resolveBodyLength = async (headers, body) => {
|
|
12088
|
+
const length = utils_default.toFiniteNumber(headers.getContentLength());
|
|
12089
|
+
return length == null ? getBodyLength(body) : length;
|
|
12090
|
+
};
|
|
12091
|
+
return async (config) => {
|
|
12092
|
+
let {
|
|
12093
|
+
url,
|
|
12094
|
+
method,
|
|
12095
|
+
data,
|
|
12096
|
+
signal,
|
|
12097
|
+
cancelToken,
|
|
12098
|
+
timeout,
|
|
12099
|
+
onDownloadProgress,
|
|
12100
|
+
onUploadProgress,
|
|
12101
|
+
responseType,
|
|
12102
|
+
headers,
|
|
12103
|
+
withCredentials = "same-origin",
|
|
12104
|
+
fetchOptions
|
|
12105
|
+
} = resolveConfig_default(config);
|
|
12106
|
+
let _fetch = envFetch || fetch;
|
|
12107
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
12108
|
+
let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
12109
|
+
let request = null;
|
|
12110
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
12111
|
+
composedSignal.unsubscribe();
|
|
12100
12112
|
});
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12113
|
+
let requestContentLength;
|
|
12114
|
+
try {
|
|
12115
|
+
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
12116
|
+
let _request = new Request(url, {
|
|
12117
|
+
method: "POST",
|
|
12118
|
+
body: data,
|
|
12119
|
+
duplex: "half"
|
|
12120
|
+
});
|
|
12121
|
+
let contentTypeHeader;
|
|
12122
|
+
if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
12123
|
+
headers.setContentType(contentTypeHeader);
|
|
12124
|
+
}
|
|
12125
|
+
if (_request.body) {
|
|
12126
|
+
const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
|
|
12127
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
12128
|
+
}
|
|
12129
|
+
}
|
|
12130
|
+
if (!utils_default.isString(withCredentials)) {
|
|
12131
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
12132
|
+
}
|
|
12133
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
12134
|
+
const resolvedOptions = {
|
|
12135
|
+
...fetchOptions,
|
|
12136
|
+
signal: composedSignal,
|
|
12137
|
+
method: method.toUpperCase(),
|
|
12138
|
+
headers: headers.normalize().toJSON(),
|
|
12139
|
+
body: data,
|
|
12140
|
+
duplex: "half",
|
|
12141
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
12142
|
+
};
|
|
12143
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
12144
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
12145
|
+
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
12146
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
12147
|
+
const options = {};
|
|
12148
|
+
["status", "statusText", "headers"].forEach((prop) => {
|
|
12149
|
+
options[prop] = response[prop];
|
|
12150
|
+
});
|
|
12151
|
+
const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
|
|
12152
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
|
|
12153
|
+
response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
12154
|
+
flush && flush();
|
|
12155
|
+
unsubscribe && unsubscribe();
|
|
12156
|
+
}), options);
|
|
12157
|
+
}
|
|
12158
|
+
responseType = responseType || "text";
|
|
12159
|
+
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
|
|
12160
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
12161
|
+
return await new Promise((resolve, reject) => {
|
|
12162
|
+
settle(resolve, reject, {
|
|
12163
|
+
data: responseData,
|
|
12164
|
+
headers: AxiosHeaders_default.from(response.headers),
|
|
12165
|
+
status: response.status,
|
|
12166
|
+
statusText: response.statusText,
|
|
12167
|
+
config,
|
|
12168
|
+
request
|
|
12169
|
+
});
|
|
12106
12170
|
});
|
|
12171
|
+
} catch (err) {
|
|
12172
|
+
unsubscribe && unsubscribe();
|
|
12173
|
+
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
12174
|
+
throw Object.assign(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request), {
|
|
12175
|
+
cause: err.cause || err
|
|
12176
|
+
});
|
|
12177
|
+
}
|
|
12178
|
+
throw AxiosError_default.from(err, err && err.code, config, request);
|
|
12107
12179
|
}
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12180
|
+
};
|
|
12181
|
+
};
|
|
12182
|
+
var seedCache = new Map;
|
|
12183
|
+
var getFetch = (config) => {
|
|
12184
|
+
let env = config ? config.env : {};
|
|
12185
|
+
const { fetch: fetch2, Request, Response } = env;
|
|
12186
|
+
const seeds = [
|
|
12187
|
+
Request,
|
|
12188
|
+
Response,
|
|
12189
|
+
fetch2
|
|
12190
|
+
];
|
|
12191
|
+
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
12192
|
+
while (i--) {
|
|
12193
|
+
seed = seeds[i];
|
|
12194
|
+
target = map.get(seed);
|
|
12195
|
+
target === undefined && map.set(seed, target = i ? new Map : factory(env));
|
|
12196
|
+
map = target;
|
|
12197
|
+
}
|
|
12198
|
+
return target;
|
|
12199
|
+
};
|
|
12200
|
+
var adapter = getFetch();
|
|
12111
12201
|
|
|
12112
12202
|
// ../../node_modules/axios/lib/adapters/adapters.js
|
|
12113
12203
|
var knownAdapters = {
|
|
12114
12204
|
http: null_default,
|
|
12115
12205
|
xhr: xhr_default,
|
|
12116
|
-
fetch:
|
|
12206
|
+
fetch: {
|
|
12207
|
+
get: getFetch
|
|
12208
|
+
}
|
|
12117
12209
|
};
|
|
12118
12210
|
utils_default.forEach(knownAdapters, (fn, value) => {
|
|
12119
12211
|
if (fn) {
|
|
@@ -12124,37 +12216,37 @@ utils_default.forEach(knownAdapters, (fn, value) => {
|
|
|
12124
12216
|
}
|
|
12125
12217
|
});
|
|
12126
12218
|
var renderReason = (reason) => `- ${reason}`;
|
|
12127
|
-
var isResolvedHandle = (
|
|
12219
|
+
var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
|
|
12128
12220
|
var adapters_default = {
|
|
12129
|
-
getAdapter: (adapters) => {
|
|
12221
|
+
getAdapter: (adapters, config) => {
|
|
12130
12222
|
adapters = utils_default.isArray(adapters) ? adapters : [adapters];
|
|
12131
12223
|
const { length } = adapters;
|
|
12132
12224
|
let nameOrAdapter;
|
|
12133
|
-
let
|
|
12225
|
+
let adapter2;
|
|
12134
12226
|
const rejectedReasons = {};
|
|
12135
12227
|
for (let i = 0;i < length; i++) {
|
|
12136
12228
|
nameOrAdapter = adapters[i];
|
|
12137
12229
|
let id;
|
|
12138
|
-
|
|
12230
|
+
adapter2 = nameOrAdapter;
|
|
12139
12231
|
if (!isResolvedHandle(nameOrAdapter)) {
|
|
12140
|
-
|
|
12141
|
-
if (
|
|
12232
|
+
adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
12233
|
+
if (adapter2 === undefined) {
|
|
12142
12234
|
throw new AxiosError_default(`Unknown adapter '${id}'`);
|
|
12143
12235
|
}
|
|
12144
12236
|
}
|
|
12145
|
-
if (
|
|
12237
|
+
if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
|
|
12146
12238
|
break;
|
|
12147
12239
|
}
|
|
12148
|
-
rejectedReasons[id || "#" + i] =
|
|
12240
|
+
rejectedReasons[id || "#" + i] = adapter2;
|
|
12149
12241
|
}
|
|
12150
|
-
if (!
|
|
12242
|
+
if (!adapter2) {
|
|
12151
12243
|
const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
|
|
12152
12244
|
let s = length ? reasons.length > 1 ? `since :
|
|
12153
12245
|
` + reasons.map(renderReason).join(`
|
|
12154
12246
|
`) : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
12155
12247
|
throw new AxiosError_default(`There is no suitable adapter to dispatch the request ` + s, "ERR_NOT_SUPPORT");
|
|
12156
12248
|
}
|
|
12157
|
-
return
|
|
12249
|
+
return adapter2;
|
|
12158
12250
|
},
|
|
12159
12251
|
adapters: knownAdapters
|
|
12160
12252
|
};
|
|
@@ -12175,8 +12267,8 @@ function dispatchRequest(config) {
|
|
|
12175
12267
|
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
12176
12268
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
12177
12269
|
}
|
|
12178
|
-
const
|
|
12179
|
-
return
|
|
12270
|
+
const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
|
|
12271
|
+
return adapter2(config).then(function onAdapterResolution(response) {
|
|
12180
12272
|
throwIfCancellationRequested(config);
|
|
12181
12273
|
response.data = transformData.call(config, config.transformResponse, response);
|
|
12182
12274
|
response.headers = AxiosHeaders_default.from(response.headers);
|
|
@@ -12194,7 +12286,7 @@ function dispatchRequest(config) {
|
|
|
12194
12286
|
}
|
|
12195
12287
|
|
|
12196
12288
|
// ../../node_modules/axios/lib/env/data.js
|
|
12197
|
-
var VERSION = "1.
|
|
12289
|
+
var VERSION = "1.12.2";
|
|
12198
12290
|
|
|
12199
12291
|
// ../../node_modules/axios/lib/helpers/validator.js
|
|
12200
12292
|
var validators = {};
|
|
@@ -12257,7 +12349,7 @@ var validators2 = validator_default.validators;
|
|
|
12257
12349
|
|
|
12258
12350
|
class Axios {
|
|
12259
12351
|
constructor(instanceConfig) {
|
|
12260
|
-
this.defaults = instanceConfig;
|
|
12352
|
+
this.defaults = instanceConfig || {};
|
|
12261
12353
|
this.interceptors = {
|
|
12262
12354
|
request: new InterceptorManager_default,
|
|
12263
12355
|
response: new InterceptorManager_default
|
|
@@ -12344,8 +12436,8 @@ class Axios {
|
|
|
12344
12436
|
let len;
|
|
12345
12437
|
if (!synchronousRequestInterceptors) {
|
|
12346
12438
|
const chain = [dispatchRequest.bind(this), undefined];
|
|
12347
|
-
chain.unshift
|
|
12348
|
-
chain.push
|
|
12439
|
+
chain.unshift(...requestInterceptorChain);
|
|
12440
|
+
chain.push(...responseInterceptorChain);
|
|
12349
12441
|
len = chain.length;
|
|
12350
12442
|
promise = Promise.resolve(config);
|
|
12351
12443
|
while (i < len) {
|
|
@@ -12355,7 +12447,6 @@ class Axios {
|
|
|
12355
12447
|
}
|
|
12356
12448
|
len = requestInterceptorChain.length;
|
|
12357
12449
|
let newConfig = config;
|
|
12358
|
-
i = 0;
|
|
12359
12450
|
while (i < len) {
|
|
12360
12451
|
const onFulfilled = requestInterceptorChain[i++];
|
|
12361
12452
|
const onRejected = requestInterceptorChain[i++];
|
|
@@ -12617,10 +12708,122 @@ var axios_default = axios;
|
|
|
12617
12708
|
var import_json5 = __toESM(require_dist(), 1);
|
|
12618
12709
|
var import_consola = __toESM(require_consola_browser(), 1);
|
|
12619
12710
|
|
|
12620
|
-
// ../../node_modules/zod/
|
|
12711
|
+
// ../../node_modules/zod/v3/external.js
|
|
12712
|
+
var exports_external = {};
|
|
12713
|
+
__export(exports_external, {
|
|
12714
|
+
void: () => voidType,
|
|
12715
|
+
util: () => util,
|
|
12716
|
+
unknown: () => unknownType,
|
|
12717
|
+
union: () => unionType,
|
|
12718
|
+
undefined: () => undefinedType,
|
|
12719
|
+
tuple: () => tupleType,
|
|
12720
|
+
transformer: () => effectsType,
|
|
12721
|
+
symbol: () => symbolType,
|
|
12722
|
+
string: () => stringType,
|
|
12723
|
+
strictObject: () => strictObjectType,
|
|
12724
|
+
setErrorMap: () => setErrorMap,
|
|
12725
|
+
set: () => setType,
|
|
12726
|
+
record: () => recordType,
|
|
12727
|
+
quotelessJson: () => quotelessJson,
|
|
12728
|
+
promise: () => promiseType,
|
|
12729
|
+
preprocess: () => preprocessType,
|
|
12730
|
+
pipeline: () => pipelineType,
|
|
12731
|
+
ostring: () => ostring,
|
|
12732
|
+
optional: () => optionalType,
|
|
12733
|
+
onumber: () => onumber,
|
|
12734
|
+
oboolean: () => oboolean,
|
|
12735
|
+
objectUtil: () => objectUtil,
|
|
12736
|
+
object: () => objectType,
|
|
12737
|
+
number: () => numberType,
|
|
12738
|
+
nullable: () => nullableType,
|
|
12739
|
+
null: () => nullType,
|
|
12740
|
+
never: () => neverType,
|
|
12741
|
+
nativeEnum: () => nativeEnumType,
|
|
12742
|
+
nan: () => nanType,
|
|
12743
|
+
map: () => mapType,
|
|
12744
|
+
makeIssue: () => makeIssue,
|
|
12745
|
+
literal: () => literalType,
|
|
12746
|
+
lazy: () => lazyType,
|
|
12747
|
+
late: () => late,
|
|
12748
|
+
isValid: () => isValid,
|
|
12749
|
+
isDirty: () => isDirty,
|
|
12750
|
+
isAsync: () => isAsync,
|
|
12751
|
+
isAborted: () => isAborted,
|
|
12752
|
+
intersection: () => intersectionType,
|
|
12753
|
+
instanceof: () => instanceOfType,
|
|
12754
|
+
getParsedType: () => getParsedType,
|
|
12755
|
+
getErrorMap: () => getErrorMap,
|
|
12756
|
+
function: () => functionType,
|
|
12757
|
+
enum: () => enumType,
|
|
12758
|
+
effect: () => effectsType,
|
|
12759
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
12760
|
+
defaultErrorMap: () => en_default,
|
|
12761
|
+
datetimeRegex: () => datetimeRegex,
|
|
12762
|
+
date: () => dateType,
|
|
12763
|
+
custom: () => custom,
|
|
12764
|
+
coerce: () => coerce,
|
|
12765
|
+
boolean: () => booleanType,
|
|
12766
|
+
bigint: () => bigIntType,
|
|
12767
|
+
array: () => arrayType,
|
|
12768
|
+
any: () => anyType,
|
|
12769
|
+
addIssueToContext: () => addIssueToContext,
|
|
12770
|
+
ZodVoid: () => ZodVoid,
|
|
12771
|
+
ZodUnknown: () => ZodUnknown,
|
|
12772
|
+
ZodUnion: () => ZodUnion,
|
|
12773
|
+
ZodUndefined: () => ZodUndefined,
|
|
12774
|
+
ZodType: () => ZodType,
|
|
12775
|
+
ZodTuple: () => ZodTuple,
|
|
12776
|
+
ZodTransformer: () => ZodEffects,
|
|
12777
|
+
ZodSymbol: () => ZodSymbol,
|
|
12778
|
+
ZodString: () => ZodString,
|
|
12779
|
+
ZodSet: () => ZodSet,
|
|
12780
|
+
ZodSchema: () => ZodType,
|
|
12781
|
+
ZodRecord: () => ZodRecord,
|
|
12782
|
+
ZodReadonly: () => ZodReadonly,
|
|
12783
|
+
ZodPromise: () => ZodPromise,
|
|
12784
|
+
ZodPipeline: () => ZodPipeline,
|
|
12785
|
+
ZodParsedType: () => ZodParsedType,
|
|
12786
|
+
ZodOptional: () => ZodOptional,
|
|
12787
|
+
ZodObject: () => ZodObject,
|
|
12788
|
+
ZodNumber: () => ZodNumber,
|
|
12789
|
+
ZodNullable: () => ZodNullable,
|
|
12790
|
+
ZodNull: () => ZodNull,
|
|
12791
|
+
ZodNever: () => ZodNever,
|
|
12792
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
12793
|
+
ZodNaN: () => ZodNaN,
|
|
12794
|
+
ZodMap: () => ZodMap,
|
|
12795
|
+
ZodLiteral: () => ZodLiteral,
|
|
12796
|
+
ZodLazy: () => ZodLazy,
|
|
12797
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
12798
|
+
ZodIntersection: () => ZodIntersection,
|
|
12799
|
+
ZodFunction: () => ZodFunction,
|
|
12800
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
12801
|
+
ZodError: () => ZodError,
|
|
12802
|
+
ZodEnum: () => ZodEnum,
|
|
12803
|
+
ZodEffects: () => ZodEffects,
|
|
12804
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
12805
|
+
ZodDefault: () => ZodDefault,
|
|
12806
|
+
ZodDate: () => ZodDate,
|
|
12807
|
+
ZodCatch: () => ZodCatch,
|
|
12808
|
+
ZodBranded: () => ZodBranded,
|
|
12809
|
+
ZodBoolean: () => ZodBoolean,
|
|
12810
|
+
ZodBigInt: () => ZodBigInt,
|
|
12811
|
+
ZodArray: () => ZodArray,
|
|
12812
|
+
ZodAny: () => ZodAny,
|
|
12813
|
+
Schema: () => ZodType,
|
|
12814
|
+
ParseStatus: () => ParseStatus,
|
|
12815
|
+
OK: () => OK,
|
|
12816
|
+
NEVER: () => NEVER,
|
|
12817
|
+
INVALID: () => INVALID,
|
|
12818
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
12819
|
+
DIRTY: () => DIRTY,
|
|
12820
|
+
BRAND: () => BRAND
|
|
12821
|
+
});
|
|
12822
|
+
|
|
12823
|
+
// ../../node_modules/zod/v3/helpers/util.js
|
|
12621
12824
|
var util;
|
|
12622
12825
|
(function(util2) {
|
|
12623
|
-
util2.assertEqual = (
|
|
12826
|
+
util2.assertEqual = (_) => {};
|
|
12624
12827
|
function assertIs(_arg) {}
|
|
12625
12828
|
util2.assertIs = assertIs;
|
|
12626
12829
|
function assertNever(_x) {
|
|
@@ -12663,7 +12866,7 @@ var util;
|
|
|
12663
12866
|
}
|
|
12664
12867
|
return;
|
|
12665
12868
|
};
|
|
12666
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
12869
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
12667
12870
|
function joinValues(array, separator = " | ") {
|
|
12668
12871
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
12669
12872
|
}
|
|
@@ -12714,7 +12917,7 @@ var getParsedType = (data) => {
|
|
|
12714
12917
|
case "string":
|
|
12715
12918
|
return ZodParsedType.string;
|
|
12716
12919
|
case "number":
|
|
12717
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
12920
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
12718
12921
|
case "boolean":
|
|
12719
12922
|
return ZodParsedType.boolean;
|
|
12720
12923
|
case "function":
|
|
@@ -12747,6 +12950,8 @@ var getParsedType = (data) => {
|
|
|
12747
12950
|
return ZodParsedType.unknown;
|
|
12748
12951
|
}
|
|
12749
12952
|
};
|
|
12953
|
+
|
|
12954
|
+
// ../../node_modules/zod/v3/ZodError.js
|
|
12750
12955
|
var ZodIssueCode = util.arrayToEnum([
|
|
12751
12956
|
"invalid_type",
|
|
12752
12957
|
"invalid_literal",
|
|
@@ -12847,8 +13052,9 @@ class ZodError extends Error {
|
|
|
12847
13052
|
const formErrors = [];
|
|
12848
13053
|
for (const sub of this.issues) {
|
|
12849
13054
|
if (sub.path.length > 0) {
|
|
12850
|
-
|
|
12851
|
-
fieldErrors[
|
|
13055
|
+
const firstEl = sub.path[0];
|
|
13056
|
+
fieldErrors[firstEl] = fieldErrors[firstEl] || [];
|
|
13057
|
+
fieldErrors[firstEl].push(mapper(sub));
|
|
12852
13058
|
} else {
|
|
12853
13059
|
formErrors.push(mapper(sub));
|
|
12854
13060
|
}
|
|
@@ -12863,6 +13069,8 @@ ZodError.create = (issues) => {
|
|
|
12863
13069
|
const error = new ZodError(issues);
|
|
12864
13070
|
return error;
|
|
12865
13071
|
};
|
|
13072
|
+
|
|
13073
|
+
// ../../node_modules/zod/v3/locales/en.js
|
|
12866
13074
|
var errorMap = (issue, _ctx) => {
|
|
12867
13075
|
let message;
|
|
12868
13076
|
switch (issue.code) {
|
|
@@ -12924,6 +13132,8 @@ var errorMap = (issue, _ctx) => {
|
|
|
12924
13132
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
12925
13133
|
else if (issue.type === "number")
|
|
12926
13134
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
13135
|
+
else if (issue.type === "bigint")
|
|
13136
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
12927
13137
|
else if (issue.type === "date")
|
|
12928
13138
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
12929
13139
|
else
|
|
@@ -12961,13 +13171,17 @@ var errorMap = (issue, _ctx) => {
|
|
|
12961
13171
|
}
|
|
12962
13172
|
return { message };
|
|
12963
13173
|
};
|
|
12964
|
-
var
|
|
13174
|
+
var en_default = errorMap;
|
|
13175
|
+
|
|
13176
|
+
// ../../node_modules/zod/v3/errors.js
|
|
13177
|
+
var overrideErrorMap = en_default;
|
|
12965
13178
|
function setErrorMap(map) {
|
|
12966
13179
|
overrideErrorMap = map;
|
|
12967
13180
|
}
|
|
12968
13181
|
function getErrorMap() {
|
|
12969
13182
|
return overrideErrorMap;
|
|
12970
13183
|
}
|
|
13184
|
+
// ../../node_modules/zod/v3/helpers/parseUtil.js
|
|
12971
13185
|
var makeIssue = (params) => {
|
|
12972
13186
|
const { data, path, errorMaps, issueData } = params;
|
|
12973
13187
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -13004,7 +13218,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
13004
13218
|
ctx.common.contextualErrorMap,
|
|
13005
13219
|
ctx.schemaErrorMap,
|
|
13006
13220
|
overrideMap,
|
|
13007
|
-
overrideMap ===
|
|
13221
|
+
overrideMap === en_default ? undefined : en_default
|
|
13008
13222
|
].filter((x) => !!x)
|
|
13009
13223
|
});
|
|
13010
13224
|
ctx.common.issues.push(issue);
|
|
@@ -13073,30 +13287,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
13073
13287
|
var isDirty = (x) => x.status === "dirty";
|
|
13074
13288
|
var isValid = (x) => x.status === "valid";
|
|
13075
13289
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
13076
|
-
|
|
13077
|
-
if (kind === "a" && !f)
|
|
13078
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
13079
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
13080
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
13081
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13082
|
-
}
|
|
13083
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
13084
|
-
if (kind === "m")
|
|
13085
|
-
throw new TypeError("Private method is not writable");
|
|
13086
|
-
if (kind === "a" && !f)
|
|
13087
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
13088
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
13089
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
13090
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
13091
|
-
}
|
|
13290
|
+
// ../../node_modules/zod/v3/helpers/errorUtil.js
|
|
13092
13291
|
var errorUtil;
|
|
13093
13292
|
(function(errorUtil2) {
|
|
13094
13293
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
13095
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
13294
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
13096
13295
|
})(errorUtil || (errorUtil = {}));
|
|
13097
|
-
var _ZodEnum_cache;
|
|
13098
|
-
var _ZodNativeEnum_cache;
|
|
13099
13296
|
|
|
13297
|
+
// ../../node_modules/zod/v3/types.js
|
|
13100
13298
|
class ParseInputLazyPath {
|
|
13101
13299
|
constructor(parent, value, path, key) {
|
|
13102
13300
|
this._cachedPath = [];
|
|
@@ -13107,7 +13305,7 @@ class ParseInputLazyPath {
|
|
|
13107
13305
|
}
|
|
13108
13306
|
get path() {
|
|
13109
13307
|
if (!this._cachedPath.length) {
|
|
13110
|
-
if (this._key
|
|
13308
|
+
if (Array.isArray(this._key)) {
|
|
13111
13309
|
this._cachedPath.push(...this._path, ...this._key);
|
|
13112
13310
|
} else {
|
|
13113
13311
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -13145,17 +13343,16 @@ function processCreateParams(params) {
|
|
|
13145
13343
|
if (errorMap2)
|
|
13146
13344
|
return { errorMap: errorMap2, description };
|
|
13147
13345
|
const customMap = (iss, ctx) => {
|
|
13148
|
-
var _a, _b;
|
|
13149
13346
|
const { message } = params;
|
|
13150
13347
|
if (iss.code === "invalid_enum_value") {
|
|
13151
|
-
return { message: message
|
|
13348
|
+
return { message: message ?? ctx.defaultError };
|
|
13152
13349
|
}
|
|
13153
13350
|
if (typeof ctx.data === "undefined") {
|
|
13154
|
-
return { message:
|
|
13351
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
13155
13352
|
}
|
|
13156
13353
|
if (iss.code !== "invalid_type")
|
|
13157
13354
|
return { message: ctx.defaultError };
|
|
13158
|
-
return { message:
|
|
13355
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
13159
13356
|
};
|
|
13160
13357
|
return { errorMap: customMap, description };
|
|
13161
13358
|
}
|
|
@@ -13208,14 +13405,13 @@ class ZodType {
|
|
|
13208
13405
|
throw result.error;
|
|
13209
13406
|
}
|
|
13210
13407
|
safeParse(data, params) {
|
|
13211
|
-
var _a;
|
|
13212
13408
|
const ctx = {
|
|
13213
13409
|
common: {
|
|
13214
13410
|
issues: [],
|
|
13215
|
-
async:
|
|
13216
|
-
contextualErrorMap: params
|
|
13411
|
+
async: params?.async ?? false,
|
|
13412
|
+
contextualErrorMap: params?.errorMap
|
|
13217
13413
|
},
|
|
13218
|
-
path:
|
|
13414
|
+
path: params?.path || [],
|
|
13219
13415
|
schemaErrorMap: this._def.errorMap,
|
|
13220
13416
|
parent: null,
|
|
13221
13417
|
data,
|
|
@@ -13225,7 +13421,6 @@ class ZodType {
|
|
|
13225
13421
|
return handleResult(ctx, result);
|
|
13226
13422
|
}
|
|
13227
13423
|
"~validate"(data) {
|
|
13228
|
-
var _a, _b;
|
|
13229
13424
|
const ctx = {
|
|
13230
13425
|
common: {
|
|
13231
13426
|
issues: [],
|
|
@@ -13246,7 +13441,7 @@ class ZodType {
|
|
|
13246
13441
|
issues: ctx.common.issues
|
|
13247
13442
|
};
|
|
13248
13443
|
} catch (err) {
|
|
13249
|
-
if (
|
|
13444
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
13250
13445
|
this["~standard"].async = true;
|
|
13251
13446
|
}
|
|
13252
13447
|
ctx.common = {
|
|
@@ -13271,10 +13466,10 @@ class ZodType {
|
|
|
13271
13466
|
const ctx = {
|
|
13272
13467
|
common: {
|
|
13273
13468
|
issues: [],
|
|
13274
|
-
contextualErrorMap: params
|
|
13469
|
+
contextualErrorMap: params?.errorMap,
|
|
13275
13470
|
async: true
|
|
13276
13471
|
},
|
|
13277
|
-
path:
|
|
13472
|
+
path: params?.path || [],
|
|
13278
13473
|
schemaErrorMap: this._def.errorMap,
|
|
13279
13474
|
parent: null,
|
|
13280
13475
|
data,
|
|
@@ -13464,13 +13659,14 @@ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_
|
|
|
13464
13659
|
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
13465
13660
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
13466
13661
|
function timeRegexSource(args) {
|
|
13467
|
-
let
|
|
13662
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
13468
13663
|
if (args.precision) {
|
|
13469
|
-
|
|
13664
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
13470
13665
|
} else if (args.precision == null) {
|
|
13471
|
-
|
|
13666
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
13472
13667
|
}
|
|
13473
|
-
|
|
13668
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
|
13669
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
13474
13670
|
}
|
|
13475
13671
|
function timeRegex(args) {
|
|
13476
13672
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -13498,16 +13694,20 @@ function isValidJWT(jwt, alg) {
|
|
|
13498
13694
|
return false;
|
|
13499
13695
|
try {
|
|
13500
13696
|
const [header] = jwt.split(".");
|
|
13697
|
+
if (!header)
|
|
13698
|
+
return false;
|
|
13501
13699
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
13502
13700
|
const decoded = JSON.parse(atob(base64));
|
|
13503
13701
|
if (typeof decoded !== "object" || decoded === null)
|
|
13504
13702
|
return false;
|
|
13505
|
-
if (
|
|
13703
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
13704
|
+
return false;
|
|
13705
|
+
if (!decoded.alg)
|
|
13506
13706
|
return false;
|
|
13507
13707
|
if (alg && decoded.alg !== alg)
|
|
13508
13708
|
return false;
|
|
13509
13709
|
return true;
|
|
13510
|
-
} catch
|
|
13710
|
+
} catch {
|
|
13511
13711
|
return false;
|
|
13512
13712
|
}
|
|
13513
13713
|
}
|
|
@@ -13667,7 +13867,7 @@ class ZodString extends ZodType {
|
|
|
13667
13867
|
} else if (check.kind === "url") {
|
|
13668
13868
|
try {
|
|
13669
13869
|
new URL(input.data);
|
|
13670
|
-
} catch
|
|
13870
|
+
} catch {
|
|
13671
13871
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13672
13872
|
addIssueToContext(ctx, {
|
|
13673
13873
|
validation: "url",
|
|
@@ -13879,7 +14079,6 @@ class ZodString extends ZodType {
|
|
|
13879
14079
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
13880
14080
|
}
|
|
13881
14081
|
datetime(options) {
|
|
13882
|
-
var _a, _b;
|
|
13883
14082
|
if (typeof options === "string") {
|
|
13884
14083
|
return this._addCheck({
|
|
13885
14084
|
kind: "datetime",
|
|
@@ -13891,10 +14090,10 @@ class ZodString extends ZodType {
|
|
|
13891
14090
|
}
|
|
13892
14091
|
return this._addCheck({
|
|
13893
14092
|
kind: "datetime",
|
|
13894
|
-
precision: typeof
|
|
13895
|
-
offset:
|
|
13896
|
-
local:
|
|
13897
|
-
...errorUtil.errToObj(options
|
|
14093
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
14094
|
+
offset: options?.offset ?? false,
|
|
14095
|
+
local: options?.local ?? false,
|
|
14096
|
+
...errorUtil.errToObj(options?.message)
|
|
13898
14097
|
});
|
|
13899
14098
|
}
|
|
13900
14099
|
date(message) {
|
|
@@ -13910,8 +14109,8 @@ class ZodString extends ZodType {
|
|
|
13910
14109
|
}
|
|
13911
14110
|
return this._addCheck({
|
|
13912
14111
|
kind: "time",
|
|
13913
|
-
precision: typeof
|
|
13914
|
-
...errorUtil.errToObj(options
|
|
14112
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
14113
|
+
...errorUtil.errToObj(options?.message)
|
|
13915
14114
|
});
|
|
13916
14115
|
}
|
|
13917
14116
|
duration(message) {
|
|
@@ -13928,8 +14127,8 @@ class ZodString extends ZodType {
|
|
|
13928
14127
|
return this._addCheck({
|
|
13929
14128
|
kind: "includes",
|
|
13930
14129
|
value,
|
|
13931
|
-
position: options
|
|
13932
|
-
...errorUtil.errToObj(options
|
|
14130
|
+
position: options?.position,
|
|
14131
|
+
...errorUtil.errToObj(options?.message)
|
|
13933
14132
|
});
|
|
13934
14133
|
}
|
|
13935
14134
|
startsWith(value, message) {
|
|
@@ -14058,11 +14257,10 @@ class ZodString extends ZodType {
|
|
|
14058
14257
|
}
|
|
14059
14258
|
}
|
|
14060
14259
|
ZodString.create = (params) => {
|
|
14061
|
-
var _a;
|
|
14062
14260
|
return new ZodString({
|
|
14063
14261
|
checks: [],
|
|
14064
14262
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
14065
|
-
coerce:
|
|
14263
|
+
coerce: params?.coerce ?? false,
|
|
14066
14264
|
...processCreateParams(params)
|
|
14067
14265
|
});
|
|
14068
14266
|
};
|
|
@@ -14070,9 +14268,9 @@ function floatSafeRemainder(val, step) {
|
|
|
14070
14268
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
14071
14269
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
14072
14270
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
14073
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
14074
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
14075
|
-
return valInt % stepInt /
|
|
14271
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
14272
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
14273
|
+
return valInt % stepInt / 10 ** decCount;
|
|
14076
14274
|
}
|
|
14077
14275
|
|
|
14078
14276
|
class ZodNumber extends ZodType {
|
|
@@ -14283,7 +14481,8 @@ class ZodNumber extends ZodType {
|
|
|
14283
14481
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
14284
14482
|
}
|
|
14285
14483
|
get isFinite() {
|
|
14286
|
-
let max = null
|
|
14484
|
+
let max = null;
|
|
14485
|
+
let min = null;
|
|
14287
14486
|
for (const ch of this._def.checks) {
|
|
14288
14487
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
14289
14488
|
return true;
|
|
@@ -14302,7 +14501,7 @@ ZodNumber.create = (params) => {
|
|
|
14302
14501
|
return new ZodNumber({
|
|
14303
14502
|
checks: [],
|
|
14304
14503
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
14305
|
-
coerce:
|
|
14504
|
+
coerce: params?.coerce || false,
|
|
14306
14505
|
...processCreateParams(params)
|
|
14307
14506
|
});
|
|
14308
14507
|
};
|
|
@@ -14317,7 +14516,7 @@ class ZodBigInt extends ZodType {
|
|
|
14317
14516
|
if (this._def.coerce) {
|
|
14318
14517
|
try {
|
|
14319
14518
|
input.data = BigInt(input.data);
|
|
14320
|
-
} catch
|
|
14519
|
+
} catch {
|
|
14321
14520
|
return this._getInvalidInput(input);
|
|
14322
14521
|
}
|
|
14323
14522
|
}
|
|
@@ -14472,11 +14671,10 @@ class ZodBigInt extends ZodType {
|
|
|
14472
14671
|
}
|
|
14473
14672
|
}
|
|
14474
14673
|
ZodBigInt.create = (params) => {
|
|
14475
|
-
var _a;
|
|
14476
14674
|
return new ZodBigInt({
|
|
14477
14675
|
checks: [],
|
|
14478
14676
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
14479
|
-
coerce:
|
|
14677
|
+
coerce: params?.coerce ?? false,
|
|
14480
14678
|
...processCreateParams(params)
|
|
14481
14679
|
});
|
|
14482
14680
|
};
|
|
@@ -14502,7 +14700,7 @@ class ZodBoolean extends ZodType {
|
|
|
14502
14700
|
ZodBoolean.create = (params) => {
|
|
14503
14701
|
return new ZodBoolean({
|
|
14504
14702
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
14505
|
-
coerce:
|
|
14703
|
+
coerce: params?.coerce || false,
|
|
14506
14704
|
...processCreateParams(params)
|
|
14507
14705
|
});
|
|
14508
14706
|
};
|
|
@@ -14522,7 +14720,7 @@ class ZodDate extends ZodType {
|
|
|
14522
14720
|
});
|
|
14523
14721
|
return INVALID;
|
|
14524
14722
|
}
|
|
14525
|
-
if (isNaN(input.data.getTime())) {
|
|
14723
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
14526
14724
|
const ctx2 = this._getOrReturnCtx(input);
|
|
14527
14725
|
addIssueToContext(ctx2, {
|
|
14528
14726
|
code: ZodIssueCode.invalid_date
|
|
@@ -14611,7 +14809,7 @@ class ZodDate extends ZodType {
|
|
|
14611
14809
|
ZodDate.create = (params) => {
|
|
14612
14810
|
return new ZodDate({
|
|
14613
14811
|
checks: [],
|
|
14614
|
-
coerce:
|
|
14812
|
+
coerce: params?.coerce || false,
|
|
14615
14813
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
14616
14814
|
...processCreateParams(params)
|
|
14617
14815
|
});
|
|
@@ -14895,7 +15093,8 @@ class ZodObject extends ZodType {
|
|
|
14895
15093
|
return this._cached;
|
|
14896
15094
|
const shape = this._def.shape();
|
|
14897
15095
|
const keys = util.objectKeys(shape);
|
|
14898
|
-
|
|
15096
|
+
this._cached = { shape, keys };
|
|
15097
|
+
return this._cached;
|
|
14899
15098
|
}
|
|
14900
15099
|
_parse(input) {
|
|
14901
15100
|
const parsedType = this._getType(input);
|
|
@@ -14945,9 +15144,7 @@ class ZodObject extends ZodType {
|
|
|
14945
15144
|
});
|
|
14946
15145
|
status.dirty();
|
|
14947
15146
|
}
|
|
14948
|
-
} else if (unknownKeys === "strip")
|
|
14949
|
-
;
|
|
14950
|
-
else {
|
|
15147
|
+
} else if (unknownKeys === "strip") {} else {
|
|
14951
15148
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
14952
15149
|
}
|
|
14953
15150
|
} else {
|
|
@@ -14991,11 +15188,10 @@ class ZodObject extends ZodType {
|
|
|
14991
15188
|
unknownKeys: "strict",
|
|
14992
15189
|
...message !== undefined ? {
|
|
14993
15190
|
errorMap: (issue, ctx) => {
|
|
14994
|
-
|
|
14995
|
-
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === undefined ? undefined : _b.call(_a, issue, ctx).message) !== null && _c !== undefined ? _c : ctx.defaultError;
|
|
15191
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
14996
15192
|
if (issue.code === "unrecognized_keys")
|
|
14997
15193
|
return {
|
|
14998
|
-
message:
|
|
15194
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
14999
15195
|
};
|
|
15000
15196
|
return {
|
|
15001
15197
|
message: defaultError
|
|
@@ -15048,11 +15244,11 @@ class ZodObject extends ZodType {
|
|
|
15048
15244
|
}
|
|
15049
15245
|
pick(mask) {
|
|
15050
15246
|
const shape = {};
|
|
15051
|
-
util.objectKeys(mask)
|
|
15247
|
+
for (const key of util.objectKeys(mask)) {
|
|
15052
15248
|
if (mask[key] && this.shape[key]) {
|
|
15053
15249
|
shape[key] = this.shape[key];
|
|
15054
15250
|
}
|
|
15055
|
-
}
|
|
15251
|
+
}
|
|
15056
15252
|
return new ZodObject({
|
|
15057
15253
|
...this._def,
|
|
15058
15254
|
shape: () => shape
|
|
@@ -15060,11 +15256,11 @@ class ZodObject extends ZodType {
|
|
|
15060
15256
|
}
|
|
15061
15257
|
omit(mask) {
|
|
15062
15258
|
const shape = {};
|
|
15063
|
-
util.objectKeys(this.shape)
|
|
15259
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
15064
15260
|
if (!mask[key]) {
|
|
15065
15261
|
shape[key] = this.shape[key];
|
|
15066
15262
|
}
|
|
15067
|
-
}
|
|
15263
|
+
}
|
|
15068
15264
|
return new ZodObject({
|
|
15069
15265
|
...this._def,
|
|
15070
15266
|
shape: () => shape
|
|
@@ -15075,14 +15271,14 @@ class ZodObject extends ZodType {
|
|
|
15075
15271
|
}
|
|
15076
15272
|
partial(mask) {
|
|
15077
15273
|
const newShape = {};
|
|
15078
|
-
util.objectKeys(this.shape)
|
|
15274
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
15079
15275
|
const fieldSchema = this.shape[key];
|
|
15080
15276
|
if (mask && !mask[key]) {
|
|
15081
15277
|
newShape[key] = fieldSchema;
|
|
15082
15278
|
} else {
|
|
15083
15279
|
newShape[key] = fieldSchema.optional();
|
|
15084
15280
|
}
|
|
15085
|
-
}
|
|
15281
|
+
}
|
|
15086
15282
|
return new ZodObject({
|
|
15087
15283
|
...this._def,
|
|
15088
15284
|
shape: () => newShape
|
|
@@ -15090,7 +15286,7 @@ class ZodObject extends ZodType {
|
|
|
15090
15286
|
}
|
|
15091
15287
|
required(mask) {
|
|
15092
15288
|
const newShape = {};
|
|
15093
|
-
util.objectKeys(this.shape)
|
|
15289
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
15094
15290
|
if (mask && !mask[key]) {
|
|
15095
15291
|
newShape[key] = this.shape[key];
|
|
15096
15292
|
} else {
|
|
@@ -15101,7 +15297,7 @@ class ZodObject extends ZodType {
|
|
|
15101
15297
|
}
|
|
15102
15298
|
newShape[key] = newField;
|
|
15103
15299
|
}
|
|
15104
|
-
}
|
|
15300
|
+
}
|
|
15105
15301
|
return new ZodObject({
|
|
15106
15302
|
...this._def,
|
|
15107
15303
|
shape: () => newShape
|
|
@@ -15717,12 +15913,7 @@ class ZodFunction extends ZodType {
|
|
|
15717
15913
|
return makeIssue({
|
|
15718
15914
|
data: args,
|
|
15719
15915
|
path: ctx.path,
|
|
15720
|
-
errorMaps: [
|
|
15721
|
-
ctx.common.contextualErrorMap,
|
|
15722
|
-
ctx.schemaErrorMap,
|
|
15723
|
-
getErrorMap(),
|
|
15724
|
-
errorMap
|
|
15725
|
-
].filter((x) => !!x),
|
|
15916
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
15726
15917
|
issueData: {
|
|
15727
15918
|
code: ZodIssueCode.invalid_arguments,
|
|
15728
15919
|
argumentsError: error
|
|
@@ -15733,12 +15924,7 @@ class ZodFunction extends ZodType {
|
|
|
15733
15924
|
return makeIssue({
|
|
15734
15925
|
data: returns,
|
|
15735
15926
|
path: ctx.path,
|
|
15736
|
-
errorMaps: [
|
|
15737
|
-
ctx.common.contextualErrorMap,
|
|
15738
|
-
ctx.schemaErrorMap,
|
|
15739
|
-
getErrorMap(),
|
|
15740
|
-
errorMap
|
|
15741
|
-
].filter((x) => !!x),
|
|
15927
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
15742
15928
|
issueData: {
|
|
15743
15929
|
code: ZodIssueCode.invalid_return_type,
|
|
15744
15930
|
returnTypeError: error
|
|
@@ -15865,10 +16051,6 @@ function createZodEnum(values, params) {
|
|
|
15865
16051
|
}
|
|
15866
16052
|
|
|
15867
16053
|
class ZodEnum extends ZodType {
|
|
15868
|
-
constructor() {
|
|
15869
|
-
super(...arguments);
|
|
15870
|
-
_ZodEnum_cache.set(this, undefined);
|
|
15871
|
-
}
|
|
15872
16054
|
_parse(input) {
|
|
15873
16055
|
if (typeof input.data !== "string") {
|
|
15874
16056
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -15880,10 +16062,10 @@ class ZodEnum extends ZodType {
|
|
|
15880
16062
|
});
|
|
15881
16063
|
return INVALID;
|
|
15882
16064
|
}
|
|
15883
|
-
if (!
|
|
15884
|
-
|
|
16065
|
+
if (!this._cache) {
|
|
16066
|
+
this._cache = new Set(this._def.values);
|
|
15885
16067
|
}
|
|
15886
|
-
if (!
|
|
16068
|
+
if (!this._cache.has(input.data)) {
|
|
15887
16069
|
const ctx = this._getOrReturnCtx(input);
|
|
15888
16070
|
const expectedValues = this._def.values;
|
|
15889
16071
|
addIssueToContext(ctx, {
|
|
@@ -15932,14 +16114,9 @@ class ZodEnum extends ZodType {
|
|
|
15932
16114
|
});
|
|
15933
16115
|
}
|
|
15934
16116
|
}
|
|
15935
|
-
_ZodEnum_cache = new WeakMap;
|
|
15936
16117
|
ZodEnum.create = createZodEnum;
|
|
15937
16118
|
|
|
15938
16119
|
class ZodNativeEnum extends ZodType {
|
|
15939
|
-
constructor() {
|
|
15940
|
-
super(...arguments);
|
|
15941
|
-
_ZodNativeEnum_cache.set(this, undefined);
|
|
15942
|
-
}
|
|
15943
16120
|
_parse(input) {
|
|
15944
16121
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
15945
16122
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -15952,10 +16129,10 @@ class ZodNativeEnum extends ZodType {
|
|
|
15952
16129
|
});
|
|
15953
16130
|
return INVALID;
|
|
15954
16131
|
}
|
|
15955
|
-
if (!
|
|
15956
|
-
|
|
16132
|
+
if (!this._cache) {
|
|
16133
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
15957
16134
|
}
|
|
15958
|
-
if (!
|
|
16135
|
+
if (!this._cache.has(input.data)) {
|
|
15959
16136
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
15960
16137
|
addIssueToContext(ctx, {
|
|
15961
16138
|
received: ctx.data,
|
|
@@ -15970,7 +16147,6 @@ class ZodNativeEnum extends ZodType {
|
|
|
15970
16147
|
return this._def.values;
|
|
15971
16148
|
}
|
|
15972
16149
|
}
|
|
15973
|
-
_ZodNativeEnum_cache = new WeakMap;
|
|
15974
16150
|
ZodNativeEnum.create = (values, params) => {
|
|
15975
16151
|
return new ZodNativeEnum({
|
|
15976
16152
|
values,
|
|
@@ -16113,7 +16289,7 @@ class ZodEffects extends ZodType {
|
|
|
16113
16289
|
parent: ctx
|
|
16114
16290
|
});
|
|
16115
16291
|
if (!isValid(base))
|
|
16116
|
-
return
|
|
16292
|
+
return INVALID;
|
|
16117
16293
|
const result = effect.transform(base.value, checkCtx);
|
|
16118
16294
|
if (result instanceof Promise) {
|
|
16119
16295
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -16122,8 +16298,11 @@ class ZodEffects extends ZodType {
|
|
|
16122
16298
|
} else {
|
|
16123
16299
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
16124
16300
|
if (!isValid(base))
|
|
16125
|
-
return
|
|
16126
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
16301
|
+
return INVALID;
|
|
16302
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
16303
|
+
status: status.value,
|
|
16304
|
+
value: result
|
|
16305
|
+
}));
|
|
16127
16306
|
});
|
|
16128
16307
|
}
|
|
16129
16308
|
}
|
|
@@ -16146,7 +16325,6 @@ ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
|
|
|
16146
16325
|
...processCreateParams(params)
|
|
16147
16326
|
});
|
|
16148
16327
|
};
|
|
16149
|
-
|
|
16150
16328
|
class ZodOptional extends ZodType {
|
|
16151
16329
|
_parse(input) {
|
|
16152
16330
|
const parsedType = this._getType(input);
|
|
@@ -16391,21 +16569,19 @@ function cleanParams(params, data) {
|
|
|
16391
16569
|
function custom(check, _params = {}, fatal) {
|
|
16392
16570
|
if (check)
|
|
16393
16571
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
16394
|
-
var _a, _b;
|
|
16395
16572
|
const r = check(data);
|
|
16396
16573
|
if (r instanceof Promise) {
|
|
16397
16574
|
return r.then((r2) => {
|
|
16398
|
-
var _a2, _b2;
|
|
16399
16575
|
if (!r2) {
|
|
16400
16576
|
const params = cleanParams(_params, data);
|
|
16401
|
-
const _fatal =
|
|
16577
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
16402
16578
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
16403
16579
|
}
|
|
16404
16580
|
});
|
|
16405
16581
|
}
|
|
16406
16582
|
if (!r) {
|
|
16407
16583
|
const params = cleanParams(_params, data);
|
|
16408
|
-
const _fatal =
|
|
16584
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
16409
16585
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
16410
16586
|
}
|
|
16411
16587
|
return;
|
|
@@ -16505,122 +16681,6 @@ var coerce = {
|
|
|
16505
16681
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
16506
16682
|
};
|
|
16507
16683
|
var NEVER = INVALID;
|
|
16508
|
-
var z = /* @__PURE__ */ Object.freeze({
|
|
16509
|
-
__proto__: null,
|
|
16510
|
-
defaultErrorMap: errorMap,
|
|
16511
|
-
setErrorMap,
|
|
16512
|
-
getErrorMap,
|
|
16513
|
-
makeIssue,
|
|
16514
|
-
EMPTY_PATH,
|
|
16515
|
-
addIssueToContext,
|
|
16516
|
-
ParseStatus,
|
|
16517
|
-
INVALID,
|
|
16518
|
-
DIRTY,
|
|
16519
|
-
OK,
|
|
16520
|
-
isAborted,
|
|
16521
|
-
isDirty,
|
|
16522
|
-
isValid,
|
|
16523
|
-
isAsync,
|
|
16524
|
-
get util() {
|
|
16525
|
-
return util;
|
|
16526
|
-
},
|
|
16527
|
-
get objectUtil() {
|
|
16528
|
-
return objectUtil;
|
|
16529
|
-
},
|
|
16530
|
-
ZodParsedType,
|
|
16531
|
-
getParsedType,
|
|
16532
|
-
ZodType,
|
|
16533
|
-
datetimeRegex,
|
|
16534
|
-
ZodString,
|
|
16535
|
-
ZodNumber,
|
|
16536
|
-
ZodBigInt,
|
|
16537
|
-
ZodBoolean,
|
|
16538
|
-
ZodDate,
|
|
16539
|
-
ZodSymbol,
|
|
16540
|
-
ZodUndefined,
|
|
16541
|
-
ZodNull,
|
|
16542
|
-
ZodAny,
|
|
16543
|
-
ZodUnknown,
|
|
16544
|
-
ZodNever,
|
|
16545
|
-
ZodVoid,
|
|
16546
|
-
ZodArray,
|
|
16547
|
-
ZodObject,
|
|
16548
|
-
ZodUnion,
|
|
16549
|
-
ZodDiscriminatedUnion,
|
|
16550
|
-
ZodIntersection,
|
|
16551
|
-
ZodTuple,
|
|
16552
|
-
ZodRecord,
|
|
16553
|
-
ZodMap,
|
|
16554
|
-
ZodSet,
|
|
16555
|
-
ZodFunction,
|
|
16556
|
-
ZodLazy,
|
|
16557
|
-
ZodLiteral,
|
|
16558
|
-
ZodEnum,
|
|
16559
|
-
ZodNativeEnum,
|
|
16560
|
-
ZodPromise,
|
|
16561
|
-
ZodEffects,
|
|
16562
|
-
ZodTransformer: ZodEffects,
|
|
16563
|
-
ZodOptional,
|
|
16564
|
-
ZodNullable,
|
|
16565
|
-
ZodDefault,
|
|
16566
|
-
ZodCatch,
|
|
16567
|
-
ZodNaN,
|
|
16568
|
-
BRAND,
|
|
16569
|
-
ZodBranded,
|
|
16570
|
-
ZodPipeline,
|
|
16571
|
-
ZodReadonly,
|
|
16572
|
-
custom,
|
|
16573
|
-
Schema: ZodType,
|
|
16574
|
-
ZodSchema: ZodType,
|
|
16575
|
-
late,
|
|
16576
|
-
get ZodFirstPartyTypeKind() {
|
|
16577
|
-
return ZodFirstPartyTypeKind;
|
|
16578
|
-
},
|
|
16579
|
-
coerce,
|
|
16580
|
-
any: anyType,
|
|
16581
|
-
array: arrayType,
|
|
16582
|
-
bigint: bigIntType,
|
|
16583
|
-
boolean: booleanType,
|
|
16584
|
-
date: dateType,
|
|
16585
|
-
discriminatedUnion: discriminatedUnionType,
|
|
16586
|
-
effect: effectsType,
|
|
16587
|
-
enum: enumType,
|
|
16588
|
-
function: functionType,
|
|
16589
|
-
instanceof: instanceOfType,
|
|
16590
|
-
intersection: intersectionType,
|
|
16591
|
-
lazy: lazyType,
|
|
16592
|
-
literal: literalType,
|
|
16593
|
-
map: mapType,
|
|
16594
|
-
nan: nanType,
|
|
16595
|
-
nativeEnum: nativeEnumType,
|
|
16596
|
-
never: neverType,
|
|
16597
|
-
null: nullType,
|
|
16598
|
-
nullable: nullableType,
|
|
16599
|
-
number: numberType,
|
|
16600
|
-
object: objectType,
|
|
16601
|
-
oboolean,
|
|
16602
|
-
onumber,
|
|
16603
|
-
optional: optionalType,
|
|
16604
|
-
ostring,
|
|
16605
|
-
pipeline: pipelineType,
|
|
16606
|
-
preprocess: preprocessType,
|
|
16607
|
-
promise: promiseType,
|
|
16608
|
-
record: recordType,
|
|
16609
|
-
set: setType,
|
|
16610
|
-
strictObject: strictObjectType,
|
|
16611
|
-
string: stringType,
|
|
16612
|
-
symbol: symbolType,
|
|
16613
|
-
transformer: effectsType,
|
|
16614
|
-
tuple: tupleType,
|
|
16615
|
-
undefined: undefinedType,
|
|
16616
|
-
union: unionType,
|
|
16617
|
-
unknown: unknownType,
|
|
16618
|
-
void: voidType,
|
|
16619
|
-
NEVER,
|
|
16620
|
-
ZodIssueCode,
|
|
16621
|
-
quotelessJson,
|
|
16622
|
-
ZodError
|
|
16623
|
-
});
|
|
16624
16684
|
// src/common/string.ts
|
|
16625
16685
|
var getChineseByStr = (str) => {
|
|
16626
16686
|
if (!str) {
|
|
@@ -16799,7 +16859,7 @@ var watch = {
|
|
|
16799
16859
|
};
|
|
16800
16860
|
// ../../node_modules/decimal.js/decimal.mjs
|
|
16801
16861
|
/*!
|
|
16802
|
-
* decimal.js v10.
|
|
16862
|
+
* decimal.js v10.6.0
|
|
16803
16863
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
16804
16864
|
* https://github.com/MikeMcl/decimal.js
|
|
16805
16865
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
@@ -16822,7 +16882,7 @@ var DEFAULTS = {
|
|
|
16822
16882
|
};
|
|
16823
16883
|
var inexact;
|
|
16824
16884
|
var quadrant;
|
|
16825
|
-
var
|
|
16885
|
+
var external2 = true;
|
|
16826
16886
|
var decimalError = "[DecimalError] ";
|
|
16827
16887
|
var invalidArgument = decimalError + "Invalid argument: ";
|
|
16828
16888
|
var precisionLimitExceeded = decimalError + "Precision limit exceeded";
|
|
@@ -16898,7 +16958,7 @@ P.cubeRoot = P.cbrt = function() {
|
|
|
16898
16958
|
var e, m, n, r, rep, s, sd, t, t3, t3plusx, x = this, Ctor = x.constructor;
|
|
16899
16959
|
if (!x.isFinite() || x.isZero())
|
|
16900
16960
|
return new Ctor(x);
|
|
16901
|
-
|
|
16961
|
+
external2 = false;
|
|
16902
16962
|
s = x.s * mathpow(x.s * x, 1 / 3);
|
|
16903
16963
|
if (!s || Math.abs(s) == 1 / 0) {
|
|
16904
16964
|
n = digitsToString(x.d);
|
|
@@ -16945,7 +17005,7 @@ P.cubeRoot = P.cbrt = function() {
|
|
|
16945
17005
|
}
|
|
16946
17006
|
}
|
|
16947
17007
|
}
|
|
16948
|
-
|
|
17008
|
+
external2 = true;
|
|
16949
17009
|
return finalise(r, e, Ctor.rounding, m);
|
|
16950
17010
|
};
|
|
16951
17011
|
P.decimalPlaces = P.dp = function() {
|
|
@@ -17070,9 +17130,9 @@ P.inverseHyperbolicCosine = P.acosh = function() {
|
|
|
17070
17130
|
rm = Ctor.rounding;
|
|
17071
17131
|
Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;
|
|
17072
17132
|
Ctor.rounding = 1;
|
|
17073
|
-
|
|
17133
|
+
external2 = false;
|
|
17074
17134
|
x = x.times(x).minus(1).sqrt().plus(x);
|
|
17075
|
-
|
|
17135
|
+
external2 = true;
|
|
17076
17136
|
Ctor.precision = pr;
|
|
17077
17137
|
Ctor.rounding = rm;
|
|
17078
17138
|
return x.ln();
|
|
@@ -17085,9 +17145,9 @@ P.inverseHyperbolicSine = P.asinh = function() {
|
|
|
17085
17145
|
rm = Ctor.rounding;
|
|
17086
17146
|
Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;
|
|
17087
17147
|
Ctor.rounding = 1;
|
|
17088
|
-
|
|
17148
|
+
external2 = false;
|
|
17089
17149
|
x = x.times(x).plus(1).sqrt().plus(x);
|
|
17090
|
-
|
|
17150
|
+
external2 = true;
|
|
17091
17151
|
Ctor.precision = pr;
|
|
17092
17152
|
Ctor.rounding = rm;
|
|
17093
17153
|
return x.ln();
|
|
@@ -17156,7 +17216,7 @@ P.inverseTangent = P.atan = function() {
|
|
|
17156
17216
|
k = Math.min(28, wpr / LOG_BASE + 2 | 0);
|
|
17157
17217
|
for (i = k;i; --i)
|
|
17158
17218
|
x = x.div(x.times(x).plus(1).sqrt().plus(1));
|
|
17159
|
-
|
|
17219
|
+
external2 = false;
|
|
17160
17220
|
j = Math.ceil(wpr / LOG_BASE);
|
|
17161
17221
|
n = 1;
|
|
17162
17222
|
x2 = x.times(x);
|
|
@@ -17173,7 +17233,7 @@ P.inverseTangent = P.atan = function() {
|
|
|
17173
17233
|
}
|
|
17174
17234
|
if (k)
|
|
17175
17235
|
r = r.times(2 << k - 1);
|
|
17176
|
-
|
|
17236
|
+
external2 = true;
|
|
17177
17237
|
return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);
|
|
17178
17238
|
};
|
|
17179
17239
|
P.isFinite = function() {
|
|
@@ -17225,7 +17285,7 @@ P.logarithm = P.log = function(base) {
|
|
|
17225
17285
|
inf = k !== 1;
|
|
17226
17286
|
}
|
|
17227
17287
|
}
|
|
17228
|
-
|
|
17288
|
+
external2 = false;
|
|
17229
17289
|
sd = pr + guard;
|
|
17230
17290
|
num = naturalLogarithm(arg, sd);
|
|
17231
17291
|
denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);
|
|
@@ -17244,7 +17304,7 @@ P.logarithm = P.log = function(base) {
|
|
|
17244
17304
|
}
|
|
17245
17305
|
} while (checkRoundingDigits(r.d, k += 10, rm));
|
|
17246
17306
|
}
|
|
17247
|
-
|
|
17307
|
+
external2 = true;
|
|
17248
17308
|
return finalise(r, pr, rm);
|
|
17249
17309
|
};
|
|
17250
17310
|
P.minus = P.sub = function(y) {
|
|
@@ -17274,7 +17334,7 @@ P.minus = P.sub = function(y) {
|
|
|
17274
17334
|
y = new Ctor(x);
|
|
17275
17335
|
else
|
|
17276
17336
|
return new Ctor(rm === 3 ? -0 : 0);
|
|
17277
|
-
return
|
|
17337
|
+
return external2 ? finalise(y, pr, rm) : y;
|
|
17278
17338
|
}
|
|
17279
17339
|
e = mathfloor(y.e / LOG_BASE);
|
|
17280
17340
|
xe = mathfloor(x.e / LOG_BASE);
|
|
@@ -17340,7 +17400,7 @@ P.minus = P.sub = function(y) {
|
|
|
17340
17400
|
return new Ctor(rm === 3 ? -0 : 0);
|
|
17341
17401
|
y.d = xd;
|
|
17342
17402
|
y.e = getBase10Exponent(xd, e);
|
|
17343
|
-
return
|
|
17403
|
+
return external2 ? finalise(y, pr, rm) : y;
|
|
17344
17404
|
};
|
|
17345
17405
|
P.modulo = P.mod = function(y) {
|
|
17346
17406
|
var q, x = this, Ctor = x.constructor;
|
|
@@ -17350,7 +17410,7 @@ P.modulo = P.mod = function(y) {
|
|
|
17350
17410
|
if (!y.d || x.d && !x.d[0]) {
|
|
17351
17411
|
return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);
|
|
17352
17412
|
}
|
|
17353
|
-
|
|
17413
|
+
external2 = false;
|
|
17354
17414
|
if (Ctor.modulo == 9) {
|
|
17355
17415
|
q = divide(x, y.abs(), 0, 3, 1);
|
|
17356
17416
|
q.s *= y.s;
|
|
@@ -17358,7 +17418,7 @@ P.modulo = P.mod = function(y) {
|
|
|
17358
17418
|
q = divide(x, y, 0, Ctor.modulo, 1);
|
|
17359
17419
|
}
|
|
17360
17420
|
q = q.times(y);
|
|
17361
|
-
|
|
17421
|
+
external2 = true;
|
|
17362
17422
|
return x.minus(q);
|
|
17363
17423
|
};
|
|
17364
17424
|
P.naturalExponential = P.exp = function() {
|
|
@@ -17393,7 +17453,7 @@ P.plus = P.add = function(y) {
|
|
|
17393
17453
|
if (!xd[0] || !yd[0]) {
|
|
17394
17454
|
if (!yd[0])
|
|
17395
17455
|
y = new Ctor(x);
|
|
17396
|
-
return
|
|
17456
|
+
return external2 ? finalise(y, pr, rm) : y;
|
|
17397
17457
|
}
|
|
17398
17458
|
k = mathfloor(x.e / LOG_BASE);
|
|
17399
17459
|
e = mathfloor(y.e / LOG_BASE);
|
|
@@ -17440,15 +17500,15 @@ P.plus = P.add = function(y) {
|
|
|
17440
17500
|
xd.pop();
|
|
17441
17501
|
y.d = xd;
|
|
17442
17502
|
y.e = getBase10Exponent(xd, e);
|
|
17443
|
-
return
|
|
17503
|
+
return external2 ? finalise(y, pr, rm) : y;
|
|
17444
17504
|
};
|
|
17445
|
-
P.precision = P.sd = function(
|
|
17505
|
+
P.precision = P.sd = function(z) {
|
|
17446
17506
|
var k, x = this;
|
|
17447
|
-
if (
|
|
17448
|
-
throw Error(invalidArgument +
|
|
17507
|
+
if (z !== undefined && z !== !!z && z !== 1 && z !== 0)
|
|
17508
|
+
throw Error(invalidArgument + z);
|
|
17449
17509
|
if (x.d) {
|
|
17450
17510
|
k = getPrecision(x.d);
|
|
17451
|
-
if (
|
|
17511
|
+
if (z && x.e + 1 > k)
|
|
17452
17512
|
k = x.e + 1;
|
|
17453
17513
|
} else {
|
|
17454
17514
|
k = NaN;
|
|
@@ -17479,7 +17539,7 @@ P.squareRoot = P.sqrt = function() {
|
|
|
17479
17539
|
if (s !== 1 || !d || !d[0]) {
|
|
17480
17540
|
return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);
|
|
17481
17541
|
}
|
|
17482
|
-
|
|
17542
|
+
external2 = false;
|
|
17483
17543
|
s = Math.sqrt(+x);
|
|
17484
17544
|
if (s == 0 || s == 1 / 0) {
|
|
17485
17545
|
n = digitsToString(d);
|
|
@@ -17522,7 +17582,7 @@ P.squareRoot = P.sqrt = function() {
|
|
|
17522
17582
|
}
|
|
17523
17583
|
}
|
|
17524
17584
|
}
|
|
17525
|
-
|
|
17585
|
+
external2 = true;
|
|
17526
17586
|
return finalise(r, e, Ctor.rounding, m);
|
|
17527
17587
|
};
|
|
17528
17588
|
P.tangent = P.tan = function() {
|
|
@@ -17580,7 +17640,7 @@ P.times = P.mul = function(y) {
|
|
|
17580
17640
|
r.shift();
|
|
17581
17641
|
y.d = r;
|
|
17582
17642
|
y.e = getBase10Exponent(r, e);
|
|
17583
|
-
return
|
|
17643
|
+
return external2 ? finalise(y, Ctor.precision, Ctor.rounding) : y;
|
|
17584
17644
|
};
|
|
17585
17645
|
P.toBinary = function(sd, rm) {
|
|
17586
17646
|
return toStringBinary(this, 2, sd, rm);
|
|
@@ -17645,7 +17705,7 @@ P.toFraction = function(maxD) {
|
|
|
17645
17705
|
throw Error(invalidArgument + n);
|
|
17646
17706
|
maxD = n.gt(d) ? e > 0 ? d : n1 : n;
|
|
17647
17707
|
}
|
|
17648
|
-
|
|
17708
|
+
external2 = false;
|
|
17649
17709
|
n = new Ctor(digitsToString(xd));
|
|
17650
17710
|
pr = Ctor.precision;
|
|
17651
17711
|
Ctor.precision = e = xd.length * LOG_BASE * 2;
|
|
@@ -17669,7 +17729,7 @@ P.toFraction = function(maxD) {
|
|
|
17669
17729
|
n0.s = n1.s = x.s;
|
|
17670
17730
|
r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];
|
|
17671
17731
|
Ctor.precision = pr;
|
|
17672
|
-
|
|
17732
|
+
external2 = true;
|
|
17673
17733
|
return r;
|
|
17674
17734
|
};
|
|
17675
17735
|
P.toHexadecimal = P.toHex = function(sd, rm) {
|
|
@@ -17699,9 +17759,9 @@ P.toNearest = function(y, rm) {
|
|
|
17699
17759
|
}
|
|
17700
17760
|
}
|
|
17701
17761
|
if (y.d[0]) {
|
|
17702
|
-
|
|
17762
|
+
external2 = false;
|
|
17703
17763
|
x = divide(x, y, 0, rm, 1).times(y);
|
|
17704
|
-
|
|
17764
|
+
external2 = true;
|
|
17705
17765
|
finalise(x);
|
|
17706
17766
|
} else {
|
|
17707
17767
|
y.s = x.s;
|
|
@@ -17746,7 +17806,7 @@ P.toPower = P.pow = function(y) {
|
|
|
17746
17806
|
e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log("0." + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + "").e;
|
|
17747
17807
|
if (e > Ctor.maxE + 1 || e < Ctor.minE - 1)
|
|
17748
17808
|
return new Ctor(e > 0 ? s / 0 : 0);
|
|
17749
|
-
|
|
17809
|
+
external2 = false;
|
|
17750
17810
|
Ctor.rounding = x.s = 1;
|
|
17751
17811
|
k = Math.min(12, (e + "").length);
|
|
17752
17812
|
r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);
|
|
@@ -17761,7 +17821,7 @@ P.toPower = P.pow = function(y) {
|
|
|
17761
17821
|
}
|
|
17762
17822
|
}
|
|
17763
17823
|
r.s = s;
|
|
17764
|
-
|
|
17824
|
+
external2 = true;
|
|
17765
17825
|
Ctor.rounding = rm;
|
|
17766
17826
|
return finalise(r, pr, rm);
|
|
17767
17827
|
};
|
|
@@ -18160,7 +18220,7 @@ function finalise(x, sd, rm, isTruncated) {
|
|
|
18160
18220
|
for (i = xd.length;xd[--i] === 0; )
|
|
18161
18221
|
xd.pop();
|
|
18162
18222
|
}
|
|
18163
|
-
if (
|
|
18223
|
+
if (external2) {
|
|
18164
18224
|
if (x.e > Ctor.maxE) {
|
|
18165
18225
|
x.d = null;
|
|
18166
18226
|
x.e = NaN;
|
|
@@ -18209,7 +18269,7 @@ function getBase10Exponent(digits, e) {
|
|
|
18209
18269
|
}
|
|
18210
18270
|
function getLn10(Ctor, sd, pr) {
|
|
18211
18271
|
if (sd > LN10_PRECISION) {
|
|
18212
|
-
|
|
18272
|
+
external2 = true;
|
|
18213
18273
|
if (pr)
|
|
18214
18274
|
Ctor.precision = pr;
|
|
18215
18275
|
throw Error(precisionLimitExceeded);
|
|
@@ -18240,7 +18300,7 @@ function getZeroString(k) {
|
|
|
18240
18300
|
}
|
|
18241
18301
|
function intPow(Ctor, x, n, pr) {
|
|
18242
18302
|
var isTruncated, r = new Ctor(1), k = Math.ceil(pr / LOG_BASE + 4);
|
|
18243
|
-
|
|
18303
|
+
external2 = false;
|
|
18244
18304
|
for (;; ) {
|
|
18245
18305
|
if (n % 2) {
|
|
18246
18306
|
r = r.times(x);
|
|
@@ -18257,7 +18317,7 @@ function intPow(Ctor, x, n, pr) {
|
|
|
18257
18317
|
x = x.times(x);
|
|
18258
18318
|
truncate(x.d, k);
|
|
18259
18319
|
}
|
|
18260
|
-
|
|
18320
|
+
external2 = true;
|
|
18261
18321
|
return r;
|
|
18262
18322
|
}
|
|
18263
18323
|
function isOdd(n) {
|
|
@@ -18284,7 +18344,7 @@ function naturalExponential(x, sd) {
|
|
|
18284
18344
|
return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : 0 / 0);
|
|
18285
18345
|
}
|
|
18286
18346
|
if (sd == null) {
|
|
18287
|
-
|
|
18347
|
+
external2 = false;
|
|
18288
18348
|
wpr = pr;
|
|
18289
18349
|
} else {
|
|
18290
18350
|
wpr = sd;
|
|
@@ -18313,7 +18373,7 @@ function naturalExponential(x, sd) {
|
|
|
18313
18373
|
i = 0;
|
|
18314
18374
|
rep++;
|
|
18315
18375
|
} else {
|
|
18316
|
-
return finalise(sum, Ctor.precision = pr, rm,
|
|
18376
|
+
return finalise(sum, Ctor.precision = pr, rm, external2 = true);
|
|
18317
18377
|
}
|
|
18318
18378
|
} else {
|
|
18319
18379
|
Ctor.precision = pr;
|
|
@@ -18329,7 +18389,7 @@ function naturalLogarithm(y, sd) {
|
|
|
18329
18389
|
return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);
|
|
18330
18390
|
}
|
|
18331
18391
|
if (sd == null) {
|
|
18332
|
-
|
|
18392
|
+
external2 = false;
|
|
18333
18393
|
wpr = pr;
|
|
18334
18394
|
} else {
|
|
18335
18395
|
wpr = sd;
|
|
@@ -18355,7 +18415,7 @@ function naturalLogarithm(y, sd) {
|
|
|
18355
18415
|
t = getLn10(Ctor, wpr + 2, pr).times(e + "");
|
|
18356
18416
|
x = naturalLogarithm(new Ctor(c0 + "." + c.slice(1)), wpr - guard).plus(t);
|
|
18357
18417
|
Ctor.precision = pr;
|
|
18358
|
-
return sd == null ? finalise(x, pr, rm,
|
|
18418
|
+
return sd == null ? finalise(x, pr, rm, external2 = true) : x;
|
|
18359
18419
|
}
|
|
18360
18420
|
x1 = x;
|
|
18361
18421
|
sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);
|
|
@@ -18376,7 +18436,7 @@ function naturalLogarithm(y, sd) {
|
|
|
18376
18436
|
x2 = finalise(x.times(x), wpr, 1);
|
|
18377
18437
|
denominator = rep = 1;
|
|
18378
18438
|
} else {
|
|
18379
|
-
return finalise(sum, Ctor.precision = pr, rm,
|
|
18439
|
+
return finalise(sum, Ctor.precision = pr, rm, external2 = true);
|
|
18380
18440
|
}
|
|
18381
18441
|
} else {
|
|
18382
18442
|
Ctor.precision = pr;
|
|
@@ -18427,7 +18487,7 @@ function parseDecimal(x, str) {
|
|
|
18427
18487
|
for (;i--; )
|
|
18428
18488
|
str += "0";
|
|
18429
18489
|
x.d.push(+str);
|
|
18430
|
-
if (
|
|
18490
|
+
if (external2) {
|
|
18431
18491
|
if (x.e > x.constructor.maxE) {
|
|
18432
18492
|
x.d = null;
|
|
18433
18493
|
x.e = NaN;
|
|
@@ -18489,12 +18549,12 @@ function parseOther(x, str) {
|
|
|
18489
18549
|
return new Ctor(x.s * 0);
|
|
18490
18550
|
x.e = getBase10Exponent(xd, xe);
|
|
18491
18551
|
x.d = xd;
|
|
18492
|
-
|
|
18552
|
+
external2 = false;
|
|
18493
18553
|
if (isFloat)
|
|
18494
18554
|
x = divide(x, divisor, len * 4);
|
|
18495
18555
|
if (p)
|
|
18496
18556
|
x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));
|
|
18497
|
-
|
|
18557
|
+
external2 = true;
|
|
18498
18558
|
return x;
|
|
18499
18559
|
}
|
|
18500
18560
|
function sine(Ctor, x) {
|
|
@@ -18515,7 +18575,7 @@ function sine(Ctor, x) {
|
|
|
18515
18575
|
}
|
|
18516
18576
|
function taylorSeries(Ctor, n, x, y, isHyperbolic) {
|
|
18517
18577
|
var j, t, u, x2, i = 1, pr = Ctor.precision, k = Math.ceil(pr / LOG_BASE);
|
|
18518
|
-
|
|
18578
|
+
external2 = false;
|
|
18519
18579
|
x2 = x.times(x);
|
|
18520
18580
|
u = new Ctor(y);
|
|
18521
18581
|
for (;; ) {
|
|
@@ -18535,7 +18595,7 @@ function taylorSeries(Ctor, n, x, y, isHyperbolic) {
|
|
|
18535
18595
|
t = j;
|
|
18536
18596
|
i++;
|
|
18537
18597
|
}
|
|
18538
|
-
|
|
18598
|
+
external2 = true;
|
|
18539
18599
|
t.d.length = k + 1;
|
|
18540
18600
|
return t;
|
|
18541
18601
|
}
|
|
@@ -18804,7 +18864,7 @@ function clone(obj) {
|
|
|
18804
18864
|
x.constructor = Decimal;
|
|
18805
18865
|
if (isDecimalInstance(v)) {
|
|
18806
18866
|
x.s = v.s;
|
|
18807
|
-
if (
|
|
18867
|
+
if (external2) {
|
|
18808
18868
|
if (!v.d || v.e > Decimal.maxE) {
|
|
18809
18869
|
x.e = NaN;
|
|
18810
18870
|
x.d = null;
|
|
@@ -18838,7 +18898,7 @@ function clone(obj) {
|
|
|
18838
18898
|
if (v === ~~v && v < 1e7) {
|
|
18839
18899
|
for (e = 0, i2 = v;i2 >= 10; i2 /= 10)
|
|
18840
18900
|
e++;
|
|
18841
|
-
if (
|
|
18901
|
+
if (external2) {
|
|
18842
18902
|
if (e > Decimal.maxE) {
|
|
18843
18903
|
x.e = NaN;
|
|
18844
18904
|
x.d = null;
|
|
@@ -18962,12 +19022,12 @@ function floor(x) {
|
|
|
18962
19022
|
}
|
|
18963
19023
|
function hypot() {
|
|
18964
19024
|
var i, n, t = new this(0);
|
|
18965
|
-
|
|
19025
|
+
external2 = false;
|
|
18966
19026
|
for (i = 0;i < arguments.length; ) {
|
|
18967
19027
|
n = new this(arguments[i++]);
|
|
18968
19028
|
if (!n.d) {
|
|
18969
19029
|
if (n.s) {
|
|
18970
|
-
|
|
19030
|
+
external2 = true;
|
|
18971
19031
|
return new this(1 / 0);
|
|
18972
19032
|
}
|
|
18973
19033
|
t = n;
|
|
@@ -18975,7 +19035,7 @@ function hypot() {
|
|
|
18975
19035
|
t = t.plus(n.times(n));
|
|
18976
19036
|
}
|
|
18977
19037
|
}
|
|
18978
|
-
|
|
19038
|
+
external2 = true;
|
|
18979
19039
|
return t.sqrt();
|
|
18980
19040
|
}
|
|
18981
19041
|
function isDecimalInstance(obj) {
|
|
@@ -19088,10 +19148,10 @@ function sub(x, y) {
|
|
|
19088
19148
|
}
|
|
19089
19149
|
function sum() {
|
|
19090
19150
|
var i = 0, args = arguments, x = new this(args[i]);
|
|
19091
|
-
|
|
19151
|
+
external2 = false;
|
|
19092
19152
|
for (;x.s && ++i < args.length; )
|
|
19093
19153
|
x = x.plus(args[i]);
|
|
19094
|
-
|
|
19154
|
+
external2 = true;
|
|
19095
19155
|
return finalise(x, this.precision, this.rounding);
|
|
19096
19156
|
}
|
|
19097
19157
|
function tan(x) {
|
|
@@ -20928,7 +20988,7 @@ var export__ = import_lodash.default;
|
|
|
20928
20988
|
var export_Dayjs = import_dayjs2.Dayjs;
|
|
20929
20989
|
|
|
20930
20990
|
export {
|
|
20931
|
-
z,
|
|
20991
|
+
exports_external as z,
|
|
20932
20992
|
watch,
|
|
20933
20993
|
voidType as void,
|
|
20934
20994
|
util,
|
|
@@ -21025,7 +21085,7 @@ export {
|
|
|
21025
21085
|
effectsType as effect,
|
|
21026
21086
|
discriminatedUnionType as discriminatedUnion,
|
|
21027
21087
|
delay,
|
|
21028
|
-
|
|
21088
|
+
en_default as defaultErrorMap,
|
|
21029
21089
|
dayjs_default as dayjs,
|
|
21030
21090
|
datetimeRegex,
|
|
21031
21091
|
dateType as date,
|