zudoku 0.25.3 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/dist/cli/dev/handler.js +2 -2
  2. package/dist/cli/dev/handler.js.map +1 -1
  3. package/dist/config/config.d.ts +1 -0
  4. package/dist/config/loader.js +1 -1
  5. package/dist/config/loader.js.map +1 -1
  6. package/dist/config/validators/common.d.ts +39 -28
  7. package/dist/config/validators/common.js +1 -0
  8. package/dist/config/validators/common.js.map +1 -1
  9. package/dist/config/validators/icon-types.d.ts +1 -1
  10. package/dist/config/validators/validate.d.ts +17 -12
  11. package/dist/lib/authentication/providers/auth0.js +1 -1
  12. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  13. package/dist/lib/authentication/providers/openid.d.ts +1 -1
  14. package/dist/lib/authentication/providers/openid.js +10 -6
  15. package/dist/lib/authentication/providers/openid.js.map +1 -1
  16. package/dist/lib/components/Autocomplete.d.ts +12 -0
  17. package/dist/lib/components/Autocomplete.js +47 -0
  18. package/dist/lib/components/Autocomplete.js.map +1 -0
  19. package/dist/lib/components/Header.js +3 -3
  20. package/dist/lib/components/Header.js.map +1 -1
  21. package/dist/lib/components/index.js +2 -2
  22. package/dist/lib/components/index.js.map +1 -1
  23. package/dist/lib/components/navigation/SidebarCategory.js +1 -1
  24. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  25. package/dist/lib/plugins/markdown/MdxPage.js +8 -2
  26. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  27. package/dist/lib/plugins/openapi/OperationList.js +3 -0
  28. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  29. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  30. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  31. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +3 -1
  32. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -2
  33. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  34. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +2 -1
  35. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -2
  36. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  37. package/dist/lib/plugins/openapi/Sidecar.js +9 -6
  38. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  39. package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
  40. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  41. package/dist/lib/plugins/openapi/SidecarExamples.d.ts +2 -1
  42. package/dist/lib/plugins/openapi/SidecarExamples.js +7 -4
  43. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  44. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
  45. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +12 -0
  46. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
  47. package/dist/lib/plugins/openapi/playground/Headers.js +66 -4
  48. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  49. package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -1
  50. package/dist/lib/plugins/openapi/playground/Playground.js +36 -11
  51. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  52. package/dist/lib/plugins/openapi/playground/QueryParams.js +20 -30
  53. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  54. package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +2 -1
  55. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +5 -3
  56. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -1
  57. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +49 -0
  58. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -1
  59. package/dist/lib/plugins/openapi/post-processors/removeParameters.d.ts +10 -0
  60. package/dist/lib/plugins/openapi/post-processors/removeParameters.js +66 -0
  61. package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +1 -0
  62. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.d.ts +1 -0
  63. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js +131 -0
  64. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +1 -0
  65. package/dist/lib/plugins/openapi/schema/SchemaComponents.js +1 -1
  66. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
  67. package/dist/lib/ui/Badge.d.ts +1 -1
  68. package/dist/lib/ui/Badge.js +1 -0
  69. package/dist/lib/ui/Badge.js.map +1 -1
  70. package/dist/lib/ui/Command.d.ts +9 -1
  71. package/dist/lib/ui/Command.js +5 -1
  72. package/dist/lib/ui/Command.js.map +1 -1
  73. package/dist/lib/util/joinUrl.d.ts +1 -0
  74. package/dist/lib/util/joinUrl.js +40 -0
  75. package/dist/lib/util/joinUrl.js.map +1 -0
  76. package/dist/vite/build.js +10 -10
  77. package/dist/vite/build.js.map +1 -1
  78. package/dist/vite/config.js +4 -1
  79. package/dist/vite/config.js.map +1 -1
  80. package/dist/vite/config.test.js +5 -1
  81. package/dist/vite/config.test.js.map +1 -1
  82. package/dist/vite/dev-server.js +4 -1
  83. package/dist/vite/dev-server.js.map +1 -1
  84. package/dist/vite/plugin-api.d.ts +1 -1
  85. package/dist/vite/plugin-api.js +23 -5
  86. package/dist/vite/plugin-api.js.map +1 -1
  87. package/dist/vite/plugin-auth.js +4 -1
  88. package/dist/vite/plugin-auth.js.map +1 -1
  89. package/dist/vite/plugin-mdx.js +9 -4
  90. package/dist/vite/plugin-mdx.js.map +1 -1
  91. package/dist/vite/prerender.d.ts +2 -2
  92. package/dist/vite/prerender.js +4 -4
  93. package/dist/vite/prerender.js.map +1 -1
  94. package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
  95. package/dist/zuplo/enrich-with-zuplo.js +184 -0
  96. package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
  97. package/dist/zuplo/env.d.ts +1 -0
  98. package/dist/zuplo/env.js +3 -0
  99. package/dist/zuplo/env.js.map +1 -1
  100. package/dist/zuplo/policy-types.d.ts +33 -0
  101. package/dist/zuplo/policy-types.js +8 -0
  102. package/dist/zuplo/policy-types.js.map +1 -0
  103. package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
  104. package/dist/zuplo/with-zuplo-processors.js +26 -0
  105. package/dist/zuplo/with-zuplo-processors.js.map +1 -0
  106. package/dist/zuplo/with-zuplo.d.ts +1 -2
  107. package/dist/zuplo/with-zuplo.js +6 -27
  108. package/dist/zuplo/with-zuplo.js.map +1 -1
  109. package/lib/{AnchorLink-DFZZbmvr.js → AnchorLink-bObQitZv.js} +3 -3
  110. package/lib/{AnchorLink-DFZZbmvr.js.map → AnchorLink-bObQitZv.js.map} +1 -1
  111. package/lib/{AuthenticationPlugin-D7G3me8L.js → AuthenticationPlugin-C9SwOxkc.js} +4 -4
  112. package/lib/{AuthenticationPlugin-D7G3me8L.js.map → AuthenticationPlugin-C9SwOxkc.js.map} +1 -1
  113. package/lib/{CategoryHeading-CBconmtI.js → CategoryHeading-MYL1u_6K.js} +3 -3
  114. package/lib/{CategoryHeading-CBconmtI.js.map → CategoryHeading-MYL1u_6K.js.map} +1 -1
  115. package/lib/{Markdown-CZDLNOFc.js → Markdown-DFN6p0J-.js} +1041 -1041
  116. package/lib/{Markdown-CZDLNOFc.js.map → Markdown-DFN6p0J-.js.map} +1 -1
  117. package/lib/{MdxPage-DKMbBROv.js → MdxPage-D9c4z09Q.js} +61 -56
  118. package/lib/MdxPage-D9c4z09Q.js.map +1 -0
  119. package/lib/{OperationList-B8bHMKme.js → OperationList-DGJWDx1G.js} +1264 -1244
  120. package/lib/OperationList-DGJWDx1G.js.map +1 -0
  121. package/lib/{Route-DYwKZ_c_.js → Route-VdmEyOD0.js} +5 -5
  122. package/lib/{Route-DYwKZ_c_.js.map → Route-VdmEyOD0.js.map} +1 -1
  123. package/lib/{Select-B_IxRUUC.js → Select-D3O7wISy.js} +36 -36
  124. package/lib/{Select-B_IxRUUC.js.map → Select-D3O7wISy.js.map} +1 -1
  125. package/lib/{SlotletProvider-pfc9oejW.js → SlotletProvider-_3zzX_g_.js} +53 -53
  126. package/lib/{SlotletProvider-pfc9oejW.js.map → SlotletProvider-_3zzX_g_.js.map} +1 -1
  127. package/lib/{Button-DeAoTouo.js → Spinner-BlzrEEk1.js} +16 -13
  128. package/lib/Spinner-BlzrEEk1.js.map +1 -0
  129. package/lib/{SyntaxHighlight-Bz-lOJtH.js → SyntaxHighlight-CJCSPG1F.js} +297 -301
  130. package/lib/{SyntaxHighlight-Bz-lOJtH.js.map → SyntaxHighlight-CJCSPG1F.js.map} +1 -1
  131. package/lib/{ZudokuContext-hmLMUdf2.js → ZudokuContext-DeQZEp-x.js} +357 -356
  132. package/lib/ZudokuContext-DeQZEp-x.js.map +1 -0
  133. package/lib/{chunk-D52XG6IA-Dl7HLe6j.js → chunk-SYFQ2XB5-BF5IDYrB.js} +410 -412
  134. package/lib/chunk-SYFQ2XB5-BF5IDYrB.js.map +1 -0
  135. package/lib/context-rwLGh-6_.js +22 -0
  136. package/lib/{context-h_UkBLvr.js.map → context-rwLGh-6_.js.map} +1 -1
  137. package/lib/{createServer-BznDkeSA.js → createServer-BcaswoFO.js} +1274 -1286
  138. package/lib/createServer-BcaswoFO.js.map +1 -0
  139. package/lib/{hook-CHq7pFyz.js → hook-BRQEDRbn.js} +17 -17
  140. package/lib/{hook-CHq7pFyz.js.map → hook-BRQEDRbn.js.map} +1 -1
  141. package/lib/index-B7mqiOei.js +509 -0
  142. package/lib/index-B7mqiOei.js.map +1 -0
  143. package/lib/index-CXRrqOIl.js +1750 -0
  144. package/lib/index-CXRrqOIl.js.map +1 -0
  145. package/lib/index-Djenk2Hj.js +36 -0
  146. package/lib/{index-CPNSgwSb.js.map → index-Djenk2Hj.js.map} +1 -1
  147. package/lib/{index-CBXSgjaE.js → index-Dl3Yl0yb.js} +65 -69
  148. package/lib/index-Dl3Yl0yb.js.map +1 -0
  149. package/lib/{index.esm-BSV1C092.js → index.esm-9-TF9KQB.js} +52 -52
  150. package/lib/{index.esm-BSV1C092.js.map → index.esm-9-TF9KQB.js.map} +1 -1
  151. package/lib/index.esm-CrSoEshU.js +1207 -0
  152. package/lib/index.esm-CrSoEshU.js.map +1 -0
  153. package/lib/joinUrl-BTy9bvoK.js +20 -0
  154. package/lib/joinUrl-BTy9bvoK.js.map +1 -0
  155. package/lib/{jsx-runtime-Dx-03ztt.js → jsx-runtime-Bdg6XQ1m.js} +135 -135
  156. package/lib/{jsx-runtime-Dx-03ztt.js.map → jsx-runtime-Bdg6XQ1m.js.map} +1 -1
  157. package/lib/post-processors/removeExtensions.js +7 -7
  158. package/lib/post-processors/removeExtensions.js.map +1 -1
  159. package/lib/post-processors/removeParameters.js +48 -0
  160. package/lib/post-processors/removeParameters.js.map +1 -0
  161. package/lib/{prism-bash.min-DadFsM4Z.js → prism-bash.min-HHIMdNJ_.js} +4 -4
  162. package/lib/{prism-bash.min-DadFsM4Z.js.map → prism-bash.min-HHIMdNJ_.js.map} +1 -1
  163. package/lib/{prism-csharp.min-DUwvItt4.js → prism-csharp.min-bQAo2pmx.js} +33 -33
  164. package/lib/{prism-csharp.min-DUwvItt4.js.map → prism-csharp.min-bQAo2pmx.js.map} +1 -1
  165. package/lib/{prism-java.min-BtgBR4yd.js → prism-java.min-BpvsOuIa.js} +12 -12
  166. package/lib/{prism-java.min-BtgBR4yd.js.map → prism-java.min-BpvsOuIa.js.map} +1 -1
  167. package/lib/{prism-markdown.min-F3U-vPBi.js → prism-markdown.min-C0Qn0m-5.js} +30 -30
  168. package/lib/{prism-markdown.min-F3U-vPBi.js.map → prism-markdown.min-C0Qn0m-5.js.map} +1 -1
  169. package/lib/{prism-ruby.min-DeDXCp1r.js → prism-ruby.min-Dx9KO9ds.js} +16 -16
  170. package/lib/{prism-ruby.min-DeDXCp1r.js.map → prism-ruby.min-Dx9KO9ds.js.map} +1 -1
  171. package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
  172. package/lib/state-mM7uaXTW.js +202 -0
  173. package/lib/state-mM7uaXTW.js.map +1 -0
  174. package/lib/ui/Accordion.js +1 -1
  175. package/lib/ui/ActionButton.js +10 -11
  176. package/lib/ui/ActionButton.js.map +1 -1
  177. package/lib/ui/Alert.js +2 -2
  178. package/lib/ui/AlertDialog.js +1 -1
  179. package/lib/ui/Badge.js +3 -2
  180. package/lib/ui/Badge.js.map +1 -1
  181. package/lib/ui/Breadcrumb.js +1 -1
  182. package/lib/ui/Button.js +2 -2
  183. package/lib/ui/Callout.js +1 -1
  184. package/lib/ui/Card.js +1 -1
  185. package/lib/ui/Carousel.js +3 -3
  186. package/lib/ui/Carousel.js.map +1 -1
  187. package/lib/ui/Checkbox.js +2 -2
  188. package/lib/ui/Command.js +125 -13
  189. package/lib/ui/Command.js.map +1 -1
  190. package/lib/ui/Dialog.js +1 -1
  191. package/lib/ui/Drawer.js +520 -519
  192. package/lib/ui/Drawer.js.map +1 -1
  193. package/lib/ui/DropdownMenu.js +1 -1
  194. package/lib/ui/Form.js +2 -2
  195. package/lib/ui/HoverCard.js +1 -1
  196. package/lib/ui/Input.js +1 -1
  197. package/lib/ui/Label.js +2 -2
  198. package/lib/ui/Pagination.js +7 -7
  199. package/lib/ui/Popover.js +1 -1
  200. package/lib/ui/Progress.js +1 -1
  201. package/lib/ui/RadioGroup.js +1 -1
  202. package/lib/ui/ScrollArea.js +1 -1
  203. package/lib/ui/Select.js +1 -1
  204. package/lib/ui/Skeleton.js +1 -1
  205. package/lib/ui/Slider.js +1 -1
  206. package/lib/ui/Switch.js +1 -1
  207. package/lib/ui/Tabs.js +1 -1
  208. package/lib/ui/Textarea.js +1 -1
  209. package/lib/ui/Toggle.js +2 -2
  210. package/lib/ui/ToggleGroup.js +1 -1
  211. package/lib/ui/Tooltip.js +1 -1
  212. package/lib/{useExposedProps-DE9lR6MF.js → useExposedProps-CetwhZpP.js} +2 -2
  213. package/lib/{useExposedProps-DE9lR6MF.js.map → useExposedProps-CetwhZpP.js.map} +1 -1
  214. package/lib/zudoku.auth-auth0.js +8 -10
  215. package/lib/zudoku.auth-auth0.js.map +1 -1
  216. package/lib/zudoku.auth-clerk.js +18 -18
  217. package/lib/zudoku.auth-openid.js +225 -221
  218. package/lib/zudoku.auth-openid.js.map +1 -1
  219. package/lib/zudoku.components.js +476 -461
  220. package/lib/zudoku.components.js.map +1 -1
  221. package/lib/zudoku.plugin-api-catalog.js +5 -5
  222. package/lib/zudoku.plugin-api-keys.js +7 -7
  223. package/lib/zudoku.plugin-custom-pages.js +3 -3
  224. package/lib/zudoku.plugin-markdown.js +2 -2
  225. package/lib/zudoku.plugin-openapi.js +5 -5
  226. package/lib/zudoku.plugin-redirect.js +1 -1
  227. package/lib/zudoku.plugin-search-inkeep.js +9 -9
  228. package/package.json +48 -48
  229. package/src/app/main.css +50 -50
  230. package/src/lib/authentication/providers/auth0.tsx +1 -4
  231. package/src/lib/authentication/providers/openid.tsx +12 -5
  232. package/src/lib/components/Autocomplete.tsx +111 -0
  233. package/src/lib/components/Header.tsx +3 -3
  234. package/src/lib/components/index.ts +2 -2
  235. package/src/lib/components/navigation/SidebarCategory.tsx +2 -2
  236. package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
  237. package/src/lib/plugins/openapi/OperationList.tsx +4 -0
  238. package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -5
  239. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +5 -0
  240. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +8 -2
  241. package/src/lib/plugins/openapi/Sidecar.tsx +15 -7
  242. package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
  243. package/src/lib/plugins/openapi/SidecarExamples.tsx +14 -6
  244. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +51 -0
  245. package/src/lib/plugins/openapi/playground/Headers.tsx +138 -41
  246. package/src/lib/plugins/openapi/playground/Playground.tsx +156 -62
  247. package/src/lib/plugins/openapi/playground/QueryParams.tsx +89 -122
  248. package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +58 -0
  249. package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +7 -4
  250. package/src/lib/plugins/openapi/post-processors/removeParameters.test.ts +148 -0
  251. package/src/lib/plugins/openapi/post-processors/removeParameters.ts +101 -0
  252. package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +1 -1
  253. package/src/lib/ui/Badge.tsx +1 -0
  254. package/src/lib/ui/Command.tsx +20 -0
  255. package/src/lib/util/joinUrl.ts +57 -0
  256. package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +0 -8
  257. package/dist/lib/plugins/openapi/playground/EnumSelector.js +0 -21
  258. package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +0 -1
  259. package/lib/Button-DeAoTouo.js.map +0 -1
  260. package/lib/Command-9x_kZHr4.js +0 -611
  261. package/lib/Command-9x_kZHr4.js.map +0 -1
  262. package/lib/MdxPage-DKMbBROv.js.map +0 -1
  263. package/lib/OperationList-B8bHMKme.js.map +0 -1
  264. package/lib/Spinner-DuxJLLNE.js +0 -7
  265. package/lib/Spinner-DuxJLLNE.js.map +0 -1
  266. package/lib/ZudokuContext-hmLMUdf2.js.map +0 -1
  267. package/lib/chunk-D52XG6IA-Dl7HLe6j.js.map +0 -1
  268. package/lib/context-h_UkBLvr.js +0 -22
  269. package/lib/createServer-BznDkeSA.js.map +0 -1
  270. package/lib/index-CBXSgjaE.js.map +0 -1
  271. package/lib/index-CPNSgwSb.js +0 -36
  272. package/lib/index-sD8L1_Dl.js +0 -1292
  273. package/lib/index-sD8L1_Dl.js.map +0 -1
  274. package/lib/index.esm-BnnBRKJX.js +0 -1214
  275. package/lib/index.esm-BnnBRKJX.js.map +0 -1
  276. package/lib/state-CFQsUZUP.js +0 -202
  277. package/lib/state-CFQsUZUP.js.map +0 -1
  278. package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
