@zuplo/cli 7.13.3 → 7.13.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 (858) hide show
  1. package/dist/cmds/lint.d.ts.map +1 -1
  2. package/dist/cmds/lint.js +0 -5
  3. package/dist/cmds/lint.js.map +1 -1
  4. package/dist/lint/handler.d.ts.map +1 -1
  5. package/dist/lint/handler.js +9 -0
  6. package/dist/lint/handler.js.map +1 -1
  7. package/node_modules/@simple-git/argv-parser/LICENSE +20 -0
  8. package/node_modules/@simple-git/argv-parser/dist/index.cjs +1 -1
  9. package/node_modules/@simple-git/argv-parser/dist/index.cjs.map +1 -1
  10. package/node_modules/@simple-git/argv-parser/dist/index.d.ts +2 -1
  11. package/node_modules/@simple-git/argv-parser/dist/index.d.ts.map +1 -0
  12. package/node_modules/@simple-git/argv-parser/dist/index.mjs +244 -198
  13. package/node_modules/@simple-git/argv-parser/dist/index.mjs.map +1 -1
  14. package/node_modules/@simple-git/argv-parser/dist/src/args/parse-argv.d.ts +1 -0
  15. package/node_modules/@simple-git/argv-parser/dist/src/args/parse-argv.d.ts.map +1 -0
  16. package/node_modules/@simple-git/argv-parser/dist/src/args/parse-argv.types.d.ts +1 -0
  17. package/node_modules/@simple-git/argv-parser/dist/src/args/parse-argv.types.d.ts.map +1 -0
  18. package/node_modules/@simple-git/argv-parser/dist/src/config/analyse-config.d.ts +1 -0
  19. package/node_modules/@simple-git/argv-parser/dist/src/config/analyse-config.d.ts.map +1 -0
  20. package/node_modules/@simple-git/argv-parser/dist/src/config/config-operands.d.ts +1 -0
  21. package/node_modules/@simple-git/argv-parser/dist/src/config/config-operands.d.ts.map +1 -0
  22. package/node_modules/@simple-git/argv-parser/dist/src/config/config.types.d.ts +1 -0
  23. package/node_modules/@simple-git/argv-parser/dist/src/config/config.types.d.ts.map +1 -0
  24. package/node_modules/@simple-git/argv-parser/dist/src/config/detect-config-action.d.ts +1 -0
  25. package/node_modules/@simple-git/argv-parser/dist/src/config/detect-config-action.d.ts.map +1 -0
  26. package/node_modules/@simple-git/argv-parser/dist/src/env/parse-env.d.ts +25 -0
  27. package/node_modules/@simple-git/argv-parser/dist/src/env/parse-env.d.ts.map +1 -0
  28. package/node_modules/@simple-git/argv-parser/dist/src/flags/flags.helpers.d.ts +1 -0
  29. package/node_modules/@simple-git/argv-parser/dist/src/flags/flags.helpers.d.ts.map +1 -0
  30. package/node_modules/@simple-git/argv-parser/dist/src/flags/parse-global-flags.d.ts +1 -0
  31. package/node_modules/@simple-git/argv-parser/dist/src/flags/parse-global-flags.d.ts.map +1 -0
  32. package/node_modules/@simple-git/argv-parser/dist/src/flags/parse-task-flags.d.ts +1 -0
  33. package/node_modules/@simple-git/argv-parser/dist/src/flags/parse-task-flags.d.ts.map +1 -0
  34. package/node_modules/@simple-git/argv-parser/dist/src/tokens/flag-specs.d.ts +1 -0
  35. package/node_modules/@simple-git/argv-parser/dist/src/tokens/flag-specs.d.ts.map +1 -0
  36. package/node_modules/@simple-git/argv-parser/dist/src/tokens/token-expander.d.ts +1 -0
  37. package/node_modules/@simple-git/argv-parser/dist/src/tokens/token-expander.d.ts.map +1 -0
  38. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/detect-vulnerable-config-writes.d.ts +1 -0
  39. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/detect-vulnerable-config-writes.d.ts.map +1 -0
  40. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/detect-vulnerable-flags.d.ts +1 -0
  41. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/detect-vulnerable-flags.d.ts.map +1 -0
  42. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability-analysis.d.ts +1 -0
  43. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability-analysis.d.ts.map +1 -0
  44. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability-check.d.ts +1 -0
  45. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability-check.d.ts.map +1 -0
  46. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability.types.d.ts +29 -0
  47. package/node_modules/@simple-git/argv-parser/dist/src/vulnerabilities/vulnerability.types.d.ts.map +1 -0
  48. package/node_modules/@simple-git/argv-parser/package.json +2 -2
  49. package/node_modules/@zuplo/core/customer.cli.minified.js +344 -344
  50. package/node_modules/@zuplo/core/index.minified.js +359 -359
  51. package/node_modules/@zuplo/core/package.json +1 -1
  52. package/node_modules/@zuplo/graphql/package.json +1 -1
  53. package/node_modules/@zuplo/openapi-tools/package.json +2 -2
  54. package/node_modules/@zuplo/otel/package.json +1 -1
  55. package/node_modules/@zuplo/runtime/out/esm/{chunk-DVFQRFED.js → chunk-NWYAKCSU.js} +81 -81
  56. package/node_modules/@zuplo/runtime/out/esm/chunk-NWYAKCSU.js.map +1 -0
  57. package/node_modules/@zuplo/runtime/out/esm/chunk-PXS4NOKU.js +102 -0
  58. package/node_modules/@zuplo/runtime/out/esm/chunk-PXS4NOKU.js.map +1 -0
  59. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  60. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  61. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  62. package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
  63. package/node_modules/@zuplo/runtime/package.json +2 -2
  64. package/node_modules/simple-git/LICENSE +20 -0
  65. package/node_modules/simple-git/dist/index.cjs +6 -0
  66. package/node_modules/simple-git/dist/index.cjs.map +1 -0
  67. package/node_modules/simple-git/dist/index.d.ts +5 -0
  68. package/node_modules/simple-git/dist/index.d.ts.map +1 -0
  69. package/node_modules/simple-git/dist/index.mjs +2895 -0
  70. package/node_modules/simple-git/dist/index.mjs.map +1 -0
  71. package/node_modules/simple-git/dist/src/lib/api.d.ts +13 -13
  72. package/node_modules/simple-git/dist/src/lib/api.d.ts.map +1 -0
  73. package/node_modules/simple-git/dist/src/lib/args/log-format.d.ts +1 -0
  74. package/node_modules/simple-git/dist/src/lib/args/log-format.d.ts.map +1 -0
  75. package/node_modules/simple-git/dist/src/lib/errors/git-configuration-error.d.ts +25 -0
  76. package/node_modules/simple-git/dist/src/lib/errors/git-configuration-error.d.ts.map +1 -0
  77. package/node_modules/simple-git/dist/src/lib/errors/git-construct-error.d.ts +2 -1
  78. package/node_modules/simple-git/dist/src/lib/errors/git-construct-error.d.ts.map +1 -0
  79. package/node_modules/simple-git/dist/src/lib/errors/git-error.d.ts +3 -2
  80. package/node_modules/simple-git/dist/src/lib/errors/git-error.d.ts.map +1 -0
  81. package/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts +2 -1
  82. package/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts.map +1 -0
  83. package/node_modules/simple-git/dist/src/lib/errors/git-response-error.d.ts +3 -2
  84. package/node_modules/simple-git/dist/src/lib/errors/git-response-error.d.ts.map +1 -0
  85. package/node_modules/simple-git/dist/src/lib/errors/task-configuration-error.d.ts +1 -0
  86. package/node_modules/simple-git/dist/src/lib/errors/task-configuration-error.d.ts.map +1 -0
  87. package/node_modules/simple-git/dist/src/lib/git-factory.d.ts +3 -15
  88. package/node_modules/simple-git/dist/src/lib/git-factory.d.ts.map +1 -0
  89. package/node_modules/simple-git/dist/src/lib/git-logger.d.ts +2 -1
  90. package/node_modules/simple-git/dist/src/lib/git-logger.d.ts.map +1 -0
  91. package/node_modules/simple-git/dist/src/lib/parsers/parse-branch-delete.d.ts +3 -2
  92. package/node_modules/simple-git/dist/src/lib/parsers/parse-branch-delete.d.ts.map +1 -0
  93. package/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +2 -1
  94. package/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts.map +1 -0
  95. package/node_modules/simple-git/dist/src/lib/{responses/CleanSummary.d.ts → parsers/parse-clean.d.ts} +5 -4
  96. package/node_modules/simple-git/dist/src/lib/parsers/parse-clean.d.ts.map +1 -0
  97. package/node_modules/simple-git/dist/src/lib/parsers/parse-commit.d.ts +2 -1
  98. package/node_modules/simple-git/dist/src/lib/parsers/parse-commit.d.ts.map +1 -0
  99. package/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts +1 -0
  100. package/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts.map +1 -0
  101. package/node_modules/simple-git/dist/src/lib/parsers/parse-fetch.d.ts +2 -1
  102. package/node_modules/simple-git/dist/src/lib/parsers/parse-fetch.d.ts.map +1 -0
  103. package/node_modules/simple-git/dist/src/lib/parsers/parse-list-log-summary.d.ts +2 -1
  104. package/node_modules/simple-git/dist/src/lib/parsers/parse-list-log-summary.d.ts.map +1 -0
  105. package/node_modules/simple-git/dist/src/lib/parsers/parse-merge.d.ts +3 -2
  106. package/node_modules/simple-git/dist/src/lib/parsers/parse-merge.d.ts.map +1 -0
  107. package/node_modules/simple-git/dist/src/lib/parsers/parse-move.d.ts +2 -1
  108. package/node_modules/simple-git/dist/src/lib/parsers/parse-move.d.ts.map +1 -0
  109. package/node_modules/simple-git/dist/src/lib/parsers/parse-pull.d.ts +3 -2
  110. package/node_modules/simple-git/dist/src/lib/parsers/parse-pull.d.ts.map +1 -0
  111. package/node_modules/simple-git/dist/src/lib/parsers/parse-push.d.ts +3 -2
  112. package/node_modules/simple-git/dist/src/lib/parsers/parse-push.d.ts.map +1 -0
  113. package/node_modules/simple-git/dist/src/lib/parsers/parse-remote-messages.d.ts +2 -1
  114. package/node_modules/simple-git/dist/src/lib/parsers/parse-remote-messages.d.ts.map +1 -0
  115. package/node_modules/simple-git/dist/src/lib/parsers/parse-remote-objects.d.ts +2 -1
  116. package/node_modules/simple-git/dist/src/lib/parsers/parse-remote-objects.d.ts.map +1 -0
  117. package/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts +3 -2
  118. package/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts.map +1 -0
  119. package/node_modules/simple-git/dist/src/lib/plugins/allow-environment.plugin.d.ts +3 -0
  120. package/node_modules/simple-git/dist/src/lib/plugins/allow-environment.plugin.d.ts.map +1 -0
  121. package/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts +1 -0
  122. package/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts.map +1 -0
  123. package/node_modules/simple-git/dist/src/lib/plugins/command-config-prefixing-plugin.d.ts +2 -1
  124. package/node_modules/simple-git/dist/src/lib/plugins/command-config-prefixing-plugin.d.ts.map +1 -0
  125. package/node_modules/simple-git/dist/src/lib/plugins/completion-detection.plugin.d.ts +3 -2
  126. package/node_modules/simple-git/dist/src/lib/plugins/completion-detection.plugin.d.ts.map +1 -0
  127. package/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts +2 -1
  128. package/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts.map +1 -0
  129. package/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +3 -2
  130. package/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts.map +1 -0
  131. package/node_modules/simple-git/dist/src/lib/plugins/index.d.ts +5 -1
  132. package/node_modules/simple-git/dist/src/lib/plugins/index.d.ts.map +1 -0
  133. package/node_modules/simple-git/dist/src/lib/plugins/input.plugin.d.ts +4 -0
  134. package/node_modules/simple-git/dist/src/lib/plugins/input.plugin.d.ts.map +1 -0
  135. package/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts +2 -1
  136. package/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts.map +1 -0
  137. package/node_modules/simple-git/dist/src/lib/plugins/progress-monitor-plugin.d.ts +3 -2
  138. package/node_modules/simple-git/dist/src/lib/plugins/progress-monitor-plugin.d.ts.map +1 -0
  139. package/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +8 -4
  140. package/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts.map +1 -0
  141. package/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +3 -2
  142. package/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts.map +1 -0
  143. package/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts +2 -1
  144. package/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts.map +1 -0
  145. package/node_modules/simple-git/dist/src/lib/plugins/{timout-plugin.d.ts → timeout-plugin.d.ts} +2 -1
  146. package/node_modules/simple-git/dist/src/lib/plugins/timeout-plugin.d.ts.map +1 -0
  147. package/node_modules/simple-git/dist/src/lib/responses/BranchDeleteSummary.d.ts +2 -1
  148. package/node_modules/simple-git/dist/src/lib/responses/BranchDeleteSummary.d.ts.map +1 -0
  149. package/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts +2 -1
  150. package/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts.map +1 -0
  151. package/node_modules/simple-git/dist/src/lib/responses/ConfigList.d.ts +2 -1
  152. package/node_modules/simple-git/dist/src/lib/responses/ConfigList.d.ts.map +1 -0
  153. package/node_modules/simple-git/dist/src/lib/responses/DiffSummary.d.ts +2 -1
  154. package/node_modules/simple-git/dist/src/lib/responses/DiffSummary.d.ts.map +1 -0
  155. package/node_modules/simple-git/dist/src/lib/responses/FileStatusSummary.d.ts +2 -1
  156. package/node_modules/simple-git/dist/src/lib/responses/FileStatusSummary.d.ts.map +1 -0
  157. package/node_modules/simple-git/dist/src/lib/responses/GetRemoteSummary.d.ts +1 -0
  158. package/node_modules/simple-git/dist/src/lib/responses/GetRemoteSummary.d.ts.map +1 -0
  159. package/node_modules/simple-git/dist/src/lib/responses/InitSummary.d.ts +2 -1
  160. package/node_modules/simple-git/dist/src/lib/responses/InitSummary.d.ts.map +1 -0
  161. package/node_modules/simple-git/dist/src/lib/responses/MergeSummary.d.ts +2 -1
  162. package/node_modules/simple-git/dist/src/lib/responses/MergeSummary.d.ts.map +1 -0
  163. package/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts +2 -1
  164. package/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts.map +1 -0
  165. package/node_modules/simple-git/dist/src/lib/responses/StatusSummary.d.ts +2 -1
  166. package/node_modules/simple-git/dist/src/lib/responses/StatusSummary.d.ts.map +1 -0
  167. package/node_modules/simple-git/dist/src/lib/responses/TagList.d.ts +2 -1
  168. package/node_modules/simple-git/dist/src/lib/responses/TagList.d.ts.map +1 -0
  169. package/node_modules/simple-git/dist/src/lib/runners/git-executor-chain.d.ts +5 -3
  170. package/node_modules/simple-git/dist/src/lib/runners/git-executor-chain.d.ts.map +1 -0
  171. package/node_modules/simple-git/dist/src/lib/runners/git-executor.d.ts +2 -1
  172. package/node_modules/simple-git/dist/src/lib/runners/git-executor.d.ts.map +1 -0
  173. package/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +1 -0
  174. package/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts.map +1 -0
  175. package/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +3 -2
  176. package/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts.map +1 -0
  177. package/node_modules/simple-git/dist/src/lib/simple-git-api.d.ts +3 -2
  178. package/node_modules/simple-git/dist/src/lib/simple-git-api.d.ts.map +1 -0
  179. package/node_modules/simple-git/dist/src/lib/task-callback.d.ts +2 -1
  180. package/node_modules/simple-git/dist/src/lib/task-callback.d.ts.map +1 -0
  181. package/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +2 -1
  182. package/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts.map +1 -0
  183. package/node_modules/simple-git/dist/src/lib/tasks/branch.d.ts +3 -2
  184. package/node_modules/simple-git/dist/src/lib/tasks/branch.d.ts.map +1 -0
  185. package/node_modules/simple-git/dist/src/lib/tasks/change-working-directory.d.ts +2 -1
  186. package/node_modules/simple-git/dist/src/lib/tasks/change-working-directory.d.ts.map +1 -0
  187. package/node_modules/simple-git/dist/src/lib/tasks/check-ignore.d.ts +2 -1
  188. package/node_modules/simple-git/dist/src/lib/tasks/check-ignore.d.ts.map +1 -0
  189. package/node_modules/simple-git/dist/src/lib/tasks/check-is-repo.d.ts +2 -1
  190. package/node_modules/simple-git/dist/src/lib/tasks/check-is-repo.d.ts.map +1 -0
  191. package/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts +2 -1
  192. package/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts.map +1 -0
  193. package/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +3 -2
  194. package/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts.map +1 -0
  195. package/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +4 -3
  196. package/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts.map +1 -0
  197. package/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts +2 -1
  198. package/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts.map +1 -0
  199. package/node_modules/simple-git/dist/src/lib/tasks/config.d.ts +2 -1
  200. package/node_modules/simple-git/dist/src/lib/tasks/config.d.ts.map +1 -0
  201. package/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts +2 -1
  202. package/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts.map +1 -0
  203. package/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts +1 -0
  204. package/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts.map +1 -0
  205. package/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts +4 -3
  206. package/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts.map +1 -0
  207. package/node_modules/simple-git/dist/src/lib/tasks/fetch.d.ts +4 -3
  208. package/node_modules/simple-git/dist/src/lib/tasks/fetch.d.ts.map +1 -0
  209. package/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts +2 -1
  210. package/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts.map +1 -0
  211. package/node_modules/simple-git/dist/src/lib/tasks/grep.d.ts +2 -1
  212. package/node_modules/simple-git/dist/src/lib/tasks/grep.d.ts.map +1 -0
  213. package/node_modules/simple-git/dist/src/lib/tasks/hash-object.d.ts +2 -1
  214. package/node_modules/simple-git/dist/src/lib/tasks/hash-object.d.ts.map +1 -0
  215. package/node_modules/simple-git/dist/src/lib/tasks/init.d.ts +3 -2
  216. package/node_modules/simple-git/dist/src/lib/tasks/init.d.ts.map +1 -0
  217. package/node_modules/simple-git/dist/src/lib/tasks/interpret-trailers.d.ts +3 -0
  218. package/node_modules/simple-git/dist/src/lib/tasks/interpret-trailers.d.ts.map +1 -0
  219. package/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +3 -2
  220. package/node_modules/simple-git/dist/src/lib/tasks/log.d.ts.map +1 -0
  221. package/node_modules/simple-git/dist/src/lib/tasks/merge.d.ts +4 -3
  222. package/node_modules/simple-git/dist/src/lib/tasks/merge.d.ts.map +1 -0
  223. package/node_modules/simple-git/dist/src/lib/tasks/move.d.ts +3 -2
  224. package/node_modules/simple-git/dist/src/lib/tasks/move.d.ts.map +1 -0
  225. package/node_modules/simple-git/dist/src/lib/tasks/pull.d.ts +3 -2
  226. package/node_modules/simple-git/dist/src/lib/tasks/pull.d.ts.map +1 -0
  227. package/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +3 -2
  228. package/node_modules/simple-git/dist/src/lib/tasks/push.d.ts.map +1 -0
  229. package/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +1 -0
  230. package/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts.map +1 -0
  231. package/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +1 -0
  232. package/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts.map +1 -0
  233. package/node_modules/simple-git/dist/src/lib/tasks/show.d.ts +2 -1
  234. package/node_modules/simple-git/dist/src/lib/tasks/show.d.ts.map +1 -0
  235. package/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +2 -1
  236. package/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts.map +1 -0
  237. package/node_modules/simple-git/dist/src/lib/tasks/status.d.ts +3 -2
  238. package/node_modules/simple-git/dist/src/lib/tasks/status.d.ts.map +1 -0
  239. package/node_modules/simple-git/dist/src/lib/tasks/sub-module.d.ts +2 -1
  240. package/node_modules/simple-git/dist/src/lib/tasks/sub-module.d.ts.map +1 -0
  241. package/node_modules/simple-git/dist/src/lib/tasks/tag.d.ts +3 -2
  242. package/node_modules/simple-git/dist/src/lib/tasks/tag.d.ts.map +1 -0
  243. package/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +1 -0
  244. package/node_modules/simple-git/dist/src/lib/tasks/task.d.ts.map +1 -0
  245. package/node_modules/simple-git/dist/src/lib/tasks/version.d.ts +2 -1
  246. package/node_modules/simple-git/dist/src/lib/tasks/version.d.ts.map +1 -0
  247. package/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +2 -1
  248. package/node_modules/simple-git/dist/src/lib/types/handlers.d.ts.map +1 -0
  249. package/node_modules/simple-git/dist/src/lib/types/index.d.ts +19 -2
  250. package/node_modules/simple-git/dist/src/lib/types/index.d.ts.map +1 -0
  251. package/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +4 -2
  252. package/node_modules/simple-git/dist/src/lib/types/tasks.d.ts.map +1 -0
  253. package/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +2 -0
  254. package/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts.map +1 -0
  255. package/node_modules/simple-git/dist/src/lib/utils/exit-codes.d.ts +1 -0
  256. package/node_modules/simple-git/dist/src/lib/utils/exit-codes.d.ts.map +1 -0
  257. package/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +2 -1
  258. package/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts.map +1 -0
  259. package/node_modules/simple-git/dist/src/lib/utils/index.d.ts +1 -0
  260. package/node_modules/simple-git/dist/src/lib/utils/index.d.ts.map +1 -0
  261. package/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +1 -0
  262. package/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts.map +1 -0
  263. package/node_modules/simple-git/dist/src/lib/utils/simple-git-options.d.ts +2 -1
  264. package/node_modules/simple-git/dist/src/lib/utils/simple-git-options.d.ts.map +1 -0
  265. package/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +2 -1
  266. package/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts.map +1 -0
  267. package/node_modules/simple-git/dist/src/lib/utils/task-parser.d.ts +3 -2
  268. package/node_modules/simple-git/dist/src/lib/utils/task-parser.d.ts.map +1 -0
  269. package/node_modules/simple-git/dist/src/lib/utils/util.d.ts +2 -0
  270. package/node_modules/simple-git/dist/src/lib/utils/util.d.ts.map +1 -0
  271. package/node_modules/simple-git/dist/src/typings/index.d.ts +4 -0
  272. package/node_modules/simple-git/dist/src/typings/index.d.ts.map +1 -0
  273. package/node_modules/simple-git/dist/src/typings/response.d.ts +479 -0
  274. package/node_modules/simple-git/dist/src/typings/response.d.ts.map +1 -0
  275. package/node_modules/simple-git/dist/src/typings/simple-git.d.ts +517 -0
  276. package/node_modules/simple-git/dist/src/typings/simple-git.d.ts.map +1 -0
  277. package/node_modules/simple-git/dist/src/typings/types.d.ts +11 -0
  278. package/node_modules/simple-git/dist/src/typings/types.d.ts.map +1 -0
  279. package/node_modules/simple-git/package.json +12 -16
  280. package/node_modules/simple-git/readme.md +29 -47
  281. package/node_modules/undici/docs/docs/api/Client.md +2 -0
  282. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +3 -1
  283. package/node_modules/undici/docs/docs/api/Dispatcher.md +1 -0
  284. package/node_modules/undici/lib/core/connect.js +10 -4
  285. package/node_modules/undici/lib/core/request.js +23 -2
  286. package/node_modules/undici/lib/core/symbols.js +1 -0
  287. package/node_modules/undici/lib/dispatcher/agent.js +6 -2
  288. package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
  289. package/node_modules/undici/lib/dispatcher/client-h1.js +23 -10
  290. package/node_modules/undici/lib/dispatcher/client-h2.js +84 -23
  291. package/node_modules/undici/lib/dispatcher/client.js +9 -4
  292. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
  293. package/node_modules/undici/lib/handler/cache-handler.js +69 -5
  294. package/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
  295. package/node_modules/undici/lib/handler/redirect-handler.js +8 -1
  296. package/node_modules/undici/lib/handler/retry-handler.js +109 -23
  297. package/node_modules/undici/lib/interceptor/cache.js +20 -1
  298. package/node_modules/undici/lib/interceptor/decompress.js +348 -46
  299. package/node_modules/undici/lib/interceptor/dump.js +10 -23
  300. package/node_modules/undici/lib/web/cookies/index.js +3 -1
  301. package/node_modules/undici/lib/web/cookies/parse.js +138 -137
  302. package/node_modules/undici/lib/web/cookies/util.js +21 -2
  303. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +325 -149
  304. package/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
  305. package/node_modules/undici/lib/web/fetch/index.js +3 -3
  306. package/node_modules/undici/lib/web/infra/index.js +14 -0
  307. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  308. package/node_modules/undici/lib/web/websocket/connection.js +19 -9
  309. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  310. package/node_modules/undici/lib/web/websocket/receiver.js +13 -0
  311. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  312. package/node_modules/undici/package.json +1 -1
  313. package/node_modules/undici/types/client.d.ts +14 -0
  314. package/node_modules/undici/types/interceptors.d.ts +2 -0
  315. package/node_modules/zod/README.md +29 -2
  316. package/node_modules/zod/compile.cjs +96 -0
  317. package/node_modules/zod/compile.d.cts +1 -0
  318. package/node_modules/zod/compile.d.ts +1 -0
  319. package/node_modules/zod/compile.js +52 -0
  320. package/node_modules/zod/index.cjs +21 -2
  321. package/node_modules/zod/index.d.cts +1 -2
  322. package/node_modules/zod/index.d.ts +1 -2
  323. package/node_modules/zod/index.js +5 -2
  324. package/node_modules/zod/locales/index.cjs +19 -0
  325. package/node_modules/zod/mini/index.cjs +19 -0
  326. package/node_modules/zod/package.json +20 -8
  327. package/node_modules/zod/src/compile.ts +56 -0
  328. package/node_modules/zod/src/index.ts +5 -2
  329. package/node_modules/zod/src/v3/ZodError.ts +22 -12
  330. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  331. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  332. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  333. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  334. package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
  335. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  336. package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
  337. package/node_modules/zod/src/v3/types.ts +5 -5
  338. package/node_modules/zod/src/v4/classic/checks.ts +1 -0
  339. package/node_modules/zod/src/v4/classic/compat.ts +26 -18
  340. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  341. package/node_modules/zod/src/v4/classic/errors.ts +59 -44
  342. package/node_modules/zod/src/v4/classic/external.ts +14 -9
  343. package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
  344. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  345. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  346. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  347. package/node_modules/zod/src/v4/classic/parse.ts +10 -4
  348. package/node_modules/zod/src/v4/classic/schemas.ts +640 -375
  349. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
  350. package/node_modules/zod/src/v4/classic/tests/array.test.ts +29 -2
  351. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +186 -0
  352. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
  353. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
  354. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
  355. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
  356. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
  357. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  358. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  359. package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
  360. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
  361. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  362. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  363. package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
  364. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
  365. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
  366. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
  367. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
  368. package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
  369. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
  370. package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
  371. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
  372. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
  373. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  374. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  375. package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
  376. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  377. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
  378. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
  379. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  380. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
  381. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  382. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
  383. package/node_modules/zod/src/v4/classic/tests/map.test.ts +19 -0
  384. package/node_modules/zod/src/v4/classic/tests/number.test.ts +85 -9
  385. package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
  386. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  387. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
  388. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
  389. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  390. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
  391. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  392. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
  393. package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
  394. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
  395. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  396. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
  397. package/node_modules/zod/src/v4/classic/tests/set.test.ts +15 -0
  398. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  399. package/node_modules/zod/src/v4/classic/tests/string.test.ts +222 -6
  400. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
  401. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
  402. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1812 -204
  403. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
  404. package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
  405. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  406. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  407. package/node_modules/zod/src/v4/core/api.ts +87 -35
  408. package/node_modules/zod/src/v4/core/checks.ts +119 -146
  409. package/node_modules/zod/src/v4/core/compile.ts +2322 -0
  410. package/node_modules/zod/src/v4/core/core.ts +99 -22
  411. package/node_modules/zod/src/v4/core/doc.ts +17 -9
  412. package/node_modules/zod/src/v4/core/errors.ts +113 -25
  413. package/node_modules/zod/src/v4/core/index.ts +3 -0
  414. package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
  415. package/node_modules/zod/src/v4/core/json-schema-processors.ts +424 -156
  416. package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
  417. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  418. package/node_modules/zod/src/v4/core/parse.ts +164 -50
  419. package/node_modules/zod/src/v4/core/regexes.ts +42 -15
  420. package/node_modules/zod/src/v4/core/registries.ts +2 -2
  421. package/node_modules/zod/src/v4/core/schemas.ts +1035 -539
  422. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  423. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  424. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  425. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  426. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  427. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  428. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  429. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  430. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
  431. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
  432. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
  433. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  434. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  435. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  436. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  437. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  438. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  439. package/node_modules/zod/src/v4/core/to-json-schema.ts +283 -48
  440. package/node_modules/zod/src/v4/core/util.ts +467 -157
  441. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  442. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  443. package/node_modules/zod/src/v4/index.ts +3 -3
  444. package/node_modules/zod/src/v4/locales/ar.ts +5 -0
  445. package/node_modules/zod/src/v4/locales/az.ts +5 -0
  446. package/node_modules/zod/src/v4/locales/be.ts +12 -0
  447. package/node_modules/zod/src/v4/locales/bg.ts +5 -0
  448. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  449. package/node_modules/zod/src/v4/locales/ca.ts +5 -0
  450. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  451. package/node_modules/zod/src/v4/locales/cs.ts +5 -0
  452. package/node_modules/zod/src/v4/locales/da.ts +7 -2
  453. package/node_modules/zod/src/v4/locales/de.ts +5 -0
  454. package/node_modules/zod/src/v4/locales/el.ts +3 -0
  455. package/node_modules/zod/src/v4/locales/en.ts +17 -4
  456. package/node_modules/zod/src/v4/locales/eo.ts +5 -0
  457. package/node_modules/zod/src/v4/locales/es.ts +4 -0
  458. package/node_modules/zod/src/v4/locales/fa.ts +5 -0
  459. package/node_modules/zod/src/v4/locales/fi.ts +5 -0
  460. package/node_modules/zod/src/v4/locales/fr-CA.ts +5 -0
  461. package/node_modules/zod/src/v4/locales/fr.ts +21 -14
  462. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  463. package/node_modules/zod/src/v4/locales/he.ts +8 -1
  464. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  465. package/node_modules/zod/src/v4/locales/hr.ts +4 -0
  466. package/node_modules/zod/src/v4/locales/hu.ts +5 -0
  467. package/node_modules/zod/src/v4/locales/hy.ts +11 -0
  468. package/node_modules/zod/src/v4/locales/id.ts +5 -0
  469. package/node_modules/zod/src/v4/locales/index.ts +11 -0
  470. package/node_modules/zod/src/v4/locales/is.ts +5 -0
  471. package/node_modules/zod/src/v4/locales/it.ts +5 -0
  472. package/node_modules/zod/src/v4/locales/ja.ts +5 -0
  473. package/node_modules/zod/src/v4/locales/ka.ts +5 -0
  474. package/node_modules/zod/src/v4/locales/km.ts +5 -0
  475. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  476. package/node_modules/zod/src/v4/locales/ko.ts +5 -0
  477. package/node_modules/zod/src/v4/locales/lt.ts +4 -0
  478. package/node_modules/zod/src/v4/locales/mk.ts +5 -0
  479. package/node_modules/zod/src/v4/locales/ms.ts +5 -0
  480. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  481. package/node_modules/zod/src/v4/locales/nl.ts +5 -0
  482. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  483. package/node_modules/zod/src/v4/locales/no.ts +7 -2
  484. package/node_modules/zod/src/v4/locales/ota.ts +5 -0
  485. package/node_modules/zod/src/v4/locales/pl.ts +5 -0
  486. package/node_modules/zod/src/v4/locales/ps.ts +5 -0
  487. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  488. package/node_modules/zod/src/v4/locales/pt.ts +101 -58
  489. package/node_modules/zod/src/v4/locales/ro.ts +3 -0
  490. package/node_modules/zod/src/v4/locales/ru.ts +12 -0
  491. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  492. package/node_modules/zod/src/v4/locales/sl.ts +5 -0
  493. package/node_modules/zod/src/v4/locales/sv.ts +7 -2
  494. package/node_modules/zod/src/v4/locales/ta.ts +5 -0
  495. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  496. package/node_modules/zod/src/v4/locales/th.ts +5 -0
  497. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  498. package/node_modules/zod/src/v4/locales/tr.ts +5 -0
  499. package/node_modules/zod/src/v4/locales/uk.ts +5 -0
  500. package/node_modules/zod/src/v4/locales/ur.ts +5 -0
  501. package/node_modules/zod/src/v4/locales/uz.ts +3 -0
  502. package/node_modules/zod/src/v4/locales/vi.ts +5 -0
  503. package/node_modules/zod/src/v4/locales/yo.ts +5 -0
  504. package/node_modules/zod/src/v4/locales/zh-CN.ts +5 -0
  505. package/node_modules/zod/src/v4/locales/zh-TW.ts +5 -0
  506. package/node_modules/zod/src/v4/mini/checks.ts +1 -0
  507. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  508. package/node_modules/zod/src/v4/mini/external.ts +12 -1
  509. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  510. package/node_modules/zod/src/v4/mini/parse.ts +2 -0
  511. package/node_modules/zod/src/v4/mini/schemas.ts +167 -63
  512. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
  513. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
  514. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  515. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
  516. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  517. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  518. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  519. package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
  520. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
  521. package/node_modules/zod/src/v4/mini/tests/index.test.ts +158 -5
  522. package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
  523. package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
  524. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  525. package/node_modules/zod/src/v4/mini/tests/string.test.ts +44 -0
  526. package/node_modules/zod/v3/ZodError.cjs +41 -12
  527. package/node_modules/zod/v3/ZodError.d.cts +1 -1
  528. package/node_modules/zod/v3/ZodError.d.ts +1 -1
  529. package/node_modules/zod/v3/ZodError.js +22 -12
  530. package/node_modules/zod/v3/errors.cjs +19 -0
  531. package/node_modules/zod/v3/external.cjs +19 -0
  532. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  533. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  534. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  535. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  536. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  537. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  538. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  539. package/node_modules/zod/v3/index.cjs +19 -0
  540. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  541. package/node_modules/zod/v3/types.cjs +26 -5
  542. package/node_modules/zod/v3/types.js +7 -5
  543. package/node_modules/zod/v4/classic/checks.cjs +21 -1
  544. package/node_modules/zod/v4/classic/checks.d.cts +1 -1
  545. package/node_modules/zod/v4/classic/checks.d.ts +1 -1
  546. package/node_modules/zod/v4/classic/checks.js +1 -1
  547. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  548. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  549. package/node_modules/zod/v4/classic/compat.d.cts +9 -11
  550. package/node_modules/zod/v4/classic/compat.d.ts +9 -11
  551. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  552. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  553. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  554. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  555. package/node_modules/zod/v4/classic/errors.cjs +62 -34
  556. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  557. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  558. package/node_modules/zod/v4/classic/errors.js +43 -34
  559. package/node_modules/zod/v4/classic/external.cjs +51 -27
  560. package/node_modules/zod/v4/classic/external.d.cts +5 -2
  561. package/node_modules/zod/v4/classic/external.d.ts +5 -2
  562. package/node_modules/zod/v4/classic/external.js +5 -8
  563. package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
  564. package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
  565. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  566. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  567. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  568. package/node_modules/zod/v4/classic/in-out.js +36 -0
  569. package/node_modules/zod/v4/classic/index.cjs +21 -2
  570. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  571. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  572. package/node_modules/zod/v4/classic/index.js +2 -2
  573. package/node_modules/zod/v4/classic/iso.cjs +30 -22
  574. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  575. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  576. package/node_modules/zod/v4/classic/iso.js +2 -17
  577. package/node_modules/zod/v4/classic/parse.cjs +23 -1
  578. package/node_modules/zod/v4/classic/parse.d.cts +17 -4
  579. package/node_modules/zod/v4/classic/parse.d.ts +17 -4
  580. package/node_modules/zod/v4/classic/parse.js +1 -0
  581. package/node_modules/zod/v4/classic/schemas.cjs +591 -426
  582. package/node_modules/zod/v4/classic/schemas.d.cts +68 -19
  583. package/node_modules/zod/v4/classic/schemas.d.ts +68 -19
  584. package/node_modules/zod/v4/classic/schemas.js +564 -424
  585. package/node_modules/zod/v4/core/api.cjs +66 -24
  586. package/node_modules/zod/v4/core/api.d.cts +22 -12
  587. package/node_modules/zod/v4/core/api.d.ts +22 -12
  588. package/node_modules/zod/v4/core/api.js +44 -24
  589. package/node_modules/zod/v4/core/checks.cjs +88 -128
  590. package/node_modules/zod/v4/core/checks.d.cts +29 -13
  591. package/node_modules/zod/v4/core/checks.d.ts +29 -13
  592. package/node_modules/zod/v4/core/checks.js +68 -127
  593. package/node_modules/zod/v4/core/compile.cjs +1916 -0
  594. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  595. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  596. package/node_modules/zod/v4/core/compile.js +1866 -0
  597. package/node_modules/zod/v4/core/core.cjs +101 -19
  598. package/node_modules/zod/v4/core/core.d.cts +16 -4
  599. package/node_modules/zod/v4/core/core.d.ts +16 -4
  600. package/node_modules/zod/v4/core/core.js +83 -20
  601. package/node_modules/zod/v4/core/doc.cjs +31 -9
  602. package/node_modules/zod/v4/core/doc.d.cts +3 -1
  603. package/node_modules/zod/v4/core/doc.d.ts +3 -1
  604. package/node_modules/zod/v4/core/doc.js +12 -9
  605. package/node_modules/zod/v4/core/errors.cjs +126 -25
  606. package/node_modules/zod/v4/core/errors.d.cts +4 -0
  607. package/node_modules/zod/v4/core/errors.d.ts +4 -0
  608. package/node_modules/zod/v4/core/errors.js +107 -25
  609. package/node_modules/zod/v4/core/index.cjs +24 -1
  610. package/node_modules/zod/v4/core/index.d.cts +3 -0
  611. package/node_modules/zod/v4/core/index.d.ts +3 -0
  612. package/node_modules/zod/v4/core/index.js +3 -0
  613. package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
  614. package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
  615. package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
  616. package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
  617. package/node_modules/zod/v4/core/json-schema-processors.cjs +441 -156
  618. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  619. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  620. package/node_modules/zod/v4/core/json-schema-processors.js +400 -158
  621. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  622. package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
  623. package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
  624. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  625. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  626. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  627. package/node_modules/zod/v4/core/memoizer.js +311 -0
  628. package/node_modules/zod/v4/core/parse.cjs +148 -46
  629. package/node_modules/zod/v4/core/parse.d.cts +14 -11
  630. package/node_modules/zod/v4/core/parse.d.ts +14 -11
  631. package/node_modules/zod/v4/core/parse.js +127 -45
  632. package/node_modules/zod/v4/core/regexes.cjs +54 -17
  633. package/node_modules/zod/v4/core/regexes.d.cts +5 -0
  634. package/node_modules/zod/v4/core/regexes.d.ts +5 -0
  635. package/node_modules/zod/v4/core/regexes.js +32 -15
  636. package/node_modules/zod/v4/core/registries.cjs +19 -0
  637. package/node_modules/zod/v4/core/registries.js +2 -2
  638. package/node_modules/zod/v4/core/schemas.cjs +815 -386
  639. package/node_modules/zod/v4/core/schemas.d.cts +126 -35
  640. package/node_modules/zod/v4/core/schemas.d.ts +126 -35
  641. package/node_modules/zod/v4/core/schemas.js +783 -386
  642. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  643. package/node_modules/zod/v4/core/to-json-schema.cjs +269 -45
  644. package/node_modules/zod/v4/core/to-json-schema.d.cts +45 -5
  645. package/node_modules/zod/v4/core/to-json-schema.d.ts +45 -5
  646. package/node_modules/zod/v4/core/to-json-schema.js +247 -44
  647. package/node_modules/zod/v4/core/util.cjs +387 -157
  648. package/node_modules/zod/v4/core/util.d.cts +81 -1
  649. package/node_modules/zod/v4/core/util.d.ts +81 -1
  650. package/node_modules/zod/v4/core/util.js +355 -156
  651. package/node_modules/zod/v4/core/versions.cjs +21 -2
  652. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  653. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  654. package/node_modules/zod/v4/core/versions.js +2 -2
  655. package/node_modules/zod/v4/core/visit.cjs +214 -0
  656. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  657. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  658. package/node_modules/zod/v4/core/visit.js +169 -0
  659. package/node_modules/zod/v4/index.cjs +34 -5
  660. package/node_modules/zod/v4/index.d.cts +2 -2
  661. package/node_modules/zod/v4/index.d.ts +2 -2
  662. package/node_modules/zod/v4/index.js +3 -2
  663. package/node_modules/zod/v4/locales/ar.cjs +5 -0
  664. package/node_modules/zod/v4/locales/ar.js +5 -0
  665. package/node_modules/zod/v4/locales/az.cjs +5 -0
  666. package/node_modules/zod/v4/locales/az.js +5 -0
  667. package/node_modules/zod/v4/locales/be.cjs +12 -0
  668. package/node_modules/zod/v4/locales/be.js +12 -0
  669. package/node_modules/zod/v4/locales/bg.cjs +5 -0
  670. package/node_modules/zod/v4/locales/bg.js +5 -0
  671. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  672. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  673. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  674. package/node_modules/zod/v4/locales/bn.js +113 -0
  675. package/node_modules/zod/v4/locales/ca.cjs +5 -0
  676. package/node_modules/zod/v4/locales/ca.js +5 -0
  677. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  678. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  679. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  680. package/node_modules/zod/v4/locales/ckb.js +133 -0
  681. package/node_modules/zod/v4/locales/cs.cjs +5 -0
  682. package/node_modules/zod/v4/locales/cs.js +5 -0
  683. package/node_modules/zod/v4/locales/da.cjs +7 -2
  684. package/node_modules/zod/v4/locales/da.js +7 -2
  685. package/node_modules/zod/v4/locales/de.cjs +5 -0
  686. package/node_modules/zod/v4/locales/de.js +5 -0
  687. package/node_modules/zod/v4/locales/el.cjs +3 -0
  688. package/node_modules/zod/v4/locales/el.js +3 -0
  689. package/node_modules/zod/v4/locales/en.cjs +16 -4
  690. package/node_modules/zod/v4/locales/en.js +16 -4
  691. package/node_modules/zod/v4/locales/eo.cjs +5 -0
  692. package/node_modules/zod/v4/locales/eo.js +5 -0
  693. package/node_modules/zod/v4/locales/es.cjs +4 -0
  694. package/node_modules/zod/v4/locales/es.js +4 -0
  695. package/node_modules/zod/v4/locales/fa.cjs +5 -0
  696. package/node_modules/zod/v4/locales/fa.js +5 -0
  697. package/node_modules/zod/v4/locales/fi.cjs +5 -0
  698. package/node_modules/zod/v4/locales/fi.js +5 -0
  699. package/node_modules/zod/v4/locales/fr-CA.cjs +5 -0
  700. package/node_modules/zod/v4/locales/fr-CA.js +5 -0
  701. package/node_modules/zod/v4/locales/fr.cjs +18 -14
  702. package/node_modules/zod/v4/locales/fr.js +18 -14
  703. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  704. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  705. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  706. package/node_modules/zod/v4/locales/gu.js +113 -0
  707. package/node_modules/zod/v4/locales/he.cjs +7 -0
  708. package/node_modules/zod/v4/locales/he.js +7 -0
  709. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  710. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  711. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  712. package/node_modules/zod/v4/locales/hi.js +111 -0
  713. package/node_modules/zod/v4/locales/hr.cjs +4 -0
  714. package/node_modules/zod/v4/locales/hr.js +4 -0
  715. package/node_modules/zod/v4/locales/hu.cjs +5 -0
  716. package/node_modules/zod/v4/locales/hu.js +5 -0
  717. package/node_modules/zod/v4/locales/hy.cjs +11 -0
  718. package/node_modules/zod/v4/locales/hy.js +11 -0
  719. package/node_modules/zod/v4/locales/id.cjs +5 -0
  720. package/node_modules/zod/v4/locales/id.js +5 -0
  721. package/node_modules/zod/v4/locales/index.cjs +43 -2
  722. package/node_modules/zod/v4/locales/index.d.cts +11 -0
  723. package/node_modules/zod/v4/locales/index.d.ts +11 -0
  724. package/node_modules/zod/v4/locales/index.js +11 -0
  725. package/node_modules/zod/v4/locales/is.cjs +5 -0
  726. package/node_modules/zod/v4/locales/is.js +5 -0
  727. package/node_modules/zod/v4/locales/it.cjs +5 -0
  728. package/node_modules/zod/v4/locales/it.js +5 -0
  729. package/node_modules/zod/v4/locales/ja.cjs +5 -0
  730. package/node_modules/zod/v4/locales/ja.js +5 -0
  731. package/node_modules/zod/v4/locales/ka.cjs +5 -0
  732. package/node_modules/zod/v4/locales/ka.js +5 -0
  733. package/node_modules/zod/v4/locales/km.cjs +5 -0
  734. package/node_modules/zod/v4/locales/km.js +5 -0
  735. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  736. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  737. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  738. package/node_modules/zod/v4/locales/kn.js +116 -0
  739. package/node_modules/zod/v4/locales/ko.cjs +5 -0
  740. package/node_modules/zod/v4/locales/ko.js +5 -0
  741. package/node_modules/zod/v4/locales/lt.cjs +4 -0
  742. package/node_modules/zod/v4/locales/lt.js +4 -0
  743. package/node_modules/zod/v4/locales/mk.cjs +5 -0
  744. package/node_modules/zod/v4/locales/mk.js +5 -0
  745. package/node_modules/zod/v4/locales/ms.cjs +5 -0
  746. package/node_modules/zod/v4/locales/ms.js +5 -0
  747. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  748. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  749. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  750. package/node_modules/zod/v4/locales/ne.js +111 -0
  751. package/node_modules/zod/v4/locales/nl.cjs +5 -0
  752. package/node_modules/zod/v4/locales/nl.js +5 -0
  753. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  754. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  755. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  756. package/node_modules/zod/v4/locales/nn.js +113 -0
  757. package/node_modules/zod/v4/locales/no.cjs +7 -2
  758. package/node_modules/zod/v4/locales/no.js +7 -2
  759. package/node_modules/zod/v4/locales/ota.cjs +5 -0
  760. package/node_modules/zod/v4/locales/ota.js +5 -0
  761. package/node_modules/zod/v4/locales/pl.cjs +5 -0
  762. package/node_modules/zod/v4/locales/pl.js +5 -0
  763. package/node_modules/zod/v4/locales/ps.cjs +5 -0
  764. package/node_modules/zod/v4/locales/ps.js +5 -0
  765. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  766. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  767. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  768. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  769. package/node_modules/zod/v4/locales/pt.cjs +89 -55
  770. package/node_modules/zod/v4/locales/pt.js +89 -55
  771. package/node_modules/zod/v4/locales/ro.cjs +3 -0
  772. package/node_modules/zod/v4/locales/ro.js +3 -0
  773. package/node_modules/zod/v4/locales/ru.cjs +12 -0
  774. package/node_modules/zod/v4/locales/ru.js +12 -0
  775. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  776. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  777. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  778. package/node_modules/zod/v4/locales/sk.js +116 -0
  779. package/node_modules/zod/v4/locales/sl.cjs +5 -0
  780. package/node_modules/zod/v4/locales/sl.js +5 -0
  781. package/node_modules/zod/v4/locales/sv.cjs +7 -2
  782. package/node_modules/zod/v4/locales/sv.js +7 -2
  783. package/node_modules/zod/v4/locales/ta.cjs +5 -0
  784. package/node_modules/zod/v4/locales/ta.js +5 -0
  785. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  786. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  787. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  788. package/node_modules/zod/v4/locales/tg.js +117 -0
  789. package/node_modules/zod/v4/locales/th.cjs +5 -0
  790. package/node_modules/zod/v4/locales/th.js +5 -0
  791. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  792. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  793. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  794. package/node_modules/zod/v4/locales/tk.js +107 -0
  795. package/node_modules/zod/v4/locales/tr.cjs +5 -0
  796. package/node_modules/zod/v4/locales/tr.js +5 -0
  797. package/node_modules/zod/v4/locales/uk.cjs +5 -0
  798. package/node_modules/zod/v4/locales/uk.js +5 -0
  799. package/node_modules/zod/v4/locales/ur.cjs +5 -0
  800. package/node_modules/zod/v4/locales/ur.js +5 -0
  801. package/node_modules/zod/v4/locales/uz.cjs +3 -0
  802. package/node_modules/zod/v4/locales/uz.js +3 -0
  803. package/node_modules/zod/v4/locales/vi.cjs +5 -0
  804. package/node_modules/zod/v4/locales/vi.js +5 -0
  805. package/node_modules/zod/v4/locales/yo.cjs +5 -0
  806. package/node_modules/zod/v4/locales/yo.js +5 -0
  807. package/node_modules/zod/v4/locales/zh-CN.cjs +5 -0
  808. package/node_modules/zod/v4/locales/zh-CN.js +5 -0
  809. package/node_modules/zod/v4/locales/zh-TW.cjs +5 -0
  810. package/node_modules/zod/v4/locales/zh-TW.js +5 -0
  811. package/node_modules/zod/v4/mini/checks.cjs +21 -1
  812. package/node_modules/zod/v4/mini/checks.d.cts +1 -1
  813. package/node_modules/zod/v4/mini/checks.d.ts +1 -1
  814. package/node_modules/zod/v4/mini/checks.js +1 -1
  815. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  816. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  817. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  818. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  819. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  820. package/node_modules/zod/v4/mini/external.cjs +33 -1
  821. package/node_modules/zod/v4/mini/external.d.cts +5 -2
  822. package/node_modules/zod/v4/mini/external.d.ts +5 -2
  823. package/node_modules/zod/v4/mini/external.js +3 -1
  824. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  825. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  826. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  827. package/node_modules/zod/v4/mini/in-out.js +36 -0
  828. package/node_modules/zod/v4/mini/index.cjs +19 -0
  829. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  830. package/node_modules/zod/v4/mini/parse.cjs +22 -1
  831. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  832. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  833. package/node_modules/zod/v4/mini/parse.js +1 -1
  834. package/node_modules/zod/v4/mini/schemas.cjs +117 -53
  835. package/node_modules/zod/v4/mini/schemas.d.cts +49 -14
  836. package/node_modules/zod/v4/mini/schemas.d.ts +49 -14
  837. package/node_modules/zod/v4/mini/schemas.js +92 -51
  838. package/node_modules/zod/v4-mini/index.cjs +19 -0
  839. package/package.json +14 -14
  840. package/node_modules/@zuplo/runtime/out/esm/chunk-DVFQRFED.js.map +0 -1
  841. package/node_modules/@zuplo/runtime/out/esm/chunk-FQIUJWH2.js +0 -105
  842. package/node_modules/@zuplo/runtime/out/esm/chunk-FQIUJWH2.js.map +0 -1
  843. package/node_modules/simple-git/dist/cjs/index.js +0 -4898
  844. package/node_modules/simple-git/dist/cjs/index.js.map +0 -7
  845. package/node_modules/simple-git/dist/esm/index.js +0 -4745
  846. package/node_modules/simple-git/dist/esm/index.js.map +0 -7
  847. package/node_modules/simple-git/dist/esm/package.json +0 -3
  848. package/node_modules/simple-git/dist/src/lib/responses/CheckIgnore.d.ts +0 -4
  849. package/node_modules/simple-git/dist/src/lib/runners/promise-wrapped.d.ts +0 -2
  850. package/node_modules/simple-git/dist/typings/errors.d.ts +0 -5
  851. package/node_modules/simple-git/dist/typings/index.d.ts +0 -14
  852. package/node_modules/simple-git/dist/typings/response.d.ts +0 -556
  853. package/node_modules/simple-git/dist/typings/simple-git.d.ts +0 -1033
  854. package/node_modules/simple-git/dist/typings/types.d.ts +0 -22
  855. package/node_modules/simple-git/promise.js +0 -17
  856. package/node_modules/zod/src/v4/core/config.ts +0 -15
  857. /package/node_modules/@zuplo/runtime/out/esm/{chunk-DVFQRFED.js.LEGAL.txt → chunk-NWYAKCSU.js.LEGAL.txt} +0 -0
  858. /package/node_modules/@zuplo/runtime/out/esm/{chunk-FQIUJWH2.js.LEGAL.txt → chunk-PXS4NOKU.js.LEGAL.txt} +0 -0
