zudoku 0.3.0-dev.9 → 0.3.0-dev.91

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 (663) hide show
  1. package/cli.js +5 -1
  2. package/dist/app/App.d.ts +1 -2
  3. package/dist/app/App.js +1 -29
  4. package/dist/app/App.js.map +1 -1
  5. package/dist/app/demo.d.ts +2 -0
  6. package/dist/app/demo.js +33 -0
  7. package/dist/app/demo.js.map +1 -0
  8. package/dist/app/entry.client.d.ts +2 -0
  9. package/dist/app/entry.client.js +35 -0
  10. package/dist/app/entry.client.js.map +1 -0
  11. package/dist/app/entry.server.d.ts +14 -0
  12. package/dist/app/entry.server.js +105 -0
  13. package/dist/app/entry.server.js.map +1 -0
  14. package/dist/app/main.d.ts +6 -1
  15. package/dist/app/main.js +74 -12
  16. package/dist/app/main.js.map +1 -1
  17. package/dist/app/standalone.d.ts +2 -0
  18. package/dist/app/standalone.js +38 -0
  19. package/dist/app/standalone.js.map +1 -0
  20. package/dist/app/tailwind.d.ts +1 -1
  21. package/dist/app/tailwind.js +0 -4
  22. package/dist/app/tailwind.js.map +1 -1
  23. package/dist/cli/cmds/dev.js +5 -0
  24. package/dist/cli/cmds/dev.js.map +1 -1
  25. package/dist/cli/dev/handler.d.ts +1 -0
  26. package/dist/cli/dev/handler.js +3 -1
  27. package/dist/cli/dev/handler.js.map +1 -1
  28. package/dist/config/config.d.ts +21 -46
  29. package/dist/config/validators/InputSidebarSchema.d.ts +176 -0
  30. package/dist/config/validators/InputSidebarSchema.js +71 -0
  31. package/dist/config/validators/InputSidebarSchema.js.map +1 -0
  32. package/dist/config/validators/SidebarSchema.d.ts +17 -0
  33. package/dist/config/validators/SidebarSchema.js +76 -0
  34. package/dist/config/validators/SidebarSchema.js.map +1 -0
  35. package/dist/config/validators/validate.d.ts +1263 -2
  36. package/dist/config/validators/validate.js +170 -1
  37. package/dist/config/validators/validate.js.map +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/internal.d.ts +1 -0
  40. package/dist/internal.js +2 -0
  41. package/dist/internal.js.map +1 -0
  42. package/dist/lib/authentication/AuthenticationPlugin.d.ts +13 -0
  43. package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
  44. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
  45. package/dist/lib/authentication/authentication.d.ts +10 -9
  46. package/dist/lib/authentication/components/SignIn.d.ts +1 -0
  47. package/dist/lib/authentication/components/SignIn.js +14 -0
  48. package/dist/lib/authentication/components/SignIn.js.map +1 -0
  49. package/dist/lib/authentication/components/SignOut.d.ts +1 -0
  50. package/dist/lib/authentication/components/SignOut.js +12 -0
  51. package/dist/lib/authentication/components/SignOut.js.map +1 -0
  52. package/dist/lib/authentication/components/SignUp.d.ts +1 -0
  53. package/dist/lib/authentication/components/SignUp.js +10 -0
  54. package/dist/lib/authentication/components/SignUp.js.map +1 -0
  55. package/dist/lib/authentication/hook.js +4 -4
  56. package/dist/lib/authentication/hook.js.map +1 -1
  57. package/dist/lib/authentication/providers/auth0.js +11 -6
  58. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  59. package/dist/lib/authentication/providers/clerk.js +59 -30
  60. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  61. package/dist/lib/authentication/providers/openid.d.ts +30 -7
  62. package/dist/lib/authentication/providers/openid.js +79 -29
  63. package/dist/lib/authentication/providers/openid.js.map +1 -1
  64. package/dist/lib/authentication/state.js +1 -1
  65. package/dist/lib/authentication/state.js.map +1 -1
  66. package/dist/lib/components/Bootstrap.d.ts +13 -0
  67. package/dist/lib/components/Bootstrap.js +12 -0
  68. package/dist/lib/components/Bootstrap.js.map +1 -0
  69. package/dist/lib/components/DevPortal.d.ts +5 -23
  70. package/dist/lib/components/DevPortal.js +43 -20
  71. package/dist/lib/components/DevPortal.js.map +1 -1
  72. package/dist/lib/components/DeveloperHint.d.ts +5 -0
  73. package/dist/lib/components/DeveloperHint.js +10 -0
  74. package/dist/lib/components/DeveloperHint.js.map +1 -0
  75. package/dist/lib/components/ErrorPage.d.ts +6 -0
  76. package/dist/lib/components/ErrorPage.js +9 -0
  77. package/dist/lib/components/ErrorPage.js.map +1 -0
  78. package/dist/lib/components/Header.js +23 -4
  79. package/dist/lib/components/Header.js.map +1 -1
  80. package/dist/lib/components/Heading.d.ts +9 -4
  81. package/dist/lib/components/Heading.js +17 -2
  82. package/dist/lib/components/Heading.js.map +1 -1
  83. package/dist/lib/components/InlineCode.d.ts +5 -0
  84. package/dist/lib/components/InlineCode.js +4 -0
  85. package/dist/lib/components/InlineCode.js.map +1 -0
  86. package/dist/lib/components/Layout.js +7 -5
  87. package/dist/lib/components/Layout.js.map +1 -1
  88. package/dist/lib/components/NotFoundPage.d.ts +1 -0
  89. package/dist/lib/components/NotFoundPage.js +12 -0
  90. package/dist/lib/components/NotFoundPage.js.map +1 -0
  91. package/dist/lib/components/SlotletProvider.d.ts +9 -0
  92. package/dist/lib/components/SlotletProvider.js +11 -0
  93. package/dist/lib/components/SlotletProvider.js.map +1 -0
  94. package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
  95. package/dist/lib/components/SyntaxHighlight.js +24 -22
  96. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  97. package/dist/lib/components/TopNavigation.d.ts +1 -1
  98. package/dist/lib/components/TopNavigation.js +8 -4
  99. package/dist/lib/components/TopNavigation.js.map +1 -1
  100. package/dist/lib/components/context/ThemeContext.d.ts +1 -4
  101. package/dist/lib/components/context/ThemeContext.js +3 -29
  102. package/dist/lib/components/context/ThemeContext.js.map +1 -1
  103. package/dist/lib/components/context/ThemeProvider.d.ts +4 -0
  104. package/dist/lib/components/context/ThemeProvider.js +23 -0
  105. package/dist/lib/components/context/ThemeProvider.js.map +1 -0
  106. package/dist/lib/components/context/ZudokuContext.d.ts +15 -0
  107. package/dist/lib/components/context/ZudokuContext.js +46 -0
  108. package/dist/lib/components/context/ZudokuContext.js.map +1 -0
  109. package/dist/lib/components/context/ZudokuProvider.d.ts +5 -0
  110. package/dist/lib/components/context/ZudokuProvider.js +16 -0
  111. package/dist/lib/components/context/ZudokuProvider.js.map +1 -0
  112. package/dist/lib/components/index.d.ts +32 -3
  113. package/dist/lib/components/index.js +21 -3
  114. package/dist/lib/components/index.js.map +1 -1
  115. package/dist/lib/components/navigation/Sidebar.d.ts +1 -0
  116. package/dist/lib/components/navigation/Sidebar.js +12 -0
  117. package/dist/lib/components/navigation/Sidebar.js.map +1 -0
  118. package/dist/lib/components/navigation/SidebarBadge.d.ts +22 -0
  119. package/dist/lib/components/navigation/SidebarBadge.js +24 -0
  120. package/dist/lib/components/navigation/SidebarBadge.js.map +1 -0
  121. package/dist/lib/components/navigation/SidebarCategory.d.ts +5 -0
  122. package/dist/lib/components/navigation/SidebarCategory.js +33 -0
  123. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -0
  124. package/dist/lib/components/navigation/SidebarItem.d.ts +12 -0
  125. package/dist/lib/components/navigation/SidebarItem.js +42 -0
  126. package/dist/lib/components/navigation/SidebarItem.js.map +1 -0
  127. package/dist/lib/components/navigation/{SideNavigationWrapper.d.ts → SidebarWrapper.d.ts} +1 -1
  128. package/dist/lib/components/navigation/{SideNavigationWrapper.js → SidebarWrapper.js} +2 -2
  129. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -0
  130. package/dist/lib/components/navigation/utils.d.ts +16 -0
  131. package/dist/lib/components/navigation/utils.js +85 -0
  132. package/dist/lib/components/navigation/utils.js.map +1 -0
  133. package/dist/lib/core/DevPortalContext.d.ts +58 -42
  134. package/dist/lib/core/DevPortalContext.js +18 -19
  135. package/dist/lib/core/DevPortalContext.js.map +1 -1
  136. package/dist/lib/core/plugins.d.ts +25 -10
  137. package/dist/lib/core/plugins.js +3 -0
  138. package/dist/lib/core/plugins.js.map +1 -1
  139. package/dist/lib/errors/ErrorAlert.d.ts +3 -0
  140. package/dist/lib/errors/ErrorAlert.js +8 -0
  141. package/dist/lib/errors/ErrorAlert.js.map +1 -0
  142. package/dist/lib/errors/RouterError.d.ts +1 -0
  143. package/dist/lib/errors/RouterError.js +12 -0
  144. package/dist/lib/errors/RouterError.js.map +1 -0
  145. package/dist/lib/errors/ServerError.d.ts +3 -0
  146. package/dist/lib/errors/ServerError.js +6 -0
  147. package/dist/lib/errors/ServerError.js.map +1 -0
  148. package/dist/lib/errors/TopLevelError.d.ts +2 -0
  149. package/dist/lib/errors/TopLevelError.js +7 -0
  150. package/dist/lib/errors/TopLevelError.js.map +1 -0
  151. package/dist/lib/oas/graphql/index.js +8 -5
  152. package/dist/lib/oas/graphql/index.js.map +1 -1
  153. package/dist/lib/oas/parser/index.d.ts +1 -1
  154. package/dist/lib/oas/parser/index.js +38 -12
  155. package/dist/lib/oas/parser/index.js.map +1 -1
  156. package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +4 -4
  157. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  158. package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
  159. package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
  160. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
  161. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +54 -0
  162. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  163. package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +4 -5
  164. package/dist/lib/plugins/{api-key → api-keys}/index.js +18 -20
  165. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  166. package/dist/lib/plugins/custom-page/index.d.ts +8 -0
  167. package/dist/lib/plugins/custom-page/index.js +12 -0
  168. package/dist/lib/plugins/custom-page/index.js.map +1 -0
  169. package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
  170. package/dist/lib/plugins/markdown/MdxPage.js +10 -40
  171. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  172. package/dist/lib/plugins/markdown/Toc.js +17 -9
  173. package/dist/lib/plugins/markdown/Toc.js.map +1 -1
  174. package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
  175. package/dist/lib/plugins/markdown/generateRoutes.js +20 -43
  176. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  177. package/dist/lib/plugins/markdown/index.d.ts +4 -1
  178. package/dist/lib/plugins/markdown/index.js +3 -7
  179. package/dist/lib/plugins/markdown/index.js.map +1 -1
  180. package/dist/lib/plugins/openapi/ColorizedParam.d.ts +2 -1
  181. package/dist/lib/plugins/openapi/ColorizedParam.js +14 -9
  182. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  183. package/dist/lib/plugins/openapi/OperationList.js +17 -5
  184. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  185. package/dist/lib/plugins/openapi/OperationListItem.js +11 -5
  186. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  187. package/dist/lib/plugins/openapi/ParameterList.js +2 -1
  188. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  189. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  190. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  191. package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +2 -1
  192. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +23 -0
  193. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
  194. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +3 -9
  195. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  196. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
  197. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  198. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  199. package/dist/lib/plugins/openapi/Route.js +8 -0
  200. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  201. package/dist/lib/plugins/openapi/SchemaListView.js +10 -26
  202. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
  203. package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +8 -0
  204. package/dist/lib/plugins/openapi/SchemaListViewItem.js +25 -0
  205. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
  206. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
  207. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
  208. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
  209. package/dist/lib/plugins/openapi/Sidecar.d.ts +4 -0
  210. package/dist/lib/plugins/openapi/Sidecar.js +55 -21
  211. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  212. package/dist/lib/plugins/openapi/SidecarBox.d.ts +1 -0
  213. package/dist/lib/plugins/openapi/SidecarBox.js +3 -2
  214. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  215. package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
  216. package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
  217. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
  218. package/dist/lib/plugins/openapi/StaggeredRender.d.ts +8 -0
  219. package/dist/lib/plugins/openapi/StaggeredRender.js +18 -0
  220. package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -0
  221. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
  222. package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
  223. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
  224. package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
  225. package/dist/lib/plugins/openapi/client/createServer.js +30 -0
  226. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
  227. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
  228. package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
  229. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
  230. package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
  231. package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
  232. package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
  233. package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
  234. package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
  235. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  236. package/dist/lib/plugins/openapi/context.js +11 -0
  237. package/dist/lib/plugins/openapi/context.js.map +1 -0
  238. package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -6
  239. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  240. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  241. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +15 -15
  242. package/dist/lib/plugins/openapi/graphql/graphql.js +67 -67
  243. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  244. package/dist/lib/plugins/openapi/index.d.ts +4 -18
  245. package/dist/lib/plugins/openapi/index.js +76 -32
  246. package/dist/lib/plugins/openapi/index.js.map +1 -1
  247. package/dist/lib/plugins/openapi/interfaces.d.ts +16 -0
  248. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  249. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  250. package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
  251. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  252. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +4 -5
  253. package/dist/lib/plugins/openapi/playground/PathParams.js +9 -13
  254. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  255. package/dist/lib/plugins/openapi/playground/Playground.d.ts +26 -14
  256. package/dist/lib/plugins/openapi/playground/Playground.js +54 -26
  257. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  258. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +5 -0
  259. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +12 -0
  260. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
  261. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +4 -3
  262. package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -12
  263. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  264. package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +4 -0
  265. package/dist/lib/plugins/openapi/playground/ResponseTab.js +40 -0
  266. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -0
  267. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
  268. package/dist/lib/plugins/openapi/playground/createUrl.js +5 -9
  269. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
  270. package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
  271. package/dist/lib/plugins/openapi/util/prose.js +4 -0
  272. package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
  273. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  274. package/dist/lib/plugins/openapi-worker.js +1 -1
  275. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  276. package/dist/lib/plugins/redirect/index.d.ts +0 -1
  277. package/dist/lib/plugins/redirect/index.js +3 -4
  278. package/dist/lib/plugins/redirect/index.js.map +1 -1
  279. package/dist/lib/ui/Button.d.ts +5 -1
  280. package/dist/lib/ui/Button.js +24 -1
  281. package/dist/lib/ui/Button.js.map +1 -1
  282. package/dist/lib/ui/Callout.js +2 -2
  283. package/dist/lib/ui/Callout.js.map +1 -1
  284. package/dist/lib/ui/Card.js +1 -1
  285. package/dist/lib/ui/Card.js.map +1 -1
  286. package/dist/lib/ui/DropdownMenu.d.ts +27 -0
  287. package/dist/lib/ui/DropdownMenu.js +36 -0
  288. package/dist/lib/ui/DropdownMenu.js.map +1 -0
  289. package/dist/lib/ui/Input.js.map +1 -0
  290. package/dist/lib/util/MdxComponents.d.ts +2 -2
  291. package/dist/lib/util/MdxComponents.js +7 -5
  292. package/dist/lib/util/MdxComponents.js.map +1 -1
  293. package/dist/lib/util/fetchTimeout.d.ts +1 -0
  294. package/dist/lib/util/fetchTimeout.js +14 -0
  295. package/dist/lib/util/fetchTimeout.js.map +1 -0
  296. package/dist/lib/util/groupBy.d.ts +1 -6
  297. package/dist/lib/util/groupBy.js +10 -8
  298. package/dist/lib/util/groupBy.js.map +1 -1
  299. package/dist/lib/util/invariant.d.ts +6 -0
  300. package/dist/lib/util/invariant.js +21 -0
  301. package/dist/lib/util/invariant.js.map +1 -0
  302. package/dist/lib/util/joinPath.js +2 -1
  303. package/dist/lib/util/joinPath.js.map +1 -1
  304. package/dist/lib/util/logInit.d.ts +1 -0
  305. package/dist/lib/util/logInit.js +9 -0
  306. package/dist/lib/util/logInit.js.map +1 -0
  307. package/dist/lib/util/objectEntries.d.ts +4 -0
  308. package/dist/lib/util/objectEntries.js +2 -0
  309. package/dist/lib/util/objectEntries.js.map +1 -0
  310. package/dist/lib/util/renderIf.d.ts +1 -0
  311. package/dist/lib/util/renderIf.js +2 -0
  312. package/dist/lib/util/renderIf.js.map +1 -0
  313. package/dist/lib/util/requestIdleCallbackPolyfill.d.ts +1 -0
  314. package/dist/lib/util/requestIdleCallbackPolyfill.js +7 -0
  315. package/dist/lib/util/requestIdleCallbackPolyfill.js.map +1 -0
  316. package/dist/lib/util/useScrollToAnchor.js +31 -17
  317. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  318. package/dist/vite/build.js +30 -7
  319. package/dist/vite/build.js.map +1 -1
  320. package/dist/vite/config.d.ts +20 -12
  321. package/dist/vite/config.js +107 -55
  322. package/dist/vite/config.js.map +1 -1
  323. package/dist/vite/config.test.js +6 -3
  324. package/dist/vite/config.test.js.map +1 -1
  325. package/dist/vite/dev-server.d.ts +2 -1
  326. package/dist/vite/dev-server.js +44 -15
  327. package/dist/vite/dev-server.js.map +1 -1
  328. package/dist/vite/html.js +18 -5
  329. package/dist/vite/html.js.map +1 -1
  330. package/dist/vite/plugin-api-keys.js +7 -8
  331. package/dist/vite/plugin-api-keys.js.map +1 -1
  332. package/dist/vite/plugin-api.js +9 -20
  333. package/dist/vite/plugin-api.js.map +1 -1
  334. package/dist/vite/plugin-auth.js +5 -6
  335. package/dist/vite/plugin-auth.js.map +1 -1
  336. package/dist/vite/plugin-component.js +5 -2
  337. package/dist/vite/plugin-component.js.map +1 -1
  338. package/dist/vite/plugin-config.d.ts +3 -6
  339. package/dist/vite/plugin-config.js +5 -8
  340. package/dist/vite/plugin-config.js.map +1 -1
  341. package/dist/vite/plugin-custom-css.d.ts +6 -0
  342. package/dist/vite/plugin-custom-css.js +54 -0
  343. package/dist/vite/plugin-custom-css.js.map +1 -0
  344. package/dist/vite/plugin-docs.js +11 -5
  345. package/dist/vite/plugin-docs.js.map +1 -1
  346. package/dist/vite/plugin-mdx.d.ts +3 -1
  347. package/dist/vite/plugin-mdx.js +5 -5
  348. package/dist/vite/plugin-mdx.js.map +1 -1
  349. package/dist/vite/plugin-metadata.js +1 -1
  350. package/dist/vite/plugin-metadata.js.map +1 -1
  351. package/dist/vite/plugin-redirect.js +10 -10
  352. package/dist/vite/plugin-redirect.js.map +1 -1
  353. package/dist/vite/plugin-sidebar.d.ts +3 -0
  354. package/dist/vite/plugin-sidebar.js +23 -0
  355. package/dist/vite/plugin-sidebar.js.map +1 -0
  356. package/dist/vite/plugin.js +5 -5
  357. package/dist/vite/plugin.js.map +1 -1
  358. package/dist/vite/prerender.d.ts +17 -0
  359. package/dist/vite/prerender.js +79 -0
  360. package/dist/vite/prerender.js.map +1 -0
  361. package/lib/AuthenticationPlugin-CH5NSVOu.js +55 -0
  362. package/lib/AuthenticationPlugin-CH5NSVOu.js.map +1 -0
  363. package/lib/CategoryHeading-BWq12Bfa.js +10 -0
  364. package/lib/CategoryHeading-BWq12Bfa.js.map +1 -0
  365. package/lib/Combination-D-9IH0zy.js +2789 -0
  366. package/lib/Combination-D-9IH0zy.js.map +1 -0
  367. package/lib/DeveloperHint-BQSFXH01.js +10 -0
  368. package/lib/DeveloperHint-BQSFXH01.js.map +1 -0
  369. package/lib/Input-HmAaR6kw.js +2239 -0
  370. package/lib/Input-HmAaR6kw.js.map +1 -0
  371. package/lib/Markdown-B_Gax7at.js +14108 -0
  372. package/lib/Markdown-B_Gax7at.js.map +1 -0
  373. package/lib/MdxPage-3-PenZs2.js +187 -0
  374. package/lib/MdxPage-3-PenZs2.js.map +1 -0
  375. package/lib/OperationList-DvKqvB16.js +448 -0
  376. package/lib/OperationList-DvKqvB16.js.map +1 -0
  377. package/lib/Route-CnmaDun4.js +14 -0
  378. package/lib/Route-CnmaDun4.js.map +1 -0
  379. package/lib/SlotletProvider-CzMAO73_.js +82 -0
  380. package/lib/SlotletProvider-CzMAO73_.js.map +1 -0
  381. package/lib/Spinner-D99Tq0hv.js +274 -0
  382. package/lib/Spinner-D99Tq0hv.js.map +1 -0
  383. package/lib/ZudokuContext-BIZ8zHbZ.js +1084 -0
  384. package/lib/ZudokuContext-BIZ8zHbZ.js.map +1 -0
  385. package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
  386. package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
  387. package/lib/assets/index-BPdJm2ty.js +1 -0
  388. package/lib/assets/index-BPdJm2ty.js.map +1 -0
  389. package/lib/assets/{worker-BCcpCNJ7.js → worker-CyHZIIfE.js} +10727 -10300
  390. package/lib/assets/worker-CyHZIIfE.js.map +1 -0
  391. package/lib/index-7kcHaXD6.js +1771 -0
  392. package/lib/index-7kcHaXD6.js.map +1 -0
  393. package/lib/index-7nswqEVR.js +124 -0
  394. package/lib/index-7nswqEVR.js.map +1 -0
  395. package/lib/index-DjaqWcmv.js +5934 -0
  396. package/lib/index-DjaqWcmv.js.map +1 -0
  397. package/lib/index-pI9JkN46.js +4765 -0
  398. package/lib/index-pI9JkN46.js.map +1 -0
  399. package/lib/joinPath-VeNuJa7y.js +8 -0
  400. package/lib/joinPath-VeNuJa7y.js.map +1 -0
  401. package/lib/jsx-runtime-B6kdoens.js +635 -0
  402. package/lib/jsx-runtime-B6kdoens.js.map +1 -0
  403. package/lib/prism-bash.min-DadFsM4Z.js +1 -0
  404. package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
  405. package/lib/prism-csharp.min-Yizuc34Y.js +1 -0
  406. package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
  407. package/lib/prism-java.min-d5iT_mOd.js +1 -0
  408. package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
  409. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  410. package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
  411. package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
  412. package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
  413. package/lib/prism-objectivec.min-BXSWqpJJ.js +1 -0
  414. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
  415. package/lib/prism-php.min-o7FpoMP_.js +1 -0
  416. package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
  417. package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
  418. package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
  419. package/lib/router-BiRCp01d.js +2971 -0
  420. package/lib/router-BiRCp01d.js.map +1 -0
  421. package/lib/slugify-CiPVjteN.js +28 -0
  422. package/lib/slugify-CiPVjteN.js.map +1 -0
  423. package/lib/state-DsXXkBLH.js +288 -0
  424. package/lib/state-DsXXkBLH.js.map +1 -0
  425. package/lib/{urql-DMlBWUKL.js → urql-DrBfkb92.js} +2 -2
  426. package/lib/urql-DrBfkb92.js.map +1 -0
  427. package/lib/utils-D3g3xyZM.js +749 -0
  428. package/lib/utils-D3g3xyZM.js.map +1 -0
  429. package/lib/zudoku.auth-auth0.js +31 -20
  430. package/lib/zudoku.auth-auth0.js.map +1 -0
  431. package/lib/zudoku.auth-clerk.js +59 -29
  432. package/lib/zudoku.auth-clerk.js.map +1 -0
  433. package/lib/zudoku.auth-openid.js +742 -573
  434. package/lib/zudoku.auth-openid.js.map +1 -0
  435. package/lib/zudoku.components.js +2008 -684
  436. package/lib/zudoku.components.js.map +1 -0
  437. package/lib/zudoku.openapi-worker.js +15035 -146
  438. package/lib/zudoku.openapi-worker.js.map +1 -0
  439. package/lib/zudoku.plugin-api-keys.js +325 -0
  440. package/lib/zudoku.plugin-api-keys.js.map +1 -0
  441. package/lib/zudoku.plugin-custom-page.js +13 -0
  442. package/lib/zudoku.plugin-custom-page.js.map +1 -0
  443. package/lib/zudoku.plugin-markdown.js +31 -0
  444. package/lib/zudoku.plugin-markdown.js.map +1 -0
  445. package/lib/zudoku.plugin-openapi.js +14 -0
  446. package/lib/zudoku.plugin-openapi.js.map +1 -0
  447. package/lib/zudoku.plugin-redirect.js +11 -0
  448. package/lib/zudoku.plugin-redirect.js.map +1 -0
  449. package/package.json +64 -25
  450. package/src/app/App.tsx +0 -41
  451. package/src/app/demo-cdn.html +26 -0
  452. package/src/app/demo.html +18 -0
  453. package/src/app/demo.tsx +46 -0
  454. package/src/app/entry.client.tsx +47 -0
  455. package/src/app/entry.server.tsx +160 -0
  456. package/src/app/main.css +83 -3
  457. package/src/app/main.tsx +87 -15
  458. package/src/app/standalone.html +20 -0
  459. package/src/app/standalone.tsx +52 -0
  460. package/src/app/tailwind.ts +2 -6
  461. package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
  462. package/src/lib/authentication/authentication.ts +6 -12
  463. package/src/lib/authentication/components/SignIn.tsx +15 -0
  464. package/src/lib/authentication/components/SignOut.tsx +13 -0
  465. package/src/lib/authentication/components/SignUp.tsx +11 -0
  466. package/src/lib/authentication/hook.ts +4 -4
  467. package/src/lib/authentication/providers/auth0.tsx +16 -6
  468. package/src/lib/authentication/providers/clerk.tsx +63 -31
  469. package/src/lib/authentication/providers/openid.tsx +104 -34
  470. package/src/lib/authentication/state.ts +1 -1
  471. package/src/lib/components/Bootstrap.tsx +44 -0
  472. package/src/lib/components/DevPortal.tsx +75 -66
  473. package/src/lib/components/DeveloperHint.tsx +25 -0
  474. package/src/lib/components/ErrorPage.tsx +28 -0
  475. package/src/lib/components/Header.tsx +106 -31
  476. package/src/lib/components/Heading.tsx +26 -7
  477. package/src/lib/components/InlineCode.tsx +19 -0
  478. package/src/lib/components/Layout.tsx +16 -11
  479. package/src/lib/components/NotFoundPage.tsx +33 -0
  480. package/src/lib/components/SlotletProvider.tsx +25 -0
  481. package/src/lib/components/SyntaxHighlight.tsx +53 -44
  482. package/src/lib/components/TopNavigation.tsx +10 -5
  483. package/src/lib/components/context/ThemeContext.tsx +3 -41
  484. package/src/lib/components/context/ThemeProvider.tsx +27 -0
  485. package/src/lib/components/context/ZudokuContext.ts +58 -0
  486. package/src/lib/components/context/ZudokuProvider.tsx +26 -0
  487. package/src/lib/components/index.ts +25 -3
  488. package/src/lib/components/navigation/Sidebar.tsx +24 -0
  489. package/src/lib/components/navigation/SidebarBadge.tsx +40 -0
  490. package/src/lib/components/navigation/SidebarCategory.tsx +105 -0
  491. package/src/lib/components/navigation/SidebarItem.tsx +100 -0
  492. package/src/lib/components/navigation/{SideNavigationWrapper.tsx → SidebarWrapper.tsx} +1 -1
  493. package/src/lib/components/navigation/utils.ts +117 -0
  494. package/src/lib/core/DevPortalContext.ts +72 -68
  495. package/src/lib/core/plugins.ts +40 -16
  496. package/src/lib/errors/ErrorAlert.tsx +21 -0
  497. package/src/lib/errors/RouterError.tsx +13 -0
  498. package/src/lib/errors/ServerError.tsx +5 -0
  499. package/src/lib/errors/TopLevelError.tsx +8 -0
  500. package/src/lib/oas/graphql/index.ts +11 -6
  501. package/src/lib/oas/parser/index.ts +41 -20
  502. package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +4 -4
  503. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
  504. package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +49 -16
  505. package/src/lib/plugins/{api-key → api-keys}/index.tsx +27 -41
  506. package/src/lib/plugins/custom-page/index.tsx +22 -0
  507. package/src/lib/plugins/markdown/MdxPage.tsx +54 -73
  508. package/src/lib/plugins/markdown/Toc.tsx +53 -40
  509. package/src/lib/plugins/markdown/generateRoutes.tsx +35 -53
  510. package/src/lib/plugins/markdown/index.tsx +10 -7
  511. package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -16
  512. package/src/lib/plugins/openapi/OperationList.tsx +46 -10
  513. package/src/lib/plugins/openapi/OperationListItem.tsx +51 -30
  514. package/src/lib/plugins/openapi/ParameterList.tsx +13 -10
  515. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
  516. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +39 -0
  517. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +3 -15
  518. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -2
  519. package/src/lib/plugins/openapi/Route.tsx +21 -0
  520. package/src/lib/plugins/openapi/SchemaListView.tsx +39 -192
  521. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +125 -0
  522. package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
  523. package/src/lib/plugins/openapi/Sidecar.tsx +77 -30
  524. package/src/lib/plugins/openapi/SidecarBox.tsx +13 -2
  525. package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
  526. package/src/lib/plugins/openapi/StaggeredRender.tsx +31 -0
  527. package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
  528. package/src/lib/plugins/openapi/client/createServer.ts +33 -0
  529. package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
  530. package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
  531. package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
  532. package/src/lib/plugins/openapi/context.tsx +16 -0
  533. package/src/lib/plugins/openapi/graphql/gql.ts +8 -8
  534. package/src/lib/plugins/openapi/graphql/graphql.ts +80 -80
  535. package/src/lib/plugins/openapi/index.tsx +134 -76
  536. package/src/lib/plugins/openapi/interfaces.ts +10 -0
  537. package/src/lib/plugins/openapi/playground/Headers.tsx +1 -1
  538. package/src/lib/plugins/openapi/playground/PathParams.tsx +76 -50
  539. package/src/lib/plugins/openapi/playground/Playground.tsx +240 -230
  540. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +40 -0
  541. package/src/lib/plugins/openapi/playground/QueryParams.tsx +107 -66
  542. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +76 -0
  543. package/src/lib/plugins/openapi/playground/createUrl.ts +12 -15
  544. package/src/lib/plugins/openapi/util/prose.ts +7 -0
  545. package/src/lib/plugins/openapi-worker.ts +1 -1
  546. package/src/lib/plugins/redirect/index.tsx +3 -4
  547. package/src/lib/ui/Button.tsx +32 -2
  548. package/src/lib/ui/Callout.tsx +4 -4
  549. package/src/lib/ui/Card.tsx +1 -1
  550. package/src/lib/ui/DropdownMenu.tsx +199 -0
  551. package/src/lib/util/MdxComponents.tsx +7 -15
  552. package/src/lib/util/fetchTimeout.tsx +21 -0
  553. package/src/lib/util/groupBy.ts +7 -12
  554. package/src/lib/util/invariant.ts +26 -0
  555. package/src/lib/util/joinPath.tsx +2 -1
  556. package/src/lib/util/logInit.ts +9 -0
  557. package/src/lib/util/objectEntries.ts +5 -0
  558. package/src/lib/util/renderIf.ts +4 -0
  559. package/src/lib/util/requestIdleCallbackPolyfill.ts +6 -0
  560. package/src/lib/util/useScrollToAnchor.ts +39 -18
  561. package/dist/lib/authentication/Callback.d.ts +0 -3
  562. package/dist/lib/authentication/Callback.js +0 -34
  563. package/dist/lib/authentication/Callback.js.map +0 -1
  564. package/dist/lib/components/Input.js.map +0 -1
  565. package/dist/lib/components/Link.d.ts +0 -1
  566. package/dist/lib/components/Link.js +0 -2
  567. package/dist/lib/components/Link.js.map +0 -1
  568. package/dist/lib/components/Router.d.ts +0 -4
  569. package/dist/lib/components/Router.js +0 -20
  570. package/dist/lib/components/Router.js.map +0 -1
  571. package/dist/lib/components/context/DevPortalProvider.d.ts +0 -9
  572. package/dist/lib/components/context/DevPortalProvider.js +0 -39
  573. package/dist/lib/components/context/DevPortalProvider.js.map +0 -1
  574. package/dist/lib/components/navigation/SideNavigation.d.ts +0 -1
  575. package/dist/lib/components/navigation/SideNavigation.js +0 -11
  576. package/dist/lib/components/navigation/SideNavigation.js.map +0 -1
  577. package/dist/lib/components/navigation/SideNavigationCategory.d.ts +0 -4
  578. package/dist/lib/components/navigation/SideNavigationCategory.js +0 -26
  579. package/dist/lib/components/navigation/SideNavigationCategory.js.map +0 -1
  580. package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -13
  581. package/dist/lib/components/navigation/SideNavigationItem.js +0 -44
  582. package/dist/lib/components/navigation/SideNavigationItem.js.map +0 -1
  583. package/dist/lib/components/navigation/SideNavigationWrapper.js.map +0 -1
  584. package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +0 -6
  585. package/dist/lib/components/navigation/useNavigationCollapsibleState.js +0 -16
  586. package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +0 -1
  587. package/dist/lib/components/navigation/util.d.ts +0 -8
  588. package/dist/lib/components/navigation/util.js +0 -15
  589. package/dist/lib/components/navigation/util.js.map +0 -1
  590. package/dist/lib/core/helmet.d.ts +0 -4
  591. package/dist/lib/core/helmet.js +0 -5
  592. package/dist/lib/core/helmet.js.map +0 -1
  593. package/dist/lib/core/icons.d.ts +0 -1
  594. package/dist/lib/core/icons.js +0 -2
  595. package/dist/lib/core/icons.js.map +0 -1
  596. package/dist/lib/core/router.d.ts +0 -1
  597. package/dist/lib/core/router.js +0 -2
  598. package/dist/lib/core/router.js.map +0 -1
  599. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  600. package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
  601. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  602. package/dist/lib/plugins/api-key/index.js.map +0 -1
  603. package/dist/lib/plugins/index.d.ts +0 -4
  604. package/dist/lib/plugins/index.js +0 -5
  605. package/dist/lib/plugins/index.js.map +0 -1
  606. package/dist/lib/plugins/openapi/MakeRequest.js +0 -43
  607. package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
  608. package/dist/lib/plugins/openapi/MethodBadge.d.ts +0 -13
  609. package/dist/lib/plugins/openapi/MethodBadge.js +0 -26
  610. package/dist/lib/plugins/openapi/MethodBadge.js.map +0 -1
  611. package/dist/lib/plugins/openapi/Select.js +0 -5
  612. package/dist/lib/plugins/openapi/Select.js.map +0 -1
  613. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
  614. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  615. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
  616. package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
  617. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
  618. package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
  619. package/dist/lib/ui/button-variants.d.ts +0 -4
  620. package/dist/lib/ui/button-variants.js +0 -24
  621. package/dist/lib/ui/button-variants.js.map +0 -1
  622. package/dist/lib/util/traverseNavigation.d.ts +0 -6
  623. package/dist/lib/util/traverseNavigation.js +0 -30
  624. package/dist/lib/util/traverseNavigation.js.map +0 -1
  625. package/dist/vite/common.d.ts +0 -1
  626. package/dist/vite/common.js +0 -5
  627. package/dist/vite/common.js.map +0 -1
  628. package/dist/vite/plugin-html.d.ts +0 -3
  629. package/dist/vite/plugin-html.js +0 -47
  630. package/dist/vite/plugin-html.js.map +0 -1
  631. package/dist/vite/plugin-openapi-worker.d.ts +0 -4
  632. package/dist/vite/plugin-openapi-worker.js +0 -28
  633. package/dist/vite/plugin-openapi-worker.js.map +0 -1
  634. package/lib/Spinner-BewqqUU-.js +0 -8413
  635. package/lib/clerk-Wslx_mPo.js +0 -19685
  636. package/lib/index-PyGcnQFX.js +0 -3462
  637. package/lib/loglevel-CoH7VSwE.js +0 -152
  638. package/lib/state-2Hu1renZ.js +0 -313
  639. package/lib/zudoku.plugins.js +0 -19904
  640. package/src/lib/authentication/Callback.tsx +0 -60
  641. package/src/lib/components/Link.tsx +0 -1
  642. package/src/lib/components/Router.tsx +0 -28
  643. package/src/lib/components/context/DevPortalProvider.ts +0 -54
  644. package/src/lib/components/navigation/SideNavigation.tsx +0 -21
  645. package/src/lib/components/navigation/SideNavigationCategory.tsx +0 -76
  646. package/src/lib/components/navigation/SideNavigationItem.tsx +0 -152
  647. package/src/lib/components/navigation/useNavigationCollapsibleState.ts +0 -27
  648. package/src/lib/components/navigation/util.ts +0 -38
  649. package/src/lib/core/helmet.ts +0 -5
  650. package/src/lib/core/icons.tsx +0 -1
  651. package/src/lib/core/router.tsx +0 -1
  652. package/src/lib/plugins/index.ts +0 -4
  653. package/src/lib/plugins/openapi/MakeRequest.tsx +0 -63
  654. package/src/lib/plugins/openapi/MethodBadge.tsx +0 -36
  655. package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
  656. package/src/lib/ui/button-variants.ts +0 -31
  657. package/src/lib/util/traverseNavigation.ts +0 -55
  658. /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
  659. /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
  660. /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
  661. /package/dist/lib/{components → ui}/Input.d.ts +0 -0
  662. /package/dist/lib/{components → ui}/Input.js +0 -0
  663. /package/src/lib/{components → ui}/Input.tsx +0 -0
