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