prometeo-design-system 6.3.3 → 6.3.5

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