@boxcustodia/library 0.0.6 → 0.0.7

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 (419) hide show
  1. package/dist/index.es10.js +1 -1
  2. package/dist/index.es100.js +3 -1061
  3. package/dist/index.es101.js +12 -3672
  4. package/dist/index.es102.js +5 -4
  5. package/dist/index.es103.js +57 -4
  6. package/dist/index.es105.js +12 -4
  7. package/dist/index.es106.js +4 -7
  8. package/dist/index.es107.js +21 -5
  9. package/dist/index.es108.js +12 -57
  10. package/dist/index.es109.js +4 -4
  11. package/dist/index.es110.js +12 -224
  12. package/dist/index.es111.js +1062 -11
  13. package/dist/index.es112.js +4 -11
  14. package/dist/index.es113.js +4 -41
  15. package/dist/index.es114.js +222 -19
  16. package/dist/index.es115.js +4 -5
  17. package/dist/index.es116.js +41 -12
  18. package/dist/index.es117.js +4 -4
  19. package/dist/index.es118.js +2 -2
  20. package/dist/index.es119.js +11 -11
  21. package/dist/index.es120.js +1 -1
  22. package/dist/index.es121.js +1 -1
  23. package/dist/index.es122.js +11 -88
  24. package/dist/index.es123.js +88 -4
  25. package/dist/index.es124.js +211 -28
  26. package/dist/index.es125.js +33 -13
  27. package/dist/index.es126.js +5 -3
  28. package/dist/index.es127.js +5 -5
  29. package/dist/index.es128.js +4 -8
  30. package/dist/index.es129.js +7 -215
  31. package/dist/index.es13.js +1 -1
  32. package/dist/index.es131.js +1 -1
  33. package/dist/index.es132.js +1 -1
  34. package/dist/index.es137.js +11 -10
  35. package/dist/index.es138.js +205 -21
  36. package/dist/index.es139.js +10 -36
  37. package/dist/index.es14.js +1 -1
  38. package/dist/index.es140.js +17 -7
  39. package/dist/index.es141.js +36 -11
  40. package/dist/index.es142.js +11 -205
  41. package/dist/index.es145.js +1 -1
  42. package/dist/index.es146.js +3 -3
  43. package/dist/index.es147.js +2 -2
  44. package/dist/index.es148.js +1 -1
  45. package/dist/index.es149.js +1 -1
  46. package/dist/index.es15.js +1 -1
  47. package/dist/index.es151.js +3 -3
  48. package/dist/index.es155.js +646 -40
  49. package/dist/index.es156.js +193 -625
  50. package/dist/index.es157.js +3 -217
  51. package/dist/index.es158.js +4 -4
  52. package/dist/index.es159.js +45 -3
  53. package/dist/index.es160.js +7 -45
  54. package/dist/index.es161.js +5 -7
  55. package/dist/index.es162.js +28 -6
  56. package/dist/index.es163.js +43 -27
  57. package/dist/index.es164.js +6 -118
  58. package/dist/index.es165.js +3 -35
  59. package/dist/index.es166.js +2054 -2
  60. package/dist/index.es167.js +118 -2
  61. package/dist/index.es168.js +32 -20
  62. package/dist/index.es169.js +2 -9
  63. package/dist/index.es170.js +2 -38
  64. package/dist/index.es171.js +14 -11
  65. package/dist/index.es172.js +9 -6
  66. package/dist/index.es173.js +40 -3
  67. package/dist/index.es174.js +17 -2053
  68. package/dist/index.es186.js +3 -3
  69. package/dist/index.es188.js +7 -11
  70. package/dist/index.es189.js +5 -7
  71. package/dist/index.es190.js +4 -5
  72. package/dist/index.es191.js +17 -4
  73. package/dist/index.es192.js +5 -17
  74. package/dist/index.es193.js +5 -5
  75. package/dist/index.es194.js +8 -5
  76. package/dist/index.es195.js +6 -9
  77. package/dist/index.es196.js +7 -6
  78. package/dist/index.es197.js +15 -6
  79. package/dist/index.es198.js +13 -15
  80. package/dist/index.es199.js +12 -12
  81. package/dist/index.es200.js +6 -13
  82. package/dist/index.es201.js +6 -6
  83. package/dist/index.es202.js +6 -6
  84. package/dist/index.es203.js +4 -6
  85. package/dist/index.es204.js +515 -4
  86. package/dist/index.es205.js +48 -514
  87. package/dist/index.es206.js +18 -50
  88. package/dist/index.es207.js +9 -17
  89. package/dist/index.es208.js +19 -10
  90. package/dist/index.es209.js +8 -18
  91. package/dist/index.es210.js +7 -8
  92. package/dist/index.es211.js +7 -7
  93. package/dist/index.es212.js +5 -7
  94. package/dist/index.es213.js +6 -5
  95. package/dist/index.es214.js +9 -6
  96. package/dist/index.es215.js +5 -9
  97. package/dist/index.es216.js +8 -5
  98. package/dist/index.es217.js +12 -8
  99. package/dist/index.es218.js +9 -12
  100. package/dist/index.es219.js +8 -9
  101. package/dist/index.es220.js +10 -8
  102. package/dist/index.es221.js +14 -10
  103. package/dist/index.es222.js +6 -14
  104. package/dist/index.es223.js +6 -6
  105. package/dist/index.es224.js +6 -6
  106. package/dist/index.es225.js +6 -6
  107. package/dist/index.es226.js +6 -6
  108. package/dist/index.es227.js +9 -6
  109. package/dist/index.es228.js +84 -9
  110. package/dist/index.es229.js +65 -85
  111. package/dist/index.es230.js +38 -65
  112. package/dist/index.es231.js +9 -37
  113. package/dist/index.es232.js +8 -9
  114. package/dist/index.es233.js +6 -7
  115. package/dist/index.es234.js +10 -7
  116. package/dist/index.es235.js +7 -10
  117. package/dist/index.es236.js +7 -7
  118. package/dist/index.es237.js +6 -7
  119. package/dist/index.es238.js +5 -6
  120. package/dist/index.es239.js +15 -5
  121. package/dist/index.es240.js +11 -15
  122. package/dist/index.es241.js +177 -24
  123. package/dist/index.es242.js +5 -5
  124. package/dist/index.es243.js +5 -5
  125. package/dist/index.es245.js +195 -172
  126. package/dist/index.es246.js +20 -199
  127. package/dist/index.es247.js +25 -22
  128. package/dist/index.es248.js +369 -23
  129. package/dist/index.es249.js +2 -371
  130. package/dist/index.es250.js +397 -25
  131. package/dist/index.es251.js +722 -4
  132. package/dist/index.es252.js +282 -7
  133. package/dist/index.es253.js +60 -13
  134. package/dist/index.es254.js +9 -13
  135. package/dist/index.es255.js +28 -134
  136. package/dist/index.es256.js +199 -32
  137. package/dist/index.es257.js +25 -462
  138. package/dist/index.es258.js +4 -131
  139. package/dist/index.es259.js +8 -27
  140. package/dist/index.es260.js +13 -4
  141. package/dist/index.es261.js +13 -26
  142. package/dist/index.es262.js +134 -7
  143. package/dist/index.es263.js +31 -11
  144. package/dist/index.es264.js +460 -26
  145. package/dist/index.es265.js +130 -47
  146. package/dist/index.es266.js +27 -31
  147. package/dist/index.es267.js +4 -43
  148. package/dist/index.es268.js +26 -158
  149. package/dist/index.es269.js +6 -32
  150. package/dist/index.es27.js +1 -1
  151. package/dist/index.es270.js +12 -2
  152. package/dist/index.es271.js +26 -77
  153. package/dist/index.es272.js +48 -18
  154. package/dist/index.es273.js +31 -16
  155. package/dist/index.es274.js +44 -8
  156. package/dist/index.es275.js +159 -2
  157. package/dist/index.es276.js +32 -396
  158. package/dist/index.es277.js +2 -723
  159. package/dist/index.es278.js +71 -274
  160. package/dist/index.es279.js +18 -60
  161. package/dist/index.es28.js +3 -3
  162. package/dist/index.es280.js +25 -10
  163. package/dist/index.es281.js +16 -29
  164. package/dist/index.es282.js +8 -199
  165. package/dist/index.es286.js +14 -24
  166. package/dist/index.es287.js +3 -29
  167. package/dist/index.es288.js +5 -5
  168. package/dist/index.es289.js +56 -14
  169. package/dist/index.es29.js +6 -6
  170. package/dist/index.es290.js +28 -3
  171. package/dist/index.es291.js +46 -4
  172. package/dist/index.es292.js +64 -54
  173. package/dist/index.es293.js +32 -22
  174. package/dist/index.es294.js +13 -41
  175. package/dist/index.es295.js +48 -47
  176. package/dist/index.es296.js +50 -20
  177. package/dist/index.es297.js +63 -13
  178. package/dist/index.es298.js +43 -42
  179. package/dist/index.es299.js +26 -48
  180. package/dist/index.es300.js +26 -48
  181. package/dist/index.es301.js +37 -47
  182. package/dist/index.es302.js +25 -22
  183. package/dist/index.es303.js +34 -38
  184. package/dist/index.es304.js +53 -40
  185. package/dist/index.es305.js +50 -27
  186. package/dist/index.es306.js +88 -34
  187. package/dist/index.es307.js +32 -57
  188. package/dist/index.es308.js +35 -60
  189. package/dist/index.es309.js +38 -88
  190. package/dist/index.es31.js +2 -2
  191. package/dist/index.es310.js +23 -39
  192. package/dist/index.es311.js +22 -39
  193. package/dist/index.es312.js +22 -39
  194. package/dist/index.es313.js +19 -19
  195. package/dist/index.es314.js +18 -18
  196. package/dist/index.es315.js +18 -18
  197. package/dist/index.es316.js +14 -25
  198. package/dist/index.es317.js +38 -22
  199. package/dist/index.es318.js +38 -22
  200. package/dist/index.es319.js +14 -14
  201. package/dist/index.es32.js +2 -2
  202. package/dist/index.es320.js +14 -40
  203. package/dist/index.es321.js +23 -44
  204. package/dist/index.es322.js +29 -20
  205. package/dist/index.es323.js +5 -20
  206. package/dist/index.es336.js +2 -6
  207. package/dist/index.es337.js +2 -34
  208. package/dist/index.es338.js +6 -26
  209. package/dist/index.es339.js +34 -18
  210. package/dist/index.es34.js +6 -6
  211. package/dist/index.es340.js +25 -4
  212. package/dist/index.es341.js +18 -231
  213. package/dist/index.es342.js +5 -100
  214. package/dist/index.es343.js +229 -26
  215. package/dist/index.es344.js +80 -35
  216. package/dist/index.es345.js +28 -2
  217. package/dist/index.es346.js +55 -2
  218. package/dist/index.es347.js +2 -334
  219. package/dist/index.es348.js +106 -31
  220. package/dist/index.es349.js +75 -16
  221. package/dist/index.es350.js +35 -29
  222. package/dist/index.es351.js +64 -3
  223. package/dist/index.es352.js +34 -107
  224. package/dist/index.es353.js +60 -71
  225. package/dist/index.es354.js +111 -34
  226. package/dist/index.es355.js +90 -60
  227. package/dist/index.es356.js +41 -32
  228. package/dist/index.es357.js +3 -66
  229. package/dist/index.es358.js +3 -113
  230. package/dist/index.es359.js +3 -94
  231. package/dist/index.es360.js +3 -43
  232. package/dist/index.es361.js +2 -2
  233. package/dist/index.es362.js +2 -2
  234. package/dist/index.es363.js +2 -2
  235. package/dist/index.es364.js +2 -2
  236. package/dist/index.es365.js +2 -2
  237. package/dist/index.es366.js +241 -4
  238. package/dist/index.es367.js +384 -4
  239. package/dist/index.es368.js +169 -4
  240. package/dist/index.es369.js +153 -4
  241. package/dist/index.es370.js +88 -187
  242. package/dist/index.es371.js +4 -384
  243. package/dist/index.es372.js +4 -169
  244. package/dist/index.es373.js +4 -153
  245. package/dist/index.es374.js +4 -142
  246. package/dist/index.es375.js +2 -2
  247. package/dist/index.es376.js +2 -2
  248. package/dist/index.es377.js +334 -2
  249. package/dist/index.es378.js +31 -2
  250. package/dist/index.es379.js +17 -2
  251. package/dist/index.es38.js +5 -5
  252. package/dist/index.es380.js +29 -2
  253. package/dist/index.es381.js +29 -2
  254. package/dist/index.es382.js +5 -54
  255. package/dist/index.es383.js +2 -59
  256. package/dist/index.es384.js +54 -29
  257. package/dist/index.es385.js +59 -5
  258. package/dist/index.es386.js +68 -5
  259. package/dist/index.es387.js +31 -3
  260. package/dist/index.es388.js +9 -24
  261. package/dist/index.es389.js +152 -109
  262. package/dist/index.es39.js +2 -2
  263. package/dist/index.es390.js +107 -15
  264. package/dist/index.es391.js +19 -67
  265. package/dist/index.es392.js +101 -31
  266. package/dist/index.es393.js +47 -9
  267. package/dist/index.es394.js +5 -153
  268. package/dist/index.es395.js +3 -108
  269. package/dist/index.es396.js +23 -19
  270. package/dist/index.es397.js +107 -98
  271. package/dist/index.es398.js +15 -46
  272. package/dist/index.es40.js +3 -3
  273. package/dist/index.es401.js +3 -3
  274. package/dist/index.es402.js +4 -4
  275. package/dist/index.es403.js +1 -1
  276. package/dist/index.es405.js +517 -66
  277. package/dist/index.es406.js +126 -30
  278. package/dist/index.es407.js +126 -16
  279. package/dist/index.es408.js +62 -135
  280. package/dist/index.es409.js +25 -108
  281. package/dist/index.es410.js +16 -519
  282. package/dist/index.es411.js +140 -126
  283. package/dist/index.es412.js +113 -125
  284. package/dist/index.es416.js +1 -1
  285. package/dist/index.es418.js +1 -1
  286. package/dist/index.es419.js +6 -6
  287. package/dist/index.es42.js +1 -1
  288. package/dist/index.es437.js +275 -2
  289. package/dist/index.es438.js +80 -2
  290. package/dist/index.es439.js +161 -20
  291. package/dist/index.es44.js +1 -1
  292. package/dist/index.es440.js +24 -10
  293. package/dist/index.es441.js +10 -32
  294. package/dist/index.es442.js +30 -27
  295. package/dist/index.es443.js +29 -11
  296. package/dist/index.es444.js +11 -274
  297. package/dist/index.es445.js +2 -80
  298. package/dist/index.es446.js +2 -166
  299. package/dist/index.es447.js +1 -1
  300. package/dist/index.es448.js +5 -5
  301. package/dist/index.es449.js +5 -63
  302. package/dist/index.es45.js +4 -4
  303. package/dist/index.es450.js +16 -69
  304. package/dist/index.es451.js +28 -8
  305. package/dist/index.es452.js +13 -14
  306. package/dist/index.es453.js +2 -60
  307. package/dist/index.es454.js +75 -6
  308. package/dist/index.es455.js +92 -15
  309. package/dist/index.es456.js +51 -28
  310. package/dist/index.es457.js +7 -12
  311. package/dist/index.es458.js +5 -2
  312. package/dist/index.es459.js +48 -72
  313. package/dist/index.es46.js +1 -1
  314. package/dist/index.es460.js +61 -89
  315. package/dist/index.es461.js +67 -50
  316. package/dist/index.es462.js +9 -8
  317. package/dist/index.es463.js +14 -5
  318. package/dist/index.es464.js +59 -51
  319. package/dist/index.es467.js +1 -1
  320. package/dist/index.es468.js +2 -2
  321. package/dist/index.es469.js +2 -2
  322. package/dist/index.es47.js +4 -4
  323. package/dist/index.es476.js +1 -1
  324. package/dist/index.es477.js +1 -1
  325. package/dist/index.es50.js +1 -1
  326. package/dist/index.es51.js +1 -1
  327. package/dist/index.es52.js +1 -1
  328. package/dist/index.es55.js +1 -1
  329. package/dist/index.es56.js +2 -2
  330. package/dist/index.es57.js +3 -3
  331. package/dist/index.es59.js +2 -2
  332. package/dist/index.es61.js +1 -1
  333. package/dist/index.es63.js +2 -2
  334. package/dist/index.es64.js +1 -1
  335. package/dist/index.es65.js +2 -2
  336. package/dist/index.es66.js +2 -2
  337. package/dist/index.es67.js +2 -2
  338. package/dist/index.es69.js +1 -1
  339. package/dist/index.es7.js +1 -1
  340. package/dist/index.es754.js +21 -13
  341. package/dist/index.es755.js +79 -18
  342. package/dist/index.es756.js +13 -82
  343. package/dist/index.es757.js +2 -14
  344. package/dist/index.es758.js +2 -60
  345. package/dist/index.es759.js +14 -4
  346. package/dist/index.es760.js +60 -23
  347. package/dist/index.es761.js +4 -2
  348. package/dist/index.es762.js +23 -2
  349. package/dist/index.es763.js +24 -5
  350. package/dist/index.es764.js +8 -17
  351. package/dist/index.es765.js +66 -7
  352. package/dist/index.es766.js +50 -54
  353. package/dist/index.es767.js +69 -17
  354. package/dist/index.es768.js +5 -24
  355. package/dist/index.es769.js +17 -8
  356. package/dist/index.es770.js +2 -67
  357. package/dist/index.es771.js +2 -52
  358. package/dist/index.es772.js +7 -70
  359. package/dist/index.es773.js +56 -2
  360. package/dist/index.es774.js +19 -2
  361. package/dist/index.es779.js +6 -21
  362. package/dist/index.es78.js +1 -1
  363. package/dist/index.es780.js +20 -56
  364. package/dist/index.es781.js +49 -26
  365. package/dist/index.es782.js +34 -9
  366. package/dist/index.es783.js +9 -18
  367. package/dist/index.es784.js +18 -8
  368. package/dist/index.es785.js +8 -12
  369. package/dist/index.es786.js +11 -56
  370. package/dist/index.es787.js +28 -10
  371. package/dist/index.es788.js +3 -15
  372. package/dist/index.es789.js +57 -6
  373. package/dist/index.es79.js +1 -1
  374. package/dist/index.es790.js +10 -28
  375. package/dist/index.es791.js +15 -3
  376. package/dist/index.es792.js +6 -6
  377. package/dist/index.es797.js +1 -1
  378. package/dist/index.es798.js +1 -1
  379. package/dist/index.es799.js +1 -1
  380. package/dist/index.es800.js +1 -1
  381. package/dist/index.es801.js +1 -1
  382. package/dist/index.es802.js +1 -1
  383. package/dist/index.es804.js +1 -1
  384. package/dist/index.es806.js +10 -8
  385. package/dist/index.es807.js +7 -9
  386. package/dist/index.es808.js +2 -2
  387. package/dist/index.es809.js +8 -10
  388. package/dist/index.es810.js +9 -7
  389. package/dist/index.es811.js +5 -5
  390. package/dist/index.es812.js +2 -2
  391. package/dist/index.es813.js +1 -1
  392. package/dist/index.es815.js +2 -2
  393. package/dist/index.es823.js +1 -1
  394. package/dist/index.es825.js +38 -25
  395. package/dist/index.es826.js +25 -38
  396. package/dist/index.es827.js +15 -64
  397. package/dist/index.es828.js +7 -11
  398. package/dist/index.es829.js +61 -38
  399. package/dist/index.es830.js +7 -54
  400. package/dist/index.es831.js +40 -16
  401. package/dist/index.es832.js +57 -17
  402. package/dist/index.es833.js +20 -7
  403. package/dist/index.es834.js +1 -1
  404. package/dist/index.es84.js +1 -1
  405. package/dist/index.es86.js +32 -29
  406. package/dist/index.es87.js +46 -12
  407. package/dist/index.es88.js +30 -55
  408. package/dist/index.es89.js +28 -53
  409. package/dist/index.es90.js +9 -90
  410. package/dist/index.es91.js +55 -37
  411. package/dist/index.es92.js +53 -22
  412. package/dist/index.es93.js +89 -29
  413. package/dist/index.es94.js +36 -32
  414. package/dist/index.es95.js +24 -46
  415. package/dist/index.es96.js +27 -27
  416. package/dist/index.es97.js +3 -3
  417. package/dist/index.es98.js +1 -1
  418. package/dist/index.es99.js +3672 -7
  419. package/package.json +2 -2
