react-luminus-components 1.3.76 → 1.3.78

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.
Files changed (91) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +60 -95
  3. package/dist/Loading-CBsJX4LG.js +17 -0
  4. package/dist/Loading-If5qsvY2.cjs +1 -0
  5. package/dist/SimpleTooltip-DwgjTb1C.js +5 -0
  6. package/dist/{SimpleTooltip-Duct0nes.cjs → SimpleTooltip-dm9JzI9d.cjs} +1 -1
  7. package/dist/components/Documents/Documents.d.ts +10 -0
  8. package/dist/components/Documents/components/DocumentDirectory/DocumentDirectory.d.ts +5 -0
  9. package/dist/components/Documents/components/DocumentDirectory/components/DocumentDirectoryLabel/DocumentDirectoryLabel.d.ts +7 -0
  10. package/dist/components/Documents/components/DocumentDirectory/components/index.d.ts +1 -0
  11. package/dist/components/Documents/components/DocumentsActions/DocumentsActions.d.ts +7 -0
  12. package/dist/components/Documents/components/DocumentsActions/components/DocActionButton/DocActionButton.d.ts +10 -0
  13. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/DocumentsUpload.d.ts +10 -0
  14. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/UploadFilesModal/UploadFilesModal.d.ts +7 -0
  15. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/UploadFilesModal/hooks/useUploadFilesFormSchema.d.ts +18 -0
  16. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/index.d.ts +1 -0
  17. package/dist/components/Documents/components/DocumentsActions/components/index.d.ts +2 -0
  18. package/dist/components/Documents/components/DocumentsFilesTable/DocumentsFilesTable.d.ts +6 -0
  19. package/dist/components/Documents/components/DocumentsFilesTable/hooks/useDocumentsFilesColumns.d.ts +11 -0
  20. package/dist/components/Documents/components/DocumentsModals/DocumentsModals.d.ts +2 -0
  21. package/dist/components/Documents/components/DocumentsModals/components/CreateFolderModal/CreateFolderModal.d.ts +5 -0
  22. package/dist/components/Documents/components/DocumentsModals/components/CreateFolderModal/hooks/useDocCreateFolderForm.d.ts +13 -0
  23. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/EditFileModal.d.ts +5 -0
  24. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/EditFileModalInner.d.ts +8 -0
  25. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/hooks/useEditFileForm.d.ts +18 -0
  26. package/dist/components/Documents/components/DocumentsModals/components/index.d.ts +2 -0
  27. package/dist/components/Documents/components/DocumentsModals/types/DocumentsModalType.d.ts +2 -0
  28. package/dist/components/Documents/components/DocumentsRoot/DocumentsRoot.d.ts +5 -0
  29. package/dist/components/Documents/components/FileExtensionIcon/FileExtensionIcon.d.ts +7 -0
  30. package/dist/components/Documents/components/index.d.ts +6 -0
  31. package/dist/components/Documents/contexts/DocumentsContext.d.ts +13 -0
  32. package/dist/components/Documents/hooks/useDocContextApiActions.d.ts +17 -0
  33. package/dist/components/Documents/hooks/useDocumentsApiActions.d.ts +7 -0
  34. package/dist/components/Documents/hooks/useDocumentsDrag.d.ts +19 -0
  35. package/dist/components/Documents/hooks/useDocumentsReducer.d.ts +91 -0
  36. package/dist/components/Documents/index.d.ts +2 -0
  37. package/dist/components/Documents/types/api/DocType.d.ts +6 -0
  38. package/dist/components/Documents/types/api/DocumentFileModel.d.ts +18 -0
  39. package/dist/components/Documents/types/api/DocumentFolderModel.d.ts +9 -0
  40. package/dist/components/Documents/types/api/DocumentListModel.d.ts +8 -0
  41. package/dist/components/Documents/types/api/DocumentUploadModel.d.ts +6 -0
  42. package/dist/components/Documents/types/api/DocumentsCreateFolderModel.d.ts +8 -0
  43. package/dist/components/Documents/types/ui/DocumentFile.d.ts +6 -0
  44. package/dist/components/Documents/types/ui/DocumentFolder.d.ts +10 -0
  45. package/dist/components/Documents/types/ui/DocumentState.d.ts +2 -0
  46. package/dist/components/Documents/types/ui/DocumentsActionsObj.d.ts +14 -0
  47. package/dist/components/Documents/types/ui/DocumentsFolderId.d.ts +2 -0
  48. package/dist/components/Documents/types/ui/FileDirType.d.ts +2 -0
  49. package/dist/components/Documents/utils/documentsConstants.d.ts +1 -0
  50. package/dist/components/Documents/utils/documentsDataUtils.d.ts +12 -0
  51. package/dist/components/Documents/utils/documentsTypeUtils.d.ts +4 -0
  52. package/dist/components/Documents/utils/documentsUtils.d.ts +7 -0
  53. package/dist/contexts.cjs.js +1 -1
  54. package/dist/contexts.es.js +103 -105
  55. package/dist/hooks.cjs.js +1 -1
  56. package/dist/hooks.es.js +40 -2968
  57. package/dist/layout.cjs.js +1 -1
  58. package/dist/layout.es.js +18 -18
  59. package/dist/main.cjs.js +2 -2
  60. package/dist/main.d.ts +2 -0
  61. package/dist/main.es.js +2958 -3364
  62. package/dist/models/luminus-context-types/CommonLuminusIcons.d.ts +1 -1
  63. package/dist/models/texts/ComponentsContextTexts.d.ts +2 -0
  64. package/dist/models/texts/DocumentsTexts.d.ts +45 -0
  65. package/dist/nivo-pie.es-CWpL5Qz1.cjs +279 -0
  66. package/dist/nivo-pie.es-CfGrs0qQ.js +21226 -0
  67. package/dist/{searchUtils-C-P7nqmc.js → searchUtils-6cFIcqrD.js} +1 -1
  68. package/dist/{searchUtils-Bwcn0kNN.cjs → searchUtils-eG-nNTgU.cjs} +1 -1
  69. package/dist/style.css +1 -1
  70. package/dist/useClipboard-BbFBkj-c.cjs +1 -0
  71. package/dist/{useClipboard-Ci3XItTi.js → useClipboard-BsBDyYHu.js} +12 -13
  72. package/dist/useLocalStorageState-B8C3HlW-.cjs +1 -0
  73. package/dist/useLocalStorageState-D9uh-D8S.js +64 -0
  74. package/dist/{usePermissions-CDkc5n4B.cjs → usePermissions-D3jEVB-f.cjs} +1 -1
  75. package/dist/{usePermissions-D1kTfy1F.js → usePermissions-DInna_ZH.js} +1 -1
  76. package/dist/utils.cjs.js +1 -1
  77. package/dist/utils.es.js +70 -105
  78. package/dist/variables.scss +171 -171
  79. package/package.json +111 -109
  80. package/dist/PrimaryButton-DHWMFBqe.js +0 -682
  81. package/dist/PrimaryButton-DoEWPvdG.cjs +0 -1
  82. package/dist/SimpleTooltip-DIbveCyg.js +0 -5
  83. package/dist/dateUtils-DBObp1Kn.js +0 -1402
  84. package/dist/dateUtils-UEaQDw00.cjs +0 -1
  85. package/dist/nivo-pie.es-CYja6R0y.cjs +0 -279
  86. package/dist/nivo-pie.es-DbylxdLa.js +0 -14728
  87. package/dist/useClipboard-KQiedKAp.cjs +0 -1
  88. package/dist/useConfirm-BFRnARZA.js +0 -18
  89. package/dist/useConfirm-SzzUX_WZ.cjs +0 -1
  90. package/dist/useLocalStorageState-C2fAE5hY.cjs +0 -1
  91. package/dist/useLocalStorageState-OXK3MAPN.js +0 -72
