mlform 0.1.3 → 0.1.4

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 (305) hide show
  1. package/README.md +224 -152
  2. package/dist/design-system-CrrSGfFB.js +1352 -0
  3. package/dist/engine-nnhWPT2L.js +5301 -0
  4. package/dist/kit-Dt_1Fxlc.js +76 -0
  5. package/dist/mlform/design-system.mjs +2 -0
  6. package/dist/mlform/engine.mjs +3 -0
  7. package/dist/mlform/kit.mjs +3 -0
  8. package/dist/mlform/primitives.mjs +2 -0
  9. package/dist/mlform/questionnaire.mjs +640 -0
  10. package/dist/mlform/transport.mjs +2 -0
  11. package/dist/mlform.mjs +4 -717
  12. package/dist/primitives-Pi-ztAr6.js +5063 -0
  13. package/dist/transport-A1RsnZhD.js +2143 -0
  14. package/dist/types/src/design-system/constants.d.ts +34 -0
  15. package/dist/types/src/design-system/contract/component-keys.d.ts +2 -0
  16. package/dist/types/src/design-system/contract/component-tokens.d.ts +5 -0
  17. package/dist/types/src/design-system/contract/global-tokens.d.ts +7 -0
  18. package/dist/types/src/design-system/contract/index.d.ts +4 -0
  19. package/dist/types/src/design-system/contract/token-keys.d.ts +12 -0
  20. package/dist/types/src/design-system/index.d.ts +8 -0
  21. package/dist/types/src/design-system/recipes/contrast.d.ts +2 -0
  22. package/dist/types/src/design-system/recipes/default.d.ts +2 -0
  23. package/dist/types/src/design-system/recipes/index.d.ts +4 -0
  24. package/dist/types/src/design-system/recipes/minimal.d.ts +2 -0
  25. package/dist/types/src/design-system/recipes/soft.d.ts +2 -0
  26. package/dist/types/src/design-system/registry/builtins.d.ts +5 -0
  27. package/dist/types/src/design-system/registry/create-registry.d.ts +2 -0
  28. package/dist/types/src/design-system/registry/deep-freeze.d.ts +5 -0
  29. package/dist/types/src/design-system/registry/define-recipe.d.ts +2 -0
  30. package/dist/types/src/design-system/registry/define-theme.d.ts +2 -0
  31. package/dist/types/src/design-system/registry/define-token-maps.d.ts +6 -0
  32. package/dist/types/src/design-system/registry/index.d.ts +5 -0
  33. package/dist/types/src/design-system/resolve/diagnostics.d.ts +9 -0
  34. package/dist/types/src/design-system/resolve/index.d.ts +5 -0
  35. package/dist/types/src/design-system/resolve/merge-config.d.ts +2 -0
  36. package/dist/types/src/design-system/resolve/migrate-tokens.d.ts +44 -0
  37. package/dist/types/src/design-system/resolve/resolve-mode.d.ts +6 -0
  38. package/dist/types/src/design-system/resolve/resolve-recipe.d.ts +2 -0
  39. package/dist/types/src/design-system/resolve/resolve-theme.d.ts +2 -0
  40. package/dist/types/src/design-system/resolve/resolve-tokens.d.ts +2 -0
  41. package/dist/types/src/design-system/runtime/apply-tokens.d.ts +4 -0
  42. package/dist/types/src/design-system/runtime/attach-design-system.d.ts +11 -0
  43. package/dist/types/src/design-system/runtime/create-stylesheet.d.ts +11 -0
  44. package/dist/types/src/design-system/runtime/declarations.d.ts +5 -0
  45. package/dist/types/src/design-system/runtime/design-system-controller.d.ts +9 -0
  46. package/dist/types/src/design-system/runtime/host-state.d.ts +3 -0
  47. package/dist/types/src/design-system/runtime/hydrate-design-system.d.ts +25 -0
  48. package/dist/types/src/design-system/runtime/index.d.ts +8 -0
  49. package/dist/types/src/design-system/themes/cobalt.d.ts +2 -0
  50. package/dist/types/src/design-system/themes/graphite.d.ts +2 -0
  51. package/dist/types/src/design-system/themes/index.d.ts +5 -0
  52. package/dist/types/src/design-system/themes/neutral.d.ts +2 -0
  53. package/dist/types/src/design-system/themes/sage.d.ts +2 -0
  54. package/dist/types/src/design-system/themes/sunset.d.ts +2 -0
  55. package/dist/types/src/design-system/tokens/base.d.ts +5 -0
  56. package/dist/types/src/design-system/tokens/contrast.d.ts +8 -0
  57. package/dist/types/src/design-system/tokens/density.d.ts +9 -0
  58. package/dist/types/src/design-system/tokens/forced-colors.d.ts +12 -0
  59. package/dist/types/src/design-system/tokens/index.d.ts +5 -0
  60. package/dist/types/src/design-system/tokens/motion.d.ts +2 -0
  61. package/dist/types/src/design-system/types.d.ts +225 -0
  62. package/dist/types/src/engine/builtins/fields/boolean.d.ts +8 -0
  63. package/dist/types/src/engine/builtins/fields/category.d.ts +11 -0
  64. package/dist/types/src/engine/builtins/fields/date.d.ts +9 -0
  65. package/dist/types/src/engine/builtins/fields/long-text.d.ts +10 -0
  66. package/dist/types/src/engine/builtins/fields/multi-choice.d.ts +12 -0
  67. package/dist/types/src/engine/builtins/fields/number.d.ts +11 -0
  68. package/dist/types/src/engine/builtins/fields/rating.d.ts +9 -0
  69. package/dist/types/src/engine/builtins/fields/series.d.ts +20 -0
  70. package/dist/types/src/engine/builtins/fields/single-choice.d.ts +12 -0
  71. package/dist/types/src/engine/builtins/fields/text.d.ts +10 -0
  72. package/dist/types/src/engine/builtins/index.d.ts +97 -0
  73. package/dist/types/src/engine/builtins/reports/classifier.d.ts +8 -0
  74. package/dist/types/src/engine/builtins/reports/regressor.d.ts +8 -0
  75. package/dist/types/src/engine/builtins/shared.d.ts +49 -0
  76. package/dist/types/src/engine/comparison.d.ts +2 -0
  77. package/dist/types/src/engine/constants.d.ts +51 -0
  78. package/dist/types/src/engine/declarative/explanation.d.ts +2 -0
  79. package/dist/types/src/engine/declarative/field.d.ts +2 -0
  80. package/dist/types/src/engine/declarative/presentation.d.ts +61 -0
  81. package/dist/types/src/engine/declarative/report.d.ts +2 -0
  82. package/dist/types/src/engine/equality.d.ts +4 -0
  83. package/dist/types/src/engine/errors.d.ts +28 -0
  84. package/dist/types/src/engine/explanations/controller.d.ts +13 -0
  85. package/dist/types/src/engine/explanations/index.d.ts +1 -0
  86. package/dist/types/src/engine/fields/controller.d.ts +30 -0
  87. package/dist/types/src/engine/fields/index.d.ts +1 -0
  88. package/dist/types/src/engine/form.d.ts +2 -0
  89. package/dist/types/src/engine/index.d.ts +11 -0
  90. package/dist/types/src/engine/paths.d.ts +2 -0
  91. package/dist/types/src/engine/registry/index.d.ts +26 -0
  92. package/dist/types/src/engine/reports/controller.d.ts +19 -0
  93. package/dist/types/src/engine/reports/index.d.ts +1 -0
  94. package/dist/types/src/engine/schema/index.d.ts +7 -0
  95. package/dist/types/src/engine/state/engine.d.ts +60 -0
  96. package/dist/types/src/engine/state/index.d.ts +3 -0
  97. package/dist/types/src/engine/state/snapshots.d.ts +5 -0
  98. package/dist/types/src/engine/state/store.d.ts +13 -0
  99. package/dist/types/src/engine/submission/abort.d.ts +15 -0
  100. package/dist/types/src/engine/submission/explanations.d.ts +2 -0
  101. package/dist/types/src/engine/submission/index.d.ts +5 -0
  102. package/dist/types/src/engine/submission/lifecycle.d.ts +16 -0
  103. package/dist/types/src/engine/submission/pipeline.d.ts +2 -0
  104. package/dist/types/src/engine/submission/reports.d.ts +12 -0
  105. package/dist/types/src/engine/submission/request.d.ts +23 -0
  106. package/dist/types/src/engine/submission/result.d.ts +4 -0
  107. package/dist/types/src/engine/submission/submitter.d.ts +40 -0
  108. package/dist/types/src/engine/types/explanation.d.ts +109 -0
  109. package/dist/types/src/engine/types/field.d.ts +172 -0
  110. package/dist/types/src/engine/types/form.d.ts +120 -0
  111. package/dist/types/src/engine/types/index.d.ts +9 -0
  112. package/dist/types/src/engine/types/pipeline.d.ts +31 -0
  113. package/dist/types/src/engine/types/registry.d.ts +17 -0
  114. package/dist/types/src/engine/types/report.d.ts +87 -0
  115. package/dist/types/src/engine/types/transport.d.ts +41 -0
  116. package/dist/types/src/engine/utils.d.ts +9 -0
  117. package/dist/types/src/engine/validation/conditions.d.ts +11 -0
  118. package/dist/types/src/engine/validation/field.d.ts +29 -0
  119. package/dist/types/src/engine/validation/form.d.ts +35 -0
  120. package/dist/types/src/engine/validation/index.d.ts +3 -0
  121. package/dist/types/src/engine/values.d.ts +2 -0
  122. package/dist/types/src/index.d.ts +7 -0
  123. package/dist/types/src/kit/constants.d.ts +4 -0
  124. package/dist/types/src/kit/defaults.d.ts +11 -0
  125. package/dist/types/src/kit/index.d.ts +4 -0
  126. package/dist/types/src/kit/mount-form.d.ts +3 -0
  127. package/dist/types/src/kit/types.d.ts +52 -0
  128. package/dist/types/src/primitives/base-async-report-element.d.ts +19 -0
  129. package/dist/types/src/primitives/base-explanation-element.d.ts +21 -0
  130. package/dist/types/src/primitives/base-field-element.d.ts +21 -0
  131. package/dist/types/src/primitives/base-report-element.d.ts +15 -0
  132. package/dist/types/src/primitives/components/declarative-explanation.d.ts +5 -0
  133. package/dist/types/src/primitives/components/declarative-field.d.ts +6 -0
  134. package/dist/types/src/primitives/components/declarative-report.d.ts +5 -0
  135. package/dist/types/src/primitives/components/explanation-panel.d.ts +22 -0
  136. package/dist/types/src/primitives/components/field-frame.d.ts +21 -0
  137. package/dist/types/src/primitives/components/form-errors.d.ts +19 -0
  138. package/dist/types/src/primitives/components/form-root.d.ts +29 -0
  139. package/dist/types/src/primitives/components/presentation.d.ts +4 -0
  140. package/dist/types/src/primitives/components/report-frame.d.ts +22 -0
  141. package/dist/types/src/primitives/components/submit-button.d.ts +21 -0
  142. package/dist/types/src/primitives/components/unsupported-component.d.ts +14 -0
  143. package/dist/types/src/primitives/constants.d.ts +94 -0
  144. package/dist/types/src/primitives/controller-binding.d.ts +32 -0
  145. package/dist/types/src/primitives/fields/boolean-field.d.ts +6 -0
  146. package/dist/types/src/primitives/fields/category-field.d.ts +6 -0
  147. package/dist/types/src/primitives/fields/date-field.d.ts +6 -0
  148. package/dist/types/src/primitives/fields/long-text-field.d.ts +6 -0
  149. package/dist/types/src/primitives/fields/multi-choice-field.d.ts +6 -0
  150. package/dist/types/src/primitives/fields/number-field.d.ts +8 -0
  151. package/dist/types/src/primitives/fields/rating-field.d.ts +6 -0
  152. package/dist/types/src/primitives/fields/series-field.d.ts +8 -0
  153. package/dist/types/src/primitives/fields/single-choice-field.d.ts +6 -0
  154. package/dist/types/src/primitives/fields/text-field.d.ts +6 -0
  155. package/dist/types/src/primitives/index.d.ts +8 -0
  156. package/dist/types/src/primitives/mount-form.d.ts +4 -0
  157. package/dist/types/src/primitives/register.d.ts +0 -0
  158. package/dist/types/src/primitives/registry.d.ts +3 -0
  159. package/dist/types/src/primitives/reports/classifier-report.d.ts +5 -0
  160. package/dist/types/src/primitives/reports/regressor-report.d.ts +5 -0
  161. package/dist/types/src/primitives/types.d.ts +128 -0
  162. package/dist/types/src/primitives/utils.d.ts +3 -0
  163. package/dist/types/src/questionnaire/constants.d.ts +31 -0
  164. package/dist/types/src/questionnaire/defaults.d.ts +8 -0
  165. package/dist/types/src/questionnaire/engine/controller.d.ts +12 -0
  166. package/dist/types/src/questionnaire/engine/schema.d.ts +9 -0
  167. package/dist/types/src/questionnaire/errors.d.ts +3 -0
  168. package/dist/types/src/questionnaire/index.d.ts +6 -0
  169. package/dist/types/src/questionnaire/mount.d.ts +3 -0
  170. package/dist/types/src/questionnaire/primitives/components/questionnaire-root.d.ts +23 -0
  171. package/dist/types/src/questionnaire/primitives/components/step-indicator.d.ts +14 -0
  172. package/dist/types/src/questionnaire/primitives/register.d.ts +0 -0
  173. package/dist/types/src/questionnaire/types.d.ts +69 -0
  174. package/dist/types/src/shared/errors.d.ts +3 -0
  175. package/dist/types/src/shared/index.d.ts +1 -0
  176. package/dist/types/src/transport/capabilities.d.ts +7 -0
  177. package/dist/types/src/transport/clone.d.ts +6 -0
  178. package/dist/types/src/transport/composition/fallback.d.ts +2 -0
  179. package/dist/types/src/transport/composition/fanout.d.ts +3 -0
  180. package/dist/types/src/transport/composition/hedged.d.ts +2 -0
  181. package/dist/types/src/transport/composition/index.d.ts +7 -0
  182. package/dist/types/src/transport/composition/load-balancing.d.ts +2 -0
  183. package/dist/types/src/transport/composition/pipeline.d.ts +2 -0
  184. package/dist/types/src/transport/composition/racing.d.ts +2 -0
  185. package/dist/types/src/transport/composition/routing.d.ts +3 -0
  186. package/dist/types/src/transport/constants.d.ts +34 -0
  187. package/dist/types/src/transport/errors.d.ts +36 -0
  188. package/dist/types/src/transport/index.d.ts +9 -0
  189. package/dist/types/src/transport/internal.d.ts +110 -0
  190. package/dist/types/src/transport/middleware/auth.d.ts +2 -0
  191. package/dist/types/src/transport/middleware/cache.d.ts +2 -0
  192. package/dist/types/src/transport/middleware/circuit-breaker.d.ts +2 -0
  193. package/dist/types/src/transport/middleware/dedup.d.ts +2 -0
  194. package/dist/types/src/transport/middleware/index.d.ts +12 -0
  195. package/dist/types/src/transport/middleware/logging.d.ts +2 -0
  196. package/dist/types/src/transport/middleware/metrics.d.ts +2 -0
  197. package/dist/types/src/transport/middleware/pipe.d.ts +2 -0
  198. package/dist/types/src/transport/middleware/rate-limit.d.ts +2 -0
  199. package/dist/types/src/transport/middleware/retry.d.ts +2 -0
  200. package/dist/types/src/transport/middleware/timeout.d.ts +2 -0
  201. package/dist/types/src/transport/middleware/tracing.d.ts +2 -0
  202. package/dist/types/src/transport/middleware/transform.d.ts +3 -0
  203. package/dist/types/src/transport/policy-context.d.ts +3 -0
  204. package/dist/types/src/transport/protocols/graphql.d.ts +2 -0
  205. package/dist/types/src/transport/protocols/grpc.d.ts +5 -0
  206. package/dist/types/src/transport/protocols/index.d.ts +5 -0
  207. package/dist/types/src/transport/protocols/json.d.ts +2 -0
  208. package/dist/types/src/transport/protocols/sse.d.ts +2 -0
  209. package/dist/types/src/transport/protocols/websocket.d.ts +2 -0
  210. package/dist/types/src/transport/runtime.d.ts +4 -0
  211. package/dist/types/src/transport/state/cache-store.d.ts +2 -0
  212. package/dist/types/src/transport/state/circuit-breaker.d.ts +2 -0
  213. package/dist/types/src/transport/state/health.d.ts +2 -0
  214. package/dist/types/src/transport/state/index.d.ts +5 -0
  215. package/dist/types/src/transport/state/rate-limiter.d.ts +2 -0
  216. package/dist/types/src/transport/state/session.d.ts +2 -0
  217. package/dist/types/src/transport/types/capabilities.d.ts +35 -0
  218. package/dist/types/src/transport/types/core.d.ts +57 -0
  219. package/dist/types/src/transport/types/events.d.ts +50 -0
  220. package/dist/types/src/transport/types/index.d.ts +7 -0
  221. package/dist/types/src/transport/types/middleware.d.ts +3 -0
  222. package/dist/types/src/transport/types/options.d.ts +258 -0
  223. package/dist/types/src/transport/types/session.d.ts +48 -0
  224. package/dist/types/src/transport/types/state.d.ts +46 -0
  225. package/package.json +71 -59
  226. package/dist/FieldStrategy-CW2h8YyB.js +0 -2427
  227. package/dist/ModelTypes-B9_veCKB.js +0 -5
  228. package/dist/ReportStrategy-CxPzs4b2.js +0 -23
  229. package/dist/boolean-field-Dwz0ejWl.js +0 -104
  230. package/dist/category-field-DIgX--Px.js +0 -73
  231. package/dist/classifier-prediction-DgiEREf_.js +0 -193
  232. package/dist/custom-element-DFxkZ1wU.js +0 -8
  233. package/dist/date-field-91U2Xe46.js +0 -162
  234. package/dist/error-card-DHdkE18B.js +0 -195
  235. package/dist/field-wrapper-CBmpN5T_.js +0 -177
  236. package/dist/ml-layout-BJax9HVW.js +0 -332
  237. package/dist/mlform/extensions.mjs +0 -38
  238. package/dist/mlform/strategies.mjs +0 -292
  239. package/dist/number-field-Bcp45dJb.js +0 -164
  240. package/dist/property-B2UZ3Oii.js +0 -536
  241. package/dist/range-field-CD0kkCt0.js +0 -98
  242. package/dist/regressor-prediction-CPzZXlmA.js +0 -236
  243. package/dist/src/core/app/DescriptorItem.d.ts +0 -6
  244. package/dist/src/core/app/DescriptorRegistry.d.ts +0 -13
  245. package/dist/src/core/app/DescriptorService.d.ts +0 -22
  246. package/dist/src/core/app/DescriptorStrategy.d.ts +0 -11
  247. package/dist/src/core/app/index.d.ts +0 -4
  248. package/dist/src/core/domain/index.d.ts +0 -25
  249. package/dist/src/core/index.d.ts +0 -3
  250. package/dist/src/core/ui/error-card.d.ts +0 -38
  251. package/dist/src/core/ui/field-wrapper.d.ts +0 -23
  252. package/dist/src/core/ui/index.d.ts +0 -3
  253. package/dist/src/core/ui/ml-layout.d.ts +0 -23
  254. package/dist/src/extensions/app/FieldStrategy.d.ts +0 -10
  255. package/dist/src/extensions/app/ReportStrategy.d.ts +0 -9
  256. package/dist/src/extensions/app/index.d.ts +0 -2
  257. package/dist/src/extensions/domain/BaseField.d.ts +0 -7
  258. package/dist/src/extensions/domain/BaseModel.d.ts +0 -6
  259. package/dist/src/extensions/domain/index.d.ts +0 -2
  260. package/dist/src/extensions/index.d.ts +0 -3
  261. package/dist/src/extensions/ui/field-element.d.ts +0 -9
  262. package/dist/src/extensions/ui/index.d.ts +0 -1
  263. package/dist/src/index.d.ts +0 -1
  264. package/dist/src/mlform/index.d.ts +0 -1
  265. package/dist/src/mlform/mlform.d.ts +0 -27
  266. package/dist/src/mlform/mlform.types.d.ts +0 -11
  267. package/dist/src/strategies/app/BooleanStrategy.d.ts +0 -12
  268. package/dist/src/strategies/app/CategoryStrategy.d.ts +0 -13
  269. package/dist/src/strategies/app/ClassifierStrategy.d.ts +0 -15
  270. package/dist/src/strategies/app/DateStrategy.d.ts +0 -15
  271. package/dist/src/strategies/app/NumberStrategy.d.ts +0 -29
  272. package/dist/src/strategies/app/RegressorStrategy.d.ts +0 -15
  273. package/dist/src/strategies/app/TextStrategy.d.ts +0 -16
  274. package/dist/src/strategies/app/index.d.ts +0 -7
  275. package/dist/src/strategies/domain/BooleanField.d.ts +0 -10
  276. package/dist/src/strategies/domain/CategoryField.d.ts +0 -11
  277. package/dist/src/strategies/domain/ClassifierModel.d.ts +0 -11
  278. package/dist/src/strategies/domain/DateField.d.ts +0 -13
  279. package/dist/src/strategies/domain/FieldTypes.d.ts +0 -7
  280. package/dist/src/strategies/domain/ModelTypes.d.ts +0 -4
  281. package/dist/src/strategies/domain/NumberField.d.ts +0 -15
  282. package/dist/src/strategies/domain/RegressorModel.d.ts +0 -11
  283. package/dist/src/strategies/domain/TextField.d.ts +0 -14
  284. package/dist/src/strategies/domain/index.d.ts +0 -9
  285. package/dist/src/strategies/index.d.ts +0 -1
  286. package/dist/src/strategies/ui/boolean-field.d.ts +0 -13
  287. package/dist/src/strategies/ui/category-field.d.ts +0 -14
  288. package/dist/src/strategies/ui/classifier-prediction.d.ts +0 -39
  289. package/dist/src/strategies/ui/date-field.d.ts +0 -18
  290. package/dist/src/strategies/ui/index.d.ts +0 -8
  291. package/dist/src/strategies/ui/number-field.d.ts +0 -19
  292. package/dist/src/strategies/ui/range-field.d.ts +0 -17
  293. package/dist/src/strategies/ui/regressor-prediction.d.ts +0 -29
  294. package/dist/src/strategies/ui/text-field.d.ts +0 -17
  295. package/dist/state-Ba1Gr1cr.js +0 -7
  296. package/dist/test/_fixtures/DummyField.d.ts +0 -9
  297. package/dist/test/integration/lifecycle.integration.test.d.ts +0 -1
  298. package/dist/test/integration/registration.integration.test.d.ts +0 -1
  299. package/dist/test/integration/state.integration.test.d.ts +0 -1
  300. package/dist/test/integration/validation.integration.test.d.ts +0 -1
  301. package/dist/test/setup.d.ts +0 -1
  302. package/dist/test/unit/DummyField.test.d.ts +0 -1
  303. package/dist/test/unit/Strategies.extensions.test.d.ts +0 -1
  304. package/dist/test/unit/Strategies.test.d.ts +0 -1
  305. package/dist/text-field-CSBBr4gN.js +0 -114
