zudoku 0.33.1 → 0.34.0

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 (244) hide show
  1. package/dist/config/validators/common.d.ts +572 -354
  2. package/dist/config/validators/common.js +26 -8
  3. package/dist/config/validators/common.js.map +1 -1
  4. package/dist/config/validators/validate.d.ts +254 -167
  5. package/dist/lib/authentication/hook.d.ts +1 -0
  6. package/dist/lib/authentication/hook.js +11 -1
  7. package/dist/lib/authentication/hook.js.map +1 -1
  8. package/dist/lib/authentication/providers/clerk.js +6 -6
  9. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  10. package/dist/lib/components/AnchorLink.d.ts +2 -2
  11. package/dist/lib/components/AnchorLink.js +4 -4
  12. package/dist/lib/components/AnchorLink.js.map +1 -1
  13. package/dist/lib/components/Banner.js +1 -1
  14. package/dist/lib/components/Banner.js.map +1 -1
  15. package/dist/lib/components/Heading.d.ts +2 -2
  16. package/dist/lib/components/Layout.js +1 -1
  17. package/dist/lib/components/Layout.js.map +1 -1
  18. package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
  19. package/dist/lib/components/index.d.ts +1 -0
  20. package/dist/lib/components/navigation/SidebarItem.js +6 -5
  21. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  22. package/dist/lib/core/RouteGuard.js +2 -1
  23. package/dist/lib/core/RouteGuard.js.map +1 -1
  24. package/dist/lib/core/ZudokuContext.d.ts +4 -0
  25. package/dist/lib/core/ZudokuContext.js.map +1 -1
  26. package/dist/lib/plugins/api-catalog/Catalog.d.ts +3 -1
  27. package/dist/lib/plugins/api-catalog/Catalog.js +7 -4
  28. package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
  29. package/dist/lib/plugins/api-catalog/index.js +1 -1
  30. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  31. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  32. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  33. package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
  34. package/dist/lib/plugins/openapi/OperationList.js +5 -1
  35. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  36. package/dist/lib/plugins/openapi/OperationListItem.d.ts +1 -1
  37. package/dist/lib/plugins/openapi/OperationListItem.js +6 -3
  38. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  39. package/dist/lib/plugins/openapi/ParameterList.d.ts +2 -1
  40. package/dist/lib/plugins/openapi/ParameterList.js +3 -2
  41. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  42. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -1
  43. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  44. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  45. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  46. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  47. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  48. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  49. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +1 -0
  50. package/dist/lib/plugins/openapi/graphql/graphql.js +2 -0
  51. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  52. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
  53. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
  54. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  55. package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
  56. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  57. package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
  58. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
  59. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
  60. package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
  61. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
  62. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
  63. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +3 -2
  64. package/dist/lib/plugins/openapi/playground/PathParams.js +3 -2
  65. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  66. package/dist/lib/plugins/openapi/playground/Playground.d.ts +13 -2
  67. package/dist/lib/plugins/openapi/playground/Playground.js +80 -26
  68. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  69. package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
  70. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  71. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
  72. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
  73. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
  74. package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
  75. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
  76. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
  77. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +19 -13
  78. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  79. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
  80. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
  81. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  82. package/dist/lib/plugins/search-pagefind/PagefindSearch.d.ts +6 -0
  83. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +66 -0
  84. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -0
  85. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +8 -0
  86. package/dist/lib/plugins/search-pagefind/ResultList.js +31 -0
  87. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -0
  88. package/dist/lib/plugins/search-pagefind/get-results.d.ts +3 -0
  89. package/dist/lib/plugins/search-pagefind/get-results.js +37 -0
  90. package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -0
  91. package/dist/lib/plugins/search-pagefind/index.d.ts +8 -0
  92. package/dist/lib/plugins/search-pagefind/index.js +9 -0
  93. package/dist/lib/plugins/search-pagefind/index.js.map +1 -0
  94. package/dist/lib/plugins/search-pagefind/types.d.ts +85 -0
  95. package/dist/lib/plugins/search-pagefind/types.js +2 -0
  96. package/dist/lib/plugins/search-pagefind/types.js.map +1 -0
  97. package/dist/lib/ui/Checkbox.d.ts +2 -8
  98. package/dist/lib/ui/Checkbox.js +1 -13
  99. package/dist/lib/ui/Checkbox.js.map +1 -1
  100. package/dist/lib/ui/Command.d.ts +13 -7
  101. package/dist/lib/ui/Command.js +2 -2
  102. package/dist/lib/ui/Command.js.map +1 -1
  103. package/dist/lib/ui/Select.js +1 -1
  104. package/dist/lib/ui/Select.js.map +1 -1
  105. package/dist/lib/ui/SyntaxHighlight.d.ts +2 -1
  106. package/dist/lib/ui/SyntaxHighlight.js +19 -15
  107. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  108. package/dist/lib/util/MdxComponents.d.ts +1 -1
  109. package/dist/lib/util/MdxComponents.js +2 -2
  110. package/dist/lib/util/MdxComponents.js.map +1 -1
  111. package/dist/lib/util/useScrollToAnchor.js +6 -8
  112. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  113. package/dist/vite/build.js +4 -0
  114. package/dist/vite/build.js.map +1 -1
  115. package/dist/vite/config.js +7 -2
  116. package/dist/vite/config.js.map +1 -1
  117. package/dist/vite/dev-server.js +8 -0
  118. package/dist/vite/dev-server.js.map +1 -1
  119. package/dist/vite/pagefind.d.ts +4 -0
  120. package/dist/vite/pagefind.js +15 -0
  121. package/dist/vite/pagefind.js.map +1 -0
  122. package/dist/vite/plugin-component.js +4 -0
  123. package/dist/vite/plugin-component.js.map +1 -1
  124. package/dist/vite/plugin-search.js +4 -0
  125. package/dist/vite/plugin-search.js.map +1 -1
  126. package/dist/vite/prerender/prerender.js +1 -1
  127. package/dist/vite/prerender/prerender.js.map +1 -1
  128. package/dist/vite/sitemap.js +2 -1
  129. package/dist/vite/sitemap.js.map +1 -1
  130. package/lib/{AuthenticationPlugin-CiO1FM6Q.js → AuthenticationPlugin-4ip08maU.js} +3 -3
  131. package/lib/{AuthenticationPlugin-CiO1FM6Q.js.map → AuthenticationPlugin-4ip08maU.js.map} +1 -1
  132. package/lib/Callout-B_sEhkYd.js +211 -0
  133. package/lib/Callout-B_sEhkYd.js.map +1 -0
  134. package/lib/{Dialog-DIKGQxQc.js → Dialog-sbgekbjb.js} +47 -32
  135. package/lib/{Dialog-DIKGQxQc.js.map → Dialog-sbgekbjb.js.map} +1 -1
  136. package/lib/{Markdown-DePfm7oQ.js → Markdown-DZXjQjpH.js} +4099 -3848
  137. package/lib/Markdown-DZXjQjpH.js.map +1 -0
  138. package/lib/MdxPage-52vRwa_7.js +200 -0
  139. package/lib/MdxPage-52vRwa_7.js.map +1 -0
  140. package/lib/{OasProvider-SzD9mHJc.js → OasProvider-CR2nG1Eg.js} +4 -4
  141. package/lib/{OasProvider-SzD9mHJc.js.map → OasProvider-CR2nG1Eg.js.map} +1 -1
  142. package/lib/{OperationList-DDs9NblY.js → OperationList-DndcCJUG.js} +2069 -1983
  143. package/lib/OperationList-DndcCJUG.js.map +1 -0
  144. package/lib/{Select-Dqtcn53H.js → Select-FAYHOYTy.js} +4 -4
  145. package/lib/{Select-Dqtcn53H.js.map → Select-FAYHOYTy.js.map} +1 -1
  146. package/lib/{SlotletProvider-DdtIOUi6.js → SlotletProvider-TydSHROc.js} +4 -4
  147. package/lib/{SlotletProvider-DdtIOUi6.js.map → SlotletProvider-TydSHROc.js.map} +1 -1
  148. package/lib/{chunk-IR6S3I6Y-D_3UmFIn.js → chunk-HA7DTUK3-ZGg2W6yV.js} +277 -277
  149. package/lib/chunk-HA7DTUK3-ZGg2W6yV.js.map +1 -0
  150. package/lib/hook-CfCFKZ-2.js +350 -0
  151. package/lib/hook-CfCFKZ-2.js.map +1 -0
  152. package/lib/index-DK7IuUyR.js +2201 -0
  153. package/lib/index-DK7IuUyR.js.map +1 -0
  154. package/lib/{index.esm-CQHE3GEU.js → index.esm-CltAN0Tf.js} +259 -239
  155. package/lib/index.esm-CltAN0Tf.js.map +1 -0
  156. package/lib/{mutation-EclmI0is.js → mutation-B81DztCT.js} +2 -2
  157. package/lib/{mutation-EclmI0is.js.map → mutation-B81DztCT.js.map} +1 -1
  158. package/lib/objectEntries-BS7aAgOm.js +12 -0
  159. package/lib/objectEntries-BS7aAgOm.js.map +1 -0
  160. package/lib/ui/Checkbox.js +15 -25
  161. package/lib/ui/Checkbox.js.map +1 -1
  162. package/lib/ui/Command.js +96 -70
  163. package/lib/ui/Command.js.map +1 -1
  164. package/lib/ui/Select.js +1 -1
  165. package/lib/ui/Select.js.map +1 -1
  166. package/lib/ui/SyntaxHighlight.js +483 -502
  167. package/lib/ui/SyntaxHighlight.js.map +1 -1
  168. package/lib/{useExposedProps-RIvey2Oy.js → useExposedProps-BslIn-FE.js} +2 -2
  169. package/lib/{useExposedProps-RIvey2Oy.js.map → useExposedProps-BslIn-FE.js.map} +1 -1
  170. package/lib/useQuery-CQUwWR9i.js +1137 -0
  171. package/lib/useQuery-CQUwWR9i.js.map +1 -0
  172. package/lib/zudoku.auth-auth0.js +1 -1
  173. package/lib/zudoku.auth-clerk.js +29 -29
  174. package/lib/zudoku.auth-clerk.js.map +1 -1
  175. package/lib/zudoku.auth-openid.js +3 -3
  176. package/lib/zudoku.components.js +146 -149
  177. package/lib/zudoku.components.js.map +1 -1
  178. package/lib/zudoku.hooks.js +1 -1
  179. package/lib/zudoku.plugin-api-catalog.js +87 -71
  180. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  181. package/lib/zudoku.plugin-api-keys.js +16 -15
  182. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  183. package/lib/zudoku.plugin-custom-pages.js +2 -2
  184. package/lib/zudoku.plugin-markdown.js +1 -1
  185. package/lib/zudoku.plugin-openapi.js +3 -3
  186. package/lib/zudoku.plugin-redirect.js +1 -1
  187. package/lib/zudoku.plugin-search-pagefind.js +204 -0
  188. package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
  189. package/package.json +10 -5
  190. package/src/lib/authentication/hook.ts +12 -1
  191. package/src/lib/authentication/providers/clerk.tsx +10 -6
  192. package/src/lib/components/AnchorLink.tsx +7 -7
  193. package/src/lib/components/Banner.tsx +1 -0
  194. package/src/lib/components/Heading.tsx +1 -1
  195. package/src/lib/components/Layout.tsx +1 -0
  196. package/src/lib/components/navigation/SidebarItem.tsx +8 -23
  197. package/src/lib/core/RouteGuard.tsx +2 -1
  198. package/src/lib/core/ZudokuContext.ts +4 -0
  199. package/src/lib/plugins/api-catalog/Catalog.tsx +23 -7
  200. package/src/lib/plugins/api-catalog/index.tsx +1 -0
  201. package/src/lib/plugins/markdown/MdxPage.tsx +5 -1
  202. package/src/lib/plugins/openapi/OperationList.tsx +83 -31
  203. package/src/lib/plugins/openapi/OperationListItem.tsx +107 -86
  204. package/src/lib/plugins/openapi/ParameterList.tsx +4 -0
  205. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -0
  206. package/src/lib/plugins/openapi/Sidecar.tsx +1 -0
  207. package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
  208. package/src/lib/plugins/openapi/graphql/graphql.ts +3 -0
  209. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
  210. package/src/lib/plugins/openapi/playground/Headers.tsx +0 -1
  211. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
  212. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
  213. package/src/lib/plugins/openapi/playground/PathParams.tsx +8 -2
  214. package/src/lib/plugins/openapi/playground/Playground.tsx +175 -88
  215. package/src/lib/plugins/openapi/playground/QueryParams.tsx +0 -1
  216. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
  217. package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
  218. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +24 -4
  219. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +66 -45
  220. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +135 -0
  221. package/src/lib/plugins/search-pagefind/ResultList.tsx +104 -0
  222. package/src/lib/plugins/search-pagefind/get-results.tsx +54 -0
  223. package/src/lib/plugins/search-pagefind/index.tsx +21 -0
  224. package/src/lib/plugins/search-pagefind/types.ts +118 -0
  225. package/src/lib/ui/Checkbox.tsx +8 -24
  226. package/src/lib/ui/Command.tsx +25 -3
  227. package/src/lib/ui/Select.tsx +1 -1
  228. package/src/lib/ui/SyntaxHighlight.tsx +94 -96
  229. package/src/lib/util/MdxComponents.tsx +2 -2
  230. package/src/lib/util/useScrollToAnchor.ts +8 -8
  231. package/lib/Markdown-DePfm7oQ.js.map +0 -1
  232. package/lib/MdxPage-DZTt9ld7.js +0 -193
  233. package/lib/MdxPage-DZTt9ld7.js.map +0 -1
  234. package/lib/OperationList-DDs9NblY.js.map +0 -1
  235. package/lib/chunk-IR6S3I6Y-D_3UmFIn.js.map +0 -1
  236. package/lib/hook-CN__aZIt.js +0 -1464
  237. package/lib/hook-CN__aZIt.js.map +0 -1
  238. package/lib/index-CibzSNks.js +0 -2100
  239. package/lib/index-CibzSNks.js.map +0 -1
  240. package/lib/index.esm-CQHE3GEU.js.map +0 -1
  241. package/lib/objectEntries-yMIkr2mI.js +0 -5
  242. package/lib/objectEntries-yMIkr2mI.js.map +0 -1
  243. package/lib/useScrollToAnchor-C7ilRSts.js +0 -290
  244. package/lib/useScrollToAnchor-C7ilRSts.js.map +0 -1