@@ -23,11 +23,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.$ZodTuple = exports.$ZodIntersection = exports.$ZodDiscriminatedUnion = exports.$ZodXor = exports.$ZodUnion = exports.$ZodObjectJIT = exports.$ZodObject = exports.$ZodArray = exports.$ZodDate = exports.$ZodVoid = exports.$ZodNever = exports.$ZodUnknown = exports.$ZodAny = exports.$ZodNull = exports.$ZodUndefined = exports.$ZodSymbol = exports.$ZodBigIntFormat = exports.$ZodBigInt = exports.$ZodBoolean = exports.$ZodNumberFormat = exports.$ZodNumber = exports.$ZodCustomStringFormat = exports.$ZodJWT = exports.$ZodE164 = exports.$ZodBase64URL = exports.$ZodBase64 = exports.$ZodCIDRv6 = exports.$ZodCIDRv4 = exports.$ZodMAC = exports.$ZodIPv6 = exports.$ZodIPv4 = exports.$ZodISODuration = exports.$ZodISOTime = exports.$ZodISODate = exports.$ZodISODateTime = exports.$ZodKSUID = exports.$ZodXID = exports.$ZodULID = exports.$ZodCUID2 = exports.$ZodCUID = exports.$ZodNanoID = exports.$ZodEmoji = exports.$ZodURL = exports.$ZodEmail = exports.$ZodUUID = exports.$ZodGUID = exports.$ZodStringFormat = exports.$ZodString = exports.clone = exports.$ZodType = void 0;
27
- exports.$ZodCustom = exports.$ZodLazy = exports.$ZodPromise = exports.$ZodFunction = exports.$ZodTemplateLiteral = exports.$ZodReadonly = exports.$ZodPreprocess = exports.$ZodCodec = exports.$ZodPipe = exports.$ZodNaN = exports.$ZodCatch = exports.$ZodSuccess = exports.$ZodNonOptional = exports.$ZodPrefault = exports.$ZodDefault = exports.$ZodNullable = exports.$ZodExactOptional = exports.$ZodOptional = exports.$ZodTransform = exports.$ZodFile = exports.$ZodLiteral = exports.$ZodEnum = exports.$ZodSet = exports.$ZodMap = exports.$ZodRecord = void 0;
26
+ exports.$ZodObject = exports.$ZodArray = exports.$ZodDate = exports.$ZodVoid = exports.$ZodNever = exports.$ZodUnknown = exports.$ZodAny = exports.$ZodNull = exports.$ZodUndefined = exports.$ZodSymbol = exports.$ZodBigIntFormat = exports.$ZodBigInt = exports.$ZodBoolean = exports.$ZodNumberFormat = exports.$ZodNumber = exports.$ZodCustomStringFormat = exports.$ZodJWT = exports.$ZodIBAN = exports.$ZodCreditCard = exports.$ZodE164 = exports.$ZodBase64URL = exports.base64urlCharset = exports.$ZodBase64 = exports.base64Charset = exports.$ZodCIDRv6 = exports.$ZodCIDRv4 = exports.$ZodMAC = exports.$ZodIPv6 = exports.$ZodIPv4 = exports.$ZodISODuration = exports.$ZodISOTime = exports.$ZodISODate = exports.$ZodISODateTime = exports.$ZodKSUID = exports.$ZodXID = exports.$ZodULID = exports.$ZodCUID2 = exports.$ZodCUID = exports.$ZodNanoID = exports.$ZodEmoji = exports.$ZodURL = exports.URL_UNPARSEABLE = exports.URL_BAD_FORMAT = exports.$ZodEmail = exports.$ZodUUID = exports.$ZodGUID = exports.$ZodStringFormat = exports.$ZodString = exports.clone = exports.$ZodType = void 0;
27
+ exports.$ZodCustom = exports.$ZodLazy = exports.$ZodPromise = exports.$ZodFunction = exports.$ZodTemplateLiteral = exports.$ZodReadonly = exports.$ZodPreprocess = exports.$ZodCodec = exports.$ZodPipe = exports.$ZodNaN = exports.$ZodCatch = exports.$ZodSuccess = exports.$ZodNonOptional = exports.$ZodPrefault = exports.$ZodDefault = exports.$ZodNullable = exports.$ZodExactOptional = exports.$ZodOptional = exports.$ZodTransform = exports.$ZodFile = exports.$ZodLiteral = exports.$ZodEnum = exports.$ZodSet = exports.$ZodMap = exports.$ZodRecord = exports.$ZodTuple = exports.$ZodIntersection = exports.$ZodDiscriminatedUnion = exports.$ZodXor = exports.$ZodUnion = exports.$ZodObjectJIT = void 0;
28
+ exports.standardProps = standardProps;
29
+ exports.canParseURL = canParseURL;
30
+ exports.validateURL = validateURL;
31
+ exports.parseURLObject = parseURLObject;
32
+ exports.stripTabAndNewline = stripTabAndNewline;
33
+ exports.urlHostnameOk = urlHostnameOk;
34
+ exports.urlProtocolOk = urlProtocolOk;
35
+ exports.isValidIPv6 = isValidIPv6;
36
+ exports.isValidCIDRv6 = isValidCIDRv6;
28
37
  exports.isValidBase64 = isValidBase64;
