zudoku 0.0.0-f3d517c → 0.0.0-f40ea27

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 (570) hide show
  1. package/dist/app/ZuploBuildConfig.d.ts +11 -121
  2. package/dist/app/ZuploBuildConfig.js +8 -8
  3. package/dist/app/ZuploBuildConfig.js.map +1 -1
  4. package/dist/app/demo.js +6 -5
  5. package/dist/app/demo.js.map +1 -1
  6. package/dist/app/entry.client.d.ts +0 -2
  7. package/dist/app/entry.client.js +0 -2
  8. package/dist/app/entry.client.js.map +1 -1
  9. package/dist/app/entry.server.d.ts +0 -2
  10. package/dist/app/entry.server.js +0 -2
  11. package/dist/app/entry.server.js.map +1 -1
  12. package/dist/app/env.d.ts +7 -7
  13. package/dist/app/env.js +8 -0
  14. package/dist/app/env.js.map +1 -1
  15. package/dist/app/main.d.ts +1 -0
  16. package/dist/app/main.js +12 -11
  17. package/dist/app/main.js.map +1 -1
  18. package/dist/app/standalone.js +7 -6
  19. package/dist/app/standalone.js.map +1 -1
  20. package/dist/config/loader.js +2 -3
  21. package/dist/config/loader.js.map +1 -1
  22. package/dist/config/validators/BuildSchema.d.ts +20 -44
  23. package/dist/config/validators/BuildSchema.js +3 -14
  24. package/dist/config/validators/BuildSchema.js.map +1 -1
  25. package/dist/config/validators/InputNavigationSchema.d.ts +7369 -0
  26. package/dist/config/validators/InputNavigationSchema.js +74 -0
  27. package/dist/config/validators/InputNavigationSchema.js.map +1 -0
  28. package/dist/config/validators/InputNavigationSchema.test-d.d.ts +1 -0
  29. package/dist/config/validators/InputNavigationSchema.test-d.js +146 -0
  30. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -0
  31. package/dist/config/validators/NavigationSchema.d.ts +44 -0
  32. package/dist/config/validators/NavigationSchema.js +95 -0
  33. package/dist/config/validators/NavigationSchema.js.map +1 -0
  34. package/dist/config/validators/icon-types.d.ts +2 -1
  35. package/dist/config/validators/icon-types.js +1813 -1
  36. package/dist/config/validators/icon-types.js.map +1 -1
  37. package/dist/config/validators/validate.d.ts +471 -5556
  38. package/dist/config/validators/validate.js +80 -69
  39. package/dist/config/validators/validate.js.map +1 -1
  40. package/dist/config/validators/validate.test.js +0 -2
  41. package/dist/config/validators/validate.test.js.map +1 -1
  42. package/dist/flat-config.d.ts +325 -0
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/lib/auth/issuer.js +4 -1
  46. package/dist/lib/auth/issuer.js.map +1 -1
  47. package/dist/lib/auth/issuer.test.js +14 -1
  48. package/dist/lib/auth/issuer.test.js.map +1 -1
  49. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  50. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  51. package/dist/lib/components/Autocomplete.js +2 -2
  52. package/dist/lib/components/Autocomplete.js.map +1 -1
  53. package/dist/lib/components/Banner.js +1 -1
  54. package/dist/lib/components/Banner.js.map +1 -1
  55. package/dist/lib/components/BuildCheck.js +1 -1
  56. package/dist/lib/components/BuildCheck.js.map +1 -1
  57. package/dist/lib/components/ErrorPage.js +2 -2
  58. package/dist/lib/components/ErrorPage.js.map +1 -1
  59. package/dist/lib/components/Footer.js +1 -1
  60. package/dist/lib/components/Footer.js.map +1 -1
  61. package/dist/lib/components/Framed.d.ts +7 -0
  62. package/dist/lib/components/Framed.js +26 -0
  63. package/dist/lib/components/Framed.js.map +1 -0
  64. package/dist/lib/components/Header.js +19 -18
  65. package/dist/lib/components/Header.js.map +1 -1
  66. package/dist/lib/components/Heading.d.ts +6 -2
  67. package/dist/lib/components/Heading.js +2 -2
  68. package/dist/lib/components/Heading.js.map +1 -1
  69. package/dist/lib/components/Main.js +4 -4
  70. package/dist/lib/components/Main.js.map +1 -1
  71. package/dist/lib/components/Markdown.d.ts +0 -1
  72. package/dist/lib/components/Markdown.js +2 -3
  73. package/dist/lib/components/Markdown.js.map +1 -1
  74. package/dist/lib/components/MobileTopNavigation.js +6 -5
  75. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  76. package/dist/lib/components/NotFoundPage.js +2 -2
  77. package/dist/lib/components/NotFoundPage.js.map +1 -1
  78. package/dist/lib/components/PageProgress.d.ts +1 -0
  79. package/dist/lib/components/PageProgress.js +20 -0
  80. package/dist/lib/components/PageProgress.js.map +1 -0
  81. package/dist/lib/components/Pagination.js +1 -1
  82. package/dist/lib/components/Pagination.js.map +1 -1
  83. package/dist/lib/components/TopNavigation.d.ts +2 -3
  84. package/dist/lib/components/TopNavigation.js +45 -44
  85. package/dist/lib/components/TopNavigation.js.map +1 -1
  86. package/dist/lib/components/Typography.d.ts +5 -0
  87. package/dist/lib/components/Typography.js +8 -0
  88. package/dist/lib/components/Typography.js.map +1 -0
  89. package/dist/lib/components/context/ZudokuContext.d.ts +3 -7
  90. package/dist/lib/components/context/ZudokuContext.js +44 -26
  91. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  92. package/dist/lib/components/index.d.ts +4 -0
  93. package/dist/lib/components/index.js +2 -0
  94. package/dist/lib/components/index.js.map +1 -1
  95. package/dist/lib/components/navigation/Navigation.d.ts +5 -0
  96. package/dist/lib/components/navigation/Navigation.js +12 -0
  97. package/dist/lib/components/navigation/Navigation.js.map +1 -0
  98. package/dist/lib/components/navigation/{SidebarBadge.d.ts → NavigationBadge.d.ts} +1 -1
  99. package/dist/lib/components/navigation/{SidebarBadge.js → NavigationBadge.js} +2 -2
  100. package/dist/lib/components/navigation/NavigationBadge.js.map +1 -0
  101. package/dist/lib/components/navigation/NavigationCategory.d.ts +5 -0
  102. package/dist/lib/components/navigation/{SidebarCategory.js → NavigationCategory.js} +14 -12
  103. package/dist/lib/components/navigation/NavigationCategory.js.map +1 -0
  104. package/dist/lib/components/navigation/NavigationItem.d.ts +6 -0
  105. package/dist/lib/components/navigation/NavigationItem.js +47 -0
  106. package/dist/lib/components/navigation/NavigationItem.js.map +1 -0
  107. package/dist/lib/components/navigation/{SidebarWrapper.d.ts → NavigationWrapper.d.ts} +1 -1
  108. package/dist/lib/components/navigation/{SidebarWrapper.js → NavigationWrapper.js} +4 -4
  109. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -0
  110. package/dist/lib/components/navigation/utils.d.ts +7 -9
  111. package/dist/lib/components/navigation/utils.js +17 -17
  112. package/dist/lib/components/navigation/utils.js.map +1 -1
  113. package/dist/lib/core/ZudokuContext.d.ts +10 -12
  114. package/dist/lib/core/ZudokuContext.js +7 -9
  115. package/dist/lib/core/ZudokuContext.js.map +1 -1
  116. package/dist/lib/core/plugins.d.ts +2 -2
  117. package/dist/lib/errors/ErrorAlert.js +2 -3
  118. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  119. package/dist/lib/hooks/useEvent.test.js +5 -3
  120. package/dist/lib/hooks/useEvent.test.js.map +1 -1
  121. package/dist/lib/hooks/useHotkey.d.ts +4 -0
  122. package/dist/lib/hooks/useHotkey.js +58 -0
  123. package/dist/lib/hooks/useHotkey.js.map +1 -0
  124. package/dist/lib/plugins/api-catalog/Catalog.d.ts +1 -1
  125. package/dist/lib/plugins/api-catalog/index.d.ts +6 -6
  126. package/dist/lib/plugins/api-catalog/index.js +10 -10
  127. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  128. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +12 -15
  129. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  130. package/dist/lib/plugins/api-keys/index.js +24 -5
  131. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  132. package/dist/lib/plugins/custom-pages/index.d.ts +4 -6
  133. package/dist/lib/plugins/custom-pages/index.js +15 -10
  134. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  135. package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -2
  136. package/dist/lib/plugins/markdown/MdxPage.js +28 -9
  137. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  138. package/dist/lib/plugins/markdown/index.d.ts +10 -2
  139. package/dist/lib/plugins/markdown/index.js +9 -26
  140. package/dist/lib/plugins/markdown/index.js.map +1 -1
  141. package/dist/lib/plugins/openapi/OperationList.js +2 -3
  142. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  143. package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
  144. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  145. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  146. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  147. package/dist/lib/plugins/openapi/SchemaList.js +2 -3
  148. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  149. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  150. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  151. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  152. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  153. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  154. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  155. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  156. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +3 -3
  157. package/dist/lib/plugins/openapi/graphql/graphql.js +2 -2
  158. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  159. package/dist/lib/plugins/openapi/index.d.ts +3 -3
  160. package/dist/lib/plugins/openapi/index.js +9 -9
  161. package/dist/lib/plugins/openapi/index.js.map +1 -1
  162. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -3
  163. package/dist/lib/plugins/openapi/playground/BodyPanel.d.ts +2 -2
  164. package/dist/lib/plugins/openapi/playground/BodyPanel.js +16 -12
  165. package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
  166. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.d.ts +8 -0
  167. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +11 -0
  168. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -0
  169. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +2 -2
  170. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  171. package/dist/lib/plugins/openapi/playground/Headers.d.ts +3 -2
  172. package/dist/lib/plugins/openapi/playground/Headers.js +52 -30
  173. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  174. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +2 -1
  175. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -1
  176. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +1 -2
  177. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -1
  178. package/dist/lib/plugins/openapi/playground/InlineInput.js +1 -1
  179. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +1 -1
  180. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +2 -2
  181. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  182. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -2
  183. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  184. package/dist/lib/plugins/openapi/playground/Playground.js +47 -34
  185. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  186. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  187. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  188. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +2 -2
  189. package/dist/lib/plugins/openapi/playground/QueryParams.js +38 -23
  190. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  191. package/dist/lib/plugins/openapi/playground/Spinner.d.ts +2 -0
  192. package/dist/lib/plugins/openapi/playground/Spinner.js +63 -0
  193. package/dist/lib/plugins/openapi/playground/Spinner.js.map +1 -0
  194. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.d.ts +3 -0
  195. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.js +13 -0
  196. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.js.map +1 -0
  197. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.d.ts +1 -0
  198. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +12 -0
  199. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -0
  200. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.d.ts +12 -0
  201. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.js +11 -0
  202. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.js.map +1 -0
  203. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.d.ts +8 -0
  204. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js +69 -0
  205. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js.map +1 -0
  206. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +7 -4
  207. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +25 -32
  208. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  209. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +4 -2
  210. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +8 -10
  211. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  212. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +3 -3
  213. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  214. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +2 -3
  215. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  216. package/dist/lib/plugins/openapi/schema/SchemaView.js +5 -5
  217. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  218. package/dist/lib/plugins/openapi/schema/utils.js +3 -2
  219. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  220. package/dist/lib/plugins/openapi/util/createNavigationCategory.d.ts +9 -0
  221. package/dist/lib/plugins/openapi/util/{createSidebarCategory.js → createNavigationCategory.js} +5 -4
  222. package/dist/lib/plugins/openapi/util/createNavigationCategory.js.map +1 -0
  223. package/dist/lib/plugins/openapi/util/getRoutes.js +2 -2
  224. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  225. package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +1 -1
  226. package/dist/lib/ui/Alert.d.ts +5 -4
  227. package/dist/lib/ui/Alert.js +12 -10
  228. package/dist/lib/ui/Alert.js.map +1 -1
  229. package/dist/lib/ui/CodeBlock.d.ts +1 -2
  230. package/dist/lib/ui/CodeBlock.js +10 -11
  231. package/dist/lib/ui/CodeBlock.js.map +1 -1
  232. package/dist/lib/ui/Dialog.js +1 -1
  233. package/dist/lib/ui/Dialog.js.map +1 -1
  234. package/dist/lib/ui/EmbeddedCodeBlock.d.ts +15 -0
  235. package/dist/lib/ui/EmbeddedCodeBlock.js +18 -0
  236. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -0
  237. package/dist/lib/ui/Select.js +1 -1
  238. package/dist/lib/ui/SyntaxHighlight.d.ts +3 -1
  239. package/dist/lib/ui/SyntaxHighlight.js +3 -2
  240. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  241. package/dist/lib/util/MdxComponents.d.ts +9 -1
  242. package/dist/lib/util/MdxComponents.js +4 -2
  243. package/dist/lib/util/MdxComponents.js.map +1 -1
  244. package/dist/lib/util/os.d.ts +2 -0
  245. package/dist/lib/util/os.js +21 -0
  246. package/dist/lib/util/os.js.map +1 -0
  247. package/dist/lib/util/useCopyToClipboard.d.ts +1 -0
  248. package/dist/lib/util/useCopyToClipboard.js +11 -0
  249. package/dist/lib/util/useCopyToClipboard.js.map +1 -0
  250. package/dist/lib/util/useScrollToAnchor.js +3 -3
  251. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  252. package/dist/vite/api/SchemaManager.d.ts +4 -4
  253. package/dist/vite/api/SchemaManager.js +25 -21
  254. package/dist/vite/api/SchemaManager.js.map +1 -1
  255. package/dist/vite/api/SchemaManager.test.js +4 -4
  256. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  257. package/dist/vite/api/schema-codegen.js +42 -11
  258. package/dist/vite/api/schema-codegen.js.map +1 -1
  259. package/dist/vite/api/schema-codegen.test.js +82 -0
  260. package/dist/vite/api/schema-codegen.test.js.map +1 -1
  261. package/dist/vite/build.js +1 -1
  262. package/dist/vite/config.js +12 -2
  263. package/dist/vite/config.js.map +1 -1
  264. package/dist/vite/css/plugin.js +11 -0
  265. package/dist/vite/css/plugin.js.map +1 -1
  266. package/dist/vite/dev-server.js +1 -1
  267. package/dist/vite/mdx/remark-last-modified.d.ts +3 -0
  268. package/dist/vite/mdx/remark-last-modified.js +56 -0
  269. package/dist/vite/mdx/remark-last-modified.js.map +1 -0
  270. package/dist/vite/mdx/utils.d.ts +2 -0
  271. package/dist/vite/mdx/utils.js +31 -0
  272. package/dist/vite/mdx/utils.js.map +1 -0
  273. package/dist/vite/plugin-api.js +8 -8
  274. package/dist/vite/plugin-api.js.map +1 -1
  275. package/dist/vite/plugin-config-reload.js +2 -0
  276. package/dist/vite/plugin-config-reload.js.map +1 -1
  277. package/dist/vite/plugin-custom-pages.js +2 -2
  278. package/dist/vite/plugin-custom-pages.js.map +1 -1
  279. package/dist/vite/plugin-docs.js +61 -59
  280. package/dist/vite/plugin-docs.js.map +1 -1
  281. package/dist/vite/plugin-frontmatter.js +6 -2
  282. package/dist/vite/plugin-frontmatter.js.map +1 -1
  283. package/dist/vite/plugin-mdx.js +15 -35
  284. package/dist/vite/plugin-mdx.js.map +1 -1
  285. package/dist/vite/{plugin-sidebar.d.ts → plugin-navigation.d.ts} +1 -1
  286. package/dist/vite/{plugin-sidebar.js → plugin-navigation.js} +20 -19
  287. package/dist/vite/plugin-navigation.js.map +1 -0
  288. package/dist/vite/plugin-theme.d.ts +8 -0
  289. package/dist/vite/plugin-theme.js +235 -0
  290. package/dist/vite/plugin-theme.js.map +1 -0
  291. package/dist/vite/plugin-theme.test.d.ts +1 -0
  292. package/dist/vite/plugin-theme.test.js +291 -0
  293. package/dist/vite/plugin-theme.test.js.map +1 -0
  294. package/dist/vite/plugin.js +4 -6
  295. package/dist/vite/plugin.js.map +1 -1
  296. package/dist/vite/shadcn-registry.d.ts +45 -0
  297. package/dist/vite/shadcn-registry.js +29 -0
  298. package/dist/vite/shadcn-registry.js.map +1 -0
  299. package/lib/Alert-CT_ViLrJ.js +161 -0
  300. package/lib/Alert-CT_ViLrJ.js.map +1 -0
  301. package/lib/CodeBlock-DAKxs_Tu.js +85 -0
  302. package/lib/CodeBlock-DAKxs_Tu.js.map +1 -0
  303. package/lib/Command-xsbs2uhf.js +140 -0
  304. package/lib/Command-xsbs2uhf.js.map +1 -0
  305. package/lib/{Dialog-BxpuVLh9.js → Dialog-CiIdyz6a.js} +5 -5
  306. package/lib/Dialog-CiIdyz6a.js.map +1 -0
  307. package/lib/Drawer-BzkOKwgC.js.map +1 -1
  308. package/lib/MdxPage-swXPJ0gf.js +110 -0
  309. package/lib/MdxPage-swXPJ0gf.js.map +1 -0
  310. package/lib/OasProvider-CDAM3TB1.js +35 -0
  311. package/lib/OasProvider-CDAM3TB1.js.map +1 -0
  312. package/lib/{OperationList-BISd29LY.js → OperationList-C9Hb9ql8.js} +582 -569
  313. package/lib/OperationList-C9Hb9ql8.js.map +1 -0
  314. package/lib/Pagination-VGlgeCmS.js +36 -0
  315. package/lib/Pagination-VGlgeCmS.js.map +1 -0
  316. package/lib/RouteGuard-CbKd7_9h.js +737 -0
  317. package/lib/RouteGuard-CbKd7_9h.js.map +1 -0
  318. package/lib/{SchemaList-BqnRo5ov.js → SchemaList-BAbh1BXO.js} +32 -43
  319. package/lib/SchemaList-BAbh1BXO.js.map +1 -0
  320. package/lib/{SchemaView-CtYJpxQI.js → SchemaView-C2Io712T.js} +95 -104
  321. package/lib/SchemaView-C2Io712T.js.map +1 -0
  322. package/lib/{SignUp-CrjeBbqN.js → SignUp-5RUdVhnq.js} +13 -13
  323. package/lib/{SignUp-CrjeBbqN.js.map → SignUp-5RUdVhnq.js.map} +1 -1
  324. package/lib/{Markdown-BUE2ViaD.js → Slot-DwZlQ-vX.js} +3320 -2937
  325. package/lib/Slot-DwZlQ-vX.js.map +1 -0
  326. package/lib/{SyntaxHighlight-DtvR7RLF.js → SyntaxHighlight-CrjhGEwT.js} +717 -716
  327. package/lib/{SyntaxHighlight-DtvR7RLF.js.map → SyntaxHighlight-CrjhGEwT.js.map} +1 -1
  328. package/lib/{Toc-ClJBmdtI.js → Toc-WCmwFkX-.js} +2 -2
  329. package/lib/{Toc-ClJBmdtI.js.map → Toc-WCmwFkX-.js.map} +1 -1
  330. package/lib/{chunk-DQRVZFIR-BblmKnHy.js → chunk-DQRVZFIR-DHK7_Ilc.js} +7 -7
  331. package/lib/{chunk-DQRVZFIR-BblmKnHy.js.map → chunk-DQRVZFIR-DHK7_Ilc.js.map} +1 -1
  332. package/lib/{circular-pOdgLzpG.js → circular-B42RaanD.js} +2 -2
  333. package/lib/{circular-pOdgLzpG.js.map → circular-B42RaanD.js.map} +1 -1
  334. package/lib/clerk-BDZ31hjU.js +25190 -0
  335. package/lib/clerk-BDZ31hjU.js.map +1 -0
  336. package/lib/{createServer-qAtUf99r.js → createServer-BKFsRuuk.js} +6 -6
  337. package/lib/{createServer-qAtUf99r.js.map → createServer-BKFsRuuk.js.map} +1 -1
  338. package/lib/{errors-Bpodza84.js → errors-CF2X_x5o.js} +12 -12
  339. package/lib/{errors-Bpodza84.js.map → errors-CF2X_x5o.js.map} +1 -1
  340. package/lib/hook-Bd0yS8M0.js +1503 -0
  341. package/lib/hook-Bd0yS8M0.js.map +1 -0
  342. package/lib/index-B6Re5_cx.js +3469 -0
  343. package/lib/index-B6Re5_cx.js.map +1 -0
  344. package/lib/index-CLy1XyH0.js +3919 -0
  345. package/lib/index-CLy1XyH0.js.map +1 -0
  346. package/lib/{index-BvvmIczU.js → index-CcV90rin.js} +2 -2
  347. package/lib/{index-BvvmIczU.js.map → index-CcV90rin.js.map} +1 -1
  348. package/lib/index-ClhS5TxS.js +107 -0
  349. package/lib/index-ClhS5TxS.js.map +1 -0
  350. package/lib/index-CrcNWbel.js.map +1 -1
  351. package/lib/{index-zddirpDj.js → index-DmNq2fbN.js} +226 -221
  352. package/lib/index-DmNq2fbN.js.map +1 -0
  353. package/lib/ui/Alert.js +54 -38
  354. package/lib/ui/Alert.js.map +1 -1
  355. package/lib/ui/CodeBlock.js +6 -81
  356. package/lib/ui/CodeBlock.js.map +1 -1
  357. package/lib/ui/Command.js +1 -1
  358. package/lib/ui/Dialog.js +23 -23
  359. package/lib/ui/Dialog.js.map +1 -1
  360. package/lib/ui/EmbeddedCodeBlock.js +80 -0
  361. package/lib/ui/EmbeddedCodeBlock.js.map +1 -0
  362. package/lib/ui/Select.js +1 -1
  363. package/lib/ui/Select.js.map +1 -1
  364. package/lib/ui/SyntaxHighlight.js +5 -4
  365. package/lib/ui/SyntaxHighlight.js.map +1 -1
  366. package/lib/{useExposedProps-BZQkZneR.js → useExposedProps-BIYjecPD.js} +2 -2
  367. package/lib/{useExposedProps-BZQkZneR.js.map → useExposedProps-BIYjecPD.js.map} +1 -1
  368. package/lib/zudoku.auth-auth0.js +1 -1
  369. package/lib/zudoku.auth-azureb2c.js +2 -2
  370. package/lib/zudoku.auth-clerk.js +3 -3
  371. package/lib/zudoku.auth-openid.js +2 -2
  372. package/lib/zudoku.components.js +33 -4201
  373. package/lib/zudoku.components.js.map +1 -1
  374. package/lib/zudoku.hooks.js +10 -11
  375. package/lib/zudoku.hooks.js.map +1 -1
  376. package/lib/zudoku.plugin-api-catalog.js +47 -47
  377. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  378. package/lib/zudoku.plugin-api-keys.js +292 -268
  379. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  380. package/lib/zudoku.plugin-custom-pages.js +12 -18
  381. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  382. package/lib/zudoku.plugin-markdown.js +19 -69
  383. package/lib/zudoku.plugin-markdown.js.map +1 -1
  384. package/lib/zudoku.plugin-openapi.js +6 -6
  385. package/lib/zudoku.plugin-redirect.js +1 -1
  386. package/lib/zudoku.plugin-search-pagefind.js +201 -111
  387. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  388. package/lib/zudoku.plugins.js.map +1 -1
  389. package/package.json +23 -19
  390. package/src/app/ZuploBuildConfig.ts +8 -8
  391. package/src/app/defaultTheme.css +68 -49
  392. package/src/app/demo.tsx +6 -5
  393. package/src/app/entry.client.tsx +0 -2
  394. package/src/app/entry.server.tsx +0 -2
  395. package/src/app/env.ts +8 -0
  396. package/src/app/main.css +10 -53
  397. package/src/app/main.tsx +13 -11
  398. package/src/app/standalone.tsx +7 -6
  399. package/src/lib/auth/issuer.test.ts +17 -1
  400. package/src/lib/auth/issuer.ts +4 -1
  401. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  402. package/src/lib/components/Autocomplete.tsx +2 -1
  403. package/src/lib/components/Banner.tsx +1 -1
  404. package/src/lib/components/BuildCheck.tsx +1 -1
  405. package/src/lib/components/ErrorPage.tsx +3 -3
  406. package/src/lib/components/Footer.tsx +1 -1
  407. package/src/lib/components/Framed.tsx +51 -0
  408. package/src/lib/components/Header.tsx +20 -20
  409. package/src/lib/components/Heading.tsx +7 -3
  410. package/src/lib/components/Main.tsx +9 -9
  411. package/src/lib/components/Markdown.tsx +3 -5
  412. package/src/lib/components/MobileTopNavigation.tsx +18 -13
  413. package/src/lib/components/NotFoundPage.tsx +3 -3
  414. package/src/lib/components/PageProgress.tsx +28 -0
  415. package/src/lib/components/Pagination.tsx +4 -4
  416. package/src/lib/components/TopNavigation.tsx +57 -66
  417. package/src/lib/components/Typography.tsx +14 -0
  418. package/src/lib/components/context/ZudokuContext.ts +50 -32
  419. package/src/lib/components/index.ts +2 -0
  420. package/src/lib/components/navigation/{Sidebar.tsx → Navigation.tsx} +18 -16
  421. package/src/lib/components/navigation/{SidebarBadge.tsx → NavigationBadge.tsx} +1 -1
  422. package/src/lib/components/navigation/{SidebarCategory.tsx → NavigationCategory.tsx} +16 -14
  423. package/src/lib/components/navigation/{SidebarItem.tsx → NavigationItem.tsx} +23 -17
  424. package/src/lib/components/navigation/{SidebarWrapper.tsx → NavigationWrapper.tsx} +3 -3
  425. package/src/lib/components/navigation/utils.ts +27 -28
  426. package/src/lib/core/ZudokuContext.ts +14 -20
  427. package/src/lib/core/plugins.ts +2 -2
  428. package/src/lib/errors/ErrorAlert.tsx +3 -9
  429. package/src/lib/hooks/useEvent.test.tsx +7 -5
  430. package/src/lib/hooks/useHotkey.ts +70 -0
  431. package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
  432. package/src/lib/plugins/api-catalog/index.tsx +19 -19
  433. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +41 -22
  434. package/src/lib/plugins/api-keys/index.tsx +27 -7
  435. package/src/lib/plugins/custom-pages/index.tsx +21 -16
  436. package/src/lib/plugins/markdown/MdxPage.tsx +72 -18
  437. package/src/lib/plugins/markdown/index.tsx +28 -41
  438. package/src/lib/plugins/openapi/OperationList.tsx +8 -18
  439. package/src/lib/plugins/openapi/OperationListItem.tsx +3 -3
  440. package/src/lib/plugins/openapi/ParameterListItem.tsx +6 -0
  441. package/src/lib/plugins/openapi/SchemaList.tsx +5 -11
  442. package/src/lib/plugins/openapi/Sidecar.tsx +1 -0
  443. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -0
  444. package/src/lib/plugins/openapi/graphql/gql.ts +5 -5
  445. package/src/lib/plugins/openapi/graphql/graphql.ts +6 -6
  446. package/src/lib/plugins/openapi/index.tsx +11 -11
  447. package/src/lib/plugins/openapi/interfaces.ts +3 -3
  448. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +40 -31
  449. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +47 -0
  450. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +7 -3
  451. package/src/lib/plugins/openapi/playground/Headers.tsx +187 -89
  452. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +3 -2
  453. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +7 -12
  454. package/src/lib/plugins/openapi/playground/InlineInput.tsx +1 -1
  455. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +2 -2
  456. package/src/lib/plugins/openapi/playground/PathParams.tsx +4 -5
  457. package/src/lib/plugins/openapi/playground/Playground.tsx +174 -125
  458. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  459. package/src/lib/plugins/openapi/playground/QueryParams.tsx +104 -58
  460. package/src/lib/plugins/openapi/playground/Spinner.tsx +87 -0
  461. package/src/lib/plugins/openapi/playground/request-panel/UrlPath.tsx +31 -0
  462. package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +25 -0
  463. package/src/lib/plugins/openapi/playground/result-panel/Highlight.tsx +26 -0
  464. package/src/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.tsx +115 -0
  465. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +103 -97
  466. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +68 -92
  467. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +3 -3
  468. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +2 -3
  469. package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -11
  470. package/src/lib/plugins/openapi/schema/utils.ts +3 -2
  471. package/src/lib/plugins/openapi/util/{createSidebarCategory.tsx → createNavigationCategory.tsx} +6 -5
  472. package/src/lib/plugins/openapi/util/getRoutes.tsx +2 -2
  473. package/src/lib/plugins/openapi/util/methodColorMap.tsx +1 -1
  474. package/src/lib/ui/Alert.tsx +44 -38
  475. package/src/lib/ui/CodeBlock.tsx +40 -55
  476. package/src/lib/ui/Dialog.tsx +2 -2
  477. package/src/lib/ui/EmbeddedCodeBlock.tsx +94 -0
  478. package/src/lib/ui/Select.tsx +1 -1
  479. package/src/lib/ui/SyntaxHighlight.tsx +11 -3
  480. package/src/lib/util/MdxComponents.tsx +13 -2
  481. package/src/lib/util/os.ts +18 -0
  482. package/src/lib/util/useCopyToClipboard.ts +17 -0
  483. package/src/lib/util/useScrollToAnchor.ts +3 -3
  484. package/dist/config/validators/InputSidebarSchema.d.ts +0 -220
  485. package/dist/config/validators/InputSidebarSchema.js +0 -63
  486. package/dist/config/validators/InputSidebarSchema.js.map +0 -1
  487. package/dist/config/validators/SidebarSchema.d.ts +0 -46
  488. package/dist/config/validators/SidebarSchema.js +0 -118
  489. package/dist/config/validators/SidebarSchema.js.map +0 -1
  490. package/dist/lib/components/navigation/Sidebar.d.ts +0 -5
  491. package/dist/lib/components/navigation/Sidebar.js +0 -10
  492. package/dist/lib/components/navigation/Sidebar.js.map +0 -1
  493. package/dist/lib/components/navigation/SidebarBadge.js.map +0 -1
  494. package/dist/lib/components/navigation/SidebarCategory.d.ts +0 -5
  495. package/dist/lib/components/navigation/SidebarCategory.js.map +0 -1
  496. package/dist/lib/components/navigation/SidebarItem.d.ts +0 -6
  497. package/dist/lib/components/navigation/SidebarItem.js +0 -44
  498. package/dist/lib/components/navigation/SidebarItem.js.map +0 -1
  499. package/dist/lib/components/navigation/SidebarWrapper.js.map +0 -1
  500. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +0 -2
  501. package/dist/lib/plugins/custom-pages/CustomPage.js +0 -11
  502. package/dist/lib/plugins/custom-pages/CustomPage.js.map +0 -1
  503. package/dist/lib/plugins/markdown/resolver.d.ts +0 -32
  504. package/dist/lib/plugins/markdown/resolver.js +0 -46
  505. package/dist/lib/plugins/markdown/resolver.js.map +0 -1
  506. package/dist/lib/plugins/openapi/playground/UrlDisplay.d.ts +0 -4
  507. package/dist/lib/plugins/openapi/playground/UrlDisplay.js +0 -22
  508. package/dist/lib/plugins/openapi/playground/UrlDisplay.js.map +0 -1
  509. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +0 -7
  510. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +0 -11
  511. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +0 -1
  512. package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +0 -9
  513. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +0 -1
  514. package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
  515. package/dist/vite/plugin-configure-tailwind.js +0 -38
  516. package/dist/vite/plugin-configure-tailwind.js.map +0 -1
  517. package/dist/vite/plugin-sidebar.js.map +0 -1
  518. package/dist/vite/plugin-theme-css.d.ts +0 -5
  519. package/dist/vite/plugin-theme-css.js +0 -77
  520. package/dist/vite/plugin-theme-css.js.map +0 -1
  521. package/lib/Callout-CoVxYafP.js +0 -231
  522. package/lib/Callout-CoVxYafP.js.map +0 -1
  523. package/lib/CategoryHeading-Cu2RwgjC.js +0 -10
  524. package/lib/CategoryHeading-Cu2RwgjC.js.map +0 -1
  525. package/lib/Dialog-BxpuVLh9.js.map +0 -1
  526. package/lib/Markdown-BUE2ViaD.js.map +0 -1
  527. package/lib/MdxPage-By4UkRkI.js +0 -84
  528. package/lib/MdxPage-By4UkRkI.js.map +0 -1
  529. package/lib/OasProvider-C6_Kx5O7.js +0 -33
  530. package/lib/OasProvider-C6_Kx5O7.js.map +0 -1
  531. package/lib/OperationList-BISd29LY.js.map +0 -1
  532. package/lib/Pagination-CCxhL836.js +0 -36
  533. package/lib/Pagination-CCxhL836.js.map +0 -1
  534. package/lib/RouteGuard-CgmsSw7T.js +0 -55
  535. package/lib/RouteGuard-CgmsSw7T.js.map +0 -1
  536. package/lib/SchemaList-BqnRo5ov.js.map +0 -1
  537. package/lib/SchemaView-CtYJpxQI.js.map +0 -1
  538. package/lib/Slot-DANV2b7_.js +0 -160
  539. package/lib/Slot-DANV2b7_.js.map +0 -1
  540. package/lib/clerk-yAKDC3Qz.js +0 -24812
  541. package/lib/clerk-yAKDC3Qz.js.map +0 -1
  542. package/lib/hook-wIlTGE-2.js +0 -1486
  543. package/lib/hook-wIlTGE-2.js.map +0 -1
  544. package/lib/index--oeBayMa.js +0 -86
  545. package/lib/index--oeBayMa.js.map +0 -1
  546. package/lib/index-Bn6Lc9tq.js +0 -9
  547. package/lib/index-Bn6Lc9tq.js.map +0 -1
  548. package/lib/index-QzXzw_ra.js +0 -24
  549. package/lib/index-QzXzw_ra.js.map +0 -1
  550. package/lib/index-RFzRn4fM.js +0 -3226
  551. package/lib/index-RFzRn4fM.js.map +0 -1
  552. package/lib/index-zddirpDj.js.map +0 -1
  553. package/lib/index.esm-BFcSKCe-.js +0 -683
  554. package/lib/index.esm-BFcSKCe-.js.map +0 -1
  555. package/lib/joinPath-B7kNnUX4.js +0 -8
  556. package/lib/joinPath-B7kNnUX4.js.map +0 -1
  557. package/lib/mutation-C-kdA_1r.js +0 -196
  558. package/lib/mutation-C-kdA_1r.js.map +0 -1
  559. package/lib/objectEntries-yMIkr2mI.js +0 -5
  560. package/lib/objectEntries-yMIkr2mI.js.map +0 -1
  561. package/lib/react-nprogress.esm-C2MPXjiJ.js +0 -389
  562. package/lib/react-nprogress.esm-C2MPXjiJ.js.map +0 -1
  563. package/lib/useLatest-hmRS46UF.js +0 -11
  564. package/lib/useLatest-hmRS46UF.js.map +0 -1
  565. package/lib/useMutation-3Ph3x6En.js +0 -97
  566. package/lib/useMutation-3Ph3x6En.js.map +0 -1
  567. package/src/lib/plugins/custom-pages/CustomPage.tsx +0 -18
  568. package/src/lib/plugins/markdown/resolver.ts +0 -59
  569. package/src/lib/plugins/openapi/playground/UrlDisplay.tsx +0 -32
  570. package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +0 -73
