bonsaif-ui 0.1.48 → 0.1.51

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,5 +1,5 @@
1
1
  "use client";
2
- import je, { useRef as le, useState as A, useEffect as Q, createContext as Do, useLayoutEffect as Bo, useContext as Oo, isValidElement as cn, Children as Io, useMemo as at, useCallback as we, forwardRef as ga, cloneElement as Ro, useId as Ho, useSyncExternalStore as jo } from "react";
2
+ import je, { useRef as le, useState as B, useEffect as Q, createContext as Do, useLayoutEffect as Bo, useContext as Oo, isValidElement as cn, Children as Io, useMemo as at, useCallback as we, forwardRef as ga, cloneElement as Ro, useId as Ho, useSyncExternalStore as jo } from "react";
3
3
  import { jsx as t, jsxs as l, Fragment as Re } from "react/jsx-runtime";
4
4
  import { HiMagnifyingGlass as xt, HiXMark as Ie, HiInformationCircle as rn, HiExclamationCircle as ya, HiExclamationTriangle as dn, HiCheckCircle as zo, HiChevronLeft as Tt, HiChevronDown as Xe, HiChevronRight as st, HiCalendarDays as nn, HiCheck as Ue, HiClipboardDocument as Fo, HiLink as wa, HiCog6Tooth as Sr, HiChevronUp as Yr, HiChevronUpDown as _o, HiFunnel as Po, HiEllipsisVertical as Wo, HiMinus as Na, HiTableCells as qo, HiDocumentText as ka, HiCommandLine as Uo, HiClock as qn, HiTrash as Ca, HiArrowDownTray as Ko, HiPencil as Vo, HiInbox as Sa, HiArrowUpTray as Yo, HiDocument as Go, HiH2 as Xo, HiH3 as Zo, HiArrowsPointingIn as Jo, HiArrowsPointingOut as Qo, HiArrowUturnLeft as el, HiArrowUturnRight as tl, HiListBullet as an, HiNumberedList as rl, HiArrowTurnUpLeft as nl, HiArrowTurnDownRight as al, HiBars3BottomLeft as ol, HiBars3CenterLeft as ll, HiBars3BottomRight as il, HiBars3 as Ea, HiLinkSlash as sl, HiPhoto as cl, HiOutlinePaintBrush as dl, HiNoSymbol as ul, HiLockClosed as ml, HiHome as Er, HiArrowRightOnRectangle as bl, HiShieldCheck as Gr, HiBriefcase as fl, HiUsers as Un, HiBell as pl, HiUser as hl, HiClipboardDocumentList as vl, HiBuildingOffice2 as xl, HiRectangleGroup as gl, HiTicket as yl, HiChartBar as wl } from "react-icons/hi2";
5
5
  import { createPortal as Ze } from "react-dom";
