react-ecosistema-unp 1.9.1-pre.1 → 1.9.1-pre.2
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 +13 -13
- package/dist/index-Cs6Q8pv4.js +394 -0
- package/dist/shared/iconos-sistema/logout-button/LogoutButton.js +11 -7
- package/dist/shared/menu-lateral/MenuLateral.js +32 -31
- package/dist/utils/components/ProtectedRoute.js +23 -23
- package/dist/utils/components/UserRoute.js +13 -13
- package/dist/utils/eco-provider/EcoContext.js +1 -1
- package/dist/utils/fetch-data/useFetchData.js +1 -1
- package/package.json +1 -1
- package/dist/index-BUe3EJDH.js +0 -115
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { FinSesionService as r } from "../services/FinSesionService.js";
|
|
2
|
-
import { y as
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
5
|
-
const [o,
|
|
6
|
-
return
|
|
2
|
+
import { y as t } from "../../index-Cs6Q8pv4.js";
|
|
3
|
+
import { useState as l, useEffect as c } from "react";
|
|
4
|
+
const d = () => {
|
|
5
|
+
const [o, a] = l(null), s = `${window.location.protocol}//${window.location.host}/`;
|
|
6
|
+
return c(() => {
|
|
7
7
|
const e = localStorage.getItem("auth_state");
|
|
8
8
|
if (e) {
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const n = JSON.parse(e);
|
|
10
|
+
a(n);
|
|
11
11
|
}
|
|
12
12
|
}, []), { FinSesion: () => {
|
|
13
|
-
|
|
13
|
+
t.info("Finalizando sesión..."), new Promise(async (e, n) => {
|
|
14
14
|
try {
|
|
15
|
-
await r((o == null ? void 0 : o.user.username) || "", s),
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
console.log("Intentando finalizar sesión..."), await r((o == null ? void 0 : o.user.username) || "", s), t.success("Sesión finalizada con éxito"), e(!0);
|
|
16
|
+
} catch (i) {
|
|
17
|
+
console.error("Error al finalizar sesión:", i), t.warning("Sesión finalizada localmente"), n(i);
|
|
18
18
|
} finally {
|
|
19
|
-
sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), setTimeout(() => {
|
|
19
|
+
console.log("Finalizando sesión y limpiando tokens..."), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), setTimeout(() => {
|
|
20
20
|
window.location.href = s;
|
|
21
21
|
}, 1e3);
|
|
22
22
|
}
|
|
@@ -24,5 +24,5 @@ const w = () => {
|
|
|
24
24
|
} };
|
|
25
25
|
};
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
d as useFinalizarSesion
|
|
28
28
|
};
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import T, { useState as Q, useRef as D, useEffect as H, useSyncExternalStore as dt, useLayoutEffect as at, isValidElement as U, cloneElement as Z } from "react";
|
|
2
|
+
function ot(t) {
|
|
3
|
+
var e, a, o = "";
|
|
4
|
+
if (typeof t == "string" || typeof t == "number") o += t;
|
|
5
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
6
|
+
var r = t.length;
|
|
7
|
+
for (e = 0; e < r; e++) t[e] && (a = ot(t[e])) && (o && (o += " "), o += a);
|
|
8
|
+
} else for (a in t) t[a] && (o && (o += " "), o += a);
|
|
9
|
+
return o;
|
|
10
|
+
}
|
|
11
|
+
function N() {
|
|
12
|
+
for (var t, e, a = 0, o = "", r = arguments.length; a < r; a++) (t = arguments[a]) && (e = ot(t)) && (o && (o += " "), o += e);
|
|
13
|
+
return o;
|
|
14
|
+
}
|
|
15
|
+
function yt(t) {
|
|
16
|
+
if (typeof document > "u") return;
|
|
17
|
+
let e = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
|
|
18
|
+
a.type = "text/css", e.firstChild ? e.insertBefore(a, e.firstChild) : e.appendChild(a), a.styleSheet ? a.styleSheet.cssText = t : a.appendChild(document.createTextNode(t));
|
|
19
|
+
}
|
|
20
|
+
yt(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
21
|
+
`);
|
|
22
|
+
var M = (t) => typeof t == "number" && !isNaN(t), A = (t) => typeof t == "string", z = (t) => typeof t == "function", ut = (t) => A(t) || M(t), j = (t) => A(t) || z(t) ? t : null, pt = (t, e) => t === !1 || M(t) && t > 0 ? t : e, W = (t) => U(t) || A(t) || z(t) || M(t);
|
|
23
|
+
function mt(t, e, a = 300) {
|
|
24
|
+
let { scrollHeight: o, style: r } = t;
|
|
25
|
+
requestAnimationFrame(() => {
|
|
26
|
+
r.minHeight = "initial", r.height = o + "px", r.transition = `all ${a}ms`, requestAnimationFrame(() => {
|
|
27
|
+
r.height = "0", r.padding = "0", r.margin = "0", setTimeout(e, a);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function _t({ enter: t, exit: e, appendPosition: a = !1, collapse: o = !0, collapseDuration: r = 300 }) {
|
|
32
|
+
return function({ children: l, position: s, preventExitTransition: d, done: f, nodeRef: u, isIn: _, playToast: x }) {
|
|
33
|
+
let E = a ? `${t}--${s}` : t, k = a ? `${e}--${s}` : e, I = D(0);
|
|
34
|
+
return at(() => {
|
|
35
|
+
let v = u.current, m = E.split(" "), p = (n) => {
|
|
36
|
+
n.target === u.current && (x(), v.removeEventListener("animationend", p), v.removeEventListener("animationcancel", p), I.current === 0 && n.type !== "animationcancel" && v.classList.remove(...m));
|
|
37
|
+
};
|
|
38
|
+
v.classList.add(...m), v.addEventListener("animationend", p), v.addEventListener("animationcancel", p);
|
|
39
|
+
}, []), H(() => {
|
|
40
|
+
let v = u.current, m = () => {
|
|
41
|
+
v.removeEventListener("animationend", m), o ? mt(v, f, r) : f();
|
|
42
|
+
};
|
|
43
|
+
_ || (d ? m() : (I.current = 1, v.className += ` ${k}`, v.addEventListener("animationend", m)));
|
|
44
|
+
}, [_]), T.createElement(T.Fragment, null, l);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function et(t, e) {
|
|
48
|
+
return { content: st(t.content, t.props), containerId: t.props.containerId, id: t.props.toastId, theme: t.props.theme, type: t.props.type, data: t.props.data || {}, isLoading: t.props.isLoading, icon: t.props.icon, reason: t.removalReason, status: e };
|
|
49
|
+
}
|
|
50
|
+
function st(t, e, a = !1) {
|
|
51
|
+
return U(t) && !A(t.type) ? Z(t, { closeToast: e.closeToast, toastProps: e, data: e.data, isPaused: a }) : z(t) ? t({ closeToast: e.closeToast, toastProps: e, data: e.data, isPaused: a }) : t;
|
|
52
|
+
}
|
|
53
|
+
function gt({ closeToast: t, theme: e, ariaLabel: a = "close" }) {
|
|
54
|
+
return T.createElement("button", { className: `Toastify__close-button Toastify__close-button--${e}`, type: "button", onClick: (o) => {
|
|
55
|
+
o.stopPropagation(), t(!0);
|
|
56
|
+
}, "aria-label": a }, T.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, T.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" })));
|
|
57
|
+
}
|
|
58
|
+
function bt({ delay: t, isRunning: e, closeToast: a, type: o = "default", hide: r, className: l, controlledProgress: s, progress: d, rtl: f, isIn: u, theme: _ }) {
|
|
59
|
+
let x = r || s && d === 0, E = { animationDuration: `${t}ms`, animationPlayState: e ? "running" : "paused" };
|
|
60
|
+
s && (E.transform = `scaleX(${d})`);
|
|
61
|
+
let k = N("Toastify__progress-bar", s ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${_}`, `Toastify__progress-bar--${o}`, { "Toastify__progress-bar--rtl": f }), I = z(l) ? l({ rtl: f, type: o, defaultClassName: k }) : N(k, l), v = { [s && d >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: s && d < 1 ? null : () => {
|
|
62
|
+
u && a();
|
|
63
|
+
} };
|
|
64
|
+
return T.createElement("div", { className: "Toastify__progress-bar--wrp", "data-hidden": x }, T.createElement("div", { className: `Toastify__progress-bar--bg Toastify__progress-bar-theme--${_} Toastify__progress-bar--${o}` }), T.createElement("div", { role: "progressbar", "aria-hidden": x ? "true" : "false", "aria-label": "notification timer", className: I, style: E, ...v }));
|
|
65
|
+
}
|
|
66
|
+
var vt = 1, rt = () => `${vt++}`;
|
|
67
|
+
function Tt(t, e, a) {
|
|
68
|
+
let o = 1, r = 0, l = [], s = [], d = e, f = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), _ = (n) => (u.add(n), () => u.delete(n)), x = () => {
|
|
69
|
+
s = Array.from(f.values()), u.forEach((n) => n());
|
|
70
|
+
}, E = ({ containerId: n, toastId: i, updateId: c }) => {
|
|
71
|
+
let h = n ? n !== t : t !== 1, C = f.has(i) && c == null;
|
|
72
|
+
return h || C;
|
|
73
|
+
}, k = (n, i) => {
|
|
74
|
+
f.forEach((c) => {
|
|
75
|
+
var h;
|
|
76
|
+
(i == null || i === c.props.toastId) && ((h = c.toggle) == null || h.call(c, n));
|
|
77
|
+
});
|
|
78
|
+
}, I = (n) => {
|
|
79
|
+
var i, c;
|
|
80
|
+
(c = (i = n.props) == null ? void 0 : i.onClose) == null || c.call(i, n.removalReason), n.isActive = !1;
|
|
81
|
+
}, v = (n) => {
|
|
82
|
+
if (n == null) f.forEach(I);
|
|
83
|
+
else {
|
|
84
|
+
let i = f.get(n);
|
|
85
|
+
i && I(i);
|
|
86
|
+
}
|
|
87
|
+
x();
|
|
88
|
+
}, m = () => {
|
|
89
|
+
r -= l.length, l = [];
|
|
90
|
+
}, p = (n) => {
|
|
91
|
+
var i, c;
|
|
92
|
+
let { toastId: h, updateId: C } = n.props, y = C == null;
|
|
93
|
+
n.staleId && f.delete(n.staleId), n.isActive = !0, f.set(h, n), x(), a(et(n, y ? "added" : "updated")), y && ((c = (i = n.props).onOpen) == null || c.call(i));
|
|
94
|
+
};
|
|
95
|
+
return { id: t, props: d, observe: _, toggle: k, removeToast: v, toasts: f, clearQueue: m, buildToast: (n, i) => {
|
|
96
|
+
if (E(i)) return;
|
|
97
|
+
let { toastId: c, updateId: h, data: C, staleId: y, delay: b } = i, L = h == null;
|
|
98
|
+
L && r++;
|
|
99
|
+
let P = { ...d, style: d.toastStyle, key: o++, ...Object.fromEntries(Object.entries(i).filter(([$, S]) => S != null)), toastId: c, updateId: h, data: C, isIn: !1, className: j(i.className || d.toastClassName), progressClassName: j(i.progressClassName || d.progressClassName), autoClose: i.isLoading ? !1 : pt(i.autoClose, d.autoClose), closeToast($) {
|
|
100
|
+
f.get(c).removalReason = $, v(c);
|
|
101
|
+
}, deleteToast() {
|
|
102
|
+
let $ = f.get(c);
|
|
103
|
+
if ($ != null) {
|
|
104
|
+
if (a(et($, "removed")), f.delete(c), r--, r < 0 && (r = 0), l.length > 0) {
|
|
105
|
+
p(l.shift());
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
x();
|
|
109
|
+
}
|
|
110
|
+
} };
|
|
111
|
+
P.closeButton = d.closeButton, i.closeButton === !1 || W(i.closeButton) ? P.closeButton = i.closeButton : i.closeButton === !0 && (P.closeButton = W(d.closeButton) ? d.closeButton : !0);
|
|
112
|
+
let O = { content: n, props: P, staleId: y };
|
|
113
|
+
d.limit && d.limit > 0 && r > d.limit && L ? l.push(O) : M(b) ? setTimeout(() => {
|
|
114
|
+
p(O);
|
|
115
|
+
}, b) : p(O);
|
|
116
|
+
}, setProps(n) {
|
|
117
|
+
d = n;
|
|
118
|
+
}, setToggle: (n, i) => {
|
|
119
|
+
let c = f.get(n);
|
|
120
|
+
c && (c.toggle = i);
|
|
121
|
+
}, isToastActive: (n) => {
|
|
122
|
+
var i;
|
|
123
|
+
return (i = f.get(n)) == null ? void 0 : i.isActive;
|
|
124
|
+
}, getSnapshot: () => s };
|
|
125
|
+
}
|
|
126
|
+
var w = /* @__PURE__ */ new Map(), R = [], V = /* @__PURE__ */ new Set(), ht = (t) => V.forEach((e) => e(t)), nt = () => w.size > 0;
|
|
127
|
+
function xt() {
|
|
128
|
+
R.forEach((t) => lt(t.content, t.options)), R = [];
|
|
129
|
+
}
|
|
130
|
+
var kt = (t, { containerId: e }) => {
|
|
131
|
+
var a;
|
|
132
|
+
return (a = w.get(e || 1)) == null ? void 0 : a.toasts.get(t);
|
|
133
|
+
};
|
|
134
|
+
function it(t, e) {
|
|
135
|
+
var a;
|
|
136
|
+
if (e) return !!((a = w.get(e)) != null && a.isToastActive(t));
|
|
137
|
+
let o = !1;
|
|
138
|
+
return w.forEach((r) => {
|
|
139
|
+
r.isToastActive(t) && (o = !0);
|
|
140
|
+
}), o;
|
|
141
|
+
}
|
|
142
|
+
function Et(t) {
|
|
143
|
+
if (!nt()) {
|
|
144
|
+
R = R.filter((e) => t != null && e.options.toastId !== t);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (t == null || ut(t)) w.forEach((e) => {
|
|
148
|
+
e.removeToast(t);
|
|
149
|
+
});
|
|
150
|
+
else if (t && ("containerId" in t || "id" in t)) {
|
|
151
|
+
let e = w.get(t.containerId);
|
|
152
|
+
e ? e.removeToast(t.id) : w.forEach((a) => {
|
|
153
|
+
a.removeToast(t.id);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
var wt = (t = {}) => {
|
|
158
|
+
w.forEach((e) => {
|
|
159
|
+
e.props.limit && (!t.containerId || e.id === t.containerId) && e.clearQueue();
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
function lt(t, e) {
|
|
163
|
+
W(t) && (nt() || R.push({ content: t, options: e }), w.forEach((a) => {
|
|
164
|
+
a.buildToast(t, e);
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
function It(t) {
|
|
168
|
+
var e;
|
|
169
|
+
(e = w.get(t.containerId || 1)) == null || e.setToggle(t.id, t.fn);
|
|
170
|
+
}
|
|
171
|
+
function ft(t, e) {
|
|
172
|
+
w.forEach((a) => {
|
|
173
|
+
(e == null || !(e != null && e.containerId) || (e == null ? void 0 : e.containerId) === a.id) && a.toggle(t, e == null ? void 0 : e.id);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function Ct(t) {
|
|
177
|
+
let e = t.containerId || 1;
|
|
178
|
+
return { subscribe(a) {
|
|
179
|
+
let o = Tt(e, t, ht);
|
|
180
|
+
w.set(e, o);
|
|
181
|
+
let r = o.observe(a);
|
|
182
|
+
return xt(), () => {
|
|
183
|
+
r(), w.delete(e);
|
|
184
|
+
};
|
|
185
|
+
}, setProps(a) {
|
|
186
|
+
var o;
|
|
187
|
+
(o = w.get(e)) == null || o.setProps(a);
|
|
188
|
+
}, getSnapshot() {
|
|
189
|
+
var a;
|
|
190
|
+
return (a = w.get(e)) == null ? void 0 : a.getSnapshot();
|
|
191
|
+
} };
|
|
192
|
+
}
|
|
193
|
+
function Lt(t) {
|
|
194
|
+
return V.add(t), () => {
|
|
195
|
+
V.delete(t);
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function Ot(t) {
|
|
199
|
+
return t && (A(t.toastId) || M(t.toastId)) ? t.toastId : rt();
|
|
200
|
+
}
|
|
201
|
+
function B(t, e) {
|
|
202
|
+
return lt(t, e), e.toastId;
|
|
203
|
+
}
|
|
204
|
+
function F(t, e) {
|
|
205
|
+
return { ...e, type: e && e.type || t, toastId: Ot(e) };
|
|
206
|
+
}
|
|
207
|
+
function Y(t) {
|
|
208
|
+
return (e, a) => B(e, F(t, a));
|
|
209
|
+
}
|
|
210
|
+
function g(t, e) {
|
|
211
|
+
return B(t, F("default", e));
|
|
212
|
+
}
|
|
213
|
+
g.loading = (t, e) => B(t, F("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...e }));
|
|
214
|
+
function zt(t, { pending: e, error: a, success: o }, r) {
|
|
215
|
+
let l;
|
|
216
|
+
e && (l = A(e) ? g.loading(e, r) : g.loading(e.render, { ...r, ...e }));
|
|
217
|
+
let s = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, d = (u, _, x) => {
|
|
218
|
+
if (_ == null) {
|
|
219
|
+
g.dismiss(l);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
let E = { type: u, ...s, ...r, data: x }, k = A(_) ? { render: _ } : _;
|
|
223
|
+
return l ? g.update(l, { ...E, ...k }) : g(k.render, { ...E, ...k }), x;
|
|
224
|
+
}, f = z(t) ? t() : t;
|
|
225
|
+
return f.then((u) => d("success", o, u)).catch((u) => d("error", a, u)), f;
|
|
226
|
+
}
|
|
227
|
+
g.promise = zt;
|
|
228
|
+
g.success = Y("success");
|
|
229
|
+
g.info = Y("info");
|
|
230
|
+
g.error = Y("error");
|
|
231
|
+
g.warning = Y("warning");
|
|
232
|
+
g.warn = g.warning;
|
|
233
|
+
g.dark = (t, e) => B(t, F("default", { theme: "dark", ...e }));
|
|
234
|
+
function Pt(t) {
|
|
235
|
+
Et(t);
|
|
236
|
+
}
|
|
237
|
+
g.dismiss = Pt;
|
|
238
|
+
g.clearWaitingQueue = wt;
|
|
239
|
+
g.isActive = it;
|
|
240
|
+
g.update = (t, e = {}) => {
|
|
241
|
+
let a = kt(t, e);
|
|
242
|
+
if (a) {
|
|
243
|
+
let { props: o, content: r } = a, l = { delay: 100, ...o, ...e, toastId: e.toastId || t, updateId: rt() };
|
|
244
|
+
l.toastId !== t && (l.staleId = t);
|
|
245
|
+
let s = l.render || r;
|
|
246
|
+
delete l.render, B(s, l);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
g.done = (t) => {
|
|
250
|
+
g.update(t, { progress: 1 });
|
|
251
|
+
};
|
|
252
|
+
g.onChange = Lt;
|
|
253
|
+
g.play = (t) => ft(!0, t);
|
|
254
|
+
g.pause = (t) => ft(!1, t);
|
|
255
|
+
function $t(t) {
|
|
256
|
+
var e;
|
|
257
|
+
let { subscribe: a, getSnapshot: o, setProps: r } = D(Ct(t)).current;
|
|
258
|
+
r(t);
|
|
259
|
+
let l = (e = dt(a, o, o)) == null ? void 0 : e.slice();
|
|
260
|
+
function s(d) {
|
|
261
|
+
if (!l) return [];
|
|
262
|
+
let f = /* @__PURE__ */ new Map();
|
|
263
|
+
return t.newestOnTop && l.reverse(), l.forEach((u) => {
|
|
264
|
+
let { position: _ } = u.props;
|
|
265
|
+
f.has(_) || f.set(_, []), f.get(_).push(u);
|
|
266
|
+
}), Array.from(f, (u) => d(u[0], u[1]));
|
|
267
|
+
}
|
|
268
|
+
return { getToastToRender: s, isToastActive: it, count: l == null ? void 0 : l.length };
|
|
269
|
+
}
|
|
270
|
+
function Nt(t) {
|
|
271
|
+
let [e, a] = Q(!1), [o, r] = Q(!1), l = D(null), s = D({ start: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, didMove: !1 }).current, { autoClose: d, pauseOnHover: f, closeToast: u, onClick: _, closeOnClick: x } = t;
|
|
272
|
+
It({ id: t.toastId, containerId: t.containerId, fn: a }), H(() => {
|
|
273
|
+
if (t.pauseOnFocusLoss) return E(), () => {
|
|
274
|
+
k();
|
|
275
|
+
};
|
|
276
|
+
}, [t.pauseOnFocusLoss]);
|
|
277
|
+
function E() {
|
|
278
|
+
document.hasFocus() || p(), window.addEventListener("focus", m), window.addEventListener("blur", p);
|
|
279
|
+
}
|
|
280
|
+
function k() {
|
|
281
|
+
window.removeEventListener("focus", m), window.removeEventListener("blur", p);
|
|
282
|
+
}
|
|
283
|
+
function I(y) {
|
|
284
|
+
if (t.draggable === !0 || t.draggable === y.pointerType) {
|
|
285
|
+
n();
|
|
286
|
+
let b = l.current;
|
|
287
|
+
s.canCloseOnClick = !0, s.canDrag = !0, b.style.transition = "none", t.draggableDirection === "x" ? (s.start = y.clientX, s.removalDistance = b.offsetWidth * (t.draggablePercent / 100)) : (s.start = y.clientY, s.removalDistance = b.offsetHeight * (t.draggablePercent === 80 ? t.draggablePercent * 1.5 : t.draggablePercent) / 100);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function v(y) {
|
|
291
|
+
let { top: b, bottom: L, left: P, right: O } = l.current.getBoundingClientRect();
|
|
292
|
+
y.nativeEvent.type !== "touchend" && t.pauseOnHover && y.clientX >= P && y.clientX <= O && y.clientY >= b && y.clientY <= L ? p() : m();
|
|
293
|
+
}
|
|
294
|
+
function m() {
|
|
295
|
+
a(!0);
|
|
296
|
+
}
|
|
297
|
+
function p() {
|
|
298
|
+
a(!1);
|
|
299
|
+
}
|
|
300
|
+
function n() {
|
|
301
|
+
s.didMove = !1, document.addEventListener("pointermove", c), document.addEventListener("pointerup", h);
|
|
302
|
+
}
|
|
303
|
+
function i() {
|
|
304
|
+
document.removeEventListener("pointermove", c), document.removeEventListener("pointerup", h);
|
|
305
|
+
}
|
|
306
|
+
function c(y) {
|
|
307
|
+
let b = l.current;
|
|
308
|
+
if (s.canDrag && b) {
|
|
309
|
+
s.didMove = !0, e && p(), t.draggableDirection === "x" ? s.delta = y.clientX - s.start : s.delta = y.clientY - s.start, s.start !== y.clientX && (s.canCloseOnClick = !1);
|
|
310
|
+
let L = t.draggableDirection === "x" ? `${s.delta}px, var(--y)` : `0, calc(${s.delta}px + var(--y))`;
|
|
311
|
+
b.style.transform = `translate3d(${L},0)`, b.style.opacity = `${1 - Math.abs(s.delta / s.removalDistance)}`;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function h() {
|
|
315
|
+
i();
|
|
316
|
+
let y = l.current;
|
|
317
|
+
if (s.canDrag && s.didMove && y) {
|
|
318
|
+
if (s.canDrag = !1, Math.abs(s.delta) > s.removalDistance) {
|
|
319
|
+
r(!0), t.closeToast(!0), t.collapseAll();
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
y.style.transition = "transform 0.2s, opacity 0.2s", y.style.removeProperty("transform"), y.style.removeProperty("opacity");
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
let C = { onPointerDown: I, onPointerUp: v };
|
|
326
|
+
return d && f && (C.onMouseEnter = p, t.stacked || (C.onMouseLeave = m)), x && (C.onClick = (y) => {
|
|
327
|
+
_ && _(y), s.canCloseOnClick && u(!0);
|
|
328
|
+
}), { playToast: m, pauseToast: p, isRunning: e, preventExitTransition: o, toastRef: l, eventHandlers: C };
|
|
329
|
+
}
|
|
330
|
+
var At = typeof window < "u" ? at : H, q = ({ theme: t, type: e, isLoading: a, ...o }) => T.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${e})`, ...o });
|
|
331
|
+
function Dt(t) {
|
|
332
|
+
return T.createElement(q, { ...t }, T.createElement("path", { d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z" }));
|
|
333
|
+
}
|
|
334
|
+
function Rt(t) {
|
|
335
|
+
return T.createElement(q, { ...t }, T.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }));
|
|
336
|
+
}
|
|
337
|
+
function Mt(t) {
|
|
338
|
+
return T.createElement(q, { ...t }, T.createElement("path", { d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" }));
|
|
339
|
+
}
|
|
340
|
+
function Bt(t) {
|
|
341
|
+
return T.createElement(q, { ...t }, T.createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" }));
|
|
342
|
+
}
|
|
343
|
+
function St() {
|
|
344
|
+
return T.createElement("div", { className: "Toastify__spinner" });
|
|
345
|
+
}
|
|
346
|
+
var G = { info: Rt, warning: Dt, success: Mt, error: Bt, spinner: St }, Xt = (t) => t in G;
|
|
347
|
+
function Ht({ theme: t, type: e, isLoading: a, icon: o }) {
|
|
348
|
+
let r = null, l = { theme: t, type: e };
|
|
349
|
+
return o === !1 || (z(o) ? r = o({ ...l, isLoading: a }) : U(o) ? r = Z(o, l) : a ? r = G.spinner() : Xt(e) && (r = G[e](l))), r;
|
|
350
|
+
}
|
|
351
|
+
var Ut = (t) => {
|
|
352
|
+
let { isRunning: e, preventExitTransition: a, toastRef: o, eventHandlers: r, playToast: l } = Nt(t), { closeButton: s, children: d, autoClose: f, onClick: u, type: _, hideProgressBar: x, closeToast: E, transition: k, position: I, className: v, style: m, progressClassName: p, updateId: n, role: i, progress: c, rtl: h, toastId: C, deleteToast: y, isIn: b, isLoading: L, closeOnClick: P, theme: O, ariaLabel: $ } = t, S = N("Toastify__toast", `Toastify__toast-theme--${O}`, `Toastify__toast--${_}`, { "Toastify__toast--rtl": h }, { "Toastify__toast--close-on-click": P }), ct = z(v) ? v({ rtl: h, position: I, type: _, defaultClassName: S }) : N(S, v), J = Ht(t), tt = !!c || !f, K = { closeToast: E, type: _, theme: O }, X = null;
|
|
353
|
+
return s === !1 || (z(s) ? X = s(K) : U(s) ? X = Z(s, K) : X = gt(K)), T.createElement(k, { isIn: b, done: y, position: I, preventExitTransition: a, nodeRef: o, playToast: l }, T.createElement("div", { id: C, tabIndex: 0, onClick: u, "data-in": b, className: ct, ...r, style: m, ref: o, ...b && { role: i, "aria-label": $ } }, J != null && T.createElement("div", { className: N("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !L }) }, J), st(d, t, !e), X, !t.customProgressBar && T.createElement(bt, { ...n && !tt ? { key: `p-${n}` } : {}, rtl: h, theme: O, delay: f, isRunning: e, isIn: b, closeToast: E, hide: x, type: _, className: p, controlledProgress: tt, progress: c || 0 })));
|
|
354
|
+
}, Ft = (t, e = !1) => ({ enter: `Toastify--animate Toastify__${t}-enter`, exit: `Toastify--animate Toastify__${t}-exit`, appendPosition: e }), Yt = _t(Ft("bounce", !0)), qt = { position: "top-right", transition: Yt, autoClose: 5e3, closeButton: !0, pauseOnHover: !0, pauseOnFocusLoss: !0, draggable: "touch", draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light", "aria-label": "Notifications Alt+T", hotKeys: (t) => t.altKey && t.code === "KeyT" };
|
|
355
|
+
function Qt(t) {
|
|
356
|
+
let e = { ...qt, ...t }, a = t.stacked, [o, r] = Q(!0), l = D(null), { getToastToRender: s, isToastActive: d, count: f } = $t(e), { className: u, style: _, rtl: x, containerId: E, hotKeys: k } = e;
|
|
357
|
+
function I(m) {
|
|
358
|
+
let p = N("Toastify__toast-container", `Toastify__toast-container--${m}`, { "Toastify__toast-container--rtl": x });
|
|
359
|
+
return z(u) ? u({ position: m, rtl: x, defaultClassName: p }) : N(p, j(u));
|
|
360
|
+
}
|
|
361
|
+
function v() {
|
|
362
|
+
a && (r(!0), g.play());
|
|
363
|
+
}
|
|
364
|
+
return At(() => {
|
|
365
|
+
var m;
|
|
366
|
+
if (a) {
|
|
367
|
+
let p = l.current.querySelectorAll('[data-in="true"]'), n = 12, i = (m = e.position) == null ? void 0 : m.includes("top"), c = 0, h = 0;
|
|
368
|
+
Array.from(p).reverse().forEach((C, y) => {
|
|
369
|
+
let b = C;
|
|
370
|
+
b.classList.add("Toastify__toast--stacked"), y > 0 && (b.dataset.collapsed = `${o}`), b.dataset.pos || (b.dataset.pos = i ? "top" : "bot");
|
|
371
|
+
let L = c * (o ? 0.2 : 1) + (o ? 0 : n * y);
|
|
372
|
+
b.style.setProperty("--y", `${i ? L : L * -1}px`), b.style.setProperty("--g", `${n}`), b.style.setProperty("--s", `${1 - (o ? h : 0)}`), c += b.offsetHeight, h += 0.025;
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}, [o, f, a]), H(() => {
|
|
376
|
+
function m(p) {
|
|
377
|
+
var n;
|
|
378
|
+
let i = l.current;
|
|
379
|
+
k(p) && ((n = i.querySelector('[tabIndex="0"]')) == null || n.focus(), r(!1), g.pause()), p.key === "Escape" && (document.activeElement === i || i != null && i.contains(document.activeElement)) && (r(!0), g.play());
|
|
380
|
+
}
|
|
381
|
+
return document.addEventListener("keydown", m), () => {
|
|
382
|
+
document.removeEventListener("keydown", m);
|
|
383
|
+
};
|
|
384
|
+
}, [k]), T.createElement("section", { ref: l, className: "Toastify", id: E, onMouseEnter: () => {
|
|
385
|
+
a && (r(!1), g.pause());
|
|
386
|
+
}, onMouseLeave: v, "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text", "aria-label": e["aria-label"] }, s((m, p) => {
|
|
387
|
+
let n = p.length ? { ..._ } : { ..._, pointerEvents: "none" };
|
|
388
|
+
return T.createElement("div", { tabIndex: -1, className: I(m), "data-stacked": a, style: n, key: `c-${m}` }, p.map(({ content: i, props: c }) => T.createElement(Ut, { ...c, stacked: a, collapseAll: v, isIn: d(c.toastId, c.containerId), key: `t-${c.key}` }, i)));
|
|
389
|
+
}));
|
|
390
|
+
}
|
|
391
|
+
export {
|
|
392
|
+
Qt as L,
|
|
393
|
+
g as y
|
|
394
|
+
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useFinalizarSesion as
|
|
3
|
-
import { y as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsxs as t, Fragment as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useFinalizarSesion as n } from "../../../auth/hooks/useFinalizarSesion.js";
|
|
3
|
+
import { y as s } from "../../../index-DDjnZyBf.js";
|
|
4
|
+
import { L as m } from "../../../index-Cs6Q8pv4.js";
|
|
5
|
+
import '../../../assets/LogoutButton.css';const p = () => {
|
|
6
|
+
const { FinSesion: r } = n();
|
|
7
|
+
return /* @__PURE__ */ t(i, { children: [
|
|
8
|
+
/* @__PURE__ */ o(m, {}),
|
|
9
|
+
/* @__PURE__ */ o(s, { className: "icono-logout", onClick: r })
|
|
10
|
+
] });
|
|
7
11
|
};
|
|
8
12
|
export {
|
|
9
|
-
|
|
13
|
+
p as LogoutButton
|
|
10
14
|
};
|
|
@@ -25,50 +25,50 @@ import "../../ui/subtitulo/Subtitulo.js";
|
|
|
25
25
|
import "../../index-BrykDZgK.js";
|
|
26
26
|
/* empty css */
|
|
27
27
|
import "../../Animacion-ThNL9iiY.js";
|
|
28
|
-
import "../../index-
|
|
29
|
-
import { useWebSocketConnection as
|
|
28
|
+
import { L as V } from "../../index-Cs6Q8pv4.js";
|
|
29
|
+
import { useWebSocketConnection as A } from "../../utils/websocket-manager/WebSocketContext.js";
|
|
30
30
|
import { G as i } from "../../iconBase-LROS5hdG.js";
|
|
31
|
-
function
|
|
31
|
+
function y(t) {
|
|
32
32
|
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: [] }] })(t);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function E(t) {
|
|
35
35
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19 2H6c-1.206 0-3 .799-3 3v14c0 2.201 1.794 3 3 3h15v-2H6.012C5.55 19.988 5 19.806 5 19s.55-.988 1.012-1H21V4c0-1.103-.897-2-2-2zm0 14H5V5c0-.806.55-.988 1-1h13v12z" }, child: [] }] })(t);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function T(t) {
|
|
38
38
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M20 4H4c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V6c0-1.103-.897-2-2-2zm0 2v.511l-8 6.223-8-6.222V6h16zM4 18V9.044l7.386 5.745a.994.994 0 0 0 1.228 0L20 9.044 20.002 18H4z" }, child: [] }] })(t);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function I(t) {
|
|
41
41
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z" }, child: [] }, { tag: "path", attr: { d: "M11 7h2v7h-2zm0 8h2v2h-2z" }, child: [] }] })(t);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function P(t) {
|
|
44
44
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19.903 8.586a.997.997 0 0 0-.196-.293l-6-6a.997.997 0 0 0-.293-.196c-.03-.014-.062-.022-.094-.033a.991.991 0 0 0-.259-.051C13.04 2.011 13.021 2 13 2H6c-1.103 0-2 .897-2 2v16c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V9c0-.021-.011-.04-.013-.062a.952.952 0 0 0-.051-.259c-.01-.032-.019-.063-.033-.093zM16.586 8H14V5.414L16.586 8zM6 20V4h6v5a1 1 0 0 0 1 1h5l.002 10H6z" }, child: [] }, { tag: "path", attr: { d: "M8 12h8v2H8zm0 4h8v2H8zm0-8h2v2H8z" }, child: [] }] })(t);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function j(t) {
|
|
47
47
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 0 0 .707-1.707l-9-9a.999.999 0 0 0-1.414 0l-9 9A1 1 0 0 0 3 13zm7 7v-5h4v5h-4zm2-15.586 6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z" }, child: [] }] })(t);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function U(t) {
|
|
50
50
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4.222 19.778a4.983 4.983 0 0 0 3.535 1.462 4.986 4.986 0 0 0 3.536-1.462l2.828-2.829-1.414-1.414-2.828 2.829a3.007 3.007 0 0 1-4.243 0 3.005 3.005 0 0 1 0-4.243l2.829-2.828-1.414-1.414-2.829 2.828a5.006 5.006 0 0 0 0 7.071zm15.556-8.485a5.008 5.008 0 0 0 0-7.071 5.006 5.006 0 0 0-7.071 0L9.879 7.051l1.414 1.414 2.828-2.829a3.007 3.007 0 0 1 4.243 0 3.005 3.005 0 0 1 0 4.243l-2.829 2.828 1.414 1.414 2.829-2.828z" }, child: [] }, { tag: "path", attr: { d: "m8.464 16.95-1.415-1.414 8.487-8.486 1.414 1.415z" }, child: [] }] })(t);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function F(t) {
|
|
53
53
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M16 13v-2H7V8l-5 4 5 4v-3z" }, child: [] }, { tag: "path", attr: { d: "M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z" }, child: [] }] })(t);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function R(t) {
|
|
56
56
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "m12 17 1-2V9.858c1.721-.447 3-2 3-3.858 0-2.206-1.794-4-4-4S8 3.794 8 6c0 1.858 1.279 3.411 3 3.858V15l1 2zM10 6c0-1.103.897-2 2-2s2 .897 2 2-.897 2-2 2-2-.897-2-2z" }, child: [] }, { tag: "path", attr: { d: "m16.267 10.563-.533 1.928C18.325 13.207 20 14.584 20 16c0 1.892-3.285 4-8 4s-8-2.108-8-4c0-1.416 1.675-2.793 4.267-3.51l-.533-1.928C4.197 11.54 2 13.623 2 16c0 3.364 4.393 6 10 6s10-2.636 10-6c0-2.377-2.197-4.46-5.733-5.437z" }, child: [] }] })(t);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function $(t) {
|
|
59
59
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h16v2H4zm4 5h12v2H8zm5 5h7v2h-7z" }, child: [] }] })(t);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function D(t) {
|
|
62
62
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, child: [] }] })(t);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function G(t) {
|
|
65
65
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M15.661 15.549a1.315 1.315 0 0 0 1.185-1.386 1.363 1.363 0 0 0-1.35-1.302h-.048a1.352 1.352 0 0 0-1.303 1.397c.024.379.179.687.391.911-.827 1.609-2.07 2.794-3.954 3.788-1.266.663-2.604.912-3.905.734-1.089-.153-1.94-.64-2.463-1.421-.78-1.185-.852-2.462-.201-3.74a5.597 5.597 0 0 1 1.658-1.931 7.88 7.88 0 0 1-.331-1.218c-3.506 2.51-3.148 5.942-2.084 7.564.794 1.184 2.415 1.941 4.19 1.941.474 0 .972-.035 1.457-.154 3.077-.592 5.409-2.438 6.747-5.16l.011-.023z" }, child: [] }, { tag: "path", attr: { d: "M19.887 12.589c-1.834-2.154-4.533-3.337-7.611-3.337h-.403c-.2-.438-.661-.711-1.183-.711h-.036c-.744 0-1.325.64-1.301 1.385.023.71.627 1.302 1.35 1.302h.059a1.332 1.332 0 0 0 1.183-.828h.439c1.824 0 3.551.532 5.126 1.574 1.206.792 2.072 1.834 2.557 3.077.425 1.019.402 2.013-.035 2.843-.675 1.302-1.812 1.988-3.314 1.988-.947 0-1.871-.296-2.345-.509-.283.235-.758.626-1.102.863 1.042.473 2.096.746 3.113.746 2.309 0 4.023-1.302 4.676-2.557.709-1.422.651-3.813-1.161-5.859l-.012.023z" }, child: [] }, { tag: "path", attr: { d: "M7.647 15.975c.023.71.626 1.302 1.35 1.302h.048a1.334 1.334 0 0 0 1.302-1.397c0-.71-.616-1.301-1.338-1.301h-.048c-.048 0-.118 0-.178.022-.982-1.657-1.397-3.434-1.242-5.349.094-1.445.567-2.7 1.42-3.742.71-.888 2.048-1.326 2.96-1.35 2.556-.048 3.622 3.138 3.704 4.404l1.184.354C16.536 5.036 14.122 3 11.813 3 9.647 3 7.647 4.574 6.842 6.884c-1.102 3.077-.379 6.036.971 8.404-.118.154-.189.426-.166.687z" }, child: [] }] })(t);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function J(t) {
|
|
68
68
|
return i({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z" }, child: [] }] })(t);
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
const [x, N] = o(!0), [m, p] = o(null), f = l ? "sidebar-bar-panel open" : "sidebar-bar-panel", k = _(), { FinSesion: b } = H(), { connectionStatus: v } =
|
|
70
|
+
const w1 = ({ onToggle: t, isOpen: l, showConnectionStatus: u }) => {
|
|
71
|
+
const [x, N] = o(!0), [m, p] = o(null), f = l ? "sidebar-bar-panel open" : "sidebar-bar-panel", k = _(), { FinSesion: b } = H(), { connectionStatus: v } = A(), [w, c] = o(!1), [z, n] = o(""), h = `${window.location.host}`;
|
|
72
72
|
if (d(() => {
|
|
73
73
|
const r = localStorage.getItem("auth_state");
|
|
74
74
|
if (r) {
|
|
@@ -104,32 +104,32 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: u }) => {
|
|
|
104
104
|
),
|
|
105
105
|
/* @__PURE__ */ a("div", { className: "logo-name", children: "EI - UNP" }),
|
|
106
106
|
l ? /* @__PURE__ */ a(
|
|
107
|
-
|
|
107
|
+
$,
|
|
108
108
|
{
|
|
109
109
|
className: "bx bx-menu i",
|
|
110
110
|
id: "btn",
|
|
111
111
|
onClick: t
|
|
112
112
|
}
|
|
113
|
-
) : /* @__PURE__ */ a(
|
|
113
|
+
) : /* @__PURE__ */ a(D, { className: "bx bx-menu i", id: "btn", onClick: t })
|
|
114
114
|
] }),
|
|
115
115
|
/* @__PURE__ */ e("ul", { className: "nav-list-panel", children: [
|
|
116
116
|
/* @__PURE__ */ e("li", { children: [
|
|
117
117
|
/* @__PURE__ */ e("a", { href: "", children: [
|
|
118
|
-
/* @__PURE__ */ a(
|
|
118
|
+
/* @__PURE__ */ a(j, { className: "bx bx-home i2" }),
|
|
119
119
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Inicio" })
|
|
120
120
|
] }),
|
|
121
121
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Inicio" })
|
|
122
122
|
] }),
|
|
123
123
|
/* @__PURE__ */ e("li", { children: [
|
|
124
124
|
/* @__PURE__ */ e("a", { href: "", children: [
|
|
125
|
-
/* @__PURE__ */ a(
|
|
125
|
+
/* @__PURE__ */ a(R, { className: "bx bx-map-pin i2" }),
|
|
126
126
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Mapa del proceso" })
|
|
127
127
|
] }),
|
|
128
128
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Mapa del proceso" })
|
|
129
129
|
] }),
|
|
130
130
|
/* @__PURE__ */ e("li", { children: [
|
|
131
131
|
/* @__PURE__ */ e("a", { href: "", children: [
|
|
132
|
-
/* @__PURE__ */ a(
|
|
132
|
+
/* @__PURE__ */ a(E, { className: "bx bx-book-alt i2" }),
|
|
133
133
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Manuales de usuario" })
|
|
134
134
|
] }),
|
|
135
135
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Manual de usuario" })
|
|
@@ -137,7 +137,7 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: u }) => {
|
|
|
137
137
|
/* @__PURE__ */ a("div", { style: { paddingLeft: "15px", paddingRight: "15px" }, children: /* @__PURE__ */ a("hr", { style: { borderTop: "1px solid white" } }) }),
|
|
138
138
|
/* @__PURE__ */ e("li", { children: [
|
|
139
139
|
/* @__PURE__ */ e("a", { href: "https://www.unp.gov.co/", target: "_blank", children: [
|
|
140
|
-
/* @__PURE__ */ a(
|
|
140
|
+
/* @__PURE__ */ a(U, { className: "bx bx-link-alt i2" }),
|
|
141
141
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Portal UNP" })
|
|
142
142
|
] }),
|
|
143
143
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Portal UNP" })
|
|
@@ -149,7 +149,7 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: u }) => {
|
|
|
149
149
|
href: "https://login.microsoftonline.com/common/oauth2/authorize?client_id=00000002-0000-0ff1-ce00-000000000000",
|
|
150
150
|
target: "_blank",
|
|
151
151
|
children: [
|
|
152
|
-
/* @__PURE__ */ a(
|
|
152
|
+
/* @__PURE__ */ a(T, { className: "bx bx-envelope i2" }),
|
|
153
153
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Correo institucional" })
|
|
154
154
|
]
|
|
155
155
|
}
|
|
@@ -158,14 +158,14 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: u }) => {
|
|
|
158
158
|
] }),
|
|
159
159
|
/* @__PURE__ */ e("li", { children: [
|
|
160
160
|
/* @__PURE__ */ e("a", { href: "http://intranet.unp.gov.co/", target: "_blank", children: [
|
|
161
|
-
/* @__PURE__ */ a(
|
|
161
|
+
/* @__PURE__ */ a(G, { className: "bx bxl-redux i2" }),
|
|
162
162
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Acceso directo a Intranet" })
|
|
163
163
|
] }),
|
|
164
164
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Acceso directo a Intranet" })
|
|
165
165
|
] }),
|
|
166
166
|
/* @__PURE__ */ e("li", { children: [
|
|
167
167
|
/* @__PURE__ */ e("a", { href: "https://mesadeservicios.unp.gov.co/HEAT/", target: "_blank", children: [
|
|
168
|
-
/* @__PURE__ */ a(
|
|
168
|
+
/* @__PURE__ */ a(I, { className: "bx bx-error-circle i2" }),
|
|
169
169
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Mesa de servicios" })
|
|
170
170
|
] }),
|
|
171
171
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Mesa de servicios" })
|
|
@@ -173,21 +173,21 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: u }) => {
|
|
|
173
173
|
/* @__PURE__ */ a("div", { style: { paddingLeft: "15px", paddingRight: "15px" }, children: /* @__PURE__ */ a("hr", { style: { borderTop: "1px solid white" } }) }),
|
|
174
174
|
/* @__PURE__ */ e("li", { children: [
|
|
175
175
|
/* @__PURE__ */ e("a", { href: "", children: [
|
|
176
|
-
/* @__PURE__ */ a(
|
|
176
|
+
/* @__PURE__ */ a(y, { className: "bx i2" }),
|
|
177
177
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Acta de reunión" })
|
|
178
178
|
] }),
|
|
179
179
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Acta de reunión" })
|
|
180
180
|
] }),
|
|
181
181
|
/* @__PURE__ */ e("li", { children: [
|
|
182
182
|
/* @__PURE__ */ e("a", { href: "", children: [
|
|
183
|
-
/* @__PURE__ */ a(
|
|
183
|
+
/* @__PURE__ */ a(J, { className: "bx i2" }),
|
|
184
184
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Solicitud de viáticos" })
|
|
185
185
|
] }),
|
|
186
186
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Solicitud de viáticos" })
|
|
187
187
|
] }),
|
|
188
188
|
/* @__PURE__ */ e("li", { children: [
|
|
189
189
|
/* @__PURE__ */ e("a", { href: `${C}${L}`, target: "_blank", children: [
|
|
190
|
-
/* @__PURE__ */ a(
|
|
190
|
+
/* @__PURE__ */ a(P, { className: "bx i2" }),
|
|
191
191
|
/* @__PURE__ */ a("span", { className: "link_name", children: "Certificados contratistas" })
|
|
192
192
|
] }),
|
|
193
193
|
/* @__PURE__ */ a("span", { className: "tooltip", children: "Certificados contratistas" })
|
|
@@ -298,11 +298,12 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: u }) => {
|
|
|
298
298
|
] })
|
|
299
299
|
}
|
|
300
300
|
),
|
|
301
|
-
/* @__PURE__ */ a(
|
|
301
|
+
/* @__PURE__ */ a(V, {}),
|
|
302
|
+
/* @__PURE__ */ a(F, { className: "icon", onClick: b })
|
|
302
303
|
] })
|
|
303
304
|
] })
|
|
304
305
|
] }) });
|
|
305
306
|
};
|
|
306
307
|
export {
|
|
307
|
-
|
|
308
|
+
w1 as MenuLateral
|
|
308
309
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useLocation as
|
|
4
|
-
import
|
|
1
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useEffect as _ } from "react";
|
|
3
|
+
import { useLocation as v, Outlet as I } from "react-router-dom";
|
|
4
|
+
import p from "../fingerprint/fingerprintService.js";
|
|
5
5
|
const E = () => {
|
|
6
|
-
const [
|
|
7
|
-
const m = await
|
|
6
|
+
const [u, o] = w(!1), k = v(), a = `${window.location.protocol}//${window.location.host}/`, l = `${window.location.host}`, g = async () => {
|
|
7
|
+
const m = await p.getFingerprint(), h = localStorage.getItem("refresh_token"), r = await fetch(`${a}api-auth/auth/refresh_token/`, {
|
|
8
8
|
method: "POST",
|
|
9
9
|
headers: {
|
|
10
10
|
"Content-Type": "application/json",
|
|
@@ -16,26 +16,26 @@ const E = () => {
|
|
|
16
16
|
refresh: h
|
|
17
17
|
})
|
|
18
18
|
});
|
|
19
|
-
if (
|
|
20
|
-
const n = await
|
|
21
|
-
return localStorage.setItem("access_token", i), localStorage.setItem("refresh_token",
|
|
19
|
+
if (r.ok) {
|
|
20
|
+
const n = await r.json(), i = n.access_token, s = n.refresh_token;
|
|
21
|
+
return localStorage.setItem("access_token", i), localStorage.setItem("refresh_token", s), !0;
|
|
22
22
|
} else
|
|
23
23
|
throw new Error("Error al refrescar token de Microsoft");
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return _(() => {
|
|
26
26
|
const m = async () => {
|
|
27
27
|
try {
|
|
28
28
|
if (localStorage.getItem("access_token")) {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const i = JSON.parse(
|
|
29
|
+
const r = localStorage.getItem("auth_state");
|
|
30
|
+
if (r) {
|
|
31
|
+
const i = JSON.parse(r).user.servicios.map((e) => e.url).filter((e) => !!e), s = k.pathname, c = i.map(
|
|
32
32
|
(e) => e.startsWith("/") ? e : `/${e}`
|
|
33
|
-
), f =
|
|
33
|
+
), f = s.startsWith("/") ? s : `/${s}`;
|
|
34
34
|
c.some(
|
|
35
35
|
(e) => f.startsWith(e)
|
|
36
|
-
) ? o(!0) : (console.warn("No hay match con los roles del usuario"), o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a);
|
|
36
|
+
) ? o(!0) : (console.warn("No hay match con los roles del usuario"), o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), window.location.href = a);
|
|
37
37
|
} else
|
|
38
|
-
o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a;
|
|
38
|
+
o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), window.location.href = a;
|
|
39
39
|
} else
|
|
40
40
|
throw new Error("Token inválido");
|
|
41
41
|
} catch {
|
|
@@ -43,23 +43,23 @@ const E = () => {
|
|
|
43
43
|
if (await g()) {
|
|
44
44
|
const n = localStorage.getItem("auth_state");
|
|
45
45
|
if (n) {
|
|
46
|
-
const
|
|
46
|
+
const s = JSON.parse(n).user.servicios.map((t) => t.url).filter((t) => !!t), c = k.pathname, f = s.map(
|
|
47
47
|
(t) => t.startsWith("/") ? t : `/${t}`
|
|
48
|
-
),
|
|
48
|
+
), d = c.startsWith("/") ? c : `/${c}`;
|
|
49
49
|
f.some(
|
|
50
|
-
(t) =>
|
|
51
|
-
) ? o(!0) : (o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a);
|
|
50
|
+
(t) => d.startsWith(t)
|
|
51
|
+
) ? o(!0) : (o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), window.location.href = a);
|
|
52
52
|
} else
|
|
53
|
-
o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a;
|
|
53
|
+
o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), window.location.href = a;
|
|
54
54
|
} else
|
|
55
55
|
throw new Error("No se pudo refrescar el token.");
|
|
56
56
|
} catch {
|
|
57
|
-
sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a, o(!1);
|
|
57
|
+
sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), window.location.href = a, o(!1);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
l.includes("ecosistemadesarrollo") || l.includes("ecosistemapruebas") || l.includes("ecosistemaprov") || l.includes("ecosistema") ? m() : (console.warn("ProtectedRoute is disabled in the local development environment."), o(!0));
|
|
62
|
-
}, []),
|
|
62
|
+
}, []), u ? /* @__PURE__ */ S(I, {}) : null;
|
|
63
63
|
};
|
|
64
64
|
export {
|
|
65
65
|
E as ProtectedRoute
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d, useEffect as u } from "react";
|
|
3
|
-
import { useNavigate as
|
|
4
|
-
import
|
|
3
|
+
import { useNavigate as k, Outlet as g } from "react-router-dom";
|
|
4
|
+
import w from "../fingerprint/fingerprintService.js";
|
|
5
5
|
const I = () => {
|
|
6
|
-
const [c, e] = d(!1),
|
|
6
|
+
const [c, e] = d(!1), l = k(), t = `${window.location.protocol}//${window.location.host}/`, a = `${window.location.host}`;
|
|
7
7
|
if (a.includes("localhost"))
|
|
8
8
|
return console.warn("ProtectedRoute is disabled in the local development environment."), null;
|
|
9
|
-
const
|
|
10
|
-
const r = await
|
|
9
|
+
const i = async () => {
|
|
10
|
+
const r = await w.getFingerprint(), n = localStorage.getItem("refresh_token"), o = await fetch(`${t}api-auth/auth/refresh_token/`, {
|
|
11
11
|
method: "POST",
|
|
12
12
|
headers: {
|
|
13
13
|
"Content-Type": "application/json",
|
|
@@ -19,8 +19,8 @@ const I = () => {
|
|
|
19
19
|
})
|
|
20
20
|
});
|
|
21
21
|
if (o.ok) {
|
|
22
|
-
const s = await o.json(),
|
|
23
|
-
return localStorage.setItem("access_token",
|
|
22
|
+
const s = await o.json(), m = s.access_token, f = s.refresh_token;
|
|
23
|
+
return localStorage.setItem("access_token", m), localStorage.setItem("refresh_token", f), !0;
|
|
24
24
|
} else
|
|
25
25
|
throw new Error("Error al refrescar token de Microsoft");
|
|
26
26
|
};
|
|
@@ -31,7 +31,7 @@ const I = () => {
|
|
|
31
31
|
e(!0);
|
|
32
32
|
else
|
|
33
33
|
try {
|
|
34
|
-
if (await
|
|
34
|
+
if (await i())
|
|
35
35
|
(await fetch(
|
|
36
36
|
`${t}api-auth/auth/validate_jwt/`,
|
|
37
37
|
{
|
|
@@ -41,18 +41,18 @@ const I = () => {
|
|
|
41
41
|
},
|
|
42
42
|
credentials: "include"
|
|
43
43
|
}
|
|
44
|
-
)).ok ? e(!0) : (sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = t, e(!1));
|
|
44
|
+
)).ok ? e(!0) : (sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), window.location.href = t, e(!1));
|
|
45
45
|
else
|
|
46
46
|
throw new Error("No se pudo refrescar el token.");
|
|
47
47
|
} catch {
|
|
48
|
-
sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = t, e(!1);
|
|
48
|
+
sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), window.location.href = t, e(!1);
|
|
49
49
|
}
|
|
50
50
|
} catch {
|
|
51
|
-
sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = t, e(!1);
|
|
51
|
+
sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), window.location.href = t, e(!1);
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
a.includes("localhost") ? (console.warn("ProtectedRoute is disabled in the local development environment."), e(!0)) : r();
|
|
55
|
-
}, [
|
|
55
|
+
}, [l]), c ? /* @__PURE__ */ h(g, {}) : null;
|
|
56
56
|
};
|
|
57
57
|
export {
|
|
58
58
|
I as UserRoute
|
|
@@ -22,7 +22,7 @@ import "../../ui/subtitulo/Subtitulo.js";
|
|
|
22
22
|
import "../../index-BrykDZgK.js";
|
|
23
23
|
/* empty css */
|
|
24
24
|
import "../../Animacion-ThNL9iiY.js";
|
|
25
|
-
import "../../index-
|
|
25
|
+
import "../../index-Cs6Q8pv4.js";
|
|
26
26
|
import { WebSocketProvider as i } from "../websocket-manager/WebSocketContext.js";
|
|
27
27
|
const z = ({ children: o }) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(i, { children: o }) });
|
|
28
28
|
export {
|
package/package.json
CHANGED
package/dist/index-BUe3EJDH.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { isValidElement as O } from "react";
|
|
2
|
-
function C(t) {
|
|
3
|
-
if (typeof document > "u") return;
|
|
4
|
-
let o = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
|
|
5
|
-
a.type = "text/css", o.firstChild ? o.insertBefore(a, o.firstChild) : o.appendChild(a), a.styleSheet ? a.styleSheet.cssText = t : a.appendChild(document.createTextNode(t));
|
|
6
|
-
}
|
|
7
|
-
C(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
8
|
-
`);
|
|
9
|
-
var g = (t) => typeof t == "number" && !isNaN(t), l = (t) => typeof t == "string", k = (t) => typeof t == "function", L = (t) => l(t) || g(t), X = (t) => O(t) || l(t) || k(t) || g(t), E = 1, w = () => `${E++}`, s = /* @__PURE__ */ new Map(), u = [], x = /* @__PURE__ */ new Set(), I = () => s.size > 0, U = (t, { containerId: o }) => {
|
|
10
|
-
var a;
|
|
11
|
-
return (a = s.get(o || 1)) == null ? void 0 : a.toasts.get(t);
|
|
12
|
-
};
|
|
13
|
-
function D(t, o) {
|
|
14
|
-
var a;
|
|
15
|
-
if (o) return !!((a = s.get(o)) != null && a.isToastActive(t));
|
|
16
|
-
let n = !1;
|
|
17
|
-
return s.forEach((e) => {
|
|
18
|
-
e.isToastActive(t) && (n = !0);
|
|
19
|
-
}), n;
|
|
20
|
-
}
|
|
21
|
-
function R(t) {
|
|
22
|
-
if (!I()) {
|
|
23
|
-
u = u.filter((o) => t != null && o.options.toastId !== t);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (t == null || L(t)) s.forEach((o) => {
|
|
27
|
-
o.removeToast(t);
|
|
28
|
-
});
|
|
29
|
-
else if (t && ("containerId" in t || "id" in t)) {
|
|
30
|
-
let o = s.get(t.containerId);
|
|
31
|
-
o ? o.removeToast(t.id) : s.forEach((a) => {
|
|
32
|
-
a.removeToast(t.id);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
var N = (t = {}) => {
|
|
37
|
-
s.forEach((o) => {
|
|
38
|
-
o.props.limit && (!t.containerId || o.id === t.containerId) && o.clearQueue();
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
function B(t, o) {
|
|
42
|
-
X(t) && (I() || u.push({ content: t, options: o }), s.forEach((a) => {
|
|
43
|
-
a.buildToast(t, o);
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
function z(t, o) {
|
|
47
|
-
s.forEach((a) => {
|
|
48
|
-
(o == null || !(o != null && o.containerId) || (o == null ? void 0 : o.containerId) === a.id) && a.toggle(t, o == null ? void 0 : o.id);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function P(t) {
|
|
52
|
-
return x.add(t), () => {
|
|
53
|
-
x.delete(t);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function A(t) {
|
|
57
|
-
return t && (l(t.toastId) || g(t.toastId)) ? t.toastId : w();
|
|
58
|
-
}
|
|
59
|
-
function c(t, o) {
|
|
60
|
-
return B(t, o), o.toastId;
|
|
61
|
-
}
|
|
62
|
-
function d(t, o) {
|
|
63
|
-
return { ...o, type: o && o.type || t, toastId: A(o) };
|
|
64
|
-
}
|
|
65
|
-
function _(t) {
|
|
66
|
-
return (o, a) => c(o, d(t, a));
|
|
67
|
-
}
|
|
68
|
-
function r(t, o) {
|
|
69
|
-
return c(t, d("default", o));
|
|
70
|
-
}
|
|
71
|
-
r.loading = (t, o) => c(t, d("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...o }));
|
|
72
|
-
function Q(t, { pending: o, error: a, success: n }, e) {
|
|
73
|
-
let i;
|
|
74
|
-
o && (i = l(o) ? r.loading(o, e) : r.loading(o.render, { ...e, ...o }));
|
|
75
|
-
let m = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, b = (f, y, h) => {
|
|
76
|
-
if (y == null) {
|
|
77
|
-
r.dismiss(i);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
let v = { type: f, ...m, ...e, data: h }, p = l(y) ? { render: y } : y;
|
|
81
|
-
return i ? r.update(i, { ...v, ...p }) : r(p.render, { ...v, ...p }), h;
|
|
82
|
-
}, T = k(t) ? t() : t;
|
|
83
|
-
return T.then((f) => b("success", n, f)).catch((f) => b("error", a, f)), T;
|
|
84
|
-
}
|
|
85
|
-
r.promise = Q;
|
|
86
|
-
r.success = _("success");
|
|
87
|
-
r.info = _("info");
|
|
88
|
-
r.error = _("error");
|
|
89
|
-
r.warning = _("warning");
|
|
90
|
-
r.warn = r.warning;
|
|
91
|
-
r.dark = (t, o) => c(t, d("default", { theme: "dark", ...o }));
|
|
92
|
-
function S(t) {
|
|
93
|
-
R(t);
|
|
94
|
-
}
|
|
95
|
-
r.dismiss = S;
|
|
96
|
-
r.clearWaitingQueue = N;
|
|
97
|
-
r.isActive = D;
|
|
98
|
-
r.update = (t, o = {}) => {
|
|
99
|
-
let a = U(t, o);
|
|
100
|
-
if (a) {
|
|
101
|
-
let { props: n, content: e } = a, i = { delay: 100, ...n, ...o, toastId: o.toastId || t, updateId: w() };
|
|
102
|
-
i.toastId !== t && (i.staleId = t);
|
|
103
|
-
let m = i.render || e;
|
|
104
|
-
delete i.render, c(m, i);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
r.done = (t) => {
|
|
108
|
-
r.update(t, { progress: 1 });
|
|
109
|
-
};
|
|
110
|
-
r.onChange = P;
|
|
111
|
-
r.play = (t) => z(!0, t);
|
|
112
|
-
r.pause = (t) => z(!1, t);
|
|
113
|
-
export {
|
|
114
|
-
r as y
|
|
115
|
-
};
|