zudoku 0.0.0-f40ea27 → 0.0.0-f42e3678

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 (420) hide show
  1. package/README.md +2 -2
  2. package/dist/app/demo.js +16 -1
  3. package/dist/app/demo.js.map +1 -1
  4. package/dist/app/main.js +3 -9
  5. package/dist/app/main.js.map +1 -1
  6. package/dist/cli/build/handler.js +9 -1
  7. package/dist/cli/build/handler.js.map +1 -1
  8. package/dist/config/config.d.ts +1 -0
  9. package/dist/config/loader.js +2 -5
  10. package/dist/config/loader.js.map +1 -1
  11. package/dist/config/validators/BuildSchema.js +5 -0
  12. package/dist/config/validators/BuildSchema.js.map +1 -1
  13. package/dist/config/validators/InputNavigationSchema.d.ts +254 -163
  14. package/dist/config/validators/InputNavigationSchema.js +4 -4
  15. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  16. package/dist/config/validators/InputNavigationSchema.test-d.js +0 -1
  17. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -1
  18. package/dist/config/validators/NavigationSchema.js +3 -2
  19. package/dist/config/validators/NavigationSchema.js.map +1 -1
  20. package/dist/config/validators/ProtectedRoutesSchema.d.ts +12 -0
  21. package/dist/config/validators/ProtectedRoutesSchema.js +19 -0
  22. package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -0
  23. package/dist/config/validators/icon-types.d.ts +1 -1
  24. package/dist/config/validators/icon-types.js +16 -0
  25. package/dist/config/validators/icon-types.js.map +1 -1
  26. package/dist/config/validators/validate.d.ts +36 -20
  27. package/dist/config/validators/validate.js +18 -4
  28. package/dist/config/validators/validate.js.map +1 -1
  29. package/dist/config/validators/validate.test.js +65 -2
  30. package/dist/config/validators/validate.test.js.map +1 -1
  31. package/dist/flat-config.d.ts +8 -6
  32. package/dist/lib/authentication/authentication.d.ts +2 -0
  33. package/dist/lib/authentication/components/CallbackHandler.js +11 -9
  34. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  35. package/dist/lib/authentication/components/OAuthErrorPage.d.ts +3 -0
  36. package/dist/lib/authentication/components/OAuthErrorPage.js +99 -0
  37. package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -0
  38. package/dist/lib/authentication/components/SignIn.js +4 -3
  39. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  40. package/dist/lib/authentication/errors.d.ts +6 -12
  41. package/dist/lib/authentication/errors.js +2 -1
  42. package/dist/lib/authentication/errors.js.map +1 -1
  43. package/dist/lib/authentication/hook.d.ts +1 -0
  44. package/dist/lib/authentication/hook.js.map +1 -1
  45. package/dist/lib/authentication/providers/azureb2c.js +4 -2
  46. package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
  47. package/dist/lib/authentication/providers/clerk.js +4 -2
  48. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  49. package/dist/lib/authentication/providers/openid.d.ts +4 -2
  50. package/dist/lib/authentication/providers/openid.js +14 -6
  51. package/dist/lib/authentication/providers/openid.js.map +1 -1
  52. package/dist/lib/components/Banner.js +1 -1
  53. package/dist/lib/components/Banner.js.map +1 -1
  54. package/dist/lib/components/CategoryHeading.js +1 -1
  55. package/dist/lib/components/CategoryHeading.js.map +1 -1
  56. package/dist/lib/components/Header.js +1 -1
  57. package/dist/lib/components/Header.js.map +1 -1
  58. package/dist/lib/components/Heading.js +1 -1
  59. package/dist/lib/components/Heading.js.map +1 -1
  60. package/dist/lib/components/Markdown.js +2 -2
  61. package/dist/lib/components/Markdown.js.map +1 -1
  62. package/dist/lib/components/MobileTopNavigation.js +11 -6
  63. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  64. package/dist/lib/components/NotFoundPage.js +1 -1
  65. package/dist/lib/components/NotFoundPage.js.map +1 -1
  66. package/dist/lib/components/Pagination.js +1 -1
  67. package/dist/lib/components/Pagination.js.map +1 -1
  68. package/dist/lib/components/StatusPage.js +4 -0
  69. package/dist/lib/components/StatusPage.js.map +1 -1
  70. package/dist/lib/components/TopNavigation.d.ts +5 -0
  71. package/dist/lib/components/TopNavigation.js +20 -15
  72. package/dist/lib/components/TopNavigation.js.map +1 -1
  73. package/dist/lib/components/Typography.d.ts +1 -1
  74. package/dist/lib/components/Typography.js +1 -1
  75. package/dist/lib/components/Typography.js.map +1 -1
  76. package/dist/lib/components/context/ZudokuContext.js +21 -13
  77. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  78. package/dist/lib/components/navigation/NavigationItem.d.ts +1 -1
  79. package/dist/lib/components/navigation/NavigationItem.js +8 -1
  80. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  81. package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
  82. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
  83. package/dist/lib/components/navigation/utils.d.ts +3 -1
  84. package/dist/lib/components/navigation/utils.js +6 -3
  85. package/dist/lib/components/navigation/utils.js.map +1 -1
  86. package/dist/lib/core/RouteGuard.js +9 -9
  87. package/dist/lib/core/RouteGuard.js.map +1 -1
  88. package/dist/lib/core/ZudokuContext.d.ts +5 -2
  89. package/dist/lib/core/ZudokuContext.js +27 -2
  90. package/dist/lib/core/ZudokuContext.js.map +1 -1
  91. package/dist/lib/core/plugins.d.ts +2 -1
  92. package/dist/lib/core/plugins.js.map +1 -1
  93. package/dist/lib/errors/ErrorAlert.js +1 -1
  94. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  95. package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
  96. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  97. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +6 -4
  98. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  99. package/dist/lib/plugins/api-keys/index.d.ts +1 -0
  100. package/dist/lib/plugins/api-keys/index.js +4 -8
  101. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  102. package/dist/lib/plugins/markdown/MdxPage.js +4 -3
  103. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  104. package/dist/lib/plugins/openapi/OperationList.js +2 -1
  105. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  106. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  107. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  108. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  109. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  110. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  111. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  112. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  113. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +1 -0
  114. package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
  115. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  116. package/dist/lib/plugins/openapi/index.js +43 -11
  117. package/dist/lib/plugins/openapi/index.js.map +1 -1
  118. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
  119. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  120. package/dist/lib/plugins/openapi/playground/Playground.js +4 -2
  121. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  122. package/dist/lib/plugins/search-inkeep/index.d.ts +5 -22
  123. package/dist/lib/plugins/search-inkeep/index.js +35 -29
  124. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  125. package/dist/lib/plugins/search-inkeep/inkeep.d.ts +5 -21
  126. package/dist/lib/plugins/search-inkeep/inkeep.js +10 -19
  127. package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
  128. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +1 -1
  129. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  130. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -1
  131. package/dist/lib/plugins/search-pagefind/ResultList.js +12 -5
  132. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  133. package/dist/lib/ui/ActionButton.js +1 -1
  134. package/dist/lib/ui/ActionButton.js.map +1 -1
  135. package/dist/lib/ui/Alert.d.ts +1 -1
  136. package/dist/lib/ui/Badge.d.ts +1 -1
  137. package/dist/lib/ui/Button.d.ts +2 -2
  138. package/dist/lib/ui/CodeBlock.js +1 -1
  139. package/dist/lib/ui/CodeBlock.js.map +1 -1
  140. package/dist/lib/ui/Command.d.ts +1 -1
  141. package/dist/lib/ui/EmbeddedCodeBlock.js +1 -1
  142. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  143. package/dist/lib/util/invariant.d.ts +6 -5
  144. package/dist/lib/util/invariant.js +1 -1
  145. package/dist/lib/util/invariant.js.map +1 -1
  146. package/dist/vite/build.js +7 -1
  147. package/dist/vite/build.js.map +1 -1
  148. package/dist/vite/dev-server.js +9 -1
  149. package/dist/vite/dev-server.js.map +1 -1
  150. package/dist/vite/mdx/remark-last-modified.js +1 -28
  151. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  152. package/dist/vite/plugin-docs.js +20 -13
  153. package/dist/vite/plugin-docs.js.map +1 -1
  154. package/dist/vite/plugin-mdx.js +2 -3
  155. package/dist/vite/plugin-mdx.js.map +1 -1
  156. package/dist/vite/plugin-theme.js +88 -49
  157. package/dist/vite/plugin-theme.js.map +1 -1
  158. package/dist/vite/plugin-theme.test.js +25 -4
  159. package/dist/vite/plugin-theme.test.js.map +1 -1
  160. package/dist/vite/prerender/worker.js +5 -1
  161. package/dist/vite/prerender/worker.js.map +1 -1
  162. package/dist/vite/shadcn-registry.d.ts +8 -8
  163. package/lib/{Button-BE9IVkWV.js → Button-B3o-2Xdf.js} +2 -2
  164. package/lib/{Button-BE9IVkWV.js.map → Button-B3o-2Xdf.js.map} +1 -1
  165. package/lib/{Card-DPhGbYUM.js → Card-CMDQUPM4.js} +2 -2
  166. package/lib/{Card-DPhGbYUM.js.map → Card-CMDQUPM4.js.map} +1 -1
  167. package/lib/ClientOnly-E7hGysn1.js.map +1 -1
  168. package/lib/{CodeBlock-DAKxs_Tu.js → CodeBlock-B-G0eKtw.js} +3 -3
  169. package/lib/{CodeBlock-DAKxs_Tu.js.map → CodeBlock-B-G0eKtw.js.map} +1 -1
  170. package/lib/{Command-xsbs2uhf.js → Command-BYukybsa.js} +3 -3
  171. package/lib/{Command-xsbs2uhf.js.map → Command-BYukybsa.js.map} +1 -1
  172. package/lib/{Dialog-CiIdyz6a.js → Dialog-u9Uz9sTt.js} +5 -5
  173. package/lib/{Dialog-CiIdyz6a.js.map → Dialog-u9Uz9sTt.js.map} +1 -1
  174. package/lib/{Drawer-BzkOKwgC.js → Drawer-DJ05s2pH.js} +86 -86
  175. package/lib/{Drawer-BzkOKwgC.js.map → Drawer-DJ05s2pH.js.map} +1 -1
  176. package/lib/{MdxPage-swXPJ0gf.js → MdxPage-Bsko6_kb.js} +34 -34
  177. package/lib/MdxPage-Bsko6_kb.js.map +1 -0
  178. package/lib/OAuthErrorPage-DJzGiIBt.js +150 -0
  179. package/lib/OAuthErrorPage-DJzGiIBt.js.map +1 -0
  180. package/lib/{OasProvider-CDAM3TB1.js → OasProvider-DQQRt3oS.js} +3 -3
  181. package/lib/{OasProvider-CDAM3TB1.js.map → OasProvider-DQQRt3oS.js.map} +1 -1
  182. package/lib/{OperationList-C9Hb9ql8.js → OperationList-DpmkHf26.js} +212 -210
  183. package/lib/OperationList-DpmkHf26.js.map +1 -0
  184. package/lib/{Pagination-VGlgeCmS.js → Pagination-kqFNgtnI.js} +10 -9
  185. package/lib/Pagination-kqFNgtnI.js.map +1 -0
  186. package/lib/{RouteGuard-CbKd7_9h.js → RouteGuard-0wPUKdxJ.js} +166 -165
  187. package/lib/{RouteGuard-CbKd7_9h.js.map → RouteGuard-0wPUKdxJ.js.map} +1 -1
  188. package/lib/{SchemaList-BAbh1BXO.js → SchemaList-DS-pMd6B.js} +9 -9
  189. package/lib/{SchemaList-BAbh1BXO.js.map → SchemaList-DS-pMd6B.js.map} +1 -1
  190. package/lib/{SchemaView-C2Io712T.js → SchemaView-BnN6WHjw.js} +6 -6
  191. package/lib/{SchemaView-C2Io712T.js.map → SchemaView-BnN6WHjw.js.map} +1 -1
  192. package/lib/Select-BmTTKNPp.js +273 -0
  193. package/lib/Select-BmTTKNPp.js.map +1 -0
  194. package/lib/SignUp-BwOSCD-6.js +56 -0
  195. package/lib/SignUp-BwOSCD-6.js.map +1 -0
  196. package/lib/{Slot-DwZlQ-vX.js → Slot-DAyXieeZ.js} +1634 -1643
  197. package/lib/Slot-DAyXieeZ.js.map +1 -0
  198. package/lib/Spinner-mNLZ6awP.js.map +1 -1
  199. package/lib/{SyntaxHighlight-CrjhGEwT.js → SyntaxHighlight-BMKR4pl6.js} +757 -757
  200. package/lib/SyntaxHighlight-BMKR4pl6.js.map +1 -0
  201. package/lib/{Toc-WCmwFkX-.js → Toc-BKDRCQzU.js} +3 -3
  202. package/lib/{Toc-WCmwFkX-.js.map → Toc-BKDRCQzU.js.map} +1 -1
  203. package/lib/ZudokuContext-CLl5w57E.js +1278 -0
  204. package/lib/ZudokuContext-CLl5w57E.js.map +1 -0
  205. package/lib/{chunk-DQRVZFIR-DHK7_Ilc.js → chunk-QMGIS6GS-CEOk3lro.js} +3 -3
  206. package/lib/chunk-QMGIS6GS-CEOk3lro.js.map +1 -0
  207. package/lib/{circular-B42RaanD.js → circular-8GWQDvCW.js} +2 -2
  208. package/lib/{circular-B42RaanD.js.map → circular-8GWQDvCW.js.map} +1 -1
  209. package/lib/{cn-wvCW-ho6.js → cn-dYga0KKN.js} +2 -2
  210. package/lib/cn-dYga0KKN.js.map +1 -0
  211. package/lib/{createServer-BKFsRuuk.js → createServer-BsezSzvV.js} +3398 -3552
  212. package/lib/createServer-BsezSzvV.js.map +1 -0
  213. package/lib/errors-Cs7hKmdL.js +45 -0
  214. package/lib/errors-Cs7hKmdL.js.map +1 -0
  215. package/lib/hook-DbUCLQNg.js +247 -0
  216. package/lib/hook-DbUCLQNg.js.map +1 -0
  217. package/lib/index-A5Qdwj1B.js +4081 -0
  218. package/lib/index-A5Qdwj1B.js.map +1 -0
  219. package/lib/{index-B6Re5_cx.js → index-Bg7Js3jB.js} +873 -951
  220. package/lib/index-Bg7Js3jB.js.map +1 -0
  221. package/lib/{index-CcV90rin.js → index-BkW9tJ6j.js} +2 -2
  222. package/lib/{index-CcV90rin.js.map → index-BkW9tJ6j.js.map} +1 -1
  223. package/lib/index-Bm35Tkgf.js +107 -0
  224. package/lib/index-Bm35Tkgf.js.map +1 -0
  225. package/lib/index-CrcNWbel.js.map +1 -1
  226. package/lib/index-DI5SPFK9.js.map +1 -1
  227. package/lib/index-DmNq2fbN.js.map +1 -1
  228. package/lib/index.esm-CdzlRw50.js +1254 -0
  229. package/lib/index.esm-CdzlRw50.js.map +1 -0
  230. package/lib/{invariant-DAFpPywt.js → invariant-Bm-FVUQE.js} +2 -6
  231. package/lib/invariant-Bm-FVUQE.js.map +1 -0
  232. package/lib/jsx-runtime-C5mzlN2N.js.map +1 -1
  233. package/lib/processors/removeExtensions.js.map +1 -1
  234. package/lib/processors/removeParameters.js.map +1 -1
  235. package/lib/processors/removePaths.js.map +1 -1
  236. package/lib/processors/traverse.js.map +1 -1
  237. package/lib/ui/Accordion.js +1 -1
  238. package/lib/ui/Accordion.js.map +1 -1
  239. package/lib/ui/ActionButton.js +10 -10
  240. package/lib/ui/ActionButton.js.map +1 -1
  241. package/lib/ui/Alert.js +1 -1
  242. package/lib/ui/Alert.js.map +1 -1
  243. package/lib/ui/AlertDialog.js +1 -1
  244. package/lib/ui/AlertDialog.js.map +1 -1
  245. package/lib/ui/Badge.js +1 -1
  246. package/lib/ui/Badge.js.map +1 -1
  247. package/lib/ui/Breadcrumb.js +1 -1
  248. package/lib/ui/Breadcrumb.js.map +1 -1
  249. package/lib/ui/Button.js +1 -1
  250. package/lib/ui/Button.js.map +1 -1
  251. package/lib/ui/Callout.js +1 -1
  252. package/lib/ui/Callout.js.map +1 -1
  253. package/lib/ui/Card.js +1 -1
  254. package/lib/ui/Card.js.map +1 -1
  255. package/lib/ui/Carousel.js +1 -1
  256. package/lib/ui/Carousel.js.map +1 -1
  257. package/lib/ui/Checkbox.js +1 -1
  258. package/lib/ui/Checkbox.js.map +1 -1
  259. package/lib/ui/CodeBlock.js +2 -2
  260. package/lib/ui/Command.js +2 -2
  261. package/lib/ui/Command.js.map +1 -1
  262. package/lib/ui/Dialog.js +1 -1
  263. package/lib/ui/Dialog.js.map +1 -1
  264. package/lib/ui/Drawer.js +2 -2
  265. package/lib/ui/DropdownMenu.js +1 -1
  266. package/lib/ui/DropdownMenu.js.map +1 -1
  267. package/lib/ui/EmbeddedCodeBlock.js +2 -2
  268. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  269. package/lib/ui/Form.js +2 -2
  270. package/lib/ui/Form.js.map +1 -1
  271. package/lib/ui/HoverCard.js +1 -1
  272. package/lib/ui/HoverCard.js.map +1 -1
  273. package/lib/ui/Input.js +1 -1
  274. package/lib/ui/Input.js.map +1 -1
  275. package/lib/ui/Label.js +1 -1
  276. package/lib/ui/Label.js.map +1 -1
  277. package/lib/ui/Pagination.js +1 -1
  278. package/lib/ui/Pagination.js.map +1 -1
  279. package/lib/ui/Popover.js +1 -1
  280. package/lib/ui/Popover.js.map +1 -1
  281. package/lib/ui/Progress.js +1 -1
  282. package/lib/ui/Progress.js.map +1 -1
  283. package/lib/ui/RadioGroup.js +1 -1
  284. package/lib/ui/RadioGroup.js.map +1 -1
  285. package/lib/ui/ScrollArea.js +1 -1
  286. package/lib/ui/ScrollArea.js.map +1 -1
  287. package/lib/ui/Select.js +1 -1
  288. package/lib/ui/Select.js.map +1 -1
  289. package/lib/ui/Skeleton.js +1 -1
  290. package/lib/ui/Skeleton.js.map +1 -1
  291. package/lib/ui/Slider.js +1 -1
  292. package/lib/ui/Slider.js.map +1 -1
  293. package/lib/ui/Stepper.js.map +1 -1
  294. package/lib/ui/Switch.js +1 -1
  295. package/lib/ui/Switch.js.map +1 -1
  296. package/lib/ui/SyntaxHighlight.js +4 -4
  297. package/lib/ui/Tabs.js +1 -1
  298. package/lib/ui/Tabs.js.map +1 -1
  299. package/lib/ui/Textarea.js +1 -1
  300. package/lib/ui/Textarea.js.map +1 -1
  301. package/lib/ui/Toggle.js +1 -1
  302. package/lib/ui/Toggle.js.map +1 -1
  303. package/lib/ui/ToggleGroup.js +1 -1
  304. package/lib/ui/ToggleGroup.js.map +1 -1
  305. package/lib/ui/Tooltip.js +1 -1
  306. package/lib/ui/Tooltip.js.map +1 -1
  307. package/lib/ui/util.js +1 -1
  308. package/lib/{useExposedProps-BIYjecPD.js → useExposedProps-KcgXHKeE.js} +2 -2
  309. package/lib/{useExposedProps-BIYjecPD.js.map → useExposedProps-KcgXHKeE.js.map} +1 -1
  310. package/lib/zudoku.auth-auth0.js +1 -1
  311. package/lib/zudoku.auth-auth0.js.map +1 -1
  312. package/lib/zudoku.auth-azureb2c.js +46 -9883
  313. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  314. package/lib/zudoku.auth-clerk.js +25 -22
  315. package/lib/zudoku.auth-clerk.js.map +1 -1
  316. package/lib/zudoku.auth-openid.js +249 -231
  317. package/lib/zudoku.auth-openid.js.map +1 -1
  318. package/lib/zudoku.auth-supabase.js +97 -0
  319. package/lib/zudoku.auth-supabase.js.map +1 -0
  320. package/lib/zudoku.components.js +30 -29
  321. package/lib/zudoku.components.js.map +1 -1
  322. package/lib/zudoku.hooks.js +17 -16
  323. package/lib/zudoku.hooks.js.map +1 -1
  324. package/lib/zudoku.icons.js.map +1 -1
  325. package/lib/zudoku.plugin-api-catalog.js +26 -25
  326. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  327. package/lib/zudoku.plugin-api-keys.js +428 -299
  328. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  329. package/lib/zudoku.plugin-custom-pages.js +1 -1
  330. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  331. package/lib/zudoku.plugin-markdown.js +1 -1
  332. package/lib/zudoku.plugin-markdown.js.map +1 -1
  333. package/lib/zudoku.plugin-openapi.js +7 -6
  334. package/lib/zudoku.plugin-openapi.js.map +1 -1
  335. package/lib/zudoku.plugin-redirect.js +1 -1
  336. package/lib/zudoku.plugin-redirect.js.map +1 -1
  337. package/lib/zudoku.plugin-search-inkeep.js +54 -57
  338. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  339. package/lib/zudoku.plugin-search-pagefind.js +123 -118
  340. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  341. package/lib/zudoku.plugins.js.map +1 -1
  342. package/package.json +34 -33
  343. package/src/app/demo.tsx +19 -2
  344. package/src/app/main.css +26 -5
  345. package/src/app/main.tsx +6 -14
  346. package/src/lib/authentication/authentication.ts +2 -2
  347. package/src/lib/authentication/components/CallbackHandler.tsx +22 -15
  348. package/src/lib/authentication/components/OAuthErrorPage.tsx +171 -0
  349. package/src/lib/authentication/components/SignIn.tsx +5 -12
  350. package/src/lib/authentication/errors.ts +27 -13
  351. package/src/lib/authentication/hook.ts +2 -0
  352. package/src/lib/authentication/providers/azureb2c.tsx +8 -3
  353. package/src/lib/authentication/providers/clerk.tsx +4 -1
  354. package/src/lib/authentication/providers/openid.tsx +30 -5
  355. package/src/lib/components/Banner.tsx +0 -1
  356. package/src/lib/components/CategoryHeading.tsx +4 -1
  357. package/src/lib/components/Header.tsx +5 -2
  358. package/src/lib/components/Heading.tsx +1 -1
  359. package/src/lib/components/Markdown.tsx +3 -3
  360. package/src/lib/components/MobileTopNavigation.tsx +60 -8
  361. package/src/lib/components/NotFoundPage.tsx +3 -2
  362. package/src/lib/components/Pagination.tsx +1 -0
  363. package/src/lib/components/StatusPage.tsx +5 -0
  364. package/src/lib/components/TopNavigation.tsx +34 -18
  365. package/src/lib/components/Typography.tsx +1 -1
  366. package/src/lib/components/context/ZudokuContext.ts +25 -18
  367. package/src/lib/components/navigation/NavigationItem.tsx +9 -1
  368. package/src/lib/components/navigation/NavigationWrapper.tsx +4 -1
  369. package/src/lib/components/navigation/utils.ts +9 -3
  370. package/src/lib/core/RouteGuard.tsx +13 -13
  371. package/src/lib/core/ZudokuContext.ts +40 -5
  372. package/src/lib/core/plugins.ts +2 -1
  373. package/src/lib/errors/ErrorAlert.tsx +5 -7
  374. package/src/lib/plugins/api-keys/CreateApiKey.tsx +12 -1
  375. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +37 -13
  376. package/src/lib/plugins/api-keys/index.tsx +8 -9
  377. package/src/lib/plugins/markdown/MdxPage.tsx +4 -3
  378. package/src/lib/plugins/openapi/OperationList.tsx +4 -2
  379. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  380. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -1
  381. package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
  382. package/src/lib/plugins/openapi/graphql/graphql.ts +2 -0
  383. package/src/lib/plugins/openapi/index.tsx +67 -17
  384. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  385. package/src/lib/plugins/openapi/playground/Playground.tsx +8 -2
  386. package/src/lib/plugins/search-inkeep/index.tsx +54 -58
  387. package/src/lib/plugins/search-inkeep/inkeep.ts +19 -21
  388. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +1 -0
  389. package/src/lib/plugins/search-pagefind/ResultList.tsx +13 -4
  390. package/src/lib/ui/ActionButton.tsx +3 -1
  391. package/src/lib/ui/Alert.tsx +1 -1
  392. package/src/lib/ui/CodeBlock.tsx +1 -1
  393. package/src/lib/ui/EmbeddedCodeBlock.tsx +1 -1
  394. package/src/lib/util/invariant.ts +7 -5
  395. package/lib/Alert-CT_ViLrJ.js +0 -161
  396. package/lib/Alert-CT_ViLrJ.js.map +0 -1
  397. package/lib/MdxPage-swXPJ0gf.js.map +0 -1
  398. package/lib/OperationList-C9Hb9ql8.js.map +0 -1
  399. package/lib/Pagination-VGlgeCmS.js.map +0 -1
  400. package/lib/SignUp-5RUdVhnq.js +0 -63
  401. package/lib/SignUp-5RUdVhnq.js.map +0 -1
  402. package/lib/Slot-DwZlQ-vX.js.map +0 -1
  403. package/lib/SyntaxHighlight-CrjhGEwT.js.map +0 -1
  404. package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +0 -1
  405. package/lib/clerk-BDZ31hjU.js +0 -25190
  406. package/lib/clerk-BDZ31hjU.js.map +0 -1
  407. package/lib/cn-wvCW-ho6.js.map +0 -1
  408. package/lib/createServer-BKFsRuuk.js.map +0 -1
  409. package/lib/errors-CF2X_x5o.js +0 -78
  410. package/lib/errors-CF2X_x5o.js.map +0 -1
  411. package/lib/hook-Bd0yS8M0.js +0 -1503
  412. package/lib/hook-Bd0yS8M0.js.map +0 -1
  413. package/lib/index-B6Re5_cx.js.map +0 -1
  414. package/lib/index-CLy1XyH0.js +0 -3919
  415. package/lib/index-CLy1XyH0.js.map +0 -1
  416. package/lib/index-ClhS5TxS.js +0 -107
  417. package/lib/index-ClhS5TxS.js.map +0 -1
  418. package/lib/index.esm-Cp4wkyud.js +0 -1236
  419. package/lib/index.esm-Cp4wkyud.js.map +0 -1
  420. package/lib/invariant-DAFpPywt.js.map +0 -1
