ics-ui-kit 0.1.19 → 1.0.0-alpha.1

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 (325) hide show
  1. package/README.md +36 -36
  2. package/dist/AlertContext-CxjW1LVL.js.map +1 -1
  3. package/dist/AlertIcon-BphnEYvV.js.map +1 -1
  4. package/dist/{Button-BZ3ON1Tj.js → Button-_qdP4hSf.js} +2 -2
  5. package/dist/Button-_qdP4hSf.js.map +1 -0
  6. package/dist/{ButtonBase-jgu7EolU.js → ButtonBase-CbWrYcx-.js} +2 -2
  7. package/dist/ButtonBase-CbWrYcx-.js.map +1 -0
  8. package/dist/{CheckboxField-limFbMk2.js → CheckboxField-xDqHgXHh.js} +32 -32
  9. package/dist/CheckboxField-xDqHgXHh.js.map +1 -0
  10. package/dist/Combination-DeIugdgY.js.map +1 -1
  11. package/dist/{Command-B7ZRyW8w.js → Command-WsAKNQrY.js} +8 -8
  12. package/dist/Command-WsAKNQrY.js.map +1 -0
  13. package/dist/ComponentVariantProvider-brk0g-hm.js.map +1 -1
  14. package/dist/Description-BTPMlTT-.js.map +1 -1
  15. package/dist/{Dialog-CdnsGyJD.js → Dialog-i_Y-phdM.js} +42 -43
  16. package/dist/Dialog-i_Y-phdM.js.map +1 -0
  17. package/dist/Divider-DPW5ZhZ8.js.map +1 -1
  18. package/dist/EmptyState-DRKjscH-.js.map +1 -1
  19. package/dist/ErrorState-B26k67-z.js.map +1 -1
  20. package/dist/FeatureIcon-BGE0Orkc.js.map +1 -1
  21. package/dist/{Field-CP_-li9L.js → Field-BcwUtgGr.js} +2 -2
  22. package/dist/Field-BcwUtgGr.js.map +1 -0
  23. package/dist/{FieldLabel-eyKmeWRn.js → FieldLabel-DYu1AcGH.js} +2 -2
  24. package/dist/FieldLabel-DYu1AcGH.js.map +1 -0
  25. package/dist/FolderSvg-cw0DxNVy.js.map +1 -1
  26. package/dist/{FormFooterTemplate-DdNnLu2-.js → FormFooterTemplate-CHlas_Pp.js} +5 -5
  27. package/dist/FormFooterTemplate-CHlas_Pp.js.map +1 -0
  28. package/dist/{FormHeader--F6b2aRk.js → FormHeader-PE63OqG9.js} +3 -3
  29. package/dist/FormHeader-PE63OqG9.js.map +1 -0
  30. package/dist/FormStack-DfoaOry7.js +1205 -0
  31. package/dist/FormStack-DfoaOry7.js.map +1 -0
  32. package/dist/HintState-BxrCAWqq.js.map +1 -1
  33. package/dist/Icon-DH3ev9GK.js.map +1 -1
  34. package/dist/{IconButton-uGJ3cQtk.js → IconButton-DAg1oMwz.js} +2 -2
  35. package/dist/IconButton-DAg1oMwz.js.map +1 -0
  36. package/dist/{IconTooltip-RSxvnBgH.js → IconTooltip-R6_6_f40.js} +2 -2
  37. package/dist/IconTooltip-R6_6_f40.js.map +1 -0
  38. package/dist/Indicator-AqxHWPA9.js.map +1 -1
  39. package/dist/{InputGroup-AVAtosX_.js → InputGroup-CW55G5nE.js} +5 -5
  40. package/dist/InputGroup-CW55G5nE.js.map +1 -0
  41. package/dist/{InputOTP-B2e1nfSO.js → InputOTP-DkVh6bBz.js} +2 -2
  42. package/dist/InputOTP-DkVh6bBz.js.map +1 -0
  43. package/dist/Loader-BpHiL6W-.js.map +1 -1
  44. package/dist/{MenuItem-d19Ty84F.js → MenuItem-C51uFz3V.js} +11 -11
  45. package/dist/MenuItem-C51uFz3V.js.map +1 -0
  46. package/dist/MenuItemShortcut-D1faeIXp.js.map +1 -1
  47. package/dist/MenuItemText-CRpaPbvg.js.map +1 -1
  48. package/dist/{Overlay-CVt011mY.js → Overlay-E0UvxzIc.js} +2 -2
  49. package/dist/Overlay-E0UvxzIc.js.map +1 -0
  50. package/dist/{Popover-KjZXxxl3.js → Popover-XrJa7lyb.js} +51 -52
  51. package/dist/Popover-XrJa7lyb.js.map +1 -0
  52. package/dist/{RichButton-B1wjK7Bk.js → RichButton-Bt0yUShU.js} +2 -2
  53. package/dist/RichButton-Bt0yUShU.js.map +1 -0
  54. package/dist/ScrollArea-CuuTeDn3.js.map +1 -1
  55. package/dist/ScrollShadowContainer-DdrnF8qU.js.map +1 -1
  56. package/dist/{SearchSelectTag-CA7Ie3Nx.js → SearchSelectTag-Dp5_OvZp.js} +16 -16
  57. package/dist/SearchSelectTag-Dp5_OvZp.js.map +1 -0
  58. package/dist/{Select-D9juHX8o.js → Select-DO02vXt3.js} +189 -190
  59. package/dist/Select-DO02vXt3.js.map +1 -0
  60. package/dist/{Sheet-qTIXsqm0.js → Sheet-C2UoHLL0.js} +40 -41
  61. package/dist/Sheet-C2UoHLL0.js.map +1 -0
  62. package/dist/Shortcut-D8L15_ed.js.map +1 -1
  63. package/dist/Skeleton-y6I-i9q5.js.map +1 -1
  64. package/dist/{TableFillHandle-C_yvCTSl.js → TableFillHandle-CHHoUi6s.js} +7 -7
  65. package/dist/TableFillHandle-CHHoUi6s.js.map +1 -0
  66. package/dist/{Tag-DdHXTyKF.js → Tag-Cf6HftP-.js} +4 -4
  67. package/dist/Tag-Cf6HftP-.js.map +1 -0
  68. package/dist/Text-DeBE8AKl.js.map +1 -1
  69. package/dist/{TextInput-5BuZtWV6.js → TextInput-CoL8nOyt.js} +3 -3
  70. package/dist/TextInput-CoL8nOyt.js.map +1 -0
  71. package/dist/{TextOverflowTooltip-B1I5qwAT.js → TextOverflowTooltip-XPDdO9Dz.js} +2 -2
  72. package/dist/{TextOverflowTooltip-B1I5qwAT.js.map → TextOverflowTooltip-XPDdO9Dz.js.map} +1 -1
  73. package/dist/{Toggle-v_HT3Gm2.js → Toggle-CmalMf4O.js} +2 -2
  74. package/dist/Toggle-CmalMf4O.js.map +1 -0
  75. package/dist/{Tooltip-7Duaau0S.js → Tooltip-D2XvRS0c.js} +64 -65
  76. package/dist/Tooltip-D2XvRS0c.js.map +1 -0
  77. package/dist/{TriggerButton-Bakr8Boi.js → TriggerButton-CoAgB4lx.js} +2 -2
  78. package/dist/TriggerButton-CoAgB4lx.js.map +1 -0
  79. package/dist/blocks/auth/otp-form.js +3240 -204
  80. package/dist/blocks/auth/otp-form.js.map +1 -1
  81. package/dist/cn-dsXlqdJg.js.map +1 -1
  82. package/dist/components/alert-dialog/AlertDialog.d.ts +2 -4
  83. package/dist/components/alert-dialog.js +71 -72
  84. package/dist/components/alert-dialog.js.map +1 -1
  85. package/dist/components/alert.js +1 -1
  86. package/dist/components/alert.js.map +1 -1
  87. package/dist/components/avatar.js.map +1 -1
  88. package/dist/components/background-pattern.js.map +1 -1
  89. package/dist/components/badge.js.map +1 -1
  90. package/dist/components/banner.js.map +1 -1
  91. package/dist/components/breadcrumb.js.map +1 -1
  92. package/dist/components/button.js +5 -5
  93. package/dist/components/button.js.map +1 -1
  94. package/dist/components/calendar.js +2889 -71
  95. package/dist/components/calendar.js.map +1 -1
  96. package/dist/components/card.js +2 -2
  97. package/dist/components/card.js.map +1 -1
  98. package/dist/components/carousel.js +1 -1
  99. package/dist/components/carousel.js.map +1 -1
  100. package/dist/components/checkbox.js +1 -1
  101. package/dist/components/collapsible.js.map +1 -1
  102. package/dist/components/color-tile.js.map +1 -1
  103. package/dist/components/command.js +1 -1
  104. package/dist/components/container.js.map +1 -1
  105. package/dist/components/context-menu.js +6 -6
  106. package/dist/components/context-menu.js.map +1 -1
  107. package/dist/components/counter.js +1 -1
  108. package/dist/components/counter.js.map +1 -1
  109. package/dist/components/dialog/Dialog.d.ts +2 -4
  110. package/dist/components/dialog.js +3 -3
  111. package/dist/components/dialog.js.map +1 -1
  112. package/dist/components/divider.js.map +1 -1
  113. package/dist/components/drawer/components/drawer-content/DrawerContent.d.ts +1 -2
  114. package/dist/components/drawer.js +98 -99
  115. package/dist/components/drawer.js.map +1 -1
  116. package/dist/components/dropdown/Dropdown.d.ts +2 -4
  117. package/dist/components/dropdown.js +258 -259
  118. package/dist/components/dropdown.js.map +1 -1
  119. package/dist/components/error-state.js +1 -1
  120. package/dist/components/error-state.js.map +1 -1
  121. package/dist/components/field.js +1 -1
  122. package/dist/components/file-upload.js +3 -3
  123. package/dist/components/file-upload.js.map +1 -1
  124. package/dist/components/form/Form.d.ts +14 -0
  125. package/dist/components/form/components/form-field/FormField.d.ts +4 -0
  126. package/dist/components/form.js +5 -5
  127. package/dist/components/form.js.map +1 -1
  128. package/dist/components/glass-toolbar.js +6 -6
  129. package/dist/components/glass-toolbar.js.map +1 -1
  130. package/dist/components/icon-tooltip.js +1 -1
  131. package/dist/components/image-placeholder.js.map +1 -1
  132. package/dist/components/image-preview.js +2 -2
  133. package/dist/components/image-preview.js.map +1 -1
  134. package/dist/components/image-uploader.js +1 -1
  135. package/dist/components/image-uploader.js.map +1 -1
  136. package/dist/components/input-otp.js +1 -1
  137. package/dist/components/input.js +5 -5
  138. package/dist/components/input.js.map +1 -1
  139. package/dist/components/label.js +1 -1
  140. package/dist/components/menu-item.js +6 -6
  141. package/dist/components/menu-item.js.map +1 -1
  142. package/dist/components/overflow-tooltip.js +1 -1
  143. package/dist/components/overlay.js +1 -1
  144. package/dist/components/page-state.js +7 -7
  145. package/dist/components/page-state.js.map +1 -1
  146. package/dist/components/popover/Popover.d.ts +1 -2
  147. package/dist/components/popover.js +1 -1
  148. package/dist/components/progress-circle.js +1 -1
  149. package/dist/components/progress-circle.js.map +1 -1
  150. package/dist/components/progress.js +3 -3
  151. package/dist/components/progress.js.map +1 -1
  152. package/dist/components/prose.js.map +1 -1
  153. package/dist/components/radio-group.js +1 -1
  154. package/dist/components/radio-group.js.map +1 -1
  155. package/dist/components/resizable/Resizable.d.ts +1 -1
  156. package/dist/components/resizable.js +1 -1
  157. package/dist/components/resizable.js.map +1 -1
  158. package/dist/components/scheduler.js +1 -1
  159. package/dist/components/scheduler.js.map +1 -1
  160. package/dist/components/search-select/multi-select/MultiSelect.d.ts +1 -1
  161. package/dist/components/search-select.js +4 -4
  162. package/dist/components/search-select.js.map +1 -1
  163. package/dist/components/select/Select.d.ts +1 -2
  164. package/dist/components/select.js +1 -1
  165. package/dist/components/sheet/Sheet.d.ts +1 -2
  166. package/dist/components/sheet.js +1 -1
  167. package/dist/components/sidebar.js +90 -90
  168. package/dist/components/sidebar.js.map +1 -1
  169. package/dist/components/slider.js +1 -1
  170. package/dist/components/slider.js.map +1 -1
  171. package/dist/components/stepper.js +1 -1
  172. package/dist/components/stepper.js.map +1 -1
  173. package/dist/components/switch.js +2 -2
  174. package/dist/components/switch.js.map +1 -1
  175. package/dist/components/system-state.js +1 -1
  176. package/dist/components/system-state.js.map +1 -1
  177. package/dist/components/table/editable/editableCell.d.ts +2 -2
  178. package/dist/components/table/editable.js +1 -1
  179. package/dist/components/table/tree.js +1 -1
  180. package/dist/components/table.js +2 -2
  181. package/dist/components/tabs.js +2 -2
  182. package/dist/components/tabs.js.map +1 -1
  183. package/dist/components/tag-input.js +5 -5
  184. package/dist/components/tag-input.js.map +1 -1
  185. package/dist/components/tag.js +1 -1
  186. package/dist/components/textarea.js +1 -1
  187. package/dist/components/textarea.js.map +1 -1
  188. package/dist/components/timer.js.map +1 -1
  189. package/dist/components/toast.js +6 -6
  190. package/dist/components/toast.js.map +1 -1
  191. package/dist/components/toggle-group.js +1 -1
  192. package/dist/components/toggle-group.js.map +1 -1
  193. package/dist/components/toggle.js +1 -1
  194. package/dist/components/toolbar.js +1 -1
  195. package/dist/components/toolbar.js.map +1 -1
  196. package/dist/components/tooltip/Tooltip.d.ts +2 -4
  197. package/dist/components/tooltip.js +1 -1
  198. package/dist/design-tokens.source.json +1 -0
  199. package/dist/docs/tailwind-utilities/ScrollFade.stories.d.ts +28 -0
  200. package/dist/docs/tailwind-utilities/Shimmer.stories.d.ts +32 -0
  201. package/dist/floating-ui.react-dom-BwDfy92G.js.map +1 -1
  202. package/dist/font-smoothing.css +4 -0
  203. package/dist/formatBytes-C4QXq5lC.js.map +1 -1
  204. package/dist/index-0ioNhtNM.js.map +1 -1
  205. package/dist/index-1SnkxfPR.js.map +1 -1
  206. package/dist/index-437EL2iq.js.map +1 -1
  207. package/dist/index-BDrapWDv.js.map +1 -1
  208. package/dist/index-BGQepRFJ.js.map +1 -1
  209. package/dist/index-BVqs-uqP.js.map +1 -1
  210. package/dist/index-BZPx6jYI.js.map +1 -1
  211. package/dist/index-Bb23HztA.js.map +1 -1
  212. package/dist/index-BjtNfqNq.js.map +1 -1
  213. package/dist/index-BpWB3aFK.js.map +1 -1
  214. package/dist/index-ByaXH_ih.js.map +1 -1
  215. package/dist/index-CCKe-Mpx.js.map +1 -1
  216. package/dist/index-CFaU3UXv.js.map +1 -1
  217. package/dist/index-CLuiUUQ8.js.map +1 -1
  218. package/dist/index-CMxHunQ4.js.map +1 -1
  219. package/dist/index-CmBeyp2d.js.map +1 -1
  220. package/dist/index-DFZozV_h.js.map +1 -1
  221. package/dist/index-DHsfW5Rj.js.map +1 -1
  222. package/dist/index-DHyZ_0Ut.js.map +1 -1
  223. package/dist/index-DLcqcWxM.js.map +1 -1
  224. package/dist/index-DnnQs07z.js.map +1 -1
  225. package/dist/index-Uiy0Xwy2.js.map +1 -1
  226. package/dist/index-_ITz1IyW.js.map +1 -1
  227. package/dist/index.js.map +1 -1
  228. package/dist/{inputBaseStyles-BfZIWuQ6.js → inputBaseStyles-CZwQWSub.js} +7 -7
  229. package/dist/inputBaseStyles-CZwQWSub.js.map +1 -0
  230. package/dist/lib/utils.js.map +1 -1
  231. package/dist/opaqueCell-D95h1mFM.js.map +1 -1
  232. package/dist/tailwind.css +408 -0
  233. package/dist/theme.css +360 -360
  234. package/dist/{treeModel-BlJWP4sc.js → treeModel-CUO1A5s7.js} +11 -11
  235. package/dist/treeModel-CUO1A5s7.js.map +1 -0
  236. package/dist/types/css.d.ts +4 -4
  237. package/dist/useBreakpoints-DHvp74UL.js.map +1 -1
  238. package/dist/useDebounce-BRah78CF.js.map +1 -1
  239. package/dist/useFileUpload-Bnl3P8mP.js.map +1 -1
  240. package/dist/useItemsKeyboardNavigation-CmeOR30y.js.map +1 -1
  241. package/dist/useMergeRefs-qoKniYqT.js.map +1 -1
  242. package/package.json +28 -28
  243. package/dist/Button-BZ3ON1Tj.js.map +0 -1
  244. package/dist/ButtonBase-jgu7EolU.js.map +0 -1
  245. package/dist/CheckboxField-limFbMk2.js.map +0 -1
  246. package/dist/Command-B7ZRyW8w.js.map +0 -1
  247. package/dist/DayPicker-4hE1QEvO.js +0 -2452
  248. package/dist/DayPicker-4hE1QEvO.js.map +0 -1
  249. package/dist/Dialog-CdnsGyJD.js.map +0 -1
  250. package/dist/Field-CP_-li9L.js.map +0 -1
  251. package/dist/FieldLabel-eyKmeWRn.js.map +0 -1
  252. package/dist/FormFooterTemplate-DdNnLu2-.js.map +0 -1
  253. package/dist/FormHeader--F6b2aRk.js.map +0 -1
  254. package/dist/FormStack-Cc_ELdWL.js +0 -127
  255. package/dist/FormStack-Cc_ELdWL.js.map +0 -1
  256. package/dist/IconButton-uGJ3cQtk.js.map +0 -1
  257. package/dist/IconTooltip-RSxvnBgH.js.map +0 -1
  258. package/dist/InputGroup-AVAtosX_.js.map +0 -1
  259. package/dist/InputOTP-B2e1nfSO.js.map +0 -1
  260. package/dist/MenuItem-d19Ty84F.js.map +0 -1
  261. package/dist/Overlay-CVt011mY.js.map +0 -1
  262. package/dist/Popover-KjZXxxl3.js.map +0 -1
  263. package/dist/RichButton-B1wjK7Bk.js.map +0 -1
  264. package/dist/SearchSelectTag-CA7Ie3Nx.js.map +0 -1
  265. package/dist/Select-D9juHX8o.js.map +0 -1
  266. package/dist/Sheet-qTIXsqm0.js.map +0 -1
  267. package/dist/TableFillHandle-C_yvCTSl.js.map +0 -1
  268. package/dist/Tag-DdHXTyKF.js.map +0 -1
  269. package/dist/TextInput-5BuZtWV6.js.map +0 -1
  270. package/dist/Toggle-v_HT3Gm2.js.map +0 -1
  271. package/dist/Tooltip-7Duaau0S.js.map +0 -1
  272. package/dist/TriggerButton-Bakr8Boi.js.map +0 -1
  273. package/dist/buildMatchPatternFn-d7GTeGl_.js +0 -68
  274. package/dist/buildMatchPatternFn-d7GTeGl_.js.map +0 -1
  275. package/dist/components/portal-container/PortalContainer.d.ts +0 -10
  276. package/dist/components/portal-container/index.d.ts +0 -2
  277. package/dist/components/portal-container/portalContainerEvents.d.ts +0 -12
  278. package/dist/components/portal-container/usePortalContainer.d.ts +0 -10
  279. package/dist/components/portal-container.d.ts +0 -2
  280. package/dist/components/portal-container.js +0 -14
  281. package/dist/components/portal-container.js.map +0 -1
  282. package/dist/index.esm-CXA6i4d7.js +0 -1282
  283. package/dist/index.esm-CXA6i4d7.js.map +0 -1
  284. package/dist/inputBaseStyles-BfZIWuQ6.js.map +0 -1
  285. package/dist/lib/utils/styles.d.ts +0 -10
  286. package/dist/normalizeDates-9A3c9WYM.js +0 -32
  287. package/dist/normalizeDates-9A3c9WYM.js.map +0 -1
  288. package/dist/styles-scoped.css +0 -6605
  289. package/dist/styles-scoped.d.ts +0 -1
  290. package/dist/styles.css +0 -6594
  291. package/dist/styles.d.ts +0 -1
  292. package/dist/treeModel-BlJWP4sc.js.map +0 -1
  293. package/dist/usePortalContainer-BAIp0kSF.js +0 -44
  294. package/dist/usePortalContainer-BAIp0kSF.js.map +0 -1
  295. package/dist/vendors/date-fns/index.d.ts +0 -12
  296. package/dist/vendors/date-fns/locale/en-US/index.d.ts +0 -5
  297. package/dist/vendors/date-fns/locale/en-US.d.ts +0 -2
  298. package/dist/vendors/date-fns/locale/en-US.js +0 -372
  299. package/dist/vendors/date-fns/locale/en-US.js.map +0 -1
  300. package/dist/vendors/date-fns/locale/ru/index.d.ts +0 -5
  301. package/dist/vendors/date-fns/locale/ru.d.ts +0 -2
  302. package/dist/vendors/date-fns/locale/ru.js +0 -569
  303. package/dist/vendors/date-fns/locale/ru.js.map +0 -1
  304. package/dist/vendors/date-fns.d.ts +0 -2
  305. package/dist/vendors/date-fns.js +0 -2
  306. package/dist/vendors/date-fns.js.map +0 -1
  307. package/dist/vendors/react-day-picker/index.d.ts +0 -13
  308. package/dist/vendors/react-day-picker.d.ts +0 -2
  309. package/dist/vendors/react-day-picker.js +0 -87
  310. package/dist/vendors/react-day-picker.js.map +0 -1
  311. package/dist/vendors/react-hook-form/index.d.ts +0 -14
  312. package/dist/vendors/react-hook-form.d.ts +0 -2
  313. package/dist/vendors/react-hook-form.js +0 -19
  314. package/dist/vendors/react-hook-form.js.map +0 -1
  315. package/dist/vendors/tanstack/react-table/index.d.ts +0 -13
  316. package/dist/vendors/tanstack/react-table.d.ts +0 -2
  317. package/dist/vendors/tanstack/react-table.js +0 -2090
  318. package/dist/vendors/tanstack/react-table.js.map +0 -1
  319. package/dist/vendors/zod/index.d.ts +0 -13
  320. package/dist/vendors/zod.d.ts +0 -2
  321. package/dist/vendors/zod.js +0 -3080
  322. package/dist/vendors/zod.js.map +0 -1
  323. package/dist/zod-BMNoK3aM.js +0 -75
  324. package/dist/zod-BMNoK3aM.js.map +0 -1
  325. package/tailwind.preset.js +0 -452