package/dist/hooks.es.js CHANGED
@@ -1,2987 +1,59 @@
1
- import { U as Je, aJ as Ye, a6 as He } from "./nivo-pie.es-DbylxdLa.js";
2
- import { aK as mr, ab as pr, am as yr } from "./nivo-pie.es-DbylxdLa.js";
3
- import { u as vr } from "./useConfirm-BFRnARZA.js";
4
- import { b as xr, a as kr, u as br } from "./useLocalStorageState-OXK3MAPN.js";
5
- import { useContext as Qe, useCallback as N, useState as Xe, useEffect as Ke } from "react";
6
- import "react-router-dom";
7
- import "@azure/msal-browser";
8
- import "@azure/msal-react";
9
- import { i as Fe } from "./dateUtils-DBObp1Kn.js";
10
- import "react-hook-form";
11
- import { b as Tr, u as Zr, f as Sr, c as Cr, a as Nr, d as Er, e as Or } from "./useClipboard-Ci3XItTi.js";
12
- import { u as Ir } from "./usePermissions-D1kTfy1F.js";
13
- var x;
14
- (function(r) {
15
- r.assertEqual = (n) => n;
16
- function e(n) {
17
- }
18
- r.assertIs = e;
19
- function t(n) {
20
- throw new Error();
21
- }
22
- r.assertNever = t, r.arrayToEnum = (n) => {
23
- const a = {};
24
- for (const i of n)
25
- a[i] = i;
26
- return a;
27
- }, r.getValidEnumValues = (n) => {
28
- const a = r.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
29
- for (const o of a)
30
- i[o] = n[o];
31
- return r.objectValues(i);
32
- }, r.objectValues = (n) => r.objectKeys(n).map(function(a) {
33
- return n[a];
34
- }), r.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
35
- const a = [];
36
- for (const i in n)
37
- Object.prototype.hasOwnProperty.call(n, i) && a.push(i);
38
- return a;
39
- }, r.find = (n, a) => {
40
- for (const i of n)
41
- if (a(i))
42
- return i;
43
- }, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
44
- function s(n, a = " | ") {
45
- return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
46
- }
47
- r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
48
- })(x || (x = {}));
49
- var Ne;
50
- (function(r) {
51
- r.mergeShapes = (e, t) => ({
52
- ...e,
53
- ...t
54
- // second overwrites first
55
- });
56
- })(Ne || (Ne = {}));
57
- const f = x.arrayToEnum([
58
- "string",
59
- "nan",
60
- "number",
61
- "integer",
62
- "float",
63
- "boolean",
64
- "date",
65
- "bigint",
66
- "symbol",
67
- "function",
68
- "undefined",
69
- "null",
70
- "array",
71
- "object",
72
- "unknown",
73
- "promise",
74
- "void",
75
- "never",
76
- "map",
77
- "set"
78
- ]), D = (r) => {
79
- switch (typeof r) {
80
- case "undefined":
81
- return f.undefined;
82
- case "string":
83
- return f.string;
84
- case "number":
85
- return isNaN(r) ? f.nan : f.number;
86
- case "boolean":
87
- return f.boolean;
88
- case "function":
89
- return f.function;
90
- case "bigint":
91
- return f.bigint;
92
- case "symbol":
93
- return f.symbol;
94
- case "object":
95
- return Array.isArray(r) ? f.array : r === null ? f.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? f.promise : typeof Map < "u" && r instanceof Map ? f.map : typeof Set < "u" && r instanceof Set ? f.set : typeof Date < "u" && r instanceof Date ? f.date : f.object;
96
- default:
97
- return f.unknown;
98
- }
99
- }, d = x.arrayToEnum([
100
- "invalid_type",
101
- "invalid_literal",
102
- "custom",
103
- "invalid_union",
104
- "invalid_union_discriminator",
105
- "invalid_enum_value",
106
- "unrecognized_keys",
107
- "invalid_arguments",
108
- "invalid_return_type",
109
- "invalid_date",
110
- "invalid_string",
111
- "too_small",
112
- "too_big",
113
- "invalid_intersection_types",
114
- "not_multiple_of",
115
- "not_finite"
116
- ]), et = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
117
- class O extends Error {
118
- constructor(e) {
119
- super(), this.issues = [], this.addIssue = (s) => {
120
- this.issues = [...this.issues, s];
121
- }, this.addIssues = (s = []) => {
122
- this.issues = [...this.issues, ...s];
123
- };
124
- const t = new.target.prototype;
125
- Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
126
- }
127
- get errors() {
128
- return this.issues;
129
- }
130
- format(e) {
131
- const t = e || function(a) {
132
- return a.message;
133
- }, s = { _errors: [] }, n = (a) => {
134
- for (const i of a.issues)
135
- if (i.code === "invalid_union")
136
- i.unionErrors.map(n);
137
- else if (i.code === "invalid_return_type")
138
- n(i.returnTypeError);
139
- else if (i.code === "invalid_arguments")
140
- n(i.argumentsError);
141
- else if (i.path.length === 0)
142
- s._errors.push(t(i));
143
- else {
144
- let o = s, u = 0;
145
- for (; u < i.path.length; ) {
146
- const c = i.path[u];
147
- u === i.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(t(i))) : o[c] = o[c] || { _errors: [] }, o = o[c], u++;
148
- }
149
- }
150
- };
151
- return n(this), s;
152
- }
153
- static assert(e) {
154
- if (!(e instanceof O))
155
- throw new Error(`Not a ZodError: ${e}`);
156
- }
157
- toString() {
158
- return this.message;
159
- }
160
- get message() {
161
- return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
162
- }
163
- get isEmpty() {
164
- return this.issues.length === 0;
165
- }
166
- flatten(e = (t) => t.message) {
167
- const t = {}, s = [];
168
- for (const n of this.issues)
169
- n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : s.push(e(n));
170
- return { formErrors: s, fieldErrors: t };
171
- }
172
- get formErrors() {
173
- return this.flatten();
174
- }
175
- }
176
- O.create = (r) => new O(r);
177
- const Q = (r, e) => {
178
- let t;
179
- switch (r.code) {
180
- case d.invalid_type:
181
- r.received === f.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
182
- break;
183
- case d.invalid_literal:
184
- t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
185
- break;
186
- case d.unrecognized_keys:
187
- t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
188
- break;
189
- case d.invalid_union:
190
- t = "Invalid input";
191
- break;
192
- case d.invalid_union_discriminator:
193
- t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
194
- break;
195
- case d.invalid_enum_value:
196
- t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
197
- break;
198
- case d.invalid_arguments:
199
- t = "Invalid function arguments";
200
- break;
201
- case d.invalid_return_type:
202
- t = "Invalid function return type";
203
- break;
204
- case d.invalid_date:
205
- t = "Invalid date";
206
- break;
207
- case d.invalid_string:
208
- typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
209
- break;
210
- case d.too_small:
211
- r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
212
- break;
213
- case d.too_big:
214
- r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
215
- break;
216
- case d.custom:
217
- t = "Invalid input";
218
- break;
219
- case d.invalid_intersection_types:
220
- t = "Intersection results could not be merged";
221
- break;
222
- case d.not_multiple_of:
223
- t = `Number must be a multiple of ${r.multipleOf}`;
224
- break;
225
- case d.not_finite:
226
- t = "Number must be finite";
227
- break;
228
- default:
229
- t = e.defaultError, x.assertNever(r);
230
- }
231
- return { message: t };
232
- };
233
- let Me = Q;
234
- function tt(r) {
235
- Me = r;
236
- }
237
- function ge() {
238
- return Me;
239
- }
240
- const xe = (r) => {
241
- const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = {
242
- ...n,
243
- path: a
244
- };
245
- if (n.message !== void 0)
246
- return {
247
- ...n,
248
- path: a,
249
- message: n.message
250
- };
251
- let o = "";
252
- const u = s.filter((c) => !!c).slice().reverse();
253
- for (const c of u)
254
- o = c(i, { data: e, defaultError: o }).message;
255
- return {
256
- ...n,
257
- path: a,
258
- message: o
259
- };
260
- }, rt = [];
261
- function l(r, e) {
262
- const t = ge(), s = xe({
263
- issueData: e,
264
- data: r.data,
265
- path: r.path,
266
- errorMaps: [
267
- r.common.contextualErrorMap,
268
- r.schemaErrorMap,
269
- t,
270
- t === Q ? void 0 : Q
271
- // then global default map
272
- ].filter((n) => !!n)
273
- });
274
- r.common.issues.push(s);
275
- }
276
- class Z {
277
- constructor() {
278
- this.value = "valid";
279
- }
280
- dirty() {
281
- this.value === "valid" && (this.value = "dirty");
282
- }
283
- abort() {
284
- this.value !== "aborted" && (this.value = "aborted");
285
- }
286
- static mergeArray(e, t) {
287
- const s = [];
288
- for (const n of t) {
289
- if (n.status === "aborted")
290
- return y;
291
- n.status === "dirty" && e.dirty(), s.push(n.value);
292
- }
293
- return { status: e.value, value: s };
294
- }
295
- static async mergeObjectAsync(e, t) {
296
- const s = [];
297
- for (const n of t) {
298
- const a = await n.key, i = await n.value;
299
- s.push({
300
- key: a,
301
- value: i
302
- });
303
- }
304
- return Z.mergeObjectSync(e, s);
305
- }
306
- static mergeObjectSync(e, t) {
307
- const s = {};
308
- for (const n of t) {
309
- const { key: a, value: i } = n;
310
- if (a.status === "aborted" || i.status === "aborted")
311
- return y;
312
- a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || n.alwaysSet) && (s[a.value] = i.value);
313
- }
314
- return { status: e.value, value: s };
315
- }
316
- }
317
- const y = Object.freeze({
318
- status: "aborted"
319
- }), Y = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Ee = (r) => r.status === "aborted", Oe = (r) => r.status === "dirty", se = (r) => r.status === "valid", ne = (r) => typeof Promise < "u" && r instanceof Promise;
320
- function ke(r, e, t, s) {
321
- if (typeof e == "function" ? r !== e || !s : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
322
- return e.get(r);
323
- }
324
- function $e(r, e, t, s, n) {
325
- if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
326
- return e.set(r, t), t;
327
- }
328
- var h;
329
- (function(r) {
330
- r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
331
- })(h || (h = {}));
332
- var te, re;
333
- class M {
334
- constructor(e, t, s, n) {
335
- this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
336
- }
337
- get path() {
338
- return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
339
- }
340
- }
341
- const je = (r, e) => {
342
- if (se(e))
343
- return { success: !0, data: e.value };
344
- if (!r.common.issues.length)
345
- throw new Error("Validation failed but no issues detected.");
346
- return {
347
- success: !1,
348
- get error() {
349
- if (this._error)
350
- return this._error;
351
- const t = new O(r.common.issues);
352
- return this._error = t, this._error;
353
- }
354
- };
355
- };
356
- function _(r) {
357
- if (!r)
358
- return {};
359
- const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
360
- if (e && (t || s))
361
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
362
- return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
363
- var u, c;
364
- const { message: p } = r;
365
- return i.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (u = p ?? s) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = p ?? t) !== null && c !== void 0 ? c : o.defaultError };
366
- }, description: n };
367
- }
368
- class v {
369
- constructor(e) {
370
- this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
371
- }
372
- get description() {
373
- return this._def.description;
374
- }
375
- _getType(e) {
376
- return D(e.data);
377
- }
378
- _getOrReturnCtx(e, t) {
379
- return t || {
380
- common: e.parent.common,
381
- data: e.data,
382
- parsedType: D(e.data),
383
- schemaErrorMap: this._def.errorMap,
384
- path: e.path,
385
- parent: e.parent
386
- };
387
- }
388
- _processInputParams(e) {
389
- return {
390
- status: new Z(),
391
- ctx: {
392
- common: e.parent.common,
393
- data: e.data,
394
- parsedType: D(e.data),
395
- schemaErrorMap: this._def.errorMap,
396
- path: e.path,
397
- parent: e.parent
398
- }
399
- };
400
- }
401
- _parseSync(e) {
402
- const t = this._parse(e);
403
- if (ne(t))
404
- throw new Error("Synchronous parse encountered promise.");
405
- return t;
406
- }
407
- _parseAsync(e) {
408
- const t = this._parse(e);
409
- return Promise.resolve(t);
410
- }
411
- parse(e, t) {
412
- const s = this.safeParse(e, t);
413
- if (s.success)
414
- return s.data;
415
- throw s.error;
416
- }
417
- safeParse(e, t) {
418
- var s;
419
- const n = {
420
- common: {
421
- issues: [],
422
- async: (s = t == null ? void 0 : t.async) !== null && s !== void 0 ? s : !1,
423
- contextualErrorMap: t == null ? void 0 : t.errorMap
424
- },
425
- path: (t == null ? void 0 : t.path) || [],
426
- schemaErrorMap: this._def.errorMap,
427
- parent: null,
428
- data: e,
429
- parsedType: D(e)
430
- }, a = this._parseSync({ data: e, path: n.path, parent: n });
431
- return je(n, a);
432
- }
433
- async parseAsync(e, t) {
434
- const s = await this.safeParseAsync(e, t);
435
- if (s.success)
436
- return s.data;
437
- throw s.error;
438
- }
439
- async safeParseAsync(e, t) {
440
- const s = {
441
- common: {
442
- issues: [],
443
- contextualErrorMap: t == null ? void 0 : t.errorMap,
444
- async: !0
445
- },
446
- path: (t == null ? void 0 : t.path) || [],
447
- schemaErrorMap: this._def.errorMap,
448
- parent: null,
449
- data: e,
450
- parsedType: D(e)
451
- }, n = this._parse({ data: e, path: s.path, parent: s }), a = await (ne(n) ? n : Promise.resolve(n));
452
- return je(s, a);
453
- }
454
- refine(e, t) {
455
- const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
456
- return this._refinement((n, a) => {
457
- const i = e(n), o = () => a.addIssue({
458
- code: d.custom,
459
- ...s(n)
460
- });
461
- return typeof Promise < "u" && i instanceof Promise ? i.then((u) => u ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
462
- });
463
- }
464
- refinement(e, t) {
465
- return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
466
- }
467
- _refinement(e) {
468
- return new j({
469
- schema: this,
470
- typeName: m.ZodEffects,
471
- effect: { type: "refinement", refinement: e }
472
- });
473
- }
474
- superRefine(e) {
475
- return this._refinement(e);
476
- }
477
- optional() {
478
- return A.create(this, this._def);
479
- }
480
- nullable() {
481
- return U.create(this, this._def);
482
- }
483
- nullish() {
484
- return this.nullable().optional();
485
- }
486
- array() {
487
- return I.create(this, this._def);
488
- }
489
- promise() {
490
- return K.create(this, this._def);
491
- }
492
- or(e) {
493
- return de.create([this, e], this._def);
494
- }
495
- and(e) {
496
- return ce.create(this, e, this._def);
497
- }
498
- transform(e) {
499
- return new j({
500
- ..._(this._def),
501
- schema: this,
502
- typeName: m.ZodEffects,
503
- effect: { type: "transform", transform: e }
504
- });
505
- }
506
- default(e) {
507
- const t = typeof e == "function" ? e : () => e;
508
- return new me({
509
- ..._(this._def),
510
- innerType: this,
511
- defaultValue: t,
512
- typeName: m.ZodDefault
513
- });
514
- }
515
- brand() {
516
- return new Ie({
517
- typeName: m.ZodBranded,
518
- type: this,
519
- ..._(this._def)
520
- });
521
- }
522
- catch(e) {
523
- const t = typeof e == "function" ? e : () => e;
524
- return new pe({
525
- ..._(this._def),
526
- innerType: this,
527
- catchValue: t,
528
- typeName: m.ZodCatch
529
- });
530
- }
531
- describe(e) {
532
- const t = this.constructor;
533
- return new t({
534
- ...this._def,
535
- description: e
536
- });
537
- }
538
- pipe(e) {
539
- return _e.create(this, e);
540
- }
541
- readonly() {
542
- return ye.create(this);
543
- }
544
- isOptional() {
545
- return this.safeParse(void 0).success;
546
- }
547
- isNullable() {
548
- return this.safeParse(null).success;
549
- }
550
- }
551
- const st = /^c[^\s-]{8,}$/i, nt = /^[0-9a-z]+$/, at = /^[0-9A-HJKMNP-TV-Z]{26}$/, it = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ot = /^[a-z0-9_-]{21}$/i, dt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ct = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ut = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
552
- let Ce;
553
- const lt = /^(?:(?: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])$/, ft = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, ht = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Pe = "((\\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])))", mt = new RegExp(`^${Pe}$`);
554
- function Ve(r) {
555
- let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
556
- return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
557
- }
558
- function pt(r) {
559
- return new RegExp(`^${Ve(r)}$`);
560
- }
561
- function De(r) {
562
- let e = `${Pe}T${Ve(r)}`;
563
- const t = [];
564
- return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
565
- }
566
- function yt(r, e) {
567
- return !!((e === "v4" || !e) && lt.test(r) || (e === "v6" || !e) && ft.test(r));
568
- }
569
- class R extends v {
570
- _parse(e) {
571
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
572
- const a = this._getOrReturnCtx(e);
573
- return l(a, {
574
- code: d.invalid_type,
575
- expected: f.string,
576
- received: a.parsedType
577
- }), y;
578
- }
579
- const s = new Z();
580
- let n;
581
- for (const a of this._def.checks)
582
- if (a.kind === "min")
583
- e.data.length < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
584
- code: d.too_small,
585
- minimum: a.value,
586
- type: "string",
587
- inclusive: !0,
588
- exact: !1,
589
- message: a.message
590
- }), s.dirty());
591
- else if (a.kind === "max")
592
- e.data.length > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
593
- code: d.too_big,
594
- maximum: a.value,
595
- type: "string",
596
- inclusive: !0,
597
- exact: !1,
598
- message: a.message
599
- }), s.dirty());
600
- else if (a.kind === "length") {
601
- const i = e.data.length > a.value, o = e.data.length < a.value;
602
- (i || o) && (n = this._getOrReturnCtx(e, n), i ? l(n, {
603
- code: d.too_big,
604
- maximum: a.value,
605
- type: "string",
606
- inclusive: !0,
607
- exact: !0,
608
- message: a.message
609
- }) : o && l(n, {
610
- code: d.too_small,
611
- minimum: a.value,
612
- type: "string",
613
- inclusive: !0,
614
- exact: !0,
615
- message: a.message
616
- }), s.dirty());
617
- } else if (a.kind === "email")
618
- ct.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
619
- validation: "email",
620
- code: d.invalid_string,
621
- message: a.message
622
- }), s.dirty());
623
- else if (a.kind === "emoji")
624
- Ce || (Ce = new RegExp(ut, "u")), Ce.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
625
- validation: "emoji",
626
- code: d.invalid_string,
627
- message: a.message
628
- }), s.dirty());
629
- else if (a.kind === "uuid")
630
- it.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
631
- validation: "uuid",
632
- code: d.invalid_string,
633
- message: a.message
634
- }), s.dirty());
635
- else if (a.kind === "nanoid")
636
- ot.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
637
- validation: "nanoid",
638
- code: d.invalid_string,
639
- message: a.message
640
- }), s.dirty());
641
- else if (a.kind === "cuid")
642
- st.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
643
- validation: "cuid",
644
- code: d.invalid_string,
645
- message: a.message
646
- }), s.dirty());
647
- else if (a.kind === "cuid2")
648
- nt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
649
- validation: "cuid2",
650
- code: d.invalid_string,
651
- message: a.message
652
- }), s.dirty());
653
- else if (a.kind === "ulid")
654
- at.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
655
- validation: "ulid",
656
- code: d.invalid_string,
657
- message: a.message
658
- }), s.dirty());
659
- else if (a.kind === "url")
660
- try {
661
- new URL(e.data);
662
- } catch {
663
- n = this._getOrReturnCtx(e, n), l(n, {
664
- validation: "url",
665
- code: d.invalid_string,
666
- message: a.message
667
- }), s.dirty();
668
- }
669
- else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
670
- validation: "regex",
671
- code: d.invalid_string,
672
- message: a.message
673
- }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), l(n, {
674
- code: d.invalid_string,
675
- validation: { includes: a.value, position: a.position },
676
- message: a.message
677
- }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n), l(n, {
678
- code: d.invalid_string,
679
- validation: { startsWith: a.value },
680
- message: a.message
681
- }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), l(n, {
682
- code: d.invalid_string,
683
- validation: { endsWith: a.value },
684
- message: a.message
685
- }), s.dirty()) : a.kind === "datetime" ? De(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
686
- code: d.invalid_string,
687
- validation: "datetime",
688
- message: a.message
689
- }), s.dirty()) : a.kind === "date" ? mt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
690
- code: d.invalid_string,
691
- validation: "date",
692
- message: a.message
693
- }), s.dirty()) : a.kind === "time" ? pt(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
694
- code: d.invalid_string,
695
- validation: "time",
696
- message: a.message
697
- }), s.dirty()) : a.kind === "duration" ? dt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
698
- validation: "duration",
699
- code: d.invalid_string,
700
- message: a.message
701
- }), s.dirty()) : a.kind === "ip" ? yt(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
702
- validation: "ip",
703
- code: d.invalid_string,
704
- message: a.message
705
- }), s.dirty()) : a.kind === "base64" ? ht.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
706
- validation: "base64",
707
- code: d.invalid_string,
708
- message: a.message
709
- }), s.dirty()) : x.assertNever(a);
710
- return { status: s.value, value: e.data };
711
- }
712
- _regex(e, t, s) {
713
- return this.refinement((n) => e.test(n), {
714
- validation: t,
715
- code: d.invalid_string,
716
- ...h.errToObj(s)
717
- });
718
- }
719
- _addCheck(e) {
720
- return new R({
721
- ...this._def,
722
- checks: [...this._def.checks, e]
723
- });
724
- }
725
- email(e) {
726
- return this._addCheck({ kind: "email", ...h.errToObj(e) });
727
- }
728
- url(e) {
729
- return this._addCheck({ kind: "url", ...h.errToObj(e) });
730
- }
731
- emoji(e) {
732
- return this._addCheck({ kind: "emoji", ...h.errToObj(e) });
733
- }
734
- uuid(e) {
735
- return this._addCheck({ kind: "uuid", ...h.errToObj(e) });
736
- }
737
- nanoid(e) {
738
- return this._addCheck({ kind: "nanoid", ...h.errToObj(e) });
739
- }
740
- cuid(e) {
741
- return this._addCheck({ kind: "cuid", ...h.errToObj(e) });
742
- }
743
- cuid2(e) {
744
- return this._addCheck({ kind: "cuid2", ...h.errToObj(e) });
745
- }
746
- ulid(e) {
747
- return this._addCheck({ kind: "ulid", ...h.errToObj(e) });
748
- }
749
- base64(e) {
750
- return this._addCheck({ kind: "base64", ...h.errToObj(e) });
751
- }
752
- ip(e) {
753
- return this._addCheck({ kind: "ip", ...h.errToObj(e) });
754
- }
755
- datetime(e) {
756
- var t, s;
757
- return typeof e == "string" ? this._addCheck({
758
- kind: "datetime",
759
- precision: null,
760
- offset: !1,
761
- local: !1,
762
- message: e
763
- }) : this._addCheck({
764
- kind: "datetime",
765
- precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
766
- offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
767
- local: (s = e == null ? void 0 : e.local) !== null && s !== void 0 ? s : !1,
768
- ...h.errToObj(e == null ? void 0 : e.message)
769
- });
770
- }
771
- date(e) {
772
- return this._addCheck({ kind: "date", message: e });
773
- }
774
- time(e) {
775
- return typeof e == "string" ? this._addCheck({
776
- kind: "time",
777
- precision: null,
778
- message: e
779
- }) : this._addCheck({
780
- kind: "time",
781
- precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
782
- ...h.errToObj(e == null ? void 0 : e.message)
783
- });
784
- }
785
- duration(e) {
786
- return this._addCheck({ kind: "duration", ...h.errToObj(e) });
787
- }
788
- regex(e, t) {
789
- return this._addCheck({
790
- kind: "regex",
791
- regex: e,
792
- ...h.errToObj(t)
793
- });
794
- }
795
- includes(e, t) {
796
- return this._addCheck({
797
- kind: "includes",
798
- value: e,
799
- position: t == null ? void 0 : t.position,
800
- ...h.errToObj(t == null ? void 0 : t.message)
801
- });
802
- }
803
- startsWith(e, t) {
804
- return this._addCheck({
805
- kind: "startsWith",
806
- value: e,
807
- ...h.errToObj(t)
808
- });
809
- }
810
- endsWith(e, t) {
811
- return this._addCheck({
812
- kind: "endsWith",
813
- value: e,
814
- ...h.errToObj(t)
815
- });
816
- }
817
- min(e, t) {
818
- return this._addCheck({
819
- kind: "min",
820
- value: e,
821
- ...h.errToObj(t)
822
- });
823
- }
824
- max(e, t) {
825
- return this._addCheck({
826
- kind: "max",
827
- value: e,
828
- ...h.errToObj(t)
829
- });
830
- }
831
- length(e, t) {
832
- return this._addCheck({
833
- kind: "length",
834
- value: e,
835
- ...h.errToObj(t)
836
- });
837
- }
838
- /**
839
- * @deprecated Use z.string().min(1) instead.
840
- * @see {@link ZodString.min}
841
- */
842
- nonempty(e) {
843
- return this.min(1, h.errToObj(e));
844
- }
845
- trim() {
846
- return new R({
847
- ...this._def,
848
- checks: [...this._def.checks, { kind: "trim" }]
849
- });
850
- }
851
- toLowerCase() {
852
- return new R({
853
- ...this._def,
854
- checks: [...this._def.checks, { kind: "toLowerCase" }]
855
- });
856
- }
857
- toUpperCase() {
858
- return new R({
859
- ...this._def,
860
- checks: [...this._def.checks, { kind: "toUpperCase" }]
861
- });
862
- }
863
- get isDatetime() {
864
- return !!this._def.checks.find((e) => e.kind === "datetime");
865
- }
866
- get isDate() {
867
- return !!this._def.checks.find((e) => e.kind === "date");
868
- }
869
- get isTime() {
870
- return !!this._def.checks.find((e) => e.kind === "time");
871
- }
872
- get isDuration() {
873
- return !!this._def.checks.find((e) => e.kind === "duration");
874
- }
875
- get isEmail() {
876
- return !!this._def.checks.find((e) => e.kind === "email");
877
- }
878
- get isURL() {
879
- return !!this._def.checks.find((e) => e.kind === "url");
880
- }
881
- get isEmoji() {
882
- return !!this._def.checks.find((e) => e.kind === "emoji");
883
- }
884
- get isUUID() {
885
- return !!this._def.checks.find((e) => e.kind === "uuid");
886
- }
887
- get isNANOID() {
888
- return !!this._def.checks.find((e) => e.kind === "nanoid");
889
- }
890
- get isCUID() {
891
- return !!this._def.checks.find((e) => e.kind === "cuid");
892
- }
893
- get isCUID2() {
894
- return !!this._def.checks.find((e) => e.kind === "cuid2");
895
- }
896
- get isULID() {
897
- return !!this._def.checks.find((e) => e.kind === "ulid");
898
- }
899
- get isIP() {
900
- return !!this._def.checks.find((e) => e.kind === "ip");
901
- }
902
- get isBase64() {
903
- return !!this._def.checks.find((e) => e.kind === "base64");
904
- }
905
- get minLength() {
906
- let e = null;
907
- for (const t of this._def.checks)
908
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
909
- return e;
910
- }
911
- get maxLength() {
912
- let e = null;
913
- for (const t of this._def.checks)
914
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
915
- return e;
916
- }
917
- }
918
- R.create = (r) => {
919
- var e;
920
- return new R({
921
- checks: [],
922
- typeName: m.ZodString,
923
- coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
924
- ..._(r)
925
- });
926
- };
927
- function _t(r, e) {
928
- const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
929
- return a % i / Math.pow(10, n);
930
- }
931
- class z extends v {
932
- constructor() {
933
- super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
934
- }
935
- _parse(e) {
936
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
937
- const a = this._getOrReturnCtx(e);
938
- return l(a, {
939
- code: d.invalid_type,
940
- expected: f.number,
941
- received: a.parsedType
942
- }), y;
943
- }
944
- let s;
945
- const n = new Z();
946
- for (const a of this._def.checks)
947
- a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
948
- code: d.invalid_type,
949
- expected: "integer",
950
- received: "float",
951
- message: a.message
952
- }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
953
- code: d.too_small,
954
- minimum: a.value,
955
- type: "number",
956
- inclusive: a.inclusive,
957
- exact: !1,
958
- message: a.message
959
- }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
960
- code: d.too_big,
961
- maximum: a.value,
962
- type: "number",
963
- inclusive: a.inclusive,
964
- exact: !1,
965
- message: a.message
966
- }), n.dirty()) : a.kind === "multipleOf" ? _t(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
967
- code: d.not_multiple_of,
968
- multipleOf: a.value,
969
- message: a.message
970
- }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
971
- code: d.not_finite,
972
- message: a.message
973
- }), n.dirty()) : x.assertNever(a);
974
- return { status: n.value, value: e.data };
975
- }
976
- gte(e, t) {
977
- return this.setLimit("min", e, !0, h.toString(t));
978
- }
979
- gt(e, t) {
980
- return this.setLimit("min", e, !1, h.toString(t));
981
- }
982
- lte(e, t) {
983
- return this.setLimit("max", e, !0, h.toString(t));
984
- }
985
- lt(e, t) {
986
- return this.setLimit("max", e, !1, h.toString(t));
987
- }
988
- setLimit(e, t, s, n) {
989
- return new z({
990
- ...this._def,
991
- checks: [
992
- ...this._def.checks,
993
- {
994
- kind: e,
995
- value: t,
996
- inclusive: s,
997
- message: h.toString(n)
998
- }
999
- ]
1000
- });
1001
- }
1002
- _addCheck(e) {
1003
- return new z({
1004
- ...this._def,
1005
- checks: [...this._def.checks, e]
1006
- });
1007
- }
1008
- int(e) {
1009
- return this._addCheck({
1010
- kind: "int",
1011
- message: h.toString(e)
1012
- });
1013
- }
1014
- positive(e) {
1015
- return this._addCheck({
1016
- kind: "min",
1017
- value: 0,
1018
- inclusive: !1,
1019
- message: h.toString(e)
1020
- });
1021
- }
1022
- negative(e) {
1023
- return this._addCheck({
1024
- kind: "max",
1025
- value: 0,
1026
- inclusive: !1,
1027
- message: h.toString(e)
1028
- });
1029
- }
1030
- nonpositive(e) {
1031
- return this._addCheck({
1032
- kind: "max",
1033
- value: 0,
1034
- inclusive: !0,
1035
- message: h.toString(e)
1036
- });
1037
- }
1038
- nonnegative(e) {
1039
- return this._addCheck({
1040
- kind: "min",
1041
- value: 0,
1042
- inclusive: !0,
1043
- message: h.toString(e)
1044
- });
1045
- }
1046
- multipleOf(e, t) {
1047
- return this._addCheck({
1048
- kind: "multipleOf",
1049
- value: e,
1050
- message: h.toString(t)
1051
- });
1052
- }
1053
- finite(e) {
1054
- return this._addCheck({
1055
- kind: "finite",
1056
- message: h.toString(e)
1057
- });
1058
- }
1059
- safe(e) {
1060
- return this._addCheck({
1061
- kind: "min",
1062
- inclusive: !0,
1063
- value: Number.MIN_SAFE_INTEGER,
1064
- message: h.toString(e)
1065
- })._addCheck({
1066
- kind: "max",
1067
- inclusive: !0,
1068
- value: Number.MAX_SAFE_INTEGER,
1069
- message: h.toString(e)
1070
- });
1071
- }
1072
- get minValue() {
1073
- let e = null;
1074
- for (const t of this._def.checks)
1075
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1076
- return e;
1077
- }
1078
- get maxValue() {
1079
- let e = null;
1080
- for (const t of this._def.checks)
1081
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1082
- return e;
1083
- }
1084
- get isInt() {
1085
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
1086
- }
1087
- get isFinite() {
1088
- let e = null, t = null;
1089
- for (const s of this._def.checks) {
1090
- if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
1091
- return !0;
1092
- s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1093
- }
1094
- return Number.isFinite(t) && Number.isFinite(e);
1095
- }
1096
- }
1097
- z.create = (r) => new z({
1098
- checks: [],
1099
- typeName: m.ZodNumber,
1100
- coerce: (r == null ? void 0 : r.coerce) || !1,
1101
- ..._(r)
1102
- });
1103
- class L extends v {
1104
- constructor() {
1105
- super(...arguments), this.min = this.gte, this.max = this.lte;
1106
- }
1107
- _parse(e) {
1108
- if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== f.bigint) {
1109
- const a = this._getOrReturnCtx(e);
1110
- return l(a, {
1111
- code: d.invalid_type,
1112
- expected: f.bigint,
1113
- received: a.parsedType
1114
- }), y;
1115
- }
1116
- let s;
1117
- const n = new Z();
1118
- for (const a of this._def.checks)
1119
- a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1120
- code: d.too_small,
1121
- type: "bigint",
1122
- minimum: a.value,
1123
- inclusive: a.inclusive,
1124
- message: a.message
1125
- }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
1126
- code: d.too_big,
1127
- type: "bigint",
1128
- maximum: a.value,
1129
- inclusive: a.inclusive,
1130
- message: a.message
1131
- }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), l(s, {
1132
- code: d.not_multiple_of,
1133
- multipleOf: a.value,
1134
- message: a.message
1135
- }), n.dirty()) : x.assertNever(a);
1136
- return { status: n.value, value: e.data };
1137
- }
1138
- gte(e, t) {
1139
- return this.setLimit("min", e, !0, h.toString(t));
1140
- }
1141
- gt(e, t) {
1142
- return this.setLimit("min", e, !1, h.toString(t));
1143
- }
1144
- lte(e, t) {
1145
- return this.setLimit("max", e, !0, h.toString(t));
1146
- }
1147
- lt(e, t) {
1148
- return this.setLimit("max", e, !1, h.toString(t));
1149
- }
1150
- setLimit(e, t, s, n) {
1151
- return new L({
1152
- ...this._def,
1153
- checks: [
1154
- ...this._def.checks,
1155
- {
1156
- kind: e,
1157
- value: t,
1158
- inclusive: s,
1159
- message: h.toString(n)
1160
- }
1161
- ]
1162
- });
1163
- }
1164
- _addCheck(e) {
1165
- return new L({
1166
- ...this._def,
1167
- checks: [...this._def.checks, e]
1168
- });
1169
- }
1170
- positive(e) {
1171
- return this._addCheck({
1172
- kind: "min",
1173
- value: BigInt(0),
1174
- inclusive: !1,
1175
- message: h.toString(e)
1176
- });
1177
- }
1178
- negative(e) {
1179
- return this._addCheck({
1180
- kind: "max",
1181
- value: BigInt(0),
1182
- inclusive: !1,
1183
- message: h.toString(e)
1184
- });
1185
- }
1186
- nonpositive(e) {
1187
- return this._addCheck({
1188
- kind: "max",
1189
- value: BigInt(0),
1190
- inclusive: !0,
1191
- message: h.toString(e)
1192
- });
1193
- }
1194
- nonnegative(e) {
1195
- return this._addCheck({
1196
- kind: "min",
1197
- value: BigInt(0),
1198
- inclusive: !0,
1199
- message: h.toString(e)
1200
- });
1201
- }
1202
- multipleOf(e, t) {
1203
- return this._addCheck({
1204
- kind: "multipleOf",
1205
- value: e,
1206
- message: h.toString(t)
1207
- });
1208
- }
1209
- get minValue() {
1210
- let e = null;
1211
- for (const t of this._def.checks)
1212
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1213
- return e;
1214
- }
1215
- get maxValue() {
1216
- let e = null;
1217
- for (const t of this._def.checks)
1218
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1219
- return e;
1220
- }
1221
- }
1222
- L.create = (r) => {
1223
- var e;
1224
- return new L({
1225
- checks: [],
1226
- typeName: m.ZodBigInt,
1227
- coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
1228
- ..._(r)
1229
- });
1230
- };
1231
- class ae extends v {
1232
- _parse(e) {
1233
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1234
- const s = this._getOrReturnCtx(e);
1235
- return l(s, {
1236
- code: d.invalid_type,
1237
- expected: f.boolean,
1238
- received: s.parsedType
1239
- }), y;
1240
- }
1241
- return S(e.data);
1242
- }
1243
- }
1244
- ae.create = (r) => new ae({
1245
- typeName: m.ZodBoolean,
1246
- coerce: (r == null ? void 0 : r.coerce) || !1,
1247
- ..._(r)
1248
- });
1249
- class W extends v {
1250
- _parse(e) {
1251
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1252
- const a = this._getOrReturnCtx(e);
1253
- return l(a, {
1254
- code: d.invalid_type,
1255
- expected: f.date,
1256
- received: a.parsedType
1257
- }), y;
1258
- }
1259
- if (isNaN(e.data.getTime())) {
1260
- const a = this._getOrReturnCtx(e);
1261
- return l(a, {
1262
- code: d.invalid_date
1263
- }), y;
1264
- }
1265
- const s = new Z();
1266
- let n;
1267
- for (const a of this._def.checks)
1268
- a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
1269
- code: d.too_small,
1270
- message: a.message,
1271
- inclusive: !0,
1272
- exact: !1,
1273
- minimum: a.value,
1274
- type: "date"
1275
- }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
1276
- code: d.too_big,
1277
- message: a.message,
1278
- inclusive: !0,
1279
- exact: !1,
1280
- maximum: a.value,
1281
- type: "date"
1282
- }), s.dirty()) : x.assertNever(a);
1283
- return {
1284
- status: s.value,
1285
- value: new Date(e.data.getTime())
1286
- };
1287
- }
1288
- _addCheck(e) {
1289
- return new W({
1290
- ...this._def,
1291
- checks: [...this._def.checks, e]
1292
- });
1293
- }
1294
- min(e, t) {
1295
- return this._addCheck({
1296
- kind: "min",
1297
- value: e.getTime(),
1298
- message: h.toString(t)
1299
- });
1300
- }
1301
- max(e, t) {
1302
- return this._addCheck({
1303
- kind: "max",
1304
- value: e.getTime(),
1305
- message: h.toString(t)
1306
- });
1307
- }
1308
- get minDate() {
1309
- let e = null;
1310
- for (const t of this._def.checks)
1311
- t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1312
- return e != null ? new Date(e) : null;
1313
- }
1314
- get maxDate() {
1315
- let e = null;
1316
- for (const t of this._def.checks)
1317
- t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1318
- return e != null ? new Date(e) : null;
1319
- }
1320
- }
1321
- W.create = (r) => new W({
1322
- checks: [],
1323
- coerce: (r == null ? void 0 : r.coerce) || !1,
1324
- typeName: m.ZodDate,
1325
- ..._(r)
1326
- });
1327
- class be extends v {
1328
- _parse(e) {
1329
- if (this._getType(e) !== f.symbol) {
1330
- const s = this._getOrReturnCtx(e);
1331
- return l(s, {
1332
- code: d.invalid_type,
1333
- expected: f.symbol,
1334
- received: s.parsedType
1335
- }), y;
1336
- }
1337
- return S(e.data);
1338
- }
1339
- }
1340
- be.create = (r) => new be({
1341
- typeName: m.ZodSymbol,
1342
- ..._(r)
1343
- });
1344
- class ie extends v {
1345
- _parse(e) {
1346
- if (this._getType(e) !== f.undefined) {
1347
- const s = this._getOrReturnCtx(e);
1348
- return l(s, {
1349
- code: d.invalid_type,
1350
- expected: f.undefined,
1351
- received: s.parsedType
1352
- }), y;
1353
- }
1354
- return S(e.data);
1355
- }
1356
- }
1357
- ie.create = (r) => new ie({
1358
- typeName: m.ZodUndefined,
1359
- ..._(r)
1360
- });
1361
- class oe extends v {
1362
- _parse(e) {
1363
- if (this._getType(e) !== f.null) {
1364
- const s = this._getOrReturnCtx(e);
1365
- return l(s, {
1366
- code: d.invalid_type,
1367
- expected: f.null,
1368
- received: s.parsedType
1369
- }), y;
1370
- }
1371
- return S(e.data);
1372
- }
1373
- }
1374
- oe.create = (r) => new oe({
1375
- typeName: m.ZodNull,
1376
- ..._(r)
1377
- });
1378
- class X extends v {
1379
- constructor() {
1380
- super(...arguments), this._any = !0;
1381
- }
1382
- _parse(e) {
1383
- return S(e.data);
1384
- }
1385
- }
1386
- X.create = (r) => new X({
1387
- typeName: m.ZodAny,
1388
- ..._(r)
1389
- });
1390
- class B extends v {
1391
- constructor() {
1392
- super(...arguments), this._unknown = !0;
1393
- }
1394
- _parse(e) {
1395
- return S(e.data);
1396
- }
1397
- }
1398
- B.create = (r) => new B({
1399
- typeName: m.ZodUnknown,
1400
- ..._(r)
1401
- });
1402
- class V extends v {
1403
- _parse(e) {
1404
- const t = this._getOrReturnCtx(e);
1405
- return l(t, {
1406
- code: d.invalid_type,
1407
- expected: f.never,
1408
- received: t.parsedType
1409
- }), y;
1410
- }
1411
- }
1412
- V.create = (r) => new V({
1413
- typeName: m.ZodNever,
1414
- ..._(r)
1415
- });
1416
- class we extends v {
1417
- _parse(e) {
1418
- if (this._getType(e) !== f.undefined) {
1419
- const s = this._getOrReturnCtx(e);
1420
- return l(s, {
1421
- code: d.invalid_type,
1422
- expected: f.void,
1423
- received: s.parsedType
1424
- }), y;
1425
- }
1426
- return S(e.data);
1427
- }
1428
- }
1429
- we.create = (r) => new we({
1430
- typeName: m.ZodVoid,
1431
- ..._(r)
1432
- });
1433
- class I extends v {
1434
- _parse(e) {
1435
- const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
1436
- if (t.parsedType !== f.array)
1437
- return l(t, {
1438
- code: d.invalid_type,
1439
- expected: f.array,
1440
- received: t.parsedType
1441
- }), y;
1442
- if (n.exactLength !== null) {
1443
- const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
1444
- (i || o) && (l(t, {
1445
- code: i ? d.too_big : d.too_small,
1446
- minimum: o ? n.exactLength.value : void 0,
1447
- maximum: i ? n.exactLength.value : void 0,
1448
- type: "array",
1449
- inclusive: !0,
1450
- exact: !0,
1451
- message: n.exactLength.message
1452
- }), s.dirty());
1453
- }
1454
- if (n.minLength !== null && t.data.length < n.minLength.value && (l(t, {
1455
- code: d.too_small,
1456
- minimum: n.minLength.value,
1457
- type: "array",
1458
- inclusive: !0,
1459
- exact: !1,
1460
- message: n.minLength.message
1461
- }), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (l(t, {
1462
- code: d.too_big,
1463
- maximum: n.maxLength.value,
1464
- type: "array",
1465
- inclusive: !0,
1466
- exact: !1,
1467
- message: n.maxLength.message
1468
- }), s.dirty()), t.common.async)
1469
- return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new M(t, i, t.path, o)))).then((i) => Z.mergeArray(s, i));
1470
- const a = [...t.data].map((i, o) => n.type._parseSync(new M(t, i, t.path, o)));
1471
- return Z.mergeArray(s, a);
1472
- }
1473
- get element() {
1474
- return this._def.type;
1475
- }
1476
- min(e, t) {
1477
- return new I({
1478
- ...this._def,
1479
- minLength: { value: e, message: h.toString(t) }
1480
- });
1481
- }
1482
- max(e, t) {
1483
- return new I({
1484
- ...this._def,
1485
- maxLength: { value: e, message: h.toString(t) }
1486
- });
1487
- }
1488
- length(e, t) {
1489
- return new I({
1490
- ...this._def,
1491
- exactLength: { value: e, message: h.toString(t) }
1492
- });
1493
- }
1494
- nonempty(e) {
1495
- return this.min(1, e);
1496
- }
1497
- }
1498
- I.create = (r, e) => new I({
1499
- type: r,
1500
- minLength: null,
1501
- maxLength: null,
1502
- exactLength: null,
1503
- typeName: m.ZodArray,
1504
- ..._(e)
1505
- });
1506
- function J(r) {
1507
- if (r instanceof k) {
1508
- const e = {};
1509
- for (const t in r.shape) {
1510
- const s = r.shape[t];
1511
- e[t] = A.create(J(s));
1512
- }
1513
- return new k({
1514
- ...r._def,
1515
- shape: () => e
1516
- });
1517
- } else return r instanceof I ? new I({
1518
- ...r._def,
1519
- type: J(r.element)
1520
- }) : r instanceof A ? A.create(J(r.unwrap())) : r instanceof U ? U.create(J(r.unwrap())) : r instanceof $ ? $.create(r.items.map((e) => J(e))) : r;
1521
- }
1522
- class k extends v {
1523
- constructor() {
1524
- super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1525
- }
1526
- _getCached() {
1527
- if (this._cached !== null)
1528
- return this._cached;
1529
- const e = this._def.shape(), t = x.objectKeys(e);
1530
- return this._cached = { shape: e, keys: t };
1531
- }
1532
- _parse(e) {
1533
- if (this._getType(e) !== f.object) {
1534
- const c = this._getOrReturnCtx(e);
1535
- return l(c, {
1536
- code: d.invalid_type,
1537
- expected: f.object,
1538
- received: c.parsedType
1539
- }), y;
1540
- }
1541
- const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1542
- if (!(this._def.catchall instanceof V && this._def.unknownKeys === "strip"))
1543
- for (const c in n.data)
1544
- i.includes(c) || o.push(c);
1545
- const u = [];
1546
- for (const c of i) {
1547
- const p = a[c], C = n.data[c];
1548
- u.push({
1549
- key: { status: "valid", value: c },
1550
- value: p._parse(new M(n, C, n.path, c)),
1551
- alwaysSet: c in n.data
1552
- });
1553
- }
1554
- if (this._def.catchall instanceof V) {
1555
- const c = this._def.unknownKeys;
1556
- if (c === "passthrough")
1557
- for (const p of o)
1558
- u.push({
1559
- key: { status: "valid", value: p },
1560
- value: { status: "valid", value: n.data[p] }
1561
- });
1562
- else if (c === "strict")
1563
- o.length > 0 && (l(n, {
1564
- code: d.unrecognized_keys,
1565
- keys: o
1566
- }), s.dirty());
1567
- else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1568
- } else {
1569
- const c = this._def.catchall;
1570
- for (const p of o) {
1571
- const C = n.data[p];
1572
- u.push({
1573
- key: { status: "valid", value: p },
1574
- value: c._parse(
1575
- new M(n, C, n.path, p)
1576
- //, ctx.child(key), value, getParsedType(value)
1577
- ),
1578
- alwaysSet: p in n.data
1579
- });
1580
- }
1581
- }
1582
- return n.common.async ? Promise.resolve().then(async () => {
1583
- const c = [];
1584
- for (const p of u) {
1585
- const C = await p.key, ve = await p.value;
1586
- c.push({
1587
- key: C,
1588
- value: ve,
1589
- alwaysSet: p.alwaysSet
1590
- });
1591
- }
1592
- return c;
1593
- }).then((c) => Z.mergeObjectSync(s, c)) : Z.mergeObjectSync(s, u);
1594
- }
1595
- get shape() {
1596
- return this._def.shape();
1597
- }
1598
- strict(e) {
1599
- return h.errToObj, new k({
1600
- ...this._def,
1601
- unknownKeys: "strict",
1602
- ...e !== void 0 ? {
1603
- errorMap: (t, s) => {
1604
- var n, a, i, o;
1605
- const u = (i = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
1606
- return t.code === "unrecognized_keys" ? {
1607
- message: (o = h.errToObj(e).message) !== null && o !== void 0 ? o : u
1608
- } : {
1609
- message: u
1610
- };
1611
- }
1612
- } : {}
1613
- });
1614
- }
1615
- strip() {
1616
- return new k({
1617
- ...this._def,
1618
- unknownKeys: "strip"
1619
- });
1620
- }
1621
- passthrough() {
1622
- return new k({
1623
- ...this._def,
1624
- unknownKeys: "passthrough"
1625
- });
1626
- }
1627
- // const AugmentFactory =
1628
- // <Def extends ZodObjectDef>(def: Def) =>
1629
- // <Augmentation extends ZodRawShape>(
1630
- // augmentation: Augmentation
1631
- // ): ZodObject<
1632
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
1633
- // Def["unknownKeys"],
1634
- // Def["catchall"]
1635
- // > => {
1636
- // return new ZodObject({
1637
- // ...def,
1638
- // shape: () => ({
1639
- // ...def.shape(),
1640
- // ...augmentation,
1641
- // }),
1642
- // }) as any;
1643
- // };
1644
- extend(e) {
1645
- return new k({
1646
- ...this._def,
1647
- shape: () => ({
1648
- ...this._def.shape(),
1649
- ...e
1650
- })
1651
- });
1652
- }
1653
- /**
1654
- * Prior to zod@1.0.12 there was a bug in the
1655
- * inferred type of merged objects. Please
1656
- * upgrade if you are experiencing issues.
1657
- */
1658
- merge(e) {
1659
- return new k({
1660
- unknownKeys: e._def.unknownKeys,
1661
- catchall: e._def.catchall,
1662
- shape: () => ({
1663
- ...this._def.shape(),
1664
- ...e._def.shape()
1665
- }),
1666
- typeName: m.ZodObject
1667
- });
1668
- }
1669
- // merge<
1670
- // Incoming extends AnyZodObject,
1671
- // Augmentation extends Incoming["shape"],
1672
- // NewOutput extends {
1673
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1674
- // ? Augmentation[k]["_output"]
1675
- // : k extends keyof Output
1676
- // ? Output[k]
1677
- // : never;
1678
- // },
1679
- // NewInput extends {
1680
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1681
- // ? Augmentation[k]["_input"]
1682
- // : k extends keyof Input
1683
- // ? Input[k]
1684
- // : never;
1685
- // }
1686
- // >(
1687
- // merging: Incoming
1688
- // ): ZodObject<
1689
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1690
- // Incoming["_def"]["unknownKeys"],
1691
- // Incoming["_def"]["catchall"],
1692
- // NewOutput,
1693
- // NewInput
1694
- // > {
1695
- // const merged: any = new ZodObject({
1696
- // unknownKeys: merging._def.unknownKeys,
1697
- // catchall: merging._def.catchall,
1698
- // shape: () =>
1699
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1700
- // typeName: ZodFirstPartyTypeKind.ZodObject,
1701
- // }) as any;
1702
- // return merged;
1703
- // }
1704
- setKey(e, t) {
1705
- return this.augment({ [e]: t });
1706
- }
1707
- // merge<Incoming extends AnyZodObject>(
1708
- // merging: Incoming
1709
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
1710
- // ZodObject<
1711
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1712
- // Incoming["_def"]["unknownKeys"],
1713
- // Incoming["_def"]["catchall"]
1714
- // > {
1715
- // // const mergedShape = objectUtil.mergeShapes(
1716
- // // this._def.shape(),
1717
- // // merging._def.shape()
1718
- // // );
1719
- // const merged: any = new ZodObject({
1720
- // unknownKeys: merging._def.unknownKeys,
1721
- // catchall: merging._def.catchall,
1722
- // shape: () =>
1723
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1724
- // typeName: ZodFirstPartyTypeKind.ZodObject,
1725
- // }) as any;
1726
- // return merged;
1727
- // }
1728
- catchall(e) {
1729
- return new k({
1730
- ...this._def,
1731
- catchall: e
1732
- });
1733
- }
1734
- pick(e) {
1735
- const t = {};
1736
- return x.objectKeys(e).forEach((s) => {
1737
- e[s] && this.shape[s] && (t[s] = this.shape[s]);
1738
- }), new k({
1739
- ...this._def,
1740
- shape: () => t
1741
- });
1742
- }
1743
- omit(e) {
1744
- const t = {};
1745
- return x.objectKeys(this.shape).forEach((s) => {
1746
- e[s] || (t[s] = this.shape[s]);
1747
- }), new k({
1748
- ...this._def,
1749
- shape: () => t
1750
- });
1751
- }
1752
- /**
1753
- * @deprecated
1754
- */
1755
- deepPartial() {
1756
- return J(this);
1757
- }
1758
- partial(e) {
1759
- const t = {};
1760
- return x.objectKeys(this.shape).forEach((s) => {
1761
- const n = this.shape[s];
1762
- e && !e[s] ? t[s] = n : t[s] = n.optional();
1763
- }), new k({
1764
- ...this._def,
1765
- shape: () => t
1766
- });
1767
- }
1768
- required(e) {
1769
- const t = {};
1770
- return x.objectKeys(this.shape).forEach((s) => {
1771
- if (e && !e[s])
1772
- t[s] = this.shape[s];
1773
- else {
1774
- let a = this.shape[s];
1775
- for (; a instanceof A; )
1776
- a = a._def.innerType;
1777
- t[s] = a;
1778
- }
1779
- }), new k({
1780
- ...this._def,
1781
- shape: () => t
1782
- });
1783
- }
1784
- keyof() {
1785
- return ze(x.objectKeys(this.shape));
1786
- }
1787
- }
1788
- k.create = (r, e) => new k({
1789
- shape: () => r,
1790
- unknownKeys: "strip",
1791
- catchall: V.create(),
1792
- typeName: m.ZodObject,
1793
- ..._(e)
1794
- });
1795
- k.strictCreate = (r, e) => new k({
1796
- shape: () => r,
1797
- unknownKeys: "strict",
1798
- catchall: V.create(),
1799
- typeName: m.ZodObject,
1800
- ..._(e)
1801
- });
1802
- k.lazycreate = (r, e) => new k({
1803
- shape: r,
1804
- unknownKeys: "strip",
1805
- catchall: V.create(),
1806
- typeName: m.ZodObject,
1807
- ..._(e)
1808
- });
1809
- class de extends v {
1810
- _parse(e) {
1811
- const { ctx: t } = this._processInputParams(e), s = this._def.options;
1812
- function n(a) {
1813
- for (const o of a)
1814
- if (o.result.status === "valid")
1815
- return o.result;
1816
- for (const o of a)
1817
- if (o.result.status === "dirty")
1818
- return t.common.issues.push(...o.ctx.common.issues), o.result;
1819
- const i = a.map((o) => new O(o.ctx.common.issues));
1820
- return l(t, {
1821
- code: d.invalid_union,
1822
- unionErrors: i
1823
- }), y;
1824
- }
1825
- if (t.common.async)
1826
- return Promise.all(s.map(async (a) => {
1827
- const i = {
1828
- ...t,
1829
- common: {
1830
- ...t.common,
1831
- issues: []
1832
- },
1833
- parent: null
1834
- };
1835
- return {
1836
- result: await a._parseAsync({
1837
- data: t.data,
1838
- path: t.path,
1839
- parent: i
1840
- }),
1841
- ctx: i
1842
- };
1843
- })).then(n);
1844
- {
1845
- let a;
1846
- const i = [];
1847
- for (const u of s) {
1848
- const c = {
1849
- ...t,
1850
- common: {
1851
- ...t.common,
1852
- issues: []
1853
- },
1854
- parent: null
1855
- }, p = u._parseSync({
1856
- data: t.data,
1857
- path: t.path,
1858
- parent: c
1859
- });
1860
- if (p.status === "valid")
1861
- return p;
1862
- p.status === "dirty" && !a && (a = { result: p, ctx: c }), c.common.issues.length && i.push(c.common.issues);
1863
- }
1864
- if (a)
1865
- return t.common.issues.push(...a.ctx.common.issues), a.result;
1866
- const o = i.map((u) => new O(u));
1867
- return l(t, {
1868
- code: d.invalid_union,
1869
- unionErrors: o
1870
- }), y;
1871
- }
1872
- }
1873
- get options() {
1874
- return this._def.options;
1875
- }
1876
- }
1877
- de.create = (r, e) => new de({
1878
- options: r,
1879
- typeName: m.ZodUnion,
1880
- ..._(e)
1881
- });
1882
- const P = (r) => r instanceof le ? P(r.schema) : r instanceof j ? P(r.innerType()) : r instanceof fe ? [r.value] : r instanceof q ? r.options : r instanceof he ? x.objectValues(r.enum) : r instanceof me ? P(r._def.innerType) : r instanceof ie ? [void 0] : r instanceof oe ? [null] : r instanceof A ? [void 0, ...P(r.unwrap())] : r instanceof U ? [null, ...P(r.unwrap())] : r instanceof Ie || r instanceof ye ? P(r.unwrap()) : r instanceof pe ? P(r._def.innerType) : [];
1883
- class Se extends v {
1884
- _parse(e) {
1885
- const { ctx: t } = this._processInputParams(e);
1886
- if (t.parsedType !== f.object)
1887
- return l(t, {
1888
- code: d.invalid_type,
1889
- expected: f.object,
1890
- received: t.parsedType
1891
- }), y;
1892
- const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
1893
- return a ? t.common.async ? a._parseAsync({
1894
- data: t.data,
1895
- path: t.path,
1896
- parent: t
1897
- }) : a._parseSync({
1898
- data: t.data,
1899
- path: t.path,
1900
- parent: t
1901
- }) : (l(t, {
1902
- code: d.invalid_union_discriminator,
1903
- options: Array.from(this.optionsMap.keys()),
1904
- path: [s]
1905
- }), y);
1906
- }
1907
- get discriminator() {
1908
- return this._def.discriminator;
1909
- }
1910
- get options() {
1911
- return this._def.options;
1912
- }
1913
- get optionsMap() {
1914
- return this._def.optionsMap;
1915
- }
1916
- /**
1917
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
1918
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
1919
- * have a different value for each object in the union.
1920
- * @param discriminator the name of the discriminator property
1921
- * @param types an array of object schemas
1922
- * @param params
1923
- */
1924
- static create(e, t, s) {
1925
- const n = /* @__PURE__ */ new Map();
1926
- for (const a of t) {
1927
- const i = P(a.shape[e]);
1928
- if (!i.length)
1929
- throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
1930
- for (const o of i) {
1931
- if (n.has(o))
1932
- throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
1933
- n.set(o, a);
1934
- }
1935
- }
1936
- return new Se({
1937
- typeName: m.ZodDiscriminatedUnion,
1938
- discriminator: e,
1939
- options: t,
1940
- optionsMap: n,
1941
- ..._(s)
1942
- });
1943
- }
1944
- }
1945
- function Re(r, e) {
1946
- const t = D(r), s = D(e);
1947
- if (r === e)
1948
- return { valid: !0, data: r };
1949
- if (t === f.object && s === f.object) {
1950
- const n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = { ...r, ...e };
1951
- for (const o of a) {
1952
- const u = Re(r[o], e[o]);
1953
- if (!u.valid)
1954
- return { valid: !1 };
1955
- i[o] = u.data;
1956
- }
1957
- return { valid: !0, data: i };
1958
- } else if (t === f.array && s === f.array) {
1959
- if (r.length !== e.length)
1960
- return { valid: !1 };
1961
- const n = [];
1962
- for (let a = 0; a < r.length; a++) {
1963
- const i = r[a], o = e[a], u = Re(i, o);
1964
- if (!u.valid)
1965
- return { valid: !1 };
1966
- n.push(u.data);
1967
- }
1968
- return { valid: !0, data: n };
1969
- } else return t === f.date && s === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
1970
- }
1971
- class ce extends v {
1972
- _parse(e) {
1973
- const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
1974
- if (Ee(a) || Ee(i))
1975
- return y;
1976
- const o = Re(a.value, i.value);
1977
- return o.valid ? ((Oe(a) || Oe(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(s, {
1978
- code: d.invalid_intersection_types
1979
- }), y);
1980
- };
1981
- return s.common.async ? Promise.all([
1982
- this._def.left._parseAsync({
1983
- data: s.data,
1984
- path: s.path,
1985
- parent: s
1986
- }),
1987
- this._def.right._parseAsync({
1988
- data: s.data,
1989
- path: s.path,
1990
- parent: s
1991
- })
1992
- ]).then(([a, i]) => n(a, i)) : n(this._def.left._parseSync({
1993
- data: s.data,
1994
- path: s.path,
1995
- parent: s
1996
- }), this._def.right._parseSync({
1997
- data: s.data,
1998
- path: s.path,
1999
- parent: s
2000
- }));
2001
- }
2002
- }
2003
- ce.create = (r, e, t) => new ce({
2004
- left: r,
2005
- right: e,
2006
- typeName: m.ZodIntersection,
2007
- ..._(t)
2008
- });
2009
- class $ extends v {
2010
- _parse(e) {
2011
- const { status: t, ctx: s } = this._processInputParams(e);
2012
- if (s.parsedType !== f.array)
2013
- return l(s, {
2014
- code: d.invalid_type,
2015
- expected: f.array,
2016
- received: s.parsedType
2017
- }), y;
2018
- if (s.data.length < this._def.items.length)
2019
- return l(s, {
2020
- code: d.too_small,
2021
- minimum: this._def.items.length,
2022
- inclusive: !0,
2023
- exact: !1,
2024
- type: "array"
2025
- }), y;
2026
- !this._def.rest && s.data.length > this._def.items.length && (l(s, {
2027
- code: d.too_big,
2028
- maximum: this._def.items.length,
2029
- inclusive: !0,
2030
- exact: !1,
2031
- type: "array"
2032
- }), t.dirty());
2033
- const a = [...s.data].map((i, o) => {
2034
- const u = this._def.items[o] || this._def.rest;
2035
- return u ? u._parse(new M(s, i, s.path, o)) : null;
2036
- }).filter((i) => !!i);
2037
- return s.common.async ? Promise.all(a).then((i) => Z.mergeArray(t, i)) : Z.mergeArray(t, a);
2038
- }
2039
- get items() {
2040
- return this._def.items;
2041
- }
2042
- rest(e) {
2043
- return new $({
2044
- ...this._def,
2045
- rest: e
2046
- });
2047
- }
2048
- }
2049
- $.create = (r, e) => {
2050
- if (!Array.isArray(r))
2051
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2052
- return new $({
2053
- items: r,
2054
- typeName: m.ZodTuple,
2055
- rest: null,
2056
- ..._(e)
2057
- });
2058
- };
2059
- class ue extends v {
2060
- get keySchema() {
2061
- return this._def.keyType;
2062
- }
2063
- get valueSchema() {
2064
- return this._def.valueType;
2065
- }
2066
- _parse(e) {
2067
- const { status: t, ctx: s } = this._processInputParams(e);
2068
- if (s.parsedType !== f.object)
2069
- return l(s, {
2070
- code: d.invalid_type,
2071
- expected: f.object,
2072
- received: s.parsedType
2073
- }), y;
2074
- const n = [], a = this._def.keyType, i = this._def.valueType;
2075
- for (const o in s.data)
2076
- n.push({
2077
- key: a._parse(new M(s, o, s.path, o)),
2078
- value: i._parse(new M(s, s.data[o], s.path, o)),
2079
- alwaysSet: o in s.data
2080
- });
2081
- return s.common.async ? Z.mergeObjectAsync(t, n) : Z.mergeObjectSync(t, n);
2082
- }
2083
- get element() {
2084
- return this._def.valueType;
2085
- }
2086
- static create(e, t, s) {
2087
- return t instanceof v ? new ue({
2088
- keyType: e,
2089
- valueType: t,
2090
- typeName: m.ZodRecord,
2091
- ..._(s)
2092
- }) : new ue({
2093
- keyType: R.create(),
2094
- valueType: e,
2095
- typeName: m.ZodRecord,
2096
- ..._(t)
2097
- });
2098
- }
2099
- }
2100
- class Te extends v {
2101
- get keySchema() {
2102
- return this._def.keyType;
2103
- }
2104
- get valueSchema() {
2105
- return this._def.valueType;
2106
- }
2107
- _parse(e) {
2108
- const { status: t, ctx: s } = this._processInputParams(e);
2109
- if (s.parsedType !== f.map)
2110
- return l(s, {
2111
- code: d.invalid_type,
2112
- expected: f.map,
2113
- received: s.parsedType
2114
- }), y;
2115
- const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, u], c) => ({
2116
- key: n._parse(new M(s, o, s.path, [c, "key"])),
2117
- value: a._parse(new M(s, u, s.path, [c, "value"]))
2118
- }));
2119
- if (s.common.async) {
2120
- const o = /* @__PURE__ */ new Map();
2121
- return Promise.resolve().then(async () => {
2122
- for (const u of i) {
2123
- const c = await u.key, p = await u.value;
2124
- if (c.status === "aborted" || p.status === "aborted")
2125
- return y;
2126
- (c.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(c.value, p.value);
2127
- }
2128
- return { status: t.value, value: o };
2129
- });
2130
- } else {
2131
- const o = /* @__PURE__ */ new Map();
2132
- for (const u of i) {
2133
- const c = u.key, p = u.value;
2134
- if (c.status === "aborted" || p.status === "aborted")
2135
- return y;
2136
- (c.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(c.value, p.value);
2137
- }
2138
- return { status: t.value, value: o };
2139
- }
2140
- }
2141
- }
2142
- Te.create = (r, e, t) => new Te({
2143
- valueType: e,
2144
- keyType: r,
2145
- typeName: m.ZodMap,
2146
- ..._(t)
2147
- });
2148
- class G extends v {
2149
- _parse(e) {
2150
- const { status: t, ctx: s } = this._processInputParams(e);
2151
- if (s.parsedType !== f.set)
2152
- return l(s, {
2153
- code: d.invalid_type,
2154
- expected: f.set,
2155
- received: s.parsedType
2156
- }), y;
2157
- const n = this._def;
2158
- n.minSize !== null && s.data.size < n.minSize.value && (l(s, {
2159
- code: d.too_small,
2160
- minimum: n.minSize.value,
2161
- type: "set",
2162
- inclusive: !0,
2163
- exact: !1,
2164
- message: n.minSize.message
2165
- }), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (l(s, {
2166
- code: d.too_big,
2167
- maximum: n.maxSize.value,
2168
- type: "set",
2169
- inclusive: !0,
2170
- exact: !1,
2171
- message: n.maxSize.message
2172
- }), t.dirty());
2173
- const a = this._def.valueType;
2174
- function i(u) {
2175
- const c = /* @__PURE__ */ new Set();
2176
- for (const p of u) {
2177
- if (p.status === "aborted")
2178
- return y;
2179
- p.status === "dirty" && t.dirty(), c.add(p.value);
2180
- }
2181
- return { status: t.value, value: c };
2182
- }
2183
- const o = [...s.data.values()].map((u, c) => a._parse(new M(s, u, s.path, c)));
2184
- return s.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
2185
- }
2186
- min(e, t) {
2187
- return new G({
2188
- ...this._def,
2189
- minSize: { value: e, message: h.toString(t) }
2190
- });
2191
- }
2192
- max(e, t) {
2193
- return new G({
2194
- ...this._def,
2195
- maxSize: { value: e, message: h.toString(t) }
2196
- });
2197
- }
2198
- size(e, t) {
2199
- return this.min(e, t).max(e, t);
2200
- }
2201
- nonempty(e) {
2202
- return this.min(1, e);
2203
- }
2204
- }
2205
- G.create = (r, e) => new G({
2206
- valueType: r,
2207
- minSize: null,
2208
- maxSize: null,
2209
- typeName: m.ZodSet,
2210
- ..._(e)
2211
- });
2212
- class H extends v {
2213
- constructor() {
2214
- super(...arguments), this.validate = this.implement;
2215
- }
2216
- _parse(e) {
2217
- const { ctx: t } = this._processInputParams(e);
2218
- if (t.parsedType !== f.function)
2219
- return l(t, {
2220
- code: d.invalid_type,
2221
- expected: f.function,
2222
- received: t.parsedType
2223
- }), y;
2224
- function s(o, u) {
2225
- return xe({
2226
- data: o,
2227
- path: t.path,
2228
- errorMaps: [
2229
- t.common.contextualErrorMap,
2230
- t.schemaErrorMap,
2231
- ge(),
2232
- Q
2233
- ].filter((c) => !!c),
2234
- issueData: {
2235
- code: d.invalid_arguments,
2236
- argumentsError: u
2237
- }
2238
- });
2239
- }
2240
- function n(o, u) {
2241
- return xe({
2242
- data: o,
2243
- path: t.path,
2244
- errorMaps: [
2245
- t.common.contextualErrorMap,
2246
- t.schemaErrorMap,
2247
- ge(),
2248
- Q
2249
- ].filter((c) => !!c),
2250
- issueData: {
2251
- code: d.invalid_return_type,
2252
- returnTypeError: u
2253
- }
2254
- });
2255
- }
2256
- const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2257
- if (this._def.returns instanceof K) {
2258
- const o = this;
2259
- return S(async function(...u) {
2260
- const c = new O([]), p = await o._def.args.parseAsync(u, a).catch((F) => {
2261
- throw c.addIssue(s(u, F)), c;
2262
- }), C = await Reflect.apply(i, this, p);
2263
- return await o._def.returns._def.type.parseAsync(C, a).catch((F) => {
2264
- throw c.addIssue(n(C, F)), c;
2265
- });
2266
- });
2267
- } else {
2268
- const o = this;
2269
- return S(function(...u) {
2270
- const c = o._def.args.safeParse(u, a);
2271
- if (!c.success)
2272
- throw new O([s(u, c.error)]);
2273
- const p = Reflect.apply(i, this, c.data), C = o._def.returns.safeParse(p, a);
2274
- if (!C.success)
2275
- throw new O([n(p, C.error)]);
2276
- return C.data;
2277
- });
2278
- }
2279
- }
2280
- parameters() {
2281
- return this._def.args;
2282
- }
2283
- returnType() {
2284
- return this._def.returns;
2285
- }
2286
- args(...e) {
2287
- return new H({
2288
- ...this._def,
2289
- args: $.create(e).rest(B.create())
2290
- });
2291
- }
2292
- returns(e) {
2293
- return new H({
2294
- ...this._def,
2295
- returns: e
2296
- });
2297
- }
2298
- implement(e) {
2299
- return this.parse(e);
2300
- }
2301
- strictImplement(e) {
2302
- return this.parse(e);
2303
- }
2304
- static create(e, t, s) {
2305
- return new H({
2306
- args: e || $.create([]).rest(B.create()),
2307
- returns: t || B.create(),
2308
- typeName: m.ZodFunction,
2309
- ..._(s)
2310
- });
2311
- }
2312
- }
2313
- class le extends v {
2314
- get schema() {
2315
- return this._def.getter();
2316
- }
2317
- _parse(e) {
2318
- const { ctx: t } = this._processInputParams(e);
2319
- return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2320
- }
2321
- }
2322
- le.create = (r, e) => new le({
2323
- getter: r,
2324
- typeName: m.ZodLazy,
2325
- ..._(e)
2326
- });
2327
- class fe extends v {
2328
- _parse(e) {
2329
- if (e.data !== this._def.value) {
2330
- const t = this._getOrReturnCtx(e);
2331
- return l(t, {
2332
- received: t.data,
2333
- code: d.invalid_literal,
2334
- expected: this._def.value
2335
- }), y;
2336
- }
2337
- return { status: "valid", value: e.data };
2338
- }
2339
- get value() {
2340
- return this._def.value;
2341
- }
2342
- }
2343
- fe.create = (r, e) => new fe({
2344
- value: r,
2345
- typeName: m.ZodLiteral,
2346
- ..._(e)
2347
- });
2348
- function ze(r, e) {
2349
- return new q({
2350
- values: r,
2351
- typeName: m.ZodEnum,
2352
- ..._(e)
2353
- });
2354
- }
2355
- class q extends v {
2356
- constructor() {
2357
- super(...arguments), te.set(this, void 0);
2358
- }
2359
- _parse(e) {
2360
- if (typeof e.data != "string") {
2361
- const t = this._getOrReturnCtx(e), s = this._def.values;
2362
- return l(t, {
2363
- expected: x.joinValues(s),
2364
- received: t.parsedType,
2365
- code: d.invalid_type
2366
- }), y;
2367
- }
2368
- if (ke(this, te) || $e(this, te, new Set(this._def.values)), !ke(this, te).has(e.data)) {
2369
- const t = this._getOrReturnCtx(e), s = this._def.values;
2370
- return l(t, {
2371
- received: t.data,
2372
- code: d.invalid_enum_value,
2373
- options: s
2374
- }), y;
2375
- }
2376
- return S(e.data);
2377
- }
2378
- get options() {
2379
- return this._def.values;
2380
- }
2381
- get enum() {
2382
- const e = {};
2383
- for (const t of this._def.values)
2384
- e[t] = t;
2385
- return e;
2386
- }
2387
- get Values() {
2388
- const e = {};
2389
- for (const t of this._def.values)
2390
- e[t] = t;
2391
- return e;
2392
- }
2393
- get Enum() {
2394
- const e = {};
2395
- for (const t of this._def.values)
2396
- e[t] = t;
2397
- return e;
2398
- }
2399
- extract(e, t = this._def) {
2400
- return q.create(e, {
2401
- ...this._def,
2402
- ...t
2403
- });
2404
- }
2405
- exclude(e, t = this._def) {
2406
- return q.create(this.options.filter((s) => !e.includes(s)), {
2407
- ...this._def,
2408
- ...t
2409
- });
2410
- }
2411
- }
2412
- te = /* @__PURE__ */ new WeakMap();
2413
- q.create = ze;
2414
- class he extends v {
2415
- constructor() {
2416
- super(...arguments), re.set(this, void 0);
2417
- }
2418
- _parse(e) {
2419
- const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2420
- if (s.parsedType !== f.string && s.parsedType !== f.number) {
2421
- const n = x.objectValues(t);
2422
- return l(s, {
2423
- expected: x.joinValues(n),
2424
- received: s.parsedType,
2425
- code: d.invalid_type
2426
- }), y;
2427
- }
2428
- if (ke(this, re) || $e(this, re, new Set(x.getValidEnumValues(this._def.values))), !ke(this, re).has(e.data)) {
2429
- const n = x.objectValues(t);
2430
- return l(s, {
2431
- received: s.data,
2432
- code: d.invalid_enum_value,
2433
- options: n
2434
- }), y;
2435
- }
2436
- return S(e.data);
2437
- }
2438
- get enum() {
2439
- return this._def.values;
2440
- }
2441
- }
2442
- re = /* @__PURE__ */ new WeakMap();
2443
- he.create = (r, e) => new he({
2444
- values: r,
2445
- typeName: m.ZodNativeEnum,
2446
- ..._(e)
2447
- });
2448
- class K extends v {
2449
- unwrap() {
2450
- return this._def.type;
2451
- }
2452
- _parse(e) {
2453
- const { ctx: t } = this._processInputParams(e);
2454
- if (t.parsedType !== f.promise && t.common.async === !1)
2455
- return l(t, {
2456
- code: d.invalid_type,
2457
- expected: f.promise,
2458
- received: t.parsedType
2459
- }), y;
2460
- const s = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
2461
- return S(s.then((n) => this._def.type.parseAsync(n, {
2462
- path: t.path,
2463
- errorMap: t.common.contextualErrorMap
2464
- })));
2465
- }
2466
- }
2467
- K.create = (r, e) => new K({
2468
- type: r,
2469
- typeName: m.ZodPromise,
2470
- ..._(e)
2471
- });
2472
- class j extends v {
2473
- innerType() {
2474
- return this._def.schema;
2475
- }
2476
- sourceType() {
2477
- return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2478
- }
2479
- _parse(e) {
2480
- const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
2481
- addIssue: (i) => {
2482
- l(s, i), i.fatal ? t.abort() : t.dirty();
2483
- },
2484
- get path() {
2485
- return s.path;
2486
- }
2487
- };
2488
- if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
2489
- const i = n.transform(s.data, a);
2490
- if (s.common.async)
2491
- return Promise.resolve(i).then(async (o) => {
2492
- if (t.value === "aborted")
2493
- return y;
2494
- const u = await this._def.schema._parseAsync({
2495
- data: o,
2496
- path: s.path,
2497
- parent: s
2498
- });
2499
- return u.status === "aborted" ? y : u.status === "dirty" || t.value === "dirty" ? Y(u.value) : u;
2500
- });
2501
- {
2502
- if (t.value === "aborted")
2503
- return y;
2504
- const o = this._def.schema._parseSync({
2505
- data: i,
2506
- path: s.path,
2507
- parent: s
2508
- });
2509
- return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? Y(o.value) : o;
2510
- }
2511
- }
2512
- if (n.type === "refinement") {
2513
- const i = (o) => {
2514
- const u = n.refinement(o, a);
2515
- if (s.common.async)
2516
- return Promise.resolve(u);
2517
- if (u instanceof Promise)
2518
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2519
- return o;
2520
- };
2521
- if (s.common.async === !1) {
2522
- const o = this._def.schema._parseSync({
2523
- data: s.data,
2524
- path: s.path,
2525
- parent: s
2526
- });
2527
- return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2528
- } else
2529
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2530
- }
2531
- if (n.type === "transform")
2532
- if (s.common.async === !1) {
2533
- const i = this._def.schema._parseSync({
2534
- data: s.data,
2535
- path: s.path,
2536
- parent: s
2537
- });
2538
- if (!se(i))
2539
- return i;
2540
- const o = n.transform(i.value, a);
2541
- if (o instanceof Promise)
2542
- throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2543
- return { status: t.value, value: o };
2544
- } else
2545
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => se(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
2546
- x.assertNever(n);
2547
- }
2548
- }
2549
- j.create = (r, e, t) => new j({
2550
- schema: r,
2551
- typeName: m.ZodEffects,
2552
- effect: e,
2553
- ..._(t)
2554
- });
2555
- j.createWithPreprocess = (r, e, t) => new j({
2556
- schema: e,
2557
- effect: { type: "preprocess", transform: r },
2558
- typeName: m.ZodEffects,
2559
- ..._(t)
2560
- });
2561
- class A extends v {
2562
- _parse(e) {
2563
- return this._getType(e) === f.undefined ? S(void 0) : this._def.innerType._parse(e);
2564
- }
2565
- unwrap() {
2566
- return this._def.innerType;
2567
- }
2568
- }
2569
- A.create = (r, e) => new A({
2570
- innerType: r,
2571
- typeName: m.ZodOptional,
2572
- ..._(e)
2573
- });
2574
- class U extends v {
2575
- _parse(e) {
2576
- return this._getType(e) === f.null ? S(null) : this._def.innerType._parse(e);
2577
- }
2578
- unwrap() {
2579
- return this._def.innerType;
2580
- }
2581
- }
2582
- U.create = (r, e) => new U({
2583
- innerType: r,
2584
- typeName: m.ZodNullable,
2585
- ..._(e)
2586
- });
2587
- class me extends v {
2588
- _parse(e) {
2589
- const { ctx: t } = this._processInputParams(e);
2590
- let s = t.data;
2591
- return t.parsedType === f.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
2592
- data: s,
2593
- path: t.path,
2594
- parent: t
2595
- });
2596
- }
2597
- removeDefault() {
2598
- return this._def.innerType;
2599
- }
2600
- }
2601
- me.create = (r, e) => new me({
2602
- innerType: r,
2603
- typeName: m.ZodDefault,
2604
- defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2605
- ..._(e)
2606
- });
2607
- class pe extends v {
2608
- _parse(e) {
2609
- const { ctx: t } = this._processInputParams(e), s = {
2610
- ...t,
2611
- common: {
2612
- ...t.common,
2613
- issues: []
2614
- }
2615
- }, n = this._def.innerType._parse({
2616
- data: s.data,
2617
- path: s.path,
2618
- parent: {
2619
- ...s
2620
- }
2621
- });
2622
- return ne(n) ? n.then((a) => ({
2623
- status: "valid",
2624
- value: a.status === "valid" ? a.value : this._def.catchValue({
2625
- get error() {
2626
- return new O(s.common.issues);
2627
- },
2628
- input: s.data
2629
- })
2630
- })) : {
2631
- status: "valid",
2632
- value: n.status === "valid" ? n.value : this._def.catchValue({
2633
- get error() {
2634
- return new O(s.common.issues);
2635
- },
2636
- input: s.data
2637
- })
2638
- };
2639
- }
2640
- removeCatch() {
2641
- return this._def.innerType;
2642
- }
2643
- }
2644
- pe.create = (r, e) => new pe({
2645
- innerType: r,
2646
- typeName: m.ZodCatch,
2647
- catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2648
- ..._(e)
2649
- });
2650
- class Ze extends v {
2651
- _parse(e) {
2652
- if (this._getType(e) !== f.nan) {
2653
- const s = this._getOrReturnCtx(e);
2654
- return l(s, {
2655
- code: d.invalid_type,
2656
- expected: f.nan,
2657
- received: s.parsedType
2658
- }), y;
2659
- }
2660
- return { status: "valid", value: e.data };
2661
- }
2662
- }
2663
- Ze.create = (r) => new Ze({
2664
- typeName: m.ZodNaN,
2665
- ..._(r)
2666
- });
2667
- const vt = Symbol("zod_brand");
2668
- class Ie extends v {
2669
- _parse(e) {
2670
- const { ctx: t } = this._processInputParams(e), s = t.data;
2671
- return this._def.type._parse({
2672
- data: s,
2673
- path: t.path,
2674
- parent: t
2675
- });
2676
- }
2677
- unwrap() {
2678
- return this._def.type;
2679
- }
2680
- }
2681
- class _e extends v {
2682
- _parse(e) {
2683
- const { status: t, ctx: s } = this._processInputParams(e);
2684
- if (s.common.async)
2685
- return (async () => {
2686
- const a = await this._def.in._parseAsync({
2687
- data: s.data,
2688
- path: s.path,
2689
- parent: s
2690
- });
2691
- return a.status === "aborted" ? y : a.status === "dirty" ? (t.dirty(), Y(a.value)) : this._def.out._parseAsync({
2692
- data: a.value,
2693
- path: s.path,
2694
- parent: s
2695
- });
2696
- })();
2697
- {
2698
- const n = this._def.in._parseSync({
2699
- data: s.data,
2700
- path: s.path,
2701
- parent: s
2702
- });
2703
- return n.status === "aborted" ? y : n.status === "dirty" ? (t.dirty(), {
2704
- status: "dirty",
2705
- value: n.value
2706
- }) : this._def.out._parseSync({
2707
- data: n.value,
2708
- path: s.path,
2709
- parent: s
2710
- });
2711
- }
2712
- }
2713
- static create(e, t) {
2714
- return new _e({
2715
- in: e,
2716
- out: t,
2717
- typeName: m.ZodPipeline
2718
- });
2719
- }
2720
- }
2721
- class ye extends v {
2722
- _parse(e) {
2723
- const t = this._def.innerType._parse(e), s = (n) => (se(n) && (n.value = Object.freeze(n.value)), n);
2724
- return ne(t) ? t.then((n) => s(n)) : s(t);
2725
- }
2726
- unwrap() {
2727
- return this._def.innerType;
2728
- }
2729
- }
2730
- ye.create = (r, e) => new ye({
2731
- innerType: r,
2732
- typeName: m.ZodReadonly,
2733
- ..._(e)
2734
- });
2735
- function Le(r, e = {}, t) {
2736
- return r ? X.create().superRefine((s, n) => {
2737
- var a, i;
2738
- if (!r(s)) {
2739
- const o = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, c = typeof o == "string" ? { message: o } : o;
2740
- n.addIssue({ code: "custom", ...c, fatal: u });
2741
- }
2742
- }) : X.create();
2743
- }
2744
- const gt = {
2745
- object: k.lazycreate
2746
- };
2747
- var m;
2748
- (function(r) {
2749
- r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2750
- })(m || (m = {}));
2751
- const xt = (r, e = {
2752
- message: `Input not instance of ${r.name}`
2753
- }) => Le((t) => t instanceof r, e), qe = R.create, Ue = z.create, kt = Ze.create, bt = L.create, Be = ae.create, wt = W.create, Tt = be.create, Zt = ie.create, St = oe.create, Ct = X.create, Nt = B.create, Et = V.create, Ot = we.create, Rt = I.create, It = k.create, jt = k.strictCreate, At = de.create, Mt = Se.create, $t = ce.create, Pt = $.create, Vt = ue.create, Dt = Te.create, zt = G.create, Lt = H.create, qt = le.create, Ut = fe.create, Bt = q.create, Wt = he.create, Gt = K.create, Ae = j.create, Jt = A.create, Yt = U.create, Ht = j.createWithPreprocess, Qt = _e.create, Xt = () => qe().optional(), Kt = () => Ue().optional(), Ft = () => Be().optional(), er = {
2754
- string: (r) => R.create({ ...r, coerce: !0 }),
2755
- number: (r) => z.create({ ...r, coerce: !0 }),
2756
- boolean: (r) => ae.create({
2757
- ...r,
2758
- coerce: !0
2759
- }),
2760
- bigint: (r) => L.create({ ...r, coerce: !0 }),
2761
- date: (r) => W.create({ ...r, coerce: !0 })
2762
- }, tr = y;
2763
- var E = /* @__PURE__ */ Object.freeze({
2764
- __proto__: null,
2765
- defaultErrorMap: Q,
2766
- setErrorMap: tt,
2767
- getErrorMap: ge,
2768
- makeIssue: xe,
2769
- EMPTY_PATH: rt,
2770
- addIssueToContext: l,
2771
- ParseStatus: Z,
2772
- INVALID: y,
2773
- DIRTY: Y,
2774
- OK: S,
2775
- isAborted: Ee,
2776
- isDirty: Oe,
2777
- isValid: se,
2778
- isAsync: ne,
2779
- get util() {
2780
- return x;
2781
- },
2782
- get objectUtil() {
2783
- return Ne;
2784
- },
2785
- ZodParsedType: f,
2786
- getParsedType: D,
2787
- ZodType: v,
2788
- datetimeRegex: De,
2789
- ZodString: R,
2790
- ZodNumber: z,
2791
- ZodBigInt: L,
2792
- ZodBoolean: ae,
2793
- ZodDate: W,
2794
- ZodSymbol: be,
2795
- ZodUndefined: ie,
2796
- ZodNull: oe,
2797
- ZodAny: X,
2798
- ZodUnknown: B,
2799
- ZodNever: V,
2800
- ZodVoid: we,
2801
- ZodArray: I,
2802
- ZodObject: k,
2803
- ZodUnion: de,
2804
- ZodDiscriminatedUnion: Se,
2805
- ZodIntersection: ce,
2806
- ZodTuple: $,
2807
- ZodRecord: ue,
2808
- ZodMap: Te,
2809
- ZodSet: G,
2810
- ZodFunction: H,
2811
- ZodLazy: le,
2812
- ZodLiteral: fe,
2813
- ZodEnum: q,
2814
- ZodNativeEnum: he,
2815
- ZodPromise: K,
2816
- ZodEffects: j,
2817
- ZodTransformer: j,
2818
- ZodOptional: A,
2819
- ZodNullable: U,
2820
- ZodDefault: me,
2821
- ZodCatch: pe,
2822
- ZodNaN: Ze,
2823
- BRAND: vt,
2824
- ZodBranded: Ie,
2825
- ZodPipeline: _e,
2826
- ZodReadonly: ye,
2827
- custom: Le,
2828
- Schema: v,
2829
- ZodSchema: v,
2830
- late: gt,
2831
- get ZodFirstPartyTypeKind() {
2832
- return m;
2833
- },
2834
- coerce: er,
2835
- any: Ct,
2836
- array: Rt,
2837
- bigint: bt,
2838
- boolean: Be,
2839
- date: wt,
2840
- discriminatedUnion: Mt,
2841
- effect: Ae,
2842
- enum: Bt,
2843
- function: Lt,
2844
- instanceof: xt,
2845
- intersection: $t,
2846
- lazy: qt,
2847
- literal: Ut,
2848
- map: Dt,
2849
- nan: kt,
2850
- nativeEnum: Wt,
2851
- never: Et,
2852
- null: St,
2853
- nullable: Yt,
2854
- number: Ue,
2855
- object: It,
2856
- oboolean: Ft,
2857
- onumber: Kt,
2858
- optional: Jt,
2859
- ostring: Xt,
2860
- pipeline: Qt,
2861
- preprocess: Ht,
2862
- promise: Gt,
2863
- record: Vt,
2864
- set: zt,
2865
- strictObject: jt,
2866
- string: qe,
2867
- symbol: Tt,
2868
- transformer: Ae,
2869
- tuple: Pt,
2870
- undefined: Zt,
2871
- union: At,
2872
- unknown: Nt,
2873
- void: Ot,
2874
- NEVER: tr,
2875
- ZodIssueCode: d,
2876
- quotelessJson: et,
2877
- ZodError: O
2878
- });
2879
- const ur = () => {
2880
- const { texts: { formValidation: r } } = Qe(Je), e = N((g) => (g != null && g.useCoerce ? E.coerce : E).string({
2881
- invalid_type_error: r.required,
2882
- required_error: r.required
2883
- }).transform((w) => w ?? null), [r.required]), t = N((g) => e(g).nullable().optional().transform((b) => b ?? null), [e]), s = N((g) => {
2884
- const b = (g == null ? void 0 : g.min) ?? Number.MIN_SAFE_INTEGER, w = (g == null ? void 0 : g.max) ?? Number.MAX_SAFE_INTEGER, ee = (g != null && g.useCoerce ? E.coerce : E).number({
2885
- invalid_type_error: r.required,
2886
- required_error: r.required
2887
- }).min(b, r.lessThanMin(b)).max(w, r.moreThanMax(w));
2888
- return ee.transform((T) => T ?? null), ee;
2889
- }, [r]), n = N((g) => s(g).nullable().optional().transform((b) => b ?? null), [s]), a = N((g) => (g != null && g.useCoerce ? E.coerce : E).boolean({
2890
- invalid_type_error: r.required,
2891
- required_error: r.required
2892
- }).transform((b) => b ?? null), [r.required]), i = N((g) => (g != null && g.useCoerce ? E.coerce : E).string({
2893
- invalid_type_error: r.required,
2894
- required_error: r.required
2895
- }).refine(Fe, { message: r.invalidDate }).transform((w) => w ?? null), [r.invalidDate, r.required]), o = N((g) => i(g).nullable().transform((b) => b ?? null), [i]), u = N(
2896
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2897
- (g, b) => E.enum(g, {
2898
- invalid_type_error: r.required,
2899
- required_error: r.required
2900
- }).transform((ee) => ee ?? null),
2901
- [r.required]
2902
- ), c = N((g, b) => u(g, b).nullable().transform((w) => w ?? null), [u]), p = N(
2903
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2904
- (g) => E.object({ id: n({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
2905
- [n]
2906
- ), C = N(
2907
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2908
- (g) => E.object({ id: s() }).transform((w) => w ?? null),
2909
- [s]
2910
- ), ve = N(
2911
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2912
- (g) => E.object({ id: t({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
2913
- [t]
2914
- ), F = N(
2915
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2916
- (g) => E.object({ id: e() }).transform((w) => w ?? null),
2917
- [e]
2918
- ), We = N(({ required: g, multiple: b, maxFileSize: w }) => E.any().transform((T) => Array.from(T ?? [])).refine((T) => !g || (T == null ? void 0 : T.length) > 0, "File is required.").refine((T) => b || (T == null ? void 0 : T.length) <= 1, "Multiple files not allowed.").refine((T) => T.every((Ge) => Ge.size <= w), `Maximum file size is ${Ye(w)}.`).transform((T) => (b ? T : T == null ? void 0 : T[0]) ?? null), []);
2919
- return {
2920
- zString: t,
2921
- zStringRequired: e,
2922
- zNumber: n,
2923
- zNumberRequired: s,
2924
- zBool: a,
2925
- zDate: o,
2926
- zDateRequired: i,
2927
- zEnum: c,
2928
- zEnumRequired: u,
2929
- zObjectIdInt: p,
2930
- zObjectIdIntRequired: C,
2931
- zObjectIdStr: ve,
2932
- zObjectIdStrRequired: F,
2933
- zFile: We
2934
- };
2935
- }, rr = (r) => {
2936
- let e = "pending", t;
2937
- const s = r.then((n) => {
2938
- e = "success", t = n;
2939
- }, (n) => {
2940
- e = "error", t = n;
1
+ import { ao as c } from "./nivo-pie.es-CfGrs0qQ.js";
2
+ import { b4 as y, aD as S, aP as g, ae as w, aO as D, a_ as P, b5 as k } from "./nivo-pie.es-CfGrs0qQ.js";
3
+ import { b, u as C, e as A, a as B, c as E, d as U } from "./useClipboard-BsBDyYHu.js";
4
+ import { u as O } from "./usePermissions-DInna_ZH.js";
5
+ import { a as F, u as K } from "./useLocalStorageState-D9uh-D8S.js";
6
+ import { useState as n, useEffect as m } from "react";
7
+ const f = (t) => {
8
+ let e = "pending", s;
9
+ const r = t.then((a) => {
10
+ e = "success", s = a;
11
+ }, (a) => {
12
+ e = "error", s = a;
2941
13
  });
2942
14
  return () => {
2943
15
  switch (e) {
2944
16
  case "pending":
2945
- throw s;
17
+ throw r;
2946
18
  case "success":
2947
- return t;
19
+ return s;
2948
20
  case "error":
2949
- throw t;
21
+ throw s;
2950
22
  default:
2951
23
  throw new Error("Unknown status");
2952
24
  }
2953
25
  };
2954
26
  };
2955
- function lr(r, e) {
2956
- const t = He({
27
+ function d(t, e) {
28
+ const s = c({
2957
29
  silent: !0,
2958
30
  differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
2959
31
  customToken: e == null ? void 0 : e.customToken
2960
- }), [s, n] = Xe(null);
2961
- return Ke(() => {
32
+ }), [r, a] = n(null);
33
+ return m(() => {
2962
34
  (async () => {
2963
- const i = t.get(r).then((o) => o.data);
2964
- n(rr(i));
35
+ const u = s.get(t).then((o) => o.data);
36
+ a(f(u));
2965
37
  })();
2966
- }, [t, r]), s;
38
+ }, [s, t]), r;
2967
39
  }
2968
40
  export {
2969
- mr as cancelToken,
2970
- pr as useAuth,
2971
- He as useAxios,
2972
- Tr as useClickOutside,
2973
- Zr as useClipboard,
2974
- vr as useConfirm,
2975
- Sr as useEmployeePhotoPath,
2976
- Cr as useFormControlType,
2977
- xr as useGetApiData,
2978
- lr as useGetDataBound,
2979
- Nr as useKeyPress,
2980
- kr as useLocalStorageState,
2981
- yr as useNotifications,
2982
- Ir as usePermissions,
2983
- br as usePrompt,
2984
- Er as useSearchQuery,
2985
- Or as useSearchQueryState,
2986
- ur as useZodSchemaTypes
41
+ y as cancelToken,
42
+ S as useAuth,
43
+ c as useAxios,
44
+ b as useClickOutside,
45
+ C as useClipboard,
46
+ g as useConfirm,
47
+ A as useEmployeePhotoPath,
48
+ w as useFormControlType,
49
+ F as useGetApiData,
50
+ d as useGetDataBound,
51
+ B as useKeyPress,
52
+ K as useLocalStorageState,
53
+ D as useNotifications,
54
+ O as usePermissions,
55
+ P as usePrompt,
56
+ E as useSearchQuery,
57
+ U as useSearchQueryState,
58
+ k as useZodSchemaTypes
2987
59
  };