@@ -1,1503 +0,0 @@
1
- import * as S from "react";
2
- import tt, { createContext as Rt, useContext as Et } from "react";
3
- import { j as Ct } from "./jsx-runtime-C5mzlN2N.js";
4
- import { u as x, m as j } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
5
- import { c as Ft } from "./index-DI5SPFK9.js";
6
- var $ = class {
7
- constructor() {
8
- this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
9
- }
10
- subscribe(t) {
11
- return this.listeners.add(t), this.onSubscribe(), () => {
12
- this.listeners.delete(t), this.onUnsubscribe();
13
- };
14
- }
15
- hasListeners() {
16
- return this.listeners.size > 0;
17
- }
18
- onSubscribe() {
19
- }
20
- onUnsubscribe() {
21
- }
22
- }, C = typeof window > "u" || "Deno" in globalThis;
23
- function Q() {
24
- }
25
- function be(t, e) {
26
- return typeof t == "function" ? t(e) : t;
27
- }
28
- function N(t) {
29
- return typeof t == "number" && t >= 0 && t !== 1 / 0;
30
- }
31
- function ut(t, e) {
32
- return Math.max(t + (e || 0) - Date.now(), 0);
33
- }
34
- function A(t, e) {
35
- return typeof t == "function" ? t(e) : t;
36
- }
37
- function w(t, e) {
38
- return typeof t == "function" ? t(e) : t;
39
- }
40
- function Se(t, e) {
41
- const {
42
- type: s = "all",
43
- exact: r,
44
- fetchStatus: n,
45
- predicate: i,
46
- queryKey: o,
47
- stale: a
48
- } = t;
49
- if (o) {
50
- if (r) {
51
- if (e.queryHash !== It(o, e.options))
52
- return !1;
53
- } else if (!V(e.queryKey, o))
54
- return !1;
55
- }
56
- if (s !== "all") {
57
- const u = e.isActive();
58
- if (s === "active" && !u || s === "inactive" && u)
59
- return !1;
60
- }
61
- return !(typeof a == "boolean" && e.isStale() !== a || n && n !== e.state.fetchStatus || i && !i(e));
62
- }
63
- function we(t, e) {
64
- const { exact: s, status: r, predicate: n, mutationKey: i } = t;
65
- if (i) {
66
- if (!e.options.mutationKey)
67
- return !1;
68
- if (s) {
69
- if (L(e.options.mutationKey) !== L(i))
70
- return !1;
71
- } else if (!V(e.options.mutationKey, i))
72
- return !1;
73
- }
74
- return !(r && e.state.status !== r || n && !n(e));
75
- }
76
- function It(t, e) {
77
- return (e?.queryKeyHashFn || L)(t);
78
- }
79
- function L(t) {
80
- return JSON.stringify(
81
- t,
82
- (e, s) => H(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
83
- );
84
- }
85
- function V(t, e) {
86
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => V(t[s], e[s])) : !1;
87
- }
88
- function M(t, e) {
89
- if (t === e)
90
- return t;
91
- const s = et(t) && et(e);
92
- if (s || H(t) && H(e)) {
93
- const r = s ? t : Object.keys(t), n = r.length, i = s ? e : Object.keys(e), o = i.length, a = s ? [] : {};
94
- let u = 0;
95
- for (let f = 0; f < o; f++) {
96
- const c = s ? f : i[f];
97
- (!s && r.includes(c) || s) && t[c] === void 0 && e[c] === void 0 ? (a[c] = void 0, u++) : (a[c] = M(t[c], e[c]), a[c] === t[c] && t[c] !== void 0 && u++);
98
- }
99
- return n === o && u === n ? t : a;
100
- }
101
- return e;
102
- }
103
- function _(t, e) {
104
- if (!e || Object.keys(t).length !== Object.keys(e).length)
105
- return !1;
106
- for (const s in t)
107
- if (t[s] !== e[s])
108
- return !1;
109
- return !0;
110
- }
111
- function et(t) {
112
- return Array.isArray(t) && t.length === Object.keys(t).length;
113
- }
114
- function H(t) {
115
- if (!st(t))
116
- return !1;
117
- const e = t.constructor;
118
- if (e === void 0)
119
- return !0;
120
- const s = e.prototype;
121
- return !(!st(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
122
- }
123
- function st(t) {
124
- return Object.prototype.toString.call(t) === "[object Object]";
125
- }
126
- function Pt(t) {
127
- return new Promise((e) => {
128
- setTimeout(e, t);
129
- });
130
- }
131
- function K(t, e, s) {
132
- if (typeof s.structuralSharing == "function")
133
- return s.structuralSharing(t, e);
134
- if (s.structuralSharing !== !1) {
135
- if (process.env.NODE_ENV !== "production")
136
- try {
137
- return M(t, e);
138
- } catch (r) {
139
- throw console.error(
140
- `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
141
- ), r;
142
- }
143
- return M(t, e);
144
- }
145
- return e;
146
- }
147
- function Oe(t) {
148
- return t;
149
- }
150
- function Re(t, e, s = 0) {
151
- const r = [...t, e];
152
- return s && r.length > s ? r.slice(1) : r;
153
- }
154
- function Ee(t, e, s = 0) {
155
- const r = [e, ...t];
156
- return s && r.length > s ? r.slice(0, -1) : r;
157
- }
158
- var k = Symbol();
159
- function Tt(t, e) {
160
- return process.env.NODE_ENV !== "production" && t.queryFn === k && console.error(
161
- `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
162
- ), !t.queryFn && e?.initialPromise ? () => e.initialPromise : !t.queryFn || t.queryFn === k ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
163
- }
164
- var Dt = class extends $ {
165
- #e;
166
- #t;
167
- #s;
168
- constructor() {
169
- super(), this.#s = (t) => {
170
- if (!C && window.addEventListener) {
171
- const e = () => t();
172
- return window.addEventListener("visibilitychange", e, !1), () => {
173
- window.removeEventListener("visibilitychange", e);
174
- };
175
- }
176
- };
177
- }
178
- onSubscribe() {
179
- this.#t || this.setEventListener(this.#s);
180
- }
181
- onUnsubscribe() {
182
- this.hasListeners() || (this.#t?.(), this.#t = void 0);
183
- }
184
- setEventListener(t) {
185
- this.#s = t, this.#t?.(), this.#t = t((e) => {
186
- typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
187
- });
188
- }
189
- setFocused(t) {
190
- this.#e !== t && (this.#e = t, this.onFocus());
191
- }
192
- onFocus() {
193
- const t = this.isFocused();
194
- this.listeners.forEach((e) => {
195
- e(t);
196
- });
197
- }
198
- isFocused() {
199
- return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
200
- }
201
- }, ct = new Dt(), At = class extends $ {
202
- #e = !0;
203
- #t;
204
- #s;
205
- constructor() {
206
- super(), this.#s = (t) => {
207
- if (!C && window.addEventListener) {
208
- const e = () => t(!0), s = () => t(!1);
209
- return window.addEventListener("online", e, !1), window.addEventListener("offline", s, !1), () => {
210
- window.removeEventListener("online", e), window.removeEventListener("offline", s);
211
- };
212
- }
213
- };
214
- }
215
- onSubscribe() {
216
- this.#t || this.setEventListener(this.#s);
217
- }
218
- onUnsubscribe() {
219
- this.hasListeners() || (this.#t?.(), this.#t = void 0);
220
- }
221
- setEventListener(t) {
222
- this.#s = t, this.#t?.(), this.#t = t(this.setOnline.bind(this));
223
- }
224
- setOnline(t) {
225
- this.#e !== t && (this.#e = t, this.listeners.forEach((s) => {
226
- s(t);
227
- }));
228
- }
229
- isOnline() {
230
- return this.#e;
231
- }
232
- }, ht = new At();
233
- function B() {
234
- let t, e;
235
- const s = new Promise((n, i) => {
236
- t = n, e = i;
237
- });
238
- s.status = "pending", s.catch(() => {
239
- });
240
- function r(n) {
241
- Object.assign(s, n), delete s.resolve, delete s.reject;
242
- }
243
- return s.resolve = (n) => {
244
- r({
245
- status: "fulfilled",
246
- value: n
247
- }), t(n);
248
- }, s.reject = (n) => {
249
- r({
250
- status: "rejected",
251
- reason: n
252
- }), e(n);
253
- }, s;
254
- }
255
- function kt(t) {
256
- return Math.min(1e3 * 2 ** t, 3e4);
257
- }
258
- function lt(t) {
259
- return (t ?? "online") === "online" ? ht.isOnline() : !0;
260
- }
261
- var ft = class extends Error {
262
- constructor(t) {
263
- super("CancelledError"), this.revert = t?.revert, this.silent = t?.silent;
264
- }
265
- };
266
- function q(t) {
267
- return t instanceof ft;
268
- }
269
- function xt(t) {
270
- let e = !1, s = 0, r = !1, n;
271
- const i = B(), o = (h) => {
272
- r || (l(new ft(h)), t.abort?.());
273
- }, a = () => {
274
- e = !0;
275
- }, u = () => {
276
- e = !1;
277
- }, f = () => ct.isFocused() && (t.networkMode === "always" || ht.isOnline()) && t.canRun(), c = () => lt(t.networkMode) && t.canRun(), d = (h) => {
278
- r || (r = !0, t.onSuccess?.(h), n?.(), i.resolve(h));
279
- }, l = (h) => {
280
- r || (r = !0, t.onError?.(h), n?.(), i.reject(h));
281
- }, g = () => new Promise((h) => {
282
- n = (m) => {
283
- (r || f()) && h(m);
284
- }, t.onPause?.();
285
- }).then(() => {
286
- n = void 0, r || t.onContinue?.();
287
- }), R = () => {
288
- if (r)
289
- return;
290
- let h;
291
- const m = s === 0 ? t.initialPromise : void 0;
292
- try {
293
- h = m ?? t.fn();
294
- } catch (v) {
295
- h = Promise.reject(v);
296
- }
297
- Promise.resolve(h).then(d).catch((v) => {
298
- if (r)
299
- return;
300
- const p = t.retry ?? (C ? 0 : 3), y = t.retryDelay ?? kt, E = typeof y == "function" ? y(s, v) : y, I = p === !0 || typeof p == "number" && s < p || typeof p == "function" && p(s, v);
301
- if (e || !I) {
302
- l(v);
303
- return;
304
- }
305
- s++, t.onFail?.(s, v), Pt(E).then(() => f() ? void 0 : g()).then(() => {
306
- e ? l(v) : R();
307
- });
308
- });
309
- };
310
- return {
311
- promise: i,
312
- cancel: o,
313
- continue: () => (n?.(), i),
314
- cancelRetry: a,
315
- continueRetry: u,
316
- canStart: c,
317
- start: () => (c() ? R() : g().then(R), i)
318
- };
319
- }
320
- var jt = (t) => setTimeout(t, 0);
321
- function qt() {
322
- let t = [], e = 0, s = (a) => {
323
- a();
324
- }, r = (a) => {
325
- a();
326
- }, n = jt;
327
- const i = (a) => {
328
- e ? t.push(a) : n(() => {
329
- s(a);
330
- });
331
- }, o = () => {
332
- const a = t;
333
- t = [], a.length && n(() => {
334
- r(() => {
335
- a.forEach((u) => {
336
- s(u);
337
- });
338
- });
339
- });
340
- };
341
- return {
342
- batch: (a) => {
343
- let u;
344
- e++;
345
- try {
346
- u = a();
347
- } finally {
348
- e--, e || o();
349
- }
350
- return u;
351
- },
352
- /**
353
- * All calls to the wrapped function will be batched.
354
- */
355
- batchCalls: (a) => (...u) => {
356
- i(() => {
357
- a(...u);
358
- });
359
- },
360
- schedule: i,
361
- /**
362
- * Use this method to set a custom notify function.
363
- * This can be used to for example wrap notifications with `React.act` while running tests.
364
- */
365
- setNotifyFunction: (a) => {
366
- s = a;
367
- },
368
- /**
369
- * Use this method to set a custom function to batch notifications together into a single tick.
370
- * By default React Query will use the batch function provided by ReactDOM or React Native.
371
- */
372
- setBatchNotifyFunction: (a) => {
373
- r = a;
374
- },
375
- setScheduler: (a) => {
376
- n = a;
377
- }
378
- };
379
- }
380
- var J = qt(), Ut = class {
381
- #e;
382
- destroy() {
383
- this.clearGcTimeout();
384
- }
385
- scheduleGc() {
386
- this.clearGcTimeout(), N(this.gcTime) && (this.#e = setTimeout(() => {
387
- this.optionalRemove();
388
- }, this.gcTime));
389
- }
390
- updateGcTime(t) {
391
- this.gcTime = Math.max(
392
- this.gcTime || 0,
393
- t ?? (C ? 1 / 0 : 5 * 60 * 1e3)
394
- );
395
- }
396
- clearGcTimeout() {
397
- this.#e && (clearTimeout(this.#e), this.#e = void 0);
398
- }
399
- }, Ce = class extends Ut {
400
- #e;
401
- #t;
402
- #s;
403
- #n;
404
- #r;
405
- #o;
406
- #a;
407
- constructor(t) {
408
- super(), this.#a = !1, this.#o = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#n = t.client, this.#s = this.#n.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#e = Qt(this.options), this.state = t.state ?? this.#e, this.scheduleGc();
409
- }
410
- get meta() {
411
- return this.options.meta;
412
- }
413
- get promise() {
414
- return this.#r?.promise;
415
- }
416
- setOptions(t) {
417
- this.options = { ...this.#o, ...t }, this.updateGcTime(this.options.gcTime);
418
- }
419
- optionalRemove() {
420
- !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
421
- }
422
- setData(t, e) {
423
- const s = K(this.state.data, t, this.options);
424
- return this.#i({
425
- data: s,
426
- type: "success",
427
- dataUpdatedAt: e?.updatedAt,
428
- manual: e?.manual
429
- }), s;
430
- }
431
- setState(t, e) {
432
- this.#i({ type: "setState", state: t, setStateOptions: e });
433
- }
434
- cancel(t) {
435
- const e = this.#r?.promise;
436
- return this.#r?.cancel(t), e ? e.then(Q).catch(Q) : Promise.resolve();
437
- }
438
- destroy() {
439
- super.destroy(), this.cancel({ silent: !0 });
440
- }
441
- reset() {
442
- this.destroy(), this.setState(this.#e);
443
- }
444
- isActive() {
445
- return this.observers.some(
446
- (t) => w(t.options.enabled, this) !== !1
447
- );
448
- }
449
- isDisabled() {
450
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === k || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
451
- }
452
- isStale() {
453
- return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
454
- (t) => t.getCurrentResult().isStale
455
- ) : this.state.data === void 0;
456
- }
457
- isStaleByTime(t = 0) {
458
- return this.state.isInvalidated || this.state.data === void 0 || !ut(this.state.dataUpdatedAt, t);
459
- }
460
- onFocus() {
461
- this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
462
- }
463
- onOnline() {
464
- this.observers.find((e) => e.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
465
- }
466
- addObserver(t) {
467
- this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.#s.notify({ type: "observerAdded", query: this, observer: t }));
468
- }
469
- removeObserver(t) {
470
- this.observers.includes(t) && (this.observers = this.observers.filter((e) => e !== t), this.observers.length || (this.#r && (this.#a ? this.#r.cancel({ revert: !0 }) : this.#r.cancelRetry()), this.scheduleGc()), this.#s.notify({ type: "observerRemoved", query: this, observer: t }));
471
- }
472
- getObserversCount() {
473
- return this.observers.length;
474
- }
475
- invalidate() {
476
- this.state.isInvalidated || this.#i({ type: "invalidate" });
477
- }
478
- fetch(t, e) {
479
- if (this.state.fetchStatus !== "idle") {
480
- if (this.state.data !== void 0 && e?.cancelRefetch)
481
- this.cancel({ silent: !0 });
482
- else if (this.#r)
483
- return this.#r.continueRetry(), this.#r.promise;
484
- }
485
- if (t && this.setOptions(t), !this.options.queryFn) {
486
- const a = this.observers.find((u) => u.options.queryFn);
487
- a && this.setOptions(a.options);
488
- }
489
- process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
490
- "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
491
- ));
492
- const s = new AbortController(), r = (a) => {
493
- Object.defineProperty(a, "signal", {
494
- enumerable: !0,
495
- get: () => (this.#a = !0, s.signal)
496
- });
497
- }, n = () => {
498
- const a = Tt(this.options, e), u = {
499
- client: this.#n,
500
- queryKey: this.queryKey,
501
- meta: this.meta
502
- };
503
- return r(u), this.#a = !1, this.options.persister ? this.options.persister(
504
- a,
505
- u,
506
- this
507
- ) : a(u);
508
- }, i = {
509
- fetchOptions: e,
510
- options: this.options,
511
- queryKey: this.queryKey,
512
- client: this.#n,
513
- state: this.state,
514
- fetchFn: n
515
- };
516
- r(i), this.options.behavior?.onFetch(
517
- i,
518
- this
519
- ), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== i.fetchOptions?.meta) && this.#i({ type: "fetch", meta: i.fetchOptions?.meta });
520
- const o = (a) => {
521
- q(a) && a.silent || this.#i({
522
- type: "error",
523
- error: a
524
- }), q(a) || (this.#s.config.onError?.(
525
- a,
526
- this
527
- ), this.#s.config.onSettled?.(
528
- this.state.data,
529
- a,
530
- this
531
- )), this.scheduleGc();
532
- };
533
- return this.#r = xt({
534
- initialPromise: e?.initialPromise,
535
- fn: i.fetchFn,
536
- abort: s.abort.bind(s),
537
- onSuccess: (a) => {
538
- if (a === void 0) {
539
- process.env.NODE_ENV !== "production" && console.error(
540
- `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
541
- ), o(new Error(`${this.queryHash} data is undefined`));
542
- return;
543
- }
544
- try {
545
- this.setData(a);
546
- } catch (u) {
547
- o(u);
548
- return;
549
- }
550
- this.#s.config.onSuccess?.(a, this), this.#s.config.onSettled?.(
551
- a,
552
- this.state.error,
553
- this
554
- ), this.scheduleGc();
555
- },
556
- onError: o,
557
- onFail: (a, u) => {
558
- this.#i({ type: "failed", failureCount: a, error: u });
559
- },
560
- onPause: () => {
561
- this.#i({ type: "pause" });
562
- },
563
- onContinue: () => {
564
- this.#i({ type: "continue" });
565
- },
566
- retry: i.options.retry,
567
- retryDelay: i.options.retryDelay,
568
- networkMode: i.options.networkMode,
569
- canRun: () => !0
570
- }), this.#r.start();
571
- }
572
- #i(t) {
573
- const e = (s) => {
574
- switch (t.type) {
575
- case "failed":
576
- return {
577
- ...s,
578
- fetchFailureCount: t.failureCount,
579
- fetchFailureReason: t.error
580
- };
581
- case "pause":
582
- return {
583
- ...s,
584
- fetchStatus: "paused"
585
- };
586
- case "continue":
587
- return {
588
- ...s,
589
- fetchStatus: "fetching"
590
- };
591
- case "fetch":
592
- return {
593
- ...s,
594
- ...dt(s.data, this.options),
595
- fetchMeta: t.meta ?? null
596
- };
597
- case "success":
598
- return {
599
- ...s,
600
- data: t.data,
601
- dataUpdateCount: s.dataUpdateCount + 1,
602
- dataUpdatedAt: t.dataUpdatedAt ?? Date.now(),
603
- error: null,
604
- isInvalidated: !1,
605
- status: "success",
606
- ...!t.manual && {
607
- fetchStatus: "idle",
608
- fetchFailureCount: 0,
609
- fetchFailureReason: null
610
- }
611
- };
612
- case "error":
613
- const r = t.error;
614
- return q(r) && r.revert && this.#t ? { ...this.#t, fetchStatus: "idle" } : {
615
- ...s,
616
- error: r,
617
- errorUpdateCount: s.errorUpdateCount + 1,
618
- errorUpdatedAt: Date.now(),
619
- fetchFailureCount: s.fetchFailureCount + 1,
620
- fetchFailureReason: r,
621
- fetchStatus: "idle",
622
- status: "error"
623
- };
624
- case "invalidate":
625
- return {
626
- ...s,
627
- isInvalidated: !0
628
- };
629
- case "setState":
630
- return {
631
- ...s,
632
- ...t.state
633
- };
634
- }
635
- };
636
- this.state = e(this.state), J.batch(() => {
637
- this.observers.forEach((s) => {
638
- s.onQueryUpdate();
639
- }), this.#s.notify({ query: this, type: "updated", action: t });
640
- });
641
- }
642
- };
643
- function dt(t, e) {
644
- return {
645
- fetchFailureCount: 0,
646
- fetchFailureReason: null,
647
- fetchStatus: lt(e.networkMode) ? "fetching" : "paused",
648
- ...t === void 0 && {
649
- error: null,
650
- status: "pending"
651
- }
652
- };
653
- }
654
- function Qt(t) {
655
- const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
656
- return {
657
- data: e,
658
- dataUpdateCount: 0,
659
- dataUpdatedAt: s ? r ?? Date.now() : 0,
660
- error: null,
661
- errorUpdateCount: 0,
662
- errorUpdatedAt: 0,
663
- fetchFailureCount: 0,
664
- fetchFailureReason: null,
665
- fetchMeta: null,
666
- isInvalidated: !1,
667
- status: s ? "success" : "pending",
668
- fetchStatus: "idle"
669
- };
670
- }
671
- var pt = class extends $ {
672
- constructor(t, e) {
673
- super(), this.options = e, this.#e = t, this.#i = null, this.#a = B(), this.options.experimental_prefetchInRender || this.#a.reject(
674
- new Error("experimental_prefetchInRender feature flag is not enabled")
675
- ), this.bindMethods(), this.setOptions(e);
676
- }
677
- #e;
678
- #t = void 0;
679
- #s = void 0;
680
- #n = void 0;
681
- #r;
682
- #o;
683
- #a;
684
- #i;
685
- #y;
686
- #f;
687
- // This property keeps track of the last query with defined data.
688
- // It will be used to pass the previous data and query to the placeholder function between renders.
689
- #d;
690
- #c;
691
- #h;
692
- #u;
693
- #p = /* @__PURE__ */ new Set();
694
- bindMethods() {
695
- this.refetch = this.refetch.bind(this);
696
- }
697
- onSubscribe() {
698
- this.listeners.size === 1 && (this.#t.addObserver(this), rt(this.#t, this.options) ? this.#l() : this.updateResult(), this.#b());
699
- }
700
- onUnsubscribe() {
701
- this.hasListeners() || this.destroy();
702
- }
703
- shouldFetchOnReconnect() {
704
- return G(
705
- this.#t,
706
- this.options,
707
- this.options.refetchOnReconnect
708
- );
709
- }
710
- shouldFetchOnWindowFocus() {
711
- return G(
712
- this.#t,
713
- this.options,
714
- this.options.refetchOnWindowFocus
715
- );
716
- }
717
- destroy() {
718
- this.listeners = /* @__PURE__ */ new Set(), this.#S(), this.#w(), this.#t.removeObserver(this);
719
- }
720
- setOptions(t) {
721
- const e = this.options, s = this.#t;
722
- if (this.options = this.#e.defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof w(this.options.enabled, this.#t) != "boolean")
723
- throw new Error(
724
- "Expected enabled to be a boolean or a callback that returns a boolean"
725
- );
726
- this.#O(), this.#t.setOptions(this.options), e._defaulted && !_(this.options, e) && this.#e.getQueryCache().notify({
727
- type: "observerOptionsUpdated",
728
- query: this.#t,
729
- observer: this
730
- });
731
- const r = this.hasListeners();
732
- r && nt(
733
- this.#t,
734
- s,
735
- this.options,
736
- e
737
- ) && this.#l(), this.updateResult(), r && (this.#t !== s || w(this.options.enabled, this.#t) !== w(e.enabled, this.#t) || A(this.options.staleTime, this.#t) !== A(e.staleTime, this.#t)) && this.#v();
738
- const n = this.#g();
739
- r && (this.#t !== s || w(this.options.enabled, this.#t) !== w(e.enabled, this.#t) || n !== this.#u) && this.#m(n);
740
- }
741
- getOptimisticResult(t) {
742
- const e = this.#e.getQueryCache().build(this.#e, t), s = this.createResult(e, t);
743
- return Lt(this, s) && (this.#n = s, this.#o = this.options, this.#r = this.#t.state), s;
744
- }
745
- getCurrentResult() {
746
- return this.#n;
747
- }
748
- trackResult(t, e) {
749
- const s = {};
750
- return Object.keys(t).forEach((r) => {
751
- Object.defineProperty(s, r, {
752
- configurable: !1,
753
- enumerable: !0,
754
- get: () => (this.trackProp(r), e?.(r), t[r])
755
- });
756
- }), s;
757
- }
758
- trackProp(t) {
759
- this.#p.add(t);
760
- }
761
- getCurrentQuery() {
762
- return this.#t;
763
- }
764
- refetch({ ...t } = {}) {
765
- return this.fetch({
766
- ...t
767
- });
768
- }
769
- fetchOptimistic(t) {
770
- const e = this.#e.defaultQueryOptions(t), s = this.#e.getQueryCache().build(this.#e, e);
771
- return s.fetch().then(() => this.createResult(s, e));
772
- }
773
- fetch(t) {
774
- return this.#l({
775
- ...t,
776
- cancelRefetch: t.cancelRefetch ?? !0
777
- }).then(() => (this.updateResult(), this.#n));
778
- }
779
- #l(t) {
780
- this.#O();
781
- let e = this.#t.fetch(
782
- this.options,
783
- t
784
- );
785
- return t?.throwOnError || (e = e.catch(Q)), e;
786
- }
787
- #v() {
788
- this.#S();
789
- const t = A(
790
- this.options.staleTime,
791
- this.#t
792
- );
793
- if (C || this.#n.isStale || !N(t))
794
- return;
795
- const s = ut(this.#n.dataUpdatedAt, t) + 1;
796
- this.#c = setTimeout(() => {
797
- this.#n.isStale || this.updateResult();
798
- }, s);
799
- }
800
- #g() {
801
- return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
802
- }
803
- #m(t) {
804
- this.#w(), this.#u = t, !(C || w(this.options.enabled, this.#t) === !1 || !N(this.#u) || this.#u === 0) && (this.#h = setInterval(() => {
805
- (this.options.refetchIntervalInBackground || ct.isFocused()) && this.#l();
806
- }, this.#u));
807
- }
808
- #b() {
809
- this.#v(), this.#m(this.#g());
810
- }
811
- #S() {
812
- this.#c && (clearTimeout(this.#c), this.#c = void 0);
813
- }
814
- #w() {
815
- this.#h && (clearInterval(this.#h), this.#h = void 0);
816
- }
817
- createResult(t, e) {
818
- const s = this.#t, r = this.options, n = this.#n, i = this.#r, o = this.#o, u = t !== s ? t.state : this.#s, { state: f } = t;
819
- let c = { ...f }, d = !1, l;
820
- if (e._optimisticResults) {
821
- const b = this.hasListeners(), T = !b && rt(t, e), P = b && nt(t, s, e, r);
822
- (T || P) && (c = {
823
- ...c,
824
- ...dt(f.data, t.options)
825
- }), e._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
826
- }
827
- let { error: g, errorUpdatedAt: R, status: h } = c;
828
- l = c.data;
829
- let m = !1;
830
- if (e.placeholderData !== void 0 && l === void 0 && h === "pending") {
831
- let b;
832
- n?.isPlaceholderData && e.placeholderData === o?.placeholderData ? (b = n.data, m = !0) : b = typeof e.placeholderData == "function" ? e.placeholderData(
833
- this.#d?.state.data,
834
- this.#d
835
- ) : e.placeholderData, b !== void 0 && (h = "success", l = K(
836
- n?.data,
837
- b,
838
- e
839
- ), d = !0);
840
- }
841
- if (e.select && l !== void 0 && !m)
842
- if (n && l === i?.data && e.select === this.#y)
843
- l = this.#f;
844
- else
845
- try {
846
- this.#y = e.select, l = e.select(l), l = K(n?.data, l, e), this.#f = l, this.#i = null;
847
- } catch (b) {
848
- this.#i = b;
849
- }
850
- this.#i && (g = this.#i, l = this.#f, R = Date.now(), h = "error");
851
- const v = c.fetchStatus === "fetching", p = h === "pending", y = h === "error", E = p && v, I = l !== void 0, O = {
852
- status: h,
853
- fetchStatus: c.fetchStatus,
854
- isPending: p,
855
- isSuccess: h === "success",
856
- isError: y,
857
- isInitialLoading: E,
858
- isLoading: E,
859
- data: l,
860
- dataUpdatedAt: c.dataUpdatedAt,
861
- error: g,
862
- errorUpdatedAt: R,
863
- failureCount: c.fetchFailureCount,
864
- failureReason: c.fetchFailureReason,
865
- errorUpdateCount: c.errorUpdateCount,
866
- isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
867
- isFetchedAfterMount: c.dataUpdateCount > u.dataUpdateCount || c.errorUpdateCount > u.errorUpdateCount,
868
- isFetching: v,
869
- isRefetching: v && !p,
870
- isLoadingError: y && !I,
871
- isPaused: c.fetchStatus === "paused",
872
- isPlaceholderData: d,
873
- isRefetchError: y && I,
874
- isStale: Z(t, e),
875
- refetch: this.refetch,
876
- promise: this.#a
877
- };
878
- if (this.options.experimental_prefetchInRender) {
879
- const b = (D) => {
880
- O.status === "error" ? D.reject(O.error) : O.data !== void 0 && D.resolve(O.data);
881
- }, T = () => {
882
- const D = this.#a = O.promise = B();
883
- b(D);
884
- }, P = this.#a;
885
- switch (P.status) {
886
- case "pending":
887
- t.queryHash === s.queryHash && b(P);
888
- break;
889
- case "fulfilled":
890
- (O.status === "error" || O.data !== P.value) && T();
891
- break;
892
- case "rejected":
893
- (O.status !== "error" || O.error !== P.reason) && T();
894
- break;
895
- }
896
- }
897
- return O;
898
- }
899
- updateResult() {
900
- const t = this.#n, e = this.createResult(this.#t, this.options);
901
- if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t), _(e, t))
902
- return;
903
- this.#n = e;
904
- const s = () => {
905
- if (!t)
906
- return !0;
907
- const { notifyOnChangeProps: r } = this.options, n = typeof r == "function" ? r() : r;
908
- if (n === "all" || !n && !this.#p.size)
909
- return !0;
910
- const i = new Set(
911
- n ?? this.#p
912
- );
913
- return this.options.throwOnError && i.add("error"), Object.keys(this.#n).some((o) => {
914
- const a = o;
915
- return this.#n[a] !== t[a] && i.has(a);
916
- });
917
- };
918
- this.#R({ listeners: s() });
919
- }
920
- #O() {
921
- const t = this.#e.getQueryCache().build(this.#e, this.options);
922
- if (t === this.#t)
923
- return;
924
- const e = this.#t;
925
- this.#t = t, this.#s = t.state, this.hasListeners() && (e?.removeObserver(this), t.addObserver(this));
926
- }
927
- onQueryUpdate() {
928
- this.updateResult(), this.hasListeners() && this.#b();
929
- }
930
- #R(t) {
931
- J.batch(() => {
932
- t.listeners && this.listeners.forEach((e) => {
933
- e(this.#n);
934
- }), this.#e.getQueryCache().notify({
935
- query: this.#t,
936
- type: "observerResultsUpdated"
937
- });
938
- });
939
- }
940
- };
941
- function Nt(t, e) {
942
- return w(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
943
- }
944
- function rt(t, e) {
945
- return Nt(t, e) || t.state.data !== void 0 && G(t, e, e.refetchOnMount);
946
- }
947
- function G(t, e, s) {
948
- if (w(e.enabled, t) !== !1) {
949
- const r = typeof s == "function" ? s(t) : s;
950
- return r === "always" || r !== !1 && Z(t, e);
951
- }
952
- return !1;
953
- }
954
- function nt(t, e, s, r) {
955
- return (t !== e || w(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Z(t, s);
956
- }
957
- function Z(t, e) {
958
- return w(e.enabled, t) !== !1 && t.isStaleByTime(A(e.staleTime, t));
959
- }
960
- function Lt(t, e) {
961
- return !_(t.getCurrentResult(), e);
962
- }
963
- var yt = S.createContext(
964
- void 0
965
- ), vt = (t) => {
966
- const e = S.useContext(yt);
967
- if (t)
968
- return t;
969
- if (!e)
970
- throw new Error("No QueryClient set, use QueryClientProvider to set one");
971
- return e;
972
- }, Fe = ({
973
- client: t,
974
- children: e
975
- }) => (S.useEffect(() => (t.mount(), () => {
976
- t.unmount();
977
- }), [t]), /* @__PURE__ */ Ct.jsx(yt.Provider, { value: t, children: e })), gt = S.createContext(!1), Mt = () => S.useContext(gt);
978
- gt.Provider;
979
- function _t() {
980
- let t = !1;
981
- return {
982
- clearReset: () => {
983
- t = !1;
984
- },
985
- reset: () => {
986
- t = !0;
987
- },
988
- isReset: () => t
989
- };
990
- }
991
- var Ht = S.createContext(_t()), Kt = () => S.useContext(Ht);
992
- function Bt(t, e) {
993
- return typeof t == "function" ? t(...e) : !!t;
994
- }
995
- function it() {
996
- }
997
- var Gt = (t, e) => {
998
- (t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
999
- }, zt = (t) => {
1000
- S.useEffect(() => {
1001
- t.clearReset();
1002
- }, [t]);
1003
- }, $t = ({
1004
- result: t,
1005
- errorResetBoundary: e,
1006
- throwOnError: s,
1007
- query: r,
1008
- suspense: n
1009
- }) => t.isError && !e.isReset() && !t.isFetching && r && (n && t.data === void 0 || Bt(s, [t.error, r])), Vt = (t, e) => e.state.data === void 0, Jt = (t) => {
1010
- const e = t.staleTime;
1011
- t.suspense && (t.staleTime = typeof e == "function" ? (...s) => Math.max(e(...s), 1e3) : Math.max(e ?? 1e3, 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
1012
- }, Zt = (t, e) => t.isLoading && t.isFetching && !e, Wt = (t, e) => t?.suspense && e.isPending, at = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1013
- s.clearReset();
1014
- });
1015
- function mt(t, e, s) {
1016
- if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1017
- throw new Error(
1018
- 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
1019
- );
1020
- const r = vt(s), n = Mt(), i = Kt(), o = r.defaultQueryOptions(t);
1021
- r.getDefaultOptions().queries?._experimental_beforeQuery?.(
1022
- o
1023
- ), process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
1024
- `[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
1025
- )), o._optimisticResults = n ? "isRestoring" : "optimistic", Jt(o), Gt(o, i), zt(i);
1026
- const a = !r.getQueryCache().get(o.queryHash), [u] = S.useState(
1027
- () => new e(
1028
- r,
1029
- o
1030
- )
1031
- ), f = u.getOptimisticResult(o), c = !n && t.subscribed !== !1;
1032
- if (S.useSyncExternalStore(
1033
- S.useCallback(
1034
- (d) => {
1035
- const l = c ? u.subscribe(J.batchCalls(d)) : it;
1036
- return u.updateResult(), l;
1037
- },
1038
- [u, c]
1039
- ),
1040
- () => u.getCurrentResult(),
1041
- () => u.getCurrentResult()
1042
- ), S.useEffect(() => {
1043
- u.setOptions(o);
1044
- }, [o, u]), Wt(o, f))
1045
- throw at(o, u, i);
1046
- if ($t({
1047
- result: f,
1048
- errorResetBoundary: i,
1049
- throwOnError: o.throwOnError,
1050
- query: r.getQueryCache().get(o.queryHash),
1051
- suspense: o.suspense
1052
- }))
1053
- throw f.error;
1054
- return r.getDefaultOptions().queries?._experimental_afterQuery?.(
1055
- o,
1056
- f
1057
- ), o.experimental_prefetchInRender && !C && Zt(f, n) && (a ? (
1058
- // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1059
- at(o, u, i)
1060
- ) : (
1061
- // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1062
- r.getQueryCache().get(o.queryHash)?.promise
1063
- ))?.catch(it).finally(() => {
1064
- u.updateResult();
1065
- }), o.notifyOnChangeProps ? f : u.trackResult(f);
1066
- }
1067
- function Yt(t, e) {
1068
- return mt(t, pt, e);
1069
- }
1070
- function Xt(t, e) {
1071
- return process.env.NODE_ENV !== "production" && t.queryFn === k && console.error("skipToken is not allowed for useSuspenseQuery"), mt(
1072
- {
1073
- ...t,
1074
- enabled: !0,
1075
- suspense: !0,
1076
- throwOnError: Vt,
1077
- placeholderData: void 0
1078
- },
1079
- pt,
1080
- e
1081
- );
1082
- }
1083
- const te = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, ee = (t) => t.filter(
1084
- (e) => e != null && e !== !1 && (typeof e == "string" || typeof e == "number")
1085
- ).map((e) => `${e}`).filter((e) => e), se = (t) => {
1086
- const e = t.join("/"), [, s = "", r = ""] = e.match(te) ?? [];
1087
- return {
1088
- prefix: s,
1089
- pathname: r.split("/").filter((n) => n !== "")
1090
- };
1091
- }, re = (t) => {
1092
- const { prefix: e, pathname: s } = t;
1093
- let r = e;
1094
- return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
1095
- }, F = (...t) => {
1096
- const e = ee(t), s = se(e);
1097
- return re(s);
1098
- }, bt = Object.freeze({
1099
- API_IDENTITIES: ["api-identities"]
1100
- }), Ie = () => {
1101
- const t = vt();
1102
- return {
1103
- invalidateCache: async (e) => {
1104
- await t.invalidateQueries({ queryKey: bt[e] });
1105
- }
1106
- };
1107
- }, Pe = "no-dehydrate", W = (t, e) => {
1108
- for (const s of t) {
1109
- const r = Y(s, e);
1110
- if (r !== void 0) return r;
1111
- }
1112
- }, Y = (t, e, s = []) => {
1113
- const r = e(t, s);
1114
- if (r !== void 0) return r;
1115
- if (t.type === "category")
1116
- for (const n of t.items) {
1117
- const i = Y(n, e, [
1118
- ...s,
1119
- t
1120
- ]);
1121
- if (i !== void 0) return i;
1122
- }
1123
- }, Te = () => {
1124
- const t = x(), { navigation: e } = St();
1125
- return W(e, (s) => {
1126
- if (s.type === "doc" && F(s.path) === t.pathname)
1127
- return s;
1128
- });
1129
- }, De = (t) => {
1130
- const e = x();
1131
- return Y(t, (s) => {
1132
- if (s.type === "category" && s.link && F(s.link.path) === e.pathname || s.type === "doc" && F(s.path) === e.pathname)
1133
- return !0;
1134
- });
1135
- }, Ae = () => {
1136
- const t = x().pathname, { navigation: e } = St();
1137
- let s, r, n = !1;
1138
- return W(e, (i) => {
1139
- const o = i.type === "doc" ? F(i.path) : i.type === "category" && i.link ? F(i.link.path) : void 0;
1140
- if (o) {
1141
- if (n)
1142
- return r = { label: i.label, id: o }, !0;
1143
- t === o ? n = !0 : s = { label: i.label, id: o };
1144
- }
1145
- }), { prev: s, next: r };
1146
- }, ke = Ft(
1147
- "relative flex items-center gap-2 px-(--padding-nav-item) my-0.5 py-1.5 rounded-lg hover:bg-accent tabular-nums",
1148
- {
1149
- variants: {
1150
- isActive: {
1151
- true: "bg-accent font-medium",
1152
- false: "text-foreground/80"
1153
- },
1154
- isMuted: {
1155
- true: "text-foreground/30",
1156
- false: ""
1157
- },
1158
- isPending: {
1159
- true: "bg-accent animate-pulse",
1160
- false: ""
1161
- }
1162
- },
1163
- defaultVariants: {
1164
- isActive: !1
1165
- }
1166
- }
1167
- ), xe = (t) => (e) => e.display === "hide" || !e.label ? !1 : e.display === "auth" && t || e.display === "anon" && !t || !e.display || e.display === "always", ne = Rt(
1168
- void 0
1169
- ), X = () => {
1170
- const t = Et(ne);
1171
- if (!t)
1172
- throw new Error("useZudoku must be used within a ZudokuProvider.");
1173
- return t;
1174
- }, je = () => {
1175
- const { getApiIdentities: t } = X();
1176
- return Yt({
1177
- queryFn: t,
1178
- queryKey: bt.API_IDENTITIES
1179
- });
1180
- }, U = (t) => {
1181
- switch (t.type) {
1182
- case "doc":
1183
- return F(t.path);
1184
- case "category":
1185
- return t.link ? F(t.link.path) : void 0;
1186
- case "link":
1187
- return t.to;
1188
- case "custom-page":
1189
- return t.path;
1190
- default:
1191
- return;
1192
- }
1193
- }, St = () => {
1194
- const { getPluginNavigation: t, navigation: e, options: s } = X(), r = x(), n = de(), i = s.protectedRoutes?.some(
1195
- (c) => j(c, r.pathname)
1196
- ), o = W(e, (c, d) => {
1197
- if (U(c) === r.pathname)
1198
- return d.at(0) ?? c;
1199
- }), { data: a } = Xt({
1200
- queryFn: () => t(r.pathname),
1201
- queryKey: ["plugin-navigation", r.pathname]
1202
- });
1203
- let u = o;
1204
- if (!o && a.length > 0) {
1205
- const c = a.flatMap((d) => U(d)?.split("?").at(0)?.split("#").at(0) ?? []);
1206
- u = e.flatMap((d) => {
1207
- const l = U(d);
1208
- return l ? [{ item: d, path: l }] : [];
1209
- }).sort((d, l) => l.path.length - d.path.length).find(({ path: d }) => c.some(
1210
- (l) => j({ path: d, end: !1 }, l) ?? j({ path: l, end: !1 }, d)
1211
- ))?.item;
1212
- }
1213
- return {
1214
- navigation: n.isAuthEnabled && !n.isAuthenticated && i ? [] : [...o?.type === "category" ? o.items : [], ...a],
1215
- topNavItem: u
1216
- };
1217
- }, ot = (t) => {
1218
- let e;
1219
- const s = /* @__PURE__ */ new Set(), r = (f, c) => {
1220
- const d = typeof f == "function" ? f(e) : f;
1221
- if (!Object.is(d, e)) {
1222
- const l = e;
1223
- e = c ?? (typeof d != "object" || d === null) ? d : Object.assign({}, e, d), s.forEach((g) => g(e, l));
1224
- }
1225
- }, n = () => e, a = { setState: r, getState: n, getInitialState: () => u, subscribe: (f) => (s.add(f), () => s.delete(f)) }, u = e = t(r, n, a);
1226
- return a;
1227
- }, ie = (t) => t ? ot(t) : ot, ae = (t) => t;
1228
- function oe(t, e = ae) {
1229
- const s = tt.useSyncExternalStore(
1230
- t.subscribe,
1231
- () => e(t.getState()),
1232
- () => e(t.getInitialState())
1233
- );
1234
- return tt.useDebugValue(s), s;
1235
- }
1236
- const ue = (t) => {
1237
- const e = ie(t), s = (r) => oe(e, r);
1238
- return Object.assign(s, e), s;
1239
- }, ce = (t) => ue;
1240
- function wt(t, e) {
1241
- let s;
1242
- try {
1243
- s = t();
1244
- } catch {
1245
- return;
1246
- }
1247
- return {
1248
- getItem: (n) => {
1249
- var i;
1250
- const o = (u) => u === null ? null : JSON.parse(u, void 0), a = (i = s.getItem(n)) != null ? i : null;
1251
- return a instanceof Promise ? a.then(o) : o(a);
1252
- },
1253
- setItem: (n, i) => s.setItem(n, JSON.stringify(i, void 0)),
1254
- removeItem: (n) => s.removeItem(n)
1255
- };
1256
- }
1257
- const z = (t) => (e) => {
1258
- try {
1259
- const s = t(e);
1260
- return s instanceof Promise ? s : {
1261
- then(r) {
1262
- return z(r)(s);
1263
- },
1264
- catch(r) {
1265
- return this;
1266
- }
1267
- };
1268
- } catch (s) {
1269
- return {
1270
- then(r) {
1271
- return this;
1272
- },
1273
- catch(r) {
1274
- return z(r)(s);
1275
- }
1276
- };
1277
- }
1278
- }, he = (t, e) => (s, r, n) => {
1279
- let i = {
1280
- storage: wt(() => localStorage),
1281
- partialize: (h) => h,
1282
- version: 0,
1283
- merge: (h, m) => ({
1284
- ...m,
1285
- ...h
1286
- }),
1287
- ...e
1288
- }, o = !1;
1289
- const a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
1290
- let f = i.storage;
1291
- if (!f)
1292
- return t(
1293
- (...h) => {
1294
- console.warn(
1295
- `[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`
1296
- ), s(...h);
1297
- },
1298
- r,
1299
- n
1300
- );
1301
- const c = () => {
1302
- const h = i.partialize({ ...r() });
1303
- return f.setItem(i.name, {
1304
- state: h,
1305
- version: i.version
1306
- });
1307
- }, d = n.setState;
1308
- n.setState = (h, m) => {
1309
- d(h, m), c();
1310
- };
1311
- const l = t(
1312
- (...h) => {
1313
- s(...h), c();
1314
- },
1315
- r,
1316
- n
1317
- );
1318
- n.getInitialState = () => l;
1319
- let g;
1320
- const R = () => {
1321
- var h, m;
1322
- if (!f) return;
1323
- o = !1, a.forEach((p) => {
1324
- var y;
1325
- return p((y = r()) != null ? y : l);
1326
- });
1327
- const v = ((m = i.onRehydrateStorage) == null ? void 0 : m.call(i, (h = r()) != null ? h : l)) || void 0;
1328
- return z(f.getItem.bind(f))(i.name).then((p) => {
1329
- if (p)
1330
- if (typeof p.version == "number" && p.version !== i.version) {
1331
- if (i.migrate) {
1332
- const y = i.migrate(
1333
- p.state,
1334
- p.version
1335
- );
1336
- return y instanceof Promise ? y.then((E) => [!0, E]) : [!0, y];
1337
- }
1338
- console.error(
1339
- "State loaded from storage couldn't be migrated since no migrate function was provided"
1340
- );
1341
- } else
1342
- return [!1, p.state];
1343
- return [!1, void 0];
1344
- }).then((p) => {
1345
- var y;
1346
- const [E, I] = p;
1347
- if (g = i.merge(
1348
- I,
1349
- (y = r()) != null ? y : l
1350
- ), s(g, !0), E)
1351
- return c();
1352
- }).then(() => {
1353
- v?.(g, void 0), g = r(), o = !0, u.forEach((p) => p(g));
1354
- }).catch((p) => {
1355
- v?.(void 0, p);
1356
- });
1357
- };
1358
- return n.persist = {
1359
- setOptions: (h) => {
1360
- i = {
1361
- ...i,
1362
- ...h
1363
- }, h.storage && (f = h.storage);
1364
- },
1365
- clearStorage: () => {
1366
- f?.removeItem(i.name);
1367
- },
1368
- getOptions: () => i,
1369
- rehydrate: () => R(),
1370
- hasHydrated: () => o,
1371
- onHydrate: (h) => (a.add(h), () => {
1372
- a.delete(h);
1373
- }),
1374
- onFinishHydration: (h) => (u.add(h), () => {
1375
- u.delete(h);
1376
- })
1377
- }, i.skipHydration || R(), g || l;
1378
- }, le = he, fe = (t) => {
1379
- const e = (s) => {
1380
- s.key === t.persist.getOptions().name && s.newValue && t.persist.rehydrate();
1381
- };
1382
- return window.addEventListener("storage", e), () => {
1383
- window.removeEventListener("storage", e);
1384
- };
1385
- }, Ot = ce()(
1386
- le(
1387
- (t) => ({
1388
- isAuthenticated: !1,
1389
- isPending: !0,
1390
- profile: null,
1391
- providerData: null,
1392
- setAuthenticationPending: () => t(() => ({
1393
- isAuthenticated: !1,
1394
- isPending: !1,
1395
- profile: null,
1396
- providerData: null
1397
- })),
1398
- setLoggedOut: () => t(() => ({
1399
- isAuthenticated: !1,
1400
- isPending: !1,
1401
- profile: null,
1402
- providerData: null
1403
- })),
1404
- setLoggedIn: ({
1405
- profile: e,
1406
- providerData: s
1407
- }) => t(() => ({
1408
- isAuthenticated: !0,
1409
- isPending: !1,
1410
- profile: e,
1411
- providerData: s
1412
- }))
1413
- }),
1414
- {
1415
- merge: (t, e) => ({
1416
- ...e,
1417
- isPending: !1,
1418
- ...typeof t == "object" ? t : {}
1419
- }),
1420
- name: "auth-state",
1421
- storage: wt(() => localStorage)
1422
- }
1423
- )
1424
- );
1425
- typeof window < "u" && fe(Ot);
1426
- const de = () => {
1427
- const { authentication: t } = X(), e = Ot(), s = typeof t < "u";
1428
- return {
1429
- isAuthEnabled: s,
1430
- ...e,
1431
- login: async () => {
1432
- if (!s)
1433
- throw new Error("Authentication is not enabled.");
1434
- await t.signIn({
1435
- redirectTo: window.location.href
1436
- });
1437
- },
1438
- logout: async () => {
1439
- if (!s)
1440
- throw new Error("Authentication is not enabled.");
1441
- await t.signOut(), window.location.href = "/";
1442
- },
1443
- signup: async () => {
1444
- if (!s)
1445
- throw new Error("Authentication is not enabled.");
1446
- await t.signUp({
1447
- redirectTo: window.location.href
1448
- });
1449
- }
1450
- };
1451
- };
1452
- export {
1453
- Ee as A,
1454
- Re as B,
1455
- bt as C,
1456
- ct as D,
1457
- ht as E,
1458
- A as F,
1459
- be as G,
1460
- V as H,
1461
- k as I,
1462
- Fe as J,
1463
- xe as K,
1464
- St as L,
1465
- Y as M,
1466
- Pe as N,
1467
- xt as O,
1468
- De as P,
1469
- Ce as Q,
1470
- Ut as R,
1471
- $ as S,
1472
- ke as T,
1473
- ie as U,
1474
- oe as V,
1475
- ne as Z,
1476
- Te as a,
1477
- Ae as b,
1478
- Xt as c,
1479
- X as d,
1480
- de as e,
1481
- Ie as f,
1482
- vt as g,
1483
- L as h,
1484
- it as i,
1485
- F as j,
1486
- Bt as k,
1487
- Yt as l,
1488
- Oe as m,
1489
- J as n,
1490
- ce as o,
1491
- le as p,
1492
- wt as q,
1493
- je as r,
1494
- _ as s,
1495
- W as t,
1496
- Ot as u,
1497
- It as v,
1498
- Se as w,
1499
- we as x,
1500
- Q as y,
1501
- Tt as z
1502
- };
1503
- //# sourceMappingURL=hook-Bd0yS8M0.js.map