@nullix/zod-mongoose-studio 3.3.2 → 3.3.3

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 (322) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{B7ScFmDB.js → 5ZXm4f56.js} +1 -1
  3. package/.output/public/_nuxt/{DbqvVYbv.js → B2fcLSyW.js} +1 -1
  4. package/.output/public/_nuxt/{DKK0Mrrg.js → BBN7l5Hn.js} +1 -1
  5. package/.output/public/_nuxt/BBTTtb8r.js +41 -0
  6. package/.output/public/_nuxt/{C8xmwXC2.js → BDbISGvP.js} +1 -1
  7. package/.output/public/_nuxt/{DJa7_7Hz.js → BijI4RNx.js} +1 -1
  8. package/.output/public/_nuxt/{BlZ0x31M.js → Bp9qkJ9m.js} +1 -1
  9. package/.output/public/_nuxt/{BcYnCaqL.js → Bu3-sqCf.js} +1 -1
  10. package/.output/public/_nuxt/{C919AVYR.js → C-FtTvwz.js} +1 -1
  11. package/.output/public/_nuxt/C02JV0Aj.js +1 -0
  12. package/.output/public/_nuxt/{Bbi9UBvi.js → C1UkIsDc.js} +1 -1
  13. package/.output/public/_nuxt/{PXBhK7S_.js → CJT28r6J.js} +1 -1
  14. package/.output/public/_nuxt/{BC9tFNFa.js → CL7qtgl2.js} +3 -3
  15. package/.output/public/_nuxt/{B6lqezyA.js → CRMd2YH2.js} +3 -3
  16. package/.output/public/_nuxt/{YC-RLggm.js → CRkdQgFz.js} +1 -1
  17. package/.output/public/_nuxt/{iKW_mt0p.js → Cw1XFOz5.js} +1 -1
  18. package/.output/public/_nuxt/{d1NBz903.js → D5yWk6Ly.js} +1 -1
  19. package/.output/public/_nuxt/{iGzUozbF.js → DA9GjKpR.js} +1 -1
  20. package/.output/public/_nuxt/{JkiDMdYG.js → DaWAlZhp.js} +1 -1
  21. package/.output/public/_nuxt/{OVQ3C2Ge.js → DafLMUHo.js} +1 -1
  22. package/.output/public/_nuxt/{Bw82IGM8.js → Dyaldc-t.js} +1 -1
  23. package/.output/public/_nuxt/{CsQL5F-l.js → UU9fpRNQ.js} +1 -1
  24. package/.output/public/_nuxt/builds/latest.json +1 -1
  25. package/.output/public/_nuxt/builds/meta/717459d8-0da1-42ed-af0b-9ec5395e8fdc.json +1 -0
  26. package/.output/public/_nuxt/entry.CDPplHzk.css +1 -0
  27. package/.output/public/_nuxt/error-404.hPtlUQpd.css +1 -0
  28. package/.output/public/_nuxt/error-500.E-PXUb6B.css +1 -0
  29. package/.output/public/_nuxt/{DbUZZZZu.js → kFZJW2-u.js} +2 -2
  30. package/.output/public/_nuxt/{B8gqXD2U.js → u3DlT5Mh.js} +1 -1
  31. package/.output/server/chunks/_/error-500.mjs.map +1 -1
  32. package/.output/server/chunks/_/parse-request.mjs +29 -0
  33. package/.output/server/chunks/_/parse-request.mjs.map +1 -0
  34. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  35. package/.output/server/chunks/build/{error-404-KRkA0DPI.mjs → error-404-aQ5PiVuX.mjs} +6 -12
  36. package/.output/server/chunks/build/error-404-aQ5PiVuX.mjs.map +1 -0
  37. package/.output/server/chunks/build/error-404-styles.DIZfBVBR.mjs +8 -0
  38. package/.output/server/chunks/build/error-404-styles.DIZfBVBR.mjs.map +1 -0
  39. package/.output/server/chunks/build/{error-500-DIIFf55p.mjs → error-500-BY6ZAZZ2.mjs} +6 -12
  40. package/.output/server/chunks/build/error-500-BY6ZAZZ2.mjs.map +1 -0
  41. package/.output/server/chunks/build/error-500-styles.BZXgEzR5.mjs +8 -0
  42. package/.output/server/chunks/build/error-500-styles.BZXgEzR5.mjs.map +1 -0
  43. package/.output/server/chunks/build/index-57_mtIua.mjs +235 -0
  44. package/.output/server/chunks/build/index-57_mtIua.mjs.map +1 -0
  45. package/.output/server/chunks/build/{index-CB1N4gax.mjs → index-Qa-4KqCB.mjs} +7 -13
  46. package/.output/server/chunks/build/index-Qa-4KqCB.mjs.map +1 -0
  47. package/.output/server/chunks/build/server.mjs +3913 -3378
  48. package/.output/server/chunks/build/server.mjs.map +1 -1
  49. package/.output/server/chunks/build/styles.mjs +4 -4
  50. package/.output/server/chunks/nitro/nitro.mjs +562 -2188
  51. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  52. package/.output/server/chunks/routes/api/editor-types.get.mjs +0 -6
  53. package/.output/server/chunks/routes/api/editor-types.get.mjs.map +1 -1
  54. package/.output/server/chunks/routes/api/parse.post.mjs +1599 -7
  55. package/.output/server/chunks/routes/api/parse.post.mjs.map +1 -1
  56. package/.output/server/chunks/routes/api/resolve.get.mjs +0 -6
  57. package/.output/server/chunks/routes/api/resolve.get.mjs.map +1 -1
  58. package/.output/server/chunks/routes/api/studio/run.post.mjs +41 -8
  59. package/.output/server/chunks/routes/api/studio/run.post.mjs.map +1 -1
  60. package/.output/server/chunks/routes/renderer.mjs +21 -44
  61. package/.output/server/chunks/routes/renderer.mjs.map +1 -1
  62. package/.output/server/index.mjs +1 -7
  63. package/.output/server/index.mjs.map +1 -1
  64. package/.output/server/node_modules/.nitro/@vue/compiler-core@3.5.43/dist/compiler-core.cjs.prod.js +6801 -0
  65. package/.output/server/node_modules/.nitro/@vue/compiler-core@3.5.43/package.json +58 -0
  66. package/.output/server/node_modules/.nitro/@vue/compiler-dom@3.5.43/dist/compiler-dom.cjs.prod.js +692 -0
  67. package/.output/server/node_modules/.nitro/@vue/compiler-dom@3.5.43/package.json +57 -0
  68. package/.output/server/node_modules/.nitro/@vue/reactivity@3.5.43/dist/reactivity.cjs.prod.js +1905 -0
  69. package/.output/server/node_modules/.nitro/@vue/reactivity@3.5.43/package.json +55 -0
  70. package/.output/server/node_modules/.nitro/@vue/runtime-core@3.5.43/dist/runtime-core.cjs.prod.js +7006 -0
  71. package/.output/server/node_modules/.nitro/@vue/runtime-core@3.5.43/package.json +52 -0
  72. package/.output/server/node_modules/.nitro/@vue/runtime-dom@3.5.43/dist/runtime-dom.cjs.prod.js +1867 -0
  73. package/.output/server/node_modules/.nitro/@vue/runtime-dom@3.5.43/package.json +60 -0
  74. package/.output/server/node_modules/.nitro/@vue/shared@3.5.43/dist/shared.cjs.prod.js +655 -0
  75. package/.output/server/node_modules/.nitro/@vue/shared@3.5.43/package.json +47 -0
  76. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/array-set.js +121 -0
  77. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/base64-vlq.js +140 -0
  78. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/base64.js +67 -0
  79. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/binary-search.js +111 -0
  80. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/mapping-list.js +79 -0
  81. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/quick-sort.js +141 -0
  82. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-map-consumer.js +1236 -0
  83. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-map-generator.js +446 -0
  84. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/source-node.js +420 -0
  85. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/lib/util.js +594 -0
  86. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/package.json +71 -0
  87. package/.output/server/node_modules/.nitro/source-map-js@1.2.2/source-map.js +8 -0
  88. package/.output/server/node_modules/.nitro/vue@3.5.43/dist/vue.cjs.js +80 -0
  89. package/.output/server/node_modules/.nitro/vue@3.5.43/dist/vue.cjs.prod.js +66 -0
  90. package/.output/server/node_modules/.nitro/vue@3.5.43/index.js +7 -0
  91. package/.output/server/node_modules/.nitro/vue@3.5.43/index.mjs +1 -0
  92. package/.output/server/node_modules/.nitro/vue@3.5.43/package.json +112 -0
  93. package/.output/server/node_modules/@babel/parser/lib/index.js +55 -21
  94. package/.output/server/node_modules/@babel/parser/package.json +7 -7
  95. package/.output/server/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  96. package/.output/server/node_modules/@esbuild/linux-x64/package.json +1 -1
  97. package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +19 -16
  98. package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +3 -4
  99. package/.output/server/node_modules/@iconify/utils/lib/css/common.js +16 -16
  100. package/.output/server/node_modules/@iconify/utils/lib/css/format.js +1 -2
  101. package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +11 -14
  102. package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +13 -16
  103. package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +1 -2
  104. package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +1 -3
  105. package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +2 -5
  106. package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +1 -3
  107. package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +4 -5
  108. package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +1 -3
  109. package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +9 -11
  110. package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +1 -2
  111. package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +1 -3
  112. package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +1 -3
  113. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +12 -18
  114. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +3 -4
  115. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +5 -7
  116. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +1 -8
  117. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +11 -12
  118. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +5 -7
  119. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +1 -3
  120. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +1 -3
  121. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +7 -7
  122. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +2 -4
  123. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +5 -9
  124. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +3 -5
  125. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +2 -4
  126. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +7 -8
  127. package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +1 -2
  128. package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +1 -3
  129. package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +3 -4
  130. package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +1 -2
  131. package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +1 -2
  132. package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +10 -15
  133. package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +1 -3
  134. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +3 -5
  135. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +1 -3
  136. package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +1 -3
  137. package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +1 -3
  138. package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +1 -2
  139. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +1 -3
  140. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +21 -13
  141. package/.output/server/node_modules/@iconify/utils/lib/index.js +1 -2
  142. package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +3 -3
  143. package/.output/server/node_modules/@iconify/utils/lib/loader/hmr-utils.js +33 -0
  144. package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +22 -22
  145. package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +7 -22
  146. package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +60 -16
  147. package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +1 -2
  148. package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +1 -2
  149. package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +1 -2
  150. package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +9 -11
  151. package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +1 -2
  152. package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +1 -3
  153. package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +1 -2
  154. package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +1 -2
  155. package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +1 -2
  156. package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +3 -5
  157. package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +5 -4
  158. package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +1 -2
  159. package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +1 -2
  160. package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +1 -2
  161. package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +2 -3
  162. package/.output/server/node_modules/@iconify/utils/package.json +15 -13
  163. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +8 -1
  164. package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
  165. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +34 -13
  166. package/.output/server/node_modules/@vue/server-renderer/package.json +4 -6
  167. package/.output/server/node_modules/devalue/index.js +15 -2
  168. package/.output/server/node_modules/devalue/package.json +5 -3
  169. package/.output/server/node_modules/devalue/src/base64.js +46 -96
  170. package/.output/server/node_modules/devalue/src/constants.js +5 -0
  171. package/.output/server/node_modules/devalue/src/operations.js +221 -0
  172. package/.output/server/node_modules/devalue/src/parse.js +76 -62
  173. package/.output/server/node_modules/devalue/src/stringify.js +164 -81
  174. package/.output/server/node_modules/devalue/src/uneval.js +312 -104
  175. package/.output/server/node_modules/devalue/src/utils.js +61 -19
  176. package/.output/server/node_modules/esbuild/lib/main.js +12 -8
  177. package/.output/server/node_modules/esbuild/package.json +50 -50
  178. package/.output/server/node_modules/hookable/dist/index.mjs +2 -11
  179. package/.output/server/node_modules/hookable/package.json +23 -22
  180. package/.output/server/node_modules/ip-address/dist/ipv4.js +7 -0
  181. package/.output/server/node_modules/ip-address/package.json +1 -1
  182. package/.output/server/node_modules/zod/package.json +20 -8
  183. package/.output/server/node_modules/zod/v4/classic/checks.js +1 -1
  184. package/.output/server/node_modules/zod/v4/classic/deep-partial.js +13 -0
  185. package/.output/server/node_modules/zod/v4/classic/errors.js +44 -35
  186. package/.output/server/node_modules/zod/v4/classic/external.js +5 -8
  187. package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +375 -78
  188. package/.output/server/node_modules/zod/v4/classic/in-out.js +36 -0
  189. package/.output/server/node_modules/zod/v4/classic/index.js +2 -2
  190. package/.output/server/node_modules/zod/v4/classic/iso.js +2 -17
  191. package/.output/server/node_modules/zod/v4/classic/package.json +2 -1
  192. package/.output/server/node_modules/zod/v4/classic/parse.js +1 -0
  193. package/.output/server/node_modules/zod/v4/classic/schemas.js +601 -223
  194. package/.output/server/node_modules/zod/v4/core/api.js +51 -26
  195. package/.output/server/node_modules/zod/v4/core/checks.js +68 -127
  196. package/.output/server/node_modules/zod/v4/core/compile.js +1858 -0
  197. package/.output/server/node_modules/zod/v4/core/core.js +87 -22
  198. package/.output/server/node_modules/zod/v4/core/doc.js +12 -9
  199. package/.output/server/node_modules/zod/v4/core/errors.js +127 -42
  200. package/.output/server/node_modules/zod/v4/core/index.js +3 -0
  201. package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +6 -2
  202. package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +413 -175
  203. package/.output/server/node_modules/zod/v4/core/memoizer.js +311 -0
  204. package/.output/server/node_modules/zod/v4/core/package.json +2 -1
  205. package/.output/server/node_modules/zod/v4/core/parse.js +130 -48
  206. package/.output/server/node_modules/zod/v4/core/regexes.js +39 -16
  207. package/.output/server/node_modules/zod/v4/core/registries.js +2 -2
  208. package/.output/server/node_modules/zod/v4/core/schemas.js +895 -382
  209. package/.output/server/node_modules/zod/v4/core/to-json-schema.js +253 -39
  210. package/.output/server/node_modules/zod/v4/core/util.js +383 -175
  211. package/.output/server/node_modules/zod/v4/core/versions.js +2 -2
  212. package/.output/server/node_modules/zod/v4/core/visit.js +169 -0
  213. package/.output/server/node_modules/zod/v4/index.js +3 -2
  214. package/.output/server/node_modules/zod/v4/locales/ar.js +5 -0
  215. package/.output/server/node_modules/zod/v4/locales/az.js +5 -0
  216. package/.output/server/node_modules/zod/v4/locales/be.js +12 -0
  217. package/.output/server/node_modules/zod/v4/locales/bg.js +5 -0
  218. package/.output/server/node_modules/zod/v4/locales/bn.js +113 -0
  219. package/.output/server/node_modules/zod/v4/locales/ca.js +5 -0
  220. package/.output/server/node_modules/zod/v4/locales/ckb.js +133 -0
  221. package/.output/server/node_modules/zod/v4/locales/cs.js +5 -0
  222. package/.output/server/node_modules/zod/v4/locales/da.js +7 -2
  223. package/.output/server/node_modules/zod/v4/locales/de.js +5 -0
  224. package/.output/server/node_modules/zod/v4/locales/el.js +112 -0
  225. package/.output/server/node_modules/zod/v4/locales/en.js +20 -4
  226. package/.output/server/node_modules/zod/v4/locales/eo.js +5 -0
  227. package/.output/server/node_modules/zod/v4/locales/es.js +4 -0
  228. package/.output/server/node_modules/zod/v4/locales/fa.js +5 -0
  229. package/.output/server/node_modules/zod/v4/locales/fi.js +5 -0
  230. package/.output/server/node_modules/zod/v4/locales/fr-CA.js +5 -0
  231. package/.output/server/node_modules/zod/v4/locales/fr.js +38 -17
  232. package/.output/server/node_modules/zod/v4/locales/gu.js +113 -0
  233. package/.output/server/node_modules/zod/v4/locales/he.js +7 -0
  234. package/.output/server/node_modules/zod/v4/locales/hi.js +111 -0
  235. package/.output/server/node_modules/zod/v4/locales/hr.js +126 -0
  236. package/.output/server/node_modules/zod/v4/locales/hu.js +5 -0
  237. package/.output/server/node_modules/zod/v4/locales/hy.js +11 -0
  238. package/.output/server/node_modules/zod/v4/locales/id.js +5 -0
  239. package/.output/server/node_modules/zod/v4/locales/index.js +14 -0
  240. package/.output/server/node_modules/zod/v4/locales/is.js +5 -0
  241. package/.output/server/node_modules/zod/v4/locales/it.js +6 -1
  242. package/.output/server/node_modules/zod/v4/locales/ja.js +5 -0
  243. package/.output/server/node_modules/zod/v4/locales/ka.js +13 -8
  244. package/.output/server/node_modules/zod/v4/locales/km.js +5 -0
  245. package/.output/server/node_modules/zod/v4/locales/kn.js +116 -0
  246. package/.output/server/node_modules/zod/v4/locales/ko.js +5 -0
  247. package/.output/server/node_modules/zod/v4/locales/lt.js +4 -0
  248. package/.output/server/node_modules/zod/v4/locales/mk.js +5 -0
  249. package/.output/server/node_modules/zod/v4/locales/ms.js +5 -0
  250. package/.output/server/node_modules/zod/v4/locales/ne.js +111 -0
  251. package/.output/server/node_modules/zod/v4/locales/nl.js +5 -0
  252. package/.output/server/node_modules/zod/v4/locales/nn.js +113 -0
  253. package/.output/server/node_modules/zod/v4/locales/no.js +7 -2
  254. package/.output/server/node_modules/zod/v4/locales/ota.js +5 -0
  255. package/.output/server/node_modules/zod/v4/locales/package.json +2 -1
  256. package/.output/server/node_modules/zod/v4/locales/pl.js +5 -0
  257. package/.output/server/node_modules/zod/v4/locales/ps.js +5 -0
  258. package/.output/server/node_modules/zod/v4/locales/pt-BR.js +143 -0
  259. package/.output/server/node_modules/zod/v4/locales/pt.js +89 -55
  260. package/.output/server/node_modules/zod/v4/locales/ro.js +122 -0
  261. package/.output/server/node_modules/zod/v4/locales/ru.js +12 -0
  262. package/.output/server/node_modules/zod/v4/locales/sk.js +116 -0
  263. package/.output/server/node_modules/zod/v4/locales/sl.js +5 -0
  264. package/.output/server/node_modules/zod/v4/locales/sv.js +7 -2
  265. package/.output/server/node_modules/zod/v4/locales/ta.js +5 -0
  266. package/.output/server/node_modules/zod/v4/locales/tg.js +117 -0
  267. package/.output/server/node_modules/zod/v4/locales/th.js +5 -0
  268. package/.output/server/node_modules/zod/v4/locales/tk.js +107 -0
  269. package/.output/server/node_modules/zod/v4/locales/tr.js +5 -0
  270. package/.output/server/node_modules/zod/v4/locales/uk.js +5 -0
  271. package/.output/server/node_modules/zod/v4/locales/ur.js +5 -0
  272. package/.output/server/node_modules/zod/v4/locales/uz.js +4 -0
  273. package/.output/server/node_modules/zod/v4/locales/vi.js +5 -0
  274. package/.output/server/node_modules/zod/v4/locales/yo.js +5 -0
  275. package/.output/server/node_modules/zod/v4/locales/zh-CN.js +5 -0
  276. package/.output/server/node_modules/zod/v4/locales/zh-TW.js +5 -0
  277. package/.output/server/node_modules/zod/v4/package.json +2 -1
  278. package/.output/server/package.json +18 -18
  279. package/README.md +9 -0
  280. package/package.json +8 -8
  281. package/.output/public/_nuxt/Czp4_2o-.js +0 -33
  282. package/.output/public/_nuxt/builds/meta/46174b5e-cab6-4a73-95f8-66a1c9b1be2b.json +0 -1
  283. package/.output/public/_nuxt/entry.DaqrxXuH.css +0 -1
  284. package/.output/public/_nuxt/error-404.CTSXlFYa.css +0 -1
  285. package/.output/public/_nuxt/error-500.DqEfQnVZ.css +0 -1
  286. package/.output/server/chunks/build/error-404-KRkA0DPI.mjs.map +0 -1
  287. package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs +0 -8
  288. package/.output/server/chunks/build/error-404-styles.I0NYw-Bn.mjs.map +0 -1
  289. package/.output/server/chunks/build/error-500-DIIFf55p.mjs.map +0 -1
  290. package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs +0 -8
  291. package/.output/server/chunks/build/error-500-styles.D1cs9hQy.mjs.map +0 -1
  292. package/.output/server/chunks/build/index-CB1N4gax.mjs.map +0 -1
  293. /package/.output/server/node_modules/{@vue/compiler-core → .nitro/@vue/compiler-core@3.5.32}/dist/compiler-core.cjs.prod.js +0 -0
  294. /package/.output/server/node_modules/{@vue/compiler-core → .nitro/@vue/compiler-core@3.5.32}/package.json +0 -0
  295. /package/.output/server/node_modules/{@vue/compiler-dom → .nitro/@vue/compiler-dom@3.5.32}/dist/compiler-dom.cjs.prod.js +0 -0
  296. /package/.output/server/node_modules/{@vue/compiler-dom → .nitro/@vue/compiler-dom@3.5.32}/package.json +0 -0
  297. /package/.output/server/node_modules/{@vue/reactivity → .nitro/@vue/reactivity@3.5.32}/dist/reactivity.cjs.prod.js +0 -0
  298. /package/.output/server/node_modules/{@vue/reactivity → .nitro/@vue/reactivity@3.5.32}/package.json +0 -0
  299. /package/.output/server/node_modules/{@vue/runtime-core → .nitro/@vue/runtime-core@3.5.32}/dist/runtime-core.cjs.prod.js +0 -0
  300. /package/.output/server/node_modules/{@vue/runtime-core → .nitro/@vue/runtime-core@3.5.32}/package.json +0 -0
  301. /package/.output/server/node_modules/{@vue/runtime-dom → .nitro/@vue/runtime-dom@3.5.32}/dist/runtime-dom.cjs.prod.js +0 -0
  302. /package/.output/server/node_modules/{@vue/runtime-dom → .nitro/@vue/runtime-dom@3.5.32}/package.json +0 -0
  303. /package/.output/server/node_modules/{@vue/shared → .nitro/@vue/shared@3.5.32}/dist/shared.cjs.prod.js +0 -0
  304. /package/.output/server/node_modules/{@vue/shared → .nitro/@vue/shared@3.5.32}/package.json +0 -0
  305. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/array-set.js +0 -0
  306. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/base64-vlq.js +0 -0
  307. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/base64.js +0 -0
  308. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/binary-search.js +0 -0
  309. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/mapping-list.js +0 -0
  310. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/quick-sort.js +0 -0
  311. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-map-consumer.js +0 -0
  312. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-map-generator.js +0 -0
  313. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/source-node.js +0 -0
  314. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/lib/util.js +0 -0
  315. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/package.json +0 -0
  316. /package/.output/server/node_modules/{source-map-js → .nitro/source-map-js@1.2.1}/source-map.js +0 -0
  317. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/dist/vue.cjs.js +0 -0
  318. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/dist/vue.cjs.prod.js +0 -0
  319. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/index.js +0 -0
  320. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/index.mjs +0 -0
  321. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.32}/package.json +0 -0
  322. /package/.output/server/node_modules/{vue → .nitro/vue@3.5.43}/server-renderer/index.mjs +0 -0
