react-ecosistema-unp 0.1.0
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/README.md +50 -0
- package/dist/FinSesionHook-CqFXvTMK.js +1532 -0
- package/dist/assets/MenuLateral.css +1 -0
- package/dist/auth/contexts/AuthContex.js +22 -0
- package/dist/auth/hooks/AuthHook.js +11 -0
- package/dist/auth/hooks/FinSesionHook.js +6 -0
- package/dist/auth/services/FinSesionService.js +20 -0
- package/dist/auth/types/AuthTypes.js +1 -0
- package/dist/lib/auth/contexts/AuthContex.d.ts +8 -0
- package/dist/lib/auth/hooks/AuthHook.d.ts +2 -0
- package/dist/lib/auth/hooks/FinSesionHook.d.ts +3 -0
- package/dist/lib/auth/services/FinSesionService.d.ts +1 -0
- package/dist/lib/auth/types/AuthTypes.d.ts +6 -0
- package/dist/lib/main.d.ts +1 -0
- package/dist/lib/shared/components/MenuLateral.d.ts +7 -0
- package/dist/lib/utils/Url.d.ts +7 -0
- package/dist/main.js +4 -0
- package/dist/shared/components/MenuLateral.js +353 -0
- package/dist/utils/Url.js +10 -0
- package/package.json +56 -0
|
@@ -0,0 +1,1532 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { isValidElement as Fe } from "react";
|
|
3
|
+
import { useAuthId as ze } from "./auth/hooks/AuthHook.js";
|
|
4
|
+
import { FinSesionService as Ae } from "./auth/services/FinSesionService.js";
|
|
5
|
+
var A = {}, ce;
|
|
6
|
+
function Me() {
|
|
7
|
+
if (ce) return A;
|
|
8
|
+
ce = 1, Object.defineProperty(A, "__esModule", { value: !0 }), A.parse = u, A.serialize = i;
|
|
9
|
+
const e = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, t = /^[\u0021-\u003A\u003C-\u007E]*$/, a = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, o = /^[\u0020-\u003A\u003D-\u007E]*$/, r = Object.prototype.toString, n = /* @__PURE__ */ (() => {
|
|
10
|
+
const c = function() {
|
|
11
|
+
};
|
|
12
|
+
return c.prototype = /* @__PURE__ */ Object.create(null), c;
|
|
13
|
+
})();
|
|
14
|
+
function u(c, h) {
|
|
15
|
+
const d = new n(), v = c.length;
|
|
16
|
+
if (v < 2)
|
|
17
|
+
return d;
|
|
18
|
+
const _ = (h == null ? void 0 : h.decode) || m;
|
|
19
|
+
let y = 0;
|
|
20
|
+
do {
|
|
21
|
+
const g = c.indexOf("=", y);
|
|
22
|
+
if (g === -1)
|
|
23
|
+
break;
|
|
24
|
+
const b = c.indexOf(";", y), T = b === -1 ? v : b;
|
|
25
|
+
if (g > T) {
|
|
26
|
+
y = c.lastIndexOf(";", g - 1) + 1;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const C = f(c, y, g), F = s(c, g, C), L = c.slice(C, F);
|
|
30
|
+
if (d[L] === void 0) {
|
|
31
|
+
let O = f(c, g + 1, T), k = s(c, T, O);
|
|
32
|
+
const $ = _(c.slice(O, k));
|
|
33
|
+
d[L] = $;
|
|
34
|
+
}
|
|
35
|
+
y = T + 1;
|
|
36
|
+
} while (y < v);
|
|
37
|
+
return d;
|
|
38
|
+
}
|
|
39
|
+
function f(c, h, d) {
|
|
40
|
+
do {
|
|
41
|
+
const v = c.charCodeAt(h);
|
|
42
|
+
if (v !== 32 && v !== 9)
|
|
43
|
+
return h;
|
|
44
|
+
} while (++h < d);
|
|
45
|
+
return d;
|
|
46
|
+
}
|
|
47
|
+
function s(c, h, d) {
|
|
48
|
+
for (; h > d; ) {
|
|
49
|
+
const v = c.charCodeAt(--h);
|
|
50
|
+
if (v !== 32 && v !== 9)
|
|
51
|
+
return h + 1;
|
|
52
|
+
}
|
|
53
|
+
return d;
|
|
54
|
+
}
|
|
55
|
+
function i(c, h, d) {
|
|
56
|
+
const v = (d == null ? void 0 : d.encode) || encodeURIComponent;
|
|
57
|
+
if (!e.test(c))
|
|
58
|
+
throw new TypeError(`argument name is invalid: ${c}`);
|
|
59
|
+
const _ = v(h);
|
|
60
|
+
if (!t.test(_))
|
|
61
|
+
throw new TypeError(`argument val is invalid: ${h}`);
|
|
62
|
+
let y = c + "=" + _;
|
|
63
|
+
if (!d)
|
|
64
|
+
return y;
|
|
65
|
+
if (d.maxAge !== void 0) {
|
|
66
|
+
if (!Number.isInteger(d.maxAge))
|
|
67
|
+
throw new TypeError(`option maxAge is invalid: ${d.maxAge}`);
|
|
68
|
+
y += "; Max-Age=" + d.maxAge;
|
|
69
|
+
}
|
|
70
|
+
if (d.domain) {
|
|
71
|
+
if (!a.test(d.domain))
|
|
72
|
+
throw new TypeError(`option domain is invalid: ${d.domain}`);
|
|
73
|
+
y += "; Domain=" + d.domain;
|
|
74
|
+
}
|
|
75
|
+
if (d.path) {
|
|
76
|
+
if (!o.test(d.path))
|
|
77
|
+
throw new TypeError(`option path is invalid: ${d.path}`);
|
|
78
|
+
y += "; Path=" + d.path;
|
|
79
|
+
}
|
|
80
|
+
if (d.expires) {
|
|
81
|
+
if (!p(d.expires) || !Number.isFinite(d.expires.valueOf()))
|
|
82
|
+
throw new TypeError(`option expires is invalid: ${d.expires}`);
|
|
83
|
+
y += "; Expires=" + d.expires.toUTCString();
|
|
84
|
+
}
|
|
85
|
+
if (d.httpOnly && (y += "; HttpOnly"), d.secure && (y += "; Secure"), d.partitioned && (y += "; Partitioned"), d.priority)
|
|
86
|
+
switch (typeof d.priority == "string" ? d.priority.toLowerCase() : void 0) {
|
|
87
|
+
case "low":
|
|
88
|
+
y += "; Priority=Low";
|
|
89
|
+
break;
|
|
90
|
+
case "medium":
|
|
91
|
+
y += "; Priority=Medium";
|
|
92
|
+
break;
|
|
93
|
+
case "high":
|
|
94
|
+
y += "; Priority=High";
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
throw new TypeError(`option priority is invalid: ${d.priority}`);
|
|
98
|
+
}
|
|
99
|
+
if (d.sameSite)
|
|
100
|
+
switch (typeof d.sameSite == "string" ? d.sameSite.toLowerCase() : d.sameSite) {
|
|
101
|
+
case !0:
|
|
102
|
+
case "strict":
|
|
103
|
+
y += "; SameSite=Strict";
|
|
104
|
+
break;
|
|
105
|
+
case "lax":
|
|
106
|
+
y += "; SameSite=Lax";
|
|
107
|
+
break;
|
|
108
|
+
case "none":
|
|
109
|
+
y += "; SameSite=None";
|
|
110
|
+
break;
|
|
111
|
+
default:
|
|
112
|
+
throw new TypeError(`option sameSite is invalid: ${d.sameSite}`);
|
|
113
|
+
}
|
|
114
|
+
return y;
|
|
115
|
+
}
|
|
116
|
+
function m(c) {
|
|
117
|
+
if (c.indexOf("%") === -1)
|
|
118
|
+
return c;
|
|
119
|
+
try {
|
|
120
|
+
return decodeURIComponent(c);
|
|
121
|
+
} catch {
|
|
122
|
+
return c;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function p(c) {
|
|
126
|
+
return r.call(c) === "[object Date]";
|
|
127
|
+
}
|
|
128
|
+
return A;
|
|
129
|
+
}
|
|
130
|
+
Me();
|
|
131
|
+
/**
|
|
132
|
+
* react-router v7.1.5
|
|
133
|
+
*
|
|
134
|
+
* Copyright (c) Remix Software Inc.
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the MIT license found in the
|
|
137
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
138
|
+
*
|
|
139
|
+
* @license MIT
|
|
140
|
+
*/
|
|
141
|
+
function w(e, t) {
|
|
142
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
143
|
+
throw new Error(t);
|
|
144
|
+
}
|
|
145
|
+
function S(e, t) {
|
|
146
|
+
if (!e) {
|
|
147
|
+
typeof console < "u" && console.warn(t);
|
|
148
|
+
try {
|
|
149
|
+
throw new Error(t);
|
|
150
|
+
} catch {
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function ee({
|
|
155
|
+
pathname: e = "/",
|
|
156
|
+
search: t = "",
|
|
157
|
+
hash: a = ""
|
|
158
|
+
}) {
|
|
159
|
+
return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), a && a !== "#" && (e += a.charAt(0) === "#" ? a : "#" + a), e;
|
|
160
|
+
}
|
|
161
|
+
function ae(e) {
|
|
162
|
+
let t = {};
|
|
163
|
+
if (e) {
|
|
164
|
+
let a = e.indexOf("#");
|
|
165
|
+
a >= 0 && (t.hash = e.substring(a), e = e.substring(0, a));
|
|
166
|
+
let o = e.indexOf("?");
|
|
167
|
+
o >= 0 && (t.search = e.substring(o), e = e.substring(0, o)), e && (t.pathname = e);
|
|
168
|
+
}
|
|
169
|
+
return t;
|
|
170
|
+
}
|
|
171
|
+
function ye(e, t, a = "/") {
|
|
172
|
+
return Ue(e, t, a, !1);
|
|
173
|
+
}
|
|
174
|
+
function Ue(e, t, a, o) {
|
|
175
|
+
let r = typeof t == "string" ? ae(t) : t, n = D(r.pathname || "/", a);
|
|
176
|
+
if (n == null)
|
|
177
|
+
return null;
|
|
178
|
+
let u = ge(e);
|
|
179
|
+
Be(u);
|
|
180
|
+
let f = null;
|
|
181
|
+
for (let s = 0; f == null && s < u.length; ++s) {
|
|
182
|
+
let i = Qe(n);
|
|
183
|
+
f = Ye(
|
|
184
|
+
u[s],
|
|
185
|
+
i,
|
|
186
|
+
o
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return f;
|
|
190
|
+
}
|
|
191
|
+
function ge(e, t = [], a = [], o = "") {
|
|
192
|
+
let r = (n, u, f) => {
|
|
193
|
+
let s = {
|
|
194
|
+
relativePath: f === void 0 ? n.path || "" : f,
|
|
195
|
+
caseSensitive: n.caseSensitive === !0,
|
|
196
|
+
childrenIndex: u,
|
|
197
|
+
route: n
|
|
198
|
+
};
|
|
199
|
+
s.relativePath.startsWith("/") && (w(
|
|
200
|
+
s.relativePath.startsWith(o),
|
|
201
|
+
`Absolute route path "${s.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
202
|
+
), s.relativePath = s.relativePath.slice(o.length));
|
|
203
|
+
let i = R([o, s.relativePath]), m = a.concat(s);
|
|
204
|
+
n.children && n.children.length > 0 && (w(
|
|
205
|
+
// Our types know better, but runtime JS may not!
|
|
206
|
+
// @ts-expect-error
|
|
207
|
+
n.index !== !0,
|
|
208
|
+
`Index routes must not have child routes. Please remove all child routes from route path "${i}".`
|
|
209
|
+
), ge(n.children, t, m, i)), !(n.path == null && !n.index) && t.push({
|
|
210
|
+
path: i,
|
|
211
|
+
score: Ke(i, n.index),
|
|
212
|
+
routesMeta: m
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
return e.forEach((n, u) => {
|
|
216
|
+
var f;
|
|
217
|
+
if (n.path === "" || !((f = n.path) != null && f.includes("?")))
|
|
218
|
+
r(n, u);
|
|
219
|
+
else
|
|
220
|
+
for (let s of _e(n.path))
|
|
221
|
+
r(n, u, s);
|
|
222
|
+
}), t;
|
|
223
|
+
}
|
|
224
|
+
function _e(e) {
|
|
225
|
+
let t = e.split("/");
|
|
226
|
+
if (t.length === 0) return [];
|
|
227
|
+
let [a, ...o] = t, r = a.endsWith("?"), n = a.replace(/\?$/, "");
|
|
228
|
+
if (o.length === 0)
|
|
229
|
+
return r ? [n, ""] : [n];
|
|
230
|
+
let u = _e(o.join("/")), f = [];
|
|
231
|
+
return f.push(
|
|
232
|
+
...u.map(
|
|
233
|
+
(s) => s === "" ? n : [n, s].join("/")
|
|
234
|
+
)
|
|
235
|
+
), r && f.push(...u), f.map(
|
|
236
|
+
(s) => e.startsWith("/") && s === "" ? "/" : s
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
function Be(e) {
|
|
240
|
+
e.sort(
|
|
241
|
+
(t, a) => t.score !== a.score ? a.score - t.score : qe(
|
|
242
|
+
t.routesMeta.map((o) => o.childrenIndex),
|
|
243
|
+
a.routesMeta.map((o) => o.childrenIndex)
|
|
244
|
+
)
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
var We = /^:[\w-]+$/, He = 3, Ve = 2, je = 1, Xe = 10, Je = -2, de = (e) => e === "*";
|
|
248
|
+
function Ke(e, t) {
|
|
249
|
+
let a = e.split("/"), o = a.length;
|
|
250
|
+
return a.some(de) && (o += Je), t && (o += Ve), a.filter((r) => !de(r)).reduce(
|
|
251
|
+
(r, n) => r + (We.test(n) ? He : n === "" ? je : Xe),
|
|
252
|
+
o
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
function qe(e, t) {
|
|
256
|
+
return e.length === t.length && e.slice(0, -1).every((o, r) => o === t[r]) ? (
|
|
257
|
+
// If two routes are siblings, we should try to match the earlier sibling
|
|
258
|
+
// first. This allows people to have fine-grained control over the matching
|
|
259
|
+
// behavior by simply putting routes with identical paths in the order they
|
|
260
|
+
// want them tried.
|
|
261
|
+
e[e.length - 1] - t[t.length - 1]
|
|
262
|
+
) : (
|
|
263
|
+
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
264
|
+
// so they sort equally.
|
|
265
|
+
0
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
function Ye(e, t, a = !1) {
|
|
269
|
+
let { routesMeta: o } = e, r = {}, n = "/", u = [];
|
|
270
|
+
for (let f = 0; f < o.length; ++f) {
|
|
271
|
+
let s = o[f], i = f === o.length - 1, m = n === "/" ? t : t.slice(n.length) || "/", p = X(
|
|
272
|
+
{ path: s.relativePath, caseSensitive: s.caseSensitive, end: i },
|
|
273
|
+
m
|
|
274
|
+
), c = s.route;
|
|
275
|
+
if (!p && i && a && !o[o.length - 1].route.index && (p = X(
|
|
276
|
+
{
|
|
277
|
+
path: s.relativePath,
|
|
278
|
+
caseSensitive: s.caseSensitive,
|
|
279
|
+
end: !1
|
|
280
|
+
},
|
|
281
|
+
m
|
|
282
|
+
)), !p)
|
|
283
|
+
return null;
|
|
284
|
+
Object.assign(r, p.params), u.push({
|
|
285
|
+
// TODO: Can this as be avoided?
|
|
286
|
+
params: r,
|
|
287
|
+
pathname: R([n, p.pathname]),
|
|
288
|
+
pathnameBase: at(
|
|
289
|
+
R([n, p.pathnameBase])
|
|
290
|
+
),
|
|
291
|
+
route: c
|
|
292
|
+
}), p.pathnameBase !== "/" && (n = R([n, p.pathnameBase]));
|
|
293
|
+
}
|
|
294
|
+
return u;
|
|
295
|
+
}
|
|
296
|
+
function X(e, t) {
|
|
297
|
+
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
298
|
+
let [a, o] = Ge(
|
|
299
|
+
e.path,
|
|
300
|
+
e.caseSensitive,
|
|
301
|
+
e.end
|
|
302
|
+
), r = t.match(a);
|
|
303
|
+
if (!r) return null;
|
|
304
|
+
let n = r[0], u = n.replace(/(.)\/+$/, "$1"), f = r.slice(1);
|
|
305
|
+
return {
|
|
306
|
+
params: o.reduce(
|
|
307
|
+
(i, { paramName: m, isOptional: p }, c) => {
|
|
308
|
+
if (m === "*") {
|
|
309
|
+
let d = f[c] || "";
|
|
310
|
+
u = n.slice(0, n.length - d.length).replace(/(.)\/+$/, "$1");
|
|
311
|
+
}
|
|
312
|
+
const h = f[c];
|
|
313
|
+
return p && !h ? i[m] = void 0 : i[m] = (h || "").replace(/%2F/g, "/"), i;
|
|
314
|
+
},
|
|
315
|
+
{}
|
|
316
|
+
),
|
|
317
|
+
pathname: n,
|
|
318
|
+
pathnameBase: u,
|
|
319
|
+
pattern: e
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function Ge(e, t = !1, a = !0) {
|
|
323
|
+
S(
|
|
324
|
+
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
325
|
+
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
326
|
+
);
|
|
327
|
+
let o = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
328
|
+
/\/:([\w-]+)(\?)?/g,
|
|
329
|
+
(u, f, s) => (o.push({ paramName: f, isOptional: s != null }), s ? "/?([^\\/]+)?" : "/([^\\/]+)")
|
|
330
|
+
);
|
|
331
|
+
return e.endsWith("*") ? (o.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : a ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, t ? void 0 : "i"), o];
|
|
332
|
+
}
|
|
333
|
+
function Qe(e) {
|
|
334
|
+
try {
|
|
335
|
+
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
336
|
+
} catch (t) {
|
|
337
|
+
return S(
|
|
338
|
+
!1,
|
|
339
|
+
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
|
|
340
|
+
), e;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function D(e, t) {
|
|
344
|
+
if (t === "/") return e;
|
|
345
|
+
if (!e.toLowerCase().startsWith(t.toLowerCase()))
|
|
346
|
+
return null;
|
|
347
|
+
let a = t.endsWith("/") ? t.length - 1 : t.length, o = e.charAt(a);
|
|
348
|
+
return o && o !== "/" ? null : e.slice(a) || "/";
|
|
349
|
+
}
|
|
350
|
+
function Ze(e, t = "/") {
|
|
351
|
+
let {
|
|
352
|
+
pathname: a,
|
|
353
|
+
search: o = "",
|
|
354
|
+
hash: r = ""
|
|
355
|
+
} = typeof e == "string" ? ae(e) : e;
|
|
356
|
+
return {
|
|
357
|
+
pathname: a ? a.startsWith("/") ? a : et(a, t) : t,
|
|
358
|
+
search: rt(o),
|
|
359
|
+
hash: nt(r)
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function et(e, t) {
|
|
363
|
+
let a = t.replace(/\/+$/, "").split("/");
|
|
364
|
+
return e.split("/").forEach((r) => {
|
|
365
|
+
r === ".." ? a.length > 1 && a.pop() : r !== "." && a.push(r);
|
|
366
|
+
}), a.length > 1 ? a.join("/") : "/";
|
|
367
|
+
}
|
|
368
|
+
function Q(e, t, a, o) {
|
|
369
|
+
return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
|
|
370
|
+
o
|
|
371
|
+
)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
372
|
+
}
|
|
373
|
+
function tt(e) {
|
|
374
|
+
return e.filter(
|
|
375
|
+
(t, a) => a === 0 || t.route.path && t.route.path.length > 0
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
function ve(e) {
|
|
379
|
+
let t = tt(e);
|
|
380
|
+
return t.map(
|
|
381
|
+
(a, o) => o === t.length - 1 ? a.pathname : a.pathnameBase
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
function be(e, t, a, o = !1) {
|
|
385
|
+
let r;
|
|
386
|
+
typeof e == "string" ? r = ae(e) : (r = { ...e }, w(
|
|
387
|
+
!r.pathname || !r.pathname.includes("?"),
|
|
388
|
+
Q("?", "pathname", "search", r)
|
|
389
|
+
), w(
|
|
390
|
+
!r.pathname || !r.pathname.includes("#"),
|
|
391
|
+
Q("#", "pathname", "hash", r)
|
|
392
|
+
), w(
|
|
393
|
+
!r.search || !r.search.includes("#"),
|
|
394
|
+
Q("#", "search", "hash", r)
|
|
395
|
+
));
|
|
396
|
+
let n = e === "" || r.pathname === "", u = n ? "/" : r.pathname, f;
|
|
397
|
+
if (u == null)
|
|
398
|
+
f = a;
|
|
399
|
+
else {
|
|
400
|
+
let p = t.length - 1;
|
|
401
|
+
if (!o && u.startsWith("..")) {
|
|
402
|
+
let c = u.split("/");
|
|
403
|
+
for (; c[0] === ".."; )
|
|
404
|
+
c.shift(), p -= 1;
|
|
405
|
+
r.pathname = c.join("/");
|
|
406
|
+
}
|
|
407
|
+
f = p >= 0 ? t[p] : "/";
|
|
408
|
+
}
|
|
409
|
+
let s = Ze(r, f), i = u && u !== "/" && u.endsWith("/"), m = (n || u === ".") && a.endsWith("/");
|
|
410
|
+
return !s.pathname.endsWith("/") && (i || m) && (s.pathname += "/"), s;
|
|
411
|
+
}
|
|
412
|
+
var R = (e) => e.join("/").replace(/\/\/+/g, "/"), at = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), rt = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, nt = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
413
|
+
function ot(e) {
|
|
414
|
+
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
415
|
+
}
|
|
416
|
+
var xe = [
|
|
417
|
+
"POST",
|
|
418
|
+
"PUT",
|
|
419
|
+
"PATCH",
|
|
420
|
+
"DELETE"
|
|
421
|
+
];
|
|
422
|
+
new Set(
|
|
423
|
+
xe
|
|
424
|
+
);
|
|
425
|
+
var it = [
|
|
426
|
+
"GET",
|
|
427
|
+
...xe
|
|
428
|
+
];
|
|
429
|
+
new Set(it);
|
|
430
|
+
var z = l.createContext(null);
|
|
431
|
+
z.displayName = "DataRouter";
|
|
432
|
+
var J = l.createContext(null);
|
|
433
|
+
J.displayName = "DataRouterState";
|
|
434
|
+
var we = l.createContext({
|
|
435
|
+
isTransitioning: !1
|
|
436
|
+
});
|
|
437
|
+
we.displayName = "ViewTransition";
|
|
438
|
+
var st = l.createContext(
|
|
439
|
+
/* @__PURE__ */ new Map()
|
|
440
|
+
);
|
|
441
|
+
st.displayName = "Fetchers";
|
|
442
|
+
var lt = l.createContext(null);
|
|
443
|
+
lt.displayName = "Await";
|
|
444
|
+
var I = l.createContext(
|
|
445
|
+
null
|
|
446
|
+
);
|
|
447
|
+
I.displayName = "Navigation";
|
|
448
|
+
var re = l.createContext(
|
|
449
|
+
null
|
|
450
|
+
);
|
|
451
|
+
re.displayName = "Location";
|
|
452
|
+
var P = l.createContext({
|
|
453
|
+
outlet: null,
|
|
454
|
+
matches: [],
|
|
455
|
+
isDataRoute: !1
|
|
456
|
+
});
|
|
457
|
+
P.displayName = "Route";
|
|
458
|
+
var ne = l.createContext(null);
|
|
459
|
+
ne.displayName = "RouteError";
|
|
460
|
+
function ut(e, { relative: t } = {}) {
|
|
461
|
+
w(
|
|
462
|
+
K(),
|
|
463
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
464
|
+
// router loaded. We can help them understand how to avoid that.
|
|
465
|
+
"useHref() may be used only in the context of a <Router> component."
|
|
466
|
+
);
|
|
467
|
+
let { basename: a, navigator: o } = l.useContext(I), { hash: r, pathname: n, search: u } = B(e, { relative: t }), f = n;
|
|
468
|
+
return a !== "/" && (f = n === "/" ? a : R([a, n])), o.createHref({ pathname: f, search: u, hash: r });
|
|
469
|
+
}
|
|
470
|
+
function K() {
|
|
471
|
+
return l.useContext(re) != null;
|
|
472
|
+
}
|
|
473
|
+
function N() {
|
|
474
|
+
return w(
|
|
475
|
+
K(),
|
|
476
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
477
|
+
// router loaded. We can help them understand how to avoid that.
|
|
478
|
+
"useLocation() may be used only in the context of a <Router> component."
|
|
479
|
+
), l.useContext(re).location;
|
|
480
|
+
}
|
|
481
|
+
var Te = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
482
|
+
function ke(e) {
|
|
483
|
+
l.useContext(I).static || l.useLayoutEffect(e);
|
|
484
|
+
}
|
|
485
|
+
function Ce() {
|
|
486
|
+
let { isDataRoute: e } = l.useContext(P);
|
|
487
|
+
return e ? wt() : ft();
|
|
488
|
+
}
|
|
489
|
+
function ft() {
|
|
490
|
+
w(
|
|
491
|
+
K(),
|
|
492
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
493
|
+
// router loaded. We can help them understand how to avoid that.
|
|
494
|
+
"useNavigate() may be used only in the context of a <Router> component."
|
|
495
|
+
);
|
|
496
|
+
let e = l.useContext(z), { basename: t, navigator: a } = l.useContext(I), { matches: o } = l.useContext(P), { pathname: r } = N(), n = JSON.stringify(ve(o)), u = l.useRef(!1);
|
|
497
|
+
return ke(() => {
|
|
498
|
+
u.current = !0;
|
|
499
|
+
}), l.useCallback(
|
|
500
|
+
(s, i = {}) => {
|
|
501
|
+
if (S(u.current, Te), !u.current) return;
|
|
502
|
+
if (typeof s == "number") {
|
|
503
|
+
a.go(s);
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
let m = be(
|
|
507
|
+
s,
|
|
508
|
+
JSON.parse(n),
|
|
509
|
+
r,
|
|
510
|
+
i.relative === "path"
|
|
511
|
+
);
|
|
512
|
+
e == null && t !== "/" && (m.pathname = m.pathname === "/" ? t : R([t, m.pathname])), (i.replace ? a.replace : a.push)(
|
|
513
|
+
m,
|
|
514
|
+
i.state,
|
|
515
|
+
i
|
|
516
|
+
);
|
|
517
|
+
},
|
|
518
|
+
[
|
|
519
|
+
t,
|
|
520
|
+
a,
|
|
521
|
+
n,
|
|
522
|
+
r,
|
|
523
|
+
e
|
|
524
|
+
]
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
l.createContext(null);
|
|
528
|
+
function B(e, { relative: t } = {}) {
|
|
529
|
+
let { matches: a } = l.useContext(P), { pathname: o } = N(), r = JSON.stringify(ve(a));
|
|
530
|
+
return l.useMemo(
|
|
531
|
+
() => be(
|
|
532
|
+
e,
|
|
533
|
+
JSON.parse(r),
|
|
534
|
+
o,
|
|
535
|
+
t === "path"
|
|
536
|
+
),
|
|
537
|
+
[e, r, o, t]
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
function ct(e, t, a, o) {
|
|
541
|
+
w(
|
|
542
|
+
K(),
|
|
543
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
544
|
+
// router loaded. We can help them understand how to avoid that.
|
|
545
|
+
"useRoutes() may be used only in the context of a <Router> component."
|
|
546
|
+
);
|
|
547
|
+
let { navigator: r, static: n } = l.useContext(I), { matches: u } = l.useContext(P), f = u[u.length - 1], s = f ? f.params : {}, i = f ? f.pathname : "/", m = f ? f.pathnameBase : "/", p = f && f.route;
|
|
548
|
+
{
|
|
549
|
+
let g = p && p.path || "";
|
|
550
|
+
Ee(
|
|
551
|
+
i,
|
|
552
|
+
!p || g.endsWith("*") || g.endsWith("*?"),
|
|
553
|
+
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${i}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
554
|
+
|
|
555
|
+
Please change the parent <Route path="${g}"> to <Route path="${g === "/" ? "*" : `${g}/*`}">.`
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
let c = N(), h;
|
|
559
|
+
h = c;
|
|
560
|
+
let d = h.pathname || "/", v = d;
|
|
561
|
+
if (m !== "/") {
|
|
562
|
+
let g = m.replace(/^\//, "").split("/");
|
|
563
|
+
v = "/" + d.replace(/^\//, "").split("/").slice(g.length).join("/");
|
|
564
|
+
}
|
|
565
|
+
let _ = !n && a && a.matches && a.matches.length > 0 ? a.matches : ye(e, { pathname: v });
|
|
566
|
+
return S(
|
|
567
|
+
p || _ != null,
|
|
568
|
+
`No routes matched location "${h.pathname}${h.search}${h.hash}" `
|
|
569
|
+
), S(
|
|
570
|
+
_ == null || _[_.length - 1].route.element !== void 0 || _[_.length - 1].route.Component !== void 0 || _[_.length - 1].route.lazy !== void 0,
|
|
571
|
+
`Matched leaf route at location "${h.pathname}${h.search}${h.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.`
|
|
572
|
+
), yt(
|
|
573
|
+
_ && _.map(
|
|
574
|
+
(g) => Object.assign({}, g, {
|
|
575
|
+
params: Object.assign({}, s, g.params),
|
|
576
|
+
pathname: R([
|
|
577
|
+
m,
|
|
578
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
579
|
+
r.encodeLocation ? r.encodeLocation(g.pathname).pathname : g.pathname
|
|
580
|
+
]),
|
|
581
|
+
pathnameBase: g.pathnameBase === "/" ? m : R([
|
|
582
|
+
m,
|
|
583
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
584
|
+
r.encodeLocation ? r.encodeLocation(g.pathnameBase).pathname : g.pathnameBase
|
|
585
|
+
])
|
|
586
|
+
})
|
|
587
|
+
),
|
|
588
|
+
u,
|
|
589
|
+
a,
|
|
590
|
+
o
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
function dt() {
|
|
594
|
+
let e = xt(), t = ot(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), a = e instanceof Error ? e.stack : null, o = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: o }, n = { padding: "2px 4px", backgroundColor: o }, u = null;
|
|
595
|
+
return console.error(
|
|
596
|
+
"Error handled by React Router default ErrorBoundary:",
|
|
597
|
+
e
|
|
598
|
+
), u = /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ l.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ l.createElement("code", { style: n }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ l.createElement("code", { style: n }, "errorElement"), " prop on your route.")), /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ l.createElement("h3", { style: { fontStyle: "italic" } }, t), a ? /* @__PURE__ */ l.createElement("pre", { style: r }, a) : null, u);
|
|
599
|
+
}
|
|
600
|
+
var mt = /* @__PURE__ */ l.createElement(dt, null), ht = class extends l.Component {
|
|
601
|
+
constructor(e) {
|
|
602
|
+
super(e), this.state = {
|
|
603
|
+
location: e.location,
|
|
604
|
+
revalidation: e.revalidation,
|
|
605
|
+
error: e.error
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
static getDerivedStateFromError(e) {
|
|
609
|
+
return { error: e };
|
|
610
|
+
}
|
|
611
|
+
static getDerivedStateFromProps(e, t) {
|
|
612
|
+
return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
|
|
613
|
+
error: e.error,
|
|
614
|
+
location: e.location,
|
|
615
|
+
revalidation: e.revalidation
|
|
616
|
+
} : {
|
|
617
|
+
error: e.error !== void 0 ? e.error : t.error,
|
|
618
|
+
location: t.location,
|
|
619
|
+
revalidation: e.revalidation || t.revalidation
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
componentDidCatch(e, t) {
|
|
623
|
+
console.error(
|
|
624
|
+
"React Router caught the following error during render",
|
|
625
|
+
e,
|
|
626
|
+
t
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
render() {
|
|
630
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ l.createElement(P.Provider, { value: this.props.routeContext }, /* @__PURE__ */ l.createElement(
|
|
631
|
+
ne.Provider,
|
|
632
|
+
{
|
|
633
|
+
value: this.state.error,
|
|
634
|
+
children: this.props.component
|
|
635
|
+
}
|
|
636
|
+
)) : this.props.children;
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
function pt({ routeContext: e, match: t, children: a }) {
|
|
640
|
+
let o = l.useContext(z);
|
|
641
|
+
return o && o.static && o.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (o.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ l.createElement(P.Provider, { value: e }, a);
|
|
642
|
+
}
|
|
643
|
+
function yt(e, t = [], a = null, o = null) {
|
|
644
|
+
if (e == null) {
|
|
645
|
+
if (!a)
|
|
646
|
+
return null;
|
|
647
|
+
if (a.errors)
|
|
648
|
+
e = a.matches;
|
|
649
|
+
else if (t.length === 0 && !a.initialized && a.matches.length > 0)
|
|
650
|
+
e = a.matches;
|
|
651
|
+
else
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
let r = e, n = a == null ? void 0 : a.errors;
|
|
655
|
+
if (n != null) {
|
|
656
|
+
let s = r.findIndex(
|
|
657
|
+
(i) => i.route.id && (n == null ? void 0 : n[i.route.id]) !== void 0
|
|
658
|
+
);
|
|
659
|
+
w(
|
|
660
|
+
s >= 0,
|
|
661
|
+
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
662
|
+
n
|
|
663
|
+
).join(",")}`
|
|
664
|
+
), r = r.slice(
|
|
665
|
+
0,
|
|
666
|
+
Math.min(r.length, s + 1)
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
let u = !1, f = -1;
|
|
670
|
+
if (a)
|
|
671
|
+
for (let s = 0; s < r.length; s++) {
|
|
672
|
+
let i = r[s];
|
|
673
|
+
if ((i.route.HydrateFallback || i.route.hydrateFallbackElement) && (f = s), i.route.id) {
|
|
674
|
+
let { loaderData: m, errors: p } = a, c = i.route.loader && !m.hasOwnProperty(i.route.id) && (!p || p[i.route.id] === void 0);
|
|
675
|
+
if (i.route.lazy || c) {
|
|
676
|
+
u = !0, f >= 0 ? r = r.slice(0, f + 1) : r = [r[0]];
|
|
677
|
+
break;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return r.reduceRight((s, i, m) => {
|
|
682
|
+
let p, c = !1, h = null, d = null;
|
|
683
|
+
a && (p = n && i.route.id ? n[i.route.id] : void 0, h = i.route.errorElement || mt, u && (f < 0 && m === 0 ? (Ee(
|
|
684
|
+
"route-fallback",
|
|
685
|
+
!1,
|
|
686
|
+
"No `HydrateFallback` element provided to render during initial hydration"
|
|
687
|
+
), c = !0, d = null) : f === m && (c = !0, d = i.route.hydrateFallbackElement || null)));
|
|
688
|
+
let v = t.concat(r.slice(0, m + 1)), _ = () => {
|
|
689
|
+
let y;
|
|
690
|
+
return p ? y = h : c ? y = d : i.route.Component ? y = /* @__PURE__ */ l.createElement(i.route.Component, null) : i.route.element ? y = i.route.element : y = s, /* @__PURE__ */ l.createElement(
|
|
691
|
+
pt,
|
|
692
|
+
{
|
|
693
|
+
match: i,
|
|
694
|
+
routeContext: {
|
|
695
|
+
outlet: s,
|
|
696
|
+
matches: v,
|
|
697
|
+
isDataRoute: a != null
|
|
698
|
+
},
|
|
699
|
+
children: y
|
|
700
|
+
}
|
|
701
|
+
);
|
|
702
|
+
};
|
|
703
|
+
return a && (i.route.ErrorBoundary || i.route.errorElement || m === 0) ? /* @__PURE__ */ l.createElement(
|
|
704
|
+
ht,
|
|
705
|
+
{
|
|
706
|
+
location: a.location,
|
|
707
|
+
revalidation: a.revalidation,
|
|
708
|
+
component: h,
|
|
709
|
+
error: p,
|
|
710
|
+
children: _(),
|
|
711
|
+
routeContext: { outlet: null, matches: v, isDataRoute: !0 }
|
|
712
|
+
}
|
|
713
|
+
) : _();
|
|
714
|
+
}, null);
|
|
715
|
+
}
|
|
716
|
+
function oe(e) {
|
|
717
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
718
|
+
}
|
|
719
|
+
function gt(e) {
|
|
720
|
+
let t = l.useContext(z);
|
|
721
|
+
return w(t, oe(e)), t;
|
|
722
|
+
}
|
|
723
|
+
function _t(e) {
|
|
724
|
+
let t = l.useContext(J);
|
|
725
|
+
return w(t, oe(e)), t;
|
|
726
|
+
}
|
|
727
|
+
function vt(e) {
|
|
728
|
+
let t = l.useContext(P);
|
|
729
|
+
return w(t, oe(e)), t;
|
|
730
|
+
}
|
|
731
|
+
function ie(e) {
|
|
732
|
+
let t = vt(e), a = t.matches[t.matches.length - 1];
|
|
733
|
+
return w(
|
|
734
|
+
a.route.id,
|
|
735
|
+
`${e} can only be used on routes that contain a unique "id"`
|
|
736
|
+
), a.route.id;
|
|
737
|
+
}
|
|
738
|
+
function bt() {
|
|
739
|
+
return ie(
|
|
740
|
+
"useRouteId"
|
|
741
|
+
/* UseRouteId */
|
|
742
|
+
);
|
|
743
|
+
}
|
|
744
|
+
function xt() {
|
|
745
|
+
var o;
|
|
746
|
+
let e = l.useContext(ne), t = _t(
|
|
747
|
+
"useRouteError"
|
|
748
|
+
/* UseRouteError */
|
|
749
|
+
), a = ie(
|
|
750
|
+
"useRouteError"
|
|
751
|
+
/* UseRouteError */
|
|
752
|
+
);
|
|
753
|
+
return e !== void 0 ? e : (o = t.errors) == null ? void 0 : o[a];
|
|
754
|
+
}
|
|
755
|
+
function wt() {
|
|
756
|
+
let { router: e } = gt(
|
|
757
|
+
"useNavigate"
|
|
758
|
+
/* UseNavigateStable */
|
|
759
|
+
), t = ie(
|
|
760
|
+
"useNavigate"
|
|
761
|
+
/* UseNavigateStable */
|
|
762
|
+
), a = l.useRef(!1);
|
|
763
|
+
return ke(() => {
|
|
764
|
+
a.current = !0;
|
|
765
|
+
}), l.useCallback(
|
|
766
|
+
async (r, n = {}) => {
|
|
767
|
+
S(a.current, Te), a.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: t, ...n }));
|
|
768
|
+
},
|
|
769
|
+
[e, t]
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
var me = {};
|
|
773
|
+
function Ee(e, t, a) {
|
|
774
|
+
!t && !me[e] && (me[e] = !0, S(!1, a));
|
|
775
|
+
}
|
|
776
|
+
l.memo(Tt);
|
|
777
|
+
function Tt({
|
|
778
|
+
routes: e,
|
|
779
|
+
future: t,
|
|
780
|
+
state: a
|
|
781
|
+
}) {
|
|
782
|
+
return ct(e, void 0, a, t);
|
|
783
|
+
}
|
|
784
|
+
var V = "get", j = "application/x-www-form-urlencoded";
|
|
785
|
+
function q(e) {
|
|
786
|
+
return e != null && typeof e.tagName == "string";
|
|
787
|
+
}
|
|
788
|
+
function kt(e) {
|
|
789
|
+
return q(e) && e.tagName.toLowerCase() === "button";
|
|
790
|
+
}
|
|
791
|
+
function Ct(e) {
|
|
792
|
+
return q(e) && e.tagName.toLowerCase() === "form";
|
|
793
|
+
}
|
|
794
|
+
function Et(e) {
|
|
795
|
+
return q(e) && e.tagName.toLowerCase() === "input";
|
|
796
|
+
}
|
|
797
|
+
function Rt(e) {
|
|
798
|
+
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
799
|
+
}
|
|
800
|
+
function St(e, t) {
|
|
801
|
+
return e.button === 0 && // Ignore everything but left clicks
|
|
802
|
+
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
803
|
+
!Rt(e);
|
|
804
|
+
}
|
|
805
|
+
var H = null;
|
|
806
|
+
function It() {
|
|
807
|
+
if (H === null)
|
|
808
|
+
try {
|
|
809
|
+
new FormData(
|
|
810
|
+
document.createElement("form"),
|
|
811
|
+
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
812
|
+
0
|
|
813
|
+
), H = !1;
|
|
814
|
+
} catch {
|
|
815
|
+
H = !0;
|
|
816
|
+
}
|
|
817
|
+
return H;
|
|
818
|
+
}
|
|
819
|
+
var Pt = /* @__PURE__ */ new Set([
|
|
820
|
+
"application/x-www-form-urlencoded",
|
|
821
|
+
"multipart/form-data",
|
|
822
|
+
"text/plain"
|
|
823
|
+
]);
|
|
824
|
+
function Z(e) {
|
|
825
|
+
return e != null && !Pt.has(e) ? (S(
|
|
826
|
+
!1,
|
|
827
|
+
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${j}"`
|
|
828
|
+
), null) : e;
|
|
829
|
+
}
|
|
830
|
+
function Lt(e, t) {
|
|
831
|
+
let a, o, r, n, u;
|
|
832
|
+
if (Ct(e)) {
|
|
833
|
+
let f = e.getAttribute("action");
|
|
834
|
+
o = f ? D(f, t) : null, a = e.getAttribute("method") || V, r = Z(e.getAttribute("enctype")) || j, n = new FormData(e);
|
|
835
|
+
} else if (kt(e) || Et(e) && (e.type === "submit" || e.type === "image")) {
|
|
836
|
+
let f = e.form;
|
|
837
|
+
if (f == null)
|
|
838
|
+
throw new Error(
|
|
839
|
+
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
840
|
+
);
|
|
841
|
+
let s = e.getAttribute("formaction") || f.getAttribute("action");
|
|
842
|
+
if (o = s ? D(s, t) : null, a = e.getAttribute("formmethod") || f.getAttribute("method") || V, r = Z(e.getAttribute("formenctype")) || Z(f.getAttribute("enctype")) || j, n = new FormData(f, e), !It()) {
|
|
843
|
+
let { name: i, type: m, value: p } = e;
|
|
844
|
+
if (m === "image") {
|
|
845
|
+
let c = i ? `${i}.` : "";
|
|
846
|
+
n.append(`${c}x`, "0"), n.append(`${c}y`, "0");
|
|
847
|
+
} else i && n.append(i, p);
|
|
848
|
+
}
|
|
849
|
+
} else {
|
|
850
|
+
if (q(e))
|
|
851
|
+
throw new Error(
|
|
852
|
+
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
853
|
+
);
|
|
854
|
+
a = V, o = null, r = j, u = e;
|
|
855
|
+
}
|
|
856
|
+
return n && r === "text/plain" && (u = n, n = void 0), { action: o, method: a.toLowerCase(), encType: r, formData: n, body: u };
|
|
857
|
+
}
|
|
858
|
+
function se(e, t) {
|
|
859
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
860
|
+
throw new Error(t);
|
|
861
|
+
}
|
|
862
|
+
async function $t(e, t) {
|
|
863
|
+
if (e.id in t)
|
|
864
|
+
return t[e.id];
|
|
865
|
+
try {
|
|
866
|
+
let a = await import(
|
|
867
|
+
/* @vite-ignore */
|
|
868
|
+
/* webpackIgnore: true */
|
|
869
|
+
e.module
|
|
870
|
+
);
|
|
871
|
+
return t[e.id] = a, a;
|
|
872
|
+
} catch (a) {
|
|
873
|
+
return console.error(
|
|
874
|
+
`Error loading route module \`${e.module}\`, reloading page...`
|
|
875
|
+
), console.error(a), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
function Ot(e) {
|
|
880
|
+
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";
|
|
881
|
+
}
|
|
882
|
+
async function Dt(e, t, a) {
|
|
883
|
+
let o = await Promise.all(
|
|
884
|
+
e.map(async (r) => {
|
|
885
|
+
let n = t.routes[r.route.id];
|
|
886
|
+
if (n) {
|
|
887
|
+
let u = await $t(n, a);
|
|
888
|
+
return u.links ? u.links() : [];
|
|
889
|
+
}
|
|
890
|
+
return [];
|
|
891
|
+
})
|
|
892
|
+
);
|
|
893
|
+
return At(
|
|
894
|
+
o.flat(1).filter(Ot).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
|
|
895
|
+
(r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
|
|
896
|
+
)
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
function he(e, t, a, o, r, n) {
|
|
900
|
+
let u = (s, i) => a[i] ? s.route.id !== a[i].route.id : !0, f = (s, i) => {
|
|
901
|
+
var m;
|
|
902
|
+
return (
|
|
903
|
+
// param change, /users/123 -> /users/456
|
|
904
|
+
a[i].pathname !== s.pathname || // splat param changed, which is not present in match.path
|
|
905
|
+
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
906
|
+
((m = a[i].route.path) == null ? void 0 : m.endsWith("*")) && a[i].params["*"] !== s.params["*"]
|
|
907
|
+
);
|
|
908
|
+
};
|
|
909
|
+
return n === "assets" ? t.filter(
|
|
910
|
+
(s, i) => u(s, i) || f(s, i)
|
|
911
|
+
) : n === "data" ? t.filter((s, i) => {
|
|
912
|
+
var p;
|
|
913
|
+
let m = o.routes[s.route.id];
|
|
914
|
+
if (!m || !m.hasLoader)
|
|
915
|
+
return !1;
|
|
916
|
+
if (u(s, i) || f(s, i))
|
|
917
|
+
return !0;
|
|
918
|
+
if (s.route.shouldRevalidate) {
|
|
919
|
+
let c = s.route.shouldRevalidate({
|
|
920
|
+
currentUrl: new URL(
|
|
921
|
+
r.pathname + r.search + r.hash,
|
|
922
|
+
window.origin
|
|
923
|
+
),
|
|
924
|
+
currentParams: ((p = a[0]) == null ? void 0 : p.params) || {},
|
|
925
|
+
nextUrl: new URL(e, window.origin),
|
|
926
|
+
nextParams: s.params,
|
|
927
|
+
defaultShouldRevalidate: !0
|
|
928
|
+
});
|
|
929
|
+
if (typeof c == "boolean")
|
|
930
|
+
return c;
|
|
931
|
+
}
|
|
932
|
+
return !0;
|
|
933
|
+
}) : [];
|
|
934
|
+
}
|
|
935
|
+
function Nt(e, t) {
|
|
936
|
+
return Ft(
|
|
937
|
+
e.map((a) => {
|
|
938
|
+
let o = t.routes[a.route.id];
|
|
939
|
+
if (!o) return [];
|
|
940
|
+
let r = [o.module];
|
|
941
|
+
return o.imports && (r = r.concat(o.imports)), r;
|
|
942
|
+
}).flat(1)
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
function Ft(e) {
|
|
946
|
+
return [...new Set(e)];
|
|
947
|
+
}
|
|
948
|
+
function zt(e) {
|
|
949
|
+
let t = {}, a = Object.keys(e).sort();
|
|
950
|
+
for (let o of a)
|
|
951
|
+
t[o] = e[o];
|
|
952
|
+
return t;
|
|
953
|
+
}
|
|
954
|
+
function At(e, t) {
|
|
955
|
+
let a = /* @__PURE__ */ new Set();
|
|
956
|
+
return new Set(t), e.reduce((o, r) => {
|
|
957
|
+
let n = JSON.stringify(zt(r));
|
|
958
|
+
return a.has(n) || (a.add(n), o.push({ key: n, link: r })), o;
|
|
959
|
+
}, []);
|
|
960
|
+
}
|
|
961
|
+
function Mt(e) {
|
|
962
|
+
let t = typeof e == "string" ? new URL(
|
|
963
|
+
e,
|
|
964
|
+
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
965
|
+
// don't assume window is available
|
|
966
|
+
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
967
|
+
) : e;
|
|
968
|
+
return t.pathname === "/" ? t.pathname = "_root.data" : t.pathname = `${t.pathname.replace(/\/$/, "")}.data`, t;
|
|
969
|
+
}
|
|
970
|
+
function Ut() {
|
|
971
|
+
let e = l.useContext(z);
|
|
972
|
+
return se(
|
|
973
|
+
e,
|
|
974
|
+
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
975
|
+
), e;
|
|
976
|
+
}
|
|
977
|
+
function Bt() {
|
|
978
|
+
let e = l.useContext(J);
|
|
979
|
+
return se(
|
|
980
|
+
e,
|
|
981
|
+
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
982
|
+
), e;
|
|
983
|
+
}
|
|
984
|
+
var le = l.createContext(void 0);
|
|
985
|
+
le.displayName = "FrameworkContext";
|
|
986
|
+
function Re() {
|
|
987
|
+
let e = l.useContext(le);
|
|
988
|
+
return se(
|
|
989
|
+
e,
|
|
990
|
+
"You must render this element inside a <HydratedRouter> element"
|
|
991
|
+
), e;
|
|
992
|
+
}
|
|
993
|
+
function Wt(e, t) {
|
|
994
|
+
let a = l.useContext(le), [o, r] = l.useState(!1), [n, u] = l.useState(!1), { onFocus: f, onBlur: s, onMouseEnter: i, onMouseLeave: m, onTouchStart: p } = t, c = l.useRef(null);
|
|
995
|
+
l.useEffect(() => {
|
|
996
|
+
if (e === "render" && u(!0), e === "viewport") {
|
|
997
|
+
let v = (y) => {
|
|
998
|
+
y.forEach((g) => {
|
|
999
|
+
u(g.isIntersecting);
|
|
1000
|
+
});
|
|
1001
|
+
}, _ = new IntersectionObserver(v, { threshold: 0.5 });
|
|
1002
|
+
return c.current && _.observe(c.current), () => {
|
|
1003
|
+
_.disconnect();
|
|
1004
|
+
};
|
|
1005
|
+
}
|
|
1006
|
+
}, [e]), l.useEffect(() => {
|
|
1007
|
+
if (o) {
|
|
1008
|
+
let v = setTimeout(() => {
|
|
1009
|
+
u(!0);
|
|
1010
|
+
}, 100);
|
|
1011
|
+
return () => {
|
|
1012
|
+
clearTimeout(v);
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
}, [o]);
|
|
1016
|
+
let h = () => {
|
|
1017
|
+
r(!0);
|
|
1018
|
+
}, d = () => {
|
|
1019
|
+
r(!1), u(!1);
|
|
1020
|
+
};
|
|
1021
|
+
return a ? e !== "intent" ? [n, c, {}] : [
|
|
1022
|
+
n,
|
|
1023
|
+
c,
|
|
1024
|
+
{
|
|
1025
|
+
onFocus: M(f, h),
|
|
1026
|
+
onBlur: M(s, d),
|
|
1027
|
+
onMouseEnter: M(i, h),
|
|
1028
|
+
onMouseLeave: M(m, d),
|
|
1029
|
+
onTouchStart: M(p, h)
|
|
1030
|
+
}
|
|
1031
|
+
] : [!1, c, {}];
|
|
1032
|
+
}
|
|
1033
|
+
function M(e, t) {
|
|
1034
|
+
return (a) => {
|
|
1035
|
+
e && e(a), a.defaultPrevented || t(a);
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
function Ht({
|
|
1039
|
+
page: e,
|
|
1040
|
+
...t
|
|
1041
|
+
}) {
|
|
1042
|
+
let { router: a } = Ut(), o = l.useMemo(
|
|
1043
|
+
() => ye(a.routes, e, a.basename),
|
|
1044
|
+
[a.routes, e, a.basename]
|
|
1045
|
+
);
|
|
1046
|
+
return o ? /* @__PURE__ */ l.createElement(jt, { page: e, matches: o, ...t }) : null;
|
|
1047
|
+
}
|
|
1048
|
+
function Vt(e) {
|
|
1049
|
+
let { manifest: t, routeModules: a } = Re(), [o, r] = l.useState([]);
|
|
1050
|
+
return l.useEffect(() => {
|
|
1051
|
+
let n = !1;
|
|
1052
|
+
return Dt(e, t, a).then(
|
|
1053
|
+
(u) => {
|
|
1054
|
+
n || r(u);
|
|
1055
|
+
}
|
|
1056
|
+
), () => {
|
|
1057
|
+
n = !0;
|
|
1058
|
+
};
|
|
1059
|
+
}, [e, t, a]), o;
|
|
1060
|
+
}
|
|
1061
|
+
function jt({
|
|
1062
|
+
page: e,
|
|
1063
|
+
matches: t,
|
|
1064
|
+
...a
|
|
1065
|
+
}) {
|
|
1066
|
+
let o = N(), { manifest: r, routeModules: n } = Re(), { loaderData: u, matches: f } = Bt(), s = l.useMemo(
|
|
1067
|
+
() => he(
|
|
1068
|
+
e,
|
|
1069
|
+
t,
|
|
1070
|
+
f,
|
|
1071
|
+
r,
|
|
1072
|
+
o,
|
|
1073
|
+
"data"
|
|
1074
|
+
),
|
|
1075
|
+
[e, t, f, r, o]
|
|
1076
|
+
), i = l.useMemo(
|
|
1077
|
+
() => he(
|
|
1078
|
+
e,
|
|
1079
|
+
t,
|
|
1080
|
+
f,
|
|
1081
|
+
r,
|
|
1082
|
+
o,
|
|
1083
|
+
"assets"
|
|
1084
|
+
),
|
|
1085
|
+
[e, t, f, r, o]
|
|
1086
|
+
), m = l.useMemo(() => {
|
|
1087
|
+
if (e === o.pathname + o.search + o.hash)
|
|
1088
|
+
return [];
|
|
1089
|
+
let h = /* @__PURE__ */ new Set(), d = !1;
|
|
1090
|
+
if (t.forEach((_) => {
|
|
1091
|
+
var g;
|
|
1092
|
+
let y = r.routes[_.route.id];
|
|
1093
|
+
!y || !y.hasLoader || (!s.some((b) => b.route.id === _.route.id) && _.route.id in u && ((g = n[_.route.id]) != null && g.shouldRevalidate) || y.hasClientLoader ? d = !0 : h.add(_.route.id));
|
|
1094
|
+
}), h.size === 0)
|
|
1095
|
+
return [];
|
|
1096
|
+
let v = Mt(e);
|
|
1097
|
+
return d && h.size > 0 && v.searchParams.set(
|
|
1098
|
+
"_routes",
|
|
1099
|
+
t.filter((_) => h.has(_.route.id)).map((_) => _.route.id).join(",")
|
|
1100
|
+
), [v.pathname + v.search];
|
|
1101
|
+
}, [
|
|
1102
|
+
u,
|
|
1103
|
+
o,
|
|
1104
|
+
r,
|
|
1105
|
+
s,
|
|
1106
|
+
t,
|
|
1107
|
+
e,
|
|
1108
|
+
n
|
|
1109
|
+
]), p = l.useMemo(
|
|
1110
|
+
() => Nt(i, r),
|
|
1111
|
+
[i, r]
|
|
1112
|
+
), c = Vt(i);
|
|
1113
|
+
return /* @__PURE__ */ l.createElement(l.Fragment, null, m.map((h) => /* @__PURE__ */ l.createElement("link", { key: h, rel: "prefetch", as: "fetch", href: h, ...a })), p.map((h) => /* @__PURE__ */ l.createElement("link", { key: h, rel: "modulepreload", href: h, ...a })), c.map(({ key: h, link: d }) => (
|
|
1114
|
+
// these don't spread `linkProps` because they are full link descriptors
|
|
1115
|
+
// already with their own props
|
|
1116
|
+
/* @__PURE__ */ l.createElement("link", { key: h, ...d })
|
|
1117
|
+
)));
|
|
1118
|
+
}
|
|
1119
|
+
function Xt(...e) {
|
|
1120
|
+
return (t) => {
|
|
1121
|
+
e.forEach((a) => {
|
|
1122
|
+
typeof a == "function" ? a(t) : a != null && (a.current = t);
|
|
1123
|
+
});
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
var Se = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
1127
|
+
try {
|
|
1128
|
+
Se && (window.__reactRouterVersion = "7.1.5");
|
|
1129
|
+
} catch {
|
|
1130
|
+
}
|
|
1131
|
+
var Ie = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Pe = l.forwardRef(
|
|
1132
|
+
function({
|
|
1133
|
+
onClick: t,
|
|
1134
|
+
discover: a = "render",
|
|
1135
|
+
prefetch: o = "none",
|
|
1136
|
+
relative: r,
|
|
1137
|
+
reloadDocument: n,
|
|
1138
|
+
replace: u,
|
|
1139
|
+
state: f,
|
|
1140
|
+
target: s,
|
|
1141
|
+
to: i,
|
|
1142
|
+
preventScrollReset: m,
|
|
1143
|
+
viewTransition: p,
|
|
1144
|
+
...c
|
|
1145
|
+
}, h) {
|
|
1146
|
+
let { basename: d } = l.useContext(I), v = typeof i == "string" && Ie.test(i), _, y = !1;
|
|
1147
|
+
if (typeof i == "string" && v && (_ = i, Se))
|
|
1148
|
+
try {
|
|
1149
|
+
let k = new URL(window.location.href), $ = i.startsWith("//") ? new URL(k.protocol + i) : new URL(i), fe = D($.pathname, d);
|
|
1150
|
+
$.origin === k.origin && fe != null ? i = fe + $.search + $.hash : y = !0;
|
|
1151
|
+
} catch {
|
|
1152
|
+
S(
|
|
1153
|
+
!1,
|
|
1154
|
+
`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1157
|
+
let g = ut(i, { relative: r }), [b, T, C] = Wt(
|
|
1158
|
+
o,
|
|
1159
|
+
c
|
|
1160
|
+
), F = Yt(i, {
|
|
1161
|
+
replace: u,
|
|
1162
|
+
state: f,
|
|
1163
|
+
target: s,
|
|
1164
|
+
preventScrollReset: m,
|
|
1165
|
+
relative: r,
|
|
1166
|
+
viewTransition: p
|
|
1167
|
+
});
|
|
1168
|
+
function L(k) {
|
|
1169
|
+
t && t(k), k.defaultPrevented || F(k);
|
|
1170
|
+
}
|
|
1171
|
+
let O = (
|
|
1172
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1173
|
+
/* @__PURE__ */ l.createElement(
|
|
1174
|
+
"a",
|
|
1175
|
+
{
|
|
1176
|
+
...c,
|
|
1177
|
+
...C,
|
|
1178
|
+
href: _ || g,
|
|
1179
|
+
onClick: y || n ? t : L,
|
|
1180
|
+
ref: Xt(h, T),
|
|
1181
|
+
target: s,
|
|
1182
|
+
"data-discover": !v && a === "render" ? "true" : void 0
|
|
1183
|
+
}
|
|
1184
|
+
)
|
|
1185
|
+
);
|
|
1186
|
+
return b && !v ? /* @__PURE__ */ l.createElement(l.Fragment, null, O, /* @__PURE__ */ l.createElement(Ht, { page: g })) : O;
|
|
1187
|
+
}
|
|
1188
|
+
);
|
|
1189
|
+
Pe.displayName = "Link";
|
|
1190
|
+
var Jt = l.forwardRef(
|
|
1191
|
+
function({
|
|
1192
|
+
"aria-current": t = "page",
|
|
1193
|
+
caseSensitive: a = !1,
|
|
1194
|
+
className: o = "",
|
|
1195
|
+
end: r = !1,
|
|
1196
|
+
style: n,
|
|
1197
|
+
to: u,
|
|
1198
|
+
viewTransition: f,
|
|
1199
|
+
children: s,
|
|
1200
|
+
...i
|
|
1201
|
+
}, m) {
|
|
1202
|
+
let p = B(u, { relative: i.relative }), c = N(), h = l.useContext(J), { navigator: d, basename: v } = l.useContext(I), _ = h != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1203
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1204
|
+
ta(p) && f === !0, y = d.encodeLocation ? d.encodeLocation(p).pathname : p.pathname, g = c.pathname, b = h && h.navigation && h.navigation.location ? h.navigation.location.pathname : null;
|
|
1205
|
+
a || (g = g.toLowerCase(), b = b ? b.toLowerCase() : null, y = y.toLowerCase()), b && v && (b = D(b, v) || b);
|
|
1206
|
+
const T = y !== "/" && y.endsWith("/") ? y.length - 1 : y.length;
|
|
1207
|
+
let C = g === y || !r && g.startsWith(y) && g.charAt(T) === "/", F = b != null && (b === y || !r && b.startsWith(y) && b.charAt(y.length) === "/"), L = {
|
|
1208
|
+
isActive: C,
|
|
1209
|
+
isPending: F,
|
|
1210
|
+
isTransitioning: _
|
|
1211
|
+
}, O = C ? t : void 0, k;
|
|
1212
|
+
typeof o == "function" ? k = o(L) : k = [
|
|
1213
|
+
o,
|
|
1214
|
+
C ? "active" : null,
|
|
1215
|
+
F ? "pending" : null,
|
|
1216
|
+
_ ? "transitioning" : null
|
|
1217
|
+
].filter(Boolean).join(" ");
|
|
1218
|
+
let $ = typeof n == "function" ? n(L) : n;
|
|
1219
|
+
return /* @__PURE__ */ l.createElement(
|
|
1220
|
+
Pe,
|
|
1221
|
+
{
|
|
1222
|
+
...i,
|
|
1223
|
+
"aria-current": O,
|
|
1224
|
+
className: k,
|
|
1225
|
+
ref: m,
|
|
1226
|
+
style: $,
|
|
1227
|
+
to: u,
|
|
1228
|
+
viewTransition: f
|
|
1229
|
+
},
|
|
1230
|
+
typeof s == "function" ? s(L) : s
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
);
|
|
1234
|
+
Jt.displayName = "NavLink";
|
|
1235
|
+
var Kt = l.forwardRef(
|
|
1236
|
+
({
|
|
1237
|
+
discover: e = "render",
|
|
1238
|
+
fetcherKey: t,
|
|
1239
|
+
navigate: a,
|
|
1240
|
+
reloadDocument: o,
|
|
1241
|
+
replace: r,
|
|
1242
|
+
state: n,
|
|
1243
|
+
method: u = V,
|
|
1244
|
+
action: f,
|
|
1245
|
+
onSubmit: s,
|
|
1246
|
+
relative: i,
|
|
1247
|
+
preventScrollReset: m,
|
|
1248
|
+
viewTransition: p,
|
|
1249
|
+
...c
|
|
1250
|
+
}, h) => {
|
|
1251
|
+
let d = Zt(), v = ea(f, { relative: i }), _ = u.toLowerCase() === "get" ? "get" : "post", y = typeof f == "string" && Ie.test(f), g = (b) => {
|
|
1252
|
+
if (s && s(b), b.defaultPrevented) return;
|
|
1253
|
+
b.preventDefault();
|
|
1254
|
+
let T = b.nativeEvent.submitter, C = (T == null ? void 0 : T.getAttribute("formmethod")) || u;
|
|
1255
|
+
d(T || b.currentTarget, {
|
|
1256
|
+
fetcherKey: t,
|
|
1257
|
+
method: C,
|
|
1258
|
+
navigate: a,
|
|
1259
|
+
replace: r,
|
|
1260
|
+
state: n,
|
|
1261
|
+
relative: i,
|
|
1262
|
+
preventScrollReset: m,
|
|
1263
|
+
viewTransition: p
|
|
1264
|
+
});
|
|
1265
|
+
};
|
|
1266
|
+
return /* @__PURE__ */ l.createElement(
|
|
1267
|
+
"form",
|
|
1268
|
+
{
|
|
1269
|
+
ref: h,
|
|
1270
|
+
method: _,
|
|
1271
|
+
action: v,
|
|
1272
|
+
onSubmit: o ? s : g,
|
|
1273
|
+
...c,
|
|
1274
|
+
"data-discover": !y && e === "render" ? "true" : void 0
|
|
1275
|
+
}
|
|
1276
|
+
);
|
|
1277
|
+
}
|
|
1278
|
+
);
|
|
1279
|
+
Kt.displayName = "Form";
|
|
1280
|
+
function qt(e) {
|
|
1281
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1282
|
+
}
|
|
1283
|
+
function Le(e) {
|
|
1284
|
+
let t = l.useContext(z);
|
|
1285
|
+
return w(t, qt(e)), t;
|
|
1286
|
+
}
|
|
1287
|
+
function Yt(e, {
|
|
1288
|
+
target: t,
|
|
1289
|
+
replace: a,
|
|
1290
|
+
state: o,
|
|
1291
|
+
preventScrollReset: r,
|
|
1292
|
+
relative: n,
|
|
1293
|
+
viewTransition: u
|
|
1294
|
+
} = {}) {
|
|
1295
|
+
let f = Ce(), s = N(), i = B(e, { relative: n });
|
|
1296
|
+
return l.useCallback(
|
|
1297
|
+
(m) => {
|
|
1298
|
+
if (St(m, t)) {
|
|
1299
|
+
m.preventDefault();
|
|
1300
|
+
let p = a !== void 0 ? a : ee(s) === ee(i);
|
|
1301
|
+
f(e, {
|
|
1302
|
+
replace: p,
|
|
1303
|
+
state: o,
|
|
1304
|
+
preventScrollReset: r,
|
|
1305
|
+
relative: n,
|
|
1306
|
+
viewTransition: u
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1310
|
+
[
|
|
1311
|
+
s,
|
|
1312
|
+
f,
|
|
1313
|
+
i,
|
|
1314
|
+
a,
|
|
1315
|
+
o,
|
|
1316
|
+
t,
|
|
1317
|
+
e,
|
|
1318
|
+
r,
|
|
1319
|
+
n,
|
|
1320
|
+
u
|
|
1321
|
+
]
|
|
1322
|
+
);
|
|
1323
|
+
}
|
|
1324
|
+
var Gt = 0, Qt = () => `__${String(++Gt)}__`;
|
|
1325
|
+
function Zt() {
|
|
1326
|
+
let { router: e } = Le(
|
|
1327
|
+
"useSubmit"
|
|
1328
|
+
/* UseSubmit */
|
|
1329
|
+
), { basename: t } = l.useContext(I), a = bt();
|
|
1330
|
+
return l.useCallback(
|
|
1331
|
+
async (o, r = {}) => {
|
|
1332
|
+
let { action: n, method: u, encType: f, formData: s, body: i } = Lt(
|
|
1333
|
+
o,
|
|
1334
|
+
t
|
|
1335
|
+
);
|
|
1336
|
+
if (r.navigate === !1) {
|
|
1337
|
+
let m = r.fetcherKey || Qt();
|
|
1338
|
+
await e.fetch(m, a, r.action || n, {
|
|
1339
|
+
preventScrollReset: r.preventScrollReset,
|
|
1340
|
+
formData: s,
|
|
1341
|
+
body: i,
|
|
1342
|
+
formMethod: r.method || u,
|
|
1343
|
+
formEncType: r.encType || f,
|
|
1344
|
+
flushSync: r.flushSync
|
|
1345
|
+
});
|
|
1346
|
+
} else
|
|
1347
|
+
await e.navigate(r.action || n, {
|
|
1348
|
+
preventScrollReset: r.preventScrollReset,
|
|
1349
|
+
formData: s,
|
|
1350
|
+
body: i,
|
|
1351
|
+
formMethod: r.method || u,
|
|
1352
|
+
formEncType: r.encType || f,
|
|
1353
|
+
replace: r.replace,
|
|
1354
|
+
state: r.state,
|
|
1355
|
+
fromRouteId: a,
|
|
1356
|
+
flushSync: r.flushSync,
|
|
1357
|
+
viewTransition: r.viewTransition
|
|
1358
|
+
});
|
|
1359
|
+
},
|
|
1360
|
+
[e, t, a]
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
function ea(e, { relative: t } = {}) {
|
|
1364
|
+
let { basename: a } = l.useContext(I), o = l.useContext(P);
|
|
1365
|
+
w(o, "useFormAction must be used inside a RouteContext");
|
|
1366
|
+
let [r] = o.matches.slice(-1), n = { ...B(e || ".", { relative: t }) }, u = N();
|
|
1367
|
+
if (e == null) {
|
|
1368
|
+
n.search = u.search;
|
|
1369
|
+
let f = new URLSearchParams(n.search), s = f.getAll("index");
|
|
1370
|
+
if (s.some((m) => m === "")) {
|
|
1371
|
+
f.delete("index"), s.filter((p) => p).forEach((p) => f.append("index", p));
|
|
1372
|
+
let m = f.toString();
|
|
1373
|
+
n.search = m ? `?${m}` : "";
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
return (!e || e === ".") && r.route.index && (n.search = n.search ? n.search.replace(/^\?/, "?index&") : "?index"), a !== "/" && (n.pathname = n.pathname === "/" ? a : R([a, n.pathname])), ee(n);
|
|
1377
|
+
}
|
|
1378
|
+
function ta(e, t = {}) {
|
|
1379
|
+
let a = l.useContext(we);
|
|
1380
|
+
w(
|
|
1381
|
+
a != null,
|
|
1382
|
+
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1383
|
+
);
|
|
1384
|
+
let { basename: o } = Le(
|
|
1385
|
+
"useViewTransitionState"
|
|
1386
|
+
/* useViewTransitionState */
|
|
1387
|
+
), r = B(e, { relative: t.relative });
|
|
1388
|
+
if (!a.isTransitioning)
|
|
1389
|
+
return !1;
|
|
1390
|
+
let n = D(a.currentLocation.pathname, o) || a.currentLocation.pathname, u = D(a.nextLocation.pathname, o) || a.nextLocation.pathname;
|
|
1391
|
+
return X(r.pathname, u) != null || X(r.pathname, n) != null;
|
|
1392
|
+
}
|
|
1393
|
+
new TextEncoder();
|
|
1394
|
+
function aa(e) {
|
|
1395
|
+
if (typeof document > "u") return;
|
|
1396
|
+
let t = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
|
|
1397
|
+
a.type = "text/css", t.firstChild ? t.insertBefore(a, t.firstChild) : t.appendChild(a), a.styleSheet ? a.styleSheet.cssText = e : a.appendChild(document.createTextNode(e));
|
|
1398
|
+
}
|
|
1399
|
+
aa(`: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)}}
|
|
1400
|
+
`);
|
|
1401
|
+
var ue = (e) => typeof e == "number" && !isNaN(e), U = (e) => typeof e == "string", $e = (e) => typeof e == "function", ra = (e) => U(e) || ue(e), na = (e) => Fe(e) || U(e) || $e(e) || ue(e), oa = 1, Oe = () => `${oa++}`, E = /* @__PURE__ */ new Map(), te = [], pe = /* @__PURE__ */ new Set(), De = () => E.size > 0, ia = (e, { containerId: t }) => {
|
|
1402
|
+
var a;
|
|
1403
|
+
return (a = E.get(t || 1)) == null ? void 0 : a.toasts.get(e);
|
|
1404
|
+
};
|
|
1405
|
+
function sa(e, t) {
|
|
1406
|
+
var a;
|
|
1407
|
+
if (t) return !!((a = E.get(t)) != null && a.isToastActive(e));
|
|
1408
|
+
let o = !1;
|
|
1409
|
+
return E.forEach((r) => {
|
|
1410
|
+
r.isToastActive(e) && (o = !0);
|
|
1411
|
+
}), o;
|
|
1412
|
+
}
|
|
1413
|
+
function la(e) {
|
|
1414
|
+
if (!De()) {
|
|
1415
|
+
te = te.filter((t) => e != null && t.options.toastId !== e);
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
if (e == null || ra(e)) E.forEach((t) => {
|
|
1419
|
+
t.removeToast(e);
|
|
1420
|
+
});
|
|
1421
|
+
else if (e && ("containerId" in e || "id" in e)) {
|
|
1422
|
+
let t = E.get(e.containerId);
|
|
1423
|
+
t ? t.removeToast(e.id) : E.forEach((a) => {
|
|
1424
|
+
a.removeToast(e.id);
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
var ua = (e = {}) => {
|
|
1429
|
+
E.forEach((t) => {
|
|
1430
|
+
t.props.limit && (!e.containerId || t.id === e.containerId) && t.clearQueue();
|
|
1431
|
+
});
|
|
1432
|
+
};
|
|
1433
|
+
function fa(e, t) {
|
|
1434
|
+
na(e) && (De() || te.push({ content: e, options: t }), E.forEach((a) => {
|
|
1435
|
+
a.buildToast(e, t);
|
|
1436
|
+
}));
|
|
1437
|
+
}
|
|
1438
|
+
function Ne(e, t) {
|
|
1439
|
+
E.forEach((a) => {
|
|
1440
|
+
(t == null || !(t != null && t.containerId) || (t == null ? void 0 : t.containerId) === a.id) && a.toggle(e, t == null ? void 0 : t.id);
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
function ca(e) {
|
|
1444
|
+
return pe.add(e), () => {
|
|
1445
|
+
pe.delete(e);
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
function da(e) {
|
|
1449
|
+
return e && (U(e.toastId) || ue(e.toastId)) ? e.toastId : Oe();
|
|
1450
|
+
}
|
|
1451
|
+
function W(e, t) {
|
|
1452
|
+
return fa(e, t), t.toastId;
|
|
1453
|
+
}
|
|
1454
|
+
function Y(e, t) {
|
|
1455
|
+
return { ...t, type: t && t.type || e, toastId: da(t) };
|
|
1456
|
+
}
|
|
1457
|
+
function G(e) {
|
|
1458
|
+
return (t, a) => W(t, Y(e, a));
|
|
1459
|
+
}
|
|
1460
|
+
function x(e, t) {
|
|
1461
|
+
return W(e, Y("default", t));
|
|
1462
|
+
}
|
|
1463
|
+
x.loading = (e, t) => W(e, Y("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...t }));
|
|
1464
|
+
function ma(e, { pending: t, error: a, success: o }, r) {
|
|
1465
|
+
let n;
|
|
1466
|
+
t && (n = U(t) ? x.loading(t, r) : x.loading(t.render, { ...r, ...t }));
|
|
1467
|
+
let u = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, f = (i, m, p) => {
|
|
1468
|
+
if (m == null) {
|
|
1469
|
+
x.dismiss(n);
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
let c = { type: i, ...u, ...r, data: p }, h = U(m) ? { render: m } : m;
|
|
1473
|
+
return n ? x.update(n, { ...c, ...h }) : x(h.render, { ...c, ...h }), p;
|
|
1474
|
+
}, s = $e(e) ? e() : e;
|
|
1475
|
+
return s.then((i) => f("success", o, i)).catch((i) => f("error", a, i)), s;
|
|
1476
|
+
}
|
|
1477
|
+
x.promise = ma;
|
|
1478
|
+
x.success = G("success");
|
|
1479
|
+
x.info = G("info");
|
|
1480
|
+
x.error = G("error");
|
|
1481
|
+
x.warning = G("warning");
|
|
1482
|
+
x.warn = x.warning;
|
|
1483
|
+
x.dark = (e, t) => W(e, Y("default", { theme: "dark", ...t }));
|
|
1484
|
+
function ha(e) {
|
|
1485
|
+
la(e);
|
|
1486
|
+
}
|
|
1487
|
+
x.dismiss = ha;
|
|
1488
|
+
x.clearWaitingQueue = ua;
|
|
1489
|
+
x.isActive = sa;
|
|
1490
|
+
x.update = (e, t = {}) => {
|
|
1491
|
+
let a = ia(e, t);
|
|
1492
|
+
if (a) {
|
|
1493
|
+
let { props: o, content: r } = a, n = { delay: 100, ...o, ...t, toastId: t.toastId || e, updateId: Oe() };
|
|
1494
|
+
n.toastId !== e && (n.staleId = e);
|
|
1495
|
+
let u = n.render || r;
|
|
1496
|
+
delete n.render, W(u, n);
|
|
1497
|
+
}
|
|
1498
|
+
};
|
|
1499
|
+
x.done = (e) => {
|
|
1500
|
+
x.update(e, { progress: 1 });
|
|
1501
|
+
};
|
|
1502
|
+
x.onChange = ca;
|
|
1503
|
+
x.play = (e) => Ne(!0, e);
|
|
1504
|
+
x.pause = (e) => Ne(!1, e);
|
|
1505
|
+
const _a = () => {
|
|
1506
|
+
const e = Ce(), { setAuthToken: t, setUserToken: a } = ze();
|
|
1507
|
+
return { FinSesion: () => {
|
|
1508
|
+
x.promise(
|
|
1509
|
+
new Promise(async (r, n) => {
|
|
1510
|
+
try {
|
|
1511
|
+
const u = localStorage.getItem("access_token");
|
|
1512
|
+
if (!u)
|
|
1513
|
+
throw new Error("No se encontró el token de acceso.");
|
|
1514
|
+
await Ae(u), localStorage.removeItem("access_token"), localStorage.removeItem("user_token"), t(null), a(null), setTimeout(() => {
|
|
1515
|
+
r(!0), e("/");
|
|
1516
|
+
}, 1e3);
|
|
1517
|
+
} catch (u) {
|
|
1518
|
+
n(u);
|
|
1519
|
+
}
|
|
1520
|
+
}),
|
|
1521
|
+
{
|
|
1522
|
+
pending: "Finalizando sesión...",
|
|
1523
|
+
success: "Sesión finalizada con éxito",
|
|
1524
|
+
error: "Error al finalizar la sesión"
|
|
1525
|
+
}
|
|
1526
|
+
);
|
|
1527
|
+
} };
|
|
1528
|
+
};
|
|
1529
|
+
export {
|
|
1530
|
+
_a as a,
|
|
1531
|
+
Ce as u
|
|
1532
|
+
};
|