@nxgt/material 3.75.0 → 3.76.0

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 (239) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +37 -1
  3. package/dist/{alert-dialog-BfO_ri-N.js → alert-dialog-653apk3f.js} +8 -7
  4. package/dist/{async-slice-roMAJVzG.js → async-slice-CXLbQuOc.js} +1 -1
  5. package/dist/{bubble-input-B7BVd9fX.js → bubble-input-CQwVSoU3.js} +30 -29
  6. package/dist/{button-DgenqmpS.js → button-3op3rtZh.js} +5 -4
  7. package/dist/calculator-BaSMe0SK.js +1189 -0
  8. package/dist/calculator-announce-DRd2c6Dq.js +89 -0
  9. package/dist/calculator-context-BugcKuVG.js +10 -0
  10. package/dist/calculator-field.js +172 -0
  11. package/dist/calculator-panel-announce-AZSnZUSr.js +29 -0
  12. package/dist/calculator-segment-BlJE1LaS.js +22 -0
  13. package/dist/calculator.js +2 -0
  14. package/dist/charts.js +3 -3
  15. package/dist/{chip-CiDczNxO.js → chip-MuKDwtkG.js} +2 -2
  16. package/dist/{code-editor-CohlhFsA.js → code-editor-Bp2RrdNx.js} +13 -13
  17. package/dist/code-editor.js +37 -37
  18. package/dist/{code-language-items-Cs8GLYDp.js → code-language-items-B7WR5ua_.js} +19 -24
  19. package/dist/components/base-content.css +9 -4
  20. package/dist/components/ui/collections/server-table/server-table-phone-row.css +10 -3
  21. package/dist/{components-zJdfH4im.js → components-Ci3Zo8kC.js} +15837 -17245
  22. package/dist/components.js +37 -28
  23. package/dist/conversion-variant-BDFAxqe9.js +529 -0
  24. package/dist/copy-to-clipboard-Be5Ffvs_.js +7 -0
  25. package/dist/currency-B-r3ig11.js +16 -0
  26. package/dist/currency-field-BJ9rSrif.js +285 -0
  27. package/dist/{number.utils-BG_eEt5g.js → date.utils-DUvqcjan.js} +1 -7
  28. package/dist/dialog-Bm5LvVlB.js +166 -0
  29. package/dist/dist-BZe2evxL.js +139 -0
  30. package/dist/dist-CxhKjOYm.js +28 -0
  31. package/dist/dist-DHdUUM1w.js +241 -0
  32. package/dist/{dist-C4wtXCjf.js → dist-DOK3zo5C.js} +33 -32
  33. package/dist/dist-DWZXlCZR.js +182 -0
  34. package/dist/dist-DkQbkF9T.js +33 -0
  35. package/dist/dnd.js +1 -1
  36. package/dist/{dropdown-menu-CzR6JP31.js → dropdown-menu-xlZ6NYUA.js} +160 -159
  37. package/dist/editor.js +299 -298
  38. package/dist/{empty-state-DjHGMp5F.js → empty-state-C0kviQdW.js} +2 -2
  39. package/dist/{field-blur-CdASxjL7.js → field-blur-DkiZOVNV.js} +178 -180
  40. package/dist/{field-blur-context-kZ4SD7xu.js → field-blur-context-BLGgf_3z.js} +2 -2
  41. package/dist/financial-variant-BsZEa5sF.js +459 -0
  42. package/dist/{hooks-Dqq8O3Az.js → hooks-Dg94jPRq.js} +12 -12
  43. package/dist/hooks.js +2 -2
  44. package/dist/{hover-card-BPKqte4a.js → hover-card-B1g55Hi6.js} +44 -43
  45. package/dist/i18n.js +3 -3
  46. package/dist/icon-badge-BcW66bRk.js +17 -0
  47. package/dist/{icon-button-Cr-DyDGg.js → icon-button-Cogxy1cy.js} +5 -4
  48. package/dist/{in-dialog-Vwkyp-M5.js → in-dialog-D61Yeaol.js} +2 -1
  49. package/dist/input-CC2joTjB.js +56 -0
  50. package/dist/key-layout-cR79xfGE.js +38 -0
  51. package/dist/lib/calculator/index.d.ts +16 -0
  52. package/dist/lib/calculator-field/index.d.ts +12 -0
  53. package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +2 -2
  54. package/dist/lib/components/ui/feedback/moment/moment-body.d.ts +17 -2
  55. package/dist/lib/components/ui/feedback/moment/moment-passive.d.ts +13 -0
  56. package/dist/lib/components/ui/feedback/moment/moment.d.ts +16 -2
  57. package/dist/lib/components/ui/fields/calculator-field/apply-calculated.d.ts +17 -0
  58. package/dist/lib/components/ui/fields/calculator-field/calculator-field-content.d.ts +16 -0
  59. package/dist/lib/components/ui/fields/calculator-field/calculator-field-trigger.d.ts +4 -0
  60. package/dist/lib/components/ui/fields/calculator-field/calculator-field.d.ts +12 -0
  61. package/dist/lib/components/ui/fields/calculator-field/calculator-field.types.d.ts +31 -0
  62. package/dist/lib/components/ui/fields/calculator-field/calculator-form-field.d.ts +4 -0
  63. package/dist/lib/components/ui/fields/calculator-field/index.d.ts +3 -0
  64. package/dist/lib/components/ui/fields/calculator-field/use-calculator-field.d.ts +15 -0
  65. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  66. package/dist/lib/components/ui/fields/currency-field/currency-field.d.ts +7 -1
  67. package/dist/lib/components/ui/layout/app-shell/app-sidebar-context.d.ts +4 -0
  68. package/dist/lib/components/ui/widgets/calculator/calculator-announce.d.ts +27 -0
  69. package/dist/lib/components/ui/widgets/calculator/calculator-clipboard.d.ts +19 -0
  70. package/dist/lib/components/ui/widgets/calculator/calculator-context.d.ts +49 -0
  71. package/dist/lib/components/ui/widgets/calculator/calculator-feedback.d.ts +18 -0
  72. package/dist/lib/components/ui/widgets/calculator/calculator-keyboard.d.ts +30 -0
  73. package/dist/lib/components/ui/widgets/calculator/calculator-storage.d.ts +17 -0
  74. package/dist/lib/components/ui/widgets/calculator/calculator-variant-steps.d.ts +16 -0
  75. package/dist/lib/components/ui/widgets/calculator/calculator.d.ts +11 -0
  76. package/dist/lib/components/ui/widgets/calculator/calculator.selectors.d.ts +23 -0
  77. package/dist/lib/components/ui/widgets/calculator/calculator.slice.d.ts +1881 -0
  78. package/dist/lib/components/ui/widgets/calculator/currency.d.ts +9 -0
  79. package/dist/lib/components/ui/widgets/calculator/engine.d.ts +22 -0
  80. package/dist/lib/components/ui/widgets/calculator/index.d.ts +3 -0
  81. package/dist/lib/components/ui/widgets/calculator/partials/calculator-announcer.d.ts +2 -0
  82. package/dist/lib/components/ui/widgets/calculator/partials/calculator-display.d.ts +3 -0
  83. package/dist/lib/components/ui/widgets/calculator/partials/calculator-key.d.ts +17 -0
  84. package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +8 -0
  85. package/dist/lib/components/ui/widgets/calculator/partials/calculator-loading.d.ts +6 -0
  86. package/dist/lib/components/ui/widgets/calculator/partials/calculator-memory.d.ts +2 -0
  87. package/dist/lib/components/ui/widgets/calculator/partials/calculator-panel-announce.d.ts +10 -0
  88. package/dist/lib/components/ui/widgets/calculator/partials/calculator-panel-body.d.ts +9 -0
  89. package/dist/lib/components/ui/widgets/calculator/partials/calculator-screen.d.ts +4 -0
  90. package/dist/lib/components/ui/widgets/calculator/partials/calculator-segment.d.ts +21 -0
  91. package/dist/lib/components/ui/widgets/calculator/partials/calculator-shell.d.ts +9 -0
  92. package/dist/lib/components/ui/widgets/calculator/partials/calculator-switcher.d.ts +5 -0
  93. package/dist/lib/components/ui/widgets/calculator/partials/calculator-tape.d.ts +4 -0
  94. package/dist/lib/components/ui/widgets/calculator/partials/calculator-tools.d.ts +4 -0
  95. package/dist/lib/components/ui/widgets/calculator/partials/keypad-navigation.d.ts +24 -0
  96. package/dist/lib/components/ui/widgets/calculator/types.d.ts +102 -0
  97. package/dist/lib/components/ui/widgets/calculator/use-calculator-clipboard.d.ts +19 -0
  98. package/dist/lib/components/ui/widgets/calculator/use-calculator-conversion.d.ts +4 -0
  99. package/dist/lib/components/ui/widgets/calculator/use-calculator-feedback.d.ts +3 -0
  100. package/dist/lib/components/ui/widgets/calculator/use-calculator-keyboard.d.ts +22 -0
  101. package/dist/lib/components/ui/widgets/calculator/use-calculator-persistence.d.ts +14 -0
  102. package/dist/lib/components/ui/widgets/calculator/use-calculator-pos.d.ts +25 -0
  103. package/dist/lib/components/ui/widgets/calculator/use-calculator-press.d.ts +26 -0
  104. package/dist/lib/components/ui/widgets/calculator/use-calculator-tape.d.ts +29 -0
  105. package/dist/lib/components/ui/widgets/calculator/use-calculator-value.d.ts +9 -0
  106. package/dist/lib/components/ui/widgets/calculator/use-calculator-variant.d.ts +23 -0
  107. package/dist/lib/components/ui/widgets/calculator/use-calculator.d.ts +10 -0
  108. package/dist/lib/components/ui/widgets/calculator/use-engine-settings.d.ts +10 -0
  109. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-fields.d.ts +19 -0
  110. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-labels.d.ts +17 -0
  111. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-math.d.ts +31 -0
  112. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-names.d.ts +4 -0
  113. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-panel.d.ts +7 -0
  114. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-rates.d.ts +29 -0
  115. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-result.d.ts +15 -0
  116. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-state.d.ts +36 -0
  117. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-variant.d.ts +3 -0
  118. package/dist/lib/components/ui/widgets/calculator/variants/conversion/use-conversion.d.ts +24 -0
  119. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-change.d.ts +4 -0
  120. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-figures.d.ts +43 -0
  121. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-format.d.ts +12 -0
  122. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-loan-math.d.ts +14 -0
  123. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-loan.d.ts +4 -0
  124. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-margin.d.ts +4 -0
  125. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-math.d.ts +10 -0
  126. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-panel.d.ts +7 -0
  127. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-parts.d.ts +35 -0
  128. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-table.d.ts +7 -0
  129. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-variant.d.ts +3 -0
  130. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-vat.d.ts +4 -0
  131. package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +51 -0
  132. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-announce.d.ts +16 -0
  133. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-aside.d.ts +2 -0
  134. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-display.d.ts +2 -0
  135. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-fields.d.ts +2 -0
  136. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-layout.d.ts +9 -0
  137. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-line.d.ts +6 -0
  138. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-names.d.ts +2 -0
  139. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-state.d.ts +3 -0
  140. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-tender.d.ts +2 -0
  141. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-ticket-data.d.ts +41 -0
  142. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-ticket.d.ts +5 -0
  143. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-totals.d.ts +2 -0
  144. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-types.d.ts +76 -0
  145. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-variant.d.ts +3 -0
  146. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-vat.d.ts +2 -0
  147. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-view.d.ts +28 -0
  148. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-announce.d.ts +19 -0
  149. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-base.d.ts +11 -0
  150. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-bitpad.d.ts +14 -0
  151. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-display.d.ts +9 -0
  152. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-layout.d.ts +6 -0
  153. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-names.d.ts +2 -0
  154. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-readouts.d.ts +14 -0
  155. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-reduce.d.ts +29 -0
  156. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-state.d.ts +22 -0
  157. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-toolbar.d.ts +5 -0
  158. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-variant.d.ts +3 -0
  159. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-word.d.ts +15 -0
  160. package/dist/lib/components/ui/widgets/calculator/variants/registry.d.ts +21 -0
  161. package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-layout.d.ts +3 -0
  162. package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-names.d.ts +2 -0
  163. package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-toolbar.d.ts +2 -0
  164. package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-variant.d.ts +3 -0
  165. package/dist/lib/components/ui/widgets/calculator/variants/standard/standard-layout.d.ts +3 -0
  166. package/dist/lib/components/ui/widgets/calculator/variants/variant-loader.d.ts +34 -0
  167. package/dist/lib/components/ui/widgets/calculator/variants/variant-logic.d.ts +40 -0
  168. package/dist/lib/components/ui/widgets/calculator/variants/variant-types.d.ts +62 -0
  169. package/dist/lib/i18n/resources/en/en.d.ts +412 -0
  170. package/dist/lib/i18n/resources/en/material.json.d.ts +412 -0
  171. package/dist/lib/i18n/resources/fr/fr.d.ts +412 -0
  172. package/dist/lib/i18n/resources/fr/material.json.d.ts +412 -0
  173. package/dist/lib/i18n/resources/resources.d.ts +824 -0
  174. package/dist/lib/i18n/translator.d.ts +1 -1
  175. package/dist/lib.js +4 -3
  176. package/dist/main.js +50 -40
  177. package/dist/map.js +66 -65
  178. package/dist/material.css +1 -1
  179. package/dist/native-select-w_FlBLHV.js +40 -0
  180. package/dist/number.utils-CSueQZcv.js +7 -0
  181. package/dist/pdf-reader.js +1 -1
  182. package/dist/percent-field-lahyDJDG.js +14 -0
  183. package/dist/picker-surface-CV09H7Nb.js +1220 -0
  184. package/dist/popover-Cd7DkND4.js +233 -0
  185. package/dist/pos-types-DKCkOTYy.js +49 -0
  186. package/dist/pos-variant-GrUfbTTP.js +603 -0
  187. package/dist/print.js +1 -1
  188. package/dist/programmer-variant-eKJNKENL.js +501 -0
  189. package/dist/programmer-word-CNCF7DJF.js +15 -0
  190. package/dist/{public-DC9VQw4Z.js → public-y6g4ddxd.js} +895 -892
  191. package/dist/{rich-code-block-DBSL9zEN.js → rich-code-block-CRQ0iyLb.js} +5 -5
  192. package/dist/scientific-variant-2y3UxAAU.js +149 -0
  193. package/dist/{sortable-provider-C4tk5esY.js → sortable-provider-DdiI3Fwk.js} +2 -2
  194. package/dist/{spinner-B2MubVWb.js → spinner-C1QIewWv.js} +133 -159
  195. package/dist/standard-layout-BuSRr3TY.js +40 -0
  196. package/dist/tabs-DzEqMb1W.js +383 -0
  197. package/dist/{icon-badge-B9uvDoyY.js → text-field-BAdY-kpO.js} +20 -34
  198. package/dist/theme-picker.js +3 -3
  199. package/dist/{theme-toggle-BInlu21G.js → theme-toggle-C_VeiiCm.js} +2 -2
  200. package/dist/toggle-FeCCJqbg.js +40 -0
  201. package/dist/{toggle-group-DXXlqid2.js → toggle-group-CVMxEpWi.js} +1 -1
  202. package/dist/{toolbar-items-CRJSx1MU.js → toolbar-items-D310xDuM.js} +333 -554
  203. package/dist/{translate-material-pVlPJ1v4.js → translate-material-BypJJ1l5.js} +1 -1
  204. package/dist/{translator-BoYCward.js → translator-DJkf4J7t.js} +824 -0
  205. package/dist/{typography-B6YMbCge.js → typography-CYEquVeb.js} +1 -1
  206. package/dist/{use-chat-composer-BvWQogJe.js → use-chat-composer-DMXu9E1O.js} +4198 -4600
  207. package/dist/{use-heading-spy-B_Z4ArDh.js → use-heading-spy-DJR8YYm6.js} +19 -19
  208. package/dist/{use-material-translation-CIS2n3RB.js → use-material-translation-CD6QoVal.js} +1 -1
  209. package/dist/{use-return-focus-DNQtADAR.js → use-return-focus-Cevw_6yq.js} +106 -105
  210. package/dist/useLatest-C2PnQEeD.js +8 -0
  211. package/docs/README.md +1 -0
  212. package/docs/components/feedback-and-status.md +10 -1
  213. package/docs/components/form-fields.md +1 -0
  214. package/docs/components/rich-widgets.md +108 -0
  215. package/docs/getting-started.md +1 -0
  216. package/docs/guides/calculator.md +468 -0
  217. package/docs/guides/forms.md +4 -2
  218. package/docs/guides/i18n.md +5 -0
  219. package/docs/previews/rich-widgets-calculator-conversion.webp +0 -0
  220. package/docs/previews/rich-widgets-calculator-point-of-sale.webp +0 -0
  221. package/docs/previews/rich-widgets-calculator.webp +0 -0
  222. package/docs/roadmap.md +9 -3
  223. package/docs/troubleshooting.md +134 -0
  224. package/lib/components/base-content.css +9 -4
  225. package/lib/components/ui/collections/server-table/server-table-phone-row.css +10 -3
  226. package/lib/components/ui/widgets/calculator/calculator-bands.css +146 -0
  227. package/lib/components/ui/widgets/calculator/calculator-display.css +83 -0
  228. package/lib/components/ui/widgets/calculator/calculator-keys.css +118 -0
  229. package/lib/components/ui/widgets/calculator/calculator-pos-ticket.css +185 -0
  230. package/lib/components/ui/widgets/calculator/calculator-pos.css +38 -0
  231. package/lib/components/ui/widgets/calculator/calculator-tape.css +71 -0
  232. package/lib/components/ui/widgets/calculator/calculator.css +97 -0
  233. package/lib/components/ui/widgets/calculator/variants/conversion/conversion.css +98 -0
  234. package/lib/components/ui/widgets/calculator/variants/financial/financial.css +162 -0
  235. package/lib/components/ui/widgets/calculator/variants/programmer/programmer.css +162 -0
  236. package/package.json +17 -3
  237. package/dist/dialog-AGsB3bv4.js +0 -219
  238. package/dist/dist-B7RjY7SL.js +0 -158
  239. package/dist/dist-lmHmz_bu.js +0 -419
