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