@_davideast/stitch-mcp 0.3.2 → 0.5.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 (214) hide show
  1. package/README.md +54 -239
  2. package/dist/chunk-25wakzyb.js +137 -0
  3. package/dist/chunk-25wakzyb.js.map +10 -0
  4. package/dist/chunk-2cetsfw4.js +16531 -0
  5. package/dist/chunk-2cetsfw4.js.map +95 -0
  6. package/dist/chunk-2fcdwvrm.js +54 -0
  7. package/dist/chunk-2fcdwvrm.js.map +10 -0
  8. package/dist/chunk-2k7n0w2x.js +3980 -0
  9. package/dist/chunk-2k7n0w2x.js.map +16 -0
  10. package/dist/chunk-2kyqsrg2.js +403 -0
  11. package/dist/chunk-2kyqsrg2.js.map +10 -0
  12. package/dist/chunk-384jmtpy.js +11057 -0
  13. package/dist/chunk-384jmtpy.js.map +238 -0
  14. package/dist/chunk-3at4pjgn.js +22 -0
  15. package/dist/chunk-3at4pjgn.js.map +9 -0
  16. package/dist/chunk-3sfn889r.js +492 -0
  17. package/dist/chunk-3sfn889r.js.map +13 -0
  18. package/dist/chunk-45wx7tn7.js +94 -0
  19. package/dist/chunk-45wx7tn7.js.map +10 -0
  20. package/dist/chunk-48d17n29.js +10 -0
  21. package/dist/chunk-48d17n29.js.map +9 -0
  22. package/dist/chunk-4jwmvjb4.js +839 -0
  23. package/dist/chunk-4jwmvjb4.js.map +11 -0
  24. package/dist/chunk-4jygt4d6.js +14 -0
  25. package/dist/chunk-4jygt4d6.js.map +10 -0
  26. package/dist/chunk-4vxy1qce.js +68 -0
  27. package/dist/chunk-4vxy1qce.js.map +10 -0
  28. package/dist/chunk-7tx0wn04.js +11 -0
  29. package/dist/chunk-7tx0wn04.js.map +9 -0
  30. package/dist/chunk-7xh1y383.js +45188 -0
  31. package/dist/chunk-7xh1y383.js.map +258 -0
  32. package/dist/chunk-8yrtq2qs.js +18 -0
  33. package/dist/chunk-8yrtq2qs.js.map +9 -0
  34. package/dist/chunk-985f11w6.js +21 -0
  35. package/dist/chunk-985f11w6.js.map +9 -0
  36. package/dist/chunk-9tvppjaf.js +250 -0
  37. package/dist/chunk-9tvppjaf.js.map +14 -0
  38. package/dist/chunk-9wyra8hs.js +32 -0
  39. package/dist/chunk-9wyra8hs.js.map +9 -0
  40. package/dist/chunk-cwkb2wbe.js +733 -0
  41. package/dist/chunk-cwkb2wbe.js.map +16 -0
  42. package/dist/chunk-djhzzcgj.js +362 -0
  43. package/dist/chunk-djhzzcgj.js.map +13 -0
  44. package/dist/chunk-edp6faw2.js +7 -0
  45. package/dist/chunk-edp6faw2.js.map +9 -0
  46. package/dist/chunk-ezmw2j8c.js +14 -0
  47. package/dist/chunk-ezmw2j8c.js.map +9 -0
  48. package/dist/chunk-f2hq6bfv.js +22 -0
  49. package/dist/chunk-f2hq6bfv.js.map +10 -0
  50. package/dist/chunk-fwb4fnkp.js +31 -0
  51. package/dist/chunk-fwb4fnkp.js.map +10 -0
  52. package/dist/chunk-h18jrqed.js +9517 -0
  53. package/dist/chunk-h18jrqed.js.map +99 -0
  54. package/dist/chunk-hb3c6f6a.js +42 -0
  55. package/dist/chunk-hb3c6f6a.js.map +9 -0
  56. package/dist/chunk-jy2d17pr.js +252 -0
  57. package/dist/chunk-jy2d17pr.js.map +11 -0
  58. package/dist/chunk-kbtqrkwh.js +24 -0
  59. package/dist/chunk-kbtqrkwh.js.map +10 -0
  60. package/dist/chunk-knbnsf6s.js +92 -0
  61. package/dist/chunk-knbnsf6s.js.map +10 -0
  62. package/dist/chunk-mv9ssgmx.js +446 -0
  63. package/dist/chunk-mv9ssgmx.js.map +17 -0
  64. package/dist/chunk-nq68kghz.js +1647 -0
  65. package/dist/chunk-nq68kghz.js.map +10 -0
  66. package/dist/chunk-nthabjd9.js +3138 -0
  67. package/dist/chunk-nthabjd9.js.map +34 -0
  68. package/dist/chunk-nxpzt33t.js +278 -0
  69. package/dist/chunk-nxpzt33t.js.map +10 -0
  70. package/dist/chunk-pfyjtfex.js +172 -0
  71. package/dist/chunk-pfyjtfex.js.map +10 -0
  72. package/dist/chunk-q1nd6g0y.js +392 -0
  73. package/dist/chunk-q1nd6g0y.js.map +20 -0
  74. package/dist/chunk-q4js8r0z.js +4708 -0
  75. package/dist/chunk-q4js8r0z.js.map +29 -0
  76. package/dist/chunk-qv44tmn6.js +289 -0
  77. package/dist/chunk-qv44tmn6.js.map +13 -0
  78. package/dist/chunk-r2sg2nxa.js +20 -0
  79. package/dist/chunk-r2sg2nxa.js.map +9 -0
  80. package/dist/chunk-rp8wjzht.js +16959 -0
  81. package/dist/chunk-rp8wjzht.js.map +26 -0
  82. package/dist/chunk-rpxnm86e.js +372 -0
  83. package/dist/chunk-rpxnm86e.js.map +17 -0
  84. package/dist/chunk-sdp429xd.js +914 -0
  85. package/dist/chunk-sdp429xd.js.map +24 -0
  86. package/dist/chunk-t85nbjjb.js +113 -0
  87. package/dist/chunk-t85nbjjb.js.map +10 -0
  88. package/dist/chunk-tz7wnw4s.js +211 -0
  89. package/dist/chunk-tz7wnw4s.js.map +11 -0
  90. package/dist/chunk-v7117ywx.js +1477 -0
  91. package/dist/chunk-v7117ywx.js.map +23 -0
  92. package/dist/chunk-w8q7nsm7.js +2098 -0
  93. package/dist/chunk-w8q7nsm7.js.map +44 -0
  94. package/dist/chunk-wa64nz8b.js +47 -0
  95. package/dist/chunk-wa64nz8b.js.map +10 -0
  96. package/dist/chunk-wz8d5vzb.js +234 -0
  97. package/dist/chunk-wz8d5vzb.js.map +11 -0
  98. package/dist/chunk-ycfxp056.js +677 -0
  99. package/dist/chunk-ycfxp056.js.map +17 -0
  100. package/dist/chunk-z9d2xc83.js +3256 -0
  101. package/dist/chunk-z9d2xc83.js.map +84 -0
  102. package/dist/cli.js +111 -125552
  103. package/dist/cli.js.map +19 -0
  104. package/dist/commands/autoload.d.ts +2 -0
  105. package/dist/commands/doctor/command.d.ts +2 -1
  106. package/dist/commands/doctor/command.js +82 -0
  107. package/dist/commands/doctor/command.js.map +11 -0
  108. package/dist/commands/doctor/spec.d.ts +16 -8
  109. package/dist/commands/init/command.d.ts +2 -1
  110. package/dist/commands/init/command.js +98 -0
  111. package/dist/commands/init/command.js.map +11 -0
  112. package/dist/commands/init/spec.d.ts +29 -9
  113. package/dist/commands/logout/command.d.ts +2 -1
  114. package/dist/commands/logout/command.js +79 -0
  115. package/dist/commands/logout/command.js.map +11 -0
  116. package/dist/commands/logout/spec.d.ts +11 -0
  117. package/dist/commands/proxy/command.d.ts +2 -1
  118. package/dist/commands/proxy/command.js +56 -0
  119. package/dist/commands/proxy/command.js.map +11 -0
  120. package/dist/commands/proxy/spec.d.ts +15 -0
  121. package/dist/commands/screens/command.d.ts +2 -1
  122. package/dist/commands/screens/command.js +61 -0
  123. package/dist/commands/screens/command.js.map +11 -0
  124. package/dist/commands/screens/spec.d.ts +9 -0
  125. package/dist/commands/serve/command.d.ts +2 -1
  126. package/dist/commands/serve/command.js +65 -0
  127. package/dist/commands/serve/command.js.map +11 -0
  128. package/dist/commands/serve/spec.d.ts +9 -0
  129. package/dist/commands/site/command.d.ts +2 -1
  130. package/dist/commands/site/command.js +53 -0
  131. package/dist/commands/site/command.js.map +11 -0
  132. package/dist/commands/site/spec.d.ts +15 -0
  133. package/dist/commands/snapshot/command.d.ts +2 -1
  134. package/dist/commands/snapshot/command.js +59 -0
  135. package/dist/commands/snapshot/command.js.map +11 -0
  136. package/dist/commands/tool/command.d.ts +2 -1
  137. package/dist/commands/tool/command.js +79 -0
  138. package/dist/commands/tool/command.js.map +11 -0
  139. package/dist/commands/tool/handler.d.ts +17 -0
  140. package/dist/commands/tool/spec.d.ts +17 -0
  141. package/dist/commands/tool/steps/ValidateToolStep.d.ts +8 -0
  142. package/dist/commands/tool/virtual-tools/index.d.ts +1 -0
  143. package/dist/commands/tool/virtual-tools/list-tools.d.ts +2 -0
  144. package/dist/commands/view/command.d.ts +2 -1
  145. package/dist/commands/view/command.js +52 -0
  146. package/dist/commands/view/command.js.map +11 -0
  147. package/dist/commands/view/spec.d.ts +24 -0
  148. package/dist/framework/CommandDefinition.d.ts +2 -2
  149. package/dist/index.js +26 -21668
  150. package/dist/index.js.map +9 -0
  151. package/dist/lib/services/site/schemas.d.ts +8 -8
  152. package/dist/services/config/handler.d.ts +12 -0
  153. package/dist/services/config/spec.d.ts +82 -0
  154. package/dist/services/gcloud/auth.d.ts +28 -0
  155. package/dist/services/gcloud/core.d.ts +21 -0
  156. package/dist/services/gcloud/handler.d.ts +6 -18
  157. package/dist/services/gcloud/install.d.ts +23 -0
  158. package/dist/services/gcloud/projects.d.ts +15 -0
  159. package/dist/services/gcloud/spec.d.ts +32 -24
  160. package/dist/services/mcp-client/client.d.ts +0 -5
  161. package/dist/services/mcp-client/spec.d.ts +6 -6
  162. package/dist/services/mcp-config/spec.d.ts +12 -12
  163. package/dist/services/project/spec.d.ts +4 -4
  164. package/dist/services/proxy/spec.d.ts +3 -3
  165. package/dist/services/stitch/api.d.ts +10 -0
  166. package/dist/services/stitch/connection.d.ts +5 -0
  167. package/dist/services/stitch/handler.d.ts +5 -3
  168. package/dist/services/stitch/iam.d.ts +11 -0
  169. package/dist/services/stitch/spec.d.ts +6 -6
  170. package/dist/services/view/spec.d.ts +7 -7
  171. package/dist/src/cli.d.ts +1 -0
  172. package/dist/src/commands/doctor/handler.d.ts +9 -0
  173. package/dist/src/commands/doctor/handler.test.d.ts +1 -0
  174. package/dist/src/commands/doctor/spec.d.ts +130 -0
  175. package/dist/src/commands/doctor/spec.test.d.ts +1 -0
  176. package/dist/src/commands/init/handler.d.ts +17 -0
  177. package/dist/src/commands/init/handler.test.d.ts +1 -0
  178. package/dist/src/commands/init/spec.d.ts +88 -0
  179. package/dist/src/commands/init/spec.test.d.ts +1 -0
  180. package/dist/src/commands/proxy/handler.d.ts +7 -0
  181. package/dist/src/commands/proxy/handler.test.d.ts +1 -0
  182. package/dist/src/index.d.ts +13 -0
  183. package/dist/src/platform/detector.d.ts +29 -0
  184. package/dist/src/platform/paths.d.ts +20 -0
  185. package/dist/src/platform/shell.d.ts +26 -0
  186. package/dist/src/services/gcloud/handler.d.ts +48 -0
  187. package/dist/src/services/gcloud/handler.test.d.ts +1 -0
  188. package/dist/src/services/gcloud/spec.d.ts +405 -0
  189. package/dist/src/services/mcp-config/handler.d.ts +12 -0
  190. package/dist/src/services/mcp-config/handler.test.d.ts +1 -0
  191. package/dist/src/services/mcp-config/spec.d.ts +88 -0
  192. package/dist/src/services/mcp-config/spec.test.d.ts +1 -0
  193. package/dist/src/services/project/handler.d.ts +11 -0
  194. package/dist/src/services/project/handler.test.d.ts +1 -0
  195. package/dist/src/services/project/spec.d.ts +86 -0
  196. package/dist/src/services/project/spec.test.d.ts +1 -0
  197. package/dist/src/services/proxy/handler.d.ts +15 -0
  198. package/dist/src/services/proxy/handler.test.d.ts +1 -0
  199. package/dist/src/services/proxy/spec.d.ts +83 -0
  200. package/dist/src/services/proxy/spec.test.d.ts +1 -0
  201. package/dist/src/services/stitch/handler.d.ts +15 -0
  202. package/dist/src/services/stitch/handler.test.d.ts +1 -0
  203. package/dist/src/services/stitch/spec.d.ts +262 -0
  204. package/dist/src/services/stitch/spec.test.d.ts +1 -0
  205. package/dist/src/ui/spinner.d.ts +11 -0
  206. package/dist/src/ui/theme.d.ts +18 -0
  207. package/dist/src/ui/wizard.d.ts +24 -0
  208. package/dist/tests/mocks/shell.d.ts +2 -0
  209. package/dist/ui/JsonTree.d.ts +1 -1
  210. package/package.json +2 -2
  211. package/dist/commands/registry.d.ts +0 -2
  212. package/dist/ui/copy-behaviors/index.d.ts +0 -8
  213. package/dist/ui/serve-behaviors/index.d.ts +0 -7
  214. /package/dist/ui/navigation-behaviors/{index.d.ts → handler.d.ts} +0 -0
