@cm-sigoo-temp/ui 0.2.33 → 0.2.35

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.
@@ -902,7 +902,7 @@ function vo(e) {
902
902
  function zr(e) {
903
903
  return typeof e == "object" && e !== null;
904
904
  }
905
- const Pe = new hn({
905
+ const Ee = new hn({
906
906
  clientId: "sigo-cli",
907
907
  realm: "autenticacion_usuarios",
908
908
  url: "https://cmautenticacion-dev.coordinadora.com"
@@ -1949,14 +1949,14 @@ const _t = (e) => {
1949
1949
  () => [t, { setCargando: n, toogleCargando: o }],
1950
1950
  [t, n, o]
1951
1951
  );
1952
- }, Re = Rr(() => ({
1952
+ }, _e = Rr(() => ({
1953
1953
  abierto: !0,
1954
1954
  cargando: !0,
1955
1955
  toolbar: !0,
1956
1956
  inhabilitado: !1
1957
- })), Ve = Re, lc = (e) => Re.setState({
1958
- inhabilitado: typeof e == "boolean" ? e : e(Re.getState().inhabilitado)
1959
- }), uc = (e, r) => Re.setState({ seleccion: { menu: e, submenu: r } }), zo = ({
1957
+ })), Ve = _e, lc = (e) => _e.setState({
1958
+ inhabilitado: typeof e == "boolean" ? e : e(_e.getState().inhabilitado)
1959
+ }), uc = (e, r) => _e.setState({ seleccion: { menu: e, submenu: r } }), zo = ({
1960
1960
  subMenu: e,
1961
1961
  menu: r,
1962
1962
  LinkComponent: t
@@ -1982,7 +1982,7 @@ const _t = (e) => {
1982
1982
  sx: [{ px: 3 }],
1983
1983
  ...e.to ? { to: e.to } : {},
1984
1984
  LinkComponent: t,
1985
- onClick: () => Re.setState({ seleccion: { menu: r, submenu: e.id } }),
1985
+ onClick: () => _e.setState({ seleccion: { menu: r, submenu: e.id } }),
1986
1986
  children: [
1987
1987
  u,
1988
1988
  /* @__PURE__ */ d.jsx(
@@ -2003,7 +2003,7 @@ const _t = (e) => {
2003
2003
  ]
2004
2004
  }
2005
2005
  ) }) });
2006
- }, Ie = {
2006
+ }, Pe = {
2007
2007
  color: "primary",
2008
2008
  sx: {
2009
2009
  color: "primary.main"
@@ -2043,13 +2043,13 @@ const _t = (e) => {
2043
2043
  ] }) }) : /* @__PURE__ */ d.jsx(br, { title: n ? e.nombre : "", placement: "right", arrow: !0, children: /* @__PURE__ */ d.jsx(xe, { disablePadding: !0, children: /* @__PURE__ */ d.jsxs(
2044
2044
  Se,
2045
2045
  {
2046
- ...Ie,
2046
+ ...Pe,
2047
2047
  ...e.to ? { to: e.to } : {},
2048
2048
  LinkComponent: t,
2049
- onClick: () => Re.setState({ seleccion: { menu: e.id } }),
2049
+ onClick: () => _e.setState({ seleccion: { menu: e.id } }),
2050
2050
  sx: [
2051
2051
  { px: 3 },
2052
- ...Array.isArray(Ie == null ? void 0 : Ie.sx) ? Ie.sx : [Ie == null ? void 0 : Ie.sx]
2052
+ ...Array.isArray(Pe == null ? void 0 : Pe.sx) ? Pe.sx : [Pe == null ? void 0 : Pe.sx]
2053
2053
  ],
2054
2054
  children: [
2055
2055
  u,
@@ -3169,14 +3169,14 @@ function ca() {
3169
3169
  return zt || (zt = 1, process.env.NODE_ENV === "production" ? hr.exports = /* @__PURE__ */ ia() : hr.exports = /* @__PURE__ */ sa()), hr.exports;
3170
3170
  }
3171
3171
  var Sr = /* @__PURE__ */ ca();
3172
- function Ee(e) {
3172
+ function Te(e) {
3173
3173
  if (typeof e != "object" || e === null)
3174
3174
  return !1;
3175
3175
  const r = Object.getPrototypeOf(e);
3176
3176
  return (r === null || r === Object.prototype || Object.getPrototypeOf(r) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
3177
3177
  }
3178
3178
  function Cn(e) {
3179
- if (/* @__PURE__ */ Ue.isValidElement(e) || Sr.isValidElementType(e) || !Ee(e))
3179
+ if (/* @__PURE__ */ Ue.isValidElement(e) || Sr.isValidElementType(e) || !Te(e))
3180
3180
  return e;
3181
3181
  const r = {};
3182
3182
  return Object.keys(e).forEach((t) => {
@@ -3189,9 +3189,9 @@ function me(e, r, t = {
3189
3189
  const n = t.clone ? {
3190
3190
  ...e
3191
3191
  } : e;
3192
- return Ee(e) && Ee(r) && Object.keys(r).forEach((o) => {
3193
- /* @__PURE__ */ Ue.isValidElement(r[o]) || Sr.isValidElementType(r[o]) ? n[o] = r[o] : Ee(r[o]) && // Avoid prototype pollution
3194
- Object.prototype.hasOwnProperty.call(e, o) && Ee(e[o]) ? n[o] = me(e[o], r[o], t) : t.clone ? n[o] = Ee(r[o]) ? Cn(r[o]) : r[o] : n[o] = r[o];
3192
+ return Te(e) && Te(r) && Object.keys(r).forEach((o) => {
3193
+ /* @__PURE__ */ Ue.isValidElement(r[o]) || Sr.isValidElementType(r[o]) ? n[o] = r[o] : Te(r[o]) && // Avoid prototype pollution
3194
+ Object.prototype.hasOwnProperty.call(e, o) && Te(e[o]) ? n[o] = me(e[o], r[o], t) : t.clone ? n[o] = Te(r[o]) ? Cn(r[o]) : r[o] : n[o] = r[o];
3195
3195
  }), n;
3196
3196
  }
3197
3197
  function cr(e, r) {
@@ -3271,7 +3271,7 @@ const _r = {
3271
3271
  }
3272
3272
  })
3273
3273
  };
3274
- function _e(e, r, t) {
3274
+ function Oe(e, r, t) {
3275
3275
  const n = e.theme || {};
3276
3276
  if (Array.isArray(r)) {
3277
3277
  const a = n.breakpoints || Ht;
@@ -3332,7 +3332,7 @@ function ie(e) {
3332
3332
  if (l[r] == null)
3333
3333
  return null;
3334
3334
  const u = l[r], f = l.theme, h = Or(f, n) || {};
3335
- return _e(l, u, (C) => {
3335
+ return Oe(l, u, (C) => {
3336
3336
  let x = wr(h, o, C);
3337
3337
  return C === x && typeof C == "string" && (x = wr(h, o, `${r}${C === "default" ? "" : We(C)}`, C)), t === !1 ? x : {
3338
3338
  [t]: x
@@ -3399,7 +3399,7 @@ function va(e, r, t, n) {
3399
3399
  if (!r.includes(t))
3400
3400
  return null;
3401
3401
  const o = ya(t), a = Aa(o, n), l = e[t];
3402
- return _e(e, l, a);
3402
+ return Oe(e, l, a);
3403
3403
  }
3404
3404
  function kn(e, r) {
3405
3405
  const t = bt(e.theme);
@@ -3437,7 +3437,7 @@ const xa = be("border", ge), Sa = be("borderTop", ge), wa = be("borderRight", ge
3437
3437
  const r = ur(e.theme, "shape.borderRadius", 4, "borderRadius"), t = (n) => ({
3438
3438
  borderRadius: dr(r, n)
3439
3439
  });
3440
- return _e(e, e.borderRadius, t);
3440
+ return Oe(e, e.borderRadius, t);
3441
3441
  }
3442
3442
  return null;
3443
3443
  };
@@ -3451,7 +3451,7 @@ const Mr = (e) => {
3451
3451
  const r = ur(e.theme, "spacing", 8, "gap"), t = (n) => ({
3452
3452
  gap: dr(r, n)
3453
3453
  });
3454
- return _e(e, e.gap, t);
3454
+ return Oe(e, e.gap, t);
3455
3455
  }
3456
3456
  return null;
3457
3457
  };
@@ -3464,7 +3464,7 @@ const Ur = (e) => {
3464
3464
  const r = ur(e.theme, "spacing", 8, "columnGap"), t = (n) => ({
3465
3465
  columnGap: dr(r, n)
3466
3466
  });
3467
- return _e(e, e.columnGap, t);
3467
+ return Oe(e, e.columnGap, t);
3468
3468
  }
3469
3469
  return null;
3470
3470
  };
@@ -3477,7 +3477,7 @@ const Lr = (e) => {
3477
3477
  const r = ur(e.theme, "spacing", 8, "rowGap"), t = (n) => ({
3478
3478
  rowGap: dr(r, n)
3479
3479
  });
3480
- return _e(e, e.rowGap, t);
3480
+ return Oe(e, e.rowGap, t);
3481
3481
  }
3482
3482
  return null;
3483
3483
  };
@@ -3542,7 +3542,7 @@ const Ha = ie({
3542
3542
  maxWidth: pe(t)
3543
3543
  };
3544
3544
  };
3545
- return _e(e, e.maxWidth, r);
3545
+ return Oe(e, e.maxWidth, r);
3546
3546
  }
3547
3547
  return null;
3548
3548
  };
@@ -3892,7 +3892,7 @@ function Xa() {
3892
3892
  [t]: n
3893
3893
  };
3894
3894
  const x = Or(o, h) || {};
3895
- return C ? C(l) : _e(l, n, (v) => {
3895
+ return C ? C(l) : Oe(l, n, (v) => {
3896
3896
  let p = wr(x, w, v);
3897
3897
  return v === p && typeof v == "string" && (p = wr(x, w, `${t}${v === "default" ? "" : We(v)}`, v)), f === !1 ? p : {
3898
3898
  [f]: p
@@ -3925,7 +3925,7 @@ function Xa() {
3925
3925
  if (l[E])
3926
3926
  x = cr(x, e(E, v, o, l));
3927
3927
  else {
3928
- const p = _e({
3928
+ const p = Oe({
3929
3929
  theme: o
3930
3930
  }, v, (_) => ({
3931
3931
  [E]: _
@@ -4434,7 +4434,7 @@ function Ai(e = {}) {
4434
4434
  return function(F) {
4435
4435
  return yr(F, L, F.theme.modularCssLayers ? p : void 0);
4436
4436
  };
4437
- if (Ee(L)) {
4437
+ if (Te(L)) {
4438
4438
  const H = On(L);
4439
4439
  return function(re) {
4440
4440
  return H.variants ? yr(re, H, re.theme.modularCssLayers ? p : void 0) : re.theme.modularCssLayers ? Be(H.style, p) : H.style;
@@ -5348,7 +5348,7 @@ const ns = {
5348
5348
  tooltip: 1500
5349
5349
  };
5350
5350
  function os(e) {
5351
- return Ee(e) || typeof e > "u" || typeof e == "string" || typeof e == "boolean" || typeof e == "number" || Array.isArray(e);
5351
+ return Te(e) || typeof e > "u" || typeof e == "string" || typeof e == "boolean" || typeof e == "number" || Array.isArray(e);
5352
5352
  }
5353
5353
  function Nn(e = {}) {
5354
5354
  const r = {
@@ -5358,7 +5358,7 @@ function Nn(e = {}) {
5358
5358
  const o = Object.entries(n);
5359
5359
  for (let a = 0; a < o.length; a++) {
5360
5360
  const [l, u] = o[a];
5361
- !os(u) || l.startsWith("unstable_") ? delete n[l] : Ee(u) && (n[l] = {
5361
+ !os(u) || l.startsWith("unstable_") ? delete n[l] : Te(u) && (n[l] = {
5362
5362
  ...u
5363
5363
  }, t(n[l]));
5364
5364
  }
@@ -6155,21 +6155,21 @@ const Rs = Ce(/* @__PURE__ */ d.jsx("path", {
6155
6155
  }
6156
6156
  ], Ns = Ce(/* @__PURE__ */ d.jsx("path", {
6157
6157
  d: "M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"
6158
- }), "ExitToAppOutlined"), Te = Rr(
6158
+ }), "ExitToAppOutlined"), Re = Rr(
6159
6159
  () => ({
6160
6160
  ...Ls,
6161
6161
  setTerminal(e) {
6162
- localStorage.setItem("terminal", e.toString()), Te.setState({ terminal: e });
6162
+ localStorage.setItem("terminal", e.toString()), Re.setState({ terminal: e });
6163
6163
  }
6164
6164
  })
6165
- ), Oe = Te, Ds = ({
6165
+ ), Ie = Re, Ds = ({
6166
6166
  onCerrarSesion: e,
6167
6167
  acciones: r
6168
6168
  }) => {
6169
6169
  const [t, n] = Er(null), [o] = Me(Ae.general), [a] = Me(Ae.avatar), l = Ze(
6170
6170
  () => o || a,
6171
6171
  [o, a]
6172
- ), u = Oe((x) => x.avatar), f = Oe((x) => x.nombre), h = Ze(() => {
6172
+ ), u = Ie((x) => x.avatar), f = Ie((x) => x.nombre), h = Ze(() => {
6173
6173
  var E, v;
6174
6174
  const x = f == null ? void 0 : f.split(" ");
6175
6175
  return `${((E = x == null ? void 0 : x[0]) == null ? void 0 : E.charAt(0)) ?? ""}${((v = x == null ? void 0 : x[1]) == null ? void 0 : v.charAt(0)) ?? ""}`;
@@ -6243,10 +6243,10 @@ const Rs = Ce(/* @__PURE__ */ d.jsx("path", {
6243
6243
  )
6244
6244
  ] });
6245
6245
  }, Bs = () => {
6246
- const e = Oe(
6246
+ const e = Ie(
6247
6247
  (n) => n.terminales.find((o) => n.terminal === o.codigo)
6248
6248
  ), r = ye(
6249
- (n) => Te.getState().setTerminal(n),
6249
+ (n) => Re.getState().setTerminal(n),
6250
6250
  []
6251
6251
  );
6252
6252
  return Ze(
@@ -6254,7 +6254,7 @@ const Rs = Ce(/* @__PURE__ */ d.jsx("path", {
6254
6254
  [e, r]
6255
6255
  );
6256
6256
  }, Vs = () => {
6257
- const [e, r] = Bs(), t = Oe((o) => o.terminales), n = ye(
6257
+ const [e, r] = Bs(), t = Ie((o) => o.terminales), n = ye(
6258
6258
  (o) => {
6259
6259
  r(Number(o.target.value));
6260
6260
  },
@@ -6335,7 +6335,7 @@ const Rs = Ce(/* @__PURE__ */ d.jsx("path", {
6335
6335
  acciones: e,
6336
6336
  onCerrarSesion: r
6337
6337
  }) => {
6338
- const t = Oe((u) => u.nombre), n = Oe(
6338
+ const t = Ie((u) => u.nombre), n = Ie(
6339
6339
  (u) => !!u.terminales.length
6340
6340
  ), [o] = Me(Ae.general), [a] = Me(
6341
6341
  Ae.nombreUsuario
@@ -6386,14 +6386,14 @@ const Rs = Ce(/* @__PURE__ */ d.jsx("path", {
6386
6386
  }) => {
6387
6387
  const l = An(
6388
6388
  (U) => !!U.toolbar.length
6389
- ), [u] = Me(Ae.apps), [f] = Me(Ae.general), [h] = Me(Ae.nombreApp), w = Ve((U) => U.inhabilitado), C = Oe((U) => U.abrirApps), x = Oe(
6389
+ ), [u] = Me(Ae.apps), [f] = Me(Ae.general), [h] = Me(Ae.nombreApp), w = Ve((U) => U.inhabilitado), C = Ie((U) => U.abrirApps), x = Ie(
6390
6390
  (U) => U.mostrarBotonDrawer
6391
6391
  ), E = Qn(null), v = ye(() => {
6392
- Te.setState({ abrirApps: !0 });
6392
+ Re.setState({ abrirApps: !0 });
6393
6393
  }, []), p = ye(() => {
6394
- Te.setState({ abrirApps: !1 });
6394
+ Re.setState({ abrirApps: !1 });
6395
6395
  }, []), _ = ye(() => {
6396
- Re.setState({ abierto: !Re.getState().abierto });
6396
+ _e.setState({ abierto: !_e.getState().abierto });
6397
6397
  }, []);
6398
6398
  return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
6399
6399
  /* @__PURE__ */ d.jsxs(
@@ -6487,7 +6487,7 @@ const Rs = Ce(/* @__PURE__ */ d.jsx("path", {
6487
6487
  menus: u,
6488
6488
  LinkComponent: f
6489
6489
  }) => {
6490
- const h = Oe(
6490
+ const h = Ie(
6491
6491
  (w) => typeof w.terminal == "number"
6492
6492
  );
6493
6493
  return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
@@ -6556,7 +6556,7 @@ function Gs({
6556
6556
  tema: l
6557
6557
  }) {
6558
6558
  const u = Ks((x) => x.permisos), [f, h] = Er([]), w = () => {
6559
- Pe.logout();
6559
+ Ee.logout();
6560
6560
  }, C = o.reduce((x, E) => {
6561
6561
  var p, _;
6562
6562
  const v = (p = u == null ? void 0 : u.menus) == null ? void 0 : p.find(({ id: U }) => E.id === U);
@@ -6574,27 +6574,30 @@ function Gs({
6574
6574
  ] : x;
6575
6575
  }, []);
6576
6576
  return Kn(() => {
6577
- if (Pe.didInitialize) return;
6577
+ if (Ee.didInitialize) return;
6578
6578
  const x = new URL(
6579
6579
  "/silent-check-sso.html",
6580
6580
  window.location.href
6581
6581
  ).toString();
6582
- Pe.init({
6582
+ Ee.init({
6583
6583
  onLoad: "check-sso",
6584
6584
  pkceMethod: "S256",
6585
6585
  flow: "standard",
6586
- silentCheckSsoRedirectUri: x
6586
+ silentCheckSsoRedirectUri: x,
6587
+ // Evitar iframe: el servidor Keycloak suele enviar X-Frame-Options: sameorigin
6588
+ // y el navegador bloquea "Refused to display in a frame", rompiendo token/permisos/logout.
6589
+ checkLoginIframe: !1
6587
6590
  }).then((E) => {
6588
6591
  if (!E) {
6589
- Pe.login({
6592
+ Ee.login({
6590
6593
  // select_account fuerza pantalla de selección de cuenta en el IdP (ej. Google).
6591
6594
  // Tipos de keycloak-js no incluyen select_account; es válido en OIDC.
6592
6595
  prompt: "select_account"
6593
6596
  }), rt(Ae.general, !1, !0);
6594
6597
  return;
6595
6598
  }
6596
- const v = Pe.idTokenParsed, { terminal: p, setTerminal: _ } = Te.getState(), U = `${(v == null ? void 0 : v.given_name) ?? ""}${v != null && v.given_name && (v != null && v.family_name) ? " " : ""}${v == null ? void 0 : v.family_name}`;
6597
- Te.setState({
6599
+ const v = Ee.idTokenParsed, { terminal: p, setTerminal: _ } = Re.getState(), U = `${(v == null ? void 0 : v.given_name) ?? ""}${v != null && v.given_name && (v != null && v.family_name) ? " " : ""}${v == null ? void 0 : v.family_name}`;
6600
+ Re.setState({
6598
6601
  nombre: U
6599
6602
  });
6600
6603
  const B = v.terminal;
@@ -6604,13 +6607,10 @@ function Gs({
6604
6607
  rt(Ae.general, !1, !0);
6605
6608
  return;
6606
6609
  }
6607
- Pe.updateToken(30).then(
6608
- () => lo(
6609
- V,
6610
- n,
6611
- Pe.token ?? void 0
6612
- )
6613
- ).then(async (j) => {
6610
+ Ee.updateToken(30).then(() => {
6611
+ const j = Ee.token ?? Ee.idToken ?? void 0;
6612
+ return lo(V, n, j);
6613
+ }).then(async (j) => {
6614
6614
  var c, M, O, N, D;
6615
6615
  const R = (N = (O = (M = (c = j.response) == null ? void 0 : c[0]) == null ? void 0 : M.permisos) == null ? void 0 : O.aplicaciones) == null ? void 0 : N.find(
6616
6616
  ({ id: J }) => J === r
@@ -6639,20 +6639,18 @@ function Gs({
6639
6639
  );
6640
6640
  if (!F.length)
6641
6641
  throw new Error("No tienes acceso a ninguna terminal");
6642
- Te.setState({
6642
+ Re.setState({
6643
6643
  terminales: F,
6644
6644
  mostrarBotonDrawer: !0,
6645
6645
  terminalDeNomina: H
6646
- }), Re.setState({ cargando: !1 });
6647
- const { terminal: re, setTerminal: le } = Te.getState(), W = Number(v == null ? void 0 : v.terminal);
6646
+ }), _e.setState({ cargando: !1 });
6647
+ const { terminal: re, setTerminal: le } = Re.getState(), W = Number(v == null ? void 0 : v.terminal);
6648
6648
  re || le(
6649
6649
  Number.isNaN(W) ? F[0].codigo : W
6650
6650
  );
6651
6651
  }).catch((j) => {
6652
6652
  console.error("Error al obtener permisos", j);
6653
- }).finally(
6654
- () => rt(Ae.general, !1, !0)
6655
- );
6653
+ }).finally(() => rt(Ae.general, !1, !0));
6656
6654
  });
6657
6655
  }, [r]), /* @__PURE__ */ d.jsx(so, { theme: l ?? lt, children: /* @__PURE__ */ d.jsx(
6658
6656
  Qs,
@@ -6676,7 +6674,7 @@ const fc = {
6676
6674
  corporateAccessLabel: n = "Ingresa únicamente con tu correo @coordinadora.com"
6677
6675
  }) => {
6678
6676
  const o = ye(() => {
6679
- Pe.login({ idpHint: "google" });
6677
+ Ee.login({ idpHint: "google" });
6680
6678
  }, []);
6681
6679
  return /* @__PURE__ */ d.jsx(
6682
6680
  ce,
@@ -6982,10 +6980,10 @@ export {
6982
6980
  Q as colores,
6983
6981
  Js as convertirTerminalesToolbar,
6984
6982
  Fn as estadoAuth,
6985
- Re as estadoDrawer,
6983
+ _e as estadoDrawer,
6986
6984
  Ls as estadoInicialToolbar,
6987
- Te as estadoToolbar,
6988
- Pe as keycloak,
6985
+ Re as estadoToolbar,
6986
+ Ee as keycloak,
6989
6987
  Ae as keysCargandoToolbar,
6990
6988
  ic as menusPermitidos,
6991
6989
  dc as obtenerAppsToolbar,
@@ -7005,7 +7003,7 @@ export {
7005
7003
  Me as useCargando,
7006
7004
  Ks as useEstadoAuth,
7007
7005
  Ve as useEstadoDrawer,
7008
- Oe as useEstadoToolbar,
7006
+ Ie as useEstadoToolbar,
7009
7007
  An as useStoreCargando
7010
7008
  };
7011
7009
  //# sourceMappingURL=cm-sigoo-temp-ui.js.map