treege 3.0.0-beta.3 → 3.0.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/LICENSE +18 -12
  2. package/README.md +305 -49
  3. package/dist/ThemeContext-D49eu_oE.js +1472 -0
  4. package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
  5. package/dist/editor/constants/defaultNode.d.ts +1 -1
  6. package/dist/editor/constants/edgeTypes.d.ts +3 -2
  7. package/dist/editor/constants/nodeSpacing.d.ts +20 -0
  8. package/dist/editor/constants/nodeTypes.d.ts +5 -5
  9. package/dist/editor/context/TreegeEditorContext.d.ts +24 -1
  10. package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
  11. package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +2 -2
  12. package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +3 -0
  13. package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
  14. package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
  15. package/dist/editor/features/TreegeEditor/inputs/OptionImageField.d.ts +6 -0
  16. package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +2 -2
  17. package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +6 -0
  18. package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +6 -0
  19. package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +9 -0
  20. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +8 -0
  21. package/dist/editor/features/TreegeEditor/nodes/components/OpenSheetButton.d.ts +6 -0
  22. package/dist/editor/features/TreegeEditor/nodes/components/SubTypeBadge.d.ts +8 -0
  23. package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +2 -1
  24. package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
  25. package/dist/editor/hooks/useFlowActions.d.ts +2 -0
  26. package/dist/editor/hooks/useFlowConnections.d.ts +4 -0
  27. package/dist/editor/hooks/useNodesSelection.d.ts +5 -5
  28. package/dist/editor/types/ai.d.ts +65 -0
  29. package/dist/editor/types/editor.d.ts +9 -8
  30. package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
  31. package/dist/editor/utils/image.d.ts +7 -0
  32. package/dist/editor-DnrJgSrC.js +3567 -0
  33. package/dist/editor.js +3 -7
  34. package/dist/main.js +5 -52
  35. package/dist/renderer/context/TreegeRendererContext.d.ts +4 -1
  36. package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +19 -11
  37. package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -7
  38. package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +7 -7
  39. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +26 -15
  40. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +9 -7
  41. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts +11 -0
  42. package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +8 -7
  43. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +3 -0
  44. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
  45. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +3 -0
  46. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +3 -0
  47. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +3 -0
  48. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +3 -0
  49. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +3 -0
  50. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +3 -0
  51. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +3 -0
  52. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +3 -0
  53. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +3 -0
  54. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +3 -0
  55. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +3 -0
  56. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +3 -0
  57. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +3 -0
  58. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +3 -0
  59. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
  60. package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +84 -24
  61. package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
  62. package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +1 -1
  63. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
  64. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
  65. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
  66. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
  67. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
  68. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
  69. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
  70. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
  71. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
  72. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
  73. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
  74. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
  75. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +3 -0
  76. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
  77. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
  78. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
  79. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
  80. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
  81. package/dist/renderer/hooks/useRenderNode.d.ts +55 -0
  82. package/dist/renderer/hooks/useSubmitHandler.d.ts +34 -0
  83. package/dist/renderer/hooks/useTranslate.d.ts +6 -4
  84. package/dist/renderer/index.d.ts +2 -0
  85. package/dist/renderer/index.native.d.ts +19 -0
  86. package/dist/renderer/types/renderer.d.ts +60 -6
  87. package/dist/renderer/utils/form.d.ts +22 -2
  88. package/dist/renderer/utils/http.d.ts +101 -0
  89. package/dist/renderer/utils/node.d.ts +9 -1
  90. package/dist/renderer/utils/sanitize.d.ts +85 -0
  91. package/dist/renderer/utils/sanitize.native.d.ts +69 -0
  92. package/dist/renderer/utils/submit.d.ts +47 -0
  93. package/dist/renderer-MCPhNlp1.js +1157 -0
  94. package/dist/renderer-native.d.ts +2 -0
  95. package/dist/renderer-native.js +3408 -0
  96. package/dist/renderer.js +4 -45
  97. package/dist/separator-gO82kpxa.js +350 -0
  98. package/dist/shared/components/ui/alert-dialog.d.ts +14 -0
  99. package/dist/shared/components/ui/badge.d.ts +2 -2
  100. package/dist/shared/components/ui/button.d.ts +1 -1
  101. package/dist/shared/components/ui/popover.d.ts +3 -1
  102. package/dist/shared/components/ui/select.d.ts +3 -1
  103. package/dist/shared/constants/colors.d.ts +45 -0
  104. package/dist/shared/constants/inputType.d.ts +1 -0
  105. package/dist/shared/context/ThemeContext.d.ts +2 -0
  106. package/dist/shared/context/ThemeContext.native.d.ts +22 -0
  107. package/dist/shared/hooks/useThemeColors.d.ts +37 -0
  108. package/dist/shared/locales/ar.json.d.ts +102 -9
  109. package/dist/shared/locales/de.json.d.ts +102 -9
  110. package/dist/shared/locales/en.json.d.ts +103 -10
  111. package/dist/shared/locales/es.json.d.ts +102 -9
  112. package/dist/shared/locales/fr.json.d.ts +102 -9
  113. package/dist/shared/locales/it.json.d.ts +102 -9
  114. package/dist/shared/locales/pt.json.d.ts +102 -9
  115. package/dist/shared/types/node.d.ts +56 -0
  116. package/dist/useRenderNode-B_GPMTPf.js +774 -0
  117. package/package.json +36 -9
  118. package/dist/ThemeContext-BIvs8Kw-.js +0 -758
  119. package/dist/TreegeEditor-BSPfQQk3.js +0 -2151
  120. package/dist/TreegeRenderer-D3EvsEfJ.js +0 -1413
  121. package/dist/_name_.css +0 -1
  122. package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +0 -6
  123. package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +0 -6
  124. package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +0 -6