@@ -0,0 +1,2239 @@
1
+ var zt = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var St = (e, r, t) => r.has(e) || zt("Cannot " + t);
5
+ var G = (e, r, t) => (St(e, r, "read from private field"), t ? t.call(e) : r.get(e)), Ue = (e, r, t) => r.has(e) ? zt("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), He = (e, r, t, s) => (St(e, r, "write to private field"), s ? s.call(e, t) : r.set(e, t), t), We = (e, r, t) => (St(e, r, "access private method"), t);
6
+ import * as h from "react";
7
+ import I from "react";
8
+ import { s as hs, P as de, c as ms, a as ys, b as nr, u as xe, A as gs, d as ne, r as Ne, h as vs, e as xs, R as Ss, S as _s, F as bs, D as ws, C as Cs, n as Bt, g as As, f as Vs, m as Es, k as Fs, o as Yt, l as Rs } from "./Combination-D-9IH0zy.js";
9
+ import { S as Ts, x as Is, i as Xt, n as ir, t as Ns, y as Ds, z as Ps } from "./ZudokuContext-BIZ8zHbZ.js";
10
+ import { j as _ } from "./jsx-runtime-B6kdoens.js";
11
+ import * as ar from "react-dom";
12
+ import { c as lr, a as Ee, C as ks } from "./Markdown-B_Gax7at.js";
13
+ /**
14
+ * @license lucide-react v0.378.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ */
19
+ const cr = lr("ChevronDown", [
20
+ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
21
+ ]);
22
+ /**
23
+ * @license lucide-react v0.378.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */
28
+ const Ms = lr("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
29
+ var Re, Te, ae, Ae, Ve, nt, Nt, or, Os = (or = class extends Ts {
30
+ constructor(r, t) {
31
+ super();
32
+ Ue(this, Ve);
33
+ Ue(this, Re);
34
+ Ue(this, Te);
35
+ Ue(this, ae);
36
+ Ue(this, Ae);
37
+ He(this, Re, r), this.setOptions(t), this.bindMethods(), We(this, Ve, nt).call(this);
38
+ }
39
+ bindMethods() {
40
+ this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
41
+ }
42
+ setOptions(r) {
43
+ var s;
44
+ const t = this.options;
45
+ this.options = G(this, Re).defaultMutationOptions(r), Is(this.options, t) || G(this, Re).getMutationCache().notify({
46
+ type: "observerOptionsUpdated",
47
+ mutation: G(this, ae),
48
+ observer: this
49
+ }), t != null && t.mutationKey && this.options.mutationKey && Xt(t.mutationKey) !== Xt(this.options.mutationKey) ? this.reset() : ((s = G(this, ae)) == null ? void 0 : s.state.status) === "pending" && G(this, ae).setOptions(this.options);
50
+ }
51
+ onUnsubscribe() {
52
+ var r;
53
+ this.hasListeners() || (r = G(this, ae)) == null || r.removeObserver(this);
54
+ }
55
+ onMutationUpdate(r) {
56
+ We(this, Ve, nt).call(this), We(this, Ve, Nt).call(this, r);
57
+ }
58
+ getCurrentResult() {
59
+ return G(this, Te);
60
+ }
61
+ reset() {
62
+ var r;
63
+ (r = G(this, ae)) == null || r.removeObserver(this), He(this, ae, void 0), We(this, Ve, nt).call(this), We(this, Ve, Nt).call(this);
64
+ }
65
+ mutate(r, t) {
66
+ var s;
67
+ return He(this, Ae, t), (s = G(this, ae)) == null || s.removeObserver(this), He(this, ae, G(this, Re).getMutationCache().build(G(this, Re), this.options)), G(this, ae).addObserver(this), G(this, ae).execute(r);
68
+ }
69
+ }, Re = new WeakMap(), Te = new WeakMap(), ae = new WeakMap(), Ae = new WeakMap(), Ve = new WeakSet(), nt = function() {
70
+ var t;
71
+ const r = ((t = G(this, ae)) == null ? void 0 : t.state) ?? hs();
72
+ He(this, Te, {
73
+ ...r,
74
+ isPending: r.status === "pending",
75
+ isSuccess: r.status === "success",
76
+ isError: r.status === "error",
77
+ isIdle: r.status === "idle",
78
+ mutate: this.mutate,
79
+ reset: this.reset
80
+ });
81
+ }, Nt = function(r) {
82
+ ir.batch(() => {
83
+ var t, s, n, i, l, c, d, S;
84
+ if (G(this, Ae) && this.hasListeners()) {
85
+ const m = G(this, Te).variables, y = G(this, Te).context;
86
+ (r == null ? void 0 : r.type) === "success" ? ((s = (t = G(this, Ae)).onSuccess) == null || s.call(t, r.data, m, y), (i = (n = G(this, Ae)).onSettled) == null || i.call(n, r.data, null, m, y)) : (r == null ? void 0 : r.type) === "error" && ((c = (l = G(this, Ae)).onError) == null || c.call(l, r.error, m, y), (S = (d = G(this, Ae)).onSettled) == null || S.call(
87
+ d,
88
+ void 0,
89
+ r.error,
90
+ m,
91
+ y
92
+ ));
93
+ }
94
+ this.listeners.forEach((m) => {
95
+ m(G(this, Te));
96
+ });
97
+ });
98
+ }, or);
99
+ function Uo(e, r) {
100
+ const t = Ns(), [s] = h.useState(
101
+ () => new Os(
102
+ t,
103
+ e
104
+ )
105
+ );
106
+ h.useEffect(() => {
107
+ s.setOptions(e);
108
+ }, [s, e]);
109
+ const n = h.useSyncExternalStore(
110
+ h.useCallback(
111
+ (l) => s.subscribe(ir.batchCalls(l)),
112
+ [s]
113
+ ),
114
+ () => s.getCurrentResult(),
115
+ () => s.getCurrentResult()
116
+ ), i = h.useCallback(
117
+ (l, c) => {
118
+ s.mutate(l, c).catch(Ds);
119
+ },
120
+ [s]
121
+ );
122
+ if (n.error && Ps(s.options.throwOnError, [n.error]))
123
+ throw n.error;
124
+ return { ...n, mutate: i, mutateAsync: n.mutate };
125
+ }
126
+ var Qe = (e) => e.type === "checkbox", $e = (e) => e instanceof Date, oe = (e) => e == null;
127
+ const ur = (e) => typeof e == "object";
128
+ var re = (e) => !oe(e) && !Array.isArray(e) && ur(e) && !$e(e), dr = (e) => re(e) && e.target ? Qe(e.target) ? e.target.checked : e.target.value : e, js = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, fr = (e, r) => e.has(js(r)), Ls = (e) => {
129
+ const r = e.constructor && e.constructor.prototype;
130
+ return re(r) && r.hasOwnProperty("isPrototypeOf");
131
+ }, Ut = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
132
+ function te(e) {
133
+ let r;
134
+ const t = Array.isArray(e);
135
+ if (e instanceof Date)
136
+ r = new Date(e);
137
+ else if (e instanceof Set)
138
+ r = new Set(e);
139
+ else if (!(Ut && (e instanceof Blob || e instanceof FileList)) && (t || re(e)))
140
+ if (r = t ? [] : {}, !t && !Ls(e))
141
+ r = e;
142
+ else
143
+ for (const s in e)
144
+ e.hasOwnProperty(s) && (r[s] = te(e[s]));
145
+ else
146
+ return e;
147
+ return r;
148
+ }
149
+ var Je = (e) => Array.isArray(e) ? e.filter(Boolean) : [], $ = (e) => e === void 0, p = (e, r, t) => {
150
+ if (!r || !re(e))
151
+ return t;
152
+ const s = Je(r.split(/[,[\].]+?/)).reduce((n, i) => oe(n) ? n : n[i], e);
153
+ return $(s) || s === e ? $(e[r]) ? t : e[r] : s;
154
+ }, ge = (e) => typeof e == "boolean", Ht = (e) => /^\w*$/.test(e), pr = (e) => Je(e.replace(/["|']|\]/g, "").split(/\.|\[/)), H = (e, r, t) => {
155
+ let s = -1;
156
+ const n = Ht(r) ? [r] : pr(r), i = n.length, l = i - 1;
157
+ for (; ++s < i; ) {
158
+ const c = n[s];
159
+ let d = t;
160
+ if (s !== l) {
161
+ const S = e[c];
162
+ d = re(S) || Array.isArray(S) ? S : isNaN(+n[s + 1]) ? {} : [];
163
+ }
164
+ if (c === "__proto__")
165
+ return;
166
+ e[c] = d, e = e[c];
167
+ }
168
+ return e;
169
+ };
170
+ const at = {
171
+ BLUR: "blur",
172
+ FOCUS_OUT: "focusout",
173
+ CHANGE: "change"
174
+ }, he = {
175
+ onBlur: "onBlur",
176
+ onChange: "onChange",
177
+ onSubmit: "onSubmit",
178
+ onTouched: "onTouched",
179
+ all: "all"
180
+ }, we = {
181
+ max: "max",
182
+ min: "min",
183
+ maxLength: "maxLength",
184
+ minLength: "minLength",
185
+ pattern: "pattern",
186
+ required: "required",
187
+ validate: "validate"
188
+ }, hr = I.createContext(null), pt = () => I.useContext(hr), Ho = (e) => {
189
+ const { children: r, ...t } = e;
190
+ return I.createElement(hr.Provider, { value: t }, r);
191
+ };
192
+ var mr = (e, r, t, s = !0) => {
193
+ const n = {
194
+ defaultValues: r._defaultValues
195
+ };
196
+ for (const i in e)
197
+ Object.defineProperty(n, i, {
198
+ get: () => {
199
+ const l = i;
200
+ return r._proxyFormState[l] !== he.all && (r._proxyFormState[l] = !s || he.all), t && (t[l] = !0), e[l];
201
+ }
202
+ });
203
+ return n;
204
+ }, le = (e) => re(e) && !Object.keys(e).length, yr = (e, r, t, s) => {
205
+ t(e);
206
+ const { name: n, ...i } = e;
207
+ return le(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((l) => r[l] === (!s || he.all));
208
+ }, ce = (e) => Array.isArray(e) ? e : [e], gr = (e, r, t) => !e || !r || e === r || ce(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s)));
209
+ function ht(e) {
210
+ const r = I.useRef(e);
211
+ r.current = e, I.useEffect(() => {
212
+ const t = !e.disabled && r.current.subject && r.current.subject.subscribe({
213
+ next: r.current.next
214
+ });
215
+ return () => {
216
+ t && t.unsubscribe();
217
+ };
218
+ }, [e.disabled]);
219
+ }
220
+ function Bs(e) {
221
+ const r = pt(), { control: t = r.control, disabled: s, name: n, exact: i } = e || {}, [l, c] = I.useState(t._formState), d = I.useRef(!0), S = I.useRef({
222
+ isDirty: !1,
223
+ isLoading: !1,
224
+ dirtyFields: !1,
225
+ touchedFields: !1,
226
+ validatingFields: !1,
227
+ isValidating: !1,
228
+ isValid: !1,
229
+ errors: !1
230
+ }), m = I.useRef(n);
231
+ return m.current = n, ht({
232
+ disabled: s,
233
+ next: (y) => d.current && gr(m.current, y.name, i) && yr(y, S.current, t._updateFormState) && c({
234
+ ...t._formState,
235
+ ...y
236
+ }),
237
+ subject: t._subjects.state
238
+ }), I.useEffect(() => (d.current = !0, S.current.isValid && t._updateValid(!0), () => {
239
+ d.current = !1;
240
+ }), [t]), mr(l, t, S.current, !1);
241
+ }
242
+ var ve = (e) => typeof e == "string", vr = (e, r, t, s, n) => ve(e) ? (s && r.watch.add(e), p(t, e, n)) : Array.isArray(e) ? e.map((i) => (s && r.watch.add(i), p(t, i))) : (s && (r.watchAll = !0), t);
243
+ function Us(e) {
244
+ const r = pt(), { control: t = r.control, name: s, defaultValue: n, disabled: i, exact: l } = e || {}, c = I.useRef(s);
245
+ c.current = s, ht({
246
+ disabled: i,
247
+ subject: t._subjects.values,
248
+ next: (m) => {
249
+ gr(c.current, m.name, l) && S(te(vr(c.current, t._names, m.values || t._formValues, !1, n)));
250
+ }
251
+ });
252
+ const [d, S] = I.useState(t._getWatch(s, n));
253
+ return I.useEffect(() => t._removeUnmounted()), d;
254
+ }
255
+ function Hs(e) {
256
+ const r = pt(), { name: t, disabled: s, control: n = r.control, shouldUnregister: i } = e, l = fr(n._names.array, t), c = Us({
257
+ control: n,
258
+ name: t,
259
+ defaultValue: p(n._formValues, t, p(n._defaultValues, t, e.defaultValue)),
260
+ exact: !0
261
+ }), d = Bs({
262
+ control: n,
263
+ name: t
264
+ }), S = I.useRef(n.register(t, {
265
+ ...e.rules,
266
+ value: c,
267
+ ...ge(e.disabled) ? { disabled: e.disabled } : {}
268
+ }));
269
+ return I.useEffect(() => {
270
+ const m = n._options.shouldUnregister || i, y = (E, O) => {
271
+ const w = p(n._fields, E);
272
+ w && w._f && (w._f.mount = O);
273
+ };
274
+ if (y(t, !0), m) {
275
+ const E = te(p(n._options.defaultValues, t));
276
+ H(n._defaultValues, t, E), $(p(n._formValues, t)) && H(n._formValues, t, E);
277
+ }
278
+ return () => {
279
+ (l ? m && !n._state.action : m) ? n.unregister(t) : y(t, !1);
280
+ };
281
+ }, [t, n, l, i]), I.useEffect(() => {
282
+ p(n._fields, t) && n._updateDisabledField({
283
+ disabled: s,
284
+ fields: n._fields,
285
+ name: t,
286
+ value: p(n._fields, t)._f.value
287
+ });
288
+ }, [s, t, n]), {
289
+ field: {
290
+ name: t,
291
+ value: c,
292
+ ...ge(s) || d.disabled ? { disabled: d.disabled || s } : {},
293
+ onChange: I.useCallback((m) => S.current.onChange({
294
+ target: {
295
+ value: dr(m),
296
+ name: t
297
+ },
298
+ type: at.CHANGE
299
+ }), [t]),
300
+ onBlur: I.useCallback(() => S.current.onBlur({
301
+ target: {
302
+ value: p(n._formValues, t),
303
+ name: t
304
+ },
305
+ type: at.BLUR
306
+ }), [t, n]),
307
+ ref: (m) => {
308
+ const y = p(n._fields, t);
309
+ y && m && (y._f.ref = {
310
+ focus: () => m.focus(),
311
+ select: () => m.select(),
312
+ setCustomValidity: (E) => m.setCustomValidity(E),
313
+ reportValidity: () => m.reportValidity()
314
+ });
315
+ }
316
+ },
317
+ formState: d,
318
+ fieldState: Object.defineProperties({}, {
319
+ invalid: {
320
+ enumerable: !0,
321
+ get: () => !!p(d.errors, t)
322
+ },
323
+ isDirty: {
324
+ enumerable: !0,
325
+ get: () => !!p(d.dirtyFields, t)
326
+ },
327
+ isTouched: {
328
+ enumerable: !0,
329
+ get: () => !!p(d.touchedFields, t)
330
+ },
331
+ isValidating: {
332
+ enumerable: !0,
333
+ get: () => !!p(d.validatingFields, t)
334
+ },
335
+ error: {
336
+ enumerable: !0,
337
+ get: () => p(d.errors, t)
338
+ }
339
+ })
340
+ };
341
+ }
342
+ const Wo = (e) => e.render(Hs(e));
343
+ var Ws = (e, r, t, s, n) => r ? {
344
+ ...t[e],
345
+ types: {
346
+ ...t[e] && t[e].types ? t[e].types : {},
347
+ [s]: n || !0
348
+ }
349
+ } : {}, Fe = () => {
350
+ const e = typeof performance > "u" ? Date.now() : performance.now() * 1e3;
351
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
352
+ const t = (Math.random() * 16 + e) % 16 | 0;
353
+ return (r == "x" ? t : t & 3 | 8).toString(16);
354
+ });
355
+ }, _t = (e, r, t = {}) => t.shouldFocus || $(t.shouldFocus) ? t.focusName || `${e}.${$(t.focusIndex) ? r : t.focusIndex}.` : "", Ze = (e) => ({
356
+ isOnSubmit: !e || e === he.onSubmit,
357
+ isOnBlur: e === he.onBlur,
358
+ isOnChange: e === he.onChange,
359
+ isOnAll: e === he.all,
360
+ isOnTouch: e === he.onTouched
361
+ }), Dt = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
362
+ const qe = (e, r, t, s) => {
363
+ for (const n of t || Object.keys(e)) {
364
+ const i = p(e, n);
365
+ if (i) {
366
+ const { _f: l, ...c } = i;
367
+ if (l) {
368
+ if (l.refs && l.refs[0] && r(l.refs[0], n) && !s)
369
+ break;
370
+ if (l.ref && r(l.ref, l.name) && !s)
371
+ break;
372
+ qe(c, r);
373
+ } else re(c) && qe(c, r);
374
+ }
375
+ }
376
+ };
377
+ var xr = (e, r, t) => {
378
+ const s = ce(p(e, t));
379
+ return H(s, "root", r[t]), H(e, t, s), e;
380
+ }, Wt = (e) => e.type === "file", Ie = (e) => typeof e == "function", lt = (e) => {
381
+ if (!Ut)
382
+ return !1;
383
+ const r = e ? e.ownerDocument : 0;
384
+ return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
385
+ }, it = (e) => ve(e), Kt = (e) => e.type === "radio", ct = (e) => e instanceof RegExp;
386
+ const Zt = {
387
+ value: !1,
388
+ isValid: !1
389
+ }, Qt = { value: !0, isValid: !0 };
390
+ var Sr = (e) => {
391
+ if (Array.isArray(e)) {
392
+ if (e.length > 1) {
393
+ const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
394
+ return { value: r, isValid: !!r.length };
395
+ }
396
+ return e[0].checked && !e[0].disabled ? (
397
+ // @ts-expect-error expected to work in the browser
398
+ e[0].attributes && !$(e[0].attributes.value) ? $(e[0].value) || e[0].value === "" ? Qt : { value: e[0].value, isValid: !0 } : Qt
399
+ ) : Zt;
400
+ }
401
+ return Zt;
402
+ };
403
+ const Jt = {
404
+ isValid: !1,
405
+ value: null
406
+ };
407
+ var _r = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
408
+ isValid: !0,
409
+ value: t.value
410
+ } : r, Jt) : Jt;
411
+ function er(e, r, t = "validate") {
412
+ if (it(e) || Array.isArray(e) && e.every(it) || ge(e) && !e)
413
+ return {
414
+ type: t,
415
+ message: it(e) ? e : "",
416
+ ref: r
417
+ };
418
+ }
419
+ var Ke = (e) => re(e) && !ct(e) ? e : {
420
+ value: e,
421
+ message: ""
422
+ }, Pt = async (e, r, t, s, n) => {
423
+ const { ref: i, refs: l, required: c, maxLength: d, minLength: S, min: m, max: y, pattern: E, validate: O, name: w, valueAsNumber: P, mount: M, disabled: R } = e._f, g = p(r, w);
424
+ if (!M || R)
425
+ return {};
426
+ const D = l ? l[0] : i, Z = (F) => {
427
+ s && D.reportValidity && (D.setCustomValidity(ge(F) ? "" : F || ""), D.reportValidity());
428
+ }, v = {}, C = Kt(i), V = Qe(i), k = C || V, Q = (P || Wt(i)) && $(i.value) && $(g) || lt(i) && i.value === "" || g === "" || Array.isArray(g) && !g.length, z = Ws.bind(null, w, t, v), fe = (F, N, B, j = we.maxLength, Y = we.minLength) => {
429
+ const X = F ? N : B;
430
+ v[w] = {
431
+ type: F ? j : Y,
432
+ message: X,
433
+ ref: i,
434
+ ...z(F ? j : Y, X)
435
+ };
436
+ };
437
+ if (n ? !Array.isArray(g) || !g.length : c && (!k && (Q || oe(g)) || ge(g) && !g || V && !Sr(l).isValid || C && !_r(l).isValid)) {
438
+ const { value: F, message: N } = it(c) ? { value: !!c, message: c } : Ke(c);
439
+ if (F && (v[w] = {
440
+ type: we.required,
441
+ message: N,
442
+ ref: D,
443
+ ...z(we.required, N)
444
+ }, !t))
445
+ return Z(N), v;
446
+ }
447
+ if (!Q && (!oe(m) || !oe(y))) {
448
+ let F, N;
449
+ const B = Ke(y), j = Ke(m);
450
+ if (!oe(g) && !isNaN(g)) {
451
+ const Y = i.valueAsNumber || g && +g;
452
+ oe(B.value) || (F = Y > B.value), oe(j.value) || (N = Y < j.value);
453
+ } else {
454
+ const Y = i.valueAsDate || new Date(g), X = (Se) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Se), pe = i.type == "time", ie = i.type == "week";
455
+ ve(B.value) && g && (F = pe ? X(g) > X(B.value) : ie ? g > B.value : Y > new Date(B.value)), ve(j.value) && g && (N = pe ? X(g) < X(j.value) : ie ? g < j.value : Y < new Date(j.value));
456
+ }
457
+ if ((F || N) && (fe(!!F, B.message, j.message, we.max, we.min), !t))
458
+ return Z(v[w].message), v;
459
+ }
460
+ if ((d || S) && !Q && (ve(g) || n && Array.isArray(g))) {
461
+ const F = Ke(d), N = Ke(S), B = !oe(F.value) && g.length > +F.value, j = !oe(N.value) && g.length < +N.value;
462
+ if ((B || j) && (fe(B, F.message, N.message), !t))
463
+ return Z(v[w].message), v;
464
+ }
465
+ if (E && !Q && ve(g)) {
466
+ const { value: F, message: N } = Ke(E);
467
+ if (ct(F) && !g.match(F) && (v[w] = {
468
+ type: we.pattern,
469
+ message: N,
470
+ ref: i,
471
+ ...z(we.pattern, N)
472
+ }, !t))
473
+ return Z(N), v;
474
+ }
475
+ if (O) {
476
+ if (Ie(O)) {
477
+ const F = await O(g, r), N = er(F, D);
478
+ if (N && (v[w] = {
479
+ ...N,
480
+ ...z(we.validate, N.message)
481
+ }, !t))
482
+ return Z(N.message), v;
483
+ } else if (re(O)) {
484
+ let F = {};
485
+ for (const N in O) {
486
+ if (!le(F) && !t)
487
+ break;
488
+ const B = er(await O[N](g, r), D, N);
489
+ B && (F = {
490
+ ...B,
491
+ ...z(N, B.message)
492
+ }, Z(B.message), t && (v[w] = F));
493
+ }
494
+ if (!le(F) && (v[w] = {
495
+ ref: D,
496
+ ...F
497
+ }, !t))
498
+ return v;
499
+ }
500
+ }
501
+ return Z(!0), v;
502
+ }, bt = (e, r) => [
503
+ ...e,
504
+ ...ce(r)
505
+ ], wt = (e) => Array.isArray(e) ? e.map(() => {
506
+ }) : void 0;
507
+ function Ct(e, r, t) {
508
+ return [
509
+ ...e.slice(0, r),
510
+ ...ce(t),
511
+ ...e.slice(r)
512
+ ];
513
+ }
514
+ var At = (e, r, t) => Array.isArray(e) ? ($(e[t]) && (e[t] = void 0), e.splice(t, 0, e.splice(r, 1)[0]), e) : [], Vt = (e, r) => [
515
+ ...ce(r),
516
+ ...ce(e)
517
+ ];
518
+ function Ks(e, r) {
519
+ let t = 0;
520
+ const s = [...e];
521
+ for (const n of r)
522
+ s.splice(n - t, 1), t++;
523
+ return Je(s).length ? s : [];
524
+ }
525
+ var Et = (e, r) => $(r) ? [] : Ks(e, ce(r).sort((t, s) => t - s)), Ft = (e, r, t) => {
526
+ [e[r], e[t]] = [e[t], e[r]];
527
+ };
528
+ function $s(e, r) {
529
+ const t = r.slice(0, -1).length;
530
+ let s = 0;
531
+ for (; s < t; )
532
+ e = $(e) ? s++ : e[r[s++]];
533
+ return e;
534
+ }
535
+ function qs(e) {
536
+ for (const r in e)
537
+ if (e.hasOwnProperty(r) && !$(e[r]))
538
+ return !1;
539
+ return !0;
540
+ }
541
+ function ee(e, r) {
542
+ const t = Array.isArray(r) ? r : Ht(r) ? [r] : pr(r), s = t.length === 1 ? e : $s(e, t), n = t.length - 1, i = t[n];
543
+ return s && delete s[i], n !== 0 && (re(s) && le(s) || Array.isArray(s) && qs(s)) && ee(e, t.slice(0, -1)), e;
544
+ }
545
+ var tr = (e, r, t) => (e[r] = t, e);
546
+ function Ko(e) {
547
+ const r = pt(), { control: t = r.control, name: s, keyName: n = "id", shouldUnregister: i } = e, [l, c] = I.useState(t._getFieldArray(s)), d = I.useRef(t._getFieldArray(s).map(Fe)), S = I.useRef(l), m = I.useRef(s), y = I.useRef(!1);
548
+ m.current = s, S.current = l, t._names.array.add(s), e.rules && t.register(s, e.rules), ht({
549
+ next: ({ values: v, name: C }) => {
550
+ if (C === m.current || !C) {
551
+ const V = p(v, m.current);
552
+ Array.isArray(V) && (c(V), d.current = V.map(Fe));
553
+ }
554
+ },
555
+ subject: t._subjects.array
556
+ });
557
+ const E = I.useCallback((v) => {
558
+ y.current = !0, t._updateFieldArray(s, v);
559
+ }, [t, s]), O = (v, C) => {
560
+ const V = ce(te(v)), k = bt(t._getFieldArray(s), V);
561
+ t._names.focus = _t(s, k.length - 1, C), d.current = bt(d.current, V.map(Fe)), E(k), c(k), t._updateFieldArray(s, k, bt, {
562
+ argA: wt(v)
563
+ });
564
+ }, w = (v, C) => {
565
+ const V = ce(te(v)), k = Vt(t._getFieldArray(s), V);
566
+ t._names.focus = _t(s, 0, C), d.current = Vt(d.current, V.map(Fe)), E(k), c(k), t._updateFieldArray(s, k, Vt, {
567
+ argA: wt(v)
568
+ });
569
+ }, P = (v) => {
570
+ const C = Et(t._getFieldArray(s), v);
571
+ d.current = Et(d.current, v), E(C), c(C), t._updateFieldArray(s, C, Et, {
572
+ argA: v
573
+ });
574
+ }, M = (v, C, V) => {
575
+ const k = ce(te(C)), Q = Ct(t._getFieldArray(s), v, k);
576
+ t._names.focus = _t(s, v, V), d.current = Ct(d.current, v, k.map(Fe)), E(Q), c(Q), t._updateFieldArray(s, Q, Ct, {
577
+ argA: v,
578
+ argB: wt(C)
579
+ });
580
+ }, R = (v, C) => {
581
+ const V = t._getFieldArray(s);
582
+ Ft(V, v, C), Ft(d.current, v, C), E(V), c(V), t._updateFieldArray(s, V, Ft, {
583
+ argA: v,
584
+ argB: C
585
+ }, !1);
586
+ }, g = (v, C) => {
587
+ const V = t._getFieldArray(s);
588
+ At(V, v, C), At(d.current, v, C), E(V), c(V), t._updateFieldArray(s, V, At, {
589
+ argA: v,
590
+ argB: C
591
+ }, !1);
592
+ }, D = (v, C) => {
593
+ const V = te(C), k = tr(t._getFieldArray(s), v, V);
594
+ d.current = [...k].map((Q, z) => !Q || z === v ? Fe() : d.current[z]), E(k), c([...k]), t._updateFieldArray(s, k, tr, {
595
+ argA: v,
596
+ argB: V
597
+ }, !0, !1);
598
+ }, Z = (v) => {
599
+ const C = ce(te(v));
600
+ d.current = C.map(Fe), E([...C]), c([...C]), t._updateFieldArray(s, [...C], (V) => V, {}, !0, !1);
601
+ };
602
+ return I.useEffect(() => {
603
+ if (t._state.action = !1, Dt(s, t._names) && t._subjects.state.next({
604
+ ...t._formState
605
+ }), y.current && (!Ze(t._options.mode).isOnSubmit || t._formState.isSubmitted))
606
+ if (t._options.resolver)
607
+ t._executeSchema([s]).then((v) => {
608
+ const C = p(v.errors, s), V = p(t._formState.errors, s);
609
+ (V ? !C && V.type || C && (V.type !== C.type || V.message !== C.message) : C && C.type) && (C ? H(t._formState.errors, s, C) : ee(t._formState.errors, s), t._subjects.state.next({
610
+ errors: t._formState.errors
611
+ }));
612
+ });
613
+ else {
614
+ const v = p(t._fields, s);
615
+ v && v._f && !(Ze(t._options.reValidateMode).isOnSubmit && Ze(t._options.mode).isOnSubmit) && Pt(v, t._formValues, t._options.criteriaMode === he.all, t._options.shouldUseNativeValidation, !0).then((C) => !le(C) && t._subjects.state.next({
616
+ errors: xr(t._formState.errors, C, s)
617
+ }));
618
+ }
619
+ t._subjects.values.next({
620
+ name: s,
621
+ values: { ...t._formValues }
622
+ }), t._names.focus && qe(t._fields, (v, C) => {
623
+ if (t._names.focus && C.startsWith(t._names.focus) && v.focus)
624
+ return v.focus(), 1;
625
+ }), t._names.focus = "", t._updateValid(), y.current = !1;
626
+ }, [l, s, t]), I.useEffect(() => (!p(t._formValues, s) && t._updateFieldArray(s), () => {
627
+ (t._options.shouldUnregister || i) && t.unregister(s);
628
+ }), [s, t, n, i]), {
629
+ swap: I.useCallback(R, [E, s, t]),
630
+ move: I.useCallback(g, [E, s, t]),
631
+ prepend: I.useCallback(w, [E, s, t]),
632
+ append: I.useCallback(O, [E, s, t]),
633
+ remove: I.useCallback(P, [E, s, t]),
634
+ insert: I.useCallback(M, [E, s, t]),
635
+ update: I.useCallback(D, [E, s, t]),
636
+ replace: I.useCallback(Z, [E, s, t]),
637
+ fields: I.useMemo(() => l.map((v, C) => ({
638
+ ...v,
639
+ [n]: d.current[C] || Fe()
640
+ })), [l, n])
641
+ };
642
+ }
643
+ var Rt = () => {
644
+ let e = [];
645
+ return {
646
+ get observers() {
647
+ return e;
648
+ },
649
+ next: (n) => {
650
+ for (const i of e)
651
+ i.next && i.next(n);
652
+ },
653
+ subscribe: (n) => (e.push(n), {
654
+ unsubscribe: () => {
655
+ e = e.filter((i) => i !== n);
656
+ }
657
+ }),
658
+ unsubscribe: () => {
659
+ e = [];
660
+ }
661
+ };
662
+ }, ut = (e) => oe(e) || !ur(e);
663
+ function Me(e, r) {
664
+ if (ut(e) || ut(r))
665
+ return e === r;
666
+ if ($e(e) && $e(r))
667
+ return e.getTime() === r.getTime();
668
+ const t = Object.keys(e), s = Object.keys(r);
669
+ if (t.length !== s.length)
670
+ return !1;
671
+ for (const n of t) {
672
+ const i = e[n];
673
+ if (!s.includes(n))
674
+ return !1;
675
+ if (n !== "ref") {
676
+ const l = r[n];
677
+ if ($e(i) && $e(l) || re(i) && re(l) || Array.isArray(i) && Array.isArray(l) ? !Me(i, l) : i !== l)
678
+ return !1;
679
+ }
680
+ }
681
+ return !0;
682
+ }
683
+ var br = (e) => e.type === "select-multiple", Gs = (e) => Kt(e) || Qe(e), Tt = (e) => lt(e) && e.isConnected, wr = (e) => {
684
+ for (const r in e)
685
+ if (Ie(e[r]))
686
+ return !0;
687
+ return !1;
688
+ };
689
+ function dt(e, r = {}) {
690
+ const t = Array.isArray(e);
691
+ if (re(e) || t)
692
+ for (const s in e)
693
+ Array.isArray(e[s]) || re(e[s]) && !wr(e[s]) ? (r[s] = Array.isArray(e[s]) ? [] : {}, dt(e[s], r[s])) : oe(e[s]) || (r[s] = !0);
694
+ return r;
695
+ }
696
+ function Cr(e, r, t) {
697
+ const s = Array.isArray(e);
698
+ if (re(e) || s)
699
+ for (const n in e)
700
+ Array.isArray(e[n]) || re(e[n]) && !wr(e[n]) ? $(r) || ut(t[n]) ? t[n] = Array.isArray(e[n]) ? dt(e[n], []) : { ...dt(e[n]) } : Cr(e[n], oe(r) ? {} : r[n], t[n]) : t[n] = !Me(e[n], r[n]);
701
+ return t;
702
+ }
703
+ var ot = (e, r) => Cr(e, r, dt(r)), Ar = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => $(e) ? e : r ? e === "" ? NaN : e && +e : t && ve(e) ? new Date(e) : s ? s(e) : e;
704
+ function It(e) {
705
+ const r = e.ref;
706
+ if (!(e.refs ? e.refs.every((t) => t.disabled) : r.disabled))
707
+ return Wt(r) ? r.files : Kt(r) ? _r(e.refs).value : br(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Qe(r) ? Sr(e.refs).value : Ar($(r.value) ? e.ref.value : r.value, e);
708
+ }
709
+ var zs = (e, r, t, s) => {
710
+ const n = {};
711
+ for (const i of e) {
712
+ const l = p(r, i);
713
+ l && H(n, i, l._f);
714
+ }
715
+ return {
716
+ criteriaMode: t,
717
+ names: [...e],
718
+ fields: n,
719
+ shouldUseNativeValidation: s
720
+ };
721
+ }, Ye = (e) => $(e) ? e : ct(e) ? e.source : re(e) ? ct(e.value) ? e.value.source : e.value : e, Ys = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
722
+ function rr(e, r, t) {
723
+ const s = p(e, t);
724
+ if (s || Ht(t))
725
+ return {
726
+ error: s,
727
+ name: t
728
+ };
729
+ const n = t.split(".");
730
+ for (; n.length; ) {
731
+ const i = n.join("."), l = p(r, i), c = p(e, i);
732
+ if (l && !Array.isArray(l) && t !== i)
733
+ return { name: t };
734
+ if (c && c.type)
735
+ return {
736
+ name: i,
737
+ error: c
738
+ };
739
+ n.pop();
740
+ }
741
+ return {
742
+ name: t
743
+ };
744
+ }
745
+ var Xs = (e, r, t, s, n) => n.isOnAll ? !1 : !t && n.isOnTouch ? !(r || e) : (t ? s.isOnBlur : n.isOnBlur) ? !e : (t ? s.isOnChange : n.isOnChange) ? e : !0, Zs = (e, r) => !Je(p(e, r)).length && ee(e, r);
746
+ const Qs = {
747
+ mode: he.onSubmit,
748
+ reValidateMode: he.onChange,
749
+ shouldFocusError: !0
750
+ };
751
+ function Js(e = {}) {
752
+ let r = {
753
+ ...Qs,
754
+ ...e
755
+ }, t = {
756
+ submitCount: 0,
757
+ isDirty: !1,
758
+ isLoading: Ie(r.defaultValues),
759
+ isValidating: !1,
760
+ isSubmitted: !1,
761
+ isSubmitting: !1,
762
+ isSubmitSuccessful: !1,
763
+ isValid: !1,
764
+ touchedFields: {},
765
+ dirtyFields: {},
766
+ validatingFields: {},
767
+ errors: r.errors || {},
768
+ disabled: r.disabled || !1
769
+ }, s = {}, n = re(r.defaultValues) || re(r.values) ? te(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : te(n), l = {
770
+ action: !1,
771
+ mount: !1,
772
+ watch: !1
773
+ }, c = {
774
+ mount: /* @__PURE__ */ new Set(),
775
+ unMount: /* @__PURE__ */ new Set(),
776
+ array: /* @__PURE__ */ new Set(),
777
+ watch: /* @__PURE__ */ new Set()
778
+ }, d, S = 0;
779
+ const m = {
780
+ isDirty: !1,
781
+ dirtyFields: !1,
782
+ validatingFields: !1,
783
+ touchedFields: !1,
784
+ isValidating: !1,
785
+ isValid: !1,
786
+ errors: !1
787
+ }, y = {
788
+ values: Rt(),
789
+ array: Rt(),
790
+ state: Rt()
791
+ }, E = Ze(r.mode), O = Ze(r.reValidateMode), w = r.criteriaMode === he.all, P = (o) => (a) => {
792
+ clearTimeout(S), S = setTimeout(o, a);
793
+ }, M = async (o) => {
794
+ if (m.isValid || o) {
795
+ const a = r.resolver ? le((await k()).errors) : await z(s, !0);
796
+ a !== t.isValid && y.state.next({
797
+ isValid: a
798
+ });
799
+ }
800
+ }, R = (o, a) => {
801
+ (m.isValidating || m.validatingFields) && ((o || Array.from(c.mount)).forEach((u) => {
802
+ u && (a ? H(t.validatingFields, u, a) : ee(t.validatingFields, u));
803
+ }), y.state.next({
804
+ validatingFields: t.validatingFields,
805
+ isValidating: !le(t.validatingFields)
806
+ }));
807
+ }, g = (o, a = [], u, b, x = !0, f = !0) => {
808
+ if (b && u) {
809
+ if (l.action = !0, f && Array.isArray(p(s, o))) {
810
+ const A = u(p(s, o), b.argA, b.argB);
811
+ x && H(s, o, A);
812
+ }
813
+ if (f && Array.isArray(p(t.errors, o))) {
814
+ const A = u(p(t.errors, o), b.argA, b.argB);
815
+ x && H(t.errors, o, A), Zs(t.errors, o);
816
+ }
817
+ if (m.touchedFields && f && Array.isArray(p(t.touchedFields, o))) {
818
+ const A = u(p(t.touchedFields, o), b.argA, b.argB);
819
+ x && H(t.touchedFields, o, A);
820
+ }
821
+ m.dirtyFields && (t.dirtyFields = ot(n, i)), y.state.next({
822
+ name: o,
823
+ isDirty: F(o, a),
824
+ dirtyFields: t.dirtyFields,
825
+ errors: t.errors,
826
+ isValid: t.isValid
827
+ });
828
+ } else
829
+ H(i, o, a);
830
+ }, D = (o, a) => {
831
+ H(t.errors, o, a), y.state.next({
832
+ errors: t.errors
833
+ });
834
+ }, Z = (o) => {
835
+ t.errors = o, y.state.next({
836
+ errors: t.errors,
837
+ isValid: !1
838
+ });
839
+ }, v = (o, a, u, b) => {
840
+ const x = p(s, o);
841
+ if (x) {
842
+ const f = p(i, o, $(u) ? p(n, o) : u);
843
+ $(f) || b && b.defaultChecked || a ? H(i, o, a ? f : It(x._f)) : j(o, f), l.mount && M();
844
+ }
845
+ }, C = (o, a, u, b, x) => {
846
+ let f = !1, A = !1;
847
+ const L = {
848
+ name: o
849
+ }, J = !!(p(s, o) && p(s, o)._f && p(s, o)._f.disabled);
850
+ if (!u || b) {
851
+ m.isDirty && (A = t.isDirty, t.isDirty = L.isDirty = F(), f = A !== L.isDirty);
852
+ const ue = J || Me(p(n, o), a);
853
+ A = !!(!J && p(t.dirtyFields, o)), ue || J ? ee(t.dirtyFields, o) : H(t.dirtyFields, o, !0), L.dirtyFields = t.dirtyFields, f = f || m.dirtyFields && A !== !ue;
854
+ }
855
+ if (u) {
856
+ const ue = p(t.touchedFields, o);
857
+ ue || (H(t.touchedFields, o, u), L.touchedFields = t.touchedFields, f = f || m.touchedFields && ue !== u);
858
+ }
859
+ return f && x && y.state.next(L), f ? L : {};
860
+ }, V = (o, a, u, b) => {
861
+ const x = p(t.errors, o), f = m.isValid && ge(a) && t.isValid !== a;
862
+ if (e.delayError && u ? (d = P(() => D(o, u)), d(e.delayError)) : (clearTimeout(S), d = null, u ? H(t.errors, o, u) : ee(t.errors, o)), (u ? !Me(x, u) : x) || !le(b) || f) {
863
+ const A = {
864
+ ...b,
865
+ ...f && ge(a) ? { isValid: a } : {},
866
+ errors: t.errors,
867
+ name: o
868
+ };
869
+ t = {
870
+ ...t,
871
+ ...A
872
+ }, y.state.next(A);
873
+ }
874
+ }, k = async (o) => {
875
+ R(o, !0);
876
+ const a = await r.resolver(i, r.context, zs(o || c.mount, s, r.criteriaMode, r.shouldUseNativeValidation));
877
+ return R(o), a;
878
+ }, Q = async (o) => {
879
+ const { errors: a } = await k(o);
880
+ if (o)
881
+ for (const u of o) {
882
+ const b = p(a, u);
883
+ b ? H(t.errors, u, b) : ee(t.errors, u);
884
+ }
885
+ else
886
+ t.errors = a;
887
+ return a;
888
+ }, z = async (o, a, u = {
889
+ valid: !0
890
+ }) => {
891
+ for (const b in o) {
892
+ const x = o[b];
893
+ if (x) {
894
+ const { _f: f, ...A } = x;
895
+ if (f) {
896
+ const L = c.array.has(f.name);
897
+ R([b], !0);
898
+ const J = await Pt(x, i, w, r.shouldUseNativeValidation && !a, L);
899
+ if (R([b]), J[f.name] && (u.valid = !1, a))
900
+ break;
901
+ !a && (p(J, f.name) ? L ? xr(t.errors, J, f.name) : H(t.errors, f.name, J[f.name]) : ee(t.errors, f.name));
902
+ }
903
+ A && await z(A, a, u);
904
+ }
905
+ }
906
+ return u.valid;
907
+ }, fe = () => {
908
+ for (const o of c.unMount) {
909
+ const a = p(s, o);
910
+ a && (a._f.refs ? a._f.refs.every((u) => !Tt(u)) : !Tt(a._f.ref)) && be(o);
911
+ }
912
+ c.unMount = /* @__PURE__ */ new Set();
913
+ }, F = (o, a) => (o && a && H(i, o, a), !Me(ke(), n)), N = (o, a, u) => vr(o, c, {
914
+ ...l.mount ? i : $(a) ? n : ve(o) ? { [o]: a } : a
915
+ }, u, a), B = (o) => Je(p(l.mount ? i : n, o, e.shouldUnregister ? p(n, o, []) : [])), j = (o, a, u = {}) => {
916
+ const b = p(s, o);
917
+ let x = a;
918
+ if (b) {
919
+ const f = b._f;
920
+ f && (!f.disabled && H(i, o, Ar(a, f)), x = lt(f.ref) && oe(a) ? "" : a, br(f.ref) ? [...f.ref.options].forEach((A) => A.selected = x.includes(A.value)) : f.refs ? Qe(f.ref) ? f.refs.length > 1 ? f.refs.forEach((A) => (!A.defaultChecked || !A.disabled) && (A.checked = Array.isArray(x) ? !!x.find((L) => L === A.value) : x === A.value)) : f.refs[0] && (f.refs[0].checked = !!x) : f.refs.forEach((A) => A.checked = A.value === x) : Wt(f.ref) ? f.ref.value = "" : (f.ref.value = x, f.ref.type || y.values.next({
921
+ name: o,
922
+ values: { ...i }
923
+ })));
924
+ }
925
+ (u.shouldDirty || u.shouldTouch) && C(o, x, u.shouldTouch, u.shouldDirty, !0), u.shouldValidate && Se(o);
926
+ }, Y = (o, a, u) => {
927
+ for (const b in a) {
928
+ const x = a[b], f = `${o}.${b}`, A = p(s, f);
929
+ (c.array.has(o) || !ut(x) || A && !A._f) && !$e(x) ? Y(f, x, u) : j(f, x, u);
930
+ }
931
+ }, X = (o, a, u = {}) => {
932
+ const b = p(s, o), x = c.array.has(o), f = te(a);
933
+ H(i, o, f), x ? (y.array.next({
934
+ name: o,
935
+ values: { ...i }
936
+ }), (m.isDirty || m.dirtyFields) && u.shouldDirty && y.state.next({
937
+ name: o,
938
+ dirtyFields: ot(n, i),
939
+ isDirty: F(o, f)
940
+ })) : b && !b._f && !oe(f) ? Y(o, f, u) : j(o, f, u), Dt(o, c) && y.state.next({ ...t }), y.values.next({
941
+ name: l.mount ? o : void 0,
942
+ values: { ...i }
943
+ });
944
+ }, pe = async (o) => {
945
+ l.mount = !0;
946
+ const a = o.target;
947
+ let u = a.name, b = !0;
948
+ const x = p(s, u), f = () => a.type ? It(x._f) : dr(o), A = (L) => {
949
+ b = Number.isNaN(L) || L === p(i, u, L);
950
+ };
951
+ if (x) {
952
+ let L, J;
953
+ const ue = f(), Be = o.type === at.BLUR || o.type === at.FOCUS_OUT, ds = !Ys(x._f) && !r.resolver && !p(t.errors, u) && !x._f.deps || Xs(Be, p(t.touchedFields, u), t.isSubmitted, O, E), vt = Dt(u, c, Be);
954
+ H(i, u, ue), Be ? (x._f.onBlur && x._f.onBlur(o), d && d(0)) : x._f.onChange && x._f.onChange(o);
955
+ const xt = C(u, ue, Be, !1), fs = !le(xt) || vt;
956
+ if (!Be && y.values.next({
957
+ name: u,
958
+ type: o.type,
959
+ values: { ...i }
960
+ }), ds)
961
+ return m.isValid && M(), fs && y.state.next({ name: u, ...vt ? {} : xt });
962
+ if (!Be && vt && y.state.next({ ...t }), r.resolver) {
963
+ const { errors: qt } = await k([u]);
964
+ if (A(ue), b) {
965
+ const ps = rr(t.errors, s, u), Gt = rr(qt, s, ps.name || u);
966
+ L = Gt.error, u = Gt.name, J = le(qt);
967
+ }
968
+ } else
969
+ R([u], !0), L = (await Pt(x, i, w, r.shouldUseNativeValidation))[u], R([u]), A(ue), b && (L ? J = !1 : m.isValid && (J = await z(s, !0)));
970
+ b && (x._f.deps && Se(x._f.deps), V(u, J, L, xt));
971
+ }
972
+ }, ie = (o, a) => {
973
+ if (p(t.errors, a) && o.focus)
974
+ return o.focus(), 1;
975
+ }, Se = async (o, a = {}) => {
976
+ let u, b;
977
+ const x = ce(o);
978
+ if (r.resolver) {
979
+ const f = await Q($(o) ? o : x);
980
+ u = le(f), b = o ? !x.some((A) => p(f, A)) : u;
981
+ } else o ? (b = (await Promise.all(x.map(async (f) => {
982
+ const A = p(s, f);
983
+ return await z(A && A._f ? { [f]: A } : A);
984
+ }))).every(Boolean), !(!b && !t.isValid) && M()) : b = u = await z(s);
985
+ return y.state.next({
986
+ ...!ve(o) || m.isValid && u !== t.isValid ? {} : { name: o },
987
+ ...r.resolver || !o ? { isValid: u } : {},
988
+ errors: t.errors
989
+ }), a.shouldFocus && !b && qe(s, ie, o ? x : c.mount), b;
990
+ }, ke = (o) => {
991
+ const a = {
992
+ ...l.mount ? i : n
993
+ };
994
+ return $(o) ? a : ve(o) ? p(a, o) : o.map((u) => p(a, u));
995
+ }, je = (o, a) => ({
996
+ invalid: !!p((a || t).errors, o),
997
+ isDirty: !!p((a || t).dirtyFields, o),
998
+ error: p((a || t).errors, o),
999
+ isValidating: !!p(t.validatingFields, o),
1000
+ isTouched: !!p((a || t).touchedFields, o)
1001
+ }), ze = (o) => {
1002
+ o && ce(o).forEach((a) => ee(t.errors, a)), y.state.next({
1003
+ errors: o ? t.errors : {}
1004
+ });
1005
+ }, _e = (o, a, u) => {
1006
+ const b = (p(s, o, { _f: {} })._f || {}).ref, x = p(t.errors, o) || {}, { ref: f, message: A, type: L, ...J } = x;
1007
+ H(t.errors, o, {
1008
+ ...J,
1009
+ ...a,
1010
+ ref: b
1011
+ }), y.state.next({
1012
+ name: o,
1013
+ errors: t.errors,
1014
+ isValid: !1
1015
+ }), u && u.shouldFocus && b && b.focus && b.focus();
1016
+ }, Le = (o, a) => Ie(o) ? y.values.subscribe({
1017
+ next: (u) => o(N(void 0, a), u)
1018
+ }) : N(o, a, !0), be = (o, a = {}) => {
1019
+ for (const u of o ? ce(o) : c.mount)
1020
+ c.mount.delete(u), c.array.delete(u), a.keepValue || (ee(s, u), ee(i, u)), !a.keepError && ee(t.errors, u), !a.keepDirty && ee(t.dirtyFields, u), !a.keepTouched && ee(t.touchedFields, u), !a.keepIsValidating && ee(t.validatingFields, u), !r.shouldUnregister && !a.keepDefaultValue && ee(n, u);
1021
+ y.values.next({
1022
+ values: { ...i }
1023
+ }), y.state.next({
1024
+ ...t,
1025
+ ...a.keepDirty ? { isDirty: F() } : {}
1026
+ }), !a.keepIsValid && M();
1027
+ }, T = ({ disabled: o, name: a, field: u, fields: b, value: x }) => {
1028
+ if (ge(o) && l.mount || o) {
1029
+ const f = o ? void 0 : $(x) ? It(u ? u._f : p(b, a)._f) : x;
1030
+ H(i, a, f), C(a, f, !1, !1, !0);
1031
+ }
1032
+ }, K = (o, a = {}) => {
1033
+ let u = p(s, o);
1034
+ const b = ge(a.disabled);
1035
+ return H(s, o, {
1036
+ ...u || {},
1037
+ _f: {
1038
+ ...u && u._f ? u._f : { ref: { name: o } },
1039
+ name: o,
1040
+ mount: !0,
1041
+ ...a
1042
+ }
1043
+ }), c.mount.add(o), u ? T({
1044
+ field: u,
1045
+ disabled: a.disabled,
1046
+ name: o,
1047
+ value: a.value
1048
+ }) : v(o, !0, a.value), {
1049
+ ...b ? { disabled: a.disabled } : {},
1050
+ ...r.progressive ? {
1051
+ required: !!a.required,
1052
+ min: Ye(a.min),
1053
+ max: Ye(a.max),
1054
+ minLength: Ye(a.minLength),
1055
+ maxLength: Ye(a.maxLength),
1056
+ pattern: Ye(a.pattern)
1057
+ } : {},
1058
+ name: o,
1059
+ onChange: pe,
1060
+ onBlur: pe,
1061
+ ref: (x) => {
1062
+ if (x) {
1063
+ K(o, a), u = p(s, o);
1064
+ const f = $(x.value) && x.querySelectorAll && x.querySelectorAll("input,select,textarea")[0] || x, A = Gs(f), L = u._f.refs || [];
1065
+ if (A ? L.find((J) => J === f) : f === u._f.ref)
1066
+ return;
1067
+ H(s, o, {
1068
+ _f: {
1069
+ ...u._f,
1070
+ ...A ? {
1071
+ refs: [
1072
+ ...L.filter(Tt),
1073
+ f,
1074
+ ...Array.isArray(p(n, o)) ? [{}] : []
1075
+ ],
1076
+ ref: { type: f.type, name: o }
1077
+ } : { ref: f }
1078
+ }
1079
+ }), v(o, !1, void 0, f);
1080
+ } else
1081
+ u = p(s, o, {}), u._f && (u._f.mount = !1), (r.shouldUnregister || a.shouldUnregister) && !(fr(c.array, o) && l.action) && c.unMount.add(o);
1082
+ }
1083
+ };
1084
+ }, se = () => r.shouldFocusError && qe(s, ie, c.mount), q = (o) => {
1085
+ ge(o) && (y.state.next({ disabled: o }), qe(s, (a, u) => {
1086
+ const b = p(s, u);
1087
+ b && (a.disabled = b._f.disabled || o, Array.isArray(b._f.refs) && b._f.refs.forEach((x) => {
1088
+ x.disabled = b._f.disabled || o;
1089
+ }));
1090
+ }, 0, !1));
1091
+ }, U = (o, a) => async (u) => {
1092
+ let b;
1093
+ u && (u.preventDefault && u.preventDefault(), u.persist && u.persist());
1094
+ let x = te(i);
1095
+ if (y.state.next({
1096
+ isSubmitting: !0
1097
+ }), r.resolver) {
1098
+ const { errors: f, values: A } = await k();
1099
+ t.errors = f, x = A;
1100
+ } else
1101
+ await z(s);
1102
+ if (ee(t.errors, "root"), le(t.errors)) {
1103
+ y.state.next({
1104
+ errors: {}
1105
+ });
1106
+ try {
1107
+ await o(x, u);
1108
+ } catch (f) {
1109
+ b = f;
1110
+ }
1111
+ } else
1112
+ a && await a({ ...t.errors }, u), se(), setTimeout(se);
1113
+ if (y.state.next({
1114
+ isSubmitted: !0,
1115
+ isSubmitting: !1,
1116
+ isSubmitSuccessful: le(t.errors) && !b,
1117
+ submitCount: t.submitCount + 1,
1118
+ errors: t.errors
1119
+ }), b)
1120
+ throw b;
1121
+ }, W = (o, a = {}) => {
1122
+ p(s, o) && ($(a.defaultValue) ? X(o, te(p(n, o))) : (X(o, a.defaultValue), H(n, o, te(a.defaultValue))), a.keepTouched || ee(t.touchedFields, o), a.keepDirty || (ee(t.dirtyFields, o), t.isDirty = a.defaultValue ? F(o, te(p(n, o))) : F()), a.keepError || (ee(t.errors, o), m.isValid && M()), y.state.next({ ...t }));
1123
+ }, me = (o, a = {}) => {
1124
+ const u = o ? te(o) : n, b = te(u), x = le(o), f = x ? n : b;
1125
+ if (a.keepDefaultValues || (n = u), !a.keepValues) {
1126
+ if (a.keepDirtyValues)
1127
+ for (const A of c.mount)
1128
+ p(t.dirtyFields, A) ? H(f, A, p(i, A)) : X(A, p(f, A));
1129
+ else {
1130
+ if (Ut && $(o))
1131
+ for (const A of c.mount) {
1132
+ const L = p(s, A);
1133
+ if (L && L._f) {
1134
+ const J = Array.isArray(L._f.refs) ? L._f.refs[0] : L._f.ref;
1135
+ if (lt(J)) {
1136
+ const ue = J.closest("form");
1137
+ if (ue) {
1138
+ ue.reset();
1139
+ break;
1140
+ }
1141
+ }
1142
+ }
1143
+ }
1144
+ s = {};
1145
+ }
1146
+ i = e.shouldUnregister ? a.keepDefaultValues ? te(n) : {} : te(f), y.array.next({
1147
+ values: { ...f }
1148
+ }), y.values.next({
1149
+ values: { ...f }
1150
+ });
1151
+ }
1152
+ c = {
1153
+ mount: a.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
1154
+ unMount: /* @__PURE__ */ new Set(),
1155
+ array: /* @__PURE__ */ new Set(),
1156
+ watch: /* @__PURE__ */ new Set(),
1157
+ watchAll: !1,
1158
+ focus: ""
1159
+ }, l.mount = !m.isValid || !!a.keepIsValid || !!a.keepDirtyValues, l.watch = !!e.shouldUnregister, y.state.next({
1160
+ submitCount: a.keepSubmitCount ? t.submitCount : 0,
1161
+ isDirty: x ? !1 : a.keepDirty ? t.isDirty : !!(a.keepDefaultValues && !Me(o, n)),
1162
+ isSubmitted: a.keepIsSubmitted ? t.isSubmitted : !1,
1163
+ dirtyFields: x ? {} : a.keepDirtyValues ? a.keepDefaultValues && i ? ot(n, i) : t.dirtyFields : a.keepDefaultValues && o ? ot(n, o) : a.keepDirty ? t.dirtyFields : {},
1164
+ touchedFields: a.keepTouched ? t.touchedFields : {},
1165
+ errors: a.keepErrors ? t.errors : {},
1166
+ isSubmitSuccessful: a.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
1167
+ isSubmitting: !1
1168
+ });
1169
+ }, ye = (o, a) => me(Ie(o) ? o(i) : o, a);
1170
+ return {
1171
+ control: {
1172
+ register: K,
1173
+ unregister: be,
1174
+ getFieldState: je,
1175
+ handleSubmit: U,
1176
+ setError: _e,
1177
+ _executeSchema: k,
1178
+ _getWatch: N,
1179
+ _getDirty: F,
1180
+ _updateValid: M,
1181
+ _removeUnmounted: fe,
1182
+ _updateFieldArray: g,
1183
+ _updateDisabledField: T,
1184
+ _getFieldArray: B,
1185
+ _reset: me,
1186
+ _resetDefaultValues: () => Ie(r.defaultValues) && r.defaultValues().then((o) => {
1187
+ ye(o, r.resetOptions), y.state.next({
1188
+ isLoading: !1
1189
+ });
1190
+ }),
1191
+ _updateFormState: (o) => {
1192
+ t = {
1193
+ ...t,
1194
+ ...o
1195
+ };
1196
+ },
1197
+ _disableForm: q,
1198
+ _subjects: y,
1199
+ _proxyFormState: m,
1200
+ _setErrors: Z,
1201
+ get _fields() {
1202
+ return s;
1203
+ },
1204
+ get _formValues() {
1205
+ return i;
1206
+ },
1207
+ get _state() {
1208
+ return l;
1209
+ },
1210
+ set _state(o) {
1211
+ l = o;
1212
+ },
1213
+ get _defaultValues() {
1214
+ return n;
1215
+ },
1216
+ get _names() {
1217
+ return c;
1218
+ },
1219
+ set _names(o) {
1220
+ c = o;
1221
+ },
1222
+ get _formState() {
1223
+ return t;
1224
+ },
1225
+ set _formState(o) {
1226
+ t = o;
1227
+ },
1228
+ get _options() {
1229
+ return r;
1230
+ },
1231
+ set _options(o) {
1232
+ r = {
1233
+ ...r,
1234
+ ...o
1235
+ };
1236
+ }
1237
+ },
1238
+ trigger: Se,
1239
+ register: K,
1240
+ handleSubmit: U,
1241
+ watch: Le,
1242
+ setValue: X,
1243
+ getValues: ke,
1244
+ reset: ye,
1245
+ resetField: W,
1246
+ clearErrors: ze,
1247
+ unregister: be,
1248
+ setError: _e,
1249
+ setFocus: (o, a = {}) => {
1250
+ const u = p(s, o), b = u && u._f;
1251
+ if (b) {
1252
+ const x = b.refs ? b.refs[0] : b.ref;
1253
+ x.focus && (x.focus(), a.shouldSelect && x.select());
1254
+ }
1255
+ },
1256
+ getFieldState: je
1257
+ };
1258
+ }
1259
+ function $o(e = {}) {
1260
+ const r = I.useRef(), t = I.useRef(), [s, n] = I.useState({
1261
+ isDirty: !1,
1262
+ isValidating: !1,
1263
+ isLoading: Ie(e.defaultValues),
1264
+ isSubmitted: !1,
1265
+ isSubmitting: !1,
1266
+ isSubmitSuccessful: !1,
1267
+ isValid: !1,
1268
+ submitCount: 0,
1269
+ dirtyFields: {},
1270
+ touchedFields: {},
1271
+ validatingFields: {},
1272
+ errors: e.errors || {},
1273
+ disabled: e.disabled || !1,
1274
+ defaultValues: Ie(e.defaultValues) ? void 0 : e.defaultValues
1275
+ });
1276
+ r.current || (r.current = {
1277
+ ...Js(e),
1278
+ formState: s
1279
+ });
1280
+ const i = r.current.control;
1281
+ return i._options = e, ht({
1282
+ subject: i._subjects.state,
1283
+ next: (l) => {
1284
+ yr(l, i._proxyFormState, i._updateFormState, !0) && n({ ...i._formState });
1285
+ }
1286
+ }), I.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), I.useEffect(() => {
1287
+ if (i._proxyFormState.isDirty) {
1288
+ const l = i._getDirty();
1289
+ l !== s.isDirty && i._subjects.state.next({
1290
+ isDirty: l
1291
+ });
1292
+ }
1293
+ }, [i, s.isDirty]), I.useEffect(() => {
1294
+ e.values && !Me(e.values, t.current) ? (i._reset(e.values, i._options.resetOptions), t.current = e.values, n((l) => ({ ...l }))) : i._resetDefaultValues();
1295
+ }, [e.values, i]), I.useEffect(() => {
1296
+ e.errors && i._setErrors(e.errors);
1297
+ }, [e.errors, i]), I.useEffect(() => {
1298
+ i._state.mount || (i._updateValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
1299
+ }), I.useEffect(() => {
1300
+ e.shouldUnregister && i._subjects.values.next({
1301
+ values: i._getWatch()
1302
+ });
1303
+ }, [e.shouldUnregister, i]), r.current.formState = mr(s, i), r.current;
1304
+ }
1305
+ function sr(e, [r, t]) {
1306
+ return Math.min(t, Math.max(r, e));
1307
+ }
1308
+ function eo(e) {
1309
+ const r = h.useRef({ value: e, previous: e });
1310
+ return h.useMemo(() => (r.current.value !== e && (r.current.previous = r.current.value, r.current.value = e), r.current.previous), [e]);
1311
+ }
1312
+ var to = "VisuallyHidden", Vr = h.forwardRef(
1313
+ (e, r) => /* @__PURE__ */ _.jsx(
1314
+ de.span,
1315
+ {
1316
+ ...e,
1317
+ ref: r,
1318
+ style: {
1319
+ // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
1320
+ position: "absolute",
1321
+ border: 0,
1322
+ width: 1,
1323
+ height: 1,
1324
+ padding: 0,
1325
+ margin: -1,
1326
+ overflow: "hidden",
1327
+ clip: "rect(0, 0, 0, 0)",
1328
+ whiteSpace: "nowrap",
1329
+ wordWrap: "normal",
1330
+ ...e.style
1331
+ }
1332
+ }
1333
+ )
1334
+ );
1335
+ Vr.displayName = to;
1336
+ var ro = [" ", "Enter", "ArrowUp", "ArrowDown"], so = [" ", "Enter"], et = "Select", [mt, yt, oo] = ms(et), [Ge, qo] = ys(et, [
1337
+ oo,
1338
+ nr
1339
+ ]), gt = nr(), [no, De] = Ge(et), [io, ao] = Ge(et), Er = (e) => {
1340
+ const {
1341
+ __scopeSelect: r,
1342
+ children: t,
1343
+ open: s,
1344
+ defaultOpen: n,
1345
+ onOpenChange: i,
1346
+ value: l,
1347
+ defaultValue: c,
1348
+ onValueChange: d,
1349
+ dir: S,
1350
+ name: m,
1351
+ autoComplete: y,
1352
+ disabled: E,
1353
+ required: O
1354
+ } = e, w = gt(r), [P, M] = h.useState(null), [R, g] = h.useState(null), [D, Z] = h.useState(!1), v = Fs(S), [C = !1, V] = Yt({
1355
+ prop: s,
1356
+ defaultProp: n,
1357
+ onChange: i
1358
+ }), [k, Q] = Yt({
1359
+ prop: l,
1360
+ defaultProp: c,
1361
+ onChange: d
1362
+ }), z = h.useRef(null), fe = P ? !!P.closest("form") : !0, [F, N] = h.useState(/* @__PURE__ */ new Set()), B = Array.from(F).map((j) => j.props.value).join(";");
1363
+ return /* @__PURE__ */ _.jsx(Rs, { ...w, children: /* @__PURE__ */ _.jsxs(
1364
+ no,
1365
+ {
1366
+ required: O,
1367
+ scope: r,
1368
+ trigger: P,
1369
+ onTriggerChange: M,
1370
+ valueNode: R,
1371
+ onValueNodeChange: g,
1372
+ valueNodeHasChildren: D,
1373
+ onValueNodeHasChildrenChange: Z,
1374
+ contentId: Bt(),
1375
+ value: k,
1376
+ onValueChange: Q,
1377
+ open: C,
1378
+ onOpenChange: V,
1379
+ dir: v,
1380
+ triggerPointerDownPosRef: z,
1381
+ disabled: E,
1382
+ children: [
1383
+ /* @__PURE__ */ _.jsx(mt.Provider, { scope: r, children: /* @__PURE__ */ _.jsx(
1384
+ io,
1385
+ {
1386
+ scope: e.__scopeSelect,
1387
+ onNativeOptionAdd: h.useCallback((j) => {
1388
+ N((Y) => new Set(Y).add(j));
1389
+ }, []),
1390
+ onNativeOptionRemove: h.useCallback((j) => {
1391
+ N((Y) => {
1392
+ const X = new Set(Y);
1393
+ return X.delete(j), X;
1394
+ });
1395
+ }, []),
1396
+ children: t
1397
+ }
1398
+ ) }),
1399
+ fe ? /* @__PURE__ */ _.jsxs(
1400
+ Jr,
1401
+ {
1402
+ "aria-hidden": !0,
1403
+ required: O,
1404
+ tabIndex: -1,
1405
+ name: m,
1406
+ autoComplete: y,
1407
+ value: k,
1408
+ onChange: (j) => Q(j.target.value),
1409
+ disabled: E,
1410
+ children: [
1411
+ k === void 0 ? /* @__PURE__ */ _.jsx("option", { value: "" }) : null,
1412
+ Array.from(F)
1413
+ ]
1414
+ },
1415
+ B
1416
+ ) : null
1417
+ ]
1418
+ }
1419
+ ) });
1420
+ };
1421
+ Er.displayName = et;
1422
+ var Fr = "SelectTrigger", Rr = h.forwardRef(
1423
+ (e, r) => {
1424
+ const { __scopeSelect: t, disabled: s = !1, ...n } = e, i = gt(t), l = De(Fr, t), c = l.disabled || s, d = xe(r, l.onTriggerChange), S = yt(t), [m, y, E] = es((w) => {
1425
+ const P = S().filter((g) => !g.disabled), M = P.find((g) => g.value === l.value), R = ts(P, w, M);
1426
+ R !== void 0 && l.onValueChange(R.value);
1427
+ }), O = () => {
1428
+ c || (l.onOpenChange(!0), E());
1429
+ };
1430
+ return /* @__PURE__ */ _.jsx(gs, { asChild: !0, ...i, children: /* @__PURE__ */ _.jsx(
1431
+ de.button,
1432
+ {
1433
+ type: "button",
1434
+ role: "combobox",
1435
+ "aria-controls": l.contentId,
1436
+ "aria-expanded": l.open,
1437
+ "aria-required": l.required,
1438
+ "aria-autocomplete": "none",
1439
+ dir: l.dir,
1440
+ "data-state": l.open ? "open" : "closed",
1441
+ disabled: c,
1442
+ "data-disabled": c ? "" : void 0,
1443
+ "data-placeholder": Qr(l.value) ? "" : void 0,
1444
+ ...n,
1445
+ ref: d,
1446
+ onClick: ne(n.onClick, (w) => {
1447
+ w.currentTarget.focus();
1448
+ }),
1449
+ onPointerDown: ne(n.onPointerDown, (w) => {
1450
+ const P = w.target;
1451
+ P.hasPointerCapture(w.pointerId) && P.releasePointerCapture(w.pointerId), w.button === 0 && w.ctrlKey === !1 && (O(), l.triggerPointerDownPosRef.current = {
1452
+ x: Math.round(w.pageX),
1453
+ y: Math.round(w.pageY)
1454
+ }, w.preventDefault());
1455
+ }),
1456
+ onKeyDown: ne(n.onKeyDown, (w) => {
1457
+ const P = m.current !== "";
1458
+ !(w.ctrlKey || w.altKey || w.metaKey) && w.key.length === 1 && y(w.key), !(P && w.key === " ") && ro.includes(w.key) && (O(), w.preventDefault());
1459
+ })
1460
+ }
1461
+ ) });
1462
+ }
1463
+ );
1464
+ Rr.displayName = Fr;
1465
+ var Tr = "SelectValue", Ir = h.forwardRef(
1466
+ (e, r) => {
1467
+ const { __scopeSelect: t, className: s, style: n, children: i, placeholder: l = "", ...c } = e, d = De(Tr, t), { onValueNodeHasChildrenChange: S } = d, m = i !== void 0, y = xe(r, d.onValueNodeChange);
1468
+ return Ne(() => {
1469
+ S(m);
1470
+ }, [S, m]), /* @__PURE__ */ _.jsx(
1471
+ de.span,
1472
+ {
1473
+ ...c,
1474
+ ref: y,
1475
+ style: { pointerEvents: "none" },
1476
+ children: Qr(d.value) ? /* @__PURE__ */ _.jsx(_.Fragment, { children: l }) : i
1477
+ }
1478
+ );
1479
+ }
1480
+ );
1481
+ Ir.displayName = Tr;
1482
+ var lo = "SelectIcon", Nr = h.forwardRef(
1483
+ (e, r) => {
1484
+ const { __scopeSelect: t, children: s, ...n } = e;
1485
+ return /* @__PURE__ */ _.jsx(de.span, { "aria-hidden": !0, ...n, ref: r, children: s || "▼" });
1486
+ }
1487
+ );
1488
+ Nr.displayName = lo;
1489
+ var co = "SelectPortal", Dr = (e) => /* @__PURE__ */ _.jsx(Es, { asChild: !0, ...e });
1490
+ Dr.displayName = co;
1491
+ var Oe = "SelectContent", Pr = h.forwardRef(
1492
+ (e, r) => {
1493
+ const t = De(Oe, e.__scopeSelect), [s, n] = h.useState();
1494
+ if (Ne(() => {
1495
+ n(new DocumentFragment());
1496
+ }, []), !t.open) {
1497
+ const i = s;
1498
+ return i ? ar.createPortal(
1499
+ /* @__PURE__ */ _.jsx(kr, { scope: e.__scopeSelect, children: /* @__PURE__ */ _.jsx(mt.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ _.jsx("div", { children: e.children }) }) }),
1500
+ i
1501
+ ) : null;
1502
+ }
1503
+ return /* @__PURE__ */ _.jsx(Mr, { ...e, ref: r });
1504
+ }
1505
+ );
1506
+ Pr.displayName = Oe;
1507
+ var Ce = 10, [kr, Pe] = Ge(Oe), uo = "SelectContentImpl", Mr = h.forwardRef(
1508
+ (e, r) => {
1509
+ const {
1510
+ __scopeSelect: t,
1511
+ position: s = "item-aligned",
1512
+ onCloseAutoFocus: n,
1513
+ onEscapeKeyDown: i,
1514
+ onPointerDownOutside: l,
1515
+ //
1516
+ // PopperContent props
1517
+ side: c,
1518
+ sideOffset: d,
1519
+ align: S,
1520
+ alignOffset: m,
1521
+ arrowPadding: y,
1522
+ collisionBoundary: E,
1523
+ collisionPadding: O,
1524
+ sticky: w,
1525
+ hideWhenDetached: P,
1526
+ avoidCollisions: M,
1527
+ //
1528
+ ...R
1529
+ } = e, g = De(Oe, t), [D, Z] = h.useState(null), [v, C] = h.useState(null), V = xe(r, (T) => Z(T)), [k, Q] = h.useState(null), [z, fe] = h.useState(
1530
+ null
1531
+ ), F = yt(t), [N, B] = h.useState(!1), j = h.useRef(!1);
1532
+ h.useEffect(() => {
1533
+ if (D) return vs(D);
1534
+ }, [D]), xs();
1535
+ const Y = h.useCallback(
1536
+ (T) => {
1537
+ const [K, ...se] = F().map((W) => W.ref.current), [q] = se.slice(-1), U = document.activeElement;
1538
+ for (const W of T)
1539
+ if (W === U || (W == null || W.scrollIntoView({ block: "nearest" }), W === K && v && (v.scrollTop = 0), W === q && v && (v.scrollTop = v.scrollHeight), W == null || W.focus(), document.activeElement !== U)) return;
1540
+ },
1541
+ [F, v]
1542
+ ), X = h.useCallback(
1543
+ () => Y([k, D]),
1544
+ [Y, k, D]
1545
+ );
1546
+ h.useEffect(() => {
1547
+ N && X();
1548
+ }, [N, X]);
1549
+ const { onOpenChange: pe, triggerPointerDownPosRef: ie } = g;
1550
+ h.useEffect(() => {
1551
+ if (D) {
1552
+ let T = { x: 0, y: 0 };
1553
+ const K = (q) => {
1554
+ var U, W;
1555
+ T = {
1556
+ x: Math.abs(Math.round(q.pageX) - (((U = ie.current) == null ? void 0 : U.x) ?? 0)),
1557
+ y: Math.abs(Math.round(q.pageY) - (((W = ie.current) == null ? void 0 : W.y) ?? 0))
1558
+ };
1559
+ }, se = (q) => {
1560
+ T.x <= 10 && T.y <= 10 ? q.preventDefault() : D.contains(q.target) || pe(!1), document.removeEventListener("pointermove", K), ie.current = null;
1561
+ };
1562
+ return ie.current !== null && (document.addEventListener("pointermove", K), document.addEventListener("pointerup", se, { capture: !0, once: !0 })), () => {
1563
+ document.removeEventListener("pointermove", K), document.removeEventListener("pointerup", se, { capture: !0 });
1564
+ };
1565
+ }
1566
+ }, [D, pe, ie]), h.useEffect(() => {
1567
+ const T = () => pe(!1);
1568
+ return window.addEventListener("blur", T), window.addEventListener("resize", T), () => {
1569
+ window.removeEventListener("blur", T), window.removeEventListener("resize", T);
1570
+ };
1571
+ }, [pe]);
1572
+ const [Se, ke] = es((T) => {
1573
+ const K = F().filter((U) => !U.disabled), se = K.find((U) => U.ref.current === document.activeElement), q = ts(K, T, se);
1574
+ q && setTimeout(() => q.ref.current.focus());
1575
+ }), je = h.useCallback(
1576
+ (T, K, se) => {
1577
+ const q = !j.current && !se;
1578
+ (g.value !== void 0 && g.value === K || q) && (Q(T), q && (j.current = !0));
1579
+ },
1580
+ [g.value]
1581
+ ), ze = h.useCallback(() => D == null ? void 0 : D.focus(), [D]), _e = h.useCallback(
1582
+ (T, K, se) => {
1583
+ const q = !j.current && !se;
1584
+ (g.value !== void 0 && g.value === K || q) && fe(T);
1585
+ },
1586
+ [g.value]
1587
+ ), Le = s === "popper" ? kt : Or, be = Le === kt ? {
1588
+ side: c,
1589
+ sideOffset: d,
1590
+ align: S,
1591
+ alignOffset: m,
1592
+ arrowPadding: y,
1593
+ collisionBoundary: E,
1594
+ collisionPadding: O,
1595
+ sticky: w,
1596
+ hideWhenDetached: P,
1597
+ avoidCollisions: M
1598
+ } : {};
1599
+ return /* @__PURE__ */ _.jsx(
1600
+ kr,
1601
+ {
1602
+ scope: t,
1603
+ content: D,
1604
+ viewport: v,
1605
+ onViewportChange: C,
1606
+ itemRefCallback: je,
1607
+ selectedItem: k,
1608
+ onItemLeave: ze,
1609
+ itemTextRefCallback: _e,
1610
+ focusSelectedItem: X,
1611
+ selectedItemText: z,
1612
+ position: s,
1613
+ isPositioned: N,
1614
+ searchRef: Se,
1615
+ children: /* @__PURE__ */ _.jsx(Ss, { as: _s, allowPinchZoom: !0, children: /* @__PURE__ */ _.jsx(
1616
+ bs,
1617
+ {
1618
+ asChild: !0,
1619
+ trapped: g.open,
1620
+ onMountAutoFocus: (T) => {
1621
+ T.preventDefault();
1622
+ },
1623
+ onUnmountAutoFocus: ne(n, (T) => {
1624
+ var K;
1625
+ (K = g.trigger) == null || K.focus({ preventScroll: !0 }), T.preventDefault();
1626
+ }),
1627
+ children: /* @__PURE__ */ _.jsx(
1628
+ ws,
1629
+ {
1630
+ asChild: !0,
1631
+ disableOutsidePointerEvents: !0,
1632
+ onEscapeKeyDown: i,
1633
+ onPointerDownOutside: l,
1634
+ onFocusOutside: (T) => T.preventDefault(),
1635
+ onDismiss: () => g.onOpenChange(!1),
1636
+ children: /* @__PURE__ */ _.jsx(
1637
+ Le,
1638
+ {
1639
+ role: "listbox",
1640
+ id: g.contentId,
1641
+ "data-state": g.open ? "open" : "closed",
1642
+ dir: g.dir,
1643
+ onContextMenu: (T) => T.preventDefault(),
1644
+ ...R,
1645
+ ...be,
1646
+ onPlaced: () => B(!0),
1647
+ ref: V,
1648
+ style: {
1649
+ // flex layout so we can place the scroll buttons properly
1650
+ display: "flex",
1651
+ flexDirection: "column",
1652
+ // reset the outline by default as the content MAY get focused
1653
+ outline: "none",
1654
+ ...R.style
1655
+ },
1656
+ onKeyDown: ne(R.onKeyDown, (T) => {
1657
+ const K = T.ctrlKey || T.altKey || T.metaKey;
1658
+ if (T.key === "Tab" && T.preventDefault(), !K && T.key.length === 1 && ke(T.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(T.key)) {
1659
+ let q = F().filter((U) => !U.disabled).map((U) => U.ref.current);
1660
+ if (["ArrowUp", "End"].includes(T.key) && (q = q.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(T.key)) {
1661
+ const U = T.target, W = q.indexOf(U);
1662
+ q = q.slice(W + 1);
1663
+ }
1664
+ setTimeout(() => Y(q)), T.preventDefault();
1665
+ }
1666
+ })
1667
+ }
1668
+ )
1669
+ }
1670
+ )
1671
+ }
1672
+ ) })
1673
+ }
1674
+ );
1675
+ }
1676
+ );
1677
+ Mr.displayName = uo;
1678
+ var fo = "SelectItemAlignedPosition", Or = h.forwardRef((e, r) => {
1679
+ const { __scopeSelect: t, onPlaced: s, ...n } = e, i = De(Oe, t), l = Pe(Oe, t), [c, d] = h.useState(null), [S, m] = h.useState(null), y = xe(r, (V) => m(V)), E = yt(t), O = h.useRef(!1), w = h.useRef(!0), { viewport: P, selectedItem: M, selectedItemText: R, focusSelectedItem: g } = l, D = h.useCallback(() => {
1680
+ if (i.trigger && i.valueNode && c && S && P && M && R) {
1681
+ const V = i.trigger.getBoundingClientRect(), k = S.getBoundingClientRect(), Q = i.valueNode.getBoundingClientRect(), z = R.getBoundingClientRect();
1682
+ if (i.dir !== "rtl") {
1683
+ const U = z.left - k.left, W = Q.left - U, me = V.left - W, ye = V.width + me, tt = Math.max(ye, k.width), rt = window.innerWidth - Ce, st = sr(W, [Ce, rt - tt]);
1684
+ c.style.minWidth = ye + "px", c.style.left = st + "px";
1685
+ } else {
1686
+ const U = k.right - z.right, W = window.innerWidth - Q.right - U, me = window.innerWidth - V.right - W, ye = V.width + me, tt = Math.max(ye, k.width), rt = window.innerWidth - Ce, st = sr(W, [Ce, rt - tt]);
1687
+ c.style.minWidth = ye + "px", c.style.right = st + "px";
1688
+ }
1689
+ const fe = E(), F = window.innerHeight - Ce * 2, N = P.scrollHeight, B = window.getComputedStyle(S), j = parseInt(B.borderTopWidth, 10), Y = parseInt(B.paddingTop, 10), X = parseInt(B.borderBottomWidth, 10), pe = parseInt(B.paddingBottom, 10), ie = j + Y + N + pe + X, Se = Math.min(M.offsetHeight * 5, ie), ke = window.getComputedStyle(P), je = parseInt(ke.paddingTop, 10), ze = parseInt(ke.paddingBottom, 10), _e = V.top + V.height / 2 - Ce, Le = F - _e, be = M.offsetHeight / 2, T = M.offsetTop + be, K = j + Y + T, se = ie - K;
1690
+ if (K <= _e) {
1691
+ const U = M === fe[fe.length - 1].ref.current;
1692
+ c.style.bottom = "0px";
1693
+ const W = S.clientHeight - P.offsetTop - P.offsetHeight, me = Math.max(
1694
+ Le,
1695
+ be + // viewport might have padding bottom, include it to avoid a scrollable viewport
1696
+ (U ? ze : 0) + W + X
1697
+ ), ye = K + me;
1698
+ c.style.height = ye + "px";
1699
+ } else {
1700
+ const U = M === fe[0].ref.current;
1701
+ c.style.top = "0px";
1702
+ const me = Math.max(
1703
+ _e,
1704
+ j + P.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
1705
+ (U ? je : 0) + be
1706
+ ) + se;
1707
+ c.style.height = me + "px", P.scrollTop = K - _e + P.offsetTop;
1708
+ }
1709
+ c.style.margin = `${Ce}px 0`, c.style.minHeight = Se + "px", c.style.maxHeight = F + "px", s == null || s(), requestAnimationFrame(() => O.current = !0);
1710
+ }
1711
+ }, [
1712
+ E,
1713
+ i.trigger,
1714
+ i.valueNode,
1715
+ c,
1716
+ S,
1717
+ P,
1718
+ M,
1719
+ R,
1720
+ i.dir,
1721
+ s
1722
+ ]);
1723
+ Ne(() => D(), [D]);
1724
+ const [Z, v] = h.useState();
1725
+ Ne(() => {
1726
+ S && v(window.getComputedStyle(S).zIndex);
1727
+ }, [S]);
1728
+ const C = h.useCallback(
1729
+ (V) => {
1730
+ V && w.current === !0 && (D(), g == null || g(), w.current = !1);
1731
+ },
1732
+ [D, g]
1733
+ );
1734
+ return /* @__PURE__ */ _.jsx(
1735
+ ho,
1736
+ {
1737
+ scope: t,
1738
+ contentWrapper: c,
1739
+ shouldExpandOnScrollRef: O,
1740
+ onScrollButtonChange: C,
1741
+ children: /* @__PURE__ */ _.jsx(
1742
+ "div",
1743
+ {
1744
+ ref: d,
1745
+ style: {
1746
+ display: "flex",
1747
+ flexDirection: "column",
1748
+ position: "fixed",
1749
+ zIndex: Z
1750
+ },
1751
+ children: /* @__PURE__ */ _.jsx(
1752
+ de.div,
1753
+ {
1754
+ ...n,
1755
+ ref: y,
1756
+ style: {
1757
+ // When we get the height of the content, it includes borders. If we were to set
1758
+ // the height without having `boxSizing: 'border-box'` it would be too big.
1759
+ boxSizing: "border-box",
1760
+ // We need to ensure the content doesn't get taller than the wrapper
1761
+ maxHeight: "100%",
1762
+ ...n.style
1763
+ }
1764
+ }
1765
+ )
1766
+ }
1767
+ )
1768
+ }
1769
+ );
1770
+ });
1771
+ Or.displayName = fo;
1772
+ var po = "SelectPopperPosition", kt = h.forwardRef((e, r) => {
1773
+ const {
1774
+ __scopeSelect: t,
1775
+ align: s = "start",
1776
+ collisionPadding: n = Ce,
1777
+ ...i
1778
+ } = e, l = gt(t);
1779
+ return /* @__PURE__ */ _.jsx(
1780
+ Cs,
1781
+ {
1782
+ ...l,
1783
+ ...i,
1784
+ ref: r,
1785
+ align: s,
1786
+ collisionPadding: n,
1787
+ style: {
1788
+ // Ensure border-box for floating-ui calculations
1789
+ boxSizing: "border-box",
1790
+ ...i.style,
1791
+ "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
1792
+ "--radix-select-content-available-width": "var(--radix-popper-available-width)",
1793
+ "--radix-select-content-available-height": "var(--radix-popper-available-height)",
1794
+ "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
1795
+ "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
1796
+ }
1797
+ }
1798
+ );
1799
+ });
1800
+ kt.displayName = po;
1801
+ var [ho, $t] = Ge(Oe, {}), Mt = "SelectViewport", jr = h.forwardRef(
1802
+ (e, r) => {
1803
+ const { __scopeSelect: t, nonce: s, ...n } = e, i = Pe(Mt, t), l = $t(Mt, t), c = xe(r, i.onViewportChange), d = h.useRef(0);
1804
+ return /* @__PURE__ */ _.jsxs(_.Fragment, { children: [
1805
+ /* @__PURE__ */ _.jsx(
1806
+ "style",
1807
+ {
1808
+ dangerouslySetInnerHTML: {
1809
+ __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
1810
+ },
1811
+ nonce: s
1812
+ }
1813
+ ),
1814
+ /* @__PURE__ */ _.jsx(mt.Slot, { scope: t, children: /* @__PURE__ */ _.jsx(
1815
+ de.div,
1816
+ {
1817
+ "data-radix-select-viewport": "",
1818
+ role: "presentation",
1819
+ ...n,
1820
+ ref: c,
1821
+ style: {
1822
+ // we use position: 'relative' here on the `viewport` so that when we call
1823
+ // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
1824
+ // (independent of the scrollUpButton).
1825
+ position: "relative",
1826
+ flex: 1,
1827
+ overflow: "auto",
1828
+ ...n.style
1829
+ },
1830
+ onScroll: ne(n.onScroll, (S) => {
1831
+ const m = S.currentTarget, { contentWrapper: y, shouldExpandOnScrollRef: E } = l;
1832
+ if (E != null && E.current && y) {
1833
+ const O = Math.abs(d.current - m.scrollTop);
1834
+ if (O > 0) {
1835
+ const w = window.innerHeight - Ce * 2, P = parseFloat(y.style.minHeight), M = parseFloat(y.style.height), R = Math.max(P, M);
1836
+ if (R < w) {
1837
+ const g = R + O, D = Math.min(w, g), Z = g - D;
1838
+ y.style.height = D + "px", y.style.bottom === "0px" && (m.scrollTop = Z > 0 ? Z : 0, y.style.justifyContent = "flex-end");
1839
+ }
1840
+ }
1841
+ }
1842
+ d.current = m.scrollTop;
1843
+ })
1844
+ }
1845
+ ) })
1846
+ ] });
1847
+ }
1848
+ );
1849
+ jr.displayName = Mt;
1850
+ var Lr = "SelectGroup", [mo, yo] = Ge(Lr), Br = h.forwardRef(
1851
+ (e, r) => {
1852
+ const { __scopeSelect: t, ...s } = e, n = Bt();
1853
+ return /* @__PURE__ */ _.jsx(mo, { scope: t, id: n, children: /* @__PURE__ */ _.jsx(de.div, { role: "group", "aria-labelledby": n, ...s, ref: r }) });
1854
+ }
1855
+ );
1856
+ Br.displayName = Lr;
1857
+ var Ur = "SelectLabel", Hr = h.forwardRef(
1858
+ (e, r) => {
1859
+ const { __scopeSelect: t, ...s } = e, n = yo(Ur, t);
1860
+ return /* @__PURE__ */ _.jsx(de.div, { id: n.id, ...s, ref: r });
1861
+ }
1862
+ );
1863
+ Hr.displayName = Ur;
1864
+ var ft = "SelectItem", [go, Wr] = Ge(ft), Kr = h.forwardRef(
1865
+ (e, r) => {
1866
+ const {
1867
+ __scopeSelect: t,
1868
+ value: s,
1869
+ disabled: n = !1,
1870
+ textValue: i,
1871
+ ...l
1872
+ } = e, c = De(ft, t), d = Pe(ft, t), S = c.value === s, [m, y] = h.useState(i ?? ""), [E, O] = h.useState(!1), w = xe(
1873
+ r,
1874
+ (R) => {
1875
+ var g;
1876
+ return (g = d.itemRefCallback) == null ? void 0 : g.call(d, R, s, n);
1877
+ }
1878
+ ), P = Bt(), M = () => {
1879
+ n || (c.onValueChange(s), c.onOpenChange(!1));
1880
+ };
1881
+ if (s === "")
1882
+ throw new Error(
1883
+ "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
1884
+ );
1885
+ return /* @__PURE__ */ _.jsx(
1886
+ go,
1887
+ {
1888
+ scope: t,
1889
+ value: s,
1890
+ disabled: n,
1891
+ textId: P,
1892
+ isSelected: S,
1893
+ onItemTextChange: h.useCallback((R) => {
1894
+ y((g) => g || ((R == null ? void 0 : R.textContent) ?? "").trim());
1895
+ }, []),
1896
+ children: /* @__PURE__ */ _.jsx(
1897
+ mt.ItemSlot,
1898
+ {
1899
+ scope: t,
1900
+ value: s,
1901
+ disabled: n,
1902
+ textValue: m,
1903
+ children: /* @__PURE__ */ _.jsx(
1904
+ de.div,
1905
+ {
1906
+ role: "option",
1907
+ "aria-labelledby": P,
1908
+ "data-highlighted": E ? "" : void 0,
1909
+ "aria-selected": S && E,
1910
+ "data-state": S ? "checked" : "unchecked",
1911
+ "aria-disabled": n || void 0,
1912
+ "data-disabled": n ? "" : void 0,
1913
+ tabIndex: n ? void 0 : -1,
1914
+ ...l,
1915
+ ref: w,
1916
+ onFocus: ne(l.onFocus, () => O(!0)),
1917
+ onBlur: ne(l.onBlur, () => O(!1)),
1918
+ onPointerUp: ne(l.onPointerUp, M),
1919
+ onPointerMove: ne(l.onPointerMove, (R) => {
1920
+ var g;
1921
+ n ? (g = d.onItemLeave) == null || g.call(d) : R.currentTarget.focus({ preventScroll: !0 });
1922
+ }),
1923
+ onPointerLeave: ne(l.onPointerLeave, (R) => {
1924
+ var g;
1925
+ R.currentTarget === document.activeElement && ((g = d.onItemLeave) == null || g.call(d));
1926
+ }),
1927
+ onKeyDown: ne(l.onKeyDown, (R) => {
1928
+ var D;
1929
+ ((D = d.searchRef) == null ? void 0 : D.current) !== "" && R.key === " " || (so.includes(R.key) && M(), R.key === " " && R.preventDefault());
1930
+ })
1931
+ }
1932
+ )
1933
+ }
1934
+ )
1935
+ }
1936
+ );
1937
+ }
1938
+ );
1939
+ Kr.displayName = ft;
1940
+ var Xe = "SelectItemText", $r = h.forwardRef(
1941
+ (e, r) => {
1942
+ const { __scopeSelect: t, className: s, style: n, ...i } = e, l = De(Xe, t), c = Pe(Xe, t), d = Wr(Xe, t), S = ao(Xe, t), [m, y] = h.useState(null), E = xe(
1943
+ r,
1944
+ (R) => y(R),
1945
+ d.onItemTextChange,
1946
+ (R) => {
1947
+ var g;
1948
+ return (g = c.itemTextRefCallback) == null ? void 0 : g.call(c, R, d.value, d.disabled);
1949
+ }
1950
+ ), O = m == null ? void 0 : m.textContent, w = h.useMemo(
1951
+ () => /* @__PURE__ */ _.jsx("option", { value: d.value, disabled: d.disabled, children: O }, d.value),
1952
+ [d.disabled, d.value, O]
1953
+ ), { onNativeOptionAdd: P, onNativeOptionRemove: M } = S;
1954
+ return Ne(() => (P(w), () => M(w)), [P, M, w]), /* @__PURE__ */ _.jsxs(_.Fragment, { children: [
1955
+ /* @__PURE__ */ _.jsx(de.span, { id: d.textId, ...i, ref: E }),
1956
+ d.isSelected && l.valueNode && !l.valueNodeHasChildren ? ar.createPortal(i.children, l.valueNode) : null
1957
+ ] });
1958
+ }
1959
+ );
1960
+ $r.displayName = Xe;
1961
+ var qr = "SelectItemIndicator", Gr = h.forwardRef(
1962
+ (e, r) => {
1963
+ const { __scopeSelect: t, ...s } = e;
1964
+ return Wr(qr, t).isSelected ? /* @__PURE__ */ _.jsx(de.span, { "aria-hidden": !0, ...s, ref: r }) : null;
1965
+ }
1966
+ );
1967
+ Gr.displayName = qr;
1968
+ var Ot = "SelectScrollUpButton", zr = h.forwardRef((e, r) => {
1969
+ const t = Pe(Ot, e.__scopeSelect), s = $t(Ot, e.__scopeSelect), [n, i] = h.useState(!1), l = xe(r, s.onScrollButtonChange);
1970
+ return Ne(() => {
1971
+ if (t.viewport && t.isPositioned) {
1972
+ let c = function() {
1973
+ const S = d.scrollTop > 0;
1974
+ i(S);
1975
+ };
1976
+ const d = t.viewport;
1977
+ return c(), d.addEventListener("scroll", c), () => d.removeEventListener("scroll", c);
1978
+ }
1979
+ }, [t.viewport, t.isPositioned]), n ? /* @__PURE__ */ _.jsx(
1980
+ Xr,
1981
+ {
1982
+ ...e,
1983
+ ref: l,
1984
+ onAutoScroll: () => {
1985
+ const { viewport: c, selectedItem: d } = t;
1986
+ c && d && (c.scrollTop = c.scrollTop - d.offsetHeight);
1987
+ }
1988
+ }
1989
+ ) : null;
1990
+ });
1991
+ zr.displayName = Ot;
1992
+ var jt = "SelectScrollDownButton", Yr = h.forwardRef((e, r) => {
1993
+ const t = Pe(jt, e.__scopeSelect), s = $t(jt, e.__scopeSelect), [n, i] = h.useState(!1), l = xe(r, s.onScrollButtonChange);
1994
+ return Ne(() => {
1995
+ if (t.viewport && t.isPositioned) {
1996
+ let c = function() {
1997
+ const S = d.scrollHeight - d.clientHeight, m = Math.ceil(d.scrollTop) < S;
1998
+ i(m);
1999
+ };
2000
+ const d = t.viewport;
2001
+ return c(), d.addEventListener("scroll", c), () => d.removeEventListener("scroll", c);
2002
+ }
2003
+ }, [t.viewport, t.isPositioned]), n ? /* @__PURE__ */ _.jsx(
2004
+ Xr,
2005
+ {
2006
+ ...e,
2007
+ ref: l,
2008
+ onAutoScroll: () => {
2009
+ const { viewport: c, selectedItem: d } = t;
2010
+ c && d && (c.scrollTop = c.scrollTop + d.offsetHeight);
2011
+ }
2012
+ }
2013
+ ) : null;
2014
+ });
2015
+ Yr.displayName = jt;
2016
+ var Xr = h.forwardRef((e, r) => {
2017
+ const { __scopeSelect: t, onAutoScroll: s, ...n } = e, i = Pe("SelectScrollButton", t), l = h.useRef(null), c = yt(t), d = h.useCallback(() => {
2018
+ l.current !== null && (window.clearInterval(l.current), l.current = null);
2019
+ }, []);
2020
+ return h.useEffect(() => () => d(), [d]), Ne(() => {
2021
+ var m;
2022
+ const S = c().find((y) => y.ref.current === document.activeElement);
2023
+ (m = S == null ? void 0 : S.ref.current) == null || m.scrollIntoView({ block: "nearest" });
2024
+ }, [c]), /* @__PURE__ */ _.jsx(
2025
+ de.div,
2026
+ {
2027
+ "aria-hidden": !0,
2028
+ ...n,
2029
+ ref: r,
2030
+ style: { flexShrink: 0, ...n.style },
2031
+ onPointerDown: ne(n.onPointerDown, () => {
2032
+ l.current === null && (l.current = window.setInterval(s, 50));
2033
+ }),
2034
+ onPointerMove: ne(n.onPointerMove, () => {
2035
+ var S;
2036
+ (S = i.onItemLeave) == null || S.call(i), l.current === null && (l.current = window.setInterval(s, 50));
2037
+ }),
2038
+ onPointerLeave: ne(n.onPointerLeave, () => {
2039
+ d();
2040
+ })
2041
+ }
2042
+ );
2043
+ }), vo = "SelectSeparator", Zr = h.forwardRef(
2044
+ (e, r) => {
2045
+ const { __scopeSelect: t, ...s } = e;
2046
+ return /* @__PURE__ */ _.jsx(de.div, { "aria-hidden": !0, ...s, ref: r });
2047
+ }
2048
+ );
2049
+ Zr.displayName = vo;
2050
+ var Lt = "SelectArrow", xo = h.forwardRef(
2051
+ (e, r) => {
2052
+ const { __scopeSelect: t, ...s } = e, n = gt(t), i = De(Lt, t), l = Pe(Lt, t);
2053
+ return i.open && l.position === "popper" ? /* @__PURE__ */ _.jsx(As, { ...n, ...s, ref: r }) : null;
2054
+ }
2055
+ );
2056
+ xo.displayName = Lt;
2057
+ function Qr(e) {
2058
+ return e === "" || e === void 0;
2059
+ }
2060
+ var Jr = h.forwardRef(
2061
+ (e, r) => {
2062
+ const { value: t, ...s } = e, n = h.useRef(null), i = xe(r, n), l = eo(t);
2063
+ return h.useEffect(() => {
2064
+ const c = n.current, d = window.HTMLSelectElement.prototype, m = Object.getOwnPropertyDescriptor(
2065
+ d,
2066
+ "value"
2067
+ ).set;
2068
+ if (l !== t && m) {
2069
+ const y = new Event("change", { bubbles: !0 });
2070
+ m.call(c, t), c.dispatchEvent(y);
2071
+ }
2072
+ }, [l, t]), /* @__PURE__ */ _.jsx(Vr, { asChild: !0, children: /* @__PURE__ */ _.jsx("select", { ...s, ref: i, defaultValue: t }) });
2073
+ }
2074
+ );
2075
+ Jr.displayName = "BubbleSelect";
2076
+ function es(e) {
2077
+ const r = Vs(e), t = h.useRef(""), s = h.useRef(0), n = h.useCallback(
2078
+ (l) => {
2079
+ const c = t.current + l;
2080
+ r(c), function d(S) {
2081
+ t.current = S, window.clearTimeout(s.current), S !== "" && (s.current = window.setTimeout(() => d(""), 1e3));
2082
+ }(c);
2083
+ },
2084
+ [r]
2085
+ ), i = h.useCallback(() => {
2086
+ t.current = "", window.clearTimeout(s.current);
2087
+ }, []);
2088
+ return h.useEffect(() => () => window.clearTimeout(s.current), []), [t, n, i];
2089
+ }
2090
+ function ts(e, r, t) {
2091
+ const n = r.length > 1 && Array.from(r).every((S) => S === r[0]) ? r[0] : r, i = t ? e.indexOf(t) : -1;
2092
+ let l = So(e, Math.max(i, 0));
2093
+ n.length === 1 && (l = l.filter((S) => S !== t));
2094
+ const d = l.find(
2095
+ (S) => S.textValue.toLowerCase().startsWith(n.toLowerCase())
2096
+ );
2097
+ return d !== t ? d : void 0;
2098
+ }
2099
+ function So(e, r) {
2100
+ return e.map((t, s) => e[(r + s) % e.length]);
2101
+ }
2102
+ var _o = Er, rs = Rr, bo = Ir, wo = Nr, Co = Dr, ss = Pr, Ao = jr, Vo = Br, os = Hr, ns = Kr, Eo = $r, Fo = Gr, is = zr, as = Yr, ls = Zr;
2103
+ const Go = _o, zo = Vo, Yo = bo, Ro = h.forwardRef(({ className: e, children: r, ...t }, s) => /* @__PURE__ */ _.jsxs(
2104
+ rs,
2105
+ {
2106
+ ref: s,
2107
+ className: Ee(
2108
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
2109
+ e
2110
+ ),
2111
+ ...t,
2112
+ children: [
2113
+ /* @__PURE__ */ _.jsx("span", { className: "truncate", children: r }),
2114
+ /* @__PURE__ */ _.jsx(wo, { asChild: !0, children: /* @__PURE__ */ _.jsx(cr, { className: "flex-shrink-0 h-4 w-4 opacity-50" }) })
2115
+ ]
2116
+ }
2117
+ ));
2118
+ Ro.displayName = rs.displayName;
2119
+ const cs = h.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ _.jsx(
2120
+ is,
2121
+ {
2122
+ ref: t,
2123
+ className: Ee(
2124
+ "flex cursor-default items-center justify-center py-1",
2125
+ e
2126
+ ),
2127
+ ...r,
2128
+ children: /* @__PURE__ */ _.jsx(Ms, { className: "h-4 w-4" })
2129
+ }
2130
+ ));
2131
+ cs.displayName = is.displayName;
2132
+ const us = h.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ _.jsx(
2133
+ as,
2134
+ {
2135
+ ref: t,
2136
+ className: Ee(
2137
+ "flex cursor-default items-center justify-center py-1",
2138
+ e
2139
+ ),
2140
+ ...r,
2141
+ children: /* @__PURE__ */ _.jsx(cr, { className: "h-4 w-4" })
2142
+ }
2143
+ ));
2144
+ us.displayName = as.displayName;
2145
+ const To = h.forwardRef(({ className: e, children: r, position: t = "popper", ...s }, n) => /* @__PURE__ */ _.jsx(Co, { children: /* @__PURE__ */ _.jsxs(
2146
+ ss,
2147
+ {
2148
+ ref: n,
2149
+ className: Ee(
2150
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2151
+ t === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
2152
+ e
2153
+ ),
2154
+ position: t,
2155
+ ...s,
2156
+ children: [
2157
+ /* @__PURE__ */ _.jsx(cs, {}),
2158
+ /* @__PURE__ */ _.jsx(
2159
+ Ao,
2160
+ {
2161
+ className: Ee(
2162
+ "p-1",
2163
+ t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
2164
+ ),
2165
+ children: r
2166
+ }
2167
+ ),
2168
+ /* @__PURE__ */ _.jsx(us, {})
2169
+ ]
2170
+ }
2171
+ ) }));
2172
+ To.displayName = ss.displayName;
2173
+ const Io = h.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ _.jsx(
2174
+ os,
2175
+ {
2176
+ ref: t,
2177
+ className: Ee("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
2178
+ ...r
2179
+ }
2180
+ ));
2181
+ Io.displayName = os.displayName;
2182
+ const No = h.forwardRef(({ className: e, children: r, ...t }, s) => /* @__PURE__ */ _.jsxs(
2183
+ ns,
2184
+ {
2185
+ ref: s,
2186
+ className: Ee(
2187
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2188
+ e
2189
+ ),
2190
+ ...t,
2191
+ children: [
2192
+ /* @__PURE__ */ _.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ _.jsx(Fo, { children: /* @__PURE__ */ _.jsx(ks, { className: "h-4 w-4" }) }) }),
2193
+ /* @__PURE__ */ _.jsx(Eo, { children: r })
2194
+ ]
2195
+ }
2196
+ ));
2197
+ No.displayName = ns.displayName;
2198
+ const Do = h.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ _.jsx(
2199
+ ls,
2200
+ {
2201
+ ref: t,
2202
+ className: Ee("-mx-1 my-1 h-px bg-muted", e),
2203
+ ...r
2204
+ }
2205
+ ));
2206
+ Do.displayName = ls.displayName;
2207
+ const Po = h.forwardRef(
2208
+ ({ className: e, type: r, ...t }, s) => /* @__PURE__ */ _.jsx(
2209
+ "input",
2210
+ {
2211
+ type: r,
2212
+ className: Ee(
2213
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
2214
+ e
2215
+ ),
2216
+ ref: s,
2217
+ ...t
2218
+ }
2219
+ )
2220
+ );
2221
+ Po.displayName = "Input";
2222
+ export {
2223
+ Wo as C,
2224
+ Ho as F,
2225
+ Po as I,
2226
+ Go as S,
2227
+ Vr as V,
2228
+ Uo as a,
2229
+ Ro as b,
2230
+ Yo as c,
2231
+ To as d,
2232
+ zo as e,
2233
+ No as f,
2234
+ Ko as g,
2235
+ Us as h,
2236
+ pt as i,
2237
+ $o as u
2238
+ };
2239
+ //# sourceMappingURL=Input-HmAaR6kw.js.map