@@ -2,9 +2,9 @@ var N = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
4
  var y = (e, t, s) => t.has(e) || N("Cannot " + s);
5
- var i = (e, t, s) => (y(e, t, "read from private field"), s ? s.call(e) : t.get(e)), l = (e, t, s) => t.has(e) ? N("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), p = (e, t, s, n) => (y(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s), h = (e, t, s) => (y(e, t, "access private method"), s);
6
- import { R as U, c as Z, n as q, a as z } from "./ZudokuContext-hmLMUdf2.js";
7
- import { u as B } from "./state-CFQsUZUP.js";
5
+ var i = (e, t, s) => (y(e, t, "read from private field"), s ? s.call(e) : t.get(e)), l = (e, t, s) => t.has(e) ? N("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), f = (e, t, s, n) => (y(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s), h = (e, t, s) => (y(e, t, "access private method"), s);
6
+ import { R as U, c as Z, n as q, a as z } from "./ZudokuContext-DeQZEp-x.js";
7
+ import { u as B } from "./state-mM7uaXTW.js";
8
8
  var r, a, d, u, c, j, Q = (j = class extends U {
9
9
  constructor(t) {
10
10
  super();
@@ -12,7 +12,7 @@ var r, a, d, u, c, j, Q = (j = class extends U {
12
12
  l(this, r);
13
13
  l(this, a);
14
14
  l(this, d);
15
- this.mutationId = t.mutationId, p(this, a, t.mutationCache), p(this, r, []), this.state = t.state || H(), this.setOptions(t.options), this.scheduleGc();
15
+ this.mutationId = t.mutationId, f(this, a, t.mutationCache), f(this, r, []), this.state = t.state || H(), this.setOptions(t.options), this.scheduleGc();
16
16
  }
17
17
  setOptions(t) {
18
18
  this.options = t, this.updateGcTime(this.options.gcTime);
@@ -28,7 +28,7 @@ var r, a, d, u, c, j, Q = (j = class extends U {
28
28
  }));
29
29
  }
30
30
  removeObserver(t) {
31
- p(this, r, i(this, r).filter((s) => s !== t)), this.scheduleGc(), i(this, a).notify({
31
+ f(this, r, i(this, r).filter((s) => s !== t)), this.scheduleGc(), i(this, a).notify({
32
32
  type: "observerRemoved",
33
33
  mutation: this,
34
34
  observer: t
@@ -43,11 +43,11 @@ var r, a, d, u, c, j, Q = (j = class extends U {
43
43
  this.execute(this.state.variables);
44
44
  }
45
45
  async execute(t) {
46
- var m, w, g, x, R, v, C, P, S, A, M, E, b, G, O, D, F, k, I, T;
47
- p(this, d, Z({
46
+ var m, w, g, x, R, C, P, S, A, M, E, v, b, G, O, D, F, k, I, T;
47
+ f(this, d, Z({
48
48
  fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
49
- onFail: (o, f) => {
50
- h(this, u, c).call(this, { type: "failed", failureCount: o, error: f });
49
+ onFail: (o, p) => {
50
+ h(this, u, c).call(this, { type: "failed", failureCount: o, error: p });
51
51
  },
52
52
  onPause: () => {
53
53
  h(this, u, c).call(this, { type: "pause" });
@@ -68,29 +68,29 @@ var r, a, d, u, c, j, Q = (j = class extends U {
68
68
  t,
69
69
  this
70
70
  ));
71
- const f = await ((x = (g = this.options).onMutate) == null ? void 0 : x.call(g, t));
72
- f !== this.state.context && h(this, u, c).call(this, {
71
+ const p = await ((x = (g = this.options).onMutate) == null ? void 0 : x.call(g, t));
72
+ p !== this.state.context && h(this, u, c).call(this, {
73
73
  type: "pending",
74
- context: f,
74
+ context: p,
75
75
  variables: t,
76
76
  isPaused: n
77
77
  });
78
78
  }
79
79
  const o = await i(this, d).start();
80
- return await ((v = (R = i(this, a).config).onSuccess) == null ? void 0 : v.call(
80
+ return await ((C = (R = i(this, a).config).onSuccess) == null ? void 0 : C.call(
81
81
  R,
82
82
  o,
83
83
  t,
84
84
  this.state.context,
85
85
  this
86
- )), await ((P = (C = this.options).onSuccess) == null ? void 0 : P.call(C, o, t, this.state.context)), await ((A = (S = i(this, a).config).onSettled) == null ? void 0 : A.call(
87
- S,
86
+ )), await ((S = (P = this.options).onSuccess) == null ? void 0 : S.call(P, o, t, this.state.context)), await ((M = (A = i(this, a).config).onSettled) == null ? void 0 : M.call(
87
+ A,
88
88
  o,
89
89
  null,
90
90
  this.state.variables,
91
91
  this.state.context,
92
92
  this
93
- )), await ((E = (M = this.options).onSettled) == null ? void 0 : E.call(M, o, null, t, this.state.context)), h(this, u, c).call(this, { type: "success", data: o }), o;
93
+ )), await ((v = (E = this.options).onSettled) == null ? void 0 : v.call(E, o, null, t, this.state.context)), h(this, u, c).call(this, { type: "success", data: o }), o;
94
94
  } catch (o) {
95
95
  try {
96
96
  throw await ((G = (b = i(this, a).config).onError) == null ? void 0 : G.call(
@@ -224,4 +224,4 @@ export {
224
224
  H as g,
225
225
  V as u
226
226
  };
227
- //# sourceMappingURL=hook-CHq7pFyz.js.map
227
+ //# sourceMappingURL=hook-BRQEDRbn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hook-CHq7pFyz.js","sources":["../../../node_modules/.pnpm/@tanstack+query-core@5.62.3/node_modules/@tanstack/query-core/build/modern/mutation.js","../src/lib/authentication/hook.ts"],"sourcesContent":["// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (!restored) {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this\n );\n const context = await this.options.onMutate?.(variables);\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this\n );\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","import { useZudoku } from \"../components/context/ZudokuContext.js\";\nimport { useAuthState } from \"./state.js\";\n\nexport const useAuth = () => {\n const { authentication } = useZudoku();\n const authState = useAuthState();\n const isAuthEnabled = typeof authentication !== \"undefined\";\n\n return {\n isAuthEnabled,\n ...authState,\n\n login: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n // TODO: Should handle errors/state\n await authentication.signIn();\n },\n\n logout: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n // TODO: Should handle errors/state\n await authentication.signOut();\n\n // Redirect to home\n window.location.href = \"/\";\n },\n };\n};\n"],"names":["Mutation","_a","Removable","config","__privateAdd","_Mutation_instances","_observers","_mutationCache","_retryer","__privateSet","getDefaultState","options","observer","__privateGet","x","variables","createRetryer","failureCount","error","__privateMethod","dispatch_fn","restored","isPaused","_b","context","_d","_c","data","_f","_e","_h","_g","_j","_i","_l","_k","_n","_m","_p","_o","_r","_q","_t","_s","action","reducer","state","notifyManager","useAuth","authentication","useZudoku","authState","useAuthState","isAuthEnabled"],"mappings":";;;;;;;sBAIIA,KAAWC,IAAA,cAAcC,EAAU;AAAA,EAIrC,YAAYC,GAAQ;AAClB,UAAO;AALI,IAAAC,EAAA,MAAAC;AACb,IAAAD,EAAA,MAAAE;AACA,IAAAF,EAAA,MAAAG;AACA,IAAAH,EAAA,MAAAI;AAGE,SAAK,aAAaL,EAAO,YACzBM,EAAA,MAAKF,GAAiBJ,EAAO,gBAC7BM,EAAA,MAAKH,GAAa,CAAE,IACpB,KAAK,QAAQH,EAAO,SAASO,EAAiB,GAC9C,KAAK,WAAWP,EAAO,OAAO,GAC9B,KAAK,WAAY;AAAA,EACrB;AAAA,EACE,WAAWQ,GAAS;AAClB,SAAK,UAAUA,GACf,KAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACzC;AAAA,EACE,IAAI,OAAO;AACT,WAAO,KAAK,QAAQ;AAAA,EACxB;AAAA,EACE,YAAYC,GAAU;AACpB,IAAKC,EAAA,MAAKP,GAAW,SAASM,CAAQ,MACpCC,EAAA,MAAKP,GAAW,KAAKM,CAAQ,GAC7B,KAAK,eAAgB,GACrBC,EAAA,MAAKN,GAAe,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,UAAAK;AAAA,IACR,CAAO;AAAA,EAEP;AAAA,EACE,eAAeA,GAAU;AACvB,IAAAH,EAAA,MAAKH,GAAaO,EAAA,MAAKP,GAAW,OAAO,CAACQ,MAAMA,MAAMF,CAAQ,IAC9D,KAAK,WAAY,GACjBC,EAAA,MAAKN,GAAe,OAAO;AAAA,MACzB,MA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A,IAC9B;AAAA,IAEA,QAAQ,YAAY;AAClB,UAAI,CAACI;AACG,cAAA,IAAI,MAAM,gCAAgC;AAGlD,YAAMJ,EAAe,QAAQ,GAG7B,OAAO,SAAS,OAAO;AAAA,IAAA;AAAA,EAE3B;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"hook-BRQEDRbn.js","sources":["../../../node_modules/.pnpm/@tanstack+query-core@5.64.2/node_modules/@tanstack/query-core/build/modern/mutation.js","../src/lib/authentication/hook.ts"],"sourcesContent":["// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (!restored) {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this\n );\n const context = await this.options.onMutate?.(variables);\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this\n );\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","import { useZudoku } from \"../components/context/ZudokuContext.js\";\nimport { useAuthState } from \"./state.js\";\n\nexport const useAuth = () => {\n const { authentication } = useZudoku();\n const authState = useAuthState();\n const isAuthEnabled = typeof authentication !== \"undefined\";\n\n return {\n isAuthEnabled,\n ...authState,\n\n login: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n // TODO: Should handle errors/state\n await authentication.signIn();\n },\n\n logout: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n // TODO: Should handle errors/state\n await authentication.signOut();\n\n // Redirect to home\n window.location.href = \"/\";\n },\n };\n};\n"],"names":["Mutation","_a","Removable","config","__privateAdd","_Mutation_instances","_observers","_mutationCache","_retryer","__privateSet","getDefaultState","options","observer","__privateGet","x","variables","createRetryer","failureCount","error","__privateMethod","dispatch_fn","restored","isPaused","_b","context","_d","_c","data","_f","_e","_h","_g","_j","_i","_l","_k","_n","_m","_p","_o","_r","_q","_t","_s","action","reducer","state","notifyManager","useAuth","authentication","useZudoku","authState","useAuthState","isAuthEnabled"],"mappings":";;;;;;;sBAIIA,KAAWC,IAAA,cAAcC,EAAU;AAAA,EAI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A,UACd,cAAcE,EAAM,eAAe;AAAA,UACnC,eAAeF,EAAO;AAAA,UACtB,UAAU;AAAA,UACV,QAAQ;AAAA,QACT;AAAA,IACX;AAAA,EACK;AACD,OAAK,QAAQC,EAAQ,KAAK,KAAK,GAC/BE,EAAc,MAAM,MAAM;AACxB,IAAAlC,EAAA,MAAKP,GAAW,QAAQ,CAACM,MAAa;AACpC,MAAAA,EAAS,iBAAiBgC,CAAM;AAAA,IACxC,CAAO,GACD/B,EAAA,MAAKN,GAAe,OAAO;AAAA,MACzB,UAAU;AAAA,MACV,MAAM;AAAA,MACN,QAAAqC;AAAA,IACR,CAAO;AAAA,EACP,CAAK;AACL,GAnNe3C;AAqNf,SAASS,IAAkB;AACzB,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACd;AACH;AClOO,MAAMsC,IAAU,MAAM;AACrB,QAAA,EAAE,gBAAAC,EAAe,IAAIC,EAAU,GAC/BC,IAAYC,EAAa,GACzBC,IAAgB,OAAOJ,IAAmB;AAEzC,SAAA;AAAA,IACL,eAAAI;AAAA,IACA,GAAGF;AAAA,IAEH,OAAO,YAAY;AACjB,UAAI,CAACE;AACG,cAAA,IAAI,MAAM,gCAAgC;AAGlD,YAAMJ,EAAe,OAAO;AAAA,IAC9B;AAAA,IAEA,QAAQ,YAAY;AAClB,UAAI,CAACI;AACG,cAAA,IAAI,MAAM,gCAAgC;AAGlD,YAAMJ,EAAe,QAAQ,GAG7B,OAAO,SAAS,OAAO;AAAA,IAAA;AAAA,EAE3B;AACF;","x_google_ignoreList":[0]}
@@ -0,0 +1,509 @@
1
+ import { j as T } from "./jsx-runtime-Bdg6XQ1m.js";
2
+ import * as R from "@radix-ui/react-dialog";
3
+ import { X as Le } from "lucide-react";
4
+ import * as a from "react";
5
+ import xe from "react";
6
+ import { c as Q } from "./cn-qaFjX9_3.js";
7
+ import { Primitive as N } from "@radix-ui/react-primitive";
8
+ import { useId as P } from "@radix-ui/react-id";
9
+ const ht = R.Root, St = R.Trigger, Te = R.Portal, _e = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ T.jsx(
10
+ R.Overlay,
11
+ {
12
+ ref: t,
13
+ className: Q(
14
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
15
+ e
16
+ ),
17
+ ...n
18
+ }
19
+ ));
20
+ _e.displayName = R.Overlay.displayName;
21
+ const Ne = a.forwardRef(({ className: e, children: n, ...t }, f) => /* @__PURE__ */ T.jsxs(Te, { children: [
22
+ /* @__PURE__ */ T.jsx(_e, {}),
23
+ /* @__PURE__ */ T.jsxs(
24
+ R.Content,
25
+ {
26
+ ref: f,
27
+ className: Q(
28
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
29
+ e
30
+ ),
31
+ ...t,
32
+ children: [
33
+ n,
34
+ /* @__PURE__ */ T.jsxs(R.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
35
+ /* @__PURE__ */ T.jsx(Le, { className: "h-4 w-4" }),
36
+ /* @__PURE__ */ T.jsx("span", { className: "sr-only", children: "Close" })
37
+ ] })
38
+ ]
39
+ }
40
+ )
41
+ ] }));
42
+ Ne.displayName = R.Content.displayName;
43
+ const Me = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ T.jsx(
44
+ R.Title,
45
+ {
46
+ ref: t,
47
+ className: Q(
48
+ "text-lg font-semibold leading-none tracking-tight",
49
+ e
50
+ ),
51
+ ...n
52
+ }
53
+ ));
54
+ Me.displayName = R.Title.displayName;
55
+ const Ve = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ T.jsx(
56
+ R.Description,
57
+ {
58
+ ref: t,
59
+ className: Q("text-sm text-muted-foreground", e),
60
+ ...n
61
+ }
62
+ ));
63
+ Ve.displayName = R.Description.displayName;
64
+ var he = 1, $e = 0.9, je = 0.8, Ke = 0.17, ne = 0.1, ae = 0.999, qe = 0.9999, Ue = 0.99, Pe = /[\\\/_+.#"@\[\(\{&]/, Fe = /[\\\/_+.#"@\[\(\{&]/g, Be = /[\s-]/, Oe = /[\s-]/g;
65
+ function oe(e, n, t, f, l, o, d) {
66
+ if (o === n.length) return l === e.length ? he : Ue;
67
+ var v = `${l},${o}`;
68
+ if (d[v] !== void 0) return d[v];
69
+ for (var h = f.charAt(o), p = t.indexOf(h, l), s = 0, i, S, E, k; p >= 0; ) i = oe(e, n, t, f, p + 1, o + 1, d), i > s && (p === l ? i *= he : Pe.test(e.charAt(p - 1)) ? (i *= je, E = e.slice(l, p - 1).match(Fe), E && l > 0 && (i *= Math.pow(ae, E.length))) : Be.test(e.charAt(p - 1)) ? (i *= $e, k = e.slice(l, p - 1).match(Oe), k && l > 0 && (i *= Math.pow(ae, k.length))) : (i *= Ke, l > 0 && (i *= Math.pow(ae, p - l))), e.charAt(p) !== n.charAt(o) && (i *= qe)), (i < ne && t.charAt(p - 1) === f.charAt(o + 1) || f.charAt(o + 1) === f.charAt(o) && t.charAt(p - 1) !== f.charAt(o)) && (S = oe(e, n, t, f, p + 1, o + 2, d), S * ne > i && (i = S * ne)), i > s && (s = i), p = t.indexOf(h, p + 1);
70
+ return d[v] = s, s;
71
+ }
72
+ function Se(e) {
73
+ return e.toLowerCase().replace(Oe, " ");
74
+ }
75
+ function Ge(e, n, t) {
76
+ return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, oe(e, n, Se(e), Se(n), 0, 0, {});
77
+ }
78
+ var J = { exports: {} }, le = {};
79
+ /**
80
+ * @license React
81
+ * use-sync-external-store-shim.production.min.js
82
+ *
83
+ * Copyright (c) Facebook, Inc. and its affiliates.
84
+ *
85
+ * This source code is licensed under the MIT license found in the
86
+ * LICENSE file in the root directory of this source tree.
87
+ */
88
+ var ye;
89
+ function He() {
90
+ if (ye) return le;
91
+ ye = 1;
92
+ var e = xe;
93
+ function n(i, S) {
94
+ return i === S && (i !== 0 || 1 / i === 1 / S) || i !== i && S !== S;
95
+ }
96
+ var t = typeof Object.is == "function" ? Object.is : n, f = e.useState, l = e.useEffect, o = e.useLayoutEffect, d = e.useDebugValue;
97
+ function v(i, S) {
98
+ var E = S(), k = f({ inst: { value: E, getSnapshot: S } }), C = k[0].inst, D = k[1];
99
+ return o(function() {
100
+ C.value = E, C.getSnapshot = S, h(C) && D({ inst: C });
101
+ }, [i, E, S]), l(function() {
102
+ return h(C) && D({ inst: C }), i(function() {
103
+ h(C) && D({ inst: C });
104
+ });
105
+ }, [i]), d(E), E;
106
+ }
107
+ function h(i) {
108
+ var S = i.getSnapshot;
109
+ i = i.value;
110
+ try {
111
+ var E = S();
112
+ return !t(i, E);
113
+ } catch {
114
+ return !0;
115
+ }
116
+ }
117
+ function p(i, S) {
118
+ return S();
119
+ }
120
+ var s = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? p : v;
121
+ return le.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : s, le;
122
+ }
123
+ var ue = {};
124
+ /**
125
+ * @license React
126
+ * use-sync-external-store-shim.development.js
127
+ *
128
+ * Copyright (c) Facebook, Inc. and its affiliates.
129
+ *
130
+ * This source code is licensed under the MIT license found in the
131
+ * LICENSE file in the root directory of this source tree.
132
+ */
133
+ var Ee;
134
+ function ze() {
135
+ return Ee || (Ee = 1, process.env.NODE_ENV !== "production" && function() {
136
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
137
+ var e = xe, n = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
138
+ function t(x) {
139
+ {
140
+ for (var b = arguments.length, O = new Array(b > 1 ? b - 1 : 0), m = 1; m < b; m++)
141
+ O[m - 1] = arguments[m];
142
+ f("error", x, O);
143
+ }
144
+ }
145
+ function f(x, b, O) {
146
+ {
147
+ var m = n.ReactDebugCurrentFrame, _ = m.getStackAddendum();
148
+ _ !== "" && (b += "%s", O = O.concat([_]));
149
+ var L = O.map(function(A) {
150
+ return String(A);
151
+ });
152
+ L.unshift("Warning: " + b), Function.prototype.apply.call(console[x], console, L);
153
+ }
154
+ }
155
+ function l(x, b) {
156
+ return x === b && (x !== 0 || 1 / x === 1 / b) || x !== x && b !== b;
157
+ }
158
+ var o = typeof Object.is == "function" ? Object.is : l, d = e.useState, v = e.useEffect, h = e.useLayoutEffect, p = e.useDebugValue, s = !1, i = !1;
159
+ function S(x, b, O) {
160
+ s || e.startTransition !== void 0 && (s = !0, t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
161
+ var m = b();
162
+ if (!i) {
163
+ var _ = b();
164
+ o(m, _) || (t("The result of getSnapshot should be cached to avoid an infinite loop"), i = !0);
165
+ }
166
+ var L = d({
167
+ inst: {
168
+ value: m,
169
+ getSnapshot: b
170
+ }
171
+ }), A = L[0].inst, M = L[1];
172
+ return h(function() {
173
+ A.value = m, A.getSnapshot = b, E(A) && M({
174
+ inst: A
175
+ });
176
+ }, [x, m, b]), v(function() {
177
+ E(A) && M({
178
+ inst: A
179
+ });
180
+ var F = function() {
181
+ E(A) && M({
182
+ inst: A
183
+ });
184
+ };
185
+ return x(F);
186
+ }, [x]), p(m), m;
187
+ }
188
+ function E(x) {
189
+ var b = x.getSnapshot, O = x.value;
190
+ try {
191
+ var m = b();
192
+ return !o(O, m);
193
+ } catch {
194
+ return !0;
195
+ }
196
+ }
197
+ function k(x, b, O) {
198
+ return b();
199
+ }
200
+ var C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", D = !C, q = D ? k : S, X = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : q;
201
+ ue.useSyncExternalStore = X, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
202
+ }()), ue;
203
+ }
204
+ var be;
205
+ function We() {
206
+ return be || (be = 1, process.env.NODE_ENV === "production" ? J.exports = He() : J.exports = ze()), J.exports;
207
+ }
208
+ var Xe = We(), H = '[cmdk-group=""]', ie = '[cmdk-group-items=""]', Ye = '[cmdk-group-heading=""]', ce = '[cmdk-item=""]', we = `${ce}:not([aria-disabled="true"])`, se = "cmdk-item-select", $ = "data-value", Je = (e, n, t) => Ge(e, n, t), Re = a.createContext(void 0), W = () => a.useContext(Re), ke = a.createContext(void 0), de = () => a.useContext(ke), Ce = a.createContext(void 0), De = a.forwardRef((e, n) => {
209
+ let t = U(() => {
210
+ var r, c;
211
+ return { search: "", value: (c = (r = e.value) != null ? r : e.defaultValue) != null ? c : "", filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
212
+ }), f = U(() => /* @__PURE__ */ new Set()), l = U(() => /* @__PURE__ */ new Map()), o = U(() => /* @__PURE__ */ new Map()), d = U(() => /* @__PURE__ */ new Set()), v = Ae(e), { label: h, children: p, value: s, onValueChange: i, filter: S, shouldFilter: E, loop: k, disablePointerSelection: C = !1, vimBindings: D = !0, ...q } = e, X = P(), x = P(), b = P(), O = a.useRef(null), m = ot();
213
+ j(() => {
214
+ if (s !== void 0) {
215
+ let r = s.trim();
216
+ t.current.value = r, _.emit();
217
+ }
218
+ }, [s]), j(() => {
219
+ m(6, fe);
220
+ }, []);
221
+ let _ = a.useMemo(() => ({ subscribe: (r) => (d.current.add(r), () => d.current.delete(r)), snapshot: () => t.current, setState: (r, c, g) => {
222
+ var u, y, w;
223
+ if (!Object.is(t.current[r], c)) {
224
+ if (t.current[r] = c, r === "search") ee(), M(), m(1, F);
225
+ else if (r === "value" && (g || m(5, fe), ((u = v.current) == null ? void 0 : u.value) !== void 0)) {
226
+ let I = c ?? "";
227
+ (w = (y = v.current).onValueChange) == null || w.call(y, I);
228
+ return;
229
+ }
230
+ _.emit();
231
+ }
232
+ }, emit: () => {
233
+ d.current.forEach((r) => r());
234
+ } }), []), L = a.useMemo(() => ({ value: (r, c, g) => {
235
+ var u;
236
+ c !== ((u = o.current.get(r)) == null ? void 0 : u.value) && (o.current.set(r, { value: c, keywords: g }), t.current.filtered.items.set(r, A(c, g)), m(2, () => {
237
+ M(), _.emit();
238
+ }));
239
+ }, item: (r, c) => (f.current.add(r), c && (l.current.has(c) ? l.current.get(c).add(r) : l.current.set(c, /* @__PURE__ */ new Set([r]))), m(3, () => {
240
+ ee(), M(), t.current.value || F(), _.emit();
241
+ }), () => {
242
+ o.current.delete(r), f.current.delete(r), t.current.filtered.items.delete(r);
243
+ let g = B();
244
+ m(4, () => {
245
+ ee(), (g == null ? void 0 : g.getAttribute("id")) === r && F(), _.emit();
246
+ });
247
+ }), group: (r) => (l.current.has(r) || l.current.set(r, /* @__PURE__ */ new Set()), () => {
248
+ o.current.delete(r), l.current.delete(r);
249
+ }), filter: () => v.current.shouldFilter, label: h || e["aria-label"], getDisablePointerSelection: () => v.current.disablePointerSelection, listId: X, inputId: b, labelId: x, listInnerRef: O }), []);
250
+ function A(r, c) {
251
+ var g, u;
252
+ let y = (u = (g = v.current) == null ? void 0 : g.filter) != null ? u : Je;
253
+ return r ? y(r, t.current.search, c) : 0;
254
+ }
255
+ function M() {
256
+ if (!t.current.search || v.current.shouldFilter === !1) return;
257
+ let r = t.current.filtered.items, c = [];
258
+ t.current.filtered.groups.forEach((u) => {
259
+ let y = l.current.get(u), w = 0;
260
+ y.forEach((I) => {
261
+ let V = r.get(I);
262
+ w = Math.max(V, w);
263
+ }), c.push([u, w]);
264
+ });
265
+ let g = O.current;
266
+ G().sort((u, y) => {
267
+ var w, I;
268
+ let V = u.getAttribute("id"), Y = y.getAttribute("id");
269
+ return ((w = r.get(Y)) != null ? w : 0) - ((I = r.get(V)) != null ? I : 0);
270
+ }).forEach((u) => {
271
+ let y = u.closest(ie);
272
+ y ? y.appendChild(u.parentElement === y ? u : u.closest(`${ie} > *`)) : g.appendChild(u.parentElement === g ? u : u.closest(`${ie} > *`));
273
+ }), c.sort((u, y) => y[1] - u[1]).forEach((u) => {
274
+ var y;
275
+ let w = (y = O.current) == null ? void 0 : y.querySelector(`${H}[${$}="${encodeURIComponent(u[0])}"]`);
276
+ w == null || w.parentElement.appendChild(w);
277
+ });
278
+ }
279
+ function F() {
280
+ let r = G().find((g) => g.getAttribute("aria-disabled") !== "true"), c = r == null ? void 0 : r.getAttribute($);
281
+ _.setState("value", c || void 0);
282
+ }
283
+ function ee() {
284
+ var r, c, g, u;
285
+ if (!t.current.search || v.current.shouldFilter === !1) {
286
+ t.current.filtered.count = f.current.size;
287
+ return;
288
+ }
289
+ t.current.filtered.groups = /* @__PURE__ */ new Set();
290
+ let y = 0;
291
+ for (let w of f.current) {
292
+ let I = (c = (r = o.current.get(w)) == null ? void 0 : r.value) != null ? c : "", V = (u = (g = o.current.get(w)) == null ? void 0 : g.keywords) != null ? u : [], Y = A(I, V);
293
+ t.current.filtered.items.set(w, Y), Y > 0 && y++;
294
+ }
295
+ for (let [w, I] of l.current) for (let V of I) if (t.current.filtered.items.get(V) > 0) {
296
+ t.current.filtered.groups.add(w);
297
+ break;
298
+ }
299
+ t.current.filtered.count = y;
300
+ }
301
+ function fe() {
302
+ var r, c, g;
303
+ let u = B();
304
+ u && (((r = u.parentElement) == null ? void 0 : r.firstChild) === u && ((g = (c = u.closest(H)) == null ? void 0 : c.querySelector(Ye)) == null || g.scrollIntoView({ block: "nearest" })), u.scrollIntoView({ block: "nearest" }));
305
+ }
306
+ function B() {
307
+ var r;
308
+ return (r = O.current) == null ? void 0 : r.querySelector(`${ce}[aria-selected="true"]`);
309
+ }
310
+ function G() {
311
+ var r;
312
+ return Array.from(((r = O.current) == null ? void 0 : r.querySelectorAll(we)) || []);
313
+ }
314
+ function te(r) {
315
+ let c = G()[r];
316
+ c && _.setState("value", c.getAttribute($));
317
+ }
318
+ function re(r) {
319
+ var c;
320
+ let g = B(), u = G(), y = u.findIndex((I) => I === g), w = u[y + r];
321
+ (c = v.current) != null && c.loop && (w = y + r < 0 ? u[u.length - 1] : y + r === u.length ? u[0] : u[y + r]), w && _.setState("value", w.getAttribute($));
322
+ }
323
+ function pe(r) {
324
+ let c = B(), g = c == null ? void 0 : c.closest(H), u;
325
+ for (; g && !u; ) g = r > 0 ? ut(g, H) : it(g, H), u = g == null ? void 0 : g.querySelector(we);
326
+ u ? _.setState("value", u.getAttribute($)) : re(r);
327
+ }
328
+ let me = () => te(G().length - 1), ve = (r) => {
329
+ r.preventDefault(), r.metaKey ? me() : r.altKey ? pe(1) : re(1);
330
+ }, ge = (r) => {
331
+ r.preventDefault(), r.metaKey ? te(0) : r.altKey ? pe(-1) : re(-1);
332
+ };
333
+ return a.createElement(N.div, { ref: n, tabIndex: -1, ...q, "cmdk-root": "", onKeyDown: (r) => {
334
+ var c;
335
+ if ((c = q.onKeyDown) == null || c.call(q, r), !r.defaultPrevented) switch (r.key) {
336
+ case "n":
337
+ case "j": {
338
+ D && r.ctrlKey && ve(r);
339
+ break;
340
+ }
341
+ case "ArrowDown": {
342
+ ve(r);
343
+ break;
344
+ }
345
+ case "p":
346
+ case "k": {
347
+ D && r.ctrlKey && ge(r);
348
+ break;
349
+ }
350
+ case "ArrowUp": {
351
+ ge(r);
352
+ break;
353
+ }
354
+ case "Home": {
355
+ r.preventDefault(), te(0);
356
+ break;
357
+ }
358
+ case "End": {
359
+ r.preventDefault(), me();
360
+ break;
361
+ }
362
+ case "Enter":
363
+ if (!r.nativeEvent.isComposing && r.keyCode !== 229) {
364
+ r.preventDefault();
365
+ let g = B();
366
+ if (g) {
367
+ let u = new Event(se);
368
+ g.dispatchEvent(u);
369
+ }
370
+ }
371
+ }
372
+ } }, a.createElement("label", { "cmdk-label": "", htmlFor: L.inputId, id: L.labelId, style: ct }, h), Z(e, (r) => a.createElement(ke.Provider, { value: _ }, a.createElement(Re.Provider, { value: L }, r))));
373
+ }), Qe = a.forwardRef((e, n) => {
374
+ var t, f;
375
+ let l = P(), o = a.useRef(null), d = a.useContext(Ce), v = W(), h = Ae(e), p = (f = (t = h.current) == null ? void 0 : t.forceMount) != null ? f : d == null ? void 0 : d.forceMount;
376
+ j(() => {
377
+ if (!p) return v.item(l, d == null ? void 0 : d.id);
378
+ }, [p]);
379
+ let s = Ie(l, o, [e.value, e.children, o], e.keywords), i = de(), S = K((m) => m.value && m.value === s.current), E = K((m) => p || v.filter() === !1 ? !0 : m.search ? m.filtered.items.get(l) > 0 : !0);
380
+ a.useEffect(() => {
381
+ let m = o.current;
382
+ if (!(!m || e.disabled)) return m.addEventListener(se, k), () => m.removeEventListener(se, k);
383
+ }, [E, e.onSelect, e.disabled]);
384
+ function k() {
385
+ var m, _;
386
+ C(), (_ = (m = h.current).onSelect) == null || _.call(m, s.current);
387
+ }
388
+ function C() {
389
+ i.setState("value", s.current, !0);
390
+ }
391
+ if (!E) return null;
392
+ let { disabled: D, value: q, onSelect: X, forceMount: x, keywords: b, ...O } = e;
393
+ return a.createElement(N.div, { ref: z([o, n]), ...O, id: l, "cmdk-item": "", role: "option", "aria-disabled": !!D, "aria-selected": !!S, "data-disabled": !!D, "data-selected": !!S, onPointerMove: D || v.getDisablePointerSelection() ? void 0 : C, onClick: D ? void 0 : k }, e.children);
394
+ }), Ze = a.forwardRef((e, n) => {
395
+ let { heading: t, children: f, forceMount: l, ...o } = e, d = P(), v = a.useRef(null), h = a.useRef(null), p = P(), s = W(), i = K((E) => l || s.filter() === !1 ? !0 : E.search ? E.filtered.groups.has(d) : !0);
396
+ j(() => s.group(d), []), Ie(d, v, [e.value, e.heading, h]);
397
+ let S = a.useMemo(() => ({ id: d, forceMount: l }), [l]);
398
+ return a.createElement(N.div, { ref: z([v, n]), ...o, "cmdk-group": "", role: "presentation", hidden: i ? void 0 : !0 }, t && a.createElement("div", { ref: h, "cmdk-group-heading": "", "aria-hidden": !0, id: p }, t), Z(e, (E) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? p : void 0 }, a.createElement(Ce.Provider, { value: S }, E))));
399
+ }), et = a.forwardRef((e, n) => {
400
+ let { alwaysRender: t, ...f } = e, l = a.useRef(null), o = K((d) => !d.search);
401
+ return !t && !o ? null : a.createElement(N.div, { ref: z([l, n]), ...f, "cmdk-separator": "", role: "separator" });
402
+ }), tt = a.forwardRef((e, n) => {
403
+ let { onValueChange: t, ...f } = e, l = e.value != null, o = de(), d = K((s) => s.search), v = K((s) => s.value), h = W(), p = a.useMemo(() => {
404
+ var s;
405
+ let i = (s = h.listInnerRef.current) == null ? void 0 : s.querySelector(`${ce}[${$}="${encodeURIComponent(v)}"]`);
406
+ return i == null ? void 0 : i.getAttribute("id");
407
+ }, []);
408
+ return a.useEffect(() => {
409
+ e.value != null && o.setState("search", e.value);
410
+ }, [e.value]), a.createElement(N.input, { ref: n, ...f, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": h.listId, "aria-labelledby": h.labelId, "aria-activedescendant": p, id: h.inputId, type: "text", value: l ? e.value : d, onChange: (s) => {
411
+ l || o.setState("search", s.target.value), t == null || t(s.target.value);
412
+ } });
413
+ }), rt = a.forwardRef((e, n) => {
414
+ let { children: t, label: f = "Suggestions", ...l } = e, o = a.useRef(null), d = a.useRef(null), v = W();
415
+ return a.useEffect(() => {
416
+ if (d.current && o.current) {
417
+ let h = d.current, p = o.current, s, i = new ResizeObserver(() => {
418
+ s = requestAnimationFrame(() => {
419
+ let S = h.offsetHeight;
420
+ p.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
421
+ });
422
+ });
423
+ return i.observe(h), () => {
424
+ cancelAnimationFrame(s), i.unobserve(h);
425
+ };
426
+ }
427
+ }, []), a.createElement(N.div, { ref: z([o, n]), ...l, "cmdk-list": "", role: "listbox", "aria-label": f, id: v.listId }, Z(e, (h) => a.createElement("div", { ref: z([d, v.listInnerRef]), "cmdk-list-sizer": "" }, h)));
428
+ }), nt = a.forwardRef((e, n) => {
429
+ let { open: t, onOpenChange: f, overlayClassName: l, contentClassName: o, container: d, ...v } = e;
430
+ return a.createElement(R.Root, { open: t, onOpenChange: f }, a.createElement(R.Portal, { container: d }, a.createElement(R.Overlay, { "cmdk-overlay": "", className: l }), a.createElement(R.Content, { "aria-label": e.label, "cmdk-dialog": "", className: o }, a.createElement(De, { ref: n, ...v }))));
431
+ }), at = a.forwardRef((e, n) => K((t) => t.filtered.count === 0) ? a.createElement(N.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), lt = a.forwardRef((e, n) => {
432
+ let { progress: t, children: f, label: l = "Loading...", ...o } = e;
433
+ return a.createElement(N.div, { ref: n, ...o, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": l }, Z(e, (d) => a.createElement("div", { "aria-hidden": !0 }, d)));
434
+ }), yt = Object.assign(De, { List: rt, Item: Qe, Input: tt, Group: Ze, Separator: et, Dialog: nt, Empty: at, Loading: lt });
435
+ function ut(e, n) {
436
+ let t = e.nextElementSibling;
437
+ for (; t; ) {
438
+ if (t.matches(n)) return t;
439
+ t = t.nextElementSibling;
440
+ }
441
+ }
442
+ function it(e, n) {
443
+ let t = e.previousElementSibling;
444
+ for (; t; ) {
445
+ if (t.matches(n)) return t;
446
+ t = t.previousElementSibling;
447
+ }
448
+ }
449
+ function Ae(e) {
450
+ let n = a.useRef(e);
451
+ return j(() => {
452
+ n.current = e;
453
+ }), n;
454
+ }
455
+ var j = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
456
+ function U(e) {
457
+ let n = a.useRef();
458
+ return n.current === void 0 && (n.current = e()), n;
459
+ }
460
+ function z(e) {
461
+ return (n) => {
462
+ e.forEach((t) => {
463
+ typeof t == "function" ? t(n) : t != null && (t.current = n);
464
+ });
465
+ };
466
+ }
467
+ function K(e) {
468
+ let n = de(), t = () => e(n.snapshot());
469
+ return Xe.useSyncExternalStore(n.subscribe, t, t);
470
+ }
471
+ function Ie(e, n, t, f = []) {
472
+ let l = a.useRef(), o = W();
473
+ return j(() => {
474
+ var d;
475
+ let v = (() => {
476
+ var p;
477
+ for (let s of t) {
478
+ if (typeof s == "string") return s.trim();
479
+ if (typeof s == "object" && "current" in s) return s.current ? (p = s.current.textContent) == null ? void 0 : p.trim() : l.current;
480
+ }
481
+ })(), h = f.map((p) => p.trim());
482
+ o.value(e, v, h), (d = n.current) == null || d.setAttribute($, v), l.current = v;
483
+ }), l;
484
+ }
485
+ var ot = () => {
486
+ let [e, n] = a.useState(), t = U(() => /* @__PURE__ */ new Map());
487
+ return j(() => {
488
+ t.current.forEach((f) => f()), t.current = /* @__PURE__ */ new Map();
489
+ }, [e]), (f, l) => {
490
+ t.current.set(f, l), n({});
491
+ };
492
+ };
493
+ function st(e) {
494
+ let n = e.type;
495
+ return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
496
+ }
497
+ function Z({ asChild: e, children: n }, t) {
498
+ return e && a.isValidElement(n) ? a.cloneElement(st(n), { ref: n.ref }, t(n.props.children)) : t(n);
499
+ }
500
+ var ct = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
501
+ export {
502
+ ht as D,
503
+ K as T,
504
+ yt as V,
505
+ Ne as a,
506
+ St as b,
507
+ Me as c
508
+ };
509
+ //# sourceMappingURL=index-B7mqiOei.js.map