zudoku 0.33.2-local.4 → 0.34.1

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