@@ -0,0 +1,4708 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-9wyra8hs.js";
4
+
5
+ // node_modules/zod/v4/core/core.js
6
+ var NEVER = Object.freeze({
7
+ status: "aborted"
8
+ });
9
+ function $constructor(name, initializer, params) {
10
+ function init(inst, def) {
11
+ var _a;
12
+ Object.defineProperty(inst, "_zod", {
13
+ value: inst._zod ?? {},
14
+ enumerable: false
15
+ });
16
+ (_a = inst._zod).traits ?? (_a.traits = new Set);
17
+ inst._zod.traits.add(name);
18
+ initializer(inst, def);
19
+ for (const k in _.prototype) {
20
+ if (!(k in inst))
21
+ Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
22
+ }
23
+ inst._zod.constr = _;
24
+ inst._zod.def = def;
25
+ }
26
+ const Parent = params?.Parent ?? Object;
27
+
28
+ class Definition extends Parent {
29
+ }
30
+ Object.defineProperty(Definition, "name", { value: name });
31
+ function _(def) {
32
+ var _a;
33
+ const inst = params?.Parent ? new Definition : this;
34
+ init(inst, def);
35
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
36
+ for (const fn of inst._zod.deferred) {
37
+ fn();
38
+ }
39
+ return inst;
40
+ }
41
+ Object.defineProperty(_, "init", { value: init });
42
+ Object.defineProperty(_, Symbol.hasInstance, {
43
+ value: (inst) => {
44
+ if (params?.Parent && inst instanceof params.Parent)
45
+ return true;
46
+ return inst?._zod?.traits?.has(name);
47
+ }
48
+ });
49
+ Object.defineProperty(_, "name", { value: name });
50
+ return _;
51
+ }
52
+ var $brand = Symbol("zod_brand");
53
+
54
+ class $ZodAsyncError extends Error {
55
+ constructor() {
56
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
57
+ }
58
+ }
59
+ var globalConfig = {};
60
+ function config(newConfig) {
61
+ if (newConfig)
62
+ Object.assign(globalConfig, newConfig);
63
+ return globalConfig;
64
+ }
65
+ // node_modules/zod/v4/core/util.js
66
+ var exports_util = {};
67
+ __export(exports_util, {
68
+ unwrapMessage: () => unwrapMessage,
69
+ stringifyPrimitive: () => stringifyPrimitive,
70
+ required: () => required,
71
+ randomString: () => randomString,
72
+ propertyKeyTypes: () => propertyKeyTypes,
73
+ promiseAllObject: () => promiseAllObject,
74
+ primitiveTypes: () => primitiveTypes,
75
+ prefixIssues: () => prefixIssues,
76
+ pick: () => pick,
77
+ partial: () => partial,
78
+ optionalKeys: () => optionalKeys,
79
+ omit: () => omit,
80
+ numKeys: () => numKeys,
81
+ nullish: () => nullish,
82
+ normalizeParams: () => normalizeParams,
83
+ merge: () => merge,
84
+ jsonStringifyReplacer: () => jsonStringifyReplacer,
85
+ joinValues: () => joinValues,
86
+ issue: () => issue,
87
+ isPlainObject: () => isPlainObject,
88
+ isObject: () => isObject,
89
+ getSizableOrigin: () => getSizableOrigin,
90
+ getParsedType: () => getParsedType,
91
+ getLengthableOrigin: () => getLengthableOrigin,
92
+ getEnumValues: () => getEnumValues,
93
+ getElementAtPath: () => getElementAtPath,
94
+ floatSafeRemainder: () => floatSafeRemainder,
95
+ finalizeIssue: () => finalizeIssue,
96
+ extend: () => extend,
97
+ escapeRegex: () => escapeRegex,
98
+ esc: () => esc,
99
+ defineLazy: () => defineLazy,
100
+ createTransparentProxy: () => createTransparentProxy,
101
+ clone: () => clone,
102
+ cleanRegex: () => cleanRegex,
103
+ cleanEnum: () => cleanEnum,
104
+ captureStackTrace: () => captureStackTrace,
105
+ cached: () => cached,
106
+ assignProp: () => assignProp,
107
+ assertNotEqual: () => assertNotEqual,
108
+ assertNever: () => assertNever,
109
+ assertIs: () => assertIs,
110
+ assertEqual: () => assertEqual,
111
+ assert: () => assert,
112
+ allowsEval: () => allowsEval,
113
+ aborted: () => aborted,
114
+ NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
115
+ Class: () => Class,
116
+ BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES
117
+ });
118
+ function assertEqual(val) {
119
+ return val;
120
+ }
121
+ function assertNotEqual(val) {
122
+ return val;
123
+ }
124
+ function assertIs(_arg) {}
125
+ function assertNever(_x) {
126
+ throw new Error;
127
+ }
128
+ function assert(_) {}
129
+ function getEnumValues(entries) {
130
+ const numericValues = Object.values(entries).filter((v) => typeof v === "number");
131
+ const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
132
+ return values;
133
+ }
134
+ function joinValues(array, separator = "|") {
135
+ return array.map((val) => stringifyPrimitive(val)).join(separator);
136
+ }
137
+ function jsonStringifyReplacer(_, value) {
138
+ if (typeof value === "bigint")
139
+ return value.toString();
140
+ return value;
141
+ }
142
+ function cached(getter) {
143
+ const set = false;
144
+ return {
145
+ get value() {
146
+ if (!set) {
147
+ const value = getter();
148
+ Object.defineProperty(this, "value", { value });
149
+ return value;
150
+ }
151
+ throw new Error("cached value already set");
152
+ }
153
+ };
154
+ }
155
+ function nullish(input) {
156
+ return input === null || input === undefined;
157
+ }
158
+ function cleanRegex(source) {
159
+ const start = source.startsWith("^") ? 1 : 0;
160
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
161
+ return source.slice(start, end);
162
+ }
163
+ function floatSafeRemainder(val, step) {
164
+ const valDecCount = (val.toString().split(".")[1] || "").length;
165
+ const stepDecCount = (step.toString().split(".")[1] || "").length;
166
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
167
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
168
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
169
+ return valInt % stepInt / 10 ** decCount;
170
+ }
171
+ function defineLazy(object, key, getter) {
172
+ const set = false;
173
+ Object.defineProperty(object, key, {
174
+ get() {
175
+ if (!set) {
176
+ const value = getter();
177
+ object[key] = value;
178
+ return value;
179
+ }
180
+ throw new Error("cached value already set");
181
+ },
182
+ set(v) {
183
+ Object.defineProperty(object, key, {
184
+ value: v
185
+ });
186
+ },
187
+ configurable: true
188
+ });
189
+ }
190
+ function assignProp(target, prop, value) {
191
+ Object.defineProperty(target, prop, {
192
+ value,
193
+ writable: true,
194
+ enumerable: true,
195
+ configurable: true
196
+ });
197
+ }
198
+ function getElementAtPath(obj, path) {
199
+ if (!path)
200
+ return obj;
201
+ return path.reduce((acc, key) => acc?.[key], obj);
202
+ }
203
+ function promiseAllObject(promisesObj) {
204
+ const keys = Object.keys(promisesObj);
205
+ const promises = keys.map((key) => promisesObj[key]);
206
+ return Promise.all(promises).then((results) => {
207
+ const resolvedObj = {};
208
+ for (let i = 0;i < keys.length; i++) {
209
+ resolvedObj[keys[i]] = results[i];
210
+ }
211
+ return resolvedObj;
212
+ });
213
+ }
214
+ function randomString(length = 10) {
215
+ const chars = "abcdefghijklmnopqrstuvwxyz";
216
+ let str = "";
217
+ for (let i = 0;i < length; i++) {
218
+ str += chars[Math.floor(Math.random() * chars.length)];
219
+ }
220
+ return str;
221
+ }
222
+ function esc(str) {
223
+ return JSON.stringify(str);
224
+ }
225
+ var captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {};
226
+ function isObject(data) {
227
+ return typeof data === "object" && data !== null && !Array.isArray(data);
228
+ }
229
+ var allowsEval = cached(() => {
230
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
231
+ return false;
232
+ }
233
+ try {
234
+ const F = Function;
235
+ new F("");
236
+ return true;
237
+ } catch (_) {
238
+ return false;
239
+ }
240
+ });
241
+ function isPlainObject(o) {
242
+ if (isObject(o) === false)
243
+ return false;
244
+ const ctor = o.constructor;
245
+ if (ctor === undefined)
246
+ return true;
247
+ const prot = ctor.prototype;
248
+ if (isObject(prot) === false)
249
+ return false;
250
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
251
+ return false;
252
+ }
253
+ return true;
254
+ }
255
+ function numKeys(data) {
256
+ let keyCount = 0;
257
+ for (const key in data) {
258
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
259
+ keyCount++;
260
+ }
261
+ }
262
+ return keyCount;
263
+ }
264
+ var getParsedType = (data) => {
265
+ const t = typeof data;
266
+ switch (t) {
267
+ case "undefined":
268
+ return "undefined";
269
+ case "string":
270
+ return "string";
271
+ case "number":
272
+ return Number.isNaN(data) ? "nan" : "number";
273
+ case "boolean":
274
+ return "boolean";
275
+ case "function":
276
+ return "function";
277
+ case "bigint":
278
+ return "bigint";
279
+ case "symbol":
280
+ return "symbol";
281
+ case "object":
282
+ if (Array.isArray(data)) {
283
+ return "array";
284
+ }
285
+ if (data === null) {
286
+ return "null";
287
+ }
288
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
289
+ return "promise";
290
+ }
291
+ if (typeof Map !== "undefined" && data instanceof Map) {
292
+ return "map";
293
+ }
294
+ if (typeof Set !== "undefined" && data instanceof Set) {
295
+ return "set";
296
+ }
297
+ if (typeof Date !== "undefined" && data instanceof Date) {
298
+ return "date";
299
+ }
300
+ if (typeof File !== "undefined" && data instanceof File) {
301
+ return "file";
302
+ }
303
+ return "object";
304
+ default:
305
+ throw new Error(`Unknown data type: ${t}`);
306
+ }
307
+ };
308
+ var propertyKeyTypes = new Set(["string", "number", "symbol"]);
309
+ var primitiveTypes = new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
310
+ function escapeRegex(str) {
311
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
312
+ }
313
+ function clone(inst, def, params) {
314
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
315
+ if (!def || params?.parent)
316
+ cl._zod.parent = inst;
317
+ return cl;
318
+ }
319
+ function normalizeParams(_params) {
320
+ const params = _params;
321
+ if (!params)
322
+ return {};
323
+ if (typeof params === "string")
324
+ return { error: () => params };
325
+ if (params?.message !== undefined) {
326
+ if (params?.error !== undefined)
327
+ throw new Error("Cannot specify both `message` and `error` params");
328
+ params.error = params.message;
329
+ }
330
+ delete params.message;
331
+ if (typeof params.error === "string")
332
+ return { ...params, error: () => params.error };
333
+ return params;
334
+ }
335
+ function createTransparentProxy(getter) {
336
+ let target;
337
+ return new Proxy({}, {
338
+ get(_, prop, receiver) {
339
+ target ?? (target = getter());
340
+ return Reflect.get(target, prop, receiver);
341
+ },
342
+ set(_, prop, value, receiver) {
343
+ target ?? (target = getter());
344
+ return Reflect.set(target, prop, value, receiver);
345
+ },
346
+ has(_, prop) {
347
+ target ?? (target = getter());
348
+ return Reflect.has(target, prop);
349
+ },
350
+ deleteProperty(_, prop) {
351
+ target ?? (target = getter());
352
+ return Reflect.deleteProperty(target, prop);
353
+ },
354
+ ownKeys(_) {
355
+ target ?? (target = getter());
356
+ return Reflect.ownKeys(target);
357
+ },
358
+ getOwnPropertyDescriptor(_, prop) {
359
+ target ?? (target = getter());
360
+ return Reflect.getOwnPropertyDescriptor(target, prop);
361
+ },
362
+ defineProperty(_, prop, descriptor) {
363
+ target ?? (target = getter());
364
+ return Reflect.defineProperty(target, prop, descriptor);
365
+ }
366
+ });
367
+ }
368
+ function stringifyPrimitive(value) {
369
+ if (typeof value === "bigint")
370
+ return value.toString() + "n";
371
+ if (typeof value === "string")
372
+ return `"${value}"`;
373
+ return `${value}`;
374
+ }
375
+ function optionalKeys(shape) {
376
+ return Object.keys(shape).filter((k) => {
377
+ return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
378
+ });
379
+ }
380
+ var NUMBER_FORMAT_RANGES = {
381
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
382
+ int32: [-2147483648, 2147483647],
383
+ uint32: [0, 4294967295],
384
+ float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000],
385
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
386
+ };
387
+ var BIGINT_FORMAT_RANGES = {
388
+ int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
389
+ uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
390
+ };
391
+ function pick(schema, mask) {
392
+ const newShape = {};
393
+ const currDef = schema._zod.def;
394
+ for (const key in mask) {
395
+ if (!(key in currDef.shape)) {
396
+ throw new Error(`Unrecognized key: "${key}"`);
397
+ }
398
+ if (!mask[key])
399
+ continue;
400
+ newShape[key] = currDef.shape[key];
401
+ }
402
+ return clone(schema, {
403
+ ...schema._zod.def,
404
+ shape: newShape,
405
+ checks: []
406
+ });
407
+ }
408
+ function omit(schema, mask) {
409
+ const newShape = { ...schema._zod.def.shape };
410
+ const currDef = schema._zod.def;
411
+ for (const key in mask) {
412
+ if (!(key in currDef.shape)) {
413
+ throw new Error(`Unrecognized key: "${key}"`);
414
+ }
415
+ if (!mask[key])
416
+ continue;
417
+ delete newShape[key];
418
+ }
419
+ return clone(schema, {
420
+ ...schema._zod.def,
421
+ shape: newShape,
422
+ checks: []
423
+ });
424
+ }
425
+ function extend(schema, shape) {
426
+ if (!isPlainObject(shape)) {
427
+ throw new Error("Invalid input to extend: expected a plain object");
428
+ }
429
+ const def = {
430
+ ...schema._zod.def,
431
+ get shape() {
432
+ const _shape = { ...schema._zod.def.shape, ...shape };
433
+ assignProp(this, "shape", _shape);
434
+ return _shape;
435
+ },
436
+ checks: []
437
+ };
438
+ return clone(schema, def);
439
+ }
440
+ function merge(a, b) {
441
+ return clone(a, {
442
+ ...a._zod.def,
443
+ get shape() {
444
+ const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
445
+ assignProp(this, "shape", _shape);
446
+ return _shape;
447
+ },
448
+ catchall: b._zod.def.catchall,
449
+ checks: []
450
+ });
451
+ }
452
+ function partial(Class, schema, mask) {
453
+ const oldShape = schema._zod.def.shape;
454
+ const shape = { ...oldShape };
455
+ if (mask) {
456
+ for (const key in mask) {
457
+ if (!(key in oldShape)) {
458
+ throw new Error(`Unrecognized key: "${key}"`);
459
+ }
460
+ if (!mask[key])
461
+ continue;
462
+ shape[key] = Class ? new Class({
463
+ type: "optional",
464
+ innerType: oldShape[key]
465
+ }) : oldShape[key];
466
+ }
467
+ } else {
468
+ for (const key in oldShape) {
469
+ shape[key] = Class ? new Class({
470
+ type: "optional",
471
+ innerType: oldShape[key]
472
+ }) : oldShape[key];
473
+ }
474
+ }
475
+ return clone(schema, {
476
+ ...schema._zod.def,
477
+ shape,
478
+ checks: []
479
+ });
480
+ }
481
+ function required(Class, schema, mask) {
482
+ const oldShape = schema._zod.def.shape;
483
+ const shape = { ...oldShape };
484
+ if (mask) {
485
+ for (const key in mask) {
486
+ if (!(key in shape)) {
487
+ throw new Error(`Unrecognized key: "${key}"`);
488
+ }
489
+ if (!mask[key])
490
+ continue;
491
+ shape[key] = new Class({
492
+ type: "nonoptional",
493
+ innerType: oldShape[key]
494
+ });
495
+ }
496
+ } else {
497
+ for (const key in oldShape) {
498
+ shape[key] = new Class({
499
+ type: "nonoptional",
500
+ innerType: oldShape[key]
501
+ });
502
+ }
503
+ }
504
+ return clone(schema, {
505
+ ...schema._zod.def,
506
+ shape,
507
+ checks: []
508
+ });
509
+ }
510
+ function aborted(x, startIndex = 0) {
511
+ for (let i = startIndex;i < x.issues.length; i++) {
512
+ if (x.issues[i]?.continue !== true)
513
+ return true;
514
+ }
515
+ return false;
516
+ }
517
+ function prefixIssues(path, issues) {
518
+ return issues.map((iss) => {
519
+ var _a;
520
+ (_a = iss).path ?? (_a.path = []);
521
+ iss.path.unshift(path);
522
+ return iss;
523
+ });
524
+ }
525
+ function unwrapMessage(message) {
526
+ return typeof message === "string" ? message : message?.message;
527
+ }
528
+ function finalizeIssue(iss, ctx, config2) {
529
+ const full = { ...iss, path: iss.path ?? [] };
530
+ if (!iss.message) {
531
+ const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
532
+ full.message = message;
533
+ }
534
+ delete full.inst;
535
+ delete full.continue;
536
+ if (!ctx?.reportInput) {
537
+ delete full.input;
538
+ }
539
+ return full;
540
+ }
541
+ function getSizableOrigin(input) {
542
+ if (input instanceof Set)
543
+ return "set";
544
+ if (input instanceof Map)
545
+ return "map";
546
+ if (input instanceof File)
547
+ return "file";
548
+ return "unknown";
549
+ }
550
+ function getLengthableOrigin(input) {
551
+ if (Array.isArray(input))
552
+ return "array";
553
+ if (typeof input === "string")
554
+ return "string";
555
+ return "unknown";
556
+ }
557
+ function issue(...args) {
558
+ const [iss, input, inst] = args;
559
+ if (typeof iss === "string") {
560
+ return {
561
+ message: iss,
562
+ code: "custom",
563
+ input,
564
+ inst
565
+ };
566
+ }
567
+ return { ...iss };
568
+ }
569
+ function cleanEnum(obj) {
570
+ return Object.entries(obj).filter(([k, _]) => {
571
+ return Number.isNaN(Number.parseInt(k, 10));
572
+ }).map((el) => el[1]);
573
+ }
574
+
575
+ class Class {
576
+ constructor(..._args) {}
577
+ }
578
+
579
+ // node_modules/zod/v4/core/errors.js
580
+ var initializer = (inst, def) => {
581
+ inst.name = "$ZodError";
582
+ Object.defineProperty(inst, "_zod", {
583
+ value: inst._zod,
584
+ enumerable: false
585
+ });
586
+ Object.defineProperty(inst, "issues", {
587
+ value: def,
588
+ enumerable: false
589
+ });
590
+ Object.defineProperty(inst, "message", {
591
+ get() {
592
+ return JSON.stringify(def, jsonStringifyReplacer, 2);
593
+ },
594
+ enumerable: true
595
+ });
596
+ Object.defineProperty(inst, "toString", {
597
+ value: () => inst.message,
598
+ enumerable: false
599
+ });
600
+ };
601
+ var $ZodError = $constructor("$ZodError", initializer);
602
+ var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
603
+ function flattenError(error, mapper = (issue2) => issue2.message) {
604
+ const fieldErrors = {};
605
+ const formErrors = [];
606
+ for (const sub of error.issues) {
607
+ if (sub.path.length > 0) {
608
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
609
+ fieldErrors[sub.path[0]].push(mapper(sub));
610
+ } else {
611
+ formErrors.push(mapper(sub));
612
+ }
613
+ }
614
+ return { formErrors, fieldErrors };
615
+ }
616
+ function formatError(error, _mapper) {
617
+ const mapper = _mapper || function(issue2) {
618
+ return issue2.message;
619
+ };
620
+ const fieldErrors = { _errors: [] };
621
+ const processError = (error2) => {
622
+ for (const issue2 of error2.issues) {
623
+ if (issue2.code === "invalid_union" && issue2.errors.length) {
624
+ issue2.errors.map((issues) => processError({ issues }));
625
+ } else if (issue2.code === "invalid_key") {
626
+ processError({ issues: issue2.issues });
627
+ } else if (issue2.code === "invalid_element") {
628
+ processError({ issues: issue2.issues });
629
+ } else if (issue2.path.length === 0) {
630
+ fieldErrors._errors.push(mapper(issue2));
631
+ } else {
632
+ let curr = fieldErrors;
633
+ let i = 0;
634
+ while (i < issue2.path.length) {
635
+ const el = issue2.path[i];
636
+ const terminal = i === issue2.path.length - 1;
637
+ if (!terminal) {
638
+ curr[el] = curr[el] || { _errors: [] };
639
+ } else {
640
+ curr[el] = curr[el] || { _errors: [] };
641
+ curr[el]._errors.push(mapper(issue2));
642
+ }
643
+ curr = curr[el];
644
+ i++;
645
+ }
646
+ }
647
+ }
648
+ };
649
+ processError(error);
650
+ return fieldErrors;
651
+ }
652
+
653
+ // node_modules/zod/v4/core/parse.js
654
+ var _parse = (_Err) => (schema, value, _ctx, _params) => {
655
+ const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
656
+ const result = schema._zod.run({ value, issues: [] }, ctx);
657
+ if (result instanceof Promise) {
658
+ throw new $ZodAsyncError;
659
+ }
660
+ if (result.issues.length) {
661
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
662
+ captureStackTrace(e, _params?.callee);
663
+ throw e;
664
+ }
665
+ return result.value;
666
+ };
667
+ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
668
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
669
+ let result = schema._zod.run({ value, issues: [] }, ctx);
670
+ if (result instanceof Promise)
671
+ result = await result;
672
+ if (result.issues.length) {
673
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
674
+ captureStackTrace(e, params?.callee);
675
+ throw e;
676
+ }
677
+ return result.value;
678
+ };
679
+ var _safeParse = (_Err) => (schema, value, _ctx) => {
680
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
681
+ const result = schema._zod.run({ value, issues: [] }, ctx);
682
+ if (result instanceof Promise) {
683
+ throw new $ZodAsyncError;
684
+ }
685
+ return result.issues.length ? {
686
+ success: false,
687
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
688
+ } : { success: true, data: result.value };
689
+ };
690
+ var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
691
+ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
692
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
693
+ let result = schema._zod.run({ value, issues: [] }, ctx);
694
+ if (result instanceof Promise)
695
+ result = await result;
696
+ return result.issues.length ? {
697
+ success: false,
698
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
699
+ } : { success: true, data: result.value };
700
+ };
701
+ var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
702
+ // node_modules/zod/v4/core/regexes.js
703
+ var cuid = /^[cC][^\s-]{8,}$/;
704
+ var cuid2 = /^[0-9a-z]+$/;
705
+ var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
706
+ var xid = /^[0-9a-vA-V]{20}$/;
707
+ var ksuid = /^[A-Za-z0-9]{27}$/;
708
+ var nanoid = /^[a-zA-Z0-9_-]{21}$/;
709
+ var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
710
+ var guid = /^([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})$/;
711
+ var uuid = (version) => {
712
+ if (!version)
713
+ return /^([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)$/;
714
+ return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
715
+ };
716
+ var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
717
+ var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
718
+ function emoji() {
719
+ return new RegExp(_emoji, "u");
720
+ }
721
+ var ipv4 = /^(?:(?: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])$/;
722
+ var ipv6 = /^(([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})$/;
723
+ var cidrv4 = /^((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])$/;
724
+ var cidrv6 = /^(([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])$/;
725
+ var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
726
+ var base64url = /^[A-Za-z0-9_-]*$/;
727
+ var hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
728
+ var e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
729
+ var dateSource = `(?:(?:\\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])))`;
730
+ var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
731
+ function timeSource(args) {
732
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
733
+ const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
734
+ return regex;
735
+ }
736
+ function time(args) {
737
+ return new RegExp(`^${timeSource(args)}$`);
738
+ }
739
+ function datetime(args) {
740
+ const time2 = timeSource({ precision: args.precision });
741
+ const opts = ["Z"];
742
+ if (args.local)
743
+ opts.push("");
744
+ if (args.offset)
745
+ opts.push(`([+-]\\d{2}:\\d{2})`);
746
+ const timeRegex = `${time2}(?:${opts.join("|")})`;
747
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
748
+ }
749
+ var string = (params) => {
750
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
751
+ return new RegExp(`^${regex}$`);
752
+ };
753
+ var bigint = /^\d+n?$/;
754
+ var integer = /^\d+$/;
755
+ var number = /^-?\d+(?:\.\d+)?/i;
756
+ var boolean = /true|false/i;
757
+ var _null = /null/i;
758
+ var lowercase = /^[^A-Z]*$/;
759
+ var uppercase = /^[^a-z]*$/;
760
+
761
+ // node_modules/zod/v4/core/checks.js
762
+ var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
763
+ var _a;
764
+ inst._zod ?? (inst._zod = {});
765
+ inst._zod.def = def;
766
+ (_a = inst._zod).onattach ?? (_a.onattach = []);
767
+ });
768
+ var numericOriginMap = {
769
+ number: "number",
770
+ bigint: "bigint",
771
+ object: "date"
772
+ };
773
+ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
774
+ $ZodCheck.init(inst, def);
775
+ const origin = numericOriginMap[typeof def.value];
776
+ inst._zod.onattach.push((inst2) => {
777
+ const bag = inst2._zod.bag;
778
+ const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
779
+ if (def.value < curr) {
780
+ if (def.inclusive)
781
+ bag.maximum = def.value;
782
+ else
783
+ bag.exclusiveMaximum = def.value;
784
+ }
785
+ });
786
+ inst._zod.check = (payload) => {
787
+ if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
788
+ return;
789
+ }
790
+ payload.issues.push({
791
+ origin,
792
+ code: "too_big",
793
+ maximum: def.value,
794
+ input: payload.value,
795
+ inclusive: def.inclusive,
796
+ inst,
797
+ continue: !def.abort
798
+ });
799
+ };
800
+ });
801
+ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
802
+ $ZodCheck.init(inst, def);
803
+ const origin = numericOriginMap[typeof def.value];
804
+ inst._zod.onattach.push((inst2) => {
805
+ const bag = inst2._zod.bag;
806
+ const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
807
+ if (def.value > curr) {
808
+ if (def.inclusive)
809
+ bag.minimum = def.value;
810
+ else
811
+ bag.exclusiveMinimum = def.value;
812
+ }
813
+ });
814
+ inst._zod.check = (payload) => {
815
+ if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
816
+ return;
817
+ }
818
+ payload.issues.push({
819
+ origin,
820
+ code: "too_small",
821
+ minimum: def.value,
822
+ input: payload.value,
823
+ inclusive: def.inclusive,
824
+ inst,
825
+ continue: !def.abort
826
+ });
827
+ };
828
+ });
829
+ var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
830
+ $ZodCheck.init(inst, def);
831
+ inst._zod.onattach.push((inst2) => {
832
+ var _a;
833
+ (_a = inst2._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
834
+ });
835
+ inst._zod.check = (payload) => {
836
+ if (typeof payload.value !== typeof def.value)
837
+ throw new Error("Cannot mix number and bigint in multiple_of check.");
838
+ const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0;
839
+ if (isMultiple)
840
+ return;
841
+ payload.issues.push({
842
+ origin: typeof payload.value,
843
+ code: "not_multiple_of",
844
+ divisor: def.value,
845
+ input: payload.value,
846
+ inst,
847
+ continue: !def.abort
848
+ });
849
+ };
850
+ });
851
+ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
852
+ $ZodCheck.init(inst, def);
853
+ def.format = def.format || "float64";
854
+ const isInt = def.format?.includes("int");
855
+ const origin = isInt ? "int" : "number";
856
+ const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
857
+ inst._zod.onattach.push((inst2) => {
858
+ const bag = inst2._zod.bag;
859
+ bag.format = def.format;
860
+ bag.minimum = minimum;
861
+ bag.maximum = maximum;
862
+ if (isInt)
863
+ bag.pattern = integer;
864
+ });
865
+ inst._zod.check = (payload) => {
866
+ const input = payload.value;
867
+ if (isInt) {
868
+ if (!Number.isInteger(input)) {
869
+ payload.issues.push({
870
+ expected: origin,
871
+ format: def.format,
872
+ code: "invalid_type",
873
+ input,
874
+ inst
875
+ });
876
+ return;
877
+ }
878
+ if (!Number.isSafeInteger(input)) {
879
+ if (input > 0) {
880
+ payload.issues.push({
881
+ input,
882
+ code: "too_big",
883
+ maximum: Number.MAX_SAFE_INTEGER,
884
+ note: "Integers must be within the safe integer range.",
885
+ inst,
886
+ origin,
887
+ continue: !def.abort
888
+ });
889
+ } else {
890
+ payload.issues.push({
891
+ input,
892
+ code: "too_small",
893
+ minimum: Number.MIN_SAFE_INTEGER,
894
+ note: "Integers must be within the safe integer range.",
895
+ inst,
896
+ origin,
897
+ continue: !def.abort
898
+ });
899
+ }
900
+ return;
901
+ }
902
+ }
903
+ if (input < minimum) {
904
+ payload.issues.push({
905
+ origin: "number",
906
+ input,
907
+ code: "too_small",
908
+ minimum,
909
+ inclusive: true,
910
+ inst,
911
+ continue: !def.abort
912
+ });
913
+ }
914
+ if (input > maximum) {
915
+ payload.issues.push({
916
+ origin: "number",
917
+ input,
918
+ code: "too_big",
919
+ maximum,
920
+ inst
921
+ });
922
+ }
923
+ };
924
+ });
925
+ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
926
+ var _a;
927
+ $ZodCheck.init(inst, def);
928
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
929
+ const val = payload.value;
930
+ return !nullish(val) && val.length !== undefined;
931
+ });
932
+ inst._zod.onattach.push((inst2) => {
933
+ const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
934
+ if (def.maximum < curr)
935
+ inst2._zod.bag.maximum = def.maximum;
936
+ });
937
+ inst._zod.check = (payload) => {
938
+ const input = payload.value;
939
+ const length = input.length;
940
+ if (length <= def.maximum)
941
+ return;
942
+ const origin = getLengthableOrigin(input);
943
+ payload.issues.push({
944
+ origin,
945
+ code: "too_big",
946
+ maximum: def.maximum,
947
+ inclusive: true,
948
+ input,
949
+ inst,
950
+ continue: !def.abort
951
+ });
952
+ };
953
+ });
954
+ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
955
+ var _a;
956
+ $ZodCheck.init(inst, def);
957
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
958
+ const val = payload.value;
959
+ return !nullish(val) && val.length !== undefined;
960
+ });
961
+ inst._zod.onattach.push((inst2) => {
962
+ const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
963
+ if (def.minimum > curr)
964
+ inst2._zod.bag.minimum = def.minimum;
965
+ });
966
+ inst._zod.check = (payload) => {
967
+ const input = payload.value;
968
+ const length = input.length;
969
+ if (length >= def.minimum)
970
+ return;
971
+ const origin = getLengthableOrigin(input);
972
+ payload.issues.push({
973
+ origin,
974
+ code: "too_small",
975
+ minimum: def.minimum,
976
+ inclusive: true,
977
+ input,
978
+ inst,
979
+ continue: !def.abort
980
+ });
981
+ };
982
+ });
983
+ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
984
+ var _a;
985
+ $ZodCheck.init(inst, def);
986
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
987
+ const val = payload.value;
988
+ return !nullish(val) && val.length !== undefined;
989
+ });
990
+ inst._zod.onattach.push((inst2) => {
991
+ const bag = inst2._zod.bag;
992
+ bag.minimum = def.length;
993
+ bag.maximum = def.length;
994
+ bag.length = def.length;
995
+ });
996
+ inst._zod.check = (payload) => {
997
+ const input = payload.value;
998
+ const length = input.length;
999
+ if (length === def.length)
1000
+ return;
1001
+ const origin = getLengthableOrigin(input);
1002
+ const tooBig = length > def.length;
1003
+ payload.issues.push({
1004
+ origin,
1005
+ ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
1006
+ inclusive: true,
1007
+ exact: true,
1008
+ input: payload.value,
1009
+ inst,
1010
+ continue: !def.abort
1011
+ });
1012
+ };
1013
+ });
1014
+ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1015
+ var _a, _b;
1016
+ $ZodCheck.init(inst, def);
1017
+ inst._zod.onattach.push((inst2) => {
1018
+ const bag = inst2._zod.bag;
1019
+ bag.format = def.format;
1020
+ if (def.pattern) {
1021
+ bag.patterns ?? (bag.patterns = new Set);
1022
+ bag.patterns.add(def.pattern);
1023
+ }
1024
+ });
1025
+ if (def.pattern)
1026
+ (_a = inst._zod).check ?? (_a.check = (payload) => {
1027
+ def.pattern.lastIndex = 0;
1028
+ if (def.pattern.test(payload.value))
1029
+ return;
1030
+ payload.issues.push({
1031
+ origin: "string",
1032
+ code: "invalid_format",
1033
+ format: def.format,
1034
+ input: payload.value,
1035
+ ...def.pattern ? { pattern: def.pattern.toString() } : {},
1036
+ inst,
1037
+ continue: !def.abort
1038
+ });
1039
+ });
1040
+ else
1041
+ (_b = inst._zod).check ?? (_b.check = () => {});
1042
+ });
1043
+ var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
1044
+ $ZodCheckStringFormat.init(inst, def);
1045
+ inst._zod.check = (payload) => {
1046
+ def.pattern.lastIndex = 0;
1047
+ if (def.pattern.test(payload.value))
1048
+ return;
1049
+ payload.issues.push({
1050
+ origin: "string",
1051
+ code: "invalid_format",
1052
+ format: "regex",
1053
+ input: payload.value,
1054
+ pattern: def.pattern.toString(),
1055
+ inst,
1056
+ continue: !def.abort
1057
+ });
1058
+ };
1059
+ });
1060
+ var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => {
1061
+ def.pattern ?? (def.pattern = lowercase);
1062
+ $ZodCheckStringFormat.init(inst, def);
1063
+ });
1064
+ var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => {
1065
+ def.pattern ?? (def.pattern = uppercase);
1066
+ $ZodCheckStringFormat.init(inst, def);
1067
+ });
1068
+ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
1069
+ $ZodCheck.init(inst, def);
1070
+ const escapedRegex = escapeRegex(def.includes);
1071
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
1072
+ def.pattern = pattern;
1073
+ inst._zod.onattach.push((inst2) => {
1074
+ const bag = inst2._zod.bag;
1075
+ bag.patterns ?? (bag.patterns = new Set);
1076
+ bag.patterns.add(pattern);
1077
+ });
1078
+ inst._zod.check = (payload) => {
1079
+ if (payload.value.includes(def.includes, def.position))
1080
+ return;
1081
+ payload.issues.push({
1082
+ origin: "string",
1083
+ code: "invalid_format",
1084
+ format: "includes",
1085
+ includes: def.includes,
1086
+ input: payload.value,
1087
+ inst,
1088
+ continue: !def.abort
1089
+ });
1090
+ };
1091
+ });
1092
+ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
1093
+ $ZodCheck.init(inst, def);
1094
+ const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
1095
+ def.pattern ?? (def.pattern = pattern);
1096
+ inst._zod.onattach.push((inst2) => {
1097
+ const bag = inst2._zod.bag;
1098
+ bag.patterns ?? (bag.patterns = new Set);
1099
+ bag.patterns.add(pattern);
1100
+ });
1101
+ inst._zod.check = (payload) => {
1102
+ if (payload.value.startsWith(def.prefix))
1103
+ return;
1104
+ payload.issues.push({
1105
+ origin: "string",
1106
+ code: "invalid_format",
1107
+ format: "starts_with",
1108
+ prefix: def.prefix,
1109
+ input: payload.value,
1110
+ inst,
1111
+ continue: !def.abort
1112
+ });
1113
+ };
1114
+ });
1115
+ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
1116
+ $ZodCheck.init(inst, def);
1117
+ const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
1118
+ def.pattern ?? (def.pattern = pattern);
1119
+ inst._zod.onattach.push((inst2) => {
1120
+ const bag = inst2._zod.bag;
1121
+ bag.patterns ?? (bag.patterns = new Set);
1122
+ bag.patterns.add(pattern);
1123
+ });
1124
+ inst._zod.check = (payload) => {
1125
+ if (payload.value.endsWith(def.suffix))
1126
+ return;
1127
+ payload.issues.push({
1128
+ origin: "string",
1129
+ code: "invalid_format",
1130
+ format: "ends_with",
1131
+ suffix: def.suffix,
1132
+ input: payload.value,
1133
+ inst,
1134
+ continue: !def.abort
1135
+ });
1136
+ };
1137
+ });
1138
+ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
1139
+ $ZodCheck.init(inst, def);
1140
+ inst._zod.check = (payload) => {
1141
+ payload.value = def.tx(payload.value);
1142
+ };
1143
+ });
1144
+
1145
+ // node_modules/zod/v4/core/doc.js
1146
+ class Doc {
1147
+ constructor(args = []) {
1148
+ this.content = [];
1149
+ this.indent = 0;
1150
+ if (this)
1151
+ this.args = args;
1152
+ }
1153
+ indented(fn) {
1154
+ this.indent += 1;
1155
+ fn(this);
1156
+ this.indent -= 1;
1157
+ }
1158
+ write(arg) {
1159
+ if (typeof arg === "function") {
1160
+ arg(this, { execution: "sync" });
1161
+ arg(this, { execution: "async" });
1162
+ return;
1163
+ }
1164
+ const content = arg;
1165
+ const lines = content.split(`
1166
+ `).filter((x) => x);
1167
+ const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
1168
+ const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
1169
+ for (const line of dedented) {
1170
+ this.content.push(line);
1171
+ }
1172
+ }
1173
+ compile() {
1174
+ const F = Function;
1175
+ const args = this?.args;
1176
+ const content = this?.content ?? [``];
1177
+ const lines = [...content.map((x) => ` ${x}`)];
1178
+ return new F(...args, lines.join(`
1179
+ `));
1180
+ }
1181
+ }
1182
+
1183
+ // node_modules/zod/v4/core/versions.js
1184
+ var version = {
1185
+ major: 4,
1186
+ minor: 0,
1187
+ patch: 0
1188
+ };
1189
+
1190
+ // node_modules/zod/v4/core/schemas.js
1191
+ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1192
+ var _a;
1193
+ inst ?? (inst = {});
1194
+ inst._zod.def = def;
1195
+ inst._zod.bag = inst._zod.bag || {};
1196
+ inst._zod.version = version;
1197
+ const checks = [...inst._zod.def.checks ?? []];
1198
+ if (inst._zod.traits.has("$ZodCheck")) {
1199
+ checks.unshift(inst);
1200
+ }
1201
+ for (const ch of checks) {
1202
+ for (const fn of ch._zod.onattach) {
1203
+ fn(inst);
1204
+ }
1205
+ }
1206
+ if (checks.length === 0) {
1207
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
1208
+ inst._zod.deferred?.push(() => {
1209
+ inst._zod.run = inst._zod.parse;
1210
+ });
1211
+ } else {
1212
+ const runChecks = (payload, checks2, ctx) => {
1213
+ let isAborted = aborted(payload);
1214
+ let asyncResult;
1215
+ for (const ch of checks2) {
1216
+ if (ch._zod.def.when) {
1217
+ const shouldRun = ch._zod.def.when(payload);
1218
+ if (!shouldRun)
1219
+ continue;
1220
+ } else if (isAborted) {
1221
+ continue;
1222
+ }
1223
+ const currLen = payload.issues.length;
1224
+ const _ = ch._zod.check(payload);
1225
+ if (_ instanceof Promise && ctx?.async === false) {
1226
+ throw new $ZodAsyncError;
1227
+ }
1228
+ if (asyncResult || _ instanceof Promise) {
1229
+ asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
1230
+ await _;
1231
+ const nextLen = payload.issues.length;
1232
+ if (nextLen === currLen)
1233
+ return;
1234
+ if (!isAborted)
1235
+ isAborted = aborted(payload, currLen);
1236
+ });
1237
+ } else {
1238
+ const nextLen = payload.issues.length;
1239
+ if (nextLen === currLen)
1240
+ continue;
1241
+ if (!isAborted)
1242
+ isAborted = aborted(payload, currLen);
1243
+ }
1244
+ }
1245
+ if (asyncResult) {
1246
+ return asyncResult.then(() => {
1247
+ return payload;
1248
+ });
1249
+ }
1250
+ return payload;
1251
+ };
1252
+ inst._zod.run = (payload, ctx) => {
1253
+ const result = inst._zod.parse(payload, ctx);
1254
+ if (result instanceof Promise) {
1255
+ if (ctx.async === false)
1256
+ throw new $ZodAsyncError;
1257
+ return result.then((result2) => runChecks(result2, checks, ctx));
1258
+ }
1259
+ return runChecks(result, checks, ctx);
1260
+ };
1261
+ }
1262
+ inst["~standard"] = {
1263
+ validate: (value) => {
1264
+ try {
1265
+ const r = safeParse(inst, value);
1266
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
1267
+ } catch (_) {
1268
+ return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1269
+ }
1270
+ },
1271
+ vendor: "zod",
1272
+ version: 1
1273
+ };
1274
+ });
1275
+ var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
1276
+ $ZodType.init(inst, def);
1277
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
1278
+ inst._zod.parse = (payload, _) => {
1279
+ if (def.coerce)
1280
+ try {
1281
+ payload.value = String(payload.value);
1282
+ } catch (_2) {}
1283
+ if (typeof payload.value === "string")
1284
+ return payload;
1285
+ payload.issues.push({
1286
+ expected: "string",
1287
+ code: "invalid_type",
1288
+ input: payload.value,
1289
+ inst
1290
+ });
1291
+ return payload;
1292
+ };
1293
+ });
1294
+ var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
1295
+ $ZodCheckStringFormat.init(inst, def);
1296
+ $ZodString.init(inst, def);
1297
+ });
1298
+ var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
1299
+ def.pattern ?? (def.pattern = guid);
1300
+ $ZodStringFormat.init(inst, def);
1301
+ });
1302
+ var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
1303
+ if (def.version) {
1304
+ const versionMap = {
1305
+ v1: 1,
1306
+ v2: 2,
1307
+ v3: 3,
1308
+ v4: 4,
1309
+ v5: 5,
1310
+ v6: 6,
1311
+ v7: 7,
1312
+ v8: 8
1313
+ };
1314
+ const v = versionMap[def.version];
1315
+ if (v === undefined)
1316
+ throw new Error(`Invalid UUID version: "${def.version}"`);
1317
+ def.pattern ?? (def.pattern = uuid(v));
1318
+ } else
1319
+ def.pattern ?? (def.pattern = uuid());
1320
+ $ZodStringFormat.init(inst, def);
1321
+ });
1322
+ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
1323
+ def.pattern ?? (def.pattern = email);
1324
+ $ZodStringFormat.init(inst, def);
1325
+ });
1326
+ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1327
+ $ZodStringFormat.init(inst, def);
1328
+ inst._zod.check = (payload) => {
1329
+ try {
1330
+ const orig = payload.value;
1331
+ const url = new URL(orig);
1332
+ const href = url.href;
1333
+ if (def.hostname) {
1334
+ def.hostname.lastIndex = 0;
1335
+ if (!def.hostname.test(url.hostname)) {
1336
+ payload.issues.push({
1337
+ code: "invalid_format",
1338
+ format: "url",
1339
+ note: "Invalid hostname",
1340
+ pattern: hostname.source,
1341
+ input: payload.value,
1342
+ inst,
1343
+ continue: !def.abort
1344
+ });
1345
+ }
1346
+ }
1347
+ if (def.protocol) {
1348
+ def.protocol.lastIndex = 0;
1349
+ if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
1350
+ payload.issues.push({
1351
+ code: "invalid_format",
1352
+ format: "url",
1353
+ note: "Invalid protocol",
1354
+ pattern: def.protocol.source,
1355
+ input: payload.value,
1356
+ inst,
1357
+ continue: !def.abort
1358
+ });
1359
+ }
1360
+ }
1361
+ if (!orig.endsWith("/") && href.endsWith("/")) {
1362
+ payload.value = href.slice(0, -1);
1363
+ } else {
1364
+ payload.value = href;
1365
+ }
1366
+ return;
1367
+ } catch (_) {
1368
+ payload.issues.push({
1369
+ code: "invalid_format",
1370
+ format: "url",
1371
+ input: payload.value,
1372
+ inst,
1373
+ continue: !def.abort
1374
+ });
1375
+ }
1376
+ };
1377
+ });
1378
+ var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
1379
+ def.pattern ?? (def.pattern = emoji());
1380
+ $ZodStringFormat.init(inst, def);
1381
+ });
1382
+ var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
1383
+ def.pattern ?? (def.pattern = nanoid);
1384
+ $ZodStringFormat.init(inst, def);
1385
+ });
1386
+ var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
1387
+ def.pattern ?? (def.pattern = cuid);
1388
+ $ZodStringFormat.init(inst, def);
1389
+ });
1390
+ var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
1391
+ def.pattern ?? (def.pattern = cuid2);
1392
+ $ZodStringFormat.init(inst, def);
1393
+ });
1394
+ var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
1395
+ def.pattern ?? (def.pattern = ulid);
1396
+ $ZodStringFormat.init(inst, def);
1397
+ });
1398
+ var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
1399
+ def.pattern ?? (def.pattern = xid);
1400
+ $ZodStringFormat.init(inst, def);
1401
+ });
1402
+ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
1403
+ def.pattern ?? (def.pattern = ksuid);
1404
+ $ZodStringFormat.init(inst, def);
1405
+ });
1406
+ var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
1407
+ def.pattern ?? (def.pattern = datetime(def));
1408
+ $ZodStringFormat.init(inst, def);
1409
+ });
1410
+ var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
1411
+ def.pattern ?? (def.pattern = date);
1412
+ $ZodStringFormat.init(inst, def);
1413
+ });
1414
+ var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
1415
+ def.pattern ?? (def.pattern = time(def));
1416
+ $ZodStringFormat.init(inst, def);
1417
+ });
1418
+ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
1419
+ def.pattern ?? (def.pattern = duration);
1420
+ $ZodStringFormat.init(inst, def);
1421
+ });
1422
+ var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
1423
+ def.pattern ?? (def.pattern = ipv4);
1424
+ $ZodStringFormat.init(inst, def);
1425
+ inst._zod.onattach.push((inst2) => {
1426
+ const bag = inst2._zod.bag;
1427
+ bag.format = `ipv4`;
1428
+ });
1429
+ });
1430
+ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
1431
+ def.pattern ?? (def.pattern = ipv6);
1432
+ $ZodStringFormat.init(inst, def);
1433
+ inst._zod.onattach.push((inst2) => {
1434
+ const bag = inst2._zod.bag;
1435
+ bag.format = `ipv6`;
1436
+ });
1437
+ inst._zod.check = (payload) => {
1438
+ try {
1439
+ new URL(`http://[${payload.value}]`);
1440
+ } catch {
1441
+ payload.issues.push({
1442
+ code: "invalid_format",
1443
+ format: "ipv6",
1444
+ input: payload.value,
1445
+ inst,
1446
+ continue: !def.abort
1447
+ });
1448
+ }
1449
+ };
1450
+ });
1451
+ var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
1452
+ def.pattern ?? (def.pattern = cidrv4);
1453
+ $ZodStringFormat.init(inst, def);
1454
+ });
1455
+ var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
1456
+ def.pattern ?? (def.pattern = cidrv6);
1457
+ $ZodStringFormat.init(inst, def);
1458
+ inst._zod.check = (payload) => {
1459
+ const [address, prefix] = payload.value.split("/");
1460
+ try {
1461
+ if (!prefix)
1462
+ throw new Error;
1463
+ const prefixNum = Number(prefix);
1464
+ if (`${prefixNum}` !== prefix)
1465
+ throw new Error;
1466
+ if (prefixNum < 0 || prefixNum > 128)
1467
+ throw new Error;
1468
+ new URL(`http://[${address}]`);
1469
+ } catch {
1470
+ payload.issues.push({
1471
+ code: "invalid_format",
1472
+ format: "cidrv6",
1473
+ input: payload.value,
1474
+ inst,
1475
+ continue: !def.abort
1476
+ });
1477
+ }
1478
+ };
1479
+ });
1480
+ function isValidBase64(data) {
1481
+ if (data === "")
1482
+ return true;
1483
+ if (data.length % 4 !== 0)
1484
+ return false;
1485
+ try {
1486
+ atob(data);
1487
+ return true;
1488
+ } catch {
1489
+ return false;
1490
+ }
1491
+ }
1492
+ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
1493
+ def.pattern ?? (def.pattern = base64);
1494
+ $ZodStringFormat.init(inst, def);
1495
+ inst._zod.onattach.push((inst2) => {
1496
+ inst2._zod.bag.contentEncoding = "base64";
1497
+ });
1498
+ inst._zod.check = (payload) => {
1499
+ if (isValidBase64(payload.value))
1500
+ return;
1501
+ payload.issues.push({
1502
+ code: "invalid_format",
1503
+ format: "base64",
1504
+ input: payload.value,
1505
+ inst,
1506
+ continue: !def.abort
1507
+ });
1508
+ };
1509
+ });
1510
+ function isValidBase64URL(data) {
1511
+ if (!base64url.test(data))
1512
+ return false;
1513
+ const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1514
+ const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "=");
1515
+ return isValidBase64(padded);
1516
+ }
1517
+ var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
1518
+ def.pattern ?? (def.pattern = base64url);
1519
+ $ZodStringFormat.init(inst, def);
1520
+ inst._zod.onattach.push((inst2) => {
1521
+ inst2._zod.bag.contentEncoding = "base64url";
1522
+ });
1523
+ inst._zod.check = (payload) => {
1524
+ if (isValidBase64URL(payload.value))
1525
+ return;
1526
+ payload.issues.push({
1527
+ code: "invalid_format",
1528
+ format: "base64url",
1529
+ input: payload.value,
1530
+ inst,
1531
+ continue: !def.abort
1532
+ });
1533
+ };
1534
+ });
1535
+ var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
1536
+ def.pattern ?? (def.pattern = e164);
1537
+ $ZodStringFormat.init(inst, def);
1538
+ });
1539
+ function isValidJWT(token, algorithm = null) {
1540
+ try {
1541
+ const tokensParts = token.split(".");
1542
+ if (tokensParts.length !== 3)
1543
+ return false;
1544
+ const [header] = tokensParts;
1545
+ if (!header)
1546
+ return false;
1547
+ const parsedHeader = JSON.parse(atob(header));
1548
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
1549
+ return false;
1550
+ if (!parsedHeader.alg)
1551
+ return false;
1552
+ if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
1553
+ return false;
1554
+ return true;
1555
+ } catch {
1556
+ return false;
1557
+ }
1558
+ }
1559
+ var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1560
+ $ZodStringFormat.init(inst, def);
1561
+ inst._zod.check = (payload) => {
1562
+ if (isValidJWT(payload.value, def.alg))
1563
+ return;
1564
+ payload.issues.push({
1565
+ code: "invalid_format",
1566
+ format: "jwt",
1567
+ input: payload.value,
1568
+ inst,
1569
+ continue: !def.abort
1570
+ });
1571
+ };
1572
+ });
1573
+ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1574
+ $ZodType.init(inst, def);
1575
+ inst._zod.pattern = inst._zod.bag.pattern ?? number;
1576
+ inst._zod.parse = (payload, _ctx) => {
1577
+ if (def.coerce)
1578
+ try {
1579
+ payload.value = Number(payload.value);
1580
+ } catch (_) {}
1581
+ const input = payload.value;
1582
+ if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
1583
+ return payload;
1584
+ }
1585
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : undefined : undefined;
1586
+ payload.issues.push({
1587
+ expected: "number",
1588
+ code: "invalid_type",
1589
+ input,
1590
+ inst,
1591
+ ...received ? { received } : {}
1592
+ });
1593
+ return payload;
1594
+ };
1595
+ });
1596
+ var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1597
+ $ZodCheckNumberFormat.init(inst, def);
1598
+ $ZodNumber.init(inst, def);
1599
+ });
1600
+ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
1601
+ $ZodType.init(inst, def);
1602
+ inst._zod.pattern = boolean;
1603
+ inst._zod.parse = (payload, _ctx) => {
1604
+ if (def.coerce)
1605
+ try {
1606
+ payload.value = Boolean(payload.value);
1607
+ } catch (_) {}
1608
+ const input = payload.value;
1609
+ if (typeof input === "boolean")
1610
+ return payload;
1611
+ payload.issues.push({
1612
+ expected: "boolean",
1613
+ code: "invalid_type",
1614
+ input,
1615
+ inst
1616
+ });
1617
+ return payload;
1618
+ };
1619
+ });
1620
+ var $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
1621
+ $ZodType.init(inst, def);
1622
+ inst._zod.pattern = bigint;
1623
+ inst._zod.parse = (payload, _ctx) => {
1624
+ if (def.coerce)
1625
+ try {
1626
+ payload.value = BigInt(payload.value);
1627
+ } catch (_) {}
1628
+ if (typeof payload.value === "bigint")
1629
+ return payload;
1630
+ payload.issues.push({
1631
+ expected: "bigint",
1632
+ code: "invalid_type",
1633
+ input: payload.value,
1634
+ inst
1635
+ });
1636
+ return payload;
1637
+ };
1638
+ });
1639
+ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1640
+ $ZodType.init(inst, def);
1641
+ inst._zod.pattern = _null;
1642
+ inst._zod.values = new Set([null]);
1643
+ inst._zod.parse = (payload, _ctx) => {
1644
+ const input = payload.value;
1645
+ if (input === null)
1646
+ return payload;
1647
+ payload.issues.push({
1648
+ expected: "null",
1649
+ code: "invalid_type",
1650
+ input,
1651
+ inst
1652
+ });
1653
+ return payload;
1654
+ };
1655
+ });
1656
+ var $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
1657
+ $ZodType.init(inst, def);
1658
+ inst._zod.parse = (payload) => payload;
1659
+ });
1660
+ var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
1661
+ $ZodType.init(inst, def);
1662
+ inst._zod.parse = (payload) => payload;
1663
+ });
1664
+ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1665
+ $ZodType.init(inst, def);
1666
+ inst._zod.parse = (payload, _ctx) => {
1667
+ payload.issues.push({
1668
+ expected: "never",
1669
+ code: "invalid_type",
1670
+ input: payload.value,
1671
+ inst
1672
+ });
1673
+ return payload;
1674
+ };
1675
+ });
1676
+ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
1677
+ $ZodType.init(inst, def);
1678
+ inst._zod.parse = (payload, _ctx) => {
1679
+ if (def.coerce) {
1680
+ try {
1681
+ payload.value = new Date(payload.value);
1682
+ } catch (_err) {}
1683
+ }
1684
+ const input = payload.value;
1685
+ const isDate = input instanceof Date;
1686
+ const isValidDate = isDate && !Number.isNaN(input.getTime());
1687
+ if (isValidDate)
1688
+ return payload;
1689
+ payload.issues.push({
1690
+ expected: "date",
1691
+ code: "invalid_type",
1692
+ input,
1693
+ ...isDate ? { received: "Invalid Date" } : {},
1694
+ inst
1695
+ });
1696
+ return payload;
1697
+ };
1698
+ });
1699
+ function handleArrayResult(result, final, index) {
1700
+ if (result.issues.length) {
1701
+ final.issues.push(...prefixIssues(index, result.issues));
1702
+ }
1703
+ final.value[index] = result.value;
1704
+ }
1705
+ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1706
+ $ZodType.init(inst, def);
1707
+ inst._zod.parse = (payload, ctx) => {
1708
+ const input = payload.value;
1709
+ if (!Array.isArray(input)) {
1710
+ payload.issues.push({
1711
+ expected: "array",
1712
+ code: "invalid_type",
1713
+ input,
1714
+ inst
1715
+ });
1716
+ return payload;
1717
+ }
1718
+ payload.value = Array(input.length);
1719
+ const proms = [];
1720
+ for (let i = 0;i < input.length; i++) {
1721
+ const item = input[i];
1722
+ const result = def.element._zod.run({
1723
+ value: item,
1724
+ issues: []
1725
+ }, ctx);
1726
+ if (result instanceof Promise) {
1727
+ proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
1728
+ } else {
1729
+ handleArrayResult(result, payload, i);
1730
+ }
1731
+ }
1732
+ if (proms.length) {
1733
+ return Promise.all(proms).then(() => payload);
1734
+ }
1735
+ return payload;
1736
+ };
1737
+ });
1738
+ function handleObjectResult(result, final, key) {
1739
+ if (result.issues.length) {
1740
+ final.issues.push(...prefixIssues(key, result.issues));
1741
+ }
1742
+ final.value[key] = result.value;
1743
+ }
1744
+ function handleOptionalObjectResult(result, final, key, input) {
1745
+ if (result.issues.length) {
1746
+ if (input[key] === undefined) {
1747
+ if (key in input) {
1748
+ final.value[key] = undefined;
1749
+ } else {
1750
+ final.value[key] = result.value;
1751
+ }
1752
+ } else {
1753
+ final.issues.push(...prefixIssues(key, result.issues));
1754
+ }
1755
+ } else if (result.value === undefined) {
1756
+ if (key in input)
1757
+ final.value[key] = undefined;
1758
+ } else {
1759
+ final.value[key] = result.value;
1760
+ }
1761
+ }
1762
+ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1763
+ $ZodType.init(inst, def);
1764
+ const _normalized = cached(() => {
1765
+ const keys = Object.keys(def.shape);
1766
+ for (const k of keys) {
1767
+ if (!(def.shape[k] instanceof $ZodType)) {
1768
+ throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1769
+ }
1770
+ }
1771
+ const okeys = optionalKeys(def.shape);
1772
+ return {
1773
+ shape: def.shape,
1774
+ keys,
1775
+ keySet: new Set(keys),
1776
+ numKeys: keys.length,
1777
+ optionalKeys: new Set(okeys)
1778
+ };
1779
+ });
1780
+ defineLazy(inst._zod, "propValues", () => {
1781
+ const shape = def.shape;
1782
+ const propValues = {};
1783
+ for (const key in shape) {
1784
+ const field = shape[key]._zod;
1785
+ if (field.values) {
1786
+ propValues[key] ?? (propValues[key] = new Set);
1787
+ for (const v of field.values)
1788
+ propValues[key].add(v);
1789
+ }
1790
+ }
1791
+ return propValues;
1792
+ });
1793
+ const generateFastpass = (shape) => {
1794
+ const doc = new Doc(["shape", "payload", "ctx"]);
1795
+ const normalized = _normalized.value;
1796
+ const parseStr = (key) => {
1797
+ const k = esc(key);
1798
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1799
+ };
1800
+ doc.write(`const input = payload.value;`);
1801
+ const ids = Object.create(null);
1802
+ let counter = 0;
1803
+ for (const key of normalized.keys) {
1804
+ ids[key] = `key_${counter++}`;
1805
+ }
1806
+ doc.write(`const newResult = {}`);
1807
+ for (const key of normalized.keys) {
1808
+ if (normalized.optionalKeys.has(key)) {
1809
+ const id = ids[key];
1810
+ doc.write(`const ${id} = ${parseStr(key)};`);
1811
+ const k = esc(key);
1812
+ doc.write(`
1813
+ if (${id}.issues.length) {
1814
+ if (input[${k}] === undefined) {
1815
+ if (${k} in input) {
1816
+ newResult[${k}] = undefined;
1817
+ }
1818
+ } else {
1819
+ payload.issues = payload.issues.concat(
1820
+ ${id}.issues.map((iss) => ({
1821
+ ...iss,
1822
+ path: iss.path ? [${k}, ...iss.path] : [${k}],
1823
+ }))
1824
+ );
1825
+ }
1826
+ } else if (${id}.value === undefined) {
1827
+ if (${k} in input) newResult[${k}] = undefined;
1828
+ } else {
1829
+ newResult[${k}] = ${id}.value;
1830
+ }
1831
+ `);
1832
+ } else {
1833
+ const id = ids[key];
1834
+ doc.write(`const ${id} = ${parseStr(key)};`);
1835
+ doc.write(`
1836
+ if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1837
+ ...iss,
1838
+ path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
1839
+ })));`);
1840
+ doc.write(`newResult[${esc(key)}] = ${id}.value`);
1841
+ }
1842
+ }
1843
+ doc.write(`payload.value = newResult;`);
1844
+ doc.write(`return payload;`);
1845
+ const fn = doc.compile();
1846
+ return (payload, ctx) => fn(shape, payload, ctx);
1847
+ };
1848
+ let fastpass;
1849
+ const isObject2 = isObject;
1850
+ const jit = !globalConfig.jitless;
1851
+ const allowsEval2 = allowsEval;
1852
+ const fastEnabled = jit && allowsEval2.value;
1853
+ const catchall = def.catchall;
1854
+ let value;
1855
+ inst._zod.parse = (payload, ctx) => {
1856
+ value ?? (value = _normalized.value);
1857
+ const input = payload.value;
1858
+ if (!isObject2(input)) {
1859
+ payload.issues.push({
1860
+ expected: "object",
1861
+ code: "invalid_type",
1862
+ input,
1863
+ inst
1864
+ });
1865
+ return payload;
1866
+ }
1867
+ const proms = [];
1868
+ if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1869
+ if (!fastpass)
1870
+ fastpass = generateFastpass(def.shape);
1871
+ payload = fastpass(payload, ctx);
1872
+ } else {
1873
+ payload.value = {};
1874
+ const shape = value.shape;
1875
+ for (const key of value.keys) {
1876
+ const el = shape[key];
1877
+ const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1878
+ const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
1879
+ if (r instanceof Promise) {
1880
+ proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
1881
+ } else if (isOptional) {
1882
+ handleOptionalObjectResult(r, payload, key, input);
1883
+ } else {
1884
+ handleObjectResult(r, payload, key);
1885
+ }
1886
+ }
1887
+ }
1888
+ if (!catchall) {
1889
+ return proms.length ? Promise.all(proms).then(() => payload) : payload;
1890
+ }
1891
+ const unrecognized = [];
1892
+ const keySet = value.keySet;
1893
+ const _catchall = catchall._zod;
1894
+ const t = _catchall.def.type;
1895
+ for (const key of Object.keys(input)) {
1896
+ if (keySet.has(key))
1897
+ continue;
1898
+ if (t === "never") {
1899
+ unrecognized.push(key);
1900
+ continue;
1901
+ }
1902
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1903
+ if (r instanceof Promise) {
1904
+ proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
1905
+ } else {
1906
+ handleObjectResult(r, payload, key);
1907
+ }
1908
+ }
1909
+ if (unrecognized.length) {
1910
+ payload.issues.push({
1911
+ code: "unrecognized_keys",
1912
+ keys: unrecognized,
1913
+ input,
1914
+ inst
1915
+ });
1916
+ }
1917
+ if (!proms.length)
1918
+ return payload;
1919
+ return Promise.all(proms).then(() => {
1920
+ return payload;
1921
+ });
1922
+ };
1923
+ });
1924
+ function handleUnionResults(results, final, inst, ctx) {
1925
+ for (const result of results) {
1926
+ if (result.issues.length === 0) {
1927
+ final.value = result.value;
1928
+ return final;
1929
+ }
1930
+ }
1931
+ final.issues.push({
1932
+ code: "invalid_union",
1933
+ input: final.value,
1934
+ inst,
1935
+ errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1936
+ });
1937
+ return final;
1938
+ }
1939
+ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1940
+ $ZodType.init(inst, def);
1941
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
1942
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
1943
+ defineLazy(inst._zod, "values", () => {
1944
+ if (def.options.every((o) => o._zod.values)) {
1945
+ return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1946
+ }
1947
+ return;
1948
+ });
1949
+ defineLazy(inst._zod, "pattern", () => {
1950
+ if (def.options.every((o) => o._zod.pattern)) {
1951
+ const patterns = def.options.map((o) => o._zod.pattern);
1952
+ return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1953
+ }
1954
+ return;
1955
+ });
1956
+ inst._zod.parse = (payload, ctx) => {
1957
+ let async = false;
1958
+ const results = [];
1959
+ for (const option of def.options) {
1960
+ const result = option._zod.run({
1961
+ value: payload.value,
1962
+ issues: []
1963
+ }, ctx);
1964
+ if (result instanceof Promise) {
1965
+ results.push(result);
1966
+ async = true;
1967
+ } else {
1968
+ if (result.issues.length === 0)
1969
+ return result;
1970
+ results.push(result);
1971
+ }
1972
+ }
1973
+ if (!async)
1974
+ return handleUnionResults(results, payload, inst, ctx);
1975
+ return Promise.all(results).then((results2) => {
1976
+ return handleUnionResults(results2, payload, inst, ctx);
1977
+ });
1978
+ };
1979
+ });
1980
+ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
1981
+ $ZodUnion.init(inst, def);
1982
+ const _super = inst._zod.parse;
1983
+ defineLazy(inst._zod, "propValues", () => {
1984
+ const propValues = {};
1985
+ for (const option of def.options) {
1986
+ const pv = option._zod.propValues;
1987
+ if (!pv || Object.keys(pv).length === 0)
1988
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
1989
+ for (const [k, v] of Object.entries(pv)) {
1990
+ if (!propValues[k])
1991
+ propValues[k] = new Set;
1992
+ for (const val of v) {
1993
+ propValues[k].add(val);
1994
+ }
1995
+ }
1996
+ }
1997
+ return propValues;
1998
+ });
1999
+ const disc = cached(() => {
2000
+ const opts = def.options;
2001
+ const map = new Map;
2002
+ for (const o of opts) {
2003
+ const values = o._zod.propValues[def.discriminator];
2004
+ if (!values || values.size === 0)
2005
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
2006
+ for (const v of values) {
2007
+ if (map.has(v)) {
2008
+ throw new Error(`Duplicate discriminator value "${String(v)}"`);
2009
+ }
2010
+ map.set(v, o);
2011
+ }
2012
+ }
2013
+ return map;
2014
+ });
2015
+ inst._zod.parse = (payload, ctx) => {
2016
+ const input = payload.value;
2017
+ if (!isObject(input)) {
2018
+ payload.issues.push({
2019
+ code: "invalid_type",
2020
+ expected: "object",
2021
+ input,
2022
+ inst
2023
+ });
2024
+ return payload;
2025
+ }
2026
+ const opt = disc.value.get(input?.[def.discriminator]);
2027
+ if (opt) {
2028
+ return opt._zod.run(payload, ctx);
2029
+ }
2030
+ if (def.unionFallback) {
2031
+ return _super(payload, ctx);
2032
+ }
2033
+ payload.issues.push({
2034
+ code: "invalid_union",
2035
+ errors: [],
2036
+ note: "No matching discriminator",
2037
+ input,
2038
+ path: [def.discriminator],
2039
+ inst
2040
+ });
2041
+ return payload;
2042
+ };
2043
+ });
2044
+ var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
2045
+ $ZodType.init(inst, def);
2046
+ inst._zod.parse = (payload, ctx) => {
2047
+ const input = payload.value;
2048
+ const left = def.left._zod.run({ value: input, issues: [] }, ctx);
2049
+ const right = def.right._zod.run({ value: input, issues: [] }, ctx);
2050
+ const async = left instanceof Promise || right instanceof Promise;
2051
+ if (async) {
2052
+ return Promise.all([left, right]).then(([left2, right2]) => {
2053
+ return handleIntersectionResults(payload, left2, right2);
2054
+ });
2055
+ }
2056
+ return handleIntersectionResults(payload, left, right);
2057
+ };
2058
+ });
2059
+ function mergeValues(a, b) {
2060
+ if (a === b) {
2061
+ return { valid: true, data: a };
2062
+ }
2063
+ if (a instanceof Date && b instanceof Date && +a === +b) {
2064
+ return { valid: true, data: a };
2065
+ }
2066
+ if (isPlainObject(a) && isPlainObject(b)) {
2067
+ const bKeys = Object.keys(b);
2068
+ const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
2069
+ const newObj = { ...a, ...b };
2070
+ for (const key of sharedKeys) {
2071
+ const sharedValue = mergeValues(a[key], b[key]);
2072
+ if (!sharedValue.valid) {
2073
+ return {
2074
+ valid: false,
2075
+ mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
2076
+ };
2077
+ }
2078
+ newObj[key] = sharedValue.data;
2079
+ }
2080
+ return { valid: true, data: newObj };
2081
+ }
2082
+ if (Array.isArray(a) && Array.isArray(b)) {
2083
+ if (a.length !== b.length) {
2084
+ return { valid: false, mergeErrorPath: [] };
2085
+ }
2086
+ const newArray = [];
2087
+ for (let index = 0;index < a.length; index++) {
2088
+ const itemA = a[index];
2089
+ const itemB = b[index];
2090
+ const sharedValue = mergeValues(itemA, itemB);
2091
+ if (!sharedValue.valid) {
2092
+ return {
2093
+ valid: false,
2094
+ mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
2095
+ };
2096
+ }
2097
+ newArray.push(sharedValue.data);
2098
+ }
2099
+ return { valid: true, data: newArray };
2100
+ }
2101
+ return { valid: false, mergeErrorPath: [] };
2102
+ }
2103
+ function handleIntersectionResults(result, left, right) {
2104
+ if (left.issues.length) {
2105
+ result.issues.push(...left.issues);
2106
+ }
2107
+ if (right.issues.length) {
2108
+ result.issues.push(...right.issues);
2109
+ }
2110
+ if (aborted(result))
2111
+ return result;
2112
+ const merged = mergeValues(left.value, right.value);
2113
+ if (!merged.valid) {
2114
+ throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
2115
+ }
2116
+ result.value = merged.data;
2117
+ return result;
2118
+ }
2119
+ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
2120
+ $ZodType.init(inst, def);
2121
+ inst._zod.parse = (payload, ctx) => {
2122
+ const input = payload.value;
2123
+ if (!isPlainObject(input)) {
2124
+ payload.issues.push({
2125
+ expected: "record",
2126
+ code: "invalid_type",
2127
+ input,
2128
+ inst
2129
+ });
2130
+ return payload;
2131
+ }
2132
+ const proms = [];
2133
+ if (def.keyType._zod.values) {
2134
+ const values = def.keyType._zod.values;
2135
+ payload.value = {};
2136
+ for (const key of values) {
2137
+ if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
2138
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
2139
+ if (result instanceof Promise) {
2140
+ proms.push(result.then((result2) => {
2141
+ if (result2.issues.length) {
2142
+ payload.issues.push(...prefixIssues(key, result2.issues));
2143
+ }
2144
+ payload.value[key] = result2.value;
2145
+ }));
2146
+ } else {
2147
+ if (result.issues.length) {
2148
+ payload.issues.push(...prefixIssues(key, result.issues));
2149
+ }
2150
+ payload.value[key] = result.value;
2151
+ }
2152
+ }
2153
+ }
2154
+ let unrecognized;
2155
+ for (const key in input) {
2156
+ if (!values.has(key)) {
2157
+ unrecognized = unrecognized ?? [];
2158
+ unrecognized.push(key);
2159
+ }
2160
+ }
2161
+ if (unrecognized && unrecognized.length > 0) {
2162
+ payload.issues.push({
2163
+ code: "unrecognized_keys",
2164
+ input,
2165
+ inst,
2166
+ keys: unrecognized
2167
+ });
2168
+ }
2169
+ } else {
2170
+ payload.value = {};
2171
+ for (const key of Reflect.ownKeys(input)) {
2172
+ if (key === "__proto__")
2173
+ continue;
2174
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
2175
+ if (keyResult instanceof Promise) {
2176
+ throw new Error("Async schemas not supported in object keys currently");
2177
+ }
2178
+ if (keyResult.issues.length) {
2179
+ payload.issues.push({
2180
+ origin: "record",
2181
+ code: "invalid_key",
2182
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
2183
+ input: key,
2184
+ path: [key],
2185
+ inst
2186
+ });
2187
+ payload.value[keyResult.value] = keyResult.value;
2188
+ continue;
2189
+ }
2190
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
2191
+ if (result instanceof Promise) {
2192
+ proms.push(result.then((result2) => {
2193
+ if (result2.issues.length) {
2194
+ payload.issues.push(...prefixIssues(key, result2.issues));
2195
+ }
2196
+ payload.value[keyResult.value] = result2.value;
2197
+ }));
2198
+ } else {
2199
+ if (result.issues.length) {
2200
+ payload.issues.push(...prefixIssues(key, result.issues));
2201
+ }
2202
+ payload.value[keyResult.value] = result.value;
2203
+ }
2204
+ }
2205
+ }
2206
+ if (proms.length) {
2207
+ return Promise.all(proms).then(() => payload);
2208
+ }
2209
+ return payload;
2210
+ };
2211
+ });
2212
+ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
2213
+ $ZodType.init(inst, def);
2214
+ const values = getEnumValues(def.entries);
2215
+ inst._zod.values = new Set(values);
2216
+ inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
2217
+ inst._zod.parse = (payload, _ctx) => {
2218
+ const input = payload.value;
2219
+ if (inst._zod.values.has(input)) {
2220
+ return payload;
2221
+ }
2222
+ payload.issues.push({
2223
+ code: "invalid_value",
2224
+ values,
2225
+ input,
2226
+ inst
2227
+ });
2228
+ return payload;
2229
+ };
2230
+ });
2231
+ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
2232
+ $ZodType.init(inst, def);
2233
+ inst._zod.values = new Set(def.values);
2234
+ inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? o.toString() : String(o)).join("|")})$`);
2235
+ inst._zod.parse = (payload, _ctx) => {
2236
+ const input = payload.value;
2237
+ if (inst._zod.values.has(input)) {
2238
+ return payload;
2239
+ }
2240
+ payload.issues.push({
2241
+ code: "invalid_value",
2242
+ values: def.values,
2243
+ input,
2244
+ inst
2245
+ });
2246
+ return payload;
2247
+ };
2248
+ });
2249
+ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
2250
+ $ZodType.init(inst, def);
2251
+ inst._zod.parse = (payload, _ctx) => {
2252
+ const _out = def.transform(payload.value, payload);
2253
+ if (_ctx.async) {
2254
+ const output = _out instanceof Promise ? _out : Promise.resolve(_out);
2255
+ return output.then((output2) => {
2256
+ payload.value = output2;
2257
+ return payload;
2258
+ });
2259
+ }
2260
+ if (_out instanceof Promise) {
2261
+ throw new $ZodAsyncError;
2262
+ }
2263
+ payload.value = _out;
2264
+ return payload;
2265
+ };
2266
+ });
2267
+ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
2268
+ $ZodType.init(inst, def);
2269
+ inst._zod.optin = "optional";
2270
+ inst._zod.optout = "optional";
2271
+ defineLazy(inst._zod, "values", () => {
2272
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;
2273
+ });
2274
+ defineLazy(inst._zod, "pattern", () => {
2275
+ const pattern = def.innerType._zod.pattern;
2276
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : undefined;
2277
+ });
2278
+ inst._zod.parse = (payload, ctx) => {
2279
+ if (def.innerType._zod.optin === "optional") {
2280
+ return def.innerType._zod.run(payload, ctx);
2281
+ }
2282
+ if (payload.value === undefined) {
2283
+ return payload;
2284
+ }
2285
+ return def.innerType._zod.run(payload, ctx);
2286
+ };
2287
+ });
2288
+ var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
2289
+ $ZodType.init(inst, def);
2290
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2291
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2292
+ defineLazy(inst._zod, "pattern", () => {
2293
+ const pattern = def.innerType._zod.pattern;
2294
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : undefined;
2295
+ });
2296
+ defineLazy(inst._zod, "values", () => {
2297
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;
2298
+ });
2299
+ inst._zod.parse = (payload, ctx) => {
2300
+ if (payload.value === null)
2301
+ return payload;
2302
+ return def.innerType._zod.run(payload, ctx);
2303
+ };
2304
+ });
2305
+ var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
2306
+ $ZodType.init(inst, def);
2307
+ inst._zod.optin = "optional";
2308
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2309
+ inst._zod.parse = (payload, ctx) => {
2310
+ if (payload.value === undefined) {
2311
+ payload.value = def.defaultValue;
2312
+ return payload;
2313
+ }
2314
+ const result = def.innerType._zod.run(payload, ctx);
2315
+ if (result instanceof Promise) {
2316
+ return result.then((result2) => handleDefaultResult(result2, def));
2317
+ }
2318
+ return handleDefaultResult(result, def);
2319
+ };
2320
+ });
2321
+ function handleDefaultResult(payload, def) {
2322
+ if (payload.value === undefined) {
2323
+ payload.value = def.defaultValue;
2324
+ }
2325
+ return payload;
2326
+ }
2327
+ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
2328
+ $ZodType.init(inst, def);
2329
+ inst._zod.optin = "optional";
2330
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2331
+ inst._zod.parse = (payload, ctx) => {
2332
+ if (payload.value === undefined) {
2333
+ payload.value = def.defaultValue;
2334
+ }
2335
+ return def.innerType._zod.run(payload, ctx);
2336
+ };
2337
+ });
2338
+ var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
2339
+ $ZodType.init(inst, def);
2340
+ defineLazy(inst._zod, "values", () => {
2341
+ const v = def.innerType._zod.values;
2342
+ return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
2343
+ });
2344
+ inst._zod.parse = (payload, ctx) => {
2345
+ const result = def.innerType._zod.run(payload, ctx);
2346
+ if (result instanceof Promise) {
2347
+ return result.then((result2) => handleNonOptionalResult(result2, inst));
2348
+ }
2349
+ return handleNonOptionalResult(result, inst);
2350
+ };
2351
+ });
2352
+ function handleNonOptionalResult(payload, inst) {
2353
+ if (!payload.issues.length && payload.value === undefined) {
2354
+ payload.issues.push({
2355
+ code: "invalid_type",
2356
+ expected: "nonoptional",
2357
+ input: payload.value,
2358
+ inst
2359
+ });
2360
+ }
2361
+ return payload;
2362
+ }
2363
+ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2364
+ $ZodType.init(inst, def);
2365
+ inst._zod.optin = "optional";
2366
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2367
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2368
+ inst._zod.parse = (payload, ctx) => {
2369
+ const result = def.innerType._zod.run(payload, ctx);
2370
+ if (result instanceof Promise) {
2371
+ return result.then((result2) => {
2372
+ payload.value = result2.value;
2373
+ if (result2.issues.length) {
2374
+ payload.value = def.catchValue({
2375
+ ...payload,
2376
+ error: {
2377
+ issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
2378
+ },
2379
+ input: payload.value
2380
+ });
2381
+ payload.issues = [];
2382
+ }
2383
+ return payload;
2384
+ });
2385
+ }
2386
+ payload.value = result.value;
2387
+ if (result.issues.length) {
2388
+ payload.value = def.catchValue({
2389
+ ...payload,
2390
+ error: {
2391
+ issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
2392
+ },
2393
+ input: payload.value
2394
+ });
2395
+ payload.issues = [];
2396
+ }
2397
+ return payload;
2398
+ };
2399
+ });
2400
+ var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
2401
+ $ZodType.init(inst, def);
2402
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
2403
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2404
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
2405
+ inst._zod.parse = (payload, ctx) => {
2406
+ const left = def.in._zod.run(payload, ctx);
2407
+ if (left instanceof Promise) {
2408
+ return left.then((left2) => handlePipeResult(left2, def, ctx));
2409
+ }
2410
+ return handlePipeResult(left, def, ctx);
2411
+ };
2412
+ });
2413
+ function handlePipeResult(left, def, ctx) {
2414
+ if (aborted(left)) {
2415
+ return left;
2416
+ }
2417
+ return def.out._zod.run({ value: left.value, issues: left.issues }, ctx);
2418
+ }
2419
+ var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2420
+ $ZodType.init(inst, def);
2421
+ defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2422
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2423
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2424
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2425
+ inst._zod.parse = (payload, ctx) => {
2426
+ const result = def.innerType._zod.run(payload, ctx);
2427
+ if (result instanceof Promise) {
2428
+ return result.then(handleReadonlyResult);
2429
+ }
2430
+ return handleReadonlyResult(result);
2431
+ };
2432
+ });
2433
+ function handleReadonlyResult(payload) {
2434
+ payload.value = Object.freeze(payload.value);
2435
+ return payload;
2436
+ }
2437
+ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
2438
+ $ZodCheck.init(inst, def);
2439
+ $ZodType.init(inst, def);
2440
+ inst._zod.parse = (payload, _) => {
2441
+ return payload;
2442
+ };
2443
+ inst._zod.check = (payload) => {
2444
+ const input = payload.value;
2445
+ const r = def.fn(input);
2446
+ if (r instanceof Promise) {
2447
+ return r.then((r2) => handleRefineResult(r2, payload, input, inst));
2448
+ }
2449
+ handleRefineResult(r, payload, input, inst);
2450
+ return;
2451
+ };
2452
+ });
2453
+ function handleRefineResult(result, payload, input, inst) {
2454
+ if (!result) {
2455
+ const _iss = {
2456
+ code: "custom",
2457
+ input,
2458
+ inst,
2459
+ path: [...inst._zod.def.path ?? []],
2460
+ continue: !inst._zod.def.abort
2461
+ };
2462
+ if (inst._zod.def.params)
2463
+ _iss.params = inst._zod.def.params;
2464
+ payload.issues.push(issue(_iss));
2465
+ }
2466
+ }
2467
+ // node_modules/zod/v4/locales/en.js
2468
+ var parsedType = (data) => {
2469
+ const t = typeof data;
2470
+ switch (t) {
2471
+ case "number": {
2472
+ return Number.isNaN(data) ? "NaN" : "number";
2473
+ }
2474
+ case "object": {
2475
+ if (Array.isArray(data)) {
2476
+ return "array";
2477
+ }
2478
+ if (data === null) {
2479
+ return "null";
2480
+ }
2481
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
2482
+ return data.constructor.name;
2483
+ }
2484
+ }
2485
+ }
2486
+ return t;
2487
+ };
2488
+ var error = () => {
2489
+ const Sizable = {
2490
+ string: { unit: "characters", verb: "to have" },
2491
+ file: { unit: "bytes", verb: "to have" },
2492
+ array: { unit: "items", verb: "to have" },
2493
+ set: { unit: "items", verb: "to have" }
2494
+ };
2495
+ function getSizing(origin) {
2496
+ return Sizable[origin] ?? null;
2497
+ }
2498
+ const Nouns = {
2499
+ regex: "input",
2500
+ email: "email address",
2501
+ url: "URL",
2502
+ emoji: "emoji",
2503
+ uuid: "UUID",
2504
+ uuidv4: "UUIDv4",
2505
+ uuidv6: "UUIDv6",
2506
+ nanoid: "nanoid",
2507
+ guid: "GUID",
2508
+ cuid: "cuid",
2509
+ cuid2: "cuid2",
2510
+ ulid: "ULID",
2511
+ xid: "XID",
2512
+ ksuid: "KSUID",
2513
+ datetime: "ISO datetime",
2514
+ date: "ISO date",
2515
+ time: "ISO time",
2516
+ duration: "ISO duration",
2517
+ ipv4: "IPv4 address",
2518
+ ipv6: "IPv6 address",
2519
+ cidrv4: "IPv4 range",
2520
+ cidrv6: "IPv6 range",
2521
+ base64: "base64-encoded string",
2522
+ base64url: "base64url-encoded string",
2523
+ json_string: "JSON string",
2524
+ e164: "E.164 number",
2525
+ jwt: "JWT",
2526
+ template_literal: "input"
2527
+ };
2528
+ return (issue2) => {
2529
+ switch (issue2.code) {
2530
+ case "invalid_type":
2531
+ return `Invalid input: expected ${issue2.expected}, received ${parsedType(issue2.input)}`;
2532
+ case "invalid_value":
2533
+ if (issue2.values.length === 1)
2534
+ return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`;
2535
+ return `Invalid option: expected one of ${joinValues(issue2.values, "|")}`;
2536
+ case "too_big": {
2537
+ const adj = issue2.inclusive ? "<=" : "<";
2538
+ const sizing = getSizing(issue2.origin);
2539
+ if (sizing)
2540
+ return `Too big: expected ${issue2.origin ?? "value"} to have ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`;
2541
+ return `Too big: expected ${issue2.origin ?? "value"} to be ${adj}${issue2.maximum.toString()}`;
2542
+ }
2543
+ case "too_small": {
2544
+ const adj = issue2.inclusive ? ">=" : ">";
2545
+ const sizing = getSizing(issue2.origin);
2546
+ if (sizing) {
2547
+ return `Too small: expected ${issue2.origin} to have ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
2548
+ }
2549
+ return `Too small: expected ${issue2.origin} to be ${adj}${issue2.minimum.toString()}`;
2550
+ }
2551
+ case "invalid_format": {
2552
+ const _issue = issue2;
2553
+ if (_issue.format === "starts_with") {
2554
+ return `Invalid string: must start with "${_issue.prefix}"`;
2555
+ }
2556
+ if (_issue.format === "ends_with")
2557
+ return `Invalid string: must end with "${_issue.suffix}"`;
2558
+ if (_issue.format === "includes")
2559
+ return `Invalid string: must include "${_issue.includes}"`;
2560
+ if (_issue.format === "regex")
2561
+ return `Invalid string: must match pattern ${_issue.pattern}`;
2562
+ return `Invalid ${Nouns[_issue.format] ?? issue2.format}`;
2563
+ }
2564
+ case "not_multiple_of":
2565
+ return `Invalid number: must be a multiple of ${issue2.divisor}`;
2566
+ case "unrecognized_keys":
2567
+ return `Unrecognized key${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
2568
+ case "invalid_key":
2569
+ return `Invalid key in ${issue2.origin}`;
2570
+ case "invalid_union":
2571
+ return "Invalid input";
2572
+ case "invalid_element":
2573
+ return `Invalid value in ${issue2.origin}`;
2574
+ default:
2575
+ return `Invalid input`;
2576
+ }
2577
+ };
2578
+ };
2579
+ function en_default() {
2580
+ return {
2581
+ localeError: error()
2582
+ };
2583
+ }
2584
+ // node_modules/zod/v4/core/registries.js
2585
+ var $output = Symbol("ZodOutput");
2586
+ var $input = Symbol("ZodInput");
2587
+
2588
+ class $ZodRegistry {
2589
+ constructor() {
2590
+ this._map = new Map;
2591
+ this._idmap = new Map;
2592
+ }
2593
+ add(schema, ..._meta) {
2594
+ const meta = _meta[0];
2595
+ this._map.set(schema, meta);
2596
+ if (meta && typeof meta === "object" && "id" in meta) {
2597
+ if (this._idmap.has(meta.id)) {
2598
+ throw new Error(`ID ${meta.id} already exists in the registry`);
2599
+ }
2600
+ this._idmap.set(meta.id, schema);
2601
+ }
2602
+ return this;
2603
+ }
2604
+ clear() {
2605
+ this._map = new Map;
2606
+ this._idmap = new Map;
2607
+ return this;
2608
+ }
2609
+ remove(schema) {
2610
+ const meta = this._map.get(schema);
2611
+ if (meta && typeof meta === "object" && "id" in meta) {
2612
+ this._idmap.delete(meta.id);
2613
+ }
2614
+ this._map.delete(schema);
2615
+ return this;
2616
+ }
2617
+ get(schema) {
2618
+ const p = schema._zod.parent;
2619
+ if (p) {
2620
+ const pm = { ...this.get(p) ?? {} };
2621
+ delete pm.id;
2622
+ return { ...pm, ...this._map.get(schema) };
2623
+ }
2624
+ return this._map.get(schema);
2625
+ }
2626
+ has(schema) {
2627
+ return this._map.has(schema);
2628
+ }
2629
+ }
2630
+ function registry() {
2631
+ return new $ZodRegistry;
2632
+ }
2633
+ var globalRegistry = /* @__PURE__ */ registry();
2634
+ // node_modules/zod/v4/core/api.js
2635
+ function _string(Class2, params) {
2636
+ return new Class2({
2637
+ type: "string",
2638
+ ...normalizeParams(params)
2639
+ });
2640
+ }
2641
+ function _coercedString(Class2, params) {
2642
+ return new Class2({
2643
+ type: "string",
2644
+ coerce: true,
2645
+ ...normalizeParams(params)
2646
+ });
2647
+ }
2648
+ function _email(Class2, params) {
2649
+ return new Class2({
2650
+ type: "string",
2651
+ format: "email",
2652
+ check: "string_format",
2653
+ abort: false,
2654
+ ...normalizeParams(params)
2655
+ });
2656
+ }
2657
+ function _guid(Class2, params) {
2658
+ return new Class2({
2659
+ type: "string",
2660
+ format: "guid",
2661
+ check: "string_format",
2662
+ abort: false,
2663
+ ...normalizeParams(params)
2664
+ });
2665
+ }
2666
+ function _uuid(Class2, params) {
2667
+ return new Class2({
2668
+ type: "string",
2669
+ format: "uuid",
2670
+ check: "string_format",
2671
+ abort: false,
2672
+ ...normalizeParams(params)
2673
+ });
2674
+ }
2675
+ function _uuidv4(Class2, params) {
2676
+ return new Class2({
2677
+ type: "string",
2678
+ format: "uuid",
2679
+ check: "string_format",
2680
+ abort: false,
2681
+ version: "v4",
2682
+ ...normalizeParams(params)
2683
+ });
2684
+ }
2685
+ function _uuidv6(Class2, params) {
2686
+ return new Class2({
2687
+ type: "string",
2688
+ format: "uuid",
2689
+ check: "string_format",
2690
+ abort: false,
2691
+ version: "v6",
2692
+ ...normalizeParams(params)
2693
+ });
2694
+ }
2695
+ function _uuidv7(Class2, params) {
2696
+ return new Class2({
2697
+ type: "string",
2698
+ format: "uuid",
2699
+ check: "string_format",
2700
+ abort: false,
2701
+ version: "v7",
2702
+ ...normalizeParams(params)
2703
+ });
2704
+ }
2705
+ function _url(Class2, params) {
2706
+ return new Class2({
2707
+ type: "string",
2708
+ format: "url",
2709
+ check: "string_format",
2710
+ abort: false,
2711
+ ...normalizeParams(params)
2712
+ });
2713
+ }
2714
+ function _emoji2(Class2, params) {
2715
+ return new Class2({
2716
+ type: "string",
2717
+ format: "emoji",
2718
+ check: "string_format",
2719
+ abort: false,
2720
+ ...normalizeParams(params)
2721
+ });
2722
+ }
2723
+ function _nanoid(Class2, params) {
2724
+ return new Class2({
2725
+ type: "string",
2726
+ format: "nanoid",
2727
+ check: "string_format",
2728
+ abort: false,
2729
+ ...normalizeParams(params)
2730
+ });
2731
+ }
2732
+ function _cuid(Class2, params) {
2733
+ return new Class2({
2734
+ type: "string",
2735
+ format: "cuid",
2736
+ check: "string_format",
2737
+ abort: false,
2738
+ ...normalizeParams(params)
2739
+ });
2740
+ }
2741
+ function _cuid2(Class2, params) {
2742
+ return new Class2({
2743
+ type: "string",
2744
+ format: "cuid2",
2745
+ check: "string_format",
2746
+ abort: false,
2747
+ ...normalizeParams(params)
2748
+ });
2749
+ }
2750
+ function _ulid(Class2, params) {
2751
+ return new Class2({
2752
+ type: "string",
2753
+ format: "ulid",
2754
+ check: "string_format",
2755
+ abort: false,
2756
+ ...normalizeParams(params)
2757
+ });
2758
+ }
2759
+ function _xid(Class2, params) {
2760
+ return new Class2({
2761
+ type: "string",
2762
+ format: "xid",
2763
+ check: "string_format",
2764
+ abort: false,
2765
+ ...normalizeParams(params)
2766
+ });
2767
+ }
2768
+ function _ksuid(Class2, params) {
2769
+ return new Class2({
2770
+ type: "string",
2771
+ format: "ksuid",
2772
+ check: "string_format",
2773
+ abort: false,
2774
+ ...normalizeParams(params)
2775
+ });
2776
+ }
2777
+ function _ipv4(Class2, params) {
2778
+ return new Class2({
2779
+ type: "string",
2780
+ format: "ipv4",
2781
+ check: "string_format",
2782
+ abort: false,
2783
+ ...normalizeParams(params)
2784
+ });
2785
+ }
2786
+ function _ipv6(Class2, params) {
2787
+ return new Class2({
2788
+ type: "string",
2789
+ format: "ipv6",
2790
+ check: "string_format",
2791
+ abort: false,
2792
+ ...normalizeParams(params)
2793
+ });
2794
+ }
2795
+ function _cidrv4(Class2, params) {
2796
+ return new Class2({
2797
+ type: "string",
2798
+ format: "cidrv4",
2799
+ check: "string_format",
2800
+ abort: false,
2801
+ ...normalizeParams(params)
2802
+ });
2803
+ }
2804
+ function _cidrv6(Class2, params) {
2805
+ return new Class2({
2806
+ type: "string",
2807
+ format: "cidrv6",
2808
+ check: "string_format",
2809
+ abort: false,
2810
+ ...normalizeParams(params)
2811
+ });
2812
+ }
2813
+ function _base64(Class2, params) {
2814
+ return new Class2({
2815
+ type: "string",
2816
+ format: "base64",
2817
+ check: "string_format",
2818
+ abort: false,
2819
+ ...normalizeParams(params)
2820
+ });
2821
+ }
2822
+ function _base64url(Class2, params) {
2823
+ return new Class2({
2824
+ type: "string",
2825
+ format: "base64url",
2826
+ check: "string_format",
2827
+ abort: false,
2828
+ ...normalizeParams(params)
2829
+ });
2830
+ }
2831
+ function _e164(Class2, params) {
2832
+ return new Class2({
2833
+ type: "string",
2834
+ format: "e164",
2835
+ check: "string_format",
2836
+ abort: false,
2837
+ ...normalizeParams(params)
2838
+ });
2839
+ }
2840
+ function _jwt(Class2, params) {
2841
+ return new Class2({
2842
+ type: "string",
2843
+ format: "jwt",
2844
+ check: "string_format",
2845
+ abort: false,
2846
+ ...normalizeParams(params)
2847
+ });
2848
+ }
2849
+ function _isoDateTime(Class2, params) {
2850
+ return new Class2({
2851
+ type: "string",
2852
+ format: "datetime",
2853
+ check: "string_format",
2854
+ offset: false,
2855
+ local: false,
2856
+ precision: null,
2857
+ ...normalizeParams(params)
2858
+ });
2859
+ }
2860
+ function _isoDate(Class2, params) {
2861
+ return new Class2({
2862
+ type: "string",
2863
+ format: "date",
2864
+ check: "string_format",
2865
+ ...normalizeParams(params)
2866
+ });
2867
+ }
2868
+ function _isoTime(Class2, params) {
2869
+ return new Class2({
2870
+ type: "string",
2871
+ format: "time",
2872
+ check: "string_format",
2873
+ precision: null,
2874
+ ...normalizeParams(params)
2875
+ });
2876
+ }
2877
+ function _isoDuration(Class2, params) {
2878
+ return new Class2({
2879
+ type: "string",
2880
+ format: "duration",
2881
+ check: "string_format",
2882
+ ...normalizeParams(params)
2883
+ });
2884
+ }
2885
+ function _number(Class2, params) {
2886
+ return new Class2({
2887
+ type: "number",
2888
+ checks: [],
2889
+ ...normalizeParams(params)
2890
+ });
2891
+ }
2892
+ function _coercedNumber(Class2, params) {
2893
+ return new Class2({
2894
+ type: "number",
2895
+ coerce: true,
2896
+ checks: [],
2897
+ ...normalizeParams(params)
2898
+ });
2899
+ }
2900
+ function _int(Class2, params) {
2901
+ return new Class2({
2902
+ type: "number",
2903
+ check: "number_format",
2904
+ abort: false,
2905
+ format: "safeint",
2906
+ ...normalizeParams(params)
2907
+ });
2908
+ }
2909
+ function _boolean(Class2, params) {
2910
+ return new Class2({
2911
+ type: "boolean",
2912
+ ...normalizeParams(params)
2913
+ });
2914
+ }
2915
+ function _coercedBoolean(Class2, params) {
2916
+ return new Class2({
2917
+ type: "boolean",
2918
+ coerce: true,
2919
+ ...normalizeParams(params)
2920
+ });
2921
+ }
2922
+ function _coercedBigint(Class2, params) {
2923
+ return new Class2({
2924
+ type: "bigint",
2925
+ coerce: true,
2926
+ ...normalizeParams(params)
2927
+ });
2928
+ }
2929
+ function _null2(Class2, params) {
2930
+ return new Class2({
2931
+ type: "null",
2932
+ ...normalizeParams(params)
2933
+ });
2934
+ }
2935
+ function _any(Class2) {
2936
+ return new Class2({
2937
+ type: "any"
2938
+ });
2939
+ }
2940
+ function _unknown(Class2) {
2941
+ return new Class2({
2942
+ type: "unknown"
2943
+ });
2944
+ }
2945
+ function _never(Class2, params) {
2946
+ return new Class2({
2947
+ type: "never",
2948
+ ...normalizeParams(params)
2949
+ });
2950
+ }
2951
+ function _coercedDate(Class2, params) {
2952
+ return new Class2({
2953
+ type: "date",
2954
+ coerce: true,
2955
+ ...normalizeParams(params)
2956
+ });
2957
+ }
2958
+ function _lt(value, params) {
2959
+ return new $ZodCheckLessThan({
2960
+ check: "less_than",
2961
+ ...normalizeParams(params),
2962
+ value,
2963
+ inclusive: false
2964
+ });
2965
+ }
2966
+ function _lte(value, params) {
2967
+ return new $ZodCheckLessThan({
2968
+ check: "less_than",
2969
+ ...normalizeParams(params),
2970
+ value,
2971
+ inclusive: true
2972
+ });
2973
+ }
2974
+ function _gt(value, params) {
2975
+ return new $ZodCheckGreaterThan({
2976
+ check: "greater_than",
2977
+ ...normalizeParams(params),
2978
+ value,
2979
+ inclusive: false
2980
+ });
2981
+ }
2982
+ function _gte(value, params) {
2983
+ return new $ZodCheckGreaterThan({
2984
+ check: "greater_than",
2985
+ ...normalizeParams(params),
2986
+ value,
2987
+ inclusive: true
2988
+ });
2989
+ }
2990
+ function _multipleOf(value, params) {
2991
+ return new $ZodCheckMultipleOf({
2992
+ check: "multiple_of",
2993
+ ...normalizeParams(params),
2994
+ value
2995
+ });
2996
+ }
2997
+ function _maxLength(maximum, params) {
2998
+ const ch = new $ZodCheckMaxLength({
2999
+ check: "max_length",
3000
+ ...normalizeParams(params),
3001
+ maximum
3002
+ });
3003
+ return ch;
3004
+ }
3005
+ function _minLength(minimum, params) {
3006
+ return new $ZodCheckMinLength({
3007
+ check: "min_length",
3008
+ ...normalizeParams(params),
3009
+ minimum
3010
+ });
3011
+ }
3012
+ function _length(length, params) {
3013
+ return new $ZodCheckLengthEquals({
3014
+ check: "length_equals",
3015
+ ...normalizeParams(params),
3016
+ length
3017
+ });
3018
+ }
3019
+ function _regex(pattern, params) {
3020
+ return new $ZodCheckRegex({
3021
+ check: "string_format",
3022
+ format: "regex",
3023
+ ...normalizeParams(params),
3024
+ pattern
3025
+ });
3026
+ }
3027
+ function _lowercase(params) {
3028
+ return new $ZodCheckLowerCase({
3029
+ check: "string_format",
3030
+ format: "lowercase",
3031
+ ...normalizeParams(params)
3032
+ });
3033
+ }
3034
+ function _uppercase(params) {
3035
+ return new $ZodCheckUpperCase({
3036
+ check: "string_format",
3037
+ format: "uppercase",
3038
+ ...normalizeParams(params)
3039
+ });
3040
+ }
3041
+ function _includes(includes, params) {
3042
+ return new $ZodCheckIncludes({
3043
+ check: "string_format",
3044
+ format: "includes",
3045
+ ...normalizeParams(params),
3046
+ includes
3047
+ });
3048
+ }
3049
+ function _startsWith(prefix, params) {
3050
+ return new $ZodCheckStartsWith({
3051
+ check: "string_format",
3052
+ format: "starts_with",
3053
+ ...normalizeParams(params),
3054
+ prefix
3055
+ });
3056
+ }
3057
+ function _endsWith(suffix, params) {
3058
+ return new $ZodCheckEndsWith({
3059
+ check: "string_format",
3060
+ format: "ends_with",
3061
+ ...normalizeParams(params),
3062
+ suffix
3063
+ });
3064
+ }
3065
+ function _overwrite(tx) {
3066
+ return new $ZodCheckOverwrite({
3067
+ check: "overwrite",
3068
+ tx
3069
+ });
3070
+ }
3071
+ function _normalize(form) {
3072
+ return _overwrite((input) => input.normalize(form));
3073
+ }
3074
+ function _trim() {
3075
+ return _overwrite((input) => input.trim());
3076
+ }
3077
+ function _toLowerCase() {
3078
+ return _overwrite((input) => input.toLowerCase());
3079
+ }
3080
+ function _toUpperCase() {
3081
+ return _overwrite((input) => input.toUpperCase());
3082
+ }
3083
+ function _array(Class2, element, params) {
3084
+ return new Class2({
3085
+ type: "array",
3086
+ element,
3087
+ ...normalizeParams(params)
3088
+ });
3089
+ }
3090
+ function _custom(Class2, fn, _params) {
3091
+ const norm = normalizeParams(_params);
3092
+ norm.abort ?? (norm.abort = true);
3093
+ const schema = new Class2({
3094
+ type: "custom",
3095
+ check: "custom",
3096
+ fn,
3097
+ ...norm
3098
+ });
3099
+ return schema;
3100
+ }
3101
+ function _refine(Class2, fn, _params) {
3102
+ const schema = new Class2({
3103
+ type: "custom",
3104
+ check: "custom",
3105
+ fn,
3106
+ ...normalizeParams(_params)
3107
+ });
3108
+ return schema;
3109
+ }
3110
+ // node_modules/zod/v4/classic/iso.js
3111
+ var exports_iso = {};
3112
+ __export(exports_iso, {
3113
+ time: () => time2,
3114
+ duration: () => duration2,
3115
+ datetime: () => datetime2,
3116
+ date: () => date2,
3117
+ ZodISOTime: () => ZodISOTime,
3118
+ ZodISODuration: () => ZodISODuration,
3119
+ ZodISODateTime: () => ZodISODateTime,
3120
+ ZodISODate: () => ZodISODate
3121
+ });
3122
+ var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
3123
+ $ZodISODateTime.init(inst, def);
3124
+ ZodStringFormat.init(inst, def);
3125
+ });
3126
+ function datetime2(params) {
3127
+ return _isoDateTime(ZodISODateTime, params);
3128
+ }
3129
+ var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
3130
+ $ZodISODate.init(inst, def);
3131
+ ZodStringFormat.init(inst, def);
3132
+ });
3133
+ function date2(params) {
3134
+ return _isoDate(ZodISODate, params);
3135
+ }
3136
+ var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
3137
+ $ZodISOTime.init(inst, def);
3138
+ ZodStringFormat.init(inst, def);
3139
+ });
3140
+ function time2(params) {
3141
+ return _isoTime(ZodISOTime, params);
3142
+ }
3143
+ var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
3144
+ $ZodISODuration.init(inst, def);
3145
+ ZodStringFormat.init(inst, def);
3146
+ });
3147
+ function duration2(params) {
3148
+ return _isoDuration(ZodISODuration, params);
3149
+ }
3150
+
3151
+ // node_modules/zod/v4/classic/errors.js
3152
+ var initializer2 = (inst, issues) => {
3153
+ $ZodError.init(inst, issues);
3154
+ inst.name = "ZodError";
3155
+ Object.defineProperties(inst, {
3156
+ format: {
3157
+ value: (mapper) => formatError(inst, mapper)
3158
+ },
3159
+ flatten: {
3160
+ value: (mapper) => flattenError(inst, mapper)
3161
+ },
3162
+ addIssue: {
3163
+ value: (issue2) => inst.issues.push(issue2)
3164
+ },
3165
+ addIssues: {
3166
+ value: (issues2) => inst.issues.push(...issues2)
3167
+ },
3168
+ isEmpty: {
3169
+ get() {
3170
+ return inst.issues.length === 0;
3171
+ }
3172
+ }
3173
+ });
3174
+ };
3175
+ var ZodError = $constructor("ZodError", initializer2);
3176
+ var ZodRealError = $constructor("ZodError", initializer2, {
3177
+ Parent: Error
3178
+ });
3179
+
3180
+ // node_modules/zod/v4/classic/parse.js
3181
+ var parse2 = /* @__PURE__ */ _parse(ZodRealError);
3182
+ var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3183
+ var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
3184
+ var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
3185
+
3186
+ // node_modules/zod/v4/classic/schemas.js
3187
+ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3188
+ $ZodType.init(inst, def);
3189
+ inst.def = def;
3190
+ Object.defineProperty(inst, "_def", { value: def });
3191
+ inst.check = (...checks2) => {
3192
+ return inst.clone({
3193
+ ...def,
3194
+ checks: [
3195
+ ...def.checks ?? [],
3196
+ ...checks2.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
3197
+ ]
3198
+ });
3199
+ };
3200
+ inst.clone = (def2, params) => clone(inst, def2, params);
3201
+ inst.brand = () => inst;
3202
+ inst.register = (reg, meta) => {
3203
+ reg.add(inst, meta);
3204
+ return inst;
3205
+ };
3206
+ inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
3207
+ inst.safeParse = (data, params) => safeParse2(inst, data, params);
3208
+ inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
3209
+ inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
3210
+ inst.spa = inst.safeParseAsync;
3211
+ inst.refine = (check, params) => inst.check(refine(check, params));
3212
+ inst.superRefine = (refinement) => inst.check(superRefine(refinement));
3213
+ inst.overwrite = (fn) => inst.check(_overwrite(fn));
3214
+ inst.optional = () => optional(inst);
3215
+ inst.nullable = () => nullable(inst);
3216
+ inst.nullish = () => optional(nullable(inst));
3217
+ inst.nonoptional = (params) => nonoptional(inst, params);
3218
+ inst.array = () => array(inst);
3219
+ inst.or = (arg) => union([inst, arg]);
3220
+ inst.and = (arg) => intersection(inst, arg);
3221
+ inst.transform = (tx) => pipe(inst, transform(tx));
3222
+ inst.default = (def2) => _default(inst, def2);
3223
+ inst.prefault = (def2) => prefault(inst, def2);
3224
+ inst.catch = (params) => _catch(inst, params);
3225
+ inst.pipe = (target) => pipe(inst, target);
3226
+ inst.readonly = () => readonly(inst);
3227
+ inst.describe = (description) => {
3228
+ const cl = inst.clone();
3229
+ globalRegistry.add(cl, { description });
3230
+ return cl;
3231
+ };
3232
+ Object.defineProperty(inst, "description", {
3233
+ get() {
3234
+ return globalRegistry.get(inst)?.description;
3235
+ },
3236
+ configurable: true
3237
+ });
3238
+ inst.meta = (...args) => {
3239
+ if (args.length === 0) {
3240
+ return globalRegistry.get(inst);
3241
+ }
3242
+ const cl = inst.clone();
3243
+ globalRegistry.add(cl, args[0]);
3244
+ return cl;
3245
+ };
3246
+ inst.isOptional = () => inst.safeParse(undefined).success;
3247
+ inst.isNullable = () => inst.safeParse(null).success;
3248
+ return inst;
3249
+ });
3250
+ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
3251
+ $ZodString.init(inst, def);
3252
+ ZodType.init(inst, def);
3253
+ const bag = inst._zod.bag;
3254
+ inst.format = bag.format ?? null;
3255
+ inst.minLength = bag.minimum ?? null;
3256
+ inst.maxLength = bag.maximum ?? null;
3257
+ inst.regex = (...args) => inst.check(_regex(...args));
3258
+ inst.includes = (...args) => inst.check(_includes(...args));
3259
+ inst.startsWith = (...args) => inst.check(_startsWith(...args));
3260
+ inst.endsWith = (...args) => inst.check(_endsWith(...args));
3261
+ inst.min = (...args) => inst.check(_minLength(...args));
3262
+ inst.max = (...args) => inst.check(_maxLength(...args));
3263
+ inst.length = (...args) => inst.check(_length(...args));
3264
+ inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
3265
+ inst.lowercase = (params) => inst.check(_lowercase(params));
3266
+ inst.uppercase = (params) => inst.check(_uppercase(params));
3267
+ inst.trim = () => inst.check(_trim());
3268
+ inst.normalize = (...args) => inst.check(_normalize(...args));
3269
+ inst.toLowerCase = () => inst.check(_toLowerCase());
3270
+ inst.toUpperCase = () => inst.check(_toUpperCase());
3271
+ });
3272
+ var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
3273
+ $ZodString.init(inst, def);
3274
+ _ZodString.init(inst, def);
3275
+ inst.email = (params) => inst.check(_email(ZodEmail, params));
3276
+ inst.url = (params) => inst.check(_url(ZodURL, params));
3277
+ inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
3278
+ inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params));
3279
+ inst.guid = (params) => inst.check(_guid(ZodGUID, params));
3280
+ inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
3281
+ inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
3282
+ inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
3283
+ inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
3284
+ inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
3285
+ inst.guid = (params) => inst.check(_guid(ZodGUID, params));
3286
+ inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
3287
+ inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
3288
+ inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
3289
+ inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
3290
+ inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
3291
+ inst.xid = (params) => inst.check(_xid(ZodXID, params));
3292
+ inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
3293
+ inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
3294
+ inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
3295
+ inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
3296
+ inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
3297
+ inst.e164 = (params) => inst.check(_e164(ZodE164, params));
3298
+ inst.datetime = (params) => inst.check(datetime2(params));
3299
+ inst.date = (params) => inst.check(date2(params));
3300
+ inst.time = (params) => inst.check(time2(params));
3301
+ inst.duration = (params) => inst.check(duration2(params));
3302
+ });
3303
+ function string2(params) {
3304
+ return _string(ZodString, params);
3305
+ }
3306
+ var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
3307
+ $ZodStringFormat.init(inst, def);
3308
+ _ZodString.init(inst, def);
3309
+ });
3310
+ var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
3311
+ $ZodEmail.init(inst, def);
3312
+ ZodStringFormat.init(inst, def);
3313
+ });
3314
+ var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
3315
+ $ZodGUID.init(inst, def);
3316
+ ZodStringFormat.init(inst, def);
3317
+ });
3318
+ var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
3319
+ $ZodUUID.init(inst, def);
3320
+ ZodStringFormat.init(inst, def);
3321
+ });
3322
+ var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
3323
+ $ZodURL.init(inst, def);
3324
+ ZodStringFormat.init(inst, def);
3325
+ });
3326
+ function url(params) {
3327
+ return _url(ZodURL, params);
3328
+ }
3329
+ var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
3330
+ $ZodEmoji.init(inst, def);
3331
+ ZodStringFormat.init(inst, def);
3332
+ });
3333
+ var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
3334
+ $ZodNanoID.init(inst, def);
3335
+ ZodStringFormat.init(inst, def);
3336
+ });
3337
+ var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
3338
+ $ZodCUID.init(inst, def);
3339
+ ZodStringFormat.init(inst, def);
3340
+ });
3341
+ var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
3342
+ $ZodCUID2.init(inst, def);
3343
+ ZodStringFormat.init(inst, def);
3344
+ });
3345
+ var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
3346
+ $ZodULID.init(inst, def);
3347
+ ZodStringFormat.init(inst, def);
3348
+ });
3349
+ var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
3350
+ $ZodXID.init(inst, def);
3351
+ ZodStringFormat.init(inst, def);
3352
+ });
3353
+ var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
3354
+ $ZodKSUID.init(inst, def);
3355
+ ZodStringFormat.init(inst, def);
3356
+ });
3357
+ var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
3358
+ $ZodIPv4.init(inst, def);
3359
+ ZodStringFormat.init(inst, def);
3360
+ });
3361
+ var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
3362
+ $ZodIPv6.init(inst, def);
3363
+ ZodStringFormat.init(inst, def);
3364
+ });
3365
+ var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
3366
+ $ZodCIDRv4.init(inst, def);
3367
+ ZodStringFormat.init(inst, def);
3368
+ });
3369
+ var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
3370
+ $ZodCIDRv6.init(inst, def);
3371
+ ZodStringFormat.init(inst, def);
3372
+ });
3373
+ var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
3374
+ $ZodBase64.init(inst, def);
3375
+ ZodStringFormat.init(inst, def);
3376
+ });
3377
+ var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
3378
+ $ZodBase64URL.init(inst, def);
3379
+ ZodStringFormat.init(inst, def);
3380
+ });
3381
+ var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
3382
+ $ZodE164.init(inst, def);
3383
+ ZodStringFormat.init(inst, def);
3384
+ });
3385
+ var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
3386
+ $ZodJWT.init(inst, def);
3387
+ ZodStringFormat.init(inst, def);
3388
+ });
3389
+ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
3390
+ $ZodNumber.init(inst, def);
3391
+ ZodType.init(inst, def);
3392
+ inst.gt = (value, params) => inst.check(_gt(value, params));
3393
+ inst.gte = (value, params) => inst.check(_gte(value, params));
3394
+ inst.min = (value, params) => inst.check(_gte(value, params));
3395
+ inst.lt = (value, params) => inst.check(_lt(value, params));
3396
+ inst.lte = (value, params) => inst.check(_lte(value, params));
3397
+ inst.max = (value, params) => inst.check(_lte(value, params));
3398
+ inst.int = (params) => inst.check(int(params));
3399
+ inst.safe = (params) => inst.check(int(params));
3400
+ inst.positive = (params) => inst.check(_gt(0, params));
3401
+ inst.nonnegative = (params) => inst.check(_gte(0, params));
3402
+ inst.negative = (params) => inst.check(_lt(0, params));
3403
+ inst.nonpositive = (params) => inst.check(_lte(0, params));
3404
+ inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
3405
+ inst.step = (value, params) => inst.check(_multipleOf(value, params));
3406
+ inst.finite = () => inst;
3407
+ const bag = inst._zod.bag;
3408
+ inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
3409
+ inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
3410
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
3411
+ inst.isFinite = true;
3412
+ inst.format = bag.format ?? null;
3413
+ });
3414
+ function number2(params) {
3415
+ return _number(ZodNumber, params);
3416
+ }
3417
+ var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
3418
+ $ZodNumberFormat.init(inst, def);
3419
+ ZodNumber.init(inst, def);
3420
+ });
3421
+ function int(params) {
3422
+ return _int(ZodNumberFormat, params);
3423
+ }
3424
+ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
3425
+ $ZodBoolean.init(inst, def);
3426
+ ZodType.init(inst, def);
3427
+ });
3428
+ function boolean2(params) {
3429
+ return _boolean(ZodBoolean, params);
3430
+ }
3431
+ var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
3432
+ $ZodBigInt.init(inst, def);
3433
+ ZodType.init(inst, def);
3434
+ inst.gte = (value, params) => inst.check(_gte(value, params));
3435
+ inst.min = (value, params) => inst.check(_gte(value, params));
3436
+ inst.gt = (value, params) => inst.check(_gt(value, params));
3437
+ inst.gte = (value, params) => inst.check(_gte(value, params));
3438
+ inst.min = (value, params) => inst.check(_gte(value, params));
3439
+ inst.lt = (value, params) => inst.check(_lt(value, params));
3440
+ inst.lte = (value, params) => inst.check(_lte(value, params));
3441
+ inst.max = (value, params) => inst.check(_lte(value, params));
3442
+ inst.positive = (params) => inst.check(_gt(BigInt(0), params));
3443
+ inst.negative = (params) => inst.check(_lt(BigInt(0), params));
3444
+ inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
3445
+ inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
3446
+ inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
3447
+ const bag = inst._zod.bag;
3448
+ inst.minValue = bag.minimum ?? null;
3449
+ inst.maxValue = bag.maximum ?? null;
3450
+ inst.format = bag.format ?? null;
3451
+ });
3452
+ var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
3453
+ $ZodNull.init(inst, def);
3454
+ ZodType.init(inst, def);
3455
+ });
3456
+ function _null3(params) {
3457
+ return _null2(ZodNull, params);
3458
+ }
3459
+ var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
3460
+ $ZodAny.init(inst, def);
3461
+ ZodType.init(inst, def);
3462
+ });
3463
+ function any() {
3464
+ return _any(ZodAny);
3465
+ }
3466
+ var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
3467
+ $ZodUnknown.init(inst, def);
3468
+ ZodType.init(inst, def);
3469
+ });
3470
+ function unknown() {
3471
+ return _unknown(ZodUnknown);
3472
+ }
3473
+ var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
3474
+ $ZodNever.init(inst, def);
3475
+ ZodType.init(inst, def);
3476
+ });
3477
+ function never(params) {
3478
+ return _never(ZodNever, params);
3479
+ }
3480
+ var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
3481
+ $ZodDate.init(inst, def);
3482
+ ZodType.init(inst, def);
3483
+ inst.min = (value, params) => inst.check(_gte(value, params));
3484
+ inst.max = (value, params) => inst.check(_lte(value, params));
3485
+ const c = inst._zod.bag;
3486
+ inst.minDate = c.minimum ? new Date(c.minimum) : null;
3487
+ inst.maxDate = c.maximum ? new Date(c.maximum) : null;
3488
+ });
3489
+ var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
3490
+ $ZodArray.init(inst, def);
3491
+ ZodType.init(inst, def);
3492
+ inst.element = def.element;
3493
+ inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
3494
+ inst.nonempty = (params) => inst.check(_minLength(1, params));
3495
+ inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
3496
+ inst.length = (len, params) => inst.check(_length(len, params));
3497
+ inst.unwrap = () => inst.element;
3498
+ });
3499
+ function array(element, params) {
3500
+ return _array(ZodArray, element, params);
3501
+ }
3502
+ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
3503
+ $ZodObject.init(inst, def);
3504
+ ZodType.init(inst, def);
3505
+ exports_util.defineLazy(inst, "shape", () => def.shape);
3506
+ inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
3507
+ inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
3508
+ inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
3509
+ inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
3510
+ inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
3511
+ inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
3512
+ inst.extend = (incoming) => {
3513
+ return exports_util.extend(inst, incoming);
3514
+ };
3515
+ inst.merge = (other) => exports_util.merge(inst, other);
3516
+ inst.pick = (mask) => exports_util.pick(inst, mask);
3517
+ inst.omit = (mask) => exports_util.omit(inst, mask);
3518
+ inst.partial = (...args) => exports_util.partial(ZodOptional, inst, args[0]);
3519
+ inst.required = (...args) => exports_util.required(ZodNonOptional, inst, args[0]);
3520
+ });
3521
+ function object(shape, params) {
3522
+ const def = {
3523
+ type: "object",
3524
+ get shape() {
3525
+ exports_util.assignProp(this, "shape", { ...shape });
3526
+ return this.shape;
3527
+ },
3528
+ ...exports_util.normalizeParams(params)
3529
+ };
3530
+ return new ZodObject(def);
3531
+ }
3532
+ function looseObject(shape, params) {
3533
+ return new ZodObject({
3534
+ type: "object",
3535
+ get shape() {
3536
+ exports_util.assignProp(this, "shape", { ...shape });
3537
+ return this.shape;
3538
+ },
3539
+ catchall: unknown(),
3540
+ ...exports_util.normalizeParams(params)
3541
+ });
3542
+ }
3543
+ var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
3544
+ $ZodUnion.init(inst, def);
3545
+ ZodType.init(inst, def);
3546
+ inst.options = def.options;
3547
+ });
3548
+ function union(options, params) {
3549
+ return new ZodUnion({
3550
+ type: "union",
3551
+ options,
3552
+ ...exports_util.normalizeParams(params)
3553
+ });
3554
+ }
3555
+ var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
3556
+ ZodUnion.init(inst, def);
3557
+ $ZodDiscriminatedUnion.init(inst, def);
3558
+ });
3559
+ function discriminatedUnion(discriminator, options, params) {
3560
+ return new ZodDiscriminatedUnion({
3561
+ type: "union",
3562
+ options,
3563
+ discriminator,
3564
+ ...exports_util.normalizeParams(params)
3565
+ });
3566
+ }
3567
+ var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
3568
+ $ZodIntersection.init(inst, def);
3569
+ ZodType.init(inst, def);
3570
+ });
3571
+ function intersection(left, right) {
3572
+ return new ZodIntersection({
3573
+ type: "intersection",
3574
+ left,
3575
+ right
3576
+ });
3577
+ }
3578
+ var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
3579
+ $ZodRecord.init(inst, def);
3580
+ ZodType.init(inst, def);
3581
+ inst.keyType = def.keyType;
3582
+ inst.valueType = def.valueType;
3583
+ });
3584
+ function record(keyType, valueType, params) {
3585
+ return new ZodRecord({
3586
+ type: "record",
3587
+ keyType,
3588
+ valueType,
3589
+ ...exports_util.normalizeParams(params)
3590
+ });
3591
+ }
3592
+ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
3593
+ $ZodEnum.init(inst, def);
3594
+ ZodType.init(inst, def);
3595
+ inst.enum = def.entries;
3596
+ inst.options = Object.values(def.entries);
3597
+ const keys = new Set(Object.keys(def.entries));
3598
+ inst.extract = (values, params) => {
3599
+ const newEntries = {};
3600
+ for (const value of values) {
3601
+ if (keys.has(value)) {
3602
+ newEntries[value] = def.entries[value];
3603
+ } else
3604
+ throw new Error(`Key ${value} not found in enum`);
3605
+ }
3606
+ return new ZodEnum({
3607
+ ...def,
3608
+ checks: [],
3609
+ ...exports_util.normalizeParams(params),
3610
+ entries: newEntries
3611
+ });
3612
+ };
3613
+ inst.exclude = (values, params) => {
3614
+ const newEntries = { ...def.entries };
3615
+ for (const value of values) {
3616
+ if (keys.has(value)) {
3617
+ delete newEntries[value];
3618
+ } else
3619
+ throw new Error(`Key ${value} not found in enum`);
3620
+ }
3621
+ return new ZodEnum({
3622
+ ...def,
3623
+ checks: [],
3624
+ ...exports_util.normalizeParams(params),
3625
+ entries: newEntries
3626
+ });
3627
+ };
3628
+ });
3629
+ function _enum(values, params) {
3630
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
3631
+ return new ZodEnum({
3632
+ type: "enum",
3633
+ entries,
3634
+ ...exports_util.normalizeParams(params)
3635
+ });
3636
+ }
3637
+ var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
3638
+ $ZodLiteral.init(inst, def);
3639
+ ZodType.init(inst, def);
3640
+ inst.values = new Set(def.values);
3641
+ Object.defineProperty(inst, "value", {
3642
+ get() {
3643
+ if (def.values.length > 1) {
3644
+ throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
3645
+ }
3646
+ return def.values[0];
3647
+ }
3648
+ });
3649
+ });
3650
+ function literal(value, params) {
3651
+ return new ZodLiteral({
3652
+ type: "literal",
3653
+ values: Array.isArray(value) ? value : [value],
3654
+ ...exports_util.normalizeParams(params)
3655
+ });
3656
+ }
3657
+ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
3658
+ $ZodTransform.init(inst, def);
3659
+ ZodType.init(inst, def);
3660
+ inst._zod.parse = (payload, _ctx) => {
3661
+ payload.addIssue = (issue2) => {
3662
+ if (typeof issue2 === "string") {
3663
+ payload.issues.push(exports_util.issue(issue2, payload.value, def));
3664
+ } else {
3665
+ const _issue = issue2;
3666
+ if (_issue.fatal)
3667
+ _issue.continue = false;
3668
+ _issue.code ?? (_issue.code = "custom");
3669
+ _issue.input ?? (_issue.input = payload.value);
3670
+ _issue.inst ?? (_issue.inst = inst);
3671
+ _issue.continue ?? (_issue.continue = true);
3672
+ payload.issues.push(exports_util.issue(_issue));
3673
+ }
3674
+ };
3675
+ const output = def.transform(payload.value, payload);
3676
+ if (output instanceof Promise) {
3677
+ return output.then((output2) => {
3678
+ payload.value = output2;
3679
+ return payload;
3680
+ });
3681
+ }
3682
+ payload.value = output;
3683
+ return payload;
3684
+ };
3685
+ });
3686
+ function transform(fn) {
3687
+ return new ZodTransform({
3688
+ type: "transform",
3689
+ transform: fn
3690
+ });
3691
+ }
3692
+ var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
3693
+ $ZodOptional.init(inst, def);
3694
+ ZodType.init(inst, def);
3695
+ inst.unwrap = () => inst._zod.def.innerType;
3696
+ });
3697
+ function optional(innerType) {
3698
+ return new ZodOptional({
3699
+ type: "optional",
3700
+ innerType
3701
+ });
3702
+ }
3703
+ var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
3704
+ $ZodNullable.init(inst, def);
3705
+ ZodType.init(inst, def);
3706
+ inst.unwrap = () => inst._zod.def.innerType;
3707
+ });
3708
+ function nullable(innerType) {
3709
+ return new ZodNullable({
3710
+ type: "nullable",
3711
+ innerType
3712
+ });
3713
+ }
3714
+ var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
3715
+ $ZodDefault.init(inst, def);
3716
+ ZodType.init(inst, def);
3717
+ inst.unwrap = () => inst._zod.def.innerType;
3718
+ inst.removeDefault = inst.unwrap;
3719
+ });
3720
+ function _default(innerType, defaultValue) {
3721
+ return new ZodDefault({
3722
+ type: "default",
3723
+ innerType,
3724
+ get defaultValue() {
3725
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
3726
+ }
3727
+ });
3728
+ }
3729
+ var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
3730
+ $ZodPrefault.init(inst, def);
3731
+ ZodType.init(inst, def);
3732
+ inst.unwrap = () => inst._zod.def.innerType;
3733
+ });
3734
+ function prefault(innerType, defaultValue) {
3735
+ return new ZodPrefault({
3736
+ type: "prefault",
3737
+ innerType,
3738
+ get defaultValue() {
3739
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
3740
+ }
3741
+ });
3742
+ }
3743
+ var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
3744
+ $ZodNonOptional.init(inst, def);
3745
+ ZodType.init(inst, def);
3746
+ inst.unwrap = () => inst._zod.def.innerType;
3747
+ });
3748
+ function nonoptional(innerType, params) {
3749
+ return new ZodNonOptional({
3750
+ type: "nonoptional",
3751
+ innerType,
3752
+ ...exports_util.normalizeParams(params)
3753
+ });
3754
+ }
3755
+ var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
3756
+ $ZodCatch.init(inst, def);
3757
+ ZodType.init(inst, def);
3758
+ inst.unwrap = () => inst._zod.def.innerType;
3759
+ inst.removeCatch = inst.unwrap;
3760
+ });
3761
+ function _catch(innerType, catchValue) {
3762
+ return new ZodCatch({
3763
+ type: "catch",
3764
+ innerType,
3765
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
3766
+ });
3767
+ }
3768
+ var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
3769
+ $ZodPipe.init(inst, def);
3770
+ ZodType.init(inst, def);
3771
+ inst.in = def.in;
3772
+ inst.out = def.out;
3773
+ });
3774
+ function pipe(in_, out) {
3775
+ return new ZodPipe({
3776
+ type: "pipe",
3777
+ in: in_,
3778
+ out
3779
+ });
3780
+ }
3781
+ var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
3782
+ $ZodReadonly.init(inst, def);
3783
+ ZodType.init(inst, def);
3784
+ });
3785
+ function readonly(innerType) {
3786
+ return new ZodReadonly({
3787
+ type: "readonly",
3788
+ innerType
3789
+ });
3790
+ }
3791
+ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
3792
+ $ZodCustom.init(inst, def);
3793
+ ZodType.init(inst, def);
3794
+ });
3795
+ function check(fn) {
3796
+ const ch = new $ZodCheck({
3797
+ check: "custom"
3798
+ });
3799
+ ch._zod.check = fn;
3800
+ return ch;
3801
+ }
3802
+ function custom(fn, _params) {
3803
+ return _custom(ZodCustom, fn ?? (() => true), _params);
3804
+ }
3805
+ function refine(fn, _params = {}) {
3806
+ return _refine(ZodCustom, fn, _params);
3807
+ }
3808
+ function superRefine(fn) {
3809
+ const ch = check((payload) => {
3810
+ payload.addIssue = (issue2) => {
3811
+ if (typeof issue2 === "string") {
3812
+ payload.issues.push(exports_util.issue(issue2, payload.value, ch._zod.def));
3813
+ } else {
3814
+ const _issue = issue2;
3815
+ if (_issue.fatal)
3816
+ _issue.continue = false;
3817
+ _issue.code ?? (_issue.code = "custom");
3818
+ _issue.input ?? (_issue.input = payload.value);
3819
+ _issue.inst ?? (_issue.inst = ch);
3820
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
3821
+ payload.issues.push(exports_util.issue(_issue));
3822
+ }
3823
+ };
3824
+ return fn(payload.value, payload);
3825
+ });
3826
+ return ch;
3827
+ }
3828
+ function preprocess(fn, schema) {
3829
+ return pipe(transform(fn), schema);
3830
+ }
3831
+ // node_modules/zod/v4/classic/compat.js
3832
+ var ZodIssueCode = {
3833
+ invalid_type: "invalid_type",
3834
+ too_big: "too_big",
3835
+ too_small: "too_small",
3836
+ invalid_format: "invalid_format",
3837
+ not_multiple_of: "not_multiple_of",
3838
+ unrecognized_keys: "unrecognized_keys",
3839
+ invalid_union: "invalid_union",
3840
+ invalid_key: "invalid_key",
3841
+ invalid_element: "invalid_element",
3842
+ invalid_value: "invalid_value",
3843
+ custom: "custom"
3844
+ };
3845
+ // node_modules/zod/v4/classic/coerce.js
3846
+ var exports_coerce = {};
3847
+ __export(exports_coerce, {
3848
+ string: () => string3,
3849
+ number: () => number3,
3850
+ date: () => date3,
3851
+ boolean: () => boolean3,
3852
+ bigint: () => bigint2
3853
+ });
3854
+ function string3(params) {
3855
+ return _coercedString(ZodString, params);
3856
+ }
3857
+ function number3(params) {
3858
+ return _coercedNumber(ZodNumber, params);
3859
+ }
3860
+ function boolean3(params) {
3861
+ return _coercedBoolean(ZodBoolean, params);
3862
+ }
3863
+ function bigint2(params) {
3864
+ return _coercedBigint(ZodBigInt, params);
3865
+ }
3866
+ function date3(params) {
3867
+ return _coercedDate(ZodDate, params);
3868
+ }
3869
+
3870
+ // node_modules/zod/v4/classic/external.js
3871
+ config(en_default());
3872
+
3873
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
3874
+ var LATEST_PROTOCOL_VERSION = "2025-11-25";
3875
+ var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
3876
+ var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
3877
+ var JSONRPC_VERSION = "2.0";
3878
+ var AssertObjectSchema = custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
3879
+ var ProgressTokenSchema = union([string2(), number2().int()]);
3880
+ var CursorSchema = string2();
3881
+ var TaskCreationParamsSchema = looseObject({
3882
+ ttl: union([number2(), _null3()]).optional(),
3883
+ pollInterval: number2().optional()
3884
+ });
3885
+ var TaskMetadataSchema = object({
3886
+ ttl: number2().optional()
3887
+ });
3888
+ var RelatedTaskMetadataSchema = object({
3889
+ taskId: string2()
3890
+ });
3891
+ var RequestMetaSchema = looseObject({
3892
+ progressToken: ProgressTokenSchema.optional(),
3893
+ [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
3894
+ });
3895
+ var BaseRequestParamsSchema = object({
3896
+ _meta: RequestMetaSchema.optional()
3897
+ });
3898
+ var TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
3899
+ task: TaskMetadataSchema.optional()
3900
+ });
3901
+ var isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
3902
+ var RequestSchema = object({
3903
+ method: string2(),
3904
+ params: BaseRequestParamsSchema.loose().optional()
3905
+ });
3906
+ var NotificationsParamsSchema = object({
3907
+ _meta: RequestMetaSchema.optional()
3908
+ });
3909
+ var NotificationSchema = object({
3910
+ method: string2(),
3911
+ params: NotificationsParamsSchema.loose().optional()
3912
+ });
3913
+ var ResultSchema = looseObject({
3914
+ _meta: RequestMetaSchema.optional()
3915
+ });
3916
+ var RequestIdSchema = union([string2(), number2().int()]);
3917
+ var JSONRPCRequestSchema = object({
3918
+ jsonrpc: literal(JSONRPC_VERSION),
3919
+ id: RequestIdSchema,
3920
+ ...RequestSchema.shape
3921
+ }).strict();
3922
+ var isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
3923
+ var JSONRPCNotificationSchema = object({
3924
+ jsonrpc: literal(JSONRPC_VERSION),
3925
+ ...NotificationSchema.shape
3926
+ }).strict();
3927
+ var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
3928
+ var JSONRPCResultResponseSchema = object({
3929
+ jsonrpc: literal(JSONRPC_VERSION),
3930
+ id: RequestIdSchema,
3931
+ result: ResultSchema
3932
+ }).strict();
3933
+ var isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;
3934
+ var ErrorCode;
3935
+ (function(ErrorCode2) {
3936
+ ErrorCode2[ErrorCode2["ConnectionClosed"] = -32000] = "ConnectionClosed";
3937
+ ErrorCode2[ErrorCode2["RequestTimeout"] = -32001] = "RequestTimeout";
3938
+ ErrorCode2[ErrorCode2["ParseError"] = -32700] = "ParseError";
3939
+ ErrorCode2[ErrorCode2["InvalidRequest"] = -32600] = "InvalidRequest";
3940
+ ErrorCode2[ErrorCode2["MethodNotFound"] = -32601] = "MethodNotFound";
3941
+ ErrorCode2[ErrorCode2["InvalidParams"] = -32602] = "InvalidParams";
3942
+ ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
3943
+ ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
3944
+ })(ErrorCode || (ErrorCode = {}));
3945
+ var JSONRPCErrorResponseSchema = object({
3946
+ jsonrpc: literal(JSONRPC_VERSION),
3947
+ id: RequestIdSchema.optional(),
3948
+ error: object({
3949
+ code: number2().int(),
3950
+ message: string2(),
3951
+ data: unknown().optional()
3952
+ })
3953
+ }).strict();
3954
+ var isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
3955
+ var JSONRPCMessageSchema = union([
3956
+ JSONRPCRequestSchema,
3957
+ JSONRPCNotificationSchema,
3958
+ JSONRPCResultResponseSchema,
3959
+ JSONRPCErrorResponseSchema
3960
+ ]);
3961
+ var JSONRPCResponseSchema = union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
3962
+ var EmptyResultSchema = ResultSchema.strict();
3963
+ var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
3964
+ requestId: RequestIdSchema.optional(),
3965
+ reason: string2().optional()
3966
+ });
3967
+ var CancelledNotificationSchema = NotificationSchema.extend({
3968
+ method: literal("notifications/cancelled"),
3969
+ params: CancelledNotificationParamsSchema
3970
+ });
3971
+ var IconSchema = object({
3972
+ src: string2(),
3973
+ mimeType: string2().optional(),
3974
+ sizes: array(string2()).optional(),
3975
+ theme: _enum(["light", "dark"]).optional()
3976
+ });
3977
+ var IconsSchema = object({
3978
+ icons: array(IconSchema).optional()
3979
+ });
3980
+ var BaseMetadataSchema = object({
3981
+ name: string2(),
3982
+ title: string2().optional()
3983
+ });
3984
+ var ImplementationSchema = BaseMetadataSchema.extend({
3985
+ ...BaseMetadataSchema.shape,
3986
+ ...IconsSchema.shape,
3987
+ version: string2(),
3988
+ websiteUrl: string2().optional(),
3989
+ description: string2().optional()
3990
+ });
3991
+ var FormElicitationCapabilitySchema = intersection(object({
3992
+ applyDefaults: boolean2().optional()
3993
+ }), record(string2(), unknown()));
3994
+ var ElicitationCapabilitySchema = preprocess((value) => {
3995
+ if (value && typeof value === "object" && !Array.isArray(value)) {
3996
+ if (Object.keys(value).length === 0) {
3997
+ return { form: {} };
3998
+ }
3999
+ }
4000
+ return value;
4001
+ }, intersection(object({
4002
+ form: FormElicitationCapabilitySchema.optional(),
4003
+ url: AssertObjectSchema.optional()
4004
+ }), record(string2(), unknown()).optional()));
4005
+ var ClientTasksCapabilitySchema = looseObject({
4006
+ list: AssertObjectSchema.optional(),
4007
+ cancel: AssertObjectSchema.optional(),
4008
+ requests: looseObject({
4009
+ sampling: looseObject({
4010
+ createMessage: AssertObjectSchema.optional()
4011
+ }).optional(),
4012
+ elicitation: looseObject({
4013
+ create: AssertObjectSchema.optional()
4014
+ }).optional()
4015
+ }).optional()
4016
+ });
4017
+ var ServerTasksCapabilitySchema = looseObject({
4018
+ list: AssertObjectSchema.optional(),
4019
+ cancel: AssertObjectSchema.optional(),
4020
+ requests: looseObject({
4021
+ tools: looseObject({
4022
+ call: AssertObjectSchema.optional()
4023
+ }).optional()
4024
+ }).optional()
4025
+ });
4026
+ var ClientCapabilitiesSchema = object({
4027
+ experimental: record(string2(), AssertObjectSchema).optional(),
4028
+ sampling: object({
4029
+ context: AssertObjectSchema.optional(),
4030
+ tools: AssertObjectSchema.optional()
4031
+ }).optional(),
4032
+ elicitation: ElicitationCapabilitySchema.optional(),
4033
+ roots: object({
4034
+ listChanged: boolean2().optional()
4035
+ }).optional(),
4036
+ tasks: ClientTasksCapabilitySchema.optional()
4037
+ });
4038
+ var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
4039
+ protocolVersion: string2(),
4040
+ capabilities: ClientCapabilitiesSchema,
4041
+ clientInfo: ImplementationSchema
4042
+ });
4043
+ var InitializeRequestSchema = RequestSchema.extend({
4044
+ method: literal("initialize"),
4045
+ params: InitializeRequestParamsSchema
4046
+ });
4047
+ var ServerCapabilitiesSchema = object({
4048
+ experimental: record(string2(), AssertObjectSchema).optional(),
4049
+ logging: AssertObjectSchema.optional(),
4050
+ completions: AssertObjectSchema.optional(),
4051
+ prompts: object({
4052
+ listChanged: boolean2().optional()
4053
+ }).optional(),
4054
+ resources: object({
4055
+ subscribe: boolean2().optional(),
4056
+ listChanged: boolean2().optional()
4057
+ }).optional(),
4058
+ tools: object({
4059
+ listChanged: boolean2().optional()
4060
+ }).optional(),
4061
+ tasks: ServerTasksCapabilitySchema.optional()
4062
+ });
4063
+ var InitializeResultSchema = ResultSchema.extend({
4064
+ protocolVersion: string2(),
4065
+ capabilities: ServerCapabilitiesSchema,
4066
+ serverInfo: ImplementationSchema,
4067
+ instructions: string2().optional()
4068
+ });
4069
+ var InitializedNotificationSchema = NotificationSchema.extend({
4070
+ method: literal("notifications/initialized"),
4071
+ params: NotificationsParamsSchema.optional()
4072
+ });
4073
+ var isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
4074
+ var PingRequestSchema = RequestSchema.extend({
4075
+ method: literal("ping"),
4076
+ params: BaseRequestParamsSchema.optional()
4077
+ });
4078
+ var ProgressSchema = object({
4079
+ progress: number2(),
4080
+ total: optional(number2()),
4081
+ message: optional(string2())
4082
+ });
4083
+ var ProgressNotificationParamsSchema = object({
4084
+ ...NotificationsParamsSchema.shape,
4085
+ ...ProgressSchema.shape,
4086
+ progressToken: ProgressTokenSchema
4087
+ });
4088
+ var ProgressNotificationSchema = NotificationSchema.extend({
4089
+ method: literal("notifications/progress"),
4090
+ params: ProgressNotificationParamsSchema
4091
+ });
4092
+ var PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
4093
+ cursor: CursorSchema.optional()
4094
+ });
4095
+ var PaginatedRequestSchema = RequestSchema.extend({
4096
+ params: PaginatedRequestParamsSchema.optional()
4097
+ });
4098
+ var PaginatedResultSchema = ResultSchema.extend({
4099
+ nextCursor: CursorSchema.optional()
4100
+ });
4101
+ var TaskStatusSchema = _enum(["working", "input_required", "completed", "failed", "cancelled"]);
4102
+ var TaskSchema = object({
4103
+ taskId: string2(),
4104
+ status: TaskStatusSchema,
4105
+ ttl: union([number2(), _null3()]),
4106
+ createdAt: string2(),
4107
+ lastUpdatedAt: string2(),
4108
+ pollInterval: optional(number2()),
4109
+ statusMessage: optional(string2())
4110
+ });
4111
+ var CreateTaskResultSchema = ResultSchema.extend({
4112
+ task: TaskSchema
4113
+ });
4114
+ var TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
4115
+ var TaskStatusNotificationSchema = NotificationSchema.extend({
4116
+ method: literal("notifications/tasks/status"),
4117
+ params: TaskStatusNotificationParamsSchema
4118
+ });
4119
+ var GetTaskRequestSchema = RequestSchema.extend({
4120
+ method: literal("tasks/get"),
4121
+ params: BaseRequestParamsSchema.extend({
4122
+ taskId: string2()
4123
+ })
4124
+ });
4125
+ var GetTaskResultSchema = ResultSchema.merge(TaskSchema);
4126
+ var GetTaskPayloadRequestSchema = RequestSchema.extend({
4127
+ method: literal("tasks/result"),
4128
+ params: BaseRequestParamsSchema.extend({
4129
+ taskId: string2()
4130
+ })
4131
+ });
4132
+ var GetTaskPayloadResultSchema = ResultSchema.loose();
4133
+ var ListTasksRequestSchema = PaginatedRequestSchema.extend({
4134
+ method: literal("tasks/list")
4135
+ });
4136
+ var ListTasksResultSchema = PaginatedResultSchema.extend({
4137
+ tasks: array(TaskSchema)
4138
+ });
4139
+ var CancelTaskRequestSchema = RequestSchema.extend({
4140
+ method: literal("tasks/cancel"),
4141
+ params: BaseRequestParamsSchema.extend({
4142
+ taskId: string2()
4143
+ })
4144
+ });
4145
+ var CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
4146
+ var ResourceContentsSchema = object({
4147
+ uri: string2(),
4148
+ mimeType: optional(string2()),
4149
+ _meta: record(string2(), unknown()).optional()
4150
+ });
4151
+ var TextResourceContentsSchema = ResourceContentsSchema.extend({
4152
+ text: string2()
4153
+ });
4154
+ var Base64Schema = string2().refine((val) => {
4155
+ try {
4156
+ atob(val);
4157
+ return true;
4158
+ } catch {
4159
+ return false;
4160
+ }
4161
+ }, { message: "Invalid Base64 string" });
4162
+ var BlobResourceContentsSchema = ResourceContentsSchema.extend({
4163
+ blob: Base64Schema
4164
+ });
4165
+ var RoleSchema = _enum(["user", "assistant"]);
4166
+ var AnnotationsSchema = object({
4167
+ audience: array(RoleSchema).optional(),
4168
+ priority: number2().min(0).max(1).optional(),
4169
+ lastModified: exports_iso.datetime({ offset: true }).optional()
4170
+ });
4171
+ var ResourceSchema = object({
4172
+ ...BaseMetadataSchema.shape,
4173
+ ...IconsSchema.shape,
4174
+ uri: string2(),
4175
+ description: optional(string2()),
4176
+ mimeType: optional(string2()),
4177
+ annotations: AnnotationsSchema.optional(),
4178
+ _meta: optional(looseObject({}))
4179
+ });
4180
+ var ResourceTemplateSchema = object({
4181
+ ...BaseMetadataSchema.shape,
4182
+ ...IconsSchema.shape,
4183
+ uriTemplate: string2(),
4184
+ description: optional(string2()),
4185
+ mimeType: optional(string2()),
4186
+ annotations: AnnotationsSchema.optional(),
4187
+ _meta: optional(looseObject({}))
4188
+ });
4189
+ var ListResourcesRequestSchema = PaginatedRequestSchema.extend({
4190
+ method: literal("resources/list")
4191
+ });
4192
+ var ListResourcesResultSchema = PaginatedResultSchema.extend({
4193
+ resources: array(ResourceSchema)
4194
+ });
4195
+ var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
4196
+ method: literal("resources/templates/list")
4197
+ });
4198
+ var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
4199
+ resourceTemplates: array(ResourceTemplateSchema)
4200
+ });
4201
+ var ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
4202
+ uri: string2()
4203
+ });
4204
+ var ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
4205
+ var ReadResourceRequestSchema = RequestSchema.extend({
4206
+ method: literal("resources/read"),
4207
+ params: ReadResourceRequestParamsSchema
4208
+ });
4209
+ var ReadResourceResultSchema = ResultSchema.extend({
4210
+ contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
4211
+ });
4212
+ var ResourceListChangedNotificationSchema = NotificationSchema.extend({
4213
+ method: literal("notifications/resources/list_changed"),
4214
+ params: NotificationsParamsSchema.optional()
4215
+ });
4216
+ var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
4217
+ var SubscribeRequestSchema = RequestSchema.extend({
4218
+ method: literal("resources/subscribe"),
4219
+ params: SubscribeRequestParamsSchema
4220
+ });
4221
+ var UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
4222
+ var UnsubscribeRequestSchema = RequestSchema.extend({
4223
+ method: literal("resources/unsubscribe"),
4224
+ params: UnsubscribeRequestParamsSchema
4225
+ });
4226
+ var ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
4227
+ uri: string2()
4228
+ });
4229
+ var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
4230
+ method: literal("notifications/resources/updated"),
4231
+ params: ResourceUpdatedNotificationParamsSchema
4232
+ });
4233
+ var PromptArgumentSchema = object({
4234
+ name: string2(),
4235
+ description: optional(string2()),
4236
+ required: optional(boolean2())
4237
+ });
4238
+ var PromptSchema = object({
4239
+ ...BaseMetadataSchema.shape,
4240
+ ...IconsSchema.shape,
4241
+ description: optional(string2()),
4242
+ arguments: optional(array(PromptArgumentSchema)),
4243
+ _meta: optional(looseObject({}))
4244
+ });
4245
+ var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
4246
+ method: literal("prompts/list")
4247
+ });
4248
+ var ListPromptsResultSchema = PaginatedResultSchema.extend({
4249
+ prompts: array(PromptSchema)
4250
+ });
4251
+ var GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
4252
+ name: string2(),
4253
+ arguments: record(string2(), string2()).optional()
4254
+ });
4255
+ var GetPromptRequestSchema = RequestSchema.extend({
4256
+ method: literal("prompts/get"),
4257
+ params: GetPromptRequestParamsSchema
4258
+ });
4259
+ var TextContentSchema = object({
4260
+ type: literal("text"),
4261
+ text: string2(),
4262
+ annotations: AnnotationsSchema.optional(),
4263
+ _meta: record(string2(), unknown()).optional()
4264
+ });
4265
+ var ImageContentSchema = object({
4266
+ type: literal("image"),
4267
+ data: Base64Schema,
4268
+ mimeType: string2(),
4269
+ annotations: AnnotationsSchema.optional(),
4270
+ _meta: record(string2(), unknown()).optional()
4271
+ });
4272
+ var AudioContentSchema = object({
4273
+ type: literal("audio"),
4274
+ data: Base64Schema,
4275
+ mimeType: string2(),
4276
+ annotations: AnnotationsSchema.optional(),
4277
+ _meta: record(string2(), unknown()).optional()
4278
+ });
4279
+ var ToolUseContentSchema = object({
4280
+ type: literal("tool_use"),
4281
+ name: string2(),
4282
+ id: string2(),
4283
+ input: record(string2(), unknown()),
4284
+ _meta: record(string2(), unknown()).optional()
4285
+ });
4286
+ var EmbeddedResourceSchema = object({
4287
+ type: literal("resource"),
4288
+ resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
4289
+ annotations: AnnotationsSchema.optional(),
4290
+ _meta: record(string2(), unknown()).optional()
4291
+ });
4292
+ var ResourceLinkSchema = ResourceSchema.extend({
4293
+ type: literal("resource_link")
4294
+ });
4295
+ var ContentBlockSchema = union([
4296
+ TextContentSchema,
4297
+ ImageContentSchema,
4298
+ AudioContentSchema,
4299
+ ResourceLinkSchema,
4300
+ EmbeddedResourceSchema
4301
+ ]);
4302
+ var PromptMessageSchema = object({
4303
+ role: RoleSchema,
4304
+ content: ContentBlockSchema
4305
+ });
4306
+ var GetPromptResultSchema = ResultSchema.extend({
4307
+ description: string2().optional(),
4308
+ messages: array(PromptMessageSchema)
4309
+ });
4310
+ var PromptListChangedNotificationSchema = NotificationSchema.extend({
4311
+ method: literal("notifications/prompts/list_changed"),
4312
+ params: NotificationsParamsSchema.optional()
4313
+ });
4314
+ var ToolAnnotationsSchema = object({
4315
+ title: string2().optional(),
4316
+ readOnlyHint: boolean2().optional(),
4317
+ destructiveHint: boolean2().optional(),
4318
+ idempotentHint: boolean2().optional(),
4319
+ openWorldHint: boolean2().optional()
4320
+ });
4321
+ var ToolExecutionSchema = object({
4322
+ taskSupport: _enum(["required", "optional", "forbidden"]).optional()
4323
+ });
4324
+ var ToolSchema = object({
4325
+ ...BaseMetadataSchema.shape,
4326
+ ...IconsSchema.shape,
4327
+ description: string2().optional(),
4328
+ inputSchema: object({
4329
+ type: literal("object"),
4330
+ properties: record(string2(), AssertObjectSchema).optional(),
4331
+ required: array(string2()).optional()
4332
+ }).catchall(unknown()),
4333
+ outputSchema: object({
4334
+ type: literal("object"),
4335
+ properties: record(string2(), AssertObjectSchema).optional(),
4336
+ required: array(string2()).optional()
4337
+ }).catchall(unknown()).optional(),
4338
+ annotations: ToolAnnotationsSchema.optional(),
4339
+ execution: ToolExecutionSchema.optional(),
4340
+ _meta: record(string2(), unknown()).optional()
4341
+ });
4342
+ var ListToolsRequestSchema = PaginatedRequestSchema.extend({
4343
+ method: literal("tools/list")
4344
+ });
4345
+ var ListToolsResultSchema = PaginatedResultSchema.extend({
4346
+ tools: array(ToolSchema)
4347
+ });
4348
+ var CallToolResultSchema = ResultSchema.extend({
4349
+ content: array(ContentBlockSchema).default([]),
4350
+ structuredContent: record(string2(), unknown()).optional(),
4351
+ isError: boolean2().optional()
4352
+ });
4353
+ var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
4354
+ toolResult: unknown()
4355
+ }));
4356
+ var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
4357
+ name: string2(),
4358
+ arguments: record(string2(), unknown()).optional()
4359
+ });
4360
+ var CallToolRequestSchema = RequestSchema.extend({
4361
+ method: literal("tools/call"),
4362
+ params: CallToolRequestParamsSchema
4363
+ });
4364
+ var ToolListChangedNotificationSchema = NotificationSchema.extend({
4365
+ method: literal("notifications/tools/list_changed"),
4366
+ params: NotificationsParamsSchema.optional()
4367
+ });
4368
+ var ListChangedOptionsBaseSchema = object({
4369
+ autoRefresh: boolean2().default(true),
4370
+ debounceMs: number2().int().nonnegative().default(300)
4371
+ });
4372
+ var LoggingLevelSchema = _enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
4373
+ var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
4374
+ level: LoggingLevelSchema
4375
+ });
4376
+ var SetLevelRequestSchema = RequestSchema.extend({
4377
+ method: literal("logging/setLevel"),
4378
+ params: SetLevelRequestParamsSchema
4379
+ });
4380
+ var LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
4381
+ level: LoggingLevelSchema,
4382
+ logger: string2().optional(),
4383
+ data: unknown()
4384
+ });
4385
+ var LoggingMessageNotificationSchema = NotificationSchema.extend({
4386
+ method: literal("notifications/message"),
4387
+ params: LoggingMessageNotificationParamsSchema
4388
+ });
4389
+ var ModelHintSchema = object({
4390
+ name: string2().optional()
4391
+ });
4392
+ var ModelPreferencesSchema = object({
4393
+ hints: array(ModelHintSchema).optional(),
4394
+ costPriority: number2().min(0).max(1).optional(),
4395
+ speedPriority: number2().min(0).max(1).optional(),
4396
+ intelligencePriority: number2().min(0).max(1).optional()
4397
+ });
4398
+ var ToolChoiceSchema = object({
4399
+ mode: _enum(["auto", "required", "none"]).optional()
4400
+ });
4401
+ var ToolResultContentSchema = object({
4402
+ type: literal("tool_result"),
4403
+ toolUseId: string2().describe("The unique identifier for the corresponding tool call."),
4404
+ content: array(ContentBlockSchema).default([]),
4405
+ structuredContent: object({}).loose().optional(),
4406
+ isError: boolean2().optional(),
4407
+ _meta: record(string2(), unknown()).optional()
4408
+ });
4409
+ var SamplingContentSchema = discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
4410
+ var SamplingMessageContentBlockSchema = discriminatedUnion("type", [
4411
+ TextContentSchema,
4412
+ ImageContentSchema,
4413
+ AudioContentSchema,
4414
+ ToolUseContentSchema,
4415
+ ToolResultContentSchema
4416
+ ]);
4417
+ var SamplingMessageSchema = object({
4418
+ role: RoleSchema,
4419
+ content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
4420
+ _meta: record(string2(), unknown()).optional()
4421
+ });
4422
+ var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
4423
+ messages: array(SamplingMessageSchema),
4424
+ modelPreferences: ModelPreferencesSchema.optional(),
4425
+ systemPrompt: string2().optional(),
4426
+ includeContext: _enum(["none", "thisServer", "allServers"]).optional(),
4427
+ temperature: number2().optional(),
4428
+ maxTokens: number2().int(),
4429
+ stopSequences: array(string2()).optional(),
4430
+ metadata: AssertObjectSchema.optional(),
4431
+ tools: array(ToolSchema).optional(),
4432
+ toolChoice: ToolChoiceSchema.optional()
4433
+ });
4434
+ var CreateMessageRequestSchema = RequestSchema.extend({
4435
+ method: literal("sampling/createMessage"),
4436
+ params: CreateMessageRequestParamsSchema
4437
+ });
4438
+ var CreateMessageResultSchema = ResultSchema.extend({
4439
+ model: string2(),
4440
+ stopReason: optional(_enum(["endTurn", "stopSequence", "maxTokens"]).or(string2())),
4441
+ role: RoleSchema,
4442
+ content: SamplingContentSchema
4443
+ });
4444
+ var CreateMessageResultWithToolsSchema = ResultSchema.extend({
4445
+ model: string2(),
4446
+ stopReason: optional(_enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string2())),
4447
+ role: RoleSchema,
4448
+ content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
4449
+ });
4450
+ var BooleanSchemaSchema = object({
4451
+ type: literal("boolean"),
4452
+ title: string2().optional(),
4453
+ description: string2().optional(),
4454
+ default: boolean2().optional()
4455
+ });
4456
+ var StringSchemaSchema = object({
4457
+ type: literal("string"),
4458
+ title: string2().optional(),
4459
+ description: string2().optional(),
4460
+ minLength: number2().optional(),
4461
+ maxLength: number2().optional(),
4462
+ format: _enum(["email", "uri", "date", "date-time"]).optional(),
4463
+ default: string2().optional()
4464
+ });
4465
+ var NumberSchemaSchema = object({
4466
+ type: _enum(["number", "integer"]),
4467
+ title: string2().optional(),
4468
+ description: string2().optional(),
4469
+ minimum: number2().optional(),
4470
+ maximum: number2().optional(),
4471
+ default: number2().optional()
4472
+ });
4473
+ var UntitledSingleSelectEnumSchemaSchema = object({
4474
+ type: literal("string"),
4475
+ title: string2().optional(),
4476
+ description: string2().optional(),
4477
+ enum: array(string2()),
4478
+ default: string2().optional()
4479
+ });
4480
+ var TitledSingleSelectEnumSchemaSchema = object({
4481
+ type: literal("string"),
4482
+ title: string2().optional(),
4483
+ description: string2().optional(),
4484
+ oneOf: array(object({
4485
+ const: string2(),
4486
+ title: string2()
4487
+ })),
4488
+ default: string2().optional()
4489
+ });
4490
+ var LegacyTitledEnumSchemaSchema = object({
4491
+ type: literal("string"),
4492
+ title: string2().optional(),
4493
+ description: string2().optional(),
4494
+ enum: array(string2()),
4495
+ enumNames: array(string2()).optional(),
4496
+ default: string2().optional()
4497
+ });
4498
+ var SingleSelectEnumSchemaSchema = union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
4499
+ var UntitledMultiSelectEnumSchemaSchema = object({
4500
+ type: literal("array"),
4501
+ title: string2().optional(),
4502
+ description: string2().optional(),
4503
+ minItems: number2().optional(),
4504
+ maxItems: number2().optional(),
4505
+ items: object({
4506
+ type: literal("string"),
4507
+ enum: array(string2())
4508
+ }),
4509
+ default: array(string2()).optional()
4510
+ });
4511
+ var TitledMultiSelectEnumSchemaSchema = object({
4512
+ type: literal("array"),
4513
+ title: string2().optional(),
4514
+ description: string2().optional(),
4515
+ minItems: number2().optional(),
4516
+ maxItems: number2().optional(),
4517
+ items: object({
4518
+ anyOf: array(object({
4519
+ const: string2(),
4520
+ title: string2()
4521
+ }))
4522
+ }),
4523
+ default: array(string2()).optional()
4524
+ });
4525
+ var MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
4526
+ var EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
4527
+ var PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
4528
+ var ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
4529
+ mode: literal("form").optional(),
4530
+ message: string2(),
4531
+ requestedSchema: object({
4532
+ type: literal("object"),
4533
+ properties: record(string2(), PrimitiveSchemaDefinitionSchema),
4534
+ required: array(string2()).optional()
4535
+ })
4536
+ });
4537
+ var ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
4538
+ mode: literal("url"),
4539
+ message: string2(),
4540
+ elicitationId: string2(),
4541
+ url: string2().url()
4542
+ });
4543
+ var ElicitRequestParamsSchema = union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
4544
+ var ElicitRequestSchema = RequestSchema.extend({
4545
+ method: literal("elicitation/create"),
4546
+ params: ElicitRequestParamsSchema
4547
+ });
4548
+ var ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
4549
+ elicitationId: string2()
4550
+ });
4551
+ var ElicitationCompleteNotificationSchema = NotificationSchema.extend({
4552
+ method: literal("notifications/elicitation/complete"),
4553
+ params: ElicitationCompleteNotificationParamsSchema
4554
+ });
4555
+ var ElicitResultSchema = ResultSchema.extend({
4556
+ action: _enum(["accept", "decline", "cancel"]),
4557
+ content: preprocess((val) => val === null ? undefined : val, record(string2(), union([string2(), number2(), boolean2(), array(string2())])).optional())
4558
+ });
4559
+ var ResourceTemplateReferenceSchema = object({
4560
+ type: literal("ref/resource"),
4561
+ uri: string2()
4562
+ });
4563
+ var PromptReferenceSchema = object({
4564
+ type: literal("ref/prompt"),
4565
+ name: string2()
4566
+ });
4567
+ var CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
4568
+ ref: union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
4569
+ argument: object({
4570
+ name: string2(),
4571
+ value: string2()
4572
+ }),
4573
+ context: object({
4574
+ arguments: record(string2(), string2()).optional()
4575
+ }).optional()
4576
+ });
4577
+ var CompleteRequestSchema = RequestSchema.extend({
4578
+ method: literal("completion/complete"),
4579
+ params: CompleteRequestParamsSchema
4580
+ });
4581
+ var CompleteResultSchema = ResultSchema.extend({
4582
+ completion: looseObject({
4583
+ values: array(string2()).max(100),
4584
+ total: optional(number2().int()),
4585
+ hasMore: optional(boolean2())
4586
+ })
4587
+ });
4588
+ var RootSchema = object({
4589
+ uri: string2().startsWith("file://"),
4590
+ name: string2().optional(),
4591
+ _meta: record(string2(), unknown()).optional()
4592
+ });
4593
+ var ListRootsRequestSchema = RequestSchema.extend({
4594
+ method: literal("roots/list"),
4595
+ params: BaseRequestParamsSchema.optional()
4596
+ });
4597
+ var ListRootsResultSchema = ResultSchema.extend({
4598
+ roots: array(RootSchema)
4599
+ });
4600
+ var RootsListChangedNotificationSchema = NotificationSchema.extend({
4601
+ method: literal("notifications/roots/list_changed"),
4602
+ params: NotificationsParamsSchema.optional()
4603
+ });
4604
+ var ClientRequestSchema = union([
4605
+ PingRequestSchema,
4606
+ InitializeRequestSchema,
4607
+ CompleteRequestSchema,
4608
+ SetLevelRequestSchema,
4609
+ GetPromptRequestSchema,
4610
+ ListPromptsRequestSchema,
4611
+ ListResourcesRequestSchema,
4612
+ ListResourceTemplatesRequestSchema,
4613
+ ReadResourceRequestSchema,
4614
+ SubscribeRequestSchema,
4615
+ UnsubscribeRequestSchema,
4616
+ CallToolRequestSchema,
4617
+ ListToolsRequestSchema,
4618
+ GetTaskRequestSchema,
4619
+ GetTaskPayloadRequestSchema,
4620
+ ListTasksRequestSchema,
4621
+ CancelTaskRequestSchema
4622
+ ]);
4623
+ var ClientNotificationSchema = union([
4624
+ CancelledNotificationSchema,
4625
+ ProgressNotificationSchema,
4626
+ InitializedNotificationSchema,
4627
+ RootsListChangedNotificationSchema,
4628
+ TaskStatusNotificationSchema
4629
+ ]);
4630
+ var ClientResultSchema = union([
4631
+ EmptyResultSchema,
4632
+ CreateMessageResultSchema,
4633
+ CreateMessageResultWithToolsSchema,
4634
+ ElicitResultSchema,
4635
+ ListRootsResultSchema,
4636
+ GetTaskResultSchema,
4637
+ ListTasksResultSchema,
4638
+ CreateTaskResultSchema
4639
+ ]);
4640
+ var ServerRequestSchema = union([
4641
+ PingRequestSchema,
4642
+ CreateMessageRequestSchema,
4643
+ ElicitRequestSchema,
4644
+ ListRootsRequestSchema,
4645
+ GetTaskRequestSchema,
4646
+ GetTaskPayloadRequestSchema,
4647
+ ListTasksRequestSchema,
4648
+ CancelTaskRequestSchema
4649
+ ]);
4650
+ var ServerNotificationSchema = union([
4651
+ CancelledNotificationSchema,
4652
+ ProgressNotificationSchema,
4653
+ LoggingMessageNotificationSchema,
4654
+ ResourceUpdatedNotificationSchema,
4655
+ ResourceListChangedNotificationSchema,
4656
+ ToolListChangedNotificationSchema,
4657
+ PromptListChangedNotificationSchema,
4658
+ TaskStatusNotificationSchema,
4659
+ ElicitationCompleteNotificationSchema
4660
+ ]);
4661
+ var ServerResultSchema = union([
4662
+ EmptyResultSchema,
4663
+ InitializeResultSchema,
4664
+ CompleteResultSchema,
4665
+ GetPromptResultSchema,
4666
+ ListPromptsResultSchema,
4667
+ ListResourcesResultSchema,
4668
+ ListResourceTemplatesResultSchema,
4669
+ ReadResourceResultSchema,
4670
+ CallToolResultSchema,
4671
+ ListToolsResultSchema,
4672
+ GetTaskResultSchema,
4673
+ ListTasksResultSchema,
4674
+ CreateTaskResultSchema
4675
+ ]);
4676
+
4677
+ class McpError extends Error {
4678
+ constructor(code, message, data) {
4679
+ super(`MCP error ${code}: ${message}`);
4680
+ this.code = code;
4681
+ this.data = data;
4682
+ this.name = "McpError";
4683
+ }
4684
+ static fromError(code, message, data) {
4685
+ if (code === ErrorCode.UrlElicitationRequired && data) {
4686
+ const errorData = data;
4687
+ if (errorData.elicitations) {
4688
+ return new UrlElicitationRequiredError(errorData.elicitations, message);
4689
+ }
4690
+ }
4691
+ return new McpError(code, message, data);
4692
+ }
4693
+ }
4694
+
4695
+ class UrlElicitationRequiredError extends McpError {
4696
+ constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? "s" : ""} required`) {
4697
+ super(ErrorCode.UrlElicitationRequired, message, {
4698
+ elicitations
4699
+ });
4700
+ }
4701
+ get elicitations() {
4702
+ return this.data?.elicitations ?? [];
4703
+ }
4704
+ }
4705
+
4706
+ export { NEVER, safeParse, string2 as string, url, number2 as number, boolean2 as boolean, any, array, object, looseObject, literal, ZodIssueCode, exports_coerce, LATEST_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, isTaskAugmentedRequestParams, isJSONRPCRequest, isJSONRPCNotification, isJSONRPCResultResponse, ErrorCode, isJSONRPCErrorResponse, JSONRPCMessageSchema, EmptyResultSchema, CancelledNotificationSchema, InitializeResultSchema, isInitializedNotification, PingRequestSchema, ProgressNotificationSchema, CreateTaskResultSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ListResourcesResultSchema, ListResourceTemplatesResultSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, ListPromptsResultSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ListToolsResultSchema, CallToolResultSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, CreateMessageRequestSchema, CreateMessageResultSchema, ElicitRequestSchema, ElicitResultSchema, CompleteResultSchema, McpError };
4707
+
4708
+ //# debugId=B0F3814A2BD2D0FE64756E2164756E21