sixseconds-modules 1.6.156 → 1.6.158
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/index.cjs.js +256 -640
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +256 -640
- package/dist/index.es.js.map +1 -1
- package/package.json +98 -98
package/dist/index.es.js
CHANGED
|
@@ -530,10 +530,10 @@ function isFunction$2(value) {
|
|
|
530
530
|
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
|
531
531
|
}
|
|
532
532
|
var coreJsData = root["__core-js_shared__"];
|
|
533
|
-
var maskSrcKey = function() {
|
|
533
|
+
var maskSrcKey = (function() {
|
|
534
534
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
535
535
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
536
|
-
}();
|
|
536
|
+
})();
|
|
537
537
|
function isMasked(func) {
|
|
538
538
|
return !!maskSrcKey && maskSrcKey in func;
|
|
539
539
|
}
|
|
@@ -702,14 +702,14 @@ function arrayEach(array2, iteratee) {
|
|
|
702
702
|
}
|
|
703
703
|
return array2;
|
|
704
704
|
}
|
|
705
|
-
var defineProperty = function() {
|
|
705
|
+
var defineProperty = (function() {
|
|
706
706
|
try {
|
|
707
707
|
var func = getNative(Object, "defineProperty");
|
|
708
708
|
func({}, "", {});
|
|
709
709
|
return func;
|
|
710
710
|
} catch (e) {
|
|
711
711
|
}
|
|
712
|
-
}();
|
|
712
|
+
})();
|
|
713
713
|
function baseAssignValue(object2, key, value) {
|
|
714
714
|
if (key == "__proto__" && defineProperty) {
|
|
715
715
|
defineProperty(object2, key, {
|
|
@@ -762,9 +762,9 @@ function baseIsArguments(value) {
|
|
|
762
762
|
var objectProto$6 = Object.prototype;
|
|
763
763
|
var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
|
764
764
|
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
|
765
|
-
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
765
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
|
|
766
766
|
return arguments;
|
|
767
|
-
}()) ? baseIsArguments : function(value) {
|
|
767
|
+
})()) ? baseIsArguments : function(value) {
|
|
768
768
|
return isObjectLike(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
769
769
|
};
|
|
770
770
|
var isArray$1 = Array.isArray;
|
|
@@ -805,7 +805,7 @@ var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType &
|
|
|
805
805
|
var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
|
|
806
806
|
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
|
807
807
|
var freeProcess = moduleExports$1 && freeGlobal.process;
|
|
808
|
-
var nodeUtil = function() {
|
|
808
|
+
var nodeUtil = (function() {
|
|
809
809
|
try {
|
|
810
810
|
var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
|
|
811
811
|
if (types) {
|
|
@@ -814,7 +814,7 @@ var nodeUtil = function() {
|
|
|
814
814
|
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
815
815
|
} catch (e) {
|
|
816
816
|
}
|
|
817
|
-
}();
|
|
817
|
+
})();
|
|
818
818
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
819
819
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
820
820
|
var objectProto$5 = Object.prototype;
|
|
@@ -1065,7 +1065,7 @@ function initCloneByTag(object2, tag, isDeep) {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
1067
|
var objectCreate = Object.create;
|
|
1068
|
-
var baseCreate = /* @__PURE__ */ function() {
|
|
1068
|
+
var baseCreate = /* @__PURE__ */ (function() {
|
|
1069
1069
|
function object2() {
|
|
1070
1070
|
}
|
|
1071
1071
|
return function(proto2) {
|
|
@@ -1080,7 +1080,7 @@ var baseCreate = /* @__PURE__ */ function() {
|
|
|
1080
1080
|
object2.prototype = void 0;
|
|
1081
1081
|
return result;
|
|
1082
1082
|
};
|
|
1083
|
-
}();
|
|
1083
|
+
})();
|
|
1084
1084
|
function initCloneObject(object2) {
|
|
1085
1085
|
return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate(getPrototype(object2)) : {};
|
|
1086
1086
|
}
|
|
@@ -1342,7 +1342,7 @@ function requireReactIs_production_min() {
|
|
|
1342
1342
|
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
1343
1343
|
hasRequiredReactIs_production_min = 1;
|
|
1344
1344
|
var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
|
|
1345
|
-
function
|
|
1345
|
+
function z(a) {
|
|
1346
1346
|
if ("object" === typeof a && null !== a) {
|
|
1347
1347
|
var u = a.$$typeof;
|
|
1348
1348
|
switch (u) {
|
|
@@ -1373,7 +1373,7 @@ function requireReactIs_production_min() {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
1375
|
function A(a) {
|
|
1376
|
-
return
|
|
1376
|
+
return z(a) === m;
|
|
1377
1377
|
}
|
|
1378
1378
|
reactIs_production_min.AsyncMode = l;
|
|
1379
1379
|
reactIs_production_min.ConcurrentMode = m;
|
|
@@ -1389,46 +1389,46 @@ function requireReactIs_production_min() {
|
|
|
1389
1389
|
reactIs_production_min.StrictMode = f;
|
|
1390
1390
|
reactIs_production_min.Suspense = p;
|
|
1391
1391
|
reactIs_production_min.isAsyncMode = function(a) {
|
|
1392
|
-
return A(a) ||
|
|
1392
|
+
return A(a) || z(a) === l;
|
|
1393
1393
|
};
|
|
1394
1394
|
reactIs_production_min.isConcurrentMode = A;
|
|
1395
1395
|
reactIs_production_min.isContextConsumer = function(a) {
|
|
1396
|
-
return
|
|
1396
|
+
return z(a) === k;
|
|
1397
1397
|
};
|
|
1398
1398
|
reactIs_production_min.isContextProvider = function(a) {
|
|
1399
|
-
return
|
|
1399
|
+
return z(a) === h;
|
|
1400
1400
|
};
|
|
1401
1401
|
reactIs_production_min.isElement = function(a) {
|
|
1402
1402
|
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
1403
1403
|
};
|
|
1404
1404
|
reactIs_production_min.isForwardRef = function(a) {
|
|
1405
|
-
return
|
|
1405
|
+
return z(a) === n;
|
|
1406
1406
|
};
|
|
1407
1407
|
reactIs_production_min.isFragment = function(a) {
|
|
1408
|
-
return
|
|
1408
|
+
return z(a) === e;
|
|
1409
1409
|
};
|
|
1410
1410
|
reactIs_production_min.isLazy = function(a) {
|
|
1411
|
-
return
|
|
1411
|
+
return z(a) === t;
|
|
1412
1412
|
};
|
|
1413
1413
|
reactIs_production_min.isMemo = function(a) {
|
|
1414
|
-
return
|
|
1414
|
+
return z(a) === r;
|
|
1415
1415
|
};
|
|
1416
1416
|
reactIs_production_min.isPortal = function(a) {
|
|
1417
|
-
return
|
|
1417
|
+
return z(a) === d;
|
|
1418
1418
|
};
|
|
1419
1419
|
reactIs_production_min.isProfiler = function(a) {
|
|
1420
|
-
return
|
|
1420
|
+
return z(a) === g;
|
|
1421
1421
|
};
|
|
1422
1422
|
reactIs_production_min.isStrictMode = function(a) {
|
|
1423
|
-
return
|
|
1423
|
+
return z(a) === f;
|
|
1424
1424
|
};
|
|
1425
1425
|
reactIs_production_min.isSuspense = function(a) {
|
|
1426
|
-
return
|
|
1426
|
+
return z(a) === p;
|
|
1427
1427
|
};
|
|
1428
1428
|
reactIs_production_min.isValidElementType = function(a) {
|
|
1429
1429
|
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
1430
1430
|
};
|
|
1431
|
-
reactIs_production_min.typeOf =
|
|
1431
|
+
reactIs_production_min.typeOf = z;
|
|
1432
1432
|
return reactIs_production_min;
|
|
1433
1433
|
}
|
|
1434
1434
|
var reactIs_development = {};
|
|
@@ -2194,15 +2194,16 @@ function useFormik(_ref) {
|
|
|
2194
2194
|
});
|
|
2195
2195
|
}, []);
|
|
2196
2196
|
var setFieldValue = useEventCallback(function(field, value, shouldValidate) {
|
|
2197
|
+
var resolvedValue = isFunction$1(value) ? value(getIn$1(state.values, field)) : value;
|
|
2197
2198
|
dispatch({
|
|
2198
2199
|
type: "SET_FIELD_VALUE",
|
|
2199
2200
|
payload: {
|
|
2200
2201
|
field,
|
|
2201
|
-
value
|
|
2202
|
+
value: resolvedValue
|
|
2202
2203
|
}
|
|
2203
2204
|
});
|
|
2204
2205
|
var willValidate = shouldValidate === void 0 ? validateOnChange : shouldValidate;
|
|
2205
|
-
return willValidate ? validateFormWithHighPriority(setIn(state.values, field,
|
|
2206
|
+
return willValidate ? validateFormWithHighPriority(setIn(state.values, field, resolvedValue)) : Promise.resolve();
|
|
2206
2207
|
});
|
|
2207
2208
|
var executeChange = useCallback(function(eventOrTextValue, maybePath) {
|
|
2208
2209
|
var field = maybePath;
|
|
@@ -2649,15 +2650,18 @@ const ErrorMessage = ({ fieldName, formik }) => {
|
|
|
2649
2650
|
};
|
|
2650
2651
|
function createEnv(opts) {
|
|
2651
2652
|
const runtimeEnv = opts.runtimeEnvStrict ?? opts.runtimeEnv ?? process.env;
|
|
2652
|
-
|
|
2653
|
-
if (emptyStringAsUndefined) {
|
|
2653
|
+
if (opts.emptyStringAsUndefined ?? false) {
|
|
2654
2654
|
for (const [key, value] of Object.entries(runtimeEnv)) if (value === "") delete runtimeEnv[key];
|
|
2655
2655
|
}
|
|
2656
|
-
|
|
2656
|
+
{
|
|
2657
|
+
if (opts.extends) for (const preset of opts.extends) preset.skipValidation = true;
|
|
2658
|
+
return runtimeEnv;
|
|
2659
|
+
}
|
|
2657
2660
|
}
|
|
2658
2661
|
var util;
|
|
2659
2662
|
(function(util2) {
|
|
2660
|
-
util2.assertEqual = (
|
|
2663
|
+
util2.assertEqual = (_) => {
|
|
2664
|
+
};
|
|
2661
2665
|
function assertIs(_arg) {
|
|
2662
2666
|
}
|
|
2663
2667
|
util2.assertIs = assertIs;
|
|
@@ -2701,7 +2705,7 @@ var util;
|
|
|
2701
2705
|
}
|
|
2702
2706
|
return void 0;
|
|
2703
2707
|
};
|
|
2704
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
2708
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
2705
2709
|
function joinValues(array2, separator = " | ") {
|
|
2706
2710
|
return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
2707
2711
|
}
|
|
@@ -2753,7 +2757,7 @@ const getParsedType = (data) => {
|
|
|
2753
2757
|
case "string":
|
|
2754
2758
|
return ZodParsedType.string;
|
|
2755
2759
|
case "number":
|
|
2756
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
2760
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
2757
2761
|
case "boolean":
|
|
2758
2762
|
return ZodParsedType.boolean;
|
|
2759
2763
|
case "function":
|
|
@@ -2804,10 +2808,6 @@ const ZodIssueCode = util.arrayToEnum([
|
|
|
2804
2808
|
"not_multiple_of",
|
|
2805
2809
|
"not_finite"
|
|
2806
2810
|
]);
|
|
2807
|
-
const quotelessJson = (obj) => {
|
|
2808
|
-
const json = JSON.stringify(obj, null, 2);
|
|
2809
|
-
return json.replace(/"([^"]+)":/g, "$1:");
|
|
2810
|
-
};
|
|
2811
2811
|
class ZodError extends Error {
|
|
2812
2812
|
get errors() {
|
|
2813
2813
|
return this.issues;
|
|
@@ -2885,8 +2885,9 @@ class ZodError extends Error {
|
|
|
2885
2885
|
const formErrors = [];
|
|
2886
2886
|
for (const sub of this.issues) {
|
|
2887
2887
|
if (sub.path.length > 0) {
|
|
2888
|
-
|
|
2889
|
-
fieldErrors[
|
|
2888
|
+
const firstEl = sub.path[0];
|
|
2889
|
+
fieldErrors[firstEl] = fieldErrors[firstEl] || [];
|
|
2890
|
+
fieldErrors[firstEl].push(mapper(sub));
|
|
2890
2891
|
} else {
|
|
2891
2892
|
formErrors.push(mapper(sub));
|
|
2892
2893
|
}
|
|
@@ -2962,6 +2963,8 @@ const errorMap = (issue, _ctx) => {
|
|
|
2962
2963
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
2963
2964
|
else if (issue.type === "number")
|
|
2964
2965
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2966
|
+
else if (issue.type === "bigint")
|
|
2967
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2965
2968
|
else if (issue.type === "date")
|
|
2966
2969
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
2967
2970
|
else
|
|
@@ -3000,9 +3003,6 @@ const errorMap = (issue, _ctx) => {
|
|
|
3000
3003
|
return { message };
|
|
3001
3004
|
};
|
|
3002
3005
|
let overrideErrorMap = errorMap;
|
|
3003
|
-
function setErrorMap(map2) {
|
|
3004
|
-
overrideErrorMap = map2;
|
|
3005
|
-
}
|
|
3006
3006
|
function getErrorMap() {
|
|
3007
3007
|
return overrideErrorMap;
|
|
3008
3008
|
}
|
|
@@ -3031,7 +3031,6 @@ const makeIssue = (params) => {
|
|
|
3031
3031
|
message: errorMessage
|
|
3032
3032
|
};
|
|
3033
3033
|
};
|
|
3034
|
-
const EMPTY_PATH = [];
|
|
3035
3034
|
function addIssueToContext(ctx, issueData) {
|
|
3036
3035
|
const overrideMap = getErrorMap();
|
|
3037
3036
|
const issue = makeIssue({
|
|
@@ -3114,24 +3113,11 @@ const isAborted = (x) => x.status === "aborted";
|
|
|
3114
3113
|
const isDirty = (x) => x.status === "dirty";
|
|
3115
3114
|
const isValid$3 = (x) => x.status === "valid";
|
|
3116
3115
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
3117
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
3118
|
-
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3119
|
-
return state.get(receiver);
|
|
3120
|
-
}
|
|
3121
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
3122
|
-
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3123
|
-
return state.set(receiver, value), value;
|
|
3124
|
-
}
|
|
3125
|
-
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
3126
|
-
var e = new Error(message);
|
|
3127
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
3128
|
-
};
|
|
3129
3116
|
var errorUtil;
|
|
3130
3117
|
(function(errorUtil2) {
|
|
3131
3118
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
3132
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
3119
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
3133
3120
|
})(errorUtil || (errorUtil = {}));
|
|
3134
|
-
var _ZodEnum_cache, _ZodNativeEnum_cache;
|
|
3135
3121
|
class ParseInputLazyPath {
|
|
3136
3122
|
constructor(parent, value, path, key) {
|
|
3137
3123
|
this._cachedPath = [];
|
|
@@ -3142,7 +3128,7 @@ class ParseInputLazyPath {
|
|
|
3142
3128
|
}
|
|
3143
3129
|
get path() {
|
|
3144
3130
|
if (!this._cachedPath.length) {
|
|
3145
|
-
if (this._key
|
|
3131
|
+
if (Array.isArray(this._key)) {
|
|
3146
3132
|
this._cachedPath.push(...this._path, ...this._key);
|
|
3147
3133
|
} else {
|
|
3148
3134
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -3180,17 +3166,16 @@ function processCreateParams(params) {
|
|
|
3180
3166
|
if (errorMap2)
|
|
3181
3167
|
return { errorMap: errorMap2, description };
|
|
3182
3168
|
const customMap = (iss, ctx) => {
|
|
3183
|
-
var _a, _b;
|
|
3184
3169
|
const { message } = params;
|
|
3185
3170
|
if (iss.code === "invalid_enum_value") {
|
|
3186
|
-
return { message: message
|
|
3171
|
+
return { message: message ?? ctx.defaultError };
|
|
3187
3172
|
}
|
|
3188
3173
|
if (typeof ctx.data === "undefined") {
|
|
3189
|
-
return { message:
|
|
3174
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
3190
3175
|
}
|
|
3191
3176
|
if (iss.code !== "invalid_type")
|
|
3192
3177
|
return { message: ctx.defaultError };
|
|
3193
|
-
return { message:
|
|
3178
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
3194
3179
|
};
|
|
3195
3180
|
return { errorMap: customMap, description };
|
|
3196
3181
|
}
|
|
@@ -3242,14 +3227,13 @@ class ZodType {
|
|
|
3242
3227
|
throw result.error;
|
|
3243
3228
|
}
|
|
3244
3229
|
safeParse(data, params) {
|
|
3245
|
-
var _a;
|
|
3246
3230
|
const ctx = {
|
|
3247
3231
|
common: {
|
|
3248
3232
|
issues: [],
|
|
3249
|
-
async:
|
|
3250
|
-
contextualErrorMap: params
|
|
3233
|
+
async: params?.async ?? false,
|
|
3234
|
+
contextualErrorMap: params?.errorMap
|
|
3251
3235
|
},
|
|
3252
|
-
path:
|
|
3236
|
+
path: params?.path || [],
|
|
3253
3237
|
schemaErrorMap: this._def.errorMap,
|
|
3254
3238
|
parent: null,
|
|
3255
3239
|
data,
|
|
@@ -3259,7 +3243,6 @@ class ZodType {
|
|
|
3259
3243
|
return handleResult(ctx, result);
|
|
3260
3244
|
}
|
|
3261
3245
|
"~validate"(data) {
|
|
3262
|
-
var _a, _b;
|
|
3263
3246
|
const ctx = {
|
|
3264
3247
|
common: {
|
|
3265
3248
|
issues: [],
|
|
@@ -3280,7 +3263,7 @@ class ZodType {
|
|
|
3280
3263
|
issues: ctx.common.issues
|
|
3281
3264
|
};
|
|
3282
3265
|
} catch (err) {
|
|
3283
|
-
if (
|
|
3266
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
3284
3267
|
this["~standard"].async = true;
|
|
3285
3268
|
}
|
|
3286
3269
|
ctx.common = {
|
|
@@ -3305,10 +3288,10 @@ class ZodType {
|
|
|
3305
3288
|
const ctx = {
|
|
3306
3289
|
common: {
|
|
3307
3290
|
issues: [],
|
|
3308
|
-
contextualErrorMap: params
|
|
3291
|
+
contextualErrorMap: params?.errorMap,
|
|
3309
3292
|
async: true
|
|
3310
3293
|
},
|
|
3311
|
-
path:
|
|
3294
|
+
path: params?.path || [],
|
|
3312
3295
|
schemaErrorMap: this._def.errorMap,
|
|
3313
3296
|
parent: null,
|
|
3314
3297
|
data,
|
|
@@ -3533,16 +3516,20 @@ function isValidJWT(jwt, alg) {
|
|
|
3533
3516
|
return false;
|
|
3534
3517
|
try {
|
|
3535
3518
|
const [header] = jwt.split(".");
|
|
3519
|
+
if (!header)
|
|
3520
|
+
return false;
|
|
3536
3521
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
3537
3522
|
const decoded = JSON.parse(atob(base64));
|
|
3538
3523
|
if (typeof decoded !== "object" || decoded === null)
|
|
3539
3524
|
return false;
|
|
3540
|
-
if (
|
|
3525
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
3526
|
+
return false;
|
|
3527
|
+
if (!decoded.alg)
|
|
3541
3528
|
return false;
|
|
3542
3529
|
if (alg && decoded.alg !== alg)
|
|
3543
3530
|
return false;
|
|
3544
3531
|
return true;
|
|
3545
|
-
} catch
|
|
3532
|
+
} catch {
|
|
3546
3533
|
return false;
|
|
3547
3534
|
}
|
|
3548
3535
|
}
|
|
@@ -3701,7 +3688,7 @@ class ZodString extends ZodType {
|
|
|
3701
3688
|
} else if (check.kind === "url") {
|
|
3702
3689
|
try {
|
|
3703
3690
|
new URL(input.data);
|
|
3704
|
-
} catch
|
|
3691
|
+
} catch {
|
|
3705
3692
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
3706
3693
|
addIssueToContext(ctx, {
|
|
3707
3694
|
validation: "url",
|
|
@@ -3913,7 +3900,6 @@ class ZodString extends ZodType {
|
|
|
3913
3900
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
3914
3901
|
}
|
|
3915
3902
|
datetime(options) {
|
|
3916
|
-
var _a, _b;
|
|
3917
3903
|
if (typeof options === "string") {
|
|
3918
3904
|
return this._addCheck({
|
|
3919
3905
|
kind: "datetime",
|
|
@@ -3925,10 +3911,10 @@ class ZodString extends ZodType {
|
|
|
3925
3911
|
}
|
|
3926
3912
|
return this._addCheck({
|
|
3927
3913
|
kind: "datetime",
|
|
3928
|
-
precision: typeof
|
|
3929
|
-
offset:
|
|
3930
|
-
local:
|
|
3931
|
-
...errorUtil.errToObj(options
|
|
3914
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3915
|
+
offset: options?.offset ?? false,
|
|
3916
|
+
local: options?.local ?? false,
|
|
3917
|
+
...errorUtil.errToObj(options?.message)
|
|
3932
3918
|
});
|
|
3933
3919
|
}
|
|
3934
3920
|
date(message) {
|
|
@@ -3944,8 +3930,8 @@ class ZodString extends ZodType {
|
|
|
3944
3930
|
}
|
|
3945
3931
|
return this._addCheck({
|
|
3946
3932
|
kind: "time",
|
|
3947
|
-
precision: typeof
|
|
3948
|
-
...errorUtil.errToObj(options
|
|
3933
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3934
|
+
...errorUtil.errToObj(options?.message)
|
|
3949
3935
|
});
|
|
3950
3936
|
}
|
|
3951
3937
|
duration(message) {
|
|
@@ -3962,8 +3948,8 @@ class ZodString extends ZodType {
|
|
|
3962
3948
|
return this._addCheck({
|
|
3963
3949
|
kind: "includes",
|
|
3964
3950
|
value,
|
|
3965
|
-
position: options
|
|
3966
|
-
...errorUtil.errToObj(options
|
|
3951
|
+
position: options?.position,
|
|
3952
|
+
...errorUtil.errToObj(options?.message)
|
|
3967
3953
|
});
|
|
3968
3954
|
}
|
|
3969
3955
|
startsWith(value, message) {
|
|
@@ -4095,11 +4081,10 @@ class ZodString extends ZodType {
|
|
|
4095
4081
|
}
|
|
4096
4082
|
}
|
|
4097
4083
|
ZodString.create = (params) => {
|
|
4098
|
-
var _a;
|
|
4099
4084
|
return new ZodString({
|
|
4100
4085
|
checks: [],
|
|
4101
4086
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
4102
|
-
coerce:
|
|
4087
|
+
coerce: params?.coerce ?? false,
|
|
4103
4088
|
...processCreateParams(params)
|
|
4104
4089
|
});
|
|
4105
4090
|
};
|
|
@@ -4107,9 +4092,9 @@ function floatSafeRemainder(val, step) {
|
|
|
4107
4092
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
4108
4093
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
4109
4094
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
4110
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
4111
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
4112
|
-
return valInt % stepInt /
|
|
4095
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
4096
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
4097
|
+
return valInt % stepInt / 10 ** decCount;
|
|
4113
4098
|
}
|
|
4114
4099
|
class ZodNumber extends ZodType {
|
|
4115
4100
|
constructor() {
|
|
@@ -4319,7 +4304,8 @@ class ZodNumber extends ZodType {
|
|
|
4319
4304
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
4320
4305
|
}
|
|
4321
4306
|
get isFinite() {
|
|
4322
|
-
let max2 = null
|
|
4307
|
+
let max2 = null;
|
|
4308
|
+
let min2 = null;
|
|
4323
4309
|
for (const ch of this._def.checks) {
|
|
4324
4310
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
4325
4311
|
return true;
|
|
@@ -4338,7 +4324,7 @@ ZodNumber.create = (params) => {
|
|
|
4338
4324
|
return new ZodNumber({
|
|
4339
4325
|
checks: [],
|
|
4340
4326
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
4341
|
-
coerce:
|
|
4327
|
+
coerce: params?.coerce || false,
|
|
4342
4328
|
...processCreateParams(params)
|
|
4343
4329
|
});
|
|
4344
4330
|
};
|
|
@@ -4352,7 +4338,7 @@ class ZodBigInt extends ZodType {
|
|
|
4352
4338
|
if (this._def.coerce) {
|
|
4353
4339
|
try {
|
|
4354
4340
|
input.data = BigInt(input.data);
|
|
4355
|
-
} catch
|
|
4341
|
+
} catch {
|
|
4356
4342
|
return this._getInvalidInput(input);
|
|
4357
4343
|
}
|
|
4358
4344
|
}
|
|
@@ -4507,11 +4493,10 @@ class ZodBigInt extends ZodType {
|
|
|
4507
4493
|
}
|
|
4508
4494
|
}
|
|
4509
4495
|
ZodBigInt.create = (params) => {
|
|
4510
|
-
var _a;
|
|
4511
4496
|
return new ZodBigInt({
|
|
4512
4497
|
checks: [],
|
|
4513
4498
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
4514
|
-
coerce:
|
|
4499
|
+
coerce: params?.coerce ?? false,
|
|
4515
4500
|
...processCreateParams(params)
|
|
4516
4501
|
});
|
|
4517
4502
|
};
|
|
@@ -4536,7 +4521,7 @@ class ZodBoolean extends ZodType {
|
|
|
4536
4521
|
ZodBoolean.create = (params) => {
|
|
4537
4522
|
return new ZodBoolean({
|
|
4538
4523
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
4539
|
-
coerce:
|
|
4524
|
+
coerce: params?.coerce || false,
|
|
4540
4525
|
...processCreateParams(params)
|
|
4541
4526
|
});
|
|
4542
4527
|
};
|
|
@@ -4555,7 +4540,7 @@ class ZodDate extends ZodType {
|
|
|
4555
4540
|
});
|
|
4556
4541
|
return INVALID;
|
|
4557
4542
|
}
|
|
4558
|
-
if (isNaN(input.data.getTime())) {
|
|
4543
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
4559
4544
|
const ctx2 = this._getOrReturnCtx(input);
|
|
4560
4545
|
addIssueToContext(ctx2, {
|
|
4561
4546
|
code: ZodIssueCode.invalid_date
|
|
@@ -4644,7 +4629,7 @@ class ZodDate extends ZodType {
|
|
|
4644
4629
|
ZodDate.create = (params) => {
|
|
4645
4630
|
return new ZodDate({
|
|
4646
4631
|
checks: [],
|
|
4647
|
-
coerce:
|
|
4632
|
+
coerce: params?.coerce || false,
|
|
4648
4633
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
4649
4634
|
...processCreateParams(params)
|
|
4650
4635
|
});
|
|
@@ -4919,7 +4904,8 @@ class ZodObject extends ZodType {
|
|
|
4919
4904
|
return this._cached;
|
|
4920
4905
|
const shape = this._def.shape();
|
|
4921
4906
|
const keys2 = util.objectKeys(shape);
|
|
4922
|
-
|
|
4907
|
+
this._cached = { shape, keys: keys2 };
|
|
4908
|
+
return this._cached;
|
|
4923
4909
|
}
|
|
4924
4910
|
_parse(input) {
|
|
4925
4911
|
const parsedType = this._getType(input);
|
|
@@ -5017,11 +5003,10 @@ class ZodObject extends ZodType {
|
|
|
5017
5003
|
unknownKeys: "strict",
|
|
5018
5004
|
...message !== void 0 ? {
|
|
5019
5005
|
errorMap: (issue, ctx) => {
|
|
5020
|
-
|
|
5021
|
-
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
|
|
5006
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
5022
5007
|
if (issue.code === "unrecognized_keys")
|
|
5023
5008
|
return {
|
|
5024
|
-
message:
|
|
5009
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
5025
5010
|
};
|
|
5026
5011
|
return {
|
|
5027
5012
|
message: defaultError
|
|
@@ -5152,11 +5137,11 @@ class ZodObject extends ZodType {
|
|
|
5152
5137
|
}
|
|
5153
5138
|
pick(mask) {
|
|
5154
5139
|
const shape = {};
|
|
5155
|
-
util.objectKeys(mask)
|
|
5140
|
+
for (const key of util.objectKeys(mask)) {
|
|
5156
5141
|
if (mask[key] && this.shape[key]) {
|
|
5157
5142
|
shape[key] = this.shape[key];
|
|
5158
5143
|
}
|
|
5159
|
-
}
|
|
5144
|
+
}
|
|
5160
5145
|
return new ZodObject({
|
|
5161
5146
|
...this._def,
|
|
5162
5147
|
shape: () => shape
|
|
@@ -5164,11 +5149,11 @@ class ZodObject extends ZodType {
|
|
|
5164
5149
|
}
|
|
5165
5150
|
omit(mask) {
|
|
5166
5151
|
const shape = {};
|
|
5167
|
-
util.objectKeys(this.shape)
|
|
5152
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
5168
5153
|
if (!mask[key]) {
|
|
5169
5154
|
shape[key] = this.shape[key];
|
|
5170
5155
|
}
|
|
5171
|
-
}
|
|
5156
|
+
}
|
|
5172
5157
|
return new ZodObject({
|
|
5173
5158
|
...this._def,
|
|
5174
5159
|
shape: () => shape
|
|
@@ -5182,14 +5167,14 @@ class ZodObject extends ZodType {
|
|
|
5182
5167
|
}
|
|
5183
5168
|
partial(mask) {
|
|
5184
5169
|
const newShape = {};
|
|
5185
|
-
util.objectKeys(this.shape)
|
|
5170
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
5186
5171
|
const fieldSchema = this.shape[key];
|
|
5187
5172
|
if (mask && !mask[key]) {
|
|
5188
5173
|
newShape[key] = fieldSchema;
|
|
5189
5174
|
} else {
|
|
5190
5175
|
newShape[key] = fieldSchema.optional();
|
|
5191
5176
|
}
|
|
5192
|
-
}
|
|
5177
|
+
}
|
|
5193
5178
|
return new ZodObject({
|
|
5194
5179
|
...this._def,
|
|
5195
5180
|
shape: () => newShape
|
|
@@ -5197,7 +5182,7 @@ class ZodObject extends ZodType {
|
|
|
5197
5182
|
}
|
|
5198
5183
|
required(mask) {
|
|
5199
5184
|
const newShape = {};
|
|
5200
|
-
util.objectKeys(this.shape)
|
|
5185
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
5201
5186
|
if (mask && !mask[key]) {
|
|
5202
5187
|
newShape[key] = this.shape[key];
|
|
5203
5188
|
} else {
|
|
@@ -5208,7 +5193,7 @@ class ZodObject extends ZodType {
|
|
|
5208
5193
|
}
|
|
5209
5194
|
newShape[key] = newField;
|
|
5210
5195
|
}
|
|
5211
|
-
}
|
|
5196
|
+
}
|
|
5212
5197
|
return new ZodObject({
|
|
5213
5198
|
...this._def,
|
|
5214
5199
|
shape: () => newShape
|
|
@@ -5336,113 +5321,6 @@ ZodUnion.create = (types, params) => {
|
|
|
5336
5321
|
...processCreateParams(params)
|
|
5337
5322
|
});
|
|
5338
5323
|
};
|
|
5339
|
-
const getDiscriminator = (type) => {
|
|
5340
|
-
if (type instanceof ZodLazy) {
|
|
5341
|
-
return getDiscriminator(type.schema);
|
|
5342
|
-
} else if (type instanceof ZodEffects) {
|
|
5343
|
-
return getDiscriminator(type.innerType());
|
|
5344
|
-
} else if (type instanceof ZodLiteral) {
|
|
5345
|
-
return [type.value];
|
|
5346
|
-
} else if (type instanceof ZodEnum) {
|
|
5347
|
-
return type.options;
|
|
5348
|
-
} else if (type instanceof ZodNativeEnum) {
|
|
5349
|
-
return util.objectValues(type.enum);
|
|
5350
|
-
} else if (type instanceof ZodDefault) {
|
|
5351
|
-
return getDiscriminator(type._def.innerType);
|
|
5352
|
-
} else if (type instanceof ZodUndefined) {
|
|
5353
|
-
return [void 0];
|
|
5354
|
-
} else if (type instanceof ZodNull) {
|
|
5355
|
-
return [null];
|
|
5356
|
-
} else if (type instanceof ZodOptional) {
|
|
5357
|
-
return [void 0, ...getDiscriminator(type.unwrap())];
|
|
5358
|
-
} else if (type instanceof ZodNullable) {
|
|
5359
|
-
return [null, ...getDiscriminator(type.unwrap())];
|
|
5360
|
-
} else if (type instanceof ZodBranded) {
|
|
5361
|
-
return getDiscriminator(type.unwrap());
|
|
5362
|
-
} else if (type instanceof ZodReadonly) {
|
|
5363
|
-
return getDiscriminator(type.unwrap());
|
|
5364
|
-
} else if (type instanceof ZodCatch) {
|
|
5365
|
-
return getDiscriminator(type._def.innerType);
|
|
5366
|
-
} else {
|
|
5367
|
-
return [];
|
|
5368
|
-
}
|
|
5369
|
-
};
|
|
5370
|
-
class ZodDiscriminatedUnion extends ZodType {
|
|
5371
|
-
_parse(input) {
|
|
5372
|
-
const { ctx } = this._processInputParams(input);
|
|
5373
|
-
if (ctx.parsedType !== ZodParsedType.object) {
|
|
5374
|
-
addIssueToContext(ctx, {
|
|
5375
|
-
code: ZodIssueCode.invalid_type,
|
|
5376
|
-
expected: ZodParsedType.object,
|
|
5377
|
-
received: ctx.parsedType
|
|
5378
|
-
});
|
|
5379
|
-
return INVALID;
|
|
5380
|
-
}
|
|
5381
|
-
const discriminator = this.discriminator;
|
|
5382
|
-
const discriminatorValue = ctx.data[discriminator];
|
|
5383
|
-
const option = this.optionsMap.get(discriminatorValue);
|
|
5384
|
-
if (!option) {
|
|
5385
|
-
addIssueToContext(ctx, {
|
|
5386
|
-
code: ZodIssueCode.invalid_union_discriminator,
|
|
5387
|
-
options: Array.from(this.optionsMap.keys()),
|
|
5388
|
-
path: [discriminator]
|
|
5389
|
-
});
|
|
5390
|
-
return INVALID;
|
|
5391
|
-
}
|
|
5392
|
-
if (ctx.common.async) {
|
|
5393
|
-
return option._parseAsync({
|
|
5394
|
-
data: ctx.data,
|
|
5395
|
-
path: ctx.path,
|
|
5396
|
-
parent: ctx
|
|
5397
|
-
});
|
|
5398
|
-
} else {
|
|
5399
|
-
return option._parseSync({
|
|
5400
|
-
data: ctx.data,
|
|
5401
|
-
path: ctx.path,
|
|
5402
|
-
parent: ctx
|
|
5403
|
-
});
|
|
5404
|
-
}
|
|
5405
|
-
}
|
|
5406
|
-
get discriminator() {
|
|
5407
|
-
return this._def.discriminator;
|
|
5408
|
-
}
|
|
5409
|
-
get options() {
|
|
5410
|
-
return this._def.options;
|
|
5411
|
-
}
|
|
5412
|
-
get optionsMap() {
|
|
5413
|
-
return this._def.optionsMap;
|
|
5414
|
-
}
|
|
5415
|
-
/**
|
|
5416
|
-
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
5417
|
-
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
5418
|
-
* have a different value for each object in the union.
|
|
5419
|
-
* @param discriminator the name of the discriminator property
|
|
5420
|
-
* @param types an array of object schemas
|
|
5421
|
-
* @param params
|
|
5422
|
-
*/
|
|
5423
|
-
static create(discriminator, options, params) {
|
|
5424
|
-
const optionsMap = /* @__PURE__ */ new Map();
|
|
5425
|
-
for (const type of options) {
|
|
5426
|
-
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
5427
|
-
if (!discriminatorValues.length) {
|
|
5428
|
-
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
5429
|
-
}
|
|
5430
|
-
for (const value of discriminatorValues) {
|
|
5431
|
-
if (optionsMap.has(value)) {
|
|
5432
|
-
throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
5433
|
-
}
|
|
5434
|
-
optionsMap.set(value, type);
|
|
5435
|
-
}
|
|
5436
|
-
}
|
|
5437
|
-
return new ZodDiscriminatedUnion({
|
|
5438
|
-
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
|
|
5439
|
-
discriminator,
|
|
5440
|
-
options,
|
|
5441
|
-
optionsMap,
|
|
5442
|
-
...processCreateParams(params)
|
|
5443
|
-
});
|
|
5444
|
-
}
|
|
5445
|
-
}
|
|
5446
5324
|
function mergeValues(a, b) {
|
|
5447
5325
|
const aType = getParsedType(a);
|
|
5448
5326
|
const bType = getParsedType(b);
|
|
@@ -5601,59 +5479,6 @@ ZodTuple.create = (schemas, params) => {
|
|
|
5601
5479
|
...processCreateParams(params)
|
|
5602
5480
|
});
|
|
5603
5481
|
};
|
|
5604
|
-
class ZodRecord extends ZodType {
|
|
5605
|
-
get keySchema() {
|
|
5606
|
-
return this._def.keyType;
|
|
5607
|
-
}
|
|
5608
|
-
get valueSchema() {
|
|
5609
|
-
return this._def.valueType;
|
|
5610
|
-
}
|
|
5611
|
-
_parse(input) {
|
|
5612
|
-
const { status, ctx } = this._processInputParams(input);
|
|
5613
|
-
if (ctx.parsedType !== ZodParsedType.object) {
|
|
5614
|
-
addIssueToContext(ctx, {
|
|
5615
|
-
code: ZodIssueCode.invalid_type,
|
|
5616
|
-
expected: ZodParsedType.object,
|
|
5617
|
-
received: ctx.parsedType
|
|
5618
|
-
});
|
|
5619
|
-
return INVALID;
|
|
5620
|
-
}
|
|
5621
|
-
const pairs = [];
|
|
5622
|
-
const keyType = this._def.keyType;
|
|
5623
|
-
const valueType = this._def.valueType;
|
|
5624
|
-
for (const key in ctx.data) {
|
|
5625
|
-
pairs.push({
|
|
5626
|
-
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
|
5627
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
|
5628
|
-
alwaysSet: key in ctx.data
|
|
5629
|
-
});
|
|
5630
|
-
}
|
|
5631
|
-
if (ctx.common.async) {
|
|
5632
|
-
return ParseStatus.mergeObjectAsync(status, pairs);
|
|
5633
|
-
} else {
|
|
5634
|
-
return ParseStatus.mergeObjectSync(status, pairs);
|
|
5635
|
-
}
|
|
5636
|
-
}
|
|
5637
|
-
get element() {
|
|
5638
|
-
return this._def.valueType;
|
|
5639
|
-
}
|
|
5640
|
-
static create(first, second, third) {
|
|
5641
|
-
if (second instanceof ZodType) {
|
|
5642
|
-
return new ZodRecord({
|
|
5643
|
-
keyType: first,
|
|
5644
|
-
valueType: second,
|
|
5645
|
-
typeName: ZodFirstPartyTypeKind.ZodRecord,
|
|
5646
|
-
...processCreateParams(third)
|
|
5647
|
-
});
|
|
5648
|
-
}
|
|
5649
|
-
return new ZodRecord({
|
|
5650
|
-
keyType: ZodString.create(),
|
|
5651
|
-
valueType: first,
|
|
5652
|
-
typeName: ZodFirstPartyTypeKind.ZodRecord,
|
|
5653
|
-
...processCreateParams(second)
|
|
5654
|
-
});
|
|
5655
|
-
}
|
|
5656
|
-
}
|
|
5657
5482
|
class ZodMap extends ZodType {
|
|
5658
5483
|
get keySchema() {
|
|
5659
5484
|
return this._def.keyType;
|
|
@@ -5805,121 +5630,6 @@ ZodSet.create = (valueType, params) => {
|
|
|
5805
5630
|
...processCreateParams(params)
|
|
5806
5631
|
});
|
|
5807
5632
|
};
|
|
5808
|
-
class ZodFunction extends ZodType {
|
|
5809
|
-
constructor() {
|
|
5810
|
-
super(...arguments);
|
|
5811
|
-
this.validate = this.implement;
|
|
5812
|
-
}
|
|
5813
|
-
_parse(input) {
|
|
5814
|
-
const { ctx } = this._processInputParams(input);
|
|
5815
|
-
if (ctx.parsedType !== ZodParsedType.function) {
|
|
5816
|
-
addIssueToContext(ctx, {
|
|
5817
|
-
code: ZodIssueCode.invalid_type,
|
|
5818
|
-
expected: ZodParsedType.function,
|
|
5819
|
-
received: ctx.parsedType
|
|
5820
|
-
});
|
|
5821
|
-
return INVALID;
|
|
5822
|
-
}
|
|
5823
|
-
function makeArgsIssue(args, error) {
|
|
5824
|
-
return makeIssue({
|
|
5825
|
-
data: args,
|
|
5826
|
-
path: ctx.path,
|
|
5827
|
-
errorMaps: [
|
|
5828
|
-
ctx.common.contextualErrorMap,
|
|
5829
|
-
ctx.schemaErrorMap,
|
|
5830
|
-
getErrorMap(),
|
|
5831
|
-
errorMap
|
|
5832
|
-
].filter((x) => !!x),
|
|
5833
|
-
issueData: {
|
|
5834
|
-
code: ZodIssueCode.invalid_arguments,
|
|
5835
|
-
argumentsError: error
|
|
5836
|
-
}
|
|
5837
|
-
});
|
|
5838
|
-
}
|
|
5839
|
-
function makeReturnsIssue(returns, error) {
|
|
5840
|
-
return makeIssue({
|
|
5841
|
-
data: returns,
|
|
5842
|
-
path: ctx.path,
|
|
5843
|
-
errorMaps: [
|
|
5844
|
-
ctx.common.contextualErrorMap,
|
|
5845
|
-
ctx.schemaErrorMap,
|
|
5846
|
-
getErrorMap(),
|
|
5847
|
-
errorMap
|
|
5848
|
-
].filter((x) => !!x),
|
|
5849
|
-
issueData: {
|
|
5850
|
-
code: ZodIssueCode.invalid_return_type,
|
|
5851
|
-
returnTypeError: error
|
|
5852
|
-
}
|
|
5853
|
-
});
|
|
5854
|
-
}
|
|
5855
|
-
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
5856
|
-
const fn = ctx.data;
|
|
5857
|
-
if (this._def.returns instanceof ZodPromise) {
|
|
5858
|
-
const me = this;
|
|
5859
|
-
return OK(async function(...args) {
|
|
5860
|
-
const error = new ZodError([]);
|
|
5861
|
-
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
5862
|
-
error.addIssue(makeArgsIssue(args, e));
|
|
5863
|
-
throw error;
|
|
5864
|
-
});
|
|
5865
|
-
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
5866
|
-
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
5867
|
-
error.addIssue(makeReturnsIssue(result, e));
|
|
5868
|
-
throw error;
|
|
5869
|
-
});
|
|
5870
|
-
return parsedReturns;
|
|
5871
|
-
});
|
|
5872
|
-
} else {
|
|
5873
|
-
const me = this;
|
|
5874
|
-
return OK(function(...args) {
|
|
5875
|
-
const parsedArgs = me._def.args.safeParse(args, params);
|
|
5876
|
-
if (!parsedArgs.success) {
|
|
5877
|
-
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
5878
|
-
}
|
|
5879
|
-
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
5880
|
-
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
5881
|
-
if (!parsedReturns.success) {
|
|
5882
|
-
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
5883
|
-
}
|
|
5884
|
-
return parsedReturns.data;
|
|
5885
|
-
});
|
|
5886
|
-
}
|
|
5887
|
-
}
|
|
5888
|
-
parameters() {
|
|
5889
|
-
return this._def.args;
|
|
5890
|
-
}
|
|
5891
|
-
returnType() {
|
|
5892
|
-
return this._def.returns;
|
|
5893
|
-
}
|
|
5894
|
-
args(...items) {
|
|
5895
|
-
return new ZodFunction({
|
|
5896
|
-
...this._def,
|
|
5897
|
-
args: ZodTuple.create(items).rest(ZodUnknown.create())
|
|
5898
|
-
});
|
|
5899
|
-
}
|
|
5900
|
-
returns(returnType) {
|
|
5901
|
-
return new ZodFunction({
|
|
5902
|
-
...this._def,
|
|
5903
|
-
returns: returnType
|
|
5904
|
-
});
|
|
5905
|
-
}
|
|
5906
|
-
implement(func) {
|
|
5907
|
-
const validatedFunc = this.parse(func);
|
|
5908
|
-
return validatedFunc;
|
|
5909
|
-
}
|
|
5910
|
-
strictImplement(func) {
|
|
5911
|
-
const validatedFunc = this.parse(func);
|
|
5912
|
-
return validatedFunc;
|
|
5913
|
-
}
|
|
5914
|
-
static create(args, returns, params) {
|
|
5915
|
-
return new ZodFunction({
|
|
5916
|
-
args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
|
|
5917
|
-
returns: returns || ZodUnknown.create(),
|
|
5918
|
-
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
5919
|
-
...processCreateParams(params)
|
|
5920
|
-
});
|
|
5921
|
-
}
|
|
5922
|
-
}
|
|
5923
5633
|
class ZodLazy extends ZodType {
|
|
5924
5634
|
get schema() {
|
|
5925
5635
|
return this._def.getter();
|
|
@@ -5969,10 +5679,6 @@ function createZodEnum(values, params) {
|
|
|
5969
5679
|
});
|
|
5970
5680
|
}
|
|
5971
5681
|
class ZodEnum extends ZodType {
|
|
5972
|
-
constructor() {
|
|
5973
|
-
super(...arguments);
|
|
5974
|
-
_ZodEnum_cache.set(this, void 0);
|
|
5975
|
-
}
|
|
5976
5682
|
_parse(input) {
|
|
5977
5683
|
if (typeof input.data !== "string") {
|
|
5978
5684
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5984,10 +5690,10 @@ class ZodEnum extends ZodType {
|
|
|
5984
5690
|
});
|
|
5985
5691
|
return INVALID;
|
|
5986
5692
|
}
|
|
5987
|
-
if (!
|
|
5988
|
-
|
|
5693
|
+
if (!this._cache) {
|
|
5694
|
+
this._cache = new Set(this._def.values);
|
|
5989
5695
|
}
|
|
5990
|
-
if (!
|
|
5696
|
+
if (!this._cache.has(input.data)) {
|
|
5991
5697
|
const ctx = this._getOrReturnCtx(input);
|
|
5992
5698
|
const expectedValues = this._def.values;
|
|
5993
5699
|
addIssueToContext(ctx, {
|
|
@@ -6036,13 +5742,8 @@ class ZodEnum extends ZodType {
|
|
|
6036
5742
|
});
|
|
6037
5743
|
}
|
|
6038
5744
|
}
|
|
6039
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
6040
5745
|
ZodEnum.create = createZodEnum;
|
|
6041
5746
|
class ZodNativeEnum extends ZodType {
|
|
6042
|
-
constructor() {
|
|
6043
|
-
super(...arguments);
|
|
6044
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
|
6045
|
-
}
|
|
6046
5747
|
_parse(input) {
|
|
6047
5748
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
6048
5749
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -6055,10 +5756,10 @@ class ZodNativeEnum extends ZodType {
|
|
|
6055
5756
|
});
|
|
6056
5757
|
return INVALID;
|
|
6057
5758
|
}
|
|
6058
|
-
if (!
|
|
6059
|
-
|
|
5759
|
+
if (!this._cache) {
|
|
5760
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
6060
5761
|
}
|
|
6061
|
-
if (!
|
|
5762
|
+
if (!this._cache.has(input.data)) {
|
|
6062
5763
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
6063
5764
|
addIssueToContext(ctx, {
|
|
6064
5765
|
received: ctx.data,
|
|
@@ -6073,7 +5774,6 @@ class ZodNativeEnum extends ZodType {
|
|
|
6073
5774
|
return this._def.values;
|
|
6074
5775
|
}
|
|
6075
5776
|
}
|
|
6076
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
6077
5777
|
ZodNativeEnum.create = (values, params) => {
|
|
6078
5778
|
return new ZodNativeEnum({
|
|
6079
5779
|
values,
|
|
@@ -6214,7 +5914,7 @@ class ZodEffects extends ZodType {
|
|
|
6214
5914
|
parent: ctx
|
|
6215
5915
|
});
|
|
6216
5916
|
if (!isValid$3(base))
|
|
6217
|
-
return
|
|
5917
|
+
return INVALID;
|
|
6218
5918
|
const result = effect.transform(base.value, checkCtx);
|
|
6219
5919
|
if (result instanceof Promise) {
|
|
6220
5920
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -6223,8 +5923,11 @@ class ZodEffects extends ZodType {
|
|
|
6223
5923
|
} else {
|
|
6224
5924
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
6225
5925
|
if (!isValid$3(base))
|
|
6226
|
-
return
|
|
6227
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5926
|
+
return INVALID;
|
|
5927
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5928
|
+
status: status.value,
|
|
5929
|
+
value: result
|
|
5930
|
+
}));
|
|
6228
5931
|
});
|
|
6229
5932
|
}
|
|
6230
5933
|
}
|
|
@@ -6384,7 +6087,6 @@ ZodNaN.create = (params) => {
|
|
|
6384
6087
|
...processCreateParams(params)
|
|
6385
6088
|
});
|
|
6386
6089
|
};
|
|
6387
|
-
const BRAND = Symbol("zod_brand");
|
|
6388
6090
|
class ZodBranded extends ZodType {
|
|
6389
6091
|
_parse(input) {
|
|
6390
6092
|
const { ctx } = this._processInputParams(input);
|
|
@@ -6476,38 +6178,6 @@ ZodReadonly.create = (type, params) => {
|
|
|
6476
6178
|
...processCreateParams(params)
|
|
6477
6179
|
});
|
|
6478
6180
|
};
|
|
6479
|
-
function cleanParams(params, data) {
|
|
6480
|
-
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
6481
|
-
const p2 = typeof p === "string" ? { message: p } : p;
|
|
6482
|
-
return p2;
|
|
6483
|
-
}
|
|
6484
|
-
function custom(check, _params = {}, fatal) {
|
|
6485
|
-
if (check)
|
|
6486
|
-
return ZodAny.create().superRefine((data, ctx) => {
|
|
6487
|
-
var _a, _b;
|
|
6488
|
-
const r = check(data);
|
|
6489
|
-
if (r instanceof Promise) {
|
|
6490
|
-
return r.then((r2) => {
|
|
6491
|
-
var _a2, _b2;
|
|
6492
|
-
if (!r2) {
|
|
6493
|
-
const params = cleanParams(_params, data);
|
|
6494
|
-
const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
|
|
6495
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
6496
|
-
}
|
|
6497
|
-
});
|
|
6498
|
-
}
|
|
6499
|
-
if (!r) {
|
|
6500
|
-
const params = cleanParams(_params, data);
|
|
6501
|
-
const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
|
|
6502
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
6503
|
-
}
|
|
6504
|
-
return;
|
|
6505
|
-
});
|
|
6506
|
-
return ZodAny.create();
|
|
6507
|
-
}
|
|
6508
|
-
const late = {
|
|
6509
|
-
object: ZodObject.lazycreate
|
|
6510
|
-
};
|
|
6511
6181
|
var ZodFirstPartyTypeKind;
|
|
6512
6182
|
(function(ZodFirstPartyTypeKind2) {
|
|
6513
6183
|
ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
|
|
@@ -6547,177 +6217,20 @@ var ZodFirstPartyTypeKind;
|
|
|
6547
6217
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
|
6548
6218
|
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
|
6549
6219
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
6550
|
-
const instanceOfType = (cls, params = {
|
|
6551
|
-
message: `Input not instance of ${cls.name}`
|
|
6552
|
-
}) => custom((data) => data instanceof cls, params);
|
|
6553
6220
|
const stringType = ZodString.create;
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
const
|
|
6564
|
-
const neverType = ZodNever.create;
|
|
6565
|
-
const voidType = ZodVoid.create;
|
|
6566
|
-
const arrayType = ZodArray.create;
|
|
6567
|
-
const objectType = ZodObject.create;
|
|
6568
|
-
const strictObjectType = ZodObject.strictCreate;
|
|
6569
|
-
const unionType = ZodUnion.create;
|
|
6570
|
-
const discriminatedUnionType = ZodDiscriminatedUnion.create;
|
|
6571
|
-
const intersectionType = ZodIntersection.create;
|
|
6572
|
-
const tupleType = ZodTuple.create;
|
|
6573
|
-
const recordType = ZodRecord.create;
|
|
6574
|
-
const mapType = ZodMap.create;
|
|
6575
|
-
const setType = ZodSet.create;
|
|
6576
|
-
const functionType = ZodFunction.create;
|
|
6577
|
-
const lazyType = ZodLazy.create;
|
|
6578
|
-
const literalType = ZodLiteral.create;
|
|
6579
|
-
const enumType = ZodEnum.create;
|
|
6580
|
-
const nativeEnumType = ZodNativeEnum.create;
|
|
6581
|
-
const promiseType = ZodPromise.create;
|
|
6582
|
-
const effectsType = ZodEffects.create;
|
|
6583
|
-
const optionalType = ZodOptional.create;
|
|
6584
|
-
const nullableType = ZodNullable.create;
|
|
6585
|
-
const preprocessType = ZodEffects.createWithPreprocess;
|
|
6586
|
-
const pipelineType = ZodPipeline.create;
|
|
6587
|
-
const ostring = () => stringType().optional();
|
|
6588
|
-
const onumber = () => numberType().optional();
|
|
6589
|
-
const oboolean = () => booleanType().optional();
|
|
6590
|
-
const coerce = {
|
|
6591
|
-
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
|
6592
|
-
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
|
6593
|
-
boolean: (arg) => ZodBoolean.create({
|
|
6594
|
-
...arg,
|
|
6595
|
-
coerce: true
|
|
6596
|
-
}),
|
|
6597
|
-
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
|
6598
|
-
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
6599
|
-
};
|
|
6600
|
-
const NEVER = INVALID;
|
|
6601
|
-
var z = /* @__PURE__ */ Object.freeze({
|
|
6602
|
-
__proto__: null,
|
|
6603
|
-
defaultErrorMap: errorMap,
|
|
6604
|
-
setErrorMap,
|
|
6605
|
-
getErrorMap,
|
|
6606
|
-
makeIssue,
|
|
6607
|
-
EMPTY_PATH,
|
|
6608
|
-
addIssueToContext,
|
|
6609
|
-
ParseStatus,
|
|
6610
|
-
INVALID,
|
|
6611
|
-
DIRTY,
|
|
6612
|
-
OK,
|
|
6613
|
-
isAborted,
|
|
6614
|
-
isDirty,
|
|
6615
|
-
isValid: isValid$3,
|
|
6616
|
-
isAsync,
|
|
6617
|
-
get util() {
|
|
6618
|
-
return util;
|
|
6619
|
-
},
|
|
6620
|
-
get objectUtil() {
|
|
6621
|
-
return objectUtil;
|
|
6622
|
-
},
|
|
6623
|
-
ZodParsedType,
|
|
6624
|
-
getParsedType,
|
|
6625
|
-
ZodType,
|
|
6626
|
-
datetimeRegex,
|
|
6627
|
-
ZodString,
|
|
6628
|
-
ZodNumber,
|
|
6629
|
-
ZodBigInt,
|
|
6630
|
-
ZodBoolean,
|
|
6631
|
-
ZodDate,
|
|
6632
|
-
ZodSymbol,
|
|
6633
|
-
ZodUndefined,
|
|
6634
|
-
ZodNull,
|
|
6635
|
-
ZodAny,
|
|
6636
|
-
ZodUnknown,
|
|
6637
|
-
ZodNever,
|
|
6638
|
-
ZodVoid,
|
|
6639
|
-
ZodArray,
|
|
6640
|
-
ZodObject,
|
|
6641
|
-
ZodUnion,
|
|
6642
|
-
ZodDiscriminatedUnion,
|
|
6643
|
-
ZodIntersection,
|
|
6644
|
-
ZodTuple,
|
|
6645
|
-
ZodRecord,
|
|
6646
|
-
ZodMap,
|
|
6647
|
-
ZodSet,
|
|
6648
|
-
ZodFunction,
|
|
6649
|
-
ZodLazy,
|
|
6650
|
-
ZodLiteral,
|
|
6651
|
-
ZodEnum,
|
|
6652
|
-
ZodNativeEnum,
|
|
6653
|
-
ZodPromise,
|
|
6654
|
-
ZodEffects,
|
|
6655
|
-
ZodTransformer: ZodEffects,
|
|
6656
|
-
ZodOptional,
|
|
6657
|
-
ZodNullable,
|
|
6658
|
-
ZodDefault,
|
|
6659
|
-
ZodCatch,
|
|
6660
|
-
ZodNaN,
|
|
6661
|
-
BRAND,
|
|
6662
|
-
ZodBranded,
|
|
6663
|
-
ZodPipeline,
|
|
6664
|
-
ZodReadonly,
|
|
6665
|
-
custom,
|
|
6666
|
-
Schema: ZodType,
|
|
6667
|
-
ZodSchema: ZodType,
|
|
6668
|
-
late,
|
|
6669
|
-
get ZodFirstPartyTypeKind() {
|
|
6670
|
-
return ZodFirstPartyTypeKind;
|
|
6671
|
-
},
|
|
6672
|
-
coerce,
|
|
6673
|
-
any: anyType,
|
|
6674
|
-
array: arrayType,
|
|
6675
|
-
bigint: bigIntType,
|
|
6676
|
-
boolean: booleanType,
|
|
6677
|
-
date: dateType,
|
|
6678
|
-
discriminatedUnion: discriminatedUnionType,
|
|
6679
|
-
effect: effectsType,
|
|
6680
|
-
"enum": enumType,
|
|
6681
|
-
"function": functionType,
|
|
6682
|
-
"instanceof": instanceOfType,
|
|
6683
|
-
intersection: intersectionType,
|
|
6684
|
-
lazy: lazyType,
|
|
6685
|
-
literal: literalType,
|
|
6686
|
-
map: mapType,
|
|
6687
|
-
nan: nanType,
|
|
6688
|
-
nativeEnum: nativeEnumType,
|
|
6689
|
-
never: neverType,
|
|
6690
|
-
"null": nullType,
|
|
6691
|
-
nullable: nullableType,
|
|
6692
|
-
number: numberType,
|
|
6693
|
-
object: objectType,
|
|
6694
|
-
oboolean,
|
|
6695
|
-
onumber,
|
|
6696
|
-
optional: optionalType,
|
|
6697
|
-
ostring,
|
|
6698
|
-
pipeline: pipelineType,
|
|
6699
|
-
preprocess: preprocessType,
|
|
6700
|
-
promise: promiseType,
|
|
6701
|
-
record: recordType,
|
|
6702
|
-
set: setType,
|
|
6703
|
-
strictObject: strictObjectType,
|
|
6704
|
-
string: stringType,
|
|
6705
|
-
symbol: symbolType,
|
|
6706
|
-
transformer: effectsType,
|
|
6707
|
-
tuple: tupleType,
|
|
6708
|
-
"undefined": undefinedType,
|
|
6709
|
-
union: unionType,
|
|
6710
|
-
unknown: unknownType,
|
|
6711
|
-
"void": voidType,
|
|
6712
|
-
NEVER,
|
|
6713
|
-
ZodIssueCode,
|
|
6714
|
-
quotelessJson,
|
|
6715
|
-
ZodError
|
|
6716
|
-
});
|
|
6717
|
-
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_MODULES_CARDS_ADMIN_FRONTEND_BASE_URL": "https://admin-cards.6seconds.org", "VITE_MODULES_CARDS_HOME_FRONTEND_BASE_URL": "https://cards.6seconds.org", "VITE_MODULES_CERT_FRONTEND_BASE_URL": "https://cert.6seconds.org", "VITE_MODULES_ENV": "prod", "VITE_MODULES_EVENTS_FRONTEND_BASE_URL": "https://events.6seconds.org", "VITE_MODULES_SSO_BACKEND_BASE_URL": "https://ssoapi.6seconds.org", "VITE_MODULES_SSO_FRONTEND_BASE_URL": "https://sso.6seconds.org", "VITE_MODULES_TOOLS_FRONTEND_BASE_URL": "https://newtools.6seconds.org" };
|
|
6221
|
+
ZodNever.create;
|
|
6222
|
+
ZodArray.create;
|
|
6223
|
+
ZodUnion.create;
|
|
6224
|
+
ZodIntersection.create;
|
|
6225
|
+
ZodTuple.create;
|
|
6226
|
+
ZodEnum.create;
|
|
6227
|
+
ZodPromise.create;
|
|
6228
|
+
ZodOptional.create;
|
|
6229
|
+
ZodNullable.create;
|
|
6230
|
+
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "qa", "PROD": true, "SSR": false, "VITE_MODULES_CARDS_ADMIN_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_CARDS_HOME_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_CERT_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_ENV": "qa", "VITE_MODULES_EVENTS_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_SSO_BACKEND_BASE_URL": "https://qa-ssoapi.6seconds.org", "VITE_MODULES_SSO_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_TOOLS_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org" };
|
|
6718
6231
|
const env = createEnv({
|
|
6719
6232
|
client: {
|
|
6720
|
-
VITE_MODULES_ENV:
|
|
6233
|
+
VITE_MODULES_ENV: stringType()
|
|
6721
6234
|
},
|
|
6722
6235
|
runtimeEnv: __vite_import_meta_env__
|
|
6723
6236
|
});
|
|
@@ -11430,19 +10943,20 @@ function createValidation(config) {
|
|
|
11430
10943
|
abortEarly = schema.spec.abortEarly,
|
|
11431
10944
|
disableStackTrace = schema.spec.disableStackTrace
|
|
11432
10945
|
} = options;
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
10946
|
+
const resolveOptions = {
|
|
10947
|
+
value,
|
|
10948
|
+
parent,
|
|
10949
|
+
context
|
|
10950
|
+
};
|
|
11436
10951
|
function createError(overrides = {}) {
|
|
11437
|
-
const nextParams = Object.assign({
|
|
10952
|
+
const nextParams = resolveParams(Object.assign({
|
|
11438
10953
|
value,
|
|
11439
10954
|
originalValue,
|
|
11440
10955
|
label: schema.spec.label,
|
|
11441
10956
|
path: overrides.path || path,
|
|
11442
10957
|
spec: schema.spec,
|
|
11443
10958
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
11444
|
-
}, params, overrides.params);
|
|
11445
|
-
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
10959
|
+
}, params, overrides.params), resolveOptions);
|
|
11446
10960
|
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
|
|
11447
10961
|
error.params = nextParams;
|
|
11448
10962
|
return error;
|
|
@@ -11454,7 +10968,9 @@ function createValidation(config) {
|
|
|
11454
10968
|
type: name,
|
|
11455
10969
|
from: options.from,
|
|
11456
10970
|
createError,
|
|
11457
|
-
resolve
|
|
10971
|
+
resolve(item) {
|
|
10972
|
+
return resolveMaybeRef(item, resolveOptions);
|
|
10973
|
+
},
|
|
11458
10974
|
options,
|
|
11459
10975
|
originalValue,
|
|
11460
10976
|
schema
|
|
@@ -11491,6 +11007,16 @@ function createValidation(config) {
|
|
|
11491
11007
|
validate.OPTIONS = config;
|
|
11492
11008
|
return validate;
|
|
11493
11009
|
}
|
|
11010
|
+
function resolveParams(params, options) {
|
|
11011
|
+
if (!params) return params;
|
|
11012
|
+
for (const key of Object.keys(params)) {
|
|
11013
|
+
params[key] = resolveMaybeRef(params[key], options);
|
|
11014
|
+
}
|
|
11015
|
+
return params;
|
|
11016
|
+
}
|
|
11017
|
+
function resolveMaybeRef(item, options) {
|
|
11018
|
+
return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
|
|
11019
|
+
}
|
|
11494
11020
|
function getIn(schema, path, value, context = value) {
|
|
11495
11021
|
let parent, lastPart, lastPartDebug;
|
|
11496
11022
|
if (!path) return {
|
|
@@ -11587,6 +11113,69 @@ function clone(src, seen = /* @__PURE__ */ new Map()) {
|
|
|
11587
11113
|
}
|
|
11588
11114
|
return copy;
|
|
11589
11115
|
}
|
|
11116
|
+
function createStandardPath(path) {
|
|
11117
|
+
if (!(path != null && path.length)) {
|
|
11118
|
+
return void 0;
|
|
11119
|
+
}
|
|
11120
|
+
const segments = [];
|
|
11121
|
+
let currentSegment = "";
|
|
11122
|
+
let inBrackets = false;
|
|
11123
|
+
let inQuotes = false;
|
|
11124
|
+
for (let i = 0; i < path.length; i++) {
|
|
11125
|
+
const char = path[i];
|
|
11126
|
+
if (char === "[" && !inQuotes) {
|
|
11127
|
+
if (currentSegment) {
|
|
11128
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
11129
|
+
currentSegment = "";
|
|
11130
|
+
}
|
|
11131
|
+
inBrackets = true;
|
|
11132
|
+
continue;
|
|
11133
|
+
}
|
|
11134
|
+
if (char === "]" && !inQuotes) {
|
|
11135
|
+
if (currentSegment) {
|
|
11136
|
+
if (/^\d+$/.test(currentSegment)) {
|
|
11137
|
+
segments.push(currentSegment);
|
|
11138
|
+
} else {
|
|
11139
|
+
segments.push(currentSegment.replace(/^"|"$/g, ""));
|
|
11140
|
+
}
|
|
11141
|
+
currentSegment = "";
|
|
11142
|
+
}
|
|
11143
|
+
inBrackets = false;
|
|
11144
|
+
continue;
|
|
11145
|
+
}
|
|
11146
|
+
if (char === '"') {
|
|
11147
|
+
inQuotes = !inQuotes;
|
|
11148
|
+
continue;
|
|
11149
|
+
}
|
|
11150
|
+
if (char === "." && !inBrackets && !inQuotes) {
|
|
11151
|
+
if (currentSegment) {
|
|
11152
|
+
segments.push(currentSegment);
|
|
11153
|
+
currentSegment = "";
|
|
11154
|
+
}
|
|
11155
|
+
continue;
|
|
11156
|
+
}
|
|
11157
|
+
currentSegment += char;
|
|
11158
|
+
}
|
|
11159
|
+
if (currentSegment) {
|
|
11160
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
11161
|
+
}
|
|
11162
|
+
return segments;
|
|
11163
|
+
}
|
|
11164
|
+
function createStandardIssues(error, parentPath) {
|
|
11165
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
11166
|
+
return error.errors.map((err) => ({
|
|
11167
|
+
message: err,
|
|
11168
|
+
path: createStandardPath(path)
|
|
11169
|
+
}));
|
|
11170
|
+
}
|
|
11171
|
+
function issuesFromValidationError(error, parentPath) {
|
|
11172
|
+
var _error$inner;
|
|
11173
|
+
if (!((_error$inner = error.inner) != null && _error$inner.length) && error.errors.length) {
|
|
11174
|
+
return createStandardIssues(error, parentPath);
|
|
11175
|
+
}
|
|
11176
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
11177
|
+
return error.inner.flatMap((err) => issuesFromValidationError(err, path));
|
|
11178
|
+
}
|
|
11590
11179
|
class Schema {
|
|
11591
11180
|
constructor(options) {
|
|
11592
11181
|
this.type = void 0;
|
|
@@ -11716,9 +11305,11 @@ class Schema {
|
|
|
11716
11305
|
* Run the configured transform pipeline over an input value.
|
|
11717
11306
|
*/
|
|
11718
11307
|
cast(value, options = {}) {
|
|
11719
|
-
let resolvedSchema = this.resolve(Object.assign({
|
|
11308
|
+
let resolvedSchema = this.resolve(Object.assign({}, options, {
|
|
11720
11309
|
value
|
|
11721
|
-
|
|
11310
|
+
// parent: options.parent,
|
|
11311
|
+
// context: options.context,
|
|
11312
|
+
}));
|
|
11722
11313
|
let allowOptionality = options.assert === "ignore-optionality";
|
|
11723
11314
|
let result = resolvedSchema._cast(value, options);
|
|
11724
11315
|
if (options.assert !== false && !resolvedSchema.isType(result)) {
|
|
@@ -11735,7 +11326,7 @@ attempted value: ${formattedValue}
|
|
|
11735
11326
|
return result;
|
|
11736
11327
|
}
|
|
11737
11328
|
_cast(rawValue, options) {
|
|
11738
|
-
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this), rawValue);
|
|
11329
|
+
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this, options), rawValue);
|
|
11739
11330
|
if (value === void 0) {
|
|
11740
11331
|
value = this.getDefault(options);
|
|
11741
11332
|
}
|
|
@@ -12130,13 +11721,41 @@ attempted value: ${formattedValue}
|
|
|
12130
11721
|
type: next.type,
|
|
12131
11722
|
oneOf: next._whitelist.describe(),
|
|
12132
11723
|
notOneOf: next._blacklist.describe(),
|
|
12133
|
-
tests: next.tests.map((fn) =>
|
|
12134
|
-
|
|
12135
|
-
|
|
12136
|
-
|
|
11724
|
+
tests: next.tests.filter((n, idx, list) => list.findIndex((c) => c.OPTIONS.name === n.OPTIONS.name) === idx).map((fn) => {
|
|
11725
|
+
const params = fn.OPTIONS.params && options ? resolveParams(Object.assign({}, fn.OPTIONS.params), options) : fn.OPTIONS.params;
|
|
11726
|
+
return {
|
|
11727
|
+
name: fn.OPTIONS.name,
|
|
11728
|
+
params
|
|
11729
|
+
};
|
|
11730
|
+
})
|
|
12137
11731
|
};
|
|
12138
11732
|
return description;
|
|
12139
11733
|
}
|
|
11734
|
+
get ["~standard"]() {
|
|
11735
|
+
const schema = this;
|
|
11736
|
+
const standard = {
|
|
11737
|
+
version: 1,
|
|
11738
|
+
vendor: "yup",
|
|
11739
|
+
async validate(value) {
|
|
11740
|
+
try {
|
|
11741
|
+
const result = await schema.validate(value, {
|
|
11742
|
+
abortEarly: false
|
|
11743
|
+
});
|
|
11744
|
+
return {
|
|
11745
|
+
value: result
|
|
11746
|
+
};
|
|
11747
|
+
} catch (err) {
|
|
11748
|
+
if (err instanceof ValidationError) {
|
|
11749
|
+
return {
|
|
11750
|
+
issues: issuesFromValidationError(err)
|
|
11751
|
+
};
|
|
11752
|
+
}
|
|
11753
|
+
throw err;
|
|
11754
|
+
}
|
|
11755
|
+
}
|
|
11756
|
+
};
|
|
11757
|
+
return standard;
|
|
11758
|
+
}
|
|
12140
11759
|
}
|
|
12141
11760
|
Schema.prototype.__isYupSchema__ = true;
|
|
12142
11761
|
for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At`] = function(path, value, options = {}) {
|
|
@@ -12235,8 +11854,8 @@ class StringSchema extends Schema {
|
|
|
12235
11854
|
}
|
|
12236
11855
|
});
|
|
12237
11856
|
this.withMutation(() => {
|
|
12238
|
-
this.transform((value, _raw
|
|
12239
|
-
if (!
|
|
11857
|
+
this.transform((value, _raw) => {
|
|
11858
|
+
if (!this.spec.coerce || this.isType(value)) return value;
|
|
12240
11859
|
if (Array.isArray(value)) return value;
|
|
12241
11860
|
const strValue = value != null && value.toString ? value.toString() : value;
|
|
12242
11861
|
if (strValue === objStringTag) return value;
|
|
@@ -12438,15 +12057,15 @@ class NumberSchema extends Schema {
|
|
|
12438
12057
|
}
|
|
12439
12058
|
});
|
|
12440
12059
|
this.withMutation(() => {
|
|
12441
|
-
this.transform((value, _raw
|
|
12442
|
-
if (!
|
|
12060
|
+
this.transform((value, _raw) => {
|
|
12061
|
+
if (!this.spec.coerce) return value;
|
|
12443
12062
|
let parsed = value;
|
|
12444
12063
|
if (typeof parsed === "string") {
|
|
12445
12064
|
parsed = parsed.replace(/\s/g, "");
|
|
12446
12065
|
if (parsed === "") return NaN;
|
|
12447
12066
|
parsed = +parsed;
|
|
12448
12067
|
}
|
|
12449
|
-
if (
|
|
12068
|
+
if (this.isType(parsed) || parsed === null) return parsed;
|
|
12450
12069
|
return parseFloat(parsed);
|
|
12451
12070
|
});
|
|
12452
12071
|
});
|
|
@@ -12545,8 +12164,8 @@ class DateSchema extends Schema {
|
|
|
12545
12164
|
}
|
|
12546
12165
|
});
|
|
12547
12166
|
this.withMutation(() => {
|
|
12548
|
-
this.transform((value, _raw
|
|
12549
|
-
if (!
|
|
12167
|
+
this.transform((value, _raw) => {
|
|
12168
|
+
if (!this.spec.coerce || this.isType(value) || value === null) return value;
|
|
12550
12169
|
value = parseIsoDate(value);
|
|
12551
12170
|
return !isNaN(value) ? new Date(value) : DateSchema.INVALID_DATE;
|
|
12552
12171
|
});
|
|
@@ -12628,7 +12247,7 @@ function sortByKeyOrder(keys2) {
|
|
|
12628
12247
|
return findIndex(keys2, a) - findIndex(keys2, b);
|
|
12629
12248
|
};
|
|
12630
12249
|
}
|
|
12631
|
-
const parseJson = (value, _,
|
|
12250
|
+
const parseJson = (value, _, schema) => {
|
|
12632
12251
|
if (typeof value !== "string") {
|
|
12633
12252
|
return value;
|
|
12634
12253
|
}
|
|
@@ -12637,7 +12256,7 @@ const parseJson = (value, _, ctx) => {
|
|
|
12637
12256
|
parsed = JSON.parse(value);
|
|
12638
12257
|
} catch (err) {
|
|
12639
12258
|
}
|
|
12640
|
-
return
|
|
12259
|
+
return schema.isType(parsed) ? parsed : value;
|
|
12641
12260
|
};
|
|
12642
12261
|
function deepPartial(schema) {
|
|
12643
12262
|
if ("fields" in schema) {
|
|
@@ -12713,9 +12332,9 @@ class ObjectSchema extends Schema {
|
|
|
12713
12332
|
for (const prop of props) {
|
|
12714
12333
|
let field = fields[prop];
|
|
12715
12334
|
let exists = prop in value;
|
|
12335
|
+
let inputValue = value[prop];
|
|
12716
12336
|
if (field) {
|
|
12717
12337
|
let fieldValue;
|
|
12718
|
-
let inputValue = value[prop];
|
|
12719
12338
|
innerOptions.path = (options.path ? `${options.path}.` : "") + prop;
|
|
12720
12339
|
field = field.resolve({
|
|
12721
12340
|
value: inputValue,
|
|
@@ -12728,17 +12347,14 @@ class ObjectSchema extends Schema {
|
|
|
12728
12347
|
isChanged = isChanged || prop in value;
|
|
12729
12348
|
continue;
|
|
12730
12349
|
}
|
|
12731
|
-
fieldValue = !options.__validating || !strict ? (
|
|
12732
|
-
// TODO: use _cast, this is double resolving
|
|
12733
|
-
field.cast(value[prop], innerOptions)
|
|
12734
|
-
) : value[prop];
|
|
12350
|
+
fieldValue = !options.__validating || !strict ? field.cast(inputValue, innerOptions) : inputValue;
|
|
12735
12351
|
if (fieldValue !== void 0) {
|
|
12736
12352
|
intermediateValue[prop] = fieldValue;
|
|
12737
12353
|
}
|
|
12738
12354
|
} else if (exists && !strip) {
|
|
12739
|
-
intermediateValue[prop] =
|
|
12355
|
+
intermediateValue[prop] = inputValue;
|
|
12740
12356
|
}
|
|
12741
|
-
if (exists !== prop in intermediateValue || intermediateValue[prop] !==
|
|
12357
|
+
if (exists !== prop in intermediateValue || intermediateValue[prop] !== inputValue) {
|
|
12742
12358
|
isChanged = true;
|
|
12743
12359
|
}
|
|
12744
12360
|
}
|
|
@@ -13072,8 +12688,8 @@ function requireDist() {
|
|
|
13072
12688
|
dist.default = urlcat2;
|
|
13073
12689
|
function urlcatImpl(pathTemplate, params, baseUrl) {
|
|
13074
12690
|
var _a = path(pathTemplate, params), renderedPath = _a.renderedPath, remainingParams = _a.remainingParams;
|
|
13075
|
-
var
|
|
13076
|
-
var renderedQuery = query(
|
|
12691
|
+
var cleanParams = removeNullOrUndef(remainingParams);
|
|
12692
|
+
var renderedQuery = query(cleanParams);
|
|
13077
12693
|
var pathAndQuery = join(renderedPath, "?", renderedQuery);
|
|
13078
12694
|
return baseUrl ? join(baseUrl, "/", pathAndQuery) : pathAndQuery;
|
|
13079
12695
|
}
|
|
@@ -13850,9 +13466,9 @@ function ViewProfileDialog({ userData, setInitialState, isOpen }) {
|
|
|
13850
13466
|
}
|
|
13851
13467
|
),
|
|
13852
13468
|
/* @__PURE__ */ jsx(Divider, {}),
|
|
13853
|
-
|
|
13469
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h5", sx: { fontSize: "16px", fontWeight: "500" }, children: "Description" })
|
|
13854
13470
|
] }),
|
|
13855
|
-
|
|
13471
|
+
/* @__PURE__ */ jsx(Stack$1, { direction: "row", alignItems: "center", flexWrap: "wrap", spacing: 0.5, useFlexGap: true, children: userData?.certOfferToHelp })
|
|
13856
13472
|
] })
|
|
13857
13473
|
] }) })
|
|
13858
13474
|
] }),
|
|
@@ -14253,7 +13869,7 @@ function parseThreshold(scrollThreshold) {
|
|
|
14253
13869
|
}
|
|
14254
13870
|
var InfiniteScroll = (
|
|
14255
13871
|
/** @class */
|
|
14256
|
-
function(_super) {
|
|
13872
|
+
(function(_super) {
|
|
14257
13873
|
__extends(InfiniteScroll2, _super);
|
|
14258
13874
|
function InfiniteScroll2(props) {
|
|
14259
13875
|
var _this = _super.call(this, props) || this;
|
|
@@ -14468,7 +14084,7 @@ var InfiniteScroll = (
|
|
|
14468
14084
|
);
|
|
14469
14085
|
};
|
|
14470
14086
|
return InfiniteScroll2;
|
|
14471
|
-
}(Component)
|
|
14087
|
+
})(Component)
|
|
14472
14088
|
);
|
|
14473
14089
|
const Notification = ({ setInitialState, notificationAccessApps, initialState, t: t2 }) => {
|
|
14474
14090
|
const [notifications, setNotifications] = useState([]);
|
|
@@ -14930,7 +14546,7 @@ const Header = ({
|
|
|
14930
14546
|
}
|
|
14931
14547
|
};
|
|
14932
14548
|
useEffect(() => {
|
|
14933
|
-
if (isMenu) {
|
|
14549
|
+
if (isMenu && selectedInterFaceLang?.id) {
|
|
14934
14550
|
getDropDownMenuData();
|
|
14935
14551
|
}
|
|
14936
14552
|
if (state.isLoading) {
|
|
@@ -14963,7 +14579,7 @@ const Header = ({
|
|
|
14963
14579
|
zIndex: "99999999 !important"
|
|
14964
14580
|
},
|
|
14965
14581
|
children: [
|
|
14966
|
-
isMenu && /* @__PURE__ */ jsx(DropdownMenu, { headerMenuArray: state.menuData, setInitialState: setState, initialState: state }),
|
|
14582
|
+
isMenu && selectedInterFaceLang?.id && /* @__PURE__ */ jsx(DropdownMenu, { headerMenuArray: state.menuData, setInitialState: setState, initialState: state }),
|
|
14967
14583
|
centerCustomComponents
|
|
14968
14584
|
]
|
|
14969
14585
|
}
|
|
@@ -15516,7 +15132,7 @@ const App = () => {
|
|
|
15516
15132
|
certProfileUrl: "https://cert.6seconds.org/certprofile/101/sanskar-digimon",
|
|
15517
15133
|
company: "Digimon Technologies",
|
|
15518
15134
|
certBio: "Hi, I am Sanskar from Digimon Technologies. We are working in the field of Emotion AI. We build products that help in understanding human emotions using AI. We aim to make the world a better place by leveraging the power of technology to enhance emotional intelligence.",
|
|
15519
|
-
certOfferToHelp: "
|
|
15135
|
+
certOfferToHelp: "",
|
|
15520
15136
|
appName: APP_NAMES.sso,
|
|
15521
15137
|
appAccess: [
|
|
15522
15138
|
{
|