@noxickon/onyx 0.0.3 → 0.0.4-dev.2
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/chunks/Button-D-v4l8ZE.js +20 -0
- package/dist/chunks/{Button-BV4_pmoH.js → Button-bARrxYyo.js} +120 -121
- package/dist/chunks/Input-CLi1H63d.js +1 -0
- package/dist/chunks/{Input-BraK4lDE.js → Input-dfvmdIHi.js} +38 -38
- package/dist/chunks/errorHelper--G-SWQzN.js +18 -0
- package/dist/chunks/errorHelper-DaP_XxEx.js +1 -0
- package/dist/chunks/formatTimestamp-CMxOnPo1.js +12 -0
- package/dist/chunks/formatTimestamp-TTsNcy7u.js +1 -0
- package/dist/chunks/{index-DnVdNmco.js → useAuth-DDRXztKj.js} +240 -178
- package/dist/chunks/{index-DGjVEo0G.js → useAuth-DPnpY3XC.js} +18 -9
- package/dist/chunks/{useForm-BAbY8X4X.js → useForm-D4co95Vn.js} +785 -801
- package/dist/chunks/useForm-DUviJ7xS.js +18 -0
- package/dist/chunks/useQuery-BvCyJMae.js +2065 -0
- package/dist/chunks/useQuery-DTNHO7so.js +3 -0
- package/dist/context/context.cjs.js +1 -1
- package/dist/context/context.es.js +1 -1
- package/dist/context.d.ts +1 -0
- package/dist/hooks/hooks.cjs.js +6 -6
- package/dist/hooks/hooks.es.js +117 -118
- package/dist/index.css +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/layout/layout.cjs.js +1 -1
- package/dist/layout/layout.es.js +1 -1
- package/dist/onyx.cjs.js +1 -1
- package/dist/onyx.es.js +425 -386
- package/dist/pages/pages.cjs.js +8 -2
- package/dist/pages/pages.es.js +34 -24
- package/dist/utils/utils.cjs.js +1 -0
- package/dist/utils/utils.es.js +8 -0
- package/dist/utils.d.ts +29 -0
- package/package.json +31 -26
- package/dist/chunks/Button-CU-zvMVL.js +0 -20
- package/dist/chunks/Input-C5dK8VSu.js +0 -1
- package/dist/chunks/index-Dgwp7JKP.js +0 -601
- package/dist/chunks/index-rUH_mzKt.js +0 -2
- package/dist/chunks/useAuth-BwjRd05B.js +0 -10
- package/dist/chunks/useAuth-CR3bAGqp.js +0 -61
- package/dist/chunks/useForm-cxgyAiOs.js +0 -26
- package/dist/chunks/useQuery--6GP2-dN.js +0 -2
- package/dist/chunks/useQuery-mFRa2XuW.js +0 -1481
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useState as Ee, useMemo as Ae, useCallback as
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
1
|
+
import { useState as Ee, useMemo as Ae, useCallback as S, useRef as ln } from "react";
|
|
2
|
+
import { i as xe } from "./isObject-vmP43YLW.js";
|
|
3
|
+
import { r as N, d as pn, e as mn, v as hn, D as dn, _ as he, m as gn, A as _n, f as Oe } from "./useQuery-BvCyJMae.js";
|
|
4
|
+
function vn(e) {
|
|
5
5
|
return Number.isSafeInteger(e) && e >= 0;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return e != null && typeof e != "function" &&
|
|
7
|
+
function bn(e) {
|
|
8
|
+
return e != null && typeof e != "function" && vn(e.length);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function ce(e) {
|
|
11
11
|
return e === "__proto__";
|
|
12
12
|
}
|
|
13
13
|
function nt(e) {
|
|
@@ -20,10 +20,9 @@ function nt(e) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
function rt(e) {
|
|
23
|
-
|
|
24
|
-
return typeof e == "string" || typeof e == "symbol" ? e : Object.is((t = e == null ? void 0 : e.valueOf) == null ? void 0 : t.call(e), -0) ? "-0" : String(e);
|
|
23
|
+
return typeof e == "string" || typeof e == "symbol" ? e : Object.is(e?.valueOf?.(), -0) ? "-0" : String(e);
|
|
25
24
|
}
|
|
26
|
-
function
|
|
25
|
+
function we(e) {
|
|
27
26
|
const t = [], n = e.length;
|
|
28
27
|
if (n === 0)
|
|
29
28
|
return t;
|
|
@@ -39,10 +38,10 @@ function ot(e, t, n) {
|
|
|
39
38
|
return n;
|
|
40
39
|
switch (typeof t) {
|
|
41
40
|
case "string": {
|
|
42
|
-
if (
|
|
41
|
+
if (ce(t))
|
|
43
42
|
return n;
|
|
44
43
|
const r = e[t];
|
|
45
|
-
return r === void 0 ? nt(t) ? ot(e,
|
|
44
|
+
return r === void 0 ? nt(t) ? ot(e, we(t), n) : n : r;
|
|
46
45
|
}
|
|
47
46
|
case "number":
|
|
48
47
|
case "symbol": {
|
|
@@ -52,46 +51,46 @@ function ot(e, t, n) {
|
|
|
52
51
|
}
|
|
53
52
|
default: {
|
|
54
53
|
if (Array.isArray(t))
|
|
55
|
-
return
|
|
56
|
-
if (Object.is(t
|
|
54
|
+
return yn(e, t, n);
|
|
55
|
+
if (Object.is(t?.valueOf(), -0) ? t = "-0" : t = String(t), ce(t))
|
|
57
56
|
return n;
|
|
58
57
|
const r = e[t];
|
|
59
58
|
return r === void 0 ? n : r;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
|
-
function
|
|
62
|
+
function yn(e, t, n) {
|
|
64
63
|
if (t.length === 0)
|
|
65
64
|
return n;
|
|
66
65
|
let r = e;
|
|
67
66
|
for (let o = 0; o < t.length; o++) {
|
|
68
|
-
if (r == null ||
|
|
67
|
+
if (r == null || ce(t[o]))
|
|
69
68
|
return n;
|
|
70
69
|
r = r[t[o]];
|
|
71
70
|
}
|
|
72
71
|
return r === void 0 ? n : r;
|
|
73
72
|
}
|
|
74
|
-
function
|
|
73
|
+
function zn(e) {
|
|
75
74
|
return e == null || typeof e != "object" && typeof e != "function";
|
|
76
75
|
}
|
|
77
76
|
function it(e, t) {
|
|
78
77
|
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
79
78
|
}
|
|
80
|
-
function
|
|
79
|
+
function de(e) {
|
|
81
80
|
return Object.getOwnPropertySymbols(e).filter((t) => Object.prototype.propertyIsEnumerable.call(e, t));
|
|
82
81
|
}
|
|
83
|
-
function
|
|
82
|
+
function ue(e) {
|
|
84
83
|
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
85
84
|
}
|
|
86
|
-
const st = "[object RegExp]",
|
|
85
|
+
const st = "[object RegExp]", ct = "[object String]", ut = "[object Number]", at = "[object Boolean]", ge = "[object Arguments]", ft = "[object Symbol]", lt = "[object Date]", pt = "[object Map]", mt = "[object Set]", ht = "[object Array]", wn = "[object Function]", dt = "[object ArrayBuffer]", oe = "[object Object]", $n = "[object Error]", gt = "[object DataView]", _t = "[object Uint8Array]", vt = "[object Uint8ClampedArray]", bt = "[object Uint16Array]", yt = "[object Uint32Array]", Zn = "[object BigUint64Array]", zt = "[object Int8Array]", wt = "[object Int16Array]", $t = "[object Int32Array]", kn = "[object BigInt64Array]", Zt = "[object Float32Array]", kt = "[object Float64Array]";
|
|
87
86
|
function It(e) {
|
|
88
87
|
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
89
88
|
}
|
|
90
|
-
function
|
|
91
|
-
const i = o
|
|
89
|
+
function B(e, t, n, r = /* @__PURE__ */ new Map(), o = void 0) {
|
|
90
|
+
const i = o?.(e, t, n, r);
|
|
92
91
|
if (i != null)
|
|
93
92
|
return i;
|
|
94
|
-
if (
|
|
93
|
+
if (zn(e))
|
|
95
94
|
return e;
|
|
96
95
|
if (r.has(e))
|
|
97
96
|
return r.get(e);
|
|
@@ -99,7 +98,7 @@ function L(e, t, n, r = /* @__PURE__ */ new Map(), o = void 0) {
|
|
|
99
98
|
const s = new Array(e.length);
|
|
100
99
|
r.set(e, s);
|
|
101
100
|
for (let u = 0; u < e.length; u++)
|
|
102
|
-
s[u] =
|
|
101
|
+
s[u] = B(e[u], u, n, r, o);
|
|
103
102
|
return Object.hasOwn(e, "index") && (s.index = e.index), Object.hasOwn(e, "input") && (s.input = e.input), s;
|
|
104
103
|
}
|
|
105
104
|
if (e instanceof Date)
|
|
@@ -111,15 +110,15 @@ function L(e, t, n, r = /* @__PURE__ */ new Map(), o = void 0) {
|
|
|
111
110
|
if (e instanceof Map) {
|
|
112
111
|
const s = /* @__PURE__ */ new Map();
|
|
113
112
|
r.set(e, s);
|
|
114
|
-
for (const [u,
|
|
115
|
-
s.set(u,
|
|
113
|
+
for (const [u, f] of e)
|
|
114
|
+
s.set(u, B(f, u, n, r, o));
|
|
116
115
|
return s;
|
|
117
116
|
}
|
|
118
117
|
if (e instanceof Set) {
|
|
119
118
|
const s = /* @__PURE__ */ new Set();
|
|
120
119
|
r.set(e, s);
|
|
121
120
|
for (const u of e)
|
|
122
|
-
s.add(
|
|
121
|
+
s.add(B(u, void 0, n, r, o));
|
|
123
122
|
return s;
|
|
124
123
|
}
|
|
125
124
|
if (typeof Buffer < "u" && Buffer.isBuffer(e))
|
|
@@ -128,7 +127,7 @@ function L(e, t, n, r = /* @__PURE__ */ new Map(), o = void 0) {
|
|
|
128
127
|
const s = new (Object.getPrototypeOf(e)).constructor(e.length);
|
|
129
128
|
r.set(e, s);
|
|
130
129
|
for (let u = 0; u < e.length; u++)
|
|
131
|
-
s[u] =
|
|
130
|
+
s[u] = B(e[u], u, n, r, o);
|
|
132
131
|
return s;
|
|
133
132
|
}
|
|
134
133
|
if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer)
|
|
@@ -151,24 +150,24 @@ function L(e, t, n, r = /* @__PURE__ */ new Map(), o = void 0) {
|
|
|
151
150
|
const s = new e.constructor();
|
|
152
151
|
return r.set(e, s), s.message = e.message, s.name = e.name, s.stack = e.stack, s.cause = e.cause, V(s, e, n, r, o), s;
|
|
153
152
|
}
|
|
154
|
-
if (typeof e == "object" &&
|
|
153
|
+
if (typeof e == "object" && In(e)) {
|
|
155
154
|
const s = Object.create(Object.getPrototypeOf(e));
|
|
156
155
|
return r.set(e, s), V(s, e, n, r, o), s;
|
|
157
156
|
}
|
|
158
157
|
return e;
|
|
159
158
|
}
|
|
160
159
|
function V(e, t, n = e, r, o) {
|
|
161
|
-
const i = [...Object.keys(t), ...
|
|
160
|
+
const i = [...Object.keys(t), ...de(t)];
|
|
162
161
|
for (let s = 0; s < i.length; s++) {
|
|
163
|
-
const u = i[s],
|
|
164
|
-
(
|
|
162
|
+
const u = i[s], f = Object.getOwnPropertyDescriptor(e, u);
|
|
163
|
+
(f == null || f.writable) && (e[u] = B(t[u], u, n, r, o));
|
|
165
164
|
}
|
|
166
165
|
}
|
|
167
|
-
function
|
|
168
|
-
switch (
|
|
166
|
+
function In(e) {
|
|
167
|
+
switch (ue(e)) {
|
|
169
168
|
case ge:
|
|
170
|
-
case
|
|
171
|
-
case
|
|
169
|
+
case ht:
|
|
170
|
+
case dt:
|
|
172
171
|
case gt:
|
|
173
172
|
case at:
|
|
174
173
|
case lt:
|
|
@@ -177,12 +176,12 @@ function kn(e) {
|
|
|
177
176
|
case zt:
|
|
178
177
|
case wt:
|
|
179
178
|
case $t:
|
|
180
|
-
case
|
|
181
|
-
case
|
|
179
|
+
case pt:
|
|
180
|
+
case ut:
|
|
182
181
|
case oe:
|
|
183
182
|
case st:
|
|
184
|
-
case
|
|
185
|
-
case
|
|
183
|
+
case mt:
|
|
184
|
+
case ct:
|
|
186
185
|
case ft:
|
|
187
186
|
case _t:
|
|
188
187
|
case vt:
|
|
@@ -193,10 +192,10 @@ function kn(e) {
|
|
|
193
192
|
return !1;
|
|
194
193
|
}
|
|
195
194
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
195
|
+
function En(e) {
|
|
196
|
+
return B(e, void 0, e, /* @__PURE__ */ new Map(), void 0);
|
|
198
197
|
}
|
|
199
|
-
const
|
|
198
|
+
const An = /^(?:0|[1-9]\d*)$/;
|
|
200
199
|
function Et(e, t = Number.MAX_SAFE_INTEGER) {
|
|
201
200
|
switch (typeof e) {
|
|
202
201
|
case "number":
|
|
@@ -204,15 +203,15 @@ function Et(e, t = Number.MAX_SAFE_INTEGER) {
|
|
|
204
203
|
case "symbol":
|
|
205
204
|
return !1;
|
|
206
205
|
case "string":
|
|
207
|
-
return
|
|
206
|
+
return An.test(e);
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
209
|
function At(e) {
|
|
211
|
-
return e !== null && typeof e == "object" &&
|
|
210
|
+
return e !== null && typeof e == "object" && ue(e) === "[object Arguments]";
|
|
212
211
|
}
|
|
213
212
|
function Q(e, t) {
|
|
214
213
|
let n;
|
|
215
|
-
if (Array.isArray(t) ? n = t : typeof t == "string" && nt(t) &&
|
|
214
|
+
if (Array.isArray(t) ? n = t : typeof t == "string" && nt(t) && e?.[t] == null ? n = we(t) : n = [t], n.length === 0)
|
|
216
215
|
return !1;
|
|
217
216
|
let r = e;
|
|
218
217
|
for (let o = 0; o < n.length; o++) {
|
|
@@ -223,51 +222,51 @@ function Q(e, t) {
|
|
|
223
222
|
}
|
|
224
223
|
return !0;
|
|
225
224
|
}
|
|
226
|
-
function
|
|
225
|
+
function xn(e) {
|
|
227
226
|
return typeof e == "symbol" || e instanceof Symbol;
|
|
228
227
|
}
|
|
229
228
|
const On = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Sn = /^\w*$/;
|
|
230
|
-
function
|
|
231
|
-
return Array.isArray(e) ? !1 : typeof e == "number" || typeof e == "boolean" || e == null ||
|
|
229
|
+
function Pn(e, t) {
|
|
230
|
+
return Array.isArray(e) ? !1 : typeof e == "number" || typeof e == "boolean" || e == null || xn(e) ? !0 : typeof e == "string" && (Sn.test(e) || !On.test(e)) || t != null && Object.hasOwn(t, e);
|
|
232
231
|
}
|
|
233
|
-
const
|
|
232
|
+
const jn = (e, t, n) => {
|
|
234
233
|
const r = e[t];
|
|
235
234
|
(!(Object.hasOwn(e, t) && it(r, n)) || n === void 0 && !(t in e)) && (e[t] = n);
|
|
236
235
|
};
|
|
237
|
-
function
|
|
238
|
-
if (e == null && !
|
|
236
|
+
function Nn(e, t, n, r) {
|
|
237
|
+
if (e == null && !xe(e))
|
|
239
238
|
return e;
|
|
240
|
-
const o =
|
|
239
|
+
const o = Pn(t, e) ? [t] : Array.isArray(t) ? t : typeof t == "string" ? we(t) : [t];
|
|
241
240
|
let i = e;
|
|
242
241
|
for (let s = 0; s < o.length && i != null; s++) {
|
|
243
242
|
const u = rt(o[s]);
|
|
244
|
-
if (
|
|
243
|
+
if (ce(u))
|
|
245
244
|
continue;
|
|
246
|
-
let
|
|
245
|
+
let f;
|
|
247
246
|
if (s === o.length - 1)
|
|
248
|
-
|
|
247
|
+
f = n(i[u]);
|
|
249
248
|
else {
|
|
250
|
-
const
|
|
251
|
-
|
|
249
|
+
const a = i[u], g = r?.(a, u, e);
|
|
250
|
+
f = g !== void 0 ? g : xe(a) ? a : Et(o[s + 1]) ? [] : {};
|
|
252
251
|
}
|
|
253
|
-
|
|
252
|
+
jn(i, u, f), i = i[u];
|
|
254
253
|
}
|
|
255
254
|
return e;
|
|
256
255
|
}
|
|
257
|
-
function
|
|
258
|
-
return
|
|
256
|
+
function Dn(e, t, n) {
|
|
257
|
+
return Nn(e, t, () => n, () => {
|
|
259
258
|
});
|
|
260
259
|
}
|
|
261
|
-
function
|
|
260
|
+
function Se(e) {
|
|
262
261
|
if (!e || typeof e != "object")
|
|
263
262
|
return !1;
|
|
264
263
|
const t = Object.getPrototypeOf(e);
|
|
265
264
|
return t === null || t === Object.prototype || Object.getPrototypeOf(t) === null ? Object.prototype.toString.call(e) === "[object Object]" : !1;
|
|
266
265
|
}
|
|
267
266
|
function Rn(e, t, n) {
|
|
268
|
-
return
|
|
267
|
+
return G(e, t, void 0, void 0, void 0, void 0, n);
|
|
269
268
|
}
|
|
270
|
-
function
|
|
269
|
+
function G(e, t, n, r, o, i, s) {
|
|
271
270
|
const u = s(e, t, n, r, o, i);
|
|
272
271
|
if (u !== void 0)
|
|
273
272
|
return u;
|
|
@@ -291,15 +290,15 @@ function K(e, t, n, r, o, i, s) {
|
|
|
291
290
|
function C(e, t, n, r) {
|
|
292
291
|
if (Object.is(e, t))
|
|
293
292
|
return !0;
|
|
294
|
-
let o =
|
|
293
|
+
let o = ue(e), i = ue(t);
|
|
295
294
|
if (o === ge && (o = oe), i === ge && (i = oe), o !== i)
|
|
296
295
|
return !1;
|
|
297
296
|
switch (o) {
|
|
298
|
-
case
|
|
297
|
+
case ct:
|
|
299
298
|
return e.toString() === t.toString();
|
|
300
|
-
case
|
|
301
|
-
const
|
|
302
|
-
return it(
|
|
299
|
+
case ut: {
|
|
300
|
+
const f = e.valueOf(), a = t.valueOf();
|
|
301
|
+
return it(f, a);
|
|
303
302
|
}
|
|
304
303
|
case at:
|
|
305
304
|
case lt:
|
|
@@ -307,7 +306,7 @@ function C(e, t, n, r) {
|
|
|
307
306
|
return Object.is(e.valueOf(), t.valueOf());
|
|
308
307
|
case st:
|
|
309
308
|
return e.source === t.source && e.flags === t.flags;
|
|
310
|
-
case
|
|
309
|
+
case wn:
|
|
311
310
|
return e === t;
|
|
312
311
|
}
|
|
313
312
|
n = n ?? /* @__PURE__ */ new Map();
|
|
@@ -317,63 +316,63 @@ function C(e, t, n, r) {
|
|
|
317
316
|
n.set(e, t), n.set(t, e);
|
|
318
317
|
try {
|
|
319
318
|
switch (o) {
|
|
320
|
-
case
|
|
319
|
+
case pt: {
|
|
321
320
|
if (e.size !== t.size)
|
|
322
321
|
return !1;
|
|
323
|
-
for (const [
|
|
324
|
-
if (!t.has(
|
|
322
|
+
for (const [f, a] of e.entries())
|
|
323
|
+
if (!t.has(f) || !G(a, t.get(f), f, e, t, n, r))
|
|
325
324
|
return !1;
|
|
326
325
|
return !0;
|
|
327
326
|
}
|
|
328
|
-
case
|
|
327
|
+
case mt: {
|
|
329
328
|
if (e.size !== t.size)
|
|
330
329
|
return !1;
|
|
331
|
-
const
|
|
332
|
-
for (let g = 0; g <
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
330
|
+
const f = Array.from(e.values()), a = Array.from(t.values());
|
|
331
|
+
for (let g = 0; g < f.length; g++) {
|
|
332
|
+
const p = f[g], m = a.findIndex((h) => G(p, h, void 0, e, t, n, r));
|
|
333
|
+
if (m === -1)
|
|
335
334
|
return !1;
|
|
336
|
-
|
|
335
|
+
a.splice(m, 1);
|
|
337
336
|
}
|
|
338
337
|
return !0;
|
|
339
338
|
}
|
|
340
|
-
case
|
|
339
|
+
case ht:
|
|
341
340
|
case _t:
|
|
342
341
|
case vt:
|
|
343
342
|
case bt:
|
|
344
343
|
case yt:
|
|
345
|
-
case
|
|
344
|
+
case Zn:
|
|
346
345
|
case zt:
|
|
347
346
|
case wt:
|
|
348
347
|
case $t:
|
|
349
|
-
case
|
|
348
|
+
case kn:
|
|
350
349
|
case Zt:
|
|
351
350
|
case kt: {
|
|
352
351
|
if (typeof Buffer < "u" && Buffer.isBuffer(e) !== Buffer.isBuffer(t) || e.length !== t.length)
|
|
353
352
|
return !1;
|
|
354
|
-
for (let
|
|
355
|
-
if (!
|
|
353
|
+
for (let f = 0; f < e.length; f++)
|
|
354
|
+
if (!G(e[f], t[f], f, e, t, n, r))
|
|
356
355
|
return !1;
|
|
357
356
|
return !0;
|
|
358
357
|
}
|
|
359
|
-
case
|
|
358
|
+
case dt:
|
|
360
359
|
return e.byteLength !== t.byteLength ? !1 : C(new Uint8Array(e), new Uint8Array(t), n, r);
|
|
361
360
|
case gt:
|
|
362
361
|
return e.byteLength !== t.byteLength || e.byteOffset !== t.byteOffset ? !1 : C(new Uint8Array(e), new Uint8Array(t), n, r);
|
|
363
|
-
case
|
|
362
|
+
case $n:
|
|
364
363
|
return e.name === t.name && e.message === t.message;
|
|
365
364
|
case oe: {
|
|
366
|
-
if (!(C(e.constructor, t.constructor, n, r) ||
|
|
365
|
+
if (!(C(e.constructor, t.constructor, n, r) || Se(e) && Se(t)))
|
|
367
366
|
return !1;
|
|
368
|
-
const
|
|
369
|
-
if (
|
|
367
|
+
const a = [...Object.keys(e), ...de(e)], g = [...Object.keys(t), ...de(t)];
|
|
368
|
+
if (a.length !== g.length)
|
|
370
369
|
return !1;
|
|
371
|
-
for (let
|
|
372
|
-
const
|
|
373
|
-
if (!Object.hasOwn(t,
|
|
370
|
+
for (let p = 0; p < a.length; p++) {
|
|
371
|
+
const m = a[p], h = e[m];
|
|
372
|
+
if (!Object.hasOwn(t, m))
|
|
374
373
|
return !1;
|
|
375
|
-
const
|
|
376
|
-
if (!
|
|
374
|
+
const I = t[m];
|
|
375
|
+
if (!G(h, I, m, e, t, n, r))
|
|
377
376
|
return !1;
|
|
378
377
|
}
|
|
379
378
|
return !0;
|
|
@@ -385,19 +384,19 @@ function C(e, t, n, r) {
|
|
|
385
384
|
n.delete(e), n.delete(t);
|
|
386
385
|
}
|
|
387
386
|
}
|
|
388
|
-
function
|
|
387
|
+
function Mn() {
|
|
389
388
|
}
|
|
390
|
-
function
|
|
391
|
-
return Rn(e, t,
|
|
389
|
+
function Un(e, t) {
|
|
390
|
+
return Rn(e, t, Mn);
|
|
392
391
|
}
|
|
393
|
-
function
|
|
394
|
-
const t = e
|
|
392
|
+
function Fn(e) {
|
|
393
|
+
const t = e?.constructor, n = typeof t == "function" ? t.prototype : Object.prototype;
|
|
395
394
|
return e === n;
|
|
396
395
|
}
|
|
397
|
-
function
|
|
396
|
+
function Tn(e) {
|
|
398
397
|
return It(e);
|
|
399
398
|
}
|
|
400
|
-
function
|
|
399
|
+
function Ln(e, t) {
|
|
401
400
|
const n = {}, r = Object.keys(e);
|
|
402
401
|
for (let o = 0; o < r.length; o++) {
|
|
403
402
|
const i = r[o], s = e[i];
|
|
@@ -405,23 +404,23 @@ function Tn(e, t) {
|
|
|
405
404
|
}
|
|
406
405
|
return n;
|
|
407
406
|
}
|
|
408
|
-
function
|
|
407
|
+
function xt(e) {
|
|
409
408
|
if (e == null)
|
|
410
409
|
return !0;
|
|
411
|
-
if (
|
|
412
|
-
return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !
|
|
410
|
+
if (bn(e))
|
|
411
|
+
return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !Tn(e) && !At(e) ? !1 : e.length === 0;
|
|
413
412
|
if (typeof e == "object") {
|
|
414
413
|
if (e instanceof Map || e instanceof Set)
|
|
415
414
|
return e.size === 0;
|
|
416
415
|
const t = Object.keys(e);
|
|
417
|
-
return
|
|
416
|
+
return Fn(e) ? t.filter((n) => n !== "constructor").length === 0 : t.length === 0;
|
|
418
417
|
}
|
|
419
418
|
return !0;
|
|
420
419
|
}
|
|
421
|
-
var
|
|
422
|
-
function
|
|
423
|
-
var n =
|
|
424
|
-
hn(e,
|
|
420
|
+
var Bn = pn ? N.useLayoutEffect : N.useEffect;
|
|
421
|
+
function Wn(e, t) {
|
|
422
|
+
var n = mn(t?.client);
|
|
423
|
+
hn(e, dn.Mutation);
|
|
425
424
|
var r = N.useState({
|
|
426
425
|
called: !1,
|
|
427
426
|
loading: !1,
|
|
@@ -434,69 +433,69 @@ function Bn(e, t) {
|
|
|
434
433
|
mutation: e,
|
|
435
434
|
options: t
|
|
436
435
|
});
|
|
437
|
-
|
|
436
|
+
Bn(function() {
|
|
438
437
|
Object.assign(s.current, { client: n, options: t, mutation: e });
|
|
439
438
|
});
|
|
440
|
-
var u = N.useCallback(function(
|
|
441
|
-
|
|
442
|
-
var g = s.current,
|
|
443
|
-
!s.current.result.loading && !
|
|
439
|
+
var u = N.useCallback(function(a) {
|
|
440
|
+
a === void 0 && (a = {});
|
|
441
|
+
var g = s.current, p = g.options, m = g.mutation, h = he(he({}, p), { mutation: m }), I = a.client || s.current.client;
|
|
442
|
+
!s.current.result.loading && !h.ignoreResults && s.current.isMounted && i(s.current.result = {
|
|
444
443
|
loading: !0,
|
|
445
444
|
error: void 0,
|
|
446
445
|
data: void 0,
|
|
447
446
|
called: !0,
|
|
448
|
-
client:
|
|
447
|
+
client: I
|
|
449
448
|
});
|
|
450
|
-
var
|
|
451
|
-
return
|
|
452
|
-
var _,
|
|
453
|
-
if (
|
|
454
|
-
var
|
|
449
|
+
var d = ++s.current.mutationId, E = gn(h, a);
|
|
450
|
+
return I.mutate(E).then(function(v) {
|
|
451
|
+
var _, b, $ = v.data, P = v.errors, O = P && P.length > 0 ? new _n({ graphQLErrors: P }) : void 0, H = a.onError || ((_ = s.current.options) === null || _ === void 0 ? void 0 : _.onError);
|
|
452
|
+
if (O && H && H(O, E), d === s.current.mutationId && !E.ignoreResults) {
|
|
453
|
+
var Ie = {
|
|
455
454
|
called: !0,
|
|
456
455
|
loading: !1,
|
|
457
|
-
data:
|
|
458
|
-
error:
|
|
459
|
-
client:
|
|
456
|
+
data: $,
|
|
457
|
+
error: O,
|
|
458
|
+
client: I
|
|
460
459
|
};
|
|
461
|
-
s.current.isMounted && !
|
|
460
|
+
s.current.isMounted && !Oe(s.current.result, Ie) && i(s.current.result = Ie);
|
|
462
461
|
}
|
|
463
|
-
var
|
|
464
|
-
return
|
|
465
|
-
}, function(
|
|
462
|
+
var me = a.onCompleted || ((b = s.current.options) === null || b === void 0 ? void 0 : b.onCompleted);
|
|
463
|
+
return O || me?.(v.data, E), v;
|
|
464
|
+
}, function(v) {
|
|
466
465
|
var _;
|
|
467
|
-
if (
|
|
468
|
-
var
|
|
466
|
+
if (d === s.current.mutationId && s.current.isMounted) {
|
|
467
|
+
var b = {
|
|
469
468
|
loading: !1,
|
|
470
|
-
error:
|
|
469
|
+
error: v,
|
|
471
470
|
data: void 0,
|
|
472
471
|
called: !0,
|
|
473
|
-
client:
|
|
472
|
+
client: I
|
|
474
473
|
};
|
|
475
|
-
|
|
474
|
+
Oe(s.current.result, b) || i(s.current.result = b);
|
|
476
475
|
}
|
|
477
|
-
var
|
|
478
|
-
if (
|
|
479
|
-
return
|
|
480
|
-
throw
|
|
476
|
+
var $ = a.onError || ((_ = s.current.options) === null || _ === void 0 ? void 0 : _.onError);
|
|
477
|
+
if ($)
|
|
478
|
+
return $(v, E), { data: void 0, errors: v };
|
|
479
|
+
throw v;
|
|
481
480
|
});
|
|
482
|
-
}, []),
|
|
481
|
+
}, []), f = N.useCallback(function() {
|
|
483
482
|
if (s.current.isMounted) {
|
|
484
|
-
var
|
|
483
|
+
var a = {
|
|
485
484
|
called: !1,
|
|
486
485
|
loading: !1,
|
|
487
486
|
client: s.current.client
|
|
488
487
|
};
|
|
489
|
-
Object.assign(s.current, { mutationId: 0, result:
|
|
488
|
+
Object.assign(s.current, { mutationId: 0, result: a }), i(a);
|
|
490
489
|
}
|
|
491
490
|
}, []);
|
|
492
491
|
return N.useEffect(function() {
|
|
493
|
-
var
|
|
494
|
-
return
|
|
495
|
-
|
|
492
|
+
var a = s.current;
|
|
493
|
+
return a.isMounted = !0, function() {
|
|
494
|
+
a.isMounted = !1;
|
|
496
495
|
};
|
|
497
|
-
}, []), [u,
|
|
496
|
+
}, []), [u, he({ reset: f }, o)];
|
|
498
497
|
}
|
|
499
|
-
function
|
|
498
|
+
function Vn(e, t) {
|
|
500
499
|
const n = [], r = [];
|
|
501
500
|
for (let o = 0; o < e.length; o++) {
|
|
502
501
|
const i = e[o];
|
|
@@ -504,7 +503,7 @@ function Wn(e, t) {
|
|
|
504
503
|
}
|
|
505
504
|
return [n, r];
|
|
506
505
|
}
|
|
507
|
-
function
|
|
506
|
+
function Gn(e, t) {
|
|
508
507
|
const n = { ...e };
|
|
509
508
|
for (let r = 0; r < t.length; r++) {
|
|
510
509
|
const o = t[r];
|
|
@@ -512,56 +511,53 @@ function Vn(e, t) {
|
|
|
512
511
|
}
|
|
513
512
|
return n;
|
|
514
513
|
}
|
|
515
|
-
function
|
|
514
|
+
function Cn(e) {
|
|
516
515
|
return typeof e == "string";
|
|
517
516
|
}
|
|
518
517
|
function c(e, t, n) {
|
|
519
|
-
function r(u,
|
|
520
|
-
var
|
|
518
|
+
function r(u, f) {
|
|
519
|
+
var a;
|
|
521
520
|
Object.defineProperty(u, "_zod", {
|
|
522
521
|
value: u._zod ?? {},
|
|
523
522
|
enumerable: !1
|
|
524
|
-
}), (
|
|
523
|
+
}), (a = u._zod).traits ?? (a.traits = /* @__PURE__ */ new Set()), u._zod.traits.add(e), t(u, f);
|
|
525
524
|
for (const g in s.prototype)
|
|
526
525
|
g in u || Object.defineProperty(u, g, { value: s.prototype[g].bind(u) });
|
|
527
|
-
u._zod.constr = s, u._zod.def =
|
|
526
|
+
u._zod.constr = s, u._zod.def = f;
|
|
528
527
|
}
|
|
529
|
-
const o =
|
|
528
|
+
const o = n?.Parent ?? Object;
|
|
530
529
|
class i extends o {
|
|
531
530
|
}
|
|
532
531
|
Object.defineProperty(i, "name", { value: e });
|
|
533
532
|
function s(u) {
|
|
534
|
-
var
|
|
535
|
-
const
|
|
536
|
-
r(
|
|
537
|
-
for (const g of
|
|
533
|
+
var f;
|
|
534
|
+
const a = n?.Parent ? new i() : this;
|
|
535
|
+
r(a, u), (f = a._zod).deferred ?? (f.deferred = []);
|
|
536
|
+
for (const g of a._zod.deferred)
|
|
538
537
|
g();
|
|
539
|
-
return
|
|
538
|
+
return a;
|
|
540
539
|
}
|
|
541
540
|
return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
|
|
542
|
-
value: (u) =>
|
|
543
|
-
var a, f;
|
|
544
|
-
return n != null && n.Parent && u instanceof n.Parent ? !0 : (f = (a = u == null ? void 0 : u._zod) == null ? void 0 : a.traits) == null ? void 0 : f.has(e);
|
|
545
|
-
}
|
|
541
|
+
value: (u) => n?.Parent && u instanceof n.Parent ? !0 : u?._zod?.traits?.has(e)
|
|
546
542
|
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
547
543
|
}
|
|
548
|
-
class
|
|
544
|
+
class J extends Error {
|
|
549
545
|
constructor() {
|
|
550
546
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
551
547
|
}
|
|
552
548
|
}
|
|
553
|
-
const
|
|
549
|
+
const Ot = {};
|
|
554
550
|
function U(e) {
|
|
555
|
-
return
|
|
551
|
+
return Ot;
|
|
556
552
|
}
|
|
557
553
|
function Kn(e) {
|
|
558
554
|
const t = Object.values(e).filter((r) => typeof r == "number");
|
|
559
555
|
return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
|
|
560
556
|
}
|
|
561
|
-
function
|
|
557
|
+
function _e(e, t) {
|
|
562
558
|
return typeof t == "bigint" ? t.toString() : t;
|
|
563
559
|
}
|
|
564
|
-
function
|
|
560
|
+
function St(e) {
|
|
565
561
|
return {
|
|
566
562
|
get value() {
|
|
567
563
|
{
|
|
@@ -571,10 +567,10 @@ function xt(e) {
|
|
|
571
567
|
}
|
|
572
568
|
};
|
|
573
569
|
}
|
|
574
|
-
function
|
|
570
|
+
function q(e) {
|
|
575
571
|
return e == null;
|
|
576
572
|
}
|
|
577
|
-
function
|
|
573
|
+
function $e(e) {
|
|
578
574
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
579
575
|
return e.slice(t, n);
|
|
580
576
|
}
|
|
@@ -582,7 +578,7 @@ function Jn(e, t) {
|
|
|
582
578
|
const n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, o = n > r ? n : r, i = Number.parseInt(e.toFixed(o).replace(".", "")), s = Number.parseInt(t.toFixed(o).replace(".", ""));
|
|
583
579
|
return i % s / 10 ** o;
|
|
584
580
|
}
|
|
585
|
-
function
|
|
581
|
+
function y(e, t, n) {
|
|
586
582
|
Object.defineProperty(e, t, {
|
|
587
583
|
get() {
|
|
588
584
|
{
|
|
@@ -599,7 +595,7 @@ function $(e, t, n) {
|
|
|
599
595
|
configurable: !0
|
|
600
596
|
});
|
|
601
597
|
}
|
|
602
|
-
function
|
|
598
|
+
function T(e, t, n) {
|
|
603
599
|
Object.defineProperty(e, t, {
|
|
604
600
|
value: n,
|
|
605
601
|
writable: !0,
|
|
@@ -607,41 +603,48 @@ function $e(e, t, n) {
|
|
|
607
603
|
configurable: !0
|
|
608
604
|
});
|
|
609
605
|
}
|
|
610
|
-
function
|
|
606
|
+
function W(...e) {
|
|
607
|
+
const t = {};
|
|
608
|
+
for (const n of e) {
|
|
609
|
+
const r = Object.getOwnPropertyDescriptors(n);
|
|
610
|
+
Object.assign(t, r);
|
|
611
|
+
}
|
|
612
|
+
return Object.defineProperties({}, t);
|
|
613
|
+
}
|
|
614
|
+
function Pe(e) {
|
|
611
615
|
return JSON.stringify(e);
|
|
612
616
|
}
|
|
613
|
-
const Pt =
|
|
617
|
+
const Pt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
614
618
|
};
|
|
615
|
-
function
|
|
619
|
+
function ve(e) {
|
|
616
620
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
617
621
|
}
|
|
618
|
-
const Yn =
|
|
619
|
-
|
|
620
|
-
if (typeof navigator < "u" && ((e = navigator == null ? void 0 : navigator.userAgent) != null && e.includes("Cloudflare")))
|
|
622
|
+
const Yn = St(() => {
|
|
623
|
+
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
621
624
|
return !1;
|
|
622
625
|
try {
|
|
623
|
-
const
|
|
624
|
-
return new
|
|
626
|
+
const e = Function;
|
|
627
|
+
return new e(""), !0;
|
|
625
628
|
} catch {
|
|
626
629
|
return !1;
|
|
627
630
|
}
|
|
628
631
|
});
|
|
629
|
-
function
|
|
630
|
-
if (
|
|
632
|
+
function be(e) {
|
|
633
|
+
if (ve(e) === !1)
|
|
631
634
|
return !1;
|
|
632
635
|
const t = e.constructor;
|
|
633
636
|
if (t === void 0)
|
|
634
637
|
return !0;
|
|
635
638
|
const n = t.prototype;
|
|
636
|
-
return !(
|
|
639
|
+
return !(ve(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
637
640
|
}
|
|
638
641
|
const qn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
639
642
|
function fe(e) {
|
|
640
643
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
641
644
|
}
|
|
642
|
-
function
|
|
645
|
+
function L(e, t, n) {
|
|
643
646
|
const r = new e._zod.constr(t ?? e._zod.def);
|
|
644
|
-
return (!t || n
|
|
647
|
+
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
645
648
|
}
|
|
646
649
|
function l(e) {
|
|
647
650
|
const t = e;
|
|
@@ -649,8 +652,8 @@ function l(e) {
|
|
|
649
652
|
return {};
|
|
650
653
|
if (typeof t == "string")
|
|
651
654
|
return { error: () => t };
|
|
652
|
-
if (
|
|
653
|
-
if (
|
|
655
|
+
if (t?.message !== void 0) {
|
|
656
|
+
if (t?.error !== void 0)
|
|
654
657
|
throw new Error("Cannot specify both `message` and `error` params");
|
|
655
658
|
t.error = t.message;
|
|
656
659
|
}
|
|
@@ -667,136 +670,141 @@ const Hn = {
|
|
|
667
670
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
668
671
|
};
|
|
669
672
|
function Qn(e, t) {
|
|
670
|
-
const n =
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
673
|
+
const n = e._zod.def, r = W(e._zod.def, {
|
|
674
|
+
get shape() {
|
|
675
|
+
const o = {};
|
|
676
|
+
for (const i in t) {
|
|
677
|
+
if (!(i in n.shape))
|
|
678
|
+
throw new Error(`Unrecognized key: "${i}"`);
|
|
679
|
+
t[i] && (o[i] = n.shape[i]);
|
|
680
|
+
}
|
|
681
|
+
return T(this, "shape", o), o;
|
|
682
|
+
},
|
|
679
683
|
checks: []
|
|
680
684
|
});
|
|
685
|
+
return L(e, r);
|
|
681
686
|
}
|
|
682
687
|
function er(e, t) {
|
|
683
|
-
const n =
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
688
|
+
const n = e._zod.def, r = W(e._zod.def, {
|
|
689
|
+
get shape() {
|
|
690
|
+
const o = { ...e._zod.def.shape };
|
|
691
|
+
for (const i in t) {
|
|
692
|
+
if (!(i in n.shape))
|
|
693
|
+
throw new Error(`Unrecognized key: "${i}"`);
|
|
694
|
+
t[i] && delete o[i];
|
|
695
|
+
}
|
|
696
|
+
return T(this, "shape", o), o;
|
|
697
|
+
},
|
|
692
698
|
checks: []
|
|
693
699
|
});
|
|
700
|
+
return L(e, r);
|
|
694
701
|
}
|
|
695
702
|
function tr(e, t) {
|
|
696
|
-
if (!
|
|
703
|
+
if (!be(t))
|
|
697
704
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
698
|
-
const n = {
|
|
699
|
-
...e._zod.def,
|
|
705
|
+
const n = W(e._zod.def, {
|
|
700
706
|
get shape() {
|
|
701
707
|
const r = { ...e._zod.def.shape, ...t };
|
|
702
|
-
return
|
|
708
|
+
return T(this, "shape", r), r;
|
|
703
709
|
},
|
|
704
710
|
checks: []
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
return T(e, n);
|
|
711
|
+
});
|
|
712
|
+
return L(e, n);
|
|
708
713
|
}
|
|
709
714
|
function nr(e, t) {
|
|
710
|
-
|
|
711
|
-
...e._zod.def,
|
|
715
|
+
const n = W(e._zod.def, {
|
|
712
716
|
get shape() {
|
|
713
|
-
const
|
|
714
|
-
return
|
|
717
|
+
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
718
|
+
return T(this, "shape", r), r;
|
|
719
|
+
},
|
|
720
|
+
get catchall() {
|
|
721
|
+
return t._zod.def.catchall;
|
|
715
722
|
},
|
|
716
|
-
catchall: t._zod.def.catchall,
|
|
717
723
|
checks: []
|
|
718
724
|
// delete existing checks
|
|
719
725
|
});
|
|
726
|
+
return L(e, n);
|
|
720
727
|
}
|
|
721
728
|
function rr(e, t, n) {
|
|
722
|
-
const r = t._zod.def
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
if (
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
729
|
+
const r = W(t._zod.def, {
|
|
730
|
+
get shape() {
|
|
731
|
+
const o = t._zod.def.shape, i = { ...o };
|
|
732
|
+
if (n)
|
|
733
|
+
for (const s in n) {
|
|
734
|
+
if (!(s in o))
|
|
735
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
736
|
+
n[s] && (i[s] = e ? new e({
|
|
737
|
+
type: "optional",
|
|
738
|
+
innerType: o[s]
|
|
739
|
+
}) : o[s]);
|
|
740
|
+
}
|
|
741
|
+
else
|
|
742
|
+
for (const s in o)
|
|
743
|
+
i[s] = e ? new e({
|
|
744
|
+
type: "optional",
|
|
745
|
+
innerType: o[s]
|
|
746
|
+
}) : o[s];
|
|
747
|
+
return T(this, "shape", i), i;
|
|
748
|
+
},
|
|
741
749
|
checks: []
|
|
742
750
|
});
|
|
751
|
+
return L(t, r);
|
|
743
752
|
}
|
|
744
753
|
function or(e, t, n) {
|
|
745
|
-
const r = t._zod.def
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
if (
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
754
|
+
const r = W(t._zod.def, {
|
|
755
|
+
get shape() {
|
|
756
|
+
const o = t._zod.def.shape, i = { ...o };
|
|
757
|
+
if (n)
|
|
758
|
+
for (const s in n) {
|
|
759
|
+
if (!(s in i))
|
|
760
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
761
|
+
n[s] && (i[s] = new e({
|
|
762
|
+
type: "nonoptional",
|
|
763
|
+
innerType: o[s]
|
|
764
|
+
}));
|
|
765
|
+
}
|
|
766
|
+
else
|
|
767
|
+
for (const s in o)
|
|
768
|
+
i[s] = new e({
|
|
769
|
+
type: "nonoptional",
|
|
770
|
+
innerType: o[s]
|
|
771
|
+
});
|
|
772
|
+
return T(this, "shape", i), i;
|
|
773
|
+
},
|
|
765
774
|
checks: []
|
|
766
775
|
});
|
|
776
|
+
return L(t, r);
|
|
767
777
|
}
|
|
768
|
-
function
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
if (((n = e.issues[r]) == null ? void 0 : n.continue) !== !0)
|
|
778
|
+
function K(e, t = 0) {
|
|
779
|
+
for (let n = t; n < e.issues.length; n++)
|
|
780
|
+
if (e.issues[n]?.continue !== !0)
|
|
772
781
|
return !0;
|
|
773
782
|
return !1;
|
|
774
783
|
}
|
|
775
|
-
function
|
|
784
|
+
function jt(e, t) {
|
|
776
785
|
return t.map((n) => {
|
|
777
786
|
var r;
|
|
778
787
|
return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
|
|
779
788
|
});
|
|
780
789
|
}
|
|
781
790
|
function ee(e) {
|
|
782
|
-
return typeof e == "string" ? e : e
|
|
791
|
+
return typeof e == "string" ? e : e?.message;
|
|
783
792
|
}
|
|
784
793
|
function F(e, t, n) {
|
|
785
|
-
var o, i, s, u, a, f;
|
|
786
794
|
const r = { ...e, path: e.path ?? [] };
|
|
787
795
|
if (!e.message) {
|
|
788
|
-
const
|
|
789
|
-
r.message =
|
|
796
|
+
const o = ee(e.inst?._zod.def?.error?.(e)) ?? ee(t?.error?.(e)) ?? ee(n.customError?.(e)) ?? ee(n.localeError?.(e)) ?? "Invalid input";
|
|
797
|
+
r.message = o;
|
|
790
798
|
}
|
|
791
|
-
return delete r.inst, delete r.continue, t
|
|
799
|
+
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
792
800
|
}
|
|
793
|
-
function
|
|
801
|
+
function Nt(e) {
|
|
794
802
|
return e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof File ? "file" : "unknown";
|
|
795
803
|
}
|
|
796
|
-
function
|
|
804
|
+
function Ze(e) {
|
|
797
805
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
798
806
|
}
|
|
799
|
-
function
|
|
807
|
+
function Y(...e) {
|
|
800
808
|
const [t, n, r] = e;
|
|
801
809
|
return typeof t == "string" ? {
|
|
802
810
|
message: t,
|
|
@@ -805,24 +813,18 @@ function q(...e) {
|
|
|
805
813
|
inst: r
|
|
806
814
|
} : { ...t };
|
|
807
815
|
}
|
|
808
|
-
const
|
|
816
|
+
const Dt = (e, t) => {
|
|
809
817
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
810
818
|
value: e._zod,
|
|
811
819
|
enumerable: !1
|
|
812
820
|
}), Object.defineProperty(e, "issues", {
|
|
813
821
|
value: t,
|
|
814
822
|
enumerable: !1
|
|
815
|
-
}), Object.defineProperty(e, "
|
|
816
|
-
get() {
|
|
817
|
-
return JSON.stringify(t, Cn, 2);
|
|
818
|
-
},
|
|
819
|
-
enumerable: !0
|
|
820
|
-
// configurable: false,
|
|
821
|
-
}), Object.defineProperty(e, "toString", {
|
|
823
|
+
}), e.message = JSON.stringify(t, _e, 2), Object.defineProperty(e, "toString", {
|
|
822
824
|
value: () => e.message,
|
|
823
825
|
enumerable: !1
|
|
824
826
|
});
|
|
825
|
-
}, Rt = c("$ZodError",
|
|
827
|
+
}, Rt = c("$ZodError", Dt), Mt = c("$ZodError", Dt, { Parent: Error });
|
|
826
828
|
function ir(e, t = (n) => n.message) {
|
|
827
829
|
const n = {}, r = [];
|
|
828
830
|
for (const o of e.issues)
|
|
@@ -843,78 +845,78 @@ function sr(e, t) {
|
|
|
843
845
|
else if (s.path.length === 0)
|
|
844
846
|
r._errors.push(n(s));
|
|
845
847
|
else {
|
|
846
|
-
let u = r,
|
|
847
|
-
for (;
|
|
848
|
-
const
|
|
849
|
-
|
|
848
|
+
let u = r, f = 0;
|
|
849
|
+
for (; f < s.path.length; ) {
|
|
850
|
+
const a = s.path[f];
|
|
851
|
+
f === s.path.length - 1 ? (u[a] = u[a] || { _errors: [] }, u[a]._errors.push(n(s))) : u[a] = u[a] || { _errors: [] }, u = u[a], f++;
|
|
850
852
|
}
|
|
851
853
|
}
|
|
852
854
|
};
|
|
853
855
|
return o(e), r;
|
|
854
856
|
}
|
|
855
|
-
const
|
|
857
|
+
const cr = (e) => (t, n, r, o) => {
|
|
856
858
|
const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, i);
|
|
857
859
|
if (s instanceof Promise)
|
|
858
|
-
throw new
|
|
860
|
+
throw new J();
|
|
859
861
|
if (s.issues.length) {
|
|
860
|
-
const u = new (
|
|
861
|
-
throw Pt(u, o
|
|
862
|
+
const u = new (o?.Err ?? e)(s.issues.map((f) => F(f, i, U())));
|
|
863
|
+
throw Pt(u, o?.callee), u;
|
|
862
864
|
}
|
|
863
865
|
return s.value;
|
|
864
|
-
},
|
|
866
|
+
}, ur = (e) => async (t, n, r, o) => {
|
|
865
867
|
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
866
868
|
let s = t._zod.run({ value: n, issues: [] }, i);
|
|
867
869
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
868
|
-
const u = new (
|
|
869
|
-
throw Pt(u, o
|
|
870
|
+
const u = new (o?.Err ?? e)(s.issues.map((f) => F(f, i, U())));
|
|
871
|
+
throw Pt(u, o?.callee), u;
|
|
870
872
|
}
|
|
871
873
|
return s.value;
|
|
872
|
-
},
|
|
874
|
+
}, Ut = (e) => (t, n, r) => {
|
|
873
875
|
const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
|
|
874
876
|
if (i instanceof Promise)
|
|
875
|
-
throw new
|
|
877
|
+
throw new J();
|
|
876
878
|
return i.issues.length ? {
|
|
877
879
|
success: !1,
|
|
878
880
|
error: new (e ?? Rt)(i.issues.map((s) => F(s, o, U())))
|
|
879
881
|
} : { success: !0, data: i.value };
|
|
880
|
-
}, ar = /* @__PURE__ */ Mt
|
|
882
|
+
}, ar = /* @__PURE__ */ Ut(Mt), Ft = (e) => async (t, n, r) => {
|
|
881
883
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
882
884
|
let i = t._zod.run({ value: n, issues: [] }, o);
|
|
883
885
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
884
886
|
success: !1,
|
|
885
887
|
error: new e(i.issues.map((s) => F(s, o, U())))
|
|
886
888
|
} : { success: !0, data: i.value };
|
|
887
|
-
}, fr = /* @__PURE__ */
|
|
889
|
+
}, fr = /* @__PURE__ */ Ft(Mt), lr = /^[cC][^\s-]{8,}$/, pr = /^[0-9a-z]+$/, mr = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, hr = /^[0-9a-vA-V]{20}$/, dr = /^[A-Za-z0-9]{27}$/, gr = /^[a-zA-Z0-9_-]{21}$/, _r = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, vr = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, je = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, br = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, yr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
888
890
|
function zr() {
|
|
889
891
|
return new RegExp(yr, "u");
|
|
890
892
|
}
|
|
891
|
-
const wr = /^(?:(?: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])$/, $r = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, Zr = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, kr = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ir = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,
|
|
892
|
-
function
|
|
893
|
+
const wr = /^(?:(?: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])$/, $r = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, Zr = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, kr = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ir = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Tt = /^[A-Za-z0-9_-]*$/, Er = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, Ar = /^\+(?:[0-9]){6,14}[0-9]$/, Lt = "(?:(?:\\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])))", xr = /* @__PURE__ */ new RegExp(`^${Lt}$`);
|
|
894
|
+
function Bt(e) {
|
|
893
895
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
894
896
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
895
897
|
}
|
|
896
|
-
function
|
|
897
|
-
return new RegExp(`^${
|
|
898
|
+
function Or(e) {
|
|
899
|
+
return new RegExp(`^${Bt(e)}$`);
|
|
898
900
|
}
|
|
899
|
-
function
|
|
900
|
-
const t =
|
|
901
|
+
function Sr(e) {
|
|
902
|
+
const t = Bt({ precision: e.precision }), n = ["Z"];
|
|
901
903
|
e.local && n.push(""), e.offset && n.push("([+-]\\d{2}:\\d{2})");
|
|
902
904
|
const r = `${t}(?:${n.join("|")})`;
|
|
903
|
-
return new RegExp(`^${
|
|
905
|
+
return new RegExp(`^${Lt}T(?:${r})$`);
|
|
904
906
|
}
|
|
905
907
|
const Pr = (e) => {
|
|
906
|
-
const t = e ? `[\\s\\S]{${
|
|
908
|
+
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
907
909
|
return new RegExp(`^${t}$`);
|
|
908
|
-
}, jr = /^\d+$/, Nr = /^-?\d+(?:\.\d+)?/i,
|
|
910
|
+
}, jr = /^\d+$/, Nr = /^-?\d+(?:\.\d+)?/i, Dr = /true|false/i, Rr = /^[^A-Z]*$/, Mr = /^[^a-z]*$/, A = /* @__PURE__ */ c("$ZodCheck", (e, t) => {
|
|
909
911
|
var n;
|
|
910
912
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
911
|
-
}),
|
|
913
|
+
}), Wt = {
|
|
912
914
|
number: "number",
|
|
913
915
|
bigint: "bigint",
|
|
914
916
|
object: "date"
|
|
915
|
-
},
|
|
917
|
+
}, Vt = /* @__PURE__ */ c("$ZodCheckLessThan", (e, t) => {
|
|
916
918
|
A.init(e, t);
|
|
917
|
-
const n =
|
|
919
|
+
const n = Wt[typeof t.value];
|
|
918
920
|
e._zod.onattach.push((r) => {
|
|
919
921
|
const o = r._zod.bag, i = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
920
922
|
t.value < i && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
|
|
@@ -929,9 +931,9 @@ const Pr = (e) => {
|
|
|
929
931
|
continue: !t.abort
|
|
930
932
|
});
|
|
931
933
|
};
|
|
932
|
-
}),
|
|
934
|
+
}), Gt = /* @__PURE__ */ c("$ZodCheckGreaterThan", (e, t) => {
|
|
933
935
|
A.init(e, t);
|
|
934
|
-
const n =
|
|
936
|
+
const n = Wt[typeof t.value];
|
|
935
937
|
e._zod.onattach.push((r) => {
|
|
936
938
|
const o = r._zod.bag, i = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
937
939
|
t.value > i && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
|
|
@@ -963,36 +965,35 @@ const Pr = (e) => {
|
|
|
963
965
|
});
|
|
964
966
|
};
|
|
965
967
|
}), Fr = /* @__PURE__ */ c("$ZodCheckNumberFormat", (e, t) => {
|
|
966
|
-
var s;
|
|
967
968
|
A.init(e, t), t.format = t.format || "float64";
|
|
968
|
-
const n =
|
|
969
|
-
e._zod.onattach.push((
|
|
970
|
-
const
|
|
971
|
-
|
|
972
|
-
}), e._zod.check = (
|
|
973
|
-
const
|
|
969
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = Hn[t.format];
|
|
970
|
+
e._zod.onattach.push((s) => {
|
|
971
|
+
const u = s._zod.bag;
|
|
972
|
+
u.format = t.format, u.minimum = o, u.maximum = i, n && (u.pattern = jr);
|
|
973
|
+
}), e._zod.check = (s) => {
|
|
974
|
+
const u = s.value;
|
|
974
975
|
if (n) {
|
|
975
|
-
if (!Number.isInteger(
|
|
976
|
-
|
|
976
|
+
if (!Number.isInteger(u)) {
|
|
977
|
+
s.issues.push({
|
|
977
978
|
expected: r,
|
|
978
979
|
format: t.format,
|
|
979
980
|
code: "invalid_type",
|
|
980
|
-
input:
|
|
981
|
+
input: u,
|
|
981
982
|
inst: e
|
|
982
983
|
});
|
|
983
984
|
return;
|
|
984
985
|
}
|
|
985
|
-
if (!Number.isSafeInteger(
|
|
986
|
-
|
|
987
|
-
input:
|
|
986
|
+
if (!Number.isSafeInteger(u)) {
|
|
987
|
+
u > 0 ? s.issues.push({
|
|
988
|
+
input: u,
|
|
988
989
|
code: "too_big",
|
|
989
990
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
990
991
|
note: "Integers must be within the safe integer range.",
|
|
991
992
|
inst: e,
|
|
992
993
|
origin: r,
|
|
993
994
|
continue: !t.abort
|
|
994
|
-
}) :
|
|
995
|
-
input:
|
|
995
|
+
}) : s.issues.push({
|
|
996
|
+
input: u,
|
|
996
997
|
code: "too_small",
|
|
997
998
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
998
999
|
note: "Integers must be within the safe integer range.",
|
|
@@ -1003,17 +1004,17 @@ const Pr = (e) => {
|
|
|
1003
1004
|
return;
|
|
1004
1005
|
}
|
|
1005
1006
|
}
|
|
1006
|
-
|
|
1007
|
+
u < o && s.issues.push({
|
|
1007
1008
|
origin: "number",
|
|
1008
|
-
input:
|
|
1009
|
+
input: u,
|
|
1009
1010
|
code: "too_small",
|
|
1010
1011
|
minimum: o,
|
|
1011
1012
|
inclusive: !0,
|
|
1012
1013
|
inst: e,
|
|
1013
1014
|
continue: !t.abort
|
|
1014
|
-
}),
|
|
1015
|
+
}), u > i && s.issues.push({
|
|
1015
1016
|
origin: "number",
|
|
1016
|
-
input:
|
|
1017
|
+
input: u,
|
|
1017
1018
|
code: "too_big",
|
|
1018
1019
|
maximum: i,
|
|
1019
1020
|
inst: e
|
|
@@ -1023,14 +1024,14 @@ const Pr = (e) => {
|
|
|
1023
1024
|
var n;
|
|
1024
1025
|
A.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1025
1026
|
const o = r.value;
|
|
1026
|
-
return !
|
|
1027
|
+
return !q(o) && o.size !== void 0;
|
|
1027
1028
|
}), e._zod.onattach.push((r) => {
|
|
1028
1029
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1029
1030
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
1030
1031
|
}), e._zod.check = (r) => {
|
|
1031
1032
|
const o = r.value;
|
|
1032
1033
|
o.size <= t.maximum || r.issues.push({
|
|
1033
|
-
origin:
|
|
1034
|
+
origin: Nt(o),
|
|
1034
1035
|
code: "too_big",
|
|
1035
1036
|
maximum: t.maximum,
|
|
1036
1037
|
input: o,
|
|
@@ -1042,14 +1043,14 @@ const Pr = (e) => {
|
|
|
1042
1043
|
var n;
|
|
1043
1044
|
A.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1044
1045
|
const o = r.value;
|
|
1045
|
-
return !
|
|
1046
|
+
return !q(o) && o.size !== void 0;
|
|
1046
1047
|
}), e._zod.onattach.push((r) => {
|
|
1047
1048
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1048
1049
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
1049
1050
|
}), e._zod.check = (r) => {
|
|
1050
1051
|
const o = r.value;
|
|
1051
1052
|
o.size >= t.minimum || r.issues.push({
|
|
1052
|
-
origin:
|
|
1053
|
+
origin: Nt(o),
|
|
1053
1054
|
code: "too_small",
|
|
1054
1055
|
minimum: t.minimum,
|
|
1055
1056
|
input: o,
|
|
@@ -1061,7 +1062,7 @@ const Pr = (e) => {
|
|
|
1061
1062
|
var n;
|
|
1062
1063
|
A.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1063
1064
|
const o = r.value;
|
|
1064
|
-
return !
|
|
1065
|
+
return !q(o) && o.length !== void 0;
|
|
1065
1066
|
}), e._zod.onattach.push((r) => {
|
|
1066
1067
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1067
1068
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -1069,7 +1070,7 @@ const Pr = (e) => {
|
|
|
1069
1070
|
const o = r.value;
|
|
1070
1071
|
if (o.length <= t.maximum)
|
|
1071
1072
|
return;
|
|
1072
|
-
const s =
|
|
1073
|
+
const s = Ze(o);
|
|
1073
1074
|
r.issues.push({
|
|
1074
1075
|
origin: s,
|
|
1075
1076
|
code: "too_big",
|
|
@@ -1084,7 +1085,7 @@ const Pr = (e) => {
|
|
|
1084
1085
|
var n;
|
|
1085
1086
|
A.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1086
1087
|
const o = r.value;
|
|
1087
|
-
return !
|
|
1088
|
+
return !q(o) && o.length !== void 0;
|
|
1088
1089
|
}), e._zod.onattach.push((r) => {
|
|
1089
1090
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1090
1091
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -1092,7 +1093,7 @@ const Pr = (e) => {
|
|
|
1092
1093
|
const o = r.value;
|
|
1093
1094
|
if (o.length >= t.minimum)
|
|
1094
1095
|
return;
|
|
1095
|
-
const s =
|
|
1096
|
+
const s = Ze(o);
|
|
1096
1097
|
r.issues.push({
|
|
1097
1098
|
origin: s,
|
|
1098
1099
|
code: "too_small",
|
|
@@ -1107,7 +1108,7 @@ const Pr = (e) => {
|
|
|
1107
1108
|
var n;
|
|
1108
1109
|
A.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1109
1110
|
const o = r.value;
|
|
1110
|
-
return !
|
|
1111
|
+
return !q(o) && o.length !== void 0;
|
|
1111
1112
|
}), e._zod.onattach.push((r) => {
|
|
1112
1113
|
const o = r._zod.bag;
|
|
1113
1114
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
@@ -1115,7 +1116,7 @@ const Pr = (e) => {
|
|
|
1115
1116
|
const o = r.value, i = o.length;
|
|
1116
1117
|
if (i === t.length)
|
|
1117
1118
|
return;
|
|
1118
|
-
const s =
|
|
1119
|
+
const s = Ze(o), u = i > t.length;
|
|
1119
1120
|
r.issues.push({
|
|
1120
1121
|
origin: s,
|
|
1121
1122
|
...u ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -1155,9 +1156,9 @@ const Pr = (e) => {
|
|
|
1155
1156
|
continue: !t.abort
|
|
1156
1157
|
});
|
|
1157
1158
|
};
|
|
1158
|
-
}),
|
|
1159
|
-
t.pattern ?? (t.pattern =
|
|
1160
|
-
}),
|
|
1159
|
+
}), Cr = /* @__PURE__ */ c("$ZodCheckLowerCase", (e, t) => {
|
|
1160
|
+
t.pattern ?? (t.pattern = Rr), le.init(e, t);
|
|
1161
|
+
}), Kr = /* @__PURE__ */ c("$ZodCheckUpperCase", (e, t) => {
|
|
1161
1162
|
t.pattern ?? (t.pattern = Mr), le.init(e, t);
|
|
1162
1163
|
}), Jr = /* @__PURE__ */ c("$ZodCheckIncludes", (e, t) => {
|
|
1163
1164
|
A.init(e, t);
|
|
@@ -1246,7 +1247,7 @@ class Qr {
|
|
|
1246
1247
|
this.content.push(s);
|
|
1247
1248
|
}
|
|
1248
1249
|
compile() {
|
|
1249
|
-
const t = Function, n = this
|
|
1250
|
+
const t = Function, n = this?.args, o = [...(this?.content ?? [""]).map((i) => ` ${i}`)];
|
|
1250
1251
|
return new t(...n, o.join(`
|
|
1251
1252
|
`));
|
|
1252
1253
|
}
|
|
@@ -1254,89 +1255,83 @@ class Qr {
|
|
|
1254
1255
|
const eo = {
|
|
1255
1256
|
major: 4,
|
|
1256
1257
|
minor: 0,
|
|
1257
|
-
patch:
|
|
1258
|
-
},
|
|
1259
|
-
var o;
|
|
1258
|
+
patch: 10
|
|
1259
|
+
}, z = /* @__PURE__ */ c("$ZodType", (e, t) => {
|
|
1260
1260
|
var n;
|
|
1261
1261
|
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = eo;
|
|
1262
1262
|
const r = [...e._zod.def.checks ?? []];
|
|
1263
1263
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
1264
|
-
for (const
|
|
1265
|
-
for (const
|
|
1266
|
-
|
|
1264
|
+
for (const o of r)
|
|
1265
|
+
for (const i of o._zod.onattach)
|
|
1266
|
+
i(e);
|
|
1267
1267
|
if (r.length === 0)
|
|
1268
|
-
(n = e._zod).deferred ?? (n.deferred = []),
|
|
1268
|
+
(n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
|
|
1269
1269
|
e._zod.run = e._zod.parse;
|
|
1270
1270
|
});
|
|
1271
1271
|
else {
|
|
1272
|
-
const
|
|
1273
|
-
let f =
|
|
1274
|
-
for (const
|
|
1275
|
-
if (
|
|
1276
|
-
if (!
|
|
1272
|
+
const o = (i, s, u) => {
|
|
1273
|
+
let f = K(i), a;
|
|
1274
|
+
for (const g of s) {
|
|
1275
|
+
if (g._zod.def.when) {
|
|
1276
|
+
if (!g._zod.def.when(i))
|
|
1277
1277
|
continue;
|
|
1278
1278
|
} else if (f)
|
|
1279
1279
|
continue;
|
|
1280
|
-
const
|
|
1281
|
-
if (m instanceof Promise &&
|
|
1282
|
-
throw new
|
|
1283
|
-
if (
|
|
1284
|
-
|
|
1285
|
-
await m,
|
|
1280
|
+
const p = i.issues.length, m = g._zod.check(i);
|
|
1281
|
+
if (m instanceof Promise && u?.async === !1)
|
|
1282
|
+
throw new J();
|
|
1283
|
+
if (a || m instanceof Promise)
|
|
1284
|
+
a = (a ?? Promise.resolve()).then(async () => {
|
|
1285
|
+
await m, i.issues.length !== p && (f || (f = K(i, p)));
|
|
1286
1286
|
});
|
|
1287
1287
|
else {
|
|
1288
|
-
if (
|
|
1288
|
+
if (i.issues.length === p)
|
|
1289
1289
|
continue;
|
|
1290
|
-
f || (f =
|
|
1290
|
+
f || (f = K(i, p));
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
return
|
|
1293
|
+
return a ? a.then(() => i) : i;
|
|
1294
1294
|
};
|
|
1295
|
-
e._zod.run = (
|
|
1296
|
-
const
|
|
1297
|
-
if (
|
|
1298
|
-
if (
|
|
1299
|
-
throw new
|
|
1300
|
-
return
|
|
1295
|
+
e._zod.run = (i, s) => {
|
|
1296
|
+
const u = e._zod.parse(i, s);
|
|
1297
|
+
if (u instanceof Promise) {
|
|
1298
|
+
if (s.async === !1)
|
|
1299
|
+
throw new J();
|
|
1300
|
+
return u.then((f) => o(f, r, s));
|
|
1301
1301
|
}
|
|
1302
|
-
return
|
|
1302
|
+
return o(u, r, s);
|
|
1303
1303
|
};
|
|
1304
1304
|
}
|
|
1305
1305
|
e["~standard"] = {
|
|
1306
|
-
validate: (
|
|
1307
|
-
var s;
|
|
1306
|
+
validate: (o) => {
|
|
1308
1307
|
try {
|
|
1309
|
-
const
|
|
1310
|
-
return
|
|
1308
|
+
const i = ar(e, o);
|
|
1309
|
+
return i.success ? { value: i.data } : { issues: i.error?.issues };
|
|
1311
1310
|
} catch {
|
|
1312
|
-
return fr(e,
|
|
1313
|
-
var f;
|
|
1314
|
-
return a.success ? { value: a.data } : { issues: (f = a.error) == null ? void 0 : f.issues };
|
|
1315
|
-
});
|
|
1311
|
+
return fr(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
1316
1312
|
}
|
|
1317
1313
|
},
|
|
1318
1314
|
vendor: "zod",
|
|
1319
1315
|
version: 1
|
|
1320
1316
|
};
|
|
1321
|
-
}),
|
|
1322
|
-
|
|
1323
|
-
w.init(e, t), e._zod.pattern = [...((n = e == null ? void 0 : e._zod.bag) == null ? void 0 : n.patterns) ?? []].pop() ?? Pr(e._zod.bag), e._zod.parse = (r, o) => {
|
|
1317
|
+
}), ke = /* @__PURE__ */ c("$ZodString", (e, t) => {
|
|
1318
|
+
z.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Pr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
1324
1319
|
if (t.coerce)
|
|
1325
1320
|
try {
|
|
1326
|
-
|
|
1321
|
+
n.value = String(n.value);
|
|
1327
1322
|
} catch {
|
|
1328
1323
|
}
|
|
1329
|
-
return typeof
|
|
1324
|
+
return typeof n.value == "string" || n.issues.push({
|
|
1330
1325
|
expected: "string",
|
|
1331
1326
|
code: "invalid_type",
|
|
1332
|
-
input:
|
|
1327
|
+
input: n.value,
|
|
1333
1328
|
inst: e
|
|
1334
|
-
}),
|
|
1329
|
+
}), n;
|
|
1335
1330
|
};
|
|
1336
|
-
}),
|
|
1337
|
-
le.init(e, t),
|
|
1331
|
+
}), w = /* @__PURE__ */ c("$ZodStringFormat", (e, t) => {
|
|
1332
|
+
le.init(e, t), ke.init(e, t);
|
|
1338
1333
|
}), to = /* @__PURE__ */ c("$ZodGUID", (e, t) => {
|
|
1339
|
-
t.pattern ?? (t.pattern = vr),
|
|
1334
|
+
t.pattern ?? (t.pattern = vr), w.init(e, t);
|
|
1340
1335
|
}), no = /* @__PURE__ */ c("$ZodUUID", (e, t) => {
|
|
1341
1336
|
if (t.version) {
|
|
1342
1337
|
const r = {
|
|
@@ -1351,16 +1346,16 @@ const eo = {
|
|
|
1351
1346
|
}[t.version];
|
|
1352
1347
|
if (r === void 0)
|
|
1353
1348
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
1354
|
-
t.pattern ?? (t.pattern =
|
|
1349
|
+
t.pattern ?? (t.pattern = je(r));
|
|
1355
1350
|
} else
|
|
1356
|
-
t.pattern ?? (t.pattern =
|
|
1357
|
-
|
|
1351
|
+
t.pattern ?? (t.pattern = je());
|
|
1352
|
+
w.init(e, t);
|
|
1358
1353
|
}), ro = /* @__PURE__ */ c("$ZodEmail", (e, t) => {
|
|
1359
|
-
t.pattern ?? (t.pattern = br),
|
|
1354
|
+
t.pattern ?? (t.pattern = br), w.init(e, t);
|
|
1360
1355
|
}), oo = /* @__PURE__ */ c("$ZodURL", (e, t) => {
|
|
1361
|
-
|
|
1356
|
+
w.init(e, t), e._zod.check = (n) => {
|
|
1362
1357
|
try {
|
|
1363
|
-
const r = n.value, o = new URL(r)
|
|
1358
|
+
const r = n.value.trim(), o = new URL(r);
|
|
1364
1359
|
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
|
|
1365
1360
|
code: "invalid_format",
|
|
1366
1361
|
format: "url",
|
|
@@ -1377,7 +1372,7 @@ const eo = {
|
|
|
1377
1372
|
input: n.value,
|
|
1378
1373
|
inst: e,
|
|
1379
1374
|
continue: !t.abort
|
|
1380
|
-
})),
|
|
1375
|
+
})), t.normalize ? n.value = o.href : n.value = r;
|
|
1381
1376
|
return;
|
|
1382
1377
|
} catch {
|
|
1383
1378
|
n.issues.push({
|
|
@@ -1390,34 +1385,34 @@ const eo = {
|
|
|
1390
1385
|
}
|
|
1391
1386
|
};
|
|
1392
1387
|
}), io = /* @__PURE__ */ c("$ZodEmoji", (e, t) => {
|
|
1393
|
-
t.pattern ?? (t.pattern = zr()),
|
|
1388
|
+
t.pattern ?? (t.pattern = zr()), w.init(e, t);
|
|
1394
1389
|
}), so = /* @__PURE__ */ c("$ZodNanoID", (e, t) => {
|
|
1395
|
-
t.pattern ?? (t.pattern = gr),
|
|
1396
|
-
}),
|
|
1397
|
-
t.pattern ?? (t.pattern = lr),
|
|
1398
|
-
}),
|
|
1399
|
-
t.pattern ?? (t.pattern =
|
|
1390
|
+
t.pattern ?? (t.pattern = gr), w.init(e, t);
|
|
1391
|
+
}), co = /* @__PURE__ */ c("$ZodCUID", (e, t) => {
|
|
1392
|
+
t.pattern ?? (t.pattern = lr), w.init(e, t);
|
|
1393
|
+
}), uo = /* @__PURE__ */ c("$ZodCUID2", (e, t) => {
|
|
1394
|
+
t.pattern ?? (t.pattern = pr), w.init(e, t);
|
|
1400
1395
|
}), ao = /* @__PURE__ */ c("$ZodULID", (e, t) => {
|
|
1401
|
-
t.pattern ?? (t.pattern =
|
|
1396
|
+
t.pattern ?? (t.pattern = mr), w.init(e, t);
|
|
1402
1397
|
}), fo = /* @__PURE__ */ c("$ZodXID", (e, t) => {
|
|
1403
|
-
t.pattern ?? (t.pattern =
|
|
1398
|
+
t.pattern ?? (t.pattern = hr), w.init(e, t);
|
|
1404
1399
|
}), lo = /* @__PURE__ */ c("$ZodKSUID", (e, t) => {
|
|
1405
|
-
t.pattern ?? (t.pattern =
|
|
1406
|
-
}),
|
|
1407
|
-
t.pattern ?? (t.pattern =
|
|
1408
|
-
}),
|
|
1409
|
-
t.pattern ?? (t.pattern =
|
|
1410
|
-
}),
|
|
1411
|
-
t.pattern ?? (t.pattern =
|
|
1400
|
+
t.pattern ?? (t.pattern = dr), w.init(e, t);
|
|
1401
|
+
}), po = /* @__PURE__ */ c("$ZodISODateTime", (e, t) => {
|
|
1402
|
+
t.pattern ?? (t.pattern = Sr(t)), w.init(e, t);
|
|
1403
|
+
}), mo = /* @__PURE__ */ c("$ZodISODate", (e, t) => {
|
|
1404
|
+
t.pattern ?? (t.pattern = xr), w.init(e, t);
|
|
1405
|
+
}), ho = /* @__PURE__ */ c("$ZodISOTime", (e, t) => {
|
|
1406
|
+
t.pattern ?? (t.pattern = Or(t)), w.init(e, t);
|
|
1412
1407
|
}), go = /* @__PURE__ */ c("$ZodISODuration", (e, t) => {
|
|
1413
|
-
t.pattern ?? (t.pattern = _r),
|
|
1408
|
+
t.pattern ?? (t.pattern = _r), w.init(e, t);
|
|
1414
1409
|
}), _o = /* @__PURE__ */ c("$ZodIPv4", (e, t) => {
|
|
1415
|
-
t.pattern ?? (t.pattern = wr),
|
|
1410
|
+
t.pattern ?? (t.pattern = wr), w.init(e, t), e._zod.onattach.push((n) => {
|
|
1416
1411
|
const r = n._zod.bag;
|
|
1417
1412
|
r.format = "ipv4";
|
|
1418
1413
|
});
|
|
1419
1414
|
}), vo = /* @__PURE__ */ c("$ZodIPv6", (e, t) => {
|
|
1420
|
-
t.pattern ?? (t.pattern = $r),
|
|
1415
|
+
t.pattern ?? (t.pattern = $r), w.init(e, t), e._zod.onattach.push((n) => {
|
|
1421
1416
|
const r = n._zod.bag;
|
|
1422
1417
|
r.format = "ipv6";
|
|
1423
1418
|
}), e._zod.check = (n) => {
|
|
@@ -1434,9 +1429,9 @@ const eo = {
|
|
|
1434
1429
|
}
|
|
1435
1430
|
};
|
|
1436
1431
|
}), bo = /* @__PURE__ */ c("$ZodCIDRv4", (e, t) => {
|
|
1437
|
-
t.pattern ?? (t.pattern = Zr),
|
|
1432
|
+
t.pattern ?? (t.pattern = Zr), w.init(e, t);
|
|
1438
1433
|
}), yo = /* @__PURE__ */ c("$ZodCIDRv6", (e, t) => {
|
|
1439
|
-
t.pattern ?? (t.pattern = kr),
|
|
1434
|
+
t.pattern ?? (t.pattern = kr), w.init(e, t), e._zod.check = (n) => {
|
|
1440
1435
|
const [r, o] = n.value.split("/");
|
|
1441
1436
|
try {
|
|
1442
1437
|
if (!o)
|
|
@@ -1458,7 +1453,7 @@ const eo = {
|
|
|
1458
1453
|
}
|
|
1459
1454
|
};
|
|
1460
1455
|
});
|
|
1461
|
-
function
|
|
1456
|
+
function Ct(e) {
|
|
1462
1457
|
if (e === "")
|
|
1463
1458
|
return !0;
|
|
1464
1459
|
if (e.length % 4 !== 0)
|
|
@@ -1470,10 +1465,10 @@ function Gt(e) {
|
|
|
1470
1465
|
}
|
|
1471
1466
|
}
|
|
1472
1467
|
const zo = /* @__PURE__ */ c("$ZodBase64", (e, t) => {
|
|
1473
|
-
t.pattern ?? (t.pattern = Ir),
|
|
1468
|
+
t.pattern ?? (t.pattern = Ir), w.init(e, t), e._zod.onattach.push((n) => {
|
|
1474
1469
|
n._zod.bag.contentEncoding = "base64";
|
|
1475
1470
|
}), e._zod.check = (n) => {
|
|
1476
|
-
|
|
1471
|
+
Ct(n.value) || n.issues.push({
|
|
1477
1472
|
code: "invalid_format",
|
|
1478
1473
|
format: "base64",
|
|
1479
1474
|
input: n.value,
|
|
@@ -1483,13 +1478,13 @@ const zo = /* @__PURE__ */ c("$ZodBase64", (e, t) => {
|
|
|
1483
1478
|
};
|
|
1484
1479
|
});
|
|
1485
1480
|
function wo(e) {
|
|
1486
|
-
if (!
|
|
1481
|
+
if (!Tt.test(e))
|
|
1487
1482
|
return !1;
|
|
1488
1483
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1489
|
-
return
|
|
1484
|
+
return Ct(n);
|
|
1490
1485
|
}
|
|
1491
1486
|
const $o = /* @__PURE__ */ c("$ZodBase64URL", (e, t) => {
|
|
1492
|
-
t.pattern ?? (t.pattern =
|
|
1487
|
+
t.pattern ?? (t.pattern = Tt), w.init(e, t), e._zod.onattach.push((n) => {
|
|
1493
1488
|
n._zod.bag.contentEncoding = "base64url";
|
|
1494
1489
|
}), e._zod.check = (n) => {
|
|
1495
1490
|
wo(n.value) || n.issues.push({
|
|
@@ -1501,7 +1496,7 @@ const $o = /* @__PURE__ */ c("$ZodBase64URL", (e, t) => {
|
|
|
1501
1496
|
});
|
|
1502
1497
|
};
|
|
1503
1498
|
}), Zo = /* @__PURE__ */ c("$ZodE164", (e, t) => {
|
|
1504
|
-
t.pattern ?? (t.pattern = Ar),
|
|
1499
|
+
t.pattern ?? (t.pattern = Ar), w.init(e, t);
|
|
1505
1500
|
});
|
|
1506
1501
|
function ko(e, t = null) {
|
|
1507
1502
|
try {
|
|
@@ -1512,13 +1507,13 @@ function ko(e, t = null) {
|
|
|
1512
1507
|
if (!r)
|
|
1513
1508
|
return !1;
|
|
1514
1509
|
const o = JSON.parse(atob(r));
|
|
1515
|
-
return !("typ" in o &&
|
|
1510
|
+
return !("typ" in o && o?.typ !== "JWT" || !o.alg || t && (!("alg" in o) || o.alg !== t));
|
|
1516
1511
|
} catch {
|
|
1517
1512
|
return !1;
|
|
1518
1513
|
}
|
|
1519
1514
|
}
|
|
1520
1515
|
const Io = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
|
|
1521
|
-
|
|
1516
|
+
w.init(e, t), e._zod.check = (n) => {
|
|
1522
1517
|
ko(n.value, t.alg) || n.issues.push({
|
|
1523
1518
|
code: "invalid_format",
|
|
1524
1519
|
format: "jwt",
|
|
@@ -1528,7 +1523,7 @@ const Io = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
|
|
|
1528
1523
|
});
|
|
1529
1524
|
};
|
|
1530
1525
|
}), Kt = /* @__PURE__ */ c("$ZodNumber", (e, t) => {
|
|
1531
|
-
|
|
1526
|
+
z.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Nr, e._zod.parse = (n, r) => {
|
|
1532
1527
|
if (t.coerce)
|
|
1533
1528
|
try {
|
|
1534
1529
|
n.value = Number(n.value);
|
|
@@ -1549,7 +1544,7 @@ const Io = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
|
|
|
1549
1544
|
}), Eo = /* @__PURE__ */ c("$ZodNumber", (e, t) => {
|
|
1550
1545
|
Fr.init(e, t), Kt.init(e, t);
|
|
1551
1546
|
}), Ao = /* @__PURE__ */ c("$ZodBoolean", (e, t) => {
|
|
1552
|
-
|
|
1547
|
+
z.init(e, t), e._zod.pattern = Dr, e._zod.parse = (n, r) => {
|
|
1553
1548
|
if (t.coerce)
|
|
1554
1549
|
try {
|
|
1555
1550
|
n.value = !!n.value;
|
|
@@ -1563,19 +1558,19 @@ const Io = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
|
|
|
1563
1558
|
inst: e
|
|
1564
1559
|
}), n;
|
|
1565
1560
|
};
|
|
1566
|
-
}),
|
|
1567
|
-
|
|
1568
|
-
}),
|
|
1569
|
-
|
|
1570
|
-
}),
|
|
1571
|
-
|
|
1561
|
+
}), xo = /* @__PURE__ */ c("$ZodAny", (e, t) => {
|
|
1562
|
+
z.init(e, t), e._zod.parse = (n) => n;
|
|
1563
|
+
}), Oo = /* @__PURE__ */ c("$ZodUnknown", (e, t) => {
|
|
1564
|
+
z.init(e, t), e._zod.parse = (n) => n;
|
|
1565
|
+
}), So = /* @__PURE__ */ c("$ZodNever", (e, t) => {
|
|
1566
|
+
z.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
|
|
1572
1567
|
expected: "never",
|
|
1573
1568
|
code: "invalid_type",
|
|
1574
1569
|
input: n.value,
|
|
1575
1570
|
inst: e
|
|
1576
1571
|
}), n);
|
|
1577
1572
|
}), Po = /* @__PURE__ */ c("$ZodDate", (e, t) => {
|
|
1578
|
-
|
|
1573
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
1579
1574
|
if (t.coerce)
|
|
1580
1575
|
try {
|
|
1581
1576
|
n.value = new Date(n.value);
|
|
@@ -1591,11 +1586,11 @@ const Io = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
|
|
|
1591
1586
|
}), n;
|
|
1592
1587
|
};
|
|
1593
1588
|
});
|
|
1594
|
-
function
|
|
1595
|
-
e.issues.length && t.issues.push(...
|
|
1589
|
+
function Ne(e, t, n) {
|
|
1590
|
+
e.issues.length && t.issues.push(...jt(n, e.issues)), t.value[n] = e.value;
|
|
1596
1591
|
}
|
|
1597
1592
|
const jo = /* @__PURE__ */ c("$ZodArray", (e, t) => {
|
|
1598
|
-
|
|
1593
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
1599
1594
|
const o = n.value;
|
|
1600
1595
|
if (!Array.isArray(o))
|
|
1601
1596
|
return n.issues.push({
|
|
@@ -1607,161 +1602,145 @@ const jo = /* @__PURE__ */ c("$ZodArray", (e, t) => {
|
|
|
1607
1602
|
n.value = Array(o.length);
|
|
1608
1603
|
const i = [];
|
|
1609
1604
|
for (let s = 0; s < o.length; s++) {
|
|
1610
|
-
const u = o[s],
|
|
1605
|
+
const u = o[s], f = t.element._zod.run({
|
|
1611
1606
|
value: u,
|
|
1612
1607
|
issues: []
|
|
1613
1608
|
}, r);
|
|
1614
|
-
|
|
1609
|
+
f instanceof Promise ? i.push(f.then((a) => Ne(a, n, s))) : Ne(f, n, s);
|
|
1615
1610
|
}
|
|
1616
1611
|
return i.length ? Promise.all(i).then(() => n) : n;
|
|
1617
1612
|
};
|
|
1618
1613
|
});
|
|
1619
|
-
function te(e, t, n) {
|
|
1620
|
-
e.issues.length && t.issues.push(...
|
|
1621
|
-
}
|
|
1622
|
-
function Ne(e, t, n, r) {
|
|
1623
|
-
e.issues.length ? r[n] === void 0 ? n in r ? t.value[n] = void 0 : t.value[n] = e.value : t.issues.push(...Ze(n, e.issues)) : e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1614
|
+
function te(e, t, n, r) {
|
|
1615
|
+
e.issues.length && t.issues.push(...jt(n, e.issues)), e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1624
1616
|
}
|
|
1625
1617
|
const No = /* @__PURE__ */ c("$ZodObject", (e, t) => {
|
|
1626
|
-
|
|
1627
|
-
const n =
|
|
1628
|
-
const
|
|
1629
|
-
for (const
|
|
1630
|
-
if (!(t.shape[
|
|
1631
|
-
throw new Error(`Invalid element at key "${
|
|
1632
|
-
const
|
|
1618
|
+
z.init(e, t);
|
|
1619
|
+
const n = St(() => {
|
|
1620
|
+
const p = Object.keys(t.shape);
|
|
1621
|
+
for (const h of p)
|
|
1622
|
+
if (!(t.shape[h] instanceof z))
|
|
1623
|
+
throw new Error(`Invalid element at key "${h}": expected a Zod schema`);
|
|
1624
|
+
const m = Xn(t.shape);
|
|
1633
1625
|
return {
|
|
1634
1626
|
shape: t.shape,
|
|
1635
|
-
keys:
|
|
1636
|
-
keySet: new Set(
|
|
1637
|
-
numKeys:
|
|
1638
|
-
optionalKeys: new Set(
|
|
1627
|
+
keys: p,
|
|
1628
|
+
keySet: new Set(p),
|
|
1629
|
+
numKeys: p.length,
|
|
1630
|
+
optionalKeys: new Set(m)
|
|
1639
1631
|
};
|
|
1640
1632
|
});
|
|
1641
|
-
|
|
1642
|
-
const
|
|
1643
|
-
for (const
|
|
1644
|
-
const
|
|
1645
|
-
if (
|
|
1646
|
-
h
|
|
1647
|
-
for (const
|
|
1648
|
-
h
|
|
1633
|
+
y(e._zod, "propValues", () => {
|
|
1634
|
+
const p = t.shape, m = {};
|
|
1635
|
+
for (const h in p) {
|
|
1636
|
+
const I = p[h]._zod;
|
|
1637
|
+
if (I.values) {
|
|
1638
|
+
m[h] ?? (m[h] = /* @__PURE__ */ new Set());
|
|
1639
|
+
for (const d of I.values)
|
|
1640
|
+
m[h].add(d);
|
|
1649
1641
|
}
|
|
1650
1642
|
}
|
|
1651
|
-
return
|
|
1643
|
+
return m;
|
|
1652
1644
|
});
|
|
1653
|
-
const r = (
|
|
1654
|
-
const
|
|
1655
|
-
const
|
|
1656
|
-
return `shape[${
|
|
1645
|
+
const r = (p) => {
|
|
1646
|
+
const m = new Qr(["shape", "payload", "ctx"]), h = n.value, I = (_) => {
|
|
1647
|
+
const b = Pe(_);
|
|
1648
|
+
return `shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`;
|
|
1657
1649
|
};
|
|
1658
|
-
|
|
1659
|
-
const
|
|
1650
|
+
m.write("const input = payload.value;");
|
|
1651
|
+
const d = /* @__PURE__ */ Object.create(null);
|
|
1660
1652
|
let E = 0;
|
|
1661
|
-
for (const _ of
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
for (const _ of
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
${v}.issues.map((iss) => ({
|
|
1678
|
-
...iss,
|
|
1679
|
-
path: iss.path ? [${y}, ...iss.path] : [${y}],
|
|
1680
|
-
}))
|
|
1681
|
-
);
|
|
1653
|
+
for (const _ of h.keys)
|
|
1654
|
+
d[_] = `key_${E++}`;
|
|
1655
|
+
m.write("const newResult = {}");
|
|
1656
|
+
for (const _ of h.keys) {
|
|
1657
|
+
const b = d[_], $ = Pe(_);
|
|
1658
|
+
m.write(`const ${b} = ${I(_)};`), m.write(`
|
|
1659
|
+
if (${b}.issues.length) {
|
|
1660
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
1661
|
+
...iss,
|
|
1662
|
+
path: iss.path ? [${$}, ...iss.path] : [${$}]
|
|
1663
|
+
})));
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
if (${b}.value === undefined) {
|
|
1667
|
+
if (${$} in input) {
|
|
1668
|
+
newResult[${$}] = undefined;
|
|
1682
1669
|
}
|
|
1683
|
-
} else if (${v}.value === undefined) {
|
|
1684
|
-
if (${y} in input) newResult[${y}] = undefined;
|
|
1685
1670
|
} else {
|
|
1686
|
-
newResult[${
|
|
1671
|
+
newResult[${$}] = ${b}.value;
|
|
1687
1672
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
...iss,
|
|
1694
|
-
path: iss.path ? [${G(_)}, ...iss.path] : [${G(_)}]
|
|
1695
|
-
})));`), h.write(`newResult[${G(_)}] = ${v}.value`);
|
|
1696
|
-
}
|
|
1697
|
-
h.write("payload.value = newResult;"), h.write("return payload;");
|
|
1698
|
-
const z = h.compile();
|
|
1699
|
-
return (_, v) => z(d, _, v);
|
|
1673
|
+
`);
|
|
1674
|
+
}
|
|
1675
|
+
m.write("payload.value = newResult;"), m.write("return payload;");
|
|
1676
|
+
const v = m.compile();
|
|
1677
|
+
return (_, b) => v(p, _, b);
|
|
1700
1678
|
};
|
|
1701
1679
|
let o;
|
|
1702
|
-
const i =
|
|
1680
|
+
const i = ve, s = !Ot.jitless, f = s && Yn.value, a = t.catchall;
|
|
1703
1681
|
let g;
|
|
1704
|
-
e._zod.parse = (
|
|
1682
|
+
e._zod.parse = (p, m) => {
|
|
1705
1683
|
g ?? (g = n.value);
|
|
1706
|
-
const
|
|
1707
|
-
if (!i(
|
|
1708
|
-
return
|
|
1684
|
+
const h = p.value;
|
|
1685
|
+
if (!i(h))
|
|
1686
|
+
return p.issues.push({
|
|
1709
1687
|
expected: "object",
|
|
1710
1688
|
code: "invalid_type",
|
|
1711
|
-
input:
|
|
1689
|
+
input: h,
|
|
1712
1690
|
inst: e
|
|
1713
|
-
}),
|
|
1714
|
-
const
|
|
1715
|
-
if (s &&
|
|
1716
|
-
o || (o = r(t.shape)),
|
|
1691
|
+
}), p;
|
|
1692
|
+
const I = [];
|
|
1693
|
+
if (s && f && m?.async === !1 && m.jitless !== !0)
|
|
1694
|
+
o || (o = r(t.shape)), p = o(p, m);
|
|
1717
1695
|
else {
|
|
1718
|
-
|
|
1719
|
-
const
|
|
1720
|
-
for (const
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1696
|
+
p.value = {};
|
|
1697
|
+
const b = g.shape;
|
|
1698
|
+
for (const $ of g.keys) {
|
|
1699
|
+
const O = b[$]._zod.run({ value: h[$], issues: [] }, m);
|
|
1700
|
+
O instanceof Promise ? I.push(O.then((H) => te(H, p, $, h))) : te(O, p, $, h);
|
|
1723
1701
|
}
|
|
1724
1702
|
}
|
|
1725
|
-
if (!
|
|
1726
|
-
return
|
|
1727
|
-
const
|
|
1728
|
-
for (const
|
|
1729
|
-
if (E.has(
|
|
1703
|
+
if (!a)
|
|
1704
|
+
return I.length ? Promise.all(I).then(() => p) : p;
|
|
1705
|
+
const d = [], E = g.keySet, v = a._zod, _ = v.def.type;
|
|
1706
|
+
for (const b of Object.keys(h)) {
|
|
1707
|
+
if (E.has(b))
|
|
1730
1708
|
continue;
|
|
1731
1709
|
if (_ === "never") {
|
|
1732
|
-
|
|
1710
|
+
d.push(b);
|
|
1733
1711
|
continue;
|
|
1734
1712
|
}
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1713
|
+
const $ = v.run({ value: h[b], issues: [] }, m);
|
|
1714
|
+
$ instanceof Promise ? I.push($.then((P) => te(P, p, b, h))) : te($, p, b, h);
|
|
1737
1715
|
}
|
|
1738
|
-
return
|
|
1716
|
+
return d.length && p.issues.push({
|
|
1739
1717
|
code: "unrecognized_keys",
|
|
1740
|
-
keys:
|
|
1741
|
-
input:
|
|
1718
|
+
keys: d,
|
|
1719
|
+
input: h,
|
|
1742
1720
|
inst: e
|
|
1743
|
-
}),
|
|
1721
|
+
}), I.length ? Promise.all(I).then(() => p) : p;
|
|
1744
1722
|
};
|
|
1745
1723
|
});
|
|
1746
|
-
function
|
|
1747
|
-
for (const
|
|
1748
|
-
if (
|
|
1749
|
-
return t.value =
|
|
1750
|
-
|
|
1724
|
+
function De(e, t, n, r) {
|
|
1725
|
+
for (const i of e)
|
|
1726
|
+
if (i.issues.length === 0)
|
|
1727
|
+
return t.value = i.value, t;
|
|
1728
|
+
const o = e.filter((i) => !K(i));
|
|
1729
|
+
return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
|
|
1751
1730
|
code: "invalid_union",
|
|
1752
1731
|
input: t.value,
|
|
1753
1732
|
inst: n,
|
|
1754
|
-
errors: e.map((
|
|
1755
|
-
}), t;
|
|
1733
|
+
errors: e.map((i) => i.issues.map((s) => F(s, r, U())))
|
|
1734
|
+
}), t);
|
|
1756
1735
|
}
|
|
1757
|
-
const
|
|
1758
|
-
|
|
1736
|
+
const Do = /* @__PURE__ */ c("$ZodUnion", (e, t) => {
|
|
1737
|
+
z.init(e, t), y(e._zod, "optin", () => t.options.some((n) => n._zod.optin === "optional") ? "optional" : void 0), y(e._zod, "optout", () => t.options.some((n) => n._zod.optout === "optional") ? "optional" : void 0), y(e._zod, "values", () => {
|
|
1759
1738
|
if (t.options.every((n) => n._zod.values))
|
|
1760
1739
|
return new Set(t.options.flatMap((n) => Array.from(n._zod.values)));
|
|
1761
|
-
}),
|
|
1740
|
+
}), y(e._zod, "pattern", () => {
|
|
1762
1741
|
if (t.options.every((n) => n._zod.pattern)) {
|
|
1763
1742
|
const n = t.options.map((r) => r._zod.pattern);
|
|
1764
|
-
return new RegExp(`^(${n.map((r) =>
|
|
1743
|
+
return new RegExp(`^(${n.map((r) => $e(r.source)).join("|")})$`);
|
|
1765
1744
|
}
|
|
1766
1745
|
}), e._zod.parse = (n, r) => {
|
|
1767
1746
|
let o = !1;
|
|
@@ -1779,23 +1758,23 @@ const Ro = /* @__PURE__ */ c("$ZodUnion", (e, t) => {
|
|
|
1779
1758
|
i.push(u);
|
|
1780
1759
|
}
|
|
1781
1760
|
}
|
|
1782
|
-
return o ? Promise.all(i).then((s) =>
|
|
1761
|
+
return o ? Promise.all(i).then((s) => De(s, n, e, r)) : De(i, n, e, r);
|
|
1783
1762
|
};
|
|
1784
|
-
}),
|
|
1785
|
-
|
|
1763
|
+
}), Ro = /* @__PURE__ */ c("$ZodIntersection", (e, t) => {
|
|
1764
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
1786
1765
|
const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
|
|
1787
|
-
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([
|
|
1766
|
+
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([f, a]) => Re(n, f, a)) : Re(n, i, s);
|
|
1788
1767
|
};
|
|
1789
1768
|
});
|
|
1790
|
-
function
|
|
1769
|
+
function ye(e, t) {
|
|
1791
1770
|
if (e === t)
|
|
1792
1771
|
return { valid: !0, data: e };
|
|
1793
1772
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
1794
1773
|
return { valid: !0, data: e };
|
|
1795
|
-
if (
|
|
1774
|
+
if (be(e) && be(t)) {
|
|
1796
1775
|
const n = Object.keys(t), r = Object.keys(e).filter((i) => n.indexOf(i) !== -1), o = { ...e, ...t };
|
|
1797
1776
|
for (const i of r) {
|
|
1798
|
-
const s =
|
|
1777
|
+
const s = ye(e[i], t[i]);
|
|
1799
1778
|
if (!s.valid)
|
|
1800
1779
|
return {
|
|
1801
1780
|
valid: !1,
|
|
@@ -1810,7 +1789,7 @@ function be(e, t) {
|
|
|
1810
1789
|
return { valid: !1, mergeErrorPath: [] };
|
|
1811
1790
|
const n = [];
|
|
1812
1791
|
for (let r = 0; r < e.length; r++) {
|
|
1813
|
-
const o = e[r], i = t[r], s =
|
|
1792
|
+
const o = e[r], i = t[r], s = ye(o, i);
|
|
1814
1793
|
if (!s.valid)
|
|
1815
1794
|
return {
|
|
1816
1795
|
valid: !1,
|
|
@@ -1822,28 +1801,28 @@ function be(e, t) {
|
|
|
1822
1801
|
}
|
|
1823
1802
|
return { valid: !1, mergeErrorPath: [] };
|
|
1824
1803
|
}
|
|
1825
|
-
function
|
|
1826
|
-
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues),
|
|
1804
|
+
function Re(e, t, n) {
|
|
1805
|
+
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), K(e))
|
|
1827
1806
|
return e;
|
|
1828
|
-
const r =
|
|
1807
|
+
const r = ye(t.value, n.value);
|
|
1829
1808
|
if (!r.valid)
|
|
1830
1809
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
1831
1810
|
return e.value = r.data, e;
|
|
1832
1811
|
}
|
|
1833
1812
|
const Mo = /* @__PURE__ */ c("$ZodEnum", (e, t) => {
|
|
1834
|
-
|
|
1835
|
-
const n = Kn(t.entries);
|
|
1836
|
-
e._zod.values =
|
|
1837
|
-
const
|
|
1838
|
-
return
|
|
1813
|
+
z.init(e, t);
|
|
1814
|
+
const n = Kn(t.entries), r = new Set(n);
|
|
1815
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => qn.has(typeof o)).map((o) => typeof o == "string" ? fe(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
|
|
1816
|
+
const s = o.value;
|
|
1817
|
+
return r.has(s) || o.issues.push({
|
|
1839
1818
|
code: "invalid_value",
|
|
1840
1819
|
values: n,
|
|
1841
|
-
input:
|
|
1820
|
+
input: s,
|
|
1842
1821
|
inst: e
|
|
1843
|
-
}),
|
|
1822
|
+
}), o;
|
|
1844
1823
|
};
|
|
1845
1824
|
}), Uo = /* @__PURE__ */ c("$ZodFile", (e, t) => {
|
|
1846
|
-
|
|
1825
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
1847
1826
|
const o = n.value;
|
|
1848
1827
|
return o instanceof File || n.issues.push({
|
|
1849
1828
|
expected: "file",
|
|
@@ -1853,26 +1832,26 @@ const Mo = /* @__PURE__ */ c("$ZodEnum", (e, t) => {
|
|
|
1853
1832
|
}), n;
|
|
1854
1833
|
};
|
|
1855
1834
|
}), Fo = /* @__PURE__ */ c("$ZodTransform", (e, t) => {
|
|
1856
|
-
|
|
1835
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
1857
1836
|
const o = t.transform(n.value, n);
|
|
1858
1837
|
if (r.async)
|
|
1859
1838
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n));
|
|
1860
1839
|
if (o instanceof Promise)
|
|
1861
|
-
throw new
|
|
1840
|
+
throw new J();
|
|
1862
1841
|
return n.value = o, n;
|
|
1863
1842
|
};
|
|
1864
1843
|
}), To = /* @__PURE__ */ c("$ZodOptional", (e, t) => {
|
|
1865
|
-
|
|
1844
|
+
z.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", y(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), y(e._zod, "pattern", () => {
|
|
1866
1845
|
const n = t.innerType._zod.pattern;
|
|
1867
|
-
return n ? new RegExp(`^(${
|
|
1846
|
+
return n ? new RegExp(`^(${$e(n.source)})?$`) : void 0;
|
|
1868
1847
|
}), e._zod.parse = (n, r) => t.innerType._zod.optin === "optional" ? t.innerType._zod.run(n, r) : n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
1869
1848
|
}), Lo = /* @__PURE__ */ c("$ZodNullable", (e, t) => {
|
|
1870
|
-
|
|
1849
|
+
z.init(e, t), y(e._zod, "optin", () => t.innerType._zod.optin), y(e._zod, "optout", () => t.innerType._zod.optout), y(e._zod, "pattern", () => {
|
|
1871
1850
|
const n = t.innerType._zod.pattern;
|
|
1872
|
-
return n ? new RegExp(`^(${
|
|
1873
|
-
}),
|
|
1851
|
+
return n ? new RegExp(`^(${$e(n.source)}|null)$`) : void 0;
|
|
1852
|
+
}), y(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
1874
1853
|
}), Bo = /* @__PURE__ */ c("$ZodDefault", (e, t) => {
|
|
1875
|
-
|
|
1854
|
+
z.init(e, t), e._zod.optin = "optional", y(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1876
1855
|
if (n.value === void 0)
|
|
1877
1856
|
return n.value = t.defaultValue, n;
|
|
1878
1857
|
const o = t.innerType._zod.run(n, r);
|
|
@@ -1883,9 +1862,9 @@ function Me(e, t) {
|
|
|
1883
1862
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1884
1863
|
}
|
|
1885
1864
|
const Wo = /* @__PURE__ */ c("$ZodPrefault", (e, t) => {
|
|
1886
|
-
|
|
1865
|
+
z.init(e, t), e._zod.optin = "optional", y(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
1887
1866
|
}), Vo = /* @__PURE__ */ c("$ZodNonOptional", (e, t) => {
|
|
1888
|
-
|
|
1867
|
+
z.init(e, t), y(e._zod, "values", () => {
|
|
1889
1868
|
const n = t.innerType._zod.values;
|
|
1890
1869
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
1891
1870
|
}), e._zod.parse = (n, r) => {
|
|
@@ -1902,7 +1881,7 @@ function Ue(e, t) {
|
|
|
1902
1881
|
}), e;
|
|
1903
1882
|
}
|
|
1904
1883
|
const Go = /* @__PURE__ */ c("$ZodCatch", (e, t) => {
|
|
1905
|
-
|
|
1884
|
+
z.init(e, t), y(e._zod, "optin", () => t.innerType._zod.optin), y(e._zod, "optout", () => t.innerType._zod.optout), y(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1906
1885
|
const o = t.innerType._zod.run(n, r);
|
|
1907
1886
|
return o instanceof Promise ? o.then((i) => (n.value = i.value, i.issues.length && (n.value = t.catchValue({
|
|
1908
1887
|
...n,
|
|
@@ -1918,17 +1897,17 @@ const Go = /* @__PURE__ */ c("$ZodCatch", (e, t) => {
|
|
|
1918
1897
|
input: n.value
|
|
1919
1898
|
}), n.issues = []), n);
|
|
1920
1899
|
};
|
|
1921
|
-
}),
|
|
1922
|
-
|
|
1900
|
+
}), Co = /* @__PURE__ */ c("$ZodPipe", (e, t) => {
|
|
1901
|
+
z.init(e, t), y(e._zod, "values", () => t.in._zod.values), y(e._zod, "optin", () => t.in._zod.optin), y(e._zod, "optout", () => t.out._zod.optout), y(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
1923
1902
|
const o = t.in._zod.run(n, r);
|
|
1924
1903
|
return o instanceof Promise ? o.then((i) => Fe(i, t, r)) : Fe(o, t, r);
|
|
1925
1904
|
};
|
|
1926
1905
|
});
|
|
1927
1906
|
function Fe(e, t, n) {
|
|
1928
|
-
return
|
|
1907
|
+
return e.issues.length ? e : t.out._zod.run({ value: e.value, issues: e.issues }, n);
|
|
1929
1908
|
}
|
|
1930
|
-
const
|
|
1931
|
-
|
|
1909
|
+
const Ko = /* @__PURE__ */ c("$ZodReadonly", (e, t) => {
|
|
1910
|
+
z.init(e, t), y(e._zod, "propValues", () => t.innerType._zod.propValues), y(e._zod, "values", () => t.innerType._zod.values), y(e._zod, "optin", () => t.innerType._zod.optin), y(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, r) => {
|
|
1932
1911
|
const o = t.innerType._zod.run(n, r);
|
|
1933
1912
|
return o instanceof Promise ? o.then(Te) : Te(o);
|
|
1934
1913
|
};
|
|
@@ -1937,7 +1916,7 @@ function Te(e) {
|
|
|
1937
1916
|
return e.value = Object.freeze(e.value), e;
|
|
1938
1917
|
}
|
|
1939
1918
|
const Jo = /* @__PURE__ */ c("$ZodCustom", (e, t) => {
|
|
1940
|
-
A.init(e, t),
|
|
1919
|
+
A.init(e, t), z.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
1941
1920
|
const r = n.value, o = t.fn(r);
|
|
1942
1921
|
if (o instanceof Promise)
|
|
1943
1922
|
return o.then((i) => Le(i, n, r, e));
|
|
@@ -1956,7 +1935,7 @@ function Le(e, t, n, r) {
|
|
|
1956
1935
|
continue: !r._zod.def.abort
|
|
1957
1936
|
// params: inst._zod.def.params,
|
|
1958
1937
|
};
|
|
1959
|
-
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(
|
|
1938
|
+
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(Y(o));
|
|
1960
1939
|
}
|
|
1961
1940
|
}
|
|
1962
1941
|
class Yo {
|
|
@@ -1983,7 +1962,9 @@ class Yo {
|
|
|
1983
1962
|
const n = t._zod.parent;
|
|
1984
1963
|
if (n) {
|
|
1985
1964
|
const r = { ...this.get(n) ?? {} };
|
|
1986
|
-
|
|
1965
|
+
delete r.id;
|
|
1966
|
+
const o = { ...r, ...this._map.get(t) };
|
|
1967
|
+
return Object.keys(o).length ? o : void 0;
|
|
1987
1968
|
}
|
|
1988
1969
|
return this._map.get(t);
|
|
1989
1970
|
}
|
|
@@ -2001,7 +1982,7 @@ function Xo(e, t) {
|
|
|
2001
1982
|
...l(t)
|
|
2002
1983
|
});
|
|
2003
1984
|
}
|
|
2004
|
-
function
|
|
1985
|
+
function Jt(e, t) {
|
|
2005
1986
|
return new e({
|
|
2006
1987
|
type: "string",
|
|
2007
1988
|
format: "email",
|
|
@@ -2058,7 +2039,7 @@ function ti(e, t) {
|
|
|
2058
2039
|
...l(t)
|
|
2059
2040
|
});
|
|
2060
2041
|
}
|
|
2061
|
-
function
|
|
2042
|
+
function Yt(e, t) {
|
|
2062
2043
|
return new e({
|
|
2063
2044
|
type: "string",
|
|
2064
2045
|
format: "url",
|
|
@@ -2112,7 +2093,7 @@ function si(e, t) {
|
|
|
2112
2093
|
...l(t)
|
|
2113
2094
|
});
|
|
2114
2095
|
}
|
|
2115
|
-
function
|
|
2096
|
+
function ci(e, t) {
|
|
2116
2097
|
return new e({
|
|
2117
2098
|
type: "string",
|
|
2118
2099
|
format: "xid",
|
|
@@ -2121,7 +2102,7 @@ function ui(e, t) {
|
|
|
2121
2102
|
...l(t)
|
|
2122
2103
|
});
|
|
2123
2104
|
}
|
|
2124
|
-
function
|
|
2105
|
+
function ui(e, t) {
|
|
2125
2106
|
return new e({
|
|
2126
2107
|
type: "string",
|
|
2127
2108
|
format: "ksuid",
|
|
@@ -2130,7 +2111,7 @@ function ci(e, t) {
|
|
|
2130
2111
|
...l(t)
|
|
2131
2112
|
});
|
|
2132
2113
|
}
|
|
2133
|
-
function
|
|
2114
|
+
function qt(e, t) {
|
|
2134
2115
|
return new e({
|
|
2135
2116
|
type: "string",
|
|
2136
2117
|
format: "ipv4",
|
|
@@ -2166,7 +2147,7 @@ function li(e, t) {
|
|
|
2166
2147
|
...l(t)
|
|
2167
2148
|
});
|
|
2168
2149
|
}
|
|
2169
|
-
function
|
|
2150
|
+
function pi(e, t) {
|
|
2170
2151
|
return new e({
|
|
2171
2152
|
type: "string",
|
|
2172
2153
|
format: "base64",
|
|
@@ -2175,7 +2156,7 @@ function di(e, t) {
|
|
|
2175
2156
|
...l(t)
|
|
2176
2157
|
});
|
|
2177
2158
|
}
|
|
2178
|
-
function
|
|
2159
|
+
function mi(e, t) {
|
|
2179
2160
|
return new e({
|
|
2180
2161
|
type: "string",
|
|
2181
2162
|
format: "base64url",
|
|
@@ -2184,7 +2165,7 @@ function hi(e, t) {
|
|
|
2184
2165
|
...l(t)
|
|
2185
2166
|
});
|
|
2186
2167
|
}
|
|
2187
|
-
function
|
|
2168
|
+
function hi(e, t) {
|
|
2188
2169
|
return new e({
|
|
2189
2170
|
type: "string",
|
|
2190
2171
|
format: "e164",
|
|
@@ -2193,7 +2174,7 @@ function pi(e, t) {
|
|
|
2193
2174
|
...l(t)
|
|
2194
2175
|
});
|
|
2195
2176
|
}
|
|
2196
|
-
function
|
|
2177
|
+
function di(e, t) {
|
|
2197
2178
|
return new e({
|
|
2198
2179
|
type: "string",
|
|
2199
2180
|
format: "jwt",
|
|
@@ -2283,7 +2264,7 @@ function Ii(e, t) {
|
|
|
2283
2264
|
});
|
|
2284
2265
|
}
|
|
2285
2266
|
function We(e, t) {
|
|
2286
|
-
return new
|
|
2267
|
+
return new Vt({
|
|
2287
2268
|
check: "less_than",
|
|
2288
2269
|
...l(t),
|
|
2289
2270
|
value: e,
|
|
@@ -2291,7 +2272,7 @@ function We(e, t) {
|
|
|
2291
2272
|
});
|
|
2292
2273
|
}
|
|
2293
2274
|
function ie(e, t) {
|
|
2294
|
-
return new
|
|
2275
|
+
return new Vt({
|
|
2295
2276
|
check: "less_than",
|
|
2296
2277
|
...l(t),
|
|
2297
2278
|
value: e,
|
|
@@ -2299,7 +2280,7 @@ function ie(e, t) {
|
|
|
2299
2280
|
});
|
|
2300
2281
|
}
|
|
2301
2282
|
function Ve(e, t) {
|
|
2302
|
-
return new
|
|
2283
|
+
return new Gt({
|
|
2303
2284
|
check: "greater_than",
|
|
2304
2285
|
...l(t),
|
|
2305
2286
|
value: e,
|
|
@@ -2307,7 +2288,7 @@ function Ve(e, t) {
|
|
|
2307
2288
|
});
|
|
2308
2289
|
}
|
|
2309
2290
|
function se(e, t) {
|
|
2310
|
-
return new
|
|
2291
|
+
return new Gt({
|
|
2311
2292
|
check: "greater_than",
|
|
2312
2293
|
...l(t),
|
|
2313
2294
|
value: e,
|
|
@@ -2335,7 +2316,7 @@ function Ai(e, t) {
|
|
|
2335
2316
|
minimum: e
|
|
2336
2317
|
});
|
|
2337
2318
|
}
|
|
2338
|
-
function
|
|
2319
|
+
function Xt(e, t) {
|
|
2339
2320
|
return new Br({
|
|
2340
2321
|
check: "max_length",
|
|
2341
2322
|
...l(t),
|
|
@@ -2349,14 +2330,14 @@ function ae(e, t) {
|
|
|
2349
2330
|
minimum: e
|
|
2350
2331
|
});
|
|
2351
2332
|
}
|
|
2352
|
-
function
|
|
2333
|
+
function Ht(e, t) {
|
|
2353
2334
|
return new Vr({
|
|
2354
2335
|
check: "length_equals",
|
|
2355
2336
|
...l(t),
|
|
2356
2337
|
length: e
|
|
2357
2338
|
});
|
|
2358
2339
|
}
|
|
2359
|
-
function
|
|
2340
|
+
function xi(e, t) {
|
|
2360
2341
|
return new Gr({
|
|
2361
2342
|
check: "string_format",
|
|
2362
2343
|
format: "regex",
|
|
@@ -2364,15 +2345,15 @@ function Oi(e, t) {
|
|
|
2364
2345
|
pattern: e
|
|
2365
2346
|
});
|
|
2366
2347
|
}
|
|
2367
|
-
function
|
|
2368
|
-
return new
|
|
2348
|
+
function Oi(e) {
|
|
2349
|
+
return new Cr({
|
|
2369
2350
|
check: "string_format",
|
|
2370
2351
|
format: "lowercase",
|
|
2371
2352
|
...l(e)
|
|
2372
2353
|
});
|
|
2373
2354
|
}
|
|
2374
|
-
function
|
|
2375
|
-
return new
|
|
2355
|
+
function Si(e) {
|
|
2356
|
+
return new Kr({
|
|
2376
2357
|
check: "string_format",
|
|
2377
2358
|
format: "uppercase",
|
|
2378
2359
|
...l(e)
|
|
@@ -2402,30 +2383,30 @@ function Ni(e, t) {
|
|
|
2402
2383
|
suffix: e
|
|
2403
2384
|
});
|
|
2404
2385
|
}
|
|
2405
|
-
function
|
|
2386
|
+
function Di(e, t) {
|
|
2406
2387
|
return new Xr({
|
|
2407
2388
|
check: "mime_type",
|
|
2408
2389
|
mime: e,
|
|
2409
2390
|
...l(t)
|
|
2410
2391
|
});
|
|
2411
2392
|
}
|
|
2412
|
-
function
|
|
2393
|
+
function X(e) {
|
|
2413
2394
|
return new Hr({
|
|
2414
2395
|
check: "overwrite",
|
|
2415
2396
|
tx: e
|
|
2416
2397
|
});
|
|
2417
2398
|
}
|
|
2418
|
-
function
|
|
2419
|
-
return
|
|
2399
|
+
function Ri(e) {
|
|
2400
|
+
return X((t) => t.normalize(e));
|
|
2420
2401
|
}
|
|
2421
2402
|
function Mi() {
|
|
2422
|
-
return
|
|
2403
|
+
return X((e) => e.trim());
|
|
2423
2404
|
}
|
|
2424
2405
|
function Ui() {
|
|
2425
|
-
return
|
|
2406
|
+
return X((e) => e.toLowerCase());
|
|
2426
2407
|
}
|
|
2427
2408
|
function Fi() {
|
|
2428
|
-
return
|
|
2409
|
+
return X((e) => e.toUpperCase());
|
|
2429
2410
|
}
|
|
2430
2411
|
function Ti(e, t, n) {
|
|
2431
2412
|
return new e({
|
|
@@ -2452,25 +2433,25 @@ function Bi(e, t, n) {
|
|
|
2452
2433
|
});
|
|
2453
2434
|
}
|
|
2454
2435
|
const Wi = /* @__PURE__ */ c("ZodISODateTime", (e, t) => {
|
|
2455
|
-
|
|
2436
|
+
po.init(e, t), k.init(e, t);
|
|
2456
2437
|
});
|
|
2457
2438
|
function Vi(e) {
|
|
2458
2439
|
return gi(Wi, e);
|
|
2459
2440
|
}
|
|
2460
2441
|
const Gi = /* @__PURE__ */ c("ZodISODate", (e, t) => {
|
|
2461
|
-
|
|
2442
|
+
mo.init(e, t), k.init(e, t);
|
|
2462
2443
|
});
|
|
2463
|
-
function
|
|
2444
|
+
function Ci(e) {
|
|
2464
2445
|
return _i(Gi, e);
|
|
2465
2446
|
}
|
|
2466
|
-
const
|
|
2467
|
-
|
|
2447
|
+
const Ki = /* @__PURE__ */ c("ZodISOTime", (e, t) => {
|
|
2448
|
+
ho.init(e, t), k.init(e, t);
|
|
2468
2449
|
});
|
|
2469
2450
|
function Ji(e) {
|
|
2470
|
-
return vi(
|
|
2451
|
+
return vi(Ki, e);
|
|
2471
2452
|
}
|
|
2472
2453
|
const Yi = /* @__PURE__ */ c("ZodISODuration", (e, t) => {
|
|
2473
|
-
go.init(e, t),
|
|
2454
|
+
go.init(e, t), k.init(e, t);
|
|
2474
2455
|
});
|
|
2475
2456
|
function qi(e) {
|
|
2476
2457
|
return bi(Yi, e);
|
|
@@ -2486,11 +2467,15 @@ const Xi = (e, t) => {
|
|
|
2486
2467
|
// enumerable: false,
|
|
2487
2468
|
},
|
|
2488
2469
|
addIssue: {
|
|
2489
|
-
value: (n) =>
|
|
2470
|
+
value: (n) => {
|
|
2471
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, _e, 2);
|
|
2472
|
+
}
|
|
2490
2473
|
// enumerable: false,
|
|
2491
2474
|
},
|
|
2492
2475
|
addIssues: {
|
|
2493
|
-
value: (n) =>
|
|
2476
|
+
value: (n) => {
|
|
2477
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, _e, 2);
|
|
2478
|
+
}
|
|
2494
2479
|
// enumerable: false,
|
|
2495
2480
|
},
|
|
2496
2481
|
isEmpty: {
|
|
@@ -2500,9 +2485,9 @@ const Xi = (e, t) => {
|
|
|
2500
2485
|
// enumerable: false,
|
|
2501
2486
|
}
|
|
2502
2487
|
});
|
|
2503
|
-
},
|
|
2488
|
+
}, pe = c("ZodError", Xi, {
|
|
2504
2489
|
Parent: Error
|
|
2505
|
-
}), Hi = /* @__PURE__ */
|
|
2490
|
+
}), Hi = /* @__PURE__ */ cr(pe), Qi = /* @__PURE__ */ ur(pe), es = /* @__PURE__ */ Ut(pe), ts = /* @__PURE__ */ Ft(pe), Z = /* @__PURE__ */ c("ZodType", (e, t) => (z.init(e, t), e.def = t, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(
|
|
2506
2491
|
{
|
|
2507
2492
|
...t,
|
|
2508
2493
|
checks: [
|
|
@@ -2511,13 +2496,12 @@ const Xi = (e, t) => {
|
|
|
2511
2496
|
]
|
|
2512
2497
|
}
|
|
2513
2498
|
// { parent: true }
|
|
2514
|
-
), e.clone = (n, r) =>
|
|
2499
|
+
), e.clone = (n, r) => L(e, n, r), e.brand = () => e, e.register = (n, r) => (n.add(e, r), e), e.parse = (n, r) => Hi(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => es(e, n, r), e.parseAsync = async (n, r) => Qi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ts(e, n, r), e.spa = e.safeParseAsync, e.refine = (n, r) => e.check(Ys(n, r)), e.superRefine = (n) => e.check(qs(n)), e.overwrite = (n) => e.check(X(n)), e.optional = () => Ye(e), e.nullable = () => qe(e), e.nullish = () => Ye(qe(e)), e.nonoptional = (n) => Ls(e, n), e.array = () => x(e), e.or = (n) => cn([e, n]), e.and = (n) => un(e, n), e.transform = (n) => Xe(e, Ds(n)), e.default = (n) => Us(e, n), e.prefault = (n) => Ts(e, n), e.catch = (n) => Ws(e, n), e.pipe = (n) => Xe(e, n), e.readonly = () => Cs(e), e.describe = (n) => {
|
|
2515
2500
|
const r = e.clone();
|
|
2516
2501
|
return ne.add(r, { description: n }), r;
|
|
2517
2502
|
}, Object.defineProperty(e, "description", {
|
|
2518
2503
|
get() {
|
|
2519
|
-
|
|
2520
|
-
return (n = ne.get(e)) == null ? void 0 : n.description;
|
|
2504
|
+
return ne.get(e)?.description;
|
|
2521
2505
|
},
|
|
2522
2506
|
configurable: !0
|
|
2523
2507
|
}), e.meta = (...n) => {
|
|
@@ -2525,108 +2509,108 @@ const Xi = (e, t) => {
|
|
|
2525
2509
|
return ne.get(e);
|
|
2526
2510
|
const r = e.clone();
|
|
2527
2511
|
return ne.add(r, n[0]), r;
|
|
2528
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
2529
|
-
|
|
2512
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Qt = /* @__PURE__ */ c("_ZodString", (e, t) => {
|
|
2513
|
+
ke.init(e, t), Z.init(e, t);
|
|
2530
2514
|
const n = e._zod.bag;
|
|
2531
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(
|
|
2515
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(xi(...r)), e.includes = (...r) => e.check(Pi(...r)), e.startsWith = (...r) => e.check(ji(...r)), e.endsWith = (...r) => e.check(Ni(...r)), e.min = (...r) => e.check(ae(...r)), e.max = (...r) => e.check(Xt(...r)), e.length = (...r) => e.check(Ht(...r)), e.nonempty = (...r) => e.check(ae(1, ...r)), e.lowercase = (r) => e.check(Oi(r)), e.uppercase = (r) => e.check(Si(r)), e.trim = () => e.check(Mi()), e.normalize = (...r) => e.check(Ri(...r)), e.toLowerCase = () => e.check(Ui()), e.toUpperCase = () => e.check(Fi());
|
|
2532
2516
|
}), ns = /* @__PURE__ */ c("ZodString", (e, t) => {
|
|
2533
|
-
|
|
2517
|
+
ke.init(e, t), Qt.init(e, t), e.email = (n) => e.check(Jt(en, n)), e.url = (n) => e.check(Yt(nn, n)), e.jwt = (n) => e.check(di(_s, n)), e.emoji = (n) => e.check(ni(rs, n)), e.guid = (n) => e.check(Be(Ce, n)), e.uuid = (n) => e.check(Ho(re, n)), e.uuidv4 = (n) => e.check(Qo(re, n)), e.uuidv6 = (n) => e.check(ei(re, n)), e.uuidv7 = (n) => e.check(ti(re, n)), e.nanoid = (n) => e.check(ri(os, n)), e.guid = (n) => e.check(Be(Ce, n)), e.cuid = (n) => e.check(oi(is, n)), e.cuid2 = (n) => e.check(ii(ss, n)), e.ulid = (n) => e.check(si(cs, n)), e.base64 = (n) => e.check(pi(hs, n)), e.base64url = (n) => e.check(mi(ds, n)), e.xid = (n) => e.check(ci(us, n)), e.ksuid = (n) => e.check(ui(as, n)), e.ipv4 = (n) => e.check(qt(on, n)), e.ipv6 = (n) => e.check(ai(ls, n)), e.cidrv4 = (n) => e.check(fi(ps, n)), e.cidrv6 = (n) => e.check(li(ms, n)), e.e164 = (n) => e.check(hi(gs, n)), e.datetime = (n) => e.check(Vi(n)), e.date = (n) => e.check(Ci(n)), e.time = (n) => e.check(Ji(n)), e.duration = (n) => e.check(qi(n));
|
|
2534
2518
|
});
|
|
2535
2519
|
function M(e) {
|
|
2536
2520
|
return Xo(ns, e);
|
|
2537
2521
|
}
|
|
2538
|
-
const
|
|
2539
|
-
|
|
2540
|
-
}),
|
|
2541
|
-
ro.init(e, t),
|
|
2522
|
+
const k = /* @__PURE__ */ c("ZodStringFormat", (e, t) => {
|
|
2523
|
+
w.init(e, t), Qt.init(e, t);
|
|
2524
|
+
}), en = /* @__PURE__ */ c("ZodEmail", (e, t) => {
|
|
2525
|
+
ro.init(e, t), k.init(e, t);
|
|
2542
2526
|
});
|
|
2543
|
-
function
|
|
2544
|
-
return
|
|
2527
|
+
function tn(e) {
|
|
2528
|
+
return Jt(en, e);
|
|
2545
2529
|
}
|
|
2546
|
-
const
|
|
2547
|
-
to.init(e, t),
|
|
2530
|
+
const Ce = /* @__PURE__ */ c("ZodGUID", (e, t) => {
|
|
2531
|
+
to.init(e, t), k.init(e, t);
|
|
2548
2532
|
}), re = /* @__PURE__ */ c("ZodUUID", (e, t) => {
|
|
2549
|
-
no.init(e, t),
|
|
2550
|
-
}),
|
|
2551
|
-
oo.init(e, t),
|
|
2533
|
+
no.init(e, t), k.init(e, t);
|
|
2534
|
+
}), nn = /* @__PURE__ */ c("ZodURL", (e, t) => {
|
|
2535
|
+
oo.init(e, t), k.init(e, t);
|
|
2552
2536
|
});
|
|
2553
|
-
function
|
|
2554
|
-
return
|
|
2537
|
+
function rn(e) {
|
|
2538
|
+
return Yt(nn, e);
|
|
2555
2539
|
}
|
|
2556
2540
|
const rs = /* @__PURE__ */ c("ZodEmoji", (e, t) => {
|
|
2557
|
-
io.init(e, t),
|
|
2541
|
+
io.init(e, t), k.init(e, t);
|
|
2558
2542
|
}), os = /* @__PURE__ */ c("ZodNanoID", (e, t) => {
|
|
2559
|
-
so.init(e, t),
|
|
2543
|
+
so.init(e, t), k.init(e, t);
|
|
2560
2544
|
}), is = /* @__PURE__ */ c("ZodCUID", (e, t) => {
|
|
2561
|
-
|
|
2545
|
+
co.init(e, t), k.init(e, t);
|
|
2562
2546
|
}), ss = /* @__PURE__ */ c("ZodCUID2", (e, t) => {
|
|
2563
|
-
|
|
2564
|
-
}),
|
|
2565
|
-
ao.init(e, t),
|
|
2566
|
-
}),
|
|
2567
|
-
fo.init(e, t),
|
|
2547
|
+
uo.init(e, t), k.init(e, t);
|
|
2548
|
+
}), cs = /* @__PURE__ */ c("ZodULID", (e, t) => {
|
|
2549
|
+
ao.init(e, t), k.init(e, t);
|
|
2550
|
+
}), us = /* @__PURE__ */ c("ZodXID", (e, t) => {
|
|
2551
|
+
fo.init(e, t), k.init(e, t);
|
|
2568
2552
|
}), as = /* @__PURE__ */ c("ZodKSUID", (e, t) => {
|
|
2569
|
-
lo.init(e, t),
|
|
2570
|
-
}),
|
|
2571
|
-
_o.init(e, t),
|
|
2553
|
+
lo.init(e, t), k.init(e, t);
|
|
2554
|
+
}), on = /* @__PURE__ */ c("ZodIPv4", (e, t) => {
|
|
2555
|
+
_o.init(e, t), k.init(e, t);
|
|
2572
2556
|
});
|
|
2573
2557
|
function fs(e) {
|
|
2574
|
-
return
|
|
2558
|
+
return qt(on, e);
|
|
2575
2559
|
}
|
|
2576
2560
|
const ls = /* @__PURE__ */ c("ZodIPv6", (e, t) => {
|
|
2577
|
-
vo.init(e, t),
|
|
2578
|
-
}),
|
|
2579
|
-
bo.init(e, t),
|
|
2580
|
-
}),
|
|
2581
|
-
yo.init(e, t),
|
|
2582
|
-
}),
|
|
2583
|
-
zo.init(e, t),
|
|
2584
|
-
}),
|
|
2585
|
-
$o.init(e, t),
|
|
2561
|
+
vo.init(e, t), k.init(e, t);
|
|
2562
|
+
}), ps = /* @__PURE__ */ c("ZodCIDRv4", (e, t) => {
|
|
2563
|
+
bo.init(e, t), k.init(e, t);
|
|
2564
|
+
}), ms = /* @__PURE__ */ c("ZodCIDRv6", (e, t) => {
|
|
2565
|
+
yo.init(e, t), k.init(e, t);
|
|
2566
|
+
}), hs = /* @__PURE__ */ c("ZodBase64", (e, t) => {
|
|
2567
|
+
zo.init(e, t), k.init(e, t);
|
|
2568
|
+
}), ds = /* @__PURE__ */ c("ZodBase64URL", (e, t) => {
|
|
2569
|
+
$o.init(e, t), k.init(e, t);
|
|
2586
2570
|
}), gs = /* @__PURE__ */ c("ZodE164", (e, t) => {
|
|
2587
|
-
Zo.init(e, t),
|
|
2571
|
+
Zo.init(e, t), k.init(e, t);
|
|
2588
2572
|
}), _s = /* @__PURE__ */ c("ZodJWT", (e, t) => {
|
|
2589
|
-
Io.init(e, t),
|
|
2590
|
-
}),
|
|
2591
|
-
Kt.init(e, t),
|
|
2573
|
+
Io.init(e, t), k.init(e, t);
|
|
2574
|
+
}), sn = /* @__PURE__ */ c("ZodNumber", (e, t) => {
|
|
2575
|
+
Kt.init(e, t), Z.init(e, t), e.gt = (r, o) => e.check(Ve(r, o)), e.gte = (r, o) => e.check(se(r, o)), e.min = (r, o) => e.check(se(r, o)), e.lt = (r, o) => e.check(We(r, o)), e.lte = (r, o) => e.check(ie(r, o)), e.max = (r, o) => e.check(ie(r, o)), e.int = (r) => e.check(Ke(r)), e.safe = (r) => e.check(Ke(r)), e.positive = (r) => e.check(Ve(0, r)), e.nonnegative = (r) => e.check(se(0, r)), e.negative = (r) => e.check(We(0, r)), e.nonpositive = (r) => e.check(ie(0, r)), e.multipleOf = (r, o) => e.check(Ge(r, o)), e.step = (r, o) => e.check(Ge(r, o)), e.finite = () => e;
|
|
2592
2576
|
const n = e._zod.bag;
|
|
2593
2577
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2594
2578
|
});
|
|
2595
|
-
function
|
|
2596
|
-
return yi(
|
|
2579
|
+
function R(e) {
|
|
2580
|
+
return yi(sn, e);
|
|
2597
2581
|
}
|
|
2598
2582
|
const vs = /* @__PURE__ */ c("ZodNumberFormat", (e, t) => {
|
|
2599
|
-
Eo.init(e, t),
|
|
2583
|
+
Eo.init(e, t), sn.init(e, t);
|
|
2600
2584
|
});
|
|
2601
|
-
function
|
|
2585
|
+
function Ke(e) {
|
|
2602
2586
|
return zi(vs, e);
|
|
2603
2587
|
}
|
|
2604
2588
|
const bs = /* @__PURE__ */ c("ZodBoolean", (e, t) => {
|
|
2605
|
-
Ao.init(e, t),
|
|
2589
|
+
Ao.init(e, t), Z.init(e, t);
|
|
2606
2590
|
});
|
|
2607
2591
|
function ys(e) {
|
|
2608
2592
|
return wi(bs, e);
|
|
2609
2593
|
}
|
|
2610
2594
|
const zs = /* @__PURE__ */ c("ZodAny", (e, t) => {
|
|
2611
|
-
|
|
2595
|
+
xo.init(e, t), Z.init(e, t);
|
|
2612
2596
|
});
|
|
2613
|
-
function
|
|
2597
|
+
function D() {
|
|
2614
2598
|
return $i(zs);
|
|
2615
2599
|
}
|
|
2616
2600
|
const ws = /* @__PURE__ */ c("ZodUnknown", (e, t) => {
|
|
2617
|
-
|
|
2601
|
+
Oo.init(e, t), Z.init(e, t);
|
|
2618
2602
|
});
|
|
2619
2603
|
function Je() {
|
|
2620
2604
|
return Zi(ws);
|
|
2621
2605
|
}
|
|
2622
2606
|
const $s = /* @__PURE__ */ c("ZodNever", (e, t) => {
|
|
2623
|
-
|
|
2607
|
+
So.init(e, t), Z.init(e, t);
|
|
2624
2608
|
});
|
|
2625
2609
|
function Zs(e) {
|
|
2626
2610
|
return ki($s, e);
|
|
2627
2611
|
}
|
|
2628
2612
|
const ks = /* @__PURE__ */ c("ZodDate", (e, t) => {
|
|
2629
|
-
Po.init(e, t),
|
|
2613
|
+
Po.init(e, t), Z.init(e, t), e.min = (r, o) => e.check(se(r, o)), e.max = (r, o) => e.check(ie(r, o));
|
|
2630
2614
|
const n = e._zod.bag;
|
|
2631
2615
|
e.minDate = n.minimum ? new Date(n.minimum) : null, e.maxDate = n.maximum ? new Date(n.maximum) : null;
|
|
2632
2616
|
});
|
|
@@ -2634,46 +2618,46 @@ function Is(e) {
|
|
|
2634
2618
|
return Ii(ks, e);
|
|
2635
2619
|
}
|
|
2636
2620
|
const Es = /* @__PURE__ */ c("ZodArray", (e, t) => {
|
|
2637
|
-
jo.init(e, t),
|
|
2621
|
+
jo.init(e, t), Z.init(e, t), e.element = t.element, e.min = (n, r) => e.check(ae(n, r)), e.nonempty = (n) => e.check(ae(1, n)), e.max = (n, r) => e.check(Xt(n, r)), e.length = (n, r) => e.check(Ht(n, r)), e.unwrap = () => e.element;
|
|
2638
2622
|
});
|
|
2639
|
-
function
|
|
2623
|
+
function x(e, t) {
|
|
2640
2624
|
return Ti(Es, e, t);
|
|
2641
2625
|
}
|
|
2642
2626
|
const As = /* @__PURE__ */ c("ZodObject", (e, t) => {
|
|
2643
|
-
No.init(e, t),
|
|
2627
|
+
No.init(e, t), Z.init(e, t), y(e, "shape", () => t.shape), e.keyof = () => Ps(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Je() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Je() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Zs() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => tr(e, n), e.merge = (n) => nr(e, n), e.pick = (n) => Qn(e, n), e.omit = (n) => er(e, n), e.partial = (...n) => rr(an, e, n[0]), e.required = (...n) => or(fn, e, n[0]);
|
|
2644
2628
|
});
|
|
2645
|
-
function
|
|
2629
|
+
function xs(e, t) {
|
|
2646
2630
|
const n = {
|
|
2647
2631
|
type: "object",
|
|
2648
2632
|
get shape() {
|
|
2649
|
-
return
|
|
2633
|
+
return T(this, "shape", { ...e }), this.shape;
|
|
2650
2634
|
},
|
|
2651
2635
|
...l(t)
|
|
2652
2636
|
};
|
|
2653
2637
|
return new As(n);
|
|
2654
2638
|
}
|
|
2655
|
-
const
|
|
2656
|
-
|
|
2639
|
+
const Os = /* @__PURE__ */ c("ZodUnion", (e, t) => {
|
|
2640
|
+
Do.init(e, t), Z.init(e, t), e.options = t.options;
|
|
2657
2641
|
});
|
|
2658
|
-
function
|
|
2659
|
-
return new
|
|
2642
|
+
function cn(e, t) {
|
|
2643
|
+
return new Os({
|
|
2660
2644
|
type: "union",
|
|
2661
2645
|
options: e,
|
|
2662
2646
|
...l(t)
|
|
2663
2647
|
});
|
|
2664
2648
|
}
|
|
2665
|
-
const
|
|
2666
|
-
|
|
2649
|
+
const Ss = /* @__PURE__ */ c("ZodIntersection", (e, t) => {
|
|
2650
|
+
Ro.init(e, t), Z.init(e, t);
|
|
2667
2651
|
});
|
|
2668
2652
|
function un(e, t) {
|
|
2669
|
-
return new
|
|
2653
|
+
return new Ss({
|
|
2670
2654
|
type: "intersection",
|
|
2671
2655
|
left: e,
|
|
2672
2656
|
right: t
|
|
2673
2657
|
});
|
|
2674
2658
|
}
|
|
2675
|
-
const
|
|
2676
|
-
Mo.init(e, t),
|
|
2659
|
+
const ze = /* @__PURE__ */ c("ZodEnum", (e, t) => {
|
|
2660
|
+
Mo.init(e, t), Z.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2677
2661
|
const n = new Set(Object.keys(t.entries));
|
|
2678
2662
|
e.extract = (r, o) => {
|
|
2679
2663
|
const i = {};
|
|
@@ -2682,7 +2666,7 @@ const ye = /* @__PURE__ */ c("ZodEnum", (e, t) => {
|
|
|
2682
2666
|
i[s] = t.entries[s];
|
|
2683
2667
|
else
|
|
2684
2668
|
throw new Error(`Key ${s} not found in enum`);
|
|
2685
|
-
return new
|
|
2669
|
+
return new ze({
|
|
2686
2670
|
...t,
|
|
2687
2671
|
checks: [],
|
|
2688
2672
|
...l(o),
|
|
@@ -2695,7 +2679,7 @@ const ye = /* @__PURE__ */ c("ZodEnum", (e, t) => {
|
|
|
2695
2679
|
delete i[s];
|
|
2696
2680
|
else
|
|
2697
2681
|
throw new Error(`Key ${s} not found in enum`);
|
|
2698
|
-
return new
|
|
2682
|
+
return new ze({
|
|
2699
2683
|
...t,
|
|
2700
2684
|
checks: [],
|
|
2701
2685
|
...l(o),
|
|
@@ -2705,58 +2689,58 @@ const ye = /* @__PURE__ */ c("ZodEnum", (e, t) => {
|
|
|
2705
2689
|
});
|
|
2706
2690
|
function Ps(e, t) {
|
|
2707
2691
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2708
|
-
return new
|
|
2692
|
+
return new ze({
|
|
2709
2693
|
type: "enum",
|
|
2710
2694
|
entries: n,
|
|
2711
2695
|
...l(t)
|
|
2712
2696
|
});
|
|
2713
2697
|
}
|
|
2714
2698
|
const js = /* @__PURE__ */ c("ZodFile", (e, t) => {
|
|
2715
|
-
Uo.init(e, t),
|
|
2699
|
+
Uo.init(e, t), Z.init(e, t), e.min = (n, r) => e.check(Ai(n, r)), e.max = (n, r) => e.check(Ei(n, r)), e.mime = (n, r) => e.check(Di(Array.isArray(n) ? n : [n], r));
|
|
2716
2700
|
});
|
|
2717
2701
|
function j(e) {
|
|
2718
2702
|
return Li(js, e);
|
|
2719
2703
|
}
|
|
2720
2704
|
const Ns = /* @__PURE__ */ c("ZodTransform", (e, t) => {
|
|
2721
|
-
Fo.init(e, t),
|
|
2705
|
+
Fo.init(e, t), Z.init(e, t), e._zod.parse = (n, r) => {
|
|
2722
2706
|
n.addIssue = (i) => {
|
|
2723
2707
|
if (typeof i == "string")
|
|
2724
|
-
n.issues.push(
|
|
2708
|
+
n.issues.push(Y(i, n.value, t));
|
|
2725
2709
|
else {
|
|
2726
2710
|
const s = i;
|
|
2727
|
-
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e),
|
|
2711
|
+
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(Y(s));
|
|
2728
2712
|
}
|
|
2729
2713
|
};
|
|
2730
2714
|
const o = t.transform(n.value, n);
|
|
2731
2715
|
return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
|
|
2732
2716
|
};
|
|
2733
2717
|
});
|
|
2734
|
-
function
|
|
2718
|
+
function Ds(e) {
|
|
2735
2719
|
return new Ns({
|
|
2736
2720
|
type: "transform",
|
|
2737
2721
|
transform: e
|
|
2738
2722
|
});
|
|
2739
2723
|
}
|
|
2740
|
-
const
|
|
2741
|
-
To.init(e, t),
|
|
2724
|
+
const an = /* @__PURE__ */ c("ZodOptional", (e, t) => {
|
|
2725
|
+
To.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2742
2726
|
});
|
|
2743
2727
|
function Ye(e) {
|
|
2744
|
-
return new
|
|
2728
|
+
return new an({
|
|
2745
2729
|
type: "optional",
|
|
2746
2730
|
innerType: e
|
|
2747
2731
|
});
|
|
2748
2732
|
}
|
|
2749
|
-
const
|
|
2750
|
-
Lo.init(e, t),
|
|
2733
|
+
const Rs = /* @__PURE__ */ c("ZodNullable", (e, t) => {
|
|
2734
|
+
Lo.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2751
2735
|
});
|
|
2752
2736
|
function qe(e) {
|
|
2753
|
-
return new
|
|
2737
|
+
return new Rs({
|
|
2754
2738
|
type: "nullable",
|
|
2755
2739
|
innerType: e
|
|
2756
2740
|
});
|
|
2757
2741
|
}
|
|
2758
2742
|
const Ms = /* @__PURE__ */ c("ZodDefault", (e, t) => {
|
|
2759
|
-
Bo.init(e, t),
|
|
2743
|
+
Bo.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2760
2744
|
});
|
|
2761
2745
|
function Us(e, t) {
|
|
2762
2746
|
return new Ms({
|
|
@@ -2768,7 +2752,7 @@ function Us(e, t) {
|
|
|
2768
2752
|
});
|
|
2769
2753
|
}
|
|
2770
2754
|
const Fs = /* @__PURE__ */ c("ZodPrefault", (e, t) => {
|
|
2771
|
-
Wo.init(e, t),
|
|
2755
|
+
Wo.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2772
2756
|
});
|
|
2773
2757
|
function Ts(e, t) {
|
|
2774
2758
|
return new Fs({
|
|
@@ -2779,18 +2763,18 @@ function Ts(e, t) {
|
|
|
2779
2763
|
}
|
|
2780
2764
|
});
|
|
2781
2765
|
}
|
|
2782
|
-
const
|
|
2783
|
-
Vo.init(e, t),
|
|
2766
|
+
const fn = /* @__PURE__ */ c("ZodNonOptional", (e, t) => {
|
|
2767
|
+
Vo.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2784
2768
|
});
|
|
2785
2769
|
function Ls(e, t) {
|
|
2786
|
-
return new
|
|
2770
|
+
return new fn({
|
|
2787
2771
|
type: "nonoptional",
|
|
2788
2772
|
innerType: e,
|
|
2789
2773
|
...l(t)
|
|
2790
2774
|
});
|
|
2791
2775
|
}
|
|
2792
2776
|
const Bs = /* @__PURE__ */ c("ZodCatch", (e, t) => {
|
|
2793
|
-
Go.init(e, t),
|
|
2777
|
+
Go.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2794
2778
|
});
|
|
2795
2779
|
function Ws(e, t) {
|
|
2796
2780
|
return new Bs({
|
|
@@ -2800,7 +2784,7 @@ function Ws(e, t) {
|
|
|
2800
2784
|
});
|
|
2801
2785
|
}
|
|
2802
2786
|
const Vs = /* @__PURE__ */ c("ZodPipe", (e, t) => {
|
|
2803
|
-
|
|
2787
|
+
Co.init(e, t), Z.init(e, t), e.in = t.in, e.out = t.out;
|
|
2804
2788
|
});
|
|
2805
2789
|
function Xe(e, t) {
|
|
2806
2790
|
return new Vs({
|
|
@@ -2811,16 +2795,16 @@ function Xe(e, t) {
|
|
|
2811
2795
|
});
|
|
2812
2796
|
}
|
|
2813
2797
|
const Gs = /* @__PURE__ */ c("ZodReadonly", (e, t) => {
|
|
2814
|
-
|
|
2798
|
+
Ko.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2815
2799
|
});
|
|
2816
|
-
function
|
|
2800
|
+
function Cs(e) {
|
|
2817
2801
|
return new Gs({
|
|
2818
2802
|
type: "readonly",
|
|
2819
2803
|
innerType: e
|
|
2820
2804
|
});
|
|
2821
2805
|
}
|
|
2822
|
-
const
|
|
2823
|
-
Jo.init(e, t),
|
|
2806
|
+
const Ks = /* @__PURE__ */ c("ZodCustom", (e, t) => {
|
|
2807
|
+
Jo.init(e, t), Z.init(e, t);
|
|
2824
2808
|
});
|
|
2825
2809
|
function Js(e) {
|
|
2826
2810
|
const t = new A({
|
|
@@ -2830,44 +2814,44 @@ function Js(e) {
|
|
|
2830
2814
|
return t._zod.check = e, t;
|
|
2831
2815
|
}
|
|
2832
2816
|
function Ys(e, t = {}) {
|
|
2833
|
-
return Bi(
|
|
2817
|
+
return Bi(Ks, e, t);
|
|
2834
2818
|
}
|
|
2835
2819
|
function qs(e) {
|
|
2836
2820
|
const t = Js((n) => (n.addIssue = (r) => {
|
|
2837
2821
|
if (typeof r == "string")
|
|
2838
|
-
n.issues.push(
|
|
2822
|
+
n.issues.push(Y(r, n.value, t._zod.def));
|
|
2839
2823
|
else {
|
|
2840
2824
|
const o = r;
|
|
2841
|
-
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(
|
|
2825
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(Y(o));
|
|
2842
2826
|
}
|
|
2843
2827
|
}, e(n.value, n)));
|
|
2844
2828
|
return t;
|
|
2845
2829
|
}
|
|
2846
2830
|
const He = {
|
|
2847
|
-
"arrayEach:string": () =>
|
|
2848
|
-
"arrayEach:number": () =>
|
|
2849
|
-
"arrayEach:email": () =>
|
|
2850
|
-
"arrayEach:url": () =>
|
|
2851
|
-
"arrayEach:file": () =>
|
|
2831
|
+
"arrayEach:string": () => x(M({ error: "Each item must be a string" })),
|
|
2832
|
+
"arrayEach:number": () => x(R({ error: "Each item must be a number" })),
|
|
2833
|
+
"arrayEach:email": () => x(tn({ error: "Each item must be a valid email" })),
|
|
2834
|
+
"arrayEach:url": () => x(rn({ error: "Each item must be a valid URL" })),
|
|
2835
|
+
"arrayEach:file": () => x(j({ error: "Each item must be a file" }))
|
|
2852
2836
|
}, Qe = {
|
|
2853
2837
|
nullable: () => M().nullable().optional(),
|
|
2854
|
-
required: () =>
|
|
2838
|
+
required: () => cn([
|
|
2855
2839
|
M().min(1, { error: "This field is required" }),
|
|
2856
2840
|
j({ error: "This field is required" }),
|
|
2857
|
-
|
|
2841
|
+
x(D()).min(1, { error: "This field is required" })
|
|
2858
2842
|
]),
|
|
2859
2843
|
string: () => M({ error: "Must be a string" }),
|
|
2860
|
-
email: () =>
|
|
2861
|
-
url: () =>
|
|
2862
|
-
number: () =>
|
|
2863
|
-
integer: () =>
|
|
2864
|
-
positive: () =>
|
|
2865
|
-
negative: () =>
|
|
2844
|
+
email: () => tn({ error: "Invalid email format" }),
|
|
2845
|
+
url: () => rn({ error: "Invalid URL format" }),
|
|
2846
|
+
number: () => R({ error: "Must be a number" }),
|
|
2847
|
+
integer: () => R().int({ error: "Must be an integer" }),
|
|
2848
|
+
positive: () => R().positive({ error: "Must be positive" }),
|
|
2849
|
+
negative: () => R().negative({ error: "Must be negative" }),
|
|
2866
2850
|
ipv4: () => fs({ error: "Must be valid IPv4" }),
|
|
2867
2851
|
boolean: () => ys({ error: "Must be a boolean" }),
|
|
2868
2852
|
date: () => Is({ error: "Must be a valid date" }),
|
|
2869
|
-
array: () =>
|
|
2870
|
-
object: () =>
|
|
2853
|
+
array: () => x(D(), { error: "Must be an array" }),
|
|
2854
|
+
object: () => xs({}, { error: "Must be an object" }),
|
|
2871
2855
|
file: () => j({ error: "Must be a file" })
|
|
2872
2856
|
}, et = (e) => {
|
|
2873
2857
|
const t = { B: 1, KB: 1024, MB: 1048576, GB: 1073741824, TB: 1099511627776 }, n = e.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB|TB)$/i);
|
|
@@ -2893,30 +2877,30 @@ const He = {
|
|
|
2893
2877
|
error: `Must be ${e} file`
|
|
2894
2878
|
});
|
|
2895
2879
|
}, Xs = (e) => {
|
|
2896
|
-
const [t, n] =
|
|
2880
|
+
const [t, n] = Vn(
|
|
2897
2881
|
e,
|
|
2898
2882
|
(o) => typeof o == "function"
|
|
2899
2883
|
);
|
|
2900
2884
|
return [
|
|
2901
2885
|
...t.map((o) => {
|
|
2902
2886
|
const i = o;
|
|
2903
|
-
return
|
|
2887
|
+
return D().refine(o, {
|
|
2904
2888
|
message: i.message || "Validation failed"
|
|
2905
2889
|
});
|
|
2906
2890
|
}),
|
|
2907
2891
|
...n.map((o) => {
|
|
2908
|
-
if (!
|
|
2892
|
+
if (!Cn(o)) return D();
|
|
2909
2893
|
if (o in Qe)
|
|
2910
2894
|
return Qe[o]();
|
|
2911
2895
|
if (o in He)
|
|
2912
2896
|
return He[o]();
|
|
2913
2897
|
if (o.startsWith("min:")) {
|
|
2914
2898
|
const i = parseInt(o.split(":")[1]);
|
|
2915
|
-
return
|
|
2899
|
+
return R().min(i, { error: `Must be at least ${i}` });
|
|
2916
2900
|
}
|
|
2917
2901
|
if (o.startsWith("max:")) {
|
|
2918
2902
|
const i = parseInt(o.split(":")[1]);
|
|
2919
|
-
return
|
|
2903
|
+
return R().max(i, { error: `Must be at most ${i}` });
|
|
2920
2904
|
}
|
|
2921
2905
|
if (o.startsWith("minLength:")) {
|
|
2922
2906
|
const i = parseInt(o.split(":")[1]);
|
|
@@ -2928,11 +2912,11 @@ const He = {
|
|
|
2928
2912
|
}
|
|
2929
2913
|
if (o.startsWith("arrayMinLength:")) {
|
|
2930
2914
|
const i = parseInt(o.split(":")[1]);
|
|
2931
|
-
return
|
|
2915
|
+
return x(D()).min(i, { error: `Must have at least ${i} items` });
|
|
2932
2916
|
}
|
|
2933
2917
|
if (o.startsWith("arrayMaxLength:")) {
|
|
2934
2918
|
const i = parseInt(o.split(":")[1]);
|
|
2935
|
-
return
|
|
2919
|
+
return x(D()).max(i, { error: `Must have at most ${i} items` });
|
|
2936
2920
|
}
|
|
2937
2921
|
if (o.startsWith("pattern:")) {
|
|
2938
2922
|
const i = o.split(":")[1];
|
|
@@ -2944,7 +2928,7 @@ const He = {
|
|
|
2944
2928
|
}
|
|
2945
2929
|
if (o.startsWith("arrayEach:fileSize:")) {
|
|
2946
2930
|
const i = o.split(":")[2], s = et(i);
|
|
2947
|
-
return
|
|
2931
|
+
return x(j().max(s, { error: `Each file must be smaller than ${i}` }));
|
|
2948
2932
|
}
|
|
2949
2933
|
if (o.startsWith("fileType:")) {
|
|
2950
2934
|
const i = o.split(":")[1];
|
|
@@ -2952,134 +2936,134 @@ const He = {
|
|
|
2952
2936
|
}
|
|
2953
2937
|
if (o.startsWith("arrayEach:fileType:")) {
|
|
2954
2938
|
const i = o.split(":")[2], s = tt(i);
|
|
2955
|
-
return
|
|
2939
|
+
return x(s);
|
|
2956
2940
|
}
|
|
2957
|
-
return
|
|
2941
|
+
return D();
|
|
2958
2942
|
})
|
|
2959
2943
|
].reduce((o, i) => un(o, i));
|
|
2960
2944
|
}, Hs = ({
|
|
2961
2945
|
initialData: e,
|
|
2962
2946
|
validationRules: t
|
|
2963
2947
|
}) => {
|
|
2964
|
-
const [n, r] = Ee(e), [o, i] = Ee({}), s = Ae(() => !
|
|
2965
|
-
(
|
|
2966
|
-
if (typeof
|
|
2967
|
-
if (!Q(e,
|
|
2968
|
-
throw new Error(`Invalid path: '${
|
|
2969
|
-
r((
|
|
2948
|
+
const [n, r] = Ee(e), [o, i] = Ee({}), s = Ae(() => !xt(o), [o]), u = Ae(() => !Un(n, e), [n, e]), f = S(
|
|
2949
|
+
(d, E) => {
|
|
2950
|
+
if (typeof d == "string") {
|
|
2951
|
+
if (!Q(e, d))
|
|
2952
|
+
throw new Error(`Invalid path: '${d}'`);
|
|
2953
|
+
r((v) => Dn(En(v), d, E));
|
|
2970
2954
|
} else
|
|
2971
|
-
r((
|
|
2955
|
+
r((v) => ({ ...v, ...d }));
|
|
2972
2956
|
},
|
|
2973
2957
|
[e]
|
|
2974
|
-
),
|
|
2975
|
-
(
|
|
2976
|
-
if (!Q(e,
|
|
2977
|
-
throw new Error(`Invalid path: '${
|
|
2978
|
-
i((
|
|
2979
|
-
...
|
|
2980
|
-
[
|
|
2958
|
+
), a = S(
|
|
2959
|
+
(d, E) => {
|
|
2960
|
+
if (!Q(e, d))
|
|
2961
|
+
throw new Error(`Invalid path: '${d}'`);
|
|
2962
|
+
i((v) => ({
|
|
2963
|
+
...v,
|
|
2964
|
+
[d]: E
|
|
2981
2965
|
}));
|
|
2982
2966
|
},
|
|
2983
2967
|
[e]
|
|
2984
|
-
), g =
|
|
2985
|
-
(
|
|
2986
|
-
if (!Q(e,
|
|
2987
|
-
throw new Error(`Invalid path: '${
|
|
2988
|
-
return !!o[
|
|
2968
|
+
), g = S(
|
|
2969
|
+
(d) => {
|
|
2970
|
+
if (!Q(e, d))
|
|
2971
|
+
throw new Error(`Invalid path: '${d}'`);
|
|
2972
|
+
return !!o[d];
|
|
2989
2973
|
},
|
|
2990
2974
|
[o, e]
|
|
2991
|
-
),
|
|
2992
|
-
(
|
|
2993
|
-
if (!Q(e,
|
|
2994
|
-
throw new Error(`Invalid path: '${
|
|
2995
|
-
i((E) =>
|
|
2975
|
+
), p = S(
|
|
2976
|
+
(d) => {
|
|
2977
|
+
if (!Q(e, d))
|
|
2978
|
+
throw new Error(`Invalid path: '${d}'`);
|
|
2979
|
+
i((E) => Gn(E, [d]));
|
|
2996
2980
|
},
|
|
2997
2981
|
[e]
|
|
2998
|
-
),
|
|
2982
|
+
), m = S(
|
|
2999
2983
|
() => {
|
|
3000
2984
|
i({});
|
|
3001
2985
|
},
|
|
3002
2986
|
[]
|
|
3003
|
-
),
|
|
2987
|
+
), h = S(
|
|
3004
2988
|
() => {
|
|
3005
2989
|
r(e), i({});
|
|
3006
2990
|
},
|
|
3007
2991
|
[e]
|
|
3008
|
-
),
|
|
3009
|
-
let
|
|
3010
|
-
return t &&
|
|
3011
|
-
const _ = ot(n,
|
|
3012
|
-
if (
|
|
3013
|
-
|
|
2992
|
+
), I = S(() => {
|
|
2993
|
+
let d = !0;
|
|
2994
|
+
return t && Ln(t, (E, v) => {
|
|
2995
|
+
const _ = ot(n, v), $ = Xs(E).safeParse(_);
|
|
2996
|
+
if ($.success)
|
|
2997
|
+
p(v);
|
|
3014
2998
|
else {
|
|
3015
|
-
const
|
|
3016
|
-
|
|
2999
|
+
const P = $.error.issues.map((O) => O.message);
|
|
3000
|
+
a(v, P), d = $.success;
|
|
3017
3001
|
}
|
|
3018
|
-
}),
|
|
3019
|
-
}, [n, t,
|
|
3002
|
+
}), d;
|
|
3003
|
+
}, [n, t, p, a]);
|
|
3020
3004
|
return {
|
|
3021
3005
|
data: n,
|
|
3022
|
-
setData:
|
|
3006
|
+
setData: f,
|
|
3023
3007
|
errors: o,
|
|
3024
3008
|
hasErrors: s,
|
|
3025
|
-
clearErrors:
|
|
3026
|
-
clearError:
|
|
3027
|
-
setError:
|
|
3009
|
+
clearErrors: m,
|
|
3010
|
+
clearError: p,
|
|
3011
|
+
setError: a,
|
|
3028
3012
|
hasError: g,
|
|
3029
|
-
reset:
|
|
3013
|
+
reset: h,
|
|
3030
3014
|
isDirty: u,
|
|
3031
|
-
validate:
|
|
3015
|
+
validate: I
|
|
3032
3016
|
};
|
|
3033
|
-
},
|
|
3017
|
+
}, nc = ({
|
|
3034
3018
|
headers: e = {},
|
|
3035
3019
|
initialData: t,
|
|
3036
3020
|
operation: n,
|
|
3037
3021
|
options: r = {},
|
|
3038
3022
|
validationRules: o
|
|
3039
3023
|
}) => {
|
|
3040
|
-
const i = Hs({ initialData: t, validationRules: o }), s =
|
|
3041
|
-
(
|
|
3024
|
+
const i = Hs({ initialData: t, validationRules: o }), s = ln(null), [u, { loading: f }] = Wn(n, { errorPolicy: "all", ...r }), a = S(
|
|
3025
|
+
(p = {}) => {
|
|
3042
3026
|
const {
|
|
3043
|
-
onBefore:
|
|
3027
|
+
onBefore: m = () => {
|
|
3044
3028
|
},
|
|
3045
|
-
onError:
|
|
3029
|
+
onError: h = () => {
|
|
3046
3030
|
},
|
|
3047
|
-
onFinish:
|
|
3031
|
+
onFinish: I = () => {
|
|
3048
3032
|
},
|
|
3049
|
-
onSuccess:
|
|
3033
|
+
onSuccess: d = () => {
|
|
3050
3034
|
},
|
|
3051
3035
|
skipValidation: E = !1
|
|
3052
|
-
} =
|
|
3036
|
+
} = p;
|
|
3053
3037
|
if (!E && !i.validate())
|
|
3054
3038
|
return;
|
|
3055
|
-
const
|
|
3056
|
-
|
|
3057
|
-
variables: { input:
|
|
3058
|
-
...!
|
|
3039
|
+
const v = s.current ? s.current(i.data) : i.data;
|
|
3040
|
+
m?.(), u({
|
|
3041
|
+
variables: { input: v },
|
|
3042
|
+
...!xt(e) && { context: { headers: e } }
|
|
3059
3043
|
}).then((_) => {
|
|
3060
|
-
|
|
3044
|
+
_.errors && _.errors.length > 0 ? h?.(_.errors) : d?.(_);
|
|
3061
3045
|
}).catch((_) => {
|
|
3062
|
-
|
|
3046
|
+
h?.(_);
|
|
3063
3047
|
}).finally(() => {
|
|
3064
|
-
|
|
3048
|
+
I?.();
|
|
3065
3049
|
});
|
|
3066
3050
|
},
|
|
3067
3051
|
[i, u, e]
|
|
3068
|
-
), g =
|
|
3069
|
-
(
|
|
3070
|
-
[
|
|
3052
|
+
), g = S(
|
|
3053
|
+
(p) => (s.current = p, { ...i, isLoading: f, submit: a }),
|
|
3054
|
+
[f, i, a]
|
|
3071
3055
|
);
|
|
3072
3056
|
return {
|
|
3073
3057
|
...i,
|
|
3074
|
-
isLoading:
|
|
3075
|
-
submit:
|
|
3058
|
+
isLoading: f,
|
|
3059
|
+
submit: a,
|
|
3076
3060
|
transform: g
|
|
3077
3061
|
};
|
|
3078
3062
|
};
|
|
3079
3063
|
export {
|
|
3080
|
-
|
|
3064
|
+
Bn as a,
|
|
3081
3065
|
Hs as b,
|
|
3082
3066
|
Xs as h,
|
|
3083
|
-
|
|
3084
|
-
|
|
3067
|
+
xt as i,
|
|
3068
|
+
nc as u
|
|
3085
3069
|
};
|