@@ -1,14 +1,12 @@
1
- import { t as e } from "./field-blur-context-kZ4SD7xu.js";
1
+ import { t as e } from "./field-blur-context-BLGgf_3z.js";
2
2
  import { t } from "./useEvent-2fKq-6w8.js";
3
- import n, { useCallback as r, useEffect as i, useRef as a } from "react";
4
- import { jsx as o } from "react/jsx-runtime";
5
- import { focusHandle as s } from "@nxgt/material-core/focus-control";
6
- import { layerOf as c, openerOf as l } from "@nxgt/material-core/field-blur-layers";
7
- //#region ../../node_modules/react-use/esm/useLatest.js
8
- var u = function(e) {
9
- var t = a(e);
10
- return t.current = e, t;
11
- }, d = (e) => e.type === "checkbox", f = (e) => e.type === "file", p = (e) => e instanceof Date, m = (e) => e == null, h = (e) => typeof e == "object", g = (e) => !m(e) && !Array.isArray(e) && h(e) && !p(e), _ = (e) => g(e) && e.target ? d(e.target) ? e.target.checked : f(e.target) ? e.target.files : e.target.value : e, v = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), y = (e) => {
3
+ import { t as n } from "./useLatest-C2PnQEeD.js";
4
+ import r, { useCallback as i, useEffect as a, useRef as o } from "react";
5
+ import { jsx as s } from "react/jsx-runtime";
6
+ import { focusHandle as c } from "@nxgt/material-core/focus-control";
7
+ import { layerOf as l, openerOf as u } from "@nxgt/material-core/field-blur-layers";
8
+ //#region ../../node_modules/react-hook-form/dist/index.esm.mjs
9
+ var d = (e) => e.type === "checkbox", f = (e) => e.type === "file", p = (e) => e instanceof Date, m = (e) => e == null, h = (e) => typeof e == "object", g = (e) => !m(e) && !Array.isArray(e) && h(e) && !p(e), _ = (e) => g(e) && e.target ? d(e.target) ? e.target.checked : f(e.target) ? e.target.files : e.target.value : e, v = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), y = (e) => {
12
10
  let t = e.constructor && e.constructor.prototype;
13
11
  return g(t) && t.hasOwnProperty("isPrototypeOf");
14
12
  }, b = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
