@oneclick.dev/cms-core-modules 0.0.109 → 0.0.110

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 (576) hide show
  1. package/dist/Acquisition-DNCy8nQz.mjs +400 -0
  2. package/dist/Acquisition-Dt2rREU8.js +1 -0
  3. package/dist/AgendaOpeningHoursCard-B7ROIPWw.js +1 -0
  4. package/dist/AgendaOpeningHoursCard-Cp4wxUeK.mjs +172 -0
  5. package/dist/AppointmentDetailsCard-33WpATpV.mjs +161 -0
  6. package/dist/AppointmentDetailsCard-DpLM5IrB.js +1 -0
  7. package/dist/AppointmentEditor-BeOtYV6u.mjs +196 -0
  8. package/dist/AppointmentEditor-CaTfbkIf.js +1 -0
  9. package/dist/AppointmentListTable-DZJNmTMb.mjs +177 -0
  10. package/dist/AppointmentListTable-Dieu9US_.js +1 -0
  11. package/dist/Audience-Bs7b0TNm.js +1 -0
  12. package/dist/Audience-CUeMVYRy.mjs +489 -0
  13. package/dist/Components-C83O-xlF.mjs +623 -0
  14. package/dist/Components-DXbx0RLV.js +1 -0
  15. package/dist/Content-BHr_rPVY.js +1 -0
  16. package/dist/Content-CYOZKvWK.mjs +358 -0
  17. package/dist/ContentEditor-BprPiHMJ.js +462 -0
  18. package/dist/ContentEditor-D9-1SJ5F.mjs +30700 -0
  19. package/dist/CountryBreakdownCard-D7BK3nRD.js +1 -0
  20. package/dist/CountryBreakdownCard-DVxNz2DJ.mjs +196 -0
  21. package/dist/Create-89z41K73.js +1 -0
  22. package/dist/Create-BCklc_T1.mjs +1251 -0
  23. package/dist/DateFormatter-CYAD4GBN.js +1 -0
  24. package/dist/DateFormatter-DUxlo8X8.mjs +734 -0
  25. package/dist/Detail-BCOcP2ql.mjs +585 -0
  26. package/dist/Detail-Btzwo0Y3.mjs +3477 -0
  27. package/dist/Detail-Byk781b4.mjs +26 -0
  28. package/dist/Detail-C857g62L.js +1 -0
  29. package/dist/Detail-C8wQiDcv.js +1 -0
  30. package/dist/Detail-CNlljBfH.mjs +379 -0
  31. package/dist/Detail-CPqug27l.js +1 -0
  32. package/dist/Detail-CjuhjPby.js +1 -0
  33. package/dist/Detail-DnX7tsqN.mjs +649 -0
  34. package/dist/Detail-mvSGbnFU.js +1 -0
  35. package/dist/DeviceBreakdownCard-DRhQ9ufG.js +1 -0
  36. package/dist/DeviceBreakdownCard-W1frLe0L.mjs +159 -0
  37. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +76 -0
  38. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +1 -0
  39. package/dist/Entries-BdhUyJR5.mjs +728 -0
  40. package/dist/Entries-CEXM_SkO.js +1 -0
  41. package/dist/Find-D4Qa45qC.js +1 -0
  42. package/dist/Find-DIISO5GO.mjs +229 -0
  43. package/dist/GlobalStyling-C9VthHWK.mjs +1588 -0
  44. package/dist/GlobalStyling-CnSlXkZc.js +25 -0
  45. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +1 -0
  46. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dh9jzvE0.mjs +1255 -0
  47. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js +1 -0
  48. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs +330 -0
  49. package/dist/Overview-BCpJNiEB.mjs +190 -0
  50. package/dist/Overview-BDlBCUI_.js +1 -0
  51. package/dist/Overview-BKAti8nc.mjs +567 -0
  52. package/dist/Overview-BbvfH1u-.js +1 -0
  53. package/dist/Overview-Bn1Xx3_j.js +1 -0
  54. package/dist/Overview-C-Jb_BxY.mjs +860 -0
  55. package/dist/Overview-CIa1E-HH.mjs +178 -0
  56. package/dist/Overview-DAxCu9XC.js +1 -0
  57. package/dist/Overview-DC9io1bk.js +1 -0
  58. package/dist/Overview-Di84CsR5.mjs +476 -0
  59. package/dist/Overview-Su8ZUbMs.mjs +26 -0
  60. package/dist/Overview-T-lsy3UZ.js +1 -0
  61. package/dist/Overview-UoZHUMUz.js +1 -0
  62. package/dist/Overview-lWAyyenp.mjs +632 -0
  63. package/dist/PeakHoursCard-9-EZFZLR.mjs +182 -0
  64. package/dist/PeakHoursCard-BR5zmta4.js +1 -0
  65. package/dist/ProductDetailsCard-6nHikw4V.mjs +121 -0
  66. package/dist/ProductDetailsCard-Bn7qrgmc.js +1 -0
  67. package/dist/RealtimeCard--APfRNc8.js +1 -0
  68. package/dist/RealtimeCard-fvQlJcM7.mjs +126 -0
  69. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js +349 -0
  70. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs +3077 -0
  71. package/dist/SearchTermsCard-BsB-63aH.js +1 -0
  72. package/dist/SearchTermsCard-BzVrHKqQ.mjs +201 -0
  73. package/dist/SendPush-COns44j7.js +1 -0
  74. package/dist/SendPush-CPIOjVX4.mjs +184 -0
  75. package/dist/SeoHealth-MC3lSCOY.mjs +615 -0
  76. package/dist/SeoHealth-az1YuNF2.js +1 -0
  77. package/dist/TableView-DQW0A1oG.js +4 -0
  78. package/dist/TableView-DXHhJ-jm.mjs +6143 -0
  79. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +1 -0
  80. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +40 -0
  81. package/dist/TopPagesCard-BDeA997A.js +1 -0
  82. package/dist/TopPagesCard-CTozhOr_.mjs +159 -0
  83. package/dist/TrafficSourcesCard-BxtCKsqx.mjs +197 -0
  84. package/dist/TrafficSourcesCard-C3ziDTUL.js +1 -0
  85. package/dist/View-CsudjxCE.mjs +30 -0
  86. package/dist/View-Dw_wA6kK.js +1 -0
  87. package/dist/VisitorStatsCard-BmByE_Hi.js +1 -0
  88. package/dist/VisitorStatsCard-CXizEbVK.mjs +174 -0
  89. package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  90. package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  91. package/dist/agenda-DcatSSYQ.mjs +1165 -0
  92. package/dist/agenda-IOqtALWf.js +1 -0
  93. package/dist/array-CbATeQbk.js +1 -0
  94. package/dist/array-DT5pE8Gm.mjs +108 -0
  95. package/dist/availability-CMrRa5y2.mjs +269 -0
  96. package/dist/availability-Cf2YfMwM.js +1 -0
  97. package/dist/booking-data-DgJd0BcM.mjs +889 -0
  98. package/dist/booking-data-Di5GmH_8.js +1 -0
  99. package/dist/cms-core-modules.css +1 -2
  100. package/dist/countries-BTPvmrsb.mjs +4 -0
  101. package/dist/countries-CgZ081No.js +1 -0
  102. package/dist/exceptions-CI0B4xVj.js +1 -0
  103. package/dist/exceptions-YCQkHa6a.mjs +646 -0
  104. package/dist/google-CvtuJwgk.mjs +4 -0
  105. package/dist/google-D4N3gb01.js +1 -0
  106. package/dist/index-4tjmIans.js +1 -0
  107. package/dist/index-9HVlmvK3.js +1 -0
  108. package/dist/index-A2kp8Isi.js +75 -0
  109. package/dist/index-B5aBwdxY.js +54 -0
  110. package/dist/index-BFLV54kw.mjs +3843 -0
  111. package/dist/index-BWDwEd8D.mjs +24 -0
  112. package/dist/index-BfBBm9uY.mjs +24 -0
  113. package/dist/index-BhWvXMOp.mjs +176 -0
  114. package/dist/index-BiT55eU0.js +58 -0
  115. package/dist/index-Bkq58CeQ.mjs +22 -0
  116. package/dist/index-BzWmWCo5.mjs +1187 -0
  117. package/dist/index-CJQQBRLY.js +1 -0
  118. package/dist/index-CQkOH2_3.mjs +24 -0
  119. package/dist/index-CSxYBeVA.js +1 -0
  120. package/dist/index-CU-tbS5W.mjs +24 -0
  121. package/dist/index-CZn2nDLv.mjs +34 -0
  122. package/dist/index-CkiNvRzs.js +1 -0
  123. package/dist/index-Co4ON2Di.js +1 -0
  124. package/dist/index-Cpnn_Pxd.mjs +24 -0
  125. package/dist/index-CpzDEMeC.mjs +1443 -0
  126. package/dist/index-CsVeM3PA.mjs +24 -0
  127. package/dist/index-CwqrAU-H.js +1 -0
  128. package/dist/index-CxETuRsG.js +1 -0
  129. package/dist/index-Cz-baGax.js +1 -0
  130. package/dist/index-D30apIn-.mjs +110 -0
  131. package/dist/index-DFQGVHTs.js +1 -0
  132. package/dist/index-DPd3waTN.js +1 -0
  133. package/dist/index-DRqJOqUR.mjs +3484 -0
  134. package/dist/index-DjWuIBxh.js +1 -0
  135. package/dist/index-Dnn2SCSl.js +1 -0
  136. package/dist/index-Dpl9sU6a.mjs +12 -0
  137. package/dist/index-DrXxXB2F.mjs +138 -0
  138. package/dist/index-G7cIlnGN.js +158 -0
  139. package/dist/index-R2oUDsjx.js +1 -0
  140. package/dist/index-RLz1QPrf.mjs +203 -0
  141. package/dist/index-UtjLbLw-.js +1 -0
  142. package/dist/index-V78huaSJ.mjs +442 -0
  143. package/dist/index-cOnxXTbF.mjs +24 -0
  144. package/dist/index-hlylYYgy.mjs +24 -0
  145. package/dist/index-ijdf0d9-.js +1 -0
  146. package/dist/index-vHmvbEwa.js +35 -0
  147. package/dist/index-wjkEPsNx.mjs +2940 -0
  148. package/dist/index.cjs.js +1 -1
  149. package/dist/index.mjs +806 -1095
  150. package/dist/interpolation-CHn59tIC.js +1 -0
  151. package/dist/interpolation-w7IRDJwK.mjs +180 -0
  152. package/dist/orders-C65SlpJy.mjs +618 -0
  153. package/dist/orders-XVzWAgG1.js +1 -0
  154. package/dist/payment-C3ohkehF.mjs +1080 -0
  155. package/dist/payment-Dfr-Ro-a.js +1 -0
  156. package/dist/regular-1LXNPviB.js +1 -0
  157. package/dist/regular-_05oq5Tx.mjs +1101 -0
  158. package/dist/resources-CYOb5Bl6.mjs +811 -0
  159. package/dist/resources-CxeFd57z.js +1 -0
  160. package/dist/server-handlers.cjs.js +1 -1
  161. package/dist/server-handlers.mjs +996 -1049
  162. package/dist/src/appointments/chat-components/AgendaOpeningHoursCard.vue.d.ts +15 -0
  163. package/dist/src/appointments/chat-components/AppointmentDetailsCard.vue.d.ts +14 -0
  164. package/dist/src/appointments/chat-components/AppointmentEditor.vue.d.ts +14 -0
  165. package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +14 -0
  166. package/dist/src/appointments/components/create/StepNavigation.vue.d.ts +32 -0
  167. package/dist/src/appointments/components/create/regular/Step1.vue.d.ts +2 -0
  168. package/dist/src/appointments/components/create/regular/Step2.vue.d.ts +2 -0
  169. package/dist/src/appointments/components/create/regular/Step3.vue.d.ts +2 -0
  170. package/dist/src/appointments/components/create/regular/Step4.vue.d.ts +2 -0
  171. package/dist/src/appointments/components/edit/CustomerInformationFieldEditorDialog.vue.d.ts +24 -0
  172. package/dist/src/appointments/components/edit/EditLayout.vue.d.ts +17 -0
  173. package/dist/src/appointments/components/edit/Event24hSidebar.vue.d.ts +2 -0
  174. package/dist/src/appointments/components/edit/EventDialog/ApproveReservationDialog.vue.d.ts +8 -0
  175. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +136 -0
  176. package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +8 -0
  177. package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +11 -0
  178. package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +55 -0
  179. package/dist/src/appointments/components/edit/EventDialog/RejectReservationDialog.vue.d.ts +8 -0
  180. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +87 -0
  181. package/dist/src/appointments/components/edit/EventDialog/TimelineChart.vue.d.ts +24 -0
  182. package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +4 -0
  183. package/dist/src/appointments/components/edit/EventTimeIndicator.vue.d.ts +12 -0
  184. package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +48 -0
  185. package/dist/src/appointments/components/edit/EventView.vue.d.ts +9 -0
  186. package/dist/src/appointments/components/edit/ExceptionDialog.vue.d.ts +29 -0
  187. package/dist/src/appointments/components/edit/MetadataSchemaEditorDialog.vue.d.ts +12 -0
  188. package/dist/src/appointments/components/edit/NewReservationDialog/CustomerInformation.vue.d.ts +10 -0
  189. package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +26 -0
  190. package/dist/src/appointments/components/edit/NewReservationDialog/QuickReservationAdder.vue.d.ts +26 -0
  191. package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +31 -0
  192. package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +21 -0
  193. package/dist/src/appointments/components/edit/PaymentAddons/Addon.vue.d.ts +22 -0
  194. package/dist/src/appointments/components/edit/PaymentAddons/AddonList.vue.d.ts +5 -0
  195. package/dist/src/appointments/components/edit/PaymentAddons/index.vue.d.ts +15 -0
  196. package/dist/src/appointments/components/edit/ResourceEditorDialog.vue.d.ts +13 -0
  197. package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +36 -0
  198. package/dist/src/appointments/components/edit/dashboard/timeline/ResourceSelector.vue.d.ts +50 -0
  199. package/dist/src/appointments/index.d.ts +12 -9
  200. package/dist/src/appointments/index.vue.d.ts +22 -0
  201. package/dist/src/appointments/metadata.d.ts +1 -1
  202. package/dist/src/appointments/pages/Overview.vue.d.ts +4 -0
  203. package/dist/src/appointments/pages/create/index.vue.d.ts +2 -0
  204. package/dist/src/appointments/pages/create/regular.vue.d.ts +6 -0
  205. package/dist/src/appointments/pages/edit/agenda.vue.d.ts +4 -0
  206. package/dist/src/appointments/pages/edit/availability.vue.d.ts +2 -0
  207. package/dist/src/appointments/pages/edit/booking-data.vue.d.ts +65 -0
  208. package/dist/src/appointments/pages/edit/index.vue.d.ts +2 -0
  209. package/dist/src/appointments/pages/edit/payment.vue.d.ts +2 -0
  210. package/dist/src/appointments/pages/edit/resources.vue.d.ts +28 -0
  211. package/dist/src/appointments/routes.d.ts +6 -3
  212. package/dist/src/contentManager/components/components/ComponentDialog.vue.d.ts +12 -0
  213. package/dist/src/contentManager/components/components/ComponentGridItem.vue.d.ts +16 -0
  214. package/dist/src/contentManager/components/content-editor/ApiDocs.vue.d.ts +2 -0
  215. package/dist/src/contentManager/components/content-editor/ContentLayout.vue.d.ts +49 -0
  216. package/dist/src/contentManager/components/content-editor/ContentSettings.vue.d.ts +24 -0
  217. package/dist/src/contentManager/components/content-editor/ContentStructuredContentSections.vue.d.ts +4 -0
  218. package/dist/src/contentManager/components/content-editor/Header.vue.d.ts +64 -0
  219. package/dist/src/contentManager/components/content-editor/LivePreviewWrapper.vue.d.ts +53 -0
  220. package/dist/src/contentManager/components/content-editor/Locales.vue.d.ts +44 -0
  221. package/dist/src/contentManager/components/content-editor/NewSectionDialog.vue.d.ts +21 -0
  222. package/dist/src/contentManager/components/content-editor/PageSettings.vue.d.ts +2 -0
  223. package/dist/src/contentManager/components/content-editor/SEO.vue.d.ts +14 -0
  224. package/dist/src/contentManager/components/content-editor/SidebarSectionWrapper.vue.d.ts +39 -0
  225. package/dist/src/contentManager/components/content-editor/Status.vue.d.ts +2 -0
  226. package/dist/src/contentManager/components/content-editor/Versions.vue.d.ts +63 -0
  227. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Button.vue.d.ts +94 -0
  228. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Card.vue.d.ts +92 -0
  229. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Column.vue.d.ts +92 -0
  230. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.vue.d.ts +92 -0
  231. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Divider.vue.d.ts +92 -0
  232. package/dist/src/contentManager/components/content-editor/tiptap-extensions/EmptySpace.vue.d.ts +94 -0
  233. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Heading.vue.d.ts +92 -0
  234. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Image.vue.d.ts +92 -0
  235. package/dist/src/contentManager/components/content-editor/tiptap-extensions/LockBlocks.d.ts +0 -15
  236. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Map.vue.d.ts +92 -0
  237. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Paragraph.vue.d.ts +92 -0
  238. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.vue.d.ts +115 -0
  239. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.vue.d.ts +115 -0
  240. package/dist/src/contentManager/components/content-editor/tiptap-extensions/TrailingNodeInContainers.d.ts +1 -4
  241. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Video.vue.d.ts +92 -0
  242. package/dist/src/contentManager/components/content-editor/tiptap-extensions/extension-details/DetailsNodeView.vue.d.ts +92 -0
  243. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/NodeLabel.vue.d.ts +108 -0
  244. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/ResizeHandlers.vue.d.ts +20 -0
  245. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/TopMarginDragger.vue.d.ts +104 -0
  246. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuClassBuilder.vue.d.ts +19 -0
  247. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuLinkBuilder.vue.d.ts +19 -0
  248. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuToggleButton.vue.d.ts +29 -0
  249. package/dist/src/contentManager/components/content-editor/tiptap-menus/DefaultBubbleMenu.vue.d.ts +13 -0
  250. package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +19 -0
  251. package/dist/src/contentManager/components/content-editor/tiptap-menus/EmojiMenu.vue.d.ts +8 -0
  252. package/dist/src/contentManager/components/content-editor/tiptap-menus/NewNodeView.vue.d.ts +47 -0
  253. package/dist/src/contentManager/components/content-editor/tiptap-menus/SlashMenu.vue.d.ts +6 -0
  254. package/dist/src/contentManager/components/content-editor/tiptap-menus/SlashMenuButton.vue.d.ts +17 -0
  255. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ButtonMenu.vue.d.ts +13 -0
  256. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/CardMenu.vue.d.ts +13 -0
  257. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ColumnMenu.vue.d.ts +13 -0
  258. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/DividerMenu.vue.d.ts +13 -0
  259. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/EmptySpaceMenu.vue.d.ts +13 -0
  260. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/HeadingMenu.vue.d.ts +13 -0
  261. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ImageMenu.vue.d.ts +13 -0
  262. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/MapMenu.vue.d.ts +13 -0
  263. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/RowMenu.vue.d.ts +13 -0
  264. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/StackMenu.vue.d.ts +13 -0
  265. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/TextMenu.vue.d.ts +13 -0
  266. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/VideoMenu.vue.d.ts +13 -0
  267. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +132 -12
  268. package/dist/src/contentManager/components/overview/CollectionDialog.vue.d.ts +30 -0
  269. package/dist/src/contentManager/components/overview/CollectionsGridView.vue.d.ts +18 -0
  270. package/dist/src/contentManager/components/overview/ContentEntryContextMenu.vue.d.ts +27 -0
  271. package/dist/src/contentManager/components/overview/FilterPopover.vue.d.ts +2 -0
  272. package/dist/src/contentManager/components/overview/ListView.vue.d.ts +12 -0
  273. package/dist/src/contentManager/components/styling/ButtonStyleDialog.vue.d.ts +24 -0
  274. package/dist/src/contentManager/components/styling/CardStyleDialog.vue.d.ts +24 -0
  275. package/dist/src/contentManager/components/styling/SectionStyleDialog.vue.d.ts +24 -0
  276. package/dist/src/contentManager/index.d.ts +14 -5
  277. package/dist/src/contentManager/index.vue.d.ts +22 -0
  278. package/dist/src/contentManager/metadata.d.ts +1 -1
  279. package/dist/src/contentManager/pages/Components.vue.d.ts +27 -0
  280. package/dist/src/contentManager/pages/ContentEditor.vue.d.ts +14 -0
  281. package/dist/src/contentManager/pages/Entries.vue.d.ts +16 -0
  282. package/dist/src/contentManager/pages/GlobalStyling.vue.d.ts +117 -0
  283. package/dist/src/contentManager/pages/Overview.vue.d.ts +57 -0
  284. package/dist/src/contentManager/routes.d.ts +12 -3
  285. package/dist/src/custom/index.d.ts +2 -2
  286. package/dist/src/custom/index.vue.d.ts +2 -0
  287. package/dist/src/custom/pages/View.vue.d.ts +2 -0
  288. package/dist/src/custom/routes.d.ts +1 -1
  289. package/dist/src/googleAnalytics/chat-components/CountryBreakdownCard.vue.d.ts +14 -0
  290. package/dist/src/googleAnalytics/chat-components/DeviceBreakdownCard.vue.d.ts +14 -0
  291. package/dist/src/googleAnalytics/chat-components/PeakHoursCard.vue.d.ts +14 -0
  292. package/dist/src/googleAnalytics/chat-components/RealtimeCard.vue.d.ts +14 -0
  293. package/dist/src/googleAnalytics/chat-components/SearchTermsCard.vue.d.ts +14 -0
  294. package/dist/src/googleAnalytics/chat-components/TopPagesCard.vue.d.ts +14 -0
  295. package/dist/src/googleAnalytics/chat-components/TrafficSourcesCard.vue.d.ts +14 -0
  296. package/dist/src/googleAnalytics/chat-components/VisitorStatsCard.vue.d.ts +14 -0
  297. package/dist/src/googleAnalytics/components/seo-health/SeoClicksChart.vue.d.ts +5 -0
  298. package/dist/src/googleAnalytics/components/seo-health/SeoImpressionsChart.vue.d.ts +5 -0
  299. package/dist/src/googleAnalytics/components/seo-health/SeoKeywordsTab.vue.d.ts +5 -0
  300. package/dist/src/googleAnalytics/components/seo-health/SeoKpiCards.vue.d.ts +10 -0
  301. package/dist/src/googleAnalytics/components/seo-health/SeoMappingTab.vue.d.ts +5 -0
  302. package/dist/src/googleAnalytics/components/seo-health/SeoPagesTab.vue.d.ts +5 -0
  303. package/dist/src/googleAnalytics/components/seo-health/SeoRankingDistribution.vue.d.ts +5 -0
  304. package/dist/src/googleAnalytics/index.d.ts +10 -10
  305. package/dist/src/googleAnalytics/index.vue.d.ts +2 -0
  306. package/dist/src/googleAnalytics/pages/Acquisition.vue.d.ts +2 -0
  307. package/dist/src/googleAnalytics/pages/Audience.vue.d.ts +2 -0
  308. package/dist/src/googleAnalytics/pages/Content.vue.d.ts +2 -0
  309. package/dist/src/googleAnalytics/pages/Overview.vue.d.ts +2 -0
  310. package/dist/src/googleAnalytics/pages/SeoHealth.vue.d.ts +2 -0
  311. package/dist/src/googleAnalytics/routes.d.ts +1 -1
  312. package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +2 -0
  313. package/dist/src/mailTemplates/index.d.ts +3 -3
  314. package/dist/src/mailTemplates/index.vue.d.ts +22 -0
  315. package/dist/src/mailTemplates/metadata.d.ts +1 -1
  316. package/dist/src/mailTemplates/pages/Detail.vue.d.ts +14 -0
  317. package/dist/src/mailTemplates/pages/Overview.vue.d.ts +14 -0
  318. package/dist/src/mailTemplates/routes.d.ts +1 -1
  319. package/dist/src/productCollections/components/detail/Main.vue.d.ts +2 -0
  320. package/dist/src/productCollections/components/detail/SEO.vue.d.ts +2 -0
  321. package/dist/src/productCollections/components/detail/Status.vue.d.ts +2 -0
  322. package/dist/src/productCollections/components/overview/ListView.vue.d.ts +12 -0
  323. package/dist/src/productCollections/index.d.ts +3 -3
  324. package/dist/src/productCollections/index.vue.d.ts +22 -0
  325. package/dist/src/productCollections/metadata.d.ts +1 -1
  326. package/dist/src/productCollections/pages/Detail.vue.d.ts +14 -0
  327. package/dist/src/productCollections/pages/Overview.vue.d.ts +16 -0
  328. package/dist/src/productCollections/routes.d.ts +1 -1
  329. package/dist/src/products/chat-components/ProductDetailsCard.vue.d.ts +14 -0
  330. package/dist/src/products/components/detail/Collections.vue.d.ts +14 -0
  331. package/dist/src/products/components/detail/Inventory.vue.d.ts +2 -0
  332. package/dist/src/products/components/detail/Main.vue.d.ts +2 -0
  333. package/dist/src/products/components/detail/NewSection.vue.d.ts +2 -0
  334. package/dist/src/products/components/detail/Price.vue.d.ts +2 -0
  335. package/dist/src/products/components/detail/SEO.vue.d.ts +2 -0
  336. package/dist/src/products/components/detail/Shipping.vue.d.ts +2 -0
  337. package/dist/src/products/components/detail/Status.vue.d.ts +2 -0
  338. package/dist/src/products/components/detail/price/UnitPriceDialog.vue.d.ts +17 -0
  339. package/dist/src/products/components/detail/variants/Option.vue.d.ts +33 -0
  340. package/dist/src/products/components/detail/variants/VariantList.vue.d.ts +38 -0
  341. package/dist/src/products/components/overview/FilterPopover.vue.d.ts +2 -0
  342. package/dist/src/products/components/overview/GridView.vue.d.ts +12 -0
  343. package/dist/src/products/components/overview/ListView.vue.d.ts +12 -0
  344. package/dist/src/products/components/overview/ProductContextMenu.vue.d.ts +27 -0
  345. package/dist/src/products/index.d.ts +4 -4
  346. package/dist/src/products/index.vue.d.ts +22 -0
  347. package/dist/src/products/metadata.d.ts +1 -1
  348. package/dist/src/products/pages/Detail.vue.d.ts +14 -0
  349. package/dist/src/products/pages/Overview.vue.d.ts +16 -0
  350. package/dist/src/products/routes.d.ts +1 -1
  351. package/dist/src/promoCodes/components/create/DateRange.vue.d.ts +2 -0
  352. package/dist/src/promoCodes/components/create/MultiCodes.vue.d.ts +2 -0
  353. package/dist/src/promoCodes/components/create/Note.vue.d.ts +2 -0
  354. package/dist/src/promoCodes/components/create/SingleCode.vue.d.ts +2 -0
  355. package/dist/src/promoCodes/components/create/TypeAndValue/TypeDetailDialog.vue.d.ts +6 -0
  356. package/dist/src/promoCodes/components/create/TypeAndValue/TypeManageDialog.vue.d.ts +18 -0
  357. package/dist/src/promoCodes/components/create/TypeAndValue/index.vue.d.ts +2 -0
  358. package/dist/src/promoCodes/index.d.ts +3 -3
  359. package/dist/src/promoCodes/index.vue.d.ts +22 -0
  360. package/dist/src/promoCodes/metadata.d.ts +1 -1
  361. package/dist/src/promoCodes/pages/Create.vue.d.ts +16 -0
  362. package/dist/src/promoCodes/pages/Detail.vue.d.ts +14 -0
  363. package/dist/src/promoCodes/pages/Find.vue.d.ts +16 -0
  364. package/dist/src/promoCodes/routes.d.ts +1 -1
  365. package/dist/src/push-notifications/components/PreviewAndroid.vue.d.ts +28 -0
  366. package/dist/src/push-notifications/components/PreviewIPhone.vue.d.ts +28 -0
  367. package/dist/src/push-notifications/components/PushPreview.vue.d.ts +28 -0
  368. package/dist/src/push-notifications/index.d.ts +3 -3
  369. package/dist/src/push-notifications/index.vue.d.ts +22 -0
  370. package/dist/src/push-notifications/metadata.d.ts +1 -1
  371. package/dist/src/push-notifications/pages/SendPush.vue.d.ts +14 -0
  372. package/dist/src/push-notifications/routes.d.ts +1 -1
  373. package/dist/src/shared/BrandLogo.vue.d.ts +12 -0
  374. package/dist/src/shared/DrawerToggle.vue.d.ts +60 -0
  375. package/dist/src/shared/VerticalToggle.vue.d.ts +60 -0
  376. package/dist/src/shippingOptions/components/detail/Condition.vue.d.ts +2 -0
  377. package/dist/src/shippingOptions/components/detail/Countries.vue.d.ts +2 -0
  378. package/dist/src/shippingOptions/components/detail/Example.vue.d.ts +2 -0
  379. package/dist/src/shippingOptions/components/detail/Main.vue.d.ts +2 -0
  380. package/dist/src/shippingOptions/components/overview/ListView.vue.d.ts +12 -0
  381. package/dist/src/shippingOptions/index.d.ts +3 -3
  382. package/dist/src/shippingOptions/index.vue.d.ts +22 -0
  383. package/dist/src/shippingOptions/metadata.d.ts +1 -1
  384. package/dist/src/shippingOptions/pages/Detail.vue.d.ts +14 -0
  385. package/dist/src/shippingOptions/pages/Overview.vue.d.ts +16 -0
  386. package/dist/src/shippingOptions/routes.d.ts +1 -1
  387. package/dist/src/table/components/DataTable.vue.d.ts +18 -0
  388. package/dist/src/table/components/DataTableAction.vue.d.ts +14 -0
  389. package/dist/src/table/components/DataTableMobileRowActionDrawer.vue.d.ts +4 -0
  390. package/dist/src/table/components/DataTablePagination.vue.d.ts +6 -0
  391. package/dist/src/table/components/actions/ActionDialog.vue.d.ts +19 -0
  392. package/dist/src/table/components/actions/CtaActionDialog.vue.d.ts +4 -0
  393. package/dist/src/table/components/columns/ColumnDropdown.vue.d.ts +2 -0
  394. package/dist/src/table/components/columns/ColumnEditorDialog.vue.d.ts +34 -0
  395. package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +12 -0
  396. package/dist/src/table/components/date-range-filter/DateRangeFilter.vue.d.ts +2 -0
  397. package/dist/src/table/components/date-range-filter/DateRangeSettingsDialog.vue.d.ts +27 -0
  398. package/dist/src/table/components/filters/FilterDialog.vue.d.ts +12 -0
  399. package/dist/src/table/components/filters/Filters.vue.d.ts +27 -0
  400. package/dist/src/table/components/search/Search.vue.d.ts +2 -0
  401. package/dist/src/table/components/sort/SortMode.vue.d.ts +2 -0
  402. package/dist/src/table/components/sort/SortModeSettingsDialog.vue.d.ts +18 -0
  403. package/dist/src/table/components/stats/StatDialog.vue.d.ts +12 -0
  404. package/dist/src/table/components/stats/Stats.vue.d.ts +27 -0
  405. package/dist/src/table/flow-builder-extensions/TableRowEditor.vue.d.ts +16 -0
  406. package/dist/src/table/flow-builder-extensions/row-item.d.ts +17 -3
  407. package/dist/src/table/index.d.ts +2 -2
  408. package/dist/src/table/index.vue.d.ts +22 -0
  409. package/dist/src/table/pages/TableView.vue.d.ts +54 -0
  410. package/dist/src/table/routes.d.ts +1 -1
  411. package/dist/src/types/index.d.ts +0 -6
  412. package/dist/utils-CanmrIWO.mjs +47 -0
  413. package/dist/utils-Yd6F5mea.js +3 -0
  414. package/dist/vee-validate-zod-ByykgYKJ.js +1 -0
  415. package/dist/vee-validate-zod-DNjTLCgh.mjs +4402 -0
  416. package/package.json +56 -55
  417. package/dist/Acquisition-DypEyPSO.js +0 -1
  418. package/dist/Acquisition-TCNX-th6.mjs +0 -308
  419. package/dist/AgendaOpeningHoursCard-BIhm0vpV.js +0 -1
  420. package/dist/AgendaOpeningHoursCard-BKUdJxRI.mjs +0 -133
  421. package/dist/AppointmentDetailsCard-C5rQ5jsW.js +0 -1
  422. package/dist/AppointmentDetailsCard-NRHeNP2L.mjs +0 -111
  423. package/dist/AppointmentEditor-BcF8CiD-.mjs +0 -150
  424. package/dist/AppointmentEditor-BlhFtoCm.js +0 -1
  425. package/dist/AppointmentListTable-B-ReBVtV.js +0 -1
  426. package/dist/AppointmentListTable-DHmy-iid.mjs +0 -129
  427. package/dist/Audience-CfWHjjg8.mjs +0 -394
  428. package/dist/Audience-Cj4TyauW.js +0 -1
  429. package/dist/Components-BehelN4r.js +0 -1
  430. package/dist/Components-CR6zukUU.mjs +0 -468
  431. package/dist/Content-C5Iye3t0.mjs +0 -257
  432. package/dist/Content-eOfBx52Y.js +0 -1
  433. package/dist/ContentEditor-BgL4qEeg.mjs +0 -26835
  434. package/dist/ContentEditor-Tlu3w0Hu.js +0 -462
  435. package/dist/CountryBreakdownCard-CWVyB8be.mjs +0 -151
  436. package/dist/CountryBreakdownCard-Db-pMiNe.js +0 -1
  437. package/dist/Create-B1it8S4m.js +0 -1
  438. package/dist/Create-DbYi0FAI.mjs +0 -907
  439. package/dist/DateFormatter-DLrDYkby.mjs +0 -630
  440. package/dist/DateFormatter-Dni0Oq8r.js +0 -1
  441. package/dist/Detail-D-eahJGO.mjs +0 -21
  442. package/dist/Detail-D0kdPPIm.mjs +0 -2757
  443. package/dist/Detail-DAafePYi.mjs +0 -485
  444. package/dist/Detail-DYpv4fYg.js +0 -1
  445. package/dist/Detail-Dc_ui4LM.js +0 -1
  446. package/dist/Detail-DccUekl_.js +0 -1
  447. package/dist/Detail-Dhz0V0Vf.js +0 -1
  448. package/dist/Detail-DjnGY0F8.mjs +0 -282
  449. package/dist/Detail-DplAitHg.mjs +0 -447
  450. package/dist/Detail-SugyeSxb.js +0 -1
  451. package/dist/DeviceBreakdownCard-CzxZT6To.js +0 -1
  452. package/dist/DeviceBreakdownCard-eEwPjzKl.mjs +0 -115
  453. package/dist/EditLayout-Bnz9q_jd.js +0 -1
  454. package/dist/EditLayout-J_DGXb8v.mjs +0 -99
  455. package/dist/Entries-CgpWg6fE.js +0 -1
  456. package/dist/Entries-CkGTXcAq.mjs +0 -575
  457. package/dist/Find-Bz0TNJzk.mjs +0 -164
  458. package/dist/Find-D-ItTXaZ.js +0 -1
  459. package/dist/GlobalStyling-CSQPF7o_.mjs +0 -1162
  460. package/dist/GlobalStyling-DabldMZh.js +0 -15
  461. package/dist/NewReservationDialog-BhIiY2B9.js +0 -1
  462. package/dist/NewReservationDialog-CN49aGcM.mjs +0 -1002
  463. package/dist/OrderDetailDialog-BJ01DZFe.js +0 -1
  464. package/dist/OrderDetailDialog-CoVQ_rzs.mjs +0 -215
  465. package/dist/Overview-9FMgn5hT.mjs +0 -492
  466. package/dist/Overview-BOOwMQ-c.mjs +0 -636
  467. package/dist/Overview-Biz3h60w.js +0 -1
  468. package/dist/Overview-C2K2ofdS.js +0 -1
  469. package/dist/Overview-CFHOXP9N.mjs +0 -123
  470. package/dist/Overview-CTJe7J5_.js +0 -1
  471. package/dist/Overview-Cvj2i9eW.js +0 -1
  472. package/dist/Overview-D2I1F8Dm.mjs +0 -21
  473. package/dist/Overview-DFOc9emt.mjs +0 -345
  474. package/dist/Overview-Dmhfb94Y.js +0 -1
  475. package/dist/Overview-PPzv7weG.mjs +0 -450
  476. package/dist/Overview-qFKcXHVF.js +0 -1
  477. package/dist/Overview-xkmYYTae.mjs +0 -133
  478. package/dist/Overview-yPsLvR2c.js +0 -1
  479. package/dist/PeakHoursCard-CtgEP-ez.mjs +0 -157
  480. package/dist/PeakHoursCard-DPeoMyhu.js +0 -1
  481. package/dist/ProductDetailsCard-B0WhmzO-.mjs +0 -98
  482. package/dist/ProductDetailsCard-C1ROuH6l.js +0 -1
  483. package/dist/RealtimeCard-DQno-Okz.js +0 -1
  484. package/dist/RealtimeCard-dR-g1iDo.mjs +0 -92
  485. package/dist/ReservationDetailDialog-Cdo6h0RD.mjs +0 -2163
  486. package/dist/ReservationDetailDialog-DZTFD2xI.js +0 -349
  487. package/dist/SearchTermsCard-BXJSXz_k.js +0 -1
  488. package/dist/SearchTermsCard-DsaxLKwP.mjs +0 -146
  489. package/dist/SendPush-Bssi-OZD.mjs +0 -150
  490. package/dist/SendPush-BuaYboRH.js +0 -1
  491. package/dist/SeoHealth-CP-kL0us.js +0 -1
  492. package/dist/SeoHealth-Cxp_Gb3Y.mjs +0 -459
  493. package/dist/TableView-7iwBkQ_k.mjs +0 -4757
  494. package/dist/TableView-BB_oIYYZ.js +0 -4
  495. package/dist/TemplateList-CNcM_Kgq.mjs +0 -56
  496. package/dist/TemplateList-VuPcBUJO.js +0 -1
  497. package/dist/TopPagesCard-CvDECn3_.mjs +0 -117
  498. package/dist/TopPagesCard-DNdATXJE.js +0 -1
  499. package/dist/TrafficSourcesCard-BLpBr7u0.mjs +0 -151
  500. package/dist/TrafficSourcesCard-_3gRUCw3.js +0 -1
  501. package/dist/View-DSnUHI7h.mjs +0 -30
  502. package/dist/View-Dbcfpdqh.js +0 -1
  503. package/dist/VisitorStatsCard-CFEnXSjF.mjs +0 -185
  504. package/dist/VisitorStatsCard-C_jhQxDW.js +0 -1
  505. package/dist/_plugin-vue_export-helper-5u7tqpWC.js +0 -1
  506. package/dist/_plugin-vue_export-helper-BJQSo0im.mjs +0 -8
  507. package/dist/agenda-CzMRcQTA.mjs +0 -989
  508. package/dist/agenda-D4zWRYSQ.js +0 -1
  509. package/dist/appointments-9syR5TZE.js +0 -1
  510. package/dist/appointments-BBmOJMhM.mjs +0 -23
  511. package/dist/array-BH1uH7XT.js +0 -1
  512. package/dist/array-DnDL9cFz.mjs +0 -98
  513. package/dist/availability-CAXB7Yd6.js +0 -1
  514. package/dist/availability-Dp7eF-ZK.mjs +0 -215
  515. package/dist/booking-data-Bysf6e5x.mjs +0 -724
  516. package/dist/booking-data-C6SGjC2X.js +0 -1
  517. package/dist/chunk-DQi1bQcV.js +0 -1
  518. package/dist/contentManager-D7JxXCwE.js +0 -1
  519. package/dist/contentManager-tfy0x1LD.mjs +0 -22
  520. package/dist/context-AQKfnJ4t.mjs +0 -3809
  521. package/dist/context-ubyMq9Xe.js +0 -54
  522. package/dist/core-Dhgr4ctC.mjs +0 -202
  523. package/dist/core-_HKfBlaZ.js +0 -1
  524. package/dist/countries-MXLT3mVe.mjs +0 -4
  525. package/dist/countries-OCd5qPxG.js +0 -1
  526. package/dist/create-BfNc2C7N.js +0 -1
  527. package/dist/create-C7JlIlIh.mjs +0 -95
  528. package/dist/custom-BwN9-6Mb.js +0 -1
  529. package/dist/custom-INNwaWla.mjs +0 -13
  530. package/dist/dist-BCVg7FKM.js +0 -1
  531. package/dist/dist-DIhK9VWh.mjs +0 -3045
  532. package/dist/edit-BiI2VG60.js +0 -35
  533. package/dist/edit-DD3iFBEh.mjs +0 -1097
  534. package/dist/exceptions-DICMaDcH.mjs +0 -462
  535. package/dist/exceptions-DpWqMNuG.js +0 -1
  536. package/dist/google-Bcc4XZnV.mjs +0 -4
  537. package/dist/google-DTSRmJ51.js +0 -1
  538. package/dist/googleAnalytics-BSaqRR_L.js +0 -1
  539. package/dist/googleAnalytics-Cg-iWblZ.mjs +0 -47
  540. package/dist/interpolation-B8OzkMyi.mjs +0 -131
  541. package/dist/interpolation-DpAqtGOW.js +0 -1
  542. package/dist/lib-4wSi00Vr.js +0 -1
  543. package/dist/lib-BZgXUui5.mjs +0 -198
  544. package/dist/line-DJdnFNI7.js +0 -75
  545. package/dist/line-tYLnEDGV.mjs +0 -1500
  546. package/dist/mailTemplates-BNk8fhVS.mjs +0 -23
  547. package/dist/mailTemplates-DswHzyQe.js +0 -1
  548. package/dist/orders-CIc0JlKX.mjs +0 -512
  549. package/dist/orders-DwPSi_pD.js +0 -1
  550. package/dist/payment-BsNWFaDm.js +0 -1
  551. package/dist/payment-Ced5_dpa.mjs +0 -718
  552. package/dist/productCollections-Cuvw_8zC.js +0 -1
  553. package/dist/productCollections-D0AxRlzr.mjs +0 -23
  554. package/dist/products-DUD-ZMkR.mjs +0 -22
  555. package/dist/products-DvX9B-Ul.js +0 -1
  556. package/dist/promoCodes-BCWqN6w4.mjs +0 -23
  557. package/dist/promoCodes-CEZ4LYot.js +0 -1
  558. package/dist/push-notifications-BGp4XWo9.js +0 -1
  559. package/dist/push-notifications-C7W7KuzR.mjs +0 -23
  560. package/dist/regular-BCFrS6lK.mjs +0 -908
  561. package/dist/regular-DBqPgT8C.js +0 -1
  562. package/dist/resources-DwsMmWgm.mjs +0 -669
  563. package/dist/resources-Dz81GkHe.js +0 -1
  564. package/dist/shippingOptions-C3NEJff1.mjs +0 -23
  565. package/dist/shippingOptions-Cy040ZW1.js +0 -1
  566. package/dist/single-container-BJmmqq65.mjs +0 -468
  567. package/dist/single-container-Xoo0Xzxv.js +0 -58
  568. package/dist/src/vue-shim.d.ts +0 -7
  569. package/dist/table-DWw0fs3S.js +0 -1
  570. package/dist/table-LXt5DQOL.mjs +0 -23
  571. package/dist/utils-CVIHqQsU.js +0 -3
  572. package/dist/utils-h3owcMtS.mjs +0 -37
  573. package/dist/vee-validate-zod-BmXMJo8W.js +0 -1
  574. package/dist/vee-validate-zod-D9dZzbWZ.mjs +0 -4985
  575. package/dist/xy-container-CuQSwrtB.mjs +0 -3180
  576. package/dist/xy-container-_6YpscZh.js +0 -158
