@ogc-maps/storybook-components 0.14.0 → 0.16.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 (203) hide show
  1. package/LICENSE +661 -0
  2. package/dist/{BasemapSwitcher-BW7lyZ2Y.js → BasemapSwitcher-DuqVusX0.js} +9 -9
  3. package/dist/CollapsibleControl-BTIkiTmU.js +60 -0
  4. package/dist/CoordinateDisplay-BblQ34mS.js +154 -0
  5. package/dist/{ExportButton-Ck1dESnc.js → ExportButton-C8hCCsav.js} +7 -7
  6. package/dist/{FeatureDetailPanel-CkFpdEKW.js → FeatureDetailPanel-DgCHiNi9.js} +16 -16
  7. package/dist/FeatureTooltip-DHjMZC0u.js +49 -0
  8. package/dist/{LayerPanel-SCdJ8948.js → LayerPanel-BkDbZ66Z.js} +23 -23
  9. package/dist/Legend-CvBd-v0n.js +285 -0
  10. package/dist/PropertyList-0EonV_BQ.js +33 -0
  11. package/dist/SearchPanel-DIb7aYVs.js +725 -0
  12. package/dist/components/BasemapSwitcher/index.js +1 -1
  13. package/dist/components/CollapsibleControl/CollapsibleControl.d.ts +4 -1
  14. package/dist/components/CollapsibleControl/CollapsibleControl.d.ts.map +1 -1
  15. package/dist/components/CollapsibleControl/index.js +1 -1
  16. package/dist/components/CompassControl/CompassControl.d.ts +19 -0
  17. package/dist/components/CompassControl/CompassControl.d.ts.map +1 -0
  18. package/dist/components/CompassControl/index.d.ts +3 -0
  19. package/dist/components/CompassControl/index.d.ts.map +1 -0
  20. package/dist/components/CoordinateDisplay/CoordinateDisplay.d.ts +35 -4
  21. package/dist/components/CoordinateDisplay/CoordinateDisplay.d.ts.map +1 -1
  22. package/dist/components/CoordinateDisplay/CoordinateDisplay.test.d.ts +2 -0
  23. package/dist/components/CoordinateDisplay/CoordinateDisplay.test.d.ts.map +1 -0
  24. package/dist/components/CoordinateDisplay/index.d.ts +1 -1
  25. package/dist/components/CoordinateDisplay/index.d.ts.map +1 -1
  26. package/dist/components/CoordinateDisplay/index.js +5 -3
  27. package/dist/components/Cql2FilterEditor/Cql2FilterEditor.d.ts +9 -0
  28. package/dist/components/Cql2FilterEditor/Cql2FilterEditor.d.ts.map +1 -0
  29. package/dist/components/Cql2FilterEditor/Cql2Preview.d.ts +6 -0
  30. package/dist/components/Cql2FilterEditor/Cql2Preview.d.ts.map +1 -0
  31. package/dist/components/Cql2FilterEditor/FilterRuleEditor.d.ts +9 -0
  32. package/dist/components/Cql2FilterEditor/FilterRuleEditor.d.ts.map +1 -0
  33. package/dist/components/Cql2FilterEditor/FilterRuleGroupEditor.d.ts +10 -0
  34. package/dist/components/Cql2FilterEditor/FilterRuleGroupEditor.d.ts.map +1 -0
  35. package/dist/components/Cql2FilterEditor/FilterValueInput.d.ts +12 -0
  36. package/dist/components/Cql2FilterEditor/FilterValueInput.d.ts.map +1 -0
  37. package/dist/components/Cql2FilterEditor/ParameterizableField.d.ts +30 -0
  38. package/dist/components/Cql2FilterEditor/ParameterizableField.d.ts.map +1 -0
  39. package/dist/components/Cql2FilterEditor/index.d.ts +2 -0
  40. package/dist/components/Cql2FilterEditor/index.d.ts.map +1 -0
  41. package/dist/components/Cql2FilterEditor/operatorOptions.d.ts +9 -0
  42. package/dist/components/Cql2FilterEditor/operatorOptions.d.ts.map +1 -0
  43. package/dist/components/Cql2FilterEditor/styles.d.ts +3 -0
  44. package/dist/components/Cql2FilterEditor/styles.d.ts.map +1 -0
  45. package/dist/components/ExportButton/index.js +1 -1
  46. package/dist/components/ExportModal/ExportModal.d.ts +20 -1
  47. package/dist/components/ExportModal/ExportModal.d.ts.map +1 -1
  48. package/dist/components/ExportModal/index.d.ts +1 -1
  49. package/dist/components/ExportModal/index.d.ts.map +1 -1
  50. package/dist/components/FeatureDetailPanel/index.js +1 -1
  51. package/dist/components/FeatureTooltip/index.js +1 -1
  52. package/dist/components/GlobalSearchBar/GlobalSearchBar.d.ts +25 -0
  53. package/dist/components/GlobalSearchBar/GlobalSearchBar.d.ts.map +1 -0
  54. package/dist/components/GlobalSearchBar/GlobalSearchBar.test.d.ts +2 -0
  55. package/dist/components/GlobalSearchBar/GlobalSearchBar.test.d.ts.map +1 -0
  56. package/dist/components/GlobalSearchBar/index.d.ts +3 -0
  57. package/dist/components/GlobalSearchBar/index.d.ts.map +1 -0
  58. package/dist/components/GlobalSearchConfigEditor/GlobalSearchConfigEditor.d.ts +22 -0
  59. package/dist/components/GlobalSearchConfigEditor/GlobalSearchConfigEditor.d.ts.map +1 -0
  60. package/dist/components/GlobalSearchConfigEditor/GlobalSearchConfigEditor.test.d.ts +2 -0
  61. package/dist/components/GlobalSearchConfigEditor/GlobalSearchConfigEditor.test.d.ts.map +1 -0
  62. package/dist/components/GlobalSearchConfigEditor/index.d.ts +3 -0
  63. package/dist/components/GlobalSearchConfigEditor/index.d.ts.map +1 -0
  64. package/dist/components/ImageryEditor/ImageryEditor.d.ts +0 -1
  65. package/dist/components/ImageryEditor/ImageryEditor.d.ts.map +1 -1
  66. package/dist/components/ImageryEditor/index.d.ts +2 -1
  67. package/dist/components/ImageryEditor/index.d.ts.map +1 -1
  68. package/dist/components/ImageryPanel/ImageryPanel.d.ts.map +1 -1
  69. package/dist/components/InfoControl/InfoControl.d.ts +12 -0
  70. package/dist/components/InfoControl/InfoControl.d.ts.map +1 -0
  71. package/dist/components/InfoControl/InfoModal.d.ts +16 -0
  72. package/dist/components/InfoControl/InfoModal.d.ts.map +1 -0
  73. package/dist/components/InfoControl/index.d.ts +5 -0
  74. package/dist/components/InfoControl/index.d.ts.map +1 -0
  75. package/dist/components/LayerEditor/LayerEditor.d.ts +6 -1
  76. package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
  77. package/dist/components/LayerEditor/LayerList.d.ts +8 -1
  78. package/dist/components/LayerEditor/LayerList.d.ts.map +1 -1
  79. package/dist/components/LayerEditor/index.d.ts +1 -1
  80. package/dist/components/LayerEditor/index.d.ts.map +1 -1
  81. package/dist/components/LayerPanel/index.js +1 -1
  82. package/dist/components/Legend/Legend.d.ts +7 -1
  83. package/dist/components/Legend/Legend.d.ts.map +1 -1
  84. package/dist/components/Legend/index.js +1 -1
  85. package/dist/components/PropertyFilterPanel/PropertyFilterPanel.d.ts +21 -0
  86. package/dist/components/PropertyFilterPanel/PropertyFilterPanel.d.ts.map +1 -0
  87. package/dist/components/PropertyFilterPanel/index.d.ts +3 -0
  88. package/dist/components/PropertyFilterPanel/index.d.ts.map +1 -0
  89. package/dist/components/QueryPanel/QueryPanel.d.ts +14 -0
  90. package/dist/components/QueryPanel/QueryPanel.d.ts.map +1 -0
  91. package/dist/components/QueryPanel/index.d.ts +3 -0
  92. package/dist/components/QueryPanel/index.d.ts.map +1 -0
  93. package/dist/components/ResultsDrawer/ResultsDrawer.d.ts +29 -4
  94. package/dist/components/ResultsDrawer/ResultsDrawer.d.ts.map +1 -1
  95. package/dist/components/ResultsDrawer/index.d.ts +1 -1
  96. package/dist/components/ResultsDrawer/index.d.ts.map +1 -1
  97. package/dist/components/ResultsDrawer/tableUtils.d.ts +11 -0
  98. package/dist/components/ResultsDrawer/tableUtils.d.ts.map +1 -0
  99. package/dist/components/ScaleBarControl/ScaleBarControl.d.ts +32 -0
  100. package/dist/components/ScaleBarControl/ScaleBarControl.d.ts.map +1 -0
  101. package/dist/components/ScaleBarControl/index.d.ts +2 -0
  102. package/dist/components/ScaleBarControl/index.d.ts.map +1 -0
  103. package/dist/components/SearchPanel/SearchPanel.d.ts +15 -2
  104. package/dist/components/SearchPanel/SearchPanel.d.ts.map +1 -1
  105. package/dist/components/SearchPanel/index.js +1 -1
  106. package/dist/components/SelectionPanel/SelectionPanel.d.ts +3 -1
  107. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  108. package/dist/components/SideMenuPanel/SideMenuPanel.d.ts +51 -0
  109. package/dist/components/SideMenuPanel/SideMenuPanel.d.ts.map +1 -0
  110. package/dist/components/SideMenuPanel/index.d.ts +3 -0
  111. package/dist/components/SideMenuPanel/index.d.ts.map +1 -0
  112. package/dist/components/SourceEditor/SourceEditor.d.ts +3 -1
  113. package/dist/components/SourceEditor/SourceEditor.d.ts.map +1 -1
  114. package/dist/components/SourceEditor/SourceList.d.ts +6 -1
  115. package/dist/components/SourceEditor/SourceList.d.ts.map +1 -1
  116. package/dist/components/SourceEditor/index.d.ts +1 -1
  117. package/dist/components/SourceEditor/index.d.ts.map +1 -1
  118. package/dist/components/StyleEditor/DataDrivenColorEditor.d.ts +8 -3
  119. package/dist/components/StyleEditor/DataDrivenColorEditor.d.ts.map +1 -1
  120. package/dist/components/StyleEditor/PropertyField.d.ts +6 -3
  121. package/dist/components/StyleEditor/PropertyField.d.ts.map +1 -1
  122. package/dist/components/StyleEditor/PropertyGroup.d.ts +6 -3
  123. package/dist/components/StyleEditor/PropertyGroup.d.ts.map +1 -1
  124. package/dist/components/StyleEditor/StyleEditor.d.ts +7 -3
  125. package/dist/components/StyleEditor/StyleEditor.d.ts.map +1 -1
  126. package/dist/components/UIConfigEditor/UIConfigEditor.d.ts +13 -2
  127. package/dist/components/UIConfigEditor/UIConfigEditor.d.ts.map +1 -1
  128. package/dist/components/UserMenu/UserMenu.d.ts +15 -0
  129. package/dist/components/UserMenu/UserMenu.d.ts.map +1 -0
  130. package/dist/components/UserMenu/index.d.ts +3 -0
  131. package/dist/components/UserMenu/index.d.ts.map +1 -0
  132. package/dist/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  133. package/dist/components/index.d.ts +26 -5
  134. package/dist/components/index.d.ts.map +1 -1
  135. package/dist/components/shared/controlIcons.d.ts +10 -0
  136. package/dist/components/shared/controlIcons.d.ts.map +1 -0
  137. package/dist/geo-DUdRIR7u.js +9776 -0
  138. package/dist/hooks/index.d.ts +5 -3
  139. package/dist/hooks/index.d.ts.map +1 -1
  140. package/dist/hooks/index.js +68 -59
  141. package/dist/hooks/useExport.d.ts +7 -7
  142. package/dist/hooks/useExport.d.ts.map +1 -1
  143. package/dist/id-C2J6iu8_.js +11 -0
  144. package/dist/index-BtQnyWPg.js +3718 -0
  145. package/dist/main.js +13801 -2600
  146. package/dist/schemas/config.d.ts +2127 -5011
  147. package/dist/schemas/config.d.ts.map +1 -1
  148. package/dist/schemas/index.d.ts +1 -1
  149. package/dist/schemas/index.d.ts.map +1 -1
  150. package/dist/schemas/index.js +35 -24
  151. package/dist/style.css +1 -1
  152. package/dist/types/index.d.ts +47 -2
  153. package/dist/types/index.d.ts.map +1 -1
  154. package/dist/types/index.js +56 -33
  155. package/dist/useSelection-BFHYsPvU.js +224 -0
  156. package/dist/utils/colorPalettes.d.ts +4 -2
  157. package/dist/utils/colorPalettes.d.ts.map +1 -1
  158. package/dist/utils/colorThemes.d.ts +12 -0
  159. package/dist/utils/colorThemes.d.ts.map +1 -0
  160. package/dist/utils/cql2.d.ts +34 -5
  161. package/dist/utils/cql2.d.ts.map +1 -1
  162. package/dist/utils/exportConverters.d.ts +16 -0
  163. package/dist/utils/exportConverters.d.ts.map +1 -0
  164. package/dist/utils/geo.d.ts +59 -0
  165. package/dist/utils/geo.d.ts.map +1 -1
  166. package/dist/utils/id.d.ts +2 -0
  167. package/dist/utils/id.d.ts.map +1 -0
  168. package/dist/utils/index.d.ts +9 -0
  169. package/dist/utils/index.d.ts.map +1 -1
  170. package/dist/utils/index.js +477 -0
  171. package/dist/utils/ogcApi.d.ts +31 -6
  172. package/dist/utils/ogcApi.d.ts.map +1 -1
  173. package/dist/utils/propertyFilters.d.ts +35 -0
  174. package/dist/utils/propertyFilters.d.ts.map +1 -0
  175. package/dist/utils/queryParameters.d.ts +23 -0
  176. package/dist/utils/queryParameters.d.ts.map +1 -0
  177. package/dist/utils/queryableHelpers.d.ts +4 -0
  178. package/dist/utils/queryableHelpers.d.ts.map +1 -1
  179. package/dist/utils/slugify.d.ts +2 -0
  180. package/dist/utils/slugify.d.ts.map +1 -0
  181. package/package.json +31 -14
  182. package/dist/CollapsibleControl-qo9daiD8.js +0 -53
  183. package/dist/CoordinateDisplay-PxPmVjpm.js +0 -47
  184. package/dist/FeatureTooltip-DxzN-jnp.js +0 -49
  185. package/dist/Legend-BLWBzD7Y.js +0 -275
  186. package/dist/PropertyList-BGXHLVBM.js +0 -33
  187. package/dist/SearchPanel-4Y12jfuP.js +0 -401
  188. package/dist/components/PropertyDisplayEditor/__tests__/PropertyDisplayEditor.test.d.ts +0 -2
  189. package/dist/components/PropertyDisplayEditor/__tests__/PropertyDisplayEditor.test.d.ts.map +0 -1
  190. package/dist/geo-PA_KiJwy.js +0 -1169
  191. package/dist/index-Cz_PEKV1.js +0 -3035
  192. package/dist/schemas/__tests__/config.test.d.ts +0 -2
  193. package/dist/schemas/__tests__/config.test.d.ts.map +0 -1
  194. package/dist/utils/__tests__/cql2.test.d.ts +0 -2
  195. package/dist/utils/__tests__/cql2.test.d.ts.map +0 -1
  196. package/dist/utils/__tests__/expressionColors.test.d.ts +0 -2
  197. package/dist/utils/__tests__/expressionColors.test.d.ts.map +0 -1
  198. package/dist/utils/__tests__/propertyDisplay.test.d.ts +0 -2
  199. package/dist/utils/__tests__/propertyDisplay.test.d.ts.map +0 -1
  200. package/dist/utils/__tests__/queryableHelpers.test.d.ts +0 -2
  201. package/dist/utils/__tests__/queryableHelpers.test.d.ts.map +0 -1
  202. package/dist/utils/__tests__/wkt.test.d.ts +0 -2
  203. package/dist/utils/__tests__/wkt.test.d.ts.map +0 -1
