@nice2dev/ui-api 1.0.21 → 1.0.22

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,6 +1,1773 @@
1
- import { jsxs as t, jsx as e, Fragment as R } from "react/jsx-runtime";
2
- import { useState as w, useCallback as T, useRef as Z, useEffect as se } from "react";
3
- const ce = {
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, Ae = M(Ee);
4
+ function Re() {
5
+ return { t: me(Ae) };
6
+ }
7
+ M({
8
+ dir: "ltr",
9
+ isRTL: !1,
10
+ flip: (e) => e,
11
+ value: (e) => e.ltr
12
+ });
13
+ M(null);
14
+ M(null);
15
+ const Pe = {
16
+ radius: "md",
17
+ shadow: "md",
18
+ fill: "solid",
19
+ buttonStyle: "flat",
20
+ inputStyle: "bordered",
21
+ cardStyle: "elevated",
22
+ badgeStyle: "solid",
23
+ tabStyle: "underline",
24
+ toggleStyle: "default",
25
+ tooltipStyle: "dark",
26
+ modalStyle: "default",
27
+ tableStyle: "default",
28
+ menuStyle: "default",
29
+ animation: "normal",
30
+ density: "normal"
31
+ };
32
+ M({
33
+ displayStyle: "default",
34
+ variantConfig: Pe,
35
+ setDisplayStyle: () => {
36
+ }
37
+ });
38
+ M({});
39
+ M({
40
+ direction: "ltr",
41
+ isRTL: !1,
42
+ flip: (e) => e,
43
+ flipStyle: (e, a) => ({ [e]: a })
44
+ });
45
+ M({
46
+ permissions: {},
47
+ getAccessMode: () => "full"
48
+ });
49
+ M(null);
50
+ const De = process.env.NODE_ENV === "development";
51
+ let ue = {
52
+ enabled: De,
53
+ slowRenderThreshold: 16
54
+ };
55
+ const be = [], ce = /* @__PURE__ */ new Map(), he = /* @__PURE__ */ new Map();
56
+ 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);
62
+ }
63
+ function W(e) {
64
+ return e < 1 ? `${(e * 1e3).toFixed(0)}μs` : e < 1e3 ? `${e.toFixed(2)}ms` : `${(e / 1e3).toFixed(2)}s`;
65
+ }
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 };
69
+ }
70
+ function Me() {
71
+ const e = Oe();
72
+ console.group(
73
+ "%c[Nice2Dev Performance Report]",
74
+ "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) => ({
77
+ Name: a.componentName,
78
+ Renders: a.renderCount,
79
+ "Avg Time": W(a.avgRenderTime),
80
+ "Max Time": W(a.maxRenderTime),
81
+ "Total Time": W(a.totalRenderTime),
82
+ "Slow Renders": a.slowRenderCount
83
+ }))
84
+ ), console.groupEnd(), e.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
85
+ e.slowRenders.slice(-10).map((a) => ({
86
+ Component: a.componentName,
87
+ Phase: a.phase,
88
+ Duration: W(a.actualDuration),
89
+ Time: new Date(a.timestamp).toLocaleTimeString()
90
+ }))
91
+ ), console.groupEnd()), e.marks.length > 0 && (console.group("Custom Marks"), console.table(
92
+ e.marks.filter((a) => a.duration).map((a) => ({
93
+ Name: a.name,
94
+ Duration: W(a.duration)
95
+ }))
96
+ ), console.groupEnd()), console.groupEnd();
97
+ }
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(() => {
102
+ const d = () => {
103
+ const k = Array.from(ce.values());
104
+ u(k.sort((T, _) => _.totalRenderTime - T.totalRenderTime).slice(0, 10));
105
+ const m = window.performance;
106
+ m.memory && y({
107
+ used: m.memory.usedJSHeapSize / 1024 / 1024,
108
+ total: m.memory.totalJSHeapSize / 1024 / 1024
109
+ });
110
+ };
111
+ d();
112
+ const v = setInterval(d, 2e3);
113
+ return () => clearInterval(v);
114
+ }, []), !ue.enabled)
115
+ return null;
116
+ const b = {
117
+ position: "fixed",
118
+ zIndex: 99999,
119
+ ...e.includes("top") ? { top: 8 } : { bottom: 8 },
120
+ ...e.includes("left") ? { left: 8 } : { right: 8 }
121
+ };
122
+ return /* @__PURE__ */ t(
123
+ "div",
124
+ {
125
+ style: {
126
+ ...b,
127
+ background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
128
+ color: "var(--bg-primary, #fff)",
129
+ borderRadius: 8,
130
+ fontSize: 11,
131
+ fontFamily: "Monaco, Consolas, monospace",
132
+ padding: i ? "4px 8px" : 8,
133
+ maxWidth: i ? "auto" : 300,
134
+ maxHeight: i ? "auto" : 400,
135
+ overflow: "auto"
136
+ },
137
+ children: [
138
+ /* @__PURE__ */ t(
139
+ "div",
140
+ {
141
+ style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
142
+ onClick: () => n((d) => !d),
143
+ children: [
144
+ /* @__PURE__ */ r("span", { style: { color: "var(--color-success, #22c55e)" }, children: "●" }),
145
+ /* @__PURE__ */ r("span", { children: "Profiler" }),
146
+ f.used > 0 && /* @__PURE__ */ t(
147
+ "span",
148
+ {
149
+ style: {
150
+ color: f.used > 100 ? "var(--color-warning, #f59e0b)" : "var(--text-muted, #64748b)"
151
+ },
152
+ children: [
153
+ f.used.toFixed(0),
154
+ "MB"
155
+ ]
156
+ }
157
+ ),
158
+ /* @__PURE__ */ r("span", { style: { marginLeft: "auto", opacity: 0.5 }, children: i ? "▼" : "▲" })
159
+ ]
160
+ }
161
+ ),
162
+ !i && /* @__PURE__ */ t("div", { style: { marginTop: 8 }, children: [
163
+ /* @__PURE__ */ r(
164
+ "div",
165
+ {
166
+ style: {
167
+ borderBottom: "1px solid var(--border-color, #333)",
168
+ paddingBottom: 4,
169
+ marginBottom: 8
170
+ },
171
+ children: /* @__PURE__ */ r("strong", { children: "Top Components" })
172
+ }
173
+ ),
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(
177
+ "span",
178
+ {
179
+ style: {
180
+ color: d.avgRenderTime > 16 ? "var(--color-warning, #f59e0b)" : "var(--color-success, #22c55e)"
181
+ },
182
+ children: W(d.avgRenderTime)
183
+ }
184
+ ),
185
+ /* @__PURE__ */ t(
186
+ "span",
187
+ {
188
+ style: { color: "var(--text-muted, #64748b)", minWidth: 30, textAlign: "right" },
189
+ children: [
190
+ "x",
191
+ d.renderCount
192
+ ]
193
+ }
194
+ )
195
+ ] }, d.componentName)),
196
+ /* @__PURE__ */ t("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
197
+ /* @__PURE__ */ r(
198
+ "button",
199
+ {
200
+ onClick: Me,
201
+ style: {
202
+ flex: 1,
203
+ padding: "4px 8px",
204
+ background: "var(--bg-tertiary, #333)",
205
+ border: "none",
206
+ borderRadius: 4,
207
+ color: "var(--bg-primary, #fff)",
208
+ cursor: "pointer",
209
+ fontSize: 10
210
+ },
211
+ children: "Print Report"
212
+ }
213
+ ),
214
+ /* @__PURE__ */ r(
215
+ "button",
216
+ {
217
+ onClick: Ie,
218
+ style: {
219
+ flex: 1,
220
+ padding: "4px 8px",
221
+ background: "var(--bg-tertiary, #333)",
222
+ border: "none",
223
+ borderRadius: 4,
224
+ color: "var(--bg-primary, #fff)",
225
+ cursor: "pointer",
226
+ fontSize: 10
227
+ },
228
+ children: "Clear"
229
+ }
230
+ )
231
+ ] })
232
+ ] })
233
+ ]
234
+ }
235
+ );
236
+ }
237
+ );
238
+ Le.displayName = "ProfilerOverlay";
239
+ process.env.NODE_ENV;
240
+ M(null);
241
+ const Ue = M({
242
+ enabled: !0,
243
+ active: !1,
244
+ run: () => {
245
+ }
246
+ });
247
+ function je() {
248
+ return me(Ue);
249
+ }
250
+ function ee(e, a) {
251
+ if (!e)
252
+ return null;
253
+ if (e === !0)
254
+ 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;
258
+ return i && i.length > 0 ? i : null;
259
+ }
260
+ function Ke(e, a) {
261
+ return e.map((i) => ({
262
+ target: i.target,
263
+ title: i.titleKey ? a(i.titleKey, i.title ?? "") : i.title ?? "",
264
+ content: i.contentKey ? a(i.contentKey, i.content ?? "") : i.content ?? "",
265
+ placement: i.placement,
266
+ highlightPadding: i.highlightPadding,
267
+ showArrow: i.showArrow,
268
+ scrollIntoView: i.scrollIntoView,
269
+ disableInteraction: i.disableInteraction
270
+ }));
271
+ }
272
+ const re = ({
273
+ steps: e,
274
+ autoStart: a,
275
+ label: i,
276
+ size: n = "md",
277
+ className: s,
278
+ style: u,
279
+ "data-testid": f
280
+ }) => {
281
+ const { enabled: y, run: b } = je(), { t: d } = Re();
282
+ if (!y || !e || e.length === 0)
283
+ return null;
284
+ const v = i ?? d("tutorial.startAria", "Start tutorial");
285
+ return /* @__PURE__ */ r(
286
+ "button",
287
+ {
288
+ type: "button",
289
+ className: `nice-tutorial-button nice-tutorial-button--${n}` + (s ? ` ${s}` : ""),
290
+ style: u,
291
+ "data-testid": f,
292
+ "aria-label": v,
293
+ title: v,
294
+ onClick: () => b(Ke(e, d), { autoStart: a }),
295
+ children: "?"
296
+ }
297
+ );
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 = `
302
+ .nice-tutorial-button {
303
+ display: inline-flex;
304
+ align-items: center;
305
+ justify-content: center;
306
+ border: 1px solid var(--nice-border, #cbd5e1);
307
+ background: var(--nice-bg, #fff);
308
+ color: var(--nice-text-secondary, #475569);
309
+ border-radius: var(--nice-radius-full, 9999px);
310
+ cursor: help;
311
+ font-weight: 700;
312
+ line-height: 1;
313
+ padding: 0;
314
+ transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
315
+ }
316
+ .nice-tutorial-button:hover {
317
+ background: var(--nice-primary, #2563eb);
318
+ border-color: var(--nice-primary, #2563eb);
319
+ color: var(--nice-text-inverse, #fff);
320
+ }
321
+ .nice-tutorial-button:focus-visible {
322
+ outline: none;
323
+ box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
324
+ }
325
+ .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
326
+ .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
327
+ `, document.head.appendChild(e);
328
+ }
329
+ M(null);
330
+ M(null);
331
+ M(null);
332
+ const ge = {
333
+ space1: "4px",
334
+ space2: "8px",
335
+ space3: "12px",
336
+ space4: "16px",
337
+ space5: "20px",
338
+ space6: "24px",
339
+ space8: "32px"
340
+ }, ve = {
341
+ fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
342
+ fontSizeXs: "0.75rem",
343
+ fontSizeSm: "0.8125rem",
344
+ fontSizeMd: "0.875rem",
345
+ fontSizeLg: "1rem",
346
+ fontSizeXl: "1.125rem",
347
+ fontWeightNormal: 400,
348
+ fontWeightMedium: 500,
349
+ fontWeightSemibold: 600,
350
+ fontWeightBold: 700,
351
+ lineHeight: 1.5
352
+ }, _e = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, we = (e) => ({
353
+ color: e,
354
+ radiusSm: "4px",
355
+ radiusMd: "6px",
356
+ radiusLg: "8px",
357
+ radiusXl: "12px",
358
+ radiusFull: "9999px"
359
+ }), qe = {
360
+ sm: "0 1px 2px rgba(0,0,0,0.05)",
361
+ md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
362
+ lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
363
+ xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
364
+ }, Be = {
365
+ sm: "0 1px 2px rgba(0,0,0,0.3)",
366
+ md: "0 4px 6px -1px rgba(0,0,0,0.4)",
367
+ lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
368
+ xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
369
+ };
370
+ function l(e, a, i, n, s) {
371
+ return {
372
+ name: e,
373
+ darkMode: "light",
374
+ colors: {
375
+ ...a,
376
+ surface: a.surface ?? i.primary,
377
+ surfaceHover: a.surfaceHover ?? i.secondary
378
+ },
379
+ backgrounds: {
380
+ ...i,
381
+ elevated: i.elevated ?? i.primary,
382
+ inset: i.inset ?? i.tertiary,
383
+ canvas: i.canvas ?? i.primary
384
+ },
385
+ text: { ...n, inverse: n.inverse ?? "#ffffff" },
386
+ borders: we(s),
387
+ shadows: qe,
388
+ spacing: ge,
389
+ typography: ve,
390
+ transitions: _e
391
+ };
392
+ }
393
+ function R(e, a, i, n, s) {
394
+ return {
395
+ name: e,
396
+ darkMode: "dark",
397
+ colors: {
398
+ ...a,
399
+ surface: a.surface ?? i.secondary,
400
+ surfaceHover: a.surfaceHover ?? i.tertiary
401
+ },
402
+ backgrounds: {
403
+ ...i,
404
+ elevated: i.elevated ?? i.secondary,
405
+ inset: i.inset ?? i.primary,
406
+ canvas: i.canvas ?? i.primary
407
+ },
408
+ text: { ...n, inverse: n.inverse ?? "#0f172a" },
409
+ borders: we(s),
410
+ shadows: Be,
411
+ spacing: ge,
412
+ typography: ve,
413
+ transitions: _e
414
+ };
415
+ }
416
+ l(
417
+ "Slate",
418
+ {
419
+ primary: "#64748b",
420
+ primaryHover: "#475569",
421
+ success: "#10b981",
422
+ warning: "#f59e0b",
423
+ error: "#ef4444",
424
+ info: "#06b6d4"
425
+ },
426
+ { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
427
+ { primary: "#1e293b", secondary: "#475569", muted: "#94a3b8" },
428
+ "#cbd5e1"
429
+ );
430
+ l(
431
+ "Zinc",
432
+ {
433
+ primary: "#71717a",
434
+ primaryHover: "#52525b",
435
+ success: "#22c55e",
436
+ warning: "#eab308",
437
+ error: "#ef4444",
438
+ info: "#06b6d4"
439
+ },
440
+ { primary: "#fafafa", secondary: "#f4f4f5", tertiary: "#e4e4e7", hover: "#e4e4e7" },
441
+ { primary: "#18181b", secondary: "#3f3f46", muted: "#a1a1aa" },
442
+ "#d4d4d8"
443
+ );
444
+ l(
445
+ "Stone",
446
+ {
447
+ primary: "#78716c",
448
+ primaryHover: "#57534e",
449
+ success: "#16a34a",
450
+ warning: "#ca8a04",
451
+ error: "#dc2626",
452
+ info: "#0891b2"
453
+ },
454
+ { primary: "#fafaf9", secondary: "#f5f5f4", tertiary: "#e7e5e4", hover: "#e7e5e4" },
455
+ { primary: "#1c1917", secondary: "#44403c", muted: "#a8a29e" },
456
+ "#d6d3d1"
457
+ );
458
+ l(
459
+ "Cool Gray",
460
+ {
461
+ primary: "#6b7280",
462
+ primaryHover: "#4b5563",
463
+ success: "#10b981",
464
+ warning: "#f59e0b",
465
+ error: "#ef4444",
466
+ info: "#3b82f6"
467
+ },
468
+ { primary: "#f9fafb", secondary: "#f3f4f6", tertiary: "#e5e7eb", hover: "#e5e7eb" },
469
+ { primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
470
+ "#d1d5db"
471
+ );
472
+ l(
473
+ "Warm Gray",
474
+ {
475
+ primary: "#7c7568",
476
+ primaryHover: "#5c564c",
477
+ success: "#4d7c0f",
478
+ warning: "#a16207",
479
+ error: "#b91c1c",
480
+ info: "#0e7490"
481
+ },
482
+ { primary: "#faf9f7", secondary: "#f5f4f0", tertiary: "#e8e6e1", hover: "#e8e6e1" },
483
+ { primary: "#1f1d19", secondary: "#4a463d", muted: "#a09888" },
484
+ "#d4d0c8"
485
+ );
486
+ l(
487
+ "Silver",
488
+ {
489
+ primary: "#94a3b8",
490
+ primaryHover: "#64748b",
491
+ success: "#10b981",
492
+ warning: "#f59e0b",
493
+ error: "#ef4444",
494
+ info: "#38bdf8"
495
+ },
496
+ { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
497
+ { primary: "#334155", secondary: "#64748b", muted: "#94a3b8" },
498
+ "#cbd5e1"
499
+ );
500
+ l(
501
+ "Charcoal",
502
+ {
503
+ primary: "#374151",
504
+ primaryHover: "#1f2937",
505
+ success: "#059669",
506
+ warning: "#d97706",
507
+ error: "#dc2626",
508
+ info: "#0284c7"
509
+ },
510
+ { primary: "#f9fafb", secondary: "#f3f4f6", tertiary: "#e5e7eb", hover: "#e5e7eb" },
511
+ { primary: "#111827", secondary: "#374151", muted: "#6b7280" },
512
+ "#d1d5db"
513
+ );
514
+ l(
515
+ "Ivory",
516
+ {
517
+ primary: "#92876d",
518
+ primaryHover: "#7a6f55",
519
+ success: "#4d7c0f",
520
+ warning: "#a16207",
521
+ error: "#b91c1c",
522
+ info: "#0e7490"
523
+ },
524
+ { primary: "#fffef7", secondary: "#faf6eb", tertiary: "#f0ead6", hover: "#f0ead6" },
525
+ { primary: "#2b2517", secondary: "#5c5340", muted: "#9c9280" },
526
+ "#ddd8c4"
527
+ );
528
+ l(
529
+ "Rose",
530
+ {
531
+ primary: "#e11d48",
532
+ primaryHover: "#be123c",
533
+ success: "#16a34a",
534
+ warning: "#ea580c",
535
+ error: "#dc2626",
536
+ info: "#0891b2"
537
+ },
538
+ { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
539
+ { primary: "#4c0519", secondary: "#881337", muted: "#f43f5e" },
540
+ "#fda4af"
541
+ );
542
+ l(
543
+ "Emerald",
544
+ {
545
+ primary: "#059669",
546
+ primaryHover: "#047857",
547
+ success: "#16a34a",
548
+ warning: "#d97706",
549
+ error: "#dc2626",
550
+ info: "#0891b2"
551
+ },
552
+ { primary: "#ecfdf5", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
553
+ { primary: "#064e3b", secondary: "#065f46", muted: "#34d399" },
554
+ "#6ee7b7"
555
+ );
556
+ l(
557
+ "Amber",
558
+ {
559
+ primary: "#d97706",
560
+ primaryHover: "#b45309",
561
+ success: "#16a34a",
562
+ warning: "#ca8a04",
563
+ error: "#dc2626",
564
+ info: "#0284c7"
565
+ },
566
+ { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
567
+ { primary: "#451a03", secondary: "#78350f", muted: "#f59e0b" },
568
+ "#fcd34d"
569
+ );
570
+ l(
571
+ "Violet",
572
+ {
573
+ primary: "#7c3aed",
574
+ primaryHover: "#6d28d9",
575
+ success: "#10b981",
576
+ warning: "#f59e0b",
577
+ error: "#ef4444",
578
+ info: "#06b6d4"
579
+ },
580
+ { primary: "#f5f3ff", secondary: "#ede9fe", tertiary: "#ddd6fe", hover: "#ede9fe" },
581
+ { primary: "#2e1065", secondary: "#4c1d95", muted: "#a78bfa" },
582
+ "#c4b5fd"
583
+ );
584
+ l(
585
+ "Teal",
586
+ {
587
+ primary: "#0d9488",
588
+ primaryHover: "#0f766e",
589
+ success: "#16a34a",
590
+ warning: "#d97706",
591
+ error: "#dc2626",
592
+ info: "#0284c7"
593
+ },
594
+ { primary: "#f0fdfa", secondary: "#ccfbf1", tertiary: "#99f6e4", hover: "#ccfbf1" },
595
+ { primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
596
+ "#5eead4"
597
+ );
598
+ l(
599
+ "Indigo",
600
+ {
601
+ primary: "#4f46e5",
602
+ primaryHover: "#4338ca",
603
+ success: "#10b981",
604
+ warning: "#f59e0b",
605
+ error: "#ef4444",
606
+ info: "#06b6d4"
607
+ },
608
+ { primary: "#eef2ff", secondary: "#e0e7ff", tertiary: "#c7d2fe", hover: "#e0e7ff" },
609
+ { primary: "#1e1b4b", secondary: "#312e81", muted: "#818cf8" },
610
+ "#a5b4fc"
611
+ );
612
+ l(
613
+ "Cyan",
614
+ {
615
+ primary: "#0891b2",
616
+ primaryHover: "#0e7490",
617
+ success: "#10b981",
618
+ warning: "#f59e0b",
619
+ error: "#ef4444",
620
+ info: "#0284c7"
621
+ },
622
+ { primary: "#ecfeff", secondary: "#cffafe", tertiary: "#a5f3fc", hover: "#cffafe" },
623
+ { primary: "#164e63", secondary: "#155e75", muted: "#22d3ee" },
624
+ "#67e8f9"
625
+ );
626
+ l(
627
+ "Lime",
628
+ {
629
+ primary: "#65a30d",
630
+ primaryHover: "#4d7c0f",
631
+ success: "#16a34a",
632
+ warning: "#ca8a04",
633
+ error: "#dc2626",
634
+ info: "#0891b2"
635
+ },
636
+ { primary: "#f7fee7", secondary: "#ecfccb", tertiary: "#d9f99d", hover: "#ecfccb" },
637
+ { primary: "#1a2e05", secondary: "#365314", muted: "#84cc16" },
638
+ "#bef264"
639
+ );
640
+ l(
641
+ "Pink",
642
+ {
643
+ primary: "#db2777",
644
+ primaryHover: "#be185d",
645
+ success: "#10b981",
646
+ warning: "#f59e0b",
647
+ error: "#dc2626",
648
+ info: "#06b6d4"
649
+ },
650
+ { primary: "#fdf2f8", secondary: "#fce7f3", tertiary: "#fbcfe8", hover: "#fce7f3" },
651
+ { primary: "#500724", secondary: "#831843", muted: "#f472b6" },
652
+ "#f9a8d4"
653
+ );
654
+ l(
655
+ "Orange",
656
+ {
657
+ primary: "#ea580c",
658
+ primaryHover: "#c2410c",
659
+ success: "#16a34a",
660
+ warning: "#ca8a04",
661
+ error: "#dc2626",
662
+ info: "#0891b2"
663
+ },
664
+ { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
665
+ { primary: "#431407", secondary: "#7c2d12", muted: "#fb923c" },
666
+ "#fdba74"
667
+ );
668
+ l(
669
+ "Fuchsia",
670
+ {
671
+ primary: "#c026d3",
672
+ primaryHover: "#a21caf",
673
+ success: "#10b981",
674
+ warning: "#eab308",
675
+ error: "#ef4444",
676
+ info: "#06b6d4"
677
+ },
678
+ { primary: "#fdf4ff", secondary: "#fae8ff", tertiary: "#f5d0fe", hover: "#fae8ff" },
679
+ { primary: "#4a044e", secondary: "#701a75", muted: "#d946ef" },
680
+ "#e879f9"
681
+ );
682
+ l(
683
+ "Sky",
684
+ {
685
+ primary: "#0284c7",
686
+ primaryHover: "#0369a1",
687
+ success: "#10b981",
688
+ warning: "#f59e0b",
689
+ error: "#ef4444",
690
+ info: "#06b6d4"
691
+ },
692
+ { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
693
+ { primary: "#0c4a6e", secondary: "#075985", muted: "#38bdf8" },
694
+ "#7dd3fc"
695
+ );
696
+ l(
697
+ "Ruby",
698
+ {
699
+ primary: "#be123c",
700
+ primaryHover: "#9f1239",
701
+ success: "#059669",
702
+ warning: "#d97706",
703
+ error: "#dc2626",
704
+ info: "#0284c7"
705
+ },
706
+ { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
707
+ { primary: "#4c0519", secondary: "#881337", muted: "#fb7185" },
708
+ "#fda4af"
709
+ );
710
+ l(
711
+ "Coral",
712
+ {
713
+ primary: "#f97316",
714
+ primaryHover: "#ea580c",
715
+ success: "#10b981",
716
+ warning: "#eab308",
717
+ error: "#ef4444",
718
+ info: "#06b6d4"
719
+ },
720
+ { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
721
+ { primary: "#431407", secondary: "#9a3412", muted: "#fb923c" },
722
+ "#fdba74"
723
+ );
724
+ R(
725
+ "Midnight",
726
+ {
727
+ primary: "#818cf8",
728
+ primaryHover: "#6366f1",
729
+ success: "#34d399",
730
+ warning: "#fbbf24",
731
+ error: "#f87171",
732
+ info: "#22d3ee"
733
+ },
734
+ { primary: "#020617", secondary: "#0f172a", tertiary: "#1e293b", hover: "#1e293b" },
735
+ { primary: "#f1f5f9", secondary: "#94a3b8", muted: "#475569" },
736
+ "#1e293b"
737
+ );
738
+ R(
739
+ "Obsidian",
740
+ {
741
+ primary: "#a78bfa",
742
+ primaryHover: "#8b5cf6",
743
+ success: "#4ade80",
744
+ warning: "#facc15",
745
+ error: "#fb7185",
746
+ info: "#38bdf8"
747
+ },
748
+ { primary: "#09090b", secondary: "#18181b", tertiary: "#27272a", hover: "#27272a" },
749
+ { primary: "#fafafa", secondary: "#a1a1aa", muted: "#52525b" },
750
+ "#3f3f46"
751
+ );
752
+ R(
753
+ "Eclipse",
754
+ {
755
+ primary: "#c084fc",
756
+ primaryHover: "#a855f7",
757
+ success: "#34d399",
758
+ warning: "#fbbf24",
759
+ error: "#f87171",
760
+ info: "#67e8f9"
761
+ },
762
+ { primary: "#0c0a1d", secondary: "#1a1533", tertiary: "#2a2248", hover: "#2a2248" },
763
+ { primary: "#f5f3ff", secondary: "#a78bfa", muted: "#6d5eac" },
764
+ "#3b3266"
765
+ );
766
+ R(
767
+ "Onyx",
768
+ {
769
+ primary: "#60a5fa",
770
+ primaryHover: "#3b82f6",
771
+ success: "#4ade80",
772
+ warning: "#fbbf24",
773
+ error: "#f87171",
774
+ info: "#22d3ee"
775
+ },
776
+ { primary: "#000000", secondary: "#0a0a0a", tertiary: "#171717", hover: "#171717" },
777
+ { primary: "#ffffff", secondary: "#a3a3a3", muted: "#525252" },
778
+ "#262626"
779
+ );
780
+ R(
781
+ "Carbon",
782
+ {
783
+ primary: "#38bdf8",
784
+ primaryHover: "#0ea5e9",
785
+ success: "#4ade80",
786
+ warning: "#facc15",
787
+ error: "#f87171",
788
+ info: "#67e8f9"
789
+ },
790
+ { primary: "#161616", secondary: "#262626", tertiary: "#393939", hover: "#393939" },
791
+ { primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
792
+ "#525252"
793
+ );
794
+ R(
795
+ "Cosmos",
796
+ {
797
+ primary: "#6366f1",
798
+ primaryHover: "#4f46e5",
799
+ success: "#34d399",
800
+ warning: "#fbbf24",
801
+ error: "#f87171",
802
+ info: "#22d3ee"
803
+ },
804
+ { primary: "#030712", secondary: "#111827", tertiary: "#1f2937", hover: "#1f2937" },
805
+ { primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563" },
806
+ "#374151"
807
+ );
808
+ R(
809
+ "Nebula",
810
+ {
811
+ primary: "#e879f9",
812
+ primaryHover: "#d946ef",
813
+ success: "#4ade80",
814
+ warning: "#fbbf24",
815
+ error: "#fb7185",
816
+ info: "#67e8f9"
817
+ },
818
+ { primary: "#0d0117", secondary: "#1a0533", tertiary: "#2d0a52", hover: "#2d0a52" },
819
+ { primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
820
+ "#581c87"
821
+ );
822
+ R(
823
+ "Abyss",
824
+ {
825
+ primary: "#22d3ee",
826
+ primaryHover: "#06b6d4",
827
+ success: "#34d399",
828
+ warning: "#fbbf24",
829
+ error: "#f87171",
830
+ info: "#38bdf8"
831
+ },
832
+ { primary: "#001219", secondary: "#002a3a", tertiary: "#003e54", hover: "#003e54" },
833
+ { primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
834
+ "#075985"
835
+ );
836
+ R(
837
+ "Shadow",
838
+ {
839
+ primary: "#a3a3a3",
840
+ primaryHover: "#737373",
841
+ success: "#4ade80",
842
+ warning: "#facc15",
843
+ error: "#f87171",
844
+ info: "#38bdf8"
845
+ },
846
+ { primary: "#171717", secondary: "#1f1f1f", tertiary: "#2a2a2a", hover: "#2a2a2a" },
847
+ { primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
848
+ "#404040"
849
+ );
850
+ R(
851
+ "Emerald Dark",
852
+ {
853
+ primary: "#34d399",
854
+ primaryHover: "#10b981",
855
+ success: "#4ade80",
856
+ warning: "#fbbf24",
857
+ error: "#f87171",
858
+ info: "#22d3ee"
859
+ },
860
+ { primary: "#022c22", secondary: "#064e3b", tertiary: "#065f46", hover: "#065f46" },
861
+ { primary: "#ecfdf5", secondary: "#6ee7b7", muted: "#047857" },
862
+ "#047857"
863
+ );
864
+ l(
865
+ "Forest",
866
+ {
867
+ primary: "#166534",
868
+ primaryHover: "#14532d",
869
+ success: "#22c55e",
870
+ warning: "#ca8a04",
871
+ error: "#dc2626",
872
+ info: "#0891b2"
873
+ },
874
+ { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
875
+ { primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
876
+ "#86efac"
877
+ );
878
+ l(
879
+ "Ocean",
880
+ {
881
+ primary: "#0369a1",
882
+ primaryHover: "#075985",
883
+ success: "#059669",
884
+ warning: "#d97706",
885
+ error: "#dc2626",
886
+ info: "#0284c7"
887
+ },
888
+ { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
889
+ { primary: "#0c4a6e", secondary: "#0369a1", muted: "#38bdf8" },
890
+ "#7dd3fc"
891
+ );
892
+ l(
893
+ "Desert",
894
+ {
895
+ primary: "#b45309",
896
+ primaryHover: "#92400e",
897
+ success: "#4d7c0f",
898
+ warning: "#a16207",
899
+ error: "#b91c1c",
900
+ info: "#0e7490"
901
+ },
902
+ { primary: "#fefce8", secondary: "#fef9c3", tertiary: "#fef08a", hover: "#fef9c3" },
903
+ { primary: "#422006", secondary: "#713f12", muted: "#ca8a04" },
904
+ "#fde047"
905
+ );
906
+ l(
907
+ "Sunset",
908
+ {
909
+ primary: "#ea580c",
910
+ primaryHover: "#c2410c",
911
+ success: "#16a34a",
912
+ warning: "#d97706",
913
+ error: "#dc2626",
914
+ info: "#0891b2"
915
+ },
916
+ { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
917
+ { primary: "#431407", secondary: "#9a3412", muted: "#f97316" },
918
+ "#fdba74"
919
+ );
920
+ l(
921
+ "Aurora",
922
+ {
923
+ primary: "#0d9488",
924
+ primaryHover: "#0f766e",
925
+ success: "#22c55e",
926
+ warning: "#eab308",
927
+ error: "#ef4444",
928
+ info: "#06b6d4"
929
+ },
930
+ { primary: "#f0fdfa", secondary: "#ccfbf1", tertiary: "#99f6e4", hover: "#ccfbf1" },
931
+ { primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
932
+ "#5eead4"
933
+ );
934
+ l(
935
+ "Lavender",
936
+ {
937
+ primary: "#7e22ce",
938
+ primaryHover: "#6b21a8",
939
+ success: "#16a34a",
940
+ warning: "#d97706",
941
+ error: "#dc2626",
942
+ info: "#0891b2"
943
+ },
944
+ { primary: "#faf5ff", secondary: "#f3e8ff", tertiary: "#e9d5ff", hover: "#f3e8ff" },
945
+ { primary: "#3b0764", secondary: "#581c87", muted: "#a855f7" },
946
+ "#d8b4fe"
947
+ );
948
+ l(
949
+ "Autumn",
950
+ {
951
+ primary: "#c2410c",
952
+ primaryHover: "#9a3412",
953
+ success: "#4d7c0f",
954
+ warning: "#a16207",
955
+ error: "#b91c1c",
956
+ info: "#0e7490"
957
+ },
958
+ { primary: "#fef2f2", secondary: "#fee2e2", tertiary: "#fecaca", hover: "#fee2e2" },
959
+ { primary: "#450a0a", secondary: "#7f1d1d", muted: "#f87171" },
960
+ "#fca5a5"
961
+ );
962
+ l(
963
+ "Spring",
964
+ {
965
+ primary: "#16a34a",
966
+ primaryHover: "#15803d",
967
+ success: "#22c55e",
968
+ warning: "#eab308",
969
+ error: "#ef4444",
970
+ info: "#06b6d4"
971
+ },
972
+ { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
973
+ { primary: "#14532d", secondary: "#166534", muted: "#4ade80" },
974
+ "#86efac"
975
+ );
976
+ l(
977
+ "Arctic",
978
+ {
979
+ primary: "#0ea5e9",
980
+ primaryHover: "#0284c7",
981
+ success: "#10b981",
982
+ warning: "#f59e0b",
983
+ error: "#ef4444",
984
+ info: "#06b6d4"
985
+ },
986
+ { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
987
+ { primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
988
+ "#bae6fd"
989
+ );
990
+ l(
991
+ "Tropical",
992
+ {
993
+ primary: "#0d9488",
994
+ primaryHover: "#0f766e",
995
+ success: "#16a34a",
996
+ warning: "#f59e0b",
997
+ error: "#ef4444",
998
+ info: "#06b6d4"
999
+ },
1000
+ { primary: "#ecfdf5", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
1001
+ { primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
1002
+ "#a7f3d0"
1003
+ );
1004
+ l(
1005
+ "Pastel Rose",
1006
+ {
1007
+ primary: "#f472b6",
1008
+ primaryHover: "#ec4899",
1009
+ success: "#4ade80",
1010
+ warning: "#fcd34d",
1011
+ error: "#fb7185",
1012
+ info: "#67e8f9"
1013
+ },
1014
+ { primary: "#fdf2f8", secondary: "#fce7f3", tertiary: "#fbcfe8", hover: "#fce7f3" },
1015
+ { primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
1016
+ "#f9a8d4"
1017
+ );
1018
+ l(
1019
+ "Pastel Sky",
1020
+ {
1021
+ primary: "#38bdf8",
1022
+ primaryHover: "#0ea5e9",
1023
+ success: "#4ade80",
1024
+ warning: "#fcd34d",
1025
+ error: "#fb7185",
1026
+ info: "#67e8f9"
1027
+ },
1028
+ { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
1029
+ { primary: "#075985", secondary: "#0369a1", muted: "#7dd3fc" },
1030
+ "#bae6fd"
1031
+ );
1032
+ l(
1033
+ "Pastel Mint",
1034
+ {
1035
+ primary: "#34d399",
1036
+ primaryHover: "#10b981",
1037
+ success: "#4ade80",
1038
+ warning: "#fcd34d",
1039
+ error: "#fb7185",
1040
+ info: "#67e8f9"
1041
+ },
1042
+ { primary: "#ecfdf5", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
1043
+ { primary: "#065f46", secondary: "#047857", muted: "#6ee7b7" },
1044
+ "#a7f3d0"
1045
+ );
1046
+ l(
1047
+ "Pastel Peach",
1048
+ {
1049
+ primary: "#fb923c",
1050
+ primaryHover: "#f97316",
1051
+ success: "#4ade80",
1052
+ warning: "#fcd34d",
1053
+ error: "#fb7185",
1054
+ info: "#67e8f9"
1055
+ },
1056
+ { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
1057
+ { primary: "#7c2d12", secondary: "#9a3412", muted: "#fdba74" },
1058
+ "#fed7aa"
1059
+ );
1060
+ l(
1061
+ "Pastel Lavender",
1062
+ {
1063
+ primary: "#a78bfa",
1064
+ primaryHover: "#8b5cf6",
1065
+ success: "#4ade80",
1066
+ warning: "#fcd34d",
1067
+ error: "#fb7185",
1068
+ info: "#67e8f9"
1069
+ },
1070
+ { primary: "#f5f3ff", secondary: "#ede9fe", tertiary: "#ddd6fe", hover: "#ede9fe" },
1071
+ { primary: "#4c1d95", secondary: "#5b21b6", muted: "#c4b5fd" },
1072
+ "#ddd6fe"
1073
+ );
1074
+ l(
1075
+ "Pastel Lemon",
1076
+ {
1077
+ primary: "#facc15",
1078
+ primaryHover: "#eab308",
1079
+ success: "#4ade80",
1080
+ warning: "#fcd34d",
1081
+ error: "#fb7185",
1082
+ info: "#67e8f9"
1083
+ },
1084
+ { primary: "#fefce8", secondary: "#fef9c3", tertiary: "#fef08a", hover: "#fef9c3" },
1085
+ { primary: "#713f12", secondary: "#854d0e", muted: "#fde047" },
1086
+ "#fef08a"
1087
+ );
1088
+ l(
1089
+ "Pastel Sage",
1090
+ {
1091
+ primary: "#86efac",
1092
+ primaryHover: "#4ade80",
1093
+ success: "#22c55e",
1094
+ warning: "#fcd34d",
1095
+ error: "#fb7185",
1096
+ info: "#67e8f9"
1097
+ },
1098
+ { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
1099
+ { primary: "#166534", secondary: "#15803d", muted: "#86efac" },
1100
+ "#bbf7d0"
1101
+ );
1102
+ l(
1103
+ "Pastel Coral",
1104
+ {
1105
+ primary: "#fb7185",
1106
+ primaryHover: "#f43f5e",
1107
+ success: "#4ade80",
1108
+ warning: "#fcd34d",
1109
+ error: "#ef4444",
1110
+ info: "#67e8f9"
1111
+ },
1112
+ { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
1113
+ { primary: "#881337", secondary: "#9f1239", muted: "#fda4af" },
1114
+ "#fecdd3"
1115
+ );
1116
+ l(
1117
+ "Banking",
1118
+ {
1119
+ primary: "#1e3a5f",
1120
+ primaryHover: "#152c4a",
1121
+ success: "#059669",
1122
+ warning: "#d97706",
1123
+ error: "#dc2626",
1124
+ info: "#0891b2"
1125
+ },
1126
+ { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
1127
+ { primary: "#0f172a", secondary: "#334155", muted: "#94a3b8" },
1128
+ "#cbd5e1"
1129
+ );
1130
+ l(
1131
+ "Healthcare",
1132
+ {
1133
+ primary: "#0891b2",
1134
+ primaryHover: "#0e7490",
1135
+ success: "#059669",
1136
+ warning: "#d97706",
1137
+ error: "#dc2626",
1138
+ info: "#0284c7"
1139
+ },
1140
+ { primary: "#f0fdfa", secondary: "#e0f7fa", tertiary: "#b2ebf2", hover: "#e0f7fa" },
1141
+ { primary: "#134e4a", secondary: "#1a6b6a", muted: "#80cbc4" },
1142
+ "#b2dfdb"
1143
+ );
1144
+ l(
1145
+ "Legal",
1146
+ {
1147
+ primary: "#1e293b",
1148
+ primaryHover: "#0f172a",
1149
+ success: "#059669",
1150
+ warning: "#d97706",
1151
+ error: "#dc2626",
1152
+ info: "#0284c7"
1153
+ },
1154
+ { primary: "#fafaf9", secondary: "#f5f5f4", tertiary: "#e7e5e4", hover: "#e7e5e4" },
1155
+ { primary: "#0f172a", secondary: "#44403c", muted: "#a8a29e" },
1156
+ "#d6d3d1"
1157
+ );
1158
+ l(
1159
+ "Tech Startup",
1160
+ {
1161
+ primary: "#7c3aed",
1162
+ primaryHover: "#6d28d9",
1163
+ success: "#10b981",
1164
+ warning: "#f59e0b",
1165
+ error: "#ef4444",
1166
+ info: "#06b6d4"
1167
+ },
1168
+ { primary: "#faf5ff", secondary: "#f3e8ff", tertiary: "#e9d5ff", hover: "#f3e8ff" },
1169
+ { primary: "#1e1b4b", secondary: "#4c1d95", muted: "#a78bfa" },
1170
+ "#c4b5fd"
1171
+ );
1172
+ l(
1173
+ "Enterprise",
1174
+ {
1175
+ primary: "#1e40af",
1176
+ primaryHover: "#1e3a8a",
1177
+ success: "#059669",
1178
+ warning: "#d97706",
1179
+ error: "#dc2626",
1180
+ info: "#0891b2"
1181
+ },
1182
+ { primary: "#eff6ff", secondary: "#dbeafe", tertiary: "#bfdbfe", hover: "#dbeafe" },
1183
+ { primary: "#1e3a5f", secondary: "#1e40af", muted: "#60a5fa" },
1184
+ "#93c5fd"
1185
+ );
1186
+ l(
1187
+ "Government",
1188
+ {
1189
+ primary: "#1d4ed8",
1190
+ primaryHover: "#1e40af",
1191
+ success: "#059669",
1192
+ warning: "#d97706",
1193
+ error: "#dc2626",
1194
+ info: "#0891b2"
1195
+ },
1196
+ { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
1197
+ { primary: "#0f172a", secondary: "#1e293b", muted: "#64748b" },
1198
+ "#cbd5e1"
1199
+ );
1200
+ l(
1201
+ "Education",
1202
+ {
1203
+ primary: "#059669",
1204
+ primaryHover: "#047857",
1205
+ success: "#16a34a",
1206
+ warning: "#f59e0b",
1207
+ error: "#ef4444",
1208
+ info: "#0891b2"
1209
+ },
1210
+ { primary: "#f0fdf9", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
1211
+ { primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
1212
+ "#a7f3d0"
1213
+ );
1214
+ l(
1215
+ "Real Estate",
1216
+ {
1217
+ primary: "#92400e",
1218
+ primaryHover: "#78350f",
1219
+ success: "#059669",
1220
+ warning: "#b45309",
1221
+ error: "#dc2626",
1222
+ info: "#0891b2"
1223
+ },
1224
+ { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1225
+ { primary: "#422006", secondary: "#713f12", muted: "#d97706" },
1226
+ "#fcd34d"
1227
+ );
1228
+ l(
1229
+ "Nord",
1230
+ {
1231
+ primary: "#5e81ac",
1232
+ primaryHover: "#4c6b90",
1233
+ success: "#a3be8c",
1234
+ warning: "#ebcb8b",
1235
+ error: "#bf616a",
1236
+ info: "#88c0d0"
1237
+ },
1238
+ { primary: "#eceff4", secondary: "#e5e9f0", tertiary: "#d8dee9", hover: "#d8dee9" },
1239
+ { primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
1240
+ "#d8dee9"
1241
+ );
1242
+ R(
1243
+ "Dracula",
1244
+ {
1245
+ primary: "#bd93f9",
1246
+ primaryHover: "#9d79d9",
1247
+ success: "#50fa7b",
1248
+ warning: "#f1fa8c",
1249
+ error: "#ff5555",
1250
+ info: "#8be9fd"
1251
+ },
1252
+ { primary: "#282a36", secondary: "#343746", tertiary: "#44475a", hover: "#44475a" },
1253
+ { primary: "#f8f8f2", secondary: "#c0c0c0", muted: "#6272a4" },
1254
+ "#44475a"
1255
+ );
1256
+ l(
1257
+ "Solarized Light",
1258
+ {
1259
+ primary: "#268bd2",
1260
+ primaryHover: "#1a6da0",
1261
+ success: "#859900",
1262
+ warning: "#b58900",
1263
+ error: "#dc322f",
1264
+ info: "#2aa198"
1265
+ },
1266
+ { primary: "#fdf6e3", secondary: "#eee8d5", tertiary: "#e0dbc7", hover: "#eee8d5" },
1267
+ { primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
1268
+ "#eee8d5"
1269
+ );
1270
+ R(
1271
+ "Solarized Dark",
1272
+ {
1273
+ primary: "#268bd2",
1274
+ primaryHover: "#3d98db",
1275
+ success: "#859900",
1276
+ warning: "#b58900",
1277
+ error: "#dc322f",
1278
+ info: "#2aa198"
1279
+ },
1280
+ { primary: "#002b36", secondary: "#073642", tertiary: "#0a4858", hover: "#073642" },
1281
+ { primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75" },
1282
+ "#073642"
1283
+ );
1284
+ R(
1285
+ "Monokai",
1286
+ {
1287
+ primary: "#66d9ef",
1288
+ primaryHover: "#45c0d6",
1289
+ success: "#a6e22e",
1290
+ warning: "#e6db74",
1291
+ error: "#f92672",
1292
+ info: "#66d9ef"
1293
+ },
1294
+ { primary: "#272822", secondary: "#34352e", tertiary: "#3e3d32", hover: "#3e3d32" },
1295
+ { primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
1296
+ "#3e3d32"
1297
+ );
1298
+ R(
1299
+ "One Dark",
1300
+ {
1301
+ primary: "#61afef",
1302
+ primaryHover: "#4b9ee0",
1303
+ success: "#98c379",
1304
+ warning: "#e5c07b",
1305
+ error: "#e06c75",
1306
+ info: "#56b6c2"
1307
+ },
1308
+ { primary: "#282c34", secondary: "#2c313a", tertiary: "#353b45", hover: "#353b45" },
1309
+ { primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
1310
+ "#3e4452"
1311
+ );
1312
+ R(
1313
+ "Synthwave",
1314
+ {
1315
+ primary: "#ff7edb",
1316
+ primaryHover: "#e660c2",
1317
+ success: "#72f1b8",
1318
+ warning: "#fede5d",
1319
+ error: "#fe4450",
1320
+ info: "#36f9f6"
1321
+ },
1322
+ { primary: "#241b2f", secondary: "#2d2140", tertiary: "#362a50", hover: "#362a50" },
1323
+ { primary: "#f0e4fc", secondary: "#b4a0cc", muted: "#6c5c84" },
1324
+ "#4a3866"
1325
+ );
1326
+ l(
1327
+ "Vaporwave",
1328
+ {
1329
+ primary: "#ff71ce",
1330
+ primaryHover: "#e655b5",
1331
+ success: "#78dcca",
1332
+ warning: "#ffb86c",
1333
+ error: "#ff5555",
1334
+ info: "#76e8fc"
1335
+ },
1336
+ { primary: "#fce4f7", secondary: "#e8d0f4", tertiary: "#d4bcf0", hover: "#e8d0f4" },
1337
+ { primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
1338
+ "#d8a8e8"
1339
+ );
1340
+ R(
1341
+ "Terminal Green",
1342
+ {
1343
+ primary: "#00ff41",
1344
+ primaryHover: "#00cc34",
1345
+ success: "#00ff41",
1346
+ warning: "#ffff00",
1347
+ error: "#ff0000",
1348
+ info: "#00ffff"
1349
+ },
1350
+ { primary: "#0a0a0a", secondary: "#0d1a0d", tertiary: "#1a2e1a", hover: "#1a2e1a" },
1351
+ { primary: "#00ff41", secondary: "#00cc33", muted: "#008822" },
1352
+ "#003300"
1353
+ );
1354
+ l(
1355
+ "Sepia",
1356
+ {
1357
+ primary: "#8b6914",
1358
+ primaryHover: "#704f10",
1359
+ success: "#6b8e23",
1360
+ warning: "#cd853f",
1361
+ error: "#b22222",
1362
+ info: "#5f9ea0"
1363
+ },
1364
+ { primary: "#faf0e6", secondary: "#f5e6d3", tertiary: "#eddcc7", hover: "#f5e6d3" },
1365
+ { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
1366
+ "#d7ccc8"
1367
+ );
1368
+ l(
1369
+ "Vintage",
1370
+ {
1371
+ primary: "#8d6e63",
1372
+ primaryHover: "#6d4c41",
1373
+ success: "#66bb6a",
1374
+ warning: "#ffb300",
1375
+ error: "#e53935",
1376
+ info: "#29b6f6"
1377
+ },
1378
+ { primary: "#efebe9", secondary: "#d7ccc8", tertiary: "#bcaaa4", hover: "#d7ccc8" },
1379
+ { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
1380
+ "#bcaaa4"
1381
+ );
1382
+ R(
1383
+ "Cyberpunk",
1384
+ {
1385
+ primary: "#00f0ff",
1386
+ primaryHover: "#00c8d4",
1387
+ success: "#39ff14",
1388
+ warning: "#ffff00",
1389
+ error: "#ff003c",
1390
+ info: "#bf00ff"
1391
+ },
1392
+ { primary: "#0a0e17", secondary: "#131824", tertiary: "#1c2333", hover: "#1c2333" },
1393
+ { primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72" },
1394
+ "#1c3a44"
1395
+ );
1396
+ R(
1397
+ "Neon",
1398
+ {
1399
+ primary: "#ff00ff",
1400
+ primaryHover: "#cc00cc",
1401
+ success: "#00ff00",
1402
+ warning: "#ffff00",
1403
+ error: "#ff0000",
1404
+ info: "#00ffff"
1405
+ },
1406
+ { primary: "#0d0d0d", secondary: "#1a1a1a", tertiary: "#262626", hover: "#262626" },
1407
+ { primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
1408
+ "#333333"
1409
+ );
1410
+ R(
1411
+ "Retrowave",
1412
+ {
1413
+ primary: "#f77fbe",
1414
+ primaryHover: "#e462a3",
1415
+ success: "#72f1b8",
1416
+ warning: "#ffe261",
1417
+ error: "#ff4444",
1418
+ info: "#79e8fb"
1419
+ },
1420
+ { primary: "#1b0a2e", secondary: "#261440", tertiary: "#321e52", hover: "#321e52" },
1421
+ { primary: "#ffe6f7", secondary: "#c9a0c9", muted: "#6b4c7a" },
1422
+ "#4a2d66"
1423
+ );
1424
+ l(
1425
+ "Christmas",
1426
+ {
1427
+ primary: "#c41e3a",
1428
+ primaryHover: "#a01830",
1429
+ success: "#228b22",
1430
+ warning: "#ffd700",
1431
+ error: "#dc2626",
1432
+ info: "#0891b2"
1433
+ },
1434
+ { primary: "#fef2f2", secondary: "#fde8e8", tertiary: "#f8d0d0", hover: "#fde8e8" },
1435
+ { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
1436
+ "#e8a0a0"
1437
+ );
1438
+ R(
1439
+ "Halloween",
1440
+ {
1441
+ primary: "#ff6600",
1442
+ primaryHover: "#e05500",
1443
+ success: "#4ade80",
1444
+ warning: "#fbbf24",
1445
+ error: "#ff0000",
1446
+ info: "#9333ea"
1447
+ },
1448
+ { primary: "#1a0a00", secondary: "#2d1500", tertiary: "#402000", hover: "#402000" },
1449
+ { primary: "#ffedd5", secondary: "#fdba74", muted: "#9a5c28" },
1450
+ "#5c3400"
1451
+ );
1452
+ l(
1453
+ "Valentine",
1454
+ {
1455
+ primary: "#e11d48",
1456
+ primaryHover: "#be123c",
1457
+ success: "#10b981",
1458
+ warning: "#f59e0b",
1459
+ error: "#dc2626",
1460
+ info: "#ec4899"
1461
+ },
1462
+ { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
1463
+ { primary: "#4c0519", secondary: "#881337", muted: "#f9a8d4" },
1464
+ "#fda4af"
1465
+ );
1466
+ l(
1467
+ "Easter",
1468
+ {
1469
+ primary: "#a78bfa",
1470
+ primaryHover: "#8b5cf6",
1471
+ success: "#4ade80",
1472
+ warning: "#fcd34d",
1473
+ error: "#fb7185",
1474
+ info: "#67e8f9"
1475
+ },
1476
+ { primary: "#fef9ff", secondary: "#f3e8ff", tertiary: "#e8d5ff", hover: "#f3e8ff" },
1477
+ { primary: "#581c87", secondary: "#6d28d9", muted: "#c4b5fd" },
1478
+ "#ddd6fe"
1479
+ );
1480
+ l(
1481
+ "Summer Beach",
1482
+ {
1483
+ primary: "#0ea5e9",
1484
+ primaryHover: "#0284c7",
1485
+ success: "#10b981",
1486
+ warning: "#f59e0b",
1487
+ error: "#ef4444",
1488
+ info: "#06b6d4"
1489
+ },
1490
+ { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1491
+ { primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
1492
+ "#fcd34d"
1493
+ );
1494
+ l(
1495
+ "Winter Frost",
1496
+ {
1497
+ primary: "#3b82f6",
1498
+ primaryHover: "#2563eb",
1499
+ success: "#10b981",
1500
+ warning: "#f59e0b",
1501
+ error: "#ef4444",
1502
+ info: "#06b6d4"
1503
+ },
1504
+ { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
1505
+ { primary: "#1e3a5f", secondary: "#1e40af", muted: "#93c5fd" },
1506
+ "#bfdbfe"
1507
+ );
1508
+ l(
1509
+ "Cherry Blossom",
1510
+ {
1511
+ primary: "#ec4899",
1512
+ primaryHover: "#db2777",
1513
+ success: "#10b981",
1514
+ warning: "#f59e0b",
1515
+ error: "#ef4444",
1516
+ info: "#06b6d4"
1517
+ },
1518
+ { primary: "#fdf2f8", secondary: "#fce7f3", tertiary: "#fbcfe8", hover: "#fce7f3" },
1519
+ { primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
1520
+ "#fbcfe8"
1521
+ );
1522
+ l(
1523
+ "Harvest",
1524
+ {
1525
+ primary: "#b45309",
1526
+ primaryHover: "#92400e",
1527
+ success: "#4d7c0f",
1528
+ warning: "#a16207",
1529
+ error: "#b91c1c",
1530
+ info: "#0e7490"
1531
+ },
1532
+ { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1533
+ { primary: "#451a03", secondary: "#78350f", muted: "#d97706" },
1534
+ "#fcd34d"
1535
+ );
1536
+ l(
1537
+ "Japanese Zen",
1538
+ {
1539
+ primary: "#6b7280",
1540
+ primaryHover: "#4b5563",
1541
+ success: "#6b8e23",
1542
+ warning: "#d4a017",
1543
+ error: "#c0392b",
1544
+ info: "#5f9ea0"
1545
+ },
1546
+ { primary: "#faf9f6", secondary: "#f0ece3", tertiary: "#e6e0d4", hover: "#f0ece3" },
1547
+ { primary: "#2c2c2c", secondary: "#5c5c5c", muted: "#a0998a" },
1548
+ "#d5cec0"
1549
+ );
1550
+ l(
1551
+ "Moroccan",
1552
+ {
1553
+ primary: "#c2410c",
1554
+ primaryHover: "#9a3412",
1555
+ success: "#15803d",
1556
+ warning: "#ca8a04",
1557
+ error: "#b91c1c",
1558
+ info: "#0e7490"
1559
+ },
1560
+ { primary: "#fffbf0", secondary: "#fef3e0", tertiary: "#fde6c4", hover: "#fef3e0" },
1561
+ { primary: "#3a1a00", secondary: "#7c2d12", muted: "#d97706" },
1562
+ "#f5d0a0"
1563
+ );
1564
+ l(
1565
+ "Scandinavian",
1566
+ {
1567
+ primary: "#4b5563",
1568
+ primaryHover: "#374151",
1569
+ success: "#059669",
1570
+ warning: "#d97706",
1571
+ error: "#dc2626",
1572
+ info: "#0891b2"
1573
+ },
1574
+ { primary: "#ffffff", secondary: "#f9fafb", tertiary: "#f3f4f6", hover: "#f3f4f6" },
1575
+ { primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
1576
+ "#e5e7eb"
1577
+ );
1578
+ l(
1579
+ "Mediterranean",
1580
+ {
1581
+ primary: "#1e40af",
1582
+ primaryHover: "#1e3a8a",
1583
+ success: "#059669",
1584
+ warning: "#d97706",
1585
+ error: "#dc2626",
1586
+ info: "#0891b2"
1587
+ },
1588
+ { primary: "#eff6ff", secondary: "#dbeafe", tertiary: "#bfdbfe", hover: "#dbeafe" },
1589
+ { primary: "#1e3a5f", secondary: "#2563eb", muted: "#93c5fd" },
1590
+ "#bfdbfe"
1591
+ );
1592
+ l(
1593
+ "Chinese New Year",
1594
+ {
1595
+ primary: "#dc2626",
1596
+ primaryHover: "#b91c1c",
1597
+ success: "#16a34a",
1598
+ warning: "#d4a017",
1599
+ error: "#ef4444",
1600
+ info: "#0891b2"
1601
+ },
1602
+ { primary: "#fef2f2", secondary: "#fee2e2", tertiary: "#fecaca", hover: "#fee2e2" },
1603
+ { primary: "#450a0a", secondary: "#991b1b", muted: "#f87171" },
1604
+ "#fca5a5"
1605
+ );
1606
+ l(
1607
+ "Indian Festive",
1608
+ {
1609
+ primary: "#d97706",
1610
+ primaryHover: "#b45309",
1611
+ success: "#16a34a",
1612
+ warning: "#ca8a04",
1613
+ error: "#dc2626",
1614
+ info: "#7c3aed"
1615
+ },
1616
+ { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1617
+ { primary: "#451a03", secondary: "#92400e", muted: "#f59e0b" },
1618
+ "#fcd34d"
1619
+ );
1620
+ l(
1621
+ "Brazilian Carnival",
1622
+ {
1623
+ primary: "#16a34a",
1624
+ primaryHover: "#15803d",
1625
+ success: "#22c55e",
1626
+ warning: "#facc15",
1627
+ error: "#ef4444",
1628
+ info: "#0ea5e9"
1629
+ },
1630
+ { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
1631
+ { primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
1632
+ "#86efac"
1633
+ );
1634
+ l(
1635
+ "African Earth",
1636
+ {
1637
+ primary: "#92400e",
1638
+ primaryHover: "#78350f",
1639
+ success: "#4d7c0f",
1640
+ warning: "#a16207",
1641
+ error: "#b91c1c",
1642
+ info: "#0e7490"
1643
+ },
1644
+ { primary: "#faf5f0", secondary: "#f0e6d6", tertiary: "#e6d5bb", hover: "#f0e6d6" },
1645
+ { primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
1646
+ "#d4b896"
1647
+ );
1648
+ R(
1649
+ "High Contrast Dark",
1650
+ {
1651
+ primary: "#ffff00",
1652
+ primaryHover: "#cccc00",
1653
+ success: "#00ff00",
1654
+ warning: "#ff8c00",
1655
+ error: "#ff0000",
1656
+ info: "#00ffff"
1657
+ },
1658
+ { primary: "#000000", secondary: "#1a1a1a", tertiary: "#333333", hover: "#333333" },
1659
+ { primary: "#ffffff", secondary: "#ffffff", muted: "#cccccc" },
1660
+ "#ffffff"
1661
+ );
1662
+ l(
1663
+ "Monochrome",
1664
+ {
1665
+ primary: "#404040",
1666
+ primaryHover: "#262626",
1667
+ success: "#4d7c0f",
1668
+ warning: "#a16207",
1669
+ error: "#b91c1c",
1670
+ info: "#0e7490"
1671
+ },
1672
+ { primary: "#fafafa", secondary: "#f0f0f0", tertiary: "#e0e0e0", hover: "#e0e0e0" },
1673
+ { primary: "#1a1a1a", secondary: "#404040", muted: "#808080" },
1674
+ "#c0c0c0"
1675
+ );
1676
+ l(
1677
+ "Enhanced Contrast",
1678
+ {
1679
+ primary: "#0050b3",
1680
+ primaryHover: "#003d8c",
1681
+ success: "#006400",
1682
+ warning: "#cc7000",
1683
+ error: "#cc0000",
1684
+ info: "#006680"
1685
+ },
1686
+ { primary: "#ffffff", secondary: "#f5f5f5", tertiary: "#ebebeb", hover: "#ebebeb" },
1687
+ { primary: "#000000", secondary: "#1a1a1a", muted: "#595959" },
1688
+ "#8c8c8c"
1689
+ );
1690
+ l(
1691
+ "Minimalist",
1692
+ {
1693
+ primary: "#18181b",
1694
+ primaryHover: "#27272a",
1695
+ success: "#22c55e",
1696
+ warning: "#eab308",
1697
+ error: "#ef4444",
1698
+ info: "#3b82f6"
1699
+ },
1700
+ { primary: "#ffffff", secondary: "#fafafa", tertiary: "#f5f5f5", hover: "#f5f5f5" },
1701
+ { primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
1702
+ "#e5e5e5"
1703
+ );
1704
+ R(
1705
+ "Warm Dark",
1706
+ {
1707
+ primary: "#f59e0b",
1708
+ primaryHover: "#d97706",
1709
+ success: "#10b981",
1710
+ warning: "#fbbf24",
1711
+ error: "#f87171",
1712
+ info: "#38bdf8"
1713
+ },
1714
+ { primary: "#1c1917", secondary: "#292524", tertiary: "#44403c", hover: "#44403c" },
1715
+ { primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
1716
+ "#57534e"
1717
+ );
1718
+ R(
1719
+ "Soft Dark",
1720
+ {
1721
+ primary: "#a78bfa",
1722
+ primaryHover: "#8b5cf6",
1723
+ success: "#34d399",
1724
+ warning: "#fcd34d",
1725
+ error: "#fb7185",
1726
+ info: "#67e8f9"
1727
+ },
1728
+ { primary: "#1e1e2e", secondary: "#262637", tertiary: "#313147", hover: "#313147" },
1729
+ { primary: "#e8e8f0", secondary: "#a0a0b8", muted: "#5c5c74" },
1730
+ "#3e3e58"
1731
+ );
1732
+ l(
1733
+ "Coffee",
1734
+ {
1735
+ primary: "#6f4e37",
1736
+ primaryHover: "#5c3d28",
1737
+ success: "#4d7c0f",
1738
+ warning: "#a16207",
1739
+ error: "#b91c1c",
1740
+ info: "#0e7490"
1741
+ },
1742
+ { primary: "#faf6f1", secondary: "#f0e8dc", tertiary: "#e6d8c6", hover: "#f0e8dc" },
1743
+ { primary: "#2c1a0e", secondary: "#5c3d28", muted: "#a08868" },
1744
+ "#d4c4a8"
1745
+ );
1746
+ l(
1747
+ "Wine",
1748
+ {
1749
+ primary: "#7f1d1d",
1750
+ primaryHover: "#641717",
1751
+ success: "#059669",
1752
+ warning: "#d97706",
1753
+ error: "#dc2626",
1754
+ info: "#0891b2"
1755
+ },
1756
+ { primary: "#fef2f2", secondary: "#fde8e8", tertiary: "#f8d0d0", hover: "#fde8e8" },
1757
+ { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
1758
+ "#e8a0a0"
1759
+ );
1760
+ M(null);
1761
+ const Ve = [
1762
+ {
1763
+ target: ".nice-api-designer",
1764
+ titleKey: "tutorial.apiDesigner.intro.title",
1765
+ title: "API designer",
1766
+ contentKey: "tutorial.apiDesigner.intro.content",
1767
+ content: "Define endpoints, parameters, request/response schemas and security for your OpenAPI document.",
1768
+ placement: "auto"
1769
+ }
1770
+ ], ze = {
4
1771
  openapi: "3.0.3",
5
1772
  info: {
6
1773
  title: "New API",
@@ -13,247 +1780,249 @@ const ce = {
13
1780
  securitySchemes: {}
14
1781
  },
15
1782
  tags: []
16
- }, ne = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
17
- function ie(i) {
18
- var c, n;
1783
+ }, Ne = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
1784
+ function le(e) {
1785
+ var i, n;
19
1786
  const a = [];
20
- return i.openapi || a.push({ path: "openapi", message: "OpenAPI version is required", severity: "error" }), (c = i.info) != null && c.title || a.push({ path: "info.title", message: "API title is required", severity: "error" }), (n = i.info) != null && n.version || a.push({ path: "info.version", message: "API version is required", severity: "error" }), Object.entries(i.paths || {}).forEach(([r, d]) => {
21
- r.startsWith("/") || a.push({ path: `paths.${r}`, message: "Path must start with /", severity: "error" }), ne.forEach((o) => {
22
- const b = d[o.toLowerCase()];
23
- b && !b.responses && a.push({
24
- path: `paths.${r}.${o.toLowerCase()}.responses`,
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()];
1790
+ y && !y.responses && a.push({
1791
+ path: `paths.${s}.${f.toLowerCase()}.responses`,
25
1792
  message: "Responses are required",
26
1793
  severity: "error"
27
1794
  });
28
1795
  });
29
1796
  }), a;
30
1797
  }
31
- function Pe({
32
- schema: i,
1798
+ function _r({
1799
+ schema: e,
33
1800
  onChange: a,
34
- onSave: c,
1801
+ onSave: i,
35
1802
  readOnly: n = !1,
36
- className: r = ""
1803
+ className: s = "",
1804
+ tutorial: u
37
1805
  }) {
38
1806
  var O, q;
39
- const [d, o] = w(i || ce), [b, u] = w(null), [p, x] = w(null), [h, _] = w("info"), [S, C] = w([]), E = T(
40
- (v) => {
41
- o((f) => {
42
- const N = v(f);
43
- return a == null || a(N), C(ie(N)), N;
1807
+ const [f, y] = g(e || ze), [b, d] = g(null), [v, k] = g(null), [m, T] = g("info"), [_, I] = g([]), H = P(
1808
+ (w) => {
1809
+ y((x) => {
1810
+ const S = w(x);
1811
+ return a == null || a(S), I(le(S)), S;
44
1812
  });
45
1813
  },
46
1814
  [a]
47
- ), $ = T(() => {
48
- const v = "/new-endpoint";
49
- E((f) => ({
50
- ...f,
1815
+ ), j = P(() => {
1816
+ const w = "/new-endpoint";
1817
+ H((x) => ({
1818
+ ...x,
51
1819
  paths: {
52
- ...f.paths,
53
- [v]: {
1820
+ ...x.paths,
1821
+ [w]: {
54
1822
  get: {
55
1823
  summary: "New endpoint",
56
1824
  responses: { 200: { description: "Success" } }
57
1825
  }
58
1826
  }
59
1827
  }
60
- })), u(v), x("get");
61
- }, [E]), I = T(
62
- (v) => {
63
- E((f) => {
64
- const { [v]: N, ...U } = f.paths;
65
- return { ...f, paths: U };
66
- }), u(null), x(null);
1828
+ })), d(w), k("get");
1829
+ }, [H]), K = P(
1830
+ (w) => {
1831
+ H((x) => {
1832
+ const { [w]: S, ...B } = x.paths;
1833
+ return { ...x, paths: B };
1834
+ }), d(null), k(null);
67
1835
  },
68
- [E]
69
- ), F = T(() => {
70
- const v = "NewSchema";
71
- E((f) => {
72
- var N;
1836
+ [H]
1837
+ ), G = P(() => {
1838
+ const w = "NewSchema";
1839
+ H((x) => {
1840
+ var S;
73
1841
  return {
74
- ...f,
1842
+ ...x,
75
1843
  components: {
76
- ...f.components,
1844
+ ...x.components,
77
1845
  schemas: {
78
- ...(N = f.components) == null ? void 0 : N.schemas,
79
- [v]: { type: "object", properties: {} }
1846
+ ...(S = x.components) == null ? void 0 : S.schemas,
1847
+ [w]: { type: "object", properties: {} }
80
1848
  }
81
1849
  }
82
1850
  };
83
1851
  });
84
- }, [E]), P = T(() => {
85
- const v = ie(d);
86
- C(v), v.filter((f) => f.severity === "error").length === 0 && (c == null || c(d));
87
- }, [d, c]), j = Object.entries(d.paths).flatMap(
88
- ([v, f]) => ne.filter((N) => f[N.toLowerCase()]).map(
89
- (N) => ({
90
- path: v,
91
- method: N,
92
- operation: f[N.toLowerCase()]
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) => ({
1858
+ path: w,
1859
+ method: S,
1860
+ operation: x[S.toLowerCase()]
93
1861
  })
94
1862
  )
95
1863
  );
96
- return /* @__PURE__ */ t("div", { className: `nice-api-designer ${r}`, children: [
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) }) }),
97
1866
  /* @__PURE__ */ t("div", { className: "nice-api-designer__toolbar", children: [
98
- /* @__PURE__ */ e("div", { className: "nice-api-designer__tabs", children: ["info", "paths", "schemas", "security", "preview"].map((v) => /* @__PURE__ */ e(
1867
+ /* @__PURE__ */ r("div", { className: "nice-api-designer__tabs", children: ["info", "paths", "schemas", "security", "preview"].map((w) => /* @__PURE__ */ r(
99
1868
  "button",
100
1869
  {
101
- className: `nice-api-designer__tab ${h === v ? "nice-api-designer__tab--active" : ""}`,
102
- onClick: () => _(v),
103
- children: v.charAt(0).toUpperCase() + v.slice(1)
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)
104
1873
  },
105
- v
1874
+ w
106
1875
  )) }),
107
- !n && /* @__PURE__ */ e("button", { className: "nice-api-designer__save-btn", onClick: P, children: "Save" })
1876
+ !n && /* @__PURE__ */ r("button", { className: "nice-api-designer__save-btn", onClick: $, children: "Save" })
108
1877
  ] }),
109
- S.length > 0 && /* @__PURE__ */ e("div", { className: "nice-api-designer__errors", children: S.map((v, f) => /* @__PURE__ */ t(
1878
+ _.length > 0 && /* @__PURE__ */ r("div", { className: "nice-api-designer__errors", children: _.map((w, x) => /* @__PURE__ */ t(
110
1879
  "div",
111
1880
  {
112
- className: `nice-api-designer__error nice-api-designer__error--${v.severity}`,
1881
+ className: `nice-api-designer__error nice-api-designer__error--${w.severity}`,
113
1882
  children: [
114
1883
  /* @__PURE__ */ t("strong", { children: [
115
- v.path,
1884
+ w.path,
116
1885
  ":"
117
1886
  ] }),
118
1887
  " ",
119
- v.message
1888
+ w.message
120
1889
  ]
121
1890
  },
122
- f
1891
+ x
123
1892
  )) }),
124
1893
  /* @__PURE__ */ t("div", { className: "nice-api-designer__content", children: [
125
- h === "info" && /* @__PURE__ */ e(le, { schema: d, onChange: E, readOnly: n }),
126
- h === "paths" && /* @__PURE__ */ e(
127
- oe,
1894
+ m === "info" && /* @__PURE__ */ r(Fe, { schema: f, onChange: H, readOnly: n }),
1895
+ m === "paths" && /* @__PURE__ */ r(
1896
+ We,
128
1897
  {
129
- endpoints: j,
130
- schema: d,
1898
+ endpoints: U,
1899
+ schema: f,
131
1900
  selectedPath: b,
132
- selectedMethod: p,
133
- onSelectEndpoint: (v, f) => {
134
- u(v), x(f);
1901
+ selectedMethod: v,
1902
+ onSelectEndpoint: (w, x) => {
1903
+ d(w), k(x);
135
1904
  },
136
- onAdd: $,
137
- onDelete: I,
138
- onChange: E,
1905
+ onAdd: j,
1906
+ onDelete: K,
1907
+ onChange: H,
139
1908
  readOnly: n
140
1909
  }
141
1910
  ),
142
- h === "schemas" && /* @__PURE__ */ e(
143
- de,
1911
+ m === "schemas" && /* @__PURE__ */ r(
1912
+ Je,
144
1913
  {
145
- schemas: ((O = d.components) == null ? void 0 : O.schemas) || {},
146
- onAdd: F,
147
- onChange: (v) => E((f) => ({
148
- ...f,
149
- components: { ...f.components, schemas: v }
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 }
150
1919
  })),
151
1920
  readOnly: n
152
1921
  }
153
1922
  ),
154
- h === "security" && /* @__PURE__ */ e(
155
- pe,
1923
+ m === "security" && /* @__PURE__ */ r(
1924
+ Ge,
156
1925
  {
157
- schemes: ((q = d.components) == null ? void 0 : q.securitySchemes) || {},
158
- onChange: (v) => E((f) => ({
159
- ...f,
160
- components: { ...f.components, securitySchemes: v }
1926
+ schemes: ((q = f.components) == null ? void 0 : q.securitySchemes) || {},
1927
+ onChange: (w) => H((x) => ({
1928
+ ...x,
1929
+ components: { ...x.components, securitySchemes: w }
161
1930
  })),
162
1931
  readOnly: n
163
1932
  }
164
1933
  ),
165
- h === "preview" && /* @__PURE__ */ e(ue, { schema: d })
1934
+ m === "preview" && /* @__PURE__ */ r(Xe, { schema: f })
166
1935
  ] })
167
1936
  ] });
168
1937
  }
169
- function le({ schema: i, onChange: a, readOnly: c }) {
1938
+ function Fe({ schema: e, onChange: a, readOnly: i }) {
170
1939
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__info-editor", children: [
171
- /* @__PURE__ */ e("h3", { children: "API Information" }),
1940
+ /* @__PURE__ */ r("h3", { children: "API Information" }),
172
1941
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
173
- /* @__PURE__ */ e("label", { children: "Title" }),
174
- /* @__PURE__ */ e(
1942
+ /* @__PURE__ */ r("label", { children: "Title" }),
1943
+ /* @__PURE__ */ r(
175
1944
  "input",
176
1945
  {
177
1946
  type: "text",
178
- value: i.info.title,
179
- onChange: (n) => a((r) => ({
180
- ...r,
181
- info: { ...r.info, title: n.target.value }
1947
+ value: e.info.title,
1948
+ onChange: (n) => a((s) => ({
1949
+ ...s,
1950
+ info: { ...s.info, title: n.target.value }
182
1951
  })),
183
- disabled: c
1952
+ disabled: i
184
1953
  }
185
1954
  )
186
1955
  ] }),
187
1956
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
188
- /* @__PURE__ */ e("label", { children: "Version" }),
189
- /* @__PURE__ */ e(
1957
+ /* @__PURE__ */ r("label", { children: "Version" }),
1958
+ /* @__PURE__ */ r(
190
1959
  "input",
191
1960
  {
192
1961
  type: "text",
193
- value: i.info.version,
194
- onChange: (n) => a((r) => ({
195
- ...r,
196
- info: { ...r.info, version: n.target.value }
1962
+ value: e.info.version,
1963
+ onChange: (n) => a((s) => ({
1964
+ ...s,
1965
+ info: { ...s.info, version: n.target.value }
197
1966
  })),
198
- disabled: c
1967
+ disabled: i
199
1968
  }
200
1969
  )
201
1970
  ] }),
202
1971
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
203
- /* @__PURE__ */ e("label", { children: "Description" }),
204
- /* @__PURE__ */ e(
1972
+ /* @__PURE__ */ r("label", { children: "Description" }),
1973
+ /* @__PURE__ */ r(
205
1974
  "textarea",
206
1975
  {
207
- value: i.info.description || "",
208
- onChange: (n) => a((r) => ({
209
- ...r,
210
- info: { ...r.info, description: n.target.value }
1976
+ value: e.info.description || "",
1977
+ onChange: (n) => a((s) => ({
1978
+ ...s,
1979
+ info: { ...s.info, description: n.target.value }
211
1980
  })),
212
- disabled: c,
1981
+ disabled: i,
213
1982
  rows: 5
214
1983
  }
215
1984
  )
216
1985
  ] }),
217
- /* @__PURE__ */ e("h4", { children: "Servers" }),
218
- (i.servers || []).map((n, r) => /* @__PURE__ */ t("div", { className: "nice-api-designer__server", children: [
219
- /* @__PURE__ */ e(
1986
+ /* @__PURE__ */ r("h4", { children: "Servers" }),
1987
+ (e.servers || []).map((n, s) => /* @__PURE__ */ t("div", { className: "nice-api-designer__server", children: [
1988
+ /* @__PURE__ */ r(
220
1989
  "input",
221
1990
  {
222
1991
  type: "text",
223
1992
  value: n.url,
224
1993
  placeholder: "Server URL",
225
- onChange: (d) => a((o) => {
226
- var b;
1994
+ onChange: (u) => a((f) => {
1995
+ var y;
227
1996
  return {
228
- ...o,
229
- servers: (b = o.servers) == null ? void 0 : b.map(
230
- (u, p) => p === r ? { ...u, url: d.target.value } : u
1997
+ ...f,
1998
+ servers: (y = f.servers) == null ? void 0 : y.map(
1999
+ (b, d) => d === s ? { ...b, url: u.target.value } : b
231
2000
  )
232
2001
  };
233
2002
  }),
234
- disabled: c
2003
+ disabled: i
235
2004
  }
236
2005
  ),
237
- /* @__PURE__ */ e(
2006
+ /* @__PURE__ */ r(
238
2007
  "input",
239
2008
  {
240
2009
  type: "text",
241
2010
  value: n.description || "",
242
2011
  placeholder: "Description",
243
- onChange: (d) => a((o) => {
244
- var b;
2012
+ onChange: (u) => a((f) => {
2013
+ var y;
245
2014
  return {
246
- ...o,
247
- servers: (b = o.servers) == null ? void 0 : b.map(
248
- (u, p) => p === r ? { ...u, description: d.target.value } : u
2015
+ ...f,
2016
+ servers: (y = f.servers) == null ? void 0 : y.map(
2017
+ (b, d) => d === s ? { ...b, description: u.target.value } : b
249
2018
  )
250
2019
  };
251
2020
  }),
252
- disabled: c
2021
+ disabled: i
253
2022
  }
254
2023
  )
255
- ] }, r)),
256
- !c && /* @__PURE__ */ e(
2024
+ ] }, s)),
2025
+ !i && /* @__PURE__ */ r(
257
2026
  "button",
258
2027
  {
259
2028
  onClick: () => a((n) => ({
@@ -265,192 +2034,192 @@ function le({ schema: i, onChange: a, readOnly: c }) {
265
2034
  )
266
2035
  ] });
267
2036
  }
268
- function oe({
269
- endpoints: i,
2037
+ function We({
2038
+ endpoints: e,
270
2039
  schema: a,
271
- selectedPath: c,
2040
+ selectedPath: i,
272
2041
  selectedMethod: n,
273
- onSelectEndpoint: r,
274
- onAdd: d,
275
- onDelete: o,
276
- onChange: b,
277
- readOnly: u
2042
+ onSelectEndpoint: s,
2043
+ onAdd: u,
2044
+ onDelete: f,
2045
+ onChange: y,
2046
+ readOnly: b
278
2047
  }) {
279
- var x;
280
- const p = c && n ? (x = a.paths[c]) == null ? void 0 : x[n] : null;
2048
+ var v;
2049
+ const d = i && n ? (v = a.paths[i]) == null ? void 0 : v[n] : null;
281
2050
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__paths-editor", children: [
282
2051
  /* @__PURE__ */ t("div", { className: "nice-api-designer__endpoints-list", children: [
283
2052
  /* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
284
- /* @__PURE__ */ e("h3", { children: "Endpoints" }),
285
- !u && /* @__PURE__ */ e("button", { onClick: d, children: "+ Add" })
2053
+ /* @__PURE__ */ r("h3", { children: "Endpoints" }),
2054
+ !b && /* @__PURE__ */ r("button", { onClick: u, children: "+ Add" })
286
2055
  ] }),
287
- i.map(({ path: h, method: _ }) => /* @__PURE__ */ t(
2056
+ e.map(({ path: k, method: m }) => /* @__PURE__ */ t(
288
2057
  "div",
289
2058
  {
290
- className: `nice-api-designer__endpoint ${c === h && n === _.toLowerCase() ? "nice-api-designer__endpoint--selected" : ""}`,
291
- onClick: () => r(h, _.toLowerCase()),
2059
+ className: `nice-api-designer__endpoint ${i === k && n === m.toLowerCase() ? "nice-api-designer__endpoint--selected" : ""}`,
2060
+ onClick: () => s(k, m.toLowerCase()),
292
2061
  children: [
293
- /* @__PURE__ */ e(
2062
+ /* @__PURE__ */ r(
294
2063
  "span",
295
2064
  {
296
- className: `nice-api-designer__method nice-api-designer__method--${_.toLowerCase()}`,
297
- children: _
2065
+ className: `nice-api-designer__method nice-api-designer__method--${m.toLowerCase()}`,
2066
+ children: m
298
2067
  }
299
2068
  ),
300
- /* @__PURE__ */ e("span", { className: "nice-api-designer__path", children: h })
2069
+ /* @__PURE__ */ r("span", { className: "nice-api-designer__path", children: k })
301
2070
  ]
302
2071
  },
303
- `${_}-${h}`
2072
+ `${m}-${k}`
304
2073
  ))
305
2074
  ] }),
306
- p && c && n && /* @__PURE__ */ t("div", { className: "nice-api-designer__operation-editor", children: [
2075
+ d && i && n && /* @__PURE__ */ t("div", { className: "nice-api-designer__operation-editor", children: [
307
2076
  /* @__PURE__ */ t("h3", { children: [
308
2077
  n.toUpperCase(),
309
2078
  " ",
310
- c
2079
+ i
311
2080
  ] }),
312
2081
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
313
- /* @__PURE__ */ e("label", { children: "Summary" }),
314
- /* @__PURE__ */ e(
2082
+ /* @__PURE__ */ r("label", { children: "Summary" }),
2083
+ /* @__PURE__ */ r(
315
2084
  "input",
316
2085
  {
317
2086
  type: "text",
318
- value: p.summary || "",
319
- onChange: (h) => b((_) => ({
320
- ..._,
2087
+ value: d.summary || "",
2088
+ onChange: (k) => y((m) => ({
2089
+ ...m,
321
2090
  paths: {
322
- ..._.paths,
323
- [c]: {
324
- ..._.paths[c],
2091
+ ...m.paths,
2092
+ [i]: {
2093
+ ...m.paths[i],
325
2094
  [n]: {
326
- ...p,
327
- summary: h.target.value
2095
+ ...d,
2096
+ summary: k.target.value
328
2097
  }
329
2098
  }
330
2099
  }
331
2100
  })),
332
- disabled: u
2101
+ disabled: b
333
2102
  }
334
2103
  )
335
2104
  ] }),
336
2105
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
337
- /* @__PURE__ */ e("label", { children: "Description" }),
338
- /* @__PURE__ */ e(
2106
+ /* @__PURE__ */ r("label", { children: "Description" }),
2107
+ /* @__PURE__ */ r(
339
2108
  "textarea",
340
2109
  {
341
- value: p.description || "",
342
- onChange: (h) => b((_) => ({
343
- ..._,
2110
+ value: d.description || "",
2111
+ onChange: (k) => y((m) => ({
2112
+ ...m,
344
2113
  paths: {
345
- ..._.paths,
346
- [c]: {
347
- ..._.paths[c],
2114
+ ...m.paths,
2115
+ [i]: {
2116
+ ...m.paths[i],
348
2117
  [n]: {
349
- ...p,
350
- description: h.target.value
2118
+ ...d,
2119
+ description: k.target.value
351
2120
  }
352
2121
  }
353
2122
  }
354
2123
  })),
355
- disabled: u,
2124
+ disabled: b,
356
2125
  rows: 3
357
2126
  }
358
2127
  )
359
2128
  ] }),
360
2129
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
361
- /* @__PURE__ */ e("label", { children: "Operation ID" }),
362
- /* @__PURE__ */ e(
2130
+ /* @__PURE__ */ r("label", { children: "Operation ID" }),
2131
+ /* @__PURE__ */ r(
363
2132
  "input",
364
2133
  {
365
2134
  type: "text",
366
- value: p.operationId || "",
367
- onChange: (h) => b((_) => ({
368
- ..._,
2135
+ value: d.operationId || "",
2136
+ onChange: (k) => y((m) => ({
2137
+ ...m,
369
2138
  paths: {
370
- ..._.paths,
371
- [c]: {
372
- ..._.paths[c],
2139
+ ...m.paths,
2140
+ [i]: {
2141
+ ...m.paths[i],
373
2142
  [n]: {
374
- ...p,
375
- operationId: h.target.value
2143
+ ...d,
2144
+ operationId: k.target.value
376
2145
  }
377
2146
  }
378
2147
  }
379
2148
  })),
380
- disabled: u
2149
+ disabled: b
381
2150
  }
382
2151
  )
383
2152
  ] }),
384
- !u && /* @__PURE__ */ e(
2153
+ !b && /* @__PURE__ */ r(
385
2154
  "button",
386
2155
  {
387
2156
  className: "nice-api-designer__delete-btn",
388
- onClick: () => o(c),
2157
+ onClick: () => f(i),
389
2158
  children: "Delete Endpoint"
390
2159
  }
391
2160
  )
392
2161
  ] })
393
2162
  ] });
394
2163
  }
395
- function de({
396
- schemas: i,
2164
+ function Je({
2165
+ schemas: e,
397
2166
  onAdd: a,
398
- onChange: c,
2167
+ onChange: i,
399
2168
  readOnly: n
400
2169
  }) {
401
- const [r, d] = w(null);
2170
+ const [s, u] = g(null);
402
2171
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__schemas-editor", children: [
403
2172
  /* @__PURE__ */ t("div", { className: "nice-api-designer__schemas-list", children: [
404
2173
  /* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
405
- /* @__PURE__ */ e("h3", { children: "Schemas" }),
406
- !n && /* @__PURE__ */ e("button", { onClick: a, children: "+ Add" })
2174
+ /* @__PURE__ */ r("h3", { children: "Schemas" }),
2175
+ !n && /* @__PURE__ */ r("button", { onClick: a, children: "+ Add" })
407
2176
  ] }),
408
- Object.keys(i).map((o) => /* @__PURE__ */ e(
2177
+ Object.keys(e).map((f) => /* @__PURE__ */ r(
409
2178
  "div",
410
2179
  {
411
- className: `nice-api-designer__schema-item ${r === o ? "nice-api-designer__schema-item--selected" : ""}`,
412
- onClick: () => d(o),
413
- children: o
2180
+ className: `nice-api-designer__schema-item ${s === f ? "nice-api-designer__schema-item--selected" : ""}`,
2181
+ onClick: () => u(f),
2182
+ children: f
414
2183
  },
415
- o
2184
+ f
416
2185
  ))
417
2186
  ] }),
418
- r && i[r] && /* @__PURE__ */ t("div", { className: "nice-api-designer__schema-editor", children: [
419
- /* @__PURE__ */ e("h3", { children: r }),
2187
+ s && e[s] && /* @__PURE__ */ t("div", { className: "nice-api-designer__schema-editor", children: [
2188
+ /* @__PURE__ */ r("h3", { children: s }),
420
2189
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
421
- /* @__PURE__ */ e("label", { children: "Type" }),
2190
+ /* @__PURE__ */ r("label", { children: "Type" }),
422
2191
  /* @__PURE__ */ t(
423
2192
  "select",
424
2193
  {
425
- value: i[r].type || "object",
426
- onChange: (o) => c({
427
- ...i,
428
- [r]: {
429
- ...i[r],
430
- type: o.target.value
2194
+ value: e[s].type || "object",
2195
+ onChange: (f) => i({
2196
+ ...e,
2197
+ [s]: {
2198
+ ...e[s],
2199
+ type: f.target.value
431
2200
  }
432
2201
  }),
433
2202
  disabled: n,
434
2203
  children: [
435
- /* @__PURE__ */ e("option", { value: "object", children: "object" }),
436
- /* @__PURE__ */ e("option", { value: "array", children: "array" }),
437
- /* @__PURE__ */ e("option", { value: "string", children: "string" }),
438
- /* @__PURE__ */ e("option", { value: "number", children: "number" }),
439
- /* @__PURE__ */ e("option", { value: "integer", children: "integer" }),
440
- /* @__PURE__ */ e("option", { value: "boolean", children: "boolean" })
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" })
441
2210
  ]
442
2211
  }
443
2212
  )
444
2213
  ] }),
445
2214
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
446
- /* @__PURE__ */ e("label", { children: "Description" }),
447
- /* @__PURE__ */ e(
2215
+ /* @__PURE__ */ r("label", { children: "Description" }),
2216
+ /* @__PURE__ */ r(
448
2217
  "textarea",
449
2218
  {
450
- value: i[r].description || "",
451
- onChange: (o) => c({
452
- ...i,
453
- [r]: { ...i[r], description: o.target.value }
2219
+ value: e[s].description || "",
2220
+ onChange: (f) => i({
2221
+ ...e,
2222
+ [s]: { ...e[s], description: f.target.value }
454
2223
  }),
455
2224
  disabled: n,
456
2225
  rows: 3
@@ -458,15 +2227,15 @@ function de({
458
2227
  )
459
2228
  ] }),
460
2229
  /* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
461
- /* @__PURE__ */ e("label", { children: "JSON Schema" }),
462
- /* @__PURE__ */ e(
2230
+ /* @__PURE__ */ r("label", { children: "JSON Schema" }),
2231
+ /* @__PURE__ */ r(
463
2232
  "textarea",
464
2233
  {
465
- value: JSON.stringify(i[r], null, 2),
466
- onChange: (o) => {
2234
+ value: JSON.stringify(e[s], null, 2),
2235
+ onChange: (f) => {
467
2236
  try {
468
- const b = JSON.parse(o.target.value);
469
- c({ ...i, [r]: b });
2237
+ const y = JSON.parse(f.target.value);
2238
+ i({ ...e, [s]: y });
470
2239
  } catch {
471
2240
  }
472
2241
  },
@@ -479,30 +2248,39 @@ function de({
479
2248
  ] })
480
2249
  ] });
481
2250
  }
482
- function pe({ schemes: i, onChange: a, readOnly: c }) {
2251
+ function Ge({ schemes: e, onChange: a, readOnly: i }) {
483
2252
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__security-editor", children: [
484
2253
  /* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
485
- /* @__PURE__ */ e("h3", { children: "Security Schemes" }),
486
- !c && /* @__PURE__ */ e("button", { onClick: () => {
2254
+ /* @__PURE__ */ r("h3", { children: "Security Schemes" }),
2255
+ !i && /* @__PURE__ */ r("button", { onClick: () => {
487
2256
  a({
488
- ...i,
2257
+ ...e,
489
2258
  newScheme: { type: "apiKey", name: "X-API-Key", in: "header" }
490
2259
  });
491
2260
  }, children: "+ Add" })
492
2261
  ] }),
493
- Object.entries(i).map(([r, d]) => /* @__PURE__ */ t("div", { className: "nice-api-designer__security-item", children: [
494
- /* @__PURE__ */ e("h4", { children: r }),
495
- /* @__PURE__ */ e("pre", { children: JSON.stringify(d, null, 2) })
496
- ] }, r))
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))
497
2266
  ] });
498
2267
  }
499
- function ue({ schema: i }) {
2268
+ function Xe({ schema: e }) {
500
2269
  return /* @__PURE__ */ t("div", { className: "nice-api-designer__json-preview", children: [
501
- /* @__PURE__ */ e("h3", { children: "OpenAPI Specification" }),
502
- /* @__PURE__ */ e("pre", { className: "nice-api-designer__code", children: JSON.stringify(i, null, 2) })
2270
+ /* @__PURE__ */ r("h3", { children: "OpenAPI Specification" }),
2271
+ /* @__PURE__ */ r("pre", { className: "nice-api-designer__code", children: JSON.stringify(e, null, 2) })
503
2272
  ] });
504
2273
  }
505
- const he = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], me = {
2274
+ const Ye = [
2275
+ {
2276
+ target: ".nice-api-tester",
2277
+ titleKey: "tutorial.apiTester.intro.title",
2278
+ title: "API tester",
2279
+ contentKey: "tutorial.apiTester.intro.content",
2280
+ content: "Build requests with collections and environment variables, send them and assert on the responses.",
2281
+ placement: "auto"
2282
+ }
2283
+ ], Qe = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], Ze = {
506
2284
  id: "",
507
2285
  name: "New Request",
508
2286
  method: "GET",
@@ -510,334 +2288,336 @@ const he = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], me = {
510
2288
  headers: {},
511
2289
  queryParams: {}
512
2290
  };
513
- function Q(i, a) {
514
- return i.replace(/\{\{(\w+)\}\}/g, (c, n) => a[n] || `{{${n}}}`);
2291
+ function ne(e, a) {
2292
+ return e.replace(/\{\{(\w+)\}\}/g, (i, n) => a[n] || `{{${n}}}`);
515
2293
  }
516
- function _e(i, a) {
517
- const c = Object.entries(a).filter(([, n]) => n).map(([n, r]) => `${encodeURIComponent(n)}=${encodeURIComponent(r)}`).join("&");
518
- return c ? `${i}?${c}` : i;
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;
519
2297
  }
520
- function Oe({
521
- collections: i = [],
2298
+ function wr({
2299
+ collections: e = [],
522
2300
  environments: a = [],
523
- onRequest: c,
2301
+ onRequest: i,
524
2302
  onSaveCollection: n,
525
- className: r = ""
2303
+ className: s = "",
2304
+ tutorial: u
526
2305
  }) {
527
- const [d, o] = w(i), [b, u] = w(a), [p, x] = w(
528
- a.find((s) => s.isActive) || null
529
- ), [h, _] = w({
530
- ...me,
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,
531
2310
  id: crypto.randomUUID()
532
- }), [S, C] = w(null), [E, $] = w(!1), [I, F] = w("none"), [P, j] = w(
2311
+ }), [_, I] = g(null), [H, j] = g(!1), [K, G] = g("none"), [$, U] = g(
533
2312
  "params"
534
- ), [O, q] = w("body"), [v, f] = w(""), [N, U] = w(""), [L, V] = w([]), [H, J] = w([]), K = Z(null), z = T(async () => {
535
- var B;
536
- if (!h.url)
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;
2315
+ if (!m.url)
537
2316
  return;
538
- $(!0), C(null), V([]);
539
- const s = Object.fromEntries(
540
- Object.entries((p == null ? void 0 : p.variables) || {}).map(([A, D]) => [A, D.value])
541
- ), g = {
542
- ...h,
543
- url: Q(h.url, s),
2317
+ j(!0), I(null), z([]);
2318
+ const c = Object.fromEntries(
2319
+ Object.entries((v == null ? void 0 : v.variables) || {}).map(([E, A]) => [E, A.value])
2320
+ ), o = {
2321
+ ...m,
2322
+ url: ne(m.url, c),
544
2323
  headers: Object.fromEntries(
545
- Object.entries(h.headers).map(([A, D]) => [A, Q(D, s)])
2324
+ Object.entries(m.headers).map(([E, A]) => [E, ne(A, c)])
546
2325
  ),
547
2326
  queryParams: Object.fromEntries(
548
- Object.entries(h.queryParams).map(([A, D]) => [
549
- A,
550
- Q(D, s)
2327
+ Object.entries(m.queryParams).map(([E, A]) => [
2328
+ E,
2329
+ ne(A, c)
551
2330
  ])
552
2331
  )
553
- }, k = performance.now();
2332
+ }, N = performance.now();
554
2333
  try {
555
- let A;
556
- if (c)
557
- A = await c(g);
2334
+ let E;
2335
+ if (i)
2336
+ E = await i(o);
558
2337
  else {
559
- K.current = new AbortController();
560
- const D = { ...g.headers };
561
- h.auth && ge(D, h.auth);
562
- const ae = _e(g.url, g.queryParams), ee = {
563
- method: g.method,
564
- headers: D,
565
- signal: K.current.signal
2338
+ F.current = new AbortController();
2339
+ const A = { ...o.headers };
2340
+ m.auth && rr(A, m.auth);
2341
+ const Se = er(o.url, o.queryParams), oe = {
2342
+ method: o.method,
2343
+ headers: A,
2344
+ signal: F.current.signal
566
2345
  };
567
- ["POST", "PUT", "PATCH"].includes(g.method) && ((B = h.body) != null && B.content) && (ee.body = typeof h.body.content == "string" ? h.body.content : JSON.stringify(h.body.content), h.body.type === "json" && (D["Content-Type"] = "application/json"));
568
- const M = await fetch(ae, ee), X = await M.text();
569
- let Y;
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" && (A["Content-Type"] = "application/json"));
2347
+ const Z = await fetch(Se, oe), ae = await Z.text();
2348
+ let ie;
570
2349
  try {
571
- Y = JSON.parse(X);
2350
+ ie = JSON.parse(ae);
572
2351
  } catch {
573
- Y = X;
2352
+ ie = ae;
574
2353
  }
575
- const re = performance.now();
576
- A = {
577
- status: M.status,
578
- statusText: M.statusText,
579
- headers: Object.fromEntries(M.headers.entries()),
580
- body: Y,
581
- time: Math.round(re - k),
582
- size: new Blob([X]).size,
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,
583
2362
  timestamp: /* @__PURE__ */ new Date()
584
2363
  };
585
2364
  }
586
- if (C(A), J(
587
- (D) => [...D, { request: h, response: A }].slice(-50)
588
- ), N) {
589
- const D = ve(N, A);
590
- V(D);
2365
+ if (I(E), X(
2366
+ (A) => [...A, { request: m, response: E }].slice(-50)
2367
+ ), S) {
2368
+ const A = ir(S, E);
2369
+ z(A);
591
2370
  }
592
- } catch (A) {
593
- A.name !== "AbortError" && C({
2371
+ } catch (E) {
2372
+ E.name !== "AbortError" && I({
594
2373
  status: 0,
595
2374
  statusText: "Error",
596
2375
  headers: {},
597
- body: { error: A.message },
598
- time: Math.round(performance.now() - k),
2376
+ body: { error: E.message },
2377
+ time: Math.round(performance.now() - N),
599
2378
  size: 0,
600
2379
  timestamp: /* @__PURE__ */ new Date()
601
2380
  });
602
2381
  } finally {
603
- $(!1), K.current = null;
2382
+ j(!1), F.current = null;
604
2383
  }
605
- }, [h, p, c, N]), G = T(() => {
606
- var s;
607
- (s = K.current) == null || s.abort(), $(!1);
608
- }, []), l = T(() => {
609
- _((s) => ({
610
- ...s,
611
- headers: { ...s.headers, "": "" }
2384
+ }, [m, v, i, S]), Y = P(() => {
2385
+ var c;
2386
+ (c = F.current) == null || c.abort(), j(!1);
2387
+ }, []), p = P(() => {
2388
+ T((c) => ({
2389
+ ...c,
2390
+ headers: { ...c.headers, "": "" }
612
2391
  }));
613
- }, []), m = T(() => {
614
- _((s) => ({
615
- ...s,
616
- queryParams: { ...s.queryParams, "": "" }
2392
+ }, []), h = P(() => {
2393
+ T((c) => ({
2394
+ ...c,
2395
+ queryParams: { ...c.queryParams, "": "" }
617
2396
  }));
618
- }, []), y = T(() => {
619
- if (d.length === 0) {
620
- const s = {
2397
+ }, []), C = P(() => {
2398
+ if (f.length === 0) {
2399
+ const c = {
621
2400
  id: crypto.randomUUID(),
622
2401
  name: "My Collection",
623
- requests: [h]
2402
+ requests: [m]
624
2403
  };
625
- o([s]), n == null || n(s);
2404
+ y([c]), n == null || n(c);
626
2405
  } else {
627
- const s = {
628
- ...d[0],
629
- requests: [...d[0].requests, h]
2406
+ const c = {
2407
+ ...f[0],
2408
+ requests: [...f[0].requests, m]
630
2409
  };
631
- o((g) => [s, ...g.slice(1)]), n == null || n(s);
2410
+ y((o) => [c, ...o.slice(1)]), n == null || n(c);
632
2411
  }
633
- }, [d, h, n]);
634
- return /* @__PURE__ */ t("div", { className: `nice-api-tester ${r}`, children: [
635
- /* @__PURE__ */ e("div", { className: "nice-api-tester__toolbar", children: /* @__PURE__ */ e("div", { className: "nice-api-tester__env-selector", children: /* @__PURE__ */ t(
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(
636
2416
  "select",
637
2417
  {
638
- value: (p == null ? void 0 : p.id) || "",
639
- onChange: (s) => x(b.find((g) => g.id === s.target.value) || null),
2418
+ value: (v == null ? void 0 : v.id) || "",
2419
+ onChange: (c) => k(b.find((o) => o.id === c.target.value) || null),
640
2420
  children: [
641
- /* @__PURE__ */ e("option", { value: "", children: "No Environment" }),
642
- b.map((s) => /* @__PURE__ */ e("option", { value: s.id, children: s.name }, s.id))
2421
+ /* @__PURE__ */ r("option", { value: "", children: "No Environment" }),
2422
+ b.map((c) => /* @__PURE__ */ r("option", { value: c.id, children: c.name }, c.id))
643
2423
  ]
644
2424
  }
645
2425
  ) }) }),
646
2426
  /* @__PURE__ */ t("div", { className: "nice-api-tester__request-bar", children: [
647
- /* @__PURE__ */ e(
2427
+ /* @__PURE__ */ r(
648
2428
  "select",
649
2429
  {
650
- value: h.method,
651
- onChange: (s) => _((g) => ({
652
- ...g,
653
- method: s.target.value
2430
+ value: m.method,
2431
+ onChange: (c) => T((o) => ({
2432
+ ...o,
2433
+ method: c.target.value
654
2434
  })),
655
- className: `nice-api-tester__method nice-api-tester__method--${h.method.toLowerCase()}`,
656
- children: he.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
2435
+ 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))
657
2437
  }
658
2438
  ),
659
- /* @__PURE__ */ e(
2439
+ /* @__PURE__ */ r(
660
2440
  "input",
661
2441
  {
662
2442
  type: "text",
663
- value: h.url,
664
- onChange: (s) => _((g) => ({ ...g, url: s.target.value })),
2443
+ value: m.url,
2444
+ onChange: (c) => T((o) => ({ ...o, url: c.target.value })),
665
2445
  placeholder: "Enter request URL",
666
2446
  className: "nice-api-tester__url-input"
667
2447
  }
668
2448
  ),
669
- /* @__PURE__ */ e(
2449
+ /* @__PURE__ */ r(
670
2450
  "button",
671
2451
  {
672
- onClick: E ? G : z,
673
- className: `nice-api-tester__send-btn ${E ? "nice-api-tester__send-btn--loading" : ""}`,
674
- children: E ? "Cancel" : "Send"
2452
+ onClick: H ? Y : Q,
2453
+ className: `nice-api-tester__send-btn ${H ? "nice-api-tester__send-btn--loading" : ""}`,
2454
+ children: H ? "Cancel" : "Send"
675
2455
  }
676
2456
  ),
677
- /* @__PURE__ */ e("button", { onClick: y, className: "nice-api-tester__save-btn", children: "Save" })
2457
+ /* @__PURE__ */ r("button", { onClick: C, className: "nice-api-tester__save-btn", children: "Save" })
678
2458
  ] }),
679
2459
  /* @__PURE__ */ t("div", { className: "nice-api-tester__main", children: [
680
2460
  /* @__PURE__ */ t("div", { className: "nice-api-tester__request-panel", children: [
681
- /* @__PURE__ */ e("div", { className: "nice-api-tester__tabs", children: ["params", "headers", "body", "auth", "tests"].map((s) => /* @__PURE__ */ e(
2461
+ /* @__PURE__ */ r("div", { className: "nice-api-tester__tabs", children: ["params", "headers", "body", "auth", "tests"].map((c) => /* @__PURE__ */ r(
682
2462
  "button",
683
2463
  {
684
- className: `nice-api-tester__tab ${P === s ? "nice-api-tester__tab--active" : ""}`,
685
- onClick: () => j(s),
686
- children: s.charAt(0).toUpperCase() + s.slice(1)
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)
687
2467
  },
688
- s
2468
+ c
689
2469
  )) }),
690
2470
  /* @__PURE__ */ t("div", { className: "nice-api-tester__tab-content", children: [
691
- P === "params" && /* @__PURE__ */ e(
692
- fe,
2471
+ $ === "params" && /* @__PURE__ */ r(
2472
+ nr,
693
2473
  {
694
- params: h.queryParams,
695
- onChange: (s) => _((g) => ({ ...g, queryParams: s })),
696
- onAdd: m
2474
+ params: m.queryParams,
2475
+ onChange: (c) => T((o) => ({ ...o, queryParams: c })),
2476
+ onAdd: h
697
2477
  }
698
2478
  ),
699
- P === "headers" && /* @__PURE__ */ e(
700
- ye,
2479
+ $ === "headers" && /* @__PURE__ */ r(
2480
+ tr,
701
2481
  {
702
- headers: h.headers,
703
- onChange: (s) => _((g) => ({ ...g, headers: s })),
704
- onAdd: l
2482
+ headers: m.headers,
2483
+ onChange: (c) => T((o) => ({ ...o, headers: c })),
2484
+ onAdd: p
705
2485
  }
706
2486
  ),
707
- P === "body" && /* @__PURE__ */ e(
708
- Ne,
2487
+ $ === "body" && /* @__PURE__ */ r(
2488
+ sr,
709
2489
  {
710
- body: h.body,
711
- bodyTab: I,
712
- onBodyTabChange: F,
713
- onChange: (s) => _((g) => ({ ...g, body: s }))
2490
+ body: m.body,
2491
+ bodyTab: K,
2492
+ onBodyTabChange: G,
2493
+ onChange: (c) => T((o) => ({ ...o, body: c }))
714
2494
  }
715
2495
  ),
716
- P === "auth" && /* @__PURE__ */ e(
717
- we,
2496
+ $ === "auth" && /* @__PURE__ */ r(
2497
+ cr,
718
2498
  {
719
- auth: h.auth,
720
- onChange: (s) => _((g) => ({ ...g, auth: s }))
2499
+ auth: m.auth,
2500
+ onChange: (c) => T((o) => ({ ...o, auth: c }))
721
2501
  }
722
2502
  ),
723
- P === "tests" && /* @__PURE__ */ e(
724
- Ce,
2503
+ $ === "tests" && /* @__PURE__ */ r(
2504
+ or,
725
2505
  {
726
- preRequestScript: v,
727
- testScript: N,
728
- onPreRequestChange: f,
729
- onTestChange: U
2506
+ preRequestScript: w,
2507
+ testScript: S,
2508
+ onPreRequestChange: x,
2509
+ onTestChange: B
730
2510
  }
731
2511
  )
732
2512
  ] })
733
2513
  ] }),
734
- /* @__PURE__ */ e("div", { className: "nice-api-tester__response-panel", children: S ? /* @__PURE__ */ t(R, { children: [
2514
+ /* @__PURE__ */ r("div", { className: "nice-api-tester__response-panel", children: _ ? /* @__PURE__ */ t(J, { children: [
735
2515
  /* @__PURE__ */ t("div", { className: "nice-api-tester__response-meta", children: [
736
2516
  /* @__PURE__ */ t(
737
2517
  "span",
738
2518
  {
739
- className: `nice-api-tester__status nice-api-tester__status--${Math.floor(S.status / 100)}`,
2519
+ className: `nice-api-tester__status nice-api-tester__status--${Math.floor(_.status / 100)}`,
740
2520
  children: [
741
- S.status,
2521
+ _.status,
742
2522
  " ",
743
- S.statusText
2523
+ _.statusText
744
2524
  ]
745
2525
  }
746
2526
  ),
747
2527
  /* @__PURE__ */ t("span", { className: "nice-api-tester__time", children: [
748
- S.time,
2528
+ _.time,
749
2529
  "ms"
750
2530
  ] }),
751
- /* @__PURE__ */ e("span", { className: "nice-api-tester__size", children: be(S.size) })
2531
+ /* @__PURE__ */ r("span", { className: "nice-api-tester__size", children: ar(_.size) })
752
2532
  ] }),
753
- /* @__PURE__ */ e("div", { className: "nice-api-tester__tabs", children: ["body", "headers", "tests"].map((s) => /* @__PURE__ */ t(
2533
+ /* @__PURE__ */ r("div", { className: "nice-api-tester__tabs", children: ["body", "headers", "tests"].map((c) => /* @__PURE__ */ t(
754
2534
  "button",
755
2535
  {
756
- className: `nice-api-tester__tab ${O === s ? "nice-api-tester__tab--active" : ""}`,
757
- onClick: () => q(s),
2536
+ className: `nice-api-tester__tab ${O === c ? "nice-api-tester__tab--active" : ""}`,
2537
+ onClick: () => q(c),
758
2538
  children: [
759
- s.charAt(0).toUpperCase() + s.slice(1),
760
- s === "tests" && L.length > 0 && /* @__PURE__ */ t("span", { className: "nice-api-tester__test-badge", children: [
761
- L.filter((g) => g.passed).length,
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,
762
2542
  "/",
763
- L.length
2543
+ V.length
764
2544
  ] })
765
2545
  ]
766
2546
  },
767
- s
2547
+ c
768
2548
  )) }),
769
2549
  /* @__PURE__ */ t("div", { className: "nice-api-tester__response-content", children: [
770
- O === "body" && /* @__PURE__ */ e("pre", { className: "nice-api-tester__response-body", children: typeof S.body == "string" ? S.body : JSON.stringify(S.body, null, 2) }),
771
- O === "headers" && /* @__PURE__ */ e("div", { className: "nice-api-tester__response-headers", children: Object.entries(S.headers).map(([s, g]) => /* @__PURE__ */ t("div", { className: "nice-api-tester__header-row", children: [
772
- /* @__PURE__ */ e("span", { className: "nice-api-tester__header-key", children: s }),
773
- /* @__PURE__ */ e("span", { className: "nice-api-tester__header-value", children: g })
774
- ] }, s)) }),
775
- O === "tests" && /* @__PURE__ */ e("div", { className: "nice-api-tester__test-results", children: L.map((s, g) => /* @__PURE__ */ t(
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(
776
2556
  "div",
777
2557
  {
778
- className: `nice-api-tester__test-result nice-api-tester__test-result--${s.passed ? "pass" : "fail"}`,
2558
+ className: `nice-api-tester__test-result nice-api-tester__test-result--${c.passed ? "pass" : "fail"}`,
779
2559
  children: [
780
- /* @__PURE__ */ e("span", { className: "nice-api-tester__test-icon", children: s.passed ? "✓" : "✗" }),
781
- /* @__PURE__ */ e("span", { className: "nice-api-tester__test-name", children: s.name }),
782
- s.message && /* @__PURE__ */ e("span", { className: "nice-api-tester__test-message", children: s.message })
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 })
783
2563
  ]
784
2564
  },
785
- g
2565
+ o
786
2566
  )) })
787
2567
  ] })
788
- ] }) : /* @__PURE__ */ e("div", { className: "nice-api-tester__empty-response", children: E ? "Loading..." : "Send a request to see the response" }) })
2568
+ ] }) : /* @__PURE__ */ r("div", { className: "nice-api-tester__empty-response", children: H ? "Loading..." : "Send a request to see the response" }) })
789
2569
  ] }),
790
- H.length > 0 && /* @__PURE__ */ t("div", { className: "nice-api-tester__history", children: [
791
- /* @__PURE__ */ e("h4", { children: "History" }),
792
- /* @__PURE__ */ e("div", { className: "nice-api-tester__history-list", children: H.slice().reverse().map(({ request: s, response: g }, k) => /* @__PURE__ */ t(
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(
793
2573
  "div",
794
2574
  {
795
2575
  className: "nice-api-tester__history-item",
796
- onClick: () => _(s),
2576
+ onClick: () => T(c),
797
2577
  children: [
798
- /* @__PURE__ */ e(
2578
+ /* @__PURE__ */ r(
799
2579
  "span",
800
2580
  {
801
- className: `nice-api-tester__method nice-api-tester__method--${s.method.toLowerCase()}`,
802
- children: s.method
2581
+ className: `nice-api-tester__method nice-api-tester__method--${c.method.toLowerCase()}`,
2582
+ children: c.method
803
2583
  }
804
2584
  ),
805
- /* @__PURE__ */ e("span", { className: "nice-api-tester__history-url", children: s.url }),
806
- /* @__PURE__ */ e(
2585
+ /* @__PURE__ */ r("span", { className: "nice-api-tester__history-url", children: c.url }),
2586
+ /* @__PURE__ */ r(
807
2587
  "span",
808
2588
  {
809
2589
  className: `nice-api-tester__status nice-api-tester__status--${Math.floor(
810
- g.status / 100
2590
+ o.status / 100
811
2591
  )}`,
812
- children: g.status
2592
+ children: o.status
813
2593
  }
814
2594
  )
815
2595
  ]
816
2596
  },
817
- k
2597
+ N
818
2598
  )) })
819
2599
  ] })
820
2600
  ] });
821
2601
  }
822
- function ge(i, a) {
823
- var c, n, r, d, o;
2602
+ function rr(e, a) {
2603
+ var i, n, s, u, f;
824
2604
  switch (a.type) {
825
2605
  case "bearer":
826
- i.Authorization = `${((c = a.bearer) == null ? void 0 : c.prefix) || "Bearer"} ${(n = a.bearer) == null ? void 0 : n.token}`;
2606
+ e.Authorization = `${((i = a.bearer) == null ? void 0 : i.prefix) || "Bearer"} ${(n = a.bearer) == null ? void 0 : n.token}`;
827
2607
  break;
828
2608
  case "basic":
829
- i.Authorization = `Basic ${btoa(`${(r = a.basic) == null ? void 0 : r.username}:${(d = a.basic) == null ? void 0 : d.password}`)}`;
2609
+ e.Authorization = `Basic ${btoa(`${(s = a.basic) == null ? void 0 : s.username}:${(u = a.basic) == null ? void 0 : u.password}`)}`;
830
2610
  break;
831
2611
  case "api-key":
832
- ((o = a.apiKey) == null ? void 0 : o.in) === "header" && (i[a.apiKey.key] = a.apiKey.value);
2612
+ ((f = a.apiKey) == null ? void 0 : f.in) === "header" && (e[a.apiKey.key] = a.apiKey.value);
833
2613
  break;
834
2614
  }
835
2615
  }
836
- function be(i) {
837
- return i < 1024 ? `${i} B` : i < 1024 * 1024 ? `${(i / 1024).toFixed(1)} KB` : `${(i / (1024 * 1024)).toFixed(1)} MB`;
2616
+ function ar(e) {
2617
+ return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
838
2618
  }
839
- function ve(i, a) {
840
- const c = [], n = {
2619
+ function ir(e, a) {
2620
+ const i = [], n = {
841
2621
  response: {
842
2622
  code: a.status,
843
2623
  status: a.statusText,
@@ -846,153 +2626,153 @@ function ve(i, a) {
846
2626
  text: () => typeof a.body == "string" ? a.body : JSON.stringify(a.body),
847
2627
  responseTime: a.time
848
2628
  },
849
- test: (r, d) => {
850
- const o = performance.now();
2629
+ test: (s, u) => {
2630
+ const f = performance.now();
851
2631
  try {
852
- d(), c.push({ name: r, passed: !0, duration: performance.now() - o });
853
- } catch (b) {
854
- c.push({
855
- name: r,
2632
+ u(), i.push({ name: s, passed: !0, duration: performance.now() - f });
2633
+ } catch (y) {
2634
+ i.push({
2635
+ name: s,
856
2636
  passed: !1,
857
- message: b.message,
858
- duration: performance.now() - o
2637
+ message: y.message,
2638
+ duration: performance.now() - f
859
2639
  });
860
2640
  }
861
2641
  },
862
- expect: (r) => ({
2642
+ expect: (s) => ({
863
2643
  to: {
864
- equal: (d) => {
865
- if (r !== d)
866
- throw new Error(`Expected ${d} but got ${r}`);
2644
+ equal: (u) => {
2645
+ if (s !== u)
2646
+ throw new Error(`Expected ${u} but got ${s}`);
867
2647
  },
868
2648
  be: {
869
- oneOf: (d) => {
870
- if (!d.includes(r))
871
- throw new Error(`Expected ${r} to be one of ${d}`);
2649
+ oneOf: (u) => {
2650
+ if (!u.includes(s))
2651
+ throw new Error(`Expected ${s} to be one of ${u}`);
872
2652
  }
873
2653
  },
874
2654
  have: {
875
- property: (d) => {
876
- if (typeof r != "object" || r === null || !(d in r))
877
- throw new Error(`Expected object to have property ${d}`);
2655
+ property: (u) => {
2656
+ if (typeof s != "object" || s === null || !(u in s))
2657
+ throw new Error(`Expected object to have property ${u}`);
878
2658
  }
879
2659
  }
880
2660
  }
881
2661
  })
882
2662
  };
883
2663
  try {
884
- new Function("pm", i)(n);
885
- } catch (r) {
886
- c.push({
2664
+ new Function("pm", e)(n);
2665
+ } catch (s) {
2666
+ i.push({
887
2667
  name: "Script Error",
888
2668
  passed: !1,
889
- message: r.message,
2669
+ message: s.message,
890
2670
  duration: 0
891
2671
  });
892
2672
  }
893
- return c;
2673
+ return i;
894
2674
  }
895
- function te({
896
- items: i,
2675
+ function xe({
2676
+ items: e,
897
2677
  onChange: a,
898
- onAdd: c,
2678
+ onAdd: i,
899
2679
  keyPlaceholder: n = "Key",
900
- valuePlaceholder: r = "Value"
2680
+ valuePlaceholder: s = "Value"
901
2681
  }) {
902
2682
  return /* @__PURE__ */ t("div", { className: "nice-api-tester__kv-editor", children: [
903
- Object.entries(i).map(([d, o], b) => /* @__PURE__ */ t("div", { className: "nice-api-tester__kv-row", children: [
904
- /* @__PURE__ */ e(
2683
+ Object.entries(e).map(([u, f], y) => /* @__PURE__ */ t("div", { className: "nice-api-tester__kv-row", children: [
2684
+ /* @__PURE__ */ r(
905
2685
  "input",
906
2686
  {
907
2687
  type: "text",
908
- value: d,
2688
+ value: u,
909
2689
  placeholder: n,
910
- onChange: (u) => {
911
- const p = Object.entries(i);
912
- p[b] = [u.target.value, o], a(Object.fromEntries(p));
2690
+ onChange: (b) => {
2691
+ const d = Object.entries(e);
2692
+ d[y] = [b.target.value, f], a(Object.fromEntries(d));
913
2693
  }
914
2694
  }
915
2695
  ),
916
- /* @__PURE__ */ e(
2696
+ /* @__PURE__ */ r(
917
2697
  "input",
918
2698
  {
919
2699
  type: "text",
920
- value: o,
921
- placeholder: r,
922
- onChange: (u) => a({ ...i, [d]: u.target.value })
2700
+ value: f,
2701
+ placeholder: s,
2702
+ onChange: (b) => a({ ...e, [u]: b.target.value })
923
2703
  }
924
2704
  ),
925
- /* @__PURE__ */ e(
2705
+ /* @__PURE__ */ r(
926
2706
  "button",
927
2707
  {
928
2708
  onClick: () => {
929
- const { [d]: u, ...p } = i;
930
- a(p);
2709
+ const { [u]: b, ...d } = e;
2710
+ a(d);
931
2711
  },
932
2712
  children: "×"
933
2713
  }
934
2714
  )
935
- ] }, b)),
936
- /* @__PURE__ */ e("button", { onClick: c, className: "nice-api-tester__add-btn", children: "+ Add" })
2715
+ ] }, y)),
2716
+ /* @__PURE__ */ r("button", { onClick: i, className: "nice-api-tester__add-btn", children: "+ Add" })
937
2717
  ] });
938
2718
  }
939
- function fe({
940
- params: i,
2719
+ function nr({
2720
+ params: e,
941
2721
  onChange: a,
942
- onAdd: c
2722
+ onAdd: i
943
2723
  }) {
944
- return /* @__PURE__ */ e(
945
- te,
2724
+ return /* @__PURE__ */ r(
2725
+ xe,
946
2726
  {
947
- items: i,
2727
+ items: e,
948
2728
  onChange: a,
949
- onAdd: c,
2729
+ onAdd: i,
950
2730
  keyPlaceholder: "Parameter",
951
2731
  valuePlaceholder: "Value"
952
2732
  }
953
2733
  );
954
2734
  }
955
- function ye({
956
- headers: i,
2735
+ function tr({
2736
+ headers: e,
957
2737
  onChange: a,
958
- onAdd: c
2738
+ onAdd: i
959
2739
  }) {
960
- return /* @__PURE__ */ e(
961
- te,
2740
+ return /* @__PURE__ */ r(
2741
+ xe,
962
2742
  {
963
- items: i,
2743
+ items: e,
964
2744
  onChange: a,
965
- onAdd: c,
2745
+ onAdd: i,
966
2746
  keyPlaceholder: "Header",
967
2747
  valuePlaceholder: "Value"
968
2748
  }
969
2749
  );
970
2750
  }
971
- function Ne({
972
- body: i,
2751
+ function sr({
2752
+ body: e,
973
2753
  bodyTab: a,
974
- onBodyTabChange: c,
2754
+ onBodyTabChange: i,
975
2755
  onChange: n
976
2756
  }) {
977
2757
  return /* @__PURE__ */ t("div", { className: "nice-api-tester__body-editor", children: [
978
- /* @__PURE__ */ e("div", { className: "nice-api-tester__body-tabs", children: ["none", "json", "form-data", "raw"].map((r) => /* @__PURE__ */ t("label", { children: [
979
- /* @__PURE__ */ e(
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(
980
2760
  "input",
981
2761
  {
982
2762
  type: "radio",
983
- checked: a === r,
2763
+ checked: a === s,
984
2764
  onChange: () => {
985
- c(r), n({ type: r, content: "" });
2765
+ i(s), n({ type: s, content: "" });
986
2766
  }
987
2767
  }
988
2768
  ),
989
- r
990
- ] }, r)) }),
991
- a !== "none" && /* @__PURE__ */ e(
2769
+ s
2770
+ ] }, s)) }),
2771
+ a !== "none" && /* @__PURE__ */ r(
992
2772
  "textarea",
993
2773
  {
994
- value: typeof (i == null ? void 0 : i.content) == "string" ? i.content : JSON.stringify(i == null ? void 0 : i.content, null, 2),
995
- onChange: (r) => n({ type: a, content: r.target.value }),
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 }),
996
2776
  placeholder: a === "json" ? '{ "key": "value" }' : "Enter body content",
997
2777
  rows: 10,
998
2778
  className: "nice-api-tester__body-textarea"
@@ -1000,46 +2780,46 @@ function Ne({
1000
2780
  )
1001
2781
  ] });
1002
2782
  }
1003
- function we({
1004
- auth: i,
2783
+ function cr({
2784
+ auth: e,
1005
2785
  onChange: a
1006
2786
  }) {
1007
- var c, n, r, d, o, b;
2787
+ var i, n, s, u, f, y;
1008
2788
  return /* @__PURE__ */ t("div", { className: "nice-api-tester__auth-editor", children: [
1009
2789
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
1010
- /* @__PURE__ */ e("label", { children: "Type" }),
2790
+ /* @__PURE__ */ r("label", { children: "Type" }),
1011
2791
  /* @__PURE__ */ t(
1012
2792
  "select",
1013
2793
  {
1014
- value: (i == null ? void 0 : i.type) || "none",
1015
- onChange: (u) => a({ type: u.target.value }),
2794
+ value: (e == null ? void 0 : e.type) || "none",
2795
+ onChange: (b) => a({ type: b.target.value }),
1016
2796
  children: [
1017
- /* @__PURE__ */ e("option", { value: "none", children: "No Auth" }),
1018
- /* @__PURE__ */ e("option", { value: "api-key", children: "API Key" }),
1019
- /* @__PURE__ */ e("option", { value: "bearer", children: "Bearer Token" }),
1020
- /* @__PURE__ */ e("option", { value: "basic", children: "Basic Auth" }),
1021
- /* @__PURE__ */ e("option", { value: "oauth2", children: "OAuth 2.0" })
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" })
1022
2802
  ]
1023
2803
  }
1024
2804
  )
1025
2805
  ] }),
1026
- (i == null ? void 0 : i.type) === "api-key" && /* @__PURE__ */ t(R, { children: [
2806
+ (e == null ? void 0 : e.type) === "api-key" && /* @__PURE__ */ t(J, { children: [
1027
2807
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
1028
- /* @__PURE__ */ e("label", { children: "Key" }),
1029
- /* @__PURE__ */ e(
2808
+ /* @__PURE__ */ r("label", { children: "Key" }),
2809
+ /* @__PURE__ */ r(
1030
2810
  "input",
1031
2811
  {
1032
2812
  type: "text",
1033
- value: ((c = i.apiKey) == null ? void 0 : c.key) || "",
1034
- onChange: (u) => {
1035
- var p, x;
2813
+ value: ((i = e.apiKey) == null ? void 0 : i.key) || "",
2814
+ onChange: (b) => {
2815
+ var d, v;
1036
2816
  return a({
1037
- ...i,
2817
+ ...e,
1038
2818
  apiKey: {
1039
- ...i.apiKey,
1040
- key: u.target.value,
1041
- value: ((p = i.apiKey) == null ? void 0 : p.value) || "",
1042
- in: ((x = i.apiKey) == null ? void 0 : x.in) || "header"
2819
+ ...e.apiKey,
2820
+ 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"
1043
2823
  }
1044
2824
  });
1045
2825
  },
@@ -1048,21 +2828,21 @@ function we({
1048
2828
  )
1049
2829
  ] }),
1050
2830
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
1051
- /* @__PURE__ */ e("label", { children: "Value" }),
1052
- /* @__PURE__ */ e(
2831
+ /* @__PURE__ */ r("label", { children: "Value" }),
2832
+ /* @__PURE__ */ r(
1053
2833
  "input",
1054
2834
  {
1055
2835
  type: "text",
1056
- value: ((n = i.apiKey) == null ? void 0 : n.value) || "",
1057
- onChange: (u) => {
1058
- var p, x;
2836
+ value: ((n = e.apiKey) == null ? void 0 : n.value) || "",
2837
+ onChange: (b) => {
2838
+ var d, v;
1059
2839
  return a({
1060
- ...i,
2840
+ ...e,
1061
2841
  apiKey: {
1062
- ...i.apiKey,
1063
- value: u.target.value,
1064
- key: ((p = i.apiKey) == null ? void 0 : p.key) || "",
1065
- in: ((x = i.apiKey) == null ? void 0 : x.in) || "header"
2842
+ ...e.apiKey,
2843
+ 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"
1066
2846
  }
1067
2847
  });
1068
2848
  },
@@ -1071,59 +2851,59 @@ function we({
1071
2851
  )
1072
2852
  ] }),
1073
2853
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
1074
- /* @__PURE__ */ e("label", { children: "Add to" }),
2854
+ /* @__PURE__ */ r("label", { children: "Add to" }),
1075
2855
  /* @__PURE__ */ t(
1076
2856
  "select",
1077
2857
  {
1078
- value: ((r = i.apiKey) == null ? void 0 : r.in) || "header",
1079
- onChange: (u) => {
1080
- var p, x;
2858
+ value: ((s = e.apiKey) == null ? void 0 : s.in) || "header",
2859
+ onChange: (b) => {
2860
+ var d, v;
1081
2861
  return a({
1082
- ...i,
2862
+ ...e,
1083
2863
  apiKey: {
1084
- ...i.apiKey,
1085
- in: u.target.value,
1086
- key: ((p = i.apiKey) == null ? void 0 : p.key) || "",
1087
- value: ((x = i.apiKey) == null ? void 0 : x.value) || ""
2864
+ ...e.apiKey,
2865
+ in: b.target.value,
2866
+ key: ((d = e.apiKey) == null ? void 0 : d.key) || "",
2867
+ value: ((v = e.apiKey) == null ? void 0 : v.value) || ""
1088
2868
  }
1089
2869
  });
1090
2870
  },
1091
2871
  children: [
1092
- /* @__PURE__ */ e("option", { value: "header", children: "Header" }),
1093
- /* @__PURE__ */ e("option", { value: "query", children: "Query Params" })
2872
+ /* @__PURE__ */ r("option", { value: "header", children: "Header" }),
2873
+ /* @__PURE__ */ r("option", { value: "query", children: "Query Params" })
1094
2874
  ]
1095
2875
  }
1096
2876
  )
1097
2877
  ] })
1098
2878
  ] }),
1099
- (i == null ? void 0 : i.type) === "bearer" && /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
1100
- /* @__PURE__ */ e("label", { children: "Token" }),
1101
- /* @__PURE__ */ e(
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(
1102
2882
  "input",
1103
2883
  {
1104
2884
  type: "text",
1105
- value: ((d = i.bearer) == null ? void 0 : d.token) || "",
1106
- onChange: (u) => a({ ...i, bearer: { token: u.target.value } }),
2885
+ value: ((u = e.bearer) == null ? void 0 : u.token) || "",
2886
+ onChange: (b) => a({ ...e, bearer: { token: b.target.value } }),
1107
2887
  placeholder: "your-bearer-token"
1108
2888
  }
1109
2889
  )
1110
2890
  ] }),
1111
- (i == null ? void 0 : i.type) === "basic" && /* @__PURE__ */ t(R, { children: [
2891
+ (e == null ? void 0 : e.type) === "basic" && /* @__PURE__ */ t(J, { children: [
1112
2892
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
1113
- /* @__PURE__ */ e("label", { children: "Username" }),
1114
- /* @__PURE__ */ e(
2893
+ /* @__PURE__ */ r("label", { children: "Username" }),
2894
+ /* @__PURE__ */ r(
1115
2895
  "input",
1116
2896
  {
1117
2897
  type: "text",
1118
- value: ((o = i.basic) == null ? void 0 : o.username) || "",
1119
- onChange: (u) => {
1120
- var p;
2898
+ value: ((f = e.basic) == null ? void 0 : f.username) || "",
2899
+ onChange: (b) => {
2900
+ var d;
1121
2901
  return a({
1122
- ...i,
2902
+ ...e,
1123
2903
  basic: {
1124
- ...i.basic,
1125
- username: u.target.value,
1126
- password: ((p = i.basic) == null ? void 0 : p.password) || ""
2904
+ ...e.basic,
2905
+ username: b.target.value,
2906
+ password: ((d = e.basic) == null ? void 0 : d.password) || ""
1127
2907
  }
1128
2908
  });
1129
2909
  }
@@ -1131,20 +2911,20 @@ function we({
1131
2911
  )
1132
2912
  ] }),
1133
2913
  /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
1134
- /* @__PURE__ */ e("label", { children: "Password" }),
1135
- /* @__PURE__ */ e(
2914
+ /* @__PURE__ */ r("label", { children: "Password" }),
2915
+ /* @__PURE__ */ r(
1136
2916
  "input",
1137
2917
  {
1138
2918
  type: "password",
1139
- value: ((b = i.basic) == null ? void 0 : b.password) || "",
1140
- onChange: (u) => {
1141
- var p;
2919
+ value: ((y = e.basic) == null ? void 0 : y.password) || "",
2920
+ onChange: (b) => {
2921
+ var d;
1142
2922
  return a({
1143
- ...i,
2923
+ ...e,
1144
2924
  basic: {
1145
- ...i.basic,
1146
- password: u.target.value,
1147
- username: ((p = i.basic) == null ? void 0 : p.username) || ""
2925
+ ...e.basic,
2926
+ password: b.target.value,
2927
+ username: ((d = e.basic) == null ? void 0 : d.username) || ""
1148
2928
  }
1149
2929
  });
1150
2930
  }
@@ -1154,32 +2934,32 @@ function we({
1154
2934
  ] })
1155
2935
  ] });
1156
2936
  }
1157
- function Ce({
1158
- preRequestScript: i,
2937
+ function or({
2938
+ preRequestScript: e,
1159
2939
  testScript: a,
1160
- onPreRequestChange: c,
2940
+ onPreRequestChange: i,
1161
2941
  onTestChange: n
1162
2942
  }) {
1163
2943
  return /* @__PURE__ */ t("div", { className: "nice-api-tester__tests-editor", children: [
1164
2944
  /* @__PURE__ */ t("div", { className: "nice-api-tester__script-section", children: [
1165
- /* @__PURE__ */ e("h4", { children: "Pre-request Script" }),
1166
- /* @__PURE__ */ e(
2945
+ /* @__PURE__ */ r("h4", { children: "Pre-request Script" }),
2946
+ /* @__PURE__ */ r(
1167
2947
  "textarea",
1168
2948
  {
1169
- value: i,
1170
- onChange: (r) => c(r.target.value),
2949
+ value: e,
2950
+ onChange: (s) => i(s.target.value),
1171
2951
  placeholder: "// Code to run before the request",
1172
2952
  rows: 5
1173
2953
  }
1174
2954
  )
1175
2955
  ] }),
1176
2956
  /* @__PURE__ */ t("div", { className: "nice-api-tester__script-section", children: [
1177
- /* @__PURE__ */ e("h4", { children: "Tests" }),
1178
- /* @__PURE__ */ e(
2957
+ /* @__PURE__ */ r("h4", { children: "Tests" }),
2958
+ /* @__PURE__ */ r(
1179
2959
  "textarea",
1180
2960
  {
1181
2961
  value: a,
1182
- onChange: (r) => n(r.target.value),
2962
+ onChange: (s) => n(s.target.value),
1183
2963
  placeholder: `pm.test("Status code is 200", function () {
1184
2964
  pm.expect(pm.response.code).to.equal(200);
1185
2965
  });`,
@@ -1189,7 +2969,16 @@ function Ce({
1189
2969
  ] })
1190
2970
  ] });
1191
2971
  }
1192
- const W = [
2972
+ const dr = [
2973
+ {
2974
+ target: ".nice-integration-builder",
2975
+ titleKey: "tutorial.integrationBuilder.intro.title",
2976
+ title: "Integration builder",
2977
+ contentKey: "tutorial.integrationBuilder.intro.content",
2978
+ content: "Wire a flow of nodes (triggers → actions → error handling) and connect them to build an integration.",
2979
+ placement: "auto"
2980
+ }
2981
+ ], te = [
1193
2982
  { type: "trigger", label: "Trigger", icon: "⚡", category: "Control" },
1194
2983
  { type: "http-request", label: "HTTP Request", icon: "🌐", category: "Actions" },
1195
2984
  { type: "transform", label: "Transform", icon: "🔄", category: "Data" },
@@ -1203,7 +2992,7 @@ const W = [
1203
2992
  { type: "webhook", label: "Webhook", icon: "🔗", category: "Actions" },
1204
2993
  { type: "function", label: "Function", icon: "ƒ", category: "Actions" },
1205
2994
  { type: "error-handler", label: "Error Handler", icon: "⚠️", category: "Control" }
1206
- ], Ee = {
2995
+ ], lr = {
1207
2996
  id: "",
1208
2997
  name: "New Flow",
1209
2998
  nodes: [],
@@ -1212,245 +3001,247 @@ const W = [
1212
3001
  triggers: [],
1213
3002
  errorHandling: { strategy: "stop" }
1214
3003
  };
1215
- function Ie({
1216
- flow: i,
3004
+ function Nr({
3005
+ flow: e,
1217
3006
  connectors: a = [],
1218
- onChange: c,
3007
+ onChange: i,
1219
3008
  onSave: n,
1220
- onRun: r,
1221
- className: d = ""
3009
+ onRun: s,
3010
+ className: u = "",
3011
+ tutorial: f
1222
3012
  }) {
1223
- const [o, b] = w(
1224
- i || { ...Ee, id: crypto.randomUUID() }
1225
- ), [u, p] = w(null), [x, h] = w(!0), [_, S] = w("canvas"), [C, E] = w(!1), [$, I] = w(null), [F, P] = w(!1), [j, O] = w(null), [q, v] = w(!1), f = Z(null), N = T(
1226
- (l) => {
1227
- b((m) => {
1228
- const y = l(m);
1229
- return c == null || c(y), y;
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), [j, K] = g(null), [G, $] = g(!1), [U, O] = g(null), [q, w] = g(!1), x = se(null), S = P(
3016
+ (p) => {
3017
+ b((h) => {
3018
+ const C = p(h);
3019
+ return i == null || i(C), C;
1230
3020
  });
1231
3021
  },
1232
- [c]
1233
- ), U = T(
1234
- (l, m) => {
1235
- var s;
1236
- const y = {
3022
+ [i]
3023
+ ), B = P(
3024
+ (p, h) => {
3025
+ var c;
3026
+ const C = {
1237
3027
  id: crypto.randomUUID(),
1238
- type: l,
1239
- name: ((s = W.find((g) => g.type === l)) == null ? void 0 : s.label) || l,
1240
- position: m,
1241
- config: xe(l),
1242
- inputs: l !== "trigger" ? ["input"] : [],
3028
+ type: p,
3029
+ name: ((c = te.find((o) => o.type === p)) == null ? void 0 : c.label) || p,
3030
+ position: h,
3031
+ config: fr(p),
3032
+ inputs: p !== "trigger" ? ["input"] : [],
1243
3033
  outputs: ["output"]
1244
3034
  };
1245
- N((g) => ({
1246
- ...g,
1247
- nodes: [...g.nodes, y]
1248
- })), p(y);
3035
+ S((o) => ({
3036
+ ...o,
3037
+ nodes: [...o.nodes, C]
3038
+ })), v(C);
1249
3039
  },
1250
- [N]
1251
- ), L = T(
1252
- (l) => {
1253
- N((m) => ({
1254
- ...m,
1255
- nodes: m.nodes.filter((y) => y.id !== l),
1256
- connections: m.connections.filter(
1257
- (y) => y.sourceNodeId !== l && y.targetNodeId !== l
3040
+ [S]
3041
+ ), V = P(
3042
+ (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
1258
3048
  )
1259
- })), p(null);
3049
+ })), v(null);
1260
3050
  },
1261
- [N]
1262
- ), V = T(
1263
- (l, m) => {
1264
- N((y) => ({
1265
- ...y,
1266
- nodes: y.nodes.map((s) => s.id === l ? { ...s, ...m } : s)
1267
- })), (u == null ? void 0 : u.id) === l && p((y) => y ? { ...y, ...m } : null);
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);
1268
3058
  },
1269
- [N, u]
1270
- ), H = T(
1271
- (l, m, y, s) => {
1272
- l === y || o.connections.some(
1273
- (k) => k.sourceNodeId === l && k.targetNodeId === y && k.sourceOutput === m && k.targetInput === s
1274
- ) || N((k) => ({
1275
- ...k,
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,
1276
3066
  connections: [
1277
- ...k.connections,
3067
+ ...N.connections,
1278
3068
  {
1279
3069
  id: crypto.randomUUID(),
1280
- sourceNodeId: l,
1281
- sourceOutput: m,
1282
- targetNodeId: y,
1283
- targetInput: s
3070
+ sourceNodeId: p,
3071
+ sourceOutput: h,
3072
+ targetNodeId: C,
3073
+ targetInput: c
1284
3074
  }
1285
3075
  ]
1286
3076
  }));
1287
3077
  },
1288
- [o.connections, N]
1289
- ), J = T(
1290
- (l) => {
1291
- N((m) => ({
1292
- ...m,
1293
- connections: m.connections.filter((y) => y.id !== l)
3078
+ [y.connections, S]
3079
+ ), X = P(
3080
+ (p) => {
3081
+ S((h) => ({
3082
+ ...h,
3083
+ connections: h.connections.filter((C) => C.id !== p)
1294
3084
  }));
1295
3085
  },
1296
- [N]
1297
- ), K = T(
1298
- (l) => {
1299
- if (l.preventDefault(), !$ || !f.current)
3086
+ [S]
3087
+ ), F = P(
3088
+ (p) => {
3089
+ if (p.preventDefault(), !j || !x.current)
1300
3090
  return;
1301
- const m = f.current.getBoundingClientRect(), y = l.clientX - m.left, s = l.clientY - m.top;
1302
- U($, { x: y, y: s }), E(!1), I(null);
3091
+ const h = x.current.getBoundingClientRect(), C = p.clientX - h.left, c = p.clientY - h.top;
3092
+ B(j, { x: C, y: c }), H(!1), K(null);
1303
3093
  },
1304
- [$, U]
1305
- ), z = T(async () => {
1306
- if (r) {
1307
- v(!0);
3094
+ [j, B]
3095
+ ), Q = P(async () => {
3096
+ if (s) {
3097
+ w(!0);
1308
3098
  try {
1309
- await r(o);
3099
+ await s(y);
1310
3100
  } finally {
1311
- v(!1);
3101
+ w(!1);
1312
3102
  }
1313
3103
  }
1314
- }, [o, r]), G = T(() => {
1315
- n == null || n(o);
1316
- }, [o, n]);
1317
- return /* @__PURE__ */ t("div", { className: `nice-integration-builder ${d}`, children: [
3104
+ }, [y, s]), Y = P(() => {
3105
+ 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) }) }),
1318
3109
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__toolbar", children: [
1319
- /* @__PURE__ */ e(
3110
+ /* @__PURE__ */ r(
1320
3111
  "input",
1321
3112
  {
1322
3113
  type: "text",
1323
- value: o.name,
1324
- onChange: (l) => N((m) => ({ ...m, name: l.target.value })),
3114
+ value: y.name,
3115
+ onChange: (p) => S((h) => ({ ...h, name: p.target.value })),
1325
3116
  className: "nice-integration-builder__name-input"
1326
3117
  }
1327
3118
  ),
1328
- /* @__PURE__ */ e("div", { className: "nice-integration-builder__tabs", children: ["canvas", "code", "variables", "settings"].map((l) => /* @__PURE__ */ e(
3119
+ /* @__PURE__ */ r("div", { className: "nice-integration-builder__tabs", children: ["canvas", "code", "variables", "settings"].map((p) => /* @__PURE__ */ r(
1329
3120
  "button",
1330
3121
  {
1331
- className: `nice-integration-builder__tab ${_ === l ? "nice-integration-builder__tab--active" : ""}`,
1332
- onClick: () => S(l),
1333
- children: l.charAt(0).toUpperCase() + l.slice(1)
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)
1334
3125
  },
1335
- l
3126
+ p
1336
3127
  )) }),
1337
3128
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__actions", children: [
1338
- /* @__PURE__ */ e(
3129
+ /* @__PURE__ */ r(
1339
3130
  "button",
1340
3131
  {
1341
- onClick: z,
3132
+ onClick: Q,
1342
3133
  disabled: q,
1343
3134
  className: "nice-integration-builder__run-btn",
1344
3135
  children: q ? "⏳ Running..." : "▶ Run"
1345
3136
  }
1346
3137
  ),
1347
- /* @__PURE__ */ e("button", { onClick: G, className: "nice-integration-builder__save-btn", children: "💾 Save" })
3138
+ /* @__PURE__ */ r("button", { onClick: Y, className: "nice-integration-builder__save-btn", children: "💾 Save" })
1348
3139
  ] })
1349
3140
  ] }),
1350
3141
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__main", children: [
1351
- x && _ === "canvas" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__palette", children: [
1352
- /* @__PURE__ */ e("h4", { children: "Nodes" }),
1353
- ["Control", "Actions", "Data"].map((l) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__category", children: [
1354
- /* @__PURE__ */ e("h5", { children: l }),
1355
- W.filter((m) => m.category === l).map((m) => /* @__PURE__ */ t(
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(
1356
3147
  "div",
1357
3148
  {
1358
3149
  className: "nice-integration-builder__palette-item",
1359
3150
  draggable: !0,
1360
3151
  onDragStart: () => {
1361
- E(!0), I(m.type);
3152
+ H(!0), K(h.type);
1362
3153
  },
1363
3154
  onDragEnd: () => {
1364
- E(!1), I(null);
3155
+ H(!1), K(null);
1365
3156
  },
1366
3157
  children: [
1367
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: m.icon }),
1368
- /* @__PURE__ */ e("span", { children: m.label })
3158
+ /* @__PURE__ */ r("span", { className: "nice-integration-builder__palette-icon", children: h.icon }),
3159
+ /* @__PURE__ */ r("span", { children: h.label })
1369
3160
  ]
1370
3161
  },
1371
- m.type
3162
+ h.type
1372
3163
  ))
1373
- ] }, l)),
3164
+ ] }, p)),
1374
3165
  a.length > 0 && /* @__PURE__ */ t("div", { className: "nice-integration-builder__category", children: [
1375
- /* @__PURE__ */ e("h5", { children: "Connectors" }),
1376
- a.map((l) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__palette-item", children: [
1377
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: "🔌" }),
1378
- /* @__PURE__ */ e("span", { children: l.name })
1379
- ] }, l.id))
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))
1380
3171
  ] })
1381
3172
  ] }),
1382
- _ === "canvas" && /* @__PURE__ */ t(
3173
+ T === "canvas" && /* @__PURE__ */ t(
1383
3174
  "div",
1384
3175
  {
1385
- ref: f,
1386
- className: `nice-integration-builder__canvas ${C ? "nice-integration-builder__canvas--dragging" : ""}`,
1387
- onDragOver: (l) => l.preventDefault(),
1388
- onDrop: K,
1389
- onClick: () => p(null),
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),
1390
3181
  children: [
1391
- /* @__PURE__ */ e("svg", { className: "nice-integration-builder__connections", children: o.connections.map((l) => {
1392
- const m = o.nodes.find((D) => D.id === l.sourceNodeId), y = o.nodes.find((D) => D.id === l.targetNodeId);
1393
- if (!m || !y)
3182
+ /* @__PURE__ */ r("svg", { className: "nice-integration-builder__connections", children: y.connections.map((p) => {
3183
+ const h = y.nodes.find((A) => A.id === p.sourceNodeId), C = y.nodes.find((A) => A.id === p.targetNodeId);
3184
+ if (!h || !C)
1394
3185
  return null;
1395
- const s = m.position.x + 150, g = m.position.y + 30, k = y.position.x, B = y.position.y + 30, A = (s + k) / 2;
1396
- return /* @__PURE__ */ e("g", { onClick: () => J(l.id), children: /* @__PURE__ */ e(
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(
1397
3188
  "path",
1398
3189
  {
1399
- d: `M ${s} ${g} C ${A} ${g}, ${A} ${B}, ${k} ${B}`,
3190
+ d: `M ${c} ${o} C ${E} ${o}, ${E} ${D}, ${N} ${D}`,
1400
3191
  className: "nice-integration-builder__connection"
1401
3192
  }
1402
- ) }, l.id);
3193
+ ) }, p.id);
1403
3194
  }) }),
1404
- o.nodes.map((l) => /* @__PURE__ */ e(
1405
- Te,
3195
+ y.nodes.map((p) => /* @__PURE__ */ r(
3196
+ pr,
1406
3197
  {
1407
- node: l,
1408
- isSelected: (u == null ? void 0 : u.id) === l.id,
1409
- onSelect: () => p(l),
1410
- onDelete: () => L(l.id),
1411
- onPositionChange: (m) => V(l.id, { position: m }),
1412
- onStartConnection: (m) => {
1413
- P(!0), O({ nodeId: l.id, output: m });
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 });
1414
3205
  },
1415
- onEndConnection: (m) => {
1416
- j && H(j.nodeId, j.output, l.id, m), P(!1), O(null);
3206
+ onEndConnection: (h) => {
3207
+ U && L(U.nodeId, U.output, p.id, h), $(!1), O(null);
1417
3208
  }
1418
3209
  },
1419
- l.id
3210
+ p.id
1420
3211
  )),
1421
- o.nodes.length === 0 && /* @__PURE__ */ e("div", { className: "nice-integration-builder__empty", children: "Drag nodes from the palette to build your flow" })
3212
+ y.nodes.length === 0 && /* @__PURE__ */ r("div", { className: "nice-integration-builder__empty", children: "Drag nodes from the palette to build your flow" })
1422
3213
  ]
1423
3214
  }
1424
3215
  ),
1425
- _ === "code" && /* @__PURE__ */ e("div", { className: "nice-integration-builder__code-view", children: /* @__PURE__ */ e("pre", { children: JSON.stringify(o, null, 2) }) }),
1426
- _ === "variables" && /* @__PURE__ */ e(
1427
- Ae,
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,
1428
3219
  {
1429
- variables: o.variables,
1430
- onChange: (l) => N((m) => ({ ...m, variables: l }))
3220
+ variables: y.variables,
3221
+ onChange: (p) => S((h) => ({ ...h, variables: p }))
1431
3222
  }
1432
3223
  ),
1433
- _ === "settings" && /* @__PURE__ */ e(
1434
- De,
3224
+ T === "settings" && /* @__PURE__ */ r(
3225
+ ur,
1435
3226
  {
1436
- errorHandling: o.errorHandling,
1437
- schedule: o.schedule,
1438
- onChange: (l, m) => N((y) => ({ ...y, errorHandling: l, schedule: m }))
3227
+ errorHandling: y.errorHandling,
3228
+ schedule: y.schedule,
3229
+ onChange: (p, h) => S((C) => ({ ...C, errorHandling: p, schedule: h }))
1439
3230
  }
1440
3231
  ),
1441
- u && _ === "canvas" && /* @__PURE__ */ e(
1442
- Se,
3232
+ d && T === "canvas" && /* @__PURE__ */ r(
3233
+ mr,
1443
3234
  {
1444
- node: u,
1445
- onChange: (l) => V(u.id, l),
1446
- onClose: () => p(null)
3235
+ node: d,
3236
+ onChange: (p) => z(d.id, p),
3237
+ onClose: () => v(null)
1447
3238
  }
1448
3239
  )
1449
3240
  ] })
1450
3241
  ] });
1451
3242
  }
1452
- function xe(i) {
1453
- switch (i) {
3243
+ function fr(e) {
3244
+ switch (e) {
1454
3245
  case "http-request":
1455
3246
  return { method: "GET", url: "", headers: {}, body: "" };
1456
3247
  case "transform":
@@ -1480,214 +3271,214 @@ return input;` };
1480
3271
  return {};
1481
3272
  }
1482
3273
  }
1483
- function Te({
1484
- node: i,
3274
+ function pr({
3275
+ node: e,
1485
3276
  isSelected: a,
1486
- onSelect: c,
3277
+ onSelect: i,
1487
3278
  onDelete: n,
1488
- onPositionChange: r,
1489
- onStartConnection: d,
1490
- onEndConnection: o
3279
+ onPositionChange: s,
3280
+ onStartConnection: u,
3281
+ onEndConnection: f
1491
3282
  }) {
1492
- const [b, u] = w(!1), [p, x] = w({ x: 0, y: 0 }), h = Z(null), _ = W.find((C) => C.type === i.type), S = (C) => {
1493
- C.button === 0 && (C.stopPropagation(), u(!0), x({
1494
- x: C.clientX - i.position.x,
1495
- y: C.clientY - i.position.y
1496
- }), c());
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
3287
+ }), i());
1497
3288
  };
1498
- return se(() => {
1499
- if (!b)
3289
+ return ye(() => {
3290
+ if (!y)
1500
3291
  return;
1501
- const C = ($) => {
1502
- r({
1503
- x: $.clientX - p.x,
1504
- y: $.clientY - p.y
3292
+ const _ = (H) => {
3293
+ s({
3294
+ x: H.clientX - d.x,
3295
+ y: H.clientY - d.y
1505
3296
  });
1506
- }, E = () => {
1507
- u(!1);
3297
+ }, I = () => {
3298
+ b(!1);
1508
3299
  };
1509
- return window.addEventListener("mousemove", C), window.addEventListener("mouseup", E), () => {
1510
- window.removeEventListener("mousemove", C), window.removeEventListener("mouseup", E);
3300
+ return window.addEventListener("mousemove", _), window.addEventListener("mouseup", I), () => {
3301
+ window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", I);
1511
3302
  };
1512
- }, [b, p, r]), /* @__PURE__ */ t(
3303
+ }, [y, d, s]), /* @__PURE__ */ t(
1513
3304
  "div",
1514
3305
  {
1515
- ref: h,
1516
- className: `nice-integration-builder__node nice-integration-builder__node--${i.type} ${a ? "nice-integration-builder__node--selected" : ""}`,
3306
+ ref: k,
3307
+ className: `nice-integration-builder__node nice-integration-builder__node--${e.type} ${a ? "nice-integration-builder__node--selected" : ""}`,
1517
3308
  style: {
1518
- left: i.position.x,
1519
- top: i.position.y
3309
+ left: e.position.x,
3310
+ top: e.position.y
1520
3311
  },
1521
- onMouseDown: S,
3312
+ onMouseDown: T,
1522
3313
  children: [
1523
3314
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__node-header", children: [
1524
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__node-icon", children: (_ == null ? void 0 : _.icon) || "📦" }),
1525
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__node-name", children: i.name }),
1526
- /* @__PURE__ */ e(
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(
1527
3318
  "button",
1528
3319
  {
1529
3320
  className: "nice-integration-builder__node-delete",
1530
- onClick: (C) => {
1531
- C.stopPropagation(), n();
3321
+ onClick: (_) => {
3322
+ _.stopPropagation(), n();
1532
3323
  },
1533
3324
  children: "×"
1534
3325
  }
1535
3326
  )
1536
3327
  ] }),
1537
- i.inputs.map((C) => /* @__PURE__ */ t(
3328
+ e.inputs.map((_) => /* @__PURE__ */ t(
1538
3329
  "div",
1539
3330
  {
1540
3331
  className: "nice-integration-builder__port nice-integration-builder__port--input",
1541
- onMouseUp: () => o(C),
3332
+ onMouseUp: () => f(_),
1542
3333
  children: [
1543
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-dot" }),
1544
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-label", children: C })
3334
+ /* @__PURE__ */ r("span", { className: "nice-integration-builder__port-dot" }),
3335
+ /* @__PURE__ */ r("span", { className: "nice-integration-builder__port-label", children: _ })
1545
3336
  ]
1546
3337
  },
1547
- C
3338
+ _
1548
3339
  )),
1549
- i.outputs.map((C) => /* @__PURE__ */ t(
3340
+ e.outputs.map((_) => /* @__PURE__ */ t(
1550
3341
  "div",
1551
3342
  {
1552
3343
  className: "nice-integration-builder__port nice-integration-builder__port--output",
1553
- onMouseDown: (E) => {
1554
- E.stopPropagation(), d(C);
3344
+ onMouseDown: (I) => {
3345
+ I.stopPropagation(), u(_);
1555
3346
  },
1556
3347
  children: [
1557
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-label", children: C }),
1558
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-dot" })
3348
+ /* @__PURE__ */ r("span", { className: "nice-integration-builder__port-label", children: _ }),
3349
+ /* @__PURE__ */ r("span", { className: "nice-integration-builder__port-dot" })
1559
3350
  ]
1560
3351
  },
1561
- C
3352
+ _
1562
3353
  ))
1563
3354
  ]
1564
3355
  }
1565
3356
  );
1566
3357
  }
1567
- function Se({
1568
- node: i,
3358
+ function mr({
3359
+ node: e,
1569
3360
  onChange: a,
1570
- onClose: c
3361
+ onClose: i
1571
3362
  }) {
1572
3363
  return /* @__PURE__ */ t("div", { className: "nice-integration-builder__properties", children: [
1573
3364
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__properties-header", children: [
1574
- /* @__PURE__ */ e("h4", { children: i.name }),
1575
- /* @__PURE__ */ e("button", { onClick: c, children: "×" })
3365
+ /* @__PURE__ */ r("h4", { children: e.name }),
3366
+ /* @__PURE__ */ r("button", { onClick: i, children: "×" })
1576
3367
  ] }),
1577
3368
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__properties-content", children: [
1578
3369
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1579
- /* @__PURE__ */ e("label", { children: "Name" }),
1580
- /* @__PURE__ */ e(
3370
+ /* @__PURE__ */ r("label", { children: "Name" }),
3371
+ /* @__PURE__ */ r(
1581
3372
  "input",
1582
3373
  {
1583
3374
  type: "text",
1584
- value: i.name,
3375
+ value: e.name,
1585
3376
  onChange: (n) => a({ name: n.target.value })
1586
3377
  }
1587
3378
  )
1588
3379
  ] }),
1589
- i.type === "http-request" && /* @__PURE__ */ t(R, { children: [
3380
+ e.type === "http-request" && /* @__PURE__ */ t(J, { children: [
1590
3381
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1591
- /* @__PURE__ */ e("label", { children: "Method" }),
1592
- /* @__PURE__ */ e(
3382
+ /* @__PURE__ */ r("label", { children: "Method" }),
3383
+ /* @__PURE__ */ r(
1593
3384
  "select",
1594
3385
  {
1595
- value: i.config.method || "GET",
1596
- onChange: (n) => a({ config: { ...i.config, method: n.target.value } }),
1597
- children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
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))
1598
3389
  }
1599
3390
  )
1600
3391
  ] }),
1601
3392
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1602
- /* @__PURE__ */ e("label", { children: "URL" }),
1603
- /* @__PURE__ */ e(
3393
+ /* @__PURE__ */ r("label", { children: "URL" }),
3394
+ /* @__PURE__ */ r(
1604
3395
  "input",
1605
3396
  {
1606
3397
  type: "text",
1607
- value: i.config.url || "",
1608
- onChange: (n) => a({ config: { ...i.config, url: n.target.value } }),
3398
+ value: e.config.url || "",
3399
+ onChange: (n) => a({ config: { ...e.config, url: n.target.value } }),
1609
3400
  placeholder: "https://api.example.com/endpoint"
1610
3401
  }
1611
3402
  )
1612
3403
  ] })
1613
3404
  ] }),
1614
- i.type === "delay" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1615
- /* @__PURE__ */ e("label", { children: "Duration (ms)" }),
1616
- /* @__PURE__ */ e(
3405
+ e.type === "delay" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3406
+ /* @__PURE__ */ r("label", { children: "Duration (ms)" }),
3407
+ /* @__PURE__ */ r(
1617
3408
  "input",
1618
3409
  {
1619
3410
  type: "number",
1620
- value: i.config.duration || 1e3,
1621
- onChange: (n) => a({ config: { ...i.config, duration: parseInt(n.target.value, 10) } })
3411
+ value: e.config.duration || 1e3,
3412
+ onChange: (n) => a({ config: { ...e.config, duration: parseInt(n.target.value, 10) } })
1622
3413
  }
1623
3414
  )
1624
3415
  ] }),
1625
- i.type === "set-variable" && /* @__PURE__ */ t(R, { children: [
3416
+ e.type === "set-variable" && /* @__PURE__ */ t(J, { children: [
1626
3417
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1627
- /* @__PURE__ */ e("label", { children: "Variable Name" }),
1628
- /* @__PURE__ */ e(
3418
+ /* @__PURE__ */ r("label", { children: "Variable Name" }),
3419
+ /* @__PURE__ */ r(
1629
3420
  "input",
1630
3421
  {
1631
3422
  type: "text",
1632
- value: i.config.name || "",
1633
- onChange: (n) => a({ config: { ...i.config, name: n.target.value } })
3423
+ value: e.config.name || "",
3424
+ onChange: (n) => a({ config: { ...e.config, name: n.target.value } })
1634
3425
  }
1635
3426
  )
1636
3427
  ] }),
1637
3428
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1638
- /* @__PURE__ */ e("label", { children: "Value" }),
1639
- /* @__PURE__ */ e(
3429
+ /* @__PURE__ */ r("label", { children: "Value" }),
3430
+ /* @__PURE__ */ r(
1640
3431
  "input",
1641
3432
  {
1642
3433
  type: "text",
1643
- value: i.config.value || "",
1644
- onChange: (n) => a({ config: { ...i.config, value: n.target.value } })
3434
+ value: e.config.value || "",
3435
+ onChange: (n) => a({ config: { ...e.config, value: n.target.value } })
1645
3436
  }
1646
3437
  )
1647
3438
  ] })
1648
3439
  ] }),
1649
- i.type === "function" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1650
- /* @__PURE__ */ e("label", { children: "Code" }),
1651
- /* @__PURE__ */ e(
3440
+ e.type === "function" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
3441
+ /* @__PURE__ */ r("label", { children: "Code" }),
3442
+ /* @__PURE__ */ r(
1652
3443
  "textarea",
1653
3444
  {
1654
- value: i.config.code || "",
1655
- onChange: (n) => a({ config: { ...i.config, code: n.target.value } }),
3445
+ value: e.config.code || "",
3446
+ onChange: (n) => a({ config: { ...e.config, code: n.target.value } }),
1656
3447
  rows: 10,
1657
3448
  className: "nice-integration-builder__code-input"
1658
3449
  }
1659
3450
  )
1660
3451
  ] }),
1661
- i.type === "email" && /* @__PURE__ */ t(R, { children: [
3452
+ e.type === "email" && /* @__PURE__ */ t(J, { children: [
1662
3453
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1663
- /* @__PURE__ */ e("label", { children: "To" }),
1664
- /* @__PURE__ */ e(
3454
+ /* @__PURE__ */ r("label", { children: "To" }),
3455
+ /* @__PURE__ */ r(
1665
3456
  "input",
1666
3457
  {
1667
3458
  type: "text",
1668
- value: i.config.to || "",
1669
- onChange: (n) => a({ config: { ...i.config, to: n.target.value } })
3459
+ value: e.config.to || "",
3460
+ onChange: (n) => a({ config: { ...e.config, to: n.target.value } })
1670
3461
  }
1671
3462
  )
1672
3463
  ] }),
1673
3464
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1674
- /* @__PURE__ */ e("label", { children: "Subject" }),
1675
- /* @__PURE__ */ e(
3465
+ /* @__PURE__ */ r("label", { children: "Subject" }),
3466
+ /* @__PURE__ */ r(
1676
3467
  "input",
1677
3468
  {
1678
3469
  type: "text",
1679
- value: i.config.subject || "",
1680
- onChange: (n) => a({ config: { ...i.config, subject: n.target.value } })
3470
+ value: e.config.subject || "",
3471
+ onChange: (n) => a({ config: { ...e.config, subject: n.target.value } })
1681
3472
  }
1682
3473
  )
1683
3474
  ] }),
1684
3475
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1685
- /* @__PURE__ */ e("label", { children: "Body" }),
1686
- /* @__PURE__ */ e(
3476
+ /* @__PURE__ */ r("label", { children: "Body" }),
3477
+ /* @__PURE__ */ r(
1687
3478
  "textarea",
1688
3479
  {
1689
- value: i.config.body || "",
1690
- onChange: (n) => a({ config: { ...i.config, body: n.target.value } }),
3480
+ value: e.config.body || "",
3481
+ onChange: (n) => a({ config: { ...e.config, body: n.target.value } }),
1691
3482
  rows: 5
1692
3483
  }
1693
3484
  )
@@ -1696,125 +3487,343 @@ function Se({
1696
3487
  ] })
1697
3488
  ] });
1698
3489
  }
1699
- function Ae({ variables: i, onChange: a }) {
1700
- const c = () => {
1701
- a({ ...i, newVariable: "" });
3490
+ function yr({ variables: e, onChange: a }) {
3491
+ const i = () => {
3492
+ a({ ...e, newVariable: "" });
1702
3493
  };
1703
3494
  return /* @__PURE__ */ t("div", { className: "nice-integration-builder__variables", children: [
1704
- /* @__PURE__ */ e("h4", { children: "Flow Variables" }),
1705
- /* @__PURE__ */ e("div", { className: "nice-integration-builder__variables-list", children: Object.entries(i).map(([n, r]) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__variable-row", children: [
1706
- /* @__PURE__ */ e(
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(
1707
3498
  "input",
1708
3499
  {
1709
3500
  type: "text",
1710
3501
  value: n,
1711
- onChange: (d) => {
1712
- const { [n]: o, ...b } = i;
1713
- a({ ...b, [d.target.value]: r });
3502
+ onChange: (u) => {
3503
+ const { [n]: f, ...y } = e;
3504
+ a({ ...y, [u.target.value]: s });
1714
3505
  },
1715
3506
  placeholder: "Name"
1716
3507
  }
1717
3508
  ),
1718
- /* @__PURE__ */ e(
3509
+ /* @__PURE__ */ r(
1719
3510
  "input",
1720
3511
  {
1721
3512
  type: "text",
1722
- value: String(r),
1723
- onChange: (d) => a({ ...i, [n]: d.target.value }),
3513
+ value: String(s),
3514
+ onChange: (u) => a({ ...e, [n]: u.target.value }),
1724
3515
  placeholder: "Value"
1725
3516
  }
1726
3517
  ),
1727
- /* @__PURE__ */ e(
3518
+ /* @__PURE__ */ r(
1728
3519
  "button",
1729
3520
  {
1730
3521
  onClick: () => {
1731
- const { [n]: d, ...o } = i;
1732
- a(o);
3522
+ const { [n]: u, ...f } = e;
3523
+ a(f);
1733
3524
  },
1734
3525
  children: "×"
1735
3526
  }
1736
3527
  )
1737
3528
  ] }, n)) }),
1738
- /* @__PURE__ */ e("button", { onClick: c, children: "+ Add Variable" })
3529
+ /* @__PURE__ */ r("button", { onClick: i, children: "+ Add Variable" })
1739
3530
  ] });
1740
3531
  }
1741
- function De({
1742
- errorHandling: i,
3532
+ function ur({
3533
+ errorHandling: e,
1743
3534
  schedule: a,
1744
- onChange: c
3535
+ onChange: i
1745
3536
  }) {
1746
3537
  return /* @__PURE__ */ t("div", { className: "nice-integration-builder__settings", children: [
1747
- /* @__PURE__ */ e("h4", { children: "Error Handling" }),
3538
+ /* @__PURE__ */ r("h4", { children: "Error Handling" }),
1748
3539
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1749
- /* @__PURE__ */ e("label", { children: "Strategy" }),
3540
+ /* @__PURE__ */ r("label", { children: "Strategy" }),
1750
3541
  /* @__PURE__ */ t(
1751
3542
  "select",
1752
3543
  {
1753
- value: i.strategy,
1754
- onChange: (n) => c(
1755
- { ...i, strategy: n.target.value },
3544
+ value: e.strategy,
3545
+ onChange: (n) => i(
3546
+ { ...e, strategy: n.target.value },
1756
3547
  a
1757
3548
  ),
1758
3549
  children: [
1759
- /* @__PURE__ */ e("option", { value: "stop", children: "Stop on error" }),
1760
- /* @__PURE__ */ e("option", { value: "continue", children: "Continue on error" }),
1761
- /* @__PURE__ */ e("option", { value: "retry", children: "Retry on error" })
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" })
1762
3553
  ]
1763
3554
  }
1764
3555
  )
1765
3556
  ] }),
1766
- i.strategy === "retry" && /* @__PURE__ */ t(R, { children: [
3557
+ e.strategy === "retry" && /* @__PURE__ */ t(J, { children: [
1767
3558
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1768
- /* @__PURE__ */ e("label", { children: "Max Retries" }),
1769
- /* @__PURE__ */ e(
3559
+ /* @__PURE__ */ r("label", { children: "Max Retries" }),
3560
+ /* @__PURE__ */ r(
1770
3561
  "input",
1771
3562
  {
1772
3563
  type: "number",
1773
- value: i.maxRetries || 3,
1774
- onChange: (n) => c({ ...i, maxRetries: parseInt(n.target.value, 10) }, a)
3564
+ value: e.maxRetries || 3,
3565
+ onChange: (n) => i({ ...e, maxRetries: parseInt(n.target.value, 10) }, a)
1775
3566
  }
1776
3567
  )
1777
3568
  ] }),
1778
3569
  /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1779
- /* @__PURE__ */ e("label", { children: "Retry Delay (ms)" }),
1780
- /* @__PURE__ */ e(
3570
+ /* @__PURE__ */ r("label", { children: "Retry Delay (ms)" }),
3571
+ /* @__PURE__ */ r(
1781
3572
  "input",
1782
3573
  {
1783
3574
  type: "number",
1784
- value: i.retryDelay || 1e3,
1785
- onChange: (n) => c({ ...i, retryDelay: parseInt(n.target.value, 10) }, a)
3575
+ value: e.retryDelay || 1e3,
3576
+ onChange: (n) => i({ ...e, retryDelay: parseInt(n.target.value, 10) }, a)
1786
3577
  }
1787
3578
  )
1788
3579
  ] })
1789
3580
  ] }),
1790
- /* @__PURE__ */ e("h4", { children: "Schedule" }),
1791
- /* @__PURE__ */ e("div", { className: "nice-integration-builder__field", children: /* @__PURE__ */ t("label", { children: [
1792
- /* @__PURE__ */ e(
3581
+ /* @__PURE__ */ r("h4", { children: "Schedule" }),
3582
+ /* @__PURE__ */ r("div", { className: "nice-integration-builder__field", children: /* @__PURE__ */ t("label", { children: [
3583
+ /* @__PURE__ */ r(
1793
3584
  "input",
1794
3585
  {
1795
3586
  type: "checkbox",
1796
3587
  checked: (a == null ? void 0 : a.enabled) || !1,
1797
- onChange: (n) => c(i, { ...a, enabled: n.target.checked })
3588
+ onChange: (n) => i(e, { ...a, enabled: n.target.checked })
1798
3589
  }
1799
3590
  ),
1800
3591
  "Enable scheduled execution"
1801
3592
  ] }) }),
1802
3593
  (a == null ? void 0 : a.enabled) && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
1803
- /* @__PURE__ */ e("label", { children: "Cron Expression" }),
1804
- /* @__PURE__ */ e(
3594
+ /* @__PURE__ */ r("label", { children: "Cron Expression" }),
3595
+ /* @__PURE__ */ r(
1805
3596
  "input",
1806
3597
  {
1807
3598
  type: "text",
1808
3599
  value: a.cron || "",
1809
- onChange: (n) => c(i, { ...a, cron: n.target.value }),
3600
+ onChange: (n) => i(e, { ...a, cron: n.target.value }),
1810
3601
  placeholder: "0 0 * * *"
1811
3602
  }
1812
3603
  )
1813
3604
  ] })
1814
3605
  ] });
1815
3606
  }
3607
+ const br = [
3608
+ {
3609
+ target: ".nice-webhook-tester",
3610
+ titleKey: "tutorial.webhookTester.intro.title",
3611
+ title: "Webhook tester",
3612
+ contentKey: "tutorial.webhookTester.intro.content",
3613
+ content: "Pick a saved payload (or write one), optionally sign it, send it to the endpoint and inspect the response.",
3614
+ placement: "auto"
3615
+ }
3616
+ ];
3617
+ function fe(e) {
3618
+ return e ? Object.entries(e).map(([a, i]) => ({ key: a, value: i })) : [];
3619
+ }
3620
+ function pe(e) {
3621
+ const a = {};
3622
+ for (const i of e)
3623
+ i.key.trim() !== "" && (a[i.key] = i.value);
3624
+ return a;
3625
+ }
3626
+ async function hr(e, a) {
3627
+ var f;
3628
+ const i = (f = globalThis.crypto) == null ? void 0 : f.subtle;
3629
+ if (!i)
3630
+ throw new Error("Web Crypto (crypto.subtle) is unavailable in this environment");
3631
+ const n = new TextEncoder(), s = await i.importKey(
3632
+ "raw",
3633
+ n.encode(e),
3634
+ { name: "HMAC", hash: "SHA-256" },
3635
+ !1,
3636
+ ["sign"]
3637
+ ), u = await i.sign("HMAC", s, n.encode(a));
3638
+ return [...new Uint8Array(u)].map((y) => y.toString(16).padStart(2, "0")).join("");
3639
+ }
3640
+ const xr = ke(
3641
+ function(a, i) {
3642
+ const {
3643
+ url: n = "",
3644
+ method: s = "POST",
3645
+ headers: u,
3646
+ payload: f = "",
3647
+ samples: y = [],
3648
+ onSend: b,
3649
+ signing: d,
3650
+ onSaveSample: v,
3651
+ tutorial: k,
3652
+ className: m,
3653
+ style: T,
3654
+ id: _,
3655
+ "data-testid": I
3656
+ } = a, [H, j] = g(n), [K, 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(() => {
3657
+ const o = /* @__PURE__ */ new Map();
3658
+ for (const N of y)
3659
+ o.set(N.id, N);
3660
+ 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, A) => A === o ? { ...E, ...N } : E));
3667
+ }, p = async () => {
3668
+ B(!0), z(null), X(null);
3669
+ try {
3670
+ const o = pe($);
3671
+ if (d && d.secret) {
3672
+ const A = await hr(d.secret, O);
3673
+ o[d.header] = `${d.prefix ?? ""}${A}`;
3674
+ }
3675
+ const N = typeof performance < "u" ? performance.now() : Date.now(), D = await b({ url: H, method: K ?? "POST", headers: o, body: O }), E = Math.round(
3676
+ (typeof performance < "u" ? performance.now() : Date.now()) - N
3677
+ );
3678
+ X({ ...D, durationMs: D.durationMs ?? E });
3679
+ } catch (o) {
3680
+ z(o instanceof Error ? o.message : String(o));
3681
+ } finally {
3682
+ B(!1);
3683
+ }
3684
+ }, h = () => {
3685
+ var N;
3686
+ if (!v)
3687
+ return;
3688
+ const o = typeof window < "u" && ((N = window.prompt) == null ? void 0 : N.call(window, "Sample name")) || "";
3689
+ o && v({
3690
+ id: `sample_${Date.now().toString(36)}`,
3691
+ name: o,
3692
+ payload: O,
3693
+ headers: pe($)
3694
+ });
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) }) }),
3698
+ /* @__PURE__ */ t("div", { className: "nice-webhook-tester__bar", children: [
3699
+ /* @__PURE__ */ r(
3700
+ "select",
3701
+ {
3702
+ className: "nice-webhook-tester__method",
3703
+ value: K,
3704
+ onChange: (o) => G(o.target.value),
3705
+ "aria-label": "Method",
3706
+ children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((o) => /* @__PURE__ */ r("option", { value: o, children: o }, o))
3707
+ }
3708
+ ),
3709
+ /* @__PURE__ */ r(
3710
+ "input",
3711
+ {
3712
+ type: "text",
3713
+ className: "nice-webhook-tester__url",
3714
+ value: H,
3715
+ placeholder: "https://example.com/api/payments/stripe/webhook",
3716
+ onChange: (o) => j(o.target.value),
3717
+ "aria-label": "URL"
3718
+ }
3719
+ ),
3720
+ /* @__PURE__ */ r(
3721
+ "button",
3722
+ {
3723
+ type: "button",
3724
+ className: "nice-webhook-tester__send",
3725
+ onClick: () => void p(),
3726
+ disabled: S || H.trim() === "",
3727
+ children: S ? "Sending…" : "Send"
3728
+ }
3729
+ )
3730
+ ] }),
3731
+ y.length > 0 && /* @__PURE__ */ r("div", { className: "nice-webhook-tester__samples", children: /* @__PURE__ */ t("label", { children: [
3732
+ "Sample:",
3733
+ " ",
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))
3737
+ ] })
3738
+ ] }) }),
3739
+ /* @__PURE__ */ t("div", { className: "nice-webhook-tester__headers", children: [
3740
+ /* @__PURE__ */ t("div", { className: "nice-webhook-tester__section-label", children: [
3741
+ "Headers",
3742
+ d && /* @__PURE__ */ t("span", { className: "nice-webhook-tester__signed", children: [
3743
+ " ",
3744
+ "· auto-signs ",
3745
+ /* @__PURE__ */ r("code", { children: d.header })
3746
+ ] })
3747
+ ] }),
3748
+ $.map((o, N) => /* @__PURE__ */ t("div", { className: "nice-webhook-tester__header-row", children: [
3749
+ /* @__PURE__ */ r(
3750
+ "input",
3751
+ {
3752
+ type: "text",
3753
+ value: o.key,
3754
+ placeholder: "Header",
3755
+ onChange: (D) => Y(N, { key: D.target.value }),
3756
+ "aria-label": "Header name"
3757
+ }
3758
+ ),
3759
+ /* @__PURE__ */ r(
3760
+ "input",
3761
+ {
3762
+ type: "text",
3763
+ value: o.value,
3764
+ placeholder: "Value",
3765
+ onChange: (D) => Y(N, { value: D.target.value }),
3766
+ "aria-label": "Header value"
3767
+ }
3768
+ ),
3769
+ /* @__PURE__ */ r(
3770
+ "button",
3771
+ {
3772
+ type: "button",
3773
+ onClick: () => U((D) => D.filter((E, A) => A !== N)),
3774
+ "aria-label": "Remove header",
3775
+ children: "✕"
3776
+ }
3777
+ )
3778
+ ] }, N)),
3779
+ /* @__PURE__ */ r(
3780
+ "button",
3781
+ {
3782
+ type: "button",
3783
+ className: "nice-webhook-tester__add-header",
3784
+ onClick: () => U((o) => [...o, { key: "", value: "" }]),
3785
+ children: "+ Header"
3786
+ }
3787
+ )
3788
+ ] }),
3789
+ /* @__PURE__ */ t("div", { className: "nice-webhook-tester__payload", children: [
3790
+ /* @__PURE__ */ t("div", { className: "nice-webhook-tester__section-label", children: [
3791
+ "Payload",
3792
+ v && /* @__PURE__ */ r("button", { type: "button", className: "nice-webhook-tester__save", onClick: h, children: "Save as sample" })
3793
+ ] }),
3794
+ /* @__PURE__ */ r(
3795
+ "textarea",
3796
+ {
3797
+ className: "nice-webhook-tester__textarea",
3798
+ value: O,
3799
+ spellCheck: !1,
3800
+ rows: 8,
3801
+ placeholder: '{ "type": "payment.succeeded", "data": { ... } }',
3802
+ onChange: (o) => q(o.target.value),
3803
+ "aria-label": "Payload"
3804
+ }
3805
+ )
3806
+ ] }),
3807
+ V && /* @__PURE__ */ r("div", { className: "nice-webhook-tester__error", children: V }),
3808
+ L && /* @__PURE__ */ t("div", { className: "nice-webhook-tester__response", children: [
3809
+ /* @__PURE__ */ t("div", { className: "nice-webhook-tester__section-label", children: [
3810
+ "Response",
3811
+ " ",
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: [
3814
+ " · ",
3815
+ L.durationMs,
3816
+ " ms"
3817
+ ] })
3818
+ ] }),
3819
+ L.body != null && /* @__PURE__ */ r("pre", { className: "nice-webhook-tester__response-body", children: L.body })
3820
+ ] })
3821
+ ] });
3822
+ }
3823
+ );
1816
3824
  export {
1817
- Pe as NiceAPIDesigner,
1818
- Oe as NiceAPITester,
1819
- Ie as NiceIntegrationBuilder
3825
+ _r as NiceAPIDesigner,
3826
+ wr as NiceAPITester,
3827
+ Nr as NiceIntegrationBuilder,
3828
+ xr as NiceWebhookTester
1820
3829
  };