treege 3.0.0-beta.62 → 3.0.0-beta.63

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.
@@ -1,12 +1,12 @@
1
- import { A as e, C as t, D as n, E as r, F as i, M as a, O as o, P as s, S as c, T as l, b as u, d, h as f, i as p, k as m, r as h, s as g, t as _, w as v, y } from "./ThemeContext-cGSTk24y.js";
1
+ import { A as e, C as t, D as n, E as r, F as i, I as a, N as o, O as s, T as c, b as l, d as u, g as d, i as f, j as p, k as m, r as h, s as g, t as _, w as v, x as y } from "./ThemeContext-nopV_oRU.js";
2
2
  import * as b from "react";
3
3
  import { createContext as x, forwardRef as S, useCallback as C, useContext as w, useEffect as T, useMemo as ee, useRef as E, useState as D } from "react";
4
4
  import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
5
- import { Check as te, CheckIcon as ne, ChevronDownIcon as j, ChevronLeftIcon as M, ChevronRightIcon as N, ChevronUpIcon as re, ChevronsUpDown as P, CircleIcon as F, Loader2 as I, MapPin as L, SearchIcon as R, XIcon as ie } from "lucide-react";
5
+ import { Check as te, CheckIcon as j, ChevronDownIcon as M, ChevronLeftIcon as N, ChevronRightIcon as P, ChevronUpIcon as ne, ChevronsUpDown as re, CircleIcon as F, Loader2 as I, MapPin as L, SearchIcon as R, XIcon as ie } from "lucide-react";
6
6
  import { Slot as ae } from "@radix-ui/react-slot";
7
- import { cva as z } from "class-variance-authority";
8
- import { clsx as B } from "clsx";
9
- import { extendTailwindMerge as oe } from "tailwind-merge";
7
+ import { cva as oe } from "class-variance-authority";
8
+ import { clsx as z } from "clsx";
9
+ import { extendTailwindMerge as B } from "tailwind-merge";
10
10
  import * as se from "@radix-ui/react-checkbox";
11
11
  import * as ce from "@radix-ui/react-label";
12
12
  import * as V from "@radix-ui/react-popover";
@@ -19,13 +19,13 @@ import { DayPicker as ue, getDefaultClassNames as de } from "react-day-picker";
19
19
  import * as K from "@radix-ui/react-radio-group";
20
20
  import * as fe from "@radix-ui/react-switch";
21
21
  //#region src/shared/lib/utils.ts
22
- var pe = oe({ prefix: "tg" });
22
+ var pe = B({ prefix: "tg" });
23
23
  function q(...e) {
24
- return pe(B(e));
24
+ return pe(z(e));
25
25
  }
26
26
  //#endregion
27
27
  //#region src/shared/components/ui/button.tsx