29
38
  exports.isValidBase64URL = isValidBase64URL;
39
+ exports.isValidCreditCard = isValidCreditCard;
40
+ exports.isValidIBAN = isValidIBAN;
30
41
  exports.isValidJWT = isValidJWT;
42
+ exports.getDiscriminatedOption = getDiscriminatedOption;
43
+ exports.mergeValues = mergeValues;
31
44
  const checks = __importStar(require("./checks.cjs"));
32
45
  const core = __importStar(require("./core.cjs"));
33
46
  const doc_js_1 = require("./doc.cjs");
@@ -41,19 +54,20 @@ exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
41
54
  inst._zod.def = def; // set _def property
42
55
  inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
43
56
  inst._zod.version = versions_js_1.version;
44
- const checks = [...(inst._zod.def.checks ?? [])];
57
+ const defChecks = inst._zod.def.checks;
45
58
  // if inst is itself a checks.$ZodCheck, run it as a check
46
- if (inst._zod.traits.has("$ZodCheck")) {
47
- checks.unshift(inst);
48
- }
59
+ const checks = inst._zod.traits.has("$ZodCheck")
60
+ ? [inst, ...(defChecks ?? [])]
61
+ : defChecks?.length
62
+ ? [...defChecks]
63
+ : [];
49
64
  for (const ch of checks) {
50
65
  for (const fn of ch._zod.onattach) {
51
66
  fn(inst);
52
67
  }
53
68
  }