@@ -64,16 +62,16 @@ var S = {
64
62
  if (E.includes(t)) return;
65
63
  e[t] = a, e = e[t];
66
64
  }
67
- }, I = n.createContext(null);
65
+ }, I = r.createContext(null);
68
66
  I.displayName = "HookFormControlContext";
69
- var L = () => n.useContext(I), ee = (e, t, n, r = !0) => {
67
+ var L = () => r.useContext(I), ee = (e, t, n, r = !0) => {
70
68
  let i = {};
71
69
  for (let a in e) Object.defineProperty(i, a, { get: () => {
72
70
  let i = a;
73
71
  return t._proxyFormState[i] !== C.all && (t._proxyFormState[i] = !r || C.all), n && (n[i] = !0), e[i];
74
72
  } });
75
73
  return i;
76
- }, te = b ? n.useLayoutEffect : n.useEffect, R = (e) => m(e) || !h(e), z = (e, t) => t.length === 0 && !Array.isArray(e) && !y(e);
74
+ }, te = b ? r.useLayoutEffect : r.useEffect, R = (e) => m(e) || !h(e), z = (e, t) => t.length === 0 && !Array.isArray(e) && !y(e);
77
75
  function B(e, t, n = /* @__PURE__ */ new WeakMap()) {
78
76
  if (e === t) return !0;
79
77
  if (R(e) || R(t)) return Object.is(e, t);
@@ -100,25 +98,25 @@ function B(e, t, n = /* @__PURE__ */ new WeakMap()) {
100
98
  return !0;
101
99
  }
102
100
  function ne() {
103
- let e = n.useRef(!1), t = n.useRef(void 0);
101
+ let e = r.useRef(!1), t = r.useRef(void 0);
104
102
  return {
105
- resyncIfNeeded: n.useCallback((n, r, i) => {
103
+ resyncIfNeeded: r.useCallback((n, r, i) => {
106
104
  if (n && e.current) {
107
105
  let e = r();
108
106
  B(t.current, e) || i(e);
109
107
  }
110
108
  e.current = !0;
111
109
  }, []),
112
- snapshot: n.useCallback((e, n) => {
110
+ snapshot: r.useCallback((e, n) => {
113
111
  e && (t.current = x(n()));
114
112
  }, [])
115
113
  };
116
114
  }
117
115
  function re(e) {
118
- let t = L(), { control: r = t, disabled: i, name: a, exact: o } = e || {}, [s, c] = n.useState(() => ({
119
- ...r._formState,
120
- defaultValues: r._defaultValues
121
- })), l = n.useRef({
116
+ let t = L(), { control: n = t, disabled: i, name: a, exact: o } = e || {}, [s, c] = r.useState(() => ({
117
+ ...n._formState,
118
+ defaultValues: n._defaultValues
119
+ })), l = r.useRef({
122
120
  isDirty: !1,
123
121
  isLoading: !1,
124
122
  dirtyFields: !1,
@@ -130,19 +128,19 @@ function re(e) {
130
128
  }), { resyncIfNeeded: u, snapshot: d } = ne();
131
129
  return te(() => {
132
130
  let e = () => ({
133
- ...r._formState,
134
- defaultValues: r._defaultValues
131
+ ...n._formState,
132
+ defaultValues: n._defaultValues
135
133
  });
136
134
  u(!i, e, c);
137
- let t = r._subscribe({
135
+ let t = n._subscribe({
138
136
  name: a,
139
137
  formState: l.current,
140
138
  exact: o,
141
139
  callback: (e) => {
142
140
  !i && c({
143
- ...r._formState,
141
+ ...n._formState,
144
142
  ...e,
145
- defaultValues: r._defaultValues
143
+ defaultValues: n._defaultValues
146
144
  });
147
145
  }
148
146
  });
@@ -155,45 +153,45 @@ function re(e) {
155
153
  o,
156
154
  u,
157
155
  d
158
- ]), n.useEffect(() => {
159
- l.current.isValid && r._setValid(!0);
160
- }, [r]), n.useMemo(() => ee(s, r, l.current, !1), [s, r]);
156
+ ]), r.useEffect(() => {
157
+ l.current.isValid && n._setValid(!0);
158
+ }, [n]), r.useMemo(() => ee(s, n, l.current, !1), [s, n]);
161
159
  }
162
160
  var V = (e) => typeof e == "string", ie = (e, t, n, r, i) => V(e) ? (r && t.watch.add(e), M(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), M(n, e))) : (r && (t.watchAll = !0), n);
163
161
  function ae(e) {
164
- let t = L(), { control: r = t, name: i, defaultValue: a, disabled: o, exact: s, compute: c } = e || {}, l = n.useRef(a), u = n.useRef(c), d = n.useRef(void 0), f = n.useRef(r), p = n.useRef(i);
162
+ let t = L(), { control: n = t, name: i, defaultValue: a, disabled: o, exact: s, compute: c } = e || {}, l = r.useRef(a), u = r.useRef(c), d = r.useRef(void 0), f = r.useRef(n), p = r.useRef(i);
165
163
  u.current = c;
166
- let [m, h] = n.useState(() => {
167
- let e = r._getWatch(i, l.current);
164
+ let [m, h] = r.useState(() => {
165
+ let e = n._getWatch(i, l.current);
168
166
  return u.current ? u.current(e) : e;
169
- }), g = n.useCallback((e) => {
170
- let t = ie(i, r._names, e || r._formValues, !1, l.current);
167
+ }), g = r.useCallback((e) => {
168
+ let t = ie(i, n._names, e || n._formValues, !1, l.current);
171
169
  return u.current ? u.current(t) : t;
172
170
  }, [
173
- r._formValues,
174
- r._names,
171
+ n._formValues,
172
+ n._names,
175
173
  i
176
- ]), _ = n.useCallback((e) => {
174
+ ]), _ = r.useCallback((e) => {
177
175
  if (!o) {
178
- let t = ie(i, r._names, e || r._formValues, !1, l.current);
176
+ let t = ie(i, n._names, e || n._formValues, !1, l.current);
179
177
  if (u.current) {
180
178
  let e = u.current(t);
181
179
  B(e, d.current) || (h(e), d.current = e);
182
180
  } else h(t);
183
181
  }
184
182
  }, [
185
- r._formValues,
186
- r._names,
183
+ n._formValues,
184
+ n._names,
187
185
  o,
188
186
  i
189
- ]), { resyncIfNeeded: v, snapshot: y } = ne(), b = n.useRef(_);
187
+ ]), { resyncIfNeeded: v, snapshot: y } = ne(), b = r.useRef(_);
190
188
  b.current = _;
191
- let x = n.useRef(g);
189
+ let x = r.useRef(g);
192
190
  x.current = g, te(() => {
193
- f.current !== r || !B(p.current, i) ? (f.current = r, p.current = i, b.current()) : v(!o, () => x.current(), (e) => {
191
+ f.current !== n || !B(p.current, i) ? (f.current = n, p.current = i, b.current()) : v(!o, () => x.current(), (e) => {
194
192
  h(e), d.current = e;
195
193
  });
196
- let e = r._subscribe({
194
+ let e = n._subscribe({
197
195
  name: i,
198
196
  formState: { values: !0 },
199
197
  exact: s,
@@ -205,14 +203,14 @@ function ae(e) {
205
203
  e(), y(!o, () => x.current());
206
204
  };
207
205
  }, [
208
- r,
206
+ n,
209
207
  s,
210
208
  i,
211
209
  o,
212
210
  v,
213
211
  y
214
- ]), n.useEffect(() => r._removeUnmounted());
215
- let S = f.current !== r, C = p.current, w = n.useMemo(() => {
212
+ ]), r.useEffect(() => n._removeUnmounted());
213
+ let S = f.current !== n, C = p.current, w = r.useMemo(() => {
216
214
  if (o) return null;
217
215
  let e = !S && !B(C, i);
218
216
  return S || e ? g() : null;
@@ -226,82 +224,82 @@ function ae(e) {
226
224
  return w === null ? m : w;
227
225
  }
228
226
  function oe(e) {
229
- let t = L(), { name: r, disabled: i, control: a = t, shouldUnregister: o, defaultValue: s, exact: c = !0 } = e, l = v(a._names.array, r), u = ae({
227
+ let t = L(), { name: n, disabled: i, control: a = t, shouldUnregister: o, defaultValue: s, exact: c = !0 } = e, l = v(a._names.array, n), u = ae({
230
228
  control: a,
231
- name: r,
232
- defaultValue: n.useMemo(() => M(a._formValues, r, M(a._defaultValues, r, s)), [
229
+ name: n,
230
+ defaultValue: r.useMemo(() => M(a._formValues, n, M(a._defaultValues, n, s)), [
233
231
  a,
234
- r,
232
+ n,
235
233
  s
236
234
  ]),
237
235
  exact: c
238
236
  }), d = re({
239
237
  control: a,
240
- name: r,
238
+ name: n,
241
239
  exact: c
242
- }), f = n.useRef(e), p = n.useRef(null), m = n.useRef(a.register(r, {
240
+ }), f = r.useRef(e), p = r.useRef(null), m = r.useRef(a.register(n, {
243
241
  ...e.rules,
244
242
  value: u,
245
243
  ...N(e.disabled) ? { disabled: e.disabled } : {}
246
244
  }));
247
245
  f.current = e;
248
- let h = n.useMemo(() => Object.defineProperties({}, {
246
+ let h = r.useMemo(() => Object.defineProperties({}, {
249
247
  invalid: {
250
248
  enumerable: !0,
251
- get: () => !!M(d.errors, r)
249
+ get: () => !!M(d.errors, n)
252
250
  },
253
251
  isDirty: {
254
252
  enumerable: !0,
255
- get: () => !!M(d.dirtyFields, r)
253
+ get: () => !!M(d.dirtyFields, n)
256
254
  },
257
255
  isTouched: {
258
256
  enumerable: !0,
259
- get: () => !!M(d.touchedFields, r)
257
+ get: () => !!M(d.touchedFields, n)
260
258
  },
261
259
  isValidating: {
262
260
  enumerable: !0,
263
- get: () => !!M(d.validatingFields, r)
261
+ get: () => !!M(d.validatingFields, n)
264
262
  },
265
263
  error: {
266
264
  enumerable: !0,
267
- get: () => M(d.errors, r)
265
+ get: () => M(d.errors, n)
268
266
  }
269
- }), [d, r]), g = n.useCallback((e) => {
267
+ }), [d, n]), g = r.useCallback((e) => {
270
268
  let t = _(e);
271
- return M(a._fields, r) || (m.current = a.register(r, {
269
+ return M(a._fields, n) || (m.current = a.register(n, {
272
270
  ...f.current.rules,
273
271
  value: t
274
272
  })), m.current.onChange({
275
273
  target: {
276
274
  value: _(e),
277
- name: r
275
+ name: n
278
276
  },
279
277
  type: S.CHANGE
280
278
  });
281
- }, [r, a]), y = n.useCallback(() => m.current.onBlur({
279
+ }, [n, a]), y = r.useCallback(() => m.current.onBlur({
282
280
  target: {
283
- value: M(a._formValues, r),
284
- name: r
281
+ value: M(a._formValues, n),
282
+ name: n
285
283
  },
286
284
  type: S.BLUR
287
- }), [r, a._formValues]), b = n.useCallback((e) => {
285
+ }), [n, a._formValues]), b = r.useCallback((e) => {
288
286
  e && (p.current = {
289
287
  focus: () => P(e.focus) && e.focus(),
290
288
  select: () => P(e.select) && e.select(),
291
289
  setCustomValidity: (t) => P(e.setCustomValidity) && e.setCustomValidity(t),
292
290
  reportValidity: () => P(e.reportValidity) && e.reportValidity()
293
291
  });
294
- let t = M(a._fields, r);
292
+ let t = M(a._fields, n);
295
293
  t && t._f && e && (t._f.ref = p.current);
296
- }, [a._fields, r]), C = n.useMemo(() => ({
297
- name: r,
294
+ }, [a._fields, n]), C = r.useMemo(() => ({
295
+ name: n,
298
296
  value: u,
299
297
  ...N(i) || d.disabled ? { disabled: d.disabled || i } : {},
300
298
  onChange: g,
301
299
  onBlur: y,
302
300
  ref: b
303
301
  }), [
304
- r,
302
+ n,
305
303
  i,
306
304
  d.disabled,
307
305
  g,
@@ -309,9 +307,9 @@ function oe(e) {
309
307
  b,
310
308
  u
311
309
  ]);
312
- return n.useEffect(() => {
310
+ return r.useEffect(() => {
313
311
  let e = a._options.shouldUnregister || o;
314
- m.current = a.register(r, {
312
+ m.current = a.register(n, {
315
313
  ...f.current.rules,
316
314
  ...N(f.current.disabled) ? { disabled: f.current.disabled } : {}
317
315
  });
@@ -319,32 +317,32 @@ function oe(e) {
319
317
  let n = M(a._fields, e);
320
318
  n && n._f && (n._f.mount = t);
321
319
  };
322
- if (t(r, !0), e) {
323
- let e = x(M(o ? a._defaultValues : a._options.values || a._defaultValues, r, M(a._options.defaultValues, r, f.current.defaultValue)));
324
- F(a._defaultValues, r, e), k(M(a._formValues, r)) && F(a._formValues, r, e);
320
+ if (t(n, !0), e) {
321
+ let e = x(M(o ? a._defaultValues : a._options.values || a._defaultValues, n, M(a._options.defaultValues, n, f.current.defaultValue)));
322
+ F(a._defaultValues, n, e), k(M(a._formValues, n)) && F(a._formValues, n, e);
325
323
  }
326
- if (!l && a.register(r), p.current) {
327
- let e = M(a._fields, r);
324
+ if (!l && a.register(n), p.current) {
325
+ let e = M(a._fields, n);
328
326
  e && e._f && (e._f.ref = p.current);
329
327
  }
330
328
  return () => {
331
- (l ? e && !a._state.action : e) ? a.unregister(r) : t(r, !1);
329
+ (l ? e && !a._state.action : e) ? a.unregister(n) : t(n, !1);
332
330
  };
333
331
  }, [
334
- r,
332
+ n,
335
333
  a,
336
334
  l,
337
335
  o
338
- ]), n.useEffect(() => {
336
+ ]), r.useEffect(() => {
339
337
  a._setDisabledField({
340
338
  disabled: i,
341
- name: r
339
+ name: n
342
340
  });
343
341
  }, [
344
342
  i,
345
- r,
343
+ n,
346
344
  a
347
- ]), n.useMemo(() => ({
345
+ ]), r.useMemo(() => ({
348
346
  field: C,
349
347
  formState: d,
350
348
  fieldState: h
@@ -553,165 +551,165 @@ function Q(e, t) {
553
551
  }
554
552
  var ke = (e, t, n) => (e[t] = n, e);
555
553
  function Ae(e) {
556
- let t = L(), { control: r = t, name: i, keyName: a = "id", disabled: o, shouldUnregister: s, rules: c } = e, [l, u] = n.useState(r._getFieldArray(i)), d = n.useRef(r._getFieldArray(i).map(H)), f = n.useRef(!1);
557
- o || r._names.array.add(i), n.useMemo(() => !o && c && l.length >= 0 && r.register(i, c), [
558
- r,
554
+ let t = L(), { control: n = t, name: i, keyName: a = "id", disabled: o, shouldUnregister: s, rules: c } = e, [l, u] = r.useState(n._getFieldArray(i)), d = r.useRef(n._getFieldArray(i).map(H)), f = r.useRef(!1);
555
+ o || n._names.array.add(i), r.useMemo(() => !o && c && l.length >= 0 && n.register(i, c), [
556
+ n,
559
557
  i,
560
558
  l.length,
561
559
  c,
562
560
  o
563
561
  ]), te(() => {
564
- if (!o) return r._subjects.array.subscribe({ next: ({ values: e, name: t }) => {
562
+ if (!o) return n._subjects.array.subscribe({ next: ({ values: e, name: t }) => {
565
563
  if (t === i || !t) {
566
564
  let n = M(e, i);
567
565
  Array.isArray(n) ? (u(n), d.current = n.map(H)) : t || (u([]), d.current = []);
568
566
  }
569
567
  } }).unsubscribe;
570
568
  }, [
571
- r,
569
+ n,
572
570
  i,
573
571
  o
574
572
  ]);
575
- let p = n.useCallback((e) => {
576
- f.current = !0, r._setFieldArray(i, e);
577
- }, [r, i]);
578
- return n.useEffect(() => {
573
+ let p = r.useCallback((e) => {
574
+ f.current = !0, n._setFieldArray(i, e);
575
+ }, [n, i]);
576
+ return r.useEffect(() => {
579
577
  if (o) {
580
- r._state.actionArrayLengths.delete(i);
578
+ n._state.actionArrayLengths.delete(i);
581
579
  return;
582
580
  }
583
- r._state.action = !1, r._state.actionArrayLengths.delete(i), le(i, r._names) && r._subjects.state.next({ ...r._formState });
584
- let e = U(r._options.mode);
585
- if (f.current && (!e.isOnSubmit || r._formState.isSubmitted) && !U(r._options.reValidateMode).isOnSubmit && !e.isOnBlur) if (r._options.resolver) r._runSchema([i]).then((e) => {
586
- r._updateIsValidating([i]);
587
- let t = M(e.errors, i), n = M(r._formState.errors, i), a = n && (n.type || n.root?.type), o = n && (n.message || n.root?.message);
588
- (n ? !t && a || t && (a !== t.type || o !== t.message) : t && t.type) && (t ? g(t) && !Object.keys(t).some((e) => !Number.isNaN(+e)) ? ue(r._formState.errors, { [i]: t }, i) : F(r._formState.errors, i, t) : Q(r._formState.errors, i), r._subjects.state.next({ errors: r._formState.errors }));
581
+ n._state.action = !1, n._state.actionArrayLengths.delete(i), le(i, n._names) && n._subjects.state.next({ ...n._formState });
582
+ let e = U(n._options.mode);
583
+ if (f.current && (!e.isOnSubmit || n._formState.isSubmitted) && !U(n._options.reValidateMode).isOnSubmit && !e.isOnBlur) if (n._options.resolver) n._runSchema([i]).then((e) => {
584
+ n._updateIsValidating([i]);
585
+ let t = M(e.errors, i), r = M(n._formState.errors, i), a = r && (r.type || r.root?.type), o = r && (r.message || r.root?.message);
586
+ (r ? !t && a || t && (a !== t.type || o !== t.message) : t && t.type) && (t ? g(t) && !Object.keys(t).some((e) => !Number.isNaN(+e)) ? ue(n._formState.errors, { [i]: t }, i) : F(n._formState.errors, i, t) : Q(n._formState.errors, i), n._subjects.state.next({ errors: n._formState.errors }));
589
587
  });
590
588
  else {
591
- let e = M(r._fields, i);
592
- e && e._f && !(U(r._options.reValidateMode).isOnSubmit && U(r._options.mode).isOnSubmit) && ve(e, r._names.disabled, r._formValues, r._options.criteriaMode === C.all, r._options.shouldUseNativeValidation, !0).then((e) => !G(e) && r._subjects.state.next({ errors: ue(r._formState.errors, e, i) }));
589
+ let e = M(n._fields, i);
590
+ e && e._f && !(U(n._options.reValidateMode).isOnSubmit && U(n._options.mode).isOnSubmit) && ve(e, n._names.disabled, n._formValues, n._options.criteriaMode === C.all, n._options.shouldUseNativeValidation, !0).then((e) => !G(e) && n._subjects.state.next({ errors: ue(n._formState.errors, e, i) }));
593
591
  }
594
- f.current && r._subjects.state.next({
592
+ f.current && n._subjects.state.next({
595
593
  name: i,
596
- values: x(r._formValues)
597
- }), r._names.focus && W(r._fields, (e, t) => {
598
- if (r._names.focus && t.startsWith(r._names.focus) && e.focus) return e.focus(), 1;
599
- }), r._names.focus = "", r._setValid(), f.current = !1;
594
+ values: x(n._formValues)
595
+ }), n._names.focus && W(n._fields, (e, t) => {
596
+ if (n._names.focus && t.startsWith(n._names.focus) && e.focus) return e.focus(), 1;
597
+ }), n._names.focus = "", n._setValid(), f.current = !1;
600
598
  }, [
601
599
  l,
602
600
  i,
603
- r,
601
+ n,
604
602
  o
605
- ]), n.useEffect(() => (o || !M(r._formValues, i) && r._setFieldArray(i), () => {
606
- if (r._state.actionArrayLengths.delete(i), o) return;
607
- let e = !(r._options.shouldUnregister || s);
608
- f.current && e && r._subjects.state.next({
603
+ ]), r.useEffect(() => (o || !M(n._formValues, i) && n._setFieldArray(i), () => {
604
+ if (n._state.actionArrayLengths.delete(i), o) return;
605
+ let e = !(n._options.shouldUnregister || s);
606
+ f.current && e && n._subjects.state.next({
609
607
  name: i,
610
- values: x(r._formValues)
608
+ values: x(n._formValues)
611
609
  }), e ? ((e, t) => {
612
- let n = M(r._fields, e);
613
- n && n._f && (n._f.mount = t);
614
- })(i, !1) : r.unregister(i);
610
+ let r = M(n._fields, e);
611
+ r && r._f && (r._f.mount = t);
612
+ })(i, !1) : n.unregister(i);
615
613
  }), [
616
614
  i,
617
- r,
615
+ n,
618
616
  a,
619
617
  s,
620
618
  o
621
619
  ]), {
622
- swap: n.useCallback((e, t) => {
620
+ swap: r.useCallback((e, t) => {
623
621
  if (o) return;
624
- let n = r._getFieldArray(i);
625
- Ee(n, e, t), Ee(d.current, e, t), p(n), u(n), r._setFieldArray(i, n, Ee, {
622
+ let r = n._getFieldArray(i);
623
+ Ee(r, e, t), Ee(d.current, e, t), p(r), u(r), n._setFieldArray(i, r, Ee, {
626
624
  argA: e,
627
625
  argB: t
628
626
  }, !1);
629
627
  }, [
630
628
  p,
631
629
  i,
632
- r,
630
+ n,
633
631
  o
634
632
  ]),
635
- move: n.useCallback((e, t) => {
633
+ move: r.useCallback((e, t) => {
636
634
  if (o) return;
637
- let n = r._getFieldArray(i);
638
- Z(n, e, t), Z(d.current, e, t), p(n), u(n), r._setFieldArray(i, n, Z, {
635
+ let r = n._getFieldArray(i);
636
+ Z(r, e, t), Z(d.current, e, t), p(r), u(r), n._setFieldArray(i, r, Z, {
639
637
  argA: e,
640
638
  argB: t
641
639
  }, !1);
642
640
  }, [
643
641
  p,
644
642
  i,
645
- r,
643
+ n,
646
644
  o
647
645
  ]),
648
- prepend: n.useCallback((e, t) => {
646
+ prepend: r.useCallback((e, t) => {
649
647
  if (o) return;
650
- let n = X(x(e)), a = Se(r._getFieldArray(i), n);
651
- r._names.focus = ce(i, 0, t), d.current = Se(d.current, n.map(H)), p(a), u(a), r._setFieldArray(i, a, Se, { argA: be(e) });
648
+ let r = X(x(e)), a = Se(n._getFieldArray(i), r);
649
+ n._names.focus = ce(i, 0, t), d.current = Se(d.current, r.map(H)), p(a), u(a), n._setFieldArray(i, a, Se, { argA: be(e) });
652
650
  }, [
653
651
  p,
654
652
  i,
655
- r,
653
+ n,
656
654
  o
657
655
  ]),
658
- append: n.useCallback((e, t) => {
656
+ append: r.useCallback((e, t) => {
659
657
  if (o) return;
660
- let n = X(x(e)), a = ye(r._getFieldArray(i), n);
661
- r._names.focus = ce(i, a.length - 1, t), d.current = ye(d.current, n.map(H)), p(a), u(a), r._setFieldArray(i, a, ye, { argA: be(e) });
658
+ let r = X(x(e)), a = ye(n._getFieldArray(i), r);
659
+ n._names.focus = ce(i, a.length - 1, t), d.current = ye(d.current, r.map(H)), p(a), u(a), n._setFieldArray(i, a, ye, { argA: be(e) });
662
660
  }, [
663
661
  p,
664
662
  i,
665
- r,
663
+ n,
666
664
  o
667
665
  ]),
668
- remove: n.useCallback((e) => {
666
+ remove: r.useCallback((e) => {
669
667
  if (o) return;
670
- let t = Te(r._getFieldArray(i), e);
671
- d.current = Te(d.current, e), p(t), u(t), !Array.isArray(M(r._fields, i)) && F(r._fields, i, void 0), r._setFieldArray(i, t, Te, { argA: e });
668
+ let t = Te(n._getFieldArray(i), e);
669
+ d.current = Te(d.current, e), p(t), u(t), !Array.isArray(M(n._fields, i)) && F(n._fields, i, void 0), n._setFieldArray(i, t, Te, { argA: e });
672
670
  }, [
673
671
  p,
674
672
  i,
675
- r,
673
+ n,
676
674
  o
677
675
  ]),
678
- insert: n.useCallback((e, t, n) => {
676
+ insert: r.useCallback((e, t, r) => {
679
677
  if (o) return;
680
- let a = X(x(t)), s = xe(r._getFieldArray(i), e, a);
681
- r._names.focus = ce(i, e, n), d.current = xe(d.current, e, a.map(H)), p(s), u(s), r._setFieldArray(i, s, xe, {
678
+ let a = X(x(t)), s = xe(n._getFieldArray(i), e, a);
679
+ n._names.focus = ce(i, e, r), d.current = xe(d.current, e, a.map(H)), p(s), u(s), n._setFieldArray(i, s, xe, {
682
680
  argA: e,
683
681
  argB: be(t)
684
682
  });
685
683
  }, [
686
684
  p,
687
685
  i,
688
- r,
686
+ n,
689
687
  o
690
688
  ]),
691
- update: n.useCallback((e, t) => {
689
+ update: r.useCallback((e, t) => {
692
690
  if (o) return;
693
- let n = x(t), a = ke(r._getFieldArray(i), e, n);
694
- d.current = [...a].map((t, n) => !t || n === e ? H() : d.current[n]), p(a), u([...a]), r._setFieldArray(i, a, ke, {
691
+ let r = x(t), a = ke(n._getFieldArray(i), e, r);
692
+ d.current = [...a].map((t, n) => !t || n === e ? H() : d.current[n]), p(a), u([...a]), n._setFieldArray(i, a, ke, {
695
693
  argA: e,
696
- argB: n
694
+ argB: r
697
695
  }, !0, !1);
698
696
  }, [
699
697
  p,
700
698
  i,
701
- r,
699
+ n,
702
700
  o
703
701
  ]),
704
- replace: n.useCallback((e) => {
702
+ replace: r.useCallback((e) => {
705
703
  if (o) return;
706
704
  let t = X(x(e));
707
- d.current = t.map(H), p([...t]), u([...t]), r._setFieldArray(i, [...t], (e) => e, {}, !0, !1);
705
+ d.current = t.map(H), p([...t]), u([...t]), n._setFieldArray(i, [...t], (e) => e, {}, !0, !1);
708
706
  }, [
709
707
  p,
710
708
  i,
711
- r,
709
+ n,
712
710
  o
713
711
  ]),
714
- fields: n.useMemo(() => l.map((e, t) => ({
712
+ fields: r.useMemo(() => l.map((e, t) => ({
715
713
  ...e,
716
714
  ...N(o) ? { disabled: o } : {},
717
715
  [a]: d.current[t] || H()
@@ -729,9 +727,9 @@ var je = (e) => {
729
727
  for (let e of Object.keys(r)) t[`${n}.${e}`] = r[e];
730
728
  } else t[n] = e[n];
731
729
  return t;
732
- }, Me = n.createContext(null);
730
+ }, Me = r.createContext(null);
733
731
  Me.displayName = "HookFormContext";
734
- var Ne = () => n.useContext(Me), Pe = () => {
732
+ var Ne = () => r.useContext(Me), Pe = () => {
735
733
  let e = [];
736
734
  return {
737
735
  get observers() {
@@ -1530,7 +1528,7 @@ function lt(e = {}) {
1530
1528
  };
1531
1529
  }
1532
1530
  function ut(e = {}) {
1533
- let t = n.useRef(void 0), r = n.useRef(void 0), i = n.useRef(e.formControl), [a, o] = n.useState(() => ({
1531
+ let t = r.useRef(void 0), n = r.useRef(void 0), i = r.useRef(e.formControl), [a, o] = r.useState(() => ({
1534
1532
  ...x(ct),
1535
1533
  isLoading: P(e.defaultValues),
1536
1534
  errors: e.errors || {},
@@ -1575,29 +1573,29 @@ function ut(e = {}) {
1575
1573
  s,
1576
1574
  c,
1577
1575
  l
1578
- ]), n.useEffect(() => s._disableForm(e.disabled), [s, e.disabled]), n.useEffect(() => {
1576
+ ]), r.useEffect(() => s._disableForm(e.disabled), [s, e.disabled]), r.useEffect(() => {
1579
1577
  e.mode && (s._options.mode = e.mode), e.reValidateMode && (s._options.reValidateMode = e.reValidateMode);
1580
1578
  }, [
1581
1579
  s,
1582
1580
  e.mode,
1583
1581
  e.reValidateMode
1584
- ]), n.useEffect(() => {
1582
+ ]), r.useEffect(() => {
1585
1583
  e.errors && (s._setErrors(e.errors), s._focusError());
1586
- }, [s, e.errors]), n.useEffect(() => {
1584
+ }, [s, e.errors]), r.useEffect(() => {
1587
1585
  e.shouldUnregister && s._subjects.state.next({ values: s._getWatch() });
1588
- }, [s, e.shouldUnregister]), n.useEffect(() => {
1586
+ }, [s, e.shouldUnregister]), r.useEffect(() => {
1589
1587
  if (s._proxyFormState.isDirty) {
1590
1588
  let e = s._getDirty();
1591
1589
  e !== a.isDirty && s._subjects.state.next({ isDirty: e });
1592
1590
  }
1593
- }, [s, a.isDirty]), n.useEffect(() => {
1594
- e.values && !B(e.values, r.current) ? (s._reset(e.values, {
1591
+ }, [s, a.isDirty]), r.useEffect(() => {
1592
+ e.values && !B(e.values, n.current) ? (s._reset(e.values, {
1595
1593
  keepFieldsRef: !0,
1596
1594
  ...s._options.resetOptions
1597
- }), s._options.resetOptions?.keepIsValid || s._setValid(), r.current = e.values, o((e) => ({ ...e }))) : s._resetDefaultValues();
1598
- }, [s, e.values]), n.useEffect(() => {
1595
+ }), s._options.resetOptions?.keepIsValid || s._setValid(), n.current = e.values, o((e) => ({ ...e }))) : s._resetDefaultValues();
1596
+ }, [s, e.values]), r.useEffect(() => {
1599
1597
  s._state.mount || (s._setValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
1600
- }), t.current.formState = n.useMemo(() => ee(a, s), [s, a]), t.current;
1598
+ }), t.current.formState = r.useMemo(() => ee(a, s), [s, a]), t.current;
1601
1599
  }
1602
1600
  //#endregion
1603
1601
  //#region lib/components/ui/forms/use-field-blur.ts
@@ -1609,47 +1607,47 @@ function pt(e, t) {
1609
1607
  for (let t of e.roots) t.isConnected || e.roots.delete(t);
1610
1608
  let n = [...e.roots];
1611
1609
  if (!n.length) return !1;
1612
- if (n.some((e) => e.contains(t))) return e.inside || (e.before = new Set(t.ownerDocument?.body.childNodes ?? []), e.home = new Set(n.map(c)), e.opened = /* @__PURE__ */ new Set()), e.inside = !0, !1;
1610
+ if (n.some((e) => e.contains(t))) return e.inside || (e.before = new Set(t.ownerDocument?.body.childNodes ?? []), e.home = new Set(n.map(l)), e.opened = /* @__PURE__ */ new Set()), e.inside = !0, !1;
1613
1611
  if (!e.inside) return !1;
1614
- let r = c(t);
1612
+ let r = l(t);
1615
1613
  if (e.home.has(r)) return !0;
1616
1614
  if (!r || e.opened.has(r)) return !1;
1617
- let i = l(n, e, r);
1615
+ let i = u(n, e, r);
1618
1616
  return i === "theirs" || !i && e.before.has(r) ? !0 : (e.opened.add(r), !1);
1619
1617
  }
1620
- function mt(e, n) {
1621
- let o = u(n), c = u(e), l = a({
1618
+ function mt(e, r) {
1619
+ let s = n(r), l = n(e), u = o({
1622
1620
  roots: /* @__PURE__ */ new Set(),
1623
1621
  inside: !1,
1624
1622
  before: /* @__PURE__ */ new Set(),
1625
1623
  home: /* @__PURE__ */ new Set(),
1626
1624
  opened: /* @__PURE__ */ new Set()
1627
- }).current, d = r((e) => {
1628
- if (e) return l.roots.add(e), o.current?.(s(l.roots)), () => {
1629
- l.roots.delete(e);
1625
+ }).current, d = i((e) => {
1626
+ if (e) return u.roots.add(e), s.current?.(c(u.roots)), () => {
1627
+ u.roots.delete(e);
1630
1628
  };
1631
- }, [l, o]), f = r(() => {
1632
- l.inside = !1, c.current();
1633
- }, [l, c]), p = r((e) => {
1629
+ }, [u, s]), f = i(() => {
1630
+ u.inside = !1, l.current();
1631
+ }, [u, l]), p = i((e) => {
1634
1632
  let t = e.target;
1635
- t instanceof Node && (clearTimeout(l.settle), pt(l, t) && f());
1636
- }, [l, f]), m = r((e) => {
1637
- !l.inside || e.relatedTarget || (clearTimeout(l.settle), l.settle = setTimeout(() => {
1638
- l.settle = setTimeout(() => {
1633
+ t instanceof Node && (clearTimeout(u.settle), pt(u, t) && f());
1634
+ }, [u, f]), m = i((e) => {
1635
+ !u.inside || e.relatedTarget || (clearTimeout(u.settle), u.settle = setTimeout(() => {
1636
+ u.settle = setTimeout(() => {
1639
1637
  let e = dt?.activeElement;
1640
- l.inside && (!e || e === dt?.body) && f();
1638
+ u.inside && (!e || e === dt?.body) && f();
1641
1639
  });
1642
1640
  }));
1643
- }, [l, f]);
1644
- return t("focusin", p, dt, ft), t("focusout", m, dt, ft), i(() => () => clearTimeout(l.settle), [l]), d;
1641
+ }, [u, f]);
1642
+ return t("focusin", p, dt, ft), t("focusout", m, dt, ft), a(() => () => clearTimeout(u.settle), [u]), d;
1645
1643
  }
1646
1644
  //#endregion
1647
1645
  //#region lib/components/ui/forms/field-blur.tsx
1648
1646
  function ht({ onBlur: t, focusRef: n, children: r }) {
1649
- return /* @__PURE__ */ o(e, {
1647
+ return /* @__PURE__ */ s(e, {
1650
1648
  value: mt(t, n),
1651
1649
  children: r
1652
1650
  });
1653
1651
  }
1654
1652
  //#endregion
1655
- export { M as a, Ae as c, re as d, ae as f, K as i, ut as l, mt as n, F as o, u as p, se as r, oe as s, ht as t, Ne as u };
1653
+ export { M as a, Ae as c, re as d, ae as f, K as i, ut as l, mt as n, F as o, se as r, oe as s, ht as t, Ne as u };