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