zudoku 0.62.0 → 0.63.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 (379) hide show
  1. package/dist/cli/cli.d.ts +9 -0
  2. package/dist/cli/cli.js +4 -10
  3. package/dist/cli/cli.js.map +1 -1
  4. package/dist/cli/common/version-check.d.ts +2 -0
  5. package/dist/cli/common/version-check.js +58 -0
  6. package/dist/cli/common/version-check.js.map +1 -0
  7. package/dist/config/config.d.ts +3 -0
  8. package/dist/config/validators/InputNavigationSchema.d.ts +64 -4
  9. package/dist/config/validators/icon-types.d.ts +1 -1
  10. package/dist/config/validators/icon-types.js +15 -0
  11. package/dist/config/validators/icon-types.js.map +1 -1
  12. package/dist/config/validators/validate.d.ts +29 -9
  13. package/dist/config/validators/validate.js +22 -0
  14. package/dist/config/validators/validate.js.map +1 -1
  15. package/dist/flat-config.d.ts +21 -2
  16. package/dist/lib/assets/language-icons/c.d.ts +3 -0
  17. package/dist/lib/assets/language-icons/c.js +4 -0
  18. package/dist/lib/assets/language-icons/c.js.map +1 -0
  19. package/dist/lib/assets/language-icons/commonlisp.d.ts +3 -0
  20. package/dist/lib/assets/language-icons/commonlisp.js +4 -0
  21. package/dist/lib/assets/language-icons/commonlisp.js.map +1 -0
  22. package/dist/lib/assets/language-icons/cpp.d.ts +3 -0
  23. package/dist/lib/assets/language-icons/cpp.js +4 -0
  24. package/dist/lib/assets/language-icons/cpp.js.map +1 -0
  25. package/dist/lib/assets/language-icons/dart.d.ts +3 -0
  26. package/dist/lib/assets/language-icons/dart.js +4 -0
  27. package/dist/lib/assets/language-icons/dart.js.map +1 -0
  28. package/dist/lib/assets/language-icons/elixir.d.ts +3 -0
  29. package/dist/lib/assets/language-icons/elixir.js +4 -0
  30. package/dist/lib/assets/language-icons/elixir.js.map +1 -0
  31. package/dist/lib/assets/language-icons/ocaml.d.ts +3 -0
  32. package/dist/lib/assets/language-icons/ocaml.js +4 -0
  33. package/dist/lib/assets/language-icons/ocaml.js.map +1 -0
  34. package/dist/lib/assets/language-icons/powershell.d.ts +3 -0
  35. package/dist/lib/assets/language-icons/powershell.js +4 -0
  36. package/dist/lib/assets/language-icons/powershell.js.map +1 -0
  37. package/dist/lib/assets/language-icons/scala.d.ts +3 -0
  38. package/dist/lib/assets/language-icons/scala.js +4 -0
  39. package/dist/lib/assets/language-icons/scala.js.map +1 -0
  40. package/dist/lib/assets/language-icons/zig.d.ts +3 -0
  41. package/dist/lib/assets/language-icons/zig.js +4 -0
  42. package/dist/lib/assets/language-icons/zig.js.map +1 -0
  43. package/dist/lib/authentication/providers/auth0.js +7 -3
  44. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  45. package/dist/lib/components/Heading.js +1 -5
  46. package/dist/lib/components/Heading.js.map +1 -1
  47. package/dist/lib/components/LanguageIcon.js +45 -0
  48. package/dist/lib/components/LanguageIcon.js.map +1 -1
  49. package/dist/lib/components/Main.js +1 -1
  50. package/dist/lib/components/Main.js.map +1 -1
  51. package/dist/lib/components/cache.d.ts +3 -1
  52. package/dist/lib/components/cache.js +3 -5
  53. package/dist/lib/components/cache.js.map +1 -1
  54. package/dist/lib/components/context/ZudokuContext.js +10 -2
  55. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  56. package/dist/lib/components/index.d.ts +1 -2
  57. package/dist/lib/hooks/index.d.ts +1 -1
  58. package/dist/lib/oas/graphql/index.js +17 -0
  59. package/dist/lib/oas/graphql/index.js.map +1 -1
  60. package/dist/lib/plugins/markdown/MdxPage.js +26 -3
  61. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  62. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.d.ts +2 -0
  63. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.js +3 -0
  64. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.js.map +1 -0
  65. package/dist/lib/plugins/markdown/assets/ClaudeLogo.d.ts +2 -0
  66. package/dist/lib/plugins/markdown/assets/ClaudeLogo.js +3 -0
  67. package/dist/lib/plugins/markdown/assets/ClaudeLogo.js.map +1 -0
  68. package/dist/lib/plugins/markdown/index.d.ts +2 -1
  69. package/dist/lib/plugins/markdown/index.js.map +1 -1
  70. package/dist/lib/plugins/openapi/OperationList.js +7 -2
  71. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  72. package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -2
  73. package/dist/lib/plugins/openapi/OperationListItem.js +6 -3
  74. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  75. package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -1
  76. package/dist/lib/plugins/openapi/Sidecar.js +6 -9
  77. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  78. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  79. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  80. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  81. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  82. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +8 -2
  83. package/dist/lib/plugins/openapi/graphql/graphql.js +8 -0
  84. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  85. package/dist/lib/plugins/openapi/index.js +1 -1
  86. package/dist/lib/plugins/openapi/index.js.map +1 -1
  87. package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
  88. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  89. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  90. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  91. package/dist/lib/shiki.js +9 -0
  92. package/dist/lib/shiki.js.map +1 -1
  93. package/dist/lib/ui/Carousel.js.map +1 -1
  94. package/dist/lib/ui/Dialog.d.ts +12 -18
  95. package/dist/lib/ui/Dialog.js +30 -17
  96. package/dist/lib/ui/Dialog.js.map +1 -1
  97. package/dist/lib/util/pastellize.js +4 -4
  98. package/dist/lib/util/pastellize.js.map +1 -1
  99. package/dist/vite/api/SchemaManager.js.map +1 -1
  100. package/dist/vite/llms.d.ts +12 -0
  101. package/dist/vite/llms.js +66 -0
  102. package/dist/vite/llms.js.map +1 -0
  103. package/dist/vite/plugin-docs.d.ts +9 -0
  104. package/dist/vite/plugin-docs.js +67 -48
  105. package/dist/vite/plugin-docs.js.map +1 -1
  106. package/dist/vite/plugin-markdown-export.d.ts +21 -0
  107. package/dist/vite/plugin-markdown-export.js +139 -0
  108. package/dist/vite/plugin-markdown-export.js.map +1 -0
  109. package/dist/vite/plugin-navigation.js +4 -0
  110. package/dist/vite/plugin-navigation.js.map +1 -1
  111. package/dist/vite/plugin.js +2 -0
  112. package/dist/vite/plugin.js.map +1 -1
  113. package/dist/vite/prerender/prerender.js +30 -0
  114. package/dist/vite/prerender/prerender.js.map +1 -1
  115. package/lib/{Button-DTDRi4CT.js → Button-DmS4u8Lj.js} +2 -2
  116. package/lib/{Button-DTDRi4CT.js.map → Button-DmS4u8Lj.js.map} +1 -1
  117. package/lib/{Card-hTy9PAnh.js → Card-KFniaZn5.js} +2 -2
  118. package/lib/{Card-hTy9PAnh.js.map → Card-KFniaZn5.js.map} +1 -1
  119. package/lib/{CategoryHeading-BGCNu3VK.js → CategoryHeading-DhmodDcq.js} +2 -2
  120. package/lib/{CategoryHeading-BGCNu3VK.js.map → CategoryHeading-DhmodDcq.js.map} +1 -1
  121. package/lib/CodeBlock-CanTUJLl.js +221 -0
  122. package/lib/CodeBlock-CanTUJLl.js.map +1 -0
  123. package/lib/{Command-TEBTONf1.js → Command-CUcrW3qs.js} +3 -3
  124. package/lib/{Command-TEBTONf1.js.map → Command-CUcrW3qs.js.map} +1 -1
  125. package/lib/Dialog-BQciPiHN.js +144 -0
  126. package/lib/Dialog-BQciPiHN.js.map +1 -0
  127. package/lib/{Drawer-DM9wJUC6.js → Drawer-Ci7XwhqT.js} +2 -2
  128. package/lib/Drawer-Ci7XwhqT.js.map +1 -0
  129. package/lib/DropdownMenu-BZ2NKQ3K.js +126 -0
  130. package/lib/DropdownMenu-BZ2NKQ3K.js.map +1 -0
  131. package/lib/{ErrorAlert-xpVkFS_n.js → ErrorAlert-VBJ8aHH7.js} +100 -103
  132. package/lib/ErrorAlert-VBJ8aHH7.js.map +1 -0
  133. package/lib/MdxPage-DFRNwSsc.js +239 -0
  134. package/lib/MdxPage-DFRNwSsc.js.map +1 -0
  135. package/lib/{OAuthErrorPage-DCjFngGS.js → OAuthErrorPage-DJUOdr6Q.js} +7 -7
  136. package/lib/{OAuthErrorPage-DCjFngGS.js.map → OAuthErrorPage-DJUOdr6Q.js.map} +1 -1
  137. package/lib/{OasProvider-B6Co-6Vj.js → OasProvider-D2NYAaBN.js} +3 -3
  138. package/lib/{OasProvider-B6Co-6Vj.js.map → OasProvider-D2NYAaBN.js.map} +1 -1
  139. package/lib/{OperationList-uu04Ezta.js → OperationList-DmXCI4NU.js} +1328 -1319
  140. package/lib/OperationList-DmXCI4NU.js.map +1 -0
  141. package/lib/{Pagination-Cdi_qiXc.js → Pagination-CT4VUR6u.js} +3 -3
  142. package/lib/{Pagination-Cdi_qiXc.js.map → Pagination-CT4VUR6u.js.map} +1 -1
  143. package/lib/{RouteGuard-dji1UEYe.js → RouteGuard-Bg0Lu0OU.js} +5 -5
  144. package/lib/{RouteGuard-dji1UEYe.js.map → RouteGuard-Bg0Lu0OU.js.map} +1 -1
  145. package/lib/{RouterError-D1I15Qyy.js → RouterError-fm21cqlj.js} +4 -4
  146. package/lib/{RouterError-D1I15Qyy.js.map → RouterError-fm21cqlj.js.map} +1 -1
  147. package/lib/{SchemaList-BExl5RED.js → SchemaList-uElsscMN.js} +10 -10
  148. package/lib/{SchemaList-BExl5RED.js.map → SchemaList-uElsscMN.js.map} +1 -1
  149. package/lib/{SchemaView-BYH_AirG.js → SchemaView-CNQ3VAbI.js} +5 -5
  150. package/lib/{SchemaView-BYH_AirG.js.map → SchemaView-CNQ3VAbI.js.map} +1 -1
  151. package/lib/{Select-CegS9OKH.js → Select-CPoGZU_V.js} +4 -4
  152. package/lib/{Select-CegS9OKH.js.map → Select-CPoGZU_V.js.map} +1 -1
  153. package/lib/{SignUp-C-YP_Rxi.js → SignUp-BraHuRN_.js} +9 -9
  154. package/lib/{SignUp-C-YP_Rxi.js.map → SignUp-BraHuRN_.js.map} +1 -1
  155. package/lib/{Spinner-Cf6E803I.js → Spinner-CI6bRyZw.js} +2 -2
  156. package/lib/{Spinner-Cf6E803I.js.map → Spinner-CI6bRyZw.js.map} +1 -1
  157. package/lib/{SyntaxHighlight-CPF64UHi.js → SyntaxHighlight-B0laqAqK.js} +6 -6
  158. package/lib/{SyntaxHighlight-CPF64UHi.js.map → SyntaxHighlight-B0laqAqK.js.map} +1 -1
  159. package/lib/{Toc-Cf5UojVb.js → Toc-KzXCRqrX.js} +3 -3
  160. package/lib/{Toc-Cf5UojVb.js.map → Toc-KzXCRqrX.js.map} +1 -1
  161. package/lib/ZudokuContext-BXTZApgy.js +1506 -0
  162. package/lib/ZudokuContext-BXTZApgy.js.map +1 -0
  163. package/lib/c-B-NUhs61.js +46 -0
  164. package/lib/c-B-NUhs61.js.map +1 -0
  165. package/lib/chunk-PVWAREVJ-BO6B-RAk.js.map +1 -1
  166. package/lib/{circular-06Yrxzsw.js → circular-BWT7_Ahq.js} +30 -30
  167. package/lib/{circular-06Yrxzsw.js.map → circular-BWT7_Ahq.js.map} +1 -1
  168. package/lib/commonlisp-De080z23.js +28 -0
  169. package/lib/commonlisp-De080z23.js.map +1 -0
  170. package/lib/cpp-79Paht7T.js +53 -0
  171. package/lib/cpp-79Paht7T.js.map +1 -0
  172. package/lib/{createServer-BA0aitmR.js → createServer-zhJZSgor.js} +1120 -1083
  173. package/lib/createServer-zhJZSgor.js.map +1 -0
  174. package/lib/{csharp-rrJEDRrV.js → csharp-D8MIL50B.js} +2 -2
  175. package/lib/{csharp-rrJEDRrV.js.map → csharp-D8MIL50B.js.map} +1 -1
  176. package/lib/{css-Dpk9bCql.js → css-Bt6hr1td.js} +2 -2
  177. package/lib/{css-Dpk9bCql.js.map → css-Bt6hr1td.js.map} +1 -1
  178. package/lib/dart-B0vy1jWB.js +60 -0
  179. package/lib/dart-B0vy1jWB.js.map +1 -0
  180. package/lib/elixir-Ds8r0sF8.js +25 -0
  181. package/lib/elixir-Ds8r0sF8.js.map +1 -0
  182. package/lib/{errors-ouIp07AW.js → errors-XqO6MsfU.js} +3 -3
  183. package/lib/{errors-ouIp07AW.js.map → errors-XqO6MsfU.js.map} +1 -1
  184. package/lib/{go-D8SJIQ0Z.js → go-D2VsmIOS.js} +2 -2
  185. package/lib/{go-D8SJIQ0Z.js.map → go-D2VsmIOS.js.map} +1 -1
  186. package/lib/{graphql-aeVKJNa2.js → graphql-BtA6M4m5.js} +2 -2
  187. package/lib/{graphql-aeVKJNa2.js.map → graphql-BtA6M4m5.js.map} +1 -1
  188. package/lib/hook-CAebs2rv.js +31 -0
  189. package/lib/hook-CAebs2rv.js.map +1 -0
  190. package/lib/{html-D_7om-nA.js → html-MGnI2uzP.js} +2 -2
  191. package/lib/{html-D_7om-nA.js.map → html-MGnI2uzP.js.map} +1 -1
  192. package/lib/{index-CVfG8Pb4.js → index-BPSpOxTK.js} +26 -26
  193. package/lib/index-BPSpOxTK.js.map +1 -0
  194. package/lib/{index-DhL3LhWV.js → index-C5L4favO.js} +166 -50
  195. package/lib/index-C5L4favO.js.map +1 -0
  196. package/lib/index-CrcNWbel.js.map +1 -1
  197. package/lib/{index-BRQDtecD.js → index-D8Btv4uT.js} +706 -809
  198. package/lib/index-D8Btv4uT.js.map +1 -0
  199. package/lib/index.esm-BYObtETB.js +1294 -0
  200. package/lib/index.esm-BYObtETB.js.map +1 -0
  201. package/lib/index.esm-BnYHxCYC.js.map +1 -1
  202. package/lib/{java-DUh-EL8n.js → java-CVLzHfb1.js} +2 -2
  203. package/lib/{java-DUh-EL8n.js.map → java-CVLzHfb1.js.map} +1 -1
  204. package/lib/{javascript-CrY8dcGu.js → javascript-CcmIpL4G.js} +2 -2
  205. package/lib/{javascript-CrY8dcGu.js.map → javascript-CcmIpL4G.js.map} +1 -1
  206. package/lib/{json-DLK2_sdf.js → json-4AyP4uiY.js} +2 -2
  207. package/lib/{json-DLK2_sdf.js.map → json-4AyP4uiY.js.map} +1 -1
  208. package/lib/{jsx-runtime-DywqP_6a.js → jsx-runtime-BzflLqGi.js} +109 -111
  209. package/lib/jsx-runtime-BzflLqGi.js.map +1 -0
  210. package/lib/{kotlin-rJMOGl7D.js → kotlin-v2plddBQ.js} +2 -2
  211. package/lib/{kotlin-rJMOGl7D.js.map → kotlin-v2plddBQ.js.map} +1 -1
  212. package/lib/{markdown-BD9bIU5J.js → markdown-DYGWCmGQ.js} +2 -2
  213. package/lib/{markdown-BD9bIU5J.js.map → markdown-DYGWCmGQ.js.map} +1 -1
  214. package/lib/{mdx-G25UCvf3.js → mdx-CHwYvXd4.js} +2 -2
  215. package/lib/{mdx-G25UCvf3.js.map → mdx-CHwYvXd4.js.map} +1 -1
  216. package/lib/{mutation-De-1gXxl.js → mutation-CdGPxHNX.js} +2 -2
  217. package/lib/{mutation-De-1gXxl.js.map → mutation-CdGPxHNX.js.map} +1 -1
  218. package/lib/{objectivec-DDpj0aWX.js → objectivec-HZY8shkd.js} +2 -2
  219. package/lib/{objectivec-DDpj0aWX.js.map → objectivec-HZY8shkd.js.map} +1 -1
  220. package/lib/ocaml-DqsdDdwb.js +52 -0
  221. package/lib/ocaml-DqsdDdwb.js.map +1 -0
  222. package/lib/{php-BeG18bSy.js → php-rQXzo7K_.js} +2 -2
  223. package/lib/{php-BeG18bSy.js.map → php-rQXzo7K_.js.map} +1 -1
  224. package/lib/powershell-CQje9pm1.js +39 -0
  225. package/lib/powershell-CQje9pm1.js.map +1 -0
  226. package/lib/{python-BaF2byD-.js → python-QIQAE5Ei.js} +2 -2
  227. package/lib/{python-BaF2byD-.js.map → python-QIQAE5Ei.js.map} +1 -1
  228. package/lib/{react-CQvDN20M.js → react-DHpVpxRv.js} +2 -2
  229. package/lib/{react-CQvDN20M.js.map → react-DHpVpxRv.js.map} +1 -1
  230. package/lib/{ruby-CmxRVHMR.js → ruby-B2dU8Ny5.js} +2 -2
  231. package/lib/{ruby-CmxRVHMR.js.map → ruby-B2dU8Ny5.js.map} +1 -1
  232. package/lib/{rust-IfSC62c5.js → rust-DYnLHAi2.js} +2 -2
  233. package/lib/{rust-IfSC62c5.js.map → rust-DYnLHAi2.js.map} +1 -1
  234. package/lib/scala-CeKInBR8.js +25 -0
  235. package/lib/scala-CeKInBR8.js.map +1 -0
  236. package/lib/{shell-BFu0M6m4.js → shell-HUv9oVtp.js} +2 -2
  237. package/lib/{shell-BFu0M6m4.js.map → shell-HUv9oVtp.js.map} +1 -1
  238. package/lib/{swift-DckbsN4v.js → swift-B4z6ig1Z.js} +2 -2
  239. package/lib/{swift-DckbsN4v.js.map → swift-B4z6ig1Z.js.map} +1 -1
  240. package/lib/{toml-BJsCc8TC.js → toml-Co9mpdct.js} +2 -2
  241. package/lib/{toml-BJsCc8TC.js.map → toml-Co9mpdct.js.map} +1 -1
  242. package/lib/{typescript-7qOVMjOC.js → typescript-C26xdBDC.js} +2 -2
  243. package/lib/{typescript-7qOVMjOC.js.map → typescript-C26xdBDC.js.map} +1 -1
  244. package/lib/ui/Accordion.js +1 -1
  245. package/lib/ui/ActionButton.js +3 -3
  246. package/lib/ui/Alert.js +1 -1
  247. package/lib/ui/AlertDialog.js +1 -1
  248. package/lib/ui/Badge.js +1 -1
  249. package/lib/ui/Breadcrumb.js +1 -1
  250. package/lib/ui/Button.js +1 -1
  251. package/lib/ui/Callout.js +1 -1
  252. package/lib/ui/Card.js +1 -1
  253. package/lib/ui/Carousel.js +1 -1
  254. package/lib/ui/Carousel.js.map +1 -1
  255. package/lib/ui/Checkbox.js +1 -1
  256. package/lib/ui/CodeBlock.js +2 -2
  257. package/lib/ui/Command.js +2 -2
  258. package/lib/ui/Dialog.js +135 -105
  259. package/lib/ui/Dialog.js.map +1 -1
  260. package/lib/ui/Drawer.js +2 -2
  261. package/lib/ui/DropdownMenu.js +1 -1
  262. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  263. package/lib/ui/Form.js +2 -2
  264. package/lib/ui/HoverCard.js +1 -1
  265. package/lib/ui/Input.js +1 -1
  266. package/lib/ui/Label.js +1 -1
  267. package/lib/ui/Pagination.js +1 -1
  268. package/lib/ui/Popover.js +1 -1
  269. package/lib/ui/Progress.js +1 -1
  270. package/lib/ui/RadioGroup.js +1 -1
  271. package/lib/ui/ReactComponentDoc.js +1 -1
  272. package/lib/ui/ScrollArea.js +1 -1
  273. package/lib/ui/Secret.js +1 -1
  274. package/lib/ui/Select.js +1 -1
  275. package/lib/ui/Skeleton.js +1 -1
  276. package/lib/ui/Slider.js +1 -1
  277. package/lib/ui/Stepper.js +1 -1
  278. package/lib/ui/Switch.js +1 -1
  279. package/lib/ui/SyntaxHighlight.js +4 -4
  280. package/lib/ui/Tabs.js +1 -1
  281. package/lib/ui/Textarea.js +1 -1
  282. package/lib/ui/Toggle.js +1 -1
  283. package/lib/ui/ToggleGroup.js +1 -1
  284. package/lib/ui/Tooltip.js +1 -1
  285. package/lib/ui/Value.js +1 -1
  286. package/lib/{useExposedProps-B8NHdNRq.js → useExposedProps-Cd7Yg_uG.js} +3 -3
  287. package/lib/useExposedProps-Cd7Yg_uG.js.map +1 -0
  288. package/lib/{xml-DAaTIkBX.js → xml-BQOOC04j.js} +2 -2
  289. package/lib/{xml-DAaTIkBX.js.map → xml-BQOOC04j.js.map} +1 -1
  290. package/lib/{yaml-DUi-dbfu.js → yaml-BGsJItKv.js} +2 -2
  291. package/lib/{yaml-DUi-dbfu.js.map → yaml-BGsJItKv.js.map} +1 -1
  292. package/lib/zig-CUV2sTct.js +35 -0
  293. package/lib/zig-CUV2sTct.js.map +1 -0
  294. package/lib/zudoku.__internal.js +1040 -937
  295. package/lib/zudoku.__internal.js.map +1 -1
  296. package/lib/zudoku.auth-auth0.js +22 -21
  297. package/lib/zudoku.auth-auth0.js.map +1 -1
  298. package/lib/zudoku.auth-azureb2c.js +14 -15
  299. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  300. package/lib/zudoku.auth-clerk.js +3 -3
  301. package/lib/zudoku.auth-openid.js +57 -58
  302. package/lib/zudoku.auth-openid.js.map +1 -1
  303. package/lib/zudoku.auth-supabase.js +2 -2
  304. package/lib/zudoku.components.js +6 -6
  305. package/lib/zudoku.hooks.js +6 -6
  306. package/lib/zudoku.hooks.js.map +1 -1
  307. package/lib/zudoku.icons.js +1 -1
  308. package/lib/zudoku.plugin-api-catalog.js +27 -28
  309. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  310. package/lib/zudoku.plugin-api-keys.js +89 -89
  311. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  312. package/lib/zudoku.plugin-custom-pages.js +1 -1
  313. package/lib/zudoku.plugin-markdown.js +2 -2
  314. package/lib/zudoku.plugin-markdown.js.map +1 -1
  315. package/lib/zudoku.plugin-openapi.js +4 -4
  316. package/lib/zudoku.plugin-search-inkeep.js +1 -1
  317. package/lib/zudoku.plugin-search-pagefind.js +27 -28
  318. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  319. package/lib/zudoku.router.js +1 -1
  320. package/lib/zudoku.router.js.map +1 -1
  321. package/package.json +37 -37
  322. package/src/lib/assets/language-icons/c.tsx +31 -0
  323. package/src/lib/assets/language-icons/commonlisp.tsx +22 -0
  324. package/src/lib/assets/language-icons/cpp.tsx +35 -0
  325. package/src/lib/assets/language-icons/dart.tsx +39 -0
  326. package/src/lib/assets/language-icons/elixir.tsx +19 -0
  327. package/src/lib/assets/language-icons/ocaml.tsx +34 -0
  328. package/src/lib/assets/language-icons/powershell.tsx +27 -0
  329. package/src/lib/assets/language-icons/scala.tsx +19 -0
  330. package/src/lib/assets/language-icons/zig.tsx +32 -0
  331. package/src/lib/authentication/providers/auth0.tsx +7 -3
  332. package/src/lib/components/Heading.tsx +2 -6
  333. package/src/lib/components/LanguageIcon.tsx +45 -0
  334. package/src/lib/components/Main.tsx +1 -1
  335. package/src/lib/components/cache.ts +9 -5
  336. package/src/lib/components/context/ZudokuContext.ts +11 -2
  337. package/src/lib/oas/graphql/index.ts +19 -0
  338. package/src/lib/plugins/markdown/MdxPage.tsx +122 -8
  339. package/src/lib/plugins/markdown/assets/ChatGPTLogo.tsx +11 -0
  340. package/src/lib/plugins/markdown/assets/ClaudeLogo.tsx +19 -0
  341. package/src/lib/plugins/markdown/index.tsx +3 -7
  342. package/src/lib/plugins/openapi/OperationList.tsx +9 -2
  343. package/src/lib/plugins/openapi/OperationListItem.tsx +10 -5
  344. package/src/lib/plugins/openapi/Sidecar.tsx +8 -8
  345. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +1 -0
  346. package/src/lib/plugins/openapi/graphql/gql.ts +4 -3
  347. package/src/lib/plugins/openapi/graphql/graphql.ts +20 -3
  348. package/src/lib/plugins/openapi/index.tsx +1 -1
  349. package/src/lib/plugins/openapi/playground/Playground.tsx +1 -1
  350. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  351. package/src/lib/shiki.ts +9 -0
  352. package/src/lib/ui/Carousel.tsx +0 -1
  353. package/src/lib/ui/Dialog.tsx +112 -106
  354. package/src/lib/util/pastellize.ts +4 -4
  355. package/src/shiki/langs/hurl.js +1 -0
  356. package/src/shiki/langs/kdl.js +1 -0
  357. package/src/shiki/langs/pkl.js +1 -0
  358. package/src/shiki/langs/rosmsg.js +1 -0
  359. package/lib/CodeBlock-i0BM_QFf.js +0 -176
  360. package/lib/CodeBlock-i0BM_QFf.js.map +0 -1
  361. package/lib/Dialog-VIMic7xI.js +0 -114
  362. package/lib/Dialog-VIMic7xI.js.map +0 -1
  363. package/lib/Drawer-DM9wJUC6.js.map +0 -1
  364. package/lib/ErrorAlert-xpVkFS_n.js.map +0 -1
  365. package/lib/MdxPage-Ud1w_GV-.js +0 -111
  366. package/lib/MdxPage-Ud1w_GV-.js.map +0 -1
  367. package/lib/OperationList-uu04Ezta.js.map +0 -1
  368. package/lib/ZudokuContext-BcqSiygJ.js +0 -1294
  369. package/lib/ZudokuContext-BcqSiygJ.js.map +0 -1
  370. package/lib/createServer-BA0aitmR.js.map +0 -1
  371. package/lib/hook-BkLXq8pm.js +0 -243
  372. package/lib/hook-BkLXq8pm.js.map +0 -1
  373. package/lib/index-BRQDtecD.js.map +0 -1
  374. package/lib/index-CVfG8Pb4.js.map +0 -1
  375. package/lib/index-DhL3LhWV.js.map +0 -1
  376. package/lib/index.esm-DpgNxKa2.js +0 -1267
  377. package/lib/index.esm-DpgNxKa2.js.map +0 -1
  378. package/lib/jsx-runtime-DywqP_6a.js.map +0 -1
  379. package/lib/useExposedProps-B8NHdNRq.js.map +0 -1