@@ -1,3 +1,4 @@
1
+ import { globalConfig } from "./core.js";
1
2
  // functions
2
3
  export function assertEqual(val) {
3
4
  return val;
@@ -5,6 +6,9 @@ export function assertEqual(val) {
5
6
  export function assertNotEqual(val) {
6
7
  return val;
7
8
  }
9
+ export function toZod() {
10
+ return (schema) => schema;
11
+ }
8
12
  export function assertIs(_arg) { }
9
13
  export function assertNever(_x) {
10
14
  throw new Error("Unexpected value in exhaustive check");
@@ -25,18 +29,23 @@ export function jsonStringifyReplacer(_, value) {
25
29
  return value.toString();
26
30
  return value;
27
31
  }
32
+ // the accessor lives on a shared prototype: an own accessor makes every box a dictionary-mode object (~360 B and a slow load per read against ~100 B and an inlined getter here)
33
+ class Cached {
34
+ constructor(getter) {
35
+ this._getter = getter;
36
+ this._value = undefined;
37
+ }
38
+ get value() {
39
+ const getter = this._getter;
40
+ if (getter !== undefined) {
41
+ this._value = getter();
42
+ this._getter = undefined;
43
+ }
44
+ return this._value;
45
+ }
46
+ }
28
47
  export function cached(getter) {
29
- const set = false;
30
- return {
31
- get value() {
32
- if (!set) {
33
- const value = getter();
34
- Object.defineProperty(this, "value", { value });
35
- return value;
36
- }
37
- throw new Error("cached value already set");
38
- },
39
- };
48
+ return new Cached(getter);
40
49
  }
41
50
  export function nullish(input) {
42
51
  return input === null || input === undefined;
@@ -47,21 +56,15 @@ export function cleanRegex(source) {
47
56
  return source.slice(start, end);
48
57
  }
49
58
  export function floatSafeRemainder(val, step) {
50
- const valDecCount = (val.toString().split(".")[1] || "").length;
51
- const stepString = step.toString();
52
- let stepDecCount = (stepString.split(".")[1] || "").length;
53
- if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
54
- const match = stepString.match(/\d?e-(\d?)/);
55
- if (match?.[1]) {
56
- stepDecCount = Number.parseInt(match[1]);
57
- }
58
- }
59
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
60
- const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
61
- const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
62
- return (valInt % stepInt) / 10 ** decCount;
63
- }
64
- const EVALUATING = Symbol("evaluating");
59
+ const ratio = val / step;
60
+ const roundedRatio = Math.round(ratio);
61
+ // `val` and `step` each round to a double before the division rounds again, so a true decimal multiple's quotient can sit up to 1.5 of these scaled epsilons from the integer. A 1x tolerance therefore rejected 2.03 as a multiple of 0.07; 4x covers the worst case with margin.
62
+ const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
63
+ if (Math.abs(ratio - roundedRatio) < tolerance)
64
+ return 0;
65
+ return ratio - roundedRatio;
66
+ }
67
+ const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
65
68
  export function defineLazy(object, key, getter) {
66
69
  let value = undefined;
67
70
  Object.defineProperty(object, key, {
@@ -97,6 +100,71 @@ export function assignProp(target, prop, value) {
97
100
  configurable: true,
98
101
  });
99
102
  }
103
+ /**
104
+ * Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
105
+ *
106
+ * Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
107
+ */
108
+ export function rawShape(def) {
109
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
110
+ return desc?.get ? desc.get.raw : desc?.value;
111
+ }
112
+ // where a builder reads its source's keys and descriptors, resolving only a shape a def answers for itself. A shape resolves by object spread, so only its enumerable keys are ever part of it.
113
+ function sourceShape(schema) {
114
+ return rawShape(schema._zod.def) ?? schema._zod.def.shape;
115
+ }
116
+ // a key whose value is not settled yet, self-caching so every read after the first gets the same one
117
+ function deferProp(target, key, getter) {
118
+ Object.defineProperty(target, key, {
119
+ get() {
120
+ const value = getter();
121
+ assignProp(this, key, value);
122
+ return value;
123
+ },
124
+ enumerable: true,
125
+ configurable: true,
126
+ });
127
+ }
128
+ // Writes a settled key. A plain assignment is much cheaper than `defineProperty` and produces the same descriptor, but it runs whatever setter already answers to the key — an accessor this shape deferred, or an inherited one, which `__proto__` has on every object and prototype pollution can add for any name.
129
+ function putProp(target, key, value) {
130
+ if (key in target)
131
+ assignProp(target, key, value);
132
+ else
133
+ target[key] = value;
134
+ }
135
+ /**
136
+ * Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
137
+ *
138
+ * A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.
139
+ */
140
+ function mirrorShape(target, source, keys, wrap) {
141
+ const raw = sourceShape(source);
142
+ for (const key of keys) {
143
+ const desc = Object.getOwnPropertyDescriptor(raw, key);
144
+ if (!desc.enumerable)
145
+ continue;
146
+ if (desc.get) {
147
+ deferProp(target, key, () => {
148
+ const value = source._zod.def.shape[key];
149
+ return wrap ? wrap(value, key) : value;
150
+ });
151
+ }
152
+ else
153
+ putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
154
+ }
155
+ }
156
+ // same, for a plain shape a caller passed rather than a schema's
157
+ function mirrorProps(target, source) {
158
+ for (const key of Reflect.ownKeys(source)) {
159
+ const desc = Object.getOwnPropertyDescriptor(source, key);
160
+ if (!desc.enumerable)
161
+ continue;
162
+ if (desc.get)
163
+ deferProp(target, key, () => source[key]);
164
+ else
165
+ putProp(target, key, desc.value);
166
+ }
167
+ }
100
168
  export function mergeDefs(...defs) {
101
169
  const mergedDescriptors = {};
102
170
  for (const def of defs) {
@@ -147,7 +215,11 @@ export const captureStackTrace = ("captureStackTrace" in Error ? Error.captureSt
147
215
  export function isObject(data) {
148
216
  return typeof data === "object" && data !== null && !Array.isArray(data);
149
217
  }
150
- export const allowsEval = cached(() => {
218
+ export const allowsEval = /* @__PURE__*/ cached(() => {
219
+ // Skip the probe under `jitless`: strict CSPs report the caught `new Function` as a `securitypolicyviolation` even though the throw is swallowed.
220
+ if (globalConfig.jitless) {
221
+ return false;
222
+ }
151
223
  // @ts-ignore
152
224
  if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
153
225
  return false;
@@ -185,6 +257,10 @@ export function shallowClone(o) {
185
257
  return { ...o };
186
258
  if (Array.isArray(o))
187
259
  return [...o];
260
+ if (o instanceof Map)
261
+ return new Map(o);
262
+ if (o instanceof Set)
263
+ return new Set(o);
188
264
  return o;
189
265
  }
190
266
  export function numKeys(data) {
@@ -241,8 +317,15 @@ export const getParsedType = (data) => {
241
317
  throw new Error(`Unknown data type: ${t}`);
242
318
  }
243
319
  };
244
- export const propertyKeyTypes = new Set(["string", "number", "symbol"]);
245
- export const primitiveTypes = new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
320
+ export const propertyKeyTypes = /* @__PURE__*/ new Set(["string", "number", "symbol"]);
321
+ export const primitiveTypes = /* @__PURE__*/ new Set([
322
+ "string",
323
+ "number",
324
+ "bigint",
325
+ "boolean",
326
+ "symbol",
327
+ "undefined",
328
+ ]);
246
329
  export function escapeRegex(str) {
247
330
  return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
248
331
  }
@@ -311,16 +394,17 @@ export function stringifyPrimitive(value) {
311
394
  }
312
395
  export function optionalKeys(shape) {
313
396
  return Object.keys(shape).filter((k) => {
314
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
397
+ return shape[k]._zod.optin !== undefined && shape[k]._zod.optout === "optional";
315
398
  });
316
399
  }
317
- export const NUMBER_FORMAT_RANGES = {
400
+ // Wrapped in a `@__PURE__` IIFE: esbuild never tree-shakes a top-level initializer that contains a member access on `Number`, so the bare object literal survived into every bundle.
401
+ export const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
318
402
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
319
403
  int32: [-2147483648, 2147483647],
320
404
  uint32: [0, 4294967295],
321
405
  float32: [-3.4028234663852886e38, 3.4028234663852886e38],
322
406
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE],
323
- };
407
+ }))();
324
408
  export const BIGINT_FORMAT_RANGES = {
325
409
  int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
326
410
  uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")],
@@ -332,23 +416,23 @@ export function pick(schema, mask) {
332
416
  if (hasChecks) {
333
417
  throw new Error(".pick() cannot be used on object schemas containing refinements");
334
418
  }
335
- const def = mergeDefs(schema._zod.def, {
336
- get shape() {
337
- const newShape = {};
338
- for (const key in mask) {
339
- if (!(key in currDef.shape)) {
340
- throw new Error(`Unrecognized key: "${key}"`);
341
- }
342
- if (!mask[key])
343
- continue;
344
- newShape[key] = currDef.shape[key];
345
- }
346
- assignProp(this, "shape", newShape); // self-caching
347
- return newShape;
348
- },
349
- checks: [],
350
- });
351
- return clone(schema, def);
419
+ const newShape = {};
420
+ mirrorShape(newShape, schema, maskedKeys(schema, mask));
421
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
422
+ }
423
+ // the mask keys that select something, checked against the source's shape without resolving it
424
+ function maskedKeys(schema, mask) {
425
+ const raw = sourceShape(schema);
426
+ const keys = [];
427
+ // `for...in` skips symbols, so a symbol in the mask would select nothing
428
+ for (const key of Reflect.ownKeys(mask)) {
429
+ if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
430
+ throw new Error(`Unrecognized key: "${String(key)}"`);
431
+ }
432
+ if (mask[key])
433
+ keys.push(key);
434
+ }
435
+ return keys;
352
436
  }
353
437
  export function omit(schema, mask) {
354
438
  const currDef = schema._zod.def;
@@ -357,23 +441,10 @@ export function omit(schema, mask) {
357
441
  if (hasChecks) {
358
442
  throw new Error(".omit() cannot be used on object schemas containing refinements");
359
443
  }
360
- const def = mergeDefs(schema._zod.def, {
361
- get shape() {
362
- const newShape = { ...schema._zod.def.shape };
363
- for (const key in mask) {
364
- if (!(key in currDef.shape)) {
365
- throw new Error(`Unrecognized key: "${key}"`);
366
- }
367
- if (!mask[key])
368
- continue;
369
- delete newShape[key];
370
- }
371
- assignProp(this, "shape", newShape); // self-caching
372
- return newShape;
373
- },
374
- checks: [],
375
- });
376
- return clone(schema, def);
444
+ const omitted = new Set(maskedKeys(schema, mask));
445
+ const newShape = {};
446
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
447
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
377
448
  }
378
449
  export function extend(schema, shape) {
379
450
  if (!isPlainObject(shape)) {
@@ -382,129 +453,68 @@ export function extend(schema, shape) {
382
453
  const checks = schema._zod.def.checks;
383
454
  const hasChecks = checks && checks.length > 0;
384
455
  if (hasChecks) {
385
- // Only throw if new shape overlaps with existing shape
386
- // Use getOwnPropertyDescriptor to check key existence without accessing values
387
- const existingShape = schema._zod.def.shape;
388
- for (const key in shape) {
456
+ // Only throw if new shape overlaps with existing shape. Use getOwnPropertyDescriptor to check key existence without accessing values
457
+ const existingShape = sourceShape(schema);
458
+ for (const key of Reflect.ownKeys(shape)) {
389
459
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
390
460
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
391
461
  }
392
462
  }
393
463
  }
394
- const def = mergeDefs(schema._zod.def, {
395
- get shape() {
396
- const _shape = { ...schema._zod.def.shape, ...shape };
397
- assignProp(this, "shape", _shape); // self-caching
398
- return _shape;
399
- },
400
- });
401
- return clone(schema, def);
464
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
465
+ }
466
+ // the source's keys, then the caller's overlaid on top
467
+ function extended(schema, shape) {
468
+ const newShape = {};
469
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
470
+ mirrorProps(newShape, shape);
471
+ return newShape;
402
472
  }
403
473
  export function safeExtend(schema, shape) {
404
474
  if (!isPlainObject(shape)) {
405
475
  throw new Error("Invalid input to safeExtend: expected a plain object");
406
476
  }
407
- const def = mergeDefs(schema._zod.def, {
408
- get shape() {
409
- const _shape = { ...schema._zod.def.shape, ...shape };
410
- assignProp(this, "shape", _shape); // self-caching
411
- return _shape;
412
- },
413
- });
414
- return clone(schema, def);
477
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
415
478
  }
416
479
  export function merge(a, b) {
480
+ if (!b?._zod?.def) {
481
+ throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
482
+ }
483
+ if (a._zod.def.checks?.length) {
484
+ throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
485
+ }
486
+ const newShape = {};
487
+ mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
488
+ mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
417
489
  const def = mergeDefs(a._zod.def, {
418
- get shape() {
419
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
420
- assignProp(this, "shape", _shape); // self-caching
421
- return _shape;
422
- },
490
+ shape: newShape,
423
491
  get catchall() {
424
492
  return b._zod.def.catchall;
425
493
  },
426
- checks: [], // delete existing checks
494
+ checks: b._zod.def.checks ?? [],
427
495
  });
428
496
  return clone(a, def);
429
497
  }
430
- export function partial(Class, schema, mask) {
498
+ export function partial(Class, schema, mask, name = "partial") {
431
499
  const currDef = schema._zod.def;
432
500
  const checks = currDef.checks;
433
501
  const hasChecks = checks && checks.length > 0;
434
502
  if (hasChecks) {
435
- throw new Error(".partial() cannot be used on object schemas containing refinements");
436
- }
437
- const def = mergeDefs(schema._zod.def, {
438
- get shape() {
439
- const oldShape = schema._zod.def.shape;
440
- const shape = { ...oldShape };
441
- if (mask) {
442
- for (const key in mask) {
443
- if (!(key in oldShape)) {
444
- throw new Error(`Unrecognized key: "${key}"`);
445
- }
446
- if (!mask[key])
447
- continue;
448
- // if (oldShape[key]!._zod.optin === "optional") continue;
449
- shape[key] = Class
450
- ? new Class({
451
- type: "optional",
452
- innerType: oldShape[key],
453
- })
454
- : oldShape[key];
455
- }
456
- }
457
- else {
458
- for (const key in oldShape) {
459
- // if (oldShape[key]!._zod.optin === "optional") continue;
460
- shape[key] = Class
461
- ? new Class({
462
- type: "optional",
463
- innerType: oldShape[key],
464
- })
465
- : oldShape[key];
466
- }
467
- }
468
- assignProp(this, "shape", shape); // self-caching
469
- return shape;
470
- },
471
- checks: [],
472
- });
473
- return clone(schema, def);
503
+ throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
504
+ }
505
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
506
+ const newShape = {};
507
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class &&
508
+ ((value, key) => (selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value }))));
509
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
474
510
  }
475
511
  export function required(Class, schema, mask) {
476
- const def = mergeDefs(schema._zod.def, {
477
- get shape() {
478
- const oldShape = schema._zod.def.shape;
479
- const shape = { ...oldShape };
480
- if (mask) {
481
- for (const key in mask) {
482
- if (!(key in shape)) {
483
- throw new Error(`Unrecognized key: "${key}"`);
484
- }
485
- if (!mask[key])
486
- continue;
487
- // overwrite with non-optional
488
- shape[key] = new Class({
489
- type: "nonoptional",
490
- innerType: oldShape[key],
491
- });
492
- }
493
- }
494
- else {
495
- for (const key in oldShape) {
496
- // overwrite with non-optional
497
- shape[key] = new Class({
498
- type: "nonoptional",
499
- innerType: oldShape[key],
500
- });
501
- }
502
- }
503
- assignProp(this, "shape", shape); // self-caching
504
- return shape;
505
- },
506
- });
507
- return clone(schema, def);
512
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
513
+ const newShape = {};
514
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) =>
515
+ // overwrite with non-optional
516
+ selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
517
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
508
518
  }
509
519
  // invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom
510
520
  export function aborted(x, startIndex = 0) {
@@ -517,6 +527,17 @@ export function aborted(x, startIndex = 0) {
517
527
  }
518
528
  return false;
519
529
  }
530
+ // Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined). Used to respect `abort: true` in .refine() even for checks that have a `when` function.
531
+ export function explicitlyAborted(x, startIndex = 0) {
532
+ if (x.aborted === true)
533
+ return true;
534
+ for (let i = startIndex; i < x.issues.length; i++) {
535
+ if (x.issues[i]?.continue === false) {
536
+ return true;
537
+ }
538
+ }
539
+ return false;
540
+ }
520
541
  export function prefixIssues(path, issues) {
521
542
  return issues.map((iss) => {
522
543
  var _a;
@@ -528,22 +549,44 @@ export function prefixIssues(path, issues) {
528
549
  export function unwrapMessage(message) {
529
550
  return typeof message === "string" ? message : message?.message;
530
551
  }
552
+ /* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */
553
+ export function attachSchema(issues, start, inst) {
554
+ var _a;
555
+ for (let i = start; i < issues.length; i++) {
556
+ (_a = issues[i]).schema ?? (_a.schema = inst);
557
+ }
558
+ }
531
559
  export function finalizeIssue(iss, ctx, config) {
532
- const full = { ...iss, path: iss.path ?? [] };
533
- // for backwards compatibility
534
- if (!iss.message) {
535
- const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??
560
+ var _a;
561
+ // A schema that raised an issue itself owns it outright, and outranks any stamp an enclosing check left in `attachSchema`. String formats and z.custom() are schema and check at once, so when they act as a check they defer to that stamp instead.
562
+ const traits = iss.inst?._zod?.traits;
563
+ if (traits?.has("$ZodType")) {
564
+ if (traits.has("$ZodCheck"))
565
+ (_a = iss).schema ?? (_a.schema = iss.inst);
566
+ else
567
+ iss.schema = iss.inst;
568
+ }
569
+ // Decreasing specificity, first map to return a message wins. `inst` is whatever raised the issue, so a check's own map outranks the owning schema's.
570
+ const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
571
+ const message = iss.message
572
+ ? iss.message
573
+ : (unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??
574
+ unwrapMessage(schemaError?.(iss)) ??
536
575
  unwrapMessage(ctx?.error?.(iss)) ??
537
576
  unwrapMessage(config.customError?.(iss)) ??
538
577
  unwrapMessage(config.localeError?.(iss)) ??
539
- "Invalid input";
540
- full.message = message;
578
+ "Invalid input");
579
+ // an explicit own-key copy beats object rest with excluded keys, which v8 routes through a generic runtime call; Object.keys rather than for-in so an issue pushed with a prototype does not leak inherited keys, and an own __proto__ key is dropped rather than assigned through the setter
580
+ const full = {};
581
+ for (const k of Object.keys(iss)) {
582
+ if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
583
+ continue;
584
+ full[k] = iss[k];
541
585
  }
542
- // delete (full as any).def;
543
- delete full.inst;
544
- delete full.continue;
545
- if (!ctx?.reportInput) {
546
- delete full.input;
586
+ full.path ?? (full.path = []);
587
+ full.message = message;
588
+ if (ctx?.reportInput) {
589
+ full.input = iss.input;
547
590
  }
548
591
  return full;
549
592
  }
@@ -557,6 +600,21 @@ export function getSizableOrigin(input) {
557
600
  return "file";
558
601
  return "unknown";
559
602
  }
603
+ const highSurrogate = /[\uD800-\uDBFF]/;
604
+ // Code points in `str`: a surrogate pair counts once, a lone surrogate as itself. Hand-rolled because the string iterator allocates and runs ~250x slower on this path; the regex probe exits ~50x quicker for a string with no astral characters.
605
+ export function codePointLength(str) {
606
+ const units = str.length;
607
+ if (!highSurrogate.test(str))
608
+ return units;
609
+ let count = units;
610
+ for (let i = 0; i < units - 1; i++) {
611
+ if ((str.charCodeAt(i) & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
612
+ count--;
613
+ i++;
614
+ }
615
+ }
616
+ return count;
617
+ }
560
618
  export function getLengthableOrigin(input) {
561
619
  if (Array.isArray(input))
562
620
  return "array";
@@ -649,3 +707,153 @@ export function uint8ArrayToHex(bytes) {
649
707
  export class Class {
650
708
  constructor(..._args) { }
651
709
  }
710
+ ////////// PROTOTYPE INSTALLERS //////////
711
+ //
712
+ // Members live on the prototype and materialize per instance on first read, which keeps own-property count under the step where V8 stops using inline slots. Changing anything here means re-measuring runtime, memory and bundle size together — see "The three axes" in AGENTS.md.
713
+ /**
714
+ * Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
715
+ *
716
+ * Call this from a `proto` initializer, which runs once per prototype — never per instance.
717
+ */
718
+ export function members(proto, table) {
719
+ for (const key in table) {
720
+ const desc = Object.getOwnPropertyDescriptor(table, key);
721
+ // a getter installs as written, so it stays live: `description` reads through to the registry on every access. not enumerable: an object literal's is, and a prototype member never was
722
+ if (desc.get)
723
+ Object.defineProperty(proto, key, { ...desc, enumerable: false });
724
+ // a method materializes bound on first read, which is what keeps a detached member working: `const opt = schema.optional; opt()`
725
+ else
726
+ defineBound(proto, key, desc.value);
727
+ }
728
+ }
729
+ /** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
730
+ export function own(inst, key, value, enumerable = true) {
731
+ Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
732
+ return value;
733
+ }
734
+ /** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
735
+ export function hide(inst, key, value) {
736
+ return own(inst, key, value, false);
737
+ }
738
+ /** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
739
+ export /*@__NO_SIDE_EFFECTS__*/ function derived(computes, table) {
740
+ for (const key in computes) {
741
+ const compute = computes[key];
742
+ // an object literal's accessor is configurable and enumerable, and `members` copies the descriptor as written
743
+ Object.defineProperty(table, key, {
744
+ configurable: true,
745
+ enumerable: true,
746
+ get() {
747
+ return own(this, key, compute(this));
748
+ },
749
+ set(value) {
750
+ own(this, key, value);
751
+ },
752
+ });
753
+ }
754
+ return table;
755
+ }
756
+ function defineBound(proto, key, fn) {
757
+ Object.defineProperty(proto, key, {
758
+ configurable: true,
759
+ get() {
760
+ // vitest's spyOn calls a prototype getter bare to find the function it wraps, so a nullish receiver answers the raw method
761
+ return this == null ? fn : own(this, key, fn.bind(this));
762
+ },
763
+ set(value) {
764
+ own(this, key, value);
765
+ },
766
+ });
767
+ }
768
+ /** Returns the prototype to install on, or `undefined` if this group is already installed on it. */
769
+ function claim(inst, sentinel) {
770
+ const proto = Object.getPrototypeOf(inst);
771
+ // Runs on every construction, so `in` rather than the costlier `hasOwnProperty.call`. Sentinels are keys the group itself defines.
772
+ return sentinel in proto ? undefined : proto;
773
+ }
774
+ // The internals whose init chain is installing. A second call for the same one is a derived constructor overriding its base, so it must not construct another schema in between or the override is dropped.
775
+ let installing;
776
+ // Set while a getter is running, so a value that resolved through a recursion break is not memoized. One shared descriptor shadows the key for the duration, which costs no per-key allocation.
777
+ let broke = false;
778
+ const breaker = {
779
+ configurable: true,
780
+ get() {
781
+ broke = true;
782
+ return undefined;
783
+ },
784
+ };
785
+ /**
786
+ * Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
787
+ * constructor, computed from the internals object itself and cached there on
788
+ * first read. One accessor per constructor rather than one per instance.
789
+ */
790
+ export function defineLazyInternal(inst, key, compute) {
791
+ const proto = Object.getPrototypeOf(inst._zod);
792
+ if (key in proto && installing !== inst._zod) {
793
+ // A repeat construction: everything is installed already. Cleared here so the reference is not held past the first construction of every type.
794
+ installing = undefined;
795
+ return;
796
+ }
797
+ installing = inst._zod;
798
+ Object.defineProperty(proto, key, {
799
+ configurable: true,
800
+ get() {
801
+ // Shadowed before computing so a re-entrant read from a recursive schema resolves to undefined instead of running the getter again.
802
+ Object.defineProperty(this, key, breaker);
803
+ const outer = broke;
804
+ broke = false;
805
+ try {
806
+ const value = compute(this);
807
+ // A result that resolved through a recursion break is recomputed once the graph is complete; everything else memoizes, undefined included.
808
+ if (broke)
809
+ delete this[key];
810
+ else
811
+ Object.defineProperty(this, key, { configurable: true, writable: true, value });
812
+ broke = broke || outer;
813
+ return value;
814
+ }
815
+ catch (err) {
816
+ // A compute that threw memoizes nothing, so a later read runs it again and fails the same way. The shadow goes with it, since leaving it installed would answer undefined for every later read.
817
+ delete this[key];
818
+ broke = broke || outer;
819
+ throw err;
820
+ }
821
+ },
822
+ set(value) {
823
+ Object.defineProperty(this, key, { configurable: true, writable: true, value });
824
+ },
825
+ });
826
+ }
827
+ /**
828
+ * Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
829
+ * data property. One accessor per constructor rather than one per instance, because an own accessor
830
+ * puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
831
+ */
832
+ export function installLazyProp(inst, key, make, enumerable) {
833
+ const proto = claim(inst, key);
834
+ if (!proto)
835
+ return;
836
+ Object.defineProperty(proto, key, {
837
+ configurable: true,
838
+ get() {
839
+ // Shadowed before computing, so a re-entrant read from a self-referential shape resolves to undefined instead of running the getter again. A data property rather than an accessor: an own accessor is the dictionary-mode transition this exists to avoid.
840
+ const desc = { configurable: true, writable: true, enumerable, value: undefined };
841
+ Object.defineProperty(this, key, desc);
842
+ // a compute that throws leaves the shadow behind, so later reads answer undefined instead of re-throwing; `defineLazy` did the same, and `defineLazyInternal`'s delete-on-catch would cost bytes in every bundle for a case only a throwing user getter reaches
843
+ desc.value = make(this);
844
+ Object.defineProperty(this, key, desc);
845
+ return desc.value;
846
+ },
847
+ set(value) {
848
+ Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });
849
+ },
850
+ });
851
+ }
852
+ /** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
853
+ export const CONSTANT_CATCH = "~constantCatch";
854
+ /** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
855
+ export function constantCatch(value) {
856
+ const fn = () => value;
857
+ fn[CONSTANT_CATCH] = true;
858
+ return fn;
859
+ }