@foris/avocado-not-front 4.4.0 → 4.6.0

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 (32) hide show
  1. package/dist/avocado-not-front.es.js +2133 -1635
  2. package/dist/avocado-not-front.umd.js +3 -3
  3. package/dist/src/components/box/Box.d.ts +7 -0
  4. package/dist/src/components/dropdown-button/DropdownButton.d.ts +7 -0
  5. package/dist/src/components/index.d.ts +13 -6
  6. package/dist/src/components/layout-card/LayoutCard.d.ts +7 -0
  7. package/dist/src/components/menu/Menu.d.ts +7 -0
  8. package/dist/src/components/radio-group/RadioGroup.d.ts +8 -0
  9. package/dist/src/components/stepper/Stepper.d.ts +7 -0
  10. package/dist/src/components/table/table.util.d.ts +10 -0
  11. package/dist/src/components/textarea/Textarea.d.ts +7 -0
  12. package/dist/src/hooks/useDependencies.d.ts +6 -2
  13. package/dist/src/hooks/useNotFrontButtonActionRunner.d.ts +10 -0
  14. package/dist/src/index.d.ts +1 -0
  15. package/dist/src/types/components.type.d.ts +713 -97
  16. package/dist/src/types/componentsCore.type.d.ts +5 -1
  17. package/dist/src/types/dynamicRouteDefinition.type.d.ts +6 -0
  18. package/dist/src/types/index.d.ts +1 -0
  19. package/dist/src/utils/dataSource.util.d.ts +2 -1
  20. package/dist/src/utils/dynamicRouting/index.d.ts +5 -0
  21. package/dist/src/utils/dynamicRouting/normalizePathname.d.ts +2 -0
  22. package/dist/src/utils/dynamicRouting/normalizePathname.test.d.ts +1 -0
  23. package/dist/src/utils/dynamicRouting/pathBelongsToPrefix.d.ts +6 -0
  24. package/dist/src/utils/dynamicRouting/pathBelongsToPrefix.test.d.ts +1 -0
  25. package/dist/src/utils/dynamicRouting/selectDynamicRoutesUnderPrefix.d.ts +9 -0
  26. package/dist/src/utils/dynamicRouting/selectDynamicRoutesUnderPrefix.test.d.ts +1 -0
  27. package/dist/src/utils/dynamicRouting/stripPrefixFromPathname.d.ts +6 -0
  28. package/dist/src/utils/dynamicRouting/stripPrefixFromPathname.test.d.ts +1 -0
  29. package/dist/src/utils/dynamicRouting/userCanAccessDynamicRoute.d.ts +9 -0
  30. package/dist/src/utils/dynamicRouting/userCanAccessDynamicRoute.test.d.ts +1 -0
  31. package/dist/style.css +1 -1
  32. package/package.json +4 -4
