zudoku 0.3.0-dev.82 → 0.3.0-dev.84
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/cli.js +5 -1
- package/dist/app/demo.js +5 -4
- package/dist/app/demo.js.map +1 -1
- package/dist/app/main.js +3 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js +5 -4
- package/dist/app/standalone.js.map +1 -1
- package/dist/config/validators/ResolvedSidebarSchema.d.ts +18 -0
- package/dist/config/validators/ResolvedSidebarSchema.js +76 -0
- package/dist/config/validators/ResolvedSidebarSchema.js.map +1 -0
- package/dist/config/validators/SidebarSchema.d.ts +177 -0
- package/dist/config/validators/SidebarSchema.js +71 -0
- package/dist/config/validators/SidebarSchema.js.map +1 -0
- package/dist/config/validators/validate.d.ts +411 -59
- package/dist/config/validators/validate.js +22 -4
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/components/DevPortal.js +1 -1
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +2 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +5 -5
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.d.ts +9 -3
- package/dist/lib/components/context/DevPortalProvider.js +11 -23
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/context/ThemeContext.d.ts +1 -4
- package/dist/lib/components/context/ThemeContext.js +3 -29
- package/dist/lib/components/context/ThemeContext.js.map +1 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +4 -0
- package/dist/lib/components/context/ThemeProvider.js +23 -0
- package/dist/lib/components/context/ThemeProvider.js.map +1 -0
- package/dist/lib/components/navigation/Sidebar.d.ts +1 -0
- package/dist/lib/components/navigation/Sidebar.js +12 -0
- package/dist/lib/components/navigation/Sidebar.js.map +1 -0
- package/dist/lib/components/navigation/SidebarBadge.d.ts +22 -0
- package/dist/lib/components/navigation/SidebarBadge.js +24 -0
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -0
- package/dist/lib/components/navigation/SidebarCategory.d.ts +5 -0
- package/dist/lib/components/navigation/SidebarCategory.js +33 -0
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -0
- package/dist/lib/components/navigation/SidebarItem.d.ts +12 -0
- package/dist/lib/components/navigation/SidebarItem.js +42 -0
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -0
- package/dist/lib/components/navigation/{SideNavigationWrapper.d.ts → SidebarWrapper.d.ts} +1 -1
- package/dist/lib/components/navigation/{SideNavigationWrapper.js → SidebarWrapper.js} +2 -2
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -0
- package/dist/lib/components/navigation/utils.d.ts +16 -0
- package/dist/lib/components/navigation/utils.js +85 -0
- package/dist/lib/components/navigation/utils.js.map +1 -0
- package/dist/lib/core/DevPortalContext.d.ts +9 -32
- package/dist/lib/core/DevPortalContext.js +8 -5
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +6 -8
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +16 -2
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.js +6 -0
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +5 -36
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.js +20 -43
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +12 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +14 -11
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +1 -1
- package/dist/lib/util/useScrollToAnchor.js +31 -17
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +3 -0
- package/dist/vite/plugin-sidebar.js +23 -0
- package/dist/vite/plugin-sidebar.js.map +1 -0
- package/dist/vite/plugin.js +2 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{AuthenticationPlugin-XS0DoAhE.js → AuthenticationPlugin-DgwV0hVu.js} +7 -7
- package/lib/{AuthenticationPlugin-XS0DoAhE.js.map → AuthenticationPlugin-DgwV0hVu.js.map} +1 -1
- package/lib/{CategoryHeading-DCmchnA1.js → CategoryHeading-BWq12Bfa.js} +3 -3
- package/lib/{CategoryHeading-DCmchnA1.js.map → CategoryHeading-BWq12Bfa.js.map} +1 -1
- package/lib/{Combination-C442XfGG.js → Combination-DkycFHkm.js} +4 -4
- package/lib/{Combination-C442XfGG.js.map → Combination-DkycFHkm.js.map} +1 -1
- package/lib/{DevPortalProvider-BWeAysxF.js → DevPortalProvider-CTxoCHIT.js} +375 -417
- package/lib/DevPortalProvider-CTxoCHIT.js.map +1 -0
- package/lib/DeveloperHint-BQSFXH01.js +10 -0
- package/lib/{DeveloperHint-DQVwIery.js.map → DeveloperHint-BQSFXH01.js.map} +1 -1
- package/lib/{Input-3IEt27jb.js → Input-BclXSY0g.js} +5 -5
- package/lib/{Input-3IEt27jb.js.map → Input-BclXSY0g.js.map} +1 -1
- package/lib/{Markdown-QsZ-PHET.js → Markdown-B_Gax7at.js} +1136 -1152
- package/lib/{Markdown-QsZ-PHET.js.map → Markdown-B_Gax7at.js.map} +1 -1
- package/lib/{MdxPage-CA1WmW14.js → MdxPage-Crlr0GmN.js} +67 -81
- package/lib/MdxPage-Crlr0GmN.js.map +1 -0
- package/lib/{OperationList-CHK_erYP.js → OperationList-nQ0bd8TU.js} +8 -8
- package/lib/{OperationList-CHK_erYP.js.map → OperationList-nQ0bd8TU.js.map} +1 -1
- package/lib/Route-CNvxEBnR.js +14 -0
- package/lib/{Route-D70pGn9n.js.map → Route-CNvxEBnR.js.map} +1 -1
- package/lib/{SlotletProvider-B71hNEUL.js → SlotletProvider-CzMAO73_.js} +12 -12
- package/lib/{SlotletProvider-B71hNEUL.js.map → SlotletProvider-CzMAO73_.js.map} +1 -1
- package/lib/Spinner-fF-Xv-gw.js +274 -0
- package/lib/Spinner-fF-Xv-gw.js.map +1 -0
- package/lib/index-7kcHaXD6.js +1771 -0
- package/lib/index-7kcHaXD6.js.map +1 -0
- package/lib/{index-Bl6YeerK.js → index-CgCPw6Jn.js} +1026 -1043
- package/lib/index-CgCPw6Jn.js.map +1 -0
- package/lib/{index-BH-Ub36F.js → index-DkuZvRNP.js} +4 -4
- package/lib/{index-BH-Ub36F.js.map → index-DkuZvRNP.js.map} +1 -1
- package/lib/joinPath-VeNuJa7y.js +8 -0
- package/lib/joinPath-VeNuJa7y.js.map +1 -0
- package/lib/jsx-runtime-B6kdoens.js +635 -0
- package/lib/jsx-runtime-B6kdoens.js.map +1 -0
- package/lib/{AnchorLink-BZcpTwOs.js → utils-CzT_9Tsn.js} +258 -214
- package/lib/utils-CzT_9Tsn.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +2 -2
- package/lib/zudoku.components.js +1229 -1227
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +129 -107
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-page.js +2 -2
- package/lib/zudoku.plugin-markdown.js +21 -38
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +8 -6
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/package.json +4 -1
- package/src/app/demo.tsx +5 -4
- package/src/app/main.css +2 -2
- package/src/app/main.tsx +3 -1
- package/src/app/standalone.tsx +5 -4
- package/src/lib/components/DevPortal.tsx +1 -1
- package/src/lib/components/Header.tsx +2 -2
- package/src/lib/components/Layout.tsx +2 -2
- package/src/lib/components/TopNavigation.tsx +5 -5
- package/src/lib/components/context/DevPortalProvider.ts +11 -28
- package/src/lib/components/context/ThemeContext.tsx +3 -41
- package/src/lib/components/context/ThemeProvider.tsx +27 -0
- package/src/lib/components/navigation/{SideNavigation.tsx → Sidebar.tsx} +7 -7
- package/src/lib/components/navigation/SidebarBadge.tsx +40 -0
- package/src/lib/components/navigation/SidebarCategory.tsx +105 -0
- package/src/lib/components/navigation/SidebarItem.tsx +96 -0
- package/src/lib/components/navigation/{SideNavigationWrapper.tsx → SidebarWrapper.tsx} +1 -1
- package/src/lib/components/navigation/utils.ts +120 -0
- package/src/lib/core/DevPortalContext.ts +12 -44
- package/src/lib/core/plugins.ts +6 -13
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +31 -10
- package/src/lib/plugins/api-keys/index.tsx +10 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +14 -50
- package/src/lib/plugins/markdown/generateRoutes.tsx +29 -57
- package/src/lib/plugins/openapi/Sidecar.tsx +15 -2
- package/src/lib/plugins/openapi/index.tsx +17 -23
- package/src/lib/plugins/openapi/interfaces.ts +1 -1
- package/src/lib/util/useScrollToAnchor.ts +39 -18
- package/dist/lib/components/navigation/SideNavigation.d.ts +0 -1
- package/dist/lib/components/navigation/SideNavigation.js +0 -12
- package/dist/lib/components/navigation/SideNavigation.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationCategory.d.ts +0 -4
- package/dist/lib/components/navigation/SideNavigationCategory.js +0 -26
- package/dist/lib/components/navigation/SideNavigationCategory.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -9
- package/dist/lib/components/navigation/SideNavigationItem.js +0 -44
- package/dist/lib/components/navigation/SideNavigationItem.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.js.map +0 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +0 -9
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js +0 -28
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +0 -1
- package/dist/lib/components/navigation/util.d.ts +0 -8
- package/dist/lib/components/navigation/util.js +0 -15
- package/dist/lib/components/navigation/util.js.map +0 -1
- package/dist/lib/plugins/openapi/MethodBadge.d.ts +0 -13
- package/dist/lib/plugins/openapi/MethodBadge.js +0 -26
- package/dist/lib/plugins/openapi/MethodBadge.js.map +0 -1
- package/dist/lib/util/traverseNavigation.d.ts +0 -6
- package/dist/lib/util/traverseNavigation.js +0 -30
- package/dist/lib/util/traverseNavigation.js.map +0 -1
- package/lib/AnchorLink-BZcpTwOs.js.map +0 -1
- package/lib/DevPortalProvider-BWeAysxF.js.map +0 -1
- package/lib/DeveloperHint-DQVwIery.js +0 -10
- package/lib/MdxPage-CA1WmW14.js.map +0 -1
- package/lib/Route-D70pGn9n.js +0 -13
- package/lib/Spinner-Coi7ORUV.js +0 -244
- package/lib/Spinner-Coi7ORUV.js.map +0 -1
- package/lib/index-Bl6YeerK.js.map +0 -1
- package/lib/index-Dt-pU7Vu.js +0 -916
- package/lib/index-Dt-pU7Vu.js.map +0 -1
- package/lib/jsx-runtime-CJBdjYYx.js +0 -1526
- package/lib/jsx-runtime-CJBdjYYx.js.map +0 -1
- package/src/lib/components/navigation/SideNavigationCategory.tsx +0 -72
- package/src/lib/components/navigation/SideNavigationItem.tsx +0 -148
- package/src/lib/components/navigation/useNavigationCollapsibleState.ts +0 -42
- package/src/lib/components/navigation/util.ts +0 -38
- package/src/lib/plugins/openapi/MethodBadge.tsx +0 -36
- package/src/lib/util/traverseNavigation.ts +0 -55
package/lib/index-Dt-pU7Vu.js
DELETED
|
@@ -1,916 +0,0 @@
|
|
|
1
|
-
import * as o from "react";
|
|
2
|
-
import * as ke from "react-dom";
|
|
3
|
-
import { f as O, g as he, a as ne, u as A, h as V, D as J, i as pe, R as re, k as ae, l as M, m as Ie, n as ve, o as ye, b as we, p as Ee, A as Ve, M as Me, N as He, O as Ke, q as Be, r as je, L as ze, s as We, t as ce, v as Ye, w as qe, x as Ge, y as Je, z as Xe, B as $e, C as Qe, E as Ze, F as et, G as tt, c as nt, H as rt, e as at, I as ot, J as it } from "./jsx-runtime-CJBdjYYx.js";
|
|
4
|
-
import { s as P, w as H, n as q, b as E, j as st, m as te, l as Se, x as be, y as Re, E as ge, z as lt, k as ut, A as ct, o as ft, q as dt, i as mt, t as ht, d as pt, p as vt, a as yt, u as wt, v as Et } from "./router-BiRCp01d.js";
|
|
5
|
-
/**
|
|
6
|
-
* React Router DOM v6.25.1
|
|
7
|
-
*
|
|
8
|
-
* Copyright (c) Remix Software Inc.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
12
|
-
*
|
|
13
|
-
* @license MIT
|
|
14
|
-
*/
|
|
15
|
-
function g() {
|
|
16
|
-
return g = Object.assign ? Object.assign.bind() : function(e) {
|
|
17
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
18
|
-
var n = arguments[t];
|
|
19
|
-
for (var a in n)
|
|
20
|
-
Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
|
|
21
|
-
}
|
|
22
|
-
return e;
|
|
23
|
-
}, g.apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
function oe(e, t) {
|
|
26
|
-
if (e == null) return {};
|
|
27
|
-
var n = {}, a = Object.keys(e), r, s;
|
|
28
|
-
for (s = 0; s < a.length; s++)
|
|
29
|
-
r = a[s], !(t.indexOf(r) >= 0) && (n[r] = e[r]);
|
|
30
|
-
return n;
|
|
31
|
-
}
|
|
32
|
-
const W = "get", Y = "application/x-www-form-urlencoded";
|
|
33
|
-
function X(e) {
|
|
34
|
-
return e != null && typeof e.tagName == "string";
|
|
35
|
-
}
|
|
36
|
-
function St(e) {
|
|
37
|
-
return X(e) && e.tagName.toLowerCase() === "button";
|
|
38
|
-
}
|
|
39
|
-
function bt(e) {
|
|
40
|
-
return X(e) && e.tagName.toLowerCase() === "form";
|
|
41
|
-
}
|
|
42
|
-
function Rt(e) {
|
|
43
|
-
return X(e) && e.tagName.toLowerCase() === "input";
|
|
44
|
-
}
|
|
45
|
-
function gt(e) {
|
|
46
|
-
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
47
|
-
}
|
|
48
|
-
function _t(e, t) {
|
|
49
|
-
return e.button === 0 && // Ignore everything but left clicks
|
|
50
|
-
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
51
|
-
!gt(e);
|
|
52
|
-
}
|
|
53
|
-
function G(e) {
|
|
54
|
-
return e === void 0 && (e = ""), new URLSearchParams(typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((t, n) => {
|
|
55
|
-
let a = e[n];
|
|
56
|
-
return t.concat(Array.isArray(a) ? a.map((r) => [n, r]) : [[n, a]]);
|
|
57
|
-
}, []));
|
|
58
|
-
}
|
|
59
|
-
function Nt(e, t) {
|
|
60
|
-
let n = G(e);
|
|
61
|
-
return t && t.forEach((a, r) => {
|
|
62
|
-
n.has(r) || t.getAll(r).forEach((s) => {
|
|
63
|
-
n.append(r, s);
|
|
64
|
-
});
|
|
65
|
-
}), n;
|
|
66
|
-
}
|
|
67
|
-
let j = null;
|
|
68
|
-
function Ct() {
|
|
69
|
-
if (j === null)
|
|
70
|
-
try {
|
|
71
|
-
new FormData(
|
|
72
|
-
document.createElement("form"),
|
|
73
|
-
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
74
|
-
0
|
|
75
|
-
), j = !1;
|
|
76
|
-
} catch {
|
|
77
|
-
j = !0;
|
|
78
|
-
}
|
|
79
|
-
return j;
|
|
80
|
-
}
|
|
81
|
-
const Tt = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
82
|
-
function ee(e) {
|
|
83
|
-
return e != null && !Tt.has(e) ? (process.env.NODE_ENV !== "production" && H(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + Y + '"')), null) : e;
|
|
84
|
-
}
|
|
85
|
-
function Lt(e, t) {
|
|
86
|
-
let n, a, r, s, i;
|
|
87
|
-
if (bt(e)) {
|
|
88
|
-
let u = e.getAttribute("action");
|
|
89
|
-
a = u ? P(u, t) : null, n = e.getAttribute("method") || W, r = ee(e.getAttribute("enctype")) || Y, s = new FormData(e);
|
|
90
|
-
} else if (St(e) || Rt(e) && (e.type === "submit" || e.type === "image")) {
|
|
91
|
-
let u = e.form;
|
|
92
|
-
if (u == null)
|
|
93
|
-
throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
|
|
94
|
-
let f = e.getAttribute("formaction") || u.getAttribute("action");
|
|
95
|
-
if (a = f ? P(f, t) : null, n = e.getAttribute("formmethod") || u.getAttribute("method") || W, r = ee(e.getAttribute("formenctype")) || ee(u.getAttribute("enctype")) || Y, s = new FormData(u, e), !Ct()) {
|
|
96
|
-
let {
|
|
97
|
-
name: l,
|
|
98
|
-
type: c,
|
|
99
|
-
value: m
|
|
100
|
-
} = e;
|
|
101
|
-
if (c === "image") {
|
|
102
|
-
let h = l ? l + "." : "";
|
|
103
|
-
s.append(h + "x", "0"), s.append(h + "y", "0");
|
|
104
|
-
} else l && s.append(l, m);
|
|
105
|
-
}
|
|
106
|
-
} else {
|
|
107
|
-
if (X(e))
|
|
108
|
-
throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
|
|
109
|
-
n = W, a = null, r = Y, i = e;
|
|
110
|
-
}
|
|
111
|
-
return s && r === "text/plain" && (i = s, s = void 0), {
|
|
112
|
-
action: a,
|
|
113
|
-
method: n.toLowerCase(),
|
|
114
|
-
encType: r,
|
|
115
|
-
formData: s,
|
|
116
|
-
body: i
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
const xt = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"], Ft = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"], Pt = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"], Dt = "6";
|
|
120
|
-
try {
|
|
121
|
-
window.__reactRouterVersion = Dt;
|
|
122
|
-
} catch {
|
|
123
|
-
}
|
|
124
|
-
function Ot(e, t) {
|
|
125
|
-
return Se({
|
|
126
|
-
basename: t == null ? void 0 : t.basename,
|
|
127
|
-
future: g({}, t == null ? void 0 : t.future, {
|
|
128
|
-
v7_prependBasename: !0
|
|
129
|
-
}),
|
|
130
|
-
history: be({
|
|
131
|
-
window: t == null ? void 0 : t.window
|
|
132
|
-
}),
|
|
133
|
-
hydrationData: (t == null ? void 0 : t.hydrationData) || _e(),
|
|
134
|
-
routes: e,
|
|
135
|
-
mapRouteProperties: ve,
|
|
136
|
-
unstable_dataStrategy: t == null ? void 0 : t.unstable_dataStrategy,
|
|
137
|
-
unstable_patchRoutesOnMiss: t == null ? void 0 : t.unstable_patchRoutesOnMiss,
|
|
138
|
-
window: t == null ? void 0 : t.window
|
|
139
|
-
}).initialize();
|
|
140
|
-
}
|
|
141
|
-
function At(e, t) {
|
|
142
|
-
return Se({
|
|
143
|
-
basename: t == null ? void 0 : t.basename,
|
|
144
|
-
future: g({}, t == null ? void 0 : t.future, {
|
|
145
|
-
v7_prependBasename: !0
|
|
146
|
-
}),
|
|
147
|
-
history: Re({
|
|
148
|
-
window: t == null ? void 0 : t.window
|
|
149
|
-
}),
|
|
150
|
-
hydrationData: (t == null ? void 0 : t.hydrationData) || _e(),
|
|
151
|
-
routes: e,
|
|
152
|
-
mapRouteProperties: ve,
|
|
153
|
-
unstable_dataStrategy: t == null ? void 0 : t.unstable_dataStrategy,
|
|
154
|
-
unstable_patchRoutesOnMiss: t == null ? void 0 : t.unstable_patchRoutesOnMiss,
|
|
155
|
-
window: t == null ? void 0 : t.window
|
|
156
|
-
}).initialize();
|
|
157
|
-
}
|
|
158
|
-
function _e() {
|
|
159
|
-
var e;
|
|
160
|
-
let t = (e = window) == null ? void 0 : e.__staticRouterHydrationData;
|
|
161
|
-
return t && t.errors && (t = g({}, t, {
|
|
162
|
-
errors: Ut(t.errors)
|
|
163
|
-
})), t;
|
|
164
|
-
}
|
|
165
|
-
function Ut(e) {
|
|
166
|
-
if (!e) return null;
|
|
167
|
-
let t = Object.entries(e), n = {};
|
|
168
|
-
for (let [a, r] of t)
|
|
169
|
-
if (r && r.__type === "RouteErrorResponse")
|
|
170
|
-
n[a] = new ge(r.status, r.statusText, r.data, r.internal === !0);
|
|
171
|
-
else if (r && r.__type === "Error") {
|
|
172
|
-
if (r.__subType) {
|
|
173
|
-
let s = window[r.__subType];
|
|
174
|
-
if (typeof s == "function")
|
|
175
|
-
try {
|
|
176
|
-
let i = new s(r.message);
|
|
177
|
-
i.stack = "", n[a] = i;
|
|
178
|
-
} catch {
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
if (n[a] == null) {
|
|
182
|
-
let s = new Error(r.message);
|
|
183
|
-
s.stack = "", n[a] = s;
|
|
184
|
-
}
|
|
185
|
-
} else
|
|
186
|
-
n[a] = r;
|
|
187
|
-
return n;
|
|
188
|
-
}
|
|
189
|
-
const $ = /* @__PURE__ */ o.createContext({
|
|
190
|
-
isTransitioning: !1
|
|
191
|
-
});
|
|
192
|
-
process.env.NODE_ENV !== "production" && ($.displayName = "ViewTransition");
|
|
193
|
-
const Q = /* @__PURE__ */ o.createContext(/* @__PURE__ */ new Map());
|
|
194
|
-
process.env.NODE_ENV !== "production" && (Q.displayName = "Fetchers");
|
|
195
|
-
const kt = "startTransition", L = o[kt], It = "flushSync", fe = ke[It], Vt = "useId", de = o[Vt];
|
|
196
|
-
function Mt(e) {
|
|
197
|
-
L ? L(e) : e();
|
|
198
|
-
}
|
|
199
|
-
function k(e) {
|
|
200
|
-
fe ? fe(e) : e();
|
|
201
|
-
}
|
|
202
|
-
class Ht {
|
|
203
|
-
constructor() {
|
|
204
|
-
this.status = "pending", this.promise = new Promise((t, n) => {
|
|
205
|
-
this.resolve = (a) => {
|
|
206
|
-
this.status === "pending" && (this.status = "resolved", t(a));
|
|
207
|
-
}, this.reject = (a) => {
|
|
208
|
-
this.status === "pending" && (this.status = "rejected", n(a));
|
|
209
|
-
};
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
function Kt(e) {
|
|
214
|
-
let {
|
|
215
|
-
fallbackElement: t,
|
|
216
|
-
router: n,
|
|
217
|
-
future: a
|
|
218
|
-
} = e, [r, s] = o.useState(n.state), [i, u] = o.useState(), [f, l] = o.useState({
|
|
219
|
-
isTransitioning: !1
|
|
220
|
-
}), [c, m] = o.useState(), [h, S] = o.useState(), [w, _] = o.useState(), b = o.useRef(/* @__PURE__ */ new Map()), {
|
|
221
|
-
v7_startTransition: N
|
|
222
|
-
} = a || {}, d = o.useCallback((y) => {
|
|
223
|
-
N ? Mt(y) : y();
|
|
224
|
-
}, [N]), p = o.useCallback((y, C) => {
|
|
225
|
-
let {
|
|
226
|
-
deletedFetchers: R,
|
|
227
|
-
unstable_flushSync: B,
|
|
228
|
-
unstable_viewTransitionOpts: x
|
|
229
|
-
} = C;
|
|
230
|
-
R.forEach((F) => b.current.delete(F)), y.fetchers.forEach((F, Ue) => {
|
|
231
|
-
F.data !== void 0 && b.current.set(Ue, F.data);
|
|
232
|
-
});
|
|
233
|
-
let Ae = n.window == null || n.window.document == null || typeof n.window.document.startViewTransition != "function";
|
|
234
|
-
if (!x || Ae) {
|
|
235
|
-
B ? k(() => s(y)) : d(() => s(y));
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
if (B) {
|
|
239
|
-
k(() => {
|
|
240
|
-
h && (c && c.resolve(), h.skipTransition()), l({
|
|
241
|
-
isTransitioning: !0,
|
|
242
|
-
flushSync: !0,
|
|
243
|
-
currentLocation: x.currentLocation,
|
|
244
|
-
nextLocation: x.nextLocation
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
let F = n.window.document.startViewTransition(() => {
|
|
248
|
-
k(() => s(y));
|
|
249
|
-
});
|
|
250
|
-
F.finished.finally(() => {
|
|
251
|
-
k(() => {
|
|
252
|
-
m(void 0), S(void 0), u(void 0), l({
|
|
253
|
-
isTransitioning: !1
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
}), k(() => S(F));
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
h ? (c && c.resolve(), h.skipTransition(), _({
|
|
260
|
-
state: y,
|
|
261
|
-
currentLocation: x.currentLocation,
|
|
262
|
-
nextLocation: x.nextLocation
|
|
263
|
-
})) : (u(y), l({
|
|
264
|
-
isTransitioning: !0,
|
|
265
|
-
flushSync: !1,
|
|
266
|
-
currentLocation: x.currentLocation,
|
|
267
|
-
nextLocation: x.nextLocation
|
|
268
|
-
}));
|
|
269
|
-
}, [n.window, h, c, b, d]);
|
|
270
|
-
o.useLayoutEffect(() => n.subscribe(p), [n, p]), o.useEffect(() => {
|
|
271
|
-
f.isTransitioning && !f.flushSync && m(new Ht());
|
|
272
|
-
}, [f]), o.useEffect(() => {
|
|
273
|
-
if (c && i && n.window) {
|
|
274
|
-
let y = i, C = c.promise, R = n.window.document.startViewTransition(async () => {
|
|
275
|
-
d(() => s(y)), await C;
|
|
276
|
-
});
|
|
277
|
-
R.finished.finally(() => {
|
|
278
|
-
m(void 0), S(void 0), u(void 0), l({
|
|
279
|
-
isTransitioning: !1
|
|
280
|
-
});
|
|
281
|
-
}), S(R);
|
|
282
|
-
}
|
|
283
|
-
}, [d, i, c, n.window]), o.useEffect(() => {
|
|
284
|
-
c && i && r.location.key === i.location.key && c.resolve();
|
|
285
|
-
}, [c, h, r.location, i]), o.useEffect(() => {
|
|
286
|
-
!f.isTransitioning && w && (u(w.state), l({
|
|
287
|
-
isTransitioning: !0,
|
|
288
|
-
flushSync: !1,
|
|
289
|
-
currentLocation: w.currentLocation,
|
|
290
|
-
nextLocation: w.nextLocation
|
|
291
|
-
}), _(void 0));
|
|
292
|
-
}, [f.isTransitioning, w]), o.useEffect(() => {
|
|
293
|
-
process.env.NODE_ENV !== "production" && H(t == null || !n.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead");
|
|
294
|
-
}, []);
|
|
295
|
-
let v = o.useMemo(() => ({
|
|
296
|
-
createHref: n.createHref,
|
|
297
|
-
encodeLocation: n.encodeLocation,
|
|
298
|
-
go: (y) => n.navigate(y),
|
|
299
|
-
push: (y, C, R) => n.navigate(y, {
|
|
300
|
-
state: C,
|
|
301
|
-
preventScrollReset: R == null ? void 0 : R.preventScrollReset
|
|
302
|
-
}),
|
|
303
|
-
replace: (y, C, R) => n.navigate(y, {
|
|
304
|
-
replace: !0,
|
|
305
|
-
state: C,
|
|
306
|
-
preventScrollReset: R == null ? void 0 : R.preventScrollReset
|
|
307
|
-
})
|
|
308
|
-
}), [n]), T = n.basename || "/", U = o.useMemo(() => ({
|
|
309
|
-
router: n,
|
|
310
|
-
navigator: v,
|
|
311
|
-
static: !1,
|
|
312
|
-
basename: T
|
|
313
|
-
}), [n, v, T]), K = o.useMemo(() => ({
|
|
314
|
-
v7_relativeSplatPath: n.future.v7_relativeSplatPath
|
|
315
|
-
}), [n.future.v7_relativeSplatPath]);
|
|
316
|
-
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(ae.Provider, {
|
|
317
|
-
value: U
|
|
318
|
-
}, /* @__PURE__ */ o.createElement(J.Provider, {
|
|
319
|
-
value: r
|
|
320
|
-
}, /* @__PURE__ */ o.createElement(Q.Provider, {
|
|
321
|
-
value: b.current
|
|
322
|
-
}, /* @__PURE__ */ o.createElement($.Provider, {
|
|
323
|
-
value: f
|
|
324
|
-
}, /* @__PURE__ */ o.createElement(M, {
|
|
325
|
-
basename: T,
|
|
326
|
-
location: r.location,
|
|
327
|
-
navigationType: r.historyAction,
|
|
328
|
-
navigator: v,
|
|
329
|
-
future: K
|
|
330
|
-
}, r.initialized || n.future.v7_partialHydration ? /* @__PURE__ */ o.createElement(Bt, {
|
|
331
|
-
routes: n.routes,
|
|
332
|
-
future: n.future,
|
|
333
|
-
state: r
|
|
334
|
-
}) : t))))), null);
|
|
335
|
-
}
|
|
336
|
-
const Bt = /* @__PURE__ */ o.memo(jt);
|
|
337
|
-
function jt(e) {
|
|
338
|
-
let {
|
|
339
|
-
routes: t,
|
|
340
|
-
future: n,
|
|
341
|
-
state: a
|
|
342
|
-
} = e;
|
|
343
|
-
return Ie(t, void 0, a, n);
|
|
344
|
-
}
|
|
345
|
-
function zt(e) {
|
|
346
|
-
let {
|
|
347
|
-
basename: t,
|
|
348
|
-
children: n,
|
|
349
|
-
future: a,
|
|
350
|
-
window: r
|
|
351
|
-
} = e, s = o.useRef();
|
|
352
|
-
s.current == null && (s.current = be({
|
|
353
|
-
window: r,
|
|
354
|
-
v5Compat: !0
|
|
355
|
-
}));
|
|
356
|
-
let i = s.current, [u, f] = o.useState({
|
|
357
|
-
action: i.action,
|
|
358
|
-
location: i.location
|
|
359
|
-
}), {
|
|
360
|
-
v7_startTransition: l
|
|
361
|
-
} = a || {}, c = o.useCallback((m) => {
|
|
362
|
-
l && L ? L(() => f(m)) : f(m);
|
|
363
|
-
}, [f, l]);
|
|
364
|
-
return o.useLayoutEffect(() => i.listen(c), [i, c]), /* @__PURE__ */ o.createElement(M, {
|
|
365
|
-
basename: t,
|
|
366
|
-
children: n,
|
|
367
|
-
location: u.location,
|
|
368
|
-
navigationType: u.action,
|
|
369
|
-
navigator: i,
|
|
370
|
-
future: a
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
function Wt(e) {
|
|
374
|
-
let {
|
|
375
|
-
basename: t,
|
|
376
|
-
children: n,
|
|
377
|
-
future: a,
|
|
378
|
-
window: r
|
|
379
|
-
} = e, s = o.useRef();
|
|
380
|
-
s.current == null && (s.current = Re({
|
|
381
|
-
window: r,
|
|
382
|
-
v5Compat: !0
|
|
383
|
-
}));
|
|
384
|
-
let i = s.current, [u, f] = o.useState({
|
|
385
|
-
action: i.action,
|
|
386
|
-
location: i.location
|
|
387
|
-
}), {
|
|
388
|
-
v7_startTransition: l
|
|
389
|
-
} = a || {}, c = o.useCallback((m) => {
|
|
390
|
-
l && L ? L(() => f(m)) : f(m);
|
|
391
|
-
}, [f, l]);
|
|
392
|
-
return o.useLayoutEffect(() => i.listen(c), [i, c]), /* @__PURE__ */ o.createElement(M, {
|
|
393
|
-
basename: t,
|
|
394
|
-
children: n,
|
|
395
|
-
location: u.location,
|
|
396
|
-
navigationType: u.action,
|
|
397
|
-
navigator: i,
|
|
398
|
-
future: a
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
function Ne(e) {
|
|
402
|
-
let {
|
|
403
|
-
basename: t,
|
|
404
|
-
children: n,
|
|
405
|
-
future: a,
|
|
406
|
-
history: r
|
|
407
|
-
} = e, [s, i] = o.useState({
|
|
408
|
-
action: r.action,
|
|
409
|
-
location: r.location
|
|
410
|
-
}), {
|
|
411
|
-
v7_startTransition: u
|
|
412
|
-
} = a || {}, f = o.useCallback((l) => {
|
|
413
|
-
u && L ? L(() => i(l)) : i(l);
|
|
414
|
-
}, [i, u]);
|
|
415
|
-
return o.useLayoutEffect(() => r.listen(f), [r, f]), /* @__PURE__ */ o.createElement(M, {
|
|
416
|
-
basename: t,
|
|
417
|
-
children: n,
|
|
418
|
-
location: s.location,
|
|
419
|
-
navigationType: s.action,
|
|
420
|
-
navigator: r,
|
|
421
|
-
future: a
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
process.env.NODE_ENV !== "production" && (Ne.displayName = "unstable_HistoryRouter");
|
|
425
|
-
const Yt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", qt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ie = /* @__PURE__ */ o.forwardRef(function(t, n) {
|
|
426
|
-
let {
|
|
427
|
-
onClick: a,
|
|
428
|
-
relative: r,
|
|
429
|
-
reloadDocument: s,
|
|
430
|
-
replace: i,
|
|
431
|
-
state: u,
|
|
432
|
-
target: f,
|
|
433
|
-
to: l,
|
|
434
|
-
preventScrollReset: c,
|
|
435
|
-
unstable_viewTransition: m
|
|
436
|
-
} = t, h = oe(t, xt), {
|
|
437
|
-
basename: S
|
|
438
|
-
} = o.useContext(O), w, _ = !1;
|
|
439
|
-
if (typeof l == "string" && qt.test(l) && (w = l, Yt))
|
|
440
|
-
try {
|
|
441
|
-
let p = new URL(window.location.href), v = l.startsWith("//") ? new URL(p.protocol + l) : new URL(l), T = P(v.pathname, S);
|
|
442
|
-
v.origin === p.origin && T != null ? l = T + v.search + v.hash : _ = !0;
|
|
443
|
-
} catch {
|
|
444
|
-
process.env.NODE_ENV !== "production" && H(!1, '<Link to="' + l + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
|
|
445
|
-
}
|
|
446
|
-
let b = he(l, {
|
|
447
|
-
relative: r
|
|
448
|
-
}), N = xe(l, {
|
|
449
|
-
replace: i,
|
|
450
|
-
state: u,
|
|
451
|
-
target: f,
|
|
452
|
-
preventScrollReset: c,
|
|
453
|
-
relative: r,
|
|
454
|
-
unstable_viewTransition: m
|
|
455
|
-
});
|
|
456
|
-
function d(p) {
|
|
457
|
-
a && a(p), p.defaultPrevented || N(p);
|
|
458
|
-
}
|
|
459
|
-
return (
|
|
460
|
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
461
|
-
/* @__PURE__ */ o.createElement("a", g({}, h, {
|
|
462
|
-
href: w || b,
|
|
463
|
-
onClick: _ || s ? a : d,
|
|
464
|
-
ref: n,
|
|
465
|
-
target: f
|
|
466
|
-
}))
|
|
467
|
-
);
|
|
468
|
-
});
|
|
469
|
-
process.env.NODE_ENV !== "production" && (ie.displayName = "Link");
|
|
470
|
-
const Ce = /* @__PURE__ */ o.forwardRef(function(t, n) {
|
|
471
|
-
let {
|
|
472
|
-
"aria-current": a = "page",
|
|
473
|
-
caseSensitive: r = !1,
|
|
474
|
-
className: s = "",
|
|
475
|
-
end: i = !1,
|
|
476
|
-
style: u,
|
|
477
|
-
to: f,
|
|
478
|
-
unstable_viewTransition: l,
|
|
479
|
-
children: c
|
|
480
|
-
} = t, m = oe(t, Ft), h = V(f, {
|
|
481
|
-
relative: m.relative
|
|
482
|
-
}), S = A(), w = o.useContext(J), {
|
|
483
|
-
navigator: _,
|
|
484
|
-
basename: b
|
|
485
|
-
} = o.useContext(O), N = w != null && // Conditional usage is OK here because the usage of a data router is static
|
|
486
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
487
|
-
Oe(h) && l === !0, d = _.encodeLocation ? _.encodeLocation(h).pathname : h.pathname, p = S.pathname, v = w && w.navigation && w.navigation.location ? w.navigation.location.pathname : null;
|
|
488
|
-
r || (p = p.toLowerCase(), v = v ? v.toLowerCase() : null, d = d.toLowerCase()), v && b && (v = P(v, b) || v);
|
|
489
|
-
const T = d !== "/" && d.endsWith("/") ? d.length - 1 : d.length;
|
|
490
|
-
let U = p === d || !i && p.startsWith(d) && p.charAt(T) === "/", K = v != null && (v === d || !i && v.startsWith(d) && v.charAt(d.length) === "/"), y = {
|
|
491
|
-
isActive: U,
|
|
492
|
-
isPending: K,
|
|
493
|
-
isTransitioning: N
|
|
494
|
-
}, C = U ? a : void 0, R;
|
|
495
|
-
typeof s == "function" ? R = s(y) : R = [s, U ? "active" : null, K ? "pending" : null, N ? "transitioning" : null].filter(Boolean).join(" ");
|
|
496
|
-
let B = typeof u == "function" ? u(y) : u;
|
|
497
|
-
return /* @__PURE__ */ o.createElement(ie, g({}, m, {
|
|
498
|
-
"aria-current": C,
|
|
499
|
-
className: R,
|
|
500
|
-
ref: n,
|
|
501
|
-
style: B,
|
|
502
|
-
to: f,
|
|
503
|
-
unstable_viewTransition: l
|
|
504
|
-
}), typeof c == "function" ? c(y) : c);
|
|
505
|
-
});
|
|
506
|
-
process.env.NODE_ENV !== "production" && (Ce.displayName = "NavLink");
|
|
507
|
-
const se = /* @__PURE__ */ o.forwardRef((e, t) => {
|
|
508
|
-
let {
|
|
509
|
-
fetcherKey: n,
|
|
510
|
-
navigate: a,
|
|
511
|
-
reloadDocument: r,
|
|
512
|
-
replace: s,
|
|
513
|
-
state: i,
|
|
514
|
-
method: u = W,
|
|
515
|
-
action: f,
|
|
516
|
-
onSubmit: l,
|
|
517
|
-
relative: c,
|
|
518
|
-
preventScrollReset: m,
|
|
519
|
-
unstable_viewTransition: h
|
|
520
|
-
} = e, S = oe(e, Pt), w = ue(), _ = Pe(f, {
|
|
521
|
-
relative: c
|
|
522
|
-
}), b = u.toLowerCase() === "get" ? "get" : "post", N = (d) => {
|
|
523
|
-
if (l && l(d), d.defaultPrevented) return;
|
|
524
|
-
d.preventDefault();
|
|
525
|
-
let p = d.nativeEvent.submitter, v = (p == null ? void 0 : p.getAttribute("formmethod")) || u;
|
|
526
|
-
w(p || d.currentTarget, {
|
|
527
|
-
fetcherKey: n,
|
|
528
|
-
method: v,
|
|
529
|
-
navigate: a,
|
|
530
|
-
replace: s,
|
|
531
|
-
state: i,
|
|
532
|
-
relative: c,
|
|
533
|
-
preventScrollReset: m,
|
|
534
|
-
unstable_viewTransition: h
|
|
535
|
-
});
|
|
536
|
-
};
|
|
537
|
-
return /* @__PURE__ */ o.createElement("form", g({
|
|
538
|
-
ref: t,
|
|
539
|
-
method: b,
|
|
540
|
-
action: _,
|
|
541
|
-
onSubmit: r ? l : N
|
|
542
|
-
}, S));
|
|
543
|
-
});
|
|
544
|
-
process.env.NODE_ENV !== "production" && (se.displayName = "Form");
|
|
545
|
-
function Te(e) {
|
|
546
|
-
let {
|
|
547
|
-
getKey: t,
|
|
548
|
-
storageKey: n
|
|
549
|
-
} = e;
|
|
550
|
-
return De({
|
|
551
|
-
getKey: t,
|
|
552
|
-
storageKey: n
|
|
553
|
-
}), null;
|
|
554
|
-
}
|
|
555
|
-
process.env.NODE_ENV !== "production" && (Te.displayName = "ScrollRestoration");
|
|
556
|
-
var D;
|
|
557
|
-
(function(e) {
|
|
558
|
-
e.UseScrollRestoration = "useScrollRestoration", e.UseSubmit = "useSubmit", e.UseSubmitFetcher = "useSubmitFetcher", e.UseFetcher = "useFetcher", e.useViewTransitionState = "useViewTransitionState";
|
|
559
|
-
})(D || (D = {}));
|
|
560
|
-
var I;
|
|
561
|
-
(function(e) {
|
|
562
|
-
e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration";
|
|
563
|
-
})(I || (I = {}));
|
|
564
|
-
function Le(e) {
|
|
565
|
-
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
566
|
-
}
|
|
567
|
-
function Z(e) {
|
|
568
|
-
let t = o.useContext(ae);
|
|
569
|
-
return t || (process.env.NODE_ENV !== "production" ? E(!1, Le(e)) : E(!1)), t;
|
|
570
|
-
}
|
|
571
|
-
function le(e) {
|
|
572
|
-
let t = o.useContext(J);
|
|
573
|
-
return t || (process.env.NODE_ENV !== "production" ? E(!1, Le(e)) : E(!1)), t;
|
|
574
|
-
}
|
|
575
|
-
function xe(e, t) {
|
|
576
|
-
let {
|
|
577
|
-
target: n,
|
|
578
|
-
replace: a,
|
|
579
|
-
state: r,
|
|
580
|
-
preventScrollReset: s,
|
|
581
|
-
relative: i,
|
|
582
|
-
unstable_viewTransition: u
|
|
583
|
-
} = t === void 0 ? {} : t, f = ne(), l = A(), c = V(e, {
|
|
584
|
-
relative: i
|
|
585
|
-
});
|
|
586
|
-
return o.useCallback((m) => {
|
|
587
|
-
if (_t(m, n)) {
|
|
588
|
-
m.preventDefault();
|
|
589
|
-
let h = a !== void 0 ? a : q(l) === q(c);
|
|
590
|
-
f(e, {
|
|
591
|
-
replace: h,
|
|
592
|
-
state: r,
|
|
593
|
-
preventScrollReset: s,
|
|
594
|
-
relative: i,
|
|
595
|
-
unstable_viewTransition: u
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
}, [l, f, c, a, r, n, e, s, i, u]);
|
|
599
|
-
}
|
|
600
|
-
function Gt(e) {
|
|
601
|
-
process.env.NODE_ENV !== "production" && H(typeof URLSearchParams < "u", "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.");
|
|
602
|
-
let t = o.useRef(G(e)), n = o.useRef(!1), a = A(), r = o.useMemo(() => (
|
|
603
|
-
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
604
|
-
// Once we call that we want those to take precedence, otherwise you can't
|
|
605
|
-
// remove a param with setSearchParams({}) if it has an initial value
|
|
606
|
-
Nt(a.search, n.current ? null : t.current)
|
|
607
|
-
), [a.search]), s = ne(), i = o.useCallback((u, f) => {
|
|
608
|
-
const l = G(typeof u == "function" ? u(r) : u);
|
|
609
|
-
n.current = !0, s("?" + l, f);
|
|
610
|
-
}, [s, r]);
|
|
611
|
-
return [r, i];
|
|
612
|
-
}
|
|
613
|
-
function Jt() {
|
|
614
|
-
if (typeof document > "u")
|
|
615
|
-
throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
|
|
616
|
-
}
|
|
617
|
-
let Xt = 0, Fe = () => "__" + String(++Xt) + "__";
|
|
618
|
-
function ue() {
|
|
619
|
-
let {
|
|
620
|
-
router: e
|
|
621
|
-
} = Z(D.UseSubmit), {
|
|
622
|
-
basename: t
|
|
623
|
-
} = o.useContext(O), n = pe();
|
|
624
|
-
return o.useCallback(function(a, r) {
|
|
625
|
-
r === void 0 && (r = {}), Jt();
|
|
626
|
-
let {
|
|
627
|
-
action: s,
|
|
628
|
-
method: i,
|
|
629
|
-
encType: u,
|
|
630
|
-
formData: f,
|
|
631
|
-
body: l
|
|
632
|
-
} = Lt(a, t);
|
|
633
|
-
if (r.navigate === !1) {
|
|
634
|
-
let c = r.fetcherKey || Fe();
|
|
635
|
-
e.fetch(c, n, r.action || s, {
|
|
636
|
-
preventScrollReset: r.preventScrollReset,
|
|
637
|
-
formData: f,
|
|
638
|
-
body: l,
|
|
639
|
-
formMethod: r.method || i,
|
|
640
|
-
formEncType: r.encType || u,
|
|
641
|
-
unstable_flushSync: r.unstable_flushSync
|
|
642
|
-
});
|
|
643
|
-
} else
|
|
644
|
-
e.navigate(r.action || s, {
|
|
645
|
-
preventScrollReset: r.preventScrollReset,
|
|
646
|
-
formData: f,
|
|
647
|
-
body: l,
|
|
648
|
-
formMethod: r.method || i,
|
|
649
|
-
formEncType: r.encType || u,
|
|
650
|
-
replace: r.replace,
|
|
651
|
-
state: r.state,
|
|
652
|
-
fromRouteId: n,
|
|
653
|
-
unstable_flushSync: r.unstable_flushSync,
|
|
654
|
-
unstable_viewTransition: r.unstable_viewTransition
|
|
655
|
-
});
|
|
656
|
-
}, [e, t, n]);
|
|
657
|
-
}
|
|
658
|
-
function Pe(e, t) {
|
|
659
|
-
let {
|
|
660
|
-
relative: n
|
|
661
|
-
} = t === void 0 ? {} : t, {
|
|
662
|
-
basename: a
|
|
663
|
-
} = o.useContext(O), r = o.useContext(re);
|
|
664
|
-
r || (process.env.NODE_ENV !== "production" ? E(!1, "useFormAction must be used inside a RouteContext") : E(!1));
|
|
665
|
-
let [s] = r.matches.slice(-1), i = g({}, V(e || ".", {
|
|
666
|
-
relative: n
|
|
667
|
-
})), u = A();
|
|
668
|
-
if (e == null) {
|
|
669
|
-
i.search = u.search;
|
|
670
|
-
let f = new URLSearchParams(i.search);
|
|
671
|
-
f.has("index") && f.get("index") === "" && (f.delete("index"), i.search = f.toString() ? "?" + f.toString() : "");
|
|
672
|
-
}
|
|
673
|
-
return (!e || e === ".") && s.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), a !== "/" && (i.pathname = i.pathname === "/" ? a : st([a, i.pathname])), q(i);
|
|
674
|
-
}
|
|
675
|
-
function $t(e) {
|
|
676
|
-
var t;
|
|
677
|
-
let {
|
|
678
|
-
key: n
|
|
679
|
-
} = e === void 0 ? {} : e, {
|
|
680
|
-
router: a
|
|
681
|
-
} = Z(D.UseFetcher), r = le(I.UseFetcher), s = o.useContext(Q), i = o.useContext(re), u = (t = i.matches[i.matches.length - 1]) == null ? void 0 : t.route.id;
|
|
682
|
-
s || (process.env.NODE_ENV !== "production" ? E(!1, "useFetcher must be used inside a FetchersContext") : E(!1)), i || (process.env.NODE_ENV !== "production" ? E(!1, "useFetcher must be used inside a RouteContext") : E(!1)), u == null && (process.env.NODE_ENV !== "production" ? E(!1, 'useFetcher can only be used on routes that contain a unique "id"') : E(!1));
|
|
683
|
-
let f = de ? de() : "", [l, c] = o.useState(n || f);
|
|
684
|
-
n && n !== l ? c(n) : l || c(Fe()), o.useEffect(() => (a.getFetcher(l), () => {
|
|
685
|
-
a.deleteFetcher(l);
|
|
686
|
-
}), [a, l]);
|
|
687
|
-
let m = o.useCallback((d, p) => {
|
|
688
|
-
u || (process.env.NODE_ENV !== "production" ? E(!1, "No routeId available for fetcher.load()") : E(!1)), a.fetch(l, u, d, p);
|
|
689
|
-
}, [l, u, a]), h = ue(), S = o.useCallback((d, p) => {
|
|
690
|
-
h(d, g({}, p, {
|
|
691
|
-
navigate: !1,
|
|
692
|
-
fetcherKey: l
|
|
693
|
-
}));
|
|
694
|
-
}, [l, h]), w = o.useMemo(() => {
|
|
695
|
-
let d = /* @__PURE__ */ o.forwardRef((p, v) => /* @__PURE__ */ o.createElement(se, g({}, p, {
|
|
696
|
-
navigate: !1,
|
|
697
|
-
fetcherKey: l,
|
|
698
|
-
ref: v
|
|
699
|
-
})));
|
|
700
|
-
return process.env.NODE_ENV !== "production" && (d.displayName = "fetcher.Form"), d;
|
|
701
|
-
}, [l]), _ = r.fetchers.get(l) || lt, b = s.get(l);
|
|
702
|
-
return o.useMemo(() => g({
|
|
703
|
-
Form: w,
|
|
704
|
-
submit: S,
|
|
705
|
-
load: m
|
|
706
|
-
}, _, {
|
|
707
|
-
data: b
|
|
708
|
-
}), [w, S, m, _, b]);
|
|
709
|
-
}
|
|
710
|
-
function Qt() {
|
|
711
|
-
let e = le(I.UseFetchers);
|
|
712
|
-
return Array.from(e.fetchers.entries()).map((t) => {
|
|
713
|
-
let [n, a] = t;
|
|
714
|
-
return g({}, a, {
|
|
715
|
-
key: n
|
|
716
|
-
});
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
const me = "react-router-scroll-positions";
|
|
720
|
-
let z = {};
|
|
721
|
-
function De(e) {
|
|
722
|
-
let {
|
|
723
|
-
getKey: t,
|
|
724
|
-
storageKey: n
|
|
725
|
-
} = e === void 0 ? {} : e, {
|
|
726
|
-
router: a
|
|
727
|
-
} = Z(D.UseScrollRestoration), {
|
|
728
|
-
restoreScrollPosition: r,
|
|
729
|
-
preventScrollReset: s
|
|
730
|
-
} = le(I.UseScrollRestoration), {
|
|
731
|
-
basename: i
|
|
732
|
-
} = o.useContext(O), u = A(), f = ye(), l = we();
|
|
733
|
-
o.useEffect(() => (window.history.scrollRestoration = "manual", () => {
|
|
734
|
-
window.history.scrollRestoration = "auto";
|
|
735
|
-
}), []), en(o.useCallback(() => {
|
|
736
|
-
if (l.state === "idle") {
|
|
737
|
-
let c = (t ? t(u, f) : null) || u.key;
|
|
738
|
-
z[c] = window.scrollY;
|
|
739
|
-
}
|
|
740
|
-
try {
|
|
741
|
-
sessionStorage.setItem(n || me, JSON.stringify(z));
|
|
742
|
-
} catch (c) {
|
|
743
|
-
process.env.NODE_ENV !== "production" && H(!1, "Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (" + c + ").");
|
|
744
|
-
}
|
|
745
|
-
window.history.scrollRestoration = "auto";
|
|
746
|
-
}, [n, t, l.state, u, f])), typeof document < "u" && (o.useLayoutEffect(() => {
|
|
747
|
-
try {
|
|
748
|
-
let c = sessionStorage.getItem(n || me);
|
|
749
|
-
c && (z = JSON.parse(c));
|
|
750
|
-
} catch {
|
|
751
|
-
}
|
|
752
|
-
}, [n]), o.useLayoutEffect(() => {
|
|
753
|
-
let c = t && i !== "/" ? (h, S) => t(
|
|
754
|
-
// Strip the basename to match useLocation()
|
|
755
|
-
g({}, h, {
|
|
756
|
-
pathname: P(h.pathname, i) || h.pathname
|
|
757
|
-
}),
|
|
758
|
-
S
|
|
759
|
-
) : t, m = a == null ? void 0 : a.enableScrollRestoration(z, () => window.scrollY, c);
|
|
760
|
-
return () => m && m();
|
|
761
|
-
}, [a, i, t]), o.useLayoutEffect(() => {
|
|
762
|
-
if (r !== !1) {
|
|
763
|
-
if (typeof r == "number") {
|
|
764
|
-
window.scrollTo(0, r);
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
if (u.hash) {
|
|
768
|
-
let c = document.getElementById(decodeURIComponent(u.hash.slice(1)));
|
|
769
|
-
if (c) {
|
|
770
|
-
c.scrollIntoView();
|
|
771
|
-
return;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
s !== !0 && window.scrollTo(0, 0);
|
|
775
|
-
}
|
|
776
|
-
}, [u, r, s]));
|
|
777
|
-
}
|
|
778
|
-
function Zt(e, t) {
|
|
779
|
-
let {
|
|
780
|
-
capture: n
|
|
781
|
-
} = t || {};
|
|
782
|
-
o.useEffect(() => {
|
|
783
|
-
let a = n != null ? {
|
|
784
|
-
capture: n
|
|
785
|
-
} : void 0;
|
|
786
|
-
return window.addEventListener("beforeunload", e, a), () => {
|
|
787
|
-
window.removeEventListener("beforeunload", e, a);
|
|
788
|
-
};
|
|
789
|
-
}, [e, n]);
|
|
790
|
-
}
|
|
791
|
-
function en(e, t) {
|
|
792
|
-
let {
|
|
793
|
-
capture: n
|
|
794
|
-
} = {};
|
|
795
|
-
o.useEffect(() => {
|
|
796
|
-
let a = n != null ? {
|
|
797
|
-
capture: n
|
|
798
|
-
} : void 0;
|
|
799
|
-
return window.addEventListener("pagehide", e, a), () => {
|
|
800
|
-
window.removeEventListener("pagehide", e, a);
|
|
801
|
-
};
|
|
802
|
-
}, [e, n]);
|
|
803
|
-
}
|
|
804
|
-
function tn(e) {
|
|
805
|
-
let {
|
|
806
|
-
when: t,
|
|
807
|
-
message: n
|
|
808
|
-
} = e, a = Ee(t);
|
|
809
|
-
o.useEffect(() => {
|
|
810
|
-
a.state === "blocked" && (window.confirm(n) ? setTimeout(a.proceed, 0) : a.reset());
|
|
811
|
-
}, [a, n]), o.useEffect(() => {
|
|
812
|
-
a.state === "blocked" && !t && a.reset();
|
|
813
|
-
}, [a, t]);
|
|
814
|
-
}
|
|
815
|
-
function Oe(e, t) {
|
|
816
|
-
t === void 0 && (t = {});
|
|
817
|
-
let n = o.useContext($);
|
|
818
|
-
n == null && (process.env.NODE_ENV !== "production" ? E(!1, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : E(!1));
|
|
819
|
-
let {
|
|
820
|
-
basename: a
|
|
821
|
-
} = Z(D.useViewTransitionState), r = V(e, {
|
|
822
|
-
relative: t.relative
|
|
823
|
-
});
|
|
824
|
-
if (!n.isTransitioning)
|
|
825
|
-
return !1;
|
|
826
|
-
let s = P(n.currentLocation.pathname, a) || n.currentLocation.pathname, i = P(n.nextLocation.pathname, a) || n.nextLocation.pathname;
|
|
827
|
-
return te(r.pathname, i) != null || te(r.pathname, s) != null;
|
|
828
|
-
}
|
|
829
|
-
const an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
830
|
-
__proto__: null,
|
|
831
|
-
AbortedDeferredError: ut,
|
|
832
|
-
Await: Ve,
|
|
833
|
-
BrowserRouter: zt,
|
|
834
|
-
Form: se,
|
|
835
|
-
HashRouter: Wt,
|
|
836
|
-
Link: ie,
|
|
837
|
-
MemoryRouter: Me,
|
|
838
|
-
NavLink: Ce,
|
|
839
|
-
Navigate: He,
|
|
840
|
-
get NavigationType() {
|
|
841
|
-
return ct;
|
|
842
|
-
},
|
|
843
|
-
Outlet: Ke,
|
|
844
|
-
Route: Be,
|
|
845
|
-
Router: M,
|
|
846
|
-
RouterProvider: Kt,
|
|
847
|
-
Routes: je,
|
|
848
|
-
ScrollRestoration: Te,
|
|
849
|
-
UNSAFE_DataRouterContext: ae,
|
|
850
|
-
UNSAFE_DataRouterStateContext: J,
|
|
851
|
-
UNSAFE_ErrorResponseImpl: ge,
|
|
852
|
-
UNSAFE_FetchersContext: Q,
|
|
853
|
-
UNSAFE_LocationContext: ze,
|
|
854
|
-
UNSAFE_NavigationContext: O,
|
|
855
|
-
UNSAFE_RouteContext: re,
|
|
856
|
-
UNSAFE_ViewTransitionContext: $,
|
|
857
|
-
UNSAFE_useRouteId: pe,
|
|
858
|
-
UNSAFE_useScrollRestoration: De,
|
|
859
|
-
createBrowserRouter: Ot,
|
|
860
|
-
createHashRouter: At,
|
|
861
|
-
createMemoryRouter: We,
|
|
862
|
-
createPath: q,
|
|
863
|
-
createRoutesFromChildren: ce,
|
|
864
|
-
createRoutesFromElements: ce,
|
|
865
|
-
createSearchParams: G,
|
|
866
|
-
defer: ft,
|
|
867
|
-
generatePath: dt,
|
|
868
|
-
isRouteErrorResponse: mt,
|
|
869
|
-
json: ht,
|
|
870
|
-
matchPath: te,
|
|
871
|
-
matchRoutes: pt,
|
|
872
|
-
parsePath: vt,
|
|
873
|
-
redirect: yt,
|
|
874
|
-
redirectDocument: wt,
|
|
875
|
-
renderMatches: Ye,
|
|
876
|
-
resolvePath: Et,
|
|
877
|
-
unstable_HistoryRouter: Ne,
|
|
878
|
-
unstable_usePrompt: tn,
|
|
879
|
-
unstable_useViewTransitionState: Oe,
|
|
880
|
-
useActionData: qe,
|
|
881
|
-
useAsyncError: Ge,
|
|
882
|
-
useAsyncValue: Je,
|
|
883
|
-
useBeforeUnload: Zt,
|
|
884
|
-
useBlocker: Ee,
|
|
885
|
-
useFetcher: $t,
|
|
886
|
-
useFetchers: Qt,
|
|
887
|
-
useFormAction: Pe,
|
|
888
|
-
useHref: he,
|
|
889
|
-
useInRouterContext: Xe,
|
|
890
|
-
useLinkClickHandler: xe,
|
|
891
|
-
useLoaderData: $e,
|
|
892
|
-
useLocation: A,
|
|
893
|
-
useMatch: Qe,
|
|
894
|
-
useMatches: ye,
|
|
895
|
-
useNavigate: ne,
|
|
896
|
-
useNavigation: we,
|
|
897
|
-
useNavigationType: Ze,
|
|
898
|
-
useOutlet: et,
|
|
899
|
-
useOutletContext: tt,
|
|
900
|
-
useParams: nt,
|
|
901
|
-
useResolvedPath: V,
|
|
902
|
-
useRevalidator: rt,
|
|
903
|
-
useRouteError: at,
|
|
904
|
-
useRouteLoaderData: ot,
|
|
905
|
-
useRoutes: it,
|
|
906
|
-
useSearchParams: Gt,
|
|
907
|
-
useSubmit: ue
|
|
908
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
909
|
-
export {
|
|
910
|
-
ie as L,
|
|
911
|
-
Ce as N,
|
|
912
|
-
Kt as R,
|
|
913
|
-
an as d,
|
|
914
|
-
Gt as u
|
|
915
|
-
};
|
|
916
|
-
//# sourceMappingURL=index-Dt-pU7Vu.js.map
|