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