@nice2dev/ui-api 1.0.28 → 1.0.29

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.
package/dist/index.mjs CHANGED
@@ -1,18 +1,88 @@
1
- import { jsx as r, jsxs as t, Fragment as J } from "react/jsx-runtime";
2
- import { useContext as me, createContext as M, memo as He, useState as g, useEffect as ye, useCallback as P, useRef as se, forwardRef as ke, useMemo as Te } from "react";
3
- const Ee = (e, a) => a, Re = M(Ee);
4
- function Ae() {
5
- return { t: me(Re) };
1
+ import { jsxs as t, jsx as e, Fragment as F } from "react/jsx-runtime";
2
+ import { forwardRef as ue, useContext as be, createContext as D, memo as Te, useState as v, useEffect as he, useCallback as R, useRef as oe, useMemo as Ee } from "react";
3
+ const de = ue(
4
+ ({
5
+ menubar: r,
6
+ toolbar: a,
7
+ sidebar: i,
8
+ sidebarWidth: n = 220,
9
+ rightSidebar: c,
10
+ rightSidebarWidth: u = 280,
11
+ children: l,
12
+ bottomPanel: y,
13
+ bottomPanelHeight: b,
14
+ statusBar: d,
15
+ height: h = "100%",
16
+ flush: S = !1,
17
+ className: m,
18
+ style: k,
19
+ id: g,
20
+ "data-testid": P
21
+ }, C) => {
22
+ const O = `nice-app-shell__sidebar${S ? " nice-app-shell__sidebar--flush" : ""}`;
23
+ return /* @__PURE__ */ t(
24
+ "div",
25
+ {
26
+ ref: C,
27
+ id: g,
28
+ "data-testid": P,
29
+ className: `nice-app-shell${m ? ` ${m}` : ""}`,
30
+ style: { height: h, ...k },
31
+ children: [
32
+ r != null && /* @__PURE__ */ e(
33
+ "div",
34
+ {
35
+ className: `nice-app-shell__menubar${S ? " nice-app-shell__chrome--flush" : ""}`,
36
+ children: r
37
+ }
38
+ ),
39
+ a != null && /* @__PURE__ */ e(
40
+ "div",
41
+ {
42
+ className: `nice-app-shell__toolbar${S ? " nice-app-shell__chrome--flush" : ""}`,
43
+ children: a
44
+ }
45
+ ),
46
+ /* @__PURE__ */ t("div", { className: "nice-app-shell__body", children: [
47
+ i != null && /* @__PURE__ */ e("aside", { className: O, style: S ? void 0 : { width: n }, children: i }),
48
+ /* @__PURE__ */ e("main", { className: "nice-app-shell__content", children: l }),
49
+ c != null && /* @__PURE__ */ e(
50
+ "aside",
51
+ {
52
+ className: `${O} nice-app-shell__sidebar--right`,
53
+ style: S ? void 0 : { width: u },
54
+ children: c
55
+ }
56
+ )
57
+ ] }),
58
+ y != null && /* @__PURE__ */ e(
59
+ "div",
60
+ {
61
+ className: `nice-app-shell__bottom${S ? " nice-app-shell__bottom--flush" : ""}`,
62
+ style: b != null ? { height: b } : void 0,
63
+ children: y
64
+ }
65
+ ),
66
+ d != null && /* @__PURE__ */ e("div", { className: "nice-app-shell__status", children: d })
67
+ ]
68
+ }
69
+ );
70
+ }
71
+ );
72
+ de.displayName = "NiceAppShell";
73
+ const Ae = (r, a) => a, Re = D(Ae);
74
+ function Pe() {
75
+ return { t: be(Re) };
6
76
  }
7
- M({
77
+ D({
8
78
  dir: "ltr",
9
79
  isRTL: !1,
10
- flip: (e) => e,
11
- value: (e) => e.ltr
80
+ flip: (r) => r,
81
+ value: (r) => r.ltr
12
82
  });
13
- M(null);
14
- M(null);
15
- const Pe = {
83
+ D(null);
84
+ D(null);
85
+ const De = {
16
86
  radius: "md",
17
87
  shadow: "md",
18
88
  fill: "solid",
@@ -29,79 +99,79 @@ const Pe = {
29
99
  animation: "normal",
30
100
  density: "normal"
31
101
  };
32
- M({
102
+ D({
33
103
  displayStyle: "default",
34
- variantConfig: Pe,
104
+ variantConfig: De,
35
105
  setDisplayStyle: () => {
36
106
  }
37
107
  });
38
- M({});
39
- M({
108
+ D({});
109
+ D({
40
110
  direction: "ltr",
41
111
  isRTL: !1,
42
- flip: (e) => e,
43
- flipStyle: (e, a) => ({ [e]: a })
112
+ flip: (r) => r,
113
+ flipStyle: (r, a) => ({ [r]: a })
44
114
  });
45
- M({
115
+ D({
46
116
  permissions: {},
47
117
  getAccessMode: () => "full"
48
118
  });
49
- M(null);
50
- const De = process.env.NODE_ENV === "development";
51
- let ue = {
52
- enabled: De,
119
+ D(null);
120
+ const $e = process.env.NODE_ENV === "development";
121
+ let ge = {
122
+ enabled: $e,
53
123
  slowRenderThreshold: 16
54
124
  };
55
- const be = [], ce = /* @__PURE__ */ new Map(), he = /* @__PURE__ */ new Map();
125
+ const ve = [], le = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
56
126
  function Ie() {
57
- be.length = 0, ce.clear(), he.clear();
58
- }
59
- function $e(e) {
60
- const a = ue.slowRenderThreshold;
61
- return be.filter((i) => i.actualDuration > a);
127
+ ve.length = 0, le.clear(), _e.clear();
62
128
  }
63
- function W(e) {
64
- return e < 1 ? `${(e * 1e3).toFixed(0)}μs` : e < 1e3 ? `${e.toFixed(2)}ms` : `${(e / 1e3).toFixed(2)}s`;
129
+ function Oe(r) {
130
+ const a = ge.slowRenderThreshold;
131
+ return ve.filter((i) => i.actualDuration > a);
65
132
  }
66
- function Oe() {
67
- const e = Array.from(ce.values()), a = $e(), i = e.reduce((u, f) => u + f.renderCount, 0), n = e.length > 0 ? e.reduce((u, f) => u + f.avgRenderTime, 0) / e.length : 0, s = Array.from(he.values());
68
- return { stats: e, slowRenders: a, totalRenders: i, avgRenderTime: n, marks: s };
133
+ function z(r) {
134
+ return r < 1 ? `${(r * 1e3).toFixed(0)}μs` : r < 1e3 ? `${r.toFixed(2)}ms` : `${(r / 1e3).toFixed(2)}s`;
69
135
  }
70
136
  function Me() {
71
- const e = Oe();
137
+ const r = Array.from(le.values()), a = Oe(), i = r.reduce((u, l) => u + l.renderCount, 0), n = r.length > 0 ? r.reduce((u, l) => u + l.avgRenderTime, 0) / r.length : 0, c = Array.from(_e.values());
138
+ return { stats: r, slowRenders: a, totalRenders: i, avgRenderTime: n, marks: c };
139
+ }
140
+ function Le() {
141
+ const r = Me();
72
142
  console.group(
73
143
  "%c[Nice2Dev Performance Report]",
74
144
  "color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
75
- ), console.log(`Total renders: ${e.totalRenders}`), console.log(`Average render time: ${W(e.avgRenderTime)}`), console.log(`Slow renders: ${e.slowRenders.length}`), console.group("Component Stats"), console.table(
76
- e.stats.sort((a, i) => i.totalRenderTime - a.totalRenderTime).map((a) => ({
145
+ ), console.log(`Total renders: ${r.totalRenders}`), console.log(`Average render time: ${z(r.avgRenderTime)}`), console.log(`Slow renders: ${r.slowRenders.length}`), console.group("Component Stats"), console.table(
146
+ r.stats.sort((a, i) => i.totalRenderTime - a.totalRenderTime).map((a) => ({
77
147
  Name: a.componentName,
78
148
  Renders: a.renderCount,
79
- "Avg Time": W(a.avgRenderTime),
80
- "Max Time": W(a.maxRenderTime),
81
- "Total Time": W(a.totalRenderTime),
149
+ "Avg Time": z(a.avgRenderTime),
150
+ "Max Time": z(a.maxRenderTime),
151
+ "Total Time": z(a.totalRenderTime),
82
152
  "Slow Renders": a.slowRenderCount
83
153
  }))
84
- ), console.groupEnd(), e.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
85
- e.slowRenders.slice(-10).map((a) => ({
154
+ ), console.groupEnd(), r.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
155
+ r.slowRenders.slice(-10).map((a) => ({
86
156
  Component: a.componentName,
87
157
  Phase: a.phase,
88
- Duration: W(a.actualDuration),
158
+ Duration: z(a.actualDuration),
89
159
  Time: new Date(a.timestamp).toLocaleTimeString()
90
160
  }))
91
- ), console.groupEnd()), e.marks.length > 0 && (console.group("Custom Marks"), console.table(
92
- e.marks.filter((a) => a.duration).map((a) => ({
161
+ ), console.groupEnd()), r.marks.length > 0 && (console.group("Custom Marks"), console.table(
162
+ r.marks.filter((a) => a.duration).map((a) => ({
93
163
  Name: a.name,
94
- Duration: W(a.duration)
164
+ Duration: z(a.duration)
95
165
  }))
96
166
  ), console.groupEnd()), console.groupEnd();
97
167
  }
98
- const Le = He(
99
- ({ position: e = "bottom-right", defaultCollapsed: a = !0 }) => {
100
- const [i, n] = g(a), [s, u] = g([]), [f, y] = g({ used: 0, total: 0 });
101
- if (ye(() => {
168
+ const Ue = Te(
169
+ ({ position: r = "bottom-right", defaultCollapsed: a = !0 }) => {
170
+ const [i, n] = v(a), [c, u] = v([]), [l, y] = v({ used: 0, total: 0 });
171
+ if (he(() => {
102
172
  const d = () => {
103
- const k = Array.from(ce.values());
104
- u(k.sort((T, _) => _.totalRenderTime - T.totalRenderTime).slice(0, 10));
173
+ const S = Array.from(le.values());
174
+ u(S.sort((k, g) => g.totalRenderTime - k.totalRenderTime).slice(0, 10));
105
175
  const m = window.performance;
106
176
  m.memory && y({
107
177
  used: m.memory.usedJSHeapSize / 1024 / 1024,
@@ -109,15 +179,15 @@ const Le = He(
109
179
  });
110
180
  };
111
181
  d();
112
- const v = setInterval(d, 2e3);
113
- return () => clearInterval(v);
114
- }, []), !ue.enabled)
182
+ const h = setInterval(d, 2e3);
183
+ return () => clearInterval(h);
184
+ }, []), !ge.enabled)
115
185
  return null;
116
186
  const b = {
117
187
  position: "fixed",
118
188
  zIndex: 99999,
119
- ...e.includes("top") ? { top: 8 } : { bottom: 8 },
120
- ...e.includes("left") ? { left: 8 } : { right: 8 }
189
+ ...r.includes("top") ? { top: 8 } : { bottom: 8 },
190
+ ...r.includes("left") ? { left: 8 } : { right: 8 }
121
191
  };
122
192
  return /* @__PURE__ */ t(
123
193
  "div",
@@ -141,26 +211,26 @@ const Le = He(
141
211
  style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
142
212
  onClick: () => n((d) => !d),
143
213
  children: [
144
- /* @__PURE__ */ r("span", { style: { color: "var(--color-success, #22c55e)" }, children: "●" }),
145
- /* @__PURE__ */ r("span", { children: "Profiler" }),
146
- f.used > 0 && /* @__PURE__ */ t(
214
+ /* @__PURE__ */ e("span", { style: { color: "var(--color-success, #22c55e)" }, children: "●" }),
215
+ /* @__PURE__ */ e("span", { children: "Profiler" }),
216
+ l.used > 0 && /* @__PURE__ */ t(
147
217
  "span",
148
218
  {
149
219
  style: {
150
- color: f.used > 100 ? "var(--color-warning, #f59e0b)" : "var(--text-muted, #64748b)"
220
+ color: l.used > 100 ? "var(--color-warning, #f59e0b)" : "var(--text-muted, #64748b)"
151
221
  },
152
222
  children: [
153
- f.used.toFixed(0),
223
+ l.used.toFixed(0),
154
224
  "MB"
155
225
  ]
156
226
  }
157
227
  ),
158
- /* @__PURE__ */ r("span", { style: { marginLeft: "auto", opacity: 0.5 }, children: i ? "▼" : "▲" })
228
+ /* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5 }, children: i ? "▼" : "▲" })
159
229
  ]
160
230
  }
161
231
  ),
162
232
  !i && /* @__PURE__ */ t("div", { style: { marginTop: 8 }, children: [
163
- /* @__PURE__ */ r(
233
+ /* @__PURE__ */ e(
164
234
  "div",
165
235
  {
166
236
  style: {
@@ -168,18 +238,18 @@ const Le = He(
168
238
  paddingBottom: 4,
169
239
  marginBottom: 8
170
240
  },
171
- children: /* @__PURE__ */ r("strong", { children: "Top Components" })
241
+ children: /* @__PURE__ */ e("strong", { children: "Top Components" })
172
242
  }
173
243
  ),
174
- s.map((d) => /* @__PURE__ */ t("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
175
- /* @__PURE__ */ r("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: d.componentName }),
176
- /* @__PURE__ */ r(
244
+ c.map((d) => /* @__PURE__ */ t("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
245
+ /* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: d.componentName }),
246
+ /* @__PURE__ */ e(
177
247
  "span",
178
248
  {
179
249
  style: {
180
250
  color: d.avgRenderTime > 16 ? "var(--color-warning, #f59e0b)" : "var(--color-success, #22c55e)"
181
251
  },
182
- children: W(d.avgRenderTime)
252
+ children: z(d.avgRenderTime)
183
253
  }
184
254
  ),
185
255
  /* @__PURE__ */ t(
@@ -194,10 +264,10 @@ const Le = He(
194
264
  )
195
265
  ] }, d.componentName)),
196
266
  /* @__PURE__ */ t("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
197
- /* @__PURE__ */ r(
267
+ /* @__PURE__ */ e(
198
268
  "button",
199
269
  {
200
- onClick: Me,
270
+ onClick: Le,
201
271
  style: {
202
272
  flex: 1,
203
273
  padding: "4px 8px",
@@ -211,7 +281,7 @@ const Le = He(
211
281
  children: "Print Report"
212
282
  }
213
283
  ),
214
- /* @__PURE__ */ r(
284
+ /* @__PURE__ */ e(
215
285
  "button",
216
286
  {
217
287
  onClick: Ie,
@@ -235,30 +305,30 @@ const Le = He(
235
305
  );
236
306
  }
237
307
  );
238
- Le.displayName = "ProfilerOverlay";
308
+ Ue.displayName = "ProfilerOverlay";
239
309
  process.env.NODE_ENV;
240
- M(null);
241
- const Ue = M({
310
+ D(null);
311
+ const je = D({
242
312
  enabled: !0,
243
313
  active: !1,
244
314
  run: () => {
245
315
  }
246
316
  });
247
317
  function Ke() {
248
- return me(Ue);
318
+ return be(je);
249
319
  }
250
- function ee(e, a) {
251
- if (!e)
320
+ function ae(r, a) {
321
+ if (!r)
252
322
  return null;
253
- if (e === !0)
323
+ if (r === !0)
254
324
  return a && a.length > 0 ? a : null;
255
- if (Array.isArray(e))
256
- return e.length > 0 ? e : null;
257
- const i = e.steps ?? a;
325
+ if (Array.isArray(r))
326
+ return r.length > 0 ? r : null;
327
+ const i = r.steps ?? a;
258
328
  return i && i.length > 0 ? i : null;
259
329
  }
260
- function je(e, a) {
261
- return e.map((i) => ({
330
+ function qe(r, a) {
331
+ return r.map((i) => ({
262
332
  target: i.target,
263
333
  title: i.titleKey ? a(i.titleKey, i.title ?? "") : i.title ?? "",
264
334
  content: i.contentKey ? a(i.contentKey, i.content ?? "") : i.content ?? "",
@@ -269,36 +339,36 @@ function je(e, a) {
269
339
  disableInteraction: i.disableInteraction
270
340
  }));
271
341
  }
272
- const re = ({
273
- steps: e,
342
+ const ie = ({
343
+ steps: r,
274
344
  autoStart: a,
275
345
  label: i,
276
346
  size: n = "md",
277
- className: s,
347
+ className: c,
278
348
  style: u,
279
- "data-testid": f
349
+ "data-testid": l
280
350
  }) => {
281
- const { enabled: y, run: b } = Ke(), { t: d } = Ae();
282
- if (!y || !e || e.length === 0)
351
+ const { enabled: y, run: b } = Ke(), { t: d } = Pe();
352
+ if (!y || !r || r.length === 0)
283
353
  return null;
284
- const v = i ?? d("tutorial.startAria", "Start tutorial");
285
- return /* @__PURE__ */ r(
354
+ const h = i ?? d("tutorial.startAria", "Start tutorial");
355
+ return /* @__PURE__ */ e(
286
356
  "button",
287
357
  {
288
358
  type: "button",
289
- className: `nice-tutorial-button nice-tutorial-button--${n}` + (s ? ` ${s}` : ""),
359
+ className: `nice-tutorial-button nice-tutorial-button--${n}` + (c ? ` ${c}` : ""),
290
360
  style: u,
291
- "data-testid": f,
292
- "aria-label": v,
293
- title: v,
294
- onClick: () => b(je(e, d), { autoStart: a }),
361
+ "data-testid": l,
362
+ "aria-label": h,
363
+ title: h,
364
+ onClick: () => b(qe(r, d), { autoStart: a }),
295
365
  children: "?"
296
366
  }
297
367
  );
298
- }, de = "nice-tutorial-button-styles";
299
- if (typeof document < "u" && !document.getElementById(de)) {
300
- const e = document.createElement("style");
301
- e.id = de, e.textContent = `
368
+ }, fe = "nice-tutorial-button-styles";
369
+ if (typeof document < "u" && !document.getElementById(fe)) {
370
+ const r = document.createElement("style");
371
+ r.id = fe, r.textContent = `
302
372
  .nice-tutorial-button {
303
373
  display: inline-flex;
304
374
  align-items: center;
@@ -324,12 +394,12 @@ if (typeof document < "u" && !document.getElementById(de)) {
324
394
  }
325
395
  .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
326
396
  .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
327
- `, document.head.appendChild(e);
397
+ `, document.head.appendChild(r);
328
398
  }
329
- M(null);
330
- M(null);
331
- M(null);
332
- const ge = {
399
+ D(null);
400
+ D(null);
401
+ D(null);
402
+ const we = {
333
403
  space1: "4px",
334
404
  space2: "8px",
335
405
  space3: "12px",
@@ -337,7 +407,7 @@ const ge = {
337
407
  space5: "20px",
338
408
  space6: "24px",
339
409
  space8: "32px"
340
- }, ve = {
410
+ }, Ne = {
341
411
  fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
342
412
  fontSizeXs: "0.75rem",
343
413
  fontSizeSm: "0.8125rem",
@@ -349,27 +419,27 @@ const ge = {
349
419
  fontWeightSemibold: 600,
350
420
  fontWeightBold: 700,
351
421
  lineHeight: 1.5
352
- }, _e = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, we = (e) => ({
353
- color: e,
422
+ }, xe = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, Se = (r) => ({
423
+ color: r,
354
424
  radiusSm: "4px",
355
425
  radiusMd: "6px",
356
426
  radiusLg: "8px",
357
427
  radiusXl: "12px",
358
428
  radiusFull: "9999px"
359
- }), qe = {
429
+ }), Be = {
360
430
  sm: "0 1px 2px rgba(0,0,0,0.05)",
361
431
  md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
362
432
  lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
363
433
  xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
364
- }, Be = {
434
+ }, Ve = {
365
435
  sm: "0 1px 2px rgba(0,0,0,0.3)",
366
436
  md: "0 4px 6px -1px rgba(0,0,0,0.4)",
367
437
  lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
368
438
  xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
369
439
  };
370
- function l(e, a, i, n, s) {
440
+ function f(r, a, i, n, c) {
371
441
  return {
372
- name: e,
442
+ name: r,
373
443
  darkMode: "light",
374
444
  colors: {
375
445
  ...a,
@@ -383,16 +453,16 @@ function l(e, a, i, n, s) {
383
453
  canvas: i.canvas ?? i.primary
384
454
  },
385
455
  text: { ...n, inverse: n.inverse ?? "#ffffff" },
386
- borders: we(s),
387
- shadows: qe,
388
- spacing: ge,
389
- typography: ve,
390
- transitions: _e
456
+ borders: Se(c),
457
+ shadows: Be,
458
+ spacing: we,
459
+ typography: Ne,
460
+ transitions: xe
391
461
  };
392
462
  }
393
- function A(e, a, i, n, s) {
463
+ function T(r, a, i, n, c) {
394
464
  return {
395
- name: e,
465
+ name: r,
396
466
  darkMode: "dark",
397
467
  colors: {
398
468
  ...a,
@@ -406,14 +476,14 @@ function A(e, a, i, n, s) {
406
476
  canvas: i.canvas ?? i.primary
407
477
  },
408
478
  text: { ...n, inverse: n.inverse ?? "#0f172a" },
409
- borders: we(s),
410
- shadows: Be,
411
- spacing: ge,
412
- typography: ve,
413
- transitions: _e
479
+ borders: Se(c),
480
+ shadows: Ve,
481
+ spacing: we,
482
+ typography: Ne,
483
+ transitions: xe
414
484
  };
415
485
  }
416
- l(
486
+ f(
417
487
  "Slate",
418
488
  {
419
489
  primary: "#64748b",
@@ -427,7 +497,7 @@ l(
427
497
  { primary: "#1e293b", secondary: "#475569", muted: "#94a3b8" },
428
498
  "#cbd5e1"
429
499
  );
430
- l(
500
+ f(
431
501
  "Zinc",
432
502
  {
433
503
  primary: "#71717a",
@@ -441,7 +511,7 @@ l(
441
511
  { primary: "#18181b", secondary: "#3f3f46", muted: "#a1a1aa" },
442
512
  "#d4d4d8"
443
513
  );
444
- l(
514
+ f(
445
515
  "Stone",
446
516
  {
447
517
  primary: "#78716c",
@@ -455,7 +525,7 @@ l(
455
525
  { primary: "#1c1917", secondary: "#44403c", muted: "#a8a29e" },
456
526
  "#d6d3d1"
457
527
  );
458
- l(
528
+ f(
459
529
  "Cool Gray",
460
530
  {
461
531
  primary: "#6b7280",
@@ -469,7 +539,7 @@ l(
469
539
  { primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
470
540
  "#d1d5db"
471
541
  );
472
- l(
542
+ f(
473
543
  "Warm Gray",
474
544
  {
475
545
  primary: "#7c7568",
@@ -483,7 +553,7 @@ l(
483
553
  { primary: "#1f1d19", secondary: "#4a463d", muted: "#a09888" },
484
554
  "#d4d0c8"
485
555
  );
486
- l(
556
+ f(
487
557
  "Silver",
488
558
  {
489
559
  primary: "#94a3b8",
@@ -497,7 +567,7 @@ l(
497
567
  { primary: "#334155", secondary: "#64748b", muted: "#94a3b8" },
498
568
  "#cbd5e1"
499
569
  );
500
- l(
570
+ f(
501
571
  "Charcoal",
502
572
  {
503
573
  primary: "#374151",
@@ -511,7 +581,7 @@ l(
511
581
  { primary: "#111827", secondary: "#374151", muted: "#6b7280" },
512
582
  "#d1d5db"
513
583
  );
514
- l(
584
+ f(
515
585
  "Ivory",
516
586
  {
517
587
  primary: "#92876d",
@@ -525,7 +595,7 @@ l(
525
595
  { primary: "#2b2517", secondary: "#5c5340", muted: "#9c9280" },
526
596
  "#ddd8c4"
527
597
  );
528
- l(
598
+ f(
529
599
  "Rose",
530
600
  {
531
601
  primary: "#e11d48",
@@ -539,7 +609,7 @@ l(
539
609
  { primary: "#4c0519", secondary: "#881337", muted: "#f43f5e" },
540
610
  "#fda4af"
541
611
  );
542
- l(
612
+ f(
543
613
  "Emerald",
544
614
  {
545
615
  primary: "#059669",
@@ -553,7 +623,7 @@ l(
553
623
  { primary: "#064e3b", secondary: "#065f46", muted: "#34d399" },
554
624
  "#6ee7b7"
555
625
  );
556
- l(
626
+ f(
557
627
  "Amber",
558
628
  {
559
629
  primary: "#d97706",
@@ -567,7 +637,7 @@ l(
567
637
  { primary: "#451a03", secondary: "#78350f", muted: "#f59e0b" },
568
638
  "#fcd34d"
569
639
  );
570
- l(
640
+ f(
571
641
  "Violet",
572
642
  {
573
643
  primary: "#7c3aed",
@@ -581,7 +651,7 @@ l(
581
651
  { primary: "#2e1065", secondary: "#4c1d95", muted: "#a78bfa" },
582
652
  "#c4b5fd"
583
653
  );
584
- l(
654
+ f(
585
655
  "Teal",
586
656
  {
587
657
  primary: "#0d9488",
@@ -595,7 +665,7 @@ l(
595
665
  { primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
596
666
  "#5eead4"
597
667
  );
598
- l(
668
+ f(
599
669
  "Indigo",
600
670
  {
601
671
  primary: "#4f46e5",
@@ -609,7 +679,7 @@ l(
609
679
  { primary: "#1e1b4b", secondary: "#312e81", muted: "#818cf8" },
610
680
  "#a5b4fc"
611
681
  );
612
- l(
682
+ f(
613
683
  "Cyan",
614
684
  {
615
685
  primary: "#0891b2",
@@ -623,7 +693,7 @@ l(
623
693
  { primary: "#164e63", secondary: "#155e75", muted: "#22d3ee" },
624
694
  "#67e8f9"
625
695
  );
626
- l(
696
+ f(
627
697
  "Lime",
628
698
  {
629
699
  primary: "#65a30d",
@@ -637,7 +707,7 @@ l(
637
707
  { primary: "#1a2e05", secondary: "#365314", muted: "#84cc16" },
638
708
  "#bef264"
639
709
  );
640
- l(
710
+ f(
641
711
  "Pink",
642
712
  {
643
713
  primary: "#db2777",
@@ -651,7 +721,7 @@ l(
651
721
  { primary: "#500724", secondary: "#831843", muted: "#f472b6" },
652
722
  "#f9a8d4"
653
723
  );
654
- l(
724
+ f(
655
725
  "Orange",
656
726
  {
657
727
  primary: "#ea580c",
@@ -665,7 +735,7 @@ l(
665
735
  { primary: "#431407", secondary: "#7c2d12", muted: "#fb923c" },
666
736
  "#fdba74"
667
737
  );
668
- l(
738
+ f(
669
739
  "Fuchsia",
670
740
  {
671
741
  primary: "#c026d3",
@@ -679,7 +749,7 @@ l(
679
749
  { primary: "#4a044e", secondary: "#701a75", muted: "#d946ef" },
680
750
  "#e879f9"
681
751
  );
682
- l(
752
+ f(
683
753
  "Sky",
684
754
  {
685
755
  primary: "#0284c7",
@@ -693,7 +763,7 @@ l(
693
763
  { primary: "#0c4a6e", secondary: "#075985", muted: "#38bdf8" },
694
764
  "#7dd3fc"
695
765
  );
696
- l(
766
+ f(
697
767
  "Ruby",
698
768
  {
699
769
  primary: "#be123c",
@@ -707,7 +777,7 @@ l(
707
777
  { primary: "#4c0519", secondary: "#881337", muted: "#fb7185" },
708
778
  "#fda4af"
709
779
  );
710
- l(
780
+ f(
711
781
  "Coral",
712
782
  {
713
783
  primary: "#f97316",
@@ -721,7 +791,7 @@ l(
721
791
  { primary: "#431407", secondary: "#9a3412", muted: "#fb923c" },
722
792
  "#fdba74"
723
793
  );
724
- A(
794
+ T(
725
795
  "Midnight",
726
796
  {
727
797
  primary: "#818cf8",
@@ -735,7 +805,7 @@ A(
735
805
  { primary: "#f1f5f9", secondary: "#94a3b8", muted: "#475569" },
736
806
  "#1e293b"
737
807
  );
738
- A(
808
+ T(
739
809
  "Obsidian",
740
810
  {
741
811
  primary: "#a78bfa",
@@ -749,7 +819,7 @@ A(
749
819
  { primary: "#fafafa", secondary: "#a1a1aa", muted: "#52525b" },
750
820
  "#3f3f46"
751
821
  );
752
- A(
822
+ T(
753
823
  "Eclipse",
754
824
  {
755
825
  primary: "#c084fc",
@@ -763,7 +833,7 @@ A(
763
833
  { primary: "#f5f3ff", secondary: "#a78bfa", muted: "#6d5eac" },
764
834
  "#3b3266"
765
835
  );
766
- A(
836
+ T(
767
837
  "Onyx",
768
838
  {
769
839
  primary: "#60a5fa",
@@ -777,7 +847,7 @@ A(
777
847
  { primary: "#ffffff", secondary: "#a3a3a3", muted: "#525252" },
778
848
  "#262626"
779
849
  );
780
- A(
850
+ T(
781
851
  "Carbon",
782
852
  {
783
853
  primary: "#38bdf8",
@@ -791,7 +861,7 @@ A(
791
861
  { primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
792
862
  "#525252"
793
863
  );
794
- A(
864
+ T(
795
865
  "Cosmos",
796
866
  {
797
867
  primary: "#6366f1",
@@ -805,7 +875,7 @@ A(
805
875
  { primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563" },
806
876
  "#374151"
807
877
  );
808
- A(
878
+ T(
809
879
  "Nebula",
810
880
  {
811
881
  primary: "#e879f9",
@@ -819,7 +889,7 @@ A(
819
889
  { primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
820
890
  "#581c87"
821
891
  );
822
- A(
892
+ T(
823
893
  "Abyss",
824
894
  {
825
895
  primary: "#22d3ee",
@@ -833,7 +903,7 @@ A(
833
903
  { primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
834
904
  "#075985"
835
905
  );
836
- A(
906
+ T(
837
907
  "Shadow",
838
908
  {
839
909
  primary: "#a3a3a3",
@@ -847,7 +917,7 @@ A(
847
917
  { primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
848
918
  "#404040"
849
919
  );
850
- A(
920
+ T(
851
921
  "Emerald Dark",
852
922
  {
853
923
  primary: "#34d399",
@@ -861,7 +931,7 @@ A(
861
931
  { primary: "#ecfdf5", secondary: "#6ee7b7", muted: "#047857" },
862
932
  "#047857"
863
933
  );
864
- l(
934
+ f(
865
935
  "Forest",
866
936
  {
867
937
  primary: "#166534",
@@ -875,7 +945,7 @@ l(
875
945
  { primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
876
946
  "#86efac"
877
947
  );
878
- l(
948
+ f(
879
949
  "Ocean",
880
950
  {
881
951
  primary: "#0369a1",
@@ -889,7 +959,7 @@ l(
889
959
  { primary: "#0c4a6e", secondary: "#0369a1", muted: "#38bdf8" },
890
960
  "#7dd3fc"
891
961
  );
892
- l(
962
+ f(
893
963
  "Desert",
894
964
  {
895
965
  primary: "#b45309",
@@ -903,7 +973,7 @@ l(
903
973
  { primary: "#422006", secondary: "#713f12", muted: "#ca8a04" },
904
974
  "#fde047"
905
975
  );
906
- l(
976
+ f(
907
977
  "Sunset",
908
978
  {
909
979
  primary: "#ea580c",
@@ -917,7 +987,7 @@ l(
917
987
  { primary: "#431407", secondary: "#9a3412", muted: "#f97316" },
918
988
  "#fdba74"
919
989
  );
920
- l(
990
+ f(
921
991
  "Aurora",
922
992
  {
923
993
  primary: "#0d9488",
@@ -931,7 +1001,7 @@ l(
931
1001
  { primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
932
1002
  "#5eead4"
933
1003
  );
934
- l(
1004
+ f(
935
1005
  "Lavender",
936
1006
  {
937
1007
  primary: "#7e22ce",
@@ -945,7 +1015,7 @@ l(
945
1015
  { primary: "#3b0764", secondary: "#581c87", muted: "#a855f7" },
946
1016
  "#d8b4fe"
947
1017
  );
948
- l(
1018
+ f(
949
1019
  "Autumn",
950
1020
  {
951
1021
  primary: "#c2410c",
@@ -959,7 +1029,7 @@ l(
959
1029
  { primary: "#450a0a", secondary: "#7f1d1d", muted: "#f87171" },
960
1030
  "#fca5a5"
961
1031
  );
962
- l(
1032
+ f(
963
1033
  "Spring",
964
1034
  {
965
1035
  primary: "#16a34a",
@@ -973,7 +1043,7 @@ l(
973
1043
  { primary: "#14532d", secondary: "#166534", muted: "#4ade80" },
974
1044
  "#86efac"
975
1045
  );
976
- l(
1046
+ f(
977
1047
  "Arctic",
978
1048
  {
979
1049
  primary: "#0ea5e9",
@@ -987,7 +1057,7 @@ l(
987
1057
  { primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
988
1058
  "#bae6fd"
989
1059
  );
990
- l(
1060
+ f(
991
1061
  "Tropical",
992
1062
  {
993
1063
  primary: "#0d9488",
@@ -1001,7 +1071,7 @@ l(
1001
1071
  { primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
1002
1072
  "#a7f3d0"
1003
1073
  );
1004
- l(
1074
+ f(
1005
1075
  "Pastel Rose",
1006
1076
  {
1007
1077
  primary: "#f472b6",
@@ -1015,7 +1085,7 @@ l(
1015
1085
  { primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
1016
1086
  "#f9a8d4"
1017
1087
  );
1018
- l(
1088
+ f(
1019
1089
  "Pastel Sky",
1020
1090
  {
1021
1091
  primary: "#38bdf8",
@@ -1029,7 +1099,7 @@ l(
1029
1099
  { primary: "#075985", secondary: "#0369a1", muted: "#7dd3fc" },
1030
1100
  "#bae6fd"
1031
1101
  );
1032
- l(
1102
+ f(
1033
1103
  "Pastel Mint",
1034
1104
  {
1035
1105
  primary: "#34d399",
@@ -1043,7 +1113,7 @@ l(
1043
1113
  { primary: "#065f46", secondary: "#047857", muted: "#6ee7b7" },
1044
1114
  "#a7f3d0"
1045
1115
  );
1046
- l(
1116
+ f(
1047
1117
  "Pastel Peach",
1048
1118
  {
1049
1119
  primary: "#fb923c",
@@ -1057,7 +1127,7 @@ l(
1057
1127
  { primary: "#7c2d12", secondary: "#9a3412", muted: "#fdba74" },
1058
1128
  "#fed7aa"
1059
1129
  );
1060
- l(
1130
+ f(
1061
1131
  "Pastel Lavender",
1062
1132
  {
1063
1133
  primary: "#a78bfa",
@@ -1071,7 +1141,7 @@ l(
1071
1141
  { primary: "#4c1d95", secondary: "#5b21b6", muted: "#c4b5fd" },
1072
1142
  "#ddd6fe"
1073
1143
  );
1074
- l(
1144
+ f(
1075
1145
  "Pastel Lemon",
1076
1146
  {
1077
1147
  primary: "#facc15",
@@ -1085,7 +1155,7 @@ l(
1085
1155
  { primary: "#713f12", secondary: "#854d0e", muted: "#fde047" },
1086
1156
  "#fef08a"
1087
1157
  );
1088
- l(
1158
+ f(
1089
1159
  "Pastel Sage",
1090
1160
  {
1091
1161
  primary: "#86efac",
@@ -1099,7 +1169,7 @@ l(
1099
1169
  { primary: "#166534", secondary: "#15803d", muted: "#86efac" },
1100
1170
  "#bbf7d0"
1101
1171
  );
1102
- l(
1172
+ f(
1103
1173
  "Pastel Coral",
1104
1174
  {
1105
1175
  primary: "#fb7185",
@@ -1113,7 +1183,7 @@ l(
1113
1183
  { primary: "#881337", secondary: "#9f1239", muted: "#fda4af" },
1114
1184
  "#fecdd3"
1115
1185
  );
1116
- l(
1186
+ f(
1117
1187
  "Banking",
1118
1188
  {
1119
1189
  primary: "#1e3a5f",
@@ -1127,7 +1197,7 @@ l(
1127
1197
  { primary: "#0f172a", secondary: "#334155", muted: "#94a3b8" },
1128
1198
  "#cbd5e1"
1129
1199
  );
1130
- l(
1200
+ f(
1131
1201
  "Healthcare",
1132
1202
  {
1133
1203
  primary: "#0891b2",
@@ -1141,7 +1211,7 @@ l(
1141
1211
  { primary: "#134e4a", secondary: "#1a6b6a", muted: "#80cbc4" },
1142
1212
  "#b2dfdb"
1143
1213
  );
1144
- l(
1214
+ f(
1145
1215
  "Legal",
1146
1216
  {
1147
1217
  primary: "#1e293b",
@@ -1155,7 +1225,7 @@ l(
1155
1225
  { primary: "#0f172a", secondary: "#44403c", muted: "#a8a29e" },
1156
1226
  "#d6d3d1"
1157
1227
  );
1158
- l(
1228
+ f(
1159
1229
  "Tech Startup",
1160
1230
  {
1161
1231
  primary: "#7c3aed",
@@ -1169,7 +1239,7 @@ l(
1169
1239
  { primary: "#1e1b4b", secondary: "#4c1d95", muted: "#a78bfa" },
1170
1240
  "#c4b5fd"
1171
1241
  );
1172
- l(
1242
+ f(
1173
1243
  "Enterprise",
1174
1244
  {
1175
1245
  primary: "#1e40af",
@@ -1183,7 +1253,7 @@ l(
1183
1253
  { primary: "#1e3a5f", secondary: "#1e40af", muted: "#60a5fa" },
1184
1254
  "#93c5fd"
1185
1255
  );
1186
- l(
1256
+ f(
1187
1257
  "Government",
1188
1258
  {
1189
1259
  primary: "#1d4ed8",
@@ -1197,7 +1267,7 @@ l(
1197
1267
  { primary: "#0f172a", secondary: "#1e293b", muted: "#64748b" },
1198
1268
  "#cbd5e1"
1199
1269
  );
1200
- l(
1270
+ f(
1201
1271
  "Education",
1202
1272
  {
1203
1273
  primary: "#059669",
@@ -1211,7 +1281,7 @@ l(
1211
1281
  { primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
1212
1282
  "#a7f3d0"
1213
1283
  );
1214
- l(
1284
+ f(
1215
1285
  "Real Estate",
1216
1286
  {
1217
1287
  primary: "#92400e",
@@ -1225,7 +1295,7 @@ l(
1225
1295
  { primary: "#422006", secondary: "#713f12", muted: "#d97706" },
1226
1296
  "#fcd34d"
1227
1297
  );
1228
- l(
1298
+ f(
1229
1299
  "Nord",
1230
1300
  {
1231
1301
  primary: "#5e81ac",
@@ -1239,7 +1309,7 @@ l(
1239
1309
  { primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
1240
1310
  "#d8dee9"
1241
1311
  );
1242
- A(
1312
+ T(
1243
1313
  "Dracula",
1244
1314
  {
1245
1315
  primary: "#bd93f9",
@@ -1253,7 +1323,7 @@ A(
1253
1323
  { primary: "#f8f8f2", secondary: "#c0c0c0", muted: "#6272a4" },
1254
1324
  "#44475a"
1255
1325
  );
1256
- l(
1326
+ f(
1257
1327
  "Solarized Light",
1258
1328
  {
1259
1329
  primary: "#268bd2",
@@ -1267,7 +1337,7 @@ l(
1267
1337
  { primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
1268
1338
  "#eee8d5"
1269
1339
  );
1270
- A(
1340
+ T(
1271
1341
  "Solarized Dark",
1272
1342
  {
1273
1343
  primary: "#268bd2",
@@ -1281,7 +1351,7 @@ A(
1281
1351
  { primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75" },
1282
1352
  "#073642"
1283
1353
  );
1284
- A(
1354
+ T(
1285
1355
  "Monokai",
1286
1356
  {
1287
1357
  primary: "#66d9ef",
@@ -1295,7 +1365,7 @@ A(
1295
1365
  { primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
1296
1366
  "#3e3d32"
1297
1367
  );
1298
- A(
1368
+ T(
1299
1369
  "One Dark",
1300
1370
  {
1301
1371
  primary: "#61afef",
@@ -1309,7 +1379,7 @@ A(
1309
1379
  { primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
1310
1380
  "#3e4452"
1311
1381
  );
1312
- A(
1382
+ T(
1313
1383
  "Synthwave",
1314
1384
  {
1315
1385
  primary: "#ff7edb",
@@ -1323,7 +1393,7 @@ A(
1323
1393
  { primary: "#f0e4fc", secondary: "#b4a0cc", muted: "#6c5c84" },
1324
1394
  "#4a3866"
1325
1395
  );
1326
- l(
1396
+ f(
1327
1397
  "Vaporwave",
1328
1398
  {
1329
1399
  primary: "#ff71ce",
@@ -1337,7 +1407,7 @@ l(
1337
1407
  { primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
1338
1408
  "#d8a8e8"
1339
1409
  );
1340
- A(
1410
+ T(
1341
1411
  "Terminal Green",
1342
1412
  {
1343
1413
  primary: "#00ff41",
@@ -1351,7 +1421,7 @@ A(
1351
1421
  { primary: "#00ff41", secondary: "#00cc33", muted: "#008822" },
1352
1422
  "#003300"
1353
1423
  );
1354
- l(
1424
+ f(
1355
1425
  "Sepia",
1356
1426
  {
1357
1427
  primary: "#8b6914",
@@ -1365,7 +1435,7 @@ l(
1365
1435
  { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
1366
1436
  "#d7ccc8"
1367
1437
  );
1368
- l(
1438
+ f(
1369
1439
  "Vintage",
1370
1440
  {
1371
1441
  primary: "#8d6e63",
@@ -1379,7 +1449,7 @@ l(
1379
1449
  { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
1380
1450
  "#bcaaa4"
1381
1451
  );
1382
- A(
1452
+ T(
1383
1453
  "Cyberpunk",
1384
1454
  {
1385
1455
  primary: "#00f0ff",
@@ -1393,7 +1463,7 @@ A(
1393
1463
  { primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72" },
1394
1464
  "#1c3a44"
1395
1465
  );
1396
- A(
1466
+ T(
1397
1467
  "Neon",
1398
1468
  {
1399
1469
  primary: "#ff00ff",
@@ -1407,7 +1477,7 @@ A(
1407
1477
  { primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
1408
1478
  "#333333"
1409
1479
  );
1410
- A(
1480
+ T(
1411
1481
  "Retrowave",
1412
1482
  {
1413
1483
  primary: "#f77fbe",
@@ -1421,7 +1491,7 @@ A(
1421
1491
  { primary: "#ffe6f7", secondary: "#c9a0c9", muted: "#6b4c7a" },
1422
1492
  "#4a2d66"
1423
1493
  );
1424
- l(
1494
+ f(
1425
1495
  "Christmas",
1426
1496
  {
1427
1497
  primary: "#c41e3a",
@@ -1435,7 +1505,7 @@ l(
1435
1505
  { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
1436
1506
  "#e8a0a0"
1437
1507
  );
1438
- A(
1508
+ T(
1439
1509
  "Halloween",
1440
1510
  {
1441
1511
  primary: "#ff6600",
@@ -1449,7 +1519,7 @@ A(
1449
1519
  { primary: "#ffedd5", secondary: "#fdba74", muted: "#9a5c28" },
1450
1520
  "#5c3400"
1451
1521
  );
1452
- l(
1522
+ f(
1453
1523
  "Valentine",
1454
1524
  {
1455
1525
  primary: "#e11d48",
@@ -1463,7 +1533,7 @@ l(
1463
1533
  { primary: "#4c0519", secondary: "#881337", muted: "#f9a8d4" },
1464
1534
  "#fda4af"
1465
1535
  );
1466
- l(
1536
+ f(
1467
1537
  "Easter",
1468
1538
  {
1469
1539
  primary: "#a78bfa",
@@ -1477,7 +1547,7 @@ l(
1477
1547
  { primary: "#581c87", secondary: "#6d28d9", muted: "#c4b5fd" },
1478
1548
  "#ddd6fe"
1479
1549
  );
1480
- l(
1550
+ f(
1481
1551
  "Summer Beach",
1482
1552
  {
1483
1553
  primary: "#0ea5e9",
@@ -1491,7 +1561,7 @@ l(
1491
1561
  { primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
1492
1562
  "#fcd34d"
1493
1563
  );
1494
- l(
1564
+ f(
1495
1565
  "Winter Frost",
1496
1566
  {
1497
1567
  primary: "#3b82f6",
@@ -1505,7 +1575,7 @@ l(
1505
1575
  { primary: "#1e3a5f", secondary: "#1e40af", muted: "#93c5fd" },
1506
1576
  "#bfdbfe"
1507
1577
  );
1508
- l(
1578
+ f(
1509
1579
  "Cherry Blossom",
1510
1580
  {
1511
1581
  primary: "#ec4899",
@@ -1519,7 +1589,7 @@ l(
1519
1589
  { primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
1520
1590
  "#fbcfe8"
1521
1591
  );
1522
- l(
1592
+ f(
1523
1593
  "Harvest",
1524
1594
  {
1525
1595
  primary: "#b45309",
@@ -1533,7 +1603,7 @@ l(
1533
1603
  { primary: "#451a03", secondary: "#78350f", muted: "#d97706" },
1534
1604
  "#fcd34d"
1535
1605
  );
1536
- l(
1606
+ f(
1537
1607
  "Japanese Zen",
1538
1608
  {
1539
1609
  primary: "#6b7280",
@@ -1547,7 +1617,7 @@ l(
1547
1617
  { primary: "#2c2c2c", secondary: "#5c5c5c", muted: "#a0998a" },
1548
1618
  "#d5cec0"
1549
1619
  );
1550
- l(
1620
+ f(
1551
1621
  "Moroccan",
1552
1622
  {
1553
1623
  primary: "#c2410c",
@@ -1561,7 +1631,7 @@ l(
1561
1631
  { primary: "#3a1a00", secondary: "#7c2d12", muted: "#d97706" },
1562
1632
  "#f5d0a0"
1563
1633
  );
1564
- l(
1634
+ f(
1565
1635
  "Scandinavian",
1566
1636
  {
1567
1637
  primary: "#4b5563",
@@ -1575,7 +1645,7 @@ l(
1575
1645
  { primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
1576
1646
  "#e5e7eb"
1577
1647
  );
1578
- l(
1648
+ f(
1579
1649
  "Mediterranean",
1580
1650
  {
1581
1651
  primary: "#1e40af",
@@ -1589,7 +1659,7 @@ l(
1589
1659
  { primary: "#1e3a5f", secondary: "#2563eb", muted: "#93c5fd" },
1590
1660
  "#bfdbfe"
1591
1661
  );
1592
- l(
1662
+ f(
1593
1663
  "Chinese New Year",
1594
1664
  {
1595
1665
  primary: "#dc2626",
@@ -1603,7 +1673,7 @@ l(
1603
1673
  { primary: "#450a0a", secondary: "#991b1b", muted: "#f87171" },
1604
1674
  "#fca5a5"
1605
1675
  );
1606
- l(
1676
+ f(
1607
1677
  "Indian Festive",
1608
1678
  {
1609
1679
  primary: "#d97706",
@@ -1617,7 +1687,7 @@ l(
1617
1687
  { primary: "#451a03", secondary: "#92400e", muted: "#f59e0b" },
1618
1688
  "#fcd34d"
1619
1689
  );
1620
- l(
1690
+ f(
1621
1691
  "Brazilian Carnival",
1622
1692
  {
1623
1693
  primary: "#16a34a",
@@ -1631,7 +1701,7 @@ l(
1631
1701
  { primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
1632
1702
  "#86efac"
1633
1703
  );
1634
- l(
1704
+ f(
1635
1705
  "African Earth",
1636
1706
  {
1637
1707
  primary: "#92400e",
@@ -1645,7 +1715,7 @@ l(
1645
1715
  { primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
1646
1716
  "#d4b896"
1647
1717
  );
1648
- A(
1718
+ T(
1649
1719
  "High Contrast Dark",
1650
1720
  {
1651
1721
  primary: "#ffff00",
@@ -1659,7 +1729,7 @@ A(
1659
1729
  { primary: "#ffffff", secondary: "#ffffff", muted: "#cccccc" },
1660
1730
  "#ffffff"
1661
1731
  );
1662
- l(
1732
+ f(
1663
1733
  "Monochrome",
1664
1734
  {
1665
1735
  primary: "#404040",
@@ -1673,7 +1743,7 @@ l(
1673
1743
  { primary: "#1a1a1a", secondary: "#404040", muted: "#808080" },
1674
1744
  "#c0c0c0"
1675
1745
  );
1676
- l(
1746
+ f(
1677
1747
  "Enhanced Contrast",
1678
1748
  {
1679
1749
  primary: "#0050b3",
@@ -1687,7 +1757,7 @@ l(
1687
1757
  { primary: "#000000", secondary: "#1a1a1a", muted: "#595959" },
1688
1758
  "#8c8c8c"
1689
1759
  );
1690
- l(
1760
+ f(
1691
1761
  "Minimalist",
1692
1762
  {
1693
1763
  primary: "#18181b",
@@ -1701,7 +1771,7 @@ l(
1701
1771
  { primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
1702
1772
  "#e5e5e5"
1703
1773
  );
1704
- A(
1774
+ T(
1705
1775
  "Warm Dark",
1706
1776
  {
1707
1777
  primary: "#f59e0b",
@@ -1715,7 +1785,7 @@ A(
1715
1785
  { primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
1716
1786
  "#57534e"
1717
1787
  );
1718
- A(
1788
+ T(
1719
1789
  "Soft Dark",
1720
1790
  {
1721
1791
  primary: "#a78bfa",
@@ -1729,7 +1799,7 @@ A(
1729
1799
  { primary: "#e8e8f0", secondary: "#a0a0b8", muted: "#5c5c74" },
1730
1800
  "#3e3e58"
1731
1801
  );
1732
- l(
1802
+ f(
1733
1803
  "Coffee",
1734
1804
  {
1735
1805
  primary: "#6f4e37",
@@ -1743,7 +1813,7 @@ l(
1743
1813
  { primary: "#2c1a0e", secondary: "#5c3d28", muted: "#a08868" },
1744
1814
  "#d4c4a8"
1745
1815
  );
1746
- l(
1816
+ f(
1747
1817
  "Wine",
1748
1818
  {
1749
1819
  primary: "#7f1d1d",
@@ -1757,8 +1827,9 @@ l(
1757
1827
  { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
1758
1828
  "#e8a0a0"
1759
1829
  );
1760
- M(null);
1761
- const Ve = [
1830
+ D(null);
1831
+ D(null);
1832
+ const ze = [
1762
1833
  {
1763
1834
  target: ".nice-api-designer",
1764
1835
  titleKey: "tutorial.apiDesigner.intro.title",
@@ -1767,7 +1838,7 @@ const Ve = [
1767
1838
  content: "Define endpoints, parameters, request/response schemas and security for your OpenAPI document.",
1768
1839
  placement: "auto"
1769
1840
  }
1770
- ], ze = {
1841
+ ], Fe = {
1771
1842
  openapi: "3.0.3",
1772
1843
  info: {
1773
1844
  title: "New API",
@@ -1780,44 +1851,44 @@ const Ve = [
1780
1851
  securitySchemes: {}
1781
1852
  },
1782
1853
  tags: []
1783
- }, Ne = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
1784
- function le(e) {
1854
+ }, He = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
1855
+ function pe(r) {
1785
1856
  var i, n;
1786
1857
  const a = [];
1787
- return e.openapi || a.push({ path: "openapi", message: "OpenAPI version is required", severity: "error" }), (i = e.info) != null && i.title || a.push({ path: "info.title", message: "API title is required", severity: "error" }), (n = e.info) != null && n.version || a.push({ path: "info.version", message: "API version is required", severity: "error" }), Object.entries(e.paths || {}).forEach(([s, u]) => {
1788
- s.startsWith("/") || a.push({ path: `paths.${s}`, message: "Path must start with /", severity: "error" }), Ne.forEach((f) => {
1789
- const y = u[f.toLowerCase()];
1858
+ return r.openapi || a.push({ path: "openapi", message: "OpenAPI version is required", severity: "error" }), (i = r.info) != null && i.title || a.push({ path: "info.title", message: "API title is required", severity: "error" }), (n = r.info) != null && n.version || a.push({ path: "info.version", message: "API version is required", severity: "error" }), Object.entries(r.paths || {}).forEach(([c, u]) => {
1859
+ c.startsWith("/") || a.push({ path: `paths.${c}`, message: "Path must start with /", severity: "error" }), He.forEach((l) => {
1860
+ const y = u[l.toLowerCase()];
1790
1861
  y && !y.responses && a.push({
1791
- path: `paths.${s}.${f.toLowerCase()}.responses`,
1862
+ path: `paths.${c}.${l.toLowerCase()}.responses`,
1792
1863
  message: "Responses are required",
1793
1864
  severity: "error"
1794
1865
  });
1795
1866
  });
1796
1867
  }), a;
1797
1868
  }
1798
- function _r({
1799
- schema: e,
1869
+ function wr({
1870
+ schema: r,
1800
1871
  onChange: a,
1801
1872
  onSave: i,
1802
1873
  readOnly: n = !1,
1803
- className: s = "",
1874
+ className: c = "",
1804
1875
  tutorial: u
1805
1876
  }) {
1806
- var O, q;
1807
- const [f, y] = g(e || ze), [b, d] = g(null), [v, k] = g(null), [m, T] = g("info"), [_, I] = g([]), H = P(
1877
+ var I, j;
1878
+ const [l, y] = v(r || Fe), [b, d] = v(null), [h, S] = v(null), [m, k] = v("info"), [g, P] = v([]), C = R(
1808
1879
  (w) => {
1809
- y((x) => {
1810
- const S = w(x);
1811
- return a == null || a(S), I(le(S)), S;
1880
+ y((N) => {
1881
+ const x = w(N);
1882
+ return a == null || a(x), P(pe(x)), x;
1812
1883
  });
1813
1884
  },
1814
1885
  [a]
1815
- ), K = P(() => {
1886
+ ), O = R(() => {
1816
1887
  const w = "/new-endpoint";
1817
- H((x) => ({
1818
- ...x,
1888
+ C((N) => ({
1889
+ ...N,
1819
1890
  paths: {
1820
- ...x.paths,
1891
+ ...N.paths,
1821
1892
  [w]: {
1822
1893
  get: {
1823
1894
  summary: "New endpoint",
@@ -1825,204 +1896,213 @@ function _r({
1825
1896
  }
1826
1897
  }
1827
1898
  }
1828
- })), d(w), k("get");
1829
- }, [H]), j = P(
1899
+ })), d(w), S("get");
1900
+ }, [C]), U = R(
1830
1901
  (w) => {
1831
- H((x) => {
1832
- const { [w]: S, ...B } = x.paths;
1833
- return { ...x, paths: B };
1834
- }), d(null), k(null);
1902
+ C((N) => {
1903
+ const { [w]: x, ...K } = N.paths;
1904
+ return { ...N, paths: K };
1905
+ }), d(null), S(null);
1835
1906
  },
1836
- [H]
1837
- ), G = P(() => {
1907
+ [C]
1908
+ ), W = R(() => {
1838
1909
  const w = "NewSchema";
1839
- H((x) => {
1840
- var S;
1910
+ C((N) => {
1911
+ var x;
1841
1912
  return {
1842
- ...x,
1913
+ ...N,
1843
1914
  components: {
1844
- ...x.components,
1915
+ ...N.components,
1845
1916
  schemas: {
1846
- ...(S = x.components) == null ? void 0 : S.schemas,
1917
+ ...(x = N.components) == null ? void 0 : x.schemas,
1847
1918
  [w]: { type: "object", properties: {} }
1848
1919
  }
1849
1920
  }
1850
1921
  };
1851
1922
  });
1852
- }, [H]), $ = P(() => {
1853
- const w = le(f);
1854
- I(w), w.filter((x) => x.severity === "error").length === 0 && (i == null || i(f));
1855
- }, [f, i]), U = Object.entries(f.paths).flatMap(
1856
- ([w, x]) => Ne.filter((S) => x[S.toLowerCase()]).map(
1857
- (S) => ({
1923
+ }, [C]), $ = R(() => {
1924
+ const w = pe(l);
1925
+ P(w), w.filter((N) => N.severity === "error").length === 0 && (i == null || i(l));
1926
+ }, [l, i]), L = Object.entries(l.paths).flatMap(
1927
+ ([w, N]) => He.filter((x) => N[x.toLowerCase()]).map(
1928
+ (x) => ({
1858
1929
  path: w,
1859
- method: S,
1860
- operation: x[S.toLowerCase()]
1930
+ method: x,
1931
+ operation: N[x.toLowerCase()]
1861
1932
  })
1862
1933
  )
1863
1934
  );
1864
- return /* @__PURE__ */ t("div", { className: `nice-api-designer ${s}`, style: { position: "relative" }, children: [
1865
- u && /* @__PURE__ */ r("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ r(re, { steps: ee(u, Ve) }) }),
1866
- /* @__PURE__ */ t("div", { className: "nice-api-designer__toolbar", children: [
1867
- /* @__PURE__ */ r("div", { className: "nice-api-designer__tabs", children: ["info", "paths", "schemas", "security", "preview"].map((w) => /* @__PURE__ */ r(
1868
- "button",
1869
- {
1870
- className: `nice-api-designer__tab ${m === w ? "nice-api-designer__tab--active" : ""}`,
1871
- onClick: () => T(w),
1872
- children: w.charAt(0).toUpperCase() + w.slice(1)
1873
- },
1874
- w
1875
- )) }),
1876
- !n && /* @__PURE__ */ r("button", { className: "nice-api-designer__save-btn", onClick: $, children: "Save" })
1877
- ] }),
1878
- _.length > 0 && /* @__PURE__ */ r("div", { className: "nice-api-designer__errors", children: _.map((w, x) => /* @__PURE__ */ t(
1879
- "div",
1935
+ return /* @__PURE__ */ t("div", { style: { position: "relative", height: "100%" }, children: [
1936
+ u && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ie, { steps: ae(u, ze) }) }),
1937
+ /* @__PURE__ */ e(
1938
+ de,
1880
1939
  {
1881
- className: `nice-api-designer__error nice-api-designer__error--${w.severity}`,
1882
- children: [
1883
- /* @__PURE__ */ t("strong", { children: [
1884
- w.path,
1885
- ":"
1886
- ] }),
1887
- " ",
1888
- w.message
1889
- ]
1890
- },
1891
- x
1892
- )) }),
1893
- /* @__PURE__ */ t("div", { className: "nice-api-designer__content", children: [
1894
- m === "info" && /* @__PURE__ */ r(Fe, { schema: f, onChange: H, readOnly: n }),
1895
- m === "paths" && /* @__PURE__ */ r(
1896
- We,
1897
- {
1898
- endpoints: U,
1899
- schema: f,
1900
- selectedPath: b,
1901
- selectedMethod: v,
1902
- onSelectEndpoint: (w, x) => {
1903
- d(w), k(x);
1940
+ flush: !0,
1941
+ className: `nice-api-designer ${c}`,
1942
+ height: "100%",
1943
+ style: { minHeight: 600 },
1944
+ toolbar: /* @__PURE__ */ t("div", { className: "nice-api-designer__toolbar", children: [
1945
+ /* @__PURE__ */ e("div", { className: "nice-api-designer__tabs", children: ["info", "paths", "schemas", "security", "preview"].map((w) => /* @__PURE__ */ e(
1946
+ "button",
1947
+ {
1948
+ className: `nice-api-designer__tab ${m === w ? "nice-api-designer__tab--active" : ""}`,
1949
+ onClick: () => k(w),
1950
+ children: w.charAt(0).toUpperCase() + w.slice(1)
1951
+ },
1952
+ w
1953
+ )) }),
1954
+ !n && /* @__PURE__ */ e("button", { className: "nice-api-designer__save-btn", onClick: $, children: "Save" })
1955
+ ] }),
1956
+ bottomPanel: g.length > 0 ? /* @__PURE__ */ e("div", { className: "nice-api-designer__errors", children: g.map((w, N) => /* @__PURE__ */ t(
1957
+ "div",
1958
+ {
1959
+ className: `nice-api-designer__error nice-api-designer__error--${w.severity}`,
1960
+ children: [
1961
+ /* @__PURE__ */ t("strong", { children: [
1962
+ w.path,
1963
+ ":"
1964
+ ] }),
1965
+ " ",
1966
+ w.message
1967
+ ]
1904
1968
  },
1905
- onAdd: K,
1906
- onDelete: j,
1907
- onChange: H,
1908
- readOnly: n
1909
- }
1910
- ),
1911
- m === "schemas" && /* @__PURE__ */ r(
1912
- Je,
1913
- {
1914
- schemas: ((O = f.components) == null ? void 0 : O.schemas) || {},
1915
- onAdd: G,
1916
- onChange: (w) => H((x) => ({
1917
- ...x,
1918
- components: { ...x.components, schemas: w }
1919
- })),
1920
- readOnly: n
1921
- }
1922
- ),
1923
- m === "security" && /* @__PURE__ */ r(
1924
- Ge,
1925
- {
1926
- schemes: ((q = f.components) == null ? void 0 : q.securitySchemes) || {},
1927
- onChange: (w) => H((x) => ({
1928
- ...x,
1929
- components: { ...x.components, securitySchemes: w }
1930
- })),
1931
- readOnly: n
1932
- }
1933
- ),
1934
- m === "preview" && /* @__PURE__ */ r(Xe, { schema: f })
1935
- ] })
1969
+ N
1970
+ )) }) : void 0,
1971
+ children: /* @__PURE__ */ t("div", { className: "nice-api-designer__content", children: [
1972
+ m === "info" && /* @__PURE__ */ e(We, { schema: l, onChange: C, readOnly: n }),
1973
+ m === "paths" && /* @__PURE__ */ e(
1974
+ Je,
1975
+ {
1976
+ endpoints: L,
1977
+ schema: l,
1978
+ selectedPath: b,
1979
+ selectedMethod: h,
1980
+ onSelectEndpoint: (w, N) => {
1981
+ d(w), S(N);
1982
+ },
1983
+ onAdd: O,
1984
+ onDelete: U,
1985
+ onChange: C,
1986
+ readOnly: n
1987
+ }
1988
+ ),
1989
+ m === "schemas" && /* @__PURE__ */ e(
1990
+ Ge,
1991
+ {
1992
+ schemas: ((I = l.components) == null ? void 0 : I.schemas) || {},
1993
+ onAdd: W,
1994
+ onChange: (w) => C((N) => ({
1995
+ ...N,
1996
+ components: { ...N.components, schemas: w }
1997
+ })),
1998
+ readOnly: n
1999
+ }
2000
+ ),
2001
+ m === "security" && /* @__PURE__ */ e(
2002
+ Xe,
2003
+ {
2004
+ schemes: ((j = l.components) == null ? void 0 : j.securitySchemes) || {},
2005
+ onChange: (w) => C((N) => ({
2006
+ ...N,
2007
+ components: { ...N.components, securitySchemes: w }
2008
+ })),
2009
+ readOnly: n
2010
+ }
2011
+ ),
2012
+ m === "preview" && /* @__PURE__ */ e(Ye, { schema: l })
2013
+ ] })
2014
+ }
2015
+ )
1936
2016
  ] });
1937
2017
  }
1938
- function Fe({ schema: e, onChange: a, readOnly: i }) {
2018
+ function We({ schema: r, onChange: a, readOnly: i }) {
1939
2019
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__info-editor", children: [
1940
- /* @__PURE__ */ r("h3", { children: "API Information" }),
2020
+ /* @__PURE__ */ e("h3", { children: "API Information" }),
1941
2021
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
1942
- /* @__PURE__ */ r("label", { children: "Title" }),
1943
- /* @__PURE__ */ r(
2022
+ /* @__PURE__ */ e("label", { children: "Title" }),
2023
+ /* @__PURE__ */ e(
1944
2024
  "input",
1945
2025
  {
1946
2026
  type: "text",
1947
- value: e.info.title,
1948
- onChange: (n) => a((s) => ({
1949
- ...s,
1950
- info: { ...s.info, title: n.target.value }
2027
+ value: r.info.title,
2028
+ onChange: (n) => a((c) => ({
2029
+ ...c,
2030
+ info: { ...c.info, title: n.target.value }
1951
2031
  })),
1952
2032
  disabled: i
1953
2033
  }
1954
2034
  )
1955
2035
  ] }),
1956
2036
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
1957
- /* @__PURE__ */ r("label", { children: "Version" }),
1958
- /* @__PURE__ */ r(
2037
+ /* @__PURE__ */ e("label", { children: "Version" }),
2038
+ /* @__PURE__ */ e(
1959
2039
  "input",
1960
2040
  {
1961
2041
  type: "text",
1962
- value: e.info.version,
1963
- onChange: (n) => a((s) => ({
1964
- ...s,
1965
- info: { ...s.info, version: n.target.value }
2042
+ value: r.info.version,
2043
+ onChange: (n) => a((c) => ({
2044
+ ...c,
2045
+ info: { ...c.info, version: n.target.value }
1966
2046
  })),
1967
2047
  disabled: i
1968
2048
  }
1969
2049
  )
1970
2050
  ] }),
1971
2051
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
1972
- /* @__PURE__ */ r("label", { children: "Description" }),
1973
- /* @__PURE__ */ r(
2052
+ /* @__PURE__ */ e("label", { children: "Description" }),
2053
+ /* @__PURE__ */ e(
1974
2054
  "textarea",
1975
2055
  {
1976
- value: e.info.description || "",
1977
- onChange: (n) => a((s) => ({
1978
- ...s,
1979
- info: { ...s.info, description: n.target.value }
2056
+ value: r.info.description || "",
2057
+ onChange: (n) => a((c) => ({
2058
+ ...c,
2059
+ info: { ...c.info, description: n.target.value }
1980
2060
  })),
1981
2061
  disabled: i,
1982
2062
  rows: 5
1983
2063
  }
1984
2064
  )
1985
2065
  ] }),
1986
- /* @__PURE__ */ r("h4", { children: "Servers" }),
1987
- (e.servers || []).map((n, s) => /* @__PURE__ */ t("div", { className: "nice-api-designer__server", children: [
1988
- /* @__PURE__ */ r(
2066
+ /* @__PURE__ */ e("h4", { children: "Servers" }),
2067
+ (r.servers || []).map((n, c) => /* @__PURE__ */ t("div", { className: "nice-api-designer__server", children: [
2068
+ /* @__PURE__ */ e(
1989
2069
  "input",
1990
2070
  {
1991
2071
  type: "text",
1992
2072
  value: n.url,
1993
2073
  placeholder: "Server URL",
1994
- onChange: (u) => a((f) => {
2074
+ onChange: (u) => a((l) => {
1995
2075
  var y;
1996
2076
  return {
1997
- ...f,
1998
- servers: (y = f.servers) == null ? void 0 : y.map(
1999
- (b, d) => d === s ? { ...b, url: u.target.value } : b
2077
+ ...l,
2078
+ servers: (y = l.servers) == null ? void 0 : y.map(
2079
+ (b, d) => d === c ? { ...b, url: u.target.value } : b
2000
2080
  )
2001
2081
  };
2002
2082
  }),
2003
2083
  disabled: i
2004
2084
  }
2005
2085
  ),
2006
- /* @__PURE__ */ r(
2086
+ /* @__PURE__ */ e(
2007
2087
  "input",
2008
2088
  {
2009
2089
  type: "text",
2010
2090
  value: n.description || "",
2011
2091
  placeholder: "Description",
2012
- onChange: (u) => a((f) => {
2092
+ onChange: (u) => a((l) => {
2013
2093
  var y;
2014
2094
  return {
2015
- ...f,
2016
- servers: (y = f.servers) == null ? void 0 : y.map(
2017
- (b, d) => d === s ? { ...b, description: u.target.value } : b
2095
+ ...l,
2096
+ servers: (y = l.servers) == null ? void 0 : y.map(
2097
+ (b, d) => d === c ? { ...b, description: u.target.value } : b
2018
2098
  )
2019
2099
  };
2020
2100
  }),
2021
2101
  disabled: i
2022
2102
  }
2023
2103
  )
2024
- ] }, s)),
2025
- !i && /* @__PURE__ */ r(
2104
+ ] }, c)),
2105
+ !i && /* @__PURE__ */ e(
2026
2106
  "button",
2027
2107
  {
2028
2108
  onClick: () => a((n) => ({
@@ -2034,42 +2114,42 @@ function Fe({ schema: e, onChange: a, readOnly: i }) {
2034
2114
  )
2035
2115
  ] });
2036
2116
  }
2037
- function We({
2038
- endpoints: e,
2117
+ function Je({
2118
+ endpoints: r,
2039
2119
  schema: a,
2040
2120
  selectedPath: i,
2041
2121
  selectedMethod: n,
2042
- onSelectEndpoint: s,
2122
+ onSelectEndpoint: c,
2043
2123
  onAdd: u,
2044
- onDelete: f,
2124
+ onDelete: l,
2045
2125
  onChange: y,
2046
2126
  readOnly: b
2047
2127
  }) {
2048
- var v;
2049
- const d = i && n ? (v = a.paths[i]) == null ? void 0 : v[n] : null;
2128
+ var h;
2129
+ const d = i && n ? (h = a.paths[i]) == null ? void 0 : h[n] : null;
2050
2130
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__paths-editor", children: [
2051
2131
  /* @__PURE__ */ t("div", { className: "nice-api-designer__endpoints-list", children: [
2052
2132
  /* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
2053
- /* @__PURE__ */ r("h3", { children: "Endpoints" }),
2054
- !b && /* @__PURE__ */ r("button", { onClick: u, children: "+ Add" })
2133
+ /* @__PURE__ */ e("h3", { children: "Endpoints" }),
2134
+ !b && /* @__PURE__ */ e("button", { onClick: u, children: "+ Add" })
2055
2135
  ] }),
2056
- e.map(({ path: k, method: m }) => /* @__PURE__ */ t(
2136
+ r.map(({ path: S, method: m }) => /* @__PURE__ */ t(
2057
2137
  "div",
2058
2138
  {
2059
- className: `nice-api-designer__endpoint ${i === k && n === m.toLowerCase() ? "nice-api-designer__endpoint--selected" : ""}`,
2060
- onClick: () => s(k, m.toLowerCase()),
2139
+ className: `nice-api-designer__endpoint ${i === S && n === m.toLowerCase() ? "nice-api-designer__endpoint--selected" : ""}`,
2140
+ onClick: () => c(S, m.toLowerCase()),
2061
2141
  children: [
2062
- /* @__PURE__ */ r(
2142
+ /* @__PURE__ */ e(
2063
2143
  "span",
2064
2144
  {
2065
2145
  className: `nice-api-designer__method nice-api-designer__method--${m.toLowerCase()}`,
2066
2146
  children: m
2067
2147
  }
2068
2148
  ),
2069
- /* @__PURE__ */ r("span", { className: "nice-api-designer__path", children: k })
2149
+ /* @__PURE__ */ e("span", { className: "nice-api-designer__path", children: S })
2070
2150
  ]
2071
2151
  },
2072
- `${m}-${k}`
2152
+ `${m}-${S}`
2073
2153
  ))
2074
2154
  ] }),
2075
2155
  d && i && n && /* @__PURE__ */ t("div", { className: "nice-api-designer__operation-editor", children: [
@@ -2079,13 +2159,13 @@ function We({
2079
2159
  i
2080
2160
  ] }),
2081
2161
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
2082
- /* @__PURE__ */ r("label", { children: "Summary" }),
2083
- /* @__PURE__ */ r(
2162
+ /* @__PURE__ */ e("label", { children: "Summary" }),
2163
+ /* @__PURE__ */ e(
2084
2164
  "input",
2085
2165
  {
2086
2166
  type: "text",
2087
2167
  value: d.summary || "",
2088
- onChange: (k) => y((m) => ({
2168
+ onChange: (S) => y((m) => ({
2089
2169
  ...m,
2090
2170
  paths: {
2091
2171
  ...m.paths,
@@ -2093,7 +2173,7 @@ function We({
2093
2173
  ...m.paths[i],
2094
2174
  [n]: {
2095
2175
  ...d,
2096
- summary: k.target.value
2176
+ summary: S.target.value
2097
2177
  }
2098
2178
  }
2099
2179
  }
@@ -2103,12 +2183,12 @@ function We({
2103
2183
  )
2104
2184
  ] }),
2105
2185
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
2106
- /* @__PURE__ */ r("label", { children: "Description" }),
2107
- /* @__PURE__ */ r(
2186
+ /* @__PURE__ */ e("label", { children: "Description" }),
2187
+ /* @__PURE__ */ e(
2108
2188
  "textarea",
2109
2189
  {
2110
2190
  value: d.description || "",
2111
- onChange: (k) => y((m) => ({
2191
+ onChange: (S) => y((m) => ({
2112
2192
  ...m,
2113
2193
  paths: {
2114
2194
  ...m.paths,
@@ -2116,7 +2196,7 @@ function We({
2116
2196
  ...m.paths[i],
2117
2197
  [n]: {
2118
2198
  ...d,
2119
- description: k.target.value
2199
+ description: S.target.value
2120
2200
  }
2121
2201
  }
2122
2202
  }
@@ -2127,13 +2207,13 @@ function We({
2127
2207
  )
2128
2208
  ] }),
2129
2209
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
2130
- /* @__PURE__ */ r("label", { children: "Operation ID" }),
2131
- /* @__PURE__ */ r(
2210
+ /* @__PURE__ */ e("label", { children: "Operation ID" }),
2211
+ /* @__PURE__ */ e(
2132
2212
  "input",
2133
2213
  {
2134
2214
  type: "text",
2135
2215
  value: d.operationId || "",
2136
- onChange: (k) => y((m) => ({
2216
+ onChange: (S) => y((m) => ({
2137
2217
  ...m,
2138
2218
  paths: {
2139
2219
  ...m.paths,
@@ -2141,7 +2221,7 @@ function We({
2141
2221
  ...m.paths[i],
2142
2222
  [n]: {
2143
2223
  ...d,
2144
- operationId: k.target.value
2224
+ operationId: S.target.value
2145
2225
  }
2146
2226
  }
2147
2227
  }
@@ -2150,76 +2230,76 @@ function We({
2150
2230
  }
2151
2231
  )
2152
2232
  ] }),
2153
- !b && /* @__PURE__ */ r(
2233
+ !b && /* @__PURE__ */ e(
2154
2234
  "button",
2155
2235
  {
2156
2236
  className: "nice-api-designer__delete-btn",
2157
- onClick: () => f(i),
2237
+ onClick: () => l(i),
2158
2238
  children: "Delete Endpoint"
2159
2239
  }
2160
2240
  )
2161
2241
  ] })
2162
2242
  ] });
2163
2243
  }
2164
- function Je({
2165
- schemas: e,
2244
+ function Ge({
2245
+ schemas: r,
2166
2246
  onAdd: a,
2167
2247
  onChange: i,
2168
2248
  readOnly: n
2169
2249
  }) {
2170
- const [s, u] = g(null);
2250
+ const [c, u] = v(null);
2171
2251
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__schemas-editor", children: [
2172
2252
  /* @__PURE__ */ t("div", { className: "nice-api-designer__schemas-list", children: [
2173
2253
  /* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
2174
- /* @__PURE__ */ r("h3", { children: "Schemas" }),
2175
- !n && /* @__PURE__ */ r("button", { onClick: a, children: "+ Add" })
2254
+ /* @__PURE__ */ e("h3", { children: "Schemas" }),
2255
+ !n && /* @__PURE__ */ e("button", { onClick: a, children: "+ Add" })
2176
2256
  ] }),
2177
- Object.keys(e).map((f) => /* @__PURE__ */ r(
2257
+ Object.keys(r).map((l) => /* @__PURE__ */ e(
2178
2258
  "div",
2179
2259
  {
2180
- className: `nice-api-designer__schema-item ${s === f ? "nice-api-designer__schema-item--selected" : ""}`,
2181
- onClick: () => u(f),
2182
- children: f
2260
+ className: `nice-api-designer__schema-item ${c === l ? "nice-api-designer__schema-item--selected" : ""}`,
2261
+ onClick: () => u(l),
2262
+ children: l
2183
2263
  },
2184
- f
2264
+ l
2185
2265
  ))
2186
2266
  ] }),
2187
- s && e[s] && /* @__PURE__ */ t("div", { className: "nice-api-designer__schema-editor", children: [
2188
- /* @__PURE__ */ r("h3", { children: s }),
2267
+ c && r[c] && /* @__PURE__ */ t("div", { className: "nice-api-designer__schema-editor", children: [
2268
+ /* @__PURE__ */ e("h3", { children: c }),
2189
2269
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
2190
- /* @__PURE__ */ r("label", { children: "Type" }),
2270
+ /* @__PURE__ */ e("label", { children: "Type" }),
2191
2271
  /* @__PURE__ */ t(
2192
2272
  "select",
2193
2273
  {
2194
- value: e[s].type || "object",
2195
- onChange: (f) => i({
2196
- ...e,
2197
- [s]: {
2198
- ...e[s],
2199
- type: f.target.value
2274
+ value: r[c].type || "object",
2275
+ onChange: (l) => i({
2276
+ ...r,
2277
+ [c]: {
2278
+ ...r[c],
2279
+ type: l.target.value
2200
2280
  }
2201
2281
  }),
2202
2282
  disabled: n,
2203
2283
  children: [
2204
- /* @__PURE__ */ r("option", { value: "object", children: "object" }),
2205
- /* @__PURE__ */ r("option", { value: "array", children: "array" }),
2206
- /* @__PURE__ */ r("option", { value: "string", children: "string" }),
2207
- /* @__PURE__ */ r("option", { value: "number", children: "number" }),
2208
- /* @__PURE__ */ r("option", { value: "integer", children: "integer" }),
2209
- /* @__PURE__ */ r("option", { value: "boolean", children: "boolean" })
2284
+ /* @__PURE__ */ e("option", { value: "object", children: "object" }),
2285
+ /* @__PURE__ */ e("option", { value: "array", children: "array" }),
2286
+ /* @__PURE__ */ e("option", { value: "string", children: "string" }),
2287
+ /* @__PURE__ */ e("option", { value: "number", children: "number" }),
2288
+ /* @__PURE__ */ e("option", { value: "integer", children: "integer" }),
2289
+ /* @__PURE__ */ e("option", { value: "boolean", children: "boolean" })
2210
2290
  ]
2211
2291
  }
2212
2292
  )
2213
2293
  ] }),
2214
2294
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
2215
- /* @__PURE__ */ r("label", { children: "Description" }),
2216
- /* @__PURE__ */ r(
2295
+ /* @__PURE__ */ e("label", { children: "Description" }),
2296
+ /* @__PURE__ */ e(
2217
2297
  "textarea",
2218
2298
  {
2219
- value: e[s].description || "",
2220
- onChange: (f) => i({
2221
- ...e,
2222
- [s]: { ...e[s], description: f.target.value }
2299
+ value: r[c].description || "",
2300
+ onChange: (l) => i({
2301
+ ...r,
2302
+ [c]: { ...r[c], description: l.target.value }
2223
2303
  }),
2224
2304
  disabled: n,
2225
2305
  rows: 3
@@ -2227,15 +2307,15 @@ function Je({
2227
2307
  )
2228
2308
  ] }),
2229
2309
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
2230
- /* @__PURE__ */ r("label", { children: "JSON Schema" }),
2231
- /* @__PURE__ */ r(
2310
+ /* @__PURE__ */ e("label", { children: "JSON Schema" }),
2311
+ /* @__PURE__ */ e(
2232
2312
  "textarea",
2233
2313
  {
2234
- value: JSON.stringify(e[s], null, 2),
2235
- onChange: (f) => {
2314
+ value: JSON.stringify(r[c], null, 2),
2315
+ onChange: (l) => {
2236
2316
  try {
2237
- const y = JSON.parse(f.target.value);
2238
- i({ ...e, [s]: y });
2317
+ const y = JSON.parse(l.target.value);
2318
+ i({ ...r, [c]: y });
2239
2319
  } catch {
2240
2320
  }
2241
2321
  },
@@ -2248,30 +2328,30 @@ function Je({
2248
2328
  ] })
2249
2329
  ] });
2250
2330
  }
2251
- function Ge({ schemes: e, onChange: a, readOnly: i }) {
2331
+ function Xe({ schemes: r, onChange: a, readOnly: i }) {
2252
2332
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__security-editor", children: [
2253
2333
  /* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
2254
- /* @__PURE__ */ r("h3", { children: "Security Schemes" }),
2255
- !i && /* @__PURE__ */ r("button", { onClick: () => {
2334
+ /* @__PURE__ */ e("h3", { children: "Security Schemes" }),
2335
+ !i && /* @__PURE__ */ e("button", { onClick: () => {
2256
2336
  a({
2257
- ...e,
2337
+ ...r,
2258
2338
  newScheme: { type: "apiKey", name: "X-API-Key", in: "header" }
2259
2339
  });
2260
2340
  }, children: "+ Add" })
2261
2341
  ] }),
2262
- Object.entries(e).map(([s, u]) => /* @__PURE__ */ t("div", { className: "nice-api-designer__security-item", children: [
2263
- /* @__PURE__ */ r("h4", { children: s }),
2264
- /* @__PURE__ */ r("pre", { children: JSON.stringify(u, null, 2) })
2265
- ] }, s))
2342
+ Object.entries(r).map(([c, u]) => /* @__PURE__ */ t("div", { className: "nice-api-designer__security-item", children: [
2343
+ /* @__PURE__ */ e("h4", { children: c }),
2344
+ /* @__PURE__ */ e("pre", { children: JSON.stringify(u, null, 2) })
2345
+ ] }, c))
2266
2346
  ] });
2267
2347
  }
2268
- function Xe({ schema: e }) {
2348
+ function Ye({ schema: r }) {
2269
2349
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__json-preview", children: [
2270
- /* @__PURE__ */ r("h3", { children: "OpenAPI Specification" }),
2271
- /* @__PURE__ */ r("pre", { className: "nice-api-designer__code", children: JSON.stringify(e, null, 2) })
2350
+ /* @__PURE__ */ e("h3", { children: "OpenAPI Specification" }),
2351
+ /* @__PURE__ */ e("pre", { className: "nice-api-designer__code", children: JSON.stringify(r, null, 2) })
2272
2352
  ] });
2273
2353
  }
2274
- const Ye = [
2354
+ const Qe = [
2275
2355
  {
2276
2356
  target: ".nice-api-tester",
2277
2357
  titleKey: "tutorial.apiTester.intro.title",
@@ -2280,7 +2360,7 @@ const Ye = [
2280
2360
  content: "Build requests with collections and environment variables, send them and assert on the responses.",
2281
2361
  placement: "auto"
2282
2362
  }
2283
- ], Qe = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], Ze = {
2363
+ ], Ze = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], er = {
2284
2364
  id: "",
2285
2365
  name: "New Request",
2286
2366
  method: "GET",
@@ -2288,302 +2368,302 @@ const Ye = [
2288
2368
  headers: {},
2289
2369
  queryParams: {}
2290
2370
  };
2291
- function ne(e, a) {
2292
- return e.replace(/\{\{(\w+)\}\}/g, (i, n) => a[n] || `{{${n}}}`);
2371
+ function se(r, a) {
2372
+ return r.replace(/\{\{(\w+)\}\}/g, (i, n) => a[n] || `{{${n}}}`);
2293
2373
  }
2294
- function er(e, a) {
2295
- const i = Object.entries(a).filter(([, n]) => n).map(([n, s]) => `${encodeURIComponent(n)}=${encodeURIComponent(s)}`).join("&");
2296
- return i ? `${e}?${i}` : e;
2374
+ function rr(r, a) {
2375
+ const i = Object.entries(a).filter(([, n]) => n).map(([n, c]) => `${encodeURIComponent(n)}=${encodeURIComponent(c)}`).join("&");
2376
+ return i ? `${r}?${i}` : r;
2297
2377
  }
2298
- function wr({
2299
- collections: e = [],
2378
+ function Nr({
2379
+ collections: r = [],
2300
2380
  environments: a = [],
2301
2381
  onRequest: i,
2302
2382
  onSaveCollection: n,
2303
- className: s = "",
2383
+ className: c = "",
2304
2384
  tutorial: u
2305
2385
  }) {
2306
- const [f, y] = g(e), [b, d] = g(a), [v, k] = g(
2307
- a.find((c) => c.isActive) || null
2308
- ), [m, T] = g({
2309
- ...Ze,
2386
+ const [l, y] = v(r), [b, d] = v(a), [h, S] = v(
2387
+ a.find((s) => s.isActive) || null
2388
+ ), [m, k] = v({
2389
+ ...er,
2310
2390
  id: crypto.randomUUID()
2311
- }), [_, I] = g(null), [H, K] = g(!1), [j, G] = g("none"), [$, U] = g(
2391
+ }), [g, P] = v(null), [C, O] = v(!1), [U, W] = v("none"), [$, L] = v(
2312
2392
  "params"
2313
- ), [O, q] = g("body"), [w, x] = g(""), [S, B] = g(""), [V, z] = g([]), [L, X] = g([]), F = se(null), Q = P(async () => {
2314
- var D;
2393
+ ), [I, j] = v("body"), [w, N] = v(""), [x, K] = v(""), [q, B] = v([]), [M, J] = v([]), V = oe(null), Y = R(async () => {
2394
+ var E;
2315
2395
  if (!m.url)
2316
2396
  return;
2317
- K(!0), I(null), z([]);
2318
- const c = Object.fromEntries(
2319
- Object.entries((v == null ? void 0 : v.variables) || {}).map(([E, R]) => [E, R.value])
2397
+ O(!0), P(null), B([]);
2398
+ const s = Object.fromEntries(
2399
+ Object.entries((h == null ? void 0 : h.variables) || {}).map(([H, A]) => [H, A.value])
2320
2400
  ), o = {
2321
2401
  ...m,
2322
- url: ne(m.url, c),
2402
+ url: se(m.url, s),
2323
2403
  headers: Object.fromEntries(
2324
- Object.entries(m.headers).map(([E, R]) => [E, ne(R, c)])
2404
+ Object.entries(m.headers).map(([H, A]) => [H, se(A, s)])
2325
2405
  ),
2326
2406
  queryParams: Object.fromEntries(
2327
- Object.entries(m.queryParams).map(([E, R]) => [
2328
- E,
2329
- ne(R, c)
2407
+ Object.entries(m.queryParams).map(([H, A]) => [
2408
+ H,
2409
+ se(A, s)
2330
2410
  ])
2331
2411
  )
2332
- }, N = performance.now();
2412
+ }, _ = performance.now();
2333
2413
  try {
2334
- let E;
2414
+ let H;
2335
2415
  if (i)
2336
- E = await i(o);
2416
+ H = await i(o);
2337
2417
  else {
2338
- F.current = new AbortController();
2339
- const R = { ...o.headers };
2340
- m.auth && rr(R, m.auth);
2341
- const Se = er(o.url, o.queryParams), oe = {
2418
+ V.current = new AbortController();
2419
+ const A = { ...o.headers };
2420
+ m.auth && ar(A, m.auth);
2421
+ const ee = rr(o.url, o.queryParams), X = {
2342
2422
  method: o.method,
2343
- headers: R,
2344
- signal: F.current.signal
2423
+ headers: A,
2424
+ signal: V.current.signal
2345
2425
  };
2346
- ["POST", "PUT", "PATCH"].includes(o.method) && ((D = m.body) != null && D.content) && (oe.body = typeof m.body.content == "string" ? m.body.content : JSON.stringify(m.body.content), m.body.type === "json" && (R["Content-Type"] = "application/json"));
2347
- const Z = await fetch(Se, oe), ae = await Z.text();
2348
- let ie;
2426
+ ["POST", "PUT", "PATCH"].includes(o.method) && ((E = m.body) != null && E.content) && (X.body = typeof m.body.content == "string" ? m.body.content : JSON.stringify(m.body.content), m.body.type === "json" && (A["Content-Type"] = "application/json"));
2427
+ const re = await fetch(ee, X), ne = await re.text();
2428
+ let te;
2349
2429
  try {
2350
- ie = JSON.parse(ae);
2430
+ te = JSON.parse(ne);
2351
2431
  } catch {
2352
- ie = ae;
2432
+ te = ne;
2353
2433
  }
2354
- const Ce = performance.now();
2355
- E = {
2356
- status: Z.status,
2357
- statusText: Z.statusText,
2358
- headers: Object.fromEntries(Z.headers.entries()),
2359
- body: ie,
2360
- time: Math.round(Ce - N),
2361
- size: new Blob([ae]).size,
2434
+ const ke = performance.now();
2435
+ H = {
2436
+ status: re.status,
2437
+ statusText: re.statusText,
2438
+ headers: Object.fromEntries(re.headers.entries()),
2439
+ body: te,
2440
+ time: Math.round(ke - _),
2441
+ size: new Blob([ne]).size,
2362
2442
  timestamp: /* @__PURE__ */ new Date()
2363
2443
  };
2364
2444
  }
2365
- if (I(E), X(
2366
- (R) => [...R, { request: m, response: E }].slice(-50)
2367
- ), S) {
2368
- const R = ir(S, E);
2369
- z(R);
2445
+ if (P(H), J(
2446
+ (A) => [...A, { request: m, response: H }].slice(-50)
2447
+ ), x) {
2448
+ const A = nr(x, H);
2449
+ B(A);
2370
2450
  }
2371
- } catch (E) {
2372
- E.name !== "AbortError" && I({
2451
+ } catch (H) {
2452
+ H.name !== "AbortError" && P({
2373
2453
  status: 0,
2374
2454
  statusText: "Error",
2375
2455
  headers: {},
2376
- body: { error: E.message },
2377
- time: Math.round(performance.now() - N),
2456
+ body: { error: H.message },
2457
+ time: Math.round(performance.now() - _),
2378
2458
  size: 0,
2379
2459
  timestamp: /* @__PURE__ */ new Date()
2380
2460
  });
2381
2461
  } finally {
2382
- K(!1), F.current = null;
2462
+ O(!1), V.current = null;
2383
2463
  }
2384
- }, [m, v, i, S]), Y = P(() => {
2385
- var c;
2386
- (c = F.current) == null || c.abort(), K(!1);
2387
- }, []), p = P(() => {
2388
- T((c) => ({
2389
- ...c,
2390
- headers: { ...c.headers, "": "" }
2464
+ }, [m, h, i, x]), G = R(() => {
2465
+ var s;
2466
+ (s = V.current) == null || s.abort(), O(!1);
2467
+ }, []), Q = R(() => {
2468
+ k((s) => ({
2469
+ ...s,
2470
+ headers: { ...s.headers, "": "" }
2391
2471
  }));
2392
- }, []), h = P(() => {
2393
- T((c) => ({
2394
- ...c,
2395
- queryParams: { ...c.queryParams, "": "" }
2472
+ }, []), Z = R(() => {
2473
+ k((s) => ({
2474
+ ...s,
2475
+ queryParams: { ...s.queryParams, "": "" }
2396
2476
  }));
2397
- }, []), C = P(() => {
2398
- if (f.length === 0) {
2399
- const c = {
2477
+ }, []), p = R(() => {
2478
+ if (l.length === 0) {
2479
+ const s = {
2400
2480
  id: crypto.randomUUID(),
2401
2481
  name: "My Collection",
2402
2482
  requests: [m]
2403
2483
  };
2404
- y([c]), n == null || n(c);
2484
+ y([s]), n == null || n(s);
2405
2485
  } else {
2406
- const c = {
2407
- ...f[0],
2408
- requests: [...f[0].requests, m]
2486
+ const s = {
2487
+ ...l[0],
2488
+ requests: [...l[0].requests, m]
2409
2489
  };
2410
- y((o) => [c, ...o.slice(1)]), n == null || n(c);
2490
+ y((o) => [s, ...o.slice(1)]), n == null || n(s);
2411
2491
  }
2412
- }, [f, m, n]);
2413
- return /* @__PURE__ */ t("div", { className: `nice-api-tester ${s}`, style: { position: "relative" }, children: [
2414
- u && /* @__PURE__ */ r("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ r(re, { steps: ee(u, Ye) }) }),
2415
- /* @__PURE__ */ r("div", { className: "nice-api-tester__toolbar", children: /* @__PURE__ */ r("div", { className: "nice-api-tester__env-selector", children: /* @__PURE__ */ t(
2492
+ }, [l, m, n]);
2493
+ return /* @__PURE__ */ t("div", { className: `nice-api-tester ${c}`, style: { position: "relative" }, children: [
2494
+ u && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ie, { steps: ae(u, Qe) }) }),
2495
+ /* @__PURE__ */ e("div", { className: "nice-api-tester__toolbar", children: /* @__PURE__ */ e("div", { className: "nice-api-tester__env-selector", children: /* @__PURE__ */ t(
2416
2496
  "select",
2417
2497
  {
2418
- value: (v == null ? void 0 : v.id) || "",
2419
- onChange: (c) => k(b.find((o) => o.id === c.target.value) || null),
2498
+ value: (h == null ? void 0 : h.id) || "",
2499
+ onChange: (s) => S(b.find((o) => o.id === s.target.value) || null),
2420
2500
  children: [
2421
- /* @__PURE__ */ r("option", { value: "", children: "No Environment" }),
2422
- b.map((c) => /* @__PURE__ */ r("option", { value: c.id, children: c.name }, c.id))
2501
+ /* @__PURE__ */ e("option", { value: "", children: "No Environment" }),
2502
+ b.map((s) => /* @__PURE__ */ e("option", { value: s.id, children: s.name }, s.id))
2423
2503
  ]
2424
2504
  }
2425
2505
  ) }) }),
2426
2506
  /* @__PURE__ */ t("div", { className: "nice-api-tester__request-bar", children: [
2427
- /* @__PURE__ */ r(
2507
+ /* @__PURE__ */ e(
2428
2508
  "select",
2429
2509
  {
2430
2510
  value: m.method,
2431
- onChange: (c) => T((o) => ({
2511
+ onChange: (s) => k((o) => ({
2432
2512
  ...o,
2433
- method: c.target.value
2513
+ method: s.target.value
2434
2514
  })),
2435
2515
  className: `nice-api-tester__method nice-api-tester__method--${m.method.toLowerCase()}`,
2436
- children: Qe.map((c) => /* @__PURE__ */ r("option", { value: c, children: c }, c))
2516
+ children: Ze.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
2437
2517
  }
2438
2518
  ),
2439
- /* @__PURE__ */ r(
2519
+ /* @__PURE__ */ e(
2440
2520
  "input",
2441
2521
  {
2442
2522
  type: "text",
2443
2523
  value: m.url,
2444
- onChange: (c) => T((o) => ({ ...o, url: c.target.value })),
2524
+ onChange: (s) => k((o) => ({ ...o, url: s.target.value })),
2445
2525
  placeholder: "Enter request URL",
2446
2526
  className: "nice-api-tester__url-input"
2447
2527
  }
2448
2528
  ),
2449
- /* @__PURE__ */ r(
2529
+ /* @__PURE__ */ e(
2450
2530
  "button",
2451
2531
  {
2452
- onClick: H ? Y : Q,
2453
- className: `nice-api-tester__send-btn ${H ? "nice-api-tester__send-btn--loading" : ""}`,
2454
- children: H ? "Cancel" : "Send"
2532
+ onClick: C ? G : Y,
2533
+ className: `nice-api-tester__send-btn ${C ? "nice-api-tester__send-btn--loading" : ""}`,
2534
+ children: C ? "Cancel" : "Send"
2455
2535
  }
2456
2536
  ),
2457
- /* @__PURE__ */ r("button", { onClick: C, className: "nice-api-tester__save-btn", children: "Save" })
2537
+ /* @__PURE__ */ e("button", { onClick: p, className: "nice-api-tester__save-btn", children: "Save" })
2458
2538
  ] }),
2459
2539
  /* @__PURE__ */ t("div", { className: "nice-api-tester__main", children: [
2460
2540
  /* @__PURE__ */ t("div", { className: "nice-api-tester__request-panel", children: [
2461
- /* @__PURE__ */ r("div", { className: "nice-api-tester__tabs", children: ["params", "headers", "body", "auth", "tests"].map((c) => /* @__PURE__ */ r(
2541
+ /* @__PURE__ */ e("div", { className: "nice-api-tester__tabs", children: ["params", "headers", "body", "auth", "tests"].map((s) => /* @__PURE__ */ e(
2462
2542
  "button",
2463
2543
  {
2464
- className: `nice-api-tester__tab ${$ === c ? "nice-api-tester__tab--active" : ""}`,
2465
- onClick: () => U(c),
2466
- children: c.charAt(0).toUpperCase() + c.slice(1)
2544
+ className: `nice-api-tester__tab ${$ === s ? "nice-api-tester__tab--active" : ""}`,
2545
+ onClick: () => L(s),
2546
+ children: s.charAt(0).toUpperCase() + s.slice(1)
2467
2547
  },
2468
- c
2548
+ s
2469
2549
  )) }),
2470
2550
  /* @__PURE__ */ t("div", { className: "nice-api-tester__tab-content", children: [
2471
- $ === "params" && /* @__PURE__ */ r(
2472
- nr,
2551
+ $ === "params" && /* @__PURE__ */ e(
2552
+ tr,
2473
2553
  {
2474
2554
  params: m.queryParams,
2475
- onChange: (c) => T((o) => ({ ...o, queryParams: c })),
2476
- onAdd: h
2555
+ onChange: (s) => k((o) => ({ ...o, queryParams: s })),
2556
+ onAdd: Z
2477
2557
  }
2478
2558
  ),
2479
- $ === "headers" && /* @__PURE__ */ r(
2480
- tr,
2559
+ $ === "headers" && /* @__PURE__ */ e(
2560
+ sr,
2481
2561
  {
2482
2562
  headers: m.headers,
2483
- onChange: (c) => T((o) => ({ ...o, headers: c })),
2484
- onAdd: p
2563
+ onChange: (s) => k((o) => ({ ...o, headers: s })),
2564
+ onAdd: Q
2485
2565
  }
2486
2566
  ),
2487
- $ === "body" && /* @__PURE__ */ r(
2488
- sr,
2567
+ $ === "body" && /* @__PURE__ */ e(
2568
+ cr,
2489
2569
  {
2490
2570
  body: m.body,
2491
- bodyTab: j,
2492
- onBodyTabChange: G,
2493
- onChange: (c) => T((o) => ({ ...o, body: c }))
2571
+ bodyTab: U,
2572
+ onBodyTabChange: W,
2573
+ onChange: (s) => k((o) => ({ ...o, body: s }))
2494
2574
  }
2495
2575
  ),
2496
- $ === "auth" && /* @__PURE__ */ r(
2497
- cr,
2576
+ $ === "auth" && /* @__PURE__ */ e(
2577
+ or,
2498
2578
  {
2499
2579
  auth: m.auth,
2500
- onChange: (c) => T((o) => ({ ...o, auth: c }))
2580
+ onChange: (s) => k((o) => ({ ...o, auth: s }))
2501
2581
  }
2502
2582
  ),
2503
- $ === "tests" && /* @__PURE__ */ r(
2504
- or,
2583
+ $ === "tests" && /* @__PURE__ */ e(
2584
+ dr,
2505
2585
  {
2506
2586
  preRequestScript: w,
2507
- testScript: S,
2508
- onPreRequestChange: x,
2509
- onTestChange: B
2587
+ testScript: x,
2588
+ onPreRequestChange: N,
2589
+ onTestChange: K
2510
2590
  }
2511
2591
  )
2512
2592
  ] })
2513
2593
  ] }),
2514
- /* @__PURE__ */ r("div", { className: "nice-api-tester__response-panel", children: _ ? /* @__PURE__ */ t(J, { children: [
2594
+ /* @__PURE__ */ e("div", { className: "nice-api-tester__response-panel", children: g ? /* @__PURE__ */ t(F, { children: [
2515
2595
  /* @__PURE__ */ t("div", { className: "nice-api-tester__response-meta", children: [
2516
2596
  /* @__PURE__ */ t(
2517
2597
  "span",
2518
2598
  {
2519
- className: `nice-api-tester__status nice-api-tester__status--${Math.floor(_.status / 100)}`,
2599
+ className: `nice-api-tester__status nice-api-tester__status--${Math.floor(g.status / 100)}`,
2520
2600
  children: [
2521
- _.status,
2601
+ g.status,
2522
2602
  " ",
2523
- _.statusText
2603
+ g.statusText
2524
2604
  ]
2525
2605
  }
2526
2606
  ),
2527
2607
  /* @__PURE__ */ t("span", { className: "nice-api-tester__time", children: [
2528
- _.time,
2608
+ g.time,
2529
2609
  "ms"
2530
2610
  ] }),
2531
- /* @__PURE__ */ r("span", { className: "nice-api-tester__size", children: ar(_.size) })
2611
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__size", children: ir(g.size) })
2532
2612
  ] }),
2533
- /* @__PURE__ */ r("div", { className: "nice-api-tester__tabs", children: ["body", "headers", "tests"].map((c) => /* @__PURE__ */ t(
2613
+ /* @__PURE__ */ e("div", { className: "nice-api-tester__tabs", children: ["body", "headers", "tests"].map((s) => /* @__PURE__ */ t(
2534
2614
  "button",
2535
2615
  {
2536
- className: `nice-api-tester__tab ${O === c ? "nice-api-tester__tab--active" : ""}`,
2537
- onClick: () => q(c),
2616
+ className: `nice-api-tester__tab ${I === s ? "nice-api-tester__tab--active" : ""}`,
2617
+ onClick: () => j(s),
2538
2618
  children: [
2539
- c.charAt(0).toUpperCase() + c.slice(1),
2540
- c === "tests" && V.length > 0 && /* @__PURE__ */ t("span", { className: "nice-api-tester__test-badge", children: [
2541
- V.filter((o) => o.passed).length,
2619
+ s.charAt(0).toUpperCase() + s.slice(1),
2620
+ s === "tests" && q.length > 0 && /* @__PURE__ */ t("span", { className: "nice-api-tester__test-badge", children: [
2621
+ q.filter((o) => o.passed).length,
2542
2622
  "/",
2543
- V.length
2623
+ q.length
2544
2624
  ] })
2545
2625
  ]
2546
2626
  },
2547
- c
2627
+ s
2548
2628
  )) }),
2549
2629
  /* @__PURE__ */ t("div", { className: "nice-api-tester__response-content", children: [
2550
- O === "body" && /* @__PURE__ */ r("pre", { className: "nice-api-tester__response-body", children: typeof _.body == "string" ? _.body : JSON.stringify(_.body, null, 2) }),
2551
- O === "headers" && /* @__PURE__ */ r("div", { className: "nice-api-tester__response-headers", children: Object.entries(_.headers).map(([c, o]) => /* @__PURE__ */ t("div", { className: "nice-api-tester__header-row", children: [
2552
- /* @__PURE__ */ r("span", { className: "nice-api-tester__header-key", children: c }),
2553
- /* @__PURE__ */ r("span", { className: "nice-api-tester__header-value", children: o })
2554
- ] }, c)) }),
2555
- O === "tests" && /* @__PURE__ */ r("div", { className: "nice-api-tester__test-results", children: V.map((c, o) => /* @__PURE__ */ t(
2630
+ I === "body" && /* @__PURE__ */ e("pre", { className: "nice-api-tester__response-body", children: typeof g.body == "string" ? g.body : JSON.stringify(g.body, null, 2) }),
2631
+ I === "headers" && /* @__PURE__ */ e("div", { className: "nice-api-tester__response-headers", children: Object.entries(g.headers).map(([s, o]) => /* @__PURE__ */ t("div", { className: "nice-api-tester__header-row", children: [
2632
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__header-key", children: s }),
2633
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__header-value", children: o })
2634
+ ] }, s)) }),
2635
+ I === "tests" && /* @__PURE__ */ e("div", { className: "nice-api-tester__test-results", children: q.map((s, o) => /* @__PURE__ */ t(
2556
2636
  "div",
2557
2637
  {
2558
- className: `nice-api-tester__test-result nice-api-tester__test-result--${c.passed ? "pass" : "fail"}`,
2638
+ className: `nice-api-tester__test-result nice-api-tester__test-result--${s.passed ? "pass" : "fail"}`,
2559
2639
  children: [
2560
- /* @__PURE__ */ r("span", { className: "nice-api-tester__test-icon", children: c.passed ? "✓" : "✗" }),
2561
- /* @__PURE__ */ r("span", { className: "nice-api-tester__test-name", children: c.name }),
2562
- c.message && /* @__PURE__ */ r("span", { className: "nice-api-tester__test-message", children: c.message })
2640
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__test-icon", children: s.passed ? "✓" : "✗" }),
2641
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__test-name", children: s.name }),
2642
+ s.message && /* @__PURE__ */ e("span", { className: "nice-api-tester__test-message", children: s.message })
2563
2643
  ]
2564
2644
  },
2565
2645
  o
2566
2646
  )) })
2567
2647
  ] })
2568
- ] }) : /* @__PURE__ */ r("div", { className: "nice-api-tester__empty-response", children: H ? "Loading..." : "Send a request to see the response" }) })
2648
+ ] }) : /* @__PURE__ */ e("div", { className: "nice-api-tester__empty-response", children: C ? "Loading..." : "Send a request to see the response" }) })
2569
2649
  ] }),
2570
- L.length > 0 && /* @__PURE__ */ t("div", { className: "nice-api-tester__history", children: [
2571
- /* @__PURE__ */ r("h4", { children: "History" }),
2572
- /* @__PURE__ */ r("div", { className: "nice-api-tester__history-list", children: L.slice().reverse().map(({ request: c, response: o }, N) => /* @__PURE__ */ t(
2650
+ M.length > 0 && /* @__PURE__ */ t("div", { className: "nice-api-tester__history", children: [
2651
+ /* @__PURE__ */ e("h4", { children: "History" }),
2652
+ /* @__PURE__ */ e("div", { className: "nice-api-tester__history-list", children: M.slice().reverse().map(({ request: s, response: o }, _) => /* @__PURE__ */ t(
2573
2653
  "div",
2574
2654
  {
2575
2655
  className: "nice-api-tester__history-item",
2576
- onClick: () => T(c),
2656
+ onClick: () => k(s),
2577
2657
  children: [
2578
- /* @__PURE__ */ r(
2658
+ /* @__PURE__ */ e(
2579
2659
  "span",
2580
2660
  {
2581
- className: `nice-api-tester__method nice-api-tester__method--${c.method.toLowerCase()}`,
2582
- children: c.method
2661
+ className: `nice-api-tester__method nice-api-tester__method--${s.method.toLowerCase()}`,
2662
+ children: s.method
2583
2663
  }
2584
2664
  ),
2585
- /* @__PURE__ */ r("span", { className: "nice-api-tester__history-url", children: c.url }),
2586
- /* @__PURE__ */ r(
2665
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__history-url", children: s.url }),
2666
+ /* @__PURE__ */ e(
2587
2667
  "span",
2588
2668
  {
2589
2669
  className: `nice-api-tester__status nice-api-tester__status--${Math.floor(
@@ -2594,29 +2674,29 @@ function wr({
2594
2674
  )
2595
2675
  ]
2596
2676
  },
2597
- N
2677
+ _
2598
2678
  )) })
2599
2679
  ] })
2600
2680
  ] });
2601
2681
  }
2602
- function rr(e, a) {
2603
- var i, n, s, u, f;
2682
+ function ar(r, a) {
2683
+ var i, n, c, u, l;
2604
2684
  switch (a.type) {
2605
2685
  case "bearer":
2606
- e.Authorization = `${((i = a.bearer) == null ? void 0 : i.prefix) || "Bearer"} ${(n = a.bearer) == null ? void 0 : n.token}`;
2686
+ r.Authorization = `${((i = a.bearer) == null ? void 0 : i.prefix) || "Bearer"} ${(n = a.bearer) == null ? void 0 : n.token}`;
2607
2687
  break;
2608
2688
  case "basic":
2609
- e.Authorization = `Basic ${btoa(`${(s = a.basic) == null ? void 0 : s.username}:${(u = a.basic) == null ? void 0 : u.password}`)}`;
2689
+ r.Authorization = `Basic ${btoa(`${(c = a.basic) == null ? void 0 : c.username}:${(u = a.basic) == null ? void 0 : u.password}`)}`;
2610
2690
  break;
2611
2691
  case "api-key":
2612
- ((f = a.apiKey) == null ? void 0 : f.in) === "header" && (e[a.apiKey.key] = a.apiKey.value);
2692
+ ((l = a.apiKey) == null ? void 0 : l.in) === "header" && (r[a.apiKey.key] = a.apiKey.value);
2613
2693
  break;
2614
2694
  }
2615
2695
  }
2616
- function ar(e) {
2617
- return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
2696
+ function ir(r) {
2697
+ return r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : `${(r / (1024 * 1024)).toFixed(1)} MB`;
2618
2698
  }
2619
- function ir(e, a) {
2699
+ function nr(r, a) {
2620
2700
  const i = [], n = {
2621
2701
  response: {
2622
2702
  code: a.status,
@@ -2626,34 +2706,34 @@ function ir(e, a) {
2626
2706
  text: () => typeof a.body == "string" ? a.body : JSON.stringify(a.body),
2627
2707
  responseTime: a.time
2628
2708
  },
2629
- test: (s, u) => {
2630
- const f = performance.now();
2709
+ test: (c, u) => {
2710
+ const l = performance.now();
2631
2711
  try {
2632
- u(), i.push({ name: s, passed: !0, duration: performance.now() - f });
2712
+ u(), i.push({ name: c, passed: !0, duration: performance.now() - l });
2633
2713
  } catch (y) {
2634
2714
  i.push({
2635
- name: s,
2715
+ name: c,
2636
2716
  passed: !1,
2637
2717
  message: y.message,
2638
- duration: performance.now() - f
2718
+ duration: performance.now() - l
2639
2719
  });
2640
2720
  }
2641
2721
  },
2642
- expect: (s) => ({
2722
+ expect: (c) => ({
2643
2723
  to: {
2644
2724
  equal: (u) => {
2645
- if (s !== u)
2646
- throw new Error(`Expected ${u} but got ${s}`);
2725
+ if (c !== u)
2726
+ throw new Error(`Expected ${u} but got ${c}`);
2647
2727
  },
2648
2728
  be: {
2649
2729
  oneOf: (u) => {
2650
- if (!u.includes(s))
2651
- throw new Error(`Expected ${s} to be one of ${u}`);
2730
+ if (!u.includes(c))
2731
+ throw new Error(`Expected ${c} to be one of ${u}`);
2652
2732
  }
2653
2733
  },
2654
2734
  have: {
2655
2735
  property: (u) => {
2656
- if (typeof s != "object" || s === null || !(u in s))
2736
+ if (typeof c != "object" || c === null || !(u in c))
2657
2737
  throw new Error(`Expected object to have property ${u}`);
2658
2738
  }
2659
2739
  }
@@ -2661,70 +2741,70 @@ function ir(e, a) {
2661
2741
  })
2662
2742
  };
2663
2743
  try {
2664
- new Function("pm", e)(n);
2665
- } catch (s) {
2744
+ new Function("pm", r)(n);
2745
+ } catch (c) {
2666
2746
  i.push({
2667
2747
  name: "Script Error",
2668
2748
  passed: !1,
2669
- message: s.message,
2749
+ message: c.message,
2670
2750
  duration: 0
2671
2751
  });
2672
2752
  }
2673
2753
  return i;
2674
2754
  }
2675
- function xe({
2676
- items: e,
2755
+ function Ce({
2756
+ items: r,
2677
2757
  onChange: a,
2678
2758
  onAdd: i,
2679
2759
  keyPlaceholder: n = "Key",
2680
- valuePlaceholder: s = "Value"
2760
+ valuePlaceholder: c = "Value"
2681
2761
  }) {
2682
2762
  return /* @__PURE__ */ t("div", { className: "nice-api-tester__kv-editor", children: [
2683
- Object.entries(e).map(([u, f], y) => /* @__PURE__ */ t("div", { className: "nice-api-tester__kv-row", children: [
2684
- /* @__PURE__ */ r(
2763
+ Object.entries(r).map(([u, l], y) => /* @__PURE__ */ t("div", { className: "nice-api-tester__kv-row", children: [
2764
+ /* @__PURE__ */ e(
2685
2765
  "input",
2686
2766
  {
2687
2767
  type: "text",
2688
2768
  value: u,
2689
2769
  placeholder: n,
2690
2770
  onChange: (b) => {
2691
- const d = Object.entries(e);
2692
- d[y] = [b.target.value, f], a(Object.fromEntries(d));
2771
+ const d = Object.entries(r);
2772
+ d[y] = [b.target.value, l], a(Object.fromEntries(d));
2693
2773
  }
2694
2774
  }
2695
2775
  ),
2696
- /* @__PURE__ */ r(
2776
+ /* @__PURE__ */ e(
2697
2777
  "input",
2698
2778
  {
2699
2779
  type: "text",
2700
- value: f,
2701
- placeholder: s,
2702
- onChange: (b) => a({ ...e, [u]: b.target.value })
2780
+ value: l,
2781
+ placeholder: c,
2782
+ onChange: (b) => a({ ...r, [u]: b.target.value })
2703
2783
  }
2704
2784
  ),
2705
- /* @__PURE__ */ r(
2785
+ /* @__PURE__ */ e(
2706
2786
  "button",
2707
2787
  {
2708
2788
  onClick: () => {
2709
- const { [u]: b, ...d } = e;
2789
+ const { [u]: b, ...d } = r;
2710
2790
  a(d);
2711
2791
  },
2712
2792
  children: "×"
2713
2793
  }
2714
2794
  )
2715
2795
  ] }, y)),
2716
- /* @__PURE__ */ r("button", { onClick: i, className: "nice-api-tester__add-btn", children: "+ Add" })
2796
+ /* @__PURE__ */ e("button", { onClick: i, className: "nice-api-tester__add-btn", children: "+ Add" })
2717
2797
  ] });
2718
2798
  }
2719
- function nr({
2720
- params: e,
2799
+ function tr({
2800
+ params: r,
2721
2801
  onChange: a,
2722
2802
  onAdd: i
2723
2803
  }) {
2724
- return /* @__PURE__ */ r(
2725
- xe,
2804
+ return /* @__PURE__ */ e(
2805
+ Ce,
2726
2806
  {
2727
- items: e,
2807
+ items: r,
2728
2808
  onChange: a,
2729
2809
  onAdd: i,
2730
2810
  keyPlaceholder: "Parameter",
@@ -2732,15 +2812,15 @@ function nr({
2732
2812
  }
2733
2813
  );
2734
2814
  }
2735
- function tr({
2736
- headers: e,
2815
+ function sr({
2816
+ headers: r,
2737
2817
  onChange: a,
2738
2818
  onAdd: i
2739
2819
  }) {
2740
- return /* @__PURE__ */ r(
2741
- xe,
2820
+ return /* @__PURE__ */ e(
2821
+ Ce,
2742
2822
  {
2743
- items: e,
2823
+ items: r,
2744
2824
  onChange: a,
2745
2825
  onAdd: i,
2746
2826
  keyPlaceholder: "Header",
@@ -2748,31 +2828,31 @@ function tr({
2748
2828
  }
2749
2829
  );
2750
2830
  }
2751
- function sr({
2752
- body: e,
2831
+ function cr({
2832
+ body: r,
2753
2833
  bodyTab: a,
2754
2834
  onBodyTabChange: i,
2755
2835
  onChange: n
2756
2836
  }) {
2757
2837
  return /* @__PURE__ */ t("div", { className: "nice-api-tester__body-editor", children: [
2758
- /* @__PURE__ */ r("div", { className: "nice-api-tester__body-tabs", children: ["none", "json", "form-data", "raw"].map((s) => /* @__PURE__ */ t("label", { children: [
2759
- /* @__PURE__ */ r(
2838
+ /* @__PURE__ */ e("div", { className: "nice-api-tester__body-tabs", children: ["none", "json", "form-data", "raw"].map((c) => /* @__PURE__ */ t("label", { children: [
2839
+ /* @__PURE__ */ e(
2760
2840
  "input",
2761
2841
  {
2762
2842
  type: "radio",
2763
- checked: a === s,
2843
+ checked: a === c,
2764
2844
  onChange: () => {
2765
- i(s), n({ type: s, content: "" });
2845
+ i(c), n({ type: c, content: "" });
2766
2846
  }
2767
2847
  }
2768
2848
  ),
2769
- s
2770
- ] }, s)) }),
2771
- a !== "none" && /* @__PURE__ */ r(
2849
+ c
2850
+ ] }, c)) }),
2851
+ a !== "none" && /* @__PURE__ */ e(
2772
2852
  "textarea",
2773
2853
  {
2774
- value: typeof (e == null ? void 0 : e.content) == "string" ? e.content : JSON.stringify(e == null ? void 0 : e.content, null, 2),
2775
- onChange: (s) => n({ type: a, content: s.target.value }),
2854
+ value: typeof (r == null ? void 0 : r.content) == "string" ? r.content : JSON.stringify(r == null ? void 0 : r.content, null, 2),
2855
+ onChange: (c) => n({ type: a, content: c.target.value }),
2776
2856
  placeholder: a === "json" ? '{ "key": "value" }' : "Enter body content",
2777
2857
  rows: 10,
2778
2858
  className: "nice-api-tester__body-textarea"
@@ -2780,46 +2860,46 @@ function sr({
2780
2860
  )
2781
2861
  ] });
2782
2862
  }
2783
- function cr({
2784
- auth: e,
2863
+ function or({
2864
+ auth: r,
2785
2865
  onChange: a
2786
2866
  }) {
2787
- var i, n, s, u, f, y;
2867
+ var i, n, c, u, l, y;
2788
2868
  return /* @__PURE__ */ t("div", { className: "nice-api-tester__auth-editor", children: [
2789
2869
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
2790
- /* @__PURE__ */ r("label", { children: "Type" }),
2870
+ /* @__PURE__ */ e("label", { children: "Type" }),
2791
2871
  /* @__PURE__ */ t(
2792
2872
  "select",
2793
2873
  {
2794
- value: (e == null ? void 0 : e.type) || "none",
2874
+ value: (r == null ? void 0 : r.type) || "none",
2795
2875
  onChange: (b) => a({ type: b.target.value }),
2796
2876
  children: [
2797
- /* @__PURE__ */ r("option", { value: "none", children: "No Auth" }),
2798
- /* @__PURE__ */ r("option", { value: "api-key", children: "API Key" }),
2799
- /* @__PURE__ */ r("option", { value: "bearer", children: "Bearer Token" }),
2800
- /* @__PURE__ */ r("option", { value: "basic", children: "Basic Auth" }),
2801
- /* @__PURE__ */ r("option", { value: "oauth2", children: "OAuth 2.0" })
2877
+ /* @__PURE__ */ e("option", { value: "none", children: "No Auth" }),
2878
+ /* @__PURE__ */ e("option", { value: "api-key", children: "API Key" }),
2879
+ /* @__PURE__ */ e("option", { value: "bearer", children: "Bearer Token" }),
2880
+ /* @__PURE__ */ e("option", { value: "basic", children: "Basic Auth" }),
2881
+ /* @__PURE__ */ e("option", { value: "oauth2", children: "OAuth 2.0" })
2802
2882
  ]
2803
2883
  }
2804
2884
  )
2805
2885
  ] }),
2806
- (e == null ? void 0 : e.type) === "api-key" && /* @__PURE__ */ t(J, { children: [
2886
+ (r == null ? void 0 : r.type) === "api-key" && /* @__PURE__ */ t(F, { children: [
2807
2887
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
2808
- /* @__PURE__ */ r("label", { children: "Key" }),
2809
- /* @__PURE__ */ r(
2888
+ /* @__PURE__ */ e("label", { children: "Key" }),
2889
+ /* @__PURE__ */ e(
2810
2890
  "input",
2811
2891
  {
2812
2892
  type: "text",
2813
- value: ((i = e.apiKey) == null ? void 0 : i.key) || "",
2893
+ value: ((i = r.apiKey) == null ? void 0 : i.key) || "",
2814
2894
  onChange: (b) => {
2815
- var d, v;
2895
+ var d, h;
2816
2896
  return a({
2817
- ...e,
2897
+ ...r,
2818
2898
  apiKey: {
2819
- ...e.apiKey,
2899
+ ...r.apiKey,
2820
2900
  key: b.target.value,
2821
- value: ((d = e.apiKey) == null ? void 0 : d.value) || "",
2822
- in: ((v = e.apiKey) == null ? void 0 : v.in) || "header"
2901
+ value: ((d = r.apiKey) == null ? void 0 : d.value) || "",
2902
+ in: ((h = r.apiKey) == null ? void 0 : h.in) || "header"
2823
2903
  }
2824
2904
  });
2825
2905
  },
@@ -2828,21 +2908,21 @@ function cr({
2828
2908
  )
2829
2909
  ] }),
2830
2910
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
2831
- /* @__PURE__ */ r("label", { children: "Value" }),
2832
- /* @__PURE__ */ r(
2911
+ /* @__PURE__ */ e("label", { children: "Value" }),
2912
+ /* @__PURE__ */ e(
2833
2913
  "input",
2834
2914
  {
2835
2915
  type: "text",
2836
- value: ((n = e.apiKey) == null ? void 0 : n.value) || "",
2916
+ value: ((n = r.apiKey) == null ? void 0 : n.value) || "",
2837
2917
  onChange: (b) => {
2838
- var d, v;
2918
+ var d, h;
2839
2919
  return a({
2840
- ...e,
2920
+ ...r,
2841
2921
  apiKey: {
2842
- ...e.apiKey,
2922
+ ...r.apiKey,
2843
2923
  value: b.target.value,
2844
- key: ((d = e.apiKey) == null ? void 0 : d.key) || "",
2845
- in: ((v = e.apiKey) == null ? void 0 : v.in) || "header"
2924
+ key: ((d = r.apiKey) == null ? void 0 : d.key) || "",
2925
+ in: ((h = r.apiKey) == null ? void 0 : h.in) || "header"
2846
2926
  }
2847
2927
  });
2848
2928
  },
@@ -2851,59 +2931,59 @@ function cr({
2851
2931
  )
2852
2932
  ] }),
2853
2933
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
2854
- /* @__PURE__ */ r("label", { children: "Add to" }),
2934
+ /* @__PURE__ */ e("label", { children: "Add to" }),
2855
2935
  /* @__PURE__ */ t(
2856
2936
  "select",
2857
2937
  {
2858
- value: ((s = e.apiKey) == null ? void 0 : s.in) || "header",
2938
+ value: ((c = r.apiKey) == null ? void 0 : c.in) || "header",
2859
2939
  onChange: (b) => {
2860
- var d, v;
2940
+ var d, h;
2861
2941
  return a({
2862
- ...e,
2942
+ ...r,
2863
2943
  apiKey: {
2864
- ...e.apiKey,
2944
+ ...r.apiKey,
2865
2945
  in: b.target.value,
2866
- key: ((d = e.apiKey) == null ? void 0 : d.key) || "",
2867
- value: ((v = e.apiKey) == null ? void 0 : v.value) || ""
2946
+ key: ((d = r.apiKey) == null ? void 0 : d.key) || "",
2947
+ value: ((h = r.apiKey) == null ? void 0 : h.value) || ""
2868
2948
  }
2869
2949
  });
2870
2950
  },
2871
2951
  children: [
2872
- /* @__PURE__ */ r("option", { value: "header", children: "Header" }),
2873
- /* @__PURE__ */ r("option", { value: "query", children: "Query Params" })
2952
+ /* @__PURE__ */ e("option", { value: "header", children: "Header" }),
2953
+ /* @__PURE__ */ e("option", { value: "query", children: "Query Params" })
2874
2954
  ]
2875
2955
  }
2876
2956
  )
2877
2957
  ] })
2878
2958
  ] }),
2879
- (e == null ? void 0 : e.type) === "bearer" && /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
2880
- /* @__PURE__ */ r("label", { children: "Token" }),
2881
- /* @__PURE__ */ r(
2959
+ (r == null ? void 0 : r.type) === "bearer" && /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
2960
+ /* @__PURE__ */ e("label", { children: "Token" }),
2961
+ /* @__PURE__ */ e(
2882
2962
  "input",
2883
2963
  {
2884
2964
  type: "text",
2885
- value: ((u = e.bearer) == null ? void 0 : u.token) || "",
2886
- onChange: (b) => a({ ...e, bearer: { token: b.target.value } }),
2965
+ value: ((u = r.bearer) == null ? void 0 : u.token) || "",
2966
+ onChange: (b) => a({ ...r, bearer: { token: b.target.value } }),
2887
2967
  placeholder: "your-bearer-token"
2888
2968
  }
2889
2969
  )
2890
2970
  ] }),
2891
- (e == null ? void 0 : e.type) === "basic" && /* @__PURE__ */ t(J, { children: [
2971
+ (r == null ? void 0 : r.type) === "basic" && /* @__PURE__ */ t(F, { children: [
2892
2972
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
2893
- /* @__PURE__ */ r("label", { children: "Username" }),
2894
- /* @__PURE__ */ r(
2973
+ /* @__PURE__ */ e("label", { children: "Username" }),
2974
+ /* @__PURE__ */ e(
2895
2975
  "input",
2896
2976
  {
2897
2977
  type: "text",
2898
- value: ((f = e.basic) == null ? void 0 : f.username) || "",
2978
+ value: ((l = r.basic) == null ? void 0 : l.username) || "",
2899
2979
  onChange: (b) => {
2900
2980
  var d;
2901
2981
  return a({
2902
- ...e,
2982
+ ...r,
2903
2983
  basic: {
2904
- ...e.basic,
2984
+ ...r.basic,
2905
2985
  username: b.target.value,
2906
- password: ((d = e.basic) == null ? void 0 : d.password) || ""
2986
+ password: ((d = r.basic) == null ? void 0 : d.password) || ""
2907
2987
  }
2908
2988
  });
2909
2989
  }
@@ -2911,20 +2991,20 @@ function cr({
2911
2991
  )
2912
2992
  ] }),
2913
2993
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
2914
- /* @__PURE__ */ r("label", { children: "Password" }),
2915
- /* @__PURE__ */ r(
2994
+ /* @__PURE__ */ e("label", { children: "Password" }),
2995
+ /* @__PURE__ */ e(
2916
2996
  "input",
2917
2997
  {
2918
2998
  type: "password",
2919
- value: ((y = e.basic) == null ? void 0 : y.password) || "",
2999
+ value: ((y = r.basic) == null ? void 0 : y.password) || "",
2920
3000
  onChange: (b) => {
2921
3001
  var d;
2922
3002
  return a({
2923
- ...e,
3003
+ ...r,
2924
3004
  basic: {
2925
- ...e.basic,
3005
+ ...r.basic,
2926
3006
  password: b.target.value,
2927
- username: ((d = e.basic) == null ? void 0 : d.username) || ""
3007
+ username: ((d = r.basic) == null ? void 0 : d.username) || ""
2928
3008
  }
2929
3009
  });
2930
3010
  }
@@ -2934,32 +3014,32 @@ function cr({
2934
3014
  ] })
2935
3015
  ] });
2936
3016
  }
2937
- function or({
2938
- preRequestScript: e,
3017
+ function dr({
3018
+ preRequestScript: r,
2939
3019
  testScript: a,
2940
3020
  onPreRequestChange: i,
2941
3021
  onTestChange: n
2942
3022
  }) {
2943
3023
  return /* @__PURE__ */ t("div", { className: "nice-api-tester__tests-editor", children: [
2944
3024
  /* @__PURE__ */ t("div", { className: "nice-api-tester__script-section", children: [
2945
- /* @__PURE__ */ r("h4", { children: "Pre-request Script" }),
2946
- /* @__PURE__ */ r(
3025
+ /* @__PURE__ */ e("h4", { children: "Pre-request Script" }),
3026
+ /* @__PURE__ */ e(
2947
3027
  "textarea",
2948
3028
  {
2949
- value: e,
2950
- onChange: (s) => i(s.target.value),
3029
+ value: r,
3030
+ onChange: (c) => i(c.target.value),
2951
3031
  placeholder: "// Code to run before the request",
2952
3032
  rows: 5
2953
3033
  }
2954
3034
  )
2955
3035
  ] }),
2956
3036
  /* @__PURE__ */ t("div", { className: "nice-api-tester__script-section", children: [
2957
- /* @__PURE__ */ r("h4", { children: "Tests" }),
2958
- /* @__PURE__ */ r(
3037
+ /* @__PURE__ */ e("h4", { children: "Tests" }),
3038
+ /* @__PURE__ */ e(
2959
3039
  "textarea",
2960
3040
  {
2961
3041
  value: a,
2962
- onChange: (s) => n(s.target.value),
3042
+ onChange: (c) => n(c.target.value),
2963
3043
  placeholder: `pm.test("Status code is 200", function () {
2964
3044
  pm.expect(pm.response.code).to.equal(200);
2965
3045
  });`,
@@ -2969,7 +3049,7 @@ function or({
2969
3049
  ] })
2970
3050
  ] });
2971
3051
  }
2972
- const dr = [
3052
+ const lr = [
2973
3053
  {
2974
3054
  target: ".nice-integration-builder",
2975
3055
  titleKey: "tutorial.integrationBuilder.intro.title",
@@ -2978,7 +3058,7 @@ const dr = [
2978
3058
  content: "Wire a flow of nodes (triggers → actions → error handling) and connect them to build an integration.",
2979
3059
  placement: "auto"
2980
3060
  }
2981
- ], te = [
3061
+ ], ce = [
2982
3062
  { type: "trigger", label: "Trigger", icon: "⚡", category: "Control" },
2983
3063
  { type: "http-request", label: "HTTP Request", icon: "🌐", category: "Actions" },
2984
3064
  { type: "transform", label: "Transform", icon: "🔄", category: "Data" },
@@ -2992,7 +3072,7 @@ const dr = [
2992
3072
  { type: "webhook", label: "Webhook", icon: "🔗", category: "Actions" },
2993
3073
  { type: "function", label: "Function", icon: "ƒ", category: "Actions" },
2994
3074
  { type: "error-handler", label: "Error Handler", icon: "⚠️", category: "Control" }
2995
- ], lr = {
3075
+ ], fr = {
2996
3076
  id: "",
2997
3077
  name: "New Flow",
2998
3078
  nodes: [],
@@ -3001,247 +3081,256 @@ const dr = [
3001
3081
  triggers: [],
3002
3082
  errorHandling: { strategy: "stop" }
3003
3083
  };
3004
- function Nr({
3005
- flow: e,
3084
+ function xr({
3085
+ flow: r,
3006
3086
  connectors: a = [],
3007
3087
  onChange: i,
3008
3088
  onSave: n,
3009
- onRun: s,
3089
+ onRun: c,
3010
3090
  className: u = "",
3011
- tutorial: f
3091
+ tutorial: l
3012
3092
  }) {
3013
- const [y, b] = g(
3014
- e || { ...lr, id: crypto.randomUUID() }
3015
- ), [d, v] = g(null), [k, m] = g(!0), [T, _] = g("canvas"), [I, H] = g(!1), [K, j] = g(null), [G, $] = g(!1), [U, O] = g(null), [q, w] = g(!1), x = se(null), S = P(
3093
+ const [y, b] = v(
3094
+ r || { ...fr, id: crypto.randomUUID() }
3095
+ ), [d, h] = v(null), [S, m] = v(!0), [k, g] = v("canvas"), [P, C] = v(!1), [O, U] = v(null), [W, $] = v(!1), [L, I] = v(null), [j, w] = v(!1), N = oe(null), x = R(
3016
3096
  (p) => {
3017
- b((h) => {
3018
- const C = p(h);
3019
- return i == null || i(C), C;
3097
+ b((s) => {
3098
+ const o = p(s);
3099
+ return i == null || i(o), o;
3020
3100
  });
3021
3101
  },
3022
3102
  [i]
3023
- ), B = P(
3024
- (p, h) => {
3025
- var c;
3026
- const C = {
3103
+ ), K = R(
3104
+ (p, s) => {
3105
+ var _;
3106
+ const o = {
3027
3107
  id: crypto.randomUUID(),
3028
3108
  type: p,
3029
- name: ((c = te.find((o) => o.type === p)) == null ? void 0 : c.label) || p,
3030
- position: h,
3031
- config: fr(p),
3109
+ name: ((_ = ce.find((E) => E.type === p)) == null ? void 0 : _.label) || p,
3110
+ position: s,
3111
+ config: pr(p),
3032
3112
  inputs: p !== "trigger" ? ["input"] : [],
3033
3113
  outputs: ["output"]
3034
3114
  };
3035
- S((o) => ({
3036
- ...o,
3037
- nodes: [...o.nodes, C]
3038
- })), v(C);
3115
+ x((E) => ({
3116
+ ...E,
3117
+ nodes: [...E.nodes, o]
3118
+ })), h(o);
3039
3119
  },
3040
- [S]
3041
- ), V = P(
3120
+ [x]
3121
+ ), q = R(
3042
3122
  (p) => {
3043
- S((h) => ({
3044
- ...h,
3045
- nodes: h.nodes.filter((C) => C.id !== p),
3046
- connections: h.connections.filter(
3047
- (C) => C.sourceNodeId !== p && C.targetNodeId !== p
3123
+ x((s) => ({
3124
+ ...s,
3125
+ nodes: s.nodes.filter((o) => o.id !== p),
3126
+ connections: s.connections.filter(
3127
+ (o) => o.sourceNodeId !== p && o.targetNodeId !== p
3048
3128
  )
3049
- })), v(null);
3129
+ })), h(null);
3050
3130
  },
3051
- [S]
3052
- ), z = P(
3053
- (p, h) => {
3054
- S((C) => ({
3055
- ...C,
3056
- nodes: C.nodes.map((c) => c.id === p ? { ...c, ...h } : c)
3057
- })), (d == null ? void 0 : d.id) === p && v((C) => C ? { ...C, ...h } : null);
3131
+ [x]
3132
+ ), B = R(
3133
+ (p, s) => {
3134
+ x((o) => ({
3135
+ ...o,
3136
+ nodes: o.nodes.map((_) => _.id === p ? { ..._, ...s } : _)
3137
+ })), (d == null ? void 0 : d.id) === p && h((o) => o ? { ...o, ...s } : null);
3058
3138
  },
3059
- [S, d]
3060
- ), L = P(
3061
- (p, h, C, c) => {
3062
- p === C || y.connections.some(
3063
- (N) => N.sourceNodeId === p && N.targetNodeId === C && N.sourceOutput === h && N.targetInput === c
3064
- ) || S((N) => ({
3065
- ...N,
3139
+ [x, d]
3140
+ ), M = R(
3141
+ (p, s, o, _) => {
3142
+ p === o || y.connections.some(
3143
+ (H) => H.sourceNodeId === p && H.targetNodeId === o && H.sourceOutput === s && H.targetInput === _
3144
+ ) || x((H) => ({
3145
+ ...H,
3066
3146
  connections: [
3067
- ...N.connections,
3147
+ ...H.connections,
3068
3148
  {
3069
3149
  id: crypto.randomUUID(),
3070
3150
  sourceNodeId: p,
3071
- sourceOutput: h,
3072
- targetNodeId: C,
3073
- targetInput: c
3151
+ sourceOutput: s,
3152
+ targetNodeId: o,
3153
+ targetInput: _
3074
3154
  }
3075
3155
  ]
3076
3156
  }));
3077
3157
  },
3078
- [y.connections, S]
3079
- ), X = P(
3158
+ [y.connections, x]
3159
+ ), J = R(
3080
3160
  (p) => {
3081
- S((h) => ({
3082
- ...h,
3083
- connections: h.connections.filter((C) => C.id !== p)
3161
+ x((s) => ({
3162
+ ...s,
3163
+ connections: s.connections.filter((o) => o.id !== p)
3084
3164
  }));
3085
3165
  },
3086
- [S]
3087
- ), F = P(
3166
+ [x]
3167
+ ), V = R(
3088
3168
  (p) => {
3089
- if (p.preventDefault(), !K || !x.current)
3169
+ if (p.preventDefault(), !O || !N.current)
3090
3170
  return;
3091
- const h = x.current.getBoundingClientRect(), C = p.clientX - h.left, c = p.clientY - h.top;
3092
- B(K, { x: C, y: c }), H(!1), j(null);
3171
+ const s = N.current.getBoundingClientRect(), o = p.clientX - s.left, _ = p.clientY - s.top;
3172
+ K(O, { x: o, y: _ }), C(!1), U(null);
3093
3173
  },
3094
- [K, B]
3095
- ), Q = P(async () => {
3096
- if (s) {
3174
+ [O, K]
3175
+ ), Y = R(async () => {
3176
+ if (c) {
3097
3177
  w(!0);
3098
3178
  try {
3099
- await s(y);
3179
+ await c(y);
3100
3180
  } finally {
3101
3181
  w(!1);
3102
3182
  }
3103
3183
  }
3104
- }, [y, s]), Y = P(() => {
3184
+ }, [y, c]), G = R(() => {
3105
3185
  n == null || n(y);
3106
- }, [y, n]);
3107
- return /* @__PURE__ */ t("div", { className: `nice-integration-builder ${u}`, style: { position: "relative" }, children: [
3108
- f && /* @__PURE__ */ r("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ r(re, { steps: ee(f, dr) }) }),
3109
- /* @__PURE__ */ t("div", { className: "nice-integration-builder__toolbar", children: [
3110
- /* @__PURE__ */ r(
3111
- "input",
3112
- {
3113
- type: "text",
3114
- value: y.name,
3115
- onChange: (p) => S((h) => ({ ...h, name: p.target.value })),
3116
- className: "nice-integration-builder__name-input"
3117
- }
3118
- ),
3119
- /* @__PURE__ */ r("div", { className: "nice-integration-builder__tabs", children: ["canvas", "code", "variables", "settings"].map((p) => /* @__PURE__ */ r(
3120
- "button",
3186
+ }, [y, n]), Q = S && k === "canvas" ? /* @__PURE__ */ t("div", { className: "nice-integration-builder__palette", children: [
3187
+ /* @__PURE__ */ e("h4", { children: "Nodes" }),
3188
+ ["Control", "Actions", "Data"].map((p) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__category", children: [
3189
+ /* @__PURE__ */ e("h5", { children: p }),
3190
+ ce.filter((s) => s.category === p).map((s) => /* @__PURE__ */ t(
3191
+ "div",
3121
3192
  {
3122
- className: `nice-integration-builder__tab ${T === p ? "nice-integration-builder__tab--active" : ""}`,
3123
- onClick: () => _(p),
3124
- children: p.charAt(0).toUpperCase() + p.slice(1)
3193
+ className: "nice-integration-builder__palette-item",
3194
+ draggable: !0,
3195
+ onDragStart: () => {
3196
+ C(!0), U(s.type);
3197
+ },
3198
+ onDragEnd: () => {
3199
+ C(!1), U(null);
3200
+ },
3201
+ children: [
3202
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: s.icon }),
3203
+ /* @__PURE__ */ e("span", { children: s.label })
3204
+ ]
3125
3205
  },
3126
- p
3127
- )) }),
3128
- /* @__PURE__ */ t("div", { className: "nice-integration-builder__actions", children: [
3129
- /* @__PURE__ */ r(
3130
- "button",
3131
- {
3132
- onClick: Q,
3133
- disabled: q,
3134
- className: "nice-integration-builder__run-btn",
3135
- children: q ? "⏳ Running..." : "▶ Run"
3136
- }
3137
- ),
3138
- /* @__PURE__ */ r("button", { onClick: Y, className: "nice-integration-builder__save-btn", children: "💾 Save" })
3139
- ] })
3140
- ] }),
3141
- /* @__PURE__ */ t("div", { className: "nice-integration-builder__main", children: [
3142
- k && T === "canvas" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__palette", children: [
3143
- /* @__PURE__ */ r("h4", { children: "Nodes" }),
3144
- ["Control", "Actions", "Data"].map((p) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__category", children: [
3145
- /* @__PURE__ */ r("h5", { children: p }),
3146
- te.filter((h) => h.category === p).map((h) => /* @__PURE__ */ t(
3206
+ s.type
3207
+ ))
3208
+ ] }, p)),
3209
+ a.length > 0 && /* @__PURE__ */ t("div", { className: "nice-integration-builder__category", children: [
3210
+ /* @__PURE__ */ e("h5", { children: "Connectors" }),
3211
+ a.map((p) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__palette-item", children: [
3212
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: "🔌" }),
3213
+ /* @__PURE__ */ e("span", { children: p.name })
3214
+ ] }, p.id))
3215
+ ] })
3216
+ ] }) : void 0, Z = d && k === "canvas" ? /* @__PURE__ */ e(
3217
+ yr,
3218
+ {
3219
+ node: d,
3220
+ onChange: (p) => B(d.id, p),
3221
+ onClose: () => h(null)
3222
+ }
3223
+ ) : void 0;
3224
+ return /* @__PURE__ */ t("div", { style: { position: "relative", height: "100%" }, children: [
3225
+ l && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ie, { steps: ae(l, lr) }) }),
3226
+ /* @__PURE__ */ t(
3227
+ de,
3228
+ {
3229
+ flush: !0,
3230
+ className: `nice-integration-builder ${u}`,
3231
+ height: "100%",
3232
+ style: { minHeight: 600 },
3233
+ sidebar: Q,
3234
+ rightSidebar: Z,
3235
+ toolbar: /* @__PURE__ */ t("div", { className: "nice-integration-builder__toolbar", children: [
3236
+ /* @__PURE__ */ e(
3237
+ "input",
3238
+ {
3239
+ type: "text",
3240
+ value: y.name,
3241
+ onChange: (p) => x((s) => ({ ...s, name: p.target.value })),
3242
+ className: "nice-integration-builder__name-input"
3243
+ }
3244
+ ),
3245
+ /* @__PURE__ */ e("div", { className: "nice-integration-builder__tabs", children: ["canvas", "code", "variables", "settings"].map((p) => /* @__PURE__ */ e(
3246
+ "button",
3247
+ {
3248
+ className: `nice-integration-builder__tab ${k === p ? "nice-integration-builder__tab--active" : ""}`,
3249
+ onClick: () => g(p),
3250
+ children: p.charAt(0).toUpperCase() + p.slice(1)
3251
+ },
3252
+ p
3253
+ )) }),
3254
+ /* @__PURE__ */ t("div", { className: "nice-integration-builder__actions", children: [
3255
+ /* @__PURE__ */ e(
3256
+ "button",
3257
+ {
3258
+ onClick: Y,
3259
+ disabled: j,
3260
+ className: "nice-integration-builder__run-btn",
3261
+ children: j ? "⏳ Running..." : "▶ Run"
3262
+ }
3263
+ ),
3264
+ /* @__PURE__ */ e("button", { onClick: G, className: "nice-integration-builder__save-btn", children: "💾 Save" })
3265
+ ] })
3266
+ ] }),
3267
+ children: [
3268
+ k === "canvas" && /* @__PURE__ */ t(
3147
3269
  "div",
3148
3270
  {
3149
- className: "nice-integration-builder__palette-item",
3150
- draggable: !0,
3151
- onDragStart: () => {
3152
- H(!0), j(h.type);
3153
- },
3154
- onDragEnd: () => {
3155
- H(!1), j(null);
3156
- },
3271
+ ref: N,
3272
+ className: `nice-integration-builder__canvas ${P ? "nice-integration-builder__canvas--dragging" : ""}`,
3273
+ onDragOver: (p) => p.preventDefault(),
3274
+ onDrop: V,
3275
+ onClick: () => h(null),
3157
3276
  children: [
3158
- /* @__PURE__ */ r("span", { className: "nice-integration-builder__palette-icon", children: h.icon }),
3159
- /* @__PURE__ */ r("span", { children: h.label })
3277
+ /* @__PURE__ */ e("svg", { className: "nice-integration-builder__connections", children: y.connections.map((p) => {
3278
+ const s = y.nodes.find((X) => X.id === p.sourceNodeId), o = y.nodes.find((X) => X.id === p.targetNodeId);
3279
+ if (!s || !o)
3280
+ return null;
3281
+ const _ = s.position.x + 150, E = s.position.y + 30, H = o.position.x, A = o.position.y + 30, ee = (_ + H) / 2;
3282
+ return /* @__PURE__ */ e("g", { onClick: () => J(p.id), children: /* @__PURE__ */ e(
3283
+ "path",
3284
+ {
3285
+ d: `M ${_} ${E} C ${ee} ${E}, ${ee} ${A}, ${H} ${A}`,
3286
+ className: "nice-integration-builder__connection"
3287
+ }
3288
+ ) }, p.id);
3289
+ }) }),
3290
+ y.nodes.map((p) => /* @__PURE__ */ e(
3291
+ mr,
3292
+ {
3293
+ node: p,
3294
+ isSelected: (d == null ? void 0 : d.id) === p.id,
3295
+ onSelect: () => h(p),
3296
+ onDelete: () => q(p.id),
3297
+ onPositionChange: (s) => B(p.id, { position: s }),
3298
+ onStartConnection: (s) => {
3299
+ $(!0), I({ nodeId: p.id, output: s });
3300
+ },
3301
+ onEndConnection: (s) => {
3302
+ L && M(L.nodeId, L.output, p.id, s), $(!1), I(null);
3303
+ }
3304
+ },
3305
+ p.id
3306
+ )),
3307
+ y.nodes.length === 0 && /* @__PURE__ */ e("div", { className: "nice-integration-builder__empty", children: "Drag nodes from the palette to build your flow" })
3160
3308
  ]
3161
- },
3162
- h.type
3163
- ))
3164
- ] }, p)),
3165
- a.length > 0 && /* @__PURE__ */ t("div", { className: "nice-integration-builder__category", children: [
3166
- /* @__PURE__ */ r("h5", { children: "Connectors" }),
3167
- a.map((p) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__palette-item", children: [
3168
- /* @__PURE__ */ r("span", { className: "nice-integration-builder__palette-icon", children: "🔌" }),
3169
- /* @__PURE__ */ r("span", { children: p.name })
3170
- ] }, p.id))
3171
- ] })
3172
- ] }),
3173
- T === "canvas" && /* @__PURE__ */ t(
3174
- "div",
3175
- {
3176
- ref: x,
3177
- className: `nice-integration-builder__canvas ${I ? "nice-integration-builder__canvas--dragging" : ""}`,
3178
- onDragOver: (p) => p.preventDefault(),
3179
- onDrop: F,
3180
- onClick: () => v(null),
3181
- children: [
3182
- /* @__PURE__ */ r("svg", { className: "nice-integration-builder__connections", children: y.connections.map((p) => {
3183
- const h = y.nodes.find((R) => R.id === p.sourceNodeId), C = y.nodes.find((R) => R.id === p.targetNodeId);
3184
- if (!h || !C)
3185
- return null;
3186
- const c = h.position.x + 150, o = h.position.y + 30, N = C.position.x, D = C.position.y + 30, E = (c + N) / 2;
3187
- return /* @__PURE__ */ r("g", { onClick: () => X(p.id), children: /* @__PURE__ */ r(
3188
- "path",
3189
- {
3190
- d: `M ${c} ${o} C ${E} ${o}, ${E} ${D}, ${N} ${D}`,
3191
- className: "nice-integration-builder__connection"
3192
- }
3193
- ) }, p.id);
3194
- }) }),
3195
- y.nodes.map((p) => /* @__PURE__ */ r(
3196
- pr,
3197
- {
3198
- node: p,
3199
- isSelected: (d == null ? void 0 : d.id) === p.id,
3200
- onSelect: () => v(p),
3201
- onDelete: () => V(p.id),
3202
- onPositionChange: (h) => z(p.id, { position: h }),
3203
- onStartConnection: (h) => {
3204
- $(!0), O({ nodeId: p.id, output: h });
3205
- },
3206
- onEndConnection: (h) => {
3207
- U && L(U.nodeId, U.output, p.id, h), $(!1), O(null);
3208
- }
3209
- },
3210
- p.id
3211
- )),
3212
- y.nodes.length === 0 && /* @__PURE__ */ r("div", { className: "nice-integration-builder__empty", children: "Drag nodes from the palette to build your flow" })
3213
- ]
3214
- }
3215
- ),
3216
- T === "code" && /* @__PURE__ */ r("div", { className: "nice-integration-builder__code-view", children: /* @__PURE__ */ r("pre", { children: JSON.stringify(y, null, 2) }) }),
3217
- T === "variables" && /* @__PURE__ */ r(
3218
- yr,
3219
- {
3220
- variables: y.variables,
3221
- onChange: (p) => S((h) => ({ ...h, variables: p }))
3222
- }
3223
- ),
3224
- T === "settings" && /* @__PURE__ */ r(
3225
- ur,
3226
- {
3227
- errorHandling: y.errorHandling,
3228
- schedule: y.schedule,
3229
- onChange: (p, h) => S((C) => ({ ...C, errorHandling: p, schedule: h }))
3230
- }
3231
- ),
3232
- d && T === "canvas" && /* @__PURE__ */ r(
3233
- mr,
3234
- {
3235
- node: d,
3236
- onChange: (p) => z(d.id, p),
3237
- onClose: () => v(null)
3238
- }
3239
- )
3240
- ] })
3309
+ }
3310
+ ),
3311
+ k === "code" && /* @__PURE__ */ e("div", { className: "nice-integration-builder__code-view", children: /* @__PURE__ */ e("pre", { children: JSON.stringify(y, null, 2) }) }),
3312
+ k === "variables" && /* @__PURE__ */ e(
3313
+ ur,
3314
+ {
3315
+ variables: y.variables,
3316
+ onChange: (p) => x((s) => ({ ...s, variables: p }))
3317
+ }
3318
+ ),
3319
+ k === "settings" && /* @__PURE__ */ e(
3320
+ br,
3321
+ {
3322
+ errorHandling: y.errorHandling,
3323
+ schedule: y.schedule,
3324
+ onChange: (p, s) => x((o) => ({ ...o, errorHandling: p, schedule: s }))
3325
+ }
3326
+ )
3327
+ ]
3328
+ }
3329
+ )
3241
3330
  ] });
3242
3331
  }
3243
- function fr(e) {
3244
- switch (e) {
3332
+ function pr(r) {
3333
+ switch (r) {
3245
3334
  case "http-request":
3246
3335
  return { method: "GET", url: "", headers: {}, body: "" };
3247
3336
  case "transform":
@@ -3271,214 +3360,214 @@ return input;` };
3271
3360
  return {};
3272
3361
  }
3273
3362
  }
3274
- function pr({
3275
- node: e,
3363
+ function mr({
3364
+ node: r,
3276
3365
  isSelected: a,
3277
3366
  onSelect: i,
3278
3367
  onDelete: n,
3279
- onPositionChange: s,
3368
+ onPositionChange: c,
3280
3369
  onStartConnection: u,
3281
- onEndConnection: f
3370
+ onEndConnection: l
3282
3371
  }) {
3283
- const [y, b] = g(!1), [d, v] = g({ x: 0, y: 0 }), k = se(null), m = te.find((_) => _.type === e.type), T = (_) => {
3284
- _.button === 0 && (_.stopPropagation(), b(!0), v({
3285
- x: _.clientX - e.position.x,
3286
- y: _.clientY - e.position.y
3372
+ const [y, b] = v(!1), [d, h] = v({ x: 0, y: 0 }), S = oe(null), m = ce.find((g) => g.type === r.type), k = (g) => {
3373
+ g.button === 0 && (g.stopPropagation(), b(!0), h({
3374
+ x: g.clientX - r.position.x,
3375
+ y: g.clientY - r.position.y
3287
3376
  }), i());
3288
3377
  };
3289
- return ye(() => {
3378
+ return he(() => {
3290
3379
  if (!y)
3291
3380
  return;
3292
- const _ = (H) => {
3293
- s({
3294
- x: H.clientX - d.x,
3295
- y: H.clientY - d.y
3381
+ const g = (C) => {
3382
+ c({
3383
+ x: C.clientX - d.x,
3384
+ y: C.clientY - d.y
3296
3385
  });
3297
- }, I = () => {
3386
+ }, P = () => {
3298
3387
  b(!1);
3299
3388
  };
3300
- return window.addEventListener("mousemove", _), window.addEventListener("mouseup", I), () => {
3301
- window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", I);
3389
+ return window.addEventListener("mousemove", g), window.addEventListener("mouseup", P), () => {
3390
+ window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", P);
3302
3391
  };
3303
- }, [y, d, s]), /* @__PURE__ */ t(
3392
+ }, [y, d, c]), /* @__PURE__ */ t(
3304
3393
  "div",
3305
3394
  {
3306
- ref: k,
3307
- className: `nice-integration-builder__node nice-integration-builder__node--${e.type} ${a ? "nice-integration-builder__node--selected" : ""}`,
3395
+ ref: S,
3396
+ className: `nice-integration-builder__node nice-integration-builder__node--${r.type} ${a ? "nice-integration-builder__node--selected" : ""}`,
3308
3397
  style: {
3309
- left: e.position.x,
3310
- top: e.position.y
3398
+ left: r.position.x,
3399
+ top: r.position.y
3311
3400
  },
3312
- onMouseDown: T,
3401
+ onMouseDown: k,
3313
3402
  children: [
3314
3403
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__node-header", children: [
3315
- /* @__PURE__ */ r("span", { className: "nice-integration-builder__node-icon", children: (m == null ? void 0 : m.icon) || "📦" }),
3316
- /* @__PURE__ */ r("span", { className: "nice-integration-builder__node-name", children: e.name }),
3317
- /* @__PURE__ */ r(
3404
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__node-icon", children: (m == null ? void 0 : m.icon) || "📦" }),
3405
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__node-name", children: r.name }),
3406
+ /* @__PURE__ */ e(
3318
3407
  "button",
3319
3408
  {
3320
3409
  className: "nice-integration-builder__node-delete",
3321
- onClick: (_) => {
3322
- _.stopPropagation(), n();
3410
+ onClick: (g) => {
3411
+ g.stopPropagation(), n();
3323
3412
  },
3324
3413
  children: "×"
3325
3414
  }
3326
3415
  )
3327
3416
  ] }),
3328
- e.inputs.map((_) => /* @__PURE__ */ t(
3417
+ r.inputs.map((g) => /* @__PURE__ */ t(
3329
3418
  "div",
3330
3419
  {
3331
3420
  className: "nice-integration-builder__port nice-integration-builder__port--input",
3332
- onMouseUp: () => f(_),
3421
+ onMouseUp: () => l(g),
3333
3422
  children: [
3334
- /* @__PURE__ */ r("span", { className: "nice-integration-builder__port-dot" }),
3335
- /* @__PURE__ */ r("span", { className: "nice-integration-builder__port-label", children: _ })
3423
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-dot" }),
3424
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-label", children: g })
3336
3425
  ]
3337
3426
  },
3338
- _
3427
+ g
3339
3428
  )),
3340
- e.outputs.map((_) => /* @__PURE__ */ t(
3429
+ r.outputs.map((g) => /* @__PURE__ */ t(
3341
3430
  "div",
3342
3431
  {
3343
3432
  className: "nice-integration-builder__port nice-integration-builder__port--output",
3344
- onMouseDown: (I) => {
3345
- I.stopPropagation(), u(_);
3433
+ onMouseDown: (P) => {
3434
+ P.stopPropagation(), u(g);
3346
3435
  },
3347
3436
  children: [
3348
- /* @__PURE__ */ r("span", { className: "nice-integration-builder__port-label", children: _ }),
3349
- /* @__PURE__ */ r("span", { className: "nice-integration-builder__port-dot" })
3437
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-label", children: g }),
3438
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-dot" })
3350
3439
  ]
3351
3440
  },
3352
- _
3441
+ g
3353
3442
  ))
3354
3443
  ]
3355
3444
  }
3356
3445
  );
3357
3446
  }
3358
- function mr({
3359
- node: e,
3447
+ function yr({
3448
+ node: r,
3360
3449
  onChange: a,
3361
3450
  onClose: i
3362
3451
  }) {
3363
3452
  return /* @__PURE__ */ t("div", { className: "nice-integration-builder__properties", children: [
3364
3453
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__properties-header", children: [
3365
- /* @__PURE__ */ r("h4", { children: e.name }),
3366
- /* @__PURE__ */ r("button", { onClick: i, children: "×" })
3454
+ /* @__PURE__ */ e("h4", { children: r.name }),
3455
+ /* @__PURE__ */ e("button", { onClick: i, children: "×" })
3367
3456
  ] }),
3368
3457
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__properties-content", children: [
3369
3458
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3370
- /* @__PURE__ */ r("label", { children: "Name" }),
3371
- /* @__PURE__ */ r(
3459
+ /* @__PURE__ */ e("label", { children: "Name" }),
3460
+ /* @__PURE__ */ e(
3372
3461
  "input",
3373
3462
  {
3374
3463
  type: "text",
3375
- value: e.name,
3464
+ value: r.name,
3376
3465
  onChange: (n) => a({ name: n.target.value })
3377
3466
  }
3378
3467
  )
3379
3468
  ] }),
3380
- e.type === "http-request" && /* @__PURE__ */ t(J, { children: [
3469
+ r.type === "http-request" && /* @__PURE__ */ t(F, { children: [
3381
3470
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3382
- /* @__PURE__ */ r("label", { children: "Method" }),
3383
- /* @__PURE__ */ r(
3471
+ /* @__PURE__ */ e("label", { children: "Method" }),
3472
+ /* @__PURE__ */ e(
3384
3473
  "select",
3385
3474
  {
3386
- value: e.config.method || "GET",
3387
- onChange: (n) => a({ config: { ...e.config, method: n.target.value } }),
3388
- children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((n) => /* @__PURE__ */ r("option", { value: n, children: n }, n))
3475
+ value: r.config.method || "GET",
3476
+ onChange: (n) => a({ config: { ...r.config, method: n.target.value } }),
3477
+ children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
3389
3478
  }
3390
3479
  )
3391
3480
  ] }),
3392
3481
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3393
- /* @__PURE__ */ r("label", { children: "URL" }),
3394
- /* @__PURE__ */ r(
3482
+ /* @__PURE__ */ e("label", { children: "URL" }),
3483
+ /* @__PURE__ */ e(
3395
3484
  "input",
3396
3485
  {
3397
3486
  type: "text",
3398
- value: e.config.url || "",
3399
- onChange: (n) => a({ config: { ...e.config, url: n.target.value } }),
3487
+ value: r.config.url || "",
3488
+ onChange: (n) => a({ config: { ...r.config, url: n.target.value } }),
3400
3489
  placeholder: "https://api.example.com/endpoint"
3401
3490
  }
3402
3491
  )
3403
3492
  ] })
3404
3493
  ] }),
3405
- e.type === "delay" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3406
- /* @__PURE__ */ r("label", { children: "Duration (ms)" }),
3407
- /* @__PURE__ */ r(
3494
+ r.type === "delay" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3495
+ /* @__PURE__ */ e("label", { children: "Duration (ms)" }),
3496
+ /* @__PURE__ */ e(
3408
3497
  "input",
3409
3498
  {
3410
3499
  type: "number",
3411
- value: e.config.duration || 1e3,
3412
- onChange: (n) => a({ config: { ...e.config, duration: parseInt(n.target.value, 10) } })
3500
+ value: r.config.duration || 1e3,
3501
+ onChange: (n) => a({ config: { ...r.config, duration: parseInt(n.target.value, 10) } })
3413
3502
  }
3414
3503
  )
3415
3504
  ] }),
3416
- e.type === "set-variable" && /* @__PURE__ */ t(J, { children: [
3505
+ r.type === "set-variable" && /* @__PURE__ */ t(F, { children: [
3417
3506
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3418
- /* @__PURE__ */ r("label", { children: "Variable Name" }),
3419
- /* @__PURE__ */ r(
3507
+ /* @__PURE__ */ e("label", { children: "Variable Name" }),
3508
+ /* @__PURE__ */ e(
3420
3509
  "input",
3421
3510
  {
3422
3511
  type: "text",
3423
- value: e.config.name || "",
3424
- onChange: (n) => a({ config: { ...e.config, name: n.target.value } })
3512
+ value: r.config.name || "",
3513
+ onChange: (n) => a({ config: { ...r.config, name: n.target.value } })
3425
3514
  }
3426
3515
  )
3427
3516
  ] }),
3428
3517
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3429
- /* @__PURE__ */ r("label", { children: "Value" }),
3430
- /* @__PURE__ */ r(
3518
+ /* @__PURE__ */ e("label", { children: "Value" }),
3519
+ /* @__PURE__ */ e(
3431
3520
  "input",
3432
3521
  {
3433
3522
  type: "text",
3434
- value: e.config.value || "",
3435
- onChange: (n) => a({ config: { ...e.config, value: n.target.value } })
3523
+ value: r.config.value || "",
3524
+ onChange: (n) => a({ config: { ...r.config, value: n.target.value } })
3436
3525
  }
3437
3526
  )
3438
3527
  ] })
3439
3528
  ] }),
3440
- e.type === "function" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3441
- /* @__PURE__ */ r("label", { children: "Code" }),
3442
- /* @__PURE__ */ r(
3529
+ r.type === "function" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3530
+ /* @__PURE__ */ e("label", { children: "Code" }),
3531
+ /* @__PURE__ */ e(
3443
3532
  "textarea",
3444
3533
  {
3445
- value: e.config.code || "",
3446
- onChange: (n) => a({ config: { ...e.config, code: n.target.value } }),
3534
+ value: r.config.code || "",
3535
+ onChange: (n) => a({ config: { ...r.config, code: n.target.value } }),
3447
3536
  rows: 10,
3448
3537
  className: "nice-integration-builder__code-input"
3449
3538
  }
3450
3539
  )
3451
3540
  ] }),
3452
- e.type === "email" && /* @__PURE__ */ t(J, { children: [
3541
+ r.type === "email" && /* @__PURE__ */ t(F, { children: [
3453
3542
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3454
- /* @__PURE__ */ r("label", { children: "To" }),
3455
- /* @__PURE__ */ r(
3543
+ /* @__PURE__ */ e("label", { children: "To" }),
3544
+ /* @__PURE__ */ e(
3456
3545
  "input",
3457
3546
  {
3458
3547
  type: "text",
3459
- value: e.config.to || "",
3460
- onChange: (n) => a({ config: { ...e.config, to: n.target.value } })
3548
+ value: r.config.to || "",
3549
+ onChange: (n) => a({ config: { ...r.config, to: n.target.value } })
3461
3550
  }
3462
3551
  )
3463
3552
  ] }),
3464
3553
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3465
- /* @__PURE__ */ r("label", { children: "Subject" }),
3466
- /* @__PURE__ */ r(
3554
+ /* @__PURE__ */ e("label", { children: "Subject" }),
3555
+ /* @__PURE__ */ e(
3467
3556
  "input",
3468
3557
  {
3469
3558
  type: "text",
3470
- value: e.config.subject || "",
3471
- onChange: (n) => a({ config: { ...e.config, subject: n.target.value } })
3559
+ value: r.config.subject || "",
3560
+ onChange: (n) => a({ config: { ...r.config, subject: n.target.value } })
3472
3561
  }
3473
3562
  )
3474
3563
  ] }),
3475
3564
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3476
- /* @__PURE__ */ r("label", { children: "Body" }),
3477
- /* @__PURE__ */ r(
3565
+ /* @__PURE__ */ e("label", { children: "Body" }),
3566
+ /* @__PURE__ */ e(
3478
3567
  "textarea",
3479
3568
  {
3480
- value: e.config.body || "",
3481
- onChange: (n) => a({ config: { ...e.config, body: n.target.value } }),
3569
+ value: r.config.body || "",
3570
+ onChange: (n) => a({ config: { ...r.config, body: n.target.value } }),
3482
3571
  rows: 5
3483
3572
  }
3484
3573
  )
@@ -3487,124 +3576,124 @@ function mr({
3487
3576
  ] })
3488
3577
  ] });
3489
3578
  }
3490
- function yr({ variables: e, onChange: a }) {
3579
+ function ur({ variables: r, onChange: a }) {
3491
3580
  const i = () => {
3492
- a({ ...e, newVariable: "" });
3581
+ a({ ...r, newVariable: "" });
3493
3582
  };
3494
3583
  return /* @__PURE__ */ t("div", { className: "nice-integration-builder__variables", children: [
3495
- /* @__PURE__ */ r("h4", { children: "Flow Variables" }),
3496
- /* @__PURE__ */ r("div", { className: "nice-integration-builder__variables-list", children: Object.entries(e).map(([n, s]) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__variable-row", children: [
3497
- /* @__PURE__ */ r(
3584
+ /* @__PURE__ */ e("h4", { children: "Flow Variables" }),
3585
+ /* @__PURE__ */ e("div", { className: "nice-integration-builder__variables-list", children: Object.entries(r).map(([n, c]) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__variable-row", children: [
3586
+ /* @__PURE__ */ e(
3498
3587
  "input",
3499
3588
  {
3500
3589
  type: "text",
3501
3590
  value: n,
3502
3591
  onChange: (u) => {
3503
- const { [n]: f, ...y } = e;
3504
- a({ ...y, [u.target.value]: s });
3592
+ const { [n]: l, ...y } = r;
3593
+ a({ ...y, [u.target.value]: c });
3505
3594
  },
3506
3595
  placeholder: "Name"
3507
3596
  }
3508
3597
  ),
3509
- /* @__PURE__ */ r(
3598
+ /* @__PURE__ */ e(
3510
3599
  "input",
3511
3600
  {
3512
3601
  type: "text",
3513
- value: String(s),
3514
- onChange: (u) => a({ ...e, [n]: u.target.value }),
3602
+ value: String(c),
3603
+ onChange: (u) => a({ ...r, [n]: u.target.value }),
3515
3604
  placeholder: "Value"
3516
3605
  }
3517
3606
  ),
3518
- /* @__PURE__ */ r(
3607
+ /* @__PURE__ */ e(
3519
3608
  "button",
3520
3609
  {
3521
3610
  onClick: () => {
3522
- const { [n]: u, ...f } = e;
3523
- a(f);
3611
+ const { [n]: u, ...l } = r;
3612
+ a(l);
3524
3613
  },
3525
3614
  children: "×"
3526
3615
  }
3527
3616
  )
3528
3617
  ] }, n)) }),
3529
- /* @__PURE__ */ r("button", { onClick: i, children: "+ Add Variable" })
3618
+ /* @__PURE__ */ e("button", { onClick: i, children: "+ Add Variable" })
3530
3619
  ] });
3531
3620
  }
3532
- function ur({
3533
- errorHandling: e,
3621
+ function br({
3622
+ errorHandling: r,
3534
3623
  schedule: a,
3535
3624
  onChange: i
3536
3625
  }) {
3537
3626
  return /* @__PURE__ */ t("div", { className: "nice-integration-builder__settings", children: [
3538
- /* @__PURE__ */ r("h4", { children: "Error Handling" }),
3627
+ /* @__PURE__ */ e("h4", { children: "Error Handling" }),
3539
3628
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3540
- /* @__PURE__ */ r("label", { children: "Strategy" }),
3629
+ /* @__PURE__ */ e("label", { children: "Strategy" }),
3541
3630
  /* @__PURE__ */ t(
3542
3631
  "select",
3543
3632
  {
3544
- value: e.strategy,
3633
+ value: r.strategy,
3545
3634
  onChange: (n) => i(
3546
- { ...e, strategy: n.target.value },
3635
+ { ...r, strategy: n.target.value },
3547
3636
  a
3548
3637
  ),
3549
3638
  children: [
3550
- /* @__PURE__ */ r("option", { value: "stop", children: "Stop on error" }),
3551
- /* @__PURE__ */ r("option", { value: "continue", children: "Continue on error" }),
3552
- /* @__PURE__ */ r("option", { value: "retry", children: "Retry on error" })
3639
+ /* @__PURE__ */ e("option", { value: "stop", children: "Stop on error" }),
3640
+ /* @__PURE__ */ e("option", { value: "continue", children: "Continue on error" }),
3641
+ /* @__PURE__ */ e("option", { value: "retry", children: "Retry on error" })
3553
3642
  ]
3554
3643
  }
3555
3644
  )
3556
3645
  ] }),
3557
- e.strategy === "retry" && /* @__PURE__ */ t(J, { children: [
3646
+ r.strategy === "retry" && /* @__PURE__ */ t(F, { children: [
3558
3647
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3559
- /* @__PURE__ */ r("label", { children: "Max Retries" }),
3560
- /* @__PURE__ */ r(
3648
+ /* @__PURE__ */ e("label", { children: "Max Retries" }),
3649
+ /* @__PURE__ */ e(
3561
3650
  "input",
3562
3651
  {
3563
3652
  type: "number",
3564
- value: e.maxRetries || 3,
3565
- onChange: (n) => i({ ...e, maxRetries: parseInt(n.target.value, 10) }, a)
3653
+ value: r.maxRetries || 3,
3654
+ onChange: (n) => i({ ...r, maxRetries: parseInt(n.target.value, 10) }, a)
3566
3655
  }
3567
3656
  )
3568
3657
  ] }),
3569
3658
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3570
- /* @__PURE__ */ r("label", { children: "Retry Delay (ms)" }),
3571
- /* @__PURE__ */ r(
3659
+ /* @__PURE__ */ e("label", { children: "Retry Delay (ms)" }),
3660
+ /* @__PURE__ */ e(
3572
3661
  "input",
3573
3662
  {
3574
3663
  type: "number",
3575
- value: e.retryDelay || 1e3,
3576
- onChange: (n) => i({ ...e, retryDelay: parseInt(n.target.value, 10) }, a)
3664
+ value: r.retryDelay || 1e3,
3665
+ onChange: (n) => i({ ...r, retryDelay: parseInt(n.target.value, 10) }, a)
3577
3666
  }
3578
3667
  )
3579
3668
  ] })
3580
3669
  ] }),
3581
- /* @__PURE__ */ r("h4", { children: "Schedule" }),
3582
- /* @__PURE__ */ r("div", { className: "nice-integration-builder__field", children: /* @__PURE__ */ t("label", { children: [
3583
- /* @__PURE__ */ r(
3670
+ /* @__PURE__ */ e("h4", { children: "Schedule" }),
3671
+ /* @__PURE__ */ e("div", { className: "nice-integration-builder__field", children: /* @__PURE__ */ t("label", { children: [
3672
+ /* @__PURE__ */ e(
3584
3673
  "input",
3585
3674
  {
3586
3675
  type: "checkbox",
3587
3676
  checked: (a == null ? void 0 : a.enabled) || !1,
3588
- onChange: (n) => i(e, { ...a, enabled: n.target.checked })
3677
+ onChange: (n) => i(r, { ...a, enabled: n.target.checked })
3589
3678
  }
3590
3679
  ),
3591
3680
  "Enable scheduled execution"
3592
3681
  ] }) }),
3593
3682
  (a == null ? void 0 : a.enabled) && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3594
- /* @__PURE__ */ r("label", { children: "Cron Expression" }),
3595
- /* @__PURE__ */ r(
3683
+ /* @__PURE__ */ e("label", { children: "Cron Expression" }),
3684
+ /* @__PURE__ */ e(
3596
3685
  "input",
3597
3686
  {
3598
3687
  type: "text",
3599
3688
  value: a.cron || "",
3600
- onChange: (n) => i(e, { ...a, cron: n.target.value }),
3689
+ onChange: (n) => i(r, { ...a, cron: n.target.value }),
3601
3690
  placeholder: "0 0 * * *"
3602
3691
  }
3603
3692
  )
3604
3693
  ] })
3605
3694
  ] });
3606
3695
  }
3607
- const br = [
3696
+ const hr = [
3608
3697
  {
3609
3698
  target: ".nice-webhook-tester",
3610
3699
  titleKey: "tutorial.webhookTester.intro.title",
@@ -3614,126 +3703,126 @@ const br = [
3614
3703
  placement: "auto"
3615
3704
  }
3616
3705
  ];
3617
- function fe(e) {
3618
- return e ? Object.entries(e).map(([a, i]) => ({ key: a, value: i })) : [];
3706
+ function me(r) {
3707
+ return r ? Object.entries(r).map(([a, i]) => ({ key: a, value: i })) : [];
3619
3708
  }
3620
- function pe(e) {
3709
+ function ye(r) {
3621
3710
  const a = {};
3622
- for (const i of e)
3711
+ for (const i of r)
3623
3712
  i.key.trim() !== "" && (a[i.key] = i.value);
3624
3713
  return a;
3625
3714
  }
3626
- async function hr(e, a) {
3627
- var f;
3628
- const i = (f = globalThis.crypto) == null ? void 0 : f.subtle;
3715
+ async function gr(r, a) {
3716
+ var l;
3717
+ const i = (l = globalThis.crypto) == null ? void 0 : l.subtle;
3629
3718
  if (!i)
3630
3719
  throw new Error("Web Crypto (crypto.subtle) is unavailable in this environment");
3631
- const n = new TextEncoder(), s = await i.importKey(
3720
+ const n = new TextEncoder(), c = await i.importKey(
3632
3721
  "raw",
3633
- n.encode(e),
3722
+ n.encode(r),
3634
3723
  { name: "HMAC", hash: "SHA-256" },
3635
3724
  !1,
3636
3725
  ["sign"]
3637
- ), u = await i.sign("HMAC", s, n.encode(a));
3726
+ ), u = await i.sign("HMAC", c, n.encode(a));
3638
3727
  return [...new Uint8Array(u)].map((y) => y.toString(16).padStart(2, "0")).join("");
3639
3728
  }
3640
- const xr = ke(
3729
+ const Sr = ue(
3641
3730
  function(a, i) {
3642
3731
  const {
3643
3732
  url: n = "",
3644
- method: s = "POST",
3733
+ method: c = "POST",
3645
3734
  headers: u,
3646
- payload: f = "",
3735
+ payload: l = "",
3647
3736
  samples: y = [],
3648
3737
  onSend: b,
3649
3738
  signing: d,
3650
- onSaveSample: v,
3651
- tutorial: k,
3739
+ onSaveSample: h,
3740
+ tutorial: S,
3652
3741
  className: m,
3653
- style: T,
3654
- id: _,
3655
- "data-testid": I
3656
- } = a, [H, K] = g(n), [j, G] = g(s), [$, U] = g(() => fe(u)), [O, q] = g(f), [w, x] = g(""), [S, B] = g(!1), [V, z] = g(null), [L, X] = g(null), F = Te(() => {
3742
+ style: k,
3743
+ id: g,
3744
+ "data-testid": P
3745
+ } = a, [C, O] = v(n), [U, W] = v(c), [$, L] = v(() => me(u)), [I, j] = v(l), [w, N] = v(""), [x, K] = v(!1), [q, B] = v(null), [M, J] = v(null), V = Ee(() => {
3657
3746
  const o = /* @__PURE__ */ new Map();
3658
- for (const N of y)
3659
- o.set(N.id, N);
3747
+ for (const _ of y)
3748
+ o.set(_.id, _);
3660
3749
  return o;
3661
- }, [y]), Q = (o) => {
3662
- x(o);
3663
- const N = F.get(o);
3664
- N && (q(N.payload), N.headers && U(fe(N.headers)));
3665
- }, Y = (o, N) => {
3666
- U((D) => D.map((E, R) => R === o ? { ...E, ...N } : E));
3667
- }, p = async () => {
3668
- B(!0), z(null), X(null);
3750
+ }, [y]), Y = (o) => {
3751
+ N(o);
3752
+ const _ = V.get(o);
3753
+ _ && (j(_.payload), _.headers && L(me(_.headers)));
3754
+ }, G = (o, _) => {
3755
+ L((E) => E.map((H, A) => A === o ? { ...H, ..._ } : H));
3756
+ }, Q = async () => {
3757
+ K(!0), B(null), J(null);
3669
3758
  try {
3670
- const o = pe($);
3759
+ const o = ye($);
3671
3760
  if (d && d.secret) {
3672
- const R = await hr(d.secret, O);
3673
- o[d.header] = `${d.prefix ?? ""}${R}`;
3761
+ const A = await gr(d.secret, I);
3762
+ o[d.header] = `${d.prefix ?? ""}${A}`;
3674
3763
  }
3675
- const N = typeof performance < "u" ? performance.now() : Date.now(), D = await b({ url: H, method: j ?? "POST", headers: o, body: O }), E = Math.round(
3676
- (typeof performance < "u" ? performance.now() : Date.now()) - N
3764
+ const _ = typeof performance < "u" ? performance.now() : Date.now(), E = await b({ url: C, method: U ?? "POST", headers: o, body: I }), H = Math.round(
3765
+ (typeof performance < "u" ? performance.now() : Date.now()) - _
3677
3766
  );
3678
- X({ ...D, durationMs: D.durationMs ?? E });
3767
+ J({ ...E, durationMs: E.durationMs ?? H });
3679
3768
  } catch (o) {
3680
- z(o instanceof Error ? o.message : String(o));
3769
+ B(o instanceof Error ? o.message : String(o));
3681
3770
  } finally {
3682
- B(!1);
3771
+ K(!1);
3683
3772
  }
3684
- }, h = () => {
3685
- var N;
3686
- if (!v)
3773
+ }, Z = () => {
3774
+ var _;
3775
+ if (!h)
3687
3776
  return;
3688
- const o = typeof window < "u" && ((N = window.prompt) == null ? void 0 : N.call(window, "Sample name")) || "";
3689
- o && v({
3777
+ const o = typeof window < "u" && ((_ = window.prompt) == null ? void 0 : _.call(window, "Sample name")) || "";
3778
+ o && h({
3690
3779
  id: `sample_${Date.now().toString(36)}`,
3691
3780
  name: o,
3692
- payload: O,
3693
- headers: pe($)
3781
+ payload: I,
3782
+ headers: ye($)
3694
3783
  });
3695
- }, C = L == null ? "" : L.status >= 200 && L.status < 300 ? " nice-webhook-tester__status--ok" : " nice-webhook-tester__status--error", c = "nice-webhook-tester" + (m ? ` ${m}` : "");
3696
- return /* @__PURE__ */ t("div", { ref: i, id: _, className: c, style: T, "data-testid": I, children: [
3697
- k && /* @__PURE__ */ r("div", { className: "nice-webhook-tester__tutorial", children: /* @__PURE__ */ r(re, { steps: ee(k, br) }) }),
3784
+ }, p = M == null ? "" : M.status >= 200 && M.status < 300 ? " nice-webhook-tester__status--ok" : " nice-webhook-tester__status--error", s = "nice-webhook-tester" + (m ? ` ${m}` : "");
3785
+ return /* @__PURE__ */ t("div", { ref: i, id: g, className: s, style: k, "data-testid": P, children: [
3786
+ S && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__tutorial", children: /* @__PURE__ */ e(ie, { steps: ae(S, hr) }) }),
3698
3787
  /* @__PURE__ */ t("div", { className: "nice-webhook-tester__bar", children: [
3699
- /* @__PURE__ */ r(
3788
+ /* @__PURE__ */ e(
3700
3789
  "select",
3701
3790
  {
3702
3791
  className: "nice-webhook-tester__method",
3703
- value: j,
3704
- onChange: (o) => G(o.target.value),
3792
+ value: U,
3793
+ onChange: (o) => W(o.target.value),
3705
3794
  "aria-label": "Method",
3706
- children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((o) => /* @__PURE__ */ r("option", { value: o, children: o }, o))
3795
+ children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((o) => /* @__PURE__ */ e("option", { value: o, children: o }, o))
3707
3796
  }
3708
3797
  ),
3709
- /* @__PURE__ */ r(
3798
+ /* @__PURE__ */ e(
3710
3799
  "input",
3711
3800
  {
3712
3801
  type: "text",
3713
3802
  className: "nice-webhook-tester__url",
3714
- value: H,
3803
+ value: C,
3715
3804
  placeholder: "https://example.com/api/payments/stripe/webhook",
3716
- onChange: (o) => K(o.target.value),
3805
+ onChange: (o) => O(o.target.value),
3717
3806
  "aria-label": "URL"
3718
3807
  }
3719
3808
  ),
3720
- /* @__PURE__ */ r(
3809
+ /* @__PURE__ */ e(
3721
3810
  "button",
3722
3811
  {
3723
3812
  type: "button",
3724
3813
  className: "nice-webhook-tester__send",
3725
- onClick: () => void p(),
3726
- disabled: S || H.trim() === "",
3727
- children: S ? "Sending…" : "Send"
3814
+ onClick: () => void Q(),
3815
+ disabled: x || C.trim() === "",
3816
+ children: x ? "Sending…" : "Send"
3728
3817
  }
3729
3818
  )
3730
3819
  ] }),
3731
- y.length > 0 && /* @__PURE__ */ r("div", { className: "nice-webhook-tester__samples", children: /* @__PURE__ */ t("label", { children: [
3820
+ y.length > 0 && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__samples", children: /* @__PURE__ */ t("label", { children: [
3732
3821
  "Sample:",
3733
3822
  " ",
3734
- /* @__PURE__ */ t("select", { value: w, onChange: (o) => Q(o.target.value), children: [
3735
- /* @__PURE__ */ r("option", { value: "", children: "— choose a saved payload —" }),
3736
- y.map((o) => /* @__PURE__ */ r("option", { value: o.id, children: o.name }, o.id))
3823
+ /* @__PURE__ */ t("select", { value: w, onChange: (o) => Y(o.target.value), children: [
3824
+ /* @__PURE__ */ e("option", { value: "", children: "— choose a saved payload —" }),
3825
+ y.map((o) => /* @__PURE__ */ e("option", { value: o.id, children: o.name }, o.id))
3737
3826
  ] })
3738
3827
  ] }) }),
3739
3828
  /* @__PURE__ */ t("div", { className: "nice-webhook-tester__headers", children: [
@@ -3742,46 +3831,46 @@ const xr = ke(
3742
3831
  d && /* @__PURE__ */ t("span", { className: "nice-webhook-tester__signed", children: [
3743
3832
  " ",
3744
3833
  "· auto-signs ",
3745
- /* @__PURE__ */ r("code", { children: d.header })
3834
+ /* @__PURE__ */ e("code", { children: d.header })
3746
3835
  ] })
3747
3836
  ] }),
3748
- $.map((o, N) => /* @__PURE__ */ t("div", { className: "nice-webhook-tester__header-row", children: [
3749
- /* @__PURE__ */ r(
3837
+ $.map((o, _) => /* @__PURE__ */ t("div", { className: "nice-webhook-tester__header-row", children: [
3838
+ /* @__PURE__ */ e(
3750
3839
  "input",
3751
3840
  {
3752
3841
  type: "text",
3753
3842
  value: o.key,
3754
3843
  placeholder: "Header",
3755
- onChange: (D) => Y(N, { key: D.target.value }),
3844
+ onChange: (E) => G(_, { key: E.target.value }),
3756
3845
  "aria-label": "Header name"
3757
3846
  }
3758
3847
  ),
3759
- /* @__PURE__ */ r(
3848
+ /* @__PURE__ */ e(
3760
3849
  "input",
3761
3850
  {
3762
3851
  type: "text",
3763
3852
  value: o.value,
3764
3853
  placeholder: "Value",
3765
- onChange: (D) => Y(N, { value: D.target.value }),
3854
+ onChange: (E) => G(_, { value: E.target.value }),
3766
3855
  "aria-label": "Header value"
3767
3856
  }
3768
3857
  ),
3769
- /* @__PURE__ */ r(
3858
+ /* @__PURE__ */ e(
3770
3859
  "button",
3771
3860
  {
3772
3861
  type: "button",
3773
- onClick: () => U((D) => D.filter((E, R) => R !== N)),
3862
+ onClick: () => L((E) => E.filter((H, A) => A !== _)),
3774
3863
  "aria-label": "Remove header",
3775
3864
  children: "✕"
3776
3865
  }
3777
3866
  )
3778
- ] }, N)),
3779
- /* @__PURE__ */ r(
3867
+ ] }, _)),
3868
+ /* @__PURE__ */ e(
3780
3869
  "button",
3781
3870
  {
3782
3871
  type: "button",
3783
3872
  className: "nice-webhook-tester__add-header",
3784
- onClick: () => U((o) => [...o, { key: "", value: "" }]),
3873
+ onClick: () => L((o) => [...o, { key: "", value: "" }]),
3785
3874
  children: "+ Header"
3786
3875
  }
3787
3876
  )
@@ -3789,41 +3878,41 @@ const xr = ke(
3789
3878
  /* @__PURE__ */ t("div", { className: "nice-webhook-tester__payload", children: [
3790
3879
  /* @__PURE__ */ t("div", { className: "nice-webhook-tester__section-label", children: [
3791
3880
  "Payload",
3792
- v && /* @__PURE__ */ r("button", { type: "button", className: "nice-webhook-tester__save", onClick: h, children: "Save as sample" })
3881
+ h && /* @__PURE__ */ e("button", { type: "button", className: "nice-webhook-tester__save", onClick: Z, children: "Save as sample" })
3793
3882
  ] }),
3794
- /* @__PURE__ */ r(
3883
+ /* @__PURE__ */ e(
3795
3884
  "textarea",
3796
3885
  {
3797
3886
  className: "nice-webhook-tester__textarea",
3798
- value: O,
3887
+ value: I,
3799
3888
  spellCheck: !1,
3800
3889
  rows: 8,
3801
3890
  placeholder: '{ "type": "payment.succeeded", "data": { ... } }',
3802
- onChange: (o) => q(o.target.value),
3891
+ onChange: (o) => j(o.target.value),
3803
3892
  "aria-label": "Payload"
3804
3893
  }
3805
3894
  )
3806
3895
  ] }),
3807
- V && /* @__PURE__ */ r("div", { className: "nice-webhook-tester__error", children: V }),
3808
- L && /* @__PURE__ */ t("div", { className: "nice-webhook-tester__response", children: [
3896
+ q && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__error", children: q }),
3897
+ M && /* @__PURE__ */ t("div", { className: "nice-webhook-tester__response", children: [
3809
3898
  /* @__PURE__ */ t("div", { className: "nice-webhook-tester__section-label", children: [
3810
3899
  "Response",
3811
3900
  " ",
3812
- /* @__PURE__ */ r("span", { className: "nice-webhook-tester__status" + C, children: L.status }),
3813
- L.durationMs != null && /* @__PURE__ */ t("span", { className: "nice-webhook-tester__time", children: [
3901
+ /* @__PURE__ */ e("span", { className: "nice-webhook-tester__status" + p, children: M.status }),
3902
+ M.durationMs != null && /* @__PURE__ */ t("span", { className: "nice-webhook-tester__time", children: [
3814
3903
  " · ",
3815
- L.durationMs,
3904
+ M.durationMs,
3816
3905
  " ms"
3817
3906
  ] })
3818
3907
  ] }),
3819
- L.body != null && /* @__PURE__ */ r("pre", { className: "nice-webhook-tester__response-body", children: L.body })
3908
+ M.body != null && /* @__PURE__ */ e("pre", { className: "nice-webhook-tester__response-body", children: M.body })
3820
3909
  ] })
3821
3910
  ] });
3822
3911
  }
3823
3912
  );
3824
3913
  export {
3825
- _r as NiceAPIDesigner,
3826
- wr as NiceAPITester,
3827
- Nr as NiceIntegrationBuilder,
3828
- xr as NiceWebhookTester
3914
+ wr as NiceAPIDesigner,
3915
+ Nr as NiceAPITester,
3916
+ xr as NiceIntegrationBuilder,
3917
+ Sr as NiceWebhookTester
3829
3918
  };