zudoku 0.23.4 → 0.23.5

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 (38) hide show
  1. package/dist/config/validators/common.d.ts +37 -37
  2. package/dist/config/validators/common.js +4 -1
  3. package/dist/config/validators/common.js.map +1 -1
  4. package/dist/config/validators/validate.d.ts +14 -14
  5. package/dist/lib/plugins/openapi/OperationList.js +7 -33
  6. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  7. package/dist/lib/plugins/openapi/Route.d.ts +4 -2
  8. package/dist/lib/plugins/openapi/Route.js +25 -2
  9. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  10. package/dist/lib/plugins/openapi/context.d.ts +3 -3
  11. package/dist/lib/plugins/openapi/index.js +12 -12
  12. package/dist/lib/plugins/openapi/index.js.map +1 -1
  13. package/dist/lib/plugins/openapi/interfaces.d.ts +19 -0
  14. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.d.ts +1 -0
  15. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js +27 -0
  16. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js.map +1 -0
  17. package/dist/vite/config.js +2 -1
  18. package/dist/vite/config.js.map +1 -1
  19. package/dist/vite/plugin-api.js +35 -14
  20. package/dist/vite/plugin-api.js.map +1 -1
  21. package/lib/{OperationList-C7ac3kR5.js → OperationList-wvY-BrxS.js} +1173 -1157
  22. package/lib/OperationList-wvY-BrxS.js.map +1 -0
  23. package/lib/Route-C8nwd9A2.js +37 -0
  24. package/lib/Route-C8nwd9A2.js.map +1 -0
  25. package/lib/context-h_UkBLvr.js.map +1 -1
  26. package/lib/{index-C8ubT49C.js → index-C_ul-2fb.js} +442 -437
  27. package/lib/{index-C8ubT49C.js.map → index-C_ul-2fb.js.map} +1 -1
  28. package/lib/zudoku.plugin-openapi.js +1 -1
  29. package/package.json +1 -1
  30. package/src/lib/plugins/openapi/OperationList.tsx +42 -50
  31. package/src/lib/plugins/openapi/Route.tsx +45 -9
  32. package/src/lib/plugins/openapi/context.tsx +2 -2
  33. package/src/lib/plugins/openapi/index.tsx +35 -28
  34. package/src/lib/plugins/openapi/interfaces.ts +22 -1
  35. package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -0
  36. package/lib/OperationList-C7ac3kR5.js.map +0 -1
  37. package/lib/Route-C9cYcP-j.js +0 -11
  38. package/lib/Route-C9cYcP-j.js.map +0 -1
