zudoku 0.0.0-f3786a4 → 0.0.0-f3f6db5

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