54
69
  if (checks.length === 0) {
55
- // deferred initializer
56
- // inst._zod.parse is not yet defined
70
+ // deferred initializer inst._zod.parse is not yet defined
57
71
  (_a = inst._zod).deferred ?? (_a.deferred = []);
58
72
  inst._zod.deferred?.push(() => {
59
73
  inst._zod.run = inst._zod.parse;
@@ -61,6 +75,8 @@ exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
61
75
  }
62
76
  else {
63
77
  const runChecks = (payload, checks, ctx) => {
78
+ if (payload.memo)
79
+ return payload;
64
80
  let isAborted = util.aborted(payload);
65
81
  let asyncResult;
66
82
  for (const ch of checks) {
@@ -85,6 +101,7 @@ exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
85
101
  const nextLen = payload.issues.length;
86
102
  if (nextLen === currLen)
87
103
  return;
104
+ util.attachSchema(payload.issues, currLen, inst);
88
105
  if (!isAborted)
89
106
  isAborted = util.aborted(payload, currLen);
90
107
  });
@@ -93,6 +110,7 @@ exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
93
110
  const nextLen = payload.issues.length;
94
111
  if (nextLen === currLen)
95
112
  continue;
113
+ util.attachSchema(payload.issues, currLen, inst);
96
114
  if (!isAborted)
97
115
  isAborted = util.aborted(payload, currLen);
98
116
  }
@@ -124,8 +142,7 @@ exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
124
142
  return inst._zod.parse(payload, ctx);
125
143
  }
126
144
  if (ctx.direction === "backward") {
127
- // run canary
128
- // initial pass (no checks)
145
+ // run canary initial pass (no checks)
129
146
  const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
130
147
  if (canary instanceof Promise) {
131
148
  return canary.then((canary) => {
@@ -144,26 +161,45 @@ exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
144
161
  return runChecks(result, checks, ctx);
145
162
  };
146
163
  }
147
- // Lazy initialize ~standard to avoid creating objects for every schema
148
- util.defineLazy(inst, "~standard", () => ({
164
+ }, {
165
+ // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
166
+ get "~standard"() {
167
+ return util.hide(this, "~standard", standardProps(this));
168
+ },
169
+ set "~standard"(value) {
170
+ util.own(this, "~standard", value);
171
+ },
172
+ });
173
+ /** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
174
+ // a Standard Schema result only reports issues, so a failure finalizes them straight off the raw payload: no ZodError, and no lazy result to read through
175
+ const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())) } : { value: r.value };
176
+ async function validateAsync(inst, value) {
177
+ const ctx = { async: true };
178
+ return toStandardResult((await inst._zod.run({ value, issues: [] }, ctx)), ctx);
179
+ }
180
+ function standardProps(inst) {
181
+ return {
149
182
  validate: (value) => {
183
+ const ctx = { async: false };
150
184
  try {
151
- const r = (0, parse_js_1.safeParse)(inst, value);
152
- return r.success ? { value: r.data } : { issues: r.error?.issues };
153
- }
154
- catch (_) {
155
- return (0, parse_js_1.safeParseAsync)(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));
185
+ const r = inst._zod.run({ value, issues: [] }, ctx);
186
+ if (!(r instanceof Promise))
187
+ return toStandardResult(r, ctx);
156
188
  }
189
+ catch (_) { }
190
+ // async function so a synchronously throwing check rejects instead of escaping validate
191
+ return validateAsync(inst, value);
157
192
  },
158
193
  vendor: "zod",
159
194
  version: 1,
160
- }));
161
- });
195
+ };
196
+ }
162
197
  var util_js_1 = require("./util.cjs");
163
198
  Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return util_js_1.clone; } });
164
199
  exports.$ZodString = core.$constructor("$ZodString", (inst, def) => {
165
200
  exports.$ZodType.init(inst, def);
166
- inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);
201
+ // a format's own pattern, else unbounded; a template literal derives the check-aware form itself
202
+ inst._zod.pattern = def.pattern ?? regexes.anyString;
167
203
  inst._zod.parse = (payload, _) => {
168
204
  if (def.coerce)
169
205
  try {
@@ -215,66 +251,115 @@ exports.$ZodEmail = core.$constructor("$ZodEmail", (inst, def) => {
215
251
  def.pattern ?? (def.pattern = regexes.email);
216
252
  exports.$ZodStringFormat.init(inst, def);
217
253
  });
254
+ /** The `://` guard rejected the input before the URL constructor saw it. */
255
+ exports.URL_BAD_FORMAT = 1;
256
+ /** The URL parser rejected the input. */
257
+ exports.URL_UNPARSEABLE = 2;
258
+ function canParseURL(input) {
259
+ try {
260
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function")
261
+ return URL.canParse(input);
262
+ new URL(input);
263
+ return true;
264
+ }
265
+ catch {
266
+ return false;
267
+ }
268
+ }
269
+ function validateURL(trimmed, def) {
270
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
271
+ return canParseURL(trimmed) || exports.URL_UNPARSEABLE;
272
+ }
273
+ return parseURLObject(trimmed, def);
274
+ }
275
+ /** Parses a URL while preserving the non-normalizing HTTP guard. */
276
+ function parseURLObject(trimmed, def) {
277
+ // When normalize is off, require :// for http/https URLs. This prevents strings like "http:example.com" or "https:/path" from being silently accepted
278
+ if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
279
+ return exports.URL_BAD_FORMAT;
280
+ }
281
+ try {
282
+ if (typeof URL !== "undefined") {
283
+ const URLStatic = URL;
284
+ if (typeof URLStatic.parse === "function")
285
+ return URLStatic.parse(trimmed) ?? exports.URL_UNPARSEABLE;
286
+ }
287
+ // @ts-ignore
288
+ return new URL(trimmed);
289
+ }
290
+ catch {
291
+ return exports.URL_UNPARSEABLE;
292
+ }
293
+ }
294
+ const asciiTabOrNewline = /[\t\n\r]/g;
295
+ /** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
296
+ function stripTabAndNewline(value) {
297
+ return value.replace(asciiTabOrNewline, "");
298
+ }
299
+ function urlHostnameOk(url, hostname) {
300
+ hostname.lastIndex = 0;
301
+ return hostname.test(url.hostname);
302
+ }
303
+ function urlProtocolOk(url, protocol) {
304
+ protocol.lastIndex = 0;
305
+ return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
306
+ }
218
307
  exports.$ZodURL = core.$constructor("$ZodURL", (inst, def) => {
219
308
  exports.$ZodStringFormat.init(inst, def);
220
309
  inst._zod.check = (payload) => {
221
310
  try {
222
311
  // Trim whitespace from input
223
312
  const trimmed = payload.value.trim();
224
- // When normalize is off, require :// for http/https URLs
225
- // This prevents strings like "http:example.com" or "https:/path" from being silently accepted
226
- if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source) {
227
- if (!/^https?:\/\//i.test(trimmed)) {
228
- payload.issues.push({
229
- code: "invalid_format",
230
- format: "url",
231
- note: "Invalid URL format",
232
- input: payload.value,
233
- inst,
234
- continue: !def.abort,
235
- });
236
- return;
237
- }
313
+ const url = validateURL(trimmed, def);
314
+ if (url === exports.URL_BAD_FORMAT) {
315
+ payload.issues.push({
316
+ code: "invalid_format",
317
+ format: "url",
318
+ note: "Invalid URL format",
319
+ input: payload.value,
320
+ inst,
321
+ continue: !def.abort,
322
+ });
323
+ return;
238
324
  }
239
- // @ts-ignore
240
- const url = new URL(trimmed);
241
- if (def.hostname) {
242
- def.hostname.lastIndex = 0;
243
- if (!def.hostname.test(url.hostname)) {
244
- payload.issues.push({
245
- code: "invalid_format",
246
- format: "url",
247
- note: "Invalid hostname",
248
- pattern: def.hostname.source,
249
- input: payload.value,
250
- inst,
251
- continue: !def.abort,
252
- });
253
- }
325
+ if (url === exports.URL_UNPARSEABLE) {
326
+ payload.issues.push({
327
+ code: "invalid_format",
328
+ format: "url",
329
+ input: payload.value,
330
+ inst,
331
+ continue: !def.abort,
332
+ });
333
+ return;
254
334
  }
255
- if (def.protocol) {
256
- def.protocol.lastIndex = 0;
257
- if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
258
- payload.issues.push({
259
- code: "invalid_format",
260
- format: "url",
261
- note: "Invalid protocol",
262
- pattern: def.protocol.source,
263
- input: payload.value,
264
- inst,
265
- continue: !def.abort,
266
- });
267
- }
335
+ if (url === true) {
336
+ payload.value = stripTabAndNewline(trimmed);
337
+ return;
268
338
  }
269
- // Set the output value based on normalize flag
270
- if (def.normalize) {
271
- // Use normalized URL
272
- payload.value = url.href;
339
+ if (def.hostname && !urlHostnameOk(url, def.hostname)) {
340
+ payload.issues.push({
341
+ code: "invalid_format",
342
+ format: "url",
343
+ note: "Invalid hostname",
344
+ pattern: def.hostname.source,
345
+ input: payload.value,
346
+ inst,
347
+ continue: !def.abort,
348
+ });
273
349
  }
274
- else {
275
- // Preserve the original input (trimmed)
276
- payload.value = trimmed;
350
+ if (def.protocol && !urlProtocolOk(url, def.protocol)) {
351
+ payload.issues.push({
352
+ code: "invalid_format",
353
+ format: "url",
354
+ note: "Invalid protocol",
355
+ pattern: def.protocol.source,
356
+ input: payload.value,
357
+ inst,
358
+ continue: !def.abort,
359
+ });
277
360
  }
361
+ // Set the output value based on normalize flag
362
+ payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
278
363
  return;
279
364
  }
280
365
  catch (_) {
@@ -293,7 +378,9 @@ exports.$ZodEmoji = core.$constructor("$ZodEmoji", (inst, def) => {
293
378
  exports.$ZodStringFormat.init(inst, def);
294
379
  });
295
380
  exports.$ZodNanoID = core.$constructor("$ZodNanoID", (inst, def) => {
296
- def.pattern ?? (def.pattern = regexes.nanoid);
381
+ if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))
382
+ throw new Error(`Invalid nanoid length: ${def.length}`);
383
+ def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));
297
384
  exports.$ZodStringFormat.init(inst, def);
298
385
  });
299
386
  /**
@@ -340,19 +427,19 @@ exports.$ZodISODuration = core.$constructor("$ZodISODuration", (inst, def) => {
340
427
  exports.$ZodIPv4 = core.$constructor("$ZodIPv4", (inst, def) => {
341
428
  def.pattern ?? (def.pattern = regexes.ipv4);
342
429
  exports.$ZodStringFormat.init(inst, def);
343
- inst._zod.bag.format = `ipv4`;
344
430
  });
431
+ /** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
432
+ const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
433
+ function isValidIPv6(value) {
434
+ if (!ipv6Alphabet.test(value))
435
+ return false;
436
+ return canParseURL(`http://[${value}]`);
437
+ }
345
438
  exports.$ZodIPv6 = core.$constructor("$ZodIPv6", (inst, def) => {
346
439
  def.pattern ?? (def.pattern = regexes.ipv6);
347
440
  exports.$ZodStringFormat.init(inst, def);
348
- inst._zod.bag.format = `ipv6`;
349
441
  inst._zod.check = (payload) => {
350
- try {
351
- // @ts-ignore
352
- new URL(`http://[${payload.value}]`);
353
- // return;
354
- }
355
- catch {
442
+ if (!isValidIPv6(payload.value)) {
356
443
  payload.issues.push({
357
444
  code: "invalid_format",
358
445
  format: "ipv6",
@@ -366,32 +453,30 @@ exports.$ZodIPv6 = core.$constructor("$ZodIPv6", (inst, def) => {
366
453
  exports.$ZodMAC = core.$constructor("$ZodMAC", (inst, def) => {
367
454
  def.pattern ?? (def.pattern = regexes.mac(def.delimiter));
368
455
  exports.$ZodStringFormat.init(inst, def);
369
- inst._zod.bag.format = `mac`;
370
456
  });
371
457
  exports.$ZodCIDRv4 = core.$constructor("$ZodCIDRv4", (inst, def) => {
372
458
  def.pattern ?? (def.pattern = regexes.cidrv4);
373
459
  exports.$ZodStringFormat.init(inst, def);
374
460
  });
461
+ function isValidCIDRv6(value) {
462
+ const parts = value.split("/");
463
+ if (parts.length !== 2)
464
+ return false;
465
+ const [address, prefix] = parts;
466
+ if (!prefix)
467
+ return false;
468
+ const prefixNum = Number(prefix);
469
+ if (`${prefixNum}` !== prefix)
470
+ return false;
471
+ if (prefixNum < 0 || prefixNum > 128)
472
+ return false;
473
+ return isValidIPv6(address);
474
+ }
375
475
  exports.$ZodCIDRv6 = core.$constructor("$ZodCIDRv6", (inst, def) => {
376
476
  def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation
377
477
  exports.$ZodStringFormat.init(inst, def);
378
478
  inst._zod.check = (payload) => {
379
- const parts = payload.value.split("/");
380
- try {
381
- if (parts.length !== 2)
382
- throw new Error();
383
- const [address, prefix] = parts;
384
- if (!prefix)
385
- throw new Error();
386
- const prefixNum = Number(prefix);
387
- if (`${prefixNum}` !== prefix)
388
- throw new Error();
389
- if (prefixNum < 0 || prefixNum > 128)
390
- throw new Error();
391
- // @ts-ignore
392
- new URL(`http://[${address}]`);
393
- }
394
- catch {
479
+ if (!isValidCIDRv6(payload.value)) {
395
480
  payload.issues.push({
396
481
  code: "invalid_format",
397
482
  format: "cidrv6",
@@ -420,10 +505,11 @@ function isValidBase64(data) {
420
505
  return false;
421
506
  }
422
507
  }
508
+ // lax on purpose: the quantified regexes.base64 overflows the regex stack on multi-MB input and its leading ^$| alternation leaks through template-literal composition; isValidBase64 enforces length and padding
509
+ exports.base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
423
510
  exports.$ZodBase64 = core.$constructor("$ZodBase64", (inst, def) => {
424
- def.pattern ?? (def.pattern = regexes.base64);
511
+ def.pattern ?? (def.pattern = exports.base64Charset);
425
512
  exports.$ZodStringFormat.init(inst, def);
426
- inst._zod.bag.contentEncoding = "base64";
427
513
  inst._zod.check = (payload) => {
428
514
  if (isValidBase64(payload.value))
429
515
  return;
@@ -436,18 +522,19 @@ exports.$ZodBase64 = core.$constructor("$ZodBase64", (inst, def) => {
436
522
  });
437
523
  };
438
524
  });
439
- ////////////////////////////// ZodBase64 //////////////////////////////
525
+ ////////////////////////////// ZodBase64URL //////////////////////////////
526
+ // lax on purpose: the quantified regexes.base64url overflows the regex stack on multi-MB input; isValidBase64 enforces length on the padded string
527
+ exports.base64urlCharset = /^[A-Za-z0-9_-]*$/;
440
528
  function isValidBase64URL(data) {
441
- if (!regexes.base64url.test(data))
529
+ if (!exports.base64urlCharset.test(data))
442
530
  return false;
443
531
  const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
444
532
  const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
445
533
  return isValidBase64(padded);
446
534
  }
447
535
  exports.$ZodBase64URL = core.$constructor("$ZodBase64URL", (inst, def) => {
448
- def.pattern ?? (def.pattern = regexes.base64url);
536
+ def.pattern ?? (def.pattern = exports.base64urlCharset);
449
537
  exports.$ZodStringFormat.init(inst, def);
450
- inst._zod.bag.contentEncoding = "base64url";
451
538
  inst._zod.check = (payload) => {
452
539
  if (isValidBase64URL(payload.value))
453
540
  return;
@@ -464,6 +551,77 @@ exports.$ZodE164 = core.$constructor("$ZodE164", (inst, def) => {
464
551
  def.pattern ?? (def.pattern = regexes.e164);
465
552
  exports.$ZodStringFormat.init(inst, def);
466
553
  });
554
+ ////////////////////////////// ZodCreditCard //////////////////////////////
555
+ const CC_SANITIZE = /[- ]/g;
556
+ /** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */
557
+ function isLuhnAlgo(digits) {
558
+ let length = digits.length;
559
+ let bit = 1;
560
+ let sum = 0;
561
+ while (length) {
562
+ const value = digits.charCodeAt(--length) - 48;
563
+ bit ^= 1;
564
+ sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
565
+ }
566
+ return sum % 10 === 0;
567
+ }
568
+ function isValidCreditCard(input) {
569
+ if (!regexes.creditCard.test(input))
570
+ return false;
571
+ return isLuhnAlgo(input.replace(CC_SANITIZE, ""));
572
+ }
573
+ exports.$ZodCreditCard = core.$constructor("$ZodCreditCard", (inst, def) => {
574
+ // Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.
575
+ def.pattern ?? (def.pattern = regexes.creditCard);
576
+ exports.$ZodStringFormat.init(inst, def);
577
+ inst._zod.check = (payload) => {
578
+ if (isValidCreditCard(payload.value))
579
+ return;
580
+ payload.issues.push({
581
+ code: "invalid_format",
582
+ format: "credit_card",
583
+ input: payload.value,
584
+ inst,
585
+ continue: !def.abort,
586
+ });
587
+ };
588
+ });
589
+ ////////////////////////////// ZodIBAN //////////////////////////////
590
+ // iso 7064 mod 97-10 checksum without BigInt
591
+ function isIso7064Mod97(iban) {
592
+ let remainder = 0;
593
+ const len = iban.length;
594
+ for (let i = 4; i < len; i++) {
595
+ const code = iban.charCodeAt(i);
596
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
597
+ }
598
+ for (let i = 0; i < 4; i++) {
599
+ const code = iban.charCodeAt(i);
600
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
601
+ }
602
+ return remainder === 1;
603
+ }
604
+ function isValidIBAN(input) {
605
+ if (!regexes.iban.test(input))
606
+ return false;
607
+ return isIso7064Mod97(input);
608
+ }
609
+ exports.$ZodIBAN = core.$constructor("$ZodIBAN", (inst, def) => {
610
+ // shape only — checksum is not expressible as a pattern
611
+ def.pattern ?? (def.pattern = regexes.iban);
612
+ exports.$ZodStringFormat.init(inst, def);
613
+ inst._zod.check = (payload) => {
614
+ if (isValidIBAN(payload.value))
615
+ return;
616
+ payload.issues.push({
617
+ code: "invalid_format",
618
+ format: "iban",
619
+ input: payload.value,
620
+ inst,
621
+ continue: !def.abort,
622
+ });
623
+ };
624
+ });
467
625
  ////////////////////////////// ZodJWT //////////////////////////////
468
626
  function isValidJWT(token, algorithm = null) {
469
627
  try {
@@ -517,7 +675,7 @@ exports.$ZodCustomStringFormat = core.$constructor("$ZodCustomStringFormat", (in
517
675
  });
518
676
  exports.$ZodNumber = core.$constructor("$ZodNumber", (inst, def) => {
519
677
  exports.$ZodType.init(inst, def);
520
- inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;
678
+ inst._zod.pattern = regexes.number;
521
679
  inst._zod.parse = (payload, _ctx) => {
522
680
  if (def.coerce)
523
681
  try {
@@ -532,7 +690,7 @@ exports.$ZodNumber = core.$constructor("$ZodNumber", (inst, def) => {
532
690
  ? Number.isNaN(input)
533
691
  ? "NaN"
534
692
  : !Number.isFinite(input)
535
- ? "Infinity"
693
+ ? String(input)
536
694
  : undefined
537
695
  : undefined;
538
696
  payload.issues.push({
@@ -702,6 +860,33 @@ exports.$ZodDate = core.$constructor("$ZodDate", (inst, def) => {
702
860
  return payload;
703
861
  };
704
862
  });
863
+ // an oversized container fails its leading size checks before any element is parsed
864
+ function capSize(inst, size) {
865
+ const caps = util.sizeCaps(inst._zod.def.checks);
866
+ if (!caps.length)
867
+ return;
868
+ const cap = Math.min(...caps.map((c) => c[0]));
869
+ const parse = inst._zod.parse;
870
+ inst._zod.parse = (payload, ctx) => {
871
+ const n = size(payload.value);
872
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
873
+ for (const [max, ch] of util.sizeCaps(inst._zod.def.checks)) {
874
+ if (n > max && ch._zod.def.when(payload)) {
875
+ const start = payload.issues.length;
876
+ ch._zod.check(payload);
877
+ // the value is still the raw input, so no later check may read it
878
+ payload.issues[start].continue = false;
879
+ util.attachSchema(payload.issues, start, inst);
880
+ return payload;
881
+ }
882
+ }
883
+ }
884
+ return parse(payload, ctx);
885
+ };
886
+ }
887
+ const arraySize = (input) => (Array.isArray(input) ? input.length : -1);
888
+ const mapSize = (input) => (input instanceof Map ? input.size : -1);
889
+ const setSize = (input) => (input instanceof Set ? input.size : -1);
705
890
  function handleArrayResult(result, final, index) {
706
891
  if (result.issues.length) {
707
892
  final.issues.push(...util.prefixIssues(index, result.issues));
@@ -710,6 +895,8 @@ function handleArrayResult(result, final, index) {
710
895
  }
711
896
  exports.$ZodArray = core.$constructor("$ZodArray", (inst, def) => {
712
897
  exports.$ZodType.init(inst, def);
898
+ const memo = core.globalConfig.memoizer;
899
+ memo?.attach(inst);
713
900
  inst._zod.parse = (payload, ctx) => {
714
901
  const input = payload.value;
715
902
  if (!Array.isArray(input)) {
@@ -721,8 +908,9 @@ exports.$ZodArray = core.$constructor("$ZodArray", (inst, def) => {
721
908
  });
722
909
  return payload;
723
910
  }
724
- payload.value = Array(input.length);
911
+ payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
725
912
  const proms = [];
913
+ const abortEarly = ctx?.abortEarly;
726
914
  for (let i = 0; i < input.length; i++) {
727
915
  const item = input[i];
728
916
  const result = def.element._zod.run({
@@ -734,6 +922,9 @@ exports.$ZodArray = core.$constructor("$ZodArray", (inst, def) => {
734
922
  }
735
923
  else {
736
924
  handleArrayResult(result, payload, i);
925
+ // the element's payload is authoritative here, since handleArrayResult forwards every issue; an object's is not, because it drops a failed absent optional
926
+ if (abortEarly && result.issues.length !== 0 && util.aborted(result))
927
+ break;
737
928
  }
738
929
  }
739
930
  if (proms.length) {
@@ -741,17 +932,23 @@ exports.$ZodArray = core.$constructor("$ZodArray", (inst, def) => {
741
932
  }
742
933
  return payload; //handleArrayResultsAsync(parseResults, final);
743
934
  };
935
+ capSize(inst, arraySize);
744
936
  });
745
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
937
+ function handlePropertyResult(result, final, key, input, optin, optout) {
746
938
  const isPresent = key in input;
939
+ const isOptionalOut = optout === "optional";
940
+ // The middle rung means "absence permitted, nothing supplied in its place", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.
941
+ if (!isPresent && isOptionalOut && optin === "optional") {
942
+ return;
943
+ }
747
944
  if (result.issues.length) {
748
945
  // For optional-in/out schemas, ignore errors on absent keys.
749
- if (isOptionalIn && isOptionalOut && !isPresent) {
946
+ if (optin !== undefined && isOptionalOut && !isPresent) {
750
947
  return;
751
948
  }
752
949
  final.issues.push(...util.prefixIssues(key, result.issues));
753
950
  }
754
- if (!isPresent && !isOptionalIn) {
951
+ if (!isPresent && optin === undefined) {
755
952
  if (!result.issues.length) {
756
953
  final.issues.push({
757
954
  code: "invalid_type",
@@ -763,7 +960,7 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
763
960
  return;
764
961
  }
765
962
  if (result.value === undefined) {
766
- if (isPresent) {
963
+ if (isPresent || (optin === "defaulted" && !isOptionalOut)) {
767
964
  final.value[key] = undefined;
768
965
  }
769
966
  }
@@ -771,46 +968,64 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
771
968
  final.value[key] = result.value;
772
969
  }
773
970
  }
971
+ // one shared instance; a fresh [] per schema cost 56 bytes retained
972
+ const NO_SYMBOL_KEYS = [];
774
973
  function normalizeDef(def) {
775
974
  const keys = Object.keys(def.shape);
776
- for (const k of keys) {
975
+ const ownSymbols = Object.getOwnPropertySymbols(def.shape);
976
+ const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
977
+ // aliases `keys` when there are no symbols, so a string-only shape keeps one array
978
+ const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
979
+ for (const k of allKeys) {
777
980
  if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
778
- throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
981
+ throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
779
982
  }
780
983
  }
781
984
  const okeys = util.optionalKeys(def.shape);
782
985
  return {
783
986
  ...def,
784
- keys,
987
+ allKeys,
988
+ symbolKeys,
989
+ // string-only: handleCatchall matches it against `for...in`, which never yields a symbol
785
990
  keySet: new Set(keys),
786
991
  numKeys: keys.length,
787
992
  optionalKeys: new Set(okeys),
788
993
  };
789
994
  }
790
- function handleCatchall(proms, input, payload, ctx, def, inst) {
995
+ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
791
996
  const unrecognized = [];
792
997
  const keySet = def.keySet;
793
998
  const _catchall = def.catchall._zod;
794
999
  const t = _catchall.def.type;
795
- const isOptionalIn = _catchall.optin === "optional";
796
- const isOptionalOut = _catchall.optout === "optional";
1000
+ const optin = _catchall.optin;
1001
+ const optout = _catchall.optout;
1002
+ // starts at 0, not the current length: the shape phase already ran and may have aborted
1003
+ let seen = 0;
797
1004
  for (const key in input) {
798
- // skip __proto__ so it can't replace the result prototype via the
799
- // assignment setter on the plain {} we build into
800
- if (key === "__proto__")
801
- continue;
1005
+ if (abortEarly && payload.issues.length !== seen) {
1006
+ if (util.aborted(payload, seen))
1007
+ break;
1008
+ seen = payload.issues.length;
1009
+ }
1010
+ // Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.
802
1011
  if (keySet.has(key))
803
1012
  continue;
1013
+ // Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.
1014
+ if (key === "__proto__") {
1015
+ if (t === "never")
1016
+ unrecognized.push(key);
1017
+ continue;
1018
+ }
804
1019
  if (t === "never") {
805
1020
  unrecognized.push(key);
806
1021
  continue;
807
1022
  }
808
1023
  const r = _catchall.run({ value: input[key], issues: [] }, ctx);
809
1024
  if (r instanceof Promise) {
810
- proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1025
+ proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
811
1026
  }
812
1027
  else {
813
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1028
+ handlePropertyResult(r, payload, key, input, optin, optout);
814
1029
  }
815
1030
  }
816
1031
  if (unrecognized.length) {
@@ -819,6 +1034,8 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
819
1034
  keys: unrecognized,
820
1035
  input,
821
1036
  inst,
1037
+ // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
1038
+ continue: true,
822
1039
  });
823
1040
  }
824
1041
  if (!proms.length)
@@ -830,30 +1047,35 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
830
1047
  exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
831
1048
  // requires cast because technically $ZodObject doesn't extend
832
1049
  exports.$ZodType.init(inst, def);
833
- // const sh = def.shape;
834
1050
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
835
- if (!desc?.get) {
836
- const sh = def.shape;
837
- Object.defineProperty(def, "shape", {
838
- get: () => {
839
- const newSh = { ...sh };
840
- Object.defineProperty(def, "shape", {
841
- value: newSh,
842
- });
843
- return newSh;
844
- },
845
- });
1051
+ // a cloned def carries its source's accessor, which knows the shape it answers from; adopting that keeps the clone's keys readable without running it
1052
+ const sh = desc?.get ? desc.get.raw : (def.shape ?? {});
1053
+ if (sh) {
1054
+ // Freezes the shape on first read, so its getters resolve once and every later read sees the same schemas.
1055
+ const get = () => {
1056
+ const newSh = { ...sh };
1057
+ Object.defineProperty(def, "shape", { value: newSh });
1058
+ get.raw = newSh;
1059
+ return newSh;
1060
+ };
1061
+ get.raw = sh;
1062
+ Object.defineProperty(def, "shape", { get });
846
1063
  }
847
1064
  const _normalized = util.cached(() => normalizeDef(def));
848
- util.defineLazy(inst._zod, "propValues", () => {
849
- const shape = def.shape;
1065
+ util.defineLazyInternal(inst, "propValues", (zod) => {
1066
+ const shape = zod.def.shape;
850
1067
  const propValues = {};
851
1068
  for (const key in shape) {
852
1069
  const field = shape[key]._zod;
853
1070
  if (field.values) {
854
- propValues[key] ?? (propValues[key] = new Set());
1071
+ if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
1072
+ util.assignProp(propValues, key, new Set());
1073
+ }
855
1074
  for (const v of field.values)
856
1075
  propValues[key].add(v);
1076
+ // An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.
1077
+ if (field.optin !== undefined)
1078
+ propValues[key].add(undefined);
857
1079
  }
858
1080
  }
859
1081
  return propValues;
@@ -861,6 +1083,8 @@ exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
861
1083
  const isObject = util.isObject;
862
1084
  const catchall = def.catchall;
863
1085
  let value;
1086
+ const memo = core.globalConfig.memoizer;
1087
+ memo?.attach(inst);
864
1088
  inst._zod.parse = (payload, ctx) => {
865
1089
  value ?? (value = _normalized.value);
866
1090
  const input = payload.value;
@@ -873,25 +1097,34 @@ exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
873
1097
  });
874
1098
  return payload;
875
1099
  }
876
- payload.value = {};
1100
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
877
1101
  const proms = [];
878
1102
  const shape = value.shape;
879
- for (const key of value.keys) {
1103
+ const abortEarly = ctx?.abortEarly;
1104
+ let seen = payload.issues.length;
1105
+ for (const key of value.allKeys) {
1106
+ if (abortEarly && payload.issues.length !== seen) {
1107
+ if (util.aborted(payload, seen))
1108
+ break;
1109
+ seen = payload.issues.length;
1110
+ }
1111
+ if (key === "__proto__")
1112
+ continue;
880
1113
  const el = shape[key];
881
- const isOptionalIn = el._zod.optin === "optional";
882
- const isOptionalOut = el._zod.optout === "optional";
1114
+ const optin = el._zod.optin;
1115
+ const optout = el._zod.optout;
883
1116
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
884
1117
  if (r instanceof Promise) {
885
- proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1118
+ proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
886
1119
  }
887
1120
  else {
888
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1121
+ handlePropertyResult(r, payload, key, input, optin, optout);
889
1122
  }
890
1123
  }
891
1124
  if (!catchall) {
892
1125
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
893
1126
  }
894
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
1127
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
895
1128
  };
896
1129
  });
897
1130
  exports.$ZodObjectJIT = core.$constructor("$ZodObjectJIT", (inst, def) => {
@@ -899,58 +1132,65 @@ exports.$ZodObjectJIT = core.$constructor("$ZodObjectJIT", (inst, def) => {
899
1132
  exports.$ZodObject.init(inst, def);
900
1133
  const superParse = inst._zod.parse;
901
1134
  const _normalized = util.cached(() => normalizeDef(def));
1135
+ const memo = core.globalConfig.memoizer;
902
1136
  const generateFastpass = (shape) => {
903
- const doc = new doc_js_1.Doc(["shape", "payload", "ctx"]);
904
1137
  const normalized = _normalized.value;
905
- const parseStr = (key) => {
906
- const k = util.esc(key);
907
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
908
- };
1138
+ const syms = normalized.symbolKeys;
1139
+ // a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope
1140
+ const doc = new doc_js_1.Doc(["payload", "ctx"], { shape, inst, memo, syms });
1141
+ const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1142
+ // prefixes in place, like util.prefixIssues. newResult must land before the early return: a catchall runs after this and would otherwise write onto the caller's input
1143
+ const prefixStr = (id, k) => `
1144
+ let ${id}_ab = false;
1145
+ for (let i = 0; i < ${id}.issues.length; i++) {
1146
+ const iss = ${id}.issues[i];
1147
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
1148
+ payload.issues.push(iss);
1149
+ if (iss.continue !== true) ${id}_ab = true;
1150
+ }
1151
+ if (${id}_ab && ctx && ctx.abortEarly) {
1152
+ payload.value = newResult;
1153
+ return payload;
1154
+ }`;
909
1155
  doc.write(`const input = payload.value;`);
910
1156
  const ids = Object.create(null);
911
1157
  let counter = 0;
912
- for (const key of normalized.keys) {
1158
+ for (const key of normalized.allKeys) {
913
1159
  ids[key] = `key_${counter++}`;
914
1160
  }
915
1161
  // A: preserve key order {
916
- doc.write(`const newResult = {};`);
917
- for (const key of normalized.keys) {
1162
+ doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
1163
+ for (const key of normalized.allKeys) {
1164
+ if (key === "__proto__")
1165
+ continue;
918
1166
  const id = ids[key];
919
- const k = util.esc(key);
1167
+ const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : util.esc(key);
1168
+ const isPresent = `${k} in input`;
920
1169
  const schema = shape[key];
921
- const isOptionalIn = schema?._zod?.optin === "optional";
1170
+ const optin = schema?._zod?.optin;
1171
+ const isOptionalIn = optin !== undefined;
922
1172
  const isOptionalOut = schema?._zod?.optout === "optional";
923
- doc.write(`const ${id} = ${parseStr(key)};`);
1173
+ doc.write(`const ${id} = ${parseStr(k)};`);
924
1174
  if (isOptionalIn && isOptionalOut) {
925
- // For optional-in/out schemas, ignore errors on absent keys
1175
+ // For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.
1176
+ const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
926
1177
  doc.write(`
927
- if (${id}.issues.length) {
928
- if (${k} in input) {
929
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
930
- ...iss,
931
- path: iss.path ? [${k}, ...iss.path] : [${k}]
932
- })));
1178
+ const ${id}_present = ${isPresent};
1179
+ if (!${id}.issues.length || ${id}_present) {
1180
+ if (${id}.issues.length) {${prefixStr(id, k)}
933
1181
  }
934
- }
935
-
936
- if (${id}.value === undefined) {
937
- if (${k} in input) {
938
- newResult[${k}] = undefined;
1182
+
1183
+ if (${assign}) {
1184
+ newResult[${k}] = ${id}.value;
939
1185
  }
940
- } else {
941
- newResult[${k}] = ${id}.value;
942
1186
  }
943
-
1187
+
944
1188
  `);
945
1189
  }
946
1190
  else if (!isOptionalIn) {
947
1191
  doc.write(`
948
- const ${id}_present = ${k} in input;
949
- if (${id}.issues.length) {
950
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
951
- ...iss,
952
- path: iss.path ? [${k}, ...iss.path] : [${k}]
953
- })));
1192
+ const ${id}_present = ${isPresent};
1193
+ if (${id}.issues.length) {${prefixStr(id, k)}
954
1194
  }
955
1195
  if (!${id}_present && !${id}.issues.length) {
956
1196
  payload.issues.push({
@@ -959,42 +1199,39 @@ exports.$ZodObjectJIT = core.$constructor("$ZodObjectJIT", (inst, def) => {
959
1199
  input: undefined,
960
1200
  path: [${k}]
961
1201
  });
1202
+ if (ctx && ctx.abortEarly) {
1203
+ payload.value = newResult;
1204
+ return payload;
1205
+ }
962
1206
  }
963
1207
 
964
1208
  if (${id}_present) {
965
- if (${id}.value === undefined) {
966
- newResult[${k}] = undefined;
967
- } else {
968
- newResult[${k}] = ${id}.value;
969
- }
1209
+ newResult[${k}] = ${id}.value;
970
1210
  }
971
1211
 
972
1212
  `);
973
1213
  }
974
1214
  else {
975
1215
  doc.write(`
976
- if (${id}.issues.length) {
977
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
978
- ...iss,
979
- path: iss.path ? [${k}, ...iss.path] : [${k}]
980
- })));
981
- }
982
-
983
- if (${id}.value === undefined) {
984
- if (${k} in input) {
985
- newResult[${k}] = undefined;
986
- }
987
- } else {
1216
+ if (${id}.issues.length) {${prefixStr(id, k)}
1217
+ }
1218
+ `);
1219
+ if (optin === "defaulted") {
1220
+ doc.write(`newResult[${k}] = ${id}.value;`);
1221
+ }
1222
+ else {
1223
+ doc.write(`
1224
+ if (${id}.value !== undefined || ${isPresent}) {
988
1225
  newResult[${k}] = ${id}.value;
989
1226
  }
990
-
991
1227
  `);
1228
+ }
992
1229
  }
993
1230
  }
994
1231
  doc.write(`payload.value = newResult;`);
995
1232
  doc.write(`return payload;`);
996
- const fn = doc.compile();
997
- return (payload, ctx) => fn(shape, payload, ctx);
1233
+ // closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone
1234
+ return doc.compile();
998
1235
  };
999
1236
  let fastpass;
1000
1237
  const isObject = util.isObject;
@@ -1022,7 +1259,7 @@ exports.$ZodObjectJIT = core.$constructor("$ZodObjectJIT", (inst, def) => {
1022
1259
  payload = fastpass(payload, ctx);
1023
1260
  if (!catchall)
1024
1261
  return payload;
1025
- return handleCatchall([], input, payload, ctx, value, inst);
1262
+ return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
1026
1263
  }
1027
1264
  return superParse(payload, ctx);
1028
1265
  };
@@ -1049,17 +1286,21 @@ function handleUnionResults(results, final, inst, ctx) {
1049
1286
  }
1050
1287
  exports.$ZodUnion = core.$constructor("$ZodUnion", (inst, def) => {
1051
1288
  exports.$ZodType.init(inst, def);
1052
- util.defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
1053
- util.defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
1054
- util.defineLazy(inst._zod, "values", () => {
1055
- if (def.options.every((o) => o._zod.values)) {
1056
- return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1289
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted")
1290
+ ? "defaulted"
1291
+ : zod.def.options.some((o) => o._zod.optin !== undefined)
1292
+ ? "optional"
1293
+ : undefined);
1294
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
1295
+ util.defineLazyInternal(inst, "values", (zod) => {
1296
+ if (zod.def.options.every((o) => o._zod.values)) {
1297
+ return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
1057
1298
  }
1058
1299
  return undefined;
1059
1300
  });
1060
- util.defineLazy(inst._zod, "pattern", () => {
1061
- if (def.options.every((o) => o._zod.pattern)) {
1062
- const patterns = def.options.map((o) => o._zod.pattern);
1301
+ util.defineLazyInternal(inst, "pattern", (zod) => {
1302
+ if (zod.def.options.every((o) => o._zod.pattern)) {
1303
+ const patterns = zod.def.options.map((o) => o._zod.pattern);
1063
1304
  return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join("|")})$`);
1064
1305
  }
1065
1306
  return undefined;
@@ -1094,12 +1335,16 @@ exports.$ZodUnion = core.$constructor("$ZodUnion", (inst, def) => {
1094
1335
  };
1095
1336
  });
1096
1337
  function handleExclusiveUnionResults(results, final, inst, ctx) {
1097
- const successes = results.filter((r) => r.issues.length === 0);
1098
- if (successes.length === 1) {
1099
- final.value = successes[0].value;
1338
+ const matches = [];
1339
+ for (let i = 0; i < results.length; i++) {
1340
+ if (results[i].issues.length === 0)
1341
+ matches.push(i);
1342
+ }
1343
+ if (matches.length === 1) {
1344
+ final.value = results[matches[0]].value;
1100
1345
  return final;
1101
1346
  }
1102
- if (successes.length === 0) {
1347
+ if (matches.length === 0) {
1103
1348
  // No matches - same as regular union
1104
1349
  final.issues.push({
1105
1350
  code: "invalid_union",
@@ -1116,6 +1361,7 @@ function handleExclusiveUnionResults(results, final, inst, ctx) {
1116
1361
  inst,
1117
1362
  errors: [],
1118
1363
  inclusive: false,
1364
+ matches,
1119
1365
  });
1120
1366
  }
1121
1367
  return final;
@@ -1150,44 +1396,75 @@ exports.$ZodXor = core.$constructor("$ZodXor", (inst, def) => {
1150
1396
  });
1151
1397
  };
1152
1398
  });
1399
+ /** Returns the option whose discriminator claims `value`, or throws if ambiguous. */
1400
+ function getDiscriminatedOption(union, value) {
1401
+ const internals = union._zod;
1402
+ let map = internals.bag.optionsMap;
1403
+ if (!map) {
1404
+ map = discriminatorMap(internals.def);
1405
+ internals.bag.optionsMap = map;
1406
+ }
1407
+ const option = map.get(value);
1408
+ if (option === null)
1409
+ throw new Error(`Ambiguous discriminator value "${String(value)}"`);
1410
+ return option;
1411
+ }
1412
+ function discriminatorMap(def) {
1413
+ const map = new Map();
1414
+ for (const option of def.options) {
1415
+ const values = option._zod.propValues?.[def.discriminator];
1416
+ if (!values || values.size === 0)
1417
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
1418
+ for (const value of values) {
1419
+ if (map.has(value)) {
1420
+ if (value !== undefined)
1421
+ throw new Error(`Duplicate discriminator value "${String(value)}"`);
1422
+ // keep the collision marked so a later member cannot reclaim it
1423
+ map.set(value, null);
1424
+ }
1425
+ else {
1426
+ map.set(value, option);
1427
+ }
1428
+ }
1429
+ }
1430
+ return map;
1431
+ }
1153
1432
  exports.$ZodDiscriminatedUnion =
1154
1433
  /*@__PURE__*/
1155
1434
  core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1156
1435
  def.inclusive = false;
1157
1436
  exports.$ZodUnion.init(inst, def);
1158
1437
  const _super = inst._zod.parse;
1159
- util.defineLazy(inst._zod, "propValues", () => {
1438
+ util.defineLazyInternal(inst, "propValues", (zod) => {
1160
1439
  const propValues = {};
1161
- for (const option of def.options) {
1440
+ let undefinedCount = 0;
1441
+ for (const option of zod.def.options) {
1162
1442
  const pv = option._zod.propValues;
1163
1443
  if (!pv || Object.keys(pv).length === 0)
1164
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
1444
+ throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
1445
+ if (pv[zod.def.discriminator]?.has(undefined))
1446
+ undefinedCount++;
1165
1447
  for (const [k, v] of Object.entries(pv)) {
1166
- if (!propValues[k])
1167
- propValues[k] = new Set();
1448
+ if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
1449
+ util.assignProp(propValues, k, new Set());
1450
+ }
1168
1451
  for (const val of v) {
1169
1452
  propValues[k].add(val);
1170
1453
  }
1171
1454
  }
1172
1455
  }
1456
+ if (!zod.def.unionFallback && undefinedCount > 1)
1457
+ propValues[zod.def.discriminator]?.delete(undefined);
1173
1458
  return propValues;
1174
1459
  });
1175
- const disc = util.cached(() => {
1176
- const opts = def.options;
1177
- const map = new Map();
1178
- for (const o of opts) {
1179
- const values = o._zod.propValues?.[def.discriminator];
1180
- if (!values || values.size === 0)
1181
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
1182
- for (const v of values) {
1183
- if (map.has(v)) {
1184
- throw new Error(`Duplicate discriminator value "${String(v)}"`);
1185
- }
1186
- map.set(v, o);
1187
- }
1460
+ // Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes and lazies — are left to the map.
1461
+ def.options.forEach((option, i) => {
1462
+ const propShape = util.rawShape(option._zod.def);
1463
+ if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
1464
+ throw new Error(`Invalid discriminated union option at index "${i}"`);
1188
1465
  }
1189
- return map;
1190
1466
  });
1467
+ const disc = util.cached(() => discriminatorMap(def));
1191
1468
  inst._zod.parse = (payload, ctx) => {
1192
1469
  const input = payload.value;
1193
1470
  if (!util.isObject(input)) {
@@ -1199,14 +1476,15 @@ core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1199
1476
  });
1200
1477
  return payload;
1201
1478
  }
1202
- const opt = disc.value.get(input?.[def.discriminator]);
1203
- if (opt) {
1479
+ const value = input?.[def.discriminator];
1480
+ const opt = disc.value.get(value);
1481
+ // forward metadata cannot choose an encoder for an absent tag
1482
+ if (opt && (value !== undefined || ctx.direction !== "backward")) {
1204
1483
  return opt._zod.run(payload, ctx);
1205
1484
  }
1206
1485
  // Fall back to union matching when the fast discriminator path fails:
1207
1486
  // - explicitly enabled via unionFallback, or
1208
- // - during backward direction (encode), since codec-based discriminators
1209
- // have different values in forward vs backward directions
1487
+ // - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions
1210
1488
  if (def.unionFallback || ctx.direction === "backward") {
1211
1489
  return _super(payload, ctx);
1212
1490
  }
@@ -1216,7 +1494,7 @@ core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1216
1494
  errors: [],
1217
1495
  note: "No matching discriminator",
1218
1496
  discriminator: def.discriminator,
1219
- options: Array.from(disc.value.keys()),
1497
+ options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
1220
1498
  input,
1221
1499
  path: [def.discriminator],
1222
1500
  inst,
@@ -1252,7 +1530,11 @@ function mergeValues(a, b) {
1252
1530
  const bKeys = Object.keys(b);
1253
1531
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1254
1532
  const newObj = { ...a, ...b };
1533
+ if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
1534
+ delete newObj.__proto__;
1255
1535
  for (const key of sharedKeys) {
1536
+ if (key === "__proto__")
1537
+ continue;
1256
1538
  const sharedValue = mergeValues(a[key], b[key]);
1257
1539
  if (!sharedValue.valid) {
1258
1540
  return {
@@ -1286,43 +1568,55 @@ function mergeValues(a, b) {
1286
1568
  return { valid: false, mergeErrorPath: [] };
1287
1569
  }
1288
1570
  function handleIntersectionResults(result, left, right) {
1289
- // Track which side(s) report each key as unrecognized
1571
+ // Track which side(s) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.
1290
1572
  const unrecKeys = new Map();
1291
1573
  let unrecIssue;
1292
- for (const iss of left.issues) {
1293
- if (iss.code === "unrecognized_keys") {
1574
+ const keyIssues = new Map();
1575
+ const collect = (iss, side) => {
1576
+ let keys;
1577
+ if (iss.code === "unrecognized_keys" && !iss.path?.length) {
1294
1578
  unrecIssue ?? (unrecIssue = iss);
1295
- for (const k of iss.keys) {
1296
- if (!unrecKeys.has(k))
1297
- unrecKeys.set(k, {});
1298
- unrecKeys.get(k).l = true;
1299
- }
1579
+ keys = iss.keys;
1580
+ }
1581
+ else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
1582
+ const k = String(iss.path[0]);
1583
+ if (!keyIssues.has(k))
1584
+ keyIssues.set(k, iss);
1585
+ keys = [k];
1300
1586
  }
1301
1587
  else {
1302
- result.issues.push(iss);
1588
+ return false;
1589
+ }
1590
+ for (const k of keys) {
1591
+ if (!unrecKeys.has(k))
1592
+ unrecKeys.set(k, {});
1593
+ unrecKeys.get(k)[side] = true;
1303
1594
  }
1595
+ return true;
1596
+ };
1597
+ for (const iss of left.issues) {
1598
+ if (!collect(iss, "l"))
1599
+ result.issues.push(iss);
1304
1600
  }
1305
1601
  for (const iss of right.issues) {
1306
- if (iss.code === "unrecognized_keys") {
1307
- for (const k of iss.keys) {
1308
- if (!unrecKeys.has(k))
1309
- unrecKeys.set(k, {});
1310
- unrecKeys.get(k).r = true;
1311
- }
1312
- }
1313
- else {
1602
+ if (!collect(iss, "r"))
1314
1603
  result.issues.push(iss);
1315
- }
1316
1604
  }
1317
- // Report only keys unrecognized by BOTH sides
1605
+ // Report only keys rejected by BOTH sides
1318
1606
  const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1319
- if (bothKeys.length && unrecIssue) {
1320
- result.issues.push({ ...unrecIssue, keys: bothKeys });
1607
+ if (bothKeys.length) {
1608
+ const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
1609
+ if (aggregated.length)
1610
+ result.issues.push({ ...unrecIssue, keys: aggregated });
1611
+ for (const k of bothKeys) {
1612
+ if (!aggregated.includes(k) && keyIssues.has(k))
1613
+ result.issues.push(keyIssues.get(k));
1614
+ }
1321
1615
  }
1322
- if (util.aborted(result))
1323
- return result;
1324
1616
  const merged = mergeValues(left.value, right.value);
1325
1617
  if (!merged.valid) {
1618
+ if (util.aborted(result))
1619
+ return result;
1326
1620
  throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
1327
1621
  }
1328
1622
  result.value = merged.data;
@@ -1331,6 +1625,8 @@ function handleIntersectionResults(result, left, right) {
1331
1625
  exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
1332
1626
  exports.$ZodType.init(inst, def);
1333
1627
  const items = def.items;
1628
+ const memo = core.globalConfig.memoizer;
1629
+ memo?.attach(inst);
1334
1630
  inst._zod.parse = (payload, ctx) => {
1335
1631
  const input = payload.value;
1336
1632
  if (!Array.isArray(input)) {
@@ -1342,7 +1638,7 @@ exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
1342
1638
  });
1343
1639
  return payload;
1344
1640
  }
1345
- payload.value = [];
1641
+ payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];
1346
1642
  const proms = [];
1347
1643
  const optinStart = getTupleOptStart(items, "optin");
1348
1644
  const optoutStart = getTupleOptStart(items, "optout");
@@ -1369,11 +1665,11 @@ exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
1369
1665
  });
1370
1666
  }
1371
1667
  }
1372
- // Run every item in parallel, collecting results into an indexed
1373
- // array. The post-processing in `handleTupleResults` walks them in
1374
- // order so it can decide whether an absent optional-output error can
1375
- // truncate the tail or must be reported to preserve required output.
1668
+ // Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.
1376
1669
  const itemResults = new Array(items.length);
1670
+ // only tracked when there is a rest loop to skip
1671
+ const abortEarly = def.rest ? ctx?.abortEarly : undefined;
1672
+ let itemAborted = false;
1377
1673
  for (let i = 0; i < items.length; i++) {
1378
1674
  const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
1379
1675
  if (r instanceof Promise) {
@@ -1383,12 +1679,21 @@ exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
1383
1679
  }
1384
1680
  else {
1385
1681
  itemResults[i] = r;
1682
+ if (abortEarly && !itemAborted && r.issues.length)
1683
+ itemAborted = util.aborted(r);
1386
1684
  }
1387
1685
  }
1388
- if (def.rest) {
1686
+ // sound because rest is non-empty exactly when every fixed index is present, the one case handleTupleResults cannot discard an item's issues
1687
+ if (def.rest && !itemAborted) {
1389
1688
  let i = items.length - 1;
1390
1689
  const rest = input.slice(items.length);
1690
+ let seen = payload.issues.length;
1391
1691
  for (const el of rest) {
1692
+ if (abortEarly && payload.issues.length !== seen) {
1693
+ if (util.aborted(payload, seen))
1694
+ break;
1695
+ seen = payload.issues.length;
1696
+ }
1392
1697
  i++;
1393
1698
  const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
1394
1699
  if (result instanceof Promise) {
@@ -1407,7 +1712,9 @@ exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
1407
1712
  });
1408
1713
  function getTupleOptStart(items, key) {
1409
1714
  for (let i = items.length - 1; i >= 0; i--) {
1410
- if (items[i]._zod[key] !== "optional")
1715
+ // optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.
1716
+ const omittable = key === "optin" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === "optional";
1717
+ if (!omittable)
1411
1718
  return i + 1;
1412
1719
  }
1413
1720
  return 0;
@@ -1419,12 +1726,15 @@ function handleTupleResult(result, final, index) {
1419
1726
  final.value[index] = result.value;
1420
1727
  }
1421
1728
  function handleTupleResults(itemResults, final, items, input, optoutStart) {
1422
- // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional
1423
- // rule, but only after `optoutStart`: the first index where the output
1424
- // tuple tail can be absent.
1729
+ // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.
1425
1730
  for (let i = 0; i < items.length; i++) {
1426
1731
  const r = itemResults[i];
1427
1732
  const isPresent = i < input.length;
1733
+ // The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.
1734
+ if (!isPresent && i >= optoutStart && items[i]._zod.optin === "optional") {
1735
+ final.value.length = i;
1736
+ break;
1737
+ }
1428
1738
  if (r.issues.length) {
1429
1739
  if (!isPresent && i >= optoutStart) {
1430
1740
  final.value.length = i;
@@ -1452,6 +1762,8 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
1452
1762
  }
1453
1763
  exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1454
1764
  exports.$ZodType.init(inst, def);
1765
+ const memo = core.globalConfig.memoizer;
1766
+ memo?.attach(inst);
1455
1767
  inst._zod.parse = (payload, ctx) => {
1456
1768
  const input = payload.value;
1457
1769
  if (!util.isPlainObject(input)) {
@@ -1463,14 +1775,18 @@ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1463
1775
  });
1464
1776
  return payload;
1465
1777
  }
1778
+ // no guard in either loop below: a record's invalid_key aborts but an enclosing intersection can reconcile it, so a stopped loop hides keys the sibling does not own and the intersection then rejects nothing
1466
1779
  const proms = [];
1467
1780
  const values = def.keyType._zod.values;
1468
- if (values) {
1469
- payload.value = {};
1781
+ if (values && !def.partial) {
1782
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1470
1783
  const recordKeys = new Set();
1471
1784
  for (const key of values) {
1472
1785
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1473
1786
  recordKeys.add(typeof key === "number" ? key.toString() : key);
1787
+ // A declared __proto__ is stripped but is not an unrecognized key.
1788
+ if (key === "__proto__")
1789
+ continue;
1474
1790
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1475
1791
  if (keyResult instanceof Promise) {
1476
1792
  throw new Error("Async schemas not supported in object keys currently");
@@ -1487,6 +1803,8 @@ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1487
1803
  continue;
1488
1804
  }
1489
1805
  const outKey = keyResult.value;
1806
+ if (outKey === "__proto__")
1807
+ continue;
1490
1808
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1491
1809
  if (result instanceof Promise) {
1492
1810
  proms.push(result.then((result) => {
@@ -1507,8 +1825,16 @@ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1507
1825
  let unrecognized;
1508
1826
  for (const key in input) {
1509
1827
  if (!recordKeys.has(key)) {
1510
- unrecognized = unrecognized ?? [];
1511
- unrecognized.push(key);
1828
+ if (def.mode === "loose") {
1829
+ // skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into
1830
+ if (key === "__proto__")
1831
+ continue;
1832
+ payload.value[key] = input[key];
1833
+ }
1834
+ else {
1835
+ unrecognized = unrecognized ?? [];
1836
+ unrecognized.push(key);
1837
+ }
1512
1838
  }
1513
1839
  }
1514
1840
  if (unrecognized && unrecognized.length > 0) {
@@ -1517,11 +1843,14 @@ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1517
1843
  input,
1518
1844
  inst,
1519
1845
  keys: unrecognized,
1846
+ continue: true,
1520
1847
  });
1521
1848
  }
1522
1849
  }
1523
1850
  else {
1524
- payload.value = {};
1851
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1852
+ // An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.
1853
+ let unrecognized;
1525
1854
  // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()
1526
1855
  for (const key of Reflect.ownKeys(input)) {
1527
1856
  if (key === "__proto__")
@@ -1532,8 +1861,7 @@ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1532
1861
  if (keyResult instanceof Promise) {
1533
1862
  throw new Error("Async schemas not supported in object keys currently");
1534
1863
  }
1535
- // Numeric string fallback: if key is a numeric string and failed, retry with Number(key)
1536
- // This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
1864
+ // Numeric string fallback: if key is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
1537
1865
  const checkNumericKey = typeof key === "string" && regexes.number.test(key) && keyResult.issues.length;
1538
1866
  if (checkNumericKey) {
1539
1867
  const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
@@ -1549,6 +1877,10 @@ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1549
1877
  // Pass through unchanged
1550
1878
  payload.value[key] = input[key];
1551
1879
  }
1880
+ else if (values) {
1881
+ unrecognized = unrecognized ?? [];
1882
+ unrecognized.push(key);
1883
+ }
1552
1884
  else {
1553
1885
  // Default "strict" behavior: error on invalid key
1554
1886
  payload.issues.push({
@@ -1562,22 +1894,35 @@ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1562
1894
  }
1563
1895
  continue;
1564
1896
  }
1897
+ // the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under
1898
+ const outKey = keyResult.value;
1899
+ if (outKey === "__proto__")
1900
+ continue;
1565
1901
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1566
1902
  if (result instanceof Promise) {
1567
1903
  proms.push(result.then((result) => {
1568
1904
  if (result.issues.length) {
1569
1905
  payload.issues.push(...util.prefixIssues(key, result.issues));
1570
1906
  }
1571
- payload.value[keyResult.value] = result.value;
1907
+ payload.value[outKey] = result.value;
1572
1908
  }));
1573
1909
  }
1574
1910
  else {
1575
1911
  if (result.issues.length) {
1576
1912
  payload.issues.push(...util.prefixIssues(key, result.issues));
1577
1913
  }
1578
- payload.value[keyResult.value] = result.value;
1914
+ payload.value[outKey] = result.value;
1579
1915
  }
1580
1916
  }
1917
+ if (unrecognized && unrecognized.length > 0) {
1918
+ payload.issues.push({
1919
+ code: "unrecognized_keys",
1920
+ input,
1921
+ inst,
1922
+ keys: unrecognized,
1923
+ continue: true,
1924
+ });
1925
+ }
1581
1926
  }
1582
1927
  if (proms.length) {
1583
1928
  return Promise.all(proms).then(() => payload);
@@ -1587,6 +1932,8 @@ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1587
1932
  });
1588
1933
  exports.$ZodMap = core.$constructor("$ZodMap", (inst, def) => {
1589
1934
  exports.$ZodType.init(inst, def);
1935
+ const memo = core.globalConfig.memoizer;
1936
+ memo?.attach(inst);
1590
1937
  inst._zod.parse = (payload, ctx) => {
1591
1938
  const input = payload.value;
1592
1939
  if (!(input instanceof Map)) {
@@ -1599,8 +1946,15 @@ exports.$ZodMap = core.$constructor("$ZodMap", (inst, def) => {
1599
1946
  return payload;
1600
1947
  }
1601
1948
  const proms = [];
1602
- payload.value = new Map();
1949
+ payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();
1950
+ const abortEarly = ctx?.abortEarly;
1951
+ let seen = payload.issues.length;
1603
1952
  for (const [key, value] of input) {
1953
+ if (abortEarly && payload.issues.length !== seen) {
1954
+ if (util.aborted(payload, seen))
1955
+ break;
1956
+ seen = payload.issues.length;
1957
+ }
1604
1958
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1605
1959
  const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
1606
1960
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
@@ -1616,6 +1970,7 @@ exports.$ZodMap = core.$constructor("$ZodMap", (inst, def) => {
1616
1970
  return Promise.all(proms).then(() => payload);
1617
1971
  return payload;
1618
1972
  };
1973
+ capSize(inst, mapSize);
1619
1974
  });
1620
1975
  function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
1621
1976
  if (keyResult.issues.length) {
@@ -1651,6 +2006,8 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
1651
2006
  }
1652
2007
  exports.$ZodSet = core.$constructor("$ZodSet", (inst, def) => {
1653
2008
  exports.$ZodType.init(inst, def);
2009
+ const memo = core.globalConfig.memoizer;
2010
+ memo?.attach(inst);
1654
2011
  inst._zod.parse = (payload, ctx) => {
1655
2012
  const input = payload.value;
1656
2013
  if (!(input instanceof Set)) {
@@ -1663,8 +2020,15 @@ exports.$ZodSet = core.$constructor("$ZodSet", (inst, def) => {
1663
2020
  return payload;
1664
2021
  }
1665
2022
  const proms = [];
1666
- payload.value = new Set();
2023
+ payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();
2024
+ const abortEarly = ctx?.abortEarly;
2025
+ let seen = payload.issues.length;
1667
2026
  for (const item of input) {
2027
+ if (abortEarly && payload.issues.length !== seen) {
2028
+ if (util.aborted(payload, seen))
2029
+ break;
2030
+ seen = payload.issues.length;
2031
+ }
1668
2032
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
1669
2033
  if (result instanceof Promise) {
1670
2034
  proms.push(result.then((result) => handleSetResult(result, payload)));
@@ -1676,6 +2040,7 @@ exports.$ZodSet = core.$constructor("$ZodSet", (inst, def) => {
1676
2040
  return Promise.all(proms).then(() => payload);
1677
2041
  return payload;
1678
2042
  };
2043
+ capSize(inst, setSize);
1679
2044
  });
1680
2045
  function handleSetResult(result, final) {
1681
2046
  if (result.issues.length) {
@@ -1688,10 +2053,11 @@ exports.$ZodEnum = core.$constructor("$ZodEnum", (inst, def) => {
1688
2053
  const values = util.getEnumValues(def.entries);
1689
2054
  const valuesSet = new Set(values);
1690
2055
  inst._zod.values = valuesSet;
1691
- inst._zod.pattern = new RegExp(`^(${values
1692
- .filter((k) => util.propertyKeyTypes.has(typeof k))
1693
- .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o.toString()))
1694
- .join("|")})$`);
2056
+ util.defineLazyInternal(inst, "pattern", (zod) => {
2057
+ const patternValues = util.getEnumValues(zod.def.entries).filter((k) => util.propertyKeyTypes.has(typeof k));
2058
+ // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
2059
+ return new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
2060
+ });
1695
2061
  inst._zod.parse = (payload, _ctx) => {
1696
2062
  const input = payload.value;
1697
2063
  if (valuesSet.has(input)) {
@@ -1708,14 +2074,17 @@ exports.$ZodEnum = core.$constructor("$ZodEnum", (inst, def) => {
1708
2074
  });
1709
2075
  exports.$ZodLiteral = core.$constructor("$ZodLiteral", (inst, def) => {
1710
2076
  exports.$ZodType.init(inst, def);
1711
- if (def.values.length === 0) {
1712
- throw new Error("Cannot create literal schema with no valid values");
1713
- }
1714
2077
  const values = new Set(def.values);
1715
2078
  inst._zod.values = values;
1716
- inst._zod.pattern = new RegExp(`^(${def.values
1717
- .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))
1718
- .join("|")})$`);
2079
+ util.defineLazyInternal(inst, "pattern", (zod) => {
2080
+ const vals = zod.def.values;
2081
+ // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
2082
+ return new RegExp(vals.length
2083
+ ? `^(${vals
2084
+ .map((o) => typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o))
2085
+ .join("|")})$`
2086
+ : "^[^\\s\\S]$");
2087
+ });
1719
2088
  inst._zod.parse = (payload, _ctx) => {
1720
2089
  const input = payload.value;
1721
2090
  if (values.has(input)) {
@@ -1749,6 +2118,7 @@ exports.$ZodFile = core.$constructor("$ZodFile", (inst, def) => {
1749
2118
  exports.$ZodTransform = core.$constructor("$ZodTransform", (inst, def) => {
1750
2119
  exports.$ZodType.init(inst, def);
1751
2120
  inst._zod.optin = "optional";
2121
+ core.globalConfig.memoizer?.guard(inst);
1752
2122
  inst._zod.parse = (payload, ctx) => {
1753
2123
  if (ctx.direction === "backward") {
1754
2124
  throw new core.$ZodEncodeError(inst.constructor.name);
@@ -1758,7 +2128,6 @@ exports.$ZodTransform = core.$constructor("$ZodTransform", (inst, def) => {
1758
2128
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
1759
2129
  return output.then((output) => {
1760
2130
  payload.value = output;
1761
- payload.fallback = true;
1762
2131
  return payload;
1763
2132
  });
1764
2133
  }
@@ -1766,37 +2135,37 @@ exports.$ZodTransform = core.$constructor("$ZodTransform", (inst, def) => {
1766
2135
  throw new core.$ZodAsyncError();
1767
2136
  }
1768
2137
  payload.value = _out;
1769
- payload.fallback = true;
1770
2138
  return payload;
1771
2139
  };
1772
2140
  });
1773
- function handleOptionalResult(result, input) {
1774
- if (input === undefined && (result.issues.length || result.fallback)) {
1775
- return { issues: [], value: undefined };
1776
- }
1777
- return result;
2141
+ function handleOptionalResult(payload, result) {
2142
+ // A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.
2143
+ payload.value = result.issues.length ? undefined : result.value;
2144
+ return payload;
1778
2145
  }
1779
2146
  exports.$ZodOptional = core.$constructor("$ZodOptional", (inst, def) => {
1780
2147
  exports.$ZodType.init(inst, def);
1781
- inst._zod.optin = "optional";
2148
+ // .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.
2149
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
1782
2150
  inst._zod.optout = "optional";
1783
- util.defineLazy(inst._zod, "values", () => {
1784
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;
2151
+ util.defineLazyInternal(inst, "values", (zod) => {
2152
+ const values = zod.def.innerType._zod.values;
2153
+ return values ? new Set([...values, undefined]) : undefined;
1785
2154
  });
1786
- util.defineLazy(inst._zod, "pattern", () => {
1787
- const pattern = def.innerType._zod.pattern;
2155
+ util.defineLazyInternal(inst, "pattern", (zod) => {
2156
+ const pattern = zod.def.innerType._zod.pattern;
1788
2157
  return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;
1789
2158
  });
1790
2159
  inst._zod.parse = (payload, ctx) => {
1791
- if (def.innerType._zod.optin === "optional") {
1792
- const input = payload.value;
1793
- const result = def.innerType._zod.run(payload, ctx);
1794
- if (result instanceof Promise)
1795
- return result.then((r) => handleOptionalResult(r, input));
1796
- return handleOptionalResult(result, input);
1797
- }
1798
2160
  if (payload.value === undefined) {
1799
- return payload;
2161
+ // Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.
2162
+ if (def.innerType._zod.optin !== "defaulted")
2163
+ return payload;
2164
+ // Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.
2165
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
2166
+ if (result instanceof Promise)
2167
+ return result.then((result) => handleOptionalResult(payload, result));
2168
+ return handleOptionalResult(payload, result);
1800
2169
  }
1801
2170
  return def.innerType._zod.run(payload, ctx);
1802
2171
  };
@@ -1805,8 +2174,8 @@ exports.$ZodExactOptional = core.$constructor("$ZodExactOptional", (inst, def) =
1805
2174
  // Call parent init - inherits optin/optout = "optional"
1806
2175
  exports.$ZodOptional.init(inst, def);
1807
2176
  // Override values/pattern to NOT add undefined
1808
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1809
- util.defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
2177
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2178
+ util.defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
1810
2179
  // Override parse to just delegate (no undefined handling)
1811
2180
  inst._zod.parse = (payload, ctx) => {
1812
2181
  return def.innerType._zod.run(payload, ctx);
@@ -1814,14 +2183,14 @@ exports.$ZodExactOptional = core.$constructor("$ZodExactOptional", (inst, def) =
1814
2183
  });
1815
2184
  exports.$ZodNullable = core.$constructor("$ZodNullable", (inst, def) => {
1816
2185
  exports.$ZodType.init(inst, def);
1817
- util.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1818
- util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1819
- util.defineLazy(inst._zod, "pattern", () => {
1820
- const pattern = def.innerType._zod.pattern;
2186
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
2187
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2188
+ util.defineLazyInternal(inst, "pattern", (zod) => {
2189
+ const pattern = zod.def.innerType._zod.pattern;
1821
2190
  return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;
1822
2191
  });
1823
- util.defineLazy(inst._zod, "values", () => {
1824
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;
2192
+ util.defineLazyInternal(inst, "values", (zod) => {
2193
+ return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : undefined;
1825
2194
  });
1826
2195
  inst._zod.parse = (payload, ctx) => {
1827
2196
  // Forward direction (decode): allow null to pass through
@@ -1833,8 +2202,8 @@ exports.$ZodNullable = core.$constructor("$ZodNullable", (inst, def) => {
1833
2202
  exports.$ZodDefault = core.$constructor("$ZodDefault", (inst, def) => {
1834
2203
  exports.$ZodType.init(inst, def);
1835
2204
  // inst._zod.qin = "true";
1836
- inst._zod.optin = "optional";
1837
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2205
+ inst._zod.optin = "defaulted";
2206
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
1838
2207
  inst._zod.parse = (payload, ctx) => {
1839
2208
  if (ctx.direction === "backward") {
1840
2209
  return def.innerType._zod.run(payload, ctx);
@@ -1863,8 +2232,8 @@ function handleDefaultResult(payload, def) {
1863
2232
  }
1864
2233
  exports.$ZodPrefault = core.$constructor("$ZodPrefault", (inst, def) => {
1865
2234
  exports.$ZodType.init(inst, def);
1866
- inst._zod.optin = "optional";
1867
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2235
+ inst._zod.optin = "defaulted";
2236
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
1868
2237
  inst._zod.parse = (payload, ctx) => {
1869
2238
  if (ctx.direction === "backward") {
1870
2239
  return def.innerType._zod.run(payload, ctx);
@@ -1878,8 +2247,8 @@ exports.$ZodPrefault = core.$constructor("$ZodPrefault", (inst, def) => {
1878
2247
  });
1879
2248
  exports.$ZodNonOptional = core.$constructor("$ZodNonOptional", (inst, def) => {
1880
2249
  exports.$ZodType.init(inst, def);
1881
- util.defineLazy(inst._zod, "values", () => {
1882
- const v = def.innerType._zod.values;
2250
+ util.defineLazyInternal(inst, "values", (zod) => {
2251
+ const v = zod.def.innerType._zod.values;
1883
2252
  return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
1884
2253
  });
1885
2254
  inst._zod.parse = (payload, ctx) => {
@@ -1918,47 +2287,40 @@ exports.$ZodSuccess = core.$constructor("$ZodSuccess", (inst, def) => {
1918
2287
  return payload;
1919
2288
  };
1920
2289
  });
2290
+ function handleCatchResult(payload, result, def, ctx) {
2291
+ if (!result.issues.length) {
2292
+ payload.value = result.value;
2293
+ // The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.
2294
+ if (result.memo)
2295
+ payload.memo = true;
2296
+ return payload;
2297
+ }
2298
+ // Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.
2299
+ payload.value = def.catchValue({
2300
+ ...result,
2301
+ value: payload.value,
2302
+ error: {
2303
+ issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
2304
+ },
2305
+ input: payload.value,
2306
+ });
2307
+ return payload;
2308
+ }
1921
2309
  exports.$ZodCatch = core.$constructor("$ZodCatch", (inst, def) => {
1922
2310
  exports.$ZodType.init(inst, def);
1923
- inst._zod.optin = "optional";
1924
- util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1925
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2311
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
2312
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2313
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
1926
2314
  inst._zod.parse = (payload, ctx) => {
1927
2315
  if (ctx.direction === "backward") {
1928
2316
  return def.innerType._zod.run(payload, ctx);
1929
2317
  }
1930
2318
  // Forward direction (decode): apply catch logic
1931
- const result = def.innerType._zod.run(payload, ctx);
2319
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
1932
2320
  if (result instanceof Promise) {
1933
- return result.then((result) => {
1934
- payload.value = result.value;
1935
- if (result.issues.length) {
1936
- payload.value = def.catchValue({
1937
- ...payload,
1938
- error: {
1939
- issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1940
- },
1941
- input: payload.value,
1942
- });
1943
- payload.issues = [];
1944
- payload.fallback = true;
1945
- }
1946
- return payload;
1947
- });
1948
- }
1949
- payload.value = result.value;
1950
- if (result.issues.length) {
1951
- payload.value = def.catchValue({
1952
- ...payload,
1953
- error: {
1954
- issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1955
- },
1956
- input: payload.value,
1957
- });
1958
- payload.issues = [];
1959
- payload.fallback = true;
2321
+ return result.then((result) => handleCatchResult(payload, result, def, ctx));
1960
2322
  }
1961
- return payload;
2323
+ return handleCatchResult(payload, result, def, ctx);
1962
2324
  };
1963
2325
  });
1964
2326
  exports.$ZodNaN = core.$constructor("$ZodNaN", (inst, def) => {
@@ -1978,10 +2340,10 @@ exports.$ZodNaN = core.$constructor("$ZodNaN", (inst, def) => {
1978
2340
  });
1979
2341
  exports.$ZodPipe = core.$constructor("$ZodPipe", (inst, def) => {
1980
2342
  exports.$ZodType.init(inst, def);
1981
- util.defineLazy(inst._zod, "values", () => def.in._zod.values);
1982
- util.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
1983
- util.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
1984
- util.defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2343
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2344
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2345
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2346
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
1985
2347
  inst._zod.parse = (payload, ctx) => {
1986
2348
  if (ctx.direction === "backward") {
1987
2349
  const right = def.out._zod.run(payload, ctx);
@@ -1998,19 +2360,20 @@ exports.$ZodPipe = core.$constructor("$ZodPipe", (inst, def) => {
1998
2360
  };
1999
2361
  });
2000
2362
  function handlePipeResult(left, next, ctx) {
2001
- if (left.issues.length) {
2363
+ // Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.
2364
+ if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
2002
2365
  // prevent further checks
2003
2366
  left.aborted = true;
2004
2367
  return left;
2005
2368
  }
2006
- return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
2369
+ return next._zod.run({ value: left.value, issues: left.issues }, ctx);
2007
2370
  }
2008
2371
  exports.$ZodCodec = core.$constructor("$ZodCodec", (inst, def) => {
2009
2372
  exports.$ZodType.init(inst, def);
2010
- util.defineLazy(inst._zod, "values", () => def.in._zod.values);
2011
- util.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2012
- util.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
2013
- util.defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2373
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2374
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2375
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2376
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
2014
2377
  inst._zod.parse = (payload, ctx) => {
2015
2378
  const direction = ctx.direction || "forward";
2016
2379
  if (direction === "forward") {
@@ -2064,10 +2427,10 @@ exports.$ZodPreprocess = core.$constructor("$ZodPreprocess", (inst, def) => {
2064
2427
  });
2065
2428
  exports.$ZodReadonly = core.$constructor("$ZodReadonly", (inst, def) => {
2066
2429
  exports.$ZodType.init(inst, def);
2067
- util.defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2068
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2069
- util.defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
2070
- util.defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
2430
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
2431
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2432
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
2433
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
2071
2434
  inst._zod.parse = (payload, ctx) => {
2072
2435
  if (ctx.direction === "backward") {
2073
2436
  return def.innerType._zod.run(payload, ctx);
@@ -2080,25 +2443,72 @@ exports.$ZodReadonly = core.$constructor("$ZodReadonly", (inst, def) => {
2080
2443
  };
2081
2444
  });
2082
2445
  function handleReadonlyResult(payload) {
2083
- payload.value = Object.freeze(payload.value);
2446
+ // A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.
2447
+ if (!payload.memo)
2448
+ payload.value = Object.freeze(payload.value);
2084
2449
  return payload;
2085
2450
  }
2451
+ // a leaf's pattern source with its own checks folded in: the last pattern-carrying check wins, else length bounds narrow the catch-all, else an integer format narrows the number form. the fold lives here instead of on `_zod.pattern` so a bundle without template literals never pays for it
2452
+ function leafPattern(schema) {
2453
+ const def = schema._zod.def;
2454
+ let pattern = def.pattern;
2455
+ let isInt = !!def.format?.includes("int");
2456
+ let minimum;
2457
+ let maximum;
2458
+ for (const ch of def.checks ?? []) {
2459
+ const d = ch._zod.def;
2460
+ if (d.pattern)
2461
+ pattern = d.pattern;
2462
+ isInt || (isInt = !!d.format?.includes("int"));
2463
+ const lo = d.minimum ?? d.length;
2464
+ const hi = d.maximum ?? d.length;
2465
+ if (lo !== undefined && (minimum === undefined || lo > minimum))
2466
+ minimum = lo;
2467
+ if (hi !== undefined && (maximum === undefined || hi < maximum))
2468
+ maximum = hi;
2469
+ }
2470
+ if (pattern)
2471
+ return pattern.source;
2472
+ // an empty range matches nothing at runtime, and `{8,5}` is not a legal quantifier
2473
+ if (minimum !== undefined && maximum !== undefined && minimum > maximum)
2474
+ return "(?!)";
2475
+ if (minimum !== undefined || maximum !== undefined)
2476
+ return regexes.string({ minimum, maximum }).source;
2477
+ const own = schema._zod.pattern;
2478
+ return (isInt && own === regexes.number ? regexes.integer : own)?.source;
2479
+ }
2480
+ // a part's pattern source. a wrapper's pattern embeds its inner pattern's source verbatim, so the folded form is substituted in place without knowing the wrapper's own composition; a union's options are joined the way the union builds its own pattern
2481
+ function partPattern(schema) {
2482
+ const def = schema._zod.def;
2483
+ const own = schema._zod.pattern?.source;
2484
+ // lazy resolves its inner on the internals, not the def
2485
+ const inner = def.innerType ?? schema._zod.innerType;
2486
+ if (inner) {
2487
+ const before = inner._zod.pattern?.source;
2488
+ const after = partPattern(inner);
2489
+ if (own && before && after && after !== before) {
2490
+ return own.replace(util.cleanRegex(before), () => util.cleanRegex(after));
2491
+ }
2492
+ return own;
2493
+ }
2494
+ if (def.options) {
2495
+ const sources = def.options.map(partPattern);
2496
+ if (sources.every(Boolean))
2497
+ return `^(${sources.map((s) => util.cleanRegex(s)).join("|")})$`;
2498
+ }
2499
+ return leafPattern(schema);
2500
+ }
2086
2501
  exports.$ZodTemplateLiteral = core.$constructor("$ZodTemplateLiteral", (inst, def) => {
2087
2502
  exports.$ZodType.init(inst, def);
2088
2503
  const regexParts = [];
2089
2504
  for (const part of def.parts) {
2090
2505
  if (typeof part === "object" && part !== null) {
2091
2506
  // is Zod schema
2092
- if (!part._zod.pattern) {
2093
- // if (!source)
2507
+ const source = partPattern(part);
2508
+ if (!source) {
2094
2509
  throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
2095
2510
  }
2096
- const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
2097
- if (!source)
2098
- throw new Error(`Invalid template literal part: ${part._zod.traits}`);
2099
- const start = source.startsWith("^") ? 1 : 0;
2100
- const end = source.endsWith("$") ? source.length - 1 : source.length;
2101
- regexParts.push(source.slice(start, end));
2511
+ regexParts.push(util.cleanRegex(source));
2102
2512
  }
2103
2513
  else if (part === null || util.primitiveTypes.has(typeof part)) {
2104
2514
  regexParts.push(util.escapeRegex(`${part}`));
@@ -2134,33 +2544,35 @@ exports.$ZodTemplateLiteral = core.$constructor("$ZodTemplateLiteral", (inst, de
2134
2544
  });
2135
2545
  exports.$ZodFunction = core.$constructor("$ZodFunction", (inst, def) => {
2136
2546
  exports.$ZodType.init(inst, def);
2137
- inst._def = def;
2547
+ // Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.
2548
+ Object.defineProperty(inst, "_def", { value: def });
2138
2549
  inst._zod.def = def;
2139
2550
  inst.implement = (func) => {
2140
2551
  if (typeof func !== "function") {
2141
2552
  throw new Error("implement() must be called with a function");
2142
2553
  }
2143
- return function (...args) {
2554
+ // Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.
2555
+ return Object.defineProperty(function (...args) {
2144
2556
  const parsedArgs = inst._def.input ? (0, parse_js_1.parse)(inst._def.input, args) : args;
2145
2557
  const result = Reflect.apply(func, this, parsedArgs);
2146
2558
  if (inst._def.output) {
2147
2559
  return (0, parse_js_1.parse)(inst._def.output, result);
2148
2560
  }
2149
2561
  return result;
2150
- };
2562
+ }, "_zod", { value: inst._zod, enumerable: false });
2151
2563
  };
2152
2564
  inst.implementAsync = (func) => {
2153
2565
  if (typeof func !== "function") {
2154
2566
  throw new Error("implementAsync() must be called with a function");
2155
2567
  }
2156
- return async function (...args) {
2568
+ return Object.defineProperty(async function (...args) {
2157
2569
  const parsedArgs = inst._def.input ? await (0, parse_js_1.parseAsync)(inst._def.input, args) : args;
2158
2570
  const result = await Reflect.apply(func, this, parsedArgs);
2159
2571
  if (inst._def.output) {
2160
2572
  return await (0, parse_js_1.parseAsync)(inst._def.output, result);
2161
2573
  }
2162
2574
  return result;
2163
- };
2575
+ }, "_zod", { value: inst._zod, enumerable: false });
2164
2576
  };
2165
2577
  inst._zod.parse = (payload, _ctx) => {
2166
2578
  if (typeof payload.value !== "function") {
@@ -2219,19 +2631,17 @@ exports.$ZodPromise = core.$constructor("$ZodPromise", (inst, def) => {
2219
2631
  });
2220
2632
  exports.$ZodLazy = core.$constructor("$ZodLazy", (inst, def) => {
2221
2633
  exports.$ZodType.init(inst, def);
2222
- // Cache the resolved inner type on the shared `def` so all clones of this
2223
- // lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance,
2224
- // preserving identity for cycle detection on recursive schemas.
2634
+ // Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.
2225
2635
  util.defineLazy(inst._zod, "innerType", () => {
2226
2636
  const d = def;
2227
2637
  if (!d._cachedInner)
2228
2638
  d._cachedInner = def.getter();
2229
2639
  return d._cachedInner;
2230
2640
  });
2231
- util.defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
2232
- util.defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
2233
- util.defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? undefined);
2234
- util.defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? undefined);
2641
+ util.defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
2642
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
2643
+ util.defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? undefined);
2644
+ util.defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? undefined);
2235
2645
  inst._zod.parse = (payload, ctx) => {
2236
2646
  const inner = inst._zod.innerType;
2237
2647
  return inner._zod.run(payload, ctx);
@@ -2268,3 +2678,22 @@ function handleRefineResult(result, payload, input, inst) {
2268
2678
  payload.issues.push(util.issue(_iss));
2269
2679
  }
2270
2680
  }
2681
+
2682
+ // seal-cjs-exports
2683
+ (function () {
2684
+ var keys = Object.getOwnPropertyNames(exports);
2685
+ for (var i = 0; i < keys.length; i++) {
2686
+ var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
2687
+ if (!desc || !desc.get || !desc.configurable) continue;
2688
+ var value;
2689
+ try {
2690
+ value = desc.get();
2691
+ } catch (e) {
2692
+ continue;
2693
+ }
2694
+ // a circular require may not have settled this one yet, so leave it live
2695
+ if (value === undefined) continue;
2696
+ Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
2697
+ }
2698
+ Object.freeze(exports);
2699
+ })();