@@ -0,0 +1,3718 @@
1
+ function l(e, t, n) {
2
+ function o(a, c) {
3
+ if (a._zod || Object.defineProperty(a, "_zod", {
4
+ value: {
5
+ def: c,
6
+ constr: s,
7
+ traits: /* @__PURE__ */ new Set()
8
+ },
9
+ enumerable: !1
10
+ }), a._zod.traits.has(e))
11
+ return;
12
+ a._zod.traits.add(e), t(a, c);
13
+ const u = s.prototype, p = Object.keys(u);
14
+ for (let f = 0; f < p.length; f++) {
15
+ const _ = p[f];
16
+ _ in a || (a[_] = u[_].bind(a));
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(a) {
24
+ var c;
25
+ const u = n != null && n.Parent ? new i() : this;
26
+ o(u, a), (c = u._zod).deferred ?? (c.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: (a) => {
33
+ var c, u;
34
+ return n != null && n.Parent && a instanceof n.Parent ? !0 : (u = (c = a == null ? void 0 : a._zod) == null ? void 0 : c.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 it extends Error {
44
+ constructor(t) {
45
+ super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
46
+ }
47
+ }
48
+ const st = {};
49
+ function M(e) {
50
+ return st;
51
+ }
52
+ function at(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 we(e, t) {
57
+ return typeof t == "bigint" ? t.toString() : t;
58
+ }
59
+ function fe(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 Oe(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 Gt(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 c = o.match(/\d?e-(\d?)/);
81
+ c != null && c[1] && (r = Number.parseInt(c[1]));
82
+ }
83
+ const i = n > r ? n : r, s = Number.parseInt(e.toFixed(i).replace(".", "")), a = Number.parseInt(t.toFixed(i).replace(".", ""));
84
+ return s % a / 10 ** i;
85
+ }
86
+ const je = Symbol("evaluating");
87
+ function w(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 V(...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 xe(e) {
120
+ return JSON.stringify(e);
121
+ }
122
+ function Kt(e) {
123
+ return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
124
+ }
125
+ const ct = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
126
+ };
127
+ function ne(e) {
128
+ return typeof e == "object" && e !== null && !Array.isArray(e);
129
+ }
130
+ const qt = fe(() => {
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 (ne(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 !(ne(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
149
+ }
150
+ function ut(e) {
151
+ return Y(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
152
+ }
153
+ const Yt = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
154
+ function X(e) {
155
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
156
+ }
157
+ function U(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 Xt(e) {
175
+ return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
176
+ }
177
+ const Ht = {
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 Qt(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 = V(e._zod.def, {
189
+ get shape() {
190
+ const s = {};
191
+ for (const a in t) {
192
+ if (!(a in n.shape))
193
+ throw new Error(`Unrecognized key: "${a}"`);
194
+ t[a] && (s[a] = n.shape[a]);
195
+ }
196
+ return W(this, "shape", s), s;
197
+ },
198
+ checks: []
199
+ });
200
+ return U(e, i);
201
+ }
202
+ function en(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 = V(e._zod.def, {
207
+ get shape() {
208
+ const s = { ...e._zod.def.shape };
209
+ for (const a in t) {
210
+ if (!(a in n.shape))
211
+ throw new Error(`Unrecognized key: "${a}"`);
212
+ t[a] && delete s[a];
213
+ }
214
+ return W(this, "shape", s), s;
215
+ },
216
+ checks: []
217
+ });
218
+ return U(e, i);
219
+ }
220
+ function tn(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 = V(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 U(e, r);
237
+ }
238
+ function nn(e, t) {
239
+ if (!Y(t))
240
+ throw new Error("Invalid input to safeExtend: expected a plain object");
241
+ const n = V(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 U(e, n);
248
+ }
249
+ function on(e, t) {
250
+ const n = V(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 U(e, n);
262
+ }
263
+ function rn(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 = V(t._zod.def, {
268
+ get shape() {
269
+ const a = t._zod.def.shape, c = { ...a };
270
+ if (n)
271
+ for (const u in n) {
272
+ if (!(u in a))
273
+ throw new Error(`Unrecognized key: "${u}"`);
274
+ n[u] && (c[u] = e ? new e({
275
+ type: "optional",
276
+ innerType: a[u]
277
+ }) : a[u]);
278
+ }
279
+ else
280
+ for (const u in a)
281
+ c[u] = e ? new e({
282
+ type: "optional",
283
+ innerType: a[u]
284
+ }) : a[u];
285
+ return W(this, "shape", c), c;
286
+ },
287
+ checks: []
288
+ });
289
+ return U(t, s);
290
+ }
291
+ function sn(e, t, n) {
292
+ const o = V(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 U(t, o);
314
+ }
315
+ function G(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 ie(e) {
331
+ return typeof e == "string" ? e : e == null ? void 0 : e.message;
332
+ }
333
+ function J(e, t, n) {
334
+ var r, i, s, a, c, u;
335
+ const o = { ...e, path: e.path ?? [] };
336
+ if (!e.message) {
337
+ const p = ie((s = (i = (r = e.inst) == null ? void 0 : r._zod.def) == null ? void 0 : i.error) == null ? void 0 : s.call(i, e)) ?? ie((a = t == null ? void 0 : t.error) == null ? void 0 : a.call(t, e)) ?? ie((c = n.customError) == null ? void 0 : c.call(n, e)) ?? ie((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 Te(e) {
343
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
344
+ }
345
+ function oe(...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 lt = (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, we, 2), Object.defineProperty(e, "toString", {
362
+ value: () => e.message,
363
+ enumerable: !1
364
+ });
365
+ }, pt = l("$ZodError", lt), ft = l("$ZodError", lt, { Parent: Error });
366
+ function an(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 cn(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, a = 0;
385
+ for (; a < i.path.length; ) {
386
+ const c = i.path[a];
387
+ a === i.path.length - 1 ? (s[c] = s[c] || { _errors: [] }, s[c]._errors.push(t(i))) : s[c] = s[c] || { _errors: [] }, s = s[c], a++;
388
+ }
389
+ }
390
+ };
391
+ return o(e), n;
392
+ }
393
+ const Ie = (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 a = new ((r == null ? void 0 : r.Err) ?? e)(s.issues.map((c) => J(c, i, M())));
399
+ throw ct(a, r == null ? void 0 : r.callee), a;
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 a = new ((r == null ? void 0 : r.Err) ?? e)(s.issues.map((c) => J(c, i, M())));
407
+ throw ct(a, r == null ? void 0 : r.callee), a;
408
+ }
409
+ return s.value;
410
+ }, de = (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 ?? pt)(i.issues.map((s) => J(s, r, M())))
417
+ } : { success: !0, data: i.value };
418
+ }, un = /* @__PURE__ */ de(ft), he = (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) => J(s, r, M())))
424
+ } : { success: !0, data: i.value };
425
+ }, ln = /* @__PURE__ */ he(ft), pn = (e) => (t, n, o) => {
426
+ const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
427
+ return Ie(e)(t, n, r);
428
+ }, fn = (e) => (t, n, o) => Ie(e)(t, n, o), dn = (e) => async (t, n, o) => {
429
+ const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
430
+ return Pe(e)(t, n, r);
431
+ }, hn = (e) => async (t, n, o) => Pe(e)(t, n, o), mn = (e) => (t, n, o) => {
432
+ const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
433
+ return de(e)(t, n, r);
434
+ }, gn = (e) => (t, n, o) => de(e)(t, n, o), _n = (e) => async (t, n, o) => {
435
+ const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
436
+ return he(e)(t, n, r);
437
+ }, vn = (e) => async (t, n, o) => he(e)(t, n, o), yn = /^[cC][^\s-]{8,}$/, bn = /^[0-9a-z]+$/, wn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, zn = /^[0-9a-vA-V]{20}$/, kn = /^[A-Za-z0-9]{27}$/, Sn = /^[a-zA-Z0-9_-]{21}$/, Zn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, $n = /^([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})$/, Re = (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)$/, On = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Tn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
438
+ function In() {
439
+ return new RegExp(Tn, "u");
440
+ }
441
+ const Pn = /^(?:(?: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])$/, En = /^(([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}|:))$/, Nn = /^((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])$/, Cn = /^(([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])$/, An = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, dt = /^[A-Za-z0-9_-]*$/, jn = /^\+[1-9]\d{6,14}$/, ht = "(?:(?:\\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])))", xn = /* @__PURE__ */ new RegExp(`^${ht}$`);
442
+ function mt(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 Rn(e) {
447
+ return new RegExp(`^${mt(e)}$`);
448
+ }
449
+ function Dn(e) {
450
+ const t = mt({ 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(`^${ht}T(?:${o})$`);
454
+ }
455
+ const Fn = (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
+ }, Ln = /^-?\d+$/, gt = /^-?\d+(?:\.\d+)?$/, Un = /^(?:true|false)$/i, Mn = /^null$/i, Jn = /^[^A-Z]*$/, Vn = /^[^a-z]*$/, j = /* @__PURE__ */ l("$ZodCheck", (e, t) => {
459
+ var n;
460
+ e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
461
+ }), _t = {
462
+ number: "number",
463
+ bigint: "bigint",
464
+ object: "date"
465
+ }, vt = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
466
+ j.init(e, t);
467
+ const n = _t[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
+ }), yt = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
483
+ j.init(e, t);
484
+ const n = _t[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
+ }), Bn = /* @__PURE__ */ l("$ZodCheckMultipleOf", (e, t) => {
500
+ j.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) : Gt(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
+ }), Wn = /* @__PURE__ */ l("$ZodCheckNumberFormat", (e, t) => {
516
+ var s;
517
+ j.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] = Ht[t.format];
519
+ e._zod.onattach.push((a) => {
520
+ const c = a._zod.bag;
521
+ c.format = t.format, c.minimum = r, c.maximum = i, n && (c.pattern = Ln);
522
+ }), e._zod.check = (a) => {
523
+ const c = a.value;
524
+ if (n) {
525
+ if (!Number.isInteger(c)) {
526
+ a.issues.push({
527
+ expected: o,
528
+ format: t.format,
529
+ code: "invalid_type",
530
+ continue: !1,
531
+ input: c,
532
+ inst: e
533
+ });
534
+ return;
535
+ }
536
+ if (!Number.isSafeInteger(c)) {
537
+ c > 0 ? a.issues.push({
538
+ input: c,
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
+ }) : a.issues.push({
547
+ input: c,
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
+ c < r && a.issues.push({
560
+ origin: "number",
561
+ input: c,
562
+ code: "too_small",
563
+ minimum: r,
564
+ inclusive: !0,
565
+ inst: e,
566
+ continue: !t.abort
567
+ }), c > i && a.issues.push({
568
+ origin: "number",
569
+ input: c,
570
+ code: "too_big",
571
+ maximum: i,
572
+ inclusive: !0,
573
+ inst: e,
574
+ continue: !t.abort
575
+ });
576
+ };
577
+ }), Gn = /* @__PURE__ */ l("$ZodCheckMaxLength", (e, t) => {
578
+ var n;
579
+ j.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 = Te(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
+ }), Kn = /* @__PURE__ */ l("$ZodCheckMinLength", (e, t) => {
601
+ var n;
602
+ j.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 = Te(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
+ }), qn = /* @__PURE__ */ l("$ZodCheckLengthEquals", (e, t) => {
624
+ var n;
625
+ j.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 = Te(r), a = i > t.length;
636
+ o.issues.push({
637
+ origin: s,
638
+ ...a ? { 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
+ }), me = /* @__PURE__ */ l("$ZodCheckStringFormat", (e, t) => {
647
+ var n, o;
648
+ j.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
+ }), Yn = /* @__PURE__ */ l("$ZodCheckRegex", (e, t) => {
664
+ me.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
+ }), Xn = /* @__PURE__ */ l("$ZodCheckLowerCase", (e, t) => {
676
+ t.pattern ?? (t.pattern = Jn), me.init(e, t);
677
+ }), Hn = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
678
+ t.pattern ?? (t.pattern = Vn), me.init(e, t);
679
+ }), Qn = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
680
+ j.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
+ }), eo = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
697
+ j.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
+ }), to = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
714
+ j.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
+ }), no = /* @__PURE__ */ l("$ZodCheckOverwrite", (e, t) => {
731
+ j.init(e, t), e._zod.check = (n) => {
732
+ n.value = t.tx(n.value);
733
+ };
734
+ });
735
+ class oo {
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 ro = {
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 = ro;
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 = (a, c, u) => {
777
+ let p = G(a), f;
778
+ for (const _ of c) {
779
+ if (_._zod.def.when) {
780
+ if (!_._zod.def.when(a))
781
+ continue;
782
+ } else if (p)
783
+ continue;
784
+ const b = a.issues.length, k = _._zod.check(a);
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, a.issues.length !== b && (p || (p = G(a, b)));
790
+ });
791
+ else {
792
+ if (a.issues.length === b)
793
+ continue;
794
+ p || (p = G(a, b));
795
+ }
796
+ }
797
+ return f ? f.then(() => a) : a;
798
+ }, s = (a, c, u) => {
799
+ if (G(a))
800
+ return a.aborted = !0, a;
801
+ const p = i(c, 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 = (a, c) => {
810
+ if (c.skipChecks)
811
+ return e._zod.parse(a, c);
812
+ if (c.direction === "backward") {
813
+ const p = e._zod.parse({ value: a.value, issues: [] }, { ...c, skipChecks: !0 });
814
+ return p instanceof Promise ? p.then((f) => s(f, a, c)) : s(p, a, c);
815
+ }
816
+ const u = e._zod.parse(a, c);
817
+ if (u instanceof Promise) {
818
+ if (c.async === !1)
819
+ throw new q();
820
+ return u.then((p) => i(p, o, c));
821
+ }
822
+ return i(u, o, c);
823
+ };
824
+ }
825
+ w(e, "~standard", () => ({
826
+ validate: (i) => {
827
+ var s;
828
+ try {
829
+ const a = un(e, i);
830
+ return a.success ? { value: a.data } : { issues: (s = a.error) == null ? void 0 : s.issues };
831
+ } catch {
832
+ return ln(e, i).then((c) => {
833
+ var u;
834
+ return c.success ? { value: c.data } : { issues: (u = c.error) == null ? void 0 : u.issues };
835
+ });
836
+ }
837
+ },
838
+ vendor: "zod",
839
+ version: 1
840
+ }));
841
+ }), Ee = /* @__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() ?? Fn(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
+ }), O = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
857
+ me.init(e, t), Ee.init(e, t);
858
+ }), io = /* @__PURE__ */ l("$ZodGUID", (e, t) => {
859
+ t.pattern ?? (t.pattern = $n), O.init(e, t);
860
+ }), so = /* @__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 = Re(o));
875
+ } else
876
+ t.pattern ?? (t.pattern = Re());
877
+ O.init(e, t);
878
+ }), ao = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
879
+ t.pattern ?? (t.pattern = On), O.init(e, t);
880
+ }), co = /* @__PURE__ */ l("$ZodURL", (e, t) => {
881
+ O.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
+ }), uo = /* @__PURE__ */ l("$ZodEmoji", (e, t) => {
913
+ t.pattern ?? (t.pattern = In()), O.init(e, t);
914
+ }), lo = /* @__PURE__ */ l("$ZodNanoID", (e, t) => {
915
+ t.pattern ?? (t.pattern = Sn), O.init(e, t);
916
+ }), po = /* @__PURE__ */ l("$ZodCUID", (e, t) => {
917
+ t.pattern ?? (t.pattern = yn), O.init(e, t);
918
+ }), fo = /* @__PURE__ */ l("$ZodCUID2", (e, t) => {
919
+ t.pattern ?? (t.pattern = bn), O.init(e, t);
920
+ }), ho = /* @__PURE__ */ l("$ZodULID", (e, t) => {
921
+ t.pattern ?? (t.pattern = wn), O.init(e, t);
922
+ }), mo = /* @__PURE__ */ l("$ZodXID", (e, t) => {
923
+ t.pattern ?? (t.pattern = zn), O.init(e, t);
924
+ }), go = /* @__PURE__ */ l("$ZodKSUID", (e, t) => {
925
+ t.pattern ?? (t.pattern = kn), O.init(e, t);
926
+ }), _o = /* @__PURE__ */ l("$ZodISODateTime", (e, t) => {
927
+ t.pattern ?? (t.pattern = Dn(t)), O.init(e, t);
928
+ }), vo = /* @__PURE__ */ l("$ZodISODate", (e, t) => {
929
+ t.pattern ?? (t.pattern = xn), O.init(e, t);
930
+ }), yo = /* @__PURE__ */ l("$ZodISOTime", (e, t) => {
931
+ t.pattern ?? (t.pattern = Rn(t)), O.init(e, t);
932
+ }), bo = /* @__PURE__ */ l("$ZodISODuration", (e, t) => {
933
+ t.pattern ?? (t.pattern = Zn), O.init(e, t);
934
+ }), wo = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
935
+ t.pattern ?? (t.pattern = Pn), O.init(e, t), e._zod.bag.format = "ipv4";
936
+ }), zo = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
937
+ t.pattern ?? (t.pattern = En), O.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
+ }), ko = /* @__PURE__ */ l("$ZodCIDRv4", (e, t) => {
951
+ t.pattern ?? (t.pattern = Nn), O.init(e, t);
952
+ }), So = /* @__PURE__ */ l("$ZodCIDRv6", (e, t) => {
953
+ t.pattern ?? (t.pattern = Cn), O.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 bt(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 Zo = /* @__PURE__ */ l("$ZodBase64", (e, t) => {
990
+ t.pattern ?? (t.pattern = An), O.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
991
+ bt(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 $o(e) {
1001
+ if (!dt.test(e))
1002
+ return !1;
1003
+ const t = e.replace(/[-_]/g, (o) => o === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1004
+ return bt(n);
1005
+ }
1006
+ const Oo = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
1007
+ t.pattern ?? (t.pattern = dt), O.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1008
+ $o(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
+ }), To = /* @__PURE__ */ l("$ZodE164", (e, t) => {
1017
+ t.pattern ?? (t.pattern = jn), O.init(e, t);
1018
+ });
1019
+ function Io(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 Po = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
1034
+ O.init(e, t), e._zod.check = (n) => {
1035
+ Io(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
+ }), wt = /* @__PURE__ */ l("$ZodNumber", (e, t) => {
1044
+ S.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? gt, 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
+ }), Eo = /* @__PURE__ */ l("$ZodNumberFormat", (e, t) => {
1063
+ Wn.init(e, t), wt.init(e, t);
1064
+ }), No = /* @__PURE__ */ l("$ZodBoolean", (e, t) => {
1065
+ S.init(e, t), e._zod.pattern = Un, 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
+ }), Co = /* @__PURE__ */ l("$ZodNull", (e, t) => {
1080
+ S.init(e, t), e._zod.pattern = Mn, 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
+ }), Ao = /* @__PURE__ */ l("$ZodUnknown", (e, t) => {
1090
+ S.init(e, t), e._zod.parse = (n) => n;
1091
+ }), jo = /* @__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 De(e, t, n) {
1100
+ e.issues.length && t.issues.push(...B(n, e.issues)), t.value[n] = e.value;
1101
+ }
1102
+ const xo = /* @__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 a = r[s], c = t.element._zod.run({
1116
+ value: a,
1117
+ issues: []
1118
+ }, o);
1119
+ c instanceof Promise ? i.push(c.then((u) => De(u, n, s))) : De(c, n, s);
1120
+ }
1121
+ return i.length ? Promise.all(i).then(() => n) : n;
1122
+ };
1123
+ });
1124
+ function ue(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 zt(e) {
1133
+ var o, r, i, s;
1134
+ const t = Object.keys(e.shape);
1135
+ for (const a of t)
1136
+ if (!((s = (i = (r = (o = e.shape) == null ? void 0 : o[a]) == null ? void 0 : r._zod) == null ? void 0 : i.traits) != null && s.has("$ZodType")))
1137
+ throw new Error(`Invalid element at key "${a}": expected a Zod schema`);
1138
+ const n = Xt(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 kt(e, t, n, o, r, i) {
1148
+ const s = [], a = r.keySet, c = r.catchall._zod, u = c.def.type, p = c.optout === "optional";
1149
+ for (const f in t) {
1150
+ if (a.has(f))
1151
+ continue;
1152
+ if (u === "never") {
1153
+ s.push(f);
1154
+ continue;
1155
+ }
1156
+ const _ = c.run({ value: t[f], issues: [] }, o);
1157
+ _ instanceof Promise ? e.push(_.then((b) => ue(b, n, f, t, p))) : ue(_, 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 Ro = /* @__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 a = t.shape;
1171
+ Object.defineProperty(t, "shape", {
1172
+ get: () => {
1173
+ const c = { ...a };
1174
+ return Object.defineProperty(t, "shape", {
1175
+ value: c
1176
+ }), c;
1177
+ }
1178
+ });
1179
+ }
1180
+ const o = fe(() => zt(t));
1181
+ w(e._zod, "propValues", () => {
1182
+ const a = t.shape, c = {};
1183
+ for (const u in a) {
1184
+ const p = a[u]._zod;
1185
+ if (p.values) {
1186
+ c[u] ?? (c[u] = /* @__PURE__ */ new Set());
1187
+ for (const f of p.values)
1188
+ c[u].add(f);
1189
+ }
1190
+ }
1191
+ return c;
1192
+ });
1193
+ const r = ne, i = t.catchall;
1194
+ let s;
1195
+ e._zod.parse = (a, c) => {
1196
+ s ?? (s = o.value);
1197
+ const u = a.value;
1198
+ if (!r(u))
1199
+ return a.issues.push({
1200
+ expected: "object",
1201
+ code: "invalid_type",
1202
+ input: u,
1203
+ inst: e
1204
+ }), a;
1205
+ a.value = {};
1206
+ const p = [], f = s.shape;
1207
+ for (const _ of s.keys) {
1208
+ const b = f[_], k = b._zod.optout === "optional", z = b._zod.run({ value: u[_], issues: [] }, c);
1209
+ z instanceof Promise ? p.push(z.then((P) => ue(P, a, _, u, k))) : ue(z, a, _, u, k);
1210
+ }
1211
+ return i ? kt(p, u, a, c, o.value, e) : p.length ? Promise.all(p).then(() => a) : a;
1212
+ };
1213
+ }), Do = /* @__PURE__ */ l("$ZodObjectJIT", (e, t) => {
1214
+ Ro.init(e, t);
1215
+ const n = e._zod.parse, o = fe(() => zt(t)), r = (_) => {
1216
+ var re;
1217
+ const b = new oo(["shape", "payload", "ctx"]), k = o.value, z = (F) => {
1218
+ const A = xe(F);
1219
+ return `shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`;
1220
+ };
1221
+ b.write("const input = payload.value;");
1222
+ const P = /* @__PURE__ */ Object.create(null);
1223
+ let Q = 0;
1224
+ for (const F of k.keys)
1225
+ P[F] = `key_${Q++}`;
1226
+ b.write("const newResult = {};");
1227
+ for (const F of k.keys) {
1228
+ const A = P[F], D = xe(F), ve = _[F], Wt = ((re = ve == null ? void 0 : ve._zod) == null ? void 0 : re.optout) === "optional";
1229
+ b.write(`const ${A} = ${z(F)};`), Wt ? b.write(`
1230
+ if (${A}.issues.length) {
1231
+ if (${D} in input) {
1232
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
1233
+ ...iss,
1234
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
1235
+ })));
1236
+ }
1237
+ }
1238
+
1239
+ if (${A}.value === undefined) {
1240
+ if (${D} in input) {
1241
+ newResult[${D}] = undefined;
1242
+ }
1243
+ } else {
1244
+ newResult[${D}] = ${A}.value;
1245
+ }
1246
+
1247
+ `) : b.write(`
1248
+ if (${A}.issues.length) {
1249
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
1250
+ ...iss,
1251
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
1252
+ })));
1253
+ }
1254
+
1255
+ if (${A}.value === undefined) {
1256
+ if (${D} in input) {
1257
+ newResult[${D}] = undefined;
1258
+ }
1259
+ } else {
1260
+ newResult[${D}] = ${A}.value;
1261
+ }
1262
+
1263
+ `);
1264
+ }
1265
+ b.write("payload.value = newResult;"), b.write("return payload;");
1266
+ const N = b.compile();
1267
+ return (F, A) => N(_, F, A);
1268
+ };
1269
+ let i;
1270
+ const s = ne, a = !st.jitless, u = a && qt.value, p = t.catchall;
1271
+ let f;
1272
+ e._zod.parse = (_, b) => {
1273
+ f ?? (f = o.value);
1274
+ const k = _.value;
1275
+ return s(k) ? a && u && (b == null ? void 0 : b.async) === !1 && b.jitless !== !0 ? (i || (i = r(t.shape)), _ = i(_, b), p ? kt([], k, _, b, f, e) : _) : n(_, b) : (_.issues.push({
1276
+ expected: "object",
1277
+ code: "invalid_type",
1278
+ input: k,
1279
+ inst: e
1280
+ }), _);
1281
+ };
1282
+ });
1283
+ function Fe(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) => !G(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) => J(s, o, M())))
1293
+ }), t);
1294
+ }
1295
+ const St = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
1296
+ S.init(e, t), w(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), w(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), w(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
+ }), w(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) => Oe(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 a = [];
1311
+ for (const c of t.options) {
1312
+ const u = c._zod.run({
1313
+ value: r.value,
1314
+ issues: []
1315
+ }, i);
1316
+ if (u instanceof Promise)
1317
+ a.push(u), s = !0;
1318
+ else {
1319
+ if (u.issues.length === 0)
1320
+ return u;
1321
+ a.push(u);
1322
+ }
1323
+ }
1324
+ return s ? Promise.all(a).then((c) => Fe(c, r, e, i)) : Fe(a, r, e, i);
1325
+ };
1326
+ }), Fo = /* @__PURE__ */ l("$ZodDiscriminatedUnion", (e, t) => {
1327
+ t.inclusive = !1, St.init(e, t);
1328
+ const n = e._zod.parse;
1329
+ w(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 [a, c] of Object.entries(s)) {
1336
+ r[a] || (r[a] = /* @__PURE__ */ new Set());
1337
+ for (const u of c)
1338
+ r[a].add(u);
1339
+ }
1340
+ }
1341
+ return r;
1342
+ });
1343
+ const o = fe(() => {
1344
+ var s;
1345
+ const r = t.options, i = /* @__PURE__ */ new Map();
1346
+ for (const a of r) {
1347
+ const c = (s = a._zod.propValues) == null ? void 0 : s[t.discriminator];
1348
+ if (!c || c.size === 0)
1349
+ throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);
1350
+ for (const u of c) {
1351
+ if (i.has(u))
1352
+ throw new Error(`Duplicate discriminator value "${String(u)}"`);
1353
+ i.set(u, a);
1354
+ }
1355
+ }
1356
+ return i;
1357
+ });
1358
+ e._zod.parse = (r, i) => {
1359
+ const s = r.value;
1360
+ if (!ne(s))
1361
+ return r.issues.push({
1362
+ code: "invalid_type",
1363
+ expected: "object",
1364
+ input: s,
1365
+ inst: e
1366
+ }), r;
1367
+ const a = o.value.get(s == null ? void 0 : s[t.discriminator]);
1368
+ return a ? a._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
+ }), Lo = /* @__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(([c, u]) => Le(n, c, u)) : Le(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 Le(e, t, n) {
1420
+ const o = /* @__PURE__ */ new Map();
1421
+ let r;
1422
+ for (const a of t.issues)
1423
+ if (a.code === "unrecognized_keys") {
1424
+ r ?? (r = a);
1425
+ for (const c of a.keys)
1426
+ o.has(c) || o.set(c, {}), o.get(c).l = !0;
1427
+ } else
1428
+ e.issues.push(a);
1429
+ for (const a of n.issues)
1430
+ if (a.code === "unrecognized_keys")
1431
+ for (const c of a.keys)
1432
+ o.has(c) || o.set(c, {}), o.get(c).r = !0;
1433
+ else
1434
+ e.issues.push(a);
1435
+ const i = [...o].filter(([, a]) => a.l && a.r).map(([a]) => a);
1436
+ if (i.length && r && e.issues.push({ ...r, keys: i }), G(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 Uo = /* @__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 = [], a = [...n].reverse().findIndex((p) => p._zod.optin !== "optional"), c = a === -1 ? 0 : n.length - a;
1457
+ if (!t.rest) {
1458
+ const p = i.length > n.length, f = i.length < c - 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 >= c)
1470
+ continue;
1471
+ const f = p._zod.run({
1472
+ value: i[u],
1473
+ issues: []
1474
+ }, r);
1475
+ f instanceof Promise ? s.push(f.then((_) => se(_, o, u))) : se(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 _ = t.rest._zod.run({
1482
+ value: f,
1483
+ issues: []
1484
+ }, r);
1485
+ _ instanceof Promise ? s.push(_.then((b) => se(b, o, u))) : se(_, o, u);
1486
+ }
1487
+ }
1488
+ return s.length ? Promise.all(s).then(() => o) : o;
1489
+ };
1490
+ });
1491
+ function se(e, t, n) {
1492
+ e.issues.length && t.issues.push(...B(n, e.issues)), t.value[n] = e.value;
1493
+ }
1494
+ const Mo = /* @__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 a = /* @__PURE__ */ new Set();
1508
+ for (const u of s)
1509
+ if (typeof u == "string" || typeof u == "number" || typeof u == "symbol") {
1510
+ a.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 c;
1517
+ for (const u in r)
1518
+ a.has(u) || (c = c ?? [], c.push(u));
1519
+ c && c.length > 0 && n.issues.push({
1520
+ code: "unrecognized_keys",
1521
+ input: r,
1522
+ inst: e,
1523
+ keys: c
1524
+ });
1525
+ } else {
1526
+ n.value = {};
1527
+ for (const a of Reflect.ownKeys(r)) {
1528
+ if (a === "__proto__")
1529
+ continue;
1530
+ let c = t.keyType._zod.run({ value: a, issues: [] }, o);
1531
+ if (c instanceof Promise)
1532
+ throw new Error("Async schemas not supported in object keys currently");
1533
+ if (typeof a == "string" && gt.test(a) && c.issues.length) {
1534
+ const f = t.keyType._zod.run({ value: Number(a), issues: [] }, o);
1535
+ if (f instanceof Promise)
1536
+ throw new Error("Async schemas not supported in object keys currently");
1537
+ f.issues.length === 0 && (c = f);
1538
+ }
1539
+ if (c.issues.length) {
1540
+ t.mode === "loose" ? n.value[a] = r[a] : n.issues.push({
1541
+ code: "invalid_key",
1542
+ origin: "record",
1543
+ issues: c.issues.map((f) => J(f, o, M())),
1544
+ input: a,
1545
+ path: [a],
1546
+ inst: e
1547
+ });
1548
+ continue;
1549
+ }
1550
+ const p = t.valueType._zod.run({ value: r[a], issues: [] }, o);
1551
+ p instanceof Promise ? i.push(p.then((f) => {
1552
+ f.issues.length && n.issues.push(...B(a, f.issues)), n.value[c.value] = f.value;
1553
+ })) : (p.issues.length && n.issues.push(...B(a, p.issues)), n.value[c.value] = p.value);
1554
+ }
1555
+ }
1556
+ return i.length ? Promise.all(i).then(() => n) : n;
1557
+ };
1558
+ }), Jo = /* @__PURE__ */ l("$ZodEnum", (e, t) => {
1559
+ S.init(e, t);
1560
+ const n = at(t.entries), o = new Set(n);
1561
+ e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) => Yt.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
+ }), Vo = /* @__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
+ }), Bo = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
1584
+ S.init(e, t), e._zod.parse = (n, o) => {
1585
+ if (o.direction === "backward")
1586
+ throw new it(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 Ue(e, t) {
1596
+ return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
1597
+ }
1598
+ const Zt = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
1599
+ S.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", w(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), w(e._zod, "pattern", () => {
1600
+ const n = t.innerType._zod.pattern;
1601
+ return n ? new RegExp(`^(${Oe(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) => Ue(i, n.value)) : Ue(r, n.value);
1606
+ }
1607
+ return n.value === void 0 ? n : t.innerType._zod.run(n, o);
1608
+ };
1609
+ }), Wo = /* @__PURE__ */ l("$ZodExactOptional", (e, t) => {
1610
+ Zt.init(e, t), w(e._zod, "values", () => t.innerType._zod.values), w(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, o) => t.innerType._zod.run(n, o);
1611
+ }), Go = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
1612
+ S.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "pattern", () => {
1613
+ const n = t.innerType._zod.pattern;
1614
+ return n ? new RegExp(`^(${Oe(n.source)}|null)$`) : void 0;
1615
+ }), w(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
+ }), Ko = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
1617
+ S.init(e, t), e._zod.optin = "optional", w(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) => Me(i, t)) : Me(r, t);
1624
+ };
1625
+ });
1626
+ function Me(e, t) {
1627
+ return e.value === void 0 && (e.value = t.defaultValue), e;
1628
+ }
1629
+ const qo = /* @__PURE__ */ l("$ZodPrefault", (e, t) => {
1630
+ S.init(e, t), e._zod.optin = "optional", w(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
+ }), Yo = /* @__PURE__ */ l("$ZodNonOptional", (e, t) => {
1632
+ S.init(e, t), w(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) => Je(i, e)) : Je(r, e);
1638
+ };
1639
+ });
1640
+ function Je(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 Xo = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
1649
+ S.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(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) => J(s, o, M()))
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) => J(i, o, M()))
1663
+ },
1664
+ input: n.value
1665
+ }), n.issues = []), n);
1666
+ };
1667
+ }), Ho = /* @__PURE__ */ l("$ZodPipe", (e, t) => {
1668
+ S.init(e, t), w(e._zod, "values", () => t.in._zod.values), w(e._zod, "optin", () => t.in._zod.optin), w(e._zod, "optout", () => t.out._zod.optout), w(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) => ae(s, t.in, o)) : ae(i, t.in, o);
1672
+ }
1673
+ const r = t.in._zod.run(n, o);
1674
+ return r instanceof Promise ? r.then((i) => ae(i, t.out, o)) : ae(r, t.out, o);
1675
+ };
1676
+ });
1677
+ function ae(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 Qo = /* @__PURE__ */ l("$ZodReadonly", (e, t) => {
1681
+ S.init(e, t), w(e._zod, "propValues", () => t.innerType._zod.propValues), w(e._zod, "values", () => t.innerType._zod.values), w(e._zod, "optin", () => {
1682
+ var n, o;
1683
+ return (o = (n = t.innerType) == null ? void 0 : n._zod) == null ? void 0 : o.optin;
1684
+ }), w(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(Ve) : Ve(r);
1692
+ };
1693
+ });
1694
+ function Ve(e) {
1695
+ return e.value = Object.freeze(e.value), e;
1696
+ }
1697
+ const er = /* @__PURE__ */ l("$ZodLazy", (e, t) => {
1698
+ S.init(e, t), w(e._zod, "innerType", () => t.getter()), w(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
+ }), w(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
+ }), w(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
+ }), w(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
+ }), tr = /* @__PURE__ */ l("$ZodCustom", (e, t) => {
1712
+ j.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) => Be(i, n, o, e));
1716
+ Be(r, n, o, e);
1717
+ };
1718
+ });
1719
+ function Be(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(oe(r));
1732
+ }
1733
+ }
1734
+ var We;
1735
+ class nr {
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 or() {
1765
+ return new nr();
1766
+ }
1767
+ (We = globalThis).__zod_globalRegistry ?? (We.__zod_globalRegistry = or());
1768
+ const ee = globalThis.__zod_globalRegistry;
1769
+ // @__NO_SIDE_EFFECTS__
1770
+ function rr(e, t) {
1771
+ return new e({
1772
+ type: "string",
1773
+ ...m(t)
1774
+ });
1775
+ }
1776
+ // @__NO_SIDE_EFFECTS__
1777
+ function ir(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 Ge(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 sr(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 ar(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 cr(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 ur(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 lr(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 pr(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 fr(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 dr(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 hr(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 mr(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 gr(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 _r(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 vr(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 yr(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 br(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 wr(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 zr(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 kr(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 Sr(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 Zr(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 $r(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 Or(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 Tr(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 Ir(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 Pr(e, t) {
2041
+ return new e({
2042
+ type: "number",
2043
+ checks: [],
2044
+ ...m(t)
2045
+ });
2046
+ }
2047
+ // @__NO_SIDE_EFFECTS__
2048
+ function Er(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 Nr(e, t) {
2059
+ return new e({
2060
+ type: "boolean",
2061
+ ...m(t)
2062
+ });
2063
+ }
2064
+ // @__NO_SIDE_EFFECTS__
2065
+ function Cr(e, t) {
2066
+ return new e({
2067
+ type: "null",
2068
+ ...m(t)
2069
+ });
2070
+ }
2071
+ // @__NO_SIDE_EFFECTS__
2072
+ function Ar(e) {
2073
+ return new e({
2074
+ type: "unknown"
2075
+ });
2076
+ }
2077
+ // @__NO_SIDE_EFFECTS__
2078
+ function jr(e, t) {
2079
+ return new e({
2080
+ type: "never",
2081
+ ...m(t)
2082
+ });
2083
+ }
2084
+ // @__NO_SIDE_EFFECTS__
2085
+ function Ke(e, t) {
2086
+ return new vt({
2087
+ check: "less_than",
2088
+ ...m(t),
2089
+ value: e,
2090
+ inclusive: !1
2091
+ });
2092
+ }
2093
+ // @__NO_SIDE_EFFECTS__
2094
+ function ye(e, t) {
2095
+ return new vt({
2096
+ check: "less_than",
2097
+ ...m(t),
2098
+ value: e,
2099
+ inclusive: !0
2100
+ });
2101
+ }
2102
+ // @__NO_SIDE_EFFECTS__
2103
+ function qe(e, t) {
2104
+ return new yt({
2105
+ check: "greater_than",
2106
+ ...m(t),
2107
+ value: e,
2108
+ inclusive: !1
2109
+ });
2110
+ }
2111
+ // @__NO_SIDE_EFFECTS__
2112
+ function be(e, t) {
2113
+ return new yt({
2114
+ check: "greater_than",
2115
+ ...m(t),
2116
+ value: e,
2117
+ inclusive: !0
2118
+ });
2119
+ }
2120
+ // @__NO_SIDE_EFFECTS__
2121
+ function Ye(e, t) {
2122
+ return new Bn({
2123
+ check: "multiple_of",
2124
+ ...m(t),
2125
+ value: e
2126
+ });
2127
+ }
2128
+ // @__NO_SIDE_EFFECTS__
2129
+ function $t(e, t) {
2130
+ return new Gn({
2131
+ check: "max_length",
2132
+ ...m(t),
2133
+ maximum: e
2134
+ });
2135
+ }
2136
+ // @__NO_SIDE_EFFECTS__
2137
+ function le(e, t) {
2138
+ return new Kn({
2139
+ check: "min_length",
2140
+ ...m(t),
2141
+ minimum: e
2142
+ });
2143
+ }
2144
+ // @__NO_SIDE_EFFECTS__
2145
+ function Ot(e, t) {
2146
+ return new qn({
2147
+ check: "length_equals",
2148
+ ...m(t),
2149
+ length: e
2150
+ });
2151
+ }
2152
+ // @__NO_SIDE_EFFECTS__
2153
+ function xr(e, t) {
2154
+ return new Yn({
2155
+ check: "string_format",
2156
+ format: "regex",
2157
+ ...m(t),
2158
+ pattern: e
2159
+ });
2160
+ }
2161
+ // @__NO_SIDE_EFFECTS__
2162
+ function Rr(e) {
2163
+ return new Xn({
2164
+ check: "string_format",
2165
+ format: "lowercase",
2166
+ ...m(e)
2167
+ });
2168
+ }
2169
+ // @__NO_SIDE_EFFECTS__
2170
+ function Dr(e) {
2171
+ return new Hn({
2172
+ check: "string_format",
2173
+ format: "uppercase",
2174
+ ...m(e)
2175
+ });
2176
+ }
2177
+ // @__NO_SIDE_EFFECTS__
2178
+ function Fr(e, t) {
2179
+ return new Qn({
2180
+ check: "string_format",
2181
+ format: "includes",
2182
+ ...m(t),
2183
+ includes: e
2184
+ });
2185
+ }
2186
+ // @__NO_SIDE_EFFECTS__
2187
+ function Lr(e, t) {
2188
+ return new eo({
2189
+ check: "string_format",
2190
+ format: "starts_with",
2191
+ ...m(t),
2192
+ prefix: e
2193
+ });
2194
+ }
2195
+ // @__NO_SIDE_EFFECTS__
2196
+ function Ur(e, t) {
2197
+ return new to({
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 no({
2207
+ check: "overwrite",
2208
+ tx: e
2209
+ });
2210
+ }
2211
+ // @__NO_SIDE_EFFECTS__
2212
+ function Mr(e) {
2213
+ return /* @__PURE__ */ H((t) => t.normalize(e));
2214
+ }
2215
+ // @__NO_SIDE_EFFECTS__
2216
+ function Jr() {
2217
+ return /* @__PURE__ */ H((e) => e.trim());
2218
+ }
2219
+ // @__NO_SIDE_EFFECTS__
2220
+ function Vr() {
2221
+ return /* @__PURE__ */ H((e) => e.toLowerCase());
2222
+ }
2223
+ // @__NO_SIDE_EFFECTS__
2224
+ function Br() {
2225
+ return /* @__PURE__ */ H((e) => e.toUpperCase());
2226
+ }
2227
+ // @__NO_SIDE_EFFECTS__
2228
+ function Wr() {
2229
+ return /* @__PURE__ */ H((e) => Kt(e));
2230
+ }
2231
+ // @__NO_SIDE_EFFECTS__
2232
+ function Gr(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 Kr(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 qr(e) {
2253
+ const t = /* @__PURE__ */ Yr((n) => (n.addIssue = (o) => {
2254
+ if (typeof o == "string")
2255
+ n.issues.push(oe(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(oe(r));
2259
+ }
2260
+ }, e(n.value, n)));
2261
+ return t;
2262
+ }
2263
+ // @__NO_SIDE_EFFECTS__
2264
+ function Yr(e, t) {
2265
+ const n = new j({
2266
+ check: "custom",
2267
+ ...m(t)
2268
+ });
2269
+ return n._zod.check = e, n;
2270
+ }
2271
+ function Tt(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 T(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 a = (f = (p = e._zod).toJSONSchema) == null ? void 0 : f.call(p);
2297
+ if (a)
2298
+ s.schema = a;
2299
+ else {
2300
+ const _ = {
2301
+ ...n,
2302
+ schemaPath: [...n.schemaPath, e],
2303
+ path: n.path
2304
+ };
2305
+ if (e._zod.processJSONSchema)
2306
+ e._zod.processJSONSchema(t, s.schema, _);
2307
+ else {
2308
+ const k = s.schema, z = t.processors[r.type];
2309
+ if (!z)
2310
+ throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);
2311
+ z(e, t, k, _);
2312
+ }
2313
+ const b = e._zod.parent;
2314
+ b && (s.ref || (s.ref = b), T(b, t, _), t.seen.get(b).isParent = !0);
2315
+ }
2316
+ const c = t.metadataRegistry.get(e);
2317
+ return c && Object.assign(s.schema, c), t.io === "input" && C(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 It(e, t) {
2320
+ var s, a, c, 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 _ = o.get(f);
2329
+ if (_ && _ !== 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 z;
2336
+ const f = e.target === "draft-2020-12" ? "$defs" : "definitions";
2337
+ if (e.external) {
2338
+ const P = (z = e.external.registry.get(p[0])) == null ? void 0 : z.id, Q = e.external.uri ?? ((re) => re);
2339
+ if (P)
2340
+ return { ref: Q(P) };
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 b = `#/${f}/`, k = p[1].schema.id ?? `__schema${e.counter++}`;
2347
+ return { defId: k, ref: b + k };
2348
+ }, i = (p) => {
2349
+ if (p[1].schema.$ref)
2350
+ return;
2351
+ const f = p[1], { ref: _, defId: b } = r(p);
2352
+ f.def = { ...f.schema }, b && (f.defId = b);
2353
+ const k = f.schema;
2354
+ for (const z in k)
2355
+ delete k[z];
2356
+ k.$ref = _;
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: #/${(a = f.cycle) == null ? void 0 : a.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 b = (c = e.external.registry.get(p[0])) == null ? void 0 : c.id;
2374
+ if (t !== p[0] && b) {
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 Pt(e, t) {
2394
+ var s, a, c;
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, _ = { ...f }, b = p.ref;
2403
+ if (p.ref = null, b) {
2404
+ o(b);
2405
+ const z = e.seen.get(b), P = z.schema;
2406
+ if (P.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (f.allOf = f.allOf ?? [], f.allOf.push(P)) : Object.assign(f, P), Object.assign(f, _), u._zod.parent === b)
2407
+ for (const N in f)
2408
+ N === "$ref" || N === "allOf" || N in _ || delete f[N];
2409
+ if (P.$ref && z.def)
2410
+ for (const N in f)
2411
+ N === "$ref" || N === "allOf" || N in z.def && JSON.stringify(f[N]) === JSON.stringify(z.def[N]) && delete f[N];
2412
+ }
2413
+ const k = u._zod.parent;
2414
+ if (k && k !== b) {
2415
+ o(k);
2416
+ const z = e.seen.get(k);
2417
+ if (z != null && z.schema.$ref && (f.$ref = z.schema.$ref, z.def))
2418
+ for (const P in f)
2419
+ P === "$ref" || P === "allOf" || P in z.def && JSON.stringify(f[P]) === JSON.stringify(z.def[P]) && delete f[P];
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 = (a = e.external.registry.get(t)) == null ? void 0 : a.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 = ((c = e.external) == null ? void 0 : c.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: pe(t, "input", e.processors),
2450
+ output: pe(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 C(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 C(o.element, n);
2470
+ if (o.type === "set")
2471
+ return C(o.valueType, n);
2472
+ if (o.type === "lazy")
2473
+ return C(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 C(o.innerType, n);
2476
+ if (o.type === "intersection")
2477
+ return C(o.left, n) || C(o.right, n);
2478
+ if (o.type === "record" || o.type === "map")
2479
+ return C(o.keyType, n) || C(o.valueType, n);
2480
+ if (o.type === "pipe")
2481
+ return C(o.in, n) || C(o.out, n);
2482
+ if (o.type === "object") {
2483
+ for (const r in o.shape)
2484
+ if (C(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 (C(r, n))
2491
+ return !0;
2492
+ return !1;
2493
+ }
2494
+ if (o.type === "tuple") {
2495
+ for (const r of o.items)
2496
+ if (C(r, n))
2497
+ return !0;
2498
+ return !!(o.rest && C(o.rest, n));
2499
+ }
2500
+ return !1;
2501
+ }
2502
+ const Xr = (e, t = {}) => (n) => {
2503
+ const o = Tt({ ...n, processors: t });
2504
+ return T(e, o), It(o, e), Pt(o, e);
2505
+ }, pe = (e, t, n = {}) => (o) => {
2506
+ const { libraryOptions: r, target: i } = o ?? {}, s = Tt({ ...r ?? {}, target: i, io: t, processors: n });
2507
+ return T(e, s), It(s, e), Pt(s, e);
2508
+ }, Hr = {
2509
+ guid: "uuid",
2510
+ url: "uri",
2511
+ datetime: "date-time",
2512
+ json_string: "json-string",
2513
+ regex: ""
2514
+ // do not set
2515
+ }, Qr = (e, t, n, o) => {
2516
+ const r = n;
2517
+ r.type = "string";
2518
+ const { minimum: i, maximum: s, format: a, patterns: c, contentEncoding: u } = e._zod.bag;
2519
+ if (typeof i == "number" && (r.minLength = i), typeof s == "number" && (r.maxLength = s), a && (r.format = Hr[a] ?? a, r.format === "" && delete r.format, a === "time" && delete r.format), u && (r.contentEncoding = u), c && c.size > 0) {
2520
+ const p = [...c];
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
+ }, ei = (e, t, n, o) => {
2529
+ const r = n, { minimum: i, maximum: s, format: a, multipleOf: c, exclusiveMaximum: u, exclusiveMinimum: p } = e._zod.bag;
2530
+ typeof a == "string" && a.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 c == "number" && (r.multipleOf = c);
2531
+ }, ti = (e, t, n, o) => {
2532
+ n.type = "boolean";
2533
+ }, ni = (e, t, n, o) => {
2534
+ t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
2535
+ }, oi = (e, t, n, o) => {
2536
+ n.not = {};
2537
+ }, ri = (e, t, n, o) => {
2538
+ }, ii = (e, t, n, o) => {
2539
+ const r = e._zod.def, i = at(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
+ }, si = (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
+ }, ai = (e, t, n, o) => {
2559
+ if (t.unrepresentable === "throw")
2560
+ throw new Error("Custom types cannot be represented in JSON Schema");
2561
+ }, ci = (e, t, n, o) => {
2562
+ if (t.unrepresentable === "throw")
2563
+ throw new Error("Transforms cannot be represented in JSON Schema");
2564
+ }, ui = (e, t, n, o) => {
2565
+ const r = n, i = e._zod.def, { minimum: s, maximum: a } = e._zod.bag;
2566
+ typeof s == "number" && (r.minItems = s), typeof a == "number" && (r.maxItems = a), r.type = "array", r.items = T(i.element, t, { ...o, path: [...o.path, "items"] });
2567
+ }, li = (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] = T(s[p], t, {
2574
+ ...o,
2575
+ path: [...o.path, "properties", p]
2576
+ });
2577
+ const a = new Set(Object.keys(s)), c = new Set([...a].filter((p) => {
2578
+ const f = i.shape[p]._zod;
2579
+ return t.io === "input" ? f.optin === void 0 : f.optout === void 0;
2580
+ }));
2581
+ c.size > 0 && (r.required = Array.from(c)), ((u = i.catchall) == null ? void 0 : u._zod.def.type) === "never" ? r.additionalProperties = !1 : i.catchall ? i.catchall && (r.additionalProperties = T(i.catchall, t, {
2582
+ ...o,
2583
+ path: [...o.path, "additionalProperties"]
2584
+ })) : t.io === "output" && (r.additionalProperties = !1);
2585
+ }, pi = (e, t, n, o) => {
2586
+ const r = e._zod.def, i = r.inclusive === !1, s = r.options.map((a, c) => T(a, t, {
2587
+ ...o,
2588
+ path: [...o.path, i ? "oneOf" : "anyOf", c]
2589
+ }));
2590
+ i ? n.oneOf = s : n.anyOf = s;
2591
+ }, fi = (e, t, n, o) => {
2592
+ const r = e._zod.def, i = T(r.left, t, {
2593
+ ...o,
2594
+ path: [...o.path, "allOf", 0]
2595
+ }), s = T(r.right, t, {
2596
+ ...o,
2597
+ path: [...o.path, "allOf", 1]
2598
+ }), a = (u) => "allOf" in u && Object.keys(u).length === 1, c = [
2599
+ ...a(i) ? i.allOf : [i],
2600
+ ...a(s) ? s.allOf : [s]
2601
+ ];
2602
+ n.allOf = c;
2603
+ }, di = (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", a = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = i.items.map((_, b) => T(_, t, {
2607
+ ...o,
2608
+ path: [...o.path, s, b]
2609
+ })), u = i.rest ? T(i.rest, t, {
2610
+ ...o,
2611
+ path: [...o.path, a, ...t.target === "openapi-3.0" ? [i.items.length] : []]
2612
+ }) : null;
2613
+ t.target === "draft-2020-12" ? (r.prefixItems = c, u && (r.items = u)) : t.target === "openapi-3.0" ? (r.items = {
2614
+ anyOf: c
2615
+ }, u && r.items.anyOf.push(u), r.minItems = c.length, u || (r.maxItems = c.length)) : (r.items = c, 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
+ }, hi = (e, t, n, o) => {
2619
+ const r = n, i = e._zod.def;
2620
+ r.type = "object";
2621
+ const s = i.keyType, a = s._zod.bag, c = a == null ? void 0 : a.patterns;
2622
+ if (i.mode === "loose" && c && c.size > 0) {
2623
+ const p = T(i.valueType, t, {
2624
+ ...o,
2625
+ path: [...o.path, "patternProperties", "*"]
2626
+ });
2627
+ r.patternProperties = {};
2628
+ for (const f of c)
2629
+ r.patternProperties[f.source] = p;
2630
+ } else
2631
+ (t.target === "draft-07" || t.target === "draft-2020-12") && (r.propertyNames = T(i.keyType, t, {
2632
+ ...o,
2633
+ path: [...o.path, "propertyNames"]
2634
+ })), r.additionalProperties = T(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
+ }, mi = (e, t, n, o) => {
2644
+ const r = e._zod.def, i = T(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
+ }, gi = (e, t, n, o) => {
2647
+ const r = e._zod.def;
2648
+ T(r.innerType, t, o);
2649
+ const i = t.seen.get(e);
2650
+ i.ref = r.innerType;
2651
+ }, _i = (e, t, n, o) => {
2652
+ const r = e._zod.def;
2653
+ T(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
+ }, vi = (e, t, n, o) => {
2657
+ const r = e._zod.def;
2658
+ T(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
+ }, yi = (e, t, n, o) => {
2662
+ const r = e._zod.def;
2663
+ T(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
+ }, bi = (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
+ T(i, t, o);
2676
+ const s = t.seen.get(e);
2677
+ s.ref = i;
2678
+ }, wi = (e, t, n, o) => {
2679
+ const r = e._zod.def;
2680
+ T(r.innerType, t, o);
2681
+ const i = t.seen.get(e);
2682
+ i.ref = r.innerType, n.readOnly = !0;
2683
+ }, Et = (e, t, n, o) => {
2684
+ const r = e._zod.def;
2685
+ T(r.innerType, t, o);
2686
+ const i = t.seen.get(e);
2687
+ i.ref = r.innerType;
2688
+ }, zi = (e, t, n, o) => {
2689
+ const r = e._zod.innerType;
2690
+ T(r, t, o);
2691
+ const i = t.seen.get(e);
2692
+ i.ref = r;
2693
+ }, ki = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
2694
+ _o.init(e, t), I.init(e, t);
2695
+ });
2696
+ function Si(e) {
2697
+ return /* @__PURE__ */ $r(ki, e);
2698
+ }
2699
+ const Zi = /* @__PURE__ */ l("ZodISODate", (e, t) => {
2700
+ vo.init(e, t), I.init(e, t);
2701
+ });
2702
+ function $i(e) {
2703
+ return /* @__PURE__ */ Or(Zi, e);
2704
+ }
2705
+ const Oi = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
2706
+ yo.init(e, t), I.init(e, t);
2707
+ });
2708
+ function Ti(e) {
2709
+ return /* @__PURE__ */ Tr(Oi, e);
2710
+ }
2711
+ const Ii = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
2712
+ bo.init(e, t), I.init(e, t);
2713
+ });
2714
+ function Pi(e) {
2715
+ return /* @__PURE__ */ Ir(Ii, e);
2716
+ }
2717
+ const Ei = (e, t) => {
2718
+ pt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2719
+ format: {
2720
+ value: (n) => cn(e, n)
2721
+ // enumerable: false,
2722
+ },
2723
+ flatten: {
2724
+ value: (n) => an(e, n)
2725
+ // enumerable: false,
2726
+ },
2727
+ addIssue: {
2728
+ value: (n) => {
2729
+ e.issues.push(n), e.message = JSON.stringify(e.issues, we, 2);
2730
+ }
2731
+ // enumerable: false,
2732
+ },
2733
+ addIssues: {
2734
+ value: (n) => {
2735
+ e.issues.push(...n), e.message = JSON.stringify(e.issues, we, 2);
2736
+ }
2737
+ // enumerable: false,
2738
+ },
2739
+ isEmpty: {
2740
+ get() {
2741
+ return e.issues.length === 0;
2742
+ }
2743
+ // enumerable: false,
2744
+ }
2745
+ });
2746
+ }, R = l("ZodError", Ei, {
2747
+ Parent: Error
2748
+ }), Ni = /* @__PURE__ */ Ie(R), Ci = /* @__PURE__ */ Pe(R), Ai = /* @__PURE__ */ de(R), ji = /* @__PURE__ */ he(R), xi = /* @__PURE__ */ pn(R), Ri = /* @__PURE__ */ fn(R), Di = /* @__PURE__ */ dn(R), Fi = /* @__PURE__ */ hn(R), Li = /* @__PURE__ */ mn(R), Ui = /* @__PURE__ */ gn(R), Mi = /* @__PURE__ */ _n(R), Ji = /* @__PURE__ */ vn(R), $ = /* @__PURE__ */ l("ZodType", (e, t) => (S.init(e, t), Object.assign(e["~standard"], {
2749
+ jsonSchema: {
2750
+ input: pe(e, "input"),
2751
+ output: pe(e, "output")
2752
+ }
2753
+ }), e.toJSONSchema = Xr(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(V(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) => U(e, n, o), e.brand = () => e, e.register = ((n, o) => (n.add(e, o), e)), e.parse = (n, o) => Ni(e, n, o, { callee: e.parse }), e.safeParse = (n, o) => Ai(e, n, o), e.parseAsync = async (n, o) => Ci(e, n, o, { callee: e.parseAsync }), e.safeParseAsync = async (n, o) => ji(e, n, o), e.spa = e.safeParseAsync, e.encode = (n, o) => xi(e, n, o), e.decode = (n, o) => Ri(e, n, o), e.encodeAsync = async (n, o) => Di(e, n, o), e.decodeAsync = async (n, o) => Fi(e, n, o), e.safeEncode = (n, o) => Li(e, n, o), e.safeDecode = (n, o) => Ui(e, n, o), e.safeEncodeAsync = async (n, o) => Mi(e, n, o), e.safeDecodeAsync = async (n, o) => Ji(e, n, o), e.refine = (n, o) => e.check(Fs(n, o)), e.superRefine = (n) => e.check(Ls(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ H(n)), e.optional = () => et(e), e.exactOptional = () => Ss(e), e.nullable = () => tt(e), e.nullish = () => et(tt(e)), e.nonoptional = (n) => Ps(e, n), e.array = () => Z(e), e.or = (n) => x([e, n]), e.and = (n) => ys(e, n), e.transform = (n) => Ze(e, Rt(n)), e.default = (n) => Os(e, n), e.prefault = (n) => Is(e, n), e.catch = (n) => Ns(e, n), e.pipe = (n) => Ze(e, n), e.readonly = () => js(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)), Nt = /* @__PURE__ */ l("_ZodString", (e, t) => {
2775
+ Ee.init(e, t), $.init(e, t), e._zod.processJSONSchema = (o, r, i) => Qr(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__ */ xr(...o)), e.includes = (...o) => e.check(/* @__PURE__ */ Fr(...o)), e.startsWith = (...o) => e.check(/* @__PURE__ */ Lr(...o)), e.endsWith = (...o) => e.check(/* @__PURE__ */ Ur(...o)), e.min = (...o) => e.check(/* @__PURE__ */ le(...o)), e.max = (...o) => e.check(/* @__PURE__ */ $t(...o)), e.length = (...o) => e.check(/* @__PURE__ */ Ot(...o)), e.nonempty = (...o) => e.check(/* @__PURE__ */ le(1, ...o)), e.lowercase = (o) => e.check(/* @__PURE__ */ Rr(o)), e.uppercase = (o) => e.check(/* @__PURE__ */ Dr(o)), e.trim = () => e.check(/* @__PURE__ */ Jr()), e.normalize = (...o) => e.check(/* @__PURE__ */ Mr(...o)), e.toLowerCase = () => e.check(/* @__PURE__ */ Vr()), e.toUpperCase = () => e.check(/* @__PURE__ */ Br()), e.slugify = () => e.check(/* @__PURE__ */ Wr());
2778
+ }), Vi = /* @__PURE__ */ l("ZodString", (e, t) => {
2779
+ Ee.init(e, t), Nt.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ ir(Bi, n)), e.url = (n) => e.check(/* @__PURE__ */ lr(Wi, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Zr(as, n)), e.emoji = (n) => e.check(/* @__PURE__ */ pr(Gi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Ge(Xe, n)), e.uuid = (n) => e.check(/* @__PURE__ */ sr(ce, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ ar(ce, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ cr(ce, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ ur(ce, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ fr(Ki, n)), e.guid = (n) => e.check(/* @__PURE__ */ Ge(Xe, n)), e.cuid = (n) => e.check(/* @__PURE__ */ dr(qi, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ hr(Yi, n)), e.ulid = (n) => e.check(/* @__PURE__ */ mr(Xi, n)), e.base64 = (n) => e.check(/* @__PURE__ */ zr(rs, n)), e.base64url = (n) => e.check(/* @__PURE__ */ kr(is, n)), e.xid = (n) => e.check(/* @__PURE__ */ gr(Hi, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ _r(Qi, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ vr(es, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ yr(ts, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ br(ns, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ wr(os, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Sr(ss, n)), e.datetime = (n) => e.check(Si(n)), e.date = (n) => e.check($i(n)), e.time = (n) => e.check(Ti(n)), e.duration = (n) => e.check(Pi(n));
2780
+ });
2781
+ function h(e) {
2782
+ return /* @__PURE__ */ rr(Vi, e);
2783
+ }
2784
+ const I = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
2785
+ O.init(e, t), Nt.init(e, t);
2786
+ }), Bi = /* @__PURE__ */ l("ZodEmail", (e, t) => {
2787
+ ao.init(e, t), I.init(e, t);
2788
+ }), Xe = /* @__PURE__ */ l("ZodGUID", (e, t) => {
2789
+ io.init(e, t), I.init(e, t);
2790
+ }), ce = /* @__PURE__ */ l("ZodUUID", (e, t) => {
2791
+ so.init(e, t), I.init(e, t);
2792
+ }), Wi = /* @__PURE__ */ l("ZodURL", (e, t) => {
2793
+ co.init(e, t), I.init(e, t);
2794
+ }), Gi = /* @__PURE__ */ l("ZodEmoji", (e, t) => {
2795
+ uo.init(e, t), I.init(e, t);
2796
+ }), Ki = /* @__PURE__ */ l("ZodNanoID", (e, t) => {
2797
+ lo.init(e, t), I.init(e, t);
2798
+ }), qi = /* @__PURE__ */ l("ZodCUID", (e, t) => {
2799
+ po.init(e, t), I.init(e, t);
2800
+ }), Yi = /* @__PURE__ */ l("ZodCUID2", (e, t) => {
2801
+ fo.init(e, t), I.init(e, t);
2802
+ }), Xi = /* @__PURE__ */ l("ZodULID", (e, t) => {
2803
+ ho.init(e, t), I.init(e, t);
2804
+ }), Hi = /* @__PURE__ */ l("ZodXID", (e, t) => {
2805
+ mo.init(e, t), I.init(e, t);
2806
+ }), Qi = /* @__PURE__ */ l("ZodKSUID", (e, t) => {
2807
+ go.init(e, t), I.init(e, t);
2808
+ }), es = /* @__PURE__ */ l("ZodIPv4", (e, t) => {
2809
+ wo.init(e, t), I.init(e, t);
2810
+ }), ts = /* @__PURE__ */ l("ZodIPv6", (e, t) => {
2811
+ zo.init(e, t), I.init(e, t);
2812
+ }), ns = /* @__PURE__ */ l("ZodCIDRv4", (e, t) => {
2813
+ ko.init(e, t), I.init(e, t);
2814
+ }), os = /* @__PURE__ */ l("ZodCIDRv6", (e, t) => {
2815
+ So.init(e, t), I.init(e, t);
2816
+ }), rs = /* @__PURE__ */ l("ZodBase64", (e, t) => {
2817
+ Zo.init(e, t), I.init(e, t);
2818
+ }), is = /* @__PURE__ */ l("ZodBase64URL", (e, t) => {
2819
+ Oo.init(e, t), I.init(e, t);
2820
+ }), ss = /* @__PURE__ */ l("ZodE164", (e, t) => {
2821
+ To.init(e, t), I.init(e, t);
2822
+ }), as = /* @__PURE__ */ l("ZodJWT", (e, t) => {
2823
+ Po.init(e, t), I.init(e, t);
2824
+ }), Ct = /* @__PURE__ */ l("ZodNumber", (e, t) => {
2825
+ wt.init(e, t), $.init(e, t), e._zod.processJSONSchema = (o, r, i) => ei(e, o, r), e.gt = (o, r) => e.check(/* @__PURE__ */ qe(o, r)), e.gte = (o, r) => e.check(/* @__PURE__ */ be(o, r)), e.min = (o, r) => e.check(/* @__PURE__ */ be(o, r)), e.lt = (o, r) => e.check(/* @__PURE__ */ Ke(o, r)), e.lte = (o, r) => e.check(/* @__PURE__ */ ye(o, r)), e.max = (o, r) => e.check(/* @__PURE__ */ ye(o, r)), e.int = (o) => e.check(He(o)), e.safe = (o) => e.check(He(o)), e.positive = (o) => e.check(/* @__PURE__ */ qe(0, o)), e.nonnegative = (o) => e.check(/* @__PURE__ */ be(0, o)), e.negative = (o) => e.check(/* @__PURE__ */ Ke(0, o)), e.nonpositive = (o) => e.check(/* @__PURE__ */ ye(0, o)), e.multipleOf = (o, r) => e.check(/* @__PURE__ */ Ye(o, r)), e.step = (o, r) => e.check(/* @__PURE__ */ Ye(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__ */ Pr(Ct, e);
2831
+ }
2832
+ const cs = /* @__PURE__ */ l("ZodNumberFormat", (e, t) => {
2833
+ Eo.init(e, t), Ct.init(e, t);
2834
+ });
2835
+ function He(e) {
2836
+ return /* @__PURE__ */ Er(cs, e);
2837
+ }
2838
+ const us = /* @__PURE__ */ l("ZodBoolean", (e, t) => {
2839
+ No.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => ti(e, n, o);
2840
+ });
2841
+ function y(e) {
2842
+ return /* @__PURE__ */ Nr(us, e);
2843
+ }
2844
+ const ls = /* @__PURE__ */ l("ZodNull", (e, t) => {
2845
+ Co.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => ni(e, n, o);
2846
+ });
2847
+ function ps(e) {
2848
+ return /* @__PURE__ */ Cr(ls, e);
2849
+ }
2850
+ const fs = /* @__PURE__ */ l("ZodUnknown", (e, t) => {
2851
+ Ao.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => ri();
2852
+ });
2853
+ function ke() {
2854
+ return /* @__PURE__ */ Ar(fs);
2855
+ }
2856
+ const ds = /* @__PURE__ */ l("ZodNever", (e, t) => {
2857
+ jo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => oi(e, n, o);
2858
+ });
2859
+ function hs(e) {
2860
+ return /* @__PURE__ */ jr(ds, e);
2861
+ }
2862
+ const ms = /* @__PURE__ */ l("ZodArray", (e, t) => {
2863
+ xo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => ui(e, n, o, r), e.element = t.element, e.min = (n, o) => e.check(/* @__PURE__ */ le(n, o)), e.nonempty = (n) => e.check(/* @__PURE__ */ le(1, n)), e.max = (n, o) => e.check(/* @__PURE__ */ $t(n, o)), e.length = (n, o) => e.check(/* @__PURE__ */ Ot(n, o)), e.unwrap = () => e.element;
2864
+ });
2865
+ function Z(e, t) {
2866
+ return /* @__PURE__ */ Gr(ms, e, t);
2867
+ }
2868
+ const gs = /* @__PURE__ */ l("ZodObject", (e, t) => {
2869
+ Do.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => li(e, n, o, r), w(e, "shape", () => t.shape), e.keyof = () => v(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ke() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ke() }), e.strict = () => e.clone({ ...e._zod.def, catchall: hs() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => tn(e, n), e.safeExtend = (n) => nn(e, n), e.merge = (n) => on(e, n), e.pick = (n) => Qt(e, n), e.omit = (n) => en(e, n), e.partial = (...n) => rn(Dt, e, n[0]), e.required = (...n) => sn(Ft, e, n[0]);
2870
+ });
2871
+ function g(e, t) {
2872
+ const n = {
2873
+ type: "object",
2874
+ shape: e ?? {},
2875
+ ...m(t)
2876
+ };
2877
+ return new gs(n);
2878
+ }
2879
+ const At = /* @__PURE__ */ l("ZodUnion", (e, t) => {
2880
+ St.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => pi(e, n, o, r), e.options = t.options;
2881
+ });
2882
+ function x(e, t) {
2883
+ return new At({
2884
+ type: "union",
2885
+ options: e,
2886
+ ...m(t)
2887
+ });
2888
+ }
2889
+ const _s = /* @__PURE__ */ l("ZodDiscriminatedUnion", (e, t) => {
2890
+ At.init(e, t), Fo.init(e, t);
2891
+ });
2892
+ function Ne(e, t, n) {
2893
+ return new _s({
2894
+ type: "union",
2895
+ options: t,
2896
+ discriminator: e,
2897
+ ...m(n)
2898
+ });
2899
+ }
2900
+ const vs = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
2901
+ Lo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => fi(e, n, o, r);
2902
+ });
2903
+ function ys(e, t) {
2904
+ return new vs({
2905
+ type: "intersection",
2906
+ left: e,
2907
+ right: t
2908
+ });
2909
+ }
2910
+ const bs = /* @__PURE__ */ l("ZodTuple", (e, t) => {
2911
+ Uo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => di(e, n, o, r), e.rest = (n) => e.clone({
2912
+ ...e._zod.def,
2913
+ rest: n
2914
+ });
2915
+ });
2916
+ function L(e, t, n) {
2917
+ const o = t instanceof S, r = o ? n : t, i = o ? t : null;
2918
+ return new bs({
2919
+ type: "tuple",
2920
+ items: e,
2921
+ rest: i,
2922
+ ...m(r)
2923
+ });
2924
+ }
2925
+ const jt = /* @__PURE__ */ l("ZodRecord", (e, t) => {
2926
+ Mo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => hi(e, n, o, r), e.keyType = t.keyType, e.valueType = t.valueType;
2927
+ });
2928
+ function xt(e, t, n) {
2929
+ return new jt({
2930
+ type: "record",
2931
+ keyType: e,
2932
+ valueType: t,
2933
+ ...m(n)
2934
+ });
2935
+ }
2936
+ function Qe(e, t, n) {
2937
+ const o = U(e);
2938
+ return o._zod.values = void 0, new jt({
2939
+ type: "record",
2940
+ keyType: o,
2941
+ valueType: t,
2942
+ ...m(n)
2943
+ });
2944
+ }
2945
+ const Se = /* @__PURE__ */ l("ZodEnum", (e, t) => {
2946
+ Jo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (o, r, i) => ii(e, o, r), e.enum = t.entries, e.options = Object.values(t.entries);
2947
+ const n = new Set(Object.keys(t.entries));
2948
+ e.extract = (o, r) => {
2949
+ const i = {};
2950
+ for (const s of o)
2951
+ if (n.has(s))
2952
+ i[s] = t.entries[s];
2953
+ else
2954
+ throw new Error(`Key ${s} not found in enum`);
2955
+ return new Se({
2956
+ ...t,
2957
+ checks: [],
2958
+ ...m(r),
2959
+ entries: i
2960
+ });
2961
+ }, e.exclude = (o, r) => {
2962
+ const i = { ...t.entries };
2963
+ for (const s of o)
2964
+ if (n.has(s))
2965
+ delete i[s];
2966
+ else
2967
+ throw new Error(`Key ${s} not found in enum`);
2968
+ return new Se({
2969
+ ...t,
2970
+ checks: [],
2971
+ ...m(r),
2972
+ entries: i
2973
+ });
2974
+ };
2975
+ });
2976
+ function v(e, t) {
2977
+ const n = Array.isArray(e) ? Object.fromEntries(e.map((o) => [o, o])) : e;
2978
+ return new Se({
2979
+ type: "enum",
2980
+ entries: n,
2981
+ ...m(t)
2982
+ });
2983
+ }
2984
+ const ws = /* @__PURE__ */ l("ZodLiteral", (e, t) => {
2985
+ Vo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => si(e, n, o), e.values = new Set(t.values), Object.defineProperty(e, "value", {
2986
+ get() {
2987
+ if (t.values.length > 1)
2988
+ throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
2989
+ return t.values[0];
2990
+ }
2991
+ });
2992
+ });
2993
+ function E(e, t) {
2994
+ return new ws({
2995
+ type: "literal",
2996
+ values: Array.isArray(e) ? e : [e],
2997
+ ...m(t)
2998
+ });
2999
+ }
3000
+ const zs = /* @__PURE__ */ l("ZodTransform", (e, t) => {
3001
+ Bo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => ci(e, n), e._zod.parse = (n, o) => {
3002
+ if (o.direction === "backward")
3003
+ throw new it(e.constructor.name);
3004
+ n.addIssue = (i) => {
3005
+ if (typeof i == "string")
3006
+ n.issues.push(oe(i, n.value, t));
3007
+ else {
3008
+ const s = i;
3009
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(oe(s));
3010
+ }
3011
+ };
3012
+ const r = t.transform(n.value, n);
3013
+ return r instanceof Promise ? r.then((i) => (n.value = i, n)) : (n.value = r, n);
3014
+ };
3015
+ });
3016
+ function Rt(e) {
3017
+ return new zs({
3018
+ type: "transform",
3019
+ transform: e
3020
+ });
3021
+ }
3022
+ const Dt = /* @__PURE__ */ l("ZodOptional", (e, t) => {
3023
+ Zt.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => Et(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
3024
+ });
3025
+ function et(e) {
3026
+ return new Dt({
3027
+ type: "optional",
3028
+ innerType: e
3029
+ });
3030
+ }
3031
+ const ks = /* @__PURE__ */ l("ZodExactOptional", (e, t) => {
3032
+ Wo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => Et(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
3033
+ });
3034
+ function Ss(e) {
3035
+ return new ks({
3036
+ type: "optional",
3037
+ innerType: e
3038
+ });
3039
+ }
3040
+ const Zs = /* @__PURE__ */ l("ZodNullable", (e, t) => {
3041
+ Go.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => mi(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
3042
+ });
3043
+ function tt(e) {
3044
+ return new Zs({
3045
+ type: "nullable",
3046
+ innerType: e
3047
+ });
3048
+ }
3049
+ const $s = /* @__PURE__ */ l("ZodDefault", (e, t) => {
3050
+ Ko.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => _i(e, n, o, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
3051
+ });
3052
+ function Os(e, t) {
3053
+ return new $s({
3054
+ type: "default",
3055
+ innerType: e,
3056
+ get defaultValue() {
3057
+ return typeof t == "function" ? t() : ut(t);
3058
+ }
3059
+ });
3060
+ }
3061
+ const Ts = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
3062
+ qo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => vi(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
3063
+ });
3064
+ function Is(e, t) {
3065
+ return new Ts({
3066
+ type: "prefault",
3067
+ innerType: e,
3068
+ get defaultValue() {
3069
+ return typeof t == "function" ? t() : ut(t);
3070
+ }
3071
+ });
3072
+ }
3073
+ const Ft = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
3074
+ Yo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => gi(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
3075
+ });
3076
+ function Ps(e, t) {
3077
+ return new Ft({
3078
+ type: "nonoptional",
3079
+ innerType: e,
3080
+ ...m(t)
3081
+ });
3082
+ }
3083
+ const Es = /* @__PURE__ */ l("ZodCatch", (e, t) => {
3084
+ Xo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => yi(e, n, o, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3085
+ });
3086
+ function Ns(e, t) {
3087
+ return new Es({
3088
+ type: "catch",
3089
+ innerType: e,
3090
+ catchValue: typeof t == "function" ? t : () => t
3091
+ });
3092
+ }
3093
+ const Cs = /* @__PURE__ */ l("ZodPipe", (e, t) => {
3094
+ Ho.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => bi(e, n, o, r), e.in = t.in, e.out = t.out;
3095
+ });
3096
+ function Ze(e, t) {
3097
+ return new Cs({
3098
+ type: "pipe",
3099
+ in: e,
3100
+ out: t
3101
+ // ...util.normalizeParams(params),
3102
+ });
3103
+ }
3104
+ const As = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
3105
+ Qo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => wi(e, n, o, r), e.unwrap = () => e._zod.def.innerType;
3106
+ });
3107
+ function js(e) {
3108
+ return new As({
3109
+ type: "readonly",
3110
+ innerType: e
3111
+ });
3112
+ }
3113
+ const xs = /* @__PURE__ */ l("ZodLazy", (e, t) => {
3114
+ er.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => zi(e, n, o, r), e.unwrap = () => e._zod.def.getter();
3115
+ });
3116
+ function Rs(e) {
3117
+ return new xs({
3118
+ type: "lazy",
3119
+ getter: e
3120
+ });
3121
+ }
3122
+ const Ds = /* @__PURE__ */ l("ZodCustom", (e, t) => {
3123
+ tr.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, o, r) => ai(e, n);
3124
+ });
3125
+ function Fs(e, t = {}) {
3126
+ return /* @__PURE__ */ Kr(Ds, e, t);
3127
+ }
3128
+ function Ls(e) {
3129
+ return /* @__PURE__ */ qr(e);
3130
+ }
3131
+ function Us(e, t) {
3132
+ return Ze(Rt(e), t);
3133
+ }
3134
+ const ge = v([
3135
+ "Point",
3136
+ "MultiPoint",
3137
+ "LineString",
3138
+ "MultiLineString",
3139
+ "Polygon",
3140
+ "MultiPolygon"
3141
+ ]), Lt = Z(ke()), Ce = (e) => x([h(), Lt]).default(e), K = () => x([h(), Lt]).optional(), Ms = g({
3142
+ latitude: d().min(-90).max(90),
3143
+ longitude: d().min(-180).max(180),
3144
+ zoom: d().min(0).max(24),
3145
+ pitch: d().min(0).max(85).default(0),
3146
+ bearing: d().min(-180).max(180).default(0),
3147
+ minZoom: d().min(0).max(24).optional(),
3148
+ maxZoom: d().min(0).max(24).optional()
3149
+ }).superRefine((e, t) => {
3150
+ e.minZoom != null && e.maxZoom != null && e.minZoom > e.maxZoom && t.addIssue({
3151
+ code: "custom",
3152
+ path: ["minZoom"],
3153
+ message: "minZoom must be less than or equal to maxZoom"
3154
+ }), e.minZoom != null && e.zoom < e.minZoom && t.addIssue({
3155
+ code: "custom",
3156
+ path: ["zoom"],
3157
+ message: `Zoom must be at least ${e.minZoom} (minZoom)`
3158
+ }), e.maxZoom != null && e.zoom > e.maxZoom && t.addIssue({
3159
+ code: "custom",
3160
+ path: ["zoom"],
3161
+ message: `Zoom must be at most ${e.maxZoom} (maxZoom)`
3162
+ });
3163
+ }), Js = g({
3164
+ type: v(["query_param", "header"]),
3165
+ name: h().min(1),
3166
+ value: h().min(1)
3167
+ }), Vs = g({
3168
+ id: h().min(1),
3169
+ url: h().url(),
3170
+ label: h().optional(),
3171
+ tileMatrixSetId: h().optional().default("WebMercatorQuad"),
3172
+ type: v(["features", "imagery"]).optional(),
3173
+ auth: Js.optional(),
3174
+ proxy: y().optional()
3175
+ }), Bs = g({
3176
+ "fill-color": Ce("#000000"),
3177
+ "fill-opacity": d().min(0).max(1).default(1),
3178
+ "fill-outline-color": K(),
3179
+ "fill-antialias": y().optional(),
3180
+ "fill-translate": L([d(), d()]).optional(),
3181
+ "fill-translate-anchor": v(["map", "viewport"]).optional(),
3182
+ "fill-pattern": h().optional()
3183
+ }), Ws = g({
3184
+ "line-color": Ce("#000000"),
3185
+ "line-width": d().min(0).default(1),
3186
+ "line-opacity": d().min(0).max(1).default(1),
3187
+ "line-dasharray": Z(d()).optional(),
3188
+ "line-translate": L([d(), d()]).optional(),
3189
+ "line-translate-anchor": v(["map", "viewport"]).optional(),
3190
+ "line-gap-width": d().min(0).optional(),
3191
+ "line-offset": d().optional(),
3192
+ "line-blur": d().min(0).optional(),
3193
+ "line-pattern": h().optional(),
3194
+ "line-gradient": h().optional()
3195
+ }), Gs = g({
3196
+ "circle-color": Ce("#000000"),
3197
+ "circle-radius": d().min(0).default(5),
3198
+ "circle-opacity": d().min(0).max(1).default(1),
3199
+ "circle-stroke-color": K(),
3200
+ "circle-stroke-width": d().min(0).optional(),
3201
+ "circle-blur": d().min(0).optional(),
3202
+ "circle-translate": L([d(), d()]).optional(),
3203
+ "circle-translate-anchor": v(["map", "viewport"]).optional(),
3204
+ "circle-pitch-scale": v(["map", "viewport"]).optional(),
3205
+ "circle-pitch-alignment": v(["map", "viewport"]).optional(),
3206
+ "circle-stroke-opacity": d().min(0).max(1).optional()
3207
+ }), Ks = g({
3208
+ "icon-opacity": d().min(0).max(1).optional(),
3209
+ "icon-color": K(),
3210
+ "icon-halo-color": K(),
3211
+ "icon-halo-width": d().min(0).optional(),
3212
+ "icon-halo-blur": d().min(0).optional(),
3213
+ "icon-translate": L([d(), d()]).optional(),
3214
+ "icon-translate-anchor": v(["map", "viewport"]).optional(),
3215
+ "text-opacity": d().min(0).max(1).optional(),
3216
+ "text-color": K(),
3217
+ "text-halo-color": K(),
3218
+ "text-halo-width": d().min(0).optional(),
3219
+ "text-halo-blur": d().min(0).optional(),
3220
+ "text-translate": L([d(), d()]).optional(),
3221
+ "text-translate-anchor": v(["map", "viewport"]).optional()
3222
+ }), qs = g({
3223
+ "fill-sort-key": d().optional(),
3224
+ visibility: v(["visible", "none"]).optional()
3225
+ }), Ys = g({
3226
+ "line-cap": v(["butt", "round", "square"]).optional(),
3227
+ "line-join": v(["bevel", "round", "miter"]).optional(),
3228
+ "line-miter-limit": d().optional(),
3229
+ "line-round-limit": d().optional(),
3230
+ "line-sort-key": d().optional(),
3231
+ visibility: v(["visible", "none"]).optional()
3232
+ }), Xs = g({
3233
+ "circle-sort-key": d().optional(),
3234
+ visibility: v(["visible", "none"]).optional()
3235
+ }), Hs = g({
3236
+ "symbol-placement": v(["point", "line", "line-center"]).optional(),
3237
+ "symbol-spacing": d().min(1).optional(),
3238
+ "symbol-avoid-edges": y().optional(),
3239
+ "symbol-sort-key": d().optional(),
3240
+ "symbol-z-order": v(["auto", "viewport-y", "source"]).optional(),
3241
+ "icon-allow-overlap": y().optional(),
3242
+ "icon-ignore-placement": y().optional(),
3243
+ "icon-optional": y().optional(),
3244
+ "icon-rotation-alignment": v(["map", "viewport", "auto"]).optional(),
3245
+ "icon-size": d().min(0).optional(),
3246
+ "icon-text-fit": v(["none", "width", "height", "both"]).optional(),
3247
+ "icon-text-fit-padding": L([d(), d(), d(), d()]).optional(),
3248
+ "icon-image": h().optional(),
3249
+ "icon-rotate": d().optional(),
3250
+ "icon-padding": d().min(0).optional(),
3251
+ "icon-keep-upright": y().optional(),
3252
+ "icon-offset": L([d(), d()]).optional(),
3253
+ "icon-anchor": v(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]).optional(),
3254
+ "icon-pitch-alignment": v(["map", "viewport", "auto"]).optional(),
3255
+ "text-pitch-alignment": v(["map", "viewport", "auto"]).optional(),
3256
+ "text-rotation-alignment": v(["map", "viewport", "viewport-glyph", "auto"]).optional(),
3257
+ "text-field": h().optional(),
3258
+ "text-font": Z(h()).optional(),
3259
+ "text-size": d().min(0).optional(),
3260
+ "text-max-width": d().min(0).optional(),
3261
+ "text-line-height": d().optional(),
3262
+ "text-letter-spacing": d().optional(),
3263
+ "text-justify": v(["auto", "left", "center", "right"]).optional(),
3264
+ "text-anchor": v(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]).optional(),
3265
+ "text-max-angle": d().optional(),
3266
+ "text-rotate": d().optional(),
3267
+ "text-padding": d().min(0).optional(),
3268
+ "text-keep-upright": y().optional(),
3269
+ "text-transform": v(["none", "uppercase", "lowercase"]).optional(),
3270
+ "text-offset": L([d(), d()]).optional(),
3271
+ "text-allow-overlap": y().optional(),
3272
+ "text-ignore-placement": y().optional(),
3273
+ "text-optional": y().optional(),
3274
+ visibility: v(["visible", "none"]).optional()
3275
+ }), Qs = g({
3276
+ type: E("fill"),
3277
+ paint: Bs,
3278
+ layout: qs.optional(),
3279
+ geometryFilter: Z(ge).optional()
3280
+ }), ea = g({
3281
+ type: E("line"),
3282
+ paint: Ws,
3283
+ layout: Ys.optional(),
3284
+ geometryFilter: Z(ge).optional()
3285
+ }), ta = g({
3286
+ type: E("circle"),
3287
+ paint: Gs,
3288
+ layout: Xs.optional(),
3289
+ geometryFilter: Z(ge).optional()
3290
+ }), na = g({
3291
+ type: E("symbol"),
3292
+ paint: Ks,
3293
+ layout: Hs.optional(),
3294
+ geometryFilter: Z(ge).optional()
3295
+ }), oa = Ne("type", [
3296
+ Qs,
3297
+ ea,
3298
+ ta,
3299
+ na
3300
+ ]), ra = g({
3301
+ label: h(),
3302
+ color: h(),
3303
+ shape: v(["circle", "line", "square"]).optional()
3304
+ }), ia = g({
3305
+ entries: Z(ra).min(1),
3306
+ displayMode: v(["categorical", "gradient", "simple"]).optional(),
3307
+ showLabelsCollapsed: y().optional(),
3308
+ showColorBar: y().optional(),
3309
+ showDisclosureArrow: y().optional(),
3310
+ gradientProperty: h().optional()
3311
+ }), _e = {
3312
+ property: h().min(1),
3313
+ label: h(),
3314
+ placeholder: h().optional()
3315
+ }, sa = g({
3316
+ ..._e,
3317
+ type: E("text"),
3318
+ autocomplete: y().default(!1),
3319
+ prefetch: y().optional(),
3320
+ options: Z(h()).optional(),
3321
+ zoomTo: y().optional()
3322
+ }), aa = g({
3323
+ ..._e,
3324
+ type: E("number"),
3325
+ inputMode: v(["input", "slider"]).default("input"),
3326
+ operator: v(["eq", "gt", "lt", "gte", "lte", "between"]).default("eq"),
3327
+ operatorLabelStyle: v(["symbol", "word"]).optional(),
3328
+ showRange: y().optional(),
3329
+ min: d().optional(),
3330
+ max: d().optional(),
3331
+ step: d().optional()
3332
+ }), ca = g({
3333
+ ..._e,
3334
+ type: E("datetime"),
3335
+ range: y().default(!1)
3336
+ }), ua = g({
3337
+ ..._e,
3338
+ type: E("select"),
3339
+ options: Z(h()).optional(),
3340
+ prefetch: y().optional(),
3341
+ zoomTo: y().optional()
3342
+ }), la = Ne("type", [
3343
+ sa,
3344
+ aa,
3345
+ ca,
3346
+ ua
3347
+ ]), pa = g({
3348
+ fields: Z(la).min(1)
3349
+ }), fa = g({
3350
+ property: h().min(1),
3351
+ label: h().optional(),
3352
+ autocomplete: y().optional(),
3353
+ prefetch: y().optional()
3354
+ }), da = g({
3355
+ layerId: h().min(1),
3356
+ properties: Z(fa).min(1)
3357
+ }), ha = g({
3358
+ enabled: y().default(!0),
3359
+ placeholder: h().optional(),
3360
+ maxResultsPerLayer: d().int().min(1).max(50).default(10),
3361
+ debounceMs: d().int().min(0).default(250),
3362
+ minQueryLength: d().int().min(1).default(2),
3363
+ layers: Z(da).default([])
3364
+ }), ma = g({
3365
+ label: h().optional(),
3366
+ visible: y().optional().default(!0)
3367
+ }), ga = xt(h(), ma), _a = g({
3368
+ properties: xt(h(), x([h(), d(), y(), Z(h())])).optional(),
3369
+ bbox: L([d(), d(), d(), d()]).optional(),
3370
+ datetime: h().optional()
3371
+ }), va = v([
3372
+ "=",
3373
+ "<>",
3374
+ ">",
3375
+ ">=",
3376
+ "<",
3377
+ "<=",
3378
+ "like",
3379
+ "in",
3380
+ "isNull",
3381
+ "between",
3382
+ "t_after",
3383
+ "t_before",
3384
+ "t_during",
3385
+ "s_intersects",
3386
+ "s_within",
3387
+ "s_dwithin"
3388
+ ]), ya = g({
3389
+ kind: E("static"),
3390
+ value: x([
3391
+ h(),
3392
+ d(),
3393
+ y(),
3394
+ ps(),
3395
+ Z(h()),
3396
+ g({ lower: d(), upper: d() }),
3397
+ g({ start: h(), end: h() })
3398
+ ])
3399
+ }), ba = g({
3400
+ kind: E("parameter"),
3401
+ name: h().min(1),
3402
+ label: h(),
3403
+ inputType: v(["text", "number", "date", "select"]),
3404
+ default: x([h(), d()]).optional()
3405
+ }), Ut = x([
3406
+ g({ kind: E("static"), value: d() }),
3407
+ g({ kind: E("parameter"), name: h().min(1), label: h(), default: d().optional() })
3408
+ ]), Mt = g({
3409
+ kind: E("relativeDate"),
3410
+ direction: v(["past", "future"]),
3411
+ offset: Ut,
3412
+ unit: v(["days", "months", "years"])
3413
+ }), nt = x([
3414
+ g({ kind: E("static"), value: h() }),
3415
+ Mt,
3416
+ g({ kind: E("parameter"), name: h(), label: h(), default: h().optional() })
3417
+ ]), wa = g({
3418
+ kind: E("dateRange"),
3419
+ start: nt,
3420
+ end: nt
3421
+ }), za = g({
3422
+ kind: E("computedRange"),
3423
+ baseParam: h().min(1),
3424
+ baseLabel: h(),
3425
+ offsetType: v(["percentage", "absolute"]),
3426
+ offsetAmount: Ut
3427
+ }), ka = Ne("kind", [
3428
+ ya,
3429
+ ba,
3430
+ Mt,
3431
+ wa,
3432
+ za
3433
+ ]), Sa = ["meters", "kilometers", "miles", "feet"], Ae = v(Sa), Jt = g({
3434
+ kind: E("parameter"),
3435
+ name: h().min(1),
3436
+ label: h(),
3437
+ default: d().optional()
3438
+ }), Za = g({
3439
+ kind: E("parameter"),
3440
+ name: h().min(1),
3441
+ label: h(),
3442
+ default: Ae.optional()
3443
+ }), $a = g({
3444
+ distance: x([d(), Jt]).optional(),
3445
+ units: Ae.optional()
3446
+ }), Oa = g({
3447
+ id: h(),
3448
+ property: h(),
3449
+ operator: va,
3450
+ value: ka,
3451
+ spatial: $a.optional()
3452
+ }), Ta = g({
3453
+ property: h(),
3454
+ direction: v(["asc", "desc"])
3455
+ }), Ia = g({
3456
+ operator: v(["s_intersects", "s_within", "s_dwithin"]),
3457
+ geometryProperty: h(),
3458
+ distance: x([d(), Jt]).optional(),
3459
+ distanceUnits: x([Ae, Za]).optional()
3460
+ }), Vt = Rs(
3461
+ () => g({
3462
+ id: h(),
3463
+ combinator: v(["and", "or"]),
3464
+ rules: Z(x([Oa, Vt])),
3465
+ sortby: Z(Ta).optional(),
3466
+ limit: d().min(1).optional(),
3467
+ spatialConstraint: Ia.optional()
3468
+ })
3469
+ ), Pa = Vt, Ea = {
3470
+ id: h().min(1),
3471
+ sourceId: h().min(1),
3472
+ collection: h().min(1),
3473
+ label: h(),
3474
+ visible: y().default(!0),
3475
+ dataMode: v(["vector-tiles", "geojson"]),
3476
+ minZoom: d().min(0).max(24).optional(),
3477
+ maxZoom: d().min(0).max(24).optional(),
3478
+ /** Preferred zoom level used when zooming to a point/zero-area feature in this layer. */
3479
+ zoomToLevel: d().min(0).max(24).optional(),
3480
+ styles: Z(oa).optional(),
3481
+ legend: ia.optional(),
3482
+ filters: _a.optional(),
3483
+ search: pa.optional(),
3484
+ propertyDisplay: ga.optional(),
3485
+ cql2Filter: Pa.optional(),
3486
+ showTooltip: y().optional(),
3487
+ showDetailPanel: y().optional()
3488
+ }, Na = Us(
3489
+ (e) => {
3490
+ if (e && typeof e == "object" && "style" in e && !("styles" in e)) {
3491
+ const { style: t, ...n } = e;
3492
+ return { ...n, styles: t ? [t] : void 0 };
3493
+ }
3494
+ return e;
3495
+ },
3496
+ g(Ea)
3497
+ ), ot = h().refine(
3498
+ (e) => e.startsWith("/") || /^https?:\/\//i.test(e),
3499
+ { message: 'Must be an absolute http(s) URL or a path starting with "/"' }
3500
+ ), Ca = g({
3501
+ id: h().min(1),
3502
+ label: h(),
3503
+ url: ot,
3504
+ thumbnail: ot.optional()
3505
+ }), Aa = g({
3506
+ id: h().min(1),
3507
+ url: h().url()
3508
+ }), te = [
3509
+ "showLegend",
3510
+ "showSearchPanel",
3511
+ "showLayerPanel",
3512
+ "showMeasureTool",
3513
+ "showSelectionTool",
3514
+ "showImageryPanel",
3515
+ "showBasemapSwitcher",
3516
+ "showExportButton",
3517
+ "showCompass",
3518
+ "showInfoControl"
3519
+ ], rt = ["top-right", "top-left", "bottom-right", "bottom-left"], ja = ["individual", "side-menu", "auto"], xa = ["decimal-degrees", "ddm", "dms"], Ra = g({
3520
+ showLayerPanel: y().default(!0),
3521
+ showLegend: y().default(!0),
3522
+ showBasemapSwitcher: y().default(!0),
3523
+ showSearchPanel: y().default(!1),
3524
+ showCoordinateDisplay: y().default(!0),
3525
+ showFeatureDetail: y().default(!0),
3526
+ showFeatureTooltip: y().default(!0),
3527
+ showExportButton: y().default(!0),
3528
+ /** When true, surfaces a "Export as PDF" option in the export modal. */
3529
+ showExportPdf: y().default(!1),
3530
+ showLegendOpacity: y().default(!1),
3531
+ showMeasureTool: y().default(!1),
3532
+ showSelectionTool: y().default(!1),
3533
+ showImageryPanel: y().default(!1),
3534
+ showCompass: y().default(!0),
3535
+ showGlobalSearch: y().default(!1),
3536
+ showScaleBar: y().default(!1),
3537
+ controlOrder: Z(v(te)).optional(),
3538
+ /**
3539
+ * Optional per-control corner override. When absent or a control is not
3540
+ * listed, the control falls back to 'top-right' (existing behavior).
3541
+ */
3542
+ controlPositions: Qe(v(te), v(rt)).optional(),
3543
+ /**
3544
+ * How controls are presented: 'individual' renders each as its own button,
3545
+ * 'side-menu' collapses them into a SideMenuPanel, 'auto' picks based on
3546
+ * viewport width.
3547
+ */
3548
+ controlLayout: v(ja).default("individual"),
3549
+ /**
3550
+ * Corner where the side-menu toggle (hamburger) button appears when using
3551
+ * 'side-menu' or 'auto' layout. Defaults to 'top-right'.
3552
+ */
3553
+ sideMenuToggleCorner: v(rt).default("top-right"),
3554
+ /**
3555
+ * Optional per-control icon override. Keys are control keys (e.g. `showSearchPanel`),
3556
+ * values are icon names from `CONTROL_ICON_MAP`. Unknown names fall back to the
3557
+ * control's default icon.
3558
+ */
3559
+ controlIcons: Qe(v(te), h()).optional(),
3560
+ /**
3561
+ * Optional display order for legend layers (array of layer IDs).
3562
+ * When absent, the legend renders visible layers in their natural order.
3563
+ * IDs not in the list are appended in natural order; unknown IDs are ignored.
3564
+ */
3565
+ legendOrder: Z(h()).optional(),
3566
+ coordinateFormat: v(xa).default("decimal-degrees")
3567
+ });
3568
+ function Da(e) {
3569
+ if (!e.controlOrder || e.controlOrder.length === 0)
3570
+ return te;
3571
+ const t = new Set(e.controlOrder), n = te.filter((o) => !t.has(o));
3572
+ return [...e.controlOrder, ...n];
3573
+ }
3574
+ function Fa(e, t) {
3575
+ var n;
3576
+ return ((n = e.controlPositions) == null ? void 0 : n[t]) ?? "top-right";
3577
+ }
3578
+ function Va(e) {
3579
+ const t = {
3580
+ "top-right": [],
3581
+ "top-left": [],
3582
+ "bottom-right": [],
3583
+ "bottom-left": []
3584
+ };
3585
+ for (const n of Da(e))
3586
+ t[Fa(e, n)].push(n);
3587
+ return t;
3588
+ }
3589
+ const Ba = "#1e293b", La = g({
3590
+ headerTitle: h().optional(),
3591
+ headerColor: h().optional(),
3592
+ browserTitle: h().optional(),
3593
+ faviconDataUrl: h().optional(),
3594
+ logoDataUrl: h().optional(),
3595
+ logoHeight: d().int().min(16).max(200).optional()
3596
+ }), Ua = g({
3597
+ id: h().min(1),
3598
+ sourceId: h().default(""),
3599
+ collection: h().default(""),
3600
+ label: h(),
3601
+ visible: y().default(!1),
3602
+ opacity: d().min(0).max(1).default(1),
3603
+ exclusive: y().default(!1),
3604
+ minZoom: d().min(0).max(24).optional(),
3605
+ maxZoom: d().min(0).max(24).optional(),
3606
+ tileSize: d().default(256),
3607
+ tileUrlTemplate: h().optional(),
3608
+ /** Optional thumbnail image URL rendered beside the layer in ImageryPanel. */
3609
+ thumbnailUrl: h().optional()
3610
+ }).superRefine((e, t) => {
3611
+ 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" }));
3612
+ }), Ma = ["top-right", "top-left", "bottom-right", "bottom-left"], Ja = g({
3613
+ enabled: y().default(!1),
3614
+ title: h().optional(),
3615
+ markdown: h().default(""),
3616
+ position: v(Ma).default("top-right")
3617
+ }), Bt = g({
3618
+ sources: Z(Vs).min(1),
3619
+ layers: Z(Na),
3620
+ imageryLayers: Z(Ua).optional(),
3621
+ basemaps: Z(Ca).min(1),
3622
+ sprites: Z(Aa).optional(),
3623
+ ui: Ra.default({
3624
+ showLayerPanel: !0,
3625
+ showLegend: !0,
3626
+ showBasemapSwitcher: !0,
3627
+ showSearchPanel: !1,
3628
+ showCoordinateDisplay: !0,
3629
+ showFeatureDetail: !0,
3630
+ showFeatureTooltip: !0,
3631
+ showExportButton: !0,
3632
+ showExportPdf: !1,
3633
+ showLegendOpacity: !1,
3634
+ showMeasureTool: !1,
3635
+ showSelectionTool: !1,
3636
+ showImageryPanel: !1,
3637
+ showCompass: !0,
3638
+ showGlobalSearch: !1,
3639
+ showScaleBar: !1,
3640
+ controlLayout: "individual",
3641
+ sideMenuToggleCorner: "top-right",
3642
+ coordinateFormat: "decimal-degrees"
3643
+ }),
3644
+ initialView: Ms,
3645
+ branding: La.optional(),
3646
+ globalSearch: ha.optional(),
3647
+ info: Ja.optional()
3648
+ });
3649
+ function Wa(e) {
3650
+ return Bt.parse(e);
3651
+ }
3652
+ function Ga(e) {
3653
+ return Bt.safeParse(e);
3654
+ }
3655
+ export {
3656
+ oa as $,
3657
+ ia as A,
3658
+ Ca as B,
3659
+ ja as C,
3660
+ Sa as D,
3661
+ ra as E,
3662
+ qs as F,
3663
+ ge as G,
3664
+ Ys as H,
3665
+ Ma as I,
3666
+ Ws as J,
3667
+ ea as K,
3668
+ Na as L,
3669
+ Bt as M,
3670
+ aa as N,
3671
+ te as O,
3672
+ Vs as P,
3673
+ ga as Q,
3674
+ ma as R,
3675
+ Mt as S,
3676
+ pa as T,
3677
+ la as U,
3678
+ ua as V,
3679
+ Ta as W,
3680
+ Js as X,
3681
+ $a as Y,
3682
+ Ia as Z,
3683
+ Aa as _,
3684
+ rt as a,
3685
+ Hs as a0,
3686
+ Ks as a1,
3687
+ na as a2,
3688
+ sa as a3,
3689
+ Ra as a4,
3690
+ Ms as a5,
3691
+ Va as a6,
3692
+ Wa as a7,
3693
+ Fa as b,
3694
+ xa as c,
3695
+ La as d,
3696
+ Xs as e,
3697
+ Gs as f,
3698
+ ta as g,
3699
+ za as h,
3700
+ Pa as i,
3701
+ Ba as j,
3702
+ wa as k,
3703
+ ca as l,
3704
+ Bs as m,
3705
+ Qs as n,
3706
+ _a as o,
3707
+ va as p,
3708
+ Vt as q,
3709
+ Da as r,
3710
+ Ga as s,
3711
+ Oa as t,
3712
+ ka as u,
3713
+ ha as v,
3714
+ da as w,
3715
+ fa as x,
3716
+ Ua as y,
3717
+ Ja as z
3718
+ };