@@ -1,13 +1,1064 @@
1
- import t from "./index.es168.js";
2
- /**
3
- * @license lucide-react v0.379.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const h = t("ChevronRight", [
9
- ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
10
- ]);
1
+ import x from "react";
2
+ var ce = (e) => e.type === "checkbox", ie = (e) => e instanceof Date, O = (e) => e == null;
3
+ const et = (e) => typeof e == "object";
4
+ var T = (e) => !O(e) && !Array.isArray(e) && et(e) && !ie(e), tt = (e) => T(e) && e.target ? ce(e.target) ? e.target.checked : e.target.value : e, xt = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, rt = (e, s) => e.has(xt(s)), mt = (e) => {
5
+ const s = e.constructor && e.constructor.prototype;
6
+ return T(s) && s.hasOwnProperty("isPrototypeOf");
7
+ }, Re = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
8
+ function p(e) {
9
+ let s;
10
+ const t = Array.isArray(e);
11
+ if (e instanceof Date)
12
+ s = new Date(e);
13
+ else if (e instanceof Set)
14
+ s = new Set(e);
15
+ else if (!(Re && (e instanceof Blob || e instanceof FileList)) && (t || T(e)))
16
+ if (s = t ? [] : {}, !t && !mt(e))
17
+ s = e;
18
+ else
19
+ for (const u in e)
20
+ e.hasOwnProperty(u) && (s[u] = p(e[u]));
21
+ else
22
+ return e;
23
+ return s;
24
+ }
25
+ var Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], w = (e) => e === void 0, f = (e, s, t) => {
26
+ if (!s || !T(e))
27
+ return t;
28
+ const u = Ae(s.split(/[,[\].]+?/)).reduce((n, a) => O(n) ? n : n[a], e);
29
+ return w(u) || u === e ? w(e[s]) ? t : e[s] : u;
30
+ }, j = (e) => typeof e == "boolean", Te = (e) => /^\w*$/.test(e), st = (e) => Ae(e.replace(/["|']|\]/g, "").split(/\.|\[/)), m = (e, s, t) => {
31
+ let u = -1;
32
+ const n = Te(s) ? [s] : st(s), a = n.length, y = a - 1;
33
+ for (; ++u < a; ) {
34
+ const h = n[u];
35
+ let D = t;
36
+ if (u !== y) {
37
+ const S = e[h];
38
+ D = T(S) || Array.isArray(S) ? S : isNaN(+n[u + 1]) ? {} : [];
39
+ }
40
+ if (h === "__proto__")
41
+ return;
42
+ e[h] = D, e = e[h];
43
+ }
44
+ return e;
45
+ };
46
+ const ve = {
47
+ BLUR: "blur",
48
+ FOCUS_OUT: "focusout",
49
+ CHANGE: "change"
50
+ }, W = {
51
+ onBlur: "onBlur",
52
+ onChange: "onChange",
53
+ onSubmit: "onSubmit",
54
+ onTouched: "onTouched",
55
+ all: "all"
56
+ }, z = {
57
+ max: "max",
58
+ min: "min",
59
+ maxLength: "maxLength",
60
+ minLength: "minLength",
61
+ pattern: "pattern",
62
+ required: "required",
63
+ validate: "validate"
64
+ }, it = x.createContext(null), Le = () => x.useContext(it), Wt = (e) => {
65
+ const { children: s, ...t } = e;
66
+ return x.createElement(it.Provider, { value: t }, s);
67
+ };
68
+ var ut = (e, s, t, u = !0) => {
69
+ const n = {
70
+ defaultValues: s._defaultValues
71
+ };
72
+ for (const a in e)
73
+ Object.defineProperty(n, a, {
74
+ get: () => {
75
+ const y = a;
76
+ return s._proxyFormState[y] !== W.all && (s._proxyFormState[y] = !u || W.all), t && (t[y] = !0), e[y];
77
+ }
78
+ });
79
+ return n;
80
+ }, M = (e) => T(e) && !Object.keys(e).length, lt = (e, s, t, u) => {
81
+ t(e);
82
+ const { name: n, ...a } = e;
83
+ return M(a) || Object.keys(a).length >= Object.keys(s).length || Object.keys(a).find((y) => s[y] === (!u || W.all));
84
+ }, oe = (e) => Array.isArray(e) ? e : [e], at = (e, s, t) => !e || !s || e === s || oe(e).some((u) => u && (t ? u === s : u.startsWith(s) || s.startsWith(u)));
85
+ function Ue(e) {
86
+ const s = x.useRef(e);
87
+ s.current = e, x.useEffect(() => {
88
+ const t = !e.disabled && s.current.subject && s.current.subject.subscribe({
89
+ next: s.current.next
90
+ });
91
+ return () => {
92
+ t && t.unsubscribe();
93
+ };
94
+ }, [e.disabled]);
95
+ }
96
+ function Dt(e) {
97
+ const s = Le(), { control: t = s.control, disabled: u, name: n, exact: a } = e || {}, [y, h] = x.useState(t._formState), D = x.useRef(!0), S = x.useRef({
98
+ isDirty: !1,
99
+ isLoading: !1,
100
+ dirtyFields: !1,
101
+ touchedFields: !1,
102
+ validatingFields: !1,
103
+ isValidating: !1,
104
+ isValid: !1,
105
+ errors: !1
106
+ }), _ = x.useRef(n);
107
+ return _.current = n, Ue({
108
+ disabled: u,
109
+ next: (v) => D.current && at(_.current, v.name, a) && lt(v, S.current, t._updateFormState) && h({
110
+ ...t._formState,
111
+ ...v
112
+ }),
113
+ subject: t._subjects.state
114
+ }), x.useEffect(() => (D.current = !0, S.current.isValid && t._updateValid(!0), () => {
115
+ D.current = !1;
116
+ }), [t]), ut(y, t, S.current, !1);
117
+ }
118
+ var $ = (e) => typeof e == "string", nt = (e, s, t, u, n) => $(e) ? (u && s.watch.add(e), f(t, e, n)) : Array.isArray(e) ? e.map((a) => (u && s.watch.add(a), f(t, a))) : (u && (s.watchAll = !0), t);
119
+ function wt(e) {
120
+ const s = Le(), { control: t = s.control, name: u, defaultValue: n, disabled: a, exact: y } = e || {}, h = x.useRef(u);
121
+ h.current = u, Ue({
122
+ disabled: a,
123
+ subject: t._subjects.values,
124
+ next: (_) => {
125
+ at(h.current, _.name, y) && S(p(nt(h.current, t._names, _.values || t._formValues, !1, n)));
126
+ }
127
+ });
128
+ const [D, S] = x.useState(t._getWatch(u, n));
129
+ return x.useEffect(() => t._removeUnmounted()), D;
130
+ }
131
+ function Et(e) {
132
+ const s = Le(), { name: t, disabled: u, control: n = s.control, shouldUnregister: a } = e, y = rt(n._names.array, t), h = wt({
133
+ control: n,
134
+ name: t,
135
+ defaultValue: f(n._formValues, t, f(n._defaultValues, t, e.defaultValue)),
136
+ exact: !0
137
+ }), D = Dt({
138
+ control: n,
139
+ name: t,
140
+ exact: !0
141
+ }), S = x.useRef(n.register(t, {
142
+ ...e.rules,
143
+ value: h,
144
+ ...j(e.disabled) ? { disabled: e.disabled } : {}
145
+ }));
146
+ return x.useEffect(() => {
147
+ const _ = n._options.shouldUnregister || a, v = (N, H) => {
148
+ const L = f(n._fields, N);
149
+ L && L._f && (L._f.mount = H);
150
+ };
151
+ if (v(t, !0), _) {
152
+ const N = p(f(n._options.defaultValues, t));
153
+ m(n._defaultValues, t, N), w(f(n._formValues, t)) && m(n._formValues, t, N);
154
+ }
155
+ return () => {
156
+ (y ? _ && !n._state.action : _) ? n.unregister(t) : v(t, !1);
157
+ };
158
+ }, [t, n, y, a]), x.useEffect(() => {
159
+ f(n._fields, t) && n._updateDisabledField({
160
+ disabled: u,
161
+ fields: n._fields,
162
+ name: t,
163
+ value: f(n._fields, t)._f.value
164
+ });
165
+ }, [u, t, n]), {
166
+ field: {
167
+ name: t,
168
+ value: h,
169
+ ...j(u) || D.disabled ? { disabled: D.disabled || u } : {},
170
+ onChange: x.useCallback((_) => S.current.onChange({
171
+ target: {
172
+ value: tt(_),
173
+ name: t
174
+ },
175
+ type: ve.CHANGE
176
+ }), [t]),
177
+ onBlur: x.useCallback(() => S.current.onBlur({
178
+ target: {
179
+ value: f(n._formValues, t),
180
+ name: t
181
+ },
182
+ type: ve.BLUR
183
+ }), [t, n]),
184
+ ref: x.useCallback((_) => {
185
+ const v = f(n._fields, t);
186
+ v && _ && (v._f.ref = {
187
+ focus: () => _.focus(),
188
+ select: () => _.select(),
189
+ setCustomValidity: (N) => _.setCustomValidity(N),
190
+ reportValidity: () => _.reportValidity()
191
+ });
192
+ }, [n._fields, t])
193
+ },
194
+ formState: D,
195
+ fieldState: Object.defineProperties({}, {
196
+ invalid: {
197
+ enumerable: !0,
198
+ get: () => !!f(D.errors, t)
199
+ },
200
+ isDirty: {
201
+ enumerable: !0,
202
+ get: () => !!f(D.dirtyFields, t)
203
+ },
204
+ isTouched: {
205
+ enumerable: !0,
206
+ get: () => !!f(D.touchedFields, t)
207
+ },
208
+ isValidating: {
209
+ enumerable: !0,
210
+ get: () => !!f(D.validatingFields, t)
211
+ },
212
+ error: {
213
+ enumerable: !0,
214
+ get: () => f(D.errors, t)
215
+ }
216
+ })
217
+ };
218
+ }
219
+ const Ht = (e) => e.render(Et(e));
220
+ var St = (e, s, t, u, n) => s ? {
221
+ ...t[e],
222
+ types: {
223
+ ...t[e] && t[e].types ? t[e].types : {},
224
+ [u]: n || !0
225
+ }
226
+ } : {}, Ke = (e) => ({
227
+ isOnSubmit: !e || e === W.onSubmit,
228
+ isOnBlur: e === W.onBlur,
229
+ isOnChange: e === W.onChange,
230
+ isOnAll: e === W.all,
231
+ isOnTouch: e === W.onTouched
232
+ }), Ge = (e, s, t) => !t && (s.watchAll || s.watch.has(e) || [...s.watch].some((u) => e.startsWith(u) && /^\.\w+/.test(e.slice(u.length))));
233
+ const fe = (e, s, t, u) => {
234
+ for (const n of t || Object.keys(e)) {
235
+ const a = f(e, n);
236
+ if (a) {
237
+ const { _f: y, ...h } = a;
238
+ if (y) {
239
+ if (y.refs && y.refs[0] && s(y.refs[0], n) && !u)
240
+ break;
241
+ if (y.ref && s(y.ref, y.name) && !u)
242
+ break;
243
+ fe(h, s);
244
+ } else T(h) && fe(h, s);
245
+ }
246
+ }
247
+ };
248
+ var kt = (e, s, t) => {
249
+ const u = oe(f(e, t));
250
+ return m(u, "root", s[t]), m(e, t, u), e;
251
+ }, Oe = (e) => e.type === "file", X = (e) => typeof e == "function", _e = (e) => {
252
+ if (!Re)
253
+ return !1;
254
+ const s = e ? e.ownerDocument : 0;
255
+ return e instanceof (s && s.defaultView ? s.defaultView.HTMLElement : HTMLElement);
256
+ }, he = (e) => $(e), pe = (e) => e.type === "radio", be = (e) => e instanceof RegExp;
257
+ const ze = {
258
+ value: !1,
259
+ isValid: !1
260
+ }, Je = { value: !0, isValid: !0 };
261
+ var ot = (e) => {
262
+ if (Array.isArray(e)) {
263
+ if (e.length > 1) {
264
+ const s = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
265
+ return { value: s, isValid: !!s.length };
266
+ }
267
+ return e[0].checked && !e[0].disabled ? (
268
+ // @ts-expect-error expected to work in the browser
269
+ e[0].attributes && !w(e[0].attributes.value) ? w(e[0].value) || e[0].value === "" ? Je : { value: e[0].value, isValid: !0 } : Je
270
+ ) : ze;
271
+ }
272
+ return ze;
273
+ };
274
+ const Qe = {
275
+ isValid: !1,
276
+ value: null
277
+ };
278
+ var ft = (e) => Array.isArray(e) ? e.reduce((s, t) => t && t.checked && !t.disabled ? {
279
+ isValid: !0,
280
+ value: t.value
281
+ } : s, Qe) : Qe;
282
+ function Xe(e, s, t = "validate") {
283
+ if (he(e) || Array.isArray(e) && e.every(he) || j(e) && !e)
284
+ return {
285
+ type: t,
286
+ message: he(e) ? e : "",
287
+ ref: s
288
+ };
289
+ }
290
+ var se = (e) => T(e) && !be(e) ? e : {
291
+ value: e,
292
+ message: ""
293
+ }, Ye = async (e, s, t, u, n) => {
294
+ const { ref: a, refs: y, required: h, maxLength: D, minLength: S, min: _, max: v, pattern: N, validate: H, name: L, valueAsNumber: xe, mount: J, disabled: Q } = e._f, V = f(s, L);
295
+ if (!J || Q)
296
+ return {};
297
+ const K = y ? y[0] : a, G = (b) => {
298
+ u && K.reportValidity && (K.setCustomValidity(j(b) ? "" : b || ""), K.reportValidity());
299
+ }, k = {}, ee = pe(a), de = ce(a), Y = ee || de, te = (xe || Oe(a)) && w(a.value) && w(V) || _e(a) && a.value === "" || V === "" || Array.isArray(V) && !V.length, P = St.bind(null, L, t, k), ye = (b, F, C, U = z.maxLength, q = z.minLength) => {
300
+ const I = b ? F : C;
301
+ k[L] = {
302
+ type: b ? U : q,
303
+ message: I,
304
+ ref: a,
305
+ ...P(b ? U : q, I)
306
+ };
307
+ };
308
+ if (n ? !Array.isArray(V) || !V.length : h && (!Y && (te || O(V)) || j(V) && !V || de && !ot(y).isValid || ee && !ft(y).isValid)) {
309
+ const { value: b, message: F } = he(h) ? { value: !!h, message: h } : se(h);
310
+ if (b && (k[L] = {
311
+ type: z.required,
312
+ message: F,
313
+ ref: K,
314
+ ...P(z.required, F)
315
+ }, !t))
316
+ return G(F), k;
317
+ }
318
+ if (!te && (!O(_) || !O(v))) {
319
+ let b, F;
320
+ const C = se(v), U = se(_);
321
+ if (!O(V) && !isNaN(V)) {
322
+ const q = a.valueAsNumber || V && +V;
323
+ O(C.value) || (b = q > C.value), O(U.value) || (F = q < U.value);
324
+ } else {
325
+ const q = a.valueAsDate || new Date(V), I = (ae) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ae), ue = a.type == "time", le = a.type == "week";
326
+ $(C.value) && V && (b = ue ? I(V) > I(C.value) : le ? V > C.value : q > new Date(C.value)), $(U.value) && V && (F = ue ? I(V) < I(U.value) : le ? V < U.value : q < new Date(U.value));
327
+ }
328
+ if ((b || F) && (ye(!!b, C.message, U.message, z.max, z.min), !t))
329
+ return G(k[L].message), k;
330
+ }
331
+ if ((D || S) && !te && ($(V) || n && Array.isArray(V))) {
332
+ const b = se(D), F = se(S), C = !O(b.value) && V.length > +b.value, U = !O(F.value) && V.length < +F.value;
333
+ if ((C || U) && (ye(C, b.message, F.message), !t))
334
+ return G(k[L].message), k;
335
+ }
336
+ if (N && !te && $(V)) {
337
+ const { value: b, message: F } = se(N);
338
+ if (be(b) && !V.match(b) && (k[L] = {
339
+ type: z.pattern,
340
+ message: F,
341
+ ref: a,
342
+ ...P(z.pattern, F)
343
+ }, !t))
344
+ return G(F), k;
345
+ }
346
+ if (H) {
347
+ if (X(H)) {
348
+ const b = await H(V, s), F = Xe(b, K);
349
+ if (F && (k[L] = {
350
+ ...F,
351
+ ...P(z.validate, F.message)
352
+ }, !t))
353
+ return G(F.message), k;
354
+ } else if (T(H)) {
355
+ let b = {};
356
+ for (const F in H) {
357
+ if (!M(b) && !t)
358
+ break;
359
+ const C = Xe(await H[F](V, s), K, F);
360
+ C && (b = {
361
+ ...C,
362
+ ...P(F, C.message)
363
+ }, G(C.message), t && (k[L] = b));
364
+ }
365
+ if (!M(b) && (k[L] = {
366
+ ref: K,
367
+ ...b
368
+ }, !t))
369
+ return k;
370
+ }
371
+ }
372
+ return G(!0), k;
373
+ };
374
+ function Ct(e, s) {
375
+ const t = s.slice(0, -1).length;
376
+ let u = 0;
377
+ for (; u < t; )
378
+ e = w(e) ? u++ : e[s[u++]];
379
+ return e;
380
+ }
381
+ function Rt(e) {
382
+ for (const s in e)
383
+ if (e.hasOwnProperty(s) && !w(e[s]))
384
+ return !1;
385
+ return !0;
386
+ }
387
+ function R(e, s) {
388
+ const t = Array.isArray(s) ? s : Te(s) ? [s] : st(s), u = t.length === 1 ? e : Ct(e, t), n = t.length - 1, a = t[n];
389
+ return u && delete u[a], n !== 0 && (T(u) && M(u) || Array.isArray(u) && Rt(u)) && R(e, t.slice(0, -1)), e;
390
+ }
391
+ var Se = () => {
392
+ let e = [];
393
+ return {
394
+ get observers() {
395
+ return e;
396
+ },
397
+ next: (n) => {
398
+ for (const a of e)
399
+ a.next && a.next(n);
400
+ },
401
+ subscribe: (n) => (e.push(n), {
402
+ unsubscribe: () => {
403
+ e = e.filter((a) => a !== n);
404
+ }
405
+ }),
406
+ unsubscribe: () => {
407
+ e = [];
408
+ }
409
+ };
410
+ }, Ve = (e) => O(e) || !et(e);
411
+ function Z(e, s) {
412
+ if (Ve(e) || Ve(s))
413
+ return e === s;
414
+ if (ie(e) && ie(s))
415
+ return e.getTime() === s.getTime();
416
+ const t = Object.keys(e), u = Object.keys(s);
417
+ if (t.length !== u.length)
418
+ return !1;
419
+ for (const n of t) {
420
+ const a = e[n];
421
+ if (!u.includes(n))
422
+ return !1;
423
+ if (n !== "ref") {
424
+ const y = s[n];
425
+ if (ie(a) && ie(y) || T(a) && T(y) || Array.isArray(a) && Array.isArray(y) ? !Z(a, y) : a !== y)
426
+ return !1;
427
+ }
428
+ }
429
+ return !0;
430
+ }
431
+ var ct = (e) => e.type === "select-multiple", Tt = (e) => pe(e) || ce(e), ke = (e) => _e(e) && e.isConnected, dt = (e) => {
432
+ for (const s in e)
433
+ if (X(e[s]))
434
+ return !0;
435
+ return !1;
436
+ };
437
+ function Fe(e, s = {}) {
438
+ const t = Array.isArray(e);
439
+ if (T(e) || t)
440
+ for (const u in e)
441
+ Array.isArray(e[u]) || T(e[u]) && !dt(e[u]) ? (s[u] = Array.isArray(e[u]) ? [] : {}, Fe(e[u], s[u])) : O(e[u]) || (s[u] = !0);
442
+ return s;
443
+ }
444
+ function yt(e, s, t) {
445
+ const u = Array.isArray(e);
446
+ if (T(e) || u)
447
+ for (const n in e)
448
+ Array.isArray(e[n]) || T(e[n]) && !dt(e[n]) ? w(s) || Ve(t[n]) ? t[n] = Array.isArray(e[n]) ? Fe(e[n], []) : { ...Fe(e[n]) } : yt(e[n], O(s) ? {} : s[n], t[n]) : t[n] = !Z(e[n], s[n]);
449
+ return t;
450
+ }
451
+ var ge = (e, s) => yt(e, s, Fe(s)), gt = (e, { valueAsNumber: s, valueAsDate: t, setValueAs: u }) => w(e) ? e : s ? e === "" ? NaN : e && +e : t && $(e) ? new Date(e) : u ? u(e) : e;
452
+ function Ce(e) {
453
+ const s = e.ref;
454
+ if (!(e.refs ? e.refs.every((t) => t.disabled) : s.disabled))
455
+ return Oe(s) ? s.files : pe(s) ? ft(e.refs).value : ct(s) ? [...s.selectedOptions].map(({ value: t }) => t) : ce(s) ? ot(e.refs).value : gt(w(s.value) ? e.ref.value : s.value, e);
456
+ }
457
+ var Lt = (e, s, t, u) => {
458
+ const n = {};
459
+ for (const a of e) {
460
+ const y = f(s, a);
461
+ y && m(n, a, y._f);
462
+ }
463
+ return {
464
+ criteriaMode: t,
465
+ names: [...e],
466
+ fields: n,
467
+ shouldUseNativeValidation: u
468
+ };
469
+ }, ne = (e) => w(e) ? e : be(e) ? e.source : T(e) ? be(e.value) ? e.value.source : e.value : e, Ut = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
470
+ function Ze(e, s, t) {
471
+ const u = f(e, t);
472
+ if (u || Te(t))
473
+ return {
474
+ error: u,
475
+ name: t
476
+ };
477
+ const n = t.split(".");
478
+ for (; n.length; ) {
479
+ const a = n.join("."), y = f(s, a), h = f(e, a);
480
+ if (y && !Array.isArray(y) && t !== a)
481
+ return { name: t };
482
+ if (h && h.type)
483
+ return {
484
+ name: a,
485
+ error: h
486
+ };
487
+ n.pop();
488
+ }
489
+ return {
490
+ name: t
491
+ };
492
+ }
493
+ var Ot = (e, s, t, u, n) => n.isOnAll ? !1 : !t && n.isOnTouch ? !(s || e) : (t ? u.isOnBlur : n.isOnBlur) ? !e : (t ? u.isOnChange : n.isOnChange) ? e : !0, pt = (e, s) => !Ae(f(e, s)).length && R(e, s);
494
+ const Mt = {
495
+ mode: W.onSubmit,
496
+ reValidateMode: W.onChange,
497
+ shouldFocusError: !0
498
+ };
499
+ function Bt(e = {}) {
500
+ let s = {
501
+ ...Mt,
502
+ ...e
503
+ }, t = {
504
+ submitCount: 0,
505
+ isDirty: !1,
506
+ isLoading: X(s.defaultValues),
507
+ isValidating: !1,
508
+ isSubmitted: !1,
509
+ isSubmitting: !1,
510
+ isSubmitSuccessful: !1,
511
+ isValid: !1,
512
+ touchedFields: {},
513
+ dirtyFields: {},
514
+ validatingFields: {},
515
+ errors: s.errors || {},
516
+ disabled: s.disabled || !1
517
+ }, u = {}, n = T(s.defaultValues) || T(s.values) ? p(s.defaultValues || s.values) || {} : {}, a = s.shouldUnregister ? {} : p(n), y = {
518
+ action: !1,
519
+ mount: !1,
520
+ watch: !1
521
+ }, h = {
522
+ mount: /* @__PURE__ */ new Set(),
523
+ unMount: /* @__PURE__ */ new Set(),
524
+ array: /* @__PURE__ */ new Set(),
525
+ watch: /* @__PURE__ */ new Set()
526
+ }, D, S = 0;
527
+ const _ = {
528
+ isDirty: !1,
529
+ dirtyFields: !1,
530
+ validatingFields: !1,
531
+ touchedFields: !1,
532
+ isValidating: !1,
533
+ isValid: !1,
534
+ errors: !1
535
+ }, v = {
536
+ values: Se(),
537
+ array: Se(),
538
+ state: Se()
539
+ }, N = Ke(s.mode), H = Ke(s.reValidateMode), L = s.criteriaMode === W.all, xe = (r) => (i) => {
540
+ clearTimeout(S), S = setTimeout(r, i);
541
+ }, J = async (r) => {
542
+ if (_.isValid || r) {
543
+ const i = s.resolver ? M((await Y()).errors) : await P(u, !0);
544
+ i !== t.isValid && v.state.next({
545
+ isValid: i
546
+ });
547
+ }
548
+ }, Q = (r, i) => {
549
+ (_.isValidating || _.validatingFields) && ((r || Array.from(h.mount)).forEach((l) => {
550
+ l && (i ? m(t.validatingFields, l, i) : R(t.validatingFields, l));
551
+ }), v.state.next({
552
+ validatingFields: t.validatingFields,
553
+ isValidating: !M(t.validatingFields)
554
+ }));
555
+ }, V = (r, i = [], l, d, c = !0, o = !0) => {
556
+ if (d && l) {
557
+ if (y.action = !0, o && Array.isArray(f(u, r))) {
558
+ const g = l(f(u, r), d.argA, d.argB);
559
+ c && m(u, r, g);
560
+ }
561
+ if (o && Array.isArray(f(t.errors, r))) {
562
+ const g = l(f(t.errors, r), d.argA, d.argB);
563
+ c && m(t.errors, r, g), pt(t.errors, r);
564
+ }
565
+ if (_.touchedFields && o && Array.isArray(f(t.touchedFields, r))) {
566
+ const g = l(f(t.touchedFields, r), d.argA, d.argB);
567
+ c && m(t.touchedFields, r, g);
568
+ }
569
+ _.dirtyFields && (t.dirtyFields = ge(n, a)), v.state.next({
570
+ name: r,
571
+ isDirty: b(r, i),
572
+ dirtyFields: t.dirtyFields,
573
+ errors: t.errors,
574
+ isValid: t.isValid
575
+ });
576
+ } else
577
+ m(a, r, i);
578
+ }, K = (r, i) => {
579
+ m(t.errors, r, i), v.state.next({
580
+ errors: t.errors
581
+ });
582
+ }, G = (r) => {
583
+ t.errors = r, v.state.next({
584
+ errors: t.errors,
585
+ isValid: !1
586
+ });
587
+ }, k = (r, i, l, d) => {
588
+ const c = f(u, r);
589
+ if (c) {
590
+ const o = f(a, r, w(l) ? f(n, r) : l);
591
+ w(o) || d && d.defaultChecked || i ? m(a, r, i ? o : Ce(c._f)) : U(r, o), y.mount && J();
592
+ }
593
+ }, ee = (r, i, l, d, c) => {
594
+ let o = !1, g = !1;
595
+ const A = {
596
+ name: r
597
+ }, E = !!(f(u, r) && f(u, r)._f && f(u, r)._f.disabled);
598
+ if (!l || d) {
599
+ _.isDirty && (g = t.isDirty, t.isDirty = A.isDirty = b(), o = g !== A.isDirty);
600
+ const B = E || Z(f(n, r), i);
601
+ g = !!(!E && f(t.dirtyFields, r)), B || E ? R(t.dirtyFields, r) : m(t.dirtyFields, r, !0), A.dirtyFields = t.dirtyFields, o = o || _.dirtyFields && g !== !B;
602
+ }
603
+ if (l) {
604
+ const B = f(t.touchedFields, r);
605
+ B || (m(t.touchedFields, r, l), A.touchedFields = t.touchedFields, o = o || _.touchedFields && B !== l);
606
+ }
607
+ return o && c && v.state.next(A), o ? A : {};
608
+ }, de = (r, i, l, d) => {
609
+ const c = f(t.errors, r), o = _.isValid && j(i) && t.isValid !== i;
610
+ if (e.delayError && l ? (D = xe(() => K(r, l)), D(e.delayError)) : (clearTimeout(S), D = null, l ? m(t.errors, r, l) : R(t.errors, r)), (l ? !Z(c, l) : c) || !M(d) || o) {
611
+ const g = {
612
+ ...d,
613
+ ...o && j(i) ? { isValid: i } : {},
614
+ errors: t.errors,
615
+ name: r
616
+ };
617
+ t = {
618
+ ...t,
619
+ ...g
620
+ }, v.state.next(g);
621
+ }
622
+ }, Y = async (r) => {
623
+ Q(r, !0);
624
+ const i = await s.resolver(a, s.context, Lt(r || h.mount, u, s.criteriaMode, s.shouldUseNativeValidation));
625
+ return Q(r), i;
626
+ }, te = async (r) => {
627
+ const { errors: i } = await Y(r);
628
+ if (r)
629
+ for (const l of r) {
630
+ const d = f(i, l);
631
+ d ? m(t.errors, l, d) : R(t.errors, l);
632
+ }
633
+ else
634
+ t.errors = i;
635
+ return i;
636
+ }, P = async (r, i, l = {
637
+ valid: !0
638
+ }) => {
639
+ for (const d in r) {
640
+ const c = r[d];
641
+ if (c) {
642
+ const { _f: o, ...g } = c;
643
+ if (o) {
644
+ const A = h.array.has(o.name);
645
+ Q([d], !0);
646
+ const E = await Ye(c, a, L, s.shouldUseNativeValidation && !i, A);
647
+ if (Q([d]), E[o.name] && (l.valid = !1, i))
648
+ break;
649
+ !i && (f(E, o.name) ? A ? kt(t.errors, E, o.name) : m(t.errors, o.name, E[o.name]) : R(t.errors, o.name));
650
+ }
651
+ !M(g) && await P(g, i, l);
652
+ }
653
+ }
654
+ return l.valid;
655
+ }, ye = () => {
656
+ for (const r of h.unMount) {
657
+ const i = f(u, r);
658
+ i && (i._f.refs ? i._f.refs.every((l) => !ke(l)) : !ke(i._f.ref)) && me(r);
659
+ }
660
+ h.unMount = /* @__PURE__ */ new Set();
661
+ }, b = (r, i) => (r && i && m(a, r, i), !Z(Me(), n)), F = (r, i, l) => nt(r, h, {
662
+ ...y.mount ? a : w(i) ? n : $(r) ? { [r]: i } : i
663
+ }, l, i), C = (r) => Ae(f(y.mount ? a : n, r, e.shouldUnregister ? f(n, r, []) : [])), U = (r, i, l = {}) => {
664
+ const d = f(u, r);
665
+ let c = i;
666
+ if (d) {
667
+ const o = d._f;
668
+ o && (!o.disabled && m(a, r, gt(i, o)), c = _e(o.ref) && O(i) ? "" : i, ct(o.ref) ? [...o.ref.options].forEach((g) => g.selected = c.includes(g.value)) : o.refs ? ce(o.ref) ? o.refs.length > 1 ? o.refs.forEach((g) => (!g.defaultChecked || !g.disabled) && (g.checked = Array.isArray(c) ? !!c.find((A) => A === g.value) : c === g.value)) : o.refs[0] && (o.refs[0].checked = !!c) : o.refs.forEach((g) => g.checked = g.value === c) : Oe(o.ref) ? o.ref.value = "" : (o.ref.value = c, o.ref.type || v.values.next({
669
+ name: r,
670
+ values: { ...a }
671
+ })));
672
+ }
673
+ (l.shouldDirty || l.shouldTouch) && ee(r, c, l.shouldTouch, l.shouldDirty, !0), l.shouldValidate && ae(r);
674
+ }, q = (r, i, l) => {
675
+ for (const d in i) {
676
+ const c = i[d], o = `${r}.${d}`, g = f(u, o);
677
+ (h.array.has(r) || !Ve(c) || g && !g._f) && !ie(c) ? q(o, c, l) : U(o, c, l);
678
+ }
679
+ }, I = (r, i, l = {}) => {
680
+ const d = f(u, r), c = h.array.has(r), o = p(i);
681
+ m(a, r, o), c ? (v.array.next({
682
+ name: r,
683
+ values: { ...a }
684
+ }), (_.isDirty || _.dirtyFields) && l.shouldDirty && v.state.next({
685
+ name: r,
686
+ dirtyFields: ge(n, a),
687
+ isDirty: b(r, o)
688
+ })) : d && !d._f && !O(o) ? q(r, o, l) : U(r, o, l), Ge(r, h) && v.state.next({ ...t }), v.values.next({
689
+ name: y.mount ? r : void 0,
690
+ values: { ...a }
691
+ });
692
+ }, ue = async (r) => {
693
+ y.mount = !0;
694
+ const i = r.target;
695
+ let l = i.name, d = !0;
696
+ const c = f(u, l), o = () => i.type ? Ce(c._f) : tt(r), g = (A) => {
697
+ d = Number.isNaN(A) || A === f(a, l, A);
698
+ };
699
+ if (c) {
700
+ let A, E;
701
+ const B = o(), re = r.type === ve.BLUR || r.type === ve.FOCUS_OUT, Vt = !Ut(c._f) && !s.resolver && !f(t.errors, l) && !c._f.deps || Ot(re, f(t.touchedFields, l), t.isSubmitted, H, N), we = Ge(l, h, re);
702
+ m(a, l, B), re ? (c._f.onBlur && c._f.onBlur(r), D && D(0)) : c._f.onChange && c._f.onChange(r);
703
+ const Ee = ee(l, B, re, !1), Ft = !M(Ee) || we;
704
+ if (!re && v.values.next({
705
+ name: l,
706
+ type: r.type,
707
+ values: { ...a }
708
+ }), Vt)
709
+ return _.isValid && J(), Ft && v.state.next({ name: l, ...we ? {} : Ee });
710
+ if (!re && we && v.state.next({ ...t }), s.resolver) {
711
+ const { errors: je } = await Y([l]);
712
+ if (g(B), d) {
713
+ const At = Ze(t.errors, u, l), $e = Ze(je, u, At.name || l);
714
+ A = $e.error, l = $e.name, E = M(je);
715
+ }
716
+ } else
717
+ Q([l], !0), A = (await Ye(c, a, L, s.shouldUseNativeValidation))[l], Q([l]), g(B), d && (A ? E = !1 : _.isValid && (E = await P(u, !0)));
718
+ d && (c._f.deps && ae(c._f.deps), de(l, E, A, Ee));
719
+ }
720
+ }, le = (r, i) => {
721
+ if (f(t.errors, i) && r.focus)
722
+ return r.focus(), 1;
723
+ }, ae = async (r, i = {}) => {
724
+ let l, d;
725
+ const c = oe(r);
726
+ if (s.resolver) {
727
+ const o = await te(w(r) ? r : c);
728
+ l = M(o), d = r ? !c.some((g) => f(o, g)) : l;
729
+ } else r ? (d = (await Promise.all(c.map(async (o) => {
730
+ const g = f(u, o);
731
+ return await P(g && g._f ? { [o]: g } : g);
732
+ }))).every(Boolean), !(!d && !t.isValid) && J()) : d = l = await P(u);
733
+ return v.state.next({
734
+ ...!$(r) || _.isValid && l !== t.isValid ? {} : { name: r },
735
+ ...s.resolver || !r ? { isValid: l } : {},
736
+ errors: t.errors
737
+ }), i.shouldFocus && !d && fe(u, le, r ? c : h.mount), d;
738
+ }, Me = (r) => {
739
+ const i = {
740
+ ...y.mount ? a : n
741
+ };
742
+ return w(r) ? i : $(r) ? f(i, r) : r.map((l) => f(i, l));
743
+ }, Be = (r, i) => ({
744
+ invalid: !!f((i || t).errors, r),
745
+ isDirty: !!f((i || t).dirtyFields, r),
746
+ error: f((i || t).errors, r),
747
+ isValidating: !!f(t.validatingFields, r),
748
+ isTouched: !!f((i || t).touchedFields, r)
749
+ }), ht = (r) => {
750
+ r && oe(r).forEach((i) => R(t.errors, i)), v.state.next({
751
+ errors: r ? t.errors : {}
752
+ });
753
+ }, Pe = (r, i, l) => {
754
+ const d = (f(u, r, { _f: {} })._f || {}).ref, c = f(t.errors, r) || {}, { ref: o, message: g, type: A, ...E } = c;
755
+ m(t.errors, r, {
756
+ ...E,
757
+ ...i,
758
+ ref: d
759
+ }), v.state.next({
760
+ name: r,
761
+ errors: t.errors,
762
+ isValid: !1
763
+ }), l && l.shouldFocus && d && d.focus && d.focus();
764
+ }, vt = (r, i) => X(r) ? v.values.subscribe({
765
+ next: (l) => r(F(void 0, i), l)
766
+ }) : F(r, i, !0), me = (r, i = {}) => {
767
+ for (const l of r ? oe(r) : h.mount)
768
+ h.mount.delete(l), h.array.delete(l), i.keepValue || (R(u, l), R(a, l)), !i.keepError && R(t.errors, l), !i.keepDirty && R(t.dirtyFields, l), !i.keepTouched && R(t.touchedFields, l), !i.keepIsValidating && R(t.validatingFields, l), !s.shouldUnregister && !i.keepDefaultValue && R(n, l);
769
+ v.values.next({
770
+ values: { ...a }
771
+ }), v.state.next({
772
+ ...t,
773
+ ...i.keepDirty ? { isDirty: b() } : {}
774
+ }), !i.keepIsValid && J();
775
+ }, Ie = ({ disabled: r, name: i, field: l, fields: d, value: c }) => {
776
+ if (j(r) && y.mount || r) {
777
+ const o = r ? void 0 : w(c) ? Ce(l ? l._f : f(d, i)._f) : c;
778
+ m(a, i, o), ee(i, o, !1, !1, !0);
779
+ }
780
+ }, De = (r, i = {}) => {
781
+ let l = f(u, r);
782
+ const d = j(i.disabled);
783
+ return m(u, r, {
784
+ ...l || {},
785
+ _f: {
786
+ ...l && l._f ? l._f : { ref: { name: r } },
787
+ name: r,
788
+ mount: !0,
789
+ ...i
790
+ }
791
+ }), h.mount.add(r), l ? Ie({
792
+ field: l,
793
+ disabled: i.disabled,
794
+ name: r,
795
+ value: i.value
796
+ }) : k(r, !0, i.value), {
797
+ ...d ? { disabled: i.disabled } : {},
798
+ ...s.progressive ? {
799
+ required: !!i.required,
800
+ min: ne(i.min),
801
+ max: ne(i.max),
802
+ minLength: ne(i.minLength),
803
+ maxLength: ne(i.maxLength),
804
+ pattern: ne(i.pattern)
805
+ } : {},
806
+ name: r,
807
+ onChange: ue,
808
+ onBlur: ue,
809
+ ref: (c) => {
810
+ if (c) {
811
+ De(r, i), l = f(u, r);
812
+ const o = w(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, g = Tt(o), A = l._f.refs || [];
813
+ if (g ? A.find((E) => E === o) : o === l._f.ref)
814
+ return;
815
+ m(u, r, {
816
+ _f: {
817
+ ...l._f,
818
+ ...g ? {
819
+ refs: [
820
+ ...A.filter(ke),
821
+ o,
822
+ ...Array.isArray(f(n, r)) ? [{}] : []
823
+ ],
824
+ ref: { type: o.type, name: r }
825
+ } : { ref: o }
826
+ }
827
+ }), k(r, !1, void 0, o);
828
+ } else
829
+ l = f(u, r, {}), l._f && (l._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(rt(h.array, r) && y.action) && h.unMount.add(r);
830
+ }
831
+ };
832
+ }, Ne = () => s.shouldFocusError && fe(u, le, h.mount), _t = (r) => {
833
+ j(r) && (v.state.next({ disabled: r }), fe(u, (i, l) => {
834
+ const d = f(u, l);
835
+ d && (i.disabled = d._f.disabled || r, Array.isArray(d._f.refs) && d._f.refs.forEach((c) => {
836
+ c.disabled = d._f.disabled || r;
837
+ }));
838
+ }, 0, !1));
839
+ }, qe = (r, i) => async (l) => {
840
+ let d;
841
+ l && (l.preventDefault && l.preventDefault(), l.persist && l.persist());
842
+ let c = p(a);
843
+ if (v.state.next({
844
+ isSubmitting: !0
845
+ }), s.resolver) {
846
+ const { errors: o, values: g } = await Y();
847
+ t.errors = o, c = g;
848
+ } else
849
+ await P(u);
850
+ if (R(t.errors, "root"), M(t.errors)) {
851
+ v.state.next({
852
+ errors: {}
853
+ });
854
+ try {
855
+ await r(c, l);
856
+ } catch (o) {
857
+ d = o;
858
+ }
859
+ } else
860
+ i && await i({ ...t.errors }, l), Ne(), setTimeout(Ne);
861
+ if (v.state.next({
862
+ isSubmitted: !0,
863
+ isSubmitting: !1,
864
+ isSubmitSuccessful: M(t.errors) && !d,
865
+ submitCount: t.submitCount + 1,
866
+ errors: t.errors
867
+ }), d)
868
+ throw d;
869
+ }, bt = (r, i = {}) => {
870
+ f(u, r) && (w(i.defaultValue) ? I(r, p(f(n, r))) : (I(r, i.defaultValue), m(n, r, p(i.defaultValue))), i.keepTouched || R(t.touchedFields, r), i.keepDirty || (R(t.dirtyFields, r), t.isDirty = i.defaultValue ? b(r, p(f(n, r))) : b()), i.keepError || (R(t.errors, r), _.isValid && J()), v.state.next({ ...t }));
871
+ }, We = (r, i = {}) => {
872
+ const l = r ? p(r) : n, d = p(l), c = M(r), o = c ? n : d;
873
+ if (i.keepDefaultValues || (n = l), !i.keepValues) {
874
+ if (i.keepDirtyValues)
875
+ for (const g of h.mount)
876
+ f(t.dirtyFields, g) ? m(o, g, f(a, g)) : I(g, f(o, g));
877
+ else {
878
+ if (Re && w(r))
879
+ for (const g of h.mount) {
880
+ const A = f(u, g);
881
+ if (A && A._f) {
882
+ const E = Array.isArray(A._f.refs) ? A._f.refs[0] : A._f.ref;
883
+ if (_e(E)) {
884
+ const B = E.closest("form");
885
+ if (B) {
886
+ B.reset();
887
+ break;
888
+ }
889
+ }
890
+ }
891
+ }
892
+ u = {};
893
+ }
894
+ a = e.shouldUnregister ? i.keepDefaultValues ? p(n) : {} : p(o), v.array.next({
895
+ values: { ...o }
896
+ }), v.values.next({
897
+ values: { ...o }
898
+ });
899
+ }
900
+ h = {
901
+ mount: i.keepDirtyValues ? h.mount : /* @__PURE__ */ new Set(),
902
+ unMount: /* @__PURE__ */ new Set(),
903
+ array: /* @__PURE__ */ new Set(),
904
+ watch: /* @__PURE__ */ new Set(),
905
+ watchAll: !1,
906
+ focus: ""
907
+ }, y.mount = !_.isValid || !!i.keepIsValid || !!i.keepDirtyValues, y.watch = !!e.shouldUnregister, v.state.next({
908
+ submitCount: i.keepSubmitCount ? t.submitCount : 0,
909
+ isDirty: c ? !1 : i.keepDirty ? t.isDirty : !!(i.keepDefaultValues && !Z(r, n)),
910
+ isSubmitted: i.keepIsSubmitted ? t.isSubmitted : !1,
911
+ dirtyFields: c ? {} : i.keepDirtyValues ? i.keepDefaultValues && a ? ge(n, a) : t.dirtyFields : i.keepDefaultValues && r ? ge(n, r) : i.keepDirty ? t.dirtyFields : {},
912
+ touchedFields: i.keepTouched ? t.touchedFields : {},
913
+ errors: i.keepErrors ? t.errors : {},
914
+ isSubmitSuccessful: i.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
915
+ isSubmitting: !1
916
+ });
917
+ }, He = (r, i) => We(X(r) ? r(a) : r, i);
918
+ return {
919
+ control: {
920
+ register: De,
921
+ unregister: me,
922
+ getFieldState: Be,
923
+ handleSubmit: qe,
924
+ setError: Pe,
925
+ _executeSchema: Y,
926
+ _getWatch: F,
927
+ _getDirty: b,
928
+ _updateValid: J,
929
+ _removeUnmounted: ye,
930
+ _updateFieldArray: V,
931
+ _updateDisabledField: Ie,
932
+ _getFieldArray: C,
933
+ _reset: We,
934
+ _resetDefaultValues: () => X(s.defaultValues) && s.defaultValues().then((r) => {
935
+ He(r, s.resetOptions), v.state.next({
936
+ isLoading: !1
937
+ });
938
+ }),
939
+ _updateFormState: (r) => {
940
+ t = {
941
+ ...t,
942
+ ...r
943
+ };
944
+ },
945
+ _disableForm: _t,
946
+ _subjects: v,
947
+ _proxyFormState: _,
948
+ _setErrors: G,
949
+ get _fields() {
950
+ return u;
951
+ },
952
+ get _formValues() {
953
+ return a;
954
+ },
955
+ get _state() {
956
+ return y;
957
+ },
958
+ set _state(r) {
959
+ y = r;
960
+ },
961
+ get _defaultValues() {
962
+ return n;
963
+ },
964
+ get _names() {
965
+ return h;
966
+ },
967
+ set _names(r) {
968
+ h = r;
969
+ },
970
+ get _formState() {
971
+ return t;
972
+ },
973
+ set _formState(r) {
974
+ t = r;
975
+ },
976
+ get _options() {
977
+ return s;
978
+ },
979
+ set _options(r) {
980
+ s = {
981
+ ...s,
982
+ ...r
983
+ };
984
+ }
985
+ },
986
+ trigger: ae,
987
+ register: De,
988
+ handleSubmit: qe,
989
+ watch: vt,
990
+ setValue: I,
991
+ getValues: Me,
992
+ reset: He,
993
+ resetField: bt,
994
+ clearErrors: ht,
995
+ unregister: me,
996
+ setError: Pe,
997
+ setFocus: (r, i = {}) => {
998
+ const l = f(u, r), d = l && l._f;
999
+ if (d) {
1000
+ const c = d.refs ? d.refs[0] : d.ref;
1001
+ c.focus && (c.focus(), i.shouldSelect && c.select());
1002
+ }
1003
+ },
1004
+ getFieldState: Be
1005
+ };
1006
+ }
1007
+ function jt(e = {}) {
1008
+ const s = x.useRef(), t = x.useRef(), [u, n] = x.useState({
1009
+ isDirty: !1,
1010
+ isValidating: !1,
1011
+ isLoading: X(e.defaultValues),
1012
+ isSubmitted: !1,
1013
+ isSubmitting: !1,
1014
+ isSubmitSuccessful: !1,
1015
+ isValid: !1,
1016
+ submitCount: 0,
1017
+ dirtyFields: {},
1018
+ touchedFields: {},
1019
+ validatingFields: {},
1020
+ errors: e.errors || {},
1021
+ disabled: e.disabled || !1,
1022
+ defaultValues: X(e.defaultValues) ? void 0 : e.defaultValues
1023
+ });
1024
+ s.current || (s.current = {
1025
+ ...Bt(e),
1026
+ formState: u
1027
+ });
1028
+ const a = s.current.control;
1029
+ return a._options = e, Ue({
1030
+ subject: a._subjects.state,
1031
+ next: (y) => {
1032
+ lt(y, a._proxyFormState, a._updateFormState, !0) && n({ ...a._formState });
1033
+ }
1034
+ }), x.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), x.useEffect(() => {
1035
+ if (a._proxyFormState.isDirty) {
1036
+ const y = a._getDirty();
1037
+ y !== u.isDirty && a._subjects.state.next({
1038
+ isDirty: y
1039
+ });
1040
+ }
1041
+ }, [a, u.isDirty]), x.useEffect(() => {
1042
+ e.values && !Z(e.values, t.current) ? (a._reset(e.values, a._options.resetOptions), t.current = e.values, n((y) => ({ ...y }))) : a._resetDefaultValues();
1043
+ }, [e.values, a]), x.useEffect(() => {
1044
+ e.errors && a._setErrors(e.errors);
1045
+ }, [e.errors, a]), x.useEffect(() => {
1046
+ a._state.mount || (a._updateValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
1047
+ }), x.useEffect(() => {
1048
+ e.shouldUnregister && a._subjects.values.next({
1049
+ values: a._getWatch()
1050
+ });
1051
+ }, [e.shouldUnregister, a]), s.current.formState = ut(u, a), s.current;
1052
+ }
11
1053
  export {
12
- h as default
1054
+ Ht as Controller,
1055
+ Wt as FormProvider,
1056
+ St as appendErrors,
1057
+ f as get,
1058
+ m as set,
1059
+ Et as useController,
1060
+ jt as useForm,
1061
+ Le as useFormContext,
1062
+ Dt as useFormState,
1063
+ wt as useWatch
13
1064
  };