react-ecosistema-unp 0.9.11-pre-release → 0.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/hooks/useFinalizarSesion.js +1 -1
- package/dist/{chunk-IR6S3I6Y-Dvzk3EbC.js → chunk-IR6S3I6Y-DDsyyqUQ.js} +113 -121
- package/dist/lib/utils/components/ProtectedRoute.d.ts +4 -1
- package/dist/lib/utils/components/UserRoute.d.ts +4 -1
- package/dist/shared/menu-lateral/MenuLateral.js +1 -1
- package/dist/shared/ventana-lienzo/VentanaLienzo.js +1 -1
- package/dist/shared/ventana-tabs/VentanaTabs.js +1 -1
- package/dist/ui/items-modal/ItemsModal.js +1 -1
- package/dist/utils/components/ProtectedRoute.js +14 -16
- package/dist/utils/components/UserRoute.js +6 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useAuthId as O } from "./AuthHook.js";
|
|
2
2
|
import { FinSesionService as C } from "../services/FinSesionService.js";
|
|
3
3
|
import { isValidElement as S } from "react";
|
|
4
|
-
import { a as E } from "../../chunk-IR6S3I6Y-
|
|
4
|
+
import { a as E } from "../../chunk-IR6S3I6Y-DDsyyqUQ.js";
|
|
5
5
|
function L(t) {
|
|
6
6
|
if (typeof document > "u") return;
|
|
7
7
|
let o = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
|
|
@@ -23,7 +23,7 @@ function Pe() {
|
|
|
23
23
|
m = d.lastIndexOf(";", v - 1) + 1;
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
26
|
-
const R = s(d, m, v),
|
|
26
|
+
const R = s(d, m, v), F = l(d, v, R), $ = d.slice(R, F);
|
|
27
27
|
if (f[$] === void 0) {
|
|
28
28
|
let D = s(d, v + 1, C), b = l(d, C, D);
|
|
29
29
|
const I = g(d.slice(D, b));
|
|
@@ -360,11 +360,11 @@ function Ne(e) {
|
|
|
360
360
|
)
|
|
361
361
|
);
|
|
362
362
|
}
|
|
363
|
-
var Te = /^:[\w-]+$/, De = 3,
|
|
363
|
+
var Te = /^:[\w-]+$/, De = 3, Fe = 2, Ae = 1, Oe = 10, Me = -2, se = (e) => e === "*";
|
|
364
364
|
function Be(e, t) {
|
|
365
365
|
let n = e.split("/"), a = n.length;
|
|
366
|
-
return n.some(se) && (a += Me), t && (a +=
|
|
367
|
-
(r, i) => r + (Te.test(i) ? De : i === "" ?
|
|
366
|
+
return n.some(se) && (a += Me), t && (a += Fe), n.filter((r) => !se(r)).reduce(
|
|
367
|
+
(r, i) => r + (Te.test(i) ? De : i === "" ? Ae : Oe),
|
|
368
368
|
a
|
|
369
369
|
);
|
|
370
370
|
}
|
|
@@ -543,8 +543,8 @@ var Ge = [
|
|
|
543
543
|
...pe
|
|
544
544
|
];
|
|
545
545
|
new Set(Ge);
|
|
546
|
-
var
|
|
547
|
-
|
|
546
|
+
var A = u.createContext(null);
|
|
547
|
+
A.displayName = "DataRouter";
|
|
548
548
|
var J = u.createContext(null);
|
|
549
549
|
J.displayName = "DataRouterState";
|
|
550
550
|
var ge = u.createContext({
|
|
@@ -575,7 +575,7 @@ var ee = u.createContext(null);
|
|
|
575
575
|
ee.displayName = "RouteError";
|
|
576
576
|
function Ze(e, { relative: t } = {}) {
|
|
577
577
|
E(
|
|
578
|
-
|
|
578
|
+
O(),
|
|
579
579
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
580
580
|
// router loaded. We can help them understand how to avoid that.
|
|
581
581
|
"useHref() may be used only in the context of a <Router> component."
|
|
@@ -583,12 +583,12 @@ function Ze(e, { relative: t } = {}) {
|
|
|
583
583
|
let { basename: n, navigator: a } = u.useContext(P), { hash: r, pathname: i, search: c } = W(e, { relative: t }), s = i;
|
|
584
584
|
return n !== "/" && (s = i === "/" ? n : L([n, i])), a.createHref({ pathname: s, search: c, hash: r });
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function O() {
|
|
587
587
|
return u.useContext(K) != null;
|
|
588
588
|
}
|
|
589
589
|
function T() {
|
|
590
590
|
return E(
|
|
591
|
-
|
|
591
|
+
O(),
|
|
592
592
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
593
593
|
// router loaded. We can help them understand how to avoid that.
|
|
594
594
|
"useLocation() may be used only in the context of a <Router> component."
|
|
@@ -600,16 +600,16 @@ function ve(e) {
|
|
|
600
600
|
}
|
|
601
601
|
function we() {
|
|
602
602
|
let { isDataRoute: e } = u.useContext(k);
|
|
603
|
-
return e ?
|
|
603
|
+
return e ? dt() : et();
|
|
604
604
|
}
|
|
605
605
|
function et() {
|
|
606
606
|
E(
|
|
607
|
-
|
|
607
|
+
O(),
|
|
608
608
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
609
609
|
// router loaded. We can help them understand how to avoid that.
|
|
610
610
|
"useNavigate() may be used only in the context of a <Router> component."
|
|
611
611
|
);
|
|
612
|
-
let e = u.useContext(
|
|
612
|
+
let e = u.useContext(A), { basename: t, navigator: n } = u.useContext(P), { matches: a } = u.useContext(k), { pathname: r } = T(), i = JSON.stringify(Q(a)), c = u.useRef(!1);
|
|
613
613
|
return ve(() => {
|
|
614
614
|
c.current = !0;
|
|
615
615
|
}), u.useCallback(
|
|
@@ -640,11 +640,7 @@ function et() {
|
|
|
640
640
|
]
|
|
641
641
|
);
|
|
642
642
|
}
|
|
643
|
-
|
|
644
|
-
function nt(e) {
|
|
645
|
-
let t = u.useContext(k).outlet;
|
|
646
|
-
return t && /* @__PURE__ */ u.createElement(tt.Provider, { value: e }, t);
|
|
647
|
-
}
|
|
643
|
+
u.createContext(null);
|
|
648
644
|
function W(e, { relative: t } = {}) {
|
|
649
645
|
let { matches: n } = u.useContext(k), { pathname: a } = T(), r = JSON.stringify(Q(n));
|
|
650
646
|
return u.useMemo(
|
|
@@ -657,9 +653,9 @@ function W(e, { relative: t } = {}) {
|
|
|
657
653
|
[e, r, a, t]
|
|
658
654
|
);
|
|
659
655
|
}
|
|
660
|
-
function
|
|
656
|
+
function tt(e, t, n, a) {
|
|
661
657
|
E(
|
|
662
|
-
|
|
658
|
+
O(),
|
|
663
659
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
664
660
|
// router loaded. We can help them understand how to avoid that.
|
|
665
661
|
"useRoutes() may be used only in the context of a <Router> component."
|
|
@@ -689,7 +685,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v === "/" ? "*" :
|
|
|
689
685
|
), S(
|
|
690
686
|
g == null || g[g.length - 1].route.element !== void 0 || g[g.length - 1].route.Component !== void 0 || g[g.length - 1].route.lazy !== void 0,
|
|
691
687
|
`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
692
|
-
),
|
|
688
|
+
), lt(
|
|
693
689
|
g && g.map(
|
|
694
690
|
(v) => Object.assign({}, v, {
|
|
695
691
|
params: Object.assign({}, l, v.params),
|
|
@@ -710,14 +706,14 @@ Please change the parent <Route path="${v}"> to <Route path="${v === "/" ? "*" :
|
|
|
710
706
|
a
|
|
711
707
|
);
|
|
712
708
|
}
|
|
713
|
-
function
|
|
714
|
-
let e =
|
|
709
|
+
function nt() {
|
|
710
|
+
let e = ft(), t = qe(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: a }, i = { padding: "2px 4px", backgroundColor: a }, c = null;
|
|
715
711
|
return console.error(
|
|
716
712
|
"Error handled by React Router default ErrorBoundary:",
|
|
717
713
|
e
|
|
718
714
|
), c = /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ u.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ u.createElement("code", { style: i }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ u.createElement("code", { style: i }, "errorElement"), " prop on your route.")), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ u.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ u.createElement("pre", { style: r }, n) : null, c);
|
|
719
715
|
}
|
|
720
|
-
var
|
|
716
|
+
var rt = /* @__PURE__ */ u.createElement(nt, null), at = class extends u.Component {
|
|
721
717
|
constructor(e) {
|
|
722
718
|
super(e), this.state = {
|
|
723
719
|
location: e.location,
|
|
@@ -756,11 +752,11 @@ var it = /* @__PURE__ */ u.createElement(at, null), lt = class extends u.Compone
|
|
|
756
752
|
)) : this.props.children;
|
|
757
753
|
}
|
|
758
754
|
};
|
|
759
|
-
function
|
|
760
|
-
let a = u.useContext(
|
|
755
|
+
function it({ routeContext: e, match: t, children: n }) {
|
|
756
|
+
let a = u.useContext(A);
|
|
761
757
|
return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ u.createElement(k.Provider, { value: e }, n);
|
|
762
758
|
}
|
|
763
|
-
function
|
|
759
|
+
function lt(e, t = [], n = null, a = null) {
|
|
764
760
|
if (e == null) {
|
|
765
761
|
if (!n)
|
|
766
762
|
return null;
|
|
@@ -800,7 +796,7 @@ function ut(e, t = [], n = null, a = null) {
|
|
|
800
796
|
}
|
|
801
797
|
return r.reduceRight((l, o, h) => {
|
|
802
798
|
let y, d = !1, p = null, f = null;
|
|
803
|
-
n && (y = i && o.route.id ? i[o.route.id] : void 0, p = o.route.errorElement ||
|
|
799
|
+
n && (y = i && o.route.id ? i[o.route.id] : void 0, p = o.route.errorElement || rt, c && (s < 0 && h === 0 ? (xe(
|
|
804
800
|
"route-fallback",
|
|
805
801
|
!1,
|
|
806
802
|
"No `HydrateFallback` element provided to render during initial hydration"
|
|
@@ -808,7 +804,7 @@ function ut(e, t = [], n = null, a = null) {
|
|
|
808
804
|
let w = t.concat(r.slice(0, h + 1)), g = () => {
|
|
809
805
|
let m;
|
|
810
806
|
return y ? m = p : d ? m = f : o.route.Component ? m = /* @__PURE__ */ u.createElement(o.route.Component, null) : o.route.element ? m = o.route.element : m = l, /* @__PURE__ */ u.createElement(
|
|
811
|
-
|
|
807
|
+
it,
|
|
812
808
|
{
|
|
813
809
|
match: o,
|
|
814
810
|
routeContext: {
|
|
@@ -821,7 +817,7 @@ function ut(e, t = [], n = null, a = null) {
|
|
|
821
817
|
);
|
|
822
818
|
};
|
|
823
819
|
return n && (o.route.ErrorBoundary || o.route.errorElement || h === 0) ? /* @__PURE__ */ u.createElement(
|
|
824
|
-
|
|
820
|
+
at,
|
|
825
821
|
{
|
|
826
822
|
location: n.location,
|
|
827
823
|
revalidation: n.revalidation,
|
|
@@ -836,34 +832,34 @@ function ut(e, t = [], n = null, a = null) {
|
|
|
836
832
|
function te(e) {
|
|
837
833
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
838
834
|
}
|
|
839
|
-
function
|
|
840
|
-
let t = u.useContext(
|
|
835
|
+
function ot(e) {
|
|
836
|
+
let t = u.useContext(A);
|
|
841
837
|
return E(t, te(e)), t;
|
|
842
838
|
}
|
|
843
|
-
function
|
|
839
|
+
function ut(e) {
|
|
844
840
|
let t = u.useContext(J);
|
|
845
841
|
return E(t, te(e)), t;
|
|
846
842
|
}
|
|
847
|
-
function
|
|
843
|
+
function st(e) {
|
|
848
844
|
let t = u.useContext(k);
|
|
849
845
|
return E(t, te(e)), t;
|
|
850
846
|
}
|
|
851
847
|
function ne(e) {
|
|
852
|
-
let t =
|
|
848
|
+
let t = st(e), n = t.matches[t.matches.length - 1];
|
|
853
849
|
return E(
|
|
854
850
|
n.route.id,
|
|
855
851
|
`${e} can only be used on routes that contain a unique "id"`
|
|
856
852
|
), n.route.id;
|
|
857
853
|
}
|
|
858
|
-
function
|
|
854
|
+
function ct() {
|
|
859
855
|
return ne(
|
|
860
856
|
"useRouteId"
|
|
861
857
|
/* UseRouteId */
|
|
862
858
|
);
|
|
863
859
|
}
|
|
864
|
-
function
|
|
860
|
+
function ft() {
|
|
865
861
|
var a;
|
|
866
|
-
let e = u.useContext(ee), t =
|
|
862
|
+
let e = u.useContext(ee), t = ut(
|
|
867
863
|
"useRouteError"
|
|
868
864
|
/* UseRouteError */
|
|
869
865
|
), n = ne(
|
|
@@ -872,8 +868,8 @@ function ht() {
|
|
|
872
868
|
);
|
|
873
869
|
return e !== void 0 ? e : (a = t.errors) == null ? void 0 : a[n];
|
|
874
870
|
}
|
|
875
|
-
function
|
|
876
|
-
let { router: e } =
|
|
871
|
+
function dt() {
|
|
872
|
+
let { router: e } = ot(
|
|
877
873
|
"useNavigate"
|
|
878
874
|
/* UseNavigateStable */
|
|
879
875
|
), t = ne(
|
|
@@ -893,22 +889,22 @@ var ce = {};
|
|
|
893
889
|
function xe(e, t, n) {
|
|
894
890
|
!t && !ce[e] && (ce[e] = !0, S(!1, n));
|
|
895
891
|
}
|
|
896
|
-
u.memo(
|
|
897
|
-
function
|
|
892
|
+
u.memo(ht);
|
|
893
|
+
function ht({
|
|
898
894
|
routes: e,
|
|
899
895
|
future: t,
|
|
900
896
|
state: n
|
|
901
897
|
}) {
|
|
902
|
-
return
|
|
898
|
+
return tt(e, void 0, n, t);
|
|
903
899
|
}
|
|
904
|
-
function
|
|
900
|
+
function Kt({
|
|
905
901
|
to: e,
|
|
906
902
|
replace: t,
|
|
907
903
|
state: n,
|
|
908
904
|
relative: a
|
|
909
905
|
}) {
|
|
910
906
|
E(
|
|
911
|
-
|
|
907
|
+
O(),
|
|
912
908
|
// TODO: This error is probably because they somehow have 2 versions of
|
|
913
909
|
// the router loaded. We can help them understand how to avoid that.
|
|
914
910
|
"<Navigate> may be used only in the context of a <Router> component."
|
|
@@ -928,10 +924,7 @@ function qt({
|
|
|
928
924
|
s(JSON.parse(o), { replace: t, state: n, relative: a });
|
|
929
925
|
}, [s, o, a, t, n]), null;
|
|
930
926
|
}
|
|
931
|
-
function
|
|
932
|
-
return nt(e.context);
|
|
933
|
-
}
|
|
934
|
-
function gt({
|
|
927
|
+
function mt({
|
|
935
928
|
basename: e = "/",
|
|
936
929
|
children: t = null,
|
|
937
930
|
location: n,
|
|
@@ -940,7 +933,7 @@ function gt({
|
|
|
940
933
|
static: i = !1
|
|
941
934
|
}) {
|
|
942
935
|
E(
|
|
943
|
-
!
|
|
936
|
+
!O(),
|
|
944
937
|
"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
|
|
945
938
|
);
|
|
946
939
|
let c = e.replace(/^\/*/, "/"), s = u.useMemo(
|
|
@@ -981,25 +974,25 @@ var z = "get", V = "application/x-www-form-urlencoded";
|
|
|
981
974
|
function Y(e) {
|
|
982
975
|
return e != null && typeof e.tagName == "string";
|
|
983
976
|
}
|
|
984
|
-
function
|
|
977
|
+
function pt(e) {
|
|
985
978
|
return Y(e) && e.tagName.toLowerCase() === "button";
|
|
986
979
|
}
|
|
987
|
-
function
|
|
980
|
+
function gt(e) {
|
|
988
981
|
return Y(e) && e.tagName.toLowerCase() === "form";
|
|
989
982
|
}
|
|
990
|
-
function
|
|
983
|
+
function yt(e) {
|
|
991
984
|
return Y(e) && e.tagName.toLowerCase() === "input";
|
|
992
985
|
}
|
|
993
|
-
function
|
|
986
|
+
function vt(e) {
|
|
994
987
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
995
988
|
}
|
|
996
|
-
function
|
|
989
|
+
function wt(e, t) {
|
|
997
990
|
return e.button === 0 && // Ignore everything but left clicks
|
|
998
991
|
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
999
|
-
!
|
|
992
|
+
!vt(e);
|
|
1000
993
|
}
|
|
1001
994
|
var _ = null;
|
|
1002
|
-
function
|
|
995
|
+
function xt() {
|
|
1003
996
|
if (_ === null)
|
|
1004
997
|
try {
|
|
1005
998
|
new FormData(
|
|
@@ -1012,30 +1005,30 @@ function Ct() {
|
|
|
1012
1005
|
}
|
|
1013
1006
|
return _;
|
|
1014
1007
|
}
|
|
1015
|
-
var
|
|
1008
|
+
var Et = /* @__PURE__ */ new Set([
|
|
1016
1009
|
"application/x-www-form-urlencoded",
|
|
1017
1010
|
"multipart/form-data",
|
|
1018
1011
|
"text/plain"
|
|
1019
1012
|
]);
|
|
1020
1013
|
function G(e) {
|
|
1021
|
-
return e != null && !
|
|
1014
|
+
return e != null && !Et.has(e) ? (S(
|
|
1022
1015
|
!1,
|
|
1023
1016
|
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${V}"`
|
|
1024
1017
|
), null) : e;
|
|
1025
1018
|
}
|
|
1026
|
-
function
|
|
1019
|
+
function Ct(e, t) {
|
|
1027
1020
|
let n, a, r, i, c;
|
|
1028
|
-
if (
|
|
1021
|
+
if (gt(e)) {
|
|
1029
1022
|
let s = e.getAttribute("action");
|
|
1030
1023
|
a = s ? N(s, t) : null, n = e.getAttribute("method") || z, r = G(e.getAttribute("enctype")) || V, i = new FormData(e);
|
|
1031
|
-
} else if (
|
|
1024
|
+
} else if (pt(e) || yt(e) && (e.type === "submit" || e.type === "image")) {
|
|
1032
1025
|
let s = e.form;
|
|
1033
1026
|
if (s == null)
|
|
1034
1027
|
throw new Error(
|
|
1035
1028
|
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
1036
1029
|
);
|
|
1037
1030
|
let l = e.getAttribute("formaction") || s.getAttribute("action");
|
|
1038
|
-
if (a = l ? N(l, t) : null, n = e.getAttribute("formmethod") || s.getAttribute("method") || z, r = G(e.getAttribute("formenctype")) || G(s.getAttribute("enctype")) || V, i = new FormData(s, e), !
|
|
1031
|
+
if (a = l ? N(l, t) : null, n = e.getAttribute("formmethod") || s.getAttribute("method") || z, r = G(e.getAttribute("formenctype")) || G(s.getAttribute("enctype")) || V, i = new FormData(s, e), !xt()) {
|
|
1039
1032
|
let { name: o, type: h, value: y } = e;
|
|
1040
1033
|
if (h === "image") {
|
|
1041
1034
|
let d = o ? `${o}.` : "";
|
|
@@ -1055,7 +1048,7 @@ function re(e, t) {
|
|
|
1055
1048
|
if (e === !1 || e === null || typeof e > "u")
|
|
1056
1049
|
throw new Error(t);
|
|
1057
1050
|
}
|
|
1058
|
-
async function
|
|
1051
|
+
async function Rt(e, t) {
|
|
1059
1052
|
if (e.id in t)
|
|
1060
1053
|
return t[e.id];
|
|
1061
1054
|
try {
|
|
@@ -1072,22 +1065,22 @@ async function St(e, t) {
|
|
|
1072
1065
|
});
|
|
1073
1066
|
}
|
|
1074
1067
|
}
|
|
1075
|
-
function
|
|
1068
|
+
function bt(e) {
|
|
1076
1069
|
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
1077
1070
|
}
|
|
1078
|
-
async function
|
|
1071
|
+
async function St(e, t, n) {
|
|
1079
1072
|
let a = await Promise.all(
|
|
1080
1073
|
e.map(async (r) => {
|
|
1081
1074
|
let i = t.routes[r.route.id];
|
|
1082
1075
|
if (i) {
|
|
1083
|
-
let c = await
|
|
1076
|
+
let c = await Rt(i, n);
|
|
1084
1077
|
return c.links ? c.links() : [];
|
|
1085
1078
|
}
|
|
1086
1079
|
return [];
|
|
1087
1080
|
})
|
|
1088
1081
|
);
|
|
1089
|
-
return
|
|
1090
|
-
a.flat(1).filter(
|
|
1082
|
+
return $t(
|
|
1083
|
+
a.flat(1).filter(bt).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
|
|
1091
1084
|
(r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
|
|
1092
1085
|
)
|
|
1093
1086
|
);
|
|
@@ -1128,8 +1121,8 @@ function fe(e, t, n, a, r, i) {
|
|
|
1128
1121
|
return !0;
|
|
1129
1122
|
}) : [];
|
|
1130
1123
|
}
|
|
1131
|
-
function
|
|
1132
|
-
return
|
|
1124
|
+
function Pt(e, t) {
|
|
1125
|
+
return kt(
|
|
1133
1126
|
e.map((n) => {
|
|
1134
1127
|
let a = t.routes[n.route.id];
|
|
1135
1128
|
if (!a) return [];
|
|
@@ -1138,23 +1131,23 @@ function Lt(e, t) {
|
|
|
1138
1131
|
}).flat(1)
|
|
1139
1132
|
);
|
|
1140
1133
|
}
|
|
1141
|
-
function
|
|
1134
|
+
function kt(e) {
|
|
1142
1135
|
return [...new Set(e)];
|
|
1143
1136
|
}
|
|
1144
|
-
function
|
|
1137
|
+
function Lt(e) {
|
|
1145
1138
|
let t = {}, n = Object.keys(e).sort();
|
|
1146
1139
|
for (let a of n)
|
|
1147
1140
|
t[a] = e[a];
|
|
1148
1141
|
return t;
|
|
1149
1142
|
}
|
|
1150
|
-
function
|
|
1143
|
+
function $t(e, t) {
|
|
1151
1144
|
let n = /* @__PURE__ */ new Set();
|
|
1152
1145
|
return new Set(t), e.reduce((a, r) => {
|
|
1153
|
-
let i = JSON.stringify(
|
|
1146
|
+
let i = JSON.stringify(Lt(r));
|
|
1154
1147
|
return n.has(i) || (n.add(i), a.push({ key: i, link: r })), a;
|
|
1155
1148
|
}, []);
|
|
1156
1149
|
}
|
|
1157
|
-
function
|
|
1150
|
+
function It(e) {
|
|
1158
1151
|
let t = typeof e == "string" ? new URL(
|
|
1159
1152
|
e,
|
|
1160
1153
|
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
@@ -1163,14 +1156,14 @@ function Tt(e) {
|
|
|
1163
1156
|
) : e;
|
|
1164
1157
|
return t.pathname === "/" ? t.pathname = "_root.data" : t.pathname = `${t.pathname.replace(/\/$/, "")}.data`, t;
|
|
1165
1158
|
}
|
|
1166
|
-
function
|
|
1167
|
-
let e = u.useContext(
|
|
1159
|
+
function Nt() {
|
|
1160
|
+
let e = u.useContext(A);
|
|
1168
1161
|
return re(
|
|
1169
1162
|
e,
|
|
1170
1163
|
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
1171
1164
|
), e;
|
|
1172
1165
|
}
|
|
1173
|
-
function
|
|
1166
|
+
function Tt() {
|
|
1174
1167
|
let e = u.useContext(J);
|
|
1175
1168
|
return re(
|
|
1176
1169
|
e,
|
|
@@ -1186,7 +1179,7 @@ function Ee() {
|
|
|
1186
1179
|
"You must render this element inside a <HydratedRouter> element"
|
|
1187
1180
|
), e;
|
|
1188
1181
|
}
|
|
1189
|
-
function
|
|
1182
|
+
function Dt(e, t) {
|
|
1190
1183
|
let n = u.useContext(ae), [a, r] = u.useState(!1), [i, c] = u.useState(!1), { onFocus: s, onBlur: l, onMouseEnter: o, onMouseLeave: h, onTouchStart: y } = t, d = u.useRef(null);
|
|
1191
1184
|
u.useEffect(() => {
|
|
1192
1185
|
if (e === "render" && c(!0), e === "viewport") {
|
|
@@ -1231,21 +1224,21 @@ function B(e, t) {
|
|
|
1231
1224
|
e && e(n), n.defaultPrevented || t(n);
|
|
1232
1225
|
};
|
|
1233
1226
|
}
|
|
1234
|
-
function
|
|
1227
|
+
function Ft({
|
|
1235
1228
|
page: e,
|
|
1236
1229
|
...t
|
|
1237
1230
|
}) {
|
|
1238
|
-
let { router: n } =
|
|
1231
|
+
let { router: n } = Nt(), a = u.useMemo(
|
|
1239
1232
|
() => de(n.routes, e, n.basename),
|
|
1240
1233
|
[n.routes, e, n.basename]
|
|
1241
1234
|
);
|
|
1242
|
-
return a ? /* @__PURE__ */ u.createElement(
|
|
1235
|
+
return a ? /* @__PURE__ */ u.createElement(Ot, { page: e, matches: a, ...t }) : null;
|
|
1243
1236
|
}
|
|
1244
|
-
function
|
|
1237
|
+
function At(e) {
|
|
1245
1238
|
let { manifest: t, routeModules: n } = Ee(), [a, r] = u.useState([]);
|
|
1246
1239
|
return u.useEffect(() => {
|
|
1247
1240
|
let i = !1;
|
|
1248
|
-
return
|
|
1241
|
+
return St(e, t, n).then(
|
|
1249
1242
|
(c) => {
|
|
1250
1243
|
i || r(c);
|
|
1251
1244
|
}
|
|
@@ -1254,12 +1247,12 @@ function Mt(e) {
|
|
|
1254
1247
|
};
|
|
1255
1248
|
}, [e, t, n]), a;
|
|
1256
1249
|
}
|
|
1257
|
-
function
|
|
1250
|
+
function Ot({
|
|
1258
1251
|
page: e,
|
|
1259
1252
|
matches: t,
|
|
1260
1253
|
...n
|
|
1261
1254
|
}) {
|
|
1262
|
-
let a = T(), { manifest: r, routeModules: i } = Ee(), { loaderData: c, matches: s } =
|
|
1255
|
+
let a = T(), { manifest: r, routeModules: i } = Ee(), { loaderData: c, matches: s } = Tt(), l = u.useMemo(
|
|
1263
1256
|
() => fe(
|
|
1264
1257
|
e,
|
|
1265
1258
|
t,
|
|
@@ -1289,7 +1282,7 @@ function Bt({
|
|
|
1289
1282
|
!m || !m.hasLoader || (!l.some((x) => x.route.id === g.route.id) && g.route.id in c && ((v = i[g.route.id]) != null && v.shouldRevalidate) || m.hasClientLoader ? f = !0 : p.add(g.route.id));
|
|
1290
1283
|
}), p.size === 0)
|
|
1291
1284
|
return [];
|
|
1292
|
-
let w =
|
|
1285
|
+
let w = It(e);
|
|
1293
1286
|
return f && p.size > 0 && w.searchParams.set(
|
|
1294
1287
|
"_routes",
|
|
1295
1288
|
t.filter((g) => p.has(g.route.id)).map((g) => g.route.id).join(",")
|
|
@@ -1303,16 +1296,16 @@ function Bt({
|
|
|
1303
1296
|
e,
|
|
1304
1297
|
i
|
|
1305
1298
|
]), y = u.useMemo(
|
|
1306
|
-
() =>
|
|
1299
|
+
() => Pt(o, r),
|
|
1307
1300
|
[o, r]
|
|
1308
|
-
), d =
|
|
1301
|
+
), d = At(o);
|
|
1309
1302
|
return /* @__PURE__ */ u.createElement(u.Fragment, null, h.map((p) => /* @__PURE__ */ u.createElement("link", { key: p, rel: "prefetch", as: "fetch", href: p, ...n })), y.map((p) => /* @__PURE__ */ u.createElement("link", { key: p, rel: "modulepreload", href: p, ...n })), d.map(({ key: p, link: f }) => (
|
|
1310
1303
|
// these don't spread `linkProps` because they are full link descriptors
|
|
1311
1304
|
// already with their own props
|
|
1312
1305
|
/* @__PURE__ */ u.createElement("link", { key: p, ...f })
|
|
1313
1306
|
)));
|
|
1314
1307
|
}
|
|
1315
|
-
function
|
|
1308
|
+
function Mt(...e) {
|
|
1316
1309
|
return (t) => {
|
|
1317
1310
|
e.forEach((n) => {
|
|
1318
1311
|
typeof n == "function" ? n(t) : n != null && (n.current = t);
|
|
@@ -1324,7 +1317,7 @@ try {
|
|
|
1324
1317
|
Ce && (window.__reactRouterVersion = "7.1.5");
|
|
1325
1318
|
} catch {
|
|
1326
1319
|
}
|
|
1327
|
-
function
|
|
1320
|
+
function Yt({
|
|
1328
1321
|
basename: e,
|
|
1329
1322
|
children: t,
|
|
1330
1323
|
window: n
|
|
@@ -1341,7 +1334,7 @@ function Xt({
|
|
|
1341
1334
|
[c]
|
|
1342
1335
|
);
|
|
1343
1336
|
return u.useLayoutEffect(() => r.listen(s), [r, s]), /* @__PURE__ */ u.createElement(
|
|
1344
|
-
|
|
1337
|
+
mt,
|
|
1345
1338
|
{
|
|
1346
1339
|
basename: e,
|
|
1347
1340
|
children: t,
|
|
@@ -1377,10 +1370,10 @@ var Re = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, be = u.forwardRef(
|
|
|
1377
1370
|
`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1378
1371
|
);
|
|
1379
1372
|
}
|
|
1380
|
-
let v = Ze(o, { relative: r }), [x, C, R] =
|
|
1373
|
+
let v = Ze(o, { relative: r }), [x, C, R] = Dt(
|
|
1381
1374
|
a,
|
|
1382
1375
|
d
|
|
1383
|
-
),
|
|
1376
|
+
), F = Wt(o, {
|
|
1384
1377
|
replace: c,
|
|
1385
1378
|
state: s,
|
|
1386
1379
|
target: l,
|
|
@@ -1389,7 +1382,7 @@ var Re = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, be = u.forwardRef(
|
|
|
1389
1382
|
viewTransition: y
|
|
1390
1383
|
});
|
|
1391
1384
|
function $(b) {
|
|
1392
|
-
t && t(b), b.defaultPrevented ||
|
|
1385
|
+
t && t(b), b.defaultPrevented || F(b);
|
|
1393
1386
|
}
|
|
1394
1387
|
let D = (
|
|
1395
1388
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
@@ -1400,17 +1393,17 @@ var Re = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, be = u.forwardRef(
|
|
|
1400
1393
|
...R,
|
|
1401
1394
|
href: g || v,
|
|
1402
1395
|
onClick: m || i ? t : $,
|
|
1403
|
-
ref:
|
|
1396
|
+
ref: Mt(p, C),
|
|
1404
1397
|
target: l,
|
|
1405
1398
|
"data-discover": !w && n === "render" ? "true" : void 0
|
|
1406
1399
|
}
|
|
1407
1400
|
)
|
|
1408
1401
|
);
|
|
1409
|
-
return x && !w ? /* @__PURE__ */ u.createElement(u.Fragment, null, D, /* @__PURE__ */ u.createElement(
|
|
1402
|
+
return x && !w ? /* @__PURE__ */ u.createElement(u.Fragment, null, D, /* @__PURE__ */ u.createElement(Ft, { page: v })) : D;
|
|
1410
1403
|
}
|
|
1411
1404
|
);
|
|
1412
1405
|
be.displayName = "Link";
|
|
1413
|
-
var
|
|
1406
|
+
var Bt = u.forwardRef(
|
|
1414
1407
|
function({
|
|
1415
1408
|
"aria-current": t = "page",
|
|
1416
1409
|
caseSensitive: n = !1,
|
|
@@ -1424,18 +1417,18 @@ var Ht = u.forwardRef(
|
|
|
1424
1417
|
}, h) {
|
|
1425
1418
|
let y = W(c, { relative: o.relative }), d = T(), p = u.useContext(J), { navigator: f, basename: w } = u.useContext(P), g = p != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1426
1419
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1427
|
-
|
|
1420
|
+
Jt(y) && s === !0, m = f.encodeLocation ? f.encodeLocation(y).pathname : y.pathname, v = d.pathname, x = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
|
|
1428
1421
|
n || (v = v.toLowerCase(), x = x ? x.toLowerCase() : null, m = m.toLowerCase()), x && w && (x = N(x, w) || x);
|
|
1429
1422
|
const C = m !== "/" && m.endsWith("/") ? m.length - 1 : m.length;
|
|
1430
|
-
let R = v === m || !r && v.startsWith(m) && v.charAt(C) === "/",
|
|
1423
|
+
let R = v === m || !r && v.startsWith(m) && v.charAt(C) === "/", F = x != null && (x === m || !r && x.startsWith(m) && x.charAt(m.length) === "/"), $ = {
|
|
1431
1424
|
isActive: R,
|
|
1432
|
-
isPending:
|
|
1425
|
+
isPending: F,
|
|
1433
1426
|
isTransitioning: g
|
|
1434
1427
|
}, D = R ? t : void 0, b;
|
|
1435
1428
|
typeof a == "function" ? b = a($) : b = [
|
|
1436
1429
|
a,
|
|
1437
1430
|
R ? "active" : null,
|
|
1438
|
-
|
|
1431
|
+
F ? "pending" : null,
|
|
1439
1432
|
g ? "transitioning" : null
|
|
1440
1433
|
].filter(Boolean).join(" ");
|
|
1441
1434
|
let I = typeof i == "function" ? i($) : i;
|
|
@@ -1454,8 +1447,8 @@ var Ht = u.forwardRef(
|
|
|
1454
1447
|
);
|
|
1455
1448
|
}
|
|
1456
1449
|
);
|
|
1457
|
-
|
|
1458
|
-
var
|
|
1450
|
+
Bt.displayName = "NavLink";
|
|
1451
|
+
var Ut = u.forwardRef(
|
|
1459
1452
|
({
|
|
1460
1453
|
discover: e = "render",
|
|
1461
1454
|
fetcherKey: t,
|
|
@@ -1471,7 +1464,7 @@ var Wt = u.forwardRef(
|
|
|
1471
1464
|
viewTransition: y,
|
|
1472
1465
|
...d
|
|
1473
1466
|
}, p) => {
|
|
1474
|
-
let f =
|
|
1467
|
+
let f = Vt(), w = jt(s, { relative: o }), g = c.toLowerCase() === "get" ? "get" : "post", m = typeof s == "string" && Re.test(s), v = (x) => {
|
|
1475
1468
|
if (l && l(x), x.defaultPrevented) return;
|
|
1476
1469
|
x.preventDefault();
|
|
1477
1470
|
let C = x.nativeEvent.submitter, R = (C == null ? void 0 : C.getAttribute("formmethod")) || c;
|
|
@@ -1499,15 +1492,15 @@ var Wt = u.forwardRef(
|
|
|
1499
1492
|
);
|
|
1500
1493
|
}
|
|
1501
1494
|
);
|
|
1502
|
-
|
|
1503
|
-
function
|
|
1495
|
+
Ut.displayName = "Form";
|
|
1496
|
+
function Ht(e) {
|
|
1504
1497
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1505
1498
|
}
|
|
1506
1499
|
function Se(e) {
|
|
1507
|
-
let t = u.useContext(
|
|
1508
|
-
return E(t,
|
|
1500
|
+
let t = u.useContext(A);
|
|
1501
|
+
return E(t, Ht(e)), t;
|
|
1509
1502
|
}
|
|
1510
|
-
function
|
|
1503
|
+
function Wt(e, {
|
|
1511
1504
|
target: t,
|
|
1512
1505
|
replace: n,
|
|
1513
1506
|
state: a,
|
|
@@ -1518,7 +1511,7 @@ function zt(e, {
|
|
|
1518
1511
|
let s = we(), l = T(), o = W(e, { relative: i });
|
|
1519
1512
|
return u.useCallback(
|
|
1520
1513
|
(h) => {
|
|
1521
|
-
if (
|
|
1514
|
+
if (wt(h, t)) {
|
|
1522
1515
|
h.preventDefault();
|
|
1523
1516
|
let y = n !== void 0 ? n : U(l) === U(o);
|
|
1524
1517
|
s(e, {
|
|
@@ -1544,20 +1537,20 @@ function zt(e, {
|
|
|
1544
1537
|
]
|
|
1545
1538
|
);
|
|
1546
1539
|
}
|
|
1547
|
-
var
|
|
1548
|
-
function
|
|
1540
|
+
var _t = 0, zt = () => `__${String(++_t)}__`;
|
|
1541
|
+
function Vt() {
|
|
1549
1542
|
let { router: e } = Se(
|
|
1550
1543
|
"useSubmit"
|
|
1551
1544
|
/* UseSubmit */
|
|
1552
|
-
), { basename: t } = u.useContext(P), n =
|
|
1545
|
+
), { basename: t } = u.useContext(P), n = ct();
|
|
1553
1546
|
return u.useCallback(
|
|
1554
1547
|
async (a, r = {}) => {
|
|
1555
|
-
let { action: i, method: c, encType: s, formData: l, body: o } =
|
|
1548
|
+
let { action: i, method: c, encType: s, formData: l, body: o } = Ct(
|
|
1556
1549
|
a,
|
|
1557
1550
|
t
|
|
1558
1551
|
);
|
|
1559
1552
|
if (r.navigate === !1) {
|
|
1560
|
-
let h = r.fetcherKey ||
|
|
1553
|
+
let h = r.fetcherKey || zt();
|
|
1561
1554
|
await e.fetch(h, n, r.action || i, {
|
|
1562
1555
|
preventScrollReset: r.preventScrollReset,
|
|
1563
1556
|
formData: l,
|
|
@@ -1583,7 +1576,7 @@ function Jt() {
|
|
|
1583
1576
|
[e, t, n]
|
|
1584
1577
|
);
|
|
1585
1578
|
}
|
|
1586
|
-
function
|
|
1579
|
+
function jt(e, { relative: t } = {}) {
|
|
1587
1580
|
let { basename: n } = u.useContext(P), a = u.useContext(k);
|
|
1588
1581
|
E(a, "useFormAction must be used inside a RouteContext");
|
|
1589
1582
|
let [r] = a.matches.slice(-1), i = { ...W(e || ".", { relative: t }) }, c = T();
|
|
@@ -1598,7 +1591,7 @@ function Kt(e, { relative: t } = {}) {
|
|
|
1598
1591
|
}
|
|
1599
1592
|
return (!e || e === ".") && r.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (i.pathname = i.pathname === "/" ? n : L([n, i.pathname])), U(i);
|
|
1600
1593
|
}
|
|
1601
|
-
function
|
|
1594
|
+
function Jt(e, t = {}) {
|
|
1602
1595
|
let n = u.useContext(ge);
|
|
1603
1596
|
E(
|
|
1604
1597
|
n != null,
|
|
@@ -1615,9 +1608,8 @@ function Yt(e, t = {}) {
|
|
|
1615
1608
|
}
|
|
1616
1609
|
new TextEncoder();
|
|
1617
1610
|
export {
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
Gt as O,
|
|
1611
|
+
Yt as B,
|
|
1612
|
+
Kt as N,
|
|
1621
1613
|
we as a,
|
|
1622
1614
|
T as u
|
|
1623
1615
|
};
|
|
@@ -5,7 +5,7 @@ import { useFinalizarSesion as z } from "../../auth/hooks/useFinalizarSesion.js"
|
|
|
5
5
|
import { urlBase as b, urlCertificadoLaboral as M } from "../../utils/Url.js";
|
|
6
6
|
import { l as k } from "../../logo_escudo_blanco-DaOI8SGq.js";
|
|
7
7
|
import { G as i } from "../../iconBase-LROS5hdG.js";
|
|
8
|
-
import { a as B } from "../../chunk-IR6S3I6Y-
|
|
8
|
+
import { a as B } from "../../chunk-IR6S3I6Y-DDsyyqUQ.js";
|
|
9
9
|
import '../../assets/MenuLateral.css';function H(e) {
|
|
10
10
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M2 12h2a7.986 7.986 0 0 1 2.337-5.663 7.91 7.91 0 0 1 2.542-1.71 8.12 8.12 0 0 1 6.13-.041A2.488 2.488 0 0 0 17.5 7C18.886 7 20 5.886 20 4.5S18.886 2 17.5 2c-.689 0-1.312.276-1.763.725-2.431-.973-5.223-.958-7.635.059a9.928 9.928 0 0 0-3.18 2.139 9.92 9.92 0 0 0-2.14 3.179A10.005 10.005 0 0 0 2 12zm17.373 3.122c-.401.952-.977 1.808-1.71 2.541s-1.589 1.309-2.542 1.71a8.12 8.12 0 0 1-6.13.041A2.488 2.488 0 0 0 6.5 17C5.114 17 4 18.114 4 19.5S5.114 22 6.5 22c.689 0 1.312-.276 1.763-.725A9.965 9.965 0 0 0 12 22a9.983 9.983 0 0 0 9.217-6.102A9.992 9.992 0 0 0 22 12h-2a7.993 7.993 0 0 1-.627 3.122z" }, child: [] }, { tag: "path", attr: { d: "M12 7.462c-2.502 0-4.538 2.036-4.538 4.538S9.498 16.538 12 16.538s4.538-2.036 4.538-4.538S14.502 7.462 12 7.462zm0 7.076c-1.399 0-2.538-1.139-2.538-2.538S10.601 9.462 12 9.462s2.538 1.139 2.538 2.538-1.139 2.538-2.538 2.538z" }, child: [] }] })(e);
|
|
11
11
|
}
|
|
@@ -3,7 +3,7 @@ import m from "react";
|
|
|
3
3
|
import { IconosSistema as i } from "../iconos-sistema/IconosSistema.js";
|
|
4
4
|
import { BreadcrumbNav as l } from "../breadcrumb/Breadcrumb.js";
|
|
5
5
|
import { MenuLateral as c } from "../menu-lateral/MenuLateral.js";
|
|
6
|
-
import { B as p } from "../../chunk-IR6S3I6Y-
|
|
6
|
+
import { B as p } from "../../chunk-IR6S3I6Y-DDsyyqUQ.js";
|
|
7
7
|
import '../../assets/VentanaLienzo.css';const x = ({ children: r, items: a, extraInput: t }) => {
|
|
8
8
|
const [n, s] = m.useState(!1);
|
|
9
9
|
return /* @__PURE__ */ o(p, { children: [
|
|
@@ -9,7 +9,7 @@ import { u as Z, T as ee, g as te, a as ne, b as ae } from "../../TabPane-Q7bzCw
|
|
|
9
9
|
import { u as L, c as k } from "../../ThemeProvider-CFCmmLJC.js";
|
|
10
10
|
import { S as I, T as re, m as oe } from "../../TabContext-CdjYJzMB.js";
|
|
11
11
|
import { c as se } from "../../CardHeaderContext-DVw0yHuy.js";
|
|
12
|
-
import { B as le } from "../../chunk-IR6S3I6Y-
|
|
12
|
+
import { B as le } from "../../chunk-IR6S3I6Y-DDsyyqUQ.js";
|
|
13
13
|
function P(n, e) {
|
|
14
14
|
let a = 0;
|
|
15
15
|
return b.Children.map(n, (t) => /* @__PURE__ */ b.isValidElement(t) ? e(t, a++) : t);
|
|
@@ -2,7 +2,7 @@ import { jsx as o, jsxs as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { h as d, i as s } from "../../index-D_9gBL0I.js";
|
|
3
3
|
import { G as n } from "../../iconBase-LROS5hdG.js";
|
|
4
4
|
import '../../assets/ItemsModal.css';/* empty css */
|
|
5
|
-
import { a as c } from "../../chunk-IR6S3I6Y-
|
|
5
|
+
import { a as c } from "../../chunk-IR6S3I6Y-DDsyyqUQ.js";
|
|
6
6
|
function m(l) {
|
|
7
7
|
return n({ tag: "svg", attr: { viewBox: "0 0 32 32" }, child: [{ tag: "path", attr: { d: "M 15 4 L 15 20.5625 L 9.71875 15.28125 L 8.28125 16.71875 L 15.28125 23.71875 L 16 24.40625 L 16.71875 23.71875 L 23.71875 16.71875 L 22.28125 15.28125 L 17 20.5625 L 17 4 Z M 7 26 L 7 28 L 25 28 L 25 26 Z" }, child: [] }] })(l);
|
|
8
8
|
}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useAuthId as
|
|
3
|
-
import { j as
|
|
4
|
-
import { u as h, N as r
|
|
5
|
-
const _ = () => {
|
|
6
|
-
const { authToken:
|
|
7
|
-
if (!(
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
let s;
|
|
1
|
+
import { jsx as t, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { useAuthId as f } from "../../auth/hooks/AuthHook.js";
|
|
3
|
+
import { j as g } from "../../index-CuHybtft.js";
|
|
4
|
+
import { u as h, N as r } from "../../chunk-IR6S3I6Y-DDsyyqUQ.js";
|
|
5
|
+
const _ = ({ children: s }) => {
|
|
6
|
+
const { authToken: n, userToken: i } = f(), m = h(), a = i || localStorage.getItem("user_token");
|
|
7
|
+
if (!(n || localStorage.getItem("access_token")) || !a)
|
|
8
|
+
return /* @__PURE__ */ t(r, { to: "/", replace: !0 });
|
|
10
9
|
try {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const u = g(a).access_url, e = m.pathname, d = u.map((o) => o.startsWith("/") ? o : `/${o}`), l = e.startsWith("/") ? e : `/${e}`;
|
|
11
|
+
if (!d.includes(l))
|
|
12
|
+
return /* @__PURE__ */ t(r, { to: "/sistema/pagina-no-permitida", replace: !0 });
|
|
13
|
+
} catch (c) {
|
|
14
|
+
return console.error("Error decoding token:", c), /* @__PURE__ */ t(r, { to: "/", replace: !0 });
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
(t) => t.startsWith("/") ? t : `/${t}`
|
|
17
|
-
), m = o.startsWith("/") ? o : `/${o}`;
|
|
18
|
-
return l.includes(m) ? /* @__PURE__ */ e(g, {}) : /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(r, { to: "/sistema/pagina-no-permitida", replace: !0 }) });
|
|
16
|
+
return /* @__PURE__ */ t(p, { children: s });
|
|
19
17
|
};
|
|
20
18
|
export {
|
|
21
19
|
_ as ProtectedRoute
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useAuthId as
|
|
3
|
-
import {
|
|
4
|
-
const p = () => {
|
|
5
|
-
const { authToken:
|
|
6
|
-
return !(
|
|
1
|
+
import { jsx as t, Fragment as n } from "react/jsx-runtime";
|
|
2
|
+
import { useAuthId as s } from "../../auth/hooks/AuthHook.js";
|
|
3
|
+
import { N as m } from "../../chunk-IR6S3I6Y-DDsyyqUQ.js";
|
|
4
|
+
const p = ({ children: e }) => {
|
|
5
|
+
const { authToken: o, userToken: r } = s(), a = r || localStorage.getItem("user_token");
|
|
6
|
+
return !(o || localStorage.getItem("access_token")) || !a ? /* @__PURE__ */ t(m, { to: "/sistema/pagina-no-permitida", replace: !0 }) : /* @__PURE__ */ t(n, { children: e });
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
p as UserRoute
|