@@ -1,38 +1,38 @@
1
- var ke = Object.defineProperty;
2
- var me = (t) => {
3
- throw TypeError(t);
1
+ var Ie = Object.defineProperty;
2
+ var me = (e) => {
3
+ throw TypeError(e);
4
4
  };
5
- var Ie = (t, n, s) => n in t ? ke(t, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[n] = s;
6
- var W = (t, n, s) => Ie(t, typeof n != "symbol" ? n + "" : n, s), pe = (t, n, s) => n.has(t) || me("Cannot " + s);
7
- var x = (t, n, s) => (pe(t, n, "read from private field"), s ? s.call(t) : n.get(t)), R = (t, n, s) => n.has(t) ? me("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(t) : n.set(t, s), M = (t, n, s, r) => (pe(t, n, "write to private field"), r ? r.call(t, s) : n.set(t, s), s);
8
- import { j as e } from "./jsx-runtime-Dx-03ztt.js";
9
- import { m as qe } from "./chunk-D52XG6IA-Dl7HLe6j.js";
10
- import { i as Re, j as Me, k as Ae } from "./utils-B4O1uet5.js";
11
- import { XIcon as Ve, EraserIcon as Se, ChevronsUpDownIcon as ze, LogInIcon as Fe, CirclePlayIcon as Le } from "lucide-react";
5
+ var qe = (e, n, s) => n in e ? Ie(e, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[n] = s;
6
+ var W = (e, n, s) => qe(e, typeof n != "symbol" ? n + "" : n, s), pe = (e, n, s) => n.has(e) || me("Cannot " + s);
7
+ var y = (e, n, s) => (pe(e, n, "read from private field"), s ? s.call(e) : n.get(e)), R = (e, n, s) => n.has(e) ? me("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, s), M = (e, n, s, a) => (pe(e, n, "write to private field"), a ? a.call(e, s) : n.set(e, s), s);
8
+ import { j as t } from "./jsx-runtime-Dx-03ztt.js";
9
+ import { m as Re } from "./chunk-D52XG6IA-Dl7HLe6j.js";
10
+ import { i as Me, j as he, k as Ae } from "./utils-B4O1uet5.js";
11
+ import { XIcon as Ve, EraserIcon as Ce, ChevronsUpDownIcon as ze, LogInIcon as Fe, CirclePlayIcon as Le } from "lucide-react";
12
12
  import { u as De } from "./hook-DgGeo5iL.js";
13
13
  import { Button as E } from "./ui/Button.js";
14
14
  import { initializeWorker as Ge } from "zudoku/openapi-worker";
15
15
  import { Z as Be } from "./invariant-Caa8-XvF.js";
16
16
  import { VisuallyHidden as Je } from "@radix-ui/react-visually-hidden";
17
- import * as he from "react";
18
- import { useRef as Ce, useEffect as $e, useState as Te, useTransition as He, Fragment as Z } from "react";
17
+ import * as fe from "react";
18
+ import { useRef as $e, useEffect as Te, useState as Ee, useTransition as He, Fragment as Z } from "react";
19
19
  import { D as Qe, b as Ue, a as We, c as Ze } from "./Dialog-Bxv1yEIg.js";
20
- import { u as Ke, S as fe, a as xe, b as ye, c as ge, e as K } from "./Select-D3XuKKuH.js";
20
+ import { u as Ke, S as xe, a as ye, b as ge, c as ve, e as K } from "./Select-D3XuKKuH.js";
21
21
  import { b as oe, C as $, u as Xe, a as Ye, F as et } from "./index.esm-BnnBRKJX.js";
22
22
  import { a as tt } from "./state-CFQsUZUP.js";
23
- import { S as ve } from "./Spinner-DuxJLLNE.js";
23
+ import { S as je } from "./Spinner-DuxJLLNE.js";
24
24
  import { Callout as nt } from "./ui/Callout.js";
25
25
  import { Card as ae, CardHeader as st, CardTitle as rt, CardContent as at } from "./ui/Card.js";
26
- import { Tabs as je, TabsList as be, TabsTrigger as A, TabsContent as V } from "./ui/Tabs.js";
26
+ import { Tabs as be, TabsList as Ne, TabsTrigger as A, TabsContent as V } from "./ui/Tabs.js";
27
27
  import { z as ot, S as it } from "./SyntaxHighlight-Bz-lOJtH.js";
28
- import { c as P } from "./cn-qaFjX9_3.js";
28
+ import { c as O } from "./cn-qaFjX9_3.js";
29
29
  import { Input as H } from "./ui/Input.js";
30
30
  import { Slot as lt } from "@radix-ui/react-slot";
31
31
  class L extends String {
32
- constructor(s, r) {
32
+ constructor(s, a) {
33
33
  super(s);
34
34
  W(this, "__apiType");
35
- this.value = s, this.__meta__ = r;
35
+ this.value = s, this.__meta__ = a;
36
36
  }
37
37
  toString() {
38
38
  return this.value;
@@ -225,36 +225,36 @@ const ct = new L(
225
225
  "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": mt,
226
226
  "\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": pt
227
227
  };
228
- function ft(t) {
229
- return ht[t] ?? {};
228
+ function ft(e) {
229
+ return ht[e] ?? {};
230
230
  }
231
- function X(t) {
232
- if (!ie(t))
231
+ function X(e) {
232
+ if (!ie(e))
233
233
  throw new Error("Parameter was not an error");
234
234
  }
235
- function ie(t) {
236
- return !!t && typeof t == "object" && xt(t) === "[object Error]" || t instanceof Error;
235
+ function ie(e) {
236
+ return !!e && typeof e == "object" && xt(e) === "[object Error]" || e instanceof Error;
237
237
  }
238
- function xt(t) {
239
- return Object.prototype.toString.call(t);
238
+ function xt(e) {
239
+ return Object.prototype.toString.call(e);
240
240
  }
241
241
  const yt = "Layerr";
242
242
  let gt = yt;
243
243
  function vt() {
244
244
  return gt;
245
245
  }
246
- function jt(t) {
246
+ function jt(e) {
247
247
  let n, s = "";
248
- if (t.length === 0)
248
+ if (e.length === 0)
249
249
  n = {};
250
- else if (ie(t[0]))
250
+ else if (ie(e[0]))
251
251
  n = {
252
- cause: t[0]
253
- }, s = t.slice(1).join(" ") || "";
254
- else if (t[0] && typeof t[0] == "object")
255
- n = Object.assign({}, t[0]), s = t.slice(1).join(" ") || "";
256
- else if (typeof t[0] == "string")
257
- n = {}, s = s = t.join(" ") || "";
252
+ cause: e[0]
253
+ }, s = e.slice(1).join(" ") || "";
254
+ else if (e[0] && typeof e[0] == "object")
255
+ n = Object.assign({}, e[0]), s = e.slice(1).join(" ") || "";
256
+ else if (typeof e[0] == "string")
257
+ n = {}, s = s = e.join(" ") || "";
258
258
  else
259
259
  throw new Error("Invalid arguments passed to Layerr");
260
260
  return {
@@ -262,13 +262,13 @@ function jt(t) {
262
262
  shortMessage: s
263
263
  };
264
264
  }
265
- class y extends Error {
265
+ class g extends Error {
266
266
  constructor(n, s) {
267
- const r = [...arguments], { options: o, shortMessage: l } = jt(r);
268
- let i = l;
269
- if (o.cause && (i = `${i}: ${o.cause.message}`), super(i), this.message = i, o.name && typeof o.name == "string" ? this.name = o.name : this.name = vt(), o.cause && Object.defineProperty(this, "_cause", { value: o.cause }), Object.defineProperty(this, "_info", { value: {} }), o.info && typeof o.info == "object" && Object.assign(this._info, o.info), Error.captureStackTrace) {
270
- const c = o.constructorOpt || this.constructor;
271
- Error.captureStackTrace(this, c);
267
+ const a = [...arguments], { options: r, shortMessage: i } = jt(a);
268
+ let l = i;
269
+ if (r.cause && (l = `${l}: ${r.cause.message}`), super(l), this.message = l, r.name && typeof r.name == "string" ? this.name = r.name : this.name = vt(), r.cause && Object.defineProperty(this, "_cause", { value: r.cause }), Object.defineProperty(this, "_info", { value: {} }), r.info && typeof r.info == "object" && Object.assign(this._info, r.info), Error.captureStackTrace) {
270
+ const u = r.constructorOpt || this.constructor;
271
+ Error.captureStackTrace(this, u);
272
272
  }
273
273
  }
274
274
  static cause(n) {
@@ -276,33 +276,33 @@ class y extends Error {
276
276
  }
277
277
  static fullStack(n) {
278
278
  X(n);
279
- const s = y.cause(n);
279
+ const s = g.cause(n);
280
280
  return s ? `${n.stack}
281
- caused by: ${y.fullStack(s)}` : n.stack ?? "";
281
+ caused by: ${g.fullStack(s)}` : n.stack ?? "";
282
282
  }
283
283
  static info(n) {
284
284
  X(n);
285
- const s = {}, r = y.cause(n);
286
- return r && Object.assign(s, y.info(r)), n._info && Object.assign(s, n._info), s;
285
+ const s = {}, a = g.cause(n);
286
+ return a && Object.assign(s, g.info(a)), n._info && Object.assign(s, n._info), s;
287
287
  }
288
288
  toString() {
289
289
  let n = this.name || this.constructor.name || this.constructor.prototype.name;
290
290
  return this.message && (n = `${n}: ${this.message}`), n;
291
291
  }
292
292
  }
293
- const Ee = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", F = 32, Ne = 281474976710655, bt = 10, Nt = 16, z = Object.freeze({
293
+ const Oe = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", F = 32, we = 281474976710655, bt = 10, Nt = 16, z = Object.freeze({
294
294
  source: "ulid"
295
295
  });
296
- function wt(t) {
296
+ function wt(e) {
297
297
  const n = St(), s = n && (n.crypto || n.msCrypto) || null;
298
298
  if (typeof (s == null ? void 0 : s.getRandomValues) == "function")
299
299
  return () => {
300
- const r = new Uint8Array(1);
301
- return s.getRandomValues(r), r[0] / 255;
300
+ const a = new Uint8Array(1);
301
+ return s.getRandomValues(a), a[0] / 255;
302
302
  };
303
303
  if (typeof (s == null ? void 0 : s.randomBytes) == "function")
304
304
  return () => s.randomBytes(1).readUInt8() / 255;
305
- throw new y({
305
+ throw new g({
306
306
  info: {
307
307
  code: "PRNG_DETECT",
308
308
  ...z
@@ -312,283 +312,283 @@ function wt(t) {
312
312
  function St() {
313
313
  return Tt() ? self : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : null;
314
314
  }
315
- function Ct(t, n) {
315
+ function Ct(e, n) {
316
316
  let s = "";
317
- for (; t > 0; t--)
317
+ for (; e > 0; e--)
318
318
  s = Et(n) + s;
319
319
  return s;
320
320
  }
321
- function $t(t, n) {
322
- if (isNaN(t))
323
- throw new y({
321
+ function $t(e, n) {
322
+ if (isNaN(e))
323
+ throw new g({
324
324
  info: {
325
325
  code: "ENC_TIME_NAN",
326
326
  ...z
327
327
  }
328
- }, `Time must be a number: ${t}`);
329
- if (t > Ne)
330
- throw new y({
328
+ }, `Time must be a number: ${e}`);
329
+ if (e > we)
330
+ throw new g({
331
331
  info: {
332
332
  code: "ENC_TIME_SIZE_EXCEED",
333
333
  ...z
334
334
  }
335
- }, `Cannot encode a time larger than ${Ne}: ${t}`);
336
- if (t < 0)
337
- throw new y({
335
+ }, `Cannot encode a time larger than ${we}: ${e}`);
336
+ if (e < 0)
337
+ throw new g({
338
338
  info: {
339
339
  code: "ENC_TIME_NEG",
340
340
  ...z
341
341
  }
342
- }, `Time must be positive: ${t}`);
343
- if (Number.isInteger(t) === !1)
344
- throw new y({
342
+ }, `Time must be positive: ${e}`);
343
+ if (Number.isInteger(e) === !1)
344
+ throw new g({
345
345
  info: {
346
346
  code: "ENC_TIME_TYPE",
347
347
  ...z
348
348
  }
349
- }, `Time must be an integer: ${t}`);
350
- let s, r = "";
351
- for (let o = n; o > 0; o--)
352
- s = t % F, r = Ee.charAt(s) + r, t = (t - s) / F;
353
- return r;
349
+ }, `Time must be an integer: ${e}`);
350
+ let s, a = "";
351
+ for (let r = n; r > 0; r--)
352
+ s = e % F, a = Oe.charAt(s) + a, e = (e - s) / F;
353
+ return a;
354
354
  }
355
355
  function Tt() {
356
356
  return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope;
357
357
  }
358
- function Et(t) {
359
- let n = Math.floor(t() * F);
360
- return n === F && (n = F - 1), Ee.charAt(n);
358
+ function Et(e) {
359
+ let n = Math.floor(e() * F);
360
+ return n === F && (n = F - 1), Oe.charAt(n);
361
361
  }
362
- function Pt(t, n) {
363
- const s = wt(), r = isNaN(t) ? Date.now() : t;
364
- return $t(r, bt) + Ct(Nt, s);
362
+ function Ot(e, n) {
363
+ const s = wt(), a = isNaN(e) ? Date.now() : e;
364
+ return $t(a, bt) + Ct(Nt, s);
365
365
  }
366
366
  let Y, ee;
367
- const Ot = async (t) => {
368
- t && typeof t == "object" && "type" in t && t.type === "file" && "input" in t && typeof t.input == "function" && (t.input = await t.input());
369
- }, te = (t) => {
367
+ const Pt = async (e) => {
368
+ e && typeof e == "object" && "type" in e && e.type === "file" && "input" in e && typeof e.input == "function" && (e.input = await e.input());
369
+ }, te = (e) => {
370
370
  var n;
371
- if ((n = t.errors) != null && n[0])
372
- throw new Be(t.errors[0].message, {
371
+ if ((n = e.errors) != null && n[0])
372
+ throw new Be(e.errors[0].message, {
373
373
  developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
374
374
  });
375
375
  };
376
- var T, O, N, Q;
377
- class _t {
376
+ var T, P, N, Q;
377
+ class kt {
378
378
  constructor(n) {
379
379
  R(this, T);
380
- R(this, O, /* @__PURE__ */ new Map());
380
+ R(this, P, /* @__PURE__ */ new Map());
381
381
  R(this, N);
382
382
  R(this, Q, () => import("./createServer-69sLlmQA.js").then((n) => n.createServer()));
383
383
  W(this, "fetch", async (n, ...[s]) => {
384
- var l;
385
- const r = (l = n.match(/query (\w+)/)) == null ? void 0 : l[1];
386
- await Ot(s);
387
- const o = JSON.stringify({ query: n, variables: s, operationName: r });
388
- switch (x(this, T)) {
384
+ var i;
385
+ const a = (i = n.match(/query (\w+)/)) == null ? void 0 : i[1];
386
+ await Pt(s);
387
+ const r = JSON.stringify({ query: n, variables: s, operationName: a });
388
+ switch (y(this, T)) {
389
389
  case "remote": {
390
- const i = await fetch(this.config.server, {
390
+ const l = await fetch(this.config.server, {
391
391
  method: "POST",
392
- body: o,
392
+ body: r,
393
393
  headers: { "Content-Type": "application/json" }
394
394
  });
395
- if (!i.ok)
395
+ if (!l.ok)
396
396
  throw new Error("Network response was not ok");
397
- const c = await i.json();
398
- return te(c), c.data;
397
+ const u = await l.json();
398
+ return te(u), u.data;
399
399
  }
400
400
  case "in-memory": {
401
- Y || (Y = x(this, Q).call(this));
402
- const i = await Y;
403
- if (!i) throw new Error("Local server not initialized");
404
- const c = await i.fetch(
401
+ Y || (Y = y(this, Q).call(this));
402
+ const l = await Y;
403
+ if (!l) throw new Error("Local server not initialized");
404
+ const u = await l.fetch(
405
405
  new Request("http://localhost/graphql", {
406
406
  method: "POST",
407
- body: o,
407
+ body: r,
408
408
  headers: { "Content-Type": "application/json" }
409
409
  })
410
410
  );
411
- if (!c.ok)
411
+ if (!u.ok)
412
412
  throw new Error("Network response was not ok");
413
- const u = await c.json();
414
- return te(u), u.data;
413
+ const d = await u.json();
414
+ return te(d), d.data;
415
415
  }
416
416
  case "worker": {
417
- if (ee || (ee = Ge()), !x(this, N)) {
418
- const d = new MessageChannel();
419
- ee.port.postMessage({ port: d.port2 }, [d.port2]), M(this, N, d.port1), x(this, N).onmessage = (h) => {
420
- const { id: g, body: j } = h.data, b = x(this, O).get(g);
417
+ if (ee || (ee = Ge()), !y(this, N)) {
418
+ const c = new MessageChannel();
419
+ ee.port.postMessage({ port: c.port2 }, [c.port2]), M(this, N, c.port1), y(this, N).onmessage = (f) => {
420
+ const { id: h, body: j } = f.data, b = y(this, P).get(h);
421
421
  if (b) {
422
422
  const w = JSON.parse(j);
423
- b(w), x(this, O).delete(g);
423
+ b(w), y(this, P).delete(h);
424
424
  } else
425
- console.error(`No pending request found for id: ${g}`);
426
- }, x(this, N).start();
425
+ console.error(`No pending request found for id: ${h}`);
426
+ }, y(this, N).start();
427
427
  }
428
- const i = Pt(), u = await new Promise(
429
- (d) => {
430
- x(this, O).set(i, d), x(this, N).postMessage({ id: i, body: o });
428
+ const l = Ot(), d = await new Promise(
429
+ (c) => {
430
+ y(this, P).set(l, c), y(this, N).postMessage({ id: l, body: r });
431
431
  }
432
432
  );
433
- return te(u), u.data;
433
+ return te(d), d.data;
434
434
  }
435
435
  }
436
436
  });
437
437
  this.config = n, n.server ? M(this, T, "remote") : n.inMemory || typeof SharedWorker > "u" ? M(this, T, "in-memory") : M(this, T, "worker");
438
438
  }
439
439
  }
440
- T = new WeakMap(), O = new WeakMap(), N = new WeakMap(), Q = new WeakMap();
441
- const ne = (t) => Math.abs(
442
- isNaN(parseInt(t)) ? t.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(t)) ? 0 : parseInt(t)
443
- ), se = (t) => t.length > 1 ? parseInt(t.split("").reduce((n, s) => `${ne(n) + ne(s)}`)) : ne(t), kt = (t, n = {}) => {
444
- const s = (3 * se(t) + 2 * se(t) + se(t)) % 360, { saturation: r = 75, lightness: o = 60 } = n;
445
- return `${s}deg ${r}% ${o}%`;
446
- }, re = "data-linked-param", It = (t) => {
440
+ T = new WeakMap(), P = new WeakMap(), N = new WeakMap(), Q = new WeakMap();
441
+ const ne = (e) => Math.abs(
442
+ isNaN(parseInt(e)) ? e.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(e)) ? 0 : parseInt(e)
443
+ ), se = (e) => e.length > 1 ? parseInt(e.split("").reduce((n, s) => `${ne(n) + ne(s)}`)) : ne(e), _t = (e, n = {}) => {
444
+ const s = (3 * se(e) + 2 * se(e) + se(e)) % 360, { saturation: a = 75, lightness: r = 60 } = n;
445
+ return `${s}deg ${a}% ${r}%`;
446
+ }, re = "data-linked-param", It = (e) => {
447
447
  const { resolvedTheme: n } = ot();
448
- return kt(
449
- t,
448
+ return _t(
449
+ e,
450
450
  n === "light" ? { saturation: 85, lightness: 50 } : void 0
451
451
  );
452
452
  }, Pe = ({
453
- name: t,
453
+ name: e,
454
454
  className: n,
455
455
  backgroundOpacity: s = "100%",
456
- borderOpacity: r = "100%",
457
- slug: o,
458
- children: l,
459
- onClick: i
456
+ borderOpacity: a = "100%",
457
+ slug: r,
458
+ children: i,
459
+ onClick: l
460
460
  }) => {
461
- const c = Ce(null), u = t.replace(/[{}]/g, ""), d = o == null ? void 0 : o.replace(/[{}]/g, ""), h = It(u), g = `hsl(${h} / ${r})`, j = `hsl(${h} / ${s})`;
462
- return $e(() => {
463
- if (!d || !c.current) return;
461
+ const u = $e(null), d = e.replace(/[{}]/g, ""), c = r == null ? void 0 : r.replace(/[{}]/g, ""), f = It(d), h = `hsl(${f} / ${a})`, j = `hsl(${f} / ${s})`;
462
+ return Te(() => {
463
+ if (!c || !u.current) return;
464
464
  const b = () => {
465
- document.querySelectorAll(`[${re}="${d}"]`).forEach((S) => {
465
+ document.querySelectorAll(`[${re}="${c}"]`).forEach((S) => {
466
466
  S instanceof HTMLElement && (S.dataset.active = "true");
467
467
  });
468
468
  }, w = () => {
469
- document.querySelectorAll(`[${re}="${d}"]`).forEach((S) => {
469
+ document.querySelectorAll(`[${re}="${c}"]`).forEach((S) => {
470
470
  S instanceof HTMLElement && (S.dataset.active = "false");
471
471
  });
472
- }, v = c.current;
472
+ }, v = u.current;
473
473
  return v.addEventListener("mouseenter", b), v.addEventListener("mouseleave", w), () => {
474
474
  v.removeEventListener("mouseenter", b), v.removeEventListener("mouseleave", w);
475
475
  };
476
- }, [d]), /* @__PURE__ */ e.jsx(
476
+ }, [c]), /* @__PURE__ */ t.jsx(
477
477
  "span",
478
478
  {
479
- [re]: d,
480
- className: P(
479
+ [re]: c,
480
+ className: O(
481
481
  "relative after:rounded after:absolute after:inset-0 after:-bottom-0.5 after:border-b-2 after:transition-opacity after:duration-200",
482
482
  "after:pointer-events-none after:border-[--border-color] after:opacity-30 after:data-[active=true]:opacity-100",
483
483
  n
484
484
  ),
485
485
  suppressHydrationWarning: !0,
486
- ref: c,
487
- onClick: i,
486
+ ref: u,
487
+ onClick: l,
488
488
  style: {
489
- "--border-color": g,
489
+ "--border-color": h,
490
490
  "--background-color": j
491
491
  },
492
- children: l ?? t
492
+ children: i ?? e
493
493
  }
494
494
  );
495
- }, qt = (t, n, s) => {
496
- const r = n.replace(/(:\w+|\{\w+})/g, (l) => {
497
- var u;
498
- const i = l.replace(/[:{}]/g, "");
499
- return ((u = s.pathParams.find((d) => d.name === i)) == null ? void 0 : u.value) ?? l;
500
- }), o = new URL(
501
- r.replace(/^\//, ""),
502
- t.endsWith("/") ? t : `${t}/`
495
+ }, qt = (e, n, s) => {
496
+ const a = n.replace(/(:\w+|\{\w+})/g, (i) => {
497
+ var d;
498
+ const l = i.replace(/[:{}]/g, "");
499
+ return ((d = s.pathParams.find((c) => c.name === l)) == null ? void 0 : d.value) ?? i;
500
+ }), r = new URL(
501
+ a.replace(/^\//, ""),
502
+ e.endsWith("/") ? e : `${e}/`
503
503
  );
504
- return s.queryParams.filter((l) => l.active).forEach((l) => {
505
- o.searchParams.set(l.name, l.value);
506
- }), o;
504
+ return s.queryParams.filter((i) => i.active).forEach((i) => {
505
+ r.searchParams.set(i.name, i.value);
506
+ }), r;
507
507
  }, Rt = ({
508
- control: t,
508
+ control: e,
509
509
  register: n
510
510
  }) => {
511
- const { fields: s, append: r, remove: o } = oe({
512
- control: t,
511
+ const { fields: s, append: a, remove: r } = oe({
512
+ control: e,
513
513
  name: "headers"
514
514
  });
515
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
516
- /* @__PURE__ */ e.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: s.map((l, i) => /* @__PURE__ */ e.jsxs(
515
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
516
+ /* @__PURE__ */ t.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ t.jsx("tbody", { children: s.map((i, l) => /* @__PURE__ */ t.jsxs(
517
517
  "tr",
518
518
  {
519
519
  className: "group has-[:focus]:bg-muted/50 hover:bg-muted/50",
520
520
  children: [
521
- /* @__PURE__ */ e.jsx("td", { className: "flex gap-2 items-center", children: /* @__PURE__ */ e.jsx(
521
+ /* @__PURE__ */ t.jsx("td", { className: "flex gap-2 items-center", children: /* @__PURE__ */ t.jsx(
522
522
  H,
523
523
  {
524
- ...n(`headers.${i}.name`),
524
+ ...n(`headers.${l}.name`),
525
525
  placeholder: "Name",
526
526
  className: "border-0 shadow-none text-xs font-mono",
527
527
  autoComplete: "off"
528
528
  }
529
529
  ) }),
530
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
531
- /* @__PURE__ */ e.jsx(
530
+ /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
531
+ /* @__PURE__ */ t.jsx(
532
532
  H,
533
533
  {
534
534
  placeholder: "Value",
535
535
  className: "border-0 shadow-none text-xs font-mono",
536
- ...n(`headers.${i}.value`),
536
+ ...n(`headers.${l}.value`),
537
537
  autoComplete: "off"
538
538
  }
539
539
  ),
540
- /* @__PURE__ */ e.jsx(
540
+ /* @__PURE__ */ t.jsx(
541
541
  E,
542
542
  {
543
543
  size: "icon",
544
544
  variant: "ghost",
545
545
  className: "text-muted-foreground opacity-0 group-hover:opacity-100",
546
546
  onClick: () => {
547
- o(i);
547
+ r(l);
548
548
  },
549
549
  type: "button",
550
- children: /* @__PURE__ */ e.jsx(Ve, { size: 16 })
550
+ children: /* @__PURE__ */ t.jsx(Ve, { size: 16 })
551
551
  }
552
552
  )
553
553
  ] }) })
554
554
  ]
555
555
  },
556
- l.id
556
+ i.id
557
557
  )) }) }),
558
- /* @__PURE__ */ e.jsx("div", { className: "text-end", children: /* @__PURE__ */ e.jsx(
558
+ /* @__PURE__ */ t.jsx("div", { className: "text-end", children: /* @__PURE__ */ t.jsx(
559
559
  E,
560
560
  {
561
561
  className: "",
562
- onClick: () => r({ name: "", value: "" }),
562
+ onClick: () => a({ name: "", value: "" }),
563
563
  type: "button",
564
564
  children: "Add header"
565
565
  }
566
566
  ) })
567
567
  ] });
568
568
  }, Mt = ({
569
- control: t
569
+ control: e
570
570
  }) => {
571
571
  const { fields: n } = oe({
572
- control: t,
572
+ control: e,
573
573
  name: "pathParams"
574
574
  });
575
- return /* @__PURE__ */ e.jsx("table", { className: "w-full table-auto [&_td]:border [&_td]:py-1 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: n.map((s, r) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
576
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsx(
575
+ return /* @__PURE__ */ t.jsx("table", { className: "w-full table-auto [&_td]:border [&_td]:py-1 [&_td]:px-2", children: /* @__PURE__ */ t.jsx("tbody", { children: n.map((s, a) => /* @__PURE__ */ t.jsxs("tr", { className: "hover:bg-accent/40", children: [
576
+ /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx(
577
577
  $,
578
578
  {
579
- control: t,
580
- name: `pathParams.${r}.value`,
581
- render: ({ field: o }) => /* @__PURE__ */ e.jsxs("div", { children: [
582
- /* @__PURE__ */ e.jsx(
579
+ control: e,
580
+ name: `pathParams.${a}.value`,
581
+ render: ({ field: r }) => /* @__PURE__ */ t.jsxs("div", { children: [
582
+ /* @__PURE__ */ t.jsx(
583
583
  Pe,
584
584
  {
585
585
  slug: s.name,
586
586
  name: s.name,
587
587
  backgroundOpacity: "25%",
588
- borderOpacity: o.value ? "100%" : "0",
589
- className: P(
588
+ borderOpacity: r.value ? "100%" : "0",
589
+ className: O(
590
590
  "font-mono text-xs m-2",
591
- !o.value && "opacity-60"
591
+ !r.value && "opacity-60"
592
592
  )
593
593
  }
594
594
  ),
@@ -596,16 +596,16 @@ const ne = (t) => Math.abs(
596
596
  ] })
597
597
  }
598
598
  ) }),
599
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
600
- /* @__PURE__ */ e.jsx(
599
+ /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
600
+ /* @__PURE__ */ t.jsx(
601
601
  $,
602
602
  {
603
- control: t,
604
- name: `pathParams.${r}.value`,
605
- render: ({ field: o }) => /* @__PURE__ */ e.jsx(
603
+ control: e,
604
+ name: `pathParams.${a}.value`,
605
+ render: ({ field: r }) => /* @__PURE__ */ t.jsx(
606
606
  H,
607
607
  {
608
- ...o,
608
+ ...r,
609
609
  required: !0,
610
610
  placeholder: "Enter value",
611
611
  className: "border-0 shadow-none ring-0 font-mono text-xs"
@@ -613,166 +613,166 @@ const ne = (t) => Math.abs(
613
613
  )
614
614
  }
615
615
  ),
616
- /* @__PURE__ */ e.jsx(
616
+ /* @__PURE__ */ t.jsx(
617
617
  $,
618
618
  {
619
- control: t,
620
- name: `pathParams.${r}.value`,
621
- render: ({ field: o }) => /* @__PURE__ */ e.jsx(
619
+ control: e,
620
+ name: `pathParams.${a}.value`,
621
+ render: ({ field: r }) => /* @__PURE__ */ t.jsx(
622
622
  E,
623
623
  {
624
624
  size: "icon",
625
625
  type: "button",
626
626
  variant: "ghost",
627
627
  "aria-label": "Clear value",
628
- className: P(
628
+ className: O(
629
629
  "ms-2",
630
- o.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
630
+ r.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
631
631
  ),
632
632
  title: "Clear value",
633
- onClick: () => o.onChange(""),
634
- children: /* @__PURE__ */ e.jsx(Se, { size: 16 })
633
+ onClick: () => r.onChange(""),
634
+ children: /* @__PURE__ */ t.jsx(Ce, { size: 16 })
635
635
  }
636
636
  )
637
637
  }
638
638
  )
639
639
  ] }) })
640
640
  ] }, s.id)) }) });
641
- }, At = (t, n) => {
642
- const s = he.forwardRef(({ className: r, asChild: o, ...l }, i) => {
643
- const c = o ? lt : t;
644
- return he.createElement(c, {
645
- ...l,
646
- ref: i,
647
- className: P(n, r)
641
+ }, At = (e, n) => {
642
+ const s = fe.forwardRef(({ className: a, asChild: r, ...i }, l) => {
643
+ const u = r ? lt : e;
644
+ return fe.createElement(u, {
645
+ ...i,
646
+ ref: l,
647
+ className: O(n, a)
648
648
  });
649
649
  });
650
- return s.displayName = `VariantComponent(${t})`, s;
650
+ return s.displayName = `VariantComponent(${e})`, s;
651
651
  }, Vt = At(
652
652
  "input",
653
653
  "px-2 bg-transparent h-6 font-mono text-xs m-2"
654
654
  ), zt = ({
655
- control: t,
655
+ control: e,
656
656
  queryParams: n
657
657
  }) => {
658
658
  const { fields: s } = oe({
659
- control: t,
659
+ control: e,
660
660
  name: "queryParams"
661
- }), r = Xe(), o = n.map((c) => !!c.isRequired), i = r.watch("identity") !== J;
662
- return /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: s.filter(
661
+ }), a = Xe(), r = n.map((u) => !!u.isRequired), l = a.watch("identity") !== J;
662
+ return /* @__PURE__ */ t.jsx("div", { className: "", children: /* @__PURE__ */ t.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ t.jsx("tbody", { children: s.filter(
663
663
  // TODO remove this hack for Accu or make it more generic
664
- (c) => !(i && c.name === "apikey")
665
- ).map((c, u) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
666
- /* @__PURE__ */ e.jsx("td", { className: "text-center", children: /* @__PURE__ */ e.jsx(
664
+ (u) => !(l && u.name === "apikey")
665
+ ).map((u, d) => /* @__PURE__ */ t.jsxs("tr", { className: "hover:bg-accent/40", children: [
666
+ /* @__PURE__ */ t.jsx("td", { className: "text-center", children: /* @__PURE__ */ t.jsx(
667
667
  $,
668
668
  {
669
- control: t,
670
- name: `queryParams.${u}.active`,
671
- render: ({ field: d }) => /* @__PURE__ */ e.jsx(
669
+ control: e,
670
+ name: `queryParams.${d}.active`,
671
+ render: ({ field: c }) => /* @__PURE__ */ t.jsx(
672
672
  "input",
673
673
  {
674
674
  type: "checkbox",
675
- id: `queryParams.${u}.active`,
676
- checked: d.value,
677
- onChange: d.onChange
675
+ id: `queryParams.${d}.active`,
676
+ checked: c.value,
677
+ onChange: c.onChange
678
678
  }
679
679
  )
680
680
  }
681
681
  ) }),
682
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsx(
682
+ /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx(
683
683
  $,
684
684
  {
685
- control: t,
686
- render: ({ field: d }) => /* @__PURE__ */ e.jsx(Vt, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
685
+ control: e,
686
+ render: ({ field: c }) => /* @__PURE__ */ t.jsx(Vt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
687
687
  "label",
688
688
  {
689
689
  className: "flex items-center cursor-pointer",
690
- htmlFor: `queryParams.${u}.active`,
691
- title: o[u] ? "Required field" : void 0,
690
+ htmlFor: `queryParams.${d}.active`,
691
+ title: r[d] ? "Required field" : void 0,
692
692
  children: [
693
- d.value,
694
- o[u] && /* @__PURE__ */ e.jsx("sup", { children: " *" })
693
+ c.value,
694
+ r[d] && /* @__PURE__ */ t.jsx("sup", { children: " *" })
695
695
  ]
696
696
  }
697
697
  ) }),
698
- name: `queryParams.${u}.name`
698
+ name: `queryParams.${d}.name`
699
699
  }
700
700
  ) }),
701
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
702
- /* @__PURE__ */ e.jsx(
701
+ /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
702
+ /* @__PURE__ */ t.jsx(
703
703
  $,
704
704
  {
705
- control: t,
706
- render: ({ field: d }) => /* @__PURE__ */ e.jsx(
705
+ control: e,
706
+ render: ({ field: c }) => /* @__PURE__ */ t.jsx(
707
707
  H,
708
708
  {
709
- ...d,
710
- onChange: (h) => {
711
- d.onChange(h.target.value), h.target.value.length > 0 && r.setValue(`queryParams.${u}.active`, !0);
709
+ ...c,
710
+ onChange: (f) => {
711
+ c.onChange(f.target.value), f.target.value.length > 0 && a.setValue(`queryParams.${d}.active`, !0);
712
712
  },
713
713
  placeholder: "Enter value",
714
714
  className: "w-full border-0 shadow-none text-xs font-mono"
715
715
  }
716
716
  ),
717
- name: `queryParams.${u}.value`
717
+ name: `queryParams.${d}.value`
718
718
  }
719
719
  ),
720
- /* @__PURE__ */ e.jsx(
720
+ /* @__PURE__ */ t.jsx(
721
721
  $,
722
722
  {
723
- control: t,
724
- render: ({ field: d }) => /* @__PURE__ */ e.jsx(
723
+ control: e,
724
+ render: ({ field: c }) => /* @__PURE__ */ t.jsx(
725
725
  E,
726
726
  {
727
727
  size: "icon",
728
728
  type: "button",
729
729
  variant: "ghost",
730
730
  "aria-label": "Clear value",
731
- className: P(
731
+ className: O(
732
732
  "ms-2",
733
- d.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
733
+ c.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
734
734
  ),
735
735
  title: "Clear value",
736
- onClick: () => d.onChange(""),
737
- children: /* @__PURE__ */ e.jsx(Se, { size: 16 })
736
+ onClick: () => c.onChange(""),
737
+ children: /* @__PURE__ */ t.jsx(Ce, { size: 16 })
738
738
  }
739
739
  ),
740
- name: `queryParams.${u}.value`
740
+ name: `queryParams.${d}.value`
741
741
  }
742
742
  )
743
743
  ] }) })
744
- ] }, c.id)) }) }) });
744
+ ] }, u.id)) }) }) });
745
745
  }, Ft = ({
746
- value: t,
746
+ value: e,
747
747
  onChange: n,
748
748
  className: s,
749
- options: r,
750
- showChevrons: o = !0
751
- }) => /* @__PURE__ */ e.jsxs("div", { className: "grid", children: [
752
- /* @__PURE__ */ e.jsx(
749
+ options: a,
750
+ showChevrons: r = !0
751
+ }) => /* @__PURE__ */ t.jsxs("div", { className: "grid", children: [
752
+ /* @__PURE__ */ t.jsx(
753
753
  "select",
754
754
  {
755
- className: P(
755
+ className: O(
756
756
  "row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
757
757
  "rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
758
758
  s
759
759
  ),
760
- value: t,
760
+ value: e,
761
761
  onChange: n,
762
- children: r.map((l) => /* @__PURE__ */ e.jsx("option", { value: l.value, children: l.label }, l.value))
762
+ children: a.map((i) => /* @__PURE__ */ t.jsx("option", { value: i.value, children: i.label }, i.value))
763
763
  }
764
764
  ),
765
- /* @__PURE__ */ e.jsx(
765
+ /* @__PURE__ */ t.jsx(
766
766
  "div",
767
767
  {
768
- className: P(
769
- !o && "hidden",
768
+ className: O(
769
+ !r && "hidden",
770
770
  "row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none"
771
771
  ),
772
- children: /* @__PURE__ */ e.jsx(ze, { size: 14 })
772
+ children: /* @__PURE__ */ t.jsx(ze, { size: 14 })
773
773
  }
774
774
  )
775
- ] }), Lt = (t) => {
775
+ ] }), Lt = (e) => {
776
776
  var s;
777
777
  return (s = Object.entries({
778
778
  "application/json": "json",
@@ -783,39 +783,39 @@ const ne = (t) => Math.abs(
783
783
  "application/xml": "xml",
784
784
  "application/xhtml+xml": "xhtml"
785
785
  }).find(
786
- ([r]) => t.includes(r)
786
+ ([a]) => e.includes(a)
787
787
  )) == null ? void 0 : s[1];
788
- }, Dt = (t) => {
789
- const n = t.get("Content-Type") || "";
788
+ }, Dt = (e) => {
789
+ const n = e.get("Content-Type") || "";
790
790
  return Lt(n);
791
- }, Gt = (t) => {
791
+ }, Gt = (e) => {
792
792
  try {
793
- return JSON.stringify(JSON.parse(t), null, 2);
793
+ return JSON.stringify(JSON.parse(e), null, 2);
794
794
  } catch {
795
795
  return null;
796
796
  }
797
797
  }, Bt = ({
798
- body: t = "",
798
+ body: e = "",
799
799
  headers: n
800
800
  }) => {
801
- const s = Dt(n), r = Gt(t), o = r || t, [l, i] = Te(
802
- r ? "formatted" : "raw"
801
+ const s = Dt(n), a = Gt(e), r = a || e, [i, l] = Ee(
802
+ a ? "formatted" : "raw"
803
803
  );
804
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
805
- /* @__PURE__ */ e.jsx(ae, { className: "shadow-none", children: /* @__PURE__ */ e.jsx(
804
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
805
+ /* @__PURE__ */ t.jsx(ae, { className: "shadow-none", children: /* @__PURE__ */ t.jsx(
806
806
  it,
807
807
  {
808
- language: l === "raw" ? r ? "plain" : s : "json",
808
+ language: i === "raw" ? a ? "plain" : s : "json",
809
809
  noBackground: !0,
810
810
  className: "overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]",
811
- code: l === "raw" ? t : o
811
+ code: i === "raw" ? e : r
812
812
  }
813
813
  ) }),
814
- r && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
814
+ a && /* @__PURE__ */ t.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ t.jsx(
815
815
  Ft,
816
816
  {
817
- value: l,
818
- onChange: (c) => i(c.target.value),
817
+ value: i,
818
+ onChange: (u) => l(u.target.value),
819
819
  options: [
820
820
  { value: "formatted", label: "Formatted" },
821
821
  { value: "raw", label: "Raw" }
@@ -835,56 +835,56 @@ const ne = (t) => Math.abs(
835
835
  405: "Method Not Allowed",
836
836
  500: "Internal Server Error"
837
837
  }, Ht = ({
838
- server: t,
838
+ server: e,
839
839
  servers: n,
840
840
  url: s,
841
- method: r,
842
- headers: o = [],
843
- queryParams: l = [],
844
- pathParams: i = [],
845
- defaultBody: c = ""
841
+ method: a,
842
+ headers: r = [],
843
+ queryParams: i = [],
844
+ pathParams: l = [],
845
+ defaultBody: u = ""
846
846
  }) => {
847
847
  var de, ue;
848
- const { selectedServer: u, setSelectedServer: d } = tt(), [, h] = He(), { register: g, control: j, handleSubmit: b, watch: w, setValue: v, ...S } = Ye({
848
+ const { selectedServer: d, setSelectedServer: c } = tt(), [, f] = He(), { register: h, control: j, handleSubmit: b, watch: w, setValue: v, ...S } = Ye({
849
849
  defaultValues: {
850
- body: c,
851
- queryParams: l.map((a) => ({
852
- name: a.name,
853
- value: a.defaultValue ?? "",
854
- active: a.defaultActive ?? !1
850
+ body: u,
851
+ queryParams: i.map((o) => ({
852
+ name: o.name,
853
+ value: o.defaultValue ?? "",
854
+ active: o.defaultActive ?? !1
855
855
  })),
856
- pathParams: i.map((a) => ({
857
- name: a.name,
858
- value: a.defaultValue ?? ""
856
+ pathParams: l.map((o) => ({
857
+ name: o.name,
858
+ value: o.defaultValue ?? ""
859
859
  })),
860
- headers: o.map((a) => ({
861
- name: a.name,
862
- value: a.defaultValue ?? ""
860
+ headers: r.map((o) => ({
861
+ name: o.name,
862
+ value: o.defaultValue ?? ""
863
863
  })),
864
864
  identity: J
865
865
  }
866
- }), C = w(), _ = Re(), le = Ce(!1);
867
- $e(() => {
868
- var f;
866
+ }), C = w(), k = Me(), le = $e(!1);
867
+ Te(() => {
868
+ var x;
869
869
  if (le.current) return;
870
- const a = (f = _.data) == null ? void 0 : f.at(0);
871
- a && (v("identity", a.id), le.current = !0);
872
- }, [v, _.data]);
870
+ const o = (x = k.data) == null ? void 0 : x.at(0);
871
+ o && (v("identity", o.id), le.current = !0);
872
+ }, [v, k.data]);
873
873
  const p = Ke({
874
- mutationFn: async (a) => {
874
+ mutationFn: async (o) => {
875
875
  var I, q;
876
- const f = qt(u ?? t, s, a), k = performance.now(), D = new Request(f, {
877
- method: r.toUpperCase(),
876
+ const x = qt(d ?? e, s, o), _ = performance.now(), D = new Request(x, {
877
+ method: a.toUpperCase(),
878
878
  headers: Object.fromEntries(
879
- a.headers.filter((m) => m.name).map((m) => [m.name, m.value])
879
+ o.headers.filter((m) => m.name).map((m) => [m.name, m.value])
880
880
  ),
881
- body: a.body ? a.body : void 0
881
+ body: o.body ? o.body : void 0
882
882
  });
883
- a.identity !== J && ((q = (I = _.data) == null ? void 0 : I.find((m) => m.id === a.identity)) == null || q.authorizeRequest(D));
883
+ o.identity !== J && ((q = (I = k.data) == null ? void 0 : I.find((m) => m.id === o.identity)) == null || q.authorizeRequest(D));
884
884
  try {
885
885
  const m = await fetch(D, {
886
886
  signal: AbortSignal.timeout(5e3)
887
- }), G = performance.now() - k, B = await m.text();
887
+ }), G = performance.now() - _, B = await m.text();
888
888
  return {
889
889
  status: m.status,
890
890
  headers: m.headers,
@@ -898,126 +898,126 @@ const ne = (t) => Math.abs(
898
898
  ) : m;
899
899
  }
900
900
  }
901
- }), Oe = s.split("/").map((a, f, k) => {
901
+ }), ke = s.split("/").map((o, x, _) => {
902
902
  var G;
903
- const D = a.startsWith("{") && a.endsWith("}") || a.startsWith(":"), I = a.replace(/[:{}]/g, ""), q = (G = C.pathParams.find((B) => B.name === I)) == null ? void 0 : G.value, m = q ? /* @__PURE__ */ e.jsx(Pe, { backgroundOpacity: "25%", name: a, slug: a, children: encodeURIComponent(q) }) : /* @__PURE__ */ e.jsx(
903
+ const D = o.startsWith("{") && o.endsWith("}") || o.startsWith(":"), I = o.replace(/[:{}]/g, ""), q = (G = C.pathParams.find((B) => B.name === I)) == null ? void 0 : G.value, m = q ? /* @__PURE__ */ t.jsx(Pe, { backgroundOpacity: "25%", name: o, slug: o, children: encodeURIComponent(q) }) : /* @__PURE__ */ t.jsx(
904
904
  "span",
905
905
  {
906
906
  className: "underline decoration-wavy decoration-red-500",
907
907
  title: `Missing value for path parameter \`${I}\``,
908
- children: a
908
+ children: o
909
909
  }
910
910
  );
911
911
  return (
912
912
  // eslint-disable-next-line react/no-array-index-key
913
- /* @__PURE__ */ e.jsxs(Z, { children: [
914
- D ? m : a,
915
- f < k.length - 1 && "/",
916
- /* @__PURE__ */ e.jsx("wbr", {})
917
- ] }, a + f)
913
+ /* @__PURE__ */ t.jsxs(Z, { children: [
914
+ D ? m : o,
915
+ x < _.length - 1 && "/",
916
+ /* @__PURE__ */ t.jsx("wbr", {})
917
+ ] }, o + x)
918
918
  );
919
- }), U = Array.from(((de = p.data) == null ? void 0 : de.headers.entries()) ?? []), ce = C.queryParams.filter((a) => a.active).map((a, f, k) => /* @__PURE__ */ e.jsxs(Z, { children: [
920
- a.name,
919
+ }), U = Array.from(((de = p.data) == null ? void 0 : de.headers.entries()) ?? []), ce = C.queryParams.filter((o) => o.active).map((o, x, _) => /* @__PURE__ */ t.jsxs(Z, { children: [
920
+ o.name,
921
921
  "=",
922
- encodeURIComponent(a.value).replaceAll("%20", "+"),
923
- f < k.length - 1 && "&",
924
- /* @__PURE__ */ e.jsx("wbr", {})
925
- ] }, a.name)), _e = /* @__PURE__ */ e.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: n && n.length > 1 ? /* @__PURE__ */ e.jsxs(
926
- fe,
922
+ encodeURIComponent(o.value).replaceAll("%20", "+"),
923
+ x < _.length - 1 && "&",
924
+ /* @__PURE__ */ t.jsx("wbr", {})
925
+ ] }, o.name)), _e = /* @__PURE__ */ t.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: n && n.length > 1 ? /* @__PURE__ */ t.jsxs(
926
+ xe,
927
927
  {
928
- onValueChange: (a) => {
929
- h(() => {
930
- d(a);
928
+ onValueChange: (o) => {
929
+ f(() => {
930
+ c(o);
931
931
  });
932
932
  },
933
- value: u,
933
+ value: d,
934
934
  children: [
935
- /* @__PURE__ */ e.jsx(xe, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ e.jsx(ye, {}) }),
936
- /* @__PURE__ */ e.jsx(ge, { children: n.map((a) => /* @__PURE__ */ e.jsx(K, { value: a, children: a.replace(/^https?:\/\//, "") }, a)) })
935
+ /* @__PURE__ */ t.jsx(ye, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ t.jsx(ge, {}) }),
936
+ /* @__PURE__ */ t.jsx(ve, { children: n.map((o) => /* @__PURE__ */ t.jsx(K, { value: o, children: o.replace(/^https?:\/\//, "") }, o)) })
937
937
  ]
938
938
  }
939
- ) : /* @__PURE__ */ e.jsx("span", { children: t.replace(/^https?:\/\//, "") }) });
940
- return /* @__PURE__ */ e.jsx(
939
+ ) : /* @__PURE__ */ t.jsx("span", { children: e.replace(/^https?:\/\//, "") }) });
940
+ return /* @__PURE__ */ t.jsx(
941
941
  et,
942
942
  {
943
- register: g,
943
+ register: h,
944
944
  control: j,
945
945
  handleSubmit: b,
946
946
  watch: w,
947
947
  setValue: v,
948
948
  ...S,
949
- children: /* @__PURE__ */ e.jsx("form", { onSubmit: b((a) => p.mutateAsync(a)), children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[8fr_7fr] text-sm h-full", children: [
950
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 p-8 bg-muted/50 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
951
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-stretch", children: [
952
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
953
- /* @__PURE__ */ e.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono", children: r.toUpperCase() }),
954
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center flex-wrap p-2 font-mono text-xs", children: [
949
+ children: /* @__PURE__ */ t.jsx("form", { onSubmit: b((o) => p.mutateAsync(o)), children: /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[8fr_7fr] text-sm h-full", children: [
950
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-4 p-8 bg-muted/50 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
951
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 items-stretch", children: [
952
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
953
+ /* @__PURE__ */ t.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono", children: a.toUpperCase() }),
954
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center flex-wrap p-2 font-mono text-xs", children: [
955
955
  _e,
956
- Oe,
956
+ ke,
957
957
  ce.length > 0 ? "?" : "",
958
958
  ce
959
959
  ] })
960
960
  ] }),
961
- /* @__PURE__ */ e.jsx(E, { type: "submit", className: "h-auto flex gap-1", children: "Send" })
961
+ /* @__PURE__ */ t.jsx(E, { type: "submit", className: "h-auto flex gap-1", children: "Send" })
962
962
  ] }),
963
- /* @__PURE__ */ e.jsxs(
964
- je,
963
+ /* @__PURE__ */ t.jsxs(
964
+ be,
965
965
  {
966
- defaultValue: l.length + i.length > 0 ? "parameters" : "headers",
966
+ defaultValue: i.length + l.length > 0 ? "parameters" : "headers",
967
967
  children: [
968
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-1 justify-between", children: [
969
- /* @__PURE__ */ e.jsxs(be, { children: [
970
- l.length + i.length > 0 && /* @__PURE__ */ e.jsx(A, { value: "parameters", children: "Parameters" }),
971
- /* @__PURE__ */ e.jsxs(A, { value: "headers", children: [
968
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-wrap gap-1 justify-between", children: [
969
+ /* @__PURE__ */ t.jsxs(Ne, { children: [
970
+ i.length + l.length > 0 && /* @__PURE__ */ t.jsx(A, { value: "parameters", children: "Parameters" }),
971
+ /* @__PURE__ */ t.jsxs(A, { value: "headers", children: [
972
972
  "Headers",
973
973
  " ",
974
974
  C.headers.length > 0 && `(${C.headers.length})`
975
975
  ] }),
976
- /* @__PURE__ */ e.jsx(
976
+ /* @__PURE__ */ t.jsx(
977
977
  A,
978
978
  {
979
979
  value: "body",
980
980
  disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
981
- r.toUpperCase()
981
+ a.toUpperCase()
982
982
  ),
983
983
  children: "Body"
984
984
  }
985
985
  )
986
986
  ] }),
987
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
987
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 items-center", children: [
988
988
  "Auth:",
989
- /* @__PURE__ */ e.jsxs(
990
- fe,
989
+ /* @__PURE__ */ t.jsxs(
990
+ xe,
991
991
  {
992
- onValueChange: (a) => v("identity", a),
992
+ onValueChange: (o) => v("identity", o),
993
993
  value: C.identity,
994
994
  defaultValue: C.identity,
995
995
  children: [
996
- /* @__PURE__ */ e.jsx(xe, { className: "w-[180px] flex", children: _.isPending ? /* @__PURE__ */ e.jsx(ve, {}) : /* @__PURE__ */ e.jsx(ye, {}) }),
997
- /* @__PURE__ */ e.jsxs(ge, { align: "center", children: [
998
- /* @__PURE__ */ e.jsx(K, { value: J, children: "None" }),
999
- (ue = _.data) == null ? void 0 : ue.map((a) => /* @__PURE__ */ e.jsx(K, { value: a.id, children: a.label }, a.id))
996
+ /* @__PURE__ */ t.jsx(ye, { className: "w-[180px] flex", children: k.isPending ? /* @__PURE__ */ t.jsx(je, {}) : /* @__PURE__ */ t.jsx(ge, {}) }),
997
+ /* @__PURE__ */ t.jsxs(ve, { align: "center", children: [
998
+ /* @__PURE__ */ t.jsx(K, { value: J, children: "None" }),
999
+ (ue = k.data) == null ? void 0 : ue.map((o) => /* @__PURE__ */ t.jsx(K, { value: o.id, children: o.label }, o.id))
1000
1000
  ] })
1001
1001
  ]
1002
1002
  }
1003
1003
  )
1004
1004
  ] })
1005
1005
  ] }),
1006
- /* @__PURE__ */ e.jsx(V, { value: "headers", children: /* @__PURE__ */ e.jsx(Rt, { control: j, register: g }) }),
1007
- /* @__PURE__ */ e.jsxs(V, { value: "parameters", children: [
1008
- i.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1009
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
1010
- /* @__PURE__ */ e.jsx(Mt, { control: j })
1006
+ /* @__PURE__ */ t.jsx(V, { value: "headers", children: /* @__PURE__ */ t.jsx(Rt, { control: j, register: h }) }),
1007
+ /* @__PURE__ */ t.jsxs(V, { value: "parameters", children: [
1008
+ l.length > 0 && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1009
+ /* @__PURE__ */ t.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
1010
+ /* @__PURE__ */ t.jsx(Mt, { control: j })
1011
1011
  ] }),
1012
- l.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1013
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
1014
- /* @__PURE__ */ e.jsx(zt, { control: j, queryParams: l })
1012
+ i.length > 0 && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1013
+ /* @__PURE__ */ t.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
1014
+ /* @__PURE__ */ t.jsx(zt, { control: j, queryParams: i })
1015
1015
  ] })
1016
1016
  ] }),
1017
- /* @__PURE__ */ e.jsx(V, { value: "body", children: /* @__PURE__ */ e.jsx(
1017
+ /* @__PURE__ */ t.jsx(V, { value: "body", children: /* @__PURE__ */ t.jsx(
1018
1018
  "textarea",
1019
1019
  {
1020
- ...g("body"),
1020
+ ...h("body"),
1021
1021
  className: "border w-full rounded p-2 bg-muted h-40"
1022
1022
  }
1023
1023
  ) })
@@ -1025,79 +1025,79 @@ const ne = (t) => Math.abs(
1025
1025
  }
1026
1026
  )
1027
1027
  ] }),
1028
- /* @__PURE__ */ e.jsx("div", { className: "min-w-0 p-8 bg-muted/70", children: p.error ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1029
- C.pathParams.some((a) => a.value === "") && /* @__PURE__ */ e.jsx(nt, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
1030
- /* @__PURE__ */ e.jsxs(ae, { children: [
1031
- /* @__PURE__ */ e.jsx(st, { children: /* @__PURE__ */ e.jsx(rt, { children: "Request failed" }) }),
1032
- /* @__PURE__ */ e.jsxs(at, { children: [
1028
+ /* @__PURE__ */ t.jsx("div", { className: "min-w-0 p-8 bg-muted/70", children: p.error ? /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
1029
+ C.pathParams.some((o) => o.value === "") && /* @__PURE__ */ t.jsx(nt, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
1030
+ /* @__PURE__ */ t.jsxs(ae, { children: [
1031
+ /* @__PURE__ */ t.jsx(st, { children: /* @__PURE__ */ t.jsx(rt, { children: "Request failed" }) }),
1032
+ /* @__PURE__ */ t.jsxs(at, { children: [
1033
1033
  "Error:",
1034
1034
  " ",
1035
1035
  p.error.message || String(p.error) || "Unexpected error"
1036
1036
  ] })
1037
1037
  ] })
1038
- ] }) : p.data ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1039
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex text-xs gap-6", children: [
1040
- /* @__PURE__ */ e.jsxs("div", { children: [
1038
+ ] }) : p.data ? /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
1039
+ /* @__PURE__ */ t.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ t.jsxs("div", { className: "flex text-xs gap-6", children: [
1040
+ /* @__PURE__ */ t.jsxs("div", { children: [
1041
1041
  "Status: ",
1042
1042
  p.data.status,
1043
1043
  " ",
1044
1044
  Jt[p.data.status] ?? ""
1045
1045
  ] }),
1046
- /* @__PURE__ */ e.jsxs("div", { children: [
1046
+ /* @__PURE__ */ t.jsxs("div", { children: [
1047
1047
  "Time: ",
1048
1048
  p.data.time.toFixed(0),
1049
1049
  "ms"
1050
1050
  ] }),
1051
- /* @__PURE__ */ e.jsxs("div", { children: [
1051
+ /* @__PURE__ */ t.jsxs("div", { children: [
1052
1052
  "Size: ",
1053
1053
  p.data.size,
1054
1054
  " B"
1055
1055
  ] })
1056
1056
  ] }) }),
1057
- /* @__PURE__ */ e.jsxs(je, { defaultValue: "response", children: [
1058
- /* @__PURE__ */ e.jsxs(be, { children: [
1059
- /* @__PURE__ */ e.jsx(A, { value: "response", children: "Response" }),
1060
- /* @__PURE__ */ e.jsx(A, { value: "headers", children: U.length ? `Headers (${U.length})` : "No headers" })
1057
+ /* @__PURE__ */ t.jsxs(be, { defaultValue: "response", children: [
1058
+ /* @__PURE__ */ t.jsxs(Ne, { children: [
1059
+ /* @__PURE__ */ t.jsx(A, { value: "response", children: "Response" }),
1060
+ /* @__PURE__ */ t.jsx(A, { value: "headers", children: U.length ? `Headers (${U.length})` : "No headers" })
1061
1061
  ] }),
1062
- /* @__PURE__ */ e.jsx(V, { value: "response", children: /* @__PURE__ */ e.jsx(
1062
+ /* @__PURE__ */ t.jsx(V, { value: "response", children: /* @__PURE__ */ t.jsx(
1063
1063
  Bt,
1064
1064
  {
1065
1065
  headers: p.data.headers,
1066
1066
  body: p.data.body
1067
1067
  }
1068
1068
  ) }),
1069
- /* @__PURE__ */ e.jsx(V, { value: "headers", children: /* @__PURE__ */ e.jsxs(
1069
+ /* @__PURE__ */ t.jsx(V, { value: "headers", children: /* @__PURE__ */ t.jsxs(
1070
1070
  ae,
1071
1071
  {
1072
1072
  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",
1073
1073
  children: [
1074
- /* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Key" }),
1075
- /* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Value" }),
1076
- U.map(([a, f]) => /* @__PURE__ */ e.jsxs(Z, { children: [
1077
- /* @__PURE__ */ e.jsx("div", { children: a }),
1078
- /* @__PURE__ */ e.jsx("div", { className: "break-words", children: f })
1079
- ] }, a))
1074
+ /* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: "Key" }),
1075
+ /* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: "Value" }),
1076
+ U.map(([o, x]) => /* @__PURE__ */ t.jsxs(Z, { children: [
1077
+ /* @__PURE__ */ t.jsx("div", { children: o }),
1078
+ /* @__PURE__ */ t.jsx("div", { className: "break-words", children: x })
1079
+ ] }, o))
1080
1080
  ]
1081
1081
  }
1082
1082
  ) })
1083
1083
  ] })
1084
- ] }) : /* @__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: p.isPending ? /* @__PURE__ */ e.jsx(ve, {}) : "Send a request first to see the response here" }) }) })
1084
+ ] }) : /* @__PURE__ */ t.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ t.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: p.isPending ? /* @__PURE__ */ t.jsx(je, {}) : "Send a request first to see the response here" }) }) })
1085
1085
  ] }) })
1086
1086
  }
1087
1087
  );
1088
1088
  }, Qt = ({
1089
- className: t,
1089
+ className: e,
1090
1090
  size: n = 16
1091
- }) => /* @__PURE__ */ e.jsx(
1091
+ }) => /* @__PURE__ */ t.jsx(
1092
1092
  "svg",
1093
1093
  {
1094
1094
  xmlns: "http://www.w3.org/2000/svg",
1095
1095
  viewBox: "0 0 24 24",
1096
1096
  fill: "currentColor",
1097
- className: t,
1097
+ className: e,
1098
1098
  width: n,
1099
1099
  height: n,
1100
- children: /* @__PURE__ */ e.jsx(
1100
+ children: /* @__PURE__ */ t.jsx(
1101
1101
  "path",
1102
1102
  {
1103
1103
  fillRule: "evenodd",
@@ -1106,26 +1106,26 @@ const ne = (t) => Math.abs(
1106
1106
  }
1107
1107
  )
1108
1108
  }
1109
- ), Ut = (t) => {
1110
- const [n, s] = Te(!1);
1111
- return /* @__PURE__ */ e.jsxs(Qe, { onOpenChange: (r) => s(r), children: [
1112
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: t.children ?? /* @__PURE__ */ e.jsxs("button", { className: "flex gap-1 items-center px-2 py-1 rounded-md bg-primary/80 hover:bg-primary transition text-primary-foreground text-xs", children: [
1109
+ ), Ut = (e) => {
1110
+ const [n, s] = Ee(!1);
1111
+ return /* @__PURE__ */ t.jsxs(Qe, { onOpenChange: (a) => s(a), children: [
1112
+ /* @__PURE__ */ t.jsx(Ue, { asChild: !0, children: e.children ?? /* @__PURE__ */ t.jsxs("button", { className: "flex gap-1 items-center px-2 py-1 rounded-md bg-primary/80 hover:bg-primary transition text-primary-foreground text-xs", children: [
1113
1113
  "Test",
1114
- /* @__PURE__ */ e.jsx(Qt, { className: "", size: 14 })
1114
+ /* @__PURE__ */ t.jsx(Qt, { className: "", size: 14 })
1115
1115
  ] }) }),
1116
- /* @__PURE__ */ e.jsxs(
1116
+ /* @__PURE__ */ t.jsxs(
1117
1117
  We,
1118
1118
  {
1119
1119
  className: "max-w-screen-xl w-full h-5/6 overflow-auto p-0",
1120
1120
  "aria-describedby": void 0,
1121
1121
  children: [
1122
- /* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsx(Ze, { children: "Playground" }) }),
1123
- n && /* @__PURE__ */ e.jsx(Ht, { ...t })
1122
+ /* @__PURE__ */ t.jsx(Je, { children: /* @__PURE__ */ t.jsx(Ze, { children: "Playground" }) }),
1123
+ n && /* @__PURE__ */ t.jsx(Ht, { ...e })
1124
1124
  ]
1125
1125
  }
1126
1126
  )
1127
1127
  ] });
1128
- }, we = ft(`
1128
+ }, Se = ft(`
1129
1129
  query GetCategories($input: JSON!, $type: SchemaType!) {
1130
1130
  schema(input: $input, type: $type) {
1131
1131
  url
@@ -1152,79 +1152,80 @@ const ne = (t) => Math.abs(
1152
1152
  patch: "purple",
1153
1153
  options: "gray",
1154
1154
  head: "gray"
1155
- }, jn = (t) => {
1156
- const n = Me(t.navigationId ?? "/reference"), s = new _t(t);
1155
+ }, jn = (e) => {
1156
+ const n = he(e.navigationId ?? "/reference"), s = e.type === "file" ? Object.keys(e.input) : [], a = new kt(e);
1157
1157
  return {
1158
1158
  getHead: () => {
1159
- if (t.type === "url" && !t.skipPreload)
1160
- return /* @__PURE__ */ e.jsx(
1159
+ if (e.type === "url" && !e.skipPreload)
1160
+ return /* @__PURE__ */ t.jsx(
1161
1161
  "link",
1162
1162
  {
1163
1163
  rel: "preload",
1164
- href: t.input,
1164
+ href: e.input,
1165
1165
  as: "fetch",
1166
1166
  crossOrigin: "anonymous"
1167
1167
  }
1168
1168
  );
1169
- if (t.server)
1170
- return /* @__PURE__ */ e.jsx("link", { rel: "preconnect", href: t.server });
1169
+ if (e.server)
1170
+ return /* @__PURE__ */ t.jsx("link", { rel: "preconnect", href: e.server });
1171
1171
  },
1172
1172
  getMdxComponents: () => ({
1173
1173
  OpenPlaygroundButton: ({
1174
1174
  requireAuth: r,
1175
- server: o,
1175
+ server: i,
1176
1176
  method: l,
1177
- url: i,
1178
- ...c
1177
+ url: u,
1178
+ ...d
1179
1179
  }) => {
1180
1180
  var h;
1181
- const u = De(), d = Ae({
1182
- queryFn: () => s.fetch(we, {
1183
- type: t.type,
1184
- input: t.input
1181
+ const c = De(), f = Ae({
1182
+ queryFn: () => a.fetch(Se, {
1183
+ type: e.type,
1184
+ input: e.input
1185
1185
  }),
1186
- enabled: !o,
1186
+ enabled: !i,
1187
1187
  queryKey: ["playground-server"]
1188
1188
  });
1189
- return r && !u.isAuthenticated ? /* @__PURE__ */ e.jsxs(
1189
+ return r && !c.isAuthenticated ? /* @__PURE__ */ t.jsxs(
1190
1190
  E,
1191
1191
  {
1192
1192
  className: "gap-2 items-center",
1193
1193
  variant: "outline",
1194
- onClick: u.login,
1194
+ onClick: c.login,
1195
1195
  children: [
1196
1196
  "Login to open in Playground ",
1197
- /* @__PURE__ */ e.jsx(Fe, { size: 16 })
1197
+ /* @__PURE__ */ t.jsx(Fe, { size: 16 })
1198
1198
  ]
1199
1199
  }
1200
- ) : /* @__PURE__ */ e.jsx(
1200
+ ) : /* @__PURE__ */ t.jsx(
1201
1201
  Ut,
1202
1202
  {
1203
- url: i ?? "/",
1203
+ url: u ?? "/",
1204
1204
  method: l ?? "get",
1205
- server: o ?? ((h = d.data) == null ? void 0 : h.schema.url) ?? "https://example.com",
1206
- ...c,
1207
- children: /* @__PURE__ */ e.jsxs(E, { className: "gap-2 items-center", variant: "outline", children: [
1205
+ server: i ?? ((h = f.data) == null ? void 0 : h.schema.url) ?? "https://example.com",
1206
+ ...d,
1207
+ children: /* @__PURE__ */ t.jsxs(E, { className: "gap-2 items-center", variant: "outline", children: [
1208
1208
  "Open in Playground ",
1209
- /* @__PURE__ */ e.jsx(Le, { size: 16 })
1209
+ /* @__PURE__ */ t.jsx(Le, { size: 16 })
1210
1210
  ] })
1211
1211
  }
1212
1212
  );
1213
1213
  }
1214
1214
  }),
1215
1215
  getSidebar: async (r) => {
1216
- if (!qe({ path: n, end: !1 }, r))
1216
+ if (!Re({ path: n, end: !1 }, r))
1217
1217
  return [];
1218
1218
  try {
1219
- const l = (await s.fetch(we, {
1220
- type: t.type,
1221
- input: t.input
1222
- })).schema.tags.filter((i) => i.operations.length > 0).map((i) => ({
1219
+ const i = s.find((d) => r === he(n, d)) ?? Object.keys(e.input).at(0), u = (await a.fetch(Se, {
1220
+ type: e.type,
1221
+ input: e.type === "file" ? e.input[i] : e.input,
1222
+ version: i
1223
+ })).schema.tags.filter((d) => d.operations.length > 0).map((d) => ({
1223
1224
  type: "category",
1224
- label: i.name || "Other endpoints",
1225
+ label: d.name || "Other endpoints",
1225
1226
  collapsible: !0,
1226
1227
  collapsed: !1,
1227
- items: i.operations.map((c) => ({
1228
+ items: d.operations.map((c) => ({
1228
1229
  type: "link",
1229
1230
  label: c.summary ?? c.path,
1230
1231
  href: `#${c.slug}`,
@@ -1234,35 +1235,39 @@ const ne = (t) => Math.abs(
1234
1235
  }
1235
1236
  }))
1236
1237
  }));
1237
- return l.unshift({
1238
+ return u.unshift({
1238
1239
  type: "link",
1239
1240
  label: "Overview",
1240
1241
  href: "#description"
1241
- }), l;
1242
+ }), u;
1242
1243
  } catch {
1243
1244
  return [];
1244
1245
  }
1245
1246
  },
1246
1247
  getRoutes: () => [
1247
1248
  {
1249
+ path: n + "/:version?",
1248
1250
  async lazy() {
1249
- const { OpenApiRoute: r } = await import("./Route-C9cYcP-j.js");
1251
+ const { OpenApiRoute: r } = await import("./Route-C8nwd9A2.js");
1250
1252
  return {
1251
- element: /* @__PURE__ */ e.jsx(r, { client: s, config: t })
1253
+ element: /* @__PURE__ */ t.jsx(
1254
+ r,
1255
+ {
1256
+ basePath: n,
1257
+ versions: s,
1258
+ client: a,
1259
+ config: e
1260
+ }
1261
+ )
1252
1262
  };
1253
1263
  },
1254
1264
  children: [
1255
1265
  {
1256
- path: n,
1257
- children: [
1258
- {
1259
- index: !0,
1260
- async lazy() {
1261
- const { OperationList: r } = await import("./OperationList-C7ac3kR5.js");
1262
- return { element: /* @__PURE__ */ e.jsx(r, {}) };
1263
- }
1264
- }
1265
- ]
1266
+ index: !0,
1267
+ async lazy() {
1268
+ const { OperationList: r } = await import("./OperationList-wvY-BrxS.js");
1269
+ return { element: /* @__PURE__ */ t.jsx(r, {}) };
1270
+ }
1266
1271
  }
1267
1272
  ]
1268
1273
  }
@@ -1276,4 +1281,4 @@ export {
1276
1281
  ft as g,
1277
1282
  jn as o
1278
1283
  };
1279
- //# sourceMappingURL=index-C8ubT49C.js.map
1284
+ //# sourceMappingURL=index-C_ul-2fb.js.map