@golemui/gui-lit 0.0.2 → 0.12.0

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 (66) hide show
  1. package/README.md +17 -4
  2. package/{accordion.element-D1RfC2ew.js → accordion.element-81uTv6Ms.js} +29 -18
  3. package/{alert.element-B4rpyqGV.js → alert.element-DWrS5ggK.js} +17 -17
  4. package/button.element-hjhVBamJ.js +56 -0
  5. package/{calendar.element-D7mAbpAa.js → calendar.element-C1rLK7aY.js} +24 -18
  6. package/{checkbox.element--Kc7sWBx.js → checkbox.element-bu9_MvED.js} +8 -8
  7. package/{currency.element-D9dyGRBH.js → currency.element-Bxv2WxAx.js} +20 -19
  8. package/date-picker.element-GNC8f3Qi.js +157 -0
  9. package/{date.element-na_Uywms.js → date.element-Dzw-UJzC.js} +10 -10
  10. package/{dropdown.element-Cfj40aJz.js → dropdown.element-CebROj9s.js} +95 -78
  11. package/flex.element-BMqqfxjI.js +77 -0
  12. package/grid.element-CBMoOuLt.js +75 -0
  13. package/index.js +1104 -1031
  14. package/index.umd.cjs +319 -112
  15. package/lib/components/accordion.element.d.ts +1 -1
  16. package/lib/components/alert.element.d.ts +1 -1
  17. package/lib/components/button.element.d.ts +3 -2
  18. package/lib/components/calendar.element.d.ts +1 -0
  19. package/lib/components/checkbox.element.d.ts +1 -1
  20. package/lib/components/currency.element.d.ts +1 -1
  21. package/lib/components/date-picker.element.d.ts +4 -2
  22. package/lib/components/date.element.d.ts +1 -1
  23. package/lib/components/dropdown.element.d.ts +1 -1
  24. package/lib/components/flex.element.d.ts +1 -1
  25. package/lib/components/form.element.d.ts +6 -16
  26. package/lib/components/grid.element.d.ts +16 -0
  27. package/lib/components/list.element.d.ts +1 -1
  28. package/lib/components/markdown-text.element.d.ts +16 -0
  29. package/lib/components/markdown.element.d.ts +17 -0
  30. package/lib/components/number.element.d.ts +1 -1
  31. package/lib/components/password.element.d.ts +1 -1
  32. package/lib/components/radiogroup.element.d.ts +1 -1
  33. package/lib/components/range-calendar.element.d.ts +1 -0
  34. package/lib/components/range-date-input.element.d.ts +18 -0
  35. package/lib/components/range-date-picker.element.d.ts +30 -0
  36. package/lib/components/renderer.element.d.ts +1 -0
  37. package/lib/components/repeater.element.d.ts +5 -1
  38. package/lib/components/select.element.d.ts +1 -1
  39. package/lib/components/tabs.element.d.ts +1 -1
  40. package/lib/components/textarea.element.d.ts +1 -1
  41. package/lib/components/textinput.element.d.ts +1 -1
  42. package/lib/components/toggle.element.d.ts +1 -1
  43. package/lib/widget.loaders.d.ts +2 -2
  44. package/{list.element--aj6sNNU.js → list.element-DIIgN_Ww.js} +66 -59
  45. package/markdown-text.element-DY7b-dU5.js +53 -0
  46. package/markdown.element-ZD_n4ObO.js +73 -0
  47. package/{number.element-Bl5YReaL.js → number.element-B0E7W2TK.js} +20 -19
  48. package/package.json +11 -6
  49. package/{password.element-CKmcH8Gn.js → password.element-C4_eLdUO.js} +11 -10
  50. package/{radiogroup.element-Cn1lyyVE.js → radiogroup.element-BD8qBNoO.js} +8 -7
  51. package/{range-calendar.element-C2YUElqM.js → range-calendar.element-Bli9UfhN.js} +35 -27
  52. package/range-date-input.element-BwPvGk5F.js +72 -0
  53. package/range-date-picker.element-DJQOwDPh.js +170 -0
  54. package/renderer.element-B99qD2mz.js +48 -0
  55. package/repeater.element-AaifWsOB.js +136 -0
  56. package/{select.element-LWiqYxzA.js → select.element-BLxtqB0A.js} +9 -8
  57. package/{tabs.element-DYg1wAz9.js → tabs.element-k8JMNDXi.js} +18 -16
  58. package/{textarea.element-BXc-rLZE.js → textarea.element-DgDwfzYP.js} +14 -14
  59. package/{textinput.element-x9LYeW8B.js → textinput.element-DSLFDjfb.js} +17 -16
  60. package/{toggle.element-BP4YKWyR.js → toggle.element-BLu6F99u.js} +5 -5
  61. package/CHANGELOG.md +0 -529
  62. package/button.element-BnUBVNSH.js +0 -58
  63. package/date-picker.element-Dcs5OpxN.js +0 -136
  64. package/flex.element-BSMOum-h.js +0 -65
  65. package/renderer.element-B7AjPqr2.js +0 -43
  66. package/repeater.element-BfwzCooC.js +0 -83
package/index.js CHANGED
@@ -1,57 +1,44 @@
1
1
  import "@golemui/gui-components";
2
- import * as ae from "@golemui/core";
3
- import { standardValidate as He, isStandardValidateSuccess as Qe } from "@golemui/core";
2
+ import { resolveFormInput as tn } from "@golemui/gui-shared";
3
+ import { filterTap as rn, standardValidate as Ee, isStandardValidateSuccess as Te } from "@golemui/core";
4
4
  import "@golemui/lit";
