zudoku 0.0.0-f3f6db5 → 0.0.0-f471fb8

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 (774) hide show
  1. package/README.md +1 -1
  2. package/cli.js +3 -0
  3. package/dist/app/entry.client.d.ts +5 -0
  4. package/dist/app/entry.client.js +1 -0
  5. package/dist/app/entry.client.js.map +1 -1
  6. package/dist/app/entry.server.d.ts +5 -4
  7. package/dist/app/entry.server.js +11 -7
  8. package/dist/app/entry.server.js.map +1 -1
  9. package/dist/app/main.js +4 -3
  10. package/dist/app/main.js.map +1 -1
  11. package/dist/app/tailwind.js +20 -0
  12. package/dist/app/tailwind.js.map +1 -1
  13. package/dist/cli/build/handler.d.ts +1 -3
  14. package/dist/cli/build/handler.js +7 -0
  15. package/dist/cli/build/handler.js.map +1 -1
  16. package/dist/cli/cli.js +5 -0
  17. package/dist/cli/cli.js.map +1 -1
  18. package/dist/cli/cmds/build.d.ts +11 -3
  19. package/dist/cli/cmds/build.js +20 -13
  20. package/dist/cli/cmds/build.js.map +1 -1
  21. package/dist/cli/cmds/dev.d.ts +1 -1
  22. package/dist/cli/cmds/dev.js +7 -1
  23. package/dist/cli/cmds/dev.js.map +1 -1
  24. package/dist/cli/cmds/preview.d.ts +16 -0
  25. package/dist/cli/cmds/preview.js +25 -0
  26. package/dist/cli/cmds/preview.js.map +1 -0
  27. package/dist/cli/common/output.js.map +1 -1
  28. package/dist/cli/common/utils/ports.d.ts +1 -1
  29. package/dist/cli/common/utils/ports.js +16 -15
  30. package/dist/cli/common/utils/ports.js.map +1 -1
  31. package/dist/cli/dev/handler.js +14 -12
  32. package/dist/cli/dev/handler.js.map +1 -1
  33. package/dist/cli/dev/pagefind-command.d.ts +3 -0
  34. package/dist/cli/dev/pagefind-command.js +59 -0
  35. package/dist/cli/dev/pagefind-command.js.map +1 -0
  36. package/dist/cli/preview/handler.d.ts +3 -0
  37. package/dist/cli/preview/handler.js +35 -0
  38. package/dist/cli/preview/handler.js.map +1 -0
  39. package/dist/config/common.d.ts +5 -3
  40. package/dist/config/config.d.ts +15 -15
  41. package/dist/config/loader.d.ts +6 -6
  42. package/dist/config/loader.js +20 -25
  43. package/dist/config/loader.js.map +1 -1
  44. package/dist/config/validators/InputSidebarSchema.d.ts +15 -15
  45. package/dist/config/validators/InputSidebarSchema.js +10 -1
  46. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  47. package/dist/config/validators/common.d.ts +2318 -503
  48. package/dist/config/validators/common.js +94 -17
  49. package/dist/config/validators/common.js.map +1 -1
  50. package/dist/config/validators/icon-types.d.ts +1 -1
  51. package/dist/config/validators/validate.d.ts +891 -219
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.js +1 -0
  54. package/dist/index.js.map +1 -1
  55. package/dist/lib/MissingIcon.d.ts +2 -0
  56. package/dist/lib/MissingIcon.js +7 -0
  57. package/dist/lib/MissingIcon.js.map +1 -0
  58. package/dist/lib/authentication/authentication.d.ts +1 -0
  59. package/dist/lib/authentication/hook.d.ts +1 -0
  60. package/dist/lib/authentication/hook.js +11 -1
  61. package/dist/lib/authentication/hook.js.map +1 -1
  62. package/dist/lib/authentication/providers/auth0.d.ts +2 -2
  63. package/dist/lib/authentication/providers/auth0.js +1 -0
  64. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  65. package/dist/lib/authentication/providers/clerk.d.ts +2 -2
  66. package/dist/lib/authentication/providers/clerk.js +25 -6
  67. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  68. package/dist/lib/authentication/providers/openid.d.ts +5 -3
  69. package/dist/lib/authentication/providers/openid.js +24 -10
  70. package/dist/lib/authentication/providers/openid.js.map +1 -1
  71. package/dist/lib/authentication/providers/supabase.d.ts +4 -0
  72. package/dist/lib/authentication/providers/supabase.js +117 -0
  73. package/dist/lib/authentication/providers/supabase.js.map +1 -0
  74. package/dist/lib/authentication/state.d.ts +0 -17
  75. package/dist/lib/authentication/state.js +9 -7
  76. package/dist/lib/authentication/state.js.map +1 -1
  77. package/dist/lib/components/AnchorLink.d.ts +2 -2
  78. package/dist/lib/components/AnchorLink.js +5 -4
  79. package/dist/lib/components/AnchorLink.js.map +1 -1
  80. package/dist/lib/components/Autocomplete.d.ts +4 -3
  81. package/dist/lib/components/Autocomplete.js +2 -2
  82. package/dist/lib/components/Autocomplete.js.map +1 -1
  83. package/dist/lib/components/Banner.js +1 -1
  84. package/dist/lib/components/Banner.js.map +1 -1
  85. package/dist/lib/components/Header.js +4 -4
  86. package/dist/lib/components/Header.js.map +1 -1
  87. package/dist/lib/components/Heading.d.ts +2 -2
  88. package/dist/lib/components/InlineCode.d.ts +2 -1
  89. package/dist/lib/components/InlineCode.js +2 -9
  90. package/dist/lib/components/InlineCode.js.map +1 -1
  91. package/dist/lib/components/Layout.js +7 -29
  92. package/dist/lib/components/Layout.js.map +1 -1
  93. package/dist/lib/components/Main.d.ts +2 -0
  94. package/dist/lib/components/Main.js +17 -0
  95. package/dist/lib/components/Main.js.map +1 -0
  96. package/dist/lib/components/MobileTopNavigation.js +1 -1
  97. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  98. package/dist/lib/components/Pagination.d.ts +10 -0
  99. package/dist/lib/components/Pagination.js +10 -0
  100. package/dist/lib/components/Pagination.js.map +1 -0
  101. package/dist/lib/components/PathRenderer.js +23 -20
  102. package/dist/lib/components/PathRenderer.js.map +1 -1
  103. package/dist/lib/components/ThemeSwitch.js +8 -5
  104. package/dist/lib/components/ThemeSwitch.js.map +1 -1
  105. package/dist/lib/components/TopNavigation.d.ts +2 -2
  106. package/dist/lib/components/TopNavigation.js +28 -14
  107. package/dist/lib/components/TopNavigation.js.map +1 -1
  108. package/dist/lib/components/Zudoku.d.ts +1 -1
  109. package/dist/lib/components/Zudoku.js +12 -8
  110. package/dist/lib/components/Zudoku.js.map +1 -1
  111. package/dist/lib/components/cache.d.ts +7 -0
  112. package/dist/lib/components/cache.js +7 -0
  113. package/dist/lib/components/cache.js.map +1 -1
  114. package/dist/lib/components/context/RouterEventsEmitter.d.ts +1 -0
  115. package/dist/lib/components/context/RouterEventsEmitter.js +17 -0
  116. package/dist/lib/components/context/RouterEventsEmitter.js.map +1 -0
  117. package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
  118. package/dist/lib/components/context/ViewportAnchorContext.js +5 -10
  119. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  120. package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
  121. package/dist/lib/components/context/ZudokuContext.js +21 -9
  122. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  123. package/dist/lib/components/index.d.ts +9 -2
  124. package/dist/lib/components/index.js +4 -0
  125. package/dist/lib/components/index.js.map +1 -1
  126. package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
  127. package/dist/lib/components/navigation/Sidebar.js +8 -5
  128. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  129. package/dist/lib/components/navigation/SidebarBadge.d.ts +2 -0
  130. package/dist/lib/components/navigation/SidebarBadge.js +3 -1
  131. package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
  132. package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
  133. package/dist/lib/components/navigation/SidebarCategory.js +10 -6
  134. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  135. package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
  136. package/dist/lib/components/navigation/SidebarItem.js +17 -10
  137. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  138. package/dist/lib/components/navigation/SidebarWrapper.d.ts +8 -6
  139. package/dist/lib/components/navigation/SidebarWrapper.js +1 -2
  140. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  141. package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
  142. package/dist/lib/components/navigation/Toc.js.map +1 -0
  143. package/dist/lib/core/RouteGuard.d.ts +1 -1
  144. package/dist/lib/core/RouteGuard.js +28 -10
  145. package/dist/lib/core/RouteGuard.js.map +1 -1
  146. package/dist/lib/core/ZudokuContext.d.ts +29 -6
  147. package/dist/lib/core/ZudokuContext.js +29 -6
  148. package/dist/lib/core/ZudokuContext.js.map +1 -1
  149. package/dist/lib/core/plugins.d.ts +17 -7
  150. package/dist/lib/core/plugins.js +3 -0
  151. package/dist/lib/core/plugins.js.map +1 -1
  152. package/dist/lib/errors/ErrorAlert.js +6 -1
  153. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  154. package/dist/lib/hooks/index.d.ts +3 -0
  155. package/dist/lib/hooks/index.js +5 -0
  156. package/dist/lib/hooks/index.js.map +1 -0
  157. package/dist/lib/hooks/useEvent.d.ts +11 -0
  158. package/dist/lib/hooks/useEvent.js +19 -0
  159. package/dist/lib/hooks/useEvent.js.map +1 -0
  160. package/dist/lib/hooks/useEvent.test.d.ts +1 -0
  161. package/dist/lib/hooks/useEvent.test.js +100 -0
  162. package/dist/lib/hooks/useEvent.test.js.map +1 -0
  163. package/dist/lib/icons.d.ts +1 -0
  164. package/dist/lib/icons.js +1 -0
  165. package/dist/lib/icons.js.map +1 -1
  166. package/dist/lib/oas/graphql/index.d.ts +24 -4
  167. package/dist/lib/oas/graphql/index.js +163 -48
  168. package/dist/lib/oas/graphql/index.js.map +1 -1
  169. package/dist/lib/oas/parser/dereference/index.js +2 -0
  170. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  171. package/dist/lib/oas/parser/index.d.ts +5 -3
  172. package/dist/lib/oas/parser/index.js +0 -22
  173. package/dist/lib/oas/parser/index.js.map +1 -1
  174. package/dist/lib/oas/parser/upgrade/index.js +2 -1
  175. package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
  176. package/dist/lib/plugins/api-catalog/Catalog.d.ts +4 -2
  177. package/dist/lib/plugins/api-catalog/Catalog.js +16 -26
  178. package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
  179. package/dist/lib/plugins/api-catalog/index.d.ts +1 -0
  180. package/dist/lib/plugins/api-catalog/index.js +39 -8
  181. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  182. package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
  183. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  184. package/dist/lib/plugins/api-keys/index.d.ts +1 -0
  185. package/dist/lib/plugins/api-keys/index.js +1 -0
  186. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  187. package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
  188. package/dist/lib/plugins/markdown/MdxPage.js +3 -9
  189. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  190. package/dist/lib/plugins/markdown/resolver.d.ts +0 -6
  191. package/dist/lib/plugins/markdown/resolver.js +0 -29
  192. package/dist/lib/plugins/markdown/resolver.js.map +1 -1
  193. package/dist/lib/plugins/openapi/Endpoint.js +6 -7
  194. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  195. package/dist/lib/plugins/openapi/{OpenApiRoute.d.ts → OasProvider.d.ts} +1 -2
  196. package/dist/lib/plugins/openapi/OasProvider.js +29 -0
  197. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -0
  198. package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
  199. package/dist/lib/plugins/openapi/OperationList.js +71 -22
  200. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  201. package/dist/lib/plugins/openapi/OperationListItem.d.ts +3 -2
  202. package/dist/lib/plugins/openapi/OperationListItem.js +8 -13
  203. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  204. package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
  205. package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
  206. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
  207. package/dist/lib/plugins/openapi/ParameterList.d.ts +2 -1
  208. package/dist/lib/plugins/openapi/ParameterList.js +3 -2
  209. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  210. package/dist/lib/plugins/openapi/ParameterListItem.js +8 -4
  211. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  212. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +1 -1
  213. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +9 -3
  214. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  215. package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
  216. package/dist/lib/plugins/openapi/SchemaList.js +52 -0
  217. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
  218. package/dist/lib/plugins/openapi/Sidecar.js +41 -12
  219. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  220. package/dist/lib/plugins/openapi/SidecarExamples.js +2 -2
  221. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  222. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  223. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  224. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
  225. package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
  226. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
  227. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
  228. package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
  229. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
  230. package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
  231. package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
  232. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
  233. package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
  234. package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
  235. package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
  236. package/dist/lib/plugins/openapi/graphql/gql.d.ts +9 -5
  237. package/dist/lib/plugins/openapi/graphql/gql.js +5 -15
  238. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  239. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +110 -41
  240. package/dist/lib/plugins/openapi/graphql/graphql.js +63 -24
  241. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  242. package/dist/lib/plugins/openapi/index.d.ts +10 -7
  243. package/dist/lib/plugins/openapi/index.js +62 -119
  244. package/dist/lib/plugins/openapi/index.js.map +1 -1
  245. package/dist/lib/plugins/openapi/interfaces.d.ts +39 -11
  246. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
  247. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
  248. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  249. package/dist/lib/plugins/openapi/playground/Headers.d.ts +4 -4
  250. package/dist/lib/plugins/openapi/playground/Headers.js +42 -26
  251. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  252. package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
  253. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
  254. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
  255. package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
  256. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
  257. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
  258. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +4 -0
  259. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +2 -1
  260. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  261. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +3 -2
  262. package/dist/lib/plugins/openapi/playground/PathParams.js +5 -4
  263. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  264. package/dist/lib/plugins/openapi/playground/Playground.d.ts +18 -3
  265. package/dist/lib/plugins/openapi/playground/Playground.js +84 -30
  266. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  267. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  268. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  269. package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -21
  270. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  271. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
  272. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
  273. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
  274. package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
  275. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
  276. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
  277. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +1 -1
  278. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +1 -1
  279. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +20 -14
  280. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  281. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
  282. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
  283. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  284. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +10 -8
  285. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  286. package/dist/lib/plugins/openapi/schema/SchemaView.js +13 -6
  287. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  288. package/dist/lib/plugins/openapi/state.d.ts +25 -0
  289. package/dist/lib/plugins/openapi/state.js +18 -0
  290. package/dist/lib/plugins/openapi/state.js.map +1 -0
  291. package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +9 -0
  292. package/dist/lib/plugins/openapi/util/createSidebarCategory.js +23 -0
  293. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -0
  294. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +10 -0
  295. package/dist/lib/plugins/openapi/util/getRoutes.js +80 -0
  296. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -0
  297. package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +2 -0
  298. package/dist/lib/plugins/openapi/util/methodColorMap.js +10 -0
  299. package/dist/lib/plugins/openapi/util/methodColorMap.js.map +1 -0
  300. package/dist/lib/plugins/search-pagefind/PagefindSearch.d.ts +6 -0
  301. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +75 -0
  302. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -0
  303. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +8 -0
  304. package/dist/lib/plugins/search-pagefind/ResultList.js +38 -0
  305. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -0
  306. package/dist/lib/plugins/search-pagefind/get-results.d.ts +10 -0
  307. package/dist/lib/plugins/search-pagefind/get-results.js +42 -0
  308. package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -0
  309. package/dist/lib/plugins/search-pagefind/index.d.ts +8 -0
  310. package/dist/lib/plugins/search-pagefind/index.js +9 -0
  311. package/dist/lib/plugins/search-pagefind/index.js.map +1 -0
  312. package/dist/lib/plugins/search-pagefind/types.d.ts +85 -0
  313. package/dist/lib/plugins/search-pagefind/types.js +2 -0
  314. package/dist/lib/plugins/search-pagefind/types.js.map +1 -0
  315. package/dist/lib/ui/Badge.d.ts +1 -1
  316. package/dist/lib/ui/Button.d.ts +2 -2
  317. package/dist/lib/ui/Button.js +2 -1
  318. package/dist/lib/ui/Button.js.map +1 -1
  319. package/dist/lib/ui/Callout.d.ts +2 -1
  320. package/dist/lib/ui/Callout.js +3 -2
  321. package/dist/lib/ui/Callout.js.map +1 -1
  322. package/dist/lib/ui/Checkbox.d.ts +2 -8
  323. package/dist/lib/ui/Checkbox.js +1 -13
  324. package/dist/lib/ui/Checkbox.js.map +1 -1
  325. package/dist/lib/ui/Command.d.ts +7 -1
  326. package/dist/lib/ui/Command.js +2 -2
  327. package/dist/lib/ui/Command.js.map +1 -1
  328. package/dist/lib/ui/Input.d.ts +1 -2
  329. package/dist/lib/ui/Input.js.map +1 -1
  330. package/dist/lib/ui/Select.js +1 -1
  331. package/dist/lib/ui/Select.js.map +1 -1
  332. package/dist/lib/ui/Stepper.d.ts +3 -0
  333. package/dist/lib/ui/Stepper.js +7 -0
  334. package/dist/lib/ui/Stepper.js.map +1 -0
  335. package/dist/lib/ui/SyntaxHighlight.d.ts +15 -0
  336. package/dist/lib/ui/SyntaxHighlight.js +62 -0
  337. package/dist/lib/ui/SyntaxHighlight.js.map +1 -0
  338. package/dist/lib/ui/util.d.ts +2 -0
  339. package/dist/lib/ui/util.js +3 -0
  340. package/dist/lib/ui/util.js.map +1 -0
  341. package/dist/lib/util/MdxComponents.d.ts +5 -2
  342. package/dist/lib/util/MdxComponents.js +6 -3
  343. package/dist/lib/util/MdxComponents.js.map +1 -1
  344. package/dist/lib/util/joinPath.d.ts +3 -0
  345. package/dist/lib/util/joinPath.js +3 -0
  346. package/dist/lib/util/joinPath.js.map +1 -1
  347. package/dist/lib/util/scrollIntoViewIfNeeded.d.ts +1 -0
  348. package/dist/lib/util/scrollIntoViewIfNeeded.js +14 -0
  349. package/dist/lib/util/scrollIntoViewIfNeeded.js.map +1 -0
  350. package/dist/lib/util/traverse.d.ts +2 -8
  351. package/dist/lib/util/traverse.js +2 -2
  352. package/dist/lib/util/traverse.js.map +1 -1
  353. package/dist/lib/util/types.d.ts +7 -0
  354. package/dist/lib/util/types.js +2 -0
  355. package/dist/lib/util/types.js.map +1 -0
  356. package/dist/lib/util/useLatest.d.ts +1 -0
  357. package/dist/lib/util/useLatest.js +15 -0
  358. package/dist/lib/util/useLatest.js.map +1 -0
  359. package/dist/lib/util/useOnScreen.d.ts +3 -2
  360. package/dist/lib/util/useOnScreen.js +3 -3
  361. package/dist/lib/util/useOnScreen.js.map +1 -1
  362. package/dist/lib/util/useScrollToAnchor.js +27 -33
  363. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  364. package/dist/lib/util/useScrollToTop.js +6 -4
  365. package/dist/lib/util/useScrollToTop.js.map +1 -1
  366. package/dist/vite/api/schema-codegen.d.ts +1 -1
  367. package/dist/vite/api/schema-codegen.js +27 -8
  368. package/dist/vite/api/schema-codegen.js.map +1 -1
  369. package/dist/vite/api/schema-codegen.test.js +66 -0
  370. package/dist/vite/api/schema-codegen.test.js.map +1 -1
  371. package/dist/vite/build.js +35 -16
  372. package/dist/vite/build.js.map +1 -1
  373. package/dist/vite/config.d.ts +2 -5
  374. package/dist/vite/config.js +63 -71
  375. package/dist/vite/config.js.map +1 -1
  376. package/dist/vite/config.test.js +1 -1
  377. package/dist/vite/config.test.js.map +1 -1
  378. package/dist/vite/create-pagefind-index.d.ts +4 -0
  379. package/dist/vite/create-pagefind-index.js +12 -0
  380. package/dist/vite/create-pagefind-index.js.map +1 -0
  381. package/dist/vite/css/plugin.d.ts +2 -2
  382. package/dist/vite/css/plugin.js.map +1 -1
  383. package/dist/vite/dev-server.d.ts +4 -2
  384. package/dist/vite/dev-server.js +42 -12
  385. package/dist/vite/dev-server.js.map +1 -1
  386. package/dist/vite/error-handler.d.ts +1 -1
  387. package/dist/vite/error-handler.js +1 -1
  388. package/dist/vite/error-handler.js.map +1 -1
  389. package/dist/vite/output.d.ts +14 -2
  390. package/dist/vite/output.js +12 -14
  391. package/dist/vite/output.js.map +1 -1
  392. package/dist/vite/plugin-api-keys.d.ts +2 -2
  393. package/dist/vite/plugin-api-keys.js +5 -5
  394. package/dist/vite/plugin-api-keys.js.map +1 -1
  395. package/dist/vite/plugin-api.d.ts +2 -2
  396. package/dist/vite/plugin-api.js +143 -116
  397. package/dist/vite/plugin-api.js.map +1 -1
  398. package/dist/vite/plugin-auth.d.ts +2 -2
  399. package/dist/vite/plugin-auth.js +3 -3
  400. package/dist/vite/plugin-auth.js.map +1 -1
  401. package/dist/vite/plugin-component.d.ts +2 -2
  402. package/dist/vite/plugin-component.js +7 -2
  403. package/dist/vite/plugin-component.js.map +1 -1
  404. package/dist/vite/plugin-config-reload.d.ts +4 -3
  405. package/dist/vite/plugin-config-reload.js +11 -5
  406. package/dist/vite/plugin-config-reload.js.map +1 -1
  407. package/dist/vite/plugin-config.d.ts +2 -2
  408. package/dist/vite/plugin-config.js +9 -5
  409. package/dist/vite/plugin-config.js.map +1 -1
  410. package/dist/vite/plugin-custom-pages.d.ts +2 -2
  411. package/dist/vite/plugin-custom-pages.js +3 -3
  412. package/dist/vite/plugin-custom-pages.js.map +1 -1
  413. package/dist/vite/plugin-docs.d.ts +3 -3
  414. package/dist/vite/plugin-docs.js +23 -6
  415. package/dist/vite/plugin-docs.js.map +1 -1
  416. package/dist/vite/plugin-frontmatter.d.ts +2 -2
  417. package/dist/vite/plugin-frontmatter.js +5 -4
  418. package/dist/vite/plugin-frontmatter.js.map +1 -1
  419. package/dist/vite/plugin-mdx.d.ts +2 -2
  420. package/dist/vite/plugin-mdx.js +34 -23
  421. package/dist/vite/plugin-mdx.js.map +1 -1
  422. package/dist/vite/plugin-redirect.d.ts +2 -2
  423. package/dist/vite/plugin-redirect.js +3 -3
  424. package/dist/vite/plugin-redirect.js.map +1 -1
  425. package/dist/vite/plugin-search.d.ts +2 -2
  426. package/dist/vite/plugin-search.js +5 -1
  427. package/dist/vite/plugin-search.js.map +1 -1
  428. package/dist/vite/plugin-sidebar.d.ts +2 -2
  429. package/dist/vite/plugin-sidebar.js +13 -4
  430. package/dist/vite/plugin-sidebar.js.map +1 -1
  431. package/dist/vite/plugin-theme-css.d.ts +2 -2
  432. package/dist/vite/plugin-theme-css.js +7 -4
  433. package/dist/vite/plugin-theme-css.js.map +1 -1
  434. package/dist/vite/plugin.d.ts +2 -2
  435. package/dist/vite/plugin.js.map +1 -1
  436. package/dist/vite/{prerender.d.ts → prerender/FileWritingResponse.d.ts} +8 -9
  437. package/dist/vite/prerender/FileWritingResponse.js +51 -0
  438. package/dist/vite/prerender/FileWritingResponse.js.map +1 -0
  439. package/dist/vite/prerender/prerender.d.ts +14 -0
  440. package/dist/vite/prerender/prerender.js +90 -0
  441. package/dist/vite/prerender/prerender.js.map +1 -0
  442. package/dist/vite/prerender/worker.d.ts +13 -0
  443. package/dist/vite/prerender/worker.js +31 -0
  444. package/dist/vite/prerender/worker.js.map +1 -0
  445. package/dist/vite/reporter.d.ts +3 -0
  446. package/dist/vite/reporter.js +33 -0
  447. package/dist/vite/reporter.js.map +1 -0
  448. package/dist/vite/sitemap.js +2 -1
  449. package/dist/vite/sitemap.js.map +1 -1
  450. package/lib/{AuthenticationPlugin-Du8cLBSr.js → AuthenticationPlugin-foqdvvkf.js} +4 -4
  451. package/lib/{AuthenticationPlugin-Du8cLBSr.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
  452. package/lib/Button-Fp19CMUr.js +49 -0
  453. package/lib/Button-Fp19CMUr.js.map +1 -0
  454. package/lib/Callout-D5frCCJ0.js +229 -0
  455. package/lib/Callout-D5frCCJ0.js.map +1 -0
  456. package/lib/{CategoryHeading-MYL1u_6K.js → CategoryHeading-DpB47wvk.js} +3 -3
  457. package/lib/{CategoryHeading-MYL1u_6K.js.map → CategoryHeading-DpB47wvk.js.map} +1 -1
  458. package/lib/Dialog-Dv6WG8RN.js +98 -0
  459. package/lib/Dialog-Dv6WG8RN.js.map +1 -0
  460. package/lib/Drawer-kDAfOq_2.js +1133 -0
  461. package/lib/Drawer-kDAfOq_2.js.map +1 -0
  462. package/lib/{Markdown-Cyrx_JrO.js → Markdown-aF5FdsNi.js} +8223 -6475
  463. package/lib/Markdown-aF5FdsNi.js.map +1 -0
  464. package/lib/MdxPage-ZW1StNhp.js +83 -0
  465. package/lib/MdxPage-ZW1StNhp.js.map +1 -0
  466. package/lib/OasProvider-OlYb8W57.js +34 -0
  467. package/lib/OasProvider-OlYb8W57.js.map +1 -0
  468. package/lib/OperationList-BvfIzVRx.js +5065 -0
  469. package/lib/OperationList-BvfIzVRx.js.map +1 -0
  470. package/lib/Pagination-CYB3nVYx.js +46 -0
  471. package/lib/Pagination-CYB3nVYx.js.map +1 -0
  472. package/lib/SchemaList-Bi35O4XD.js +148 -0
  473. package/lib/SchemaList-Bi35O4XD.js.map +1 -0
  474. package/lib/SchemaView-D7MC5cjz.js +356 -0
  475. package/lib/SchemaView-D7MC5cjz.js.map +1 -0
  476. package/lib/{Select-CnCZ4WhS.js → Select-DVFRKf1R.js} +71 -71
  477. package/lib/{Select-CnCZ4WhS.js.map → Select-DVFRKf1R.js.map} +1 -1
  478. package/lib/SlotletProvider-DXvc0aY6.js +338 -0
  479. package/lib/SlotletProvider-DXvc0aY6.js.map +1 -0
  480. package/lib/Spinner-CE68iCm0.js +7 -0
  481. package/lib/Spinner-CE68iCm0.js.map +1 -0
  482. package/lib/{SyntaxHighlight-B0L4SC_N.js → SyntaxHighlight-BEoSoPEo.js} +496 -592
  483. package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
  484. package/lib/Toc-YBsgI72s.js +92 -0
  485. package/lib/Toc-YBsgI72s.js.map +1 -0
  486. package/lib/{chunk-SYFQ2XB5-BPvC-soB.js → chunk-HA7DTUK3-C4gP41vD.js} +561 -561
  487. package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
  488. package/lib/{circular-DxaIIlWD.js → circular-ByJI6Mci.js} +5461 -4993
  489. package/lib/circular-ByJI6Mci.js.map +1 -0
  490. package/lib/context-DLCwaMXN.js +22 -0
  491. package/lib/{context-rwLGh-6_.js.map → context-DLCwaMXN.js.map} +1 -1
  492. package/lib/{createServer-CjNktZzL.js → createServer-mMau3eV_.js} +4801 -4976
  493. package/lib/createServer-mMau3eV_.js.map +1 -0
  494. package/lib/hook-CqpVYDqN.js +1483 -0
  495. package/lib/hook-CqpVYDqN.js.map +1 -0
  496. package/lib/index-Bn6Lc9tq.js +9 -0
  497. package/lib/index-Bn6Lc9tq.js.map +1 -0
  498. package/lib/index-Bt7MKhZq.js +2514 -0
  499. package/lib/index-Bt7MKhZq.js.map +1 -0
  500. package/lib/index-CPNSgwSb.js +36 -0
  501. package/lib/{index-Djenk2Hj.js.map → index-CPNSgwSb.js.map} +1 -1
  502. package/lib/index-CXfEwK_7.js +2226 -0
  503. package/lib/index-CXfEwK_7.js.map +1 -0
  504. package/lib/index-DwT-v3zK.js +86 -0
  505. package/lib/index-DwT-v3zK.js.map +1 -0
  506. package/lib/{index-CjJS0l4l.js → index-LNp6rxyU.js} +2 -2
  507. package/lib/{index-CjJS0l4l.js.map → index-LNp6rxyU.js.map} +1 -1
  508. package/lib/index-gQD2h1wX.js +447 -0
  509. package/lib/index-gQD2h1wX.js.map +1 -0
  510. package/lib/{index.esm-CrSoEshU.js → index.esm--gIChbWs.js} +3 -3
  511. package/lib/{index.esm-CrSoEshU.js.map → index.esm--gIChbWs.js.map} +1 -1
  512. package/lib/{jsx-runtime-Bdg6XQ1m.js → jsx-runtime-CYK1ROHF.js} +99 -99
  513. package/lib/{jsx-runtime-Bdg6XQ1m.js.map → jsx-runtime-CYK1ROHF.js.map} +1 -1
  514. package/lib/{hook-FT3SJLe_.js → mutation-8LjrN7uz.js} +43 -62
  515. package/lib/mutation-8LjrN7uz.js.map +1 -0
  516. package/lib/objectEntries-BS7aAgOm.js +12 -0
  517. package/lib/objectEntries-BS7aAgOm.js.map +1 -0
  518. package/lib/post-processors/removeExtensions.js +4 -4
  519. package/lib/post-processors/traverse.js +2 -2
  520. package/lib/post-processors/traverse.js.map +1 -1
  521. package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
  522. package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
  523. package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
  524. package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
  525. package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
  526. package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
  527. package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
  528. package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
  529. package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
  530. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
  531. package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
  532. package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
  533. package/lib/ui/Accordion.js +1 -1
  534. package/lib/ui/ActionButton.js +11 -10
  535. package/lib/ui/ActionButton.js.map +1 -1
  536. package/lib/ui/Alert.js +2 -2
  537. package/lib/ui/AlertDialog.js +1 -1
  538. package/lib/ui/Badge.js +2 -2
  539. package/lib/ui/Breadcrumb.js +4 -4
  540. package/lib/ui/Button.js +13 -12
  541. package/lib/ui/Button.js.map +1 -1
  542. package/lib/ui/Callout.js +39 -21
  543. package/lib/ui/Callout.js.map +1 -1
  544. package/lib/ui/Card.js +1 -1
  545. package/lib/ui/Carousel.js +1 -1
  546. package/lib/ui/Checkbox.js +16 -26
  547. package/lib/ui/Checkbox.js.map +1 -1
  548. package/lib/ui/Command.js +105 -78
  549. package/lib/ui/Command.js.map +1 -1
  550. package/lib/ui/Dialog.js +1 -1
  551. package/lib/ui/Drawer.js +14 -1151
  552. package/lib/ui/Drawer.js.map +1 -1
  553. package/lib/ui/DropdownMenu.js +1 -1
  554. package/lib/ui/Form.js +5 -5
  555. package/lib/ui/HoverCard.js +1 -1
  556. package/lib/ui/Input.js +1 -1
  557. package/lib/ui/Input.js.map +1 -1
  558. package/lib/ui/Label.js +2 -2
  559. package/lib/ui/Pagination.js +10 -10
  560. package/lib/ui/Popover.js +1 -1
  561. package/lib/ui/Progress.js +1 -1
  562. package/lib/ui/RadioGroup.js +1 -1
  563. package/lib/ui/ScrollArea.js +1 -1
  564. package/lib/ui/Select.js +2 -2
  565. package/lib/ui/Select.js.map +1 -1
  566. package/lib/ui/Skeleton.js +1 -1
  567. package/lib/ui/Slider.js +1 -1
  568. package/lib/ui/Stepper.js +6 -0
  569. package/lib/ui/Stepper.js.map +1 -0
  570. package/lib/ui/Switch.js +1 -1
  571. package/lib/ui/SyntaxHighlight.js +11 -0
  572. package/lib/ui/SyntaxHighlight.js.map +1 -0
  573. package/lib/ui/Tabs.js +1 -1
  574. package/lib/ui/Textarea.js +1 -1
  575. package/lib/ui/Toggle.js +2 -2
  576. package/lib/ui/ToggleGroup.js +1 -1
  577. package/lib/ui/Tooltip.js +1 -1
  578. package/lib/ui/util.js +6 -0
  579. package/lib/ui/util.js.map +1 -0
  580. package/lib/{useExposedProps-BLKFBylA.js → useExposedProps-B9qXJedG.js} +2 -2
  581. package/lib/{useExposedProps-BLKFBylA.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
  582. package/lib/zudoku.auth-auth0.js +15 -14
  583. package/lib/zudoku.auth-auth0.js.map +1 -1
  584. package/lib/zudoku.auth-clerk.js +67 -49
  585. package/lib/zudoku.auth-clerk.js.map +1 -1
  586. package/lib/zudoku.auth-openid.js +370 -405
  587. package/lib/zudoku.auth-openid.js.map +1 -1
  588. package/lib/zudoku.components.js +31 -1215
  589. package/lib/zudoku.components.js.map +1 -1
  590. package/lib/zudoku.hooks.js +19 -0
  591. package/lib/zudoku.hooks.js.map +1 -0
  592. package/lib/zudoku.icons.js +10 -0
  593. package/lib/zudoku.icons.js.map +1 -1
  594. package/lib/zudoku.plugin-api-catalog.js +109 -109
  595. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  596. package/lib/zudoku.plugin-api-keys.js +108 -106
  597. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  598. package/lib/zudoku.plugin-custom-pages.js +3 -3
  599. package/lib/zudoku.plugin-markdown.js +23 -44
  600. package/lib/zudoku.plugin-markdown.js.map +1 -1
  601. package/lib/zudoku.plugin-openapi.js +6 -7
  602. package/lib/zudoku.plugin-openapi.js.map +1 -1
  603. package/lib/zudoku.plugin-redirect.js +1 -1
  604. package/lib/zudoku.plugin-search-inkeep.js +9 -9
  605. package/lib/zudoku.plugin-search-pagefind.js +238 -0
  606. package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
  607. package/lib/zudoku.plugins.js +14 -0
  608. package/lib/zudoku.plugins.js.map +1 -0
  609. package/package.json +83 -55
  610. package/src/app/demo-cdn.html +31 -31
  611. package/src/app/entry.client.tsx +8 -0
  612. package/src/app/entry.server.tsx +18 -11
  613. package/src/app/main.css +100 -58
  614. package/src/app/main.tsx +10 -3
  615. package/src/app/tailwind.ts +20 -0
  616. package/src/lib/MissingIcon.tsx +22 -0
  617. package/src/lib/authentication/authentication.ts +2 -0
  618. package/src/lib/authentication/hook.ts +12 -1
  619. package/src/lib/authentication/providers/auth0.tsx +3 -2
  620. package/src/lib/authentication/providers/clerk.tsx +32 -8
  621. package/src/lib/authentication/providers/openid.tsx +31 -15
  622. package/src/lib/authentication/providers/supabase.tsx +157 -0
  623. package/src/lib/authentication/state.ts +9 -19
  624. package/src/lib/components/AnchorLink.tsx +9 -7
  625. package/src/lib/components/Autocomplete.tsx +6 -4
  626. package/src/lib/components/Banner.tsx +1 -0
  627. package/src/lib/components/Header.tsx +12 -8
  628. package/src/lib/components/Heading.tsx +1 -1
  629. package/src/lib/components/InlineCode.tsx +13 -16
  630. package/src/lib/components/Layout.tsx +20 -67
  631. package/src/lib/components/Main.tsx +49 -0
  632. package/src/lib/components/MobileTopNavigation.tsx +1 -1
  633. package/src/lib/components/Pagination.tsx +47 -0
  634. package/src/lib/components/PathRenderer.tsx +6 -4
  635. package/src/lib/components/ThemeSwitch.tsx +28 -8
  636. package/src/lib/components/TopNavigation.tsx +51 -24
  637. package/src/lib/components/Zudoku.tsx +18 -7
  638. package/src/lib/components/cache.ts +8 -0
  639. package/src/lib/components/context/RouterEventsEmitter.tsx +19 -0
  640. package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
  641. package/src/lib/components/context/ZudokuContext.ts +30 -10
  642. package/src/lib/components/index.ts +4 -0
  643. package/src/lib/components/navigation/Sidebar.tsx +14 -10
  644. package/src/lib/components/navigation/SidebarBadge.tsx +4 -1
  645. package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
  646. package/src/lib/components/navigation/SidebarItem.tsx +22 -28
  647. package/src/lib/components/navigation/SidebarWrapper.tsx +13 -15
  648. package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
  649. package/src/lib/core/RouteGuard.tsx +48 -9
  650. package/src/lib/core/ZudokuContext.ts +57 -12
  651. package/src/lib/core/plugins.ts +29 -7
  652. package/src/lib/errors/ErrorAlert.tsx +24 -17
  653. package/src/lib/hooks/index.ts +5 -0
  654. package/src/lib/hooks/useEvent.test.tsx +149 -0
  655. package/src/lib/hooks/useEvent.ts +41 -0
  656. package/src/lib/icons.ts +1 -0
  657. package/src/lib/oas/graphql/index.ts +223 -73
  658. package/src/lib/oas/parser/dereference/index.ts +2 -0
  659. package/src/lib/oas/parser/index.ts +7 -29
  660. package/src/lib/oas/parser/upgrade/index.ts +2 -1
  661. package/src/lib/plugins/api-catalog/Catalog.tsx +53 -100
  662. package/src/lib/plugins/api-catalog/index.tsx +66 -15
  663. package/src/lib/plugins/api-keys/CreateApiKey.tsx +7 -3
  664. package/src/lib/plugins/api-keys/index.tsx +3 -0
  665. package/src/lib/plugins/markdown/MdxPage.tsx +13 -46
  666. package/src/lib/plugins/markdown/resolver.ts +0 -33
  667. package/src/lib/plugins/openapi/Endpoint.tsx +11 -9
  668. package/src/lib/plugins/openapi/OasProvider.tsx +51 -0
  669. package/src/lib/plugins/openapi/OperationList.tsx +180 -83
  670. package/src/lib/plugins/openapi/OperationListItem.tsx +118 -104
  671. package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
  672. package/src/lib/plugins/openapi/ParameterList.tsx +4 -0
  673. package/src/lib/plugins/openapi/ParameterListItem.tsx +33 -23
  674. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +15 -3
  675. package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
  676. package/src/lib/plugins/openapi/Sidecar.tsx +52 -16
  677. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -2
  678. package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
  679. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
  680. package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
  681. package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
  682. package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
  683. package/src/lib/plugins/openapi/graphql/gql.ts +34 -17
  684. package/src/lib/plugins/openapi/graphql/graphql.ts +175 -65
  685. package/src/lib/plugins/openapi/index.tsx +90 -152
  686. package/src/lib/plugins/openapi/interfaces.ts +48 -24
  687. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
  688. package/src/lib/plugins/openapi/playground/Headers.tsx +119 -88
  689. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
  690. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
  691. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +6 -1
  692. package/src/lib/plugins/openapi/playground/PathParams.tsx +16 -10
  693. package/src/lib/plugins/openapi/playground/Playground.tsx +207 -112
  694. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +5 -2
  695. package/src/lib/plugins/openapi/playground/QueryParams.tsx +87 -86
  696. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
  697. package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
  698. package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +1 -1
  699. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +25 -5
  700. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +67 -45
  701. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +29 -31
  702. package/src/lib/plugins/openapi/schema/SchemaView.tsx +48 -35
  703. package/src/lib/plugins/openapi/state.ts +36 -0
  704. package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +37 -0
  705. package/src/lib/plugins/openapi/util/getRoutes.tsx +126 -0
  706. package/src/lib/plugins/openapi/util/methodColorMap.tsx +11 -0
  707. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +157 -0
  708. package/src/lib/plugins/search-pagefind/ResultList.tsx +116 -0
  709. package/src/lib/plugins/search-pagefind/get-results.tsx +75 -0
  710. package/src/lib/plugins/search-pagefind/index.tsx +21 -0
  711. package/src/lib/plugins/search-pagefind/types.ts +118 -0
  712. package/src/lib/ui/Button.tsx +4 -2
  713. package/src/lib/ui/Callout.tsx +28 -10
  714. package/src/lib/ui/Checkbox.tsx +8 -24
  715. package/src/lib/ui/Command.tsx +25 -3
  716. package/src/lib/ui/Input.tsx +1 -2
  717. package/src/lib/ui/Select.tsx +1 -1
  718. package/src/lib/ui/Stepper.tsx +8 -0
  719. package/src/lib/ui/SyntaxHighlight.tsx +186 -0
  720. package/src/lib/ui/util.tsx +3 -0
  721. package/src/lib/util/MdxComponents.tsx +7 -4
  722. package/src/lib/util/joinPath.tsx +3 -0
  723. package/src/lib/util/scrollIntoViewIfNeeded.ts +18 -0
  724. package/src/lib/util/traverse.ts +4 -8
  725. package/src/lib/util/types.ts +7 -0
  726. package/src/lib/util/useLatest.ts +18 -0
  727. package/src/lib/util/useOnScreen.ts +6 -4
  728. package/src/lib/util/useScrollToAnchor.ts +31 -39
  729. package/src/lib/util/useScrollToTop.ts +8 -3
  730. package/dist/lib/components/SyntaxHighlight.d.ts +0 -12
  731. package/dist/lib/components/SyntaxHighlight.js +0 -53
  732. package/dist/lib/components/SyntaxHighlight.js.map +0 -1
  733. package/dist/lib/plugins/markdown/Toc.js.map +0 -1
  734. package/dist/lib/plugins/openapi/OpenApiRoute.js +0 -25
  735. package/dist/lib/plugins/openapi/OpenApiRoute.js.map +0 -1
  736. package/dist/vite/prerender.js +0 -89
  737. package/dist/vite/prerender.js.map +0 -1
  738. package/lib/Markdown-Cyrx_JrO.js.map +0 -1
  739. package/lib/MdxPage-BuG8Tuwc.js +0 -193
  740. package/lib/MdxPage-BuG8Tuwc.js.map +0 -1
  741. package/lib/OpenApiRoute-UrC_t0e5.js +0 -36
  742. package/lib/OpenApiRoute-UrC_t0e5.js.map +0 -1
  743. package/lib/OperationList-CDt1xdc4.js +0 -5169
  744. package/lib/OperationList-CDt1xdc4.js.map +0 -1
  745. package/lib/SlotletProvider-mQiPDQIH.js +0 -221
  746. package/lib/SlotletProvider-mQiPDQIH.js.map +0 -1
  747. package/lib/Spinner-BlzrEEk1.js +0 -51
  748. package/lib/Spinner-BlzrEEk1.js.map +0 -1
  749. package/lib/SyntaxHighlight-B0L4SC_N.js.map +0 -1
  750. package/lib/ZudokuContext-BTUJPpQl.js +0 -1229
  751. package/lib/ZudokuContext-BTUJPpQl.js.map +0 -1
  752. package/lib/__vite-browser-external-BYRIRx8p.js +0 -9
  753. package/lib/__vite-browser-external-BYRIRx8p.js.map +0 -1
  754. package/lib/chunk-SYFQ2XB5-BPvC-soB.js.map +0 -1
  755. package/lib/circular-DxaIIlWD.js.map +0 -1
  756. package/lib/context-rwLGh-6_.js +0 -22
  757. package/lib/createServer-CjNktZzL.js.map +0 -1
  758. package/lib/hook-FT3SJLe_.js.map +0 -1
  759. package/lib/index-B7mqiOei.js +0 -509
  760. package/lib/index-B7mqiOei.js.map +0 -1
  761. package/lib/index-Djenk2Hj.js +0 -36
  762. package/lib/index-Eb1oiHbM.js +0 -1997
  763. package/lib/index-Eb1oiHbM.js.map +0 -1
  764. package/lib/index.esm-9-TF9KQB.js +0 -692
  765. package/lib/index.esm-9-TF9KQB.js.map +0 -1
  766. package/lib/joinUrl-nLx9pD-Z.js +0 -20
  767. package/lib/joinUrl-nLx9pD-Z.js.map +0 -1
  768. package/lib/state-mM7uaXTW.js +0 -202
  769. package/lib/state-mM7uaXTW.js.map +0 -1
  770. package/lib/useScrollToAnchor-BZsGmBng.js +0 -284
  771. package/lib/useScrollToAnchor-BZsGmBng.js.map +0 -1
  772. package/src/lib/components/SyntaxHighlight.tsx +0 -171
  773. package/src/lib/plugins/openapi/OpenApiRoute.tsx +0 -51
  774. /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
@@ -1,1229 +0,0 @@
1
- var Ke = (t) => {
2
- throw TypeError(t);
3
- };
4
- var me = (t, e, s) => e.has(t) || Ke("Cannot " + s);
5
- var n = (t, e, s) => (me(t, e, "read from private field"), s ? s.call(t) : e.get(t)), f = (t, e, s) => e.has(t) ? Ke("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), h = (t, e, s, r) => (me(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), m = (t, e, s) => (me(t, e, "access private method"), s);
6
- import * as T from "react";
7
- import { createContext as pt, useContext as bt } from "react";
8
- import { j as mt } from "./jsx-runtime-Bdg6XQ1m.js";
9
- import { u as pe, m as vt } from "./chunk-SYFQ2XB5-BPvC-soB.js";
10
- var Ae = class {
11
- constructor() {
12
- this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
13
- }
14
- subscribe(t) {
15
- return this.listeners.add(t), this.onSubscribe(), () => {
16
- this.listeners.delete(t), this.onUnsubscribe();
17
- };
18
- }
19
- hasListeners() {
20
- return this.listeners.size > 0;
21
- }
22
- onSubscribe() {
23
- }
24
- onUnsubscribe() {
25
- }
26
- }, V = typeof window > "u" || "Deno" in globalThis;
27
- function ge() {
28
- }
29
- function Wt(t, e) {
30
- return typeof t == "function" ? t(e) : t;
31
- }
32
- function Se(t) {
33
- return typeof t == "number" && t >= 0 && t !== 1 / 0;
34
- }
35
- function et(t, e) {
36
- return Math.max(t + (e || 0) - Date.now(), 0);
37
- }
38
- function fe(t, e) {
39
- return typeof t == "function" ? t(e) : t;
40
- }
41
- function x(t, e) {
42
- return typeof t == "function" ? t(e) : t;
43
- }
44
- function Jt(t, e) {
45
- const {
46
- type: s = "all",
47
- exact: r,
48
- fetchStatus: i,
49
- predicate: o,
50
- queryKey: a,
51
- stale: u
52
- } = t;
53
- if (a) {
54
- if (r) {
55
- if (e.queryHash !== gt(a, e.options))
56
- return !1;
57
- } else if (!Qe(e.queryKey, a))
58
- return !1;
59
- }
60
- if (s !== "all") {
61
- const l = e.isActive();
62
- if (s === "active" && !l || s === "inactive" && l)
63
- return !1;
64
- }
65
- return !(typeof u == "boolean" && e.isStale() !== u || i && i !== e.state.fetchStatus || o && !o(e));
66
- }
67
- function Yt(t, e) {
68
- const { exact: s, status: r, predicate: i, mutationKey: o } = t;
69
- if (o) {
70
- if (!e.options.mutationKey)
71
- return !1;
72
- if (s) {
73
- if (Ce(e.options.mutationKey) !== Ce(o))
74
- return !1;
75
- } else if (!Qe(e.options.mutationKey, o))
76
- return !1;
77
- }
78
- return !(r && e.state.status !== r || i && !i(e));
79
- }
80
- function gt(t, e) {
81
- return ((e == null ? void 0 : e.queryKeyHashFn) || Ce)(t);
82
- }
83
- function Ce(t) {
84
- return JSON.stringify(
85
- t,
86
- (e, s) => Ee(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
87
- );
88
- }
89
- function Qe(t, e) {
90
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !Qe(t[s], e[s])) : !1;
91
- }
92
- function Re(t, e) {
93
- if (t === e)
94
- return t;
95
- const s = He(t) && He(e);
96
- if (s || Ee(t) && Ee(e)) {
97
- const r = s ? t : Object.keys(t), i = r.length, o = s ? e : Object.keys(e), a = o.length, u = s ? [] : {};
98
- let l = 0;
99
- for (let S = 0; S < a; S++) {
100
- const v = s ? S : o[S];
101
- (!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (u[v] = void 0, l++) : (u[v] = Re(t[v], e[v]), u[v] === t[v] && t[v] !== void 0 && l++);
102
- }
103
- return i === a && l === i ? t : u;
104
- }
105
- return e;
106
- }
107
- function we(t, e) {
108
- if (!e || Object.keys(t).length !== Object.keys(e).length)
109
- return !1;
110
- for (const s in t)
111
- if (t[s] !== e[s])
112
- return !1;
113
- return !0;
114
- }
115
- function He(t) {
116
- return Array.isArray(t) && t.length === Object.keys(t).length;
117
- }
118
- function Ee(t) {
119
- if (!Be(t))
120
- return !1;
121
- const e = t.constructor;
122
- if (e === void 0)
123
- return !0;
124
- const s = e.prototype;
125
- return !(!Be(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
126
- }
127
- function Be(t) {
128
- return Object.prototype.toString.call(t) === "[object Object]";
129
- }
130
- function St(t) {
131
- return new Promise((e) => {
132
- setTimeout(e, t);
133
- });
134
- }
135
- function Oe(t, e, s) {
136
- if (typeof s.structuralSharing == "function")
137
- return s.structuralSharing(t, e);
138
- if (s.structuralSharing !== !1) {
139
- if (process.env.NODE_ENV !== "production")
140
- try {
141
- return Re(t, e);
142
- } catch (r) {
143
- console.error(
144
- `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}`
145
- );
146
- }
147
- return Re(t, e);
148
- }
149
- return e;
150
- }
151
- function Xt(t, e, s = 0) {
152
- const r = [...t, e];
153
- return s && r.length > s ? r.slice(1) : r;
154
- }
155
- function es(t, e, s = 0) {
156
- const r = [e, ...t];
157
- return s && r.length > s ? r.slice(0, -1) : r;
158
- }
159
- var ye = Symbol();
160
- function Ct(t, e) {
161
- return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error(
162
- `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
163
- ), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ye ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
164
- }
165
- var _, Q, J, Ze, Rt = (Ze = class extends Ae {
166
- constructor() {
167
- super();
168
- f(this, _);
169
- f(this, Q);
170
- f(this, J);
171
- h(this, J, (e) => {
172
- if (!V && window.addEventListener) {
173
- const s = () => e();
174
- return window.addEventListener("visibilitychange", s, !1), () => {
175
- window.removeEventListener("visibilitychange", s);
176
- };
177
- }
178
- });
179
- }
180
- onSubscribe() {
181
- n(this, Q) || this.setEventListener(n(this, J));
182
- }
183
- onUnsubscribe() {
184
- var e;
185
- this.hasListeners() || ((e = n(this, Q)) == null || e.call(this), h(this, Q, void 0));
186
- }
187
- setEventListener(e) {
188
- var s;
189
- h(this, J, e), (s = n(this, Q)) == null || s.call(this), h(this, Q, e((r) => {
190
- typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
191
- }));
192
- }
193
- setFocused(e) {
194
- n(this, _) !== e && (h(this, _, e), this.onFocus());
195
- }
196
- onFocus() {
197
- const e = this.isFocused();
198
- this.listeners.forEach((s) => {
199
- s(e);
200
- });
201
- }
202
- isFocused() {
203
- var e;
204
- return typeof n(this, _) == "boolean" ? n(this, _) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
205
- }
206
- }, _ = new WeakMap(), Q = new WeakMap(), J = new WeakMap(), Ze), tt = new Rt(), Y, U, X, We, wt = (We = class extends Ae {
207
- constructor() {
208
- super();
209
- f(this, Y, !0);
210
- f(this, U);
211
- f(this, X);
212
- h(this, X, (e) => {
213
- if (!V && window.addEventListener) {
214
- const s = () => e(!0), r = () => e(!1);
215
- return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
216
- window.removeEventListener("online", s), window.removeEventListener("offline", r);
217
- };
218
- }
219
- });
220
- }
221
- onSubscribe() {
222
- n(this, U) || this.setEventListener(n(this, X));
223
- }
224
- onUnsubscribe() {
225
- var e;
226
- this.hasListeners() || ((e = n(this, U)) == null || e.call(this), h(this, U, void 0));
227
- }
228
- setEventListener(e) {
229
- var s;
230
- h(this, X, e), (s = n(this, U)) == null || s.call(this), h(this, U, e(this.setOnline.bind(this)));
231
- }
232
- setOnline(e) {
233
- n(this, Y) !== e && (h(this, Y, e), this.listeners.forEach((r) => {
234
- r(e);
235
- }));
236
- }
237
- isOnline() {
238
- return n(this, Y);
239
- }
240
- }, Y = new WeakMap(), U = new WeakMap(), X = new WeakMap(), We), st = new wt();
241
- function Fe() {
242
- let t, e;
243
- const s = new Promise((i, o) => {
244
- t = i, e = o;
245
- });
246
- s.status = "pending", s.catch(() => {
247
- });
248
- function r(i) {
249
- Object.assign(s, i), delete s.resolve, delete s.reject;
250
- }
251
- return s.resolve = (i) => {
252
- r({
253
- status: "fulfilled",
254
- value: i
255
- }), t(i);
256
- }, s.reject = (i) => {
257
- r({
258
- status: "rejected",
259
- reason: i
260
- }), e(i);
261
- }, s;
262
- }
263
- function Et(t) {
264
- return Math.min(1e3 * 2 ** t, 3e4);
265
- }
266
- function rt(t) {
267
- return (t ?? "online") === "online" ? st.isOnline() : !0;
268
- }
269
- var nt = class extends Error {
270
- constructor(t) {
271
- super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
272
- }
273
- };
274
- function ve(t) {
275
- return t instanceof nt;
276
- }
277
- function Ot(t) {
278
- let e = !1, s = 0, r = !1, i;
279
- const o = Fe(), a = (b) => {
280
- var p;
281
- r || (C(new nt(b)), (p = t.abort) == null || p.call(t));
282
- }, u = () => {
283
- e = !0;
284
- }, l = () => {
285
- e = !1;
286
- }, S = () => tt.isFocused() && (t.networkMode === "always" || st.isOnline()) && t.canRun(), v = () => rt(t.networkMode) && t.canRun(), c = (b) => {
287
- var p;
288
- r || (r = !0, (p = t.onSuccess) == null || p.call(t, b), i == null || i(), o.resolve(b));
289
- }, C = (b) => {
290
- var p;
291
- r || (r = !0, (p = t.onError) == null || p.call(t, b), i == null || i(), o.reject(b));
292
- }, g = () => new Promise((b) => {
293
- var p;
294
- i = (E) => {
295
- (r || S()) && b(E);
296
- }, (p = t.onPause) == null || p.call(t);
297
- }).then(() => {
298
- var b;
299
- i = void 0, r || (b = t.onContinue) == null || b.call(t);
300
- }), w = () => {
301
- if (r)
302
- return;
303
- let b;
304
- const p = s === 0 ? t.initialPromise : void 0;
305
- try {
306
- b = p ?? t.fn();
307
- } catch (E) {
308
- b = Promise.reject(E);
309
- }
310
- Promise.resolve(b).then(c).catch((E) => {
311
- var be;
312
- if (r)
313
- return;
314
- const q = t.retry ?? (V ? 0 : 3), N = t.retryDelay ?? Et, he = typeof N == "function" ? N(s, E) : N, le = q === !0 || typeof q == "number" && s < q || typeof q == "function" && q(s, E);
315
- if (e || !le) {
316
- C(E);
317
- return;
318
- }
319
- s++, (be = t.onFail) == null || be.call(t, s, E), St(he).then(() => S() ? void 0 : g()).then(() => {
320
- e ? C(E) : w();
321
- });
322
- });
323
- };
324
- return {
325
- promise: o,
326
- cancel: a,
327
- continue: () => (i == null || i(), o),
328
- cancelRetry: u,
329
- continueRetry: l,
330
- canStart: v,
331
- start: () => (v() ? w() : g().then(w), o)
332
- };
333
- }
334
- function Ft() {
335
- let t = [], e = 0, s = (u) => {
336
- u();
337
- }, r = (u) => {
338
- u();
339
- }, i = (u) => setTimeout(u, 0);
340
- const o = (u) => {
341
- e ? t.push(u) : i(() => {
342
- s(u);
343
- });
344
- }, a = () => {
345
- const u = t;
346
- t = [], u.length && i(() => {
347
- r(() => {
348
- u.forEach((l) => {
349
- s(l);
350
- });
351
- });
352
- });
353
- };
354
- return {
355
- batch: (u) => {
356
- let l;
357
- e++;
358
- try {
359
- l = u();
360
- } finally {
361
- e--, e || a();
362
- }
363
- return l;
364
- },
365
- /**
366
- * All calls to the wrapped function will be batched.
367
- */
368
- batchCalls: (u) => (...l) => {
369
- o(() => {
370
- u(...l);
371
- });
372
- },
373
- schedule: o,
374
- /**
375
- * Use this method to set a custom notify function.
376
- * This can be used to for example wrap notifications with `React.act` while running tests.
377
- */
378
- setNotifyFunction: (u) => {
379
- s = u;
380
- },
381
- /**
382
- * Use this method to set a custom function to batch notifications together into a single tick.
383
- * By default React Query will use the batch function provided by ReactDOM or React Native.
384
- */
385
- setBatchNotifyFunction: (u) => {
386
- r = u;
387
- },
388
- setScheduler: (u) => {
389
- i = u;
390
- }
391
- };
392
- }
393
- var Ue = Ft(), K, Je, It = (Je = class {
394
- constructor() {
395
- f(this, K);
396
- }
397
- destroy() {
398
- this.clearGcTimeout();
399
- }
400
- scheduleGc() {
401
- this.clearGcTimeout(), Se(this.gcTime) && h(this, K, setTimeout(() => {
402
- this.optionalRemove();
403
- }, this.gcTime));
404
- }
405
- updateGcTime(t) {
406
- this.gcTime = Math.max(
407
- this.gcTime || 0,
408
- t ?? (V ? 1 / 0 : 5 * 60 * 1e3)
409
- );
410
- }
411
- clearGcTimeout() {
412
- n(this, K) && (clearTimeout(n(this, K)), h(this, K, void 0));
413
- }
414
- }, K = new WeakMap(), Je), ee, te, P, R, ue, H, D, A, Ye, ts = (Ye = class extends It {
415
- constructor(e) {
416
- super();
417
- f(this, D);
418
- f(this, ee);
419
- f(this, te);
420
- f(this, P);
421
- f(this, R);
422
- f(this, ue);
423
- f(this, H);
424
- h(this, H, !1), h(this, ue, e.defaultOptions), this.setOptions(e.options), this.observers = [], h(this, P, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, h(this, ee, Pt(this.options)), this.state = e.state ?? n(this, ee), this.scheduleGc();
425
- }
426
- get meta() {
427
- return this.options.meta;
428
- }
429
- get promise() {
430
- var e;
431
- return (e = n(this, R)) == null ? void 0 : e.promise;
432
- }
433
- setOptions(e) {
434
- this.options = { ...n(this, ue), ...e }, this.updateGcTime(this.options.gcTime);
435
- }
436
- optionalRemove() {
437
- !this.observers.length && this.state.fetchStatus === "idle" && n(this, P).remove(this);
438
- }
439
- setData(e, s) {
440
- const r = Oe(this.state.data, e, this.options);
441
- return m(this, D, A).call(this, {
442
- data: r,
443
- type: "success",
444
- dataUpdatedAt: s == null ? void 0 : s.updatedAt,
445
- manual: s == null ? void 0 : s.manual
446
- }), r;
447
- }
448
- setState(e, s) {
449
- m(this, D, A).call(this, { type: "setState", state: e, setStateOptions: s });
450
- }
451
- cancel(e) {
452
- var r, i;
453
- const s = (r = n(this, R)) == null ? void 0 : r.promise;
454
- return (i = n(this, R)) == null || i.cancel(e), s ? s.then(ge).catch(ge) : Promise.resolve();
455
- }
456
- destroy() {
457
- super.destroy(), this.cancel({ silent: !0 });
458
- }
459
- reset() {
460
- this.destroy(), this.setState(n(this, ee));
461
- }
462
- isActive() {
463
- return this.observers.some(
464
- (e) => x(e.options.enabled, this) !== !1
465
- );
466
- }
467
- isDisabled() {
468
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === ye || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
469
- }
470
- isStale() {
471
- return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
472
- (e) => e.getCurrentResult().isStale
473
- ) : this.state.data === void 0;
474
- }
475
- isStaleByTime(e = 0) {
476
- return this.state.isInvalidated || this.state.data === void 0 || !et(this.state.dataUpdatedAt, e);
477
- }
478
- onFocus() {
479
- var s;
480
- const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
481
- e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, R)) == null || s.continue();
482
- }
483
- onOnline() {
484
- var s;
485
- const e = this.observers.find((r) => r.shouldFetchOnReconnect());
486
- e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, R)) == null || s.continue();
487
- }
488
- addObserver(e) {
489
- this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), n(this, P).notify({ type: "observerAdded", query: this, observer: e }));
490
- }
491
- removeObserver(e) {
492
- this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (n(this, R) && (n(this, H) ? n(this, R).cancel({ revert: !0 }) : n(this, R).cancelRetry()), this.scheduleGc()), n(this, P).notify({ type: "observerRemoved", query: this, observer: e }));
493
- }
494
- getObserversCount() {
495
- return this.observers.length;
496
- }
497
- invalidate() {
498
- this.state.isInvalidated || m(this, D, A).call(this, { type: "invalidate" });
499
- }
500
- fetch(e, s) {
501
- var l, S, v;
502
- if (this.state.fetchStatus !== "idle") {
503
- if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
504
- this.cancel({ silent: !0 });
505
- else if (n(this, R))
506
- return n(this, R).continueRetry(), n(this, R).promise;
507
- }
508
- if (e && this.setOptions(e), !this.options.queryFn) {
509
- const c = this.observers.find((C) => C.options.queryFn);
510
- c && this.setOptions(c.options);
511
- }
512
- process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
513
- "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']"
514
- ));
515
- const r = new AbortController(), i = (c) => {
516
- Object.defineProperty(c, "signal", {
517
- enumerable: !0,
518
- get: () => (h(this, H, !0), r.signal)
519
- });
520
- }, o = () => {
521
- const c = Ct(this.options, s), C = {
522
- queryKey: this.queryKey,
523
- meta: this.meta
524
- };
525
- return i(C), h(this, H, !1), this.options.persister ? this.options.persister(
526
- c,
527
- C,
528
- this
529
- ) : c(C);
530
- }, a = {
531
- fetchOptions: s,
532
- options: this.options,
533
- queryKey: this.queryKey,
534
- state: this.state,
535
- fetchFn: o
536
- };
537
- i(a), (l = this.options.behavior) == null || l.onFetch(
538
- a,
539
- this
540
- ), h(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((S = a.fetchOptions) == null ? void 0 : S.meta)) && m(this, D, A).call(this, { type: "fetch", meta: (v = a.fetchOptions) == null ? void 0 : v.meta });
541
- const u = (c) => {
542
- var C, g, w, b;
543
- ve(c) && c.silent || m(this, D, A).call(this, {
544
- type: "error",
545
- error: c
546
- }), ve(c) || ((g = (C = n(this, P).config).onError) == null || g.call(
547
- C,
548
- c,
549
- this
550
- ), (b = (w = n(this, P).config).onSettled) == null || b.call(
551
- w,
552
- this.state.data,
553
- c,
554
- this
555
- )), this.scheduleGc();
556
- };
557
- return h(this, R, Ot({
558
- initialPromise: s == null ? void 0 : s.initialPromise,
559
- fn: a.fetchFn,
560
- abort: r.abort.bind(r),
561
- onSuccess: (c) => {
562
- var C, g, w, b;
563
- if (c === void 0) {
564
- process.env.NODE_ENV !== "production" && console.error(
565
- `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
566
- ), u(new Error(`${this.queryHash} data is undefined`));
567
- return;
568
- }
569
- try {
570
- this.setData(c);
571
- } catch (p) {
572
- u(p);
573
- return;
574
- }
575
- (g = (C = n(this, P).config).onSuccess) == null || g.call(C, c, this), (b = (w = n(this, P).config).onSettled) == null || b.call(
576
- w,
577
- c,
578
- this.state.error,
579
- this
580
- ), this.scheduleGc();
581
- },
582
- onError: u,
583
- onFail: (c, C) => {
584
- m(this, D, A).call(this, { type: "failed", failureCount: c, error: C });
585
- },
586
- onPause: () => {
587
- m(this, D, A).call(this, { type: "pause" });
588
- },
589
- onContinue: () => {
590
- m(this, D, A).call(this, { type: "continue" });
591
- },
592
- retry: a.options.retry,
593
- retryDelay: a.options.retryDelay,
594
- networkMode: a.options.networkMode,
595
- canRun: () => !0
596
- })), n(this, R).start();
597
- }
598
- }, ee = new WeakMap(), te = new WeakMap(), P = new WeakMap(), R = new WeakMap(), ue = new WeakMap(), H = new WeakMap(), D = new WeakSet(), A = function(e) {
599
- const s = (r) => {
600
- switch (e.type) {
601
- case "failed":
602
- return {
603
- ...r,
604
- fetchFailureCount: e.failureCount,
605
- fetchFailureReason: e.error
606
- };
607
- case "pause":
608
- return {
609
- ...r,
610
- fetchStatus: "paused"
611
- };
612
- case "continue":
613
- return {
614
- ...r,
615
- fetchStatus: "fetching"
616
- };
617
- case "fetch":
618
- return {
619
- ...r,
620
- ...it(r.data, this.options),
621
- fetchMeta: e.meta ?? null
622
- };
623
- case "success":
624
- return {
625
- ...r,
626
- data: e.data,
627
- dataUpdateCount: r.dataUpdateCount + 1,
628
- dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
629
- error: null,
630
- isInvalidated: !1,
631
- status: "success",
632
- ...!e.manual && {
633
- fetchStatus: "idle",
634
- fetchFailureCount: 0,
635
- fetchFailureReason: null
636
- }
637
- };
638
- case "error":
639
- const i = e.error;
640
- return ve(i) && i.revert && n(this, te) ? { ...n(this, te), fetchStatus: "idle" } : {
641
- ...r,
642
- error: i,
643
- errorUpdateCount: r.errorUpdateCount + 1,
644
- errorUpdatedAt: Date.now(),
645
- fetchFailureCount: r.fetchFailureCount + 1,
646
- fetchFailureReason: i,
647
- fetchStatus: "idle",
648
- status: "error"
649
- };
650
- case "invalidate":
651
- return {
652
- ...r,
653
- isInvalidated: !0
654
- };
655
- case "setState":
656
- return {
657
- ...r,
658
- ...e.state
659
- };
660
- }
661
- };
662
- this.state = s(this.state), Ue.batch(() => {
663
- this.observers.forEach((r) => {
664
- r.onQueryUpdate();
665
- }), n(this, P).notify({ query: this, type: "updated", action: e });
666
- });
667
- }, Ye);
668
- function it(t, e) {
669
- return {
670
- fetchFailureCount: 0,
671
- fetchFailureReason: null,
672
- fetchStatus: rt(e.networkMode) ? "fetching" : "paused",
673
- ...t === void 0 && {
674
- error: null,
675
- status: "pending"
676
- }
677
- };
678
- }
679
- function Pt(t) {
680
- 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;
681
- return {
682
- data: e,
683
- dataUpdateCount: 0,
684
- dataUpdatedAt: s ? r ?? Date.now() : 0,
685
- error: null,
686
- errorUpdateCount: 0,
687
- errorUpdatedAt: 0,
688
- fetchFailureCount: 0,
689
- fetchFailureReason: null,
690
- fetchMeta: null,
691
- isInvalidated: !1,
692
- status: s ? "success" : "pending",
693
- fetchStatus: "idle"
694
- };
695
- }
696
- var I, d, oe, F, B, se, M, k, ce, re, ne, G, z, L, ie, y, ae, Ie, Pe, Te, De, xe, je, ke, ut, Xe, at = (Xe = class extends Ae {
697
- constructor(e, s) {
698
- super();
699
- f(this, y);
700
- f(this, I);
701
- f(this, d);
702
- f(this, oe);
703
- f(this, F);
704
- f(this, B);
705
- f(this, se);
706
- f(this, M);
707
- f(this, k);
708
- f(this, ce);
709
- f(this, re);
710
- // This property keeps track of the last query with defined data.
711
- // It will be used to pass the previous data and query to the placeholder function between renders.
712
- f(this, ne);
713
- f(this, G);
714
- f(this, z);
715
- f(this, L);
716
- f(this, ie, /* @__PURE__ */ new Set());
717
- this.options = s, h(this, I, e), h(this, k, null), h(this, M, Fe()), this.options.experimental_prefetchInRender || n(this, M).reject(
718
- new Error("experimental_prefetchInRender feature flag is not enabled")
719
- ), this.bindMethods(), this.setOptions(s);
720
- }
721
- bindMethods() {
722
- this.refetch = this.refetch.bind(this);
723
- }
724
- onSubscribe() {
725
- this.listeners.size === 1 && (n(this, d).addObserver(this), Ge(n(this, d), this.options) ? m(this, y, ae).call(this) : this.updateResult(), m(this, y, De).call(this));
726
- }
727
- onUnsubscribe() {
728
- this.hasListeners() || this.destroy();
729
- }
730
- shouldFetchOnReconnect() {
731
- return qe(
732
- n(this, d),
733
- this.options,
734
- this.options.refetchOnReconnect
735
- );
736
- }
737
- shouldFetchOnWindowFocus() {
738
- return qe(
739
- n(this, d),
740
- this.options,
741
- this.options.refetchOnWindowFocus
742
- );
743
- }
744
- destroy() {
745
- this.listeners = /* @__PURE__ */ new Set(), m(this, y, xe).call(this), m(this, y, je).call(this), n(this, d).removeObserver(this);
746
- }
747
- setOptions(e, s) {
748
- const r = this.options, i = n(this, d);
749
- if (this.options = n(this, I).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof x(this.options.enabled, n(this, d)) != "boolean")
750
- throw new Error(
751
- "Expected enabled to be a boolean or a callback that returns a boolean"
752
- );
753
- m(this, y, ke).call(this), n(this, d).setOptions(this.options), r._defaulted && !we(this.options, r) && n(this, I).getQueryCache().notify({
754
- type: "observerOptionsUpdated",
755
- query: n(this, d),
756
- observer: this
757
- });
758
- const o = this.hasListeners();
759
- o && ze(
760
- n(this, d),
761
- i,
762
- this.options,
763
- r
764
- ) && m(this, y, ae).call(this), this.updateResult(s), o && (n(this, d) !== i || x(this.options.enabled, n(this, d)) !== x(r.enabled, n(this, d)) || fe(this.options.staleTime, n(this, d)) !== fe(r.staleTime, n(this, d))) && m(this, y, Ie).call(this);
765
- const a = m(this, y, Pe).call(this);
766
- o && (n(this, d) !== i || x(this.options.enabled, n(this, d)) !== x(r.enabled, n(this, d)) || a !== n(this, L)) && m(this, y, Te).call(this, a);
767
- }
768
- getOptimisticResult(e) {
769
- const s = n(this, I).getQueryCache().build(n(this, I), e), r = this.createResult(s, e);
770
- return Dt(this, r) && (h(this, F, r), h(this, se, this.options), h(this, B, n(this, d).state)), r;
771
- }
772
- getCurrentResult() {
773
- return n(this, F);
774
- }
775
- trackResult(e, s) {
776
- const r = {};
777
- return Object.keys(e).forEach((i) => {
778
- Object.defineProperty(r, i, {
779
- configurable: !1,
780
- enumerable: !0,
781
- get: () => (this.trackProp(i), s == null || s(i), e[i])
782
- });
783
- }), r;
784
- }
785
- trackProp(e) {
786
- n(this, ie).add(e);
787
- }
788
- getCurrentQuery() {
789
- return n(this, d);
790
- }
791
- refetch({ ...e } = {}) {
792
- return this.fetch({
793
- ...e
794
- });
795
- }
796
- fetchOptimistic(e) {
797
- const s = n(this, I).defaultQueryOptions(e), r = n(this, I).getQueryCache().build(n(this, I), s);
798
- return r.fetch().then(() => this.createResult(r, s));
799
- }
800
- fetch(e) {
801
- return m(this, y, ae).call(this, {
802
- ...e,
803
- cancelRefetch: e.cancelRefetch ?? !0
804
- }).then(() => (this.updateResult(), n(this, F)));
805
- }
806
- createResult(e, s) {
807
- var _e;
808
- const r = n(this, d), i = this.options, o = n(this, F), a = n(this, B), u = n(this, se), S = e !== r ? e.state : n(this, oe), { state: v } = e;
809
- let c = { ...v }, C = !1, g;
810
- if (s._optimisticResults) {
811
- const O = this.hasListeners(), Z = !O && Ge(e, s), W = O && ze(e, r, s, i);
812
- (Z || W) && (c = {
813
- ...c,
814
- ...it(v.data, e.options)
815
- }), s._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
816
- }
817
- let { error: w, errorUpdatedAt: b, status: p } = c;
818
- if (s.select && c.data !== void 0)
819
- if (o && c.data === (a == null ? void 0 : a.data) && s.select === n(this, ce))
820
- g = n(this, re);
821
- else
822
- try {
823
- h(this, ce, s.select), g = s.select(c.data), g = Oe(o == null ? void 0 : o.data, g, s), h(this, re, g), h(this, k, null);
824
- } catch (O) {
825
- h(this, k, O);
826
- }
827
- else
828
- g = c.data;
829
- if (s.placeholderData !== void 0 && g === void 0 && p === "pending") {
830
- let O;
831
- if (o != null && o.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData))
832
- O = o.data;
833
- else if (O = typeof s.placeholderData == "function" ? s.placeholderData(
834
- (_e = n(this, ne)) == null ? void 0 : _e.state.data,
835
- n(this, ne)
836
- ) : s.placeholderData, s.select && O !== void 0)
837
- try {
838
- O = s.select(O), h(this, k, null);
839
- } catch (Z) {
840
- h(this, k, Z);
841
- }
842
- O !== void 0 && (p = "success", g = Oe(
843
- o == null ? void 0 : o.data,
844
- O,
845
- s
846
- ), C = !0);
847
- }
848
- n(this, k) && (w = n(this, k), g = n(this, re), b = Date.now(), p = "error");
849
- const E = c.fetchStatus === "fetching", q = p === "pending", N = p === "error", he = q && E, le = g !== void 0, j = {
850
- status: p,
851
- fetchStatus: c.fetchStatus,
852
- isPending: q,
853
- isSuccess: p === "success",
854
- isError: N,
855
- isInitialLoading: he,
856
- isLoading: he,
857
- data: g,
858
- dataUpdatedAt: c.dataUpdatedAt,
859
- error: w,
860
- errorUpdatedAt: b,
861
- failureCount: c.fetchFailureCount,
862
- failureReason: c.fetchFailureReason,
863
- errorUpdateCount: c.errorUpdateCount,
864
- isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
865
- isFetchedAfterMount: c.dataUpdateCount > S.dataUpdateCount || c.errorUpdateCount > S.errorUpdateCount,
866
- isFetching: E,
867
- isRefetching: E && !q,
868
- isLoadingError: N && !le,
869
- isPaused: c.fetchStatus === "paused",
870
- isPlaceholderData: C,
871
- isRefetchError: N && le,
872
- isStale: Me(e, s),
873
- refetch: this.refetch,
874
- promise: n(this, M)
875
- };
876
- if (this.options.experimental_prefetchInRender) {
877
- const O = (de) => {
878
- j.status === "error" ? de.reject(j.error) : j.data !== void 0 && de.resolve(j.data);
879
- }, Z = () => {
880
- const de = h(this, M, j.promise = Fe());
881
- O(de);
882
- }, W = n(this, M);
883
- switch (W.status) {
884
- case "pending":
885
- e.queryHash === r.queryHash && O(W);
886
- break;
887
- case "fulfilled":
888
- (j.status === "error" || j.data !== W.value) && Z();
889
- break;
890
- case "rejected":
891
- (j.status !== "error" || j.error !== W.reason) && Z();
892
- break;
893
- }
894
- }
895
- return j;
896
- }
897
- updateResult(e) {
898
- const s = n(this, F), r = this.createResult(n(this, d), this.options);
899
- if (h(this, B, n(this, d).state), h(this, se, this.options), n(this, B).data !== void 0 && h(this, ne, n(this, d)), we(r, s))
900
- return;
901
- h(this, F, r);
902
- const i = {}, o = () => {
903
- if (!s)
904
- return !0;
905
- const { notifyOnChangeProps: a } = this.options, u = typeof a == "function" ? a() : a;
906
- if (u === "all" || !u && !n(this, ie).size)
907
- return !0;
908
- const l = new Set(
909
- u ?? n(this, ie)
910
- );
911
- return this.options.throwOnError && l.add("error"), Object.keys(n(this, F)).some((S) => {
912
- const v = S;
913
- return n(this, F)[v] !== s[v] && l.has(v);
914
- });
915
- };
916
- (e == null ? void 0 : e.listeners) !== !1 && o() && (i.listeners = !0), m(this, y, ut).call(this, { ...i, ...e });
917
- }
918
- onQueryUpdate() {
919
- this.updateResult(), this.hasListeners() && m(this, y, De).call(this);
920
- }
921
- }, I = new WeakMap(), d = new WeakMap(), oe = new WeakMap(), F = new WeakMap(), B = new WeakMap(), se = new WeakMap(), M = new WeakMap(), k = new WeakMap(), ce = new WeakMap(), re = new WeakMap(), ne = new WeakMap(), G = new WeakMap(), z = new WeakMap(), L = new WeakMap(), ie = new WeakMap(), y = new WeakSet(), ae = function(e) {
922
- m(this, y, ke).call(this);
923
- let s = n(this, d).fetch(
924
- this.options,
925
- e
926
- );
927
- return e != null && e.throwOnError || (s = s.catch(ge)), s;
928
- }, Ie = function() {
929
- m(this, y, xe).call(this);
930
- const e = fe(
931
- this.options.staleTime,
932
- n(this, d)
933
- );
934
- if (V || n(this, F).isStale || !Se(e))
935
- return;
936
- const r = et(n(this, F).dataUpdatedAt, e) + 1;
937
- h(this, G, setTimeout(() => {
938
- n(this, F).isStale || this.updateResult();
939
- }, r));
940
- }, Pe = function() {
941
- return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this, d)) : this.options.refetchInterval) ?? !1;
942
- }, Te = function(e) {
943
- m(this, y, je).call(this), h(this, L, e), !(V || x(this.options.enabled, n(this, d)) === !1 || !Se(n(this, L)) || n(this, L) === 0) && h(this, z, setInterval(() => {
944
- (this.options.refetchIntervalInBackground || tt.isFocused()) && m(this, y, ae).call(this);
945
- }, n(this, L)));
946
- }, De = function() {
947
- m(this, y, Ie).call(this), m(this, y, Te).call(this, m(this, y, Pe).call(this));
948
- }, xe = function() {
949
- n(this, G) && (clearTimeout(n(this, G)), h(this, G, void 0));
950
- }, je = function() {
951
- n(this, z) && (clearInterval(n(this, z)), h(this, z, void 0));
952
- }, ke = function() {
953
- const e = n(this, I).getQueryCache().build(n(this, I), this.options);
954
- if (e === n(this, d))
955
- return;
956
- const s = n(this, d);
957
- h(this, d, e), h(this, oe, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
958
- }, ut = function(e) {
959
- Ue.batch(() => {
960
- e.listeners && this.listeners.forEach((s) => {
961
- s(n(this, F));
962
- }), n(this, I).getQueryCache().notify({
963
- query: n(this, d),
964
- type: "observerResultsUpdated"
965
- });
966
- });
967
- }, Xe);
968
- function Tt(t, e) {
969
- return x(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
970
- }
971
- function Ge(t, e) {
972
- return Tt(t, e) || t.state.data !== void 0 && qe(t, e, e.refetchOnMount);
973
- }
974
- function qe(t, e, s) {
975
- if (x(e.enabled, t) !== !1) {
976
- const r = typeof s == "function" ? s(t) : s;
977
- return r === "always" || r !== !1 && Me(t, e);
978
- }
979
- return !1;
980
- }
981
- function ze(t, e, s, r) {
982
- return (t !== e || x(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Me(t, s);
983
- }
984
- function Me(t, e) {
985
- return x(e.enabled, t) !== !1 && t.isStaleByTime(fe(e.staleTime, t));
986
- }
987
- function Dt(t, e) {
988
- return !we(t.getCurrentResult(), e);
989
- }
990
- var ot = T.createContext(
991
- void 0
992
- ), ct = (t) => {
993
- const e = T.useContext(ot);
994
- if (t)
995
- return t;
996
- if (!e)
997
- throw new Error("No QueryClient set, use QueryClientProvider to set one");
998
- return e;
999
- }, ss = ({
1000
- client: t,
1001
- children: e
1002
- }) => (T.useEffect(() => (t.mount(), () => {
1003
- t.unmount();
1004
- }), [t]), /* @__PURE__ */ mt.jsx(ot.Provider, { value: t, children: e })), ht = T.createContext(!1), xt = () => T.useContext(ht);
1005
- ht.Provider;
1006
- function jt() {
1007
- let t = !1;
1008
- return {
1009
- clearReset: () => {
1010
- t = !1;
1011
- },
1012
- reset: () => {
1013
- t = !0;
1014
- },
1015
- isReset: () => t
1016
- };
1017
- }
1018
- var kt = T.createContext(jt()), qt = () => T.useContext(kt);
1019
- function At(t, e) {
1020
- return typeof t == "function" ? t(...e) : !!t;
1021
- }
1022
- function Ve() {
1023
- }
1024
- var Qt = (t, e) => {
1025
- (t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
1026
- }, Ut = (t) => {
1027
- T.useEffect(() => {
1028
- t.clearReset();
1029
- }, [t]);
1030
- }, Mt = ({
1031
- result: t,
1032
- errorResetBoundary: e,
1033
- throwOnError: s,
1034
- query: r
1035
- }) => t.isError && !e.isReset() && !t.isFetching && r && At(s, [t.error, r]), Lt = (t, e) => e.state.data === void 0, Nt = (t) => {
1036
- const e = t.staleTime;
1037
- 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)));
1038
- }, _t = (t, e) => t.isLoading && t.isFetching && !e, Kt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, $e = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1039
- s.clearReset();
1040
- });
1041
- function lt(t, e, s) {
1042
- var c, C, g, w, b;
1043
- if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1044
- throw new Error(
1045
- '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'
1046
- );
1047
- const r = ct(s), i = xt(), o = qt(), a = r.defaultQueryOptions(t);
1048
- (C = (c = r.getDefaultOptions().queries) == null ? void 0 : c._experimental_beforeQuery) == null || C.call(
1049
- c,
1050
- a
1051
- ), a._optimisticResults = i ? "isRestoring" : "optimistic", Nt(a), Qt(a, o), Ut(o);
1052
- const u = !r.getQueryCache().get(a.queryHash), [l] = T.useState(
1053
- () => new e(
1054
- r,
1055
- a
1056
- )
1057
- ), S = l.getOptimisticResult(a), v = !i && t.subscribed !== !1;
1058
- if (T.useSyncExternalStore(
1059
- T.useCallback(
1060
- (p) => {
1061
- const E = v ? l.subscribe(Ue.batchCalls(p)) : Ve;
1062
- return l.updateResult(), E;
1063
- },
1064
- [l, v]
1065
- ),
1066
- () => l.getCurrentResult(),
1067
- () => l.getCurrentResult()
1068
- ), T.useEffect(() => {
1069
- l.setOptions(a, { listeners: !1 });
1070
- }, [a, l]), Kt(a, S))
1071
- throw $e(a, l, o);
1072
- if (Mt({
1073
- result: S,
1074
- errorResetBoundary: o,
1075
- throwOnError: a.throwOnError,
1076
- query: r.getQueryCache().get(a.queryHash)
1077
- }))
1078
- throw S.error;
1079
- if ((w = (g = r.getDefaultOptions().queries) == null ? void 0 : g._experimental_afterQuery) == null || w.call(
1080
- g,
1081
- a,
1082
- S
1083
- ), a.experimental_prefetchInRender && !V && _t(S, i)) {
1084
- const p = u ? (
1085
- // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1086
- $e(a, l, o)
1087
- ) : (
1088
- // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1089
- (b = r.getQueryCache().get(a.queryHash)) == null ? void 0 : b.promise
1090
- );
1091
- p == null || p.catch(Ve).finally(() => {
1092
- l.updateResult();
1093
- });
1094
- }
1095
- return a.notifyOnChangeProps ? S : l.trackResult(S);
1096
- }
1097
- function Ht(t, e) {
1098
- return lt(t, at, e);
1099
- }
1100
- function Bt(t, e) {
1101
- return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error("skipToken is not allowed for useSuspenseQuery"), lt(
1102
- {
1103
- ...t,
1104
- enabled: !0,
1105
- suspense: !0,
1106
- throwOnError: Lt,
1107
- placeholderData: void 0
1108
- },
1109
- at,
1110
- e
1111
- );
1112
- }
1113
- const $ = (...t) => {
1114
- const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
1115
- return e ? `/${e}` : "/";
1116
- }, dt = Object.freeze({
1117
- API_IDENTITIES: ["api-identities"]
1118
- }), rs = () => {
1119
- const t = ct();
1120
- return {
1121
- invalidateCache: async (e) => {
1122
- await t.invalidateQueries({ queryKey: dt[e] });
1123
- }
1124
- };
1125
- }, Le = (t, e) => {
1126
- for (const s of t) {
1127
- const r = Ne(s, e);
1128
- if (r !== void 0) return r;
1129
- }
1130
- }, Ne = (t, e, s = []) => {
1131
- const r = e(t, s);
1132
- if (r !== void 0) return r;
1133
- if (t.type === "category")
1134
- for (const i of t.items) {
1135
- const o = Ne(i, e, [
1136
- ...s,
1137
- t
1138
- ]);
1139
- if (o !== void 0) return o;
1140
- }
1141
- }, ns = () => {
1142
- const t = pe(), s = yt().sidebar;
1143
- return Le(s, (r) => {
1144
- if (r.type === "doc" && $(r.id) === t.pathname)
1145
- return r;
1146
- });
1147
- }, is = (t) => {
1148
- const e = pe();
1149
- return Ne(t, (s) => {
1150
- if (s.type === "category" && s.link && $(s.link.id) === e.pathname || s.type === "doc" && $(s.id) === e.pathname)
1151
- return !0;
1152
- });
1153
- }, as = () => {
1154
- const t = pe().pathname, s = yt().sidebar;
1155
- let r, i, o = !1;
1156
- return Le(s, (a) => {
1157
- const u = a.type === "doc" ? $(a.id) : a.type === "category" && a.link ? $(a.link.id) : void 0;
1158
- if (u) {
1159
- if (o)
1160
- return i = { label: a.label, id: u }, !0;
1161
- t === u ? o = !0 : r = { label: a.label, id: u };
1162
- }
1163
- }), { prev: r, next: i };
1164
- }, Gt = pt(
1165
- void 0
1166
- ), ft = () => {
1167
- const t = bt(Gt);
1168
- if (!t)
1169
- throw new Error("useZudoku must be used within a ZudokuProvider.");
1170
- return t;
1171
- }, us = () => {
1172
- const { getApiIdentities: t } = ft();
1173
- return Ht({
1174
- queryFn: t,
1175
- queryKey: [dt.API_IDENTITIES]
1176
- });
1177
- }, yt = () => {
1178
- const { getPluginSidebar: t, sidebars: e, topNavigation: s } = ft(), r = pe(), i = Object.entries(e).find(([, u]) => Le(u, (l) => {
1179
- if ((l.type === "doc" ? $(l.id) : l.type === "category" && l.link ? $(l.link.id) : void 0) === r.pathname)
1180
- return l;
1181
- })), o = s.find((u) => u.id === (i == null ? void 0 : i[0])) ?? s.find((u) => vt(u.id, r.pathname)), { data: a } = Bt({
1182
- queryFn: () => t(r.pathname),
1183
- queryKey: ["plugin-sidebar", r.pathname]
1184
- });
1185
- return {
1186
- sidebar: [...i ? i[1] : [], ...a],
1187
- topNavItem: o
1188
- };
1189
- };
1190
- export {
1191
- Qe as A,
1192
- ye as B,
1193
- ss as C,
1194
- yt as D,
1195
- Le as E,
1196
- rs as F,
1197
- dt as G,
1198
- ts as Q,
1199
- It as R,
1200
- Ae as S,
1201
- Gt as Z,
1202
- ft as a,
1203
- ns as b,
1204
- Ot as c,
1205
- as as d,
1206
- ct as e,
1207
- Ve as f,
1208
- At as g,
1209
- Ce as h,
1210
- is as i,
1211
- $ as j,
1212
- Ht as k,
1213
- us as l,
1214
- gt as m,
1215
- Ue as n,
1216
- Jt as o,
1217
- Yt as p,
1218
- ge as q,
1219
- Ct as r,
1220
- we as s,
1221
- es as t,
1222
- Bt as u,
1223
- Xt as v,
1224
- tt as w,
1225
- st as x,
1226
- fe as y,
1227
- Wt as z
1228
- };
1229
- //# sourceMappingURL=ZudokuContext-BTUJPpQl.js.map