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