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