@@ -1,2100 +0,0 @@
1
- var yt = Object.defineProperty;
2
- var De = (t) => {
3
- throw TypeError(t);
4
- };
5
- var vt = (t, a, s) => a in t ? yt(t, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[a] = s;
6
- var ne = (t, a, s) => vt(t, typeof a != "symbol" ? a + "" : a, s), jt = (t, a, s) => a.has(t) || De("Cannot " + s);
7
- var re = (t, a, s) => (jt(t, a, "read from private field"), s ? s.call(t) : a.get(t)), oe = (t, a, s) => a.has(t) ? De("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, s);
8
- import { j as e } from "./jsx-runtime-CYK1ROHF.js";
9
- import { s as W } from "./index-LNp6rxyU.js";
10
- import { Circle as bt, ChevronRightIcon as B, CheckIcon as Nt, DotIcon as wt, Check as Ct, Search as Tt, XIcon as $t, ChevronDownIcon as St, InfoIcon as Le, LogInIcon as Pt, CirclePlayIcon as Rt } from "lucide-react";
11
- import { r as kt, m as Ve } from "./chunk-IR6S3I6Y-D_3UmFIn.js";
12
- import { m as It, o as Ot, p as Et, k as At } from "./hook-CN__aZIt.js";
13
- import { Button as K } from "./ui/Button.js";
14
- import { j as O } from "./joinUrl-10po2Jdj.js";
15
- import { Z as qt } from "./invariant-Caa8-XvF.js";
16
- import { VisuallyHidden as Dt } from "@radix-ui/react-visually-hidden";
17
- import * as x from "react";
18
- import { Fragment as k, useRef as q, useEffect as fe, useState as U, useCallback as Lt, useTransition as Vt } from "react";
19
- import { D as Ft, b as zt, a as Ht, c as Gt } from "./Dialog-DIKGQxQc.js";
20
- import { S as Qe, a as Ze, b as We, c as Ke, e as Q, u as Bt } from "./Select-Dqtcn53H.js";
21
- import { b as ge, u as ye, C as I, a as Ut, F as Mt } from "./index.esm--gIChbWs.js";
22
- import { c as ve } from "./index-CPNSgwSb.js";
23
- import { c as m } from "./cn-qaFjX9_3.js";
24
- import * as Xe from "@radix-ui/react-label";
25
- import * as M from "@radix-ui/react-radio-group";
26
- import { Card as je, CardHeader as _t, CardTitle as Jt, CardContent as Qt } from "./ui/Card.js";
27
- import { Tabs as Ye, TabsList as et, TabsTrigger as E, TabsContent as A } from "./ui/Tabs.js";
28
- import { z as Zt } from "./index-DwT-v3zK.js";
29
- import { B as Z, S as Wt } from "./Spinner-1KrEmx1V.js";
30
- import * as j from "@radix-ui/react-dropdown-menu";
31
- import * as me from "@radix-ui/react-checkbox";
32
- import * as X from "@radix-ui/react-popover";
33
- import { PopoverAnchor as Kt } from "@radix-ui/react-popover";
34
- import { V as $, T as Xt } from "./index-gQD2h1wX.js";
35
- import { Input as be } from "./ui/Input.js";
36
- import { Slot as Yt } from "@radix-ui/react-slot";
37
- import { Callout as ea } from "./ui/Callout.js";
38
- import { Collapsible as Fe, CollapsibleTrigger as ze, CollapsibleContent as He } from "./ui/Collapsible.js";
39
- import * as Ne from "@radix-ui/react-collapsible";
40
- import { SyntaxHighlight as ta } from "./ui/SyntaxHighlight.js";
41
- let ie;
42
- const aa = (t) => {
43
- var a;
44
- if ((a = t.errors) != null && a[0])
45
- throw new qt(t.errors[0].message, {
46
- developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
47
- });
48
- };
49
- var te, ae;
50
- class sa {
51
- constructor(a) {
52
- oe(this, te, async () => (ie || (ie = import("./createServer-DmusVVsi.js").then(
53
- (a) => a.createServer(this.config)
54
- )), ie));
55
- oe(this, ae, async (a) => this.config.server ? fetch(this.config.server, a) : (await re(this, te).call(this)).fetch("http://localhost/graphql", a));
56
- ne(this, "fetch", async (a, ...[s]) => {
57
- var l;
58
- const n = (l = a.match(/query (\w+)/)) == null ? void 0 : l[1], r = await re(this, ae).call(this, {
59
- method: "POST",
60
- body: JSON.stringify({ query: a, variables: s, operationName: n }),
61
- headers: { "Content-Type": "application/json" }
62
- });
63
- if (!r.ok)
64
- throw new Error("Network response was not ok");
65
- const i = await r.json();
66
- return aa(i), i.data;
67
- });
68
- this.config = a;
69
- }
70
- }
71
- te = new WeakMap(), ae = new WeakMap();
72
- class D extends String {
73
- constructor(s, n) {
74
- super(s);
75
- ne(this, "__apiType");
76
- this.value = s, this.__meta__ = n;
77
- }
78
- toString() {
79
- return this.value;
80
- }
81
- }
82
- const na = new D(
83
- `
84
- fragment OperationsFragment on OperationItem {
85
- slug
86
- summary
87
- method
88
- description
89
- operationId
90
- contentTypes
91
- path
92
- parameters {
93
- name
94
- in
95
- description
96
- required
97
- schema
98
- style
99
- examples {
100
- name
101
- description
102
- externalValue
103
- value
104
- summary
105
- }
106
- }
107
- requestBody {
108
- content {
109
- mediaType
110
- encoding {
111
- name
112
- }
113
- examples {
114
- name
115
- description
116
- externalValue
117
- value
118
- summary
119
- }
120
- schema
121
- }
122
- description
123
- required
124
- }
125
- responses {
126
- statusCode
127
- links
128
- description
129
- content {
130
- examples {
131
- name
132
- description
133
- externalValue
134
- value
135
- summary
136
- }
137
- mediaType
138
- encoding {
139
- name
140
- }
141
- schema
142
- }
143
- }
144
- }
145
- `,
146
- { fragmentName: "OperationsFragment" }
147
- ), ra = new D(`
148
- query ServersQuery($input: JSON!, $type: SchemaType!) {
149
- schema(input: $input, type: $type) {
150
- url
151
- servers {
152
- url
153
- }
154
- }
155
- }
156
- `), oa = new D(`
157
- query AllOperations($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
158
- schema(input: $input, type: $type) {
159
- servers {
160
- url
161
- }
162
- description
163
- summary
164
- title
165
- url
166
- version
167
- tags(name: $tag) {
168
- name
169
- description
170
- }
171
- operations(tag: $tag, untagged: $untagged) {
172
- slug
173
- ...OperationsFragment
174
- }
175
- }
176
- }
177
- fragment OperationsFragment on OperationItem {
178
- slug
179
- summary
180
- method
181
- description
182
- operationId
183
- contentTypes
184
- path
185
- parameters {
186
- name
187
- in
188
- description
189
- required
190
- schema
191
- style
192
- examples {
193
- name
194
- description
195
- externalValue
196
- value
197
- summary
198
- }
199
- }
200
- requestBody {
201
- content {
202
- mediaType
203
- encoding {
204
- name
205
- }
206
- examples {
207
- name
208
- description
209
- externalValue
210
- value
211
- summary
212
- }
213
- schema
214
- }
215
- description
216
- required
217
- }
218
- responses {
219
- statusCode
220
- links
221
- description
222
- content {
223
- examples {
224
- name
225
- description
226
- externalValue
227
- value
228
- summary
229
- }
230
- mediaType
231
- encoding {
232
- name
233
- }
234
- schema
235
- }
236
- }
237
- }`), ia = new D(`
238
- query getServerQuery($input: JSON!, $type: SchemaType!) {
239
- schema(input: $input, type: $type) {
240
- url
241
- servers {
242
- url
243
- }
244
- }
245
- }
246
- `), la = new D(`
247
- query GetCategories($input: JSON!, $type: SchemaType!) {
248
- schema(input: $input, type: $type) {
249
- url
250
- tags {
251
- name
252
- }
253
- }
254
- }
255
- `), da = new D(`
256
- query GetOperations($input: JSON!, $type: SchemaType!, $tag: String) {
257
- schema(input: $input, type: $type) {
258
- operations(tag: $tag) {
259
- slug
260
- deprecated
261
- method
262
- summary
263
- operationId
264
- path
265
- tags {
266
- name
267
- }
268
- }
269
- untagged: operations(untagged: true) {
270
- slug
271
- deprecated
272
- method
273
- summary
274
- operationId
275
- path
276
- }
277
- }
278
- }
279
- `), ca = {
280
- "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": ra,
281
- "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\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": na,
282
- "\n query AllOperations(\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 tags(name: $tag) {\n name\n description\n }\n operations(tag: $tag, untagged: $untagged) {\n slug\n ...OperationsFragment\n }\n }\n }\n": oa,
283
- "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": ia,
284
- "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n name\n }\n }\n }\n": la,
285
- "\n query GetOperations($input: JSON!, $type: SchemaType!, $tag: String) {\n schema(input: $input, type: $type) {\n operations(tag: $tag) {\n slug\n deprecated\n method\n summary\n operationId\n path\n tags {\n name\n }\n }\n untagged: operations(untagged: true) {\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n": da
286
- };
287
- function tt(t) {
288
- return ca[t] ?? {};
289
- }
290
- const ma = ve(
291
- "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
292
- {
293
- variants: {
294
- variant: {
295
- default: "bg-background text-foreground",
296
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
297
- }
298
- },
299
- defaultVariants: {
300
- variant: "default"
301
- }
302
- }
303
- ), ue = x.forwardRef(({ className: t, variant: a, ...s }, n) => /* @__PURE__ */ e.jsx(
304
- "div",
305
- {
306
- ref: n,
307
- role: "alert",
308
- className: m(ma({ variant: a }), t),
309
- ...s
310
- }
311
- ));
312
- ue.displayName = "Alert";
313
- const pe = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
314
- "h5",
315
- {
316
- ref: s,
317
- className: m("mb-1 font-medium leading-none tracking-tight", t),
318
- ...a
319
- }
320
- ));
321
- pe.displayName = "AlertTitle";
322
- const he = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
323
- "div",
324
- {
325
- ref: s,
326
- className: m("text-sm [&_p]:leading-relaxed", t),
327
- ...a
328
- }
329
- ));
330
- he.displayName = "AlertDescription";
331
- const ua = ({
332
- path: t,
333
- renderParam: a
334
- }) => {
335
- let s = 0;
336
- return t.split("/").map((n, r, i) => {
337
- const l = Array.from(n.matchAll(/{([^}]+)}/g)), c = [];
338
- let d = 0;
339
- return l.forEach((u) => {
340
- const [g, C] = u;
341
- if (!C) return;
342
- const b = u.index;
343
- b > d && c.push(
344
- /* @__PURE__ */ e.jsx(k, { children: n.slice(d, b) }, `text-${d}-${b}`)
345
- ), c.push(
346
- /* @__PURE__ */ e.jsx(k, { children: a({ name: C, originalValue: g, index: s++ }) }, `param-${C}`)
347
- ), d = b + g.length;
348
- }), d < n.length && c.push(
349
- /* @__PURE__ */ e.jsx(k, { children: n.slice(d) }, `text-${d}-${n.length}`)
350
- ), // eslint-disable-next-line react/no-array-index-key
351
- /* @__PURE__ */ e.jsxs(k, { children: [
352
- c,
353
- r < i.length - 1 && "/",
354
- /* @__PURE__ */ e.jsx("wbr", {})
355
- ] }, `${n}-${r}`);
356
- });
357
- }, pa = ve(
358
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
359
- ), z = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
360
- Xe.Root,
361
- {
362
- ref: s,
363
- className: m(pa(), t),
364
- ...a
365
- }
366
- ));
367
- z.displayName = Xe.Root.displayName;
368
- const we = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
369
- M.Root,
370
- {
371
- className: m("grid gap-2", t),
372
- ...a,
373
- ref: s
374
- }
375
- ));
376
- we.displayName = M.Root.displayName;
377
- const Y = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
378
- M.Item,
379
- {
380
- ref: s,
381
- className: m(
382
- "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
383
- t
384
- ),
385
- ...a,
386
- children: /* @__PURE__ */ e.jsx(M.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(bt, { className: "h-2.5 w-2.5 fill-current text-current" }) })
387
- }
388
- ));
389
- Y.displayName = M.Item.displayName;
390
- const at = x.forwardRef(
391
- ({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
392
- "textarea",
393
- {
394
- className: m(
395
- "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-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
396
- t
397
- ),
398
- ref: s,
399
- ...a
400
- }
401
- )
402
- );
403
- at.displayName = "Textarea";
404
- const le = (t) => Math.abs(
405
- isNaN(parseInt(t)) ? t.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(t)) ? 0 : parseInt(t)
406
- ), de = (t) => t.length > 1 ? parseInt(t.split("").reduce((a, s) => `${le(a) + le(s)}`)) : le(t), Ge = (t, a = {}) => {
407
- const s = (3 * de(t) + 2 * de(t) + de(t)) % 360, { saturation: n = 75, lightness: r = 60 } = a;
408
- return `${s}deg ${n}% ${r}%`;
409
- }, ce = "data-linked-param", ha = (t) => {
410
- const { resolvedTheme: a } = Zt();
411
- return {
412
- text: Ge(
413
- t,
414
- a === "light" ? { saturation: 95, lightness: 38 } : {}
415
- ),
416
- background: Ge(
417
- t,
418
- a === "light" ? { saturation: 85, lightness: 40 } : {}
419
- )
420
- };
421
- }, st = ({
422
- name: t,
423
- className: a,
424
- slug: s,
425
- title: n,
426
- children: r,
427
- onClick: i
428
- }) => {
429
- const l = q(null), c = s == null ? void 0 : s.replace(/[{}]/g, ""), d = t.replace(/[{}]/g, ""), { text: u, background: g } = ha(d), C = `hsl(${u} / 100%)`, b = `hsl(${g} / 10%)`, p = `hsl(${g} / 50%)`;
430
- return fe(() => {
431
- if (!c || !l.current) return;
432
- const f = () => {
433
- document.querySelectorAll(`[${ce}="${c}"]`).forEach((y) => {
434
- y instanceof HTMLElement && (y.dataset.active = "true");
435
- });
436
- }, h = () => {
437
- document.querySelectorAll(`[${ce}="${c}"]`).forEach((y) => {
438
- y instanceof HTMLElement && (y.dataset.active = "false");
439
- });
440
- }, v = l.current;
441
- return v.addEventListener("mouseenter", f), v.addEventListener("mouseleave", h), () => {
442
- v.removeEventListener("mouseenter", f), v.removeEventListener("mouseleave", h);
443
- };
444
- }, [c]), /* @__PURE__ */ e.jsx(
445
- "span",
446
- {
447
- [ce]: c,
448
- className: m(
449
- // This may not contain (inline-)flex or (inline-)block otherwise it breaks the browser's full text search
450
- "relative rounded transition-all duration-100 rounded-lg",
451
- "border border-[--border-color] p-0.5 text-[--param-color] bg-[--background-color]",
452
- "data-[active=true]:border-[--param-color] data-[active=true]:shadow data-[active=true]:bottom-px",
453
- a
454
- ),
455
- title: n,
456
- suppressHydrationWarning: !0,
457
- ref: l,
458
- onClick: i,
459
- style: {
460
- "--param-color": C,
461
- "--border-color": p,
462
- "--background-color": b
463
- },
464
- children: r ?? t
465
- }
466
- );
467
- }, xa = (t, a, s) => {
468
- const n = a.replace(/(:\w+|\{\w+})/g, (i) => {
469
- var d;
470
- const l = i.replace(/[:{}]/g, "");
471
- return ((d = s.pathParams.find((u) => u.name === l)) == null ? void 0 : d.value) ?? i;
472
- }), r = new URL(
473
- n.replace(/^\//, ""),
474
- t.endsWith("/") ? t : `${t}/`
475
- );
476
- return s.queryParams.filter((i) => i.active).forEach((i) => {
477
- r.searchParams.set(i.name, i.value);
478
- }), r;
479
- }, nt = j.Root, rt = j.Trigger, fa = j.Group, ga = x.forwardRef(({ className: t, inset: a, children: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
480
- j.SubTrigger,
481
- {
482
- ref: r,
483
- className: m(
484
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
485
- a && "pl-8",
486
- t
487
- ),
488
- ...n,
489
- children: [
490
- s,
491
- /* @__PURE__ */ e.jsx(B, { className: "ml-auto h-4 w-4" })
492
- ]
493
- }
494
- ));
495
- ga.displayName = j.SubTrigger.displayName;
496
- const ya = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
497
- j.SubContent,
498
- {
499
- ref: s,
500
- className: m(
501
- "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",
502
- t
503
- ),
504
- ...a
505
- }
506
- ));
507
- ya.displayName = j.SubContent.displayName;
508
- const Ce = x.forwardRef(({ className: t, sideOffset: a = 4, ...s }, n) => /* @__PURE__ */ e.jsx(j.Portal, { children: /* @__PURE__ */ e.jsx(
509
- j.Content,
510
- {
511
- ref: n,
512
- sideOffset: a,
513
- className: m(
514
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
515
- "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",
516
- t
517
- ),
518
- ...s
519
- }
520
- ) }));
521
- Ce.displayName = j.Content.displayName;
522
- const Te = x.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ e.jsx(
523
- j.Item,
524
- {
525
- ref: n,
526
- className: m(
527
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
528
- a && "pl-8",
529
- t
530
- ),
531
- ...s
532
- }
533
- ));
534
- Te.displayName = j.Item.displayName;
535
- const va = x.forwardRef(({ className: t, children: a, checked: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
536
- j.CheckboxItem,
537
- {
538
- ref: r,
539
- className: m(
540
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
541
- t
542
- ),
543
- checked: s,
544
- ...n,
545
- children: [
546
- /* @__PURE__ */ e.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e.jsx(j.ItemIndicator, { children: /* @__PURE__ */ e.jsx(Nt, { className: "h-4 w-4" }) }) }),
547
- a
548
- ]
549
- }
550
- ));
551
- va.displayName = j.CheckboxItem.displayName;
552
- const ja = x.forwardRef(({ className: t, children: a, ...s }, n) => /* @__PURE__ */ e.jsxs(
553
- j.RadioItem,
554
- {
555
- ref: n,
556
- className: m(
557
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
558
- t
559
- ),
560
- ...s,
561
- children: [
562
- /* @__PURE__ */ e.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e.jsx(j.ItemIndicator, { children: /* @__PURE__ */ e.jsx(wt, { className: "h-4 w-4 fill-current" }) }) }),
563
- a
564
- ]
565
- }
566
- ));
567
- ja.displayName = j.RadioItem.displayName;
568
- const ot = x.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ e.jsx(
569
- j.Label,
570
- {
571
- ref: n,
572
- className: m(
573
- "px-2 py-1.5 text-sm font-semibold",
574
- a && "pl-8",
575
- t
576
- ),
577
- ...s
578
- }
579
- ));
580
- ot.displayName = j.Label.displayName;
581
- const it = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
582
- j.Separator,
583
- {
584
- ref: s,
585
- className: m("-mx-1 my-1 h-px bg-muted", t),
586
- ...a
587
- }
588
- ));
589
- it.displayName = j.Separator.displayName;
590
- const ba = ({
591
- examples: t,
592
- onSelect: a
593
- }) => /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 mt-2 items-end", children: /* @__PURE__ */ e.jsxs(nt, { children: [
594
- /* @__PURE__ */ e.jsx(rt, { asChild: !0, children: /* @__PURE__ */ e.jsx(Z, { variant: "outline", children: "Use Example" }) }),
595
- /* @__PURE__ */ e.jsx(Ce, { className: "w-56", children: t.map((s) => {
596
- var n;
597
- return /* @__PURE__ */ e.jsxs("div", { children: [
598
- /* @__PURE__ */ e.jsx(ot, { children: s.mediaType }),
599
- /* @__PURE__ */ e.jsx(it, {}),
600
- /* @__PURE__ */ e.jsx(fa, { children: (n = s.examples) == null ? void 0 : n.map((r) => /* @__PURE__ */ e.jsx(
601
- Te,
602
- {
603
- onSelect: () => a(r),
604
- className: "line-clamp-1",
605
- children: r.summary ?? r.name
606
- },
607
- r.name
608
- )) })
609
- ] }, s.mediaType);
610
- }) })
611
- ] }) }), se = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
612
- "div",
613
- {
614
- ref: s,
615
- className: m(
616
- "rounded-xl border bg-card text-card-foreground shadow-sm",
617
- t
618
- ),
619
- ...a
620
- }
621
- ));
622
- se.displayName = "Card";
623
- const Na = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
624
- "div",
625
- {
626
- ref: s,
627
- className: m("flex flex-col space-y-1.5 p-6", t),
628
- ...a
629
- }
630
- ));
631
- Na.displayName = "CardHeader";
632
- const wa = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
633
- "h3",
634
- {
635
- ref: s,
636
- className: m("font-semibold leading-none tracking-tight", t),
637
- ...a
638
- }
639
- ));
640
- wa.displayName = "CardTitle";
641
- const Ca = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
642
- "p",
643
- {
644
- ref: s,
645
- className: m("text-sm text-muted-foreground", t),
646
- ...a
647
- }
648
- ));
649
- Ca.displayName = "CardDescription";
650
- const Ta = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx("div", { ref: s, className: m("p-6 pt-0", t), ...a }));
651
- Ta.displayName = "CardContent";
652
- const $a = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
653
- "div",
654
- {
655
- ref: s,
656
- className: m("flex items-center p-6 pt-0", t),
657
- ...a
658
- }
659
- ));
660
- $a.displayName = "CardFooter";
661
- const Sa = ve(
662
- "peer h-4 w-4 shrink-0 rounded-sm ring-offset-background focus-visible:outline-none 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",
663
- {
664
- variants: {
665
- variant: {
666
- default: "border border-primary data-[state=checked]:bg-primary",
667
- outline: "border border-input data-[state=checked]:bg-accent"
668
- }
669
- },
670
- defaultVariants: {
671
- variant: "default"
672
- }
673
- }
674
- ), $e = x.forwardRef(({ className: t, variant: a, ...s }, n) => /* @__PURE__ */ e.jsx(
675
- me.Root,
676
- {
677
- ref: n,
678
- className: m(Sa({ variant: a, className: t })),
679
- ...s,
680
- children: /* @__PURE__ */ e.jsx(
681
- me.Indicator,
682
- {
683
- className: m("flex items-center justify-center text-current"),
684
- children: /* @__PURE__ */ e.jsx(Ct, { className: "h-4 w-4" })
685
- }
686
- )
687
- }
688
- ));
689
- $e.displayName = me.Root.displayName;
690
- const lt = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
691
- $,
692
- {
693
- ref: s,
694
- className: m(
695
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
696
- t
697
- ),
698
- ...a
699
- }
700
- ));
701
- lt.displayName = $.displayName;
702
- const Pa = x.forwardRef(({ className: t, ...a }, s) => (
703
- // eslint-disable-next-line react/no-unknown-property
704
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
705
- /* @__PURE__ */ e.jsx(Tt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
706
- /* @__PURE__ */ e.jsx(
707
- $.Input,
708
- {
709
- ref: s,
710
- className: m(
711
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
712
- t
713
- ),
714
- ...a
715
- }
716
- )
717
- ] })
718
- ));
719
- Pa.displayName = $.Input.displayName;
720
- const dt = x.forwardRef(({ className: t, ...a }, s) => (
721
- // eslint-disable-next-line react/no-unknown-property
722
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center", "cmdk-input-wrapper": "", children: /* @__PURE__ */ e.jsx(
723
- $.Input,
724
- {
725
- ref: s,
726
- className: m(
727
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
728
- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
729
- t
730
- ),
731
- ...a
732
- }
733
- ) })
734
- ));
735
- dt.displayName = $.Input.displayName;
736
- const ct = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
737
- $.List,
738
- {
739
- ref: s,
740
- className: m("max-h-[300px] overflow-y-auto overflow-x-hidden", t),
741
- ...a
742
- }
743
- ));
744
- ct.displayName = $.List.displayName;
745
- const Ra = x.forwardRef((t, a) => /* @__PURE__ */ e.jsx(
746
- $.Empty,
747
- {
748
- ref: a,
749
- className: "py-6 text-center text-sm",
750
- ...t
751
- }
752
- ));
753
- Ra.displayName = $.Empty.displayName;
754
- const ka = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
755
- $.Group,
756
- {
757
- ref: s,
758
- className: m(
759
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
760
- t
761
- ),
762
- ...a
763
- }
764
- ));
765
- ka.displayName = $.Group.displayName;
766
- const Ia = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
767
- $.Separator,
768
- {
769
- ref: s,
770
- className: m("-mx-1 h-px bg-border", t),
771
- ...a
772
- }
773
- ));
774
- Ia.displayName = $.Separator.displayName;
775
- const mt = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
776
- $.Item,
777
- {
778
- ref: s,
779
- className: m(
780
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
781
- t
782
- ),
783
- ...a
784
- }
785
- ));
786
- mt.displayName = $.Item.displayName;
787
- const Oa = X.Root, ut = x.forwardRef(({ className: t, align: a = "center", sideOffset: s = 4, ...n }, r) => /* @__PURE__ */ e.jsx(X.Portal, { children: /* @__PURE__ */ e.jsx(
788
- X.Content,
789
- {
790
- ref: r,
791
- align: a,
792
- sideOffset: s,
793
- className: m(
794
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
795
- t
796
- ),
797
- ...n
798
- }
799
- ) }));
800
- ut.displayName = X.Content.displayName;
801
- const Ea = ({
802
- value: t,
803
- options: a,
804
- onChange: s,
805
- className: n,
806
- placeholder: r = "Enter value",
807
- onEnterPress: i,
808
- ref: l
809
- }) => {
810
- const [c, d] = U(!1), [u, g] = U(!1), C = Xt((p) => p.filtered.count), b = q(null);
811
- return /* @__PURE__ */ e.jsxs(Oa, { open: c, children: [
812
- /* @__PURE__ */ e.jsx(Kt, { children: /* @__PURE__ */ e.jsx(
813
- dt,
814
- {
815
- ref: (p) => {
816
- b.current = p, typeof l == "function" ? l(p) : l && (l.current = p);
817
- },
818
- value: t,
819
- placeholder: r,
820
- className: m("h-9 bg-transparent", n),
821
- onFocus: () => d(!0),
822
- onBlur: () => {
823
- u || d(!1);
824
- },
825
- onKeyDown: (p) => {
826
- var f;
827
- p.key === "Enter" && (d(!1), (f = b.current) == null || f.blur(), i == null || i(p));
828
- },
829
- onValueChange: (p) => s(p)
830
- }
831
- ) }),
832
- /* @__PURE__ */ e.jsx(
833
- ut,
834
- {
835
- onMouseEnter: () => g(!0),
836
- onMouseLeave: () => g(!1),
837
- onOpenAutoFocus: (p) => p.preventDefault(),
838
- className: m("p-0 w-[--radix-popover-trigger-width]", {
839
- "border-0": C === 0
840
- }),
841
- align: "start",
842
- side: "bottom",
843
- onWheel: (p) => {
844
- p.stopPropagation();
845
- },
846
- onTouchMove: (p) => {
847
- p.stopPropagation();
848
- },
849
- children: /* @__PURE__ */ e.jsx(ct, { className: "max-h-[140px]", children: a.map((p) => /* @__PURE__ */ e.jsx(
850
- mt,
851
- {
852
- value: p,
853
- onSelect: (f) => {
854
- s(f), d(!1);
855
- },
856
- className: "cursor-pointer",
857
- children: p
858
- },
859
- p
860
- )) })
861
- }
862
- )
863
- ] });
864
- }, ee = ({ shouldFilter: t, ...a }) => /* @__PURE__ */ e.jsx(lt, { className: "bg-transparent", shouldFilter: t, children: /* @__PURE__ */ e.jsx(Ea, { ...a }) }), Se = (t, a) => {
865
- const s = x.forwardRef(({ className: n, asChild: r, ...i }, l) => {
866
- const c = r ? Yt : t;
867
- return x.createElement(c, {
868
- ...i,
869
- ref: l,
870
- className: typeof a == "function" ? a({ className: n }) : m(a, n)
871
- });
872
- });
873
- return s.displayName = `VariantComponent(${t})`, s;
874
- }, Pe = Se(
875
- "div",
876
- "grid grid-cols-[2fr_3fr] gap-2 items-center"
877
- ), Re = Se(
878
- "div",
879
- "group hover:bg-accent px-3 grid col-span-full grid-cols-subgrid"
880
- ), Aa = Object.freeze([
881
- "Accept",
882
- "Accept-Encoding",
883
- "Accept-Language",
884
- "Authorization",
885
- "Cache-Control",
886
- "Connection",
887
- "Content-Disposition",
888
- "Content-Encoding",
889
- "Content-Language",
890
- "Content-Length",
891
- "Content-Range",
892
- "Content-Security-Policy",
893
- "Content-Type",
894
- "Cookie",
895
- "Date",
896
- "ETag",
897
- "Expires",
898
- "Host",
899
- "If-Modified-Since",
900
- "Location",
901
- "Origin",
902
- "Pragma",
903
- "Referer",
904
- "Set-Cookie",
905
- "User-Agent",
906
- "X-Requested-With"
907
- ]), qa = ({
908
- control: t,
909
- headers: a
910
- }) => {
911
- const { fields: s, append: n, remove: r } = ge({
912
- control: t,
913
- name: "headers"
914
- }), { setValue: i, watch: l } = ye(), c = q([]), d = q([]), u = l("headers"), g = Lt(() => {
915
- n({ name: "", value: "", active: !1 });
916
- }, [n]);
917
- fe(() => {
918
- u.length === 0 && g();
919
- }, [u, g]);
920
- const C = (f) => {
921
- var h;
922
- (h = c.current[f]) == null || h.focus();
923
- }, b = (f) => {
924
- g(), requestAnimationFrame(() => {
925
- var h;
926
- return (h = d.current[f + 1]) == null ? void 0 : h.focus();
927
- });
928
- }, p = a.filter((f) => !u.some((h) => h.name === f.name)).map(({ name: f }) => f);
929
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
930
- /* @__PURE__ */ e.jsx(se, { className: "overflow-hidden", children: /* @__PURE__ */ e.jsx(Pe, { children: s.map((f, h) => {
931
- const v = a.find(
932
- (y) => y.name === l(`headers.${h}.name`)
933
- );
934
- return /* @__PURE__ */ e.jsxs(Re, { children: [
935
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 ", children: [
936
- /* @__PURE__ */ e.jsx(
937
- I,
938
- {
939
- control: t,
940
- name: `headers.${h}.active`,
941
- render: ({ field: y }) => /* @__PURE__ */ e.jsx(
942
- $e,
943
- {
944
- variant: "outline",
945
- id: `headers.${h}.active`,
946
- checked: y.value,
947
- onCheckedChange: (N) => {
948
- y.onChange(N);
949
- }
950
- }
951
- )
952
- }
953
- ),
954
- /* @__PURE__ */ e.jsx(
955
- I,
956
- {
957
- control: t,
958
- name: `headers.${h}.name`,
959
- render: ({ field: y }) => /* @__PURE__ */ e.jsx(
960
- ee,
961
- {
962
- ...y,
963
- placeholder: "Name",
964
- className: "border-0 shadow-none bg-transparent text-xs font-mono",
965
- options: [...p, ...Aa],
966
- onEnterPress: () => C(h),
967
- onChange: (N) => {
968
- y.onChange(N), i(`headers.${h}.active`, !0);
969
- },
970
- ref: (N) => {
971
- d.current[h] = N;
972
- }
973
- }
974
- )
975
- }
976
- )
977
- ] }),
978
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
979
- /* @__PURE__ */ e.jsx(
980
- I,
981
- {
982
- control: t,
983
- name: `headers.${h}.value`,
984
- render: ({ field: y }) => (v == null ? void 0 : v.enum) && v.enum.length > 0 ? /* @__PURE__ */ e.jsx(
985
- ee,
986
- {
987
- shouldFilter: !1,
988
- value: y.value,
989
- options: v.enum ?? [],
990
- onChange: (w) => {
991
- y.onChange(w), i(`headers.${h}.active`, !0);
992
- },
993
- className: "font-mono text-xs border-0"
994
- }
995
- ) : /* @__PURE__ */ e.jsx(
996
- be,
997
- {
998
- placeholder: "Value",
999
- className: "w-full border-0 shadow-none text-xs font-mono focus-visible:ring-0",
1000
- ...y,
1001
- ref: (w) => {
1002
- c.current[h] = w;
1003
- },
1004
- onKeyDown: (w) => {
1005
- w.key === "Enter" && w.currentTarget.value.trim() && b(h);
1006
- },
1007
- autoComplete: "off"
1008
- }
1009
- )
1010
- }
1011
- ),
1012
- /* @__PURE__ */ e.jsx(
1013
- K,
1014
- {
1015
- size: "icon",
1016
- variant: "ghost",
1017
- className: "text-muted-foreground opacity-0 group-hover:opacity-100 rounded-full w-8 h-7",
1018
- onClick: () => r(h),
1019
- type: "button",
1020
- children: /* @__PURE__ */ e.jsx($t, { size: 16 })
1021
- }
1022
- )
1023
- ] })
1024
- ] }, f.id);
1025
- }) }) }),
1026
- /* @__PURE__ */ e.jsx("div", { className: "text-end", children: /* @__PURE__ */ e.jsx(
1027
- K,
1028
- {
1029
- className: "",
1030
- onClick: g,
1031
- type: "button",
1032
- variant: "secondary",
1033
- children: "Add header"
1034
- }
1035
- ) })
1036
- ] });
1037
- }, Da = ({
1038
- control: t
1039
- }) => {
1040
- const { fields: a } = ge({
1041
- control: t,
1042
- name: "pathParams"
1043
- });
1044
- return /* @__PURE__ */ e.jsx(se, { className: "rounded-lg", children: /* @__PURE__ */ e.jsx(Pe, { children: a.map((s, n) => /* @__PURE__ */ e.jsxs(Re, { children: [
1045
- /* @__PURE__ */ e.jsx(
1046
- I,
1047
- {
1048
- control: t,
1049
- name: `pathParams.${n}.name`,
1050
- render: () => /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsx(
1051
- st,
1052
- {
1053
- slug: s.name,
1054
- name: s.name,
1055
- className: "font-mono text-xs px-2"
1056
- }
1057
- ) })
1058
- }
1059
- ),
1060
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ e.jsx(
1061
- I,
1062
- {
1063
- control: t,
1064
- name: `pathParams.${n}.value`,
1065
- render: ({ field: r }) => /* @__PURE__ */ e.jsx(
1066
- be,
1067
- {
1068
- ...r,
1069
- required: !0,
1070
- placeholder: "Enter value",
1071
- className: "w-full border-0 shadow-none text-xs font-mono focus-visible:ring-0"
1072
- }
1073
- )
1074
- }
1075
- ) })
1076
- ] }, s.id)) }) });
1077
- }, La = Se(
1078
- "input",
1079
- "px-2 bg-transparent h-6 font-mono text-xs m-2"
1080
- ), Va = ({
1081
- control: t,
1082
- queryParams: a
1083
- }) => {
1084
- const { fields: s } = ge({
1085
- control: t,
1086
- name: "queryParams"
1087
- }), n = ye(), r = a.map((i) => !!i.isRequired);
1088
- return /* @__PURE__ */ e.jsx(se, { className: "rounded-lg", children: /* @__PURE__ */ e.jsx("div", { className: "w-full ", children: /* @__PURE__ */ e.jsx(Pe, { children: s.map((i, l) => {
1089
- const c = a.find(
1090
- (d) => d.name === n.watch(`queryParams.${l}.name`)
1091
- );
1092
- return /* @__PURE__ */ e.jsxs(Re, { children: [
1093
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1094
- /* @__PURE__ */ e.jsx(
1095
- I,
1096
- {
1097
- control: t,
1098
- name: `queryParams.${l}.active`,
1099
- render: ({ field: d }) => /* @__PURE__ */ e.jsx(
1100
- $e,
1101
- {
1102
- variant: "outline",
1103
- id: `queryParams.${l}.active`,
1104
- className: "mr-2",
1105
- checked: d.value,
1106
- onCheckedChange: d.onChange
1107
- }
1108
- )
1109
- }
1110
- ),
1111
- /* @__PURE__ */ e.jsx(
1112
- I,
1113
- {
1114
- control: t,
1115
- render: ({ field: d }) => r[l] ? /* @__PURE__ */ e.jsx(La, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1116
- "label",
1117
- {
1118
- className: "flex items-center cursor-pointer gap-1",
1119
- htmlFor: `queryParams.${l}.active`,
1120
- title: r[l] ? "Required field" : void 0,
1121
- children: [
1122
- d.value,
1123
- r[l] && /* @__PURE__ */ e.jsx("sup", { children: " *" })
1124
- ]
1125
- }
1126
- ) }) : /* @__PURE__ */ e.jsx(
1127
- ee,
1128
- {
1129
- value: d.value,
1130
- options: a.map((u) => u.name),
1131
- onChange: (u) => {
1132
- d.onChange(u);
1133
- },
1134
- className: "border-0 font-mono text-xs bg-transparent hover:bg-transparent"
1135
- }
1136
- ),
1137
- name: `queryParams.${l}.name`
1138
- }
1139
- )
1140
- ] }, i.id),
1141
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ e.jsx(
1142
- I,
1143
- {
1144
- control: t,
1145
- render: ({ field: d }) => (c == null ? void 0 : c.enum) && c.enum.length > 0 ? /* @__PURE__ */ e.jsx(
1146
- ee,
1147
- {
1148
- value: d.value,
1149
- options: c.enum ?? [],
1150
- onChange: (g) => {
1151
- d.onChange(g), n.setValue(`queryParams.${l}.active`, !0);
1152
- },
1153
- className: "font-mono text-xs border-0 ring-1 ring-ring"
1154
- }
1155
- ) : /* @__PURE__ */ e.jsx(
1156
- be,
1157
- {
1158
- ...d,
1159
- onChange: (g) => {
1160
- d.onChange(g.target.value), g.target.value.length > 0 && n.setValue(`queryParams.${l}.active`, !0);
1161
- },
1162
- placeholder: "Enter value",
1163
- className: "w-full border-0 shadow-none focus-visible:ring-0 text-xs font-mono"
1164
- }
1165
- ),
1166
- name: `queryParams.${l}.value`
1167
- }
1168
- ) })
1169
- ] }, i.id);
1170
- }) }) }) });
1171
- }, P = {
1172
- green: "text-green-600",
1173
- blue: "text-sky-600",
1174
- yellow: "text-yellow-600",
1175
- red: "text-red-600",
1176
- purple: "text-purple-600",
1177
- indigo: "text-indigo-600",
1178
- gray: "text-gray-600"
1179
- }, Fa = {
1180
- get: P.green,
1181
- post: P.blue,
1182
- put: P.yellow,
1183
- delete: P.red,
1184
- patch: P.purple,
1185
- options: P.indigo,
1186
- head: P.gray,
1187
- trace: P.gray
1188
- }, za = (t) => Fa[t.toLocaleLowerCase()] ?? P.gray, Ha = ({
1189
- method: t,
1190
- url: a,
1191
- headers: s,
1192
- body: n
1193
- }) => /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 font-mono text-xs", children: [
1194
- /* @__PURE__ */ e.jsxs("div", { className: "gap-2 p-2 bg-muted rounded-md", children: [
1195
- /* @__PURE__ */ e.jsx("span", { className: m(za(t), "font-semibold"), children: t }),
1196
- " ",
1197
- /* @__PURE__ */ e.jsx("span", { className: "break-all", children: a }),
1198
- " ",
1199
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "HTTP/1.1" })
1200
- ] }),
1201
- /* @__PURE__ */ e.jsxs("div", { className: "mx-1.5 flex flex-col gap-3", children: [
1202
- /* @__PURE__ */ e.jsxs(Fe, { defaultOpen: !0, children: [
1203
- /* @__PURE__ */ e.jsxs(ze, { className: "flex items-center gap-2 hover:text-primary group", children: [
1204
- /* @__PURE__ */ e.jsx(B, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1205
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Headers" })
1206
- ] }),
1207
- /* @__PURE__ */ e.jsx(He, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-[auto,1fr] gap-x-8 gap-y-1 pl-1.5 pt-2", children: s.map(([r, i]) => /* @__PURE__ */ e.jsxs(k, { children: [
1208
- /* @__PURE__ */ e.jsx("div", { className: "text-primary", children: r }),
1209
- /* @__PURE__ */ e.jsx("div", { className: "break-all", children: i })
1210
- ] }, r)) }) })
1211
- ] }),
1212
- /* @__PURE__ */ e.jsxs(Fe, { defaultOpen: !0, children: [
1213
- /* @__PURE__ */ e.jsxs(ze, { className: "flex items-center gap-2 hover:text-primary group", children: [
1214
- /* @__PURE__ */ e.jsx(B, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1215
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Body" })
1216
- ] }),
1217
- /* @__PURE__ */ e.jsx(He, { children: /* @__PURE__ */ e.jsx("div", { className: "pl-0 pt-2", children: /* @__PURE__ */ e.jsx(
1218
- "div",
1219
- {
1220
- className: m(
1221
- "whitespace-pre-wrap break-all bg-muted p-2 rounded-md",
1222
- !n && "text-muted-foreground"
1223
- ),
1224
- children: n ?? "Empty body"
1225
- }
1226
- ) }) })
1227
- ] })
1228
- ] })
1229
- ] }), Be = Ne.Root, Ue = Ne.CollapsibleTrigger, Me = Ne.CollapsibleContent;
1230
- function ke(t) {
1231
- if (t === null) return "null";
1232
- if (Array.isArray(t)) {
1233
- if (t.length === 0) return "any[]";
1234
- const a = t[0];
1235
- return a === void 0 ? "any[]" : `${ke(a)}[]`;
1236
- }
1237
- return typeof t == "object" ? Ga(t) : typeof t;
1238
- }
1239
- function Ga(t, a = "") {
1240
- const s = ["{"];
1241
- for (const [n, r] of Object.entries(t)) {
1242
- const i = ke(r);
1243
- s.push(` ${n}: ${i};`);
1244
- }
1245
- return s.push("}"), s.join(`
1246
- `);
1247
- }
1248
- function Ba(t) {
1249
- return { lines: [`type GeneratedType = ${ke(t)};`] };
1250
- }
1251
- const Ua = {
1252
- 200: "OK",
1253
- 201: "Created",
1254
- 202: "Accepted",
1255
- 204: "No Content",
1256
- 400: "Bad Request",
1257
- 401: "Unauthorized",
1258
- 403: "Forbidden",
1259
- 404: "Not Found",
1260
- 405: "Method Not Allowed",
1261
- 500: "Internal Server Error"
1262
- }, Ma = (t) => {
1263
- var s;
1264
- return (s = Object.entries({
1265
- "application/json": "json",
1266
- "text/json": "json",
1267
- "text/html": "html",
1268
- "text/css": "css",
1269
- "text/javascript": "javascript",
1270
- "application/xml": "xml",
1271
- "application/xhtml+xml": "xhtml"
1272
- }).find(
1273
- ([n]) => t.includes(n)
1274
- )) == null ? void 0 : s[1];
1275
- }, _a = (t) => {
1276
- var s;
1277
- const a = ((s = t.find(([n, r]) => n === "Content-Type")) == null ? void 0 : s[1]) || "";
1278
- return Ma(a);
1279
- }, Ja = (t) => {
1280
- try {
1281
- return JSON.stringify(JSON.parse(t), null, 2);
1282
- } catch {
1283
- return null;
1284
- }
1285
- }, Qa = (t) => {
1286
- const a = [
1287
- "Content-Type",
1288
- "Content-Length",
1289
- "Authorization",
1290
- "X-RateLimit-Remaining",
1291
- "X-RateLimit-Limit",
1292
- "Cache-Control",
1293
- "ETag"
1294
- ].map((s) => s.toLowerCase());
1295
- return [...t].sort(([s], [n]) => {
1296
- const r = a.indexOf(s.toLowerCase()), i = a.indexOf(n.toLowerCase());
1297
- return r === i ? 0 : r === -1 ? 1 : i === -1 ? -1 : r - i;
1298
- });
1299
- }, Za = ({
1300
- body: t = "",
1301
- headers: a,
1302
- status: s,
1303
- time: n,
1304
- size: r,
1305
- url: i
1306
- }) => {
1307
- var p;
1308
- const l = _a(a), c = Ja(t), d = c || t, [u, g] = U(
1309
- c ? "formatted" : "raw"
1310
- ), C = It({
1311
- queryKey: ["types", d],
1312
- queryFn: async () => Ba(JSON.parse(d)),
1313
- enabled: u === "types"
1314
- }), b = Qa([...a]);
1315
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 h-full overflow-y-scroll max-h-[calc(100vh-220px)] py-4", children: [
1316
- /* @__PURE__ */ e.jsxs(Be, { defaultOpen: !0, children: [
1317
- /* @__PURE__ */ e.jsxs(Ue, { className: "flex items-center gap-2 hover:text-primary group", children: [
1318
- /* @__PURE__ */ e.jsx(B, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1319
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Headers" })
1320
- ] }),
1321
- /* @__PURE__ */ e.jsx(Me, { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[auto,1fr] gap-x-8 gap-y-1 pl-1.5 pt-2 font-mono text-xs", children: [
1322
- b.slice(0, 5).map(([f, h]) => /* @__PURE__ */ e.jsxs(k, { children: [
1323
- /* @__PURE__ */ e.jsx("div", { className: "text-primary whitespace-pre", children: f }),
1324
- /* @__PURE__ */ e.jsx("div", { className: "break-all", children: h })
1325
- ] }, f)),
1326
- b.length > 5 && /* @__PURE__ */ e.jsxs(Be, { className: "col-span-full grid-cols-subgrid grid", children: [
1327
- /* @__PURE__ */ e.jsxs(Ue, { className: "col-span-2 text-xs text-muted-foreground hover:text-primary flex items-center gap-1 py-1", children: [
1328
- /* @__PURE__ */ e.jsx(B, { className: "h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1329
- "Show ",
1330
- b.length - 5,
1331
- " more headers"
1332
- ] }),
1333
- /* @__PURE__ */ e.jsx(Me, { className: "col-span-full grid grid-cols-subgrid gap-x-8 gap-y-1 ", children: b.slice(5).map(([f, h]) => /* @__PURE__ */ e.jsxs(k, { children: [
1334
- /* @__PURE__ */ e.jsx("div", { className: "text-primary whitespace-pre", children: f }),
1335
- /* @__PURE__ */ e.jsx("div", { className: "break-all", children: h })
1336
- ] }, f)) })
1337
- ] })
1338
- ] }) })
1339
- ] }),
1340
- /* @__PURE__ */ e.jsx(je, { className: "shadow-none", children: /* @__PURE__ */ e.jsx(
1341
- ta,
1342
- {
1343
- language: u === "types" ? "typescript" : u === "raw" ? c ? "plain" : l : "json",
1344
- noBackground: !0,
1345
- className: "overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]",
1346
- code: (u === "raw" ? t : u === "types" ? (p = C.data) == null ? void 0 : p.lines.join(`
1347
- `) : d) ?? ""
1348
- }
1349
- ) }),
1350
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 justify-between", children: [
1351
- /* @__PURE__ */ e.jsxs("div", { className: "flex text-xs gap-2 border bg-muted rounded-md p-2 items-center h-8 font-mono divide-x", children: [
1352
- /* @__PURE__ */ e.jsxs("div", { children: [
1353
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Status" }),
1354
- " ",
1355
- s,
1356
- " ",
1357
- Ua[s] ?? ""
1358
- ] }),
1359
- /* @__PURE__ */ e.jsxs("div", { children: [
1360
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Time" }),
1361
- " ",
1362
- n.toFixed(0),
1363
- "ms"
1364
- ] }),
1365
- /* @__PURE__ */ e.jsxs("div", { children: [
1366
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Size" }),
1367
- " ",
1368
- r,
1369
- "B"
1370
- ] })
1371
- ] }),
1372
- c && /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
1373
- Qe,
1374
- {
1375
- value: u,
1376
- onValueChange: (f) => g(f),
1377
- children: [
1378
- /* @__PURE__ */ e.jsx(Ze, { className: "min-w-32", children: /* @__PURE__ */ e.jsx(We, { placeholder: "View" }) }),
1379
- /* @__PURE__ */ e.jsxs(Ke, { children: [
1380
- /* @__PURE__ */ e.jsx(Q, { value: "formatted", children: "Formatted" }),
1381
- /* @__PURE__ */ e.jsx(Q, { value: "raw", children: "Raw" }),
1382
- /* @__PURE__ */ e.jsx(Q, { value: "types", children: "Types" })
1383
- ] })
1384
- ]
1385
- }
1386
- ) })
1387
- ] })
1388
- ] });
1389
- }, Wa = ({
1390
- queryMutation: t,
1391
- showPathParamsWarning: a
1392
- }) => {
1393
- var n;
1394
- const s = ((((n = t.data) == null ? void 0 : n.status) ?? 0) / 100).toFixed(0);
1395
- return /* @__PURE__ */ e.jsx("div", { className: "min-w-0 p-8 bg-muted/70 overflow-y-auto", children: t.error ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1396
- a && /* @__PURE__ */ e.jsx(ea, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
1397
- /* @__PURE__ */ e.jsxs(je, { children: [
1398
- /* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(Jt, { children: "Request failed" }) }),
1399
- /* @__PURE__ */ e.jsxs(Qt, { children: [
1400
- "Error:",
1401
- " ",
1402
- t.error.message || String(t.error) || "Unexpected error"
1403
- ] })
1404
- ] })
1405
- ] }) : t.data ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs(Ye, { defaultValue: "response", children: [
1406
- /* @__PURE__ */ e.jsxs(et, { children: [
1407
- /* @__PURE__ */ e.jsx(E, { value: "request", children: "Request" }),
1408
- /* @__PURE__ */ e.jsxs(E, { value: "response", children: [
1409
- "Response",
1410
- /* @__PURE__ */ e.jsxs(
1411
- "span",
1412
- {
1413
- className: m(
1414
- "text-xs font-mono ml-1",
1415
- s === "2" && "text-green-500",
1416
- s === "3" && "text-blue-500",
1417
- s === "4" && "text-yellow-500",
1418
- s === "5" && "text-red-500"
1419
- ),
1420
- children: [
1421
- "(",
1422
- t.data.status,
1423
- ")"
1424
- ]
1425
- }
1426
- )
1427
- ] })
1428
- ] }),
1429
- /* @__PURE__ */ e.jsx(A, { value: "request", children: /* @__PURE__ */ e.jsx(Ha, { ...t.data.request }) }),
1430
- /* @__PURE__ */ e.jsx(A, { value: "response", children: /* @__PURE__ */ e.jsx(
1431
- Za,
1432
- {
1433
- status: t.data.status,
1434
- time: t.data.time,
1435
- size: t.data.size,
1436
- headers: t.data.headers,
1437
- body: t.data.body,
1438
- url: t.data.request.url
1439
- }
1440
- ) })
1441
- ] }) }) : /* @__PURE__ */ e.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ e.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: t.isPending ? /* @__PURE__ */ e.jsx(Wt, {}) : "Send a request first to see the response here" }) }) });
1442
- }, Ka = ({
1443
- identities: t,
1444
- formRef: a,
1445
- disabled: s
1446
- }) => {
1447
- const { setValue: n } = ye(), [r, i] = U();
1448
- return t.length === 0 ? /* @__PURE__ */ e.jsx(Z, { disabled: s, children: "Send" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex", children: [
1449
- /* @__PURE__ */ e.jsx(
1450
- Z,
1451
- {
1452
- className: "rounded-r-none inset-shadow-sm",
1453
- disabled: s,
1454
- onClick: () => {
1455
- var l;
1456
- return (l = a == null ? void 0 : a.current) == null ? void 0 : l.requestSubmit();
1457
- },
1458
- children: "Send"
1459
- }
1460
- ),
1461
- /* @__PURE__ */ e.jsxs(nt, { children: [
1462
- /* @__PURE__ */ e.jsx(rt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1463
- Z,
1464
- {
1465
- disabled: s,
1466
- className: "rounded-l-none border-l border-border/40 inset-shadow-sm w-6",
1467
- size: "icon",
1468
- children: /* @__PURE__ */ e.jsx(St, { className: "w-4 h-4" })
1469
- }
1470
- ) }),
1471
- /* @__PURE__ */ e.jsx(we, { value: r, children: /* @__PURE__ */ e.jsx(Ce, { className: "w-56", align: "end", alignOffset: -150, children: [{ id: H, label: "None" }, ...t].map(
1472
- (l) => /* @__PURE__ */ e.jsxs(
1473
- Te,
1474
- {
1475
- onClick: () => {
1476
- var c;
1477
- i(l.id), n("identity", l.id), (c = a == null ? void 0 : a.current) == null || c.requestSubmit();
1478
- },
1479
- onMouseEnter: () => i(l.id),
1480
- onMouseLeave: () => i(void 0),
1481
- children: [
1482
- /* @__PURE__ */ e.jsx(Y, { value: l.id, className: "mr-2" }),
1483
- l.label
1484
- ]
1485
- },
1486
- l.id
1487
- )
1488
- ) }) })
1489
- ] })
1490
- ] });
1491
- }, H = "__none", Xa = ({
1492
- server: t,
1493
- servers: a = [],
1494
- url: s,
1495
- method: n,
1496
- headers: r = [],
1497
- queryParams: i = [],
1498
- pathParams: l = [],
1499
- defaultBody: c = "",
1500
- examples: d
1501
- }) => {
1502
- var Oe, Ee, Ae;
1503
- const { selectedServer: u, setSelectedServer: g } = Ot(
1504
- a.map((o) => ({ url: o }))
1505
- ), [, C] = Vt(), { register: b, control: p, handleSubmit: f, watch: h, setValue: v, ...y } = Ut({
1506
- defaultValues: {
1507
- body: c,
1508
- queryParams: i.map((o) => ({
1509
- name: o.name,
1510
- value: o.defaultValue ?? "",
1511
- active: o.defaultActive ?? !1,
1512
- enum: o.enum ?? []
1513
- })).concat([
1514
- {
1515
- name: "",
1516
- value: "",
1517
- active: !1,
1518
- enum: []
1519
- }
1520
- ]),
1521
- pathParams: l.map((o) => ({
1522
- name: o.name,
1523
- value: o.defaultValue ?? ""
1524
- })),
1525
- headers: r.map((o) => ({
1526
- name: o.name,
1527
- value: o.defaultValue ?? "",
1528
- active: o.defaultActive ?? !1
1529
- })).concat([
1530
- {
1531
- name: "",
1532
- value: "",
1533
- active: !1
1534
- }
1535
- ]),
1536
- identity: H
1537
- }
1538
- }), N = h(), w = Et(), L = q(!1);
1539
- fe(() => {
1540
- var R;
1541
- if (L.current) return;
1542
- const o = (R = w.data) == null ? void 0 : R.at(0);
1543
- o && (v("identity", o.id), L.current = !0);
1544
- }, [v, w.data]);
1545
- const V = q(null), _ = Bt({
1546
- mutationFn: async (o) => {
1547
- var J, F;
1548
- const R = performance.now(), S = new Request(
1549
- xa(t ?? u, s, o),
1550
- {
1551
- method: n.toUpperCase(),
1552
- headers: Object.fromEntries(
1553
- o.headers.filter((T) => T.name && T.active).map((T) => [T.name, T.value])
1554
- ),
1555
- body: o.body ? o.body : void 0
1556
- }
1557
- );
1558
- o.identity !== H && await ((F = (J = w.data) == null ? void 0 : J.find((T) => T.id === o.identity)) == null ? void 0 : F.authorizeRequest(S));
1559
- try {
1560
- const T = await fetch(S, {
1561
- signal: AbortSignal.timeout(5e3)
1562
- }), ft = performance.now() - R, qe = await T.text(), gt = new URL(S.url);
1563
- return {
1564
- status: T.status,
1565
- headers: Array.from(T.headers.entries()),
1566
- size: qe.length,
1567
- body: qe,
1568
- time: ft,
1569
- request: {
1570
- method: S.method.toUpperCase(),
1571
- url: S.url,
1572
- headers: [
1573
- ["Host", gt.host],
1574
- ["User-Agent", "Zudoku Playground"],
1575
- ...Array.from(S.headers.entries())
1576
- ],
1577
- body: o.body ? o.body : void 0
1578
- }
1579
- };
1580
- } catch (T) {
1581
- throw T instanceof TypeError ? new Error(
1582
- "The request failed, possibly due to network issues or CORS policy."
1583
- ) : T;
1584
- }
1585
- }
1586
- }), ht = /* @__PURE__ */ e.jsx(
1587
- ua,
1588
- {
1589
- path: s,
1590
- renderParam: ({ name: o, originalValue: R, index: S }) => {
1591
- var F;
1592
- const J = (F = N.pathParams.find(
1593
- (T) => T.name === o
1594
- )) == null ? void 0 : F.value;
1595
- return /* @__PURE__ */ e.jsx(
1596
- st,
1597
- {
1598
- name: o,
1599
- backgroundOpacity: "0",
1600
- slug: o,
1601
- onClick: () => y.setFocus(`pathParams.${S}.value`),
1602
- children: J || R
1603
- }
1604
- );
1605
- }
1606
- }
1607
- ), Ie = N.queryParams.filter((o) => o.active).map((o, R, S) => /* @__PURE__ */ e.jsxs(k, { children: [
1608
- o.name,
1609
- "=",
1610
- encodeURIComponent(o.value).replaceAll("%20", "+"),
1611
- R < S.length - 1 && "&",
1612
- /* @__PURE__ */ e.jsx("wbr", {})
1613
- ] }, o.name)), xt = /* @__PURE__ */ e.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: t ? /* @__PURE__ */ e.jsx("span", { children: t.replace(/^https?:\/\//, "") }) : a.length > 1 && /* @__PURE__ */ e.jsxs(
1614
- Qe,
1615
- {
1616
- onValueChange: (o) => {
1617
- C(() => g(o));
1618
- },
1619
- value: u,
1620
- defaultValue: u,
1621
- children: [
1622
- /* @__PURE__ */ e.jsx(Ze, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ e.jsx(We, {}) }),
1623
- /* @__PURE__ */ e.jsx(Ke, { children: a.map((o) => /* @__PURE__ */ e.jsx(Q, { value: o, children: o.replace(/^https?:\/\//, "") }, o)) })
1624
- ]
1625
- }
1626
- ) });
1627
- return /* @__PURE__ */ e.jsx(
1628
- Mt,
1629
- {
1630
- register: b,
1631
- control: p,
1632
- handleSubmit: f,
1633
- watch: h,
1634
- setValue: v,
1635
- ...y,
1636
- children: /* @__PURE__ */ e.jsx(
1637
- "form",
1638
- {
1639
- onSubmit: f((o) => _.mutateAsync(o)),
1640
- ref: V,
1641
- children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 text-sm h-full", children: [
1642
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 p-4 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
1643
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-stretch", children: [
1644
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
1645
- /* @__PURE__ */ e.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono flex items-center", children: n.toUpperCase() }),
1646
- /* @__PURE__ */ e.jsxs("div", { className: "items-center p-2 font-mono text-xs break-words", children: [
1647
- xt,
1648
- ht,
1649
- Ie.length > 0 ? "?" : "",
1650
- Ie
1651
- ] })
1652
- ] }),
1653
- /* @__PURE__ */ e.jsx(
1654
- Ka,
1655
- {
1656
- identities: w.data ?? [],
1657
- formRef: V,
1658
- disabled: y.formState.isSubmitting
1659
- }
1660
- )
1661
- ] }),
1662
- /* @__PURE__ */ e.jsxs(Ye, { defaultValue: "parameters", children: [
1663
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1 justify-between", children: /* @__PURE__ */ e.jsxs(et, { children: [
1664
- /* @__PURE__ */ e.jsxs(E, { value: "parameters", children: [
1665
- "Parameters",
1666
- (N.pathParams.some((o) => o.value !== "") || N.queryParams.some((o) => o.active)) && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1667
- ] }),
1668
- /* @__PURE__ */ e.jsxs(E, { value: "headers", children: [
1669
- "Headers",
1670
- N.headers.filter((o) => o.active).length > 0 && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1671
- ] }),
1672
- /* @__PURE__ */ e.jsxs(E, { value: "auth", children: [
1673
- "Auth",
1674
- N.identity !== H && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1675
- ] }),
1676
- /* @__PURE__ */ e.jsx(E, { value: "body", children: "Body" })
1677
- ] }) }),
1678
- /* @__PURE__ */ e.jsx(A, { value: "headers", children: /* @__PURE__ */ e.jsx(qa, { control: p, headers: r }) }),
1679
- /* @__PURE__ */ e.jsxs(A, { value: "parameters", children: [
1680
- l.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1681
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
1682
- /* @__PURE__ */ e.jsx(Da, { control: p })
1683
- ] }),
1684
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1685
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
1686
- /* @__PURE__ */ e.jsx(Va, { control: p, queryParams: i })
1687
- ] })
1688
- ] }),
1689
- /* @__PURE__ */ e.jsxs(A, { value: "body", children: [
1690
- !["POST", "PUT", "PATCH", "DELETE"].includes(
1691
- n.toUpperCase()
1692
- ) && /* @__PURE__ */ e.jsxs(ue, { className: "mb-2", children: [
1693
- /* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4" }),
1694
- /* @__PURE__ */ e.jsx(pe, { children: "Body" }),
1695
- /* @__PURE__ */ e.jsx(he, { children: "Body is only supported for POST, PUT, PATCH, and DELETE requests" })
1696
- ] }),
1697
- /* @__PURE__ */ e.jsx(
1698
- at,
1699
- {
1700
- ...b("body"),
1701
- className: m(
1702
- "border w-full rounded-lg p-2 bg-muted h-40 font-mono",
1703
- !["POST", "PUT", "PATCH", "DELETE"].includes(
1704
- n.toUpperCase()
1705
- ) && "h-20"
1706
- ),
1707
- placeholder: ["POST", "PUT", "PATCH", "DELETE"].includes(
1708
- n.toUpperCase()
1709
- ) ? void 0 : "This request does not support a body",
1710
- disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
1711
- n.toUpperCase()
1712
- )
1713
- }
1714
- ),
1715
- d && /* @__PURE__ */ e.jsx(
1716
- ba,
1717
- {
1718
- examples: d,
1719
- onSelect: (o) => v("body", JSON.stringify(o.value, null, 2))
1720
- }
1721
- )
1722
- ] }),
1723
- /* @__PURE__ */ e.jsx(A, { value: "auth", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1724
- ((Oe = w.data) == null ? void 0 : Oe.length) === 0 && /* @__PURE__ */ e.jsxs(ue, { children: [
1725
- /* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4" }),
1726
- /* @__PURE__ */ e.jsx(pe, { children: "Authentication" }),
1727
- /* @__PURE__ */ e.jsx(he, { children: "No identities found. Please create an identity first." })
1728
- ] }),
1729
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center gap-2", children: /* @__PURE__ */ e.jsx(je, { className: "w-full overflow-hidden", children: /* @__PURE__ */ e.jsxs(
1730
- we,
1731
- {
1732
- onValueChange: (o) => v("identity", o),
1733
- value: N.identity,
1734
- defaultValue: N.identity,
1735
- className: "gap-0",
1736
- disabled: ((Ee = w.data) == null ? void 0 : Ee.length) === 0,
1737
- children: [
1738
- /* @__PURE__ */ e.jsxs(
1739
- z,
1740
- {
1741
- className: "h-12 border-b items-center flex p-4 cursor-pointer hover:bg-accent",
1742
- htmlFor: "none",
1743
- children: [
1744
- /* @__PURE__ */ e.jsx(Y, { value: H, id: "none", children: "None" }),
1745
- /* @__PURE__ */ e.jsx(z, { htmlFor: "none", className: "ml-2", children: "None" })
1746
- ]
1747
- }
1748
- ),
1749
- (Ae = w.data) == null ? void 0 : Ae.map((o) => /* @__PURE__ */ e.jsxs(
1750
- z,
1751
- {
1752
- className: "h-12 border-b items-center flex p-4 cursor-pointer hover:bg-accent",
1753
- children: [
1754
- /* @__PURE__ */ e.jsx(
1755
- Y,
1756
- {
1757
- value: o.id,
1758
- id: o.id,
1759
- children: o.label
1760
- }
1761
- ),
1762
- /* @__PURE__ */ e.jsx(z, { htmlFor: o.id, className: "ml-2", children: o.label })
1763
- ]
1764
- },
1765
- o.id
1766
- ))
1767
- ]
1768
- }
1769
- ) }) })
1770
- ] }) })
1771
- ] })
1772
- ] }),
1773
- /* @__PURE__ */ e.jsx(
1774
- Wa,
1775
- {
1776
- queryMutation: _,
1777
- showPathParamsWarning: N.pathParams.some(
1778
- (o) => o.value === ""
1779
- )
1780
- }
1781
- )
1782
- ] })
1783
- }
1784
- )
1785
- }
1786
- );
1787
- }, Ya = ({
1788
- className: t,
1789
- size: a = 16
1790
- }) => /* @__PURE__ */ e.jsx(
1791
- "svg",
1792
- {
1793
- xmlns: "http://www.w3.org/2000/svg",
1794
- viewBox: "0 0 24 24",
1795
- fill: "currentColor",
1796
- className: t,
1797
- width: a,
1798
- height: a,
1799
- children: /* @__PURE__ */ e.jsx(
1800
- "path",
1801
- {
1802
- fillRule: "evenodd",
1803
- 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",
1804
- clipRule: "evenodd"
1805
- }
1806
- )
1807
- }
1808
- ), es = (t) => {
1809
- const [a, s] = U(!1);
1810
- return /* @__PURE__ */ e.jsxs(Ft, { onOpenChange: (n) => s(n), children: [
1811
- /* @__PURE__ */ e.jsx(zt, { asChild: !0, children: t.children ?? /* @__PURE__ */ e.jsxs(
1812
- "button",
1813
- {
1814
- type: "button",
1815
- className: "flex gap-1 items-center px-2 py-1 rounded-md transition text-xs bg-primary text-primary-foreground shadow-sm hover:bg-primary/80",
1816
- children: [
1817
- "Test",
1818
- /* @__PURE__ */ e.jsx(Ya, { size: 14 })
1819
- ]
1820
- }
1821
- ) }),
1822
- /* @__PURE__ */ e.jsxs(
1823
- Ht,
1824
- {
1825
- className: "max-w-screen-xl w-full h-5/6 overflow-hidden p-0",
1826
- "aria-describedby": void 0,
1827
- children: [
1828
- /* @__PURE__ */ e.jsx(Dt, { children: /* @__PURE__ */ e.jsx(Gt, { children: "Playground" }) }),
1829
- a && /* @__PURE__ */ e.jsx(Xa, { ...t })
1830
- ]
1831
- }
1832
- )
1833
- ] });
1834
- }, ts = {
1835
- get: "green",
1836
- post: "blue",
1837
- put: "yellow",
1838
- delete: "red",
1839
- patch: "purple",
1840
- options: "gray",
1841
- head: "gray"
1842
- }, _e = ({
1843
- label: t,
1844
- path: a,
1845
- operations: s,
1846
- collapsible: n,
1847
- collapsed: r
1848
- }) => ({
1849
- type: "category",
1850
- label: t,
1851
- link: {
1852
- type: "doc",
1853
- id: a,
1854
- label: t
1855
- },
1856
- collapsible: n,
1857
- collapsed: r,
1858
- items: s.map((i) => ({
1859
- type: "link",
1860
- label: i.summary ?? i.path,
1861
- href: `${a}#${i.slug}`,
1862
- ...i.method && {
1863
- badge: {
1864
- label: i.method,
1865
- color: ts[i.method.toLowerCase()],
1866
- invert: !0
1867
- }
1868
- }
1869
- }))
1870
- }), Je = (t) => ({
1871
- path: t.routePath,
1872
- async lazy() {
1873
- const { OasProvider: a } = await import("./OasProvider-SzD9mHJc.js");
1874
- return {
1875
- element: /* @__PURE__ */ e.jsx(
1876
- a,
1877
- {
1878
- basePath: t.basePath,
1879
- version: t.version,
1880
- client: t.client,
1881
- config: t.config
1882
- }
1883
- )
1884
- };
1885
- },
1886
- children: t.routes
1887
- }), xe = ({
1888
- path: t,
1889
- tag: a,
1890
- untagged: s
1891
- }) => ({
1892
- path: t,
1893
- async lazy() {
1894
- const { OperationList: n } = await import("./OperationList-DDs9NblY.js");
1895
- return { element: /* @__PURE__ */ e.jsx(n, { tag: a, untagged: s }) };
1896
- }
1897
- }), as = (t, a) => {
1898
- const s = O(
1899
- t,
1900
- a[0] ? W(a[0]) : G
1901
- );
1902
- return [
1903
- // Redirect to first tag on the index route
1904
- { index: !0, loader: () => kt(s) },
1905
- // Create routes for each tag
1906
- ...a.map(
1907
- (n) => xe({
1908
- path: O(t, W(n)),
1909
- tag: n
1910
- })
1911
- ),
1912
- // Category without tagged operations
1913
- xe({
1914
- path: O(t, G),
1915
- untagged: !0
1916
- })
1917
- ];
1918
- }, pt = (t) => t.type === "file" ? Object.keys(t.input) : [], ss = ({
1919
- basePath: t,
1920
- config: a,
1921
- client: s
1922
- }) => {
1923
- const n = a.tagPages;
1924
- if (!n)
1925
- return [
1926
- Je({
1927
- basePath: t,
1928
- routePath: t,
1929
- routes: [xe({ path: t + "/:tag?" })],
1930
- client: s,
1931
- config: a
1932
- })
1933
- ];
1934
- const r = pt(a);
1935
- return (r.length > 1 ? [void 0, ...r] : [void 0]).map((l) => {
1936
- const c = O(t, l);
1937
- return Je({
1938
- basePath: t,
1939
- version: l,
1940
- routePath: c,
1941
- routes: as(c, n),
1942
- client: s,
1943
- config: a
1944
- });
1945
- });
1946
- }, ns = tt(`
1947
- query GetCategories($input: JSON!, $type: SchemaType!) {
1948
- schema(input: $input, type: $type) {
1949
- url
1950
- tags {
1951
- name
1952
- }
1953
- }
1954
- }
1955
- `), rs = tt(`
1956
- query GetOperations($input: JSON!, $type: SchemaType!, $tag: String) {
1957
- schema(input: $input, type: $type) {
1958
- operations(tag: $tag) {
1959
- slug
1960
- deprecated
1961
- method
1962
- summary
1963
- operationId
1964
- path
1965
- tags {
1966
- name
1967
- }
1968
- }
1969
- untagged: operations(untagged: true) {
1970
- slug
1971
- deprecated
1972
- method
1973
- summary
1974
- operationId
1975
- path
1976
- }
1977
- }
1978
- }
1979
- `), G = "~endpoints", Es = (t) => {
1980
- const a = O(t.navigationId ?? "/reference"), s = new sa(t);
1981
- return {
1982
- getHead: () => {
1983
- if (t.type === "url" && !t.skipPreload)
1984
- return /* @__PURE__ */ e.jsx(
1985
- "link",
1986
- {
1987
- rel: "preload",
1988
- href: t.input,
1989
- as: "fetch",
1990
- crossOrigin: "anonymous"
1991
- }
1992
- );
1993
- if (t.server)
1994
- return /* @__PURE__ */ e.jsx("link", { rel: "preconnect", href: t.server });
1995
- },
1996
- getMdxComponents: () => ({
1997
- OpenPlaygroundButton: ({
1998
- requireAuth: n,
1999
- server: r,
2000
- method: i,
2001
- url: l,
2002
- children: c,
2003
- ...d
2004
- }) => {
2005
- const u = At();
2006
- if (!r)
2007
- throw new Error("Server is required");
2008
- return n && !u.isAuthenticated ? /* @__PURE__ */ e.jsxs(
2009
- K,
2010
- {
2011
- className: "gap-2 items-center",
2012
- variant: "outline",
2013
- onClick: u.login,
2014
- children: [
2015
- "Login to open in Playground ",
2016
- /* @__PURE__ */ e.jsx(Pt, { size: 16 })
2017
- ]
2018
- }
2019
- ) : /* @__PURE__ */ e.jsx(
2020
- es,
2021
- {
2022
- url: l ?? "/",
2023
- method: i ?? "get",
2024
- server: r,
2025
- ...d,
2026
- children: /* @__PURE__ */ e.jsx(K, { className: "gap-2 items-center", variant: "outline", children: c ?? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2027
- "Open in Playground ",
2028
- /* @__PURE__ */ e.jsx(Rt, { size: 16 })
2029
- ] }) })
2030
- }
2031
- );
2032
- }
2033
- }),
2034
- getSidebar: async (n) => {
2035
- var i;
2036
- if (!Ve({ path: a, end: !1 }, n))
2037
- return [];
2038
- const r = Ve(
2039
- { path: `${a}/:version?/:tag`, end: !0 },
2040
- n
2041
- );
2042
- try {
2043
- const l = r == null ? void 0 : r.params.version, c = l ?? pt(t).at(0), d = t.type, u = t.type === "file" ? t.input[c] : t.input, g = t.loadTags === !0 || t.type === "url", C = !t.loadTags && t.type !== "url", b = (i = t.tagPages) == null ? void 0 : i.find(
2044
- (v) => W(v) === (r == null ? void 0 : r.params.tag)
2045
- ), [p, f] = await Promise.all([
2046
- s.fetch(ns, { type: d, input: u }),
2047
- s.fetch(rs, {
2048
- type: d,
2049
- input: u,
2050
- tag: t.loadTags ? void 0 : b
2051
- })
2052
- ]), h = p.schema.tags.flatMap((v) => {
2053
- const y = O(
2054
- a,
2055
- l,
2056
- W(v.name)
2057
- ), N = f.schema.operations.filter(
2058
- (w) => {
2059
- var L, V;
2060
- return ((L = w.tags) == null ? void 0 : L.length) !== 0 && ((V = w.tags) == null ? void 0 : V.map((_) => _.name).includes(v.name));
2061
- }
2062
- );
2063
- return t.loadTags && N.length === 0 ? [] : _e({
2064
- label: v.name,
2065
- path: y,
2066
- operations: (r == null ? void 0 : r.params.tag) !== G || t.loadTags ? N : [],
2067
- collapsible: g,
2068
- collapsed: C
2069
- });
2070
- });
2071
- return f.schema.untagged.length > 0 && h.push(
2072
- _e({
2073
- label: "Other endpoints",
2074
- path: O(a, l, G),
2075
- operations: (r == null ? void 0 : r.params.tag) === G || t.loadTags ? f.schema.untagged : [],
2076
- collapsible: g,
2077
- collapsed: C
2078
- })
2079
- ), h;
2080
- } catch {
2081
- return [];
2082
- }
2083
- },
2084
- getRoutes: () => ss({ basePath: a, config: t, client: s })
2085
- };
2086
- };
2087
- export {
2088
- st as C,
2089
- es as P,
2090
- G as U,
2091
- tt as a,
2092
- Be as b,
2093
- Me as c,
2094
- Ue as d,
2095
- ua as e,
2096
- pt as g,
2097
- za as m,
2098
- Es as o
2099
- };
2100
- //# sourceMappingURL=index-CibzSNks.js.map