@@ -41,7 +41,7 @@ function El({
41
41
  size: m = "default",
42
42
  inputTabIndex: f
43
43
  }) {
44
- const p = le(null), [h, x] = A(!1), v = c || h || e.trim().length > 0, L = m === "sm" ? "h-9 rounded-md" : "h-10 rounded-lg", S = a || "w-48 max-w-full sm:w-64 lg:w-72";
44
+ const p = le(null), [h, x] = B(!1), v = c || h || e.trim().length > 0, T = m === "sm" ? "h-9 rounded-md" : "h-10 rounded-lg", S = a || "w-48 max-w-full sm:w-64 lg:w-72";
45
45
  Q(() => {
46
46
  var k;
47
47
  i && ((k = p.current) == null || k.focus());
@@ -81,7 +81,7 @@ function El({
81
81
  k.key === "Escape" && (u == null || u());
82
82
  },
83
83
  placeholder: v ? n : "Buscar",
84
- className: `${L} w-full py-0 text-sm leading-none placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${v ? "pl-9 pr-8" : "cursor-pointer pl-9 pr-3"}`,
84
+ className: `${T} w-full py-0 text-sm leading-none placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${v ? "pl-9 pr-8" : "cursor-pointer pl-9 pr-3"}`,
85
85
  style: {
86
86
  height: `var(--page-header-control-height, ${m === "sm" ? "36px" : "40px"})`,
87
87
  paddingLeft: "calc(var(--page-header-control-icon-left, 12px) + 24px)",
@@ -160,40 +160,40 @@ function Ut({
160
160
  tooltipStyle: h,
161
161
  as: x = "div"
162
162
  }) {
163
- const v = le(null), L = le(null), S = le(null), w = le(!1), [k, O] = A(null), [ee, z] = A("");
163
+ const v = le(null), T = le(null), S = le(null), w = le(!1), [k, O] = B(null), [ee, z] = B("");
164
164
  Q(() => {
165
- const E = v.current;
166
- E && (E.querySelectorAll("[title]").forEach((R) => {
167
- const U = R.getAttribute("title");
168
- U && (R.getAttribute("aria-label") || R.setAttribute("aria-label", U), R.removeAttribute("title"));
169
- }), E.querySelectorAll("svg title").forEach((R) => R.remove()));
165
+ const L = v.current;
166
+ L && (L.querySelectorAll("[title]").forEach((j) => {
167
+ const U = j.getAttribute("title");
168
+ U && (j.getAttribute("aria-label") || j.setAttribute("aria-label", U), j.removeAttribute("title"));
169
+ }), L.querySelectorAll("svg title").forEach((j) => j.remove()));
170
170
  }), Bo(() => {
171
171
  if (!k) return;
172
- const E = L.current;
173
- if (!E) return;
174
- const R = 12, U = 14, _ = E.getBoundingClientRect(), oe = window.innerWidth - _.width - R, W = window.innerHeight - _.height - R;
175
- let s = k.mouseX + U, y = k.mouseY + U, D, j;
172
+ const L = T.current;
173
+ if (!L) return;
174
+ const j = 12, U = 14, _ = L.getBoundingClientRect(), oe = window.innerWidth - _.width - j, W = window.innerHeight - _.height - j;
175
+ let s = k.mouseX + U, g = k.mouseY + U, E, R;
176
176
  if (!i && v.current) {
177
- const B = v.current.getBoundingClientRect(), ne = B.left + B.width / 2, ce = B.top + B.height / 2;
178
- c === "top" ? (s = ne - _.width / 2, y = B.top - _.height - U, j = _.height - 1) : c === "left" ? (s = B.left - _.width - U, y = ce - _.height / 2, D = _.width - 1) : c === "right" ? (s = B.right + U, y = ce - _.height / 2, D = -7) : (s = ne - _.width / 2, y = B.bottom + U, j = -7);
177
+ const D = v.current.getBoundingClientRect(), ne = D.left + D.width / 2, ce = D.top + D.height / 2;
178
+ c === "top" ? (s = ne - _.width / 2, g = D.top - _.height - U, R = _.height - 1) : c === "left" ? (s = D.left - _.width - U, g = ce - _.height / 2, E = _.width - 1) : c === "right" ? (s = D.right + U, g = ce - _.height / 2, E = -7) : (s = ne - _.width / 2, g = D.bottom + U, R = -7);
179
179
  }
180
- if (i && (s > oe && (s = k.mouseX - _.width - U), y > W && (y = k.mouseY - _.height - U)), s = Math.min(Math.max(R, s), Math.max(R, oe)), y = Math.min(Math.max(R, y), Math.max(R, W)), !i && v.current) {
181
- const B = v.current.getBoundingClientRect(), ne = B.left + B.width / 2, ce = B.top + B.height / 2;
182
- c === "top" || c === "bottom" ? D = Math.min(Math.max(14, ne - s), _.width - 14) : j = Math.min(Math.max(14, ce - y), _.height - 14);
180
+ if (i && (s > oe && (s = k.mouseX - _.width - U), g > W && (g = k.mouseY - _.height - U)), s = Math.min(Math.max(j, s), Math.max(j, oe)), g = Math.min(Math.max(j, g), Math.max(j, W)), !i && v.current) {
181
+ const D = v.current.getBoundingClientRect(), ne = D.left + D.width / 2, ce = D.top + D.height / 2;
182
+ c === "top" || c === "bottom" ? E = Math.min(Math.max(14, ne - s), _.width - 14) : R = Math.min(Math.max(14, ce - g), _.height - 14);
183
183
  }
184
- (Math.abs(s - k.x) > 0.5 || Math.abs(y - k.y) > 0.5 || D !== k.arrowX || j !== k.arrowY) && O(
185
- (B) => B && {
186
- ...B,
184
+ (Math.abs(s - k.x) > 0.5 || Math.abs(g - k.y) > 0.5 || E !== k.arrowX || R !== k.arrowY) && O(
185
+ (D) => D && {
186
+ ...D,
187
187
  x: s,
188
- y,
189
- arrowX: D,
190
- arrowY: j
188
+ y: g,
189
+ arrowX: E,
190
+ arrowY: R
191
191
  }
192
192
  );
193
193
  }, [i, c, k]);
194
194
  const Y = () => {
195
195
  S.current && (window.clearTimeout(S.current), S.current = null);
196
- }, T = (E, R) => {
196
+ }, $ = (L, j) => {
197
197
  if (!$l() || w.current) return;
198
198
  const U = v.current;
199
199
  if (U && !hr(U)) {
@@ -202,13 +202,13 @@ function Ut({
202
202
  if (!_) return;
203
203
  z(_);
204
204
  }
205
- !n && !r || O({ mouseX: E, mouseY: R, x: E + 14, y: R + 14 });
205
+ !n && !r || O({ mouseX: L, mouseY: j, x: L + 14, y: j + 14 });
206
206
  }
207
207
  }, q = () => {
208
- const E = v.current;
209
- if (!E) return;
210
- const R = E.getBoundingClientRect();
211
- T(R.left + R.width / 2, R.bottom);
208
+ const L = v.current;
209
+ if (!L) return;
210
+ const j = L.getBoundingClientRect();
211
+ $(j.left + j.width / 2, j.bottom);
212
212
  }, Z = () => {
213
213
  Y(), O(null);
214
214
  }, te = () => {
@@ -228,10 +228,10 @@ function Ut({
228
228
  O(null);
229
229
  return;
230
230
  }
231
- const E = () => O(null), R = () => {
231
+ const L = () => O(null), j = () => {
232
232
  pr(), w.current = !0, O(null);
233
233
  };
234
- document.addEventListener("pointerdown", R, !0), document.addEventListener("click", R, !0), document.addEventListener("scroll", E, !0), window.addEventListener("blur", E), document.addEventListener("visibilitychange", E), document.addEventListener("keydown", E, !0);
234
+ document.addEventListener("pointerdown", j, !0), document.addEventListener("click", j, !0), document.addEventListener("scroll", L, !0), window.addEventListener("blur", L), document.addEventListener("visibilitychange", L), document.addEventListener("keydown", L, !0);
235
235
  const U = new MutationObserver(() => {
236
236
  hr(v.current) && O(null);
237
237
  });
@@ -241,16 +241,16 @@ function Ut({
241
241
  attributes: !0,
242
242
  attributeFilter: ["role", "aria-modal", "aria-hidden", "class"]
243
243
  }), () => {
244
- document.removeEventListener("pointerdown", R, !0), document.removeEventListener("click", R, !0), document.removeEventListener("scroll", E, !0), window.removeEventListener("blur", E), document.removeEventListener("visibilitychange", E), document.removeEventListener("keydown", E, !0), U.disconnect();
244
+ document.removeEventListener("pointerdown", j, !0), document.removeEventListener("click", j, !0), document.removeEventListener("scroll", L, !0), window.removeEventListener("blur", L), document.removeEventListener("visibilitychange", L), document.removeEventListener("keydown", L, !0), U.disconnect();
245
245
  };
246
246
  }, [k]), Q(() => {
247
- const E = () => pr(), R = () => {
247
+ const L = () => pr(), j = () => {
248
248
  pr(), w.current = !0, O(null);
249
249
  };
250
- return document.addEventListener("pointerdown", E, !0), document.addEventListener("click", E, !0), document.addEventListener("keydown", E, !0), window.addEventListener(Yn, R), () => {
251
- document.removeEventListener("pointerdown", E, !0), document.removeEventListener("click", E, !0), document.removeEventListener("keydown", E, !0), window.removeEventListener(
250
+ return document.addEventListener("pointerdown", L, !0), document.addEventListener("click", L, !0), document.addEventListener("keydown", L, !0), window.addEventListener(Yn, j), () => {
251
+ document.removeEventListener("pointerdown", L, !0), document.removeEventListener("click", L, !0), document.removeEventListener("keydown", L, !0), window.removeEventListener(
252
252
  Yn,
253
- R
253
+ j
254
254
  );
255
255
  };
256
256
  }, []);
@@ -259,16 +259,16 @@ function Ut({
259
259
  /* @__PURE__ */ t(
260
260
  x,
261
261
  {
262
- ref: (E) => {
263
- v.current = E;
262
+ ref: (L) => {
263
+ v.current = L;
264
264
  },
265
265
  className: m,
266
266
  style: p,
267
- onMouseEnter: (E) => {
268
- Y(), X(), i ? T(E.clientX, E.clientY) : q();
267
+ onMouseEnter: (L) => {
268
+ Y(), X(), i ? $(L.clientX, L.clientY) : q();
269
269
  },
270
- onMouseMove: (E) => {
271
- k && i && T(E.clientX, E.clientY);
270
+ onMouseMove: (L) => {
271
+ k && i && $(L.clientX, L.clientY);
272
272
  },
273
273
  onMouseDown: P,
274
274
  onClick: P,
@@ -284,7 +284,7 @@ function Ut({
284
284
  /* @__PURE__ */ l(
285
285
  "div",
286
286
  {
287
- ref: L,
287
+ ref: T,
288
288
  role: "tooltip",
289
289
  className: f,
290
290
  onMouseEnter: a ? Y : void 0,
@@ -385,7 +385,7 @@ function Be({
385
385
  style: x,
386
386
  ...v
387
387
  }) {
388
- const L = Oo($a), S = c ?? L.iconOnly ?? e === "icon", w = L.compact ?? !1, k = L.headerAction ?? !1, O = k && r === "md" ? "sm" : w && !k && r === "md" ? "xs" : r, ee = e === "icon" || S, z = k && ee, Y = on(f), T = i ?? v.title ?? v["aria-label"] ?? (S ? Y : void 0), q = T ? void 0 : v.title, Z = v["aria-label"] ?? (typeof T == "string" ? T : Y || void 0), te = n ? null : a ?? (S ? Il(f) : null), P = /* @__PURE__ */ l(
388
+ const T = Oo($a), S = c ?? T.iconOnly ?? e === "icon", w = T.compact ?? !1, k = T.headerAction ?? !1, O = k && r === "md" ? "sm" : w && !k && r === "md" ? "xs" : r, ee = e === "icon" || S, z = k && ee, Y = on(f), $ = i ?? v.title ?? v["aria-label"] ?? (S ? Y : void 0), q = $ ? void 0 : v.title, Z = v["aria-label"] ?? (typeof $ == "string" ? $ : Y || void 0), te = n ? null : a ?? (S ? Il(f) : null), P = /* @__PURE__ */ l(
389
389
  "button",
390
390
  {
391
391
  ...v,
@@ -420,11 +420,11 @@ function Be({
420
420
  ]
421
421
  }
422
422
  );
423
- return T ? /* @__PURE__ */ t(
423
+ return $ ? /* @__PURE__ */ t(
424
424
  Ut,
425
425
  {
426
426
  as: "span",
427
- content: T,
427
+ content: $,
428
428
  className: "inline-flex shrink-0",
429
429
  children: P
430
430
  }
@@ -572,7 +572,7 @@ function Ks({
572
572
  onActiveServiceChange: h,
573
573
  canAccess: x,
574
574
  keepAlive: v = !0,
575
- title: L,
575
+ title: T,
576
576
  subtitle: S,
577
577
  emptyState: w,
578
578
  loadingState: k,
@@ -580,15 +580,15 @@ function Ks({
580
580
  renderTabLabel: ee,
581
581
  searchableTabs: z = "auto",
582
582
  tabsSearchThreshold: Y = 6,
583
- tabsSearchPlaceholder: T = "Buscar modulo...",
583
+ tabsSearchPlaceholder: $ = "Buscar modulo...",
584
584
  tabsSearchValue: q,
585
585
  onTabsSearchChange: Z,
586
586
  emptySearchState: te,
587
587
  showTabCount: P = !0,
588
588
  className: X = "",
589
589
  parentClassName: J = "",
590
- contentClassName: E = "",
591
- tabsClassName: R = ""
590
+ contentClassName: L = "",
591
+ tabsClassName: j = ""
592
592
  }) {
593
593
  var qe;
594
594
  const U = at(
@@ -598,34 +598,34 @@ function Ks({
598
598
  [x, i, c]
599
599
  ), _ = (qe = U.find(
600
600
  (ae) => !ae.disabled
601
- )) == null ? void 0 : qe.service, [oe, W] = A(
601
+ )) == null ? void 0 : qe.service, [oe, W] = B(
602
602
  p ?? _ ?? ""
603
- ), [s, y] = A({}), [D, j] = A({}), [B, ne] = A(""), [ce, pe] = A(!1), $ = le(D), ie = le(0), I = q ?? B, M = Xn(I), G = z === !0 || z === "auto" && U.length >= Y, V = G && I.trim().length > 0, re = at(() => M ? U.filter(
604
- (ae) => Xn(zl(ae)).includes(M)
605
- ) : U, [M, U]), me = f ?? oe, se = U.find((ae) => ae.service === me) ?? U.find((ae) => !ae.disabled);
603
+ ), [s, g] = B({}), [E, R] = B({}), [D, ne] = B(""), [ce, pe] = B(!1), M = le(E), ie = le(0), H = q ?? D, A = Xn(H), G = z === !0 || z === "auto" && U.length >= Y, V = G && H.trim().length > 0, re = at(() => A ? U.filter(
604
+ (ae) => Xn(zl(ae)).includes(A)
605
+ ) : U, [A, U]), me = f ?? oe, se = U.find((ae) => ae.service === me) ?? U.find((ae) => !ae.disabled);
606
606
  Q(() => {
607
607
  !se && _ && W(_);
608
608
  }, [_, se]), Q(() => {
609
- $.current = D;
610
- }, [D]);
611
- const g = (ae) => {
609
+ M.current = E;
610
+ }, [E]);
611
+ const y = (ae) => {
612
612
  ae.disabled || (f || W(ae.service), h == null || h(ae.service, ae));
613
- }, H = (ae) => {
613
+ }, I = (ae) => {
614
614
  q === void 0 && ne(ae), Z == null || Z(ae);
615
615
  }, ue = (ae, Me) => {
616
616
  const Te = re.filter((De) => !De.disabled), _e = Te.findIndex(
617
617
  (De) => De.service === Me.service
618
618
  );
619
- _e < 0 || ((ae.key === "ArrowRight" || ae.key === "ArrowDown") && (ae.preventDefault(), g(Te[(_e + 1) % Te.length])), (ae.key === "ArrowLeft" || ae.key === "ArrowUp") && (ae.preventDefault(), g(
619
+ _e < 0 || ((ae.key === "ArrowRight" || ae.key === "ArrowDown") && (ae.preventDefault(), y(Te[(_e + 1) % Te.length])), (ae.key === "ArrowLeft" || ae.key === "ArrowUp") && (ae.preventDefault(), y(
620
620
  Te[(_e - 1 + Te.length) % Te.length]
621
- )), ae.key === "Home" && (ae.preventDefault(), g(Te[0])), ae.key === "End" && (ae.preventDefault(), g(Te[Te.length - 1])));
621
+ )), ae.key === "Home" && (ae.preventDefault(), y(Te[0])), ae.key === "End" && (ae.preventDefault(), y(Te[Te.length - 1])));
622
622
  }, be = we(() => {
623
623
  if (!se) return;
624
- const ae = se.service, Me = $.current[ae];
624
+ const ae = se.service, Me = M.current[ae];
625
625
  if (Me != null && Me.loading || Me != null && Me.component && v) return;
626
626
  const Te = (u == null ? void 0 : u[ae]) ?? m;
627
627
  if (!Te) {
628
- j((De) => ({
628
+ R((De) => ({
629
629
  ...De,
630
630
  [ae]: {
631
631
  loading: !1,
@@ -635,32 +635,32 @@ function Ks({
635
635
  return;
636
636
  }
637
637
  const _e = ++ie.current;
638
- j((De) => ({
638
+ R((De) => ({
639
639
  ...De,
640
640
  [ae]: { ...De[ae], loading: !0, error: void 0 }
641
641
  })), Te(se, i).then((De) => {
642
642
  if (_e !== ie.current && !v) return;
643
643
  const et = Fl(De);
644
- j((Fe) => ({
644
+ R((Fe) => ({
645
645
  ...Fe,
646
646
  [ae]: { component: et, loading: !1 }
647
647
  }));
648
648
  }).catch((De) => {
649
649
  const et = De instanceof Error ? De : new Error(String(De));
650
- j((Fe) => ({
650
+ R((Fe) => ({
651
651
  ...Fe,
652
652
  [ae]: { ...Fe[ae], loading: !1, error: et }
653
653
  }));
654
654
  });
655
655
  }, [i, v, m, u, se]);
656
656
  Q(be, [be]);
657
- const Se = se ? s[se.service] ?? null : null, he = se ? D[se.service] : void 0, Ee = he == null ? void 0 : he.component, ke = (ae) => {
658
- se && y((Me) => ({
657
+ const Se = se ? s[se.service] ?? null : null, he = se ? E[se.service] : void 0, Ee = he == null ? void 0 : he.component, ke = (ae) => {
658
+ se && g((Me) => ({
659
659
  ...Me,
660
660
  [se.service]: ae
661
661
  }));
662
662
  }, fe = () => {
663
- se && y((ae) => ({
663
+ se && g((ae) => ({
664
664
  ...ae,
665
665
  [se.service]: null
666
666
  }));
@@ -673,8 +673,8 @@ function Ks({
673
673
  selectedLink: se,
674
674
  selectedService: se == null ? void 0 : se.service,
675
675
  activeItemId: Se,
676
- tabsSearch: I,
677
- onSelectService: g,
676
+ tabsSearch: H,
677
+ onSelectService: y,
678
678
  onOpenDetail: ke,
679
679
  onBackToList: fe
680
680
  }, Qe = n ? n(ze) : r ? /* @__PURE__ */ t(r, { ...ze }) : e;
@@ -693,11 +693,11 @@ function Ks({
693
693
  /* @__PURE__ */ l(
694
694
  "div",
695
695
  {
696
- className: `relative min-w-0 overflow-visible rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${E}`,
696
+ className: `relative min-w-0 overflow-visible rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${L}`,
697
697
  children: [
698
- (L || S || G || P) && /* @__PURE__ */ t("div", { className: "relative border-b border-[var(--border)] px-4 py-3", children: /* @__PURE__ */ l("div", { className: "flex min-w-0 items-start justify-between gap-3", children: [
698
+ (T || S || G || P) && /* @__PURE__ */ t("div", { className: "relative border-b border-[var(--border)] px-4 py-3", children: /* @__PURE__ */ l("div", { className: "flex min-w-0 items-start justify-between gap-3", children: [
699
699
  /* @__PURE__ */ l("div", { className: "min-w-0", children: [
700
- L && /* @__PURE__ */ t("h2", { className: "truncate text-sm font-semibold text-[var(--text-main)]", children: L }),
700
+ T && /* @__PURE__ */ t("h2", { className: "truncate text-sm font-semibold text-[var(--text-main)]", children: T }),
701
701
  S && /* @__PURE__ */ t("p", { className: "mt-1 line-clamp-2 text-xs text-[var(--text-muted)]", children: S })
702
702
  ] }),
703
703
  (G || P) && /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-shrink-0 items-center justify-end gap-2", children: [
@@ -715,9 +715,9 @@ function Ks({
715
715
  children: /* @__PURE__ */ t(
716
716
  El,
717
717
  {
718
- value: I,
719
- onChange: H,
720
- placeholder: T,
718
+ value: H,
719
+ onChange: I,
720
+ placeholder: $,
721
721
  className: "w-full",
722
722
  autoFocus: ce,
723
723
  forceExpanded: !0,
@@ -735,7 +735,7 @@ function Ks({
735
735
  "aria-label": ce ? "Cerrar busqueda" : "Buscar tabs",
736
736
  "aria-expanded": ce,
737
737
  onClick: () => {
738
- ce && I && H(""), pe((ae) => !ae);
738
+ ce && H && I(""), pe((ae) => !ae);
739
739
  },
740
740
  className: `inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border transition-all duration-200 hover:scale-[1.03] active:scale-95 ${ce || V ? "border-[var(--primary)] bg-[var(--bg-input)] text-[var(--text-main)] shadow-sm" : "border-[var(--border)] text-[var(--text-muted)] hover:bg-[var(--bg-input)] hover:text-[var(--text-main)]"}`,
741
741
  children: /* @__PURE__ */ t("span", { className: "grid h-4 w-4 place-items-center transition-transform duration-200", children: ce || V ? /* @__PURE__ */ t(Ie, { className: "h-4 w-4" }) : /* @__PURE__ */ t(xt, { className: "h-4 w-4" }) })
@@ -748,8 +748,8 @@ function Ks({
748
748
  "div",
749
749
  {
750
750
  role: "tablist",
751
- "aria-label": L ?? "Modulos relacionados",
752
- className: `flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${R}`,
751
+ "aria-label": T ?? "Modulos relacionados",
752
+ className: `flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${j}`,
753
753
  children: re.length > 0 ? re.map((ae) => {
754
754
  const Me = ae.service === (se == null ? void 0 : se.service);
755
755
  return /* @__PURE__ */ t(
@@ -759,7 +759,7 @@ function Ks({
759
759
  role: "tab",
760
760
  "aria-selected": Me,
761
761
  disabled: ae.disabled,
762
- onClick: () => g(ae),
762
+ onClick: () => y(ae),
763
763
  onKeyDown: (Te) => ue(Te, ae),
764
764
  className: `inline-flex h-9 min-w-max items-center gap-2 rounded-md border px-3 text-xs font-semibold transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50 ${Me ? "border-[var(--primary)] bg-[var(--bg-card)] text-[var(--text-main)] shadow-sm" : "border-transparent text-[var(--text-muted)] hover:bg-[var(--bg-card)] hover:text-[var(--text-main)]"}`,
765
765
  children: ee ? ee(ae, Me) : /* @__PURE__ */ l(Re, { children: [
@@ -919,24 +919,24 @@ function Ys({
919
919
  minDate: n,
920
920
  displayMode: a = "inline"
921
921
  }) {
922
- const i = Ul(), u = Da(e || i), m = a === "popover", [f, p] = A(!1), h = le(null), [x, v] = A({
922
+ const i = Ul(), u = Da(e || i), m = a === "popover", [f, p] = B(!1), h = le(null), [x, v] = B({
923
923
  horizontal: "left",
924
924
  vertical: "bottom"
925
- }), [L, S] = A(u.year), [w, k] = A(u.month), [O, ee] = A("days"), z = 16, [Y, T] = A(0), q = L - 7 + Y, Z = Array.from({ length: z }, (W, s) => q + s);
925
+ }), [T, S] = B(u.year), [w, k] = B(u.month), [O, ee] = B("days"), z = 16, [Y, $] = B(0), q = T - 7 + Y, Z = Array.from({ length: z }, (W, s) => q + s);
926
926
  Q(() => {
927
927
  if (!m || !f || !h.current) return;
928
- const W = h.current.getBoundingClientRect(), s = 8, y = 280, D = 340, j = W.left + y > window.innerWidth - s, B = W.right - y >= s, ne = W.bottom + 8 + D > window.innerHeight - s, ce = W.top - 8 - D >= s;
928
+ const W = h.current.getBoundingClientRect(), s = 8, g = 280, E = 340, R = W.left + g > window.innerWidth - s, D = W.right - g >= s, ne = W.bottom + 8 + E > window.innerHeight - s, ce = W.top - 8 - E >= s;
929
929
  v({
930
- horizontal: j && B ? "right" : "left",
930
+ horizontal: R && D ? "right" : "left",
931
931
  vertical: ne && ce ? "top" : "bottom"
932
932
  });
933
933
  }, [m, f]), Q(() => {
934
934
  if (!m || !f) return;
935
- function W(y) {
936
- h.current && (h.current.contains(y.target) || p(!1));
935
+ function W(g) {
936
+ h.current && (h.current.contains(g.target) || p(!1));
937
937
  }
938
- function s(y) {
939
- y.key === "Escape" && p(!1);
938
+ function s(g) {
939
+ g.key === "Escape" && p(!1);
940
940
  }
941
941
  return document.addEventListener("mousedown", W), document.addEventListener("keydown", s), () => {
942
942
  document.removeEventListener("mousedown", W), document.removeEventListener("keydown", s);
@@ -948,14 +948,14 @@ function Ys({
948
948
  function P() {
949
949
  w === 12 ? (S((W) => W + 1), k(1)) : k((W) => W + 1);
950
950
  }
951
- const X = new Date(L, w - 1, 1).getDay(), J = new Date(L, w, 0).getDate(), E = [
951
+ const X = new Date(T, w - 1, 1).getDay(), J = new Date(T, w, 0).getDate(), L = [
952
952
  ...Array(X).fill(null),
953
953
  ...Array.from({ length: J }, (W, s) => s + 1)
954
954
  ];
955
- for (; E.length < Xr * 7; ) E.push(null);
956
- const R = E.slice(0, Xr * 7);
955
+ for (; L.length < Xr * 7; ) L.push(null);
956
+ const j = L.slice(0, Xr * 7);
957
957
  function U(W) {
958
- const s = ln(L, w, W);
958
+ const s = ln(T, w, W);
959
959
  n && s < n || (r(s), m && p(!1));
960
960
  }
961
961
  const _ = {
@@ -1005,7 +1005,7 @@ function Ys({
1005
1005
  {
1006
1006
  type: "button",
1007
1007
  onClick: () => {
1008
- ee("years"), T(0);
1008
+ ee("years"), $(0);
1009
1009
  },
1010
1010
  style: {
1011
1011
  background: "none",
@@ -1023,7 +1023,7 @@ function Ys({
1023
1023
  children: [
1024
1024
  Aa[w - 1],
1025
1025
  " ",
1026
- L,
1026
+ T,
1027
1027
  /* @__PURE__ */ t(Xe, { size: 13, style: { color: "var(--text-muted)" } })
1028
1028
  ]
1029
1029
  }
@@ -1043,7 +1043,7 @@ function Ys({
1043
1043
  "button",
1044
1044
  {
1045
1045
  type: "button",
1046
- onClick: () => T((W) => W - z),
1046
+ onClick: () => $((W) => W - z),
1047
1047
  style: _,
1048
1048
  children: /* @__PURE__ */ t(Tt, { size: 16 })
1049
1049
  }
@@ -1074,7 +1074,7 @@ function Ys({
1074
1074
  "button",
1075
1075
  {
1076
1076
  type: "button",
1077
- onClick: () => T((W) => W + z),
1077
+ onClick: () => $((W) => W + z),
1078
1078
  style: _,
1079
1079
  children: /* @__PURE__ */ t(st, { size: 16 })
1080
1080
  }
@@ -1093,7 +1093,7 @@ function Ys({
1093
1093
  marginBottom: 8
1094
1094
  },
1095
1095
  children: Wl.map((W, s) => {
1096
- const y = s + 1 === w;
1096
+ const g = s + 1 === w;
1097
1097
  return /* @__PURE__ */ t(
1098
1098
  "button",
1099
1099
  {
@@ -1104,10 +1104,10 @@ function Ys({
1104
1104
  cursor: "pointer",
1105
1105
  borderRadius: 6,
1106
1106
  fontSize: 11,
1107
- fontWeight: y ? 700 : 400,
1107
+ fontWeight: g ? 700 : 400,
1108
1108
  padding: "4px 0",
1109
- background: y ? "var(--primary)" : "transparent",
1110
- color: y ? "var(--primary-fg, #ffffff)" : "var(--text-secondary)"
1109
+ background: g ? "var(--primary)" : "transparent",
1110
+ color: g ? "var(--primary-fg, #ffffff)" : "var(--text-secondary)"
1111
1111
  },
1112
1112
  children: W
1113
1113
  },
@@ -1131,7 +1131,7 @@ function Ys({
1131
1131
  gap: 3
1132
1132
  },
1133
1133
  children: Z.map((W) => {
1134
- const s = W === L;
1134
+ const s = W === T;
1135
1135
  return /* @__PURE__ */ t(
1136
1136
  "button",
1137
1137
  {
@@ -1195,27 +1195,27 @@ function Ys({
1195
1195
  padding: "4px 8px 10px",
1196
1196
  gap: 2
1197
1197
  },
1198
- children: R.map((W, s) => {
1198
+ children: j.map((W, s) => {
1199
1199
  if (W === null)
1200
1200
  return /* @__PURE__ */ t("div", { style: { aspectRatio: "1" } }, s);
1201
- const y = ln(L, w, W), D = y === e, j = y === i, B = !!(n && y < n);
1201
+ const g = ln(T, w, W), E = g === e, R = g === i, D = !!(n && g < n);
1202
1202
  return /* @__PURE__ */ t(
1203
1203
  "button",
1204
1204
  {
1205
1205
  type: "button",
1206
- onClick: () => !B && U(W),
1206
+ onClick: () => !D && U(W),
1207
1207
  style: {
1208
1208
  width: "100%",
1209
1209
  aspectRatio: "1",
1210
1210
  borderRadius: 6,
1211
1211
  border: "none",
1212
- cursor: B ? "not-allowed" : "pointer",
1212
+ cursor: D ? "not-allowed" : "pointer",
1213
1213
  fontSize: 12,
1214
- fontWeight: D || j ? 700 : 400,
1215
- background: D ? "var(--primary)" : "transparent",
1216
- color: D ? "var(--primary-fg, #ffffff)" : B ? "var(--text-muted)" : "var(--text-main)",
1217
- opacity: B ? 0.4 : 1,
1218
- outline: j && !D ? "2px solid var(--primary)" : "none",
1214
+ fontWeight: E || R ? 700 : 400,
1215
+ background: E ? "var(--primary)" : "transparent",
1216
+ color: E ? "var(--primary-fg, #ffffff)" : D ? "var(--text-muted)" : "var(--text-main)",
1217
+ opacity: D ? 0.4 : 1,
1218
+ outline: R && !E ? "2px solid var(--primary)" : "none",
1219
1219
  outlineOffset: "-2px"
1220
1220
  },
1221
1221
  children: W
@@ -1354,22 +1354,22 @@ function Oa({
1354
1354
  className: h = "",
1355
1355
  style: x,
1356
1356
  children: v,
1357
- onClick: L,
1357
+ onClick: T,
1358
1358
  type: S = "button",
1359
1359
  ...w
1360
1360
  }) {
1361
- const [k, O] = A(!1), ee = le(null);
1361
+ const [k, O] = B(!1), ee = le(null);
1362
1362
  Q(() => () => {
1363
1363
  ee.current && window.clearTimeout(ee.current);
1364
1364
  }, []);
1365
- function z(T) {
1366
- O(!0), f == null || f(T), ee.current && window.clearTimeout(ee.current), ee.current = window.setTimeout(() => {
1365
+ function z($) {
1366
+ O(!0), f == null || f($), ee.current && window.clearTimeout(ee.current), ee.current = window.setTimeout(() => {
1367
1367
  O(!1), ee.current = null;
1368
1368
  }, r);
1369
1369
  }
1370
- async function Y(T) {
1370
+ async function Y($) {
1371
1371
  var Z;
1372
- if (m && T.stopPropagation(), L == null || L(T), T.defaultPrevented) return;
1372
+ if (m && $.stopPropagation(), T == null || T($), $.defaultPrevented) return;
1373
1373
  const q = Xl(e);
1374
1374
  if (q)
1375
1375
  try {
@@ -1504,101 +1504,101 @@ function At({
1504
1504
  className: h = "",
1505
1505
  style: x,
1506
1506
  dropdownMinWidth: v,
1507
- height: L = 40,
1507
+ height: T = 40,
1508
1508
  padding: S = "0 10px",
1509
1509
  searchable: w = !0,
1510
1510
  minOptionsForSearch: k = 6
1511
1511
  }) {
1512
- const [O, ee] = A(!1), [z, Y] = A(""), [T, q] = A(-1), [Z, te] = A(!1), [P, X] = A({}), J = le(null), E = le(null), R = le(null), U = le(null), _ = w && n.length >= k, oe = n.find((I) => I.value === e) ?? null, W = c === "ghost", s = a === "error" ? "var(--danger)" : O ? "var(--primary)" : "var(--border)", y = _ && z.trim() ? n.filter(
1513
- (I) => {
1514
- var M;
1515
- return I.label.toLowerCase().includes(z.toLowerCase()) || ((M = I.sublabel) == null ? void 0 : M.toLowerCase().includes(z.toLowerCase()));
1512
+ const [O, ee] = B(!1), [z, Y] = B(""), [$, q] = B(-1), [Z, te] = B(!1), [P, X] = B({}), J = le(null), L = le(null), j = le(null), U = le(null), _ = w && n.length >= k, oe = n.find((H) => H.value === e) ?? null, W = c === "ghost", s = a === "error" ? "var(--danger)" : O ? "var(--primary)" : "var(--border)", g = _ && z.trim() ? n.filter(
1513
+ (H) => {
1514
+ var A;
1515
+ return H.label.toLowerCase().includes(z.toLowerCase()) || ((A = H.sublabel) == null ? void 0 : A.toLowerCase().includes(z.toLowerCase()));
1516
1516
  }
1517
- ) : n, D = we(() => {
1518
- const I = J.current;
1519
- if (!I) return;
1520
- const M = I.getBoundingClientRect(), G = _ ? 272 : 212, V = window.innerHeight - M.bottom, re = V < G && M.top > V;
1517
+ ) : n, E = we(() => {
1518
+ const H = J.current;
1519
+ if (!H) return;
1520
+ const A = H.getBoundingClientRect(), G = _ ? 272 : 212, V = window.innerHeight - A.bottom, re = V < G && A.top > V;
1521
1521
  X({
1522
1522
  position: "fixed",
1523
- left: M.left,
1524
- top: re ? void 0 : M.bottom + 4,
1525
- bottom: re ? window.innerHeight - M.top + 4 : void 0,
1526
- width: M.width,
1523
+ left: A.left,
1524
+ top: re ? void 0 : A.bottom + 4,
1525
+ bottom: re ? window.innerHeight - A.top + 4 : void 0,
1526
+ width: A.width,
1527
1527
  minWidth: Zr(v),
1528
1528
  zIndex: 9999
1529
1529
  });
1530
1530
  }, [v, _]);
1531
1531
  Q(() => te(!0), []), Q(() => {
1532
1532
  if (!O) return;
1533
- function I(M) {
1533
+ function H(A) {
1534
1534
  var V, re;
1535
- const G = M.target;
1536
- !((V = J.current) != null && V.contains(G)) && !((re = E.current) != null && re.contains(G)) && (ee(!1), Y(""));
1535
+ const G = A.target;
1536
+ !((V = J.current) != null && V.contains(G)) && !((re = L.current) != null && re.contains(G)) && (ee(!1), Y(""));
1537
1537
  }
1538
- return document.addEventListener("mousedown", I), () => document.removeEventListener("mousedown", I);
1538
+ return document.addEventListener("mousedown", H), () => document.removeEventListener("mousedown", H);
1539
1539
  }, [O]), Q(() => {
1540
- O && (q(-1), D(), _ && setTimeout(() => {
1541
- var I;
1542
- return (I = R.current) == null ? void 0 : I.focus();
1540
+ O && (q(-1), E(), _ && setTimeout(() => {
1541
+ var H;
1542
+ return (H = j.current) == null ? void 0 : H.focus();
1543
1543
  }, 0));
1544
- }, [O, _, D]), Q(() => {
1544
+ }, [O, _, E]), Q(() => {
1545
1545
  if (O)
1546
- return window.addEventListener("resize", D), window.addEventListener("scroll", D, !0), () => {
1547
- window.removeEventListener("resize", D), window.removeEventListener("scroll", D, !0);
1546
+ return window.addEventListener("resize", E), window.addEventListener("scroll", E, !0), () => {
1547
+ window.removeEventListener("resize", E), window.removeEventListener("scroll", E, !0);
1548
1548
  };
1549
- }, [O, D]), Q(() => {
1550
- if (T < 0 || !U.current) return;
1551
- const I = U.current.children[T];
1552
- I == null || I.scrollIntoView({ block: "nearest" });
1553
- }, [T]);
1554
- const j = we(
1555
- (I) => {
1556
- r(I), ee(!1), Y("");
1549
+ }, [O, E]), Q(() => {
1550
+ if ($ < 0 || !U.current) return;
1551
+ const H = U.current.children[$];
1552
+ H == null || H.scrollIntoView({ block: "nearest" });
1553
+ }, [$]);
1554
+ const R = we(
1555
+ (H) => {
1556
+ r(H), ee(!1), Y("");
1557
1557
  },
1558
1558
  [r]
1559
- ), B = le(O);
1560
- B.current = O;
1561
- const ne = le(y);
1562
- ne.current = y;
1563
- const ce = le(T);
1564
- ce.current = T;
1559
+ ), D = le(O);
1560
+ D.current = O;
1561
+ const ne = le(g);
1562
+ ne.current = g;
1563
+ const ce = le($);
1564
+ ce.current = $;
1565
1565
  const pe = le(f);
1566
1566
  pe.current = f;
1567
- const $ = le(j);
1568
- $.current = j, Q(() => {
1569
- function I(M) {
1567
+ const M = le(R);
1568
+ M.current = R, Q(() => {
1569
+ function H(A) {
1570
1570
  var me, se;
1571
- const G = document.activeElement, V = ((me = J.current) == null ? void 0 : me.contains(G)) ?? !1, re = ((se = E.current) == null ? void 0 : se.contains(G)) ?? !1;
1571
+ const G = document.activeElement, V = ((me = J.current) == null ? void 0 : me.contains(G)) ?? !1, re = ((se = L.current) == null ? void 0 : se.contains(G)) ?? !1;
1572
1572
  if (!(!V && !re)) {
1573
- if (!B.current) {
1574
- (M.key === "Enter" || M.key === " " || M.key === "ArrowDown") && (M.preventDefault(), ee(!0));
1573
+ if (!D.current) {
1574
+ (A.key === "Enter" || A.key === " " || A.key === "ArrowDown") && (A.preventDefault(), ee(!0));
1575
1575
  return;
1576
1576
  }
1577
- switch (M.key) {
1577
+ switch (A.key) {
1578
1578
  case "ArrowDown":
1579
- M.preventDefault(), q((g) => Math.min(g + 1, ne.current.length - 1));
1579
+ A.preventDefault(), q((y) => Math.min(y + 1, ne.current.length - 1));
1580
1580
  break;
1581
1581
  case "ArrowUp":
1582
- M.preventDefault(), q((g) => Math.max(g - 1, pe.current ? -1 : 0));
1582
+ A.preventDefault(), q((y) => Math.max(y - 1, pe.current ? -1 : 0));
1583
1583
  break;
1584
1584
  case "Enter": {
1585
- M.preventDefault();
1586
- const g = ce.current, H = ne.current;
1587
- g === -1 && pe.current ? $.current("") : H[g] && !H[g].disabled && $.current(H[g].value);
1585
+ A.preventDefault();
1586
+ const y = ce.current, I = ne.current;
1587
+ y === -1 && pe.current ? M.current("") : I[y] && !I[y].disabled && M.current(I[y].value);
1588
1588
  break;
1589
1589
  }
1590
1590
  case "Escape":
1591
- M.preventDefault(), M.stopPropagation(), ee(!1), Y("");
1591
+ A.preventDefault(), A.stopPropagation(), ee(!1), Y("");
1592
1592
  break;
1593
1593
  }
1594
1594
  }
1595
1595
  }
1596
- return document.addEventListener("keydown", I), () => document.removeEventListener("keydown", I);
1596
+ return document.addEventListener("keydown", H), () => document.removeEventListener("keydown", H);
1597
1597
  }, []);
1598
1598
  const ie = /* @__PURE__ */ l(
1599
1599
  "div",
1600
1600
  {
1601
- ref: E,
1601
+ ref: L,
1602
1602
  "data-bonsaif-select-dropdown": "true",
1603
1603
  className: "rounded-xl shadow-xl overflow-hidden",
1604
1604
  style: {
@@ -1623,10 +1623,10 @@ function At({
1623
1623
  /* @__PURE__ */ t(
1624
1624
  "input",
1625
1625
  {
1626
- ref: R,
1626
+ ref: j,
1627
1627
  value: z,
1628
- onChange: (I) => {
1629
- Y(I.target.value), q(-1);
1628
+ onChange: (H) => {
1629
+ Y(H.target.value), q(-1);
1630
1630
  },
1631
1631
  placeholder: "Buscar…",
1632
1632
  className: "min-w-0 flex-1 text-sm bg-transparent outline-none",
@@ -1637,8 +1637,8 @@ function At({
1637
1637
  "button",
1638
1638
  {
1639
1639
  type: "button",
1640
- onMouseDown: (I) => {
1641
- I.preventDefault(), Y("");
1640
+ onMouseDown: (H) => {
1641
+ H.preventDefault(), Y("");
1642
1642
  },
1643
1643
  children: /* @__PURE__ */ t(
1644
1644
  Ie,
@@ -1670,70 +1670,70 @@ function At({
1670
1670
  {
1671
1671
  role: "option",
1672
1672
  "aria-selected": e === "",
1673
- onMouseDown: (I) => {
1674
- I.preventDefault(), j("");
1673
+ onMouseDown: (H) => {
1674
+ H.preventDefault(), R("");
1675
1675
  },
1676
1676
  onMouseEnter: () => q(-1),
1677
1677
  className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",
1678
1678
  style: {
1679
- background: T === -1 && !z.trim() ? "var(--bg-hover)" : "transparent",
1679
+ background: $ === -1 && !z.trim() ? "var(--bg-hover)" : "transparent",
1680
1680
  color: "var(--text-muted)",
1681
1681
  fontStyle: "italic"
1682
1682
  },
1683
1683
  children: f
1684
1684
  }
1685
1685
  ),
1686
- y.map((I, M) => {
1687
- const V = M === T, re = I.value === e;
1686
+ g.map((H, A) => {
1687
+ const V = A === $, re = H.value === e;
1688
1688
  return /* @__PURE__ */ l(
1689
1689
  "li",
1690
1690
  {
1691
1691
  role: "option",
1692
1692
  "aria-selected": re,
1693
1693
  onMouseDown: (me) => {
1694
- me.preventDefault(), I.disabled || j(I.value);
1694
+ me.preventDefault(), H.disabled || R(H.value);
1695
1695
  },
1696
- onMouseEnter: () => !I.disabled && q(M),
1696
+ onMouseEnter: () => !H.disabled && q(A),
1697
1697
  className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",
1698
1698
  style: {
1699
1699
  background: V ? "var(--bg-hover)" : re ? "color-mix(in srgb, var(--primary) 6%, transparent)" : "transparent",
1700
- color: I.disabled ? "var(--text-muted)" : "var(--text-main)",
1701
- cursor: I.disabled ? "not-allowed" : "pointer",
1700
+ color: H.disabled ? "var(--text-muted)" : "var(--text-main)",
1701
+ cursor: H.disabled ? "not-allowed" : "pointer",
1702
1702
  boxShadow: re ? "inset 2px 0 0 var(--primary)" : void 0
1703
1703
  },
1704
1704
  children: [
1705
- I.color && /* @__PURE__ */ t(
1705
+ H.color && /* @__PURE__ */ t(
1706
1706
  "span",
1707
1707
  {
1708
1708
  className: "flex-shrink-0 w-2.5 h-2.5 rounded-full",
1709
- style: { background: I.color }
1709
+ style: { background: H.color }
1710
1710
  }
1711
1711
  ),
1712
1712
  /* @__PURE__ */ l("span", { className: "min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden", children: [
1713
- /* @__PURE__ */ t("span", { className: "truncate", children: I.label }),
1714
- I.sublabel && /* @__PURE__ */ t(
1713
+ /* @__PURE__ */ t("span", { className: "truncate", children: H.label }),
1714
+ H.sublabel && /* @__PURE__ */ t(
1715
1715
  "span",
1716
1716
  {
1717
1717
  className: "min-w-0 flex-shrink truncate",
1718
1718
  style: { color: "var(--text-muted)", fontSize: 12 },
1719
- children: I.sublabel
1719
+ children: H.sublabel
1720
1720
  }
1721
1721
  )
1722
1722
  ] }),
1723
- I.badge && /* @__PURE__ */ t(
1723
+ H.badge && /* @__PURE__ */ t(
1724
1724
  "span",
1725
1725
  {
1726
1726
  className: "text-xs flex-shrink-0",
1727
1727
  style: { color: "var(--text-muted)" },
1728
- children: I.badge
1728
+ children: H.badge
1729
1729
  }
1730
1730
  )
1731
1731
  ]
1732
1732
  },
1733
- I.value
1733
+ H.value
1734
1734
  );
1735
1735
  }),
1736
- y.length === 0 && /* @__PURE__ */ t(
1736
+ g.length === 0 && /* @__PURE__ */ t(
1737
1737
  "li",
1738
1738
  {
1739
1739
  className: "px-3 py-4 text-sm text-center",
@@ -1759,10 +1759,10 @@ function At({
1759
1759
  {
1760
1760
  type: "button",
1761
1761
  disabled: p,
1762
- onClick: () => !p && ee((I) => !I),
1762
+ onClick: () => !p && ee((H) => !H),
1763
1763
  className: "flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",
1764
1764
  style: {
1765
- height: Zr(L),
1765
+ height: Zr(T),
1766
1766
  padding: Zr(S),
1767
1767
  background: W ? "transparent" : "var(--bg-input)",
1768
1768
  color: oe ? "var(--text-main)" : "var(--text-muted)",
@@ -1797,8 +1797,8 @@ function At({
1797
1797
  {
1798
1798
  role: "button",
1799
1799
  tabIndex: -1,
1800
- onMouseDown: (I) => {
1801
- I.preventDefault(), I.stopPropagation(), j("");
1800
+ onMouseDown: (H) => {
1801
+ H.preventDefault(), H.stopPropagation(), R("");
1802
1802
  },
1803
1803
  className: "flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",
1804
1804
  style: { color: "var(--text-muted)" },
@@ -1919,7 +1919,7 @@ function Ia({
1919
1919
  zIndex: h = 1e3,
1920
1920
  closeOnBackdrop: x = !0,
1921
1921
  closeOnEscape: v = !0,
1922
- showCloseButton: L = !0,
1922
+ showCloseButton: T = !0,
1923
1923
  placement: S = "center",
1924
1924
  bodyClassName: w = "px-6 py-5",
1925
1925
  panelClassName: k = "",
@@ -1927,9 +1927,9 @@ function Ia({
1927
1927
  contentClassName: ee = "p-4",
1928
1928
  ariaLabel: z,
1929
1929
  frameless: Y = !1,
1930
- disabled: T = !1
1930
+ disabled: $ = !1
1931
1931
  }) {
1932
- const [q, Z] = A(!1), [te, P] = A(!1), X = le(null);
1932
+ const [q, Z] = B(!1), [te, P] = B(!1), X = le(null);
1933
1933
  if (Q(() => (e ? (X.current && clearTimeout(X.current), Z(!0), requestAnimationFrame(() => requestAnimationFrame(() => P(!0)))) : (P(!1), X.current = setTimeout(
1934
1934
  () => Z(!1),
1935
1935
  vr + 40
@@ -1947,7 +1947,7 @@ function Ia({
1947
1947
  };
1948
1948
  return window.addEventListener("keydown", oe), () => window.removeEventListener("keydown", oe);
1949
1949
  }, [v, r, e]), !q) return null;
1950
- const J = n || a || i || c || L, E = p ?? Zl[f], R = S === "bottom-mobile" ? "items-end sm:items-center justify-center p-0 sm:p-4" : "items-center justify-center", U = S === "bottom-mobile" ? "rounded-t-2xl sm:rounded-2xl" : "rounded-2xl", _ = te ? "translateY(0) scale(1)" : S === "bottom-mobile" ? "translateY(16px) scale(0.98)" : "translateY(10px) scale(0.96)";
1950
+ const J = n || a || i || c || T, L = p ?? Zl[f], j = S === "bottom-mobile" ? "items-end sm:items-center justify-center p-0 sm:p-4" : "items-center justify-center", U = S === "bottom-mobile" ? "rounded-t-2xl sm:rounded-2xl" : "rounded-2xl", _ = te ? "translateY(0) scale(1)" : S === "bottom-mobile" ? "translateY(16px) scale(0.98)" : "translateY(10px) scale(0.96)";
1951
1951
  return Ze(
1952
1952
  /* @__PURE__ */ l(
1953
1953
  "div",
@@ -1956,7 +1956,7 @@ function Ia({
1956
1956
  "aria-modal": "true",
1957
1957
  "data-bonsaif-overlay": "true",
1958
1958
  "aria-label": z ?? n,
1959
- className: `fixed inset-0 flex ${R} ${ee}`,
1959
+ className: `fixed inset-0 flex ${j} ${ee}`,
1960
1960
  style: { zIndex: h },
1961
1961
  children: [
1962
1962
  /* @__PURE__ */ t(
@@ -1975,7 +1975,7 @@ function Ia({
1975
1975
  {
1976
1976
  className: `relative z-10 flex max-h-[92dvh] w-full flex-col overflow-hidden ${Y ? "shadow-none" : "shadow-2xl"} ${U} ${k}`,
1977
1977
  style: {
1978
- maxWidth: E,
1978
+ maxWidth: L,
1979
1979
  background: Y ? "transparent" : "var(--bg-card)",
1980
1980
  border: Y ? "none" : "1px solid var(--border)",
1981
1981
  opacity: te ? 1 : 0,
@@ -1984,7 +1984,7 @@ function Ia({
1984
1984
  },
1985
1985
  onClick: (oe) => oe.stopPropagation(),
1986
1986
  children: [
1987
- T && /* @__PURE__ */ t(
1987
+ $ && /* @__PURE__ */ t(
1988
1988
  "div",
1989
1989
  {
1990
1990
  className: "absolute inset-0 z-[1002] cursor-not-allowed rounded-2xl",
@@ -2023,7 +2023,7 @@ function Ia({
2023
2023
  ] }),
2024
2024
  /* @__PURE__ */ l("div", { className: "flex flex-shrink-0 items-center gap-2", children: [
2025
2025
  c,
2026
- L && /* @__PURE__ */ t(Be, { variant: "icon", onClick: r, title: "Cerrar", children: /* @__PURE__ */ t(Ie, { className: "h-5 w-5" }) })
2026
+ T && /* @__PURE__ */ t(Be, { variant: "icon", onClick: r, title: "Cerrar", children: /* @__PURE__ */ t(Ie, { className: "h-5 w-5" }) })
2027
2027
  ] })
2028
2028
  ]
2029
2029
  }
@@ -2429,7 +2429,7 @@ function pi({
2429
2429
  getRowCanExpand: h,
2430
2430
  expandedRowIds: x,
2431
2431
  defaultExpandedRowIds: v = [],
2432
- onExpandedRowIdsChange: L,
2432
+ onExpandedRowIdsChange: T,
2433
2433
  expandOnRowClick: S = !1,
2434
2434
  selected: w,
2435
2435
  onToggleOne: k,
@@ -2437,39 +2437,39 @@ function pi({
2437
2437
  highlightSelected: ee = !0,
2438
2438
  rowClassName: z,
2439
2439
  getRowCategory: Y,
2440
- stickyHeader: T = !0,
2440
+ stickyHeader: $ = !0,
2441
2441
  pageSize: q = 25,
2442
2442
  pageSizeOptions: Z = [25, 50, 100],
2443
2443
  pageSizeSelectWidth: te = 62,
2444
2444
  pageSizeSelectHeight: P = 30,
2445
2445
  pageSizeSelectPadding: X = "0 7px",
2446
2446
  totalRows: J,
2447
- page: E,
2448
- onPageChange: R,
2447
+ page: L,
2448
+ onPageChange: j,
2449
2449
  onPageSizeChange: U,
2450
2450
  storageKey: _,
2451
2451
  stickyFirstColumn: oe = !1,
2452
2452
  bottomOffset: W = 0,
2453
2453
  compact: s = !0,
2454
- restrictHeight: y = !0,
2455
- maxHeight: D,
2456
- minTableWidth: j,
2457
- enableColumnVisibility: B = !0,
2454
+ restrictHeight: g = !0,
2455
+ maxHeight: E,
2456
+ minTableWidth: R,
2457
+ enableColumnVisibility: D = !0,
2458
2458
  enableColumnFilters: ne = !0,
2459
2459
  hiddenColumnKeys: ce,
2460
2460
  defaultHiddenColumnKeys: pe = li,
2461
- onHiddenColumnKeysChange: $,
2461
+ onHiddenColumnKeysChange: M,
2462
2462
  columnVisibilityLabel: ie = "Columnas",
2463
- enableBql: I = !1,
2464
- bqlValue: M,
2463
+ enableBql: H = !1,
2464
+ bqlValue: A,
2465
2465
  defaultBqlValue: G = "",
2466
2466
  onBqlChange: V,
2467
2467
  bqlDescription: re = "Filtra registros con Bonsaif Query Language",
2468
2468
  bqlPlaceholder: me = `status = activo
2469
2469
  rol IN (admin, employee)`,
2470
2470
  bqlQuickFilters: se = [],
2471
- bqlExamples: g = [],
2472
- bqlSuggestions: H = [],
2471
+ bqlExamples: y = [],
2472
+ bqlSuggestions: I = [],
2473
2473
  bqlActiveFilters: ue,
2474
2474
  bqlError: be,
2475
2475
  onQueryChange: Se,
@@ -2480,29 +2480,29 @@ rol IN (admin, employee)`,
2480
2480
  var Wn;
2481
2481
  const fe = di(he), ze = Object.values(fe).some(Boolean), Qe = e.map((o) => o.key).join(","), qe = pe.join(","), ae = le(e), Me = le(pe);
2482
2482
  ae.current = e, Me.current = pe;
2483
- const [Te, _e] = A(
2483
+ const [Te, _e] = B(
2484
2484
  !_ || !ze
2485
- ), De = le(null), et = le(!_), Fe = ce !== void 0, [Va, Dt] = A(() => pt(pe, e)), Pe = pt(
2485
+ ), De = le(null), et = le(!_), Fe = ce !== void 0, [Va, Dt] = B(() => pt(pe, e)), Pe = pt(
2486
2486
  Fe ? ce : Va,
2487
2487
  e
2488
- ), [ot, Kt] = A(!1), [ct, Ya] = A("filter"), [Bt, Vt] = A(
2488
+ ), [ot, Kt] = B(!1), [ct, Ya] = B("filter"), [Bt, Vt] = B(
2489
2489
  null
2490
- ), [mn, bn] = A(""), [We, Ot] = A({}), [Ke, Yt] = A({}), Tr = x !== void 0, [fn, Ga] = A(v), It = M !== void 0, [Xa, Ar] = A(G), tt = It ? M : Xa, [Gt, Xt] = A(tt), [rt, dt] = A(!1), [pn, gt] = A(!1), [hn, yt] = A(!1), [Rt, Ht] = A([]), Dr = le(null), vn = le(null), Br = le(null), [Za, Ja] = A(
2490
+ ), [mn, bn] = B(""), [We, Ot] = B({}), [Ke, Yt] = B({}), Tr = x !== void 0, [fn, Ga] = B(v), It = A !== void 0, [Xa, Ar] = B(G), tt = It ? A : Xa, [Gt, Xt] = B(tt), [rt, dt] = B(!1), [pn, gt] = B(!1), [hn, yt] = B(!1), [Rt, Ht] = B([]), Dr = le(null), vn = le(null), Br = le(null), [Za, Ja] = B(
2491
2491
  {}
2492
- ), [Qa, eo] = A(
2492
+ ), [Qa, eo] = B(
2493
2493
  {}
2494
- ), [jt, Zt] = A(!1), Or = le(null), Jt = le(null), [to, ro] = A(
2494
+ ), [jt, Zt] = B(!1), Or = le(null), Jt = le(null), [to, ro] = B(
2495
2495
  {}
2496
- ), xn = le(null), Qt = le(null), [Ir, gn] = A(
2496
+ ), xn = le(null), Qt = le(null), [Ir, gn] = B(
2497
2497
  r.length > 0 || a || m === !1
2498
- ), yn = (o, d) => 50 + (o * 17 + d * 13 + 7) % 40, lt = le(null), [no, ao] = A(
2498
+ ), yn = (o, d) => 50 + (o * 17 + d * 13 + 7) % 40, lt = le(null), [no, ao] = B(
2499
2499
  void 0
2500
- ), [wn, oo] = A(0), [Rr, lo] = A(!1);
2500
+ ), [wn, oo] = B(0), [Rr, lo] = B(!1);
2501
2501
  Q(() => {
2502
2502
  function o() {
2503
2503
  lo(window.innerWidth < 640);
2504
2504
  }
2505
- if (!y || D !== void 0)
2505
+ if (!g || E !== void 0)
2506
2506
  return o(), window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
2507
2507
  const C = q !== !1 ? 48 : 0, b = 12;
2508
2508
  function K() {
@@ -2516,8 +2516,8 @@ rol IN (admin, employee)`,
2516
2516
  );
2517
2517
  }
2518
2518
  return K(), window.addEventListener("resize", K), () => window.removeEventListener("resize", K);
2519
- }, [a, q, W, y, D]);
2520
- const Nn = y ? D ?? no : void 0;
2519
+ }, [a, q, W, g, E]);
2520
+ const Nn = g ? E ?? no : void 0;
2521
2521
  Q(() => {
2522
2522
  const o = lt.current;
2523
2523
  if (!o) return;
@@ -2537,13 +2537,13 @@ rol IN (admin, employee)`,
2537
2537
  }, m);
2538
2538
  return () => window.clearTimeout(o);
2539
2539
  }, [r.length, m, Ir, a]);
2540
- const [wt, zt] = A(
2540
+ const [wt, zt] = B(
2541
2541
  () => e.map((o) => o.key)
2542
- ), [Nt, Ft] = A(
2542
+ ), [Nt, Ft] = B(
2543
2543
  () => Object.fromEntries(
2544
2544
  e.map((o) => [o.key, nt(o, ft(o.width))])
2545
2545
  )
2546
- ), [$e, kt] = A(null), [io, er] = A(1), [tr, Hr] = A(
2546
+ ), [$e, kt] = B(null), [io, er] = B(1), [tr, Hr] = B(
2547
2547
  q === !1 ? 0 : q
2548
2548
  );
2549
2549
  Q(() => {
@@ -2835,7 +2835,7 @@ rol IN (admin, employee)`,
2835
2835
  }, [rt, ar]);
2836
2836
  function Mn(o) {
2837
2837
  const d = pt(o, e);
2838
- Fe || Dt(d), $ == null || $(d);
2838
+ Fe || Dt(d), M == null || M(d);
2839
2839
  }
2840
2840
  function po(o) {
2841
2841
  Mn(
@@ -2945,7 +2945,7 @@ rol IN (admin, employee)`,
2945
2945
  document.removeEventListener("pointermove", o), document.removeEventListener("pointerup", d);
2946
2946
  };
2947
2947
  }, [e]);
2948
- const or = le(null), [An, Pr] = A(null);
2948
+ const or = le(null), [An, Pr] = B(null);
2949
2949
  function xo(o, d) {
2950
2950
  or.current = wt.indexOf(o), d.dataTransfer.effectAllowed = "move";
2951
2951
  }
@@ -2975,7 +2975,7 @@ rol IN (admin, employee)`,
2975
2975
  }, [r]), Q(() => {
2976
2976
  er(1);
2977
2977
  }, [Ke, We]);
2978
- const ut = !!(R && U), mt = q !== !1, He = ut ? E ?? 1 : io, Ye = ut || mt ? tr : r.length, Ge = !!w && !!k && !!O, Ct = !!p, Dn = je.useMemo(
2978
+ const ut = !!(j && U), mt = q !== !1, He = ut ? L ?? 1 : io, Ye = ut || mt ? tr : r.length, Ge = !!w && !!k && !!O, Ct = !!p, Dn = je.useMemo(
2979
2979
  () => new Set(
2980
2980
  Tr ? Array.from(x ?? []) : fn
2981
2981
  ),
@@ -3014,16 +3014,16 @@ rol IN (admin, employee)`,
3014
3014
  function Ur(o) {
3015
3015
  if (a) return;
3016
3016
  const d = Math.max(1, Math.min(o, qr));
3017
- ut ? R(d) : er(d);
3017
+ ut ? j(d) : er(d);
3018
3018
  }
3019
3019
  function Lo(o) {
3020
- a || (Hr(o), ut ? (U(o), R(1)) : er(1), U && U(o));
3020
+ a || (Hr(o), ut ? (U(o), j(1)) : er(1), U && U(o));
3021
3021
  }
3022
3022
  function On(o) {
3023
3023
  const d = new Set(Dn);
3024
3024
  d.has(o) ? d.delete(o) : d.add(o);
3025
3025
  const C = Array.from(d);
3026
- Tr || Ga(C), L == null || L(C);
3026
+ Tr || Ga(C), T == null || T(C);
3027
3027
  }
3028
3028
  Q(() => {
3029
3029
  Se == null || Se({
@@ -3048,7 +3048,7 @@ rol IN (admin, employee)`,
3048
3048
  const In = (o) => o === "center" ? "text-center" : o === "right" ? "text-right" : "text-left", Mo = "color-mix(in srgb, var(--primary) 6%, var(--bg-card))", Kr = "linear-gradient(180deg, color-mix(in srgb, var(--bg-input) 90%, var(--bg-card)) 0%, color-mix(in srgb, var(--bg-input) 70%, var(--bg-card)) 100%)", ye = "color-mix(in srgb, var(--border) 62%, var(--bg-card))", Et = "color-mix(in srgb, var(--primary) 24%, var(--border))", ir = `inset 0 0 0 1px ${ye}`, Rn = Ve.reduce(
3049
3049
  (o, d) => o + (Nt[d.key] ?? ft(d.width)),
3050
3050
  (Ct ? 40 : 0) + (Ge ? 40 : 0)
3051
- ), Hn = typeof j == "number" ? j : typeof j == "string" ? Number(((Wn = j.match(/^(\d+(?:\.\d+)?)px$/)) == null ? void 0 : Wn[1]) ?? NaN) : NaN, Pt = Number.isFinite(Hn) ? Math.max(Rn, Hn, wn) : Math.max(Rn, wn), sr = j ?? Pt, $t = `${Ct ? "40px " : ""}${Ge ? "40px " : ""}${Ve.map((o) => `${Nt[o.key] ?? ft(o.width)}px`).join(" ")}`;
3051
+ ), Hn = typeof R == "number" ? R : typeof R == "string" ? Number(((Wn = R.match(/^(\d+(?:\.\d+)?)px$/)) == null ? void 0 : Wn[1]) ?? NaN) : NaN, Pt = Number.isFinite(Hn) ? Math.max(Rn, Hn, wn) : Math.max(Rn, wn), sr = R ?? Pt, $t = `${Ct ? "40px " : ""}${Ge ? "40px " : ""}${Ve.map((o) => `${Nt[o.key] ?? ft(o.width)}px`).join(" ")}`;
3052
3052
  Q(() => {
3053
3053
  $e && Pe.includes($e.key) && kt(null);
3054
3054
  }, [Pe, $e]);
@@ -3277,7 +3277,7 @@ rol IN (admin, employee)`,
3277
3277
  ]
3278
3278
  }
3279
3279
  ), dr = () => {
3280
- if (!ot || typeof document > "u" || ct === "visibility" && !B || ct === "filter" && !ne) return null;
3280
+ if (!ot || typeof document > "u" || ct === "visibility" && !D || ct === "filter" && !ne) return null;
3281
3281
  const o = e.find(
3282
3282
  (xe) => xe.key === Bt
3283
3283
  ), d = uo(), C = o ? Object.prototype.hasOwnProperty.call(We, o.key) : !1, b = o ? Ke[o.key] : void 0, K = Mr.find(
@@ -3691,8 +3691,8 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
3691
3691
  ),
3692
3692
  document.body
3693
3693
  ), br = () => {
3694
- const o = I && tt.trim().length > 0, d = ue != null && ue.length ? ue : o ? [{ key: "bql", label: "BQL", value: tt }] : [], C = H.filter((b) => b.trim() && b !== Gt).slice(0, 8);
3695
- return !B && jr === 0 && !I && !Ee ? null : /* @__PURE__ */ l(
3694
+ const o = H && tt.trim().length > 0, d = ue != null && ue.length ? ue : o ? [{ key: "bql", label: "BQL", value: tt }] : [], C = I.filter((b) => b.trim() && b !== Gt).slice(0, 8);
3695
+ return !D && jr === 0 && !H && !Ee ? null : /* @__PURE__ */ l(
3696
3696
  "div",
3697
3697
  {
3698
3698
  className: "relative flex min-h-9 flex-wrap items-center justify-between gap-2 border-b rounded-t-lg px-2 py-1",
@@ -3712,7 +3712,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
3712
3712
  ]
3713
3713
  }
3714
3714
  ),
3715
- I && /* @__PURE__ */ l(
3715
+ H && /* @__PURE__ */ l(
3716
3716
  "div",
3717
3717
  {
3718
3718
  ref: Dr,
@@ -3813,7 +3813,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
3813
3813
  },
3814
3814
  b.label
3815
3815
  )),
3816
- g.length > 0 && /* @__PURE__ */ l(
3816
+ y.length > 0 && /* @__PURE__ */ l(
3817
3817
  "button",
3818
3818
  {
3819
3819
  type: "button",
@@ -3977,7 +3977,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
3977
3977
  b
3978
3978
  ))
3979
3979
  ] }),
3980
- pn && g.length > 0 && /* @__PURE__ */ t("div", { className: "grid gap-2 sm:grid-cols-2 lg:grid-cols-3", children: g.map((b) => /* @__PURE__ */ l(
3980
+ pn && y.length > 0 && /* @__PURE__ */ t("div", { className: "grid gap-2 sm:grid-cols-2 lg:grid-cols-3", children: y.map((b) => /* @__PURE__ */ l(
3981
3981
  "button",
3982
3982
  {
3983
3983
  type: "button",
@@ -4049,7 +4049,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
4049
4049
  children: /* @__PURE__ */ t(Ko, { className: "h-4 w-4" })
4050
4050
  }
4051
4051
  ),
4052
- B && /* @__PURE__ */ t(
4052
+ D && /* @__PURE__ */ t(
4053
4053
  "button",
4054
4054
  {
4055
4055
  type: "button",
@@ -4190,7 +4190,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
4190
4190
  "div",
4191
4191
  {
4192
4192
  role: "rowgroup",
4193
- style: T ? {
4193
+ style: $ ? {
4194
4194
  position: "sticky",
4195
4195
  top: 0,
4196
4196
  zIndex: 10,
@@ -4290,7 +4290,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
4290
4290
  "div",
4291
4291
  {
4292
4292
  role: "rowgroup",
4293
- style: T ? {
4293
+ style: $ ? {
4294
4294
  position: "sticky",
4295
4295
  top: 0,
4296
4296
  zIndex: 10,
@@ -4392,7 +4392,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
4392
4392
  "div",
4393
4393
  {
4394
4394
  role: "rowgroup",
4395
- style: T ? {
4395
+ style: $ ? {
4396
4396
  position: "sticky",
4397
4397
  top: 0,
4398
4398
  zIndex: 10,
@@ -4472,7 +4472,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
4472
4472
  "div",
4473
4473
  {
4474
4474
  role: "rowgroup",
4475
- style: T ? {
4475
+ style: $ ? {
4476
4476
  position: "sticky",
4477
4477
  top: 0,
4478
4478
  zIndex: 10,
@@ -4718,7 +4718,7 @@ function gi({
4718
4718
  onCommit: a,
4719
4719
  onCancel: i
4720
4720
  }) {
4721
- const [c, u] = A(e), m = le(null), f = (n == null ? void 0 : n.preset) === "date", p = f ? "date" : r === "number" ? "number" : "text";
4721
+ const [c, u] = B(e), m = le(null), f = (n == null ? void 0 : n.preset) === "date", p = f ? "date" : r === "number" ? "number" : "text";
4722
4722
  return Q(() => {
4723
4723
  var h, x;
4724
4724
  (h = m.current) == null || h.focus(), f || (x = m.current) == null || x.select();
@@ -4746,7 +4746,7 @@ function yi({
4746
4746
  onCommit: a,
4747
4747
  onCancel: i
4748
4748
  }) {
4749
- const c = le(null), [u, m] = A(e);
4749
+ const c = le(null), [u, m] = B(e);
4750
4750
  return Q(() => {
4751
4751
  if (n) return;
4752
4752
  const f = setTimeout(() => {
@@ -4804,53 +4804,54 @@ function ec({
4804
4804
  readOnly: i = !1,
4805
4805
  ...c
4806
4806
  }) {
4807
- const [u, m] = A(r), f = le(null);
4807
+ const [u, m] = B(r), f = le(null);
4808
4808
  Q(() => {
4809
4809
  f.current || m(r);
4810
4810
  }, [r]);
4811
- const [p, h] = A(null);
4811
+ const [p, h] = B(null);
4812
4812
  f.current = p;
4813
- const [x, v] = A(null), L = le(null);
4814
- L.current = x;
4815
- const [S, w] = A({}), [k, O] = A({}), [ee, z] = A({}), Y = le(/* @__PURE__ */ new Set()), T = le(null);
4813
+ const [x, v] = B(null), T = le(null);
4814
+ T.current = x;
4815
+ const [S, w] = B({}), [k, O] = B({}), [ee, z] = B({}), Y = le(/* @__PURE__ */ new Set()), $ = le(null);
4816
4816
  Q(() => {
4817
- var s;
4818
- (s = T.current) == null || s.focus({ preventScroll: !0 });
4817
+ var g;
4818
+ const s = document.activeElement;
4819
+ (!s || s === document.body) && ((g = $.current) == null || g.focus({ preventScroll: !0 }));
4819
4820
  }, []);
4820
4821
  const q = e.map((s) => {
4821
- var y, D, j;
4822
- return `${s.key}:${((j = (D = (y = s.editable) == null ? void 0 : y.select) == null ? void 0 : D.options) == null ? void 0 : j.length) ?? -1}`;
4822
+ var g, E, R;
4823
+ return `${s.key}:${((R = (E = (g = s.editable) == null ? void 0 : g.select) == null ? void 0 : E.options) == null ? void 0 : R.length) ?? -1}`;
4823
4824
  }).join("|");
4824
4825
  Q(() => {
4825
4826
  e.forEach((s) => {
4826
- var j, B;
4827
- const y = (B = (j = s.editable) == null ? void 0 : j.select) == null ? void 0 : B.options;
4828
- if (!y) return;
4829
- const D = k[s.key];
4830
- (!Y.current.has(s.key) || (D == null ? void 0 : D.length) === 0 && y.length > 0) && (Y.current.add(s.key), O((ne) => ({ ...ne, [s.key]: y })));
4827
+ var R, D;
4828
+ const g = (D = (R = s.editable) == null ? void 0 : R.select) == null ? void 0 : D.options;
4829
+ if (!g) return;
4830
+ const E = k[s.key];
4831
+ (!Y.current.has(s.key) || (E == null ? void 0 : E.length) === 0 && g.length > 0) && (Y.current.add(s.key), O((ne) => ({ ...ne, [s.key]: g })));
4831
4832
  });
4832
4833
  }, [q]);
4833
4834
  const Z = we(
4834
- async (s, y) => {
4835
+ async (s, g) => {
4835
4836
  if (Y.current.has(s)) return;
4836
4837
  Y.current.add(s);
4837
- const { url: D, fetchOptions: j } = y.select ?? {};
4838
- if (!(!D && !j)) {
4839
- z((B) => ({ ...B, [s]: !0 }));
4838
+ const { url: E, fetchOptions: R } = g.select ?? {};
4839
+ if (!(!E && !R)) {
4840
+ z((D) => ({ ...D, [s]: !0 }));
4840
4841
  try {
4841
- let B = [];
4842
- if (j)
4843
- B = await j();
4844
- else if (D) {
4845
- const ne = await fetch(D);
4842
+ let D = [];
4843
+ if (R)
4844
+ D = await R();
4845
+ else if (E) {
4846
+ const ne = await fetch(E);
4846
4847
  if (!ne.ok) throw new Error("fetch failed");
4847
- B = await ne.json();
4848
+ D = await ne.json();
4848
4849
  }
4849
- O((ne) => ({ ...ne, [s]: B }));
4850
+ O((ne) => ({ ...ne, [s]: D }));
4850
4851
  } catch {
4851
- O((B) => ({ ...B, [s]: [] }));
4852
+ O((D) => ({ ...D, [s]: [] }));
4852
4853
  } finally {
4853
- z((B) => ({ ...B, [s]: !1 }));
4854
+ z((D) => ({ ...D, [s]: !1 }));
4854
4855
  }
4855
4856
  }
4856
4857
  },
@@ -4863,104 +4864,105 @@ function ec({
4863
4864
  X.current = n;
4864
4865
  const J = le(e);
4865
4866
  J.current = e;
4866
- const E = le(i);
4867
- E.current = i, Q(() => {
4867
+ const L = le(i);
4868
+ L.current = i, Q(() => {
4868
4869
  if (e.length > 0 && r.length > 0) {
4869
- const s = e.find((y) => y.selectable !== !1);
4870
+ const s = e.find((g) => g.selectable !== !1);
4870
4871
  s && v({ rowId: n(r[0]), colKey: s.key });
4871
4872
  }
4872
4873
  }, []), Q(() => {
4873
4874
  if (!x) return;
4874
- const s = T.current;
4875
+ const s = $.current;
4875
4876
  if (!s) return;
4876
- const y = s.querySelector(
4877
+ const g = s.querySelector(
4877
4878
  `[data-cell-id="${x.rowId}:${x.colKey}"]`
4878
4879
  );
4879
- if (!y) return;
4880
- const D = s.querySelector('[role="rowgroup"]');
4881
- y.style.scrollMarginTop = `${(D == null ? void 0 : D.offsetHeight) ?? 0}px`;
4882
- const j = s.querySelector('[role="row"]');
4883
- let B = 0;
4884
- j && j.querySelectorAll('[role="cell"], [role="columnheader"]').forEach((ne) => {
4885
- ne.style.position === "sticky" && ne.style.left !== "" && (B = Math.max(B, parseFloat(ne.style.left) + ne.offsetWidth));
4886
- }), y.style.scrollMarginLeft = `${B}px`, y.scrollIntoView({ block: "nearest", inline: "nearest" });
4880
+ if (!g) return;
4881
+ const E = s.querySelector('[role="rowgroup"]');
4882
+ g.style.scrollMarginTop = `${(E == null ? void 0 : E.offsetHeight) ?? 0}px`;
4883
+ const R = s.querySelector('[role="row"]');
4884
+ let D = 0;
4885
+ R && R.querySelectorAll('[role="cell"], [role="columnheader"]').forEach((ne) => {
4886
+ ne.style.position === "sticky" && ne.style.left !== "" && (D = Math.max(D, parseFloat(ne.style.left) + ne.offsetWidth));
4887
+ }), g.style.scrollMarginLeft = `${D}px`, g.scrollIntoView({ block: "nearest", inline: "nearest" });
4887
4888
  }, [x]);
4888
- const R = we(
4889
+ const j = we(
4889
4890
  (s) => {
4890
- var B;
4891
- const y = J.current, D = /* @__PURE__ */ new Set(), j = [];
4892
- (B = T.current) == null || B.querySelectorAll("[data-cell-id]").forEach((ne) => {
4891
+ var D;
4892
+ const g = J.current, E = /* @__PURE__ */ new Set(), R = [];
4893
+ (D = $.current) == null || D.querySelectorAll("[data-cell-id]").forEach((ne) => {
4893
4894
  const ce = ne.dataset.cellId.split(":")[0];
4894
- D.has(ce) || (D.add(ce), j.push(ce));
4895
+ E.has(ce) || (E.add(ce), R.push(ce));
4895
4896
  }), v((ne) => {
4896
4897
  if (!ne) return ne;
4897
- const ce = y.findIndex((I) => I.key === ne.colKey), pe = j.indexOf(ne.rowId);
4898
- let $ = ce, ie = pe;
4898
+ const ce = g.findIndex((H) => H.key === ne.colKey), pe = R.indexOf(ne.rowId);
4899
+ let M = ce, ie = pe;
4899
4900
  if (s === "up") ie = Math.max(0, pe - 1);
4900
- else if (s === "down") ie = Math.min(j.length - 1, pe + 1);
4901
+ else if (s === "down") ie = Math.min(R.length - 1, pe + 1);
4901
4902
  else if (s === "left") {
4902
- let I = ce - 1;
4903
- for (; I >= 0 && y[I].selectable === !1; ) I--;
4904
- I >= 0 && ($ = I);
4903
+ let H = ce - 1;
4904
+ for (; H >= 0 && g[H].selectable === !1; ) H--;
4905
+ H >= 0 && (M = H);
4905
4906
  } else if (s === "right") {
4906
- let I = ce + 1;
4907
- for (; I < y.length && y[I].selectable === !1; ) I++;
4908
- I < y.length && ($ = I);
4907
+ let H = ce + 1;
4908
+ for (; H < g.length && g[H].selectable === !1; ) H++;
4909
+ H < g.length && (M = H);
4909
4910
  }
4910
- return $ === ce && ie === pe ? ne : { rowId: j[ie], colKey: y[$].key };
4911
+ return M === ce && ie === pe ? ne : { rowId: R[ie], colKey: g[M].key };
4911
4912
  });
4912
4913
  },
4913
4914
  []
4914
- ), U = we(() => {
4915
- const s = f.current;
4916
- h(null), s && v(s), setTimeout(() => {
4917
- var y;
4918
- return (y = T.current) == null ? void 0 : y.focus({ preventScroll: !0 });
4915
+ ), U = we((s = !0) => {
4916
+ const g = f.current;
4917
+ h(null), g && v(g), s && setTimeout(() => {
4918
+ var E;
4919
+ return (E = $.current) == null ? void 0 : E.focus({ preventScroll: !0 });
4919
4920
  }, 0);
4920
4921
  }, []), _ = we(
4921
- async (s, y, D) => {
4922
+ async (s, g, E) => {
4922
4923
  var se;
4923
- const j = J.current.find((g) => g.key === y);
4924
- if (!(j != null && j.editable)) return;
4925
- const { field: B, type: ne, mask: ce, validate: pe } = j.editable, $ = ne === "number" ? D === "" ? null : Number(D) : D;
4924
+ const R = J.current.find((y) => y.key === g);
4925
+ if (!(R != null && R.editable)) return;
4926
+ const { field: D, type: ne, mask: ce, validate: pe } = R.editable, M = ne === "number" ? E === "" ? null : Number(E) : E;
4926
4927
  if (ce) {
4927
- const g = vi(D, ce);
4928
- if (g) {
4929
- w((H) => ({ ...H, [`${s}:${y}`]: g }));
4928
+ const y = vi(E, ce);
4929
+ if (y) {
4930
+ w((I) => ({ ...I, [`${s}:${g}`]: y }));
4930
4931
  return;
4931
4932
  }
4932
4933
  }
4933
4934
  if (pe) {
4934
- const g = pe($);
4935
- if (g) {
4936
- w((H) => ({ ...H, [`${s}:${y}`]: g }));
4935
+ const y = pe(M);
4936
+ if (y) {
4937
+ w((I) => ({ ...I, [`${s}:${g}`]: y }));
4937
4938
  return;
4938
4939
  }
4939
4940
  }
4940
- const ie = X.current, I = te.current.find((g) => ie(g) === s);
4941
- if (!I) return;
4942
- const M = I[B];
4943
- h(null), w((g) => {
4944
- const H = { ...g };
4945
- return delete H[`${s}:${y}`], H;
4941
+ const ie = X.current, H = te.current.find((y) => ie(y) === s);
4942
+ if (!H) return;
4943
+ const A = H[D];
4944
+ h(null), w((y) => {
4945
+ const I = { ...y };
4946
+ return delete I[`${s}:${g}`], I;
4946
4947
  });
4947
- const G = te.current, V = G.findIndex((g) => ie(g) === s), re = G[Math.min(G.length - 1, V + 1)];
4948
- if (v({ rowId: ie(re), colKey: y }), setTimeout(() => {
4949
- var g;
4950
- return (g = T.current) == null ? void 0 : g.focus({ preventScroll: !0 });
4951
- }, 0), String(M ?? "") === String($ ?? "")) return;
4952
- const me = { ...I, [B]: $ };
4948
+ const G = te.current, V = G.findIndex((y) => ie(y) === s), re = G[Math.min(G.length - 1, V + 1)];
4949
+ if (v({ rowId: ie(re), colKey: g }), setTimeout(() => {
4950
+ var I, ue;
4951
+ const y = document.activeElement;
4952
+ (!y || y === document.body || (I = $.current) != null && I.contains(y)) && ((ue = $.current) == null || ue.focus({ preventScroll: !0 }));
4953
+ }, 0), String(A ?? "") === String(M ?? "")) return;
4954
+ const me = { ...H, [D]: M };
4953
4955
  m(
4954
- (g) => g.map((H) => ie(H) === s ? me : H)
4956
+ (y) => y.map((I) => ie(I) === s ? me : I)
4955
4957
  );
4956
4958
  try {
4957
- await ((se = P.current) == null ? void 0 : se.call(P, { row: I, rowId: s, field: B, oldValue: M, newValue: $ }));
4959
+ await ((se = P.current) == null ? void 0 : se.call(P, { row: H, rowId: s, field: D, oldValue: A, newValue: M }));
4958
4960
  } catch {
4959
4961
  m(
4960
- (g) => g.map((H) => ie(H) === s ? I : H)
4961
- ), w((g) => ({
4962
- ...g,
4963
- [`${s}:${y}`]: "Error al guardar. Intenta de nuevo."
4962
+ (y) => y.map((I) => ie(I) === s ? H : I)
4963
+ ), w((y) => ({
4964
+ ...y,
4965
+ [`${s}:${g}`]: "Error al guardar. Intenta de nuevo."
4964
4966
  }));
4965
4967
  }
4966
4968
  },
@@ -4968,8 +4970,8 @@ function ec({
4968
4970
  ), oe = we(
4969
4971
  (s) => {
4970
4972
  if (f.current) return;
4971
- const y = L.current;
4972
- if (!(!y || ![
4973
+ const g = T.current;
4974
+ if (!(!g || ![
4973
4975
  "ArrowUp",
4974
4976
  "ArrowDown",
4975
4977
  "ArrowLeft",
@@ -4980,40 +4982,40 @@ function ec({
4980
4982
  ].includes(s.key)))
4981
4983
  switch (s.preventDefault(), s.key) {
4982
4984
  case "ArrowUp":
4983
- R("up");
4985
+ j("up");
4984
4986
  break;
4985
4987
  case "ArrowDown":
4986
- R("down");
4988
+ j("down");
4987
4989
  break;
4988
4990
  case "ArrowLeft":
4989
- R("left");
4991
+ j("left");
4990
4992
  break;
4991
4993
  case "ArrowRight":
4992
- R("right");
4994
+ j("right");
4993
4995
  break;
4994
4996
  case "Tab":
4995
- R(s.shiftKey ? "left" : "right");
4997
+ j(s.shiftKey ? "left" : "right");
4996
4998
  break;
4997
4999
  case "Enter": {
4998
- const j = J.current.find((B) => B.key === y.colKey);
4999
- j != null && j.editable && !E.current ? (h(y), j.editable.type === "select" && !Y.current.has(y.colKey) && Z(y.colKey, j.editable)) : R("down");
5000
+ const R = J.current.find((D) => D.key === g.colKey);
5001
+ R != null && R.editable && !L.current ? (h(g), R.editable.type === "select" && !Y.current.has(g.colKey) && Z(g.colKey, R.editable)) : j("down");
5000
5002
  break;
5001
5003
  }
5002
5004
  }
5003
5005
  },
5004
- [R, Z]
5006
+ [j, Z]
5005
5007
  ), W = at(() => e.map((s) => {
5006
5008
  if (!s.editable || i) {
5007
- const { editable: D, selectable: j, ...B } = s;
5009
+ const { editable: E, selectable: R, ...D } = s;
5008
5010
  if (s.selectable === !1)
5009
- return { ...B, disableRowClick: !0 };
5010
- const ne = B.cell;
5011
+ return { ...D, disableRowClick: !0 };
5012
+ const ne = D.cell;
5011
5013
  return {
5012
- ...B,
5013
- className: `relative ${B.className ?? ""}`.trim(),
5014
+ ...D,
5015
+ className: `relative ${D.className ?? ""}`.trim(),
5014
5016
  disableRowClick: !0,
5015
5017
  cell: (ce) => {
5016
- const pe = n(ce), $ = (x == null ? void 0 : x.rowId) === pe && (x == null ? void 0 : x.colKey) === s.key;
5018
+ const pe = n(ce), M = (x == null ? void 0 : x.rowId) === pe && (x == null ? void 0 : x.colKey) === s.key;
5017
5019
  return /* @__PURE__ */ l(Re, { children: [
5018
5020
  /* @__PURE__ */ t(
5019
5021
  "span",
@@ -5022,11 +5024,11 @@ function ec({
5022
5024
  className: "absolute inset-0 z-10 cursor-default",
5023
5025
  onClick: () => {
5024
5026
  var ie;
5025
- v({ rowId: pe, colKey: s.key }), (ie = T.current) == null || ie.focus({ preventScroll: !0 });
5027
+ v({ rowId: pe, colKey: s.key }), (ie = $.current) == null || ie.focus({ preventScroll: !0 });
5026
5028
  }
5027
5029
  }
5028
5030
  ),
5029
- $ && /* @__PURE__ */ t(
5031
+ M && /* @__PURE__ */ t(
5030
5032
  "div",
5031
5033
  {
5032
5034
  className: "pointer-events-none absolute inset-0 z-20",
@@ -5038,34 +5040,34 @@ function ec({
5038
5040
  }
5039
5041
  };
5040
5042
  }
5041
- const y = s.editable;
5043
+ const g = s.editable;
5042
5044
  return {
5043
5045
  ...s,
5044
5046
  // Make the cell a positioned ancestor so the absolute edit overlay works
5045
5047
  className: `relative ${s.className ?? ""}`.trim(),
5046
5048
  disableRowClick: !0,
5047
- cell: (D) => {
5048
- const j = n(D), B = s.key, ne = (p == null ? void 0 : p.rowId) === j && (p == null ? void 0 : p.colKey) === B, ce = (x == null ? void 0 : x.rowId) === j && (x == null ? void 0 : x.colKey) === B, pe = S[`${j}:${B}`], $ = D[y.field], ie = String($ ?? ""), I = () => {
5049
+ cell: (E) => {
5050
+ const R = n(E), D = s.key, ne = (p == null ? void 0 : p.rowId) === R && (p == null ? void 0 : p.colKey) === D, ce = (x == null ? void 0 : x.rowId) === R && (x == null ? void 0 : x.colKey) === D, pe = S[`${R}:${D}`], M = E[g.field], ie = String(M ?? ""), H = () => {
5049
5051
  var G;
5050
- v({ rowId: j, colKey: B }), h({ rowId: j, colKey: B }), (G = T.current) == null || G.focus({ preventScroll: !0 }), y.type === "select" && !Y.current.has(B) && Z(B, y);
5052
+ v({ rowId: R, colKey: D }), h({ rowId: R, colKey: D }), (G = $.current) == null || G.focus({ preventScroll: !0 }), g.type === "select" && !Y.current.has(D) && Z(D, g);
5051
5053
  };
5052
5054
  if (ne) {
5053
- const G = y.type === "select" ? /* @__PURE__ */ t(
5055
+ const G = g.type === "select" ? /* @__PURE__ */ t(
5054
5056
  yi,
5055
5057
  {
5056
5058
  initialValue: ie,
5057
- options: k[B] ?? [],
5058
- loading: ee[B] ?? !1,
5059
- onCommit: (V) => _(j, B, V),
5059
+ options: k[D] ?? [],
5060
+ loading: ee[D] ?? !1,
5061
+ onCommit: (V) => _(R, D, V),
5060
5062
  onCancel: U
5061
5063
  }
5062
5064
  ) : /* @__PURE__ */ t(
5063
5065
  gi,
5064
5066
  {
5065
5067
  initialValue: ie,
5066
- type: y.type ?? "text",
5067
- mask: y.mask,
5068
- onCommit: (V) => _(j, B, V),
5068
+ type: g.type ?? "text",
5069
+ mask: g.mask,
5070
+ onCommit: (V) => _(R, D, V),
5069
5071
  onCancel: U
5070
5072
  }
5071
5073
  );
@@ -5079,14 +5081,14 @@ function ec({
5079
5081
  }
5080
5082
  );
5081
5083
  }
5082
- const M = s.cell(D);
5084
+ const A = s.cell(E);
5083
5085
  return /* @__PURE__ */ l(Re, { children: [
5084
5086
  /* @__PURE__ */ t(
5085
5087
  "span",
5086
5088
  {
5087
- "data-cell-id": `${j}:${B}`,
5089
+ "data-cell-id": `${R}:${D}`,
5088
5090
  className: "peer absolute inset-0 z-10 cursor-pointer",
5089
- onClick: I
5091
+ onClick: H
5090
5092
  }
5091
5093
  ),
5092
5094
  ce && /* @__PURE__ */ t(
@@ -5099,7 +5101,7 @@ function ec({
5099
5101
  /* @__PURE__ */ t("span", { className: "relative z-0 inline-flex items-center gap-1 pointer-events-none", children: pe ? /* @__PURE__ */ l("span", { className: "flex items-center gap-1 text-red-500", children: [
5100
5102
  /* @__PURE__ */ t(ya, { className: "h-3.5 w-3.5 shrink-0" }),
5101
5103
  /* @__PURE__ */ t("span", { className: "truncate text-xs", children: pe })
5102
- ] }) : /* @__PURE__ */ t("span", { className: "truncate", children: M }) }),
5104
+ ] }) : /* @__PURE__ */ t("span", { className: "truncate", children: A }) }),
5103
5105
  /* @__PURE__ */ t(Vo, { className: "pointer-events-none absolute right-1 top-1/2 z-0 h-3 w-3 -translate-y-1/2 shrink-0 text-[var(--text-muted)] opacity-0 transition-opacity peer-hover:opacity-40" })
5104
5106
  ] });
5105
5107
  }
@@ -5120,12 +5122,16 @@ function ec({
5120
5122
  return /* @__PURE__ */ t(
5121
5123
  "div",
5122
5124
  {
5123
- ref: T,
5125
+ ref: $,
5124
5126
  tabIndex: 0,
5125
5127
  onKeyDown: oe,
5126
5128
  onBlur: (s) => {
5127
- var y;
5128
- (y = T.current) != null && y.contains(s.relatedTarget) || U();
5129
+ var g;
5130
+ (g = $.current) != null && g.contains(s.relatedTarget) || setTimeout(() => {
5131
+ var R, D;
5132
+ const E = document.activeElement;
5133
+ E && ((R = E.closest) != null && R.call(E, "[data-bonsaif-select-dropdown]")) || (D = $.current) != null && D.contains(E) || U(!1);
5134
+ }, 0);
5129
5135
  },
5130
5136
  style: { width: "100%", minWidth: 0, outline: "none" },
5131
5137
  children: /* @__PURE__ */ t(
@@ -5232,7 +5238,7 @@ function tc({
5232
5238
  const p = {
5233
5239
  from: Wt(e),
5234
5240
  to: Wt(r)
5235
- }, h = Wt(a), [x, v] = A(
5241
+ }, h = Wt(a), [x, v] = B(
5236
5242
  Wt(i || e)
5237
5243
  );
5238
5244
  return Q(() => {
@@ -5257,8 +5263,8 @@ function tc({
5257
5263
  selected: p,
5258
5264
  month: x,
5259
5265
  onMonthChange: v,
5260
- onSelect: (L) => {
5261
- const S = L != null && L.from ? ea(L.from) : e, w = L != null && L.to ? ea(L.to) : "";
5266
+ onSelect: (T) => {
5267
+ const S = T != null && T.from ? ea(T.from) : e, w = T != null && T.to ? ea(T.to) : "";
5262
5268
  n({ startDate: S, endDate: w });
5263
5269
  },
5264
5270
  numberOfMonths: c,
@@ -5358,15 +5364,15 @@ function tc({
5358
5364
  }
5359
5365
  },
5360
5366
  formatters: {
5361
- formatCaption: (L) => ki(
5367
+ formatCaption: (T) => ki(
5362
5368
  new Intl.DateTimeFormat("es-MX", {
5363
5369
  month: "long",
5364
5370
  year: "numeric"
5365
- }).format(L)
5371
+ }).format(T)
5366
5372
  ),
5367
- formatWeekdayName: (L) => new Intl.DateTimeFormat("es-MX", {
5373
+ formatWeekdayName: (T) => new Intl.DateTimeFormat("es-MX", {
5368
5374
  weekday: "short"
5369
- }).format(L)
5375
+ }).format(T)
5370
5376
  },
5371
5377
  labels: {
5372
5378
  labelMonthDropdown: () => "Mes",
@@ -5423,40 +5429,40 @@ function rc({
5423
5429
  menuClassName: u = "",
5424
5430
  onOpenChange: m
5425
5431
  }) {
5426
- const [f, p] = A(!1), [h, x] = A(!1), [v, L] = A({}), S = le(null), w = le(null), k = we(
5427
- (T) => {
5428
- p(T), m == null || m(T);
5432
+ const [f, p] = B(!1), [h, x] = B(!1), [v, T] = B({}), S = le(null), w = le(null), k = we(
5433
+ ($) => {
5434
+ p($), m == null || m($);
5429
5435
  },
5430
5436
  [m]
5431
5437
  ), O = we(() => {
5432
- const T = S.current;
5433
- if (!T) return;
5434
- const q = T.getBoundingClientRect(), Z = typeof a == "number" ? a : q.width, te = typeof a == "number" ? a : Math.max(q.width, 180), P = n === "end" ? Math.max(8, q.right - te) : Math.min(q.left, window.innerWidth - te - 8), X = window.innerHeight - q.bottom, J = X < 240 && q.top > X ? void 0 : q.bottom + 6, E = J === void 0 ? window.innerHeight - q.top + 6 : void 0;
5435
- L({
5438
+ const $ = S.current;
5439
+ if (!$) return;
5440
+ const q = $.getBoundingClientRect(), Z = typeof a == "number" ? a : q.width, te = typeof a == "number" ? a : Math.max(q.width, 180), P = n === "end" ? Math.max(8, q.right - te) : Math.min(q.left, window.innerWidth - te - 8), X = window.innerHeight - q.bottom, J = X < 240 && q.top > X ? void 0 : q.bottom + 6, L = J === void 0 ? window.innerHeight - q.top + 6 : void 0;
5441
+ T({
5436
5442
  position: "fixed",
5437
5443
  zIndex: 9999,
5438
5444
  left: P,
5439
5445
  top: J,
5440
- bottom: E,
5446
+ bottom: L,
5441
5447
  width: Si(typeof a == "number" ? Z : a)
5442
5448
  });
5443
5449
  }, [n, a]);
5444
5450
  Q(() => x(!0), []), Q(() => {
5445
5451
  if (!f) return;
5446
5452
  O();
5447
- const T = (Z) => {
5453
+ const $ = (Z) => {
5448
5454
  var P, X;
5449
5455
  const te = Z.target;
5450
5456
  !((P = S.current) != null && P.contains(te)) && !((X = w.current) != null && X.contains(te)) && k(!1);
5451
5457
  }, q = (Z) => {
5452
5458
  Z.key === "Escape" && k(!1);
5453
5459
  };
5454
- return document.addEventListener("mousedown", T), window.addEventListener("keydown", q), window.addEventListener("resize", O), window.addEventListener("scroll", O, !0), () => {
5455
- document.removeEventListener("mousedown", T), window.removeEventListener("keydown", q), window.removeEventListener("resize", O), window.removeEventListener("scroll", O, !0);
5460
+ return document.addEventListener("mousedown", $), window.addEventListener("keydown", q), window.addEventListener("resize", O), window.addEventListener("scroll", O, !0), () => {
5461
+ document.removeEventListener("mousedown", $), window.removeEventListener("keydown", q), window.removeEventListener("resize", O), window.removeEventListener("scroll", O, !0);
5456
5462
  };
5457
5463
  }, [f, k, O]);
5458
- const ee = (T) => {
5459
- i || (T.key === "Enter" || T.key === " ") && (T.preventDefault(), k(!f));
5464
+ const ee = ($) => {
5465
+ i || ($.key === "Enter" || $.key === " ") && ($.preventDefault(), k(!f));
5460
5466
  }, z = cn(e) ? Ro(e, {
5461
5467
  onClick: () => {
5462
5468
  i || (ta(), k(!f));
@@ -5469,32 +5475,32 @@ function rc({
5469
5475
  "data-bonsaif-overlay": "true",
5470
5476
  className: `overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-1 shadow-xl ${u}`,
5471
5477
  style: v,
5472
- children: r.map((T) => /* @__PURE__ */ l("div", { children: [
5473
- T.separatorBefore && /* @__PURE__ */ t("div", { className: "my-1 border-t border-[var(--border)]" }),
5478
+ children: r.map(($) => /* @__PURE__ */ l("div", { children: [
5479
+ $.separatorBefore && /* @__PURE__ */ t("div", { className: "my-1 border-t border-[var(--border)]" }),
5474
5480
  /* @__PURE__ */ l(
5475
5481
  "button",
5476
5482
  {
5477
5483
  type: "button",
5478
5484
  role: "menuitem",
5479
- disabled: T.disabled,
5485
+ disabled: $.disabled,
5480
5486
  onClick: () => {
5481
5487
  var q;
5482
- T.disabled || (ta(), (q = T.onSelect) == null || q.call(T), k(!1));
5488
+ $.disabled || (ta(), (q = $.onSelect) == null || q.call($), k(!1));
5483
5489
  },
5484
5490
  className: "flex w-full min-w-0 items-start gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)] disabled:cursor-not-allowed disabled:opacity-50",
5485
5491
  style: {
5486
- color: T.danger ? "var(--danger)" : "var(--text-main)"
5492
+ color: $.danger ? "var(--danger)" : "var(--text-main)"
5487
5493
  },
5488
5494
  children: [
5489
- T.icon && /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: T.icon }),
5495
+ $.icon && /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: $.icon }),
5490
5496
  /* @__PURE__ */ l("span", { className: "min-w-0 flex-1", children: [
5491
- /* @__PURE__ */ t("span", { className: "block truncate text-sm font-medium", children: T.label }),
5492
- T.description && /* @__PURE__ */ t("span", { className: "block truncate text-xs text-[var(--text-muted)]", children: T.description })
5497
+ /* @__PURE__ */ t("span", { className: "block truncate text-sm font-medium", children: $.label }),
5498
+ $.description && /* @__PURE__ */ t("span", { className: "block truncate text-xs text-[var(--text-muted)]", children: $.description })
5493
5499
  ] })
5494
5500
  ]
5495
5501
  }
5496
5502
  )
5497
- ] }, T.id))
5503
+ ] }, $.id))
5498
5504
  }
5499
5505
  ) : null;
5500
5506
  return /* @__PURE__ */ l(
@@ -5529,7 +5535,7 @@ function nc({
5529
5535
  bodyClassName: h = "flex-1 overflow-y-auto px-6 py-5",
5530
5536
  width: x = 440,
5531
5537
  hasUnsavedChanges: v = !1,
5532
- unsavedChangesTitle: L = "Descartar cambios",
5538
+ unsavedChangesTitle: T = "Descartar cambios",
5533
5539
  unsavedChangesDescription: S = "Hay cambios sin guardar. Si cierras el drawer se perderán.",
5534
5540
  unsavedChangesConfirmLabel: w = "Descartar",
5535
5541
  unsavedChangesCancelLabel: k = "Seguir editando",
@@ -5537,7 +5543,7 @@ function nc({
5537
5543
  disabled: ee = !1,
5538
5544
  children: z
5539
5545
  }) {
5540
- const [Y, T] = A(!1), [q, Z] = A(!1), [te, P] = A(!1), X = we(() => {
5546
+ const [Y, $] = B(!1), [q, Z] = B(!1), [te, P] = B(!1), X = we(() => {
5541
5547
  Z(!0), requestAnimationFrame(() => {
5542
5548
  requestAnimationFrame(() => P(!0));
5543
5549
  });
@@ -5546,17 +5552,17 @@ function nc({
5546
5552
  () => Z(!1),
5547
5553
  Ei
5548
5554
  );
5549
- }, []), E = we(() => {
5555
+ }, []), L = we(() => {
5550
5556
  if (v) {
5551
5557
  X();
5552
5558
  return;
5553
5559
  }
5554
5560
  r();
5555
- }, [v, r, X]), R = we(() => {
5561
+ }, [v, r, X]), j = we(() => {
5556
5562
  P(!1), Z(!1), O == null || O(), r();
5557
5563
  }, [r, O]);
5558
5564
  return Q(() => {
5559
- T(!0);
5565
+ $(!0);
5560
5566
  }, []), Q(() => (document.body.style.overflow = e ? "hidden" : "", e || (P(!1), Z(!1)), () => {
5561
5567
  document.body.style.overflow = "";
5562
5568
  }), [e]), Q(() => {
@@ -5567,11 +5573,11 @@ function nc({
5567
5573
  J();
5568
5574
  return;
5569
5575
  }
5570
- E();
5576
+ L();
5571
5577
  }
5572
5578
  };
5573
5579
  return window.addEventListener("keydown", U), () => window.removeEventListener("keydown", U);
5574
- }, [J, q, e, E]), Y ? Ze(
5580
+ }, [J, q, e, L]), Y ? Ze(
5575
5581
  /* @__PURE__ */ l(
5576
5582
  "div",
5577
5583
  {
@@ -5583,7 +5589,7 @@ function nc({
5583
5589
  "div",
5584
5590
  {
5585
5591
  className: `absolute inset-0 ${ra}`,
5586
- onClick: E
5592
+ onClick: L
5587
5593
  }
5588
5594
  ),
5589
5595
  /* @__PURE__ */ l(
@@ -5603,7 +5609,7 @@ function nc({
5603
5609
  style: { borderBottom: "1px solid var(--border)" },
5604
5610
  children: [
5605
5611
  /* @__PURE__ */ l("div", { className: "flex items-center gap-3 min-w-0", children: [
5606
- /* @__PURE__ */ t(Be, { variant: "icon", onClick: E, title: "Cerrar", children: /* @__PURE__ */ t(Ie, { className: "w-5 h-5" }) }),
5612
+ /* @__PURE__ */ t(Be, { variant: "icon", onClick: L, title: "Cerrar", children: /* @__PURE__ */ t(Ie, { className: "w-5 h-5" }) }),
5607
5613
  i && /* @__PURE__ */ t("div", { className: "flex-shrink-0", children: i }),
5608
5614
  /* @__PURE__ */ l("div", { className: "min-w-0", children: [
5609
5615
  /* @__PURE__ */ t(
@@ -5632,7 +5638,7 @@ function nc({
5632
5638
  {
5633
5639
  variant: "secondary",
5634
5640
  size: "sm",
5635
- onClick: E,
5641
+ onClick: L,
5636
5642
  style: { background: "var(--bg-input)" },
5637
5643
  children: "Cancelar"
5638
5644
  }
@@ -5673,7 +5679,7 @@ function nc({
5673
5679
  {
5674
5680
  role: "dialog",
5675
5681
  "aria-modal": "true",
5676
- "aria-label": L,
5682
+ "aria-label": T,
5677
5683
  className: "fixed inset-0 z-[1001] flex items-center justify-center p-4",
5678
5684
  children: [
5679
5685
  /* @__PURE__ */ t(
@@ -5722,7 +5728,7 @@ function nc({
5722
5728
  {
5723
5729
  className: "mb-1 text-base font-semibold",
5724
5730
  style: { color: "var(--text-main, #0f2f2c)" },
5725
- children: L
5731
+ children: T
5726
5732
  }
5727
5733
  ),
5728
5734
  /* @__PURE__ */ t(
@@ -5752,7 +5758,7 @@ function nc({
5752
5758
  Be,
5753
5759
  {
5754
5760
  variant: "secondary",
5755
- onClick: R,
5761
+ onClick: j,
5756
5762
  className: "flex-1 border",
5757
5763
  style: {
5758
5764
  background: "var(--warning, #d97706)",
@@ -5983,16 +5989,16 @@ function Wa({
5983
5989
  required: x,
5984
5990
  ...v
5985
5991
  }) {
5986
- const [L, S] = A(() => !!v.autoFocus), [w, k] = A(!1), O = v.type === "password" && f, ee = O && w ? "text" : v.type, z = !!a, Y = z && i !== "tooltip", T = z && i !== "inline", q = p ? x : void 0, Z = z ? "border-[var(--danger)] focus:border-[var(--danger)]" : "", te = T ? O ? "pr-20" : "pr-10" : O ? "pr-10" : "", P = v.value !== void 0 ? String(v.value).length > 0 : v.defaultValue !== void 0 && String(v.defaultValue).length > 0, X = L || P, J = {
5992
+ const [T, S] = B(() => !!v.autoFocus), [w, k] = B(!1), O = v.type === "password" && f, ee = O && w ? "text" : v.type, z = !!a, Y = z && i !== "tooltip", $ = z && i !== "inline", q = p ? x : void 0, Z = z ? "border-[var(--danger)] focus:border-[var(--danger)]" : "", te = $ ? O ? "pr-20" : "pr-10" : O ? "pr-10" : "", P = v.value !== void 0 ? String(v.value).length > 0 : v.defaultValue !== void 0 && String(v.defaultValue).length > 0, X = T || P, J = {
5987
5993
  top: X ? 7 : 12,
5988
- color: L ? "var(--primary)" : "var(--text-muted)",
5994
+ color: T ? "var(--primary)" : "var(--text-muted)",
5989
5995
  fontSize: X ? 10 : 13,
5990
5996
  fontWeight: X ? 600 : 400,
5991
5997
  textTransform: X ? "uppercase" : "none"
5992
- }, E = (oe) => {
5998
+ }, L = (oe) => {
5993
5999
  var W;
5994
6000
  S(!0), (W = v.onFocus) == null || W.call(v, oe);
5995
- }, R = (oe) => {
6001
+ }, j = (oe) => {
5996
6002
  var W;
5997
6003
  S(!1), (W = v.onBlur) == null || W.call(v, oe);
5998
6004
  }, U = O ? /* @__PURE__ */ l(
@@ -6023,7 +6029,7 @@ function Wa({
6023
6029
  )
6024
6030
  ]
6025
6031
  }
6026
- ) : null, _ = T ? /* @__PURE__ */ t(
6032
+ ) : null, _ = $ ? /* @__PURE__ */ t(
6027
6033
  Ut,
6028
6034
  {
6029
6035
  as: "span",
@@ -6053,8 +6059,8 @@ function Wa({
6053
6059
  "aria-invalid": z || v["aria-invalid"],
6054
6060
  "data-has-value": P ? "true" : void 0,
6055
6061
  className: `h-11 w-full pt-5 ${te} ${Z} ${h}`,
6056
- onFocus: E,
6057
- onBlur: R
6062
+ onFocus: L,
6063
+ onBlur: j
6058
6064
  }
6059
6065
  ),
6060
6066
  /* @__PURE__ */ l(
@@ -6095,8 +6101,8 @@ function Wa({
6095
6101
  required: q,
6096
6102
  "aria-invalid": z || v["aria-invalid"],
6097
6103
  className: `w-full ${te} ${Z} ${h}`,
6098
- onFocus: E,
6099
- onBlur: R
6104
+ onFocus: L,
6105
+ onBlur: j
6100
6106
  }
6101
6107
  ),
6102
6108
  _,
@@ -6131,9 +6137,9 @@ function bc({
6131
6137
  onChange: f,
6132
6138
  ...p
6133
6139
  }) {
6134
- const [h, x] = A(
6140
+ const [h, x] = B(
6135
6141
  () => oa(m)
6136
- ), v = u !== void 0 ? oa(u) : h, L = n && v.length > 0 && !ja(v) ? a : void 0;
6142
+ ), v = u !== void 0 ? oa(u) : h, T = n && v.length > 0 && !ja(v) ? a : void 0;
6137
6143
  return /* @__PURE__ */ t(
6138
6144
  Wa,
6139
6145
  {
@@ -6143,7 +6149,7 @@ function bc({
6143
6149
  type: "text",
6144
6150
  inputMode: r,
6145
6151
  autoComplete: e,
6146
- error: c ?? L,
6152
+ error: c ?? T,
6147
6153
  errorDisplay: i,
6148
6154
  onChange: (w) => {
6149
6155
  u === void 0 && x(w.currentTarget.value), f == null || f(w);
@@ -6219,7 +6225,7 @@ function pc({
6219
6225
  appendFiles: h = !1,
6220
6226
  showFileList: x = !0,
6221
6227
  clearable: v = !0,
6222
- browseLabel: L = "Buscar archivos",
6228
+ browseLabel: T = "Buscar archivos",
6223
6229
  dropLabel: S = "Suelta los archivos aqui",
6224
6230
  emptyLabel: w = "Arrastra y suelta archivos",
6225
6231
  emptyDescription: k = "o haz click para buscarlos en tu equipo",
@@ -6227,7 +6233,7 @@ function pc({
6227
6233
  size: ee = "md",
6228
6234
  containerClassName: z = "",
6229
6235
  dropzoneClassName: Y = "",
6230
- fileListClassName: T = "",
6236
+ fileListClassName: $ = "",
6231
6237
  className: q = "",
6232
6238
  id: Z,
6233
6239
  accept: te,
@@ -6235,32 +6241,32 @@ function pc({
6235
6241
  required: X,
6236
6242
  ...J
6237
6243
  }) {
6238
- const E = Ho(), R = Z ?? E, U = le(null), [_, oe] = A(!1), [W, s] = A(c), y = i ?? W, D = !!n, j = v && y.length > 0 && !P, B = (re, me) => {
6244
+ const L = Ho(), j = Z ?? L, U = le(null), [_, oe] = B(!1), [W, s] = B(c), g = i ?? W, E = !!n, R = v && g.length > 0 && !P, D = (re, me) => {
6239
6245
  i === void 0 && s(re), u == null || u(re, me);
6240
6246
  }, ne = (re, me) => {
6241
6247
  const se = re.filter(
6242
6248
  (be) => la(be, te)
6243
- ), g = re.filter(
6249
+ ), y = re.filter(
6244
6250
  (be) => !la(be, te)
6245
- ), H = h ? [...y, ...se] : se, ue = Wi(H, f, p);
6246
- g.length > 0 && (m == null || m(g)), B(ue, me);
6251
+ ), I = h ? [...g, ...se] : se, ue = Wi(I, f, p);
6252
+ y.length > 0 && (m == null || m(y)), D(ue, me);
6247
6253
  }, ce = () => {
6248
6254
  var re;
6249
6255
  P || (re = U.current) == null || re.click();
6250
6256
  }, pe = (re) => {
6251
6257
  ne(Array.from(re.target.files ?? []), re), re.target.value = "";
6252
- }, $ = (re) => {
6258
+ }, M = (re) => {
6253
6259
  re.preventDefault(), P || oe(!0);
6254
6260
  }, ie = (re) => {
6255
6261
  re.currentTarget.contains(re.relatedTarget) || oe(!1);
6256
- }, I = (re) => {
6262
+ }, H = (re) => {
6257
6263
  re.preventDefault(), oe(!1), !P && ne(Array.from(re.dataTransfer.files), re);
6258
- }, M = (re) => {
6264
+ }, A = (re) => {
6259
6265
  re.key !== "Enter" && re.key !== " " || (re.preventDefault(), ce());
6260
6266
  }, G = (re) => {
6261
- B(y.filter((me, se) => se !== re));
6267
+ D(g.filter((me, se) => se !== re));
6262
6268
  }, V = () => {
6263
- B([]);
6269
+ D([]);
6264
6270
  };
6265
6271
  return /* @__PURE__ */ l("div", { className: `flex flex-col gap-2 ${z}`, children: [
6266
6272
  (e || a) && /* @__PURE__ */ l("div", { className: "inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]", children: [
@@ -6273,13 +6279,13 @@ function pc({
6273
6279
  {
6274
6280
  ...J,
6275
6281
  ref: U,
6276
- id: R,
6282
+ id: j,
6277
6283
  type: "file",
6278
6284
  accept: te,
6279
6285
  multiple: f,
6280
6286
  disabled: P,
6281
- required: X && y.length === 0,
6282
- "aria-invalid": D || J["aria-invalid"],
6287
+ required: X && g.length === 0,
6288
+ "aria-invalid": E || J["aria-invalid"],
6283
6289
  className: "sr-only",
6284
6290
  onChange: pe
6285
6291
  }
@@ -6289,33 +6295,33 @@ function pc({
6289
6295
  {
6290
6296
  role: "button",
6291
6297
  tabIndex: P ? -1 : 0,
6292
- "aria-controls": R,
6298
+ "aria-controls": j,
6293
6299
  "aria-disabled": P || void 0,
6294
- "aria-invalid": D || void 0,
6295
- className: `flex cursor-pointer flex-col items-center justify-center gap-3 rounded-lg border border-dashed bg-[var(--bg-card)] text-center outline-none transition-colors focus:border-[var(--primary)] focus:bg-[var(--bg-input)] ${_i[ee]} ${_ ? "border-[var(--primary)] bg-[var(--bg-input)]" : D ? "border-[var(--danger)]" : "border-[var(--border)]"} ${P ? "cursor-not-allowed opacity-60" : "hover:border-[var(--primary)] hover:bg-[var(--bg-input)]"} ${Y} ${q}`,
6300
+ "aria-invalid": E || void 0,
6301
+ className: `flex cursor-pointer flex-col items-center justify-center gap-3 rounded-lg border border-dashed bg-[var(--bg-card)] text-center outline-none transition-colors focus:border-[var(--primary)] focus:bg-[var(--bg-input)] ${_i[ee]} ${_ ? "border-[var(--primary)] bg-[var(--bg-input)]" : E ? "border-[var(--danger)]" : "border-[var(--border)]"} ${P ? "cursor-not-allowed opacity-60" : "hover:border-[var(--primary)] hover:bg-[var(--bg-input)]"} ${Y} ${q}`,
6296
6302
  onClick: ce,
6297
- onDragOver: $,
6303
+ onDragOver: M,
6298
6304
  onDragLeave: ie,
6299
- onDrop: I,
6300
- onKeyDown: M,
6305
+ onDrop: H,
6306
+ onKeyDown: A,
6301
6307
  children: [
6302
6308
  /* @__PURE__ */ t("span", { className: "flex h-10 w-10 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-input)] text-[var(--text-muted)]", children: /* @__PURE__ */ t(Yo, { className: "h-5 w-5" }) }),
6303
6309
  /* @__PURE__ */ l("span", { className: "space-y-1", children: [
6304
6310
  /* @__PURE__ */ t("span", { className: "block text-sm font-semibold text-[var(--text-main)]", children: _ ? S : w }),
6305
6311
  k && /* @__PURE__ */ t("span", { className: "block text-sm text-[var(--text-muted)]", children: k })
6306
6312
  ] }),
6307
- L && /* @__PURE__ */ t("span", { className: "inline-flex h-9 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] px-3 text-xs font-semibold text-[var(--text-main)] shadow-sm shadow-black/5 transition-colors", children: L })
6313
+ T && /* @__PURE__ */ t("span", { className: "inline-flex h-9 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] px-3 text-xs font-semibold text-[var(--text-main)] shadow-sm shadow-black/5 transition-colors", children: T })
6308
6314
  ]
6309
6315
  }
6310
6316
  ),
6311
- x && y.length > 0 && /* @__PURE__ */ l(
6317
+ x && g.length > 0 && /* @__PURE__ */ l(
6312
6318
  "div",
6313
6319
  {
6314
- className: `rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${T}`,
6320
+ className: `rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${$}`,
6315
6321
  children: [
6316
6322
  /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--border)] px-3 py-2", children: [
6317
6323
  /* @__PURE__ */ t("span", { className: "text-xs font-semibold uppercase text-[var(--text-muted)]", children: O }),
6318
- j && /* @__PURE__ */ t(
6324
+ R && /* @__PURE__ */ t(
6319
6325
  "button",
6320
6326
  {
6321
6327
  type: "button",
@@ -6326,7 +6332,7 @@ function pc({
6326
6332
  }
6327
6333
  )
6328
6334
  ] }),
6329
- /* @__PURE__ */ t("ul", { className: "divide-y divide-[var(--border)]", children: y.map((re, me) => /* @__PURE__ */ l(
6335
+ /* @__PURE__ */ t("ul", { className: "divide-y divide-[var(--border)]", children: g.map((re, me) => /* @__PURE__ */ l(
6330
6336
  "li",
6331
6337
  {
6332
6338
  className: "flex items-center gap-3 px-3 py-2",
@@ -6380,12 +6386,12 @@ function hc({
6380
6386
  onSave: f,
6381
6387
  onChange: p
6382
6388
  }) {
6383
- const [h, x] = A(
6389
+ const [h, x] = B(
6384
6390
  () => e.map((z) => ({ key: !1, type: "", ...z }))
6385
- ), [v, L] = A(""), [S, w] = A(""), k = we(
6391
+ ), [v, T] = B(""), [S, w] = B(""), k = we(
6386
6392
  (z, Y) => {
6387
- x((T) => {
6388
- const q = T.map((Z, te) => te === z ? { ...Z, ...Y } : Z);
6393
+ x(($) => {
6394
+ const q = $.map((Z, te) => te === z ? { ...Z, ...Y } : Z);
6389
6395
  return p == null || p(q), q;
6390
6396
  });
6391
6397
  },
@@ -6405,15 +6411,15 @@ function hc({
6405
6411
  w("Ese campo ya existe en el arreglo.");
6406
6412
  return;
6407
6413
  }
6408
- const T = {
6414
+ const $ = {
6409
6415
  name: z,
6410
6416
  key: !1,
6411
6417
  type: ((q = n[0]) == null ? void 0 : q.value) ?? ""
6412
6418
  };
6413
6419
  x((Z) => {
6414
- const te = [...Z, T];
6420
+ const te = [...Z, $];
6415
6421
  return p == null || p(te), te;
6416
- }), L(""), w("");
6422
+ }), T(""), w("");
6417
6423
  }, [n, h, v, p]);
6418
6424
  return /* @__PURE__ */ l(
6419
6425
  "div",
@@ -6472,7 +6478,7 @@ function hc({
6472
6478
  {
6473
6479
  size: "sm",
6474
6480
  checked: z.key ?? !1,
6475
- onChange: (T) => k(Y, { key: T.target.checked }),
6481
+ onChange: ($) => k(Y, { key: $.target.checked }),
6476
6482
  "aria-label": `${z.name} es clave`
6477
6483
  }
6478
6484
  ) }),
@@ -6480,7 +6486,7 @@ function hc({
6480
6486
  At,
6481
6487
  {
6482
6488
  value: z.type ?? "",
6483
- onChange: (T) => k(Y, { type: T }),
6489
+ onChange: ($) => k(Y, { type: $ }),
6484
6490
  options: n,
6485
6491
  placeholder: "—",
6486
6492
  emptyLabel: "—",
@@ -6516,7 +6522,7 @@ function hc({
6516
6522
  type: "text",
6517
6523
  value: v,
6518
6524
  onChange: (z) => {
6519
- L(z.currentTarget.value), S && w("");
6525
+ T(z.currentTarget.value), S && w("");
6520
6526
  },
6521
6527
  onKeyDown: (z) => {
6522
6528
  z.key === "Enter" && (z.preventDefault(), ee());
@@ -6602,24 +6608,24 @@ function vc({
6602
6608
  minOptionsForSearch: h = 6,
6603
6609
  maxVisibleValues: x = 2,
6604
6610
  truncateSelectedValues: v = !0,
6605
- emptyText: L = "Sin resultados",
6611
+ emptyText: T = "Sin resultados",
6606
6612
  clearLabel: S = "Limpiar seleccion"
6607
6613
  }) {
6608
- const [w, k] = A(!1), [O, ee] = A(""), [z, Y] = A(0), [T, q] = A(!1), [Z, te] = A({}), P = le(null), X = le(null), J = le(null), E = le(null), R = p && n.length >= h, U = at(() => new Set(e), [e]), _ = at(
6609
- () => n.filter(($) => U.has($.value)),
6614
+ const [w, k] = B(!1), [O, ee] = B(""), [z, Y] = B(0), [$, q] = B(!1), [Z, te] = B({}), P = le(null), X = le(null), J = le(null), L = le(null), j = p && n.length >= h, U = at(() => new Set(e), [e]), _ = at(
6615
+ () => n.filter((M) => U.has(M.value)),
6610
6616
  [n, U]
6611
6617
  ), oe = x === "all" ? _.length : x, W = _.slice(0, oe), s = Math.max(
6612
6618
  0,
6613
6619
  _.length - W.length
6614
- ), y = R && O.trim() ? n.filter(
6615
- ($) => {
6620
+ ), g = j && O.trim() ? n.filter(
6621
+ (M) => {
6616
6622
  var ie;
6617
- return $.label.toLowerCase().includes(O.toLowerCase()) || ((ie = $.sublabel) == null ? void 0 : ie.toLowerCase().includes(O.toLowerCase()));
6623
+ return M.label.toLowerCase().includes(O.toLowerCase()) || ((ie = M.sublabel) == null ? void 0 : ie.toLowerCase().includes(O.toLowerCase()));
6618
6624
  }
6619
- ) : n, D = we(() => {
6620
- const $ = P.current;
6621
- if (!$) return;
6622
- const ie = $.getBoundingClientRect(), I = R ? 304 : 244, M = window.innerHeight - ie.bottom, G = M < I && ie.top > M;
6625
+ ) : n, E = we(() => {
6626
+ const M = P.current;
6627
+ if (!M) return;
6628
+ const ie = M.getBoundingClientRect(), H = j ? 304 : 244, A = window.innerHeight - ie.bottom, G = A < H && ie.top > A;
6623
6629
  te({
6624
6630
  position: "fixed",
6625
6631
  left: ie.left,
@@ -6628,49 +6634,49 @@ function vc({
6628
6634
  width: ie.width,
6629
6635
  zIndex: 9999
6630
6636
  });
6631
- }, [R]), j = we(
6632
- ($) => {
6633
- Ki(e, $) || r($);
6637
+ }, [j]), R = we(
6638
+ (M) => {
6639
+ Ki(e, M) || r(M);
6634
6640
  },
6635
6641
  [r, e]
6636
- ), B = we(
6637
- ($) => {
6638
- const ie = n.find((M) => M.value === $);
6642
+ ), D = we(
6643
+ (M) => {
6644
+ const ie = n.find((A) => A.value === M);
6639
6645
  if (ie != null && ie.disabled) return;
6640
- const I = U.has($) ? e.filter((M) => M !== $) : [...e, $];
6641
- j(I);
6646
+ const H = U.has(M) ? e.filter((A) => A !== M) : [...e, M];
6647
+ R(H);
6642
6648
  },
6643
- [j, n, e, U]
6644
- ), ne = we(() => j([]), [j]);
6649
+ [R, n, e, U]
6650
+ ), ne = we(() => R([]), [R]);
6645
6651
  Q(() => q(!0), []), Q(() => {
6646
6652
  if (!w) return;
6647
- function $(ie) {
6648
- var M, G;
6649
- const I = ie.target;
6650
- !((M = P.current) != null && M.contains(I)) && !((G = X.current) != null && G.contains(I)) && (k(!1), ee(""));
6653
+ function M(ie) {
6654
+ var A, G;
6655
+ const H = ie.target;
6656
+ !((A = P.current) != null && A.contains(H)) && !((G = X.current) != null && G.contains(H)) && (k(!1), ee(""));
6651
6657
  }
6652
- return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
6658
+ return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
6653
6659
  }, [w]), Q(() => {
6654
- w && (Y(0), D(), R && setTimeout(() => {
6655
- var $;
6656
- return ($ = J.current) == null ? void 0 : $.focus();
6660
+ w && (Y(0), E(), j && setTimeout(() => {
6661
+ var M;
6662
+ return (M = J.current) == null ? void 0 : M.focus();
6657
6663
  }, 0));
6658
- }, [w, R, D]), Q(() => {
6664
+ }, [w, j, E]), Q(() => {
6659
6665
  if (w)
6660
- return window.addEventListener("resize", D), window.addEventListener("scroll", D, !0), () => {
6661
- window.removeEventListener("resize", D), window.removeEventListener("scroll", D, !0);
6666
+ return window.addEventListener("resize", E), window.addEventListener("scroll", E, !0), () => {
6667
+ window.removeEventListener("resize", E), window.removeEventListener("scroll", E, !0);
6662
6668
  };
6663
- }, [w, D]), Q(() => {
6664
- if (z < 0 || !E.current) return;
6665
- const $ = E.current.children[z];
6666
- $ == null || $.scrollIntoView({ block: "nearest" });
6669
+ }, [w, E]), Q(() => {
6670
+ if (z < 0 || !L.current) return;
6671
+ const M = L.current.children[z];
6672
+ M == null || M.scrollIntoView({ block: "nearest" });
6667
6673
  }, [z]);
6668
- function ce($) {
6674
+ function ce(M) {
6669
6675
  if (!w) {
6670
- ($.key === "Enter" || $.key === " " || $.key === "ArrowDown") && ($.preventDefault(), k(!0));
6676
+ (M.key === "Enter" || M.key === " " || M.key === "ArrowDown") && (M.preventDefault(), k(!0));
6671
6677
  return;
6672
6678
  }
6673
- $.key === "Escape" && ($.preventDefault(), k(!1), ee("")), $.key === "ArrowDown" && ($.preventDefault(), Y((ie) => Math.min(ie + 1, y.length - 1))), $.key === "ArrowUp" && ($.preventDefault(), Y((ie) => Math.max(ie - 1, 0))), $.key === "Enter" && y[z] && ($.preventDefault(), B(y[z].value)), $.key === "Backspace" && !O && e.length && ($.preventDefault(), j(e.slice(0, -1)));
6679
+ M.key === "Escape" && (M.preventDefault(), k(!1), ee("")), M.key === "ArrowDown" && (M.preventDefault(), Y((ie) => Math.min(ie + 1, g.length - 1))), M.key === "ArrowUp" && (M.preventDefault(), Y((ie) => Math.max(ie - 1, 0))), M.key === "Enter" && g[z] && (M.preventDefault(), D(g[z].value)), M.key === "Backspace" && !O && e.length && (M.preventDefault(), R(e.slice(0, -1)));
6674
6680
  }
6675
6681
  const pe = /* @__PURE__ */ l(
6676
6682
  "div",
@@ -6683,7 +6689,7 @@ function vc({
6683
6689
  border: "1px solid var(--border)"
6684
6690
  },
6685
6691
  children: [
6686
- R && /* @__PURE__ */ l(
6692
+ j && /* @__PURE__ */ l(
6687
6693
  "div",
6688
6694
  {
6689
6695
  className: "flex items-center gap-2 px-3 py-2",
@@ -6701,8 +6707,8 @@ function vc({
6701
6707
  {
6702
6708
  ref: J,
6703
6709
  value: O,
6704
- onChange: ($) => {
6705
- ee($.target.value), Y(0);
6710
+ onChange: (M) => {
6711
+ ee(M.target.value), Y(0);
6706
6712
  },
6707
6713
  placeholder: "Buscar…",
6708
6714
  className: "min-w-0 flex-1 bg-transparent text-sm outline-none",
@@ -6713,8 +6719,8 @@ function vc({
6713
6719
  "button",
6714
6720
  {
6715
6721
  type: "button",
6716
- onMouseDown: ($) => {
6717
- $.preventDefault(), ee("");
6722
+ onMouseDown: (M) => {
6723
+ M.preventDefault(), ee("");
6718
6724
  },
6719
6725
  children: /* @__PURE__ */ t(
6720
6726
  Ie,
@@ -6745,8 +6751,8 @@ function vc({
6745
6751
  "button",
6746
6752
  {
6747
6753
  type: "button",
6748
- onMouseDown: ($) => {
6749
- $.preventDefault(), ne();
6754
+ onMouseDown: (M) => {
6755
+ M.preventDefault(), ne();
6750
6756
  },
6751
6757
  className: "font-semibold transition-colors hover:text-[var(--primary)]",
6752
6758
  children: S
@@ -6758,34 +6764,34 @@ function vc({
6758
6764
  /* @__PURE__ */ l(
6759
6765
  "ul",
6760
6766
  {
6761
- ref: E,
6767
+ ref: L,
6762
6768
  role: "listbox",
6763
6769
  "aria-multiselectable": "true",
6764
6770
  className: "overflow-y-auto",
6765
6771
  style: {
6766
- maxHeight: R ? 220 : 200,
6772
+ maxHeight: j ? 220 : 200,
6767
6773
  scrollbarWidth: "thin",
6768
6774
  scrollbarColor: "var(--border) transparent",
6769
6775
  overscrollBehavior: "contain"
6770
6776
  },
6771
6777
  children: [
6772
- y.map(($, ie) => {
6773
- const I = ie === z, M = U.has($.value);
6778
+ g.map((M, ie) => {
6779
+ const H = ie === z, A = U.has(M.value);
6774
6780
  return /* @__PURE__ */ l(
6775
6781
  "li",
6776
6782
  {
6777
6783
  role: "option",
6778
- "aria-selected": M,
6784
+ "aria-selected": A,
6779
6785
  onMouseDown: (G) => {
6780
- G.preventDefault(), B($.value);
6786
+ G.preventDefault(), D(M.value);
6781
6787
  },
6782
- onMouseEnter: () => !$.disabled && Y(ie),
6788
+ onMouseEnter: () => !M.disabled && Y(ie),
6783
6789
  className: "flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition-colors",
6784
6790
  style: {
6785
- background: I ? "var(--bg-hover)" : M ? "color-mix(in srgb, var(--primary) 6%, transparent)" : "transparent",
6786
- color: $.disabled ? "var(--text-muted)" : "var(--text-main)",
6787
- cursor: $.disabled ? "not-allowed" : "pointer",
6788
- opacity: $.disabled ? 0.58 : 1
6791
+ background: H ? "var(--bg-hover)" : A ? "color-mix(in srgb, var(--primary) 6%, transparent)" : "transparent",
6792
+ color: M.disabled ? "var(--text-muted)" : "var(--text-main)",
6793
+ cursor: M.disabled ? "not-allowed" : "pointer",
6794
+ opacity: M.disabled ? 0.58 : 1
6789
6795
  },
6790
6796
  children: [
6791
6797
  /* @__PURE__ */ t(
@@ -6793,50 +6799,50 @@ function vc({
6793
6799
  {
6794
6800
  className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border",
6795
6801
  style: {
6796
- borderColor: M ? "var(--primary)" : "var(--border)",
6797
- background: M ? "var(--primary)" : "var(--bg-input)",
6802
+ borderColor: A ? "var(--primary)" : "var(--border)",
6803
+ background: A ? "var(--primary)" : "var(--bg-input)",
6798
6804
  color: "var(--primary-fg)"
6799
6805
  },
6800
- children: M && /* @__PURE__ */ t(Ue, { className: "h-3 w-3" })
6806
+ children: A && /* @__PURE__ */ t(Ue, { className: "h-3 w-3" })
6801
6807
  }
6802
6808
  ),
6803
- $.color && /* @__PURE__ */ t(
6809
+ M.color && /* @__PURE__ */ t(
6804
6810
  "span",
6805
6811
  {
6806
6812
  className: "h-2.5 w-2.5 flex-shrink-0 rounded-full",
6807
- style: { background: $.color }
6813
+ style: { background: M.color }
6808
6814
  }
6809
6815
  ),
6810
6816
  /* @__PURE__ */ l("span", { className: "flex min-w-0 flex-1 items-baseline gap-1 overflow-hidden", children: [
6811
- /* @__PURE__ */ t("span", { className: "truncate", children: $.label }),
6812
- $.sublabel && /* @__PURE__ */ t(
6817
+ /* @__PURE__ */ t("span", { className: "truncate", children: M.label }),
6818
+ M.sublabel && /* @__PURE__ */ t(
6813
6819
  "span",
6814
6820
  {
6815
6821
  className: "min-w-0 flex-shrink truncate",
6816
6822
  style: { color: "var(--text-muted)", fontSize: 12 },
6817
- children: $.sublabel
6823
+ children: M.sublabel
6818
6824
  }
6819
6825
  )
6820
6826
  ] }),
6821
- $.badge && /* @__PURE__ */ t(
6827
+ M.badge && /* @__PURE__ */ t(
6822
6828
  "span",
6823
6829
  {
6824
6830
  className: "flex-shrink-0 text-xs",
6825
6831
  style: { color: "var(--text-muted)" },
6826
- children: $.badge
6832
+ children: M.badge
6827
6833
  }
6828
6834
  )
6829
6835
  ]
6830
6836
  },
6831
- $.value
6837
+ M.value
6832
6838
  );
6833
6839
  }),
6834
- y.length === 0 && /* @__PURE__ */ t(
6840
+ g.length === 0 && /* @__PURE__ */ t(
6835
6841
  "li",
6836
6842
  {
6837
6843
  className: "px-3 py-4 text-center text-sm",
6838
6844
  style: { color: "var(--text-muted)" },
6839
- children: L
6845
+ children: T
6840
6846
  }
6841
6847
  )
6842
6848
  ]
@@ -6858,7 +6864,7 @@ function vc({
6858
6864
  {
6859
6865
  type: "button",
6860
6866
  disabled: i,
6861
- onClick: () => !i && k(($) => !$),
6867
+ onClick: () => !i && k((M) => !M),
6862
6868
  className: "flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",
6863
6869
  style: {
6864
6870
  minHeight: ia(m),
@@ -6873,7 +6879,7 @@ function vc({
6873
6879
  "aria-expanded": w,
6874
6880
  children: [
6875
6881
  /* @__PURE__ */ t("span", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-1.5 overflow-hidden", children: W.length ? /* @__PURE__ */ l(Re, { children: [
6876
- W.map(($) => /* @__PURE__ */ l(
6882
+ W.map((M) => /* @__PURE__ */ l(
6877
6883
  "span",
6878
6884
  {
6879
6885
  className: `inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-xs font-semibold ${v ? "max-w-[160px]" : "max-w-full whitespace-normal"}`,
@@ -6883,23 +6889,23 @@ function vc({
6883
6889
  color: "var(--text-main)"
6884
6890
  },
6885
6891
  children: [
6886
- $.color && /* @__PURE__ */ t(
6892
+ M.color && /* @__PURE__ */ t(
6887
6893
  "span",
6888
6894
  {
6889
6895
  className: "h-1.5 w-1.5 flex-shrink-0 rounded-full",
6890
- style: { background: $.color }
6896
+ style: { background: M.color }
6891
6897
  }
6892
6898
  ),
6893
6899
  /* @__PURE__ */ t(
6894
6900
  "span",
6895
6901
  {
6896
6902
  className: v ? "truncate" : "break-words",
6897
- children: $.label
6903
+ children: M.label
6898
6904
  }
6899
6905
  )
6900
6906
  ]
6901
6907
  },
6902
- $.value
6908
+ M.value
6903
6909
  )),
6904
6910
  s > 0 && /* @__PURE__ */ l(
6905
6911
  "span",
@@ -6922,8 +6928,8 @@ function vc({
6922
6928
  role: "button",
6923
6929
  tabIndex: -1,
6924
6930
  "aria-label": S,
6925
- onMouseDown: ($) => {
6926
- $.preventDefault(), $.stopPropagation(), ne();
6931
+ onMouseDown: (M) => {
6932
+ M.preventDefault(), M.stopPropagation(), ne();
6927
6933
  },
6928
6934
  className: "flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",
6929
6935
  style: { color: "var(--text-muted)" },
@@ -6942,7 +6948,7 @@ function vc({
6942
6948
  ]
6943
6949
  }
6944
6950
  ),
6945
- w && T && Ze(pe, document.body)
6951
+ w && $ && Ze(pe, document.body)
6946
6952
  ]
6947
6953
  }
6948
6954
  );
@@ -7256,7 +7262,7 @@ function yc({
7256
7262
  defaultCountryCode: h = "+1",
7257
7263
  onCountryCodeChange: x,
7258
7264
  allowedCountryCodes: v,
7259
- countryCodeOptions: L,
7265
+ countryCodeOptions: T,
7260
7266
  countryCodePlaceholder: S = "Codigo",
7261
7267
  countryCodeClassName: w = "",
7262
7268
  countryCodeWidth: k = 84,
@@ -7264,38 +7270,38 @@ function yc({
7264
7270
  label: ee,
7265
7271
  containerClassName: z = "",
7266
7272
  helperText: Y,
7267
- labelAction: T,
7273
+ labelAction: $,
7268
7274
  className: q = "",
7269
7275
  required: Z,
7270
7276
  disabled: te,
7271
7277
  floatingLabel: P,
7272
7278
  showPasswordToggle: X,
7273
7279
  nativeValidation: J,
7274
- errorTooltipLabel: E = "Error de validacion",
7275
- ...R
7280
+ errorTooltipLabel: L = "Error de validacion",
7281
+ ...j
7276
7282
  }) {
7277
7283
  var re;
7278
- const [U, _] = A(
7284
+ const [U, _] = B(
7279
7285
  () => sa(m)
7280
- ), [oe, W] = A(
7286
+ ), [oe, W] = B(
7281
7287
  () => Nr(h)
7282
7288
  ), s = at(() => {
7283
- const me = L ?? Yi, se = v == null ? void 0 : v.map(Nr);
7284
- return se != null && se.length ? me.filter((g) => se.includes(g.value)) : me;
7285
- }, [v, L]), y = ((re = s[0]) == null ? void 0 : re.value) ?? "+1", D = s.some(
7289
+ const me = T ?? Yi, se = v == null ? void 0 : v.map(Nr);
7290
+ return se != null && se.length ? me.filter((y) => se.includes(y.value)) : me;
7291
+ }, [v, T]), g = ((re = s[0]) == null ? void 0 : re.value) ?? "+1", E = s.some(
7286
7292
  (me) => me.value === Nr(p ?? oe)
7287
- ) ? Nr(p ?? oe) : y, j = u !== void 0 ? sa(u) : U, B = `${D} ${j}`.trim(), ne = n && j.length > 0 && !za(B) ? a : void 0, ce = c ?? ne, pe = !!ce, $ = pe && i !== "tooltip", ie = pe && i !== "inline", I = pe ? "border-[var(--danger)] focus-within:border-[var(--danger)]" : "border-[var(--border)] focus-within:border-[var(--primary)]", M = (me) => {
7293
+ ) ? Nr(p ?? oe) : g, R = u !== void 0 ? sa(u) : U, D = `${E} ${R}`.trim(), ne = n && R.length > 0 && !za(D) ? a : void 0, ce = c ?? ne, pe = !!ce, M = pe && i !== "tooltip", ie = pe && i !== "inline", H = pe ? "border-[var(--danger)] focus-within:border-[var(--danger)]" : "border-[var(--border)] focus-within:border-[var(--primary)]", A = (me) => {
7288
7294
  const se = me.currentTarget.value;
7289
7295
  u === void 0 && _(se), O == null || O(se, {
7290
- countryCode: D,
7296
+ countryCode: E,
7291
7297
  nationalNumber: se,
7292
- fullNumber: `${D} ${se}`.trim()
7298
+ fullNumber: `${E} ${se}`.trim()
7293
7299
  }), f == null || f(me);
7294
7300
  }, G = (me) => {
7295
- p === void 0 && W(me), x == null || x(me), O == null || O(j, {
7301
+ p === void 0 && W(me), x == null || x(me), O == null || O(R, {
7296
7302
  countryCode: me,
7297
- nationalNumber: j,
7298
- fullNumber: `${me} ${j}`.trim()
7303
+ nationalNumber: R,
7304
+ fullNumber: `${me} ${R}`.trim()
7299
7305
  });
7300
7306
  }, V = ie ? /* @__PURE__ */ t(
7301
7307
  Ut,
@@ -7308,7 +7314,7 @@ function yc({
7308
7314
  {
7309
7315
  tabIndex: 0,
7310
7316
  role: "img",
7311
- "aria-label": E,
7317
+ "aria-label": L,
7312
7318
  className: "flex h-full w-full items-center justify-center outline-none",
7313
7319
  children: /* @__PURE__ */ t(Pa, { className: "h-[18px] w-[18px]" })
7314
7320
  }
@@ -7319,17 +7325,17 @@ function yc({
7319
7325
  /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]", children: [
7320
7326
  /* @__PURE__ */ t("span", { children: ee }),
7321
7327
  Z && /* @__PURE__ */ t("span", { className: "text-[var(--danger)]", children: "*" }),
7322
- T && /* @__PURE__ */ t("span", { className: "ml-auto normal-case", children: T })
7328
+ $ && /* @__PURE__ */ t("span", { className: "ml-auto normal-case", children: $ })
7323
7329
  ] }),
7324
7330
  /* @__PURE__ */ l(
7325
7331
  "span",
7326
7332
  {
7327
- className: `flex h-10 min-w-0 items-center overflow-hidden rounded-lg border bg-[var(--bg-input)] transition-colors ${I}`,
7333
+ className: `flex h-10 min-w-0 items-center overflow-hidden rounded-lg border bg-[var(--bg-input)] transition-colors ${H}`,
7328
7334
  children: [
7329
7335
  /* @__PURE__ */ t(
7330
7336
  At,
7331
7337
  {
7332
- value: D,
7338
+ value: E,
7333
7339
  onChange: G,
7334
7340
  options: s,
7335
7341
  placeholder: S,
@@ -7351,7 +7357,7 @@ function yc({
7351
7357
  /* @__PURE__ */ t(
7352
7358
  "input",
7353
7359
  {
7354
- ...R,
7360
+ ...j,
7355
7361
  value: u,
7356
7362
  defaultValue: m,
7357
7363
  type: "tel",
@@ -7359,10 +7365,10 @@ function yc({
7359
7365
  autoComplete: e,
7360
7366
  disabled: te,
7361
7367
  required: void 0,
7362
- "aria-label": R["aria-label"] ?? (typeof ee == "string" ? ee : void 0),
7363
- "aria-invalid": pe || R["aria-invalid"],
7368
+ "aria-label": j["aria-label"] ?? (typeof ee == "string" ? ee : void 0),
7369
+ "aria-invalid": pe || j["aria-invalid"],
7364
7370
  className: `h-full w-full min-w-0 bg-transparent px-2 py-1.5 text-sm text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:opacity-60 ${ie ? "pr-10" : ""} ${q}`,
7365
- onChange: M
7371
+ onChange: A
7366
7372
  }
7367
7373
  ),
7368
7374
  V
@@ -7370,7 +7376,7 @@ function yc({
7370
7376
  ]
7371
7377
  }
7372
7378
  ),
7373
- $ ? /* @__PURE__ */ t("span", { className: "text-xs font-medium normal-case text-[var(--danger)]", children: ce }) : Y ? /* @__PURE__ */ t("span", { className: "text-xs font-medium normal-case text-[var(--text-muted)]", children: Y }) : null
7379
+ M ? /* @__PURE__ */ t("span", { className: "text-xs font-medium normal-case text-[var(--danger)]", children: ce }) : Y ? /* @__PURE__ */ t("span", { className: "text-xs font-medium normal-case text-[var(--text-muted)]", children: Y }) : null
7374
7380
  ] });
7375
7381
  }
7376
7382
  function wc({
@@ -7475,7 +7481,7 @@ function Nc({
7475
7481
  placeholder: n = "Escribe algo...",
7476
7482
  minHeight: a = "80px"
7477
7483
  }) {
7478
- const i = le(null), c = le(null), u = le(null), m = le(!1), f = le(e ?? ""), p = le(r), [h, x] = A(() => !e || e.trim() === ""), [v, L] = A(/* @__PURE__ */ new Set()), [S, w] = A(null), [k, O] = A(""), [ee, z] = A(""), [Y, T] = A(""), [q, Z] = A(""), [te, P] = A(!1), X = we(
7484
+ const i = le(null), c = le(null), u = le(null), m = le(!1), f = le(e ?? ""), p = le(r), [h, x] = B(() => !e || e.trim() === ""), [v, T] = B(/* @__PURE__ */ new Set()), [S, w] = B(null), [k, O] = B(""), [ee, z] = B(""), [Y, $] = B(""), [q, Z] = B(""), [te, P] = B(!1), X = we(
7479
7485
  () => m.current ? c.current : i.current,
7480
7486
  []
7481
7487
  );
@@ -7483,27 +7489,27 @@ function Nc({
7483
7489
  p.current = r;
7484
7490
  }, [r]);
7485
7491
  const J = we(() => {
7486
- const g = window.getSelection(), H = X();
7487
- if (!g || !H || g.rangeCount === 0 || g.isCollapsed)
7492
+ const y = window.getSelection(), I = X();
7493
+ if (!y || !I || y.rangeCount === 0 || y.isCollapsed)
7488
7494
  return "";
7489
- const ue = g.getRangeAt(0);
7490
- return !H.contains(ue.startContainer) || !H.contains(ue.endContainer) ? "" : g.toString();
7495
+ const ue = y.getRangeAt(0);
7496
+ return !I.contains(ue.startContainer) || !I.contains(ue.endContainer) ? "" : y.toString();
7491
7497
  }, [X]);
7492
7498
  Q(() => {
7493
- const g = e ?? "";
7494
- f.current = g;
7495
- const H = [i.current, c.current].filter(
7499
+ const y = e ?? "";
7500
+ f.current = y;
7501
+ const I = [i.current, c.current].filter(
7496
7502
  (be) => !!be
7497
7503
  );
7498
- H.forEach((be) => {
7499
- be.innerHTML !== g && (be.innerHTML = g);
7500
- }), x(!g || g.trim() === "");
7501
- const ue = H.map((be) => ca(be));
7504
+ I.forEach((be) => {
7505
+ be.innerHTML !== y && (be.innerHTML = y);
7506
+ }), x(!y || y.trim() === "");
7507
+ const ue = I.map((be) => ca(be));
7502
7508
  return () => ue.forEach((be) => be());
7503
7509
  }, [e]), Q(() => {
7504
7510
  var be, Se;
7505
7511
  m.current = te;
7506
- let g, H = 0, ue;
7512
+ let y, I = 0, ue;
7507
7513
  if (te) {
7508
7514
  const he = i.current;
7509
7515
  he && (f.current = he.innerHTML);
@@ -7511,22 +7517,22 @@ function Nc({
7511
7517
  var fe;
7512
7518
  const ke = c.current;
7513
7519
  if (!ke) {
7514
- H = requestAnimationFrame(Ee);
7520
+ I = requestAnimationFrame(Ee);
7515
7521
  return;
7516
7522
  }
7517
- ke.innerHTML !== f.current && (ke.innerHTML = f.current), g = ca(ke), x(((fe = ke.textContent) == null ? void 0 : fe.trim()) === ""), ue = setTimeout(() => ke.focus(), 60);
7523
+ ke.innerHTML !== f.current && (ke.innerHTML = f.current), y = ca(ke), x(((fe = ke.textContent) == null ? void 0 : fe.trim()) === ""), ue = setTimeout(() => ke.focus(), 60);
7518
7524
  };
7519
- H = requestAnimationFrame(Ee);
7525
+ I = requestAnimationFrame(Ee);
7520
7526
  } else {
7521
7527
  const he = c.current, Ee = i.current, ke = (he == null ? void 0 : he.innerHTML) ?? f.current, fe = f.current;
7522
7528
  f.current = ke, Ee && Ee.innerHTML !== ke && (Ee.innerHTML = ke), ke !== fe && p.current(ke), x(((Se = (be = he ?? Ee) == null ? void 0 : be.textContent) == null ? void 0 : Se.trim()) === "");
7523
7529
  }
7524
7530
  return () => {
7525
- H && cancelAnimationFrame(H), ue && clearTimeout(ue), g == null || g();
7531
+ I && cancelAnimationFrame(I), ue && clearTimeout(ue), y == null || y();
7526
7532
  };
7527
7533
  }, [te]);
7528
- const E = we(() => {
7529
- const g = [
7534
+ const L = we(() => {
7535
+ const y = [
7530
7536
  "bold",
7531
7537
  "italic",
7532
7538
  "underline",
@@ -7537,10 +7543,10 @@ function Nc({
7537
7543
  "justifyCenter",
7538
7544
  "justifyRight",
7539
7545
  "justifyFull"
7540
- ], H = /* @__PURE__ */ new Set();
7541
- g.forEach((be) => {
7546
+ ], I = /* @__PURE__ */ new Set();
7547
+ y.forEach((be) => {
7542
7548
  try {
7543
- document.queryCommandState(be) && H.add(be);
7549
+ document.queryCommandState(be) && I.add(be);
7544
7550
  } catch {
7545
7551
  return;
7546
7552
  }
@@ -7549,70 +7555,70 @@ function Nc({
7549
7555
  const be = Xi(
7550
7556
  document.queryCommandValue("formatBlock")
7551
7557
  );
7552
- be && H.add(`formatBlock:${be}`);
7558
+ be && I.add(`formatBlock:${be}`);
7553
7559
  } catch {
7554
7560
  return;
7555
7561
  }
7556
7562
  const ue = J();
7557
- Qr(ue, "uppercase") && H.add("__upper"), Qr(ue, "lowercase") && H.add("__lower"), Qr(ue, "capitalize") && H.add("__cap"), L(H);
7558
- }, [J]), R = () => {
7559
- var H;
7560
- const g = X();
7561
- g && (f.current = g.innerHTML, p.current(f.current), x(((H = g.textContent) == null ? void 0 : H.trim()) === ""));
7562
- }, U = (g) => {
7563
- if (!g) {
7564
- const H = i.current;
7565
- H && (f.current = H.innerHTML);
7563
+ Qr(ue, "uppercase") && I.add("__upper"), Qr(ue, "lowercase") && I.add("__lower"), Qr(ue, "capitalize") && I.add("__cap"), T(I);
7564
+ }, [J]), j = () => {
7565
+ var I;
7566
+ const y = X();
7567
+ y && (f.current = y.innerHTML, p.current(f.current), x(((I = y.textContent) == null ? void 0 : I.trim()) === ""));
7568
+ }, U = (y) => {
7569
+ if (!y) {
7570
+ const I = i.current;
7571
+ I && (f.current = I.innerHTML);
7566
7572
  }
7567
- P(!g);
7568
- }, _ = (g, H) => {
7573
+ P(!y);
7574
+ }, _ = (y, I) => {
7569
7575
  var ue;
7570
- (ue = X()) == null || ue.focus(), document.execCommand(g, !1, H), R(), E();
7571
- }, oe = (g) => {
7572
- _("formatBlock", g);
7576
+ (ue = X()) == null || ue.focus(), document.execCommand(y, !1, I), j(), L();
7577
+ }, oe = (y) => {
7578
+ _("formatBlock", y);
7573
7579
  }, W = () => {
7574
- var g;
7575
- (g = X()) == null || g.focus(), document.execCommand("insertHTML", !1, "<hr><p><br></p>"), R(), E();
7580
+ var y;
7581
+ (y = X()) == null || y.focus(), document.execCommand("insertHTML", !1, "<hr><p><br></p>"), j(), L();
7576
7582
  }, s = () => {
7577
- const g = window.getSelection();
7578
- g && g.rangeCount > 0 && (u.current = g.getRangeAt(0).cloneRange());
7579
- }, y = () => {
7580
- const g = window.getSelection();
7581
- g && u.current && (g.removeAllRanges(), g.addRange(u.current));
7582
- }, D = (g) => {
7583
- if (s(), g === "link") {
7584
- const H = window.getSelection();
7583
+ const y = window.getSelection();
7584
+ y && y.rangeCount > 0 && (u.current = y.getRangeAt(0).cloneRange());
7585
+ }, g = () => {
7586
+ const y = window.getSelection();
7587
+ y && u.current && (y.removeAllRanges(), y.addRange(u.current));
7588
+ }, E = (y) => {
7589
+ if (s(), y === "link") {
7590
+ const I = window.getSelection();
7585
7591
  z(
7586
- H && !H.isCollapsed ? H.toString() : ""
7592
+ I && !I.isCollapsed ? I.toString() : ""
7587
7593
  ), O("");
7588
7594
  }
7589
- g === "image" && (T(""), Z("")), w(g);
7590
- }, j = () => {
7595
+ y === "image" && ($(""), Z("")), w(y);
7596
+ }, R = () => {
7591
7597
  var be;
7592
7598
  if (!k.trim()) return;
7593
- y(), (be = X()) == null || be.focus();
7594
- const g = window.getSelection(), ue = (g && !g.isCollapsed ? g.toString() : "") || ee.trim() || k.trim();
7599
+ g(), (be = X()) == null || be.focus();
7600
+ const y = window.getSelection(), ue = (y && !y.isCollapsed ? y.toString() : "") || ee.trim() || k.trim();
7595
7601
  document.execCommand(
7596
7602
  "insertHTML",
7597
7603
  !1,
7598
7604
  `<a href="${kr(k.trim())}" target="_blank" rel="noopener noreferrer" class="rich-link">${kr(ue)}</a>`
7599
- ), R(), w(null);
7600
- }, B = (g, H = "") => `<span class="rich-img-wrap" contenteditable="false"><img src="${kr(g)}" alt="${kr(H)}" class="rich-img" />${qa()}</span>`, ne = () => {
7601
- var g;
7602
- Y.trim() && (y(), (g = X()) == null || g.focus(), document.execCommand(
7605
+ ), j(), w(null);
7606
+ }, D = (y, I = "") => `<span class="rich-img-wrap" contenteditable="false"><img src="${kr(y)}" alt="${kr(I)}" class="rich-img" />${qa()}</span>`, ne = () => {
7607
+ var y;
7608
+ Y.trim() && (g(), (y = X()) == null || y.focus(), document.execCommand(
7603
7609
  "insertHTML",
7604
7610
  !1,
7605
- B(Y.trim(), q.trim())
7606
- ), R(), w(null));
7607
- }, ce = (g, H = 1200, ue = 1200, be = 0.72) => new Promise((Se, he) => {
7611
+ D(Y.trim(), q.trim())
7612
+ ), j(), w(null));
7613
+ }, ce = (y, I = 1200, ue = 1200, be = 0.72) => new Promise((Se, he) => {
7608
7614
  const Ee = new FileReader();
7609
7615
  Ee.onerror = he, Ee.onload = (ke) => {
7610
7616
  var Qe;
7611
7617
  const fe = (Qe = ke.target) == null ? void 0 : Qe.result, ze = new Image();
7612
7618
  ze.onerror = he, ze.onload = () => {
7613
7619
  let { width: qe, height: ae } = ze;
7614
- if (qe > H || ae > ue) {
7615
- const _e = Math.min(H / qe, ue / ae);
7620
+ if (qe > I || ae > ue) {
7621
+ const _e = Math.min(I / qe, ue / ae);
7616
7622
  qe = Math.round(qe * _e), ae = Math.round(ae * _e);
7617
7623
  }
7618
7624
  const Me = document.createElement("canvas");
@@ -7624,41 +7630,41 @@ function Nc({
7624
7630
  }
7625
7631
  Te.drawImage(ze, 0, 0, qe, ae), Se(Me.toDataURL("image/jpeg", be));
7626
7632
  }, ze.src = fe;
7627
- }, Ee.readAsDataURL(g);
7628
- }), pe = (g) => {
7629
- const ue = Array.from(g.clipboardData.items).find((Se) => Se.type.startsWith("image/"));
7633
+ }, Ee.readAsDataURL(y);
7634
+ }), pe = (y) => {
7635
+ const ue = Array.from(y.clipboardData.items).find((Se) => Se.type.startsWith("image/"));
7630
7636
  if (!ue) return;
7631
- g.preventDefault();
7637
+ y.preventDefault();
7632
7638
  const be = ue.getAsFile();
7633
7639
  be && ce(be).then((Se) => {
7634
7640
  var he;
7635
7641
  (he = X()) == null || he.focus(), document.execCommand(
7636
7642
  "insertHTML",
7637
7643
  !1,
7638
- B(Se, "imagen")
7639
- ), R();
7644
+ D(Se, "imagen")
7645
+ ), j();
7640
7646
  });
7641
- }, $ = (g) => {
7642
- const H = window.getSelection(), ue = X();
7643
- if (!H || !ue || H.rangeCount === 0 || H.isCollapsed)
7647
+ }, M = (y) => {
7648
+ const I = window.getSelection(), ue = X();
7649
+ if (!I || !ue || I.rangeCount === 0 || I.isCollapsed)
7644
7650
  return;
7645
- const be = H.getRangeAt(0);
7651
+ const be = I.getRangeAt(0);
7646
7652
  if (!ue.contains(be.startContainer) || !ue.contains(be.endContainer))
7647
7653
  return;
7648
7654
  const Se = be.toString();
7649
7655
  if (!Se) return;
7650
7656
  let he = Se;
7651
- g === "uppercase" ? he = Se.toLocaleUpperCase() : g === "lowercase" ? he = Se.toLocaleLowerCase() : he = Ua(Se), be.deleteContents();
7657
+ y === "uppercase" ? he = Se.toLocaleUpperCase() : y === "lowercase" ? he = Se.toLocaleLowerCase() : he = Ua(Se), be.deleteContents();
7652
7658
  const Ee = document.createTextNode(he);
7653
7659
  be.insertNode(Ee);
7654
7660
  const ke = document.createRange();
7655
- ke.setStart(Ee, 0), ke.setEnd(Ee, he.length), H.removeAllRanges(), H.addRange(ke), u.current = ke.cloneRange(), R(), E();
7661
+ ke.setStart(Ee, 0), ke.setEnd(Ee, he.length), I.removeAllRanges(), I.addRange(ke), u.current = ke.cloneRange(), j(), L();
7656
7662
  }, ie = () => {
7657
- s(), E();
7658
- }, I = () => {
7659
- R(), E();
7660
- }, M = (g) => {
7661
- if (g.key === "Escape") {
7663
+ s(), L();
7664
+ }, H = () => {
7665
+ j(), L();
7666
+ }, A = (y) => {
7667
+ if (y.key === "Escape") {
7662
7668
  if (S) {
7663
7669
  w(null);
7664
7670
  return;
@@ -7668,20 +7674,20 @@ function Nc({
7668
7674
  return;
7669
7675
  }
7670
7676
  }
7671
- S || (g.ctrlKey || g.metaKey) && (g.key === "b" && (g.preventDefault(), _("bold")), g.key === "i" && (g.preventDefault(), _("italic")), g.key === "u" && (g.preventDefault(), _("underline")), g.key === "k" && (g.preventDefault(), D("link")));
7677
+ S || (y.ctrlKey || y.metaKey) && (y.key === "b" && (y.preventDefault(), _("bold")), y.key === "i" && (y.preventDefault(), _("italic")), y.key === "u" && (y.preventDefault(), _("underline")), y.key === "k" && (y.preventDefault(), E("link")));
7672
7678
  }, G = () => /* @__PURE__ */ t(
7673
7679
  "div",
7674
7680
  {
7675
7681
  className: "h-4 w-px flex-shrink-0 mx-1",
7676
7682
  style: { background: "var(--border)" }
7677
7683
  }
7678
- ), V = (g, H, ue, be, Se) => {
7684
+ ), V = (y, I, ue, be, Se) => {
7679
7685
  const he = Se ?? (v.has(ue) || ue === "__link" && S === "link" || ue === "__img" && S === "image");
7680
7686
  return /* @__PURE__ */ t(
7681
7687
  "button",
7682
7688
  {
7683
7689
  type: "button",
7684
- title: H,
7690
+ title: I,
7685
7691
  onMouseDown: (Ee) => {
7686
7692
  Ee.preventDefault(), be ? be() : _(ue);
7687
7693
  },
@@ -7690,23 +7696,23 @@ function Nc({
7690
7696
  color: he ? "var(--primary)" : "var(--text-secondary)",
7691
7697
  background: he ? "rgba(59,130,246,0.12)" : "transparent"
7692
7698
  },
7693
- children: g
7699
+ children: y
7694
7700
  },
7695
7701
  ue
7696
7702
  );
7697
- }, re = (g) => {
7698
- const H = g.target;
7699
- if (H.closest("[data-action='delete-img']")) {
7700
- g.preventDefault();
7701
- const ue = H.closest(".rich-img-wrap");
7702
- ue && (ue.remove(), R());
7703
+ }, re = (y) => {
7704
+ const I = y.target;
7705
+ if (I.closest("[data-action='delete-img']")) {
7706
+ y.preventDefault();
7707
+ const ue = I.closest(".rich-img-wrap");
7708
+ ue && (ue.remove(), j());
7703
7709
  }
7704
- }, me = (g) => /* @__PURE__ */ l(Re, { children: [
7710
+ }, me = (y) => /* @__PURE__ */ l(Re, { children: [
7705
7711
  S === "link" && /* @__PURE__ */ l(
7706
7712
  "div",
7707
7713
  {
7708
7714
  className: "flex flex-shrink-0 flex-wrap items-center gap-2 border-t px-3 py-2",
7709
- style: { borderColor: "var(--border)", background: g },
7715
+ style: { borderColor: "var(--border)", background: y },
7710
7716
  children: [
7711
7717
  /* @__PURE__ */ t(
7712
7718
  "input",
@@ -7714,9 +7720,9 @@ function Nc({
7714
7720
  autoFocus: !0,
7715
7721
  type: "url",
7716
7722
  value: k,
7717
- onChange: (H) => O(H.target.value),
7718
- onKeyDown: (H) => {
7719
- H.key === "Enter" && (H.preventDefault(), j()), H.key === "Escape" && w(null);
7723
+ onChange: (I) => O(I.target.value),
7724
+ onKeyDown: (I) => {
7725
+ I.key === "Enter" && (I.preventDefault(), R()), I.key === "Escape" && w(null);
7720
7726
  },
7721
7727
  placeholder: "https://...",
7722
7728
  className: "min-w-0 flex-1 rounded px-2 py-1 text-xs focus:outline-none",
@@ -7732,9 +7738,9 @@ function Nc({
7732
7738
  {
7733
7739
  type: "text",
7734
7740
  value: ee,
7735
- onChange: (H) => z(H.target.value),
7736
- onKeyDown: (H) => {
7737
- H.key === "Enter" && (H.preventDefault(), j()), H.key === "Escape" && w(null);
7741
+ onChange: (I) => z(I.target.value),
7742
+ onKeyDown: (I) => {
7743
+ I.key === "Enter" && (I.preventDefault(), R()), I.key === "Escape" && w(null);
7738
7744
  },
7739
7745
  placeholder: "Texto (opcional)",
7740
7746
  className: "w-32 rounded px-2 py-1 text-xs focus:outline-none",
@@ -7749,7 +7755,7 @@ function Nc({
7749
7755
  "button",
7750
7756
  {
7751
7757
  type: "button",
7752
- onClick: j,
7758
+ onClick: R,
7753
7759
  className: "rounded px-2.5 py-1 text-xs font-semibold text-white",
7754
7760
  style: { background: "var(--primary)" },
7755
7761
  children: "OK"
@@ -7772,7 +7778,7 @@ function Nc({
7772
7778
  "div",
7773
7779
  {
7774
7780
  className: "flex flex-shrink-0 flex-wrap items-center gap-2 border-t px-3 py-2",
7775
- style: { borderColor: "var(--border)", background: g },
7781
+ style: { borderColor: "var(--border)", background: y },
7776
7782
  children: [
7777
7783
  /* @__PURE__ */ t(
7778
7784
  "input",
@@ -7780,9 +7786,9 @@ function Nc({
7780
7786
  autoFocus: !0,
7781
7787
  type: "url",
7782
7788
  value: Y,
7783
- onChange: (H) => T(H.target.value),
7784
- onKeyDown: (H) => {
7785
- H.key === "Enter" && (H.preventDefault(), ne()), H.key === "Escape" && w(null);
7789
+ onChange: (I) => $(I.target.value),
7790
+ onKeyDown: (I) => {
7791
+ I.key === "Enter" && (I.preventDefault(), ne()), I.key === "Escape" && w(null);
7786
7792
  },
7787
7793
  placeholder: "URL de la imagen...",
7788
7794
  className: "min-w-0 flex-1 rounded px-2 py-1 text-xs focus:outline-none",
@@ -7798,9 +7804,9 @@ function Nc({
7798
7804
  {
7799
7805
  type: "text",
7800
7806
  value: q,
7801
- onChange: (H) => Z(H.target.value),
7802
- onKeyDown: (H) => {
7803
- H.key === "Enter" && (H.preventDefault(), ne()), H.key === "Escape" && w(null);
7807
+ onChange: (I) => Z(I.target.value),
7808
+ onKeyDown: (I) => {
7809
+ I.key === "Enter" && (I.preventDefault(), ne()), I.key === "Escape" && w(null);
7804
7810
  },
7805
7811
  placeholder: "Texto alt",
7806
7812
  className: "w-28 rounded px-2 py-1 text-xs focus:outline-none",
@@ -7834,11 +7840,11 @@ function Nc({
7834
7840
  ]
7835
7841
  }
7836
7842
  )
7837
- ] }), se = (g, H) => /* @__PURE__ */ l(
7843
+ ] }), se = (y, I) => /* @__PURE__ */ l(
7838
7844
  "div",
7839
7845
  {
7840
7846
  className: "flex flex-shrink-0 flex-wrap items-center gap-0.5 border-t px-2 py-1",
7841
- style: { borderColor: "var(--border)", background: H },
7847
+ style: { borderColor: "var(--border)", background: I },
7842
7848
  children: [
7843
7849
  V(
7844
7850
  /* @__PURE__ */ t(el, { className: "h-4 w-4" }),
@@ -7931,26 +7937,26 @@ function Nc({
7931
7937
  /* @__PURE__ */ t("span", { style: { fontSize: "10px" }, children: "AA" }),
7932
7938
  "Mayusculas",
7933
7939
  "__upper",
7934
- () => $("uppercase")
7940
+ () => M("uppercase")
7935
7941
  ),
7936
7942
  V(
7937
7943
  /* @__PURE__ */ t("span", { style: { fontSize: "10px" }, children: "aa" }),
7938
7944
  "Minusculas",
7939
7945
  "__lower",
7940
- () => $("lowercase")
7946
+ () => M("lowercase")
7941
7947
  ),
7942
7948
  V(
7943
7949
  /* @__PURE__ */ t("span", { style: { fontSize: "10px" }, children: "Aa" }),
7944
7950
  "Capitalizar",
7945
7951
  "__cap",
7946
- () => $("capitalize")
7952
+ () => M("capitalize")
7947
7953
  ),
7948
7954
  G(),
7949
7955
  V(
7950
7956
  /* @__PURE__ */ t(wa, { className: "h-4 w-4" }),
7951
7957
  "Insertar enlace (Ctrl+K)",
7952
7958
  "__link",
7953
- () => D("link")
7959
+ () => E("link")
7954
7960
  ),
7955
7961
  V(
7956
7962
  /* @__PURE__ */ t(sl, { className: "h-4 w-4" }),
@@ -7961,7 +7967,7 @@ function Nc({
7961
7967
  /* @__PURE__ */ t(cl, { className: "h-4 w-4" }),
7962
7968
  "Insertar imagen",
7963
7969
  "__img",
7964
- () => D("image")
7970
+ () => E("image")
7965
7971
  ),
7966
7972
  V(
7967
7973
  /* @__PURE__ */ t(Na, { className: "h-4 w-4" }),
@@ -7986,13 +7992,13 @@ function Nc({
7986
7992
  "button",
7987
7993
  {
7988
7994
  type: "button",
7989
- title: g ? "Salir del modo de enfoque (Esc)" : "Modo de enfoque",
7995
+ title: y ? "Salir del modo de enfoque (Esc)" : "Modo de enfoque",
7990
7996
  onMouseDown: (ue) => {
7991
- ue.preventDefault(), U(g);
7997
+ ue.preventDefault(), U(y);
7992
7998
  },
7993
7999
  className: "flex h-7 w-7 items-center justify-center rounded transition-colors",
7994
8000
  style: { color: "var(--text-secondary)" },
7995
- children: g ? /* @__PURE__ */ t(Jo, { className: "h-4 w-4" }) : /* @__PURE__ */ t(Qo, { className: "h-4 w-4" })
8001
+ children: y ? /* @__PURE__ */ t(Jo, { className: "h-4 w-4" }) : /* @__PURE__ */ t(Qo, { className: "h-4 w-4" })
7996
8002
  }
7997
8003
  )
7998
8004
  ]
@@ -8011,8 +8017,8 @@ function Nc({
8011
8017
  ref: i,
8012
8018
  contentEditable: !0,
8013
8019
  suppressContentEditableWarning: !0,
8014
- onInput: I,
8015
- onKeyDown: M,
8020
+ onInput: H,
8021
+ onKeyDown: A,
8016
8022
  onKeyUp: ie,
8017
8023
  onSelect: ie,
8018
8024
  onMouseUp: ie,
@@ -8053,8 +8059,8 @@ function Nc({
8053
8059
  ref: c,
8054
8060
  contentEditable: !0,
8055
8061
  suppressContentEditableWarning: !0,
8056
- onInput: I,
8057
- onKeyDown: M,
8062
+ onInput: H,
8063
+ onKeyDown: A,
8058
8064
  onKeyUp: ie,
8059
8065
  onSelect: ie,
8060
8066
  onMouseUp: ie,
@@ -8233,50 +8239,50 @@ function Sc({
8233
8239
  selectClassName: h,
8234
8240
  menuClassName: x,
8235
8241
  optionClassName: v,
8236
- spinnerClassName: L
8242
+ spinnerClassName: T
8237
8243
  }) {
8238
- const [S, w] = A(!1), [k, O] = A(!1), [ee, z] = A(-1), [Y, T] = A({}), q = le(null), Z = le(null), te = le(null), P = r.find((s) => s.value === e) ?? r[0], X = {
8244
+ const [S, w] = B(!1), [k, O] = B(!1), [ee, z] = B(-1), [Y, $] = B({}), q = le(null), Z = le(null), te = le(null), P = r.find((s) => s.value === e) ?? r[0], X = {
8239
8245
  ...P != null && P.tone ? da[P.tone] : void 0,
8240
8246
  ...P == null ? void 0 : P.style
8241
- }, J = i || c || r.length === 0, E = (s) => {
8247
+ }, J = i || c || r.length === 0, L = (s) => {
8242
8248
  u && s.stopPropagation();
8243
- }, R = we(() => {
8249
+ }, j = we(() => {
8244
8250
  w(!1), z(-1);
8245
8251
  }, []), U = we(() => {
8246
8252
  const s = q.current;
8247
8253
  if (!s) return;
8248
- const y = s.getBoundingClientRect(), D = Math.max(y.width, rs[a]), j = Math.min(Math.max(r.length, 1) * 38 + 12, 260), B = window.innerHeight - y.bottom, ne = B < j && y.top > B, ce = Math.min(
8249
- Math.max(8, y.left + y.width / 2 - D / 2),
8250
- window.innerWidth - D - 8
8254
+ const g = s.getBoundingClientRect(), E = Math.max(g.width, rs[a]), R = Math.min(Math.max(r.length, 1) * 38 + 12, 260), D = window.innerHeight - g.bottom, ne = D < R && g.top > D, ce = Math.min(
8255
+ Math.max(8, g.left + g.width / 2 - E / 2),
8256
+ window.innerWidth - E - 8
8251
8257
  );
8252
- T({
8258
+ $({
8253
8259
  position: "fixed",
8254
8260
  left: ce,
8255
- top: ne ? void 0 : y.bottom + 6,
8256
- bottom: ne ? window.innerHeight - y.top + 6 : void 0,
8257
- width: D,
8261
+ top: ne ? void 0 : g.bottom + 6,
8262
+ bottom: ne ? window.innerHeight - g.top + 6 : void 0,
8263
+ width: E,
8258
8264
  zIndex: 9999
8259
8265
  });
8260
8266
  }, [r.length, a]), _ = we(
8261
8267
  (s) => {
8262
- s.disabled || (n(s.value), R());
8268
+ s.disabled || (n(s.value), j());
8263
8269
  },
8264
- [R, n]
8270
+ [j, n]
8265
8271
  );
8266
8272
  Q(() => O(!0), []), Q(() => {
8267
8273
  if (!S) return;
8268
8274
  U();
8269
- const s = r.findIndex((y) => y.value === e);
8275
+ const s = r.findIndex((g) => g.value === e);
8270
8276
  z(s >= 0 ? s : 0);
8271
8277
  }, [S, r, U, e]), Q(() => {
8272
8278
  if (!S) return;
8273
- function s(y) {
8274
- var j, B;
8275
- const D = y.target;
8276
- !((j = q.current) != null && j.contains(D)) && !((B = Z.current) != null && B.contains(D)) && R();
8279
+ function s(g) {
8280
+ var R, D;
8281
+ const E = g.target;
8282
+ !((R = q.current) != null && R.contains(E)) && !((D = Z.current) != null && D.contains(E)) && j();
8277
8283
  }
8278
8284
  return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
8279
- }, [R, S]), Q(() => {
8285
+ }, [j, S]), Q(() => {
8280
8286
  if (S)
8281
8287
  return window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), () => {
8282
8288
  window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
@@ -8293,21 +8299,21 @@ function Sc({
8293
8299
  return;
8294
8300
  }
8295
8301
  if (s.key === "Escape") {
8296
- s.preventDefault(), R();
8302
+ s.preventDefault(), j();
8297
8303
  return;
8298
8304
  }
8299
8305
  if (s.key === "ArrowDown") {
8300
- s.preventDefault(), z((y) => Math.min(y + 1, r.length - 1));
8306
+ s.preventDefault(), z((g) => Math.min(g + 1, r.length - 1));
8301
8307
  return;
8302
8308
  }
8303
8309
  if (s.key === "ArrowUp") {
8304
- s.preventDefault(), z((y) => Math.max(y - 1, 0));
8310
+ s.preventDefault(), z((g) => Math.max(g - 1, 0));
8305
8311
  return;
8306
8312
  }
8307
8313
  if (s.key === "Enter" || s.key === " ") {
8308
8314
  s.preventDefault();
8309
- const y = r[ee];
8310
- y && _(y);
8315
+ const g = r[ee];
8316
+ g && _(g);
8311
8317
  }
8312
8318
  }
8313
8319
  }
@@ -8327,9 +8333,9 @@ function Sc({
8327
8333
  borderColor: "var(--border)",
8328
8334
  color: "var(--text-main)"
8329
8335
  },
8330
- onClick: E,
8331
- onMouseDown: E,
8332
- onPointerDown: E,
8336
+ onClick: L,
8337
+ onMouseDown: L,
8338
+ onPointerDown: L,
8333
8339
  children: /* @__PURE__ */ t(
8334
8340
  "div",
8335
8341
  {
@@ -8340,8 +8346,8 @@ function Sc({
8340
8346
  scrollbarColor: "var(--border) transparent",
8341
8347
  overscrollBehavior: "contain"
8342
8348
  },
8343
- children: r.map((s, y) => {
8344
- const D = s.value === e, j = y === ee, B = {
8349
+ children: r.map((s, g) => {
8350
+ const E = s.value === e, R = g === ee, D = {
8345
8351
  ...s.tone ? da[s.tone] : void 0,
8346
8352
  ...s.style
8347
8353
  };
@@ -8350,25 +8356,25 @@ function Sc({
8350
8356
  {
8351
8357
  type: "button",
8352
8358
  role: "option",
8353
- "aria-selected": D,
8359
+ "aria-selected": E,
8354
8360
  disabled: s.disabled,
8355
- onMouseEnter: () => !s.disabled && z(y),
8361
+ onMouseEnter: () => !s.disabled && z(g),
8356
8362
  onMouseDown: (ne) => {
8357
8363
  ne.preventDefault(), _(s);
8358
8364
  },
8359
8365
  className: ht(
8360
8366
  "flex w-full items-center gap-2 rounded-lg font-medium text-left transition-colors disabled:cursor-not-allowed disabled:opacity-45",
8361
8367
  ns[a],
8362
- D ? s.className : void 0,
8368
+ E ? s.className : void 0,
8363
8369
  v
8364
8370
  ),
8365
8371
  style: {
8366
- ...D ? B : void 0,
8367
- background: D ? B.background ?? "color-mix(in srgb, var(--primary) 12%, transparent)" : j ? "var(--bg-hover)" : "transparent",
8368
- color: D ? B.color ?? "var(--primary)" : "var(--text-main)"
8372
+ ...E ? D : void 0,
8373
+ background: E ? D.background ?? "color-mix(in srgb, var(--primary) 12%, transparent)" : R ? "var(--bg-hover)" : "transparent",
8374
+ color: E ? D.color ?? "var(--primary)" : "var(--text-main)"
8369
8375
  },
8370
8376
  children: [
8371
- /* @__PURE__ */ t("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center", children: D ? /* @__PURE__ */ t(Ue, { className: "h-4 w-4" }) : null }),
8377
+ /* @__PURE__ */ t("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center", children: E ? /* @__PURE__ */ t(Ue, { className: "h-4 w-4" }) : null }),
8372
8378
  /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: s.label })
8373
8379
  ]
8374
8380
  },
@@ -8385,8 +8391,8 @@ function Sc({
8385
8391
  ref: q,
8386
8392
  className: ht("relative inline-flex shrink-0 items-center", p),
8387
8393
  onKeyDown: oe,
8388
- onClick: E,
8389
- onPointerDown: E,
8394
+ onClick: L,
8395
+ onPointerDown: L,
8390
8396
  children: [
8391
8397
  /* @__PURE__ */ t(
8392
8398
  "button",
@@ -8425,7 +8431,7 @@ function Sc({
8425
8431
  "aria-hidden": "true",
8426
8432
  className: ht(
8427
8433
  "absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full border border-current border-t-transparent animate-spin",
8428
- L
8434
+ T
8429
8435
  )
8430
8436
  }
8431
8437
  ),
@@ -8524,73 +8530,73 @@ function $c({
8524
8530
  previousLabel: h = "Anterior",
8525
8531
  nextLabel: x = "Siguiente",
8526
8532
  blockedNextLabel: v = "Completa este paso",
8527
- className: L = "",
8533
+ className: T = "",
8528
8534
  headerClassName: S = "",
8529
8535
  contentClassName: w = "",
8530
8536
  footerClassName: k = ""
8531
8537
  }) {
8532
- var I;
8533
- const O = ((I = e[0]) == null ? void 0 : I.id) ?? "", [ee, z] = A(
8538
+ var H;
8539
+ const O = ((H = e[0]) == null ? void 0 : H.id) ?? "", [ee, z] = B(
8534
8540
  n ?? O
8535
- ), [Y, T] = A(
8541
+ ), [Y, $] = B(
8536
8542
  i
8537
8543
  ), q = r ?? ee, Z = a ?? Y, te = at(
8538
8544
  () => new Set(Z),
8539
8545
  [Z]
8540
8546
  ), P = Math.max(
8541
8547
  0,
8542
- e.findIndex((M) => M.id === q)
8543
- ), X = e[P] ?? e[0], J = e.length <= 1 ? 100 : P / (e.length - 1) * 100, E = (M) => {
8544
- a || T(M), u == null || u(M);
8545
- }, R = (M) => {
8546
- const G = e.find((V) => V.id === M);
8547
- G && (r || z(M), c == null || c(M, G));
8548
- }, U = (M) => te.has(M), _ = (M) => e.slice(0, M).find((G) => !G.optional && !te.has(G.id)), oe = (M) => {
8549
- const G = e[M];
8550
- return !G || G.disabled ? !1 : M === P || f && M < P ? !0 : !_(M);
8551
- }, W = (M) => {
8552
- const G = e.findIndex((V) => V.id === M);
8548
+ e.findIndex((A) => A.id === q)
8549
+ ), X = e[P] ?? e[0], J = e.length <= 1 ? 100 : P / (e.length - 1) * 100, L = (A) => {
8550
+ a || $(A), u == null || u(A);
8551
+ }, j = (A) => {
8552
+ const G = e.find((V) => V.id === A);
8553
+ G && (r || z(A), c == null || c(A, G));
8554
+ }, U = (A) => te.has(A), _ = (A) => e.slice(0, A).find((G) => !G.optional && !te.has(G.id)), oe = (A) => {
8555
+ const G = e[A];
8556
+ return !G || G.disabled ? !1 : A === P || f && A < P ? !0 : !_(A);
8557
+ }, W = (A) => {
8558
+ const G = e.findIndex((V) => V.id === A);
8553
8559
  return G >= 0 && oe(G);
8554
- }, s = (M) => {
8555
- const G = e.findIndex((V) => V.id === M);
8560
+ }, s = (A) => {
8561
+ const G = e.findIndex((V) => V.id === A);
8556
8562
  if (G < 0) return !1;
8557
8563
  if (!oe(G)) {
8558
8564
  const V = _(G);
8559
8565
  return V && (m == null || m(e[G], V)), !1;
8560
8566
  }
8561
- return R(M), !0;
8562
- }, y = (M = X == null ? void 0 : X.id) => {
8563
- !M || te.has(M) || E([...Z, M]);
8564
- }, D = (M = X == null ? void 0 : X.id) => {
8565
- if (!M) return;
8566
- const G = e.findIndex((re) => re.id === M), V = Z.filter((re) => {
8567
+ return j(A), !0;
8568
+ }, g = (A = X == null ? void 0 : X.id) => {
8569
+ !A || te.has(A) || L([...Z, A]);
8570
+ }, E = (A = X == null ? void 0 : X.id) => {
8571
+ if (!A) return;
8572
+ const G = e.findIndex((re) => re.id === A), V = Z.filter((re) => {
8567
8573
  const me = e.findIndex((se) => se.id === re);
8568
8574
  return me >= 0 && me < G;
8569
8575
  });
8570
- E(V), G >= 0 && P > G && R(M);
8571
- }, j = () => P <= 0 ? !1 : s(e[P - 1].id), B = () => {
8572
- const M = e[P + 1];
8573
- return M ? s(M.id) : !1;
8576
+ L(V), G >= 0 && P > G && j(A);
8577
+ }, R = () => P <= 0 ? !1 : s(e[P - 1].id), D = () => {
8578
+ const A = e[P + 1];
8579
+ return A ? s(A.id) : !1;
8574
8580
  }, ne = {
8575
8581
  activeStep: X,
8576
8582
  activeIndex: P,
8577
8583
  completedStepIds: Z,
8578
8584
  isCompleted: U,
8579
8585
  isUnlocked: W,
8580
- completeStep: y,
8581
- uncompleteStep: D,
8586
+ completeStep: g,
8587
+ uncompleteStep: E,
8582
8588
  goToStep: s,
8583
- goNext: B,
8584
- goPrevious: j
8589
+ goNext: D,
8590
+ goPrevious: R
8585
8591
  };
8586
8592
  if (!X) return null;
8587
- const ce = e[P + 1], pe = P > 0, $ = ce ? W(ce.id) : !1, ie = typeof X.content == "function" ? X.content(ne) : X.content;
8593
+ const ce = e[P + 1], pe = P > 0, M = ce ? W(ce.id) : !1, ie = typeof X.content == "function" ? X.content(ne) : X.content;
8588
8594
  return /* @__PURE__ */ l(
8589
8595
  "section",
8590
8596
  {
8591
8597
  className: it(
8592
8598
  "overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",
8593
- L
8599
+ T
8594
8600
  ),
8595
8601
  children: [
8596
8602
  /* @__PURE__ */ l(
@@ -8615,8 +8621,8 @@ function $c({
8615
8621
  style: {
8616
8622
  gridTemplateColumns: `repeat(${e.length}, minmax(0, 1fr))`
8617
8623
  },
8618
- children: e.map((M, G) => {
8619
- const V = M.id === X.id, re = U(M.id), me = oe(G), se = _(G);
8624
+ children: e.map((A, G) => {
8625
+ const V = A.id === X.id, re = U(A.id), me = oe(G), se = _(G);
8620
8626
  return /* @__PURE__ */ l(
8621
8627
  "button",
8622
8628
  {
@@ -8624,8 +8630,8 @@ function $c({
8624
8630
  disabled: !me,
8625
8631
  "aria-current": V ? "step" : void 0,
8626
8632
  "aria-disabled": !me,
8627
- title: !me && se ? `Completa ${se.title}` : M.title,
8628
- onClick: () => s(M.id),
8633
+ title: !me && se ? `Completa ${se.title}` : A.title,
8634
+ onClick: () => s(A.id),
8629
8635
  className: it(
8630
8636
  "group relative min-h-16 min-w-0 overflow-hidden rounded-md border p-3 text-left transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/35 disabled:cursor-not-allowed",
8631
8637
  V && "border-[var(--primary)] bg-[var(--bg-card)] shadow-sm",
@@ -8668,17 +8674,17 @@ function $c({
8668
8674
  children: [
8669
8675
  G + 1,
8670
8676
  ". ",
8671
- M.title
8677
+ A.title
8672
8678
  ]
8673
8679
  }
8674
8680
  ),
8675
- M.description && /* @__PURE__ */ t("span", { className: "mt-1 block truncate text-[11px] text-[var(--text-muted)]", children: M.description })
8681
+ A.description && /* @__PURE__ */ t("span", { className: "mt-1 block truncate text-[11px] text-[var(--text-muted)]", children: A.description })
8676
8682
  ] }),
8677
- M.badge && /* @__PURE__ */ t("span", { className: "shrink-0", children: M.badge })
8683
+ A.badge && /* @__PURE__ */ t("span", { className: "shrink-0", children: A.badge })
8678
8684
  ] })
8679
8685
  ]
8680
8686
  },
8681
- M.id
8687
+ A.id
8682
8688
  );
8683
8689
  })
8684
8690
  }
@@ -8713,7 +8719,7 @@ function $c({
8713
8719
  padding: "0 14px",
8714
8720
  icon: /* @__PURE__ */ t(Tt, {}),
8715
8721
  disabled: !pe,
8716
- onClick: j,
8722
+ onClick: R,
8717
8723
  children: h
8718
8724
  }
8719
8725
  ),
@@ -8736,9 +8742,9 @@ function $c({
8736
8742
  height: 38,
8737
8743
  padding: "0 14px",
8738
8744
  icon: /* @__PURE__ */ t(st, {}),
8739
- disabled: !ce || !$,
8740
- onClick: B,
8741
- children: ce && !$ ? v : x
8745
+ disabled: !ce || !M,
8746
+ onClick: D,
8747
+ children: ce && !M ? v : x
8742
8748
  }
8743
8749
  )
8744
8750
  ]
@@ -8784,35 +8790,35 @@ const ss = ga(
8784
8790
  status: h = "default",
8785
8791
  icon: x,
8786
8792
  action: v,
8787
- style: L,
8793
+ style: T,
8788
8794
  value: S,
8789
8795
  defaultValue: w,
8790
8796
  maxLength: k,
8791
8797
  onInput: O,
8792
8798
  ...ee
8793
8799
  }, z) {
8794
- const Y = le(null), T = is(S, w), q = p ?? k, Z = !!(x || v || f), te = h === "error" ? "var(--danger)" : h === "success" ? "#16a34a" : "var(--border)", P = {
8795
- ...L ?? {},
8800
+ const Y = le(null), $ = is(S, w), q = p ?? k, Z = !!(x || v || f), te = h === "error" ? "var(--danger)" : h === "success" ? "#16a34a" : "var(--border)", P = {
8801
+ ...T ?? {},
8796
8802
  ...u ? { minHeight: `${u * 24 + 18}px` } : null,
8797
8803
  ...m ? { maxHeight: `${m * 24 + 18}px` } : null
8798
8804
  }, X = () => {
8799
- const E = Y.current;
8800
- !E || !c || (E.style.height = "auto", E.style.height = `${E.scrollHeight}px`);
8805
+ const L = Y.current;
8806
+ !L || !c || (L.style.height = "auto", L.style.height = `${L.scrollHeight}px`);
8801
8807
  };
8802
8808
  Q(X, [c, S]);
8803
8809
  const J = /* @__PURE__ */ t(
8804
8810
  "textarea",
8805
8811
  {
8806
8812
  ...ee,
8807
- ref: (E) => {
8808
- Y.current = E, ls(z, E);
8813
+ ref: (L) => {
8814
+ Y.current = L, ls(z, L);
8809
8815
  },
8810
8816
  value: S,
8811
8817
  defaultValue: w,
8812
8818
  maxLength: k,
8813
8819
  "aria-invalid": h === "error" || ee["aria-invalid"],
8814
- onInput: (E) => {
8815
- X(), O == null || O(E);
8820
+ onInput: (L) => {
8821
+ X(), O == null || O(L);
8816
8822
  },
8817
8823
  style: { ...P, borderColor: te },
8818
8824
  className: `w-full rounded-lg border bg-[var(--bg-input)] text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] transition-colors focus:border-[var(--primary)] disabled:cursor-not-allowed disabled:opacity-60 ${as[a]} ${os[c ? "none" : i]} ${x ? "pl-8" : ""} ${v ? "pr-10" : ""} ${r}`
@@ -8823,7 +8829,7 @@ const ss = ga(
8823
8829
  J,
8824
8830
  v && /* @__PURE__ */ t("span", { className: "absolute right-2 top-2 flex items-center justify-center", children: v }),
8825
8831
  f && /* @__PURE__ */ l("span", { className: "absolute bottom-1.5 right-2 rounded bg-[var(--bg-input)] px-1.5 text-[10px] font-semibold text-[var(--text-muted)]", children: [
8826
- T,
8832
+ $,
8827
8833
  q ? `/${q}` : ""
8828
8834
  ] })
8829
8835
  ] }) : J;
@@ -9032,14 +9038,14 @@ function ys({
9032
9038
  labelSize: h = "xs",
9033
9039
  avatarVersion: x = 0,
9034
9040
  className: v = "",
9035
- style: L
9041
+ style: T
9036
9042
  }) {
9037
9043
  var U;
9038
- const [S, w] = A(!1), k = typeof e == "string" && e.trim() && e !== "undefined" && e !== "null" ? e.trim() : "";
9044
+ const [S, w] = B(!1), k = typeof e == "string" && e.trim() && e !== "undefined" && e !== "null" ? e.trim() : "";
9039
9045
  Q(() => {
9040
9046
  w(!1);
9041
9047
  }, [k, x]);
9042
- const { wh: O, text: ee } = ms[a], z = fa(n) || fa(r) || m, Y = z.trim()[0] || "?", T = typeof process < "u" && ((U = process.env) == null ? void 0 : U.NEXT_PUBLIC_BASE_PATH) || "", q = xs(r, n), Z = gs(T, "/favicon.svg"), te = k ? `${T}/api/user/avatar/${k}${x ? `?v=${x}` : ""}` : "", X = {
9048
+ const { wh: O, text: ee } = ms[a], z = fa(n) || fa(r) || m, Y = z.trim()[0] || "?", $ = typeof process < "u" && ((U = process.env) == null ? void 0 : U.NEXT_PUBLIC_BASE_PATH) || "", q = xs(r, n), Z = gs($, "/favicon.svg"), te = k ? `${$}/api/user/avatar/${k}${x ? `?v=${x}` : ""}` : "", X = {
9043
9049
  xs: 20,
9044
9050
  sm: 28,
9045
9051
  md: 36,
@@ -9049,7 +9055,7 @@ function ys({
9049
9055
  "span",
9050
9056
  {
9051
9057
  className: `${O} ${hs[a]} rounded-full flex items-center justify-center bg-[#071f1a] ring-1 ring-emerald-400/35 shadow-[0_0_0_1px_rgba(255,255,255,0.06)] flex-shrink-0 ${v}`,
9052
- style: L,
9058
+ style: T,
9053
9059
  children: /* @__PURE__ */ t(
9054
9060
  "img",
9055
9061
  {
@@ -9069,7 +9075,7 @@ function ys({
9069
9075
  width: X,
9070
9076
  height: X,
9071
9077
  className: `${O} rounded-full object-cover flex-shrink-0 ${v}`,
9072
- style: L,
9078
+ style: T,
9073
9079
  onError: () => w(!0)
9074
9080
  },
9075
9081
  `${k}-${x}`
@@ -9077,7 +9083,7 @@ function ys({
9077
9083
  "span",
9078
9084
  {
9079
9085
  className: `${O} ${vs(z)} ${ee} rounded-full flex items-center justify-center font-black text-white uppercase flex-shrink-0 ${v}`,
9080
- style: L,
9086
+ style: T,
9081
9087
  title: z,
9082
9088
  children: Y
9083
9089
  }
@@ -9100,12 +9106,12 @@ function ys({
9100
9106
  ]
9101
9107
  }
9102
9108
  );
9103
- const E = c ?? !0, R = u ?? z;
9104
- return E && R ? /* @__PURE__ */ t(
9109
+ const L = c ?? !0, j = u ?? z;
9110
+ return L && j ? /* @__PURE__ */ t(
9105
9111
  Ut,
9106
9112
  {
9107
9113
  as: "span",
9108
- content: R,
9114
+ content: j,
9109
9115
  className: `inline-flex flex-shrink-0 ${f}`,
9110
9116
  children: J
9111
9117
  }
@@ -9132,7 +9138,7 @@ function ks({
9132
9138
  onLogout: f,
9133
9139
  LinkComponent: p = ws
9134
9140
  }) {
9135
- const [h, x] = A(!1), v = Ns(r);
9141
+ const [h, x] = B(!1), v = Ns(r);
9136
9142
  return /* @__PURE__ */ l("div", { className: "min-h-screen bg-[var(--bg-main)] text-[var(--text-main)]", children: [
9137
9143
  /* @__PURE__ */ t(us, {}),
9138
9144
  /* @__PURE__ */ t(
@@ -9178,10 +9184,10 @@ function ks({
9178
9184
  {
9179
9185
  className: "sidebar-scroll min-h-0 flex-1 overflow-y-auto px-3 py-4",
9180
9186
  "data-overlay-scroll": "true",
9181
- children: Object.entries(v).map(([L, S]) => /* @__PURE__ */ l("div", { className: "mb-5", children: [
9187
+ children: Object.entries(v).map(([T, S]) => /* @__PURE__ */ l("div", { className: "mb-5", children: [
9182
9188
  /* @__PURE__ */ l("div", { className: "mb-2 flex items-center gap-2 px-2 text-[11px] font-semibold uppercase tracking-wide text-white/35", children: [
9183
9189
  /* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" }),
9184
- L
9190
+ T
9185
9191
  ] }),
9186
9192
  /* @__PURE__ */ t("div", { className: "space-y-1", children: S.map((w) => {
9187
9193
  const k = n === w.href || n.startsWith(`${w.href}/`);
@@ -9198,7 +9204,7 @@ function ks({
9198
9204
  w.href
9199
9205
  );
9200
9206
  }) })
9201
- ] }, L))
9207
+ ] }, T))
9202
9208
  }
9203
9209
  ),
9204
9210
  /* @__PURE__ */ l("div", { className: "border-t border-white/10 p-3", children: [
@@ -9349,7 +9355,7 @@ function Tc({
9349
9355
  contained: h = !1,
9350
9356
  LinkComponent: x = Ss
9351
9357
  }) {
9352
- const v = le(null), [L, S] = A(!1), [w, k] = A(f ?? "/"), [O, ee] = A(() => ha()), [z, Y] = A(null), T = f ?? w, q = m ?? Ls(T), Z = i ?? Ms(T), te = p && !O && q.length > 1, P = !te;
9358
+ const v = le(null), [T, S] = B(!1), [w, k] = B(f ?? "/"), [O, ee] = B(() => ha()), [z, Y] = B(null), $ = f ?? w, q = m ?? Ls($), Z = i ?? Ms($), te = p && !O && q.length > 1, P = !te;
9353
9359
  Q(() => {
9354
9360
  f || k(window.location.pathname);
9355
9361
  }, [f]), Q(() => {
@@ -9359,7 +9365,7 @@ function Tc({
9359
9365
  S(!1);
9360
9366
  return;
9361
9367
  }
9362
- let J = null, E = 0, R = 0;
9368
+ let J = null, L = 0, j = 0;
9363
9369
  const U = () => {
9364
9370
  const W = v.current, s = document.querySelector(
9365
9371
  "[data-app-scroll='true']"
@@ -9373,8 +9379,8 @@ function Tc({
9373
9379
  }, oe = () => {
9374
9380
  J == null || J.removeEventListener("scroll", _), J = U(), J.addEventListener("scroll", _, { passive: !0 }), _();
9375
9381
  };
9376
- return oe(), E = window.requestAnimationFrame(oe), R = window.setTimeout(oe, 120), () => {
9377
- window.cancelAnimationFrame(E), window.clearTimeout(R), J == null || J.removeEventListener("scroll", _);
9382
+ return oe(), L = window.requestAnimationFrame(oe), j = window.setTimeout(oe, 120), () => {
9383
+ window.cancelAnimationFrame(L), window.clearTimeout(j), J == null || J.removeEventListener("scroll", _);
9378
9384
  };
9379
9385
  }, [h]), Q(() => {
9380
9386
  if (h) {
@@ -9382,62 +9388,62 @@ function Tc({
9382
9388
  return;
9383
9389
  }
9384
9390
  let J = 0;
9385
- const E = [], R = () => {
9386
- const D = v.current, j = D == null ? void 0 : D.parentElement, B = document.querySelector(
9391
+ const L = [], j = () => {
9392
+ const E = v.current, R = E == null ? void 0 : E.parentElement, D = document.querySelector(
9387
9393
  "[data-app-scroll='true']"
9388
- ), ne = tn(B) ?? B;
9389
- if (!D || !j || !ne) {
9394
+ ), ne = tn(D) ?? D;
9395
+ if (!E || !R || !ne) {
9390
9396
  Y(null);
9391
9397
  return;
9392
9398
  }
9393
- const ce = j.getBoundingClientRect(), pe = window.getComputedStyle(j), $ = ne.getBoundingClientRect(), ie = ne instanceof HTMLElement && ne.clientWidth > 0 ? ne.clientWidth : $.width, I = ce.left + parseFloat(pe.paddingLeft || "0"), M = {
9394
- marginLeft: Math.round($.left - I),
9399
+ const ce = R.getBoundingClientRect(), pe = window.getComputedStyle(R), M = ne.getBoundingClientRect(), ie = ne instanceof HTMLElement && ne.clientWidth > 0 ? ne.clientWidth : M.width, H = ce.left + parseFloat(pe.paddingLeft || "0"), A = {
9400
+ marginLeft: Math.round(M.left - H),
9395
9401
  width: Math.round(ie)
9396
9402
  };
9397
9403
  Y(
9398
- (G) => G && G.marginLeft === M.marginLeft && G.width === M.width ? G : M
9404
+ (G) => G && G.marginLeft === A.marginLeft && G.width === A.width ? G : A
9399
9405
  );
9400
9406
  }, U = () => {
9401
- window.cancelAnimationFrame(J), J = window.requestAnimationFrame(R);
9407
+ window.cancelAnimationFrame(J), J = window.requestAnimationFrame(j);
9402
9408
  };
9403
9409
  U(), window.addEventListener("resize", U);
9404
9410
  const _ = new ResizeObserver(U), oe = v.current, W = oe == null ? void 0 : oe.parentElement, s = document.querySelector(
9405
9411
  "[data-app-scroll='true']"
9406
- ), y = tn(s) ?? s;
9407
- return [W, s, y].forEach((D) => {
9408
- D && _.observe(D);
9409
- }), E.push(window.setTimeout(U, 120)), E.push(window.setTimeout(U, 280)), () => {
9410
- window.cancelAnimationFrame(J), window.removeEventListener("resize", U), _.disconnect(), E.forEach((D) => window.clearTimeout(D));
9412
+ ), g = tn(s) ?? s;
9413
+ return [W, s, g].forEach((E) => {
9414
+ E && _.observe(E);
9415
+ }), L.push(window.setTimeout(U, 120)), L.push(window.setTimeout(U, 280)), () => {
9416
+ window.cancelAnimationFrame(J), window.removeEventListener("resize", U), _.disconnect(), L.forEach((E) => window.clearTimeout(E));
9411
9417
  };
9412
9418
  }, [h]);
9413
9419
  const X = {
9414
9420
  ...z ? { marginLeft: z.marginLeft, width: z.width } : null,
9415
- "--page-header-control-height": L ? "34px" : "40px",
9416
- "--page-header-control-padding-x": L ? "10px" : "14px",
9417
- "--page-header-control-icon-left": L ? "10px" : "12px",
9418
- background: h ? "var(--bg-card)" : L ? "color-mix(in srgb, var(--bg-main) 82%, transparent)" : "color-mix(in srgb, var(--bg-main) 58%, transparent)",
9421
+ "--page-header-control-height": T ? "34px" : "40px",
9422
+ "--page-header-control-padding-x": T ? "10px" : "14px",
9423
+ "--page-header-control-icon-left": T ? "10px" : "12px",
9424
+ background: h ? "var(--bg-card)" : T ? "color-mix(in srgb, var(--bg-main) 82%, transparent)" : "color-mix(in srgb, var(--bg-main) 58%, transparent)",
9419
9425
  backdropFilter: "saturate(1.25) blur(18px)",
9420
9426
  WebkitBackdropFilter: "saturate(1.25) blur(18px)",
9421
- borderBottom: h || L ? "1px solid var(--border)" : "1px solid transparent",
9422
- boxShadow: L ? "0 10px 28px rgba(12, 54, 53, 0.12)" : "none"
9427
+ borderBottom: h || T ? "1px solid var(--border)" : "1px solid transparent",
9428
+ boxShadow: T ? "0 10px 28px rgba(12, 54, 53, 0.12)" : "none"
9423
9429
  };
9424
9430
  return /* @__PURE__ */ t(
9425
9431
  "div",
9426
9432
  {
9427
9433
  ref: v,
9428
9434
  "data-page-header": "true",
9429
- "data-compact": L ? "true" : "false",
9435
+ "data-compact": T ? "true" : "false",
9430
9436
  className: `sticky top-0 z-30 overflow-visible py-0 transition-[background-color,box-shadow,border-color] duration-300 ease-out ${h ? "mb-0 flex-shrink-0" : "mb-4 sm:mb-0"} ${c}`,
9431
9437
  style: X,
9432
9438
  children: /* @__PURE__ */ l(
9433
9439
  "div",
9434
9440
  {
9435
- className: `flex flex-wrap items-center justify-between transition-[gap,min-height,padding] duration-300 ease-out ${L ? "min-h-8 gap-1.5 px-3 py-0 sm:min-h-9 sm:gap-2" : P ? "min-h-9 gap-2 px-4 py-0 sm:min-h-10 sm:gap-2.5" : "min-h-10 gap-2.5 px-4 pt-0.5 sm:min-h-11 sm:gap-3"} ${u}`,
9441
+ className: `flex flex-wrap items-center justify-between transition-[gap,min-height,padding] duration-300 ease-out ${T ? "min-h-8 gap-1.5 px-3 py-0 sm:min-h-9 sm:gap-2" : P ? "min-h-9 gap-2 px-4 py-0 sm:min-h-10 sm:gap-2.5" : "min-h-10 gap-2.5 px-4 pt-0.5 sm:min-h-11 sm:gap-3"} ${u}`,
9436
9442
  children: [
9437
9443
  /* @__PURE__ */ l(
9438
9444
  "div",
9439
9445
  {
9440
- className: `min-w-0 flex flex-1 flex-col justify-center transition-[gap,transform] duration-300 ease-out ${L || P ? "gap-1" : "gap-1.5 sm:gap-2"}`,
9446
+ className: `min-w-0 flex flex-1 flex-col justify-center transition-[gap,transform] duration-300 ease-out ${T || P ? "gap-1" : "gap-1.5 sm:gap-2"}`,
9441
9447
  children: [
9442
9448
  te && /* @__PURE__ */ t(
9443
9449
  "nav",
@@ -9447,22 +9453,22 @@ function Tc({
9447
9453
  children: /* @__PURE__ */ t(
9448
9454
  "ol",
9449
9455
  {
9450
- className: `flex flex-wrap items-center gap-1.5 leading-none transition-[font-size,line-height] duration-300 ease-out ${L ? "text-[10px]" : "text-[10px] sm:text-[11px]"}`,
9451
- children: q.map((J, E) => {
9452
- const R = E === q.length - 1;
9456
+ className: `flex flex-wrap items-center gap-1.5 leading-none transition-[font-size,line-height] duration-300 ease-out ${T ? "text-[10px]" : "text-[10px] sm:text-[11px]"}`,
9457
+ children: q.map((J, L) => {
9458
+ const j = L === q.length - 1;
9453
9459
  return /* @__PURE__ */ l(
9454
9460
  "li",
9455
9461
  {
9456
9462
  className: "flex min-w-0 items-center gap-1.5",
9457
9463
  children: [
9458
- E > 0 && /* @__PURE__ */ t(
9464
+ L > 0 && /* @__PURE__ */ t(
9459
9465
  st,
9460
9466
  {
9461
9467
  className: "h-3.5 w-3.5 transition-[color,transform] duration-300 ease-out",
9462
9468
  style: { color: "var(--text-muted)" }
9463
9469
  }
9464
9470
  ),
9465
- J.href && !R ? /* @__PURE__ */ t(
9471
+ J.href && !j ? /* @__PURE__ */ t(
9466
9472
  x,
9467
9473
  {
9468
9474
  href: J.href,
@@ -9473,17 +9479,17 @@ function Tc({
9473
9479
  ) : /* @__PURE__ */ t(
9474
9480
  "span",
9475
9481
  {
9476
- "aria-current": R ? "page" : void 0,
9477
- className: R ? "truncate font-semibold" : "truncate",
9482
+ "aria-current": j ? "page" : void 0,
9483
+ className: j ? "truncate font-semibold" : "truncate",
9478
9484
  style: {
9479
- color: R ? "var(--text-main)" : "var(--text-muted)"
9485
+ color: j ? "var(--text-main)" : "var(--text-muted)"
9480
9486
  },
9481
9487
  children: J.label
9482
9488
  }
9483
9489
  )
9484
9490
  ]
9485
9491
  },
9486
- `${J.label}-${E}`
9492
+ `${J.label}-${L}`
9487
9493
  );
9488
9494
  })
9489
9495
  }
@@ -9493,12 +9499,12 @@ function Tc({
9493
9499
  /* @__PURE__ */ l(
9494
9500
  "div",
9495
9501
  {
9496
- className: `flex min-w-0 items-center transition-[gap,transform] duration-300 ease-out ${L || P ? "gap-2" : "gap-2.5 sm:gap-3"}`,
9502
+ className: `flex min-w-0 items-center transition-[gap,transform] duration-300 ease-out ${T || P ? "gap-2" : "gap-2.5 sm:gap-3"}`,
9497
9503
  children: [
9498
9504
  /* @__PURE__ */ t(
9499
9505
  "span",
9500
9506
  {
9501
- className: `flex-shrink-0 transition-[color,transform,opacity] duration-300 ease-out ${L ? "scale-75 opacity-80" : "scale-90 opacity-100"}`,
9507
+ className: `flex-shrink-0 transition-[color,transform,opacity] duration-300 ease-out ${T ? "scale-75 opacity-80" : "scale-90 opacity-100"}`,
9502
9508
  style: {
9503
9509
  color: te ? "var(--text-secondary)" : "var(--text-muted)"
9504
9510
  },
@@ -9508,13 +9514,13 @@ function Tc({
9508
9514
  /* @__PURE__ */ l(
9509
9515
  "div",
9510
9516
  {
9511
- className: `flex min-w-0 flex-1 flex-wrap items-center transition-[gap] duration-300 ease-out ${L ? "gap-x-2 gap-y-1" : "gap-x-3 gap-y-2"}`,
9517
+ className: `flex min-w-0 flex-1 flex-wrap items-center transition-[gap] duration-300 ease-out ${T ? "gap-x-2 gap-y-1" : "gap-x-3 gap-y-2"}`,
9512
9518
  children: [
9513
9519
  /* @__PURE__ */ l("div", { className: "min-w-0 flex-shrink transition-[transform] duration-300 ease-out", children: [
9514
9520
  /* @__PURE__ */ t(
9515
9521
  "h1",
9516
9522
  {
9517
- className: `truncate font-bold tracking-tight transition-[font-size,line-height,color] duration-300 ease-out ${L ? "text-sm sm:text-base" : "text-lg sm:text-xl"}`,
9523
+ className: `truncate font-bold tracking-tight transition-[font-size,line-height,color] duration-300 ease-out ${T ? "text-sm sm:text-base" : "text-lg sm:text-xl"}`,
9518
9524
  style: { color: "var(--text-main)" },
9519
9525
  children: e
9520
9526
  }
@@ -9522,8 +9528,8 @@ function Tc({
9522
9528
  r && /* @__PURE__ */ t(
9523
9529
  "p",
9524
9530
  {
9525
- "aria-hidden": L,
9526
- className: `overflow-hidden text-xs transition-[max-height,opacity,transform,margin] duration-300 ease-out ${L ? "mt-0 max-h-0 -translate-y-1 opacity-0" : "mt-0.5 max-h-5 translate-y-0 opacity-100"}`,
9531
+ "aria-hidden": T,
9532
+ className: `overflow-hidden text-xs transition-[max-height,opacity,transform,margin] duration-300 ease-out ${T ? "mt-0 max-h-0 -translate-y-1 opacity-0" : "mt-0.5 max-h-5 translate-y-0 opacity-100"}`,
9527
9533
  style: { color: "var(--text-muted)" },
9528
9534
  children: r
9529
9535
  }
@@ -9532,7 +9538,7 @@ function Tc({
9532
9538
  a && /* @__PURE__ */ t(
9533
9539
  "div",
9534
9540
  {
9535
- className: `page-header-meta flex min-w-0 flex-1 basis-full items-center overflow-visible transition-[gap,opacity,transform] duration-300 ease-out sm:basis-auto ${L ? "translate-y-0 gap-1.5 opacity-95" : "gap-2 opacity-100"}`,
9541
+ className: `page-header-meta flex min-w-0 flex-1 basis-full items-center overflow-visible transition-[gap,opacity,transform] duration-300 ease-out sm:basis-auto ${T ? "translate-y-0 gap-1.5 opacity-95" : "gap-2 opacity-100"}`,
9536
9542
  children: a
9537
9543
  }
9538
9544
  )
@@ -9548,7 +9554,7 @@ function Tc({
9548
9554
  n && /* @__PURE__ */ t(
9549
9555
  "div",
9550
9556
  {
9551
- className: `page-header-actions ml-auto flex max-w-full flex-shrink-0 flex-wrap items-center justify-end self-center overflow-visible transition-[gap,min-height,opacity,transform] duration-300 ease-out ${L ? "min-h-9 gap-1 opacity-95" : "min-h-9 gap-1.5 opacity-100"}`,
9557
+ className: `page-header-actions ml-auto flex max-w-full flex-shrink-0 flex-wrap items-center justify-end self-center overflow-visible transition-[gap,min-height,opacity,transform] duration-300 ease-out ${T ? "min-h-9 gap-1 opacity-95" : "min-h-9 gap-1.5 opacity-100"}`,
9552
9558
  children: /* @__PURE__ */ t(
9553
9559
  $a.Provider,
9554
9560
  {
@@ -9597,7 +9603,7 @@ function Dc({
9597
9603
  src: r,
9598
9604
  projectKey: n
9599
9605
  }) {
9600
- const [a, i] = A("system"), c = le(null);
9606
+ const [a, i] = B("system"), c = le(null);
9601
9607
  Q(() => {
9602
9608
  i(va());
9603
9609
  const f = new MutationObserver(
@@ -9622,8 +9628,8 @@ function Dc({
9622
9628
  if (!n) return;
9623
9629
  const f = n;
9624
9630
  function p(h) {
9625
- var L, S, w;
9626
- if (h.source !== ((L = c.current) == null ? void 0 : L.contentWindow) || m && h.origin !== m) return;
9631
+ var T, S, w;
9632
+ if (h.source !== ((T = c.current) == null ? void 0 : T.contentWindow) || m && h.origin !== m) return;
9627
9633
  if (((S = h.data) == null ? void 0 : S.type) === "prime-microservice:overlay") {
9628
9634
  window.dispatchEvent(
9629
9635
  new CustomEvent("prime-auth:microservice-overlay", {
@@ -9661,7 +9667,7 @@ function Dc({
9661
9667
  ) });
9662
9668
  }
9663
9669
  function Bc() {
9664
- const [e, r] = A(""), [n, a] = A(!1), [i, c] = A({ width: 96, height: 96 });
9670
+ const [e, r] = B(""), [n, a] = B(!1), [i, c] = B({ width: 96, height: 96 });
9665
9671
  return Q(() => {
9666
9672
  let u = !1;
9667
9673
  return fetch("/api/microservices/prime-suite/chat-url", { cache: "no-store" }).then((m) => m.ok ? m.json() : null).then((m) => {
@@ -9728,7 +9734,7 @@ function Oc({
9728
9734
  return /* @__PURE__ */ t(Nl, { position: e, theme: r, richColors: !0, closeButton: !0 });
9729
9735
  }
9730
9736
  function Ic(e) {
9731
- const [r, n] = A({}), [a, i] = A(!1), c = we(
9737
+ const [r, n] = B({}), [a, i] = B(!1), c = we(
9732
9738
  (p) => a || r[p] ? e[p] : void 0,
9733
9739
  [e, a, r]
9734
9740
  ), u = we((p) => {