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