@@ -1,64 +1,65 @@
1
- import V from "axios";
2
- import { create as Ye } from "zustand";
3
- import Ze, { useMemo as T, useEffect as z, useState as A, Fragment as S, useCallback as R, useRef as Fe, cloneElement as Pe } from "react";
4
- import { Heading as Be, Text as et, ThemeStore as te, Tooltip as tt, Breadcrumbs as nt, Button as st, CardAccordion as at, CardNotification as me, Checkbox as rt, PreviewerMarkdown as Ke, DataCard as ot, Divider as ct, SkeletonBase as Me, Link as it, Modal as lt, Pill as he, RoundButton as dt, SelectPagination as _t, Select as ut, Switch as ht, Table as ft, Pager as mt, Tabs as yt, TextField as xt, toast as Q, Accordion as gt, Drawer as pt, Loading as bt, Toaster as jt } from "@foris/avocado-suite";
5
- import { ChatPanel as wt, SummaryCard as Ct, PromptCodeEditor as Nt } from "@foris/ai-agent";
6
- import vt from "@uiw/react-codemirror";
7
- import { json as we } from "@codemirror/lang-json";
8
- import { markdown as Et } from "@codemirror/lang-markdown";
9
- import { sql as St } from "@codemirror/lang-sql";
10
- import { yaml as kt } from "@codemirror/lang-yaml";
11
- import L from "jsonpath";
12
- import { Legend as Tt, Tooltip as $t, XAxis as At, YAxis as qt, ResponsiveContainer as ne, AreaChart as Ot, CartesianGrid as ye, Area as Rt, BarChart as Dt, Bar as Lt, LineChart as It, Line as Bt, PieChart as Kt, Pie as Mt, Cell as zt } from "recharts";
13
- import { Routes as Gt, Route as Ce, Navigate as Ut } from "react-router-dom";
14
- const v = Ye(() => ({})), ce = (e, t, a, s) => {
15
- const c = a == null ? void 0 : a.hash, i = s && Object.keys(s).length > 0 ? { ...s } : {};
16
- v.setState((l) => {
1
+ import H from "axios";
2
+ import { create as nt } from "zustand";
3
+ import st, { useMemo as A, useState as L, useCallback as R, Fragment as k, useEffect as z, useRef as Me, cloneElement as at } from "react";
4
+ import { Heading as ze, Text as rt, Accordion as ot, ThemeStore as ne, Box as ct, RadioButton as it, Stepper as lt, Breadcrumbs as dt, Button as _t, CardAccordion as ut, Card as ht, CardNotification as ge, SkeletonBase as Ve, Checkbox as ft, PreviewerMarkdown as Je, DataCard as mt, Divider as yt, Drawer as xt, DropdownButton as gt, Link as pt, Menu as bt, Modal as jt, Pill as ye, RoundButton as Nt, SelectPagination as wt, Select as Ct, Switch as vt, Table as St, Pager as Et, Tabs as Tt, Textarea as kt, TextField as Ot, toast as ee, Tooltip as At, Loading as $t, Toaster as qt } from "@foris/avocado-suite";
5
+ import { ChatPanel as Dt, PromptCodeEditor as Rt, SummaryCard as Lt } from "@foris/ai-agent";
6
+ import B from "jsonpath";
7
+ import { Legend as It, Tooltip as Bt, XAxis as Kt, YAxis as Gt, ResponsiveContainer as oe, AreaChart as Ut, CartesianGrid as pe, Area as Mt, BarChart as zt, Bar as Vt, LineChart as Jt, Line as Xt, PieChart as Ht, Pie as Wt, Cell as Qt } from "recharts";
8
+ import Yt from "@uiw/react-codemirror";
9
+ import { json as ve } from "@codemirror/lang-json";
10
+ import { markdown as Zt } from "@codemirror/lang-markdown";
11
+ import { sql as Ft } from "@codemirror/lang-sql";
12
+ import { yaml as Pt } from "@codemirror/lang-yaml";
13
+ import { Icon as Se } from "@foris/avocado-icons";
14
+ import { Routes as en, Route as Ee, Navigate as tn } from "react-router-dom";
15
+ const v = nt(() => ({})), de = (e, t, s, r) => {
16
+ const i = s == null ? void 0 : s.hash, l = r && Object.keys(r).length > 0 ? { ...r } : {};
17
+ v.setState((c) => {
17
18
  var n;
18
19
  return {
19
- ...l,
20
+ ...c,
20
21
  [e]: {
21
- ...l[e],
22
+ ...c[e],
22
23
  apiConfig: t,
23
- currentPageId: c,
24
+ currentPageId: i,
24
25
  isLoading: !1,
25
26
  isModalOpen: !0,
26
27
  isDrawerOpen: !1,
27
- entries: i,
28
+ entries: l,
28
29
  overlay: null,
29
30
  pages: {
30
- ...(n = l[e]) == null ? void 0 : n.pages,
31
- [c]: {
32
- page: a
31
+ ...(n = c[e]) == null ? void 0 : n.pages,
32
+ [i]: {
33
+ page: s
33
34
  }
34
35
  }
35
36
  }
36
37
  };
37
38
  });
38
- }, ze = (e, t, a) => {
39
- const s = a && Object.keys(a).length > 0 ? { ...e, ...a } : e;
39
+ }, Xe = (e, t, s) => {
40
+ const r = s && Object.keys(s).length > 0 ? { ...e, ...s } : e;
40
41
  return t.length === 0 ? e : Object.fromEntries(
41
- Object.entries(s).filter(
42
- ([c]) => !t.includes(c)
42
+ Object.entries(r).filter(
43
+ ([i]) => !t.includes(i)
43
44
  )
44
45
  );
45
- }, Jt = (e, t, a, s, c) => {
46
- sessionStorage.setItem("sessionId", a), v.setState((i) => {
47
- const l = i[e] ?? {}, n = l.entries ?? {}, d = ze(
46
+ }, nn = (e, t, s, r, i) => {
47
+ sessionStorage.setItem("sessionId", s), v.setState((l) => {
48
+ const c = l[e] ?? {}, n = c.entries ?? {}, d = Xe(
48
49
  n,
49
- s,
50
- c
50
+ r,
51
+ i
51
52
  );
52
53
  return {
53
- ...i,
54
+ ...l,
54
55
  [e]: {
55
- ...l,
56
+ ...c,
56
57
  currentPageId: t.hash,
57
58
  entries: d,
58
59
  isLoading: !1,
59
60
  overlay: null,
60
61
  pages: {
61
- ...l.pages,
62
+ ...c.pages,
62
63
  [t.hash]: {
63
64
  page: { ...t }
64
65
  }
@@ -66,20 +67,20 @@ const v = Ye(() => ({})), ce = (e, t, a, s) => {
66
67
  }
67
68
  };
68
69
  });
69
- }, Vt = (e, t, a, s) => {
70
- v.setState((c) => {
71
- var r;
72
- const i = c[e] ?? {}, l = i.entries ?? {}, n = ze(
73
- l,
74
- a,
75
- s
76
- ), d = (r = t.components) == null ? void 0 : r.some(
70
+ }, sn = (e, t, s, r) => {
71
+ v.setState((i) => {
72
+ var a;
73
+ const l = i[e] ?? {}, c = l.entries ?? {}, n = Xe(
74
+ c,
75
+ s,
76
+ r
77
+ ), d = (a = t.components) == null ? void 0 : a.some(
77
78
  (u) => u.component === "drawer"
78
79
  );
79
80
  return {
80
- ...c,
81
+ ...i,
81
82
  [e]: {
82
- ...i,
83
+ ...l,
83
84
  entries: n,
84
85
  overlay: t,
85
86
  isLoading: !1,
@@ -88,7 +89,7 @@ const v = Ye(() => ({})), ce = (e, t, a, s) => {
88
89
  }
89
90
  };
90
91
  });
91
- }, xe = (e) => {
92
+ }, be = (e) => {
92
93
  v.setState((t) => ({
93
94
  ...t,
94
95
  [e]: {
@@ -96,138 +97,138 @@ const v = Ye(() => ({})), ce = (e, t, a, s) => {
96
97
  overlay: null
97
98
  }
98
99
  }));
99
- }, Ht = (e) => {
100
- var a;
101
- return ((a = v.getState()[e]) == null ? void 0 : a.overlay) ?? null;
102
- }, q = (e, t) => {
100
+ }, an = (e) => {
101
+ var s;
102
+ return ((s = v.getState()[e]) == null ? void 0 : s.overlay) ?? null;
103
+ }, $ = (e, t) => {
103
104
  const {
104
- content: a,
105
- sessionId: s,
106
- deprecatedStateKeys: c = [],
107
- sessionState: i
105
+ content: s,
106
+ sessionId: r,
107
+ deprecatedStateKeys: i = [],
108
+ sessionState: l
108
109
  } = t;
109
- a.type !== "page" && a.type !== "overlay" || (a.type === "page" ? Jt(
110
+ s.type !== "page" && s.type !== "overlay" || (s.type === "page" ? nn(
110
111
  e,
111
- a,
112
112
  s,
113
- c,
114
- i
115
- ) : Vt(
113
+ r,
114
+ i,
115
+ l
116
+ ) : sn(
116
117
  e,
117
- a,
118
- c,
119
- i
118
+ s,
119
+ i,
120
+ l
120
121
  ));
121
- }, O = (e, t) => {
122
- v.setState((a) => {
123
- var s;
122
+ }, q = (e, t) => {
123
+ v.setState((s) => {
124
+ var r;
124
125
  return {
125
- ...a,
126
+ ...s,
126
127
  [e]: {
127
- ...a[e],
128
+ ...s[e],
128
129
  entries: {
129
- ...(s = a[e]) == null ? void 0 : s.entries,
130
+ ...(r = s[e]) == null ? void 0 : r.entries,
130
131
  ...t
131
132
  // New entries
132
133
  }
133
134
  }
134
135
  };
135
136
  });
136
- }, Xt = (e, t) => {
137
- v.setState((a) => {
138
- const s = a[e];
139
- if (!s)
140
- return a;
141
- const c = s.entries ?? {};
142
- if (!(t in c))
143
- return a;
144
- const { [t]: i, ...l } = c;
137
+ }, rn = (e, t) => {
138
+ v.setState((s) => {
139
+ const r = s[e];
140
+ if (!r)
141
+ return s;
142
+ const i = r.entries ?? {};
143
+ if (!(t in i))
144
+ return s;
145
+ const { [t]: l, ...c } = i;
145
146
  return {
146
- ...a,
147
+ ...s,
147
148
  [e]: {
148
- ...s,
149
- entries: l
149
+ ...r,
150
+ entries: c
150
151
  }
151
152
  };
152
153
  });
153
- }, H = (e, t) => {
154
- v.setState((a) => ({
155
- ...a,
154
+ }, Q = (e, t) => {
155
+ v.setState((s) => ({
156
+ ...s,
156
157
  [e]: {
157
- ...a[e],
158
+ ...s[e],
158
159
  isLoading: t
159
160
  }
160
161
  }));
161
- }, ge = (e, t) => {
162
- v.setState((a) => ({
163
- ...a,
162
+ }, ce = (e, t) => {
163
+ v.setState((s) => ({
164
+ ...s,
164
165
  [e]: {
165
- ...a[e],
166
+ ...s[e],
166
167
  isModalOpen: t
167
168
  }
168
169
  }));
169
- }, Z = (e, t) => {
170
- v.setState((a) => ({
171
- ...a,
170
+ }, W = (e, t) => {
171
+ v.setState((s) => ({
172
+ ...s,
172
173
  [e]: {
173
- ...a[e],
174
+ ...s[e],
174
175
  isDrawerOpen: t
175
176
  }
176
177
  }));
177
- }, Ne = (e, t) => {
178
- v.setState((a) => {
179
- const s = a[e];
180
- return s ? {
181
- ...a,
178
+ }, Te = (e, t) => {
179
+ v.setState((s) => {
180
+ const r = s[e];
181
+ return r ? {
182
+ ...s,
182
183
  [e]: {
183
- ...s,
184
+ ...r,
184
185
  apiConfig: {
185
- ...s.apiConfig,
186
+ ...r.apiConfig,
186
187
  headers: t
187
188
  }
188
189
  }
189
- } : a;
190
+ } : s;
190
191
  });
191
192
  };
192
- let ie = !1, P = [], ve = !1;
193
- const Wt = (e) => e._userFlow || null, Ee = (e) => {
194
- P.forEach(({ resolve: t, reject: a }) => {
195
- e ? a(e) : t(void 0);
196
- }), P = [];
197
- }, Qt = async (e) => {
198
- var s, c;
193
+ let _e = !1, re = [], ke = !1;
194
+ const on = (e) => e._userFlow || null, Oe = (e) => {
195
+ re.forEach(({ resolve: t, reject: s }) => {
196
+ e ? s(e) : t(void 0);
197
+ }), re = [];
198
+ }, cn = async (e) => {
199
+ var r, i;
199
200
  const t = e == null ? void 0 : e.config;
200
- if (((s = e == null ? void 0 : e.response) == null ? void 0 : s.status) === 401 && !t._retry) {
201
- const i = Wt(t);
202
- if (i) {
203
- const n = (c = v.getState()[i]) == null ? void 0 : c.apiConfig;
201
+ if (((r = e == null ? void 0 : e.response) == null ? void 0 : r.status) === 401 && !t._retry) {
202
+ const l = on(t);
203
+ if (l) {
204
+ const n = (i = v.getState()[l]) == null ? void 0 : i.apiConfig;
204
205
  if (!n)
205
206
  return Promise.reject(e);
206
207
  if (n.onAuthenticationError || typeof n.headers == "function") {
207
- if (ie)
208
- return new Promise((r, u) => {
209
- P.push({ resolve: r, reject: u });
210
- }).then(() => V(t)).catch((r) => (console.error("[axiosInterceptors] Queued request failed:", r), Promise.reject(r)));
211
- t._retry = !0, ie = !0;
208
+ if (_e)
209
+ return new Promise((a, u) => {
210
+ re.push({ resolve: a, reject: u });
211
+ }).then(() => H(t)).catch((a) => (console.error("[axiosInterceptors] Queued request failed:", a), Promise.reject(a)));
212
+ t._retry = !0, _e = !0;
212
213
  try {
213
- let r;
214
+ let a;
214
215
  if (n.onAuthenticationError)
215
- r = await n.onAuthenticationError();
216
+ a = await n.onAuthenticationError();
216
217
  else if (typeof n.headers == "function")
217
- r = n.headers();
218
+ a = n.headers();
218
219
  else
219
220
  throw new Error("No refresh handler available");
220
- return n.onAuthenticationError && (typeof n.headers == "string" ? Ne(i, JSON.stringify(r)) : Ne(i, r)), t.headers || (t.headers = {}), Object.assign(t.headers, r), Ee(null), V(t);
221
- } catch (r) {
221
+ return n.onAuthenticationError && (typeof n.headers == "string" ? Te(l, JSON.stringify(a)) : Te(l, a)), t.headers || (t.headers = {}), Object.assign(t.headers, a), Oe(null), H(t);
222
+ } catch (a) {
222
223
  return console.error(
223
224
  "[axiosInterceptors] Token refresh failed:",
224
- r
225
+ a
225
226
  ), console.error(
226
227
  "[axiosInterceptors] Rejecting queued requests:",
227
- P.length
228
- ), Ee(r), Promise.reject(r);
228
+ re.length
229
+ ), Oe(a), Promise.reject(a);
229
230
  } finally {
230
- ie = !1;
231
+ _e = !1;
231
232
  }
232
233
  } else
233
234
  console.warn(
@@ -240,20 +241,20 @@ const Wt = (e) => e._userFlow || null, Ee = (e) => {
240
241
  );
241
242
  }
242
243
  return Promise.reject(e);
243
- }, Yt = () => {
244
- if (ve) {
244
+ }, ln = () => {
245
+ if (ke) {
245
246
  console.debug(
246
247
  "[axiosInterceptors] Interceptors already initialized, skipping"
247
248
  );
248
249
  return;
249
250
  }
250
- console.debug("[axiosInterceptors] Initializing interceptors..."), V.interceptors.response.use(void 0, Qt), console.debug("[axiosInterceptors] Response error interceptor registered"), ve = !0, console.debug("[axiosInterceptors] Interceptors initialized successfully");
251
+ console.debug("[axiosInterceptors] Initializing interceptors..."), H.interceptors.response.use(void 0, cn), console.debug("[axiosInterceptors] Response error interceptor registered"), ke = !0, console.debug("[axiosInterceptors] Interceptors initialized successfully");
251
252
  };
252
- Yt();
253
- function Zt(e) {
253
+ ln();
254
+ function dn(e) {
254
255
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
255
256
  }
256
- var le = { exports: {} }, Y = {};
257
+ var ue = { exports: {} }, te = {};
257
258
  /**
258
259
  * @license React
259
260
  * react-jsx-runtime.production.min.js
@@ -263,251 +264,129 @@ var le = { exports: {} }, Y = {};
263
264
  * This source code is licensed under the MIT license found in the
264
265
  * LICENSE file in the root directory of this source tree.
265
266
  */
266
- var Se;
267
- function Ft() {
268
- if (Se) return Y;
269
- Se = 1;
270
- var e = Ze, t = Symbol.for("react.element"), a = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, c = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
271
- function l(n, d, r) {
272
- var u, f = {}, _ = null, h = null;
273
- r !== void 0 && (_ = "" + r), d.key !== void 0 && (_ = "" + d.key), d.ref !== void 0 && (h = d.ref);
274
- for (u in d) s.call(d, u) && !i.hasOwnProperty(u) && (f[u] = d[u]);
275
- if (n && n.defaultProps) for (u in d = n.defaultProps, d) f[u] === void 0 && (f[u] = d[u]);
276
- return { $$typeof: t, type: n, key: _, ref: h, props: f, _owner: c.current };
267
+ var Ae;
268
+ function _n() {
269
+ if (Ae) return te;
270
+ Ae = 1;
271
+ var e = st, t = Symbol.for("react.element"), s = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
272
+ function c(n, d, a) {
273
+ var u, h = {}, _ = null, f = null;
274
+ a !== void 0 && (_ = "" + a), d.key !== void 0 && (_ = "" + d.key), d.ref !== void 0 && (f = d.ref);
275
+ for (u in d) r.call(d, u) && !l.hasOwnProperty(u) && (h[u] = d[u]);
276
+ if (n && n.defaultProps) for (u in d = n.defaultProps, d) h[u] === void 0 && (h[u] = d[u]);
277
+ return { $$typeof: t, type: n, key: _, ref: f, props: h, _owner: i.current };
277
278
  }
278
- return Y.Fragment = a, Y.jsx = l, Y.jsxs = l, Y;
279
+ return te.Fragment = s, te.jsx = c, te.jsxs = c, te;
279
280
  }
280
- var ke;
281
- function Pt() {
282
- return ke || (ke = 1, le.exports = Ft()), le.exports;
281
+ var $e;
282
+ function un() {
283
+ return $e || ($e = 1, ue.exports = _n()), ue.exports;
283
284
  }
284
- var o = Pt();
285
- const en = (e) => {
285
+ var o = un();
286
+ const hn = (e) => {
286
287
  if (!(e != null && e.content)) return null;
287
288
  const t = {
288
289
  ...e,
289
290
  children: e.content,
290
291
  type: e.variant
291
292
  };
292
- return /* @__PURE__ */ o.jsx(Be, { ...t });
293
- }, tn = (e) => {
293
+ return /* @__PURE__ */ o.jsx(ze, { ...t });
294
+ }, fn = (e) => {
294
295
  if (!e) return null;
295
296
  const t = {
296
297
  ...e,
297
298
  children: e.content
298
299
  };
299
- return /* @__PURE__ */ o.jsx(et, { ...t });
300
- }, nn = (e) => {
301
- const t = te.useThemeStore((l) => l.theme.mode), a = e.dataSource, s = T(() => ({
302
- url: e.dataSource.url,
303
- method: e.dataSource.method,
304
- headers: e.dataSource.headers,
305
- params: a == null ? void 0 : a.data
306
- }), [e.dataSource.url, e.dataSource.method, e.dataSource.headers, a == null ? void 0 : a.data]), c = e.locale ?? "en", i = T(() => {
307
- var n, d, r, u, f;
308
- const l = {
309
- title: (n = e == null ? void 0 : e.translations) == null ? void 0 : n.title,
310
- welcomeTitle: (d = e == null ? void 0 : e.translations) == null ? void 0 : d.welcomeTitle,
311
- welcomeDescription: (r = e == null ? void 0 : e.translations) == null ? void 0 : r.welcomeDescription,
312
- placeholder: (u = e == null ? void 0 : e.translations) == null ? void 0 : u.placeholder,
313
- disclaimer: (f = e == null ? void 0 : e.translations) == null ? void 0 : f.disclaimer
314
- };
315
- return Object.fromEntries(Object.entries(l).filter(([, _]) => !!_));
316
- }, [e == null ? void 0 : e.translations]);
317
- return z(() => {
318
- e.onResolveProps && e.onResolveProps({
319
- dataSource: s,
320
- locale: c,
321
- translations: i,
322
- initialSuggestions: e.initialSuggestions,
323
- theme: t
324
- });
325
- }, [
326
- e.onResolveProps,
327
- s,
328
- c,
329
- i,
330
- e.initialSuggestions,
331
- t
332
- ]), e.onResolveProps ? null : /* @__PURE__ */ o.jsx(
333
- wt,
334
- {
335
- dataSource: s,
336
- locale: c,
337
- translations: i,
338
- initialSuggestions: e.initialSuggestions,
339
- theme: t
340
- }
341
- );
342
- }, sn = "_summaryCard_jva4h_1", an = {
343
- summaryCard: sn
344
- }, rn = (e) => {
345
- const t = e.dataSource, a = T(() => ({
346
- url: e.dataSource.url,
347
- method: e.dataSource.method,
348
- headers: e.dataSource.headers,
349
- body: t == null ? void 0 : t.data
350
- }), [e.dataSource.url, e.dataSource.method, e.dataSource.headers, t == null ? void 0 : t.data]), s = e.locale ?? "en", c = T(() => {
351
- var l, n, d;
352
- const i = {
353
- title: (l = e == null ? void 0 : e.translations) == null ? void 0 : l.title,
354
- loading: (n = e == null ? void 0 : e.translations) == null ? void 0 : n.loading,
355
- noData: (d = e == null ? void 0 : e.translations) == null ? void 0 : d.noData
356
- };
357
- return Object.fromEntries(
358
- Object.entries(i).filter(([, r]) => !!r)
359
- );
360
- }, [e == null ? void 0 : e.translations]);
361
- return z(() => {
362
- e.onResolveProps && e.onResolveProps({
363
- dataSource: a,
364
- locale: s,
365
- translations: c
366
- });
367
- }, [e.onResolveProps, a, s, c]), e.onResolveProps ? null : /* @__PURE__ */ o.jsx("section", { className: an.summaryCard, children: /* @__PURE__ */ o.jsx(
368
- Ct,
369
- {
370
- dataSource: a,
371
- locale: s,
372
- translations: c
373
- }
374
- ) });
375
- }, B = (e, t) => {
376
- const a = v((s) => {
377
- var c;
378
- return ((c = s[e]) == null ? void 0 : c.entries) || {};
379
- });
380
- return T(() => {
381
- const s = {
382
- disabled: !1
383
- };
384
- return !t || t.length === 0 || t.forEach((c) => {
385
- const i = a[c.key], l = i == null || i === "" || Array.isArray(i) && i.length === 0;
386
- c.when === "empty" && l && c.actions.forEach((d) => {
387
- s[d] = !0;
388
- });
389
- }), s;
390
- }, [t, a]);
391
- }, on = "_promptCodeEditor_1d57s_1", cn = {
392
- promptCodeEditor: on
393
- }, ln = (e) => {
394
- const {
395
- userFlow: t,
396
- responseKey: a,
397
- codeBlockValue: s,
398
- language: c,
399
- disabled: i,
400
- dependencies: l,
401
- dataSource: n,
402
- inputLabel: d,
403
- inputPlaceholder: r,
404
- codeBlockLabel: u
405
- } = e, f = te.useThemeStore((b) => b.theme.mode), [_, h] = A(
406
- s || ""
407
- ), { disabled: p } = B(
408
- t,
409
- l
410
- ), m = i ?? p, y = c ?? "json", x = {
411
- url: (n == null ? void 0 : n.url) || "",
412
- method: (n == null ? void 0 : n.method) || "post",
413
- headers: n == null ? void 0 : n.headers,
414
- body: n == null ? void 0 : n.data
415
- }, g = (b) => {
416
- h(b);
417
- const C = {
418
- [a]: b
419
- };
420
- O(t, C);
421
- };
422
- return z(() => {
423
- s !== void 0 && s !== _ && h(s);
424
- }, [s]), /* @__PURE__ */ o.jsx("section", { className: cn.promptCodeEditor, children: /* @__PURE__ */ o.jsx(
425
- Nt,
426
- {
427
- themeMode: f,
428
- requestConfig: x,
429
- language: y,
430
- disabled: m,
431
- inputLabel: d,
432
- inputPlaceholder: r,
433
- codeBlockLabel: u,
434
- codeBlockValue: _,
435
- onCodeChange: g
436
- }
437
- ) });
438
- }, dn = "_body_14tsv_1", _n = "_body_content_14tsv_5", Te = {
439
- body: dn,
440
- body_content: _n
441
- }, un = ({ inputs: e }) => /* @__PURE__ */ o.jsx("section", { className: Te.body, children: /* @__PURE__ */ o.jsx("div", { className: Te.body_content, children: e.map((t, a) => /* @__PURE__ */ o.jsx(S, { children: t }, a)) }) }), E = (e, t, a, s) => {
442
- var l;
443
- const c = {
444
- accordion: (n) => /* @__PURE__ */ o.jsx(Js, { ...n, userFlow: e, pageId: t }),
445
- aiChatPanel: (n) => /* @__PURE__ */ o.jsx(nn, { ...n, userFlow: e, pageId: t, onResolveProps: s == null ? void 0 : s.aiChatPanel }),
446
- aiSummaryCard: (n) => /* @__PURE__ */ o.jsx(rn, { ...n, userFlow: e, pageId: t, onResolveProps: s == null ? void 0 : s.aiSummaryCard }),
447
- aiPromptCodeEditor: (n) => /* @__PURE__ */ o.jsx(ln, { ...n, userFlow: e, pageId: t }),
448
- breadcrumbs: (n) => /* @__PURE__ */ o.jsx(bn, { ...n, userFlow: e, pageId: t }),
449
- tooltip: (n) => /* @__PURE__ */ o.jsx(mn, { ...n, userFlow: e, pageId: t }),
450
- button: (n) => /* @__PURE__ */ o.jsx(jn, { ...n, userFlow: e, pageId: t }),
451
- cardAccordion: (n) => /* @__PURE__ */ o.jsx(Cn, { ...n, userFlow: e, pageId: t }),
452
- cardNotification: (n) => /* @__PURE__ */ o.jsx(Nn, { ...n }),
453
- chart: (n) => /* @__PURE__ */ o.jsx(Xn, { ...n, userFlow: e }),
454
- dataCard: (n) => /* @__PURE__ */ o.jsx(Ln, { ...n, userFlow: e, pageId: t }),
455
- checkbox: (n) => /* @__PURE__ */ o.jsx(vn, { ...n, userFlow: e, pageId: t }),
456
- code: (n) => /* @__PURE__ */ o.jsx(qn, { ...n, userFlow: e, pageId: t }),
457
- divider: (n) => /* @__PURE__ */ o.jsx(Kn, { ...n }),
458
- drawer: (n) => /* @__PURE__ */ o.jsx(Ws, { ...n, userFlow: e, pageId: t }),
459
- heading: (n) => en(n),
460
- link: (n) => /* @__PURE__ */ o.jsx(Zn, { ...n, userFlow: e, pageId: t }),
461
- pill: (n) => /* @__PURE__ */ o.jsx(ss, { ...n }),
462
- previewerMarkdown: (n) => /* @__PURE__ */ o.jsx(as, { ...n }),
463
- modal: (n) => /* @__PURE__ */ o.jsx(es, { ...n, userFlow: e, pageId: t }),
464
- roundButton: (n) => /* @__PURE__ */ o.jsx(rs, { ...n, userFlow: e, pageId: t }),
465
- row: (n) => /* @__PURE__ */ o.jsx(is, { ...n, userFlow: e, pageId: t }),
466
- select: (n) => /* @__PURE__ */ o.jsx(ys, { ...n, userFlow: e, pageId: t }),
467
- switch: (n) => /* @__PURE__ */ o.jsx(Ss, { ...n, userFlow: e, pageId: t }),
468
- spacing: (n) => /* @__PURE__ */ o.jsx(Es, { ...n, userFlow: e, pageId: t }),
469
- table: (n) => /* @__PURE__ */ o.jsx(Os, { ...n, userFlow: e, pageId: t }),
470
- tabs: (n) => /* @__PURE__ */ o.jsx(Is, { ...n, userFlow: e, pageId: t }),
471
- text: (n) => tn(n),
472
- textField: (n) => /* @__PURE__ */ o.jsx(Ms, { ...n, userFlow: e, pageId: t }),
473
- toast: (n) => /* @__PURE__ */ o.jsx(zs, { ...n, userFlow: e, pageId: t })
300
+ return /* @__PURE__ */ o.jsx(rt, { ...t });
301
+ }, O = (e, t, s, r) => {
302
+ var c;
303
+ const i = {
304
+ accordion: (n) => /* @__PURE__ */ o.jsx(Nn, { ...n, userFlow: e, pageId: t }),
305
+ aiChatPanel: (n) => /* @__PURE__ */ o.jsx(
306
+ wn,
307
+ {
308
+ ...n,
309
+ userFlow: e,
310
+ pageId: t,
311
+ onResolveProps: r == null ? void 0 : r.aiChatPanel
312
+ }
313
+ ),
314
+ aiSummaryCard: (n) => /* @__PURE__ */ o.jsx(
315
+ kn,
316
+ {
317
+ ...n,
318
+ userFlow: e,
319
+ pageId: t,
320
+ onResolveProps: r == null ? void 0 : r.aiSummaryCard
321
+ }
322
+ ),
323
+ aiPromptCodeEditor: (n) => /* @__PURE__ */ o.jsx(Sn, { ...n, userFlow: e, pageId: t }),
324
+ box: (n) => /* @__PURE__ */ o.jsx(Rn, { ...n, userFlow: e, pageId: t }),
325
+ breadcrumbs: (n) => /* @__PURE__ */ o.jsx(Xn, { ...n, userFlow: e, pageId: t }),
326
+ tooltip: (n) => /* @__PURE__ */ o.jsx(va, { ...n, userFlow: e, pageId: t }),
327
+ textarea: (n) => /* @__PURE__ */ o.jsx(ga, { ...n, userFlow: e, pageId: t }),
328
+ card: (n) => /* @__PURE__ */ o.jsx(Fn, { ...n, userFlow: e, pageId: t }),
329
+ dropdownButton: (n) => /* @__PURE__ */ o.jsx(Ss, { ...n, userFlow: e, pageId: t }),
330
+ menu: (n) => /* @__PURE__ */ o.jsx(As, { ...n, userFlow: e, pageId: t }),
331
+ radioGroup: (n) => /* @__PURE__ */ o.jsx(Vn, { ...n, userFlow: e, pageId: t }),
332
+ stepper: (n) => /* @__PURE__ */ o.jsx(Jn, { ...n, userFlow: e, pageId: t }),
333
+ button: (n) => /* @__PURE__ */ o.jsx(Hn, { ...n, userFlow: e, pageId: t }),
334
+ cardAccordion: (n) => /* @__PURE__ */ o.jsx(Qn, { ...n, userFlow: e, pageId: t }),
335
+ cardNotification: (n) => /* @__PURE__ */ o.jsx(Pn, { ...n }),
336
+ chart: (n) => /* @__PURE__ */ o.jsx(is, { ...n, userFlow: e }),
337
+ dataCard: (n) => /* @__PURE__ */ o.jsx(gs, { ...n, userFlow: e, pageId: t }),
338
+ checkbox: (n) => /* @__PURE__ */ o.jsx(ls, { ...n, userFlow: e, pageId: t }),
339
+ code: (n) => /* @__PURE__ */ o.jsx(ys, { ...n, userFlow: e, pageId: t }),
340
+ divider: (n) => /* @__PURE__ */ o.jsx(js, { ...n }),
341
+ drawer: (n) => /* @__PURE__ */ o.jsx(vs, { ...n, userFlow: e, pageId: t }),
342
+ heading: (n) => hn(n),
343
+ link: (n) => /* @__PURE__ */ o.jsx(Os, { ...n, userFlow: e, pageId: t }),
344
+ pill: (n) => /* @__PURE__ */ o.jsx(Is, { ...n }),
345
+ previewerMarkdown: (n) => /* @__PURE__ */ o.jsx(Bs, { ...n }),
346
+ modal: (n) => /* @__PURE__ */ o.jsx(Ds, { ...n, userFlow: e, pageId: t }),
347
+ roundButton: (n) => /* @__PURE__ */ o.jsx(Ks, { ...n, userFlow: e, pageId: t }),
348
+ row: (n) => /* @__PURE__ */ o.jsx(Ms, { ...n, userFlow: e, pageId: t }),
349
+ select: (n) => /* @__PURE__ */ o.jsx(Ys, { ...n, userFlow: e, pageId: t }),
350
+ switch: (n) => /* @__PURE__ */ o.jsx(ca, { ...n, userFlow: e, pageId: t }),
351
+ spacing: (n) => /* @__PURE__ */ o.jsx(oa, { ...n, userFlow: e, pageId: t }),
352
+ table: (n) => /* @__PURE__ */ o.jsx(ha, { ...n, userFlow: e, pageId: t }),
353
+ tabs: (n) => /* @__PURE__ */ o.jsx(xa, { ...n, userFlow: e, pageId: t }),
354
+ text: (n) => fn(n),
355
+ textField: (n) => /* @__PURE__ */ o.jsx(ja, { ...n, userFlow: e, pageId: t }),
356
+ toast: (n) => /* @__PURE__ */ o.jsx(Na, { ...n, userFlow: e, pageId: t })
474
357
  };
475
- return (l = a == null ? void 0 : a.filter(Boolean)) == null ? void 0 : l.map((n) => {
476
- const d = c[n.component];
358
+ return (c = s == null ? void 0 : s.filter(Boolean)) == null ? void 0 : c.map((n) => {
359
+ const d = i[n.component];
477
360
  return d ? d({ ...n, userFlow: e, pageId: t }) : null;
478
361
  });
479
- }, hn = "_tooltipNotFront_106iw_1", fn = "_tooltipNotFront_content_106iw_5", $e = {
480
- tooltipNotFront: hn,
481
- tooltipNotFront_content: fn
482
- }, mn = (e) => {
483
- const {
484
- userFlow: t,
485
- pageId: a,
486
- component: s,
487
- hash: c,
488
- responseKey: i,
489
- content: l,
490
- label: n,
491
- placement: d,
492
- notShowArrow: r,
493
- visible: u
494
- } = e, f = E(
495
- t,
496
- a,
497
- l != null && l.length ? l : null
498
- ), _ = f && f.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: $e.tooltipNotFront_content, children: f.map((h, p) => /* @__PURE__ */ o.jsx(S, { children: h }, `tooltip-${c}-${p}`)) }) : null;
499
- return /* @__PURE__ */ o.jsx(
500
- tt,
501
- {
502
- className: $e.tooltipNotFront,
503
- label: n,
504
- placement: d,
505
- notShowArrow: r,
506
- visible: u,
507
- children: _
362
+ };
363
+ function mn(e) {
364
+ return !!(e == null || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0);
365
+ }
366
+ function He(e, t) {
367
+ if (!(t != null && t.length))
368
+ return !1;
369
+ for (const s of t)
370
+ if (s.when === "empty") {
371
+ const r = e == null ? void 0 : e[s.key];
372
+ if (mn(r))
373
+ return !0;
508
374
  }
375
+ return !1;
376
+ }
377
+ function I(e, t) {
378
+ const s = v((r) => {
379
+ var i;
380
+ return (i = r[e]) == null ? void 0 : i.entries;
381
+ });
382
+ return A(
383
+ () => ({
384
+ disabled: He(s, t)
385
+ }),
386
+ [t, s]
509
387
  );
510
- }, W = (e) => {
388
+ }
389
+ const P = (e) => {
511
390
  if (!e)
512
391
  return { "content-type": "application/json" };
513
392
  if (typeof e == "function")
@@ -519,982 +398,1582 @@ const en = (e) => {
519
398
  return { "content-type": "application/json", Authorization: e };
520
399
  }
521
400
  return e;
522
- }, F = () => new AbortController(), yn = (e, t = {}, a = {}, s = !1, c) => {
523
- const i = F();
524
- s && i.abort();
525
- const l = W(t);
401
+ }, se = () => new AbortController(), yn = (e, t = {}, s = {}, r = !1, i) => {
402
+ const l = se();
403
+ r && l.abort();
404
+ const c = P(t);
526
405
  return {
527
- call: V.get(e, {
406
+ call: H.get(e, {
528
407
  headers: {
529
- ...l
408
+ ...c
530
409
  },
531
- params: a,
532
- signal: i.signal,
533
- _userFlow: c
410
+ params: s,
411
+ signal: l.signal,
412
+ _userFlow: i
534
413
  }),
535
- controller: i
414
+ controller: l
536
415
  };
537
- }, fe = (e, t = {}, a = {}, s = {}, c = !1, i) => {
538
- const l = F();
539
- c && l.abort();
540
- const n = W(t);
416
+ }, xe = (e, t = {}, s = {}, r = {}, i = !1, l) => {
417
+ const c = se();
418
+ i && c.abort();
419
+ const n = P(t);
541
420
  return {
542
- call: V.post(e, a, {
421
+ call: H.post(e, s, {
543
422
  headers: {
544
423
  ...n
545
424
  },
546
- params: s,
547
- signal: l.signal,
548
- _userFlow: i
425
+ params: r,
426
+ signal: c.signal,
427
+ _userFlow: l
549
428
  }),
550
- controller: l
429
+ controller: c
551
430
  };
552
- }, xn = (e, t = {}, a = {}, s = {}, c = !1, i) => {
553
- const l = F();
554
- c && l.abort();
555
- const n = W(t);
431
+ }, xn = (e, t = {}, s = {}, r = {}, i = !1, l) => {
432
+ const c = se();
433
+ i && c.abort();
434
+ const n = P(t);
556
435
  return {
557
- call: V.put(e, a, {
436
+ call: H.put(e, s, {
558
437
  headers: {
559
438
  ...n
560
439
  },
561
- params: s,
562
- signal: l.signal,
563
- _userFlow: i
440
+ params: r,
441
+ signal: c.signal,
442
+ _userFlow: l
564
443
  }),
565
- controller: l
444
+ controller: c
566
445
  };
567
- }, gn = (e, t = {}, a = {}, s = {}, c = !1, i) => {
568
- const l = F();
569
- c && l.abort();
570
- const n = W(t);
446
+ }, gn = (e, t = {}, s = {}, r = {}, i = !1, l) => {
447
+ const c = se();
448
+ i && c.abort();
449
+ const n = P(t);
571
450
  return {
572
- call: V.patch(e, a, {
451
+ call: H.patch(e, s, {
573
452
  headers: {
574
453
  ...n
575
454
  },
576
- params: s,
577
- signal: l.signal,
578
- _userFlow: i
455
+ params: r,
456
+ signal: c.signal,
457
+ _userFlow: l
579
458
  }),
580
- controller: l
459
+ controller: c
581
460
  };
582
- }, pn = (e, t = {}, a = {}, s = {}, c = !1, i) => {
583
- const l = F();
584
- c && l.abort();
585
- const n = W(t);
461
+ }, pn = (e, t = {}, s = {}, r = {}, i = !1, l) => {
462
+ const c = se();
463
+ i && c.abort();
464
+ const n = P(t);
586
465
  return {
587
- call: V.delete(e, {
466
+ call: H.delete(e, {
588
467
  headers: {
589
468
  ...n
590
469
  },
591
- data: a,
592
- params: s,
593
- signal: l.signal,
594
- _userFlow: i
470
+ data: s,
471
+ params: r,
472
+ signal: c.signal,
473
+ _userFlow: l
595
474
  }),
596
- controller: l
475
+ controller: c
597
476
  };
598
- }, Ge = () => {
477
+ }, We = () => {
599
478
  let e;
600
- return { callEndpoint: async (s) => {
601
- s.controller && (e = s.controller);
602
- let c = {};
479
+ return { callEndpoint: async (r) => {
480
+ r.controller && (e = r.controller);
481
+ let i = {};
603
482
  try {
604
- c = await s.call;
605
- } catch (i) {
606
- throw i;
483
+ i = await r.call;
484
+ } catch (l) {
485
+ throw l;
607
486
  }
608
- return c;
487
+ return i;
609
488
  }, cancelEndpoint: () => {
610
489
  e && e.abort();
611
490
  } };
612
- }, Ue = async (e, t, a = "", s = {}, c = {}) => {
491
+ }, Qe = async (e, t, s = "", r = {}, i = {}) => {
613
492
  try {
614
- const { callEndpoint: i } = Ge(), { api: l, headers: n } = e, d = sessionStorage.getItem("sessionId"), r = new URLSearchParams({ session_name: t });
615
- a && r.append("hash_code", a), d && r.append("sessionId", d);
616
- const u = `${l}/not-front/next-ui/?${r.toString()}`, f = W(n), _ = fe(
493
+ const { callEndpoint: l } = We(), { api: c, headers: n } = e, d = sessionStorage.getItem("sessionId"), a = new URLSearchParams({ session_name: t });
494
+ s && a.append("hash_code", s), d && a.append("sessionId", d);
495
+ const u = `${c}/not-front/next-ui/?${a.toString()}`, h = P(n), _ = xe(
617
496
  u,
618
- f,
619
- s,
620
- c,
497
+ h,
498
+ r,
499
+ i,
621
500
  !1,
622
501
  t
623
502
  );
624
- return await i(_);
625
- } catch (i) {
626
- return console.error(i), Promise.reject(i);
503
+ return await l(_);
504
+ } catch (l) {
505
+ return console.error(l), Promise.reject(l);
627
506
  }
628
507
  }, K = () => {
629
- const e = v((n) => n), { callEndpoint: t } = Ge(), a = async (n, d, r, u, f = !0) => {
508
+ const e = v((n) => n), { callEndpoint: t } = We(), s = async (n, d, a, u, h = !0) => {
630
509
  var _;
631
510
  try {
632
- const h = (_ = e[n]) == null ? void 0 : _.apiConfig, p = {
633
- state: { ...r },
511
+ const f = (_ = e[n]) == null ? void 0 : _.apiConfig, g = {
512
+ state: { ...a },
634
513
  triggerKey: u
635
514
  };
636
- return f && H(n, !0), await Ue(
637
- h,
515
+ return h && Q(n, !0), await Qe(
516
+ f,
638
517
  n,
639
518
  d,
640
- p
519
+ g
641
520
  );
642
- } catch (h) {
643
- throw f && H(n, !1), console.error("[getNextUI] Error fetching next UI:", h), h;
521
+ } catch (f) {
522
+ throw h && Q(n, !1), console.error("[getNextUI] Error fetching next UI:", f), f;
644
523
  }
645
- }, s = (n, d) => {
646
- const { method: r, url: u, headers: f, data: _, params: h } = n;
647
- switch (r) {
524
+ }, r = (n, d) => {
525
+ const { method: a, url: u, headers: h, data: _, params: f } = n;
526
+ switch (a) {
648
527
  case "post":
649
- return fe(u, f, _, {}, !1, d);
528
+ return xe(u, h, _, {}, !1, d);
650
529
  case "put":
651
- return xn(u, f, _, {}, !1, d);
530
+ return xn(u, h, _, {}, !1, d);
652
531
  case "patch":
653
- return gn(u, f, _, {}, !1, d);
532
+ return gn(u, h, _, {}, !1, d);
654
533
  case "delete":
655
- return pn(u, f, _, h, !1, d);
534
+ return pn(u, h, _, f, !1, d);
656
535
  case "get":
657
536
  default:
658
- return yn(u, f, h, !1, d);
537
+ return yn(u, h, f, !1, d);
659
538
  }
660
- }, c = (n, d) => {
661
- const { url: r, headers: u } = n, f = {
539
+ }, i = (n, d) => {
540
+ const { url: a, headers: u } = n, h = {
662
541
  query: n == null ? void 0 : n.query,
663
542
  variables: (n == null ? void 0 : n.variables) || {}
664
543
  };
665
- return fe(
666
- r,
544
+ return xe(
545
+ a,
667
546
  {
668
547
  ...u,
669
548
  "Content-Type": "application/json"
670
549
  },
671
- f,
550
+ h,
672
551
  {},
673
552
  !1,
674
553
  d
675
554
  );
676
- }, i = async (n, d, r = !0) => {
677
- var u, f;
555
+ }, l = async (n, d, a = !0) => {
556
+ var u, h;
678
557
  if (!n) {
679
558
  console.warn("[fetchDataSource] Invalid or missing dataSource");
680
559
  return;
681
560
  }
682
- r && H(d, !0);
561
+ a && Q(d, !0);
683
562
  try {
684
563
  let _;
685
564
  switch (n == null ? void 0 : n.type) {
686
565
  case "rest":
687
- _ = s(n, d);
566
+ _ = r(n, d);
688
567
  break;
689
568
  case "graphql":
690
- _ = c(n, d);
569
+ _ = i(n, d);
691
570
  break;
692
571
  default:
693
572
  throw new Error("[fetchDataSource] Unsupported data source type");
694
573
  }
695
574
  return await t(_);
696
575
  } catch (_) {
697
- const h = _;
698
- return console.error("[fetchDataSource] Error:", h), {
699
- status: ((u = h == null ? void 0 : h.response) == null ? void 0 : u.status) ?? 0,
700
- data: ((f = h == null ? void 0 : h.response) == null ? void 0 : f.data) ?? {
701
- message: h == null ? void 0 : h.message,
702
- code: h == null ? void 0 : h.code,
703
- config: h == null ? void 0 : h.config
576
+ const f = _;
577
+ return console.error("[fetchDataSource] Error:", f), {
578
+ status: ((u = f == null ? void 0 : f.response) == null ? void 0 : u.status) ?? 0,
579
+ data: ((h = f == null ? void 0 : f.response) == null ? void 0 : h.data) ?? {
580
+ message: f == null ? void 0 : f.message,
581
+ code: f == null ? void 0 : f.code,
582
+ config: f == null ? void 0 : f.config
704
583
  }
705
584
  };
706
585
  } finally {
707
- r && H(d, !1);
586
+ a && Q(d, !1);
708
587
  }
709
588
  };
710
589
  return {
711
- getNextUI: a,
712
- fetchDataSource: i,
713
- fetchAndGetNextUI: async (n, d, r, u, f) => {
590
+ getNextUI: s,
591
+ fetchDataSource: l,
592
+ fetchAndGetNextUI: async (n, d, a, u, h) => {
714
593
  try {
715
- H(n, !0);
716
- const _ = await i(f, n, !1);
717
- return _ && await a(
594
+ Q(n, !0);
595
+ const _ = await l(h, n, !1);
596
+ return _ && await s(
718
597
  n,
719
598
  d,
720
- r,
599
+ a,
721
600
  u
722
601
  );
723
602
  } catch (_) {
724
- throw H(n, !1), console.error(
603
+ throw Q(n, !1), console.error(
725
604
  "[fetchAndGetNextUI] Error fetching and navigating:",
726
605
  _
727
606
  ), _;
728
607
  }
729
608
  }
730
609
  };
731
- }, bn = ({
732
- userFlow: e,
733
- items: t,
734
- responseKey: a
735
- }) => {
736
- const { getNextUI: s } = K(), c = R(
737
- async ({ actionType: l, hashCode: n, redirectUrl: d }) => {
738
- var r;
610
+ }, bn = "_accordion_1ri2t_1", jn = "_accordionBody_1ri2t_8", qe = {
611
+ accordion: bn,
612
+ accordionBody: jn
613
+ }, Nn = (e) => {
614
+ const {
615
+ userFlow: t,
616
+ pageId: s,
617
+ responseKey: r,
618
+ dependencies: i,
619
+ customContent: l,
620
+ actionContent: c,
621
+ components: n,
622
+ ...d
623
+ } = e, { getNextUI: a } = K(), [u, h] = L(
624
+ d.checkboxChecked || !1
625
+ ), { disabled: _ } = I(
626
+ t,
627
+ i
628
+ ), f = O(t, s, n), g = c ? O(t, s, c) : void 0, y = l ? O(t, s, l) : void 0, x = R(
629
+ async (b) => {
630
+ var N;
739
631
  try {
740
- switch (l) {
741
- case "GO_TO_NEXT_UI":
742
- const u = await s(
743
- e,
744
- n,
745
- { ...(r = v.getState()[e]) == null ? void 0 : r.entries },
746
- a
747
- );
748
- u != null && u.data && q(e, u == null ? void 0 : u.data);
749
- break;
750
- case "REDIRECT":
751
- d ? window.location.href = d : console.warn("Missing redirectUrl for REDIRECT actionType");
752
- break;
753
- default:
754
- console.warn(`Unhandled actionType: ${l}`);
755
- break;
632
+ const j = b.target.checked;
633
+ h(j);
634
+ const C = {
635
+ ...(N = v.getState()[t]) == null ? void 0 : N.entries,
636
+ [r]: j
637
+ };
638
+ if (q(t, C), d.actionType === "GO_TO_NEXT_UI") {
639
+ const w = await a(
640
+ t,
641
+ s,
642
+ C,
643
+ r
644
+ );
645
+ w != null && w.data && $(t, w == null ? void 0 : w.data);
756
646
  }
757
- } catch (u) {
758
- alert(JSON.stringify(u));
647
+ } catch (j) {
648
+ console.error("Error in accordion checkbox action:", j), alert(JSON.stringify(j));
759
649
  }
760
650
  },
761
- []
762
- ), i = T(() => t == null ? void 0 : t.map((l) => ({
763
- title: l == null ? void 0 : l.title,
764
- component: /* @__PURE__ */ o.jsx("div", { onClick: () => c(l) })
765
- })), []);
766
- return /* @__PURE__ */ o.jsx(nt, { items: i });
767
- }, jn = (e) => {
651
+ [t, s, r, d.actionType, a]
652
+ ), m = d.disabled || _, p = {
653
+ ...d,
654
+ className: qe.accordion,
655
+ disabled: m,
656
+ checkboxChecked: u,
657
+ onChanceCheckbox: d.hasCheckbox ? x : void 0,
658
+ actionContent: g ? /* @__PURE__ */ o.jsx(o.Fragment, { children: g.map((b, N) => /* @__PURE__ */ o.jsx(k, { children: b }, `accordion-action-${N}`)) }) : void 0,
659
+ customContent: y ? /* @__PURE__ */ o.jsx(o.Fragment, { children: y.map((b, N) => /* @__PURE__ */ o.jsx(k, { children: b }, `accordion-custom-${N}`)) }) : void 0,
660
+ children: f ? /* @__PURE__ */ o.jsx("section", { className: qe.accordionBody, children: f.map((b, N) => /* @__PURE__ */ o.jsx(k, { children: b }, `accordion-child-${N}`)) }) : void 0
661
+ };
662
+ return /* @__PURE__ */ o.jsx(ot, { ...p });
663
+ }, wn = (e) => {
664
+ const t = ne.useThemeStore((c) => c.theme.mode), s = e.dataSource, r = A(() => ({
665
+ url: e.dataSource.url,
666
+ method: e.dataSource.method,
667
+ headers: e.dataSource.headers,
668
+ params: s == null ? void 0 : s.data
669
+ }), [e.dataSource.url, e.dataSource.method, e.dataSource.headers, s == null ? void 0 : s.data]), i = e.locale ?? "en", l = A(() => {
670
+ var n, d, a, u, h;
671
+ const c = {
672
+ title: (n = e == null ? void 0 : e.translations) == null ? void 0 : n.title,
673
+ welcomeTitle: (d = e == null ? void 0 : e.translations) == null ? void 0 : d.welcomeTitle,
674
+ welcomeDescription: (a = e == null ? void 0 : e.translations) == null ? void 0 : a.welcomeDescription,
675
+ placeholder: (u = e == null ? void 0 : e.translations) == null ? void 0 : u.placeholder,
676
+ disclaimer: (h = e == null ? void 0 : e.translations) == null ? void 0 : h.disclaimer
677
+ };
678
+ return Object.fromEntries(Object.entries(c).filter(([, _]) => !!_));
679
+ }, [e == null ? void 0 : e.translations]);
680
+ return z(() => {
681
+ e.onResolveProps && e.onResolveProps({
682
+ dataSource: r,
683
+ locale: i,
684
+ translations: l,
685
+ initialSuggestions: e.initialSuggestions,
686
+ theme: t
687
+ });
688
+ }, [
689
+ e.onResolveProps,
690
+ r,
691
+ i,
692
+ l,
693
+ e.initialSuggestions,
694
+ t
695
+ ]), e.onResolveProps ? null : /* @__PURE__ */ o.jsx(
696
+ Dt,
697
+ {
698
+ dataSource: r,
699
+ locale: i,
700
+ translations: l,
701
+ initialSuggestions: e.initialSuggestions,
702
+ theme: t
703
+ }
704
+ );
705
+ }, Cn = "_promptCodeEditor_1d57s_1", vn = {
706
+ promptCodeEditor: Cn
707
+ }, Sn = (e) => {
768
708
  const {
769
709
  userFlow: t,
770
- pageId: a,
771
710
  responseKey: s,
772
- actionType: c,
773
- label: i,
774
- content: l,
711
+ codeBlockValue: r,
712
+ language: i,
713
+ disabled: l,
714
+ dependencies: c,
775
715
  dataSource: n,
776
- redirectUrl: d,
777
- dependencies: r,
778
- onClick: u,
779
- ...f
780
- } = e, { getNextUI: _, fetchDataSource: h, fetchAndGetNextUI: p } = K(), { disabled: m } = B(
716
+ inputLabel: d,
717
+ inputPlaceholder: a,
718
+ codeBlockLabel: u
719
+ } = e, h = ne.useThemeStore((b) => b.theme.mode), [_, f] = L(
720
+ r || ""
721
+ ), { disabled: g } = I(
781
722
  t,
782
- r
783
- ), y = {
784
- ...f,
785
- children: l ?? i
786
- }, x = (y == null ? void 0 : y.disabled) ?? m, g = R(async () => {
787
- var b, C, j;
788
- try {
789
- const N = {
790
- ...(b = v.getState()[t]) == null ? void 0 : b.entries,
791
- [s]: { status: 200 }
792
- };
793
- switch (O(t, N), c) {
794
- case "CLOSE_MODAL":
795
- ge(t, !1);
796
- break;
797
- case "CLOSE_DRAWER":
798
- Z(t, !1);
799
- break;
800
- case "OPEN_DRAWER":
801
- Z(t, !0);
802
- break;
803
- case "GO_TO_NEXT_UI": {
804
- const w = await _(
805
- t,
806
- a,
807
- N,
808
- s
809
- );
810
- w != null && w.data && q(t, w == null ? void 0 : w.data);
811
- break;
812
- }
813
- case "FETCH_AND_GO_TO_NEXT_UI": {
814
- const w = await p(
815
- t,
816
- a,
817
- N,
818
- s,
819
- n
820
- );
821
- w != null && w.data && q(t, w == null ? void 0 : w.data);
822
- break;
823
- }
824
- case "GET_DATA_SOURCE": {
825
- const w = await _(
826
- t,
827
- a,
828
- N,
829
- s
830
- ), k = (C = w == null ? void 0 : w.data) == null ? void 0 : C.content;
831
- if ((k == null ? void 0 : k.type) !== "fetch") break;
832
- const D = k == null ? void 0 : k.dataSource, $ = await h(
833
- D,
834
- t,
835
- // Avoid to handle loading state until all the requests are done
836
- !1
837
- ), G = {
838
- ...(j = v.getState()[t]) == null ? void 0 : j.entries,
839
- [s]: {
840
- status: $ == null ? void 0 : $.status,
841
- content: $ == null ? void 0 : $.data
842
- }
843
- };
844
- O(t, G);
845
- const U = await _(
846
- t,
847
- a,
848
- G,
849
- s
850
- );
851
- U != null && U.data && q(t, U == null ? void 0 : U.data);
852
- break;
853
- }
854
- case "REDIRECT":
855
- d ? window.location.href = d : console.warn("Missing redirectUrl for REDIRECT actionType");
856
- break;
857
- default:
858
- console.warn(`Unhandled actionType: ${c}`);
859
- break;
860
- }
861
- } catch (N) {
862
- alert(JSON.stringify(N));
863
- }
864
- }, [c, n, a, s, t]);
865
- return /* @__PURE__ */ o.jsx(
866
- st,
867
- {
868
- ...y,
869
- disabled: x,
870
- onClick: () => !x && (u ?? g)()
871
- }
872
- );
873
- }, wn = "_slotStack_12u4t_5", Ae = {
874
- slotStack: wn
875
- }, Cn = (e) => {
876
- const {
877
- userFlow: t,
878
- pageId: a,
879
- component: s,
880
- hash: c,
881
- responseKey: i,
882
- dependencies: l,
883
- content: n,
884
- actionContent: d,
885
- ...r
886
- } = e, { disabled: u } = B(
887
- t,
888
- l
889
- ), f = E(
890
- t,
891
- a,
892
- n && n.length > 0 ? n : null
893
- ), _ = E(
894
- t,
895
- a,
896
- d && d.length > 0 ? d : null
897
- ), h = f && f.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Ae.slotStack, children: f.map((y, x) => /* @__PURE__ */ o.jsx(S, { children: y }, `card-accordion-body-${c}-${x}`)) }) : void 0, p = _ && _.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Ae.slotStack, children: _.map((y, x) => /* @__PURE__ */ o.jsx(S, { children: y }, `card-accordion-actions-${c}-${x}`)) }) : void 0, m = r.disabled || u;
898
- return /* @__PURE__ */ o.jsx(
899
- at,
900
- {
901
- ...r,
902
- disabled: m,
903
- actionContent: p,
904
- children: h ?? null
905
- }
906
- );
907
- }, Nn = (e) => {
908
- const { content: t, description: a, ...s } = e, c = {
909
- ...s,
910
- children: t ?? a
723
+ c
724
+ ), y = l ?? g, x = i ?? "json", m = {
725
+ url: (n == null ? void 0 : n.url) || "",
726
+ method: (n == null ? void 0 : n.method) || "post",
727
+ headers: n == null ? void 0 : n.headers,
728
+ body: n == null ? void 0 : n.data
729
+ }, p = (b) => {
730
+ f(b);
731
+ const N = {
732
+ [s]: b
733
+ };
734
+ q(t, N);
911
735
  };
912
- return /* @__PURE__ */ o.jsx(me, { ...c });
913
- }, vn = (e) => {
914
- const {
915
- userFlow: t,
916
- pageId: a,
917
- responseKey: s,
918
- actionType: c,
919
- label: i,
920
- value: l,
921
- required: n,
922
- dependencies: d,
923
- ...r
924
- } = e, u = {
925
- ...r
926
- }, { getNextUI: f } = K(), [_, h] = A(l || !1), { disabled: p } = B(
927
- t,
928
- d
929
- ), m = T(() => n && i ? `${i} *` : i ?? "", [i, n]), y = R(async () => {
930
- var g;
931
- try {
932
- const b = !_;
933
- h(b);
934
- const C = {
935
- ...(g = v.getState()[t]) == null ? void 0 : g.entries,
936
- [s]: b
937
- };
938
- switch (O(t, C), c) {
939
- case "GO_TO_NEXT_UI":
940
- const j = await f(
941
- t,
942
- a,
943
- C,
944
- s
945
- );
946
- j != null && j.data && q(t, j == null ? void 0 : j.data);
947
- break;
948
- default:
949
- console.warn(`Unhandled actionType: ${c}`);
950
- break;
951
- }
952
- } catch (b) {
953
- console.error("Error in checkbox action:", b), alert(JSON.stringify(b));
736
+ return z(() => {
737
+ r !== void 0 && r !== _ && f(r);
738
+ }, [r]), /* @__PURE__ */ o.jsx("section", { className: vn.promptCodeEditor, children: /* @__PURE__ */ o.jsx(
739
+ Rt,
740
+ {
741
+ themeMode: h,
742
+ requestConfig: m,
743
+ language: x,
744
+ disabled: y,
745
+ inputLabel: d,
746
+ inputPlaceholder: a,
747
+ codeBlockLabel: u,
748
+ codeBlockValue: _,
749
+ onCodeChange: p
954
750
  }
955
- }, [t, a, s, c, _]), x = (u == null ? void 0 : u.disabled) ?? p;
956
- return /* @__PURE__ */ o.jsx(
957
- rt,
751
+ ) });
752
+ }, En = "_summaryCard_jva4h_1", Tn = {
753
+ summaryCard: En
754
+ }, kn = (e) => {
755
+ const t = e.dataSource, s = A(() => ({
756
+ url: e.dataSource.url,
757
+ method: e.dataSource.method,
758
+ headers: e.dataSource.headers,
759
+ body: t == null ? void 0 : t.data
760
+ }), [e.dataSource.url, e.dataSource.method, e.dataSource.headers, t == null ? void 0 : t.data]), r = e.locale ?? "en", i = A(() => {
761
+ var c, n, d;
762
+ const l = {
763
+ title: (c = e == null ? void 0 : e.translations) == null ? void 0 : c.title,
764
+ loading: (n = e == null ? void 0 : e.translations) == null ? void 0 : n.loading,
765
+ noData: (d = e == null ? void 0 : e.translations) == null ? void 0 : d.noData
766
+ };
767
+ return Object.fromEntries(
768
+ Object.entries(l).filter(([, a]) => !!a)
769
+ );
770
+ }, [e == null ? void 0 : e.translations]);
771
+ return z(() => {
772
+ e.onResolveProps && e.onResolveProps({
773
+ dataSource: s,
774
+ locale: r,
775
+ translations: i
776
+ });
777
+ }, [e.onResolveProps, s, r, i]), e.onResolveProps ? null : /* @__PURE__ */ o.jsx("section", { className: Tn.summaryCard, children: /* @__PURE__ */ o.jsx(
778
+ Lt,
958
779
  {
959
- ...u,
960
- labelRight: m,
961
- checked: _,
962
- disabled: x,
963
- onChange: () => {
964
- !x && y();
965
- }
780
+ dataSource: s,
781
+ locale: r,
782
+ translations: i
966
783
  }
967
- );
968
- }, En = "_codeEditor_1wi2p_1", Sn = "_codeEditor_label_1wi2p_4", kn = "_codeEditor_wrapper_1wi2p_13", Tn = "_input_1wi2p_17", $n = "_preview_1wi2p_18", An = "_preview_inner_1wi2p_33", X = {
969
- codeEditor: En,
970
- codeEditor_label: Sn,
971
- codeEditor_wrapper: kn,
972
- input: Tn,
973
- preview: $n,
974
- preview_inner: An
975
- }, qn = (e) => {
784
+ ) });
785
+ }, On = "_body_14tsv_1", An = "_body_content_14tsv_5", De = {
786
+ body: On,
787
+ body_content: An
788
+ }, $n = ({ inputs: e }) => /* @__PURE__ */ o.jsx("section", { className: De.body, children: /* @__PURE__ */ o.jsx("div", { className: De.body_content, children: e.map((t, s) => /* @__PURE__ */ o.jsx(k, { children: t }, s)) }) }), qn = "_slotStack_1b4wy_1", Dn = {
789
+ slotStack: qn
790
+ }, Rn = (e) => {
976
791
  const {
977
792
  userFlow: t,
978
- responseKey: a,
979
- label: s,
980
- language: c,
981
- placeholder: i,
982
- value: l,
983
- required: n,
984
- dependencies: d,
985
- disabled: r,
986
- showPreview: u,
987
- height: f = "400px"
988
- } = e, [_, h] = A(l ?? ""), p = te.useThemeStore((C) => C.theme.mode), { disabled: m } = B(
793
+ pageId: s,
794
+ component: r,
795
+ hash: i,
796
+ responseKey: l,
797
+ content: c
798
+ } = e, n = ne.useThemeStore((u) => u.theme.mode) === "dark", d = O(
989
799
  t,
990
- d
991
- ), y = r ?? m, x = {
992
- json: we(),
993
- markdown: Et(),
994
- sql: St(),
995
- yaml: kt()
996
- }, g = T(() => n && s ? `${s} *` : s ?? "", [s, n]), b = (C) => {
997
- h(C);
998
- const j = {
999
- [a]: C
1000
- };
1001
- O(t, j);
1002
- };
1003
- return /* @__PURE__ */ o.jsxs("div", { className: X.codeEditor, children: [
1004
- g && g !== "" && /* @__PURE__ */ o.jsx("label", { className: X.codeEditor_label, children: g }),
1005
- /* @__PURE__ */ o.jsxs("div", { className: X.codeEditor_wrapper, children: [
1006
- /* @__PURE__ */ o.jsx(
1007
- vt,
1008
- {
1009
- className: X.input,
1010
- value: _,
1011
- height: f,
1012
- placeholder: i,
1013
- extensions: [x[c] ?? we()],
1014
- onChange: (C) => b(C),
1015
- theme: p,
1016
- editable: !y
1017
- }
1018
- ),
1019
- c === "markdown" && u && /* @__PURE__ */ o.jsx("div", { className: X.preview, style: { height: f }, children: /* @__PURE__ */ o.jsx(Ke, { className: X.preview_inner, children: _ }) })
1020
- ] })
1021
- ] });
800
+ s,
801
+ c != null && c.length ? c : null
802
+ ), a = d && d.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Dn.slotStack, children: d.map((u, h) => /* @__PURE__ */ o.jsx(k, { children: u }, `box-${i}-${h}`)) }) : null;
803
+ return /* @__PURE__ */ o.jsx(ct, { darkMode: n, children: a });
1022
804
  };
1023
- var de = { exports: {} };
805
+ var he = { exports: {} };
1024
806
  /*!
1025
807
  Copyright (c) 2018 Jed Watson.
1026
808
  Licensed under the MIT License (MIT), see
1027
809
  http://jedwatson.github.io/classnames
1028
810
  */
1029
- var qe;
1030
- function On() {
1031
- return qe || (qe = 1, (function(e) {
811
+ var Re;
812
+ function Ln() {
813
+ return Re || (Re = 1, (function(e) {
1032
814
  (function() {
1033
815
  var t = {}.hasOwnProperty;
1034
- function a() {
1035
- for (var s = [], c = 0; c < arguments.length; c++) {
1036
- var i = arguments[c];
1037
- if (i) {
1038
- var l = typeof i;
1039
- if (l === "string" || l === "number")
1040
- s.push(i);
1041
- else if (Array.isArray(i)) {
1042
- if (i.length) {
1043
- var n = a.apply(null, i);
1044
- n && s.push(n);
816
+ function s() {
817
+ for (var r = [], i = 0; i < arguments.length; i++) {
818
+ var l = arguments[i];
819
+ if (l) {
820
+ var c = typeof l;
821
+ if (c === "string" || c === "number")
822
+ r.push(l);
823
+ else if (Array.isArray(l)) {
824
+ if (l.length) {
825
+ var n = s.apply(null, l);
826
+ n && r.push(n);
1045
827
  }
1046
- } else if (l === "object") {
1047
- if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]")) {
1048
- s.push(i.toString());
828
+ } else if (c === "object") {
829
+ if (l.toString !== Object.prototype.toString && !l.toString.toString().includes("[native code]")) {
830
+ r.push(l.toString());
1049
831
  continue;
1050
832
  }
1051
- for (var d in i)
1052
- t.call(i, d) && i[d] && s.push(d);
833
+ for (var d in l)
834
+ t.call(l, d) && l[d] && r.push(d);
1053
835
  }
1054
836
  }
1055
837
  }
1056
- return s.join(" ");
838
+ return r.join(" ");
1057
839
  }
1058
- e.exports ? (a.default = a, e.exports = a) : window.classNames = a;
840
+ e.exports ? (s.default = s, e.exports = s) : window.classNames = s;
1059
841
  })();
1060
- })(de)), de.exports;
842
+ })(he)), he.exports;
1061
843
  }
1062
- var Rn = On();
1063
- const ee = /* @__PURE__ */ Zt(Rn), Dn = "_slotStack_6n2wy_5", Oe = {
1064
- slotStack: Dn
1065
- }, Ln = (e) => {
844
+ var In = Ln();
845
+ const F = /* @__PURE__ */ dn(In), Bn = "_fieldset_1xrth_1", Kn = "_fieldsetColumn_1xrth_8", Gn = "_legend_1xrth_14", Un = "_options_1xrth_20", Mn = "_optionsRow_1xrth_25", zn = "_optionsColumn_1xrth_36", Y = {
846
+ fieldset: Bn,
847
+ fieldsetColumn: Kn,
848
+ legend: Gn,
849
+ options: Un,
850
+ optionsRow: Mn,
851
+ optionsColumn: zn
852
+ }, Vn = (e) => {
1066
853
  const {
1067
854
  userFlow: t,
1068
- pageId: a,
1069
- component: s,
1070
- hash: c,
1071
- responseKey: i,
1072
- content: l,
1073
- topContent: n,
1074
- icon: d,
1075
- headerStatusColor: r,
1076
- ...u
1077
- } = e, f = r ? `palette_${r}_50` : void 0, _ = E(
855
+ pageId: s,
856
+ responseKey: r,
857
+ label: i,
858
+ value: l,
859
+ required: c,
860
+ actionType: n,
861
+ dependencies: d,
862
+ direction: a,
863
+ items: u
864
+ } = e, h = a === "column" ? "column" : "row", { getNextUI: _ } = K(), { disabled: f } = I(
1078
865
  t,
1079
- a,
1080
- l && l.length > 0 ? l : null
1081
- ), h = E(
866
+ d
867
+ ), g = v(
868
+ (b) => {
869
+ var N, j;
870
+ return (j = (N = b[t]) == null ? void 0 : N.entries) == null ? void 0 : j[r];
871
+ }
872
+ ), y = g != null ? String(g) : l ?? "", x = f, m = A(() => i ? c ? `${i} *` : i : null, [i, c]), p = R(
873
+ async (b) => {
874
+ var N;
875
+ if (!x)
876
+ try {
877
+ const j = {
878
+ ...(N = v.getState()[t]) == null ? void 0 : N.entries,
879
+ [r]: b
880
+ };
881
+ if (q(t, j), n === "GO_TO_NEXT_UI" || n === "GO_TO_NEXT_UI_WITHOUT_LOADING") {
882
+ const E = await _(
883
+ t,
884
+ s,
885
+ j,
886
+ r,
887
+ n === "GO_TO_NEXT_UI"
888
+ );
889
+ E != null && E.data && $(t, E == null ? void 0 : E.data);
890
+ }
891
+ } catch (j) {
892
+ alert(JSON.stringify(j));
893
+ }
894
+ },
895
+ [
896
+ n,
897
+ _,
898
+ x,
899
+ s,
900
+ r,
901
+ t
902
+ ]
903
+ );
904
+ return /* @__PURE__ */ o.jsxs(
905
+ "fieldset",
906
+ {
907
+ className: F(
908
+ Y.fieldset,
909
+ h === "column" && Y.fieldsetColumn
910
+ ),
911
+ children: [
912
+ m ? /* @__PURE__ */ o.jsx("legend", { className: Y.legend, children: m }) : null,
913
+ /* @__PURE__ */ o.jsx(
914
+ "div",
915
+ {
916
+ className: F(
917
+ Y.options,
918
+ h === "column" ? Y.optionsColumn : Y.optionsRow
919
+ ),
920
+ children: u.map((b) => /* @__PURE__ */ o.jsx(
921
+ it,
922
+ {
923
+ name: r,
924
+ value: b.value,
925
+ checked: y === b.value,
926
+ disabled: x || b.disabled,
927
+ labelRight: b.label,
928
+ onChange: () => {
929
+ p(b.value);
930
+ }
931
+ },
932
+ b.value
933
+ ))
934
+ }
935
+ )
936
+ ]
937
+ }
938
+ );
939
+ }, Jn = ({
940
+ userFlow: e,
941
+ pageId: t,
942
+ component: s,
943
+ hash: r,
944
+ responseKey: i,
945
+ items: l,
946
+ itemActive: c,
947
+ darkMode: n
948
+ }) => /* @__PURE__ */ o.jsx(lt, { items: l, itemActive: c, darkMode: n }), Xn = ({
949
+ userFlow: e,
950
+ items: t,
951
+ responseKey: s
952
+ }) => {
953
+ const { getNextUI: r } = K(), i = R(
954
+ async ({ actionType: c, hashCode: n, redirectUrl: d }) => {
955
+ var a;
956
+ try {
957
+ switch (c) {
958
+ case "GO_TO_NEXT_UI":
959
+ const u = await r(
960
+ e,
961
+ n,
962
+ { ...(a = v.getState()[e]) == null ? void 0 : a.entries },
963
+ s
964
+ );
965
+ u != null && u.data && $(e, u == null ? void 0 : u.data);
966
+ break;
967
+ case "REDIRECT":
968
+ d ? window.location.href = d : console.warn("Missing redirectUrl for REDIRECT actionType");
969
+ break;
970
+ default:
971
+ console.warn(`Unhandled actionType: ${c}`);
972
+ break;
973
+ }
974
+ } catch (u) {
975
+ alert(JSON.stringify(u));
976
+ }
977
+ },
978
+ []
979
+ ), l = A(() => t == null ? void 0 : t.map((c) => ({
980
+ title: c == null ? void 0 : c.title,
981
+ component: /* @__PURE__ */ o.jsx("div", { onClick: () => i(c) })
982
+ })), []);
983
+ return /* @__PURE__ */ o.jsx(dt, { items: l });
984
+ };
985
+ function je(e, t) {
986
+ const { getNextUI: s, fetchDataSource: r, fetchAndGetNextUI: i } = K();
987
+ return R(
988
+ async (l) => {
989
+ var _, f, g, y;
990
+ const { responseKey: c, actionType: n, dataSource: d, redirectUrl: a, dependencies: u } = l, h = (_ = v.getState()[e]) == null ? void 0 : _.entries;
991
+ if (!He(h, u))
992
+ try {
993
+ const x = {
994
+ ...(f = v.getState()[e]) == null ? void 0 : f.entries,
995
+ [c]: { status: 200 }
996
+ };
997
+ switch (q(e, x), n) {
998
+ case "CLOSE_MODAL":
999
+ ce(e, !1);
1000
+ break;
1001
+ case "CLOSE_DRAWER":
1002
+ W(e, !1);
1003
+ break;
1004
+ case "OPEN_DRAWER":
1005
+ W(e, !0);
1006
+ break;
1007
+ case "GO_TO_NEXT_UI": {
1008
+ const m = await s(
1009
+ e,
1010
+ t,
1011
+ x,
1012
+ c
1013
+ );
1014
+ m != null && m.data && $(e, m == null ? void 0 : m.data);
1015
+ break;
1016
+ }
1017
+ case "FETCH_AND_GO_TO_NEXT_UI": {
1018
+ const m = await i(
1019
+ e,
1020
+ t,
1021
+ x,
1022
+ c,
1023
+ d
1024
+ );
1025
+ m != null && m.data && $(e, m == null ? void 0 : m.data);
1026
+ break;
1027
+ }
1028
+ case "GET_DATA_SOURCE": {
1029
+ const m = await s(
1030
+ e,
1031
+ t,
1032
+ x,
1033
+ c
1034
+ ), p = (g = m == null ? void 0 : m.data) == null ? void 0 : g.content;
1035
+ if ((p == null ? void 0 : p.type) !== "fetch")
1036
+ break;
1037
+ const b = p == null ? void 0 : p.dataSource, N = await r(b, e, !1), j = {
1038
+ ...(y = v.getState()[e]) == null ? void 0 : y.entries,
1039
+ [c]: {
1040
+ status: N == null ? void 0 : N.status,
1041
+ content: N == null ? void 0 : N.data
1042
+ }
1043
+ };
1044
+ q(e, j);
1045
+ const C = await s(
1046
+ e,
1047
+ t,
1048
+ j,
1049
+ c
1050
+ );
1051
+ C != null && C.data && $(e, C == null ? void 0 : C.data);
1052
+ break;
1053
+ }
1054
+ case "REDIRECT":
1055
+ a ? window.location.href = a : console.warn("Missing redirectUrl for REDIRECT actionType");
1056
+ break;
1057
+ default:
1058
+ console.warn(`Unhandled actionType: ${n}`);
1059
+ }
1060
+ } catch (x) {
1061
+ alert(JSON.stringify(x));
1062
+ }
1063
+ },
1064
+ [
1065
+ i,
1066
+ r,
1067
+ s,
1068
+ t,
1069
+ e
1070
+ ]
1071
+ );
1072
+ }
1073
+ const Hn = (e) => {
1074
+ const {
1075
+ userFlow: t,
1076
+ pageId: s,
1077
+ responseKey: r,
1078
+ actionType: i,
1079
+ label: l,
1080
+ content: c,
1081
+ dataSource: n,
1082
+ redirectUrl: d,
1083
+ dependencies: a,
1084
+ onClick: u,
1085
+ ...h
1086
+ } = e, _ = je(t, s), { disabled: f } = I(
1082
1087
  t,
1088
+ a
1089
+ ), g = {
1090
+ ...h,
1091
+ children: c ?? l
1092
+ }, y = (g == null ? void 0 : g.disabled) ?? f, x = R(async () => {
1093
+ await _({
1094
+ responseKey: r,
1095
+ actionType: i,
1096
+ dataSource: n,
1097
+ redirectUrl: d,
1098
+ dependencies: a
1099
+ });
1100
+ }, [
1101
+ i,
1102
+ n,
1083
1103
  a,
1104
+ d,
1105
+ r,
1106
+ _
1107
+ ]);
1108
+ return /* @__PURE__ */ o.jsx(
1109
+ _t,
1110
+ {
1111
+ ...g,
1112
+ disabled: y,
1113
+ onClick: () => !y && (u ?? x)()
1114
+ }
1115
+ );
1116
+ }, Wn = "_slotStack_12u4t_5", Le = {
1117
+ slotStack: Wn
1118
+ }, Qn = (e) => {
1119
+ const {
1120
+ userFlow: t,
1121
+ pageId: s,
1122
+ component: r,
1123
+ hash: i,
1124
+ responseKey: l,
1125
+ dependencies: c,
1126
+ content: n,
1127
+ actionContent: d,
1128
+ ...a
1129
+ } = e, { disabled: u } = I(
1130
+ t,
1131
+ c
1132
+ ), h = O(
1133
+ t,
1134
+ s,
1084
1135
  n && n.length > 0 ? n : null
1085
- ), p = _ && _.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Oe.slotStack, children: _.map((y, x) => /* @__PURE__ */ o.jsx(S, { children: y }, `data-card-body-${c}-${x}`)) }) : void 0, m = h && h.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Oe.slotStack, children: h.map((y, x) => /* @__PURE__ */ o.jsx(S, { children: y }, `data-card-top-${c}-${x}`)) }) : void 0;
1136
+ ), _ = O(
1137
+ t,
1138
+ s,
1139
+ d && d.length > 0 ? d : null
1140
+ ), f = h && h.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Le.slotStack, children: h.map((x, m) => /* @__PURE__ */ o.jsx(k, { children: x }, `card-accordion-body-${i}-${m}`)) }) : void 0, g = _ && _.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Le.slotStack, children: _.map((x, m) => /* @__PURE__ */ o.jsx(k, { children: x }, `card-accordion-actions-${i}-${m}`)) }) : void 0, y = a.disabled || u;
1086
1141
  return /* @__PURE__ */ o.jsx(
1087
- ot,
1142
+ ut,
1088
1143
  {
1089
- ...u,
1090
- icon: d,
1091
- headerStatusColor: f,
1092
- topContent: m,
1093
- children: p
1144
+ ...a,
1145
+ disabled: y,
1146
+ actionContent: g,
1147
+ children: f ?? null
1148
+ }
1149
+ );
1150
+ }, Yn = "_slotStack_ivk5b_1", Zn = {
1151
+ slotStack: Yn
1152
+ }, Fn = (e) => {
1153
+ const {
1154
+ userFlow: t,
1155
+ pageId: s,
1156
+ component: r,
1157
+ hash: i,
1158
+ responseKey: l,
1159
+ content: c,
1160
+ colorId: n,
1161
+ disabled: d,
1162
+ actionType: a,
1163
+ dataSource: u,
1164
+ redirectUrl: h,
1165
+ dependencies: _
1166
+ } = e, { getNextUI: f, fetchDataSource: g, fetchAndGetNextUI: y } = K(), { disabled: x } = I(
1167
+ t,
1168
+ _
1169
+ ), m = d ?? x, p = O(
1170
+ t,
1171
+ s,
1172
+ c && c.length > 0 ? c : null
1173
+ ), b = p && p.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Zn.slotStack, children: p.map((j, C) => /* @__PURE__ */ o.jsx(k, { children: j }, `card-body-${i}-${C}`)) }) : null, N = R(async () => {
1174
+ var j, C, w;
1175
+ if (!(!a || m))
1176
+ try {
1177
+ const E = {
1178
+ ...(j = v.getState()[t]) == null ? void 0 : j.entries,
1179
+ [l]: { status: 200 }
1180
+ };
1181
+ switch (q(t, E), a) {
1182
+ case "CLOSE_MODAL":
1183
+ ce(t, !1);
1184
+ break;
1185
+ case "CLOSE_DRAWER":
1186
+ W(t, !1);
1187
+ break;
1188
+ case "OPEN_DRAWER":
1189
+ W(t, !0);
1190
+ break;
1191
+ case "GO_TO_NEXT_UI":
1192
+ case "GO_TO_NEXT_UI_WITHOUT_LOADING": {
1193
+ const T = await f(
1194
+ t,
1195
+ s,
1196
+ E,
1197
+ l,
1198
+ a === "GO_TO_NEXT_UI"
1199
+ );
1200
+ T != null && T.data && $(t, T == null ? void 0 : T.data);
1201
+ break;
1202
+ }
1203
+ case "FETCH_AND_GO_TO_NEXT_UI": {
1204
+ const S = await y(
1205
+ t,
1206
+ s,
1207
+ E,
1208
+ l,
1209
+ u
1210
+ );
1211
+ S != null && S.data && $(t, S == null ? void 0 : S.data);
1212
+ break;
1213
+ }
1214
+ case "GET_DATA_SOURCE": {
1215
+ const S = await f(
1216
+ t,
1217
+ s,
1218
+ E,
1219
+ l
1220
+ ), T = (C = S == null ? void 0 : S.data) == null ? void 0 : C.content;
1221
+ if ((T == null ? void 0 : T.type) !== "fetch")
1222
+ break;
1223
+ const G = T == null ? void 0 : T.dataSource, U = await g(G, t, !1), J = {
1224
+ ...(w = v.getState()[t]) == null ? void 0 : w.entries,
1225
+ [l]: {
1226
+ status: U == null ? void 0 : U.status,
1227
+ content: U == null ? void 0 : U.data
1228
+ }
1229
+ };
1230
+ q(t, J);
1231
+ const D = await f(
1232
+ t,
1233
+ s,
1234
+ J,
1235
+ l
1236
+ );
1237
+ D != null && D.data && $(t, D == null ? void 0 : D.data);
1238
+ break;
1239
+ }
1240
+ case "REDIRECT":
1241
+ h && (window.location.href = h);
1242
+ break;
1243
+ default:
1244
+ console.warn(`Unhandled card actionType: ${a}`);
1245
+ }
1246
+ } catch (E) {
1247
+ alert(JSON.stringify(E));
1248
+ }
1249
+ }, [
1250
+ a,
1251
+ u,
1252
+ m,
1253
+ y,
1254
+ g,
1255
+ f,
1256
+ s,
1257
+ h,
1258
+ l,
1259
+ t
1260
+ ]);
1261
+ return /* @__PURE__ */ o.jsx(
1262
+ ht,
1263
+ {
1264
+ colorId: n,
1265
+ disabled: m,
1266
+ onClick: a && !m ? () => void N() : void 0,
1267
+ children: b
1094
1268
  }
1095
1269
  );
1096
- }, In = "_dividerNotFront_tze3j_1", Bn = {
1097
- dividerNotFront: In
1098
- }, Kn = (e) => /* @__PURE__ */ o.jsx(ct, { ...e, className: Bn.dividerNotFront }), Mn = (e, t, a) => {
1099
- const { url: s, paginationKeys: c, params: i } = e, l = [], n = (c == null ? void 0 : c.page) ?? "page";
1100
- if (l.push(`${n}=${t}`), typeof a == "string") {
1101
- const u = (c == null ? void 0 : c.text) ?? "text";
1102
- l.push(`${u}=${encodeURIComponent(a || "")}`);
1270
+ }, Pn = (e) => {
1271
+ const { content: t, description: s, ...r } = e, i = {
1272
+ ...r,
1273
+ children: t ?? s
1274
+ };
1275
+ return /* @__PURE__ */ o.jsx(ge, { ...i });
1276
+ }, es = (e, t, s) => {
1277
+ const { url: r, paginationKeys: i, params: l } = e, c = [], n = (i == null ? void 0 : i.page) ?? "page";
1278
+ if (c.push(`${n}=${t}`), typeof s == "string") {
1279
+ const u = (i == null ? void 0 : i.text) ?? "text";
1280
+ c.push(`${u}=${encodeURIComponent(s || "")}`);
1103
1281
  }
1104
- if (i && typeof i == "object") {
1105
- const u = Object.entries(i).map(
1106
- ([f, _]) => `${encodeURIComponent(f)}=${encodeURIComponent(_)}`
1282
+ if (l && typeof l == "object") {
1283
+ const u = Object.entries(l).map(
1284
+ ([h, _]) => `${encodeURIComponent(h)}=${encodeURIComponent(_)}`
1107
1285
  );
1108
- l.push(...u);
1286
+ c.push(...u);
1109
1287
  }
1110
- const d = l.join("&");
1111
- return d ? `${s}?${d}` : s;
1112
- }, pe = (e, t, a) => {
1113
- const { type: s, url: c, method: i, headers: l } = e;
1114
- return s === "rest" ? {
1115
- type: "rest",
1116
- url: Mn(e, t, a),
1117
- method: i,
1118
- headers: l,
1119
- data: (e == null ? void 0 : e.data) || {}
1120
- } : {
1121
- type: "graphql",
1122
- url: c,
1123
- method: "post",
1124
- headers: l,
1125
- query: e == null ? void 0 : e.query,
1126
- variables: {
1127
- ...(e == null ? void 0 : e.variables) || {},
1128
- ...typeof a == "string" ? { text: a } : {},
1129
- page: t
1130
- }
1131
- };
1132
- }, _e = (e) => Array.isArray(e) ? e : typeof e == "object" ? JSON.stringify(e) : e, Je = (e, t, a, s) => {
1133
- const c = L.query(e, t), i = c == null ? void 0 : c.map((r) => {
1134
- var u, f;
1135
- if (a) {
1288
+ const d = c.join("&");
1289
+ return d ? `${r}?${d}` : r;
1290
+ }, Ne = (e, t, s, r) => {
1291
+ const { type: i, url: l, method: c, headers: n } = e;
1292
+ if (i === "rest") {
1293
+ const d = es(e, t, s), u = { ...(e == null ? void 0 : e.data) ?? {}, ...r ?? {} };
1294
+ return {
1295
+ type: "rest",
1296
+ url: d,
1297
+ method: c,
1298
+ headers: n,
1299
+ data: u
1300
+ };
1301
+ } else
1302
+ return {
1303
+ type: "graphql",
1304
+ url: l,
1305
+ method: "post",
1306
+ headers: n,
1307
+ query: e == null ? void 0 : e.query,
1308
+ variables: {
1309
+ ...(e == null ? void 0 : e.variables) || {},
1310
+ ...typeof s == "string" ? { text: s } : {},
1311
+ page: t
1312
+ }
1313
+ };
1314
+ }, fe = (e) => Array.isArray(e) ? e : typeof e == "object" ? JSON.stringify(e) : e, ts = (e, t) => {
1315
+ if (!t || e == null)
1316
+ return null;
1317
+ const { extractionJsonPath: s, injectionJsonPath: r } = t, i = B.value(e, s);
1318
+ if (i == null)
1319
+ return null;
1320
+ try {
1321
+ const l = {};
1322
+ return B.value(l, r, i), l;
1323
+ } catch (l) {
1324
+ return console.warn(
1325
+ "[buildCursorPayload] invalid injectionJsonPath:",
1326
+ r,
1327
+ l
1328
+ ), null;
1329
+ }
1330
+ }, Ye = (e, t, s, r) => {
1331
+ const i = B.query(e, t), l = i == null ? void 0 : i.map((a) => {
1332
+ var u, h;
1333
+ if (s) {
1136
1334
  const _ = {};
1137
- for (const [h, p] of Object.entries(a))
1138
- if (typeof p == "object" && "path" in p) {
1139
- const m = p, y = (u = L.query(r, m.path)) == null ? void 0 : u[0];
1140
- m.translations && String(y) in m.translations ? _[h] = _e(
1141
- m.translations[String(y)]
1142
- ) : _[h] = _e(y);
1335
+ for (const [f, g] of Object.entries(s))
1336
+ if (typeof g == "object" && "path" in g) {
1337
+ const y = g, x = (u = B.query(a, y.path)) == null ? void 0 : u[0];
1338
+ y.translations && String(x) in y.translations ? _[f] = fe(
1339
+ y.translations[String(x)]
1340
+ ) : _[f] = fe(x);
1143
1341
  } else {
1144
- const m = p;
1145
- _[h] = _e((f = L.query(r, m)) == null ? void 0 : f[0]);
1342
+ const y = g;
1343
+ _[f] = fe((h = B.query(a, y)) == null ? void 0 : h[0]);
1146
1344
  }
1147
1345
  return _;
1148
1346
  } else
1149
- return r;
1150
- }), l = L.value(e, (s == null ? void 0 : s.size) ?? "$.meta.size") ?? c.length, n = L.value(e, (s == null ? void 0 : s.total) ?? "$.meta.total") ?? 0, d = {
1151
- size: l,
1347
+ return a;
1348
+ }), c = B.value(e, (r == null ? void 0 : r.size) ?? "$.meta.size") ?? i.length, n = B.value(e, (r == null ? void 0 : r.total) ?? "$.meta.total") ?? 0, d = {
1349
+ size: c,
1152
1350
  total: n,
1153
- totalPages: s != null && s.totalPages ? L.value(
1351
+ totalPages: r != null && r.totalPages ? B.value(
1154
1352
  e,
1155
- (s == null ? void 0 : s.totalPages) ?? "$.meta.totalPages"
1156
- ) : l > 0 ? Math.ceil(n / l) : 0
1353
+ (r == null ? void 0 : r.totalPages) ?? "$.meta.totalPages"
1354
+ ) : c > 0 ? Math.ceil(n / c) : 0
1157
1355
  };
1158
- return { items: i, pagination: d };
1159
- }, se = ({ withPadding: e = !1 }) => {
1160
- const t = (a) => /* @__PURE__ */ o.jsx("span", { style: { color: I.labelColor }, children: a });
1356
+ return { items: l, pagination: d };
1357
+ }, ie = ({ withPadding: e = !1 }) => {
1358
+ const t = (s) => /* @__PURE__ */ o.jsx("span", { style: { color: M.labelColor }, children: s });
1161
1359
  return /* @__PURE__ */ o.jsx(
1162
- Tt,
1360
+ It,
1163
1361
  {
1164
1362
  formatter: t,
1165
1363
  wrapperStyle: {
1166
- fontSize: I.fontSize,
1167
- fontFamily: I.fontFamily,
1364
+ fontSize: M.fontSize,
1365
+ fontFamily: M.fontFamily,
1168
1366
  padding: e ? "1rem 0" : "0"
1169
1367
  }
1170
1368
  }
1171
1369
  );
1172
- }, zn = ({
1370
+ }, ns = ({
1173
1371
  active: e,
1174
1372
  payload: t,
1175
- label: a,
1176
- tooltipKey: s
1373
+ label: s,
1374
+ tooltipKey: r
1177
1375
  }) => {
1178
- var i;
1376
+ var l;
1179
1377
  if (!e || !t || !t.length)
1180
1378
  return null;
1181
- const c = {
1182
- backgroundColor: I.tooltipBg,
1183
- borderRadius: I.tooltipBorderRadius,
1184
- color: I.tooltipColor,
1379
+ const i = {
1380
+ backgroundColor: M.tooltipBg,
1381
+ borderRadius: M.tooltipBorderRadius,
1382
+ color: M.tooltipColor,
1185
1383
  padding: "8px 12px",
1186
1384
  border: "1px solid #e5e7eb"
1187
1385
  };
1188
- if (s) {
1189
- const l = (i = t[0]) == null ? void 0 : i.payload;
1190
- if (l && l[s] !== void 0 && l[s] !== null)
1191
- return /* @__PURE__ */ o.jsx("div", { style: c, children: /* @__PURE__ */ o.jsx("p", { style: { margin: 0 }, children: l[s] }) });
1386
+ if (r) {
1387
+ const c = (l = t[0]) == null ? void 0 : l.payload;
1388
+ if (c && c[r] !== void 0 && c[r] !== null)
1389
+ return /* @__PURE__ */ o.jsx("div", { style: i, children: /* @__PURE__ */ o.jsx("p", { style: { margin: 0 }, children: c[r] }) });
1192
1390
  }
1193
- return /* @__PURE__ */ o.jsxs("div", { style: c, children: [
1194
- /* @__PURE__ */ o.jsx("p", { style: { margin: "0 0 4px 0", fontWeight: "bold" }, children: a }),
1195
- t.map((l, n) => /* @__PURE__ */ o.jsx("p", { style: { margin: "2px 0", color: l.color }, children: `${l.name}: ${l.value}` }, n))
1391
+ return /* @__PURE__ */ o.jsxs("div", { style: i, children: [
1392
+ /* @__PURE__ */ o.jsx("p", { style: { margin: "0 0 4px 0", fontWeight: "bold" }, children: s }),
1393
+ t.map((c, n) => /* @__PURE__ */ o.jsx("p", { style: { margin: "2px 0", color: c.color }, children: `${c.name}: ${c.value}` }, n))
1196
1394
  ] });
1197
- }, ae = ({ tooltipKey: e } = {}) => /* @__PURE__ */ o.jsx(
1198
- $t,
1395
+ }, le = ({ tooltipKey: e } = {}) => /* @__PURE__ */ o.jsx(
1396
+ Bt,
1199
1397
  {
1200
- content: /* @__PURE__ */ o.jsx(zn, { tooltipKey: e })
1398
+ content: /* @__PURE__ */ o.jsx(ns, { tooltipKey: e })
1201
1399
  }
1202
- ), be = ({ dataKey: e, hide: t = !1 }) => /* @__PURE__ */ o.jsx(
1203
- At,
1400
+ ), we = ({ dataKey: e, hide: t = !1 }) => /* @__PURE__ */ o.jsx(
1401
+ Kt,
1204
1402
  {
1205
1403
  dataKey: e,
1206
1404
  hide: t,
1207
1405
  tick: {
1208
- fill: I.labelColor,
1209
- fontSize: I.fontSize
1406
+ fill: M.labelColor,
1407
+ fontSize: M.fontSize
1210
1408
  }
1211
1409
  }
1212
- ), je = () => /* @__PURE__ */ o.jsx(
1213
- qt,
1410
+ ), Ce = () => /* @__PURE__ */ o.jsx(
1411
+ Gt,
1214
1412
  {
1215
1413
  tick: {
1216
- fill: I.labelColor,
1217
- fontSize: I.fontSize
1414
+ fill: M.labelColor,
1415
+ fontSize: M.fontSize
1218
1416
  }
1219
1417
  }
1220
- ), Gn = (e) => {
1221
- const { data: t, xKey: a, yKeys: s, tooltipKey: c } = e;
1222
- return /* @__PURE__ */ o.jsx(ne, { width: "100%", height: 400, children: /* @__PURE__ */ o.jsxs(Ot, { data: t, children: [
1223
- /* @__PURE__ */ o.jsx(ye, { strokeDasharray: "3 3" }),
1224
- /* @__PURE__ */ o.jsx(be, { dataKey: a }),
1225
- /* @__PURE__ */ o.jsx(je, {}),
1226
- /* @__PURE__ */ o.jsx(ae, { tooltipKey: c }),
1227
- /* @__PURE__ */ o.jsx(se, {}),
1228
- s.map((i, l) => /* @__PURE__ */ o.jsx(
1229
- Rt,
1418
+ ), ss = (e) => {
1419
+ const { data: t, xKey: s, yKeys: r, tooltipKey: i } = e;
1420
+ return /* @__PURE__ */ o.jsx(oe, { width: "100%", height: 400, children: /* @__PURE__ */ o.jsxs(Ut, { data: t, children: [
1421
+ /* @__PURE__ */ o.jsx(pe, { strokeDasharray: "3 3" }),
1422
+ /* @__PURE__ */ o.jsx(we, { dataKey: s }),
1423
+ /* @__PURE__ */ o.jsx(Ce, {}),
1424
+ /* @__PURE__ */ o.jsx(le, { tooltipKey: i }),
1425
+ /* @__PURE__ */ o.jsx(ie, {}),
1426
+ r.map((l, c) => /* @__PURE__ */ o.jsx(
1427
+ Mt,
1230
1428
  {
1231
1429
  type: "monotone",
1232
- dataKey: i,
1233
- stroke: M[l % M.length],
1234
- fill: M[l % M.length]
1430
+ dataKey: l,
1431
+ stroke: V[c % V.length],
1432
+ fill: V[c % V.length]
1235
1433
  },
1236
- i
1434
+ l
1237
1435
  ))
1238
1436
  ] }) });
1239
- }, Un = (e) => {
1240
- const { data: t, yKeys: a, xKey: s, tooltipKey: c } = e;
1241
- return /* @__PURE__ */ o.jsx(ne, { width: "100%", height: 400, children: /* @__PURE__ */ o.jsxs(Dt, { data: t, children: [
1242
- /* @__PURE__ */ o.jsx(ye, { strokeDasharray: "3 3" }),
1243
- /* @__PURE__ */ o.jsx(be, { hide: !0, dataKey: s }),
1244
- /* @__PURE__ */ o.jsx(je, {}),
1245
- /* @__PURE__ */ o.jsx(ae, { tooltipKey: c }),
1246
- /* @__PURE__ */ o.jsx(se, { withPadding: !0 }),
1247
- a.map((i, l) => /* @__PURE__ */ o.jsx(
1248
- Lt,
1437
+ }, as = (e) => {
1438
+ const { data: t, yKeys: s, xKey: r, tooltipKey: i } = e;
1439
+ return /* @__PURE__ */ o.jsx(oe, { width: "100%", height: 400, children: /* @__PURE__ */ o.jsxs(zt, { data: t, children: [
1440
+ /* @__PURE__ */ o.jsx(pe, { strokeDasharray: "3 3" }),
1441
+ /* @__PURE__ */ o.jsx(we, { hide: !0, dataKey: r }),
1442
+ /* @__PURE__ */ o.jsx(Ce, {}),
1443
+ /* @__PURE__ */ o.jsx(le, { tooltipKey: i }),
1444
+ /* @__PURE__ */ o.jsx(ie, { withPadding: !0 }),
1445
+ s.map((l, c) => /* @__PURE__ */ o.jsx(
1446
+ Vt,
1249
1447
  {
1250
- dataKey: i,
1251
- fill: M[l % M.length]
1448
+ dataKey: l,
1449
+ fill: V[c % V.length]
1252
1450
  },
1253
- i
1451
+ l
1254
1452
  ))
1255
1453
  ] }) });
1256
- }, Jn = (e) => {
1257
- const { data: t, xKey: a, yKeys: s, tooltipKey: c } = e;
1258
- return /* @__PURE__ */ o.jsx(ne, { width: "100%", height: 400, children: /* @__PURE__ */ o.jsxs(It, { data: t, children: [
1259
- /* @__PURE__ */ o.jsx(ye, { strokeDasharray: "3 3" }),
1260
- /* @__PURE__ */ o.jsx(be, { dataKey: a }),
1261
- /* @__PURE__ */ o.jsx(je, {}),
1262
- /* @__PURE__ */ o.jsx(ae, { tooltipKey: c }),
1263
- /* @__PURE__ */ o.jsx(se, {}),
1264
- s.map((i, l) => /* @__PURE__ */ o.jsx(
1265
- Bt,
1454
+ }, rs = (e) => {
1455
+ const { data: t, xKey: s, yKeys: r, tooltipKey: i } = e;
1456
+ return /* @__PURE__ */ o.jsx(oe, { width: "100%", height: 400, children: /* @__PURE__ */ o.jsxs(Jt, { data: t, children: [
1457
+ /* @__PURE__ */ o.jsx(pe, { strokeDasharray: "3 3" }),
1458
+ /* @__PURE__ */ o.jsx(we, { dataKey: s }),
1459
+ /* @__PURE__ */ o.jsx(Ce, {}),
1460
+ /* @__PURE__ */ o.jsx(le, { tooltipKey: i }),
1461
+ /* @__PURE__ */ o.jsx(ie, {}),
1462
+ r.map((l, c) => /* @__PURE__ */ o.jsx(
1463
+ Xt,
1266
1464
  {
1267
1465
  type: "monotone",
1268
- dataKey: i,
1269
- stroke: M[l % M.length],
1466
+ dataKey: l,
1467
+ stroke: V[c % V.length],
1270
1468
  strokeWidth: 2,
1271
1469
  dot: !1
1272
1470
  },
1273
- i
1471
+ l
1274
1472
  ))
1275
1473
  ] }) });
1276
- }, Vn = (e) => {
1277
- const { data: t, xKey: a, yKeys: s, tooltipKey: c } = e, i = ({
1278
- cx: l,
1474
+ }, os = (e) => {
1475
+ const { data: t, xKey: s, yKeys: r, tooltipKey: i } = e, l = ({
1476
+ cx: c,
1279
1477
  cy: n,
1280
1478
  midAngle: d,
1281
- innerRadius: r,
1479
+ innerRadius: a,
1282
1480
  outerRadius: u,
1283
- value: f
1481
+ value: h
1284
1482
  }) => {
1285
- const _ = Math.PI / 180, h = 25 + r + (u - r), p = l + h * Math.cos(-(d ?? 0) * _), m = n + h * Math.sin(-(d ?? 0) * _);
1483
+ const _ = Math.PI / 180, f = 25 + a + (u - a), g = c + f * Math.cos(-(d ?? 0) * _), y = n + f * Math.sin(-(d ?? 0) * _);
1286
1484
  return /* @__PURE__ */ o.jsx(
1287
1485
  "text",
1288
1486
  {
1289
- x: p,
1290
- y: m,
1291
- fill: I.labelColor,
1292
- color: I.labelColor,
1487
+ x: g,
1488
+ y,
1489
+ fill: M.labelColor,
1490
+ color: M.labelColor,
1293
1491
  textAnchor: "middle",
1294
1492
  dominantBaseline: "central",
1295
- children: f
1493
+ children: h
1494
+ }
1495
+ );
1496
+ };
1497
+ return /* @__PURE__ */ o.jsx(oe, { width: "100%", height: 400, children: /* @__PURE__ */ o.jsxs(Ht, { children: [
1498
+ /* @__PURE__ */ o.jsx(le, { tooltipKey: i }),
1499
+ /* @__PURE__ */ o.jsx(ie, {}),
1500
+ /* @__PURE__ */ o.jsx(
1501
+ Wt,
1502
+ {
1503
+ data: t,
1504
+ dataKey: r[0],
1505
+ nameKey: s,
1506
+ label: l,
1507
+ outerRadius: 120,
1508
+ children: t.map((c, n) => /* @__PURE__ */ o.jsx(
1509
+ Qt,
1510
+ {
1511
+ fill: V[n % V.length]
1512
+ },
1513
+ `cell-${n}`
1514
+ ))
1515
+ }
1516
+ )
1517
+ ] }) });
1518
+ }, cs = {
1519
+ area: ss,
1520
+ bar: as,
1521
+ line: rs,
1522
+ pie: os
1523
+ }, V = [
1524
+ "var(--color-primitive-palette-1-50)",
1525
+ "var(--color-primitive-palette-2-50)",
1526
+ "var(--color-primitive-palette-3-50)",
1527
+ "var(--color-primitive-palette-4-50)",
1528
+ "var(--color-primitive-palette-5-50)",
1529
+ "var(--color-primitive-palette-6-50)",
1530
+ "var(--color-primitive-palette-7-50)",
1531
+ "var(--color-primitive-palette-8-50)",
1532
+ "var(--color-primitive-palette-9-50)",
1533
+ "var(--color-primitive-palette-10-50)",
1534
+ "var(--color-primitive-palette-11-50)",
1535
+ "var(--color-primitive-palette-12-50)",
1536
+ "var(--color-primitive-palette-13-50)",
1537
+ "var(--color-primitive-palette-14-50)",
1538
+ "var(--color-primitive-palette-15-50)",
1539
+ "var(--color-primitive-palette-16-50)",
1540
+ "var(--color-primitive-palette-17-50)"
1541
+ ], M = {
1542
+ fontFamily: "Roboto, sans-serif",
1543
+ fontSize: 12,
1544
+ labelColor: "var(--color-neutral-90)",
1545
+ tooltipBg: "#fff",
1546
+ tooltipColor: "#000",
1547
+ tooltipBorderRadius: "4px"
1548
+ }, is = (e) => {
1549
+ const { component: t, userFlow: s, hash: r, responseKey: i, dataSource: l, ...c } = e, n = cs[c.type];
1550
+ if (!n)
1551
+ return /* @__PURE__ */ o.jsx("div", { children: "Not supported chart type" });
1552
+ const { fetchDataSource: d } = K(), [a, u] = L(!1), [h, _] = L([]), f = async () => {
1553
+ var y, x;
1554
+ try {
1555
+ u(!0);
1556
+ const { jsonPathData: m, mapperData: p } = l, b = Ne(
1557
+ l,
1558
+ 1
1559
+ ), N = await d(
1560
+ b,
1561
+ s,
1562
+ !1
1563
+ ), j = m ? (y = Ye(N == null ? void 0 : N.data, m, p)) == null ? void 0 : y.items : (x = N == null ? void 0 : N.data) == null ? void 0 : x.data;
1564
+ _(j), u(!1);
1565
+ } catch (m) {
1566
+ alert(JSON.stringify(m)), u(!1);
1567
+ }
1568
+ };
1569
+ z(() => {
1570
+ l ? f() : _(c.data);
1571
+ }, []);
1572
+ const g = {
1573
+ ...c,
1574
+ data: h
1575
+ };
1576
+ return a ? /* @__PURE__ */ o.jsx(Ve, { height: 400 }) : h.length > 0 ? n(g) : /* @__PURE__ */ o.jsx(ge, { state: "info", title: "Sin registros", children: "No hay datos disponibles para mostrar en este momento" });
1577
+ }, ls = (e) => {
1578
+ const {
1579
+ userFlow: t,
1580
+ pageId: s,
1581
+ responseKey: r,
1582
+ actionType: i,
1583
+ label: l,
1584
+ value: c,
1585
+ required: n,
1586
+ dependencies: d,
1587
+ ...a
1588
+ } = e, u = {
1589
+ ...a
1590
+ }, { getNextUI: h } = K(), [_, f] = L(c || !1), { disabled: g } = I(
1591
+ t,
1592
+ d
1593
+ ), y = A(() => n && l ? `${l} *` : l ?? "", [l, n]), x = R(async () => {
1594
+ var p;
1595
+ try {
1596
+ const b = !_;
1597
+ f(b);
1598
+ const N = {
1599
+ ...(p = v.getState()[t]) == null ? void 0 : p.entries,
1600
+ [r]: b
1601
+ };
1602
+ switch (q(t, N), i) {
1603
+ case "GO_TO_NEXT_UI":
1604
+ case "GO_TO_NEXT_UI_WITHOUT_LOADING": {
1605
+ const C = await h(
1606
+ t,
1607
+ s,
1608
+ N,
1609
+ r,
1610
+ i === "GO_TO_NEXT_UI"
1611
+ );
1612
+ C != null && C.data && $(t, C == null ? void 0 : C.data);
1613
+ break;
1614
+ }
1615
+ default:
1616
+ break;
1617
+ }
1618
+ } catch (b) {
1619
+ console.error("Error in checkbox action:", b), alert(JSON.stringify(b));
1620
+ }
1621
+ }, [t, s, r, i, _]), m = (u == null ? void 0 : u.disabled) ?? g;
1622
+ return /* @__PURE__ */ o.jsx(
1623
+ ft,
1624
+ {
1625
+ ...u,
1626
+ labelRight: y,
1627
+ checked: _,
1628
+ disabled: m,
1629
+ onChange: () => {
1630
+ !m && x();
1631
+ }
1632
+ }
1633
+ );
1634
+ }, ds = "_codeEditor_1wi2p_1", _s = "_codeEditor_label_1wi2p_4", us = "_codeEditor_wrapper_1wi2p_13", hs = "_input_1wi2p_17", fs = "_preview_1wi2p_18", ms = "_preview_inner_1wi2p_33", Z = {
1635
+ codeEditor: ds,
1636
+ codeEditor_label: _s,
1637
+ codeEditor_wrapper: us,
1638
+ input: hs,
1639
+ preview: fs,
1640
+ preview_inner: ms
1641
+ }, ys = (e) => {
1642
+ const {
1643
+ userFlow: t,
1644
+ responseKey: s,
1645
+ label: r,
1646
+ language: i,
1647
+ placeholder: l,
1648
+ value: c,
1649
+ required: n,
1650
+ dependencies: d,
1651
+ disabled: a,
1652
+ showPreview: u,
1653
+ height: h = "400px"
1654
+ } = e, [_, f] = L(c ?? ""), g = ne.useThemeStore((N) => N.theme.mode), { disabled: y } = I(
1655
+ t,
1656
+ d
1657
+ ), x = a ?? y, m = {
1658
+ json: ve(),
1659
+ markdown: Zt(),
1660
+ sql: Ft(),
1661
+ yaml: Pt()
1662
+ }, p = A(() => n && r ? `${r} *` : r ?? "", [r, n]), b = (N) => {
1663
+ f(N);
1664
+ const j = {
1665
+ [s]: N
1666
+ };
1667
+ q(t, j);
1668
+ };
1669
+ return /* @__PURE__ */ o.jsxs("div", { className: Z.codeEditor, children: [
1670
+ p && p !== "" && /* @__PURE__ */ o.jsx("label", { className: Z.codeEditor_label, children: p }),
1671
+ /* @__PURE__ */ o.jsxs("div", { className: Z.codeEditor_wrapper, children: [
1672
+ /* @__PURE__ */ o.jsx(
1673
+ Yt,
1674
+ {
1675
+ className: Z.input,
1676
+ value: _,
1677
+ height: h,
1678
+ placeholder: l,
1679
+ extensions: [m[i] ?? ve()],
1680
+ onChange: (N) => b(N),
1681
+ theme: g,
1682
+ editable: !x
1683
+ }
1684
+ ),
1685
+ i === "markdown" && u && /* @__PURE__ */ o.jsx("div", { className: Z.preview, style: { height: h }, children: /* @__PURE__ */ o.jsx(Je, { className: Z.preview_inner, children: _ }) })
1686
+ ] })
1687
+ ] });
1688
+ }, xs = "_slotStack_6n2wy_5", Ie = {
1689
+ slotStack: xs
1690
+ }, gs = (e) => {
1691
+ const {
1692
+ userFlow: t,
1693
+ pageId: s,
1694
+ component: r,
1695
+ hash: i,
1696
+ responseKey: l,
1697
+ content: c,
1698
+ topContent: n,
1699
+ icon: d,
1700
+ headerStatusColor: a,
1701
+ ...u
1702
+ } = e, h = a ? `palette_${a}_50` : void 0, _ = O(
1703
+ t,
1704
+ s,
1705
+ c && c.length > 0 ? c : null
1706
+ ), f = O(
1707
+ t,
1708
+ s,
1709
+ n && n.length > 0 ? n : null
1710
+ ), g = _ && _.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Ie.slotStack, children: _.map((x, m) => /* @__PURE__ */ o.jsx(k, { children: x }, `data-card-body-${i}-${m}`)) }) : void 0, y = f && f.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Ie.slotStack, children: f.map((x, m) => /* @__PURE__ */ o.jsx(k, { children: x }, `data-card-top-${i}-${m}`)) }) : void 0;
1711
+ return /* @__PURE__ */ o.jsx(
1712
+ mt,
1713
+ {
1714
+ ...u,
1715
+ icon: d,
1716
+ headerStatusColor: h,
1717
+ topContent: y,
1718
+ children: g
1719
+ }
1720
+ );
1721
+ }, ps = "_dividerNotFront_tze3j_1", bs = {
1722
+ dividerNotFront: ps
1723
+ }, js = (e) => /* @__PURE__ */ o.jsx(yt, { ...e, className: bs.dividerNotFront }), Ns = "_drawer_13pxo_1", ws = "_drawerBody_13pxo_5", Cs = "_drawerFooter_13pxo_11", me = {
1724
+ drawer: Ns,
1725
+ drawerBody: ws,
1726
+ drawerFooter: Cs
1727
+ }, vs = ({
1728
+ userFlow: e,
1729
+ pageId: t,
1730
+ responseKey: s,
1731
+ header: r,
1732
+ body: i,
1733
+ footer: l,
1734
+ ...c
1735
+ }) => {
1736
+ const n = v((y) => {
1737
+ var x;
1738
+ return (x = y[e]) == null ? void 0 : x.isDrawerOpen;
1739
+ }), d = v((y) => {
1740
+ var x;
1741
+ return (x = y[e]) == null ? void 0 : x.isLoading;
1742
+ }), a = n && !d, u = {
1743
+ ...c,
1744
+ isOpen: a,
1745
+ children: null
1746
+ }, h = R(() => {
1747
+ be(e), W(e, !1);
1748
+ }, [e]), _ = Array.isArray(r) ? O(e, t, r) : r ? /* @__PURE__ */ o.jsx(ze, { type: "h2", children: r }) : void 0, f = O(e, t, i), g = l ? O(e, t, l) : void 0;
1749
+ return /* @__PURE__ */ o.jsx(
1750
+ xt,
1751
+ {
1752
+ ...u,
1753
+ className: me.drawer,
1754
+ isOpen: a,
1755
+ onClose: h,
1756
+ heightGap: 0,
1757
+ title: _ ? /* @__PURE__ */ o.jsx(o.Fragment, { children: Array.isArray(_) ? _.map((y, x) => /* @__PURE__ */ o.jsx(k, { children: y }, `drawer-header-${x}`)) : _ }) : void 0,
1758
+ children: /* @__PURE__ */ o.jsx("section", { className: me.drawerBody, children: f.map((y, x) => /* @__PURE__ */ o.jsx(k, { children: y }, `drawer-body-${x}`)) }),
1759
+ footer: g ? /* @__PURE__ */ o.jsx("div", { className: me.drawerFooter, children: g.map((y, x) => /* @__PURE__ */ o.jsx(k, { children: y }, `drawer-footer-${x}`)) }) : void 0
1760
+ }
1761
+ );
1762
+ }, Ss = (e) => {
1763
+ const {
1764
+ userFlow: t,
1765
+ pageId: s,
1766
+ component: r,
1767
+ hash: i,
1768
+ responseKey: l,
1769
+ content: c,
1770
+ items: n,
1771
+ disabled: d,
1772
+ variant: a,
1773
+ leftIcon: u,
1774
+ rightIcon: h
1775
+ } = e, _ = je(t, s), f = A(
1776
+ () => n.map((g) => ({
1777
+ label: g.content ?? g.label ?? "",
1778
+ onClick: () => {
1779
+ _({
1780
+ responseKey: g.responseKey,
1781
+ actionType: g.actionType,
1782
+ dataSource: g.dataSource,
1783
+ redirectUrl: g.redirectUrl,
1784
+ dependencies: g.dependencies
1785
+ });
1296
1786
  }
1297
- );
1298
- };
1299
- return /* @__PURE__ */ o.jsx(ne, { width: "100%", height: 400, children: /* @__PURE__ */ o.jsxs(Kt, { children: [
1300
- /* @__PURE__ */ o.jsx(ae, { tooltipKey: c }),
1301
- /* @__PURE__ */ o.jsx(se, {}),
1302
- /* @__PURE__ */ o.jsx(
1303
- Mt,
1304
- {
1305
- data: t,
1306
- dataKey: s[0],
1307
- nameKey: a,
1308
- label: i,
1309
- outerRadius: 120,
1310
- children: t.map((l, n) => /* @__PURE__ */ o.jsx(
1311
- zt,
1787
+ })),
1788
+ [n, _]
1789
+ );
1790
+ return /* @__PURE__ */ o.jsx(
1791
+ gt,
1792
+ {
1793
+ disabled: d,
1794
+ variant: a,
1795
+ items: f,
1796
+ children: /* @__PURE__ */ o.jsxs(k, { children: [
1797
+ u ? /* @__PURE__ */ o.jsx(
1798
+ Se,
1312
1799
  {
1313
- fill: M[n % M.length]
1314
- },
1315
- `cell-${n}`
1316
- ))
1317
- }
1318
- )
1319
- ] }) });
1320
- }, Hn = {
1321
- area: Gn,
1322
- bar: Un,
1323
- line: Jn,
1324
- pie: Vn
1325
- }, M = [
1326
- "var(--color-primitive-palette-1-50)",
1327
- "var(--color-primitive-palette-2-50)",
1328
- "var(--color-primitive-palette-3-50)",
1329
- "var(--color-primitive-palette-4-50)",
1330
- "var(--color-primitive-palette-5-50)",
1331
- "var(--color-primitive-palette-6-50)",
1332
- "var(--color-primitive-palette-7-50)",
1333
- "var(--color-primitive-palette-8-50)",
1334
- "var(--color-primitive-palette-9-50)",
1335
- "var(--color-primitive-palette-10-50)",
1336
- "var(--color-primitive-palette-11-50)",
1337
- "var(--color-primitive-palette-12-50)",
1338
- "var(--color-primitive-palette-13-50)",
1339
- "var(--color-primitive-palette-14-50)",
1340
- "var(--color-primitive-palette-15-50)",
1341
- "var(--color-primitive-palette-16-50)",
1342
- "var(--color-primitive-palette-17-50)"
1343
- ], I = {
1344
- fontFamily: "Roboto, sans-serif",
1345
- fontSize: 12,
1346
- labelColor: "var(--color-neutral-90)",
1347
- tooltipBg: "#fff",
1348
- tooltipColor: "#000",
1349
- tooltipBorderRadius: "4px"
1350
- }, Xn = (e) => {
1351
- const { component: t, userFlow: a, hash: s, responseKey: c, dataSource: i, ...l } = e, n = Hn[l.type];
1352
- if (!n)
1353
- return /* @__PURE__ */ o.jsx("div", { children: "Not supported chart type" });
1354
- const { fetchDataSource: d } = K(), [r, u] = A(!1), [f, _] = A([]), h = async () => {
1355
- var m, y;
1356
- try {
1357
- u(!0);
1358
- const { jsonPathData: x, mapperData: g } = i, b = pe(
1359
- i,
1360
- 1
1361
- ), C = await d(
1362
- b,
1363
- a,
1364
- !1
1365
- ), j = x ? (m = Je(C == null ? void 0 : C.data, x, g)) == null ? void 0 : m.items : (y = C == null ? void 0 : C.data) == null ? void 0 : y.data;
1366
- _(j), u(!1);
1367
- } catch (x) {
1368
- alert(JSON.stringify(x)), u(!1);
1800
+ name: u,
1801
+ size: "md",
1802
+ style: { marginRight: 8, verticalAlign: "middle" }
1803
+ }
1804
+ ) : null,
1805
+ c,
1806
+ h ? /* @__PURE__ */ o.jsx(
1807
+ Se,
1808
+ {
1809
+ name: h,
1810
+ size: "md",
1811
+ style: { marginLeft: 8, verticalAlign: "middle" }
1812
+ }
1813
+ ) : null
1814
+ ] })
1369
1815
  }
1370
- };
1371
- z(() => {
1372
- i ? h() : _(l.data);
1373
- }, []);
1374
- const p = {
1375
- ...l,
1376
- data: f
1377
- };
1378
- return r ? /* @__PURE__ */ o.jsx(Me, { height: 400 }) : f.length > 0 ? n(p) : /* @__PURE__ */ o.jsx(me, { state: "info", title: "Sin registros", children: "No hay datos disponibles para mostrar en este momento" });
1379
- }, Wn = "_header_g1eri_1", Qn = "_header_content_g1eri_5", Re = {
1380
- header: Wn,
1381
- header_content: Qn
1382
- }, Yn = ({ components: e = [] }) => /* @__PURE__ */ o.jsx("section", { className: ee(Re.header, "avocado-dark-theme"), children: /* @__PURE__ */ o.jsx("div", { className: Re.header_content, children: e.map((t, a) => /* @__PURE__ */ o.jsx(S, { children: t }, a)) }) }), Zn = (e) => {
1816
+ );
1817
+ }, Es = "_header_g1eri_1", Ts = "_header_content_g1eri_5", Be = {
1818
+ header: Es,
1819
+ header_content: Ts
1820
+ }, ks = ({ components: e = [] }) => /* @__PURE__ */ o.jsx("section", { className: F(Be.header, "avocado-dark-theme"), children: /* @__PURE__ */ o.jsx("div", { className: Be.header_content, children: e.map((t, s) => /* @__PURE__ */ o.jsx(k, { children: t }, s)) }) }), Os = (e) => {
1383
1821
  const {
1384
1822
  userFlow: t,
1385
- pageId: a,
1386
- responseKey: s,
1387
- actionType: c,
1388
- content: i,
1389
- redirectUrl: l,
1823
+ pageId: s,
1824
+ responseKey: r,
1825
+ actionType: i,
1826
+ content: l,
1827
+ redirectUrl: c,
1390
1828
  target: n,
1391
1829
  dependencies: d,
1392
- component: r,
1830
+ component: a,
1393
1831
  hash: u,
1394
- ...f
1395
- } = e, { getNextUI: _ } = K(), { disabled: h } = B(
1832
+ ...h
1833
+ } = e, { getNextUI: _ } = K(), { disabled: f } = I(
1396
1834
  t,
1397
1835
  d
1398
- ), p = c && f ? (() => {
1399
- const { href: x, target: g, download: b, ...C } = f;
1400
- return C;
1401
- })() : f, m = R(async () => {
1402
- var x;
1403
- if (c)
1836
+ ), g = i && h ? (() => {
1837
+ const { href: m, target: p, download: b, ...N } = h;
1838
+ return N;
1839
+ })() : h, y = R(async () => {
1840
+ var m;
1841
+ if (i)
1404
1842
  try {
1405
- const g = {
1406
- ...(x = v.getState()[t]) == null ? void 0 : x.entries,
1407
- [s]: { status: 200 }
1843
+ const p = {
1844
+ ...(m = v.getState()[t]) == null ? void 0 : m.entries,
1845
+ [r]: { status: 200 }
1408
1846
  };
1409
- switch (O(t, g), c) {
1847
+ switch (q(t, p), i) {
1410
1848
  case "GO_TO_NEXT_UI": {
1411
1849
  const b = await _(
1412
1850
  t,
1413
- a,
1414
- g,
1415
- s
1851
+ s,
1852
+ p,
1853
+ r
1416
1854
  );
1417
- b != null && b.data && q(t, b == null ? void 0 : b.data);
1855
+ b != null && b.data && $(t, b == null ? void 0 : b.data);
1418
1856
  break;
1419
1857
  }
1420
1858
  case "REDIRECT":
1421
- if (!l) {
1859
+ if (!c) {
1422
1860
  console.warn("Missing redirectUrl for REDIRECT actionType");
1423
1861
  break;
1424
1862
  }
1425
- n === "_blank" ? window.open(l, "_blank", "noopener,noreferrer") : window.location.assign(l);
1863
+ n === "_blank" ? window.open(c, "_blank", "noopener,noreferrer") : window.location.assign(c);
1426
1864
  break;
1427
1865
  default:
1428
- console.warn(`Unhandled actionType for link: ${c}`);
1866
+ console.warn(`Unhandled actionType for link: ${i}`);
1429
1867
  break;
1430
1868
  }
1431
- } catch (g) {
1432
- alert(JSON.stringify(g));
1869
+ } catch (p) {
1870
+ alert(JSON.stringify(p));
1433
1871
  }
1434
- }, [c, _, a, l, s, n, t]), y = p.disabled ?? h;
1872
+ }, [i, _, s, c, r, n, t]), x = g.disabled ?? f;
1435
1873
  return /* @__PURE__ */ o.jsx(
1436
- it,
1874
+ pt,
1437
1875
  {
1438
- ...p,
1439
- disabled: y,
1440
- onClick: c ? m : void 0,
1441
- children: i
1876
+ ...g,
1877
+ disabled: x,
1878
+ onClick: i ? y : void 0,
1879
+ children: l
1442
1880
  }
1443
1881
  );
1444
- }, Fn = "_modalContent_p06ci_1", Pn = {
1445
- modalContent: Fn
1446
- }, es = ({
1882
+ }, As = (e) => {
1883
+ const {
1884
+ userFlow: t,
1885
+ pageId: s,
1886
+ component: r,
1887
+ hash: i,
1888
+ responseKey: l,
1889
+ items: c,
1890
+ closeOnClick: n,
1891
+ disabled: d,
1892
+ listOrigin: a,
1893
+ size: u,
1894
+ variant: h
1895
+ } = e, _ = je(t, s), f = A(
1896
+ () => c.map((g) => ({
1897
+ icon: g.leftIcon,
1898
+ label: g.content ?? g.label ?? "",
1899
+ onClick: (y) => {
1900
+ var x;
1901
+ (x = y == null ? void 0 : y.preventDefault) == null || x.call(y), _({
1902
+ responseKey: g.responseKey,
1903
+ actionType: g.actionType,
1904
+ dataSource: g.dataSource,
1905
+ redirectUrl: g.redirectUrl,
1906
+ dependencies: g.dependencies
1907
+ });
1908
+ }
1909
+ })),
1910
+ [c, _]
1911
+ );
1912
+ return /* @__PURE__ */ o.jsx(
1913
+ bt,
1914
+ {
1915
+ items: f,
1916
+ closeOnClick: n,
1917
+ disabled: d,
1918
+ listOrigin: a,
1919
+ size: u,
1920
+ variant: h
1921
+ }
1922
+ );
1923
+ }, $s = "_modalContent_p06ci_1", qs = {
1924
+ modalContent: $s
1925
+ }, Ds = ({
1447
1926
  userFlow: e,
1448
1927
  pageId: t,
1449
- responseKey: a,
1450
- header: s,
1451
- body: c,
1452
- footer: i,
1453
- headerStatusColor: l,
1928
+ responseKey: s,
1929
+ header: r,
1930
+ body: i,
1931
+ footer: l,
1932
+ headerStatusColor: c,
1454
1933
  ...n
1455
1934
  }) => {
1456
- const d = v((x) => {
1457
- var g;
1458
- return (g = x[e]) == null ? void 0 : g.isModalOpen;
1459
- }), r = v((x) => {
1460
- var g;
1461
- return (g = x[e]) == null ? void 0 : g.isLoading;
1462
- }), u = d && !r, f = {
1935
+ const d = v((m) => {
1936
+ var p;
1937
+ return (p = m[e]) == null ? void 0 : p.isModalOpen;
1938
+ }), a = v((m) => {
1939
+ var p;
1940
+ return (p = m[e]) == null ? void 0 : p.isLoading;
1941
+ }), u = d && !a, h = {
1463
1942
  ...n
1464
- }, _ = (f == null ? void 0 : f.headerStatusColor) ?? l, h = R(() => {
1465
- xe(e), ge(e, !1);
1466
- }, [e, a]), p = Array.isArray(s) ? E(e, t, s) : s, m = E(e, t, c), y = E(e, t, i);
1943
+ }, _ = (h == null ? void 0 : h.headerStatusColor) ?? c, f = R(() => {
1944
+ be(e), ce(e, !1);
1945
+ }, [e, s]), g = Array.isArray(r) ? O(e, t, r) : r, y = O(e, t, i), x = O(e, t, l);
1467
1946
  return /* @__PURE__ */ o.jsx(
1468
- lt,
1947
+ jt,
1469
1948
  {
1470
- ...f,
1949
+ ...h,
1471
1950
  headerStatusColor: _,
1472
- header: typeof p == "string" ? p : /* @__PURE__ */ o.jsx(o.Fragment, { children: p.map((x, g) => /* @__PURE__ */ o.jsx(S, { children: x }, `modal-header-${g}`)) }),
1473
- children: /* @__PURE__ */ o.jsx("section", { className: Pn.modalContent, children: m.map((x, g) => /* @__PURE__ */ o.jsx(S, { children: x }, `modal-body-${g}`)) }),
1474
- actions: /* @__PURE__ */ o.jsx(o.Fragment, { children: y.map((x, g) => /* @__PURE__ */ o.jsx(S, { children: x }, `modal-footer-${g}`)) }),
1951
+ header: typeof g == "string" ? g : /* @__PURE__ */ o.jsx(o.Fragment, { children: g.map((m, p) => /* @__PURE__ */ o.jsx(k, { children: m }, `modal-header-${p}`)) }),
1952
+ children: /* @__PURE__ */ o.jsx("section", { className: qs.modalContent, children: y.map((m, p) => /* @__PURE__ */ o.jsx(k, { children: m }, `modal-body-${p}`)) }),
1953
+ actions: /* @__PURE__ */ o.jsx(o.Fragment, { children: x.map((m, p) => /* @__PURE__ */ o.jsx(k, { children: m }, `modal-footer-${p}`)) }),
1475
1954
  open: u,
1476
- onClose: h
1955
+ onClose: f
1477
1956
  }
1478
1957
  );
1479
- }, ts = ({ userFlow: e, pageId: t }) => {
1480
- var i, l;
1481
- const a = Ht(e);
1482
- if (!a)
1958
+ }, Rs = ({ userFlow: e, pageId: t }) => {
1959
+ var l, c;
1960
+ const s = an(e);
1961
+ if (!s)
1483
1962
  return null;
1484
- const s = [
1485
- ...(a == null ? void 0 : a.components) || [],
1486
- ...((i = a == null ? void 0 : a.header) == null ? void 0 : i.components) || [],
1487
- ...((l = a == null ? void 0 : a.body) == null ? void 0 : l.components) || []
1488
- ], c = E(
1963
+ const r = [
1964
+ ...(s == null ? void 0 : s.components) || [],
1965
+ ...((l = s == null ? void 0 : s.header) == null ? void 0 : l.components) || [],
1966
+ ...((c = s == null ? void 0 : s.body) == null ? void 0 : c.components) || []
1967
+ ], i = O(
1489
1968
  e,
1490
1969
  t,
1491
- s
1970
+ r
1492
1971
  );
1493
- return /* @__PURE__ */ o.jsx(o.Fragment, { children: c == null ? void 0 : c.map((n, d) => {
1494
- const r = `overlay-${d}-${a == null ? void 0 : a.hash}`;
1495
- return /* @__PURE__ */ o.jsx(S, { children: n }, r);
1972
+ return /* @__PURE__ */ o.jsx(o.Fragment, { children: i == null ? void 0 : i.map((n, d) => {
1973
+ const a = `overlay-${d}-${s == null ? void 0 : s.hash}`;
1974
+ return /* @__PURE__ */ o.jsx(k, { children: n }, a);
1496
1975
  }) });
1497
- }, ns = {
1976
+ }, Ls = {
1498
1977
  success: {
1499
1978
  color: "success-opacity",
1500
1979
  textColor: "success-60",
@@ -1520,89 +1999,89 @@ const ee = /* @__PURE__ */ Zt(Rn), Dn = "_slotStack_6n2wy_5", Oe = {
1520
1999
  textColor: "neutral-70",
1521
2000
  iconColor: "neutral-70"
1522
2001
  }
1523
- }, ss = (e) => {
1524
- const { content: t, variant: a = "neutral", ...s } = e, c = ns[a], i = {
1525
- ...s,
2002
+ }, Is = (e) => {
2003
+ const { content: t, variant: s = "neutral", ...r } = e, i = Ls[s], l = {
2004
+ ...r,
1526
2005
  children: t,
1527
- color: (s == null ? void 0 : s.color) ?? c.color,
1528
- textColor: (s == null ? void 0 : s.textColor) ?? c.textColor,
1529
- iconColor: (s == null ? void 0 : s.iconColor) ?? c.iconColor
2006
+ color: (r == null ? void 0 : r.color) ?? i.color,
2007
+ textColor: (r == null ? void 0 : r.textColor) ?? i.textColor,
2008
+ iconColor: (r == null ? void 0 : r.iconColor) ?? i.iconColor
1530
2009
  };
1531
- return /* @__PURE__ */ o.jsx(he, { ...i });
1532
- }, as = (e) => {
2010
+ return /* @__PURE__ */ o.jsx(ye, { ...l });
2011
+ }, Bs = (e) => {
1533
2012
  const { content: t } = e;
1534
- return /* @__PURE__ */ o.jsx(Ke, { children: t });
1535
- }, rs = (e) => {
2013
+ return /* @__PURE__ */ o.jsx(Je, { children: t });
2014
+ }, Ks = (e) => {
1536
2015
  const {
1537
2016
  userFlow: t,
1538
- pageId: a,
1539
- responseKey: s,
1540
- actionType: c,
1541
- dataSource: i,
1542
- dependencies: l,
2017
+ pageId: s,
2018
+ responseKey: r,
2019
+ actionType: i,
2020
+ dataSource: l,
2021
+ dependencies: c,
1543
2022
  onClick: n,
1544
2023
  ...d
1545
- } = e, { getNextUI: r, fetchAndGetNextUI: u } = K(), { disabled: f } = B(
2024
+ } = e, { getNextUI: a, fetchAndGetNextUI: u } = K(), { disabled: h } = I(
1546
2025
  t,
1547
- l
2026
+ c
1548
2027
  ), _ = {
1549
2028
  ...d
1550
- }, h = (_ == null ? void 0 : _.disabled) ?? f, p = R(async () => {
1551
- var m;
2029
+ }, f = (_ == null ? void 0 : _.disabled) ?? h, g = R(async () => {
2030
+ var y;
1552
2031
  try {
1553
- const y = {
1554
- ...(m = v.getState()[t]) == null ? void 0 : m.entries,
1555
- [s]: { status: 200 }
2032
+ const x = {
2033
+ ...(y = v.getState()[t]) == null ? void 0 : y.entries,
2034
+ [r]: { status: 200 }
1556
2035
  };
1557
- switch (O(t, y), c) {
2036
+ switch (q(t, x), i) {
1558
2037
  case "GO_TO_NEXT_UI": {
1559
- const x = await r(
2038
+ const m = await a(
1560
2039
  t,
1561
- a,
1562
- y,
1563
- s
2040
+ s,
2041
+ x,
2042
+ r
1564
2043
  );
1565
- x != null && x.data && q(t, x == null ? void 0 : x.data);
2044
+ m != null && m.data && $(t, m == null ? void 0 : m.data);
1566
2045
  break;
1567
2046
  }
1568
2047
  case "FETCH_AND_GO_TO_NEXT_UI": {
1569
- const x = await u(
2048
+ const m = await u(
1570
2049
  t,
1571
- a,
1572
- y,
1573
2050
  s,
1574
- i
2051
+ x,
2052
+ r,
2053
+ l
1575
2054
  );
1576
- x != null && x.data && q(t, x == null ? void 0 : x.data);
2055
+ m != null && m.data && $(t, m == null ? void 0 : m.data);
1577
2056
  break;
1578
2057
  }
1579
2058
  case "CLOSE_MODAL":
1580
- ge(t, !1);
2059
+ ce(t, !1);
1581
2060
  break;
1582
2061
  case "CLOSE_DRAWER":
1583
- Z(t, !1);
2062
+ W(t, !1);
1584
2063
  break;
1585
2064
  case "OPEN_DRAWER":
1586
- Z(t, !0);
2065
+ W(t, !0);
1587
2066
  break;
1588
2067
  default:
1589
- console.warn(`Unhandled actionType: ${c}`);
2068
+ console.warn(`Unhandled actionType: ${i}`);
1590
2069
  break;
1591
2070
  }
1592
- } catch (y) {
1593
- alert(JSON.stringify(y));
2071
+ } catch (x) {
2072
+ alert(JSON.stringify(x));
1594
2073
  }
1595
- }, [c, i, a, s, t]);
2074
+ }, [i, l, s, r, t]);
1596
2075
  return /* @__PURE__ */ o.jsx(
1597
- dt,
2076
+ Nt,
1598
2077
  {
1599
2078
  ..._,
1600
- disabled: h,
1601
- onClick: () => !h && (n ?? p)()
2079
+ disabled: f,
2080
+ onClick: () => !f && (n ?? g)()
1602
2081
  }
1603
2082
  );
1604
- }, os = "_row_1bqj4_1", cs = "_row_column_1bqj4_65", J = {
1605
- row: os,
2083
+ }, Gs = "_row_1bqj4_1", Us = "_row_column_1bqj4_65", X = {
2084
+ row: Gs,
1606
2085
  "row__gap-none": "_row__gap-none_1bqj4_5",
1607
2086
  "row__gap-xxs": "_row__gap-xxs_1bqj4_8",
1608
2087
  "row__gap-xs": "_row__gap-xs_1bqj4_11",
@@ -1623,7 +2102,7 @@ const ee = /* @__PURE__ */ Zt(Rn), Dn = "_slotStack_6n2wy_5", Oe = {
1623
2102
  "row__align-center": "_row__align-center_1bqj4_56",
1624
2103
  "row__align-stretch": "_row__align-stretch_1bqj4_59",
1625
2104
  "row__align-baseline": "_row__align-baseline_1bqj4_62",
1626
- row_column: cs,
2105
+ row_column: Us,
1627
2106
  "row_column__gap-none": "_row_column__gap-none_1bqj4_72",
1628
2107
  "row_column__gap-xxs": "_row_column__gap-xxs_1bqj4_75",
1629
2108
  "row_column__gap-xs": "_row_column__gap-xs_1bqj4_78",
@@ -1644,866 +2123,885 @@ const ee = /* @__PURE__ */ Zt(Rn), Dn = "_slotStack_6n2wy_5", Oe = {
1644
2123
  "row_column__align-center": "_row_column__align-center_1bqj4_123",
1645
2124
  "row_column__align-stretch": "_row_column__align-stretch_1bqj4_126",
1646
2125
  "row_column__align-baseline": "_row_column__align-baseline_1bqj4_129"
1647
- }, is = (e) => {
2126
+ }, Ms = (e) => {
1648
2127
  const {
1649
2128
  userFlow: t,
1650
- pageId: a,
1651
- columnWidth: s,
1652
- columns: c,
1653
- gap: i = "md",
1654
- justifyContent: l = "start",
2129
+ pageId: s,
2130
+ columnWidth: r,
2131
+ columns: i,
2132
+ gap: l = "md",
2133
+ justifyContent: c = "start",
1655
2134
  alignItems: n = "stretch"
1656
- } = e, d = Array.isArray(c) ? c.map((r, u) => {
1657
- const f = `col_${u}`, _ = `col_${u}`;
1658
- if (Array.isArray(r))
2135
+ } = e, d = Array.isArray(i) ? i.map((a, u) => {
2136
+ const h = `col_${u}`, _ = `col_${u}`;
2137
+ if (Array.isArray(a))
1659
2138
  return {
1660
2139
  gap: "md",
1661
2140
  justifyContent: "start",
1662
2141
  alignItems: "start",
1663
- items: r,
1664
- hash: f,
2142
+ items: a,
2143
+ hash: h,
1665
2144
  responseKey: _
1666
2145
  };
1667
- const h = r;
2146
+ const f = a;
1668
2147
  return {
1669
- gap: (h == null ? void 0 : h.gap) ?? "md",
1670
- justifyContent: (h == null ? void 0 : h.justifyContent) ?? "start",
1671
- alignItems: (h == null ? void 0 : h.alignItems) ?? "start",
1672
- items: (h == null ? void 0 : h.items) ?? [],
1673
- hash: (h == null ? void 0 : h.hash) ?? f,
1674
- responseKey: (h == null ? void 0 : h.responseKey) ?? _
2148
+ gap: (f == null ? void 0 : f.gap) ?? "md",
2149
+ justifyContent: (f == null ? void 0 : f.justifyContent) ?? "start",
2150
+ alignItems: (f == null ? void 0 : f.alignItems) ?? "start",
2151
+ items: (f == null ? void 0 : f.items) ?? [],
2152
+ hash: (f == null ? void 0 : f.hash) ?? h,
2153
+ responseKey: (f == null ? void 0 : f.responseKey) ?? _
1675
2154
  };
1676
2155
  }) : [];
1677
2156
  return d.length === 0 ? null : /* @__PURE__ */ o.jsx(
1678
2157
  "div",
1679
2158
  {
1680
- className: ee(
1681
- J.row,
1682
- J[`row__gap-${i}`],
1683
- J[`row__justify-${l}`],
1684
- J[`row__align-${n}`]
2159
+ className: F(
2160
+ X.row,
2161
+ X[`row__gap-${l}`],
2162
+ X[`row__justify-${c}`],
2163
+ X[`row__align-${n}`]
1685
2164
  ),
1686
- children: d == null ? void 0 : d.map((r, u) => {
1687
- const f = (s == null ? void 0 : s[u]) || `${100 / d.length}%`, _ = E(t, a, r.items);
2165
+ children: d == null ? void 0 : d.map((a, u) => {
2166
+ const h = (r == null ? void 0 : r[u]) || `${100 / d.length}%`, _ = O(t, s, a.items);
1688
2167
  return !_ || _.length === 0 ? null : /* @__PURE__ */ o.jsx(
1689
2168
  "div",
1690
2169
  {
1691
- className: ee(
1692
- J.row_column,
1693
- J[`row_column__gap-${r.gap}`],
1694
- J[`row_column__justify-${r.justifyContent}`],
1695
- J[`row_column__align-${r.alignItems}`]
2170
+ className: F(
2171
+ X.row_column,
2172
+ X[`row_column__gap-${a.gap}`],
2173
+ X[`row_column__justify-${a.justifyContent}`],
2174
+ X[`row_column__align-${a.alignItems}`]
1696
2175
  ),
1697
- style: { width: f },
2176
+ style: { width: h },
1698
2177
  children: _
1699
2178
  },
1700
- r.hash || u
2179
+ a.hash || u
1701
2180
  );
1702
2181
  })
1703
2182
  }
1704
2183
  );
1705
2184
  };
1706
- function Ve({
2185
+ function Ze({
1707
2186
  userFlow: e,
1708
2187
  pageId: t,
1709
- responseKey: a,
1710
- actionType: s,
1711
- getNextUI: c,
1712
- isMulti: i = !1,
1713
- debounceMs: l
2188
+ responseKey: s,
2189
+ actionType: r,
2190
+ getNextUI: i,
2191
+ isMulti: l = !1,
2192
+ debounceMs: c
1714
2193
  }) {
1715
- const n = Fe(null);
2194
+ const n = Me(null);
1716
2195
  z(() => () => {
1717
2196
  n.current !== null && (clearTimeout(n.current), n.current = null);
1718
2197
  }, []);
1719
2198
  const d = R(
1720
2199
  async (u) => {
1721
- var h;
1722
- const f = {
1723
- ...(h = v.getState()[e]) == null ? void 0 : h.entries
2200
+ var f;
2201
+ const h = {
2202
+ ...(f = v.getState()[e]) == null ? void 0 : f.entries
1724
2203
  };
1725
- if (u ? (f[a] = u, O(e, f)) : (delete f[a], Xt(e, a)), s && (s === "GO_TO_NEXT_UI" || s === "GO_TO_NEXT_UI_WITHOUT_LOADING"))
2204
+ if (u ? (h[s] = u, q(e, h)) : (delete h[s], rn(e, s)), r && (r === "GO_TO_NEXT_UI" || r === "GO_TO_NEXT_UI_WITHOUT_LOADING"))
1726
2205
  try {
1727
- const m = await c(
2206
+ const y = await i(
1728
2207
  e,
1729
2208
  t,
1730
- f,
1731
- a,
1732
- s === "GO_TO_NEXT_UI"
2209
+ h,
2210
+ s,
2211
+ r === "GO_TO_NEXT_UI"
1733
2212
  );
1734
- m != null && m.data && q(e, m.data);
1735
- } catch (p) {
1736
- console.error("[useSelectChange] Failed to fetch next UI", p);
2213
+ y != null && y.data && $(e, y.data);
2214
+ } catch (g) {
2215
+ console.error("[useSelectChange] Failed to fetch next UI", g);
1737
2216
  }
1738
2217
  },
1739
- [e, t, a, s, c]
2218
+ [e, t, s, r, i]
1740
2219
  );
1741
2220
  return R(
1742
2221
  (u) => {
1743
- if (!i) {
2222
+ if (!l) {
1744
2223
  d(u);
1745
2224
  return;
1746
2225
  }
1747
- if (l == null) {
2226
+ if (c == null) {
1748
2227
  d(u);
1749
2228
  return;
1750
2229
  }
1751
2230
  n.current !== null && (clearTimeout(n.current), n.current = null), n.current = setTimeout(() => {
1752
2231
  d(u), n.current = null;
1753
- }, l);
2232
+ }, c);
1754
2233
  },
1755
- [i, l, d]
2234
+ [l, c, d]
1756
2235
  );
1757
2236
  }
1758
- const ls = /\{([^}]+)\}/g, ds = (e, t) => {
1759
- var a;
1760
- return t.includes("{") ? t.replace(ls, (s, c) => {
1761
- var l;
1762
- const i = (l = L.query(e, c.trim())) == null ? void 0 : l[0];
1763
- return i != null ? String(i) : "";
1764
- }) : (a = L.query(e, t)) == null ? void 0 : a[0];
1765
- }, _s = (e, t, a, s) => {
1766
- const c = L.query(e, t);
1767
- return (c == null ? void 0 : c.map((i) => {
2237
+ const zs = /\{([^}]+)\}/g, Vs = (e, t) => {
2238
+ var s;
2239
+ return t.includes("{") ? t.replace(zs, (r, i) => {
2240
+ var c;
2241
+ const l = (c = B.query(e, i.trim())) == null ? void 0 : c[0];
2242
+ return l != null ? String(l) : "";
2243
+ }) : (s = B.query(e, t)) == null ? void 0 : s[0];
2244
+ }, Js = (e, t, s, r) => {
2245
+ const i = B.query(e, t);
2246
+ return (i == null ? void 0 : i.map((l) => {
1768
2247
  var d;
1769
- const l = ds(i, a), n = s ? (d = L.query(i, s)) == null ? void 0 : d[0] : i;
1770
- return { label: l, value: n };
2248
+ const c = Vs(l, s), n = r ? (d = B.query(l, r)) == null ? void 0 : d[0] : l;
2249
+ return { label: c, value: n };
1771
2250
  })) ?? [];
1772
- }, us = (e, t, a, s = 10) => {
2251
+ }, Xs = (e, t, s, r = 10) => {
1773
2252
  var n, d;
1774
- let c, i;
1775
- if (a) {
1776
- const r = L.value(e, a.size ?? "$.meta.size") ?? s, u = L.value(e, a.total ?? "$.meta.total") ?? 0;
1777
- c = r, i = u;
2253
+ let i, l;
2254
+ if (s) {
2255
+ const a = B.value(e, s.size ?? "$.meta.size") ?? r, u = B.value(e, s.total ?? "$.meta.total") ?? 0;
2256
+ i = a, l = u;
1778
2257
  } else {
1779
- const r = e == null ? void 0 : e.meta;
1780
- c = (r == null ? void 0 : r.size) ?? ((n = r == null ? void 0 : r.page) == null ? void 0 : n.size) ?? s, i = (r == null ? void 0 : r.total) ?? ((d = r == null ? void 0 : r.page) == null ? void 0 : d.total) ?? 0;
2258
+ const a = e == null ? void 0 : e.meta;
2259
+ i = (a == null ? void 0 : a.size) ?? ((n = a == null ? void 0 : a.page) == null ? void 0 : n.size) ?? r, l = (a == null ? void 0 : a.total) ?? ((d = a == null ? void 0 : a.page) == null ? void 0 : d.total) ?? 0;
1781
2260
  }
1782
- const l = i > 0 ? Math.ceil(i / c) > t : !1;
2261
+ const c = l > 0 ? Math.ceil(l / i) > t : !1;
1783
2262
  return {
1784
- pageSize: c,
1785
- total: i,
1786
- hasMore: l
2263
+ pageSize: i,
2264
+ total: l,
2265
+ hasMore: c
1787
2266
  };
1788
- }, hs = "_selectNotFront_ch3v5_1", He = {
1789
- selectNotFront: hs
1790
- }, fs = ({
2267
+ }, Hs = "_selectNotFront_ch3v5_1", Fe = {
2268
+ selectNotFront: Hs
2269
+ }, Ws = ({
1791
2270
  userFlow: e,
1792
2271
  pageId: t,
1793
- responseKey: a,
1794
- required: s,
1795
- dataSource: c,
1796
- actionType: i,
1797
- dependencies: l,
2272
+ responseKey: s,
2273
+ required: r,
2274
+ dataSource: i,
2275
+ actionType: l,
2276
+ dependencies: c,
1798
2277
  debounceMs: n,
1799
2278
  ...d
1800
2279
  }) => {
1801
- const r = {
2280
+ const a = {
1802
2281
  ...d
1803
- }, { getNextUI: u, fetchDataSource: f } = K(), [_, h] = A((r == null ? void 0 : r.value) ?? ""), { disabled: p } = B(
2282
+ }, { getNextUI: u, fetchDataSource: h } = K(), [_, f] = L((a == null ? void 0 : a.value) ?? ""), { disabled: g } = I(
1804
2283
  e,
1805
- l
1806
- ), m = (r == null ? void 0 : r.disabled) ?? p, y = T(() => s && (r != null && r.label) ? `${r == null ? void 0 : r.label} *` : (r == null ? void 0 : r.label) ?? "", [r == null ? void 0 : r.label, s]), x = T(() => {
1807
- const j = r != null && r.isMulti ? _ : [_], N = {};
2284
+ c
2285
+ ), y = (a == null ? void 0 : a.disabled) ?? g, x = A(() => r && (a != null && a.label) ? `${a == null ? void 0 : a.label} *` : (a == null ? void 0 : a.label) ?? "", [a == null ? void 0 : a.label, r]), m = A(() => {
2286
+ const j = a != null && a.isMulti ? _ : [_], C = {};
1808
2287
  return Array.isArray(j) && j.forEach((w) => {
1809
2288
  if (!w) return;
1810
- const k = JSON.stringify(w.value), D = JSON.stringify(w.label);
1811
- N[k] = w, D in N || (N[D] = w);
1812
- }), N;
1813
- }, [_]), g = Ve({
2289
+ const E = JSON.stringify(w.value), S = JSON.stringify(w.label);
2290
+ C[E] = w, S in C || (C[S] = w);
2291
+ }), C;
2292
+ }, [_]), p = Ze({
1814
2293
  userFlow: e,
1815
2294
  pageId: t,
1816
- responseKey: a,
1817
- actionType: i,
2295
+ responseKey: s,
2296
+ actionType: l,
1818
2297
  getNextUI: u,
1819
- isMulti: r == null ? void 0 : r.isMulti,
2298
+ isMulti: a == null ? void 0 : a.isMulti,
1820
2299
  debounceMs: n
1821
2300
  }), b = (j) => {
1822
- h(j), g(j);
1823
- }, C = async (j, N, { page: w }) => {
2301
+ f(j), p(j);
2302
+ }, N = async (j, C, { page: w }) => {
1824
2303
  const {
1825
- jsonPathLabel: k,
1826
- jsonPathOptions: D,
1827
- jsonPathValue: $,
2304
+ jsonPathLabel: E,
2305
+ jsonPathOptions: S,
2306
+ jsonPathValue: T,
1828
2307
  jsonPathPagination: G
1829
- } = c, U = pe(
1830
- c,
2308
+ } = i, U = Ne(
2309
+ i,
1831
2310
  w,
1832
2311
  j
1833
- ), re = await f(
2312
+ ), J = await h(
1834
2313
  U,
1835
2314
  e,
1836
2315
  !1
1837
- ), oe = re == null ? void 0 : re.data, We = oe ? _s(
1838
- oe,
2316
+ ), D = J == null ? void 0 : J.data, ae = D ? Js(
2317
+ D,
2318
+ S,
2319
+ E,
2320
+ T
2321
+ ) : [], { hasMore: tt } = Xs(
1839
2322
  D,
1840
- k,
1841
- $
1842
- ) : [], { hasMore: Qe } = us(
1843
- oe,
1844
2323
  w,
1845
2324
  G
1846
2325
  );
1847
2326
  return {
1848
- options: We,
1849
- hasMore: Qe,
2327
+ options: ae,
2328
+ hasMore: tt,
1850
2329
  additional: {
1851
2330
  page: j ? 1 : w + 1
1852
2331
  }
1853
2332
  };
1854
2333
  };
1855
2334
  return /* @__PURE__ */ o.jsx(
1856
- _t,
2335
+ wt,
1857
2336
  {
1858
- ...r,
1859
- className: He.selectNotFront,
1860
- label: y,
2337
+ ...a,
2338
+ className: Fe.selectNotFront,
2339
+ label: x,
1861
2340
  value: _,
1862
- disabled: m,
2341
+ disabled: y,
1863
2342
  noOptionsMessage: () => /* @__PURE__ */ o.jsx(o.Fragment, { children: "Sin opciones" }),
1864
- onChange: (j) => !m && b(j),
1865
- loadOptions: C,
2343
+ onChange: (j) => !y && b(j),
2344
+ loadOptions: N,
1866
2345
  additional: { page: 1 },
1867
2346
  isOptionDisabled: (j) => {
1868
- const N = JSON.stringify(j == null ? void 0 : j.value), w = JSON.stringify(j == null ? void 0 : j.label);
1869
- return !!(x != null && x[N]) || !!(x != null && x[w]);
2347
+ const C = JSON.stringify(j == null ? void 0 : j.value), w = JSON.stringify(j == null ? void 0 : j.label);
2348
+ return !!(m != null && m[C]) || !!(m != null && m[w]);
1870
2349
  },
1871
2350
  debounceTimeout: 350
1872
2351
  }
1873
2352
  );
1874
- }, ms = ({
2353
+ }, Qs = ({
1875
2354
  userFlow: e,
1876
2355
  pageId: t,
1877
- responseKey: a,
1878
- dataSource: s,
1879
- required: c,
1880
- actionType: i,
1881
- dependencies: l,
2356
+ responseKey: s,
2357
+ dataSource: r,
2358
+ required: i,
2359
+ actionType: l,
2360
+ dependencies: c,
1882
2361
  debounceMs: n,
1883
2362
  ...d
1884
2363
  }) => {
1885
- const r = {
2364
+ const a = {
1886
2365
  ...d
1887
- }, { getNextUI: u } = K(), [f, _] = A(r.value || ""), { disabled: h } = B(
2366
+ }, { getNextUI: u } = K(), [h, _] = L(a.value || ""), { disabled: f } = I(
1888
2367
  e,
1889
- l
1890
- ), p = (r == null ? void 0 : r.disabled) ?? h, m = T(() => c && (r != null && r.label) ? `${r == null ? void 0 : r.label} *` : (r == null ? void 0 : r.label) ?? "", [r == null ? void 0 : r.label, c]), y = Ve({
2368
+ c
2369
+ ), g = (a == null ? void 0 : a.disabled) ?? f, y = A(() => i && (a != null && a.label) ? `${a == null ? void 0 : a.label} *` : (a == null ? void 0 : a.label) ?? "", [a == null ? void 0 : a.label, i]), x = Ze({
1891
2370
  userFlow: e,
1892
2371
  pageId: t,
1893
- responseKey: a,
1894
- actionType: i,
2372
+ responseKey: s,
2373
+ actionType: l,
1895
2374
  getNextUI: u,
1896
- isMulti: r == null ? void 0 : r.isMulti,
2375
+ isMulti: a == null ? void 0 : a.isMulti,
1897
2376
  debounceMs: n
1898
- }), x = (g) => {
1899
- _(g), y(g);
2377
+ }), m = (p) => {
2378
+ _(p), x(p);
1900
2379
  };
1901
2380
  return /* @__PURE__ */ o.jsx(
1902
- ut,
2381
+ Ct,
1903
2382
  {
1904
- ...r,
1905
- className: He.selectNotFront,
1906
- label: m,
1907
- value: f,
1908
- disabled: p,
1909
- onChange: (g) => !p && x(g)
2383
+ ...a,
2384
+ className: Fe.selectNotFront,
2385
+ label: y,
2386
+ value: h,
2387
+ disabled: g,
2388
+ onChange: (p) => !g && m(p)
1910
2389
  }
1911
2390
  );
1912
- }, ys = (e) => {
2391
+ }, Ys = (e) => {
1913
2392
  const { dataSource: t } = e;
1914
- return t ? /* @__PURE__ */ o.jsx(fs, { ...e }) : /* @__PURE__ */ o.jsx(ms, { ...e });
1915
- }, xs = "_spacing_19hqa_1", gs = "_spacing__xxs_19hqa_1", ps = "_spacing__xs_19hqa_4", bs = "_spacing__sm_19hqa_7", js = "_spacing__md_19hqa_10", ws = "_spacing__lg_19hqa_13", Cs = "_spacing__xl_19hqa_16", Ns = "_spacing__xxl_19hqa_19", vs = "_spacing__xxxl_19hqa_22", De = {
1916
- spacing: xs,
1917
- spacing__xxs: gs,
1918
- spacing__xs: ps,
1919
- spacing__sm: bs,
1920
- spacing__md: js,
1921
- spacing__lg: ws,
1922
- spacing__xl: Cs,
1923
- spacing__xxl: Ns,
1924
- spacing__xxxl: vs
1925
- }, Es = (e) => {
1926
- const { size: t } = e, a = ee(De.spacing, De[`spacing__${t}`]);
1927
- return /* @__PURE__ */ o.jsx("div", { className: a });
1928
- }, Ss = (e) => {
2393
+ return t ? /* @__PURE__ */ o.jsx(Ws, { ...e }) : /* @__PURE__ */ o.jsx(Qs, { ...e });
2394
+ }, Zs = "_spacing_19hqa_1", Fs = "_spacing__xxs_19hqa_1", Ps = "_spacing__xs_19hqa_4", ea = "_spacing__sm_19hqa_7", ta = "_spacing__md_19hqa_10", na = "_spacing__lg_19hqa_13", sa = "_spacing__xl_19hqa_16", aa = "_spacing__xxl_19hqa_19", ra = "_spacing__xxxl_19hqa_22", Ke = {
2395
+ spacing: Zs,
2396
+ spacing__xxs: Fs,
2397
+ spacing__xs: Ps,
2398
+ spacing__sm: ea,
2399
+ spacing__md: ta,
2400
+ spacing__lg: na,
2401
+ spacing__xl: sa,
2402
+ spacing__xxl: aa,
2403
+ spacing__xxxl: ra
2404
+ }, oa = (e) => {
2405
+ const { size: t } = e, s = F(Ke.spacing, Ke[`spacing__${t}`]);
2406
+ return /* @__PURE__ */ o.jsx("div", { className: s });
2407
+ }, ca = (e) => {
1929
2408
  const {
1930
2409
  userFlow: t,
1931
- pageId: a,
1932
- responseKey: s,
1933
- actionType: c,
1934
- label: i,
1935
- value: l,
2410
+ pageId: s,
2411
+ responseKey: r,
2412
+ actionType: i,
2413
+ label: l,
2414
+ value: c,
1936
2415
  required: n,
1937
2416
  dependencies: d,
1938
- ...r
2417
+ ...a
1939
2418
  } = e, u = {
1940
- ...r
1941
- }, { getNextUI: f } = K(), [_, h] = A(l || !1), { disabled: p } = B(
2419
+ ...a
2420
+ }, { getNextUI: h } = K(), [_, f] = L(c || !1), { disabled: g } = I(
1942
2421
  t,
1943
2422
  d
1944
- ), m = (u == null ? void 0 : u.disabled) ?? p, y = T(() => n && i ? `${i} *` : i ?? "", [i, n]), x = R(async () => {
1945
- var g;
2423
+ ), y = (u == null ? void 0 : u.disabled) ?? g, x = A(() => n && l ? `${l} *` : l ?? "", [l, n]), m = R(async () => {
2424
+ var p;
1946
2425
  try {
1947
2426
  const b = !_;
1948
- h(b);
1949
- const C = {
1950
- ...(g = v.getState()[t]) == null ? void 0 : g.entries,
1951
- [s]: b
2427
+ f(b);
2428
+ const N = {
2429
+ ...(p = v.getState()[t]) == null ? void 0 : p.entries,
2430
+ [r]: b
1952
2431
  };
1953
- switch (O(t, C), c) {
2432
+ switch (q(t, N), i) {
1954
2433
  case "GO_TO_NEXT_UI":
1955
- const j = await f(
2434
+ case "GO_TO_NEXT_UI_WITHOUT_LOADING": {
2435
+ const C = await h(
1956
2436
  t,
1957
- a,
1958
- C,
1959
- s
2437
+ s,
2438
+ N,
2439
+ r,
2440
+ i === "GO_TO_NEXT_UI"
1960
2441
  );
1961
- j != null && j.data && q(t, j == null ? void 0 : j.data);
2442
+ C != null && C.data && $(t, C == null ? void 0 : C.data);
1962
2443
  break;
2444
+ }
1963
2445
  default:
1964
- console.warn(`Unhandled actionType: ${c}`);
1965
2446
  break;
1966
2447
  }
1967
2448
  } catch (b) {
1968
2449
  console.error("Error in switch action:", b), alert(JSON.stringify(b));
1969
2450
  }
1970
- }, [t, a, s, c, _]);
2451
+ }, [t, s, r, i, _]);
1971
2452
  return /* @__PURE__ */ o.jsx(
1972
- ht,
2453
+ vt,
1973
2454
  {
1974
2455
  ...u,
1975
- label: y,
2456
+ label: x,
1976
2457
  checked: _,
1977
- disabled: m,
1978
- onChange: () => !m && x()
2458
+ disabled: y,
2459
+ onChange: () => !y && m()
1979
2460
  }
1980
2461
  );
1981
- }, ks = "_tableSkeleton_3nr9n_1", Ts = "_tableArrayPills_3nr9n_7", Xe = {
1982
- tableSkeleton: ks,
1983
- tableArrayPills: Ts
1984
- }, $s = ({ values: e }) => {
1985
- const a = e == null ? void 0 : e.slice(0, 4), s = (e == null ? void 0 : e.length) - 4;
1986
- return /* @__PURE__ */ o.jsxs("div", { className: Xe.tableArrayPills, children: [
1987
- a.map((c, i) => /* @__PURE__ */ o.jsx(he, { children: String(c) }, i)),
1988
- s > 0 && /* @__PURE__ */ o.jsxs(he, { outlined: !0, children: [
2462
+ }, ia = "_tableSkeleton_3nr9n_1", la = "_tableArrayPills_3nr9n_7", Pe = {
2463
+ tableSkeleton: ia,
2464
+ tableArrayPills: la
2465
+ }, da = ({ values: e }) => {
2466
+ const s = e == null ? void 0 : e.slice(0, 4), r = (e == null ? void 0 : e.length) - 4;
2467
+ return /* @__PURE__ */ o.jsxs("div", { className: Pe.tableArrayPills, children: [
2468
+ s.map((i, l) => /* @__PURE__ */ o.jsx(ye, { children: String(i) }, l)),
2469
+ r > 0 && /* @__PURE__ */ o.jsxs(ye, { outlined: !0, children: [
1989
2470
  "+",
1990
- s
2471
+ r
1991
2472
  ] })
1992
2473
  ] });
1993
- }, As = ({
2474
+ }, _a = ({
1994
2475
  userFlow: e,
1995
2476
  pageId: t,
1996
- tableResponseKey: a,
1997
- component: s,
1998
- rowData: c
2477
+ tableResponseKey: s,
2478
+ component: r,
2479
+ rowData: i
1999
2480
  }) => {
2000
- const { getNextUI: i, fetchAndGetNextUI: l, fetchDataSource: n } = K(), d = E(e, t, [
2001
- { ...s }
2002
- ]), r = (d == null ? void 0 : d[0]) || null;
2003
- if (!r) return null;
2481
+ const { getNextUI: l, fetchAndGetNextUI: c, fetchDataSource: n } = K(), d = O(e, t, [
2482
+ { ...r }
2483
+ ]), a = (d == null ? void 0 : d[0]) || null;
2484
+ if (!a) return null;
2004
2485
  const {
2005
2486
  actionType: u,
2006
- responseKey: f,
2487
+ responseKey: h,
2007
2488
  dataSource: _
2008
- } = r.props, h = R(async () => {
2009
- var p, m, y;
2489
+ } = a.props, f = R(async () => {
2490
+ var g, y, x;
2010
2491
  try {
2011
- const x = {
2012
- ...(p = v.getState()[e]) == null ? void 0 : p.entries,
2013
- [f]: { status: 200 },
2014
- [a]: [{ ...c }]
2492
+ const m = {
2493
+ ...(g = v.getState()[e]) == null ? void 0 : g.entries,
2494
+ [h]: { status: 200 },
2495
+ [s]: [{ ...i }]
2015
2496
  };
2016
- switch (O(e, x), u) {
2497
+ switch (q(e, m), u) {
2017
2498
  case "GO_TO_NEXT_UI": {
2018
- const g = await i(
2499
+ const p = await l(
2019
2500
  e,
2020
2501
  t,
2021
- x,
2022
- f
2502
+ m,
2503
+ h
2023
2504
  );
2024
- g != null && g.data && q(e, g == null ? void 0 : g.data);
2505
+ p != null && p.data && $(e, p == null ? void 0 : p.data);
2025
2506
  break;
2026
2507
  }
2027
2508
  case "FETCH_AND_GO_TO_NEXT_UI": {
2028
- const g = await l(
2509
+ const p = await c(
2029
2510
  e,
2030
2511
  t,
2031
- x,
2032
- f,
2512
+ m,
2513
+ h,
2033
2514
  _
2034
2515
  );
2035
- g != null && g.data && q(e, g == null ? void 0 : g.data);
2516
+ p != null && p.data && $(e, p == null ? void 0 : p.data);
2036
2517
  break;
2037
2518
  }
2038
2519
  case "GET_DATA_SOURCE": {
2039
- const g = await i(
2520
+ const p = await l(
2040
2521
  e,
2041
2522
  t,
2042
- x,
2043
- f
2044
- ), b = (m = g == null ? void 0 : g.data) == null ? void 0 : m.content;
2523
+ m,
2524
+ h
2525
+ ), b = (y = p == null ? void 0 : p.data) == null ? void 0 : y.content;
2045
2526
  if ((b == null ? void 0 : b.type) !== "fetch") break;
2046
- const C = b == null ? void 0 : b.dataSource, j = await n(
2047
- C,
2527
+ const N = b == null ? void 0 : b.dataSource, j = await n(
2528
+ N,
2048
2529
  e,
2049
2530
  // Avoid to handle loading state until all the requests are done
2050
2531
  !1
2051
- ), N = {
2052
- ...(y = v.getState()[e]) == null ? void 0 : y.entries,
2053
- [f]: {
2532
+ ), C = {
2533
+ ...(x = v.getState()[e]) == null ? void 0 : x.entries,
2534
+ [h]: {
2054
2535
  status: j == null ? void 0 : j.status,
2055
2536
  content: j == null ? void 0 : j.data
2056
2537
  }
2057
2538
  };
2058
- O(e, N);
2059
- const w = await i(
2539
+ q(e, C);
2540
+ const w = await l(
2060
2541
  e,
2061
2542
  t,
2062
- N,
2063
- f
2543
+ C,
2544
+ h
2064
2545
  );
2065
- w != null && w.data && q(e, w == null ? void 0 : w.data);
2546
+ w != null && w.data && $(e, w == null ? void 0 : w.data);
2066
2547
  break;
2067
2548
  }
2068
2549
  default:
2069
2550
  console.warn(`Unhandled actionType: ${u}`);
2070
2551
  break;
2071
2552
  }
2072
- } catch (x) {
2073
- alert(JSON.stringify(x));
2553
+ } catch (m) {
2554
+ alert(JSON.stringify(m));
2074
2555
  }
2075
- }, [u, _, t, f, e]);
2076
- return Pe(r, {
2077
- onClick: h
2556
+ }, [u, _, t, h, e]);
2557
+ return at(a, {
2558
+ onClick: f
2078
2559
  });
2079
- }, qs = () => /* @__PURE__ */ o.jsx("div", { className: Xe.tableSkeleton, children: [...Array(10)].map((e, t) => /* @__PURE__ */ o.jsx(
2080
- Me,
2560
+ }, ua = () => /* @__PURE__ */ o.jsx("div", { className: Pe.tableSkeleton, children: [...Array(10)].map((e, t) => /* @__PURE__ */ o.jsx(
2561
+ Ve,
2081
2562
  {
2082
2563
  maxWidth: "100%",
2083
2564
  height: 42,
2084
2565
  radius: 8
2085
2566
  },
2086
2567
  `tableSkeletonBase${t}`
2087
- )) }), Os = ({
2568
+ )) }), ha = ({
2088
2569
  userFlow: e,
2089
2570
  pageId: t,
2090
- responseKey: a,
2091
- component: s,
2092
- dataSource: c,
2093
- rightActions: i,
2094
- ...l
2571
+ responseKey: s,
2572
+ component: r,
2573
+ dataSource: i,
2574
+ rightActions: l,
2575
+ ...c
2095
2576
  }) => {
2096
- var b, C, j;
2097
- const { fetchDataSource: n } = K(), [d, r] = A(!1), [u, f] = A(1), [_, h] = A(null), p = T(() => {
2098
- if (i != null && i.length)
2099
- return i.map((N, w) => ({
2100
- renderContent: (k) => /* @__PURE__ */ o.jsx(
2101
- As,
2577
+ var N, j, C;
2578
+ const { fetchDataSource: n } = K(), [d, a] = L(!1), [u, h] = L(1), [_, f] = L(null), g = Me(
2579
+ /* @__PURE__ */ new Map([[1, null]])
2580
+ ), y = A(() => {
2581
+ if (l != null && l.length)
2582
+ return l.map((w, E) => ({
2583
+ renderContent: (S) => /* @__PURE__ */ o.jsx(
2584
+ _a,
2102
2585
  {
2103
2586
  userFlow: e,
2104
2587
  pageId: t,
2105
- tableResponseKey: a,
2106
- component: N,
2107
- rowData: k
2588
+ tableResponseKey: s,
2589
+ component: w,
2590
+ rowData: S
2108
2591
  },
2109
- `tableRowAction${w}`
2592
+ `tableRowAction${E}`
2110
2593
  )
2111
2594
  }));
2112
- }, [i, e, t]), m = async (N = 1) => {
2595
+ }, [l, e, t]), x = async (w = 1) => {
2596
+ const {
2597
+ mapperData: E,
2598
+ jsonPathData: S,
2599
+ jsonPathPagination: T,
2600
+ jsonPathCursorPagination: G
2601
+ } = i;
2602
+ if (G && w !== 1 && !g.current.has(w)) {
2603
+ h(1), x(1);
2604
+ return;
2605
+ }
2606
+ G && w === 1 && (g.current = /* @__PURE__ */ new Map([[1, null]]));
2113
2607
  try {
2114
- r(!0);
2115
- const { jsonPathData: w, mapperData: k, jsonPathPagination: D } = c, $ = pe(
2116
- c,
2117
- N
2118
- ), G = await n(
2119
- $,
2608
+ a(!0);
2609
+ const U = G ? g.current.get(w) ?? null : null, J = Ne(
2610
+ i,
2611
+ w,
2612
+ void 0,
2613
+ U
2614
+ ), D = await n(
2615
+ J,
2120
2616
  e,
2121
2617
  !1
2122
2618
  );
2123
- h(
2124
- Je(
2125
- G == null ? void 0 : G.data,
2126
- w,
2127
- k,
2128
- D
2619
+ if (f(
2620
+ Ye(
2621
+ D == null ? void 0 : D.data,
2622
+ S,
2623
+ E,
2624
+ T
2129
2625
  )
2130
- ), r(!1);
2131
- } catch (w) {
2132
- alert(JSON.stringify(w)), r(!1);
2626
+ ), G) {
2627
+ const ae = ts(
2628
+ D == null ? void 0 : D.data,
2629
+ G
2630
+ );
2631
+ ae && g.current.set(w + 1, ae);
2632
+ }
2633
+ a(!1);
2634
+ } catch (U) {
2635
+ console.error("[TableNotFront] fetchData:", U), a(!1);
2133
2636
  }
2134
- }, y = (N) => {
2135
- f(N), m(N);
2637
+ }, m = (w) => {
2638
+ h(w), x(w);
2136
2639
  };
2137
2640
  z(() => {
2138
- m();
2641
+ x();
2139
2642
  }, []);
2140
- const x = T(() => !(_ != null && _.items) || !(l != null && l.columns) ? l == null ? void 0 : l.columns : l.columns.map((N) => {
2141
- var k;
2142
- return ((k = _ == null ? void 0 : _.items) == null ? void 0 : k.some(
2143
- (D) => Array.isArray(N != null && N.accessor ? D[N == null ? void 0 : N.accessor] : void 0)
2643
+ const p = A(() => !(_ != null && _.items) || !(c != null && c.columns) ? c == null ? void 0 : c.columns : c.columns.map((w) => {
2644
+ var S;
2645
+ return ((S = _ == null ? void 0 : _.items) == null ? void 0 : S.some(
2646
+ (T) => Array.isArray(w != null && w.accessor ? T[w == null ? void 0 : w.accessor] : void 0)
2144
2647
  )) ? {
2145
- ...N,
2146
- renderCell: (D) => {
2147
- const $ = N.accessor ? D[N.accessor] : void 0;
2148
- return Array.isArray($) ? /* @__PURE__ */ o.jsx($s, { values: $ }) : $ ?? "";
2648
+ ...w,
2649
+ renderCell: (T) => {
2650
+ const G = w.accessor ? T[w.accessor] : void 0;
2651
+ return Array.isArray(G) ? /* @__PURE__ */ o.jsx(da, { values: G }) : G ?? "";
2149
2652
  }
2150
- } : N;
2151
- }), [_ == null ? void 0 : _.items, l == null ? void 0 : l.columns]), g = {
2152
- ...l,
2653
+ } : w;
2654
+ }), [_ == null ? void 0 : _.items, c == null ? void 0 : c.columns]), b = {
2655
+ ...c,
2153
2656
  data: _ == null ? void 0 : _.items,
2154
- columns: x,
2155
- rightActions: p
2657
+ columns: p,
2658
+ rightActions: y
2156
2659
  };
2157
- return /* @__PURE__ */ o.jsx(o.Fragment, { children: d ? /* @__PURE__ */ o.jsx(qs, {}) : _ && ((b = _ == null ? void 0 : _.items) == null ? void 0 : b.length) > 0 ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
2158
- /* @__PURE__ */ o.jsx(ft, { ...g }),
2159
- (_ == null ? void 0 : _.pagination) && ((C = _ == null ? void 0 : _.pagination) == null ? void 0 : C.totalPages) > 1 && /* @__PURE__ */ o.jsx(
2160
- mt,
2660
+ return /* @__PURE__ */ o.jsx(o.Fragment, { children: d ? /* @__PURE__ */ o.jsx(ua, {}) : _ && ((N = _ == null ? void 0 : _.items) == null ? void 0 : N.length) > 0 ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
2661
+ /* @__PURE__ */ o.jsx(St, { ...b }),
2662
+ (_ == null ? void 0 : _.pagination) && ((j = _ == null ? void 0 : _.pagination) == null ? void 0 : j.totalPages) > 1 && /* @__PURE__ */ o.jsx(
2663
+ Et,
2161
2664
  {
2162
2665
  classname: { global: "row__end" },
2163
2666
  page: u,
2164
2667
  size: _ == null ? void 0 : _.pagination.size,
2165
- total: (j = _ == null ? void 0 : _.pagination) == null ? void 0 : j.total,
2166
- onChange: y
2668
+ total: (C = _ == null ? void 0 : _.pagination) == null ? void 0 : C.total,
2669
+ onChange: m
2167
2670
  }
2168
2671
  )
2169
- ] }) : /* @__PURE__ */ o.jsx(me, { state: "info", title: "Sin registros", children: "No hay datos disponibles para mostrar en este momento" }) });
2170
- }, Rs = "_tabsPanel_kvslb_1", Ds = {
2171
- tabsPanel: Rs
2172
- }, Ls = ({ userFlow: e, pageId: t, components: a }) => {
2173
- const s = E(e, t, a);
2174
- return s != null && s.length ? /* @__PURE__ */ o.jsx("section", { className: Ds.tabsPanel, children: s.map((c, i) => /* @__PURE__ */ o.jsx(S, { children: c }, `tabs-panel-${i}`)) }) : null;
2175
- }, Is = ({
2672
+ ] }) : /* @__PURE__ */ o.jsx(ge, { state: "info", title: "Sin registros", children: "No hay datos disponibles para mostrar en este momento" }) });
2673
+ }, fa = "_tabsPanel_kvslb_1", ma = {
2674
+ tabsPanel: fa
2675
+ }, ya = ({ userFlow: e, pageId: t, components: s }) => {
2676
+ const r = O(e, t, s);
2677
+ return r != null && r.length ? /* @__PURE__ */ o.jsx("section", { className: ma.tabsPanel, children: r.map((i, l) => /* @__PURE__ */ o.jsx(k, { children: i }, `tabs-panel-${l}`)) }) : null;
2678
+ }, xa = ({
2176
2679
  userFlow: e,
2177
2680
  pageId: t,
2178
- hash: a,
2179
- items: s,
2180
- activeIndex: c,
2181
- className: i,
2182
- responseKey: l
2681
+ hash: s,
2682
+ items: r,
2683
+ activeIndex: i,
2684
+ className: l,
2685
+ responseKey: c
2183
2686
  }) => {
2184
- const n = s.map((r, u) => ({
2185
- label: r.label,
2186
- disabled: r.disabled,
2687
+ const n = r.map((a, u) => ({
2688
+ label: a.label,
2689
+ disabled: a.disabled,
2187
2690
  children: /* @__PURE__ */ o.jsx(
2188
- Ls,
2691
+ ya,
2189
2692
  {
2190
2693
  userFlow: e,
2191
2694
  pageId: t,
2192
- components: r.components
2695
+ components: a.components
2193
2696
  },
2194
- `${a}-tab-${u}`
2697
+ `${s}-tab-${u}`
2195
2698
  )
2196
- })), d = (r) => {
2197
- var f;
2699
+ })), d = (a) => {
2700
+ var h;
2198
2701
  const u = {
2199
- ...(f = v.getState()[e]) == null ? void 0 : f.entries,
2200
- [l]: r
2702
+ ...(h = v.getState()[e]) == null ? void 0 : h.entries,
2703
+ [c]: a
2201
2704
  };
2202
- O(e, u);
2705
+ q(e, u);
2203
2706
  };
2204
2707
  return /* @__PURE__ */ o.jsx(
2205
- yt,
2708
+ Tt,
2206
2709
  {
2207
- className: i,
2208
- activeIndex: c,
2710
+ className: l,
2711
+ activeIndex: i,
2209
2712
  items: n,
2210
2713
  onClick: d
2211
2714
  }
2212
2715
  );
2213
- }, Bs = "_textFieldNotFront_1n8fy_1", Ks = {
2214
- textFieldNotFront: Bs
2215
- }, Ms = (e) => {
2716
+ }, ga = (e) => {
2717
+ const {
2718
+ userFlow: t,
2719
+ pageId: s,
2720
+ component: r,
2721
+ hash: i,
2722
+ responseKey: l,
2723
+ required: c,
2724
+ dependencies: n,
2725
+ ...d
2726
+ } = e, a = {
2727
+ ...d
2728
+ }, [u, h] = L((a == null ? void 0 : a.value) ?? ""), { disabled: _ } = I(
2729
+ t,
2730
+ n
2731
+ ), f = (a == null ? void 0 : a.disabled) ?? _, g = A(() => c && (a != null && a.label) ? `${a.label} *` : (a == null ? void 0 : a.label) ?? "", [a == null ? void 0 : a.label, c]), y = (x) => {
2732
+ var p;
2733
+ const m = (p = x == null ? void 0 : x.target) == null ? void 0 : p.value;
2734
+ h(m), q(t, { [l]: m });
2735
+ };
2736
+ return z(() => {
2737
+ h((a == null ? void 0 : a.value) ?? "");
2738
+ }, [a == null ? void 0 : a.value]), /* @__PURE__ */ o.jsx(
2739
+ kt,
2740
+ {
2741
+ ...a,
2742
+ label: g,
2743
+ value: u,
2744
+ disabled: f,
2745
+ onChange: (x) => !f && y(x)
2746
+ }
2747
+ );
2748
+ }, pa = "_textFieldNotFront_1n8fy_1", ba = {
2749
+ textFieldNotFront: pa
2750
+ }, ja = (e) => {
2216
2751
  const {
2217
2752
  userFlow: t,
2218
- pageId: a,
2219
- component: s,
2220
- hash: c,
2221
- responseKey: i,
2222
- required: l,
2753
+ pageId: s,
2754
+ component: r,
2755
+ hash: i,
2756
+ responseKey: l,
2757
+ required: c,
2223
2758
  dependencies: n,
2224
2759
  ...d
2225
- } = e, r = {
2760
+ } = e, a = {
2226
2761
  ...d
2227
- }, [u, f] = A((r == null ? void 0 : r.value) ?? ""), { disabled: _ } = B(
2762
+ }, [u, h] = L((a == null ? void 0 : a.value) ?? ""), { disabled: _ } = I(
2228
2763
  t,
2229
2764
  n
2230
- ), h = (r == null ? void 0 : r.disabled) ?? _, p = T(() => l && (r != null && r.label) ? `${r == null ? void 0 : r.label} *` : (r == null ? void 0 : r.label) ?? "", [r == null ? void 0 : r.label, l]), m = (y) => {
2765
+ ), f = (a == null ? void 0 : a.disabled) ?? _, g = A(() => c && (a != null && a.label) ? `${a == null ? void 0 : a.label} *` : (a == null ? void 0 : a.label) ?? "", [a == null ? void 0 : a.label, c]), y = (x) => {
2231
2766
  var b;
2232
- const x = (b = y == null ? void 0 : y.target) == null ? void 0 : b.value;
2233
- f(x);
2234
- const g = {
2235
- [i]: x
2767
+ const m = (b = x == null ? void 0 : x.target) == null ? void 0 : b.value;
2768
+ h(m);
2769
+ const p = {
2770
+ [l]: m
2236
2771
  };
2237
- O(t, g);
2772
+ q(t, p);
2238
2773
  };
2239
2774
  return z(() => {
2240
- f((r == null ? void 0 : r.value) ?? "");
2241
- }, [r == null ? void 0 : r.value]), /* @__PURE__ */ o.jsx(
2242
- xt,
2775
+ h((a == null ? void 0 : a.value) ?? "");
2776
+ }, [a == null ? void 0 : a.value]), /* @__PURE__ */ o.jsx(
2777
+ Ot,
2243
2778
  {
2244
- ...r,
2245
- className: Ks.textFieldNotFront,
2779
+ ...a,
2780
+ className: ba.textFieldNotFront,
2246
2781
  allowClear: !1,
2247
- label: p,
2782
+ label: g,
2248
2783
  value: u,
2249
- disabled: h,
2250
- onChange: (y) => !h && m(y)
2784
+ disabled: f,
2785
+ onChange: (x) => !f && y(x)
2251
2786
  }
2252
2787
  );
2253
- }, zs = ({
2788
+ }, Na = ({
2254
2789
  userFlow: e,
2255
2790
  pageId: t,
2256
- responseKey: a,
2257
- variant: s,
2258
- content: c,
2259
- actionType: i,
2260
- redirectUrl: l
2791
+ responseKey: s,
2792
+ variant: r,
2793
+ content: i,
2794
+ actionType: l,
2795
+ redirectUrl: c
2261
2796
  }) => {
2262
2797
  const n = R(async () => {
2263
- xe(e);
2798
+ be(e);
2264
2799
  try {
2265
- switch (i) {
2800
+ switch (l) {
2266
2801
  case "AUTOCLOSE_AND_REDIRECT":
2267
- window.location.href = l;
2802
+ window.location.href = c;
2268
2803
  break;
2269
2804
  default:
2270
- console.warn(`Unhandled actionType: ${i}`);
2805
+ console.warn(`Unhandled actionType: ${l}`);
2271
2806
  break;
2272
2807
  }
2273
2808
  } catch (d) {
2274
2809
  console.error("Error in toast action:", d), alert(JSON.stringify(d));
2275
2810
  }
2276
- }, [i, t, a, e, l]);
2811
+ }, [l, t, s, e, c]);
2277
2812
  return z(() => {
2278
2813
  ({
2279
- info: Q.info,
2280
- error: Q.error,
2281
- success: Q.success,
2282
- warning: Q.warning
2283
- }[s] || Q.info)(c, {
2284
- autoClose: i ? !1 : 4e3,
2814
+ info: ee.info,
2815
+ error: ee.error,
2816
+ success: ee.success,
2817
+ warning: ee.warning
2818
+ }[r] || ee.info)(i, {
2819
+ autoClose: l ? !1 : 4e3,
2285
2820
  containerId: e,
2286
2821
  onClose: n
2287
2822
  });
2288
2823
  }, [n, e]), null;
2289
- }, Gs = "_accordion_1ri2t_1", Us = "_accordionBody_1ri2t_8", Le = {
2290
- accordion: Gs,
2291
- accordionBody: Us
2292
- }, Js = (e) => {
2824
+ }, wa = "_tooltipNotFront_106iw_1", Ca = "_tooltipNotFront_content_106iw_5", Ge = {
2825
+ tooltipNotFront: wa,
2826
+ tooltipNotFront_content: Ca
2827
+ }, va = (e) => {
2293
2828
  const {
2294
2829
  userFlow: t,
2295
- pageId: a,
2296
- responseKey: s,
2297
- dependencies: c,
2298
- customContent: i,
2299
- actionContent: l,
2300
- components: n,
2301
- ...d
2302
- } = e, { getNextUI: r } = K(), [u, f] = A(
2303
- d.checkboxChecked || !1
2304
- ), { disabled: _ } = B(
2830
+ pageId: s,
2831
+ component: r,
2832
+ hash: i,
2833
+ responseKey: l,
2834
+ content: c,
2835
+ label: n,
2836
+ placement: d,
2837
+ notShowArrow: a,
2838
+ visible: u
2839
+ } = e, h = O(
2305
2840
  t,
2306
- c
2307
- ), h = E(t, a, n), p = l ? E(t, a, l) : void 0, m = i ? E(t, a, i) : void 0, y = R(
2308
- async (b) => {
2309
- var C;
2310
- try {
2311
- const j = b.target.checked;
2312
- f(j);
2313
- const N = {
2314
- ...(C = v.getState()[t]) == null ? void 0 : C.entries,
2315
- [s]: j
2316
- };
2317
- if (O(t, N), d.actionType === "GO_TO_NEXT_UI") {
2318
- const w = await r(
2319
- t,
2320
- a,
2321
- N,
2322
- s
2323
- );
2324
- w != null && w.data && q(t, w == null ? void 0 : w.data);
2325
- }
2326
- } catch (j) {
2327
- console.error("Error in accordion checkbox action:", j), alert(JSON.stringify(j));
2328
- }
2329
- },
2330
- [t, a, s, d.actionType, r]
2331
- ), x = d.disabled || _, g = {
2332
- ...d,
2333
- className: Le.accordion,
2334
- disabled: x,
2335
- checkboxChecked: u,
2336
- onChanceCheckbox: d.hasCheckbox ? y : void 0,
2337
- actionContent: p ? /* @__PURE__ */ o.jsx(o.Fragment, { children: p.map((b, C) => /* @__PURE__ */ o.jsx(S, { children: b }, `accordion-action-${C}`)) }) : void 0,
2338
- customContent: m ? /* @__PURE__ */ o.jsx(o.Fragment, { children: m.map((b, C) => /* @__PURE__ */ o.jsx(S, { children: b }, `accordion-custom-${C}`)) }) : void 0,
2339
- children: h ? /* @__PURE__ */ o.jsx("section", { className: Le.accordionBody, children: h.map((b, C) => /* @__PURE__ */ o.jsx(S, { children: b }, `accordion-child-${C}`)) }) : void 0
2340
- };
2341
- return /* @__PURE__ */ o.jsx(gt, { ...g });
2342
- }, Vs = "_drawer_13pxo_1", Hs = "_drawerBody_13pxo_5", Xs = "_drawerFooter_13pxo_11", ue = {
2343
- drawer: Vs,
2344
- drawerBody: Hs,
2345
- drawerFooter: Xs
2346
- }, Ws = ({
2347
- userFlow: e,
2348
- pageId: t,
2349
- responseKey: a,
2350
- header: s,
2351
- body: c,
2352
- footer: i,
2353
- ...l
2354
- }) => {
2355
- const n = v((m) => {
2356
- var y;
2357
- return (y = m[e]) == null ? void 0 : y.isDrawerOpen;
2358
- }), d = v((m) => {
2359
- var y;
2360
- return (y = m[e]) == null ? void 0 : y.isLoading;
2361
- }), r = n && !d, u = {
2362
- ...l,
2363
- isOpen: r,
2364
- children: null
2365
- }, f = R(() => {
2366
- xe(e), Z(e, !1);
2367
- }, [e]), _ = Array.isArray(s) ? E(e, t, s) : s ? /* @__PURE__ */ o.jsx(Be, { type: "h2", children: s }) : void 0, h = E(e, t, c), p = i ? E(e, t, i) : void 0;
2841
+ s,
2842
+ c != null && c.length ? c : null
2843
+ ), _ = h && h.length > 0 ? /* @__PURE__ */ o.jsx("div", { className: Ge.tooltipNotFront_content, children: h.map((f, g) => /* @__PURE__ */ o.jsx(k, { children: f }, `tooltip-${i}-${g}`)) }) : null;
2368
2844
  return /* @__PURE__ */ o.jsx(
2369
- pt,
2845
+ At,
2370
2846
  {
2371
- ...u,
2372
- className: ue.drawer,
2373
- isOpen: r,
2374
- onClose: f,
2375
- heightGap: 0,
2376
- title: _ ? /* @__PURE__ */ o.jsx(o.Fragment, { children: Array.isArray(_) ? _.map((m, y) => /* @__PURE__ */ o.jsx(S, { children: m }, `drawer-header-${y}`)) : _ }) : void 0,
2377
- children: /* @__PURE__ */ o.jsx("section", { className: ue.drawerBody, children: h.map((m, y) => /* @__PURE__ */ o.jsx(S, { children: m }, `drawer-body-${y}`)) }),
2378
- footer: p ? /* @__PURE__ */ o.jsx("div", { className: ue.drawerFooter, children: p.map((m, y) => /* @__PURE__ */ o.jsx(S, { children: m }, `drawer-footer-${y}`)) }) : void 0
2847
+ className: Ge.tooltipNotFront,
2848
+ label: n,
2849
+ placement: d,
2850
+ notShowArrow: a,
2851
+ visible: u,
2852
+ children: _
2379
2853
  }
2380
2854
  );
2381
2855
  };
2382
- function la({
2856
+ function Ma({
2383
2857
  routes: e,
2384
2858
  renderPage: t,
2385
- renderFallback: a,
2386
- redirectTo: s = "/"
2859
+ renderFallback: s,
2860
+ redirectTo: r = "/"
2387
2861
  }) {
2388
- return /* @__PURE__ */ o.jsxs(Gt, { children: [
2389
- e.map((c) => /* @__PURE__ */ o.jsx(
2390
- Ce,
2862
+ return /* @__PURE__ */ o.jsxs(en, { children: [
2863
+ e.map((i) => /* @__PURE__ */ o.jsx(
2864
+ Ee,
2391
2865
  {
2392
- path: c.path,
2393
- element: c.canAccess ? t(c.sessionName) : (a == null ? void 0 : a()) ?? null
2866
+ path: i.path,
2867
+ element: i.canAccess ? t(i.sessionName) : (s == null ? void 0 : s()) ?? null
2394
2868
  },
2395
- `${c.path}:${c.sessionName}`
2869
+ `${i.path}:${i.sessionName}`
2396
2870
  )),
2397
- /* @__PURE__ */ o.jsx(Ce, { path: "*", element: /* @__PURE__ */ o.jsx(Ut, { to: s, replace: !0 }) })
2871
+ /* @__PURE__ */ o.jsx(Ee, { path: "*", element: /* @__PURE__ */ o.jsx(tn, { to: r, replace: !0 }) })
2398
2872
  ] });
2399
2873
  }
2400
- function da({
2874
+ function za({
2401
2875
  sessionName: e,
2402
2876
  apiConfig: t,
2403
- onResolveComponentProps: a,
2404
- children: s
2877
+ onResolveComponentProps: s,
2878
+ children: r
2405
2879
  }) {
2406
- const c = Qs(
2880
+ const i = Sa(
2407
2881
  e,
2408
2882
  t,
2409
2883
  null,
2410
- a
2884
+ s
2411
2885
  );
2412
2886
  return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
2413
- c,
2414
- s
2887
+ i,
2888
+ r
2415
2889
  ] });
2416
2890
  }
2417
- const Ie = (e, t, a, s, c) => {
2418
- const i = E(
2891
+ const Ue = (e, t, s, r, i) => {
2892
+ const l = O(
2419
2893
  e,
2420
2894
  t,
2421
- (s == null ? void 0 : s.components) || null,
2422
- c
2895
+ (r == null ? void 0 : r.components) || null,
2896
+ i
2423
2897
  );
2424
- switch (a) {
2898
+ switch (s) {
2425
2899
  case "body":
2426
2900
  return /* @__PURE__ */ o.jsx(
2427
- un,
2901
+ $n,
2428
2902
  {
2429
- ...s,
2430
- inputs: i || []
2903
+ ...r,
2904
+ inputs: l || []
2431
2905
  },
2432
- JSON.stringify(s == null ? void 0 : s.components)
2906
+ JSON.stringify(r == null ? void 0 : r.components)
2433
2907
  );
2434
2908
  case "header":
2435
2909
  return /* @__PURE__ */ o.jsx(
2436
- Yn,
2910
+ ks,
2437
2911
  {
2438
- ...s,
2439
- components: i || []
2912
+ ...r,
2913
+ components: l || []
2440
2914
  },
2441
- JSON.stringify(s == null ? void 0 : s.components)
2915
+ JSON.stringify(r == null ? void 0 : r.components)
2442
2916
  );
2443
2917
  default:
2444
2918
  return null;
2445
2919
  }
2446
- }, Qs = (e, t, a, s) => {
2447
- var _, h, p;
2448
- const [c, i] = A(!1), l = v((m) => m), n = (_ = l[e]) == null ? void 0 : _.currentPageId;
2920
+ }, Sa = (e, t, s, r) => {
2921
+ var _, f, g;
2922
+ const [i, l] = L(!1), c = v((y) => y), n = (_ = c[e]) == null ? void 0 : _.currentPageId;
2449
2923
  z(() => {
2450
2924
  if (typeof window > "u") return;
2451
- const m = new URL(window.location.href), y = m.searchParams.get("sessionId");
2452
- y && (sessionStorage.setItem("sessionId", y), m.searchParams.delete("sessionId"), window.history.replaceState({}, "", m.toString()));
2925
+ const y = new URL(window.location.href), x = y.searchParams.get("sessionId");
2926
+ x && (sessionStorage.setItem("sessionId", x), y.searchParams.delete("sessionId"), window.history.replaceState({}, "", y.toString()));
2453
2927
  }, []);
2454
- const d = n ? Ie(
2928
+ const d = n ? Ue(
2455
2929
  e,
2456
2930
  n,
2457
2931
  "header",
2458
- ((h = l[e].pages[n].page) == null ? void 0 : h.header) || null,
2459
- s
2460
- ) : null, r = n ? Ie(
2932
+ ((f = c[e].pages[n].page) == null ? void 0 : f.header) || null,
2933
+ r
2934
+ ) : null, a = n ? Ue(
2461
2935
  e,
2462
2936
  n,
2463
2937
  "body",
2464
- ((p = l[e].pages[n].page) == null ? void 0 : p.body) || null,
2465
- s
2466
- ) : null, u = T(() => {
2467
- var m;
2938
+ ((g = c[e].pages[n].page) == null ? void 0 : g.body) || null,
2939
+ r
2940
+ ) : null, u = A(() => {
2941
+ var y;
2468
2942
  return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
2469
- ((m = l[e]) == null ? void 0 : m.isLoading) && /* @__PURE__ */ o.jsx(bt, {}),
2943
+ ((y = c[e]) == null ? void 0 : y.isLoading) && /* @__PURE__ */ o.jsx($t, {}),
2470
2944
  d,
2471
- r,
2472
- n && /* @__PURE__ */ o.jsx(ts, { userFlow: e, pageId: n }),
2473
- l[e] && /* @__PURE__ */ o.jsx(jt, {})
2945
+ a,
2946
+ n && /* @__PURE__ */ o.jsx(Rs, { userFlow: e, pageId: n }),
2947
+ c[e] && /* @__PURE__ */ o.jsx(qt, {})
2474
2948
  ] });
2475
- }, [d, r, n, e]), f = async () => {
2949
+ }, [d, a, n, e]), h = async () => {
2476
2950
  try {
2477
- const m = await Ue(
2951
+ const y = await Qe(
2478
2952
  t,
2479
2953
  e
2480
- ), y = m == null ? void 0 : m.data, x = y == null ? void 0 : y.content;
2481
- (m == null ? void 0 : m.status) === 200 ? ce(e, t, x, y == null ? void 0 : y.sessionState) : i(!0);
2482
- } catch (m) {
2483
- console.error("[not-page]: API call failed", m), i(!0);
2954
+ ), x = y == null ? void 0 : y.data, m = x == null ? void 0 : x.content;
2955
+ (y == null ? void 0 : y.status) === 200 ? de(e, t, m, x == null ? void 0 : x.sessionState) : l(!0);
2956
+ } catch (y) {
2957
+ console.error("[not-page]: API call failed", y), l(!0);
2484
2958
  }
2485
2959
  };
2486
2960
  return z(() => {
2487
- t != null && t.api && !a && e ? f() : !(t != null && t.api) && a && e || t != null && t.api && a && e ? ce(e, t, a) : (!(t != null && t.api) && !a || !e) && (i(!0), console.error(
2961
+ t != null && t.api && !s && e ? h() : !(t != null && t.api) && s && e || t != null && t.api && s && e ? de(e, t, s) : (!(t != null && t.api) && !s || !e) && (l(!0), console.error(
2488
2962
  "[not-page]: API call failed",
2489
2963
  "not api config",
2490
2964
  "not userFlow"
2491
2965
  ));
2492
- const m = "avocado-theme-mode-changed", y = (x) => {
2493
- const g = x.detail;
2494
- te.setThemeMode(g);
2966
+ const y = "avocado-theme-mode-changed", x = (m) => {
2967
+ const p = m.detail;
2968
+ ne.setThemeMode(p);
2495
2969
  };
2496
- return window.addEventListener(m, y), () => {
2497
- window.removeEventListener(m, y);
2970
+ return window.addEventListener(y, x), () => {
2971
+ window.removeEventListener(y, x);
2498
2972
  };
2499
- }, []), c && console.error("[not-page]: No render page"), u;
2973
+ }, []), i && console.error("[not-page]: No render page"), u;
2500
2974
  };
2975
+ function Ea(e) {
2976
+ const t = e.replace(/\/{2,}/g, "/");
2977
+ return !t || t === "/" ? "/" : t.replace(/\/+$/, "");
2978
+ }
2979
+ function Va(e, t) {
2980
+ return t.requiredPermissions.length === 0 ? !0 : t.requiredPermissions.some(
2981
+ (s) => e.includes(s)
2982
+ );
2983
+ }
2984
+ function et(e, t) {
2985
+ return e === t || e.startsWith(`${t}/`);
2986
+ }
2987
+ function Ja(e, t) {
2988
+ return e.filter((s) => et(s.path, t));
2989
+ }
2990
+ function Xa(e, t) {
2991
+ const s = Ea(e);
2992
+ return et(s, t) ? s.slice(t.length) || "/" : s;
2993
+ }
2501
2994
  export {
2502
- Xn as Chart,
2503
- la as NotFrontDynamicRouter,
2504
- da as NotFrontPage,
2505
- is as Row,
2506
- en as heading,
2507
- tn as text,
2508
- Qs as usePage
2995
+ is as Chart,
2996
+ Ma as NotFrontDynamicRouter,
2997
+ za as NotFrontPage,
2998
+ Ms as Row,
2999
+ hn as heading,
3000
+ Ea as normalizePathname,
3001
+ et as pathBelongsToPrefix,
3002
+ Ja as selectDynamicRoutesUnderPrefix,
3003
+ Xa as stripPrefixFromPathname,
3004
+ fn as text,
3005
+ Sa as usePage,
3006
+ Va as userCanAccessDynamicRoute
2509
3007
  };