5
- import { vanillaSchemaToFieldMap as ue } from "@golemui/gui-shared";
6
- import { LitElement as et, html as tt } from "lit";
7
- import { property as E, customElement as nt } from "lit/decorators.js";
8
- const fe = {
5
+ import { LitElement as on, html as sn } from "lit";
6
+ import { property as Pe, query as cn, customElement as an } from "lit/decorators.js";
7
+ const un = {
9
8
  // ACTION
10
- button: async () => (await import("./button.element-BnUBVNSH.js")).ButtonElement,
9
+ button: async () => (await import("./button.element-hjhVBamJ.js")).ButtonElement,
11
10
  // INPUTS
12
- calendar: async () => (await import("./calendar.element-D7mAbpAa.js")).CalendarElement,
13
- rangeCalendar: async () => (await import("./range-calendar.element-C2YUElqM.js")).RangeCalendarElement,
14
- currency: async () => (await import("./currency.element-D9dyGRBH.js")).CurrencyElement,
15
- dateInput: async () => (await import("./date.element-na_Uywms.js")).DateElement,
16
- datePicker: async () => (await import("./date-picker.element-Dcs5OpxN.js")).DatePickerElement,
17
- dropdown: async () => (await import("./dropdown.element-Cfj40aJz.js")).DropdownElement,
18
- list: async () => (await import("./list.element--aj6sNNU.js")).ListElement,
19
- password: async () => (await import("./password.element-CKmcH8Gn.js")).PasswordElement,
20
- textinput: async () => (await import("./textinput.element-x9LYeW8B.js")).TextinputElement,
21
- textarea: async () => (await import("./textarea.element-BXc-rLZE.js")).TextareaElement,
22
- toggle: async () => (await import("./toggle.element-BP4YKWyR.js")).ToggleElement,
23
- checkbox: async () => (await import("./checkbox.element--Kc7sWBx.js")).CheckboxElement,
24
- number: async () => (await import("./number.element-Bl5YReaL.js")).NumberElement,
25
- radiogroup: async () => (await import("./radiogroup.element-Cn1lyyVE.js")).RadiogroupElement,
26
- select: async () => (await import("./select.element-LWiqYxzA.js")).SelectElement,
11
+ calendar: async () => (await import("./calendar.element-C1rLK7aY.js")).CalendarElement,
12
+ rangeCalendar: async () => (await import("./range-calendar.element-Bli9UfhN.js")).RangeCalendarElement,
13
+ rangeDateInput: async () => (await import("./range-date-input.element-BwPvGk5F.js")).RangeDateInputElement,
14
+ rangeDatePicker: async () => (await import("./range-date-picker.element-DJQOwDPh.js")).RangeDatePickerElement,
15
+ currency: async () => (await import("./currency.element-Bxv2WxAx.js")).CurrencyElement,
16
+ dateInput: async () => (await import("./date.element-Dzw-UJzC.js")).DateElement,
17
+ datePicker: async () => (await import("./date-picker.element-GNC8f3Qi.js")).DatePickerElement,
18
+ dropdown: async () => (await import("./dropdown.element-CebROj9s.js")).DropdownElement,
19
+ list: async () => (await import("./list.element-DIIgN_Ww.js")).ListElement,
20
+ markdown: async () => (await import("./markdown.element-ZD_n4ObO.js")).MarkdownElement,
21
+ password: async () => (await import("./password.element-C4_eLdUO.js")).PasswordElement,
22
+ textinput: async () => (await import("./textinput.element-DSLFDjfb.js")).TextinputElement,
23
+ textarea: async () => (await import("./textarea.element-DgDwfzYP.js")).TextareaElement,
24
+ toggle: async () => (await import("./toggle.element-BLu6F99u.js")).ToggleElement,
25
+ checkbox: async () => (await import("./checkbox.element-bu9_MvED.js")).CheckboxElement,
26
+ number: async () => (await import("./number.element-B0E7W2TK.js")).NumberElement,
27
+ radiogroup: async () => (await import("./radiogroup.element-BD8qBNoO.js")).RadiogroupElement,
28
+ select: async () => (await import("./select.element-BLxtqB0A.js")).SelectElement,
27
29
  // REPEATER
28
- repeater: async () => (await import("./repeater.element-BfwzCooC.js")).RepeaterElement,
30
+ repeater: async () => (await import("./repeater.element-AaifWsOB.js")).RepeaterElement,
29
31
  // LAYOUTS
30
- flex: async () => (await import("./flex.element-BSMOum-h.js")).FlexElement,
31
- tabs: async () => (await import("./tabs.element-DYg1wAz9.js")).TabsElement,
32
- accordion: async () => (await import("./accordion.element-D1RfC2ew.js")).AccordionElement,
32
+ flex: async () => (await import("./flex.element-BMqqfxjI.js")).FlexElement,
33
+ grid: async () => (await import("./grid.element-CBMoOuLt.js")).GridElement,
34
+ tabs: async () => (await import("./tabs.element-k8JMNDXi.js")).TabsElement,
35
+ accordion: async () => (await import("./accordion.element-81uTv6Ms.js")).AccordionElement,
33
36
  // DISPLAY
34
- alert: async () => (await import("./alert.element-B4rpyqGV.js")).AlertElement,
35
- renderer: async () => (await import("./renderer.element-B7AjPqr2.js")).RendererElement
36
- }, rt = (e) => ({
37
- type: "string",
38
- ...e || {}
39
- }), ot = (e) => ({
40
- type: "number",
41
- ...e || {}
42
- }), it = (e) => ({
43
- type: "integer",
44
- ...e || {}
45
- }), st = (e) => ({
46
- type: "boolean",
47
- ...e || {}
48
- }), le = {
49
- stringValidator: rt,
50
- booleanValidator: st,
51
- numberValidator: ot,
52
- integerValidator: it
37
+ alert: async () => (await import("./alert.element-DWrS5ggK.js")).AlertElement,
38
+ markdownText: async () => (await import("./markdown-text.element-DY7b-dU5.js")).MarkdownTextElement,
39
+ renderer: async () => (await import("./renderer.element-B99qD2mz.js")).RendererElement
53
40
  };
54
- function a(e, t, n) {
41
+ function a(e, n, t) {
55
42
  function r(c, u) {
56
43
  if (c._zod || Object.defineProperty(c, "_zod", {
57
44
  value: {
@@ -62,63 +49,63 @@ function a(e, t, n) {
62
49
  enumerable: !1
63
50
  }), c._zod.traits.has(e))
64
51
  return;
65
- c._zod.traits.add(e), t(c, u);
52
+ c._zod.traits.add(e), n(c, u);
66
53
  const f = i.prototype, l = Object.keys(f);
67
- for (let m = 0; m < l.length; m++) {
68
- const h = l[m];
54
+ for (let p = 0; p < l.length; p++) {
55
+ const h = l[p];
69
56
  h in c || (c[h] = f[h].bind(c));
70
57
  }
71
58
  }
72
- const o = n?.Parent ?? Object;
59
+ const o = t?.Parent ?? Object;
73
60
  class s extends o {
74
61
  }
75
62
  Object.defineProperty(s, "name", { value: e });
76
63
  function i(c) {
77
64
  var u;
78
- const f = n?.Parent ? new s() : this;
65
+ const f = t?.Parent ? new s() : this;
79
66
  r(f, c), (u = f._zod).deferred ?? (u.deferred = []);
80
67
  for (const l of f._zod.deferred)
81
68
  l();
82
69
  return f;
83
70
  }
84
71
  return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
85
- value: (c) => n?.Parent && c instanceof n.Parent ? !0 : c?._zod?.traits?.has(e)
72
+ value: (c) => t?.Parent && c instanceof t.Parent ? !0 : c?._zod?.traits?.has(e)
86
73
  }), Object.defineProperty(i, "name", { value: e }), i;
87
74
  }
88
- class I extends Error {
75
+ class A extends Error {
89
76
  constructor() {
90
77
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
91
78
  }
92
79
  }
93
- class ee extends Error {
94
- constructor(t) {
95
- super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
80
+ class Ae extends Error {
81
+ constructor(n) {
82
+ super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
96
83
  }
97
84
  }
98
- const ct = {};
99
- function T(e) {
100
- return ct;
85
+ const fn = {};
86
+ function S(e) {
87
+ return fn;
101
88
  }
102
- function X(e, t) {
103
- return typeof t == "bigint" ? t.toString() : t;
89
+ function H(e, n) {
90
+ return typeof n == "bigint" ? n.toString() : n;
104
91
  }
105
- function te(e) {
92
+ function re(e) {
106
93
  return e == null;
107
94
  }
108
- function ne(e) {
109
- const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
110
- return e.slice(t, n);
95
+ function oe(e) {
96
+ const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
97
+ return e.slice(n, t);
111
98
  }
112
- const de = Symbol("evaluating");
113
- function p(e, t, n) {
99
+ const ue = Symbol("evaluating");
100
+ function d(e, n, t) {
114
101
  let r;
115
- Object.defineProperty(e, t, {
102
+ Object.defineProperty(e, n, {
116
103
  get() {
117
- if (r !== de)
118
- return r === void 0 && (r = de, r = n()), r;
104
+ if (r !== ue)
105
+ return r === void 0 && (r = ue, r = t()), r;
119
106
  },
120
107
  set(o) {
121
- Object.defineProperty(e, t, {
108
+ Object.defineProperty(e, n, {
122
109
  value: o
123
110
  // configurable: true,
124
111
  });
@@ -126,118 +113,118 @@ function p(e, t, n) {
126
113
  configurable: !0
127
114
  });
128
115
  }
129
- function at(...e) {
130
- const t = {};
131
- for (const n of e) {
132
- const r = Object.getOwnPropertyDescriptors(n);
133
- Object.assign(t, r);
116
+ function ln(...e) {
117
+ const n = {};
118
+ for (const t of e) {
119
+ const r = Object.getOwnPropertyDescriptors(t);
120
+ Object.assign(n, r);
134
121
  }
135
- return Object.defineProperties({}, t);
122
+ return Object.defineProperties({}, n);
136
123
  }
137
- function ut(e) {
124
+ function mn(e) {
138
125
  return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
139
126
  }
140
- const Ee = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
127
+ const Ie = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
141
128
  };
142
- function pe(e) {
129
+ function fe(e) {
143
130
  return typeof e == "object" && e !== null && !Array.isArray(e);
144
131
  }
145
- function H(e) {
146
- if (pe(e) === !1)
132
+ function Q(e) {
133
+ if (fe(e) === !1)
147
134
  return !1;
148
- const t = e.constructor;
149
- if (t === void 0 || typeof t != "function")
135
+ const n = e.constructor;
136
+ if (n === void 0 || typeof n != "function")
150
137
  return !0;
151
- const n = t.prototype;
152
- return !(pe(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
138
+ const t = n.prototype;
139
+ return !(fe(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
153
140
  }
154
- function Te(e) {
155
- return H(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
141
+ function Ne(e) {
142
+ return Q(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
156
143
  }
157
- function re(e) {
144
+ function ie(e) {
158
145
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
159
146
  }
160
- function Pe(e, t, n) {
161
- const r = new e._zod.constr(t ?? e._zod.def);
162
- return (!t || n?.parent) && (r._zod.parent = e), r;
147
+ function Me(e, n, t) {
148
+ const r = new e._zod.constr(n ?? e._zod.def);
149
+ return (!n || t?.parent) && (r._zod.parent = e), r;
163
150
  }
164
- function d(e) {
165
- const t = e;
166
- if (!t)
151
+ function m(e) {
152
+ const n = e;
153
+ if (!n)
167
154
  return {};
168
- if (typeof t == "string")
169
- return { error: () => t };
170
- if (t?.message !== void 0) {
171
- if (t?.error !== void 0)
155
+ if (typeof n == "string")
156
+ return { error: () => n };
157
+ if (n?.message !== void 0) {
158
+ if (n?.error !== void 0)
172
159
  throw new Error("Cannot specify both `message` and `error` params");
173
- t.error = t.message;
160
+ n.error = n.message;
174
161
  }
175
- return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
162
+ return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
176
163
  }
177
- const ft = {
164
+ const dn = {
178
165
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
179
166
  int32: [-2147483648, 2147483647],
180
167
  uint32: [0, 4294967295],
181
168
  float32: [-34028234663852886e22, 34028234663852886e22],
182
169
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
183
170
  };
184
- function N(e, t = 0) {
171
+ function P(e, n = 0) {
185
172
  if (e.aborted === !0)
186
173
  return !0;
187
- for (let n = t; n < e.issues.length; n++)
188
- if (e.issues[n]?.continue !== !0)
174
+ for (let t = n; t < e.issues.length; t++)
175
+ if (e.issues[t]?.continue !== !0)
189
176
  return !0;
190
177
  return !1;
191
178
  }
192
- function lt(e, t) {
193
- return t.map((n) => {
179
+ function pn(e, n) {
180
+ return n.map((t) => {
194
181
  var r;
195
- return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
182
+ return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
196
183
  });
197
184
  }
198
- function L(e) {
185
+ function x(e) {
199
186
  return typeof e == "string" ? e : e?.message;
200
187
  }
201
- function P(e, t, n) {
188
+ function E(e, n, t) {
202
189
  const r = { ...e, path: e.path ?? [] };
203
190
  if (!e.message) {
204
- const o = L(e.inst?._zod.def?.error?.(e)) ?? L(t?.error?.(e)) ?? L(n.customError?.(e)) ?? L(n.localeError?.(e)) ?? "Invalid input";
191
+ const o = x(e.inst?._zod.def?.error?.(e)) ?? x(n?.error?.(e)) ?? x(t.customError?.(e)) ?? x(t.localeError?.(e)) ?? "Invalid input";
205
192
  r.message = o;
206
193
  }
207
- return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
194
+ return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
208
195
  }
209
- function oe(e) {
196
+ function se(e) {
210
197
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
211
198
  }
212
- function F(...e) {
213
- const [t, n, r] = e;
214
- return typeof t == "string" ? {
215
- message: t,
199
+ function j(...e) {
200
+ const [n, t, r] = e;
201
+ return typeof n == "string" ? {
202
+ message: n,
216
203
  code: "custom",
217
- input: n,
204
+ input: t,
218
205
  inst: r
219
- } : { ...t };
206
+ } : { ...n };
220
207
  }
221
- const Ae = (e, t) => {
208
+ const Ce = (e, n) => {
222
209
  e.name = "$ZodError", Object.defineProperty(e, "_zod", {
223
210
  value: e._zod,
224
211
  enumerable: !1
225
212
  }), Object.defineProperty(e, "issues", {
226
- value: t,
213
+ value: n,
227
214
  enumerable: !1
228
- }), e.message = JSON.stringify(t, X, 2), Object.defineProperty(e, "toString", {
215
+ }), e.message = JSON.stringify(n, H, 2), Object.defineProperty(e, "toString", {
229
216
  value: () => e.message,
230
217
  enumerable: !1
231
218
  });
232
- }, Ne = a("$ZodError", Ae), U = a("$ZodError", Ae, { Parent: Error });
233
- function dt(e, t = (n) => n.message) {
234
- const n = {}, r = [];
219
+ }, Re = a("$ZodError", Ce), U = a("$ZodError", Ce, { Parent: Error });
220
+ function hn(e, n = (t) => t.message) {
221
+ const t = {}, r = [];
235
222
  for (const o of e.issues)
236
- o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
237
- return { formErrors: r, fieldErrors: n };
223
+ o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
224
+ return { formErrors: r, fieldErrors: t };
238
225
  }
239
- function pt(e, t = (n) => n.message) {
240
- const n = { _errors: [] }, r = (o) => {
226
+ function gn(e, n = (t) => t.message) {
227
+ const t = { _errors: [] }, r = (o) => {
241
228
  for (const s of o.issues)
242
229
  if (s.code === "invalid_union" && s.errors.length)
243
230
  s.errors.map((i) => r({ issues: i }));
@@ -246,132 +233,132 @@ function pt(e, t = (n) => n.message) {
246
233
  else if (s.code === "invalid_element")
247
234
  r({ issues: s.issues });
248
235
  else if (s.path.length === 0)
249
- n._errors.push(t(s));
236
+ t._errors.push(n(s));
250
237
  else {
251
- let i = n, c = 0;
238
+ let i = t, c = 0;
252
239
  for (; c < s.path.length; ) {
253
240
  const u = s.path[c];
254
- c === s.path.length - 1 ? (i[u] = i[u] || { _errors: [] }, i[u]._errors.push(t(s))) : i[u] = i[u] || { _errors: [] }, i = i[u], c++;
241
+ c === s.path.length - 1 ? (i[u] = i[u] || { _errors: [] }, i[u]._errors.push(n(s))) : i[u] = i[u] || { _errors: [] }, i = i[u], c++;
255
242
  }
256
243
  }
257
244
  };
258
- return r(e), n;
245
+ return r(e), t;
259
246
  }
260
- const V = (e) => (t, n, r, o) => {
261
- const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
247
+ const V = (e) => (n, t, r, o) => {
248
+ const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, s);
262
249
  if (i instanceof Promise)
263
- throw new I();
250
+ throw new A();
264
251
  if (i.issues.length) {
265
- const c = new (o?.Err ?? e)(i.issues.map((u) => P(u, s, T())));
266
- throw Ee(c, o?.callee), c;
252
+ const c = new (o?.Err ?? e)(i.issues.map((u) => E(u, s, S())));
253
+ throw Ie(c, o?.callee), c;
267
254
  }
268
255
  return i.value;
269
- }, mt = /* @__PURE__ */ V(U), W = (e) => async (t, n, r, o) => {
256
+ }, _n = /* @__PURE__ */ V(U), W = (e) => async (n, t, r, o) => {
270
257
  const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
271
- let i = t._zod.run({ value: n, issues: [] }, s);
258
+ let i = n._zod.run({ value: t, issues: [] }, s);
272
259
  if (i instanceof Promise && (i = await i), i.issues.length) {
273
- const c = new (o?.Err ?? e)(i.issues.map((u) => P(u, s, T())));
274
- throw Ee(c, o?.callee), c;
260
+ const c = new (o?.Err ?? e)(i.issues.map((u) => E(u, s, S())));
261
+ throw Ie(c, o?.callee), c;
275
262
  }
276
263
  return i.value;
277
- }, ht = /* @__PURE__ */ W(U), B = (e) => (t, n, r) => {
278
- const o = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, o);
264
+ }, yn = /* @__PURE__ */ W(U), q = (e) => (n, t, r) => {
265
+ const o = r ? { ...r, async: !1 } : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
279
266
  if (s instanceof Promise)
280
- throw new I();
267
+ throw new A();
281
268
  return s.issues.length ? {
282
269
  success: !1,
283
- error: new (e ?? Ne)(s.issues.map((i) => P(i, o, T())))
270
+ error: new (e ?? Re)(s.issues.map((i) => E(i, o, S())))
284
271
  } : { success: !0, data: s.value };
285
- }, Ie = /* @__PURE__ */ B(U), G = (e) => async (t, n, r) => {
272
+ }, je = /* @__PURE__ */ q(U), B = (e) => async (n, t, r) => {
286
273
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
287
- let s = t._zod.run({ value: n, issues: [] }, o);
274
+ let s = n._zod.run({ value: t, issues: [] }, o);
288
275
  return s instanceof Promise && (s = await s), s.issues.length ? {
289
276
  success: !1,
290
- error: new e(s.issues.map((i) => P(i, o, T())))
277
+ error: new e(s.issues.map((i) => E(i, o, S())))
291
278
  } : { success: !0, data: s.value };
292
- }, je = /* @__PURE__ */ G(U), gt = (e) => (t, n, r) => {
279
+ }, Fe = /* @__PURE__ */ B(U), vn = (e) => (n, t, r) => {
293
280
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
294
- return V(e)(t, n, o);
295
- }, _t = (e) => (t, n, r) => V(e)(t, n, r), yt = (e) => async (t, n, r) => {
281
+ return V(e)(n, t, o);
282
+ }, zn = (e) => (n, t, r) => V(e)(n, t, r), bn = (e) => async (n, t, r) => {
296
283
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
297
- return W(e)(t, n, o);
298
- }, vt = (e) => async (t, n, r) => W(e)(t, n, r), zt = (e) => (t, n, r) => {
284
+ return W(e)(n, t, o);
285
+ }, wn = (e) => async (n, t, r) => W(e)(n, t, r), $n = (e) => (n, t, r) => {
299
286
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
300
- return B(e)(t, n, o);
301
- }, bt = (e) => (t, n, r) => B(e)(t, n, r), wt = (e) => async (t, n, r) => {
287
+ return q(e)(n, t, o);
288
+ }, Zn = (e) => (n, t, r) => q(e)(n, t, r), kn = (e) => async (n, t, r) => {
302
289
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
303
- return G(e)(t, n, o);
304
- }, $t = (e) => async (t, n, r) => G(e)(t, n, r), Zt = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, me = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, kt = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Ot = /^(?:(?: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])$/, St = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Et = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Ce = "(?:(?:\\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])))", Tt = /* @__PURE__ */ new RegExp(`^${Ce}$`);
305
- function Re(e) {
306
- const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
307
- return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
308
- }
309
- function Pt(e) {
310
- return new RegExp(`^${Re(e)}$`);
311
- }
312
- function At(e) {
313
- const t = Re({ precision: e.precision }), n = ["Z"];
314
- e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
315
- const r = `${t}(?:${n.join("|")})`;
316
- return new RegExp(`^${Ce}T(?:${r})$`);
317
- }
318
- const Nt = (e) => {
319
- const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
320
- return new RegExp(`^${t}$`);
321
- }, It = /^-?\d+$/, jt = /^-?\d+(?:\.\d+)?$/, Ct = /^(?:true|false)$/i, Rt = /^[^A-Z]*$/, Mt = /^[^a-z]*$/, b = /* @__PURE__ */ a("$ZodCheck", (e, t) => {
322
- var n;
323
- e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
324
- }), Me = {
290
+ return B(e)(n, t, o);
291
+ }, On = (e) => async (n, t, r) => B(e)(n, t, r), Sn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, le = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, En = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Tn = /^(?:(?: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])$/, Pn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, An = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, De = "(?:(?:\\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])))", In = /* @__PURE__ */ new RegExp(`^${De}$`);
292
+ function xe(e) {
293
+ const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
294
+ return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
295
+ }
296
+ function Nn(e) {
297
+ return new RegExp(`^${xe(e)}$`);
298
+ }
299
+ function Mn(e) {
300
+ const n = xe({ precision: e.precision }), t = ["Z"];
301
+ e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
302
+ const r = `${n}(?:${t.join("|")})`;
303
+ return new RegExp(`^${De}T(?:${r})$`);
304
+ }
305
+ const Cn = (e) => {
306
+ const n = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
307
+ return new RegExp(`^${n}$`);
308
+ }, Rn = /^-?\d+$/, jn = /^-?\d+(?:\.\d+)?$/, Fn = /^(?:true|false)$/i, Dn = /^[^A-Z]*$/, xn = /^[^a-z]*$/, $ = /* @__PURE__ */ a("$ZodCheck", (e, n) => {
309
+ var t;
310
+ e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
311
+ }), Le = {
325
312
  number: "number",
326
313
  bigint: "bigint",
327
314
  object: "date"
328
- }, Ft = /* @__PURE__ */ a("$ZodCheckLessThan", (e, t) => {
329
- b.init(e, t);
330
- const n = Me[typeof t.value];
315
+ }, Ln = /* @__PURE__ */ a("$ZodCheckLessThan", (e, n) => {
316
+ $.init(e, n);
317
+ const t = Le[typeof n.value];
331
318
  e._zod.onattach.push((r) => {
332
- const o = r._zod.bag, s = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
333
- t.value < s && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
319
+ const o = r._zod.bag, s = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
320
+ n.value < s && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
334
321
  }), e._zod.check = (r) => {
335
- (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
336
- origin: n,
322
+ (n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
323
+ origin: t,
337
324
  code: "too_big",
338
- maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
325
+ maximum: typeof n.value == "object" ? n.value.getTime() : n.value,
339
326
  input: r.value,
340
- inclusive: t.inclusive,
327
+ inclusive: n.inclusive,
341
328
  inst: e,
342
- continue: !t.abort
329
+ continue: !n.abort
343
330
  });
344
331
  };
345
- }), Dt = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, t) => {
346
- b.init(e, t);
347
- const n = Me[typeof t.value];
332
+ }), Jn = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, n) => {
333
+ $.init(e, n);
334
+ const t = Le[typeof n.value];
348
335
  e._zod.onattach.push((r) => {
349
- const o = r._zod.bag, s = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
350
- t.value > s && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
336
+ const o = r._zod.bag, s = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
337
+ n.value > s && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
351
338
  }), e._zod.check = (r) => {
352
- (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
353
- origin: n,
339
+ (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
340
+ origin: t,
354
341
  code: "too_small",
355
- minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
342
+ minimum: typeof n.value == "object" ? n.value.getTime() : n.value,
356
343
  input: r.value,
357
- inclusive: t.inclusive,
344
+ inclusive: n.inclusive,
358
345
  inst: e,
359
- continue: !t.abort
346
+ continue: !n.abort
360
347
  });
361
348
  };
362
- }), Lt = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, t) => {
363
- b.init(e, t), t.format = t.format || "float64";
364
- const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] = ft[t.format];
349
+ }), Un = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, n) => {
350
+ $.init(e, n), n.format = n.format || "float64";
351
+ const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] = dn[n.format];
365
352
  e._zod.onattach.push((i) => {
366
353
  const c = i._zod.bag;
367
- c.format = t.format, c.minimum = o, c.maximum = s, n && (c.pattern = It);
354
+ c.format = n.format, c.minimum = o, c.maximum = s, t && (c.pattern = Rn);
368
355
  }), e._zod.check = (i) => {
369
356
  const c = i.value;
370
- if (n) {
357
+ if (t) {
371
358
  if (!Number.isInteger(c)) {
372
359
  i.issues.push({
373
360
  expected: r,
374
- format: t.format,
361
+ format: n.format,
375
362
  code: "invalid_type",
376
363
  continue: !1,
377
364
  input: c,
@@ -388,7 +375,7 @@ const Nt = (e) => {
388
375
  inst: e,
389
376
  origin: r,
390
377
  inclusive: !0,
391
- continue: !t.abort
378
+ continue: !n.abort
392
379
  }) : i.issues.push({
393
380
  input: c,
394
381
  code: "too_small",
@@ -397,7 +384,7 @@ const Nt = (e) => {
397
384
  inst: e,
398
385
  origin: r,
399
386
  inclusive: !0,
400
- continue: !t.abort
387
+ continue: !n.abort
401
388
  });
402
389
  return;
403
390
  }
@@ -409,7 +396,7 @@ const Nt = (e) => {
409
396
  minimum: o,
410
397
  inclusive: !0,
411
398
  inst: e,
412
- continue: !t.abort
399
+ continue: !n.abort
413
400
  }), c > s && i.issues.push({
414
401
  origin: "number",
415
402
  input: c,
@@ -417,212 +404,212 @@ const Nt = (e) => {
417
404
  maximum: s,
418
405
  inclusive: !0,
419
406
  inst: e,
420
- continue: !t.abort
407
+ continue: !n.abort
421
408
  });
422
409
  };
423
- }), xt = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, t) => {
424
- var n;
425
- b.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
410
+ }), Vn = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, n) => {
411
+ var t;
412
+ $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
426
413
  const o = r.value;
427
- return !te(o) && o.length !== void 0;
414
+ return !re(o) && o.length !== void 0;
428
415
  }), e._zod.onattach.push((r) => {
429
416
  const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
430
- t.maximum < o && (r._zod.bag.maximum = t.maximum);
417
+ n.maximum < o && (r._zod.bag.maximum = n.maximum);
431
418
  }), e._zod.check = (r) => {
432
419
  const o = r.value;
433
- if (o.length <= t.maximum)
420
+ if (o.length <= n.maximum)
434
421
  return;
435
- const i = oe(o);
422
+ const i = se(o);
436
423
  r.issues.push({
437
424
  origin: i,
438
425
  code: "too_big",
439
- maximum: t.maximum,
426
+ maximum: n.maximum,
440
427
  inclusive: !0,
441
428
  input: o,
442
429
  inst: e,
443
- continue: !t.abort
430
+ continue: !n.abort
444
431
  });
445
432
  };
446
- }), Jt = /* @__PURE__ */ a("$ZodCheckMinLength", (e, t) => {
447
- var n;
448
- b.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
433
+ }), Wn = /* @__PURE__ */ a("$ZodCheckMinLength", (e, n) => {
434
+ var t;
435
+ $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
449
436
  const o = r.value;
450
- return !te(o) && o.length !== void 0;
437
+ return !re(o) && o.length !== void 0;
451
438
  }), e._zod.onattach.push((r) => {
452
439
  const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
453
- t.minimum > o && (r._zod.bag.minimum = t.minimum);
440
+ n.minimum > o && (r._zod.bag.minimum = n.minimum);
454
441
  }), e._zod.check = (r) => {
455
442
  const o = r.value;
456
- if (o.length >= t.minimum)
443
+ if (o.length >= n.minimum)
457
444
  return;
458
- const i = oe(o);
445
+ const i = se(o);
459
446
  r.issues.push({
460
447
  origin: i,
461
448
  code: "too_small",
462
- minimum: t.minimum,
449
+ minimum: n.minimum,
463
450
  inclusive: !0,
464
451
  input: o,
465
452
  inst: e,
466
- continue: !t.abort
453
+ continue: !n.abort
467
454
  });
468
455
  };
469
- }), Ut = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, t) => {
470
- var n;
471
- b.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
456
+ }), qn = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, n) => {
457
+ var t;
458
+ $.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
472
459
  const o = r.value;
473
- return !te(o) && o.length !== void 0;
460
+ return !re(o) && o.length !== void 0;
474
461
  }), e._zod.onattach.push((r) => {
475
462
  const o = r._zod.bag;
476
- o.minimum = t.length, o.maximum = t.length, o.length = t.length;
463
+ o.minimum = n.length, o.maximum = n.length, o.length = n.length;
477
464
  }), e._zod.check = (r) => {
478
465
  const o = r.value, s = o.length;
479
- if (s === t.length)
466
+ if (s === n.length)
480
467
  return;
481
- const i = oe(o), c = s > t.length;
468
+ const i = se(o), c = s > n.length;
482
469
  r.issues.push({
483
470
  origin: i,
484
- ...c ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
471
+ ...c ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
485
472
  inclusive: !0,
486
473
  exact: !0,
487
474
  input: r.value,
488
475
  inst: e,
489
- continue: !t.abort
476
+ continue: !n.abort
490
477
  });
491
478
  };
492
- }), q = /* @__PURE__ */ a("$ZodCheckStringFormat", (e, t) => {
493
- var n, r;
494
- b.init(e, t), e._zod.onattach.push((o) => {
479
+ }), G = /* @__PURE__ */ a("$ZodCheckStringFormat", (e, n) => {
480
+ var t, r;
481
+ $.init(e, n), e._zod.onattach.push((o) => {
495
482
  const s = o._zod.bag;
496
- s.format = t.format, t.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(t.pattern));
497
- }), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
498
- t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
483
+ s.format = n.format, n.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(n.pattern));
484
+ }), n.pattern ? (t = e._zod).check ?? (t.check = (o) => {
485
+ n.pattern.lastIndex = 0, !n.pattern.test(o.value) && o.issues.push({
499
486
  origin: "string",
500
487
  code: "invalid_format",
501
- format: t.format,
488
+ format: n.format,
502
489
  input: o.value,
503
- ...t.pattern ? { pattern: t.pattern.toString() } : {},
490
+ ...n.pattern ? { pattern: n.pattern.toString() } : {},
504
491
  inst: e,
505
- continue: !t.abort
492
+ continue: !n.abort
506
493
  });
507
494
  }) : (r = e._zod).check ?? (r.check = () => {
508
495
  });
509
- }), Vt = /* @__PURE__ */ a("$ZodCheckRegex", (e, t) => {
510
- q.init(e, t), e._zod.check = (n) => {
511
- t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
496
+ }), Bn = /* @__PURE__ */ a("$ZodCheckRegex", (e, n) => {
497
+ G.init(e, n), e._zod.check = (t) => {
498
+ n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
512
499
  origin: "string",
513
500
  code: "invalid_format",
514
501
  format: "regex",
515
- input: n.value,
516
- pattern: t.pattern.toString(),
502
+ input: t.value,
503
+ pattern: n.pattern.toString(),
517
504
  inst: e,
518
- continue: !t.abort
505
+ continue: !n.abort
519
506
  });
520
507
  };
521
- }), Wt = /* @__PURE__ */ a("$ZodCheckLowerCase", (e, t) => {
522
- t.pattern ?? (t.pattern = Rt), q.init(e, t);
523
- }), Bt = /* @__PURE__ */ a("$ZodCheckUpperCase", (e, t) => {
524
- t.pattern ?? (t.pattern = Mt), q.init(e, t);
525
- }), Gt = /* @__PURE__ */ a("$ZodCheckIncludes", (e, t) => {
526
- b.init(e, t);
527
- const n = re(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
528
- t.pattern = r, e._zod.onattach.push((o) => {
508
+ }), Gn = /* @__PURE__ */ a("$ZodCheckLowerCase", (e, n) => {
509
+ n.pattern ?? (n.pattern = Dn), G.init(e, n);
510
+ }), Kn = /* @__PURE__ */ a("$ZodCheckUpperCase", (e, n) => {
511
+ n.pattern ?? (n.pattern = xn), G.init(e, n);
512
+ }), Yn = /* @__PURE__ */ a("$ZodCheckIncludes", (e, n) => {
513
+ $.init(e, n);
514
+ const t = ie(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
515
+ n.pattern = r, e._zod.onattach.push((o) => {
529
516
  const s = o._zod.bag;
530
517
  s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
531
518
  }), e._zod.check = (o) => {
532
- o.value.includes(t.includes, t.position) || o.issues.push({
519
+ o.value.includes(n.includes, n.position) || o.issues.push({
533
520
  origin: "string",
534
521
  code: "invalid_format",
535
522
  format: "includes",
536
- includes: t.includes,
523
+ includes: n.includes,
537
524
  input: o.value,
538
525
  inst: e,
539
- continue: !t.abort
526
+ continue: !n.abort
540
527
  });
541
528
  };
542
- }), qt = /* @__PURE__ */ a("$ZodCheckStartsWith", (e, t) => {
543
- b.init(e, t);
544
- const n = new RegExp(`^${re(t.prefix)}.*`);
545
- t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
529
+ }), Xn = /* @__PURE__ */ a("$ZodCheckStartsWith", (e, n) => {
530
+ $.init(e, n);
531
+ const t = new RegExp(`^${ie(n.prefix)}.*`);
532
+ n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
546
533
  const o = r._zod.bag;
547
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
534
+ o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
548
535
  }), e._zod.check = (r) => {
549
- r.value.startsWith(t.prefix) || r.issues.push({
536
+ r.value.startsWith(n.prefix) || r.issues.push({
550
537
  origin: "string",
551
538
  code: "invalid_format",
552
539
  format: "starts_with",
553
- prefix: t.prefix,
540
+ prefix: n.prefix,
554
541
  input: r.value,
555
542
  inst: e,
556
- continue: !t.abort
543
+ continue: !n.abort
557
544
  });
558
545
  };
559
- }), Kt = /* @__PURE__ */ a("$ZodCheckEndsWith", (e, t) => {
560
- b.init(e, t);
561
- const n = new RegExp(`.*${re(t.suffix)}$`);
562
- t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
546
+ }), Hn = /* @__PURE__ */ a("$ZodCheckEndsWith", (e, n) => {
547
+ $.init(e, n);
548
+ const t = new RegExp(`.*${ie(n.suffix)}$`);
549
+ n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
563
550
  const o = r._zod.bag;
564
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
551
+ o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
565
552
  }), e._zod.check = (r) => {
566
- r.value.endsWith(t.suffix) || r.issues.push({
553
+ r.value.endsWith(n.suffix) || r.issues.push({
567
554
  origin: "string",
568
555
  code: "invalid_format",
569
556
  format: "ends_with",
570
- suffix: t.suffix,
557
+ suffix: n.suffix,
571
558
  input: r.value,
572
559
  inst: e,
573
- continue: !t.abort
560
+ continue: !n.abort
574
561
  });
575
562
  };
576
- }), Yt = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, t) => {
577
- b.init(e, t), e._zod.check = (n) => {
578
- n.value = t.tx(n.value);
563
+ }), Qn = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, n) => {
564
+ $.init(e, n), e._zod.check = (t) => {
565
+ t.value = n.tx(t.value);
579
566
  };
580
- }), Xt = {
567
+ }), et = {
581
568
  major: 4,
582
569
  minor: 3,
583
570
  patch: 6
584
- }, _ = /* @__PURE__ */ a("$ZodType", (e, t) => {
585
- var n;
586
- e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Xt;
571
+ }, y = /* @__PURE__ */ a("$ZodType", (e, n) => {
572
+ var t;
573
+ e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = et;
587
574
  const r = [...e._zod.def.checks ?? []];
588
575
  e._zod.traits.has("$ZodCheck") && r.unshift(e);
589
576
  for (const o of r)
590
577
  for (const s of o._zod.onattach)
591
578
  s(e);
592
579
  if (r.length === 0)
593
- (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
580
+ (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
594
581
  e._zod.run = e._zod.parse;
595
582
  });
596
583
  else {
597
584
  const o = (i, c, u) => {
598
- let f = N(i), l;
599
- for (const m of c) {
600
- if (m._zod.def.when) {
601
- if (!m._zod.def.when(i))
585
+ let f = P(i), l;
586
+ for (const p of c) {
587
+ if (p._zod.def.when) {
588
+ if (!p._zod.def.when(i))
602
589
  continue;
603
590
  } else if (f)
604
591
  continue;
605
- const h = i.issues.length, g = m._zod.check(i);
592
+ const h = i.issues.length, g = p._zod.check(i);
606
593
  if (g instanceof Promise && u?.async === !1)
607
- throw new I();
594
+ throw new A();
608
595
  if (l || g instanceof Promise)
609
596
  l = (l ?? Promise.resolve()).then(async () => {
610
- await g, i.issues.length !== h && (f || (f = N(i, h)));
597
+ await g, i.issues.length !== h && (f || (f = P(i, h)));
611
598
  });
612
599
  else {
613
600
  if (i.issues.length === h)
614
601
  continue;
615
- f || (f = N(i, h));
602
+ f || (f = P(i, h));
616
603
  }
617
604
  }
618
605
  return l ? l.then(() => i) : i;
619
606
  }, s = (i, c, u) => {
620
- if (N(i))
607
+ if (P(i))
621
608
  return i.aborted = !0, i;
622
609
  const f = o(c, r, u);
623
610
  if (f instanceof Promise) {
624
611
  if (u.async === !1)
625
- throw new I();
612
+ throw new A();
626
613
  return f.then((l) => e._zod.parse(l, u));
627
614
  }
628
615
  return e._zod.parse(f, u);
@@ -637,42 +624,42 @@ const Nt = (e) => {
637
624
  const u = e._zod.parse(i, c);
638
625
  if (u instanceof Promise) {
639
626
  if (c.async === !1)
640
- throw new I();
627
+ throw new A();
641
628
  return u.then((f) => o(f, r, c));
642
629
  }
643
630
  return o(u, r, c);
644
631
  };
645
632
  }
646
- p(e, "~standard", () => ({
633
+ d(e, "~standard", () => ({
647
634
  validate: (o) => {
648
635
  try {
649
- const s = Ie(e, o);
636
+ const s = je(e, o);
650
637
  return s.success ? { value: s.data } : { issues: s.error?.issues };
651
638
  } catch {
652
- return je(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
639
+ return Fe(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
653
640
  }
654
641
  },
655
642
  vendor: "zod",
656
643
  version: 1
657
644
  }));
658
- }), ie = /* @__PURE__ */ a("$ZodString", (e, t) => {
659
- _.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Nt(e._zod.bag), e._zod.parse = (n, r) => {
660
- if (t.coerce)
645
+ }), ce = /* @__PURE__ */ a("$ZodString", (e, n) => {
646
+ y.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Cn(e._zod.bag), e._zod.parse = (t, r) => {
647
+ if (n.coerce)
661
648
  try {
662
- n.value = String(n.value);
649
+ t.value = String(t.value);
663
650
  } catch {
664
651
  }
665
- return typeof n.value == "string" || n.issues.push({
652
+ return typeof t.value == "string" || t.issues.push({
666
653
  expected: "string",
667
654
  code: "invalid_type",
668
- input: n.value,
655
+ input: t.value,
669
656
  inst: e
670
- }), n;
657
+ }), t;
671
658
  };
672
- }), w = /* @__PURE__ */ a("$ZodStringFormat", (e, t) => {
673
- q.init(e, t), ie.init(e, t);
674
- }), Ht = /* @__PURE__ */ a("$ZodUUID", (e, t) => {
675
- if (t.version) {
659
+ }), Z = /* @__PURE__ */ a("$ZodStringFormat", (e, n) => {
660
+ G.init(e, n), ce.init(e, n);
661
+ }), nt = /* @__PURE__ */ a("$ZodUUID", (e, n) => {
662
+ if (n.version) {
676
663
  const r = {
677
664
  v1: 1,
678
665
  v2: 2,
@@ -682,174 +669,174 @@ const Nt = (e) => {
682
669
  v6: 6,
683
670
  v7: 7,
684
671
  v8: 8
685
- }[t.version];
672
+ }[n.version];
686
673
  if (r === void 0)
687
- throw new Error(`Invalid UUID version: "${t.version}"`);
688
- t.pattern ?? (t.pattern = me(r));
674
+ throw new Error(`Invalid UUID version: "${n.version}"`);
675
+ n.pattern ?? (n.pattern = le(r));
689
676
  } else
690
- t.pattern ?? (t.pattern = me());
691
- w.init(e, t);
692
- }), Qt = /* @__PURE__ */ a("$ZodEmail", (e, t) => {
693
- t.pattern ?? (t.pattern = kt), w.init(e, t);
694
- }), en = /* @__PURE__ */ a("$ZodURL", (e, t) => {
695
- w.init(e, t), e._zod.check = (n) => {
677
+ n.pattern ?? (n.pattern = le());
678
+ Z.init(e, n);
679
+ }), tt = /* @__PURE__ */ a("$ZodEmail", (e, n) => {
680
+ n.pattern ?? (n.pattern = En), Z.init(e, n);
681
+ }), rt = /* @__PURE__ */ a("$ZodURL", (e, n) => {
682
+ Z.init(e, n), e._zod.check = (t) => {
696
683
  try {
697
- const r = n.value.trim(), o = new URL(r);
698
- t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
684
+ const r = t.value.trim(), o = new URL(r);
685
+ n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(o.hostname) || t.issues.push({
699
686
  code: "invalid_format",
700
687
  format: "url",
701
688
  note: "Invalid hostname",
702
- pattern: t.hostname.source,
703
- input: n.value,
689
+ pattern: n.hostname.source,
690
+ input: t.value,
704
691
  inst: e,
705
- continue: !t.abort
706
- })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || n.issues.push({
692
+ continue: !n.abort
693
+ })), n.protocol && (n.protocol.lastIndex = 0, n.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || t.issues.push({
707
694
  code: "invalid_format",
708
695
  format: "url",
709
696
  note: "Invalid protocol",
710
- pattern: t.protocol.source,
711
- input: n.value,
697
+ pattern: n.protocol.source,
698
+ input: t.value,
712
699
  inst: e,
713
- continue: !t.abort
714
- })), t.normalize ? n.value = o.href : n.value = r;
700
+ continue: !n.abort
701
+ })), n.normalize ? t.value = o.href : t.value = r;
715
702
  return;
716
703
  } catch {
717
- n.issues.push({
704
+ t.issues.push({
718
705
  code: "invalid_format",
719
706
  format: "url",
720
- input: n.value,
707
+ input: t.value,
721
708
  inst: e,
722
- continue: !t.abort
709
+ continue: !n.abort
723
710
  });
724
711
  }
725
712
  };
726
- }), tn = /* @__PURE__ */ a("$ZodISODateTime", (e, t) => {
727
- t.pattern ?? (t.pattern = At(t)), w.init(e, t);
728
- }), nn = /* @__PURE__ */ a("$ZodISODate", (e, t) => {
729
- t.pattern ?? (t.pattern = Tt), w.init(e, t);
730
- }), rn = /* @__PURE__ */ a("$ZodISOTime", (e, t) => {
731
- t.pattern ?? (t.pattern = Pt(t)), w.init(e, t);
732
- }), on = /* @__PURE__ */ a("$ZodISODuration", (e, t) => {
733
- t.pattern ?? (t.pattern = Zt), w.init(e, t);
734
- }), sn = /* @__PURE__ */ a("$ZodIPv4", (e, t) => {
735
- t.pattern ?? (t.pattern = Ot), w.init(e, t), e._zod.bag.format = "ipv4";
736
- }), cn = /* @__PURE__ */ a("$ZodIPv6", (e, t) => {
737
- t.pattern ?? (t.pattern = St), w.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
713
+ }), ot = /* @__PURE__ */ a("$ZodISODateTime", (e, n) => {
714
+ n.pattern ?? (n.pattern = Mn(n)), Z.init(e, n);
715
+ }), it = /* @__PURE__ */ a("$ZodISODate", (e, n) => {
716
+ n.pattern ?? (n.pattern = In), Z.init(e, n);
717
+ }), st = /* @__PURE__ */ a("$ZodISOTime", (e, n) => {
718
+ n.pattern ?? (n.pattern = Nn(n)), Z.init(e, n);
719
+ }), ct = /* @__PURE__ */ a("$ZodISODuration", (e, n) => {
720
+ n.pattern ?? (n.pattern = Sn), Z.init(e, n);
721
+ }), at = /* @__PURE__ */ a("$ZodIPv4", (e, n) => {
722
+ n.pattern ?? (n.pattern = Tn), Z.init(e, n), e._zod.bag.format = "ipv4";
723
+ }), ut = /* @__PURE__ */ a("$ZodIPv6", (e, n) => {
724
+ n.pattern ?? (n.pattern = Pn), Z.init(e, n), e._zod.bag.format = "ipv6", e._zod.check = (t) => {
738
725
  try {
739
- new URL(`http://[${n.value}]`);
726
+ new URL(`http://[${t.value}]`);
740
727
  } catch {
741
- n.issues.push({
728
+ t.issues.push({
742
729
  code: "invalid_format",
743
730
  format: "ipv6",
744
- input: n.value,
731
+ input: t.value,
745
732
  inst: e,
746
- continue: !t.abort
733
+ continue: !n.abort
747
734
  });
748
735
  }
749
736
  };
750
- }), an = /* @__PURE__ */ a("$ZodCustomStringFormat", (e, t) => {
751
- w.init(e, t), e._zod.check = (n) => {
752
- t.fn(n.value) || n.issues.push({
737
+ }), ft = /* @__PURE__ */ a("$ZodCustomStringFormat", (e, n) => {
738
+ Z.init(e, n), e._zod.check = (t) => {
739
+ n.fn(t.value) || t.issues.push({
753
740
  code: "invalid_format",
754
- format: t.format,
755
- input: n.value,
741
+ format: n.format,
742
+ input: t.value,
756
743
  inst: e,
757
- continue: !t.abort
744
+ continue: !n.abort
758
745
  });
759
746
  };
760
- }), Fe = /* @__PURE__ */ a("$ZodNumber", (e, t) => {
761
- _.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? jt, e._zod.parse = (n, r) => {
762
- if (t.coerce)
747
+ }), Je = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
748
+ y.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? jn, e._zod.parse = (t, r) => {
749
+ if (n.coerce)
763
750
  try {
764
- n.value = Number(n.value);
751
+ t.value = Number(t.value);
765
752
  } catch {
766
753
  }
767
- const o = n.value;
754
+ const o = t.value;
768
755
  if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
769
- return n;
756
+ return t;
770
757
  const s = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
771
- return n.issues.push({
758
+ return t.issues.push({
772
759
  expected: "number",
773
760
  code: "invalid_type",
774
761
  input: o,
775
762
  inst: e,
776
763
  ...s ? { received: s } : {}
777
- }), n;
764
+ }), t;
778
765
  };
779
- }), un = /* @__PURE__ */ a("$ZodNumberFormat", (e, t) => {
780
- Lt.init(e, t), Fe.init(e, t);
781
- }), fn = /* @__PURE__ */ a("$ZodBoolean", (e, t) => {
782
- _.init(e, t), e._zod.pattern = Ct, e._zod.parse = (n, r) => {
783
- if (t.coerce)
766
+ }), lt = /* @__PURE__ */ a("$ZodNumberFormat", (e, n) => {
767
+ Un.init(e, n), Je.init(e, n);
768
+ }), mt = /* @__PURE__ */ a("$ZodBoolean", (e, n) => {
769
+ y.init(e, n), e._zod.pattern = Fn, e._zod.parse = (t, r) => {
770
+ if (n.coerce)
784
771
  try {
785
- n.value = !!n.value;
772
+ t.value = !!t.value;
786
773
  } catch {
787
774
  }
788
- const o = n.value;
789
- return typeof o == "boolean" || n.issues.push({
775
+ const o = t.value;
776
+ return typeof o == "boolean" || t.issues.push({
790
777
  expected: "boolean",
791
778
  code: "invalid_type",
792
779
  input: o,
793
780
  inst: e
794
- }), n;
781
+ }), t;
795
782
  };
796
- }), ln = /* @__PURE__ */ a("$ZodAny", (e, t) => {
797
- _.init(e, t), e._zod.parse = (n) => n;
783
+ }), dt = /* @__PURE__ */ a("$ZodAny", (e, n) => {
784
+ y.init(e, n), e._zod.parse = (t) => t;
798
785
  });
799
- function he(e, t, n) {
800
- e.issues.length && t.issues.push(...lt(n, e.issues)), t.value[n] = e.value;
786
+ function me(e, n, t) {
787
+ e.issues.length && n.issues.push(...pn(t, e.issues)), n.value[t] = e.value;
801
788
  }
802
- const dn = /* @__PURE__ */ a("$ZodArray", (e, t) => {
803
- _.init(e, t), e._zod.parse = (n, r) => {
804
- const o = n.value;
789
+ const Ue = /* @__PURE__ */ a("$ZodArray", (e, n) => {
790
+ y.init(e, n), e._zod.parse = (t, r) => {
791
+ const o = t.value;
805
792
  if (!Array.isArray(o))
806
- return n.issues.push({
793
+ return t.issues.push({
807
794
  expected: "array",
808
795
  code: "invalid_type",
809
796
  input: o,
810
797
  inst: e
811
- }), n;
812
- n.value = Array(o.length);
798
+ }), t;
799
+ t.value = Array(o.length);
813
800
  const s = [];
814
801
  for (let i = 0; i < o.length; i++) {
815
- const c = o[i], u = t.element._zod.run({
802
+ const c = o[i], u = n.element._zod.run({
816
803
  value: c,
817
804
  issues: []
818
805
  }, r);
819
- u instanceof Promise ? s.push(u.then((f) => he(f, n, i))) : he(u, n, i);
806
+ u instanceof Promise ? s.push(u.then((f) => me(f, t, i))) : me(u, t, i);
820
807
  }
821
- return s.length ? Promise.all(s).then(() => n) : n;
808
+ return s.length ? Promise.all(s).then(() => t) : t;
822
809
  };
823
810
  });
824
- function ge(e, t, n, r) {
811
+ function de(e, n, t, r) {
825
812
  for (const s of e)
826
813
  if (s.issues.length === 0)
827
- return t.value = s.value, t;
828
- const o = e.filter((s) => !N(s));
829
- return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
814
+ return n.value = s.value, n;
815
+ const o = e.filter((s) => !P(s));
816
+ return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
830
817
  code: "invalid_union",
831
- input: t.value,
832
- inst: n,
833
- errors: e.map((s) => s.issues.map((i) => P(i, r, T())))
834
- }), t);
835
- }
836
- const pn = /* @__PURE__ */ a("$ZodUnion", (e, t) => {
837
- _.init(e, t), p(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), p(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), p(e._zod, "values", () => {
838
- if (t.options.every((o) => o._zod.values))
839
- return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
840
- }), p(e._zod, "pattern", () => {
841
- if (t.options.every((o) => o._zod.pattern)) {
842
- const o = t.options.map((s) => s._zod.pattern);
843
- return new RegExp(`^(${o.map((s) => ne(s.source)).join("|")})$`);
818
+ input: n.value,
819
+ inst: t,
820
+ errors: e.map((s) => s.issues.map((i) => E(i, r, S())))
821
+ }), n);
822
+ }
823
+ const pt = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
824
+ y.init(e, n), d(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), d(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), d(e._zod, "values", () => {
825
+ if (n.options.every((o) => o._zod.values))
826
+ return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
827
+ }), d(e._zod, "pattern", () => {
828
+ if (n.options.every((o) => o._zod.pattern)) {
829
+ const o = n.options.map((s) => s._zod.pattern);
830
+ return new RegExp(`^(${o.map((s) => oe(s.source)).join("|")})$`);
844
831
  }
845
832
  });
846
- const n = t.options.length === 1, r = t.options[0]._zod.run;
833
+ const t = n.options.length === 1, r = n.options[0]._zod.run;
847
834
  e._zod.parse = (o, s) => {
848
- if (n)
835
+ if (t)
849
836
  return r(o, s);
850
837
  let i = !1;
851
838
  const c = [];
852
- for (const u of t.options) {
839
+ for (const u of n.options) {
853
840
  const f = u._zod.run({
854
841
  value: o.value,
855
842
  issues: []
@@ -862,23 +849,23 @@ const pn = /* @__PURE__ */ a("$ZodUnion", (e, t) => {
862
849
  c.push(f);
863
850
  }
864
851
  }
865
- return i ? Promise.all(c).then((u) => ge(u, o, e, s)) : ge(c, o, e, s);
852
+ return i ? Promise.all(c).then((u) => de(u, o, e, s)) : de(c, o, e, s);
866
853
  };
867
- }), mn = /* @__PURE__ */ a("$ZodIntersection", (e, t) => {
868
- _.init(e, t), e._zod.parse = (n, r) => {
869
- const o = n.value, s = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
870
- return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, f]) => _e(n, u, f)) : _e(n, s, i);
854
+ }), ht = /* @__PURE__ */ a("$ZodIntersection", (e, n) => {
855
+ y.init(e, n), e._zod.parse = (t, r) => {
856
+ const o = t.value, s = n.left._zod.run({ value: o, issues: [] }, r), i = n.right._zod.run({ value: o, issues: [] }, r);
857
+ return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, f]) => pe(t, u, f)) : pe(t, s, i);
871
858
  };
872
859
  });
873
- function Q(e, t) {
874
- if (e === t)
860
+ function ee(e, n) {
861
+ if (e === n)
875
862
  return { valid: !0, data: e };
876
- if (e instanceof Date && t instanceof Date && +e == +t)
863
+ if (e instanceof Date && n instanceof Date && +e == +n)
877
864
  return { valid: !0, data: e };
878
- if (H(e) && H(t)) {
879
- const n = Object.keys(t), r = Object.keys(e).filter((s) => n.indexOf(s) !== -1), o = { ...e, ...t };
865
+ if (Q(e) && Q(n)) {
866
+ const t = Object.keys(n), r = Object.keys(e).filter((s) => t.indexOf(s) !== -1), o = { ...e, ...n };
880
867
  for (const s of r) {
881
- const i = Q(e[s], t[s]);
868
+ const i = ee(e[s], n[s]);
882
869
  if (!i.valid)
883
870
  return {
884
871
  valid: !1,
@@ -888,175 +875,168 @@ function Q(e, t) {
888
875
  }
889
876
  return { valid: !0, data: o };
890
877
  }
891
- if (Array.isArray(e) && Array.isArray(t)) {
892
- if (e.length !== t.length)
878
+ if (Array.isArray(e) && Array.isArray(n)) {
879
+ if (e.length !== n.length)
893
880
  return { valid: !1, mergeErrorPath: [] };
894
- const n = [];
881
+ const t = [];
895
882
  for (let r = 0; r < e.length; r++) {
896
- const o = e[r], s = t[r], i = Q(o, s);
883
+ const o = e[r], s = n[r], i = ee(o, s);
897
884
  if (!i.valid)
898
885
  return {
899
886
  valid: !1,
900
887
  mergeErrorPath: [r, ...i.mergeErrorPath]
901
888
  };
902
- n.push(i.data);
889
+ t.push(i.data);
903
890
  }
904
- return { valid: !0, data: n };
891
+ return { valid: !0, data: t };
905
892
  }
906
893
  return { valid: !1, mergeErrorPath: [] };
907
894
  }
908
- function _e(e, t, n) {
895
+ function pe(e, n, t) {
909
896
  const r = /* @__PURE__ */ new Map();
910
897
  let o;
911
- for (const c of t.issues)
898
+ for (const c of n.issues)
912
899
  if (c.code === "unrecognized_keys") {
913
900
  o ?? (o = c);
914
901
  for (const u of c.keys)
915
902
  r.has(u) || r.set(u, {}), r.get(u).l = !0;
916
903
  } else
917
904
  e.issues.push(c);
918
- for (const c of n.issues)
905
+ for (const c of t.issues)
919
906
  if (c.code === "unrecognized_keys")
920
907
  for (const u of c.keys)
921
908
  r.has(u) || r.set(u, {}), r.get(u).r = !0;
922
909
  else
923
910
  e.issues.push(c);
924
911
  const s = [...r].filter(([, c]) => c.l && c.r).map(([c]) => c);
925
- if (s.length && o && e.issues.push({ ...o, keys: s }), N(e))
912
+ if (s.length && o && e.issues.push({ ...o, keys: s }), P(e))
926
913
  return e;
927
- const i = Q(t.value, n.value);
914
+ const i = ee(n.value, t.value);
928
915
  if (!i.valid)
929
916
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
930
917
  return e.value = i.data, e;
931
918
  }
932
- const hn = /* @__PURE__ */ a("$ZodTransform", (e, t) => {
933
- _.init(e, t), e._zod.parse = (n, r) => {
919
+ const gt = /* @__PURE__ */ a("$ZodTransform", (e, n) => {
920
+ y.init(e, n), e._zod.parse = (t, r) => {
934
921
  if (r.direction === "backward")
935
- throw new ee(e.constructor.name);
936
- const o = t.transform(n.value, n);
922
+ throw new Ae(e.constructor.name);
923
+ const o = n.transform(t.value, t);
937
924
  if (r.async)
938
- return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
925
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (t.value = i, t));
939
926
  if (o instanceof Promise)
940
- throw new I();
941
- return n.value = o, n;
927
+ throw new A();
928
+ return t.value = o, t;
942
929
  };
943
930
  });
944
- function ye(e, t) {
945
- return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
946
- }
947
- const se = /* @__PURE__ */ a("$ZodOptional", (e, t) => {
948
- _.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", p(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), p(e._zod, "pattern", () => {
949
- const n = t.innerType._zod.pattern;
950
- return n ? new RegExp(`^(${ne(n.source)})?$`) : void 0;
951
- }), e._zod.parse = (n, r) => {
952
- if (t.innerType._zod.optin === "optional") {
953
- const o = t.innerType._zod.run(n, r);
954
- return o instanceof Promise ? o.then((s) => ye(s, n.value)) : ye(o, n.value);
931
+ function he(e, n) {
932
+ return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
933
+ }
934
+ const ae = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
935
+ y.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", d(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), d(e._zod, "pattern", () => {
936
+ const t = n.innerType._zod.pattern;
937
+ return t ? new RegExp(`^(${oe(t.source)})?$`) : void 0;
938
+ }), e._zod.parse = (t, r) => {
939
+ if (n.innerType._zod.optin === "optional") {
940
+ const o = n.innerType._zod.run(t, r);
941
+ return o instanceof Promise ? o.then((s) => he(s, t.value)) : he(o, t.value);
955
942
  }
956
- return n.value === void 0 ? n : t.innerType._zod.run(n, r);
943
+ return t.value === void 0 ? t : n.innerType._zod.run(t, r);
957
944
  };
958
- }), gn = /* @__PURE__ */ a("$ZodExactOptional", (e, t) => {
959
- se.init(e, t), p(e._zod, "values", () => t.innerType._zod.values), p(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
960
- }), _n = /* @__PURE__ */ a("$ZodNullable", (e, t) => {
961
- _.init(e, t), p(e._zod, "optin", () => t.innerType._zod.optin), p(e._zod, "optout", () => t.innerType._zod.optout), p(e._zod, "pattern", () => {
962
- const n = t.innerType._zod.pattern;
963
- return n ? new RegExp(`^(${ne(n.source)}|null)$`) : void 0;
964
- }), p(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
965
- }), yn = /* @__PURE__ */ a("$ZodDefault", (e, t) => {
966
- _.init(e, t), e._zod.optin = "optional", p(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
945
+ }), _t = /* @__PURE__ */ a("$ZodExactOptional", (e, n) => {
946
+ ae.init(e, n), d(e._zod, "values", () => n.innerType._zod.values), d(e._zod, "pattern", () => n.innerType._zod.pattern), e._zod.parse = (t, r) => n.innerType._zod.run(t, r);
947
+ }), yt = /* @__PURE__ */ a("$ZodNullable", (e, n) => {
948
+ y.init(e, n), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), d(e._zod, "pattern", () => {
949
+ const t = n.innerType._zod.pattern;
950
+ return t ? new RegExp(`^(${oe(t.source)}|null)$`) : void 0;
951
+ }), d(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
952
+ }), vt = /* @__PURE__ */ a("$ZodDefault", (e, n) => {
953
+ y.init(e, n), e._zod.optin = "optional", d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
967
954
  if (r.direction === "backward")
968
- return t.innerType._zod.run(n, r);
969
- if (n.value === void 0)
970
- return n.value = t.defaultValue, n;
971
- const o = t.innerType._zod.run(n, r);
972
- return o instanceof Promise ? o.then((s) => ve(s, t)) : ve(o, t);
955
+ return n.innerType._zod.run(t, r);
956
+ if (t.value === void 0)
957
+ return t.value = n.defaultValue, t;
958
+ const o = n.innerType._zod.run(t, r);
959
+ return o instanceof Promise ? o.then((s) => ge(s, n)) : ge(o, n);
973
960
  };
974
961
  });
975
- function ve(e, t) {
976
- return e.value === void 0 && (e.value = t.defaultValue), e;
977
- }
978
- const vn = /* @__PURE__ */ a("$ZodPrefault", (e, t) => {
979
- _.init(e, t), e._zod.optin = "optional", p(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
980
- }), zn = /* @__PURE__ */ a("$ZodNonOptional", (e, t) => {
981
- _.init(e, t), p(e._zod, "values", () => {
982
- const n = t.innerType._zod.values;
983
- return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
984
- }), e._zod.parse = (n, r) => {
985
- const o = t.innerType._zod.run(n, r);
986
- return o instanceof Promise ? o.then((s) => ze(s, e)) : ze(o, e);
962
+ function ge(e, n) {
963
+ return e.value === void 0 && (e.value = n.defaultValue), e;
964
+ }
965
+ const zt = /* @__PURE__ */ a("$ZodPrefault", (e, n) => {
966
+ y.init(e, n), e._zod.optin = "optional", d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
967
+ }), bt = /* @__PURE__ */ a("$ZodNonOptional", (e, n) => {
968
+ y.init(e, n), d(e._zod, "values", () => {
969
+ const t = n.innerType._zod.values;
970
+ return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
971
+ }), e._zod.parse = (t, r) => {
972
+ const o = n.innerType._zod.run(t, r);
973
+ return o instanceof Promise ? o.then((s) => _e(s, e)) : _e(o, e);
987
974
  };
988
975
  });
989
- function ze(e, t) {
976
+ function _e(e, n) {
990
977
  return !e.issues.length && e.value === void 0 && e.issues.push({
991
978
  code: "invalid_type",
992
979
  expected: "nonoptional",
993
980
  input: e.value,
994
- inst: t
981
+ inst: n
995
982
  }), e;
996
983
  }
997
- const bn = /* @__PURE__ */ a("$ZodSuccess", (e, t) => {
998
- _.init(e, t), e._zod.parse = (n, r) => {
999
- if (r.direction === "backward")
1000
- throw new ee("ZodSuccess");
1001
- const o = t.innerType._zod.run(n, r);
1002
- return o instanceof Promise ? o.then((s) => (n.value = s.issues.length === 0, n)) : (n.value = o.issues.length === 0, n);
1003
- };
1004
- }), wn = /* @__PURE__ */ a("$ZodCatch", (e, t) => {
1005
- _.init(e, t), p(e._zod, "optin", () => t.innerType._zod.optin), p(e._zod, "optout", () => t.innerType._zod.optout), p(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
984
+ const wt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
985
+ y.init(e, n), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1006
986
  if (r.direction === "backward")
1007
- return t.innerType._zod.run(n, r);
1008
- const o = t.innerType._zod.run(n, r);
1009
- return o instanceof Promise ? o.then((s) => (n.value = s.value, s.issues.length && (n.value = t.catchValue({
1010
- ...n,
987
+ return n.innerType._zod.run(t, r);
988
+ const o = n.innerType._zod.run(t, r);
989
+ return o instanceof Promise ? o.then((s) => (t.value = s.value, s.issues.length && (t.value = n.catchValue({
990
+ ...t,
1011
991
  error: {
1012
- issues: s.issues.map((i) => P(i, r, T()))
992
+ issues: s.issues.map((i) => E(i, r, S()))
1013
993
  },
1014
- input: n.value
1015
- }), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
1016
- ...n,
994
+ input: t.value
995
+ }), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
996
+ ...t,
1017
997
  error: {
1018
- issues: o.issues.map((s) => P(s, r, T()))
998
+ issues: o.issues.map((s) => E(s, r, S()))
1019
999
  },
1020
- input: n.value
1021
- }), n.issues = []), n);
1000
+ input: t.value
1001
+ }), t.issues = []), t);
1022
1002
  };
1023
- }), $n = /* @__PURE__ */ a("$ZodPipe", (e, t) => {
1024
- _.init(e, t), p(e._zod, "values", () => t.in._zod.values), p(e._zod, "optin", () => t.in._zod.optin), p(e._zod, "optout", () => t.out._zod.optout), p(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1003
+ }), $t = /* @__PURE__ */ a("$ZodPipe", (e, n) => {
1004
+ y.init(e, n), d(e._zod, "values", () => n.in._zod.values), d(e._zod, "optin", () => n.in._zod.optin), d(e._zod, "optout", () => n.out._zod.optout), d(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1025
1005
  if (r.direction === "backward") {
1026
- const s = t.out._zod.run(n, r);
1027
- return s instanceof Promise ? s.then((i) => x(i, t.in, r)) : x(s, t.in, r);
1006
+ const s = n.out._zod.run(t, r);
1007
+ return s instanceof Promise ? s.then((i) => L(i, n.in, r)) : L(s, n.in, r);
1028
1008
  }
1029
- const o = t.in._zod.run(n, r);
1030
- return o instanceof Promise ? o.then((s) => x(s, t.out, r)) : x(o, t.out, r);
1009
+ const o = n.in._zod.run(t, r);
1010
+ return o instanceof Promise ? o.then((s) => L(s, n.out, r)) : L(o, n.out, r);
1031
1011
  };
1032
1012
  });
1033
- function x(e, t, n) {
1034
- return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
1013
+ function L(e, n, t) {
1014
+ return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
1035
1015
  }
1036
- const Zn = /* @__PURE__ */ a("$ZodReadonly", (e, t) => {
1037
- _.init(e, t), p(e._zod, "propValues", () => t.innerType._zod.propValues), p(e._zod, "values", () => t.innerType._zod.values), p(e._zod, "optin", () => t.innerType?._zod?.optin), p(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
1016
+ const Zt = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
1017
+ y.init(e, n), d(e._zod, "propValues", () => n.innerType._zod.propValues), d(e._zod, "values", () => n.innerType._zod.values), d(e._zod, "optin", () => n.innerType?._zod?.optin), d(e._zod, "optout", () => n.innerType?._zod?.optout), e._zod.parse = (t, r) => {
1038
1018
  if (r.direction === "backward")
1039
- return t.innerType._zod.run(n, r);
1040
- const o = t.innerType._zod.run(n, r);
1041
- return o instanceof Promise ? o.then(be) : be(o);
1019
+ return n.innerType._zod.run(t, r);
1020
+ const o = n.innerType._zod.run(t, r);
1021
+ return o instanceof Promise ? o.then(ye) : ye(o);
1042
1022
  };
1043
1023
  });
1044
- function be(e) {
1024
+ function ye(e) {
1045
1025
  return e.value = Object.freeze(e.value), e;
1046
1026
  }
1047
- const De = /* @__PURE__ */ a("$ZodCustom", (e, t) => {
1048
- b.init(e, t), _.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1049
- const r = n.value, o = t.fn(r);
1027
+ const Ve = /* @__PURE__ */ a("$ZodCustom", (e, n) => {
1028
+ $.init(e, n), y.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1029
+ const r = t.value, o = n.fn(r);
1050
1030
  if (o instanceof Promise)
1051
- return o.then((s) => we(s, n, r, e));
1052
- we(o, n, r, e);
1031
+ return o.then((s) => ve(s, t, r, e));
1032
+ ve(o, t, r, e);
1053
1033
  };
1054
1034
  });
1055
- function we(e, t, n, r) {
1035
+ function ve(e, n, t, r) {
1056
1036
  if (!e) {
1057
1037
  const o = {
1058
1038
  code: "custom",
1059
- input: n,
1039
+ input: t,
1060
1040
  inst: r,
1061
1041
  // incorporates params.error into issue reporting
1062
1042
  path: [...r._zod.def.path ?? []],
@@ -1064,103 +1044,103 @@ function we(e, t, n, r) {
1064
1044
  continue: !r._zod.def.abort
1065
1045
  // params: inst._zod.def.params,
1066
1046
  };
1067
- r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(F(o));
1047
+ r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(j(o));
1068
1048
  }
1069
1049
  }
1070
- var $e;
1071
- class kn {
1050
+ var ze;
1051
+ class kt {
1072
1052
  constructor() {
1073
1053
  this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1074
1054
  }
1075
- add(t, ...n) {
1076
- const r = n[0];
1077
- return this._map.set(t, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, t), this;
1055
+ add(n, ...t) {
1056
+ const r = t[0];
1057
+ return this._map.set(n, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, n), this;
1078
1058
  }
1079
1059
  clear() {
1080
1060
  return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1081
1061
  }
1082
- remove(t) {
1083
- const n = this._map.get(t);
1084
- return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(t), this;
1062
+ remove(n) {
1063
+ const t = this._map.get(n);
1064
+ return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
1085
1065
  }
1086
- get(t) {
1087
- const n = t._zod.parent;
1088
- if (n) {
1089
- const r = { ...this.get(n) ?? {} };
1066
+ get(n) {
1067
+ const t = n._zod.parent;
1068
+ if (t) {
1069
+ const r = { ...this.get(t) ?? {} };
1090
1070
  delete r.id;
1091
- const o = { ...r, ...this._map.get(t) };
1071
+ const o = { ...r, ...this._map.get(n) };
1092
1072
  return Object.keys(o).length ? o : void 0;
1093
1073
  }
1094
- return this._map.get(t);
1074
+ return this._map.get(n);
1095
1075
  }
1096
- has(t) {
1097
- return this._map.has(t);
1076
+ has(n) {
1077
+ return this._map.has(n);
1098
1078
  }
1099
1079
  }
1100
- function On() {
1101
- return new kn();
1080
+ function Ot() {
1081
+ return new kt();
1102
1082
  }
1103
- ($e = globalThis).__zod_globalRegistry ?? ($e.__zod_globalRegistry = On());
1104
- const M = globalThis.__zod_globalRegistry;
1083
+ (ze = globalThis).__zod_globalRegistry ?? (ze.__zod_globalRegistry = Ot());
1084
+ const R = globalThis.__zod_globalRegistry;
1105
1085
  // @__NO_SIDE_EFFECTS__
1106
- function Sn(e, t) {
1086
+ function St(e, n) {
1107
1087
  return new e({
1108
1088
  type: "string",
1109
- ...d(t)
1089
+ ...m(n)
1110
1090
  });
1111
1091
  }
1112
1092
  // @__NO_SIDE_EFFECTS__
1113
- function En(e, t) {
1093
+ function Et(e, n) {
1114
1094
  return new e({
1115
1095
  type: "string",
1116
1096
  format: "email",
1117
1097
  check: "string_format",
1118
1098
  abort: !1,
1119
- ...d(t)
1099
+ ...m(n)
1120
1100
  });
1121
1101
  }
1122
1102
  // @__NO_SIDE_EFFECTS__
1123
- function Tn(e, t) {
1103
+ function Tt(e, n) {
1124
1104
  return new e({
1125
1105
  type: "string",
1126
1106
  format: "uuid",
1127
1107
  check: "string_format",
1128
1108
  abort: !1,
1129
- ...d(t)
1109
+ ...m(n)
1130
1110
  });
1131
1111
  }
1132
1112
  // @__NO_SIDE_EFFECTS__
1133
- function Pn(e, t) {
1113
+ function Pt(e, n) {
1134
1114
  return new e({
1135
1115
  type: "string",
1136
1116
  format: "url",
1137
1117
  check: "string_format",
1138
1118
  abort: !1,
1139
- ...d(t)
1119
+ ...m(n)
1140
1120
  });
1141
1121
  }
1142
1122
  // @__NO_SIDE_EFFECTS__
1143
- function An(e, t) {
1123
+ function At(e, n) {
1144
1124
  return new e({
1145
1125
  type: "string",
1146
1126
  format: "ipv4",
1147
1127
  check: "string_format",
1148
1128
  abort: !1,
1149
- ...d(t)
1129
+ ...m(n)
1150
1130
  });
1151
1131
  }
1152
1132
  // @__NO_SIDE_EFFECTS__
1153
- function Nn(e, t) {
1133
+ function It(e, n) {
1154
1134
  return new e({
1155
1135
  type: "string",
1156
1136
  format: "ipv6",
1157
1137
  check: "string_format",
1158
1138
  abort: !1,
1159
- ...d(t)
1139
+ ...m(n)
1160
1140
  });
1161
1141
  }
1162
1142
  // @__NO_SIDE_EFFECTS__
1163
- function In(e, t) {
1143
+ function Nt(e, n) {
1164
1144
  return new e({
1165
1145
  type: "string",
1166
1146
  format: "datetime",
@@ -1168,247 +1148,247 @@ function In(e, t) {
1168
1148
  offset: !1,
1169
1149
  local: !1,
1170
1150
  precision: null,
1171
- ...d(t)
1151
+ ...m(n)
1172
1152
  });
1173
1153
  }
1174
1154
  // @__NO_SIDE_EFFECTS__
1175
- function jn(e, t) {
1155
+ function Mt(e, n) {
1176
1156
  return new e({
1177
1157
  type: "string",
1178
1158
  format: "date",
1179
1159
  check: "string_format",
1180
- ...d(t)
1160
+ ...m(n)
1181
1161
  });
1182
1162
  }
1183
1163
  // @__NO_SIDE_EFFECTS__
1184
- function Cn(e, t) {
1164
+ function Ct(e, n) {
1185
1165
  return new e({
1186
1166
  type: "string",
1187
1167
  format: "time",
1188
1168
  check: "string_format",
1189
1169
  precision: null,
1190
- ...d(t)
1170
+ ...m(n)
1191
1171
  });
1192
1172
  }
1193
1173
  // @__NO_SIDE_EFFECTS__
1194
- function Rn(e, t) {
1174
+ function Rt(e, n) {
1195
1175
  return new e({
1196
1176
  type: "string",
1197
1177
  format: "duration",
1198
1178
  check: "string_format",
1199
- ...d(t)
1179
+ ...m(n)
1200
1180
  });
1201
1181
  }
1202
1182
  // @__NO_SIDE_EFFECTS__
1203
- function Mn(e, t) {
1183
+ function jt(e, n) {
1204
1184
  return new e({
1205
1185
  type: "number",
1206
1186
  checks: [],
1207
- ...d(t)
1187
+ ...m(n)
1208
1188
  });
1209
1189
  }
1210
1190
  // @__NO_SIDE_EFFECTS__
1211
- function Fn(e, t) {
1191
+ function Ft(e, n) {
1212
1192
  return new e({
1213
1193
  type: "number",
1214
1194
  check: "number_format",
1215
1195
  abort: !1,
1216
1196
  format: "safeint",
1217
- ...d(t)
1197
+ ...m(n)
1218
1198
  });
1219
1199
  }
1220
1200
  // @__NO_SIDE_EFFECTS__
1221
- function Dn(e, t) {
1201
+ function Dt(e, n) {
1222
1202
  return new e({
1223
1203
  type: "boolean",
1224
- ...d(t)
1204
+ ...m(n)
1225
1205
  });
1226
1206
  }
1227
1207
  // @__NO_SIDE_EFFECTS__
1228
- function Ln(e) {
1208
+ function xt(e) {
1229
1209
  return new e({
1230
1210
  type: "any"
1231
1211
  });
1232
1212
  }
1233
1213
  // @__NO_SIDE_EFFECTS__
1234
- function xn(e, t) {
1235
- return new Ft({
1214
+ function Lt(e, n) {
1215
+ return new Ln({
1236
1216
  check: "less_than",
1237
- ...d(t),
1217
+ ...m(n),
1238
1218
  value: e,
1239
1219
  inclusive: !0
1240
1220
  });
1241
1221
  }
1242
1222
  // @__NO_SIDE_EFFECTS__
1243
- function Jn(e, t) {
1244
- return new Dt({
1223
+ function Jt(e, n) {
1224
+ return new Jn({
1245
1225
  check: "greater_than",
1246
- ...d(t),
1226
+ ...m(n),
1247
1227
  value: e,
1248
1228
  inclusive: !0
1249
1229
  });
1250
1230
  }
1251
1231
  // @__NO_SIDE_EFFECTS__
1252
- function ce(e, t) {
1253
- return new xt({
1232
+ function K(e, n) {
1233
+ return new Vn({
1254
1234
  check: "max_length",
1255
- ...d(t),
1235
+ ...m(n),
1256
1236
  maximum: e
1257
1237
  });
1258
1238
  }
1259
1239
  // @__NO_SIDE_EFFECTS__
1260
- function D(e, t) {
1261
- return new Jt({
1240
+ function I(e, n) {
1241
+ return new Wn({
1262
1242
  check: "min_length",
1263
- ...d(t),
1243
+ ...m(n),
1264
1244
  minimum: e
1265
1245
  });
1266
1246
  }
1267
1247
  // @__NO_SIDE_EFFECTS__
1268
- function Le(e, t) {
1269
- return new Ut({
1248
+ function We(e, n) {
1249
+ return new qn({
1270
1250
  check: "length_equals",
1271
- ...d(t),
1251
+ ...m(n),
1272
1252
  length: e
1273
1253
  });
1274
1254
  }
1275
1255
  // @__NO_SIDE_EFFECTS__
1276
- function xe(e, t) {
1277
- return new Vt({
1256
+ function qe(e, n) {
1257
+ return new Bn({
1278
1258
  check: "string_format",
1279
1259
  format: "regex",
1280
- ...d(t),
1260
+ ...m(n),
1281
1261
  pattern: e
1282
1262
  });
1283
1263
  }
1284
1264
  // @__NO_SIDE_EFFECTS__
1285
- function Un(e) {
1286
- return new Wt({
1265
+ function Ut(e) {
1266
+ return new Gn({
1287
1267
  check: "string_format",
1288
1268
  format: "lowercase",
1289
- ...d(e)
1269
+ ...m(e)
1290
1270
  });
1291
1271
  }
1292
1272
  // @__NO_SIDE_EFFECTS__
1293
- function Vn(e) {
1294
- return new Bt({
1273
+ function Vt(e) {
1274
+ return new Kn({
1295
1275
  check: "string_format",
1296
1276
  format: "uppercase",
1297
- ...d(e)
1277
+ ...m(e)
1298
1278
  });
1299
1279
  }
1300
1280
  // @__NO_SIDE_EFFECTS__
1301
- function Wn(e, t) {
1302
- return new Gt({
1281
+ function Wt(e, n) {
1282
+ return new Yn({
1303
1283
  check: "string_format",
1304
1284
  format: "includes",
1305
- ...d(t),
1285
+ ...m(n),
1306
1286
  includes: e
1307
1287
  });
1308
1288
  }
1309
1289
  // @__NO_SIDE_EFFECTS__
1310
- function Bn(e, t) {
1311
- return new qt({
1290
+ function qt(e, n) {
1291
+ return new Xn({
1312
1292
  check: "string_format",
1313
1293
  format: "starts_with",
1314
- ...d(t),
1294
+ ...m(n),
1315
1295
  prefix: e
1316
1296
  });
1317
1297
  }
1318
1298
  // @__NO_SIDE_EFFECTS__
1319
- function Gn(e, t) {
1320
- return new Kt({
1299
+ function Bt(e, n) {
1300
+ return new Hn({
1321
1301
  check: "string_format",
1322
1302
  format: "ends_with",
1323
- ...d(t),
1303
+ ...m(n),
1324
1304
  suffix: e
1325
1305
  });
1326
1306
  }
1327
1307
  // @__NO_SIDE_EFFECTS__
1328
- function j(e) {
1329
- return new Yt({
1308
+ function N(e) {
1309
+ return new Qn({
1330
1310
  check: "overwrite",
1331
1311
  tx: e
1332
1312
  });
1333
1313
  }
1334
1314
  // @__NO_SIDE_EFFECTS__
1335
- function qn(e) {
1336
- return /* @__PURE__ */ j((t) => t.normalize(e));
1315
+ function Gt(e) {
1316
+ return /* @__PURE__ */ N((n) => n.normalize(e));
1337
1317
  }
1338
1318
  // @__NO_SIDE_EFFECTS__
1339
- function Kn() {
1340
- return /* @__PURE__ */ j((e) => e.trim());
1319
+ function Kt() {
1320
+ return /* @__PURE__ */ N((e) => e.trim());
1341
1321
  }
1342
1322
  // @__NO_SIDE_EFFECTS__
1343
- function Yn() {
1344
- return /* @__PURE__ */ j((e) => e.toLowerCase());
1323
+ function Yt() {
1324
+ return /* @__PURE__ */ N((e) => e.toLowerCase());
1345
1325
  }
1346
1326
  // @__NO_SIDE_EFFECTS__
1347
- function Xn() {
1348
- return /* @__PURE__ */ j((e) => e.toUpperCase());
1327
+ function Xt() {
1328
+ return /* @__PURE__ */ N((e) => e.toUpperCase());
1349
1329
  }
1350
1330
  // @__NO_SIDE_EFFECTS__
1351
- function Hn() {
1352
- return /* @__PURE__ */ j((e) => ut(e));
1331
+ function Ht() {
1332
+ return /* @__PURE__ */ N((e) => mn(e));
1353
1333
  }
1354
1334
  // @__NO_SIDE_EFFECTS__
1355
- function Qn(e, t, n) {
1335
+ function Qt(e, n, t) {
1356
1336
  return new e({
1357
1337
  type: "array",
1358
- element: t,
1338
+ element: n,
1359
1339
  // get element() {
1360
1340
  // return element;
1361
1341
  // },
1362
- ...d(n)
1342
+ ...m(t)
1363
1343
  });
1364
1344
  }
1365
1345
  // @__NO_SIDE_EFFECTS__
1366
- function Je(e, t, n) {
1346
+ function Be(e, n, t) {
1367
1347
  return new e({
1368
1348
  type: "custom",
1369
1349
  check: "custom",
1370
- fn: t,
1371
- ...d(n)
1350
+ fn: n,
1351
+ ...m(t)
1372
1352
  });
1373
1353
  }
1374
1354
  // @__NO_SIDE_EFFECTS__
1375
- function Ue(e) {
1376
- const t = /* @__PURE__ */ er((n) => (n.addIssue = (r) => {
1355
+ function Ge(e) {
1356
+ const n = /* @__PURE__ */ er((t) => (t.addIssue = (r) => {
1377
1357
  if (typeof r == "string")
1378
- n.issues.push(F(r, n.value, t._zod.def));
1358
+ t.issues.push(j(r, t.value, n._zod.def));
1379
1359
  else {
1380
1360
  const o = r;
1381
- o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(F(o));
1361
+ o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(j(o));
1382
1362
  }
1383
- }, e(n.value, n)));
1384
- return t;
1363
+ }, e(t.value, t)));
1364
+ return n;
1385
1365
  }
1386
1366
  // @__NO_SIDE_EFFECTS__
1387
- function er(e, t) {
1388
- const n = new b({
1367
+ function er(e, n) {
1368
+ const t = new $({
1389
1369
  check: "custom",
1390
- ...d(t)
1370
+ ...m(n)
1391
1371
  });
1392
- return n._zod.check = e, n;
1372
+ return t._zod.check = e, t;
1393
1373
  }
1394
1374
  // @__NO_SIDE_EFFECTS__
1395
- function tr(e, t, n, r = {}) {
1396
- const o = d(r), s = {
1397
- ...d(r),
1375
+ function nr(e, n, t, r = {}) {
1376
+ const o = m(r), s = {
1377
+ ...m(r),
1398
1378
  check: "string_format",
1399
1379
  type: "string",
1400
- format: t,
1401
- fn: typeof n == "function" ? n : (c) => n.test(c),
1380
+ format: n,
1381
+ fn: typeof t == "function" ? t : (c) => t.test(c),
1402
1382
  ...o
1403
1383
  };
1404
- return n instanceof RegExp && (s.pattern = n), new e(s);
1384
+ return t instanceof RegExp && (s.pattern = t), new e(s);
1405
1385
  }
1406
- function Ve(e) {
1407
- let t = e?.target ?? "draft-2020-12";
1408
- return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
1386
+ function Ke(e) {
1387
+ let n = e?.target ?? "draft-2020-12";
1388
+ return n === "draft-4" && (n = "draft-04"), n === "draft-7" && (n = "draft-07"), {
1409
1389
  processors: e.processors ?? {},
1410
- metadataRegistry: e?.metadata ?? M,
1411
- target: t,
1390
+ metadataRegistry: e?.metadata ?? R,
1391
+ target: n,
1412
1392
  unrepresentable: e?.unrepresentable ?? "throw",
1413
1393
  override: e?.override ?? (() => {
1414
1394
  }),
@@ -1420,39 +1400,39 @@ function Ve(e) {
1420
1400
  external: e?.external ?? void 0
1421
1401
  };
1422
1402
  }
1423
- function v(e, t, n = { path: [], schemaPath: [] }) {
1403
+ function b(e, n, t = { path: [], schemaPath: [] }) {
1424
1404
  var r;
1425
- const o = e._zod.def, s = t.seen.get(e);
1405
+ const o = e._zod.def, s = n.seen.get(e);
1426
1406
  if (s)
1427
- return s.count++, n.schemaPath.includes(e) && (s.cycle = n.path), s.schema;
1428
- const i = { schema: {}, count: 1, cycle: void 0, path: n.path };
1429
- t.seen.set(e, i);
1407
+ return s.count++, t.schemaPath.includes(e) && (s.cycle = t.path), s.schema;
1408
+ const i = { schema: {}, count: 1, cycle: void 0, path: t.path };
1409
+ n.seen.set(e, i);
1430
1410
  const c = e._zod.toJSONSchema?.();
1431
1411
  if (c)
1432
1412
  i.schema = c;
1433
1413
  else {
1434
1414
  const l = {
1435
- ...n,
1436
- schemaPath: [...n.schemaPath, e],
1437
- path: n.path
1415
+ ...t,
1416
+ schemaPath: [...t.schemaPath, e],
1417
+ path: t.path
1438
1418
  };
1439
1419
  if (e._zod.processJSONSchema)
1440
- e._zod.processJSONSchema(t, i.schema, l);
1420
+ e._zod.processJSONSchema(n, i.schema, l);
1441
1421
  else {
1442
- const h = i.schema, g = t.processors[o.type];
1422
+ const h = i.schema, g = n.processors[o.type];
1443
1423
  if (!g)
1444
1424
  throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
1445
- g(e, t, h, l);
1425
+ g(e, n, h, l);
1446
1426
  }
1447
- const m = e._zod.parent;
1448
- m && (i.ref || (i.ref = m), v(m, t, l), t.seen.get(m).isParent = !0);
1427
+ const p = e._zod.parent;
1428
+ p && (i.ref || (i.ref = p), b(p, n, l), n.seen.get(p).isParent = !0);
1449
1429
  }
1450
- const u = t.metadataRegistry.get(e);
1451
- return u && Object.assign(i.schema, u), t.io === "input" && y(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
1430
+ const u = n.metadataRegistry.get(e);
1431
+ return u && Object.assign(i.schema, u), n.io === "input" && z(e) && (delete i.schema.examples, delete i.schema.default), n.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, n.seen.get(e).schema;
1452
1432
  }
1453
- function We(e, t) {
1454
- const n = e.seen.get(t);
1455
- if (!n)
1433
+ function Ye(e, n) {
1434
+ const t = e.seen.get(n);
1435
+ if (!t)
1456
1436
  throw new Error("Unprocessed schema. This is a bug in Zod.");
1457
1437
  const r = /* @__PURE__ */ new Map();
1458
1438
  for (const i of e.seen.entries()) {
@@ -1467,13 +1447,13 @@ function We(e, t) {
1467
1447
  const o = (i) => {
1468
1448
  const c = e.target === "draft-2020-12" ? "$defs" : "definitions";
1469
1449
  if (e.external) {
1470
- const m = e.external.registry.get(i[0])?.id, h = e.external.uri ?? ((R) => R);
1471
- if (m)
1472
- return { ref: h(m) };
1450
+ const p = e.external.registry.get(i[0])?.id, h = e.external.uri ?? ((C) => C);
1451
+ if (p)
1452
+ return { ref: h(p) };
1473
1453
  const g = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
1474
1454
  return i[1].defId = g, { defId: g, ref: `${h("__shared")}#/${c}/${g}` };
1475
1455
  }
1476
- if (i[1] === n)
1456
+ if (i[1] === t)
1477
1457
  return { ref: "#" };
1478
1458
  const f = `#/${c}/`, l = i[1].schema.id ?? `__schema${e.counter++}`;
1479
1459
  return { defId: l, ref: f + l };
@@ -1483,8 +1463,8 @@ function We(e, t) {
1483
1463
  const c = i[1], { ref: u, defId: f } = o(i);
1484
1464
  c.def = { ...c.schema }, f && (c.defId = f);
1485
1465
  const l = c.schema;
1486
- for (const m in l)
1487
- delete l[m];
1466
+ for (const p in l)
1467
+ delete l[p];
1488
1468
  l.$ref = u;
1489
1469
  };
1490
1470
  if (e.cycles === "throw")
@@ -1497,13 +1477,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1497
1477
  }
1498
1478
  for (const i of e.seen.entries()) {
1499
1479
  const c = i[1];
1500
- if (t === i[0]) {
1480
+ if (n === i[0]) {
1501
1481
  s(i);
1502
1482
  continue;
1503
1483
  }
1504
1484
  if (e.external) {
1505
1485
  const f = e.external.registry.get(i[0])?.id;
1506
- if (t !== i[0] && f) {
1486
+ if (n !== i[0] && f) {
1507
1487
  s(i);
1508
1488
  continue;
1509
1489
  }
@@ -1522,9 +1502,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1522
1502
  }
1523
1503
  }
1524
1504
  }
1525
- function Be(e, t) {
1526
- const n = e.seen.get(t);
1527
- if (!n)
1505
+ function Xe(e, n) {
1506
+ const t = e.seen.get(n);
1507
+ if (!t)
1528
1508
  throw new Error("Unprocessed schema. This is a bug in Zod.");
1529
1509
  const r = (i) => {
1530
1510
  const c = e.seen.get(i);
@@ -1535,16 +1515,16 @@ function Be(e, t) {
1535
1515
  r(l);
1536
1516
  const h = e.seen.get(l), g = h.schema;
1537
1517
  if (g.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (u.allOf = u.allOf ?? [], u.allOf.push(g)) : Object.assign(u, g), Object.assign(u, f), i._zod.parent === l)
1538
- for (const Z in u)
1539
- Z === "$ref" || Z === "allOf" || Z in f || delete u[Z];
1518
+ for (const O in u)
1519
+ O === "$ref" || O === "allOf" || O in f || delete u[O];
1540
1520
  if (g.$ref && h.def)
1541
- for (const Z in u)
1542
- Z === "$ref" || Z === "allOf" || Z in h.def && JSON.stringify(u[Z]) === JSON.stringify(h.def[Z]) && delete u[Z];
1521
+ for (const O in u)
1522
+ O === "$ref" || O === "allOf" || O in h.def && JSON.stringify(u[O]) === JSON.stringify(h.def[O]) && delete u[O];
1543
1523
  }
1544
- const m = i._zod.parent;
1545
- if (m && m !== l) {
1546
- r(m);
1547
- const h = e.seen.get(m);
1524
+ const p = i._zod.parent;
1525
+ if (p && p !== l) {
1526
+ r(p);
1527
+ const h = e.seen.get(p);
1548
1528
  if (h?.schema.$ref && (u.$ref = h.schema.$ref, h.def))
1549
1529
  for (const g in u)
1550
1530
  g === "$ref" || g === "allOf" || g in h.def && JSON.stringify(u[g]) === JSON.stringify(h.def[g]) && delete u[g];
@@ -1559,12 +1539,12 @@ function Be(e, t) {
1559
1539
  r(i[0]);
1560
1540
  const o = {};
1561
1541
  if (e.target === "draft-2020-12" ? o.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? o.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? o.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
1562
- const i = e.external.registry.get(t)?.id;
1542
+ const i = e.external.registry.get(n)?.id;
1563
1543
  if (!i)
1564
1544
  throw new Error("Schema is missing an `id` property");
1565
1545
  o.$id = e.external.uri(i);
1566
1546
  }
1567
- Object.assign(o, n.def ?? n.schema);
1547
+ Object.assign(o, t.def ?? t.schema);
1568
1548
  const s = e.external?.defs ?? {};
1569
1549
  for (const i of e.seen.entries()) {
1570
1550
  const c = i[1];
@@ -1575,10 +1555,10 @@ function Be(e, t) {
1575
1555
  const i = JSON.parse(JSON.stringify(o));
1576
1556
  return Object.defineProperty(i, "~standard", {
1577
1557
  value: {
1578
- ...t["~standard"],
1558
+ ...n["~standard"],
1579
1559
  jsonSchema: {
1580
- input: J(t, "input", e.processors),
1581
- output: J(t, "output", e.processors)
1560
+ input: J(n, "input", e.processors),
1561
+ output: J(n, "output", e.processors)
1582
1562
  }
1583
1563
  },
1584
1564
  enumerable: !1,
@@ -1588,54 +1568,54 @@ function Be(e, t) {
1588
1568
  throw new Error("Error converting schema to JSON.");
1589
1569
  }
1590
1570
  }
1591
- function y(e, t) {
1592
- const n = t ?? { seen: /* @__PURE__ */ new Set() };
1593
- if (n.seen.has(e))
1571
+ function z(e, n) {
1572
+ const t = n ?? { seen: /* @__PURE__ */ new Set() };
1573
+ if (t.seen.has(e))
1594
1574
  return !1;
1595
- n.seen.add(e);
1575
+ t.seen.add(e);
1596
1576
  const r = e._zod.def;
1597
1577
  if (r.type === "transform")
1598
1578
  return !0;
1599
1579
  if (r.type === "array")
1600
- return y(r.element, n);
1580
+ return z(r.element, t);
1601
1581
  if (r.type === "set")
1602
- return y(r.valueType, n);
1582
+ return z(r.valueType, t);
1603
1583
  if (r.type === "lazy")
1604
- return y(r.getter(), n);
1584
+ return z(r.getter(), t);
1605
1585
  if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
1606
- return y(r.innerType, n);
1586
+ return z(r.innerType, t);
1607
1587
  if (r.type === "intersection")
1608
- return y(r.left, n) || y(r.right, n);
1588
+ return z(r.left, t) || z(r.right, t);
1609
1589
  if (r.type === "record" || r.type === "map")
1610
- return y(r.keyType, n) || y(r.valueType, n);
1590
+ return z(r.keyType, t) || z(r.valueType, t);
1611
1591
  if (r.type === "pipe")
1612
- return y(r.in, n) || y(r.out, n);
1592
+ return z(r.in, t) || z(r.out, t);
1613
1593
  if (r.type === "object") {
1614
1594
  for (const o in r.shape)
1615
- if (y(r.shape[o], n))
1595
+ if (z(r.shape[o], t))
1616
1596
  return !0;
1617
1597
  return !1;
1618
1598
  }
1619
1599
  if (r.type === "union") {
1620
1600
  for (const o of r.options)
1621
- if (y(o, n))
1601
+ if (z(o, t))
1622
1602
  return !0;
1623
1603
  return !1;
1624
1604
  }
1625
1605
  if (r.type === "tuple") {
1626
1606
  for (const o of r.items)
1627
- if (y(o, n))
1607
+ if (z(o, t))
1628
1608
  return !0;
1629
- return !!(r.rest && y(r.rest, n));
1609
+ return !!(r.rest && z(r.rest, t));
1630
1610
  }
1631
1611
  return !1;
1632
1612
  }
1633
- const nr = (e, t = {}) => (n) => {
1634
- const r = Ve({ ...n, processors: t });
1635
- return v(e, r), We(r, e), Be(r, e);
1636
- }, J = (e, t, n = {}) => (r) => {
1637
- const { libraryOptions: o, target: s } = r ?? {}, i = Ve({ ...o ?? {}, target: s, io: t, processors: n });
1638
- return v(e, i), We(i, e), Be(i, e);
1613
+ const tr = (e, n = {}) => (t) => {
1614
+ const r = Ke({ ...t, processors: n });
1615
+ return b(e, r), Ye(r, e), Xe(r, e);
1616
+ }, J = (e, n, t = {}) => (r) => {
1617
+ const { libraryOptions: o, target: s } = r ?? {}, i = Ke({ ...o ?? {}, target: s, io: n, processors: t });
1618
+ return b(e, i), Ye(i, e), Xe(i, e);
1639
1619
  }, rr = {
1640
1620
  guid: "uuid",
1641
1621
  url: "uri",
@@ -1643,68 +1623,68 @@ const nr = (e, t = {}) => (n) => {
1643
1623
  json_string: "json-string",
1644
1624
  regex: ""
1645
1625
  // do not set
1646
- }, or = (e, t, n, r) => {
1647
- const o = n;
1626
+ }, or = (e, n, t, r) => {
1627
+ const o = t;
1648
1628
  o.type = "string";
1649
1629
  const { minimum: s, maximum: i, format: c, patterns: u, contentEncoding: f } = e._zod.bag;
1650
1630
  if (typeof s == "number" && (o.minLength = s), typeof i == "number" && (o.maxLength = i), c && (o.format = rr[c] ?? c, o.format === "" && delete o.format, c === "time" && delete o.format), f && (o.contentEncoding = f), u && u.size > 0) {
1651
1631
  const l = [...u];
1652
1632
  l.length === 1 ? o.pattern = l[0].source : l.length > 1 && (o.allOf = [
1653
- ...l.map((m) => ({
1654
- ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
1655
- pattern: m.source
1633
+ ...l.map((p) => ({
1634
+ ...n.target === "draft-07" || n.target === "draft-04" || n.target === "openapi-3.0" ? { type: "string" } : {},
1635
+ pattern: p.source
1656
1636
  }))
1657
1637
  ]);
1658
1638
  }
1659
- }, ir = (e, t, n, r) => {
1660
- if (t.unrepresentable === "throw")
1639
+ }, ir = (e, n, t, r) => {
1640
+ if (n.unrepresentable === "throw")
1661
1641
  throw new Error("Custom types cannot be represented in JSON Schema");
1662
- }, sr = (e, t, n, r) => {
1663
- if (t.unrepresentable === "throw")
1642
+ }, sr = (e, n, t, r) => {
1643
+ if (n.unrepresentable === "throw")
1664
1644
  throw new Error("Transforms cannot be represented in JSON Schema");
1665
- }, cr = (e, t, n, r) => {
1666
- const o = n, s = e._zod.def, { minimum: i, maximum: c } = e._zod.bag;
1667
- typeof i == "number" && (o.minItems = i), typeof c == "number" && (o.maxItems = c), o.type = "array", o.items = v(s.element, t, { ...r, path: [...r.path, "items"] });
1668
- }, ar = (e, t, n, r) => {
1669
- const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((c, u) => v(c, t, {
1645
+ }, cr = (e, n, t, r) => {
1646
+ const o = t, s = e._zod.def, { minimum: i, maximum: c } = e._zod.bag;
1647
+ typeof i == "number" && (o.minItems = i), typeof c == "number" && (o.maxItems = c), o.type = "array", o.items = b(s.element, n, { ...r, path: [...r.path, "items"] });
1648
+ }, ar = (e, n, t, r) => {
1649
+ const o = e._zod.def, s = o.inclusive === !1, i = o.options.map((c, u) => b(c, n, {
1670
1650
  ...r,
1671
1651
  path: [...r.path, s ? "oneOf" : "anyOf", u]
1672
1652
  }));
1673
- s ? n.oneOf = i : n.anyOf = i;
1674
- }, ur = (e, t, n, r) => {
1675
- const o = e._zod.def, s = v(o.left, t, {
1653
+ s ? t.oneOf = i : t.anyOf = i;
1654
+ }, ur = (e, n, t, r) => {
1655
+ const o = e._zod.def, s = b(o.left, n, {
1676
1656
  ...r,
1677
1657
  path: [...r.path, "allOf", 0]
1678
- }), i = v(o.right, t, {
1658
+ }), i = b(o.right, n, {
1679
1659
  ...r,
1680
1660
  path: [...r.path, "allOf", 1]
1681
1661
  }), c = (f) => "allOf" in f && Object.keys(f).length === 1, u = [
1682
1662
  ...c(s) ? s.allOf : [s],
1683
1663
  ...c(i) ? i.allOf : [i]
1684
1664
  ];
1685
- n.allOf = u;
1686
- }, fr = (e, t, n, r) => {
1687
- const o = e._zod.def, s = v(o.innerType, t, r), i = t.seen.get(e);
1688
- t.target === "openapi-3.0" ? (i.ref = o.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
1689
- }, lr = (e, t, n, r) => {
1665
+ t.allOf = u;
1666
+ }, fr = (e, n, t, r) => {
1667
+ const o = e._zod.def, s = b(o.innerType, n, r), i = n.seen.get(e);
1668
+ n.target === "openapi-3.0" ? (i.ref = o.innerType, t.nullable = !0) : t.anyOf = [s, { type: "null" }];
1669
+ }, lr = (e, n, t, r) => {
1690
1670
  const o = e._zod.def;
1691
- v(o.innerType, t, r);
1692
- const s = t.seen.get(e);
1671
+ b(o.innerType, n, r);
1672
+ const s = n.seen.get(e);
1693
1673
  s.ref = o.innerType;
1694
- }, dr = (e, t, n, r) => {
1674
+ }, mr = (e, n, t, r) => {
1695
1675
  const o = e._zod.def;
1696
- v(o.innerType, t, r);
1697
- const s = t.seen.get(e);
1698
- s.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
1699
- }, pr = (e, t, n, r) => {
1676
+ b(o.innerType, n, r);
1677
+ const s = n.seen.get(e);
1678
+ s.ref = o.innerType, t.default = JSON.parse(JSON.stringify(o.defaultValue));
1679
+ }, dr = (e, n, t, r) => {
1700
1680
  const o = e._zod.def;
1701
- v(o.innerType, t, r);
1702
- const s = t.seen.get(e);
1703
- s.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
1704
- }, mr = (e, t, n, r) => {
1681
+ b(o.innerType, n, r);
1682
+ const s = n.seen.get(e);
1683
+ s.ref = o.innerType, n.io === "input" && (t._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
1684
+ }, pr = (e, n, t, r) => {
1705
1685
  const o = e._zod.def;
1706
- v(o.innerType, t, r);
1707
- const s = t.seen.get(e);
1686
+ b(o.innerType, n, r);
1687
+ const s = n.seen.get(e);
1708
1688
  s.ref = o.innerType;
1709
1689
  let i;
1710
1690
  try {
@@ -1712,65 +1692,65 @@ const nr = (e, t = {}) => (n) => {
1712
1692
  } catch {
1713
1693
  throw new Error("Dynamic catch values are not supported in JSON Schema");
1714
1694
  }
1715
- n.default = i;
1716
- }, hr = (e, t, n, r) => {
1717
- const o = e._zod.def, s = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
1718
- v(s, t, r);
1719
- const i = t.seen.get(e);
1695
+ t.default = i;
1696
+ }, hr = (e, n, t, r) => {
1697
+ const o = e._zod.def, s = n.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
1698
+ b(s, n, r);
1699
+ const i = n.seen.get(e);
1720
1700
  i.ref = s;
1721
- }, gr = (e, t, n, r) => {
1701
+ }, gr = (e, n, t, r) => {
1722
1702
  const o = e._zod.def;
1723
- v(o.innerType, t, r);
1724
- const s = t.seen.get(e);
1725
- s.ref = o.innerType, n.readOnly = !0;
1726
- }, Ge = (e, t, n, r) => {
1703
+ b(o.innerType, n, r);
1704
+ const s = n.seen.get(e);
1705
+ s.ref = o.innerType, t.readOnly = !0;
1706
+ }, He = (e, n, t, r) => {
1727
1707
  const o = e._zod.def;
1728
- v(o.innerType, t, r);
1729
- const s = t.seen.get(e);
1708
+ b(o.innerType, n, r);
1709
+ const s = n.seen.get(e);
1730
1710
  s.ref = o.innerType;
1731
- }, _r = /* @__PURE__ */ a("ZodISODateTime", (e, t) => {
1732
- tn.init(e, t), K.init(e, t);
1711
+ }, _r = /* @__PURE__ */ a("ZodISODateTime", (e, n) => {
1712
+ ot.init(e, n), Y.init(e, n);
1733
1713
  });
1734
1714
  function yr(e) {
1735
- return /* @__PURE__ */ In(_r, e);
1715
+ return /* @__PURE__ */ Nt(_r, e);
1736
1716
  }
1737
- const vr = /* @__PURE__ */ a("ZodISODate", (e, t) => {
1738
- nn.init(e, t), K.init(e, t);
1717
+ const vr = /* @__PURE__ */ a("ZodISODate", (e, n) => {
1718
+ it.init(e, n), Y.init(e, n);
1739
1719
  });
1740
1720
  function zr(e) {
1741
- return /* @__PURE__ */ jn(vr, e);
1721
+ return /* @__PURE__ */ Mt(vr, e);
1742
1722
  }
1743
- const br = /* @__PURE__ */ a("ZodISOTime", (e, t) => {
1744
- rn.init(e, t), K.init(e, t);
1723
+ const br = /* @__PURE__ */ a("ZodISOTime", (e, n) => {
1724
+ st.init(e, n), Y.init(e, n);
1745
1725
  });
1746
1726
  function wr(e) {
1747
- return /* @__PURE__ */ Cn(br, e);
1727
+ return /* @__PURE__ */ Ct(br, e);
1748
1728
  }
1749
- const $r = /* @__PURE__ */ a("ZodISODuration", (e, t) => {
1750
- on.init(e, t), K.init(e, t);
1729
+ const $r = /* @__PURE__ */ a("ZodISODuration", (e, n) => {
1730
+ ct.init(e, n), Y.init(e, n);
1751
1731
  });
1752
1732
  function Zr(e) {
1753
- return /* @__PURE__ */ Rn($r, e);
1733
+ return /* @__PURE__ */ Rt($r, e);
1754
1734
  }
1755
- const kr = (e, t) => {
1756
- Ne.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
1735
+ const kr = (e, n) => {
1736
+ Re.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
1757
1737
  format: {
1758
- value: (n) => pt(e, n)
1738
+ value: (t) => gn(e, t)
1759
1739
  // enumerable: false,
1760
1740
  },
1761
1741
  flatten: {
1762
- value: (n) => dt(e, n)
1742
+ value: (t) => hn(e, t)
1763
1743
  // enumerable: false,
1764
1744
  },
1765
1745
  addIssue: {
1766
- value: (n) => {
1767
- e.issues.push(n), e.message = JSON.stringify(e.issues, X, 2);
1746
+ value: (t) => {
1747
+ e.issues.push(t), e.message = JSON.stringify(e.issues, H, 2);
1768
1748
  }
1769
1749
  // enumerable: false,
1770
1750
  },
1771
1751
  addIssues: {
1772
- value: (n) => {
1773
- e.issues.push(...n), e.message = JSON.stringify(e.issues, X, 2);
1752
+ value: (t) => {
1753
+ e.issues.push(...t), e.message = JSON.stringify(e.issues, H, 2);
1774
1754
  }
1775
1755
  // enumerable: false,
1776
1756
  },
@@ -1781,171 +1761,171 @@ const kr = (e, t) => {
1781
1761
  // enumerable: false,
1782
1762
  }
1783
1763
  });
1784
- }, $ = a("ZodError", kr, {
1764
+ }, k = a("ZodError", kr, {
1785
1765
  Parent: Error
1786
- }), Or = /* @__PURE__ */ V($), Sr = /* @__PURE__ */ W($), Er = /* @__PURE__ */ B($), Tr = /* @__PURE__ */ G($), Pr = /* @__PURE__ */ gt($), Ar = /* @__PURE__ */ _t($), Nr = /* @__PURE__ */ yt($), Ir = /* @__PURE__ */ vt($), jr = /* @__PURE__ */ zt($), Cr = /* @__PURE__ */ bt($), Rr = /* @__PURE__ */ wt($), Mr = /* @__PURE__ */ $t($), z = /* @__PURE__ */ a("ZodType", (e, t) => (_.init(e, t), Object.assign(e["~standard"], {
1766
+ }), Or = /* @__PURE__ */ V(k), Sr = /* @__PURE__ */ W(k), Er = /* @__PURE__ */ q(k), Tr = /* @__PURE__ */ B(k), Pr = /* @__PURE__ */ vn(k), Ar = /* @__PURE__ */ zn(k), Ir = /* @__PURE__ */ bn(k), Nr = /* @__PURE__ */ wn(k), Mr = /* @__PURE__ */ $n(k), Cr = /* @__PURE__ */ Zn(k), Rr = /* @__PURE__ */ kn(k), jr = /* @__PURE__ */ On(k), w = /* @__PURE__ */ a("ZodType", (e, n) => (y.init(e, n), Object.assign(e["~standard"], {
1787
1767
  jsonSchema: {
1788
1768
  input: J(e, "input"),
1789
1769
  output: J(e, "output")
1790
1770
  }
1791
- }), e.toJSONSchema = nr(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(at(t, {
1771
+ }), e.toJSONSchema = tr(e, {}), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(ln(n, {
1792
1772
  checks: [
1793
- ...t.checks ?? [],
1794
- ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
1773
+ ...n.checks ?? [],
1774
+ ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
1795
1775
  ]
1796
1776
  }), {
1797
1777
  parent: !0
1798
- }), e.with = e.check, e.clone = (n, r) => Pe(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Or(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Er(e, n, r), e.parseAsync = async (n, r) => Sr(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Tr(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Pr(e, n, r), e.decode = (n, r) => Ar(e, n, r), e.encodeAsync = async (n, r) => Nr(e, n, r), e.decodeAsync = async (n, r) => Ir(e, n, r), e.safeEncode = (n, r) => jr(e, n, r), e.safeDecode = (n, r) => Cr(e, n, r), e.safeEncodeAsync = async (n, r) => Rr(e, n, r), e.safeDecodeAsync = async (n, r) => Mr(e, n, r), e.refine = (n, r) => e.check(uo(n, r)), e.superRefine = (n) => e.check(fo(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ j(n)), e.optional = () => Ze(e), e.exactOptional = () => Kr(e), e.nullable = () => ke(e), e.nullish = () => Ze(ke(e)), e.nonoptional = (n) => no(e, n), e.array = () => Lr(e), e.or = (n) => Jr([e, n]), e.and = (n) => Vr(e, n), e.transform = (n) => Oe(e, Br(n)), e.default = (n) => Hr(e, n), e.prefault = (n) => eo(e, n), e.catch = (n) => oo(e, n), e.pipe = (n) => Oe(e, n), e.readonly = () => co(e), e.describe = (n) => {
1778
+ }), e.with = e.check, e.clone = (t, r) => Me(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => Or(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Er(e, t, r), e.parseAsync = async (t, r) => Sr(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => Tr(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => Pr(e, t, r), e.decode = (t, r) => Ar(e, t, r), e.encodeAsync = async (t, r) => Ir(e, t, r), e.decodeAsync = async (t, r) => Nr(e, t, r), e.safeEncode = (t, r) => Mr(e, t, r), e.safeDecode = (t, r) => Cr(e, t, r), e.safeEncodeAsync = async (t, r) => Rr(e, t, r), e.safeDecodeAsync = async (t, r) => jr(e, t, r), e.refine = (t, r) => e.check(uo(t, r)), e.superRefine = (t) => e.check(fo(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ N(t)), e.optional = () => be(e), e.exactOptional = () => Kr(e), e.nullable = () => we(e), e.nullish = () => be(we(e)), e.nonoptional = (t) => to(e, t), e.array = () => xr(e), e.or = (t) => Jr([e, t]), e.and = (t) => Vr(e, t), e.transform = (t) => $e(e, qr(t)), e.default = (t) => Hr(e, t), e.prefault = (t) => eo(e, t), e.catch = (t) => oo(e, t), e.pipe = (t) => $e(e, t), e.readonly = () => co(e), e.describe = (t) => {
1799
1779
  const r = e.clone();
1800
- return M.add(r, { description: n }), r;
1780
+ return R.add(r, { description: t }), r;
1801
1781
  }, Object.defineProperty(e, "description", {
1802
1782
  get() {
1803
- return M.get(e)?.description;
1783
+ return R.get(e)?.description;
1804
1784
  },
1805
1785
  configurable: !0
1806
- }), e.meta = (...n) => {
1807
- if (n.length === 0)
1808
- return M.get(e);
1786
+ }), e.meta = (...t) => {
1787
+ if (t.length === 0)
1788
+ return R.get(e);
1809
1789
  const r = e.clone();
1810
- return M.add(r, n[0]), r;
1811
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), Fr = /* @__PURE__ */ a("_ZodString", (e, t) => {
1812
- ie.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, s) => or(e, r, o);
1813
- const n = e._zod.bag;
1814
- e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ xe(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ Wn(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ Bn(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ Gn(...r)), e.min = (...r) => e.check(/* @__PURE__ */ D(...r)), e.max = (...r) => e.check(/* @__PURE__ */ ce(...r)), e.length = (...r) => e.check(/* @__PURE__ */ Le(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ D(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ Un(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ Vn(r)), e.trim = () => e.check(/* @__PURE__ */ Kn()), e.normalize = (...r) => e.check(/* @__PURE__ */ qn(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Yn()), e.toUpperCase = () => e.check(/* @__PURE__ */ Xn()), e.slugify = () => e.check(/* @__PURE__ */ Hn());
1815
- }), K = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
1816
- w.init(e, t), Fr.init(e, t);
1817
- }), Dr = /* @__PURE__ */ a("ZodArray", (e, t) => {
1818
- dn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => cr(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ D(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ D(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ ce(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ Le(n, r)), e.unwrap = () => e.element;
1790
+ return R.add(r, t[0]), r;
1791
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)), Fr = /* @__PURE__ */ a("_ZodString", (e, n) => {
1792
+ ce.init(e, n), w.init(e, n), e._zod.processJSONSchema = (r, o, s) => or(e, r, o);
1793
+ const t = e._zod.bag;
1794
+ e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ qe(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ Wt(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ qt(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ Bt(...r)), e.min = (...r) => e.check(/* @__PURE__ */ I(...r)), e.max = (...r) => e.check(/* @__PURE__ */ K(...r)), e.length = (...r) => e.check(/* @__PURE__ */ We(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ I(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ Ut(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ Vt(r)), e.trim = () => e.check(/* @__PURE__ */ Kt()), e.normalize = (...r) => e.check(/* @__PURE__ */ Gt(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Yt()), e.toUpperCase = () => e.check(/* @__PURE__ */ Xt()), e.slugify = () => e.check(/* @__PURE__ */ Ht());
1795
+ }), Y = /* @__PURE__ */ a("ZodStringFormat", (e, n) => {
1796
+ Z.init(e, n), Fr.init(e, n);
1797
+ }), Dr = /* @__PURE__ */ a("ZodArray", (e, n) => {
1798
+ Ue.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => cr(e, t, r, o), e.element = n.element, e.min = (t, r) => e.check(/* @__PURE__ */ I(t, r)), e.nonempty = (t) => e.check(/* @__PURE__ */ I(1, t)), e.max = (t, r) => e.check(/* @__PURE__ */ K(t, r)), e.length = (t, r) => e.check(/* @__PURE__ */ We(t, r)), e.unwrap = () => e.element;
1819
1799
  });
1820
- function Lr(e, t) {
1821
- return /* @__PURE__ */ Qn(Dr, e, t);
1800
+ function xr(e, n) {
1801
+ return /* @__PURE__ */ Qt(Dr, e, n);
1822
1802
  }
1823
- const xr = /* @__PURE__ */ a("ZodUnion", (e, t) => {
1824
- pn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ar(e, n, r, o), e.options = t.options;
1803
+ const Lr = /* @__PURE__ */ a("ZodUnion", (e, n) => {
1804
+ pt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => ar(e, t, r, o), e.options = n.options;
1825
1805
  });
1826
- function Jr(e, t) {
1827
- return new xr({
1806
+ function Jr(e, n) {
1807
+ return new Lr({
1828
1808
  type: "union",
1829
1809
  options: e,
1830
- ...d(t)
1810
+ ...m(n)
1831
1811
  });
1832
1812
  }
1833
- const Ur = /* @__PURE__ */ a("ZodIntersection", (e, t) => {
1834
- mn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ur(e, n, r, o);
1813
+ const Ur = /* @__PURE__ */ a("ZodIntersection", (e, n) => {
1814
+ ht.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => ur(e, t, r, o);
1835
1815
  });
1836
- function Vr(e, t) {
1816
+ function Vr(e, n) {
1837
1817
  return new Ur({
1838
1818
  type: "intersection",
1839
1819
  left: e,
1840
- right: t
1820
+ right: n
1841
1821
  });
1842
1822
  }
1843
- const Wr = /* @__PURE__ */ a("ZodTransform", (e, t) => {
1844
- hn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => sr(e, n), e._zod.parse = (n, r) => {
1823
+ const Wr = /* @__PURE__ */ a("ZodTransform", (e, n) => {
1824
+ gt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => sr(e, t), e._zod.parse = (t, r) => {
1845
1825
  if (r.direction === "backward")
1846
- throw new ee(e.constructor.name);
1847
- n.addIssue = (s) => {
1826
+ throw new Ae(e.constructor.name);
1827
+ t.addIssue = (s) => {
1848
1828
  if (typeof s == "string")
1849
- n.issues.push(F(s, n.value, t));
1829
+ t.issues.push(j(s, t.value, n));
1850
1830
  else {
1851
1831
  const i = s;
1852
- i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(F(i));
1832
+ i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = t.value), i.inst ?? (i.inst = e), t.issues.push(j(i));
1853
1833
  }
1854
1834
  };
1855
- const o = t.transform(n.value, n);
1856
- return o instanceof Promise ? o.then((s) => (n.value = s, n)) : (n.value = o, n);
1835
+ const o = n.transform(t.value, t);
1836
+ return o instanceof Promise ? o.then((s) => (t.value = s, t)) : (t.value = o, t);
1857
1837
  };
1858
1838
  });
1859
- function Br(e) {
1839
+ function qr(e) {
1860
1840
  return new Wr({
1861
1841
  type: "transform",
1862
1842
  transform: e
1863
1843
  });
1864
1844
  }
1865
- const Gr = /* @__PURE__ */ a("ZodOptional", (e, t) => {
1866
- se.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ge(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
1845
+ const Br = /* @__PURE__ */ a("ZodOptional", (e, n) => {
1846
+ ae.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => He(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1867
1847
  });
1868
- function Ze(e) {
1869
- return new Gr({
1848
+ function be(e) {
1849
+ return new Br({
1870
1850
  type: "optional",
1871
1851
  innerType: e
1872
1852
  });
1873
1853
  }
1874
- const qr = /* @__PURE__ */ a("ZodExactOptional", (e, t) => {
1875
- gn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ge(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
1854
+ const Gr = /* @__PURE__ */ a("ZodExactOptional", (e, n) => {
1855
+ _t.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => He(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1876
1856
  });
1877
1857
  function Kr(e) {
1878
- return new qr({
1858
+ return new Gr({
1879
1859
  type: "optional",
1880
1860
  innerType: e
1881
1861
  });
1882
1862
  }
1883
- const Yr = /* @__PURE__ */ a("ZodNullable", (e, t) => {
1884
- _n.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => fr(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
1863
+ const Yr = /* @__PURE__ */ a("ZodNullable", (e, n) => {
1864
+ yt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => fr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1885
1865
  });
1886
- function ke(e) {
1866
+ function we(e) {
1887
1867
  return new Yr({
1888
1868
  type: "nullable",
1889
1869
  innerType: e
1890
1870
  });
1891
1871
  }
1892
- const Xr = /* @__PURE__ */ a("ZodDefault", (e, t) => {
1893
- yn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => dr(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
1872
+ const Xr = /* @__PURE__ */ a("ZodDefault", (e, n) => {
1873
+ vt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => mr(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
1894
1874
  });
1895
- function Hr(e, t) {
1875
+ function Hr(e, n) {
1896
1876
  return new Xr({
1897
1877
  type: "default",
1898
1878
  innerType: e,
1899
1879
  get defaultValue() {
1900
- return typeof t == "function" ? t() : Te(t);
1880
+ return typeof n == "function" ? n() : Ne(n);
1901
1881
  }
1902
1882
  });
1903
1883
  }
1904
- const Qr = /* @__PURE__ */ a("ZodPrefault", (e, t) => {
1905
- vn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => pr(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
1884
+ const Qr = /* @__PURE__ */ a("ZodPrefault", (e, n) => {
1885
+ zt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => dr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1906
1886
  });
1907
- function eo(e, t) {
1887
+ function eo(e, n) {
1908
1888
  return new Qr({
1909
1889
  type: "prefault",
1910
1890
  innerType: e,
1911
1891
  get defaultValue() {
1912
- return typeof t == "function" ? t() : Te(t);
1892
+ return typeof n == "function" ? n() : Ne(n);
1913
1893
  }
1914
1894
  });
1915
1895
  }
1916
- const to = /* @__PURE__ */ a("ZodNonOptional", (e, t) => {
1917
- zn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => lr(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
1896
+ const no = /* @__PURE__ */ a("ZodNonOptional", (e, n) => {
1897
+ bt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => lr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1918
1898
  });
1919
- function no(e, t) {
1920
- return new to({
1899
+ function to(e, n) {
1900
+ return new no({
1921
1901
  type: "nonoptional",
1922
1902
  innerType: e,
1923
- ...d(t)
1903
+ ...m(n)
1924
1904
  });
1925
1905
  }
1926
- const ro = /* @__PURE__ */ a("ZodCatch", (e, t) => {
1927
- wn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => mr(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
1906
+ const ro = /* @__PURE__ */ a("ZodCatch", (e, n) => {
1907
+ wt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => pr(e, t, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
1928
1908
  });
1929
- function oo(e, t) {
1909
+ function oo(e, n) {
1930
1910
  return new ro({
1931
1911
  type: "catch",
1932
1912
  innerType: e,
1933
- catchValue: typeof t == "function" ? t : () => t
1913
+ catchValue: typeof n == "function" ? n : () => n
1934
1914
  });
1935
1915
  }
1936
- const io = /* @__PURE__ */ a("ZodPipe", (e, t) => {
1937
- $n.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => hr(e, n, r, o), e.in = t.in, e.out = t.out;
1916
+ const io = /* @__PURE__ */ a("ZodPipe", (e, n) => {
1917
+ $t.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => hr(e, t, r, o), e.in = n.in, e.out = n.out;
1938
1918
  });
1939
- function Oe(e, t) {
1919
+ function $e(e, n) {
1940
1920
  return new io({
1941
1921
  type: "pipe",
1942
1922
  in: e,
1943
- out: t
1923
+ out: n
1944
1924
  // ...util.normalizeParams(params),
1945
1925
  });
1946
1926
  }
1947
- const so = /* @__PURE__ */ a("ZodReadonly", (e, t) => {
1948
- Zn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => gr(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
1927
+ const so = /* @__PURE__ */ a("ZodReadonly", (e, n) => {
1928
+ Zt.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => gr(e, t, r, o), e.unwrap = () => e._zod.def.innerType;
1949
1929
  });
1950
1930
  function co(e) {
1951
1931
  return new so({
@@ -1953,302 +1933,395 @@ function co(e) {
1953
1933
  innerType: e
1954
1934
  });
1955
1935
  }
1956
- const ao = /* @__PURE__ */ a("ZodCustom", (e, t) => {
1957
- De.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ir(e, n);
1936
+ const ao = /* @__PURE__ */ a("ZodCustom", (e, n) => {
1937
+ Ve.init(e, n), w.init(e, n), e._zod.processJSONSchema = (t, r, o) => ir(e, t);
1958
1938
  });
1959
- function uo(e, t = {}) {
1960
- return /* @__PURE__ */ Je(ao, e, t);
1939
+ function uo(e, n = {}) {
1940
+ return /* @__PURE__ */ Be(ao, e, n);
1961
1941
  }
1962
1942
  function fo(e) {
1963
- return /* @__PURE__ */ Ue(e);
1943
+ return /* @__PURE__ */ Ge(e);
1964
1944
  }
1965
- const A = /* @__PURE__ */ a("ZodMiniType", (e, t) => {
1945
+ const T = /* @__PURE__ */ a("ZodMiniType", (e, n) => {
1966
1946
  if (!e._zod)
1967
1947
  throw new Error("Uninitialized schema in ZodMiniType.");
1968
- _.init(e, t), e.def = t, e.type = t.type, e.parse = (n, r) => mt(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Ie(e, n, r), e.parseAsync = async (n, r) => ht(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => je(e, n, r), e.check = (...n) => e.clone({
1969
- ...t,
1948
+ y.init(e, n), e.def = n, e.type = n.type, e.parse = (t, r) => _n(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => je(e, t, r), e.parseAsync = async (t, r) => yn(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => Fe(e, t, r), e.check = (...t) => e.clone({
1949
+ ...n,
1970
1950
  checks: [
1971
- ...t.checks ?? [],
1972
- ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
1951
+ ...n.checks ?? [],
1952
+ ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
1973
1953
  ]
1974
- }, { parent: !0 }), e.with = e.check, e.clone = (n, r) => Pe(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.apply = (n) => n(e);
1975
- }), qe = /* @__PURE__ */ a("ZodMiniString", (e, t) => {
1976
- ie.init(e, t), A.init(e, t);
1954
+ }, { parent: !0 }), e.with = e.check, e.clone = (t, r) => Me(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.apply = (t) => t(e);
1955
+ }), Qe = /* @__PURE__ */ a("ZodMiniString", (e, n) => {
1956
+ ce.init(e, n), T.init(e, n);
1977
1957
  });
1978
1958
  // @__NO_SIDE_EFFECTS__
1979
- function lo(e) {
1980
- return /* @__PURE__ */ Sn(qe, e);
1959
+ function Ze(e) {
1960
+ return /* @__PURE__ */ St(Qe, e);
1981
1961
  }
1982
- const C = /* @__PURE__ */ a("ZodMiniStringFormat", (e, t) => {
1983
- w.init(e, t), qe.init(e, t);
1984
- }), po = /* @__PURE__ */ a("ZodMiniEmail", (e, t) => {
1985
- Qt.init(e, t), C.init(e, t);
1962
+ const M = /* @__PURE__ */ a("ZodMiniStringFormat", (e, n) => {
1963
+ Z.init(e, n), Qe.init(e, n);
1964
+ }), lo = /* @__PURE__ */ a("ZodMiniEmail", (e, n) => {
1965
+ tt.init(e, n), M.init(e, n);
1986
1966
  });
1987
1967
  // @__NO_SIDE_EFFECTS__
1988
1968
  function mo(e) {
1989
- return /* @__PURE__ */ En(po, e);
1969
+ return /* @__PURE__ */ Et(lo, e);
1990
1970
  }
1991
- const ho = /* @__PURE__ */ a("ZodMiniUUID", (e, t) => {
1992
- Ht.init(e, t), C.init(e, t);
1971
+ const po = /* @__PURE__ */ a("ZodMiniUUID", (e, n) => {
1972
+ nt.init(e, n), M.init(e, n);
1993
1973
  });
1994
1974
  // @__NO_SIDE_EFFECTS__
1995
- function go(e) {
1996
- return /* @__PURE__ */ Tn(ho, e);
1975
+ function ho(e) {
1976
+ return /* @__PURE__ */ Tt(po, e);
1997
1977
  }
1998
- const _o = /* @__PURE__ */ a("ZodMiniURL", (e, t) => {
1999
- en.init(e, t), C.init(e, t);
1978
+ const go = /* @__PURE__ */ a("ZodMiniURL", (e, n) => {
1979
+ rt.init(e, n), M.init(e, n);
2000
1980
  });
2001
1981
  // @__NO_SIDE_EFFECTS__
2002
- function yo(e) {
2003
- return /* @__PURE__ */ Pn(_o, e);
1982
+ function _o(e) {
1983
+ return /* @__PURE__ */ Pt(go, e);
2004
1984
  }
2005
- const vo = /* @__PURE__ */ a("ZodMiniIPv4", (e, t) => {
2006
- sn.init(e, t), C.init(e, t);
1985
+ const yo = /* @__PURE__ */ a("ZodMiniIPv4", (e, n) => {
1986
+ at.init(e, n), M.init(e, n);
2007
1987
  });
2008
1988
  // @__NO_SIDE_EFFECTS__
2009
- function zo(e) {
2010
- return /* @__PURE__ */ An(vo, e);
1989
+ function vo(e) {
1990
+ return /* @__PURE__ */ At(yo, e);
2011
1991
  }
2012
- const bo = /* @__PURE__ */ a("ZodMiniIPv6", (e, t) => {
2013
- cn.init(e, t), C.init(e, t);
1992
+ const zo = /* @__PURE__ */ a("ZodMiniIPv6", (e, n) => {
1993
+ ut.init(e, n), M.init(e, n);
2014
1994
  });
2015
1995
  // @__NO_SIDE_EFFECTS__
2016
- function wo(e) {
2017
- return /* @__PURE__ */ Nn(bo, e);
1996
+ function bo(e) {
1997
+ return /* @__PURE__ */ It(zo, e);
2018
1998
  }
2019
- const $o = /* @__PURE__ */ a("ZodMiniCustomStringFormat", (e, t) => {
2020
- an.init(e, t), C.init(e, t);
1999
+ const wo = /* @__PURE__ */ a("ZodMiniCustomStringFormat", (e, n) => {
2000
+ ft.init(e, n), M.init(e, n);
2021
2001
  });
2022
2002
  // @__NO_SIDE_EFFECTS__
2023
- function Zo(e) {
2024
- return /* @__PURE__ */ tr($o, "hostname", Et, e);
2003
+ function $o(e) {
2004
+ return /* @__PURE__ */ nr(wo, "hostname", An, e);
2025
2005
  }
2026
- const Ke = /* @__PURE__ */ a("ZodMiniNumber", (e, t) => {
2027
- Fe.init(e, t), A.init(e, t);
2006
+ const en = /* @__PURE__ */ a("ZodMiniNumber", (e, n) => {
2007
+ Je.init(e, n), T.init(e, n);
2028
2008
  });
2029
2009
  // @__NO_SIDE_EFFECTS__
2030
- function ko(e) {
2031
- return /* @__PURE__ */ Mn(Ke, e);
2010
+ function ke(e) {
2011
+ return /* @__PURE__ */ jt(en, e);
2032
2012
  }
2033
- const Oo = /* @__PURE__ */ a("ZodMiniNumberFormat", (e, t) => {
2034
- un.init(e, t), Ke.init(e, t);
2013
+ const Zo = /* @__PURE__ */ a("ZodMiniNumberFormat", (e, n) => {
2014
+ lt.init(e, n), en.init(e, n);
2035
2015
  });
2036
2016
  // @__NO_SIDE_EFFECTS__
2037
- function So(e) {
2038
- return /* @__PURE__ */ Fn(Oo, e);
2017
+ function ko(e) {
2018
+ return /* @__PURE__ */ Ft(Zo, e);
2039
2019
  }
2040
- const Eo = /* @__PURE__ */ a("ZodMiniBoolean", (e, t) => {
2041
- fn.init(e, t), A.init(e, t);
2020
+ const Oo = /* @__PURE__ */ a("ZodMiniBoolean", (e, n) => {
2021
+ mt.init(e, n), T.init(e, n);
2042
2022
  });
2043
2023
  // @__NO_SIDE_EFFECTS__
2044
- function To(e) {
2045
- return /* @__PURE__ */ Dn(Eo, e);
2024
+ function Oe(e) {
2025
+ return /* @__PURE__ */ Dt(Oo, e);
2046
2026
  }
2047
- const Po = /* @__PURE__ */ a("ZodMiniAny", (e, t) => {
2048
- ln.init(e, t), A.init(e, t);
2027
+ const So = /* @__PURE__ */ a("ZodMiniAny", (e, n) => {
2028
+ dt.init(e, n), T.init(e, n);
2049
2029
  });
2050
2030
  // @__NO_SIDE_EFFECTS__
2051
- function Ye() {
2052
- return /* @__PURE__ */ Ln(Po);
2031
+ function ne() {
2032
+ return /* @__PURE__ */ xt(So);
2053
2033
  }
2054
- const Ao = /* @__PURE__ */ a("ZodMiniOptional", (e, t) => {
2055
- se.init(e, t), A.init(e, t);
2034
+ const Eo = /* @__PURE__ */ a("ZodMiniArray", (e, n) => {
2035
+ Ue.init(e, n), T.init(e, n);
2056
2036
  });
2057
2037
  // @__NO_SIDE_EFFECTS__
2058
- function No(e) {
2059
- return new Ao({
2060
- type: "optional",
2061
- innerType: e
2038
+ function Se(e, n) {
2039
+ return new Eo({
2040
+ type: "array",
2041
+ element: e,
2042
+ ...m(n)
2062
2043
  });
2063
2044
  }
2064
- const Io = /* @__PURE__ */ a("ZodMiniSuccess", (e, t) => {
2065
- bn.init(e, t), A.init(e, t);
2045
+ const To = /* @__PURE__ */ a("ZodMiniOptional", (e, n) => {
2046
+ ae.init(e, n), T.init(e, n);
2066
2047
  });
2067
2048
  // @__NO_SIDE_EFFECTS__
2068
- function jo(e) {
2069
- return new Io({
2070
- type: "success",
2049
+ function Po(e) {
2050
+ return new To({
2051
+ type: "optional",
2071
2052
  innerType: e
2072
2053
  });
2073
2054
  }
2074
- const Co = /* @__PURE__ */ a("ZodMiniCustom", (e, t) => {
2075
- De.init(e, t), A.init(e, t);
2055
+ const Ao = /* @__PURE__ */ a("ZodMiniCustom", (e, n) => {
2056
+ Ve.init(e, n), T.init(e, n);
2076
2057
  });
2077
2058
  // @__NO_SIDE_EFFECTS__
2078
- function O(e, t = {}) {
2079
- return /* @__PURE__ */ Je(Co, e, t);
2059
+ function v(e, n = {}) {
2060
+ return /* @__PURE__ */ Be(Ao, e, n);
2080
2061
  }
2081
2062
  // @__NO_SIDE_EFFECTS__
2082
- function Ro(e) {
2083
- return /* @__PURE__ */ Ue(e);
2063
+ function nn(e) {
2064
+ return /* @__PURE__ */ Ge(e);
2084
2065
  }
2085
- const Xe = {
2066
+ const te = {
2086
2067
  email: { schema: /* @__PURE__ */ mo() },
2087
- hostname: { schema: /* @__PURE__ */ Zo() },
2088
- ipv4: { schema: /* @__PURE__ */ zo() },
2089
- ipv6: { schema: /* @__PURE__ */ wo() },
2090
- url: { schema: /* @__PURE__ */ yo() },
2091
- uuid: { schema: /* @__PURE__ */ go() },
2068
+ hostname: { schema: /* @__PURE__ */ $o() },
2069
+ ipv4: { schema: /* @__PURE__ */ vo() },
2070
+ ipv6: { schema: /* @__PURE__ */ bo() },
2071
+ url: { schema: /* @__PURE__ */ _o() },
2072
+ uuid: { schema: /* @__PURE__ */ ho() },
2092
2073
  date: { schema: zr() },
2093
2074
  time: { schema: wr() },
2094
2075
  "date-time": { schema: yr() },
2095
2076
  duration: { schema: Zr() }
2096
- }, Mo = Object.keys(Xe), Se = (e) => (t) => {
2097
- switch (t.type) {
2077
+ }, Io = Object.keys(te), No = (e) => (n, t) => {
2078
+ switch (n.type) {
2098
2079
  case "string":
2099
- return Fo(t);
2080
+ return Mo(n, t);
2100
2081
  case "integer":
2101
2082
  case "number":
2102
- return Do(t);
2083
+ return Ro(n, t);
2103
2084
  case "boolean":
2104
- return Lo(t);
2085
+ return jo(n, t);
2105
2086
  case "array":
2106
- return console.warn("TODO: array validator not yet supported"), /* @__PURE__ */ jo(/* @__PURE__ */ Ye());
2087
+ return Fo(n, t);
2107
2088
  case "custom": {
2108
2089
  if (!e)
2109
2090
  throw new Error(
2110
2091
  'Validator type "custom" requires a customValidators object, but it was not supplied.'
2111
2092
  );
2112
- return xo(t, e);
2093
+ return Do(n, e);
2113
2094
  }
2114
2095
  }
2115
2096
  };
2116
- function Fo(e) {
2117
- return Y(e, (t) => {
2118
- let n = /* @__PURE__ */ lo();
2119
- if (t.required === !0 && (n = n.check(/* @__PURE__ */ O((r) => r.length > 0, { error: "This field is required" }))), typeof t.minLength == "number" && (n = n.check(/* @__PURE__ */ D(t.minLength))), typeof t.maxLength == "number" && (n = n.check(/* @__PURE__ */ ce(t.maxLength))), typeof t.pattern == "string" && (n = n.check(/* @__PURE__ */ xe(new RegExp(t.pattern)))), t.enum) {
2120
- const r = t.enum;
2121
- n = n.check(/* @__PURE__ */ O((o) => r.includes(o)));
2097
+ function _(e, n) {
2098
+ if (e !== void 0)
2099
+ return typeof e == "string" ? e : n?.translate(e.key, e.params, e.default) ?? e.default;
2100
+ }
2101
+ function Mo(e, n) {
2102
+ return D(e, (t) => {
2103
+ const r = _(t.messages?.invalid, n);
2104
+ let o = r ? /* @__PURE__ */ Ze(r) : /* @__PURE__ */ Ze();
2105
+ if (t.required === !0) {
2106
+ const s = _(t.messages?.required, n) ?? "This field is required";
2107
+ o = o.check(/* @__PURE__ */ v((i) => i.length > 0, { error: s }));
2122
2108
  }
2123
- return t.const !== void 0 && (n = n.check(/* @__PURE__ */ O((r) => r === t.const))), t.format !== void 0 && (Mo.includes(t.format) ? n = n.check(Xe[t.format].schema) : console.error(`The string validation format "${t.format}" is not supported`)), n;
2109
+ if (typeof t.minLength == "number") {
2110
+ const s = _(t.messages?.minLength, n), i = t.minLength;
2111
+ o = o.check(
2112
+ s ? /* @__PURE__ */ v((c) => c.length >= i, { error: s }) : /* @__PURE__ */ I(i)
2113
+ );
2114
+ }
2115
+ if (typeof t.maxLength == "number") {
2116
+ const s = _(t.messages?.maxLength, n), i = t.maxLength;
2117
+ o = o.check(
2118
+ s ? /* @__PURE__ */ v((c) => c.length <= i, { error: s }) : /* @__PURE__ */ K(i)
2119
+ );
2120
+ }
2121
+ if (typeof t.pattern == "string") {
2122
+ const s = _(t.messages?.pattern, n), i = new RegExp(t.pattern);
2123
+ o = o.check(
2124
+ s ? /* @__PURE__ */ v((c) => i.test(c), { error: s }) : /* @__PURE__ */ qe(i)
2125
+ );
2126
+ }
2127
+ if (t.enum) {
2128
+ const s = t.enum, i = _(t.messages?.enum, n);
2129
+ o = o.check(/* @__PURE__ */ v((c) => s.includes(c), i ? { error: i } : void 0));
2130
+ }
2131
+ if (t.const !== void 0) {
2132
+ const s = _(t.messages?.const, n);
2133
+ o = o.check(/* @__PURE__ */ v((i) => i === t.const, s ? { error: s } : void 0));
2134
+ }
2135
+ if (t.format !== void 0)
2136
+ if (Io.includes(t.format)) {
2137
+ const s = _(t.messages?.format, n);
2138
+ o = o.check(
2139
+ s ? /* @__PURE__ */ nn((i, c) => {
2140
+ const u = Ee(
2141
+ te[t.format].schema,
2142
+ i
2143
+ );
2144
+ Te(u) || c.addIssue({ code: "custom", path: [], message: s });
2145
+ }) : te[t.format].schema
2146
+ );
2147
+ } else
2148
+ console.error(`The string validation format "${t.format}" is not supported`);
2149
+ return o;
2124
2150
  });
2125
2151
  }
2126
- function Do(e) {
2127
- return Y(e, (t) => {
2128
- let n = /* @__PURE__ */ ko();
2129
- if (t.type === "integer" && (n = n.check(/* @__PURE__ */ So())), t.minimum !== void 0 && (n = n.check(/* @__PURE__ */ Jn(t.minimum))), t.maximum !== void 0 && (n = n.check(/* @__PURE__ */ xn(t.maximum))), t.exclusiveMinimum !== void 0) {
2130
- const r = t.exclusiveMinimum;
2131
- n = n.check(/* @__PURE__ */ O((o) => o > r));
2152
+ const Co = (e, n) => {
2153
+ if (n === 0)
2154
+ return !1;
2155
+ const t = e / n;
2156
+ return Math.abs(t - Math.round(t)) < 1e-10;
2157
+ };
2158
+ function Ro(e, n) {
2159
+ return D(e, (t) => {
2160
+ const r = _(t.messages?.invalid, n);
2161
+ let o = r ? /* @__PURE__ */ ke(r) : /* @__PURE__ */ ke();
2162
+ if (t.type === "integer" && (o = o.check(/* @__PURE__ */ ko())), t.minimum !== void 0) {
2163
+ const s = _(t.messages?.minimum, n), i = t.minimum;
2164
+ o = o.check(s ? /* @__PURE__ */ v((c) => c >= i, { error: s }) : /* @__PURE__ */ Jt(i));
2165
+ }
2166
+ if (t.maximum !== void 0) {
2167
+ const s = _(t.messages?.maximum, n), i = t.maximum;
2168
+ o = o.check(s ? /* @__PURE__ */ v((c) => c <= i, { error: s }) : /* @__PURE__ */ Lt(i));
2169
+ }
2170
+ if (t.exclusiveMinimum !== void 0) {
2171
+ const s = _(t.messages?.exclusiveMinimum, n), i = t.exclusiveMinimum;
2172
+ o = o.check(/* @__PURE__ */ v((c) => c > i, s ? { error: s } : void 0));
2132
2173
  }
2133
2174
  if (t.exclusiveMaximum !== void 0) {
2134
- const r = t.exclusiveMaximum;
2135
- n = n.check(/* @__PURE__ */ O((o) => o < r));
2175
+ const s = _(t.messages?.exclusiveMaximum, n), i = t.exclusiveMaximum;
2176
+ o = o.check(/* @__PURE__ */ v((c) => c < i, s ? { error: s } : void 0));
2136
2177
  }
2137
2178
  if (t.multipleOf !== void 0) {
2138
- const r = t.multipleOf;
2139
- n = n.check(/* @__PURE__ */ O((o) => o % r === 0));
2179
+ const s = _(t.messages?.multipleOf, n), i = t.multipleOf;
2180
+ o = o.check(
2181
+ /* @__PURE__ */ v((c) => Co(c, i), s ? { error: s } : void 0)
2182
+ );
2140
2183
  }
2141
2184
  if (t.enum) {
2142
- const r = t.enum;
2143
- n = n.check(/* @__PURE__ */ O((o) => r.includes(o)));
2185
+ const s = t.enum, i = _(t.messages?.enum, n);
2186
+ o = o.check(/* @__PURE__ */ v((c) => s.includes(c), i ? { error: i } : void 0));
2144
2187
  }
2145
- return t.const !== void 0 && (n = n.check(/* @__PURE__ */ O((r) => r === t.const))), n;
2188
+ if (t.const !== void 0) {
2189
+ const s = _(t.messages?.const, n);
2190
+ o = o.check(/* @__PURE__ */ v((i) => i === t.const, s ? { error: s } : void 0));
2191
+ }
2192
+ return o;
2146
2193
  });
2147
2194
  }
2148
- function Lo(e) {
2149
- return Y(e, (t) => {
2150
- let n = /* @__PURE__ */ To();
2151
- return t.const !== void 0 && (n = n.check(/* @__PURE__ */ O((r) => r === t.const))), n;
2195
+ function jo(e, n) {
2196
+ return D(e, (t) => {
2197
+ const r = _(t.messages?.invalid, n);
2198
+ let o = r ? /* @__PURE__ */ Oe(r) : /* @__PURE__ */ Oe();
2199
+ if (t.const !== void 0) {
2200
+ const s = _(t.messages?.const, n);
2201
+ o = o.check(/* @__PURE__ */ v((i) => i === t.const, s ? { error: s } : void 0));
2202
+ }
2203
+ return o;
2152
2204
  });
2153
2205
  }
2154
- function xo(e, t) {
2155
- return Y(e, (n) => {
2156
- let r = /* @__PURE__ */ Ye();
2157
- return Object.keys(n).filter((o) => o !== "type" && o !== "required").forEach((o) => {
2158
- const s = n[o], i = t[o], c = i(s);
2159
- r = r.check(
2160
- /* @__PURE__ */ Ro((u, f) => {
2161
- const l = He(
2162
- c,
2163
- u
2164
- );
2165
- if (!Qe(l)) {
2166
- const m = l.issues[0];
2167
- f.addIssue({
2168
- code: "custom",
2169
- path: [],
2170
- message: m?.message || `Validation failed for ${o}`
2171
- });
2172
- }
2173
- })
2206
+ function Fo(e, n) {
2207
+ return D(e, (t) => {
2208
+ const r = _(t.messages?.invalid, n);
2209
+ let o = r ? /* @__PURE__ */ Se(/* @__PURE__ */ ne(), r) : /* @__PURE__ */ Se(/* @__PURE__ */ ne());
2210
+ if (t.required === !0) {
2211
+ const s = _(t.messages?.required, n) ?? "This field is required";
2212
+ o = o.check(/* @__PURE__ */ v((i) => i.length > 0, { error: s }));
2213
+ }
2214
+ if (typeof t.minItems == "number") {
2215
+ const s = _(t.messages?.minItems, n), i = t.minItems;
2216
+ o = o.check(
2217
+ s ? /* @__PURE__ */ v((c) => c.length >= i, { error: s }) : /* @__PURE__ */ I(i)
2218
+ );
2219
+ }
2220
+ if (typeof t.maxItems == "number") {
2221
+ const s = _(t.messages?.maxItems, n), i = t.maxItems;
2222
+ o = o.check(
2223
+ s ? /* @__PURE__ */ v((c) => c.length <= i, { error: s }) : /* @__PURE__ */ K(i)
2174
2224
  );
2175
- }), r;
2225
+ }
2226
+ return o;
2176
2227
  });
2177
2228
  }
2178
- function Y(e, t) {
2179
- const n = t(e);
2180
- return e.required ? n : /* @__PURE__ */ No(n);
2229
+ function Do(e, n) {
2230
+ return D(e, (t) => {
2231
+ let r = /* @__PURE__ */ ne();
2232
+ return rn(
2233
+ Object.keys(t),
2234
+ // filter non-custom validator keys
2235
+ (o) => o !== "type" && o !== "required",
2236
+ (o) => {
2237
+ const s = t[o], i = n[o], c = i(s);
2238
+ r = r.check(
2239
+ /* @__PURE__ */ nn((u, f) => {
2240
+ const l = Ee(
2241
+ c,
2242
+ u
2243
+ );
2244
+ if (!Te(l)) {
2245
+ const p = l.issues[0];
2246
+ f.addIssue({
2247
+ code: "custom",
2248
+ path: [],
2249
+ message: p?.message || `Validation failed for ${o}`
2250
+ });
2251
+ }
2252
+ })
2253
+ );
2254
+ }
2255
+ ), r;
2256
+ });
2257
+ }
2258
+ function D(e, n) {
2259
+ const t = n(e);
2260
+ return e.required ? t : /* @__PURE__ */ Po(t);
2181
2261
  }
2182
- var Jo = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, S = (e, t, n, r) => {
2183
- for (var o = r > 1 ? void 0 : r ? Uo(t, n) : t, s = e.length - 1, i; s >= 0; s--)
2184
- (i = e[s]) && (o = (r ? i(t, n, o) : i(o)) || o);
2185
- return r && o && Jo(t, n, o), o;
2262
+ var xo = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, X = (e, n, t, r) => {
2263
+ for (var o = r > 1 ? void 0 : r ? Lo(n, t) : n, s = e.length - 1, i; s >= 0; s--)
2264
+ (i = e[s]) && (o = (r ? i(n, t, o) : i(o)) || o);
2265
+ return r && o && xo(n, t, o), o;
2186
2266
  };
2187
- let k = class extends et {
2267
+ let F = class extends on {
2188
2268
  constructor() {
2189
- super(...arguments), this.data = {}, this.widgetLoaders = {}, this.itemRenderers = {}, this.validators = {}, this.middlewares = [], this.validateOn = "eager", this.customWidgetLoaders = {
2190
- ...fe,
2191
- ...this.widgetLoaders
2192
- }, this.customValidators = Se({ ...this.validators }), this.customMiddlewares = [
2193
- ae.jsonSchemaMiddleware(ue(le)),
2194
- ...this.middlewares
2195
- ];
2269
+ super(...arguments), this.autocomplete = void 0;
2270
+ }
2271
+ setData(e) {
2272
+ this.coreForm?.setData(e);
2273
+ }
2274
+ setMeta(e) {
2275
+ this.coreForm?.setMeta(e);
2196
2276
  }
2197
2277
  createRenderRoot() {
2198
2278
  return this;
2199
2279
  }
2200
- connectedCallback() {
2201
- super.connectedCallback(), this.customWidgetLoaders = {
2202
- ...fe,
2203
- ...this.widgetLoaders
2204
- }, this.customValidators = Se({ ...this.validators }), this.customMiddlewares = [
2205
- ae.jsonSchemaMiddleware(ue(le)),
2206
- ...this.middlewares
2207
- ];
2208
- }
2209
2280
  render() {
2210
- return tt`
2281
+ const e = this.config, n = tn(e.formDef, e.formSelectors, e.formConfig), t = {
2282
+ formDef: n.formDef,
2283
+ widgetLoaders: {
2284
+ ...un,
2285
+ ...n.widgetLoaders,
2286
+ ...e.customWidgetLoaders ?? {}
2287
+ },
2288
+ dependencies: { ...n.dependencies ?? {}, ...e.dependencies ?? {} },
2289
+ validateOn: e.validateOn ?? n.validateOn ?? "eager",
2290
+ itemRenderers: {
2291
+ ...n.itemRenderers ?? {},
2292
+ ...e.itemRenderers ?? {}
2293
+ },
2294
+ localization: e.localization,
2295
+ middlewares: e.middlewares ?? [],
2296
+ data: e.data,
2297
+ meta: e.meta,
2298
+ formName: e.formName
2299
+ }, r = No({
2300
+ ...e.customValidators ?? {}
2301
+ }), o = n.formEvent, s = o ? (i) => o(i.detail) : void 0;
2302
+ return sn`
2211
2303
  <gui-core-form
2212
- .formDef=${this.formDef}
2213
- .data=${this.data}
2214
- .widgetLoaders=${this.customWidgetLoaders}
2215
- .itemRenderers=${this.itemRenderers}
2216
- .localization=${this.localization}
2217
- .middlewares=${this.customMiddlewares}
2218
- .validators=${this.customValidators}
2219
- .validateOn=${this.validateOn ?? "eager"}
2304
+ .config=${t}
2305
+ .validators=${r}
2306
+ .autocomplete=${this.autocomplete}
2307
+ @formEvent=${s}
2220
2308
  ></gui-core-form>
2221
2309
  `;
2222
2310
  }
2223
2311
  };
2224
- S([
2225
- E({ type: Object })
2226
- ], k.prototype, "formDef", 2);
2227
- S([
2228
- E({ type: Object })
2229
- ], k.prototype, "data", 2);
2230
- S([
2231
- E({ type: Object })
2232
- ], k.prototype, "widgetLoaders", 2);
2233
- S([
2234
- E({ type: Object })
2235
- ], k.prototype, "itemRenderers", 2);
2236
- S([
2237
- E({ type: Object })
2238
- ], k.prototype, "localization", 2);
2239
- S([
2240
- E({ type: Object, attribute: !1 })
2241
- ], k.prototype, "validators", 2);
2242
- S([
2243
- E({ type: Array })
2244
- ], k.prototype, "middlewares", 2);
2245
- S([
2246
- E({ type: String })
2247
- ], k.prototype, "validateOn", 2);
2248
- k = S([
2249
- nt("gui-form")
2250
- ], k);
2312
+ X([
2313
+ Pe({ attribute: !1 })
2314
+ ], F.prototype, "config", 2);
2315
+ X([
2316
+ Pe({ type: String })
2317
+ ], F.prototype, "autocomplete", 2);
2318
+ X([
2319
+ cn("gui-core-form")
2320
+ ], F.prototype, "coreForm", 2);
2321
+ F = X([
2322
+ an("gui-form")
2323
+ ], F);
2251
2324
  export {
2252
- k as FormElement,
2253
- fe as vanillaWidgetLoaders
2325
+ F as FormElement,
2326
+ un as widgetLoaders
2254
2327
  };