28
- var me = z("tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:whitespace-nowrap tg:rounded-md tg:text-sm tg:font-medium tg:transition-all tg:disabled:pointer-events-none tg:disabled:opacity-50 tg:[&_svg]:pointer-events-none tg:[&_svg:not([class*='size-'])]:size-4 tg:shrink-0 tg:[&_svg]:shrink-0 tg:outline-none tg:focus-visible:border-ring tg:focus-visible:ring-ring/50 tg:focus-visible:ring-[3px] tg:aria-invalid:ring-destructive/20 tg:dark:aria-invalid:ring-destructive/40 tg:aria-invalid:border-destructive", {
28
+ var me = oe("tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:whitespace-nowrap tg:rounded-md tg:text-sm tg:font-medium tg:transition-all tg:disabled:pointer-events-none tg:disabled:opacity-50 tg:[&_svg]:pointer-events-none tg:[&_svg:not([class*='size-'])]:size-4 tg:shrink-0 tg:[&_svg]:shrink-0 tg:outline-none tg:focus-visible:border-ring tg:focus-visible:ring-ring/50 tg:focus-visible:ring-[3px] tg:aria-invalid:ring-destructive/20 tg:dark:aria-invalid:ring-destructive/40 tg:aria-invalid:border-destructive", {
29
29
  defaultVariants: {
30
30
  size: "default",
31
31
  variant: "default"
@@ -72,7 +72,7 @@ function ge({ className: e, ...t }) {
72
72
  children: /* @__PURE__ */ k(se.Indicator, {
73
73
  "data-slot": "checkbox-indicator",
74
74
  className: "tg:grid tg:place-content-center tg:text-current tg:transition-none",
75
- children: /* @__PURE__ */ k(ne, { className: "tg:size-3.5" })
75
+ children: /* @__PURE__ */ k(j, { className: "tg:size-3.5" })
76
76
  })
77
77
  });
78
78
  }
@@ -164,7 +164,7 @@ var Se = ({ ...e }) => /* @__PURE__ */ k(H.Root, {
164
164
  ...r,
165
165
  children: [n, /* @__PURE__ */ k(H.Icon, {
166
166
  asChild: !0,
167
- children: /* @__PURE__ */ k(j, { className: "tg:size-4 tg:opacity-50" })
167
+ children: /* @__PURE__ */ k(M, { className: "tg:size-4 tg:opacity-50" })
168
168
  })]
169
169
  }), Ee = ({ className: e, children: t, position: n = "popper", ...r }) => /* @__PURE__ */ k(H.Portal, {
170
170
  container: _e() ?? void 0,
@@ -196,7 +196,7 @@ var Se = ({ ...e }) => /* @__PURE__ */ k(H.Root, {
196
196
  ...n,
197
197
  children: [/* @__PURE__ */ k("span", {
198
198
  className: "tg:absolute tg:right-2 tg:flex tg:size-3.5 tg:items-center tg:justify-center",
199
- children: /* @__PURE__ */ k(H.ItemIndicator, { children: /* @__PURE__ */ k(ne, { className: "tg:size-4" }) })
199
+ children: /* @__PURE__ */ k(H.ItemIndicator, { children: /* @__PURE__ */ k(j, { className: "tg:size-4" }) })
200
200
  }), /* @__PURE__ */ k(H.ItemText, { children: t })]
201
201
  }), ke = ({ className: e, ...t }) => /* @__PURE__ */ k(H.Separator, {
202
202
  "data-slot": "select-separator",
@@ -206,12 +206,12 @@ var Se = ({ ...e }) => /* @__PURE__ */ k(H.Root, {
206
206
  "data-slot": "select-scroll-up-button",
207
207
  className: q("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
208
208
  ...t,
209
- children: /* @__PURE__ */ k(re, { className: "tg:size-4" })
209
+ children: /* @__PURE__ */ k(ne, { className: "tg:size-4" })
210
210
  }), je = ({ className: e, ...t }) => /* @__PURE__ */ k(H.ScrollDownButton, {
211
211
  "data-slot": "select-scroll-down-button",
212
212
  className: q("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
213
213
  ...t,
214
- children: /* @__PURE__ */ k(j, { className: "tg:size-4" })
214
+ children: /* @__PURE__ */ k(M, { className: "tg:size-4" })
215
215
  });
216
216
  //#endregion
217
217
  //#region src/shared/components/ui/tooltip.tsx
@@ -415,23 +415,23 @@ var Qe = async (e, t) => {
415
415
  value: e.description
416
416
  })));
417
417
  });
418
- }), et = (t, n) => {
419
- let [r, a] = D(""), [o, s] = D([]), [c, l] = D(!1), { id: u, name: d, value: f, placeholder: p } = t, { node: m, setValue: h, error: g, label: _, helperText: v } = n, { googleApiKey: y, language: b } = i(), x = e(), S = C((e) => {
420
- h(e.value), a(e.value), l(!1);
418
+ }), et = (e, t) => {
419
+ let [n, r] = D(""), [i, o] = D([]), [s, c] = D(!1), { id: l, name: u, value: d, placeholder: f } = e, { node: m, setValue: h, error: g, label: _, helperText: v } = t, { googleApiKey: y, language: b } = a(), x = p(), S = C((e) => {
420
+ h(e.value), r(e.value), c(!1);
421
421
  }, [h]), w = C((e) => {
422
- h(e), a(e), e.length >= 3 && l(!0);
422
+ h(e), r(e), e.length >= 3 && c(!0);
423
423
  }, [h]);
424
424
  return T(() => {
425
- if (!r || r.trim().length < 3) {
426
- s([]);
425
+ if (!n || n.trim().length < 3) {
426
+ o([]);
427
427
  return;
428
428
  }
429
429
  let e = setTimeout(async () => {
430
- s(y ? await $e(r) : await Qe(r, b));
430
+ o(y ? await $e(n) : await Qe(n, b));
431
431
  }, 300);
432
432
  return () => clearTimeout(e);
433
433
  }, [
434
- r,
434
+ n,
435
435
  y,
436
436
  b
437
437
  ]), /* @__PURE__ */ A(O, { children: [y && /* @__PURE__ */ k("script", {
@@ -441,7 +441,7 @@ var Qe = async (e, t) => {
441
441
  className: "tg:mb-4",
442
442
  children: [
443
443
  /* @__PURE__ */ A(Q, {
444
- htmlFor: u,
444
+ htmlFor: l,
445
445
  children: [_ || m.data.name, m.data.required && /* @__PURE__ */ k("span", {
446
446
  className: "tg:text-red-500",
447
447
  children: "*"
@@ -452,21 +452,21 @@ var Qe = async (e, t) => {
452
452
  children: [
453
453
  /* @__PURE__ */ k(Z, {
454
454
  type: "text",
455
- id: u,
456
- name: d,
457
- value: f || "",
455
+ id: l,
456
+ name: u,
457
+ value: d || "",
458
458
  onChange: (e) => w(e.target.value),
459
459
  onFocus: () => {
460
- o.length > 0 && l(!0);
460
+ i.length > 0 && c(!0);
461
461
  },
462
- placeholder: p || x("renderer.defaultAddressInput.enterAddress"),
462
+ placeholder: f || x("renderer.defaultAddressInput.enterAddress"),
463
463
  className: "tg:pr-10",
464
464
  autoComplete: "off"
465
465
  }),
466
466
  /* @__PURE__ */ k(L, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-3 tg:h-4 tg:w-4 tg:text-muted-foreground" }),
467
- c && /* @__PURE__ */ k("div", {
467
+ s && /* @__PURE__ */ k("div", {
468
468
  className: "tg:absolute tg:z-50 tg:mt-1 tg:w-full tg:rounded-md tg:border tg:bg-popover tg:shadow-md",
469
- children: /* @__PURE__ */ k(Ke, { children: /* @__PURE__ */ A(Je, { children: [/* @__PURE__ */ k(Ye, { children: x("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ k(Xe, { children: o.map((e, t) => /* @__PURE__ */ A(Ze, {
469
+ children: /* @__PURE__ */ k(Ke, { children: /* @__PURE__ */ A(Je, { children: [/* @__PURE__ */ k(Ye, { children: x("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ k(Xe, { children: i.map((e, t) => /* @__PURE__ */ A(Ze, {
470
470
  value: e.value,
471
471
  onSelect: () => S(e),
472
472
  onMouseDown: (e) => e.preventDefault(),
@@ -479,12 +479,12 @@ var Qe = async (e, t) => {
479
479
  v && !g && /* @__PURE__ */ k(Y, { children: v })
480
480
  ]
481
481
  })] });
482
- }, tt = ({ missing: t }) => /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("p", {
482
+ }, tt = ({ missing: e }) => /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("p", {
483
483
  className: "tg:font-medium",
484
- children: e()("renderer.dependencyHint.title")
484
+ children: p()("renderer.dependencyHint.title")
485
485
  }), /* @__PURE__ */ k("ul", {
486
486
  className: "tg:mt-1 tg:list-disc tg:pl-4",
487
- children: t.map((e) => /* @__PURE__ */ k("li", { children: e.label }, e.id))
487
+ children: e.map((e) => /* @__PURE__ */ k("li", { children: e.label }, e.id))
488
488
  })] }), nt = ({ missing: e, children: t }) => e.length === 0 ? /* @__PURE__ */ k(O, { children: t }) : /* @__PURE__ */ k(Me, { children: /* @__PURE__ */ A(Ne, { children: [/* @__PURE__ */ k(Pe, {
489
489
  asChild: !0,
490
490
  children: /* @__PURE__ */ k("div", {
@@ -495,7 +495,7 @@ var Qe = async (e, t) => {
495
495
  className: "tg:text-muted-foreground tg:text-sm",
496
496
  children: /* @__PURE__ */ k(tt, { missing: e })
497
497
  });
498
- z("tg:group/item tg:flex tg:flex-wrap tg:items-center tg:rounded-md tg:border tg:border-transparent tg:text-sm tg:outline-none tg:transition-colors tg:duration-100 tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:[a]:transition-colors tg:[a]:hover:bg-accent/50", {
498
+ oe("tg:group/item tg:flex tg:flex-wrap tg:items-center tg:rounded-md tg:border tg:border-transparent tg:text-sm tg:outline-none tg:transition-colors tg:duration-100 tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:[a]:transition-colors tg:[a]:hover:bg-accent/50", {
499
499
  defaultVariants: {
500
500
  size: "default",
501
501
  variant: "default"
@@ -512,7 +512,7 @@ z("tg:group/item tg:flex tg:flex-wrap tg:items-center tg:rounded-md tg:border tg
512
512
  }
513
513
  }
514
514
  });
515
- var it = z("tg:flex tg:shrink-0 tg:items-center tg:justify-center tg:gap-2 tg:group-has-[[data-slot=item-description]]/item:translate-y-0.5 tg:group-has-[[data-slot=item-description]]/item:self-start tg:[&_svg]:pointer-events-none", {
515
+ var it = oe("tg:flex tg:shrink-0 tg:items-center tg:justify-center tg:gap-2 tg:group-has-[[data-slot=item-description]]/item:translate-y-0.5 tg:group-has-[[data-slot=item-description]]/item:self-start tg:[&_svg]:pointer-events-none", {
516
516
  defaultVariants: { variant: "default" },
517
517
  variants: { variant: {
518
518
  default: "tg:bg-transparent",
@@ -569,125 +569,125 @@ var lt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ A(O, { chil
569
569
  className: "tg:line-clamp-1",
570
570
  children: t
571
571
  })]
572
- })] }), ut = /\{\{([\w-]+)}}/g, dt = (e) => {
573
- let [a, s] = D({
572
+ })] }), ut = /\{\{([\w-]+)}}/g, dt = (t) => {
573
+ let [i, o] = D({
574
574
  error: null,
575
575
  fetched: null,
576
576
  isLoading: !1
577
- }), { baseUrl: c, formValues: u, headers: d } = i(), f = e.data.optionsSource, p = e.data.options, h = ee(() => {
578
- if (!(f?.url && f.mapping?.valueField && f.mapping?.labelField) || !Array.from(f.url.matchAll(ut), (e) => e[1]).every((e) => {
579
- let t = u[e];
577
+ }), { baseUrl: c, formValues: l, headers: u } = a(), d = t.data.optionsSource, f = t.data.options, p = ee(() => {
578
+ if (!(d?.url && d.mapping?.valueField && d.mapping?.labelField) || !Array.from(d.url.matchAll(ut), (e) => e[1]).every((e) => {
579
+ let t = l[e];
580
580
  return t != null && t !== "";
581
581
  })) return null;
582
- let e = f.method ?? "GET", t = {
583
- body: f.body && [
582
+ let t = d.method ?? "GET", r = {
583
+ body: d.body && [
584
584
  "POST",
585
585
  "PUT",
586
586
  "PATCH"
587
- ].includes(e) ? n(f.body, u, { json: !0 }) : void 0,
588
- headers: r(o(d, u), o(f.headers, u)),
589
- mapping: f.mapping,
590
- method: e,
591
- queryParams: o(f.queryParams, u) ?? {},
592
- responsePath: f.responsePath,
593
- url: m(n(f.url, u, { encode: !0 }), c)
587
+ ].includes(t) ? s(d.body, l, { json: !0 }) : void 0,
588
+ headers: n(m(u, l), m(d.headers, l)),
589
+ mapping: d.mapping,
590
+ method: t,
591
+ queryParams: m(d.queryParams, l) ?? {},
592
+ responsePath: d.responsePath,
593
+ url: e(s(d.url, l, { encode: !0 }), c)
594
594
  };
595
- return JSON.stringify(t);
595
+ return JSON.stringify(r);
596
596
  }, [
597
597
  c,
598
- f,
599
- u,
600
- d
598
+ d,
599
+ l,
600
+ u
601
601
  ]);
602
602
  T(() => {
603
- if (!h) {
604
- s({
603
+ if (!p) {
604
+ o({
605
605
  error: null,
606
606
  fetched: null,
607
607
  isLoading: !1
608
608
  });
609
609
  return;
610
610
  }
611
- let e = JSON.parse(h), n = new AbortController();
612
- return s((e) => ({
611
+ let e = JSON.parse(p), t = new AbortController();
612
+ return o((e) => ({
613
613
  ...e,
614
614
  error: null,
615
615
  isLoading: !0
616
616
  })), (async () => {
617
- let r = await l({
617
+ let n = await r({
618
618
  body: e.body,
619
619
  headers: e.headers,
620
620
  method: e.method,
621
621
  queryParams: e.queryParams,
622
- signal: n.signal,
622
+ signal: t.signal,
623
623
  url: e.url
624
624
  });
625
- if (!n.signal.aborted) {
626
- if (!r.success) {
627
- s({
628
- error: r.error ?? "Fetch failed",
625
+ if (!t.signal.aborted) {
626
+ if (!n.success) {
627
+ o({
628
+ error: n.error ?? "Fetch failed",
629
629
  fetched: null,
630
630
  isLoading: !1
631
631
  });
632
632
  return;
633
633
  }
634
- s({
634
+ o({
635
635
  error: null,
636
- fetched: t(r.data, e.responsePath, e.mapping),
636
+ fetched: v(n.data, e.responsePath, e.mapping),
637
637
  isLoading: !1
638
638
  });
639
639
  }
640
- })(), () => n.abort();
641
- }, [h]);
642
- let g = a.fetched ?? p ?? [];
640
+ })(), () => t.abort();
641
+ }, [p]);
642
+ let h = i.fetched ?? f ?? [];
643
643
  return {
644
- error: a.error,
645
- isLoading: a.isLoading,
646
- options: g
644
+ error: i.error,
645
+ isLoading: i.isLoading,
646
+ options: h
647
647
  };
648
- }, ft = (t, n) => {
649
- let [r, i] = D(!1), { id: a, value: o, placeholder: s } = t, { node: c, setValue: l, error: u, label: d, helperText: f, missingDependencies: p } = n, { options: m, isLoading: h, error: g } = dt(c), _ = e(), v = `${a}-trigger`, y = `${a}-error`, b = m.find((e) => e.value === o);
648
+ }, ft = (e, t) => {
649
+ let [n, r] = D(!1), { id: i, value: a, placeholder: o } = e, { node: s, setValue: c, error: l, label: u, helperText: d, missingDependencies: f } = t, { options: m, isLoading: h, error: g } = dt(s), _ = p(), v = `${i}-trigger`, y = `${i}-error`, b = m.find((e) => e.value === a);
650
650
  return /* @__PURE__ */ A(J, {
651
651
  className: "tg:mb-4",
652
652
  children: [
653
653
  /* @__PURE__ */ A(Q, {
654
654
  htmlFor: v,
655
- children: [d || c.data.name, c.data.required && /* @__PURE__ */ k("span", {
655
+ children: [u || s.data.name, s.data.required && /* @__PURE__ */ k("span", {
656
656
  className: "tg:text-red-500",
657
657
  children: "*"
658
658
  })]
659
659
  }),
660
660
  /* @__PURE__ */ k(nt, {
661
- missing: p,
661
+ missing: f,
662
662
  children: /* @__PURE__ */ A(ye, {
663
- open: r,
664
- onOpenChange: i,
663
+ open: n,
664
+ onOpenChange: r,
665
665
  children: [/* @__PURE__ */ k(be, {
666
666
  asChild: !0,
667
667
  children: /* @__PURE__ */ A(he, {
668
668
  id: v,
669
669
  variant: "outline",
670
670
  role: "combobox",
671
- "aria-expanded": r,
672
- "aria-invalid": !!u || void 0,
673
- "aria-describedby": u ? y : void 0,
674
- disabled: h || p.length > 0,
671
+ "aria-expanded": n,
672
+ "aria-invalid": !!l || void 0,
673
+ "aria-describedby": l ? y : void 0,
674
+ disabled: h || f.length > 0,
675
675
  className: "tg:w-full tg:justify-between tg:font-normal",
676
676
  children: [/* @__PURE__ */ A("span", {
677
677
  className: "tg:flex tg:items-center tg:gap-2 tg:truncate",
678
- children: [h && /* @__PURE__ */ k(I, { className: "tg:h-4 tg:w-4 tg:shrink-0 tg:animate-spin" }), o ? b?.label ? _(b.label) : o : s || _("renderer.defaultAutocompleteInput.selectOption")]
679
- }), /* @__PURE__ */ k(P, { className: "tg:ml-2 tg:size-4 tg:shrink-0 tg:opacity-50" })]
678
+ children: [h && /* @__PURE__ */ k(I, { className: "tg:h-4 tg:w-4 tg:shrink-0 tg:animate-spin" }), a ? b?.label ? _(b.label) : a : o || _("renderer.defaultAutocompleteInput.selectOption")]
679
+ }), /* @__PURE__ */ k(re, { className: "tg:ml-2 tg:size-4 tg:shrink-0 tg:opacity-50" })]
680
680
  })
681
681
  }), /* @__PURE__ */ k(xe, {
682
682
  className: "tg:w-(--radix-popover-trigger-width) tg:p-0",
683
683
  align: "start",
684
- children: /* @__PURE__ */ A(Ke, { children: [/* @__PURE__ */ k(qe, { placeholder: s || _("renderer.defaultAutocompleteInput.search") }), /* @__PURE__ */ A(Je, { children: [/* @__PURE__ */ k(Ye, { children: _("renderer.defaultAutocompleteInput.noResults") }), /* @__PURE__ */ k(Xe, { children: m.map((e) => /* @__PURE__ */ A(Ze, {
684
+ children: /* @__PURE__ */ A(Ke, { children: [/* @__PURE__ */ k(qe, { placeholder: o || _("renderer.defaultAutocompleteInput.search") }), /* @__PURE__ */ A(Je, { children: [/* @__PURE__ */ k(Ye, { children: _("renderer.defaultAutocompleteInput.noResults") }), /* @__PURE__ */ k(Xe, { children: m.map((e) => /* @__PURE__ */ A(Ze, {
685
685
  value: e.value,
686
686
  disabled: e.disabled,
687
687
  onSelect: (e) => {
688
- l(e === o ? "" : e), i(!1);
688
+ c(e === a ? "" : e), r(!1);
689
689
  },
690
- children: [/* @__PURE__ */ k(te, { className: q("tg:mr-2 tg:size-4", o === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ k(lt, {
690
+ children: [/* @__PURE__ */ k(te, { className: q("tg:mr-2 tg:size-4", a === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ k(lt, {
691
691
  label: _(e.label) || e.value,
692
692
  description: _(e.description),
693
693
  image: e.image
@@ -696,26 +696,26 @@ var lt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ A(O, { chil
696
696
  })]
697
697
  })
698
698
  }),
699
- u && /* @__PURE__ */ k(X, {
699
+ l && /* @__PURE__ */ k(X, {
700
700
  id: y,
701
- children: u
701
+ children: l
702
702
  }),
703
- g && !u && /* @__PURE__ */ k(X, { children: g }),
704
- f && !u && !g && /* @__PURE__ */ k(Y, { children: f })
703
+ g && !l && /* @__PURE__ */ k(X, { children: g }),
704
+ d && !l && !g && /* @__PURE__ */ k(Y, { children: d })
705
705
  ]
706
706
  });
707
- }, pt = (t, n) => {
708
- let { id: r, name: a, value: o } = t, { node: s, setValue: c, error: l, label: u, helperText: d, renderOptionExtras: f, compactOptions: p, missingDependencies: m } = n, { options: h, isLoading: g, error: _ } = dt(s), { optionsDisplayLimit: v } = i(), y = e();
709
- if (h.length > 0 || s.data.optionsSource) {
710
- let e = Array.isArray(o) ? o.map(String) : [], t = v ? h.slice(0, v) : h, n = h.length - t.length, i = (t, n) => {
711
- c(n ? [...e, t] : e.filter((e) => e !== t));
707
+ }, pt = (e, t) => {
708
+ let { id: n, name: r, value: i } = e, { node: o, setValue: s, error: c, label: l, helperText: u, renderOptionExtras: d, compactOptions: f, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = dt(o), { optionsDisplayLimit: v } = a(), y = p();
709
+ if (h.length > 0 || o.data.optionsSource) {
710
+ let e = Array.isArray(i) ? i.map(String) : [], t = v ? h.slice(0, v) : h, a = h.length - t.length, p = (t, n) => {
711
+ s(n ? [...e, t] : e.filter((e) => e !== t));
712
712
  };
713
713
  return /* @__PURE__ */ A(J, {
714
714
  className: "tg:mb-4",
715
715
  children: [
716
716
  /* @__PURE__ */ A(Q, {
717
717
  className: "tg:mb-1",
718
- children: [u || s.data.name, s.data.required && /* @__PURE__ */ k("span", {
718
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ k("span", {
719
719
  className: "tg:text-red-500",
720
720
  children: "*"
721
721
  })]
@@ -727,16 +727,16 @@ var lt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ A(O, { chil
727
727
  }),
728
728
  /* @__PURE__ */ A("div", {
729
729
  className: "tg:min-w-0 tg:space-y-2",
730
- children: [t.map((t, n) => {
731
- let o = y(t.description);
730
+ children: [t.map((t, i) => {
731
+ let a = y(t.description);
732
732
  return /* @__PURE__ */ A("div", {
733
- className: q("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:gap-3", p && "tg:pr-22"),
733
+ className: q("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:gap-3", f && "tg:pr-22"),
734
734
  children: [
735
735
  /* @__PURE__ */ k(ge, {
736
- id: `${r}-${t.value}`,
737
- name: a,
736
+ id: `${n}-${t.value}`,
737
+ name: r,
738
738
  checked: e.includes(String(t.value)),
739
- onCheckedChange: (e) => i(String(t.value), !!e),
739
+ onCheckedChange: (e) => p(String(t.value), !!e),
740
740
  disabled: t.disabled,
741
741
  className: "tg:mt-0.5"
742
742
  }),
@@ -746,30 +746,30 @@ var lt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ A(O, { chil
746
746
  className: "tg:h-8 tg:w-8 tg:shrink-0 tg:rounded tg:object-cover"
747
747
  }),
748
748
  /* @__PURE__ */ A("div", {
749
- className: q("tg:flex tg:flex-col", p && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
749
+ className: q("tg:flex tg:flex-col", f && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
750
750
  children: [/* @__PURE__ */ k(Q, {
751
- htmlFor: `${r}-${t.value}`,
752
- className: q("tg:cursor-pointer tg:font-normal tg:text-sm", p && "tg:block tg:max-w-full tg:truncate"),
751
+ htmlFor: `${n}-${t.value}`,
752
+ className: q("tg:cursor-pointer tg:font-normal tg:text-sm", f && "tg:block tg:max-w-full tg:truncate"),
753
753
  children: y(t.label) ? y(t.label) : t.value
754
- }), o && /* @__PURE__ */ k("span", {
755
- className: q("tg:text-muted-foreground tg:text-xs", p && "tg:block tg:max-w-full tg:truncate"),
756
- children: o
754
+ }), a && /* @__PURE__ */ k("span", {
755
+ className: q("tg:text-muted-foreground tg:text-xs", f && "tg:block tg:max-w-full tg:truncate"),
756
+ children: a
757
757
  })]
758
758
  }),
759
- f?.({
760
- index: n,
759
+ d?.({
760
+ index: i,
761
761
  option: t
762
762
  })
763
763
  ]
764
- }, t.value + n);
765
- }), n > 0 && /* @__PURE__ */ k("div", {
764
+ }, t.value + i);
765
+ }), a > 0 && /* @__PURE__ */ k("div", {
766
766
  className: "tg:px-2 tg:text-muted-foreground tg:text-xs",
767
767
  children: "…"
768
768
  })]
769
769
  }),
770
- l && /* @__PURE__ */ k(X, { children: l }),
771
- _ && !l && /* @__PURE__ */ k(X, { children: _ }),
772
- d && !l && !_ && /* @__PURE__ */ k(Y, { children: d })
770
+ c && /* @__PURE__ */ k(X, { children: c }),
771
+ _ && !c && /* @__PURE__ */ k(X, { children: _ }),
772
+ u && !c && !_ && /* @__PURE__ */ k(Y, { children: u })
773
773
  ]
774
774
  });
775
775
  }
@@ -778,19 +778,19 @@ var lt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ A(O, { chil
778
778
  children: [/* @__PURE__ */ A("div", {
779
779
  className: "tg:flex tg:items-center tg:gap-3",
780
780
  children: [/* @__PURE__ */ k(ge, {
781
- id: r,
782
- name: a,
783
- checked: typeof o == "boolean" ? o : !1,
784
- onCheckedChange: (e) => c(!!e)
781
+ id: n,
782
+ name: r,
783
+ checked: typeof i == "boolean" ? i : !1,
784
+ onCheckedChange: (e) => s(!!e)
785
785
  }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ A(Q, {
786
- htmlFor: r,
786
+ htmlFor: n,
787
787
  className: "tg:cursor-pointer tg:font-medium tg:text-sm",
788
- children: [u || s.data.name, s.data.required && /* @__PURE__ */ k("span", {
788
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ k("span", {
789
789
  className: "tg:text-red-500",
790
790
  children: "*"
791
791
  })]
792
- }), d && !l && /* @__PURE__ */ k(Y, { children: d })] })]
793
- }), l && /* @__PURE__ */ k(X, { children: l })]
792
+ }), u && !c && /* @__PURE__ */ k(Y, { children: u })] })]
793
+ }), c && /* @__PURE__ */ k(X, { children: c })]
794
794
  });
795
795
  };
796
796
  //#endregion
@@ -834,7 +834,7 @@ function mt({ className: e, classNames: t, showOutsideDays: n = !0, captionLayou
834
834
  ...t
835
835
  },
836
836
  components: {
837
- Chevron: ({ className: e, orientation: t, ...n }) => k(t === "left" ? M : t === "right" ? N : j, {
837
+ Chevron: ({ className: e, orientation: t, ...n }) => k(t === "left" ? N : t === "right" ? P : M, {
838
838
  className: q("tg:size-4", e),
839
839
  ...n
840
840
  }),
@@ -876,29 +876,29 @@ function ht({ className: e, day: t, modifiers: n, ...r }) {
876
876
  }
877
877
  //#endregion
878
878
  //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.tsx
879
- var gt = (t, n) => {
880
- let [r, i] = D(!1), { id: a, name: o, value: s, placeholder: c } = t, { node: l, setValue: u, error: d, label: f, helperText: p } = n, m = e(), h = s ? new Date(s) : void 0;
879
+ var gt = (e, t) => {
880
+ let [n, r] = D(!1), { id: i, name: a, value: o, placeholder: s } = e, { node: c, setValue: l, error: u, label: d, helperText: f } = t, m = p(), h = o ? new Date(o) : void 0;
881
881
  return /* @__PURE__ */ A(J, {
882
882
  className: "tg:mb-4",
883
883
  children: [
884
884
  /* @__PURE__ */ A(Q, {
885
- htmlFor: a,
886
- children: [f || l.data.name, l.data.required && /* @__PURE__ */ k("span", {
885
+ htmlFor: i,
886
+ children: [d || c.data.name, c.data.required && /* @__PURE__ */ k("span", {
887
887
  className: "tg:text-red-500",
888
888
  children: "*"
889
889
  })]
890
890
  }),
891
891
  /* @__PURE__ */ A(ye, {
892
- open: r,
893
- onOpenChange: i,
892
+ open: n,
893
+ onOpenChange: r,
894
894
  children: [/* @__PURE__ */ k(be, {
895
895
  asChild: !0,
896
896
  children: /* @__PURE__ */ A(he, {
897
897
  variant: "outline",
898
- id: a,
899
- name: o,
898
+ id: i,
899
+ name: a,
900
900
  className: "tg:w-full tg:justify-between tg:font-normal",
901
- children: [h ? h.toLocaleDateString() : c || m("renderer.defaultInputs.selectDate"), /* @__PURE__ */ k(j, { className: "tg:size-4" })]
901
+ children: [h ? h.toLocaleDateString() : s || m("renderer.defaultInputs.selectDate"), /* @__PURE__ */ k(M, { className: "tg:size-4" })]
902
902
  })
903
903
  }), /* @__PURE__ */ k(xe, {
904
904
  className: "tg:w-auto tg:overflow-hidden tg:p-0",
@@ -908,44 +908,44 @@ var gt = (t, n) => {
908
908
  selected: h,
909
909
  captionLayout: "dropdown",
910
910
  disabled: (e) => {
911
- if (l.data.disablePast) {
911
+ if (c.data.disablePast) {
912
912
  let t = /* @__PURE__ */ new Date();
913
913
  return t.setHours(0, 0, 0, 0), e < t;
914
914
  }
915
915
  return !1;
916
916
  },
917
917
  onSelect: (e) => {
918
- u(e ? e.toISOString() : ""), i(!1);
918
+ l(e ? e.toISOString() : ""), r(!1);
919
919
  }
920
920
  })
921
921
  })]
922
922
  }),
923
- d && /* @__PURE__ */ k(X, { children: d }),
924
- p && !d && /* @__PURE__ */ k(Y, { children: p })
923
+ u && /* @__PURE__ */ k(X, { children: u }),
924
+ f && !u && /* @__PURE__ */ k(Y, { children: f })
925
925
  ]
926
926
  });
927
- }, _t = (t, n) => {
928
- let [r, i] = D(!1), { id: a, value: o } = t, { node: s, setValue: c, error: l, label: u, helperText: d } = n, f = e(), p = Array.isArray(o) ? o : [], m = p[0] ? new Date(p[0]) : void 0, h = p[1] ? new Date(p[1]) : void 0;
927
+ }, _t = (e, t) => {
928
+ let [n, r] = D(!1), { id: i, value: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t, d = p(), f = Array.isArray(a) ? a : [], m = f[0] ? new Date(f[0]) : void 0, h = f[1] ? new Date(f[1]) : void 0;
929
929
  return /* @__PURE__ */ A(J, {
930
930
  className: "tg:mb-4",
931
931
  children: [
932
932
  /* @__PURE__ */ A(Q, {
933
- htmlFor: a,
934
- children: [u || s.data.name, s.data.required && /* @__PURE__ */ k("span", {
933
+ htmlFor: i,
934
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ k("span", {
935
935
  className: "tg:text-red-500",
936
936
  children: "*"
937
937
  })]
938
938
  }),
939
939
  /* @__PURE__ */ A(ye, {
940
- open: r,
941
- onOpenChange: i,
940
+ open: n,
941
+ onOpenChange: r,
942
942
  children: [/* @__PURE__ */ k(be, {
943
943
  asChild: !0,
944
944
  children: /* @__PURE__ */ A(he, {
945
- id: a,
945
+ id: i,
946
946
  variant: "outline",
947
947
  className: "tg:w-full tg:justify-between tg:font-normal",
948
- children: [m && h ? `${m.toLocaleDateString()} - ${h.toLocaleDateString()}` : m ? m.toLocaleDateString() : f("renderer.defaultInputs.selectDateRange"), /* @__PURE__ */ k(j, { className: "tg:size-4" })]
948
+ children: [m && h ? `${m.toLocaleDateString()} - ${h.toLocaleDateString()}` : m ? m.toLocaleDateString() : d("renderer.defaultInputs.selectDateRange"), /* @__PURE__ */ k(M, { className: "tg:size-4" })]
949
949
  })
950
950
  }), /* @__PURE__ */ k(xe, {
951
951
  className: "tg:w-auto tg:overflow-hidden tg:p-0",
@@ -958,25 +958,25 @@ var gt = (t, n) => {
958
958
  },
959
959
  captionLayout: "dropdown",
960
960
  disabled: (e) => {
961
- if (s.data.disablePast) {
961
+ if (o.data.disablePast) {
962
962
  let t = /* @__PURE__ */ new Date();
963
963
  return t.setHours(0, 0, 0, 0), e < t;
964
964
  }
965
965
  return !1;
966
966
  },
967
967
  onSelect: (e) => {
968
- c([e?.from ? e.from.toISOString() : void 0, e?.to ? e.to.toISOString() : void 0]);
968
+ s([e?.from ? e.from.toISOString() : void 0, e?.to ? e.to.toISOString() : void 0]);
969
969
  },
970
970
  numberOfMonths: 2
971
971
  })
972
972
  })]
973
973
  }),
974
- l && /* @__PURE__ */ k(X, { children: l }),
975
- d && !l && /* @__PURE__ */ k(Y, { children: d })
974
+ c && /* @__PURE__ */ k(X, { children: c }),
975
+ u && !c && /* @__PURE__ */ k(Y, { children: u })
976
976
  ]
977
977
  });
978
978
  }, vt = (e, t) => {
979
- let { id: n, name: r, placeholder: i } = e, { node: a, setValue: o, error: s, label: c, helperText: l } = t;
979
+ let { id: n, name: r, placeholder: i } = e, { node: a, setValue: o, error: s, label: c, helperText: u } = t;
980
980
  return /* @__PURE__ */ A(J, {
981
981
  className: "tg:mb-4",
982
982
  children: [
@@ -998,16 +998,16 @@ var gt = (t, n) => {
998
998
  return;
999
999
  }
1000
1000
  if (a.data.multiple) {
1001
- o(await u(Array.from(t)));
1001
+ o(await y(Array.from(t)));
1002
1002
  return;
1003
1003
  }
1004
- o(await y(t[0]));
1004
+ o(await l(t[0]));
1005
1005
  },
1006
1006
  multiple: a.data.multiple,
1007
1007
  placeholder: i
1008
1008
  }),
1009
1009
  s && /* @__PURE__ */ k(X, { children: s }),
1010
- l && !s && /* @__PURE__ */ k(Y, { children: l })
1010
+ u && !s && /* @__PURE__ */ k(Y, { children: u })
1011
1011
  ]
1012
1012
  });
1013
1013
  }, yt = (e, t) => {
@@ -1027,79 +1027,79 @@ var gt = (t, n) => {
1027
1027
  }), St = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
1028
1028
  let i = t[r], a = i == null ? "" : String(i);
1029
1029
  return n ? encodeURIComponent(a) : a;
1030
- }), Ct = (t, n) => {
1031
- let [s, l] = D(!1), [u, d] = D(null), [p, h] = D([]), [g, _] = D(""), [y, b] = D(!1), { id: x, name: S, value: w, placeholder: ne } = t, { node: j, setValue: M, error: N, label: re, helperText: F, missingDependencies: L } = n, { formValues: R, inputNodes: ie, headers: ae, baseUrl: z } = i(), { httpConfig: B } = j.data, oe = E(!1), se = E(!1), ce = E(""), V = e(), H = E(B), U = E(R), le = E(ie), W = E(ae), G = E(z), ue = E(M), de = E(null), K = E(null), fe = ee(() => B?.url ? bt(B.url) : [], [B?.url]), pe = fe.length > 0, me = ee(() => fe.map((e) => `${e}:${String(R[e] ?? "")}`).join("|"), [fe, R]), ge = ee(() => B?.url ? pe ? xt(B.url, R) : !0 : !1, [
1032
- B?.url,
1030
+ }), Ct = (r, i) => {
1031
+ let [s, l] = D(!1), [u, f] = D(null), [h, g] = D([]), [_, v] = D(""), [y, b] = D(!1), { id: x, name: S, value: w, placeholder: j } = r, { node: M, setValue: N, error: P, label: ne, helperText: F, missingDependencies: L } = i, { formValues: R, inputNodes: ie, headers: ae, baseUrl: oe } = a(), { httpConfig: z } = M.data, B = E(!1), se = E(!1), ce = E(""), V = p(), H = E(z), U = E(R), le = E(ie), W = E(ae), G = E(oe), ue = E(N), de = E(null), K = E(null), fe = ee(() => z?.url ? bt(z.url) : [], [z?.url]), pe = fe.length > 0, me = ee(() => fe.map((e) => `${e}:${String(R[e] ?? "")}`).join("|"), [fe, R]), ge = ee(() => z?.url ? pe ? xt(z.url, R) : !0 : !1, [
1032
+ z?.url,
1033
1033
  pe,
1034
1034
  R
1035
- ]), $ = C(async (e) => {
1035
+ ]), $ = C(async (r) => {
1036
1036
  K.current && K.current.abort();
1037
- let t = new AbortController();
1038
- K.current = t;
1039
- let n = H.current, i = U.current, s = ue.current;
1040
- if (!n?.url) {
1041
- d(V("renderer.defaultHttpInput.noUrlConfigured")), K.current = null;
1037
+ let i = new AbortController();
1038
+ K.current = i;
1039
+ let a = H.current, s = U.current, u = ue.current;
1040
+ if (!a?.url) {
1041
+ f(V("renderer.defaultHttpInput.noUrlConfigured")), K.current = null;
1042
1042
  return;
1043
1043
  }
1044
- if (n.url && !xt(n.url, i)) {
1044
+ if (a.url && !xt(a.url, s)) {
1045
1045
  K.current = null;
1046
1046
  return;
1047
1047
  }
1048
- l(!0), d(null);
1048
+ l(!0), f(null);
1049
1049
  try {
1050
- let u = m(St(n.url, i, !0), G.current), p = c(n.searchParam && e ? `${u}${u.includes("?") ? "&" : "?"}${n.searchParam}=${encodeURIComponent(e)}` : u, o(n.queryParams, i)), g = r({ "Content-Type": "application/json" }, o(W.current, i), o(n.headers, i)), _ = [
1050
+ let p = e(St(a.url, s, !0), G.current), h = t(a.searchParam && r ? `${p}${p.includes("?") ? "&" : "?"}${a.searchParam}=${encodeURIComponent(r)}` : p, m(a.queryParams, s)), _ = n({ "Content-Type": "application/json" }, m(W.current, s), m(a.headers, s)), v = [
1051
1051
  "POST",
1052
1052
  "PUT",
1053
1053
  "PATCH"
1054
- ].includes(n.method || "") ? n.sendAllFormValues ? JSON.stringify(f(i, le.current)) : n.body ? St(n.body, i) : void 0 : void 0, y = setTimeout(() => t.abort(), 3e4), b = await fetch(p, {
1055
- body: _ || void 0,
1056
- headers: Object.fromEntries(Object.entries(g).filter(([, e]) => e)),
1057
- method: n.method || "GET",
1058
- signal: t.signal
1054
+ ].includes(a.method || "") ? a.sendAllFormValues ? JSON.stringify(d(s, le.current)) : a.body ? St(a.body, s) : void 0 : void 0, y = setTimeout(() => i.abort(), 3e4), b = await fetch(h, {
1055
+ body: v || void 0,
1056
+ headers: Object.fromEntries(Object.entries(_).filter(([, e]) => e)),
1057
+ method: a.method || "GET",
1058
+ signal: i.signal
1059
1059
  });
1060
1060
  if (clearTimeout(y), !b.ok) {
1061
- d(`HTTP Error ${b.status}: ${b.statusText}`), l(!1);
1061
+ f(`HTTP Error ${b.status}: ${b.statusText}`), l(!1);
1062
1062
  return;
1063
1063
  }
1064
- let x = a(await b.json()), S = n.responsePath ? v(x, n.responsePath) : x;
1065
- if (n.responseMapping && Array.isArray(S)) {
1066
- let { valueField: e = "value", labelField: t = "label", descriptionField: r, imageField: i } = n.responseMapping;
1067
- h(S.map((n) => {
1068
- let a = r ? v(n, r) : void 0, o = i ? v(n, i) : void 0;
1064
+ let x = o(await b.json()), S = a.responsePath ? c(x, a.responsePath) : x;
1065
+ if (a.responseMapping && Array.isArray(S)) {
1066
+ let { valueField: e = "value", labelField: t = "label", descriptionField: n, imageField: r } = a.responseMapping;
1067
+ g(S.map((i) => {
1068
+ let a = n ? c(i, n) : void 0, o = r ? c(i, r) : void 0;
1069
1069
  return {
1070
1070
  description: a != null && a !== "" ? String(a) : void 0,
1071
1071
  image: typeof o == "string" && o !== "" ? o : void 0,
1072
- label: String(v(n, t) || ""),
1073
- value: String(v(n, e) || "")
1072
+ label: String(c(i, t) || ""),
1073
+ value: String(c(i, e) || "")
1074
1074
  };
1075
1075
  }));
1076
- } else s(typeof S == "string" ? S : JSON.stringify(S));
1076
+ } else u(typeof S == "string" ? S : JSON.stringify(S));
1077
1077
  } catch (e) {
1078
1078
  if (e instanceof Error && e.name === "AbortError") return;
1079
- d(e instanceof Error ? e.message : V("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
1079
+ f(e instanceof Error ? e.message : V("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
1080
1080
  } finally {
1081
1081
  l(!1), K.current = null;
1082
1082
  }
1083
1083
  }, [V]);
1084
1084
  if (T(() => {
1085
- H.current = B, U.current = R, le.current = ie, W.current = ae, G.current = z, ue.current = M, de.current = $;
1085
+ H.current = z, U.current = R, le.current = ie, W.current = ae, G.current = oe, ue.current = N, de.current = $;
1086
1086
  }, [
1087
- B,
1087
+ z,
1088
1088
  R,
1089
1089
  ie,
1090
1090
  ae,
1091
- z,
1092
- M,
1091
+ oe,
1092
+ N,
1093
1093
  $
1094
1094
  ]), T(() => () => {
1095
- K.current && K.current.abort(), oe.current = !1, se.current = !1;
1095
+ K.current && K.current.abort(), B.current = !1, se.current = !1;
1096
1096
  }, []), T(() => {
1097
- if (oe.current) return;
1098
- oe.current = !0;
1097
+ if (B.current) return;
1098
+ B.current = !0;
1099
1099
  let e = H.current, t = U.current, n = de.current, r = e?.url && xt(e.url, t);
1100
1100
  e?.fetchOnMount && r && n && (n(), e.url && (ce.current = bt(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1101
1101
  }, []), T(() => {
1102
- if (!oe.current || !pe || ce.current === me || !ge) return;
1102
+ if (!B.current || !pe || ce.current === me || !ge) return;
1103
1103
  let e = setTimeout(() => {
1104
1104
  $(), ce.current = me;
1105
1105
  }, 500);
@@ -1117,40 +1117,40 @@ var gt = (t, n) => {
1117
1117
  let e = H.current, t = U.current, n = de.current, r = e?.url && xt(e.url, t);
1118
1118
  e?.fetchOnMount && r && n && (n(), e.url && (ce.current = bt(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1119
1119
  }, [ee(() => JSON.stringify({
1120
- body: B?.body,
1121
- fetchOnMount: B?.fetchOnMount,
1122
- headers: B?.headers,
1123
- method: B?.method,
1124
- queryParams: B?.queryParams,
1125
- responseMapping: B?.responseMapping,
1126
- responsePath: B?.responsePath,
1127
- searchParam: B?.searchParam,
1128
- sendAllFormValues: B?.sendAllFormValues,
1129
- url: B?.url
1130
- }), [B])]), T(() => {
1131
- if (!(B?.searchParam && g)) return;
1120
+ body: z?.body,
1121
+ fetchOnMount: z?.fetchOnMount,
1122
+ headers: z?.headers,
1123
+ method: z?.method,
1124
+ queryParams: z?.queryParams,
1125
+ responseMapping: z?.responseMapping,
1126
+ responsePath: z?.responsePath,
1127
+ searchParam: z?.searchParam,
1128
+ sendAllFormValues: z?.sendAllFormValues,
1129
+ url: z?.url
1130
+ }), [z])]), T(() => {
1131
+ if (!(z?.searchParam && _)) return;
1132
1132
  let e = setTimeout(() => {
1133
- $(g);
1133
+ $(_);
1134
1134
  }, 300);
1135
1135
  return () => clearTimeout(e);
1136
1136
  }, [
1137
- g,
1138
- B?.searchParam,
1137
+ _,
1138
+ z?.searchParam,
1139
1139
  $
1140
- ]), B?.responseMapping) {
1141
- let e = Array.isArray(w) ? w[0] : w, t = p.find((t) => t.value === e);
1142
- if (B.searchParam) {
1143
- let e = s && B?.showLoading ? /* @__PURE__ */ A("div", {
1140
+ ]), z?.responseMapping) {
1141
+ let e = Array.isArray(w) ? w[0] : w, t = h.find((t) => t.value === e);
1142
+ if (z.searchParam) {
1143
+ let e = s && z?.showLoading ? /* @__PURE__ */ A("div", {
1144
1144
  className: "tg:flex tg:items-center tg:gap-2",
1145
1145
  children: [/* @__PURE__ */ k(I, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ k("span", {
1146
1146
  className: "tg:text-muted-foreground",
1147
- children: t?.label || ne || V("renderer.defaultHttpInput.search")
1147
+ children: t?.label || j || V("renderer.defaultHttpInput.search")
1148
1148
  })]
1149
- }) : t?.label || ne || V("renderer.defaultHttpInput.search");
1149
+ }) : t?.label || j || V("renderer.defaultHttpInput.search");
1150
1150
  return /* @__PURE__ */ A(J, {
1151
1151
  className: "tg:mb-4",
1152
1152
  children: [
1153
- /* @__PURE__ */ A(Q, { children: [re || j.data.name, j.data.required && /* @__PURE__ */ k("span", {
1153
+ /* @__PURE__ */ A(Q, { children: [ne || M.data.name, M.data.required && /* @__PURE__ */ k("span", {
1154
1154
  className: "tg:text-red-500",
1155
1155
  children: "*"
1156
1156
  })] }),
@@ -1167,7 +1167,7 @@ var gt = (t, n) => {
1167
1167
  "aria-expanded": y,
1168
1168
  disabled: L.length > 0,
1169
1169
  className: "tg:w-full tg:justify-between",
1170
- children: [e, /* @__PURE__ */ k(P, { className: "tg:ml-2 tg:h-4 tg:w-4 tg:shrink-0 tg:opacity-50" })]
1170
+ children: [e, /* @__PURE__ */ k(re, { className: "tg:ml-2 tg:h-4 tg:w-4 tg:shrink-0 tg:opacity-50" })]
1171
1171
  })
1172
1172
  }), /* @__PURE__ */ k(xe, {
1173
1173
  className: "tg:w-[var(--radix-popover-trigger-width)] tg:p-0",
@@ -1176,9 +1176,9 @@ var gt = (t, n) => {
1176
1176
  shouldFilter: !1,
1177
1177
  children: [/* @__PURE__ */ k(qe, {
1178
1178
  placeholder: V("renderer.defaultHttpInput.search"),
1179
- value: g,
1179
+ value: _,
1180
1180
  onValueChange: (e) => {
1181
- _(e), d(null);
1181
+ v(e), f(null);
1182
1182
  }
1183
1183
  }), /* @__PURE__ */ A(Je, { children: [
1184
1184
  s && /* @__PURE__ */ k("div", {
@@ -1189,15 +1189,15 @@ var gt = (t, n) => {
1189
1189
  className: "tg:p-4 tg:text-destructive tg:text-sm",
1190
1190
  children: [/* @__PURE__ */ k("div", { children: u }), /* @__PURE__ */ k("button", {
1191
1191
  type: "button",
1192
- onClick: () => $(g),
1192
+ onClick: () => $(_),
1193
1193
  className: "tg:mt-2 tg:block tg:text-primary tg:hover:underline",
1194
1194
  children: V("renderer.defaultHttpInput.retry")
1195
1195
  })]
1196
1196
  }),
1197
- !(s || u) && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(Ye, { children: V("renderer.defaultHttpInput.noResults") }), /* @__PURE__ */ k(Xe, { children: p.map((e) => /* @__PURE__ */ A(Ze, {
1197
+ !(s || u) && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(Ye, { children: V("renderer.defaultHttpInput.noResults") }), /* @__PURE__ */ k(Xe, { children: h.map((e) => /* @__PURE__ */ A(Ze, {
1198
1198
  value: e.value,
1199
1199
  onSelect: () => {
1200
- M(e.value), b(!1);
1200
+ N(e.value), b(!1);
1201
1201
  },
1202
1202
  children: [/* @__PURE__ */ k(te, { className: q("tg:mr-2 tg:h-4 tg:w-4", w === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ k(lt, {
1203
1203
  label: e.label,
@@ -1210,22 +1210,22 @@ var gt = (t, n) => {
1210
1210
  })]
1211
1211
  })
1212
1212
  }),
1213
- N && /* @__PURE__ */ k(X, { children: N }),
1214
- F && !N && /* @__PURE__ */ k(Y, { children: F })
1213
+ P && /* @__PURE__ */ k(X, { children: P }),
1214
+ F && !P && /* @__PURE__ */ k(Y, { children: F })
1215
1215
  ]
1216
1216
  });
1217
1217
  }
1218
- let n = s && B?.showLoading, r = L.length === 0 && p.length === 0 && !n ? u ?? V("renderer.defaultHttpInput.noDataAvailable") : void 0, i = /* @__PURE__ */ A(Se, {
1218
+ let n = s && z?.showLoading, r = L.length === 0 && h.length === 0 && !n ? u ?? V("renderer.defaultHttpInput.noDataAvailable") : void 0, i = /* @__PURE__ */ A(Se, {
1219
1219
  value: Array.isArray(w) ? w[0] ?? "" : w ?? "",
1220
- onValueChange: (e) => M(e),
1221
- disabled: n || p.length === 0,
1220
+ onValueChange: (e) => N(e),
1221
+ disabled: n || h.length === 0,
1222
1222
  name: S,
1223
1223
  children: [/* @__PURE__ */ A(Te, {
1224
1224
  id: x,
1225
1225
  name: S,
1226
1226
  className: "tg:w-full",
1227
- children: [n && /* @__PURE__ */ k(I, { className: "tg:mr-2 tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ k(we, { placeholder: ne || V("renderer.defaultHttpInput.selectOption") })]
1228
- }), /* @__PURE__ */ k(Ee, { children: /* @__PURE__ */ k(Ce, { children: p.map((e, t) => /* @__PURE__ */ k(Oe, {
1227
+ children: [n && /* @__PURE__ */ k(I, { className: "tg:mr-2 tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ k(we, { placeholder: j || V("renderer.defaultHttpInput.selectOption") })]
1228
+ }), /* @__PURE__ */ k(Ee, { children: /* @__PURE__ */ k(Ce, { children: h.map((e, t) => /* @__PURE__ */ k(Oe, {
1229
1229
  value: e.value,
1230
1230
  children: /* @__PURE__ */ k(lt, {
1231
1231
  label: e.label,
@@ -1239,7 +1239,7 @@ var gt = (t, n) => {
1239
1239
  children: [
1240
1240
  /* @__PURE__ */ A(Q, {
1241
1241
  htmlFor: x,
1242
- children: [re || j.data.name, j.data.required && /* @__PURE__ */ k("span", {
1242
+ children: [ne || M.data.name, M.data.required && /* @__PURE__ */ k("span", {
1243
1243
  className: "tg:text-red-500",
1244
1244
  children: "*"
1245
1245
  })]
@@ -1254,8 +1254,8 @@ var gt = (t, n) => {
1254
1254
  })
1255
1255
  }), /* @__PURE__ */ k(Fe, { children: /* @__PURE__ */ k("p", { children: r }) })] }) }) : i
1256
1256
  }),
1257
- N && /* @__PURE__ */ k(X, { children: N }),
1258
- F && !N && /* @__PURE__ */ k(Y, { children: F })
1257
+ P && /* @__PURE__ */ k(X, { children: P }),
1258
+ F && !P && /* @__PURE__ */ k(Y, { children: F })
1259
1259
  ]
1260
1260
  });
1261
1261
  }
@@ -1264,7 +1264,7 @@ var gt = (t, n) => {
1264
1264
  children: [
1265
1265
  /* @__PURE__ */ A(Q, {
1266
1266
  htmlFor: x,
1267
- children: [re || j.data.name, j.data.required && /* @__PURE__ */ k("span", {
1267
+ children: [ne || M.data.name, M.data.required && /* @__PURE__ */ k("span", {
1268
1268
  className: "tg:text-red-500",
1269
1269
  children: "*"
1270
1270
  })]
@@ -1277,8 +1277,8 @@ var gt = (t, n) => {
1277
1277
  readOnly: !0,
1278
1278
  disabled: !0
1279
1279
  }),
1280
- N && /* @__PURE__ */ k(X, { children: N }),
1281
- F && !N && /* @__PURE__ */ k(Y, { children: F })
1280
+ P && /* @__PURE__ */ k(X, { children: P }),
1281
+ F && !P && /* @__PURE__ */ k(Y, { children: F })
1282
1282
  ]
1283
1283
  });
1284
1284
  }, wt = (e, t) => {
@@ -1330,7 +1330,7 @@ var gt = (t, n) => {
1330
1330
  u && !c && /* @__PURE__ */ k(Y, { children: u })
1331
1331
  ]
1332
1332
  });
1333
- }, Et = z("tg:group/field tg:flex tg:w-full tg:gap-3 tg:data-[invalid=true]:text-destructive", {
1333
+ }, Et = oe("tg:group/field tg:flex tg:w-full tg:gap-3 tg:data-[invalid=true]:text-destructive", {
1334
1334
  defaultVariants: { orientation: "vertical" },
1335
1335
  variants: { orientation: {
1336
1336
  horizontal: [
@@ -1406,15 +1406,15 @@ function Nt({ className: e, ...t }) {
1406
1406
  }
1407
1407
  //#endregion
1408
1408
  //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.tsx
1409
- var Pt = (t, n) => {
1410
- let { id: r, name: a, value: o } = t, { node: s, setValue: c, error: l, label: u, helperText: d, renderOptionExtras: f, compactOptions: p, missingDependencies: m } = n, { options: h, isLoading: g, error: _ } = dt(s), { optionsDisplayLimit: v } = i(), y = e(), b = o ? String(o) : "", x = s.data.variant !== "default", S = `${r}-label`, C = v ? h.slice(0, v) : h, w = h.length - C.length;
1409
+ var Pt = (e, t) => {
1410
+ let { id: n, name: r, value: i } = e, { node: o, setValue: s, error: c, label: l, helperText: u, renderOptionExtras: d, compactOptions: f, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = dt(o), { optionsDisplayLimit: v } = a(), y = p(), b = i ? String(i) : "", x = o.data.variant !== "default", S = `${n}-label`, C = v ? h.slice(0, v) : h, w = h.length - C.length;
1411
1411
  return /* @__PURE__ */ A(J, {
1412
1412
  className: "tg:mb-4",
1413
1413
  children: [
1414
1414
  /* @__PURE__ */ A(Q, {
1415
1415
  className: "tg:mb-1",
1416
1416
  id: S,
1417
- children: [u || s.data.name, s.data.required && /* @__PURE__ */ k("span", {
1417
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ k("span", {
1418
1418
  className: "tg:text-red-500",
1419
1419
  children: "*"
1420
1420
  })]
@@ -1426,15 +1426,15 @@ var Pt = (t, n) => {
1426
1426
  }),
1427
1427
  /* @__PURE__ */ A(Mt, {
1428
1428
  value: b,
1429
- onValueChange: (e) => c(e),
1429
+ onValueChange: (e) => s(e),
1430
1430
  "aria-labelledby": S,
1431
- name: a,
1431
+ name: r,
1432
1432
  className: q("tg:min-w-0", x && "tg:flex tg:flex-col tg:gap-2"),
1433
1433
  children: [C.map((e, t) => {
1434
- let n = `${r}-${e.value}`, i = y(e.label) || e.value, a = y(e.description), o = String(e.value);
1434
+ let r = `${n}-${e.value}`, i = y(e.label) || e.value, a = y(e.description), o = String(e.value);
1435
1435
  return x ? /* @__PURE__ */ A(kt, {
1436
- htmlFor: n,
1437
- className: q("tg:group/option tg:pointer-events-auto tg:relative", p && "tg:group-hover/option:pr-16"),
1436
+ htmlFor: r,
1437
+ className: q("tg:group/option tg:pointer-events-auto tg:relative", f && "tg:group-hover/option:pr-16"),
1438
1438
  children: [/* @__PURE__ */ A(Dt, {
1439
1439
  orientation: "horizontal",
1440
1440
  "data-disabled": e.disabled || void 0,
@@ -1445,33 +1445,33 @@ var Pt = (t, n) => {
1445
1445
  className: "tg:h-10 tg:w-10 tg:shrink-0 tg:self-center tg:rounded tg:object-cover"
1446
1446
  }),
1447
1447
  /* @__PURE__ */ A(Ot, {
1448
- className: q(p && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
1448
+ className: q(f && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
1449
1449
  children: [/* @__PURE__ */ k(At, {
1450
- className: q(p && "tg:block tg:max-w-full tg:truncate"),
1450
+ className: q(f && "tg:block tg:max-w-full tg:truncate"),
1451
1451
  children: i
1452
1452
  }), a && /* @__PURE__ */ k(jt, {
1453
- className: q(p && "tg:block tg:max-w-full tg:truncate"),
1453
+ className: q(f && "tg:block tg:max-w-full tg:truncate"),
1454
1454
  children: a
1455
1455
  })]
1456
1456
  }),
1457
1457
  /* @__PURE__ */ k(Nt, {
1458
1458
  value: o,
1459
- id: n,
1459
+ id: r,
1460
1460
  disabled: e.disabled,
1461
- className: q(p && "tg:ml-auto tg:shrink-0 tg:group-hover/option:invisible")
1461
+ className: q(f && "tg:ml-auto tg:shrink-0 tg:group-hover/option:invisible")
1462
1462
  })
1463
1463
  ]
1464
- }), f?.({
1464
+ }), d?.({
1465
1465
  index: t,
1466
1466
  option: e,
1467
1467
  variant: "card"
1468
1468
  })]
1469
1469
  }, e.value + t) : /* @__PURE__ */ A("div", {
1470
- className: q("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:space-x-2", p && "tg:min-w-0 tg:pr-22"),
1470
+ className: q("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:space-x-2", f && "tg:min-w-0 tg:pr-22"),
1471
1471
  children: [
1472
1472
  /* @__PURE__ */ k(Nt, {
1473
1473
  value: o,
1474
- id: n,
1474
+ id: r,
1475
1475
  disabled: e.disabled,
1476
1476
  className: "tg:mt-0.5"
1477
1477
  }),
@@ -1481,17 +1481,17 @@ var Pt = (t, n) => {
1481
1481
  className: "tg:h-8 tg:w-8 tg:rounded tg:object-cover"
1482
1482
  }),
1483
1483
  /* @__PURE__ */ A("div", {
1484
- className: q("tg:flex tg:flex-col", p && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
1484
+ className: q("tg:flex tg:flex-col", f && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
1485
1485
  children: [/* @__PURE__ */ k(Q, {
1486
- htmlFor: n,
1487
- className: q("tg:cursor-pointer tg:font-normal tg:text-sm", p && "tg:block tg:max-w-full tg:truncate"),
1486
+ htmlFor: r,
1487
+ className: q("tg:cursor-pointer tg:font-normal tg:text-sm", f && "tg:block tg:max-w-full tg:truncate"),
1488
1488
  children: i
1489
1489
  }), a && /* @__PURE__ */ k("span", {
1490
- className: q("tg:text-muted-foreground tg:text-xs", p && "tg:block tg:max-w-full tg:truncate"),
1490
+ className: q("tg:text-muted-foreground tg:text-xs", f && "tg:block tg:max-w-full tg:truncate"),
1491
1491
  children: a
1492
1492
  })]
1493
1493
  }),
1494
- f?.({
1494
+ d?.({
1495
1495
  index: t,
1496
1496
  option: e,
1497
1497
  variant: "default"
@@ -1503,36 +1503,36 @@ var Pt = (t, n) => {
1503
1503
  children: "…"
1504
1504
  })]
1505
1505
  }),
1506
- l && /* @__PURE__ */ k(X, { children: l }),
1507
- _ && !l && /* @__PURE__ */ k(X, { children: _ }),
1508
- d && !l && !_ && /* @__PURE__ */ k(Y, { children: d })
1506
+ c && /* @__PURE__ */ k(X, { children: c }),
1507
+ _ && !c && /* @__PURE__ */ k(X, { children: _ }),
1508
+ u && !c && !_ && /* @__PURE__ */ k(Y, { children: u })
1509
1509
  ]
1510
1510
  });
1511
- }, Ft = (t, n) => {
1512
- let { id: r, name: i, value: a, placeholder: o } = t, { node: s, setValue: c, error: l, label: u, helperText: d, missingDependencies: f } = n, { options: p, isLoading: m, error: h } = dt(s), g = e(), _ = a ? String(a) : "";
1511
+ }, Ft = (e, t) => {
1512
+ let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u, missingDependencies: d } = t, { options: f, isLoading: m, error: h } = dt(o), g = p(), _ = i ? String(i) : "";
1513
1513
  return /* @__PURE__ */ A(J, {
1514
1514
  className: "tg:mb-4",
1515
1515
  children: [
1516
1516
  /* @__PURE__ */ A(Q, {
1517
- htmlFor: r,
1518
- children: [u || s.data.name, s.data.required && /* @__PURE__ */ k("span", {
1517
+ htmlFor: n,
1518
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ k("span", {
1519
1519
  className: "tg:text-red-500",
1520
1520
  children: "*"
1521
1521
  })]
1522
1522
  }),
1523
1523
  /* @__PURE__ */ k(nt, {
1524
- missing: f,
1524
+ missing: d,
1525
1525
  children: /* @__PURE__ */ A(Se, {
1526
- name: i,
1526
+ name: r,
1527
1527
  value: _,
1528
- onValueChange: (e) => c(e),
1529
- disabled: m || f.length > 0,
1528
+ onValueChange: (e) => s(e),
1529
+ disabled: m || d.length > 0,
1530
1530
  children: [/* @__PURE__ */ A(Te, {
1531
- id: r,
1532
- name: i,
1531
+ id: n,
1532
+ name: r,
1533
1533
  className: "tg:w-full",
1534
- children: [m && /* @__PURE__ */ k(I, { className: "tg:mr-2 tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ k(we, { placeholder: o || g("renderer.defaultSelectInput.selectOption") })]
1535
- }), /* @__PURE__ */ k(Ee, { children: /* @__PURE__ */ k(Ce, { children: p.map((e, t) => /* @__PURE__ */ k(Oe, {
1534
+ children: [m && /* @__PURE__ */ k(I, { className: "tg:mr-2 tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ k(we, { placeholder: a || g("renderer.defaultSelectInput.selectOption") })]
1535
+ }), /* @__PURE__ */ k(Ee, { children: /* @__PURE__ */ k(Ce, { children: f.map((e, t) => /* @__PURE__ */ k(Oe, {
1536
1536
  value: String(e.value),
1537
1537
  disabled: e.disabled,
1538
1538
  children: /* @__PURE__ */ k(lt, {
@@ -1543,99 +1543,100 @@ var Pt = (t, n) => {
1543
1543
  }, `${e.value}-${t}`)) }) })]
1544
1544
  })
1545
1545
  }),
1546
- l && /* @__PURE__ */ k(X, { children: l }),
1547
- h && !l && /* @__PURE__ */ k(X, { children: h }),
1548
- d && !l && !h && /* @__PURE__ */ k(Y, { children: d })
1546
+ c && /* @__PURE__ */ k(X, { children: c }),
1547
+ h && !c && /* @__PURE__ */ k(X, { children: h }),
1548
+ u && !c && !h && /* @__PURE__ */ k(Y, { children: u })
1549
1549
  ]
1550
1550
  });
1551
- }, It = ({ children: e, onSubmit: t }) => /* @__PURE__ */ k("form", {
1552
- onSubmit: t,
1551
+ }, It = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ k("form", {
1552
+ id: t,
1553
+ onSubmit: n,
1553
1554
  className: "tg:mx-auto tg:max-w-2xl tg:gap-y-3",
1554
1555
  children: e
1555
- }), Lt = ({ children: t, missingFields: n = [] }) => {
1556
- let r = n.length > 0, i = e();
1557
- return r ? /* @__PURE__ */ k(Me, { children: /* @__PURE__ */ A(Ne, { children: [/* @__PURE__ */ k(Pe, {
1556
+ }), Lt = ({ children: e, missingFields: t = [] }) => {
1557
+ let n = t.length > 0, r = p();
1558
+ return n ? /* @__PURE__ */ k(Me, { children: /* @__PURE__ */ A(Ne, { children: [/* @__PURE__ */ k(Pe, {
1558
1559
  asChild: !0,
1559
1560
  children: /* @__PURE__ */ k("span", {
1560
1561
  className: "tg:inline-flex",
1561
- children: t
1562
+ children: e
1562
1563
  })
1563
1564
  }), /* @__PURE__ */ k(Fe, { children: /* @__PURE__ */ A("div", {
1564
1565
  className: "tg:space-y-1",
1565
1566
  children: [/* @__PURE__ */ A("p", {
1566
1567
  className: "tg:font-semibold",
1567
- children: [i("renderer.defaultSubmitButton.requiredFieldsMissing"), ":"]
1568
+ children: [r("renderer.defaultSubmitButton.requiredFieldsMissing"), ":"]
1568
1569
  }), /* @__PURE__ */ k("ul", {
1569
1570
  className: "tg:list-inside tg:list-disc",
1570
- children: n.map((e, t) => /* @__PURE__ */ k("li", { children: e }, t))
1571
+ children: t.map((e, t) => /* @__PURE__ */ k("li", { children: e }, t))
1571
1572
  })]
1572
- }) })] }) }) : t;
1573
- }, Rt = ({ label: t, children: n, isFirstStep: r, isLastStep: i, canContinue: a, isSubmitting: o, onBack: s, onContinue: c, missingFields: l }) => {
1574
- let u = e(), d = /* @__PURE__ */ k("button", {
1573
+ }) })] }) }) : e;
1574
+ }, Rt = ({ label: e, children: t, canGoBack: n, isLastStep: r, canContinue: i, isSubmitting: a, onBack: o, onContinue: s, missingFields: c }) => {
1575
+ let l = p(), u = /* @__PURE__ */ A("button", {
1575
1576
  type: "button",
1576
- onClick: c,
1577
- disabled: !a || o,
1578
- className: "tg:rounded-md tg:bg-blue-500 tg:px-4 tg:py-2 tg:font-medium tg:text-sm tg:text-white tg:transition-colors tg:hover:bg-blue-600 tg:focus:outline-none tg:focus:ring-2 tg:focus:ring-blue-500 tg:focus:ring-offset-2 tg:disabled:cursor-not-allowed tg:disabled:opacity-50",
1579
- children: u(i ? "renderer.defaultSubmitButton.submit" : "renderer.step.continue")
1577
+ onClick: s,
1578
+ disabled: !i || a,
1579
+ className: "tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:rounded-md tg:bg-blue-500 tg:px-4 tg:py-2 tg:font-medium tg:text-sm tg:text-white tg:transition-colors tg:hover:bg-blue-600 tg:focus:outline-none tg:focus:ring-2 tg:focus:ring-blue-500 tg:focus:ring-offset-2 tg:disabled:cursor-not-allowed tg:disabled:opacity-50",
1580
+ children: [a && /* @__PURE__ */ k(I, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), l(r ? "renderer.defaultSubmitButton.submit" : "renderer.step.continue")]
1580
1581
  });
1581
1582
  return /* @__PURE__ */ A("section", {
1582
1583
  className: "tg:rounded-lg tg:border tg:p-4",
1583
1584
  children: [
1584
- t && /* @__PURE__ */ k("h3", {
1585
+ e && /* @__PURE__ */ k("h3", {
1585
1586
  className: "tg:mb-4 tg:font-semibold tg:text-lg",
1586
- children: t
1587
+ children: e
1587
1588
  }),
1588
- n,
1589
+ t,
1589
1590
  /* @__PURE__ */ A("div", {
1590
1591
  className: "tg:mt-6 tg:flex tg:items-center tg:justify-between tg:gap-2",
1591
- children: [r ? /* @__PURE__ */ k("span", {}) : /* @__PURE__ */ k("button", {
1592
+ children: [n ? /* @__PURE__ */ k("button", {
1592
1593
  type: "button",
1593
- onClick: s,
1594
- disabled: o,
1594
+ onClick: o,
1595
+ disabled: a,
1595
1596
  className: "tg:rounded-md tg:border tg:border-input tg:bg-background tg:px-4 tg:py-2 tg:font-medium tg:text-sm tg:transition-colors tg:hover:bg-accent tg:disabled:cursor-not-allowed tg:disabled:opacity-50",
1596
- children: u("renderer.step.back")
1597
- }), /* @__PURE__ */ k(Lt, {
1598
- missingFields: l,
1599
- children: d
1597
+ children: l("renderer.step.back")
1598
+ }) : /* @__PURE__ */ k("span", {}), /* @__PURE__ */ k(Lt, {
1599
+ missingFields: c,
1600
+ children: u
1600
1601
  })]
1601
1602
  })
1602
1603
  ]
1603
1604
  });
1604
- }, zt = S(({ label: t, id: n, disabled: r, onBlur: i, onClick: a, onFocus: o, onPointerDown: s, onPointerLeave: c, onPointerMove: l, ...u }, d) => {
1605
- let f = e();
1606
- return /* @__PURE__ */ k("button", {
1605
+ }, zt = S(({ label: e, id: t, disabled: n, isSubmitting: r, onBlur: i, onClick: a, onFocus: o, onPointerDown: s, onPointerLeave: c, onPointerMove: l, ...u }, d) => {
1606
+ let f = p();
1607
+ return /* @__PURE__ */ A("button", {
1607
1608
  ref: d,
1608
- id: n,
1609
+ id: t,
1609
1610
  onBlur: i,
1610
1611
  onClick: a,
1611
1612
  onFocus: o,
1612
1613
  onPointerDown: s,
1613
- disabled: r,
1614
+ disabled: n || r,
1614
1615
  onPointerLeave: c,
1615
1616
  onPointerMove: l,
1616
1617
  type: "submit",
1617
- className: "tg:mt-4 tg:rounded-md tg:bg-blue-500 tg:px-4 tg:py-2 tg:font-medium tg:text-white tg:transition-colors tg:hover:bg-blue-600 tg:focus:outline-none tg:focus:ring-2 tg:focus:ring-blue-500 tg:focus:ring-offset-2 tg:disabled:cursor-not-allowed tg:disabled:opacity-50",
1618
+ className: "tg:mt-4 tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:rounded-md tg:bg-blue-500 tg:px-4 tg:py-2 tg:font-medium tg:text-white tg:transition-colors tg:hover:bg-blue-600 tg:focus:outline-none tg:focus:ring-2 tg:focus:ring-blue-500 tg:focus:ring-offset-2 tg:disabled:cursor-not-allowed tg:disabled:opacity-50",
1618
1619
  ...u,
1619
- children: t || f("renderer.defaultSubmitButton.submit")
1620
+ children: [r && /* @__PURE__ */ k(I, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), e || f("renderer.defaultSubmitButton.submit")]
1620
1621
  });
1621
- }), Bt = ({ node: t }) => {
1622
- let n = e()(t.data?.label);
1623
- return n ? /* @__PURE__ */ A("div", {
1622
+ }), Bt = ({ node: e }) => {
1623
+ let t = p()(e.data?.label);
1624
+ return t ? /* @__PURE__ */ A("div", {
1624
1625
  className: "tg:flex tg:items-center tg:gap-x-3",
1625
1626
  children: [
1626
1627
  /* @__PURE__ */ k(Ie, { className: "tg:my-8 tg:flex-1" }),
1627
1628
  /* @__PURE__ */ k("h4", {
1628
1629
  className: "tg:font-semibold tg:text-sm",
1629
- children: n
1630
+ children: t
1630
1631
  }),
1631
1632
  /* @__PURE__ */ k(Ie, { className: "tg:my-8 tg:flex-1" })
1632
1633
  ]
1633
1634
  }) : /* @__PURE__ */ k(Ie, { className: "tg:my-8" });
1634
- }, Vt = ({ node: t }) => {
1635
- let { edges: n } = i(), r = e();
1635
+ }, Vt = ({ node: e }) => {
1636
+ let { edges: t } = a(), n = p();
1636
1637
  return /* @__PURE__ */ k("h2", {
1637
- className: q("tg:mb-5 tg:font-bold tg:text-2xl", !g(t.id, n) && "tg:mt-10"),
1638
- children: r(t.data?.label)
1638
+ className: q("tg:mb-5 tg:font-bold tg:text-2xl", !g(e.id, t) && "tg:mt-10"),
1639
+ children: n(e.data?.label)
1639
1640
  });
1640
1641
  }, Ht = {
1641
1642
  divider: Bt,
@@ -1685,99 +1686,122 @@ var Gt = () => /* @__PURE__ */ A("section", {
1685
1686
  href: "treege-renderer",
1686
1687
  precedence: "default",
1687
1688
  children: Kt
1688
- }), Jt = ({ baseUrl: e, components: t, className: n, flow: r, googleApiKey: i, headers: a, language: o, onChange: c, onSubmit: l, theme: u, validate: d, validationMode: f, initialValues: m = {}, isLoading: g = !1 }) => {
1689
- let { canContinueStep: v, canSubmit: y, clearSubmitMessage: b, config: x, currentStep: S, currentStepGroupNode: w, currentStepIndex: T, firstErrorFieldId: E, formErrors: O, formValues: te, goToNextStep: ne, goToPreviousStep: j, handleSubmit: M, inputNodes: N, isFirstStep: re, isLastStep: P, isSubmitting: F, missingRequiredFields: I, setFieldValue: L, steps: R, submitMessage: ie, t: ae } = p({
1689
+ }), Jt = ({ baseUrl: e, components: t, className: n, flow: r, formId: a, googleApiKey: o, headers: s, language: c, onBack: l, onChange: u, onSubmit: d, theme: p, validate: m, validationMode: g, initialValues: v = {}, isLoading: y = !1, isSubmitting: b = !1 }) => {
1690
+ let { canContinueStep: x, canSubmit: S, clearSubmitMessage: w, config: T, currentStep: E, currentStepGroupNode: O, currentStepIndex: te, firstErrorFieldId: j, formErrors: M, formValues: N, goToNextStep: P, goToPreviousStep: ne, handleSubmit: re, inputNodes: F, isFirstStep: I, isLastStep: L, isSubmitting: R, missingRequiredFields: ie, setFieldValue: ae, steps: oe, submitMessage: z, t: B } = f({
1690
1691
  baseUrl: e,
1691
1692
  components: t,
1692
1693
  flow: r,
1693
- googleApiKey: i,
1694
- headers: a,
1695
- initialValues: m,
1696
- language: o,
1697
- onChange: c,
1698
- onSubmit: l,
1699
- theme: u,
1700
- validate: d,
1701
- validationMode: f
1702
- }), [z, B] = D(null), { FormWrapper: oe, renderNode: se } = h({
1703
- config: x,
1694
+ googleApiKey: o,
1695
+ headers: s,
1696
+ initialValues: v,
1697
+ language: c,
1698
+ onChange: u,
1699
+ onSubmit: d,
1700
+ theme: p,
1701
+ validate: m,
1702
+ validationMode: g
1703
+ }), [se, ce] = D(null), V = b || R, { FormWrapper: H, renderNode: U } = h({
1704
+ config: T,
1704
1705
  DefaultFormWrapper: It,
1705
1706
  DefaultInputWrapper: Ut,
1706
1707
  DefaultSubmitButton: zt,
1707
1708
  DefaultSubmitButtonWrapper: Lt,
1708
1709
  defaultInputRenderers: rn,
1709
1710
  defaultUI: Ht,
1710
- formErrors: O,
1711
- formValues: te,
1712
- inputNodes: N,
1713
- missingRequiredFields: I,
1714
- setFieldValue: L
1715
- }), ce = x.components.step ?? Rt, V = x.components.loadingSkeleton ?? Gt, H = ee(() => ae(w?.data?.label), [ae, w]), U = C(async (e) => {
1716
- e.preventDefault(), !await M() && E && document.getElementById(E)?.focus();
1717
- }, [M, E]), le = C(() => {
1718
- if (P) {
1719
- M();
1711
+ formErrors: M,
1712
+ formValues: N,
1713
+ inputNodes: F,
1714
+ isSubmitting: V,
1715
+ missingRequiredFields: ie,
1716
+ setFieldValue: ae
1717
+ }), le = T.components.step ?? Rt, W = T.components.loadingSkeleton ?? Gt, G = ee(() => B(O?.data?.label), [B, O]), ue = C(async (e) => {
1718
+ if (e.preventDefault(), !L) {
1719
+ x && P();
1720
1720
  return;
1721
1721
  }
1722
- ne();
1722
+ !await re() && j && document.getElementById(j)?.focus();
1723
1723
  }, [
1724
+ L,
1725
+ x,
1724
1726
  P,
1725
- M,
1727
+ re,
1728
+ j
1729
+ ]), de = C(() => {
1730
+ if (L) {
1731
+ re();
1732
+ return;
1733
+ }
1734
+ P();
1735
+ }, [
1736
+ L,
1737
+ re,
1738
+ P
1739
+ ]), K = C(() => {
1740
+ if (I) {
1741
+ l?.();
1742
+ return;
1743
+ }
1744
+ ne();
1745
+ }, [
1746
+ I,
1747
+ l,
1726
1748
  ne
1727
- ]);
1749
+ ]), fe = !I || !!l;
1728
1750
  return /* @__PURE__ */ k("div", {
1729
- ref: B,
1751
+ ref: ce,
1730
1752
  className: q("treege treege-renderer", n),
1731
1753
  children: /* @__PURE__ */ A(ve, {
1732
- container: z,
1754
+ container: se,
1733
1755
  children: [/* @__PURE__ */ k(qt, {}), /* @__PURE__ */ k(_, {
1734
- theme: x.theme,
1756
+ theme: T.theme,
1735
1757
  storageKey: "treege-renderer-theme",
1736
- children: g ? /* @__PURE__ */ k(V, {}) : /* @__PURE__ */ A(s, {
1758
+ children: y ? /* @__PURE__ */ k(W, {}) : /* @__PURE__ */ A(i, {
1737
1759
  value: {
1738
- baseUrl: x.baseUrl,
1760
+ baseUrl: T.baseUrl,
1739
1761
  flow: r,
1740
- formErrors: O,
1741
- formValues: te,
1742
- googleApiKey: x.googleApiKey,
1743
- headers: x.headers,
1744
- inputNodes: N,
1745
- language: x.language,
1746
- setFieldValue: L
1762
+ formErrors: M,
1763
+ formValues: N,
1764
+ googleApiKey: T.googleApiKey,
1765
+ headers: T.headers,
1766
+ inputNodes: F,
1767
+ language: T.language,
1768
+ setFieldValue: ae
1747
1769
  },
1748
- children: [/* @__PURE__ */ A(oe, {
1749
- onSubmit: U,
1750
- children: [S && /* @__PURE__ */ k(ce, {
1751
- step: S,
1752
- groupNode: w,
1753
- stepIndex: T,
1754
- totalSteps: R.length,
1755
- isFirstStep: re,
1756
- isLastStep: P,
1757
- canContinue: v && (!P || y),
1758
- isSubmitting: F,
1759
- onBack: j,
1760
- onContinue: le,
1761
- label: H,
1762
- missingFields: P ? I : void 0,
1763
- children: S.nodes.map((e) => se(e))
1770
+ children: [/* @__PURE__ */ A(H, {
1771
+ id: a,
1772
+ onSubmit: ue,
1773
+ children: [E && /* @__PURE__ */ k(le, {
1774
+ step: E,
1775
+ groupNode: O,
1776
+ stepIndex: te,
1777
+ totalSteps: oe.length,
1778
+ isFirstStep: I,
1779
+ isLastStep: L,
1780
+ canContinue: x && (!L || S),
1781
+ canGoBack: fe,
1782
+ isSubmitting: V,
1783
+ onBack: K,
1784
+ onContinue: de,
1785
+ label: G,
1786
+ missingFields: L ? ie : void 0,
1787
+ children: E.nodes.map((e) => U(e))
1764
1788
  }), /* @__PURE__ */ k("p", {
1765
1789
  className: "tg:py-2 tg:text-right tg:text-muted-foreground tg:text-xs",
1766
1790
  children: "Powered by Treege"
1767
1791
  })]
1768
- }), ie && /* @__PURE__ */ k("div", {
1769
- className: `tg:my-4 tg:rounded-md tg:p-4 ${ie.type === "success" ? "bg-green-50 text-green-800 dark:bg-green-900/20 dark:text-green-300" : "bg-red-50 text-red-800 dark:bg-red-900/20 dark:text-red-300"}`,
1792
+ }), z && /* @__PURE__ */ k("div", {
1793
+ className: `tg:my-4 tg:rounded-md tg:p-4 ${z.type === "success" ? "bg-green-50 text-green-800 dark:bg-green-900/20 dark:text-green-300" : "bg-red-50 text-red-800 dark:bg-red-900/20 dark:text-red-300"}`,
1770
1794
  role: "alert",
1771
1795
  children: /* @__PURE__ */ A("div", {
1772
1796
  className: "tg:flex tg:items-center tg:justify-between",
1773
1797
  children: [/* @__PURE__ */ k("p", {
1774
1798
  className: "tg:font-medium tg:text-sm",
1775
- children: ie.message
1799
+ children: z.message
1776
1800
  }), /* @__PURE__ */ k("button", {
1777
1801
  type: "button",
1778
- onClick: b,
1802
+ onClick: w,
1779
1803
  className: "tg:ml-4 tg:font-medium tg:text-sm tg:underline tg:hover:no-underline tg:focus:outline-none",
1780
- children: ae("common.close")
1804
+ children: B("common.close")
1781
1805
  })]
1782
1806
  })
1783
1807
  })]
@@ -1786,12 +1810,13 @@ var Gt = () => /* @__PURE__ */ A("section", {
1786
1810
  })
1787
1811
  });
1788
1812
  }, Yt = (e, t) => {
1789
- let { missingRequiredFields: n, isSubmitting: r, label: i } = t, a = d(), o = a?.components?.submitButton, s = a?.components?.submitButtonWrapper;
1813
+ let { missingRequiredFields: n, isSubmitting: r, label: i } = t, a = u(), o = a?.components?.submitButton, s = a?.components?.submitButtonWrapper;
1790
1814
  return /* @__PURE__ */ k(s || Lt, {
1791
1815
  missingFields: n,
1792
1816
  children: /* @__PURE__ */ k(o || zt, {
1793
1817
  label: i,
1794
- disabled: r
1818
+ disabled: r,
1819
+ isSubmitting: r
1795
1820
  })
1796
1821
  });
1797
1822
  };
@@ -1918,18 +1943,18 @@ var $t = (e, t) => {
1918
1943
  u && !c && /* @__PURE__ */ k(Y, { children: u })
1919
1944
  ]
1920
1945
  });
1921
- }, nn = (t, n) => {
1922
- let { id: r, name: i, value: a } = t, { node: o, setValue: s, error: c, label: l, helperText: u } = n, d = e(), f = Array.isArray(a) ? a : [], p = f[0] || "", m = f[1] || "", h = (e) => {
1923
- s([e, m]);
1946
+ }, nn = (e, t) => {
1947
+ let { id: n, name: r, value: i } = e, { node: a, setValue: o, error: s, label: c, helperText: l } = t, u = p(), d = Array.isArray(i) ? i : [], f = d[0] || "", m = d[1] || "", h = (e) => {
1948
+ o([e, m]);
1924
1949
  }, g = (e) => {
1925
- s([p, e]);
1950
+ o([f, e]);
1926
1951
  };
1927
1952
  return /* @__PURE__ */ A(J, {
1928
1953
  className: "tg:mb-4",
1929
1954
  children: [
1930
1955
  /* @__PURE__ */ A(Q, {
1931
- htmlFor: `${r}-start`,
1932
- children: [l || o.data.name, o.data.required && /* @__PURE__ */ k("span", {
1956
+ htmlFor: `${n}-start`,
1957
+ children: [c || a.data.name, a.data.required && /* @__PURE__ */ k("span", {
1933
1958
  className: "tg:text-red-500",
1934
1959
  children: "*"
1935
1960
  })]
@@ -1937,31 +1962,31 @@ var $t = (e, t) => {
1937
1962
  /* @__PURE__ */ A("div", {
1938
1963
  className: "tg:flex tg:gap-2",
1939
1964
  children: [/* @__PURE__ */ k(Z, {
1940
- id: `${r}-start`,
1941
- name: `${i}-start`,
1942
- "aria-label": `${l || o.data.name} - ${d("renderer.defaultInputs.startTime")}`,
1943
- "aria-invalid": !!c,
1944
- "aria-describedby": c ? `${o.id}-error` : void 0,
1965
+ id: `${n}-start`,
1966
+ name: `${r}-start`,
1967
+ "aria-label": `${c || a.data.name} - ${u("renderer.defaultInputs.startTime")}`,
1968
+ "aria-invalid": !!s,
1969
+ "aria-describedby": s ? `${a.id}-error` : void 0,
1945
1970
  type: "time",
1946
- value: p,
1971
+ value: f,
1947
1972
  onChange: (e) => h(e.target.value),
1948
- placeholder: d("renderer.defaultInputs.startTime"),
1973
+ placeholder: u("renderer.defaultInputs.startTime"),
1949
1974
  className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
1950
1975
  }), /* @__PURE__ */ k(Z, {
1951
- id: `${r}-end`,
1952
- name: `${i}-end`,
1953
- "aria-label": `${l || o.data.name} - ${d("renderer.defaultInputs.endTime")}`,
1954
- "aria-invalid": !!c,
1955
- "aria-describedby": c ? `${o.id}-error` : void 0,
1976
+ id: `${n}-end`,
1977
+ name: `${r}-end`,
1978
+ "aria-label": `${c || a.data.name} - ${u("renderer.defaultInputs.endTime")}`,
1979
+ "aria-invalid": !!s,
1980
+ "aria-describedby": s ? `${a.id}-error` : void 0,
1956
1981
  type: "time",
1957
1982
  value: m,
1958
1983
  onChange: (e) => g(e.target.value),
1959
- placeholder: d("renderer.defaultInputs.endTime"),
1984
+ placeholder: u("renderer.defaultInputs.endTime"),
1960
1985
  className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
1961
1986
  })]
1962
1987
  }),
1963
- c && /* @__PURE__ */ k(X, { children: c }),
1964
- u && !c && /* @__PURE__ */ k(Y, { children: u })
1988
+ s && /* @__PURE__ */ k(X, { children: s }),
1989
+ l && !s && /* @__PURE__ */ k(Y, { children: l })
1965
1990
  ]
1966
1991
  });
1967
1992
  }, rn = {