@@ -1,4985 +0,0 @@
1
- import { computed as e, defineComponent as t, getCurrentInstance as n, h as r, inject as i, isRef as a, nextTick as o, onBeforeUnmount as s, onMounted as c, onUnmounted as l, provide as u, reactive as d, readonly as f, ref as p, resolveDynamicComponent as m, shallowRef as ee, toRef as h, toValue as g, unref as _, warn as te, watch as v, watchEffect as y } from "vue";
2
- //#region ../node_modules/.pnpm/vee-validate@4.15.0_vue@3.5.34_typescript@6.0.3_/node_modules/vee-validate/dist/vee-validate.mjs
3
- function b(e) {
4
- return typeof e == "function";
5
- }
6
- function x(e) {
7
- return e == null;
8
- }
9
- var S = (e) => e !== null && !!e && typeof e == "object" && !Array.isArray(e);
10
- function C(e) {
11
- return Number(e) >= 0;
12
- }
13
- function w(e) {
14
- let t = parseFloat(e);
15
- return isNaN(t) ? e : t;
16
- }
17
- function T(e) {
18
- return typeof e == "object" && !!e;
19
- }
20
- function E(e) {
21
- return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
22
- }
23
- function ne(e) {
24
- if (!T(e) || E(e) !== "[object Object]") return !1;
25
- if (Object.getPrototypeOf(e) === null) return !0;
26
- let t = e;
27
- for (; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
28
- return Object.getPrototypeOf(e) === t;
29
- }
30
- function re(e, t) {
31
- return Object.keys(t).forEach((n) => {
32
- if (ne(t[n]) && ne(e[n])) {
33
- e[n] || (e[n] = {}), re(e[n], t[n]);
34
- return;
35
- }
36
- e[n] = t[n];
37
- }), e;
38
- }
39
- function ie(e) {
40
- let t = e.split(".");
41
- if (!t.length) return "";
42
- let n = String(t[0]);
43
- for (let e = 1; e < t.length; e++) {
44
- if (C(t[e])) {
45
- n += `[${t[e]}]`;
46
- continue;
47
- }
48
- n += `.${t[e]}`;
49
- }
50
- return n;
51
- }
52
- var D = {};
53
- function ae(e) {
54
- return D[e];
55
- }
56
- function O(e, t, n) {
57
- typeof n.value == "object" && (n.value = k(n.value)), !n.enumerable || n.get || n.set || !n.configurable || !n.writable || t === "__proto__" ? Object.defineProperty(e, t, n) : e[t] = n.value;
58
- }
59
- function k(e) {
60
- if (typeof e != "object") return e;
61
- var t = 0, n, r, i, a = Object.prototype.toString.call(e);
62
- if (a === "[object Object]" ? i = Object.create(e.__proto__ || null) : a === "[object Array]" ? i = Array(e.length) : a === "[object Set]" ? (i = /* @__PURE__ */ new Set(), e.forEach(function(e) {
63
- i.add(k(e));
64
- })) : a === "[object Map]" ? (i = /* @__PURE__ */ new Map(), e.forEach(function(e, t) {
65
- i.set(k(t), k(e));
66
- })) : a === "[object Date]" ? i = /* @__PURE__ */ new Date(+e) : a === "[object RegExp]" ? i = new RegExp(e.source, e.flags) : a === "[object DataView]" ? i = new e.constructor(k(e.buffer)) : a === "[object ArrayBuffer]" ? i = e.slice(0) : a.slice(-6) === "Array]" && (i = new e.constructor(e)), i) {
67
- for (r = Object.getOwnPropertySymbols(e); t < r.length; t++) O(i, r[t], Object.getOwnPropertyDescriptor(e, r[t]));
68
- for (t = 0, r = Object.getOwnPropertyNames(e); t < r.length; t++) Object.hasOwnProperty.call(i, n = r[t]) && i[n] === e[n] || O(i, n, Object.getOwnPropertyDescriptor(e, n));
69
- }
70
- return i || e;
71
- }
72
- var oe = Symbol("vee-validate-form"), se = Symbol("vee-validate-form-context"), ce = Symbol("vee-validate-field-instance"), le = Symbol("Default empty value"), A = typeof window < "u";
73
- function ue(e) {
74
- return b(e) && !!e.__locatorRef;
75
- }
76
- function de(e) {
77
- return !!e && b(e.parse) && e.__type === "VVTypedSchema";
78
- }
79
- function fe(e) {
80
- return !!e && b(e.validate);
81
- }
82
- function pe(e) {
83
- return e === "checkbox" || e === "radio";
84
- }
85
- function me(e) {
86
- return S(e) || Array.isArray(e);
87
- }
88
- function he(e) {
89
- return Array.isArray(e) ? e.length === 0 : S(e) && Object.keys(e).length === 0;
90
- }
91
- function j(e) {
92
- return /^\[.+\]$/i.test(e);
93
- }
94
- function ge(e) {
95
- return _e(e) && e.multiple;
96
- }
97
- function _e(e) {
98
- return e.tagName === "SELECT";
99
- }
100
- function ve(e, t) {
101
- let n = ![
102
- !1,
103
- null,
104
- void 0,
105
- 0
106
- ].includes(t.multiple) && !Number.isNaN(t.multiple);
107
- return e === "select" && "multiple" in t && n;
108
- }
109
- function ye(e, t) {
110
- return !ve(e, t) && t.type !== "file" && !pe(t.type);
111
- }
112
- function be(e) {
113
- return M(e) && e.target && "submit" in e.target;
114
- }
115
- function M(e) {
116
- return e ? !!(typeof Event < "u" && b(Event) && e instanceof Event || e && e.srcElement) : !1;
117
- }
118
- function N(e, t) {
119
- return t in e && e[t] !== le;
120
- }
121
- function P(e, t) {
122
- if (e === t) return !0;
123
- if (e && t && typeof e == "object" && typeof t == "object") {
124
- if (e.constructor !== t.constructor) return !1;
125
- var n, r, i;
126
- if (Array.isArray(e)) {
127
- if (n = e.length, n != t.length) return !1;
128
- for (r = n; r-- !== 0;) if (!P(e[r], t[r])) return !1;
129
- return !0;
130
- }
131
- if (e instanceof Map && t instanceof Map) {
132
- if (e.size !== t.size) return !1;
133
- for (r of e.entries()) if (!t.has(r[0])) return !1;
134
- for (r of e.entries()) if (!P(r[1], t.get(r[0]))) return !1;
135
- return !0;
136
- }
137
- if (xe(e) && xe(t)) return !(e.size !== t.size || e.name !== t.name || e.lastModified !== t.lastModified || e.type !== t.type);
138
- if (e instanceof Set && t instanceof Set) {
139
- if (e.size !== t.size) return !1;
140
- for (r of e.entries()) if (!t.has(r[0])) return !1;
141
- return !0;
142
- }
143
- if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
144
- if (n = e.length, n != t.length) return !1;
145
- for (r = n; r-- !== 0;) if (e[r] !== t[r]) return !1;
146
- return !0;
147
- }
148
- if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
149
- if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
150
- if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
151
- if (i = Object.keys(e), n = i.length - F(e, i), n !== Object.keys(t).length - F(t, Object.keys(t))) return !1;
152
- for (r = n; r-- !== 0;) if (!Object.prototype.hasOwnProperty.call(t, i[r])) return !1;
153
- for (r = n; r-- !== 0;) {
154
- var a = i[r];
155
- if (!P(e[a], t[a])) return !1;
156
- }
157
- return !0;
158
- }
159
- return e !== e && t !== t;
160
- }
161
- function F(e, t) {
162
- let n = 0;
163
- for (let r = t.length; r-- !== 0;) e[t[r]] === void 0 && n++;
164
- return n;
165
- }
166
- function xe(e) {
167
- return A ? e instanceof File : !1;
168
- }
169
- function Se(e) {
170
- return j(e) ? e.replace(/\[|\]/gi, "") : e;
171
- }
172
- function I(e, t, n) {
173
- return e ? j(t) ? e[Se(t)] : (t || "").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((e, t) => me(e) && t in e ? e[t] : n, e) : n;
174
- }
175
- function L(e, t, n) {
176
- if (j(t)) {
177
- e[Se(t)] = n;
178
- return;
179
- }
180
- let r = t.split(/\.|\[(\d+)\]/).filter(Boolean), i = e;
181
- for (let e = 0; e < r.length; e++) {
182
- if (e === r.length - 1) {
183
- i[r[e]] = n;
184
- return;
185
- }
186
- (!(r[e] in i) || x(i[r[e]])) && (i[r[e]] = C(r[e + 1]) ? [] : {}), i = i[r[e]];
187
- }
188
- }
189
- function Ce(e, t) {
190
- if (Array.isArray(e) && C(t)) {
191
- e.splice(Number(t), 1);
192
- return;
193
- }
194
- S(e) && delete e[t];
195
- }
196
- function we(e, t) {
197
- if (j(t)) {
198
- delete e[Se(t)];
199
- return;
200
- }
201
- let n = t.split(/\.|\[(\d+)\]/).filter(Boolean), r = e;
202
- for (let e = 0; e < n.length; e++) {
203
- if (e === n.length - 1) {
204
- Ce(r, n[e]);
205
- break;
206
- }
207
- if (!(n[e] in r) || x(r[n[e]])) break;
208
- r = r[n[e]];
209
- }
210
- let i = n.map((t, r) => I(e, n.slice(0, r).join(".")));
211
- for (let t = i.length - 1; t >= 0; t--) if (he(i[t])) {
212
- if (t === 0) {
213
- Ce(e, n[0]);
214
- continue;
215
- }
216
- Ce(i[t - 1], n[t - 1]);
217
- }
218
- }
219
- function R(e) {
220
- return Object.keys(e);
221
- }
222
- function Te(e, t = void 0) {
223
- return n()?.provides[e] || i(e, t);
224
- }
225
- function Ee(e) {
226
- te(`[vee-validate]: ${e}`);
227
- }
228
- function De(e, t, n) {
229
- if (Array.isArray(e)) {
230
- let n = [...e], r = n.findIndex((e) => P(e, t));
231
- return r >= 0 ? n.splice(r, 1) : n.push(t), n;
232
- }
233
- return P(e, t) ? n : t;
234
- }
235
- function Oe(e, t) {
236
- let n, r;
237
- return function(...i) {
238
- let a = this;
239
- return n || (n = !0, setTimeout(() => n = !1, t), r = e.apply(a, i)), r;
240
- };
241
- }
242
- function ke(e, t = 0) {
243
- let n = null, r = [];
244
- return function(...i) {
245
- return n && clearTimeout(n), n = setTimeout(() => {
246
- let t = e(...i);
247
- r.forEach((e) => e(t)), r = [];
248
- }, t), new Promise((e) => r.push(e));
249
- };
250
- }
251
- function z(e, t) {
252
- return S(t) && t.number ? w(e) : e;
253
- }
254
- function Ae(e, t) {
255
- let n;
256
- return async function(...r) {
257
- let i = e(...r);
258
- n = i;
259
- let a = await i;
260
- return i === n ? (n = void 0, t(a, r)) : a;
261
- };
262
- }
263
- function je({ get: e, set: t }) {
264
- let n = p(k(e()));
265
- return v(e, (e) => {
266
- P(e, n.value) || (n.value = k(e));
267
- }, { deep: !0 }), v(n, (n) => {
268
- P(n, e()) || t(k(n));
269
- }, { deep: !0 }), n;
270
- }
271
- function Me(e) {
272
- return Array.isArray(e) ? e : e ? [e] : [];
273
- }
274
- function Ne(e, t) {
275
- let n = {};
276
- for (let r in e) t.includes(r) || (n[r] = e[r]);
277
- return n;
278
- }
279
- function Pe(e) {
280
- let t = null, n = [];
281
- return function(...r) {
282
- let i = o(() => {
283
- if (t !== i) return;
284
- let a = e(...r);
285
- n.forEach((e) => e(a)), n = [], t = null;
286
- });
287
- return t = i, new Promise((e) => n.push(e));
288
- };
289
- }
290
- function Fe(e, t, n) {
291
- return t.slots.default ? typeof e == "string" || !e ? t.slots.default(n()) : { default: () => {
292
- var e;
293
- return (e = t.slots).default?.call(e, n());
294
- } } : t.slots.default;
295
- }
296
- function Ie(e) {
297
- if (Le(e)) return e._value;
298
- }
299
- function Le(e) {
300
- return "_value" in e;
301
- }
302
- function Re(e) {
303
- return e.type === "number" || e.type === "range" ? Number.isNaN(e.valueAsNumber) ? e.value : e.valueAsNumber : e.value;
304
- }
305
- function ze(e) {
306
- if (!M(e)) return e;
307
- let t = e.target;
308
- if (pe(t.type) && Le(t)) return Ie(t);
309
- if (t.type === "file" && t.files) {
310
- let e = Array.from(t.files);
311
- return t.multiple ? e : e[0];
312
- }
313
- if (ge(t)) return Array.from(t.options).filter((e) => e.selected && !e.disabled).map(Ie);
314
- if (_e(t)) {
315
- let e = Array.from(t.options).find((e) => e.selected);
316
- return e ? Ie(e) : t.value;
317
- }
318
- return Re(t);
319
- }
320
- function Be(e) {
321
- let t = {};
322
- return Object.defineProperty(t, "_$$isNormalized", {
323
- value: !0,
324
- writable: !1,
325
- enumerable: !1,
326
- configurable: !1
327
- }), e ? S(e) && e._$$isNormalized ? e : S(e) ? Object.keys(e).reduce((t, n) => {
328
- let r = Ve(e[n]);
329
- return e[n] !== !1 && (t[n] = He(r)), t;
330
- }, t) :
331
- /* istanbul ignore if */
332
- typeof e == "string" ? e.split("|").reduce((e, t) => {
333
- let n = Ue(t);
334
- return n.name && (e[n.name] = He(n.params)), e;
335
- }, t) : t : t;
336
- }
337
- function Ve(e) {
338
- return e === !0 ? [] : Array.isArray(e) || S(e) ? e : [e];
339
- }
340
- function He(e) {
341
- let t = (e) => typeof e == "string" && e[0] === "@" ? We(e.slice(1)) : e;
342
- return Array.isArray(e) ? e.map(t) : e instanceof RegExp ? [e] : Object.keys(e).reduce((n, r) => (n[r] = t(e[r]), n), {});
343
- }
344
- var Ue = (e) => {
345
- let t = [], n = e.split(":")[0];
346
- return e.includes(":") && (t = e.split(":").slice(1).join(":").split(",")), {
347
- name: n,
348
- params: t
349
- };
350
- };
351
- function We(e) {
352
- let t = (t) => I(t, e) ?? t[e];
353
- return t.__locatorRef = e, t;
354
- }
355
- function Ge(e) {
356
- return Array.isArray(e) ? e.filter(ue) : R(e).filter((t) => ue(e[t])).map((t) => e[t]);
357
- }
358
- var Ke = Object.assign({}, {
359
- generateMessage: ({ field: e }) => `${e} is not valid.`,
360
- bails: !0,
361
- validateOnBlur: !0,
362
- validateOnChange: !0,
363
- validateOnInput: !1,
364
- validateOnModelUpdate: !0
365
- }), qe = () => Ke;
366
- async function Je(e, t, n = {}) {
367
- let r = n?.bails, i = await Ye({
368
- name: n?.name || "{field}",
369
- rules: t,
370
- label: n?.label,
371
- bails: r ?? !0,
372
- formData: n?.values || {}
373
- }, e);
374
- return Object.assign(Object.assign({}, i), { valid: !i.errors.length });
375
- }
376
- async function Ye(e, t) {
377
- let n = e.rules;
378
- if (de(n) || fe(n)) return Qe(t, Object.assign(Object.assign({}, e), { rules: n }));
379
- if (b(n) || Array.isArray(n)) {
380
- let r = {
381
- field: e.label || e.name,
382
- name: e.name,
383
- label: e.label,
384
- form: e.formData,
385
- value: t
386
- }, i = Array.isArray(n) ? n : [n], a = i.length, o = [];
387
- for (let n = 0; n < a; n++) {
388
- let a = i[n], s = await a(t, r);
389
- if (!(typeof s != "string" && !Array.isArray(s) && s)) {
390
- if (Array.isArray(s)) o.push(...s);
391
- else {
392
- let e = typeof s == "string" ? s : et(r);
393
- o.push(e);
394
- }
395
- if (e.bails) return { errors: o };
396
- }
397
- }
398
- return { errors: o };
399
- }
400
- let r = Object.assign(Object.assign({}, e), { rules: Be(n) }), i = [], a = Object.keys(r.rules), o = a.length;
401
- for (let n = 0; n < o; n++) {
402
- let o = a[n], s = await $e(r, t, {
403
- name: o,
404
- params: r.rules[o]
405
- });
406
- if (s.error && (i.push(s.error), e.bails)) return { errors: i };
407
- }
408
- return { errors: i };
409
- }
410
- function Xe(e) {
411
- return !!e && e.name === "ValidationError";
412
- }
413
- function Ze(e) {
414
- return {
415
- __type: "VVTypedSchema",
416
- async parse(t, n) {
417
- try {
418
- return {
419
- output: await e.validate(t, {
420
- abortEarly: !1,
421
- context: n?.formData || {}
422
- }),
423
- errors: []
424
- };
425
- } catch (e) {
426
- if (!Xe(e)) throw e;
427
- if (!e.inner?.length && e.errors.length) return { errors: [{
428
- path: e.path,
429
- errors: e.errors
430
- }] };
431
- let t = e.inner.reduce((e, t) => {
432
- let n = t.path || "";
433
- return e[n] || (e[n] = {
434
- errors: [],
435
- path: n
436
- }), e[n].errors.push(...t.errors), e;
437
- }, {});
438
- return { errors: Object.values(t) };
439
- }
440
- }
441
- };
442
- }
443
- async function Qe(e, t) {
444
- let n = await (de(t.rules) ? t.rules : Ze(t.rules)).parse(e, { formData: t.formData }), r = [];
445
- for (let e of n.errors) e.errors.length && r.push(...e.errors);
446
- return {
447
- value: n.value,
448
- errors: r
449
- };
450
- }
451
- async function $e(e, t, n) {
452
- let r = ae(n.name);
453
- if (!r) throw Error(`No such validator '${n.name}' exists.`);
454
- let i = tt(n.params, e.formData), a = {
455
- field: e.label || e.name,
456
- name: e.name,
457
- label: e.label,
458
- value: t,
459
- form: e.formData,
460
- rule: Object.assign(Object.assign({}, n), { params: i })
461
- }, o = await r(t, i, a);
462
- return typeof o == "string" ? { error: o } : { error: o ? void 0 : et(a) };
463
- }
464
- function et(e) {
465
- let t = qe().generateMessage;
466
- return t ? t(e) : "Field is invalid";
467
- }
468
- function tt(e, t) {
469
- let n = (e) => ue(e) ? e(t) : e;
470
- return Array.isArray(e) ? e.map(n) : Object.keys(e).reduce((t, r) => (t[r] = n(e[r]), t), {});
471
- }
472
- async function nt(e, t) {
473
- let n = await (de(e) ? e : Ze(e)).parse(k(t), { formData: k(t) }), r = {}, i = {};
474
- for (let e of n.errors) {
475
- let t = e.errors, n = (e.path || "").replace(/\["(\d+)"\]/g, (e, t) => `[${t}]`);
476
- r[n] = {
477
- valid: !t.length,
478
- errors: t
479
- }, t.length && (i[n] = t[0]);
480
- }
481
- return {
482
- valid: !n.errors.length,
483
- results: r,
484
- errors: i,
485
- values: n.value,
486
- source: "schema"
487
- };
488
- }
489
- async function rt(e, t, n) {
490
- let r = R(e).map(async (r) => {
491
- let i = n?.names?.[r], a = await Je(I(t, r), e[r], {
492
- name: i?.name || r,
493
- label: i?.label,
494
- values: t,
495
- bails: n?.bailsMap?.[r] ?? !0
496
- });
497
- return Object.assign(Object.assign({}, a), { path: r });
498
- }), i = !0, a = await Promise.all(r), o = {}, s = {};
499
- for (let e of a) o[e.path] = {
500
- valid: e.valid,
501
- errors: e.errors
502
- }, e.valid || (i = !1, s[e.path] = e.errors[0]);
503
- return {
504
- valid: i,
505
- results: o,
506
- errors: s,
507
- source: "schema"
508
- };
509
- }
510
- var it = 0;
511
- function at(t, n) {
512
- let { value: r, initialValue: i, setInitialValue: a } = ot(t, n.modelValue, n.form);
513
- if (!n.form) {
514
- let { errors: e, setErrors: o } = lt(), s = it >= 2 ** 53 - 1 ? 0 : ++it, c = ct(r, i, e, n.schema);
515
- function l(e) {
516
- "value" in e && (r.value = e.value), "errors" in e && o(e.errors), "touched" in e && (c.touched = e.touched ?? c.touched), "initialValue" in e && a(e.initialValue);
517
- }
518
- return {
519
- id: s,
520
- path: t,
521
- value: r,
522
- initialValue: i,
523
- meta: c,
524
- flags: {
525
- pendingUnmount: { [s]: !1 },
526
- pendingReset: !1
527
- },
528
- errors: e,
529
- setState: l
530
- };
531
- }
532
- let o = n.form.createPathState(t, {
533
- bails: n.bails,
534
- label: n.label,
535
- type: n.type,
536
- validate: n.validate,
537
- schema: n.schema
538
- }), s = e(() => o.errors);
539
- function c(e) {
540
- var i, o;
541
- "value" in e && (r.value = e.value), "errors" in e && ((i = n.form) == null || i.setFieldError(_(t), e.errors)), "touched" in e && ((o = n.form) == null || o.setFieldTouched(_(t), e.touched ?? !1)), "initialValue" in e && a(e.initialValue);
542
- }
543
- return {
544
- id: Array.isArray(o.id) ? o.id[o.id.length - 1] : o.id,
545
- path: t,
546
- value: r,
547
- errors: s,
548
- meta: o,
549
- initialValue: i,
550
- flags: o.__flags,
551
- setState: c
552
- };
553
- }
554
- function ot(t, n, r) {
555
- let i = p(_(n));
556
- function a() {
557
- return r ? I(r.initialValues.value, _(t), _(i)) : _(i);
558
- }
559
- function o(e) {
560
- if (!r) {
561
- i.value = e;
562
- return;
563
- }
564
- r.setFieldInitialValue(_(t), e, !0);
565
- }
566
- let s = e(a);
567
- if (!r) return {
568
- value: p(a()),
569
- initialValue: s,
570
- setInitialValue: o
571
- };
572
- let c = st(n, r, s, t);
573
- return r.stageInitialValue(_(t), c, !0), {
574
- value: e({
575
- get() {
576
- return I(r.values, _(t));
577
- },
578
- set(e) {
579
- r.setFieldValue(_(t), e, !1);
580
- }
581
- }),
582
- initialValue: s,
583
- setInitialValue: o
584
- };
585
- }
586
- function st(e, t, n, r) {
587
- return a(e) ? _(e) : e === void 0 ? I(t.values, _(r), _(n)) : e;
588
- }
589
- function ct(t, n, r, i) {
590
- let a = d({
591
- touched: !1,
592
- pending: !1,
593
- valid: !0,
594
- required: e(() => {
595
- var e;
596
- return ((e = g(i))?.describe)?.call(e).required ?? !1;
597
- }),
598
- validated: !!_(r).length,
599
- initialValue: e(() => _(n)),
600
- dirty: e(() => !P(_(t), _(n)))
601
- });
602
- return v(r, (e) => {
603
- a.valid = !e.length;
604
- }, {
605
- immediate: !0,
606
- flush: "sync"
607
- }), a;
608
- }
609
- function lt() {
610
- let e = p([]);
611
- return {
612
- errors: e,
613
- setErrors: (t) => {
614
- e.value = Me(t);
615
- }
616
- };
617
- }
618
- var ut = {}, dt = {}, ft = "vee-validate-inspector", B = {
619
- error: 12405579,
620
- success: 448379,
621
- unknown: 5522283,
622
- white: 16777215,
623
- black: 0,
624
- blue: 218007,
625
- purple: 12157168,
626
- orange: 16099682,
627
- gray: 12304330
628
- }, V = null, pt;
629
- async function mt(e) {
630
- if (process.env.NODE_ENV !== "production") {
631
- if (!A) return;
632
- (await import("./dist-DIhK9VWh.mjs")).setupDevtoolsPlugin({
633
- id: "vee-validate-devtools-plugin",
634
- label: "VeeValidate Plugin",
635
- packageName: "vee-validate",
636
- homepage: "https://vee-validate.logaretm.com/v4",
637
- app: e,
638
- logo: "https://vee-validate.logaretm.com/v4/logo.png"
639
- }, (e) => {
640
- pt = e, e.addInspector({
641
- id: ft,
642
- icon: "rule",
643
- label: "vee-validate",
644
- noSelectionText: "Select a vee-validate node to inspect",
645
- actions: [{
646
- icon: "done_outline",
647
- tooltip: "Validate selected item",
648
- action: async () => {
649
- if (!V) {
650
- console.error("There is not a valid selected vee-validate node or component");
651
- return;
652
- }
653
- if (V.type === "field") {
654
- await V.field.validate();
655
- return;
656
- }
657
- if (V.type === "form") {
658
- await V.form.validate();
659
- return;
660
- }
661
- V.type === "pathState" && await V.form.validateField(V.state.path);
662
- }
663
- }, {
664
- icon: "delete_sweep",
665
- tooltip: "Clear validation state of the selected item",
666
- action: () => {
667
- if (!V) {
668
- console.error("There is not a valid selected vee-validate node or component");
669
- return;
670
- }
671
- if (V.type === "field") {
672
- V.field.resetField();
673
- return;
674
- }
675
- V.type === "form" && V.form.resetForm(), V.type === "pathState" && V.form.resetField(V.state.path);
676
- }
677
- }]
678
- }), e.on.getInspectorTree((e) => {
679
- if (e.inspectorId !== ft) return;
680
- let t = Object.values(ut), n = Object.values(dt);
681
- e.rootNodes = [...t.map(vt), ...n.map((e) => bt(e))];
682
- }), e.on.getInspectorState((t) => {
683
- if (t.inspectorId !== ft) return;
684
- let { form: n, field: r, state: i, type: a } = Ct(t.nodeId);
685
- if (e.unhighlightElement(), n && a === "form") {
686
- t.state = Tt(n), V = {
687
- type: "form",
688
- form: n
689
- }, e.highlightElement(n._vm);
690
- return;
691
- }
692
- if (i && a === "pathState" && n) {
693
- t.state = wt(i), V = {
694
- type: "pathState",
695
- state: i,
696
- form: n
697
- };
698
- return;
699
- }
700
- if (r && a === "field") {
701
- t.state = wt({
702
- errors: r.errors.value,
703
- dirty: r.meta.dirty,
704
- valid: r.meta.valid,
705
- touched: r.meta.touched,
706
- value: r.value.value,
707
- initialValue: r.meta.initialValue
708
- }), V = {
709
- field: r,
710
- type: "field"
711
- }, e.highlightElement(r._vm);
712
- return;
713
- }
714
- V = null, e.unhighlightElement();
715
- });
716
- });
717
- }
718
- }
719
- var ht = Oe(() => {
720
- setTimeout(async () => {
721
- await o(), pt?.sendInspectorState(ft), pt?.sendInspectorTree(ft);
722
- }, 100);
723
- }, 100);
724
- function gt(e) {
725
- let t = n();
726
- if (!pt) {
727
- let e = t?.appContext.app;
728
- if (!e) return;
729
- mt(e);
730
- }
731
- ut[e.formId] = Object.assign({}, e), ut[e.formId]._vm = t, l(() => {
732
- delete ut[e.formId], ht();
733
- }), ht();
734
- }
735
- function _t(e) {
736
- let t = n();
737
- if (!pt) {
738
- let e = t?.appContext.app;
739
- if (!e) return;
740
- mt(e);
741
- }
742
- dt[e.id] = Object.assign({}, e), dt[e.id]._vm = t, l(() => {
743
- delete dt[e.id], ht();
744
- }), ht();
745
- }
746
- function vt(e) {
747
- let { textColor: t, bgColor: n } = Et(e.meta.value.valid), r = {};
748
- Object.values(e.getAllPathStates()).forEach((t) => {
749
- L(r, g(t.path), yt(t, e));
750
- });
751
- function i(e, t = []) {
752
- let n = [...t].pop();
753
- return "id" in e ? Object.assign(Object.assign({}, e), { label: n || e.label }) : S(e) ? {
754
- id: `${t.join(".")}`,
755
- label: n || "",
756
- children: Object.keys(e).map((n) => i(e[n], [...t, n]))
757
- } : Array.isArray(e) ? {
758
- id: `${t.join(".")}`,
759
- label: `${n}[]`,
760
- children: e.map((e, n) => i(e, [...t, String(n)]))
761
- } : {
762
- id: "",
763
- label: "",
764
- children: []
765
- };
766
- }
767
- let { children: a } = i(r);
768
- return {
769
- id: St(e),
770
- label: e.name,
771
- children: a,
772
- tags: [{
773
- label: "Form",
774
- textColor: t,
775
- backgroundColor: n
776
- }, {
777
- label: `${e.getAllPathStates().length} fields`,
778
- textColor: B.white,
779
- backgroundColor: B.unknown
780
- }]
781
- };
782
- }
783
- function yt(e, t) {
784
- return {
785
- id: St(t, e),
786
- label: g(e.path),
787
- tags: xt(e.multiple, e.fieldsCount, e.type, e.valid, t)
788
- };
789
- }
790
- function bt(e, t) {
791
- return {
792
- id: St(t, e),
793
- label: _(e.name),
794
- tags: xt(!1, 1, e.type, e.meta.valid, t)
795
- };
796
- }
797
- function xt(e, t, n, r, i) {
798
- let { textColor: a, bgColor: o } = Et(r);
799
- return [
800
- e ? void 0 : {
801
- label: "Field",
802
- textColor: a,
803
- backgroundColor: o
804
- },
805
- i ? void 0 : {
806
- label: "Standalone",
807
- textColor: B.black,
808
- backgroundColor: B.gray
809
- },
810
- n === "checkbox" ? {
811
- label: "Checkbox",
812
- textColor: B.white,
813
- backgroundColor: B.blue
814
- } : void 0,
815
- n === "radio" ? {
816
- label: "Radio",
817
- textColor: B.white,
818
- backgroundColor: B.purple
819
- } : void 0,
820
- e ? {
821
- label: "Multiple",
822
- textColor: B.black,
823
- backgroundColor: B.orange
824
- } : void 0
825
- ].filter(Boolean);
826
- }
827
- function St(e, t) {
828
- let n = t ? "path" in t ? "pathState" : "field" : "form", r = t ? "path" in t ? t?.path : g(t?.name) : "", i = {
829
- f: e?.formId,
830
- ff: t?.id || r,
831
- type: n
832
- };
833
- return btoa(encodeURIComponent(JSON.stringify(i)));
834
- }
835
- function Ct(e) {
836
- try {
837
- let t = JSON.parse(decodeURIComponent(atob(e))), n = ut[t.f];
838
- if (!n && t.ff) {
839
- let e = dt[t.ff];
840
- return e ? {
841
- type: t.type,
842
- field: e
843
- } : {};
844
- }
845
- if (!n) return {};
846
- let r = n.getPathState(t.ff);
847
- return {
848
- type: t.type,
849
- form: n,
850
- state: r
851
- };
852
- } catch {}
853
- return {};
854
- }
855
- function wt(e) {
856
- return { "Field state": [
857
- {
858
- key: "errors",
859
- value: e.errors
860
- },
861
- {
862
- key: "initialValue",
863
- value: e.initialValue
864
- },
865
- {
866
- key: "currentValue",
867
- value: e.value
868
- },
869
- {
870
- key: "touched",
871
- value: e.touched
872
- },
873
- {
874
- key: "dirty",
875
- value: e.dirty
876
- },
877
- {
878
- key: "valid",
879
- value: e.valid
880
- }
881
- ] };
882
- }
883
- function Tt(e) {
884
- let { errorBag: t, meta: n, values: r, isSubmitting: i, isValidating: a, submitCount: o } = e;
885
- return { "Form state": [
886
- {
887
- key: "submitCount",
888
- value: o.value
889
- },
890
- {
891
- key: "isSubmitting",
892
- value: i.value
893
- },
894
- {
895
- key: "isValidating",
896
- value: a.value
897
- },
898
- {
899
- key: "touched",
900
- value: n.value.touched
901
- },
902
- {
903
- key: "dirty",
904
- value: n.value.dirty
905
- },
906
- {
907
- key: "valid",
908
- value: n.value.valid
909
- },
910
- {
911
- key: "initialValues",
912
- value: n.value.initialValues
913
- },
914
- {
915
- key: "currentValues",
916
- value: r
917
- },
918
- {
919
- key: "errors",
920
- value: R(t.value).reduce((e, n) => {
921
- let r = t.value[n]?.[0];
922
- return r && (e[n] = r), e;
923
- }, {})
924
- }
925
- ] };
926
- }
927
- function Et(e) {
928
- return {
929
- bgColor: e ? B.success : B.error,
930
- textColor: e ? B.black : B.white
931
- };
932
- }
933
- function Dt(e, t, n) {
934
- return pe(n?.type) ? At(e, t, n) : Ot(e, t, n);
935
- }
936
- function Ot(t, r, i) {
937
- let { initialValue: o, validateOnMount: l, bails: d, type: f, checkedValue: p, label: m, validateOnValueUpdate: ee, uncheckedValue: h, controlled: te, keepValueOnUnmount: y, syncVModel: x, form: S } = kt(i), C = te ? Te(oe) : void 0, w = S || C, T = e(() => ie(g(t))), E = e(() => {
938
- if (g(w?.schema)) return;
939
- let e = _(r);
940
- return fe(e) || de(e) || b(e) || Array.isArray(e) ? e : Be(e);
941
- }), ne = !b(E.value) && de(g(r)), { id: re, value: D, initialValue: ae, meta: O, setState: se, errors: le, flags: A } = at(T, {
942
- modelValue: o,
943
- form: w,
944
- bails: d,
945
- label: m,
946
- type: f,
947
- validate: E.value ? ge : void 0,
948
- schema: ne ? r : void 0
949
- }), ue = e(() => le.value[0]);
950
- x && jt({
951
- value: D,
952
- prop: x,
953
- handleChange: _e,
954
- shouldValidate: () => ee && !A.pendingReset
955
- });
956
- let pe = (e, t = !1) => {
957
- O.touched = !0, t && he();
958
- };
959
- async function me(e) {
960
- if (w?.validateSchema) {
961
- let { results: t } = await w.validateSchema(e);
962
- return t[g(T)] ?? {
963
- valid: !0,
964
- errors: []
965
- };
966
- }
967
- return E.value ? Je(D.value, E.value, {
968
- name: g(T),
969
- label: g(m),
970
- values: w?.values ?? {},
971
- bails: d
972
- }) : {
973
- valid: !0,
974
- errors: []
975
- };
976
- }
977
- let he = Ae(async () => (O.pending = !0, O.validated = !0, me("validated-only")), (e) => A.pendingUnmount[F.id] ? e : (se({ errors: e.errors }), O.pending = !1, O.valid = e.valid, e)), j = Ae(async () => me("silent"), (e) => (O.valid = e.valid, e));
978
- function ge(e) {
979
- return e?.mode === "silent" ? j() : he();
980
- }
981
- function _e(e, t = !0) {
982
- M(ze(e), t);
983
- }
984
- c(() => {
985
- if (l) return he();
986
- (!w || !w.validateSchema) && j();
987
- });
988
- function ve(e) {
989
- O.touched = e;
990
- }
991
- function ye(e) {
992
- let t = e && "value" in e ? e.value : ae.value;
993
- se({
994
- value: k(t),
995
- initialValue: k(t),
996
- touched: e?.touched ?? !1,
997
- errors: e?.errors || []
998
- }), O.pending = !1, O.validated = !1, j();
999
- }
1000
- let be = n();
1001
- function M(e, t = !0) {
1002
- D.value = be && x ? z(e, be.props.modelModifiers) : e, (t ? he : j)();
1003
- }
1004
- function N(e) {
1005
- se({ errors: Array.isArray(e) ? e : [e] });
1006
- }
1007
- let F = {
1008
- id: re,
1009
- name: T,
1010
- label: m,
1011
- value: e({
1012
- get() {
1013
- return D.value;
1014
- },
1015
- set(e) {
1016
- M(e, ee);
1017
- }
1018
- }),
1019
- meta: O,
1020
- errors: le,
1021
- errorMessage: ue,
1022
- type: f,
1023
- checkedValue: p,
1024
- uncheckedValue: h,
1025
- bails: d,
1026
- keepValueOnUnmount: y,
1027
- resetField: ye,
1028
- handleReset: () => ye(),
1029
- validate: ge,
1030
- handleChange: _e,
1031
- handleBlur: pe,
1032
- setState: se,
1033
- setTouched: ve,
1034
- setErrors: N,
1035
- setValue: M
1036
- };
1037
- return u(ce, F), a(r) && typeof _(r) != "function" && v(r, (e, t) => {
1038
- P(e, t) || (O.validated ? he() : j());
1039
- }, { deep: !0 }), process.env.NODE_ENV !== "production" && (F._vm = n(), v(() => Object.assign(Object.assign({ errors: le.value }, O), { value: D.value }), ht, { deep: !0 }), w || _t(F)), w ? (v(e(() => {
1040
- let e = E.value;
1041
- return !e || b(e) || fe(e) || de(e) || Array.isArray(e) ? {} : Object.keys(e).reduce((t, n) => {
1042
- let r = Ge(e[n]).map((e) => e.__locatorRef).reduce((e, t) => {
1043
- let n = I(w.values, t) || w.values[t];
1044
- return n !== void 0 && (e[t] = n), e;
1045
- }, {});
1046
- return Object.assign(t, r), t;
1047
- }, {});
1048
- }), (e, t) => {
1049
- Object.keys(e).length && (P(e, t) || (O.validated ? he() : j()));
1050
- }), s(() => {
1051
- let e = g(F.keepValueOnUnmount) ?? g(w.keepValuesOnUnmount), t = g(T);
1052
- if (e || !w || A.pendingUnmount[F.id]) {
1053
- w?.removePathState(t, re);
1054
- return;
1055
- }
1056
- A.pendingUnmount[F.id] = !0;
1057
- let n = w.getPathState(t);
1058
- if (Array.isArray(n?.id) && n?.multiple ? n?.id.includes(F.id) : n?.id === F.id) {
1059
- if (n?.multiple && Array.isArray(n.value)) {
1060
- let e = n.value.findIndex((e) => P(e, g(F.checkedValue)));
1061
- if (e > -1) {
1062
- let r = [...n.value];
1063
- r.splice(e, 1), w.setFieldValue(t, r);
1064
- }
1065
- Array.isArray(n.id) && n.id.splice(n.id.indexOf(F.id), 1);
1066
- } else w.unsetPathValue(g(T));
1067
- w.removePathState(t, re);
1068
- }
1069
- }), F) : F;
1070
- }
1071
- function kt(e) {
1072
- let t = () => ({
1073
- initialValue: void 0,
1074
- validateOnMount: !1,
1075
- bails: !0,
1076
- label: void 0,
1077
- validateOnValueUpdate: !0,
1078
- keepValueOnUnmount: void 0,
1079
- syncVModel: !1,
1080
- controlled: !0
1081
- }), r = !!e?.syncVModel, i = typeof e?.syncVModel == "string" ? e.syncVModel : e?.modelPropName || "modelValue", a = r && !("initialValue" in (e || {})) ? Mt(n(), i) : e?.initialValue;
1082
- if (!e) return Object.assign(Object.assign({}, t()), { initialValue: a });
1083
- let o = "valueProp" in e ? e.valueProp : e.checkedValue, s = "standalone" in e ? !e.standalone : e.controlled, c = e?.modelPropName || e?.syncVModel || !1;
1084
- return Object.assign(Object.assign(Object.assign({}, t()), e || {}), {
1085
- initialValue: a,
1086
- controlled: s ?? !0,
1087
- checkedValue: o,
1088
- syncVModel: c
1089
- });
1090
- }
1091
- function At(t, n, r) {
1092
- let i = r?.standalone ? void 0 : Te(oe), a = r?.checkedValue, o = r?.uncheckedValue;
1093
- function s(n) {
1094
- let s = n.handleChange, c = e(() => {
1095
- let e = g(n.value), t = g(a);
1096
- return Array.isArray(e) ? e.findIndex((e) => P(e, t)) >= 0 : P(t, e);
1097
- });
1098
- function l(e, l = !0) {
1099
- if (c.value === e?.target?.checked) {
1100
- l && n.validate();
1101
- return;
1102
- }
1103
- let u = g(t), d = i?.getPathState(u), f = ze(e), p = g(a) ?? f;
1104
- i && d?.multiple && d.type === "checkbox" ? p = De(I(i.values, u) || [], p, void 0) : r?.type === "checkbox" && (p = De(g(n.value), p, g(o))), s(p, l);
1105
- }
1106
- return Object.assign(Object.assign({}, n), {
1107
- checked: c,
1108
- checkedValue: a,
1109
- uncheckedValue: o,
1110
- handleChange: l
1111
- });
1112
- }
1113
- return s(Ot(t, n, r));
1114
- }
1115
- function jt({ prop: e, value: t, handleChange: r, shouldValidate: i }) {
1116
- let a = n();
1117
- /* istanbul ignore next */
1118
- if (!a || !e) {
1119
- process.env.NODE_ENV !== "production" && console.warn("Failed to setup model events because `useField` was not called in setup.");
1120
- return;
1121
- }
1122
- let o = typeof e == "string" ? e : "modelValue", s = `update:${o}`;
1123
- o in a.props && (v(t, (e) => {
1124
- P(e, Mt(a, o)) || a.emit(s, e);
1125
- }), v(() => Mt(a, o), (e) => {
1126
- if (e === le && t.value === void 0) return;
1127
- let n = e === le ? void 0 : e;
1128
- P(n, t.value) || r(n, i());
1129
- }));
1130
- }
1131
- function Mt(e, t) {
1132
- if (e) return e.props[t];
1133
- }
1134
- t({
1135
- name: "Field",
1136
- inheritAttrs: !1,
1137
- props: {
1138
- as: {
1139
- type: [String, Object],
1140
- default: void 0
1141
- },
1142
- name: {
1143
- type: String,
1144
- required: !0
1145
- },
1146
- rules: {
1147
- type: [
1148
- Object,
1149
- String,
1150
- Function
1151
- ],
1152
- default: void 0
1153
- },
1154
- validateOnMount: {
1155
- type: Boolean,
1156
- default: !1
1157
- },
1158
- validateOnBlur: {
1159
- type: Boolean,
1160
- default: void 0
1161
- },
1162
- validateOnChange: {
1163
- type: Boolean,
1164
- default: void 0
1165
- },
1166
- validateOnInput: {
1167
- type: Boolean,
1168
- default: void 0
1169
- },
1170
- validateOnModelUpdate: {
1171
- type: Boolean,
1172
- default: void 0
1173
- },
1174
- bails: {
1175
- type: Boolean,
1176
- default: () => qe().bails
1177
- },
1178
- label: {
1179
- type: String,
1180
- default: void 0
1181
- },
1182
- uncheckedValue: {
1183
- type: null,
1184
- default: void 0
1185
- },
1186
- modelValue: {
1187
- type: null,
1188
- default: le
1189
- },
1190
- modelModifiers: {
1191
- type: null,
1192
- default: () => ({})
1193
- },
1194
- "onUpdate:modelValue": {
1195
- type: null,
1196
- default: void 0
1197
- },
1198
- standalone: {
1199
- type: Boolean,
1200
- default: !1
1201
- },
1202
- keepValue: {
1203
- type: Boolean,
1204
- default: void 0
1205
- }
1206
- },
1207
- setup(t, n) {
1208
- let i = h(t, "rules"), a = h(t, "name"), o = h(t, "label"), s = h(t, "uncheckedValue"), c = h(t, "keepValue"), { errors: l, value: u, errorMessage: d, validate: f, handleChange: p, handleBlur: ee, setTouched: g, resetField: _, handleReset: te, meta: v, checked: y, setErrors: x, setValue: S } = Dt(a, i, {
1209
- validateOnMount: t.validateOnMount,
1210
- bails: t.bails,
1211
- standalone: t.standalone,
1212
- type: n.attrs.type,
1213
- initialValue: Ft(t, n),
1214
- checkedValue: n.attrs.value,
1215
- uncheckedValue: s,
1216
- label: o,
1217
- validateOnValueUpdate: t.validateOnModelUpdate,
1218
- keepValueOnUnmount: c,
1219
- syncVModel: !0
1220
- }), C = function(e, t = !0) {
1221
- p(e, t);
1222
- }, w = e(() => {
1223
- let { validateOnInput: e, validateOnChange: r, validateOnBlur: i, validateOnModelUpdate: a } = Pt(t);
1224
- function o(e) {
1225
- ee(e, i), b(n.attrs.onBlur) && n.attrs.onBlur(e);
1226
- }
1227
- function s(t) {
1228
- C(t, e), b(n.attrs.onInput) && n.attrs.onInput(t);
1229
- }
1230
- function c(e) {
1231
- C(e, r), b(n.attrs.onChange) && n.attrs.onChange(e);
1232
- }
1233
- let l = {
1234
- name: t.name,
1235
- onBlur: o,
1236
- onInput: s,
1237
- onChange: c
1238
- };
1239
- return l["onUpdate:modelValue"] = (e) => C(e, a), l;
1240
- }), T = e(() => {
1241
- let e = Object.assign({}, w.value);
1242
- return pe(n.attrs.type) && y && (e.checked = y.value), ye(Nt(t, n), n.attrs) && (e.value = u.value), e;
1243
- }), E = e(() => Object.assign(Object.assign({}, w.value), { modelValue: u.value }));
1244
- function ne() {
1245
- return {
1246
- field: T.value,
1247
- componentField: E.value,
1248
- value: u.value,
1249
- meta: v,
1250
- errors: l.value,
1251
- errorMessage: d.value,
1252
- validate: f,
1253
- resetField: _,
1254
- handleChange: C,
1255
- handleInput: (e) => C(e, !1),
1256
- handleReset: te,
1257
- handleBlur: w.value.onBlur,
1258
- setTouched: g,
1259
- setErrors: x,
1260
- setValue: S
1261
- };
1262
- }
1263
- return n.expose({
1264
- value: u,
1265
- meta: v,
1266
- errors: l,
1267
- errorMessage: d,
1268
- setErrors: x,
1269
- setTouched: g,
1270
- setValue: S,
1271
- reset: _,
1272
- validate: f,
1273
- handleChange: p
1274
- }), () => {
1275
- let e = m(Nt(t, n)), i = Fe(e, n, ne);
1276
- return e ? r(e, Object.assign(Object.assign({}, n.attrs), T.value), i) : i;
1277
- };
1278
- }
1279
- });
1280
- function Nt(e, t) {
1281
- let n = e.as || "";
1282
- return !e.as && !t.slots.default && (n = "input"), n;
1283
- }
1284
- function Pt(e) {
1285
- let { validateOnInput: t, validateOnChange: n, validateOnBlur: r, validateOnModelUpdate: i } = qe();
1286
- return {
1287
- validateOnInput: e.validateOnInput ?? t,
1288
- validateOnChange: e.validateOnChange ?? n,
1289
- validateOnBlur: e.validateOnBlur ?? r,
1290
- validateOnModelUpdate: e.validateOnModelUpdate ?? i
1291
- };
1292
- }
1293
- function Ft(e, t) {
1294
- return pe(t.attrs.type) ? N(e, "modelValue") ? e.modelValue : void 0 : N(e, "modelValue") ? e.modelValue : t.attrs.value;
1295
- }
1296
- var It = 0, Lt = [
1297
- "bails",
1298
- "fieldsCount",
1299
- "id",
1300
- "multiple",
1301
- "type",
1302
- "validate"
1303
- ];
1304
- function Rt(e) {
1305
- let t = e?.initialValues || {}, n = Object.assign({}, g(t)), r = _(e?.validationSchema);
1306
- return r && de(r) && b(r.cast) ? k(r.cast(n) || {}) : k(n);
1307
- }
1308
- function zt(t) {
1309
- let n = It++, r = t?.name || "Form", i = 0, s = p(!1), l = p(!1), m = p(0), h = [], y = d(Rt(t)), x = p([]), S = p({}), C = p({}), w = Pe(() => {
1310
- C.value = x.value.reduce((e, t) => (e[ie(g(t.path))] = t, e), {});
1311
- });
1312
- function T(e, t) {
1313
- let n = N(e);
1314
- if (!n) {
1315
- typeof e == "string" && (S.value[ie(e)] = Me(t));
1316
- return;
1317
- }
1318
- if (typeof e == "string") {
1319
- let t = ie(e);
1320
- S.value[t] && delete S.value[t];
1321
- }
1322
- n.errors = Me(t), n.valid = !n.errors.length;
1323
- }
1324
- function E(e) {
1325
- R(e).forEach((t) => {
1326
- T(t, e[t]);
1327
- });
1328
- }
1329
- t?.initialErrors && E(t.initialErrors);
1330
- let ne = e(() => {
1331
- let e = x.value.reduce((e, t) => (t.errors.length && (e[g(t.path)] = t.errors), e), {});
1332
- return Object.assign(Object.assign({}, S.value), e);
1333
- }), D = e(() => R(ne.value).reduce((e, t) => {
1334
- let n = ne.value[t];
1335
- return n?.length && (e[t] = n[0]), e;
1336
- }, {})), ae = e(() => x.value.reduce((e, t) => (e[g(t.path)] = {
1337
- name: g(t.path) || "",
1338
- label: t.label || ""
1339
- }, e), {})), O = e(() => x.value.reduce((e, t) => (e[g(t.path)] = t.bails ?? !0, e), {})), ce = Object.assign({}, t?.initialErrors || {}), le = t?.keepValuesOnUnmount ?? !1, { initialValues: A, originalInitialValues: ue, setInitialValues: pe } = Vt(x, y, t), me = Bt(x, y, ue, D), he = e(() => x.value.reduce((e, t) => {
1340
- let n = I(y, g(t.path));
1341
- return L(e, g(t.path), n), e;
1342
- }, {})), j = t?.validationSchema;
1343
- function ge(t, n) {
1344
- let r = e(() => I(A.value, g(t))), s = C.value[g(t)], c = n?.type === "checkbox" || n?.type === "radio";
1345
- if (s && c) {
1346
- s.multiple = !0;
1347
- let e = i++;
1348
- return Array.isArray(s.id) ? s.id.push(e) : s.id = [s.id, e], s.fieldsCount++, s.__flags.pendingUnmount[e] = !1, s;
1349
- }
1350
- let l = e(() => I(y, g(t))), u = g(t), f = xe.findIndex((e) => e === u);
1351
- f !== -1 && xe.splice(f, 1);
1352
- let p = e(() => {
1353
- let e = g(j);
1354
- if (de(e)) return e.describe?.call(e, g(t)).required ?? !1;
1355
- let r = g(n?.schema);
1356
- return de(r) ? r.describe?.call(r).required ?? !1 : !1;
1357
- }), m = i++, h = d({
1358
- id: m,
1359
- path: t,
1360
- touched: !1,
1361
- pending: !1,
1362
- valid: !0,
1363
- validated: !!ce[u]?.length,
1364
- required: p,
1365
- initialValue: r,
1366
- errors: ee([]),
1367
- bails: n?.bails ?? !1,
1368
- label: n?.label,
1369
- type: n?.type || "default",
1370
- value: l,
1371
- multiple: !1,
1372
- __flags: {
1373
- pendingUnmount: { [m]: !1 },
1374
- pendingReset: !1
1375
- },
1376
- fieldsCount: 1,
1377
- validate: n?.validate,
1378
- dirty: e(() => !P(_(l), _(r)))
1379
- });
1380
- return x.value.push(h), C.value[u] = h, w(), D.value[u] && !ce[u] && o(() => {
1381
- Je(u, { mode: "silent" });
1382
- }), a(t) && v(t, (e) => {
1383
- w();
1384
- let t = k(l.value);
1385
- C.value[e] = h, o(() => {
1386
- L(y, e, t);
1387
- });
1388
- }), h;
1389
- }
1390
- let _e = ke(Qe, 5), ve = ke(Qe, 5), ye = Ae(async (e) => await (e === "silent" ? _e() : ve()), (e, [t]) => {
1391
- let n = R(z.errorBag.value), r = [...new Set([
1392
- ...R(e.results),
1393
- ...x.value.map((e) => e.path),
1394
- ...n
1395
- ])].sort().reduce((n, r) => {
1396
- let i = r, a = N(i) || F(i), o = e.results[i]?.errors || [], s = g(a?.path) || i, c = Ht({
1397
- errors: o,
1398
- valid: !o.length
1399
- }, n.results[s]);
1400
- return n.results[s] = c, c.valid || (n.errors[s] = c.errors[0]), a && S.value[s] && delete S.value[s], a ? (a.valid = c.valid, t === "silent" || t === "validated-only" && !a.validated || T(a, c.errors), n) : (T(s, o), n);
1401
- }, {
1402
- valid: e.valid,
1403
- results: {},
1404
- errors: {},
1405
- source: e.source
1406
- });
1407
- return e.values && (r.values = e.values, r.source = e.source), R(r.results).forEach((e) => {
1408
- let n = N(e);
1409
- n && t !== "silent" && (t === "validated-only" && !n.validated || T(n, r.results[e]?.errors));
1410
- }), r;
1411
- });
1412
- function M(e) {
1413
- x.value.forEach(e);
1414
- }
1415
- function N(e) {
1416
- let t = typeof e == "string" ? ie(e) : e;
1417
- return typeof t == "string" ? C.value[t] : t;
1418
- }
1419
- function F(e) {
1420
- return x.value.filter((t) => e.startsWith(g(t.path))).reduce((e, t) => e ? t.path.length > e.path.length ? t : e : t, void 0);
1421
- }
1422
- let xe = [], Se;
1423
- function Ce(e) {
1424
- return xe.push(e), Se ||= o(() => {
1425
- [...xe].sort().reverse().forEach((e) => {
1426
- we(y, e);
1427
- }), xe = [], Se = null;
1428
- }), Se;
1429
- }
1430
- function Te(e) {
1431
- return function(t, n) {
1432
- return function(r) {
1433
- return r instanceof Event && (r.preventDefault(), r.stopPropagation()), M((e) => e.touched = !0), s.value = !0, m.value++, Ke().then((i) => {
1434
- let a = k(y);
1435
- if (i.valid && typeof t == "function") {
1436
- let n = k(he.value), o = e ? n : a;
1437
- return i.values && (o = i.source === "schema" ? i.values : Object.assign({}, o, i.values)), t(o, {
1438
- evt: r,
1439
- controlledValues: n,
1440
- setErrors: E,
1441
- setFieldError: T,
1442
- setTouched: Ue,
1443
- setFieldTouched: Re,
1444
- setValues: Ie,
1445
- setFieldValue: je,
1446
- resetForm: Ge,
1447
- resetField: We
1448
- });
1449
- }
1450
- !i.valid && typeof n == "function" && n({
1451
- values: a,
1452
- evt: r,
1453
- errors: i.errors,
1454
- results: i.results
1455
- });
1456
- }).then((e) => (s.value = !1, e), (e) => {
1457
- throw s.value = !1, e;
1458
- });
1459
- };
1460
- };
1461
- }
1462
- let Ee = Te(!1);
1463
- Ee.withControlled = Te(!0);
1464
- function De(e, t) {
1465
- let n = x.value.findIndex((n) => n.path === e && (Array.isArray(n.id) ? n.id.includes(t) : n.id === t)), r = x.value[n];
1466
- if (!(n === -1 || !r)) {
1467
- if (o(() => {
1468
- Je(e, {
1469
- mode: "silent",
1470
- warn: !1
1471
- });
1472
- }), r.multiple && r.fieldsCount && r.fieldsCount--, Array.isArray(r.id)) {
1473
- let e = r.id.indexOf(t);
1474
- e >= 0 && r.id.splice(e, 1), delete r.__flags.pendingUnmount[t];
1475
- }
1476
- (!r.multiple || r.fieldsCount <= 0) && (x.value.splice(n, 1), Ye(e), w(), delete C.value[e]);
1477
- }
1478
- }
1479
- function Oe(e) {
1480
- R(C.value).forEach((t) => {
1481
- t.startsWith(e) && delete C.value[t];
1482
- }), x.value = x.value.filter((t) => !t.path.startsWith(e)), o(() => {
1483
- w();
1484
- });
1485
- }
1486
- let z = {
1487
- name: r,
1488
- formId: n,
1489
- values: y,
1490
- controlledValues: he,
1491
- errorBag: ne,
1492
- errors: D,
1493
- schema: j,
1494
- submitCount: m,
1495
- meta: me,
1496
- isSubmitting: s,
1497
- isValidating: l,
1498
- fieldArrays: h,
1499
- keepValuesOnUnmount: le,
1500
- validateSchema: _(j) ? ye : void 0,
1501
- validate: Ke,
1502
- setFieldError: T,
1503
- validateField: Je,
1504
- setFieldValue: je,
1505
- setValues: Ie,
1506
- setErrors: E,
1507
- setFieldTouched: Re,
1508
- setTouched: Ue,
1509
- resetForm: Ge,
1510
- resetField: We,
1511
- handleSubmit: Ee,
1512
- useFieldModel: tt,
1513
- defineInputBinds: it,
1514
- defineComponentBinds: at,
1515
- defineField: et,
1516
- stageInitialValue: Xe,
1517
- unsetInitialValue: Ye,
1518
- setFieldInitialValue: Ze,
1519
- createPathState: ge,
1520
- getPathState: N,
1521
- unsetPathValue: Ce,
1522
- removePathState: De,
1523
- initialValues: A,
1524
- getAllPathStates: () => x.value,
1525
- destroyPath: Oe,
1526
- isFieldTouched: Be,
1527
- isFieldDirty: Ve,
1528
- isFieldValid: He
1529
- };
1530
- function je(e, t, n = !0) {
1531
- let r = k(t), i = typeof e == "string" ? e : e.path;
1532
- N(i) || ge(i), L(y, i, r), n && Je(i);
1533
- }
1534
- function Fe(e, t = !0) {
1535
- R(y).forEach((e) => {
1536
- delete y[e];
1537
- }), R(e).forEach((t) => {
1538
- je(t, e[t], !1);
1539
- }), t && Ke();
1540
- }
1541
- function Ie(e, t = !0) {
1542
- re(y, e), h.forEach((e) => e && e.reset()), t && Ke();
1543
- }
1544
- function Le(t, n) {
1545
- let r = N(g(t)) || ge(t);
1546
- return e({
1547
- get() {
1548
- return r.value;
1549
- },
1550
- set(e) {
1551
- je(g(t), e, g(n) ?? !1);
1552
- }
1553
- });
1554
- }
1555
- function Re(e, t) {
1556
- let n = N(e);
1557
- n && (n.touched = t);
1558
- }
1559
- function Be(e) {
1560
- let t = N(e);
1561
- return t ? t.touched : x.value.filter((t) => t.path.startsWith(e)).some((e) => e.touched);
1562
- }
1563
- function Ve(e) {
1564
- let t = N(e);
1565
- return t ? t.dirty : x.value.filter((t) => t.path.startsWith(e)).some((e) => e.dirty);
1566
- }
1567
- function He(e) {
1568
- let t = N(e);
1569
- return t ? t.valid : x.value.filter((t) => t.path.startsWith(e)).every((e) => e.valid);
1570
- }
1571
- function Ue(e) {
1572
- if (typeof e == "boolean") {
1573
- M((t) => {
1574
- t.touched = e;
1575
- });
1576
- return;
1577
- }
1578
- R(e).forEach((t) => {
1579
- Re(t, !!e[t]);
1580
- });
1581
- }
1582
- function We(e, t) {
1583
- let n = t && "value" in t ? t.value : I(A.value, e), r = N(e);
1584
- r && (r.__flags.pendingReset = !0), Ze(e, k(n), !0), je(e, n, !1), Re(e, t?.touched ?? !1), T(e, t?.errors || []), o(() => {
1585
- r && (r.__flags.pendingReset = !1);
1586
- });
1587
- }
1588
- function Ge(e, t) {
1589
- let n = k(e?.values ? e.values : ue.value);
1590
- n = t?.force ? n : re(ue.value, n), n = de(j) && b(j.cast) ? j.cast(n) : n, pe(n, { force: t?.force }), M((t) => {
1591
- t.__flags.pendingReset = !0, t.validated = !1, t.touched = e?.touched?.[g(t.path)] || !1, je(g(t.path), I(n, g(t.path)), !1), T(g(t.path), void 0);
1592
- }), t?.force ? Fe(n, !1) : Ie(n, !1), E(e?.errors || {}), m.value = e?.submitCount || 0, o(() => {
1593
- Ke({ mode: "silent" }), M((e) => {
1594
- e.__flags.pendingReset = !1;
1595
- });
1596
- });
1597
- }
1598
- async function Ke(e) {
1599
- let t = e?.mode || "force";
1600
- if (t === "force" && M((e) => e.validated = !0), z.validateSchema) return z.validateSchema(t);
1601
- l.value = !0;
1602
- let n = await Promise.all(x.value.map((t) => t.validate ? t.validate(e).then((e) => ({
1603
- key: g(t.path),
1604
- valid: e.valid,
1605
- errors: e.errors,
1606
- value: e.value
1607
- })) : Promise.resolve({
1608
- key: g(t.path),
1609
- valid: !0,
1610
- errors: [],
1611
- value: void 0
1612
- })));
1613
- l.value = !1;
1614
- let r = {}, i = {}, a = {};
1615
- for (let e of n) r[e.key] = {
1616
- valid: e.valid,
1617
- errors: e.errors
1618
- }, e.value && L(a, e.key, e.value), e.errors.length && (i[e.key] = e.errors[0]);
1619
- return {
1620
- valid: n.every((e) => e.valid),
1621
- results: r,
1622
- errors: i,
1623
- values: a,
1624
- source: "fields"
1625
- };
1626
- }
1627
- async function Je(e, t) {
1628
- let n = N(e);
1629
- if (n && t?.mode !== "silent" && (n.validated = !0), j) {
1630
- let { results: n } = await ye(t?.mode || "validated-only");
1631
- return n[e] || {
1632
- errors: [],
1633
- valid: !0
1634
- };
1635
- }
1636
- return n?.validate ? n.validate(t) : (!n && (t?.warn ?? !0) && process.env.NODE_ENV !== "production" && te(`field with path ${e} was not found`), Promise.resolve({
1637
- errors: [],
1638
- valid: !0
1639
- }));
1640
- }
1641
- function Ye(e) {
1642
- we(A.value, e);
1643
- }
1644
- function Xe(e, n, r = !1) {
1645
- Ze(e, n), L(y, e, n), r && !t?.initialValues && L(ue.value, e, k(n));
1646
- }
1647
- function Ze(e, t, n = !1) {
1648
- L(A.value, e, k(t)), n && L(ue.value, e, k(t));
1649
- }
1650
- async function Qe() {
1651
- let e = _(j);
1652
- if (!e) return {
1653
- valid: !0,
1654
- results: {},
1655
- errors: {},
1656
- source: "none"
1657
- };
1658
- l.value = !0;
1659
- let t = fe(e) || de(e) ? await nt(e, y) : await rt(e, y, {
1660
- names: ae.value,
1661
- bailsMap: O.value
1662
- });
1663
- return l.value = !1, t;
1664
- }
1665
- let $e = Ee((e, { evt: t }) => {
1666
- be(t) && t.target.submit();
1667
- });
1668
- c(() => {
1669
- if (t?.initialErrors && E(t.initialErrors), t?.initialTouched && Ue(t.initialTouched), t?.validateOnMount) {
1670
- Ke();
1671
- return;
1672
- }
1673
- z.validateSchema && z.validateSchema("silent");
1674
- }), a(j) && v(j, () => {
1675
- var e;
1676
- (e = z.validateSchema) == null || e.call(z, "validated-only");
1677
- }), u(oe, z), process.env.NODE_ENV !== "production" && (gt(z), v(() => Object.assign(Object.assign({ errors: ne.value }, me.value), {
1678
- values: y,
1679
- isSubmitting: s.value,
1680
- isValidating: l.value,
1681
- submitCount: m.value
1682
- }), ht, { deep: !0 }));
1683
- function et(t, n) {
1684
- let r = b(n) ? void 0 : n?.label, i = N(g(t)) || ge(t, { label: r }), a = () => b(n) ? n(Ne(i, Lt)) : n || {};
1685
- function s() {
1686
- i.touched = !0, (a().validateOnBlur ?? qe().validateOnBlur) && Je(g(i.path));
1687
- }
1688
- function c() {
1689
- (a().validateOnInput ?? qe().validateOnInput) && o(() => {
1690
- Je(g(i.path));
1691
- });
1692
- }
1693
- function l() {
1694
- (a().validateOnChange ?? qe().validateOnChange) && o(() => {
1695
- Je(g(i.path));
1696
- });
1697
- }
1698
- let u = e(() => {
1699
- let e = {
1700
- onChange: l,
1701
- onInput: c,
1702
- onBlur: s
1703
- };
1704
- return b(n) ? Object.assign(Object.assign({}, e), n(Ne(i, Lt)).props || {}) : n?.props ? Object.assign(Object.assign({}, e), n.props(Ne(i, Lt))) : e;
1705
- });
1706
- return [Le(t, () => a().validateOnModelUpdate ?? qe()?.validateOnModelUpdate ?? !0), u];
1707
- }
1708
- function tt(e) {
1709
- return Array.isArray(e) ? e.map((e) => Le(e, !0)) : Le(e);
1710
- }
1711
- function it(t, n) {
1712
- let [r, i] = et(t, n);
1713
- function a() {
1714
- i.value.onBlur();
1715
- }
1716
- function o(e) {
1717
- let n = ze(e);
1718
- je(g(t), n, !1), i.value.onInput();
1719
- }
1720
- function s(e) {
1721
- let n = ze(e);
1722
- je(g(t), n, !1), i.value.onChange();
1723
- }
1724
- return e(() => Object.assign(Object.assign({}, i.value), {
1725
- onBlur: a,
1726
- onInput: o,
1727
- onChange: s,
1728
- value: r.value
1729
- }));
1730
- }
1731
- function at(t, n) {
1732
- let [r, i] = et(t, n), a = N(g(t));
1733
- function o(e) {
1734
- r.value = e;
1735
- }
1736
- return e(() => {
1737
- let e = b(n) ? n(Ne(a, Lt)) : n || {};
1738
- return Object.assign({
1739
- [e.model || "modelValue"]: r.value,
1740
- [`onUpdate:${e.model || "modelValue"}`]: o
1741
- }, i.value);
1742
- });
1743
- }
1744
- let ot = Object.assign(Object.assign({}, z), {
1745
- values: f(y),
1746
- handleReset: () => Ge(),
1747
- submitForm: $e
1748
- });
1749
- return u(se, ot), ot;
1750
- }
1751
- function Bt(t, n, r, i) {
1752
- let a = {
1753
- touched: "some",
1754
- pending: "some",
1755
- valid: "every"
1756
- }, o = e(() => !P(n, _(r)));
1757
- function s() {
1758
- let e = t.value;
1759
- return R(a).reduce((t, n) => (t[n] = e[a[n]]((e) => e[n]), t), {});
1760
- }
1761
- let c = d(s());
1762
- return y(() => {
1763
- let e = s();
1764
- c.touched = e.touched, c.valid = e.valid, c.pending = e.pending;
1765
- }), e(() => Object.assign(Object.assign({ initialValues: _(r) }, c), {
1766
- valid: c.valid && !R(i.value).length,
1767
- dirty: o.value
1768
- }));
1769
- }
1770
- function Vt(e, t, n) {
1771
- let r = Rt(n), i = p(r), a = p(k(r));
1772
- function o(n, r) {
1773
- r?.force ? (i.value = k(n), a.value = k(n)) : (i.value = re(k(i.value) || {}, k(n)), a.value = re(k(a.value) || {}, k(n))), r?.updateFields && e.value.forEach((e) => {
1774
- if (e.touched) return;
1775
- let n = I(i.value, g(e.path));
1776
- L(t, g(e.path), k(n));
1777
- });
1778
- }
1779
- return {
1780
- initialValues: i,
1781
- originalInitialValues: a,
1782
- setInitialValues: o
1783
- };
1784
- }
1785
- function Ht(e, t) {
1786
- return t ? {
1787
- valid: e.valid && t.valid,
1788
- errors: [...e.errors, ...t.errors]
1789
- } : e;
1790
- }
1791
- function Ut() {
1792
- return i(se);
1793
- }
1794
- t({
1795
- name: "Form",
1796
- inheritAttrs: !1,
1797
- props: {
1798
- as: {
1799
- type: null,
1800
- default: "form"
1801
- },
1802
- validationSchema: {
1803
- type: Object,
1804
- default: void 0
1805
- },
1806
- initialValues: {
1807
- type: Object,
1808
- default: void 0
1809
- },
1810
- initialErrors: {
1811
- type: Object,
1812
- default: void 0
1813
- },
1814
- initialTouched: {
1815
- type: Object,
1816
- default: void 0
1817
- },
1818
- validateOnMount: {
1819
- type: Boolean,
1820
- default: !1
1821
- },
1822
- onSubmit: {
1823
- type: Function,
1824
- default: void 0
1825
- },
1826
- onInvalidSubmit: {
1827
- type: Function,
1828
- default: void 0
1829
- },
1830
- keepValues: {
1831
- type: Boolean,
1832
- default: !1
1833
- },
1834
- name: {
1835
- type: String,
1836
- default: "Form"
1837
- }
1838
- },
1839
- setup(e, t) {
1840
- let n = h(e, "validationSchema"), i = h(e, "keepValues"), { errors: a, errorBag: o, values: s, meta: c, isSubmitting: l, isValidating: u, submitCount: d, controlledValues: f, validate: p, validateField: ee, handleReset: g, resetForm: _, handleSubmit: te, setErrors: v, setFieldError: y, setFieldValue: b, setValues: x, setFieldTouched: S, setTouched: C, resetField: w } = zt({
1841
- validationSchema: n.value ? n : void 0,
1842
- initialValues: e.initialValues,
1843
- initialErrors: e.initialErrors,
1844
- initialTouched: e.initialTouched,
1845
- validateOnMount: e.validateOnMount,
1846
- keepValuesOnUnmount: i,
1847
- name: e.name
1848
- }), T = te((e, { evt: t }) => {
1849
- be(t) && t.target.submit();
1850
- }, e.onInvalidSubmit), E = e.onSubmit ? te(e.onSubmit, e.onInvalidSubmit) : T;
1851
- function ne(e) {
1852
- M(e) && e.preventDefault(), g(), typeof t.attrs.onReset == "function" && t.attrs.onReset();
1853
- }
1854
- function re(t, n) {
1855
- return te(typeof t == "function" && !n ? t : n, e.onInvalidSubmit)(t);
1856
- }
1857
- function ie() {
1858
- return k(s);
1859
- }
1860
- function D() {
1861
- return k(c.value);
1862
- }
1863
- function ae() {
1864
- return k(a.value);
1865
- }
1866
- function O() {
1867
- return {
1868
- meta: c.value,
1869
- errors: a.value,
1870
- errorBag: o.value,
1871
- values: s,
1872
- isSubmitting: l.value,
1873
- isValidating: u.value,
1874
- submitCount: d.value,
1875
- controlledValues: f.value,
1876
- validate: p,
1877
- validateField: ee,
1878
- handleSubmit: re,
1879
- handleReset: g,
1880
- submitForm: T,
1881
- setErrors: v,
1882
- setFieldError: y,
1883
- setFieldValue: b,
1884
- setValues: x,
1885
- setFieldTouched: S,
1886
- setTouched: C,
1887
- resetForm: _,
1888
- resetField: w,
1889
- getValues: ie,
1890
- getMeta: D,
1891
- getErrors: ae
1892
- };
1893
- }
1894
- return t.expose({
1895
- setFieldError: y,
1896
- setErrors: v,
1897
- setFieldValue: b,
1898
- setValues: x,
1899
- setFieldTouched: S,
1900
- setTouched: C,
1901
- resetForm: _,
1902
- validate: p,
1903
- validateField: ee,
1904
- resetField: w,
1905
- getValues: ie,
1906
- getMeta: D,
1907
- getErrors: ae,
1908
- values: s,
1909
- meta: c,
1910
- errors: a
1911
- }), function() {
1912
- let n = e.as === "form" ? e.as : e.as ? m(e.as) : null, i = Fe(n, t, O);
1913
- return n ? r(n, Object.assign(Object.assign(Object.assign({}, n === "form" ? { novalidate: !0 } : {}), t.attrs), {
1914
- onSubmit: E,
1915
- onReset: ne
1916
- }), i) : i;
1917
- };
1918
- }
1919
- });
1920
- function Wt(e) {
1921
- let t = Te(oe, void 0), n = p([]), r = () => {}, i = {
1922
- fields: n,
1923
- remove: r,
1924
- push: r,
1925
- swap: r,
1926
- insert: r,
1927
- update: r,
1928
- replace: r,
1929
- prepend: r,
1930
- move: r
1931
- };
1932
- if (!t) return process.env.NODE_ENV !== "production" && Ee("FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly"), i;
1933
- if (!_(e)) return process.env.NODE_ENV !== "production" && Ee("FieldArray requires a field path to be provided, did you forget to pass the `name` prop?"), i;
1934
- let a = t.fieldArrays.find((t) => _(t.path) === _(e));
1935
- if (a) return a;
1936
- let o = 0;
1937
- function c() {
1938
- return I(t?.values, g(e), []) || [];
1939
- }
1940
- function l() {
1941
- let e = c();
1942
- Array.isArray(e) && (n.value = e.map((e, t) => d(e, t, n.value)), u());
1943
- }
1944
- l();
1945
- function u() {
1946
- let e = n.value.length;
1947
- for (let t = 0; t < e; t++) {
1948
- let r = n.value[t];
1949
- r.isFirst = t === 0, r.isLast = t === e - 1;
1950
- }
1951
- }
1952
- function d(r, i, a) {
1953
- if (a && !x(i) && a[i]) return a[i];
1954
- let s = o++;
1955
- return {
1956
- key: s,
1957
- value: je({
1958
- get() {
1959
- let i = I(t?.values, g(e), []) || [], a = n.value.findIndex((e) => e.key === s);
1960
- return a === -1 ? r : i[a];
1961
- },
1962
- set(e) {
1963
- let t = n.value.findIndex((e) => e.key === s);
1964
- if (t === -1) {
1965
- process.env.NODE_ENV !== "production" && Ee("Attempting to update a non-existent array item");
1966
- return;
1967
- }
1968
- b(t, e);
1969
- }
1970
- }),
1971
- isFirst: !1,
1972
- isLast: !1
1973
- };
1974
- }
1975
- function f() {
1976
- u(), t?.validate({ mode: "silent" });
1977
- }
1978
- function m(r) {
1979
- let i = g(e), a = I(t?.values, i);
1980
- if (!a || !Array.isArray(a)) return;
1981
- let o = [...a];
1982
- o.splice(r, 1);
1983
- let s = i + `[${r}]`;
1984
- t.destroyPath(s), t.unsetInitialValue(s), L(t.values, i, o), n.value.splice(r, 1), f();
1985
- }
1986
- function ee(r) {
1987
- let i = k(r), a = g(e), o = I(t?.values, a), s = x(o) ? [] : o;
1988
- if (!Array.isArray(s)) return;
1989
- let c = [...s];
1990
- c.push(i), t.stageInitialValue(a + `[${c.length - 1}]`, i), L(t.values, a, c), n.value.push(d(i)), f();
1991
- }
1992
- function h(r, i) {
1993
- let a = g(e), o = I(t?.values, a);
1994
- if (!Array.isArray(o) || !(r in o) || !(i in o)) return;
1995
- let s = [...o], c = [...n.value], l = s[r];
1996
- s[r] = s[i], s[i] = l;
1997
- let d = c[r];
1998
- c[r] = c[i], c[i] = d, L(t.values, a, s), n.value = c, u();
1999
- }
2000
- function te(r, i) {
2001
- let a = k(i), o = g(e), s = I(t?.values, o);
2002
- if (!Array.isArray(s) || s.length < r) return;
2003
- let c = [...s], l = [...n.value];
2004
- c.splice(r, 0, a), l.splice(r, 0, d(a)), L(t.values, o, c), n.value = l, f();
2005
- }
2006
- function y(n) {
2007
- let r = g(e);
2008
- t.stageInitialValue(r, n), L(t.values, r, n), l(), f();
2009
- }
2010
- function b(n, r) {
2011
- let i = g(e), a = I(t?.values, i);
2012
- !Array.isArray(a) || a.length - 1 < n || (L(t.values, `${i}[${n}]`, r), t?.validate({ mode: "validated-only" }));
2013
- }
2014
- function S(r) {
2015
- let i = k(r), a = g(e), o = I(t?.values, a), s = x(o) ? [] : o;
2016
- if (!Array.isArray(s)) return;
2017
- let c = [i, ...s];
2018
- L(t.values, a, c), t.stageInitialValue(a + "[0]", i), n.value.unshift(d(i)), f();
2019
- }
2020
- function C(r, i) {
2021
- let a = g(e), o = I(t?.values, a), s = x(o) ? [] : [...o];
2022
- if (!Array.isArray(o) || !(r in o) || !(i in o)) return;
2023
- let c = [...n.value], l = c[r];
2024
- c.splice(r, 1), c.splice(i, 0, l);
2025
- let u = s[r];
2026
- s.splice(r, 1), s.splice(i, 0, u), L(t.values, a, s), n.value = c, f();
2027
- }
2028
- let w = {
2029
- fields: n,
2030
- remove: m,
2031
- push: ee,
2032
- swap: h,
2033
- insert: te,
2034
- update: b,
2035
- replace: y,
2036
- prepend: S,
2037
- move: C
2038
- };
2039
- return t.fieldArrays.push(Object.assign({
2040
- path: e,
2041
- reset: l
2042
- }, w)), s(() => {
2043
- let n = t.fieldArrays.findIndex((t) => g(t.path) === g(e));
2044
- n >= 0 && t.fieldArrays.splice(n, 1);
2045
- }), v(c, (e) => {
2046
- P(e, n.value.map((e) => e.value)) || l();
2047
- }), w;
2048
- }
2049
- t({
2050
- name: "FieldArray",
2051
- inheritAttrs: !1,
2052
- props: { name: {
2053
- type: String,
2054
- required: !0
2055
- } },
2056
- setup(e, t) {
2057
- let { push: n, remove: r, swap: i, insert: a, replace: o, update: s, prepend: c, move: l, fields: u } = Wt(() => e.name);
2058
- function d() {
2059
- return {
2060
- fields: u.value,
2061
- push: n,
2062
- remove: r,
2063
- swap: i,
2064
- insert: a,
2065
- update: s,
2066
- replace: o,
2067
- prepend: c,
2068
- move: l
2069
- };
2070
- }
2071
- return t.expose({
2072
- push: n,
2073
- remove: r,
2074
- swap: i,
2075
- insert: a,
2076
- update: s,
2077
- replace: o,
2078
- prepend: c,
2079
- move: l
2080
- }), () => Fe(void 0, t, d);
2081
- }
2082
- }), t({
2083
- name: "ErrorMessage",
2084
- props: {
2085
- as: {
2086
- type: String,
2087
- default: void 0
2088
- },
2089
- name: {
2090
- type: String,
2091
- required: !0
2092
- }
2093
- },
2094
- setup(t, n) {
2095
- let a = i(oe, void 0), o = e(() => a?.errors.value[t.name]);
2096
- function s() {
2097
- return { message: o.value };
2098
- }
2099
- return () => {
2100
- if (!o.value) return;
2101
- let e = t.as ? m(t.as) : t.as, i = Fe(e, n, s), a = Object.assign({ role: "alert" }, n.attrs);
2102
- return !e && (Array.isArray(i) || !i) && i?.length ? i : (Array.isArray(i) || !i) && !i?.length ? r(e || "span", a, o.value) : r(e, a, i);
2103
- };
2104
- }
2105
- });
2106
- //#endregion
2107
- //#region ../node_modules/.pnpm/zod@3.24.4/node_modules/zod/lib/index.mjs
2108
- var H;
2109
- (function(e) {
2110
- e.assertEqual = (e) => e;
2111
- function t(e) {}
2112
- e.assertIs = t;
2113
- function n(e) {
2114
- throw Error();
2115
- }
2116
- e.assertNever = n, e.arrayToEnum = (e) => {
2117
- let t = {};
2118
- for (let n of e) t[n] = n;
2119
- return t;
2120
- }, e.getValidEnumValues = (t) => {
2121
- let n = e.objectKeys(t).filter((e) => typeof t[t[e]] != "number"), r = {};
2122
- for (let e of n) r[e] = t[e];
2123
- return e.objectValues(r);
2124
- }, e.objectValues = (t) => e.objectKeys(t).map(function(e) {
2125
- return t[e];
2126
- }), e.objectKeys = typeof Object.keys == "function" ? (e) => Object.keys(e) : (e) => {
2127
- let t = [];
2128
- for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
2129
- return t;
2130
- }, e.find = (e, t) => {
2131
- for (let n of e) if (t(n)) return n;
2132
- }, e.isInteger = typeof Number.isInteger == "function" ? (e) => Number.isInteger(e) : (e) => typeof e == "number" && isFinite(e) && Math.floor(e) === e;
2133
- function r(e, t = " | ") {
2134
- return e.map((e) => typeof e == "string" ? `'${e}'` : e).join(t);
2135
- }
2136
- e.joinValues = r, e.jsonStringifyReplacer = (e, t) => typeof t == "bigint" ? t.toString() : t;
2137
- })(H ||= {});
2138
- var Gt;
2139
- (function(e) {
2140
- e.mergeShapes = (e, t) => ({
2141
- ...e,
2142
- ...t
2143
- });
2144
- })(Gt ||= {});
2145
- var U = H.arrayToEnum([
2146
- "string",
2147
- "nan",
2148
- "number",
2149
- "integer",
2150
- "float",
2151
- "boolean",
2152
- "date",
2153
- "bigint",
2154
- "symbol",
2155
- "function",
2156
- "undefined",
2157
- "null",
2158
- "array",
2159
- "object",
2160
- "unknown",
2161
- "promise",
2162
- "void",
2163
- "never",
2164
- "map",
2165
- "set"
2166
- ]), Kt = (e) => {
2167
- switch (typeof e) {
2168
- case "undefined": return U.undefined;
2169
- case "string": return U.string;
2170
- case "number": return isNaN(e) ? U.nan : U.number;
2171
- case "boolean": return U.boolean;
2172
- case "function": return U.function;
2173
- case "bigint": return U.bigint;
2174
- case "symbol": return U.symbol;
2175
- case "object": return Array.isArray(e) ? U.array : e === null ? U.null : e.then && typeof e.then == "function" && e.catch && typeof e.catch == "function" ? U.promise : typeof Map < "u" && e instanceof Map ? U.map : typeof Set < "u" && e instanceof Set ? U.set : typeof Date < "u" && e instanceof Date ? U.date : U.object;
2176
- default: return U.unknown;
2177
- }
2178
- }, W = H.arrayToEnum([
2179
- "invalid_type",
2180
- "invalid_literal",
2181
- "custom",
2182
- "invalid_union",
2183
- "invalid_union_discriminator",
2184
- "invalid_enum_value",
2185
- "unrecognized_keys",
2186
- "invalid_arguments",
2187
- "invalid_return_type",
2188
- "invalid_date",
2189
- "invalid_string",
2190
- "too_small",
2191
- "too_big",
2192
- "invalid_intersection_types",
2193
- "not_multiple_of",
2194
- "not_finite"
2195
- ]), qt = class e extends Error {
2196
- get errors() {
2197
- return this.issues;
2198
- }
2199
- constructor(e) {
2200
- super(), this.issues = [], this.addIssue = (e) => {
2201
- this.issues = [...this.issues, e];
2202
- }, this.addIssues = (e = []) => {
2203
- this.issues = [...this.issues, ...e];
2204
- };
2205
- let t = new.target.prototype;
2206
- Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
2207
- }
2208
- format(e) {
2209
- let t = e || function(e) {
2210
- return e.message;
2211
- }, n = { _errors: [] }, r = (e) => {
2212
- for (let i of e.issues) if (i.code === "invalid_union") i.unionErrors.map(r);
2213
- else if (i.code === "invalid_return_type") r(i.returnTypeError);
2214
- else if (i.code === "invalid_arguments") r(i.argumentsError);
2215
- else if (i.path.length === 0) n._errors.push(t(i));
2216
- else {
2217
- let e = n, r = 0;
2218
- for (; r < i.path.length;) {
2219
- let n = i.path[r];
2220
- r === i.path.length - 1 ? (e[n] = e[n] || { _errors: [] }, e[n]._errors.push(t(i))) : e[n] = e[n] || { _errors: [] }, e = e[n], r++;
2221
- }
2222
- }
2223
- };
2224
- return r(this), n;
2225
- }
2226
- static assert(t) {
2227
- if (!(t instanceof e)) throw Error(`Not a ZodError: ${t}`);
2228
- }
2229
- toString() {
2230
- return this.message;
2231
- }
2232
- get message() {
2233
- return JSON.stringify(this.issues, H.jsonStringifyReplacer, 2);
2234
- }
2235
- get isEmpty() {
2236
- return this.issues.length === 0;
2237
- }
2238
- flatten(e = (e) => e.message) {
2239
- let t = {}, n = [];
2240
- for (let r of this.issues) r.path.length > 0 ? (t[r.path[0]] = t[r.path[0]] || [], t[r.path[0]].push(e(r))) : n.push(e(r));
2241
- return {
2242
- formErrors: n,
2243
- fieldErrors: t
2244
- };
2245
- }
2246
- get formErrors() {
2247
- return this.flatten();
2248
- }
2249
- };
2250
- qt.create = (e) => new qt(e);
2251
- var Jt = (e, t) => {
2252
- let n;
2253
- switch (e.code) {
2254
- case W.invalid_type:
2255
- n = e.received === U.undefined ? "Required" : `Expected ${e.expected}, received ${e.received}`;
2256
- break;
2257
- case W.invalid_literal:
2258
- n = `Invalid literal value, expected ${JSON.stringify(e.expected, H.jsonStringifyReplacer)}`;
2259
- break;
2260
- case W.unrecognized_keys:
2261
- n = `Unrecognized key(s) in object: ${H.joinValues(e.keys, ", ")}`;
2262
- break;
2263
- case W.invalid_union:
2264
- n = "Invalid input";
2265
- break;
2266
- case W.invalid_union_discriminator:
2267
- n = `Invalid discriminator value. Expected ${H.joinValues(e.options)}`;
2268
- break;
2269
- case W.invalid_enum_value:
2270
- n = `Invalid enum value. Expected ${H.joinValues(e.options)}, received '${e.received}'`;
2271
- break;
2272
- case W.invalid_arguments:
2273
- n = "Invalid function arguments";
2274
- break;
2275
- case W.invalid_return_type:
2276
- n = "Invalid function return type";
2277
- break;
2278
- case W.invalid_date:
2279
- n = "Invalid date";
2280
- break;
2281
- case W.invalid_string:
2282
- typeof e.validation == "object" ? "includes" in e.validation ? (n = `Invalid input: must include "${e.validation.includes}"`, typeof e.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${e.validation.position}`)) : "startsWith" in e.validation ? n = `Invalid input: must start with "${e.validation.startsWith}"` : "endsWith" in e.validation ? n = `Invalid input: must end with "${e.validation.endsWith}"` : H.assertNever(e.validation) : n = e.validation === "regex" ? "Invalid" : `Invalid ${e.validation}`;
2283
- break;
2284
- case W.too_small:
2285
- n = e.type === "array" ? `Array must contain ${e.exact ? "exactly" : e.inclusive ? "at least" : "more than"} ${e.minimum} element(s)` : e.type === "string" ? `String must contain ${e.exact ? "exactly" : e.inclusive ? "at least" : "over"} ${e.minimum} character(s)` : e.type === "number" ? `Number must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${e.minimum}` : e.type === "date" ? `Date must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(e.minimum))}` : "Invalid input";
2286
- break;
2287
- case W.too_big:
2288
- n = e.type === "array" ? `Array must contain ${e.exact ? "exactly" : e.inclusive ? "at most" : "less than"} ${e.maximum} element(s)` : e.type === "string" ? `String must contain ${e.exact ? "exactly" : e.inclusive ? "at most" : "under"} ${e.maximum} character(s)` : e.type === "number" ? `Number must be ${e.exact ? "exactly" : e.inclusive ? "less than or equal to" : "less than"} ${e.maximum}` : e.type === "bigint" ? `BigInt must be ${e.exact ? "exactly" : e.inclusive ? "less than or equal to" : "less than"} ${e.maximum}` : e.type === "date" ? `Date must be ${e.exact ? "exactly" : e.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(e.maximum))}` : "Invalid input";
2289
- break;
2290
- case W.custom:
2291
- n = "Invalid input";
2292
- break;
2293
- case W.invalid_intersection_types:
2294
- n = "Intersection results could not be merged";
2295
- break;
2296
- case W.not_multiple_of:
2297
- n = `Number must be a multiple of ${e.multipleOf}`;
2298
- break;
2299
- case W.not_finite:
2300
- n = "Number must be finite";
2301
- break;
2302
- default: n = t.defaultError, H.assertNever(e);
2303
- }
2304
- return { message: n };
2305
- }, Yt = Jt;
2306
- function Xt() {
2307
- return Yt;
2308
- }
2309
- var Zt = (e) => {
2310
- let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
2311
- ...i,
2312
- path: a
2313
- };
2314
- if (i.message !== void 0) return {
2315
- ...i,
2316
- path: a,
2317
- message: i.message
2318
- };
2319
- let s = "", c = r.filter((e) => !!e).slice().reverse();
2320
- for (let e of c) s = e(o, {
2321
- data: t,
2322
- defaultError: s
2323
- }).message;
2324
- return {
2325
- ...i,
2326
- path: a,
2327
- message: s
2328
- };
2329
- };
2330
- function G(e, t) {
2331
- let n = Xt(), r = Zt({
2332
- issueData: t,
2333
- data: e.data,
2334
- path: e.path,
2335
- errorMaps: [
2336
- e.common.contextualErrorMap,
2337
- e.schemaErrorMap,
2338
- n,
2339
- n === Jt ? void 0 : Jt
2340
- ].filter((e) => !!e)
2341
- });
2342
- e.common.issues.push(r);
2343
- }
2344
- var K = class e {
2345
- constructor() {
2346
- this.value = "valid";
2347
- }
2348
- dirty() {
2349
- this.value === "valid" && (this.value = "dirty");
2350
- }
2351
- abort() {
2352
- this.value !== "aborted" && (this.value = "aborted");
2353
- }
2354
- static mergeArray(e, t) {
2355
- let n = [];
2356
- for (let r of t) {
2357
- if (r.status === "aborted") return q;
2358
- r.status === "dirty" && e.dirty(), n.push(r.value);
2359
- }
2360
- return {
2361
- status: e.value,
2362
- value: n
2363
- };
2364
- }
2365
- static async mergeObjectAsync(t, n) {
2366
- let r = [];
2367
- for (let e of n) {
2368
- let t = await e.key, n = await e.value;
2369
- r.push({
2370
- key: t,
2371
- value: n
2372
- });
2373
- }
2374
- return e.mergeObjectSync(t, r);
2375
- }
2376
- static mergeObjectSync(e, t) {
2377
- let n = {};
2378
- for (let r of t) {
2379
- let { key: t, value: i } = r;
2380
- if (t.status === "aborted" || i.status === "aborted") return q;
2381
- t.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), t.value !== "__proto__" && (i.value !== void 0 || r.alwaysSet) && (n[t.value] = i.value);
2382
- }
2383
- return {
2384
- status: e.value,
2385
- value: n
2386
- };
2387
- }
2388
- }, q = Object.freeze({ status: "aborted" }), Qt = (e) => ({
2389
- status: "dirty",
2390
- value: e
2391
- }), J = (e) => ({
2392
- status: "valid",
2393
- value: e
2394
- }), $t = (e) => e.status === "aborted", en = (e) => e.status === "dirty", tn = (e) => e.status === "valid", nn = (e) => typeof Promise < "u" && e instanceof Promise;
2395
- function rn(e, t, n, r) {
2396
- if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
2397
- if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw TypeError("Cannot read private member from an object whose class did not declare it");
2398
- return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
2399
- }
2400
- function an(e, t, n, r, i) {
2401
- if (r === "m") throw TypeError("Private method is not writable");
2402
- if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
2403
- if (typeof t == "function" ? e !== t || !i : !t.has(e)) throw TypeError("Cannot write private member to an object whose class did not declare it");
2404
- return r === "a" ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
2405
- }
2406
- var Y;
2407
- (function(e) {
2408
- e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
2409
- })(Y ||= {});
2410
- var on, sn, cn = class {
2411
- constructor(e, t, n, r) {
2412
- this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
2413
- }
2414
- get path() {
2415
- return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
2416
- }
2417
- }, ln = (e, t) => {
2418
- if (tn(t)) return {
2419
- success: !0,
2420
- data: t.value
2421
- };
2422
- if (!e.common.issues.length) throw Error("Validation failed but no issues detected.");
2423
- return {
2424
- success: !1,
2425
- get error() {
2426
- if (this._error) return this._error;
2427
- let t = new qt(e.common.issues);
2428
- return this._error = t, this._error;
2429
- }
2430
- };
2431
- };
2432
- function X(e) {
2433
- if (!e) return {};
2434
- let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
2435
- if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
2436
- return t ? {
2437
- errorMap: t,
2438
- description: i
2439
- } : {
2440
- errorMap: (t, i) => {
2441
- let { message: a } = e;
2442
- return t.code === "invalid_enum_value" ? { message: a ?? i.defaultError } : i.data === void 0 ? { message: a ?? r ?? i.defaultError } : t.code === "invalid_type" ? { message: a ?? n ?? i.defaultError } : { message: i.defaultError };
2443
- },
2444
- description: i
2445
- };
2446
- }
2447
- var Z = class {
2448
- get description() {
2449
- return this._def.description;
2450
- }
2451
- _getType(e) {
2452
- return Kt(e.data);
2453
- }
2454
- _getOrReturnCtx(e, t) {
2455
- return t || {
2456
- common: e.parent.common,
2457
- data: e.data,
2458
- parsedType: Kt(e.data),
2459
- schemaErrorMap: this._def.errorMap,
2460
- path: e.path,
2461
- parent: e.parent
2462
- };
2463
- }
2464
- _processInputParams(e) {
2465
- return {
2466
- status: new K(),
2467
- ctx: {
2468
- common: e.parent.common,
2469
- data: e.data,
2470
- parsedType: Kt(e.data),
2471
- schemaErrorMap: this._def.errorMap,
2472
- path: e.path,
2473
- parent: e.parent
2474
- }
2475
- };
2476
- }
2477
- _parseSync(e) {
2478
- let t = this._parse(e);
2479
- if (nn(t)) throw Error("Synchronous parse encountered promise.");
2480
- return t;
2481
- }
2482
- _parseAsync(e) {
2483
- let t = this._parse(e);
2484
- return Promise.resolve(t);
2485
- }
2486
- parse(e, t) {
2487
- let n = this.safeParse(e, t);
2488
- if (n.success) return n.data;
2489
- throw n.error;
2490
- }
2491
- safeParse(e, t) {
2492
- let n = {
2493
- common: {
2494
- issues: [],
2495
- async: t?.async ?? !1,
2496
- contextualErrorMap: t?.errorMap
2497
- },
2498
- path: t?.path || [],
2499
- schemaErrorMap: this._def.errorMap,
2500
- parent: null,
2501
- data: e,
2502
- parsedType: Kt(e)
2503
- };
2504
- return ln(n, this._parseSync({
2505
- data: e,
2506
- path: n.path,
2507
- parent: n
2508
- }));
2509
- }
2510
- "~validate"(e) {
2511
- let t = {
2512
- common: {
2513
- issues: [],
2514
- async: !!this["~standard"].async
2515
- },
2516
- path: [],
2517
- schemaErrorMap: this._def.errorMap,
2518
- parent: null,
2519
- data: e,
2520
- parsedType: Kt(e)
2521
- };
2522
- if (!this["~standard"].async) try {
2523
- let n = this._parseSync({
2524
- data: e,
2525
- path: [],
2526
- parent: t
2527
- });
2528
- return tn(n) ? { value: n.value } : { issues: t.common.issues };
2529
- } catch (e) {
2530
- ((e?.message)?.toLowerCase())?.includes("encountered") && (this["~standard"].async = !0), t.common = {
2531
- issues: [],
2532
- async: !0
2533
- };
2534
- }
2535
- return this._parseAsync({
2536
- data: e,
2537
- path: [],
2538
- parent: t
2539
- }).then((e) => tn(e) ? { value: e.value } : { issues: t.common.issues });
2540
- }
2541
- async parseAsync(e, t) {
2542
- let n = await this.safeParseAsync(e, t);
2543
- if (n.success) return n.data;
2544
- throw n.error;
2545
- }
2546
- async safeParseAsync(e, t) {
2547
- let n = {
2548
- common: {
2549
- issues: [],
2550
- contextualErrorMap: t?.errorMap,
2551
- async: !0
2552
- },
2553
- path: t?.path || [],
2554
- schemaErrorMap: this._def.errorMap,
2555
- parent: null,
2556
- data: e,
2557
- parsedType: Kt(e)
2558
- }, r = this._parse({
2559
- data: e,
2560
- path: n.path,
2561
- parent: n
2562
- });
2563
- return ln(n, await (nn(r) ? r : Promise.resolve(r)));
2564
- }
2565
- refine(e, t) {
2566
- let n = (e) => typeof t == "string" || t === void 0 ? { message: t } : typeof t == "function" ? t(e) : t;
2567
- return this._refinement((t, r) => {
2568
- let i = e(t), a = () => r.addIssue({
2569
- code: W.custom,
2570
- ...n(t)
2571
- });
2572
- return typeof Promise < "u" && i instanceof Promise ? i.then((e) => e ? !0 : (a(), !1)) : i ? !0 : (a(), !1);
2573
- });
2574
- }
2575
- refinement(e, t) {
2576
- return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
2577
- }
2578
- _refinement(e) {
2579
- return new dr({
2580
- schema: this,
2581
- typeName: $.ZodEffects,
2582
- effect: {
2583
- type: "refinement",
2584
- refinement: e
2585
- }
2586
- });
2587
- }
2588
- superRefine(e) {
2589
- return this._refinement(e);
2590
- }
2591
- constructor(e) {
2592
- this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
2593
- version: 1,
2594
- vendor: "zod",
2595
- validate: (e) => this["~validate"](e)
2596
- };
2597
- }
2598
- optional() {
2599
- return fr.create(this, this._def);
2600
- }
2601
- nullable() {
2602
- return pr.create(this, this._def);
2603
- }
2604
- nullish() {
2605
- return this.nullable().optional();
2606
- }
2607
- array() {
2608
- return qn.create(this);
2609
- }
2610
- promise() {
2611
- return ur.create(this, this._def);
2612
- }
2613
- or(e) {
2614
- return Yn.create([this, e], this._def);
2615
- }
2616
- and(e) {
2617
- return $n.create(this, e, this._def);
2618
- }
2619
- transform(e) {
2620
- return new dr({
2621
- ...X(this._def),
2622
- schema: this,
2623
- typeName: $.ZodEffects,
2624
- effect: {
2625
- type: "transform",
2626
- transform: e
2627
- }
2628
- });
2629
- }
2630
- default(e) {
2631
- let t = typeof e == "function" ? e : () => e;
2632
- return new mr({
2633
- ...X(this._def),
2634
- innerType: this,
2635
- defaultValue: t,
2636
- typeName: $.ZodDefault
2637
- });
2638
- }
2639
- brand() {
2640
- return new _r({
2641
- typeName: $.ZodBranded,
2642
- type: this,
2643
- ...X(this._def)
2644
- });
2645
- }
2646
- catch(e) {
2647
- let t = typeof e == "function" ? e : () => e;
2648
- return new hr({
2649
- ...X(this._def),
2650
- innerType: this,
2651
- catchValue: t,
2652
- typeName: $.ZodCatch
2653
- });
2654
- }
2655
- describe(e) {
2656
- let t = this.constructor;
2657
- return new t({
2658
- ...this._def,
2659
- description: e
2660
- });
2661
- }
2662
- pipe(e) {
2663
- return vr.create(this, e);
2664
- }
2665
- readonly() {
2666
- return yr.create(this);
2667
- }
2668
- isOptional() {
2669
- return this.safeParse(void 0).success;
2670
- }
2671
- isNullable() {
2672
- return this.safeParse(null).success;
2673
- }
2674
- }, un = /^c[^\s-]{8,}$/i, dn = /^[0-9a-z]+$/, fn = /^[0-9A-HJKMNP-TV-Z]{26}$/i, pn = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, mn = /^[a-z0-9_-]{21}$/i, hn = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, gn = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, _n = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, vn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", yn, bn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, xn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Sn = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Cn = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, wn = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Tn = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, En = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Dn = RegExp(`^${En}$`);
2675
- function On(e) {
2676
- let t = "[0-5]\\d";
2677
- e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
2678
- let n = e.precision ? "+" : "?";
2679
- return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
2680
- }
2681
- function kn(e) {
2682
- return RegExp(`^${On(e)}$`);
2683
- }
2684
- function An(e) {
2685
- let t = `${En}T${On(e)}`, n = [];
2686
- return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
2687
- }
2688
- function jn(e, t) {
2689
- return !!((t === "v4" || !t) && bn.test(e) || (t === "v6" || !t) && Sn.test(e));
2690
- }
2691
- function Mn(e, t) {
2692
- if (!hn.test(e)) return !1;
2693
- try {
2694
- let [n] = e.split("."), r = n.replace(/-/g, "+").replace(/_/g, "/").padEnd(n.length + (4 - n.length % 4) % 4, "="), i = JSON.parse(atob(r));
2695
- return !(typeof i != "object" || !i || !i.typ || !i.alg || t && i.alg !== t);
2696
- } catch {
2697
- return !1;
2698
- }
2699
- }
2700
- function Nn(e, t) {
2701
- return !!((t === "v4" || !t) && xn.test(e) || (t === "v6" || !t) && Cn.test(e));
2702
- }
2703
- var Pn = class e extends Z {
2704
- _parse(e) {
2705
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== U.string) {
2706
- let t = this._getOrReturnCtx(e);
2707
- return G(t, {
2708
- code: W.invalid_type,
2709
- expected: U.string,
2710
- received: t.parsedType
2711
- }), q;
2712
- }
2713
- let t = new K(), n;
2714
- for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n), G(n, {
2715
- code: W.too_small,
2716
- minimum: r.value,
2717
- type: "string",
2718
- inclusive: !0,
2719
- exact: !1,
2720
- message: r.message
2721
- }), t.dirty());
2722
- else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n), G(n, {
2723
- code: W.too_big,
2724
- maximum: r.value,
2725
- type: "string",
2726
- inclusive: !0,
2727
- exact: !1,
2728
- message: r.message
2729
- }), t.dirty());
2730
- else if (r.kind === "length") {
2731
- let i = e.data.length > r.value, a = e.data.length < r.value;
2732
- (i || a) && (n = this._getOrReturnCtx(e, n), i ? G(n, {
2733
- code: W.too_big,
2734
- maximum: r.value,
2735
- type: "string",
2736
- inclusive: !0,
2737
- exact: !0,
2738
- message: r.message
2739
- }) : a && G(n, {
2740
- code: W.too_small,
2741
- minimum: r.value,
2742
- type: "string",
2743
- inclusive: !0,
2744
- exact: !0,
2745
- message: r.message
2746
- }), t.dirty());
2747
- } else if (r.kind === "email") _n.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2748
- validation: "email",
2749
- code: W.invalid_string,
2750
- message: r.message
2751
- }), t.dirty());
2752
- else if (r.kind === "emoji") yn ||= new RegExp(vn, "u"), yn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2753
- validation: "emoji",
2754
- code: W.invalid_string,
2755
- message: r.message
2756
- }), t.dirty());
2757
- else if (r.kind === "uuid") pn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2758
- validation: "uuid",
2759
- code: W.invalid_string,
2760
- message: r.message
2761
- }), t.dirty());
2762
- else if (r.kind === "nanoid") mn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2763
- validation: "nanoid",
2764
- code: W.invalid_string,
2765
- message: r.message
2766
- }), t.dirty());
2767
- else if (r.kind === "cuid") un.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2768
- validation: "cuid",
2769
- code: W.invalid_string,
2770
- message: r.message
2771
- }), t.dirty());
2772
- else if (r.kind === "cuid2") dn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2773
- validation: "cuid2",
2774
- code: W.invalid_string,
2775
- message: r.message
2776
- }), t.dirty());
2777
- else if (r.kind === "ulid") fn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2778
- validation: "ulid",
2779
- code: W.invalid_string,
2780
- message: r.message
2781
- }), t.dirty());
2782
- else if (r.kind === "url") try {
2783
- new URL(e.data);
2784
- } catch {
2785
- n = this._getOrReturnCtx(e, n), G(n, {
2786
- validation: "url",
2787
- code: W.invalid_string,
2788
- message: r.message
2789
- }), t.dirty();
2790
- }
2791
- else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2792
- validation: "regex",
2793
- code: W.invalid_string,
2794
- message: r.message
2795
- }), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), G(n, {
2796
- code: W.invalid_string,
2797
- validation: {
2798
- includes: r.value,
2799
- position: r.position
2800
- },
2801
- message: r.message
2802
- }), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), G(n, {
2803
- code: W.invalid_string,
2804
- validation: { startsWith: r.value },
2805
- message: r.message
2806
- }), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), G(n, {
2807
- code: W.invalid_string,
2808
- validation: { endsWith: r.value },
2809
- message: r.message
2810
- }), t.dirty()) : r.kind === "datetime" ? An(r).test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2811
- code: W.invalid_string,
2812
- validation: "datetime",
2813
- message: r.message
2814
- }), t.dirty()) : r.kind === "date" ? Dn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2815
- code: W.invalid_string,
2816
- validation: "date",
2817
- message: r.message
2818
- }), t.dirty()) : r.kind === "time" ? kn(r).test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2819
- code: W.invalid_string,
2820
- validation: "time",
2821
- message: r.message
2822
- }), t.dirty()) : r.kind === "duration" ? gn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2823
- validation: "duration",
2824
- code: W.invalid_string,
2825
- message: r.message
2826
- }), t.dirty()) : r.kind === "ip" ? jn(e.data, r.version) || (n = this._getOrReturnCtx(e, n), G(n, {
2827
- validation: "ip",
2828
- code: W.invalid_string,
2829
- message: r.message
2830
- }), t.dirty()) : r.kind === "jwt" ? Mn(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), G(n, {
2831
- validation: "jwt",
2832
- code: W.invalid_string,
2833
- message: r.message
2834
- }), t.dirty()) : r.kind === "cidr" ? Nn(e.data, r.version) || (n = this._getOrReturnCtx(e, n), G(n, {
2835
- validation: "cidr",
2836
- code: W.invalid_string,
2837
- message: r.message
2838
- }), t.dirty()) : r.kind === "base64" ? wn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2839
- validation: "base64",
2840
- code: W.invalid_string,
2841
- message: r.message
2842
- }), t.dirty()) : r.kind === "base64url" ? Tn.test(e.data) || (n = this._getOrReturnCtx(e, n), G(n, {
2843
- validation: "base64url",
2844
- code: W.invalid_string,
2845
- message: r.message
2846
- }), t.dirty()) : H.assertNever(r);
2847
- return {
2848
- status: t.value,
2849
- value: e.data
2850
- };
2851
- }
2852
- _regex(e, t, n) {
2853
- return this.refinement((t) => e.test(t), {
2854
- validation: t,
2855
- code: W.invalid_string,
2856
- ...Y.errToObj(n)
2857
- });
2858
- }
2859
- _addCheck(t) {
2860
- return new e({
2861
- ...this._def,
2862
- checks: [...this._def.checks, t]
2863
- });
2864
- }
2865
- email(e) {
2866
- return this._addCheck({
2867
- kind: "email",
2868
- ...Y.errToObj(e)
2869
- });
2870
- }
2871
- url(e) {
2872
- return this._addCheck({
2873
- kind: "url",
2874
- ...Y.errToObj(e)
2875
- });
2876
- }
2877
- emoji(e) {
2878
- return this._addCheck({
2879
- kind: "emoji",
2880
- ...Y.errToObj(e)
2881
- });
2882
- }
2883
- uuid(e) {
2884
- return this._addCheck({
2885
- kind: "uuid",
2886
- ...Y.errToObj(e)
2887
- });
2888
- }
2889
- nanoid(e) {
2890
- return this._addCheck({
2891
- kind: "nanoid",
2892
- ...Y.errToObj(e)
2893
- });
2894
- }
2895
- cuid(e) {
2896
- return this._addCheck({
2897
- kind: "cuid",
2898
- ...Y.errToObj(e)
2899
- });
2900
- }
2901
- cuid2(e) {
2902
- return this._addCheck({
2903
- kind: "cuid2",
2904
- ...Y.errToObj(e)
2905
- });
2906
- }
2907
- ulid(e) {
2908
- return this._addCheck({
2909
- kind: "ulid",
2910
- ...Y.errToObj(e)
2911
- });
2912
- }
2913
- base64(e) {
2914
- return this._addCheck({
2915
- kind: "base64",
2916
- ...Y.errToObj(e)
2917
- });
2918
- }
2919
- base64url(e) {
2920
- return this._addCheck({
2921
- kind: "base64url",
2922
- ...Y.errToObj(e)
2923
- });
2924
- }
2925
- jwt(e) {
2926
- return this._addCheck({
2927
- kind: "jwt",
2928
- ...Y.errToObj(e)
2929
- });
2930
- }
2931
- ip(e) {
2932
- return this._addCheck({
2933
- kind: "ip",
2934
- ...Y.errToObj(e)
2935
- });
2936
- }
2937
- cidr(e) {
2938
- return this._addCheck({
2939
- kind: "cidr",
2940
- ...Y.errToObj(e)
2941
- });
2942
- }
2943
- datetime(e) {
2944
- return typeof e == "string" ? this._addCheck({
2945
- kind: "datetime",
2946
- precision: null,
2947
- offset: !1,
2948
- local: !1,
2949
- message: e
2950
- }) : this._addCheck({
2951
- kind: "datetime",
2952
- precision: e?.precision === void 0 ? null : e?.precision,
2953
- offset: e?.offset ?? !1,
2954
- local: e?.local ?? !1,
2955
- ...Y.errToObj(e?.message)
2956
- });
2957
- }
2958
- date(e) {
2959
- return this._addCheck({
2960
- kind: "date",
2961
- message: e
2962
- });
2963
- }
2964
- time(e) {
2965
- return typeof e == "string" ? this._addCheck({
2966
- kind: "time",
2967
- precision: null,
2968
- message: e
2969
- }) : this._addCheck({
2970
- kind: "time",
2971
- precision: e?.precision === void 0 ? null : e?.precision,
2972
- ...Y.errToObj(e?.message)
2973
- });
2974
- }
2975
- duration(e) {
2976
- return this._addCheck({
2977
- kind: "duration",
2978
- ...Y.errToObj(e)
2979
- });
2980
- }
2981
- regex(e, t) {
2982
- return this._addCheck({
2983
- kind: "regex",
2984
- regex: e,
2985
- ...Y.errToObj(t)
2986
- });
2987
- }
2988
- includes(e, t) {
2989
- return this._addCheck({
2990
- kind: "includes",
2991
- value: e,
2992
- position: t?.position,
2993
- ...Y.errToObj(t?.message)
2994
- });
2995
- }
2996
- startsWith(e, t) {
2997
- return this._addCheck({
2998
- kind: "startsWith",
2999
- value: e,
3000
- ...Y.errToObj(t)
3001
- });
3002
- }
3003
- endsWith(e, t) {
3004
- return this._addCheck({
3005
- kind: "endsWith",
3006
- value: e,
3007
- ...Y.errToObj(t)
3008
- });
3009
- }
3010
- min(e, t) {
3011
- return this._addCheck({
3012
- kind: "min",
3013
- value: e,
3014
- ...Y.errToObj(t)
3015
- });
3016
- }
3017
- max(e, t) {
3018
- return this._addCheck({
3019
- kind: "max",
3020
- value: e,
3021
- ...Y.errToObj(t)
3022
- });
3023
- }
3024
- length(e, t) {
3025
- return this._addCheck({
3026
- kind: "length",
3027
- value: e,
3028
- ...Y.errToObj(t)
3029
- });
3030
- }
3031
- nonempty(e) {
3032
- return this.min(1, Y.errToObj(e));
3033
- }
3034
- trim() {
3035
- return new e({
3036
- ...this._def,
3037
- checks: [...this._def.checks, { kind: "trim" }]
3038
- });
3039
- }
3040
- toLowerCase() {
3041
- return new e({
3042
- ...this._def,
3043
- checks: [...this._def.checks, { kind: "toLowerCase" }]
3044
- });
3045
- }
3046
- toUpperCase() {
3047
- return new e({
3048
- ...this._def,
3049
- checks: [...this._def.checks, { kind: "toUpperCase" }]
3050
- });
3051
- }
3052
- get isDatetime() {
3053
- return !!this._def.checks.find((e) => e.kind === "datetime");
3054
- }
3055
- get isDate() {
3056
- return !!this._def.checks.find((e) => e.kind === "date");
3057
- }
3058
- get isTime() {
3059
- return !!this._def.checks.find((e) => e.kind === "time");
3060
- }
3061
- get isDuration() {
3062
- return !!this._def.checks.find((e) => e.kind === "duration");
3063
- }
3064
- get isEmail() {
3065
- return !!this._def.checks.find((e) => e.kind === "email");
3066
- }
3067
- get isURL() {
3068
- return !!this._def.checks.find((e) => e.kind === "url");
3069
- }
3070
- get isEmoji() {
3071
- return !!this._def.checks.find((e) => e.kind === "emoji");
3072
- }
3073
- get isUUID() {
3074
- return !!this._def.checks.find((e) => e.kind === "uuid");
3075
- }
3076
- get isNANOID() {
3077
- return !!this._def.checks.find((e) => e.kind === "nanoid");
3078
- }
3079
- get isCUID() {
3080
- return !!this._def.checks.find((e) => e.kind === "cuid");
3081
- }
3082
- get isCUID2() {
3083
- return !!this._def.checks.find((e) => e.kind === "cuid2");
3084
- }
3085
- get isULID() {
3086
- return !!this._def.checks.find((e) => e.kind === "ulid");
3087
- }
3088
- get isIP() {
3089
- return !!this._def.checks.find((e) => e.kind === "ip");
3090
- }
3091
- get isCIDR() {
3092
- return !!this._def.checks.find((e) => e.kind === "cidr");
3093
- }
3094
- get isBase64() {
3095
- return !!this._def.checks.find((e) => e.kind === "base64");
3096
- }
3097
- get isBase64url() {
3098
- return !!this._def.checks.find((e) => e.kind === "base64url");
3099
- }
3100
- get minLength() {
3101
- let e = null;
3102
- for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
3103
- return e;
3104
- }
3105
- get maxLength() {
3106
- let e = null;
3107
- for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
3108
- return e;
3109
- }
3110
- };
3111
- Pn.create = (e) => new Pn({
3112
- checks: [],
3113
- typeName: $.ZodString,
3114
- coerce: e?.coerce ?? !1,
3115
- ...X(e)
3116
- });
3117
- function Fn(e, t) {
3118
- let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
3119
- return parseInt(e.toFixed(i).replace(".", "")) % parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
3120
- }
3121
- var In = class e extends Z {
3122
- constructor() {
3123
- super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
3124
- }
3125
- _parse(e) {
3126
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== U.number) {
3127
- let t = this._getOrReturnCtx(e);
3128
- return G(t, {
3129
- code: W.invalid_type,
3130
- expected: U.number,
3131
- received: t.parsedType
3132
- }), q;
3133
- }
3134
- let t, n = new K();
3135
- for (let r of this._def.checks) r.kind === "int" ? H.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), G(t, {
3136
- code: W.invalid_type,
3137
- expected: "integer",
3138
- received: "float",
3139
- message: r.message
3140
- }), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), G(t, {
3141
- code: W.too_small,
3142
- minimum: r.value,
3143
- type: "number",
3144
- inclusive: r.inclusive,
3145
- exact: !1,
3146
- message: r.message
3147
- }), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), G(t, {
3148
- code: W.too_big,
3149
- maximum: r.value,
3150
- type: "number",
3151
- inclusive: r.inclusive,
3152
- exact: !1,
3153
- message: r.message
3154
- }), n.dirty()) : r.kind === "multipleOf" ? Fn(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), G(t, {
3155
- code: W.not_multiple_of,
3156
- multipleOf: r.value,
3157
- message: r.message
3158
- }), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), G(t, {
3159
- code: W.not_finite,
3160
- message: r.message
3161
- }), n.dirty()) : H.assertNever(r);
3162
- return {
3163
- status: n.value,
3164
- value: e.data
3165
- };
3166
- }
3167
- gte(e, t) {
3168
- return this.setLimit("min", e, !0, Y.toString(t));
3169
- }
3170
- gt(e, t) {
3171
- return this.setLimit("min", e, !1, Y.toString(t));
3172
- }
3173
- lte(e, t) {
3174
- return this.setLimit("max", e, !0, Y.toString(t));
3175
- }
3176
- lt(e, t) {
3177
- return this.setLimit("max", e, !1, Y.toString(t));
3178
- }
3179
- setLimit(t, n, r, i) {
3180
- return new e({
3181
- ...this._def,
3182
- checks: [...this._def.checks, {
3183
- kind: t,
3184
- value: n,
3185
- inclusive: r,
3186
- message: Y.toString(i)
3187
- }]
3188
- });
3189
- }
3190
- _addCheck(t) {
3191
- return new e({
3192
- ...this._def,
3193
- checks: [...this._def.checks, t]
3194
- });
3195
- }
3196
- int(e) {
3197
- return this._addCheck({
3198
- kind: "int",
3199
- message: Y.toString(e)
3200
- });
3201
- }
3202
- positive(e) {
3203
- return this._addCheck({
3204
- kind: "min",
3205
- value: 0,
3206
- inclusive: !1,
3207
- message: Y.toString(e)
3208
- });
3209
- }
3210
- negative(e) {
3211
- return this._addCheck({
3212
- kind: "max",
3213
- value: 0,
3214
- inclusive: !1,
3215
- message: Y.toString(e)
3216
- });
3217
- }
3218
- nonpositive(e) {
3219
- return this._addCheck({
3220
- kind: "max",
3221
- value: 0,
3222
- inclusive: !0,
3223
- message: Y.toString(e)
3224
- });
3225
- }
3226
- nonnegative(e) {
3227
- return this._addCheck({
3228
- kind: "min",
3229
- value: 0,
3230
- inclusive: !0,
3231
- message: Y.toString(e)
3232
- });
3233
- }
3234
- multipleOf(e, t) {
3235
- return this._addCheck({
3236
- kind: "multipleOf",
3237
- value: e,
3238
- message: Y.toString(t)
3239
- });
3240
- }
3241
- finite(e) {
3242
- return this._addCheck({
3243
- kind: "finite",
3244
- message: Y.toString(e)
3245
- });
3246
- }
3247
- safe(e) {
3248
- return this._addCheck({
3249
- kind: "min",
3250
- inclusive: !0,
3251
- value: -(2 ** 53 - 1),
3252
- message: Y.toString(e)
3253
- })._addCheck({
3254
- kind: "max",
3255
- inclusive: !0,
3256
- value: 2 ** 53 - 1,
3257
- message: Y.toString(e)
3258
- });
3259
- }
3260
- get minValue() {
3261
- let e = null;
3262
- for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
3263
- return e;
3264
- }
3265
- get maxValue() {
3266
- let e = null;
3267
- for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
3268
- return e;
3269
- }
3270
- get isInt() {
3271
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && H.isInteger(e.value));
3272
- }
3273
- get isFinite() {
3274
- let e = null, t = null;
3275
- for (let n of this._def.checks) if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf") return !0;
3276
- else n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
3277
- return Number.isFinite(t) && Number.isFinite(e);
3278
- }
3279
- };
3280
- In.create = (e) => new In({
3281
- checks: [],
3282
- typeName: $.ZodNumber,
3283
- coerce: e?.coerce || !1,
3284
- ...X(e)
3285
- });
3286
- var Ln = class e extends Z {
3287
- constructor() {
3288
- super(...arguments), this.min = this.gte, this.max = this.lte;
3289
- }
3290
- _parse(e) {
3291
- if (this._def.coerce) try {
3292
- e.data = BigInt(e.data);
3293
- } catch {
3294
- return this._getInvalidInput(e);
3295
- }
3296
- if (this._getType(e) !== U.bigint) return this._getInvalidInput(e);
3297
- let t, n = new K();
3298
- for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), G(t, {
3299
- code: W.too_small,
3300
- type: "bigint",
3301
- minimum: r.value,
3302
- inclusive: r.inclusive,
3303
- message: r.message
3304
- }), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), G(t, {
3305
- code: W.too_big,
3306
- type: "bigint",
3307
- maximum: r.value,
3308
- inclusive: r.inclusive,
3309
- message: r.message
3310
- }), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), G(t, {
3311
- code: W.not_multiple_of,
3312
- multipleOf: r.value,
3313
- message: r.message
3314
- }), n.dirty()) : H.assertNever(r);
3315
- return {
3316
- status: n.value,
3317
- value: e.data
3318
- };
3319
- }
3320
- _getInvalidInput(e) {
3321
- let t = this._getOrReturnCtx(e);
3322
- return G(t, {
3323
- code: W.invalid_type,
3324
- expected: U.bigint,
3325
- received: t.parsedType
3326
- }), q;
3327
- }
3328
- gte(e, t) {
3329
- return this.setLimit("min", e, !0, Y.toString(t));
3330
- }
3331
- gt(e, t) {
3332
- return this.setLimit("min", e, !1, Y.toString(t));
3333
- }
3334
- lte(e, t) {
3335
- return this.setLimit("max", e, !0, Y.toString(t));
3336
- }
3337
- lt(e, t) {
3338
- return this.setLimit("max", e, !1, Y.toString(t));
3339
- }
3340
- setLimit(t, n, r, i) {
3341
- return new e({
3342
- ...this._def,
3343
- checks: [...this._def.checks, {
3344
- kind: t,
3345
- value: n,
3346
- inclusive: r,
3347
- message: Y.toString(i)
3348
- }]
3349
- });
3350
- }
3351
- _addCheck(t) {
3352
- return new e({
3353
- ...this._def,
3354
- checks: [...this._def.checks, t]
3355
- });
3356
- }
3357
- positive(e) {
3358
- return this._addCheck({
3359
- kind: "min",
3360
- value: BigInt(0),
3361
- inclusive: !1,
3362
- message: Y.toString(e)
3363
- });
3364
- }
3365
- negative(e) {
3366
- return this._addCheck({
3367
- kind: "max",
3368
- value: BigInt(0),
3369
- inclusive: !1,
3370
- message: Y.toString(e)
3371
- });
3372
- }
3373
- nonpositive(e) {
3374
- return this._addCheck({
3375
- kind: "max",
3376
- value: BigInt(0),
3377
- inclusive: !0,
3378
- message: Y.toString(e)
3379
- });
3380
- }
3381
- nonnegative(e) {
3382
- return this._addCheck({
3383
- kind: "min",
3384
- value: BigInt(0),
3385
- inclusive: !0,
3386
- message: Y.toString(e)
3387
- });
3388
- }
3389
- multipleOf(e, t) {
3390
- return this._addCheck({
3391
- kind: "multipleOf",
3392
- value: e,
3393
- message: Y.toString(t)
3394
- });
3395
- }
3396
- get minValue() {
3397
- let e = null;
3398
- for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
3399
- return e;
3400
- }
3401
- get maxValue() {
3402
- let e = null;
3403
- for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
3404
- return e;
3405
- }
3406
- };
3407
- Ln.create = (e) => new Ln({
3408
- checks: [],
3409
- typeName: $.ZodBigInt,
3410
- coerce: e?.coerce ?? !1,
3411
- ...X(e)
3412
- });
3413
- var Rn = class extends Z {
3414
- _parse(e) {
3415
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== U.boolean) {
3416
- let t = this._getOrReturnCtx(e);
3417
- return G(t, {
3418
- code: W.invalid_type,
3419
- expected: U.boolean,
3420
- received: t.parsedType
3421
- }), q;
3422
- }
3423
- return J(e.data);
3424
- }
3425
- };
3426
- Rn.create = (e) => new Rn({
3427
- typeName: $.ZodBoolean,
3428
- coerce: e?.coerce || !1,
3429
- ...X(e)
3430
- });
3431
- var zn = class e extends Z {
3432
- _parse(e) {
3433
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== U.date) {
3434
- let t = this._getOrReturnCtx(e);
3435
- return G(t, {
3436
- code: W.invalid_type,
3437
- expected: U.date,
3438
- received: t.parsedType
3439
- }), q;
3440
- }
3441
- if (isNaN(e.data.getTime())) return G(this._getOrReturnCtx(e), { code: W.invalid_date }), q;
3442
- let t = new K(), n;
3443
- for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), G(n, {
3444
- code: W.too_small,
3445
- message: r.message,
3446
- inclusive: !0,
3447
- exact: !1,
3448
- minimum: r.value,
3449
- type: "date"
3450
- }), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), G(n, {
3451
- code: W.too_big,
3452
- message: r.message,
3453
- inclusive: !0,
3454
- exact: !1,
3455
- maximum: r.value,
3456
- type: "date"
3457
- }), t.dirty()) : H.assertNever(r);
3458
- return {
3459
- status: t.value,
3460
- value: new Date(e.data.getTime())
3461
- };
3462
- }
3463
- _addCheck(t) {
3464
- return new e({
3465
- ...this._def,
3466
- checks: [...this._def.checks, t]
3467
- });
3468
- }
3469
- min(e, t) {
3470
- return this._addCheck({
3471
- kind: "min",
3472
- value: e.getTime(),
3473
- message: Y.toString(t)
3474
- });
3475
- }
3476
- max(e, t) {
3477
- return this._addCheck({
3478
- kind: "max",
3479
- value: e.getTime(),
3480
- message: Y.toString(t)
3481
- });
3482
- }
3483
- get minDate() {
3484
- let e = null;
3485
- for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
3486
- return e == null ? null : new Date(e);
3487
- }
3488
- get maxDate() {
3489
- let e = null;
3490
- for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
3491
- return e == null ? null : new Date(e);
3492
- }
3493
- };
3494
- zn.create = (e) => new zn({
3495
- checks: [],
3496
- coerce: e?.coerce || !1,
3497
- typeName: $.ZodDate,
3498
- ...X(e)
3499
- });
3500
- var Bn = class extends Z {
3501
- _parse(e) {
3502
- if (this._getType(e) !== U.symbol) {
3503
- let t = this._getOrReturnCtx(e);
3504
- return G(t, {
3505
- code: W.invalid_type,
3506
- expected: U.symbol,
3507
- received: t.parsedType
3508
- }), q;
3509
- }
3510
- return J(e.data);
3511
- }
3512
- };
3513
- Bn.create = (e) => new Bn({
3514
- typeName: $.ZodSymbol,
3515
- ...X(e)
3516
- });
3517
- var Vn = class extends Z {
3518
- _parse(e) {
3519
- if (this._getType(e) !== U.undefined) {
3520
- let t = this._getOrReturnCtx(e);
3521
- return G(t, {
3522
- code: W.invalid_type,
3523
- expected: U.undefined,
3524
- received: t.parsedType
3525
- }), q;
3526
- }
3527
- return J(e.data);
3528
- }
3529
- };
3530
- Vn.create = (e) => new Vn({
3531
- typeName: $.ZodUndefined,
3532
- ...X(e)
3533
- });
3534
- var Hn = class extends Z {
3535
- _parse(e) {
3536
- if (this._getType(e) !== U.null) {
3537
- let t = this._getOrReturnCtx(e);
3538
- return G(t, {
3539
- code: W.invalid_type,
3540
- expected: U.null,
3541
- received: t.parsedType
3542
- }), q;
3543
- }
3544
- return J(e.data);
3545
- }
3546
- };
3547
- Hn.create = (e) => new Hn({
3548
- typeName: $.ZodNull,
3549
- ...X(e)
3550
- });
3551
- var Un = class extends Z {
3552
- constructor() {
3553
- super(...arguments), this._any = !0;
3554
- }
3555
- _parse(e) {
3556
- return J(e.data);
3557
- }
3558
- };
3559
- Un.create = (e) => new Un({
3560
- typeName: $.ZodAny,
3561
- ...X(e)
3562
- });
3563
- var Wn = class extends Z {
3564
- constructor() {
3565
- super(...arguments), this._unknown = !0;
3566
- }
3567
- _parse(e) {
3568
- return J(e.data);
3569
- }
3570
- };
3571
- Wn.create = (e) => new Wn({
3572
- typeName: $.ZodUnknown,
3573
- ...X(e)
3574
- });
3575
- var Gn = class extends Z {
3576
- _parse(e) {
3577
- let t = this._getOrReturnCtx(e);
3578
- return G(t, {
3579
- code: W.invalid_type,
3580
- expected: U.never,
3581
- received: t.parsedType
3582
- }), q;
3583
- }
3584
- };
3585
- Gn.create = (e) => new Gn({
3586
- typeName: $.ZodNever,
3587
- ...X(e)
3588
- });
3589
- var Kn = class extends Z {
3590
- _parse(e) {
3591
- if (this._getType(e) !== U.undefined) {
3592
- let t = this._getOrReturnCtx(e);
3593
- return G(t, {
3594
- code: W.invalid_type,
3595
- expected: U.void,
3596
- received: t.parsedType
3597
- }), q;
3598
- }
3599
- return J(e.data);
3600
- }
3601
- };
3602
- Kn.create = (e) => new Kn({
3603
- typeName: $.ZodVoid,
3604
- ...X(e)
3605
- });
3606
- var qn = class e extends Z {
3607
- _parse(e) {
3608
- let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
3609
- if (t.parsedType !== U.array) return G(t, {
3610
- code: W.invalid_type,
3611
- expected: U.array,
3612
- received: t.parsedType
3613
- }), q;
3614
- if (r.exactLength !== null) {
3615
- let e = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value;
3616
- (e || i) && (G(t, {
3617
- code: e ? W.too_big : W.too_small,
3618
- minimum: i ? r.exactLength.value : void 0,
3619
- maximum: e ? r.exactLength.value : void 0,
3620
- type: "array",
3621
- inclusive: !0,
3622
- exact: !0,
3623
- message: r.exactLength.message
3624
- }), n.dirty());
3625
- }
3626
- if (r.minLength !== null && t.data.length < r.minLength.value && (G(t, {
3627
- code: W.too_small,
3628
- minimum: r.minLength.value,
3629
- type: "array",
3630
- inclusive: !0,
3631
- exact: !1,
3632
- message: r.minLength.message
3633
- }), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (G(t, {
3634
- code: W.too_big,
3635
- maximum: r.maxLength.value,
3636
- type: "array",
3637
- inclusive: !0,
3638
- exact: !1,
3639
- message: r.maxLength.message
3640
- }), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new cn(t, e, t.path, n)))).then((e) => K.mergeArray(n, e));
3641
- let i = [...t.data].map((e, n) => r.type._parseSync(new cn(t, e, t.path, n)));
3642
- return K.mergeArray(n, i);
3643
- }
3644
- get element() {
3645
- return this._def.type;
3646
- }
3647
- min(t, n) {
3648
- return new e({
3649
- ...this._def,
3650
- minLength: {
3651
- value: t,
3652
- message: Y.toString(n)
3653
- }
3654
- });
3655
- }
3656
- max(t, n) {
3657
- return new e({
3658
- ...this._def,
3659
- maxLength: {
3660
- value: t,
3661
- message: Y.toString(n)
3662
- }
3663
- });
3664
- }
3665
- length(t, n) {
3666
- return new e({
3667
- ...this._def,
3668
- exactLength: {
3669
- value: t,
3670
- message: Y.toString(n)
3671
- }
3672
- });
3673
- }
3674
- nonempty(e) {
3675
- return this.min(1, e);
3676
- }
3677
- };
3678
- qn.create = (e, t) => new qn({
3679
- type: e,
3680
- minLength: null,
3681
- maxLength: null,
3682
- exactLength: null,
3683
- typeName: $.ZodArray,
3684
- ...X(t)
3685
- });
3686
- function Jn(e) {
3687
- if (e instanceof Q) {
3688
- let t = {};
3689
- for (let n in e.shape) {
3690
- let r = e.shape[n];
3691
- t[n] = fr.create(Jn(r));
3692
- }
3693
- return new Q({
3694
- ...e._def,
3695
- shape: () => t
3696
- });
3697
- } else if (e instanceof qn) return new qn({
3698
- ...e._def,
3699
- type: Jn(e.element)
3700
- });
3701
- else if (e instanceof fr) return fr.create(Jn(e.unwrap()));
3702
- else if (e instanceof pr) return pr.create(Jn(e.unwrap()));
3703
- else if (e instanceof er) return er.create(e.items.map((e) => Jn(e)));
3704
- else return e;
3705
- }
3706
- var Q = class e extends Z {
3707
- constructor() {
3708
- super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
3709
- }
3710
- _getCached() {
3711
- if (this._cached !== null) return this._cached;
3712
- let e = this._def.shape(), t = H.objectKeys(e);
3713
- return this._cached = {
3714
- shape: e,
3715
- keys: t
3716
- };
3717
- }
3718
- _parse(e) {
3719
- if (this._getType(e) !== U.object) {
3720
- let t = this._getOrReturnCtx(e);
3721
- return G(t, {
3722
- code: W.invalid_type,
3723
- expected: U.object,
3724
- received: t.parsedType
3725
- }), q;
3726
- }
3727
- let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
3728
- if (!(this._def.catchall instanceof Gn && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
3729
- let o = [];
3730
- for (let e of i) {
3731
- let t = r[e], i = n.data[e];
3732
- o.push({
3733
- key: {
3734
- status: "valid",
3735
- value: e
3736
- },
3737
- value: t._parse(new cn(n, i, n.path, e)),
3738
- alwaysSet: e in n.data
3739
- });
3740
- }
3741
- if (this._def.catchall instanceof Gn) {
3742
- let e = this._def.unknownKeys;
3743
- if (e === "passthrough") for (let e of a) o.push({
3744
- key: {
3745
- status: "valid",
3746
- value: e
3747
- },
3748
- value: {
3749
- status: "valid",
3750
- value: n.data[e]
3751
- }
3752
- });
3753
- else if (e === "strict") a.length > 0 && (G(n, {
3754
- code: W.unrecognized_keys,
3755
- keys: a
3756
- }), t.dirty());
3757
- else if (e !== "strip") throw Error("Internal ZodObject error: invalid unknownKeys value.");
3758
- } else {
3759
- let e = this._def.catchall;
3760
- for (let t of a) {
3761
- let r = n.data[t];
3762
- o.push({
3763
- key: {
3764
- status: "valid",
3765
- value: t
3766
- },
3767
- value: e._parse(new cn(n, r, n.path, t)),
3768
- alwaysSet: t in n.data
3769
- });
3770
- }
3771
- }
3772
- return n.common.async ? Promise.resolve().then(async () => {
3773
- let e = [];
3774
- for (let t of o) {
3775
- let n = await t.key, r = await t.value;
3776
- e.push({
3777
- key: n,
3778
- value: r,
3779
- alwaysSet: t.alwaysSet
3780
- });
3781
- }
3782
- return e;
3783
- }).then((e) => K.mergeObjectSync(t, e)) : K.mergeObjectSync(t, o);
3784
- }
3785
- get shape() {
3786
- return this._def.shape();
3787
- }
3788
- strict(t) {
3789
- return Y.errToObj, new e({
3790
- ...this._def,
3791
- unknownKeys: "strict",
3792
- ...t === void 0 ? {} : { errorMap: (e, n) => {
3793
- var r;
3794
- let i = (r = this._def).errorMap?.call(r, e, n).message ?? n.defaultError;
3795
- return e.code === "unrecognized_keys" ? { message: Y.errToObj(t).message ?? i } : { message: i };
3796
- } }
3797
- });
3798
- }
3799
- strip() {
3800
- return new e({
3801
- ...this._def,
3802
- unknownKeys: "strip"
3803
- });
3804
- }
3805
- passthrough() {
3806
- return new e({
3807
- ...this._def,
3808
- unknownKeys: "passthrough"
3809
- });
3810
- }
3811
- extend(t) {
3812
- return new e({
3813
- ...this._def,
3814
- shape: () => ({
3815
- ...this._def.shape(),
3816
- ...t
3817
- })
3818
- });
3819
- }
3820
- merge(t) {
3821
- return new e({
3822
- unknownKeys: t._def.unknownKeys,
3823
- catchall: t._def.catchall,
3824
- shape: () => ({
3825
- ...this._def.shape(),
3826
- ...t._def.shape()
3827
- }),
3828
- typeName: $.ZodObject
3829
- });
3830
- }
3831
- setKey(e, t) {
3832
- return this.augment({ [e]: t });
3833
- }
3834
- catchall(t) {
3835
- return new e({
3836
- ...this._def,
3837
- catchall: t
3838
- });
3839
- }
3840
- pick(t) {
3841
- let n = {};
3842
- return H.objectKeys(t).forEach((e) => {
3843
- t[e] && this.shape[e] && (n[e] = this.shape[e]);
3844
- }), new e({
3845
- ...this._def,
3846
- shape: () => n
3847
- });
3848
- }
3849
- omit(t) {
3850
- let n = {};
3851
- return H.objectKeys(this.shape).forEach((e) => {
3852
- t[e] || (n[e] = this.shape[e]);
3853
- }), new e({
3854
- ...this._def,
3855
- shape: () => n
3856
- });
3857
- }
3858
- deepPartial() {
3859
- return Jn(this);
3860
- }
3861
- partial(t) {
3862
- let n = {};
3863
- return H.objectKeys(this.shape).forEach((e) => {
3864
- let r = this.shape[e];
3865
- t && !t[e] ? n[e] = r : n[e] = r.optional();
3866
- }), new e({
3867
- ...this._def,
3868
- shape: () => n
3869
- });
3870
- }
3871
- required(t) {
3872
- let n = {};
3873
- return H.objectKeys(this.shape).forEach((e) => {
3874
- if (t && !t[e]) n[e] = this.shape[e];
3875
- else {
3876
- let t = this.shape[e];
3877
- for (; t instanceof fr;) t = t._def.innerType;
3878
- n[e] = t;
3879
- }
3880
- }), new e({
3881
- ...this._def,
3882
- shape: () => n
3883
- });
3884
- }
3885
- keyof() {
3886
- return sr(H.objectKeys(this.shape));
3887
- }
3888
- };
3889
- Q.create = (e, t) => new Q({
3890
- shape: () => e,
3891
- unknownKeys: "strip",
3892
- catchall: Gn.create(),
3893
- typeName: $.ZodObject,
3894
- ...X(t)
3895
- }), Q.strictCreate = (e, t) => new Q({
3896
- shape: () => e,
3897
- unknownKeys: "strict",
3898
- catchall: Gn.create(),
3899
- typeName: $.ZodObject,
3900
- ...X(t)
3901
- }), Q.lazycreate = (e, t) => new Q({
3902
- shape: e,
3903
- unknownKeys: "strip",
3904
- catchall: Gn.create(),
3905
- typeName: $.ZodObject,
3906
- ...X(t)
3907
- });
3908
- var Yn = class extends Z {
3909
- _parse(e) {
3910
- let { ctx: t } = this._processInputParams(e), n = this._def.options;
3911
- function r(e) {
3912
- for (let t of e) if (t.result.status === "valid") return t.result;
3913
- for (let n of e) if (n.result.status === "dirty") return t.common.issues.push(...n.ctx.common.issues), n.result;
3914
- let n = e.map((e) => new qt(e.ctx.common.issues));
3915
- return G(t, {
3916
- code: W.invalid_union,
3917
- unionErrors: n
3918
- }), q;
3919
- }
3920
- if (t.common.async) return Promise.all(n.map(async (e) => {
3921
- let n = {
3922
- ...t,
3923
- common: {
3924
- ...t.common,
3925
- issues: []
3926
- },
3927
- parent: null
3928
- };
3929
- return {
3930
- result: await e._parseAsync({
3931
- data: t.data,
3932
- path: t.path,
3933
- parent: n
3934
- }),
3935
- ctx: n
3936
- };
3937
- })).then(r);
3938
- {
3939
- let e, r = [];
3940
- for (let i of n) {
3941
- let n = {
3942
- ...t,
3943
- common: {
3944
- ...t.common,
3945
- issues: []
3946
- },
3947
- parent: null
3948
- }, a = i._parseSync({
3949
- data: t.data,
3950
- path: t.path,
3951
- parent: n
3952
- });
3953
- if (a.status === "valid") return a;
3954
- a.status === "dirty" && !e && (e = {
3955
- result: a,
3956
- ctx: n
3957
- }), n.common.issues.length && r.push(n.common.issues);
3958
- }
3959
- if (e) return t.common.issues.push(...e.ctx.common.issues), e.result;
3960
- let i = r.map((e) => new qt(e));
3961
- return G(t, {
3962
- code: W.invalid_union,
3963
- unionErrors: i
3964
- }), q;
3965
- }
3966
- }
3967
- get options() {
3968
- return this._def.options;
3969
- }
3970
- };
3971
- Yn.create = (e, t) => new Yn({
3972
- options: e,
3973
- typeName: $.ZodUnion,
3974
- ...X(t)
3975
- });
3976
- var Xn = (e) => e instanceof ar ? Xn(e.schema) : e instanceof dr ? Xn(e.innerType()) : e instanceof or ? [e.value] : e instanceof cr ? e.options : e instanceof lr ? H.objectValues(e.enum) : e instanceof mr ? Xn(e._def.innerType) : e instanceof Vn ? [void 0] : e instanceof Hn ? [null] : e instanceof fr ? [void 0, ...Xn(e.unwrap())] : e instanceof pr ? [null, ...Xn(e.unwrap())] : e instanceof _r || e instanceof yr ? Xn(e.unwrap()) : e instanceof hr ? Xn(e._def.innerType) : [], Zn = class e extends Z {
3977
- _parse(e) {
3978
- let { ctx: t } = this._processInputParams(e);
3979
- if (t.parsedType !== U.object) return G(t, {
3980
- code: W.invalid_type,
3981
- expected: U.object,
3982
- received: t.parsedType
3983
- }), q;
3984
- let n = this.discriminator, r = t.data[n], i = this.optionsMap.get(r);
3985
- return i ? t.common.async ? i._parseAsync({
3986
- data: t.data,
3987
- path: t.path,
3988
- parent: t
3989
- }) : i._parseSync({
3990
- data: t.data,
3991
- path: t.path,
3992
- parent: t
3993
- }) : (G(t, {
3994
- code: W.invalid_union_discriminator,
3995
- options: Array.from(this.optionsMap.keys()),
3996
- path: [n]
3997
- }), q);
3998
- }
3999
- get discriminator() {
4000
- return this._def.discriminator;
4001
- }
4002
- get options() {
4003
- return this._def.options;
4004
- }
4005
- get optionsMap() {
4006
- return this._def.optionsMap;
4007
- }
4008
- static create(t, n, r) {
4009
- let i = /* @__PURE__ */ new Map();
4010
- for (let e of n) {
4011
- let n = Xn(e.shape[t]);
4012
- if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
4013
- for (let r of n) {
4014
- if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
4015
- i.set(r, e);
4016
- }
4017
- }
4018
- return new e({
4019
- typeName: $.ZodDiscriminatedUnion,
4020
- discriminator: t,
4021
- options: n,
4022
- optionsMap: i,
4023
- ...X(r)
4024
- });
4025
- }
4026
- };
4027
- function Qn(e, t) {
4028
- let n = Kt(e), r = Kt(t);
4029
- if (e === t) return {
4030
- valid: !0,
4031
- data: e
4032
- };
4033
- if (n === U.object && r === U.object) {
4034
- let n = H.objectKeys(t), r = H.objectKeys(e).filter((e) => n.indexOf(e) !== -1), i = {
4035
- ...e,
4036
- ...t
4037
- };
4038
- for (let n of r) {
4039
- let r = Qn(e[n], t[n]);
4040
- if (!r.valid) return { valid: !1 };
4041
- i[n] = r.data;
4042
- }
4043
- return {
4044
- valid: !0,
4045
- data: i
4046
- };
4047
- } else if (n === U.array && r === U.array) {
4048
- if (e.length !== t.length) return { valid: !1 };
4049
- let n = [];
4050
- for (let r = 0; r < e.length; r++) {
4051
- let i = e[r], a = t[r], o = Qn(i, a);
4052
- if (!o.valid) return { valid: !1 };
4053
- n.push(o.data);
4054
- }
4055
- return {
4056
- valid: !0,
4057
- data: n
4058
- };
4059
- } else if (n === U.date && r === U.date && +e == +t) return {
4060
- valid: !0,
4061
- data: e
4062
- };
4063
- else return { valid: !1 };
4064
- }
4065
- var $n = class extends Z {
4066
- _parse(e) {
4067
- let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
4068
- if ($t(e) || $t(r)) return q;
4069
- let i = Qn(e.value, r.value);
4070
- return i.valid ? ((en(e) || en(r)) && t.dirty(), {
4071
- status: t.value,
4072
- value: i.data
4073
- }) : (G(n, { code: W.invalid_intersection_types }), q);
4074
- };
4075
- return n.common.async ? Promise.all([this._def.left._parseAsync({
4076
- data: n.data,
4077
- path: n.path,
4078
- parent: n
4079
- }), this._def.right._parseAsync({
4080
- data: n.data,
4081
- path: n.path,
4082
- parent: n
4083
- })]).then(([e, t]) => r(e, t)) : r(this._def.left._parseSync({
4084
- data: n.data,
4085
- path: n.path,
4086
- parent: n
4087
- }), this._def.right._parseSync({
4088
- data: n.data,
4089
- path: n.path,
4090
- parent: n
4091
- }));
4092
- }
4093
- };
4094
- $n.create = (e, t, n) => new $n({
4095
- left: e,
4096
- right: t,
4097
- typeName: $.ZodIntersection,
4098
- ...X(n)
4099
- });
4100
- var er = class e extends Z {
4101
- _parse(e) {
4102
- let { status: t, ctx: n } = this._processInputParams(e);
4103
- if (n.parsedType !== U.array) return G(n, {
4104
- code: W.invalid_type,
4105
- expected: U.array,
4106
- received: n.parsedType
4107
- }), q;
4108
- if (n.data.length < this._def.items.length) return G(n, {
4109
- code: W.too_small,
4110
- minimum: this._def.items.length,
4111
- inclusive: !0,
4112
- exact: !1,
4113
- type: "array"
4114
- }), q;
4115
- !this._def.rest && n.data.length > this._def.items.length && (G(n, {
4116
- code: W.too_big,
4117
- maximum: this._def.items.length,
4118
- inclusive: !0,
4119
- exact: !1,
4120
- type: "array"
4121
- }), t.dirty());
4122
- let r = [...n.data].map((e, t) => {
4123
- let r = this._def.items[t] || this._def.rest;
4124
- return r ? r._parse(new cn(n, e, n.path, t)) : null;
4125
- }).filter((e) => !!e);
4126
- return n.common.async ? Promise.all(r).then((e) => K.mergeArray(t, e)) : K.mergeArray(t, r);
4127
- }
4128
- get items() {
4129
- return this._def.items;
4130
- }
4131
- rest(t) {
4132
- return new e({
4133
- ...this._def,
4134
- rest: t
4135
- });
4136
- }
4137
- };
4138
- er.create = (e, t) => {
4139
- if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
4140
- return new er({
4141
- items: e,
4142
- typeName: $.ZodTuple,
4143
- rest: null,
4144
- ...X(t)
4145
- });
4146
- };
4147
- var tr = class e extends Z {
4148
- get keySchema() {
4149
- return this._def.keyType;
4150
- }
4151
- get valueSchema() {
4152
- return this._def.valueType;
4153
- }
4154
- _parse(e) {
4155
- let { status: t, ctx: n } = this._processInputParams(e);
4156
- if (n.parsedType !== U.object) return G(n, {
4157
- code: W.invalid_type,
4158
- expected: U.object,
4159
- received: n.parsedType
4160
- }), q;
4161
- let r = [], i = this._def.keyType, a = this._def.valueType;
4162
- for (let e in n.data) r.push({
4163
- key: i._parse(new cn(n, e, n.path, e)),
4164
- value: a._parse(new cn(n, n.data[e], n.path, e)),
4165
- alwaysSet: e in n.data
4166
- });
4167
- return n.common.async ? K.mergeObjectAsync(t, r) : K.mergeObjectSync(t, r);
4168
- }
4169
- get element() {
4170
- return this._def.valueType;
4171
- }
4172
- static create(t, n, r) {
4173
- return n instanceof Z ? new e({
4174
- keyType: t,
4175
- valueType: n,
4176
- typeName: $.ZodRecord,
4177
- ...X(r)
4178
- }) : new e({
4179
- keyType: Pn.create(),
4180
- valueType: t,
4181
- typeName: $.ZodRecord,
4182
- ...X(n)
4183
- });
4184
- }
4185
- }, nr = class extends Z {
4186
- get keySchema() {
4187
- return this._def.keyType;
4188
- }
4189
- get valueSchema() {
4190
- return this._def.valueType;
4191
- }
4192
- _parse(e) {
4193
- let { status: t, ctx: n } = this._processInputParams(e);
4194
- if (n.parsedType !== U.map) return G(n, {
4195
- code: W.invalid_type,
4196
- expected: U.map,
4197
- received: n.parsedType
4198
- }), q;
4199
- let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({
4200
- key: r._parse(new cn(n, e, n.path, [a, "key"])),
4201
- value: i._parse(new cn(n, t, n.path, [a, "value"]))
4202
- }));
4203
- if (n.common.async) {
4204
- let e = /* @__PURE__ */ new Map();
4205
- return Promise.resolve().then(async () => {
4206
- for (let n of a) {
4207
- let r = await n.key, i = await n.value;
4208
- if (r.status === "aborted" || i.status === "aborted") return q;
4209
- (r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
4210
- }
4211
- return {
4212
- status: t.value,
4213
- value: e
4214
- };
4215
- });
4216
- } else {
4217
- let e = /* @__PURE__ */ new Map();
4218
- for (let n of a) {
4219
- let r = n.key, i = n.value;
4220
- if (r.status === "aborted" || i.status === "aborted") return q;
4221
- (r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
4222
- }
4223
- return {
4224
- status: t.value,
4225
- value: e
4226
- };
4227
- }
4228
- }
4229
- };
4230
- nr.create = (e, t, n) => new nr({
4231
- valueType: t,
4232
- keyType: e,
4233
- typeName: $.ZodMap,
4234
- ...X(n)
4235
- });
4236
- var rr = class e extends Z {
4237
- _parse(e) {
4238
- let { status: t, ctx: n } = this._processInputParams(e);
4239
- if (n.parsedType !== U.set) return G(n, {
4240
- code: W.invalid_type,
4241
- expected: U.set,
4242
- received: n.parsedType
4243
- }), q;
4244
- let r = this._def;
4245
- r.minSize !== null && n.data.size < r.minSize.value && (G(n, {
4246
- code: W.too_small,
4247
- minimum: r.minSize.value,
4248
- type: "set",
4249
- inclusive: !0,
4250
- exact: !1,
4251
- message: r.minSize.message
4252
- }), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (G(n, {
4253
- code: W.too_big,
4254
- maximum: r.maxSize.value,
4255
- type: "set",
4256
- inclusive: !0,
4257
- exact: !1,
4258
- message: r.maxSize.message
4259
- }), t.dirty());
4260
- let i = this._def.valueType;
4261
- function a(e) {
4262
- let n = /* @__PURE__ */ new Set();
4263
- for (let r of e) {
4264
- if (r.status === "aborted") return q;
4265
- r.status === "dirty" && t.dirty(), n.add(r.value);
4266
- }
4267
- return {
4268
- status: t.value,
4269
- value: n
4270
- };
4271
- }
4272
- let o = [...n.data.values()].map((e, t) => i._parse(new cn(n, e, n.path, t)));
4273
- return n.common.async ? Promise.all(o).then((e) => a(e)) : a(o);
4274
- }
4275
- min(t, n) {
4276
- return new e({
4277
- ...this._def,
4278
- minSize: {
4279
- value: t,
4280
- message: Y.toString(n)
4281
- }
4282
- });
4283
- }
4284
- max(t, n) {
4285
- return new e({
4286
- ...this._def,
4287
- maxSize: {
4288
- value: t,
4289
- message: Y.toString(n)
4290
- }
4291
- });
4292
- }
4293
- size(e, t) {
4294
- return this.min(e, t).max(e, t);
4295
- }
4296
- nonempty(e) {
4297
- return this.min(1, e);
4298
- }
4299
- };
4300
- rr.create = (e, t) => new rr({
4301
- valueType: e,
4302
- minSize: null,
4303
- maxSize: null,
4304
- typeName: $.ZodSet,
4305
- ...X(t)
4306
- });
4307
- var ir = class e extends Z {
4308
- constructor() {
4309
- super(...arguments), this.validate = this.implement;
4310
- }
4311
- _parse(e) {
4312
- let { ctx: t } = this._processInputParams(e);
4313
- if (t.parsedType !== U.function) return G(t, {
4314
- code: W.invalid_type,
4315
- expected: U.function,
4316
- received: t.parsedType
4317
- }), q;
4318
- function n(e, n) {
4319
- return Zt({
4320
- data: e,
4321
- path: t.path,
4322
- errorMaps: [
4323
- t.common.contextualErrorMap,
4324
- t.schemaErrorMap,
4325
- Xt(),
4326
- Jt
4327
- ].filter((e) => !!e),
4328
- issueData: {
4329
- code: W.invalid_arguments,
4330
- argumentsError: n
4331
- }
4332
- });
4333
- }
4334
- function r(e, n) {
4335
- return Zt({
4336
- data: e,
4337
- path: t.path,
4338
- errorMaps: [
4339
- t.common.contextualErrorMap,
4340
- t.schemaErrorMap,
4341
- Xt(),
4342
- Jt
4343
- ].filter((e) => !!e),
4344
- issueData: {
4345
- code: W.invalid_return_type,
4346
- returnTypeError: n
4347
- }
4348
- });
4349
- }
4350
- let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
4351
- if (this._def.returns instanceof ur) {
4352
- let e = this;
4353
- return J(async function(...t) {
4354
- let o = new qt([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
4355
- throw o.addIssue(n(t, e)), o;
4356
- }), c = await Reflect.apply(a, this, s);
4357
- return await e._def.returns._def.type.parseAsync(c, i).catch((e) => {
4358
- throw o.addIssue(r(c, e)), o;
4359
- });
4360
- });
4361
- } else {
4362
- let e = this;
4363
- return J(function(...t) {
4364
- let o = e._def.args.safeParse(t, i);
4365
- if (!o.success) throw new qt([n(t, o.error)]);
4366
- let s = Reflect.apply(a, this, o.data), c = e._def.returns.safeParse(s, i);
4367
- if (!c.success) throw new qt([r(s, c.error)]);
4368
- return c.data;
4369
- });
4370
- }
4371
- }
4372
- parameters() {
4373
- return this._def.args;
4374
- }
4375
- returnType() {
4376
- return this._def.returns;
4377
- }
4378
- args(...t) {
4379
- return new e({
4380
- ...this._def,
4381
- args: er.create(t).rest(Wn.create())
4382
- });
4383
- }
4384
- returns(t) {
4385
- return new e({
4386
- ...this._def,
4387
- returns: t
4388
- });
4389
- }
4390
- implement(e) {
4391
- return this.parse(e);
4392
- }
4393
- strictImplement(e) {
4394
- return this.parse(e);
4395
- }
4396
- static create(t, n, r) {
4397
- return new e({
4398
- args: t || er.create([]).rest(Wn.create()),
4399
- returns: n || Wn.create(),
4400
- typeName: $.ZodFunction,
4401
- ...X(r)
4402
- });
4403
- }
4404
- }, ar = class extends Z {
4405
- get schema() {
4406
- return this._def.getter();
4407
- }
4408
- _parse(e) {
4409
- let { ctx: t } = this._processInputParams(e);
4410
- return this._def.getter()._parse({
4411
- data: t.data,
4412
- path: t.path,
4413
- parent: t
4414
- });
4415
- }
4416
- };
4417
- ar.create = (e, t) => new ar({
4418
- getter: e,
4419
- typeName: $.ZodLazy,
4420
- ...X(t)
4421
- });
4422
- var or = class extends Z {
4423
- _parse(e) {
4424
- if (e.data !== this._def.value) {
4425
- let t = this._getOrReturnCtx(e);
4426
- return G(t, {
4427
- received: t.data,
4428
- code: W.invalid_literal,
4429
- expected: this._def.value
4430
- }), q;
4431
- }
4432
- return {
4433
- status: "valid",
4434
- value: e.data
4435
- };
4436
- }
4437
- get value() {
4438
- return this._def.value;
4439
- }
4440
- };
4441
- or.create = (e, t) => new or({
4442
- value: e,
4443
- typeName: $.ZodLiteral,
4444
- ...X(t)
4445
- });
4446
- function sr(e, t) {
4447
- return new cr({
4448
- values: e,
4449
- typeName: $.ZodEnum,
4450
- ...X(t)
4451
- });
4452
- }
4453
- var cr = class e extends Z {
4454
- constructor() {
4455
- super(...arguments), on.set(this, void 0);
4456
- }
4457
- _parse(e) {
4458
- if (typeof e.data != "string") {
4459
- let t = this._getOrReturnCtx(e), n = this._def.values;
4460
- return G(t, {
4461
- expected: H.joinValues(n),
4462
- received: t.parsedType,
4463
- code: W.invalid_type
4464
- }), q;
4465
- }
4466
- if (rn(this, on, "f") || an(this, on, new Set(this._def.values), "f"), !rn(this, on, "f").has(e.data)) {
4467
- let t = this._getOrReturnCtx(e), n = this._def.values;
4468
- return G(t, {
4469
- received: t.data,
4470
- code: W.invalid_enum_value,
4471
- options: n
4472
- }), q;
4473
- }
4474
- return J(e.data);
4475
- }
4476
- get options() {
4477
- return this._def.values;
4478
- }
4479
- get enum() {
4480
- let e = {};
4481
- for (let t of this._def.values) e[t] = t;
4482
- return e;
4483
- }
4484
- get Values() {
4485
- let e = {};
4486
- for (let t of this._def.values) e[t] = t;
4487
- return e;
4488
- }
4489
- get Enum() {
4490
- let e = {};
4491
- for (let t of this._def.values) e[t] = t;
4492
- return e;
4493
- }
4494
- extract(t, n = this._def) {
4495
- return e.create(t, {
4496
- ...this._def,
4497
- ...n
4498
- });
4499
- }
4500
- exclude(t, n = this._def) {
4501
- return e.create(this.options.filter((e) => !t.includes(e)), {
4502
- ...this._def,
4503
- ...n
4504
- });
4505
- }
4506
- };
4507
- on = /* @__PURE__ */ new WeakMap(), cr.create = sr;
4508
- var lr = class extends Z {
4509
- constructor() {
4510
- super(...arguments), sn.set(this, void 0);
4511
- }
4512
- _parse(e) {
4513
- let t = H.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
4514
- if (n.parsedType !== U.string && n.parsedType !== U.number) {
4515
- let e = H.objectValues(t);
4516
- return G(n, {
4517
- expected: H.joinValues(e),
4518
- received: n.parsedType,
4519
- code: W.invalid_type
4520
- }), q;
4521
- }
4522
- if (rn(this, sn, "f") || an(this, sn, new Set(H.getValidEnumValues(this._def.values)), "f"), !rn(this, sn, "f").has(e.data)) {
4523
- let e = H.objectValues(t);
4524
- return G(n, {
4525
- received: n.data,
4526
- code: W.invalid_enum_value,
4527
- options: e
4528
- }), q;
4529
- }
4530
- return J(e.data);
4531
- }
4532
- get enum() {
4533
- return this._def.values;
4534
- }
4535
- };
4536
- sn = /* @__PURE__ */ new WeakMap(), lr.create = (e, t) => new lr({
4537
- values: e,
4538
- typeName: $.ZodNativeEnum,
4539
- ...X(t)
4540
- });
4541
- var ur = class extends Z {
4542
- unwrap() {
4543
- return this._def.type;
4544
- }
4545
- _parse(e) {
4546
- let { ctx: t } = this._processInputParams(e);
4547
- return t.parsedType !== U.promise && t.common.async === !1 ? (G(t, {
4548
- code: W.invalid_type,
4549
- expected: U.promise,
4550
- received: t.parsedType
4551
- }), q) : J((t.parsedType === U.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, {
4552
- path: t.path,
4553
- errorMap: t.common.contextualErrorMap
4554
- })));
4555
- }
4556
- };
4557
- ur.create = (e, t) => new ur({
4558
- type: e,
4559
- typeName: $.ZodPromise,
4560
- ...X(t)
4561
- });
4562
- var dr = class extends Z {
4563
- innerType() {
4564
- return this._def.schema;
4565
- }
4566
- sourceType() {
4567
- return this._def.schema._def.typeName === $.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
4568
- }
4569
- _parse(e) {
4570
- let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
4571
- addIssue: (e) => {
4572
- G(n, e), e.fatal ? t.abort() : t.dirty();
4573
- },
4574
- get path() {
4575
- return n.path;
4576
- }
4577
- };
4578
- if (i.addIssue = i.addIssue.bind(i), r.type === "preprocess") {
4579
- let e = r.transform(n.data, i);
4580
- if (n.common.async) return Promise.resolve(e).then(async (e) => {
4581
- if (t.value === "aborted") return q;
4582
- let r = await this._def.schema._parseAsync({
4583
- data: e,
4584
- path: n.path,
4585
- parent: n
4586
- });
4587
- return r.status === "aborted" ? q : r.status === "dirty" || t.value === "dirty" ? Qt(r.value) : r;
4588
- });
4589
- {
4590
- if (t.value === "aborted") return q;
4591
- let r = this._def.schema._parseSync({
4592
- data: e,
4593
- path: n.path,
4594
- parent: n
4595
- });
4596
- return r.status === "aborted" ? q : r.status === "dirty" || t.value === "dirty" ? Qt(r.value) : r;
4597
- }
4598
- }
4599
- if (r.type === "refinement") {
4600
- let e = (e) => {
4601
- let t = r.refinement(e, i);
4602
- if (n.common.async) return Promise.resolve(t);
4603
- if (t instanceof Promise) throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
4604
- return e;
4605
- };
4606
- if (n.common.async === !1) {
4607
- let r = this._def.schema._parseSync({
4608
- data: n.data,
4609
- path: n.path,
4610
- parent: n
4611
- });
4612
- return r.status === "aborted" ? q : (r.status === "dirty" && t.dirty(), e(r.value), {
4613
- status: t.value,
4614
- value: r.value
4615
- });
4616
- } else return this._def.schema._parseAsync({
4617
- data: n.data,
4618
- path: n.path,
4619
- parent: n
4620
- }).then((n) => n.status === "aborted" ? q : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
4621
- status: t.value,
4622
- value: n.value
4623
- }))));
4624
- }
4625
- if (r.type === "transform") if (n.common.async === !1) {
4626
- let e = this._def.schema._parseSync({
4627
- data: n.data,
4628
- path: n.path,
4629
- parent: n
4630
- });
4631
- if (!tn(e)) return e;
4632
- let a = r.transform(e.value, i);
4633
- if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
4634
- return {
4635
- status: t.value,
4636
- value: a
4637
- };
4638
- } else return this._def.schema._parseAsync({
4639
- data: n.data,
4640
- path: n.path,
4641
- parent: n
4642
- }).then((e) => tn(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
4643
- status: t.value,
4644
- value: e
4645
- })) : e);
4646
- H.assertNever(r);
4647
- }
4648
- };
4649
- dr.create = (e, t, n) => new dr({
4650
- schema: e,
4651
- typeName: $.ZodEffects,
4652
- effect: t,
4653
- ...X(n)
4654
- }), dr.createWithPreprocess = (e, t, n) => new dr({
4655
- schema: t,
4656
- effect: {
4657
- type: "preprocess",
4658
- transform: e
4659
- },
4660
- typeName: $.ZodEffects,
4661
- ...X(n)
4662
- });
4663
- var fr = class extends Z {
4664
- _parse(e) {
4665
- return this._getType(e) === U.undefined ? J(void 0) : this._def.innerType._parse(e);
4666
- }
4667
- unwrap() {
4668
- return this._def.innerType;
4669
- }
4670
- };
4671
- fr.create = (e, t) => new fr({
4672
- innerType: e,
4673
- typeName: $.ZodOptional,
4674
- ...X(t)
4675
- });
4676
- var pr = class extends Z {
4677
- _parse(e) {
4678
- return this._getType(e) === U.null ? J(null) : this._def.innerType._parse(e);
4679
- }
4680
- unwrap() {
4681
- return this._def.innerType;
4682
- }
4683
- };
4684
- pr.create = (e, t) => new pr({
4685
- innerType: e,
4686
- typeName: $.ZodNullable,
4687
- ...X(t)
4688
- });
4689
- var mr = class extends Z {
4690
- _parse(e) {
4691
- let { ctx: t } = this._processInputParams(e), n = t.data;
4692
- return t.parsedType === U.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
4693
- data: n,
4694
- path: t.path,
4695
- parent: t
4696
- });
4697
- }
4698
- removeDefault() {
4699
- return this._def.innerType;
4700
- }
4701
- };
4702
- mr.create = (e, t) => new mr({
4703
- innerType: e,
4704
- typeName: $.ZodDefault,
4705
- defaultValue: typeof t.default == "function" ? t.default : () => t.default,
4706
- ...X(t)
4707
- });
4708
- var hr = class extends Z {
4709
- _parse(e) {
4710
- let { ctx: t } = this._processInputParams(e), n = {
4711
- ...t,
4712
- common: {
4713
- ...t.common,
4714
- issues: []
4715
- }
4716
- }, r = this._def.innerType._parse({
4717
- data: n.data,
4718
- path: n.path,
4719
- parent: { ...n }
4720
- });
4721
- return nn(r) ? r.then((e) => ({
4722
- status: "valid",
4723
- value: e.status === "valid" ? e.value : this._def.catchValue({
4724
- get error() {
4725
- return new qt(n.common.issues);
4726
- },
4727
- input: n.data
4728
- })
4729
- })) : {
4730
- status: "valid",
4731
- value: r.status === "valid" ? r.value : this._def.catchValue({
4732
- get error() {
4733
- return new qt(n.common.issues);
4734
- },
4735
- input: n.data
4736
- })
4737
- };
4738
- }
4739
- removeCatch() {
4740
- return this._def.innerType;
4741
- }
4742
- };
4743
- hr.create = (e, t) => new hr({
4744
- innerType: e,
4745
- typeName: $.ZodCatch,
4746
- catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
4747
- ...X(t)
4748
- });
4749
- var gr = class extends Z {
4750
- _parse(e) {
4751
- if (this._getType(e) !== U.nan) {
4752
- let t = this._getOrReturnCtx(e);
4753
- return G(t, {
4754
- code: W.invalid_type,
4755
- expected: U.nan,
4756
- received: t.parsedType
4757
- }), q;
4758
- }
4759
- return {
4760
- status: "valid",
4761
- value: e.data
4762
- };
4763
- }
4764
- };
4765
- gr.create = (e) => new gr({
4766
- typeName: $.ZodNaN,
4767
- ...X(e)
4768
- });
4769
- var _r = class extends Z {
4770
- _parse(e) {
4771
- let { ctx: t } = this._processInputParams(e), n = t.data;
4772
- return this._def.type._parse({
4773
- data: n,
4774
- path: t.path,
4775
- parent: t
4776
- });
4777
- }
4778
- unwrap() {
4779
- return this._def.type;
4780
- }
4781
- }, vr = class e extends Z {
4782
- _parse(e) {
4783
- let { status: t, ctx: n } = this._processInputParams(e);
4784
- if (n.common.async) return (async () => {
4785
- let e = await this._def.in._parseAsync({
4786
- data: n.data,
4787
- path: n.path,
4788
- parent: n
4789
- });
4790
- return e.status === "aborted" ? q : e.status === "dirty" ? (t.dirty(), Qt(e.value)) : this._def.out._parseAsync({
4791
- data: e.value,
4792
- path: n.path,
4793
- parent: n
4794
- });
4795
- })();
4796
- {
4797
- let e = this._def.in._parseSync({
4798
- data: n.data,
4799
- path: n.path,
4800
- parent: n
4801
- });
4802
- return e.status === "aborted" ? q : e.status === "dirty" ? (t.dirty(), {
4803
- status: "dirty",
4804
- value: e.value
4805
- }) : this._def.out._parseSync({
4806
- data: e.value,
4807
- path: n.path,
4808
- parent: n
4809
- });
4810
- }
4811
- }
4812
- static create(t, n) {
4813
- return new e({
4814
- in: t,
4815
- out: n,
4816
- typeName: $.ZodPipeline
4817
- });
4818
- }
4819
- }, yr = class extends Z {
4820
- _parse(e) {
4821
- let t = this._def.innerType._parse(e), n = (e) => (tn(e) && (e.value = Object.freeze(e.value)), e);
4822
- return nn(t) ? t.then((e) => n(e)) : n(t);
4823
- }
4824
- unwrap() {
4825
- return this._def.innerType;
4826
- }
4827
- };
4828
- yr.create = (e, t) => new yr({
4829
- innerType: e,
4830
- typeName: $.ZodReadonly,
4831
- ...X(t)
4832
- }), Q.lazycreate;
4833
- var $;
4834
- (function(e) {
4835
- e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
4836
- })($ ||= {});
4837
- var br = Pn.create;
4838
- In.create, gr.create, Ln.create;
4839
- var xr = Rn.create, Sr = zn.create;
4840
- Bn.create, Vn.create, Hn.create, Un.create, Wn.create, Gn.create, Kn.create;
4841
- var Cr = qn.create, wr = Q.create;
4842
- Q.strictCreate, Yn.create, Zn.create, $n.create, er.create, tr.create, nr.create, rr.create, ir.create, ar.create, or.create, cr.create, lr.create, ur.create, dr.create, fr.create, pr.create;
4843
- var Tr = dr.createWithPreprocess;
4844
- vr.create;
4845
- var Er = {
4846
- string: ((e) => Pn.create({
4847
- ...e,
4848
- coerce: !0
4849
- })),
4850
- number: ((e) => In.create({
4851
- ...e,
4852
- coerce: !0
4853
- })),
4854
- boolean: ((e) => Rn.create({
4855
- ...e,
4856
- coerce: !0
4857
- })),
4858
- bigint: ((e) => Ln.create({
4859
- ...e,
4860
- coerce: !0
4861
- })),
4862
- date: ((e) => zn.create({
4863
- ...e,
4864
- coerce: !0
4865
- }))
4866
- }, Dr = (e) => e !== null && !!e && typeof e == "object" && !Array.isArray(e);
4867
- function Or(e) {
4868
- return Number(e) >= 0;
4869
- }
4870
- function kr(e) {
4871
- return typeof e == "object" && !!e;
4872
- }
4873
- function Ar(e) {
4874
- return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
4875
- }
4876
- function jr(e) {
4877
- if (!kr(e) || Ar(e) !== "[object Object]") return !1;
4878
- if (Object.getPrototypeOf(e) === null) return !0;
4879
- let t = e;
4880
- for (; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
4881
- return Object.getPrototypeOf(e) === t;
4882
- }
4883
- function Mr(e, t) {
4884
- return Object.keys(t).forEach((n) => {
4885
- if (jr(t[n]) && jr(e[n])) {
4886
- e[n] || (e[n] = {}), Mr(e[n], t[n]);
4887
- return;
4888
- }
4889
- e[n] = t[n];
4890
- }), e;
4891
- }
4892
- function Nr(e) {
4893
- let t = e.split(".");
4894
- if (!t.length) return "";
4895
- let n = String(t[0]);
4896
- for (let e = 1; e < t.length; e++) {
4897
- if (Or(t[e])) {
4898
- n += `[${t[e]}]`;
4899
- continue;
4900
- }
4901
- n += `.${t[e]}`;
4902
- }
4903
- return n;
4904
- }
4905
- function Pr(e, t) {
4906
- return {
4907
- __type: "VVTypedSchema",
4908
- async parse(n) {
4909
- let r = await e.safeParseAsync(n, t);
4910
- if (r.success) return {
4911
- value: r.data,
4912
- errors: []
4913
- };
4914
- let i = {};
4915
- return Fr(r.error.issues, i), { errors: Object.values(i) };
4916
- },
4917
- cast(t) {
4918
- try {
4919
- return e.parse(t);
4920
- } catch {
4921
- let n = Ir(e);
4922
- return Dr(n) && Dr(t) ? Mr(n, t) : t;
4923
- }
4924
- },
4925
- describe(t) {
4926
- try {
4927
- if (!t) return {
4928
- required: !e.isOptional(),
4929
- exists: !0
4930
- };
4931
- let n = Lr(t, e);
4932
- return n ? {
4933
- required: !n.isOptional(),
4934
- exists: !0
4935
- } : {
4936
- required: !1,
4937
- exists: !1
4938
- };
4939
- } catch {
4940
- return process.env.NODE_ENV !== "production" && console.warn(`Failed to describe path ${t} on the schema, returning a default description.`), {
4941
- required: !1,
4942
- exists: !1
4943
- };
4944
- }
4945
- }
4946
- };
4947
- }
4948
- function Fr(e, t) {
4949
- e.forEach((e) => {
4950
- let n = Nr(e.path.join("."));
4951
- e.code === "invalid_union" && (Fr(e.unionErrors.flatMap((e) => e.issues), t), !n) || (t[n] || (t[n] = {
4952
- errors: [],
4953
- path: n
4954
- }), t[n].errors.push(e.message));
4955
- });
4956
- }
4957
- function Ir(e) {
4958
- if (e instanceof Q) return Object.fromEntries(Object.entries(e.shape).map(([e, t]) => t instanceof mr ? [e, t._def.defaultValue()] : t instanceof Q ? [e, Ir(t)] : [e, void 0]));
4959
- }
4960
- function Lr(e, t) {
4961
- if (!Br(t)) return null;
4962
- if (j(e)) return t.shape[Se(e)];
4963
- let n = (e || "").split(/\.|\[(\d+)\]/).filter(Boolean), r = t;
4964
- for (let e = 0; e <= n.length; e++) {
4965
- let t = n[e];
4966
- if (!t || !r) return r;
4967
- if (Br(r)) {
4968
- r = r.shape[t] || null;
4969
- continue;
4970
- }
4971
- Or(t) && zr(r) && (r = r._def.type);
4972
- }
4973
- return null;
4974
- }
4975
- function Rr(e) {
4976
- return e._def.typeName;
4977
- }
4978
- function zr(e) {
4979
- return Rr(e) === $.ZodArray;
4980
- }
4981
- function Br(e) {
4982
- return Rr(e) === $.ZodObject;
4983
- }
4984
- //#endregion
4985
- export { Sr as a, br as c, Ut as d, Er as i, Dt as l, Cr as n, wr as o, xr as r, Tr as s, Pr as t, zt as u };