@@ -0,0 +1,1205 @@
1
+ import { jsx as q } from "react/jsx-runtime";
2
+ import * as te from "react";
3
+ import b from "react";
4
+ import { S as nt } from "./index-BtQfgaSF.js";
5
+ import { T as ge } from "./index-BVqs-uqP.js";
6
+ import { F as Ot } from "./FieldLabel-DYu1AcGH.js";
7
+ import { F as Nt } from "./Field-BcwUtgGr.js";
8
+ var me = (e) => e.type === "checkbox", ae = (e) => e instanceof Date, P = (e) => e == null;
9
+ const lt = (e) => typeof e == "object";
10
+ var C = (e) => !P(e) && !Array.isArray(e) && lt(e) && !ae(e), ot = (e) => C(e) && e.target ? me(e.target) ? e.target.checked : e.target.value : e, Mt = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ut = (e, s) => e.has(Mt(s)), Ut = (e) => {
11
+ const s = e.constructor && e.constructor.prototype;
12
+ return C(s) && s.hasOwnProperty("isPrototypeOf");
13
+ }, Te = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
14
+ function O(e) {
15
+ let s;
16
+ const t = Array.isArray(e), i = typeof FileList < "u" ? e instanceof FileList : !1;
17
+ if (e instanceof Date)
18
+ s = new Date(e);
19
+ else if (e instanceof Set)
20
+ s = new Set(e);
21
+ else if (!(Te && (e instanceof Blob || i)) && (t || C(e)))
22
+ if (s = t ? [] : {}, !t && !Ut(e))
23
+ s = e;
24
+ else
25
+ for (const n in e)
26
+ e.hasOwnProperty(n) && (s[n] = O(e[n]));
27
+ else
28
+ return e;
29
+ return s;
30
+ }
31
+ var Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], E = (e) => e === void 0, f = (e, s, t) => {
32
+ if (!s || !C(e))
33
+ return t;
34
+ const i = Ae(s.split(/[,[\].]+?/)).reduce((n, l) => P(n) ? n : n[l], e);
35
+ return E(i) || i === e ? E(e[s]) ? t : e[s] : i;
36
+ }, H = (e) => typeof e == "boolean", Ie = (e) => /^\w*$/.test(e), dt = (e) => Ae(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, s, t) => {
37
+ let i = -1;
38
+ const n = Ie(s) ? [s] : dt(s), l = n.length, d = l - 1;
39
+ for (; ++i < l; ) {
40
+ const g = n[i];
41
+ let _ = t;
42
+ if (i !== d) {
43
+ const D = e[g];
44
+ _ = C(D) || Array.isArray(D) ? D : isNaN(+n[i + 1]) ? {} : [];
45
+ }
46
+ if (g === "__proto__" || g === "constructor" || g === "prototype")
47
+ return;
48
+ e[g] = _, e = e[g];
49
+ }
50
+ };
51
+ const _e = {
52
+ BLUR: "blur",
53
+ FOCUS_OUT: "focusout",
54
+ CHANGE: "change"
55
+ }, z = {
56
+ onBlur: "onBlur",
57
+ onChange: "onChange",
58
+ onSubmit: "onSubmit",
59
+ onTouched: "onTouched",
60
+ all: "all"
61
+ }, ee = {
62
+ max: "max",
63
+ min: "min",
64
+ maxLength: "maxLength",
65
+ minLength: "minLength",
66
+ pattern: "pattern",
67
+ required: "required",
68
+ validate: "validate"
69
+ }, ct = b.createContext(null), he = () => b.useContext(ct), pt = (e) => {
70
+ const { children: s, ...t } = e;
71
+ return b.createElement(ct.Provider, { value: t }, s);
72
+ };
73
+ var ft = (e, s, t, i = !0) => {
74
+ const n = {
75
+ defaultValues: s._defaultValues
76
+ };
77
+ for (const l in e)
78
+ Object.defineProperty(n, l, {
79
+ get: () => {
80
+ const d = l;
81
+ return s._proxyFormState[d] !== z.all && (s._proxyFormState[d] = !i || z.all), t && (t[d] = !0), e[d];
82
+ }
83
+ });
84
+ return n;
85
+ };
86
+ function Pt(e) {
87
+ const s = he(), { control: t = s.control, disabled: i, name: n, exact: l } = e || {}, [d, g] = b.useState(t._formState), _ = b.useRef({
88
+ isDirty: !1,
89
+ isLoading: !1,
90
+ dirtyFields: !1,
91
+ touchedFields: !1,
92
+ validatingFields: !1,
93
+ isValidating: !1,
94
+ isValid: !1,
95
+ errors: !1
96
+ }), D = b.useRef(n);
97
+ return D.current = n, b.useEffect(() => t._subscribe({
98
+ name: D.current,
99
+ formState: _.current,
100
+ exact: l,
101
+ callback: (V) => {
102
+ !i && g({
103
+ ...t._formState,
104
+ ...V
105
+ });
106
+ }
107
+ }), [t, i, l]), b.useEffect(() => {
108
+ _.current.isValid && t._setValid(!0);
109
+ }, [t]), b.useMemo(() => ft(d, t, _.current, !1), [d, t]);
110
+ }
111
+ var Q = (e) => typeof e == "string", yt = (e, s, t, i, n) => Q(e) ? (i && s.watch.add(e), f(t, e, n)) : Array.isArray(e) ? e.map((l) => (i && s.watch.add(l), f(t, l))) : (i && (s.watchAll = !0), t);
112
+ function Bt(e) {
113
+ const s = he(), { control: t = s.control, name: i, defaultValue: n, disabled: l, exact: d } = e || {}, g = b.useRef(i), _ = b.useRef(n);
114
+ g.current = i, b.useEffect(() => t._subscribe({
115
+ name: g.current,
116
+ formState: {
117
+ values: !0
118
+ },
119
+ exact: d,
120
+ callback: (w) => !l && V(yt(g.current, t._names, w.values || t._formValues, !1, _.current))
121
+ }), [t, l, d]);
122
+ const [D, V] = b.useState(t._getWatch(i, n));
123
+ return b.useEffect(() => t._removeUnmounted()), D;
124
+ }
125
+ function qt(e) {
126
+ const s = he(), { name: t, disabled: i, control: n = s.control, shouldUnregister: l } = e, d = ut(n._names.array, t), g = Bt({
127
+ control: n,
128
+ name: t,
129
+ defaultValue: f(n._formValues, t, f(n._defaultValues, t, e.defaultValue)),
130
+ exact: !0
131
+ }), _ = Pt({
132
+ control: n,
133
+ name: t,
134
+ exact: !0
135
+ }), D = b.useRef(e), V = b.useRef(n.register(t, {
136
+ ...e.rules,
137
+ value: g,
138
+ ...H(e.disabled) ? { disabled: e.disabled } : {}
139
+ })), w = b.useMemo(() => Object.defineProperties({}, {
140
+ invalid: {
141
+ enumerable: !0,
142
+ get: () => !!f(_.errors, t)
143
+ },
144
+ isDirty: {
145
+ enumerable: !0,
146
+ get: () => !!f(_.dirtyFields, t)
147
+ },
148
+ isTouched: {
149
+ enumerable: !0,
150
+ get: () => !!f(_.touchedFields, t)
151
+ },
152
+ isValidating: {
153
+ enumerable: !0,
154
+ get: () => !!f(_.validatingFields, t)
155
+ },
156
+ error: {
157
+ enumerable: !0,
158
+ get: () => f(_.errors, t)
159
+ }
160
+ }), [_, t]), v = b.useCallback((M) => V.current.onChange({
161
+ target: {
162
+ value: ot(M),
163
+ name: t
164
+ },
165
+ type: _e.CHANGE
166
+ }), [t]), X = b.useCallback(() => V.current.onBlur({
167
+ target: {
168
+ value: f(n._formValues, t),
169
+ name: t
170
+ },
171
+ type: _e.BLUR
172
+ }), [t, n._formValues]), W = b.useCallback((M) => {
173
+ const U = f(n._fields, t);
174
+ U && M && (U._f.ref = {
175
+ focus: () => M.focus(),
176
+ select: () => M.select(),
177
+ setCustomValidity: (h) => M.setCustomValidity(h),
178
+ reportValidity: () => M.reportValidity()
179
+ });
180
+ }, [n._fields, t]), L = b.useMemo(() => ({
181
+ name: t,
182
+ value: g,
183
+ ...H(i) || _.disabled ? { disabled: _.disabled || i } : {},
184
+ onChange: v,
185
+ onBlur: X,
186
+ ref: W
187
+ }), [t, i, _.disabled, v, X, W, g]);
188
+ return b.useEffect(() => {
189
+ const M = n._options.shouldUnregister || l;
190
+ n.register(t, {
191
+ ...D.current.rules,
192
+ ...H(D.current.disabled) ? { disabled: D.current.disabled } : {}
193
+ });
194
+ const U = (h, K) => {
195
+ const $ = f(n._fields, h);
196
+ $ && $._f && ($._f.mount = K);
197
+ };
198
+ if (U(t, !0), M) {
199
+ const h = O(f(n._options.defaultValues, t));
200
+ S(n._defaultValues, t, h), E(f(n._formValues, t)) && S(n._formValues, t, h);
201
+ }
202
+ return !d && n.register(t), () => {
203
+ (d ? M && !n._state.action : M) ? n.unregister(t) : U(t, !1);
204
+ };
205
+ }, [t, n, d, l]), b.useEffect(() => {
206
+ n._setDisabledField({
207
+ disabled: i,
208
+ name: t
209
+ });
210
+ }, [i, t, n]), b.useMemo(() => ({
211
+ field: L,
212
+ formState: _,
213
+ fieldState: w
214
+ }), [L, _, w]);
215
+ }
216
+ const Wt = (e) => e.render(qt(e));
217
+ var $t = (e, s, t, i, n) => s ? {
218
+ ...t[e],
219
+ types: {
220
+ ...t[e] && t[e].types ? t[e].types : {},
221
+ [i]: n || !0
222
+ }
223
+ } : {}, fe = (e) => Array.isArray(e) ? e : [e], Ye = () => {
224
+ let e = [];
225
+ return {
226
+ get observers() {
227
+ return e;
228
+ },
229
+ next: (n) => {
230
+ for (const l of e)
231
+ l.next && l.next(n);
232
+ },
233
+ subscribe: (n) => (e.push(n), {
234
+ unsubscribe: () => {
235
+ e = e.filter((l) => l !== n);
236
+ }
237
+ }),
238
+ unsubscribe: () => {
239
+ e = [];
240
+ }
241
+ };
242
+ }, Le = (e) => P(e) || !lt(e);
243
+ function se(e, s) {
244
+ if (Le(e) || Le(s))
245
+ return e === s;
246
+ if (ae(e) && ae(s))
247
+ return e.getTime() === s.getTime();
248
+ const t = Object.keys(e), i = Object.keys(s);
249
+ if (t.length !== i.length)
250
+ return !1;
251
+ for (const n of t) {
252
+ const l = e[n];
253
+ if (!i.includes(n))
254
+ return !1;
255
+ if (n !== "ref") {
256
+ const d = s[n];
257
+ if (ae(l) && ae(d) || C(l) && C(d) || Array.isArray(l) && Array.isArray(d) ? !se(l, d) : l !== d)
258
+ return !1;
259
+ }
260
+ }
261
+ return !0;
262
+ }
263
+ var p = (e) => C(e) && !Object.keys(e).length, Oe = (e) => e.type === "file", G = (e) => typeof e == "function", Fe = (e) => {
264
+ if (!Te)
265
+ return !1;
266
+ const s = e ? e.ownerDocument : 0;
267
+ return e instanceof (s && s.defaultView ? s.defaultView.HTMLElement : HTMLElement);
268
+ }, gt = (e) => e.type === "select-multiple", Ne = (e) => e.type === "radio", Ht = (e) => Ne(e) || me(e), Re = (e) => Fe(e) && e.isConnected;
269
+ function jt(e, s) {
270
+ const t = s.slice(0, -1).length;
271
+ let i = 0;
272
+ for (; i < t; )
273
+ e = E(e) ? i++ : e[s[i++]];
274
+ return e;
275
+ }
276
+ function Kt(e) {
277
+ for (const s in e)
278
+ if (e.hasOwnProperty(s) && !E(e[s]))
279
+ return !1;
280
+ return !0;
281
+ }
282
+ function T(e, s) {
283
+ const t = Array.isArray(s) ? s : Ie(s) ? [s] : dt(s), i = t.length === 1 ? e : jt(e, t), n = t.length - 1, l = t[n];
284
+ return i && delete i[l], n !== 0 && (C(i) && p(i) || Array.isArray(i) && Kt(i)) && T(e, t.slice(0, -1)), e;
285
+ }
286
+ var mt = (e) => {
287
+ for (const s in e)
288
+ if (G(e[s]))
289
+ return !0;
290
+ return !1;
291
+ };
292
+ function Ve(e, s = {}) {
293
+ const t = Array.isArray(e);
294
+ if (C(e) || t)
295
+ for (const i in e)
296
+ Array.isArray(e[i]) || C(e[i]) && !mt(e[i]) ? (s[i] = Array.isArray(e[i]) ? [] : {}, Ve(e[i], s[i])) : P(e[i]) || (s[i] = !0);
297
+ return s;
298
+ }
299
+ function ht(e, s, t) {
300
+ const i = Array.isArray(e);
301
+ if (C(e) || i)
302
+ for (const n in e)
303
+ Array.isArray(e[n]) || C(e[n]) && !mt(e[n]) ? E(s) || Le(t[n]) ? t[n] = Array.isArray(e[n]) ? Ve(e[n], []) : { ...Ve(e[n]) } : ht(e[n], P(s) ? {} : s[n], t[n]) : t[n] = !se(e[n], s[n]);
304
+ return t;
305
+ }
306
+ var de = (e, s) => ht(e, s, Ve(s));
307
+ const Je = {
308
+ value: !1,
309
+ isValid: !1
310
+ }, Qe = { value: !0, isValid: !0 };
311
+ var vt = (e) => {
312
+ if (Array.isArray(e)) {
313
+ if (e.length > 1) {
314
+ const s = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
315
+ return { value: s, isValid: !!s.length };
316
+ }
317
+ return e[0].checked && !e[0].disabled ? (
318
+ // @ts-expect-error expected to work in the browser
319
+ e[0].attributes && !E(e[0].attributes.value) ? E(e[0].value) || e[0].value === "" ? Qe : { value: e[0].value, isValid: !0 } : Qe
320
+ ) : Je;
321
+ }
322
+ return Je;
323
+ }, bt = (e, { valueAsNumber: s, valueAsDate: t, setValueAs: i }) => E(e) ? e : s ? e === "" ? NaN : e && +e : t && Q(e) ? new Date(e) : i ? i(e) : e;
324
+ const Xe = {
325
+ isValid: !1,
326
+ value: null
327
+ };
328
+ var _t = (e) => Array.isArray(e) ? e.reduce((s, t) => t && t.checked && !t.disabled ? {
329
+ isValid: !0,
330
+ value: t.value
331
+ } : s, Xe) : Xe;
332
+ function Ze(e) {
333
+ const s = e.ref;
334
+ return Oe(s) ? s.files : Ne(s) ? _t(e.refs).value : gt(s) ? [...s.selectedOptions].map(({ value: t }) => t) : me(s) ? vt(e.refs).value : bt(E(s.value) ? e.ref.value : s.value, e);
335
+ }
336
+ var zt = (e, s, t, i) => {
337
+ const n = {};
338
+ for (const l of e) {
339
+ const d = f(s, l);
340
+ d && S(n, l, d._f);
341
+ }
342
+ return {
343
+ criteriaMode: t,
344
+ names: [...e],
345
+ fields: n,
346
+ shouldUseNativeValidation: i
347
+ };
348
+ }, xe = (e) => e instanceof RegExp, ce = (e) => E(e) ? e : xe(e) ? e.source : C(e) ? xe(e.value) ? e.value.source : e.value : e, et = (e) => ({
349
+ isOnSubmit: !e || e === z.onSubmit,
350
+ isOnBlur: e === z.onBlur,
351
+ isOnChange: e === z.onChange,
352
+ isOnAll: e === z.all,
353
+ isOnTouch: e === z.onTouched
354
+ });
355
+ const tt = "AsyncFunction";
356
+ var Gt = (e) => !!e && !!e.validate && !!(G(e.validate) && e.validate.constructor.name === tt || C(e.validate) && Object.values(e.validate).find((s) => s.constructor.name === tt)), Yt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), rt = (e, s, t) => !t && (s.watchAll || s.watch.has(e) || [...s.watch].some((i) => e.startsWith(i) && /^\.\w+/.test(e.slice(i.length))));
357
+ const ye = (e, s, t, i) => {
358
+ for (const n of t || Object.keys(e)) {
359
+ const l = f(e, n);
360
+ if (l) {
361
+ const { _f: d, ...g } = l;
362
+ if (d) {
363
+ if (d.refs && d.refs[0] && s(d.refs[0], n) && !i)
364
+ return !0;
365
+ if (d.ref && s(d.ref, d.name) && !i)
366
+ return !0;
367
+ if (ye(g, s))
368
+ break;
369
+ } else if (C(g) && ye(g, s))
370
+ break;
371
+ }
372
+ }
373
+ };
374
+ function st(e, s, t) {
375
+ const i = f(e, t);
376
+ if (i || Ie(t))
377
+ return {
378
+ error: i,
379
+ name: t
380
+ };
381
+ const n = t.split(".");
382
+ for (; n.length; ) {
383
+ const l = n.join("."), d = f(s, l), g = f(e, l);
384
+ if (d && !Array.isArray(d) && t !== l)
385
+ return { name: t };
386
+ if (g && g.type)
387
+ return {
388
+ name: l,
389
+ error: g
390
+ };
391
+ n.pop();
392
+ }
393
+ return {
394
+ name: t
395
+ };
396
+ }
397
+ var Jt = (e, s, t, i) => {
398
+ t(e);
399
+ const { name: n, ...l } = e;
400
+ return p(l) || Object.keys(l).length >= Object.keys(s).length || Object.keys(l).find((d) => s[d] === (!i || z.all));
401
+ }, Qt = (e, s, t) => !e || !s || e === s || fe(e).some((i) => i && (t ? i === s : i.startsWith(s) || s.startsWith(i))), Xt = (e, s, t, i, n) => n.isOnAll ? !1 : !t && n.isOnTouch ? !(s || e) : (t ? i.isOnBlur : n.isOnBlur) ? !e : (t ? i.isOnChange : n.isOnChange) ? e : !0, Zt = (e, s) => !Ae(f(e, s)).length && T(e, s), er = (e, s, t) => {
402
+ const i = fe(f(e, t));
403
+ return S(i, "root", s[t]), S(e, t, i), e;
404
+ }, be = (e) => Q(e);
405
+ function it(e, s, t = "validate") {
406
+ if (be(e) || Array.isArray(e) && e.every(be) || H(e) && !e)
407
+ return {
408
+ type: t,
409
+ message: be(e) ? e : "",
410
+ ref: s
411
+ };
412
+ }
413
+ var ne = (e) => C(e) && !xe(e) ? e : {
414
+ value: e,
415
+ message: ""
416
+ }, at = async (e, s, t, i, n, l) => {
417
+ const { ref: d, refs: g, required: _, maxLength: D, minLength: V, min: w, max: v, pattern: X, validate: W, name: L, valueAsNumber: M, mount: U } = e._f, h = f(t, L);
418
+ if (!U || s.has(L))
419
+ return {};
420
+ const K = g ? g[0] : d, $ = (A) => {
421
+ n && K.reportValidity && (K.setCustomValidity(H(A) ? "" : A || ""), K.reportValidity());
422
+ }, I = {}, le = Ne(d), oe = me(d), we = le || oe, Y = (M || Oe(d)) && E(d.value) && E(h) || Fe(d) && d.value === "" || h === "" || Array.isArray(h) && !h.length, ie = $t.bind(null, L, i, I), Z = (A, F, k, B = ee.maxLength, j = ee.minLength) => {
423
+ const J = A ? F : k;
424
+ I[L] = {
425
+ type: A ? B : j,
426
+ message: J,
427
+ ref: d,
428
+ ...ie(A ? B : j, J)
429
+ };
430
+ };
431
+ if (l ? !Array.isArray(h) || !h.length : _ && (!we && (Y || P(h)) || H(h) && !h || oe && !vt(g).isValid || le && !_t(g).isValid)) {
432
+ const { value: A, message: F } = be(_) ? { value: !!_, message: _ } : ne(_);
433
+ if (A && (I[L] = {
434
+ type: ee.required,
435
+ message: F,
436
+ ref: K,
437
+ ...ie(ee.required, F)
438
+ }, !i))
439
+ return $(F), I;
440
+ }
441
+ if (!Y && (!P(w) || !P(v))) {
442
+ let A, F;
443
+ const k = ne(v), B = ne(w);
444
+ if (!P(h) && !isNaN(h)) {
445
+ const j = d.valueAsNumber || h && +h;
446
+ P(k.value) || (A = j > k.value), P(B.value) || (F = j < B.value);
447
+ } else {
448
+ const j = d.valueAsDate || new Date(h), J = (ve) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ve), re = d.type == "time", ue = d.type == "week";
449
+ Q(k.value) && h && (A = re ? J(h) > J(k.value) : ue ? h > k.value : j > new Date(k.value)), Q(B.value) && h && (F = re ? J(h) < J(B.value) : ue ? h < B.value : j < new Date(B.value));
450
+ }
451
+ if ((A || F) && (Z(!!A, k.message, B.message, ee.max, ee.min), !i))
452
+ return $(I[L].message), I;
453
+ }
454
+ if ((D || V) && !Y && (Q(h) || l && Array.isArray(h))) {
455
+ const A = ne(D), F = ne(V), k = !P(A.value) && h.length > +A.value, B = !P(F.value) && h.length < +F.value;
456
+ if ((k || B) && (Z(k, A.message, F.message), !i))
457
+ return $(I[L].message), I;
458
+ }
459
+ if (X && !Y && Q(h)) {
460
+ const { value: A, message: F } = ne(X);
461
+ if (xe(A) && !h.match(A) && (I[L] = {
462
+ type: ee.pattern,
463
+ message: F,
464
+ ref: d,
465
+ ...ie(ee.pattern, F)
466
+ }, !i))
467
+ return $(F), I;
468
+ }
469
+ if (W) {
470
+ if (G(W)) {
471
+ const A = await W(h, t), F = it(A, K);
472
+ if (F && (I[L] = {
473
+ ...F,
474
+ ...ie(ee.validate, F.message)
475
+ }, !i))
476
+ return $(F.message), I;
477
+ } else if (C(W)) {
478
+ let A = {};
479
+ for (const F in W) {
480
+ if (!p(A) && !i)
481
+ break;
482
+ const k = it(await W[F](h, t), K, F);
483
+ k && (A = {
484
+ ...k,
485
+ ...ie(F, k.message)
486
+ }, $(k.message), i && (I[L] = A));
487
+ }
488
+ if (!p(A) && (I[L] = {
489
+ ref: K,
490
+ ...A
491
+ }, !i))
492
+ return I;
493
+ }
494
+ }
495
+ return $(!0), I;
496
+ };
497
+ const tr = {
498
+ mode: z.onSubmit,
499
+ reValidateMode: z.onChange,
500
+ shouldFocusError: !0
501
+ };
502
+ function rr(e = {}) {
503
+ let s = {
504
+ ...tr,
505
+ ...e
506
+ }, t = {
507
+ submitCount: 0,
508
+ isDirty: !1,
509
+ isLoading: G(s.defaultValues),
510
+ isValidating: !1,
511
+ isSubmitted: !1,
512
+ isSubmitting: !1,
513
+ isSubmitSuccessful: !1,
514
+ isValid: !1,
515
+ touchedFields: {},
516
+ dirtyFields: {},
517
+ validatingFields: {},
518
+ errors: s.errors || {},
519
+ disabled: s.disabled || !1
520
+ };
521
+ const i = {};
522
+ let n = C(s.defaultValues) || C(s.values) ? O(s.values || s.defaultValues) || {} : {}, l = s.shouldUnregister ? {} : O(n), d = {
523
+ action: !1,
524
+ mount: !1,
525
+ watch: !1
526
+ }, g = {
527
+ mount: /* @__PURE__ */ new Set(),
528
+ disabled: /* @__PURE__ */ new Set(),
529
+ unMount: /* @__PURE__ */ new Set(),
530
+ array: /* @__PURE__ */ new Set(),
531
+ watch: /* @__PURE__ */ new Set()
532
+ }, _, D = 0;
533
+ const V = {
534
+ isDirty: !1,
535
+ dirtyFields: !1,
536
+ validatingFields: !1,
537
+ touchedFields: !1,
538
+ isValidating: !1,
539
+ isValid: !1,
540
+ errors: !1
541
+ };
542
+ let w = {
543
+ ...V
544
+ };
545
+ const v = {
546
+ array: Ye(),
547
+ state: Ye()
548
+ }, X = et(s.mode), W = et(s.reValidateMode), L = s.criteriaMode === z.all, M = (r) => (a) => {
549
+ clearTimeout(D), D = setTimeout(r, a);
550
+ }, U = async (r) => {
551
+ if (!s.disabled && (V.isValid || w.isValid || r)) {
552
+ const a = s.resolver ? p((await Y()).errors) : await Z(i, !0);
553
+ a !== t.isValid && v.state.next({
554
+ isValid: a
555
+ });
556
+ }
557
+ }, h = (r, a) => {
558
+ !s.disabled && (V.isValidating || V.validatingFields || w.isValidating || w.validatingFields) && ((r || Array.from(g.mount)).forEach((o) => {
559
+ o && (a ? S(t.validatingFields, o, a) : T(t.validatingFields, o));
560
+ }), v.state.next({
561
+ validatingFields: t.validatingFields,
562
+ isValidating: !p(t.validatingFields)
563
+ }));
564
+ }, K = (r, a = [], o, y, c = !0, u = !0) => {
565
+ if (y && o && !s.disabled) {
566
+ if (d.action = !0, u && Array.isArray(f(i, r))) {
567
+ const m = o(f(i, r), y.argA, y.argB);
568
+ c && S(i, r, m);
569
+ }
570
+ if (u && Array.isArray(f(t.errors, r))) {
571
+ const m = o(f(t.errors, r), y.argA, y.argB);
572
+ c && S(t.errors, r, m), Zt(t.errors, r);
573
+ }
574
+ if ((V.touchedFields || w.touchedFields) && u && Array.isArray(f(t.touchedFields, r))) {
575
+ const m = o(f(t.touchedFields, r), y.argA, y.argB);
576
+ c && S(t.touchedFields, r, m);
577
+ }
578
+ (V.dirtyFields || w.dirtyFields) && (t.dirtyFields = de(n, l)), v.state.next({
579
+ name: r,
580
+ isDirty: F(r, a),
581
+ dirtyFields: t.dirtyFields,
582
+ errors: t.errors,
583
+ isValid: t.isValid
584
+ });
585
+ } else
586
+ S(l, r, a);
587
+ }, $ = (r, a) => {
588
+ S(t.errors, r, a), v.state.next({
589
+ errors: t.errors
590
+ });
591
+ }, I = (r) => {
592
+ t.errors = r, v.state.next({
593
+ errors: t.errors,
594
+ isValid: !1
595
+ });
596
+ }, le = (r, a, o, y) => {
597
+ const c = f(i, r);
598
+ if (c) {
599
+ const u = f(l, r, E(o) ? f(n, r) : o);
600
+ E(u) || y && y.defaultChecked || a ? S(l, r, a ? u : Ze(c._f)) : j(r, u), d.mount && U();
601
+ }
602
+ }, oe = (r, a, o, y, c) => {
603
+ let u = !1, m = !1;
604
+ const x = {
605
+ name: r
606
+ };
607
+ if (!s.disabled) {
608
+ if (!o || y) {
609
+ (V.isDirty || w.isDirty) && (m = t.isDirty, t.isDirty = x.isDirty = F(), u = m !== x.isDirty);
610
+ const R = se(f(n, r), a);
611
+ m = !!f(t.dirtyFields, r), R ? T(t.dirtyFields, r) : S(t.dirtyFields, r, !0), x.dirtyFields = t.dirtyFields, u = u || (V.dirtyFields || w.dirtyFields) && m !== !R;
612
+ }
613
+ if (o) {
614
+ const R = f(t.touchedFields, r);
615
+ R || (S(t.touchedFields, r, o), x.touchedFields = t.touchedFields, u = u || (V.touchedFields || w.touchedFields) && R !== o);
616
+ }
617
+ u && c && v.state.next(x);
618
+ }
619
+ return u ? x : {};
620
+ }, we = (r, a, o, y) => {
621
+ const c = f(t.errors, r), u = (V.isValid || w.isValid) && H(a) && t.isValid !== a;
622
+ if (s.delayError && o ? (_ = M(() => $(r, o)), _(s.delayError)) : (clearTimeout(D), _ = null, o ? S(t.errors, r, o) : T(t.errors, r)), (o ? !se(c, o) : c) || !p(y) || u) {
623
+ const m = {
624
+ ...y,
625
+ ...u && H(a) ? { isValid: a } : {},
626
+ errors: t.errors,
627
+ name: r
628
+ };
629
+ t = {
630
+ ...t,
631
+ ...m
632
+ }, v.state.next(m);
633
+ }
634
+ }, Y = async (r) => {
635
+ h(r, !0);
636
+ const a = await s.resolver(l, s.context, zt(r || g.mount, i, s.criteriaMode, s.shouldUseNativeValidation));
637
+ return h(r), a;
638
+ }, ie = async (r) => {
639
+ const { errors: a } = await Y(r);
640
+ if (r)
641
+ for (const o of r) {
642
+ const y = f(a, o);
643
+ y ? S(t.errors, o, y) : T(t.errors, o);
644
+ }
645
+ else
646
+ t.errors = a;
647
+ return a;
648
+ }, Z = async (r, a, o = {
649
+ valid: !0
650
+ }) => {
651
+ for (const y in r) {
652
+ const c = r[y];
653
+ if (c) {
654
+ const { _f: u, ...m } = c;
655
+ if (u) {
656
+ const x = g.array.has(u.name), R = c._f && Gt(c._f);
657
+ R && V.validatingFields && h([y], !0);
658
+ const N = await at(c, g.disabled, l, L, s.shouldUseNativeValidation && !a, x);
659
+ if (R && V.validatingFields && h([y]), N[u.name] && (o.valid = !1, a))
660
+ break;
661
+ !a && (f(N, u.name) ? x ? er(t.errors, N, u.name) : S(t.errors, u.name, N[u.name]) : T(t.errors, u.name));
662
+ }
663
+ !p(m) && await Z(m, a, o);
664
+ }
665
+ }
666
+ return o.valid;
667
+ }, A = () => {
668
+ for (const r of g.unMount) {
669
+ const a = f(i, r);
670
+ a && (a._f.refs ? a._f.refs.every((o) => !Re(o)) : !Re(a._f.ref)) && De(r);
671
+ }
672
+ g.unMount = /* @__PURE__ */ new Set();
673
+ }, F = (r, a) => !s.disabled && (r && a && S(l, r, a), !se(Ue(), n)), k = (r, a, o) => yt(r, g, {
674
+ ...d.mount ? l : E(a) ? n : Q(r) ? { [r]: a } : a
675
+ }, o, a), B = (r) => Ae(f(d.mount ? l : n, r, s.shouldUnregister ? f(n, r, []) : [])), j = (r, a, o = {}) => {
676
+ const y = f(i, r);
677
+ let c = a;
678
+ if (y) {
679
+ const u = y._f;
680
+ u && (!u.disabled && S(l, r, bt(a, u)), c = Fe(u.ref) && P(a) ? "" : a, gt(u.ref) ? [...u.ref.options].forEach((m) => m.selected = c.includes(m.value)) : u.refs ? me(u.ref) ? u.refs.length > 1 ? u.refs.forEach((m) => (!m.defaultChecked || !m.disabled) && (m.checked = Array.isArray(c) ? !!c.find((x) => x === m.value) : c === m.value)) : u.refs[0] && (u.refs[0].checked = !!c) : u.refs.forEach((m) => m.checked = m.value === c) : Oe(u.ref) ? u.ref.value = "" : (u.ref.value = c, u.ref.type || v.state.next({
681
+ name: r,
682
+ values: O(l)
683
+ })));
684
+ }
685
+ (o.shouldDirty || o.shouldTouch) && oe(r, c, o.shouldTouch, o.shouldDirty, !0), o.shouldValidate && Se(r);
686
+ }, J = (r, a, o) => {
687
+ for (const y in a) {
688
+ const c = a[y], u = `${r}.${y}`, m = f(i, u);
689
+ (g.array.has(r) || C(c) || m && !m._f) && !ae(c) ? J(u, c, o) : j(u, c, o);
690
+ }
691
+ }, re = (r, a, o = {}) => {
692
+ const y = f(i, r), c = g.array.has(r), u = O(a);
693
+ S(l, r, u), c ? (v.array.next({
694
+ name: r,
695
+ values: O(l)
696
+ }), (V.isDirty || V.dirtyFields || w.isDirty || w.dirtyFields) && o.shouldDirty && v.state.next({
697
+ name: r,
698
+ dirtyFields: de(n, l),
699
+ isDirty: F(r, u)
700
+ })) : y && !y._f && !P(u) ? J(r, u, o) : j(r, u, o), rt(r, g) && v.state.next({ ...t }), v.state.next({
701
+ name: d.mount ? r : void 0,
702
+ values: O(l)
703
+ });
704
+ }, ue = async (r) => {
705
+ d.mount = !0;
706
+ const a = r.target;
707
+ let o = a.name, y = !0;
708
+ const c = f(i, o), u = (m) => {
709
+ y = Number.isNaN(m) || ae(m) && isNaN(m.getTime()) || se(m, f(l, o, m));
710
+ };
711
+ if (c) {
712
+ let m, x;
713
+ const R = a.type ? Ze(c._f) : ot(r), N = r.type === _e.BLUR || r.type === _e.FOCUS_OUT, Lt = !Yt(c._f) && !s.resolver && !f(t.errors, o) && !c._f.deps || Xt(N, f(t.touchedFields, o), t.isSubmitted, W, X), Ee = rt(o, g, N);
714
+ S(l, o, R), N ? (c._f.onBlur && c._f.onBlur(r), _ && _(0)) : c._f.onChange && c._f.onChange(r);
715
+ const Ce = oe(o, R, N), Tt = !p(Ce) || Ee;
716
+ if (!N && v.state.next({
717
+ name: o,
718
+ type: r.type,
719
+ values: O(l)
720
+ }), Lt)
721
+ return (V.isValid || w.isValid) && (s.mode === "onBlur" ? N && U() : N || U()), Tt && v.state.next({ name: o, ...Ee ? {} : Ce });
722
+ if (!N && Ee && v.state.next({ ...t }), s.resolver) {
723
+ const { errors: ze } = await Y([o]);
724
+ if (u(R), y) {
725
+ const It = st(t.errors, i, o), Ge = st(ze, i, It.name || o);
726
+ m = Ge.error, o = Ge.name, x = p(ze);
727
+ }
728
+ } else
729
+ h([o], !0), m = (await at(c, g.disabled, l, L, s.shouldUseNativeValidation))[o], h([o]), u(R), y && (m ? x = !1 : (V.isValid || w.isValid) && (x = await Z(i, !0)));
730
+ y && (c._f.deps && Se(c._f.deps), we(o, x, m, Ce));
731
+ }
732
+ }, ve = (r, a) => {
733
+ if (f(t.errors, a) && r.focus)
734
+ return r.focus(), 1;
735
+ }, Se = async (r, a = {}) => {
736
+ let o, y;
737
+ const c = fe(r);
738
+ if (s.resolver) {
739
+ const u = await ie(E(r) ? r : c);
740
+ o = p(u), y = r ? !c.some((m) => f(u, m)) : o;
741
+ } else r ? (y = (await Promise.all(c.map(async (u) => {
742
+ const m = f(i, u);
743
+ return await Z(m && m._f ? { [u]: m } : m);
744
+ }))).every(Boolean), !(!y && !t.isValid) && U()) : y = o = await Z(i);
745
+ return v.state.next({
746
+ ...!Q(r) || (V.isValid || w.isValid) && o !== t.isValid ? {} : { name: r },
747
+ ...s.resolver || !r ? { isValid: o } : {},
748
+ errors: t.errors
749
+ }), a.shouldFocus && !y && ye(i, ve, r ? c : g.mount), y;
750
+ }, Ue = (r) => {
751
+ const a = {
752
+ ...d.mount ? l : n
753
+ };
754
+ return E(r) ? a : Q(r) ? f(a, r) : r.map((o) => f(a, o));
755
+ }, pe = (r, a) => ({
756
+ invalid: !!f((a || t).errors, r),
757
+ isDirty: !!f((a || t).dirtyFields, r),
758
+ error: f((a || t).errors, r),
759
+ isValidating: !!f(t.validatingFields, r),
760
+ isTouched: !!f((a || t).touchedFields, r)
761
+ }), wt = (r) => {
762
+ r && fe(r).forEach((a) => T(t.errors, a)), v.state.next({
763
+ errors: r ? t.errors : {}
764
+ });
765
+ }, Pe = (r, a, o) => {
766
+ const y = (f(i, r, { _f: {} })._f || {}).ref, c = f(t.errors, r) || {}, { ref: u, message: m, type: x, ...R } = c;
767
+ S(t.errors, r, {
768
+ ...R,
769
+ ...a,
770
+ ref: y
771
+ }), v.state.next({
772
+ name: r,
773
+ errors: t.errors,
774
+ isValid: !1
775
+ }), o && o.shouldFocus && y && y.focus && y.focus();
776
+ }, St = (r, a) => G(r) ? v.state.subscribe({
777
+ next: (o) => r(k(void 0, a), o)
778
+ }) : k(r, a, !0), Be = (r) => v.state.subscribe({
779
+ next: (a) => {
780
+ Qt(r.name, a.name, r.exact) && Jt(a, r.formState || V, Rt, r.reRenderRoot) && r.callback({
781
+ values: { ...l },
782
+ ...t,
783
+ ...a
784
+ });
785
+ }
786
+ }).unsubscribe, Dt = (r) => (d.mount = !0, w = {
787
+ ...w,
788
+ ...r.formState
789
+ }, Be({
790
+ ...r,
791
+ formState: w
792
+ })), De = (r, a = {}) => {
793
+ for (const o of r ? fe(r) : g.mount)
794
+ g.mount.delete(o), g.array.delete(o), a.keepValue || (T(i, o), T(l, o)), !a.keepError && T(t.errors, o), !a.keepDirty && T(t.dirtyFields, o), !a.keepTouched && T(t.touchedFields, o), !a.keepIsValidating && T(t.validatingFields, o), !s.shouldUnregister && !a.keepDefaultValue && T(n, o);
795
+ v.state.next({
796
+ values: O(l)
797
+ }), v.state.next({
798
+ ...t,
799
+ ...a.keepDirty ? { isDirty: F() } : {}
800
+ }), !a.keepIsValid && U();
801
+ }, qe = ({ disabled: r, name: a }) => {
802
+ (H(r) && d.mount || r || g.disabled.has(a)) && (r ? g.disabled.add(a) : g.disabled.delete(a));
803
+ }, ke = (r, a = {}) => {
804
+ let o = f(i, r);
805
+ const y = H(a.disabled) || H(s.disabled);
806
+ return S(i, r, {
807
+ ...o || {},
808
+ _f: {
809
+ ...o && o._f ? o._f : { ref: { name: r } },
810
+ name: r,
811
+ mount: !0,
812
+ ...a
813
+ }
814
+ }), g.mount.add(r), o ? qe({
815
+ disabled: H(a.disabled) ? a.disabled : s.disabled,
816
+ name: r
817
+ }) : le(r, !0, a.value), {
818
+ ...y ? { disabled: a.disabled || s.disabled } : {},
819
+ ...s.progressive ? {
820
+ required: !!a.required,
821
+ min: ce(a.min),
822
+ max: ce(a.max),
823
+ minLength: ce(a.minLength),
824
+ maxLength: ce(a.maxLength),
825
+ pattern: ce(a.pattern)
826
+ } : {},
827
+ name: r,
828
+ onChange: ue,
829
+ onBlur: ue,
830
+ ref: (c) => {
831
+ if (c) {
832
+ ke(r, a), o = f(i, r);
833
+ const u = E(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, m = Ht(u), x = o._f.refs || [];
834
+ if (m ? x.find((R) => R === u) : u === o._f.ref)
835
+ return;
836
+ S(i, r, {
837
+ _f: {
838
+ ...o._f,
839
+ ...m ? {
840
+ refs: [
841
+ ...x.filter(Re),
842
+ u,
843
+ ...Array.isArray(f(n, r)) ? [{}] : []
844
+ ],
845
+ ref: { type: u.type, name: r }
846
+ } : { ref: u }
847
+ }
848
+ }), le(r, !1, void 0, u);
849
+ } else
850
+ o = f(i, r, {}), o._f && (o._f.mount = !1), (s.shouldUnregister || a.shouldUnregister) && !(ut(g.array, r) && d.action) && g.unMount.add(r);
851
+ }
852
+ };
853
+ }, We = () => s.shouldFocusError && ye(i, ve, g.mount), kt = (r) => {
854
+ H(r) && (v.state.next({ disabled: r }), ye(i, (a, o) => {
855
+ const y = f(i, o);
856
+ y && (a.disabled = y._f.disabled || r, Array.isArray(y._f.refs) && y._f.refs.forEach((c) => {
857
+ c.disabled = y._f.disabled || r;
858
+ }));
859
+ }, 0, !1));
860
+ }, $e = (r, a) => async (o) => {
861
+ let y;
862
+ o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
863
+ let c = O(l);
864
+ if (v.state.next({
865
+ isSubmitting: !0
866
+ }), s.resolver) {
867
+ const { errors: u, values: m } = await Y();
868
+ t.errors = u, c = m;
869
+ } else
870
+ await Z(i);
871
+ if (g.disabled.size)
872
+ for (const u of g.disabled)
873
+ S(c, u, void 0);
874
+ if (T(t.errors, "root"), p(t.errors)) {
875
+ v.state.next({
876
+ errors: {}
877
+ });
878
+ try {
879
+ await r(c, o);
880
+ } catch (u) {
881
+ y = u;
882
+ }
883
+ } else
884
+ a && await a({ ...t.errors }, o), We(), setTimeout(We);
885
+ if (v.state.next({
886
+ isSubmitted: !0,
887
+ isSubmitting: !1,
888
+ isSubmitSuccessful: p(t.errors) && !y,
889
+ submitCount: t.submitCount + 1,
890
+ errors: t.errors
891
+ }), y)
892
+ throw y;
893
+ }, Et = (r, a = {}) => {
894
+ f(i, r) && (E(a.defaultValue) ? re(r, O(f(n, r))) : (re(r, a.defaultValue), S(n, r, O(a.defaultValue))), a.keepTouched || T(t.touchedFields, r), a.keepDirty || (T(t.dirtyFields, r), t.isDirty = a.defaultValue ? F(r, O(f(n, r))) : F()), a.keepError || (T(t.errors, r), V.isValid && U()), v.state.next({ ...t }));
895
+ }, He = (r, a = {}) => {
896
+ const o = r ? O(r) : n, y = O(o), c = p(r), u = c ? n : y;
897
+ if (a.keepDefaultValues || (n = o), !a.keepValues) {
898
+ if (a.keepDirtyValues) {
899
+ const m = /* @__PURE__ */ new Set([
900
+ ...g.mount,
901
+ ...Object.keys(de(n, l))
902
+ ]);
903
+ for (const x of Array.from(m))
904
+ f(t.dirtyFields, x) ? S(u, x, f(l, x)) : re(x, f(u, x));
905
+ } else {
906
+ if (Te && E(r))
907
+ for (const m of g.mount) {
908
+ const x = f(i, m);
909
+ if (x && x._f) {
910
+ const R = Array.isArray(x._f.refs) ? x._f.refs[0] : x._f.ref;
911
+ if (Fe(R)) {
912
+ const N = R.closest("form");
913
+ if (N) {
914
+ N.reset();
915
+ break;
916
+ }
917
+ }
918
+ }
919
+ }
920
+ for (const m of g.mount)
921
+ re(m, f(u, m));
922
+ }
923
+ l = O(u), v.array.next({
924
+ values: { ...u }
925
+ }), v.state.next({
926
+ values: { ...u }
927
+ });
928
+ }
929
+ g = {
930
+ mount: a.keepDirtyValues ? g.mount : /* @__PURE__ */ new Set(),
931
+ unMount: /* @__PURE__ */ new Set(),
932
+ array: /* @__PURE__ */ new Set(),
933
+ disabled: /* @__PURE__ */ new Set(),
934
+ watch: /* @__PURE__ */ new Set(),
935
+ watchAll: !1,
936
+ focus: ""
937
+ }, d.mount = !V.isValid || !!a.keepIsValid || !!a.keepDirtyValues, d.watch = !!s.shouldUnregister, v.state.next({
938
+ submitCount: a.keepSubmitCount ? t.submitCount : 0,
939
+ isDirty: c ? !1 : a.keepDirty ? t.isDirty : !!(a.keepDefaultValues && !se(r, n)),
940
+ isSubmitted: a.keepIsSubmitted ? t.isSubmitted : !1,
941
+ dirtyFields: c ? {} : a.keepDirtyValues ? a.keepDefaultValues && l ? de(n, l) : t.dirtyFields : a.keepDefaultValues && r ? de(n, r) : a.keepDirty ? t.dirtyFields : {},
942
+ touchedFields: a.keepTouched ? t.touchedFields : {},
943
+ errors: a.keepErrors ? t.errors : {},
944
+ isSubmitSuccessful: a.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
945
+ isSubmitting: !1
946
+ });
947
+ }, je = (r, a) => He(G(r) ? r(l) : r, a), Ct = (r, a = {}) => {
948
+ const o = f(i, r), y = o && o._f;
949
+ if (y) {
950
+ const c = y.refs ? y.refs[0] : y.ref;
951
+ c.focus && (c.focus(), a.shouldSelect && G(c.select) && c.select());
952
+ }
953
+ }, Rt = (r) => {
954
+ t = {
955
+ ...t,
956
+ ...r
957
+ };
958
+ }, Ke = {
959
+ control: {
960
+ register: ke,
961
+ unregister: De,
962
+ getFieldState: pe,
963
+ handleSubmit: $e,
964
+ setError: Pe,
965
+ _subscribe: Be,
966
+ _runSchema: Y,
967
+ _getWatch: k,
968
+ _getDirty: F,
969
+ _setValid: U,
970
+ _setFieldArray: K,
971
+ _setDisabledField: qe,
972
+ _setErrors: I,
973
+ _getFieldArray: B,
974
+ _reset: He,
975
+ _resetDefaultValues: () => G(s.defaultValues) && s.defaultValues().then((r) => {
976
+ je(r, s.resetOptions), v.state.next({
977
+ isLoading: !1
978
+ });
979
+ }),
980
+ _removeUnmounted: A,
981
+ _disableForm: kt,
982
+ _subjects: v,
983
+ _proxyFormState: V,
984
+ get _fields() {
985
+ return i;
986
+ },
987
+ get _formValues() {
988
+ return l;
989
+ },
990
+ get _state() {
991
+ return d;
992
+ },
993
+ set _state(r) {
994
+ d = r;
995
+ },
996
+ get _defaultValues() {
997
+ return n;
998
+ },
999
+ get _names() {
1000
+ return g;
1001
+ },
1002
+ set _names(r) {
1003
+ g = r;
1004
+ },
1005
+ get _formState() {
1006
+ return t;
1007
+ },
1008
+ get _options() {
1009
+ return s;
1010
+ },
1011
+ set _options(r) {
1012
+ s = {
1013
+ ...s,
1014
+ ...r
1015
+ };
1016
+ }
1017
+ },
1018
+ subscribe: Dt,
1019
+ trigger: Se,
1020
+ register: ke,
1021
+ handleSubmit: $e,
1022
+ watch: St,
1023
+ setValue: re,
1024
+ getValues: Ue,
1025
+ reset: je,
1026
+ resetField: Et,
1027
+ clearErrors: wt,
1028
+ unregister: De,
1029
+ setError: Pe,
1030
+ setFocus: Ct,
1031
+ getFieldState: pe
1032
+ };
1033
+ return {
1034
+ ...Ke,
1035
+ formControl: Ke
1036
+ };
1037
+ }
1038
+ function _r(e = {}) {
1039
+ const s = b.useRef(void 0), t = b.useRef(void 0), [i, n] = b.useState({
1040
+ isDirty: !1,
1041
+ isValidating: !1,
1042
+ isLoading: G(e.defaultValues),
1043
+ isSubmitted: !1,
1044
+ isSubmitting: !1,
1045
+ isSubmitSuccessful: !1,
1046
+ isValid: !1,
1047
+ submitCount: 0,
1048
+ dirtyFields: {},
1049
+ touchedFields: {},
1050
+ validatingFields: {},
1051
+ errors: e.errors || {},
1052
+ disabled: e.disabled || !1,
1053
+ defaultValues: G(e.defaultValues) ? void 0 : e.defaultValues
1054
+ });
1055
+ s.current || (s.current = {
1056
+ ...e.formControl ? e.formControl : rr(e),
1057
+ formState: i
1058
+ }, e.formControl && e.defaultValues && !G(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions));
1059
+ const l = s.current.control;
1060
+ return l._options = e, b.useLayoutEffect(() => l._subscribe({
1061
+ formState: l._proxyFormState,
1062
+ callback: () => n({ ...l._formState }),
1063
+ reRenderRoot: !0
1064
+ }), [l]), b.useEffect(() => l._disableForm(e.disabled), [l, e.disabled]), b.useEffect(() => {
1065
+ if (l._proxyFormState.isDirty) {
1066
+ const d = l._getDirty();
1067
+ d !== i.isDirty && l._subjects.state.next({
1068
+ isDirty: d
1069
+ });
1070
+ }
1071
+ }, [l, i.isDirty]), b.useEffect(() => {
1072
+ e.values && !se(e.values, t.current) ? (l._reset(e.values, l._options.resetOptions), t.current = e.values, n((d) => ({ ...d }))) : l._resetDefaultValues();
1073
+ }, [e.values, l]), b.useEffect(() => {
1074
+ e.errors && !p(e.errors) && l._setErrors(e.errors);
1075
+ }, [e.errors, l]), b.useEffect(() => {
1076
+ l._state.mount || (l._setValid(), l._state.mount = !0), l._state.watch && (l._state.watch = !1, l._subjects.state.next({ ...l._formState })), l._removeUnmounted();
1077
+ }), b.useEffect(() => {
1078
+ e.shouldUnregister && l._subjects.state.next({
1079
+ values: l._getWatch()
1080
+ });
1081
+ }, [e.shouldUnregister, l]), s.current.formState = ft(i, l), s.current;
1082
+ }
1083
+ const sr = ge({
1084
+ base: "rounded-md border border-secondary-border bg-secondary-bg"
1085
+ }), Fr = ({
1086
+ className: e,
1087
+ asChild: s,
1088
+ ...t
1089
+ }) => /* @__PURE__ */ q(s ? nt : "div", { className: sr({ className: e }), children: /* @__PURE__ */ q(pt, { ...t }) }), Ft = te.createContext({}), ir = ({
1090
+ ...e
1091
+ }) => /* @__PURE__ */ q(Ft.Provider, { value: { name: e.name }, children: /* @__PURE__ */ q(Wt, { ...e }) }), Me = () => {
1092
+ const e = te.useContext(Ft), s = te.useContext(Vt), { getFieldState: t, formState: i } = he(), n = t(e.name, i);
1093
+ if (!e)
1094
+ throw new Error("useFormField should be used within <FormField>");
1095
+ const { id: l } = s;
1096
+ return {
1097
+ id: l,
1098
+ name: e.name,
1099
+ formItemId: `${l}-form-item`,
1100
+ formDescriptionId: `${l}-form-item-description`,
1101
+ formMessageId: `${l}-form-item-message`,
1102
+ ...n
1103
+ };
1104
+ }, Vt = te.createContext({}), ar = ge({
1105
+ base: "space-y-2"
1106
+ }), xt = te.forwardRef(
1107
+ ({ className: e, ...s }, t) => {
1108
+ const i = te.useId();
1109
+ return /* @__PURE__ */ q(Vt.Provider, { value: { id: i }, children: /* @__PURE__ */ q("div", { ref: t, className: ar({ className: e }), ...s }) });
1110
+ }
1111
+ );
1112
+ xt.displayName = "FormItem";
1113
+ const nr = te.forwardRef(
1114
+ ({ className: e, required: s, ...t }, i) => {
1115
+ const { formItemId: n } = Me();
1116
+ return /* @__PURE__ */ q(Ot, { required: s, ref: i, className: e, htmlFor: n, ...t });
1117
+ }
1118
+ );
1119
+ nr.displayName = "FormLabel";
1120
+ const At = te.forwardRef(
1121
+ ({ ...e }, s) => {
1122
+ const { error: t, formItemId: i, formDescriptionId: n, formMessageId: l } = Me();
1123
+ return /* @__PURE__ */ q(
1124
+ nt,
1125
+ {
1126
+ ref: s,
1127
+ id: i,
1128
+ "aria-describedby": t ? `${n} ${l}` : `${n}`,
1129
+ "aria-invalid": !!t,
1130
+ ...e
1131
+ }
1132
+ );
1133
+ }
1134
+ );
1135
+ At.displayName = "FormControl";
1136
+ const lr = ge({
1137
+ base: "text-[0.8rem] font-medium text-destructive"
1138
+ }), or = te.forwardRef(
1139
+ ({ className: e, children: s, ...t }, i) => {
1140
+ const { error: n, formMessageId: l } = Me(), d = n ? String(n?.message ?? "") : s;
1141
+ return d ? /* @__PURE__ */ q("p", { ref: i, id: l, className: lr({ className: e }), ...t, children: d }) : null;
1142
+ }
1143
+ );
1144
+ or.displayName = "FormMessage";
1145
+ const ur = ge({
1146
+ slots: {
1147
+ label: "w-44"
1148
+ }
1149
+ });
1150
+ function Vr({
1151
+ name: e,
1152
+ title: s,
1153
+ description: t,
1154
+ control: i,
1155
+ required: n,
1156
+ className: l,
1157
+ labelClassName: d,
1158
+ readonly: g,
1159
+ layout: _ = "responsive"
1160
+ }) {
1161
+ const D = he(), V = ur();
1162
+ return /* @__PURE__ */ q(
1163
+ ir,
1164
+ {
1165
+ control: D.control,
1166
+ name: e,
1167
+ render: ({ field: w, fieldState: v, formState: X }) => /* @__PURE__ */ q(xt, { children: /* @__PURE__ */ q(
1168
+ Nt,
1169
+ {
1170
+ title: s,
1171
+ description: t,
1172
+ required: n,
1173
+ error: v.error?.message,
1174
+ labelClassName: V.label({ className: d }),
1175
+ className: l,
1176
+ readonly: g,
1177
+ layout: _,
1178
+ control: ({ id: W, readonly: L }) => /* @__PURE__ */ q(At, { id: W, children: i({ field: w, fieldState: v, formState: X, readonly: L }) })
1179
+ }
1180
+ ) })
1181
+ }
1182
+ );
1183
+ }
1184
+ const dr = ge({
1185
+ base: "space-y-5 lg:space-y-4"
1186
+ }), cr = b.forwardRef(
1187
+ ({ className: e, children: s, ...t }, i) => /* @__PURE__ */ q("div", { ref: i, className: dr({ className: e }), ...t, children: s })
1188
+ );
1189
+ cr.displayName = "FormStack";
1190
+ export {
1191
+ cr as F,
1192
+ Fr as a,
1193
+ xt as b,
1194
+ nr as c,
1195
+ At as d,
1196
+ or as e,
1197
+ ir as f,
1198
+ Vr as g,
1199
+ f as h,
1200
+ $t as i,
1201
+ _r as j,
1202
+ S as s,
1203
+ Me as u
1204
+ };
1205
+ //# sourceMappingURL=FormStack-DfoaOry7.js.map