zudoku 0.43.0 → 0.43.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/config/validators/common.d.ts +193 -0
- package/dist/config/validators/common.js +2 -0
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +70 -0
- package/dist/lib/components/Banner.js +1 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +2 -2
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Main.js +3 -2
- package/dist/lib/components/Main.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +1 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Pagination.js +2 -2
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/Search.js +1 -1
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +1 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/navigation/PoweredByZudoku.js +1 -1
- package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +1 -1
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +9 -5
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +2 -3
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/Toc.js +2 -2
- package/dist/lib/components/navigation/Toc.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +2 -1
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/oas/parser/upgrade/index.d.ts +1 -0
- package/dist/lib/oas/parser/upgrade/index.js +76 -24
- package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +4 -2
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +10 -4
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +3 -4
- package/dist/lib/plugins/openapi/index.js +6 -4
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +4 -3
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +2 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/SubmitButton.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/SubmitButton.js +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +2 -2
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +33 -3
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/ui/SyntaxHighlight.js +1 -1
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +1 -1
- package/dist/lib/util/traverse.js +6 -5
- package/dist/lib/util/traverse.js.map +1 -1
- package/dist/vite/build.js +1 -0
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/dev-server.js +5 -2
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.d.ts +6 -2
- package/dist/vite/html.js +11 -8
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api.js +2 -2
- package/dist/vite/plugin-api.js.map +1 -1
- package/lib/{AuthenticationPlugin-ByDF051g.js → AuthenticationPlugin-BxoEZCSJ.js} +4 -4
- package/lib/{AuthenticationPlugin-ByDF051g.js.map → AuthenticationPlugin-BxoEZCSJ.js.map} +1 -1
- package/lib/{Markdown-mFpg_n9p.js → Markdown-DvdVn1O7.js} +1839 -1836
- package/lib/Markdown-DvdVn1O7.js.map +1 -0
- package/lib/{MdxPage-Cm7atiW3.js → MdxPage-DUcuusMU.js} +7 -7
- package/lib/{MdxPage-Cm7atiW3.js.map → MdxPage-DUcuusMU.js.map} +1 -1
- package/lib/{OasProvider-DOs0v9u7.js → OasProvider-CjMm8pB7.js} +8 -9
- package/lib/{OasProvider-DOs0v9u7.js.map → OasProvider-CjMm8pB7.js.map} +1 -1
- package/lib/{OperationList-CKac6iap.js → OperationList-BhJcPgGi.js} +1269 -1261
- package/lib/{OperationList-CKac6iap.js.map → OperationList-BhJcPgGi.js.map} +1 -1
- package/lib/Pagination-BgQxwq5j.js +48 -0
- package/lib/Pagination-BgQxwq5j.js.map +1 -0
- package/lib/{RouteGuard-DRtEu9nh.js → RouteGuard-D2gX29iI.js} +3 -3
- package/lib/{RouteGuard-DRtEu9nh.js.map → RouteGuard-D2gX29iI.js.map} +1 -1
- package/lib/{SchemaList-BTX2mRMW.js → SchemaList-BexhT_Z0.js} +22 -23
- package/lib/{SchemaList-BTX2mRMW.js.map → SchemaList-BexhT_Z0.js.map} +1 -1
- package/lib/{SchemaView-BYRn_-2l.js → SchemaView-Dt_-u8rW.js} +123 -146
- package/lib/SchemaView-Dt_-u8rW.js.map +1 -0
- package/lib/{Select-CT64Ou40.js → Select-CYaEBIYK.js} +3 -3
- package/lib/{Select-CT64Ou40.js.map → Select-CYaEBIYK.js.map} +1 -1
- package/lib/{SlotletProvider-CS_nO-XT.js → SlotletProvider-wWbHYqWf.js} +7 -7
- package/lib/SlotletProvider-wWbHYqWf.js.map +1 -0
- package/lib/{SyntaxHighlight-CxhyyMkF.js → SyntaxHighlight-o7q0acut.js} +81 -81
- package/lib/{SyntaxHighlight-CxhyyMkF.js.map → SyntaxHighlight-o7q0acut.js.map} +1 -1
- package/lib/{Toc-D_tV8_Ri.js → Toc-BnN4zBb3.js} +17 -17
- package/lib/Toc-BnN4zBb3.js.map +1 -0
- package/lib/{chunk-BAXFHI7N-BVBOl9s0.js → chunk-BAXFHI7N-BLTsN6tl.js} +679 -659
- package/lib/{chunk-BAXFHI7N-BVBOl9s0.js.map → chunk-BAXFHI7N-BLTsN6tl.js.map} +1 -1
- package/lib/{circular-ByJI6Mci.js → circular-BWEIet3w.js} +4616 -5567
- package/lib/circular-BWEIet3w.js.map +1 -0
- package/lib/{createServer-IW7v5hWm.js → createServer-BQD3Eeqb.js} +1998 -1970
- package/lib/createServer-BQD3Eeqb.js.map +1 -0
- package/lib/{hook-CldJlP5c.js → hook-8GM2HXNM.js} +24 -24
- package/lib/{hook-CldJlP5c.js.map → hook-8GM2HXNM.js.map} +1 -1
- package/lib/index-CFf9AN-y.js +3208 -0
- package/lib/index-CFf9AN-y.js.map +1 -0
- package/lib/{index-DnQftvP4.js → index-DGNSSXgR.js} +77 -69
- package/lib/{index-DnQftvP4.js.map → index-DGNSSXgR.js.map} +1 -1
- package/lib/{mutation-DBQh7AOZ.js → mutation-Bq5bn7Hf.js} +2 -2
- package/lib/{mutation-DBQh7AOZ.js.map → mutation-Bq5bn7Hf.js.map} +1 -1
- package/lib/processors/traverse.js +9 -7
- package/lib/processors/traverse.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +1 -1
- package/lib/{useExposedProps-DbIZXspi.js → useExposedProps-DmTJxEXG.js} +2 -2
- package/lib/{useExposedProps-DbIZXspi.js.map → useExposedProps-DmTJxEXG.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.components.js +6 -6
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +5 -5
- package/lib/zudoku.plugin-api-keys.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +6 -5
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +3 -3
- package/package.json +3 -3
- package/src/app/main.css +2 -2
- package/src/lib/components/Banner.tsx +1 -1
- package/src/lib/components/Heading.tsx +3 -3
- package/src/lib/components/Layout.tsx +1 -4
- package/src/lib/components/Main.tsx +4 -3
- package/src/lib/components/MobileTopNavigation.tsx +2 -2
- package/src/lib/components/Pagination.tsx +3 -3
- package/src/lib/components/Search.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/navigation/PoweredByZudoku.tsx +6 -1
- package/src/lib/components/navigation/Sidebar.tsx +1 -1
- package/src/lib/components/navigation/SidebarCategory.tsx +9 -5
- package/src/lib/components/navigation/SidebarItem.tsx +2 -3
- package/src/lib/components/navigation/Toc.tsx +4 -4
- package/src/lib/core/ZudokuContext.ts +2 -1
- package/src/lib/oas/parser/upgrade/index.ts +97 -27
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +2 -2
- package/src/lib/plugins/openapi/OperationList.tsx +1 -1
- package/src/lib/plugins/openapi/OperationListItem.tsx +15 -6
- package/src/lib/plugins/openapi/SchemaList.tsx +1 -1
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +23 -4
- package/src/lib/plugins/openapi/index.tsx +8 -7
- package/src/lib/plugins/openapi/interfaces.ts +4 -3
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +2 -2
- package/src/lib/plugins/openapi/playground/Playground.tsx +5 -5
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +2 -2
- package/src/lib/plugins/openapi/playground/SubmitButton.tsx +2 -2
- package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +2 -2
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +1 -1
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +1 -1
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +2 -2
- package/src/lib/plugins/openapi/util/getRoutes.tsx +67 -3
- package/src/lib/ui/SyntaxHighlight.tsx +2 -2
- package/src/lib/util/traverse.ts +8 -5
- package/lib/Markdown-mFpg_n9p.js.map +0 -1
- package/lib/Pagination-DLPL5z77.js +0 -48
- package/lib/Pagination-DLPL5z77.js.map +0 -1
- package/lib/SchemaView-BYRn_-2l.js.map +0 -1
- package/lib/SlotletProvider-CS_nO-XT.js.map +0 -1
- package/lib/Toc-D_tV8_Ri.js.map +0 -1
- package/lib/circular-ByJI6Mci.js.map +0 -1
- package/lib/context-Lrf2Y9bR.js +0 -22
- package/lib/context-Lrf2Y9bR.js.map +0 -1
- package/lib/createServer-IW7v5hWm.js.map +0 -1
- package/lib/index-DuB48L78.js +0 -2184
- package/lib/index-DuB48L78.js.map +0 -1
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
import * as o from "react";
|
|
2
2
|
var F = {}, ue;
|
|
3
|
-
function
|
|
3
|
+
function Ae() {
|
|
4
4
|
if (ue) return F;
|
|
5
|
-
ue = 1, Object.defineProperty(F, "__esModule", { value: !0 }), F.parse =
|
|
6
|
-
const e = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/,
|
|
5
|
+
ue = 1, Object.defineProperty(F, "__esModule", { value: !0 }), F.parse = s, F.serialize = u;
|
|
6
|
+
const e = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, n = /^[\u0021-\u003A\u003C-\u007E]*$/, t = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, a = /^[\u0020-\u003A\u003D-\u007E]*$/, r = Object.prototype.toString, i = /* @__PURE__ */ (() => {
|
|
7
7
|
const d = function() {
|
|
8
8
|
};
|
|
9
9
|
return d.prototype = /* @__PURE__ */ Object.create(null), d;
|
|
10
10
|
})();
|
|
11
|
-
function
|
|
11
|
+
function s(d, g) {
|
|
12
12
|
const f = new i(), w = d.length;
|
|
13
13
|
if (w < 2)
|
|
14
14
|
return f;
|
|
15
|
-
const E = (
|
|
16
|
-
let
|
|
15
|
+
const E = (g == null ? void 0 : g.decode) || h;
|
|
16
|
+
let p = 0;
|
|
17
17
|
do {
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
18
|
+
const v = d.indexOf("=", p);
|
|
19
|
+
if (v === -1)
|
|
20
20
|
break;
|
|
21
|
-
const y = d.indexOf(";",
|
|
22
|
-
if (
|
|
23
|
-
|
|
21
|
+
const y = d.indexOf(";", p), b = y === -1 ? w : y;
|
|
22
|
+
if (v > b) {
|
|
23
|
+
p = d.lastIndexOf(";", v - 1) + 1;
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
26
|
-
const x =
|
|
26
|
+
const x = c(d, p, v), C = l(d, v, x), $ = d.slice(x, C);
|
|
27
27
|
if (f[$] === void 0) {
|
|
28
|
-
let S =
|
|
28
|
+
let S = c(d, v + 1, b), P = l(d, b, S);
|
|
29
29
|
const D = E(d.slice(S, P));
|
|
30
30
|
f[$] = D;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
} while (
|
|
32
|
+
p = b + 1;
|
|
33
|
+
} while (p < w);
|
|
34
34
|
return f;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function c(d, g, f) {
|
|
37
37
|
do {
|
|
38
|
-
const w = d.charCodeAt(
|
|
38
|
+
const w = d.charCodeAt(g);
|
|
39
39
|
if (w !== 32 && w !== 9)
|
|
40
|
-
return
|
|
41
|
-
} while (++
|
|
40
|
+
return g;
|
|
41
|
+
} while (++g < f);
|
|
42
42
|
return f;
|
|
43
43
|
}
|
|
44
|
-
function l(d,
|
|
45
|
-
for (;
|
|
46
|
-
const w = d.charCodeAt(--
|
|
44
|
+
function l(d, g, f) {
|
|
45
|
+
for (; g > f; ) {
|
|
46
|
+
const w = d.charCodeAt(--g);
|
|
47
47
|
if (w !== 32 && w !== 9)
|
|
48
|
-
return
|
|
48
|
+
return g + 1;
|
|
49
49
|
}
|
|
50
50
|
return f;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function u(d, g, f) {
|
|
53
53
|
const w = (f == null ? void 0 : f.encode) || encodeURIComponent;
|
|
54
54
|
if (!e.test(d))
|
|
55
55
|
throw new TypeError(`argument name is invalid: ${d}`);
|
|
56
|
-
const E = w(
|
|
57
|
-
if (!
|
|
58
|
-
throw new TypeError(`argument val is invalid: ${
|
|
59
|
-
let
|
|
56
|
+
const E = w(g);
|
|
57
|
+
if (!n.test(E))
|
|
58
|
+
throw new TypeError(`argument val is invalid: ${g}`);
|
|
59
|
+
let p = d + "=" + E;
|
|
60
60
|
if (!f)
|
|
61
|
-
return
|
|
61
|
+
return p;
|
|
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
|
+
p += "; Max-Age=" + f.maxAge;
|
|
66
66
|
}
|
|
67
67
|
if (f.domain) {
|
|
68
|
-
if (!
|
|
68
|
+
if (!t.test(f.domain))
|
|
69
69
|
throw new TypeError(`option domain is invalid: ${f.domain}`);
|
|
70
|
-
|
|
70
|
+
p += "; Domain=" + f.domain;
|
|
71
71
|
}
|
|
72
72
|
if (f.path) {
|
|
73
73
|
if (!a.test(f.path))
|
|
74
74
|
throw new TypeError(`option path is invalid: ${f.path}`);
|
|
75
|
-
|
|
75
|
+
p += "; Path=" + f.path;
|
|
76
76
|
}
|
|
77
77
|
if (f.expires) {
|
|
78
|
-
if (!
|
|
78
|
+
if (!m(f.expires) || !Number.isFinite(f.expires.valueOf()))
|
|
79
79
|
throw new TypeError(`option expires is invalid: ${f.expires}`);
|
|
80
|
-
|
|
80
|
+
p += "; Expires=" + f.expires.toUTCString();
|
|
81
81
|
}
|
|
82
|
-
if (f.httpOnly && (
|
|
82
|
+
if (f.httpOnly && (p += "; HttpOnly"), f.secure && (p += "; Secure"), f.partitioned && (p += "; Partitioned"), f.priority)
|
|
83
83
|
switch (typeof f.priority == "string" ? f.priority.toLowerCase() : void 0) {
|
|
84
84
|
case "low":
|
|
85
|
-
|
|
85
|
+
p += "; Priority=Low";
|
|
86
86
|
break;
|
|
87
87
|
case "medium":
|
|
88
|
-
|
|
88
|
+
p += "; Priority=Medium";
|
|
89
89
|
break;
|
|
90
90
|
case "high":
|
|
91
|
-
|
|
91
|
+
p += "; Priority=High";
|
|
92
92
|
break;
|
|
93
93
|
default:
|
|
94
94
|
throw new TypeError(`option priority is invalid: ${f.priority}`);
|
|
@@ -97,18 +97,18 @@ function Me() {
|
|
|
97
97
|
switch (typeof f.sameSite == "string" ? f.sameSite.toLowerCase() : f.sameSite) {
|
|
98
98
|
case !0:
|
|
99
99
|
case "strict":
|
|
100
|
-
|
|
100
|
+
p += "; SameSite=Strict";
|
|
101
101
|
break;
|
|
102
102
|
case "lax":
|
|
103
|
-
|
|
103
|
+
p += "; SameSite=Lax";
|
|
104
104
|
break;
|
|
105
105
|
case "none":
|
|
106
|
-
|
|
106
|
+
p += "; 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 p;
|
|
112
112
|
}
|
|
113
113
|
function h(d) {
|
|
114
114
|
if (d.indexOf("%") === -1)
|
|
@@ -119,12 +119,12 @@ function Me() {
|
|
|
119
119
|
return d;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function m(d) {
|
|
123
123
|
return r.call(d) === "[object Date]";
|
|
124
124
|
}
|
|
125
125
|
return F;
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
Ae();
|
|
128
128
|
/**
|
|
129
129
|
* react-router v7.5.2
|
|
130
130
|
*
|
|
@@ -135,282 +135,301 @@ Me();
|
|
|
135
135
|
*
|
|
136
136
|
* @license MIT
|
|
137
137
|
*/
|
|
138
|
-
function
|
|
138
|
+
function R(e, n) {
|
|
139
139
|
if (e === !1 || e === null || typeof e > "u")
|
|
140
|
-
throw new Error(
|
|
140
|
+
throw new Error(n);
|
|
141
141
|
}
|
|
142
|
-
function L(e,
|
|
142
|
+
function L(e, n) {
|
|
143
143
|
if (!e) {
|
|
144
|
-
typeof console < "u" && console.warn(
|
|
144
|
+
typeof console < "u" && console.warn(n);
|
|
145
145
|
try {
|
|
146
|
-
throw new Error(
|
|
146
|
+
throw new Error(n);
|
|
147
147
|
} catch {
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function W({
|
|
152
152
|
pathname: e = "/",
|
|
153
|
-
search:
|
|
154
|
-
hash:
|
|
153
|
+
search: n = "",
|
|
154
|
+
hash: t = ""
|
|
155
155
|
}) {
|
|
156
|
-
return
|
|
156
|
+
return n && n !== "?" && (e += n.charAt(0) === "?" ? n : "?" + n), t && t !== "#" && (e += t.charAt(0) === "#" ? t : "#" + t), e;
|
|
157
157
|
}
|
|
158
158
|
function Y(e) {
|
|
159
|
-
let
|
|
159
|
+
let n = {};
|
|
160
160
|
if (e) {
|
|
161
|
-
let
|
|
162
|
-
|
|
161
|
+
let t = e.indexOf("#");
|
|
162
|
+
t >= 0 && (n.hash = e.substring(t), e = e.substring(0, t));
|
|
163
163
|
let a = e.indexOf("?");
|
|
164
|
-
a >= 0 && (
|
|
164
|
+
a >= 0 && (n.search = e.substring(a), e = e.substring(0, a)), e && (n.pathname = e);
|
|
165
165
|
}
|
|
166
|
-
return
|
|
166
|
+
return n;
|
|
167
167
|
}
|
|
168
|
-
function pe(e,
|
|
169
|
-
return De(e,
|
|
168
|
+
function pe(e, n, t = "/") {
|
|
169
|
+
return De(e, n, t, !1);
|
|
170
170
|
}
|
|
171
|
-
function De(e,
|
|
172
|
-
let r = typeof
|
|
171
|
+
function De(e, n, t, a) {
|
|
172
|
+
let r = typeof n == "string" ? Y(n) : n, i = A(r.pathname || "/", t);
|
|
173
173
|
if (i == null)
|
|
174
174
|
return null;
|
|
175
|
-
let
|
|
176
|
-
Oe(
|
|
177
|
-
let
|
|
178
|
-
for (let l = 0;
|
|
179
|
-
let
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
let s = ge(e);
|
|
176
|
+
Oe(s);
|
|
177
|
+
let c = null;
|
|
178
|
+
for (let l = 0; c == null && l < s.length; ++l) {
|
|
179
|
+
let u = ye(i);
|
|
180
|
+
c = je(
|
|
181
|
+
s[l],
|
|
182
|
+
u,
|
|
183
183
|
a
|
|
184
184
|
);
|
|
185
185
|
}
|
|
186
|
-
return
|
|
186
|
+
return c;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
let r = (i,
|
|
188
|
+
function ge(e, n = [], t = [], a = "") {
|
|
189
|
+
let r = (i, s, c) => {
|
|
190
190
|
let l = {
|
|
191
|
-
relativePath:
|
|
191
|
+
relativePath: c === void 0 ? i.path || "" : c,
|
|
192
192
|
caseSensitive: i.caseSensitive === !0,
|
|
193
|
-
childrenIndex:
|
|
193
|
+
childrenIndex: s,
|
|
194
194
|
route: i
|
|
195
195
|
};
|
|
196
|
-
l.relativePath.startsWith("/") && (
|
|
196
|
+
l.relativePath.startsWith("/") && (R(
|
|
197
197
|
l.relativePath.startsWith(a),
|
|
198
198
|
`Absolute route path "${l.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
199
199
|
), l.relativePath = l.relativePath.slice(a.length));
|
|
200
|
-
let
|
|
201
|
-
i.children && i.children.length > 0 && (
|
|
200
|
+
let u = M([a, l.relativePath]), h = t.concat(l);
|
|
201
|
+
i.children && i.children.length > 0 && (R(
|
|
202
202
|
// Our types know better, but runtime JS may not!
|
|
203
203
|
// @ts-expect-error
|
|
204
204
|
i.index !== !0,
|
|
205
|
-
`Index routes must not have child routes. Please remove all child routes from route path "${
|
|
206
|
-
),
|
|
207
|
-
path:
|
|
208
|
-
score:
|
|
205
|
+
`Index routes must not have child routes. Please remove all child routes from route path "${u}".`
|
|
206
|
+
), ge(i.children, n, h, u)), !(i.path == null && !i.index) && n.push({
|
|
207
|
+
path: u,
|
|
208
|
+
score: He(u, i.index),
|
|
209
209
|
routesMeta: h
|
|
210
210
|
});
|
|
211
211
|
};
|
|
212
|
-
return e.forEach((i,
|
|
213
|
-
var
|
|
214
|
-
if (i.path === "" || !((
|
|
215
|
-
r(i,
|
|
212
|
+
return e.forEach((i, s) => {
|
|
213
|
+
var c;
|
|
214
|
+
if (i.path === "" || !((c = i.path) != null && c.includes("?")))
|
|
215
|
+
r(i, s);
|
|
216
216
|
else
|
|
217
|
-
for (let l of
|
|
218
|
-
r(i,
|
|
219
|
-
}),
|
|
217
|
+
for (let l of ve(i.path))
|
|
218
|
+
r(i, s, l);
|
|
219
|
+
}), n;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
let
|
|
223
|
-
if (
|
|
224
|
-
let [
|
|
221
|
+
function ve(e) {
|
|
222
|
+
let n = e.split("/");
|
|
223
|
+
if (n.length === 0) return [];
|
|
224
|
+
let [t, ...a] = n, r = t.endsWith("?"), i = t.replace(/\?$/, "");
|
|
225
225
|
if (a.length === 0)
|
|
226
226
|
return r ? [i, ""] : [i];
|
|
227
|
-
let
|
|
228
|
-
return
|
|
229
|
-
...
|
|
227
|
+
let s = ve(a.join("/")), c = [];
|
|
228
|
+
return c.push(
|
|
229
|
+
...s.map(
|
|
230
230
|
(l) => l === "" ? i : [i, l].join("/")
|
|
231
231
|
)
|
|
232
|
-
), r &&
|
|
232
|
+
), r && c.push(...s), c.map(
|
|
233
233
|
(l) => e.startsWith("/") && l === "" ? "/" : l
|
|
234
234
|
);
|
|
235
235
|
}
|
|
236
236
|
function Oe(e) {
|
|
237
237
|
e.sort(
|
|
238
|
-
(
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
(n, t) => n.score !== t.score ? t.score - n.score : ze(
|
|
239
|
+
n.routesMeta.map((a) => a.childrenIndex),
|
|
240
|
+
t.routesMeta.map((a) => a.childrenIndex)
|
|
241
241
|
)
|
|
242
242
|
);
|
|
243
243
|
}
|
|
244
|
-
var Ie = /^:[\w-]+$/, _e = 3, Fe = 2, Ue = 1,
|
|
245
|
-
function
|
|
246
|
-
let
|
|
247
|
-
return
|
|
248
|
-
(r, i) => r + (Ie.test(i) ? _e : i === "" ? Ue :
|
|
244
|
+
var Ie = /^:[\w-]+$/, _e = 3, Fe = 2, Ue = 1, We = 10, Be = -2, ce = (e) => e === "*";
|
|
245
|
+
function He(e, n) {
|
|
246
|
+
let t = e.split("/"), a = t.length;
|
|
247
|
+
return t.some(ce) && (a += Be), n && (a += Fe), t.filter((r) => !ce(r)).reduce(
|
|
248
|
+
(r, i) => r + (Ie.test(i) ? _e : i === "" ? Ue : We),
|
|
249
249
|
a
|
|
250
250
|
);
|
|
251
251
|
}
|
|
252
|
-
function ze(e,
|
|
253
|
-
return e.length ===
|
|
252
|
+
function ze(e, n) {
|
|
253
|
+
return e.length === n.length && e.slice(0, -1).every((a, r) => a === n[r]) ? (
|
|
254
254
|
// If two routes are siblings, we should try to match the earlier sibling
|
|
255
255
|
// first. This allows people to have fine-grained control over the matching
|
|
256
256
|
// behavior by simply putting routes with identical paths in the order they
|
|
257
257
|
// want them tried.
|
|
258
|
-
e[e.length - 1] -
|
|
258
|
+
e[e.length - 1] - n[n.length - 1]
|
|
259
259
|
) : (
|
|
260
260
|
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
261
261
|
// so they sort equally.
|
|
262
262
|
0
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
let { routesMeta: a } = e, r = {}, i = "/",
|
|
267
|
-
for (let
|
|
268
|
-
let l = a[
|
|
269
|
-
{ path: l.relativePath, caseSensitive: l.caseSensitive, end:
|
|
265
|
+
function je(e, n, t = !1) {
|
|
266
|
+
let { routesMeta: a } = e, r = {}, i = "/", s = [];
|
|
267
|
+
for (let c = 0; c < a.length; ++c) {
|
|
268
|
+
let l = a[c], u = c === a.length - 1, h = i === "/" ? n : n.slice(i.length) || "/", m = B(
|
|
269
|
+
{ path: l.relativePath, caseSensitive: l.caseSensitive, end: u },
|
|
270
270
|
h
|
|
271
271
|
), d = l.route;
|
|
272
|
-
if (!
|
|
272
|
+
if (!m && u && t && !a[a.length - 1].route.index && (m = B(
|
|
273
273
|
{
|
|
274
274
|
path: l.relativePath,
|
|
275
275
|
caseSensitive: l.caseSensitive,
|
|
276
276
|
end: !1
|
|
277
277
|
},
|
|
278
278
|
h
|
|
279
|
-
)), !
|
|
279
|
+
)), !m)
|
|
280
280
|
return null;
|
|
281
|
-
Object.assign(r,
|
|
281
|
+
Object.assign(r, m.params), s.push({
|
|
282
282
|
// TODO: Can this as be avoided?
|
|
283
283
|
params: r,
|
|
284
|
-
pathname:
|
|
284
|
+
pathname: M([i, m.pathname]),
|
|
285
285
|
pathnameBase: qe(
|
|
286
|
-
|
|
286
|
+
M([i, m.pathnameBase])
|
|
287
287
|
),
|
|
288
288
|
route: d
|
|
289
|
-
}),
|
|
289
|
+
}), m.pathnameBase !== "/" && (i = M([i, m.pathnameBase]));
|
|
290
290
|
}
|
|
291
|
-
return
|
|
291
|
+
return s;
|
|
292
|
+
}
|
|
293
|
+
function on(e, n = {}) {
|
|
294
|
+
let t = e;
|
|
295
|
+
t.endsWith("*") && t !== "*" && !t.endsWith("/*") && (L(
|
|
296
|
+
!1,
|
|
297
|
+
`Route path "${t}" will be treated as if it were "${t.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/, "/*")}".`
|
|
298
|
+
), t = t.replace(/\*$/, "/*"));
|
|
299
|
+
const a = t.startsWith("/") ? "/" : "", r = (s) => s == null ? "" : typeof s == "string" ? s : String(s), i = t.split(/\/+/).map((s, c, l) => {
|
|
300
|
+
if (c === l.length - 1 && s === "*")
|
|
301
|
+
return r(n["*"]);
|
|
302
|
+
const h = s.match(/^:([\w-]+)(\??)$/);
|
|
303
|
+
if (h) {
|
|
304
|
+
const [, m, d] = h;
|
|
305
|
+
let g = n[m];
|
|
306
|
+
return R(d === "?" || g != null, `Missing ":${m}" param`), r(g);
|
|
307
|
+
}
|
|
308
|
+
return s.replace(/\?$/g, "");
|
|
309
|
+
}).filter((s) => !!s);
|
|
310
|
+
return a + i.join("/");
|
|
292
311
|
}
|
|
293
|
-
function
|
|
312
|
+
function B(e, n) {
|
|
294
313
|
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
295
|
-
let [
|
|
314
|
+
let [t, a] = Ve(
|
|
296
315
|
e.path,
|
|
297
316
|
e.caseSensitive,
|
|
298
317
|
e.end
|
|
299
|
-
), r =
|
|
318
|
+
), r = n.match(t);
|
|
300
319
|
if (!r) return null;
|
|
301
|
-
let i = r[0],
|
|
320
|
+
let i = r[0], s = i.replace(/(.)\/+$/, "$1"), c = r.slice(1);
|
|
302
321
|
return {
|
|
303
322
|
params: a.reduce(
|
|
304
|
-
(
|
|
323
|
+
(u, { paramName: h, isOptional: m }, d) => {
|
|
305
324
|
if (h === "*") {
|
|
306
|
-
let f =
|
|
307
|
-
|
|
325
|
+
let f = c[d] || "";
|
|
326
|
+
s = i.slice(0, i.length - f.length).replace(/(.)\/+$/, "$1");
|
|
308
327
|
}
|
|
309
|
-
const
|
|
310
|
-
return
|
|
328
|
+
const g = c[d];
|
|
329
|
+
return m && !g ? u[h] = void 0 : u[h] = (g || "").replace(/%2F/g, "/"), u;
|
|
311
330
|
},
|
|
312
331
|
{}
|
|
313
332
|
),
|
|
314
333
|
pathname: i,
|
|
315
|
-
pathnameBase:
|
|
334
|
+
pathnameBase: s,
|
|
316
335
|
pattern: e
|
|
317
336
|
};
|
|
318
337
|
}
|
|
319
|
-
function
|
|
338
|
+
function Ve(e, n = !1, t = !0) {
|
|
320
339
|
L(
|
|
321
340
|
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
322
341
|
`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(/\*$/, "/*")}".`
|
|
323
342
|
);
|
|
324
343
|
let a = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
325
344
|
/\/:([\w-]+)(\?)?/g,
|
|
326
|
-
(
|
|
345
|
+
(s, c, l) => (a.push({ paramName: c, isOptional: l != null }), l ? "/?([^\\/]+)?" : "/([^\\/]+)")
|
|
327
346
|
);
|
|
328
|
-
return e.endsWith("*") ? (a.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") :
|
|
347
|
+
return e.endsWith("*") ? (a.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : t ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, n ? void 0 : "i"), a];
|
|
329
348
|
}
|
|
330
349
|
function ye(e) {
|
|
331
350
|
try {
|
|
332
|
-
return e.split("/").map((
|
|
333
|
-
} catch (
|
|
351
|
+
return e.split("/").map((n) => decodeURIComponent(n).replace(/\//g, "%2F")).join("/");
|
|
352
|
+
} catch (n) {
|
|
334
353
|
return L(
|
|
335
354
|
!1,
|
|
336
|
-
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${
|
|
355
|
+
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`
|
|
337
356
|
), e;
|
|
338
357
|
}
|
|
339
358
|
}
|
|
340
|
-
function
|
|
341
|
-
if (
|
|
342
|
-
if (!e.toLowerCase().startsWith(
|
|
359
|
+
function A(e, n) {
|
|
360
|
+
if (n === "/") return e;
|
|
361
|
+
if (!e.toLowerCase().startsWith(n.toLowerCase()))
|
|
343
362
|
return null;
|
|
344
|
-
let
|
|
345
|
-
return a && a !== "/" ? null : e.slice(
|
|
363
|
+
let t = n.endsWith("/") ? n.length - 1 : n.length, a = e.charAt(t);
|
|
364
|
+
return a && a !== "/" ? null : e.slice(t) || "/";
|
|
346
365
|
}
|
|
347
|
-
function Ye(e,
|
|
366
|
+
function Ye(e, n = "/") {
|
|
348
367
|
let {
|
|
349
|
-
pathname:
|
|
368
|
+
pathname: t,
|
|
350
369
|
search: a = "",
|
|
351
370
|
hash: r = ""
|
|
352
371
|
} = typeof e == "string" ? Y(e) : e;
|
|
353
372
|
return {
|
|
354
|
-
pathname:
|
|
373
|
+
pathname: t ? t.startsWith("/") ? t : Je(t, n) : n,
|
|
355
374
|
search: Ge(a),
|
|
356
375
|
hash: Xe(r)
|
|
357
376
|
};
|
|
358
377
|
}
|
|
359
|
-
function Je(e,
|
|
360
|
-
let
|
|
378
|
+
function Je(e, n) {
|
|
379
|
+
let t = n.replace(/\/+$/, "").split("/");
|
|
361
380
|
return e.split("/").forEach((r) => {
|
|
362
|
-
r === ".." ?
|
|
363
|
-
}),
|
|
381
|
+
r === ".." ? t.length > 1 && t.pop() : r !== "." && t.push(r);
|
|
382
|
+
}), t.length > 1 ? t.join("/") : "/";
|
|
364
383
|
}
|
|
365
|
-
function G(e,
|
|
366
|
-
return `Cannot include a '${e}' character in a manually specified \`to.${
|
|
384
|
+
function G(e, n, t, a) {
|
|
385
|
+
return `Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(
|
|
367
386
|
a
|
|
368
|
-
)}]. Please separate it out to the \`to.${
|
|
387
|
+
)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
369
388
|
}
|
|
370
389
|
function Ke(e) {
|
|
371
390
|
return e.filter(
|
|
372
|
-
(
|
|
391
|
+
(n, t) => t === 0 || n.route.path && n.route.path.length > 0
|
|
373
392
|
);
|
|
374
393
|
}
|
|
375
394
|
function Z(e) {
|
|
376
|
-
let
|
|
377
|
-
return
|
|
378
|
-
(
|
|
395
|
+
let n = Ke(e);
|
|
396
|
+
return n.map(
|
|
397
|
+
(t, a) => a === n.length - 1 ? t.pathname : t.pathnameBase
|
|
379
398
|
);
|
|
380
399
|
}
|
|
381
|
-
function ee(e,
|
|
400
|
+
function ee(e, n, t, a = !1) {
|
|
382
401
|
let r;
|
|
383
|
-
typeof e == "string" ? r = Y(e) : (r = { ...e },
|
|
402
|
+
typeof e == "string" ? r = Y(e) : (r = { ...e }, R(
|
|
384
403
|
!r.pathname || !r.pathname.includes("?"),
|
|
385
404
|
G("?", "pathname", "search", r)
|
|
386
|
-
),
|
|
405
|
+
), R(
|
|
387
406
|
!r.pathname || !r.pathname.includes("#"),
|
|
388
407
|
G("#", "pathname", "hash", r)
|
|
389
|
-
),
|
|
408
|
+
), R(
|
|
390
409
|
!r.search || !r.search.includes("#"),
|
|
391
410
|
G("#", "search", "hash", r)
|
|
392
411
|
));
|
|
393
|
-
let i = e === "" || r.pathname === "",
|
|
394
|
-
if (
|
|
395
|
-
|
|
412
|
+
let i = e === "" || r.pathname === "", s = i ? "/" : r.pathname, c;
|
|
413
|
+
if (s == null)
|
|
414
|
+
c = t;
|
|
396
415
|
else {
|
|
397
|
-
let
|
|
398
|
-
if (!a &&
|
|
399
|
-
let d =
|
|
416
|
+
let m = n.length - 1;
|
|
417
|
+
if (!a && s.startsWith("..")) {
|
|
418
|
+
let d = s.split("/");
|
|
400
419
|
for (; d[0] === ".."; )
|
|
401
|
-
d.shift(),
|
|
420
|
+
d.shift(), m -= 1;
|
|
402
421
|
r.pathname = d.join("/");
|
|
403
422
|
}
|
|
404
|
-
|
|
423
|
+
c = m >= 0 ? n[m] : "/";
|
|
405
424
|
}
|
|
406
|
-
let l = Ye(r,
|
|
407
|
-
return !l.pathname.endsWith("/") && (
|
|
408
|
-
}
|
|
409
|
-
var
|
|
410
|
-
let
|
|
411
|
-
typeof
|
|
412
|
-
let a = new Headers(
|
|
413
|
-
return a.set("Location", e), new Response(null, { ...
|
|
425
|
+
let l = Ye(r, c), u = s && s !== "/" && s.endsWith("/"), h = (i || s === ".") && t.endsWith("/");
|
|
426
|
+
return !l.pathname.endsWith("/") && (u || h) && (l.pathname += "/"), l;
|
|
427
|
+
}
|
|
428
|
+
var M = (e) => e.join("/").replace(/\/\/+/g, "/"), qe = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Ge = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Xe = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, ln = (e, n = 302) => {
|
|
429
|
+
let t = n;
|
|
430
|
+
typeof t == "number" ? t = { status: t } : typeof t.status > "u" && (t.status = 302);
|
|
431
|
+
let a = new Headers(t.headers);
|
|
432
|
+
return a.set("Location", e), new Response(null, { ...t, headers: a });
|
|
414
433
|
};
|
|
415
434
|
function we(e) {
|
|
416
435
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
@@ -459,42 +478,42 @@ var k = o.createContext({
|
|
|
459
478
|
k.displayName = "Route";
|
|
460
479
|
var ne = o.createContext(null);
|
|
461
480
|
ne.displayName = "RouteError";
|
|
462
|
-
function et(e, { relative:
|
|
463
|
-
|
|
481
|
+
function et(e, { relative: n } = {}) {
|
|
482
|
+
R(
|
|
464
483
|
I(),
|
|
465
484
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
466
485
|
// router loaded. We can help them understand how to avoid that.
|
|
467
486
|
"useHref() may be used only in the context of a <Router> component."
|
|
468
487
|
);
|
|
469
|
-
let { basename:
|
|
470
|
-
return
|
|
488
|
+
let { basename: t, navigator: a } = o.useContext(T), { hash: r, pathname: i, search: s } = H(e, { relative: n }), c = i;
|
|
489
|
+
return t !== "/" && (c = i === "/" ? t : M([t, i])), a.createHref({ pathname: c, search: s, hash: r });
|
|
471
490
|
}
|
|
472
491
|
function I() {
|
|
473
492
|
return o.useContext(K) != null;
|
|
474
493
|
}
|
|
475
494
|
function N() {
|
|
476
|
-
return
|
|
495
|
+
return R(
|
|
477
496
|
I(),
|
|
478
497
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
479
498
|
// router loaded. We can help them understand how to avoid that.
|
|
480
499
|
"useLocation() may be used only in the context of a <Router> component."
|
|
481
500
|
), o.useContext(K).location;
|
|
482
501
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
502
|
+
function sn(e) {
|
|
503
|
+
R(
|
|
485
504
|
I(),
|
|
486
505
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
487
506
|
// router loaded. We can help them understand how to avoid that.
|
|
488
507
|
"useMatch() may be used only in the context of a <Router> component."
|
|
489
508
|
);
|
|
490
|
-
let { pathname:
|
|
509
|
+
let { pathname: n } = N();
|
|
491
510
|
return o.useMemo(
|
|
492
|
-
() =>
|
|
493
|
-
[
|
|
511
|
+
() => B(e, ye(n)),
|
|
512
|
+
[n, e]
|
|
494
513
|
);
|
|
495
514
|
}
|
|
496
515
|
var xe = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
497
|
-
function
|
|
516
|
+
function be(e) {
|
|
498
517
|
o.useContext(T).static || o.useLayoutEffect(e);
|
|
499
518
|
}
|
|
500
519
|
function re() {
|
|
@@ -502,37 +521,37 @@ function re() {
|
|
|
502
521
|
return e ? ht() : tt();
|
|
503
522
|
}
|
|
504
523
|
function tt() {
|
|
505
|
-
|
|
524
|
+
R(
|
|
506
525
|
I(),
|
|
507
526
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
508
527
|
// router loaded. We can help them understand how to avoid that.
|
|
509
528
|
"useNavigate() may be used only in the context of a <Router> component."
|
|
510
529
|
);
|
|
511
|
-
let e = o.useContext(O), { basename:
|
|
512
|
-
return
|
|
513
|
-
|
|
530
|
+
let e = o.useContext(O), { basename: n, navigator: t } = o.useContext(T), { matches: a } = o.useContext(k), { pathname: r } = N(), i = JSON.stringify(Z(a)), s = o.useRef(!1);
|
|
531
|
+
return be(() => {
|
|
532
|
+
s.current = !0;
|
|
514
533
|
}), o.useCallback(
|
|
515
|
-
(l,
|
|
516
|
-
if (L(
|
|
534
|
+
(l, u = {}) => {
|
|
535
|
+
if (L(s.current, xe), !s.current) return;
|
|
517
536
|
if (typeof l == "number") {
|
|
518
|
-
|
|
537
|
+
t.go(l);
|
|
519
538
|
return;
|
|
520
539
|
}
|
|
521
540
|
let h = ee(
|
|
522
541
|
l,
|
|
523
542
|
JSON.parse(i),
|
|
524
543
|
r,
|
|
525
|
-
|
|
544
|
+
u.relative === "path"
|
|
526
545
|
);
|
|
527
|
-
e == null &&
|
|
546
|
+
e == null && n !== "/" && (h.pathname = h.pathname === "/" ? n : M([n, h.pathname])), (u.replace ? t.replace : t.push)(
|
|
528
547
|
h,
|
|
529
|
-
|
|
530
|
-
|
|
548
|
+
u.state,
|
|
549
|
+
u
|
|
531
550
|
);
|
|
532
551
|
},
|
|
533
552
|
[
|
|
534
|
-
t,
|
|
535
553
|
n,
|
|
554
|
+
t,
|
|
536
555
|
i,
|
|
537
556
|
r,
|
|
538
557
|
e
|
|
@@ -541,84 +560,84 @@ function tt() {
|
|
|
541
560
|
}
|
|
542
561
|
var nt = o.createContext(null);
|
|
543
562
|
function rt(e) {
|
|
544
|
-
let
|
|
545
|
-
return
|
|
563
|
+
let n = o.useContext(k).outlet;
|
|
564
|
+
return n && /* @__PURE__ */ o.createElement(nt.Provider, { value: e }, n);
|
|
546
565
|
}
|
|
547
|
-
function
|
|
548
|
-
let { matches: e } = o.useContext(k),
|
|
549
|
-
return
|
|
566
|
+
function un() {
|
|
567
|
+
let { matches: e } = o.useContext(k), n = e[e.length - 1];
|
|
568
|
+
return n ? n.params : {};
|
|
550
569
|
}
|
|
551
|
-
function
|
|
552
|
-
let { matches:
|
|
570
|
+
function H(e, { relative: n } = {}) {
|
|
571
|
+
let { matches: t } = o.useContext(k), { pathname: a } = N(), r = JSON.stringify(Z(t));
|
|
553
572
|
return o.useMemo(
|
|
554
573
|
() => ee(
|
|
555
574
|
e,
|
|
556
575
|
JSON.parse(r),
|
|
557
576
|
a,
|
|
558
|
-
|
|
577
|
+
n === "path"
|
|
559
578
|
),
|
|
560
|
-
[e, r, a,
|
|
579
|
+
[e, r, a, n]
|
|
561
580
|
);
|
|
562
581
|
}
|
|
563
|
-
function
|
|
564
|
-
|
|
582
|
+
function Re(e, n, t, a) {
|
|
583
|
+
R(
|
|
565
584
|
I(),
|
|
566
585
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
567
586
|
// router loaded. We can help them understand how to avoid that.
|
|
568
587
|
"useRoutes() may be used only in the context of a <Router> component."
|
|
569
588
|
);
|
|
570
|
-
let { navigator: r, static: i } = o.useContext(T), { matches:
|
|
589
|
+
let { navigator: r, static: i } = o.useContext(T), { matches: s } = o.useContext(k), c = s[s.length - 1], l = c ? c.params : {}, u = c ? c.pathname : "/", h = c ? c.pathnameBase : "/", m = c && c.route;
|
|
571
590
|
{
|
|
572
|
-
let
|
|
591
|
+
let v = m && m.path || "";
|
|
573
592
|
Se(
|
|
574
|
-
|
|
575
|
-
!
|
|
576
|
-
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${
|
|
593
|
+
u,
|
|
594
|
+
!m || v.endsWith("*") || v.endsWith("*?"),
|
|
595
|
+
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${v}">) 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.
|
|
577
596
|
|
|
578
|
-
Please change the parent <Route path="${
|
|
597
|
+
Please change the parent <Route path="${v}"> to <Route path="${v === "/" ? "*" : `${v}/*`}">.`
|
|
579
598
|
);
|
|
580
599
|
}
|
|
581
|
-
let d = N(),
|
|
582
|
-
|
|
583
|
-
let f =
|
|
600
|
+
let d = N(), g;
|
|
601
|
+
g = d;
|
|
602
|
+
let f = g.pathname || "/", w = f;
|
|
584
603
|
if (h !== "/") {
|
|
585
|
-
let
|
|
586
|
-
w = "/" + f.replace(/^\//, "").split("/").slice(
|
|
604
|
+
let v = h.replace(/^\//, "").split("/");
|
|
605
|
+
w = "/" + f.replace(/^\//, "").split("/").slice(v.length).join("/");
|
|
587
606
|
}
|
|
588
|
-
let E = !i &&
|
|
607
|
+
let E = !i && t && t.matches && t.matches.length > 0 ? t.matches : pe(e, { pathname: w });
|
|
589
608
|
return L(
|
|
590
|
-
|
|
591
|
-
`No routes matched location "${
|
|
609
|
+
m || E != null,
|
|
610
|
+
`No routes matched location "${g.pathname}${g.search}${g.hash}" `
|
|
592
611
|
), L(
|
|
593
612
|
E == null || E[E.length - 1].route.element !== void 0 || E[E.length - 1].route.Component !== void 0 || E[E.length - 1].route.lazy !== void 0,
|
|
594
|
-
`Matched leaf route at location "${
|
|
613
|
+
`Matched leaf route at location "${g.pathname}${g.search}${g.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.`
|
|
595
614
|
), st(
|
|
596
615
|
E && E.map(
|
|
597
|
-
(
|
|
598
|
-
params: Object.assign({}, l,
|
|
599
|
-
pathname:
|
|
616
|
+
(v) => Object.assign({}, v, {
|
|
617
|
+
params: Object.assign({}, l, v.params),
|
|
618
|
+
pathname: M([
|
|
600
619
|
h,
|
|
601
620
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
602
|
-
r.encodeLocation ? r.encodeLocation(
|
|
621
|
+
r.encodeLocation ? r.encodeLocation(v.pathname).pathname : v.pathname
|
|
603
622
|
]),
|
|
604
|
-
pathnameBase:
|
|
623
|
+
pathnameBase: v.pathnameBase === "/" ? h : M([
|
|
605
624
|
h,
|
|
606
625
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
607
|
-
r.encodeLocation ? r.encodeLocation(
|
|
626
|
+
r.encodeLocation ? r.encodeLocation(v.pathnameBase).pathname : v.pathnameBase
|
|
608
627
|
])
|
|
609
628
|
})
|
|
610
629
|
),
|
|
611
|
-
|
|
612
|
-
|
|
630
|
+
s,
|
|
631
|
+
t,
|
|
613
632
|
a
|
|
614
633
|
);
|
|
615
634
|
}
|
|
616
635
|
function at() {
|
|
617
|
-
let e = dt(),
|
|
636
|
+
let e = dt(), n = we(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), t = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: a }, i = { padding: "2px 4px", backgroundColor: a }, s = null;
|
|
618
637
|
return console.error(
|
|
619
638
|
"Error handled by React Router default ErrorBoundary:",
|
|
620
639
|
e
|
|
621
|
-
),
|
|
640
|
+
), s = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ o.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ o.createElement("code", { style: i }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ o.createElement("code", { style: i }, "errorElement"), " prop on your route.")), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ o.createElement("h3", { style: { fontStyle: "italic" } }, n), t ? /* @__PURE__ */ o.createElement("pre", { style: r }, t) : null, s);
|
|
622
641
|
}
|
|
623
642
|
var it = /* @__PURE__ */ o.createElement(at, null), ot = class extends o.Component {
|
|
624
643
|
constructor(e) {
|
|
@@ -631,22 +650,22 @@ var it = /* @__PURE__ */ o.createElement(at, null), ot = class extends o.Compone
|
|
|
631
650
|
static getDerivedStateFromError(e) {
|
|
632
651
|
return { error: e };
|
|
633
652
|
}
|
|
634
|
-
static getDerivedStateFromProps(e,
|
|
635
|
-
return
|
|
653
|
+
static getDerivedStateFromProps(e, n) {
|
|
654
|
+
return n.location !== e.location || n.revalidation !== "idle" && e.revalidation === "idle" ? {
|
|
636
655
|
error: e.error,
|
|
637
656
|
location: e.location,
|
|
638
657
|
revalidation: e.revalidation
|
|
639
658
|
} : {
|
|
640
|
-
error: e.error !== void 0 ? e.error :
|
|
641
|
-
location:
|
|
642
|
-
revalidation: e.revalidation ||
|
|
659
|
+
error: e.error !== void 0 ? e.error : n.error,
|
|
660
|
+
location: n.location,
|
|
661
|
+
revalidation: e.revalidation || n.revalidation
|
|
643
662
|
};
|
|
644
663
|
}
|
|
645
|
-
componentDidCatch(e,
|
|
664
|
+
componentDidCatch(e, n) {
|
|
646
665
|
console.error(
|
|
647
666
|
"React Router caught the following error during render",
|
|
648
667
|
e,
|
|
649
|
-
|
|
668
|
+
n
|
|
650
669
|
);
|
|
651
670
|
}
|
|
652
671
|
render() {
|
|
@@ -659,27 +678,27 @@ var it = /* @__PURE__ */ o.createElement(at, null), ot = class extends o.Compone
|
|
|
659
678
|
)) : this.props.children;
|
|
660
679
|
}
|
|
661
680
|
};
|
|
662
|
-
function lt({ routeContext: e, match:
|
|
681
|
+
function lt({ routeContext: e, match: n, children: t }) {
|
|
663
682
|
let a = o.useContext(O);
|
|
664
|
-
return a && a.static && a.staticContext && (
|
|
683
|
+
return a && a.static && a.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ o.createElement(k.Provider, { value: e }, t);
|
|
665
684
|
}
|
|
666
|
-
function st(e,
|
|
685
|
+
function st(e, n = [], t = null, a = null) {
|
|
667
686
|
if (e == null) {
|
|
668
|
-
if (!
|
|
687
|
+
if (!t)
|
|
669
688
|
return null;
|
|
670
|
-
if (
|
|
671
|
-
e =
|
|
672
|
-
else if (
|
|
673
|
-
e =
|
|
689
|
+
if (t.errors)
|
|
690
|
+
e = t.matches;
|
|
691
|
+
else if (n.length === 0 && !t.initialized && t.matches.length > 0)
|
|
692
|
+
e = t.matches;
|
|
674
693
|
else
|
|
675
694
|
return null;
|
|
676
695
|
}
|
|
677
|
-
let r = e, i =
|
|
696
|
+
let r = e, i = t == null ? void 0 : t.errors;
|
|
678
697
|
if (i != null) {
|
|
679
698
|
let l = r.findIndex(
|
|
680
|
-
(
|
|
699
|
+
(u) => u.route.id && (i == null ? void 0 : i[u.route.id]) !== void 0
|
|
681
700
|
);
|
|
682
|
-
|
|
701
|
+
R(
|
|
683
702
|
l >= 0,
|
|
684
703
|
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
685
704
|
i
|
|
@@ -689,47 +708,47 @@ function st(e, t = [], n = null, a = null) {
|
|
|
689
708
|
Math.min(r.length, l + 1)
|
|
690
709
|
);
|
|
691
710
|
}
|
|
692
|
-
let
|
|
693
|
-
if (
|
|
711
|
+
let s = !1, c = -1;
|
|
712
|
+
if (t)
|
|
694
713
|
for (let l = 0; l < r.length; l++) {
|
|
695
|
-
let
|
|
696
|
-
if ((
|
|
697
|
-
let { loaderData: h, errors:
|
|
698
|
-
if (
|
|
699
|
-
|
|
714
|
+
let u = r[l];
|
|
715
|
+
if ((u.route.HydrateFallback || u.route.hydrateFallbackElement) && (c = l), u.route.id) {
|
|
716
|
+
let { loaderData: h, errors: m } = t, d = u.route.loader && !h.hasOwnProperty(u.route.id) && (!m || m[u.route.id] === void 0);
|
|
717
|
+
if (u.route.lazy || d) {
|
|
718
|
+
s = !0, c >= 0 ? r = r.slice(0, c + 1) : r = [r[0]];
|
|
700
719
|
break;
|
|
701
720
|
}
|
|
702
721
|
}
|
|
703
722
|
}
|
|
704
|
-
return r.reduceRight((l,
|
|
705
|
-
let
|
|
706
|
-
|
|
723
|
+
return r.reduceRight((l, u, h) => {
|
|
724
|
+
let m, d = !1, g = null, f = null;
|
|
725
|
+
t && (m = i && u.route.id ? i[u.route.id] : void 0, g = u.route.errorElement || it, s && (c < 0 && h === 0 ? (Se(
|
|
707
726
|
"route-fallback",
|
|
708
727
|
!1,
|
|
709
728
|
"No `HydrateFallback` element provided to render during initial hydration"
|
|
710
|
-
), d = !0, f = null) :
|
|
711
|
-
let w =
|
|
712
|
-
let
|
|
713
|
-
return
|
|
729
|
+
), d = !0, f = null) : c === h && (d = !0, f = u.route.hydrateFallbackElement || null)));
|
|
730
|
+
let w = n.concat(r.slice(0, h + 1)), E = () => {
|
|
731
|
+
let p;
|
|
732
|
+
return m ? p = g : d ? p = f : u.route.Component ? p = /* @__PURE__ */ o.createElement(u.route.Component, null) : u.route.element ? p = u.route.element : p = l, /* @__PURE__ */ o.createElement(
|
|
714
733
|
lt,
|
|
715
734
|
{
|
|
716
|
-
match:
|
|
735
|
+
match: u,
|
|
717
736
|
routeContext: {
|
|
718
737
|
outlet: l,
|
|
719
738
|
matches: w,
|
|
720
|
-
isDataRoute:
|
|
739
|
+
isDataRoute: t != null
|
|
721
740
|
},
|
|
722
|
-
children:
|
|
741
|
+
children: p
|
|
723
742
|
}
|
|
724
743
|
);
|
|
725
744
|
};
|
|
726
|
-
return
|
|
745
|
+
return t && (u.route.ErrorBoundary || u.route.errorElement || h === 0) ? /* @__PURE__ */ o.createElement(
|
|
727
746
|
ot,
|
|
728
747
|
{
|
|
729
|
-
location:
|
|
730
|
-
revalidation:
|
|
731
|
-
component:
|
|
732
|
-
error:
|
|
748
|
+
location: t.location,
|
|
749
|
+
revalidation: t.revalidation,
|
|
750
|
+
component: g,
|
|
751
|
+
error: m,
|
|
733
752
|
children: E(),
|
|
734
753
|
routeContext: { outlet: null, matches: w, isDataRoute: !0 }
|
|
735
754
|
}
|
|
@@ -740,23 +759,23 @@ function ae(e) {
|
|
|
740
759
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
741
760
|
}
|
|
742
761
|
function ut(e) {
|
|
743
|
-
let
|
|
744
|
-
return
|
|
762
|
+
let n = o.useContext(O);
|
|
763
|
+
return R(n, ae(e)), n;
|
|
745
764
|
}
|
|
746
765
|
function Ce(e) {
|
|
747
|
-
let
|
|
748
|
-
return
|
|
766
|
+
let n = o.useContext(_);
|
|
767
|
+
return R(n, ae(e)), n;
|
|
749
768
|
}
|
|
750
769
|
function ct(e) {
|
|
751
|
-
let
|
|
752
|
-
return
|
|
770
|
+
let n = o.useContext(k);
|
|
771
|
+
return R(n, ae(e)), n;
|
|
753
772
|
}
|
|
754
773
|
function ie(e) {
|
|
755
|
-
let
|
|
756
|
-
return
|
|
757
|
-
|
|
774
|
+
let n = ct(e), t = n.matches[n.matches.length - 1];
|
|
775
|
+
return R(
|
|
776
|
+
t.route.id,
|
|
758
777
|
`${e} can only be used on routes that contain a unique "id"`
|
|
759
|
-
),
|
|
778
|
+
), t.route.id;
|
|
760
779
|
}
|
|
761
780
|
function ft() {
|
|
762
781
|
return ie(
|
|
@@ -764,7 +783,7 @@ function ft() {
|
|
|
764
783
|
/* UseRouteId */
|
|
765
784
|
);
|
|
766
785
|
}
|
|
767
|
-
function
|
|
786
|
+
function cn() {
|
|
768
787
|
return Ce(
|
|
769
788
|
"useNavigation"
|
|
770
789
|
/* UseNavigation */
|
|
@@ -772,63 +791,63 @@ function un() {
|
|
|
772
791
|
}
|
|
773
792
|
function dt() {
|
|
774
793
|
var a;
|
|
775
|
-
let e = o.useContext(ne),
|
|
794
|
+
let e = o.useContext(ne), n = Ce(
|
|
776
795
|
"useRouteError"
|
|
777
796
|
/* UseRouteError */
|
|
778
|
-
),
|
|
797
|
+
), t = ie(
|
|
779
798
|
"useRouteError"
|
|
780
799
|
/* UseRouteError */
|
|
781
800
|
);
|
|
782
|
-
return e !== void 0 ? e : (a =
|
|
801
|
+
return e !== void 0 ? e : (a = n.errors) == null ? void 0 : a[t];
|
|
783
802
|
}
|
|
784
803
|
function ht() {
|
|
785
804
|
let { router: e } = ut(
|
|
786
805
|
"useNavigate"
|
|
787
806
|
/* UseNavigateStable */
|
|
788
|
-
),
|
|
807
|
+
), n = ie(
|
|
789
808
|
"useNavigate"
|
|
790
809
|
/* UseNavigateStable */
|
|
791
|
-
),
|
|
792
|
-
return
|
|
793
|
-
|
|
810
|
+
), t = o.useRef(!1);
|
|
811
|
+
return be(() => {
|
|
812
|
+
t.current = !0;
|
|
794
813
|
}), o.useCallback(
|
|
795
814
|
async (r, i = {}) => {
|
|
796
|
-
L(
|
|
815
|
+
L(t.current, xe), t.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: n, ...i }));
|
|
797
816
|
},
|
|
798
|
-
[e,
|
|
817
|
+
[e, n]
|
|
799
818
|
);
|
|
800
819
|
}
|
|
801
820
|
var fe = {};
|
|
802
|
-
function Se(e,
|
|
803
|
-
!
|
|
821
|
+
function Se(e, n, t) {
|
|
822
|
+
!n && !fe[e] && (fe[e] = !0, L(!1, t));
|
|
804
823
|
}
|
|
805
824
|
var de = {};
|
|
806
|
-
function he(e,
|
|
807
|
-
!e && !de[
|
|
825
|
+
function he(e, n) {
|
|
826
|
+
!e && !de[n] && (de[n] = !0, console.warn(n));
|
|
808
827
|
}
|
|
809
828
|
var mt = class {
|
|
810
829
|
constructor() {
|
|
811
|
-
this.status = "pending", this.promise = new Promise((e,
|
|
812
|
-
this.resolve = (
|
|
813
|
-
this.status === "pending" && (this.status = "resolved", e(
|
|
814
|
-
}, this.reject = (
|
|
815
|
-
this.status === "pending" && (this.status = "rejected", t
|
|
830
|
+
this.status = "pending", this.promise = new Promise((e, n) => {
|
|
831
|
+
this.resolve = (t) => {
|
|
832
|
+
this.status === "pending" && (this.status = "resolved", e(t));
|
|
833
|
+
}, this.reject = (t) => {
|
|
834
|
+
this.status === "pending" && (this.status = "rejected", n(t));
|
|
816
835
|
};
|
|
817
836
|
});
|
|
818
837
|
}
|
|
819
838
|
};
|
|
820
|
-
function
|
|
839
|
+
function fn({
|
|
821
840
|
router: e,
|
|
822
|
-
flushSync:
|
|
841
|
+
flushSync: n
|
|
823
842
|
}) {
|
|
824
|
-
let [
|
|
843
|
+
let [t, a] = o.useState(e.state), [r, i] = o.useState(), [s, c] = o.useState({
|
|
825
844
|
isTransitioning: !1
|
|
826
|
-
}), [l,
|
|
827
|
-
(y, { deletedFetchers:
|
|
845
|
+
}), [l, u] = o.useState(), [h, m] = o.useState(), [d, g] = o.useState(), f = o.useRef(/* @__PURE__ */ new Map()), w = o.useCallback(
|
|
846
|
+
(y, { deletedFetchers: b, flushSync: x, viewTransitionOpts: C }) => {
|
|
828
847
|
y.fetchers.forEach((S, P) => {
|
|
829
848
|
S.data !== void 0 && f.current.set(P, S.data);
|
|
830
|
-
}),
|
|
831
|
-
x === !1 ||
|
|
849
|
+
}), b.forEach((S) => f.current.delete(S)), he(
|
|
850
|
+
x === !1 || n != null,
|
|
832
851
|
'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.'
|
|
833
852
|
);
|
|
834
853
|
let $ = e.window != null && e.window.document != null && typeof e.window.document.startViewTransition == "function";
|
|
@@ -836,12 +855,12 @@ function cn({
|
|
|
836
855
|
C == null || $,
|
|
837
856
|
"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."
|
|
838
857
|
), !C || !$) {
|
|
839
|
-
|
|
858
|
+
n && x ? n(() => a(y)) : o.startTransition(() => a(y));
|
|
840
859
|
return;
|
|
841
860
|
}
|
|
842
|
-
if (
|
|
843
|
-
|
|
844
|
-
h && (l && l.resolve(), h.skipTransition()),
|
|
861
|
+
if (n && x) {
|
|
862
|
+
n(() => {
|
|
863
|
+
h && (l && l.resolve(), h.skipTransition()), c({
|
|
845
864
|
isTransitioning: !0,
|
|
846
865
|
flushSync: !0,
|
|
847
866
|
currentLocation: C.currentLocation,
|
|
@@ -849,77 +868,77 @@ function cn({
|
|
|
849
868
|
});
|
|
850
869
|
});
|
|
851
870
|
let S = e.window.document.startViewTransition(() => {
|
|
852
|
-
|
|
871
|
+
n(() => a(y));
|
|
853
872
|
});
|
|
854
873
|
S.finished.finally(() => {
|
|
855
|
-
|
|
856
|
-
|
|
874
|
+
n(() => {
|
|
875
|
+
u(void 0), m(void 0), i(void 0), c({ isTransitioning: !1 });
|
|
857
876
|
});
|
|
858
|
-
}),
|
|
877
|
+
}), n(() => m(S));
|
|
859
878
|
return;
|
|
860
879
|
}
|
|
861
|
-
h ? (l && l.resolve(), h.skipTransition(),
|
|
880
|
+
h ? (l && l.resolve(), h.skipTransition(), g({
|
|
862
881
|
state: y,
|
|
863
882
|
currentLocation: C.currentLocation,
|
|
864
883
|
nextLocation: C.nextLocation
|
|
865
|
-
})) : (i(y),
|
|
884
|
+
})) : (i(y), c({
|
|
866
885
|
isTransitioning: !0,
|
|
867
886
|
flushSync: !1,
|
|
868
887
|
currentLocation: C.currentLocation,
|
|
869
888
|
nextLocation: C.nextLocation
|
|
870
889
|
}));
|
|
871
890
|
},
|
|
872
|
-
[e.window,
|
|
891
|
+
[e.window, n, h, l]
|
|
873
892
|
);
|
|
874
893
|
o.useLayoutEffect(() => e.subscribe(w), [e, w]), o.useEffect(() => {
|
|
875
|
-
|
|
876
|
-
}, [
|
|
894
|
+
s.isTransitioning && !s.flushSync && u(new mt());
|
|
895
|
+
}, [s]), o.useEffect(() => {
|
|
877
896
|
if (l && r && e.window) {
|
|
878
|
-
let y = r,
|
|
879
|
-
o.startTransition(() => a(y)), await
|
|
897
|
+
let y = r, b = l.promise, x = e.window.document.startViewTransition(async () => {
|
|
898
|
+
o.startTransition(() => a(y)), await b;
|
|
880
899
|
});
|
|
881
900
|
x.finished.finally(() => {
|
|
882
|
-
|
|
883
|
-
}),
|
|
901
|
+
u(void 0), m(void 0), i(void 0), c({ isTransitioning: !1 });
|
|
902
|
+
}), m(x);
|
|
884
903
|
}
|
|
885
904
|
}, [r, l, e.window]), o.useEffect(() => {
|
|
886
|
-
l && r &&
|
|
887
|
-
}, [l, h,
|
|
888
|
-
!
|
|
905
|
+
l && r && t.location.key === r.location.key && l.resolve();
|
|
906
|
+
}, [l, h, t.location, r]), o.useEffect(() => {
|
|
907
|
+
!s.isTransitioning && d && (i(d.state), c({
|
|
889
908
|
isTransitioning: !0,
|
|
890
909
|
flushSync: !1,
|
|
891
910
|
currentLocation: d.currentLocation,
|
|
892
911
|
nextLocation: d.nextLocation
|
|
893
|
-
}),
|
|
894
|
-
}, [
|
|
912
|
+
}), g(void 0));
|
|
913
|
+
}, [s.isTransitioning, d]);
|
|
895
914
|
let E = o.useMemo(() => ({
|
|
896
915
|
createHref: e.createHref,
|
|
897
916
|
encodeLocation: e.encodeLocation,
|
|
898
917
|
go: (y) => e.navigate(y),
|
|
899
|
-
push: (y,
|
|
900
|
-
state:
|
|
918
|
+
push: (y, b, x) => e.navigate(y, {
|
|
919
|
+
state: b,
|
|
901
920
|
preventScrollReset: x == null ? void 0 : x.preventScrollReset
|
|
902
921
|
}),
|
|
903
|
-
replace: (y,
|
|
922
|
+
replace: (y, b, x) => e.navigate(y, {
|
|
904
923
|
replace: !0,
|
|
905
|
-
state:
|
|
924
|
+
state: b,
|
|
906
925
|
preventScrollReset: x == null ? void 0 : x.preventScrollReset
|
|
907
926
|
})
|
|
908
|
-
}), [e]),
|
|
927
|
+
}), [e]), p = e.basename || "/", v = o.useMemo(
|
|
909
928
|
() => ({
|
|
910
929
|
router: e,
|
|
911
930
|
navigator: E,
|
|
912
931
|
static: !1,
|
|
913
|
-
basename:
|
|
932
|
+
basename: p
|
|
914
933
|
}),
|
|
915
|
-
[e, E,
|
|
934
|
+
[e, E, p]
|
|
916
935
|
);
|
|
917
|
-
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(O.Provider, { value:
|
|
936
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(O.Provider, { value: v }, /* @__PURE__ */ o.createElement(_.Provider, { value: t }, /* @__PURE__ */ o.createElement(te.Provider, { value: f.current }, /* @__PURE__ */ o.createElement(J.Provider, { value: s }, /* @__PURE__ */ o.createElement(
|
|
918
937
|
Pe,
|
|
919
938
|
{
|
|
920
|
-
basename:
|
|
921
|
-
location:
|
|
922
|
-
navigationType:
|
|
939
|
+
basename: p,
|
|
940
|
+
location: t.location,
|
|
941
|
+
navigationType: t.historyAction,
|
|
923
942
|
navigator: E
|
|
924
943
|
},
|
|
925
944
|
/* @__PURE__ */ o.createElement(
|
|
@@ -927,26 +946,26 @@ function cn({
|
|
|
927
946
|
{
|
|
928
947
|
routes: e.routes,
|
|
929
948
|
future: e.future,
|
|
930
|
-
state:
|
|
949
|
+
state: t
|
|
931
950
|
}
|
|
932
951
|
)
|
|
933
952
|
))))), null);
|
|
934
953
|
}
|
|
935
|
-
var pt = o.memo(
|
|
936
|
-
function
|
|
954
|
+
var pt = o.memo(gt);
|
|
955
|
+
function gt({
|
|
937
956
|
routes: e,
|
|
938
|
-
future:
|
|
939
|
-
state:
|
|
957
|
+
future: n,
|
|
958
|
+
state: t
|
|
940
959
|
}) {
|
|
941
|
-
return
|
|
960
|
+
return Re(e, void 0, t, n);
|
|
942
961
|
}
|
|
943
|
-
function
|
|
962
|
+
function dn({
|
|
944
963
|
to: e,
|
|
945
|
-
replace:
|
|
946
|
-
state:
|
|
964
|
+
replace: n,
|
|
965
|
+
state: t,
|
|
947
966
|
relative: a
|
|
948
967
|
}) {
|
|
949
|
-
|
|
968
|
+
R(
|
|
950
969
|
I(),
|
|
951
970
|
// TODO: This error is probably because they somehow have 2 versions of
|
|
952
971
|
// the router loaded. We can help them understand how to avoid that.
|
|
@@ -957,70 +976,70 @@ function fn({
|
|
|
957
976
|
!r,
|
|
958
977
|
"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change."
|
|
959
978
|
);
|
|
960
|
-
let { matches: i } = o.useContext(k), { pathname:
|
|
979
|
+
let { matches: i } = o.useContext(k), { pathname: s } = N(), c = re(), l = ee(
|
|
961
980
|
e,
|
|
962
981
|
Z(i),
|
|
963
|
-
|
|
982
|
+
s,
|
|
964
983
|
a === "path"
|
|
965
|
-
),
|
|
984
|
+
), u = JSON.stringify(l);
|
|
966
985
|
return o.useEffect(() => {
|
|
967
|
-
|
|
968
|
-
}, [
|
|
986
|
+
c(JSON.parse(u), { replace: n, state: t, relative: a });
|
|
987
|
+
}, [c, u, a, n, t]), null;
|
|
969
988
|
}
|
|
970
|
-
function
|
|
989
|
+
function hn(e) {
|
|
971
990
|
return rt(e.context);
|
|
972
991
|
}
|
|
973
992
|
function Pe({
|
|
974
993
|
basename: e = "/",
|
|
975
|
-
children:
|
|
976
|
-
location:
|
|
994
|
+
children: n = null,
|
|
995
|
+
location: t,
|
|
977
996
|
navigationType: a = "POP",
|
|
978
997
|
navigator: r,
|
|
979
998
|
static: i = !1
|
|
980
999
|
}) {
|
|
981
|
-
|
|
1000
|
+
R(
|
|
982
1001
|
!I(),
|
|
983
1002
|
"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
|
|
984
1003
|
);
|
|
985
|
-
let
|
|
1004
|
+
let s = e.replace(/^\/*/, "/"), c = o.useMemo(
|
|
986
1005
|
() => ({
|
|
987
|
-
basename:
|
|
1006
|
+
basename: s,
|
|
988
1007
|
navigator: r,
|
|
989
1008
|
static: i,
|
|
990
1009
|
future: {}
|
|
991
1010
|
}),
|
|
992
|
-
[
|
|
1011
|
+
[s, r, i]
|
|
993
1012
|
);
|
|
994
|
-
typeof
|
|
1013
|
+
typeof t == "string" && (t = Y(t));
|
|
995
1014
|
let {
|
|
996
1015
|
pathname: l = "/",
|
|
997
|
-
search:
|
|
1016
|
+
search: u = "",
|
|
998
1017
|
hash: h = "",
|
|
999
|
-
state:
|
|
1018
|
+
state: m = null,
|
|
1000
1019
|
key: d = "default"
|
|
1001
|
-
} =
|
|
1002
|
-
let f =
|
|
1020
|
+
} = t, g = o.useMemo(() => {
|
|
1021
|
+
let f = A(l, s);
|
|
1003
1022
|
return f == null ? null : {
|
|
1004
1023
|
location: {
|
|
1005
1024
|
pathname: f,
|
|
1006
|
-
search:
|
|
1025
|
+
search: u,
|
|
1007
1026
|
hash: h,
|
|
1008
|
-
state:
|
|
1027
|
+
state: m,
|
|
1009
1028
|
key: d
|
|
1010
1029
|
},
|
|
1011
1030
|
navigationType: a
|
|
1012
1031
|
};
|
|
1013
|
-
}, [
|
|
1032
|
+
}, [s, l, u, h, m, d, a]);
|
|
1014
1033
|
return L(
|
|
1015
|
-
|
|
1016
|
-
`<Router basename="${
|
|
1017
|
-
),
|
|
1034
|
+
g != null,
|
|
1035
|
+
`<Router basename="${s}"> is not able to match the URL "${l}${u}${h}" because it does not start with the basename, so the <Router> won't render anything.`
|
|
1036
|
+
), g == null ? null : /* @__PURE__ */ o.createElement(T.Provider, { value: c }, /* @__PURE__ */ o.createElement(K.Provider, { children: n, value: g }));
|
|
1018
1037
|
}
|
|
1019
|
-
var
|
|
1038
|
+
var j = "get", V = "application/x-www-form-urlencoded";
|
|
1020
1039
|
function q(e) {
|
|
1021
1040
|
return e != null && typeof e.tagName == "string";
|
|
1022
1041
|
}
|
|
1023
|
-
function
|
|
1042
|
+
function vt(e) {
|
|
1024
1043
|
return q(e) && e.tagName.toLowerCase() === "button";
|
|
1025
1044
|
}
|
|
1026
1045
|
function yt(e) {
|
|
@@ -1032,31 +1051,31 @@ function wt(e) {
|
|
|
1032
1051
|
function Et(e) {
|
|
1033
1052
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
1034
1053
|
}
|
|
1035
|
-
function xt(e,
|
|
1054
|
+
function xt(e, n) {
|
|
1036
1055
|
return e.button === 0 && // Ignore everything but left clicks
|
|
1037
|
-
(!
|
|
1056
|
+
(!n || n === "_self") && // Let browser handle "target=_blank" etc.
|
|
1038
1057
|
!Et(e);
|
|
1039
1058
|
}
|
|
1040
1059
|
function Q(e = "") {
|
|
1041
1060
|
return new URLSearchParams(
|
|
1042
|
-
typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((
|
|
1043
|
-
let a = e[
|
|
1044
|
-
return
|
|
1045
|
-
Array.isArray(a) ? a.map((r) => [
|
|
1061
|
+
typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((n, t) => {
|
|
1062
|
+
let a = e[t];
|
|
1063
|
+
return n.concat(
|
|
1064
|
+
Array.isArray(a) ? a.map((r) => [t, r]) : [[t, a]]
|
|
1046
1065
|
);
|
|
1047
1066
|
}, [])
|
|
1048
1067
|
);
|
|
1049
1068
|
}
|
|
1050
|
-
function
|
|
1051
|
-
let
|
|
1052
|
-
return
|
|
1053
|
-
|
|
1054
|
-
|
|
1069
|
+
function bt(e, n) {
|
|
1070
|
+
let t = Q(e);
|
|
1071
|
+
return n && n.forEach((a, r) => {
|
|
1072
|
+
t.has(r) || n.getAll(r).forEach((i) => {
|
|
1073
|
+
t.append(r, i);
|
|
1055
1074
|
});
|
|
1056
|
-
}),
|
|
1075
|
+
}), t;
|
|
1057
1076
|
}
|
|
1058
1077
|
var z = null;
|
|
1059
|
-
function
|
|
1078
|
+
function Rt() {
|
|
1060
1079
|
if (z === null)
|
|
1061
1080
|
try {
|
|
1062
1081
|
new FormData(
|
|
@@ -1077,96 +1096,96 @@ var Ct = /* @__PURE__ */ new Set([
|
|
|
1077
1096
|
function X(e) {
|
|
1078
1097
|
return e != null && !Ct.has(e) ? (L(
|
|
1079
1098
|
!1,
|
|
1080
|
-
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${
|
|
1099
|
+
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${V}"`
|
|
1081
1100
|
), null) : e;
|
|
1082
1101
|
}
|
|
1083
|
-
function St(e,
|
|
1084
|
-
let
|
|
1102
|
+
function St(e, n) {
|
|
1103
|
+
let t, a, r, i, s;
|
|
1085
1104
|
if (yt(e)) {
|
|
1086
|
-
let
|
|
1087
|
-
a =
|
|
1088
|
-
} else if (
|
|
1089
|
-
let
|
|
1090
|
-
if (
|
|
1105
|
+
let c = e.getAttribute("action");
|
|
1106
|
+
a = c ? A(c, n) : null, t = e.getAttribute("method") || j, r = X(e.getAttribute("enctype")) || V, i = new FormData(e);
|
|
1107
|
+
} else if (vt(e) || wt(e) && (e.type === "submit" || e.type === "image")) {
|
|
1108
|
+
let c = e.form;
|
|
1109
|
+
if (c == null)
|
|
1091
1110
|
throw new Error(
|
|
1092
1111
|
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
1093
1112
|
);
|
|
1094
|
-
let l = e.getAttribute("formaction") ||
|
|
1095
|
-
if (a = l ?
|
|
1096
|
-
let { name:
|
|
1113
|
+
let l = e.getAttribute("formaction") || c.getAttribute("action");
|
|
1114
|
+
if (a = l ? A(l, n) : null, t = e.getAttribute("formmethod") || c.getAttribute("method") || j, r = X(e.getAttribute("formenctype")) || X(c.getAttribute("enctype")) || V, i = new FormData(c, e), !Rt()) {
|
|
1115
|
+
let { name: u, type: h, value: m } = e;
|
|
1097
1116
|
if (h === "image") {
|
|
1098
|
-
let d =
|
|
1117
|
+
let d = u ? `${u}.` : "";
|
|
1099
1118
|
i.append(`${d}x`, "0"), i.append(`${d}y`, "0");
|
|
1100
|
-
} else
|
|
1119
|
+
} else u && i.append(u, m);
|
|
1101
1120
|
}
|
|
1102
1121
|
} else {
|
|
1103
1122
|
if (q(e))
|
|
1104
1123
|
throw new Error(
|
|
1105
1124
|
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
1106
1125
|
);
|
|
1107
|
-
|
|
1126
|
+
t = j, a = null, r = V, s = e;
|
|
1108
1127
|
}
|
|
1109
|
-
return i && r === "text/plain" && (
|
|
1128
|
+
return i && r === "text/plain" && (s = i, i = void 0), { action: a, method: t.toLowerCase(), encType: r, formData: i, body: s };
|
|
1110
1129
|
}
|
|
1111
|
-
function oe(e,
|
|
1130
|
+
function oe(e, n) {
|
|
1112
1131
|
if (e === !1 || e === null || typeof e > "u")
|
|
1113
|
-
throw new Error(
|
|
1132
|
+
throw new Error(n);
|
|
1114
1133
|
}
|
|
1115
|
-
async function Pt(e,
|
|
1116
|
-
if (e.id in
|
|
1117
|
-
return
|
|
1134
|
+
async function Pt(e, n) {
|
|
1135
|
+
if (e.id in n)
|
|
1136
|
+
return n[e.id];
|
|
1118
1137
|
try {
|
|
1119
|
-
let
|
|
1138
|
+
let t = await import(
|
|
1120
1139
|
/* @vite-ignore */
|
|
1121
1140
|
/* webpackIgnore: true */
|
|
1122
1141
|
e.module
|
|
1123
1142
|
);
|
|
1124
|
-
return
|
|
1125
|
-
} catch (
|
|
1143
|
+
return n[e.id] = t, t;
|
|
1144
|
+
} catch (t) {
|
|
1126
1145
|
return console.error(
|
|
1127
1146
|
`Error loading route module \`${e.module}\`, reloading page...`
|
|
1128
|
-
), console.error(
|
|
1147
|
+
), console.error(t), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
|
|
1129
1148
|
});
|
|
1130
1149
|
}
|
|
1131
1150
|
}
|
|
1132
1151
|
function Lt(e) {
|
|
1133
1152
|
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";
|
|
1134
1153
|
}
|
|
1135
|
-
async function kt(e,
|
|
1154
|
+
async function kt(e, n, t) {
|
|
1136
1155
|
let a = await Promise.all(
|
|
1137
1156
|
e.map(async (r) => {
|
|
1138
|
-
let i =
|
|
1157
|
+
let i = n.routes[r.route.id];
|
|
1139
1158
|
if (i) {
|
|
1140
|
-
let
|
|
1141
|
-
return
|
|
1159
|
+
let s = await Pt(i, t);
|
|
1160
|
+
return s.links ? s.links() : [];
|
|
1142
1161
|
}
|
|
1143
1162
|
return [];
|
|
1144
1163
|
})
|
|
1145
1164
|
);
|
|
1146
|
-
return
|
|
1165
|
+
return Mt(
|
|
1147
1166
|
a.flat(1).filter(Lt).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
|
|
1148
1167
|
(r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
|
|
1149
1168
|
)
|
|
1150
1169
|
);
|
|
1151
1170
|
}
|
|
1152
|
-
function me(e,
|
|
1153
|
-
let
|
|
1171
|
+
function me(e, n, t, a, r, i) {
|
|
1172
|
+
let s = (l, u) => t[u] ? l.route.id !== t[u].route.id : !0, c = (l, u) => {
|
|
1154
1173
|
var h;
|
|
1155
1174
|
return (
|
|
1156
1175
|
// param change, /users/123 -> /users/456
|
|
1157
|
-
|
|
1176
|
+
t[u].pathname !== l.pathname || // splat param changed, which is not present in match.path
|
|
1158
1177
|
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
1159
|
-
((h =
|
|
1178
|
+
((h = t[u].route.path) == null ? void 0 : h.endsWith("*")) && t[u].params["*"] !== l.params["*"]
|
|
1160
1179
|
);
|
|
1161
1180
|
};
|
|
1162
|
-
return i === "assets" ?
|
|
1163
|
-
(l,
|
|
1164
|
-
) : i === "data" ?
|
|
1165
|
-
var
|
|
1181
|
+
return i === "assets" ? n.filter(
|
|
1182
|
+
(l, u) => s(l, u) || c(l, u)
|
|
1183
|
+
) : i === "data" ? n.filter((l, u) => {
|
|
1184
|
+
var m;
|
|
1166
1185
|
let h = a.routes[l.route.id];
|
|
1167
1186
|
if (!h || !h.hasLoader)
|
|
1168
1187
|
return !1;
|
|
1169
|
-
if (
|
|
1188
|
+
if (s(l, u) || c(l, u))
|
|
1170
1189
|
return !0;
|
|
1171
1190
|
if (l.route.shouldRevalidate) {
|
|
1172
1191
|
let d = l.route.shouldRevalidate({
|
|
@@ -1174,7 +1193,7 @@ function me(e, t, n, a, r, i) {
|
|
|
1174
1193
|
r.pathname + r.search + r.hash,
|
|
1175
1194
|
window.origin
|
|
1176
1195
|
),
|
|
1177
|
-
currentParams: ((
|
|
1196
|
+
currentParams: ((m = t[0]) == null ? void 0 : m.params) || {},
|
|
1178
1197
|
nextUrl: new URL(e, window.origin),
|
|
1179
1198
|
nextParams: l.params,
|
|
1180
1199
|
defaultShouldRevalidate: !0
|
|
@@ -1185,13 +1204,13 @@ function me(e, t, n, a, r, i) {
|
|
|
1185
1204
|
return !0;
|
|
1186
1205
|
}) : [];
|
|
1187
1206
|
}
|
|
1188
|
-
function $t(e,
|
|
1207
|
+
function $t(e, n, { includeHydrateFallback: t } = {}) {
|
|
1189
1208
|
return Tt(
|
|
1190
1209
|
e.map((a) => {
|
|
1191
|
-
let r =
|
|
1210
|
+
let r = n.routes[a.route.id];
|
|
1192
1211
|
if (!r) return [];
|
|
1193
1212
|
let i = [r.module];
|
|
1194
|
-
return r.clientActionModule && (i = i.concat(r.clientActionModule)), r.clientLoaderModule && (i = i.concat(r.clientLoaderModule)),
|
|
1213
|
+
return r.clientActionModule && (i = i.concat(r.clientActionModule)), r.clientLoaderModule && (i = i.concat(r.clientLoaderModule)), t && r.hydrateFallbackModule && (i = i.concat(r.hydrateFallbackModule)), r.imports && (i = i.concat(r.imports)), i;
|
|
1195
1214
|
}).flat(1)
|
|
1196
1215
|
);
|
|
1197
1216
|
}
|
|
@@ -1199,27 +1218,27 @@ function Tt(e) {
|
|
|
1199
1218
|
return [...new Set(e)];
|
|
1200
1219
|
}
|
|
1201
1220
|
function Nt(e) {
|
|
1202
|
-
let
|
|
1203
|
-
for (let a of
|
|
1204
|
-
|
|
1205
|
-
return
|
|
1221
|
+
let n = {}, t = Object.keys(e).sort();
|
|
1222
|
+
for (let a of t)
|
|
1223
|
+
n[a] = e[a];
|
|
1224
|
+
return n;
|
|
1206
1225
|
}
|
|
1207
|
-
function
|
|
1208
|
-
let
|
|
1209
|
-
return new Set(
|
|
1226
|
+
function Mt(e, n) {
|
|
1227
|
+
let t = /* @__PURE__ */ new Set();
|
|
1228
|
+
return new Set(n), e.reduce((a, r) => {
|
|
1210
1229
|
let i = JSON.stringify(Nt(r));
|
|
1211
|
-
return
|
|
1230
|
+
return t.has(i) || (t.add(i), a.push({ key: i, link: r })), a;
|
|
1212
1231
|
}, []);
|
|
1213
1232
|
}
|
|
1214
|
-
var
|
|
1215
|
-
function Dt(e,
|
|
1216
|
-
let
|
|
1233
|
+
var At = /* @__PURE__ */ new Set([100, 101, 204, 205]);
|
|
1234
|
+
function Dt(e, n) {
|
|
1235
|
+
let t = typeof e == "string" ? new URL(
|
|
1217
1236
|
e,
|
|
1218
1237
|
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
1219
1238
|
// don't assume window is available
|
|
1220
1239
|
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
1221
1240
|
) : e;
|
|
1222
|
-
return
|
|
1241
|
+
return t.pathname === "/" ? t.pathname = "_root.data" : n && A(t.pathname, n) === "/" ? t.pathname = `${n.replace(/\/$/, "")}/_root.data` : t.pathname = `${t.pathname.replace(/\/$/, "")}.data`, t;
|
|
1223
1242
|
}
|
|
1224
1243
|
function Le() {
|
|
1225
1244
|
let e = o.useContext(O);
|
|
@@ -1244,13 +1263,13 @@ function ke() {
|
|
|
1244
1263
|
"You must render this element inside a <HydratedRouter> element"
|
|
1245
1264
|
), e;
|
|
1246
1265
|
}
|
|
1247
|
-
function It(e,
|
|
1248
|
-
let
|
|
1266
|
+
function It(e, n) {
|
|
1267
|
+
let t = o.useContext(le), [a, r] = o.useState(!1), [i, s] = o.useState(!1), { onFocus: c, onBlur: l, onMouseEnter: u, onMouseLeave: h, onTouchStart: m } = n, d = o.useRef(null);
|
|
1249
1268
|
o.useEffect(() => {
|
|
1250
|
-
if (e === "render" &&
|
|
1251
|
-
let w = (
|
|
1252
|
-
|
|
1253
|
-
|
|
1269
|
+
if (e === "render" && s(!0), e === "viewport") {
|
|
1270
|
+
let w = (p) => {
|
|
1271
|
+
p.forEach((v) => {
|
|
1272
|
+
s(v.isIntersecting);
|
|
1254
1273
|
});
|
|
1255
1274
|
}, E = new IntersectionObserver(w, { threshold: 0.5 });
|
|
1256
1275
|
return d.current && E.observe(d.current), () => {
|
|
@@ -1260,121 +1279,121 @@ function It(e, t) {
|
|
|
1260
1279
|
}, [e]), o.useEffect(() => {
|
|
1261
1280
|
if (a) {
|
|
1262
1281
|
let w = setTimeout(() => {
|
|
1263
|
-
|
|
1282
|
+
s(!0);
|
|
1264
1283
|
}, 100);
|
|
1265
1284
|
return () => {
|
|
1266
1285
|
clearTimeout(w);
|
|
1267
1286
|
};
|
|
1268
1287
|
}
|
|
1269
1288
|
}, [a]);
|
|
1270
|
-
let
|
|
1289
|
+
let g = () => {
|
|
1271
1290
|
r(!0);
|
|
1272
1291
|
}, f = () => {
|
|
1273
|
-
r(!1),
|
|
1292
|
+
r(!1), s(!1);
|
|
1274
1293
|
};
|
|
1275
|
-
return
|
|
1294
|
+
return t ? e !== "intent" ? [i, d, {}] : [
|
|
1276
1295
|
i,
|
|
1277
1296
|
d,
|
|
1278
1297
|
{
|
|
1279
|
-
onFocus: U(
|
|
1298
|
+
onFocus: U(c, g),
|
|
1280
1299
|
onBlur: U(l, f),
|
|
1281
|
-
onMouseEnter: U(
|
|
1300
|
+
onMouseEnter: U(u, g),
|
|
1282
1301
|
onMouseLeave: U(h, f),
|
|
1283
|
-
onTouchStart: U(
|
|
1302
|
+
onTouchStart: U(m, g)
|
|
1284
1303
|
}
|
|
1285
1304
|
] : [!1, d, {}];
|
|
1286
1305
|
}
|
|
1287
|
-
function U(e,
|
|
1288
|
-
return (
|
|
1289
|
-
e && e(
|
|
1306
|
+
function U(e, n) {
|
|
1307
|
+
return (t) => {
|
|
1308
|
+
e && e(t), t.defaultPrevented || n(t);
|
|
1290
1309
|
};
|
|
1291
1310
|
}
|
|
1292
1311
|
function _t({
|
|
1293
1312
|
page: e,
|
|
1294
|
-
...
|
|
1313
|
+
...n
|
|
1295
1314
|
}) {
|
|
1296
|
-
let { router:
|
|
1297
|
-
() => pe(
|
|
1298
|
-
[
|
|
1315
|
+
let { router: t } = Le(), a = o.useMemo(
|
|
1316
|
+
() => pe(t.routes, e, t.basename),
|
|
1317
|
+
[t.routes, e, t.basename]
|
|
1299
1318
|
);
|
|
1300
|
-
return a ? /* @__PURE__ */ o.createElement(Ut, { page: e, matches: a, ...
|
|
1319
|
+
return a ? /* @__PURE__ */ o.createElement(Ut, { page: e, matches: a, ...n }) : null;
|
|
1301
1320
|
}
|
|
1302
1321
|
function Ft(e) {
|
|
1303
|
-
let { manifest:
|
|
1322
|
+
let { manifest: n, routeModules: t } = ke(), [a, r] = o.useState([]);
|
|
1304
1323
|
return o.useEffect(() => {
|
|
1305
1324
|
let i = !1;
|
|
1306
|
-
return kt(e,
|
|
1307
|
-
(
|
|
1308
|
-
i || r(
|
|
1325
|
+
return kt(e, n, t).then(
|
|
1326
|
+
(s) => {
|
|
1327
|
+
i || r(s);
|
|
1309
1328
|
}
|
|
1310
1329
|
), () => {
|
|
1311
1330
|
i = !0;
|
|
1312
1331
|
};
|
|
1313
|
-
}, [e,
|
|
1332
|
+
}, [e, n, t]), a;
|
|
1314
1333
|
}
|
|
1315
1334
|
function Ut({
|
|
1316
1335
|
page: e,
|
|
1317
|
-
matches:
|
|
1318
|
-
...
|
|
1336
|
+
matches: n,
|
|
1337
|
+
...t
|
|
1319
1338
|
}) {
|
|
1320
|
-
let a = N(), { manifest: r, routeModules: i } = ke(), { basename:
|
|
1339
|
+
let a = N(), { manifest: r, routeModules: i } = ke(), { basename: s } = Le(), { loaderData: c, matches: l } = Ot(), u = o.useMemo(
|
|
1321
1340
|
() => me(
|
|
1322
1341
|
e,
|
|
1323
|
-
|
|
1342
|
+
n,
|
|
1324
1343
|
l,
|
|
1325
1344
|
r,
|
|
1326
1345
|
a,
|
|
1327
1346
|
"data"
|
|
1328
1347
|
),
|
|
1329
|
-
[e,
|
|
1348
|
+
[e, n, l, r, a]
|
|
1330
1349
|
), h = o.useMemo(
|
|
1331
1350
|
() => me(
|
|
1332
1351
|
e,
|
|
1333
|
-
|
|
1352
|
+
n,
|
|
1334
1353
|
l,
|
|
1335
1354
|
r,
|
|
1336
1355
|
a,
|
|
1337
1356
|
"assets"
|
|
1338
1357
|
),
|
|
1339
|
-
[e,
|
|
1340
|
-
),
|
|
1358
|
+
[e, n, l, r, a]
|
|
1359
|
+
), m = o.useMemo(() => {
|
|
1341
1360
|
if (e === a.pathname + a.search + a.hash)
|
|
1342
1361
|
return [];
|
|
1343
1362
|
let f = /* @__PURE__ */ new Set(), w = !1;
|
|
1344
|
-
if (
|
|
1363
|
+
if (n.forEach((p) => {
|
|
1345
1364
|
var y;
|
|
1346
|
-
let
|
|
1347
|
-
!
|
|
1365
|
+
let v = r.routes[p.route.id];
|
|
1366
|
+
!v || !v.hasLoader || (!u.some((b) => b.route.id === p.route.id) && p.route.id in c && ((y = i[p.route.id]) != null && y.shouldRevalidate) || v.hasClientLoader ? w = !0 : f.add(p.route.id));
|
|
1348
1367
|
}), f.size === 0)
|
|
1349
1368
|
return [];
|
|
1350
|
-
let E = Dt(e,
|
|
1369
|
+
let E = Dt(e, s);
|
|
1351
1370
|
return w && f.size > 0 && E.searchParams.set(
|
|
1352
1371
|
"_routes",
|
|
1353
|
-
|
|
1372
|
+
n.filter((p) => f.has(p.route.id)).map((p) => p.route.id).join(",")
|
|
1354
1373
|
), [E.pathname + E.search];
|
|
1355
1374
|
}, [
|
|
1375
|
+
s,
|
|
1356
1376
|
c,
|
|
1357
|
-
u,
|
|
1358
1377
|
a,
|
|
1359
1378
|
r,
|
|
1360
|
-
|
|
1361
|
-
|
|
1379
|
+
u,
|
|
1380
|
+
n,
|
|
1362
1381
|
e,
|
|
1363
1382
|
i
|
|
1364
1383
|
]), d = o.useMemo(
|
|
1365
1384
|
() => $t(h, r),
|
|
1366
1385
|
[h, r]
|
|
1367
|
-
),
|
|
1368
|
-
return /* @__PURE__ */ o.createElement(o.Fragment, null,
|
|
1386
|
+
), g = Ft(h);
|
|
1387
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, m.map((f) => /* @__PURE__ */ o.createElement("link", { key: f, rel: "prefetch", as: "fetch", href: f, ...t })), d.map((f) => /* @__PURE__ */ o.createElement("link", { key: f, rel: "modulepreload", href: f, ...t })), g.map(({ key: f, link: w }) => (
|
|
1369
1388
|
// these don't spread `linkProps` because they are full link descriptors
|
|
1370
1389
|
// already with their own props
|
|
1371
1390
|
/* @__PURE__ */ o.createElement("link", { key: f, ...w })
|
|
1372
1391
|
)));
|
|
1373
1392
|
}
|
|
1374
|
-
function
|
|
1375
|
-
return (
|
|
1376
|
-
e.forEach((
|
|
1377
|
-
typeof
|
|
1393
|
+
function Wt(...e) {
|
|
1394
|
+
return (n) => {
|
|
1395
|
+
e.forEach((t) => {
|
|
1396
|
+
typeof t == "function" ? t(n) : t != null && (t.current = n);
|
|
1378
1397
|
});
|
|
1379
1398
|
};
|
|
1380
1399
|
}
|
|
@@ -1385,43 +1404,43 @@ try {
|
|
|
1385
1404
|
}
|
|
1386
1405
|
var Te = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Ne = o.forwardRef(
|
|
1387
1406
|
function({
|
|
1388
|
-
onClick:
|
|
1389
|
-
discover:
|
|
1407
|
+
onClick: n,
|
|
1408
|
+
discover: t = "render",
|
|
1390
1409
|
prefetch: a = "none",
|
|
1391
1410
|
relative: r,
|
|
1392
1411
|
reloadDocument: i,
|
|
1393
|
-
replace:
|
|
1394
|
-
state:
|
|
1412
|
+
replace: s,
|
|
1413
|
+
state: c,
|
|
1395
1414
|
target: l,
|
|
1396
|
-
to:
|
|
1415
|
+
to: u,
|
|
1397
1416
|
preventScrollReset: h,
|
|
1398
|
-
viewTransition:
|
|
1417
|
+
viewTransition: m,
|
|
1399
1418
|
...d
|
|
1400
|
-
},
|
|
1401
|
-
let { basename: f } = o.useContext(T), w = typeof
|
|
1402
|
-
if (typeof
|
|
1419
|
+
}, g) {
|
|
1420
|
+
let { basename: f } = o.useContext(T), w = typeof u == "string" && Te.test(u), E, p = !1;
|
|
1421
|
+
if (typeof u == "string" && w && (E = u, $e))
|
|
1403
1422
|
try {
|
|
1404
|
-
let P = new URL(window.location.href), D =
|
|
1405
|
-
D.origin === P.origin && se != null ?
|
|
1423
|
+
let P = new URL(window.location.href), D = u.startsWith("//") ? new URL(P.protocol + u) : new URL(u), se = A(D.pathname, f);
|
|
1424
|
+
D.origin === P.origin && se != null ? u = se + D.search + D.hash : p = !0;
|
|
1406
1425
|
} catch {
|
|
1407
1426
|
L(
|
|
1408
1427
|
!1,
|
|
1409
|
-
`<Link to="${
|
|
1428
|
+
`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1410
1429
|
);
|
|
1411
1430
|
}
|
|
1412
|
-
let
|
|
1431
|
+
let v = et(u, { relative: r }), [y, b, x] = It(
|
|
1413
1432
|
a,
|
|
1414
1433
|
d
|
|
1415
|
-
), C =
|
|
1416
|
-
replace:
|
|
1417
|
-
state:
|
|
1434
|
+
), C = jt(u, {
|
|
1435
|
+
replace: s,
|
|
1436
|
+
state: c,
|
|
1418
1437
|
target: l,
|
|
1419
1438
|
preventScrollReset: h,
|
|
1420
1439
|
relative: r,
|
|
1421
|
-
viewTransition:
|
|
1440
|
+
viewTransition: m
|
|
1422
1441
|
});
|
|
1423
1442
|
function $(P) {
|
|
1424
|
-
|
|
1443
|
+
n && n(P), P.defaultPrevented || C(P);
|
|
1425
1444
|
}
|
|
1426
1445
|
let S = (
|
|
1427
1446
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
@@ -1430,40 +1449,40 @@ var Te = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Ne = o.forwardRef(
|
|
|
1430
1449
|
{
|
|
1431
1450
|
...d,
|
|
1432
1451
|
...x,
|
|
1433
|
-
href: E ||
|
|
1434
|
-
onClick:
|
|
1435
|
-
ref:
|
|
1452
|
+
href: E || v,
|
|
1453
|
+
onClick: p || i ? n : $,
|
|
1454
|
+
ref: Wt(g, b),
|
|
1436
1455
|
target: l,
|
|
1437
|
-
"data-discover": !w &&
|
|
1456
|
+
"data-discover": !w && t === "render" ? "true" : void 0
|
|
1438
1457
|
}
|
|
1439
1458
|
)
|
|
1440
1459
|
);
|
|
1441
|
-
return y && !w ? /* @__PURE__ */ o.createElement(o.Fragment, null, S, /* @__PURE__ */ o.createElement(_t, { page:
|
|
1460
|
+
return y && !w ? /* @__PURE__ */ o.createElement(o.Fragment, null, S, /* @__PURE__ */ o.createElement(_t, { page: v })) : S;
|
|
1442
1461
|
}
|
|
1443
1462
|
);
|
|
1444
1463
|
Ne.displayName = "Link";
|
|
1445
|
-
var
|
|
1464
|
+
var Bt = o.forwardRef(
|
|
1446
1465
|
function({
|
|
1447
|
-
"aria-current":
|
|
1448
|
-
caseSensitive:
|
|
1466
|
+
"aria-current": n = "page",
|
|
1467
|
+
caseSensitive: t = !1,
|
|
1449
1468
|
className: a = "",
|
|
1450
1469
|
end: r = !1,
|
|
1451
1470
|
style: i,
|
|
1452
|
-
to:
|
|
1453
|
-
viewTransition:
|
|
1471
|
+
to: s,
|
|
1472
|
+
viewTransition: c,
|
|
1454
1473
|
children: l,
|
|
1455
|
-
...
|
|
1474
|
+
...u
|
|
1456
1475
|
}, h) {
|
|
1457
|
-
let
|
|
1476
|
+
let m = H(s, { relative: u.relative }), d = N(), g = o.useContext(_), { navigator: f, basename: w } = o.useContext(T), E = g != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1458
1477
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1459
|
-
qt(
|
|
1460
|
-
|
|
1461
|
-
const
|
|
1462
|
-
let x =
|
|
1478
|
+
qt(m) && c === !0, p = f.encodeLocation ? f.encodeLocation(m).pathname : m.pathname, v = d.pathname, y = g && g.navigation && g.navigation.location ? g.navigation.location.pathname : null;
|
|
1479
|
+
t || (v = v.toLowerCase(), y = y ? y.toLowerCase() : null, p = p.toLowerCase()), y && w && (y = A(y, w) || y);
|
|
1480
|
+
const b = p !== "/" && p.endsWith("/") ? p.length - 1 : p.length;
|
|
1481
|
+
let x = v === p || !r && v.startsWith(p) && v.charAt(b) === "/", C = y != null && (y === p || !r && y.startsWith(p) && y.charAt(p.length) === "/"), $ = {
|
|
1463
1482
|
isActive: x,
|
|
1464
1483
|
isPending: C,
|
|
1465
1484
|
isTransitioning: E
|
|
1466
|
-
}, S = x ?
|
|
1485
|
+
}, S = x ? n : void 0, P;
|
|
1467
1486
|
typeof a == "function" ? P = a($) : P = [
|
|
1468
1487
|
a,
|
|
1469
1488
|
x ? "active" : null,
|
|
@@ -1474,268 +1493,268 @@ var Ht = o.forwardRef(
|
|
|
1474
1493
|
return /* @__PURE__ */ o.createElement(
|
|
1475
1494
|
Ne,
|
|
1476
1495
|
{
|
|
1477
|
-
...
|
|
1496
|
+
...u,
|
|
1478
1497
|
"aria-current": S,
|
|
1479
1498
|
className: P,
|
|
1480
1499
|
ref: h,
|
|
1481
1500
|
style: D,
|
|
1482
|
-
to:
|
|
1483
|
-
viewTransition:
|
|
1501
|
+
to: s,
|
|
1502
|
+
viewTransition: c
|
|
1484
1503
|
},
|
|
1485
1504
|
typeof l == "function" ? l($) : l
|
|
1486
1505
|
);
|
|
1487
1506
|
}
|
|
1488
1507
|
);
|
|
1489
|
-
|
|
1490
|
-
var
|
|
1508
|
+
Bt.displayName = "NavLink";
|
|
1509
|
+
var Ht = o.forwardRef(
|
|
1491
1510
|
({
|
|
1492
1511
|
discover: e = "render",
|
|
1493
|
-
fetcherKey:
|
|
1494
|
-
navigate:
|
|
1512
|
+
fetcherKey: n,
|
|
1513
|
+
navigate: t,
|
|
1495
1514
|
reloadDocument: a,
|
|
1496
1515
|
replace: r,
|
|
1497
1516
|
state: i,
|
|
1498
|
-
method:
|
|
1499
|
-
action:
|
|
1517
|
+
method: s = j,
|
|
1518
|
+
action: c,
|
|
1500
1519
|
onSubmit: l,
|
|
1501
|
-
relative:
|
|
1520
|
+
relative: u,
|
|
1502
1521
|
preventScrollReset: h,
|
|
1503
|
-
viewTransition:
|
|
1522
|
+
viewTransition: m,
|
|
1504
1523
|
...d
|
|
1505
|
-
},
|
|
1506
|
-
let f = Jt(), w = Kt(
|
|
1524
|
+
}, g) => {
|
|
1525
|
+
let f = Jt(), w = Kt(c, { relative: u }), E = s.toLowerCase() === "get" ? "get" : "post", p = typeof c == "string" && Te.test(c), v = (y) => {
|
|
1507
1526
|
if (l && l(y), y.defaultPrevented) return;
|
|
1508
1527
|
y.preventDefault();
|
|
1509
|
-
let
|
|
1510
|
-
f(
|
|
1511
|
-
fetcherKey:
|
|
1528
|
+
let b = y.nativeEvent.submitter, x = (b == null ? void 0 : b.getAttribute("formmethod")) || s;
|
|
1529
|
+
f(b || y.currentTarget, {
|
|
1530
|
+
fetcherKey: n,
|
|
1512
1531
|
method: x,
|
|
1513
|
-
navigate:
|
|
1532
|
+
navigate: t,
|
|
1514
1533
|
replace: r,
|
|
1515
1534
|
state: i,
|
|
1516
|
-
relative:
|
|
1535
|
+
relative: u,
|
|
1517
1536
|
preventScrollReset: h,
|
|
1518
|
-
viewTransition:
|
|
1537
|
+
viewTransition: m
|
|
1519
1538
|
});
|
|
1520
1539
|
};
|
|
1521
1540
|
return /* @__PURE__ */ o.createElement(
|
|
1522
1541
|
"form",
|
|
1523
1542
|
{
|
|
1524
|
-
ref:
|
|
1543
|
+
ref: g,
|
|
1525
1544
|
method: E,
|
|
1526
1545
|
action: w,
|
|
1527
|
-
onSubmit: a ? l :
|
|
1546
|
+
onSubmit: a ? l : v,
|
|
1528
1547
|
...d,
|
|
1529
|
-
"data-discover": !
|
|
1548
|
+
"data-discover": !p && e === "render" ? "true" : void 0
|
|
1530
1549
|
}
|
|
1531
1550
|
);
|
|
1532
1551
|
}
|
|
1533
1552
|
);
|
|
1534
|
-
|
|
1553
|
+
Ht.displayName = "Form";
|
|
1535
1554
|
function zt(e) {
|
|
1536
1555
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1537
1556
|
}
|
|
1538
|
-
function
|
|
1539
|
-
let
|
|
1540
|
-
return
|
|
1557
|
+
function Me(e) {
|
|
1558
|
+
let n = o.useContext(O);
|
|
1559
|
+
return R(n, zt(e)), n;
|
|
1541
1560
|
}
|
|
1542
|
-
function
|
|
1543
|
-
target:
|
|
1544
|
-
replace:
|
|
1561
|
+
function jt(e, {
|
|
1562
|
+
target: n,
|
|
1563
|
+
replace: t,
|
|
1545
1564
|
state: a,
|
|
1546
1565
|
preventScrollReset: r,
|
|
1547
1566
|
relative: i,
|
|
1548
|
-
viewTransition:
|
|
1567
|
+
viewTransition: s
|
|
1549
1568
|
} = {}) {
|
|
1550
|
-
let
|
|
1569
|
+
let c = re(), l = N(), u = H(e, { relative: i });
|
|
1551
1570
|
return o.useCallback(
|
|
1552
1571
|
(h) => {
|
|
1553
|
-
if (xt(h,
|
|
1572
|
+
if (xt(h, n)) {
|
|
1554
1573
|
h.preventDefault();
|
|
1555
|
-
let
|
|
1556
|
-
|
|
1557
|
-
replace:
|
|
1574
|
+
let m = t !== void 0 ? t : W(l) === W(u);
|
|
1575
|
+
c(e, {
|
|
1576
|
+
replace: m,
|
|
1558
1577
|
state: a,
|
|
1559
1578
|
preventScrollReset: r,
|
|
1560
1579
|
relative: i,
|
|
1561
|
-
viewTransition:
|
|
1580
|
+
viewTransition: s
|
|
1562
1581
|
});
|
|
1563
1582
|
}
|
|
1564
1583
|
},
|
|
1565
1584
|
[
|
|
1566
1585
|
l,
|
|
1586
|
+
c,
|
|
1567
1587
|
u,
|
|
1568
|
-
s,
|
|
1569
|
-
n,
|
|
1570
|
-
a,
|
|
1571
1588
|
t,
|
|
1589
|
+
a,
|
|
1590
|
+
n,
|
|
1572
1591
|
e,
|
|
1573
1592
|
r,
|
|
1574
1593
|
i,
|
|
1575
|
-
|
|
1594
|
+
s
|
|
1576
1595
|
]
|
|
1577
1596
|
);
|
|
1578
1597
|
}
|
|
1579
|
-
function
|
|
1598
|
+
function mn(e) {
|
|
1580
1599
|
L(
|
|
1581
1600
|
typeof URLSearchParams < "u",
|
|
1582
1601
|
"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params."
|
|
1583
1602
|
);
|
|
1584
|
-
let
|
|
1603
|
+
let n = o.useRef(Q(e)), t = o.useRef(!1), a = N(), r = o.useMemo(
|
|
1585
1604
|
() => (
|
|
1586
1605
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
1587
1606
|
// Once we call that we want those to take precedence, otherwise you can't
|
|
1588
1607
|
// remove a param with setSearchParams({}) if it has an initial value
|
|
1589
|
-
|
|
1608
|
+
bt(
|
|
1590
1609
|
a.search,
|
|
1591
|
-
|
|
1610
|
+
t.current ? null : n.current
|
|
1592
1611
|
)
|
|
1593
1612
|
),
|
|
1594
1613
|
[a.search]
|
|
1595
|
-
), i = re(),
|
|
1596
|
-
(
|
|
1597
|
-
const
|
|
1598
|
-
typeof
|
|
1614
|
+
), i = re(), s = o.useCallback(
|
|
1615
|
+
(c, l) => {
|
|
1616
|
+
const u = Q(
|
|
1617
|
+
typeof c == "function" ? c(r) : c
|
|
1599
1618
|
);
|
|
1600
|
-
|
|
1619
|
+
t.current = !0, i("?" + u, l);
|
|
1601
1620
|
},
|
|
1602
1621
|
[i, r]
|
|
1603
1622
|
);
|
|
1604
|
-
return [r,
|
|
1623
|
+
return [r, s];
|
|
1605
1624
|
}
|
|
1606
|
-
var
|
|
1625
|
+
var Vt = 0, Yt = () => `__${String(++Vt)}__`;
|
|
1607
1626
|
function Jt() {
|
|
1608
|
-
let { router: e } =
|
|
1627
|
+
let { router: e } = Me(
|
|
1609
1628
|
"useSubmit"
|
|
1610
1629
|
/* UseSubmit */
|
|
1611
|
-
), { basename:
|
|
1630
|
+
), { basename: n } = o.useContext(T), t = ft();
|
|
1612
1631
|
return o.useCallback(
|
|
1613
1632
|
async (a, r = {}) => {
|
|
1614
|
-
let { action: i, method:
|
|
1633
|
+
let { action: i, method: s, encType: c, formData: l, body: u } = St(
|
|
1615
1634
|
a,
|
|
1616
|
-
|
|
1635
|
+
n
|
|
1617
1636
|
);
|
|
1618
1637
|
if (r.navigate === !1) {
|
|
1619
1638
|
let h = r.fetcherKey || Yt();
|
|
1620
|
-
await e.fetch(h,
|
|
1639
|
+
await e.fetch(h, t, r.action || i, {
|
|
1621
1640
|
preventScrollReset: r.preventScrollReset,
|
|
1622
1641
|
formData: l,
|
|
1623
|
-
body:
|
|
1624
|
-
formMethod: r.method ||
|
|
1625
|
-
formEncType: r.encType ||
|
|
1642
|
+
body: u,
|
|
1643
|
+
formMethod: r.method || s,
|
|
1644
|
+
formEncType: r.encType || c,
|
|
1626
1645
|
flushSync: r.flushSync
|
|
1627
1646
|
});
|
|
1628
1647
|
} else
|
|
1629
1648
|
await e.navigate(r.action || i, {
|
|
1630
1649
|
preventScrollReset: r.preventScrollReset,
|
|
1631
1650
|
formData: l,
|
|
1632
|
-
body:
|
|
1633
|
-
formMethod: r.method ||
|
|
1634
|
-
formEncType: r.encType ||
|
|
1651
|
+
body: u,
|
|
1652
|
+
formMethod: r.method || s,
|
|
1653
|
+
formEncType: r.encType || c,
|
|
1635
1654
|
replace: r.replace,
|
|
1636
1655
|
state: r.state,
|
|
1637
|
-
fromRouteId:
|
|
1656
|
+
fromRouteId: t,
|
|
1638
1657
|
flushSync: r.flushSync,
|
|
1639
1658
|
viewTransition: r.viewTransition
|
|
1640
1659
|
});
|
|
1641
1660
|
},
|
|
1642
|
-
[e,
|
|
1661
|
+
[e, n, t]
|
|
1643
1662
|
);
|
|
1644
1663
|
}
|
|
1645
|
-
function Kt(e, { relative:
|
|
1646
|
-
let { basename:
|
|
1647
|
-
|
|
1648
|
-
let [r] = a.matches.slice(-1), i = { ...
|
|
1664
|
+
function Kt(e, { relative: n } = {}) {
|
|
1665
|
+
let { basename: t } = o.useContext(T), a = o.useContext(k);
|
|
1666
|
+
R(a, "useFormAction must be used inside a RouteContext");
|
|
1667
|
+
let [r] = a.matches.slice(-1), i = { ...H(e || ".", { relative: n }) }, s = N();
|
|
1649
1668
|
if (e == null) {
|
|
1650
|
-
i.search =
|
|
1651
|
-
let
|
|
1669
|
+
i.search = s.search;
|
|
1670
|
+
let c = new URLSearchParams(i.search), l = c.getAll("index");
|
|
1652
1671
|
if (l.some((h) => h === "")) {
|
|
1653
|
-
|
|
1654
|
-
let h =
|
|
1672
|
+
c.delete("index"), l.filter((m) => m).forEach((m) => c.append("index", m));
|
|
1673
|
+
let h = c.toString();
|
|
1655
1674
|
i.search = h ? `?${h}` : "";
|
|
1656
1675
|
}
|
|
1657
1676
|
}
|
|
1658
|
-
return (!e || e === ".") && r.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"),
|
|
1677
|
+
return (!e || e === ".") && r.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), t !== "/" && (i.pathname = i.pathname === "/" ? t : M([t, i.pathname])), W(i);
|
|
1659
1678
|
}
|
|
1660
|
-
function qt(e,
|
|
1661
|
-
let
|
|
1662
|
-
|
|
1663
|
-
|
|
1679
|
+
function qt(e, n = {}) {
|
|
1680
|
+
let t = o.useContext(J);
|
|
1681
|
+
R(
|
|
1682
|
+
t != null,
|
|
1664
1683
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1665
1684
|
);
|
|
1666
|
-
let { basename: a } =
|
|
1685
|
+
let { basename: a } = Me(
|
|
1667
1686
|
"useViewTransitionState"
|
|
1668
1687
|
/* useViewTransitionState */
|
|
1669
|
-
), r =
|
|
1670
|
-
if (!
|
|
1688
|
+
), r = H(e, { relative: n.relative });
|
|
1689
|
+
if (!t.isTransitioning)
|
|
1671
1690
|
return !1;
|
|
1672
|
-
let i =
|
|
1673
|
-
return
|
|
1691
|
+
let i = A(t.currentLocation.pathname, a) || t.currentLocation.pathname, s = A(t.nextLocation.pathname, a) || t.nextLocation.pathname;
|
|
1692
|
+
return B(r.pathname, s) != null || B(r.pathname, i) != null;
|
|
1674
1693
|
}
|
|
1675
|
-
function
|
|
1694
|
+
function pn({
|
|
1676
1695
|
context: e,
|
|
1677
|
-
router:
|
|
1678
|
-
hydrate:
|
|
1696
|
+
router: n,
|
|
1697
|
+
hydrate: t = !0,
|
|
1679
1698
|
nonce: a
|
|
1680
1699
|
}) {
|
|
1681
|
-
|
|
1682
|
-
|
|
1700
|
+
R(
|
|
1701
|
+
n && e,
|
|
1683
1702
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1684
1703
|
);
|
|
1685
1704
|
let r = {
|
|
1686
|
-
router:
|
|
1705
|
+
router: n,
|
|
1687
1706
|
navigator: Qt(),
|
|
1688
1707
|
static: !0,
|
|
1689
1708
|
staticContext: e,
|
|
1690
1709
|
basename: e.basename || "/"
|
|
1691
|
-
}, i = /* @__PURE__ */ new Map(),
|
|
1692
|
-
if (
|
|
1710
|
+
}, i = /* @__PURE__ */ new Map(), s = "";
|
|
1711
|
+
if (t !== !1) {
|
|
1693
1712
|
let l = {
|
|
1694
1713
|
loaderData: e.loaderData,
|
|
1695
1714
|
actionData: e.actionData,
|
|
1696
1715
|
errors: Xt(e.errors)
|
|
1697
1716
|
};
|
|
1698
|
-
|
|
1717
|
+
s = `window.__staticRouterHydrationData = JSON.parse(${an(JSON.stringify(JSON.stringify(l)))});`;
|
|
1699
1718
|
}
|
|
1700
|
-
let { state:
|
|
1701
|
-
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(O.Provider, { value: r }, /* @__PURE__ */ o.createElement(_.Provider, { value:
|
|
1719
|
+
let { state: c } = r.router;
|
|
1720
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(O.Provider, { value: r }, /* @__PURE__ */ o.createElement(_.Provider, { value: c }, /* @__PURE__ */ o.createElement(te.Provider, { value: i }, /* @__PURE__ */ o.createElement(J.Provider, { value: { isTransitioning: !1 } }, /* @__PURE__ */ o.createElement(
|
|
1702
1721
|
Pe,
|
|
1703
1722
|
{
|
|
1704
1723
|
basename: r.basename,
|
|
1705
|
-
location:
|
|
1706
|
-
navigationType:
|
|
1724
|
+
location: c.location,
|
|
1725
|
+
navigationType: c.historyAction,
|
|
1707
1726
|
navigator: r.navigator,
|
|
1708
1727
|
static: r.static
|
|
1709
1728
|
},
|
|
1710
1729
|
/* @__PURE__ */ o.createElement(
|
|
1711
1730
|
Gt,
|
|
1712
1731
|
{
|
|
1713
|
-
routes:
|
|
1714
|
-
future:
|
|
1715
|
-
state:
|
|
1732
|
+
routes: n.routes,
|
|
1733
|
+
future: n.future,
|
|
1734
|
+
state: c
|
|
1716
1735
|
}
|
|
1717
1736
|
)
|
|
1718
|
-
))))),
|
|
1737
|
+
))))), s ? /* @__PURE__ */ o.createElement(
|
|
1719
1738
|
"script",
|
|
1720
1739
|
{
|
|
1721
1740
|
suppressHydrationWarning: !0,
|
|
1722
1741
|
nonce: a,
|
|
1723
|
-
dangerouslySetInnerHTML: { __html:
|
|
1742
|
+
dangerouslySetInnerHTML: { __html: s }
|
|
1724
1743
|
}
|
|
1725
1744
|
) : null);
|
|
1726
1745
|
}
|
|
1727
1746
|
function Gt({
|
|
1728
1747
|
routes: e,
|
|
1729
|
-
future:
|
|
1730
|
-
state:
|
|
1748
|
+
future: n,
|
|
1749
|
+
state: t
|
|
1731
1750
|
}) {
|
|
1732
|
-
return
|
|
1751
|
+
return Re(e, void 0, t, n);
|
|
1733
1752
|
}
|
|
1734
1753
|
function Xt(e) {
|
|
1735
1754
|
if (!e) return null;
|
|
1736
|
-
let
|
|
1737
|
-
for (let [a, r] of
|
|
1738
|
-
we(r) ?
|
|
1755
|
+
let n = Object.entries(e), t = {};
|
|
1756
|
+
for (let [a, r] of n)
|
|
1757
|
+
we(r) ? t[a] = { ...r, __type: "RouteErrorResponse" } : r instanceof Error ? t[a] = {
|
|
1739
1758
|
message: r.message,
|
|
1740
1759
|
__type: "Error",
|
|
1741
1760
|
// If this is a subclass (i.e., ReferenceError), send up the type so we
|
|
@@ -1743,8 +1762,8 @@ function Xt(e) {
|
|
|
1743
1762
|
...r.name !== "Error" ? {
|
|
1744
1763
|
__subType: r.name
|
|
1745
1764
|
} : {}
|
|
1746
|
-
} :
|
|
1747
|
-
return
|
|
1765
|
+
} : t[a] = r;
|
|
1766
|
+
return t;
|
|
1748
1767
|
}
|
|
1749
1768
|
function Qt() {
|
|
1750
1769
|
return {
|
|
@@ -1778,16 +1797,16 @@ function Qt() {
|
|
|
1778
1797
|
};
|
|
1779
1798
|
}
|
|
1780
1799
|
function Zt(e) {
|
|
1781
|
-
return typeof e == "string" ? e :
|
|
1800
|
+
return typeof e == "string" ? e : W(e);
|
|
1782
1801
|
}
|
|
1783
1802
|
function en(e) {
|
|
1784
|
-
let
|
|
1785
|
-
|
|
1786
|
-
let
|
|
1803
|
+
let n = typeof e == "string" ? e : W(e);
|
|
1804
|
+
n = n.replace(/ $/, "%20");
|
|
1805
|
+
let t = tn.test(n) ? new URL(n) : new URL(n, "http://localhost");
|
|
1787
1806
|
return {
|
|
1788
|
-
pathname:
|
|
1789
|
-
search:
|
|
1790
|
-
hash:
|
|
1807
|
+
pathname: t.pathname,
|
|
1808
|
+
search: t.search,
|
|
1809
|
+
hash: t.hash
|
|
1791
1810
|
};
|
|
1792
1811
|
}
|
|
1793
1812
|
var tn = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, nn = {
|
|
@@ -1798,29 +1817,30 @@ var tn = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, nn = {
|
|
|
1798
1817
|
"\u2029": "\\u2029"
|
|
1799
1818
|
}, rn = /[&><\u2028\u2029]/g;
|
|
1800
1819
|
function an(e) {
|
|
1801
|
-
return e.replace(rn, (
|
|
1820
|
+
return e.replace(rn, (n) => nn[n]);
|
|
1802
1821
|
}
|
|
1803
1822
|
new TextEncoder();
|
|
1804
1823
|
[
|
|
1805
|
-
...
|
|
1824
|
+
...At
|
|
1806
1825
|
];
|
|
1807
1826
|
export {
|
|
1808
1827
|
Ne as L,
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1828
|
+
dn as N,
|
|
1829
|
+
hn as O,
|
|
1830
|
+
fn as R,
|
|
1831
|
+
pn as S,
|
|
1813
1832
|
re as a,
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1833
|
+
mn as b,
|
|
1834
|
+
un as c,
|
|
1835
|
+
sn as d,
|
|
1817
1836
|
dt as e,
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1837
|
+
cn as f,
|
|
1838
|
+
Bt as g,
|
|
1839
|
+
on as h,
|
|
1821
1840
|
we as i,
|
|
1822
|
-
|
|
1823
|
-
|
|
1841
|
+
et as j,
|
|
1842
|
+
B as m,
|
|
1843
|
+
ln as r,
|
|
1824
1844
|
N as u
|
|
1825
1845
|
};
|
|
1826
|
-
//# sourceMappingURL=chunk-BAXFHI7N-
|
|
1846
|
+
//# sourceMappingURL=chunk-BAXFHI7N-BLTsN6tl.js.map
|