@@ -0,0 +1,1157 @@
1
+ import { f as e, t } from "./ThemeContext-D49eu_oE.js";
2
+ import { A as n, C as r, D as i, E as a, F as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, i as _, j as v, k as y, l as b, n as ee, o as te, r as x, s as S, t as C, v as w, w as T, y as E } from "./separator-gO82kpxa.js";
3
+ import { S as D, a as O, b as ne, c as k, d as A, g as re, n as j, o as M, r as N, s as P, t as F, w as I } from "./useRenderNode-B_GPMTPf.js";
4
+ import * as L from "react";
5
+ import { forwardRef as R, useCallback as ie, useEffect as z, useMemo as ae, useRef as B, useState as V } from "react";
6
+ import { Check as oe, ChevronDownIcon as se, ChevronLeftIcon as ce, ChevronRightIcon as le, ChevronsUpDown as ue, CircleIcon as H, Loader2 as de, MapPin as U } from "lucide-react";
7
+ import { DayPicker as W, getDefaultClassNames as G } from "react-day-picker";
8
+ import * as K from "@radix-ui/react-tooltip";
9
+ import * as q from "@radix-ui/react-radio-group";
10
+ //#region src/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.tsx
11
+ var J = e(), fe = ({ children: e, onSubmit: t }) => /* @__PURE__ */ (0, J.jsx)("form", {
12
+ onSubmit: t,
13
+ className: "mx-auto max-w-2xl gap-y-3",
14
+ children: e
15
+ }), Y = ({ node: e, children: t }) => {
16
+ let n = M()(e.data.label);
17
+ return /* @__PURE__ */ (0, J.jsxs)("section", {
18
+ className: "mb-6 rounded-lg border p-4",
19
+ children: [n && /* @__PURE__ */ (0, J.jsx)("h3", {
20
+ className: "mb-4 font-semibold text-lg",
21
+ children: n
22
+ }), t]
23
+ });
24
+ }, pe = async (e, t) => {
25
+ if (!e || e.trim().length < 3) return [];
26
+ try {
27
+ let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
28
+ Accept: "application/json",
29
+ "User-Agent": "Treege Renderer",
30
+ ...t && { "Accept-Language": t }
31
+ } });
32
+ return n.ok ? (await n.json()).map((e) => ({
33
+ label: e.display_name,
34
+ value: e.display_name
35
+ })) : [];
36
+ } catch (e) {
37
+ return console.error("Nominatim fetch error:", e), [];
38
+ }
39
+ }, me = (e) => !e || e.trim().length < 3 ? Promise.resolve([]) : new Promise((t) => {
40
+ if (!window.google?.maps?.places) {
41
+ console.warn("Google Places SDK not loaded yet"), t([]);
42
+ return;
43
+ }
44
+ new window.google.maps.places.AutocompleteService().getPlacePredictions({ input: e }, (e, n) => {
45
+ if (n !== google.maps.places.PlacesServiceStatus.OK || !e) {
46
+ console.warn("Google Places API status:", n), t([]);
47
+ return;
48
+ }
49
+ t(e.map((e) => ({
50
+ label: e.description,
51
+ value: e.description
52
+ })));
53
+ });
54
+ }), he = ({ node: e, value: t, setValue: r, error: a, label: o, placeholder: s, helperText: c, id: u, name: d }) => {
55
+ let [f, p] = V(""), [m, h] = V([]), [g, b] = V(!1), { googleApiKey: C, language: w } = k(), T = M(), E = ie((e) => {
56
+ r(e.value), p(e.value), b(!1);
57
+ }, [r]);
58
+ z(() => {
59
+ if (!f || f.trim().length < 3) {
60
+ h([]);
61
+ return;
62
+ }
63
+ let e = setTimeout(async () => {
64
+ h(C ? await me(f) : await pe(f, w));
65
+ }, 300);
66
+ return () => clearTimeout(e);
67
+ }, [
68
+ f,
69
+ C,
70
+ w
71
+ ]);
72
+ let D = ie((e) => {
73
+ r(e), p(e), e.length >= 3 && b(!0);
74
+ }, [r]);
75
+ return /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [C && /* @__PURE__ */ (0, J.jsx)("script", {
76
+ async: !0,
77
+ src: `https://maps.googleapis.com/maps/api/js?key=${C}&libraries=places`
78
+ }), /* @__PURE__ */ (0, J.jsxs)(v, {
79
+ className: "mb-4",
80
+ children: [
81
+ /* @__PURE__ */ (0, J.jsxs)(i, {
82
+ htmlFor: u,
83
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
84
+ className: "text-red-500",
85
+ children: "*"
86
+ })]
87
+ }),
88
+ /* @__PURE__ */ (0, J.jsxs)("div", {
89
+ className: "relative",
90
+ children: [
91
+ /* @__PURE__ */ (0, J.jsx)(l, {
92
+ type: "text",
93
+ id: u,
94
+ name: d,
95
+ value: t || "",
96
+ onChange: (e) => D(e.target.value),
97
+ onFocus: () => {
98
+ m.length > 0 && b(!0);
99
+ },
100
+ placeholder: s || T("renderer.defaultAddressInput.enterAddress"),
101
+ className: "pr-10",
102
+ autoComplete: "off"
103
+ }),
104
+ /* @__PURE__ */ (0, J.jsx)(U, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 h-4 w-4 text-muted-foreground" }),
105
+ g && /* @__PURE__ */ (0, J.jsx)("div", {
106
+ className: "absolute z-50 mt-1 w-full rounded-md border bg-popover shadow-md",
107
+ children: /* @__PURE__ */ (0, J.jsx)(ee, { children: /* @__PURE__ */ (0, J.jsxs)(S, { children: [/* @__PURE__ */ (0, J.jsx)(x, { children: T("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ (0, J.jsx)(_, { children: m.map((e, t) => /* @__PURE__ */ (0, J.jsxs)(te, {
108
+ value: e.value,
109
+ onSelect: () => E(e),
110
+ onMouseDown: (e) => e.preventDefault(),
111
+ children: [/* @__PURE__ */ (0, J.jsx)(U, { className: "mr-2 h-4 w-4" }), e.label]
112
+ }, t)) })] }) })
113
+ })
114
+ ]
115
+ }),
116
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
117
+ c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
118
+ ]
119
+ })] });
120
+ }, X = ({ node: e, value: t, setValue: r, error: s, label: l, placeholder: u, helperText: d, id: p }) => {
121
+ let h = M(), [g, b] = V(!1), C = `${p}-trigger`, w = `${p}-error`, E = e.data.options || [], D = E.find((e) => e.value === t);
122
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
123
+ className: "mb-4",
124
+ children: [
125
+ /* @__PURE__ */ (0, J.jsxs)(i, {
126
+ htmlFor: C,
127
+ children: [l || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
128
+ className: "text-red-500",
129
+ children: "*"
130
+ })]
131
+ }),
132
+ /* @__PURE__ */ (0, J.jsxs)(T, {
133
+ open: g,
134
+ onOpenChange: b,
135
+ children: [/* @__PURE__ */ (0, J.jsx)(a, {
136
+ asChild: !0,
137
+ children: /* @__PURE__ */ (0, J.jsxs)(c, {
138
+ id: C,
139
+ variant: "outline",
140
+ role: "combobox",
141
+ "aria-expanded": g,
142
+ "aria-invalid": !!s || void 0,
143
+ "aria-describedby": s ? w : void 0,
144
+ className: "w-full justify-between font-normal",
145
+ children: [t ? D?.label ? h(D.label) : t : u || h("renderer.defaultAutocompleteInput.selectOption"), /* @__PURE__ */ (0, J.jsx)(ue, { className: "ml-2 size-4 shrink-0 opacity-50" })]
146
+ })
147
+ }), /* @__PURE__ */ (0, J.jsx)(f, {
148
+ className: "w-full p-0",
149
+ align: "start",
150
+ children: /* @__PURE__ */ (0, J.jsxs)(ee, { children: [/* @__PURE__ */ (0, J.jsx)(m, { placeholder: u || h("renderer.defaultAutocompleteInput.search") }), /* @__PURE__ */ (0, J.jsxs)(S, { children: [/* @__PURE__ */ (0, J.jsx)(x, { children: h("renderer.defaultAutocompleteInput.noResults") }), /* @__PURE__ */ (0, J.jsx)(_, { children: E.map((e) => /* @__PURE__ */ (0, J.jsxs)(te, {
151
+ value: e.value,
152
+ disabled: e.disabled,
153
+ onSelect: (e) => {
154
+ r(e === t ? "" : e), b(!1);
155
+ },
156
+ children: [/* @__PURE__ */ (0, J.jsx)(oe, { className: o("mr-2 size-4", t === e.value ? "opacity-100" : "opacity-0") }), h(e.label)]
157
+ }, e.value)) })] })] })
158
+ })]
159
+ }),
160
+ s && /* @__PURE__ */ (0, J.jsx)(n, {
161
+ id: w,
162
+ children: s
163
+ }),
164
+ d && !s && /* @__PURE__ */ (0, J.jsx)(y, { children: d })
165
+ ]
166
+ });
167
+ }, Z = ({ node: e, value: t, setValue: r, error: a, label: o, helperText: c, id: l, name: u }) => {
168
+ let d = M();
169
+ if (e.data.options && e.data.options.length > 0) {
170
+ let f = Array.isArray(t) ? t.map(String) : [], p = (e, t) => {
171
+ r(t ? [...f, e] : f.filter((t) => t !== e));
172
+ };
173
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
174
+ className: "mb-4",
175
+ children: [
176
+ /* @__PURE__ */ (0, J.jsxs)(i, {
177
+ className: "mb-1",
178
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
179
+ className: "text-red-500",
180
+ children: "*"
181
+ })]
182
+ }),
183
+ /* @__PURE__ */ (0, J.jsx)("div", {
184
+ className: "space-y-2",
185
+ children: e.data.options.map((e, t) => /* @__PURE__ */ (0, J.jsxs)("div", {
186
+ className: "flex items-center gap-3",
187
+ children: [/* @__PURE__ */ (0, J.jsx)(s, {
188
+ id: `${l}-${e.value}`,
189
+ name: u,
190
+ checked: f.includes(String(e.value)),
191
+ onCheckedChange: (t) => p(String(e.value), !!t),
192
+ disabled: e.disabled
193
+ }), /* @__PURE__ */ (0, J.jsx)(i, {
194
+ htmlFor: `${l}-${e.value}`,
195
+ className: "cursor-pointer font-normal text-sm",
196
+ children: d(e.label) ? d(e.label) : e.value
197
+ })]
198
+ }, e.value + t))
199
+ }),
200
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
201
+ c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
202
+ ]
203
+ });
204
+ }
205
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
206
+ className: "mb-4",
207
+ children: [/* @__PURE__ */ (0, J.jsxs)("div", {
208
+ className: "flex items-center gap-3",
209
+ children: [/* @__PURE__ */ (0, J.jsx)(s, {
210
+ id: l,
211
+ name: u,
212
+ checked: typeof t == "boolean" ? t : !1,
213
+ onCheckedChange: (e) => r(!!e)
214
+ }), /* @__PURE__ */ (0, J.jsxs)("div", { children: [/* @__PURE__ */ (0, J.jsxs)(i, {
215
+ htmlFor: l,
216
+ className: "cursor-pointer font-medium text-sm",
217
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
218
+ className: "text-red-500",
219
+ children: "*"
220
+ })]
221
+ }), c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })] })]
222
+ }), a && /* @__PURE__ */ (0, J.jsx)(n, { children: a })]
223
+ });
224
+ };
225
+ //#endregion
226
+ //#region src/shared/components/ui/calendar.tsx
227
+ function Q({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: r = "label", buttonVariant: i = "ghost", formatters: a, components: s, ...c }) {
228
+ let l = G();
229
+ return /* @__PURE__ */ (0, J.jsx)(W, {
230
+ showOutsideDays: n,
231
+ className: o("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
232
+ captionLayout: r,
233
+ formatters: {
234
+ formatMonthDropdown: (e) => e.toLocaleString("default", { month: "short" }),
235
+ ...a
236
+ },
237
+ classNames: {
238
+ button_next: o(u({ variant: i }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", l.button_next),
239
+ button_previous: o(u({ variant: i }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", l.button_previous),
240
+ caption_label: o("select-none font-medium", r === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5", l.caption_label),
241
+ day: o("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", l.day),
242
+ disabled: o("text-muted-foreground opacity-50", l.disabled),
243
+ dropdown: o("absolute bg-popover inset-0 opacity-0", l.dropdown),
244
+ dropdown_root: o("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md", l.dropdown_root),
245
+ dropdowns: o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5", l.dropdowns),
246
+ hidden: o("invisible", l.hidden),
247
+ month: o("flex flex-col w-full gap-4", l.month),
248
+ month_caption: o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)", l.month_caption),
249
+ months: o("flex gap-4 flex-col md:flex-row relative", l.months),
250
+ nav: o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", l.nav),
251
+ outside: o("text-muted-foreground aria-selected:text-muted-foreground", l.outside),
252
+ range_end: o("rounded-r-md bg-accent", l.range_end),
253
+ range_middle: o("rounded-none", l.range_middle),
254
+ range_start: o("rounded-l-md bg-accent", l.range_start),
255
+ root: o("w-fit", l.root),
256
+ table: "w-full border-collapse",
257
+ today: o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", l.today),
258
+ week: o("flex w-full mt-2", l.week),
259
+ week_number: o("text-[0.8rem] select-none text-muted-foreground", l.week_number),
260
+ week_number_header: o("select-none w-(--cell-size)", l.week_number_header),
261
+ weekday: o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none", l.weekday),
262
+ weekdays: o("flex", l.weekdays),
263
+ ...t
264
+ },
265
+ components: {
266
+ Chevron: ({ className: e, orientation: t, ...n }) => t === "left" ? /* @__PURE__ */ (0, J.jsx)(ce, {
267
+ className: o("size-4", e),
268
+ ...n
269
+ }) : t === "right" ? /* @__PURE__ */ (0, J.jsx)(le, {
270
+ className: o("size-4", e),
271
+ ...n
272
+ }) : /* @__PURE__ */ (0, J.jsx)(se, {
273
+ className: o("size-4", e),
274
+ ...n
275
+ }),
276
+ DayButton: ge,
277
+ Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ (0, J.jsx)("div", {
278
+ "data-slot": "calendar",
279
+ ref: t,
280
+ className: o(e),
281
+ ...n
282
+ }),
283
+ WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ (0, J.jsx)("td", {
284
+ ...t,
285
+ children: /* @__PURE__ */ (0, J.jsx)("div", {
286
+ className: "flex size-(--cell-size) items-center justify-center text-center",
287
+ children: e
288
+ })
289
+ }),
290
+ ...s
291
+ },
292
+ ...c
293
+ });
294
+ }
295
+ function ge({ className: e, day: t, modifiers: n, ...r }) {
296
+ let i = G(), a = L.useRef(null);
297
+ return L.useEffect(() => {
298
+ n.focused && a.current?.focus();
299
+ }, [n.focused]), /* @__PURE__ */ (0, J.jsx)(c, {
300
+ ref: a,
301
+ variant: "ghost",
302
+ size: "icon",
303
+ "data-day": t.date.toLocaleDateString(),
304
+ "data-selected-single": n.selected && !n.range_start && !n.range_end && !n.range_middle,
305
+ "data-range-start": n.range_start,
306
+ "data-range-end": n.range_end,
307
+ "data-range-middle": n.range_middle,
308
+ className: o("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-start=true]:rounded-l-md data-[range-end=true]:bg-primary data-[range-middle=true]:bg-accent data-[range-start=true]:bg-primary data-[selected-single=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:text-accent-foreground data-[range-start=true]:text-primary-foreground data-[selected-single=true]:text-primary-foreground group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", i.day, e),
309
+ ...r
310
+ });
311
+ }
312
+ //#endregion
313
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.tsx
314
+ var _e = ({ node: e, value: t, setValue: r, error: o, label: s, placeholder: l, helperText: u, id: d, name: p }) => {
315
+ let [m, h] = V(!1), g = M(), _ = t ? new Date(t) : void 0;
316
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
317
+ className: "mb-4",
318
+ children: [
319
+ /* @__PURE__ */ (0, J.jsxs)(i, {
320
+ htmlFor: d,
321
+ children: [s || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
322
+ className: "text-red-500",
323
+ children: "*"
324
+ })]
325
+ }),
326
+ /* @__PURE__ */ (0, J.jsxs)(T, {
327
+ open: m,
328
+ onOpenChange: h,
329
+ children: [/* @__PURE__ */ (0, J.jsx)(a, {
330
+ asChild: !0,
331
+ children: /* @__PURE__ */ (0, J.jsxs)(c, {
332
+ variant: "outline",
333
+ id: d,
334
+ name: p,
335
+ className: "w-full justify-between font-normal",
336
+ children: [_ ? _.toLocaleDateString() : l || g("renderer.defaultInputs.selectDate"), /* @__PURE__ */ (0, J.jsx)(se, { className: "size-4" })]
337
+ })
338
+ }), /* @__PURE__ */ (0, J.jsx)(f, {
339
+ className: "w-auto overflow-hidden p-0",
340
+ align: "start",
341
+ children: /* @__PURE__ */ (0, J.jsx)(Q, {
342
+ mode: "single",
343
+ selected: _,
344
+ captionLayout: "dropdown",
345
+ disabled: (t) => {
346
+ if (e.data.disablePast) {
347
+ let e = /* @__PURE__ */ new Date();
348
+ return e.setHours(0, 0, 0, 0), t < e;
349
+ }
350
+ return !1;
351
+ },
352
+ onSelect: (e) => {
353
+ r(e ? e.toISOString() : ""), h(!1);
354
+ }
355
+ })
356
+ })]
357
+ }),
358
+ o && /* @__PURE__ */ (0, J.jsx)(n, { children: o }),
359
+ u && !o && /* @__PURE__ */ (0, J.jsx)(y, { children: u })
360
+ ]
361
+ });
362
+ }, $ = ({ node: e, value: t, setValue: r, error: o, label: s, helperText: l, id: u }) => {
363
+ let [d, p] = V(!1), m = M(), h = Array.isArray(t) ? t : [], g = h[0] ? new Date(h[0]) : void 0, _ = h[1] ? new Date(h[1]) : void 0;
364
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
365
+ className: "mb-4",
366
+ children: [
367
+ /* @__PURE__ */ (0, J.jsxs)(i, {
368
+ htmlFor: u,
369
+ children: [s || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
370
+ className: "text-red-500",
371
+ children: "*"
372
+ })]
373
+ }),
374
+ /* @__PURE__ */ (0, J.jsxs)(T, {
375
+ open: d,
376
+ onOpenChange: p,
377
+ children: [/* @__PURE__ */ (0, J.jsx)(a, {
378
+ asChild: !0,
379
+ children: /* @__PURE__ */ (0, J.jsxs)(c, {
380
+ id: u,
381
+ variant: "outline",
382
+ className: "w-full justify-between font-normal",
383
+ children: [g && _ ? `${g.toLocaleDateString()} - ${_.toLocaleDateString()}` : g ? g.toLocaleDateString() : m("renderer.defaultInputs.selectDateRange"), /* @__PURE__ */ (0, J.jsx)(se, { className: "size-4" })]
384
+ })
385
+ }), /* @__PURE__ */ (0, J.jsx)(f, {
386
+ className: "w-auto overflow-hidden p-0",
387
+ align: "start",
388
+ children: /* @__PURE__ */ (0, J.jsx)(Q, {
389
+ mode: "range",
390
+ selected: {
391
+ from: g,
392
+ to: _
393
+ },
394
+ captionLayout: "dropdown",
395
+ disabled: (t) => {
396
+ if (e.data.disablePast) {
397
+ let e = /* @__PURE__ */ new Date();
398
+ return e.setHours(0, 0, 0, 0), t < e;
399
+ }
400
+ return !1;
401
+ },
402
+ onSelect: (e) => {
403
+ r([e?.from ? e.from.toISOString() : void 0, e?.to ? e.to.toISOString() : void 0]);
404
+ },
405
+ numberOfMonths: 2
406
+ })
407
+ })]
408
+ }),
409
+ o && /* @__PURE__ */ (0, J.jsx)(n, { children: o }),
410
+ l && !o && /* @__PURE__ */ (0, J.jsx)(y, { children: l })
411
+ ]
412
+ });
413
+ }, ve = ({ node: e, setValue: t, error: r, label: a, placeholder: o, helperText: s, name: c, id: u }) => /* @__PURE__ */ (0, J.jsxs)(v, {
414
+ className: "mb-4",
415
+ children: [
416
+ /* @__PURE__ */ (0, J.jsxs)(i, {
417
+ htmlFor: u,
418
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
419
+ className: "text-red-500",
420
+ children: "*"
421
+ })]
422
+ }),
423
+ /* @__PURE__ */ (0, J.jsx)(l, {
424
+ type: "file",
425
+ name: c,
426
+ id: u,
427
+ onChange: async (n) => {
428
+ let { files: r } = n.target;
429
+ if (!r || r.length === 0) {
430
+ t(null);
431
+ return;
432
+ }
433
+ if (e.data.multiple) {
434
+ t(await N(Array.from(r)));
435
+ return;
436
+ }
437
+ t(await j(r[0]));
438
+ },
439
+ multiple: e.data.multiple,
440
+ placeholder: o
441
+ }),
442
+ r && /* @__PURE__ */ (0, J.jsx)(n, { children: r }),
443
+ s && !r && /* @__PURE__ */ (0, J.jsx)(y, { children: s })
444
+ ]
445
+ }), ye = ({ value: e, name: t, id: n }) => /* @__PURE__ */ (0, J.jsx)(l, {
446
+ type: "hidden",
447
+ id: n,
448
+ name: t,
449
+ value: e ?? ""
450
+ });
451
+ //#endregion
452
+ //#region src/shared/components/ui/tooltip.tsx
453
+ function be({ delayDuration: e = 0, ...t }) {
454
+ return /* @__PURE__ */ (0, J.jsx)(K.Provider, {
455
+ "data-slot": "tooltip-provider",
456
+ delayDuration: e,
457
+ ...t
458
+ });
459
+ }
460
+ function xe({ ...e }) {
461
+ return /* @__PURE__ */ (0, J.jsx)(be, { children: /* @__PURE__ */ (0, J.jsx)(K.Root, {
462
+ "data-slot": "tooltip",
463
+ ...e
464
+ }) });
465
+ }
466
+ function Se({ ...e }) {
467
+ return /* @__PURE__ */ (0, J.jsx)(K.Trigger, {
468
+ "data-slot": "tooltip-trigger",
469
+ ...e
470
+ });
471
+ }
472
+ function Ce({ className: e, sideOffset: t = 0, children: n, ...r }) {
473
+ return /* @__PURE__ */ (0, J.jsx)(K.Portal, { children: /* @__PURE__ */ (0, J.jsxs)(K.Content, {
474
+ "data-slot": "tooltip-content",
475
+ sideOffset: t,
476
+ className: o("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=closed]:animate-out", e),
477
+ ...r,
478
+ children: [n, /* @__PURE__ */ (0, J.jsx)(K.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" })]
479
+ }) });
480
+ }
481
+ //#endregion
482
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.tsx
483
+ var we = (e, t) => t ? t.split(".").reduce((e, t) => {
484
+ if (e == null) return;
485
+ let n = t.match(/^(\w+)\[(\d+)]$/);
486
+ if (n) {
487
+ let [, t, r] = n, i = e[t];
488
+ return Array.isArray(i) ? i[Number.parseInt(r, 10)] : i;
489
+ }
490
+ return e[t];
491
+ }, e) : e, Te = (e) => {
492
+ let t = e.matchAll(/{{([\w-]+)}}/g);
493
+ return Array.from(t, (e) => e[1]);
494
+ }, Ee = (e, t) => Te(e).every((e) => {
495
+ let n = t[e];
496
+ return n != null && n !== "";
497
+ }), De = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
498
+ let i = t[r], a = i == null ? "" : String(i);
499
+ return n ? encodeURIComponent(a) : a;
500
+ }), Oe = ({ node: e, value: t, setValue: s, error: u, label: g, placeholder: b, helperText: C, id: O, name: A }) => {
501
+ let [j, N] = V(!1), [P, F] = V(null), [I, L] = V([]), [R, se] = V(""), [ce, le] = V(!1), { formValues: H, inputNodes: U } = k(), W = M(), { httpConfig: G } = e.data, K = B(!1), q = B(""), fe = B(G), Y = B(H), pe = B(U), me = B(s), he = B(null), X = B(null), Z = ae(() => G?.url ? Te(G.url) : [], [G?.url]), Q = Z.length > 0, ge = ae(() => Z.map((e) => `${e}:${String(H[e] ?? "")}`).join("|"), [Z, H]), _e = ae(() => G?.url ? Q ? Ee(G.url, H) : !0 : !1, [
502
+ G?.url,
503
+ Q,
504
+ H
505
+ ]), $ = ie(async (e) => {
506
+ X.current && X.current.abort();
507
+ let t = new AbortController();
508
+ X.current = t;
509
+ let n = fe.current, r = Y.current, i = me.current;
510
+ if (!n?.url) {
511
+ F(W("renderer.defaultHttpInput.noUrlConfigured")), X.current = null;
512
+ return;
513
+ }
514
+ if (n.url && !Ee(n.url, r)) {
515
+ X.current = null;
516
+ return;
517
+ }
518
+ N(!0), F(null);
519
+ try {
520
+ let a = De(n.url, r, !0), o = n.searchParam && e ? `${a}${a.includes("?") ? "&" : "?"}${n.searchParam}=${encodeURIComponent(e)}` : a, s = {};
521
+ n.headers?.forEach((e) => {
522
+ s[e.key] = De(e.value, r);
523
+ });
524
+ let c = [
525
+ "POST",
526
+ "PUT",
527
+ "PATCH"
528
+ ].includes(n.method || "") ? n.sendAllFormValues ? JSON.stringify(ne(r, pe.current)) : n.body ? De(n.body, r) : void 0 : void 0, l = setTimeout(() => t.abort(), 3e4), u = await fetch(o, {
529
+ body: c || void 0,
530
+ headers: {
531
+ "Content-Type": "application/json",
532
+ ...s
533
+ },
534
+ method: n.method || "GET",
535
+ signal: t.signal
536
+ });
537
+ if (clearTimeout(l), !u.ok) {
538
+ F(`HTTP Error ${u.status}: ${u.statusText}`), N(!1);
539
+ return;
540
+ }
541
+ let d = re(await u.json()), f = n.responsePath ? we(d, n.responsePath) : d;
542
+ if (n.responseMapping && Array.isArray(f)) {
543
+ let { valueField: e = "value", labelField: t = "label" } = n.responseMapping;
544
+ L(f.map((n) => ({
545
+ label: String(we(n, t) || ""),
546
+ value: String(we(n, e) || "")
547
+ })));
548
+ } else i(typeof f == "string" ? f : JSON.stringify(f));
549
+ } catch (e) {
550
+ if (e instanceof Error && e.name === "AbortError") return;
551
+ F(e instanceof Error ? e.message : W("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
552
+ } finally {
553
+ N(!1), X.current = null;
554
+ }
555
+ }, [W]);
556
+ if (z(() => {
557
+ fe.current = G, Y.current = H, pe.current = U, me.current = s, he.current = $;
558
+ }, [
559
+ G,
560
+ H,
561
+ U,
562
+ s,
563
+ $
564
+ ]), z(() => () => {
565
+ X.current && X.current.abort();
566
+ }, []), z(() => {
567
+ if (K.current) return;
568
+ K.current = !0;
569
+ let e = fe.current, t = Y.current, n = he.current, r = e?.url && Ee(e.url, t);
570
+ e?.fetchOnMount && r && n && (n(), e.url && (q.current = Te(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
571
+ }, []), z(() => {
572
+ if (!K.current || !Q || q.current === ge || !_e) return;
573
+ let e = setTimeout(() => {
574
+ $(), q.current = ge;
575
+ }, 500);
576
+ return () => clearTimeout(e);
577
+ }, [
578
+ ge,
579
+ Q,
580
+ _e,
581
+ $
582
+ ]), z(() => {
583
+ if (!(G?.searchParam && R)) return;
584
+ let e = setTimeout(() => {
585
+ $(R);
586
+ }, 300);
587
+ return () => clearTimeout(e);
588
+ }, [
589
+ R,
590
+ G?.searchParam,
591
+ $
592
+ ]), G?.responseMapping) {
593
+ let l = Array.isArray(t) ? t[0] : t, ne = I.find((e) => e.value === l);
594
+ if (G.searchParam) {
595
+ let r = j && G?.showLoading ? /* @__PURE__ */ (0, J.jsxs)("div", {
596
+ className: "flex items-center gap-2",
597
+ children: [/* @__PURE__ */ (0, J.jsx)(de, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ (0, J.jsx)("span", {
598
+ className: "text-muted-foreground",
599
+ children: ne?.label || b || W("renderer.defaultHttpInput.search")
600
+ })]
601
+ }) : ne?.label || b || W("renderer.defaultHttpInput.search");
602
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
603
+ className: "mb-4",
604
+ children: [
605
+ /* @__PURE__ */ (0, J.jsxs)(i, { children: [g || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
606
+ className: "text-red-500",
607
+ children: "*"
608
+ })] }),
609
+ /* @__PURE__ */ (0, J.jsxs)(T, {
610
+ open: ce,
611
+ onOpenChange: le,
612
+ children: [/* @__PURE__ */ (0, J.jsx)(a, {
613
+ asChild: !0,
614
+ children: /* @__PURE__ */ (0, J.jsxs)(c, {
615
+ variant: "outline",
616
+ role: "combobox",
617
+ "aria-expanded": ce,
618
+ className: "w-full justify-between",
619
+ children: [r, /* @__PURE__ */ (0, J.jsx)(ue, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
620
+ })
621
+ }), /* @__PURE__ */ (0, J.jsx)(f, {
622
+ className: "w-[300px] p-0",
623
+ align: "start",
624
+ children: /* @__PURE__ */ (0, J.jsxs)(ee, {
625
+ shouldFilter: !1,
626
+ children: [/* @__PURE__ */ (0, J.jsx)(m, {
627
+ placeholder: W("renderer.defaultHttpInput.search"),
628
+ value: R,
629
+ onValueChange: (e) => {
630
+ se(e), F(null);
631
+ }
632
+ }), /* @__PURE__ */ (0, J.jsxs)(S, { children: [
633
+ j && /* @__PURE__ */ (0, J.jsx)("div", {
634
+ className: "flex items-center justify-center p-4",
635
+ children: /* @__PURE__ */ (0, J.jsx)(de, { className: "h-4 w-4 animate-spin" })
636
+ }),
637
+ !j && P && /* @__PURE__ */ (0, J.jsxs)("div", {
638
+ className: "p-4 text-destructive text-sm",
639
+ children: [/* @__PURE__ */ (0, J.jsx)("div", { children: P }), /* @__PURE__ */ (0, J.jsx)("button", {
640
+ type: "button",
641
+ onClick: () => $(R),
642
+ className: "mt-2 block text-primary hover:underline",
643
+ children: W("renderer.defaultHttpInput.retry")
644
+ })]
645
+ }),
646
+ !(j || P) && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(x, { children: W("renderer.defaultHttpInput.noResults") }), /* @__PURE__ */ (0, J.jsx)(_, { children: I.map((e) => /* @__PURE__ */ (0, J.jsxs)(te, {
647
+ value: e.value,
648
+ onSelect: () => {
649
+ s(e.value), le(!1);
650
+ },
651
+ children: [/* @__PURE__ */ (0, J.jsx)(oe, { className: o("mr-2 h-4 w-4", t === e.value ? "opacity-100" : "opacity-0") }), e.label]
652
+ }, e.value)) })] })
653
+ ] })]
654
+ })
655
+ })]
656
+ }),
657
+ u && /* @__PURE__ */ (0, J.jsx)(n, { children: u }),
658
+ C && !u && /* @__PURE__ */ (0, J.jsx)(y, { children: C })
659
+ ]
660
+ });
661
+ }
662
+ let k = j && G?.showLoading, re = Z.filter((e) => {
663
+ let t = H[e];
664
+ return t == null || t === "";
665
+ }), M = re.map((e) => D(e, U) || e), N = I.length === 0 && !k ? P || (re.length > 0 ? `${W("renderer.defaultHttpInput.waitingForRequiredFields")}: ${M.join(", ")}` : W("renderer.defaultHttpInput.noDataAvailable")) : void 0, L = /* @__PURE__ */ (0, J.jsxs)(p, {
666
+ value: Array.isArray(t) ? t[0] ?? "" : t ?? "",
667
+ onValueChange: (e) => s(e),
668
+ disabled: k || I.length === 0,
669
+ name: A,
670
+ children: [/* @__PURE__ */ (0, J.jsxs)(d, {
671
+ id: O,
672
+ name: A,
673
+ className: "w-full",
674
+ children: [k && /* @__PURE__ */ (0, J.jsx)(de, { className: "mr-2 h-4 w-4 animate-spin" }), /* @__PURE__ */ (0, J.jsx)(r, { placeholder: b || W("renderer.defaultHttpInput.selectOption") })]
675
+ }), /* @__PURE__ */ (0, J.jsx)(w, { children: /* @__PURE__ */ (0, J.jsx)(E, { children: I.map((e, t) => /* @__PURE__ */ (0, J.jsx)(h, {
676
+ value: e.value,
677
+ children: e.label
678
+ }, e.value + t)) }) })]
679
+ });
680
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
681
+ className: "mb-4",
682
+ children: [
683
+ /* @__PURE__ */ (0, J.jsxs)(i, {
684
+ htmlFor: O,
685
+ children: [g || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
686
+ className: "text-red-500",
687
+ children: "*"
688
+ })]
689
+ }),
690
+ N ? /* @__PURE__ */ (0, J.jsx)(be, { children: /* @__PURE__ */ (0, J.jsxs)(xe, { children: [/* @__PURE__ */ (0, J.jsx)(Se, {
691
+ asChild: !0,
692
+ children: /* @__PURE__ */ (0, J.jsx)("div", {
693
+ className: "w-full",
694
+ children: L
695
+ })
696
+ }), /* @__PURE__ */ (0, J.jsx)(Ce, { children: /* @__PURE__ */ (0, J.jsx)("p", { children: N }) })] }) }) : L,
697
+ u && /* @__PURE__ */ (0, J.jsx)(n, { children: u }),
698
+ C && !u && /* @__PURE__ */ (0, J.jsx)(y, { children: C })
699
+ ]
700
+ });
701
+ }
702
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
703
+ className: "mb-4",
704
+ children: [
705
+ /* @__PURE__ */ (0, J.jsxs)(i, {
706
+ htmlFor: O,
707
+ children: [g || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
708
+ className: "text-red-500",
709
+ children: "*"
710
+ })]
711
+ }),
712
+ /* @__PURE__ */ (0, J.jsx)(l, {
713
+ type: "text",
714
+ name: A,
715
+ id: O,
716
+ value: typeof t == "string" ? t : JSON.stringify(t),
717
+ readOnly: !0,
718
+ disabled: !0
719
+ }),
720
+ u && /* @__PURE__ */ (0, J.jsx)(n, { children: u }),
721
+ C && !u && /* @__PURE__ */ (0, J.jsx)(y, { children: C })
722
+ ]
723
+ });
724
+ }, ke = ({ node: e, value: t, setValue: r, error: a, label: o, placeholder: s, helperText: c, name: u, id: d }) => /* @__PURE__ */ (0, J.jsxs)(v, {
725
+ className: "mb-4",
726
+ children: [
727
+ /* @__PURE__ */ (0, J.jsxs)(i, {
728
+ htmlFor: d,
729
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
730
+ className: "text-red-500",
731
+ children: "*"
732
+ })]
733
+ }),
734
+ /* @__PURE__ */ (0, J.jsx)(l, {
735
+ id: d,
736
+ type: "number",
737
+ name: u,
738
+ value: t ?? "",
739
+ onChange: (e) => r(e.target.value === "" ? null : Number(e.target.value)),
740
+ placeholder: s
741
+ }),
742
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
743
+ c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
744
+ ]
745
+ }), Ae = ({ node: e, value: t, setValue: r, error: a, label: o, placeholder: s, helperText: c, name: u, id: d }) => /* @__PURE__ */ (0, J.jsxs)(v, {
746
+ className: "mb-4",
747
+ children: [
748
+ /* @__PURE__ */ (0, J.jsxs)(i, {
749
+ htmlFor: d,
750
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
751
+ className: "text-red-500",
752
+ children: "*"
753
+ })]
754
+ }),
755
+ /* @__PURE__ */ (0, J.jsx)(l, {
756
+ id: d,
757
+ name: u,
758
+ type: "password",
759
+ value: t ?? "",
760
+ onChange: (e) => r(e.target.value),
761
+ placeholder: s,
762
+ autoComplete: "new-password"
763
+ }),
764
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
765
+ c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
766
+ ]
767
+ });
768
+ //#endregion
769
+ //#region src/shared/components/ui/radio-group.tsx
770
+ function je({ className: e, ...t }) {
771
+ return /* @__PURE__ */ (0, J.jsx)(q.Root, {
772
+ "data-slot": "radio-group",
773
+ className: o("grid gap-3", e),
774
+ ...t
775
+ });
776
+ }
777
+ function Me({ className: e, ...t }) {
778
+ return /* @__PURE__ */ (0, J.jsx)(q.Item, {
779
+ "data-slot": "radio-group-item",
780
+ className: o("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40", e),
781
+ ...t,
782
+ children: /* @__PURE__ */ (0, J.jsx)(q.Indicator, {
783
+ "data-slot": "radio-group-indicator",
784
+ className: "relative flex items-center justify-center",
785
+ children: /* @__PURE__ */ (0, J.jsx)(H, { className: "-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 size-2 fill-primary" })
786
+ })
787
+ });
788
+ }
789
+ //#endregion
790
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.tsx
791
+ var Ne = ({ node: e, value: t, setValue: r, error: a, label: o, helperText: s, id: c, name: l }) => {
792
+ let u = M(), d = t ? String(t) : "";
793
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
794
+ className: "mb-4",
795
+ children: [
796
+ /* @__PURE__ */ (0, J.jsxs)(i, {
797
+ className: "mb-1",
798
+ htmlFor: c,
799
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
800
+ className: "text-red-500",
801
+ children: "*"
802
+ })]
803
+ }),
804
+ /* @__PURE__ */ (0, J.jsx)(je, {
805
+ value: d,
806
+ onValueChange: (e) => r(e),
807
+ id: c,
808
+ name: l,
809
+ children: e.data.options?.map((e, t) => /* @__PURE__ */ (0, J.jsxs)("div", {
810
+ className: "flex items-center space-x-2",
811
+ children: [
812
+ /* @__PURE__ */ (0, J.jsx)(Me, {
813
+ value: String(e.value),
814
+ id: `${c}-${e.value}`,
815
+ disabled: e.disabled
816
+ }),
817
+ e.image && /* @__PURE__ */ (0, J.jsx)("img", {
818
+ src: e.image,
819
+ alt: "",
820
+ className: "h-8 w-8 rounded object-cover"
821
+ }),
822
+ /* @__PURE__ */ (0, J.jsx)(i, {
823
+ htmlFor: `${c}-${e.value}`,
824
+ className: "cursor-pointer font-normal text-sm",
825
+ children: u(e.label) ? u(e.label) : e.value
826
+ })
827
+ ]
828
+ }, e.value + t))
829
+ }),
830
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
831
+ s && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: s })
832
+ ]
833
+ });
834
+ }, Pe = ({ node: e, value: t, setValue: a, error: o, label: s, placeholder: c, helperText: l, name: u, id: f }) => {
835
+ let m = M(), g = t ? String(t) : "";
836
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
837
+ className: "mb-4",
838
+ children: [
839
+ /* @__PURE__ */ (0, J.jsxs)(i, {
840
+ htmlFor: f,
841
+ children: [s || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
842
+ className: "text-red-500",
843
+ children: "*"
844
+ })]
845
+ }),
846
+ /* @__PURE__ */ (0, J.jsxs)(p, {
847
+ name: u,
848
+ value: g,
849
+ onValueChange: (e) => a(e),
850
+ children: [/* @__PURE__ */ (0, J.jsx)(d, {
851
+ id: f,
852
+ name: u,
853
+ className: "w-full",
854
+ children: /* @__PURE__ */ (0, J.jsx)(r, { placeholder: c || m("renderer.defaultSelectInput.selectOption") })
855
+ }), /* @__PURE__ */ (0, J.jsx)(w, { children: /* @__PURE__ */ (0, J.jsx)(E, { children: e.data.options?.map((e, t) => /* @__PURE__ */ (0, J.jsx)(h, {
856
+ value: String(e.value),
857
+ disabled: e.disabled,
858
+ children: m(e.label) ? m(e.label) : e.value
859
+ }, `${e.value}-${t}`)) }) })]
860
+ }),
861
+ o && /* @__PURE__ */ (0, J.jsx)(n, { children: o }),
862
+ l && !o && /* @__PURE__ */ (0, J.jsx)(y, { children: l })
863
+ ]
864
+ });
865
+ }, Fe = R(({ label: e, id: t, disabled: n, onBlur: r, onClick: i, onFocus: a, onPointerDown: o, onPointerLeave: s, onPointerMove: c, ...l }, u) => {
866
+ let d = M();
867
+ return /* @__PURE__ */ (0, J.jsx)("button", {
868
+ ref: u,
869
+ id: t,
870
+ onBlur: r,
871
+ onClick: i,
872
+ onFocus: a,
873
+ onPointerDown: o,
874
+ disabled: n,
875
+ onPointerLeave: s,
876
+ onPointerMove: c,
877
+ type: "submit",
878
+ className: "mt-4 rounded-md bg-blue-500 px-4 py-2 font-medium text-white transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
879
+ ...l,
880
+ children: e || d("renderer.defaultSubmitButton.submit")
881
+ });
882
+ }), Ie = ({ children: e, missingFields: t = [] }) => {
883
+ let n = t.length > 0, r = M();
884
+ return n ? /* @__PURE__ */ (0, J.jsx)(be, { children: /* @__PURE__ */ (0, J.jsxs)(xe, { children: [/* @__PURE__ */ (0, J.jsx)(Se, {
885
+ asChild: !0,
886
+ children: e
887
+ }), /* @__PURE__ */ (0, J.jsx)(Ce, { children: /* @__PURE__ */ (0, J.jsxs)("div", {
888
+ className: "space-y-1",
889
+ children: [/* @__PURE__ */ (0, J.jsxs)("p", {
890
+ className: "font-semibold",
891
+ children: [r("renderer.defaultSubmitButton.requiredFieldsMissing"), ":"]
892
+ }), /* @__PURE__ */ (0, J.jsx)("ul", {
893
+ className: "list-inside list-disc",
894
+ children: t.map((e, t) => /* @__PURE__ */ (0, J.jsx)("li", { children: e }, t))
895
+ })]
896
+ }) })] }) }) : e;
897
+ }, Le = ({ missingRequiredFields: e, isSubmitting: t, label: n }) => {
898
+ let r = I(), i = r?.components?.submitButton, a = r?.components?.submitButtonWrapper;
899
+ return /* @__PURE__ */ (0, J.jsx)(a || Ie, {
900
+ missingFields: e,
901
+ children: /* @__PURE__ */ (0, J.jsx)(i || Fe, {
902
+ label: n,
903
+ disabled: t
904
+ })
905
+ });
906
+ }, Re = ({ node: e, value: t, setValue: r, error: a, label: o, helperText: s, name: c, id: l }) => /* @__PURE__ */ (0, J.jsxs)(v, {
907
+ className: "mb-4",
908
+ children: [
909
+ /* @__PURE__ */ (0, J.jsxs)(i, {
910
+ htmlFor: l,
911
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
912
+ className: "text-red-500",
913
+ children: "*"
914
+ })]
915
+ }),
916
+ /* @__PURE__ */ (0, J.jsx)(g, {
917
+ id: l,
918
+ name: c,
919
+ checked: t,
920
+ onCheckedChange: r
921
+ }),
922
+ s && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: s }),
923
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a })
924
+ ]
925
+ }), ze = ({ node: e, value: t, setValue: r, error: a, label: o, placeholder: s, helperText: c, name: l, id: u }) => /* @__PURE__ */ (0, J.jsxs)(v, {
926
+ className: "mb-4",
927
+ children: [
928
+ /* @__PURE__ */ (0, J.jsxs)(i, {
929
+ htmlFor: u,
930
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
931
+ className: "text-red-500",
932
+ children: "*"
933
+ })]
934
+ }),
935
+ /* @__PURE__ */ (0, J.jsx)(b, {
936
+ id: u,
937
+ name: l,
938
+ value: t ?? "",
939
+ onChange: (e) => r(e.target.value),
940
+ placeholder: s,
941
+ className: "w-full rounded-md border px-3 py-2",
942
+ rows: 4
943
+ }),
944
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
945
+ c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
946
+ ]
947
+ }), Be = ({ node: e, value: t, setValue: r, error: a, label: o, placeholder: s, helperText: c, name: u, id: d }) => /* @__PURE__ */ (0, J.jsxs)(v, {
948
+ className: "mb-4",
949
+ children: [
950
+ /* @__PURE__ */ (0, J.jsxs)(i, {
951
+ htmlFor: d,
952
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
953
+ className: "text-red-500",
954
+ children: "*"
955
+ })]
956
+ }),
957
+ /* @__PURE__ */ (0, J.jsx)(l, {
958
+ type: "text",
959
+ id: d,
960
+ name: u,
961
+ value: t ?? "",
962
+ onChange: (e) => r(e.target.value),
963
+ placeholder: s
964
+ }),
965
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
966
+ c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
967
+ ]
968
+ }), Ve = ({ node: e, value: t, setValue: r, error: a, label: o, placeholder: s, helperText: c, name: u, id: d }) => /* @__PURE__ */ (0, J.jsxs)(v, {
969
+ className: "mb-4",
970
+ children: [
971
+ /* @__PURE__ */ (0, J.jsxs)(i, {
972
+ htmlFor: d,
973
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
974
+ className: "text-red-500",
975
+ children: "*"
976
+ })]
977
+ }),
978
+ /* @__PURE__ */ (0, J.jsx)(l, {
979
+ type: "time",
980
+ id: d,
981
+ name: u,
982
+ value: t ?? "",
983
+ onChange: (e) => r(e.target.value),
984
+ placeholder: s,
985
+ className: "bg-background [color-scheme:light] dark:[color-scheme:dark]"
986
+ }),
987
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
988
+ c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
989
+ ]
990
+ }), He = ({ node: e, value: t, setValue: r, error: a, label: o, helperText: s, id: c, name: u }) => {
991
+ let d = M(), f = Array.isArray(t) ? t : [], p = f[0] || "", m = f[1] || "", h = (e) => {
992
+ r([e, m]);
993
+ }, g = (e) => {
994
+ r([p, e]);
995
+ };
996
+ return /* @__PURE__ */ (0, J.jsxs)(v, {
997
+ className: "mb-4",
998
+ children: [
999
+ /* @__PURE__ */ (0, J.jsxs)(i, {
1000
+ htmlFor: `${c}-start`,
1001
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
1002
+ className: "text-red-500",
1003
+ children: "*"
1004
+ })]
1005
+ }),
1006
+ /* @__PURE__ */ (0, J.jsxs)("div", {
1007
+ className: "flex gap-2",
1008
+ children: [/* @__PURE__ */ (0, J.jsx)(l, {
1009
+ id: `${c}-start`,
1010
+ name: `${u}-start`,
1011
+ "aria-label": `${o || e.data.name} - ${d("renderer.defaultInputs.startTime")}`,
1012
+ "aria-invalid": !!a,
1013
+ "aria-describedby": a ? `${e.id}-error` : void 0,
1014
+ type: "time",
1015
+ value: p,
1016
+ onChange: (e) => h(e.target.value),
1017
+ placeholder: d("renderer.defaultInputs.startTime"),
1018
+ className: "flex-1 bg-background [color-scheme:light] dark:[color-scheme:dark]"
1019
+ }), /* @__PURE__ */ (0, J.jsx)(l, {
1020
+ id: `${c}-end`,
1021
+ name: `${u}-end`,
1022
+ "aria-label": `${o || e.data.name} - ${d("renderer.defaultInputs.endTime")}`,
1023
+ "aria-invalid": !!a,
1024
+ "aria-describedby": a ? `${e.id}-error` : void 0,
1025
+ type: "time",
1026
+ value: m,
1027
+ onChange: (e) => g(e.target.value),
1028
+ placeholder: d("renderer.defaultInputs.endTime"),
1029
+ className: "flex-1 bg-background [color-scheme:light] dark:[color-scheme:dark]"
1030
+ })]
1031
+ }),
1032
+ a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
1033
+ s && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: s })
1034
+ ]
1035
+ });
1036
+ }, Ue = {
1037
+ address: he,
1038
+ autocomplete: X,
1039
+ checkbox: Z,
1040
+ date: _e,
1041
+ daterange: $,
1042
+ file: ve,
1043
+ hidden: ye,
1044
+ http: Oe,
1045
+ number: ke,
1046
+ password: Ae,
1047
+ radio: Ne,
1048
+ select: Pe,
1049
+ submit: Le,
1050
+ switch: Re,
1051
+ text: Be,
1052
+ textarea: ze,
1053
+ time: Ve,
1054
+ timerange: He
1055
+ }, We = ({ node: e }) => {
1056
+ let t = M()(e.data?.label);
1057
+ return t ? /* @__PURE__ */ (0, J.jsxs)("div", {
1058
+ className: "flex items-center gap-x-3",
1059
+ children: [
1060
+ /* @__PURE__ */ (0, J.jsx)(C, { className: "my-8 flex-1" }),
1061
+ /* @__PURE__ */ (0, J.jsx)("h4", {
1062
+ className: "font-semibold text-sm",
1063
+ children: t
1064
+ }),
1065
+ /* @__PURE__ */ (0, J.jsx)(C, { className: "my-8 flex-1" })
1066
+ ]
1067
+ }) : /* @__PURE__ */ (0, J.jsx)(C, { className: "my-8" });
1068
+ }, Ge = ({ node: e }) => {
1069
+ let { edges: t } = k(), n = M();
1070
+ return /* @__PURE__ */ (0, J.jsx)("h2", {
1071
+ className: o("mb-5 font-bold text-2xl", !A(e.id, t) && "mt-10"),
1072
+ children: n(e.data?.label)
1073
+ });
1074
+ }, Ke = {
1075
+ divider: We,
1076
+ title: Ge
1077
+ }, qe = ({ components: e, className: n, flows: r, googleApiKey: i, language: a, onChange: s, onSubmit: c, theme: l, validate: u, validationMode: d, initialValues: f = {} }) => {
1078
+ let { canSubmit: p, clearSubmitMessage: m, config: h, firstErrorFieldId: g, formErrors: _, formValues: v, handleSubmit: y, inputNodes: b, isSubmitting: ee, mergedFlow: te, missingRequiredFields: x, setFieldValue: S, submitMessage: C, t: w, visibleNodes: T, visibleRootNodes: E } = O({
1079
+ components: e,
1080
+ flows: r,
1081
+ googleApiKey: i,
1082
+ initialValues: f,
1083
+ language: a,
1084
+ onChange: s,
1085
+ onSubmit: c,
1086
+ theme: l,
1087
+ validate: u,
1088
+ validationMode: d
1089
+ }), { FormWrapper: D, SubmitButton: ne, SubmitButtonWrapper: k, renderNode: A } = F({
1090
+ config: h,
1091
+ DefaultFormWrapper: fe,
1092
+ DefaultGroup: Y,
1093
+ DefaultSubmitButton: Fe,
1094
+ DefaultSubmitButtonWrapper: Ie,
1095
+ defaultInputRenderers: Ue,
1096
+ defaultUI: Ke,
1097
+ formErrors: _,
1098
+ formValues: v,
1099
+ missingRequiredFields: x,
1100
+ setFieldValue: S,
1101
+ visibleNodes: T
1102
+ }), re = ie(async (e) => {
1103
+ e.preventDefault(), !await y() && g && document.getElementById(g)?.focus();
1104
+ }, [y, g]);
1105
+ return /* @__PURE__ */ (0, J.jsx)("div", {
1106
+ className: o("treege", n),
1107
+ children: /* @__PURE__ */ (0, J.jsx)(t, {
1108
+ theme: h.theme,
1109
+ storageKey: "treege-renderer-theme",
1110
+ children: /* @__PURE__ */ (0, J.jsxs)(P, {
1111
+ value: {
1112
+ flows: te,
1113
+ formErrors: _,
1114
+ formValues: v,
1115
+ googleApiKey: h.googleApiKey,
1116
+ inputNodes: b,
1117
+ language: h.language,
1118
+ setFieldValue: S
1119
+ },
1120
+ children: [/* @__PURE__ */ (0, J.jsxs)(D, {
1121
+ onSubmit: re,
1122
+ children: [
1123
+ E.map((e) => A(e)),
1124
+ p && /* @__PURE__ */ (0, J.jsx)(k, {
1125
+ missingFields: x,
1126
+ children: /* @__PURE__ */ (0, J.jsx)(ne, {
1127
+ label: w("renderer.defaultSubmitButton.submit"),
1128
+ disabled: ee
1129
+ })
1130
+ }),
1131
+ /* @__PURE__ */ (0, J.jsx)("p", {
1132
+ className: "py-2 text-muted-foreground text-xs",
1133
+ children: "Powered by Treege"
1134
+ })
1135
+ ]
1136
+ }), C && /* @__PURE__ */ (0, J.jsx)("div", {
1137
+ className: `my-4 rounded-md p-4 ${C.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"}`,
1138
+ role: "alert",
1139
+ children: /* @__PURE__ */ (0, J.jsxs)("div", {
1140
+ className: "flex items-center justify-between",
1141
+ children: [/* @__PURE__ */ (0, J.jsx)("p", {
1142
+ className: "font-medium text-sm",
1143
+ children: C.message
1144
+ }), /* @__PURE__ */ (0, J.jsx)("button", {
1145
+ type: "button",
1146
+ onClick: m,
1147
+ className: "ml-4 font-medium text-sm underline hover:no-underline focus:outline-none",
1148
+ children: w("common.close")
1149
+ })]
1150
+ })
1151
+ })]
1152
+ })
1153
+ })
1154
+ });
1155
+ };
1156
+ //#endregion
1157
+ export { Y as C, he as S, ve as _, Ue as a, Z as b, Be as c, Pe as d, Ne as f, ye as g, Oe as h, Ke as i, ze as l, ke as m, We as n, He as o, Ae as p, Ge as r, Ve as s, qe as t, Re as u, $ as v, X as x, _e as y };