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