prometeo-design-system 5.2.2 → 5.3.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.
package/dist/PyrionLayout.es.js
CHANGED
|
@@ -1,252 +1,252 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
-
import { u as
|
|
3
|
-
import { c as
|
|
4
|
-
import { g as
|
|
5
|
-
import Me, { forwardRef as pe, useState as
|
|
2
|
+
import { u as At, g as Tt } from "./useDevice-vwn4GLwK.js";
|
|
3
|
+
import { c as A } from "./cn-B6yFEsav.js";
|
|
4
|
+
import { g as Se } from "./utils-X4-h3cum.js";
|
|
5
|
+
import Me, { forwardRef as pe, useState as J, useRef as T, useEffect as te, memo as M, useContext as tt, createContext as Fe, useCallback as w, Children as It, isValidElement as be, useMemo as ge, useLayoutEffect as rt, useImperativeHandle as ze, use as Et } from "react";
|
|
6
6
|
import { createPortal as Ge } from "react-dom";
|
|
7
7
|
import { useLocation as st, useNavigate as Ot } from "react-router";
|
|
8
|
-
import de from "./Skeleton.es.js";
|
|
9
8
|
import { CloseNavBarDesktop as _t } from "./Icons/CloseNavBarDesktop.es.js";
|
|
10
9
|
import { c as Ue } from "./index-BOQuZ0gG.js";
|
|
11
10
|
import { B as nt } from "./badge-BEx-0Q-K.js";
|
|
12
|
-
import
|
|
13
|
-
import { CrevronLeft as
|
|
14
|
-
import { Scrollable as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
11
|
+
import Pt from "./PlainTooltip.es.js";
|
|
12
|
+
import { CrevronLeft as Mt } from "./Icons/CrevronLeft.es.js";
|
|
13
|
+
import { Scrollable as ke } from "./Scrollable.es.js";
|
|
14
|
+
import xe from "./TicketCard.es.js";
|
|
15
|
+
import ot from "./UserCard.es.js";
|
|
16
|
+
import we from "./Button.es.js";
|
|
18
17
|
import { Logout as Rt } from "./Icons/Logout.es.js";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
18
|
+
import ce from "./Skeleton.es.js";
|
|
19
|
+
import Bt from "./NotificationCard.es.js";
|
|
20
|
+
import { T as Ft, a as zt } from "./TabLinks-DnoWdrdk.js";
|
|
21
|
+
import { Notifications as at } from "./Icons/Notifications.es.js";
|
|
22
22
|
import { Close as We } from "./Icons/Close.es.js";
|
|
23
23
|
import { Help as lt } from "./Icons/Help.es.js";
|
|
24
24
|
import { Settings as Ut } from "./Icons/Settings.es.js";
|
|
25
|
-
const
|
|
26
|
-
const [s,
|
|
27
|
-
|
|
28
|
-
d.current?.style.setProperty("--tab-bg",
|
|
29
|
-
}, [
|
|
30
|
-
const b =
|
|
25
|
+
const Wt = pe((t, r) => {
|
|
26
|
+
const [s, l] = J(t?.currentTabName || t.tabs[0]?.name), d = T(null), { tabs: a = [], className: f, activeColor: c = "var(--neutral-900)", currentSystemId: p, isLoading: x = !1 } = t;
|
|
27
|
+
te(() => {
|
|
28
|
+
d.current?.style.setProperty("--tab-bg", c);
|
|
29
|
+
}, [c]);
|
|
30
|
+
const b = a.find((h) => h?.id === p || h?.name === t?.currentTabName) || a.find((h) => h?.name === s);
|
|
31
31
|
return /* @__PURE__ */ e.jsx(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
ref: r,
|
|
35
|
-
className:
|
|
35
|
+
className: A(
|
|
36
36
|
"select-none",
|
|
37
37
|
"flex flex-col gap-2",
|
|
38
38
|
"bg-neutral-strong-default",
|
|
39
39
|
"h-full w-14 max-w-14 pl-[6px] py-6",
|
|
40
40
|
"border-r border-neutral-default-default",
|
|
41
|
-
|
|
41
|
+
f
|
|
42
42
|
),
|
|
43
|
-
children: (
|
|
44
|
-
(
|
|
45
|
-
if (
|
|
43
|
+
children: (x ? Array(3).fill(null) : a).map(
|
|
44
|
+
(h, v) => {
|
|
45
|
+
if (x) return /* @__PURE__ */ e.jsx(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
|
-
className:
|
|
48
|
+
className: A(
|
|
49
49
|
"bg-[(--tab-bg)]",
|
|
50
50
|
"h-12 w-[50px] z-20",
|
|
51
51
|
"flex items-center pl-[6px] ",
|
|
52
52
|
"rounded-l-[8px]",
|
|
53
53
|
"tabswitch-element relative",
|
|
54
|
-
|
|
54
|
+
v === 0 && "active"
|
|
55
55
|
),
|
|
56
|
-
children: /* @__PURE__ */ e.jsx("div", { className:
|
|
56
|
+
children: /* @__PURE__ */ e.jsx("div", { className: A(
|
|
57
57
|
"size-8 rounded-[4px]",
|
|
58
58
|
"grid place-items-center",
|
|
59
59
|
"tab-thumbnail-icon",
|
|
60
60
|
"bg-transparent text-neutral-default-default",
|
|
61
|
-
|
|
62
|
-
), children: /* @__PURE__ */ e.jsx(
|
|
61
|
+
h?.className
|
|
62
|
+
), children: /* @__PURE__ */ e.jsx(ce, { shape: "rounded", className: "w-full h-full" }) })
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const j = h?.name === b?.name, D = typeof h?.thumbnail == "string" ? /* @__PURE__ */ e.jsx("img", { src: h?.thumbnail, alt: h?.description, className: "aspect-square object-contain rounded", draggable: !1 }) : h?.thumbnail, C = () => {
|
|
66
|
+
h.disabled || (l(h?.name), h.onClick && h.onClick(h?.name));
|
|
67
67
|
};
|
|
68
68
|
return /* @__PURE__ */ e.jsx(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
|
-
className:
|
|
71
|
+
className: A(
|
|
72
72
|
"bg-[(--tab-bg)]",
|
|
73
73
|
"h-12 w-[50px] z-20",
|
|
74
74
|
"flex items-center pl-[6px] ",
|
|
75
75
|
"rounded-l-[8px]",
|
|
76
76
|
"tabswitch-element relative",
|
|
77
|
-
|
|
77
|
+
j && "active"
|
|
78
78
|
),
|
|
79
|
-
onClick:
|
|
79
|
+
onClick: C,
|
|
80
80
|
ref: d,
|
|
81
|
-
children: /* @__PURE__ */ e.jsx("div", { className:
|
|
81
|
+
children: /* @__PURE__ */ e.jsx("div", { className: A(
|
|
82
82
|
"size-8 rounded-[4px]",
|
|
83
83
|
"grid place-items-center",
|
|
84
84
|
"tab-thumbnail-icon",
|
|
85
85
|
"bg-transparent text-neutral-default-default",
|
|
86
|
-
|
|
87
|
-
), children:
|
|
86
|
+
h?.className
|
|
87
|
+
), children: D })
|
|
88
88
|
},
|
|
89
|
-
|
|
89
|
+
h?.name
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
)
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
|
-
}),
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
}), it = M(pe(({ children: t, className: r, context: s, modal: l = !1, closeOnOverlayClick: d = !1, unmountChildrenOnClose: a = !0 }, f) => {
|
|
96
|
+
const c = ve(t, s), p = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: x } = Ht(), { closeSidebar: b } = de(), [h, v] = J(() => a ? x : !0), [j, D] = J(!1);
|
|
97
|
+
return te(() => {
|
|
98
|
+
a && s?.subscribeToSidebarOpen((C) => {
|
|
99
|
+
C ? (D(!1), v(!0)) : D(!0);
|
|
100
100
|
});
|
|
101
|
-
}, [
|
|
102
|
-
const
|
|
103
|
-
if (!
|
|
104
|
-
const
|
|
105
|
-
|
|
101
|
+
}, [a, s]), te(() => {
|
|
102
|
+
const C = f && typeof f == "object" && "current" in f ? f.current : null;
|
|
103
|
+
if (!C) return;
|
|
104
|
+
const y = () => {
|
|
105
|
+
j && (v(!1), D(!1));
|
|
106
106
|
};
|
|
107
|
-
return
|
|
108
|
-
}, [
|
|
109
|
-
|
|
107
|
+
return C.addEventListener("transitionend", y), () => C.removeEventListener("transitionend", y);
|
|
108
|
+
}, [j]), /* @__PURE__ */ e.jsxs("div", { ref: f, className: A("sidebar", p ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": l || void 0, children: [
|
|
109
|
+
l && p && /* @__PURE__ */ e.jsx(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
112
|
-
className:
|
|
113
|
-
onClick: (
|
|
114
|
-
|
|
112
|
+
className: A("navigation-drawer-sidebar-overlay"),
|
|
113
|
+
onClick: (C) => {
|
|
114
|
+
C.preventDefault(), C.stopPropagation(), d && b?.();
|
|
115
115
|
},
|
|
116
116
|
"aria-hidden": "true"
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
119
|
+
/* @__PURE__ */ e.jsxs("div", { className: A("navigation-drawer-sidebar-inner"), children: [
|
|
120
120
|
/* @__PURE__ */ e.jsx("div", { className: "secure-click-margin" }),
|
|
121
|
-
|
|
121
|
+
h && c
|
|
122
122
|
] })
|
|
123
123
|
] });
|
|
124
|
-
})), He =
|
|
124
|
+
})), He = M(pe(({ children: t }, r) => /* @__PURE__ */ e.jsx("div", { ref: r, className: "h-full w-max top-0 left-0 z-50", children: t })));
|
|
125
125
|
He.displayName = "LeftSlot";
|
|
126
|
-
const
|
|
127
|
-
const t =
|
|
126
|
+
const ct = Fe(null), dt = Fe(null), Ht = () => {
|
|
127
|
+
const t = tt(ct);
|
|
128
128
|
if (!t) throw new Error("useDrawerState must be used within NavigationDrawer");
|
|
129
129
|
return t;
|
|
130
|
-
},
|
|
131
|
-
const t =
|
|
130
|
+
}, de = () => {
|
|
131
|
+
const t = tt(dt);
|
|
132
132
|
if (!t) throw new Error("useDrawerActions must be used within NavigationDrawer");
|
|
133
133
|
return t;
|
|
134
|
-
}, ve = (t, r) => typeof t == "function" ? r ? t(r) : null : t,
|
|
134
|
+
}, ve = (t, r) => typeof t == "function" ? r ? t(r) : null : t, ut = "navigation-drawer-collapsed", Qe = () => {
|
|
135
135
|
if (typeof window > "u") return !1;
|
|
136
136
|
try {
|
|
137
|
-
const t = sessionStorage.getItem(
|
|
137
|
+
const t = sessionStorage.getItem(ut);
|
|
138
138
|
return t ? JSON.parse(t) : !1;
|
|
139
139
|
} catch {
|
|
140
140
|
return !1;
|
|
141
141
|
}
|
|
142
|
-
},
|
|
142
|
+
}, Vt = (t) => {
|
|
143
143
|
if (!(typeof window > "u"))
|
|
144
144
|
try {
|
|
145
|
-
sessionStorage.setItem(
|
|
145
|
+
sessionStorage.setItem(ut, JSON.stringify(t));
|
|
146
146
|
} catch {
|
|
147
147
|
}
|
|
148
|
-
},
|
|
149
|
-
const { children: r, classNameDrawer: s, classNameSidebar:
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
}, []),
|
|
153
|
-
const
|
|
154
|
-
if (!
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
}, []),
|
|
159
|
-
(n, { notify:
|
|
160
|
-
const
|
|
161
|
-
|
|
148
|
+
}, qt = (t) => {
|
|
149
|
+
const { children: r, classNameDrawer: s, classNameSidebar: l, disableDragOpen: d, modal: a = !0, closeOnOutsideClick: f = !0 } = t, c = T(null), p = T(null), x = T(null), b = t.outletRef ?? T(null), h = T(null), v = T(Qe()), j = T(!1), D = T("drawer"), C = T(/* @__PURE__ */ new Set()), y = T(/* @__PURE__ */ new Set()), k = T(!1), K = T(null), W = w((n) => {
|
|
150
|
+
const i = x.current;
|
|
151
|
+
i && (i.classList.toggle("collapsed", n), i.classList.toggle("expanded", !n));
|
|
152
|
+
}, []), E = w((n) => {
|
|
153
|
+
const i = h.current;
|
|
154
|
+
if (!i) return;
|
|
155
|
+
i.classList.toggle("collapsed", n), i.classList.toggle("expanded", !n);
|
|
156
|
+
const g = c.current;
|
|
157
|
+
g && (g.classList.toggle("sidebar-collapsed", n), g.classList.toggle("sidebar-expanded", !n));
|
|
158
|
+
}, []), _ = w(
|
|
159
|
+
(n, { notify: i = !0 } = {}) => {
|
|
160
|
+
const g = v.current !== n;
|
|
161
|
+
v.current = n, Vt(n), W(n), i && g && C.current.forEach((L) => L(n));
|
|
162
162
|
},
|
|
163
163
|
[W]
|
|
164
|
-
), S =
|
|
165
|
-
(n, { notify:
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
|
|
164
|
+
), S = w(
|
|
165
|
+
(n, { notify: i = !0 } = {}) => {
|
|
166
|
+
const g = j.current !== n;
|
|
167
|
+
if (j.current = n, E(n), i && g) {
|
|
168
|
+
const L = !n;
|
|
169
|
+
y.current.forEach((B) => B(L));
|
|
170
170
|
}
|
|
171
171
|
},
|
|
172
|
-
[
|
|
173
|
-
), P =
|
|
174
|
-
(n, { notify:
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
const B =
|
|
178
|
-
|
|
172
|
+
[E]
|
|
173
|
+
), P = w(
|
|
174
|
+
(n, { notify: i = !0 } = {}) => {
|
|
175
|
+
const g = D.current, L = g !== n;
|
|
176
|
+
D.current = n, window.matchMedia("(min-width: 768px)").matches || _(n !== "drawer", { notify: i });
|
|
177
|
+
const B = g === "sidebar", U = n === "sidebar";
|
|
178
|
+
i && L && B !== U && y.current.forEach((ne) => ne(U)), S(n !== "sidebar", { notify: i }), _(n !== "drawer", { notify: i });
|
|
179
179
|
},
|
|
180
|
-
[
|
|
181
|
-
),
|
|
182
|
-
const
|
|
183
|
-
if (!
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
180
|
+
[_, S]
|
|
181
|
+
), V = w((n) => {
|
|
182
|
+
const i = c.current;
|
|
183
|
+
if (!i || window.matchMedia("(min-width: 768px)").matches) return;
|
|
184
|
+
k.current = !0;
|
|
185
|
+
const g = b.current?.offsetLeft ?? 0, L = h.current?.offsetLeft ?? g, B = n === "drawer" ? 0 : n === "sidebar" ? L : g;
|
|
186
|
+
K.current = B, i.scrollTo({ left: B, behavior: "smooth" });
|
|
187
187
|
const U = () => {
|
|
188
|
-
|
|
188
|
+
k.current = !1, K.current = null, i.removeEventListener("scrollend", U);
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
i.addEventListener("scrollend", U, { once: !0 }), setTimeout(() => {
|
|
191
|
+
k.current && U();
|
|
192
192
|
}, 1e3);
|
|
193
|
-
}, []),
|
|
194
|
-
const n =
|
|
195
|
-
if (!n || !
|
|
196
|
-
const
|
|
193
|
+
}, []), q = w(() => {
|
|
194
|
+
const n = c.current, i = b.current;
|
|
195
|
+
if (!n || !i || window.matchMedia("(min-width: 768px)").matches) return;
|
|
196
|
+
const g = [
|
|
197
197
|
{ panel: "drawer", offset: 0 },
|
|
198
|
-
{ panel: "outlet", offset:
|
|
199
|
-
],
|
|
200
|
-
|
|
198
|
+
{ panel: "outlet", offset: i.offsetLeft }
|
|
199
|
+
], L = h.current;
|
|
200
|
+
L && g.push({ panel: "sidebar", offset: L.offsetLeft });
|
|
201
201
|
const B = n.scrollLeft;
|
|
202
|
-
let U =
|
|
203
|
-
for (let
|
|
204
|
-
const
|
|
205
|
-
|
|
202
|
+
let U = g[0], ne = Math.abs(B - U.offset);
|
|
203
|
+
for (let oe = 1; oe < g.length; oe++) {
|
|
204
|
+
const fe = Math.abs(B - g[oe].offset);
|
|
205
|
+
fe < ne && (U = g[oe], ne = fe);
|
|
206
206
|
}
|
|
207
207
|
P(U.panel);
|
|
208
208
|
}, [P]);
|
|
209
|
-
|
|
210
|
-
const n =
|
|
209
|
+
te(() => {
|
|
210
|
+
const n = c.current;
|
|
211
211
|
n && (d?.drawer && n.classList.add("disabled-dragopen"), d?.sidebar && n.classList.add("disabled-dragopen-sidebar"));
|
|
212
|
-
}, [d,
|
|
213
|
-
const n =
|
|
214
|
-
if (!n || !
|
|
212
|
+
}, [d, c]), te(() => {
|
|
213
|
+
const n = c.current, i = b.current;
|
|
214
|
+
if (!n || !i) return;
|
|
215
215
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
216
|
-
const
|
|
217
|
-
|
|
216
|
+
const L = Qe();
|
|
217
|
+
_(L, { notify: !1 }), S(!0, { notify: !1 });
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
requestAnimationFrame(() => {
|
|
221
|
-
n.scrollLeft =
|
|
221
|
+
n.scrollLeft = i.offsetLeft, P("outlet");
|
|
222
222
|
});
|
|
223
|
-
}, [P,
|
|
224
|
-
const n =
|
|
223
|
+
}, [P, _, S]), te(() => {
|
|
224
|
+
const n = c.current;
|
|
225
225
|
if (!n || !b.current) return;
|
|
226
|
-
const
|
|
227
|
-
let B = !1, U = 0,
|
|
228
|
-
const
|
|
229
|
-
U =
|
|
230
|
-
},
|
|
231
|
-
const
|
|
232
|
-
return /(auto|scroll|overlay)/.test(
|
|
233
|
-
},
|
|
234
|
-
let
|
|
235
|
-
for (;
|
|
236
|
-
if (
|
|
237
|
-
return
|
|
238
|
-
|
|
226
|
+
const g = n, L = "onscrollend" in g;
|
|
227
|
+
let B = !1, U = 0, ne = 0;
|
|
228
|
+
const oe = (m) => {
|
|
229
|
+
U = m.touches[0].clientX, ne = m.touches[0].clientY;
|
|
230
|
+
}, fe = (m, F) => {
|
|
231
|
+
const H = window.getComputedStyle(m), me = F === "x" ? H.overflowX : H.overflowY;
|
|
232
|
+
return /(auto|scroll|overlay)/.test(me) ? F === "x" ? m.scrollWidth > m.clientWidth : m.scrollHeight > m.clientHeight : !1;
|
|
233
|
+
}, _e = (m, F) => {
|
|
234
|
+
let H = m;
|
|
235
|
+
for (; H && H !== g; ) {
|
|
236
|
+
if (fe(H, F))
|
|
237
|
+
return H;
|
|
238
|
+
H = H.parentElement;
|
|
239
239
|
}
|
|
240
240
|
return null;
|
|
241
|
-
},
|
|
242
|
-
if (!(
|
|
243
|
-
const
|
|
244
|
-
if (Ke &&
|
|
241
|
+
}, Pe = (m, F, H) => H === 0 ? !1 : F === "x" ? H < 0 ? m.scrollLeft + m.clientWidth < m.scrollWidth : m.scrollLeft > 0 : H < 0 ? m.scrollTop + m.clientHeight < m.scrollHeight : m.scrollTop > 0, Ne = (m) => {
|
|
242
|
+
if (!(m.target instanceof HTMLElement)) return;
|
|
243
|
+
const F = m.touches[0].clientX - U, H = m.touches[0].clientY - ne, me = Math.abs(F) > Math.abs(H) ? "x" : "y", Lt = me === "x" ? F : H, Ke = _e(m.target, me);
|
|
244
|
+
if (Ke && Pe(Ke, me, Lt))
|
|
245
245
|
return;
|
|
246
|
-
const Ye =
|
|
247
|
-
if (
|
|
248
|
-
if (
|
|
249
|
-
if (
|
|
246
|
+
const Ye = g.classList.contains("disabled-dragopen"), Xe = g.classList.contains("disabled-dragopen-sidebar"), Je = () => m.cancelable ? (m.preventDefault(), !0) : !1;
|
|
247
|
+
if (me === "x") {
|
|
248
|
+
if (F > 0) {
|
|
249
|
+
if (D.current === "sidebar" && !Xe) {
|
|
250
250
|
B = !0;
|
|
251
251
|
return;
|
|
252
252
|
}
|
|
@@ -254,8 +254,8 @@ const dt = Be(null), ut = Be(null), Wt = () => {
|
|
|
254
254
|
Je();
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
|
-
} else if (
|
|
258
|
-
if (
|
|
257
|
+
} else if (F < 0) {
|
|
258
|
+
if (D.current === "drawer" && !Ye) {
|
|
259
259
|
B = !0;
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
@@ -266,83 +266,83 @@ const dt = Be(null), ut = Be(null), Wt = () => {
|
|
|
266
266
|
}
|
|
267
267
|
B = !0;
|
|
268
268
|
}
|
|
269
|
-
},
|
|
269
|
+
}, ye = () => {
|
|
270
270
|
setTimeout(() => {
|
|
271
|
-
B && (
|
|
271
|
+
B && (q(), B = !1);
|
|
272
272
|
}, 100);
|
|
273
|
-
},
|
|
274
|
-
|
|
273
|
+
}, o = () => {
|
|
274
|
+
k.current || window.matchMedia("(min-width: 768px)").matches || q();
|
|
275
275
|
};
|
|
276
|
-
let
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
276
|
+
let N = null;
|
|
277
|
+
const O = () => {
|
|
278
|
+
k.current || window.matchMedia("(min-width: 768px)").matches || (N && clearTimeout(N), N = setTimeout(() => {
|
|
279
|
+
q();
|
|
280
280
|
}, 50));
|
|
281
281
|
};
|
|
282
|
-
return
|
|
283
|
-
|
|
282
|
+
return g.addEventListener("touchstart", oe, { passive: !1 }), g.addEventListener("touchmove", Ne, { passive: !1 }), g.addEventListener("touchend", ye), L ? g.addEventListener("scrollend", o) : g.addEventListener("scroll", O), () => {
|
|
283
|
+
g.removeEventListener("touchstart", oe), g.removeEventListener("touchmove", Ne), g.removeEventListener("touchend", ye), L ? g.removeEventListener("scrollend", o) : (g.removeEventListener("scroll", O), N && clearTimeout(N));
|
|
284
284
|
};
|
|
285
|
-
}, [
|
|
286
|
-
const
|
|
287
|
-
const n = window.matchMedia("(min-width: 768px)").matches,
|
|
285
|
+
}, [q]);
|
|
286
|
+
const Y = w(() => {
|
|
287
|
+
const n = window.matchMedia("(min-width: 768px)").matches, i = !v.current;
|
|
288
288
|
if (n) {
|
|
289
|
-
|
|
289
|
+
_(i);
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const
|
|
293
|
-
P(
|
|
294
|
-
}, [
|
|
295
|
-
const
|
|
292
|
+
const g = i ? "outlet" : "drawer";
|
|
293
|
+
P(g), V(g);
|
|
294
|
+
}, [V, P, _]), X = w((n) => {
|
|
295
|
+
const i = {
|
|
296
296
|
closeIfMobile: !0,
|
|
297
297
|
closeIfDesktop: !0
|
|
298
|
-
}, { closeIfMobile:
|
|
298
|
+
}, { closeIfMobile: g, closeIfDesktop: L } = { ...i, ...n };
|
|
299
299
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
300
|
-
|
|
300
|
+
L && _(!0);
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
|
-
if (
|
|
304
|
-
P("outlet"),
|
|
303
|
+
if (g) {
|
|
304
|
+
P("outlet"), V("outlet");
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
}, [
|
|
308
|
-
const
|
|
307
|
+
}, [V, P, _]), z = w((n) => {
|
|
308
|
+
const i = {
|
|
309
309
|
openIfMobile: !0,
|
|
310
310
|
openIfDesktop: !0
|
|
311
|
-
}, { openIfMobile:
|
|
312
|
-
if (window.matchMedia("(min-width: 768px)").matches &&
|
|
313
|
-
|
|
311
|
+
}, { openIfMobile: g, openIfDesktop: L } = { ...i, ...n };
|
|
312
|
+
if (window.matchMedia("(min-width: 768px)").matches && L) {
|
|
313
|
+
L && _(!1);
|
|
314
314
|
return;
|
|
315
315
|
}
|
|
316
|
-
if (
|
|
317
|
-
P("drawer"),
|
|
316
|
+
if (g) {
|
|
317
|
+
P("drawer"), V("drawer");
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
320
|
-
}, [
|
|
321
|
-
|
|
322
|
-
toggleCollapse: () =>
|
|
323
|
-
toggleDrawer: () =>
|
|
324
|
-
closeDrawer: (n) =>
|
|
320
|
+
}, [V, P, _]), u = T(null);
|
|
321
|
+
u.current || (u.current = {
|
|
322
|
+
toggleCollapse: () => Y(),
|
|
323
|
+
toggleDrawer: () => Y(),
|
|
324
|
+
closeDrawer: (n) => X(n),
|
|
325
325
|
openDrawer: (n) => z(n),
|
|
326
326
|
getIsCollapsed: () => {
|
|
327
327
|
if (!window.matchMedia("(min-width: 768px)").matches) {
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
const
|
|
331
|
-
return U !==
|
|
328
|
+
const i = c.current, g = b.current;
|
|
329
|
+
if (i && g) {
|
|
330
|
+
const L = i.scrollLeft, B = g.offsetLeft, U = Math.abs(L - B) < Math.abs(L - 0);
|
|
331
|
+
return U !== v.current && (v.current = U, W(U)), U;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
return
|
|
334
|
+
return v.current;
|
|
335
335
|
},
|
|
336
|
-
subscribeToCollapse: (n) => (
|
|
337
|
-
|
|
336
|
+
subscribeToCollapse: (n) => (C.current.add(n), () => {
|
|
337
|
+
C.current.delete(n);
|
|
338
338
|
}),
|
|
339
339
|
openSidebar: () => {
|
|
340
|
-
if (
|
|
340
|
+
if (h.current) {
|
|
341
341
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
342
342
|
S(!1);
|
|
343
343
|
return;
|
|
344
344
|
}
|
|
345
|
-
P("sidebar"),
|
|
345
|
+
P("sidebar"), V("sidebar");
|
|
346
346
|
}
|
|
347
347
|
},
|
|
348
348
|
closeSidebar: (n) => {
|
|
@@ -350,89 +350,91 @@ const dt = Be(null), ut = Be(null), Wt = () => {
|
|
|
350
350
|
S(!0), n?.();
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
|
-
P("outlet"),
|
|
353
|
+
P("outlet"), V("outlet"), n?.();
|
|
354
354
|
},
|
|
355
355
|
toggleSidebar: (n) => {
|
|
356
|
-
if (!
|
|
356
|
+
if (!h.current) return;
|
|
357
357
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
358
|
-
S(!
|
|
358
|
+
S(!j.current);
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
361
|
-
const
|
|
362
|
-
P(
|
|
361
|
+
const i = D.current === "sidebar" ? "outlet" : "sidebar";
|
|
362
|
+
P(i), V(i), n?.(j.current ? "closed" : "open");
|
|
363
363
|
},
|
|
364
|
-
getIsSidebarOpen: () =>
|
|
365
|
-
subscribeToSidebarOpen: (n) => (
|
|
366
|
-
|
|
364
|
+
getIsSidebarOpen: () => h.current ? window.matchMedia("(min-width: 768px)").matches ? !j.current : D.current === "sidebar" : !1,
|
|
365
|
+
subscribeToSidebarOpen: (n) => (y.current.add(n), () => {
|
|
366
|
+
y.current.delete(n);
|
|
367
367
|
}),
|
|
368
368
|
setDrawerDragEnabled: (n) => {
|
|
369
|
-
const
|
|
370
|
-
if (!
|
|
371
|
-
const
|
|
369
|
+
const i = c.current;
|
|
370
|
+
if (!i) return;
|
|
371
|
+
const g = i.scrollLeft;
|
|
372
372
|
if (n) {
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
373
|
+
const L = i.style.scrollBehavior;
|
|
374
|
+
i.style.scrollBehavior = "auto", i.classList.remove("disabled-dragopen"), requestAnimationFrame(() => {
|
|
375
|
+
i.scrollLeft = g, requestAnimationFrame(() => {
|
|
376
|
+
i.style.scrollBehavior = L;
|
|
377
377
|
});
|
|
378
378
|
});
|
|
379
379
|
} else
|
|
380
|
-
|
|
380
|
+
i.classList.add("disabled-dragopen");
|
|
381
381
|
},
|
|
382
382
|
setSidebarDragEnabled: (n) => {
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
383
|
+
const i = c.current;
|
|
384
|
+
if (i)
|
|
385
385
|
if (n) {
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
386
|
+
const g = i.scrollLeft, L = i.style.scrollBehavior;
|
|
387
|
+
i.style.scrollBehavior = "auto", i.classList.remove("disabled-dragopen-sidebar"), requestAnimationFrame(() => {
|
|
388
|
+
i.scrollLeft = g, requestAnimationFrame(() => {
|
|
389
|
+
i.style.scrollBehavior = L;
|
|
390
390
|
});
|
|
391
391
|
});
|
|
392
392
|
} else
|
|
393
|
-
|
|
393
|
+
i.classList.add("disabled-dragopen-sidebar");
|
|
394
394
|
}
|
|
395
395
|
});
|
|
396
|
-
const
|
|
397
|
-
let
|
|
396
|
+
const I = u.current, R = typeof r == "function" ? r(I) : r, $ = It.toArray(R);
|
|
397
|
+
let G = null, ee = null, Q = null;
|
|
398
398
|
const ae = [];
|
|
399
|
-
let
|
|
400
|
-
|
|
399
|
+
let ie = null, ue = null, re = null;
|
|
400
|
+
$.forEach((n) => {
|
|
401
401
|
if (!be(n)) {
|
|
402
402
|
ae.push(n);
|
|
403
403
|
return;
|
|
404
404
|
}
|
|
405
|
-
if (n.type === Ve && !
|
|
406
|
-
|
|
405
|
+
if (n.type === Ve && !G) {
|
|
406
|
+
G = n;
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
|
-
if (n.type ===
|
|
410
|
-
|
|
409
|
+
if (n.type === Ce && !ee) {
|
|
410
|
+
ee = n;
|
|
411
411
|
return;
|
|
412
412
|
}
|
|
413
|
-
if (n.type ===
|
|
414
|
-
|
|
413
|
+
if (n.type === je && !Q) {
|
|
414
|
+
Q = n;
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
if (n.type ===
|
|
418
|
-
|
|
417
|
+
if (n.type === Be && !ie) {
|
|
418
|
+
ie = n;
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
if (n.type ===
|
|
422
|
-
|
|
421
|
+
if (n.type === it && !ue) {
|
|
422
|
+
ue = n;
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
|
-
if (n.type === He && !
|
|
426
|
-
|
|
425
|
+
if (n.type === He && !re) {
|
|
426
|
+
re = n;
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
429
|
ae.push(n);
|
|
430
430
|
});
|
|
431
|
-
const
|
|
432
|
-
isCollapsed:
|
|
433
|
-
isSidebarOpen: !
|
|
434
|
-
}), [
|
|
435
|
-
return
|
|
431
|
+
const De = !!ee, Le = ee ?? (ae.length ? /* @__PURE__ */ e.jsx(Ce, { children: ae }) : null), Ae = De ? ae : [], se = ie ?? (!!ie ? /* @__PURE__ */ e.jsx(Be, { children: R, context: I, modal: a, closeOnOutsideClick: f }) : null), Te = Q ?? (!!Q ? /* @__PURE__ */ e.jsx(je, { children: Q }) : null), Ie = !!ue, le = ue, Ee = !!re, Oe = ge(() => ({
|
|
432
|
+
isCollapsed: v.current,
|
|
433
|
+
isSidebarOpen: !j.current
|
|
434
|
+
}), [v.current, j.current]);
|
|
435
|
+
return rt(() => {
|
|
436
|
+
p.current && x.current?.style.setProperty("--left-slot-width", `${p.current?.offsetWidth}px`);
|
|
437
|
+
}, [p.current]), /* @__PURE__ */ e.jsx(ct.Provider, { value: Oe, children: /* @__PURE__ */ e.jsx(dt.Provider, { value: I, children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-container", ref: c, className: A(
|
|
436
438
|
"w-full h-full max-h-dvh overflow-y-hidden",
|
|
437
439
|
Ie ? "navigation-drawer-with-sidebar" : "navigation-drawer",
|
|
438
440
|
d?.drawer ? "disabled-dragopen" : "",
|
|
@@ -441,38 +443,36 @@ const dt = Be(null), ut = Be(null), Wt = () => {
|
|
|
441
443
|
/* @__PURE__ */ e.jsxs(
|
|
442
444
|
"div",
|
|
443
445
|
{
|
|
444
|
-
ref:
|
|
445
|
-
className:
|
|
446
|
-
"bg-neutral-default-default border-r border-neutral-strong-default h-dvh md:h-screen p-
|
|
447
|
-
|
|
446
|
+
ref: x,
|
|
447
|
+
className: A(
|
|
448
|
+
"bg-neutral-default-default border-r border-neutral-strong-default h-dvh md:h-screen p-0 overflow-hidden drawer flex gap-0",
|
|
449
|
+
v.current ? "collapsed" : "expanded",
|
|
450
|
+
Ee ? "has-left-slot" : "",
|
|
448
451
|
s
|
|
449
452
|
),
|
|
450
|
-
style: {
|
|
451
|
-
paddingLeft: m.current ? `${m.current?.offsetWidth + 16}px` : 16
|
|
452
|
-
},
|
|
453
453
|
children: [
|
|
454
|
-
|
|
455
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 gap-4 overflow-hidden", children: [
|
|
454
|
+
re && be(re) ? Me.cloneElement(re, { ref: p }) : re,
|
|
455
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 gap-4 p-4 overflow-hidden", children: [
|
|
456
456
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
457
|
-
/* @__PURE__ */ e.jsx(
|
|
458
|
-
|
|
457
|
+
/* @__PURE__ */ e.jsx(ft, { onToggleCollapse: Y }),
|
|
458
|
+
G
|
|
459
459
|
] }),
|
|
460
460
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-hidden relative flex-col", children: [
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
] })
|
|
464
|
-
|
|
465
|
-
|
|
461
|
+
Ae,
|
|
462
|
+
Le
|
|
463
|
+
] }),
|
|
464
|
+
Te
|
|
465
|
+
] })
|
|
466
466
|
]
|
|
467
467
|
}
|
|
468
468
|
),
|
|
469
|
-
|
|
469
|
+
se && be(se) ? Me.cloneElement(se, { ref: b, modal: a, closeOnOutsideClick: f }) : se,
|
|
470
470
|
le && be(le) ? Me.cloneElement(le, {
|
|
471
|
-
ref:
|
|
472
|
-
className:
|
|
471
|
+
ref: h,
|
|
472
|
+
className: A("sidebar", le.props?.className, l)
|
|
473
473
|
}) : le
|
|
474
474
|
] }) }) });
|
|
475
|
-
}, Ze =
|
|
475
|
+
}, Ze = M(qt), ft = M(({ onToggleCollapse: t }) => /* @__PURE__ */ e.jsx(
|
|
476
476
|
"button",
|
|
477
477
|
{
|
|
478
478
|
type: "button",
|
|
@@ -481,44 +481,44 @@ const dt = Be(null), ut = Be(null), Wt = () => {
|
|
|
481
481
|
children: /* @__PURE__ */ e.jsx(_t, { size: 32, className: "transition-transform duration-300 p-1" })
|
|
482
482
|
}
|
|
483
483
|
), (t, r) => t.onToggleCollapse === r.onToggleCollapse);
|
|
484
|
-
|
|
485
|
-
const Ve =
|
|
486
|
-
const
|
|
487
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
484
|
+
ft.displayName = "NavigationDrawerCollapseButton";
|
|
485
|
+
const Ve = M(({ children: t, className: r, context: s }) => {
|
|
486
|
+
const l = ve(t, s);
|
|
487
|
+
return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
|
|
488
488
|
});
|
|
489
489
|
Ve.displayName = "NavigationDrawerHeader";
|
|
490
|
-
const
|
|
490
|
+
const Ce = M(({ children: t, className: r, context: s, ...l }) => {
|
|
491
491
|
const d = ve(t, s);
|
|
492
|
-
return /* @__PURE__ */ e.jsx("div", { ...
|
|
492
|
+
return /* @__PURE__ */ e.jsx("div", { ...l, className: A("w-full flex-1 drawer-content select-none", r), children: d });
|
|
493
493
|
});
|
|
494
|
-
|
|
495
|
-
const
|
|
496
|
-
const
|
|
497
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
494
|
+
Ce.displayName = "NavigationDrawerContent";
|
|
495
|
+
const je = M(({ children: t, className: r, context: s }) => {
|
|
496
|
+
const l = ve(t, s);
|
|
497
|
+
return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
|
|
498
498
|
});
|
|
499
|
-
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
const
|
|
504
|
-
d && (
|
|
499
|
+
je.displayName = "NavigationDrawerFooter";
|
|
500
|
+
const mt = M(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: A("w-full border-t border-neutral-strong-default ", t) }));
|
|
501
|
+
mt.displayName = "NavigationDrawerSpacer";
|
|
502
|
+
const Be = M(pe(({ children: t, className: r, context: s, modal: l, closeOnOutsideClick: d }, a) => {
|
|
503
|
+
const f = ve(t, s), c = de(), p = () => {
|
|
504
|
+
d && (c.closeDrawer(), c.closeSidebar());
|
|
505
505
|
};
|
|
506
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-outlet", ref:
|
|
507
|
-
|
|
508
|
-
|
|
506
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-outlet", ref: a, className: A("flex-1 overflow-auto relative h-full max-h-dvh", r), children: [
|
|
507
|
+
l && /* @__PURE__ */ e.jsx("div", { className: "navigation-drawer-backdrop select-none", onClick: p }),
|
|
508
|
+
f
|
|
509
509
|
] }) });
|
|
510
|
-
}), (t, r) => t.children === r.children && t.className === r.className),
|
|
510
|
+
}), (t, r) => t.children === r.children && t.className === r.className), Z = Object.assign(Ze, {
|
|
511
511
|
Root: Ze,
|
|
512
512
|
Header: Ve,
|
|
513
|
-
Content:
|
|
514
|
-
Footer:
|
|
515
|
-
Spacer:
|
|
516
|
-
Outlet:
|
|
517
|
-
Sidebar:
|
|
513
|
+
Content: Ce,
|
|
514
|
+
Footer: je,
|
|
515
|
+
Spacer: mt,
|
|
516
|
+
Outlet: Be,
|
|
517
|
+
Sidebar: it,
|
|
518
518
|
LeftSlot: He
|
|
519
519
|
});
|
|
520
|
-
|
|
521
|
-
const
|
|
520
|
+
Z.displayName = "NavigationDrawer";
|
|
521
|
+
const $t = "hover:bg-neutral-medium-hover", Kt = Ue("", {
|
|
522
522
|
variants: {
|
|
523
523
|
isSelected: {
|
|
524
524
|
true: "bg-neutral-medium-selected ",
|
|
@@ -529,8 +529,8 @@ const qt = "hover:bg-neutral-medium-hover", $t = Ue("", {
|
|
|
529
529
|
false: "cursor-pointer"
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
}),
|
|
533
|
-
|
|
532
|
+
}), Yt = Ue(
|
|
533
|
+
A(
|
|
534
534
|
"select-none line-clamp-1 min-w-max",
|
|
535
535
|
"prometeo-fonts-label-large transition-colors duration-300 ease-out"
|
|
536
536
|
),
|
|
@@ -552,8 +552,8 @@ const qt = "hover:bg-neutral-medium-hover", $t = Ue("", {
|
|
|
552
552
|
{ isSelected: !1, disabled: !1, className: " text-neutral-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" }
|
|
553
553
|
]
|
|
554
554
|
}
|
|
555
|
-
),
|
|
556
|
-
|
|
555
|
+
), Re = Ue(
|
|
556
|
+
A(
|
|
557
557
|
"transition-colors duration-300 ease-out min-w-max"
|
|
558
558
|
),
|
|
559
559
|
{
|
|
@@ -574,141 +574,141 @@ const qt = "hover:bg-neutral-medium-hover", $t = Ue("", {
|
|
|
574
574
|
{ isSelected: !1, disabled: !1, className: "text-neutral-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" }
|
|
575
575
|
]
|
|
576
576
|
}
|
|
577
|
-
),
|
|
577
|
+
), Xt = (t) => {
|
|
578
578
|
const {
|
|
579
579
|
title: r,
|
|
580
580
|
icon: s,
|
|
581
|
-
count:
|
|
581
|
+
count: l,
|
|
582
582
|
className: d,
|
|
583
|
-
isSelected:
|
|
584
|
-
hasSublinks:
|
|
585
|
-
subLinksCollapsed:
|
|
586
|
-
onToggleSublinks:
|
|
587
|
-
as:
|
|
583
|
+
isSelected: a = !1,
|
|
584
|
+
hasSublinks: f,
|
|
585
|
+
subLinksCollapsed: c,
|
|
586
|
+
onToggleSublinks: p,
|
|
587
|
+
as: x = "div",
|
|
588
588
|
onClick: b,
|
|
589
|
-
onAuxClick:
|
|
590
|
-
disabled:
|
|
591
|
-
tooltipText:
|
|
592
|
-
selectorCss:
|
|
593
|
-
} = t,
|
|
594
|
-
|
|
595
|
-
},
|
|
589
|
+
onAuxClick: h,
|
|
590
|
+
disabled: v = !1,
|
|
591
|
+
tooltipText: j,
|
|
592
|
+
selectorCss: D
|
|
593
|
+
} = t, C = (W) => {
|
|
594
|
+
v || b?.(W);
|
|
595
|
+
}, y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
596
596
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center flex-nowrap", children: [
|
|
597
|
-
s && (
|
|
598
|
-
/* @__PURE__ */ e.jsx("label", { className:
|
|
597
|
+
s && (j ? /* @__PURE__ */ e.jsx(Pt, { title: j, disabled: v, children: /* @__PURE__ */ e.jsx(s, { size: 24, className: Re({ disabled: v, isSelected: a }) }) }) : /* @__PURE__ */ e.jsx(s, { size: 24, className: Re({ disabled: v, isSelected: a }) })),
|
|
598
|
+
/* @__PURE__ */ e.jsx("label", { className: Yt({ disabled: v, isSelected: a }), children: r })
|
|
599
599
|
] }),
|
|
600
600
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
601
|
-
|
|
602
|
-
|
|
601
|
+
l && l ? /* @__PURE__ */ e.jsx(nt, { count: l, maxCount: 9, className: "badge", disabled: v }) : "",
|
|
602
|
+
f && /* @__PURE__ */ e.jsx(
|
|
603
603
|
"div",
|
|
604
604
|
{
|
|
605
|
-
className:
|
|
605
|
+
className: A(
|
|
606
606
|
"sublinks-toggle",
|
|
607
607
|
"transition-all duration-200",
|
|
608
608
|
"rounded-full relative grid place-items-center size-6",
|
|
609
|
-
|
|
610
|
-
`${
|
|
609
|
+
a && "text-primary-default-default",
|
|
610
|
+
`${c ? "-rotate-90" : "rotate-90"}`
|
|
611
611
|
),
|
|
612
612
|
children: /* @__PURE__ */ e.jsx(
|
|
613
613
|
"button",
|
|
614
614
|
{
|
|
615
|
-
disabled:
|
|
615
|
+
disabled: v,
|
|
616
616
|
type: "button",
|
|
617
|
-
onClick:
|
|
618
|
-
className:
|
|
619
|
-
children: /* @__PURE__ */ e.jsx(
|
|
617
|
+
onClick: p,
|
|
618
|
+
className: A("absolute cursor-pointer hover:text-primary-default-hover top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-2 z-100 select-none", Re({ disabled: v, isSelected: a }), v && "pointer-events-none"),
|
|
619
|
+
children: /* @__PURE__ */ e.jsx(Mt, {})
|
|
620
620
|
}
|
|
621
621
|
)
|
|
622
622
|
}
|
|
623
623
|
)
|
|
624
624
|
] })
|
|
625
|
-
] }),
|
|
625
|
+
] }), k = A(
|
|
626
626
|
"group navitem",
|
|
627
627
|
"h-12 flex-1 flex items-center p-3 rounded-lg justify-between w-full",
|
|
628
628
|
"transition-all duration-300",
|
|
629
|
-
|
|
630
|
-
|
|
629
|
+
$t,
|
|
630
|
+
Kt({ isSelected: a, disabled: v }),
|
|
631
631
|
d
|
|
632
632
|
);
|
|
633
|
-
if (
|
|
633
|
+
if (x === "a") {
|
|
634
634
|
const W = {
|
|
635
|
-
onClick:
|
|
636
|
-
onAuxClick:
|
|
637
|
-
className:
|
|
635
|
+
onClick: C,
|
|
636
|
+
onAuxClick: h,
|
|
637
|
+
className: k
|
|
638
638
|
};
|
|
639
|
-
return /* @__PURE__ */ e.jsx("a", { ...W, children:
|
|
639
|
+
return /* @__PURE__ */ e.jsx("a", { ...W, children: y });
|
|
640
640
|
}
|
|
641
|
-
if (
|
|
641
|
+
if (x === "button") {
|
|
642
642
|
const W = {
|
|
643
|
-
onClick:
|
|
643
|
+
onClick: C,
|
|
644
644
|
type: "button",
|
|
645
|
-
className:
|
|
646
|
-
id:
|
|
645
|
+
className: k,
|
|
646
|
+
id: D
|
|
647
647
|
};
|
|
648
|
-
return /* @__PURE__ */ e.jsx("button", { ...W, children:
|
|
648
|
+
return /* @__PURE__ */ e.jsx("button", { ...W, children: y });
|
|
649
649
|
}
|
|
650
|
-
const
|
|
651
|
-
onClick:
|
|
652
|
-
className:
|
|
650
|
+
const K = {
|
|
651
|
+
onClick: C,
|
|
652
|
+
className: k
|
|
653
653
|
};
|
|
654
|
-
return /* @__PURE__ */ e.jsx("div", {
|
|
655
|
-
}, qe =
|
|
654
|
+
return /* @__PURE__ */ e.jsx("div", { ...K, children: y });
|
|
655
|
+
}, qe = M(Xt);
|
|
656
656
|
qe.displayName = "NavigationDrawerItemBase";
|
|
657
|
-
const
|
|
658
|
-
const { title: r, icon: s, count:
|
|
659
|
-
return
|
|
657
|
+
const Jt = (t) => {
|
|
658
|
+
const { title: r, icon: s, count: l, className: d, isActive: a, onClick: f, isView: c = !0, disabled: p, tooltipText: x, selectorCss: b } = t;
|
|
659
|
+
return c ? /* @__PURE__ */ e.jsx(
|
|
660
660
|
qe,
|
|
661
661
|
{
|
|
662
662
|
as: "button",
|
|
663
663
|
title: r,
|
|
664
664
|
icon: s,
|
|
665
|
-
count:
|
|
665
|
+
count: l,
|
|
666
666
|
className: d,
|
|
667
|
-
isSelected:
|
|
668
|
-
onClick:
|
|
669
|
-
disabled:
|
|
670
|
-
tooltipText:
|
|
667
|
+
isSelected: a,
|
|
668
|
+
onClick: f,
|
|
669
|
+
disabled: p,
|
|
670
|
+
tooltipText: x,
|
|
671
671
|
selectorCss: b
|
|
672
672
|
}
|
|
673
673
|
) : null;
|
|
674
|
-
},
|
|
675
|
-
|
|
676
|
-
const
|
|
674
|
+
}, pt = M(Jt);
|
|
675
|
+
pt.displayName = "NavigationDrawerActionItem";
|
|
676
|
+
const Gt = ({ actions: t, activeActionId: r, onActionClick: s, className: l }) => /* @__PURE__ */ e.jsx(ke, { className: A("flex flex-col gap-2 w-full ", l), scrollbarProps: { hide: !0 }, persistScroll: "navigation-actions", indicators: {
|
|
677
677
|
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
678
678
|
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
679
679
|
}, children: t?.map((d) => {
|
|
680
|
-
const { id:
|
|
681
|
-
s?.(
|
|
680
|
+
const { id: a, onClick: f, isView: c = !0, payload: p, ...x } = d, b = a === r, h = () => {
|
|
681
|
+
s?.(a, p), f?.();
|
|
682
682
|
};
|
|
683
|
-
return
|
|
684
|
-
|
|
683
|
+
return c ? /* @__PURE__ */ e.jsx(
|
|
684
|
+
pt,
|
|
685
685
|
{
|
|
686
|
-
...
|
|
687
|
-
id:
|
|
686
|
+
...x,
|
|
687
|
+
id: a,
|
|
688
688
|
isActive: b,
|
|
689
|
-
onClick:
|
|
689
|
+
onClick: h
|
|
690
690
|
},
|
|
691
|
-
|
|
691
|
+
a
|
|
692
692
|
) : null;
|
|
693
|
-
}) }),
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
const { className: r, title: s, path:
|
|
697
|
-
d?.(
|
|
698
|
-
}, [
|
|
699
|
-
if (
|
|
700
|
-
if (!
|
|
701
|
-
const
|
|
702
|
-
window.open(
|
|
693
|
+
}) }), ht = M(Gt);
|
|
694
|
+
ht.displayName = "NavigationDrawerActions";
|
|
695
|
+
const Qt = (t) => {
|
|
696
|
+
const { className: r, title: s, path: l, onClick: d, isSelected: a, parentPath: f } = t, { pathname: c } = st(), p = w(() => {
|
|
697
|
+
d?.(l);
|
|
698
|
+
}, [l]), x = w(() => {
|
|
699
|
+
if (l.startsWith("./")) {
|
|
700
|
+
if (!f) return;
|
|
701
|
+
const h = f + l.slice(2);
|
|
702
|
+
window.open(h, "_blank");
|
|
703
703
|
} else
|
|
704
|
-
window.open(
|
|
705
|
-
}, [
|
|
704
|
+
window.open(l, "_blank");
|
|
705
|
+
}, [l]), b = a || l === c;
|
|
706
706
|
return /* @__PURE__ */ e.jsx(
|
|
707
707
|
"a",
|
|
708
708
|
{
|
|
709
|
-
onClick:
|
|
710
|
-
onAuxClick:
|
|
711
|
-
className:
|
|
709
|
+
onClick: p,
|
|
710
|
+
onAuxClick: x,
|
|
711
|
+
className: A(
|
|
712
712
|
"group",
|
|
713
713
|
"transition-all duration-300 ease-in-out cursor-pointer",
|
|
714
714
|
"h-10 w-full rounded-lg py-[11px] px-3",
|
|
@@ -716,135 +716,135 @@ const Gt = (t) => {
|
|
|
716
716
|
b && "bg-neutral-medium-selected hover:bg-neutral-medium-hover active:bg-transparent focus:bg-transparent",
|
|
717
717
|
r
|
|
718
718
|
),
|
|
719
|
-
children: /* @__PURE__ */ e.jsx("p", { className:
|
|
719
|
+
children: /* @__PURE__ */ e.jsx("p", { className: A(
|
|
720
720
|
"prometeo-fonts-label-large text-neutral-medium-default",
|
|
721
721
|
"group-active:text-neutral-default-focused group-focus:text-neutral-default-focused",
|
|
722
722
|
b && "text-primary-default-default group-hover:text-primary-default-hover group-focus:text-primary-default-focused group-active:text-primary-default-focused"
|
|
723
723
|
), children: s })
|
|
724
724
|
}
|
|
725
725
|
);
|
|
726
|
-
},
|
|
727
|
-
|
|
728
|
-
const
|
|
729
|
-
const [s,
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
}) : void 0, [
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
}, []),
|
|
736
|
-
|
|
726
|
+
}, bt = M(Qt);
|
|
727
|
+
bt.displayName = "NavItemSecondary";
|
|
728
|
+
const Zt = pe((t, r) => {
|
|
729
|
+
const [s, l] = J(!0), d = T(null), { path: a, title: f, icon: c, count: p, className: x, isSelected: b = !1, onClick: h, sublinks: v, toggleCollapse: j, getIsCollapsed: D, subscribeToCollapse: C, isView: y = !0, disabled: k, tooltipText: K, selectorCss: W } = t;
|
|
730
|
+
te(() => C ? C((u) => {
|
|
731
|
+
u && l(!0);
|
|
732
|
+
}) : void 0, [C]);
|
|
733
|
+
const E = w(() => {
|
|
734
|
+
l((z) => !z);
|
|
735
|
+
}, []), _ = w((z) => {
|
|
736
|
+
l(z);
|
|
737
737
|
}, []), S = {
|
|
738
|
-
toggle:
|
|
739
|
-
setIsCollapsed:
|
|
738
|
+
toggle: E,
|
|
739
|
+
setIsCollapsed: _,
|
|
740
740
|
get isCollapsed() {
|
|
741
741
|
return s;
|
|
742
742
|
},
|
|
743
743
|
get isDrawerCollapsed() {
|
|
744
|
-
return
|
|
744
|
+
return D?.() ?? !1;
|
|
745
745
|
},
|
|
746
|
-
toggleDrawerCollapse:
|
|
747
|
-
subscribeToCollapse:
|
|
746
|
+
toggleDrawerCollapse: j,
|
|
747
|
+
subscribeToCollapse: C
|
|
748
748
|
};
|
|
749
|
-
ze(r, () => S, [S, s,
|
|
750
|
-
const P =
|
|
751
|
-
const z =
|
|
752
|
-
if (
|
|
753
|
-
|
|
749
|
+
ze(r, () => S, [S, s, D, j]);
|
|
750
|
+
const P = c, V = w(() => {
|
|
751
|
+
const z = D?.() ?? !1;
|
|
752
|
+
if (v && v.length > 0 && z) {
|
|
753
|
+
_(!1), j?.();
|
|
754
754
|
return;
|
|
755
755
|
}
|
|
756
|
-
|
|
757
|
-
}, [
|
|
758
|
-
window.open(
|
|
759
|
-
}, [
|
|
760
|
-
if (!
|
|
761
|
-
if (t.subLinksRender &&
|
|
762
|
-
return t.subLinksRender(
|
|
763
|
-
const z =
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
766
|
-
|
|
756
|
+
h?.(a);
|
|
757
|
+
}, [a, h, v, j, _, D]), q = w(() => {
|
|
758
|
+
window.open(a, "_blank");
|
|
759
|
+
}, [a]), Y = () => {
|
|
760
|
+
if (!v || k) return null;
|
|
761
|
+
if (t.subLinksRender && v)
|
|
762
|
+
return t.subLinksRender(v, S);
|
|
763
|
+
const z = w((u) => {
|
|
764
|
+
if (u.startsWith("./")) {
|
|
765
|
+
const I = a + u.slice(2);
|
|
766
|
+
h?.(I);
|
|
767
767
|
} else
|
|
768
|
-
|
|
769
|
-
}, [
|
|
770
|
-
return
|
|
771
|
-
const
|
|
772
|
-
if (!
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
}, []), /* @__PURE__ */ e.jsx("div", { ref: d, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children:
|
|
776
|
-
},
|
|
777
|
-
z.stopPropagation(), z.preventDefault(),
|
|
768
|
+
h?.(u);
|
|
769
|
+
}, [a]);
|
|
770
|
+
return te(() => {
|
|
771
|
+
const u = d.current;
|
|
772
|
+
if (!u) return;
|
|
773
|
+
const I = u.scrollHeight;
|
|
774
|
+
u.style.setProperty("--sublinks-max-height", `${I}px`);
|
|
775
|
+
}, []), /* @__PURE__ */ e.jsx("div", { ref: d, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: v.map((u) => /* @__PURE__ */ e.jsx(bt, { ...u, onClick: z, parentPath: a }, `${u.title}-${u.path}`)) });
|
|
776
|
+
}, X = (z) => {
|
|
777
|
+
z.stopPropagation(), z.preventDefault(), E();
|
|
778
778
|
};
|
|
779
|
-
return
|
|
779
|
+
return y ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 ", id: W, children: [
|
|
780
780
|
/* @__PURE__ */ e.jsx(
|
|
781
781
|
qe,
|
|
782
782
|
{
|
|
783
783
|
as: "a",
|
|
784
|
-
title:
|
|
784
|
+
title: f,
|
|
785
785
|
icon: P,
|
|
786
|
-
count:
|
|
787
|
-
className:
|
|
786
|
+
count: p,
|
|
787
|
+
className: x,
|
|
788
788
|
isSelected: b,
|
|
789
|
-
hasSublinks: !!
|
|
789
|
+
hasSublinks: !!v,
|
|
790
790
|
subLinksCollapsed: s,
|
|
791
|
-
onToggleSublinks:
|
|
792
|
-
onClick:
|
|
793
|
-
onAuxClick:
|
|
794
|
-
disabled:
|
|
795
|
-
tooltipText:
|
|
791
|
+
onToggleSublinks: X,
|
|
792
|
+
onClick: V,
|
|
793
|
+
onAuxClick: q,
|
|
794
|
+
disabled: k,
|
|
795
|
+
tooltipText: K
|
|
796
796
|
}
|
|
797
797
|
),
|
|
798
|
-
|
|
798
|
+
Y()
|
|
799
799
|
] }) : null;
|
|
800
|
-
}), gt =
|
|
800
|
+
}), gt = M(Zt);
|
|
801
801
|
gt.displayName = "NavigationDrawerLinkItem";
|
|
802
|
-
const
|
|
803
|
-
const { pathname:
|
|
804
|
-
return /* @__PURE__ */ e.jsx(
|
|
802
|
+
const er = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: l, toggleCollapse: d, subscribeToCollapse: a }) => {
|
|
803
|
+
const { pathname: f } = st();
|
|
804
|
+
return /* @__PURE__ */ e.jsx(ke, { className: A("flex flex-col gap-2 w-full ", s), scrollbarProps: { hide: !0 }, persistScroll: "navigation-links", indicators: {
|
|
805
805
|
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
806
806
|
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
807
|
-
}, children: t?.map((
|
|
808
|
-
const
|
|
807
|
+
}, children: t?.map((c, p) => {
|
|
808
|
+
const x = c.isSelected || c.path === f || (c.relatedPaths?.some((b) => f.startsWith(b)) ?? !1) || (c.sublinks?.some((b) => b.path === f) ?? !1);
|
|
809
809
|
return /* @__PURE__ */ e.jsx(
|
|
810
810
|
gt,
|
|
811
811
|
{
|
|
812
|
-
...
|
|
813
|
-
isSelected:
|
|
812
|
+
...c,
|
|
813
|
+
isSelected: x,
|
|
814
814
|
onClick: r,
|
|
815
815
|
toggleCollapse: d,
|
|
816
|
-
getIsCollapsed:
|
|
817
|
-
subscribeToCollapse:
|
|
818
|
-
disabled:
|
|
819
|
-
isView:
|
|
820
|
-
selectorCss:
|
|
816
|
+
getIsCollapsed: l,
|
|
817
|
+
subscribeToCollapse: a,
|
|
818
|
+
disabled: c.disabled,
|
|
819
|
+
isView: c.isView,
|
|
820
|
+
selectorCss: c.selectorCss
|
|
821
821
|
},
|
|
822
|
-
|
|
822
|
+
p
|
|
823
823
|
);
|
|
824
824
|
}) });
|
|
825
|
-
},
|
|
826
|
-
|
|
827
|
-
const
|
|
828
|
-
const { getIsCollapsed:
|
|
825
|
+
}, xt = M(er);
|
|
826
|
+
xt.displayName = "NavigationDrawerNavlinks";
|
|
827
|
+
const wt = M(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId: l, onActionClick: d }) => {
|
|
828
|
+
const { getIsCollapsed: a, toggleCollapse: f, subscribeToCollapse: c } = de();
|
|
829
829
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
830
|
-
/* @__PURE__ */ e.jsx(
|
|
830
|
+
/* @__PURE__ */ e.jsx(Z.Spacer, { className: "pb-3" }),
|
|
831
831
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col overflow-hidden h-full gap-4 relative w-full", children: [
|
|
832
832
|
/* @__PURE__ */ e.jsx(
|
|
833
|
-
|
|
833
|
+
xt,
|
|
834
834
|
{
|
|
835
|
-
getIsCollapsed:
|
|
836
|
-
toggleCollapse:
|
|
837
|
-
subscribeToCollapse:
|
|
835
|
+
getIsCollapsed: a,
|
|
836
|
+
toggleCollapse: f,
|
|
837
|
+
subscribeToCollapse: c,
|
|
838
838
|
navlinks: t,
|
|
839
839
|
handleNavigation: r,
|
|
840
840
|
className: "flex flex-1 min-h-[35dvh] w-full"
|
|
841
841
|
}
|
|
842
842
|
),
|
|
843
843
|
/* @__PURE__ */ e.jsx(
|
|
844
|
-
|
|
844
|
+
ht,
|
|
845
845
|
{
|
|
846
846
|
actions: s,
|
|
847
|
-
activeActionId:
|
|
847
|
+
activeActionId: l,
|
|
848
848
|
onActionClick: d,
|
|
849
849
|
className: "max-h-[30dvh]"
|
|
850
850
|
}
|
|
@@ -852,62 +852,62 @@ const vt = R(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId:
|
|
|
852
852
|
] })
|
|
853
853
|
] });
|
|
854
854
|
}, (t, r) => t.navlinks === r.navlinks && t.handleNavigation === r.handleNavigation && t.allActions === r.allActions && t.activeActionId === r.activeActionId && t.onActionClick === r.onActionClick);
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
const { sessions: r, onSessionClick: s, secondarySlot:
|
|
855
|
+
wt.displayName = "PyrionNavigationDrawer.Content";
|
|
856
|
+
const tr = (t) => {
|
|
857
|
+
const { sessions: r, onSessionClick: s, secondarySlot: l, subImageUrlAccessor: d } = t;
|
|
858
858
|
if (!r || r.length === 0)
|
|
859
859
|
return null;
|
|
860
|
-
const
|
|
861
|
-
s &&
|
|
862
|
-
},
|
|
860
|
+
const a = (p, x) => {
|
|
861
|
+
s && x && s(p, x);
|
|
862
|
+
}, f = (p) => {
|
|
863
863
|
if (!d)
|
|
864
864
|
return;
|
|
865
|
-
const
|
|
866
|
-
if (!
|
|
865
|
+
const x = p.metadata;
|
|
866
|
+
if (!x)
|
|
867
867
|
return;
|
|
868
|
-
const b =
|
|
868
|
+
const b = Se({ metadata: x }, d);
|
|
869
869
|
if (b != null)
|
|
870
870
|
return typeof b == "string" ? b : String(b);
|
|
871
|
-
},
|
|
872
|
-
return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((
|
|
873
|
-
const { auth_id:
|
|
874
|
-
return /* @__PURE__ */ e.jsx(
|
|
875
|
-
|
|
871
|
+
}, c = w((p) => typeof l == "function" ? l(p) : l, [l]);
|
|
872
|
+
return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((p) => {
|
|
873
|
+
const { auth_id: x } = p;
|
|
874
|
+
return /* @__PURE__ */ e.jsx(xe, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(xe.Content, { onClick: () => a(p, t.userOptionsControls), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
|
|
875
|
+
ot,
|
|
876
876
|
{
|
|
877
|
-
name:
|
|
877
|
+
name: x.name,
|
|
878
878
|
avatarSize: "xxs",
|
|
879
|
-
secondarySlot:
|
|
880
|
-
subImageUrl:
|
|
881
|
-
imageUrl:
|
|
879
|
+
secondarySlot: c(p),
|
|
880
|
+
subImageUrl: f(p),
|
|
881
|
+
imageUrl: x.profile_picture,
|
|
882
882
|
className: "pyrion-navigation-drawer-user-card"
|
|
883
883
|
},
|
|
884
|
-
|
|
885
|
-
) }) },
|
|
884
|
+
p.token
|
|
885
|
+
) }) }, p.token);
|
|
886
886
|
}) });
|
|
887
|
-
},
|
|
887
|
+
}, rr = ({
|
|
888
888
|
state: t,
|
|
889
889
|
currentAppSessions: r,
|
|
890
890
|
resolveUserSecondarySlot: s,
|
|
891
|
-
resolveSessionSecondarySlot:
|
|
891
|
+
resolveSessionSecondarySlot: l,
|
|
892
892
|
onSessionClick: d,
|
|
893
|
-
onLogoutClick:
|
|
894
|
-
onProfileClick:
|
|
895
|
-
options:
|
|
896
|
-
currentSystemId:
|
|
897
|
-
userOptionsControls:
|
|
893
|
+
onLogoutClick: a,
|
|
894
|
+
onProfileClick: f,
|
|
895
|
+
options: c,
|
|
896
|
+
currentSystemId: p,
|
|
897
|
+
userOptionsControls: x,
|
|
898
898
|
mobileAppSwitcherControls: b
|
|
899
899
|
}) => {
|
|
900
|
-
const { getIsCollapsed:
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
}, [
|
|
904
|
-
return
|
|
905
|
-
|
|
906
|
-
}), [
|
|
907
|
-
/* @__PURE__ */ e.jsx(
|
|
908
|
-
/* @__PURE__ */ e.jsxs(
|
|
909
|
-
/* @__PURE__ */ e.jsx(
|
|
910
|
-
|
|
900
|
+
const { getIsCollapsed: h, toggleCollapse: v, subscribeToCollapse: j } = de(), D = w(() => {
|
|
901
|
+
const C = h();
|
|
902
|
+
C ? (v(), x.current?.open()) : f?.(C);
|
|
903
|
+
}, [h, v, x, f]);
|
|
904
|
+
return te(() => j((C) => {
|
|
905
|
+
C && (x.current?.close(), b.current?.close());
|
|
906
|
+
}), [j, x, b]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
907
|
+
/* @__PURE__ */ e.jsx(Z.Spacer, { className: "mb-3" }),
|
|
908
|
+
/* @__PURE__ */ e.jsxs(xe, { className: "", controls: x, children: [
|
|
909
|
+
/* @__PURE__ */ e.jsx(xe.Content, { onClick: D, children: /* @__PURE__ */ e.jsx(
|
|
910
|
+
ot,
|
|
911
911
|
{
|
|
912
912
|
className: "pyrion-navigation-drawer-user-card p-0",
|
|
913
913
|
name: t.user?.name || "",
|
|
@@ -918,27 +918,27 @@ const er = (t) => {
|
|
|
918
918
|
isLoading: !t.user
|
|
919
919
|
}
|
|
920
920
|
) }),
|
|
921
|
-
/* @__PURE__ */ e.jsxs(
|
|
921
|
+
/* @__PURE__ */ e.jsxs(xe.Options, { className: "min-h-max flex flex-col gap-3 pl-3 mt-3 pt-2", children: [
|
|
922
922
|
r && r.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
923
923
|
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-medium text-neutral-medium-default select-none", children: "Cambiar cuenta" }),
|
|
924
|
-
/* @__PURE__ */ e.jsx(
|
|
925
|
-
|
|
924
|
+
/* @__PURE__ */ e.jsx(ke, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, indicators: { bottom: { show: !0, type: "shadow", behavior: "scroll-on-hover" }, top: { show: !0, type: "shadow", behavior: "scroll-on-hover" } }, children: /* @__PURE__ */ e.jsx(
|
|
925
|
+
tr,
|
|
926
926
|
{
|
|
927
927
|
sessions: r,
|
|
928
928
|
onSessionClick: d,
|
|
929
|
-
secondarySlot:
|
|
930
|
-
subImageUrlAccessor:
|
|
931
|
-
currentSystemId:
|
|
932
|
-
userOptionsControls:
|
|
929
|
+
secondarySlot: l,
|
|
930
|
+
subImageUrlAccessor: c?.sessionCardOptions?.subImageUrlAccessor,
|
|
931
|
+
currentSystemId: p,
|
|
932
|
+
userOptionsControls: x
|
|
933
933
|
}
|
|
934
934
|
) })
|
|
935
935
|
] }),
|
|
936
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children:
|
|
936
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: a && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
937
937
|
/* @__PURE__ */ e.jsx("span", { className: "border-t border-neutral-strong-default w-full bg-neutral-strong-default" }),
|
|
938
938
|
/* @__PURE__ */ e.jsx(
|
|
939
|
-
|
|
939
|
+
we,
|
|
940
940
|
{
|
|
941
|
-
onClick:
|
|
941
|
+
onClick: a,
|
|
942
942
|
animate: !1,
|
|
943
943
|
animateIcon: !1,
|
|
944
944
|
variant: "text",
|
|
@@ -953,238 +953,198 @@ const er = (t) => {
|
|
|
953
953
|
] })
|
|
954
954
|
] })
|
|
955
955
|
] });
|
|
956
|
-
},
|
|
957
|
-
const s = Object.keys(t),
|
|
958
|
-
if (s.length !==
|
|
956
|
+
}, vt = M(rr, (t, r) => {
|
|
957
|
+
const s = Object.keys(t), l = Object.keys(r);
|
|
958
|
+
if (s.length !== l.length)
|
|
959
959
|
return !1;
|
|
960
960
|
for (const d of s) {
|
|
961
961
|
if (!Object.prototype.hasOwnProperty.call(r, d))
|
|
962
962
|
return !1;
|
|
963
|
-
const
|
|
964
|
-
if (
|
|
963
|
+
const a = t[d], f = r[d];
|
|
964
|
+
if (a !== f)
|
|
965
965
|
return !1;
|
|
966
966
|
}
|
|
967
967
|
return t.currentAppSessions !== r.currentAppSessions || t.options !== r.options || t.currentSystemId !== r.currentSystemId || t.userOptionsControls !== r.userOptionsControls || t.mobileAppSwitcherControls !== r.mobileAppSwitcherControls;
|
|
968
968
|
});
|
|
969
|
-
|
|
970
|
-
const
|
|
971
|
-
|
|
972
|
-
/* @__PURE__ */ e.jsxs(ie.Options, { children: [
|
|
973
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col p-2 pl-4 gap-2", children: [
|
|
974
|
-
/* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-label-medium text-neutral-medium-default", children: "Cambiar módulo" }),
|
|
975
|
-
/* @__PURE__ */ e.jsx(we, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: t?.map((o) => {
|
|
976
|
-
const d = typeof o.thumbnail == "string" ? /* @__PURE__ */ e.jsx(
|
|
977
|
-
"img",
|
|
978
|
-
{
|
|
979
|
-
src: o.thumbnail,
|
|
980
|
-
alt: o.description,
|
|
981
|
-
className: "size-8 aspect-square rounded",
|
|
982
|
-
draggable: !1
|
|
983
|
-
}
|
|
984
|
-
) : o.thumbnail, l = () => {
|
|
985
|
-
o.disabled || o.onClick && o.onClick(o.name);
|
|
986
|
-
};
|
|
987
|
-
return /* @__PURE__ */ e.jsxs("div", { onClick: l, className: "flex gap-2 p-2 rounded-lg h-12", children: [
|
|
988
|
-
d,
|
|
989
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center h-full justify-center ", children: [
|
|
990
|
-
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1", children: o.name }),
|
|
991
|
-
o.description && /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: o.description })
|
|
992
|
-
] })
|
|
993
|
-
] });
|
|
994
|
-
}) })
|
|
995
|
-
] }),
|
|
996
|
-
/* @__PURE__ */ e.jsx("div", {})
|
|
997
|
-
] })
|
|
998
|
-
] }), Fe = R(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
|
|
999
|
-
const o = g(() => {
|
|
969
|
+
vt.displayName = "PyrionNavigationDrawer.Footer";
|
|
970
|
+
const Nt = M(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
|
|
971
|
+
const l = w(() => {
|
|
1000
972
|
if (t) {
|
|
1001
973
|
if (s) {
|
|
1002
|
-
const
|
|
1003
|
-
if (
|
|
974
|
+
const c = t.find((p) => p._id === s);
|
|
975
|
+
if (c) return { coverImage: c.coverImage, thumbnail: c.thumbnail };
|
|
1004
976
|
}
|
|
1005
|
-
const
|
|
1006
|
-
if (
|
|
977
|
+
const a = window.location.origin, f = t.find((c) => c.url === a);
|
|
978
|
+
if (f) return { coverImage: f.coverImage, thumbnail: f.thumbnail };
|
|
1007
979
|
}
|
|
1008
980
|
return { coverImage: "", thumbnail: "" };
|
|
1009
981
|
}, [t]), d = !!r;
|
|
1010
982
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1011
|
-
|
|
983
|
+
l().coverImage ? /* @__PURE__ */ e.jsx(
|
|
1012
984
|
"img",
|
|
1013
985
|
{
|
|
1014
|
-
src:
|
|
986
|
+
src: l().coverImage,
|
|
1015
987
|
alt: "System Logo",
|
|
1016
|
-
className:
|
|
988
|
+
className: A("w-full h-12 rounded object-contain system-cover-image ", d && "cursor-pointer"),
|
|
1017
989
|
draggable: !1,
|
|
1018
990
|
onClick: r
|
|
1019
991
|
}
|
|
1020
|
-
) : /* @__PURE__ */ e.jsx(
|
|
1021
|
-
|
|
992
|
+
) : /* @__PURE__ */ e.jsx(ce, { className: "w-full h-12 rounded object-contain system-cover-image " }),
|
|
993
|
+
l().thumbnail ? /* @__PURE__ */ e.jsx(
|
|
1022
994
|
"img",
|
|
1023
995
|
{
|
|
1024
|
-
src:
|
|
996
|
+
src: l().thumbnail,
|
|
1025
997
|
alt: "System Logo",
|
|
1026
|
-
className:
|
|
998
|
+
className: A("w-12 h-12 rounded object-cover system-thumbnail ", d && "cursor-pointer"),
|
|
1027
999
|
draggable: !1,
|
|
1028
1000
|
onClick: r
|
|
1029
1001
|
}
|
|
1030
|
-
) : /* @__PURE__ */ e.jsx(
|
|
1002
|
+
) : /* @__PURE__ */ e.jsx(ce, { className: "w-12 h-12 rounded object-cover system-thumbnail " })
|
|
1031
1003
|
] });
|
|
1032
1004
|
}, (t, r) => t.enabled_systems === r.enabled_systems && t.onClick === r.onClick && t.currentSystemId === r.currentSystemId);
|
|
1033
|
-
|
|
1034
|
-
const yt =
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
}
|
|
1053
|
-
)
|
|
1054
|
-
}
|
|
1055
|
-
) : /* @__PURE__ */ e.jsx(
|
|
1056
|
-
Fe,
|
|
1057
|
-
{
|
|
1058
|
-
enabled_systems: r.enabled_systems,
|
|
1059
|
-
onClick: i,
|
|
1060
|
-
currentSystemId: s
|
|
1061
|
-
}
|
|
1062
|
-
);
|
|
1063
|
-
});
|
|
1005
|
+
Nt.displayName = "PyrionNavigationDrawer.SystemLogo";
|
|
1006
|
+
const yt = M(
|
|
1007
|
+
({ onSystemLogoClick: t, state: r, currentSystemId: s }) => {
|
|
1008
|
+
const { getIsCollapsed: l } = de(), d = w(() => {
|
|
1009
|
+
if (t) {
|
|
1010
|
+
const a = l();
|
|
1011
|
+
t(a);
|
|
1012
|
+
}
|
|
1013
|
+
}, [t, l]);
|
|
1014
|
+
return /* @__PURE__ */ e.jsx(
|
|
1015
|
+
Nt,
|
|
1016
|
+
{
|
|
1017
|
+
enabled_systems: r.enabled_systems,
|
|
1018
|
+
onClick: d,
|
|
1019
|
+
currentSystemId: s
|
|
1020
|
+
}
|
|
1021
|
+
);
|
|
1022
|
+
}
|
|
1023
|
+
);
|
|
1064
1024
|
yt.displayName = "PyrionNavigationDrawer.Header";
|
|
1065
1025
|
const et = ({ type: t }) => {
|
|
1066
1026
|
if (t === "load_more") return /* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-body-large text-neutral-medium-default w-full text-center py-4", children: "Cargando más ..." });
|
|
1067
1027
|
if (t === "skeletons") return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-3", children: Array(10)?.fill({})?.map(() => /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(sr, {}) })) });
|
|
1068
1028
|
}, sr = () => /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-end gap-1 p-2", children: [
|
|
1069
1029
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 w-full", children: [
|
|
1070
|
-
/* @__PURE__ */ e.jsx(
|
|
1071
|
-
/* @__PURE__ */ e.jsx(
|
|
1030
|
+
/* @__PURE__ */ e.jsx(ce, { shape: "circle", className: "w-12 h-12 aspect-square!" }),
|
|
1031
|
+
/* @__PURE__ */ e.jsx(ce, { shape: "rounded", className: "w-full h-12 min-h-12" })
|
|
1072
1032
|
] }),
|
|
1073
|
-
/* @__PURE__ */ e.jsx(
|
|
1074
|
-
] }), nr = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s, scrollableControls:
|
|
1075
|
-
const [d,
|
|
1076
|
-
|
|
1077
|
-
const
|
|
1033
|
+
/* @__PURE__ */ e.jsx(ce, { shape: "rounded", className: "w-20 h-3" })
|
|
1034
|
+
] }), nr = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s, scrollableControls: l }) => {
|
|
1035
|
+
const [d, a] = J([]), [f, c] = J("NO_LEIDAS"), [p, x] = J({ isLoading: !1, type: "load_more" }), [b, h] = J({ hasError: !1 }), v = T(/* @__PURE__ */ new Set()), j = T(null), D = T(null), C = w((u, I = "top") => {
|
|
1036
|
+
a((R) => {
|
|
1037
|
+
const $ = Array.isArray(u) ? I === "bottom" ? [...R, ...u] : [...u, ...R] : I === "bottom" ? [...R, u] : [u, ...R];
|
|
1078
1038
|
return queueMicrotask(() => {
|
|
1079
|
-
|
|
1080
|
-
}),
|
|
1039
|
+
v.current.forEach((G) => G($, { total: $.length, unread: $.filter((ee) => !ee.read).length }));
|
|
1040
|
+
}), $;
|
|
1081
1041
|
});
|
|
1082
|
-
}, []),
|
|
1083
|
-
|
|
1084
|
-
}), []),
|
|
1085
|
-
|
|
1086
|
-
const
|
|
1042
|
+
}, []), y = w((u) => (v.current.add(u), () => {
|
|
1043
|
+
v.current.delete(u);
|
|
1044
|
+
}), []), k = w((u) => {
|
|
1045
|
+
a((I) => {
|
|
1046
|
+
const R = Array.isArray(u) ? I.filter(($) => !u.includes($._id)) : I.filter(($) => $._id !== u);
|
|
1087
1047
|
return queueMicrotask(() => {
|
|
1088
|
-
|
|
1089
|
-
}),
|
|
1048
|
+
v.current.forEach(($) => $(R, { total: R.length, unread: R.filter((G) => !G.read).length }));
|
|
1049
|
+
}), R;
|
|
1090
1050
|
});
|
|
1091
|
-
}, []),
|
|
1092
|
-
|
|
1093
|
-
|
|
1051
|
+
}, []), K = w(() => {
|
|
1052
|
+
a([]), queueMicrotask(() => {
|
|
1053
|
+
v.current.forEach((u) => u([], { total: 0, unread: 0 }));
|
|
1094
1054
|
});
|
|
1095
|
-
}, []), W =
|
|
1096
|
-
|
|
1097
|
-
|
|
1055
|
+
}, []), W = w((u) => {
|
|
1056
|
+
a(u), queueMicrotask(() => {
|
|
1057
|
+
v.current.forEach((I) => I(u, { total: u.length, unread: u.filter((R) => !R.read).length }));
|
|
1098
1058
|
});
|
|
1099
|
-
}, []),
|
|
1100
|
-
|
|
1101
|
-
}, []),
|
|
1102
|
-
|
|
1059
|
+
}, []), E = w((u, I = "load_more") => {
|
|
1060
|
+
x({ isLoading: u, type: I });
|
|
1061
|
+
}, []), _ = w((u, I) => {
|
|
1062
|
+
h({ hasError: u, children: I });
|
|
1103
1063
|
}, []);
|
|
1104
1064
|
ze(s, () => ({
|
|
1105
|
-
addNewNotification:
|
|
1106
|
-
subscribeToUpdates:
|
|
1065
|
+
addNewNotification: C,
|
|
1066
|
+
subscribeToUpdates: y,
|
|
1107
1067
|
setNotifications: W,
|
|
1108
|
-
removeNotification:
|
|
1109
|
-
removeAllNotifications:
|
|
1110
|
-
setLoading:
|
|
1111
|
-
setError:
|
|
1112
|
-
}), [
|
|
1113
|
-
const S = (
|
|
1114
|
-
|
|
1068
|
+
removeNotification: k,
|
|
1069
|
+
removeAllNotifications: K,
|
|
1070
|
+
setLoading: E,
|
|
1071
|
+
setError: _
|
|
1072
|
+
}), [C, y, W, k, K, E, _]);
|
|
1073
|
+
const S = (u) => {
|
|
1074
|
+
c(u);
|
|
1115
1075
|
}, P = d.length > 0;
|
|
1116
|
-
|
|
1117
|
-
if (
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1076
|
+
rt(() => {
|
|
1077
|
+
if (j.current && D.current) {
|
|
1078
|
+
const u = j.current.clientHeight;
|
|
1079
|
+
D.current.style.setProperty("height", `calc(100vh - ${u}px - 20px)`);
|
|
1120
1080
|
}
|
|
1121
|
-
}, [
|
|
1122
|
-
const
|
|
1081
|
+
}, [j?.current]);
|
|
1082
|
+
const V = d.filter((u) => !u.read).length, { isLoading: q, type: Y } = p, { hasError: X, children: z } = b;
|
|
1123
1083
|
return /* @__PURE__ */ e.jsx(
|
|
1124
1084
|
"section",
|
|
1125
1085
|
{
|
|
1126
1086
|
className: "w-full md:w-[492px] bg-neutral-default-default flex flex-col border-l-0 md:border-l border-neutral-strong-default min-h-full h-full max-h-full overflow-hidden",
|
|
1127
1087
|
children: /* @__PURE__ */ e.jsxs("div", { className: " w-full flex flex-col gap-4 ", children: [
|
|
1128
|
-
/* @__PURE__ */ e.jsxs("div", { ref:
|
|
1088
|
+
/* @__PURE__ */ e.jsxs("div", { ref: j, className: "flex flex-col gap-4", children: [
|
|
1129
1089
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full h-max flex gap-2 items-center justify-between pt-8 pb-2 pr-2 pl-4 border-b border-neutral-strong-default sticky top-0 z-50 bg-neutral-default-default", children: [
|
|
1130
1090
|
/* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
|
|
1131
|
-
/* @__PURE__ */ e.jsx(
|
|
1091
|
+
/* @__PURE__ */ e.jsx(at, { className: "text-neutral-strong-default", size: 24 }),
|
|
1132
1092
|
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: "Notificaciones" })
|
|
1133
1093
|
] }),
|
|
1134
|
-
/* @__PURE__ */ e.jsx(
|
|
1094
|
+
/* @__PURE__ */ e.jsx(we, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(We, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
|
|
1135
1095
|
] }),
|
|
1136
1096
|
/* @__PURE__ */ e.jsx(
|
|
1137
|
-
|
|
1097
|
+
Ft,
|
|
1138
1098
|
{
|
|
1139
1099
|
className: "px-4 md:px-2 md:pl-2 pl-2 gap-0 md:gap-0",
|
|
1140
1100
|
onTabChange: S,
|
|
1141
|
-
activeTab:
|
|
1101
|
+
activeTab: f,
|
|
1142
1102
|
items: [
|
|
1143
1103
|
{ id: "ALL", title: "Todas" },
|
|
1144
1104
|
{ id: "NO_LEIDAS", title: "Sin leer" }
|
|
1145
1105
|
],
|
|
1146
|
-
renderTab: (
|
|
1106
|
+
renderTab: (u, I, R, $, G, ee, Q, ae) => /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
1147
1107
|
/* @__PURE__ */ e.jsx(
|
|
1148
1108
|
zt,
|
|
1149
1109
|
{
|
|
1150
|
-
id:
|
|
1151
|
-
title:
|
|
1152
|
-
onClick:
|
|
1153
|
-
isActive:
|
|
1154
|
-
onIconClick:
|
|
1155
|
-
onIconHover:
|
|
1156
|
-
iconTooltipProps:
|
|
1157
|
-
iconTooltipTitle:
|
|
1110
|
+
id: u.id,
|
|
1111
|
+
title: u.title,
|
|
1112
|
+
onClick: R,
|
|
1113
|
+
isActive: I,
|
|
1114
|
+
onIconClick: $,
|
|
1115
|
+
onIconHover: G,
|
|
1116
|
+
iconTooltipProps: Q,
|
|
1117
|
+
iconTooltipTitle: ee,
|
|
1158
1118
|
iconSize: ae
|
|
1159
1119
|
}
|
|
1160
1120
|
),
|
|
1161
|
-
|
|
1121
|
+
V > 0 && u.id === "NO_LEIDAS" && (q ? /* @__PURE__ */ e.jsx("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ e.jsx(ce, { className: "size-5.5", shape: "circle" }) }) : /* @__PURE__ */ e.jsx(nt, { count: V, className: "absolute top-0 right-0" }))
|
|
1162
1122
|
] })
|
|
1163
1123
|
}
|
|
1164
1124
|
),
|
|
1165
|
-
r && P &&
|
|
1125
|
+
r && P && f === "NO_LEIDAS" && !X && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end px-4", children: /* @__PURE__ */ e.jsx(we, { disabled: q, onClick: r, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) })
|
|
1166
1126
|
] }),
|
|
1167
|
-
/* @__PURE__ */ e.jsx("div", { ref:
|
|
1168
|
-
|
|
1127
|
+
/* @__PURE__ */ e.jsx("div", { ref: D, className: "", children: /* @__PURE__ */ e.jsxs(
|
|
1128
|
+
ke,
|
|
1169
1129
|
{
|
|
1170
1130
|
className: "px-4 md:px-2 py-0 md:py-0 flex flex-col gap-3 h-full",
|
|
1171
1131
|
persistScroll: "notifications-scroll",
|
|
1172
1132
|
scrollbarProps: { hide: !0, size: "small" },
|
|
1173
1133
|
axis: "y",
|
|
1174
1134
|
disableMouseScroll: !1,
|
|
1175
|
-
controls:
|
|
1135
|
+
controls: l,
|
|
1176
1136
|
scrollTopButton: {
|
|
1177
1137
|
target: "2000px"
|
|
1178
1138
|
},
|
|
1179
1139
|
scrollMetadata: {
|
|
1180
|
-
activeTab:
|
|
1181
|
-
isLoading:
|
|
1140
|
+
activeTab: f,
|
|
1141
|
+
isLoading: q
|
|
1182
1142
|
},
|
|
1183
1143
|
children: [
|
|
1184
|
-
|
|
1185
|
-
!
|
|
1186
|
-
|
|
1187
|
-
|
|
1144
|
+
X && /* @__PURE__ */ e.jsx("div", { className: "w-full h-full grid place-items-center", children: typeof z == "function" ? z() : z }),
|
|
1145
|
+
!X && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1146
|
+
q && Y === "skeletons" ? /* @__PURE__ */ e.jsx(et, { type: Y }) : P ? d?.filter((u) => f === "NO_LEIDAS" ? !u.read : u)?.map((u, I) => /* @__PURE__ */ e.jsx(Bt, { ...u, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, I)) : /* @__PURE__ */ e.jsx("p", { className: "flex-1 grid place-items-center prometeo-fonts-headline-xsmall text-neutral-default-default text-center py-8 text-balance", children: "No tienes notificaciones nuevas por el momento" }),
|
|
1147
|
+
q && Y === "load_more" && /* @__PURE__ */ e.jsx(et, { type: Y })
|
|
1188
1148
|
] })
|
|
1189
1149
|
]
|
|
1190
1150
|
}
|
|
@@ -1192,7 +1152,7 @@ const et = ({ type: t }) => {
|
|
|
1192
1152
|
] })
|
|
1193
1153
|
}
|
|
1194
1154
|
);
|
|
1195
|
-
},
|
|
1155
|
+
}, or = ({ onCloseClick: t, children: r, title: s = "Ayuda" }) => /* @__PURE__ */ e.jsxs(
|
|
1196
1156
|
"section",
|
|
1197
1157
|
{
|
|
1198
1158
|
className: "overflow-auto w-full md:w-[492px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default h-full",
|
|
@@ -1202,365 +1162,350 @@ const et = ({ type: t }) => {
|
|
|
1202
1162
|
/* @__PURE__ */ e.jsx(lt, { className: "text-neutral-strong-default", size: 24 }),
|
|
1203
1163
|
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: s })
|
|
1204
1164
|
] }),
|
|
1205
|
-
/* @__PURE__ */ e.jsx(
|
|
1165
|
+
/* @__PURE__ */ e.jsx(we, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(We, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
|
|
1206
1166
|
] }),
|
|
1207
1167
|
/* @__PURE__ */ e.jsx("div", { children: r })
|
|
1208
1168
|
]
|
|
1209
1169
|
}
|
|
1210
|
-
),
|
|
1211
|
-
const [
|
|
1212
|
-
ze(
|
|
1213
|
-
setActiveSection:
|
|
1170
|
+
), ar = ({ closeSidebar: t, options: r, helpSection: s, initialSection: l, notificationsListControls: d, scrollableControls: a }, f) => {
|
|
1171
|
+
const [c, p] = J(l ?? "notifications");
|
|
1172
|
+
ze(f, () => ({
|
|
1173
|
+
setActiveSection: p
|
|
1214
1174
|
}));
|
|
1215
|
-
const
|
|
1175
|
+
const x = () => {
|
|
1216
1176
|
t();
|
|
1217
1177
|
};
|
|
1218
1178
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1219
|
-
|
|
1179
|
+
c === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
|
|
1220
1180
|
nr,
|
|
1221
1181
|
{
|
|
1222
|
-
onCloseClick:
|
|
1182
|
+
onCloseClick: x,
|
|
1223
1183
|
onMarkAllAsRead: r?.notificationsDrawerOptions?.onMarkAllAsRead,
|
|
1224
1184
|
notificationsListControls: d,
|
|
1225
|
-
scrollableControls:
|
|
1185
|
+
scrollableControls: a
|
|
1226
1186
|
}
|
|
1227
1187
|
),
|
|
1228
|
-
|
|
1188
|
+
c === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(or, { onCloseClick: x, children: typeof s == "function" ? s() : s })
|
|
1229
1189
|
] });
|
|
1230
|
-
}, St = pe(
|
|
1190
|
+
}, St = pe(ar);
|
|
1231
1191
|
St.displayName = "SidebarContent";
|
|
1232
1192
|
const lr = ({
|
|
1233
1193
|
options: t,
|
|
1234
1194
|
helpSection: r,
|
|
1235
1195
|
sidebarContentRef: s,
|
|
1236
|
-
initialSectionRef:
|
|
1196
|
+
initialSectionRef: l,
|
|
1237
1197
|
notificationsListControls: d,
|
|
1238
|
-
scrollableControls:
|
|
1198
|
+
scrollableControls: a
|
|
1239
1199
|
}) => {
|
|
1240
|
-
const { closeSidebar:
|
|
1200
|
+
const { closeSidebar: f } = de();
|
|
1241
1201
|
return /* @__PURE__ */ e.jsx(
|
|
1242
1202
|
St,
|
|
1243
1203
|
{
|
|
1244
1204
|
ref: s,
|
|
1245
|
-
closeSidebar:
|
|
1205
|
+
closeSidebar: f,
|
|
1246
1206
|
options: t,
|
|
1247
1207
|
helpSection: r,
|
|
1248
|
-
initialSection:
|
|
1208
|
+
initialSection: l.current,
|
|
1249
1209
|
notificationsListControls: d,
|
|
1250
|
-
scrollableControls:
|
|
1210
|
+
scrollableControls: a
|
|
1251
1211
|
}
|
|
1252
1212
|
);
|
|
1253
|
-
}, Ct =
|
|
1213
|
+
}, Ct = M(lr);
|
|
1254
1214
|
Ct.displayName = "PyrionNavigationDrawer.Sidebar";
|
|
1255
1215
|
const ir = ({ navigationControlsRef: t }) => {
|
|
1256
|
-
const r =
|
|
1216
|
+
const r = de();
|
|
1257
1217
|
return t.current.toggleCollapse = r.toggleCollapse, t.current.toggleDrawer = r.toggleDrawer, t.current.closeDrawer = r.closeDrawer, t.current.openDrawer = r.openDrawer, t.current.getIsCollapsed = r.getIsCollapsed, t.current.subscribeToCollapse = r.subscribeToCollapse, t.current.openSidebar = r.openSidebar, t.current.closeSidebar = r.closeSidebar, t.current.toggleSidebar = r.toggleSidebar, t.current.getIsSidebarOpen = r.getIsSidebarOpen, t.current.subscribeToSidebarOpen = r.subscribeToSidebarOpen, t.current.setDrawerDragEnabled = r.setDrawerDragEnabled, t.current.setSidebarDragEnabled = r.setSidebarDragEnabled, null;
|
|
1258
1218
|
}, cr = (t) => {
|
|
1259
|
-
const { children: r, currentAppSessions: s, resolveUserSecondarySlot:
|
|
1260
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1261
|
-
/* @__PURE__ */ e.jsx(ir, { navigationControlsRef:
|
|
1262
|
-
/* @__PURE__ */ e.jsx(
|
|
1263
|
-
|
|
1219
|
+
const { children: r, currentAppSessions: s, resolveUserSecondarySlot: l, resolveSessionSecondarySlot: d, handleNavigation: a, allActions: f, tabs: c, navigationControlsRef: p, sidebarContentRef: x, initialSectionRef: b, userOptionsControls: h, mobileAppSwitcherControls: v, notificationsListControls: j, scrollableControls: D, outletRef: C, ...y } = t;
|
|
1220
|
+
return /* @__PURE__ */ e.jsxs(Z, { disableDragOpen: y.options?.disableDragOpen, outletRef: C, children: [
|
|
1221
|
+
/* @__PURE__ */ e.jsx(ir, { navigationControlsRef: p }),
|
|
1222
|
+
/* @__PURE__ */ e.jsx(Z.LeftSlot, { children: /* @__PURE__ */ e.jsx(
|
|
1223
|
+
Wt,
|
|
1264
1224
|
{
|
|
1265
1225
|
className: "",
|
|
1266
|
-
tabs:
|
|
1226
|
+
tabs: c,
|
|
1267
1227
|
activeColor: "var(--neutral-900)",
|
|
1268
|
-
currentTabName:
|
|
1269
|
-
currentSystemId:
|
|
1270
|
-
isLoading: !
|
|
1228
|
+
currentTabName: y.currentTabName,
|
|
1229
|
+
currentSystemId: y.currentSystemId,
|
|
1230
|
+
isLoading: !y.state.enabled_systems || y.state.enabled_systems.length === 0
|
|
1271
1231
|
}
|
|
1272
1232
|
) }),
|
|
1273
|
-
/* @__PURE__ */ e.jsx(
|
|
1233
|
+
/* @__PURE__ */ e.jsx(Z.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
|
|
1274
1234
|
yt,
|
|
1275
1235
|
{
|
|
1276
|
-
onSystemLogoClick:
|
|
1277
|
-
state:
|
|
1278
|
-
currentSystemId:
|
|
1279
|
-
tabs: i,
|
|
1280
|
-
mobileAppSwitcherControls: x
|
|
1236
|
+
onSystemLogoClick: y.onSystemLogoClick,
|
|
1237
|
+
state: y.state,
|
|
1238
|
+
currentSystemId: y.currentSystemId
|
|
1281
1239
|
}
|
|
1282
1240
|
) }, "PL-Header"),
|
|
1283
|
-
/* @__PURE__ */ e.jsx(
|
|
1284
|
-
|
|
1241
|
+
/* @__PURE__ */ e.jsx(Z.Content, { className: "overflow-hidden flex flex-col relative flex-1 md:w-auto", children: /* @__PURE__ */ e.jsx(
|
|
1242
|
+
wt,
|
|
1285
1243
|
{
|
|
1286
|
-
navlinks:
|
|
1287
|
-
handleNavigation:
|
|
1288
|
-
allActions:
|
|
1289
|
-
activeActionId:
|
|
1290
|
-
onActionClick:
|
|
1244
|
+
navlinks: y.links,
|
|
1245
|
+
handleNavigation: a,
|
|
1246
|
+
allActions: f,
|
|
1247
|
+
activeActionId: y.activeActionId,
|
|
1248
|
+
onActionClick: y.onActionClick
|
|
1291
1249
|
}
|
|
1292
1250
|
) }, "PL-Content"),
|
|
1293
|
-
/* @__PURE__ */ e.jsx(
|
|
1294
|
-
|
|
1251
|
+
/* @__PURE__ */ e.jsx(Z.Footer, { className: "md:min-h-max flex flex-col w-full overflow-hidden max-w-full", children: /* @__PURE__ */ e.jsx(
|
|
1252
|
+
vt,
|
|
1295
1253
|
{
|
|
1296
|
-
state:
|
|
1254
|
+
state: y.state,
|
|
1297
1255
|
currentAppSessions: s,
|
|
1298
|
-
resolveUserSecondarySlot:
|
|
1256
|
+
resolveUserSecondarySlot: l,
|
|
1299
1257
|
resolveSessionSecondarySlot: d,
|
|
1300
|
-
onSessionClick:
|
|
1301
|
-
onLogoutClick:
|
|
1302
|
-
options:
|
|
1303
|
-
currentSystemId:
|
|
1304
|
-
userOptionsControls:
|
|
1305
|
-
mobileAppSwitcherControls:
|
|
1306
|
-
onProfileClick:
|
|
1258
|
+
onSessionClick: y.onSessionClick,
|
|
1259
|
+
onLogoutClick: y.onLogoutClick,
|
|
1260
|
+
options: y.options,
|
|
1261
|
+
currentSystemId: y.currentSystemId,
|
|
1262
|
+
userOptionsControls: h,
|
|
1263
|
+
mobileAppSwitcherControls: v,
|
|
1264
|
+
onProfileClick: y.onProfileClick
|
|
1307
1265
|
}
|
|
1308
1266
|
) }, "PL-Footer"),
|
|
1309
|
-
/* @__PURE__ */ e.jsx(
|
|
1267
|
+
/* @__PURE__ */ e.jsx(Z.Outlet, { children: /* @__PURE__ */ e.jsx(kt, { children: r }) }),
|
|
1310
1268
|
/* @__PURE__ */ e.jsx(
|
|
1311
|
-
|
|
1269
|
+
Z.Sidebar,
|
|
1312
1270
|
{
|
|
1313
1271
|
className: "bg-neutral-default-default pyrion-layout-sidebar",
|
|
1314
|
-
modal:
|
|
1315
|
-
closeOnOverlayClick:
|
|
1272
|
+
modal: y.options?.sidebarOptions?.modal,
|
|
1273
|
+
closeOnOverlayClick: y.options?.sidebarOptions?.closeOnOverlayClick,
|
|
1316
1274
|
children: /* @__PURE__ */ e.jsx(
|
|
1317
1275
|
Ct,
|
|
1318
1276
|
{
|
|
1319
|
-
options:
|
|
1320
|
-
helpSection:
|
|
1321
|
-
sidebarContentRef:
|
|
1277
|
+
options: y.options,
|
|
1278
|
+
helpSection: y.helpSection,
|
|
1279
|
+
sidebarContentRef: x,
|
|
1322
1280
|
initialSectionRef: b,
|
|
1323
|
-
notificationsListControls:
|
|
1324
|
-
scrollableControls:
|
|
1281
|
+
notificationsListControls: j,
|
|
1282
|
+
scrollableControls: D
|
|
1325
1283
|
}
|
|
1326
1284
|
)
|
|
1327
1285
|
}
|
|
1328
1286
|
)
|
|
1329
1287
|
] });
|
|
1330
|
-
}, jt =
|
|
1331
|
-
const { children: s, ...
|
|
1332
|
-
if (
|
|
1288
|
+
}, jt = M(cr, (t, r) => {
|
|
1289
|
+
const { children: s, ...l } = t, { children: d, ...a } = r, f = Object.keys(l), c = Object.keys(a);
|
|
1290
|
+
if (f.length !== c.length)
|
|
1333
1291
|
return !1;
|
|
1334
|
-
for (const
|
|
1335
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1292
|
+
for (const p of f) {
|
|
1293
|
+
if (!Object.prototype.hasOwnProperty.call(a, p))
|
|
1336
1294
|
return !1;
|
|
1337
|
-
const
|
|
1338
|
-
if (
|
|
1295
|
+
const x = l[p], b = a[p];
|
|
1296
|
+
if (x !== b)
|
|
1339
1297
|
return !1;
|
|
1340
1298
|
}
|
|
1341
1299
|
return !0;
|
|
1342
1300
|
});
|
|
1343
1301
|
jt.displayName = "PyrionNavigationDrawer.LayoutBase";
|
|
1344
|
-
const kt =
|
|
1302
|
+
const kt = M(({ children: t }) => /* @__PURE__ */ e.jsx(Z.Outlet, { children: t }));
|
|
1345
1303
|
kt.displayName = "PyrionNavigationDrawer.IsolatedOutlet";
|
|
1346
|
-
const Dt =
|
|
1304
|
+
const Dt = Fe(null), _r = () => {
|
|
1347
1305
|
const t = Et(Dt);
|
|
1348
1306
|
if (!t)
|
|
1349
1307
|
throw new Error("usePyrionLayout debe usarse dentro de PyrionLayout");
|
|
1350
1308
|
return t;
|
|
1351
|
-
},
|
|
1352
|
-
const
|
|
1309
|
+
}, Pr = ({ children: t, helpSection: r, state: s, links: l, onLinkClick: d, onNavigate: a, onLogoutClick: f, actions: c, activeActionId: p, onActionClick: x, tabsProps: b, currentSystemId: h, onSessionClick: v, onSystemLogoClick: j, onProfileClick: D, ...C }) => {
|
|
1310
|
+
const k = Object.assign({
|
|
1353
1311
|
closeDrawerOnNavigate: !0,
|
|
1354
1312
|
disableDragOpen: {
|
|
1355
1313
|
sidebar: !0,
|
|
1356
1314
|
drawer: !1
|
|
1357
1315
|
}
|
|
1358
|
-
},
|
|
1359
|
-
if (
|
|
1360
|
-
d(
|
|
1316
|
+
}, C.options), K = Ot(), W = At(), E = T(null), _ = T(null), S = T({}), P = T(null), V = T("notifications"), q = T(null), Y = T(null), X = T(null), [z, u] = J({ total: 0, unread: 0 }), [I, R] = J(!1), [$, G] = J(null), ee = w((o) => {
|
|
1317
|
+
if (R(!1), d) {
|
|
1318
|
+
d(o);
|
|
1361
1319
|
return;
|
|
1362
1320
|
}
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
}, [d,
|
|
1366
|
-
|
|
1367
|
-
},
|
|
1321
|
+
const N = window.location.pathname;
|
|
1322
|
+
K(o), k.closeDrawerOnNavigate && Tt() && !S.current?.getIsCollapsed?.() && S.current?.toggleCollapse?.(), a && a(N, o);
|
|
1323
|
+
}, [d, a, K]), Q = (o) => {
|
|
1324
|
+
o && window.open(o, "_blank");
|
|
1325
|
+
}, ie = {
|
|
1368
1326
|
system: {
|
|
1369
|
-
mobile:
|
|
1370
|
-
desktop: (
|
|
1371
|
-
typeof window < "u" &&
|
|
1327
|
+
mobile: Q,
|
|
1328
|
+
desktop: (o) => {
|
|
1329
|
+
typeof window < "u" && o && (window.location.href = o);
|
|
1372
1330
|
}
|
|
1373
1331
|
},
|
|
1374
1332
|
product: {
|
|
1375
|
-
mobile:
|
|
1376
|
-
desktop:
|
|
1333
|
+
mobile: Q,
|
|
1334
|
+
desktop: Q
|
|
1377
1335
|
}
|
|
1378
|
-
},
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1381
|
-
}, [W, s.enabled_systems, b?.onTabClick]),
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1384
|
-
}, [W, s.company.products, b?.onTabClick]),
|
|
1385
|
-
if (
|
|
1386
|
-
|
|
1336
|
+
}, ue = w((o) => {
|
|
1337
|
+
const N = W ? "mobile" : "desktop", O = s.enabled_systems.find((m) => m.name === o)?.url;
|
|
1338
|
+
ie.system[N](O), b?.onTabClick?.(o);
|
|
1339
|
+
}, [W, s.enabled_systems, b?.onTabClick]), re = w((o) => {
|
|
1340
|
+
const N = W ? "mobile" : "desktop", O = s.company.products?.find((m) => m.name === o)?.domain;
|
|
1341
|
+
ie.product[N](O), b?.onTabClick?.(o);
|
|
1342
|
+
}, [W, s.company.products, b?.onTabClick]), De = w((o, N) => {
|
|
1343
|
+
if (N) {
|
|
1344
|
+
N(o), b?.onTabClick?.(o);
|
|
1387
1345
|
return;
|
|
1388
1346
|
} else
|
|
1389
|
-
b?.onTabClick?.(
|
|
1390
|
-
}, [b?.onTabClick]),
|
|
1391
|
-
const
|
|
1392
|
-
s.enabled_systems.forEach((
|
|
1393
|
-
|
|
1347
|
+
b?.onTabClick?.(o);
|
|
1348
|
+
}, [b?.onTabClick]), Le = w(() => {
|
|
1349
|
+
const o = {};
|
|
1350
|
+
s.enabled_systems.forEach((O) => {
|
|
1351
|
+
o[O.url] = O.name;
|
|
1394
1352
|
});
|
|
1395
|
-
const
|
|
1396
|
-
for (const [
|
|
1397
|
-
if (
|
|
1398
|
-
return
|
|
1353
|
+
const N = window.location.origin;
|
|
1354
|
+
for (const [O, m] of Object.entries(o))
|
|
1355
|
+
if (N === O)
|
|
1356
|
+
return m;
|
|
1399
1357
|
return "";
|
|
1400
|
-
}, [s.enabled_systems]),
|
|
1358
|
+
}, [s.enabled_systems]), Ae = b?.currentTabName || Le(), $e = ge(
|
|
1401
1359
|
() => s.sessions || [],
|
|
1402
1360
|
[s.sessions]
|
|
1403
|
-
),
|
|
1404
|
-
if (!
|
|
1405
|
-
if (Array.isArray(
|
|
1406
|
-
const
|
|
1361
|
+
), se = (o) => o == null ? null : typeof o == "string" || typeof o == "number" || typeof o == "boolean" ? String(o) : be(o) ? o : typeof o == "object" ? JSON.stringify(o) : null, he = w((o, N) => {
|
|
1362
|
+
if (!o) return null;
|
|
1363
|
+
if (Array.isArray(o)) {
|
|
1364
|
+
const O = o?.[0] ? Se(N, o[0]) : null, m = o?.[1] ? Se(N, o[1]) : null, F = se(O), H = se(m);
|
|
1407
1365
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1408
|
-
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 min-w-[40%] text-nowrap wrap-break-word overflow-hidden text-ellipsis", children:
|
|
1409
|
-
|
|
1366
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 min-w-[40%] text-nowrap wrap-break-word overflow-hidden text-ellipsis", children: F }),
|
|
1367
|
+
H && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-max max-w-2/3 overflow-visible ", children: [
|
|
1410
1368
|
/* @__PURE__ */ e.jsx("span", { className: "size-0.5 bg-[var(--neutral-300)] rounded-full" }),
|
|
1411
|
-
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis", children:
|
|
1369
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis", children: H })
|
|
1412
1370
|
] })
|
|
1413
1371
|
] });
|
|
1414
1372
|
}
|
|
1415
|
-
if (typeof
|
|
1416
|
-
const
|
|
1417
|
-
return
|
|
1373
|
+
if (typeof o == "string") {
|
|
1374
|
+
const O = Se(N, o);
|
|
1375
|
+
return se(O);
|
|
1418
1376
|
}
|
|
1419
|
-
return typeof
|
|
1420
|
-
}, []), Te =
|
|
1421
|
-
(
|
|
1422
|
-
const
|
|
1423
|
-
if (!
|
|
1424
|
-
const
|
|
1425
|
-
return he(
|
|
1377
|
+
return typeof o == "function" ? se(o(N)) : null;
|
|
1378
|
+
}, []), Te = w(
|
|
1379
|
+
(o) => {
|
|
1380
|
+
const N = k?.userCardOptions?.secondarySlot;
|
|
1381
|
+
if (!N) return null;
|
|
1382
|
+
const O = s.enabled_systems?.find((F) => F._id === h), m = { company: s.company, user: s.user, system: O, metadata: o };
|
|
1383
|
+
return he(N, m);
|
|
1426
1384
|
},
|
|
1427
|
-
[
|
|
1428
|
-
), Ie =
|
|
1429
|
-
(
|
|
1430
|
-
const
|
|
1431
|
-
if (!
|
|
1432
|
-
const
|
|
1433
|
-
return he(
|
|
1385
|
+
[h, k?.userCardOptions?.secondarySlot, he, s.company, s.enabled_systems, s.user]
|
|
1386
|
+
), Ie = w(
|
|
1387
|
+
(o) => {
|
|
1388
|
+
const N = k?.sessionCardOptions?.secondarySlot || k?.userCardOptions?.secondarySlot;
|
|
1389
|
+
if (!N) return null;
|
|
1390
|
+
const O = s.enabled_systems?.find((F) => F._id === h), m = { company: s.company, user: o.auth_id, metadata: o?.metadata, system: O };
|
|
1391
|
+
return he(N, m);
|
|
1434
1392
|
},
|
|
1435
|
-
[
|
|
1436
|
-
), le =
|
|
1437
|
-
const
|
|
1393
|
+
[h, k?.sessionCardOptions?.secondarySlot, k?.userCardOptions?.secondarySlot, he, s.company, s.enabled_systems]
|
|
1394
|
+
), le = ge(() => {
|
|
1395
|
+
const o = [];
|
|
1438
1396
|
return S.current.openNotifications = () => {
|
|
1439
|
-
|
|
1397
|
+
V.current = "notifications", S.current.openSidebar?.(), P.current?.setActiveSection("notifications");
|
|
1440
1398
|
}, S.current.openHelp = () => {
|
|
1441
|
-
|
|
1442
|
-
}, !
|
|
1399
|
+
V.current = "help", S.current.openSidebar?.(), P.current?.setActiveSection("help");
|
|
1400
|
+
}, !k?.notificationsDrawerOptions?.hideActionButton && !k?.notificationsDrawerOptions?.hide && o.push({
|
|
1443
1401
|
id: "notifications",
|
|
1444
1402
|
title: "Notificaciones",
|
|
1445
|
-
icon:
|
|
1403
|
+
icon: at,
|
|
1446
1404
|
onClick: S.current.openNotifications,
|
|
1447
1405
|
count: z.unread,
|
|
1448
1406
|
className: "default-action-notifications"
|
|
1449
|
-
}), !
|
|
1407
|
+
}), !k?.helpSectionDrawerOptions?.hideActionButton && r && !k?.helpSectionDrawerOptions?.hide && o.push({
|
|
1450
1408
|
id: "help",
|
|
1451
1409
|
title: "Ayuda",
|
|
1452
1410
|
icon: lt,
|
|
1453
1411
|
onClick: S.current.openHelp,
|
|
1454
1412
|
className: "default-action-help"
|
|
1455
|
-
}),
|
|
1413
|
+
}), k?.configurationActionOptions?.onClick && !k?.configurationActionOptions?.hideActionButton && o.push({
|
|
1456
1414
|
id: "configuration",
|
|
1457
1415
|
title: "Configuracion",
|
|
1458
1416
|
icon: Ut,
|
|
1459
|
-
onClick: () =>
|
|
1417
|
+
onClick: () => k.configurationActionOptions?.onClick?.(S.current),
|
|
1460
1418
|
className: "default-action-configuration"
|
|
1461
|
-
}),
|
|
1462
|
-
}, [
|
|
1463
|
-
() => [...le, ...
|
|
1464
|
-
[le,
|
|
1465
|
-
),
|
|
1466
|
-
const
|
|
1467
|
-
name:
|
|
1468
|
-
thumbnail:
|
|
1469
|
-
onClick:
|
|
1470
|
-
id:
|
|
1471
|
-
})) || [],
|
|
1472
|
-
...
|
|
1473
|
-
onClick: () =>
|
|
1474
|
-
})) || [],
|
|
1475
|
-
name:
|
|
1476
|
-
thumbnail:
|
|
1477
|
-
onClick:
|
|
1419
|
+
}), o;
|
|
1420
|
+
}, [k, r, x, z]), Ee = ge(
|
|
1421
|
+
() => [...le, ...c || []],
|
|
1422
|
+
[le, c]
|
|
1423
|
+
), Oe = ge(() => {
|
|
1424
|
+
const o = s.enabled_systems.map((m) => ({
|
|
1425
|
+
name: m.name,
|
|
1426
|
+
thumbnail: m.thumbnail,
|
|
1427
|
+
onClick: ue,
|
|
1428
|
+
id: m._id
|
|
1429
|
+
})) || [], N = b?.customTabs?.map((m) => ({
|
|
1430
|
+
...m,
|
|
1431
|
+
onClick: () => De(m.name, m?.onClick)
|
|
1432
|
+
})) || [], O = s.company.products?.map((m) => ({
|
|
1433
|
+
name: m.name,
|
|
1434
|
+
thumbnail: m.thumbnail,
|
|
1435
|
+
onClick: re
|
|
1478
1436
|
})) || [];
|
|
1479
|
-
return [...
|
|
1480
|
-
}, [s.enabled_systems, s.company.products, b?.customTabs]),
|
|
1481
|
-
|
|
1482
|
-
}, []),
|
|
1483
|
-
}), []),
|
|
1484
|
-
|
|
1485
|
-
}, []),
|
|
1486
|
-
|
|
1487
|
-
}, []),
|
|
1488
|
-
|
|
1489
|
-
}, []),
|
|
1490
|
-
}), []),
|
|
1491
|
-
|
|
1492
|
-
}, []),
|
|
1493
|
-
|
|
1494
|
-
}, []),
|
|
1495
|
-
|
|
1496
|
-
}, []), _e =
|
|
1497
|
-
|
|
1498
|
-
}, []),
|
|
1499
|
-
|
|
1500
|
-
}, []),
|
|
1501
|
-
const
|
|
1502
|
-
!
|
|
1503
|
-
typeof
|
|
1437
|
+
return [...o, ...N, ...O];
|
|
1438
|
+
}, [s.enabled_systems, s.company.products, b?.customTabs]), n = w((o, N) => {
|
|
1439
|
+
E.current?.addNewNotification ? E.current.addNewNotification(o, N) : console.warn("Notifications controls not ready yet");
|
|
1440
|
+
}, []), i = w((o) => E.current?.subscribeToUpdates ? E.current.subscribeToUpdates(o) : (console.warn("Notifications controls not ready yet"), () => {
|
|
1441
|
+
}), []), g = w((o) => {
|
|
1442
|
+
E.current?.removeNotification ? E.current.removeNotification(o) : console.warn("Notifications controls not ready yet");
|
|
1443
|
+
}, []), L = w(() => {
|
|
1444
|
+
E.current?.removeAllNotifications ? E.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
|
|
1445
|
+
}, []), B = w((o) => {
|
|
1446
|
+
E.current?.setNotifications ? E.current.setNotifications(o) : console.warn("Notifications controls not ready yet");
|
|
1447
|
+
}, []), U = w((o, N) => _.current?.subscribeToScrollTarget ? _.current.subscribeToScrollTarget(o, N) : (console.warn("Scrollable controls not ready yet"), () => {
|
|
1448
|
+
}), []), ne = w((o, N = "load_more") => {
|
|
1449
|
+
E.current?.setLoading ? E.current.setLoading(o, N) : console.warn("Notifications controls not ready yet");
|
|
1450
|
+
}, []), oe = w((o, N) => {
|
|
1451
|
+
E.current?.setError ? E.current.setError(o, N) : console.warn("Notifications controls not ready yet");
|
|
1452
|
+
}, []), fe = w(() => {
|
|
1453
|
+
q.current?.open();
|
|
1454
|
+
}, []), _e = w(() => {
|
|
1455
|
+
q.current?.close();
|
|
1456
|
+
}, []), Pe = w(() => {
|
|
1457
|
+
q.current?.toggle();
|
|
1458
|
+
}, []), Ne = w((o, N, O) => {
|
|
1459
|
+
const m = /* @__PURE__ */ e.jsxs("div", { className: A(" bg-black/60 z-200 inset-0 h-full w-full grid place-items-center text-neutral-default-default", N ? "fixed" : "sticky"), children: [
|
|
1460
|
+
!O && /* @__PURE__ */ e.jsx(we, { label: "", icon: /* @__PURE__ */ e.jsx(We, {}), onClick: () => R(!1), variant: "text", className: "absolute top-0 right-0", size: "small", color: "secondary" }),
|
|
1461
|
+
typeof o == "function" ? o() : o
|
|
1504
1462
|
] });
|
|
1505
|
-
let
|
|
1506
|
-
return
|
|
1507
|
-
}, [
|
|
1508
|
-
|
|
1463
|
+
let F;
|
|
1464
|
+
return N ? F = Ge(m, document.body, `modal-error-${Date.now()}`) : X.current && (F = Ge(m, X.current, `modal-error-${Date.now()}`)), G(F), R(!0), m;
|
|
1465
|
+
}, [X]), ye = w(() => {
|
|
1466
|
+
R(!1);
|
|
1509
1467
|
}, []);
|
|
1510
|
-
return S.current.addNewNotification =
|
|
1511
|
-
|
|
1512
|
-
|
|
1468
|
+
return S.current.addNewNotification = n, S.current.subscribeToNotificationsUpdates = i, S.current.removeNotification = g, S.current.removeAllNotifications = L, S.current.setNotifications = B, S.current.setNotificationsError = oe, S.current.setNotificationsLoading = ne, S.current.subscribeToNotificationsScroll = U, S.current.showErrorModal = Ne, S.current.closeErrorModal = ye, S.current.userCardExpand = fe, S.current.userCardCollapse = _e, S.current.userCardToggle = Pe, te(() => {
|
|
1469
|
+
i((o, N) => {
|
|
1470
|
+
u(N);
|
|
1513
1471
|
});
|
|
1514
|
-
}, [
|
|
1515
|
-
|
|
1516
|
-
/* @__PURE__ */ e.
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
helpSection: r,
|
|
1549
|
-
sidebarContentRef: P,
|
|
1550
|
-
initialSectionRef: H,
|
|
1551
|
-
navigationControlsRef: S,
|
|
1552
|
-
notificationsListControls: _,
|
|
1553
|
-
scrollableControls: M,
|
|
1554
|
-
outletRef: Y,
|
|
1555
|
-
onProfileClick: L,
|
|
1556
|
-
currentTabName: Ne,
|
|
1557
|
-
children: t
|
|
1558
|
-
}
|
|
1559
|
-
)
|
|
1560
|
-
] })
|
|
1472
|
+
}, [i]), /* @__PURE__ */ e.jsxs(Dt.Provider, { value: S.current, children: [
|
|
1473
|
+
I && $,
|
|
1474
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex h-screen", children: /* @__PURE__ */ e.jsx(
|
|
1475
|
+
jt,
|
|
1476
|
+
{
|
|
1477
|
+
links: l,
|
|
1478
|
+
handleNavigation: ee,
|
|
1479
|
+
allActions: Ee,
|
|
1480
|
+
activeActionId: p,
|
|
1481
|
+
onActionClick: x,
|
|
1482
|
+
state: s,
|
|
1483
|
+
currentAppSessions: $e,
|
|
1484
|
+
resolveUserSecondarySlot: Te,
|
|
1485
|
+
resolveSessionSecondarySlot: Ie,
|
|
1486
|
+
onSessionClick: v,
|
|
1487
|
+
onLogoutClick: f,
|
|
1488
|
+
options: k,
|
|
1489
|
+
currentSystemId: h,
|
|
1490
|
+
userOptionsControls: q,
|
|
1491
|
+
mobileAppSwitcherControls: Y,
|
|
1492
|
+
onSystemLogoClick: j,
|
|
1493
|
+
tabs: Oe,
|
|
1494
|
+
helpSection: r,
|
|
1495
|
+
sidebarContentRef: P,
|
|
1496
|
+
initialSectionRef: V,
|
|
1497
|
+
navigationControlsRef: S,
|
|
1498
|
+
notificationsListControls: E,
|
|
1499
|
+
scrollableControls: _,
|
|
1500
|
+
outletRef: X,
|
|
1501
|
+
onProfileClick: D,
|
|
1502
|
+
currentTabName: Ae,
|
|
1503
|
+
children: t
|
|
1504
|
+
}
|
|
1505
|
+
) })
|
|
1561
1506
|
] });
|
|
1562
1507
|
};
|
|
1563
1508
|
export {
|
|
1564
|
-
|
|
1509
|
+
Pr as default,
|
|
1565
1510
|
_r as u
|
|
1566
1511
|
};
|