@@ -0,0 +1,3469 @@
1
+ import { j as n } from "./jsx-runtime-C5mzlN2N.js";
2
+ import { ChevronDown as xt, ChevronUp as jn, Check as gt, ChevronUpIcon as Nn, ChevronRightIcon as wn, CheckIcon as yt, DotIcon as Cn, PlusCircleIcon as fe, FileInput as Sn, TableOfContentsIcon as Tn, LockIcon as An, CircleAlertIcon as On, XIcon as vt, Circle as Rn, Unlink2Icon as Pn, CornerDownRightIcon as Ln, CornerDownLeftIcon as $n, DownloadIcon as In, UnplugIcon as En, SendIcon as kn, CopyIcon as Dn, IdCardLanyardIcon as zn, ShapesIcon as Fn, LogInIcon as qn, CirclePlayIcon as Vn } from "lucide-react";
3
+ import { r as Bn, c as _n, u as Un, N as Mn, g as Gn, m as rt } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
4
+ import { o as $e, p as Ie, q as bt, d as Hn, l as Qn, r as Jn, j as E, c as Wn, e as Xn } from "./hook-Bd0yS8M0.js";
5
+ import { Button as se } from "./ui/Button.js";
6
+ import { Z as Zn, i as Yn } from "./invariant-DAFpPywt.js";
7
+ import * as w from "react";
8
+ import { createContext as jt, use as Kn, useRef as L, useEffect as z, useMemo as Nt, useState as k, useCallback as wt, Fragment as K, useLayoutEffect as es, useTransition as ts, useContext as ns } from "react";
9
+ import { VisuallyHidden as ss } from "@radix-ui/react-visually-hidden";
10
+ import { D as Ee, a as ke, b as De, d as Ct, f as St, e as rs } from "./Dialog-CiIdyz6a.js";
11
+ import { S as as, a as os } from "./index-CLy1XyH0.js";
12
+ import { A as is, a as cs, b as ls, u as ds } from "./Alert-CT_ViLrJ.js";
13
+ import { u as oe, a as ze, C as F, b as us, F as ms } from "./index.esm-Cp4wkyud.js";
14
+ import { B as I } from "./Button-BE9IVkWV.js";
15
+ import * as Fe from "@radix-ui/react-collapsible";
16
+ import * as S from "@radix-ui/react-select";
17
+ import { c as v } from "./cn-wvCW-ho6.js";
18
+ import { b as at, c as ot, d as it, f as ps } from "./Slot-DwZlQ-vX.js";
19
+ import { u as hs } from "./CodeBlock-DAKxs_Tu.js";
20
+ import { u as fs } from "./RouteGuard-CbKd7_9h.js";
21
+ import * as C from "@radix-ui/react-dropdown-menu";
22
+ import * as Re from "@radix-ui/react-checkbox";
23
+ import * as ue from "@radix-ui/react-popover";
24
+ import { PopoverAnchor as xs } from "@radix-ui/react-popover";
25
+ import { P as gs } from "./index-CrcNWbel.js";
26
+ import { f as ys, g as vs, C as bs, b as js } from "./Command-xsbs2uhf.js";
27
+ import { Input as me } from "./ui/Input.js";
28
+ import { Slot as Ns } from "@radix-ui/react-slot";
29
+ import { C as ws } from "./Card-DPhGbYUM.js";
30
+ import * as Tt from "@radix-ui/react-label";
31
+ import { c as Cs } from "./index-DI5SPFK9.js";
32
+ import * as re from "@radix-ui/react-radio-group";
33
+ import { z as Ss } from "./index-ClhS5TxS.js";
34
+ import { h as Ts } from "./SyntaxHighlight-CrjhGEwT.js";
35
+ let Ne;
36
+ const As = (e) => {
37
+ if (e.errors?.[0])
38
+ throw new Zn(e.errors[0].message, {
39
+ developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
40
+ });
41
+ };
42
+ class Os {
43
+ constructor(t) {
44
+ this.config = t;
45
+ }
46
+ #e = async () => (Ne || (Ne = import("./createServer-BKFsRuuk.js").then(
47
+ (t) => t.createServer(this.config)
48
+ )), Ne);
49
+ #t = async (t) => this.config.server ? fetch(this.config.server, t) : (await this.#e()).fetch("http://localhost/graphql", t);
50
+ fetch = async (t, s) => {
51
+ const a = t.match(/query (\w+)/)?.[1], r = await this.#t({
52
+ method: "POST",
53
+ body: JSON.stringify({ query: t, variables: s, operationName: a }),
54
+ headers: { "Content-Type": "application/json" }
55
+ });
56
+ if (!r.ok)
57
+ throw new Error("Network response was not ok");
58
+ const o = await r.json();
59
+ return As(o), o.data;
60
+ };
61
+ }
62
+ function we(e, t) {
63
+ if (!!!e)
64
+ throw new Error(t);
65
+ }
66
+ function Rs(e) {
67
+ return typeof e == "object" && e !== null;
68
+ }
69
+ function Ps(e, t) {
70
+ if (!!!e)
71
+ throw new Error(
72
+ t ?? "Unexpected invariant triggered."
73
+ );
74
+ }
75
+ const Ls = /\r\n|[\n\r]/g;
76
+ function Pe(e, t) {
77
+ let s = 0, a = 1;
78
+ for (const r of e.body.matchAll(Ls)) {
79
+ if (typeof r.index == "number" || Ps(!1), r.index >= t)
80
+ break;
81
+ s = r.index + r[0].length, a += 1;
82
+ }
83
+ return {
84
+ line: a,
85
+ column: t + 1 - s
86
+ };
87
+ }
88
+ function $s(e) {
89
+ return At(
90
+ e.source,
91
+ Pe(e.source, e.start)
92
+ );
93
+ }
94
+ function At(e, t) {
95
+ const s = e.locationOffset.column - 1, a = "".padStart(s) + e.body, r = t.line - 1, o = e.locationOffset.line - 1, i = t.line + o, l = t.line === 1 ? s : 0, c = t.column + l, u = `${e.name}:${i}:${c}
96
+ `, d = a.split(/\r\n|[\n\r]/g), p = d[r];
97
+ if (p.length > 120) {
98
+ const f = Math.floor(c / 80), m = c % 80, x = [];
99
+ for (let y = 0; y < p.length; y += 80)
100
+ x.push(p.slice(y, y + 80));
101
+ return u + ct([
102
+ [`${i} |`, x[0]],
103
+ ...x.slice(1, f + 1).map((y) => ["|", y]),
104
+ ["|", "^".padStart(m)],
105
+ ["|", x[f + 1]]
106
+ ]);
107
+ }
108
+ return u + ct([
109
+ // Lines specified like this: ["prefix", "string"],
110
+ [`${i - 1} |`, d[r - 1]],
111
+ [`${i} |`, p],
112
+ ["|", "^".padStart(c)],
113
+ [`${i + 1} |`, d[r + 1]]
114
+ ]);
115
+ }
116
+ function ct(e) {
117
+ const t = e.filter(([a, r]) => r !== void 0), s = Math.max(...t.map(([a]) => a.length));
118
+ return t.map(([a, r]) => a.padStart(s) + (r ? " " + r : "")).join(`
119
+ `);
120
+ }
121
+ function Is(e) {
122
+ const t = e[0];
123
+ return t == null || "kind" in t || "length" in t ? {
124
+ nodes: t,
125
+ source: e[1],
126
+ positions: e[2],
127
+ path: e[3],
128
+ originalError: e[4],
129
+ extensions: e[5]
130
+ } : t;
131
+ }
132
+ class qe extends Error {
133
+ /**
134
+ * An array of `{ line, column }` locations within the source GraphQL document
135
+ * which correspond to this error.
136
+ *
137
+ * Errors during validation often contain multiple locations, for example to
138
+ * point out two things with the same name. Errors during execution include a
139
+ * single location, the field which produced the error.
140
+ *
141
+ * Enumerable, and appears in the result of JSON.stringify().
142
+ */
143
+ /**
144
+ * An array describing the JSON-path into the execution response which
145
+ * corresponds to this error. Only included for errors during execution.
146
+ *
147
+ * Enumerable, and appears in the result of JSON.stringify().
148
+ */
149
+ /**
150
+ * An array of GraphQL AST Nodes corresponding to this error.
151
+ */
152
+ /**
153
+ * The source GraphQL document for the first location of this error.
154
+ *
155
+ * Note that if this Error represents more than one node, the source may not
156
+ * represent nodes after the first node.
157
+ */
158
+ /**
159
+ * An array of character offsets within the source GraphQL document
160
+ * which correspond to this error.
161
+ */
162
+ /**
163
+ * The original error thrown from a field resolver during execution.
164
+ */
165
+ /**
166
+ * Extension fields to add to the formatted error.
167
+ */
168
+ /**
169
+ * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
170
+ */
171
+ constructor(t, ...s) {
172
+ var a, r, o;
173
+ const { nodes: i, source: l, positions: c, path: u, originalError: d, extensions: p } = Is(s);
174
+ super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = d ?? void 0, this.nodes = lt(
175
+ Array.isArray(i) ? i : i ? [i] : void 0
176
+ );
177
+ const f = lt(
178
+ (a = this.nodes) === null || a === void 0 ? void 0 : a.map((x) => x.loc).filter((x) => x != null)
179
+ );
180
+ this.source = l ?? (f == null || (r = f[0]) === null || r === void 0 ? void 0 : r.source), this.positions = c ?? f?.map((x) => x.start), this.locations = c && l ? c.map((x) => Pe(l, x)) : f?.map((x) => Pe(x.source, x.start));
181
+ const m = Rs(
182
+ d?.extensions
183
+ ) ? d?.extensions : void 0;
184
+ this.extensions = (o = p ?? m) !== null && o !== void 0 ? o : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
185
+ message: {
186
+ writable: !0,
187
+ enumerable: !0
188
+ },
189
+ name: {
190
+ enumerable: !1
191
+ },
192
+ nodes: {
193
+ enumerable: !1
194
+ },
195
+ source: {
196
+ enumerable: !1
197
+ },
198
+ positions: {
199
+ enumerable: !1
200
+ },
201
+ originalError: {
202
+ enumerable: !1
203
+ }
204
+ }), d != null && d.stack ? Object.defineProperty(this, "stack", {
205
+ value: d.stack,
206
+ writable: !0,
207
+ configurable: !0
208
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, qe) : Object.defineProperty(this, "stack", {
209
+ value: Error().stack,
210
+ writable: !0,
211
+ configurable: !0
212
+ });
213
+ }
214
+ get [Symbol.toStringTag]() {
215
+ return "GraphQLError";
216
+ }
217
+ toString() {
218
+ let t = this.message;
219
+ if (this.nodes)
220
+ for (const s of this.nodes)
221
+ s.loc && (t += `
222
+
223
+ ` + $s(s.loc));
224
+ else if (this.source && this.locations)
225
+ for (const s of this.locations)
226
+ t += `
227
+
228
+ ` + At(this.source, s);
229
+ return t;
230
+ }
231
+ toJSON() {
232
+ const t = {
233
+ message: this.message
234
+ };
235
+ return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
236
+ }
237
+ }
238
+ function lt(e) {
239
+ return e === void 0 || e.length === 0 ? void 0 : e;
240
+ }
241
+ function $(e, t, s) {
242
+ return new qe(`Syntax Error: ${s}`, {
243
+ source: e,
244
+ positions: [t]
245
+ });
246
+ }
247
+ class Ma {
248
+ /**
249
+ * The character offset at which this Node begins.
250
+ */
251
+ /**
252
+ * The character offset at which this Node ends.
253
+ */
254
+ /**
255
+ * The Token at which this Node begins.
256
+ */
257
+ /**
258
+ * The Token at which this Node ends.
259
+ */
260
+ /**
261
+ * The Source document the AST represents.
262
+ */
263
+ constructor(t, s, a) {
264
+ this.start = t.start, this.end = s.end, this.startToken = t, this.endToken = s, this.source = a;
265
+ }
266
+ get [Symbol.toStringTag]() {
267
+ return "Location";
268
+ }
269
+ toJSON() {
270
+ return {
271
+ start: this.start,
272
+ end: this.end
273
+ };
274
+ }
275
+ }
276
+ class Ot {
277
+ /**
278
+ * The kind of Token.
279
+ */
280
+ /**
281
+ * The character offset at which this Node begins.
282
+ */
283
+ /**
284
+ * The character offset at which this Node ends.
285
+ */
286
+ /**
287
+ * The 1-indexed line number on which this Token appears.
288
+ */
289
+ /**
290
+ * The 1-indexed column number at which this Token begins.
291
+ */
292
+ /**
293
+ * For non-punctuation tokens, represents the interpreted value of the token.
294
+ *
295
+ * Note: is undefined for punctuation tokens, but typed as string for
296
+ * convenience in the parser.
297
+ */
298
+ /**
299
+ * Tokens exist as nodes in a double-linked-list amongst all tokens
300
+ * including ignored tokens. <SOF> is always the first node and <EOF>
301
+ * the last.
302
+ */
303
+ constructor(t, s, a, r, o, i) {
304
+ this.kind = t, this.start = s, this.end = a, this.line = r, this.column = o, this.value = i, this.prev = null, this.next = null;
305
+ }
306
+ get [Symbol.toStringTag]() {
307
+ return "Token";
308
+ }
309
+ toJSON() {
310
+ return {
311
+ kind: this.kind,
312
+ value: this.value,
313
+ line: this.line,
314
+ column: this.column
315
+ };
316
+ }
317
+ }
318
+ const Es = {
319
+ Name: [],
320
+ Document: ["definitions"],
321
+ OperationDefinition: [
322
+ "name",
323
+ "variableDefinitions",
324
+ "directives",
325
+ "selectionSet"
326
+ ],
327
+ VariableDefinition: ["variable", "type", "defaultValue", "directives"],
328
+ Variable: ["name"],
329
+ SelectionSet: ["selections"],
330
+ Field: ["alias", "name", "arguments", "directives", "selectionSet"],
331
+ Argument: ["name", "value"],
332
+ FragmentSpread: ["name", "directives"],
333
+ InlineFragment: ["typeCondition", "directives", "selectionSet"],
334
+ FragmentDefinition: [
335
+ "name",
336
+ // Note: fragment variable definitions are deprecated and will removed in v17.0.0
337
+ "variableDefinitions",
338
+ "typeCondition",
339
+ "directives",
340
+ "selectionSet"
341
+ ],
342
+ IntValue: [],
343
+ FloatValue: [],
344
+ StringValue: [],
345
+ BooleanValue: [],
346
+ NullValue: [],
347
+ EnumValue: [],
348
+ ListValue: ["values"],
349
+ ObjectValue: ["fields"],
350
+ ObjectField: ["name", "value"],
351
+ Directive: ["name", "arguments"],
352
+ NamedType: ["name"],
353
+ ListType: ["type"],
354
+ NonNullType: ["type"],
355
+ SchemaDefinition: ["description", "directives", "operationTypes"],
356
+ OperationTypeDefinition: ["type"],
357
+ ScalarTypeDefinition: ["description", "name", "directives"],
358
+ ObjectTypeDefinition: [
359
+ "description",
360
+ "name",
361
+ "interfaces",
362
+ "directives",
363
+ "fields"
364
+ ],
365
+ FieldDefinition: ["description", "name", "arguments", "type", "directives"],
366
+ InputValueDefinition: [
367
+ "description",
368
+ "name",
369
+ "type",
370
+ "defaultValue",
371
+ "directives"
372
+ ],
373
+ InterfaceTypeDefinition: [
374
+ "description",
375
+ "name",
376
+ "interfaces",
377
+ "directives",
378
+ "fields"
379
+ ],
380
+ UnionTypeDefinition: ["description", "name", "directives", "types"],
381
+ EnumTypeDefinition: ["description", "name", "directives", "values"],
382
+ EnumValueDefinition: ["description", "name", "directives"],
383
+ InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
384
+ DirectiveDefinition: ["description", "name", "arguments", "locations"],
385
+ SchemaExtension: ["directives", "operationTypes"],
386
+ ScalarTypeExtension: ["name", "directives"],
387
+ ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
388
+ InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
389
+ UnionTypeExtension: ["name", "directives", "types"],
390
+ EnumTypeExtension: ["name", "directives", "values"],
391
+ InputObjectTypeExtension: ["name", "directives", "fields"]
392
+ }, ks = new Set(Object.keys(Es));
393
+ function Ga(e) {
394
+ const t = e?.kind;
395
+ return typeof t == "string" && ks.has(t);
396
+ }
397
+ var dt;
398
+ (function(e) {
399
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
400
+ })(dt || (dt = {}));
401
+ function Le(e) {
402
+ return e === 9 || e === 32;
403
+ }
404
+ function ae(e) {
405
+ return e >= 48 && e <= 57;
406
+ }
407
+ function Rt(e) {
408
+ return e >= 97 && e <= 122 || // A-Z
409
+ e >= 65 && e <= 90;
410
+ }
411
+ function Pt(e) {
412
+ return Rt(e) || e === 95;
413
+ }
414
+ function Ds(e) {
415
+ return Rt(e) || ae(e) || e === 95;
416
+ }
417
+ function zs(e) {
418
+ var t;
419
+ let s = Number.MAX_SAFE_INTEGER, a = null, r = -1;
420
+ for (let i = 0; i < e.length; ++i) {
421
+ var o;
422
+ const l = e[i], c = Fs(l);
423
+ c !== l.length && (a = (o = a) !== null && o !== void 0 ? o : i, r = i, i !== 0 && c < s && (s = c));
424
+ }
425
+ return e.map((i, l) => l === 0 ? i : i.slice(s)).slice(
426
+ (t = a) !== null && t !== void 0 ? t : 0,
427
+ r + 1
428
+ );
429
+ }
430
+ function Fs(e) {
431
+ let t = 0;
432
+ for (; t < e.length && Le(e.charCodeAt(t)); )
433
+ ++t;
434
+ return t;
435
+ }
436
+ function qs(e, t) {
437
+ const s = e.replace(/"""/g, '\\"""'), a = s.split(/\r\n|[\n\r]/g), r = a.length === 1, o = a.length > 1 && a.slice(1).every((m) => m.length === 0 || Le(m.charCodeAt(0))), i = s.endsWith('\\"""'), l = e.endsWith('"') && !i, c = e.endsWith("\\"), u = l || c, d = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
438
+ (!r || e.length > 70 || u || o || i);
439
+ let p = "";
440
+ const f = r && Le(e.charCodeAt(0));
441
+ return (d && !f || o) && (p += `
442
+ `), p += s, (d || u) && (p += `
443
+ `), '"""' + p + '"""';
444
+ }
445
+ var g;
446
+ (function(e) {
447
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
448
+ })(g || (g = {}));
449
+ class Vs {
450
+ /**
451
+ * The previously focused non-ignored token.
452
+ */
453
+ /**
454
+ * The currently focused non-ignored token.
455
+ */
456
+ /**
457
+ * The (1-indexed) line containing the current token.
458
+ */
459
+ /**
460
+ * The character offset at which the current line begins.
461
+ */
462
+ constructor(t) {
463
+ const s = new Ot(g.SOF, 0, 0, 0, 0);
464
+ this.source = t, this.lastToken = s, this.token = s, this.line = 1, this.lineStart = 0;
465
+ }
466
+ get [Symbol.toStringTag]() {
467
+ return "Lexer";
468
+ }
469
+ /**
470
+ * Advances the token stream to the next non-ignored token.
471
+ */
472
+ advance() {
473
+ return this.lastToken = this.token, this.token = this.lookahead();
474
+ }
475
+ /**
476
+ * Looks ahead and returns the next non-ignored token, but does not change
477
+ * the state of Lexer.
478
+ */
479
+ lookahead() {
480
+ let t = this.token;
481
+ if (t.kind !== g.EOF)
482
+ do
483
+ if (t.next)
484
+ t = t.next;
485
+ else {
486
+ const s = _s(this, t.end);
487
+ t.next = s, s.prev = t, t = s;
488
+ }
489
+ while (t.kind === g.COMMENT);
490
+ return t;
491
+ }
492
+ }
493
+ function Bs(e) {
494
+ return e === g.BANG || e === g.DOLLAR || e === g.AMP || e === g.PAREN_L || e === g.PAREN_R || e === g.SPREAD || e === g.COLON || e === g.EQUALS || e === g.AT || e === g.BRACKET_L || e === g.BRACKET_R || e === g.BRACE_L || e === g.PIPE || e === g.BRACE_R;
495
+ }
496
+ function Z(e) {
497
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
498
+ }
499
+ function xe(e, t) {
500
+ return Lt(e.charCodeAt(t)) && $t(e.charCodeAt(t + 1));
501
+ }
502
+ function Lt(e) {
503
+ return e >= 55296 && e <= 56319;
504
+ }
505
+ function $t(e) {
506
+ return e >= 56320 && e <= 57343;
507
+ }
508
+ function U(e, t) {
509
+ const s = e.source.body.codePointAt(t);
510
+ if (s === void 0)
511
+ return g.EOF;
512
+ if (s >= 32 && s <= 126) {
513
+ const a = String.fromCodePoint(s);
514
+ return a === '"' ? `'"'` : `"${a}"`;
515
+ }
516
+ return "U+" + s.toString(16).toUpperCase().padStart(4, "0");
517
+ }
518
+ function T(e, t, s, a, r) {
519
+ const o = e.line, i = 1 + s - e.lineStart;
520
+ return new Ot(t, s, a, o, i, r);
521
+ }
522
+ function _s(e, t) {
523
+ const s = e.source.body, a = s.length;
524
+ let r = t;
525
+ for (; r < a; ) {
526
+ const o = s.charCodeAt(r);
527
+ switch (o) {
528
+ // Ignored ::
529
+ // - UnicodeBOM
530
+ // - WhiteSpace
531
+ // - LineTerminator
532
+ // - Comment
533
+ // - Comma
534
+ //
535
+ // UnicodeBOM :: "Byte Order Mark (U+FEFF)"
536
+ //
537
+ // WhiteSpace ::
538
+ // - "Horizontal Tab (U+0009)"
539
+ // - "Space (U+0020)"
540
+ //
541
+ // Comma :: ,
542
+ case 65279:
543
+ // <BOM>
544
+ case 9:
545
+ // \t
546
+ case 32:
547
+ // <space>
548
+ case 44:
549
+ ++r;
550
+ continue;
551
+ // LineTerminator ::
552
+ // - "New Line (U+000A)"
553
+ // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
554
+ // - "Carriage Return (U+000D)" "New Line (U+000A)"
555
+ case 10:
556
+ ++r, ++e.line, e.lineStart = r;
557
+ continue;
558
+ case 13:
559
+ s.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
560
+ continue;
561
+ // Comment
562
+ case 35:
563
+ return Us(e, r);
564
+ // Token ::
565
+ // - Punctuator
566
+ // - Name
567
+ // - IntValue
568
+ // - FloatValue
569
+ // - StringValue
570
+ //
571
+ // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
572
+ case 33:
573
+ return T(e, g.BANG, r, r + 1);
574
+ case 36:
575
+ return T(e, g.DOLLAR, r, r + 1);
576
+ case 38:
577
+ return T(e, g.AMP, r, r + 1);
578
+ case 40:
579
+ return T(e, g.PAREN_L, r, r + 1);
580
+ case 41:
581
+ return T(e, g.PAREN_R, r, r + 1);
582
+ case 46:
583
+ if (s.charCodeAt(r + 1) === 46 && s.charCodeAt(r + 2) === 46)
584
+ return T(e, g.SPREAD, r, r + 3);
585
+ break;
586
+ case 58:
587
+ return T(e, g.COLON, r, r + 1);
588
+ case 61:
589
+ return T(e, g.EQUALS, r, r + 1);
590
+ case 64:
591
+ return T(e, g.AT, r, r + 1);
592
+ case 91:
593
+ return T(e, g.BRACKET_L, r, r + 1);
594
+ case 93:
595
+ return T(e, g.BRACKET_R, r, r + 1);
596
+ case 123:
597
+ return T(e, g.BRACE_L, r, r + 1);
598
+ case 124:
599
+ return T(e, g.PIPE, r, r + 1);
600
+ case 125:
601
+ return T(e, g.BRACE_R, r, r + 1);
602
+ // StringValue
603
+ case 34:
604
+ return s.charCodeAt(r + 1) === 34 && s.charCodeAt(r + 2) === 34 ? Ws(e, r) : Gs(e, r);
605
+ }
606
+ if (ae(o) || o === 45)
607
+ return Ms(e, r, o);
608
+ if (Pt(o))
609
+ return Xs(e, r);
610
+ throw $(
611
+ e.source,
612
+ r,
613
+ o === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : Z(o) || xe(s, r) ? `Unexpected character: ${U(e, r)}.` : `Invalid character: ${U(e, r)}.`
614
+ );
615
+ }
616
+ return T(e, g.EOF, a, a);
617
+ }
618
+ function Us(e, t) {
619
+ const s = e.source.body, a = s.length;
620
+ let r = t + 1;
621
+ for (; r < a; ) {
622
+ const o = s.charCodeAt(r);
623
+ if (o === 10 || o === 13)
624
+ break;
625
+ if (Z(o))
626
+ ++r;
627
+ else if (xe(s, r))
628
+ r += 2;
629
+ else
630
+ break;
631
+ }
632
+ return T(
633
+ e,
634
+ g.COMMENT,
635
+ t,
636
+ r,
637
+ s.slice(t + 1, r)
638
+ );
639
+ }
640
+ function Ms(e, t, s) {
641
+ const a = e.source.body;
642
+ let r = t, o = s, i = !1;
643
+ if (o === 45 && (o = a.charCodeAt(++r)), o === 48) {
644
+ if (o = a.charCodeAt(++r), ae(o))
645
+ throw $(
646
+ e.source,
647
+ r,
648
+ `Invalid number, unexpected digit after 0: ${U(
649
+ e,
650
+ r
651
+ )}.`
652
+ );
653
+ } else
654
+ r = Ce(e, r, o), o = a.charCodeAt(r);
655
+ if (o === 46 && (i = !0, o = a.charCodeAt(++r), r = Ce(e, r, o), o = a.charCodeAt(r)), (o === 69 || o === 101) && (i = !0, o = a.charCodeAt(++r), (o === 43 || o === 45) && (o = a.charCodeAt(++r)), r = Ce(e, r, o), o = a.charCodeAt(r)), o === 46 || Pt(o))
656
+ throw $(
657
+ e.source,
658
+ r,
659
+ `Invalid number, expected digit but got: ${U(
660
+ e,
661
+ r
662
+ )}.`
663
+ );
664
+ return T(
665
+ e,
666
+ i ? g.FLOAT : g.INT,
667
+ t,
668
+ r,
669
+ a.slice(t, r)
670
+ );
671
+ }
672
+ function Ce(e, t, s) {
673
+ if (!ae(s))
674
+ throw $(
675
+ e.source,
676
+ t,
677
+ `Invalid number, expected digit but got: ${U(
678
+ e,
679
+ t
680
+ )}.`
681
+ );
682
+ const a = e.source.body;
683
+ let r = t + 1;
684
+ for (; ae(a.charCodeAt(r)); )
685
+ ++r;
686
+ return r;
687
+ }
688
+ function Gs(e, t) {
689
+ const s = e.source.body, a = s.length;
690
+ let r = t + 1, o = r, i = "";
691
+ for (; r < a; ) {
692
+ const l = s.charCodeAt(r);
693
+ if (l === 34)
694
+ return i += s.slice(o, r), T(e, g.STRING, t, r + 1, i);
695
+ if (l === 92) {
696
+ i += s.slice(o, r);
697
+ const c = s.charCodeAt(r + 1) === 117 ? s.charCodeAt(r + 2) === 123 ? Hs(e, r) : Qs(e, r) : Js(e, r);
698
+ i += c.value, r += c.size, o = r;
699
+ continue;
700
+ }
701
+ if (l === 10 || l === 13)
702
+ break;
703
+ if (Z(l))
704
+ ++r;
705
+ else if (xe(s, r))
706
+ r += 2;
707
+ else
708
+ throw $(
709
+ e.source,
710
+ r,
711
+ `Invalid character within String: ${U(
712
+ e,
713
+ r
714
+ )}.`
715
+ );
716
+ }
717
+ throw $(e.source, r, "Unterminated string.");
718
+ }
719
+ function Hs(e, t) {
720
+ const s = e.source.body;
721
+ let a = 0, r = 3;
722
+ for (; r < 12; ) {
723
+ const o = s.charCodeAt(t + r++);
724
+ if (o === 125) {
725
+ if (r < 5 || !Z(a))
726
+ break;
727
+ return {
728
+ value: String.fromCodePoint(a),
729
+ size: r
730
+ };
731
+ }
732
+ if (a = a << 4 | ee(o), a < 0)
733
+ break;
734
+ }
735
+ throw $(
736
+ e.source,
737
+ t,
738
+ `Invalid Unicode escape sequence: "${s.slice(
739
+ t,
740
+ t + r
741
+ )}".`
742
+ );
743
+ }
744
+ function Qs(e, t) {
745
+ const s = e.source.body, a = ut(s, t + 2);
746
+ if (Z(a))
747
+ return {
748
+ value: String.fromCodePoint(a),
749
+ size: 6
750
+ };
751
+ if (Lt(a) && s.charCodeAt(t + 6) === 92 && s.charCodeAt(t + 7) === 117) {
752
+ const r = ut(s, t + 8);
753
+ if ($t(r))
754
+ return {
755
+ value: String.fromCodePoint(a, r),
756
+ size: 12
757
+ };
758
+ }
759
+ throw $(
760
+ e.source,
761
+ t,
762
+ `Invalid Unicode escape sequence: "${s.slice(t, t + 6)}".`
763
+ );
764
+ }
765
+ function ut(e, t) {
766
+ return ee(e.charCodeAt(t)) << 12 | ee(e.charCodeAt(t + 1)) << 8 | ee(e.charCodeAt(t + 2)) << 4 | ee(e.charCodeAt(t + 3));
767
+ }
768
+ function ee(e) {
769
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
770
+ }
771
+ function Js(e, t) {
772
+ const s = e.source.body;
773
+ switch (s.charCodeAt(t + 1)) {
774
+ case 34:
775
+ return {
776
+ value: '"',
777
+ size: 2
778
+ };
779
+ case 92:
780
+ return {
781
+ value: "\\",
782
+ size: 2
783
+ };
784
+ case 47:
785
+ return {
786
+ value: "/",
787
+ size: 2
788
+ };
789
+ case 98:
790
+ return {
791
+ value: "\b",
792
+ size: 2
793
+ };
794
+ case 102:
795
+ return {
796
+ value: "\f",
797
+ size: 2
798
+ };
799
+ case 110:
800
+ return {
801
+ value: `
802
+ `,
803
+ size: 2
804
+ };
805
+ case 114:
806
+ return {
807
+ value: "\r",
808
+ size: 2
809
+ };
810
+ case 116:
811
+ return {
812
+ value: " ",
813
+ size: 2
814
+ };
815
+ }
816
+ throw $(
817
+ e.source,
818
+ t,
819
+ `Invalid character escape sequence: "${s.slice(
820
+ t,
821
+ t + 2
822
+ )}".`
823
+ );
824
+ }
825
+ function Ws(e, t) {
826
+ const s = e.source.body, a = s.length;
827
+ let r = e.lineStart, o = t + 3, i = o, l = "";
828
+ const c = [];
829
+ for (; o < a; ) {
830
+ const u = s.charCodeAt(o);
831
+ if (u === 34 && s.charCodeAt(o + 1) === 34 && s.charCodeAt(o + 2) === 34) {
832
+ l += s.slice(i, o), c.push(l);
833
+ const d = T(
834
+ e,
835
+ g.BLOCK_STRING,
836
+ t,
837
+ o + 3,
838
+ // Return a string of the lines joined with U+000A.
839
+ zs(c).join(`
840
+ `)
841
+ );
842
+ return e.line += c.length - 1, e.lineStart = r, d;
843
+ }
844
+ if (u === 92 && s.charCodeAt(o + 1) === 34 && s.charCodeAt(o + 2) === 34 && s.charCodeAt(o + 3) === 34) {
845
+ l += s.slice(i, o), i = o + 1, o += 4;
846
+ continue;
847
+ }
848
+ if (u === 10 || u === 13) {
849
+ l += s.slice(i, o), c.push(l), u === 13 && s.charCodeAt(o + 1) === 10 ? o += 2 : ++o, l = "", i = o, r = o;
850
+ continue;
851
+ }
852
+ if (Z(u))
853
+ ++o;
854
+ else if (xe(s, o))
855
+ o += 2;
856
+ else
857
+ throw $(
858
+ e.source,
859
+ o,
860
+ `Invalid character within String: ${U(
861
+ e,
862
+ o
863
+ )}.`
864
+ );
865
+ }
866
+ throw $(e.source, o, "Unterminated string.");
867
+ }
868
+ function Xs(e, t) {
869
+ const s = e.source.body, a = s.length;
870
+ let r = t + 1;
871
+ for (; r < a; ) {
872
+ const o = s.charCodeAt(r);
873
+ if (Ds(o))
874
+ ++r;
875
+ else
876
+ break;
877
+ }
878
+ return T(
879
+ e,
880
+ g.NAME,
881
+ t,
882
+ r,
883
+ s.slice(t, r)
884
+ );
885
+ }
886
+ const Zs = 10, It = 2;
887
+ function Et(e) {
888
+ return ge(e, []);
889
+ }
890
+ function ge(e, t) {
891
+ switch (typeof e) {
892
+ case "string":
893
+ return JSON.stringify(e);
894
+ case "function":
895
+ return e.name ? `[function ${e.name}]` : "[function]";
896
+ case "object":
897
+ return Ys(e, t);
898
+ default:
899
+ return String(e);
900
+ }
901
+ }
902
+ function Ys(e, t) {
903
+ if (e === null)
904
+ return "null";
905
+ if (t.includes(e))
906
+ return "[Circular]";
907
+ const s = [...t, e];
908
+ if (Ks(e)) {
909
+ const a = e.toJSON();
910
+ if (a !== e)
911
+ return typeof a == "string" ? a : ge(a, s);
912
+ } else if (Array.isArray(e))
913
+ return tr(e, s);
914
+ return er(e, s);
915
+ }
916
+ function Ks(e) {
917
+ return typeof e.toJSON == "function";
918
+ }
919
+ function er(e, t) {
920
+ const s = Object.entries(e);
921
+ return s.length === 0 ? "{}" : t.length > It ? "[" + nr(e) + "]" : "{ " + s.map(
922
+ ([r, o]) => r + ": " + ge(o, t)
923
+ ).join(", ") + " }";
924
+ }
925
+ function tr(e, t) {
926
+ if (e.length === 0)
927
+ return "[]";
928
+ if (t.length > It)
929
+ return "[Array]";
930
+ const s = Math.min(Zs, e.length), a = e.length - s, r = [];
931
+ for (let o = 0; o < s; ++o)
932
+ r.push(ge(e[o], t));
933
+ return a === 1 ? r.push("... 1 more item") : a > 1 && r.push(`... ${a} more items`), "[" + r.join(", ") + "]";
934
+ }
935
+ function nr(e) {
936
+ const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
937
+ if (t === "Object" && typeof e.constructor == "function") {
938
+ const s = e.constructor.name;
939
+ if (typeof s == "string" && s !== "")
940
+ return s;
941
+ }
942
+ return t;
943
+ }
944
+ const sr = globalThis.process && // eslint-disable-next-line no-undef
945
+ process.env.NODE_ENV === "production", rr = (
946
+ /* c8 ignore next 6 */
947
+ // FIXME: https://github.com/graphql/graphql-js/issues/2317
948
+ sr ? function(t, s) {
949
+ return t instanceof s;
950
+ } : function(t, s) {
951
+ if (t instanceof s)
952
+ return !0;
953
+ if (typeof t == "object" && t !== null) {
954
+ var a;
955
+ const r = s.prototype[Symbol.toStringTag], o = (
956
+ // We still need to support constructor's name to detect conflicts with older versions of this library.
957
+ Symbol.toStringTag in t ? t[Symbol.toStringTag] : (a = t.constructor) === null || a === void 0 ? void 0 : a.name
958
+ );
959
+ if (r === o) {
960
+ const i = Et(t);
961
+ throw new Error(`Cannot use ${r} "${i}" from another module or realm.
962
+
963
+ Ensure that there is only one instance of "graphql" in the node_modules
964
+ directory. If different versions of "graphql" are the dependencies of other
965
+ relied on modules, use "resolutions" to ensure only one version is installed.
966
+
967
+ https://yarnpkg.com/en/docs/selective-version-resolutions
968
+
969
+ Duplicate "graphql" modules cannot be used at the same time since different
970
+ versions may have different capabilities and behavior. The data from one
971
+ version used in the function from another could produce confusing and
972
+ spurious results.`);
973
+ }
974
+ }
975
+ return !1;
976
+ }
977
+ );
978
+ class kt {
979
+ constructor(t, s = "GraphQL request", a = {
980
+ line: 1,
981
+ column: 1
982
+ }) {
983
+ typeof t == "string" || we(!1, `Body must be a string. Received: ${Et(t)}.`), this.body = t, this.name = s, this.locationOffset = a, this.locationOffset.line > 0 || we(
984
+ !1,
985
+ "line in locationOffset is 1-indexed and must be positive."
986
+ ), this.locationOffset.column > 0 || we(
987
+ !1,
988
+ "column in locationOffset is 1-indexed and must be positive."
989
+ );
990
+ }
991
+ get [Symbol.toStringTag]() {
992
+ return "Source";
993
+ }
994
+ }
995
+ function ar(e) {
996
+ return rr(e, kt);
997
+ }
998
+ function or(e) {
999
+ const t = ar(e) ? e : new kt(e), s = t.body, a = new Vs(t);
1000
+ let r = "", o = !1;
1001
+ for (; a.advance().kind !== g.EOF; ) {
1002
+ const i = a.token, l = i.kind, c = !Bs(i.kind);
1003
+ o && (c || i.kind === g.SPREAD) && (r += " ");
1004
+ const u = s.slice(i.start, i.end);
1005
+ l === g.BLOCK_STRING ? r += qs(i.value, {
1006
+ minimize: !0
1007
+ }) : r += u, o = c;
1008
+ }
1009
+ return r;
1010
+ }
1011
+ const Dt = jt(
1012
+ void 0
1013
+ ), Ha = ({
1014
+ children: e,
1015
+ client: t
1016
+ }) => /* @__PURE__ */ n.jsx(Dt.Provider, { value: t, children: e }), zt = (e, t, ...[s]) => ({
1017
+ queryFn: () => e.fetch(t, s),
1018
+ queryKey: [or(t.toString()), s]
1019
+ }), ir = (e, ...[t]) => {
1020
+ const s = Kn(Dt);
1021
+ if (s === void 0)
1022
+ throw new Error("useGraphQL must be used within a GraphQLProvider");
1023
+ return zt(s, e, ...t === void 0 ? [] : [t]);
1024
+ };
1025
+ class H extends String {
1026
+ __apiType;
1027
+ value;
1028
+ __meta__;
1029
+ constructor(t, s) {
1030
+ super(t), this.value = t, this.__meta__ = s;
1031
+ }
1032
+ toString() {
1033
+ return this.value;
1034
+ }
1035
+ }
1036
+ const cr = new H(
1037
+ `
1038
+ fragment OperationsFragment on OperationItem {
1039
+ slug
1040
+ summary
1041
+ method
1042
+ description
1043
+ operationId
1044
+ contentTypes
1045
+ path
1046
+ deprecated
1047
+ extensions
1048
+ parameters {
1049
+ name
1050
+ in
1051
+ description
1052
+ required
1053
+ schema
1054
+ style
1055
+ explode
1056
+ examples {
1057
+ name
1058
+ description
1059
+ externalValue
1060
+ value
1061
+ summary
1062
+ }
1063
+ }
1064
+ requestBody {
1065
+ content {
1066
+ mediaType
1067
+ encoding {
1068
+ name
1069
+ }
1070
+ examples {
1071
+ name
1072
+ description
1073
+ externalValue
1074
+ value
1075
+ summary
1076
+ }
1077
+ schema
1078
+ }
1079
+ description
1080
+ required
1081
+ }
1082
+ responses {
1083
+ statusCode
1084
+ links
1085
+ description
1086
+ content {
1087
+ examples {
1088
+ name
1089
+ description
1090
+ externalValue
1091
+ value
1092
+ summary
1093
+ }
1094
+ mediaType
1095
+ encoding {
1096
+ name
1097
+ }
1098
+ schema
1099
+ }
1100
+ }
1101
+ }
1102
+ `,
1103
+ { fragmentName: "OperationsFragment" }
1104
+ ), lr = new H(`
1105
+ query ServersQuery($input: JSON!, $type: SchemaType!) {
1106
+ schema(input: $input, type: $type) {
1107
+ url
1108
+ servers {
1109
+ url
1110
+ }
1111
+ }
1112
+ }
1113
+ `), dr = new H(`
1114
+ query SchemaWarmup($input: JSON!, $type: SchemaType!) {
1115
+ schema(input: $input, type: $type) {
1116
+ openapi
1117
+ }
1118
+ }
1119
+ `), ur = new H(`
1120
+ query OperationsForTag($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
1121
+ schema(input: $input, type: $type) {
1122
+ servers {
1123
+ url
1124
+ }
1125
+ description
1126
+ summary
1127
+ title
1128
+ url
1129
+ version
1130
+ tag(slug: $tag, untagged: $untagged) {
1131
+ name
1132
+ description
1133
+ operations {
1134
+ slug
1135
+ ...OperationsFragment
1136
+ }
1137
+ next {
1138
+ name
1139
+ slug
1140
+ }
1141
+ prev {
1142
+ name
1143
+ slug
1144
+ }
1145
+ }
1146
+ }
1147
+ }
1148
+ fragment OperationsFragment on OperationItem {
1149
+ slug
1150
+ summary
1151
+ method
1152
+ description
1153
+ operationId
1154
+ contentTypes
1155
+ path
1156
+ deprecated
1157
+ extensions
1158
+ parameters {
1159
+ name
1160
+ in
1161
+ description
1162
+ required
1163
+ schema
1164
+ style
1165
+ explode
1166
+ examples {
1167
+ name
1168
+ description
1169
+ externalValue
1170
+ value
1171
+ summary
1172
+ }
1173
+ }
1174
+ requestBody {
1175
+ content {
1176
+ mediaType
1177
+ encoding {
1178
+ name
1179
+ }
1180
+ examples {
1181
+ name
1182
+ description
1183
+ externalValue
1184
+ value
1185
+ summary
1186
+ }
1187
+ schema
1188
+ }
1189
+ description
1190
+ required
1191
+ }
1192
+ responses {
1193
+ statusCode
1194
+ links
1195
+ description
1196
+ content {
1197
+ examples {
1198
+ name
1199
+ description
1200
+ externalValue
1201
+ value
1202
+ summary
1203
+ }
1204
+ mediaType
1205
+ encoding {
1206
+ name
1207
+ }
1208
+ schema
1209
+ }
1210
+ }
1211
+ }`), mr = new H(`
1212
+ query GetSchemas($input: JSON!, $type: SchemaType!) {
1213
+ schema(input: $input, type: $type) {
1214
+ title
1215
+ description
1216
+ summary
1217
+ components {
1218
+ schemas {
1219
+ name
1220
+ schema
1221
+ extensions
1222
+ }
1223
+ }
1224
+ }
1225
+ }
1226
+ `), pr = new H(`
1227
+ query getServerQuery($input: JSON!, $type: SchemaType!) {
1228
+ schema(input: $input, type: $type) {
1229
+ url
1230
+ servers {
1231
+ url
1232
+ }
1233
+ }
1234
+ }
1235
+ `), hr = new H(`
1236
+ query GetNavigationOperations($input: JSON!, $type: SchemaType!) {
1237
+ schema(input: $input, type: $type) {
1238
+ tags {
1239
+ slug
1240
+ name
1241
+ extensions
1242
+ operations {
1243
+ summary
1244
+ slug
1245
+ method
1246
+ operationId
1247
+ path
1248
+ }
1249
+ }
1250
+ components {
1251
+ schemas {
1252
+ __typename
1253
+ }
1254
+ }
1255
+ }
1256
+ }
1257
+ `), fr = {
1258
+ "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": lr,
1259
+ "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n deprecated\n extensions\n parameters {\n name\n in\n description\n required\n schema\n style\n explode\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n": cr,
1260
+ "\n query SchemaWarmup($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n openapi\n }\n }\n": dr,
1261
+ "\n query OperationsForTag(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n servers {\n url\n }\n description\n summary\n title\n url\n version\n tag(slug: $tag, untagged: $untagged) {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n next {\n name\n slug\n }\n prev {\n name\n slug\n }\n }\n }\n }\n": ur,
1262
+ "\n query GetSchemas($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n title\n description\n summary\n components {\n schemas {\n name\n schema\n extensions\n }\n }\n }\n }\n": mr,
1263
+ "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": pr,
1264
+ "\n query GetNavigationOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n slug\n name\n extensions\n operations {\n summary\n slug\n method\n operationId\n path\n }\n }\n components {\n schemas {\n __typename\n }\n }\n }\n }\n": hr
1265
+ };
1266
+ function xr(e) {
1267
+ return fr[e] ?? {};
1268
+ }
1269
+ const q = Fe.Root, Ft = Fe.CollapsibleTrigger, V = Fe.CollapsibleContent, qt = S.Root, Vt = S.Value, Ve = w.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__ */ n.jsxs(
1270
+ S.Trigger,
1271
+ {
1272
+ ref: a,
1273
+ className: v(
1274
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring focus:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",
1275
+ e
1276
+ ),
1277
+ ...s,
1278
+ children: [
1279
+ /* @__PURE__ */ n.jsx("span", { className: "truncate", children: t }),
1280
+ /* @__PURE__ */ n.jsx(S.Icon, { asChild: !0, children: /* @__PURE__ */ n.jsx(xt, { className: "shrink-0 h-4 w-4 opacity-50" }) })
1281
+ ]
1282
+ }
1283
+ ));
1284
+ Ve.displayName = S.Trigger.displayName;
1285
+ const Bt = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
1286
+ S.ScrollUpButton,
1287
+ {
1288
+ ref: s,
1289
+ className: v(
1290
+ "flex cursor-default items-center justify-center py-1",
1291
+ e
1292
+ ),
1293
+ ...t,
1294
+ children: /* @__PURE__ */ n.jsx(jn, { className: "h-4 w-4" })
1295
+ }
1296
+ ));
1297
+ Bt.displayName = S.ScrollUpButton.displayName;
1298
+ const _t = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
1299
+ S.ScrollDownButton,
1300
+ {
1301
+ ref: s,
1302
+ className: v(
1303
+ "flex cursor-default items-center justify-center py-1",
1304
+ e
1305
+ ),
1306
+ ...t,
1307
+ children: /* @__PURE__ */ n.jsx(xt, { className: "h-4 w-4" })
1308
+ }
1309
+ ));
1310
+ _t.displayName = S.ScrollDownButton.displayName;
1311
+ const Be = w.forwardRef(({ className: e, children: t, position: s = "popper", ...a }, r) => /* @__PURE__ */ n.jsx(S.Portal, { children: /* @__PURE__ */ n.jsxs(
1312
+ S.Content,
1313
+ {
1314
+ ref: r,
1315
+ className: v(
1316
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1317
+ s === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1318
+ e
1319
+ ),
1320
+ position: s,
1321
+ ...a,
1322
+ children: [
1323
+ /* @__PURE__ */ n.jsx(Bt, {}),
1324
+ /* @__PURE__ */ n.jsx(
1325
+ S.Viewport,
1326
+ {
1327
+ className: v(
1328
+ s === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
1329
+ "divide-y"
1330
+ ),
1331
+ children: t
1332
+ }
1333
+ ),
1334
+ /* @__PURE__ */ n.jsx(_t, {})
1335
+ ]
1336
+ }
1337
+ ) }));
1338
+ Be.displayName = S.Content.displayName;
1339
+ const gr = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
1340
+ S.Label,
1341
+ {
1342
+ ref: s,
1343
+ className: v("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
1344
+ ...t
1345
+ }
1346
+ ));
1347
+ gr.displayName = S.Label.displayName;
1348
+ const te = w.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__ */ n.jsxs(
1349
+ S.Item,
1350
+ {
1351
+ ref: a,
1352
+ className: v(
1353
+ "relative flex w-full cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1354
+ e
1355
+ ),
1356
+ ...s,
1357
+ children: [
1358
+ /* @__PURE__ */ n.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n.jsx(S.ItemIndicator, { children: /* @__PURE__ */ n.jsx(gt, { className: "h-4 w-4" }) }) }),
1359
+ /* @__PURE__ */ n.jsx(S.ItemText, { children: t })
1360
+ ]
1361
+ }
1362
+ ));
1363
+ te.displayName = S.Item.displayName;
1364
+ const yr = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
1365
+ S.Separator,
1366
+ {
1367
+ ref: s,
1368
+ className: v("-mx-1 my-1 h-px bg-muted", e),
1369
+ ...t
1370
+ }
1371
+ ));
1372
+ yr.displayName = S.Separator.displayName;
1373
+ function vr() {
1374
+ const t = navigator.userAgent.toLowerCase();
1375
+ if (t.indexOf("win") !== -1)
1376
+ return "windows";
1377
+ if (t.indexOf("mac") !== -1)
1378
+ return "apple";
1379
+ if (t.indexOf("linux") !== -1)
1380
+ return "linux";
1381
+ if (t.indexOf("x11") !== -1)
1382
+ return "unix";
1383
+ }
1384
+ function br() {
1385
+ return vr() === "apple";
1386
+ }
1387
+ const jr = {
1388
+ other: {
1389
+ alt: "Alt",
1390
+ meta: "Ctrl",
1391
+ ctrl: "Ctrl",
1392
+ shift: "⇧",
1393
+ option: "Alt"
1394
+ },
1395
+ apple: {
1396
+ alt: "⌥",
1397
+ meta: "⌘",
1398
+ ctrl: "Ctrl",
1399
+ shift: "⇧",
1400
+ option: "⌥"
1401
+ }
1402
+ }, Nr = (e, t) => {
1403
+ const s = e.toLowerCase().split("+"), a = s.includes("meta"), r = s.includes("shift"), o = s.includes("option") || s.includes("alt"), i = s.includes("ctrl"), l = e.split("+").pop(), c = L(t);
1404
+ return z(() => {
1405
+ c.current = t;
1406
+ }, [t]), z(() => {
1407
+ const u = (d) => {
1408
+ (d.code === `Key${l?.toUpperCase()}` || d.code.toLowerCase() === l?.toLowerCase()) && d.metaKey === a && d.shiftKey === r && d.altKey === o && d.ctrlKey === i && (d.preventDefault(), c.current());
1409
+ };
1410
+ return window.addEventListener("keydown", u), () => {
1411
+ window.removeEventListener("keydown", u);
1412
+ };
1413
+ }, [l, a, r, o, i]), {
1414
+ trigger: () => c.current(),
1415
+ label: s.map(
1416
+ (u) => u === "meta" || u === "ctrl" || u === "alt" || u === "shift" || u === "option" ? jr[br() ? "apple" : "other"][u] : u
1417
+ )
1418
+ };
1419
+ }, wr = $e()(
1420
+ Ie(
1421
+ (e) => ({
1422
+ selectedServer: void 0,
1423
+ setSelectedServer: (t) => e({ selectedServer: t })
1424
+ }),
1425
+ { name: "zudoku-selected-server" }
1426
+ )
1427
+ ), Cr = (e) => {
1428
+ const { selectedServer: t, setSelectedServer: s } = wr();
1429
+ return { selectedServer: Nt(
1430
+ () => t && e.some((r) => r.url === t) ? t : e.at(0)?.url ?? "",
1431
+ [t, e]
1432
+ ), setSelectedServer: s };
1433
+ }, Ut = w.forwardRef(
1434
+ ({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
1435
+ "textarea",
1436
+ {
1437
+ className: v(
1438
+ "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1439
+ e
1440
+ ),
1441
+ ref: s,
1442
+ ...t
1443
+ }
1444
+ )
1445
+ );
1446
+ Ut.displayName = "Textarea";
1447
+ const M = ({
1448
+ children: e,
1449
+ className: t
1450
+ }) => /* @__PURE__ */ n.jsxs(
1451
+ "div",
1452
+ {
1453
+ className: v(
1454
+ "grid grid-cols-[max-content_1fr_min-content_max-content] items-center gap-4 group bg-muted w-full h-10 ps-4 pe-2 border-b",
1455
+ t
1456
+ ),
1457
+ children: [
1458
+ e,
1459
+ /* @__PURE__ */ n.jsx(
1460
+ Ft,
1461
+ {
1462
+ className: v(
1463
+ "flex items-center gap-4 group bg-muted w-full p-2 hover:bg-accent hover:brightness-95 rounded-md",
1464
+ t
1465
+ ),
1466
+ children: /* @__PURE__ */ n.jsx(
1467
+ Nn,
1468
+ {
1469
+ className: "group-data-[state=open]:rotate-180 transition-transform flex-shrink-0",
1470
+ size: 16
1471
+ }
1472
+ )
1473
+ }
1474
+ )
1475
+ ]
1476
+ }
1477
+ ), G = ({
1478
+ children: e,
1479
+ className: t
1480
+ }) => /* @__PURE__ */ n.jsx("span", { className: v("font-semibold w-full text-start", t), children: e }), Sr = C.Root, Tr = C.Trigger, Ar = C.Group, Or = w.forwardRef(({ className: e, inset: t, children: s, ...a }, r) => /* @__PURE__ */ n.jsxs(
1481
+ C.SubTrigger,
1482
+ {
1483
+ ref: r,
1484
+ className: v(
1485
+ "flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent",
1486
+ t && "pl-8",
1487
+ e
1488
+ ),
1489
+ ...a,
1490
+ children: [
1491
+ s,
1492
+ /* @__PURE__ */ n.jsx(wn, { className: "ml-auto h-4 w-4" })
1493
+ ]
1494
+ }
1495
+ ));
1496
+ Or.displayName = C.SubTrigger.displayName;
1497
+ const Rr = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
1498
+ C.SubContent,
1499
+ {
1500
+ ref: s,
1501
+ className: v(
1502
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1503
+ e
1504
+ ),
1505
+ ...t
1506
+ }
1507
+ ));
1508
+ Rr.displayName = C.SubContent.displayName;
1509
+ const Mt = w.forwardRef(({ className: e, sideOffset: t = 4, ...s }, a) => /* @__PURE__ */ n.jsx(C.Portal, { children: /* @__PURE__ */ n.jsx(
1510
+ C.Content,
1511
+ {
1512
+ ref: a,
1513
+ sideOffset: t,
1514
+ className: v(
1515
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
1516
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1517
+ e
1518
+ ),
1519
+ ...s
1520
+ }
1521
+ ) }));
1522
+ Mt.displayName = C.Content.displayName;
1523
+ const Gt = w.forwardRef(({ className: e, inset: t, ...s }, a) => /* @__PURE__ */ n.jsx(
1524
+ C.Item,
1525
+ {
1526
+ ref: a,
1527
+ className: v(
1528
+ "relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1529
+ t && "pl-8",
1530
+ e
1531
+ ),
1532
+ ...s
1533
+ }
1534
+ ));
1535
+ Gt.displayName = C.Item.displayName;
1536
+ const Pr = w.forwardRef(({ className: e, children: t, checked: s, ...a }, r) => /* @__PURE__ */ n.jsxs(
1537
+ C.CheckboxItem,
1538
+ {
1539
+ ref: r,
1540
+ className: v(
1541
+ "relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1542
+ e
1543
+ ),
1544
+ checked: s,
1545
+ ...a,
1546
+ children: [
1547
+ /* @__PURE__ */ n.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n.jsx(C.ItemIndicator, { children: /* @__PURE__ */ n.jsx(yt, { className: "h-4 w-4" }) }) }),
1548
+ t
1549
+ ]
1550
+ }
1551
+ ));
1552
+ Pr.displayName = C.CheckboxItem.displayName;
1553
+ const Lr = w.forwardRef(({ className: e, children: t, ...s }, a) => /* @__PURE__ */ n.jsxs(
1554
+ C.RadioItem,
1555
+ {
1556
+ ref: a,
1557
+ className: v(
1558
+ "relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1559
+ e
1560
+ ),
1561
+ ...s,
1562
+ children: [
1563
+ /* @__PURE__ */ n.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n.jsx(C.ItemIndicator, { children: /* @__PURE__ */ n.jsx(Cn, { className: "h-4 w-4 fill-current" }) }) }),
1564
+ t
1565
+ ]
1566
+ }
1567
+ ));
1568
+ Lr.displayName = C.RadioItem.displayName;
1569
+ const Ht = w.forwardRef(({ className: e, inset: t, ...s }, a) => /* @__PURE__ */ n.jsx(
1570
+ C.Label,
1571
+ {
1572
+ ref: a,
1573
+ className: v(
1574
+ "px-2 py-1.5 text-sm font-semibold",
1575
+ t && "pl-8",
1576
+ e
1577
+ ),
1578
+ ...s
1579
+ }
1580
+ ));
1581
+ Ht.displayName = C.Label.displayName;
1582
+ const Qt = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
1583
+ C.Separator,
1584
+ {
1585
+ ref: s,
1586
+ className: v("-mx-1 my-1 h-px bg-muted", e),
1587
+ ...t
1588
+ }
1589
+ ));
1590
+ Qt.displayName = C.Separator.displayName;
1591
+ const $r = ({
1592
+ examples: e,
1593
+ onSelect: t
1594
+ }) => /* @__PURE__ */ n.jsxs(Sr, { children: [
1595
+ /* @__PURE__ */ n.jsx(Tr, { asChild: !0, children: /* @__PURE__ */ n.jsxs(
1596
+ I,
1597
+ {
1598
+ variant: "ghost",
1599
+ size: "sm",
1600
+ className: "hover:bg-accent hover:brightness-95",
1601
+ children: [
1602
+ "Use Example ",
1603
+ /* @__PURE__ */ n.jsx(fe, { size: 16, className: "ml-2" })
1604
+ ]
1605
+ }
1606
+ ) }),
1607
+ /* @__PURE__ */ n.jsx(Mt, { className: "max-w-72", children: e.map((s) => /* @__PURE__ */ n.jsxs("div", { children: [
1608
+ /* @__PURE__ */ n.jsx(Ht, { children: s.mediaType }),
1609
+ /* @__PURE__ */ n.jsx(Qt, {}),
1610
+ /* @__PURE__ */ n.jsx(Ar, { children: s.examples?.map((a) => /* @__PURE__ */ n.jsx(
1611
+ Gt,
1612
+ {
1613
+ onSelect: () => t(a, s.mediaType),
1614
+ children: /* @__PURE__ */ n.jsx(
1615
+ "span",
1616
+ {
1617
+ className: "line-clamp-1",
1618
+ title: a.summary ?? a.name,
1619
+ children: a.summary ?? a.name
1620
+ }
1621
+ )
1622
+ },
1623
+ a.name
1624
+ )) })
1625
+ ] }, s.mediaType)) })
1626
+ ] }), Ir = ({ content: e }) => {
1627
+ const { register: t, setValue: s, watch: a } = oe(), r = (e ?? []).flatMap((i) => i.examples), o = a("headers");
1628
+ return /* @__PURE__ */ n.jsxs(q, { defaultOpen: !0, children: [
1629
+ /* @__PURE__ */ n.jsxs(M, { children: [
1630
+ /* @__PURE__ */ n.jsx(Sn, { size: 16 }),
1631
+ /* @__PURE__ */ n.jsx(G, { children: "Body" }),
1632
+ e && r.length > 0 ? /* @__PURE__ */ n.jsx(
1633
+ $r,
1634
+ {
1635
+ examples: e,
1636
+ onSelect: (i, l) => {
1637
+ s("body", JSON.stringify(i.value, null, 2)), s("headers", [
1638
+ ...o.filter((c) => c.name !== "Content-Type"),
1639
+ {
1640
+ name: "Content-Type",
1641
+ value: l,
1642
+ active: !0
1643
+ }
1644
+ ]);
1645
+ }
1646
+ }
1647
+ ) : /* @__PURE__ */ n.jsx("div", {})
1648
+ ] }),
1649
+ /* @__PURE__ */ n.jsx(V, { className: "flex flex-col gap-2 ", children: /* @__PURE__ */ n.jsx(
1650
+ Ut,
1651
+ {
1652
+ ...t("body"),
1653
+ className: v(
1654
+ "w-full p-2 h-64 font-mono md:text-xs border-none rounded-none focus-visible:ring-0"
1655
+ ),
1656
+ placeholder: "Your body here..."
1657
+ }
1658
+ ) })
1659
+ ] });
1660
+ }, mt = (e, t, s) => {
1661
+ const a = t.replace(/(:\w+|\{\w+})/g, (o) => {
1662
+ const i = o.replace(/[:{}]/g, "");
1663
+ return s.pathParams.find((c) => c.name === i)?.value ?? o;
1664
+ }), r = new URL(
1665
+ a.replace(/^\//, ""),
1666
+ e.endsWith("/") ? e : `${e}/`
1667
+ );
1668
+ return s.queryParams.filter((o) => o.active).forEach((o) => {
1669
+ r.searchParams.set(o.name, o.value);
1670
+ }), r;
1671
+ };
1672
+ function Er(e) {
1673
+ return /^(application\/octet-stream|image\/|audio\/|video\/|font\/|application\/pdf|application\/zip|application\/x-protobuf|application\/x-binary)/i.test(
1674
+ e
1675
+ );
1676
+ }
1677
+ const kr = (e, t) => {
1678
+ const s = e.find(
1679
+ ([a]) => a.toLowerCase() === "content-disposition"
1680
+ )?.[1];
1681
+ if (s) {
1682
+ const a = s.match(
1683
+ /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/
1684
+ );
1685
+ if (a?.[1])
1686
+ return a[1].replace(/['"]/g, "");
1687
+ }
1688
+ try {
1689
+ const r = new URL(t).pathname.split("/").pop() || "download";
1690
+ return r.includes(".") ? r : "download";
1691
+ } catch {
1692
+ return "download";
1693
+ }
1694
+ }, ye = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
1695
+ Re.Root,
1696
+ {
1697
+ ref: s,
1698
+ className: v(
1699
+ "peer h-4 w-4 shrink-0 rounded-[min(6px,var(--radius)-4px)] ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary",
1700
+ "border border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary",
1701
+ e
1702
+ ),
1703
+ ...t,
1704
+ children: /* @__PURE__ */ n.jsx(
1705
+ Re.Indicator,
1706
+ {
1707
+ className: v("flex items-center justify-center text-current"),
1708
+ children: /* @__PURE__ */ n.jsx(gt, { className: "h-4 w-4" })
1709
+ }
1710
+ )
1711
+ }
1712
+ ));
1713
+ ye.displayName = Re.Root.displayName;
1714
+ const Dr = ue.Root, Jt = w.forwardRef(({ className: e, align: t = "center", sideOffset: s = 4, ...a }, r) => /* @__PURE__ */ n.jsx(ue.Portal, { children: /* @__PURE__ */ n.jsx(
1715
+ ue.Content,
1716
+ {
1717
+ ref: r,
1718
+ align: t,
1719
+ sideOffset: s,
1720
+ className: v(
1721
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1722
+ e
1723
+ ),
1724
+ ...a
1725
+ }
1726
+ ) }));
1727
+ Jt.displayName = ue.Content.displayName;
1728
+ const zr = ({
1729
+ value: e,
1730
+ options: t,
1731
+ onChange: s,
1732
+ className: a,
1733
+ placeholder: r = "Value",
1734
+ onEnterPress: o,
1735
+ ref: i
1736
+ }) => {
1737
+ const [l, c] = k(!1), [u, d] = k(!1), p = gs((m) => m.filtered.count), f = L(null);
1738
+ return /* @__PURE__ */ n.jsxs(Dr, { open: l, children: [
1739
+ /* @__PURE__ */ n.jsx(xs, { children: /* @__PURE__ */ n.jsx(
1740
+ vs,
1741
+ {
1742
+ autoComplete: "off",
1743
+ ref: (m) => {
1744
+ f.current = m, typeof i == "function" ? i(m) : i && (i.current = m);
1745
+ },
1746
+ value: e,
1747
+ placeholder: r,
1748
+ className: v("h-9 bg-transparent", a),
1749
+ onFocus: () => c(!0),
1750
+ onBlur: () => {
1751
+ u || c(!1);
1752
+ },
1753
+ onKeyDown: (m) => {
1754
+ m.key === "Enter" && (c(!1), f.current?.blur(), o?.(m));
1755
+ },
1756
+ onValueChange: (m) => s(m)
1757
+ }
1758
+ ) }),
1759
+ /* @__PURE__ */ n.jsx(
1760
+ Jt,
1761
+ {
1762
+ onMouseEnter: () => d(!0),
1763
+ onMouseLeave: () => d(!1),
1764
+ onOpenAutoFocus: (m) => m.preventDefault(),
1765
+ className: v("p-0 w-(--radix-popover-trigger-width)", {
1766
+ "border-0": p === 0
1767
+ }),
1768
+ align: "start",
1769
+ side: "bottom",
1770
+ onWheel: (m) => {
1771
+ m.stopPropagation();
1772
+ },
1773
+ onTouchMove: (m) => {
1774
+ m.stopPropagation();
1775
+ },
1776
+ children: /* @__PURE__ */ n.jsx(bs, { className: "max-h-[140px]", children: t.map((m) => /* @__PURE__ */ n.jsx(
1777
+ js,
1778
+ {
1779
+ value: m,
1780
+ onSelect: (x) => {
1781
+ s(x), c(!1);
1782
+ },
1783
+ className: "cursor-pointer",
1784
+ children: m
1785
+ },
1786
+ m
1787
+ )) })
1788
+ }
1789
+ )
1790
+ ] });
1791
+ }, pe = ({ shouldFilter: e, ...t }) => /* @__PURE__ */ n.jsx(ys, { className: "bg-transparent", shouldFilter: e, children: /* @__PURE__ */ n.jsx(zr, { ...t }) }), ie = (e, t) => {
1792
+ const s = w.forwardRef(({ className: a, asChild: r, ...o }, i) => {
1793
+ const l = r ? Ns : e;
1794
+ return w.createElement(l, {
1795
+ ...o,
1796
+ ref: i,
1797
+ className: typeof t == "function" ? t({ className: a }) : v(t, a)
1798
+ });
1799
+ });
1800
+ return s.displayName = `VariantComponent(${e})`, s;
1801
+ }, _e = ie(
1802
+ "div",
1803
+ "grid grid-cols-[min-content_2fr_3fr] items-center gap-x-5"
1804
+ ), he = ie(
1805
+ "div",
1806
+ "group h-9 hover:bg-accent/75 ps-4 pe-2 grid col-span-full grid-cols-subgrid items-center border-b"
1807
+ ), Fr = Object.freeze([
1808
+ "Accept",
1809
+ "Accept-Encoding",
1810
+ "Accept-Language",
1811
+ "Authorization",
1812
+ "Cache-Control",
1813
+ "Connection",
1814
+ "Content-Disposition",
1815
+ "Content-Encoding",
1816
+ "Content-Language",
1817
+ "Content-Length",
1818
+ "Content-Range",
1819
+ "Content-Security-Policy",
1820
+ "Content-Type",
1821
+ "Cookie",
1822
+ "Date",
1823
+ "ETag",
1824
+ "Expires",
1825
+ "Host",
1826
+ "If-Modified-Since",
1827
+ "Location",
1828
+ "Origin",
1829
+ "Pragma",
1830
+ "Referer",
1831
+ "Set-Cookie",
1832
+ "User-Agent",
1833
+ "X-Requested-With"
1834
+ ]), qr = ({
1835
+ control: e,
1836
+ schemaHeaders: t,
1837
+ lockedHeaders: s
1838
+ }) => {
1839
+ const { fields: a, append: r, remove: o } = ze({
1840
+ control: e,
1841
+ name: "headers"
1842
+ }), { setValue: i, watch: l, formState: c } = oe(), u = L([]), d = L([]), p = l("headers"), f = wt(
1843
+ (j) => {
1844
+ j?.stopPropagation(), r({ name: "", value: "", active: !1 }, { shouldFocus: !0 });
1845
+ },
1846
+ [r]
1847
+ );
1848
+ z(() => {
1849
+ p.length === 0 && f();
1850
+ }, [p, f]);
1851
+ const m = (j) => {
1852
+ u.current[j]?.focus();
1853
+ }, x = (j) => {
1854
+ f(), requestAnimationFrame(() => d.current[j + 1]?.focus());
1855
+ }, y = t.filter((j) => !p.some((N) => N.name === j.name)).map(({ name: j }) => j), b = a.flatMap((j, N) => !s?.map((O) => O.toLowerCase()).includes(j.name.toLowerCase()) ? [] : [N]), R = s?.map((j) => ({
1856
+ name: j,
1857
+ id: `locked-${j}`,
1858
+ value: "••••••••••",
1859
+ active: !0,
1860
+ locked: !0
1861
+ })) ?? [];
1862
+ return /* @__PURE__ */ n.jsxs(q, { defaultOpen: !0, children: [
1863
+ /* @__PURE__ */ n.jsxs(M, { children: [
1864
+ /* @__PURE__ */ n.jsx(Tn, { size: 16 }),
1865
+ /* @__PURE__ */ n.jsx(G, { children: "Headers" }),
1866
+ /* @__PURE__ */ n.jsxs(
1867
+ se,
1868
+ {
1869
+ onClick: f,
1870
+ type: "button",
1871
+ size: "sm",
1872
+ variant: "ghost",
1873
+ className: "hover:bg-accent hover:brightness-95 flex gap-2",
1874
+ children: [
1875
+ "Add header ",
1876
+ /* @__PURE__ */ n.jsx(fe, { size: 16 })
1877
+ ]
1878
+ }
1879
+ )
1880
+ ] }),
1881
+ /* @__PURE__ */ n.jsx(V, { className: "CollapsibleContent", children: /* @__PURE__ */ n.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ n.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ n.jsxs(_e, { children: [
1882
+ R.map((j) => /* @__PURE__ */ n.jsxs(at, { children: [
1883
+ /* @__PURE__ */ n.jsx(ot, { asChild: !0, children: /* @__PURE__ */ n.jsxs(
1884
+ he,
1885
+ {
1886
+ className: "opacity-50 cursor-not-allowed font-mono text-xs min-h-10",
1887
+ children: [
1888
+ /* @__PURE__ */ n.jsx(An, { size: 16 }),
1889
+ /* @__PURE__ */ n.jsx(
1890
+ me,
1891
+ {
1892
+ value: j.name,
1893
+ disabled: !0,
1894
+ className: "w-full border-0 p-0 m-0 shadow-none text-xs focus-visible:ring-0 font-mono"
1895
+ }
1896
+ ),
1897
+ /* @__PURE__ */ n.jsx("div", { children: j.value })
1898
+ ]
1899
+ },
1900
+ j.id
1901
+ ) }),
1902
+ /* @__PURE__ */ n.jsx(
1903
+ it,
1904
+ {
1905
+ alignOffset: 10,
1906
+ side: "bottom",
1907
+ align: "start",
1908
+ children: /* @__PURE__ */ n.jsx("p", { children: "This header is set by the selected authentication." })
1909
+ }
1910
+ )
1911
+ ] }, j.id)),
1912
+ a.map((j, N) => {
1913
+ const Q = t.find(
1914
+ (O) => O.name === p.at(N)?.name
1915
+ );
1916
+ return /* @__PURE__ */ n.jsxs(
1917
+ he,
1918
+ {
1919
+ className: v(
1920
+ b.includes(N) && "text-amber-600",
1921
+ b.includes(N) && !c.dirtyFields.headers?.[N]?.value && "hidden"
1922
+ ),
1923
+ children: [
1924
+ /* @__PURE__ */ n.jsx(
1925
+ F,
1926
+ {
1927
+ control: e,
1928
+ name: `headers.${N}.active`,
1929
+ render: ({ field: O }) => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
1930
+ /* @__PURE__ */ n.jsx(
1931
+ ye,
1932
+ {
1933
+ id: `headers.${N}.active`,
1934
+ className: v(
1935
+ b.includes(N) && "hidden"
1936
+ ),
1937
+ checked: O.value,
1938
+ onCheckedChange: (D) => {
1939
+ O.onChange(D);
1940
+ }
1941
+ }
1942
+ ),
1943
+ /* @__PURE__ */ n.jsxs(at, { children: [
1944
+ /* @__PURE__ */ n.jsx(ot, { asChild: !0, children: /* @__PURE__ */ n.jsx(
1945
+ On,
1946
+ {
1947
+ className: v(
1948
+ "text-amber-600",
1949
+ !b.includes(N) && "hidden"
1950
+ ),
1951
+ size: 16
1952
+ }
1953
+ ) }),
1954
+ /* @__PURE__ */ n.jsx(
1955
+ it,
1956
+ {
1957
+ alignOffset: 10,
1958
+ side: "bottom",
1959
+ align: "start",
1960
+ children: /* @__PURE__ */ n.jsx("p", { children: "This header will be overwritten by the selected authentication." })
1961
+ }
1962
+ )
1963
+ ] })
1964
+ ] })
1965
+ }
1966
+ ),
1967
+ /* @__PURE__ */ n.jsx(
1968
+ F,
1969
+ {
1970
+ control: e,
1971
+ name: `headers.${N}.name`,
1972
+ render: ({ field: O }) => /* @__PURE__ */ n.jsx(
1973
+ pe,
1974
+ {
1975
+ ...O,
1976
+ placeholder: "Name",
1977
+ className: "border-0 p-0 m-0 shadow-none focus-visible:ring-0 bg-transparent hover:bg-transparent text-xs font-mono",
1978
+ options: [...y, ...Fr],
1979
+ onEnterPress: () => m(N),
1980
+ onChange: (D) => {
1981
+ O.onChange(D), i(`headers.${N}.active`, !0);
1982
+ },
1983
+ ref: (D) => {
1984
+ d.current[N] = D;
1985
+ }
1986
+ }
1987
+ )
1988
+ }
1989
+ ),
1990
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
1991
+ /* @__PURE__ */ n.jsx(
1992
+ F,
1993
+ {
1994
+ control: e,
1995
+ name: `headers.${N}.value`,
1996
+ render: ({ field: O }) => Q?.enum && Q.enum.length > 0 ? /* @__PURE__ */ n.jsx(
1997
+ pe,
1998
+ {
1999
+ shouldFilter: !1,
2000
+ value: O.value,
2001
+ options: Q.enum ?? [],
2002
+ onChange: (P) => {
2003
+ O.onChange(P), i(`headers.${N}.active`, !0);
2004
+ },
2005
+ className: "border-0 p-0 m-0 shadow-none focus-visible:ring-0 bg-transparent hover:bg-transparent text-xs font-mono"
2006
+ }
2007
+ ) : /* @__PURE__ */ n.jsx(
2008
+ me,
2009
+ {
2010
+ placeholder: "Value",
2011
+ className: "w-full truncate border-0 p-0 m-0 shadow-none text-xs focus-visible:ring-0 font-mono",
2012
+ autoComplete: "off",
2013
+ ...O,
2014
+ ref: (P) => {
2015
+ u.current[N] = P;
2016
+ },
2017
+ onKeyDown: (P) => {
2018
+ P.key === "Enter" && P.currentTarget.value.trim() && x(N);
2019
+ }
2020
+ }
2021
+ )
2022
+ }
2023
+ ),
2024
+ /* @__PURE__ */ n.jsx(
2025
+ se,
2026
+ {
2027
+ size: "icon-xs",
2028
+ variant: "ghost",
2029
+ className: "text-muted-foreground opacity-0 group-hover:brightness-95 group-hover:opacity-100",
2030
+ onClick: () => o(N),
2031
+ type: "button",
2032
+ children: /* @__PURE__ */ n.jsx(vt, { size: 16 })
2033
+ }
2034
+ )
2035
+ ] })
2036
+ ]
2037
+ },
2038
+ j.id
2039
+ );
2040
+ })
2041
+ ] }) }) }) })
2042
+ ] });
2043
+ }, Vr = Cs(
2044
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
2045
+ ), Ue = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
2046
+ Tt.Root,
2047
+ {
2048
+ ref: s,
2049
+ className: v(Vr(), e),
2050
+ ...t
2051
+ }
2052
+ ));
2053
+ Ue.displayName = Tt.Root.displayName;
2054
+ const Wt = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
2055
+ re.Root,
2056
+ {
2057
+ className: v("grid gap-2", e),
2058
+ ...t,
2059
+ ref: s
2060
+ }
2061
+ ));
2062
+ Wt.displayName = re.Root.displayName;
2063
+ const Xt = w.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ n.jsx(
2064
+ re.Item,
2065
+ {
2066
+ ref: s,
2067
+ className: v(
2068
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
2069
+ e
2070
+ ),
2071
+ ...t,
2072
+ children: /* @__PURE__ */ n.jsx(re.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ n.jsx(Rn, { className: "h-2.5 w-2.5 fill-current text-current" }) })
2073
+ }
2074
+ ));
2075
+ Xt.displayName = re.Item.displayName;
2076
+ const Zt = ({
2077
+ identities: e,
2078
+ setValue: t,
2079
+ value: s
2080
+ }) => /* @__PURE__ */ n.jsx("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ n.jsx(
2081
+ Wt,
2082
+ {
2083
+ onValueChange: (a) => t(a),
2084
+ value: s,
2085
+ defaultValue: ne,
2086
+ className: "gap-0",
2087
+ disabled: e?.length === 0,
2088
+ children: [{ id: ne, label: "None" }, ...e ?? []].map(
2089
+ (a) => /* @__PURE__ */ n.jsxs(
2090
+ Ue,
2091
+ {
2092
+ className: "h-10 items-center border-b font-normal flex gap-4 p-4 cursor-pointer hover:bg-accent/75",
2093
+ children: [
2094
+ /* @__PURE__ */ n.jsx(Xt, { value: a.id, id: a.id }),
2095
+ /* @__PURE__ */ n.jsx("span", { children: a.label })
2096
+ ]
2097
+ },
2098
+ a.id
2099
+ )
2100
+ )
2101
+ }
2102
+ ) }), Br = ({
2103
+ onSubmit: e,
2104
+ identities: t,
2105
+ open: s,
2106
+ onOpenChange: a
2107
+ }) => {
2108
+ const [r, o] = k(void 0), [i, l] = k(!1);
2109
+ return /* @__PURE__ */ n.jsx(Ee, { open: s, onOpenChange: a, children: /* @__PURE__ */ n.jsxs(ke, { children: [
2110
+ /* @__PURE__ */ n.jsx(De, { children: "Select an auth identity" }),
2111
+ /* @__PURE__ */ n.jsx(Ct, { children: "Please select an identity for this request." }),
2112
+ /* @__PURE__ */ n.jsx(ws, { className: "max-h-80 overflow-auto", children: /* @__PURE__ */ n.jsx(
2113
+ Zt,
2114
+ {
2115
+ identities: t,
2116
+ setValue: o,
2117
+ value: r
2118
+ }
2119
+ ) }),
2120
+ /* @__PURE__ */ n.jsxs(St, { className: "flex flex-col gap-2", children: [
2121
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
2122
+ /* @__PURE__ */ n.jsx(
2123
+ ye,
2124
+ {
2125
+ id: "remember",
2126
+ checked: i,
2127
+ onCheckedChange: (c) => l(
2128
+ c === "indeterminate" ? !1 : !!c
2129
+ )
2130
+ }
2131
+ ),
2132
+ /* @__PURE__ */ n.jsx(Ue, { htmlFor: "remember", children: "Remember my choice" })
2133
+ ] }),
2134
+ /* @__PURE__ */ n.jsx(
2135
+ I,
2136
+ {
2137
+ onClick: () => e({ identity: r, rememberedIdentity: i }),
2138
+ children: "Send"
2139
+ }
2140
+ )
2141
+ ] })
2142
+ ] }) });
2143
+ }, Se = (e) => Math.abs(
2144
+ isNaN(parseInt(e)) ? e.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(e)) ? 0 : parseInt(e)
2145
+ ), Te = (e) => e.length > 1 ? parseInt(e.split("").reduce((t, s) => `${Se(t) + Se(s)}`)) : Se(e), pt = (e, t = {}) => {
2146
+ const s = (3 * Te(e) + 2 * Te(e) + Te(e)) % 360, { saturation: a = 75, lightness: r = 60 } = t;
2147
+ return `${s}deg ${a}% ${r}%`;
2148
+ }, Ae = "data-linked-param", _r = (e) => {
2149
+ const { resolvedTheme: t } = Ss();
2150
+ return {
2151
+ text: pt(
2152
+ e,
2153
+ t === "light" ? { saturation: 95, lightness: 38 } : {}
2154
+ ),
2155
+ background: pt(
2156
+ e,
2157
+ t === "light" ? { saturation: 85, lightness: 40 } : {}
2158
+ )
2159
+ };
2160
+ }, Yt = ({
2161
+ name: e,
2162
+ className: t,
2163
+ slug: s,
2164
+ title: a,
2165
+ children: r,
2166
+ onClick: o
2167
+ }) => {
2168
+ const i = L(null), l = s?.replace(/[{}]/g, ""), c = e.replace(/[{}]/g, ""), { text: u, background: d } = _r(c), p = `hsl(${u} / 100%)`, f = `hsl(${d} / 10%)`, m = `hsl(${d} / 50%)`;
2169
+ return z(() => {
2170
+ if (!l || !i.current) return;
2171
+ const x = () => {
2172
+ document.querySelectorAll(`[${Ae}="${l}"]`).forEach((R) => {
2173
+ R instanceof HTMLElement && (R.dataset.active = "true");
2174
+ });
2175
+ }, y = () => {
2176
+ document.querySelectorAll(`[${Ae}="${l}"]`).forEach((R) => {
2177
+ R instanceof HTMLElement && (R.dataset.active = "false");
2178
+ });
2179
+ }, b = i.current;
2180
+ return b.addEventListener("mouseenter", x), b.addEventListener("mouseleave", y), () => {
2181
+ b.removeEventListener("mouseenter", x), b.removeEventListener("mouseleave", y);
2182
+ };
2183
+ }, [l]), /* @__PURE__ */ n.jsx(
2184
+ "span",
2185
+ {
2186
+ [Ae]: l,
2187
+ className: v(
2188
+ // This may not contain (inline-)flex or (inline-)block otherwise it breaks the browser's full text search
2189
+ "relative transition-all duration-100 rounded-lg",
2190
+ "border border-(--border-color) p-0.5 text-(--param-color) bg-(--background-color)",
2191
+ "data-[active=true]:border-(--param-color) data-[active=true]:shadow-sm data-[active=true]:bottom-px",
2192
+ t
2193
+ ),
2194
+ title: a,
2195
+ suppressHydrationWarning: !0,
2196
+ ref: i,
2197
+ onClick: o,
2198
+ style: {
2199
+ "--param-color": p,
2200
+ "--border-color": m,
2201
+ "--background-color": f
2202
+ },
2203
+ children: r ?? e
2204
+ }
2205
+ );
2206
+ }, Ur = ({
2207
+ control: e,
2208
+ url: t
2209
+ }) => {
2210
+ const { fields: s } = ze({
2211
+ control: e,
2212
+ name: "pathParams"
2213
+ }), a = [...s].sort(
2214
+ (r, o) => t.indexOf(`{${r.name}}`) - t.indexOf(`{${o.name}}`)
2215
+ );
2216
+ return /* @__PURE__ */ n.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ n.jsx(_e, { children: a.map((r, o) => /* @__PURE__ */ n.jsxs(he, { children: [
2217
+ /* @__PURE__ */ n.jsx(
2218
+ F,
2219
+ {
2220
+ control: e,
2221
+ name: `pathParams.${o}.name`,
2222
+ render: () => /* @__PURE__ */ n.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ n.jsx(
2223
+ Yt,
2224
+ {
2225
+ slug: r.name,
2226
+ name: r.name,
2227
+ className: "font-mono text-xs px-2"
2228
+ }
2229
+ ) })
2230
+ }
2231
+ ),
2232
+ /* @__PURE__ */ n.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ n.jsx(
2233
+ F,
2234
+ {
2235
+ control: e,
2236
+ name: `pathParams.${o}.value`,
2237
+ render: ({ field: i }) => /* @__PURE__ */ n.jsx(
2238
+ me,
2239
+ {
2240
+ ...i,
2241
+ required: !0,
2242
+ placeholder: "Value",
2243
+ className: "w-full truncate border-0 p-0 m-0 shadow-none text-xs font-mono focus-visible:ring-0"
2244
+ }
2245
+ )
2246
+ }
2247
+ ) })
2248
+ ] }, r.id)) }) });
2249
+ }, Mr = ie(
2250
+ "input",
2251
+ "bg-transparent h-9 font-mono text-xs"
2252
+ ), Gr = ({
2253
+ control: e,
2254
+ schemaQueryParams: t
2255
+ }) => {
2256
+ const { fields: s, remove: a, append: r } = ze({
2257
+ control: e,
2258
+ name: "queryParams"
2259
+ }), { setValue: o, getValues: i, watch: l } = oe(), c = l("queryParams");
2260
+ z(() => {
2261
+ c.length === 0 && r({ name: "", value: "", active: !1 }, { shouldFocus: !0 });
2262
+ }, [c, r]);
2263
+ const u = t.map(
2264
+ (d) => !!d.isRequired
2265
+ );
2266
+ return /* @__PURE__ */ n.jsxs(q, { defaultOpen: !0, children: [
2267
+ /* @__PURE__ */ n.jsxs(M, { children: [
2268
+ /* @__PURE__ */ n.jsx(Pn, { size: 16 }),
2269
+ /* @__PURE__ */ n.jsx(G, { children: "Query Parameters" }),
2270
+ /* @__PURE__ */ n.jsxs(
2271
+ I,
2272
+ {
2273
+ onClick: () => {
2274
+ o("queryParams", [
2275
+ ...i("queryParams"),
2276
+ { name: "", value: "", active: !1 }
2277
+ ]);
2278
+ },
2279
+ type: "button",
2280
+ size: "sm",
2281
+ variant: "ghost",
2282
+ className: "hover:bg-accent hover:brightness-95 flex gap-2",
2283
+ children: [
2284
+ "Add parameter ",
2285
+ /* @__PURE__ */ n.jsx(fe, { size: 16 })
2286
+ ]
2287
+ }
2288
+ )
2289
+ ] }),
2290
+ /* @__PURE__ */ n.jsx(V, { className: "CollapsibleContent", children: /* @__PURE__ */ n.jsx("div", { className: "overflow-hidden w-full", children: /* @__PURE__ */ n.jsx(_e, { children: s.map((d, p) => {
2291
+ const f = t.find(
2292
+ (m) => m.name === c.at(p)?.name
2293
+ );
2294
+ return /* @__PURE__ */ n.jsxs(he, { children: [
2295
+ /* @__PURE__ */ n.jsx(
2296
+ F,
2297
+ {
2298
+ control: e,
2299
+ name: `queryParams.${p}.active`,
2300
+ render: ({ field: m }) => /* @__PURE__ */ n.jsx(
2301
+ ye,
2302
+ {
2303
+ id: `queryParams.${p}.active`,
2304
+ checked: m.value,
2305
+ onCheckedChange: m.onChange
2306
+ }
2307
+ )
2308
+ }
2309
+ ),
2310
+ /* @__PURE__ */ n.jsx(
2311
+ F,
2312
+ {
2313
+ control: e,
2314
+ render: ({ field: m }) => u[p] ? /* @__PURE__ */ n.jsx(Mr, { asChild: !0, children: /* @__PURE__ */ n.jsxs(
2315
+ "label",
2316
+ {
2317
+ className: "flex items-center cursor-pointer gap-1",
2318
+ htmlFor: `queryParams.${p}.active`,
2319
+ title: u[p] ? "Required field" : void 0,
2320
+ children: [
2321
+ m.value,
2322
+ u[p] && /* @__PURE__ */ n.jsx("sup", { children: " *" })
2323
+ ]
2324
+ }
2325
+ ) }) : /* @__PURE__ */ n.jsx(
2326
+ pe,
2327
+ {
2328
+ placeholder: "Name",
2329
+ value: m.value,
2330
+ options: t.map((x) => x.name),
2331
+ onChange: (x) => {
2332
+ m.onChange(x);
2333
+ },
2334
+ className: "border-0 p-0 m-0 shadow-none focus-visible:ring-0 bg-transparent hover:bg-transparent text-xs font-mono"
2335
+ }
2336
+ ),
2337
+ name: `queryParams.${p}.name`
2338
+ }
2339
+ ),
2340
+ /* @__PURE__ */ n.jsxs("div", { className: "flex justify-between items-center", children: [
2341
+ /* @__PURE__ */ n.jsx(
2342
+ F,
2343
+ {
2344
+ control: e,
2345
+ render: ({ field: m }) => f?.enum && f.enum.length > 0 ? /* @__PURE__ */ n.jsx(
2346
+ pe,
2347
+ {
2348
+ value: m.value,
2349
+ options: f.enum ?? [],
2350
+ onChange: (y) => {
2351
+ m.onChange(y), o(`queryParams.${p}.active`, !0);
2352
+ },
2353
+ className: "border-0 shadow-none focus-visible:ring-0 bg-transparent hover:bg-transparent text-xs font-mono"
2354
+ }
2355
+ ) : /* @__PURE__ */ n.jsx(
2356
+ me,
2357
+ {
2358
+ ...m,
2359
+ onChange: (y) => {
2360
+ m.onChange(y.target.value), y.target.value.length > 0 && o(`queryParams.${p}.active`, !0);
2361
+ },
2362
+ placeholder: "Value",
2363
+ "aria-label": "Query parameter value",
2364
+ className: "w-full border-0 p-0 m-0 shadow-none focus-visible:ring-0 text-xs font-mono"
2365
+ }
2366
+ ),
2367
+ name: `queryParams.${p}.value`
2368
+ }
2369
+ ),
2370
+ /* @__PURE__ */ n.jsx(
2371
+ I,
2372
+ {
2373
+ size: "icon-xs",
2374
+ variant: "ghost",
2375
+ className: "text-muted-foreground opacity-0 group-hover:brightness-95 group-hover:opacity-100",
2376
+ onClick: () => a(p),
2377
+ type: "button",
2378
+ children: /* @__PURE__ */ n.jsx(vt, { size: 16 })
2379
+ }
2380
+ )
2381
+ ] })
2382
+ ] }, d.id);
2383
+ }) }) }) })
2384
+ ] });
2385
+ }, Hr = $e()(
2386
+ Ie(
2387
+ (e, t) => ({
2388
+ rememberedIdentity: null,
2389
+ setRememberedIdentity: (s) => e({ rememberedIdentity: s }),
2390
+ getRememberedIdentity: (s) => s.find(
2391
+ (a) => a === t().rememberedIdentity
2392
+ )
2393
+ }),
2394
+ {
2395
+ name: "identity-storage",
2396
+ storage: bt(() => sessionStorage)
2397
+ }
2398
+ )
2399
+ ), Qr = ({
2400
+ path: e,
2401
+ renderParam: t
2402
+ }) => {
2403
+ let s = 0;
2404
+ return e.split("/").map((a, r, o) => {
2405
+ const i = Array.from(a.matchAll(/{([^}]+)}/g)), l = [];
2406
+ let c = 0;
2407
+ return i.forEach((u) => {
2408
+ const [d, p] = u;
2409
+ if (!p) return;
2410
+ const f = u.index;
2411
+ f > c && l.push(
2412
+ /* @__PURE__ */ n.jsx(K, { children: a.slice(c, f) }, `text-${c}-${f}`)
2413
+ ), l.push(
2414
+ /* @__PURE__ */ n.jsx(K, { children: t({ name: p, originalValue: d, index: s++ }) }, `param-${p}`)
2415
+ ), c = f + d.length;
2416
+ }), c < a.length && l.push(
2417
+ /* @__PURE__ */ n.jsx(K, { children: a.slice(c) }, `text-${c}-${a.length}`)
2418
+ ), // eslint-disable-next-line react/no-array-index-key
2419
+ /* @__PURE__ */ n.jsxs(K, { children: [
2420
+ l,
2421
+ r < o.length - 1 && "/",
2422
+ /* @__PURE__ */ n.jsx("wbr", {})
2423
+ ] }, `${a}-${r}`);
2424
+ });
2425
+ }, Jr = ({ url: e }) => {
2426
+ const { watch: t, setFocus: s } = oe(), [a] = t(["pathParams"]);
2427
+ return /* @__PURE__ */ n.jsx(
2428
+ Qr,
2429
+ {
2430
+ path: e,
2431
+ renderParam: ({ name: r, originalValue: o, index: i }) => {
2432
+ const l = a.find(
2433
+ (c) => c.name === r
2434
+ )?.value;
2435
+ return /* @__PURE__ */ n.jsx(
2436
+ Yt,
2437
+ {
2438
+ name: r,
2439
+ backgroundOpacity: "0",
2440
+ slug: r,
2441
+ onClick: () => s(`pathParams.${i}.value`),
2442
+ children: l || o
2443
+ }
2444
+ );
2445
+ }
2446
+ }
2447
+ );
2448
+ }, Wr = () => {
2449
+ const { watch: e } = oe(), s = e("queryParams").filter((a) => a.active && a.name).map((a, r, o) => /* @__PURE__ */ n.jsxs(K, { children: [
2450
+ a.name,
2451
+ "=",
2452
+ encodeURIComponent(a.value).replaceAll("%20", "+"),
2453
+ r < o.length - 1 && "&",
2454
+ /* @__PURE__ */ n.jsx("wbr", {})
2455
+ ] }, a.name));
2456
+ return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
2457
+ s.length > 0 ? "?" : "",
2458
+ s
2459
+ ] });
2460
+ }, Xr = ({
2461
+ open: e,
2462
+ setOpen: t,
2463
+ onSignUp: s,
2464
+ onLogin: a
2465
+ }) => /* @__PURE__ */ n.jsx(Ee, { open: e, onOpenChange: t, children: /* @__PURE__ */ n.jsxs(ke, { children: [
2466
+ /* @__PURE__ */ n.jsx(De, { children: "Welcome to the Playground!" }),
2467
+ /* @__PURE__ */ n.jsx(Ct, { children: "The Playground is a tool for developers to test and explore our APIs. To use the Playground, you need to login." }),
2468
+ /* @__PURE__ */ n.jsxs(St, { className: "flex gap-2 sm:justify-between", children: [
2469
+ /* @__PURE__ */ n.jsx(I, { type: "button", variant: "ghost", onClick: () => t(!1), children: "Skip" }),
2470
+ /* @__PURE__ */ n.jsxs("div", { className: "flex gap-2", children: [
2471
+ s && /* @__PURE__ */ n.jsx(I, { type: "button", variant: "outline", onClick: s, children: "Sign Up" }),
2472
+ a && /* @__PURE__ */ n.jsx(I, { type: "button", variant: "default", onClick: a, children: "Login" })
2473
+ ] })
2474
+ ] })
2475
+ ] }) }), Kt = (e = 0) => {
2476
+ if (e === 0)
2477
+ return "0 B";
2478
+ const t = Math.floor(Math.log(e) / Math.log(1e3));
2479
+ return `${(e / Math.pow(1e3, t)).toFixed(
2480
+ t ? 2 : 0
2481
+ )} ${t ? `${"kMGTPEZY"[t - 1]}B` : "B"}`;
2482
+ }, Zr = ({ status: e }) => {
2483
+ if (!e) return /* @__PURE__ */ n.jsx("div", { className: "w-2 h-2 rounded-full bg-gray-500" });
2484
+ switch (Number(e.toString().slice(0, 1))) {
2485
+ case 2:
2486
+ return /* @__PURE__ */ n.jsx("div", { className: "w-2 h-2 rounded-full bg-green-500" });
2487
+ case 4:
2488
+ return /* @__PURE__ */ n.jsx("div", { className: "w-2 h-2 rounded-full bg-yellow-400" });
2489
+ case 5:
2490
+ return /* @__PURE__ */ n.jsx("div", { className: "w-2 h-2 rounded-full bg-red-500" });
2491
+ default:
2492
+ return /* @__PURE__ */ n.jsx("div", { className: "w-2 h-2 rounded-full bg-gray-500" });
2493
+ }
2494
+ }, Yr = () => {
2495
+ const e = L(null), t = L(null), s = L(Date.now()), a = L(null), r = wt(() => {
2496
+ if (t.current) {
2497
+ const o = Date.now() - s.current;
2498
+ t.current.nodeValue = o.toFixed();
2499
+ }
2500
+ a.current = requestAnimationFrame(r);
2501
+ }, []);
2502
+ return es(() => {
2503
+ const o = document.createTextNode("0"), i = e.current;
2504
+ return i.appendChild(o), t.current = o, s.current = Date.now(), a.current = requestAnimationFrame(r), () => {
2505
+ a.current && cancelAnimationFrame(a.current), t.current && i.contains(o) && i.removeChild(o);
2506
+ };
2507
+ }, [r]), /* @__PURE__ */ n.jsx("span", { className: "inline-block text-end w-[3ch]", ref: e });
2508
+ }, Kr = ({
2509
+ status: e,
2510
+ time: t,
2511
+ size: s,
2512
+ isFinished: a,
2513
+ progress: r
2514
+ }) => {
2515
+ const o = {
2516
+ 200: "OK",
2517
+ 201: "Created",
2518
+ 202: "Accepted",
2519
+ 204: "No Content",
2520
+ 400: "Bad Request",
2521
+ 401: "Unauthorized",
2522
+ 403: "Forbidden",
2523
+ 404: "Not Found",
2524
+ 405: "Method Not Allowed",
2525
+ 500: "Internal Server Error"
2526
+ };
2527
+ return /* @__PURE__ */ n.jsxs("div", { className: "relative flex h-10 text-xs gap-4 px-4 items-center justify-between font-mono border-b", children: [
2528
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
2529
+ /* @__PURE__ */ n.jsx(Zr, { status: e }),
2530
+ " ",
2531
+ e ?? "Sending Request...",
2532
+ e ? ` ${o[e]}` : ""
2533
+ ] }),
2534
+ /* @__PURE__ */ n.jsxs("div", { className: "flex gap-2", children: [
2535
+ /* @__PURE__ */ n.jsxs("div", { children: [
2536
+ /* @__PURE__ */ n.jsx("span", { className: "text-muted-foreground", children: "Size" }),
2537
+ " ",
2538
+ /* @__PURE__ */ n.jsx("span", { className: "inline-block text-end min-w-[5ch]", children: s ? Kt(s) : "- B" })
2539
+ ] }),
2540
+ /* @__PURE__ */ n.jsxs("div", { children: [
2541
+ /* @__PURE__ */ n.jsx("span", { className: "text-muted-foreground", children: "Time" }),
2542
+ " ",
2543
+ t !== void 0 ? `${t.toFixed(0)}` : /* @__PURE__ */ n.jsx(Yr, {}),
2544
+ "ms"
2545
+ ] })
2546
+ ] }),
2547
+ /* @__PURE__ */ n.jsx(
2548
+ "div",
2549
+ {
2550
+ className: "h-full bg-neutral-500/10 absolute left-0 -bottom-0 z-10 transition-all duration-200 ease-in-out",
2551
+ style: {
2552
+ opacity: a ? 0 : 1,
2553
+ width: a ? 0 : `${r * 100}%`
2554
+ }
2555
+ }
2556
+ )
2557
+ ] });
2558
+ };
2559
+ function Me(e) {
2560
+ if (e === null) return "null";
2561
+ if (Array.isArray(e)) {
2562
+ if (e.length === 0) return "any[]";
2563
+ const t = e[0];
2564
+ return t === void 0 ? "any[]" : `${Me(t)}[]`;
2565
+ }
2566
+ return typeof e == "object" ? ea(e) : typeof e;
2567
+ }
2568
+ function ea(e, t = "") {
2569
+ const s = ["{"];
2570
+ for (const [a, r] of Object.entries(e)) {
2571
+ const o = Me(r);
2572
+ s.push(` ${a}: ${o};`);
2573
+ }
2574
+ return s.push("}"), s.join(`
2575
+ `);
2576
+ }
2577
+ function ta(e) {
2578
+ return { lines: [`type GeneratedType = ${Me(e)};`] };
2579
+ }
2580
+ const en = ({
2581
+ code: e,
2582
+ language: t,
2583
+ children: s
2584
+ }) => {
2585
+ const { syntaxHighlighting: a } = Hn().options;
2586
+ return Yn(a?.highlighter, "Highlighter not found"), Ts(
2587
+ a.highlighter,
2588
+ e ?? s ?? "",
2589
+ t,
2590
+ a.themes
2591
+ );
2592
+ };
2593
+ en.displayName = "Highlight";
2594
+ const na = (e) => Object.entries({
2595
+ "application/json": "json",
2596
+ "text/json": "json",
2597
+ "text/html": "html",
2598
+ "text/css": "css",
2599
+ "text/javascript": "javascript",
2600
+ "application/xml": "xml",
2601
+ "application/xhtml+xml": "xhtml"
2602
+ }).find(
2603
+ ([s]) => e.includes(s)
2604
+ )?.[1], sa = (e) => {
2605
+ const t = e.find(([s]) => s.toLowerCase() === "content-type")?.[1] || "";
2606
+ return na(t);
2607
+ }, ra = (e) => {
2608
+ try {
2609
+ return JSON.stringify(JSON.parse(e), null, 2);
2610
+ } catch {
2611
+ return null;
2612
+ }
2613
+ }, aa = (e) => {
2614
+ const t = [
2615
+ "Content-Type",
2616
+ "Content-Length",
2617
+ "Authorization",
2618
+ "X-RateLimit-Remaining",
2619
+ "X-RateLimit-Limit",
2620
+ "Cache-Control",
2621
+ "ETag"
2622
+ ].map((s) => s.toLowerCase());
2623
+ return [...e].sort(([s], [a]) => {
2624
+ const r = t.indexOf(s.toLowerCase()), o = t.indexOf(a.toLowerCase());
2625
+ return r === o ? 0 : r === -1 ? 1 : o === -1 ? -1 : r - o;
2626
+ });
2627
+ }, Y = 3, Oe = ie(
2628
+ "div",
2629
+ "grid-cols-subgrid grid border-b col-span-full px-4 py-1.5 font-mono text-xs"
2630
+ ), X = ie("div", "py-1 break-all"), oa = ({
2631
+ body: e = "",
2632
+ headers: t,
2633
+ request: s,
2634
+ size: a,
2635
+ isBinary: r = !1,
2636
+ fileName: o,
2637
+ blob: i
2638
+ }) => {
2639
+ const l = sa(t), c = ra(e), u = c || e, [d, p] = k(
2640
+ c ? "formatted" : "raw"
2641
+ ), f = Qn({
2642
+ queryKey: ["types", u],
2643
+ queryFn: async () => ta(JSON.parse(u)),
2644
+ enabled: d === "types" && !r
2645
+ }), m = () => {
2646
+ if (i && o) {
2647
+ const y = URL.createObjectURL(i), b = document.createElement("a");
2648
+ b.href = y, b.download = o, document.body.appendChild(b), b.click(), document.body.removeChild(b), URL.revokeObjectURL(y);
2649
+ }
2650
+ }, x = aa([...t]);
2651
+ return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
2652
+ /* @__PURE__ */ n.jsxs(q, { defaultOpen: !0, children: [
2653
+ /* @__PURE__ */ n.jsxs(M, { children: [
2654
+ /* @__PURE__ */ n.jsx(Ln, { size: 16 }),
2655
+ /* @__PURE__ */ n.jsx(G, { className: "col-span-2", children: "Header Request" })
2656
+ ] }),
2657
+ /* @__PURE__ */ n.jsx(V, { children: /* @__PURE__ */ n.jsx("div", { className: "grid grid-cols-2 gap-x-6 text-sm", children: s.headers.slice(0, Y).map(([y, b]) => /* @__PURE__ */ n.jsxs(Oe, { children: [
2658
+ /* @__PURE__ */ n.jsx(X, { children: y }),
2659
+ /* @__PURE__ */ n.jsx(X, { children: b })
2660
+ ] }, y)) }) })
2661
+ ] }),
2662
+ /* @__PURE__ */ n.jsxs(q, { defaultOpen: !0, children: [
2663
+ /* @__PURE__ */ n.jsxs(M, { children: [
2664
+ /* @__PURE__ */ n.jsx($n, { size: 16 }),
2665
+ /* @__PURE__ */ n.jsx(G, { className: "col-span-2", children: "Header Response" })
2666
+ ] }),
2667
+ /* @__PURE__ */ n.jsx(V, { children: /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-2 gap-x-6 text-sm", children: [
2668
+ x.slice(0, Y).map(([y, b]) => /* @__PURE__ */ n.jsxs(Oe, { children: [
2669
+ /* @__PURE__ */ n.jsx(X, { children: y }),
2670
+ /* @__PURE__ */ n.jsx(X, { children: b })
2671
+ ] }, y)),
2672
+ x.length > Y && /* @__PURE__ */ n.jsxs(q, { className: "col-span-full grid-cols-subgrid grid group", children: [
2673
+ /* @__PURE__ */ n.jsxs(Ft, { className: "data-[state=open]:hidden justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2674
+ /* @__PURE__ */ n.jsxs("span", { children: [
2675
+ "Show ",
2676
+ x.length - Y,
2677
+ " more headers"
2678
+ ] }),
2679
+ /* @__PURE__ */ n.jsx(fe, { size: 12, className: "text-muted-foreground" })
2680
+ ] }),
2681
+ /* @__PURE__ */ n.jsx(V, { className: "col-span-full grid grid-cols-subgrid", children: x.slice(Y).map(([y, b]) => /* @__PURE__ */ n.jsxs(Oe, { children: [
2682
+ /* @__PURE__ */ n.jsx(X, { children: y }),
2683
+ /* @__PURE__ */ n.jsx(X, { children: b })
2684
+ ] }, y)) })
2685
+ ] })
2686
+ ] }) })
2687
+ ] }),
2688
+ /* @__PURE__ */ n.jsx("div", { className: "flex gap-2 justify-between items-center border-b h-10", children: c && !r && /* @__PURE__ */ n.jsx("div", { className: "px-2", children: /* @__PURE__ */ n.jsxs(
2689
+ qt,
2690
+ {
2691
+ value: d,
2692
+ onValueChange: (y) => p(y),
2693
+ children: [
2694
+ /* @__PURE__ */ n.jsx(Ve, { className: "min-w-32 border-none h-8", children: /* @__PURE__ */ n.jsx(Vt, { placeholder: "View" }) }),
2695
+ /* @__PURE__ */ n.jsxs(Be, { children: [
2696
+ /* @__PURE__ */ n.jsx(te, { value: "formatted", children: "Formatted" }),
2697
+ /* @__PURE__ */ n.jsx(te, { value: "raw", children: "Raw" }),
2698
+ /* @__PURE__ */ n.jsx(te, { value: "types", children: "Types" })
2699
+ ] })
2700
+ ]
2701
+ }
2702
+ ) }) }),
2703
+ /* @__PURE__ */ n.jsx("div", { children: r ? /* @__PURE__ */ n.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-center gap-4", children: [
2704
+ /* @__PURE__ */ n.jsx("div", { className: "text-lg font-semibold", children: "Binary Content" }),
2705
+ /* @__PURE__ */ n.jsx("div", { className: "text-sm text-muted-foreground", children: "This response contains binary data that cannot be displayed as text." }),
2706
+ /* @__PURE__ */ n.jsxs(
2707
+ I,
2708
+ {
2709
+ onClick: m,
2710
+ className: "flex items-center gap-2",
2711
+ disabled: !i,
2712
+ children: [
2713
+ /* @__PURE__ */ n.jsx(In, { className: "h-4 w-4" }),
2714
+ "Download ",
2715
+ o || "file",
2716
+ " (",
2717
+ Kt(a),
2718
+ ")"
2719
+ ]
2720
+ }
2721
+ )
2722
+ ] }) }) : /* @__PURE__ */ n.jsx("div", { className: "overflow-auto max-w-full p-4 text-xs max-h-[calc(83.333vh-180px)]", children: /* @__PURE__ */ n.jsx(
2723
+ en,
2724
+ {
2725
+ language: d === "types" ? "typescript" : d === "raw" ? c ? "plain" : l : "json",
2726
+ code: (d === "raw" ? e : d === "types" ? f.data?.lines.join(`
2727
+ `) : u) ?? ""
2728
+ }
2729
+ ) }) })
2730
+ ] });
2731
+ }, ia = ({
2732
+ queryMutation: e,
2733
+ showLongRunningWarning: t,
2734
+ onCancel: s,
2735
+ tip: a,
2736
+ isFinished: r,
2737
+ progress: o
2738
+ }) => /* @__PURE__ */ n.jsxs("div", { className: "overflow-y-auto h-[80vh] bg-muted/50", children: [
2739
+ (e.isPending || e.data) && /* @__PURE__ */ n.jsx(
2740
+ Kr,
2741
+ {
2742
+ status: e.data?.status,
2743
+ time: e.data?.time,
2744
+ size: e.data?.size,
2745
+ isFinished: r,
2746
+ progress: o
2747
+ }
2748
+ ),
2749
+ e.error ? /* @__PURE__ */ n.jsx("div", { className: "max-w-2/3 mx-auto mt-20", children: /* @__PURE__ */ n.jsxs(is, { children: [
2750
+ /* @__PURE__ */ n.jsx(En, { size: 24, strokeWidth: 1.5, className: "me-5" }),
2751
+ /* @__PURE__ */ n.jsx(cs, { children: "Request failed" }),
2752
+ /* @__PURE__ */ n.jsx(ls, { children: e.error.message || String(e.error) || "Unexpected error" })
2753
+ ] }) }) : e.data ? /* @__PURE__ */ n.jsx(
2754
+ oa,
2755
+ {
2756
+ request: e.data.request,
2757
+ size: e.data.size,
2758
+ headers: e.data.headers,
2759
+ body: e.data.body,
2760
+ isBinary: e.data.isBinary,
2761
+ fileName: e.data.fileName,
2762
+ blob: e.data.blob
2763
+ }
2764
+ ) : e.isPending ? /* @__PURE__ */ n.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-2 items-center mt-20", children: [
2765
+ /* @__PURE__ */ n.jsx(as, {}),
2766
+ /* @__PURE__ */ n.jsxs(
2767
+ "div",
2768
+ {
2769
+ className: v(
2770
+ "opacity-0 pointer-events-none transition-opacity h-20 text-sm text-muted-foreground duration-300 flex flex-col gap-2 items-center",
2771
+ t && "opacity-100 pointer-events-auto"
2772
+ ),
2773
+ children: [
2774
+ "Looks like the request is taking longer than expected.",
2775
+ /* @__PURE__ */ n.jsx(
2776
+ se,
2777
+ {
2778
+ type: "button",
2779
+ onClick: s,
2780
+ size: "sm",
2781
+ className: "w-fit",
2782
+ variant: "outline",
2783
+ children: "Cancel"
2784
+ }
2785
+ )
2786
+ ]
2787
+ }
2788
+ )
2789
+ ] }) }) : /* @__PURE__ */ n.jsx("div", { className: "h-full grid place-items-center", children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-4 items-center", children: [
2790
+ /* @__PURE__ */ n.jsx(
2791
+ kn,
2792
+ {
2793
+ size: 64,
2794
+ className: "text-muted-foreground",
2795
+ strokeWidth: 1.2
2796
+ }
2797
+ ),
2798
+ /* @__PURE__ */ n.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: "Send your first request" }),
2799
+ a
2800
+ ] }) })
2801
+ ] }), ca = $e()(
2802
+ Ie(
2803
+ (e) => ({
2804
+ skipLogin: !1,
2805
+ setSkipLogin: (t) => e({ skipLogin: t })
2806
+ }),
2807
+ {
2808
+ name: "remember-skip-login",
2809
+ storage: bt(() => sessionStorage)
2810
+ }
2811
+ )
2812
+ ), ne = "__none", la = ({
2813
+ server: e,
2814
+ servers: t = [],
2815
+ url: s,
2816
+ method: a,
2817
+ headers: r = [],
2818
+ queryParams: o = [],
2819
+ pathParams: i = [],
2820
+ defaultBody: l = "",
2821
+ examples: c,
2822
+ requiresLogin: u = !1,
2823
+ onLogin: d,
2824
+ onSignUp: p
2825
+ }) => {
2826
+ const { selectedServer: f, setSelectedServer: m } = Cr(
2827
+ t.map((h) => ({ url: h }))
2828
+ ), [x, y] = k(!1), b = Jn(), { setRememberedIdentity: R, getRememberedIdentity: j } = Hr(), [, N] = ts(), { skipLogin: Q, setSkipLogin: O } = ca(), [D, P] = k(!1), J = L(void 0), He = fs(R), Qe = L(null), { label: on } = Nr("meta+enter", () => {
2829
+ Qe.current?.requestSubmit();
2830
+ }), { register: cn, control: ce, handleSubmit: Je, watch: We, setValue: ve, ...be } = us({
2831
+ defaultValues: {
2832
+ body: l,
2833
+ queryParams: o.length > 0 ? o.map((h) => ({
2834
+ name: h.name,
2835
+ value: h.defaultValue ?? "",
2836
+ active: h.defaultActive ?? !1,
2837
+ enum: h.enum ?? []
2838
+ })) : [
2839
+ {
2840
+ name: "",
2841
+ value: "",
2842
+ active: !1,
2843
+ enum: []
2844
+ }
2845
+ ],
2846
+ pathParams: i.map((h) => ({
2847
+ name: h.name,
2848
+ value: h.defaultValue ?? ""
2849
+ })),
2850
+ headers: r.length > 0 ? r.map((h) => ({
2851
+ name: h.name,
2852
+ value: h.defaultValue ?? "",
2853
+ active: h.defaultActive ?? !1
2854
+ })) : [
2855
+ {
2856
+ name: "",
2857
+ value: "",
2858
+ active: !1
2859
+ }
2860
+ ],
2861
+ identity: j([
2862
+ ne,
2863
+ ...b.data?.map((h) => h.id) ?? []
2864
+ ])
2865
+ }
2866
+ }), W = We("identity"), ln = Nt(
2867
+ () => b.data?.find((h) => h.id === W)?.authorizationFields,
2868
+ [b.data, W]
2869
+ );
2870
+ z(() => {
2871
+ W && He.current(W);
2872
+ }, [He, W]);
2873
+ const B = ds({
2874
+ gcTime: 0,
2875
+ mutationFn: async (h) => {
2876
+ const le = performance.now(), yn = Object.fromEntries([
2877
+ ...h.headers.filter((A) => A.name && A.active).map((A) => [A.name, A.value])
2878
+ ]), _ = new Request(
2879
+ mt(e ?? f, s, h),
2880
+ {
2881
+ method: a.toUpperCase(),
2882
+ headers: yn,
2883
+ body: h.body ? h.body : void 0
2884
+ }
2885
+ );
2886
+ h.identity !== ne && await b.data?.find((A) => A.id === h.identity)?.authorizeRequest(_);
2887
+ const je = setTimeout(
2888
+ () => P(!0),
2889
+ 3210
2890
+ );
2891
+ J.current = new AbortController(), J.current.signal.addEventListener("abort", () => {
2892
+ clearTimeout(je);
2893
+ });
2894
+ try {
2895
+ const A = await fetch(_, {
2896
+ cache: "no-store",
2897
+ signal: J.current.signal
2898
+ });
2899
+ clearTimeout(je), P(!1);
2900
+ const vn = performance.now() - le, bn = new URL(_.url), Ye = Array.from(A.headers.entries()), Ke = A.headers.get("content-type") || "", et = Er(Ke);
2901
+ let de = "", tt, nt;
2902
+ et ? (tt = await A.blob(), nt = kr(Ye, _.url), de = `Binary content (${Ke})`) : de = await A.text();
2903
+ const st = A.headers.get("content-length");
2904
+ return {
2905
+ status: A.status,
2906
+ headers: Ye,
2907
+ size: st ? parseInt(st) : de.length,
2908
+ body: de,
2909
+ time: vn,
2910
+ isBinary: et,
2911
+ fileName: nt,
2912
+ blob: tt,
2913
+ request: {
2914
+ method: _.method.toUpperCase(),
2915
+ url: _.url,
2916
+ headers: [
2917
+ ["Host", bn.host],
2918
+ ["User-Agent", "Zudoku Playground"],
2919
+ ...Array.from(_.headers.entries())
2920
+ ],
2921
+ body: h.body ? h.body : void 0
2922
+ }
2923
+ };
2924
+ } catch (A) {
2925
+ throw clearTimeout(je), P(!1), A instanceof TypeError ? new Error(
2926
+ "The request failed, possibly due to network issues or CORS policy."
2927
+ ) : A;
2928
+ }
2929
+ }
2930
+ }), Xe = B.isPending, [dn, un] = k(!1);
2931
+ z(() => {
2932
+ const h = setTimeout(() => un(Xe), 100);
2933
+ return () => clearTimeout(h);
2934
+ }, [Xe]);
2935
+ const { isFinished: mn, progress: pn } = os({ isAnimating: dn });
2936
+ z(() => () => {
2937
+ J.current?.abort();
2938
+ }, []);
2939
+ const hn = /* @__PURE__ */ n.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: e ? /* @__PURE__ */ n.jsx("span", { children: e.replace(/^https?:\/\//, "").replace(/\/$/, "") }) : t.length > 1 && /* @__PURE__ */ n.jsxs(
2940
+ qt,
2941
+ {
2942
+ onValueChange: (h) => {
2943
+ N(() => m(h));
2944
+ },
2945
+ value: f,
2946
+ defaultValue: f,
2947
+ children: [
2948
+ /* @__PURE__ */ n.jsx(Ve, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto translate-y-[4px]", children: /* @__PURE__ */ n.jsx(Vt, {}) }),
2949
+ /* @__PURE__ */ n.jsx(Be, { children: t.map((h) => /* @__PURE__ */ n.jsx(te, { value: h, children: h.replace(/^https?:\/\//, "").replace(/\/$/, "") }, h)) })
2950
+ ]
2951
+ }
2952
+ ) }), fn = u && !Q, xn = ["POST", "PUT", "PATCH", "DELETE"].includes(
2953
+ a.toUpperCase()
2954
+ ), [Ze, gn] = hs();
2955
+ return /* @__PURE__ */ n.jsx(
2956
+ ms,
2957
+ {
2958
+ register: cn,
2959
+ control: ce,
2960
+ handleSubmit: Je,
2961
+ watch: We,
2962
+ setValue: ve,
2963
+ ...be,
2964
+ children: /* @__PURE__ */ n.jsx(ps, { delayDuration: 150, children: /* @__PURE__ */ n.jsxs(
2965
+ "form",
2966
+ {
2967
+ ref: Qe,
2968
+ onSubmit: Je((h) => {
2969
+ b.data?.length === 0 || h.identity ? B.mutate(h) : y(!0);
2970
+ }),
2971
+ className: "relative",
2972
+ children: [
2973
+ /* @__PURE__ */ n.jsx(
2974
+ Br,
2975
+ {
2976
+ identities: b.data ?? [],
2977
+ open: x,
2978
+ onOpenChange: y,
2979
+ onSubmit: ({ rememberedIdentity: h, identity: le }) => {
2980
+ h && ve("identity", le ?? ne), y(!1), B.mutate({ ...be.getValues(), identity: le });
2981
+ }
2982
+ }
2983
+ ),
2984
+ /* @__PURE__ */ n.jsx(
2985
+ Xr,
2986
+ {
2987
+ open: fn,
2988
+ setOpen: (h) => O(!h),
2989
+ onSignUp: p,
2990
+ onLogin: d
2991
+ }
2992
+ ),
2993
+ /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-[1fr_1px_1fr] text-sm", children: [
2994
+ /* @__PURE__ */ n.jsxs("div", { className: "col-span-3 p-4 border-b flex gap-2 items-stretch", children: [
2995
+ /* @__PURE__ */ n.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md relative overflow-hidden", children: [
2996
+ /* @__PURE__ */ n.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono flex items-center", children: a.toUpperCase() }),
2997
+ /* @__PURE__ */ n.jsx("div", { className: "items-center px-2 font-mono text-xs break-all leading-6 relative h-full w-full", children: /* @__PURE__ */ n.jsxs("div", { className: "h-full py-1.5", children: [
2998
+ hn,
2999
+ /* @__PURE__ */ n.jsx(Jr, { url: s }),
3000
+ /* @__PURE__ */ n.jsx(Wr, {})
3001
+ ] }) }),
3002
+ /* @__PURE__ */ n.jsx("div", { className: "px-1", children: /* @__PURE__ */ n.jsx(
3003
+ I,
3004
+ {
3005
+ type: "button",
3006
+ onClick: () => {
3007
+ gn(
3008
+ mt(
3009
+ e ?? f,
3010
+ s,
3011
+ be.getValues()
3012
+ ).toString()
3013
+ );
3014
+ },
3015
+ variant: "ghost",
3016
+ size: "icon-xs",
3017
+ className: v(
3018
+ "hover:opacity-100 transition",
3019
+ Ze ? "text-emerald-600 opacity-100" : "opacity-50"
3020
+ ),
3021
+ children: Ze ? /* @__PURE__ */ n.jsx(yt, { className: "text-green-500", size: 14 }) : /* @__PURE__ */ n.jsx(Dn, { size: 14 })
3022
+ }
3023
+ ) })
3024
+ ] }),
3025
+ /* @__PURE__ */ n.jsx(
3026
+ I,
3027
+ {
3028
+ type: "submit",
3029
+ variant: B.isPending ? "destructive" : "default",
3030
+ onClick: (h) => {
3031
+ B.isPending && (J.current?.abort(
3032
+ "Request cancelled by user"
3033
+ ), h.preventDefault());
3034
+ },
3035
+ className: "w-18",
3036
+ children: B.isPending ? "Cancel" : "Send"
3037
+ }
3038
+ )
3039
+ ] }),
3040
+ /* @__PURE__ */ n.jsxs("div", { className: "relative overflow-y-auto h-[80vh]", children: [
3041
+ b.data?.length !== 0 && /* @__PURE__ */ n.jsxs(q, { defaultOpen: !0, children: [
3042
+ /* @__PURE__ */ n.jsxs(M, { children: [
3043
+ /* @__PURE__ */ n.jsx(zn, { size: 16 }),
3044
+ /* @__PURE__ */ n.jsx(G, { className: "col-span-2", children: "Authentication" })
3045
+ ] }),
3046
+ /* @__PURE__ */ n.jsx(V, { className: "CollapsibleContent", children: /* @__PURE__ */ n.jsx(
3047
+ Zt,
3048
+ {
3049
+ value: W,
3050
+ identities: b.data ?? [],
3051
+ setValue: (h) => ve("identity", h)
3052
+ }
3053
+ ) })
3054
+ ] }),
3055
+ i.length > 0 && /* @__PURE__ */ n.jsxs(q, { defaultOpen: !0, children: [
3056
+ /* @__PURE__ */ n.jsxs(M, { children: [
3057
+ /* @__PURE__ */ n.jsx(Fn, { size: 16 }),
3058
+ /* @__PURE__ */ n.jsx(G, { className: "col-span-2", children: "Path Parameters" })
3059
+ ] }),
3060
+ /* @__PURE__ */ n.jsx(V, { className: "CollapsibleContent", children: /* @__PURE__ */ n.jsx(Ur, { url: s, control: ce }) })
3061
+ ] }),
3062
+ /* @__PURE__ */ n.jsx(Gr, { control: ce, schemaQueryParams: o }),
3063
+ /* @__PURE__ */ n.jsx(
3064
+ qr,
3065
+ {
3066
+ control: ce,
3067
+ schemaHeaders: r,
3068
+ lockedHeaders: ln?.headers
3069
+ }
3070
+ ),
3071
+ xn && /* @__PURE__ */ n.jsx(Ir, { content: c })
3072
+ ] }),
3073
+ /* @__PURE__ */ n.jsx("div", { className: "w-full bg-muted-foreground/20" }),
3074
+ /* @__PURE__ */ n.jsx(
3075
+ ia,
3076
+ {
3077
+ queryMutation: B,
3078
+ showLongRunningWarning: D,
3079
+ isFinished: mn,
3080
+ progress: pn,
3081
+ tip: /* @__PURE__ */ n.jsx("div", { className: "text-xs w-full", children: /* @__PURE__ */ n.jsxs("span", { className: "text-muted-foreground", children: [
3082
+ "Press",
3083
+ " ",
3084
+ /* @__PURE__ */ n.jsx("kbd", { className: "text-foreground border rounded m-0.5 px-1 py-0.5 capitalize", children: on.join(" + ") }),
3085
+ " ",
3086
+ "to send a request"
3087
+ ] }) }),
3088
+ onCancel: () => {
3089
+ J.current?.abort(
3090
+ "Request cancelled by the user"
3091
+ ), P(!1);
3092
+ }
3093
+ }
3094
+ )
3095
+ ] })
3096
+ ]
3097
+ }
3098
+ ) })
3099
+ }
3100
+ );
3101
+ }, da = ({
3102
+ className: e,
3103
+ size: t = 16
3104
+ }) => /* @__PURE__ */ n.jsx(
3105
+ "svg",
3106
+ {
3107
+ xmlns: "http://www.w3.org/2000/svg",
3108
+ viewBox: "0 0 24 24",
3109
+ fill: "currentColor",
3110
+ className: e,
3111
+ width: t,
3112
+ height: t,
3113
+ children: /* @__PURE__ */ n.jsx(
3114
+ "path",
3115
+ {
3116
+ fillRule: "evenodd",
3117
+ d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm14.024-.983a1.125 1.125 0 0 1 0 1.966l-5.603 3.113A1.125 1.125 0 0 1 9 15.113V8.887c0-.857.921-1.4 1.671-.983l5.603 3.113Z",
3118
+ clipRule: "evenodd"
3119
+ }
3120
+ )
3121
+ }
3122
+ ), ua = (e) => {
3123
+ const [t, s] = k(!1);
3124
+ return /* @__PURE__ */ n.jsxs(Ee, { onOpenChange: (a) => s(a), children: [
3125
+ /* @__PURE__ */ n.jsx(rs, { asChild: !0, children: e.children ?? /* @__PURE__ */ n.jsxs(
3126
+ "button",
3127
+ {
3128
+ type: "button",
3129
+ className: "flex gap-1 items-center px-2 py-1 rounded-md transition text-xs bg-primary text-primary-foreground shadow-xs hover:bg-primary/80",
3130
+ children: [
3131
+ "Test",
3132
+ /* @__PURE__ */ n.jsx(da, { size: 14 })
3133
+ ]
3134
+ }
3135
+ ) }),
3136
+ /* @__PURE__ */ n.jsxs(
3137
+ ke,
3138
+ {
3139
+ className: "max-w-screen-xl w-full overflow-hidden p-0",
3140
+ "aria-describedby": void 0,
3141
+ showCloseButton: !0,
3142
+ children: [
3143
+ /* @__PURE__ */ n.jsx(ss, { children: /* @__PURE__ */ n.jsx(De, { children: "Playground" }) }),
3144
+ t && /* @__PURE__ */ n.jsx(la, { ...e })
3145
+ ]
3146
+ }
3147
+ )
3148
+ ] });
3149
+ }, ma = {
3150
+ get: "green",
3151
+ post: "blue",
3152
+ put: "yellow",
3153
+ delete: "red",
3154
+ patch: "purple",
3155
+ options: "gray",
3156
+ head: "gray"
3157
+ }, ht = ({
3158
+ label: e,
3159
+ path: t,
3160
+ operations: s,
3161
+ collapsible: a,
3162
+ collapsed: r
3163
+ }) => ({
3164
+ type: "category",
3165
+ label: e,
3166
+ link: {
3167
+ type: "doc",
3168
+ path: t,
3169
+ file: t,
3170
+ label: e
3171
+ },
3172
+ collapsible: a,
3173
+ collapsed: r,
3174
+ items: s.map((o) => ({
3175
+ type: "link",
3176
+ label: o.summary ?? o.path,
3177
+ to: `${t}#${o.slug}`,
3178
+ badge: {
3179
+ label: o.method,
3180
+ color: ma[o.method.toLowerCase()],
3181
+ invert: !0
3182
+ }
3183
+ }))
3184
+ }), tn = jt(
3185
+ void 0
3186
+ ), Qa = tn.Provider, pa = () => {
3187
+ const e = ns(tn);
3188
+ if (!e)
3189
+ throw new Error("useOasConfig must be used within a OasConfigProvider");
3190
+ return e.config;
3191
+ }, ft = (e) => ({
3192
+ path: e.routePath,
3193
+ async lazy() {
3194
+ const { OasProvider: t } = await import("./OasProvider-CDAM3TB1.js");
3195
+ return {
3196
+ element: /* @__PURE__ */ n.jsx(
3197
+ t,
3198
+ {
3199
+ basePath: e.basePath,
3200
+ version: e.version,
3201
+ client: e.client,
3202
+ config: e.config
3203
+ }
3204
+ )
3205
+ };
3206
+ },
3207
+ children: e.routes
3208
+ }), nn = ({
3209
+ path: e,
3210
+ tag: t,
3211
+ untagged: s
3212
+ }) => ({
3213
+ path: e,
3214
+ async lazy() {
3215
+ const { OperationList: a } = await import("./OperationList-C9Hb9ql8.js");
3216
+ return { element: /* @__PURE__ */ n.jsx(a, { tag: t, untagged: s }) };
3217
+ }
3218
+ }), ha = ({
3219
+ render: e,
3220
+ path: t
3221
+ }) => {
3222
+ const { type: s, input: a } = pa(), { tag: r } = _n(), o = Un(), i = ir(an, { type: s, input: a }), {
3223
+ data: { schema: l }
3224
+ } = Wn(i), c = l.tags.at(0);
3225
+ return !r && c?.slug ? /* @__PURE__ */ n.jsx(
3226
+ Mn,
3227
+ {
3228
+ to: {
3229
+ pathname: Gn(t, { tag: c.slug }),
3230
+ search: o.search
3231
+ }
3232
+ }
3233
+ ) : r && l.tags.some((u) => u.slug === r) ? e(r) : null;
3234
+ }, fa = ({ path: e }) => ({
3235
+ path: e,
3236
+ async lazy() {
3237
+ const { OperationList: t } = await import("./OperationList-C9Hb9ql8.js");
3238
+ return {
3239
+ element: /* @__PURE__ */ n.jsx(
3240
+ ha,
3241
+ {
3242
+ path: e,
3243
+ render: (s) => /* @__PURE__ */ n.jsx(t, { tag: s })
3244
+ }
3245
+ )
3246
+ };
3247
+ }
3248
+ }), sn = (e) => [
3249
+ // Category without tagged operations
3250
+ nn({
3251
+ path: E(e, Ge),
3252
+ untagged: !0
3253
+ }),
3254
+ // Schema list route
3255
+ {
3256
+ path: E(e, "~schemas"),
3257
+ lazy: async () => {
3258
+ const { SchemaList: t } = await import("./SchemaList-BAbh1BXO.js");
3259
+ return { element: /* @__PURE__ */ n.jsx(t, {}) };
3260
+ }
3261
+ }
3262
+ ], xa = (e, t) => {
3263
+ const s = E(e, t.at(0) ?? Ge);
3264
+ return [
3265
+ // Redirect to first tag on the index route
3266
+ { index: !0, loader: () => Bn(s) },
3267
+ // Create routes for each tag
3268
+ ...t.map(
3269
+ (a) => nn({
3270
+ path: E(e, a),
3271
+ tag: a
3272
+ })
3273
+ ),
3274
+ ...sn(e)
3275
+ ];
3276
+ }, rn = (e) => e.type === "file" ? Object.keys(e.input) : [], ga = ({
3277
+ basePath: e,
3278
+ config: t,
3279
+ client: s
3280
+ }) => {
3281
+ const a = t.tagPages;
3282
+ if (!a)
3283
+ return [
3284
+ ft({
3285
+ basePath: e,
3286
+ routePath: e,
3287
+ routes: [
3288
+ fa({ path: e + "/:tag?" }),
3289
+ ...sn(e)
3290
+ ],
3291
+ client: s,
3292
+ config: t
3293
+ })
3294
+ ];
3295
+ const r = rn(t);
3296
+ return (r.length > 1 ? [void 0, ...r] : [void 0]).map((i) => {
3297
+ const l = E(e, i);
3298
+ return ft({
3299
+ basePath: e,
3300
+ version: i,
3301
+ routePath: l,
3302
+ routes: xa(l, a),
3303
+ client: s,
3304
+ config: t
3305
+ });
3306
+ });
3307
+ }, an = xr(`
3308
+ query GetNavigationOperations($input: JSON!, $type: SchemaType!) {
3309
+ schema(input: $input, type: $type) {
3310
+ tags {
3311
+ slug
3312
+ name
3313
+ extensions
3314
+ operations {
3315
+ summary
3316
+ slug
3317
+ method
3318
+ operationId
3319
+ path
3320
+ }
3321
+ }
3322
+ components {
3323
+ schemas {
3324
+ __typename
3325
+ }
3326
+ }
3327
+ }
3328
+ }
3329
+ `), Ge = "~endpoints", Ja = (e) => {
3330
+ const t = E(e.path), s = new Os(e);
3331
+ return {
3332
+ getHead: () => {
3333
+ if (e.type === "url" && !e.skipPreload)
3334
+ return /* @__PURE__ */ n.jsx(
3335
+ "link",
3336
+ {
3337
+ rel: "preload",
3338
+ href: e.input,
3339
+ as: "fetch",
3340
+ crossOrigin: "anonymous"
3341
+ }
3342
+ );
3343
+ if (e.server)
3344
+ return /* @__PURE__ */ n.jsx("link", { rel: "preconnect", href: e.server });
3345
+ },
3346
+ getMdxComponents: () => ({
3347
+ OpenPlaygroundButton: ({
3348
+ requireAuth: a,
3349
+ server: r,
3350
+ method: o,
3351
+ url: i,
3352
+ children: l,
3353
+ ...c
3354
+ }) => {
3355
+ const u = Xn();
3356
+ if (!r)
3357
+ throw new Error("Server is required");
3358
+ return a && !u.isAuthenticated ? /* @__PURE__ */ n.jsxs(
3359
+ se,
3360
+ {
3361
+ className: "gap-2 items-center",
3362
+ variant: "outline",
3363
+ onClick: u.login,
3364
+ children: [
3365
+ "Login to open in Playground ",
3366
+ /* @__PURE__ */ n.jsx(qn, { size: 16 })
3367
+ ]
3368
+ }
3369
+ ) : /* @__PURE__ */ n.jsx(
3370
+ ua,
3371
+ {
3372
+ url: i ?? "/",
3373
+ method: o ?? "get",
3374
+ server: r,
3375
+ ...c,
3376
+ children: /* @__PURE__ */ n.jsx(se, { className: "gap-2 items-center", variant: "outline", children: l ?? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
3377
+ "Open in Playground ",
3378
+ /* @__PURE__ */ n.jsx(Vn, { size: 16 })
3379
+ ] }) })
3380
+ }
3381
+ );
3382
+ }
3383
+ }),
3384
+ getNavigation: async (a, r) => {
3385
+ if (!rt({ path: t, end: !1 }, a))
3386
+ return [];
3387
+ const o = rt(
3388
+ { path: `${t}/:version?/:tag`, end: !0 },
3389
+ a
3390
+ );
3391
+ try {
3392
+ const i = o?.params.version, l = i ?? rn(e).at(0), { type: c } = e, u = c === "file" ? e.input[l] : e.input, d = zt(s, an, {
3393
+ type: c,
3394
+ input: u
3395
+ }), p = await r.queryClient.ensureQueryData(d), f = p.schema.tags.flatMap((x) => {
3396
+ if (!x.name || x.operations.length === 0) return [];
3397
+ const y = E(t, i, x.slug), b = x.extensions?.["x-zudoku-collapsed"] ?? !e.options?.expandAllTags, R = x.extensions?.["x-zudoku-collapsible"] ?? !0;
3398
+ return ht({
3399
+ label: x.name,
3400
+ path: y,
3401
+ operations: x.operations,
3402
+ collapsed: b,
3403
+ collapsible: R
3404
+ });
3405
+ }), m = p.schema.tags.find(
3406
+ (x) => !x.name
3407
+ )?.operations;
3408
+ return m && f.push(
3409
+ ht({
3410
+ label: "Other endpoints",
3411
+ path: E(t, i, Ge),
3412
+ operations: m,
3413
+ collapsed: !e.options?.expandAllTags
3414
+ })
3415
+ ), p.schema.components?.schemas?.length && f.push({
3416
+ type: "link",
3417
+ label: "Schemas",
3418
+ to: E(t, i, "~schemas")
3419
+ }), f;
3420
+ } catch {
3421
+ return [];
3422
+ }
3423
+ },
3424
+ getRoutes: () => ga({ basePath: t, config: e, client: s })
3425
+ };
3426
+ };
3427
+ export {
3428
+ qs as A,
3429
+ Ds as B,
3430
+ q as C,
3431
+ Pt as D,
3432
+ an as E,
3433
+ Ja as F,
3434
+ Ha as G,
3435
+ Vs as L,
3436
+ Qa as O,
3437
+ ua as P,
3438
+ Es as Q,
3439
+ qt as S,
3440
+ g as T,
3441
+ Ge as U,
3442
+ ir as a,
3443
+ Ft as b,
3444
+ V as c,
3445
+ rn as d,
3446
+ Cr as e,
3447
+ Yt as f,
3448
+ xr as g,
3449
+ Qr as h,
3450
+ Ve as i,
3451
+ Vt as j,
3452
+ Be as k,
3453
+ te as l,
3454
+ ar as m,
3455
+ kt as n,
3456
+ dt as o,
3457
+ Ma as p,
3458
+ Bs as q,
3459
+ qe as r,
3460
+ $ as s,
3461
+ Et as t,
3462
+ pa as u,
3463
+ Rs as v,
3464
+ rr as w,
3465
+ we as x,
3466
+ Ps as y,
3467
+ Ga as z
3468
+ };
3469
+ //# sourceMappingURL=index-B6Re5_cx.js.map