@@ -1,2427 +0,0 @@
1
- function u(e, n, t) {
2
- function r(s, a) {
3
- var l;
4
- Object.defineProperty(s, "_zod", {
5
- value: s._zod ?? {},
6
- enumerable: !1
7
- }), (l = s._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), s._zod.traits.add(e), n(s, a);
8
- for (const f in c.prototype)
9
- f in s || Object.defineProperty(s, f, { value: c.prototype[f].bind(s) });
10
- s._zod.constr = c, s._zod.def = a;
11
- }
12
- const o = t?.Parent ?? Object;
13
- class i extends o {
14
- }
15
- Object.defineProperty(i, "name", { value: e });
16
- function c(s) {
17
- var a;
18
- const l = t?.Parent ? new i() : this;
19
- r(l, s), (a = l._zod).deferred ?? (a.deferred = []);
20
- for (const f of l._zod.deferred)
21
- f();
22
- return l;
23
- }
24
- return Object.defineProperty(c, "init", { value: r }), Object.defineProperty(c, Symbol.hasInstance, {
25
- value: (s) => t?.Parent && s instanceof t.Parent ? !0 : s?._zod?.traits?.has(e)
26
- }), Object.defineProperty(c, "name", { value: e }), c;
27
- }
28
- class S extends Error {
29
- constructor() {
30
- super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
31
- }
32
- }
33
- class Se extends Error {
34
- constructor(n) {
35
- super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
36
- }
37
- }
38
- const Ne = {};
39
- function E(e) {
40
- return Ne;
41
- }
42
- function cn(e) {
43
- const n = Object.values(e).filter((r) => typeof r == "number");
44
- return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
45
- }
46
- function H(e, n) {
47
- return typeof n == "bigint" ? n.toString() : n;
48
- }
49
- function re(e) {
50
- return {
51
- get value() {
52
- {
53
- const n = e();
54
- return Object.defineProperty(this, "value", { value: n }), n;
55
- }
56
- }
57
- };
58
- }
59
- function oe(e) {
60
- return e == null;
61
- }
62
- function ie(e) {
63
- const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
64
- return e.slice(n, t);
65
- }
66
- function un(e, n) {
67
- const t = (e.toString().split(".")[1] || "").length, r = n.toString();
68
- let o = (r.split(".")[1] || "").length;
69
- if (o === 0 && /\d?e-\d?/.test(r)) {
70
- const a = r.match(/\d?e-(\d?)/);
71
- a?.[1] && (o = Number.parseInt(a[1]));
72
- }
73
- const i = t > o ? t : o, c = Number.parseInt(e.toFixed(i).replace(".", "")), s = Number.parseInt(n.toFixed(i).replace(".", ""));
74
- return c % s / 10 ** i;
75
- }
76
- const fe = Symbol("evaluating");
77
- function p(e, n, t) {
78
- let r;
79
- Object.defineProperty(e, n, {
80
- get() {
81
- if (r !== fe)
82
- return r === void 0 && (r = fe, r = t()), r;
83
- },
84
- set(o) {
85
- Object.defineProperty(e, n, {
86
- value: o
87
- // configurable: true,
88
- });
89
- },
90
- configurable: !0
91
- });
92
- }
93
- function T(e, n, t) {
94
- Object.defineProperty(e, n, {
95
- value: t,
96
- writable: !0,
97
- enumerable: !0,
98
- configurable: !0
99
- });
100
- }
101
- function P(...e) {
102
- const n = {};
103
- for (const t of e) {
104
- const r = Object.getOwnPropertyDescriptors(t);
105
- Object.assign(n, r);
106
- }
107
- return Object.defineProperties({}, n);
108
- }
109
- function pe(e) {
110
- return JSON.stringify(e);
111
- }
112
- const je = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
113
- };
114
- function V(e) {
115
- return typeof e == "object" && e !== null && !Array.isArray(e);
116
- }
117
- const sn = re(() => {
118
- if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
119
- return !1;
120
- try {
121
- const e = Function;
122
- return new e(""), !0;
123
- } catch {
124
- return !1;
125
- }
126
- });
127
- function x(e) {
128
- if (V(e) === !1)
129
- return !1;
130
- const n = e.constructor;
131
- if (n === void 0)
132
- return !0;
133
- const t = n.prototype;
134
- return !(V(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
135
- }
136
- function xe(e) {
137
- return x(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
138
- }
139
- const an = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
140
- function N(e) {
141
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
142
- }
143
- function I(e, n, t) {
144
- const r = new e._zod.constr(n ?? e._zod.def);
145
- return (!n || t?.parent) && (r._zod.parent = e), r;
146
- }
147
- function h(e) {
148
- const n = e;
149
- if (!n)
150
- return {};
151
- if (typeof n == "string")
152
- return { error: () => n };
153
- if (n?.message !== void 0) {
154
- if (n?.error !== void 0)
155
- throw new Error("Cannot specify both `message` and `error` params");
156
- n.error = n.message;
157
- }
158
- return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
159
- }
160
- function ln(e) {
161
- return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
162
- }
163
- const hn = {
164
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
165
- int32: [-2147483648, 2147483647],
166
- uint32: [0, 4294967295],
167
- float32: [-34028234663852886e22, 34028234663852886e22],
168
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
169
- };
170
- function fn(e, n) {
171
- const t = e._zod.def, r = P(e._zod.def, {
172
- get shape() {
173
- const o = {};
174
- for (const i in n) {
175
- if (!(i in t.shape))
176
- throw new Error(`Unrecognized key: "${i}"`);
177
- n[i] && (o[i] = t.shape[i]);
178
- }
179
- return T(this, "shape", o), o;
180
- },
181
- checks: []
182
- });
183
- return I(e, r);
184
- }
185
- function pn(e, n) {
186
- const t = e._zod.def, r = P(e._zod.def, {
187
- get shape() {
188
- const o = { ...e._zod.def.shape };
189
- for (const i in n) {
190
- if (!(i in t.shape))
191
- throw new Error(`Unrecognized key: "${i}"`);
192
- n[i] && delete o[i];
193
- }
194
- return T(this, "shape", o), o;
195
- },
196
- checks: []
197
- });
198
- return I(e, r);
199
- }
200
- function dn(e, n) {
201
- if (!x(n))
202
- throw new Error("Invalid input to extend: expected a plain object");
203
- const t = e._zod.def.checks;
204
- if (t && t.length > 0)
205
- throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
206
- const o = P(e._zod.def, {
207
- get shape() {
208
- const i = { ...e._zod.def.shape, ...n };
209
- return T(this, "shape", i), i;
210
- },
211
- checks: []
212
- });
213
- return I(e, o);
214
- }
215
- function mn(e, n) {
216
- if (!x(n))
217
- throw new Error("Invalid input to safeExtend: expected a plain object");
218
- const t = {
219
- ...e._zod.def,
220
- get shape() {
221
- const r = { ...e._zod.def.shape, ...n };
222
- return T(this, "shape", r), r;
223
- },
224
- checks: e._zod.def.checks
225
- };
226
- return I(e, t);
227
- }
228
- function _n(e, n) {
229
- const t = P(e._zod.def, {
230
- get shape() {
231
- const r = { ...e._zod.def.shape, ...n._zod.def.shape };
232
- return T(this, "shape", r), r;
233
- },
234
- get catchall() {
235
- return n._zod.def.catchall;
236
- },
237
- checks: []
238
- // delete existing checks
239
- });
240
- return I(e, t);
241
- }
242
- function gn(e, n, t) {
243
- const r = P(n._zod.def, {
244
- get shape() {
245
- const o = n._zod.def.shape, i = { ...o };
246
- if (t)
247
- for (const c in t) {
248
- if (!(c in o))
249
- throw new Error(`Unrecognized key: "${c}"`);
250
- t[c] && (i[c] = e ? new e({
251
- type: "optional",
252
- innerType: o[c]
253
- }) : o[c]);
254
- }
255
- else
256
- for (const c in o)
257
- i[c] = e ? new e({
258
- type: "optional",
259
- innerType: o[c]
260
- }) : o[c];
261
- return T(this, "shape", i), i;
262
- },
263
- checks: []
264
- });
265
- return I(n, r);
266
- }
267
- function vn(e, n, t) {
268
- const r = P(n._zod.def, {
269
- get shape() {
270
- const o = n._zod.def.shape, i = { ...o };
271
- if (t)
272
- for (const c in t) {
273
- if (!(c in i))
274
- throw new Error(`Unrecognized key: "${c}"`);
275
- t[c] && (i[c] = new e({
276
- type: "nonoptional",
277
- innerType: o[c]
278
- }));
279
- }
280
- else
281
- for (const c in o)
282
- i[c] = new e({
283
- type: "nonoptional",
284
- innerType: o[c]
285
- });
286
- return T(this, "shape", i), i;
287
- },
288
- checks: []
289
- });
290
- return I(n, r);
291
- }
292
- function O(e, n = 0) {
293
- if (e.aborted === !0)
294
- return !0;
295
- for (let t = n; t < e.issues.length; t++)
296
- if (e.issues[t]?.continue !== !0)
297
- return !0;
298
- return !1;
299
- }
300
- function ce(e, n) {
301
- return n.map((t) => {
302
- var r;
303
- return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
304
- });
305
- }
306
- function R(e) {
307
- return typeof e == "string" ? e : e?.message;
308
- }
309
- function A(e, n, t) {
310
- const r = { ...e, path: e.path ?? [] };
311
- if (!e.message) {
312
- const o = R(e.inst?._zod.def?.error?.(e)) ?? R(n?.error?.(e)) ?? R(t.customError?.(e)) ?? R(t.localeError?.(e)) ?? "Invalid input";
313
- r.message = o;
314
- }
315
- return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
316
- }
317
- function ue(e) {
318
- return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
319
- }
320
- function D(...e) {
321
- const [n, t, r] = e;
322
- return typeof n == "string" ? {
323
- message: n,
324
- code: "custom",
325
- input: t,
326
- inst: r
327
- } : { ...n };
328
- }
329
- const De = (e, n) => {
330
- e.name = "$ZodError", Object.defineProperty(e, "_zod", {
331
- value: e._zod,
332
- enumerable: !1
333
- }), Object.defineProperty(e, "issues", {
334
- value: n,
335
- enumerable: !1
336
- }), e.message = JSON.stringify(n, H, 2), Object.defineProperty(e, "toString", {
337
- value: () => e.message,
338
- enumerable: !1
339
- });
340
- }, Ce = u("$ZodError", De), Re = u("$ZodError", De, { Parent: Error });
341
- function zn(e, n = (t) => t.message) {
342
- const t = {}, r = [];
343
- for (const o of e.issues)
344
- o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
345
- return { formErrors: r, fieldErrors: t };
346
- }
347
- function bn(e, n = (t) => t.message) {
348
- const t = { _errors: [] }, r = (o) => {
349
- for (const i of o.issues)
350
- if (i.code === "invalid_union" && i.errors.length)
351
- i.errors.map((c) => r({ issues: c }));
352
- else if (i.code === "invalid_key")
353
- r({ issues: i.issues });
354
- else if (i.code === "invalid_element")
355
- r({ issues: i.issues });
356
- else if (i.path.length === 0)
357
- t._errors.push(n(i));
358
- else {
359
- let c = t, s = 0;
360
- for (; s < i.path.length; ) {
361
- const a = i.path[s];
362
- s === i.path.length - 1 ? (c[a] = c[a] || { _errors: [] }, c[a]._errors.push(n(i))) : c[a] = c[a] || { _errors: [] }, c = c[a], s++;
363
- }
364
- }
365
- };
366
- return r(e), t;
367
- }
368
- const se = (e) => (n, t, r, o) => {
369
- const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, c = n._zod.run({ value: t, issues: [] }, i);
370
- if (c instanceof Promise)
371
- throw new S();
372
- if (c.issues.length) {
373
- const s = new (o?.Err ?? e)(c.issues.map((a) => A(a, i, E())));
374
- throw je(s, o?.callee), s;
375
- }
376
- return c.value;
377
- }, ae = (e) => async (n, t, r, o) => {
378
- const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
379
- let c = n._zod.run({ value: t, issues: [] }, i);
380
- if (c instanceof Promise && (c = await c), c.issues.length) {
381
- const s = new (o?.Err ?? e)(c.issues.map((a) => A(a, i, E())));
382
- throw je(s, o?.callee), s;
383
- }
384
- return c.value;
385
- }, G = (e) => (n, t, r) => {
386
- const o = r ? { ...r, async: !1 } : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, o);
387
- if (i instanceof Promise)
388
- throw new S();
389
- return i.issues.length ? {
390
- success: !1,
391
- error: new (e ?? Ce)(i.issues.map((c) => A(c, o, E())))
392
- } : { success: !0, data: i.value };
393
- }, wn = /* @__PURE__ */ G(Re), J = (e) => async (n, t, r) => {
394
- const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
395
- let i = n._zod.run({ value: t, issues: [] }, o);
396
- return i instanceof Promise && (i = await i), i.issues.length ? {
397
- success: !1,
398
- error: new e(i.issues.map((c) => A(c, o, E())))
399
- } : { success: !0, data: i.value };
400
- }, kn = /* @__PURE__ */ J(Re), Zn = (e) => (n, t, r) => {
401
- const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
402
- return se(e)(n, t, o);
403
- }, $n = (e) => (n, t, r) => se(e)(n, t, r), yn = (e) => async (n, t, r) => {
404
- const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
405
- return ae(e)(n, t, o);
406
- }, In = (e) => async (n, t, r) => ae(e)(n, t, r), En = (e) => (n, t, r) => {
407
- const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
408
- return G(e)(n, t, o);
409
- }, An = (e) => (n, t, r) => G(e)(n, t, r), Tn = (e) => async (n, t, r) => {
410
- const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
411
- return J(e)(n, t, o);
412
- }, Pn = (e) => async (n, t, r) => J(e)(n, t, r), On = /^[cC][^\s-]{8,}$/, Sn = /^[0-9a-z]+$/, Nn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, jn = /^[0-9a-vA-V]{20}$/, xn = /^[A-Za-z0-9]{27}$/, Dn = /^[a-zA-Z0-9_-]{21}$/, Cn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Rn = /^([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})$/, de = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Fn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Un = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
413
- function Ln() {
414
- return new RegExp(Un, "u");
415
- }
416
- const Mn = /^(?:(?: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])$/, Vn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Wn = /^((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])$/, Bn = /^(([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])$/, Gn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Fe = /^[A-Za-z0-9_-]*$/, Jn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Kn = /^\+(?:[0-9]){6,14}[0-9]$/, Ue = "(?:(?:\\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])))", Yn = /* @__PURE__ */ new RegExp(`^${Ue}$`);
417
- function Le(e) {
418
- const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
419
- return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
420
- }
421
- function Xn(e) {
422
- return new RegExp(`^${Le(e)}$`);
423
- }
424
- function qn(e) {
425
- const n = Le({ precision: e.precision }), t = ["Z"];
426
- e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
427
- const r = `${n}(?:${t.join("|")})`;
428
- return new RegExp(`^${Ue}T(?:${r})$`);
429
- }
430
- const Hn = (e) => {
431
- const n = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
432
- return new RegExp(`^${n}$`);
433
- }, Qn = /^-?\d+$/, et = /^-?\d+(?:\.\d+)?/, nt = /^(?:true|false)$/i, tt = /^[^A-Z]*$/, rt = /^[^a-z]*$/, w = /* @__PURE__ */ u("$ZodCheck", (e, n) => {
434
- var t;
435
- e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
436
- }), Me = {
437
- number: "number",
438
- bigint: "bigint",
439
- object: "date"
440
- }, Ve = /* @__PURE__ */ u("$ZodCheckLessThan", (e, n) => {
441
- w.init(e, n);
442
- const t = Me[typeof n.value];
443
- e._zod.onattach.push((r) => {
444
- const o = r._zod.bag, i = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
445
- n.value < i && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
446
- }), e._zod.check = (r) => {
447
- (n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
448
- origin: t,
449
- code: "too_big",
450
- maximum: n.value,
451
- input: r.value,
452
- inclusive: n.inclusive,
453
- inst: e,
454
- continue: !n.abort
455
- });
456
- };
457
- }), We = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, n) => {
458
- w.init(e, n);
459
- const t = Me[typeof n.value];
460
- e._zod.onattach.push((r) => {
461
- const o = r._zod.bag, i = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
462
- n.value > i && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
463
- }), e._zod.check = (r) => {
464
- (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
465
- origin: t,
466
- code: "too_small",
467
- minimum: n.value,
468
- input: r.value,
469
- inclusive: n.inclusive,
470
- inst: e,
471
- continue: !n.abort
472
- });
473
- };
474
- }), ot = /* @__PURE__ */ u("$ZodCheckMultipleOf", (e, n) => {
475
- w.init(e, n), e._zod.onattach.push((t) => {
476
- var r;
477
- (r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
478
- }), e._zod.check = (t) => {
479
- if (typeof t.value != typeof n.value)
480
- throw new Error("Cannot mix number and bigint in multiple_of check.");
481
- (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : un(t.value, n.value) === 0) || t.issues.push({
482
- origin: typeof t.value,
483
- code: "not_multiple_of",
484
- divisor: n.value,
485
- input: t.value,
486
- inst: e,
487
- continue: !n.abort
488
- });
489
- };
490
- }), it = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, n) => {
491
- w.init(e, n), n.format = n.format || "float64";
492
- const t = n.format?.includes("int"), r = t ? "int" : "number", [o, i] = hn[n.format];
493
- e._zod.onattach.push((c) => {
494
- const s = c._zod.bag;
495
- s.format = n.format, s.minimum = o, s.maximum = i, t && (s.pattern = Qn);
496
- }), e._zod.check = (c) => {
497
- const s = c.value;
498
- if (t) {
499
- if (!Number.isInteger(s)) {
500
- c.issues.push({
501
- expected: r,
502
- format: n.format,
503
- code: "invalid_type",
504
- continue: !1,
505
- input: s,
506
- inst: e
507
- });
508
- return;
509
- }
510
- if (!Number.isSafeInteger(s)) {
511
- s > 0 ? c.issues.push({
512
- input: s,
513
- code: "too_big",
514
- maximum: Number.MAX_SAFE_INTEGER,
515
- note: "Integers must be within the safe integer range.",
516
- inst: e,
517
- origin: r,
518
- continue: !n.abort
519
- }) : c.issues.push({
520
- input: s,
521
- code: "too_small",
522
- minimum: Number.MIN_SAFE_INTEGER,
523
- note: "Integers must be within the safe integer range.",
524
- inst: e,
525
- origin: r,
526
- continue: !n.abort
527
- });
528
- return;
529
- }
530
- }
531
- s < o && c.issues.push({
532
- origin: "number",
533
- input: s,
534
- code: "too_small",
535
- minimum: o,
536
- inclusive: !0,
537
- inst: e,
538
- continue: !n.abort
539
- }), s > i && c.issues.push({
540
- origin: "number",
541
- input: s,
542
- code: "too_big",
543
- maximum: i,
544
- inst: e
545
- });
546
- };
547
- }), ct = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, n) => {
548
- var t;
549
- w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
550
- const o = r.value;
551
- return !oe(o) && o.length !== void 0;
552
- }), e._zod.onattach.push((r) => {
553
- const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
554
- n.maximum < o && (r._zod.bag.maximum = n.maximum);
555
- }), e._zod.check = (r) => {
556
- const o = r.value;
557
- if (o.length <= n.maximum)
558
- return;
559
- const c = ue(o);
560
- r.issues.push({
561
- origin: c,
562
- code: "too_big",
563
- maximum: n.maximum,
564
- inclusive: !0,
565
- input: o,
566
- inst: e,
567
- continue: !n.abort
568
- });
569
- };
570
- }), ut = /* @__PURE__ */ u("$ZodCheckMinLength", (e, n) => {
571
- var t;
572
- w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
573
- const o = r.value;
574
- return !oe(o) && o.length !== void 0;
575
- }), e._zod.onattach.push((r) => {
576
- const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
577
- n.minimum > o && (r._zod.bag.minimum = n.minimum);
578
- }), e._zod.check = (r) => {
579
- const o = r.value;
580
- if (o.length >= n.minimum)
581
- return;
582
- const c = ue(o);
583
- r.issues.push({
584
- origin: c,
585
- code: "too_small",
586
- minimum: n.minimum,
587
- inclusive: !0,
588
- input: o,
589
- inst: e,
590
- continue: !n.abort
591
- });
592
- };
593
- }), st = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, n) => {
594
- var t;
595
- w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
596
- const o = r.value;
597
- return !oe(o) && o.length !== void 0;
598
- }), e._zod.onattach.push((r) => {
599
- const o = r._zod.bag;
600
- o.minimum = n.length, o.maximum = n.length, o.length = n.length;
601
- }), e._zod.check = (r) => {
602
- const o = r.value, i = o.length;
603
- if (i === n.length)
604
- return;
605
- const c = ue(o), s = i > n.length;
606
- r.issues.push({
607
- origin: c,
608
- ...s ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
609
- inclusive: !0,
610
- exact: !0,
611
- input: r.value,
612
- inst: e,
613
- continue: !n.abort
614
- });
615
- };
616
- }), K = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, n) => {
617
- var t, r;
618
- w.init(e, n), e._zod.onattach.push((o) => {
619
- const i = o._zod.bag;
620
- i.format = n.format, n.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n.pattern));
621
- }), n.pattern ? (t = e._zod).check ?? (t.check = (o) => {
622
- n.pattern.lastIndex = 0, !n.pattern.test(o.value) && o.issues.push({
623
- origin: "string",
624
- code: "invalid_format",
625
- format: n.format,
626
- input: o.value,
627
- ...n.pattern ? { pattern: n.pattern.toString() } : {},
628
- inst: e,
629
- continue: !n.abort
630
- });
631
- }) : (r = e._zod).check ?? (r.check = () => {
632
- });
633
- }), at = /* @__PURE__ */ u("$ZodCheckRegex", (e, n) => {
634
- K.init(e, n), e._zod.check = (t) => {
635
- n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
636
- origin: "string",
637
- code: "invalid_format",
638
- format: "regex",
639
- input: t.value,
640
- pattern: n.pattern.toString(),
641
- inst: e,
642
- continue: !n.abort
643
- });
644
- };
645
- }), lt = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, n) => {
646
- n.pattern ?? (n.pattern = tt), K.init(e, n);
647
- }), ht = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, n) => {
648
- n.pattern ?? (n.pattern = rt), K.init(e, n);
649
- }), ft = /* @__PURE__ */ u("$ZodCheckIncludes", (e, n) => {
650
- w.init(e, n);
651
- const t = N(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
652
- n.pattern = r, e._zod.onattach.push((o) => {
653
- const i = o._zod.bag;
654
- i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
655
- }), e._zod.check = (o) => {
656
- o.value.includes(n.includes, n.position) || o.issues.push({
657
- origin: "string",
658
- code: "invalid_format",
659
- format: "includes",
660
- includes: n.includes,
661
- input: o.value,
662
- inst: e,
663
- continue: !n.abort
664
- });
665
- };
666
- }), pt = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, n) => {
667
- w.init(e, n);
668
- const t = new RegExp(`^${N(n.prefix)}.*`);
669
- n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
670
- const o = r._zod.bag;
671
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
672
- }), e._zod.check = (r) => {
673
- r.value.startsWith(n.prefix) || r.issues.push({
674
- origin: "string",
675
- code: "invalid_format",
676
- format: "starts_with",
677
- prefix: n.prefix,
678
- input: r.value,
679
- inst: e,
680
- continue: !n.abort
681
- });
682
- };
683
- }), dt = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, n) => {
684
- w.init(e, n);
685
- const t = new RegExp(`.*${N(n.suffix)}$`);
686
- n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
687
- const o = r._zod.bag;
688
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
689
- }), e._zod.check = (r) => {
690
- r.value.endsWith(n.suffix) || r.issues.push({
691
- origin: "string",
692
- code: "invalid_format",
693
- format: "ends_with",
694
- suffix: n.suffix,
695
- input: r.value,
696
- inst: e,
697
- continue: !n.abort
698
- });
699
- };
700
- }), mt = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, n) => {
701
- w.init(e, n), e._zod.check = (t) => {
702
- t.value = n.tx(t.value);
703
- };
704
- });
705
- class _t {
706
- constructor(n = []) {
707
- this.content = [], this.indent = 0, this && (this.args = n);
708
- }
709
- indented(n) {
710
- this.indent += 1, n(this), this.indent -= 1;
711
- }
712
- write(n) {
713
- if (typeof n == "function") {
714
- n(this, { execution: "sync" }), n(this, { execution: "async" });
715
- return;
716
- }
717
- const r = n.split(`
718
- `).filter((c) => c), o = Math.min(...r.map((c) => c.length - c.trimStart().length)), i = r.map((c) => c.slice(o)).map((c) => " ".repeat(this.indent * 2) + c);
719
- for (const c of i)
720
- this.content.push(c);
721
- }
722
- compile() {
723
- const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((i) => ` ${i}`)];
724
- return new n(...t, o.join(`
725
- `));
726
- }
727
- }
728
- const gt = {
729
- major: 4,
730
- minor: 1,
731
- patch: 12
732
- }, m = /* @__PURE__ */ u("$ZodType", (e, n) => {
733
- var t;
734
- e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = gt;
735
- const r = [...e._zod.def.checks ?? []];
736
- e._zod.traits.has("$ZodCheck") && r.unshift(e);
737
- for (const o of r)
738
- for (const i of o._zod.onattach)
739
- i(e);
740
- if (r.length === 0)
741
- (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
742
- e._zod.run = e._zod.parse;
743
- });
744
- else {
745
- const o = (c, s, a) => {
746
- let l = O(c), f;
747
- for (const z of s) {
748
- if (z._zod.def.when) {
749
- if (!z._zod.def.when(c))
750
- continue;
751
- } else if (l)
752
- continue;
753
- const d = c.issues.length, b = z._zod.check(c);
754
- if (b instanceof Promise && a?.async === !1)
755
- throw new S();
756
- if (f || b instanceof Promise)
757
- f = (f ?? Promise.resolve()).then(async () => {
758
- await b, c.issues.length !== d && (l || (l = O(c, d)));
759
- });
760
- else {
761
- if (c.issues.length === d)
762
- continue;
763
- l || (l = O(c, d));
764
- }
765
- }
766
- return f ? f.then(() => c) : c;
767
- }, i = (c, s, a) => {
768
- if (O(c))
769
- return c.aborted = !0, c;
770
- const l = o(s, r, a);
771
- if (l instanceof Promise) {
772
- if (a.async === !1)
773
- throw new S();
774
- return l.then((f) => e._zod.parse(f, a));
775
- }
776
- return e._zod.parse(l, a);
777
- };
778
- e._zod.run = (c, s) => {
779
- if (s.skipChecks)
780
- return e._zod.parse(c, s);
781
- if (s.direction === "backward") {
782
- const l = e._zod.parse({ value: c.value, issues: [] }, { ...s, skipChecks: !0 });
783
- return l instanceof Promise ? l.then((f) => i(f, c, s)) : i(l, c, s);
784
- }
785
- const a = e._zod.parse(c, s);
786
- if (a instanceof Promise) {
787
- if (s.async === !1)
788
- throw new S();
789
- return a.then((l) => o(l, r, s));
790
- }
791
- return o(a, r, s);
792
- };
793
- }
794
- e["~standard"] = {
795
- validate: (o) => {
796
- try {
797
- const i = wn(e, o);
798
- return i.success ? { value: i.data } : { issues: i.error?.issues };
799
- } catch {
800
- return kn(e, o).then((c) => c.success ? { value: c.data } : { issues: c.error?.issues });
801
- }
802
- },
803
- vendor: "zod",
804
- version: 1
805
- };
806
- }), le = /* @__PURE__ */ u("$ZodString", (e, n) => {
807
- m.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Hn(e._zod.bag), e._zod.parse = (t, r) => {
808
- if (n.coerce)
809
- try {
810
- t.value = String(t.value);
811
- } catch {
812
- }
813
- return typeof t.value == "string" || t.issues.push({
814
- expected: "string",
815
- code: "invalid_type",
816
- input: t.value,
817
- inst: e
818
- }), t;
819
- };
820
- }), _ = /* @__PURE__ */ u("$ZodStringFormat", (e, n) => {
821
- K.init(e, n), le.init(e, n);
822
- }), vt = /* @__PURE__ */ u("$ZodGUID", (e, n) => {
823
- n.pattern ?? (n.pattern = Rn), _.init(e, n);
824
- }), zt = /* @__PURE__ */ u("$ZodUUID", (e, n) => {
825
- if (n.version) {
826
- const r = {
827
- v1: 1,
828
- v2: 2,
829
- v3: 3,
830
- v4: 4,
831
- v5: 5,
832
- v6: 6,
833
- v7: 7,
834
- v8: 8
835
- }[n.version];
836
- if (r === void 0)
837
- throw new Error(`Invalid UUID version: "${n.version}"`);
838
- n.pattern ?? (n.pattern = de(r));
839
- } else
840
- n.pattern ?? (n.pattern = de());
841
- _.init(e, n);
842
- }), bt = /* @__PURE__ */ u("$ZodEmail", (e, n) => {
843
- n.pattern ?? (n.pattern = Fn), _.init(e, n);
844
- }), wt = /* @__PURE__ */ u("$ZodURL", (e, n) => {
845
- _.init(e, n), e._zod.check = (t) => {
846
- try {
847
- const r = t.value.trim(), o = new URL(r);
848
- n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(o.hostname) || t.issues.push({
849
- code: "invalid_format",
850
- format: "url",
851
- note: "Invalid hostname",
852
- pattern: Jn.source,
853
- input: t.value,
854
- inst: e,
855
- continue: !n.abort
856
- })), n.protocol && (n.protocol.lastIndex = 0, n.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || t.issues.push({
857
- code: "invalid_format",
858
- format: "url",
859
- note: "Invalid protocol",
860
- pattern: n.protocol.source,
861
- input: t.value,
862
- inst: e,
863
- continue: !n.abort
864
- })), n.normalize ? t.value = o.href : t.value = r;
865
- return;
866
- } catch {
867
- t.issues.push({
868
- code: "invalid_format",
869
- format: "url",
870
- input: t.value,
871
- inst: e,
872
- continue: !n.abort
873
- });
874
- }
875
- };
876
- }), kt = /* @__PURE__ */ u("$ZodEmoji", (e, n) => {
877
- n.pattern ?? (n.pattern = Ln()), _.init(e, n);
878
- }), Zt = /* @__PURE__ */ u("$ZodNanoID", (e, n) => {
879
- n.pattern ?? (n.pattern = Dn), _.init(e, n);
880
- }), $t = /* @__PURE__ */ u("$ZodCUID", (e, n) => {
881
- n.pattern ?? (n.pattern = On), _.init(e, n);
882
- }), yt = /* @__PURE__ */ u("$ZodCUID2", (e, n) => {
883
- n.pattern ?? (n.pattern = Sn), _.init(e, n);
884
- }), It = /* @__PURE__ */ u("$ZodULID", (e, n) => {
885
- n.pattern ?? (n.pattern = Nn), _.init(e, n);
886
- }), Et = /* @__PURE__ */ u("$ZodXID", (e, n) => {
887
- n.pattern ?? (n.pattern = jn), _.init(e, n);
888
- }), At = /* @__PURE__ */ u("$ZodKSUID", (e, n) => {
889
- n.pattern ?? (n.pattern = xn), _.init(e, n);
890
- }), Tt = /* @__PURE__ */ u("$ZodISODateTime", (e, n) => {
891
- n.pattern ?? (n.pattern = qn(n)), _.init(e, n);
892
- }), Pt = /* @__PURE__ */ u("$ZodISODate", (e, n) => {
893
- n.pattern ?? (n.pattern = Yn), _.init(e, n);
894
- }), Ot = /* @__PURE__ */ u("$ZodISOTime", (e, n) => {
895
- n.pattern ?? (n.pattern = Xn(n)), _.init(e, n);
896
- }), St = /* @__PURE__ */ u("$ZodISODuration", (e, n) => {
897
- n.pattern ?? (n.pattern = Cn), _.init(e, n);
898
- }), Nt = /* @__PURE__ */ u("$ZodIPv4", (e, n) => {
899
- n.pattern ?? (n.pattern = Mn), _.init(e, n), e._zod.onattach.push((t) => {
900
- const r = t._zod.bag;
901
- r.format = "ipv4";
902
- });
903
- }), jt = /* @__PURE__ */ u("$ZodIPv6", (e, n) => {
904
- n.pattern ?? (n.pattern = Vn), _.init(e, n), e._zod.onattach.push((t) => {
905
- const r = t._zod.bag;
906
- r.format = "ipv6";
907
- }), e._zod.check = (t) => {
908
- try {
909
- new URL(`http://[${t.value}]`);
910
- } catch {
911
- t.issues.push({
912
- code: "invalid_format",
913
- format: "ipv6",
914
- input: t.value,
915
- inst: e,
916
- continue: !n.abort
917
- });
918
- }
919
- };
920
- }), xt = /* @__PURE__ */ u("$ZodCIDRv4", (e, n) => {
921
- n.pattern ?? (n.pattern = Wn), _.init(e, n);
922
- }), Dt = /* @__PURE__ */ u("$ZodCIDRv6", (e, n) => {
923
- n.pattern ?? (n.pattern = Bn), _.init(e, n), e._zod.check = (t) => {
924
- const r = t.value.split("/");
925
- try {
926
- if (r.length !== 2)
927
- throw new Error();
928
- const [o, i] = r;
929
- if (!i)
930
- throw new Error();
931
- const c = Number(i);
932
- if (`${c}` !== i)
933
- throw new Error();
934
- if (c < 0 || c > 128)
935
- throw new Error();
936
- new URL(`http://[${o}]`);
937
- } catch {
938
- t.issues.push({
939
- code: "invalid_format",
940
- format: "cidrv6",
941
- input: t.value,
942
- inst: e,
943
- continue: !n.abort
944
- });
945
- }
946
- };
947
- });
948
- function Be(e) {
949
- if (e === "")
950
- return !0;
951
- if (e.length % 4 !== 0)
952
- return !1;
953
- try {
954
- return atob(e), !0;
955
- } catch {
956
- return !1;
957
- }
958
- }
959
- const Ct = /* @__PURE__ */ u("$ZodBase64", (e, n) => {
960
- n.pattern ?? (n.pattern = Gn), _.init(e, n), e._zod.onattach.push((t) => {
961
- t._zod.bag.contentEncoding = "base64";
962
- }), e._zod.check = (t) => {
963
- Be(t.value) || t.issues.push({
964
- code: "invalid_format",
965
- format: "base64",
966
- input: t.value,
967
- inst: e,
968
- continue: !n.abort
969
- });
970
- };
971
- });
972
- function Rt(e) {
973
- if (!Fe.test(e))
974
- return !1;
975
- const n = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), t = n.padEnd(Math.ceil(n.length / 4) * 4, "=");
976
- return Be(t);
977
- }
978
- const Ft = /* @__PURE__ */ u("$ZodBase64URL", (e, n) => {
979
- n.pattern ?? (n.pattern = Fe), _.init(e, n), e._zod.onattach.push((t) => {
980
- t._zod.bag.contentEncoding = "base64url";
981
- }), e._zod.check = (t) => {
982
- Rt(t.value) || t.issues.push({
983
- code: "invalid_format",
984
- format: "base64url",
985
- input: t.value,
986
- inst: e,
987
- continue: !n.abort
988
- });
989
- };
990
- }), Ut = /* @__PURE__ */ u("$ZodE164", (e, n) => {
991
- n.pattern ?? (n.pattern = Kn), _.init(e, n);
992
- });
993
- function Lt(e, n = null) {
994
- try {
995
- const t = e.split(".");
996
- if (t.length !== 3)
997
- return !1;
998
- const [r] = t;
999
- if (!r)
1000
- return !1;
1001
- const o = JSON.parse(atob(r));
1002
- return !("typ" in o && o?.typ !== "JWT" || !o.alg || n && (!("alg" in o) || o.alg !== n));
1003
- } catch {
1004
- return !1;
1005
- }
1006
- }
1007
- const Mt = /* @__PURE__ */ u("$ZodJWT", (e, n) => {
1008
- _.init(e, n), e._zod.check = (t) => {
1009
- Lt(t.value, n.alg) || t.issues.push({
1010
- code: "invalid_format",
1011
- format: "jwt",
1012
- input: t.value,
1013
- inst: e,
1014
- continue: !n.abort
1015
- });
1016
- };
1017
- }), Ge = /* @__PURE__ */ u("$ZodNumber", (e, n) => {
1018
- m.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? et, e._zod.parse = (t, r) => {
1019
- if (n.coerce)
1020
- try {
1021
- t.value = Number(t.value);
1022
- } catch {
1023
- }
1024
- const o = t.value;
1025
- if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
1026
- return t;
1027
- const i = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
1028
- return t.issues.push({
1029
- expected: "number",
1030
- code: "invalid_type",
1031
- input: o,
1032
- inst: e,
1033
- ...i ? { received: i } : {}
1034
- }), t;
1035
- };
1036
- }), Vt = /* @__PURE__ */ u("$ZodNumber", (e, n) => {
1037
- it.init(e, n), Ge.init(e, n);
1038
- }), Wt = /* @__PURE__ */ u("$ZodBoolean", (e, n) => {
1039
- m.init(e, n), e._zod.pattern = nt, e._zod.parse = (t, r) => {
1040
- if (n.coerce)
1041
- try {
1042
- t.value = !!t.value;
1043
- } catch {
1044
- }
1045
- const o = t.value;
1046
- return typeof o == "boolean" || t.issues.push({
1047
- expected: "boolean",
1048
- code: "invalid_type",
1049
- input: o,
1050
- inst: e
1051
- }), t;
1052
- };
1053
- }), Bt = /* @__PURE__ */ u("$ZodUnknown", (e, n) => {
1054
- m.init(e, n), e._zod.parse = (t) => t;
1055
- }), Gt = /* @__PURE__ */ u("$ZodNever", (e, n) => {
1056
- m.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
1057
- expected: "never",
1058
- code: "invalid_type",
1059
- input: t.value,
1060
- inst: e
1061
- }), t);
1062
- });
1063
- function me(e, n, t) {
1064
- e.issues.length && n.issues.push(...ce(t, e.issues)), n.value[t] = e.value;
1065
- }
1066
- const Jt = /* @__PURE__ */ u("$ZodArray", (e, n) => {
1067
- m.init(e, n), e._zod.parse = (t, r) => {
1068
- const o = t.value;
1069
- if (!Array.isArray(o))
1070
- return t.issues.push({
1071
- expected: "array",
1072
- code: "invalid_type",
1073
- input: o,
1074
- inst: e
1075
- }), t;
1076
- t.value = Array(o.length);
1077
- const i = [];
1078
- for (let c = 0; c < o.length; c++) {
1079
- const s = o[c], a = n.element._zod.run({
1080
- value: s,
1081
- issues: []
1082
- }, r);
1083
- a instanceof Promise ? i.push(a.then((l) => me(l, t, c))) : me(a, t, c);
1084
- }
1085
- return i.length ? Promise.all(i).then(() => t) : t;
1086
- };
1087
- });
1088
- function W(e, n, t, r) {
1089
- e.issues.length && n.issues.push(...ce(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
1090
- }
1091
- function Je(e) {
1092
- const n = Object.keys(e.shape);
1093
- for (const r of n)
1094
- if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
1095
- throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1096
- const t = ln(e.shape);
1097
- return {
1098
- ...e,
1099
- keys: n,
1100
- keySet: new Set(n),
1101
- numKeys: n.length,
1102
- optionalKeys: new Set(t)
1103
- };
1104
- }
1105
- function Ke(e, n, t, r, o, i) {
1106
- const c = [], s = o.keySet, a = o.catchall._zod, l = a.def.type;
1107
- for (const f of Object.keys(n)) {
1108
- if (s.has(f))
1109
- continue;
1110
- if (l === "never") {
1111
- c.push(f);
1112
- continue;
1113
- }
1114
- const z = a.run({ value: n[f], issues: [] }, r);
1115
- z instanceof Promise ? e.push(z.then((d) => W(d, t, f, n))) : W(z, t, f, n);
1116
- }
1117
- return c.length && t.issues.push({
1118
- code: "unrecognized_keys",
1119
- keys: c,
1120
- input: n,
1121
- inst: i
1122
- }), e.length ? Promise.all(e).then(() => t) : t;
1123
- }
1124
- const Kt = /* @__PURE__ */ u("$ZodObject", (e, n) => {
1125
- if (m.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
1126
- const s = n.shape;
1127
- Object.defineProperty(n, "shape", {
1128
- get: () => {
1129
- const a = { ...s };
1130
- return Object.defineProperty(n, "shape", {
1131
- value: a
1132
- }), a;
1133
- }
1134
- });
1135
- }
1136
- const r = re(() => Je(n));
1137
- p(e._zod, "propValues", () => {
1138
- const s = n.shape, a = {};
1139
- for (const l in s) {
1140
- const f = s[l]._zod;
1141
- if (f.values) {
1142
- a[l] ?? (a[l] = /* @__PURE__ */ new Set());
1143
- for (const z of f.values)
1144
- a[l].add(z);
1145
- }
1146
- }
1147
- return a;
1148
- });
1149
- const o = V, i = n.catchall;
1150
- let c;
1151
- e._zod.parse = (s, a) => {
1152
- c ?? (c = r.value);
1153
- const l = s.value;
1154
- if (!o(l))
1155
- return s.issues.push({
1156
- expected: "object",
1157
- code: "invalid_type",
1158
- input: l,
1159
- inst: e
1160
- }), s;
1161
- s.value = {};
1162
- const f = [], z = c.shape;
1163
- for (const d of c.keys) {
1164
- const k = z[d]._zod.run({ value: l[d], issues: [] }, a);
1165
- k instanceof Promise ? f.push(k.then((Y) => W(Y, s, d, l))) : W(k, s, d, l);
1166
- }
1167
- return i ? Ke(f, l, s, a, r.value, e) : f.length ? Promise.all(f).then(() => s) : s;
1168
- };
1169
- }), Yt = /* @__PURE__ */ u("$ZodObjectJIT", (e, n) => {
1170
- Kt.init(e, n);
1171
- const t = e._zod.parse, r = re(() => Je(n)), o = (d) => {
1172
- const b = new _t(["shape", "payload", "ctx"]), k = r.value, Y = (y) => {
1173
- const $ = pe(y);
1174
- return `shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`;
1175
- };
1176
- b.write("const input = payload.value;");
1177
- const he = /* @__PURE__ */ Object.create(null);
1178
- let rn = 0;
1179
- for (const y of k.keys)
1180
- he[y] = `key_${rn++}`;
1181
- b.write("const newResult = {};");
1182
- for (const y of k.keys) {
1183
- const $ = he[y], j = pe(y);
1184
- b.write(`const ${$} = ${Y(y)};`), b.write(`
1185
- if (${$}.issues.length) {
1186
- payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
1187
- ...iss,
1188
- path: iss.path ? [${j}, ...iss.path] : [${j}]
1189
- })));
1190
- }
1191
-
1192
-
1193
- if (${$}.value === undefined) {
1194
- if (${j} in input) {
1195
- newResult[${j}] = undefined;
1196
- }
1197
- } else {
1198
- newResult[${j}] = ${$}.value;
1199
- }
1200
-
1201
- `);
1202
- }
1203
- b.write("payload.value = newResult;"), b.write("return payload;");
1204
- const on = b.compile();
1205
- return (y, $) => on(d, y, $);
1206
- };
1207
- let i;
1208
- const c = V, s = !Ne.jitless, l = s && sn.value, f = n.catchall;
1209
- let z;
1210
- e._zod.parse = (d, b) => {
1211
- z ?? (z = r.value);
1212
- const k = d.value;
1213
- return c(k) ? s && l && b?.async === !1 && b.jitless !== !0 ? (i || (i = o(n.shape)), d = i(d, b), f ? Ke([], k, d, b, z, e) : d) : t(d, b) : (d.issues.push({
1214
- expected: "object",
1215
- code: "invalid_type",
1216
- input: k,
1217
- inst: e
1218
- }), d);
1219
- };
1220
- });
1221
- function _e(e, n, t, r) {
1222
- for (const i of e)
1223
- if (i.issues.length === 0)
1224
- return n.value = i.value, n;
1225
- const o = e.filter((i) => !O(i));
1226
- return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
1227
- code: "invalid_union",
1228
- input: n.value,
1229
- inst: t,
1230
- errors: e.map((i) => i.issues.map((c) => A(c, r, E())))
1231
- }), n);
1232
- }
1233
- const Xt = /* @__PURE__ */ u("$ZodUnion", (e, n) => {
1234
- m.init(e, n), p(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), p(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), p(e._zod, "values", () => {
1235
- if (n.options.every((o) => o._zod.values))
1236
- return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
1237
- }), p(e._zod, "pattern", () => {
1238
- if (n.options.every((o) => o._zod.pattern)) {
1239
- const o = n.options.map((i) => i._zod.pattern);
1240
- return new RegExp(`^(${o.map((i) => ie(i.source)).join("|")})$`);
1241
- }
1242
- });
1243
- const t = n.options.length === 1, r = n.options[0]._zod.run;
1244
- e._zod.parse = (o, i) => {
1245
- if (t)
1246
- return r(o, i);
1247
- let c = !1;
1248
- const s = [];
1249
- for (const a of n.options) {
1250
- const l = a._zod.run({
1251
- value: o.value,
1252
- issues: []
1253
- }, i);
1254
- if (l instanceof Promise)
1255
- s.push(l), c = !0;
1256
- else {
1257
- if (l.issues.length === 0)
1258
- return l;
1259
- s.push(l);
1260
- }
1261
- }
1262
- return c ? Promise.all(s).then((a) => _e(a, o, e, i)) : _e(s, o, e, i);
1263
- };
1264
- }), qt = /* @__PURE__ */ u("$ZodIntersection", (e, n) => {
1265
- m.init(e, n), e._zod.parse = (t, r) => {
1266
- const o = t.value, i = n.left._zod.run({ value: o, issues: [] }, r), c = n.right._zod.run({ value: o, issues: [] }, r);
1267
- return i instanceof Promise || c instanceof Promise ? Promise.all([i, c]).then(([a, l]) => ge(t, a, l)) : ge(t, i, c);
1268
- };
1269
- });
1270
- function Q(e, n) {
1271
- if (e === n)
1272
- return { valid: !0, data: e };
1273
- if (e instanceof Date && n instanceof Date && +e == +n)
1274
- return { valid: !0, data: e };
1275
- if (x(e) && x(n)) {
1276
- const t = Object.keys(n), r = Object.keys(e).filter((i) => t.indexOf(i) !== -1), o = { ...e, ...n };
1277
- for (const i of r) {
1278
- const c = Q(e[i], n[i]);
1279
- if (!c.valid)
1280
- return {
1281
- valid: !1,
1282
- mergeErrorPath: [i, ...c.mergeErrorPath]
1283
- };
1284
- o[i] = c.data;
1285
- }
1286
- return { valid: !0, data: o };
1287
- }
1288
- if (Array.isArray(e) && Array.isArray(n)) {
1289
- if (e.length !== n.length)
1290
- return { valid: !1, mergeErrorPath: [] };
1291
- const t = [];
1292
- for (let r = 0; r < e.length; r++) {
1293
- const o = e[r], i = n[r], c = Q(o, i);
1294
- if (!c.valid)
1295
- return {
1296
- valid: !1,
1297
- mergeErrorPath: [r, ...c.mergeErrorPath]
1298
- };
1299
- t.push(c.data);
1300
- }
1301
- return { valid: !0, data: t };
1302
- }
1303
- return { valid: !1, mergeErrorPath: [] };
1304
- }
1305
- function ge(e, n, t) {
1306
- if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), O(e))
1307
- return e;
1308
- const r = Q(n.value, t.value);
1309
- if (!r.valid)
1310
- throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1311
- return e.value = r.data, e;
1312
- }
1313
- const Ht = /* @__PURE__ */ u("$ZodTuple", (e, n) => {
1314
- m.init(e, n);
1315
- const t = n.items, r = t.length - [...t].reverse().findIndex((o) => o._zod.optin !== "optional");
1316
- e._zod.parse = (o, i) => {
1317
- const c = o.value;
1318
- if (!Array.isArray(c))
1319
- return o.issues.push({
1320
- input: c,
1321
- inst: e,
1322
- expected: "tuple",
1323
- code: "invalid_type"
1324
- }), o;
1325
- o.value = [];
1326
- const s = [];
1327
- if (!n.rest) {
1328
- const l = c.length > t.length, f = c.length < r - 1;
1329
- if (l || f)
1330
- return o.issues.push({
1331
- ...l ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
1332
- input: c,
1333
- inst: e,
1334
- origin: "array"
1335
- }), o;
1336
- }
1337
- let a = -1;
1338
- for (const l of t) {
1339
- if (a++, a >= c.length && a >= r)
1340
- continue;
1341
- const f = l._zod.run({
1342
- value: c[a],
1343
- issues: []
1344
- }, i);
1345
- f instanceof Promise ? s.push(f.then((z) => F(z, o, a))) : F(f, o, a);
1346
- }
1347
- if (n.rest) {
1348
- const l = c.slice(t.length);
1349
- for (const f of l) {
1350
- a++;
1351
- const z = n.rest._zod.run({
1352
- value: f,
1353
- issues: []
1354
- }, i);
1355
- z instanceof Promise ? s.push(z.then((d) => F(d, o, a))) : F(z, o, a);
1356
- }
1357
- }
1358
- return s.length ? Promise.all(s).then(() => o) : o;
1359
- };
1360
- });
1361
- function F(e, n, t) {
1362
- e.issues.length && n.issues.push(...ce(t, e.issues)), n.value[t] = e.value;
1363
- }
1364
- const Qt = /* @__PURE__ */ u("$ZodEnum", (e, n) => {
1365
- m.init(e, n);
1366
- const t = cn(n.entries), r = new Set(t);
1367
- e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => an.has(typeof o)).map((o) => typeof o == "string" ? N(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1368
- const c = o.value;
1369
- return r.has(c) || o.issues.push({
1370
- code: "invalid_value",
1371
- values: t,
1372
- input: c,
1373
- inst: e
1374
- }), o;
1375
- };
1376
- }), er = /* @__PURE__ */ u("$ZodLiteral", (e, n) => {
1377
- if (m.init(e, n), n.values.length === 0)
1378
- throw new Error("Cannot create literal schema with no valid values");
1379
- e._zod.values = new Set(n.values), e._zod.pattern = new RegExp(`^(${n.values.map((t) => typeof t == "string" ? N(t) : t ? N(t.toString()) : String(t)).join("|")})$`), e._zod.parse = (t, r) => {
1380
- const o = t.value;
1381
- return e._zod.values.has(o) || t.issues.push({
1382
- code: "invalid_value",
1383
- values: n.values,
1384
- input: o,
1385
- inst: e
1386
- }), t;
1387
- };
1388
- }), nr = /* @__PURE__ */ u("$ZodTransform", (e, n) => {
1389
- m.init(e, n), e._zod.parse = (t, r) => {
1390
- if (r.direction === "backward")
1391
- throw new Se(e.constructor.name);
1392
- const o = n.transform(t.value, t);
1393
- if (r.async)
1394
- return (o instanceof Promise ? o : Promise.resolve(o)).then((c) => (t.value = c, t));
1395
- if (o instanceof Promise)
1396
- throw new S();
1397
- return t.value = o, t;
1398
- };
1399
- });
1400
- function ve(e, n) {
1401
- return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
1402
- }
1403
- const tr = /* @__PURE__ */ u("$ZodOptional", (e, n) => {
1404
- m.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", p(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), p(e._zod, "pattern", () => {
1405
- const t = n.innerType._zod.pattern;
1406
- return t ? new RegExp(`^(${ie(t.source)})?$`) : void 0;
1407
- }), e._zod.parse = (t, r) => {
1408
- if (n.innerType._zod.optin === "optional") {
1409
- const o = n.innerType._zod.run(t, r);
1410
- return o instanceof Promise ? o.then((i) => ve(i, t.value)) : ve(o, t.value);
1411
- }
1412
- return t.value === void 0 ? t : n.innerType._zod.run(t, r);
1413
- };
1414
- }), rr = /* @__PURE__ */ u("$ZodNullable", (e, n) => {
1415
- m.init(e, n), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), p(e._zod, "pattern", () => {
1416
- const t = n.innerType._zod.pattern;
1417
- return t ? new RegExp(`^(${ie(t.source)}|null)$`) : void 0;
1418
- }), p(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
1419
- }), or = /* @__PURE__ */ u("$ZodDefault", (e, n) => {
1420
- m.init(e, n), e._zod.optin = "optional", p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1421
- if (r.direction === "backward")
1422
- return n.innerType._zod.run(t, r);
1423
- if (t.value === void 0)
1424
- return t.value = n.defaultValue, t;
1425
- const o = n.innerType._zod.run(t, r);
1426
- return o instanceof Promise ? o.then((i) => ze(i, n)) : ze(o, n);
1427
- };
1428
- });
1429
- function ze(e, n) {
1430
- return e.value === void 0 && (e.value = n.defaultValue), e;
1431
- }
1432
- const ir = /* @__PURE__ */ u("$ZodPrefault", (e, n) => {
1433
- m.init(e, n), e._zod.optin = "optional", p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1434
- }), cr = /* @__PURE__ */ u("$ZodNonOptional", (e, n) => {
1435
- m.init(e, n), p(e._zod, "values", () => {
1436
- const t = n.innerType._zod.values;
1437
- return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
1438
- }), e._zod.parse = (t, r) => {
1439
- const o = n.innerType._zod.run(t, r);
1440
- return o instanceof Promise ? o.then((i) => be(i, e)) : be(o, e);
1441
- };
1442
- });
1443
- function be(e, n) {
1444
- return !e.issues.length && e.value === void 0 && e.issues.push({
1445
- code: "invalid_type",
1446
- expected: "nonoptional",
1447
- input: e.value,
1448
- inst: n
1449
- }), e;
1450
- }
1451
- const ur = /* @__PURE__ */ u("$ZodCatch", (e, n) => {
1452
- m.init(e, n), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), p(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1453
- if (r.direction === "backward")
1454
- return n.innerType._zod.run(t, r);
1455
- const o = n.innerType._zod.run(t, r);
1456
- return o instanceof Promise ? o.then((i) => (t.value = i.value, i.issues.length && (t.value = n.catchValue({
1457
- ...t,
1458
- error: {
1459
- issues: i.issues.map((c) => A(c, r, E()))
1460
- },
1461
- input: t.value
1462
- }), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
1463
- ...t,
1464
- error: {
1465
- issues: o.issues.map((i) => A(i, r, E()))
1466
- },
1467
- input: t.value
1468
- }), t.issues = []), t);
1469
- };
1470
- }), sr = /* @__PURE__ */ u("$ZodPipe", (e, n) => {
1471
- m.init(e, n), p(e._zod, "values", () => n.in._zod.values), p(e._zod, "optin", () => n.in._zod.optin), p(e._zod, "optout", () => n.out._zod.optout), p(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1472
- if (r.direction === "backward") {
1473
- const i = n.out._zod.run(t, r);
1474
- return i instanceof Promise ? i.then((c) => U(c, n.in, r)) : U(i, n.in, r);
1475
- }
1476
- const o = n.in._zod.run(t, r);
1477
- return o instanceof Promise ? o.then((i) => U(i, n.out, r)) : U(o, n.out, r);
1478
- };
1479
- });
1480
- function U(e, n, t) {
1481
- return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
1482
- }
1483
- const ar = /* @__PURE__ */ u("$ZodReadonly", (e, n) => {
1484
- m.init(e, n), p(e._zod, "propValues", () => n.innerType._zod.propValues), p(e._zod, "values", () => n.innerType._zod.values), p(e._zod, "optin", () => n.innerType._zod.optin), p(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
1485
- if (r.direction === "backward")
1486
- return n.innerType._zod.run(t, r);
1487
- const o = n.innerType._zod.run(t, r);
1488
- return o instanceof Promise ? o.then(we) : we(o);
1489
- };
1490
- });
1491
- function we(e) {
1492
- return e.value = Object.freeze(e.value), e;
1493
- }
1494
- const lr = /* @__PURE__ */ u("$ZodCustom", (e, n) => {
1495
- w.init(e, n), m.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1496
- const r = t.value, o = n.fn(r);
1497
- if (o instanceof Promise)
1498
- return o.then((i) => ke(i, t, r, e));
1499
- ke(o, t, r, e);
1500
- };
1501
- });
1502
- function ke(e, n, t, r) {
1503
- if (!e) {
1504
- const o = {
1505
- code: "custom",
1506
- input: t,
1507
- inst: r,
1508
- // incorporates params.error into issue reporting
1509
- path: [...r._zod.def.path ?? []],
1510
- // incorporates params.error into issue reporting
1511
- continue: !r._zod.def.abort
1512
- // params: inst._zod.def.params,
1513
- };
1514
- r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(D(o));
1515
- }
1516
- }
1517
- class hr {
1518
- constructor() {
1519
- this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1520
- }
1521
- add(n, ...t) {
1522
- const r = t[0];
1523
- if (this._map.set(n, r), r && typeof r == "object" && "id" in r) {
1524
- if (this._idmap.has(r.id))
1525
- throw new Error(`ID ${r.id} already exists in the registry`);
1526
- this._idmap.set(r.id, n);
1527
- }
1528
- return this;
1529
- }
1530
- clear() {
1531
- return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1532
- }
1533
- remove(n) {
1534
- const t = this._map.get(n);
1535
- return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
1536
- }
1537
- get(n) {
1538
- const t = n._zod.parent;
1539
- if (t) {
1540
- const r = { ...this.get(t) ?? {} };
1541
- delete r.id;
1542
- const o = { ...r, ...this._map.get(n) };
1543
- return Object.keys(o).length ? o : void 0;
1544
- }
1545
- return this._map.get(n);
1546
- }
1547
- has(n) {
1548
- return this._map.has(n);
1549
- }
1550
- }
1551
- function fr() {
1552
- return new hr();
1553
- }
1554
- const L = /* @__PURE__ */ fr();
1555
- function pr(e, n) {
1556
- return new e({
1557
- type: "string",
1558
- ...h(n)
1559
- });
1560
- }
1561
- function dr(e, n) {
1562
- return new e({
1563
- type: "string",
1564
- format: "email",
1565
- check: "string_format",
1566
- abort: !1,
1567
- ...h(n)
1568
- });
1569
- }
1570
- function Ze(e, n) {
1571
- return new e({
1572
- type: "string",
1573
- format: "guid",
1574
- check: "string_format",
1575
- abort: !1,
1576
- ...h(n)
1577
- });
1578
- }
1579
- function mr(e, n) {
1580
- return new e({
1581
- type: "string",
1582
- format: "uuid",
1583
- check: "string_format",
1584
- abort: !1,
1585
- ...h(n)
1586
- });
1587
- }
1588
- function _r(e, n) {
1589
- return new e({
1590
- type: "string",
1591
- format: "uuid",
1592
- check: "string_format",
1593
- abort: !1,
1594
- version: "v4",
1595
- ...h(n)
1596
- });
1597
- }
1598
- function gr(e, n) {
1599
- return new e({
1600
- type: "string",
1601
- format: "uuid",
1602
- check: "string_format",
1603
- abort: !1,
1604
- version: "v6",
1605
- ...h(n)
1606
- });
1607
- }
1608
- function vr(e, n) {
1609
- return new e({
1610
- type: "string",
1611
- format: "uuid",
1612
- check: "string_format",
1613
- abort: !1,
1614
- version: "v7",
1615
- ...h(n)
1616
- });
1617
- }
1618
- function zr(e, n) {
1619
- return new e({
1620
- type: "string",
1621
- format: "url",
1622
- check: "string_format",
1623
- abort: !1,
1624
- ...h(n)
1625
- });
1626
- }
1627
- function br(e, n) {
1628
- return new e({
1629
- type: "string",
1630
- format: "emoji",
1631
- check: "string_format",
1632
- abort: !1,
1633
- ...h(n)
1634
- });
1635
- }
1636
- function wr(e, n) {
1637
- return new e({
1638
- type: "string",
1639
- format: "nanoid",
1640
- check: "string_format",
1641
- abort: !1,
1642
- ...h(n)
1643
- });
1644
- }
1645
- function kr(e, n) {
1646
- return new e({
1647
- type: "string",
1648
- format: "cuid",
1649
- check: "string_format",
1650
- abort: !1,
1651
- ...h(n)
1652
- });
1653
- }
1654
- function Zr(e, n) {
1655
- return new e({
1656
- type: "string",
1657
- format: "cuid2",
1658
- check: "string_format",
1659
- abort: !1,
1660
- ...h(n)
1661
- });
1662
- }
1663
- function $r(e, n) {
1664
- return new e({
1665
- type: "string",
1666
- format: "ulid",
1667
- check: "string_format",
1668
- abort: !1,
1669
- ...h(n)
1670
- });
1671
- }
1672
- function yr(e, n) {
1673
- return new e({
1674
- type: "string",
1675
- format: "xid",
1676
- check: "string_format",
1677
- abort: !1,
1678
- ...h(n)
1679
- });
1680
- }
1681
- function Ir(e, n) {
1682
- return new e({
1683
- type: "string",
1684
- format: "ksuid",
1685
- check: "string_format",
1686
- abort: !1,
1687
- ...h(n)
1688
- });
1689
- }
1690
- function Er(e, n) {
1691
- return new e({
1692
- type: "string",
1693
- format: "ipv4",
1694
- check: "string_format",
1695
- abort: !1,
1696
- ...h(n)
1697
- });
1698
- }
1699
- function Ar(e, n) {
1700
- return new e({
1701
- type: "string",
1702
- format: "ipv6",
1703
- check: "string_format",
1704
- abort: !1,
1705
- ...h(n)
1706
- });
1707
- }
1708
- function Tr(e, n) {
1709
- return new e({
1710
- type: "string",
1711
- format: "cidrv4",
1712
- check: "string_format",
1713
- abort: !1,
1714
- ...h(n)
1715
- });
1716
- }
1717
- function Pr(e, n) {
1718
- return new e({
1719
- type: "string",
1720
- format: "cidrv6",
1721
- check: "string_format",
1722
- abort: !1,
1723
- ...h(n)
1724
- });
1725
- }
1726
- function Or(e, n) {
1727
- return new e({
1728
- type: "string",
1729
- format: "base64",
1730
- check: "string_format",
1731
- abort: !1,
1732
- ...h(n)
1733
- });
1734
- }
1735
- function Sr(e, n) {
1736
- return new e({
1737
- type: "string",
1738
- format: "base64url",
1739
- check: "string_format",
1740
- abort: !1,
1741
- ...h(n)
1742
- });
1743
- }
1744
- function Nr(e, n) {
1745
- return new e({
1746
- type: "string",
1747
- format: "e164",
1748
- check: "string_format",
1749
- abort: !1,
1750
- ...h(n)
1751
- });
1752
- }
1753
- function jr(e, n) {
1754
- return new e({
1755
- type: "string",
1756
- format: "jwt",
1757
- check: "string_format",
1758
- abort: !1,
1759
- ...h(n)
1760
- });
1761
- }
1762
- function xr(e, n) {
1763
- return new e({
1764
- type: "string",
1765
- format: "datetime",
1766
- check: "string_format",
1767
- offset: !1,
1768
- local: !1,
1769
- precision: null,
1770
- ...h(n)
1771
- });
1772
- }
1773
- function Dr(e, n) {
1774
- return new e({
1775
- type: "string",
1776
- format: "date",
1777
- check: "string_format",
1778
- ...h(n)
1779
- });
1780
- }
1781
- function Cr(e, n) {
1782
- return new e({
1783
- type: "string",
1784
- format: "time",
1785
- check: "string_format",
1786
- precision: null,
1787
- ...h(n)
1788
- });
1789
- }
1790
- function Rr(e, n) {
1791
- return new e({
1792
- type: "string",
1793
- format: "duration",
1794
- check: "string_format",
1795
- ...h(n)
1796
- });
1797
- }
1798
- function Fr(e, n) {
1799
- return new e({
1800
- type: "number",
1801
- checks: [],
1802
- ...h(n)
1803
- });
1804
- }
1805
- function Ur(e, n) {
1806
- return new e({
1807
- type: "number",
1808
- check: "number_format",
1809
- abort: !1,
1810
- format: "safeint",
1811
- ...h(n)
1812
- });
1813
- }
1814
- function Lr(e, n) {
1815
- return new e({
1816
- type: "boolean",
1817
- ...h(n)
1818
- });
1819
- }
1820
- function Mr(e) {
1821
- return new e({
1822
- type: "unknown"
1823
- });
1824
- }
1825
- function Vr(e, n) {
1826
- return new e({
1827
- type: "never",
1828
- ...h(n)
1829
- });
1830
- }
1831
- function $e(e, n) {
1832
- return new Ve({
1833
- check: "less_than",
1834
- ...h(n),
1835
- value: e,
1836
- inclusive: !1
1837
- });
1838
- }
1839
- function X(e, n) {
1840
- return new Ve({
1841
- check: "less_than",
1842
- ...h(n),
1843
- value: e,
1844
- inclusive: !0
1845
- });
1846
- }
1847
- function ye(e, n) {
1848
- return new We({
1849
- check: "greater_than",
1850
- ...h(n),
1851
- value: e,
1852
- inclusive: !1
1853
- });
1854
- }
1855
- function q(e, n) {
1856
- return new We({
1857
- check: "greater_than",
1858
- ...h(n),
1859
- value: e,
1860
- inclusive: !0
1861
- });
1862
- }
1863
- function Ie(e, n) {
1864
- return new ot({
1865
- check: "multiple_of",
1866
- ...h(n),
1867
- value: e
1868
- });
1869
- }
1870
- function Ye(e, n) {
1871
- return new ct({
1872
- check: "max_length",
1873
- ...h(n),
1874
- maximum: e
1875
- });
1876
- }
1877
- function B(e, n) {
1878
- return new ut({
1879
- check: "min_length",
1880
- ...h(n),
1881
- minimum: e
1882
- });
1883
- }
1884
- function Xe(e, n) {
1885
- return new st({
1886
- check: "length_equals",
1887
- ...h(n),
1888
- length: e
1889
- });
1890
- }
1891
- function Wr(e, n) {
1892
- return new at({
1893
- check: "string_format",
1894
- format: "regex",
1895
- ...h(n),
1896
- pattern: e
1897
- });
1898
- }
1899
- function Br(e) {
1900
- return new lt({
1901
- check: "string_format",
1902
- format: "lowercase",
1903
- ...h(e)
1904
- });
1905
- }
1906
- function Gr(e) {
1907
- return new ht({
1908
- check: "string_format",
1909
- format: "uppercase",
1910
- ...h(e)
1911
- });
1912
- }
1913
- function Jr(e, n) {
1914
- return new ft({
1915
- check: "string_format",
1916
- format: "includes",
1917
- ...h(n),
1918
- includes: e
1919
- });
1920
- }
1921
- function Kr(e, n) {
1922
- return new pt({
1923
- check: "string_format",
1924
- format: "starts_with",
1925
- ...h(n),
1926
- prefix: e
1927
- });
1928
- }
1929
- function Yr(e, n) {
1930
- return new dt({
1931
- check: "string_format",
1932
- format: "ends_with",
1933
- ...h(n),
1934
- suffix: e
1935
- });
1936
- }
1937
- function C(e) {
1938
- return new mt({
1939
- check: "overwrite",
1940
- tx: e
1941
- });
1942
- }
1943
- function Xr(e) {
1944
- return C((n) => n.normalize(e));
1945
- }
1946
- function qr() {
1947
- return C((e) => e.trim());
1948
- }
1949
- function Hr() {
1950
- return C((e) => e.toLowerCase());
1951
- }
1952
- function Qr() {
1953
- return C((e) => e.toUpperCase());
1954
- }
1955
- function eo(e, n, t) {
1956
- return new e({
1957
- type: "array",
1958
- element: n,
1959
- // get element() {
1960
- // return element;
1961
- // },
1962
- ...h(t)
1963
- });
1964
- }
1965
- function no(e, n, t) {
1966
- return new e({
1967
- type: "custom",
1968
- check: "custom",
1969
- fn: n,
1970
- ...h(t)
1971
- });
1972
- }
1973
- function to(e) {
1974
- const n = ro((t) => (t.addIssue = (r) => {
1975
- if (typeof r == "string")
1976
- t.issues.push(D(r, t.value, n._zod.def));
1977
- else {
1978
- const o = r;
1979
- o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = t.value), o.inst ?? (o.inst = n), o.continue ?? (o.continue = !n._zod.def.abort), t.issues.push(D(o));
1980
- }
1981
- }, e(t.value, t)));
1982
- return n;
1983
- }
1984
- function ro(e, n) {
1985
- const t = new w({
1986
- check: "custom",
1987
- ...h(n)
1988
- });
1989
- return t._zod.check = e, t;
1990
- }
1991
- const oo = /* @__PURE__ */ u("ZodISODateTime", (e, n) => {
1992
- Tt.init(e, n), g.init(e, n);
1993
- });
1994
- function io(e) {
1995
- return xr(oo, e);
1996
- }
1997
- const co = /* @__PURE__ */ u("ZodISODate", (e, n) => {
1998
- Pt.init(e, n), g.init(e, n);
1999
- });
2000
- function uo(e) {
2001
- return Dr(co, e);
2002
- }
2003
- const so = /* @__PURE__ */ u("ZodISOTime", (e, n) => {
2004
- Ot.init(e, n), g.init(e, n);
2005
- });
2006
- function ao(e) {
2007
- return Cr(so, e);
2008
- }
2009
- const lo = /* @__PURE__ */ u("ZodISODuration", (e, n) => {
2010
- St.init(e, n), g.init(e, n);
2011
- });
2012
- function ho(e) {
2013
- return Rr(lo, e);
2014
- }
2015
- const fo = (e, n) => {
2016
- Ce.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
2017
- format: {
2018
- value: (t) => bn(e, t)
2019
- // enumerable: false,
2020
- },
2021
- flatten: {
2022
- value: (t) => zn(e, t)
2023
- // enumerable: false,
2024
- },
2025
- addIssue: {
2026
- value: (t) => {
2027
- e.issues.push(t), e.message = JSON.stringify(e.issues, H, 2);
2028
- }
2029
- // enumerable: false,
2030
- },
2031
- addIssues: {
2032
- value: (t) => {
2033
- e.issues.push(...t), e.message = JSON.stringify(e.issues, H, 2);
2034
- }
2035
- // enumerable: false,
2036
- },
2037
- isEmpty: {
2038
- get() {
2039
- return e.issues.length === 0;
2040
- }
2041
- // enumerable: false,
2042
- }
2043
- });
2044
- }, Z = u("ZodError", fo, {
2045
- Parent: Error
2046
- }), po = /* @__PURE__ */ se(Z), mo = /* @__PURE__ */ ae(Z), _o = /* @__PURE__ */ G(Z), go = /* @__PURE__ */ J(Z), vo = /* @__PURE__ */ Zn(Z), zo = /* @__PURE__ */ $n(Z), bo = /* @__PURE__ */ yn(Z), wo = /* @__PURE__ */ In(Z), ko = /* @__PURE__ */ En(Z), Zo = /* @__PURE__ */ An(Z), $o = /* @__PURE__ */ Tn(Z), yo = /* @__PURE__ */ Pn(Z), v = /* @__PURE__ */ u("ZodType", (e, n) => (m.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(P(n, {
2047
- checks: [
2048
- ...n.checks ?? [],
2049
- ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
2050
- ]
2051
- })), e.clone = (t, r) => I(e, t, r), e.brand = () => e, e.register = (t, r) => (t.add(e, r), e), e.parse = (t, r) => po(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => _o(e, t, r), e.parseAsync = async (t, r) => mo(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => go(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => vo(e, t, r), e.decode = (t, r) => zo(e, t, r), e.encodeAsync = async (t, r) => bo(e, t, r), e.decodeAsync = async (t, r) => wo(e, t, r), e.safeEncode = (t, r) => ko(e, t, r), e.safeDecode = (t, r) => Zo(e, t, r), e.safeEncodeAsync = async (t, r) => $o(e, t, r), e.safeDecodeAsync = async (t, r) => yo(e, t, r), e.refine = (t, r) => e.check(gi(t, r)), e.superRefine = (t) => e.check(vi(t)), e.overwrite = (t) => e.check(C(t)), e.optional = () => Te(e), e.nullable = () => Pe(e), e.nullish = () => Te(Pe(e)), e.nonoptional = (t) => li(e, t), e.array = () => Yo(e), e.or = (t) => qo([e, t]), e.and = (t) => Qo(e, t), e.transform = (t) => Oe(e, oi(t)), e.default = (t) => ui(e, t), e.prefault = (t) => ai(e, t), e.catch = (t) => fi(e, t), e.pipe = (t) => Oe(e, t), e.readonly = () => mi(e), e.describe = (t) => {
2052
- const r = e.clone();
2053
- return L.add(r, { description: t }), r;
2054
- }, Object.defineProperty(e, "description", {
2055
- get() {
2056
- return L.get(e)?.description;
2057
- },
2058
- configurable: !0
2059
- }), e.meta = (...t) => {
2060
- if (t.length === 0)
2061
- return L.get(e);
2062
- const r = e.clone();
2063
- return L.add(r, t[0]), r;
2064
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), qe = /* @__PURE__ */ u("_ZodString", (e, n) => {
2065
- le.init(e, n), v.init(e, n);
2066
- const t = e._zod.bag;
2067
- e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(Wr(...r)), e.includes = (...r) => e.check(Jr(...r)), e.startsWith = (...r) => e.check(Kr(...r)), e.endsWith = (...r) => e.check(Yr(...r)), e.min = (...r) => e.check(B(...r)), e.max = (...r) => e.check(Ye(...r)), e.length = (...r) => e.check(Xe(...r)), e.nonempty = (...r) => e.check(B(1, ...r)), e.lowercase = (r) => e.check(Br(r)), e.uppercase = (r) => e.check(Gr(r)), e.trim = () => e.check(qr()), e.normalize = (...r) => e.check(Xr(...r)), e.toLowerCase = () => e.check(Hr()), e.toUpperCase = () => e.check(Qr());
2068
- }), Io = /* @__PURE__ */ u("ZodString", (e, n) => {
2069
- le.init(e, n), qe.init(e, n), e.email = (t) => e.check(dr(Eo, t)), e.url = (t) => e.check(zr(Ao, t)), e.jwt = (t) => e.check(jr(Vo, t)), e.emoji = (t) => e.check(br(To, t)), e.guid = (t) => e.check(Ze(Ee, t)), e.uuid = (t) => e.check(mr(M, t)), e.uuidv4 = (t) => e.check(_r(M, t)), e.uuidv6 = (t) => e.check(gr(M, t)), e.uuidv7 = (t) => e.check(vr(M, t)), e.nanoid = (t) => e.check(wr(Po, t)), e.guid = (t) => e.check(Ze(Ee, t)), e.cuid = (t) => e.check(kr(Oo, t)), e.cuid2 = (t) => e.check(Zr(So, t)), e.ulid = (t) => e.check($r(No, t)), e.base64 = (t) => e.check(Or(Uo, t)), e.base64url = (t) => e.check(Sr(Lo, t)), e.xid = (t) => e.check(yr(jo, t)), e.ksuid = (t) => e.check(Ir(xo, t)), e.ipv4 = (t) => e.check(Er(Do, t)), e.ipv6 = (t) => e.check(Ar(Co, t)), e.cidrv4 = (t) => e.check(Tr(Ro, t)), e.cidrv6 = (t) => e.check(Pr(Fo, t)), e.e164 = (t) => e.check(Nr(Mo, t)), e.datetime = (t) => e.check(io(t)), e.date = (t) => e.check(uo(t)), e.time = (t) => e.check(ao(t)), e.duration = (t) => e.check(ho(t));
2070
- });
2071
- function wi(e) {
2072
- return pr(Io, e);
2073
- }
2074
- const g = /* @__PURE__ */ u("ZodStringFormat", (e, n) => {
2075
- _.init(e, n), qe.init(e, n);
2076
- }), Eo = /* @__PURE__ */ u("ZodEmail", (e, n) => {
2077
- bt.init(e, n), g.init(e, n);
2078
- }), Ee = /* @__PURE__ */ u("ZodGUID", (e, n) => {
2079
- vt.init(e, n), g.init(e, n);
2080
- }), M = /* @__PURE__ */ u("ZodUUID", (e, n) => {
2081
- zt.init(e, n), g.init(e, n);
2082
- }), Ao = /* @__PURE__ */ u("ZodURL", (e, n) => {
2083
- wt.init(e, n), g.init(e, n);
2084
- }), To = /* @__PURE__ */ u("ZodEmoji", (e, n) => {
2085
- kt.init(e, n), g.init(e, n);
2086
- }), Po = /* @__PURE__ */ u("ZodNanoID", (e, n) => {
2087
- Zt.init(e, n), g.init(e, n);
2088
- }), Oo = /* @__PURE__ */ u("ZodCUID", (e, n) => {
2089
- $t.init(e, n), g.init(e, n);
2090
- }), So = /* @__PURE__ */ u("ZodCUID2", (e, n) => {
2091
- yt.init(e, n), g.init(e, n);
2092
- }), No = /* @__PURE__ */ u("ZodULID", (e, n) => {
2093
- It.init(e, n), g.init(e, n);
2094
- }), jo = /* @__PURE__ */ u("ZodXID", (e, n) => {
2095
- Et.init(e, n), g.init(e, n);
2096
- }), xo = /* @__PURE__ */ u("ZodKSUID", (e, n) => {
2097
- At.init(e, n), g.init(e, n);
2098
- }), Do = /* @__PURE__ */ u("ZodIPv4", (e, n) => {
2099
- Nt.init(e, n), g.init(e, n);
2100
- }), Co = /* @__PURE__ */ u("ZodIPv6", (e, n) => {
2101
- jt.init(e, n), g.init(e, n);
2102
- }), Ro = /* @__PURE__ */ u("ZodCIDRv4", (e, n) => {
2103
- xt.init(e, n), g.init(e, n);
2104
- }), Fo = /* @__PURE__ */ u("ZodCIDRv6", (e, n) => {
2105
- Dt.init(e, n), g.init(e, n);
2106
- }), Uo = /* @__PURE__ */ u("ZodBase64", (e, n) => {
2107
- Ct.init(e, n), g.init(e, n);
2108
- }), Lo = /* @__PURE__ */ u("ZodBase64URL", (e, n) => {
2109
- Ft.init(e, n), g.init(e, n);
2110
- }), Mo = /* @__PURE__ */ u("ZodE164", (e, n) => {
2111
- Ut.init(e, n), g.init(e, n);
2112
- }), Vo = /* @__PURE__ */ u("ZodJWT", (e, n) => {
2113
- Mt.init(e, n), g.init(e, n);
2114
- }), He = /* @__PURE__ */ u("ZodNumber", (e, n) => {
2115
- Ge.init(e, n), v.init(e, n), e.gt = (r, o) => e.check(ye(r, o)), e.gte = (r, o) => e.check(q(r, o)), e.min = (r, o) => e.check(q(r, o)), e.lt = (r, o) => e.check($e(r, o)), e.lte = (r, o) => e.check(X(r, o)), e.max = (r, o) => e.check(X(r, o)), e.int = (r) => e.check(Ae(r)), e.safe = (r) => e.check(Ae(r)), e.positive = (r) => e.check(ye(0, r)), e.nonnegative = (r) => e.check(q(0, r)), e.negative = (r) => e.check($e(0, r)), e.nonpositive = (r) => e.check(X(0, r)), e.multipleOf = (r, o) => e.check(Ie(r, o)), e.step = (r, o) => e.check(Ie(r, o)), e.finite = () => e;
2116
- const t = e._zod.bag;
2117
- e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
2118
- });
2119
- function ki(e) {
2120
- return Fr(He, e);
2121
- }
2122
- const Wo = /* @__PURE__ */ u("ZodNumberFormat", (e, n) => {
2123
- Vt.init(e, n), He.init(e, n);
2124
- });
2125
- function Ae(e) {
2126
- return Ur(Wo, e);
2127
- }
2128
- const Bo = /* @__PURE__ */ u("ZodBoolean", (e, n) => {
2129
- Wt.init(e, n), v.init(e, n);
2130
- });
2131
- function Zi(e) {
2132
- return Lr(Bo, e);
2133
- }
2134
- const Go = /* @__PURE__ */ u("ZodUnknown", (e, n) => {
2135
- Bt.init(e, n), v.init(e, n);
2136
- });
2137
- function ee() {
2138
- return Mr(Go);
2139
- }
2140
- const Jo = /* @__PURE__ */ u("ZodNever", (e, n) => {
2141
- Gt.init(e, n), v.init(e, n);
2142
- });
2143
- function Qe(e) {
2144
- return Vr(Jo, e);
2145
- }
2146
- const Ko = /* @__PURE__ */ u("ZodArray", (e, n) => {
2147
- Jt.init(e, n), v.init(e, n), e.element = n.element, e.min = (t, r) => e.check(B(t, r)), e.nonempty = (t) => e.check(B(1, t)), e.max = (t, r) => e.check(Ye(t, r)), e.length = (t, r) => e.check(Xe(t, r)), e.unwrap = () => e.element;
2148
- });
2149
- function Yo(e, n) {
2150
- return eo(Ko, e, n);
2151
- }
2152
- const en = /* @__PURE__ */ u("ZodObject", (e, n) => {
2153
- Yt.init(e, n), v.init(e, n), p(e, "shape", () => n.shape), e.keyof = () => ni(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ee() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ee() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Qe() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => dn(e, t), e.safeExtend = (t) => mn(e, t), e.merge = (t) => _n(e, t), e.pick = (t) => fn(e, t), e.omit = (t) => pn(e, t), e.partial = (...t) => gn(nn, e, t[0]), e.required = (...t) => vn(tn, e, t[0]);
2154
- });
2155
- function $i(e, n) {
2156
- return new en({
2157
- type: "object",
2158
- shape: e,
2159
- catchall: Qe(),
2160
- ...h(n)
2161
- });
2162
- }
2163
- function yi(e, n) {
2164
- return new en({
2165
- type: "object",
2166
- shape: e,
2167
- catchall: ee(),
2168
- ...h(n)
2169
- });
2170
- }
2171
- const Xo = /* @__PURE__ */ u("ZodUnion", (e, n) => {
2172
- Xt.init(e, n), v.init(e, n), e.options = n.options;
2173
- });
2174
- function qo(e, n) {
2175
- return new Xo({
2176
- type: "union",
2177
- options: e,
2178
- ...h(n)
2179
- });
2180
- }
2181
- const Ho = /* @__PURE__ */ u("ZodIntersection", (e, n) => {
2182
- qt.init(e, n), v.init(e, n);
2183
- });
2184
- function Qo(e, n) {
2185
- return new Ho({
2186
- type: "intersection",
2187
- left: e,
2188
- right: n
2189
- });
2190
- }
2191
- const ei = /* @__PURE__ */ u("ZodTuple", (e, n) => {
2192
- Ht.init(e, n), v.init(e, n), e.rest = (t) => e.clone({
2193
- ...e._zod.def,
2194
- rest: t
2195
- });
2196
- });
2197
- function Ii(e, n, t) {
2198
- const r = n instanceof m, o = r ? t : n, i = r ? n : null;
2199
- return new ei({
2200
- type: "tuple",
2201
- items: e,
2202
- rest: i,
2203
- ...h(o)
2204
- });
2205
- }
2206
- const ne = /* @__PURE__ */ u("ZodEnum", (e, n) => {
2207
- Qt.init(e, n), v.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
2208
- const t = new Set(Object.keys(n.entries));
2209
- e.extract = (r, o) => {
2210
- const i = {};
2211
- for (const c of r)
2212
- if (t.has(c))
2213
- i[c] = n.entries[c];
2214
- else
2215
- throw new Error(`Key ${c} not found in enum`);
2216
- return new ne({
2217
- ...n,
2218
- checks: [],
2219
- ...h(o),
2220
- entries: i
2221
- });
2222
- }, e.exclude = (r, o) => {
2223
- const i = { ...n.entries };
2224
- for (const c of r)
2225
- if (t.has(c))
2226
- delete i[c];
2227
- else
2228
- throw new Error(`Key ${c} not found in enum`);
2229
- return new ne({
2230
- ...n,
2231
- checks: [],
2232
- ...h(o),
2233
- entries: i
2234
- });
2235
- };
2236
- });
2237
- function ni(e, n) {
2238
- const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
2239
- return new ne({
2240
- type: "enum",
2241
- entries: t,
2242
- ...h(n)
2243
- });
2244
- }
2245
- const ti = /* @__PURE__ */ u("ZodLiteral", (e, n) => {
2246
- er.init(e, n), v.init(e, n), e.values = new Set(n.values), Object.defineProperty(e, "value", {
2247
- get() {
2248
- if (n.values.length > 1)
2249
- throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
2250
- return n.values[0];
2251
- }
2252
- });
2253
- });
2254
- function Ei(e, n) {
2255
- return new ti({
2256
- type: "literal",
2257
- values: Array.isArray(e) ? e : [e],
2258
- ...h(n)
2259
- });
2260
- }
2261
- const ri = /* @__PURE__ */ u("ZodTransform", (e, n) => {
2262
- nr.init(e, n), v.init(e, n), e._zod.parse = (t, r) => {
2263
- if (r.direction === "backward")
2264
- throw new Se(e.constructor.name);
2265
- t.addIssue = (i) => {
2266
- if (typeof i == "string")
2267
- t.issues.push(D(i, t.value, n));
2268
- else {
2269
- const c = i;
2270
- c.fatal && (c.continue = !1), c.code ?? (c.code = "custom"), c.input ?? (c.input = t.value), c.inst ?? (c.inst = e), t.issues.push(D(c));
2271
- }
2272
- };
2273
- const o = n.transform(t.value, t);
2274
- return o instanceof Promise ? o.then((i) => (t.value = i, t)) : (t.value = o, t);
2275
- };
2276
- });
2277
- function oi(e) {
2278
- return new ri({
2279
- type: "transform",
2280
- transform: e
2281
- });
2282
- }
2283
- const nn = /* @__PURE__ */ u("ZodOptional", (e, n) => {
2284
- tr.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2285
- });
2286
- function Te(e) {
2287
- return new nn({
2288
- type: "optional",
2289
- innerType: e
2290
- });
2291
- }
2292
- const ii = /* @__PURE__ */ u("ZodNullable", (e, n) => {
2293
- rr.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2294
- });
2295
- function Pe(e) {
2296
- return new ii({
2297
- type: "nullable",
2298
- innerType: e
2299
- });
2300
- }
2301
- const ci = /* @__PURE__ */ u("ZodDefault", (e, n) => {
2302
- or.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2303
- });
2304
- function ui(e, n) {
2305
- return new ci({
2306
- type: "default",
2307
- innerType: e,
2308
- get defaultValue() {
2309
- return typeof n == "function" ? n() : xe(n);
2310
- }
2311
- });
2312
- }
2313
- const si = /* @__PURE__ */ u("ZodPrefault", (e, n) => {
2314
- ir.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2315
- });
2316
- function ai(e, n) {
2317
- return new si({
2318
- type: "prefault",
2319
- innerType: e,
2320
- get defaultValue() {
2321
- return typeof n == "function" ? n() : xe(n);
2322
- }
2323
- });
2324
- }
2325
- const tn = /* @__PURE__ */ u("ZodNonOptional", (e, n) => {
2326
- cr.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2327
- });
2328
- function li(e, n) {
2329
- return new tn({
2330
- type: "nonoptional",
2331
- innerType: e,
2332
- ...h(n)
2333
- });
2334
- }
2335
- const hi = /* @__PURE__ */ u("ZodCatch", (e, n) => {
2336
- ur.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2337
- });
2338
- function fi(e, n) {
2339
- return new hi({
2340
- type: "catch",
2341
- innerType: e,
2342
- catchValue: typeof n == "function" ? n : () => n
2343
- });
2344
- }
2345
- const pi = /* @__PURE__ */ u("ZodPipe", (e, n) => {
2346
- sr.init(e, n), v.init(e, n), e.in = n.in, e.out = n.out;
2347
- });
2348
- function Oe(e, n) {
2349
- return new pi({
2350
- type: "pipe",
2351
- in: e,
2352
- out: n
2353
- // ...util.normalizeParams(params),
2354
- });
2355
- }
2356
- const di = /* @__PURE__ */ u("ZodReadonly", (e, n) => {
2357
- ar.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
2358
- });
2359
- function mi(e) {
2360
- return new di({
2361
- type: "readonly",
2362
- innerType: e
2363
- });
2364
- }
2365
- const _i = /* @__PURE__ */ u("ZodCustom", (e, n) => {
2366
- lr.init(e, n), v.init(e, n);
2367
- });
2368
- function gi(e, n = {}) {
2369
- return no(_i, e, n);
2370
- }
2371
- function vi(e) {
2372
- return to(e);
2373
- }
2374
- const zi = "[DescriptorStrategy] Type cannot be empty.";
2375
- class bi {
2376
- constructor(n, t, r) {
2377
- if (this.type = n, this.schema = t, this.loader = r, !n.trim()) throw new Error(zi);
2378
- Object.freeze(this);
2379
- }
2380
- validate(n) {
2381
- return this.schema.safeParse(n).success;
2382
- }
2383
- parse(n) {
2384
- return this.schema.parse(n);
2385
- }
2386
- }
2387
- class te extends bi {
2388
- static FIELD_SLOT = "inputs";
2389
- // @ts-ignore
2390
- buildDescriptor(n) {
2391
- const t = {
2392
- ...this.buildControl(n),
2393
- slot: te.FIELD_SLOT
2394
- };
2395
- return {
2396
- tag: "field-wrapper",
2397
- props: {
2398
- // @ts-ignore
2399
- title: n.title,
2400
- // @ts-ignore
2401
- description: n.description ?? ""
2402
- },
2403
- child: t,
2404
- slot: te.FIELD_SLOT
2405
- };
2406
- }
2407
- }
2408
- export {
2409
- hr as $,
2410
- bi as D,
2411
- te as F,
2412
- wi as a,
2413
- Zi as b,
2414
- cn as c,
2415
- Qe as d,
2416
- Yo as e,
2417
- Ei as f,
2418
- L as g,
2419
- io as h,
2420
- Ae as i,
2421
- yi as l,
2422
- ki as n,
2423
- Te as o,
2424
- $i as s,
2425
- Ii as t,
2426
- qo as u
2427
- };