react-luminus-components 1.3.13 → 1.3.15
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/components/common/ErrorBoundary/ErrorBoundary.d.ts +1 -0
- package/dist/hooks/useGetApiData/useGetApiData.d.ts +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +367 -366
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +1625 -1584
- package/dist/models/types/UseGetApiDataOptions.d.ts +3 -0
- package/package.json +3 -2
package/dist/hooks.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Q as
|
|
1
|
+
import { Q as Xe, a4 as Me, ap as Ke } from "./NoInputContainer-DPjgKLR8.js";
|
|
2
2
|
import { aH as yr, a9 as _r, aG as vr } from "./NoInputContainer-DPjgKLR8.js";
|
|
3
|
-
import { a as xr, u as
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { f as
|
|
6
|
-
import { i as
|
|
3
|
+
import { a as xr, u as kr } from "./useConfirm-Dv-I8Odc.js";
|
|
4
|
+
import { useContext as ze, useRef as Fe, useState as Pe, useCallback as et, useEffect as De } from "react";
|
|
5
|
+
import { f as tt } from "./latinize-BQrinury.js";
|
|
6
|
+
import { i as rt } from "./dateUtils-7nL2BXlo.js";
|
|
7
7
|
import "react-hook-form";
|
|
8
8
|
import { a as wr, b as Tr, u as Zr } from "./useFormControlType-BAFqxupC.js";
|
|
9
9
|
import { u as Sr } from "./usePermissions-C6VQVWtc.js";
|
|
@@ -43,14 +43,14 @@ var x;
|
|
|
43
43
|
}
|
|
44
44
|
r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
45
45
|
})(x || (x = {}));
|
|
46
|
-
var
|
|
46
|
+
var Oe;
|
|
47
47
|
(function(r) {
|
|
48
48
|
r.mergeShapes = (e, t) => ({
|
|
49
49
|
...e,
|
|
50
50
|
...t
|
|
51
51
|
// second overwrites first
|
|
52
52
|
});
|
|
53
|
-
})(
|
|
53
|
+
})(Oe || (Oe = {}));
|
|
54
54
|
const f = x.arrayToEnum([
|
|
55
55
|
"string",
|
|
56
56
|
"nan",
|
|
@@ -72,7 +72,7 @@ const f = x.arrayToEnum([
|
|
|
72
72
|
"never",
|
|
73
73
|
"map",
|
|
74
74
|
"set"
|
|
75
|
-
]),
|
|
75
|
+
]), D = (r) => {
|
|
76
76
|
switch (typeof r) {
|
|
77
77
|
case "undefined":
|
|
78
78
|
return f.undefined;
|
|
@@ -110,7 +110,7 @@ const f = x.arrayToEnum([
|
|
|
110
110
|
"invalid_intersection_types",
|
|
111
111
|
"not_multiple_of",
|
|
112
112
|
"not_finite"
|
|
113
|
-
]),
|
|
113
|
+
]), nt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
114
114
|
class N extends Error {
|
|
115
115
|
constructor(e) {
|
|
116
116
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
@@ -227,14 +227,14 @@ const X = (r, e) => {
|
|
|
227
227
|
}
|
|
228
228
|
return { message: t };
|
|
229
229
|
};
|
|
230
|
-
let
|
|
231
|
-
function
|
|
232
|
-
|
|
230
|
+
let Ve = X;
|
|
231
|
+
function st(r) {
|
|
232
|
+
Ve = r;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
return
|
|
234
|
+
function ge() {
|
|
235
|
+
return Ve;
|
|
236
236
|
}
|
|
237
|
-
const
|
|
237
|
+
const xe = (r) => {
|
|
238
238
|
const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], i = {
|
|
239
239
|
...s,
|
|
240
240
|
path: a
|
|
@@ -254,9 +254,9 @@ const ge = (r) => {
|
|
|
254
254
|
path: a,
|
|
255
255
|
message: o
|
|
256
256
|
};
|
|
257
|
-
},
|
|
257
|
+
}, at = [];
|
|
258
258
|
function l(r, e) {
|
|
259
|
-
const t =
|
|
259
|
+
const t = ge(), n = xe({
|
|
260
260
|
issueData: e,
|
|
261
261
|
data: r.data,
|
|
262
262
|
path: r.path,
|
|
@@ -270,7 +270,7 @@ function l(r, e) {
|
|
|
270
270
|
});
|
|
271
271
|
r.common.issues.push(n);
|
|
272
272
|
}
|
|
273
|
-
class
|
|
273
|
+
class Z {
|
|
274
274
|
constructor() {
|
|
275
275
|
this.value = "valid";
|
|
276
276
|
}
|
|
@@ -298,7 +298,7 @@ class C {
|
|
|
298
298
|
value: i
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
return
|
|
301
|
+
return Z.mergeObjectSync(e, n);
|
|
302
302
|
}
|
|
303
303
|
static mergeObjectSync(e, t) {
|
|
304
304
|
const n = {};
|
|
@@ -313,13 +313,13 @@ class C {
|
|
|
313
313
|
}
|
|
314
314
|
const y = Object.freeze({
|
|
315
315
|
status: "aborted"
|
|
316
|
-
}), J = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }),
|
|
317
|
-
function
|
|
316
|
+
}), J = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Ne = (r) => r.status === "aborted", Ee = (r) => r.status === "dirty", se = (r) => r.status === "valid", ae = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
317
|
+
function ke(r, e, t, n) {
|
|
318
318
|
if (typeof e == "function" ? r !== e || !n : !e.has(r))
|
|
319
319
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
320
320
|
return e.get(r);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function Le(r, e, t, n, s) {
|
|
323
323
|
if (typeof e == "function" ? r !== e || !s : !e.has(r))
|
|
324
324
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
325
325
|
return e.set(r, t), t;
|
|
@@ -328,7 +328,7 @@ var h;
|
|
|
328
328
|
(function(r) {
|
|
329
329
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
330
330
|
})(h || (h = {}));
|
|
331
|
-
var
|
|
331
|
+
var re, ne;
|
|
332
332
|
class A {
|
|
333
333
|
constructor(e, t, n, s) {
|
|
334
334
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
|
|
@@ -337,8 +337,8 @@ class A {
|
|
|
337
337
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
if (
|
|
340
|
+
const Ae = (r, e) => {
|
|
341
|
+
if (se(e))
|
|
342
342
|
return { success: !0, data: e.value };
|
|
343
343
|
if (!r.common.issues.length)
|
|
344
344
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -352,7 +352,7 @@ const je = (r, e) => {
|
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
354
|
};
|
|
355
|
-
function
|
|
355
|
+
function v(r) {
|
|
356
356
|
if (!r)
|
|
357
357
|
return {};
|
|
358
358
|
const { errorMap: e, invalid_type_error: t, required_error: n, description: s } = r;
|
|
@@ -364,7 +364,7 @@ function _(r) {
|
|
|
364
364
|
return i.code === "invalid_enum_value" ? { message: m ?? o.defaultError } : typeof o.data > "u" ? { message: (u = m ?? n) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = m ?? t) !== null && c !== void 0 ? c : o.defaultError };
|
|
365
365
|
}, description: s };
|
|
366
366
|
}
|
|
367
|
-
class
|
|
367
|
+
class g {
|
|
368
368
|
constructor(e) {
|
|
369
369
|
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
|
370
370
|
}
|
|
@@ -372,13 +372,13 @@ class v {
|
|
|
372
372
|
return this._def.description;
|
|
373
373
|
}
|
|
374
374
|
_getType(e) {
|
|
375
|
-
return
|
|
375
|
+
return D(e.data);
|
|
376
376
|
}
|
|
377
377
|
_getOrReturnCtx(e, t) {
|
|
378
378
|
return t || {
|
|
379
379
|
common: e.parent.common,
|
|
380
380
|
data: e.data,
|
|
381
|
-
parsedType:
|
|
381
|
+
parsedType: D(e.data),
|
|
382
382
|
schemaErrorMap: this._def.errorMap,
|
|
383
383
|
path: e.path,
|
|
384
384
|
parent: e.parent
|
|
@@ -386,11 +386,11 @@ class v {
|
|
|
386
386
|
}
|
|
387
387
|
_processInputParams(e) {
|
|
388
388
|
return {
|
|
389
|
-
status: new
|
|
389
|
+
status: new Z(),
|
|
390
390
|
ctx: {
|
|
391
391
|
common: e.parent.common,
|
|
392
392
|
data: e.data,
|
|
393
|
-
parsedType:
|
|
393
|
+
parsedType: D(e.data),
|
|
394
394
|
schemaErrorMap: this._def.errorMap,
|
|
395
395
|
path: e.path,
|
|
396
396
|
parent: e.parent
|
|
@@ -399,7 +399,7 @@ class v {
|
|
|
399
399
|
}
|
|
400
400
|
_parseSync(e) {
|
|
401
401
|
const t = this._parse(e);
|
|
402
|
-
if (
|
|
402
|
+
if (ae(t))
|
|
403
403
|
throw new Error("Synchronous parse encountered promise.");
|
|
404
404
|
return t;
|
|
405
405
|
}
|
|
@@ -425,9 +425,9 @@ class v {
|
|
|
425
425
|
schemaErrorMap: this._def.errorMap,
|
|
426
426
|
parent: null,
|
|
427
427
|
data: e,
|
|
428
|
-
parsedType:
|
|
428
|
+
parsedType: D(e)
|
|
429
429
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
430
|
-
return
|
|
430
|
+
return Ae(s, a);
|
|
431
431
|
}
|
|
432
432
|
async parseAsync(e, t) {
|
|
433
433
|
const n = await this.safeParseAsync(e, t);
|
|
@@ -446,9 +446,9 @@ class v {
|
|
|
446
446
|
schemaErrorMap: this._def.errorMap,
|
|
447
447
|
parent: null,
|
|
448
448
|
data: e,
|
|
449
|
-
parsedType:
|
|
450
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
451
|
-
return
|
|
449
|
+
parsedType: D(e)
|
|
450
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (ae(s) ? s : Promise.resolve(s));
|
|
451
|
+
return Ae(n, a);
|
|
452
452
|
}
|
|
453
453
|
refine(e, t) {
|
|
454
454
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
@@ -477,7 +477,7 @@ class v {
|
|
|
477
477
|
return j.create(this, this._def);
|
|
478
478
|
}
|
|
479
479
|
nullable() {
|
|
480
|
-
return
|
|
480
|
+
return U.create(this, this._def);
|
|
481
481
|
}
|
|
482
482
|
nullish() {
|
|
483
483
|
return this.nullable().optional();
|
|
@@ -489,14 +489,14 @@ class v {
|
|
|
489
489
|
return F.create(this, this._def);
|
|
490
490
|
}
|
|
491
491
|
or(e) {
|
|
492
|
-
return
|
|
492
|
+
return ce.create([this, e], this._def);
|
|
493
493
|
}
|
|
494
494
|
and(e) {
|
|
495
|
-
return
|
|
495
|
+
return ue.create(this, e, this._def);
|
|
496
496
|
}
|
|
497
497
|
transform(e) {
|
|
498
498
|
return new I({
|
|
499
|
-
...
|
|
499
|
+
...v(this._def),
|
|
500
500
|
schema: this,
|
|
501
501
|
typeName: p.ZodEffects,
|
|
502
502
|
effect: { type: "transform", transform: e }
|
|
@@ -504,24 +504,24 @@ class v {
|
|
|
504
504
|
}
|
|
505
505
|
default(e) {
|
|
506
506
|
const t = typeof e == "function" ? e : () => e;
|
|
507
|
-
return new
|
|
508
|
-
...
|
|
507
|
+
return new pe({
|
|
508
|
+
...v(this._def),
|
|
509
509
|
innerType: this,
|
|
510
510
|
defaultValue: t,
|
|
511
511
|
typeName: p.ZodDefault
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
brand() {
|
|
515
|
-
return new
|
|
515
|
+
return new Ie({
|
|
516
516
|
typeName: p.ZodBranded,
|
|
517
517
|
type: this,
|
|
518
|
-
...
|
|
518
|
+
...v(this._def)
|
|
519
519
|
});
|
|
520
520
|
}
|
|
521
521
|
catch(e) {
|
|
522
522
|
const t = typeof e == "function" ? e : () => e;
|
|
523
|
-
return new
|
|
524
|
-
...
|
|
523
|
+
return new ye({
|
|
524
|
+
...v(this._def),
|
|
525
525
|
innerType: this,
|
|
526
526
|
catchValue: t,
|
|
527
527
|
typeName: p.ZodCatch
|
|
@@ -535,10 +535,10 @@ class v {
|
|
|
535
535
|
});
|
|
536
536
|
}
|
|
537
537
|
pipe(e) {
|
|
538
|
-
return
|
|
538
|
+
return ve.create(this, e);
|
|
539
539
|
}
|
|
540
540
|
readonly() {
|
|
541
|
-
return
|
|
541
|
+
return _e.create(this);
|
|
542
542
|
}
|
|
543
543
|
isOptional() {
|
|
544
544
|
return this.safeParse(void 0).success;
|
|
@@ -547,25 +547,25 @@ class v {
|
|
|
547
547
|
return this.safeParse(null).success;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
let
|
|
552
|
-
const
|
|
553
|
-
function
|
|
550
|
+
const it = /^c[^\s-]{8,}$/i, ot = /^[0-9a-z]+$/, dt = /^[0-9A-HJKMNP-TV-Z]{26}$/, ct = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ut = /^[a-z0-9_-]{21}$/i, lt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ft = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ht = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
551
|
+
let Se;
|
|
552
|
+
const mt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, pt = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, yt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, qe = "((\\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])))", _t = new RegExp(`^${qe}$`);
|
|
553
|
+
function Ue(r) {
|
|
554
554
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
555
555
|
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
556
556
|
}
|
|
557
|
-
function
|
|
558
|
-
return new RegExp(`^${
|
|
557
|
+
function vt(r) {
|
|
558
|
+
return new RegExp(`^${Ue(r)}$`);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
let e = `${
|
|
560
|
+
function Be(r) {
|
|
561
|
+
let e = `${qe}T${Ue(r)}`;
|
|
562
562
|
const t = [];
|
|
563
563
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
return !!((e === "v4" || !e) &&
|
|
565
|
+
function gt(r, e) {
|
|
566
|
+
return !!((e === "v4" || !e) && mt.test(r) || (e === "v6" || !e) && pt.test(r));
|
|
567
567
|
}
|
|
568
|
-
class E extends
|
|
568
|
+
class E extends g {
|
|
569
569
|
_parse(e) {
|
|
570
570
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
|
571
571
|
const a = this._getOrReturnCtx(e);
|
|
@@ -575,7 +575,7 @@ class E extends v {
|
|
|
575
575
|
received: a.parsedType
|
|
576
576
|
}), y;
|
|
577
577
|
}
|
|
578
|
-
const n = new
|
|
578
|
+
const n = new Z();
|
|
579
579
|
let s;
|
|
580
580
|
for (const a of this._def.checks)
|
|
581
581
|
if (a.kind === "min")
|
|
@@ -614,43 +614,43 @@ class E extends v {
|
|
|
614
614
|
message: a.message
|
|
615
615
|
}), n.dirty());
|
|
616
616
|
} else if (a.kind === "email")
|
|
617
|
-
|
|
617
|
+
ft.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
618
618
|
validation: "email",
|
|
619
619
|
code: d.invalid_string,
|
|
620
620
|
message: a.message
|
|
621
621
|
}), n.dirty());
|
|
622
622
|
else if (a.kind === "emoji")
|
|
623
|
-
|
|
623
|
+
Se || (Se = new RegExp(ht, "u")), Se.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
624
624
|
validation: "emoji",
|
|
625
625
|
code: d.invalid_string,
|
|
626
626
|
message: a.message
|
|
627
627
|
}), n.dirty());
|
|
628
628
|
else if (a.kind === "uuid")
|
|
629
|
-
|
|
629
|
+
ct.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
630
630
|
validation: "uuid",
|
|
631
631
|
code: d.invalid_string,
|
|
632
632
|
message: a.message
|
|
633
633
|
}), n.dirty());
|
|
634
634
|
else if (a.kind === "nanoid")
|
|
635
|
-
|
|
635
|
+
ut.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
636
636
|
validation: "nanoid",
|
|
637
637
|
code: d.invalid_string,
|
|
638
638
|
message: a.message
|
|
639
639
|
}), n.dirty());
|
|
640
640
|
else if (a.kind === "cuid")
|
|
641
|
-
|
|
641
|
+
it.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
642
642
|
validation: "cuid",
|
|
643
643
|
code: d.invalid_string,
|
|
644
644
|
message: a.message
|
|
645
645
|
}), n.dirty());
|
|
646
646
|
else if (a.kind === "cuid2")
|
|
647
|
-
|
|
647
|
+
ot.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
648
648
|
validation: "cuid2",
|
|
649
649
|
code: d.invalid_string,
|
|
650
650
|
message: a.message
|
|
651
651
|
}), n.dirty());
|
|
652
652
|
else if (a.kind === "ulid")
|
|
653
|
-
|
|
653
|
+
dt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
654
654
|
validation: "ulid",
|
|
655
655
|
code: d.invalid_string,
|
|
656
656
|
message: a.message
|
|
@@ -682,27 +682,27 @@ class E extends v {
|
|
|
682
682
|
code: d.invalid_string,
|
|
683
683
|
validation: { endsWith: a.value },
|
|
684
684
|
message: a.message
|
|
685
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
685
|
+
}), n.dirty()) : a.kind === "datetime" ? Be(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
686
686
|
code: d.invalid_string,
|
|
687
687
|
validation: "datetime",
|
|
688
688
|
message: a.message
|
|
689
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
689
|
+
}), n.dirty()) : a.kind === "date" ? _t.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
690
690
|
code: d.invalid_string,
|
|
691
691
|
validation: "date",
|
|
692
692
|
message: a.message
|
|
693
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
693
|
+
}), n.dirty()) : a.kind === "time" ? vt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
694
694
|
code: d.invalid_string,
|
|
695
695
|
validation: "time",
|
|
696
696
|
message: a.message
|
|
697
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
697
|
+
}), n.dirty()) : a.kind === "duration" ? lt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
698
698
|
validation: "duration",
|
|
699
699
|
code: d.invalid_string,
|
|
700
700
|
message: a.message
|
|
701
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
701
|
+
}), n.dirty()) : a.kind === "ip" ? gt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
702
702
|
validation: "ip",
|
|
703
703
|
code: d.invalid_string,
|
|
704
704
|
message: a.message
|
|
705
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
705
|
+
}), n.dirty()) : a.kind === "base64" ? yt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
706
706
|
validation: "base64",
|
|
707
707
|
code: d.invalid_string,
|
|
708
708
|
message: a.message
|
|
@@ -921,14 +921,14 @@ E.create = (r) => {
|
|
|
921
921
|
checks: [],
|
|
922
922
|
typeName: p.ZodString,
|
|
923
923
|
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
924
|
-
...
|
|
924
|
+
...v(r)
|
|
925
925
|
});
|
|
926
926
|
};
|
|
927
|
-
function
|
|
927
|
+
function xt(r, e) {
|
|
928
928
|
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
929
929
|
return a % i / Math.pow(10, s);
|
|
930
930
|
}
|
|
931
|
-
class
|
|
931
|
+
class V extends g {
|
|
932
932
|
constructor() {
|
|
933
933
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
934
934
|
}
|
|
@@ -942,7 +942,7 @@ class D extends v {
|
|
|
942
942
|
}), y;
|
|
943
943
|
}
|
|
944
944
|
let n;
|
|
945
|
-
const s = new
|
|
945
|
+
const s = new Z();
|
|
946
946
|
for (const a of this._def.checks)
|
|
947
947
|
a.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
948
948
|
code: d.invalid_type,
|
|
@@ -963,7 +963,7 @@ class D extends v {
|
|
|
963
963
|
inclusive: a.inclusive,
|
|
964
964
|
exact: !1,
|
|
965
965
|
message: a.message
|
|
966
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
966
|
+
}), s.dirty()) : a.kind === "multipleOf" ? xt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
967
967
|
code: d.not_multiple_of,
|
|
968
968
|
multipleOf: a.value,
|
|
969
969
|
message: a.message
|
|
@@ -986,7 +986,7 @@ class D extends v {
|
|
|
986
986
|
return this.setLimit("max", e, !1, h.toString(t));
|
|
987
987
|
}
|
|
988
988
|
setLimit(e, t, n, s) {
|
|
989
|
-
return new
|
|
989
|
+
return new V({
|
|
990
990
|
...this._def,
|
|
991
991
|
checks: [
|
|
992
992
|
...this._def.checks,
|
|
@@ -1000,7 +1000,7 @@ class D extends v {
|
|
|
1000
1000
|
});
|
|
1001
1001
|
}
|
|
1002
1002
|
_addCheck(e) {
|
|
1003
|
-
return new
|
|
1003
|
+
return new V({
|
|
1004
1004
|
...this._def,
|
|
1005
1005
|
checks: [...this._def.checks, e]
|
|
1006
1006
|
});
|
|
@@ -1094,13 +1094,13 @@ class D extends v {
|
|
|
1094
1094
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
|
-
|
|
1097
|
+
V.create = (r) => new V({
|
|
1098
1098
|
checks: [],
|
|
1099
1099
|
typeName: p.ZodNumber,
|
|
1100
1100
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1101
|
-
...
|
|
1101
|
+
...v(r)
|
|
1102
1102
|
});
|
|
1103
|
-
class
|
|
1103
|
+
class L extends g {
|
|
1104
1104
|
constructor() {
|
|
1105
1105
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1106
1106
|
}
|
|
@@ -1114,7 +1114,7 @@ class V extends v {
|
|
|
1114
1114
|
}), y;
|
|
1115
1115
|
}
|
|
1116
1116
|
let n;
|
|
1117
|
-
const s = new
|
|
1117
|
+
const s = new Z();
|
|
1118
1118
|
for (const a of this._def.checks)
|
|
1119
1119
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
1120
1120
|
code: d.too_small,
|
|
@@ -1148,7 +1148,7 @@ class V extends v {
|
|
|
1148
1148
|
return this.setLimit("max", e, !1, h.toString(t));
|
|
1149
1149
|
}
|
|
1150
1150
|
setLimit(e, t, n, s) {
|
|
1151
|
-
return new
|
|
1151
|
+
return new L({
|
|
1152
1152
|
...this._def,
|
|
1153
1153
|
checks: [
|
|
1154
1154
|
...this._def.checks,
|
|
@@ -1162,7 +1162,7 @@ class V extends v {
|
|
|
1162
1162
|
});
|
|
1163
1163
|
}
|
|
1164
1164
|
_addCheck(e) {
|
|
1165
|
-
return new
|
|
1165
|
+
return new L({
|
|
1166
1166
|
...this._def,
|
|
1167
1167
|
checks: [...this._def.checks, e]
|
|
1168
1168
|
});
|
|
@@ -1219,16 +1219,16 @@ class V extends v {
|
|
|
1219
1219
|
return e;
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
|
-
|
|
1222
|
+
L.create = (r) => {
|
|
1223
1223
|
var e;
|
|
1224
|
-
return new
|
|
1224
|
+
return new L({
|
|
1225
1225
|
checks: [],
|
|
1226
1226
|
typeName: p.ZodBigInt,
|
|
1227
1227
|
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
1228
|
-
...
|
|
1228
|
+
...v(r)
|
|
1229
1229
|
});
|
|
1230
1230
|
};
|
|
1231
|
-
class
|
|
1231
|
+
class ie extends g {
|
|
1232
1232
|
_parse(e) {
|
|
1233
1233
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1234
1234
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1241,12 +1241,12 @@ class se extends v {
|
|
|
1241
1241
|
return S(e.data);
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
|
|
1244
|
+
ie.create = (r) => new ie({
|
|
1245
1245
|
typeName: p.ZodBoolean,
|
|
1246
1246
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1247
|
-
...
|
|
1247
|
+
...v(r)
|
|
1248
1248
|
});
|
|
1249
|
-
class
|
|
1249
|
+
class Y extends g {
|
|
1250
1250
|
_parse(e) {
|
|
1251
1251
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1252
1252
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1262,7 +1262,7 @@ class B extends v {
|
|
|
1262
1262
|
code: d.invalid_date
|
|
1263
1263
|
}), y;
|
|
1264
1264
|
}
|
|
1265
|
-
const n = new
|
|
1265
|
+
const n = new Z();
|
|
1266
1266
|
let s;
|
|
1267
1267
|
for (const a of this._def.checks)
|
|
1268
1268
|
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
|
|
@@ -1286,7 +1286,7 @@ class B extends v {
|
|
|
1286
1286
|
};
|
|
1287
1287
|
}
|
|
1288
1288
|
_addCheck(e) {
|
|
1289
|
-
return new
|
|
1289
|
+
return new Y({
|
|
1290
1290
|
...this._def,
|
|
1291
1291
|
checks: [...this._def.checks, e]
|
|
1292
1292
|
});
|
|
@@ -1318,13 +1318,13 @@ class B extends v {
|
|
|
1318
1318
|
return e != null ? new Date(e) : null;
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
|
-
|
|
1321
|
+
Y.create = (r) => new Y({
|
|
1322
1322
|
checks: [],
|
|
1323
1323
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1324
1324
|
typeName: p.ZodDate,
|
|
1325
|
-
...
|
|
1325
|
+
...v(r)
|
|
1326
1326
|
});
|
|
1327
|
-
class be extends
|
|
1327
|
+
class be extends g {
|
|
1328
1328
|
_parse(e) {
|
|
1329
1329
|
if (this._getType(e) !== f.symbol) {
|
|
1330
1330
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1339,9 +1339,9 @@ class be extends v {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
be.create = (r) => new be({
|
|
1341
1341
|
typeName: p.ZodSymbol,
|
|
1342
|
-
...
|
|
1342
|
+
...v(r)
|
|
1343
1343
|
});
|
|
1344
|
-
class
|
|
1344
|
+
class oe extends g {
|
|
1345
1345
|
_parse(e) {
|
|
1346
1346
|
if (this._getType(e) !== f.undefined) {
|
|
1347
1347
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1354,11 +1354,11 @@ class ae extends v {
|
|
|
1354
1354
|
return S(e.data);
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
|
-
|
|
1357
|
+
oe.create = (r) => new oe({
|
|
1358
1358
|
typeName: p.ZodUndefined,
|
|
1359
|
-
...
|
|
1359
|
+
...v(r)
|
|
1360
1360
|
});
|
|
1361
|
-
class
|
|
1361
|
+
class de extends g {
|
|
1362
1362
|
_parse(e) {
|
|
1363
1363
|
if (this._getType(e) !== f.null) {
|
|
1364
1364
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1371,11 +1371,11 @@ class ie extends v {
|
|
|
1371
1371
|
return S(e.data);
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
-
|
|
1374
|
+
de.create = (r) => new de({
|
|
1375
1375
|
typeName: p.ZodNull,
|
|
1376
|
-
...
|
|
1376
|
+
...v(r)
|
|
1377
1377
|
});
|
|
1378
|
-
class K extends
|
|
1378
|
+
class K extends g {
|
|
1379
1379
|
constructor() {
|
|
1380
1380
|
super(...arguments), this._any = !0;
|
|
1381
1381
|
}
|
|
@@ -1385,9 +1385,9 @@ class K extends v {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
K.create = (r) => new K({
|
|
1387
1387
|
typeName: p.ZodAny,
|
|
1388
|
-
...
|
|
1388
|
+
...v(r)
|
|
1389
1389
|
});
|
|
1390
|
-
class
|
|
1390
|
+
class W extends g {
|
|
1391
1391
|
constructor() {
|
|
1392
1392
|
super(...arguments), this._unknown = !0;
|
|
1393
1393
|
}
|
|
@@ -1395,11 +1395,11 @@ class U extends v {
|
|
|
1395
1395
|
return S(e.data);
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
|
-
|
|
1398
|
+
W.create = (r) => new W({
|
|
1399
1399
|
typeName: p.ZodUnknown,
|
|
1400
|
-
...
|
|
1400
|
+
...v(r)
|
|
1401
1401
|
});
|
|
1402
|
-
class z extends
|
|
1402
|
+
class z extends g {
|
|
1403
1403
|
_parse(e) {
|
|
1404
1404
|
const t = this._getOrReturnCtx(e);
|
|
1405
1405
|
return l(t, {
|
|
@@ -1411,9 +1411,9 @@ class z extends v {
|
|
|
1411
1411
|
}
|
|
1412
1412
|
z.create = (r) => new z({
|
|
1413
1413
|
typeName: p.ZodNever,
|
|
1414
|
-
...
|
|
1414
|
+
...v(r)
|
|
1415
1415
|
});
|
|
1416
|
-
class
|
|
1416
|
+
class we extends g {
|
|
1417
1417
|
_parse(e) {
|
|
1418
1418
|
if (this._getType(e) !== f.undefined) {
|
|
1419
1419
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1426,11 +1426,11 @@ class ke extends v {
|
|
|
1426
1426
|
return S(e.data);
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
|
-
|
|
1429
|
+
we.create = (r) => new we({
|
|
1430
1430
|
typeName: p.ZodVoid,
|
|
1431
|
-
...
|
|
1431
|
+
...v(r)
|
|
1432
1432
|
});
|
|
1433
|
-
class R extends
|
|
1433
|
+
class R extends g {
|
|
1434
1434
|
_parse(e) {
|
|
1435
1435
|
const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
|
|
1436
1436
|
if (t.parsedType !== f.array)
|
|
@@ -1466,9 +1466,9 @@ class R extends v {
|
|
|
1466
1466
|
exact: !1,
|
|
1467
1467
|
message: s.maxLength.message
|
|
1468
1468
|
}), n.dirty()), t.common.async)
|
|
1469
|
-
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new A(t, i, t.path, o)))).then((i) =>
|
|
1469
|
+
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new A(t, i, t.path, o)))).then((i) => Z.mergeArray(n, i));
|
|
1470
1470
|
const a = [...t.data].map((i, o) => s.type._parseSync(new A(t, i, t.path, o)));
|
|
1471
|
-
return
|
|
1471
|
+
return Z.mergeArray(n, a);
|
|
1472
1472
|
}
|
|
1473
1473
|
get element() {
|
|
1474
1474
|
return this._def.type;
|
|
@@ -1501,7 +1501,7 @@ R.create = (r, e) => new R({
|
|
|
1501
1501
|
maxLength: null,
|
|
1502
1502
|
exactLength: null,
|
|
1503
1503
|
typeName: p.ZodArray,
|
|
1504
|
-
...
|
|
1504
|
+
...v(e)
|
|
1505
1505
|
});
|
|
1506
1506
|
function H(r) {
|
|
1507
1507
|
if (r instanceof b) {
|
|
@@ -1518,9 +1518,9 @@ function H(r) {
|
|
|
1518
1518
|
return r instanceof R ? new R({
|
|
1519
1519
|
...r._def,
|
|
1520
1520
|
type: H(r.element)
|
|
1521
|
-
}) : r instanceof j ? j.create(H(r.unwrap())) : r instanceof
|
|
1521
|
+
}) : r instanceof j ? j.create(H(r.unwrap())) : r instanceof U ? U.create(H(r.unwrap())) : r instanceof $ ? $.create(r.items.map((e) => H(e))) : r;
|
|
1522
1522
|
}
|
|
1523
|
-
class b extends
|
|
1523
|
+
class b extends g {
|
|
1524
1524
|
constructor() {
|
|
1525
1525
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1526
1526
|
}
|
|
@@ -1545,10 +1545,10 @@ class b extends v {
|
|
|
1545
1545
|
i.includes(c) || o.push(c);
|
|
1546
1546
|
const u = [];
|
|
1547
1547
|
for (const c of i) {
|
|
1548
|
-
const m = a[c],
|
|
1548
|
+
const m = a[c], C = s.data[c];
|
|
1549
1549
|
u.push({
|
|
1550
1550
|
key: { status: "valid", value: c },
|
|
1551
|
-
value: m._parse(new A(s,
|
|
1551
|
+
value: m._parse(new A(s, C, s.path, c)),
|
|
1552
1552
|
alwaysSet: c in s.data
|
|
1553
1553
|
});
|
|
1554
1554
|
}
|
|
@@ -1570,11 +1570,11 @@ class b extends v {
|
|
|
1570
1570
|
} else {
|
|
1571
1571
|
const c = this._def.catchall;
|
|
1572
1572
|
for (const m of o) {
|
|
1573
|
-
const
|
|
1573
|
+
const C = s.data[m];
|
|
1574
1574
|
u.push({
|
|
1575
1575
|
key: { status: "valid", value: m },
|
|
1576
1576
|
value: c._parse(
|
|
1577
|
-
new A(s,
|
|
1577
|
+
new A(s, C, s.path, m)
|
|
1578
1578
|
//, ctx.child(key), value, getParsedType(value)
|
|
1579
1579
|
),
|
|
1580
1580
|
alwaysSet: m in s.data
|
|
@@ -1584,15 +1584,15 @@ class b extends v {
|
|
|
1584
1584
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1585
1585
|
const c = [];
|
|
1586
1586
|
for (const m of u) {
|
|
1587
|
-
const
|
|
1587
|
+
const C = await m.key, B = await m.value;
|
|
1588
1588
|
c.push({
|
|
1589
|
-
key:
|
|
1590
|
-
value:
|
|
1589
|
+
key: C,
|
|
1590
|
+
value: B,
|
|
1591
1591
|
alwaysSet: m.alwaysSet
|
|
1592
1592
|
});
|
|
1593
1593
|
}
|
|
1594
1594
|
return c;
|
|
1595
|
-
}).then((c) =>
|
|
1595
|
+
}).then((c) => Z.mergeObjectSync(n, c)) : Z.mergeObjectSync(n, u);
|
|
1596
1596
|
}
|
|
1597
1597
|
get shape() {
|
|
1598
1598
|
return this._def.shape();
|
|
@@ -1784,7 +1784,7 @@ class b extends v {
|
|
|
1784
1784
|
});
|
|
1785
1785
|
}
|
|
1786
1786
|
keyof() {
|
|
1787
|
-
return
|
|
1787
|
+
return We(x.objectKeys(this.shape));
|
|
1788
1788
|
}
|
|
1789
1789
|
}
|
|
1790
1790
|
b.create = (r, e) => new b({
|
|
@@ -1792,23 +1792,23 @@ b.create = (r, e) => new b({
|
|
|
1792
1792
|
unknownKeys: "strip",
|
|
1793
1793
|
catchall: z.create(),
|
|
1794
1794
|
typeName: p.ZodObject,
|
|
1795
|
-
...
|
|
1795
|
+
...v(e)
|
|
1796
1796
|
});
|
|
1797
1797
|
b.strictCreate = (r, e) => new b({
|
|
1798
1798
|
shape: () => r,
|
|
1799
1799
|
unknownKeys: "strict",
|
|
1800
1800
|
catchall: z.create(),
|
|
1801
1801
|
typeName: p.ZodObject,
|
|
1802
|
-
...
|
|
1802
|
+
...v(e)
|
|
1803
1803
|
});
|
|
1804
1804
|
b.lazycreate = (r, e) => new b({
|
|
1805
1805
|
shape: r,
|
|
1806
1806
|
unknownKeys: "strip",
|
|
1807
1807
|
catchall: z.create(),
|
|
1808
1808
|
typeName: p.ZodObject,
|
|
1809
|
-
...
|
|
1809
|
+
...v(e)
|
|
1810
1810
|
});
|
|
1811
|
-
class
|
|
1811
|
+
class ce extends g {
|
|
1812
1812
|
_parse(e) {
|
|
1813
1813
|
const { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1814
1814
|
function s(a) {
|
|
@@ -1876,13 +1876,13 @@ class oe extends v {
|
|
|
1876
1876
|
return this._def.options;
|
|
1877
1877
|
}
|
|
1878
1878
|
}
|
|
1879
|
-
|
|
1879
|
+
ce.create = (r, e) => new ce({
|
|
1880
1880
|
options: r,
|
|
1881
1881
|
typeName: p.ZodUnion,
|
|
1882
|
-
...
|
|
1882
|
+
...v(e)
|
|
1883
1883
|
});
|
|
1884
|
-
const M = (r) => r instanceof
|
|
1885
|
-
class
|
|
1884
|
+
const M = (r) => r instanceof fe ? M(r.schema) : r instanceof I ? M(r.innerType()) : r instanceof he ? [r.value] : r instanceof q ? r.options : r instanceof me ? x.objectValues(r.enum) : r instanceof pe ? M(r._def.innerType) : r instanceof oe ? [void 0] : r instanceof de ? [null] : r instanceof j ? [void 0, ...M(r.unwrap())] : r instanceof U ? [null, ...M(r.unwrap())] : r instanceof Ie || r instanceof _e ? M(r.unwrap()) : r instanceof ye ? M(r._def.innerType) : [];
|
|
1885
|
+
class Ce extends g {
|
|
1886
1886
|
_parse(e) {
|
|
1887
1887
|
const { ctx: t } = this._processInputParams(e);
|
|
1888
1888
|
if (t.parsedType !== f.object)
|
|
@@ -1935,23 +1935,23 @@ class Ze extends v {
|
|
|
1935
1935
|
s.set(o, a);
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
|
-
return new
|
|
1938
|
+
return new Ce({
|
|
1939
1939
|
typeName: p.ZodDiscriminatedUnion,
|
|
1940
1940
|
discriminator: e,
|
|
1941
1941
|
options: t,
|
|
1942
1942
|
optionsMap: s,
|
|
1943
|
-
...
|
|
1943
|
+
...v(n)
|
|
1944
1944
|
});
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
|
-
function
|
|
1948
|
-
const t =
|
|
1947
|
+
function Re(r, e) {
|
|
1948
|
+
const t = D(r), n = D(e);
|
|
1949
1949
|
if (r === e)
|
|
1950
1950
|
return { valid: !0, data: r };
|
|
1951
1951
|
if (t === f.object && n === f.object) {
|
|
1952
1952
|
const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
|
|
1953
1953
|
for (const o of a) {
|
|
1954
|
-
const u =
|
|
1954
|
+
const u = Re(r[o], e[o]);
|
|
1955
1955
|
if (!u.valid)
|
|
1956
1956
|
return { valid: !1 };
|
|
1957
1957
|
i[o] = u.data;
|
|
@@ -1962,7 +1962,7 @@ function Ee(r, e) {
|
|
|
1962
1962
|
return { valid: !1 };
|
|
1963
1963
|
const s = [];
|
|
1964
1964
|
for (let a = 0; a < r.length; a++) {
|
|
1965
|
-
const i = r[a], o = e[a], u =
|
|
1965
|
+
const i = r[a], o = e[a], u = Re(i, o);
|
|
1966
1966
|
if (!u.valid)
|
|
1967
1967
|
return { valid: !1 };
|
|
1968
1968
|
s.push(u.data);
|
|
@@ -1971,13 +1971,13 @@ function Ee(r, e) {
|
|
|
1971
1971
|
} else
|
|
1972
1972
|
return t === f.date && n === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
1973
1973
|
}
|
|
1974
|
-
class
|
|
1974
|
+
class ue extends g {
|
|
1975
1975
|
_parse(e) {
|
|
1976
1976
|
const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
1977
|
-
if (
|
|
1977
|
+
if (Ne(a) || Ne(i))
|
|
1978
1978
|
return y;
|
|
1979
|
-
const o =
|
|
1980
|
-
return o.valid ? ((
|
|
1979
|
+
const o = Re(a.value, i.value);
|
|
1980
|
+
return o.valid ? ((Ee(a) || Ee(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
|
|
1981
1981
|
code: d.invalid_intersection_types
|
|
1982
1982
|
}), y);
|
|
1983
1983
|
};
|
|
@@ -2003,13 +2003,13 @@ class de extends v {
|
|
|
2003
2003
|
}));
|
|
2004
2004
|
}
|
|
2005
2005
|
}
|
|
2006
|
-
|
|
2006
|
+
ue.create = (r, e, t) => new ue({
|
|
2007
2007
|
left: r,
|
|
2008
2008
|
right: e,
|
|
2009
2009
|
typeName: p.ZodIntersection,
|
|
2010
|
-
...
|
|
2010
|
+
...v(t)
|
|
2011
2011
|
});
|
|
2012
|
-
class $ extends
|
|
2012
|
+
class $ extends g {
|
|
2013
2013
|
_parse(e) {
|
|
2014
2014
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2015
2015
|
if (n.parsedType !== f.array)
|
|
@@ -2037,7 +2037,7 @@ class $ extends v {
|
|
|
2037
2037
|
const u = this._def.items[o] || this._def.rest;
|
|
2038
2038
|
return u ? u._parse(new A(n, i, n.path, o)) : null;
|
|
2039
2039
|
}).filter((i) => !!i);
|
|
2040
|
-
return n.common.async ? Promise.all(a).then((i) =>
|
|
2040
|
+
return n.common.async ? Promise.all(a).then((i) => Z.mergeArray(t, i)) : Z.mergeArray(t, a);
|
|
2041
2041
|
}
|
|
2042
2042
|
get items() {
|
|
2043
2043
|
return this._def.items;
|
|
@@ -2056,10 +2056,10 @@ $.create = (r, e) => {
|
|
|
2056
2056
|
items: r,
|
|
2057
2057
|
typeName: p.ZodTuple,
|
|
2058
2058
|
rest: null,
|
|
2059
|
-
...
|
|
2059
|
+
...v(e)
|
|
2060
2060
|
});
|
|
2061
2061
|
};
|
|
2062
|
-
class
|
|
2062
|
+
class le extends g {
|
|
2063
2063
|
get keySchema() {
|
|
2064
2064
|
return this._def.keyType;
|
|
2065
2065
|
}
|
|
@@ -2081,26 +2081,26 @@ class ce extends v {
|
|
|
2081
2081
|
value: i._parse(new A(n, n.data[o], n.path, o)),
|
|
2082
2082
|
alwaysSet: o in n.data
|
|
2083
2083
|
});
|
|
2084
|
-
return n.common.async ?
|
|
2084
|
+
return n.common.async ? Z.mergeObjectAsync(t, s) : Z.mergeObjectSync(t, s);
|
|
2085
2085
|
}
|
|
2086
2086
|
get element() {
|
|
2087
2087
|
return this._def.valueType;
|
|
2088
2088
|
}
|
|
2089
2089
|
static create(e, t, n) {
|
|
2090
|
-
return t instanceof
|
|
2090
|
+
return t instanceof g ? new le({
|
|
2091
2091
|
keyType: e,
|
|
2092
2092
|
valueType: t,
|
|
2093
2093
|
typeName: p.ZodRecord,
|
|
2094
|
-
...
|
|
2095
|
-
}) : new
|
|
2094
|
+
...v(n)
|
|
2095
|
+
}) : new le({
|
|
2096
2096
|
keyType: E.create(),
|
|
2097
2097
|
valueType: e,
|
|
2098
2098
|
typeName: p.ZodRecord,
|
|
2099
|
-
...
|
|
2099
|
+
...v(t)
|
|
2100
2100
|
});
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
|
-
class
|
|
2103
|
+
class Te extends g {
|
|
2104
2104
|
get keySchema() {
|
|
2105
2105
|
return this._def.keyType;
|
|
2106
2106
|
}
|
|
@@ -2142,13 +2142,13 @@ class we extends v {
|
|
|
2142
2142
|
}
|
|
2143
2143
|
}
|
|
2144
2144
|
}
|
|
2145
|
-
|
|
2145
|
+
Te.create = (r, e, t) => new Te({
|
|
2146
2146
|
valueType: e,
|
|
2147
2147
|
keyType: r,
|
|
2148
2148
|
typeName: p.ZodMap,
|
|
2149
|
-
...
|
|
2149
|
+
...v(t)
|
|
2150
2150
|
});
|
|
2151
|
-
class
|
|
2151
|
+
class G extends g {
|
|
2152
2152
|
_parse(e) {
|
|
2153
2153
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2154
2154
|
if (n.parsedType !== f.set)
|
|
@@ -2187,13 +2187,13 @@ class W extends v {
|
|
|
2187
2187
|
return n.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
|
|
2188
2188
|
}
|
|
2189
2189
|
min(e, t) {
|
|
2190
|
-
return new
|
|
2190
|
+
return new G({
|
|
2191
2191
|
...this._def,
|
|
2192
2192
|
minSize: { value: e, message: h.toString(t) }
|
|
2193
2193
|
});
|
|
2194
2194
|
}
|
|
2195
2195
|
max(e, t) {
|
|
2196
|
-
return new
|
|
2196
|
+
return new G({
|
|
2197
2197
|
...this._def,
|
|
2198
2198
|
maxSize: { value: e, message: h.toString(t) }
|
|
2199
2199
|
});
|
|
@@ -2205,14 +2205,14 @@ class W extends v {
|
|
|
2205
2205
|
return this.min(1, e);
|
|
2206
2206
|
}
|
|
2207
2207
|
}
|
|
2208
|
-
|
|
2208
|
+
G.create = (r, e) => new G({
|
|
2209
2209
|
valueType: r,
|
|
2210
2210
|
minSize: null,
|
|
2211
2211
|
maxSize: null,
|
|
2212
2212
|
typeName: p.ZodSet,
|
|
2213
|
-
...
|
|
2213
|
+
...v(e)
|
|
2214
2214
|
});
|
|
2215
|
-
class Q extends
|
|
2215
|
+
class Q extends g {
|
|
2216
2216
|
constructor() {
|
|
2217
2217
|
super(...arguments), this.validate = this.implement;
|
|
2218
2218
|
}
|
|
@@ -2225,13 +2225,13 @@ class Q extends v {
|
|
|
2225
2225
|
received: t.parsedType
|
|
2226
2226
|
}), y;
|
|
2227
2227
|
function n(o, u) {
|
|
2228
|
-
return
|
|
2228
|
+
return xe({
|
|
2229
2229
|
data: o,
|
|
2230
2230
|
path: t.path,
|
|
2231
2231
|
errorMaps: [
|
|
2232
2232
|
t.common.contextualErrorMap,
|
|
2233
2233
|
t.schemaErrorMap,
|
|
2234
|
-
|
|
2234
|
+
ge(),
|
|
2235
2235
|
X
|
|
2236
2236
|
].filter((c) => !!c),
|
|
2237
2237
|
issueData: {
|
|
@@ -2241,13 +2241,13 @@ class Q extends v {
|
|
|
2241
2241
|
});
|
|
2242
2242
|
}
|
|
2243
2243
|
function s(o, u) {
|
|
2244
|
-
return
|
|
2244
|
+
return xe({
|
|
2245
2245
|
data: o,
|
|
2246
2246
|
path: t.path,
|
|
2247
2247
|
errorMaps: [
|
|
2248
2248
|
t.common.contextualErrorMap,
|
|
2249
2249
|
t.schemaErrorMap,
|
|
2250
|
-
|
|
2250
|
+
ge(),
|
|
2251
2251
|
X
|
|
2252
2252
|
].filter((c) => !!c),
|
|
2253
2253
|
issueData: {
|
|
@@ -2260,11 +2260,11 @@ class Q extends v {
|
|
|
2260
2260
|
if (this._def.returns instanceof F) {
|
|
2261
2261
|
const o = this;
|
|
2262
2262
|
return S(async function(...u) {
|
|
2263
|
-
const c = new N([]), m = await o._def.args.parseAsync(u, a).catch((
|
|
2264
|
-
throw c.addIssue(n(u,
|
|
2265
|
-
}),
|
|
2266
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2267
|
-
throw c.addIssue(s(
|
|
2263
|
+
const c = new N([]), m = await o._def.args.parseAsync(u, a).catch((P) => {
|
|
2264
|
+
throw c.addIssue(n(u, P)), c;
|
|
2265
|
+
}), C = await Reflect.apply(i, this, m);
|
|
2266
|
+
return await o._def.returns._def.type.parseAsync(C, a).catch((P) => {
|
|
2267
|
+
throw c.addIssue(s(C, P)), c;
|
|
2268
2268
|
});
|
|
2269
2269
|
});
|
|
2270
2270
|
} else {
|
|
@@ -2273,10 +2273,10 @@ class Q extends v {
|
|
|
2273
2273
|
const c = o._def.args.safeParse(u, a);
|
|
2274
2274
|
if (!c.success)
|
|
2275
2275
|
throw new N([n(u, c.error)]);
|
|
2276
|
-
const m = Reflect.apply(i, this, c.data),
|
|
2277
|
-
if (!
|
|
2278
|
-
throw new N([s(m,
|
|
2279
|
-
return
|
|
2276
|
+
const m = Reflect.apply(i, this, c.data), C = o._def.returns.safeParse(m, a);
|
|
2277
|
+
if (!C.success)
|
|
2278
|
+
throw new N([s(m, C.error)]);
|
|
2279
|
+
return C.data;
|
|
2280
2280
|
});
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
@@ -2289,7 +2289,7 @@ class Q extends v {
|
|
|
2289
2289
|
args(...e) {
|
|
2290
2290
|
return new Q({
|
|
2291
2291
|
...this._def,
|
|
2292
|
-
args: $.create(e).rest(
|
|
2292
|
+
args: $.create(e).rest(W.create())
|
|
2293
2293
|
});
|
|
2294
2294
|
}
|
|
2295
2295
|
returns(e) {
|
|
@@ -2306,14 +2306,14 @@ class Q extends v {
|
|
|
2306
2306
|
}
|
|
2307
2307
|
static create(e, t, n) {
|
|
2308
2308
|
return new Q({
|
|
2309
|
-
args: e || $.create([]).rest(
|
|
2310
|
-
returns: t ||
|
|
2309
|
+
args: e || $.create([]).rest(W.create()),
|
|
2310
|
+
returns: t || W.create(),
|
|
2311
2311
|
typeName: p.ZodFunction,
|
|
2312
|
-
...
|
|
2312
|
+
...v(n)
|
|
2313
2313
|
});
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
|
-
class
|
|
2316
|
+
class fe extends g {
|
|
2317
2317
|
get schema() {
|
|
2318
2318
|
return this._def.getter();
|
|
2319
2319
|
}
|
|
@@ -2322,12 +2322,12 @@ class ue extends v {
|
|
|
2322
2322
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
|
-
|
|
2325
|
+
fe.create = (r, e) => new fe({
|
|
2326
2326
|
getter: r,
|
|
2327
2327
|
typeName: p.ZodLazy,
|
|
2328
|
-
...
|
|
2328
|
+
...v(e)
|
|
2329
2329
|
});
|
|
2330
|
-
class
|
|
2330
|
+
class he extends g {
|
|
2331
2331
|
_parse(e) {
|
|
2332
2332
|
if (e.data !== this._def.value) {
|
|
2333
2333
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2343,21 +2343,21 @@ class le extends v {
|
|
|
2343
2343
|
return this._def.value;
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
|
-
|
|
2346
|
+
he.create = (r, e) => new he({
|
|
2347
2347
|
value: r,
|
|
2348
2348
|
typeName: p.ZodLiteral,
|
|
2349
|
-
...
|
|
2349
|
+
...v(e)
|
|
2350
2350
|
});
|
|
2351
|
-
function
|
|
2352
|
-
return new
|
|
2351
|
+
function We(r, e) {
|
|
2352
|
+
return new q({
|
|
2353
2353
|
values: r,
|
|
2354
2354
|
typeName: p.ZodEnum,
|
|
2355
|
-
...
|
|
2355
|
+
...v(e)
|
|
2356
2356
|
});
|
|
2357
2357
|
}
|
|
2358
|
-
class
|
|
2358
|
+
class q extends g {
|
|
2359
2359
|
constructor() {
|
|
2360
|
-
super(...arguments),
|
|
2360
|
+
super(...arguments), re.set(this, void 0);
|
|
2361
2361
|
}
|
|
2362
2362
|
_parse(e) {
|
|
2363
2363
|
if (typeof e.data != "string") {
|
|
@@ -2368,7 +2368,7 @@ class L extends v {
|
|
|
2368
2368
|
code: d.invalid_type
|
|
2369
2369
|
}), y;
|
|
2370
2370
|
}
|
|
2371
|
-
if (
|
|
2371
|
+
if (ke(this, re) || Le(this, re, new Set(this._def.values)), !ke(this, re).has(e.data)) {
|
|
2372
2372
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2373
2373
|
return l(t, {
|
|
2374
2374
|
received: t.data,
|
|
@@ -2400,23 +2400,23 @@ class L extends v {
|
|
|
2400
2400
|
return e;
|
|
2401
2401
|
}
|
|
2402
2402
|
extract(e, t = this._def) {
|
|
2403
|
-
return
|
|
2403
|
+
return q.create(e, {
|
|
2404
2404
|
...this._def,
|
|
2405
2405
|
...t
|
|
2406
2406
|
});
|
|
2407
2407
|
}
|
|
2408
2408
|
exclude(e, t = this._def) {
|
|
2409
|
-
return
|
|
2409
|
+
return q.create(this.options.filter((n) => !e.includes(n)), {
|
|
2410
2410
|
...this._def,
|
|
2411
2411
|
...t
|
|
2412
2412
|
});
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
class
|
|
2415
|
+
re = /* @__PURE__ */ new WeakMap();
|
|
2416
|
+
q.create = We;
|
|
2417
|
+
class me extends g {
|
|
2418
2418
|
constructor() {
|
|
2419
|
-
super(...arguments),
|
|
2419
|
+
super(...arguments), ne.set(this, void 0);
|
|
2420
2420
|
}
|
|
2421
2421
|
_parse(e) {
|
|
2422
2422
|
const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2428,7 +2428,7 @@ class fe extends v {
|
|
|
2428
2428
|
code: d.invalid_type
|
|
2429
2429
|
}), y;
|
|
2430
2430
|
}
|
|
2431
|
-
if (
|
|
2431
|
+
if (ke(this, ne) || Le(this, ne, new Set(x.getValidEnumValues(this._def.values))), !ke(this, ne).has(e.data)) {
|
|
2432
2432
|
const s = x.objectValues(t);
|
|
2433
2433
|
return l(n, {
|
|
2434
2434
|
received: n.data,
|
|
@@ -2442,13 +2442,13 @@ class fe extends v {
|
|
|
2442
2442
|
return this._def.values;
|
|
2443
2443
|
}
|
|
2444
2444
|
}
|
|
2445
|
-
|
|
2446
|
-
|
|
2445
|
+
ne = /* @__PURE__ */ new WeakMap();
|
|
2446
|
+
me.create = (r, e) => new me({
|
|
2447
2447
|
values: r,
|
|
2448
2448
|
typeName: p.ZodNativeEnum,
|
|
2449
|
-
...
|
|
2449
|
+
...v(e)
|
|
2450
2450
|
});
|
|
2451
|
-
class F extends
|
|
2451
|
+
class F extends g {
|
|
2452
2452
|
unwrap() {
|
|
2453
2453
|
return this._def.type;
|
|
2454
2454
|
}
|
|
@@ -2470,9 +2470,9 @@ class F extends v {
|
|
|
2470
2470
|
F.create = (r, e) => new F({
|
|
2471
2471
|
type: r,
|
|
2472
2472
|
typeName: p.ZodPromise,
|
|
2473
|
-
...
|
|
2473
|
+
...v(e)
|
|
2474
2474
|
});
|
|
2475
|
-
class I extends
|
|
2475
|
+
class I extends g {
|
|
2476
2476
|
innerType() {
|
|
2477
2477
|
return this._def.schema;
|
|
2478
2478
|
}
|
|
@@ -2538,14 +2538,14 @@ class I extends v {
|
|
|
2538
2538
|
path: n.path,
|
|
2539
2539
|
parent: n
|
|
2540
2540
|
});
|
|
2541
|
-
if (!
|
|
2541
|
+
if (!se(i))
|
|
2542
2542
|
return i;
|
|
2543
2543
|
const o = s.transform(i.value, a);
|
|
2544
2544
|
if (o instanceof Promise)
|
|
2545
2545
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2546
2546
|
return { status: t.value, value: o };
|
|
2547
2547
|
} else
|
|
2548
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2548
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => se(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
|
|
2549
2549
|
x.assertNever(s);
|
|
2550
2550
|
}
|
|
2551
2551
|
}
|
|
@@ -2553,15 +2553,15 @@ I.create = (r, e, t) => new I({
|
|
|
2553
2553
|
schema: r,
|
|
2554
2554
|
typeName: p.ZodEffects,
|
|
2555
2555
|
effect: e,
|
|
2556
|
-
...
|
|
2556
|
+
...v(t)
|
|
2557
2557
|
});
|
|
2558
2558
|
I.createWithPreprocess = (r, e, t) => new I({
|
|
2559
2559
|
schema: e,
|
|
2560
2560
|
effect: { type: "preprocess", transform: r },
|
|
2561
2561
|
typeName: p.ZodEffects,
|
|
2562
|
-
...
|
|
2562
|
+
...v(t)
|
|
2563
2563
|
});
|
|
2564
|
-
class j extends
|
|
2564
|
+
class j extends g {
|
|
2565
2565
|
_parse(e) {
|
|
2566
2566
|
return this._getType(e) === f.undefined ? S(void 0) : this._def.innerType._parse(e);
|
|
2567
2567
|
}
|
|
@@ -2572,9 +2572,9 @@ class j extends v {
|
|
|
2572
2572
|
j.create = (r, e) => new j({
|
|
2573
2573
|
innerType: r,
|
|
2574
2574
|
typeName: p.ZodOptional,
|
|
2575
|
-
...
|
|
2575
|
+
...v(e)
|
|
2576
2576
|
});
|
|
2577
|
-
class
|
|
2577
|
+
class U extends g {
|
|
2578
2578
|
_parse(e) {
|
|
2579
2579
|
return this._getType(e) === f.null ? S(null) : this._def.innerType._parse(e);
|
|
2580
2580
|
}
|
|
@@ -2582,12 +2582,12 @@ class q extends v {
|
|
|
2582
2582
|
return this._def.innerType;
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
|
-
|
|
2585
|
+
U.create = (r, e) => new U({
|
|
2586
2586
|
innerType: r,
|
|
2587
2587
|
typeName: p.ZodNullable,
|
|
2588
|
-
...
|
|
2588
|
+
...v(e)
|
|
2589
2589
|
});
|
|
2590
|
-
class
|
|
2590
|
+
class pe extends g {
|
|
2591
2591
|
_parse(e) {
|
|
2592
2592
|
const { ctx: t } = this._processInputParams(e);
|
|
2593
2593
|
let n = t.data;
|
|
@@ -2601,13 +2601,13 @@ class he extends v {
|
|
|
2601
2601
|
return this._def.innerType;
|
|
2602
2602
|
}
|
|
2603
2603
|
}
|
|
2604
|
-
|
|
2604
|
+
pe.create = (r, e) => new pe({
|
|
2605
2605
|
innerType: r,
|
|
2606
2606
|
typeName: p.ZodDefault,
|
|
2607
2607
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2608
|
-
...
|
|
2608
|
+
...v(e)
|
|
2609
2609
|
});
|
|
2610
|
-
class
|
|
2610
|
+
class ye extends g {
|
|
2611
2611
|
_parse(e) {
|
|
2612
2612
|
const { ctx: t } = this._processInputParams(e), n = {
|
|
2613
2613
|
...t,
|
|
@@ -2622,7 +2622,7 @@ class me extends v {
|
|
|
2622
2622
|
...n
|
|
2623
2623
|
}
|
|
2624
2624
|
});
|
|
2625
|
-
return
|
|
2625
|
+
return ae(s) ? s.then((a) => ({
|
|
2626
2626
|
status: "valid",
|
|
2627
2627
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2628
2628
|
get error() {
|
|
@@ -2644,13 +2644,13 @@ class me extends v {
|
|
|
2644
2644
|
return this._def.innerType;
|
|
2645
2645
|
}
|
|
2646
2646
|
}
|
|
2647
|
-
|
|
2647
|
+
ye.create = (r, e) => new ye({
|
|
2648
2648
|
innerType: r,
|
|
2649
2649
|
typeName: p.ZodCatch,
|
|
2650
2650
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2651
|
-
...
|
|
2651
|
+
...v(e)
|
|
2652
2652
|
});
|
|
2653
|
-
class
|
|
2653
|
+
class Ze extends g {
|
|
2654
2654
|
_parse(e) {
|
|
2655
2655
|
if (this._getType(e) !== f.nan) {
|
|
2656
2656
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2663,12 +2663,12 @@ class Te extends v {
|
|
|
2663
2663
|
return { status: "valid", value: e.data };
|
|
2664
2664
|
}
|
|
2665
2665
|
}
|
|
2666
|
-
|
|
2666
|
+
Ze.create = (r) => new Ze({
|
|
2667
2667
|
typeName: p.ZodNaN,
|
|
2668
|
-
...
|
|
2668
|
+
...v(r)
|
|
2669
2669
|
});
|
|
2670
|
-
const
|
|
2671
|
-
class
|
|
2670
|
+
const kt = Symbol("zod_brand");
|
|
2671
|
+
class Ie extends g {
|
|
2672
2672
|
_parse(e) {
|
|
2673
2673
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2674
2674
|
return this._def.type._parse({
|
|
@@ -2681,7 +2681,7 @@ class Re extends v {
|
|
|
2681
2681
|
return this._def.type;
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
class
|
|
2684
|
+
class ve extends g {
|
|
2685
2685
|
_parse(e) {
|
|
2686
2686
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2687
2687
|
if (n.common.async)
|
|
@@ -2714,28 +2714,28 @@ class ye extends v {
|
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
2716
|
static create(e, t) {
|
|
2717
|
-
return new
|
|
2717
|
+
return new ve({
|
|
2718
2718
|
in: e,
|
|
2719
2719
|
out: t,
|
|
2720
2720
|
typeName: p.ZodPipeline
|
|
2721
2721
|
});
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
|
-
class
|
|
2724
|
+
class _e extends g {
|
|
2725
2725
|
_parse(e) {
|
|
2726
|
-
const t = this._def.innerType._parse(e), n = (s) => (
|
|
2727
|
-
return
|
|
2726
|
+
const t = this._def.innerType._parse(e), n = (s) => (se(s) && (s.value = Object.freeze(s.value)), s);
|
|
2727
|
+
return ae(t) ? t.then((s) => n(s)) : n(t);
|
|
2728
2728
|
}
|
|
2729
2729
|
unwrap() {
|
|
2730
2730
|
return this._def.innerType;
|
|
2731
2731
|
}
|
|
2732
2732
|
}
|
|
2733
|
-
|
|
2733
|
+
_e.create = (r, e) => new _e({
|
|
2734
2734
|
innerType: r,
|
|
2735
2735
|
typeName: p.ZodReadonly,
|
|
2736
|
-
...
|
|
2736
|
+
...v(e)
|
|
2737
2737
|
});
|
|
2738
|
-
function
|
|
2738
|
+
function Ye(r, e = {}, t) {
|
|
2739
2739
|
return r ? K.create().superRefine((n, s) => {
|
|
2740
2740
|
var a, i;
|
|
2741
2741
|
if (!r(n)) {
|
|
@@ -2751,154 +2751,154 @@ var p;
|
|
|
2751
2751
|
(function(r) {
|
|
2752
2752
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
2753
2753
|
})(p || (p = {}));
|
|
2754
|
-
const
|
|
2754
|
+
const wt = (r, e = {
|
|
2755
2755
|
message: `Input not instance of ${r.name}`
|
|
2756
|
-
}) =>
|
|
2756
|
+
}) => Ye((t) => t instanceof r, e), Ge = E.create, He = V.create, Tt = Ze.create, Zt = L.create, Je = ie.create, Ct = Y.create, St = be.create, Ot = oe.create, Nt = de.create, Et = K.create, Rt = W.create, It = z.create, jt = we.create, At = R.create, $t = b.create, Mt = b.strictCreate, zt = ce.create, Pt = Ce.create, Dt = ue.create, Vt = $.create, Lt = le.create, qt = Te.create, Ut = G.create, Bt = Q.create, Wt = fe.create, Yt = he.create, Gt = q.create, Ht = me.create, Jt = F.create, $e = I.create, Qt = j.create, Xt = U.create, Kt = I.createWithPreprocess, Ft = ve.create, er = () => Ge().optional(), tr = () => He().optional(), rr = () => Je().optional(), nr = {
|
|
2757
2757
|
string: (r) => E.create({ ...r, coerce: !0 }),
|
|
2758
|
-
number: (r) =>
|
|
2759
|
-
boolean: (r) =>
|
|
2758
|
+
number: (r) => V.create({ ...r, coerce: !0 }),
|
|
2759
|
+
boolean: (r) => ie.create({
|
|
2760
2760
|
...r,
|
|
2761
2761
|
coerce: !0
|
|
2762
2762
|
}),
|
|
2763
|
-
bigint: (r) =>
|
|
2764
|
-
date: (r) =>
|
|
2765
|
-
},
|
|
2763
|
+
bigint: (r) => L.create({ ...r, coerce: !0 }),
|
|
2764
|
+
date: (r) => Y.create({ ...r, coerce: !0 })
|
|
2765
|
+
}, sr = y;
|
|
2766
2766
|
var O = /* @__PURE__ */ Object.freeze({
|
|
2767
2767
|
__proto__: null,
|
|
2768
2768
|
defaultErrorMap: X,
|
|
2769
|
-
setErrorMap:
|
|
2770
|
-
getErrorMap:
|
|
2771
|
-
makeIssue:
|
|
2772
|
-
EMPTY_PATH:
|
|
2769
|
+
setErrorMap: st,
|
|
2770
|
+
getErrorMap: ge,
|
|
2771
|
+
makeIssue: xe,
|
|
2772
|
+
EMPTY_PATH: at,
|
|
2773
2773
|
addIssueToContext: l,
|
|
2774
|
-
ParseStatus:
|
|
2774
|
+
ParseStatus: Z,
|
|
2775
2775
|
INVALID: y,
|
|
2776
2776
|
DIRTY: J,
|
|
2777
2777
|
OK: S,
|
|
2778
|
-
isAborted:
|
|
2779
|
-
isDirty:
|
|
2780
|
-
isValid:
|
|
2781
|
-
isAsync:
|
|
2778
|
+
isAborted: Ne,
|
|
2779
|
+
isDirty: Ee,
|
|
2780
|
+
isValid: se,
|
|
2781
|
+
isAsync: ae,
|
|
2782
2782
|
get util() {
|
|
2783
2783
|
return x;
|
|
2784
2784
|
},
|
|
2785
2785
|
get objectUtil() {
|
|
2786
|
-
return
|
|
2786
|
+
return Oe;
|
|
2787
2787
|
},
|
|
2788
2788
|
ZodParsedType: f,
|
|
2789
|
-
getParsedType:
|
|
2790
|
-
ZodType:
|
|
2791
|
-
datetimeRegex:
|
|
2789
|
+
getParsedType: D,
|
|
2790
|
+
ZodType: g,
|
|
2791
|
+
datetimeRegex: Be,
|
|
2792
2792
|
ZodString: E,
|
|
2793
|
-
ZodNumber:
|
|
2794
|
-
ZodBigInt:
|
|
2795
|
-
ZodBoolean:
|
|
2796
|
-
ZodDate:
|
|
2793
|
+
ZodNumber: V,
|
|
2794
|
+
ZodBigInt: L,
|
|
2795
|
+
ZodBoolean: ie,
|
|
2796
|
+
ZodDate: Y,
|
|
2797
2797
|
ZodSymbol: be,
|
|
2798
|
-
ZodUndefined:
|
|
2799
|
-
ZodNull:
|
|
2798
|
+
ZodUndefined: oe,
|
|
2799
|
+
ZodNull: de,
|
|
2800
2800
|
ZodAny: K,
|
|
2801
|
-
ZodUnknown:
|
|
2801
|
+
ZodUnknown: W,
|
|
2802
2802
|
ZodNever: z,
|
|
2803
|
-
ZodVoid:
|
|
2803
|
+
ZodVoid: we,
|
|
2804
2804
|
ZodArray: R,
|
|
2805
2805
|
ZodObject: b,
|
|
2806
|
-
ZodUnion:
|
|
2807
|
-
ZodDiscriminatedUnion:
|
|
2808
|
-
ZodIntersection:
|
|
2806
|
+
ZodUnion: ce,
|
|
2807
|
+
ZodDiscriminatedUnion: Ce,
|
|
2808
|
+
ZodIntersection: ue,
|
|
2809
2809
|
ZodTuple: $,
|
|
2810
|
-
ZodRecord:
|
|
2811
|
-
ZodMap:
|
|
2812
|
-
ZodSet:
|
|
2810
|
+
ZodRecord: le,
|
|
2811
|
+
ZodMap: Te,
|
|
2812
|
+
ZodSet: G,
|
|
2813
2813
|
ZodFunction: Q,
|
|
2814
|
-
ZodLazy:
|
|
2815
|
-
ZodLiteral:
|
|
2816
|
-
ZodEnum:
|
|
2817
|
-
ZodNativeEnum:
|
|
2814
|
+
ZodLazy: fe,
|
|
2815
|
+
ZodLiteral: he,
|
|
2816
|
+
ZodEnum: q,
|
|
2817
|
+
ZodNativeEnum: me,
|
|
2818
2818
|
ZodPromise: F,
|
|
2819
2819
|
ZodEffects: I,
|
|
2820
2820
|
ZodTransformer: I,
|
|
2821
2821
|
ZodOptional: j,
|
|
2822
|
-
ZodNullable:
|
|
2823
|
-
ZodDefault:
|
|
2824
|
-
ZodCatch:
|
|
2825
|
-
ZodNaN:
|
|
2826
|
-
BRAND:
|
|
2827
|
-
ZodBranded:
|
|
2828
|
-
ZodPipeline:
|
|
2829
|
-
ZodReadonly:
|
|
2830
|
-
custom:
|
|
2831
|
-
Schema:
|
|
2832
|
-
ZodSchema:
|
|
2822
|
+
ZodNullable: U,
|
|
2823
|
+
ZodDefault: pe,
|
|
2824
|
+
ZodCatch: ye,
|
|
2825
|
+
ZodNaN: Ze,
|
|
2826
|
+
BRAND: kt,
|
|
2827
|
+
ZodBranded: Ie,
|
|
2828
|
+
ZodPipeline: ve,
|
|
2829
|
+
ZodReadonly: _e,
|
|
2830
|
+
custom: Ye,
|
|
2831
|
+
Schema: g,
|
|
2832
|
+
ZodSchema: g,
|
|
2833
2833
|
late: bt,
|
|
2834
2834
|
get ZodFirstPartyTypeKind() {
|
|
2835
2835
|
return p;
|
|
2836
2836
|
},
|
|
2837
|
-
coerce:
|
|
2838
|
-
any:
|
|
2839
|
-
array:
|
|
2840
|
-
bigint:
|
|
2841
|
-
boolean:
|
|
2842
|
-
date:
|
|
2843
|
-
discriminatedUnion:
|
|
2844
|
-
effect:
|
|
2845
|
-
enum:
|
|
2846
|
-
function:
|
|
2847
|
-
instanceof:
|
|
2848
|
-
intersection:
|
|
2849
|
-
lazy:
|
|
2850
|
-
literal:
|
|
2851
|
-
map:
|
|
2852
|
-
nan:
|
|
2853
|
-
nativeEnum:
|
|
2854
|
-
never:
|
|
2855
|
-
null:
|
|
2856
|
-
nullable:
|
|
2857
|
-
number:
|
|
2858
|
-
object:
|
|
2859
|
-
oboolean:
|
|
2860
|
-
onumber:
|
|
2861
|
-
optional:
|
|
2862
|
-
ostring:
|
|
2863
|
-
pipeline:
|
|
2864
|
-
preprocess:
|
|
2865
|
-
promise:
|
|
2866
|
-
record:
|
|
2867
|
-
set:
|
|
2868
|
-
strictObject:
|
|
2869
|
-
string:
|
|
2870
|
-
symbol:
|
|
2871
|
-
transformer:
|
|
2872
|
-
tuple:
|
|
2873
|
-
undefined:
|
|
2874
|
-
union:
|
|
2875
|
-
unknown:
|
|
2876
|
-
void:
|
|
2877
|
-
NEVER:
|
|
2837
|
+
coerce: nr,
|
|
2838
|
+
any: Et,
|
|
2839
|
+
array: At,
|
|
2840
|
+
bigint: Zt,
|
|
2841
|
+
boolean: Je,
|
|
2842
|
+
date: Ct,
|
|
2843
|
+
discriminatedUnion: Pt,
|
|
2844
|
+
effect: $e,
|
|
2845
|
+
enum: Gt,
|
|
2846
|
+
function: Bt,
|
|
2847
|
+
instanceof: wt,
|
|
2848
|
+
intersection: Dt,
|
|
2849
|
+
lazy: Wt,
|
|
2850
|
+
literal: Yt,
|
|
2851
|
+
map: qt,
|
|
2852
|
+
nan: Tt,
|
|
2853
|
+
nativeEnum: Ht,
|
|
2854
|
+
never: It,
|
|
2855
|
+
null: Nt,
|
|
2856
|
+
nullable: Xt,
|
|
2857
|
+
number: He,
|
|
2858
|
+
object: $t,
|
|
2859
|
+
oboolean: rr,
|
|
2860
|
+
onumber: tr,
|
|
2861
|
+
optional: Qt,
|
|
2862
|
+
ostring: er,
|
|
2863
|
+
pipeline: Ft,
|
|
2864
|
+
preprocess: Kt,
|
|
2865
|
+
promise: Jt,
|
|
2866
|
+
record: Lt,
|
|
2867
|
+
set: Ut,
|
|
2868
|
+
strictObject: Mt,
|
|
2869
|
+
string: Ge,
|
|
2870
|
+
symbol: St,
|
|
2871
|
+
transformer: $e,
|
|
2872
|
+
tuple: Vt,
|
|
2873
|
+
undefined: Ot,
|
|
2874
|
+
union: zt,
|
|
2875
|
+
unknown: Rt,
|
|
2876
|
+
void: jt,
|
|
2877
|
+
NEVER: sr,
|
|
2878
2878
|
ZodIssueCode: d,
|
|
2879
|
-
quotelessJson:
|
|
2879
|
+
quotelessJson: nt,
|
|
2880
2880
|
ZodError: N
|
|
2881
2881
|
});
|
|
2882
2882
|
const lr = () => {
|
|
2883
|
-
const { formValidationTexts: r } =
|
|
2883
|
+
const { formValidationTexts: r } = ze(Xe), e = (_) => (_ != null && _.useCoerce ? O.coerce : O).string({
|
|
2884
2884
|
invalid_type_error: r.required,
|
|
2885
2885
|
required_error: r.required
|
|
2886
|
-
}).transform((w) => w ?? null), t = (
|
|
2887
|
-
const k = (
|
|
2886
|
+
}).transform((w) => w ?? null), t = (_) => e(_).nullable().optional().transform((k) => k ?? null), n = (_) => {
|
|
2887
|
+
const k = (_ != null && _.useCoerce ? O.coerce : O).number({
|
|
2888
2888
|
invalid_type_error: r.required,
|
|
2889
2889
|
required_error: r.required
|
|
2890
2890
|
});
|
|
2891
|
-
return (
|
|
2892
|
-
}, s = (
|
|
2891
|
+
return (_ == null ? void 0 : _.min) !== void 0 && k.min(_.min), (_ == null ? void 0 : _.max) !== void 0 && k.max(_.max), k.transform((w) => w ?? null);
|
|
2892
|
+
}, s = (_) => n(_).nullable().optional().transform((k) => k ?? null), a = (_) => (_ != null && _.useCoerce ? O.coerce : O).boolean({
|
|
2893
2893
|
invalid_type_error: r.required,
|
|
2894
2894
|
required_error: r.required
|
|
2895
|
-
}).transform((k) => k ?? null), i = (
|
|
2895
|
+
}).transform((k) => k ?? null), i = (_) => (_ != null && _.useCoerce ? O.coerce : O).string({
|
|
2896
2896
|
invalid_type_error: r.required,
|
|
2897
2897
|
required_error: r.required
|
|
2898
|
-
}).refine(
|
|
2898
|
+
}).refine(rt, { message: r.invalidDate }).transform((w) => w ?? null), o = (_) => i(_).nullable().transform((k) => k ?? null), u = (_, k) => O.enum(_, {
|
|
2899
2899
|
invalid_type_error: r.required,
|
|
2900
2900
|
required_error: r.required
|
|
2901
|
-
}).transform((
|
|
2901
|
+
}).transform((je) => je ?? null);
|
|
2902
2902
|
return {
|
|
2903
2903
|
zString: t,
|
|
2904
2904
|
zStringRequired: e,
|
|
@@ -2907,41 +2907,42 @@ const lr = () => {
|
|
|
2907
2907
|
zBool: a,
|
|
2908
2908
|
zDate: o,
|
|
2909
2909
|
zDateRequired: i,
|
|
2910
|
-
zEnum: (
|
|
2910
|
+
zEnum: (_, k) => u(_).nullable().transform((w) => w ?? null),
|
|
2911
2911
|
zEnumRequired: u,
|
|
2912
|
-
zObjectIdInt: (
|
|
2913
|
-
zObjectIdIntRequired: (
|
|
2914
|
-
zObjectIdStr: (
|
|
2915
|
-
zObjectIdStrRequired: (
|
|
2916
|
-
zFile: ({ required:
|
|
2912
|
+
zObjectIdInt: (_) => O.object({ id: s({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2913
|
+
zObjectIdIntRequired: (_) => O.object({ id: n() }).transform((w) => w ?? null),
|
|
2914
|
+
zObjectIdStr: (_) => O.object({ id: t({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2915
|
+
zObjectIdStrRequired: (_) => O.object({ id: e() }).transform((w) => w ?? null),
|
|
2916
|
+
zFile: ({ required: _, multiple: k, maxFileSize: w }) => O.any().transform((T) => Array.from(T ?? [])).refine((T) => !_ || (T == null ? void 0 : T.length) > 0, "File is required.").refine((T) => k || (T == null ? void 0 : T.length) <= 1, "Multiple files not allowed.").refine((T) => T.every((Qe) => Qe.size <= w), `Maximum file size is ${tt(w)}.`).transform((T) => (k ? T : T == null ? void 0 : T[0]) ?? null)
|
|
2917
2917
|
};
|
|
2918
|
-
},
|
|
2918
|
+
}, te = {
|
|
2919
2919
|
loadOnInit: !0,
|
|
2920
2920
|
silent: !1,
|
|
2921
|
-
enabled: !0
|
|
2922
|
-
|
|
2923
|
-
|
|
2921
|
+
enabled: !0,
|
|
2922
|
+
nullStateBeforeLoad: !0
|
|
2923
|
+
}, fr = (r, { loadOnInit: e = te.loadOnInit, enabled: t = te.enabled, silent: n = te.silent, nullStateBeforeLoad: s = te.nullStateBeforeLoad, customApiUrl: a, customBearerToken: i } = te) => {
|
|
2924
|
+
const o = Me({ silent: n, customToken: i, differentBaseUrl: a }), { startLoading: u, stopLoading: c } = ze(Ke), m = Fe(0), [C, B] = Pe(null), P = et(async (ee, _) => {
|
|
2924
2925
|
if (t !== !1) {
|
|
2925
|
-
!n &&
|
|
2926
|
+
!n && u(`loadData-${r}-${_}`), s && B(null);
|
|
2926
2927
|
try {
|
|
2927
|
-
const
|
|
2928
|
-
signal:
|
|
2928
|
+
const k = await o.get(r, {
|
|
2929
|
+
signal: ee
|
|
2929
2930
|
});
|
|
2930
|
-
|
|
2931
|
+
B(k.data);
|
|
2931
2932
|
} finally {
|
|
2932
|
-
!n &&
|
|
2933
|
+
!n && c(`loadData-${r}-${_}`);
|
|
2933
2934
|
}
|
|
2934
2935
|
}
|
|
2935
|
-
}, [t, n,
|
|
2936
|
-
return
|
|
2936
|
+
}, [t, n, u, r, s, o, c]);
|
|
2937
|
+
return De(() => {
|
|
2937
2938
|
if (e === !1)
|
|
2938
2939
|
return;
|
|
2939
|
-
const
|
|
2940
|
-
return
|
|
2941
|
-
|
|
2940
|
+
const ee = new AbortController();
|
|
2941
|
+
return P(ee.signal, ++m.current), () => {
|
|
2942
|
+
ee.abort();
|
|
2942
2943
|
};
|
|
2943
|
-
}, [
|
|
2944
|
-
},
|
|
2944
|
+
}, [P, e]), { data: C, setData: B, reloadData: P };
|
|
2945
|
+
}, ar = (r) => {
|
|
2945
2946
|
let e = "pending", t;
|
|
2946
2947
|
const n = r.then((s) => {
|
|
2947
2948
|
e = "success", t = s;
|
|
@@ -2962,18 +2963,18 @@ const lr = () => {
|
|
|
2962
2963
|
};
|
|
2963
2964
|
};
|
|
2964
2965
|
function hr(r) {
|
|
2965
|
-
const e =
|
|
2966
|
-
return
|
|
2966
|
+
const e = Me({ silent: !0 }), [t, n] = Pe(null);
|
|
2967
|
+
return De(() => {
|
|
2967
2968
|
(async () => {
|
|
2968
2969
|
const a = e.get(r).then((i) => i.data);
|
|
2969
|
-
n(
|
|
2970
|
+
n(ar(a));
|
|
2970
2971
|
})();
|
|
2971
2972
|
}, [e, r]), t;
|
|
2972
2973
|
}
|
|
2973
2974
|
export {
|
|
2974
2975
|
yr as cancelToken,
|
|
2975
2976
|
_r as useAuth,
|
|
2976
|
-
|
|
2977
|
+
Me as useAxios,
|
|
2977
2978
|
wr as useClickOutside,
|
|
2978
2979
|
xr as useConfirm,
|
|
2979
2980
|
Tr as useFormControlType,
|
|
@@ -2982,6 +2983,6 @@ export {
|
|
|
2982
2983
|
Zr as useKeyPress,
|
|
2983
2984
|
vr as useNotifications,
|
|
2984
2985
|
Sr as usePermissions,
|
|
2985
|
-
|
|
2986
|
+
kr as usePrompt,
|
|
2986
2987
|
lr as useZodSchemaTypes
|
|
2987
2988
|
};
|