@@ -1,1267 +0,0 @@
1
- import b from "react";
2
- var he = (e) => e.type === "checkbox", le = (e) => e instanceof Date, j = (e) => e == null;
3
- const _t = (e) => typeof e == "object";
4
- var I = (e) => !j(e) && !Array.isArray(e) && _t(e) && !le(e), ht = (e) => I(e) && e.target ? he(e.target) ? e.target.checked : e.target.value : e, It = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, mt = (e, r) => e.has(It(r)), Nt = (e) => {
5
- const r = e.constructor && e.constructor.prototype;
6
- return I(r) && r.hasOwnProperty("isPrototypeOf");
7
- }, je = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
8
- function O(e) {
9
- let r;
10
- const t = Array.isArray(e), i = typeof FileList < "u" ? e instanceof FileList : !1;
11
- if (e instanceof Date)
12
- r = new Date(e);
13
- else if (!(je && (e instanceof Blob || i)) && (t || I(e)))
14
- if (r = t ? [] : Object.create(Object.getPrototypeOf(e)), !t && !Nt(e))
15
- r = e;
16
- else
17
- for (const u in e)
18
- e.hasOwnProperty(u) && (r[u] = O(e[u]));
19
- else
20
- return e;
21
- return r;
22
- }
23
- var Se = (e) => /^\w*$/.test(e), R = (e) => e === void 0, we = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Ke = (e) => we(e.replace(/["|']|\]/g, "").split(/\.|\[/)), d = (e, r, t) => {
24
- if (!r || !I(e))
25
- return t;
26
- const i = (Se(r) ? [r] : Ke(r)).reduce((u, n) => j(u) ? u : u[n], e);
27
- return R(i) || i === e ? R(e[r]) ? t : e[r] : i;
28
- }, Y = (e) => typeof e == "boolean", E = (e, r, t) => {
29
- let i = -1;
30
- const u = Se(r) ? [r] : Ke(r), n = u.length, f = n - 1;
31
- for (; ++i < n; ) {
32
- const c = u[i];
33
- let S = t;
34
- if (i !== f) {
35
- const x = e[c];
36
- S = I(x) || Array.isArray(x) ? x : isNaN(+u[i + 1]) ? {} : [];
37
- }
38
- if (c === "__proto__" || c === "constructor" || c === "prototype")
39
- return;
40
- e[c] = S, e = e[c];
41
- }
42
- };
43
- const Ve = {
44
- BLUR: "blur",
45
- FOCUS_OUT: "focusout",
46
- CHANGE: "change"
47
- }, Q = {
48
- onBlur: "onBlur",
49
- onChange: "onChange",
50
- onSubmit: "onSubmit",
51
- onTouched: "onTouched",
52
- all: "all"
53
- }, se = {
54
- max: "max",
55
- min: "min",
56
- maxLength: "maxLength",
57
- minLength: "minLength",
58
- pattern: "pattern",
59
- required: "required",
60
- validate: "validate"
61
- }, ze = b.createContext(null);
62
- ze.displayName = "HookFormContext";
63
- const ke = () => b.useContext(ze), ir = (e) => {
64
- const { children: r, ...t } = e;
65
- return b.createElement(ze.Provider, { value: t }, r);
66
- };
67
- var vt = (e, r, t, i = !0) => {
68
- const u = {
69
- defaultValues: r._defaultValues
70
- };
71
- for (const n in e)
72
- Object.defineProperty(u, n, {
73
- get: () => {
74
- const f = n;
75
- return r._proxyFormState[f] !== Q.all && (r._proxyFormState[f] = !i || Q.all), t && (t[f] = !0), e[f];
76
- }
77
- });
78
- return u;
79
- };
80
- const De = typeof window < "u" ? b.useLayoutEffect : b.useEffect;
81
- function Bt(e) {
82
- const r = ke(), { control: t = r.control, disabled: i, name: u, exact: n } = e || {}, [f, c] = b.useState(t._formState), S = b.useRef({
83
- isDirty: !1,
84
- isLoading: !1,
85
- dirtyFields: !1,
86
- touchedFields: !1,
87
- validatingFields: !1,
88
- isValidating: !1,
89
- isValid: !1,
90
- errors: !1
91
- });
92
- return De(() => t._subscribe({
93
- name: u,
94
- formState: S.current,
95
- exact: n,
96
- callback: (x) => {
97
- !i && c({
98
- ...t._formState,
99
- ...x
100
- });
101
- }
102
- }), [u, i, n]), b.useEffect(() => {
103
- S.current.isValid && t._setValid(!0);
104
- }, [t]), b.useMemo(() => vt(f, t, S.current, !1), [f, t]);
105
- }
106
- var re = (e) => typeof e == "string", bt = (e, r, t, i, u) => re(e) ? (i && r.watch.add(e), d(t, e, u)) : Array.isArray(e) ? e.map((n) => (i && r.watch.add(n), d(t, n))) : (i && (r.watchAll = !0), t), qe = (e) => j(e) || !_t(e);
107
- function ie(e, r, t = /* @__PURE__ */ new WeakSet()) {
108
- if (qe(e) || qe(r))
109
- return e === r;
110
- if (le(e) && le(r))
111
- return e.getTime() === r.getTime();
112
- const i = Object.keys(e), u = Object.keys(r);
113
- if (i.length !== u.length)
114
- return !1;
115
- if (t.has(e) || t.has(r))
116
- return !0;
117
- t.add(e), t.add(r);
118
- for (const n of i) {
119
- const f = e[n];
120
- if (!u.includes(n))
121
- return !1;
122
- if (n !== "ref") {
123
- const c = r[n];
124
- if (le(f) && le(c) || I(f) && I(c) || Array.isArray(f) && Array.isArray(c) ? !ie(f, c, t) : f !== c)
125
- return !1;
126
- }
127
- }
128
- return !0;
129
- }
130
- function Pt(e) {
131
- const r = ke(), { control: t = r.control, name: i, defaultValue: u, disabled: n, exact: f, compute: c } = e || {}, S = b.useRef(u), x = b.useRef(c), A = b.useRef(void 0);
132
- x.current = c;
133
- const w = b.useMemo(() => t._getWatch(i, S.current), [t, i]), [h, G] = b.useState(x.current ? x.current(w) : w);
134
- return De(() => t._subscribe({
135
- name: i,
136
- formState: {
137
- values: !0
138
- },
139
- exact: f,
140
- callback: (q) => {
141
- if (!n) {
142
- const C = bt(i, t._names, q.values || t._formValues, !1, S.current);
143
- if (x.current) {
144
- const B = x.current(C);
145
- ie(B, A.current) || (G(B), A.current = B);
146
- } else
147
- G(C);
148
- }
149
- }
150
- }), [t, n, i, f]), b.useEffect(() => t._removeUnmounted()), h;
151
- }
152
- function Wt(e) {
153
- const r = ke(), { name: t, disabled: i, control: u = r.control, shouldUnregister: n, defaultValue: f } = e, c = mt(u._names.array, t), S = b.useMemo(() => d(u._formValues, t, d(u._defaultValues, t, f)), [u, t, f]), x = Pt({
154
- control: u,
155
- name: t,
156
- defaultValue: S,
157
- exact: !0
158
- }), A = Bt({
159
- control: u,
160
- name: t,
161
- exact: !0
162
- }), w = b.useRef(e), h = b.useRef(u.register(t, {
163
- ...e.rules,
164
- value: x,
165
- ...Y(e.disabled) ? { disabled: e.disabled } : {}
166
- }));
167
- w.current = e;
168
- const G = b.useMemo(() => Object.defineProperties({}, {
169
- invalid: {
170
- enumerable: !0,
171
- get: () => !!d(A.errors, t)
172
- },
173
- isDirty: {
174
- enumerable: !0,
175
- get: () => !!d(A.dirtyFields, t)
176
- },
177
- isTouched: {
178
- enumerable: !0,
179
- get: () => !!d(A.touchedFields, t)
180
- },
181
- isValidating: {
182
- enumerable: !0,
183
- get: () => !!d(A.validatingFields, t)
184
- },
185
- error: {
186
- enumerable: !0,
187
- get: () => d(A.errors, t)
188
- }
189
- }), [A, t]), q = b.useCallback((V) => h.current.onChange({
190
- target: {
191
- value: ht(V),
192
- name: t
193
- },
194
- type: Ve.CHANGE
195
- }), [t]), C = b.useCallback(() => h.current.onBlur({
196
- target: {
197
- value: d(u._formValues, t),
198
- name: t
199
- },
200
- type: Ve.BLUR
201
- }), [t, u._formValues]), B = b.useCallback((V) => {
202
- const P = d(u._fields, t);
203
- P && V && (P._f.ref = {
204
- focus: () => V.focus && V.focus(),
205
- select: () => V.select && V.select(),
206
- setCustomValidity: (N) => V.setCustomValidity(N),
207
- reportValidity: () => V.reportValidity()
208
- });
209
- }, [u._fields, t]), ae = b.useMemo(() => ({
210
- name: t,
211
- value: x,
212
- ...Y(i) || A.disabled ? { disabled: A.disabled || i } : {},
213
- onChange: q,
214
- onBlur: C,
215
- ref: B
216
- }), [t, i, A.disabled, q, C, B, x]);
217
- return b.useEffect(() => {
218
- const V = u._options.shouldUnregister || n;
219
- u.register(t, {
220
- ...w.current.rules,
221
- ...Y(w.current.disabled) ? { disabled: w.current.disabled } : {}
222
- });
223
- const P = (N, _) => {
224
- const m = d(u._fields, N);
225
- m && m._f && (m._f.mount = _);
226
- };
227
- if (P(t, !0), V) {
228
- const N = O(d(u._options.defaultValues, t));
229
- E(u._defaultValues, t, N), R(d(u._formValues, t)) && E(u._formValues, t, N);
230
- }
231
- return !c && u.register(t), () => {
232
- (c ? V && !u._state.action : V) ? u.unregister(t) : P(t, !1);
233
- };
234
- }, [t, u, c, n]), b.useEffect(() => {
235
- u._setDisabledField({
236
- disabled: i,
237
- name: t
238
- });
239
- }, [i, t, u]), b.useMemo(() => ({
240
- field: ae,
241
- formState: A,
242
- fieldState: G
243
- }), [ae, A, G]);
244
- }
245
- const ar = (e) => e.render(Wt(e));
246
- var qt = (e, r, t, i, u) => r ? {
247
- ...t[e],
248
- types: {
249
- ...t[e] && t[e].types ? t[e].types : {},
250
- [i]: u || !0
251
- }
252
- } : {}, z = (e) => Array.isArray(e) ? e : [e], ut = () => {
253
- let e = [];
254
- return {
255
- get observers() {
256
- return e;
257
- },
258
- next: (u) => {
259
- for (const n of e)
260
- n.next && n.next(u);
261
- },
262
- subscribe: (u) => (e.push(u), {
263
- unsubscribe: () => {
264
- e = e.filter((n) => n !== u);
265
- }
266
- }),
267
- unsubscribe: () => {
268
- e = [];
269
- }
270
- };
271
- }, $ = (e) => I(e) && !Object.keys(e).length, Ge = (e) => e.type === "file", X = (e) => typeof e == "function", Fe = (e) => {
272
- if (!je)
273
- return !1;
274
- const r = e ? e.ownerDocument : 0;
275
- return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
276
- }, Vt = (e) => e.type === "select-multiple", Ye = (e) => e.type === "radio", Ht = (e) => Ye(e) || he(e), Re = (e) => Fe(e) && e.isConnected;
277
- function $t(e, r) {
278
- const t = r.slice(0, -1).length;
279
- let i = 0;
280
- for (; i < t; )
281
- e = R(e) ? i++ : e[r[i++]];
282
- return e;
283
- }
284
- function jt(e) {
285
- for (const r in e)
286
- if (e.hasOwnProperty(r) && !R(e[r]))
287
- return !1;
288
- return !0;
289
- }
290
- function T(e, r) {
291
- const t = Array.isArray(r) ? r : Se(r) ? [r] : Ke(r), i = t.length === 1 ? e : $t(e, t), u = t.length - 1, n = t[u];
292
- return i && delete i[n], u !== 0 && (I(i) && $(i) || Array.isArray(i) && jt(i)) && T(e, t.slice(0, -1)), e;
293
- }
294
- var Ft = (e) => {
295
- for (const r in e)
296
- if (X(e[r]))
297
- return !0;
298
- return !1;
299
- };
300
- function Ae(e, r = {}) {
301
- const t = Array.isArray(e);
302
- if (I(e) || t)
303
- for (const i in e)
304
- Array.isArray(e[i]) || I(e[i]) && !Ft(e[i]) ? (r[i] = Array.isArray(e[i]) ? [] : {}, Ae(e[i], r[i])) : j(e[i]) || (r[i] = !0);
305
- return r;
306
- }
307
- function At(e, r, t) {
308
- const i = Array.isArray(e);
309
- if (I(e) || i)
310
- for (const u in e)
311
- Array.isArray(e[u]) || I(e[u]) && !Ft(e[u]) ? R(r) || qe(t[u]) ? t[u] = Array.isArray(e[u]) ? Ae(e[u], []) : { ...Ae(e[u]) } : At(e[u], j(r) ? {} : r[u], t[u]) : t[u] = !ie(e[u], r[u]);
312
- return t;
313
- }
314
- var ge = (e, r) => At(e, r, Ae(r));
315
- const nt = {
316
- value: !1,
317
- isValid: !1
318
- }, lt = { value: !0, isValid: !0 };
319
- var xt = (e) => {
320
- if (Array.isArray(e)) {
321
- if (e.length > 1) {
322
- const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
323
- return { value: r, isValid: !!r.length };
324
- }
325
- return e[0].checked && !e[0].disabled ? (
326
- // @ts-expect-error expected to work in the browser
327
- e[0].attributes && !R(e[0].attributes.value) ? R(e[0].value) || e[0].value === "" ? lt : { value: e[0].value, isValid: !0 } : lt
328
- ) : nt;
329
- }
330
- return nt;
331
- }, St = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: i }) => R(e) ? e : r ? e === "" ? NaN : e && +e : t && re(e) ? new Date(e) : i ? i(e) : e;
332
- const ot = {
333
- isValid: !1,
334
- value: null
335
- };
336
- var wt = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
337
- isValid: !0,
338
- value: t.value
339
- } : r, ot) : ot;
340
- function ct(e) {
341
- const r = e.ref;
342
- return Ge(r) ? r.files : Ye(r) ? wt(e.refs).value : Vt(r) ? [...r.selectedOptions].map(({ value: t }) => t) : he(r) ? xt(e.refs).value : St(R(r.value) ? e.ref.value : r.value, e);
343
- }
344
- var Kt = (e, r, t, i) => {
345
- const u = {};
346
- for (const n of e) {
347
- const f = d(r, n);
348
- f && E(u, n, f._f);
349
- }
350
- return {
351
- criteriaMode: t,
352
- names: [...e],
353
- fields: u,
354
- shouldUseNativeValidation: i
355
- };
356
- }, xe = (e) => e instanceof RegExp, _e = (e) => R(e) ? e : xe(e) ? e.source : I(e) ? xe(e.value) ? e.value.source : e.value : e, de = (e) => ({
357
- isOnSubmit: !e || e === Q.onSubmit,
358
- isOnBlur: e === Q.onBlur,
359
- isOnChange: e === Q.onChange,
360
- isOnAll: e === Q.all,
361
- isOnTouch: e === Q.onTouched
362
- });
363
- const dt = "AsyncFunction";
364
- var zt = (e) => !!e && !!e.validate && !!(X(e.validate) && e.validate.constructor.name === dt || I(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === dt)), Gt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), He = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((i) => e.startsWith(i) && /^\.\w+/.test(e.slice(i.length))));
365
- const fe = (e, r, t, i) => {
366
- for (const u of t || Object.keys(e)) {
367
- const n = d(e, u);
368
- if (n) {
369
- const { _f: f, ...c } = n;
370
- if (f) {
371
- if (f.refs && f.refs[0] && r(f.refs[0], u) && !i)
372
- return !0;
373
- if (f.ref && r(f.ref, f.name) && !i)
374
- return !0;
375
- if (fe(c, r))
376
- break;
377
- } else if (I(c) && fe(c, r))
378
- break;
379
- }
380
- }
381
- };
382
- function ft(e, r, t) {
383
- const i = d(e, t);
384
- if (i || Se(t))
385
- return {
386
- error: i,
387
- name: t
388
- };
389
- const u = t.split(".");
390
- for (; u.length; ) {
391
- const n = u.join("."), f = d(r, n), c = d(e, n);
392
- if (f && !Array.isArray(f) && t !== n)
393
- return { name: t };
394
- if (c && c.type)
395
- return {
396
- name: n,
397
- error: c
398
- };
399
- if (c && c.root && c.root.type)
400
- return {
401
- name: `${n}.root`,
402
- error: c.root
403
- };
404
- u.pop();
405
- }
406
- return {
407
- name: t
408
- };
409
- }
410
- var Yt = (e, r, t, i) => {
411
- t(e);
412
- const { name: u, ...n } = e;
413
- return $(n) || Object.keys(n).length >= Object.keys(r).length || Object.keys(n).find((f) => r[f] === (!i || Q.all));
414
- }, Jt = (e, r, t) => !e || !r || e === r || z(e).some((i) => i && (t ? i === r : i.startsWith(r) || r.startsWith(i))), Qt = (e, r, t, i, u) => u.isOnAll ? !1 : !t && u.isOnTouch ? !(r || e) : (t ? i.isOnBlur : u.isOnBlur) ? !e : (t ? i.isOnChange : u.isOnChange) ? e : !0, Xt = (e, r) => !we(d(e, r)).length && T(e, r), kt = (e, r, t) => {
415
- const i = z(d(e, t));
416
- return E(i, "root", r[t]), E(e, t, i), e;
417
- }, be = (e) => re(e);
418
- function yt(e, r, t = "validate") {
419
- if (be(e) || Array.isArray(e) && e.every(be) || Y(e) && !e)
420
- return {
421
- type: t,
422
- message: be(e) ? e : "",
423
- ref: r
424
- };
425
- }
426
- var ce = (e) => I(e) && !xe(e) ? e : {
427
- value: e,
428
- message: ""
429
- }, $e = async (e, r, t, i, u, n) => {
430
- const { ref: f, refs: c, required: S, maxLength: x, minLength: A, min: w, max: h, pattern: G, validate: q, name: C, valueAsNumber: B, mount: ae } = e._f, V = d(t, C);
431
- if (!ae || r.has(C))
432
- return {};
433
- const P = c ? c[0] : f, N = (k) => {
434
- u && P.reportValidity && (P.setCustomValidity(Y(k) ? "" : k || ""), P.reportValidity());
435
- }, _ = {}, m = Ye(f), F = he(f), U = m || F, W = (B || Ge(f)) && R(f.value) && R(V) || Fe(f) && f.value === "" || V === "" || Array.isArray(V) && !V.length, Z = qt.bind(null, C, i, _), ee = (k, p, L, H = se.maxLength, K = se.minLength) => {
436
- const te = k ? p : L;
437
- _[C] = {
438
- type: k ? H : K,
439
- message: te,
440
- ref: f,
441
- ...Z(k ? H : K, te)
442
- };
443
- };
444
- if (n ? !Array.isArray(V) || !V.length : S && (!U && (W || j(V)) || Y(V) && !V || F && !xt(c).isValid || m && !wt(c).isValid)) {
445
- const { value: k, message: p } = be(S) ? { value: !!S, message: S } : ce(S);
446
- if (k && (_[C] = {
447
- type: se.required,
448
- message: p,
449
- ref: P,
450
- ...Z(se.required, p)
451
- }, !i))
452
- return N(p), _;
453
- }
454
- if (!W && (!j(w) || !j(h))) {
455
- let k, p;
456
- const L = ce(h), H = ce(w);
457
- if (!j(V) && !isNaN(V)) {
458
- const K = f.valueAsNumber || V && +V;
459
- j(L.value) || (k = K > L.value), j(H.value) || (p = K < H.value);
460
- } else {
461
- const K = f.valueAsDate || new Date(V), te = (me) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + me), ye = f.type == "time", oe = f.type == "week";
462
- re(L.value) && V && (k = ye ? te(V) > te(L.value) : oe ? V > L.value : K > new Date(L.value)), re(H.value) && V && (p = ye ? te(V) < te(H.value) : oe ? V < H.value : K < new Date(H.value));
463
- }
464
- if ((k || p) && (ee(!!k, L.message, H.message, se.max, se.min), !i))
465
- return N(_[C].message), _;
466
- }
467
- if ((x || A) && !W && (re(V) || n && Array.isArray(V))) {
468
- const k = ce(x), p = ce(A), L = !j(k.value) && V.length > +k.value, H = !j(p.value) && V.length < +p.value;
469
- if ((L || H) && (ee(L, k.message, p.message), !i))
470
- return N(_[C].message), _;
471
- }
472
- if (G && !W && re(V)) {
473
- const { value: k, message: p } = ce(G);
474
- if (xe(k) && !V.match(k) && (_[C] = {
475
- type: se.pattern,
476
- message: p,
477
- ref: f,
478
- ...Z(se.pattern, p)
479
- }, !i))
480
- return N(p), _;
481
- }
482
- if (q) {
483
- if (X(q)) {
484
- const k = await q(V, t), p = yt(k, P);
485
- if (p && (_[C] = {
486
- ...p,
487
- ...Z(se.validate, p.message)
488
- }, !i))
489
- return N(p.message), _;
490
- } else if (I(q)) {
491
- let k = {};
492
- for (const p in q) {
493
- if (!$(k) && !i)
494
- break;
495
- const L = yt(await q[p](V, t), P, p);
496
- L && (k = {
497
- ...L,
498
- ...Z(p, L.message)
499
- }, N(L.message), i && (_[C] = k));
500
- }
501
- if (!$(k) && (_[C] = {
502
- ref: P,
503
- ...k
504
- }, !i))
505
- return _;
506
- }
507
- }
508
- return N(!0), _;
509
- };
510
- const Zt = {
511
- mode: Q.onSubmit,
512
- reValidateMode: Q.onChange,
513
- shouldFocusError: !0
514
- };
515
- function er(e = {}) {
516
- let r = {
517
- ...Zt,
518
- ...e
519
- }, t = {
520
- submitCount: 0,
521
- isDirty: !1,
522
- isReady: !1,
523
- isLoading: X(r.defaultValues),
524
- isValidating: !1,
525
- isSubmitted: !1,
526
- isSubmitting: !1,
527
- isSubmitSuccessful: !1,
528
- isValid: !1,
529
- touchedFields: {},
530
- dirtyFields: {},
531
- validatingFields: {},
532
- errors: r.errors || {},
533
- disabled: r.disabled || !1
534
- }, i = {}, u = I(r.defaultValues) || I(r.values) ? O(r.defaultValues || r.values) || {} : {}, n = r.shouldUnregister ? {} : O(u), f = {
535
- action: !1,
536
- mount: !1,
537
- watch: !1
538
- }, c = {
539
- mount: /* @__PURE__ */ new Set(),
540
- disabled: /* @__PURE__ */ new Set(),
541
- unMount: /* @__PURE__ */ new Set(),
542
- array: /* @__PURE__ */ new Set(),
543
- watch: /* @__PURE__ */ new Set()
544
- }, S, x = 0;
545
- const A = {
546
- isDirty: !1,
547
- dirtyFields: !1,
548
- validatingFields: !1,
549
- touchedFields: !1,
550
- isValidating: !1,
551
- isValid: !1,
552
- errors: !1
553
- };
554
- let w = {
555
- ...A
556
- };
557
- const h = {
558
- array: ut(),
559
- state: ut()
560
- }, G = r.criteriaMode === Q.all, q = (s) => (a) => {
561
- clearTimeout(x), x = setTimeout(s, a);
562
- }, C = async (s) => {
563
- if (!r.disabled && (A.isValid || w.isValid || s)) {
564
- const a = r.resolver ? $((await F()).errors) : await W(i, !0);
565
- a !== t.isValid && h.state.next({
566
- isValid: a
567
- });
568
- }
569
- }, B = (s, a) => {
570
- !r.disabled && (A.isValidating || A.validatingFields || w.isValidating || w.validatingFields) && ((s || Array.from(c.mount)).forEach((l) => {
571
- l && (a ? E(t.validatingFields, l, a) : T(t.validatingFields, l));
572
- }), h.state.next({
573
- validatingFields: t.validatingFields,
574
- isValidating: !$(t.validatingFields)
575
- }));
576
- }, ae = (s, a = [], l, g, y = !0, o = !0) => {
577
- if (g && l && !r.disabled) {
578
- if (f.action = !0, o && Array.isArray(d(i, s))) {
579
- const v = l(d(i, s), g.argA, g.argB);
580
- y && E(i, s, v);
581
- }
582
- if (o && Array.isArray(d(t.errors, s))) {
583
- const v = l(d(t.errors, s), g.argA, g.argB);
584
- y && E(t.errors, s, v), Xt(t.errors, s);
585
- }
586
- if ((A.touchedFields || w.touchedFields) && o && Array.isArray(d(t.touchedFields, s))) {
587
- const v = l(d(t.touchedFields, s), g.argA, g.argB);
588
- y && E(t.touchedFields, s, v);
589
- }
590
- (A.dirtyFields || w.dirtyFields) && (t.dirtyFields = ge(u, n)), h.state.next({
591
- name: s,
592
- isDirty: ee(s, a),
593
- dirtyFields: t.dirtyFields,
594
- errors: t.errors,
595
- isValid: t.isValid
596
- });
597
- } else
598
- E(n, s, a);
599
- }, V = (s, a) => {
600
- E(t.errors, s, a), h.state.next({
601
- errors: t.errors
602
- });
603
- }, P = (s) => {
604
- t.errors = s, h.state.next({
605
- errors: t.errors,
606
- isValid: !1
607
- });
608
- }, N = (s, a, l, g) => {
609
- const y = d(i, s);
610
- if (y) {
611
- const o = d(n, s, R(l) ? d(u, s) : l);
612
- R(o) || g && g.defaultChecked || a ? E(n, s, a ? o : ct(y._f)) : L(s, o), f.mount && C();
613
- }
614
- }, _ = (s, a, l, g, y) => {
615
- let o = !1, v = !1;
616
- const D = {
617
- name: s
618
- };
619
- if (!r.disabled) {
620
- if (!l || g) {
621
- (A.isDirty || w.isDirty) && (v = t.isDirty, t.isDirty = D.isDirty = ee(), o = v !== D.isDirty);
622
- const M = ie(d(u, s), a);
623
- v = !!d(t.dirtyFields, s), M ? T(t.dirtyFields, s) : E(t.dirtyFields, s, !0), D.dirtyFields = t.dirtyFields, o = o || (A.dirtyFields || w.dirtyFields) && v !== !M;
624
- }
625
- if (l) {
626
- const M = d(t.touchedFields, s);
627
- M || (E(t.touchedFields, s, l), D.touchedFields = t.touchedFields, o = o || (A.touchedFields || w.touchedFields) && M !== l);
628
- }
629
- o && y && h.state.next(D);
630
- }
631
- return o ? D : {};
632
- }, m = (s, a, l, g) => {
633
- const y = d(t.errors, s), o = (A.isValid || w.isValid) && Y(a) && t.isValid !== a;
634
- if (r.delayError && l ? (S = q(() => V(s, l)), S(r.delayError)) : (clearTimeout(x), S = null, l ? E(t.errors, s, l) : T(t.errors, s)), (l ? !ie(y, l) : y) || !$(g) || o) {
635
- const v = {
636
- ...g,
637
- ...o && Y(a) ? { isValid: a } : {},
638
- errors: t.errors,
639
- name: s
640
- };
641
- t = {
642
- ...t,
643
- ...v
644
- }, h.state.next(v);
645
- }
646
- }, F = async (s) => {
647
- B(s, !0);
648
- const a = await r.resolver(n, r.context, Kt(s || c.mount, i, r.criteriaMode, r.shouldUseNativeValidation));
649
- return B(s), a;
650
- }, U = async (s) => {
651
- const { errors: a } = await F(s);
652
- if (s)
653
- for (const l of s) {
654
- const g = d(a, l);
655
- g ? E(t.errors, l, g) : T(t.errors, l);
656
- }
657
- else
658
- t.errors = a;
659
- return a;
660
- }, W = async (s, a, l = {
661
- valid: !0
662
- }) => {
663
- for (const g in s) {
664
- const y = s[g];
665
- if (y) {
666
- const { _f: o, ...v } = y;
667
- if (o) {
668
- const D = c.array.has(o.name), M = y._f && zt(y._f);
669
- M && A.validatingFields && B([g], !0);
670
- const J = await $e(y, c.disabled, n, G, r.shouldUseNativeValidation && !a, D);
671
- if (M && A.validatingFields && B([g]), J[o.name] && (l.valid = !1, a))
672
- break;
673
- !a && (d(J, o.name) ? D ? kt(t.errors, J, o.name) : E(t.errors, o.name, J[o.name]) : T(t.errors, o.name));
674
- }
675
- !$(v) && await W(v, a, l);
676
- }
677
- }
678
- return l.valid;
679
- }, Z = () => {
680
- for (const s of c.unMount) {
681
- const a = d(i, s);
682
- a && (a._f.refs ? a._f.refs.every((l) => !Re(l)) : !Re(a._f.ref)) && pe(s);
683
- }
684
- c.unMount = /* @__PURE__ */ new Set();
685
- }, ee = (s, a) => !r.disabled && (s && a && E(n, s, a), !ie(me(), u)), k = (s, a, l) => bt(s, c, {
686
- ...f.mount ? n : R(a) ? u : re(s) ? { [s]: a } : a
687
- }, l, a), p = (s) => we(d(f.mount ? n : u, s, r.shouldUnregister ? d(u, s, []) : [])), L = (s, a, l = {}) => {
688
- const g = d(i, s);
689
- let y = a;
690
- if (g) {
691
- const o = g._f;
692
- o && (!o.disabled && E(n, s, St(a, o)), y = Fe(o.ref) && j(a) ? "" : a, Vt(o.ref) ? [...o.ref.options].forEach((v) => v.selected = y.includes(v.value)) : o.refs ? he(o.ref) ? o.refs.forEach((v) => {
693
- (!v.defaultChecked || !v.disabled) && (Array.isArray(y) ? v.checked = !!y.find((D) => D === v.value) : v.checked = y === v.value || !!y);
694
- }) : o.refs.forEach((v) => v.checked = v.value === y) : Ge(o.ref) ? o.ref.value = "" : (o.ref.value = y, o.ref.type || h.state.next({
695
- name: s,
696
- values: O(n)
697
- })));
698
- }
699
- (l.shouldDirty || l.shouldTouch) && _(s, y, l.shouldTouch, l.shouldDirty, !0), l.shouldValidate && oe(s);
700
- }, H = (s, a, l) => {
701
- for (const g in a) {
702
- if (!a.hasOwnProperty(g))
703
- return;
704
- const y = a[g], o = s + "." + g, v = d(i, o);
705
- (c.array.has(s) || I(y) || v && !v._f) && !le(y) ? H(o, y, l) : L(o, y, l);
706
- }
707
- }, K = (s, a, l = {}) => {
708
- const g = d(i, s), y = c.array.has(s), o = O(a);
709
- E(n, s, o), y ? (h.array.next({
710
- name: s,
711
- values: O(n)
712
- }), (A.isDirty || A.dirtyFields || w.isDirty || w.dirtyFields) && l.shouldDirty && h.state.next({
713
- name: s,
714
- dirtyFields: ge(u, n),
715
- isDirty: ee(s, o)
716
- })) : g && !g._f && !j(o) ? H(s, o, l) : L(s, o, l), He(s, c) && h.state.next({ ...t, name: s }), h.state.next({
717
- name: f.mount ? s : void 0,
718
- values: O(n)
719
- });
720
- }, te = async (s) => {
721
- f.mount = !0;
722
- const a = s.target;
723
- let l = a.name, g = !0;
724
- const y = d(i, l), o = (M) => {
725
- g = Number.isNaN(M) || le(M) && isNaN(M.getTime()) || ie(M, d(n, l, M));
726
- }, v = de(r.mode), D = de(r.reValidateMode);
727
- if (y) {
728
- let M, J;
729
- const ve = a.type ? ct(y._f) : ht(s), ue = s.type === Ve.BLUR || s.type === Ve.FOCUS_OUT, Ut = !Gt(y._f) && !r.resolver && !d(t.errors, l) && !y._f.deps || Qt(ue, d(t.touchedFields, l), t.isSubmitted, D, v), Me = He(l, c, ue);
730
- E(n, l, ve), ue ? (!a || !a.readOnly) && (y._f.onBlur && y._f.onBlur(s), S && S(0)) : y._f.onChange && y._f.onChange(s);
731
- const Oe = _(l, ve, ue), Lt = !$(Oe) || Me;
732
- if (!ue && h.state.next({
733
- name: l,
734
- type: s.type,
735
- values: O(n)
736
- }), Ut)
737
- return (A.isValid || w.isValid) && (r.mode === "onBlur" ? ue && C() : ue || C()), Lt && h.state.next({ name: l, ...Me ? {} : Oe });
738
- if (!ue && Me && h.state.next({ ...t }), r.resolver) {
739
- const { errors: it } = await F([l]);
740
- if (o(ve), g) {
741
- const Tt = ft(t.errors, i, l), at = ft(it, i, Tt.name || l);
742
- M = at.error, l = at.name, J = $(it);
743
- }
744
- } else
745
- B([l], !0), M = (await $e(y, c.disabled, n, G, r.shouldUseNativeValidation))[l], B([l]), o(ve), g && (M ? J = !1 : (A.isValid || w.isValid) && (J = await W(i, !0)));
746
- g && (y._f.deps && oe(y._f.deps), m(l, J, M, Oe));
747
- }
748
- }, ye = (s, a) => {
749
- if (d(t.errors, a) && s.focus)
750
- return s.focus(), 1;
751
- }, oe = async (s, a = {}) => {
752
- let l, g;
753
- const y = z(s);
754
- if (r.resolver) {
755
- const o = await U(R(s) ? s : y);
756
- l = $(o), g = s ? !y.some((v) => d(o, v)) : l;
757
- } else s ? (g = (await Promise.all(y.map(async (o) => {
758
- const v = d(i, o);
759
- return await W(v && v._f ? { [o]: v } : v);
760
- }))).every(Boolean), !(!g && !t.isValid) && C()) : g = l = await W(i);
761
- return h.state.next({
762
- ...!re(s) || (A.isValid || w.isValid) && l !== t.isValid ? {} : { name: s },
763
- ...r.resolver || !s ? { isValid: l } : {},
764
- errors: t.errors
765
- }), a.shouldFocus && !g && fe(i, ye, s ? y : c.mount), g;
766
- }, me = (s) => {
767
- const a = {
768
- ...f.mount ? n : u
769
- };
770
- return R(s) ? a : re(s) ? d(a, s) : s.map((l) => d(a, l));
771
- }, Je = (s, a) => ({
772
- invalid: !!d((a || t).errors, s),
773
- isDirty: !!d((a || t).dirtyFields, s),
774
- error: d((a || t).errors, s),
775
- isValidating: !!d(t.validatingFields, s),
776
- isTouched: !!d((a || t).touchedFields, s)
777
- }), Dt = (s) => {
778
- s && z(s).forEach((a) => T(t.errors, a)), h.state.next({
779
- errors: s ? t.errors : {}
780
- });
781
- }, Qe = (s, a, l) => {
782
- const g = (d(i, s, { _f: {} })._f || {}).ref, y = d(t.errors, s) || {}, { ref: o, message: v, type: D, ...M } = y;
783
- E(t.errors, s, {
784
- ...M,
785
- ...a,
786
- ref: g
787
- }), h.state.next({
788
- name: s,
789
- errors: t.errors,
790
- isValid: !1
791
- }), l && l.shouldFocus && g && g.focus && g.focus();
792
- }, pt = (s, a) => X(s) ? h.state.subscribe({
793
- next: (l) => "values" in l && s(k(void 0, a), l)
794
- }) : k(s, a, !0), Xe = (s) => h.state.subscribe({
795
- next: (a) => {
796
- Jt(s.name, a.name, s.exact) && Yt(a, s.formState || A, Rt, s.reRenderRoot) && s.callback({
797
- values: { ...n },
798
- ...t,
799
- ...a,
800
- defaultValues: u
801
- });
802
- }
803
- }).unsubscribe, Et = (s) => (f.mount = !0, w = {
804
- ...w,
805
- ...s.formState
806
- }, Xe({
807
- ...s,
808
- formState: w
809
- })), pe = (s, a = {}) => {
810
- for (const l of s ? z(s) : c.mount)
811
- c.mount.delete(l), c.array.delete(l), a.keepValue || (T(i, l), T(n, l)), !a.keepError && T(t.errors, l), !a.keepDirty && T(t.dirtyFields, l), !a.keepTouched && T(t.touchedFields, l), !a.keepIsValidating && T(t.validatingFields, l), !r.shouldUnregister && !a.keepDefaultValue && T(u, l);
812
- h.state.next({
813
- values: O(n)
814
- }), h.state.next({
815
- ...t,
816
- ...a.keepDirty ? { isDirty: ee() } : {}
817
- }), !a.keepIsValid && C();
818
- }, Ze = ({ disabled: s, name: a }) => {
819
- (Y(s) && f.mount || s || c.disabled.has(a)) && (s ? c.disabled.add(a) : c.disabled.delete(a));
820
- }, Ee = (s, a = {}) => {
821
- let l = d(i, s);
822
- const g = Y(a.disabled) || Y(r.disabled);
823
- return E(i, s, {
824
- ...l || {},
825
- _f: {
826
- ...l && l._f ? l._f : { ref: { name: s } },
827
- name: s,
828
- mount: !0,
829
- ...a
830
- }
831
- }), c.mount.add(s), l ? Ze({
832
- disabled: Y(a.disabled) ? a.disabled : r.disabled,
833
- name: s
834
- }) : N(s, !0, a.value), {
835
- ...g ? { disabled: a.disabled || r.disabled } : {},
836
- ...r.progressive ? {
837
- required: !!a.required,
838
- min: _e(a.min),
839
- max: _e(a.max),
840
- minLength: _e(a.minLength),
841
- maxLength: _e(a.maxLength),
842
- pattern: _e(a.pattern)
843
- } : {},
844
- name: s,
845
- onChange: te,
846
- onBlur: te,
847
- ref: (y) => {
848
- if (y) {
849
- Ee(s, a), l = d(i, s);
850
- const o = R(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, v = Ht(o), D = l._f.refs || [];
851
- if (v ? D.find((M) => M === o) : o === l._f.ref)
852
- return;
853
- E(i, s, {
854
- _f: {
855
- ...l._f,
856
- ...v ? {
857
- refs: [
858
- ...D.filter(Re),
859
- o,
860
- ...Array.isArray(d(u, s)) ? [{}] : []
861
- ],
862
- ref: { type: o.type, name: s }
863
- } : { ref: o }
864
- }
865
- }), N(s, !1, void 0, o);
866
- } else
867
- l = d(i, s, {}), l._f && (l._f.mount = !1), (r.shouldUnregister || a.shouldUnregister) && !(mt(c.array, s) && f.action) && c.unMount.add(s);
868
- }
869
- };
870
- }, Ce = () => r.shouldFocusError && fe(i, ye, c.mount), Ct = (s) => {
871
- Y(s) && (h.state.next({ disabled: s }), fe(i, (a, l) => {
872
- const g = d(i, l);
873
- g && (a.disabled = g._f.disabled || s, Array.isArray(g._f.refs) && g._f.refs.forEach((y) => {
874
- y.disabled = g._f.disabled || s;
875
- }));
876
- }, 0, !1));
877
- }, et = (s, a) => async (l) => {
878
- let g;
879
- l && (l.preventDefault && l.preventDefault(), l.persist && l.persist());
880
- let y = O(n);
881
- if (h.state.next({
882
- isSubmitting: !0
883
- }), r.resolver) {
884
- const { errors: o, values: v } = await F();
885
- t.errors = o, y = O(v);
886
- } else
887
- await W(i);
888
- if (c.disabled.size)
889
- for (const o of c.disabled)
890
- T(y, o);
891
- if (T(t.errors, "root"), $(t.errors)) {
892
- h.state.next({
893
- errors: {}
894
- });
895
- try {
896
- await s(y, l);
897
- } catch (o) {
898
- g = o;
899
- }
900
- } else
901
- a && await a({ ...t.errors }, l), Ce(), setTimeout(Ce);
902
- if (h.state.next({
903
- isSubmitted: !0,
904
- isSubmitting: !1,
905
- isSubmitSuccessful: $(t.errors) && !g,
906
- submitCount: t.submitCount + 1,
907
- errors: t.errors
908
- }), g)
909
- throw g;
910
- }, Mt = (s, a = {}) => {
911
- d(i, s) && (R(a.defaultValue) ? K(s, O(d(u, s))) : (K(s, a.defaultValue), E(u, s, O(a.defaultValue))), a.keepTouched || T(t.touchedFields, s), a.keepDirty || (T(t.dirtyFields, s), t.isDirty = a.defaultValue ? ee(s, O(d(u, s))) : ee()), a.keepError || (T(t.errors, s), A.isValid && C()), h.state.next({ ...t }));
912
- }, tt = (s, a = {}) => {
913
- const l = s ? O(s) : u, g = O(l), y = $(s), o = y ? u : g;
914
- if (a.keepDefaultValues || (u = l), !a.keepValues) {
915
- if (a.keepDirtyValues) {
916
- const v = /* @__PURE__ */ new Set([
917
- ...c.mount,
918
- ...Object.keys(ge(u, n))
919
- ]);
920
- for (const D of Array.from(v))
921
- d(t.dirtyFields, D) ? E(o, D, d(n, D)) : K(D, d(o, D));
922
- } else {
923
- if (je && R(s))
924
- for (const v of c.mount) {
925
- const D = d(i, v);
926
- if (D && D._f) {
927
- const M = Array.isArray(D._f.refs) ? D._f.refs[0] : D._f.ref;
928
- if (Fe(M)) {
929
- const J = M.closest("form");
930
- if (J) {
931
- J.reset();
932
- break;
933
- }
934
- }
935
- }
936
- }
937
- if (a.keepFieldsRef)
938
- for (const v of c.mount)
939
- K(v, d(o, v));
940
- else
941
- i = {};
942
- }
943
- n = r.shouldUnregister ? a.keepDefaultValues ? O(u) : {} : O(o), h.array.next({
944
- values: { ...o }
945
- }), h.state.next({
946
- values: { ...o }
947
- });
948
- }
949
- c = {
950
- mount: a.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
951
- unMount: /* @__PURE__ */ new Set(),
952
- array: /* @__PURE__ */ new Set(),
953
- disabled: /* @__PURE__ */ new Set(),
954
- watch: /* @__PURE__ */ new Set(),
955
- watchAll: !1,
956
- focus: ""
957
- }, f.mount = !A.isValid || !!a.keepIsValid || !!a.keepDirtyValues, f.watch = !!r.shouldUnregister, h.state.next({
958
- submitCount: a.keepSubmitCount ? t.submitCount : 0,
959
- isDirty: y ? !1 : a.keepDirty ? t.isDirty : !!(a.keepDefaultValues && !ie(s, u)),
960
- isSubmitted: a.keepIsSubmitted ? t.isSubmitted : !1,
961
- dirtyFields: y ? {} : a.keepDirtyValues ? a.keepDefaultValues && n ? ge(u, n) : t.dirtyFields : a.keepDefaultValues && s ? ge(u, s) : a.keepDirty ? t.dirtyFields : {},
962
- touchedFields: a.keepTouched ? t.touchedFields : {},
963
- errors: a.keepErrors ? t.errors : {},
964
- isSubmitSuccessful: a.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
965
- isSubmitting: !1,
966
- defaultValues: u
967
- });
968
- }, rt = (s, a) => tt(X(s) ? s(n) : s, a), Ot = (s, a = {}) => {
969
- const l = d(i, s), g = l && l._f;
970
- if (g) {
971
- const y = g.refs ? g.refs[0] : g.ref;
972
- y.focus && (y.focus(), a.shouldSelect && X(y.select) && y.select());
973
- }
974
- }, Rt = (s) => {
975
- t = {
976
- ...t,
977
- ...s
978
- };
979
- }, st = {
980
- control: {
981
- register: Ee,
982
- unregister: pe,
983
- getFieldState: Je,
984
- handleSubmit: et,
985
- setError: Qe,
986
- _subscribe: Xe,
987
- _runSchema: F,
988
- _focusError: Ce,
989
- _getWatch: k,
990
- _getDirty: ee,
991
- _setValid: C,
992
- _setFieldArray: ae,
993
- _setDisabledField: Ze,
994
- _setErrors: P,
995
- _getFieldArray: p,
996
- _reset: tt,
997
- _resetDefaultValues: () => X(r.defaultValues) && r.defaultValues().then((s) => {
998
- rt(s, r.resetOptions), h.state.next({
999
- isLoading: !1
1000
- });
1001
- }),
1002
- _removeUnmounted: Z,
1003
- _disableForm: Ct,
1004
- _subjects: h,
1005
- _proxyFormState: A,
1006
- get _fields() {
1007
- return i;
1008
- },
1009
- get _formValues() {
1010
- return n;
1011
- },
1012
- get _state() {
1013
- return f;
1014
- },
1015
- set _state(s) {
1016
- f = s;
1017
- },
1018
- get _defaultValues() {
1019
- return u;
1020
- },
1021
- get _names() {
1022
- return c;
1023
- },
1024
- set _names(s) {
1025
- c = s;
1026
- },
1027
- get _formState() {
1028
- return t;
1029
- },
1030
- get _options() {
1031
- return r;
1032
- },
1033
- set _options(s) {
1034
- r = {
1035
- ...r,
1036
- ...s
1037
- };
1038
- }
1039
- },
1040
- subscribe: Et,
1041
- trigger: oe,
1042
- register: Ee,
1043
- handleSubmit: et,
1044
- watch: pt,
1045
- setValue: K,
1046
- getValues: me,
1047
- reset: rt,
1048
- resetField: Mt,
1049
- clearErrors: Dt,
1050
- unregister: pe,
1051
- setError: Qe,
1052
- setFocus: Ot,
1053
- getFieldState: Je
1054
- };
1055
- return {
1056
- ...st,
1057
- formControl: st
1058
- };
1059
- }
1060
- var ne = () => {
1061
- if (typeof crypto < "u" && crypto.randomUUID)
1062
- return crypto.randomUUID();
1063
- const e = typeof performance > "u" ? Date.now() : performance.now() * 1e3;
1064
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
1065
- const t = (Math.random() * 16 + e) % 16 | 0;
1066
- return (r == "x" ? t : t & 3 | 8).toString(16);
1067
- });
1068
- }, Ue = (e, r, t = {}) => t.shouldFocus || R(t.shouldFocus) ? t.focusName || `${e}.${R(t.focusIndex) ? r : t.focusIndex}.` : "", Le = (e, r) => [
1069
- ...e,
1070
- ...z(r)
1071
- ], Te = (e) => Array.isArray(e) ? e.map(() => {
1072
- }) : void 0;
1073
- function Ie(e, r, t) {
1074
- return [
1075
- ...e.slice(0, r),
1076
- ...z(t),
1077
- ...e.slice(r)
1078
- ];
1079
- }
1080
- var Ne = (e, r, t) => Array.isArray(e) ? (R(e[t]) && (e[t] = void 0), e.splice(t, 0, e.splice(r, 1)[0]), e) : [], Be = (e, r) => [
1081
- ...z(r),
1082
- ...z(e)
1083
- ];
1084
- function tr(e, r) {
1085
- let t = 0;
1086
- const i = [...e];
1087
- for (const u of r)
1088
- i.splice(u - t, 1), t++;
1089
- return we(i).length ? i : [];
1090
- }
1091
- var Pe = (e, r) => R(r) ? [] : tr(e, z(r).sort((t, i) => t - i)), We = (e, r, t) => {
1092
- [e[r], e[t]] = [e[t], e[r]];
1093
- }, gt = (e, r, t) => (e[r] = t, e);
1094
- function ur(e) {
1095
- const r = ke(), { control: t = r.control, name: i, keyName: u = "id", shouldUnregister: n, rules: f } = e, [c, S] = b.useState(t._getFieldArray(i)), x = b.useRef(t._getFieldArray(i).map(ne)), A = b.useRef(c), w = b.useRef(!1);
1096
- A.current = c, t._names.array.add(i), b.useMemo(() => f && t.register(i, f), [t, f, i]), De(() => t._subjects.array.subscribe({
1097
- next: ({ values: _, name: m }) => {
1098
- if (m === i || !m) {
1099
- const F = d(_, i);
1100
- Array.isArray(F) && (S(F), x.current = F.map(ne));
1101
- }
1102
- }
1103
- }).unsubscribe, [t, i]);
1104
- const h = b.useCallback((_) => {
1105
- w.current = !0, t._setFieldArray(i, _);
1106
- }, [t, i]), G = (_, m) => {
1107
- const F = z(O(_)), U = Le(t._getFieldArray(i), F);
1108
- t._names.focus = Ue(i, U.length - 1, m), x.current = Le(x.current, F.map(ne)), h(U), S(U), t._setFieldArray(i, U, Le, {
1109
- argA: Te(_)
1110
- });
1111
- }, q = (_, m) => {
1112
- const F = z(O(_)), U = Be(t._getFieldArray(i), F);
1113
- t._names.focus = Ue(i, 0, m), x.current = Be(x.current, F.map(ne)), h(U), S(U), t._setFieldArray(i, U, Be, {
1114
- argA: Te(_)
1115
- });
1116
- }, C = (_) => {
1117
- const m = Pe(t._getFieldArray(i), _);
1118
- x.current = Pe(x.current, _), h(m), S(m), !Array.isArray(d(t._fields, i)) && E(t._fields, i, void 0), t._setFieldArray(i, m, Pe, {
1119
- argA: _
1120
- });
1121
- }, B = (_, m, F) => {
1122
- const U = z(O(m)), W = Ie(t._getFieldArray(i), _, U);
1123
- t._names.focus = Ue(i, _, F), x.current = Ie(x.current, _, U.map(ne)), h(W), S(W), t._setFieldArray(i, W, Ie, {
1124
- argA: _,
1125
- argB: Te(m)
1126
- });
1127
- }, ae = (_, m) => {
1128
- const F = t._getFieldArray(i);
1129
- We(F, _, m), We(x.current, _, m), h(F), S(F), t._setFieldArray(i, F, We, {
1130
- argA: _,
1131
- argB: m
1132
- }, !1);
1133
- }, V = (_, m) => {
1134
- const F = t._getFieldArray(i);
1135
- Ne(F, _, m), Ne(x.current, _, m), h(F), S(F), t._setFieldArray(i, F, Ne, {
1136
- argA: _,
1137
- argB: m
1138
- }, !1);
1139
- }, P = (_, m) => {
1140
- const F = O(m), U = gt(t._getFieldArray(i), _, F);
1141
- x.current = [...U].map((W, Z) => !W || Z === _ ? ne() : x.current[Z]), h(U), S([...U]), t._setFieldArray(i, U, gt, {
1142
- argA: _,
1143
- argB: F
1144
- }, !0, !1);
1145
- }, N = (_) => {
1146
- const m = z(O(_));
1147
- x.current = m.map(ne), h([...m]), S([...m]), t._setFieldArray(i, [...m], (F) => F, {}, !0, !1);
1148
- };
1149
- return b.useEffect(() => {
1150
- if (t._state.action = !1, He(i, t._names) && t._subjects.state.next({
1151
- ...t._formState
1152
- }), w.current && (!de(t._options.mode).isOnSubmit || t._formState.isSubmitted) && !de(t._options.reValidateMode).isOnSubmit)
1153
- if (t._options.resolver)
1154
- t._runSchema([i]).then((_) => {
1155
- const m = d(_.errors, i), F = d(t._formState.errors, i);
1156
- (F ? !m && F.type || m && (F.type !== m.type || F.message !== m.message) : m && m.type) && (m ? E(t._formState.errors, i, m) : T(t._formState.errors, i), t._subjects.state.next({
1157
- errors: t._formState.errors
1158
- }));
1159
- });
1160
- else {
1161
- const _ = d(t._fields, i);
1162
- _ && _._f && !(de(t._options.reValidateMode).isOnSubmit && de(t._options.mode).isOnSubmit) && $e(_, t._names.disabled, t._formValues, t._options.criteriaMode === Q.all, t._options.shouldUseNativeValidation, !0).then((m) => !$(m) && t._subjects.state.next({
1163
- errors: kt(t._formState.errors, m, i)
1164
- }));
1165
- }
1166
- t._subjects.state.next({
1167
- name: i,
1168
- values: O(t._formValues)
1169
- }), t._names.focus && fe(t._fields, (_, m) => {
1170
- if (t._names.focus && m.startsWith(t._names.focus) && _.focus)
1171
- return _.focus(), 1;
1172
- }), t._names.focus = "", t._setValid(), w.current = !1;
1173
- }, [c, i, t]), b.useEffect(() => (!d(t._formValues, i) && t._setFieldArray(i), () => {
1174
- const _ = (m, F) => {
1175
- const U = d(t._fields, m);
1176
- U && U._f && (U._f.mount = F);
1177
- };
1178
- t._options.shouldUnregister || n ? t.unregister(i) : _(i, !1);
1179
- }), [i, t, u, n]), {
1180
- swap: b.useCallback(ae, [h, i, t]),
1181
- move: b.useCallback(V, [h, i, t]),
1182
- prepend: b.useCallback(q, [h, i, t]),
1183
- append: b.useCallback(G, [h, i, t]),
1184
- remove: b.useCallback(C, [h, i, t]),
1185
- insert: b.useCallback(B, [h, i, t]),
1186
- update: b.useCallback(P, [h, i, t]),
1187
- replace: b.useCallback(N, [h, i, t]),
1188
- fields: b.useMemo(() => c.map((_, m) => ({
1189
- ..._,
1190
- [u]: x.current[m] || ne()
1191
- })), [c, u])
1192
- };
1193
- }
1194
- function nr(e = {}) {
1195
- const r = b.useRef(void 0), t = b.useRef(void 0), [i, u] = b.useState({
1196
- isDirty: !1,
1197
- isValidating: !1,
1198
- isLoading: X(e.defaultValues),
1199
- isSubmitted: !1,
1200
- isSubmitting: !1,
1201
- isSubmitSuccessful: !1,
1202
- isValid: !1,
1203
- submitCount: 0,
1204
- dirtyFields: {},
1205
- touchedFields: {},
1206
- validatingFields: {},
1207
- errors: e.errors || {},
1208
- disabled: e.disabled || !1,
1209
- isReady: !1,
1210
- defaultValues: X(e.defaultValues) ? void 0 : e.defaultValues
1211
- });
1212
- if (!r.current)
1213
- if (e.formControl)
1214
- r.current = {
1215
- ...e.formControl,
1216
- formState: i
1217
- }, e.defaultValues && !X(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
1218
- else {
1219
- const { formControl: f, ...c } = er(e);
1220
- r.current = {
1221
- ...c,
1222
- formState: i
1223
- };
1224
- }
1225
- const n = r.current.control;
1226
- return n._options = e, De(() => {
1227
- const f = n._subscribe({
1228
- formState: n._proxyFormState,
1229
- callback: () => u({ ...n._formState }),
1230
- reRenderRoot: !0
1231
- });
1232
- return u((c) => ({
1233
- ...c,
1234
- isReady: !0
1235
- })), n._formState.isReady = !0, f;
1236
- }, [n]), b.useEffect(() => n._disableForm(e.disabled), [n, e.disabled]), b.useEffect(() => {
1237
- e.mode && (n._options.mode = e.mode), e.reValidateMode && (n._options.reValidateMode = e.reValidateMode);
1238
- }, [n, e.mode, e.reValidateMode]), b.useEffect(() => {
1239
- e.errors && (n._setErrors(e.errors), n._focusError());
1240
- }, [n, e.errors]), b.useEffect(() => {
1241
- e.shouldUnregister && n._subjects.state.next({
1242
- values: n._getWatch()
1243
- });
1244
- }, [n, e.shouldUnregister]), b.useEffect(() => {
1245
- if (n._proxyFormState.isDirty) {
1246
- const f = n._getDirty();
1247
- f !== i.isDirty && n._subjects.state.next({
1248
- isDirty: f
1249
- });
1250
- }
1251
- }, [n, i.isDirty]), b.useEffect(() => {
1252
- e.values && !ie(e.values, t.current) ? (n._reset(e.values, {
1253
- keepFieldsRef: !0,
1254
- ...n._options.resetOptions
1255
- }), t.current = e.values, u((f) => ({ ...f }))) : n._resetDefaultValues();
1256
- }, [n, e.values]), b.useEffect(() => {
1257
- n._state.mount || (n._setValid(), n._state.mount = !0), n._state.watch && (n._state.watch = !1, n._subjects.state.next({ ...n._formState })), n._removeUnmounted();
1258
- }), r.current.formState = vt(i, n), r.current;
1259
- }
1260
- export {
1261
- ar as C,
1262
- ir as F,
1263
- nr as a,
1264
- ur as b,
1265
- ke as u
1266
- };
1267
- //# sourceMappingURL=index.esm-DpgNxKa2.js.map