@camstack/addon-post-analysis 0.1.19 → 0.2.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 (101) hide show
  1. package/dist/dist-4mTLJ7BJ.mjs +20750 -0
  2. package/dist/dist-CS2K80so.js +20933 -0
  3. package/dist/embedding-encoder/index.js +977 -902
  4. package/dist/embedding-encoder/index.mjs +967 -860
  5. package/dist/enrichment-engine/index.js +834 -833
  6. package/dist/enrichment-engine/index.mjs +828 -832
  7. package/dist/pipeline-analytics/_stub.js +1680 -1397
  8. package/dist/pipeline-analytics/_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-DOSUJ-U0.mjs +156 -0
  9. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DJvmVCso.mjs +26 -0
  10. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-B3Wx5J80.mjs +26 -0
  11. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare__react__loadShare__.js-C0AuF9av.mjs +26 -0
  12. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-Bm-iyjmq.mjs +26 -0
  13. package/dist/pipeline-analytics/dist-CYZr2fwk.mjs +2726 -0
  14. package/dist/pipeline-analytics/hostInit-BazRS2O7.mjs +129 -0
  15. package/dist/pipeline-analytics/index.js +7133 -2558
  16. package/dist/pipeline-analytics/index.mjs +7124 -2557
  17. package/dist/pipeline-analytics/remoteEntry.js +134 -2973
  18. package/dist/pipeline-analytics/remoteEntry.ssr.js +33 -0
  19. package/dist/pipeline-analytics/virtualExposes-BgYzpJZG.mjs +27 -0
  20. package/dist/pipeline-analytics/virtual_mf-exposes-ssr___mfe_internal__addon_pipeline_analytics_widgets__remoteEntry_js-D7qgWCKX.mjs +10 -0
  21. package/dist/resolve-frame-5lMxmeI1.js +57 -0
  22. package/dist/resolve-frame-CT1T1tWy.mjs +44 -0
  23. package/package.json +26 -32
  24. package/dist/embedding-encoder/index.js.map +0 -1
  25. package/dist/embedding-encoder/index.mjs.map +0 -1
  26. package/dist/enrichment-engine/index.js.map +0 -1
  27. package/dist/enrichment-engine/index.mjs.map +0 -1
  28. package/dist/ffmpeg-config-DRONlBsj.mjs +0 -56
  29. package/dist/ffmpeg-config-DRONlBsj.mjs.map +0 -1
  30. package/dist/ffmpeg-config-uANz3sV5.js +0 -73
  31. package/dist/ffmpeg-config-uANz3sV5.js.map +0 -1
  32. package/dist/index-BFbwYH1P.js +0 -14343
  33. package/dist/index-BFbwYH1P.js.map +0 -1
  34. package/dist/index-BrTlzsrE.mjs +0 -14344
  35. package/dist/index-BrTlzsrE.mjs.map +0 -1
  36. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/AudioHistoryChart.d.ts +0 -4
  37. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/AudioMetricsPanel.d.ts +0 -10
  38. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/DetectionHistoryChart.d.ts +0 -4
  39. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/LiveStatsTab.d.ts +0 -5
  40. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/MotionHistoryChart.d.ts +0 -4
  41. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/OccupancyHistoryChart.d.ts +0 -4
  42. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/OccupancyPanel.d.ts +0 -10
  43. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/chart-utils.d.ts +0 -97
  44. package/dist/pipeline-analytics/@mf-types/compiled-types/pipeline-analytics/widgets/index.d.ts +0 -29
  45. package/dist/pipeline-analytics/@mf-types/widgets.d.ts +0 -2
  46. package/dist/pipeline-analytics/@mf-types.d.ts +0 -3
  47. package/dist/pipeline-analytics/@mf-types.zip +0 -0
  48. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-h5aXOPSA.mjs +0 -12
  49. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-NjF4kxzW.mjs +0 -19
  50. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.mjs-7HAAnpQu.mjs +0 -18
  51. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-DoWbefqS.mjs +0 -104
  52. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-52bfkwC8.mjs +0 -85
  53. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-CVrnrGED.mjs +0 -62
  54. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare__react__loadShare__.mjs-BZTB2scQ.mjs +0 -88
  55. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare__react__loadShare__.mjs_commonjs-proxy-CJO5YKGV.mjs +0 -29
  56. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-BsyrX6NO.mjs +0 -36
  57. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare__react_mf_2_dom__loadShare__.mjs-Dp8hqYOB.mjs +0 -45
  58. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-B0h0AGOH.mjs +0 -6
  59. package/dist/pipeline-analytics/__mfe_internal__addon_pipeline_analytics_widgets__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BZjEt71l.mjs +0 -34
  60. package/dist/pipeline-analytics/_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-kZBmgzMg.mjs +0 -156
  61. package/dist/pipeline-analytics/client-BlxIUpgf.mjs +0 -9836
  62. package/dist/pipeline-analytics/getErrorShape-BPSzUA7W-TlK8ipWe.mjs +0 -211
  63. package/dist/pipeline-analytics/hostInit-qBB1Thhi.mjs +0 -168
  64. package/dist/pipeline-analytics/index-BoL0rgZt.mjs +0 -435
  65. package/dist/pipeline-analytics/index-CR1aiZDH.mjs +0 -185
  66. package/dist/pipeline-analytics/index-CWkKuNLr.mjs +0 -232
  67. package/dist/pipeline-analytics/index-DlhiA9R0.mjs +0 -2603
  68. package/dist/pipeline-analytics/index-DtdgkNgf.mjs +0 -725
  69. package/dist/pipeline-analytics/index-Dw6Q30NI.mjs +0 -1655
  70. package/dist/pipeline-analytics/index-Dy2V7VOm.mjs +0 -14379
  71. package/dist/pipeline-analytics/index-i47purqY.mjs +0 -37880
  72. package/dist/pipeline-analytics/index-xncRG7-x.mjs +0 -2713
  73. package/dist/pipeline-analytics/index.js.map +0 -1
  74. package/dist/pipeline-analytics/index.mjs.map +0 -1
  75. package/dist/pipeline-analytics/jsx-runtime-Dlbl3gpr.mjs +0 -55
  76. package/dist/pipeline-analytics/schemas-ClCuS4qa.mjs +0 -3594
  77. package/dist/pipeline-analytics/virtualExposes-8FzWTdq3.mjs +0 -42
  78. package/dist/playlist-generator-EhPaB7Hn.js +0 -48
  79. package/dist/playlist-generator-EhPaB7Hn.js.map +0 -1
  80. package/dist/playlist-generator-VTkgn53O.mjs +0 -48
  81. package/dist/playlist-generator-VTkgn53O.mjs.map +0 -1
  82. package/dist/recording/index.js +0 -257
  83. package/dist/recording/index.js.map +0 -1
  84. package/dist/recording/index.mjs +0 -235
  85. package/dist/recording/index.mjs.map +0 -1
  86. package/dist/recording-coordinator-BoGr5moz.js +0 -1052
  87. package/dist/recording-coordinator-BoGr5moz.js.map +0 -1
  88. package/dist/recording-coordinator-CsYH9LqF.mjs +0 -1012
  89. package/dist/recording-coordinator-CsYH9LqF.mjs.map +0 -1
  90. package/dist/recording-db-gOgaoQh0.js +0 -348
  91. package/dist/recording-db-gOgaoQh0.js.map +0 -1
  92. package/dist/recording-db-lIkSMTLq.mjs +0 -348
  93. package/dist/recording-db-lIkSMTLq.mjs.map +0 -1
  94. package/dist/recording-service-facade-B9lG6OFn.mjs +0 -123
  95. package/dist/recording-service-facade-B9lG6OFn.mjs.map +0 -1
  96. package/dist/recording-service-facade-Do1PKlAL.js +0 -123
  97. package/dist/recording-service-facade-Do1PKlAL.js.map +0 -1
  98. package/dist/storage-estimator-CRpoQc9j.js +0 -72
  99. package/dist/storage-estimator-CRpoQc9j.js.map +0 -1
  100. package/dist/storage-estimator-DzD8gWJH.mjs +0 -72
  101. package/dist/storage-estimator-DzD8gWJH.mjs.map +0 -1
@@ -1,3594 +0,0 @@
1
- var ze;
2
- function l(e, t, n) {
3
- function r(u, c) {
4
- if (u._zod || Object.defineProperty(u, "_zod", {
5
- value: {
6
- def: c,
7
- constr: s,
8
- traits: /* @__PURE__ */ new Set()
9
- },
10
- enumerable: !1
11
- }), u._zod.traits.has(e))
12
- return;
13
- u._zod.traits.add(e), t(u, c);
14
- const a = s.prototype, f = Object.keys(a);
15
- for (let p = 0; p < f.length; p++) {
16
- const m = f[p];
17
- m in u || (u[m] = a[m].bind(u));
18
- }
19
- }
20
- const o = n?.Parent ?? Object;
21
- class i extends o {
22
- }
23
- Object.defineProperty(i, "name", { value: e });
24
- function s(u) {
25
- var c;
26
- const a = n?.Parent ? new i() : this;
27
- r(a, u), (c = a._zod).deferred ?? (c.deferred = []);
28
- for (const f of a._zod.deferred)
29
- f();
30
- return a;
31
- }
32
- return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
33
- value: (u) => n?.Parent && u instanceof n.Parent ? !0 : u?._zod?.traits?.has(e)
34
- }), Object.defineProperty(s, "name", { value: e }), s;
35
- }
36
- class C extends Error {
37
- constructor() {
38
- super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
39
- }
40
- }
41
- class We extends Error {
42
- constructor(t) {
43
- super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
44
- }
45
- }
46
- (ze = globalThis).__zod_globalConfig ?? (ze.__zod_globalConfig = {});
47
- const ae = globalThis.__zod_globalConfig;
48
- function E(e) {
49
- return ae;
50
- }
51
- function Ke(e) {
52
- const t = Object.values(e).filter((r) => typeof r == "number");
53
- return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
54
- }
55
- function se(e, t) {
56
- return typeof t == "bigint" ? t.toString() : t;
57
- }
58
- function ee(e) {
59
- return {
60
- get value() {
61
- {
62
- const t = e();
63
- return Object.defineProperty(this, "value", { value: t }), t;
64
- }
65
- }
66
- };
67
- }
68
- function le(e) {
69
- return e == null;
70
- }
71
- function fe(e) {
72
- const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
73
- return e.slice(t, n);
74
- }
75
- function Ot(e, t) {
76
- const n = e / t, r = Math.round(n), o = Number.EPSILON * Math.max(Math.abs(n), 1);
77
- return Math.abs(n - r) < o ? 0 : n - r;
78
- }
79
- const ye = /* @__PURE__ */ Symbol("evaluating");
80
- function _(e, t, n) {
81
- let r;
82
- Object.defineProperty(e, t, {
83
- get() {
84
- if (r !== ye)
85
- return r === void 0 && (r = ye, r = n()), r;
86
- },
87
- set(o) {
88
- Object.defineProperty(e, t, {
89
- value: o
90
- // configurable: true,
91
- });
92
- },
93
- configurable: !0
94
- });
95
- }
96
- function R(e, t, n) {
97
- Object.defineProperty(e, t, {
98
- value: n,
99
- writable: !0,
100
- enumerable: !0,
101
- configurable: !0
102
- });
103
- }
104
- function A(...e) {
105
- const t = {};
106
- for (const n of e) {
107
- const r = Object.getOwnPropertyDescriptors(n);
108
- Object.assign(t, r);
109
- }
110
- return Object.defineProperties({}, t);
111
- }
112
- function be(e) {
113
- return JSON.stringify(e);
114
- }
115
- function It(e) {
116
- return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
117
- }
118
- const Ge = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
119
- };
120
- function L(e) {
121
- return typeof e == "object" && e !== null && !Array.isArray(e);
122
- }
123
- const Tt = /* @__PURE__ */ ee(() => {
124
- if (ae.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
125
- return !1;
126
- try {
127
- const e = Function;
128
- return new e(""), !0;
129
- } catch {
130
- return !1;
131
- }
132
- });
133
- function x(e) {
134
- if (L(e) === !1)
135
- return !1;
136
- const t = e.constructor;
137
- if (t === void 0 || typeof t != "function")
138
- return !0;
139
- const n = t.prototype;
140
- return !(L(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
141
- }
142
- function Ye(e) {
143
- return x(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
144
- }
145
- const Et = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
146
- function U(e) {
147
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
148
- }
149
- function N(e, t, n) {
150
- const r = new e._zod.constr(t ?? e._zod.def);
151
- return (!t || n?.parent) && (r._zod.parent = e), r;
152
- }
153
- function d(e) {
154
- const t = e;
155
- if (!t)
156
- return {};
157
- if (typeof t == "string")
158
- return { error: () => t };
159
- if (t?.message !== void 0) {
160
- if (t?.error !== void 0)
161
- throw new Error("Cannot specify both `message` and `error` params");
162
- t.error = t.message;
163
- }
164
- return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
165
- }
166
- function Pt(e) {
167
- return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
168
- }
169
- const Nt = {
170
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
171
- int32: [-2147483648, 2147483647],
172
- uint32: [0, 4294967295],
173
- float32: [-34028234663852886e22, 34028234663852886e22],
174
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
175
- };
176
- function jt(e, t) {
177
- const n = e._zod.def, r = n.checks;
178
- if (r && r.length > 0)
179
- throw new Error(".pick() cannot be used on object schemas containing refinements");
180
- const i = A(e._zod.def, {
181
- get shape() {
182
- const s = {};
183
- for (const u in t) {
184
- if (!(u in n.shape))
185
- throw new Error(`Unrecognized key: "${u}"`);
186
- t[u] && (s[u] = n.shape[u]);
187
- }
188
- return R(this, "shape", s), s;
189
- },
190
- checks: []
191
- });
192
- return N(e, i);
193
- }
194
- function At(e, t) {
195
- const n = e._zod.def, r = n.checks;
196
- if (r && r.length > 0)
197
- throw new Error(".omit() cannot be used on object schemas containing refinements");
198
- const i = A(e._zod.def, {
199
- get shape() {
200
- const s = { ...e._zod.def.shape };
201
- for (const u in t) {
202
- if (!(u in n.shape))
203
- throw new Error(`Unrecognized key: "${u}"`);
204
- t[u] && delete s[u];
205
- }
206
- return R(this, "shape", s), s;
207
- },
208
- checks: []
209
- });
210
- return N(e, i);
211
- }
212
- function Rt(e, t) {
213
- if (!x(t))
214
- throw new Error("Invalid input to extend: expected a plain object");
215
- const n = e._zod.def.checks;
216
- if (n && n.length > 0) {
217
- const i = e._zod.def.shape;
218
- for (const s in t)
219
- if (Object.getOwnPropertyDescriptor(i, s) !== void 0)
220
- throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
221
- }
222
- const o = A(e._zod.def, {
223
- get shape() {
224
- const i = { ...e._zod.def.shape, ...t };
225
- return R(this, "shape", i), i;
226
- }
227
- });
228
- return N(e, o);
229
- }
230
- function Dt(e, t) {
231
- if (!x(t))
232
- throw new Error("Invalid input to safeExtend: expected a plain object");
233
- const n = A(e._zod.def, {
234
- get shape() {
235
- const r = { ...e._zod.def.shape, ...t };
236
- return R(this, "shape", r), r;
237
- }
238
- });
239
- return N(e, n);
240
- }
241
- function Ct(e, t) {
242
- if (e._zod.def.checks?.length)
243
- throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
244
- const n = A(e._zod.def, {
245
- get shape() {
246
- const r = { ...e._zod.def.shape, ...t._zod.def.shape };
247
- return R(this, "shape", r), r;
248
- },
249
- get catchall() {
250
- return t._zod.def.catchall;
251
- },
252
- checks: t._zod.def.checks ?? []
253
- });
254
- return N(e, n);
255
- }
256
- function xt(e, t, n) {
257
- const o = t._zod.def.checks;
258
- if (o && o.length > 0)
259
- throw new Error(".partial() cannot be used on object schemas containing refinements");
260
- const s = A(t._zod.def, {
261
- get shape() {
262
- const u = t._zod.def.shape, c = { ...u };
263
- if (n)
264
- for (const a in n) {
265
- if (!(a in u))
266
- throw new Error(`Unrecognized key: "${a}"`);
267
- n[a] && (c[a] = e ? new e({
268
- type: "optional",
269
- innerType: u[a]
270
- }) : u[a]);
271
- }
272
- else
273
- for (const a in u)
274
- c[a] = e ? new e({
275
- type: "optional",
276
- innerType: u[a]
277
- }) : u[a];
278
- return R(this, "shape", c), c;
279
- },
280
- checks: []
281
- });
282
- return N(t, s);
283
- }
284
- function Ut(e, t, n) {
285
- const r = A(t._zod.def, {
286
- get shape() {
287
- const o = t._zod.def.shape, i = { ...o };
288
- if (n)
289
- for (const s in n) {
290
- if (!(s in i))
291
- throw new Error(`Unrecognized key: "${s}"`);
292
- n[s] && (i[s] = new e({
293
- type: "nonoptional",
294
- innerType: o[s]
295
- }));
296
- }
297
- else
298
- for (const s in o)
299
- i[s] = new e({
300
- type: "nonoptional",
301
- innerType: o[s]
302
- });
303
- return R(this, "shape", i), i;
304
- }
305
- });
306
- return N(t, r);
307
- }
308
- function D(e, t = 0) {
309
- if (e.aborted === !0)
310
- return !0;
311
- for (let n = t; n < e.issues.length; n++)
312
- if (e.issues[n]?.continue !== !0)
313
- return !0;
314
- return !1;
315
- }
316
- function Ft(e, t = 0) {
317
- if (e.aborted === !0)
318
- return !0;
319
- for (let n = t; n < e.issues.length; n++)
320
- if (e.issues[n]?.continue === !1)
321
- return !0;
322
- return !1;
323
- }
324
- function j(e, t) {
325
- return t.map((n) => {
326
- var r;
327
- return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
328
- });
329
- }
330
- function W(e) {
331
- return typeof e == "string" ? e : e?.message;
332
- }
333
- function P(e, t, n) {
334
- const r = e.message ? e.message : W(e.inst?._zod.def?.error?.(e)) ?? W(t?.error?.(e)) ?? W(n.customError?.(e)) ?? W(n.localeError?.(e)) ?? "Invalid input", { inst: o, continue: i, input: s, ...u } = e;
335
- return u.path ?? (u.path = []), u.message = r, t?.reportInput && (u.input = s), u;
336
- }
337
- function pe(e) {
338
- return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
339
- }
340
- function V(...e) {
341
- const [t, n, r] = e;
342
- return typeof t == "string" ? {
343
- message: t,
344
- code: "custom",
345
- input: n,
346
- inst: r
347
- } : { ...t };
348
- }
349
- const qe = (e, t) => {
350
- e.name = "$ZodError", Object.defineProperty(e, "_zod", {
351
- value: e._zod,
352
- enumerable: !1
353
- }), Object.defineProperty(e, "issues", {
354
- value: t,
355
- enumerable: !1
356
- }), e.message = JSON.stringify(t, se, 2), Object.defineProperty(e, "toString", {
357
- value: () => e.message,
358
- enumerable: !1
359
- });
360
- }, Xe = l("$ZodError", qe), He = l("$ZodError", qe, { Parent: Error });
361
- function Jt(e, t = (n) => n.message) {
362
- const n = {}, r = [];
363
- for (const o of e.issues)
364
- o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
365
- return { formErrors: r, fieldErrors: n };
366
- }
367
- function Mt(e, t = (n) => n.message) {
368
- const n = { _errors: [] }, r = (o, i = []) => {
369
- for (const s of o.issues)
370
- if (s.code === "invalid_union" && s.errors.length)
371
- s.errors.map((u) => r({ issues: u }, [...i, ...s.path]));
372
- else if (s.code === "invalid_key")
373
- r({ issues: s.issues }, [...i, ...s.path]);
374
- else if (s.code === "invalid_element")
375
- r({ issues: s.issues }, [...i, ...s.path]);
376
- else {
377
- const u = [...i, ...s.path];
378
- if (u.length === 0)
379
- n._errors.push(t(s));
380
- else {
381
- let c = n, a = 0;
382
- for (; a < u.length; ) {
383
- const f = u[a];
384
- a === u.length - 1 ? (c[f] = c[f] || { _errors: [] }, c[f]._errors.push(t(s))) : c[f] = c[f] || { _errors: [] }, c = c[f], a++;
385
- }
386
- }
387
- }
388
- };
389
- return r(e), n;
390
- }
391
- const de = (e) => (t, n, r, o) => {
392
- const i = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, i);
393
- if (s instanceof Promise)
394
- throw new C();
395
- if (s.issues.length) {
396
- const u = new (o?.Err ?? e)(s.issues.map((c) => P(c, i, E())));
397
- throw Ge(u, o?.callee), u;
398
- }
399
- return s.value;
400
- }, he = (e) => async (t, n, r, o) => {
401
- const i = r ? { ...r, async: !0 } : { async: !0 };
402
- let s = t._zod.run({ value: n, issues: [] }, i);
403
- if (s instanceof Promise && (s = await s), s.issues.length) {
404
- const u = new (o?.Err ?? e)(s.issues.map((c) => P(c, i, E())));
405
- throw Ge(u, o?.callee), u;
406
- }
407
- return s.value;
408
- }, te = (e) => (t, n, r) => {
409
- const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
410
- if (i instanceof Promise)
411
- throw new C();
412
- return i.issues.length ? {
413
- success: !1,
414
- error: new (e ?? Xe)(i.issues.map((s) => P(s, o, E())))
415
- } : { success: !0, data: i.value };
416
- }, Lt = /* @__PURE__ */ te(He), ne = (e) => async (t, n, r) => {
417
- const o = r ? { ...r, async: !0 } : { async: !0 };
418
- let i = t._zod.run({ value: n, issues: [] }, o);
419
- return i instanceof Promise && (i = await i), i.issues.length ? {
420
- success: !1,
421
- error: new e(i.issues.map((s) => P(s, o, E())))
422
- } : { success: !0, data: i.value };
423
- }, Vt = /* @__PURE__ */ ne(He), Bt = (e) => (t, n, r) => {
424
- const o = r ? { ...r, direction: "backward" } : { direction: "backward" };
425
- return de(e)(t, n, o);
426
- }, Wt = (e) => (t, n, r) => de(e)(t, n, r), Kt = (e) => async (t, n, r) => {
427
- const o = r ? { ...r, direction: "backward" } : { direction: "backward" };
428
- return he(e)(t, n, o);
429
- }, Gt = (e) => async (t, n, r) => he(e)(t, n, r), Yt = (e) => (t, n, r) => {
430
- const o = r ? { ...r, direction: "backward" } : { direction: "backward" };
431
- return te(e)(t, n, o);
432
- }, qt = (e) => (t, n, r) => te(e)(t, n, r), Xt = (e) => async (t, n, r) => {
433
- const o = r ? { ...r, direction: "backward" } : { direction: "backward" };
434
- return ne(e)(t, n, o);
435
- }, Ht = (e) => async (t, n, r) => ne(e)(t, n, r), Qt = /^[cC][0-9a-z]{6,}$/, en = /^[0-9a-z]+$/, tn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, nn = /^[0-9a-vA-V]{20}$/, rn = /^[A-Za-z0-9]{27}$/, on = /^[a-zA-Z0-9_-]{21}$/, sn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, un = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, we = (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)$/, cn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, an = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
436
- function ln() {
437
- return new RegExp(an, "u");
438
- }
439
- const fn = /^(?:(?: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}|:))$/, dn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, hn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, mn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Qe = /^[A-Za-z0-9_-]*$/, _n = /^https?$/, gn = /^\+[1-9]\d{6,14}$/, et = "(?:(?:\\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])))", vn = /* @__PURE__ */ new RegExp(`^${et}$`);
440
- function tt(e) {
441
- const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
442
- 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+)?)?`;
443
- }
444
- function zn(e) {
445
- return new RegExp(`^${tt(e)}$`);
446
- }
447
- function yn(e) {
448
- const t = tt({ precision: e.precision }), n = ["Z"];
449
- e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
450
- const r = `${t}(?:${n.join("|")})`;
451
- return new RegExp(`^${et}T(?:${r})$`);
452
- }
453
- const bn = (e) => {
454
- const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
455
- return new RegExp(`^${t}$`);
456
- }, wn = /^-?\d+$/, nt = /^-?\d+(?:\.\d+)?$/, kn = /^(?:true|false)$/i, $n = /^null$/i, Zn = /^[^A-Z]*$/, Sn = /^[^a-z]*$/, O = /* @__PURE__ */ l("$ZodCheck", (e, t) => {
457
- var n;
458
- e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
459
- }), rt = {
460
- number: "number",
461
- bigint: "bigint",
462
- object: "date"
463
- }, ot = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
464
- O.init(e, t);
465
- const n = rt[typeof t.value];
466
- e._zod.onattach.push((r) => {
467
- const o = r._zod.bag, i = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
468
- t.value < i && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
469
- }), e._zod.check = (r) => {
470
- (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
471
- origin: n,
472
- code: "too_big",
473
- maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
474
- input: r.value,
475
- inclusive: t.inclusive,
476
- inst: e,
477
- continue: !t.abort
478
- });
479
- };
480
- }), st = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
481
- O.init(e, t);
482
- const n = rt[typeof t.value];
483
- e._zod.onattach.push((r) => {
484
- const o = r._zod.bag, i = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
485
- t.value > i && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
486
- }), e._zod.check = (r) => {
487
- (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
488
- origin: n,
489
- code: "too_small",
490
- minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
491
- input: r.value,
492
- inclusive: t.inclusive,
493
- inst: e,
494
- continue: !t.abort
495
- });
496
- };
497
- }), On = /* @__PURE__ */ l("$ZodCheckMultipleOf", (e, t) => {
498
- O.init(e, t), e._zod.onattach.push((n) => {
499
- var r;
500
- (r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
501
- }), e._zod.check = (n) => {
502
- if (typeof n.value != typeof t.value)
503
- throw new Error("Cannot mix number and bigint in multiple_of check.");
504
- (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : Ot(n.value, t.value) === 0) || n.issues.push({
505
- origin: typeof n.value,
506
- code: "not_multiple_of",
507
- divisor: t.value,
508
- input: n.value,
509
- inst: e,
510
- continue: !t.abort
511
- });
512
- };
513
- }), In = /* @__PURE__ */ l("$ZodCheckNumberFormat", (e, t) => {
514
- O.init(e, t), t.format = t.format || "float64";
515
- const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = Nt[t.format];
516
- e._zod.onattach.push((s) => {
517
- const u = s._zod.bag;
518
- u.format = t.format, u.minimum = o, u.maximum = i, n && (u.pattern = wn);
519
- }), e._zod.check = (s) => {
520
- const u = s.value;
521
- if (n) {
522
- if (!Number.isInteger(u)) {
523
- s.issues.push({
524
- expected: r,
525
- format: t.format,
526
- code: "invalid_type",
527
- continue: !1,
528
- input: u,
529
- inst: e
530
- });
531
- return;
532
- }
533
- if (!Number.isSafeInteger(u)) {
534
- u > 0 ? s.issues.push({
535
- input: u,
536
- code: "too_big",
537
- maximum: Number.MAX_SAFE_INTEGER,
538
- note: "Integers must be within the safe integer range.",
539
- inst: e,
540
- origin: r,
541
- inclusive: !0,
542
- continue: !t.abort
543
- }) : s.issues.push({
544
- input: u,
545
- code: "too_small",
546
- minimum: Number.MIN_SAFE_INTEGER,
547
- note: "Integers must be within the safe integer range.",
548
- inst: e,
549
- origin: r,
550
- inclusive: !0,
551
- continue: !t.abort
552
- });
553
- return;
554
- }
555
- }
556
- u < o && s.issues.push({
557
- origin: "number",
558
- input: u,
559
- code: "too_small",
560
- minimum: o,
561
- inclusive: !0,
562
- inst: e,
563
- continue: !t.abort
564
- }), u > i && s.issues.push({
565
- origin: "number",
566
- input: u,
567
- code: "too_big",
568
- maximum: i,
569
- inclusive: !0,
570
- inst: e,
571
- continue: !t.abort
572
- });
573
- };
574
- }), Tn = /* @__PURE__ */ l("$ZodCheckMaxLength", (e, t) => {
575
- var n;
576
- O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
577
- const o = r.value;
578
- return !le(o) && o.length !== void 0;
579
- }), e._zod.onattach.push((r) => {
580
- const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
581
- t.maximum < o && (r._zod.bag.maximum = t.maximum);
582
- }), e._zod.check = (r) => {
583
- const o = r.value;
584
- if (o.length <= t.maximum)
585
- return;
586
- const s = pe(o);
587
- r.issues.push({
588
- origin: s,
589
- code: "too_big",
590
- maximum: t.maximum,
591
- inclusive: !0,
592
- input: o,
593
- inst: e,
594
- continue: !t.abort
595
- });
596
- };
597
- }), En = /* @__PURE__ */ l("$ZodCheckMinLength", (e, t) => {
598
- var n;
599
- O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
600
- const o = r.value;
601
- return !le(o) && o.length !== void 0;
602
- }), e._zod.onattach.push((r) => {
603
- const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
604
- t.minimum > o && (r._zod.bag.minimum = t.minimum);
605
- }), e._zod.check = (r) => {
606
- const o = r.value;
607
- if (o.length >= t.minimum)
608
- return;
609
- const s = pe(o);
610
- r.issues.push({
611
- origin: s,
612
- code: "too_small",
613
- minimum: t.minimum,
614
- inclusive: !0,
615
- input: o,
616
- inst: e,
617
- continue: !t.abort
618
- });
619
- };
620
- }), Pn = /* @__PURE__ */ l("$ZodCheckLengthEquals", (e, t) => {
621
- var n;
622
- O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
623
- const o = r.value;
624
- return !le(o) && o.length !== void 0;
625
- }), e._zod.onattach.push((r) => {
626
- const o = r._zod.bag;
627
- o.minimum = t.length, o.maximum = t.length, o.length = t.length;
628
- }), e._zod.check = (r) => {
629
- const o = r.value, i = o.length;
630
- if (i === t.length)
631
- return;
632
- const s = pe(o), u = i > t.length;
633
- r.issues.push({
634
- origin: s,
635
- ...u ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
636
- inclusive: !0,
637
- exact: !0,
638
- input: r.value,
639
- inst: e,
640
- continue: !t.abort
641
- });
642
- };
643
- }), re = /* @__PURE__ */ l("$ZodCheckStringFormat", (e, t) => {
644
- var n, r;
645
- O.init(e, t), e._zod.onattach.push((o) => {
646
- const i = o._zod.bag;
647
- i.format = t.format, t.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t.pattern));
648
- }), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
649
- t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
650
- origin: "string",
651
- code: "invalid_format",
652
- format: t.format,
653
- input: o.value,
654
- ...t.pattern ? { pattern: t.pattern.toString() } : {},
655
- inst: e,
656
- continue: !t.abort
657
- });
658
- }) : (r = e._zod).check ?? (r.check = () => {
659
- });
660
- }), Nn = /* @__PURE__ */ l("$ZodCheckRegex", (e, t) => {
661
- re.init(e, t), e._zod.check = (n) => {
662
- t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
663
- origin: "string",
664
- code: "invalid_format",
665
- format: "regex",
666
- input: n.value,
667
- pattern: t.pattern.toString(),
668
- inst: e,
669
- continue: !t.abort
670
- });
671
- };
672
- }), jn = /* @__PURE__ */ l("$ZodCheckLowerCase", (e, t) => {
673
- t.pattern ?? (t.pattern = Zn), re.init(e, t);
674
- }), An = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
675
- t.pattern ?? (t.pattern = Sn), re.init(e, t);
676
- }), Rn = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
677
- O.init(e, t);
678
- const n = U(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
679
- t.pattern = r, e._zod.onattach.push((o) => {
680
- const i = o._zod.bag;
681
- i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
682
- }), e._zod.check = (o) => {
683
- o.value.includes(t.includes, t.position) || o.issues.push({
684
- origin: "string",
685
- code: "invalid_format",
686
- format: "includes",
687
- includes: t.includes,
688
- input: o.value,
689
- inst: e,
690
- continue: !t.abort
691
- });
692
- };
693
- }), Dn = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
694
- O.init(e, t);
695
- const n = new RegExp(`^${U(t.prefix)}.*`);
696
- t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
697
- const o = r._zod.bag;
698
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
699
- }), e._zod.check = (r) => {
700
- r.value.startsWith(t.prefix) || r.issues.push({
701
- origin: "string",
702
- code: "invalid_format",
703
- format: "starts_with",
704
- prefix: t.prefix,
705
- input: r.value,
706
- inst: e,
707
- continue: !t.abort
708
- });
709
- };
710
- }), Cn = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
711
- O.init(e, t);
712
- const n = new RegExp(`.*${U(t.suffix)}$`);
713
- t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
714
- const o = r._zod.bag;
715
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
716
- }), e._zod.check = (r) => {
717
- r.value.endsWith(t.suffix) || r.issues.push({
718
- origin: "string",
719
- code: "invalid_format",
720
- format: "ends_with",
721
- suffix: t.suffix,
722
- input: r.value,
723
- inst: e,
724
- continue: !t.abort
725
- });
726
- };
727
- }), xn = /* @__PURE__ */ l("$ZodCheckOverwrite", (e, t) => {
728
- O.init(e, t), e._zod.check = (n) => {
729
- n.value = t.tx(n.value);
730
- };
731
- });
732
- class Un {
733
- constructor(t = []) {
734
- this.content = [], this.indent = 0, this && (this.args = t);
735
- }
736
- indented(t) {
737
- this.indent += 1, t(this), this.indent -= 1;
738
- }
739
- write(t) {
740
- if (typeof t == "function") {
741
- t(this, { execution: "sync" }), t(this, { execution: "async" });
742
- return;
743
- }
744
- const r = t.split(`
745
- `).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), i = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
746
- for (const s of i)
747
- this.content.push(s);
748
- }
749
- compile() {
750
- const t = Function, n = this?.args, o = [...(this?.content ?? [""]).map((i) => ` ${i}`)];
751
- return new t(...n, o.join(`
752
- `));
753
- }
754
- }
755
- const Fn = {
756
- major: 4,
757
- minor: 4,
758
- patch: 3
759
- }, v = /* @__PURE__ */ l("$ZodType", (e, t) => {
760
- var n;
761
- e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Fn;
762
- const r = [...e._zod.def.checks ?? []];
763
- e._zod.traits.has("$ZodCheck") && r.unshift(e);
764
- for (const o of r)
765
- for (const i of o._zod.onattach)
766
- i(e);
767
- if (r.length === 0)
768
- (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
769
- e._zod.run = e._zod.parse;
770
- });
771
- else {
772
- const o = (s, u, c) => {
773
- let a = D(s), f;
774
- for (const p of u) {
775
- if (p._zod.def.when) {
776
- if (Ft(s) || !p._zod.def.when(s))
777
- continue;
778
- } else if (a)
779
- continue;
780
- const m = s.issues.length, h = p._zod.check(s);
781
- if (h instanceof Promise && c?.async === !1)
782
- throw new C();
783
- if (f || h instanceof Promise)
784
- f = (f ?? Promise.resolve()).then(async () => {
785
- await h, s.issues.length !== m && (a || (a = D(s, m)));
786
- });
787
- else {
788
- if (s.issues.length === m)
789
- continue;
790
- a || (a = D(s, m));
791
- }
792
- }
793
- return f ? f.then(() => s) : s;
794
- }, i = (s, u, c) => {
795
- if (D(s))
796
- return s.aborted = !0, s;
797
- const a = o(u, r, c);
798
- if (a instanceof Promise) {
799
- if (c.async === !1)
800
- throw new C();
801
- return a.then((f) => e._zod.parse(f, c));
802
- }
803
- return e._zod.parse(a, c);
804
- };
805
- e._zod.run = (s, u) => {
806
- if (u.skipChecks)
807
- return e._zod.parse(s, u);
808
- if (u.direction === "backward") {
809
- const a = e._zod.parse({ value: s.value, issues: [] }, { ...u, skipChecks: !0 });
810
- return a instanceof Promise ? a.then((f) => i(f, s, u)) : i(a, s, u);
811
- }
812
- const c = e._zod.parse(s, u);
813
- if (c instanceof Promise) {
814
- if (u.async === !1)
815
- throw new C();
816
- return c.then((a) => o(a, r, u));
817
- }
818
- return o(c, r, u);
819
- };
820
- }
821
- _(e, "~standard", () => ({
822
- validate: (o) => {
823
- try {
824
- const i = Lt(e, o);
825
- return i.success ? { value: i.data } : { issues: i.error?.issues };
826
- } catch {
827
- return Vt(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
828
- }
829
- },
830
- vendor: "zod",
831
- version: 1
832
- }));
833
- }), me = /* @__PURE__ */ l("$ZodString", (e, t) => {
834
- v.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? bn(e._zod.bag), e._zod.parse = (n, r) => {
835
- if (t.coerce)
836
- try {
837
- n.value = String(n.value);
838
- } catch {
839
- }
840
- return typeof n.value == "string" || n.issues.push({
841
- expected: "string",
842
- code: "invalid_type",
843
- input: n.value,
844
- inst: e
845
- }), n;
846
- };
847
- }), y = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
848
- re.init(e, t), me.init(e, t);
849
- }), Jn = /* @__PURE__ */ l("$ZodGUID", (e, t) => {
850
- t.pattern ?? (t.pattern = un), y.init(e, t);
851
- }), Mn = /* @__PURE__ */ l("$ZodUUID", (e, t) => {
852
- if (t.version) {
853
- const r = {
854
- v1: 1,
855
- v2: 2,
856
- v3: 3,
857
- v4: 4,
858
- v5: 5,
859
- v6: 6,
860
- v7: 7,
861
- v8: 8
862
- }[t.version];
863
- if (r === void 0)
864
- throw new Error(`Invalid UUID version: "${t.version}"`);
865
- t.pattern ?? (t.pattern = we(r));
866
- } else
867
- t.pattern ?? (t.pattern = we());
868
- y.init(e, t);
869
- }), Ln = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
870
- t.pattern ?? (t.pattern = cn), y.init(e, t);
871
- }), Vn = /* @__PURE__ */ l("$ZodURL", (e, t) => {
872
- y.init(e, t), e._zod.check = (n) => {
873
- try {
874
- const r = n.value.trim();
875
- if (!t.normalize && t.protocol?.source === _n.source && !/^https?:\/\//i.test(r)) {
876
- n.issues.push({
877
- code: "invalid_format",
878
- format: "url",
879
- note: "Invalid URL format",
880
- input: n.value,
881
- inst: e,
882
- continue: !t.abort
883
- });
884
- return;
885
- }
886
- const o = new URL(r);
887
- t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
888
- code: "invalid_format",
889
- format: "url",
890
- note: "Invalid hostname",
891
- pattern: t.hostname.source,
892
- input: n.value,
893
- inst: e,
894
- continue: !t.abort
895
- })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || n.issues.push({
896
- code: "invalid_format",
897
- format: "url",
898
- note: "Invalid protocol",
899
- pattern: t.protocol.source,
900
- input: n.value,
901
- inst: e,
902
- continue: !t.abort
903
- })), t.normalize ? n.value = o.href : n.value = r;
904
- return;
905
- } catch {
906
- n.issues.push({
907
- code: "invalid_format",
908
- format: "url",
909
- input: n.value,
910
- inst: e,
911
- continue: !t.abort
912
- });
913
- }
914
- };
915
- }), Bn = /* @__PURE__ */ l("$ZodEmoji", (e, t) => {
916
- t.pattern ?? (t.pattern = ln()), y.init(e, t);
917
- }), Wn = /* @__PURE__ */ l("$ZodNanoID", (e, t) => {
918
- t.pattern ?? (t.pattern = on), y.init(e, t);
919
- }), Kn = /* @__PURE__ */ l("$ZodCUID", (e, t) => {
920
- t.pattern ?? (t.pattern = Qt), y.init(e, t);
921
- }), Gn = /* @__PURE__ */ l("$ZodCUID2", (e, t) => {
922
- t.pattern ?? (t.pattern = en), y.init(e, t);
923
- }), Yn = /* @__PURE__ */ l("$ZodULID", (e, t) => {
924
- t.pattern ?? (t.pattern = tn), y.init(e, t);
925
- }), qn = /* @__PURE__ */ l("$ZodXID", (e, t) => {
926
- t.pattern ?? (t.pattern = nn), y.init(e, t);
927
- }), Xn = /* @__PURE__ */ l("$ZodKSUID", (e, t) => {
928
- t.pattern ?? (t.pattern = rn), y.init(e, t);
929
- }), Hn = /* @__PURE__ */ l("$ZodISODateTime", (e, t) => {
930
- t.pattern ?? (t.pattern = yn(t)), y.init(e, t);
931
- }), Qn = /* @__PURE__ */ l("$ZodISODate", (e, t) => {
932
- t.pattern ?? (t.pattern = vn), y.init(e, t);
933
- }), er = /* @__PURE__ */ l("$ZodISOTime", (e, t) => {
934
- t.pattern ?? (t.pattern = zn(t)), y.init(e, t);
935
- }), tr = /* @__PURE__ */ l("$ZodISODuration", (e, t) => {
936
- t.pattern ?? (t.pattern = sn), y.init(e, t);
937
- }), nr = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
938
- t.pattern ?? (t.pattern = fn), y.init(e, t), e._zod.bag.format = "ipv4";
939
- }), rr = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
940
- t.pattern ?? (t.pattern = pn), y.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
941
- try {
942
- new URL(`http://[${n.value}]`);
943
- } catch {
944
- n.issues.push({
945
- code: "invalid_format",
946
- format: "ipv6",
947
- input: n.value,
948
- inst: e,
949
- continue: !t.abort
950
- });
951
- }
952
- };
953
- }), or = /* @__PURE__ */ l("$ZodCIDRv4", (e, t) => {
954
- t.pattern ?? (t.pattern = dn), y.init(e, t);
955
- }), sr = /* @__PURE__ */ l("$ZodCIDRv6", (e, t) => {
956
- t.pattern ?? (t.pattern = hn), y.init(e, t), e._zod.check = (n) => {
957
- const r = n.value.split("/");
958
- try {
959
- if (r.length !== 2)
960
- throw new Error();
961
- const [o, i] = r;
962
- if (!i)
963
- throw new Error();
964
- const s = Number(i);
965
- if (`${s}` !== i)
966
- throw new Error();
967
- if (s < 0 || s > 128)
968
- throw new Error();
969
- new URL(`http://[${o}]`);
970
- } catch {
971
- n.issues.push({
972
- code: "invalid_format",
973
- format: "cidrv6",
974
- input: n.value,
975
- inst: e,
976
- continue: !t.abort
977
- });
978
- }
979
- };
980
- });
981
- function it(e) {
982
- if (e === "")
983
- return !0;
984
- if (/\s/.test(e) || e.length % 4 !== 0)
985
- return !1;
986
- try {
987
- return atob(e), !0;
988
- } catch {
989
- return !1;
990
- }
991
- }
992
- const ir = /* @__PURE__ */ l("$ZodBase64", (e, t) => {
993
- t.pattern ?? (t.pattern = mn), y.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
994
- it(n.value) || n.issues.push({
995
- code: "invalid_format",
996
- format: "base64",
997
- input: n.value,
998
- inst: e,
999
- continue: !t.abort
1000
- });
1001
- };
1002
- });
1003
- function ur(e) {
1004
- if (!Qe.test(e))
1005
- return !1;
1006
- const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1007
- return it(n);
1008
- }
1009
- const cr = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
1010
- t.pattern ?? (t.pattern = Qe), y.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1011
- ur(n.value) || n.issues.push({
1012
- code: "invalid_format",
1013
- format: "base64url",
1014
- input: n.value,
1015
- inst: e,
1016
- continue: !t.abort
1017
- });
1018
- };
1019
- }), ar = /* @__PURE__ */ l("$ZodE164", (e, t) => {
1020
- t.pattern ?? (t.pattern = gn), y.init(e, t);
1021
- });
1022
- function lr(e, t = null) {
1023
- try {
1024
- const n = e.split(".");
1025
- if (n.length !== 3)
1026
- return !1;
1027
- const [r] = n;
1028
- if (!r)
1029
- return !1;
1030
- const o = JSON.parse(atob(r));
1031
- return !("typ" in o && o?.typ !== "JWT" || !o.alg || t && (!("alg" in o) || o.alg !== t));
1032
- } catch {
1033
- return !1;
1034
- }
1035
- }
1036
- const fr = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
1037
- y.init(e, t), e._zod.check = (n) => {
1038
- lr(n.value, t.alg) || n.issues.push({
1039
- code: "invalid_format",
1040
- format: "jwt",
1041
- input: n.value,
1042
- inst: e,
1043
- continue: !t.abort
1044
- });
1045
- };
1046
- }), ut = /* @__PURE__ */ l("$ZodNumber", (e, t) => {
1047
- v.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? nt, e._zod.parse = (n, r) => {
1048
- if (t.coerce)
1049
- try {
1050
- n.value = Number(n.value);
1051
- } catch {
1052
- }
1053
- const o = n.value;
1054
- if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
1055
- return n;
1056
- const i = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
1057
- return n.issues.push({
1058
- expected: "number",
1059
- code: "invalid_type",
1060
- input: o,
1061
- inst: e,
1062
- ...i ? { received: i } : {}
1063
- }), n;
1064
- };
1065
- }), pr = /* @__PURE__ */ l("$ZodNumberFormat", (e, t) => {
1066
- In.init(e, t), ut.init(e, t);
1067
- }), dr = /* @__PURE__ */ l("$ZodBoolean", (e, t) => {
1068
- v.init(e, t), e._zod.pattern = kn, e._zod.parse = (n, r) => {
1069
- if (t.coerce)
1070
- try {
1071
- n.value = !!n.value;
1072
- } catch {
1073
- }
1074
- const o = n.value;
1075
- return typeof o == "boolean" || n.issues.push({
1076
- expected: "boolean",
1077
- code: "invalid_type",
1078
- input: o,
1079
- inst: e
1080
- }), n;
1081
- };
1082
- }), hr = /* @__PURE__ */ l("$ZodNull", (e, t) => {
1083
- v.init(e, t), e._zod.pattern = $n, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (n, r) => {
1084
- const o = n.value;
1085
- return o === null || n.issues.push({
1086
- expected: "null",
1087
- code: "invalid_type",
1088
- input: o,
1089
- inst: e
1090
- }), n;
1091
- };
1092
- }), mr = /* @__PURE__ */ l("$ZodAny", (e, t) => {
1093
- v.init(e, t), e._zod.parse = (n) => n;
1094
- }), _r = /* @__PURE__ */ l("$ZodUnknown", (e, t) => {
1095
- v.init(e, t), e._zod.parse = (n) => n;
1096
- }), gr = /* @__PURE__ */ l("$ZodNever", (e, t) => {
1097
- v.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1098
- expected: "never",
1099
- code: "invalid_type",
1100
- input: n.value,
1101
- inst: e
1102
- }), n);
1103
- }), vr = /* @__PURE__ */ l("$ZodVoid", (e, t) => {
1104
- v.init(e, t), e._zod.parse = (n, r) => {
1105
- const o = n.value;
1106
- return typeof o > "u" || n.issues.push({
1107
- expected: "void",
1108
- code: "invalid_type",
1109
- input: o,
1110
- inst: e
1111
- }), n;
1112
- };
1113
- }), zr = /* @__PURE__ */ l("$ZodDate", (e, t) => {
1114
- v.init(e, t), e._zod.parse = (n, r) => {
1115
- if (t.coerce)
1116
- try {
1117
- n.value = new Date(n.value);
1118
- } catch {
1119
- }
1120
- const o = n.value, i = o instanceof Date;
1121
- return i && !Number.isNaN(o.getTime()) || n.issues.push({
1122
- expected: "date",
1123
- code: "invalid_type",
1124
- input: o,
1125
- ...i ? { received: "Invalid Date" } : {},
1126
- inst: e
1127
- }), n;
1128
- };
1129
- });
1130
- function ke(e, t, n) {
1131
- e.issues.length && t.issues.push(...j(n, e.issues)), t.value[n] = e.value;
1132
- }
1133
- const yr = /* @__PURE__ */ l("$ZodArray", (e, t) => {
1134
- v.init(e, t), e._zod.parse = (n, r) => {
1135
- const o = n.value;
1136
- if (!Array.isArray(o))
1137
- return n.issues.push({
1138
- expected: "array",
1139
- code: "invalid_type",
1140
- input: o,
1141
- inst: e
1142
- }), n;
1143
- n.value = Array(o.length);
1144
- const i = [];
1145
- for (let s = 0; s < o.length; s++) {
1146
- const u = o[s], c = t.element._zod.run({
1147
- value: u,
1148
- issues: []
1149
- }, r);
1150
- c instanceof Promise ? i.push(c.then((a) => ke(a, n, s))) : ke(c, n, s);
1151
- }
1152
- return i.length ? Promise.all(i).then(() => n) : n;
1153
- };
1154
- });
1155
- function X(e, t, n, r, o, i) {
1156
- const s = n in r;
1157
- if (e.issues.length) {
1158
- if (o && i && !s)
1159
- return;
1160
- t.issues.push(...j(n, e.issues));
1161
- }
1162
- if (!s && !o) {
1163
- e.issues.length || t.issues.push({
1164
- code: "invalid_type",
1165
- expected: "nonoptional",
1166
- input: void 0,
1167
- path: [n]
1168
- });
1169
- return;
1170
- }
1171
- e.value === void 0 ? s && (t.value[n] = void 0) : t.value[n] = e.value;
1172
- }
1173
- function ct(e) {
1174
- const t = Object.keys(e.shape);
1175
- for (const r of t)
1176
- if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
1177
- throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1178
- const n = Pt(e.shape);
1179
- return {
1180
- ...e,
1181
- keys: t,
1182
- keySet: new Set(t),
1183
- numKeys: t.length,
1184
- optionalKeys: new Set(n)
1185
- };
1186
- }
1187
- function at(e, t, n, r, o, i) {
1188
- const s = [], u = o.keySet, c = o.catchall._zod, a = c.def.type, f = c.optin === "optional", p = c.optout === "optional";
1189
- for (const m in t) {
1190
- if (m === "__proto__" || u.has(m))
1191
- continue;
1192
- if (a === "never") {
1193
- s.push(m);
1194
- continue;
1195
- }
1196
- const h = c.run({ value: t[m], issues: [] }, r);
1197
- h instanceof Promise ? e.push(h.then((g) => X(g, n, m, t, f, p))) : X(h, n, m, t, f, p);
1198
- }
1199
- return s.length && n.issues.push({
1200
- code: "unrecognized_keys",
1201
- keys: s,
1202
- input: t,
1203
- inst: i
1204
- }), e.length ? Promise.all(e).then(() => n) : n;
1205
- }
1206
- const br = /* @__PURE__ */ l("$ZodObject", (e, t) => {
1207
- if (v.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1208
- const u = t.shape;
1209
- Object.defineProperty(t, "shape", {
1210
- get: () => {
1211
- const c = { ...u };
1212
- return Object.defineProperty(t, "shape", {
1213
- value: c
1214
- }), c;
1215
- }
1216
- });
1217
- }
1218
- const r = ee(() => ct(t));
1219
- _(e._zod, "propValues", () => {
1220
- const u = t.shape, c = {};
1221
- for (const a in u) {
1222
- const f = u[a]._zod;
1223
- if (f.values) {
1224
- c[a] ?? (c[a] = /* @__PURE__ */ new Set());
1225
- for (const p of f.values)
1226
- c[a].add(p);
1227
- }
1228
- }
1229
- return c;
1230
- });
1231
- const o = L, i = t.catchall;
1232
- let s;
1233
- e._zod.parse = (u, c) => {
1234
- s ?? (s = r.value);
1235
- const a = u.value;
1236
- if (!o(a))
1237
- return u.issues.push({
1238
- expected: "object",
1239
- code: "invalid_type",
1240
- input: a,
1241
- inst: e
1242
- }), u;
1243
- u.value = {};
1244
- const f = [], p = s.shape;
1245
- for (const m of s.keys) {
1246
- const h = p[m], g = h._zod.optin === "optional", J = h._zod.optout === "optional", $ = h._zod.run({ value: a[m], issues: [] }, c);
1247
- $ instanceof Promise ? f.push($.then((oe) => X(oe, u, m, a, g, J))) : X($, u, m, a, g, J);
1248
- }
1249
- return i ? at(f, a, u, c, r.value, e) : f.length ? Promise.all(f).then(() => u) : u;
1250
- };
1251
- }), wr = /* @__PURE__ */ l("$ZodObjectJIT", (e, t) => {
1252
- br.init(e, t);
1253
- const n = e._zod.parse, r = ee(() => ct(t)), o = (m) => {
1254
- const h = new Un(["shape", "payload", "ctx"]), g = r.value, J = (T) => {
1255
- const k = be(T);
1256
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1257
- };
1258
- h.write("const input = payload.value;");
1259
- const $ = /* @__PURE__ */ Object.create(null);
1260
- let oe = 0;
1261
- for (const T of g.keys)
1262
- $[T] = `key_${oe++}`;
1263
- h.write("const newResult = {};");
1264
- for (const T of g.keys) {
1265
- const k = $[T], Z = be(T), ge = m[T], ve = ge?._zod?.optin === "optional", St = ge?._zod?.optout === "optional";
1266
- h.write(`const ${k} = ${J(T)};`), ve && St ? h.write(`
1267
- if (${k}.issues.length) {
1268
- if (${Z} in input) {
1269
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
1270
- ...iss,
1271
- path: iss.path ? [${Z}, ...iss.path] : [${Z}]
1272
- })));
1273
- }
1274
- }
1275
-
1276
- if (${k}.value === undefined) {
1277
- if (${Z} in input) {
1278
- newResult[${Z}] = undefined;
1279
- }
1280
- } else {
1281
- newResult[${Z}] = ${k}.value;
1282
- }
1283
-
1284
- `) : ve ? h.write(`
1285
- if (${k}.issues.length) {
1286
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
1287
- ...iss,
1288
- path: iss.path ? [${Z}, ...iss.path] : [${Z}]
1289
- })));
1290
- }
1291
-
1292
- if (${k}.value === undefined) {
1293
- if (${Z} in input) {
1294
- newResult[${Z}] = undefined;
1295
- }
1296
- } else {
1297
- newResult[${Z}] = ${k}.value;
1298
- }
1299
-
1300
- `) : h.write(`
1301
- const ${k}_present = ${Z} in input;
1302
- if (${k}.issues.length) {
1303
- payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
1304
- ...iss,
1305
- path: iss.path ? [${Z}, ...iss.path] : [${Z}]
1306
- })));
1307
- }
1308
- if (!${k}_present && !${k}.issues.length) {
1309
- payload.issues.push({
1310
- code: "invalid_type",
1311
- expected: "nonoptional",
1312
- input: undefined,
1313
- path: [${Z}]
1314
- });
1315
- }
1316
-
1317
- if (${k}_present) {
1318
- if (${k}.value === undefined) {
1319
- newResult[${Z}] = undefined;
1320
- } else {
1321
- newResult[${Z}] = ${k}.value;
1322
- }
1323
- }
1324
-
1325
- `);
1326
- }
1327
- h.write("payload.value = newResult;"), h.write("return payload;");
1328
- const Zt = h.compile();
1329
- return (T, k) => Zt(m, T, k);
1330
- };
1331
- let i;
1332
- const s = L, u = !ae.jitless, a = u && Tt.value, f = t.catchall;
1333
- let p;
1334
- e._zod.parse = (m, h) => {
1335
- p ?? (p = r.value);
1336
- const g = m.value;
1337
- return s(g) ? u && a && h?.async === !1 && h.jitless !== !0 ? (i || (i = o(t.shape)), m = i(m, h), f ? at([], g, m, h, p, e) : m) : n(m, h) : (m.issues.push({
1338
- expected: "object",
1339
- code: "invalid_type",
1340
- input: g,
1341
- inst: e
1342
- }), m);
1343
- };
1344
- });
1345
- function $e(e, t, n, r) {
1346
- for (const i of e)
1347
- if (i.issues.length === 0)
1348
- return t.value = i.value, t;
1349
- const o = e.filter((i) => !D(i));
1350
- return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
1351
- code: "invalid_union",
1352
- input: t.value,
1353
- inst: n,
1354
- errors: e.map((i) => i.issues.map((s) => P(s, r, E())))
1355
- }), t);
1356
- }
1357
- const lt = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
1358
- v.init(e, t), _(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), _(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), _(e._zod, "values", () => {
1359
- if (t.options.every((r) => r._zod.values))
1360
- return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
1361
- }), _(e._zod, "pattern", () => {
1362
- if (t.options.every((r) => r._zod.pattern)) {
1363
- const r = t.options.map((o) => o._zod.pattern);
1364
- return new RegExp(`^(${r.map((o) => fe(o.source)).join("|")})$`);
1365
- }
1366
- });
1367
- const n = t.options.length === 1 ? t.options[0]._zod.run : null;
1368
- e._zod.parse = (r, o) => {
1369
- if (n)
1370
- return n(r, o);
1371
- let i = !1;
1372
- const s = [];
1373
- for (const u of t.options) {
1374
- const c = u._zod.run({
1375
- value: r.value,
1376
- issues: []
1377
- }, o);
1378
- if (c instanceof Promise)
1379
- s.push(c), i = !0;
1380
- else {
1381
- if (c.issues.length === 0)
1382
- return c;
1383
- s.push(c);
1384
- }
1385
- }
1386
- return i ? Promise.all(s).then((u) => $e(u, r, e, o)) : $e(s, r, e, o);
1387
- };
1388
- }), kr = /* @__PURE__ */ l("$ZodDiscriminatedUnion", (e, t) => {
1389
- t.inclusive = !1, lt.init(e, t);
1390
- const n = e._zod.parse;
1391
- _(e._zod, "propValues", () => {
1392
- const o = {};
1393
- for (const i of t.options) {
1394
- const s = i._zod.propValues;
1395
- if (!s || Object.keys(s).length === 0)
1396
- throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);
1397
- for (const [u, c] of Object.entries(s)) {
1398
- o[u] || (o[u] = /* @__PURE__ */ new Set());
1399
- for (const a of c)
1400
- o[u].add(a);
1401
- }
1402
- }
1403
- return o;
1404
- });
1405
- const r = ee(() => {
1406
- const o = t.options, i = /* @__PURE__ */ new Map();
1407
- for (const s of o) {
1408
- const u = s._zod.propValues?.[t.discriminator];
1409
- if (!u || u.size === 0)
1410
- throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);
1411
- for (const c of u) {
1412
- if (i.has(c))
1413
- throw new Error(`Duplicate discriminator value "${String(c)}"`);
1414
- i.set(c, s);
1415
- }
1416
- }
1417
- return i;
1418
- });
1419
- e._zod.parse = (o, i) => {
1420
- const s = o.value;
1421
- if (!L(s))
1422
- return o.issues.push({
1423
- code: "invalid_type",
1424
- expected: "object",
1425
- input: s,
1426
- inst: e
1427
- }), o;
1428
- const u = r.value.get(s?.[t.discriminator]);
1429
- return u ? u._zod.run(o, i) : t.unionFallback || i.direction === "backward" ? n(o, i) : (o.issues.push({
1430
- code: "invalid_union",
1431
- errors: [],
1432
- note: "No matching discriminator",
1433
- discriminator: t.discriminator,
1434
- options: Array.from(r.value.keys()),
1435
- input: s,
1436
- path: [t.discriminator],
1437
- inst: e
1438
- }), o);
1439
- };
1440
- }), $r = /* @__PURE__ */ l("$ZodIntersection", (e, t) => {
1441
- v.init(e, t), e._zod.parse = (n, r) => {
1442
- const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
1443
- return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, a]) => Ze(n, c, a)) : Ze(n, i, s);
1444
- };
1445
- });
1446
- function ie(e, t) {
1447
- if (e === t)
1448
- return { valid: !0, data: e };
1449
- if (e instanceof Date && t instanceof Date && +e == +t)
1450
- return { valid: !0, data: e };
1451
- if (x(e) && x(t)) {
1452
- const n = Object.keys(t), r = Object.keys(e).filter((i) => n.indexOf(i) !== -1), o = { ...e, ...t };
1453
- for (const i of r) {
1454
- const s = ie(e[i], t[i]);
1455
- if (!s.valid)
1456
- return {
1457
- valid: !1,
1458
- mergeErrorPath: [i, ...s.mergeErrorPath]
1459
- };
1460
- o[i] = s.data;
1461
- }
1462
- return { valid: !0, data: o };
1463
- }
1464
- if (Array.isArray(e) && Array.isArray(t)) {
1465
- if (e.length !== t.length)
1466
- return { valid: !1, mergeErrorPath: [] };
1467
- const n = [];
1468
- for (let r = 0; r < e.length; r++) {
1469
- const o = e[r], i = t[r], s = ie(o, i);
1470
- if (!s.valid)
1471
- return {
1472
- valid: !1,
1473
- mergeErrorPath: [r, ...s.mergeErrorPath]
1474
- };
1475
- n.push(s.data);
1476
- }
1477
- return { valid: !0, data: n };
1478
- }
1479
- return { valid: !1, mergeErrorPath: [] };
1480
- }
1481
- function Ze(e, t, n) {
1482
- const r = /* @__PURE__ */ new Map();
1483
- let o;
1484
- for (const u of t.issues)
1485
- if (u.code === "unrecognized_keys") {
1486
- o ?? (o = u);
1487
- for (const c of u.keys)
1488
- r.has(c) || r.set(c, {}), r.get(c).l = !0;
1489
- } else
1490
- e.issues.push(u);
1491
- for (const u of n.issues)
1492
- if (u.code === "unrecognized_keys")
1493
- for (const c of u.keys)
1494
- r.has(c) || r.set(c, {}), r.get(c).r = !0;
1495
- else
1496
- e.issues.push(u);
1497
- const i = [...r].filter(([, u]) => u.l && u.r).map(([u]) => u);
1498
- if (i.length && o && e.issues.push({ ...o, keys: i }), D(e))
1499
- return e;
1500
- const s = ie(t.value, n.value);
1501
- if (!s.valid)
1502
- throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
1503
- return e.value = s.data, e;
1504
- }
1505
- const Zr = /* @__PURE__ */ l("$ZodTuple", (e, t) => {
1506
- v.init(e, t);
1507
- const n = t.items;
1508
- e._zod.parse = (r, o) => {
1509
- const i = r.value;
1510
- if (!Array.isArray(i))
1511
- return r.issues.push({
1512
- input: i,
1513
- inst: e,
1514
- expected: "tuple",
1515
- code: "invalid_type"
1516
- }), r;
1517
- r.value = [];
1518
- const s = [], u = Se(n, "optin"), c = Se(n, "optout");
1519
- if (!t.rest) {
1520
- if (i.length < u)
1521
- return r.issues.push({
1522
- code: "too_small",
1523
- minimum: u,
1524
- inclusive: !0,
1525
- input: i,
1526
- inst: e,
1527
- origin: "array"
1528
- }), r;
1529
- i.length > n.length && r.issues.push({
1530
- code: "too_big",
1531
- maximum: n.length,
1532
- inclusive: !0,
1533
- input: i,
1534
- inst: e,
1535
- origin: "array"
1536
- });
1537
- }
1538
- const a = new Array(n.length);
1539
- for (let f = 0; f < n.length; f++) {
1540
- const p = n[f]._zod.run({ value: i[f], issues: [] }, o);
1541
- p instanceof Promise ? s.push(p.then((m) => {
1542
- a[f] = m;
1543
- })) : a[f] = p;
1544
- }
1545
- if (t.rest) {
1546
- let f = n.length - 1;
1547
- const p = i.slice(n.length);
1548
- for (const m of p) {
1549
- f++;
1550
- const h = t.rest._zod.run({ value: m, issues: [] }, o);
1551
- h instanceof Promise ? s.push(h.then((g) => Oe(g, r, f))) : Oe(h, r, f);
1552
- }
1553
- }
1554
- return s.length ? Promise.all(s).then(() => Ie(a, r, n, i, c)) : Ie(a, r, n, i, c);
1555
- };
1556
- });
1557
- function Se(e, t) {
1558
- for (let n = e.length - 1; n >= 0; n--)
1559
- if (e[n]._zod[t] !== "optional")
1560
- return n + 1;
1561
- return 0;
1562
- }
1563
- function Oe(e, t, n) {
1564
- e.issues.length && t.issues.push(...j(n, e.issues)), t.value[n] = e.value;
1565
- }
1566
- function Ie(e, t, n, r, o) {
1567
- for (let i = 0; i < n.length; i++) {
1568
- const s = e[i], u = i < r.length;
1569
- if (s.issues.length) {
1570
- if (!u && i >= o) {
1571
- t.value.length = i;
1572
- break;
1573
- }
1574
- t.issues.push(...j(i, s.issues));
1575
- }
1576
- t.value[i] = s.value;
1577
- }
1578
- for (let i = t.value.length - 1; i >= r.length && (n[i]._zod.optout === "optional" && t.value[i] === void 0); i--)
1579
- t.value.length = i;
1580
- return t;
1581
- }
1582
- const Sr = /* @__PURE__ */ l("$ZodRecord", (e, t) => {
1583
- v.init(e, t), e._zod.parse = (n, r) => {
1584
- const o = n.value;
1585
- if (!x(o))
1586
- return n.issues.push({
1587
- expected: "record",
1588
- code: "invalid_type",
1589
- input: o,
1590
- inst: e
1591
- }), n;
1592
- const i = [], s = t.keyType._zod.values;
1593
- if (s) {
1594
- n.value = {};
1595
- const u = /* @__PURE__ */ new Set();
1596
- for (const a of s)
1597
- if (typeof a == "string" || typeof a == "number" || typeof a == "symbol") {
1598
- u.add(typeof a == "number" ? a.toString() : a);
1599
- const f = t.keyType._zod.run({ value: a, issues: [] }, r);
1600
- if (f instanceof Promise)
1601
- throw new Error("Async schemas not supported in object keys currently");
1602
- if (f.issues.length) {
1603
- n.issues.push({
1604
- code: "invalid_key",
1605
- origin: "record",
1606
- issues: f.issues.map((h) => P(h, r, E())),
1607
- input: a,
1608
- path: [a],
1609
- inst: e
1610
- });
1611
- continue;
1612
- }
1613
- const p = f.value, m = t.valueType._zod.run({ value: o[a], issues: [] }, r);
1614
- m instanceof Promise ? i.push(m.then((h) => {
1615
- h.issues.length && n.issues.push(...j(a, h.issues)), n.value[p] = h.value;
1616
- })) : (m.issues.length && n.issues.push(...j(a, m.issues)), n.value[p] = m.value);
1617
- }
1618
- let c;
1619
- for (const a in o)
1620
- u.has(a) || (c = c ?? [], c.push(a));
1621
- c && c.length > 0 && n.issues.push({
1622
- code: "unrecognized_keys",
1623
- input: o,
1624
- inst: e,
1625
- keys: c
1626
- });
1627
- } else {
1628
- n.value = {};
1629
- for (const u of Reflect.ownKeys(o)) {
1630
- if (u === "__proto__" || !Object.prototype.propertyIsEnumerable.call(o, u))
1631
- continue;
1632
- let c = t.keyType._zod.run({ value: u, issues: [] }, r);
1633
- if (c instanceof Promise)
1634
- throw new Error("Async schemas not supported in object keys currently");
1635
- if (typeof u == "string" && nt.test(u) && c.issues.length) {
1636
- const p = t.keyType._zod.run({ value: Number(u), issues: [] }, r);
1637
- if (p instanceof Promise)
1638
- throw new Error("Async schemas not supported in object keys currently");
1639
- p.issues.length === 0 && (c = p);
1640
- }
1641
- if (c.issues.length) {
1642
- t.mode === "loose" ? n.value[u] = o[u] : n.issues.push({
1643
- code: "invalid_key",
1644
- origin: "record",
1645
- issues: c.issues.map((p) => P(p, r, E())),
1646
- input: u,
1647
- path: [u],
1648
- inst: e
1649
- });
1650
- continue;
1651
- }
1652
- const f = t.valueType._zod.run({ value: o[u], issues: [] }, r);
1653
- f instanceof Promise ? i.push(f.then((p) => {
1654
- p.issues.length && n.issues.push(...j(u, p.issues)), n.value[c.value] = p.value;
1655
- })) : (f.issues.length && n.issues.push(...j(u, f.issues)), n.value[c.value] = f.value);
1656
- }
1657
- }
1658
- return i.length ? Promise.all(i).then(() => n) : n;
1659
- };
1660
- }), Or = /* @__PURE__ */ l("$ZodEnum", (e, t) => {
1661
- v.init(e, t);
1662
- const n = Ke(t.entries), r = new Set(n);
1663
- e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => Et.has(typeof o)).map((o) => typeof o == "string" ? U(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1664
- const s = o.value;
1665
- return r.has(s) || o.issues.push({
1666
- code: "invalid_value",
1667
- values: n,
1668
- input: s,
1669
- inst: e
1670
- }), o;
1671
- };
1672
- }), Ir = /* @__PURE__ */ l("$ZodLiteral", (e, t) => {
1673
- if (v.init(e, t), t.values.length === 0)
1674
- throw new Error("Cannot create literal schema with no valid values");
1675
- const n = new Set(t.values);
1676
- e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ? U(r) : r ? U(r.toString()) : String(r)).join("|")})$`), e._zod.parse = (r, o) => {
1677
- const i = r.value;
1678
- return n.has(i) || r.issues.push({
1679
- code: "invalid_value",
1680
- values: t.values,
1681
- input: i,
1682
- inst: e
1683
- }), r;
1684
- };
1685
- }), Tr = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
1686
- v.init(e, t), e._zod.optin = "optional", e._zod.parse = (n, r) => {
1687
- if (r.direction === "backward")
1688
- throw new We(e.constructor.name);
1689
- const o = t.transform(n.value, n);
1690
- if (r.async)
1691
- return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n.fallback = !0, n));
1692
- if (o instanceof Promise)
1693
- throw new C();
1694
- return n.value = o, n.fallback = !0, n;
1695
- };
1696
- });
1697
- function Te(e, t) {
1698
- return t === void 0 && (e.issues.length || e.fallback) ? { issues: [], value: void 0 } : e;
1699
- }
1700
- const ft = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
1701
- v.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", _(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), _(e._zod, "pattern", () => {
1702
- const n = t.innerType._zod.pattern;
1703
- return n ? new RegExp(`^(${fe(n.source)})?$`) : void 0;
1704
- }), e._zod.parse = (n, r) => {
1705
- if (t.innerType._zod.optin === "optional") {
1706
- const o = n.value, i = t.innerType._zod.run(n, r);
1707
- return i instanceof Promise ? i.then((s) => Te(s, o)) : Te(i, o);
1708
- }
1709
- return n.value === void 0 ? n : t.innerType._zod.run(n, r);
1710
- };
1711
- }), Er = /* @__PURE__ */ l("$ZodExactOptional", (e, t) => {
1712
- ft.init(e, t), _(e._zod, "values", () => t.innerType._zod.values), _(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
1713
- }), Pr = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
1714
- v.init(e, t), _(e._zod, "optin", () => t.innerType._zod.optin), _(e._zod, "optout", () => t.innerType._zod.optout), _(e._zod, "pattern", () => {
1715
- const n = t.innerType._zod.pattern;
1716
- return n ? new RegExp(`^(${fe(n.source)}|null)$`) : void 0;
1717
- }), _(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);
1718
- }), Nr = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
1719
- v.init(e, t), e._zod.optin = "optional", _(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1720
- if (r.direction === "backward")
1721
- return t.innerType._zod.run(n, r);
1722
- if (n.value === void 0)
1723
- return n.value = t.defaultValue, n;
1724
- const o = t.innerType._zod.run(n, r);
1725
- return o instanceof Promise ? o.then((i) => Ee(i, t)) : Ee(o, t);
1726
- };
1727
- });
1728
- function Ee(e, t) {
1729
- return e.value === void 0 && (e.value = t.defaultValue), e;
1730
- }
1731
- const jr = /* @__PURE__ */ l("$ZodPrefault", (e, t) => {
1732
- v.init(e, t), e._zod.optin = "optional", _(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));
1733
- }), Ar = /* @__PURE__ */ l("$ZodNonOptional", (e, t) => {
1734
- v.init(e, t), _(e._zod, "values", () => {
1735
- const n = t.innerType._zod.values;
1736
- return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
1737
- }), e._zod.parse = (n, r) => {
1738
- const o = t.innerType._zod.run(n, r);
1739
- return o instanceof Promise ? o.then((i) => Pe(i, e)) : Pe(o, e);
1740
- };
1741
- });
1742
- function Pe(e, t) {
1743
- return !e.issues.length && e.value === void 0 && e.issues.push({
1744
- code: "invalid_type",
1745
- expected: "nonoptional",
1746
- input: e.value,
1747
- inst: t
1748
- }), e;
1749
- }
1750
- const Rr = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
1751
- v.init(e, t), e._zod.optin = "optional", _(e._zod, "optout", () => t.innerType._zod.optout), _(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1752
- if (r.direction === "backward")
1753
- return t.innerType._zod.run(n, r);
1754
- const o = t.innerType._zod.run(n, r);
1755
- return o instanceof Promise ? o.then((i) => (n.value = i.value, i.issues.length && (n.value = t.catchValue({
1756
- ...n,
1757
- error: {
1758
- issues: i.issues.map((s) => P(s, r, E()))
1759
- },
1760
- input: n.value
1761
- }), n.issues = [], n.fallback = !0), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
1762
- ...n,
1763
- error: {
1764
- issues: o.issues.map((i) => P(i, r, E()))
1765
- },
1766
- input: n.value
1767
- }), n.issues = [], n.fallback = !0), n);
1768
- };
1769
- }), Dr = /* @__PURE__ */ l("$ZodPipe", (e, t) => {
1770
- v.init(e, t), _(e._zod, "values", () => t.in._zod.values), _(e._zod, "optin", () => t.in._zod.optin), _(e._zod, "optout", () => t.out._zod.optout), _(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1771
- if (r.direction === "backward") {
1772
- const i = t.out._zod.run(n, r);
1773
- return i instanceof Promise ? i.then((s) => K(s, t.in, r)) : K(i, t.in, r);
1774
- }
1775
- const o = t.in._zod.run(n, r);
1776
- return o instanceof Promise ? o.then((i) => K(i, t.out, r)) : K(o, t.out, r);
1777
- };
1778
- });
1779
- function K(e, t, n) {
1780
- return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues, fallback: e.fallback }, n);
1781
- }
1782
- const Cr = /* @__PURE__ */ l("$ZodReadonly", (e, t) => {
1783
- v.init(e, t), _(e._zod, "propValues", () => t.innerType._zod.propValues), _(e._zod, "values", () => t.innerType._zod.values), _(e._zod, "optin", () => t.innerType?._zod?.optin), _(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
1784
- if (r.direction === "backward")
1785
- return t.innerType._zod.run(n, r);
1786
- const o = t.innerType._zod.run(n, r);
1787
- return o instanceof Promise ? o.then(Ne) : Ne(o);
1788
- };
1789
- });
1790
- function Ne(e) {
1791
- return e.value = Object.freeze(e.value), e;
1792
- }
1793
- const xr = /* @__PURE__ */ l("$ZodLazy", (e, t) => {
1794
- v.init(e, t), _(e._zod, "innerType", () => {
1795
- const n = t;
1796
- return n._cachedInner || (n._cachedInner = t.getter()), n._cachedInner;
1797
- }), _(e._zod, "pattern", () => e._zod.innerType?._zod?.pattern), _(e._zod, "propValues", () => e._zod.innerType?._zod?.propValues), _(e._zod, "optin", () => e._zod.innerType?._zod?.optin ?? void 0), _(e._zod, "optout", () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (n, r) => e._zod.innerType._zod.run(n, r);
1798
- }), Ur = /* @__PURE__ */ l("$ZodCustom", (e, t) => {
1799
- O.init(e, t), v.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1800
- const r = n.value, o = t.fn(r);
1801
- if (o instanceof Promise)
1802
- return o.then((i) => je(i, n, r, e));
1803
- je(o, n, r, e);
1804
- };
1805
- });
1806
- function je(e, t, n, r) {
1807
- if (!e) {
1808
- const o = {
1809
- code: "custom",
1810
- input: n,
1811
- inst: r,
1812
- // incorporates params.error into issue reporting
1813
- path: [...r._zod.def.path ?? []],
1814
- // incorporates params.error into issue reporting
1815
- continue: !r._zod.def.abort
1816
- // params: inst._zod.def.params,
1817
- };
1818
- r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(V(o));
1819
- }
1820
- }
1821
- var Ae;
1822
- class Fr {
1823
- constructor() {
1824
- this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1825
- }
1826
- add(t, ...n) {
1827
- const r = n[0];
1828
- return this._map.set(t, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, t), this;
1829
- }
1830
- clear() {
1831
- return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1832
- }
1833
- remove(t) {
1834
- const n = this._map.get(t);
1835
- return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(t), this;
1836
- }
1837
- get(t) {
1838
- const n = t._zod.parent;
1839
- if (n) {
1840
- const r = { ...this.get(n) ?? {} };
1841
- delete r.id;
1842
- const o = { ...r, ...this._map.get(t) };
1843
- return Object.keys(o).length ? o : void 0;
1844
- }
1845
- return this._map.get(t);
1846
- }
1847
- has(t) {
1848
- return this._map.has(t);
1849
- }
1850
- }
1851
- function Jr() {
1852
- return new Fr();
1853
- }
1854
- (Ae = globalThis).__zod_globalRegistry ?? (Ae.__zod_globalRegistry = Jr());
1855
- const M = globalThis.__zod_globalRegistry;
1856
- // @__NO_SIDE_EFFECTS__
1857
- function Mr(e, t) {
1858
- return new e({
1859
- type: "string",
1860
- ...d(t)
1861
- });
1862
- }
1863
- // @__NO_SIDE_EFFECTS__
1864
- function pt(e, t) {
1865
- return new e({
1866
- type: "string",
1867
- format: "email",
1868
- check: "string_format",
1869
- abort: !1,
1870
- ...d(t)
1871
- });
1872
- }
1873
- // @__NO_SIDE_EFFECTS__
1874
- function Re(e, t) {
1875
- return new e({
1876
- type: "string",
1877
- format: "guid",
1878
- check: "string_format",
1879
- abort: !1,
1880
- ...d(t)
1881
- });
1882
- }
1883
- // @__NO_SIDE_EFFECTS__
1884
- function Lr(e, t) {
1885
- return new e({
1886
- type: "string",
1887
- format: "uuid",
1888
- check: "string_format",
1889
- abort: !1,
1890
- ...d(t)
1891
- });
1892
- }
1893
- // @__NO_SIDE_EFFECTS__
1894
- function Vr(e, t) {
1895
- return new e({
1896
- type: "string",
1897
- format: "uuid",
1898
- check: "string_format",
1899
- abort: !1,
1900
- version: "v4",
1901
- ...d(t)
1902
- });
1903
- }
1904
- // @__NO_SIDE_EFFECTS__
1905
- function Br(e, t) {
1906
- return new e({
1907
- type: "string",
1908
- format: "uuid",
1909
- check: "string_format",
1910
- abort: !1,
1911
- version: "v6",
1912
- ...d(t)
1913
- });
1914
- }
1915
- // @__NO_SIDE_EFFECTS__
1916
- function Wr(e, t) {
1917
- return new e({
1918
- type: "string",
1919
- format: "uuid",
1920
- check: "string_format",
1921
- abort: !1,
1922
- version: "v7",
1923
- ...d(t)
1924
- });
1925
- }
1926
- // @__NO_SIDE_EFFECTS__
1927
- function Kr(e, t) {
1928
- return new e({
1929
- type: "string",
1930
- format: "url",
1931
- check: "string_format",
1932
- abort: !1,
1933
- ...d(t)
1934
- });
1935
- }
1936
- // @__NO_SIDE_EFFECTS__
1937
- function Gr(e, t) {
1938
- return new e({
1939
- type: "string",
1940
- format: "emoji",
1941
- check: "string_format",
1942
- abort: !1,
1943
- ...d(t)
1944
- });
1945
- }
1946
- // @__NO_SIDE_EFFECTS__
1947
- function Yr(e, t) {
1948
- return new e({
1949
- type: "string",
1950
- format: "nanoid",
1951
- check: "string_format",
1952
- abort: !1,
1953
- ...d(t)
1954
- });
1955
- }
1956
- // @__NO_SIDE_EFFECTS__
1957
- function qr(e, t) {
1958
- return new e({
1959
- type: "string",
1960
- format: "cuid",
1961
- check: "string_format",
1962
- abort: !1,
1963
- ...d(t)
1964
- });
1965
- }
1966
- // @__NO_SIDE_EFFECTS__
1967
- function Xr(e, t) {
1968
- return new e({
1969
- type: "string",
1970
- format: "cuid2",
1971
- check: "string_format",
1972
- abort: !1,
1973
- ...d(t)
1974
- });
1975
- }
1976
- // @__NO_SIDE_EFFECTS__
1977
- function Hr(e, t) {
1978
- return new e({
1979
- type: "string",
1980
- format: "ulid",
1981
- check: "string_format",
1982
- abort: !1,
1983
- ...d(t)
1984
- });
1985
- }
1986
- // @__NO_SIDE_EFFECTS__
1987
- function Qr(e, t) {
1988
- return new e({
1989
- type: "string",
1990
- format: "xid",
1991
- check: "string_format",
1992
- abort: !1,
1993
- ...d(t)
1994
- });
1995
- }
1996
- // @__NO_SIDE_EFFECTS__
1997
- function eo(e, t) {
1998
- return new e({
1999
- type: "string",
2000
- format: "ksuid",
2001
- check: "string_format",
2002
- abort: !1,
2003
- ...d(t)
2004
- });
2005
- }
2006
- // @__NO_SIDE_EFFECTS__
2007
- function to(e, t) {
2008
- return new e({
2009
- type: "string",
2010
- format: "ipv4",
2011
- check: "string_format",
2012
- abort: !1,
2013
- ...d(t)
2014
- });
2015
- }
2016
- // @__NO_SIDE_EFFECTS__
2017
- function no(e, t) {
2018
- return new e({
2019
- type: "string",
2020
- format: "ipv6",
2021
- check: "string_format",
2022
- abort: !1,
2023
- ...d(t)
2024
- });
2025
- }
2026
- // @__NO_SIDE_EFFECTS__
2027
- function ro(e, t) {
2028
- return new e({
2029
- type: "string",
2030
- format: "cidrv4",
2031
- check: "string_format",
2032
- abort: !1,
2033
- ...d(t)
2034
- });
2035
- }
2036
- // @__NO_SIDE_EFFECTS__
2037
- function oo(e, t) {
2038
- return new e({
2039
- type: "string",
2040
- format: "cidrv6",
2041
- check: "string_format",
2042
- abort: !1,
2043
- ...d(t)
2044
- });
2045
- }
2046
- // @__NO_SIDE_EFFECTS__
2047
- function so(e, t) {
2048
- return new e({
2049
- type: "string",
2050
- format: "base64",
2051
- check: "string_format",
2052
- abort: !1,
2053
- ...d(t)
2054
- });
2055
- }
2056
- // @__NO_SIDE_EFFECTS__
2057
- function io(e, t) {
2058
- return new e({
2059
- type: "string",
2060
- format: "base64url",
2061
- check: "string_format",
2062
- abort: !1,
2063
- ...d(t)
2064
- });
2065
- }
2066
- // @__NO_SIDE_EFFECTS__
2067
- function uo(e, t) {
2068
- return new e({
2069
- type: "string",
2070
- format: "e164",
2071
- check: "string_format",
2072
- abort: !1,
2073
- ...d(t)
2074
- });
2075
- }
2076
- // @__NO_SIDE_EFFECTS__
2077
- function co(e, t) {
2078
- return new e({
2079
- type: "string",
2080
- format: "jwt",
2081
- check: "string_format",
2082
- abort: !1,
2083
- ...d(t)
2084
- });
2085
- }
2086
- // @__NO_SIDE_EFFECTS__
2087
- function ao(e, t) {
2088
- return new e({
2089
- type: "string",
2090
- format: "datetime",
2091
- check: "string_format",
2092
- offset: !1,
2093
- local: !1,
2094
- precision: null,
2095
- ...d(t)
2096
- });
2097
- }
2098
- // @__NO_SIDE_EFFECTS__
2099
- function lo(e, t) {
2100
- return new e({
2101
- type: "string",
2102
- format: "date",
2103
- check: "string_format",
2104
- ...d(t)
2105
- });
2106
- }
2107
- // @__NO_SIDE_EFFECTS__
2108
- function fo(e, t) {
2109
- return new e({
2110
- type: "string",
2111
- format: "time",
2112
- check: "string_format",
2113
- precision: null,
2114
- ...d(t)
2115
- });
2116
- }
2117
- // @__NO_SIDE_EFFECTS__
2118
- function po(e, t) {
2119
- return new e({
2120
- type: "string",
2121
- format: "duration",
2122
- check: "string_format",
2123
- ...d(t)
2124
- });
2125
- }
2126
- // @__NO_SIDE_EFFECTS__
2127
- function ho(e, t) {
2128
- return new e({
2129
- type: "number",
2130
- checks: [],
2131
- ...d(t)
2132
- });
2133
- }
2134
- // @__NO_SIDE_EFFECTS__
2135
- function mo(e, t) {
2136
- return new e({
2137
- type: "number",
2138
- check: "number_format",
2139
- abort: !1,
2140
- format: "safeint",
2141
- ...d(t)
2142
- });
2143
- }
2144
- // @__NO_SIDE_EFFECTS__
2145
- function _o(e, t) {
2146
- return new e({
2147
- type: "boolean",
2148
- ...d(t)
2149
- });
2150
- }
2151
- // @__NO_SIDE_EFFECTS__
2152
- function go(e, t) {
2153
- return new e({
2154
- type: "null",
2155
- ...d(t)
2156
- });
2157
- }
2158
- // @__NO_SIDE_EFFECTS__
2159
- function vo(e) {
2160
- return new e({
2161
- type: "any"
2162
- });
2163
- }
2164
- // @__NO_SIDE_EFFECTS__
2165
- function zo(e) {
2166
- return new e({
2167
- type: "unknown"
2168
- });
2169
- }
2170
- // @__NO_SIDE_EFFECTS__
2171
- function yo(e, t) {
2172
- return new e({
2173
- type: "never",
2174
- ...d(t)
2175
- });
2176
- }
2177
- // @__NO_SIDE_EFFECTS__
2178
- function bo(e, t) {
2179
- return new e({
2180
- type: "void",
2181
- ...d(t)
2182
- });
2183
- }
2184
- // @__NO_SIDE_EFFECTS__
2185
- function wo(e, t) {
2186
- return new e({
2187
- type: "date",
2188
- ...d(t)
2189
- });
2190
- }
2191
- // @__NO_SIDE_EFFECTS__
2192
- function De(e, t) {
2193
- return new ot({
2194
- check: "less_than",
2195
- ...d(t),
2196
- value: e,
2197
- inclusive: !1
2198
- });
2199
- }
2200
- // @__NO_SIDE_EFFECTS__
2201
- function Y(e, t) {
2202
- return new ot({
2203
- check: "less_than",
2204
- ...d(t),
2205
- value: e,
2206
- inclusive: !0
2207
- });
2208
- }
2209
- // @__NO_SIDE_EFFECTS__
2210
- function Ce(e, t) {
2211
- return new st({
2212
- check: "greater_than",
2213
- ...d(t),
2214
- value: e,
2215
- inclusive: !1
2216
- });
2217
- }
2218
- // @__NO_SIDE_EFFECTS__
2219
- function q(e, t) {
2220
- return new st({
2221
- check: "greater_than",
2222
- ...d(t),
2223
- value: e,
2224
- inclusive: !0
2225
- });
2226
- }
2227
- // @__NO_SIDE_EFFECTS__
2228
- function xe(e, t) {
2229
- return new On({
2230
- check: "multiple_of",
2231
- ...d(t),
2232
- value: e
2233
- });
2234
- }
2235
- // @__NO_SIDE_EFFECTS__
2236
- function dt(e, t) {
2237
- return new Tn({
2238
- check: "max_length",
2239
- ...d(t),
2240
- maximum: e
2241
- });
2242
- }
2243
- // @__NO_SIDE_EFFECTS__
2244
- function H(e, t) {
2245
- return new En({
2246
- check: "min_length",
2247
- ...d(t),
2248
- minimum: e
2249
- });
2250
- }
2251
- // @__NO_SIDE_EFFECTS__
2252
- function ht(e, t) {
2253
- return new Pn({
2254
- check: "length_equals",
2255
- ...d(t),
2256
- length: e
2257
- });
2258
- }
2259
- // @__NO_SIDE_EFFECTS__
2260
- function ko(e, t) {
2261
- return new Nn({
2262
- check: "string_format",
2263
- format: "regex",
2264
- ...d(t),
2265
- pattern: e
2266
- });
2267
- }
2268
- // @__NO_SIDE_EFFECTS__
2269
- function $o(e) {
2270
- return new jn({
2271
- check: "string_format",
2272
- format: "lowercase",
2273
- ...d(e)
2274
- });
2275
- }
2276
- // @__NO_SIDE_EFFECTS__
2277
- function Zo(e) {
2278
- return new An({
2279
- check: "string_format",
2280
- format: "uppercase",
2281
- ...d(e)
2282
- });
2283
- }
2284
- // @__NO_SIDE_EFFECTS__
2285
- function So(e, t) {
2286
- return new Rn({
2287
- check: "string_format",
2288
- format: "includes",
2289
- ...d(t),
2290
- includes: e
2291
- });
2292
- }
2293
- // @__NO_SIDE_EFFECTS__
2294
- function Oo(e, t) {
2295
- return new Dn({
2296
- check: "string_format",
2297
- format: "starts_with",
2298
- ...d(t),
2299
- prefix: e
2300
- });
2301
- }
2302
- // @__NO_SIDE_EFFECTS__
2303
- function Io(e, t) {
2304
- return new Cn({
2305
- check: "string_format",
2306
- format: "ends_with",
2307
- ...d(t),
2308
- suffix: e
2309
- });
2310
- }
2311
- // @__NO_SIDE_EFFECTS__
2312
- function F(e) {
2313
- return new xn({
2314
- check: "overwrite",
2315
- tx: e
2316
- });
2317
- }
2318
- // @__NO_SIDE_EFFECTS__
2319
- function To(e) {
2320
- return /* @__PURE__ */ F((t) => t.normalize(e));
2321
- }
2322
- // @__NO_SIDE_EFFECTS__
2323
- function Eo() {
2324
- return /* @__PURE__ */ F((e) => e.trim());
2325
- }
2326
- // @__NO_SIDE_EFFECTS__
2327
- function Po() {
2328
- return /* @__PURE__ */ F((e) => e.toLowerCase());
2329
- }
2330
- // @__NO_SIDE_EFFECTS__
2331
- function No() {
2332
- return /* @__PURE__ */ F((e) => e.toUpperCase());
2333
- }
2334
- // @__NO_SIDE_EFFECTS__
2335
- function jo() {
2336
- return /* @__PURE__ */ F((e) => It(e));
2337
- }
2338
- // @__NO_SIDE_EFFECTS__
2339
- function Ao(e, t, n) {
2340
- return new e({
2341
- type: "array",
2342
- element: t,
2343
- // get element() {
2344
- // return element;
2345
- // },
2346
- ...d(n)
2347
- });
2348
- }
2349
- // @__NO_SIDE_EFFECTS__
2350
- function Ro(e, t, n) {
2351
- const r = d(n);
2352
- return r.abort ?? (r.abort = !0), new e({
2353
- type: "custom",
2354
- check: "custom",
2355
- fn: t,
2356
- ...r
2357
- });
2358
- }
2359
- // @__NO_SIDE_EFFECTS__
2360
- function Do(e, t, n) {
2361
- return new e({
2362
- type: "custom",
2363
- check: "custom",
2364
- fn: t,
2365
- ...d(n)
2366
- });
2367
- }
2368
- // @__NO_SIDE_EFFECTS__
2369
- function Co(e, t) {
2370
- const n = /* @__PURE__ */ xo((r) => (r.addIssue = (o) => {
2371
- if (typeof o == "string")
2372
- r.issues.push(V(o, r.value, n._zod.def));
2373
- else {
2374
- const i = o;
2375
- i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = r.value), i.inst ?? (i.inst = n), i.continue ?? (i.continue = !n._zod.def.abort), r.issues.push(V(i));
2376
- }
2377
- }, e(r.value, r)), t);
2378
- return n;
2379
- }
2380
- // @__NO_SIDE_EFFECTS__
2381
- function xo(e, t) {
2382
- const n = new O({
2383
- check: "custom",
2384
- ...d(t)
2385
- });
2386
- return n._zod.check = e, n;
2387
- }
2388
- function mt(e) {
2389
- let t = e?.target ?? "draft-2020-12";
2390
- return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
2391
- processors: e.processors ?? {},
2392
- metadataRegistry: e?.metadata ?? M,
2393
- target: t,
2394
- unrepresentable: e?.unrepresentable ?? "throw",
2395
- override: e?.override ?? (() => {
2396
- }),
2397
- io: e?.io ?? "output",
2398
- counter: 0,
2399
- seen: /* @__PURE__ */ new Map(),
2400
- cycles: e?.cycles ?? "ref",
2401
- reused: e?.reused ?? "inline",
2402
- external: e?.external ?? void 0
2403
- };
2404
- }
2405
- function b(e, t, n = { path: [], schemaPath: [] }) {
2406
- var r;
2407
- const o = e._zod.def, i = t.seen.get(e);
2408
- if (i)
2409
- return i.count++, n.schemaPath.includes(e) && (i.cycle = n.path), i.schema;
2410
- const s = { schema: {}, count: 1, cycle: void 0, path: n.path };
2411
- t.seen.set(e, s);
2412
- const u = e._zod.toJSONSchema?.();
2413
- if (u)
2414
- s.schema = u;
2415
- else {
2416
- const f = {
2417
- ...n,
2418
- schemaPath: [...n.schemaPath, e],
2419
- path: n.path
2420
- };
2421
- if (e._zod.processJSONSchema)
2422
- e._zod.processJSONSchema(t, s.schema, f);
2423
- else {
2424
- const m = s.schema, h = t.processors[o.type];
2425
- if (!h)
2426
- throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
2427
- h(e, t, m, f);
2428
- }
2429
- const p = e._zod.parent;
2430
- p && (s.ref || (s.ref = p), b(p, t, f), t.seen.get(p).isParent = !0);
2431
- }
2432
- const c = t.metadataRegistry.get(e);
2433
- return c && Object.assign(s.schema, c), t.io === "input" && S(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && "_prefault" in s.schema && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
2434
- }
2435
- function _t(e, t) {
2436
- const n = e.seen.get(t);
2437
- if (!n)
2438
- throw new Error("Unprocessed schema. This is a bug in Zod.");
2439
- const r = /* @__PURE__ */ new Map();
2440
- for (const s of e.seen.entries()) {
2441
- const u = e.metadataRegistry.get(s[0])?.id;
2442
- if (u) {
2443
- const c = r.get(u);
2444
- if (c && c !== s[0])
2445
- throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2446
- r.set(u, s[0]);
2447
- }
2448
- }
2449
- const o = (s) => {
2450
- const u = e.target === "draft-2020-12" ? "$defs" : "definitions";
2451
- if (e.external) {
2452
- const p = e.external.registry.get(s[0])?.id, m = e.external.uri ?? ((g) => g);
2453
- if (p)
2454
- return { ref: m(p) };
2455
- const h = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
2456
- return s[1].defId = h, { defId: h, ref: `${m("__shared")}#/${u}/${h}` };
2457
- }
2458
- if (s[1] === n)
2459
- return { ref: "#" };
2460
- const a = `#/${u}/`, f = s[1].schema.id ?? `__schema${e.counter++}`;
2461
- return { defId: f, ref: a + f };
2462
- }, i = (s) => {
2463
- if (s[1].schema.$ref)
2464
- return;
2465
- const u = s[1], { ref: c, defId: a } = o(s);
2466
- u.def = { ...u.schema }, a && (u.defId = a);
2467
- const f = u.schema;
2468
- for (const p in f)
2469
- delete f[p];
2470
- f.$ref = c;
2471
- };
2472
- if (e.cycles === "throw")
2473
- for (const s of e.seen.entries()) {
2474
- const u = s[1];
2475
- if (u.cycle)
2476
- throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
2477
-
2478
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2479
- }
2480
- for (const s of e.seen.entries()) {
2481
- const u = s[1];
2482
- if (t === s[0]) {
2483
- i(s);
2484
- continue;
2485
- }
2486
- if (e.external) {
2487
- const a = e.external.registry.get(s[0])?.id;
2488
- if (t !== s[0] && a) {
2489
- i(s);
2490
- continue;
2491
- }
2492
- }
2493
- if (e.metadataRegistry.get(s[0])?.id) {
2494
- i(s);
2495
- continue;
2496
- }
2497
- if (u.cycle) {
2498
- i(s);
2499
- continue;
2500
- }
2501
- if (u.count > 1 && e.reused === "ref") {
2502
- i(s);
2503
- continue;
2504
- }
2505
- }
2506
- }
2507
- function gt(e, t) {
2508
- const n = e.seen.get(t);
2509
- if (!n)
2510
- throw new Error("Unprocessed schema. This is a bug in Zod.");
2511
- const r = (u) => {
2512
- const c = e.seen.get(u);
2513
- if (c.ref === null)
2514
- return;
2515
- const a = c.def ?? c.schema, f = { ...a }, p = c.ref;
2516
- if (c.ref = null, p) {
2517
- r(p);
2518
- const h = e.seen.get(p), g = h.schema;
2519
- if (g.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (a.allOf = a.allOf ?? [], a.allOf.push(g)) : Object.assign(a, g), Object.assign(a, f), u._zod.parent === p)
2520
- for (const $ in a)
2521
- $ === "$ref" || $ === "allOf" || $ in f || delete a[$];
2522
- if (g.$ref && h.def)
2523
- for (const $ in a)
2524
- $ === "$ref" || $ === "allOf" || $ in h.def && JSON.stringify(a[$]) === JSON.stringify(h.def[$]) && delete a[$];
2525
- }
2526
- const m = u._zod.parent;
2527
- if (m && m !== p) {
2528
- r(m);
2529
- const h = e.seen.get(m);
2530
- if (h?.schema.$ref && (a.$ref = h.schema.$ref, h.def))
2531
- for (const g in a)
2532
- g === "$ref" || g === "allOf" || g in h.def && JSON.stringify(a[g]) === JSON.stringify(h.def[g]) && delete a[g];
2533
- }
2534
- e.override({
2535
- zodSchema: u,
2536
- jsonSchema: a,
2537
- path: c.path ?? []
2538
- });
2539
- };
2540
- for (const u of [...e.seen.entries()].reverse())
2541
- r(u[0]);
2542
- const o = {};
2543
- 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) {
2544
- const u = e.external.registry.get(t)?.id;
2545
- if (!u)
2546
- throw new Error("Schema is missing an `id` property");
2547
- o.$id = e.external.uri(u);
2548
- }
2549
- Object.assign(o, n.def ?? n.schema);
2550
- const i = e.metadataRegistry.get(t)?.id;
2551
- i !== void 0 && o.id === i && delete o.id;
2552
- const s = e.external?.defs ?? {};
2553
- for (const u of e.seen.entries()) {
2554
- const c = u[1];
2555
- c.def && c.defId && (c.def.id === c.defId && delete c.def.id, s[c.defId] = c.def);
2556
- }
2557
- e.external || Object.keys(s).length > 0 && (e.target === "draft-2020-12" ? o.$defs = s : o.definitions = s);
2558
- try {
2559
- const u = JSON.parse(JSON.stringify(o));
2560
- return Object.defineProperty(u, "~standard", {
2561
- value: {
2562
- ...t["~standard"],
2563
- jsonSchema: {
2564
- input: Q(t, "input", e.processors),
2565
- output: Q(t, "output", e.processors)
2566
- }
2567
- },
2568
- enumerable: !1,
2569
- writable: !1
2570
- }), u;
2571
- } catch {
2572
- throw new Error("Error converting schema to JSON.");
2573
- }
2574
- }
2575
- function S(e, t) {
2576
- const n = t ?? { seen: /* @__PURE__ */ new Set() };
2577
- if (n.seen.has(e))
2578
- return !1;
2579
- n.seen.add(e);
2580
- const r = e._zod.def;
2581
- if (r.type === "transform")
2582
- return !0;
2583
- if (r.type === "array")
2584
- return S(r.element, n);
2585
- if (r.type === "set")
2586
- return S(r.valueType, n);
2587
- if (r.type === "lazy")
2588
- return S(r.getter(), n);
2589
- if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
2590
- return S(r.innerType, n);
2591
- if (r.type === "intersection")
2592
- return S(r.left, n) || S(r.right, n);
2593
- if (r.type === "record" || r.type === "map")
2594
- return S(r.keyType, n) || S(r.valueType, n);
2595
- if (r.type === "pipe")
2596
- return e._zod.traits.has("$ZodCodec") ? !0 : S(r.in, n) || S(r.out, n);
2597
- if (r.type === "object") {
2598
- for (const o in r.shape)
2599
- if (S(r.shape[o], n))
2600
- return !0;
2601
- return !1;
2602
- }
2603
- if (r.type === "union") {
2604
- for (const o of r.options)
2605
- if (S(o, n))
2606
- return !0;
2607
- return !1;
2608
- }
2609
- if (r.type === "tuple") {
2610
- for (const o of r.items)
2611
- if (S(o, n))
2612
- return !0;
2613
- return !!(r.rest && S(r.rest, n));
2614
- }
2615
- return !1;
2616
- }
2617
- const Uo = (e, t = {}) => (n) => {
2618
- const r = mt({ ...n, processors: t });
2619
- return b(e, r), _t(r, e), gt(r, e);
2620
- }, Q = (e, t, n = {}) => (r) => {
2621
- const { libraryOptions: o, target: i } = r ?? {}, s = mt({ ...o ?? {}, target: i, io: t, processors: n });
2622
- return b(e, s), _t(s, e), gt(s, e);
2623
- }, Fo = {
2624
- guid: "uuid",
2625
- url: "uri",
2626
- datetime: "date-time",
2627
- json_string: "json-string",
2628
- regex: ""
2629
- // do not set
2630
- }, Jo = (e, t, n, r) => {
2631
- const o = n;
2632
- o.type = "string";
2633
- const { minimum: i, maximum: s, format: u, patterns: c, contentEncoding: a } = e._zod.bag;
2634
- if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), u && (o.format = Fo[u] ?? u, o.format === "" && delete o.format, u === "time" && delete o.format), a && (o.contentEncoding = a), c && c.size > 0) {
2635
- const f = [...c];
2636
- f.length === 1 ? o.pattern = f[0].source : f.length > 1 && (o.allOf = [
2637
- ...f.map((p) => ({
2638
- ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
2639
- pattern: p.source
2640
- }))
2641
- ]);
2642
- }
2643
- }, Mo = (e, t, n, r) => {
2644
- const o = n, { minimum: i, maximum: s, format: u, multipleOf: c, exclusiveMaximum: a, exclusiveMinimum: f } = e._zod.bag;
2645
- typeof u == "string" && u.includes("int") ? o.type = "integer" : o.type = "number";
2646
- const p = typeof f == "number" && f >= (i ?? Number.NEGATIVE_INFINITY), m = typeof a == "number" && a <= (s ?? Number.POSITIVE_INFINITY), h = t.target === "draft-04" || t.target === "openapi-3.0";
2647
- p ? h ? (o.minimum = f, o.exclusiveMinimum = !0) : o.exclusiveMinimum = f : typeof i == "number" && (o.minimum = i), m ? h ? (o.maximum = a, o.exclusiveMaximum = !0) : o.exclusiveMaximum = a : typeof s == "number" && (o.maximum = s), typeof c == "number" && (o.multipleOf = c);
2648
- }, Lo = (e, t, n, r) => {
2649
- n.type = "boolean";
2650
- }, Vo = (e, t, n, r) => {
2651
- t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
2652
- }, Bo = (e, t, n, r) => {
2653
- if (t.unrepresentable === "throw")
2654
- throw new Error("Void cannot be represented in JSON Schema");
2655
- }, Wo = (e, t, n, r) => {
2656
- n.not = {};
2657
- }, Ko = (e, t, n, r) => {
2658
- }, Go = (e, t, n, r) => {
2659
- }, Yo = (e, t, n, r) => {
2660
- if (t.unrepresentable === "throw")
2661
- throw new Error("Date cannot be represented in JSON Schema");
2662
- }, qo = (e, t, n, r) => {
2663
- const o = e._zod.def, i = Ke(o.entries);
2664
- i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), n.enum = i;
2665
- }, Xo = (e, t, n, r) => {
2666
- const o = e._zod.def, i = [];
2667
- for (const s of o.values)
2668
- if (s === void 0) {
2669
- if (t.unrepresentable === "throw")
2670
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
2671
- } else if (typeof s == "bigint") {
2672
- if (t.unrepresentable === "throw")
2673
- throw new Error("BigInt literals cannot be represented in JSON Schema");
2674
- i.push(Number(s));
2675
- } else
2676
- i.push(s);
2677
- if (i.length !== 0) if (i.length === 1) {
2678
- const s = i[0];
2679
- n.type = s === null ? "null" : typeof s, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [s] : n.const = s;
2680
- } else
2681
- i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), i.every((s) => typeof s == "boolean") && (n.type = "boolean"), i.every((s) => s === null) && (n.type = "null"), n.enum = i;
2682
- }, Ho = (e, t, n, r) => {
2683
- if (t.unrepresentable === "throw")
2684
- throw new Error("Custom types cannot be represented in JSON Schema");
2685
- }, Qo = (e, t, n, r) => {
2686
- if (t.unrepresentable === "throw")
2687
- throw new Error("Transforms cannot be represented in JSON Schema");
2688
- }, es = (e, t, n, r) => {
2689
- const o = n, i = e._zod.def, { minimum: s, maximum: u } = e._zod.bag;
2690
- typeof s == "number" && (o.minItems = s), typeof u == "number" && (o.maxItems = u), o.type = "array", o.items = b(i.element, t, {
2691
- ...r,
2692
- path: [...r.path, "items"]
2693
- });
2694
- }, ts = (e, t, n, r) => {
2695
- const o = n, i = e._zod.def;
2696
- o.type = "object", o.properties = {};
2697
- const s = i.shape;
2698
- for (const a in s)
2699
- o.properties[a] = b(s[a], t, {
2700
- ...r,
2701
- path: [...r.path, "properties", a]
2702
- });
2703
- const u = new Set(Object.keys(s)), c = new Set([...u].filter((a) => {
2704
- const f = i.shape[a]._zod;
2705
- return t.io === "input" ? f.optin === void 0 : f.optout === void 0;
2706
- }));
2707
- c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties = b(i.catchall, t, {
2708
- ...r,
2709
- path: [...r.path, "additionalProperties"]
2710
- })) : t.io === "output" && (o.additionalProperties = !1);
2711
- }, ns = (e, t, n, r) => {
2712
- const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((u, c) => b(u, t, {
2713
- ...r,
2714
- path: [...r.path, i ? "oneOf" : "anyOf", c]
2715
- }));
2716
- i ? n.oneOf = s : n.anyOf = s;
2717
- }, rs = (e, t, n, r) => {
2718
- const o = e._zod.def, i = b(o.left, t, {
2719
- ...r,
2720
- path: [...r.path, "allOf", 0]
2721
- }), s = b(o.right, t, {
2722
- ...r,
2723
- path: [...r.path, "allOf", 1]
2724
- }), u = (a) => "allOf" in a && Object.keys(a).length === 1, c = [
2725
- ...u(i) ? i.allOf : [i],
2726
- ...u(s) ? s.allOf : [s]
2727
- ];
2728
- n.allOf = c;
2729
- }, os = (e, t, n, r) => {
2730
- const o = n, i = e._zod.def;
2731
- o.type = "array";
2732
- const s = t.target === "draft-2020-12" ? "prefixItems" : "items", u = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = i.items.map((m, h) => b(m, t, {
2733
- ...r,
2734
- path: [...r.path, s, h]
2735
- })), a = i.rest ? b(i.rest, t, {
2736
- ...r,
2737
- path: [...r.path, u, ...t.target === "openapi-3.0" ? [i.items.length] : []]
2738
- }) : null;
2739
- t.target === "draft-2020-12" ? (o.prefixItems = c, a && (o.items = a)) : t.target === "openapi-3.0" ? (o.items = {
2740
- anyOf: c
2741
- }, a && o.items.anyOf.push(a), o.minItems = c.length, a || (o.maxItems = c.length)) : (o.items = c, a && (o.additionalItems = a));
2742
- const { minimum: f, maximum: p } = e._zod.bag;
2743
- typeof f == "number" && (o.minItems = f), typeof p == "number" && (o.maxItems = p);
2744
- }, ss = (e, t, n, r) => {
2745
- const o = n, i = e._zod.def;
2746
- o.type = "object";
2747
- const s = i.keyType, c = s._zod.bag?.patterns;
2748
- if (i.mode === "loose" && c && c.size > 0) {
2749
- const f = b(i.valueType, t, {
2750
- ...r,
2751
- path: [...r.path, "patternProperties", "*"]
2752
- });
2753
- o.patternProperties = {};
2754
- for (const p of c)
2755
- o.patternProperties[p.source] = f;
2756
- } else
2757
- (t.target === "draft-07" || t.target === "draft-2020-12") && (o.propertyNames = b(i.keyType, t, {
2758
- ...r,
2759
- path: [...r.path, "propertyNames"]
2760
- })), o.additionalProperties = b(i.valueType, t, {
2761
- ...r,
2762
- path: [...r.path, "additionalProperties"]
2763
- });
2764
- const a = s._zod.values;
2765
- if (a) {
2766
- const f = [...a].filter((p) => typeof p == "string" || typeof p == "number");
2767
- f.length > 0 && (o.required = f);
2768
- }
2769
- }, is = (e, t, n, r) => {
2770
- const o = e._zod.def, i = b(o.innerType, t, r), s = t.seen.get(e);
2771
- t.target === "openapi-3.0" ? (s.ref = o.innerType, n.nullable = !0) : n.anyOf = [i, { type: "null" }];
2772
- }, us = (e, t, n, r) => {
2773
- const o = e._zod.def;
2774
- b(o.innerType, t, r);
2775
- const i = t.seen.get(e);
2776
- i.ref = o.innerType;
2777
- }, cs = (e, t, n, r) => {
2778
- const o = e._zod.def;
2779
- b(o.innerType, t, r);
2780
- const i = t.seen.get(e);
2781
- i.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
2782
- }, as = (e, t, n, r) => {
2783
- const o = e._zod.def;
2784
- b(o.innerType, t, r);
2785
- const i = t.seen.get(e);
2786
- i.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
2787
- }, ls = (e, t, n, r) => {
2788
- const o = e._zod.def;
2789
- b(o.innerType, t, r);
2790
- const i = t.seen.get(e);
2791
- i.ref = o.innerType;
2792
- let s;
2793
- try {
2794
- s = o.catchValue(void 0);
2795
- } catch {
2796
- throw new Error("Dynamic catch values are not supported in JSON Schema");
2797
- }
2798
- n.default = s;
2799
- }, fs = (e, t, n, r) => {
2800
- const o = e._zod.def, i = o.in._zod.traits.has("$ZodTransform"), s = t.io === "input" ? i ? o.out : o.in : o.out;
2801
- b(s, t, r);
2802
- const u = t.seen.get(e);
2803
- u.ref = s;
2804
- }, ps = (e, t, n, r) => {
2805
- const o = e._zod.def;
2806
- b(o.innerType, t, r);
2807
- const i = t.seen.get(e);
2808
- i.ref = o.innerType, n.readOnly = !0;
2809
- }, vt = (e, t, n, r) => {
2810
- const o = e._zod.def;
2811
- b(o.innerType, t, r);
2812
- const i = t.seen.get(e);
2813
- i.ref = o.innerType;
2814
- }, ds = (e, t, n, r) => {
2815
- const o = e._zod.innerType;
2816
- b(o, t, r);
2817
- const i = t.seen.get(e);
2818
- i.ref = o;
2819
- }, hs = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
2820
- Hn.init(e, t), w.init(e, t);
2821
- });
2822
- function ms(e) {
2823
- return /* @__PURE__ */ ao(hs, e);
2824
- }
2825
- const _s = /* @__PURE__ */ l("ZodISODate", (e, t) => {
2826
- Qn.init(e, t), w.init(e, t);
2827
- });
2828
- function gs(e) {
2829
- return /* @__PURE__ */ lo(_s, e);
2830
- }
2831
- const vs = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
2832
- er.init(e, t), w.init(e, t);
2833
- });
2834
- function zs(e) {
2835
- return /* @__PURE__ */ fo(vs, e);
2836
- }
2837
- const ys = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
2838
- tr.init(e, t), w.init(e, t);
2839
- });
2840
- function bs(e) {
2841
- return /* @__PURE__ */ po(ys, e);
2842
- }
2843
- const ws = (e, t) => {
2844
- Xe.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2845
- format: {
2846
- value: (n) => Mt(e, n)
2847
- // enumerable: false,
2848
- },
2849
- flatten: {
2850
- value: (n) => Jt(e, n)
2851
- // enumerable: false,
2852
- },
2853
- addIssue: {
2854
- value: (n) => {
2855
- e.issues.push(n), e.message = JSON.stringify(e.issues, se, 2);
2856
- }
2857
- // enumerable: false,
2858
- },
2859
- addIssues: {
2860
- value: (n) => {
2861
- e.issues.push(...n), e.message = JSON.stringify(e.issues, se, 2);
2862
- }
2863
- // enumerable: false,
2864
- },
2865
- isEmpty: {
2866
- get() {
2867
- return e.issues.length === 0;
2868
- }
2869
- // enumerable: false,
2870
- }
2871
- });
2872
- }, I = /* @__PURE__ */ l("ZodError", ws, {
2873
- Parent: Error
2874
- }), ks = /* @__PURE__ */ de(I), $s = /* @__PURE__ */ he(I), Zs = /* @__PURE__ */ te(I), Ss = /* @__PURE__ */ ne(I), Os = /* @__PURE__ */ Bt(I), Is = /* @__PURE__ */ Wt(I), Ts = /* @__PURE__ */ Kt(I), Es = /* @__PURE__ */ Gt(I), Ps = /* @__PURE__ */ Yt(I), Ns = /* @__PURE__ */ qt(I), js = /* @__PURE__ */ Xt(I), As = /* @__PURE__ */ Ht(I), Ue = /* @__PURE__ */ new WeakMap();
2875
- function B(e, t, n) {
2876
- const r = Object.getPrototypeOf(e);
2877
- let o = Ue.get(r);
2878
- if (o || (o = /* @__PURE__ */ new Set(), Ue.set(r, o)), !o.has(t)) {
2879
- o.add(t);
2880
- for (const i in n) {
2881
- const s = n[i];
2882
- Object.defineProperty(r, i, {
2883
- configurable: !0,
2884
- enumerable: !1,
2885
- get() {
2886
- const u = s.bind(this);
2887
- return Object.defineProperty(this, i, {
2888
- configurable: !0,
2889
- writable: !0,
2890
- enumerable: !0,
2891
- value: u
2892
- }), u;
2893
- },
2894
- set(u) {
2895
- Object.defineProperty(this, i, {
2896
- configurable: !0,
2897
- writable: !0,
2898
- enumerable: !0,
2899
- value: u
2900
- });
2901
- }
2902
- });
2903
- }
2904
- }
2905
- }
2906
- const z = /* @__PURE__ */ l("ZodType", (e, t) => (v.init(e, t), Object.assign(e["~standard"], {
2907
- jsonSchema: {
2908
- input: Q(e, "input"),
2909
- output: Q(e, "output")
2910
- }
2911
- }), e.toJSONSchema = Uo(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (n, r) => ks(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Zs(e, n, r), e.parseAsync = async (n, r) => $s(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Ss(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Os(e, n, r), e.decode = (n, r) => Is(e, n, r), e.encodeAsync = async (n, r) => Ts(e, n, r), e.decodeAsync = async (n, r) => Es(e, n, r), e.safeEncode = (n, r) => Ps(e, n, r), e.safeDecode = (n, r) => Ns(e, n, r), e.safeEncodeAsync = async (n, r) => js(e, n, r), e.safeDecodeAsync = async (n, r) => As(e, n, r), B(e, "ZodType", {
2912
- check(...n) {
2913
- const r = this.def;
2914
- return this.clone(A(r, {
2915
- checks: [
2916
- ...r.checks ?? [],
2917
- ...n.map((o) => typeof o == "function" ? { _zod: { check: o, def: { check: "custom" }, onattach: [] } } : o)
2918
- ]
2919
- }), { parent: !0 });
2920
- },
2921
- with(...n) {
2922
- return this.check(...n);
2923
- },
2924
- clone(n, r) {
2925
- return N(this, n, r);
2926
- },
2927
- brand() {
2928
- return this;
2929
- },
2930
- register(n, r) {
2931
- return n.add(this, r), this;
2932
- },
2933
- refine(n, r) {
2934
- return this.check(Ai(n, r));
2935
- },
2936
- superRefine(n, r) {
2937
- return this.check(Ri(n, r));
2938
- },
2939
- overwrite(n) {
2940
- return this.check(/* @__PURE__ */ F(n));
2941
- },
2942
- optional() {
2943
- return Le(this);
2944
- },
2945
- exactOptional() {
2946
- return bi(this);
2947
- },
2948
- nullable() {
2949
- return Ve(this);
2950
- },
2951
- nullish() {
2952
- return Le(Ve(this));
2953
- },
2954
- nonoptional(n) {
2955
- return Oi(this, n);
2956
- },
2957
- array() {
2958
- return ai(this);
2959
- },
2960
- or(n) {
2961
- return fi([this, n]);
2962
- },
2963
- and(n) {
2964
- return hi(this, n);
2965
- },
2966
- transform(n) {
2967
- return Be(this, zi(n));
2968
- },
2969
- default(n) {
2970
- return $i(this, n);
2971
- },
2972
- prefault(n) {
2973
- return Si(this, n);
2974
- },
2975
- catch(n) {
2976
- return Ti(this, n);
2977
- },
2978
- pipe(n) {
2979
- return Be(this, n);
2980
- },
2981
- readonly() {
2982
- return Ni(this);
2983
- },
2984
- describe(n) {
2985
- const r = this.clone();
2986
- return M.add(r, { description: n }), r;
2987
- },
2988
- meta(...n) {
2989
- if (n.length === 0)
2990
- return M.get(this);
2991
- const r = this.clone();
2992
- return M.add(r, n[0]), r;
2993
- },
2994
- isOptional() {
2995
- return this.safeParse(void 0).success;
2996
- },
2997
- isNullable() {
2998
- return this.safeParse(null).success;
2999
- },
3000
- apply(n) {
3001
- return n(this);
3002
- }
3003
- }), Object.defineProperty(e, "description", {
3004
- get() {
3005
- return M.get(e)?.description;
3006
- },
3007
- configurable: !0
3008
- }), e)), zt = /* @__PURE__ */ l("_ZodString", (e, t) => {
3009
- me.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, i) => Jo(e, r, o);
3010
- const n = e._zod.bag;
3011
- e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, B(e, "_ZodString", {
3012
- regex(...r) {
3013
- return this.check(/* @__PURE__ */ ko(...r));
3014
- },
3015
- includes(...r) {
3016
- return this.check(/* @__PURE__ */ So(...r));
3017
- },
3018
- startsWith(...r) {
3019
- return this.check(/* @__PURE__ */ Oo(...r));
3020
- },
3021
- endsWith(...r) {
3022
- return this.check(/* @__PURE__ */ Io(...r));
3023
- },
3024
- min(...r) {
3025
- return this.check(/* @__PURE__ */ H(...r));
3026
- },
3027
- max(...r) {
3028
- return this.check(/* @__PURE__ */ dt(...r));
3029
- },
3030
- length(...r) {
3031
- return this.check(/* @__PURE__ */ ht(...r));
3032
- },
3033
- nonempty(...r) {
3034
- return this.check(/* @__PURE__ */ H(1, ...r));
3035
- },
3036
- lowercase(r) {
3037
- return this.check(/* @__PURE__ */ $o(r));
3038
- },
3039
- uppercase(r) {
3040
- return this.check(/* @__PURE__ */ Zo(r));
3041
- },
3042
- trim() {
3043
- return this.check(/* @__PURE__ */ Eo());
3044
- },
3045
- normalize(...r) {
3046
- return this.check(/* @__PURE__ */ To(...r));
3047
- },
3048
- toLowerCase() {
3049
- return this.check(/* @__PURE__ */ Po());
3050
- },
3051
- toUpperCase() {
3052
- return this.check(/* @__PURE__ */ No());
3053
- },
3054
- slugify() {
3055
- return this.check(/* @__PURE__ */ jo());
3056
- }
3057
- });
3058
- }), Rs = /* @__PURE__ */ l("ZodString", (e, t) => {
3059
- me.init(e, t), zt.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ pt(yt, n)), e.url = (n) => e.check(/* @__PURE__ */ Kr(Cs, n)), e.jwt = (n) => e.check(/* @__PURE__ */ co(Hs, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Gr(xs, n)), e.guid = (n) => e.check(/* @__PURE__ */ Re(Fe, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Lr(G, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Vr(G, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Br(G, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Wr(G, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Yr(Us, n)), e.guid = (n) => e.check(/* @__PURE__ */ Re(Fe, n)), e.cuid = (n) => e.check(/* @__PURE__ */ qr(Fs, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Xr(Js, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Hr(Ms, n)), e.base64 = (n) => e.check(/* @__PURE__ */ so(Ys, n)), e.base64url = (n) => e.check(/* @__PURE__ */ io(qs, n)), e.xid = (n) => e.check(/* @__PURE__ */ Qr(Ls, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ eo(Vs, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ to(Bs, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ no(Ws, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ ro(Ks, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ oo(Gs, n)), e.e164 = (n) => e.check(/* @__PURE__ */ uo(Xs, n)), e.datetime = (n) => e.check(ms(n)), e.date = (n) => e.check(gs(n)), e.time = (n) => e.check(zs(n)), e.duration = (n) => e.check(bs(n));
3060
- });
3061
- function Ds(e) {
3062
- return /* @__PURE__ */ Mr(Rs, e);
3063
- }
3064
- const w = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
3065
- y.init(e, t), zt.init(e, t);
3066
- }), yt = /* @__PURE__ */ l("ZodEmail", (e, t) => {
3067
- Ln.init(e, t), w.init(e, t);
3068
- });
3069
- function Di(e) {
3070
- return /* @__PURE__ */ pt(yt, e);
3071
- }
3072
- const Fe = /* @__PURE__ */ l("ZodGUID", (e, t) => {
3073
- Jn.init(e, t), w.init(e, t);
3074
- }), G = /* @__PURE__ */ l("ZodUUID", (e, t) => {
3075
- Mn.init(e, t), w.init(e, t);
3076
- }), Cs = /* @__PURE__ */ l("ZodURL", (e, t) => {
3077
- Vn.init(e, t), w.init(e, t);
3078
- }), xs = /* @__PURE__ */ l("ZodEmoji", (e, t) => {
3079
- Bn.init(e, t), w.init(e, t);
3080
- }), Us = /* @__PURE__ */ l("ZodNanoID", (e, t) => {
3081
- Wn.init(e, t), w.init(e, t);
3082
- }), Fs = /* @__PURE__ */ l("ZodCUID", (e, t) => {
3083
- Kn.init(e, t), w.init(e, t);
3084
- }), Js = /* @__PURE__ */ l("ZodCUID2", (e, t) => {
3085
- Gn.init(e, t), w.init(e, t);
3086
- }), Ms = /* @__PURE__ */ l("ZodULID", (e, t) => {
3087
- Yn.init(e, t), w.init(e, t);
3088
- }), Ls = /* @__PURE__ */ l("ZodXID", (e, t) => {
3089
- qn.init(e, t), w.init(e, t);
3090
- }), Vs = /* @__PURE__ */ l("ZodKSUID", (e, t) => {
3091
- Xn.init(e, t), w.init(e, t);
3092
- }), Bs = /* @__PURE__ */ l("ZodIPv4", (e, t) => {
3093
- nr.init(e, t), w.init(e, t);
3094
- }), Ws = /* @__PURE__ */ l("ZodIPv6", (e, t) => {
3095
- rr.init(e, t), w.init(e, t);
3096
- }), Ks = /* @__PURE__ */ l("ZodCIDRv4", (e, t) => {
3097
- or.init(e, t), w.init(e, t);
3098
- }), Gs = /* @__PURE__ */ l("ZodCIDRv6", (e, t) => {
3099
- sr.init(e, t), w.init(e, t);
3100
- }), Ys = /* @__PURE__ */ l("ZodBase64", (e, t) => {
3101
- ir.init(e, t), w.init(e, t);
3102
- }), qs = /* @__PURE__ */ l("ZodBase64URL", (e, t) => {
3103
- cr.init(e, t), w.init(e, t);
3104
- }), Xs = /* @__PURE__ */ l("ZodE164", (e, t) => {
3105
- ar.init(e, t), w.init(e, t);
3106
- }), Hs = /* @__PURE__ */ l("ZodJWT", (e, t) => {
3107
- fr.init(e, t), w.init(e, t);
3108
- }), bt = /* @__PURE__ */ l("ZodNumber", (e, t) => {
3109
- ut.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, i) => Mo(e, r, o), B(e, "ZodNumber", {
3110
- gt(r, o) {
3111
- return this.check(/* @__PURE__ */ Ce(r, o));
3112
- },
3113
- gte(r, o) {
3114
- return this.check(/* @__PURE__ */ q(r, o));
3115
- },
3116
- min(r, o) {
3117
- return this.check(/* @__PURE__ */ q(r, o));
3118
- },
3119
- lt(r, o) {
3120
- return this.check(/* @__PURE__ */ De(r, o));
3121
- },
3122
- lte(r, o) {
3123
- return this.check(/* @__PURE__ */ Y(r, o));
3124
- },
3125
- max(r, o) {
3126
- return this.check(/* @__PURE__ */ Y(r, o));
3127
- },
3128
- int(r) {
3129
- return this.check(Je(r));
3130
- },
3131
- safe(r) {
3132
- return this.check(Je(r));
3133
- },
3134
- positive(r) {
3135
- return this.check(/* @__PURE__ */ Ce(0, r));
3136
- },
3137
- nonnegative(r) {
3138
- return this.check(/* @__PURE__ */ q(0, r));
3139
- },
3140
- negative(r) {
3141
- return this.check(/* @__PURE__ */ De(0, r));
3142
- },
3143
- nonpositive(r) {
3144
- return this.check(/* @__PURE__ */ Y(0, r));
3145
- },
3146
- multipleOf(r, o) {
3147
- return this.check(/* @__PURE__ */ xe(r, o));
3148
- },
3149
- step(r, o) {
3150
- return this.check(/* @__PURE__ */ xe(r, o));
3151
- },
3152
- finite() {
3153
- return this;
3154
- }
3155
- });
3156
- const n = e._zod.bag;
3157
- e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
3158
- });
3159
- function Ci(e) {
3160
- return /* @__PURE__ */ ho(bt, e);
3161
- }
3162
- const Qs = /* @__PURE__ */ l("ZodNumberFormat", (e, t) => {
3163
- pr.init(e, t), bt.init(e, t);
3164
- });
3165
- function Je(e) {
3166
- return /* @__PURE__ */ mo(Qs, e);
3167
- }
3168
- const ei = /* @__PURE__ */ l("ZodBoolean", (e, t) => {
3169
- dr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Lo(e, n, r);
3170
- });
3171
- function xi(e) {
3172
- return /* @__PURE__ */ _o(ei, e);
3173
- }
3174
- const ti = /* @__PURE__ */ l("ZodNull", (e, t) => {
3175
- hr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Vo(e, n, r);
3176
- });
3177
- function Ui(e) {
3178
- return /* @__PURE__ */ go(ti, e);
3179
- }
3180
- const ni = /* @__PURE__ */ l("ZodAny", (e, t) => {
3181
- mr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ko();
3182
- });
3183
- function Fi() {
3184
- return /* @__PURE__ */ vo(ni);
3185
- }
3186
- const ri = /* @__PURE__ */ l("ZodUnknown", (e, t) => {
3187
- _r.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Go();
3188
- });
3189
- function Me() {
3190
- return /* @__PURE__ */ zo(ri);
3191
- }
3192
- const oi = /* @__PURE__ */ l("ZodNever", (e, t) => {
3193
- gr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Wo(e, n, r);
3194
- });
3195
- function si(e) {
3196
- return /* @__PURE__ */ yo(oi, e);
3197
- }
3198
- const ii = /* @__PURE__ */ l("ZodVoid", (e, t) => {
3199
- vr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Bo(e, n);
3200
- });
3201
- function Ji(e) {
3202
- return /* @__PURE__ */ bo(ii, e);
3203
- }
3204
- const ui = /* @__PURE__ */ l("ZodDate", (e, t) => {
3205
- zr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, i) => Yo(e, r), e.min = (r, o) => e.check(/* @__PURE__ */ q(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ Y(r, o));
3206
- const n = e._zod.bag;
3207
- e.minDate = n.minimum ? new Date(n.minimum) : null, e.maxDate = n.maximum ? new Date(n.maximum) : null;
3208
- });
3209
- function Mi(e) {
3210
- return /* @__PURE__ */ wo(ui, e);
3211
- }
3212
- const ci = /* @__PURE__ */ l("ZodArray", (e, t) => {
3213
- yr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => es(e, n, r, o), e.element = t.element, B(e, "ZodArray", {
3214
- min(n, r) {
3215
- return this.check(/* @__PURE__ */ H(n, r));
3216
- },
3217
- nonempty(n) {
3218
- return this.check(/* @__PURE__ */ H(1, n));
3219
- },
3220
- max(n, r) {
3221
- return this.check(/* @__PURE__ */ dt(n, r));
3222
- },
3223
- length(n, r) {
3224
- return this.check(/* @__PURE__ */ ht(n, r));
3225
- },
3226
- unwrap() {
3227
- return this.element;
3228
- }
3229
- });
3230
- });
3231
- function ai(e, t) {
3232
- return /* @__PURE__ */ Ao(ci, e, t);
3233
- }
3234
- const li = /* @__PURE__ */ l("ZodObject", (e, t) => {
3235
- wr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ts(e, n, r, o), _(e, "shape", () => t.shape), B(e, "ZodObject", {
3236
- keyof() {
3237
- return _i(Object.keys(this._zod.def.shape));
3238
- },
3239
- catchall(n) {
3240
- return this.clone({ ...this._zod.def, catchall: n });
3241
- },
3242
- passthrough() {
3243
- return this.clone({ ...this._zod.def, catchall: Me() });
3244
- },
3245
- loose() {
3246
- return this.clone({ ...this._zod.def, catchall: Me() });
3247
- },
3248
- strict() {
3249
- return this.clone({ ...this._zod.def, catchall: si() });
3250
- },
3251
- strip() {
3252
- return this.clone({ ...this._zod.def, catchall: void 0 });
3253
- },
3254
- extend(n) {
3255
- return Rt(this, n);
3256
- },
3257
- safeExtend(n) {
3258
- return Dt(this, n);
3259
- },
3260
- merge(n) {
3261
- return Ct(this, n);
3262
- },
3263
- pick(n) {
3264
- return jt(this, n);
3265
- },
3266
- omit(n) {
3267
- return At(this, n);
3268
- },
3269
- partial(...n) {
3270
- return xt(kt, this, n[0]);
3271
- },
3272
- required(...n) {
3273
- return Ut($t, this, n[0]);
3274
- }
3275
- });
3276
- });
3277
- function Li(e, t) {
3278
- const n = {
3279
- type: "object",
3280
- shape: e ?? {},
3281
- ...d(t)
3282
- };
3283
- return new li(n);
3284
- }
3285
- const wt = /* @__PURE__ */ l("ZodUnion", (e, t) => {
3286
- lt.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ns(e, n, r, o), e.options = t.options;
3287
- });
3288
- function fi(e, t) {
3289
- return new wt({
3290
- type: "union",
3291
- options: e,
3292
- ...d(t)
3293
- });
3294
- }
3295
- const pi = /* @__PURE__ */ l("ZodDiscriminatedUnion", (e, t) => {
3296
- wt.init(e, t), kr.init(e, t);
3297
- });
3298
- function Vi(e, t, n) {
3299
- return new pi({
3300
- type: "union",
3301
- options: t,
3302
- discriminator: e,
3303
- ...d(n)
3304
- });
3305
- }
3306
- const di = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
3307
- $r.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => rs(e, n, r, o);
3308
- });
3309
- function hi(e, t) {
3310
- return new di({
3311
- type: "intersection",
3312
- left: e,
3313
- right: t
3314
- });
3315
- }
3316
- const mi = /* @__PURE__ */ l("ZodTuple", (e, t) => {
3317
- Zr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => os(e, n, r, o), e.rest = (n) => e.clone({
3318
- ...e._zod.def,
3319
- rest: n
3320
- });
3321
- });
3322
- function Bi(e, t, n) {
3323
- const r = t instanceof v, o = r ? n : t, i = r ? t : null;
3324
- return new mi({
3325
- type: "tuple",
3326
- items: e,
3327
- rest: i,
3328
- ...d(o)
3329
- });
3330
- }
3331
- const ue = /* @__PURE__ */ l("ZodRecord", (e, t) => {
3332
- Sr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ss(e, n, r, o), e.keyType = t.keyType, e.valueType = t.valueType;
3333
- });
3334
- function Wi(e, t, n) {
3335
- return !t || !t._zod ? new ue({
3336
- type: "record",
3337
- keyType: Ds(),
3338
- valueType: e,
3339
- ...d(t)
3340
- }) : new ue({
3341
- type: "record",
3342
- keyType: e,
3343
- valueType: t,
3344
- ...d(n)
3345
- });
3346
- }
3347
- function Ki(e, t, n) {
3348
- const r = N(e);
3349
- return r._zod.values = void 0, new ue({
3350
- type: "record",
3351
- keyType: r,
3352
- valueType: t,
3353
- ...d(n)
3354
- });
3355
- }
3356
- const ce = /* @__PURE__ */ l("ZodEnum", (e, t) => {
3357
- Or.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, i) => qo(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
3358
- const n = new Set(Object.keys(t.entries));
3359
- e.extract = (r, o) => {
3360
- const i = {};
3361
- for (const s of r)
3362
- if (n.has(s))
3363
- i[s] = t.entries[s];
3364
- else
3365
- throw new Error(`Key ${s} not found in enum`);
3366
- return new ce({
3367
- ...t,
3368
- checks: [],
3369
- ...d(o),
3370
- entries: i
3371
- });
3372
- }, e.exclude = (r, o) => {
3373
- const i = { ...t.entries };
3374
- for (const s of r)
3375
- if (n.has(s))
3376
- delete i[s];
3377
- else
3378
- throw new Error(`Key ${s} not found in enum`);
3379
- return new ce({
3380
- ...t,
3381
- checks: [],
3382
- ...d(o),
3383
- entries: i
3384
- });
3385
- };
3386
- });
3387
- function _i(e, t) {
3388
- const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
3389
- return new ce({
3390
- type: "enum",
3391
- entries: n,
3392
- ...d(t)
3393
- });
3394
- }
3395
- const gi = /* @__PURE__ */ l("ZodLiteral", (e, t) => {
3396
- Ir.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Xo(e, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", {
3397
- get() {
3398
- if (t.values.length > 1)
3399
- throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
3400
- return t.values[0];
3401
- }
3402
- });
3403
- });
3404
- function Gi(e, t) {
3405
- return new gi({
3406
- type: "literal",
3407
- values: Array.isArray(e) ? e : [e],
3408
- ...d(t)
3409
- });
3410
- }
3411
- const vi = /* @__PURE__ */ l("ZodTransform", (e, t) => {
3412
- Tr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Qo(e, n), e._zod.parse = (n, r) => {
3413
- if (r.direction === "backward")
3414
- throw new We(e.constructor.name);
3415
- n.addIssue = (i) => {
3416
- if (typeof i == "string")
3417
- n.issues.push(V(i, n.value, t));
3418
- else {
3419
- const s = i;
3420
- s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(V(s));
3421
- }
3422
- };
3423
- const o = t.transform(n.value, n);
3424
- return o instanceof Promise ? o.then((i) => (n.value = i, n.fallback = !0, n)) : (n.value = o, n.fallback = !0, n);
3425
- };
3426
- });
3427
- function zi(e) {
3428
- return new vi({
3429
- type: "transform",
3430
- transform: e
3431
- });
3432
- }
3433
- const kt = /* @__PURE__ */ l("ZodOptional", (e, t) => {
3434
- ft.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => vt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3435
- });
3436
- function Le(e) {
3437
- return new kt({
3438
- type: "optional",
3439
- innerType: e
3440
- });
3441
- }
3442
- const yi = /* @__PURE__ */ l("ZodExactOptional", (e, t) => {
3443
- Er.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => vt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3444
- });
3445
- function bi(e) {
3446
- return new yi({
3447
- type: "optional",
3448
- innerType: e
3449
- });
3450
- }
3451
- const wi = /* @__PURE__ */ l("ZodNullable", (e, t) => {
3452
- Pr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => is(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3453
- });
3454
- function Ve(e) {
3455
- return new wi({
3456
- type: "nullable",
3457
- innerType: e
3458
- });
3459
- }
3460
- const ki = /* @__PURE__ */ l("ZodDefault", (e, t) => {
3461
- Nr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => cs(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
3462
- });
3463
- function $i(e, t) {
3464
- return new ki({
3465
- type: "default",
3466
- innerType: e,
3467
- get defaultValue() {
3468
- return typeof t == "function" ? t() : Ye(t);
3469
- }
3470
- });
3471
- }
3472
- const Zi = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
3473
- jr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => as(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3474
- });
3475
- function Si(e, t) {
3476
- return new Zi({
3477
- type: "prefault",
3478
- innerType: e,
3479
- get defaultValue() {
3480
- return typeof t == "function" ? t() : Ye(t);
3481
- }
3482
- });
3483
- }
3484
- const $t = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
3485
- Ar.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => us(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3486
- });
3487
- function Oi(e, t) {
3488
- return new $t({
3489
- type: "nonoptional",
3490
- innerType: e,
3491
- ...d(t)
3492
- });
3493
- }
3494
- const Ii = /* @__PURE__ */ l("ZodCatch", (e, t) => {
3495
- Rr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ls(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3496
- });
3497
- function Ti(e, t) {
3498
- return new Ii({
3499
- type: "catch",
3500
- innerType: e,
3501
- catchValue: typeof t == "function" ? t : () => t
3502
- });
3503
- }
3504
- const Ei = /* @__PURE__ */ l("ZodPipe", (e, t) => {
3505
- Dr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => fs(e, n, r, o), e.in = t.in, e.out = t.out;
3506
- });
3507
- function Be(e, t) {
3508
- return new Ei({
3509
- type: "pipe",
3510
- in: e,
3511
- out: t
3512
- // ...util.normalizeParams(params),
3513
- });
3514
- }
3515
- const Pi = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
3516
- Cr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ps(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3517
- });
3518
- function Ni(e) {
3519
- return new Pi({
3520
- type: "readonly",
3521
- innerType: e
3522
- });
3523
- }
3524
- const ji = /* @__PURE__ */ l("ZodLazy", (e, t) => {
3525
- xr.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ds(e, n, r, o), e.unwrap = () => e._zod.def.getter();
3526
- });
3527
- function Yi(e) {
3528
- return new ji({
3529
- type: "lazy",
3530
- getter: e
3531
- });
3532
- }
3533
- const _e = /* @__PURE__ */ l("ZodCustom", (e, t) => {
3534
- Ur.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ho(e, n);
3535
- });
3536
- function qi(e, t) {
3537
- return /* @__PURE__ */ Ro(_e, (() => !0), t);
3538
- }
3539
- function Ai(e, t = {}) {
3540
- return /* @__PURE__ */ Do(_e, e, t);
3541
- }
3542
- function Ri(e, t) {
3543
- return /* @__PURE__ */ Co(e, t);
3544
- }
3545
- function Xi(e, t = {}) {
3546
- const n = new _e({
3547
- type: "custom",
3548
- check: "custom",
3549
- fn: (r) => r instanceof e,
3550
- abort: !0,
3551
- ...d(t)
3552
- });
3553
- return n._zod.bag.Class = e, n._zod.check = (r) => {
3554
- r.value instanceof e || r.issues.push({
3555
- code: "invalid_type",
3556
- expected: e.name,
3557
- input: r.value,
3558
- inst: n,
3559
- path: [...n._zod.def.path ?? []]
3560
- });
3561
- }, n;
3562
- }
3563
- export {
3564
- kt as A,
3565
- wi as B,
3566
- Rs as Z,
3567
- Ji as _,
3568
- ai as a,
3569
- xi as b,
3570
- _i as c,
3571
- Xi as d,
3572
- Mi as e,
3573
- fi as f,
3574
- Vi as g,
3575
- Yi as h,
3576
- qi as i,
3577
- Di as j,
3578
- Fi as k,
3579
- Gi as l,
3580
- Ui as m,
3581
- Ci as n,
3582
- Li as o,
3583
- Ki as p,
3584
- bt as q,
3585
- Wi as r,
3586
- Ds as s,
3587
- Bi as t,
3588
- Me as u,
3589
- ei as v,
3590
- ce as w,
3591
- ci as x,
3592
- li as y,
3593
- ki as z
3594
- };