@gen-epix/ui-client-common 4.0.0 → 4.0.2
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/@types/{ui.d.ts → ui-client-common.d.ts} +1 -1
- package/dist/_chunks/ApplicationFooter.js +1 -1
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +1 -1
- package/dist/_chunks/Breadcrumbs.js.map +1 -1
- package/dist/_chunks/CrudPage.js +293 -293
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +1 -1
- package/dist/_chunks/GeoFilter.js.map +1 -1
- package/dist/_chunks/Notifications.js.map +1 -1
- package/dist/_chunks/OutageList.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +79 -66
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +953 -945
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +4 -4
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +110 -110
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +1 -1
- package/dist/_chunks/_baseGet.js +26 -26
- package/dist/_chunks/_baseGet.js.map +1 -1
- package/dist/_chunks/_baseIteratee.js +25 -26
- package/dist/_chunks/_baseIteratee.js.map +1 -1
- package/dist/_chunks/_setToString.js.map +1 -1
- package/dist/_chunks/{chunk-KS7C4IRE.js → chunk-BV7QT456.js} +1041 -1128
- package/dist/_chunks/chunk-BV7QT456.js.map +1 -0
- package/dist/_chunks/format.js +199 -198
- package/dist/_chunks/format.js.map +1 -1
- package/dist/_chunks/index.esm.js +797 -692
- package/dist/_chunks/index.esm.js.map +1 -1
- package/dist/_chunks/isArrayLike.js +1 -2
- package/dist/_chunks/isArrayLike.js.map +1 -1
- package/dist/_chunks/isObject.js +38 -2
- package/dist/_chunks/isObject.js.map +1 -1
- package/dist/_chunks/isSymbol.js +2 -2
- package/dist/_chunks/middleware.js +11 -9
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/oidc-client-ts.js +12 -9
- package/dist/_chunks/oidc-client-ts.js.map +1 -1
- package/dist/_chunks/omit.js +38 -39
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +210 -228
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react-oidc-context.js +1 -1
- package/dist/_chunks/react-oidc-context.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/rolldown-runtime.js +2 -2
- package/dist/_chunks/tableStore.js +79 -78
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/toDate.js +1 -1
- package/dist/_chunks/toDate.js.map +1 -1
- package/dist/_chunks/uniq.js +1 -1
- package/dist/_chunks/uniq.js.map +1 -1
- package/dist/_chunks/useColumnsMenu.js +7 -6
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +19 -16
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +156 -169
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +5 -5
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/filters/GeoFilter.d.ts +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/index.js +41 -44
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +10 -11
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +1 -1
- package/dist/components/app/App/index.js +48 -38
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrap/index.js +54 -54
- package/dist/components/app/ApplicationBootstrap/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +45 -45
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +7 -7
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +53 -53
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/EpiContactDetailsDialog.d.ts +2 -2
- package/dist/components/epi/EpiContactDetailsDialog/index.js +28 -26
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/filters/BooleanFilterField/index.js +1 -1
- package/dist/components/filters/BooleanFilterField/index.js.map +1 -1
- package/dist/components/filters/DateFilterField/index.js +1 -1
- package/dist/components/filters/DateFilterField/index.js.map +1 -1
- package/dist/components/filters/GeoFilterField/index.js +2 -2
- package/dist/components/filters/GeoFilterField/index.js.map +1 -1
- package/dist/components/filters/MultiSelectFilterField/index.js +2 -2
- package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -1
- package/dist/components/filters/NumberRangeFilterField/index.js +1 -1
- package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -1
- package/dist/components/filters/TextFilterField/index.js +1 -1
- package/dist/components/filters/TextFilterField/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +132 -132
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/ConsentDialog/ConsentDialog.d.ts +2 -2
- package/dist/components/ui/ConsentDialog/index.js +11 -11
- package/dist/components/ui/ConsentDialog/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/LicensesDialog/LicensesDialog.d.ts +2 -2
- package/dist/components/ui/LicensesDialog/index.js +40 -40
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/MyPermissionsDialog.d.ts +2 -2
- package/dist/components/ui/MyPermissionsDialog/index.js +21 -21
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
- package/dist/components/ui/NavLink/index.js +1 -1
- package/dist/components/ui/NavLink/index.js.map +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/OrganizationSwitcherDialog.d.ts +2 -2
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +43 -43
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/OutagesDialog/OutagesDialog.d.ts +2 -2
- package/dist/components/ui/OutagesDialog/index.js +14 -14
- package/dist/components/ui/OutagesDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +2 -2
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/ResponseHandler/index.js +8 -8
- package/dist/components/ui/ResponseHandler/index.js.map +1 -1
- package/dist/components/ui/Sidebar/index.js.map +1 -1
- package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +2 -2
- package/dist/components/ui/UserFeedbackDialog/UserFeedbackDialog.d.ts +2 -2
- package/dist/components/ui/UserFeedbackDialog/index.js +38 -38
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
- package/dist/components/ui/UserInactivityConfirmation/index.js +14 -14
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +5 -0
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +6 -0
- package/dist/context/uiClientCommonConfigContext/index.d.ts +3 -0
- package/dist/context/uiClientCommonConfigContext/index.js +18 -0
- package/dist/context/uiClientCommonConfigContext/index.js.map +1 -0
- package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +2 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +4 -4
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +4 -4
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationsQuery/index.js +4 -4
- package/dist/dataHooks/useUsersQuery/index.js +4 -4
- package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +1 -1
- package/dist/hooks/useEditMutation/index.js +6 -6
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useItemQuery/index.js +8 -8
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/locale/en.json +0 -10
- package/dist/locale/nl.json +0 -10
- package/dist/models/dataHooks.d.ts +1 -1
- package/dist/models/table.d.ts +1 -1
- package/dist/models/table.js.map +1 -1
- package/dist/pages/AcceptInvitationPage/index.js +5 -5
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +1 -1
- package/dist/pages/AdminPage/index.js.map +1 -1
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
- package/dist/pages/CrudPage/CrudPage.d.ts +2 -2
- package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +2 -2
- package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +4 -4
- package/dist/pages/ErrorPage/index.js.map +1 -1
- package/dist/pages/IdentifierIssuersAdminPage/index.js +2 -2
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationContactsAdminPage/index.js +3 -3
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +3 -3
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +2 -2
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +2 -2
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js.map +1 -1
- package/dist/pages/RouterErrorPage/index.js +1 -1
- package/dist/pages/RouterErrorPage/index.js.map +1 -1
- package/dist/pages/UserInvitationsAdminPage/UserInvitationConsumeDialog.d.ts +2 -2
- package/dist/pages/UserInvitationsAdminPage/UserInvitationShareDialog.d.ts +2 -2
- package/dist/pages/UsersAdminPage/index.js +47 -47
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.js +1 -1
- package/dist/setup/setup.js.map +1 -1
- package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +1 -1
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/StandardConfigUtil/index.js +4 -4
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TableUtil/TableUtil.d.ts +1 -1
- package/package.json +7 -7
- package/dist/_chunks/chunk-KS7C4IRE.js.map +0 -1
- package/dist/_chunks/isObjectLike.js +0 -43
- package/dist/_chunks/isObjectLike.js.map +0 -1
- package/dist/components/ui/BackdropSpinner/BackdropSpinner.d.ts +0 -5
- package/dist/components/ui/BackdropSpinner/index.d.ts +0 -1
- package/dist/components/ui/BackdropSpinner/index.js +0 -19
- package/dist/components/ui/BackdropSpinner/index.js.map +0 -1
- package/dist/components/ui/Confirmation/Confirmation.d.ts +0 -2
- package/dist/components/ui/Confirmation/ConfirmationRender.d.ts +0 -11
- package/dist/components/ui/Confirmation/index.d.ts +0 -2
- package/dist/components/ui/Confirmation/index.js +0 -58
- package/dist/components/ui/Confirmation/index.js.map +0 -1
- package/dist/components/ui/CopyToClipboardButton/CopyToClipboardButton.d.ts +0 -13
- package/dist/components/ui/CopyToClipboardButton/index.d.ts +0 -1
- package/dist/components/ui/CopyToClipboardButton/index.js +0 -101
- package/dist/components/ui/CopyToClipboardButton/index.js.map +0 -1
- package/dist/components/ui/Dialog/Dialog.d.ts +0 -27
- package/dist/components/ui/Dialog/index.d.ts +0 -1
- package/dist/components/ui/Dialog/index.js +0 -83
- package/dist/components/ui/Dialog/index.js.map +0 -1
- package/dist/components/ui/LinearProgressWithLabel/LinearProgressWithLabel.d.ts +0 -5
- package/dist/components/ui/LinearProgressWithLabel/index.d.ts +0 -1
- package/dist/components/ui/LinearProgressWithLabel/index.js +0 -31
- package/dist/components/ui/LinearProgressWithLabel/index.js.map +0 -1
- package/dist/components/ui/LoadingIndicator/LoadingIndicator.d.ts +0 -2
- package/dist/components/ui/LoadingIndicator/index.d.ts +0 -1
- package/dist/components/ui/LoadingIndicator/index.js +0 -12
- package/dist/components/ui/LoadingIndicator/index.js.map +0 -1
- package/dist/components/ui/NestedMenu/IconMenuItem.d.ts +0 -18
- package/dist/components/ui/NestedMenu/NestedDropdown.d.ts +0 -17
- package/dist/components/ui/NestedMenu/NestedMenuItem.d.ts +0 -22
- package/dist/components/ui/NestedMenu/index.d.ts +0 -4
- package/dist/components/ui/NestedMenu/index.js +0 -240
- package/dist/components/ui/NestedMenu/index.js.map +0 -1
- package/dist/components/ui/NestedMenu/nestedMenuItemsFromObject.d.ts +0 -11
- package/dist/components/ui/Spinner/Spinner.d.ts +0 -11
- package/dist/components/ui/Spinner/index.d.ts +0 -1
- package/dist/components/ui/Spinner/index.js +0 -63
- package/dist/components/ui/Spinner/index.js.map +0 -1
- package/dist/components/ui/Stepper/Stepper.d.ts +0 -17
- package/dist/components/ui/Stepper/index.d.ts +0 -2
- package/dist/components/ui/Stepper/index.js +0 -126
- package/dist/components/ui/Stepper/index.js.map +0 -1
- package/dist/components/ui/Stepper/stepperModel.d.ts +0 -4
- package/dist/hoc/withDialog/index.d.ts +0 -1
- package/dist/hoc/withDialog/index.js +0 -69
- package/dist/hoc/withDialog/index.js.map +0 -1
- package/dist/hoc/withDialog/withDialog.d.ts +0 -33
- package/dist/models/nestedMenu.d.ts +0 -17
- package/dist/models/nestedMenu.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
//#region ../../node_modules/.pnpm/react-router@7.18.
|
|
2
|
+
//#region ../../node_modules/.pnpm/react-router@7.18.3_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-router/dist/development/chunk-BV7QT456.mjs
|
|
3
3
|
var t = (e) => {
|
|
4
4
|
throw TypeError(e);
|
|
5
5
|
}, n = (e, n, r) => n.has(e) || t("Cannot " + r), r = (e, t, r) => (n(e, t, "read from private field"), r ? r.call(e) : t.get(e)), i = (e, n, r) => n.has(e) ? t("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, r), a = (e, t, r, i) => (n(e, t, "write to private field"), i ? i.call(e, r) : t.set(e, r), r), o = /^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i, s = /^[\\/]{2}/;
|
|
@@ -218,7 +218,8 @@ function k(e, t, n = [], r = {}, i = !1) {
|
|
|
218
218
|
id: s
|
|
219
219
|
};
|
|
220
220
|
return r[s] = A(n, t(n)), n;
|
|
221
|
-
}
|
|
221
|
+
}
|
|
222
|
+
{
|
|
222
223
|
let n = {
|
|
223
224
|
...e,
|
|
224
225
|
id: s,
|
|
@@ -241,10 +242,10 @@ function j(e, t, n = "/") {
|
|
|
241
242
|
return M(e, t, n, !1);
|
|
242
243
|
}
|
|
243
244
|
function M(e, t, n, r, i) {
|
|
244
|
-
let a =
|
|
245
|
+
let a = H((typeof t == "string" ? v(t) : t).pathname || "/", n);
|
|
245
246
|
if (a == null) return null;
|
|
246
|
-
let o = i ?? N(e), s = null, c =
|
|
247
|
-
for (let e = 0; s == null && e < o.length; ++e) s =
|
|
247
|
+
let o = i ?? N(e), s = null, c = le(a);
|
|
248
|
+
for (let e = 0; s == null && e < o.length; ++e) s = oe(o[e], c, r);
|
|
248
249
|
return s;
|
|
249
250
|
}
|
|
250
251
|
function ee(e, t) {
|
|
@@ -260,7 +261,7 @@ function ee(e, t) {
|
|
|
260
261
|
}
|
|
261
262
|
function N(e) {
|
|
262
263
|
let t = P(e);
|
|
263
|
-
return
|
|
264
|
+
return I(t), t;
|
|
264
265
|
}
|
|
265
266
|
function P(e, t = [], n = [], r = "", i = !1) {
|
|
266
267
|
let a = (e, a, o = i, s) => {
|
|
@@ -274,12 +275,12 @@ function P(e, t = [], n = [], r = "", i = !1) {
|
|
|
274
275
|
if (!c.relativePath.startsWith(r) && o) return;
|
|
275
276
|
f(c.relativePath.startsWith(r), `Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`), c.relativePath = c.relativePath.slice(r.length);
|
|
276
277
|
}
|
|
277
|
-
let l =
|
|
278
|
+
let l = W([r, c.relativePath]), u = n.concat(c);
|
|
278
279
|
e.children && e.children.length > 0 && (f(e.index !== !0, `Index routes must not have child routes. Please remove all child routes from route path "${l}".`), P(e.children, t, u, l, o)), !(e.path == null && !e.index) && t.push({
|
|
279
280
|
path: l,
|
|
280
|
-
score:
|
|
281
|
+
score: ae(l, e.index),
|
|
281
282
|
routesMeta: u.map((e, t) => {
|
|
282
|
-
let [n, r] =
|
|
283
|
+
let [n, r] = V(e.relativePath, e.caseSensitive, t === u.length - 1);
|
|
283
284
|
return {
|
|
284
285
|
...e,
|
|
285
286
|
matcher: n,
|
|
@@ -290,78 +291,78 @@ function P(e, t = [], n = [], r = "", i = !1) {
|
|
|
290
291
|
};
|
|
291
292
|
return e.forEach((e, t) => {
|
|
292
293
|
if (e.path === "" || !e.path?.includes("?")) a(e, t);
|
|
293
|
-
else for (let n of
|
|
294
|
+
else for (let n of F(e.path)) a(e, t, !0, n);
|
|
294
295
|
}), t;
|
|
295
296
|
}
|
|
296
|
-
function
|
|
297
|
+
function F(e) {
|
|
297
298
|
let t = e.split("/");
|
|
298
299
|
if (t.length === 0) return [];
|
|
299
300
|
let [n, ...r] = t, i = n.endsWith("?"), a = n.replace(/\?$/, "");
|
|
300
301
|
if (r.length === 0) return i ? [a, ""] : [a];
|
|
301
|
-
let o =
|
|
302
|
+
let o = F(r.join("/")), s = [];
|
|
302
303
|
return s.push(...o.map((e) => e === "" ? a : [a, e].join("/"))), i && s.push(...o), s.map((t) => e.startsWith("/") && t === "" ? "/" : t);
|
|
303
304
|
}
|
|
304
|
-
function
|
|
305
|
-
e.sort((e, t) => e.score === t.score ?
|
|
305
|
+
function I(e) {
|
|
306
|
+
e.sort((e, t) => e.score === t.score ? B(e.routesMeta.map((e) => e.childrenIndex), t.routesMeta.map((e) => e.childrenIndex)) : t.score - e.score);
|
|
306
307
|
}
|
|
307
|
-
var
|
|
308
|
-
function
|
|
308
|
+
var te = /^:[\w-]+$/, L = 3, ne = 2, re = 1, R = 10, z = -2, ie = (e) => e === "*";
|
|
309
|
+
function ae(e, t) {
|
|
309
310
|
let n = e.split("/"), r = n.length;
|
|
310
|
-
return n.some(
|
|
311
|
+
return n.some(ie) && (r += z), t && (r += ne), n.filter((e) => !ie(e)).reduce((e, t) => e + (te.test(t) ? L : t === "" ? re : R), r);
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
+
function B(e, t) {
|
|
313
314
|
return e.length === t.length && e.slice(0, -1).every((e, n) => e === t[n]) ? e[e.length - 1] - t[t.length - 1] : 0;
|
|
314
315
|
}
|
|
315
|
-
function
|
|
316
|
+
function oe(e, t, n = !1) {
|
|
316
317
|
let { routesMeta: r } = e, i = {}, a = "/", o = [];
|
|
317
318
|
for (let e = 0; e < r.length; ++e) {
|
|
318
319
|
let s = r[e], c = e === r.length - 1, l = a === "/" ? t : t.slice(a.length) || "/", u = {
|
|
319
320
|
path: s.relativePath,
|
|
320
321
|
caseSensitive: s.caseSensitive,
|
|
321
322
|
end: c
|
|
322
|
-
}, d = s.matcher && s.compiledParams ?
|
|
323
|
-
if (!d && c && n && !r[r.length - 1].route.index && (d =
|
|
323
|
+
}, d = s.matcher && s.compiledParams ? ce(u, l, s.matcher, s.compiledParams) : se(u, l), f = s.route;
|
|
324
|
+
if (!d && c && n && !r[r.length - 1].route.index && (d = se({
|
|
324
325
|
path: s.relativePath,
|
|
325
326
|
caseSensitive: s.caseSensitive,
|
|
326
327
|
end: !1
|
|
327
328
|
}, l)), !d) return null;
|
|
328
329
|
Object.assign(i, d.params), o.push({
|
|
329
330
|
params: i,
|
|
330
|
-
pathname:
|
|
331
|
-
pathnameBase:
|
|
331
|
+
pathname: W([a, d.pathname]),
|
|
332
|
+
pathnameBase: ve(W([a, d.pathnameBase])),
|
|
332
333
|
route: f
|
|
333
|
-
}), d.pathnameBase !== "/" && (a =
|
|
334
|
+
}), d.pathnameBase !== "/" && (a = W([a, d.pathnameBase]));
|
|
334
335
|
}
|
|
335
336
|
return o;
|
|
336
337
|
}
|
|
337
|
-
function
|
|
338
|
+
function se(e, t) {
|
|
338
339
|
typeof e == "string" && (e = {
|
|
339
340
|
path: e,
|
|
340
341
|
caseSensitive: !1,
|
|
341
342
|
end: !0
|
|
342
343
|
});
|
|
343
|
-
let [n, r] =
|
|
344
|
-
return
|
|
344
|
+
let [n, r] = V(e.path, e.caseSensitive, e.end);
|
|
345
|
+
return ce(e, t, n, r);
|
|
345
346
|
}
|
|
346
|
-
function
|
|
347
|
+
function ce(e, t, n, r) {
|
|
347
348
|
let i = t.match(n);
|
|
348
349
|
if (!i) return null;
|
|
349
|
-
let a = i[0], o = a
|
|
350
|
+
let a = i[0], o = G(a, 1), s = i.slice(1);
|
|
350
351
|
return {
|
|
351
352
|
params: r.reduce((e, { paramName: t, isOptional: n }, r) => {
|
|
352
353
|
if (t === "*") {
|
|
353
354
|
let e = s[r] || "";
|
|
354
|
-
o = a.slice(0, a.length - e.length)
|
|
355
|
+
o = G(a.slice(0, a.length - e.length), 1);
|
|
355
356
|
}
|
|
356
357
|
let i = s[r];
|
|
357
|
-
return n && !i ?
|
|
358
|
+
return e[t] = n && !i ? void 0 : (i || "").replace(/%2F/g, "/"), e;
|
|
358
359
|
}, {}),
|
|
359
360
|
pathname: a,
|
|
360
361
|
pathnameBase: o,
|
|
361
362
|
pattern: e
|
|
362
363
|
};
|
|
363
364
|
}
|
|
364
|
-
function
|
|
365
|
+
function V(e, t = !1, n = !0) {
|
|
365
366
|
p(e === "*" || !e.endsWith("*") || e.endsWith("/*"), `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(/\*$/, "/*")}".`);
|
|
366
367
|
let r = [], i = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (e, t, n, i, a) => {
|
|
367
368
|
if (r.push({
|
|
@@ -375,50 +376,50 @@ function R(e, t = !1, n = !0) {
|
|
|
375
376
|
}).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
|
|
376
377
|
return e.endsWith("*") ? (r.push({ paramName: "*" }), i += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : e !== "" && e !== "/" && (i += "(?:(?=\\/|$))"), [new RegExp(i, t ? void 0 : "i"), r];
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function le(e) {
|
|
379
380
|
try {
|
|
380
381
|
return e.split("/").map((e) => decodeURIComponent(e).replace(/\//g, "%2F")).join("/");
|
|
381
382
|
} catch (t) {
|
|
382
383
|
return p(!1, `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`), e;
|
|
383
384
|
}
|
|
384
385
|
}
|
|
385
|
-
function
|
|
386
|
+
function H(e, t) {
|
|
386
387
|
if (t === "/") return e;
|
|
387
388
|
if (!e.toLowerCase().startsWith(t.toLowerCase())) return null;
|
|
388
389
|
let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n);
|
|
389
390
|
return r && r !== "/" ? null : e.slice(n) || "/";
|
|
390
391
|
}
|
|
391
|
-
function
|
|
392
|
-
return t === "/" ? e :
|
|
392
|
+
function ue({ basename: e, pathname: t }) {
|
|
393
|
+
return t === "/" ? e : W([e, t]);
|
|
393
394
|
}
|
|
394
|
-
var
|
|
395
|
-
function
|
|
395
|
+
var de = (e) => o.test(e);
|
|
396
|
+
function U(e, t = "/") {
|
|
396
397
|
let { pathname: n, search: r = "", hash: i = "" } = typeof e == "string" ? v(e) : e, a;
|
|
397
|
-
return n ? (n =
|
|
398
|
+
return n ? (n = _e(n), a = n.startsWith("/") || n.startsWith("\\") ? fe(n.substring(1), "/") : fe(n, t)) : a = t, {
|
|
398
399
|
pathname: a,
|
|
399
|
-
search:
|
|
400
|
-
hash:
|
|
400
|
+
search: ye(r),
|
|
401
|
+
hash: be(i)
|
|
401
402
|
};
|
|
402
403
|
}
|
|
403
|
-
function
|
|
404
|
-
let n =
|
|
404
|
+
function fe(e, t) {
|
|
405
|
+
let n = G(t).split("/");
|
|
405
406
|
return e.split("/").forEach((e) => {
|
|
406
407
|
e === ".." ? n.length > 1 && n.pop() : e !== "." && n.push(e);
|
|
407
408
|
}), n.length > 1 ? n.join("/") : "/";
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function pe(e, t, n, r) {
|
|
410
411
|
return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
411
412
|
}
|
|
412
|
-
function
|
|
413
|
+
function me(e) {
|
|
413
414
|
return e.filter((e, t) => t === 0 || e.route.path && e.route.path.length > 0);
|
|
414
415
|
}
|
|
415
|
-
function
|
|
416
|
-
let t =
|
|
416
|
+
function he(e) {
|
|
417
|
+
let t = me(e);
|
|
417
418
|
return t.map((e, n) => n === t.length - 1 ? e.pathname : e.pathnameBase);
|
|
418
419
|
}
|
|
419
|
-
function
|
|
420
|
+
function ge(e, t, n, r = !1) {
|
|
420
421
|
let i;
|
|
421
|
-
typeof e == "string" ? i = v(e) : (i = { ...e }, f(!i.pathname || !i.pathname.includes("?"),
|
|
422
|
+
typeof e == "string" ? i = v(e) : (i = { ...e }, f(!i.pathname || !i.pathname.includes("?"), pe("?", "pathname", "search", i)), f(!i.pathname || !i.pathname.includes("#"), pe("#", "pathname", "hash", i)), f(!i.search || !i.search.includes("#"), pe("#", "search", "hash", i)));
|
|
422
423
|
let a = e === "" || i.pathname === "", o = a ? "/" : i.pathname, s;
|
|
423
424
|
if (o == null) s = n;
|
|
424
425
|
else {
|
|
@@ -430,29 +431,35 @@ function V(e, t, n, r = !1) {
|
|
|
430
431
|
}
|
|
431
432
|
s = e >= 0 ? t[e] : "/";
|
|
432
433
|
}
|
|
433
|
-
let c =
|
|
434
|
+
let c = U(i, s), l = o && o !== "/" && o.endsWith("/"), u = (a || o === ".") && n.endsWith("/");
|
|
434
435
|
return !c.pathname.endsWith("/") && (l || u) && (c.pathname += "/"), c;
|
|
435
436
|
}
|
|
436
|
-
var
|
|
437
|
+
var _e = (e) => e.replace(/[\\/]{2,}/g, "/"), W = (e) => _e(e.join("/"));
|
|
438
|
+
function G(e, t = 0) {
|
|
439
|
+
let n = e.length;
|
|
440
|
+
for (; n > t && e.charCodeAt(n - 1) === 47;) n--;
|
|
441
|
+
return n === e.length ? e : e.slice(0, n);
|
|
442
|
+
}
|
|
443
|
+
var ve = (e) => G(e).replace(/^\/*/, "/"), ye = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, be = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, xe = [
|
|
437
444
|
"EvalError",
|
|
438
445
|
"RangeError",
|
|
439
446
|
"ReferenceError",
|
|
440
447
|
"SyntaxError",
|
|
441
448
|
"TypeError",
|
|
442
449
|
"URIError"
|
|
443
|
-
],
|
|
450
|
+
], Se = class {
|
|
444
451
|
constructor(e, t, n, r = !1) {
|
|
445
452
|
this.status = e, this.statusText = t || "", this.internal = r, n instanceof Error ? (this.data = n.toString(), this.error = n) : this.data = n;
|
|
446
453
|
}
|
|
447
454
|
};
|
|
448
|
-
function
|
|
455
|
+
function Ce(e) {
|
|
449
456
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
450
457
|
}
|
|
451
|
-
function
|
|
452
|
-
return
|
|
458
|
+
function we(e) {
|
|
459
|
+
return W(e.map((e) => e.route.path).filter(Boolean)) || "/";
|
|
453
460
|
}
|
|
454
|
-
var
|
|
455
|
-
function
|
|
461
|
+
var Te = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
|
|
462
|
+
function Ee(e, t) {
|
|
456
463
|
let n = e;
|
|
457
464
|
if (typeof n != "string" || !o.test(n)) return {
|
|
458
465
|
absoluteURL: void 0,
|
|
@@ -460,8 +467,8 @@ function ke(e, t) {
|
|
|
460
467
|
to: n
|
|
461
468
|
};
|
|
462
469
|
let r = n, i = !1;
|
|
463
|
-
if (
|
|
464
|
-
let e = new URL(window.location.href), r = s.test(n) ? new URL(c(n, e.protocol)) : new URL(n), a =
|
|
470
|
+
if (Te) try {
|
|
471
|
+
let e = new URL(window.location.href), r = s.test(n) ? new URL(c(n, e.protocol)) : new URL(n), a = H(r.pathname, t);
|
|
465
472
|
r.origin === e.origin && a != null ? n = a + r.search + r.hash : i = !0;
|
|
466
473
|
} catch {
|
|
467
474
|
p(!1, `<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`);
|
|
@@ -472,8 +479,8 @@ function ke(e, t) {
|
|
|
472
479
|
to: n
|
|
473
480
|
};
|
|
474
481
|
}
|
|
475
|
-
var
|
|
476
|
-
function
|
|
482
|
+
var De = Symbol("Uninstrumented");
|
|
483
|
+
function Oe(e, t) {
|
|
477
484
|
let n = {
|
|
478
485
|
lazy: [],
|
|
479
486
|
"lazy.loader": [],
|
|
@@ -494,7 +501,7 @@ function Ae(e, t) {
|
|
|
494
501
|
}));
|
|
495
502
|
let r = {};
|
|
496
503
|
if (typeof t.lazy == "function" && n.lazy.length > 0) {
|
|
497
|
-
let e =
|
|
504
|
+
let e = Ae(n.lazy, t.lazy, () => void 0);
|
|
498
505
|
e && (r.lazy = e);
|
|
499
506
|
}
|
|
500
507
|
if (typeof t.lazy == "object") {
|
|
@@ -506,7 +513,7 @@ function Ae(e, t) {
|
|
|
506
513
|
].forEach((t) => {
|
|
507
514
|
let i = e[t], a = n[`lazy.${t}`];
|
|
508
515
|
if (typeof i == "function" && a.length > 0) {
|
|
509
|
-
let e =
|
|
516
|
+
let e = Ae(a, i, () => void 0);
|
|
510
517
|
e && (r.lazy = Object.assign(r.lazy || {}, { [t]: e }));
|
|
511
518
|
}
|
|
512
519
|
});
|
|
@@ -514,15 +521,15 @@ function Ae(e, t) {
|
|
|
514
521
|
return ["loader", "action"].forEach((e) => {
|
|
515
522
|
let i = t[e];
|
|
516
523
|
if (typeof i == "function" && n[e].length > 0) {
|
|
517
|
-
let t = i[
|
|
518
|
-
a && (e === "loader" && t.hydrate === !0 && (a.hydrate = !0), a[
|
|
524
|
+
let t = i[De] ?? i, a = Ae(n[e], t, (...e) => Me(e[0]));
|
|
525
|
+
a && (e === "loader" && t.hydrate === !0 && (a.hydrate = !0), a[De] = t, r[e] = a);
|
|
519
526
|
}
|
|
520
527
|
}), t.middleware && t.middleware.length > 0 && n.middleware.length > 0 && (r.middleware = t.middleware.map((e) => {
|
|
521
|
-
let t = e[
|
|
522
|
-
return r ? (r[
|
|
528
|
+
let t = e[De] ?? e, r = Ae(n.middleware, t, (...e) => Me(e[0]));
|
|
529
|
+
return r ? (r[De] = t, r) : e;
|
|
523
530
|
})), r;
|
|
524
531
|
}
|
|
525
|
-
function
|
|
532
|
+
function ke(e, t) {
|
|
526
533
|
let n = {
|
|
527
534
|
navigate: [],
|
|
528
535
|
fetch: []
|
|
@@ -531,39 +538,39 @@ function je(e, t) {
|
|
|
531
538
|
let t = Object.keys(e);
|
|
532
539
|
for (let r of t) e[r] && n[r].push(e[r]);
|
|
533
540
|
} })), n.navigate.length > 0) {
|
|
534
|
-
let t = e.navigate[
|
|
541
|
+
let t = e.navigate[De] ?? e.navigate, r = Ae(n.navigate, t, (...t) => {
|
|
535
542
|
let [n, r] = t;
|
|
536
543
|
return {
|
|
537
544
|
to: typeof n == "number" || typeof n == "string" ? n : n ? _(n) : ".",
|
|
538
|
-
...
|
|
545
|
+
...Ne(e, r ?? {})
|
|
539
546
|
};
|
|
540
547
|
});
|
|
541
|
-
r && (r[
|
|
548
|
+
r && (r[De] = t, e.navigate = r);
|
|
542
549
|
}
|
|
543
550
|
if (n.fetch.length > 0) {
|
|
544
|
-
let t = e.fetch[
|
|
551
|
+
let t = e.fetch[De] ?? e.fetch, r = Ae(n.fetch, t, (...t) => {
|
|
545
552
|
let [n, , r, i] = t;
|
|
546
553
|
return {
|
|
547
554
|
href: r ?? ".",
|
|
548
555
|
fetcherKey: n,
|
|
549
|
-
...
|
|
556
|
+
...Ne(e, i ?? {})
|
|
550
557
|
};
|
|
551
558
|
});
|
|
552
|
-
r && (r[
|
|
559
|
+
r && (r[De] = t, e.fetch = r);
|
|
553
560
|
}
|
|
554
561
|
return e;
|
|
555
562
|
}
|
|
556
|
-
function
|
|
563
|
+
function Ae(e, t, n) {
|
|
557
564
|
return e.length === 0 ? null : async (...r) => {
|
|
558
|
-
let i = await
|
|
565
|
+
let i = await je(e, n(...r), () => t(...r), e.length - 1);
|
|
559
566
|
if (i.type === "error") throw i.value;
|
|
560
567
|
return i.value;
|
|
561
568
|
};
|
|
562
569
|
}
|
|
563
|
-
async function
|
|
570
|
+
async function je(e, t, n, r) {
|
|
564
571
|
let i = e[r], a;
|
|
565
572
|
if (i) {
|
|
566
|
-
let o, s = async () => (o ? console.error("You cannot call instrumented handlers more than once") : o =
|
|
573
|
+
let o, s = async () => (o ? console.error("You cannot call instrumented handlers more than once") : o = je(e, t, n, r - 1), a = await o, f(a, "Expected a result"), a.type === "error" && a.value instanceof Error ? {
|
|
567
574
|
status: "error",
|
|
568
575
|
error: a.value
|
|
569
576
|
} : {
|
|
@@ -592,16 +599,16 @@ async function Me(e, t, n, r) {
|
|
|
592
599
|
value: /* @__PURE__ */ Error("No result assigned in instrumentation chain.")
|
|
593
600
|
};
|
|
594
601
|
}
|
|
595
|
-
function
|
|
602
|
+
function Me(e) {
|
|
596
603
|
let { request: t, context: n, params: r, pattern: i } = e;
|
|
597
604
|
return {
|
|
598
605
|
request: Pe(t),
|
|
599
606
|
params: { ...r },
|
|
600
607
|
pattern: i,
|
|
601
|
-
context:
|
|
608
|
+
context: K(n)
|
|
602
609
|
};
|
|
603
610
|
}
|
|
604
|
-
function
|
|
611
|
+
function Ne(e, t) {
|
|
605
612
|
return {
|
|
606
613
|
currentUrl: _(e.state.location),
|
|
607
614
|
..."formMethod" in t ? { formMethod: t.formMethod } : {},
|
|
@@ -617,30 +624,58 @@ function Pe(e) {
|
|
|
617
624
|
headers: { get: (...t) => e.headers.get(...t) }
|
|
618
625
|
};
|
|
619
626
|
}
|
|
620
|
-
function
|
|
621
|
-
if (
|
|
627
|
+
function K(e) {
|
|
628
|
+
if (Ie(e)) {
|
|
622
629
|
let t = { ...e };
|
|
623
630
|
return Object.freeze(t), t;
|
|
624
|
-
}
|
|
631
|
+
}
|
|
632
|
+
return { get: (t) => e.get(t) };
|
|
625
633
|
}
|
|
626
|
-
var
|
|
627
|
-
function
|
|
634
|
+
var Fe = Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
635
|
+
function Ie(e) {
|
|
628
636
|
if (typeof e != "object" || !e) return !1;
|
|
629
637
|
let t = Object.getPrototypeOf(e);
|
|
630
|
-
return t === Object.prototype || t === null || Object.getOwnPropertyNames(t).sort().join("\0") ===
|
|
638
|
+
return t === Object.prototype || t === null || Object.getOwnPropertyNames(t).sort().join("\0") === Fe;
|
|
631
639
|
}
|
|
632
|
-
var
|
|
640
|
+
var Le = new URL("http://localhost");
|
|
641
|
+
function Re(e) {
|
|
642
|
+
if (e.createURL) return e.createURL("/");
|
|
643
|
+
try {
|
|
644
|
+
return new URL(e.createHref("/"), Le);
|
|
645
|
+
} catch {
|
|
646
|
+
return Le;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function ze(e, t) {
|
|
650
|
+
return e.origin === t.origin && (e.origin !== "null" || e.protocol === t.protocol && e.host === t.host);
|
|
651
|
+
}
|
|
652
|
+
function Be(e, t) {
|
|
653
|
+
if (e.startsWith("//")) return !0;
|
|
654
|
+
let n = t.protocol.toLowerCase();
|
|
655
|
+
return e.toLowerCase().startsWith(n) ? t.host === "" || e.slice(n.length).startsWith("//") : !1;
|
|
656
|
+
}
|
|
657
|
+
function Ve(e, t, n, r) {
|
|
658
|
+
let i = null;
|
|
659
|
+
try {
|
|
660
|
+
i = e == null ? null : new URL(e, n);
|
|
661
|
+
} catch {}
|
|
662
|
+
let a = new URL(t, n), o = i != null && !ze(i, n), s = !ze(a, n);
|
|
663
|
+
if (r === "reject") {
|
|
664
|
+
if (o || s) throw Error("External navigation is not allowed");
|
|
665
|
+
} else if (s && (i == null || !Be(e, i) || !ze(i, a))) throw Error("External navigation is not allowed");
|
|
666
|
+
}
|
|
667
|
+
var He = [
|
|
633
668
|
"POST",
|
|
634
669
|
"PUT",
|
|
635
670
|
"PATCH",
|
|
636
671
|
"DELETE"
|
|
637
|
-
],
|
|
672
|
+
], Ue = new Set(He), We = ["GET", ...He], Ge = new Set(We), Ke = /* @__PURE__ */ new Set([
|
|
638
673
|
301,
|
|
639
674
|
302,
|
|
640
675
|
303,
|
|
641
676
|
307,
|
|
642
677
|
308
|
|
643
|
-
]),
|
|
678
|
+
]), qe = /* @__PURE__ */ new Set([307, 308]), Je = {
|
|
644
679
|
state: "idle",
|
|
645
680
|
location: void 0,
|
|
646
681
|
matches: void 0,
|
|
@@ -651,7 +686,7 @@ var Re = [
|
|
|
651
686
|
formData: void 0,
|
|
652
687
|
json: void 0,
|
|
653
688
|
text: void 0
|
|
654
|
-
},
|
|
689
|
+
}, Ye = {
|
|
655
690
|
state: "idle",
|
|
656
691
|
data: void 0,
|
|
657
692
|
formMethod: void 0,
|
|
@@ -660,109 +695,109 @@ var Re = [
|
|
|
660
695
|
formData: void 0,
|
|
661
696
|
json: void 0,
|
|
662
697
|
text: void 0
|
|
663
|
-
},
|
|
698
|
+
}, Xe = {
|
|
664
699
|
state: "unblocked",
|
|
665
700
|
proceed: void 0,
|
|
666
701
|
reset: void 0,
|
|
667
702
|
location: void 0
|
|
668
|
-
},
|
|
703
|
+
}, Ze = (e) => ({ hasErrorBoundary: !!e.hasErrorBoundary }), Qe = "remix-router-transitions", $e = Symbol("ResetLoaderData"), et, tt, nt, rt, it = class {
|
|
669
704
|
constructor(e) {
|
|
670
|
-
i(this,
|
|
705
|
+
i(this, et), i(this, tt), i(this, nt), i(this, rt), a(this, et, e), a(this, tt, N(e));
|
|
671
706
|
}
|
|
672
707
|
get stableRoutes() {
|
|
673
|
-
return r(this,
|
|
708
|
+
return r(this, et);
|
|
674
709
|
}
|
|
675
710
|
get activeRoutes() {
|
|
676
|
-
return r(this,
|
|
711
|
+
return r(this, nt) ?? r(this, et);
|
|
677
712
|
}
|
|
678
713
|
get branches() {
|
|
679
|
-
return r(this,
|
|
714
|
+
return r(this, rt) ?? r(this, tt);
|
|
680
715
|
}
|
|
681
716
|
get hasHMRRoutes() {
|
|
682
|
-
return r(this,
|
|
717
|
+
return r(this, nt) != null;
|
|
683
718
|
}
|
|
684
719
|
setRoutes(e) {
|
|
685
|
-
a(this,
|
|
720
|
+
a(this, et, e), a(this, tt, N(e));
|
|
686
721
|
}
|
|
687
722
|
setHmrRoutes(e) {
|
|
688
|
-
a(this,
|
|
723
|
+
a(this, nt, e), a(this, rt, N(e));
|
|
689
724
|
}
|
|
690
725
|
commitHmrRoutes() {
|
|
691
|
-
r(this,
|
|
726
|
+
r(this, nt) && (a(this, et, r(this, nt)), a(this, tt, r(this, rt)), a(this, nt, void 0), a(this, rt, void 0));
|
|
692
727
|
}
|
|
693
728
|
};
|
|
694
|
-
|
|
695
|
-
function
|
|
729
|
+
et = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap();
|
|
730
|
+
function at(e) {
|
|
696
731
|
let t = e.window ? e.window : typeof window < "u" ? window : void 0, n = t !== void 0 && t.document !== void 0 && t.document.createElement !== void 0;
|
|
697
732
|
f(e.routes.length > 0, "You must provide a non-empty routes array to createRouter");
|
|
698
|
-
let r = e.hydrationRouteProperties || [], i = e.mapRouteProperties ||
|
|
733
|
+
let r = e.hydrationRouteProperties || [], i = e.mapRouteProperties || Ze, a = i;
|
|
699
734
|
if (e.instrumentations) {
|
|
700
735
|
let t = e.instrumentations;
|
|
701
736
|
a = (e) => ({
|
|
702
737
|
...i(e),
|
|
703
|
-
...
|
|
738
|
+
...Oe(t.map((e) => e.route).filter(Boolean), e)
|
|
704
739
|
});
|
|
705
740
|
}
|
|
706
|
-
let o = {},
|
|
707
|
-
|
|
708
|
-
let
|
|
709
|
-
if (
|
|
710
|
-
let t =
|
|
711
|
-
|
|
712
|
-
} else if (
|
|
713
|
-
|
|
714
|
-
let t =
|
|
715
|
-
t.active && t.matches && (
|
|
716
|
-
} else if (
|
|
717
|
-
else if (!
|
|
741
|
+
let o = {}, c = new it(k(e.routes, a, void 0, o)), l = e.basename || "/";
|
|
742
|
+
l.startsWith("/") || (l = `/${l}`);
|
|
743
|
+
let u = e.dataStrategy || St, d = { ...e.future }, m = null, h = /* @__PURE__ */ new Set(), y = null, x = null, S = null, w = null, T = e.hydrationData != null, E = M(c.activeRoutes, e.history.location, l, !1, c.branches), D = !1, O = null, A, j;
|
|
744
|
+
if (E == null && !e.patchRoutesOnNavigation) {
|
|
745
|
+
let t = q(404, { pathname: e.history.location.pathname }), { matches: n, route: r } = Kt(c.activeRoutes);
|
|
746
|
+
A = !0, j = !A, E = n, O = { [r.id]: t };
|
|
747
|
+
} else if (E && !e.hydrationData && ot(E, c.activeRoutes, e.history.location.pathname).active && (E = null), !E) {
|
|
748
|
+
A = !1, j = !A, E = [];
|
|
749
|
+
let t = ot(null, c.activeRoutes, e.history.location.pathname);
|
|
750
|
+
t.active && t.matches && (D = !0, E = t.matches);
|
|
751
|
+
} else if (E.some((e) => e.route.lazy)) A = !1, j = !A;
|
|
752
|
+
else if (!E.some((e) => ut(e.route))) A = !0, j = !A;
|
|
718
753
|
else {
|
|
719
|
-
let t = e.hydrationData ? e.hydrationData.loaderData : null, n = e.hydrationData ? e.hydrationData.errors : null, r =
|
|
754
|
+
let t = e.hydrationData ? e.hydrationData.loaderData : null, n = e.hydrationData ? e.hydrationData.errors : null, r = E;
|
|
720
755
|
if (n) {
|
|
721
|
-
let e =
|
|
756
|
+
let e = E.findIndex((e) => n[e.route.id] !== void 0);
|
|
722
757
|
r = r.slice(0, e + 1);
|
|
723
758
|
}
|
|
724
|
-
|
|
725
|
-
let r =
|
|
726
|
-
|
|
759
|
+
j = !1, A = !0, r.forEach((e) => {
|
|
760
|
+
let r = dt(e.route, t, n);
|
|
761
|
+
j ||= r.renderFallback, A &&= !r.shouldLoad;
|
|
727
762
|
});
|
|
728
763
|
}
|
|
729
|
-
let
|
|
764
|
+
let N, P = {
|
|
730
765
|
historyAction: e.history.action,
|
|
731
766
|
location: e.history.location,
|
|
732
|
-
matches:
|
|
733
|
-
initialized:
|
|
734
|
-
renderFallback:
|
|
735
|
-
navigation:
|
|
736
|
-
restoreScrollPosition: e.hydrationData == null
|
|
767
|
+
matches: E,
|
|
768
|
+
initialized: A,
|
|
769
|
+
renderFallback: j,
|
|
770
|
+
navigation: Je,
|
|
771
|
+
restoreScrollPosition: e.hydrationData == null && null,
|
|
737
772
|
preventScrollReset: !1,
|
|
738
773
|
revalidation: "idle",
|
|
739
774
|
loaderData: e.hydrationData && e.hydrationData.loaderData || {},
|
|
740
775
|
actionData: e.hydrationData && e.hydrationData.actionData || null,
|
|
741
|
-
errors: e.hydrationData && e.hydrationData.errors ||
|
|
776
|
+
errors: e.hydrationData && e.hydrationData.errors || O,
|
|
742
777
|
fetchers: /* @__PURE__ */ new Map(),
|
|
743
778
|
blockers: /* @__PURE__ */ new Map()
|
|
744
|
-
},
|
|
745
|
-
function
|
|
746
|
-
if (
|
|
747
|
-
if (
|
|
748
|
-
|
|
779
|
+
}, F = "POP", I = null, te = !1, L, ne = !1, re = /* @__PURE__ */ new Map(), R = null, z = !1, ie = !1, ae = /* @__PURE__ */ new Set(), B = /* @__PURE__ */ new Map(), oe = 0, se = -1, ce = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Set(), le = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Set(), fe = /* @__PURE__ */ new Map(), pe, me = null;
|
|
780
|
+
function he() {
|
|
781
|
+
if (m = e.history.listen(({ action: t, location: n, delta: r }) => {
|
|
782
|
+
if (pe) {
|
|
783
|
+
pe(), pe = void 0;
|
|
749
784
|
return;
|
|
750
785
|
}
|
|
751
786
|
p(fe.size === 0 || r != null, "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");
|
|
752
|
-
let i =
|
|
753
|
-
currentLocation:
|
|
787
|
+
let i = $e({
|
|
788
|
+
currentLocation: P.location,
|
|
754
789
|
nextLocation: n,
|
|
755
790
|
historyAction: t
|
|
756
791
|
});
|
|
757
792
|
if (i && r != null) {
|
|
758
793
|
let t = new Promise((e) => {
|
|
759
|
-
|
|
794
|
+
pe = e;
|
|
760
795
|
});
|
|
761
|
-
e.history.go(r * -1),
|
|
796
|
+
e.history.go(r * -1), Qe(i, {
|
|
762
797
|
state: "blocked",
|
|
763
798
|
location: n,
|
|
764
799
|
proceed() {
|
|
765
|
-
|
|
800
|
+
Qe(i, {
|
|
766
801
|
state: "proceeding",
|
|
767
802
|
proceed: void 0,
|
|
768
803
|
reset: void 0,
|
|
@@ -770,176 +805,179 @@ function $e(e) {
|
|
|
770
805
|
}), t.then(() => e.history.go(r));
|
|
771
806
|
},
|
|
772
807
|
reset() {
|
|
773
|
-
let e = new Map(
|
|
774
|
-
e.set(i,
|
|
808
|
+
let e = new Map(P.blockers);
|
|
809
|
+
e.set(i, Xe), W({ blockers: e });
|
|
775
810
|
}
|
|
776
|
-
}),
|
|
811
|
+
}), I?.resolve(), I = null;
|
|
777
812
|
return;
|
|
778
813
|
}
|
|
779
|
-
return
|
|
814
|
+
return be(t, n);
|
|
780
815
|
}), n) {
|
|
781
|
-
|
|
782
|
-
let e = () =>
|
|
783
|
-
t.addEventListener("pagehide", e),
|
|
816
|
+
mn(t, re);
|
|
817
|
+
let e = () => hn(t, re);
|
|
818
|
+
t.addEventListener("pagehide", e), R = () => t.removeEventListener("pagehide", e);
|
|
784
819
|
}
|
|
785
|
-
return
|
|
820
|
+
return P.initialized || be("POP", P.location, { initialHydration: !0 }), N;
|
|
786
821
|
}
|
|
787
|
-
function
|
|
788
|
-
|
|
822
|
+
function ge() {
|
|
823
|
+
m && m(), R && R(), h.clear(), L && L.abort(), P.fetchers.forEach((e, t) => Re(P.fetchers, t)), P.blockers.forEach((e, t) => Ke(t));
|
|
789
824
|
}
|
|
790
|
-
function
|
|
791
|
-
if (
|
|
792
|
-
let { newErrors: t } =
|
|
793
|
-
|
|
825
|
+
function _e(e) {
|
|
826
|
+
if (h.add(e), y) {
|
|
827
|
+
let { newErrors: t } = y;
|
|
828
|
+
y = null, e(P, {
|
|
794
829
|
deletedFetchers: [],
|
|
795
830
|
newErrors: t,
|
|
796
831
|
viewTransitionOpts: void 0,
|
|
797
832
|
flushSync: !1
|
|
798
833
|
});
|
|
799
834
|
}
|
|
800
|
-
return () =>
|
|
835
|
+
return () => h.delete(e);
|
|
801
836
|
}
|
|
802
|
-
function
|
|
837
|
+
function W(e, t = {}) {
|
|
803
838
|
e.matches &&= e.matches.map((e) => {
|
|
804
839
|
let t = o[e.route.id], n = e.route;
|
|
805
840
|
return n.element !== t.element || n.errorElement !== t.errorElement || n.hydrateFallbackElement !== t.hydrateFallbackElement ? {
|
|
806
841
|
...e,
|
|
807
842
|
route: t
|
|
808
843
|
} : e;
|
|
809
|
-
}),
|
|
810
|
-
...
|
|
844
|
+
}), P = {
|
|
845
|
+
...P,
|
|
811
846
|
...e
|
|
812
847
|
};
|
|
813
848
|
let n = [], r = [];
|
|
814
|
-
|
|
815
|
-
e.state === "idle" && (
|
|
816
|
-
}),
|
|
817
|
-
!
|
|
818
|
-
}),
|
|
849
|
+
P.fetchers.forEach((e, t) => {
|
|
850
|
+
e.state === "idle" && (U.has(t) ? n.push(t) : r.push(t));
|
|
851
|
+
}), U.forEach((e) => {
|
|
852
|
+
!P.fetchers.has(e) && !B.has(e) && n.push(e);
|
|
853
|
+
}), h.size === 0 && (y = { newErrors: e.errors ?? null }), [...h].forEach((r) => r(P, {
|
|
819
854
|
deletedFetchers: n,
|
|
820
855
|
newErrors: e.errors ?? null,
|
|
821
856
|
viewTransitionOpts: t.viewTransitionOpts,
|
|
822
857
|
flushSync: t.flushSync === !0
|
|
823
|
-
})), n.forEach((e) =>
|
|
824
|
-
}
|
|
825
|
-
function
|
|
826
|
-
let i =
|
|
827
|
-
a = n.actionData ? Object.keys(n.actionData).length > 0 ? n.actionData : null : i ?
|
|
828
|
-
let o = n.loaderData ?
|
|
829
|
-
|
|
830
|
-
let l =
|
|
831
|
-
|
|
858
|
+
})), n.forEach((e) => Re(P.fetchers, e)), r.forEach((e) => P.fetchers.delete(e));
|
|
859
|
+
}
|
|
860
|
+
function G(t, n, { flushSync: r } = {}) {
|
|
861
|
+
let i = P.actionData != null && P.navigation.formMethod != null && Y(P.navigation.formMethod) && P.navigation.state === "loading" && t.state?._isRedirect !== !0, a;
|
|
862
|
+
a = n.actionData ? Object.keys(n.actionData).length > 0 ? n.actionData : null : i ? P.actionData : null;
|
|
863
|
+
let o = n.loaderData ? Ut(P.loaderData, n.loaderData, n.matches || [], n.errors) : P.loaderData, s = P.blockers;
|
|
864
|
+
s.size > 0 && (s = new Map(s), s.forEach((e, t) => s.set(t, Xe)));
|
|
865
|
+
let l = !z && at(t, n.matches || P.matches), u = te === !0 || P.navigation.formMethod != null && Y(P.navigation.formMethod) && t.state?._isRedirect !== !0;
|
|
866
|
+
c.commitHmrRoutes(), z || F === "POP" || (F === "PUSH" ? e.history.push(t, t.state) : F === "REPLACE" && e.history.replace(t, t.state));
|
|
832
867
|
let d;
|
|
833
|
-
if (
|
|
834
|
-
let e = re.get(
|
|
868
|
+
if (F === "POP") {
|
|
869
|
+
let e = re.get(P.location.pathname);
|
|
835
870
|
e && e.has(t.pathname) ? d = {
|
|
836
|
-
currentLocation:
|
|
871
|
+
currentLocation: P.location,
|
|
837
872
|
nextLocation: t
|
|
838
873
|
} : re.has(t.pathname) && (d = {
|
|
839
874
|
currentLocation: t,
|
|
840
|
-
nextLocation:
|
|
875
|
+
nextLocation: P.location
|
|
841
876
|
});
|
|
842
877
|
} else if (ne) {
|
|
843
|
-
let e = re.get(
|
|
844
|
-
e ? e.add(t.pathname) : (e = /* @__PURE__ */ new Set([t.pathname]), re.set(
|
|
845
|
-
currentLocation:
|
|
878
|
+
let e = re.get(P.location.pathname);
|
|
879
|
+
e ? e.add(t.pathname) : (e = /* @__PURE__ */ new Set([t.pathname]), re.set(P.location.pathname, e)), d = {
|
|
880
|
+
currentLocation: P.location,
|
|
846
881
|
nextLocation: t
|
|
847
882
|
};
|
|
848
883
|
}
|
|
849
|
-
|
|
884
|
+
W({
|
|
850
885
|
...n,
|
|
851
886
|
actionData: a,
|
|
852
887
|
loaderData: o,
|
|
853
|
-
historyAction:
|
|
888
|
+
historyAction: F,
|
|
854
889
|
location: t,
|
|
855
890
|
initialized: !0,
|
|
856
891
|
renderFallback: !1,
|
|
857
|
-
navigation:
|
|
892
|
+
navigation: Je,
|
|
858
893
|
revalidation: "idle",
|
|
859
894
|
restoreScrollPosition: l,
|
|
860
895
|
preventScrollReset: u,
|
|
861
|
-
blockers:
|
|
896
|
+
blockers: s
|
|
862
897
|
}, {
|
|
863
898
|
viewTransitionOpts: d,
|
|
864
899
|
flushSync: r === !0
|
|
865
|
-
}),
|
|
900
|
+
}), F = "POP", te = !1, ne = !1, z = !1, ie = !1, I?.resolve(), I = null, me?.resolve(), me = null;
|
|
866
901
|
}
|
|
867
|
-
async function
|
|
868
|
-
if (
|
|
869
|
-
|
|
870
|
-
let n =
|
|
902
|
+
async function ve(t, n) {
|
|
903
|
+
if (I?.resolve(), I = null, typeof t == "number") {
|
|
904
|
+
I ||= gn();
|
|
905
|
+
let n = I.promise;
|
|
871
906
|
return e.history.go(t), n;
|
|
872
907
|
}
|
|
873
|
-
let { path: r, submission: i, error: a } =
|
|
874
|
-
n?.mask
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
hash: "",
|
|
878
|
-
...typeof n.mask == "string" ? v(n.mask) : {
|
|
879
|
-
...j.location.mask,
|
|
908
|
+
let { path: r, submission: i, error: a } = ct(!1, st(P.location, P.matches, l, t, n?.fromRouteId, n?.relative), n), o;
|
|
909
|
+
if (n?.mask) {
|
|
910
|
+
let t = typeof n.mask == "string" ? v(n.mask) : {
|
|
911
|
+
...P.location.mask,
|
|
880
912
|
...n.mask
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
913
|
+
};
|
|
914
|
+
if (o = {
|
|
915
|
+
pathname: t.pathname ?? "",
|
|
916
|
+
search: t.search ?? "",
|
|
917
|
+
hash: t.hash ?? ""
|
|
918
|
+
}, s.test(o.pathname)) throw Error("External navigation is not allowed");
|
|
919
|
+
o.pathname.startsWith("\\") && (o.pathname = o.pathname.replace(/^\\+/, "/")), Ve(typeof n.mask == "string" ? n.mask : _(n.mask), _(o), e.history.createURL("/"), "reject");
|
|
920
|
+
}
|
|
921
|
+
let c = P.location, u = g(c, r, n && n.state, void 0, o);
|
|
922
|
+
u = {
|
|
923
|
+
...u,
|
|
924
|
+
...e.history.encodeLocation(u)
|
|
925
|
+
}, Ve(t == null ? e.history.createHref(P.location) : typeof t == "string" ? t : _(t), e.history.createHref(u.mask || u), e.history.createURL("/"), "reject");
|
|
926
|
+
let d = n && n.replace != null ? n.replace : void 0, f = "PUSH";
|
|
927
|
+
d === !0 ? f = "REPLACE" : d === !1 || i != null && Y(i.formMethod) && i.formAction === P.location.pathname + P.location.search && (f = "REPLACE");
|
|
928
|
+
let p = n && "preventScrollReset" in n ? n.preventScrollReset === !0 : void 0, m = (n && n.flushSync) === !0, h = $e({
|
|
929
|
+
currentLocation: c,
|
|
930
|
+
nextLocation: u,
|
|
931
|
+
historyAction: f
|
|
894
932
|
});
|
|
895
|
-
if (
|
|
896
|
-
|
|
933
|
+
if (h) {
|
|
934
|
+
Qe(h, {
|
|
897
935
|
state: "blocked",
|
|
898
|
-
location:
|
|
936
|
+
location: u,
|
|
899
937
|
proceed() {
|
|
900
|
-
|
|
938
|
+
Qe(h, {
|
|
901
939
|
state: "proceeding",
|
|
902
940
|
proceed: void 0,
|
|
903
941
|
reset: void 0,
|
|
904
|
-
location:
|
|
905
|
-
}),
|
|
942
|
+
location: u
|
|
943
|
+
}), ve(t, n);
|
|
906
944
|
},
|
|
907
945
|
reset() {
|
|
908
|
-
let e = new Map(
|
|
909
|
-
e.set(
|
|
946
|
+
let e = new Map(P.blockers);
|
|
947
|
+
e.set(h, Xe), W({ blockers: e });
|
|
910
948
|
}
|
|
911
949
|
});
|
|
912
950
|
return;
|
|
913
951
|
}
|
|
914
|
-
await
|
|
952
|
+
await be(f, u, {
|
|
915
953
|
submission: i,
|
|
916
954
|
pendingError: a,
|
|
917
|
-
preventScrollReset:
|
|
955
|
+
preventScrollReset: p,
|
|
918
956
|
replace: n && n.replace,
|
|
919
957
|
enableViewTransition: n && n.viewTransition,
|
|
920
|
-
flushSync:
|
|
958
|
+
flushSync: m,
|
|
921
959
|
callSiteDefaultShouldRevalidate: n && n.defaultShouldRevalidate
|
|
922
960
|
});
|
|
923
961
|
}
|
|
924
|
-
function
|
|
925
|
-
|
|
926
|
-
let e =
|
|
927
|
-
return
|
|
928
|
-
overrideNavigation:
|
|
962
|
+
function ye() {
|
|
963
|
+
me ||= gn(), Pe(), W({ revalidation: "loading" });
|
|
964
|
+
let e = me.promise;
|
|
965
|
+
return P.navigation.state === "submitting" ? e : P.navigation.state === "idle" ? (be(P.historyAction, P.location, { startUninterruptedRevalidation: !0 }), e) : (be(F || P.historyAction, P.navigation.location, {
|
|
966
|
+
overrideNavigation: P.navigation,
|
|
929
967
|
enableViewTransition: ne === !0
|
|
930
968
|
}), e);
|
|
931
969
|
}
|
|
932
|
-
async function
|
|
933
|
-
|
|
934
|
-
let i =
|
|
935
|
-
if (a &&
|
|
936
|
-
|
|
970
|
+
async function be(t, n, r) {
|
|
971
|
+
L && L.abort(), L = null, F = t, z = (r && r.startUninterruptedRevalidation) === !0, rt(P.location, P.matches), te = (r && r.preventScrollReset) === !0, ne = (r && r.enableViewTransition) === !0;
|
|
972
|
+
let i = c.activeRoutes, a = r?.initialHydration && P.matches && P.matches.length > 0 && !D ? P.matches : M(i, n, l, !1, c.branches), o = (r && r.flushSync) === !0;
|
|
973
|
+
if (a && P.initialized && !ie && Yt(P.location, n) && !(r && r.submission && Y(r.submission.formMethod))) {
|
|
974
|
+
G(n, { matches: a }, { flushSync: o });
|
|
937
975
|
return;
|
|
938
976
|
}
|
|
939
|
-
let
|
|
940
|
-
if (
|
|
941
|
-
let { error: e, notFoundMatches: t, route: r } =
|
|
942
|
-
|
|
977
|
+
let s = ot(a, i, n.pathname);
|
|
978
|
+
if (s.active && s.matches && (a = s.matches), !a) {
|
|
979
|
+
let { error: e, notFoundMatches: t, route: r } = et(n.pathname);
|
|
980
|
+
G(n, {
|
|
943
981
|
matches: t,
|
|
944
982
|
loaderData: {},
|
|
945
983
|
errors: { [r.id]: e }
|
|
@@ -951,22 +989,22 @@ function $e(e) {
|
|
|
951
989
|
matches: a,
|
|
952
990
|
historyAction: t
|
|
953
991
|
} : void 0;
|
|
954
|
-
|
|
955
|
-
let d =
|
|
956
|
-
if (r && r.pendingError) p = [
|
|
992
|
+
L = new AbortController();
|
|
993
|
+
let d = Lt(e.history, n, L.signal, r && r.submission), f = e.getContext ? await e.getContext() : new C(), p;
|
|
994
|
+
if (r && r.pendingError) p = [Gt(a).route.id, {
|
|
957
995
|
type: "error",
|
|
958
996
|
error: r.pendingError
|
|
959
997
|
}];
|
|
960
|
-
else if (r && r.submission &&
|
|
961
|
-
let i = await
|
|
998
|
+
else if (r && r.submission && Y(r.submission.formMethod)) {
|
|
999
|
+
let i = await xe(d, n, r.submission, a, t, f, s.active, r && r.initialHydration === !0, {
|
|
962
1000
|
replace: r.replace,
|
|
963
1001
|
flushSync: o
|
|
964
1002
|
});
|
|
965
1003
|
if (i.shortCircuited) return;
|
|
966
1004
|
if (i.pendingActionResult) {
|
|
967
1005
|
let [e, t] = i.pendingActionResult;
|
|
968
|
-
if (
|
|
969
|
-
|
|
1006
|
+
if (J(t) && Ce(t.error) && t.error.status === 404) {
|
|
1007
|
+
L = null, G(n, {
|
|
970
1008
|
matches: i.matches,
|
|
971
1009
|
loaderData: {},
|
|
972
1010
|
errors: { [e]: t.error }
|
|
@@ -974,24 +1012,24 @@ function $e(e) {
|
|
|
974
1012
|
return;
|
|
975
1013
|
}
|
|
976
1014
|
}
|
|
977
|
-
a = i.matches || a, p = i.pendingActionResult, u =
|
|
1015
|
+
a = i.matches || a, p = i.pendingActionResult, u = un(n, a, t, r.submission), o = !1, s.active = !1, d = Lt(e.history, d.url, d.signal);
|
|
978
1016
|
}
|
|
979
|
-
let { shortCircuited: m, matches: h, loaderData: g, errors: _, workingFetchers: v } = await
|
|
980
|
-
m || (
|
|
1017
|
+
let { shortCircuited: m, matches: h, loaderData: g, errors: _, workingFetchers: v } = await Se(d, n, a, t, f, s.active, u, r && r.submission, r && r.fetcherSubmission, r && r.replace, r && r.initialHydration === !0, o, p, r && r.callSiteDefaultShouldRevalidate);
|
|
1018
|
+
m || (L = null, G(n, {
|
|
981
1019
|
matches: h || a,
|
|
982
|
-
...
|
|
1020
|
+
...Wt(p),
|
|
983
1021
|
loaderData: g,
|
|
984
1022
|
errors: _,
|
|
985
1023
|
...v ? { fetchers: v } : {}
|
|
986
1024
|
}));
|
|
987
1025
|
}
|
|
988
|
-
async function
|
|
989
|
-
if (
|
|
990
|
-
let e = await
|
|
1026
|
+
async function xe(t, n, i, s, u, d, f, p, m = {}) {
|
|
1027
|
+
if (Pe(), W({ navigation: dn(n, s, u, i) }, { flushSync: m.flushSync === !0 }), f) {
|
|
1028
|
+
let e = await ft(s, n.pathname, t.signal);
|
|
991
1029
|
if (e.type === "aborted") return { shortCircuited: !0 };
|
|
992
1030
|
if (e.type === "error") {
|
|
993
1031
|
if (e.partialMatches.length === 0) {
|
|
994
|
-
let { matches: t, route: n } =
|
|
1032
|
+
let { matches: t, route: n } = Kt(c.activeRoutes);
|
|
995
1033
|
return {
|
|
996
1034
|
matches: t,
|
|
997
1035
|
pendingActionResult: [n.id, {
|
|
@@ -1000,7 +1038,7 @@ function $e(e) {
|
|
|
1000
1038
|
}]
|
|
1001
1039
|
};
|
|
1002
1040
|
}
|
|
1003
|
-
let t =
|
|
1041
|
+
let t = Gt(e.partialMatches).route.id;
|
|
1004
1042
|
return {
|
|
1005
1043
|
matches: e.partialMatches,
|
|
1006
1044
|
pendingActionResult: [t, {
|
|
@@ -1008,9 +1046,10 @@ function $e(e) {
|
|
|
1008
1046
|
error: e.error
|
|
1009
1047
|
}]
|
|
1010
1048
|
};
|
|
1011
|
-
}
|
|
1049
|
+
}
|
|
1050
|
+
if (e.matches) s = e.matches;
|
|
1012
1051
|
else {
|
|
1013
|
-
let { notFoundMatches: e, error: t, route: r } =
|
|
1052
|
+
let { notFoundMatches: e, error: t, route: r } = et(n.pathname);
|
|
1014
1053
|
return {
|
|
1015
1054
|
matches: e,
|
|
1016
1055
|
pendingActionResult: [r.id, {
|
|
@@ -1020,36 +1059,36 @@ function $e(e) {
|
|
|
1020
1059
|
};
|
|
1021
1060
|
}
|
|
1022
1061
|
}
|
|
1023
|
-
let h, g =
|
|
1062
|
+
let h, g = cn(s, n);
|
|
1024
1063
|
if (!g.route.action && !g.route.lazy) h = {
|
|
1025
1064
|
type: "error",
|
|
1026
|
-
error:
|
|
1065
|
+
error: q(405, {
|
|
1027
1066
|
method: t.method,
|
|
1028
1067
|
pathname: n.pathname,
|
|
1029
1068
|
routeId: g.route.id
|
|
1030
1069
|
})
|
|
1031
1070
|
};
|
|
1032
1071
|
else {
|
|
1033
|
-
let e = await
|
|
1072
|
+
let e = await Me(t, n, Ot(a, o, t, n, s, g, p ? [] : r, d), d, null);
|
|
1034
1073
|
if (h = e[g.route.id], !h) {
|
|
1035
|
-
for (let t of
|
|
1074
|
+
for (let t of s) if (e[t.route.id]) {
|
|
1036
1075
|
h = e[t.route.id];
|
|
1037
1076
|
break;
|
|
1038
1077
|
}
|
|
1039
1078
|
}
|
|
1040
1079
|
if (t.signal.aborted) return { shortCircuited: !0 };
|
|
1041
1080
|
}
|
|
1042
|
-
if (
|
|
1081
|
+
if (en(h)) {
|
|
1043
1082
|
let n;
|
|
1044
|
-
return n = m && m.replace != null ? m.replace :
|
|
1083
|
+
return n = m && m.replace != null ? m.replace : It(h.response.headers.get("Location"), new URL(t.url), l, e.history) === P.location.pathname + P.location.search, await je(t, h, !0, {
|
|
1045
1084
|
submission: i,
|
|
1046
1085
|
replace: n
|
|
1047
1086
|
}), { shortCircuited: !0 };
|
|
1048
1087
|
}
|
|
1049
|
-
if (
|
|
1050
|
-
let e =
|
|
1051
|
-
return (m && m.replace) !== !0 && (
|
|
1052
|
-
matches:
|
|
1088
|
+
if (J(h)) {
|
|
1089
|
+
let e = Gt(s, g.route.id);
|
|
1090
|
+
return (m && m.replace) !== !0 && (F = "PUSH"), {
|
|
1091
|
+
matches: s,
|
|
1053
1092
|
pendingActionResult: [
|
|
1054
1093
|
e.route.id,
|
|
1055
1094
|
h,
|
|
@@ -1058,40 +1097,41 @@ function $e(e) {
|
|
|
1058
1097
|
};
|
|
1059
1098
|
}
|
|
1060
1099
|
return {
|
|
1061
|
-
matches:
|
|
1100
|
+
matches: s,
|
|
1062
1101
|
pendingActionResult: [g.route.id, h]
|
|
1063
1102
|
};
|
|
1064
1103
|
}
|
|
1065
|
-
async function
|
|
1066
|
-
let b = f ||
|
|
1104
|
+
async function Se(t, n, i, s, u, d, f, p, m, h, g, _, v, y) {
|
|
1105
|
+
let b = f || un(n, i, s, p), x = p || m || ln(b), S = !z && !g;
|
|
1067
1106
|
if (d) {
|
|
1068
1107
|
if (S) {
|
|
1069
1108
|
let e = we(v);
|
|
1070
|
-
|
|
1109
|
+
W({
|
|
1071
1110
|
navigation: b,
|
|
1072
1111
|
...e === void 0 ? {} : { actionData: e }
|
|
1073
1112
|
}, { flushSync: _ });
|
|
1074
1113
|
}
|
|
1075
|
-
let e = await
|
|
1114
|
+
let e = await ft(i, n.pathname, t.signal);
|
|
1076
1115
|
if (e.type === "aborted") return { shortCircuited: !0 };
|
|
1077
1116
|
if (e.type === "error") {
|
|
1078
1117
|
if (e.partialMatches.length === 0) {
|
|
1079
|
-
let { matches: t, route: n } =
|
|
1118
|
+
let { matches: t, route: n } = Kt(c.activeRoutes);
|
|
1080
1119
|
return {
|
|
1081
1120
|
matches: t,
|
|
1082
1121
|
loaderData: {},
|
|
1083
1122
|
errors: { [n.id]: e.error }
|
|
1084
1123
|
};
|
|
1085
1124
|
}
|
|
1086
|
-
let t =
|
|
1125
|
+
let t = Gt(e.partialMatches).route.id;
|
|
1087
1126
|
return {
|
|
1088
1127
|
matches: e.partialMatches,
|
|
1089
1128
|
loaderData: {},
|
|
1090
1129
|
errors: { [t]: e.error }
|
|
1091
1130
|
};
|
|
1092
|
-
}
|
|
1131
|
+
}
|
|
1132
|
+
if (e.matches) i = e.matches;
|
|
1093
1133
|
else {
|
|
1094
|
-
let { error: e, notFoundMatches: t, route: r } =
|
|
1134
|
+
let { error: e, notFoundMatches: t, route: r } = et(n.pathname);
|
|
1095
1135
|
return {
|
|
1096
1136
|
matches: t,
|
|
1097
1137
|
loaderData: {},
|
|
@@ -1099,14 +1139,14 @@ function $e(e) {
|
|
|
1099
1139
|
};
|
|
1100
1140
|
}
|
|
1101
1141
|
}
|
|
1102
|
-
let C =
|
|
1103
|
-
if (
|
|
1104
|
-
let e = new Map(
|
|
1105
|
-
return
|
|
1142
|
+
let C = c.activeRoutes, { dsMatches: w, revalidatingFetchers: T } = lt(t, u, a, o, e.history, P, i, x, n, g ? [] : r, g === !0, ie, ae, U, le, V, C, l, e.patchRoutesOnNavigation != null, c.branches, v, y);
|
|
1143
|
+
if (se = ++oe, !e.dataStrategy && !w.some((e) => e.shouldLoad) && !w.some((e) => e.route.middleware && e.route.middleware.length > 0) && T.length === 0) {
|
|
1144
|
+
let e = new Map(P.fetchers), t = Ue(e);
|
|
1145
|
+
return G(n, {
|
|
1106
1146
|
matches: i,
|
|
1107
1147
|
loaderData: {},
|
|
1108
|
-
errors: v &&
|
|
1109
|
-
...
|
|
1148
|
+
errors: v && J(v[1]) ? { [v[0]]: v[1].error } : null,
|
|
1149
|
+
...Wt(v),
|
|
1110
1150
|
...t ? { fetchers: e } : {}
|
|
1111
1151
|
}, { flushSync: _ }), { shortCircuited: !0 };
|
|
1112
1152
|
}
|
|
@@ -1117,91 +1157,92 @@ function $e(e) {
|
|
|
1117
1157
|
let t = we(v);
|
|
1118
1158
|
t !== void 0 && (e.actionData = t);
|
|
1119
1159
|
}
|
|
1120
|
-
T.length > 0 && (e.fetchers = Te(T)),
|
|
1160
|
+
T.length > 0 && (e.fetchers = Te(T)), W(e, { flushSync: _ });
|
|
1121
1161
|
}
|
|
1122
1162
|
T.forEach((e) => {
|
|
1123
|
-
|
|
1163
|
+
Be(e.key), e.controller && B.set(e.key, e.controller);
|
|
1124
1164
|
});
|
|
1125
|
-
let E = () => T.forEach((e) =>
|
|
1126
|
-
|
|
1127
|
-
let { loaderResults: D, fetcherResults: O } = await
|
|
1165
|
+
let E = () => T.forEach((e) => Be(e.key));
|
|
1166
|
+
L && L.signal.addEventListener("abort", E);
|
|
1167
|
+
let { loaderResults: D, fetcherResults: O } = await Ne(w, T, t, n, u);
|
|
1128
1168
|
if (t.signal.aborted) return { shortCircuited: !0 };
|
|
1129
|
-
|
|
1130
|
-
let k =
|
|
1131
|
-
if (k) return await
|
|
1132
|
-
if (k =
|
|
1133
|
-
let A = new Map(
|
|
1134
|
-
g &&
|
|
1135
|
-
...
|
|
1136
|
-
...
|
|
1169
|
+
L && L.signal.removeEventListener("abort", E), T.forEach((e) => B.delete(e.key));
|
|
1170
|
+
let k = qt(D);
|
|
1171
|
+
if (k) return await je(t, k.result, !0, { replace: h }), { shortCircuited: !0 };
|
|
1172
|
+
if (k = qt(O), k) return V.add(k.key), await je(t, k.result, !0, { replace: h }), { shortCircuited: !0 };
|
|
1173
|
+
let A = new Map(P.fetchers), { loaderData: j, errors: M } = Ht(P, i, D, v, T, O, A);
|
|
1174
|
+
g && P.errors && (M = {
|
|
1175
|
+
...P.errors,
|
|
1176
|
+
...M
|
|
1137
1177
|
});
|
|
1138
|
-
let
|
|
1178
|
+
let ee = Ue(A), N = We(se, A), F = ee || N || T.length > 0;
|
|
1139
1179
|
return {
|
|
1140
1180
|
matches: i,
|
|
1141
|
-
loaderData:
|
|
1142
|
-
errors:
|
|
1143
|
-
...
|
|
1181
|
+
loaderData: j,
|
|
1182
|
+
errors: M,
|
|
1183
|
+
...F ? { workingFetchers: A } : {}
|
|
1144
1184
|
};
|
|
1145
1185
|
}
|
|
1146
1186
|
function we(e) {
|
|
1147
|
-
if (e && !
|
|
1148
|
-
if (
|
|
1187
|
+
if (e && !J(e[1])) return { [e[0]]: e[1].data };
|
|
1188
|
+
if (P.actionData) return Object.keys(P.actionData).length === 0 ? null : P.actionData;
|
|
1149
1189
|
}
|
|
1150
1190
|
function Te(e) {
|
|
1151
|
-
let t = new Map(
|
|
1191
|
+
let t = new Map(P.fetchers);
|
|
1152
1192
|
return e.forEach((e) => {
|
|
1153
|
-
let n = t.get(e.key), r =
|
|
1193
|
+
let n = t.get(e.key), r = fn(void 0, n ? n.data : void 0);
|
|
1154
1194
|
t.set(e.key, r);
|
|
1155
1195
|
}), t;
|
|
1156
1196
|
}
|
|
1157
|
-
async function
|
|
1158
|
-
|
|
1159
|
-
let a = (i && i.flushSync) === !0, o =
|
|
1197
|
+
async function Ee(t, n, r, i) {
|
|
1198
|
+
Be(t);
|
|
1199
|
+
let a = (i && i.flushSync) === !0, o = c.activeRoutes, s = st(P.location, P.matches, l, r, n, i?.relative), u = M(o, s, l, !1, c.branches), d = ot(u, o, s);
|
|
1160
1200
|
if (d.active && d.matches && (u = d.matches), !u) {
|
|
1161
|
-
|
|
1201
|
+
Fe(t, n, q(404, { pathname: s }), { flushSync: a });
|
|
1162
1202
|
return;
|
|
1163
1203
|
}
|
|
1164
|
-
let { path: f, submission: p, error: m } =
|
|
1204
|
+
let { path: f, submission: p, error: m } = ct(!0, s, i);
|
|
1165
1205
|
if (m) {
|
|
1166
|
-
|
|
1206
|
+
Fe(t, n, m, { flushSync: a });
|
|
1167
1207
|
return;
|
|
1168
1208
|
}
|
|
1169
1209
|
let h = e.getContext ? await e.getContext() : new C(), g = (i && i.preventScrollReset) === !0;
|
|
1170
|
-
if (p &&
|
|
1171
|
-
await
|
|
1210
|
+
if (p && Y(p.formMethod)) {
|
|
1211
|
+
await De(t, n, f, u, h, d.active, a, g, p, i && i.defaultShouldRevalidate);
|
|
1172
1212
|
return;
|
|
1173
1213
|
}
|
|
1174
|
-
|
|
1214
|
+
le.set(t, {
|
|
1175
1215
|
routeId: n,
|
|
1176
1216
|
path: f
|
|
1177
|
-
}), await
|
|
1217
|
+
}), await Ae(t, n, f, u, h, d.active, a, g, p);
|
|
1178
1218
|
}
|
|
1179
|
-
async function
|
|
1180
|
-
|
|
1181
|
-
let _ = new AbortController(), v =
|
|
1219
|
+
async function De(t, n, i, s, u, d, p, m, h, g) {
|
|
1220
|
+
Pe(), le.delete(t), K(t, pn(h, P.fetchers.get(t)), { flushSync: p });
|
|
1221
|
+
let _ = new AbortController(), v = Lt(e.history, i, _.signal, h);
|
|
1182
1222
|
if (d) {
|
|
1183
|
-
let e = await
|
|
1223
|
+
let e = await ft(s, new URL(v.url).pathname, v.signal, t);
|
|
1184
1224
|
if (e.type === "aborted") return;
|
|
1185
1225
|
if (e.type === "error") {
|
|
1186
|
-
|
|
1226
|
+
Fe(t, n, e.error, { flushSync: p });
|
|
1187
1227
|
return;
|
|
1188
|
-
}
|
|
1228
|
+
}
|
|
1229
|
+
if (e.matches) s = e.matches;
|
|
1189
1230
|
else {
|
|
1190
|
-
|
|
1231
|
+
Fe(t, n, q(404, { pathname: i }), { flushSync: p });
|
|
1191
1232
|
return;
|
|
1192
1233
|
}
|
|
1193
1234
|
}
|
|
1194
|
-
let y =
|
|
1235
|
+
let y = cn(s, i);
|
|
1195
1236
|
if (!y.route.action && !y.route.lazy) {
|
|
1196
|
-
|
|
1237
|
+
Fe(t, n, q(405, {
|
|
1197
1238
|
method: h.formMethod,
|
|
1198
1239
|
pathname: i,
|
|
1199
1240
|
routeId: n
|
|
1200
1241
|
}), { flushSync: p });
|
|
1201
1242
|
return;
|
|
1202
1243
|
}
|
|
1203
|
-
|
|
1204
|
-
let b =
|
|
1244
|
+
B.set(t, _);
|
|
1245
|
+
let b = oe, x = Ot(a, o, v, i, s, y, r, u), S = await Me(v, i, x, u, t), C = S[y.route.id];
|
|
1205
1246
|
if (!C) {
|
|
1206
1247
|
for (let e of x) if (S[e.route.id]) {
|
|
1207
1248
|
C = S[e.route.id];
|
|
@@ -1209,148 +1250,155 @@ function $e(e) {
|
|
|
1209
1250
|
}
|
|
1210
1251
|
}
|
|
1211
1252
|
if (v.signal.aborted) {
|
|
1212
|
-
|
|
1253
|
+
B.get(t) === _ && B.delete(t);
|
|
1213
1254
|
return;
|
|
1214
1255
|
}
|
|
1215
|
-
if (
|
|
1216
|
-
if (
|
|
1217
|
-
|
|
1256
|
+
if (U.has(t)) {
|
|
1257
|
+
if (en(C) || J(C)) {
|
|
1258
|
+
K(t, X(void 0));
|
|
1218
1259
|
return;
|
|
1219
1260
|
}
|
|
1220
1261
|
} else {
|
|
1221
|
-
if (
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1262
|
+
if (en(C)) {
|
|
1263
|
+
if (B.delete(t), se > b) {
|
|
1264
|
+
K(t, X(void 0));
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1267
|
+
return V.add(t), K(t, fn(h)), je(v, C, !1, {
|
|
1268
|
+
fetcherSubmission: h,
|
|
1269
|
+
preventScrollReset: m
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
if (J(C)) {
|
|
1273
|
+
Fe(t, n, C.error);
|
|
1230
1274
|
return;
|
|
1231
1275
|
}
|
|
1232
1276
|
}
|
|
1233
|
-
let w =
|
|
1277
|
+
let w = P.navigation.location || P.location, T = Lt(e.history, w, _.signal), E = c.activeRoutes, D = P.navigation.state === "idle" ? P.matches : M(E, P.navigation.location, l, !1, c.branches);
|
|
1234
1278
|
f(D, "Didn't find any matches after fetcher action");
|
|
1235
|
-
let O = ++
|
|
1236
|
-
|
|
1237
|
-
let { dsMatches: k, revalidatingFetchers: A } =
|
|
1238
|
-
|
|
1239
|
-
let t = e.key, n =
|
|
1240
|
-
|
|
1241
|
-
}),
|
|
1242
|
-
let
|
|
1243
|
-
_.signal.addEventListener("abort",
|
|
1244
|
-
let { loaderResults:
|
|
1279
|
+
let O = ++oe;
|
|
1280
|
+
ce.set(t, O);
|
|
1281
|
+
let { dsMatches: k, revalidatingFetchers: A } = lt(T, u, a, o, e.history, P, D, h, w, r, !1, ie, ae, U, le, V, E, l, e.patchRoutesOnNavigation != null, c.branches, [y.route.id, C], g), j = fn(h, C.data), ee = new Map(P.fetchers);
|
|
1282
|
+
ee.set(t, j), A.filter((e) => e.key !== t).forEach((e) => {
|
|
1283
|
+
let t = e.key, n = ee.get(t), r = fn(void 0, n ? n.data : void 0);
|
|
1284
|
+
ee.set(t, r), Be(t), e.controller && B.set(t, e.controller);
|
|
1285
|
+
}), W({ fetchers: ee });
|
|
1286
|
+
let N = () => A.forEach((e) => Be(e.key));
|
|
1287
|
+
_.signal.addEventListener("abort", N);
|
|
1288
|
+
let { loaderResults: I, fetcherResults: te } = await Ne(k, A, T, w, u);
|
|
1245
1289
|
if (_.signal.aborted) return;
|
|
1246
|
-
_.signal.removeEventListener("abort",
|
|
1247
|
-
let
|
|
1248
|
-
if (!
|
|
1290
|
+
_.signal.removeEventListener("abort", N), ce.delete(t), B.delete(t), A.forEach((e) => B.delete(e.key));
|
|
1291
|
+
let ne = P.fetchers.has(t), re = (e) => {
|
|
1292
|
+
if (!ne) return e;
|
|
1249
1293
|
let n = new Map(e.fetchers);
|
|
1250
|
-
return n.set(t,
|
|
1294
|
+
return n.set(t, X(C.data)), {
|
|
1251
1295
|
...e,
|
|
1252
1296
|
fetchers: n
|
|
1253
1297
|
};
|
|
1254
|
-
}, R =
|
|
1255
|
-
if (R) return
|
|
1256
|
-
if (R =
|
|
1257
|
-
let
|
|
1258
|
-
|
|
1259
|
-
let { loaderData:
|
|
1260
|
-
|
|
1298
|
+
}, R = qt(I);
|
|
1299
|
+
if (R) return P = re(P), je(T, R.result, !1, { preventScrollReset: m });
|
|
1300
|
+
if (R = qt(te), R) return V.add(R.key), P = re(P), je(T, R.result, !1, { preventScrollReset: m });
|
|
1301
|
+
let z = new Map(P.fetchers);
|
|
1302
|
+
ne && z.set(t, X(C.data));
|
|
1303
|
+
let { loaderData: H, errors: ue } = Ht(P, D, I, void 0, A, te, z);
|
|
1304
|
+
We(O, z), P.navigation.state === "loading" && O > se ? (f(F, "Expected pending action"), L && L.abort(), G(P.navigation.location, {
|
|
1261
1305
|
matches: D,
|
|
1262
|
-
loaderData:
|
|
1263
|
-
errors:
|
|
1264
|
-
fetchers:
|
|
1265
|
-
})) : (
|
|
1266
|
-
errors:
|
|
1267
|
-
loaderData:
|
|
1268
|
-
fetchers:
|
|
1269
|
-
}),
|
|
1270
|
-
}
|
|
1271
|
-
async function
|
|
1272
|
-
let p =
|
|
1273
|
-
|
|
1274
|
-
let m = new AbortController(), h =
|
|
1306
|
+
loaderData: H,
|
|
1307
|
+
errors: ue,
|
|
1308
|
+
fetchers: z
|
|
1309
|
+
})) : (W({
|
|
1310
|
+
errors: ue,
|
|
1311
|
+
loaderData: Ut(P.loaderData, H, D, ue),
|
|
1312
|
+
fetchers: z
|
|
1313
|
+
}), ie = !1);
|
|
1314
|
+
}
|
|
1315
|
+
async function Ae(t, n, i, s, c, l, u, d, f) {
|
|
1316
|
+
let p = P.fetchers.get(t);
|
|
1317
|
+
K(t, fn(f, p ? p.data : void 0), { flushSync: u });
|
|
1318
|
+
let m = new AbortController(), h = Lt(e.history, i, m.signal);
|
|
1275
1319
|
if (l) {
|
|
1276
|
-
let e = await
|
|
1320
|
+
let e = await ft(s, new URL(h.url).pathname, h.signal, t);
|
|
1277
1321
|
if (e.type === "aborted") return;
|
|
1278
1322
|
if (e.type === "error") {
|
|
1279
|
-
|
|
1323
|
+
Fe(t, n, e.error, { flushSync: u });
|
|
1280
1324
|
return;
|
|
1281
|
-
}
|
|
1325
|
+
}
|
|
1326
|
+
if (e.matches) s = e.matches;
|
|
1282
1327
|
else {
|
|
1283
|
-
|
|
1328
|
+
Fe(t, n, q(404, { pathname: i }), { flushSync: u });
|
|
1284
1329
|
return;
|
|
1285
1330
|
}
|
|
1286
1331
|
}
|
|
1287
|
-
let g =
|
|
1288
|
-
|
|
1289
|
-
let _ =
|
|
1332
|
+
let g = cn(s, i);
|
|
1333
|
+
B.set(t, m);
|
|
1334
|
+
let _ = oe, v = await Me(h, i, Ot(a, o, h, i, s, g, r, c), c, t), y = v[g.route.id];
|
|
1290
1335
|
if (!y) {
|
|
1291
1336
|
for (let e of s) if (v[e.route.id]) {
|
|
1292
1337
|
y = v[e.route.id];
|
|
1293
1338
|
break;
|
|
1294
1339
|
}
|
|
1295
1340
|
}
|
|
1296
|
-
if (
|
|
1297
|
-
if (
|
|
1298
|
-
|
|
1341
|
+
if (B.get(t) === m && B.delete(t), !h.signal.aborted) {
|
|
1342
|
+
if (U.has(t)) {
|
|
1343
|
+
K(t, X(void 0));
|
|
1299
1344
|
return;
|
|
1300
1345
|
}
|
|
1301
|
-
if (
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1346
|
+
if (en(y)) {
|
|
1347
|
+
if (se > _) {
|
|
1348
|
+
K(t, X(void 0));
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1351
|
+
V.add(t), await je(h, y, !1, { preventScrollReset: d });
|
|
1306
1352
|
return;
|
|
1307
1353
|
}
|
|
1308
|
-
if (
|
|
1309
|
-
|
|
1354
|
+
if (J(y)) {
|
|
1355
|
+
Fe(t, n, y.error);
|
|
1310
1356
|
return;
|
|
1311
1357
|
}
|
|
1312
|
-
|
|
1358
|
+
K(t, X(y.data));
|
|
1313
1359
|
}
|
|
1314
1360
|
}
|
|
1315
|
-
async function
|
|
1316
|
-
a || (
|
|
1361
|
+
async function je(r, i, a, { submission: o, fetcherSubmission: s, preventScrollReset: c, replace: u } = {}) {
|
|
1362
|
+
a || (I?.resolve(), I = null), i.response.headers.has("X-Remix-Revalidate") && (ie = !0);
|
|
1317
1363
|
let d = i.response.headers.get("Location");
|
|
1318
|
-
f(d, "Expected a Location header on the redirect Response")
|
|
1319
|
-
let p =
|
|
1364
|
+
f(d, "Expected a Location header on the redirect Response");
|
|
1365
|
+
let p = d, m = new URL(r.url);
|
|
1366
|
+
d = It(d, m, l, e.history), Ve(p, d, m, "allow-explicit");
|
|
1367
|
+
let h = g(P.location, d, { _isRedirect: !0 });
|
|
1320
1368
|
if (n) {
|
|
1321
1369
|
let e = !1;
|
|
1322
1370
|
if (i.response.headers.has("X-Remix-Reload-Document")) e = !0;
|
|
1323
|
-
else if (
|
|
1371
|
+
else if (de(d)) {
|
|
1324
1372
|
let n = b(t, d, !0);
|
|
1325
|
-
e = n.origin !== t.location.origin ||
|
|
1373
|
+
e = n.origin !== t.location.origin || H(n.pathname, l) == null;
|
|
1326
1374
|
}
|
|
1327
1375
|
if (e) {
|
|
1328
1376
|
u ? t.location.replace(d) : t.location.assign(d);
|
|
1329
1377
|
return;
|
|
1330
1378
|
}
|
|
1331
1379
|
}
|
|
1332
|
-
|
|
1333
|
-
let
|
|
1334
|
-
!o && !s &&
|
|
1335
|
-
let
|
|
1336
|
-
|
|
1380
|
+
L = null;
|
|
1381
|
+
let _ = u === !0 || i.response.headers.has("X-Remix-Replace") ? "REPLACE" : "PUSH", { formMethod: v, formAction: y, formEncType: x } = P.navigation;
|
|
1382
|
+
!o && !s && v && y && x && (o = ln(P.navigation));
|
|
1383
|
+
let S = o || s;
|
|
1384
|
+
qe.has(i.response.status) && S && Y(S.formMethod) ? await be(_, h, {
|
|
1337
1385
|
submission: {
|
|
1338
|
-
...
|
|
1386
|
+
...S,
|
|
1339
1387
|
formAction: d
|
|
1340
1388
|
},
|
|
1341
|
-
preventScrollReset:
|
|
1389
|
+
preventScrollReset: c || te,
|
|
1342
1390
|
enableViewTransition: a ? ne : void 0
|
|
1343
|
-
}) : await
|
|
1344
|
-
overrideNavigation:
|
|
1391
|
+
}) : await be(_, h, {
|
|
1392
|
+
overrideNavigation: un(h, [], _, o),
|
|
1345
1393
|
fetcherSubmission: s,
|
|
1346
|
-
preventScrollReset:
|
|
1394
|
+
preventScrollReset: c || te,
|
|
1347
1395
|
enableViewTransition: a ? ne : void 0
|
|
1348
1396
|
});
|
|
1349
1397
|
}
|
|
1350
|
-
async function
|
|
1398
|
+
async function Me(e, t, n, r, i) {
|
|
1351
1399
|
let a, o = {};
|
|
1352
1400
|
try {
|
|
1353
|
-
a = await
|
|
1401
|
+
a = await kt(u, e, t, n, i, r, !1);
|
|
1354
1402
|
} catch (e) {
|
|
1355
1403
|
return n.filter((e) => e.shouldLoad).forEach((t) => {
|
|
1356
1404
|
o[t.route.id] = {
|
|
@@ -1360,30 +1408,31 @@ function $e(e) {
|
|
|
1360
1408
|
}), o;
|
|
1361
1409
|
}
|
|
1362
1410
|
if (e.signal.aborted) return o;
|
|
1363
|
-
if (!
|
|
1411
|
+
if (!Y(e.method)) for (let e of n) {
|
|
1364
1412
|
if (a[e.route.id]?.type === "error") break;
|
|
1365
|
-
!a.hasOwnProperty(e.route.id) && !
|
|
1413
|
+
!a.hasOwnProperty(e.route.id) && !P.loaderData.hasOwnProperty(e.route.id) && (!P.errors || !P.errors.hasOwnProperty(e.route.id)) && e.shouldCallHandler() && (a[e.route.id] = {
|
|
1366
1414
|
type: "error",
|
|
1367
1415
|
result: /* @__PURE__ */ Error(`No result returned from dataStrategy for route ${e.route.id}`)
|
|
1368
1416
|
});
|
|
1369
1417
|
}
|
|
1370
|
-
for (let [t, r] of Object.entries(a)) if (
|
|
1418
|
+
for (let [t, r] of Object.entries(a)) if ($t(r)) {
|
|
1371
1419
|
let i = r.result;
|
|
1372
1420
|
o[t] = {
|
|
1373
1421
|
type: "redirect",
|
|
1374
|
-
response:
|
|
1422
|
+
response: Nt(i, e, t, n, l)
|
|
1375
1423
|
};
|
|
1376
|
-
} else o[t] = await
|
|
1424
|
+
} else o[t] = await Mt(r);
|
|
1377
1425
|
return o;
|
|
1378
1426
|
}
|
|
1379
|
-
async function
|
|
1380
|
-
let a =
|
|
1427
|
+
async function Ne(e, t, n, r, i) {
|
|
1428
|
+
let a = Me(n, r, e, i, null), o = Promise.all(t.map(async (e) => {
|
|
1381
1429
|
if (e.matches && e.match && e.request && e.controller) {
|
|
1382
|
-
let t = (await
|
|
1430
|
+
let t = (await Me(e.request, e.path, e.matches, i, e.key))[e.match.route.id];
|
|
1383
1431
|
return { [e.key]: t };
|
|
1384
|
-
}
|
|
1432
|
+
}
|
|
1433
|
+
return Promise.resolve({ [e.key]: {
|
|
1385
1434
|
type: "error",
|
|
1386
|
-
error:
|
|
1435
|
+
error: q(404, { pathname: e.path })
|
|
1387
1436
|
} });
|
|
1388
1437
|
}));
|
|
1389
1438
|
return {
|
|
@@ -1391,131 +1440,131 @@ function $e(e) {
|
|
|
1391
1440
|
fetcherResults: (await o).reduce((e, t) => Object.assign(e, t), {})
|
|
1392
1441
|
};
|
|
1393
1442
|
}
|
|
1394
|
-
function
|
|
1395
|
-
|
|
1396
|
-
|
|
1443
|
+
function Pe() {
|
|
1444
|
+
ie = !0, le.forEach((e, t) => {
|
|
1445
|
+
B.has(t) && ae.add(t), Be(t);
|
|
1397
1446
|
});
|
|
1398
1447
|
}
|
|
1399
|
-
function
|
|
1400
|
-
let r = new Map(
|
|
1401
|
-
r.set(e, t),
|
|
1448
|
+
function K(e, t, n = {}) {
|
|
1449
|
+
let r = new Map(P.fetchers);
|
|
1450
|
+
r.set(e, t), W({ fetchers: r }, { flushSync: (n && n.flushSync) === !0 });
|
|
1402
1451
|
}
|
|
1403
|
-
function
|
|
1404
|
-
let i =
|
|
1405
|
-
|
|
1452
|
+
function Fe(e, t, n, r = {}) {
|
|
1453
|
+
let i = Gt(P.matches, t), a = new Map(P.fetchers);
|
|
1454
|
+
Re(a, e), W({
|
|
1406
1455
|
errors: { [i.route.id]: n },
|
|
1407
1456
|
fetchers: a
|
|
1408
1457
|
}, { flushSync: (r && r.flushSync) === !0 });
|
|
1409
1458
|
}
|
|
1410
|
-
function
|
|
1411
|
-
return
|
|
1412
|
-
}
|
|
1413
|
-
function Ie(e, t) {
|
|
1414
|
-
ze(e, t?.reason), G(e, cn(null));
|
|
1459
|
+
function Ie(e) {
|
|
1460
|
+
return ue.set(e, (ue.get(e) || 0) + 1), U.has(e) && U.delete(e), P.fetchers.get(e) || Ye;
|
|
1415
1461
|
}
|
|
1416
1462
|
function Le(e, t) {
|
|
1417
|
-
|
|
1418
|
-
I.has(t) && !(n && n.state === "loading" && ue.has(t)) && ze(t), de.delete(t), ue.delete(t), L.delete(t), z.delete(t), se.delete(t), e.delete(t);
|
|
1463
|
+
Be(e, t?.reason), K(e, X(null));
|
|
1419
1464
|
}
|
|
1420
|
-
function Re(e) {
|
|
1421
|
-
let
|
|
1422
|
-
t
|
|
1465
|
+
function Re(e, t) {
|
|
1466
|
+
let n = P.fetchers.get(t);
|
|
1467
|
+
B.has(t) && !(n && n.state === "loading" && ce.has(t)) && Be(t), le.delete(t), ce.delete(t), V.delete(t), U.delete(t), ae.delete(t), e.delete(t);
|
|
1423
1468
|
}
|
|
1424
|
-
function ze(e
|
|
1425
|
-
let
|
|
1426
|
-
|
|
1469
|
+
function ze(e) {
|
|
1470
|
+
let t = (ue.get(e) || 0) - 1;
|
|
1471
|
+
t <= 0 ? (ue.delete(e), U.add(e)) : ue.set(e, t), W({ fetchers: new Map(P.fetchers) });
|
|
1427
1472
|
}
|
|
1428
1473
|
function Be(e, t) {
|
|
1474
|
+
let n = B.get(e);
|
|
1475
|
+
n && (n.abort(t), B.delete(e));
|
|
1476
|
+
}
|
|
1477
|
+
function He(e, t) {
|
|
1429
1478
|
for (let n of e) {
|
|
1430
1479
|
let e = t.get(n);
|
|
1431
1480
|
f(e, `Expected fetcher: ${n}`);
|
|
1432
|
-
let r =
|
|
1481
|
+
let r = X(e.data);
|
|
1433
1482
|
t.set(n, r);
|
|
1434
1483
|
}
|
|
1435
1484
|
}
|
|
1436
|
-
function
|
|
1485
|
+
function Ue(e) {
|
|
1437
1486
|
let t = [], n = !1;
|
|
1438
|
-
for (let r of
|
|
1487
|
+
for (let r of V) {
|
|
1439
1488
|
let i = e.get(r);
|
|
1440
|
-
f(i, `Expected fetcher: ${r}`), i.state === "loading" && (
|
|
1489
|
+
f(i, `Expected fetcher: ${r}`), i.state === "loading" && (V.delete(r), t.push(r), n = !0);
|
|
1441
1490
|
}
|
|
1442
|
-
return
|
|
1491
|
+
return He(t, e), n;
|
|
1443
1492
|
}
|
|
1444
|
-
function
|
|
1493
|
+
function We(e, t) {
|
|
1445
1494
|
let n = [];
|
|
1446
|
-
for (let [r, i] of
|
|
1495
|
+
for (let [r, i] of ce) if (i < e) {
|
|
1447
1496
|
let e = t.get(r);
|
|
1448
|
-
f(e, `Expected fetcher: ${r}`), e.state === "loading" && (
|
|
1497
|
+
f(e, `Expected fetcher: ${r}`), e.state === "loading" && (Be(r), ce.delete(r), n.push(r));
|
|
1449
1498
|
}
|
|
1450
|
-
return
|
|
1499
|
+
return He(n, t), n.length > 0;
|
|
1451
1500
|
}
|
|
1452
|
-
function
|
|
1453
|
-
let n =
|
|
1501
|
+
function Ge(e, t) {
|
|
1502
|
+
let n = P.blockers.get(e) || Xe;
|
|
1454
1503
|
return fe.get(e) !== t && fe.set(e, t), n;
|
|
1455
1504
|
}
|
|
1456
|
-
function
|
|
1457
|
-
|
|
1505
|
+
function Ke(e) {
|
|
1506
|
+
P.blockers.delete(e), fe.delete(e);
|
|
1458
1507
|
}
|
|
1459
|
-
function
|
|
1460
|
-
let n =
|
|
1508
|
+
function Qe(e, t) {
|
|
1509
|
+
let n = P.blockers.get(e) || Xe;
|
|
1461
1510
|
f(n.state === "unblocked" && t.state === "blocked" || n.state === "blocked" && t.state === "blocked" || n.state === "blocked" && t.state === "proceeding" || n.state === "blocked" && t.state === "unblocked" || n.state === "proceeding" && t.state === "unblocked", `Invalid blocker state transition: ${n.state} -> ${t.state}`);
|
|
1462
|
-
let r = new Map(
|
|
1463
|
-
r.set(e, t),
|
|
1511
|
+
let r = new Map(P.blockers);
|
|
1512
|
+
r.set(e, t), W({ blockers: r });
|
|
1464
1513
|
}
|
|
1465
|
-
function
|
|
1514
|
+
function $e({ currentLocation: e, nextLocation: t, historyAction: n }) {
|
|
1466
1515
|
if (fe.size === 0) return;
|
|
1467
1516
|
fe.size > 1 && p(!1, "A router only supports one blocker at a time");
|
|
1468
|
-
let r = Array.from(fe.entries()), [i, a] = r[r.length - 1], o =
|
|
1517
|
+
let r = Array.from(fe.entries()), [i, a] = r[r.length - 1], o = P.blockers.get(i);
|
|
1469
1518
|
if (!(o && o.state === "proceeding") && a({
|
|
1470
1519
|
currentLocation: e,
|
|
1471
1520
|
nextLocation: t,
|
|
1472
1521
|
historyAction: n
|
|
1473
1522
|
})) return i;
|
|
1474
1523
|
}
|
|
1475
|
-
function
|
|
1476
|
-
let t =
|
|
1524
|
+
function et(e) {
|
|
1525
|
+
let t = q(404, { pathname: e }), n = c.activeRoutes, { matches: r, route: i } = Kt(n);
|
|
1477
1526
|
return {
|
|
1478
1527
|
notFoundMatches: r,
|
|
1479
1528
|
route: i,
|
|
1480
1529
|
error: t
|
|
1481
1530
|
};
|
|
1482
1531
|
}
|
|
1483
|
-
function
|
|
1484
|
-
if (
|
|
1485
|
-
|
|
1486
|
-
let e =
|
|
1487
|
-
e != null &&
|
|
1532
|
+
function tt(e, t, n) {
|
|
1533
|
+
if (x = e, w = t, S = n || null, !T && P.navigation === Je) {
|
|
1534
|
+
T = !0;
|
|
1535
|
+
let e = at(P.location, P.matches);
|
|
1536
|
+
e != null && W({ restoreScrollPosition: e });
|
|
1488
1537
|
}
|
|
1489
1538
|
return () => {
|
|
1490
|
-
|
|
1539
|
+
x = null, w = null, S = null;
|
|
1491
1540
|
};
|
|
1492
1541
|
}
|
|
1493
|
-
function
|
|
1494
|
-
return
|
|
1542
|
+
function nt(e, t) {
|
|
1543
|
+
return S && S(e, t.map((e) => ee(e, P.loaderData))) || e.key;
|
|
1495
1544
|
}
|
|
1496
|
-
function
|
|
1497
|
-
if (
|
|
1498
|
-
let n =
|
|
1499
|
-
|
|
1545
|
+
function rt(e, t) {
|
|
1546
|
+
if (x && w) {
|
|
1547
|
+
let n = nt(e, t);
|
|
1548
|
+
x[n] = w();
|
|
1500
1549
|
}
|
|
1501
1550
|
}
|
|
1502
|
-
function
|
|
1503
|
-
if (
|
|
1504
|
-
let n =
|
|
1551
|
+
function at(e, t) {
|
|
1552
|
+
if (x) {
|
|
1553
|
+
let n = nt(e, t), r = x[n];
|
|
1505
1554
|
if (typeof r == "number") return r;
|
|
1506
1555
|
}
|
|
1507
1556
|
return null;
|
|
1508
1557
|
}
|
|
1509
|
-
function
|
|
1558
|
+
function ot(t, n, r) {
|
|
1510
1559
|
if (e.patchRoutesOnNavigation) {
|
|
1511
|
-
let e =
|
|
1560
|
+
let e = c.branches;
|
|
1512
1561
|
if (!t) return {
|
|
1513
1562
|
active: !0,
|
|
1514
|
-
matches: M(n, r,
|
|
1563
|
+
matches: M(n, r, l, !0, e) || []
|
|
1515
1564
|
};
|
|
1516
1565
|
if (Object.keys(t[0].params).length > 0) return {
|
|
1517
1566
|
active: !0,
|
|
1518
|
-
matches: M(n, r,
|
|
1567
|
+
matches: M(n, r, l, !0, e)
|
|
1519
1568
|
};
|
|
1520
1569
|
}
|
|
1521
1570
|
return {
|
|
@@ -1523,68 +1572,68 @@ function $e(e) {
|
|
|
1523
1572
|
matches: null
|
|
1524
1573
|
};
|
|
1525
1574
|
}
|
|
1526
|
-
async function
|
|
1575
|
+
async function ft(t, n, r, i) {
|
|
1527
1576
|
if (!e.patchRoutesOnNavigation) return {
|
|
1528
1577
|
type: "success",
|
|
1529
1578
|
matches: t
|
|
1530
1579
|
};
|
|
1531
|
-
let
|
|
1580
|
+
let s = t;
|
|
1532
1581
|
for (;;) {
|
|
1533
1582
|
let t = o;
|
|
1534
1583
|
try {
|
|
1535
1584
|
await e.patchRoutesOnNavigation({
|
|
1536
1585
|
signal: r,
|
|
1537
1586
|
path: n,
|
|
1538
|
-
matches:
|
|
1587
|
+
matches: s,
|
|
1539
1588
|
fetcherKey: i,
|
|
1540
1589
|
patch: (e, n) => {
|
|
1541
|
-
r.aborted ||
|
|
1590
|
+
r.aborted || ht(e, n, c, t, a, !1);
|
|
1542
1591
|
}
|
|
1543
1592
|
});
|
|
1544
1593
|
} catch (e) {
|
|
1545
1594
|
return {
|
|
1546
1595
|
type: "error",
|
|
1547
1596
|
error: e,
|
|
1548
|
-
partialMatches:
|
|
1597
|
+
partialMatches: s
|
|
1549
1598
|
};
|
|
1550
1599
|
}
|
|
1551
1600
|
if (r.aborted) return { type: "aborted" };
|
|
1552
|
-
let u =
|
|
1553
|
-
if (d && (Object.keys(d[0].params).length === 0 || (f = M(
|
|
1601
|
+
let u = c.branches, d = M(c.activeRoutes, n, l, !1, u), f = null;
|
|
1602
|
+
if (d && (Object.keys(d[0].params).length === 0 || (f = M(c.activeRoutes, n, l, !0, u), !(f && s.length < f.length && pt(s, f.slice(0, s.length)))))) return {
|
|
1554
1603
|
type: "success",
|
|
1555
1604
|
matches: d
|
|
1556
1605
|
};
|
|
1557
|
-
if (f ||= M(
|
|
1606
|
+
if (f ||= M(c.activeRoutes, n, l, !0, u), !f || pt(s, f)) return {
|
|
1558
1607
|
type: "success",
|
|
1559
1608
|
matches: null
|
|
1560
1609
|
};
|
|
1561
|
-
|
|
1610
|
+
s = f;
|
|
1562
1611
|
}
|
|
1563
1612
|
}
|
|
1564
|
-
function
|
|
1613
|
+
function pt(e, t) {
|
|
1565
1614
|
return e.length === t.length && e.every((e, n) => e.route.id === t[n].route.id);
|
|
1566
1615
|
}
|
|
1567
|
-
function
|
|
1568
|
-
o = {},
|
|
1616
|
+
function mt(e) {
|
|
1617
|
+
o = {}, c.setHmrRoutes(k(e, a, void 0, o));
|
|
1569
1618
|
}
|
|
1570
|
-
function
|
|
1571
|
-
|
|
1619
|
+
function gt(e, t, n = !1) {
|
|
1620
|
+
ht(e, t, c, o, a, n), c.hasHMRRoutes || W({});
|
|
1572
1621
|
}
|
|
1573
|
-
return
|
|
1622
|
+
return N = {
|
|
1574
1623
|
get basename() {
|
|
1575
|
-
return
|
|
1624
|
+
return l;
|
|
1576
1625
|
},
|
|
1577
1626
|
get future() {
|
|
1578
|
-
return
|
|
1627
|
+
return d;
|
|
1579
1628
|
},
|
|
1580
1629
|
get state() {
|
|
1581
|
-
return
|
|
1630
|
+
return P;
|
|
1582
1631
|
},
|
|
1583
1632
|
get routes() {
|
|
1584
|
-
return
|
|
1633
|
+
return c.stableRoutes;
|
|
1585
1634
|
},
|
|
1586
1635
|
get branches() {
|
|
1587
|
-
return
|
|
1636
|
+
return c.branches;
|
|
1588
1637
|
},
|
|
1589
1638
|
get manifest() {
|
|
1590
1639
|
return o;
|
|
@@ -1592,32 +1641,33 @@ function $e(e) {
|
|
|
1592
1641
|
get window() {
|
|
1593
1642
|
return t;
|
|
1594
1643
|
},
|
|
1595
|
-
initialize:
|
|
1596
|
-
subscribe:
|
|
1597
|
-
enableScrollRestoration:
|
|
1598
|
-
navigate:
|
|
1599
|
-
fetch:
|
|
1600
|
-
revalidate:
|
|
1644
|
+
initialize: he,
|
|
1645
|
+
subscribe: _e,
|
|
1646
|
+
enableScrollRestoration: tt,
|
|
1647
|
+
navigate: ve,
|
|
1648
|
+
fetch: Ee,
|
|
1649
|
+
revalidate: ye,
|
|
1601
1650
|
createHref: (t) => e.history.createHref(t),
|
|
1651
|
+
createURL: (t) => e.history.createURL(t),
|
|
1602
1652
|
encodeLocation: (t) => e.history.encodeLocation(t),
|
|
1603
|
-
getFetcher:
|
|
1604
|
-
resetFetcher:
|
|
1605
|
-
deleteFetcher:
|
|
1606
|
-
dispose:
|
|
1607
|
-
getBlocker:
|
|
1608
|
-
deleteBlocker:
|
|
1609
|
-
patchRoutes:
|
|
1610
|
-
_internalFetchControllers:
|
|
1611
|
-
_internalSetRoutes:
|
|
1653
|
+
getFetcher: Ie,
|
|
1654
|
+
resetFetcher: Le,
|
|
1655
|
+
deleteFetcher: ze,
|
|
1656
|
+
dispose: ge,
|
|
1657
|
+
getBlocker: Ge,
|
|
1658
|
+
deleteBlocker: Ke,
|
|
1659
|
+
patchRoutes: gt,
|
|
1660
|
+
_internalFetchControllers: B,
|
|
1661
|
+
_internalSetRoutes: mt,
|
|
1612
1662
|
_internalSetStateDoNotUseOrYouWillBreakYourApp(e) {
|
|
1613
|
-
|
|
1663
|
+
W(e);
|
|
1614
1664
|
}
|
|
1615
|
-
}, e.instrumentations && (
|
|
1665
|
+
}, e.instrumentations && (N = ke(N, e.instrumentations.map((e) => e.router).filter(Boolean))), N;
|
|
1616
1666
|
}
|
|
1617
|
-
function
|
|
1667
|
+
function ot(e) {
|
|
1618
1668
|
return e != null && ("formData" in e && e.formData != null || "body" in e && e.body !== void 0);
|
|
1619
1669
|
}
|
|
1620
|
-
function
|
|
1670
|
+
function st(e, t, n, r, i, a) {
|
|
1621
1671
|
let o, s;
|
|
1622
1672
|
if (i) {
|
|
1623
1673
|
o = [];
|
|
@@ -1626,9 +1676,9 @@ function tt(e, t, n, r, i, a) {
|
|
|
1626
1676
|
break;
|
|
1627
1677
|
}
|
|
1628
1678
|
} else o = t, s = t[t.length - 1];
|
|
1629
|
-
let c =
|
|
1679
|
+
let c = ge(r || ".", he(o), H(e.pathname, n) || e.pathname, a === "path");
|
|
1630
1680
|
if (r ?? (c.search = e.search, c.hash = e.hash), (r == null || r === "" || r === ".") && s) {
|
|
1631
|
-
let e =
|
|
1681
|
+
let e = sn(c.search);
|
|
1632
1682
|
if (s.route.index && !e) c.search = c.search ? c.search.replace(/^\?/, "?index&") : "?index";
|
|
1633
1683
|
else if (!s.route.index && e) {
|
|
1634
1684
|
let e = new URLSearchParams(c.search), t = e.getAll("index");
|
|
@@ -1637,24 +1687,24 @@ function tt(e, t, n, r, i, a) {
|
|
|
1637
1687
|
c.search = n ? `?${n}` : "";
|
|
1638
1688
|
}
|
|
1639
1689
|
}
|
|
1640
|
-
return n !== "/" && (c.pathname =
|
|
1690
|
+
return n !== "/" && (c.pathname = ue({
|
|
1641
1691
|
basename: n,
|
|
1642
1692
|
pathname: c.pathname
|
|
1643
1693
|
})), _(c);
|
|
1644
1694
|
}
|
|
1645
|
-
function
|
|
1646
|
-
if (!n || !
|
|
1647
|
-
if (n.formMethod &&
|
|
1695
|
+
function ct(e, t, n) {
|
|
1696
|
+
if (!n || !ot(n)) return { path: t };
|
|
1697
|
+
if (n.formMethod && !on(n.formMethod)) return {
|
|
1648
1698
|
path: t,
|
|
1649
|
-
error:
|
|
1699
|
+
error: q(405, { method: n.formMethod })
|
|
1650
1700
|
};
|
|
1651
1701
|
let r = () => ({
|
|
1652
1702
|
path: t,
|
|
1653
|
-
error:
|
|
1654
|
-
}), i = (n.formMethod || "get").toUpperCase(), a =
|
|
1703
|
+
error: q(400, { type: "invalid-body" })
|
|
1704
|
+
}), i = (n.formMethod || "get").toUpperCase(), a = Jt(t);
|
|
1655
1705
|
if (n.body !== void 0) {
|
|
1656
1706
|
if (n.formEncType === "text/plain") {
|
|
1657
|
-
if (!
|
|
1707
|
+
if (!Y(i)) return r();
|
|
1658
1708
|
let e = typeof n.body == "string" ? n.body : n.body instanceof FormData || n.body instanceof URLSearchParams ? Array.from(n.body.entries()).reduce((e, [t, n]) => `${e}${t}=${n}
|
|
1659
1709
|
`, "") : String(n.body);
|
|
1660
1710
|
return {
|
|
@@ -1668,8 +1718,9 @@ function nt(e, t, n) {
|
|
|
1668
1718
|
text: e
|
|
1669
1719
|
}
|
|
1670
1720
|
};
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1721
|
+
}
|
|
1722
|
+
if (n.formEncType === "application/json") {
|
|
1723
|
+
if (!Y(i)) return r();
|
|
1673
1724
|
try {
|
|
1674
1725
|
let e = typeof n.body == "string" ? JSON.parse(n.body) : n.body;
|
|
1675
1726
|
return {
|
|
@@ -1690,12 +1741,12 @@ function nt(e, t, n) {
|
|
|
1690
1741
|
}
|
|
1691
1742
|
f(typeof FormData == "function", "FormData is not available in this environment");
|
|
1692
1743
|
let o, s;
|
|
1693
|
-
if (n.formData) o =
|
|
1694
|
-
else if (n.body instanceof FormData) o =
|
|
1695
|
-
else if (n.body instanceof URLSearchParams) o = n.body, s =
|
|
1744
|
+
if (n.formData) o = zt(n.formData), s = n.formData;
|
|
1745
|
+
else if (n.body instanceof FormData) o = zt(n.body), s = n.body;
|
|
1746
|
+
else if (n.body instanceof URLSearchParams) o = n.body, s = Bt(o);
|
|
1696
1747
|
else if (n.body == null) o = new URLSearchParams(), s = new FormData();
|
|
1697
1748
|
else try {
|
|
1698
|
-
o = new URLSearchParams(n.body), s =
|
|
1749
|
+
o = new URLSearchParams(n.body), s = Bt(o);
|
|
1699
1750
|
} catch {
|
|
1700
1751
|
return r();
|
|
1701
1752
|
}
|
|
@@ -1707,22 +1758,22 @@ function nt(e, t, n) {
|
|
|
1707
1758
|
json: void 0,
|
|
1708
1759
|
text: void 0
|
|
1709
1760
|
};
|
|
1710
|
-
if (
|
|
1761
|
+
if (Y(c.formMethod)) return {
|
|
1711
1762
|
path: t,
|
|
1712
1763
|
submission: c
|
|
1713
1764
|
};
|
|
1714
1765
|
let l = v(t);
|
|
1715
|
-
return e && l.search &&
|
|
1766
|
+
return e && l.search && sn(l.search) && o.append("index", ""), l.search = `?${o}`, {
|
|
1716
1767
|
path: _(l),
|
|
1717
1768
|
submission: c
|
|
1718
1769
|
};
|
|
1719
1770
|
}
|
|
1720
|
-
function
|
|
1721
|
-
let S = b ?
|
|
1771
|
+
function lt(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
1772
|
+
let S = b ? J(b[1]) ? b[1].error : b[1].data : void 0, C = i.createURL(a.location), w = i.createURL(c), T;
|
|
1722
1773
|
if (u && a.errors) {
|
|
1723
1774
|
let e = Object.keys(a.errors)[0];
|
|
1724
1775
|
T = o.findIndex((t) => t.route.id === e);
|
|
1725
|
-
} else if (b &&
|
|
1776
|
+
} else if (b && J(b[1])) {
|
|
1726
1777
|
let e = b[0];
|
|
1727
1778
|
T = o.findIndex((t) => t.route.id === e) - 1;
|
|
1728
1779
|
}
|
|
@@ -1734,23 +1785,23 @@ function rt(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
|
1734
1785
|
...s,
|
|
1735
1786
|
actionResult: S,
|
|
1736
1787
|
actionStatus: E
|
|
1737
|
-
}, k =
|
|
1788
|
+
}, k = we(o), A = o.map((i, o) => {
|
|
1738
1789
|
let { route: s } = i, f = null;
|
|
1739
1790
|
if (T != null && o > T) f = !1;
|
|
1740
1791
|
else if (s.lazy) f = !0;
|
|
1741
|
-
else if (!
|
|
1792
|
+
else if (!ut(s)) f = !1;
|
|
1742
1793
|
else if (u) {
|
|
1743
|
-
let { shouldLoad: e } =
|
|
1794
|
+
let { shouldLoad: e } = dt(s, a.loaderData, a.errors);
|
|
1744
1795
|
f = e;
|
|
1745
|
-
} else
|
|
1746
|
-
if (f !== null) return
|
|
1796
|
+
} else ft(a.loaderData, a.matches[o], i) && (f = !0);
|
|
1797
|
+
if (f !== null) return Dt(n, r, e, c, k, i, l, t, f);
|
|
1747
1798
|
let p = !1;
|
|
1748
|
-
typeof x == "boolean" ? p = x : D ? p = !1 : d || C.pathname + C.search === w.pathname + w.search ? p = !0 : C.search === w.search ?
|
|
1799
|
+
typeof x == "boolean" ? p = x : D ? p = !1 : d || C.pathname + C.search === w.pathname + w.search ? p = !0 : C.search === w.search ? pt(a.matches[o], i) && (p = !0) : p = !0;
|
|
1749
1800
|
let m = {
|
|
1750
1801
|
...O,
|
|
1751
1802
|
defaultShouldRevalidate: p
|
|
1752
|
-
};
|
|
1753
|
-
return
|
|
1803
|
+
}, h = mt(i, m);
|
|
1804
|
+
return Dt(n, r, e, c, k, i, l, t, h, m, x);
|
|
1754
1805
|
}), j = [];
|
|
1755
1806
|
return m.forEach((e, s) => {
|
|
1756
1807
|
if (u || !o.some((t) => t.route.id === e.routeId) || p.has(s)) return;
|
|
@@ -1769,17 +1820,17 @@ function rt(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
|
1769
1820
|
return;
|
|
1770
1821
|
}
|
|
1771
1822
|
if (h.has(s)) return;
|
|
1772
|
-
let S =
|
|
1773
|
-
if (f.has(s)) f.delete(s), T =
|
|
1774
|
-
else if (m) d && (T =
|
|
1823
|
+
let S = cn(b, e.path), C = new AbortController(), w = Lt(i, e.path, C.signal), T = null;
|
|
1824
|
+
if (f.has(s)) f.delete(s), T = Ot(n, r, w, e.path, b, S, l, t);
|
|
1825
|
+
else if (m) d && (T = Ot(n, r, w, e.path, b, S, l, t));
|
|
1775
1826
|
else {
|
|
1776
1827
|
let i;
|
|
1777
|
-
i = typeof x == "boolean" ? x : D
|
|
1828
|
+
i = typeof x == "boolean" ? x : !D && d;
|
|
1778
1829
|
let a = {
|
|
1779
1830
|
...O,
|
|
1780
1831
|
defaultShouldRevalidate: i
|
|
1781
1832
|
};
|
|
1782
|
-
|
|
1833
|
+
mt(S, a) && (T = Ot(n, r, w, e.path, b, S, l, t, a));
|
|
1783
1834
|
}
|
|
1784
1835
|
T && j.push({
|
|
1785
1836
|
key: s,
|
|
@@ -1795,15 +1846,15 @@ function rt(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
|
1795
1846
|
revalidatingFetchers: j
|
|
1796
1847
|
};
|
|
1797
1848
|
}
|
|
1798
|
-
function
|
|
1849
|
+
function ut(e) {
|
|
1799
1850
|
return e.loader != null || e.middleware != null && e.middleware.length > 0;
|
|
1800
1851
|
}
|
|
1801
|
-
function
|
|
1852
|
+
function dt(e, t, n) {
|
|
1802
1853
|
if (e.lazy) return {
|
|
1803
1854
|
shouldLoad: !0,
|
|
1804
1855
|
renderFallback: !0
|
|
1805
1856
|
};
|
|
1806
|
-
if (!
|
|
1857
|
+
if (!ut(e)) return {
|
|
1807
1858
|
shouldLoad: !1,
|
|
1808
1859
|
renderFallback: !1
|
|
1809
1860
|
};
|
|
@@ -1822,22 +1873,22 @@ function at(e, t, n) {
|
|
|
1822
1873
|
renderFallback: a
|
|
1823
1874
|
};
|
|
1824
1875
|
}
|
|
1825
|
-
function
|
|
1876
|
+
function ft(e, t, n) {
|
|
1826
1877
|
let r = !t || n.route.id !== t.route.id, i = !e.hasOwnProperty(n.route.id);
|
|
1827
1878
|
return r || i;
|
|
1828
1879
|
}
|
|
1829
|
-
function
|
|
1880
|
+
function pt(e, t) {
|
|
1830
1881
|
let n = e.route.path;
|
|
1831
1882
|
return e.pathname !== t.pathname || n != null && n.endsWith("*") && e.params["*"] !== t.params["*"];
|
|
1832
1883
|
}
|
|
1833
|
-
function
|
|
1884
|
+
function mt(e, t) {
|
|
1834
1885
|
if (e.route.shouldRevalidate) {
|
|
1835
1886
|
let n = e.route.shouldRevalidate(t);
|
|
1836
1887
|
if (typeof n == "boolean") return n;
|
|
1837
1888
|
}
|
|
1838
1889
|
return t.defaultShouldRevalidate;
|
|
1839
1890
|
}
|
|
1840
|
-
function
|
|
1891
|
+
function ht(e, t, n, r, i, a) {
|
|
1841
1892
|
let o;
|
|
1842
1893
|
if (e) {
|
|
1843
1894
|
let t = r[e];
|
|
@@ -1845,7 +1896,7 @@ function lt(e, t, n, r, i, a) {
|
|
|
1845
1896
|
} else o = n.activeRoutes;
|
|
1846
1897
|
let s = [], c = [];
|
|
1847
1898
|
if (t.forEach((e) => {
|
|
1848
|
-
let t = o.find((t) =>
|
|
1899
|
+
let t = o.find((t) => gt(e, t));
|
|
1849
1900
|
t ? c.push({
|
|
1850
1901
|
existingRoute: t,
|
|
1851
1902
|
newRoute: e
|
|
@@ -1868,16 +1919,16 @@ function lt(e, t, n, r, i, a) {
|
|
|
1868
1919
|
}
|
|
1869
1920
|
n.hasHMRRoutes || n.setRoutes([...n.activeRoutes]);
|
|
1870
1921
|
}
|
|
1871
|
-
function
|
|
1872
|
-
return "id" in e && "id" in t && e.id === t.id ? !0 : e.index
|
|
1922
|
+
function gt(e, t) {
|
|
1923
|
+
return "id" in e && "id" in t && e.id === t.id ? !0 : e.index !== t.index || e.path !== t.path || e.caseSensitive !== t.caseSensitive ? !1 : (!e.children || e.children.length === 0) && (!t.children || t.children.length === 0) ? !0 : e.children?.every((e, n) => t.children?.some((t) => gt(e, t))) ?? !1;
|
|
1873
1924
|
}
|
|
1874
|
-
var
|
|
1925
|
+
var _t = /* @__PURE__ */ new WeakMap(), vt = ({ key: e, route: t, manifest: n, mapRouteProperties: r }) => {
|
|
1875
1926
|
let i = n[t.id];
|
|
1876
1927
|
if (f(i, "No route found in manifest"), !i.lazy || typeof i.lazy != "object") return;
|
|
1877
1928
|
let a = i.lazy[e];
|
|
1878
1929
|
if (!a) return;
|
|
1879
|
-
let o =
|
|
1880
|
-
o || (o = {},
|
|
1930
|
+
let o = _t.get(i);
|
|
1931
|
+
o || (o = {}, _t.set(i, o));
|
|
1881
1932
|
let s = o[e];
|
|
1882
1933
|
if (s) return s;
|
|
1883
1934
|
let c = (async () => {
|
|
@@ -1891,15 +1942,15 @@ var dt = /* @__PURE__ */ new WeakMap(), ft = ({ key: e, route: t, manifest: n, m
|
|
|
1891
1942
|
typeof i.lazy == "object" && (i.lazy[e] = void 0, Object.values(i.lazy).every((e) => e === void 0) && (i.lazy = void 0));
|
|
1892
1943
|
})();
|
|
1893
1944
|
return o[e] = c, c;
|
|
1894
|
-
},
|
|
1895
|
-
function
|
|
1945
|
+
}, yt = /* @__PURE__ */ new WeakMap();
|
|
1946
|
+
function bt(e, t, n, r, i) {
|
|
1896
1947
|
let a = n[e.id];
|
|
1897
1948
|
if (f(a, "No route found in manifest"), !e.lazy) return {
|
|
1898
1949
|
lazyRoutePromise: void 0,
|
|
1899
1950
|
lazyHandlerPromise: void 0
|
|
1900
1951
|
};
|
|
1901
1952
|
if (typeof e.lazy == "function") {
|
|
1902
|
-
let t =
|
|
1953
|
+
let t = yt.get(a);
|
|
1903
1954
|
if (t) return {
|
|
1904
1955
|
lazyRoutePromise: t,
|
|
1905
1956
|
lazyHandlerPromise: t
|
|
@@ -1918,7 +1969,7 @@ function mt(e, t, n, r, i) {
|
|
|
1918
1969
|
lazy: void 0
|
|
1919
1970
|
});
|
|
1920
1971
|
})();
|
|
1921
|
-
return
|
|
1972
|
+
return yt.set(a, n), n.catch(() => {}), {
|
|
1922
1973
|
lazyRoutePromise: n,
|
|
1923
1974
|
lazyHandlerPromise: n
|
|
1924
1975
|
};
|
|
@@ -1926,7 +1977,7 @@ function mt(e, t, n, r, i) {
|
|
|
1926
1977
|
let o = Object.keys(e.lazy), s = [], c;
|
|
1927
1978
|
for (let a of o) {
|
|
1928
1979
|
if (i && i.includes(a)) continue;
|
|
1929
|
-
let o =
|
|
1980
|
+
let o = vt({
|
|
1930
1981
|
key: a,
|
|
1931
1982
|
route: e,
|
|
1932
1983
|
manifest: n,
|
|
@@ -1940,27 +1991,27 @@ function mt(e, t, n, r, i) {
|
|
|
1940
1991
|
lazyHandlerPromise: c
|
|
1941
1992
|
};
|
|
1942
1993
|
}
|
|
1943
|
-
async function
|
|
1994
|
+
async function xt(e) {
|
|
1944
1995
|
let t = e.matches.filter((e) => e.shouldLoad), n = {};
|
|
1945
1996
|
return (await Promise.all(t.map((e) => e.resolve()))).forEach((e, r) => {
|
|
1946
1997
|
n[t[r].route.id] = e;
|
|
1947
1998
|
}), n;
|
|
1948
1999
|
}
|
|
1949
|
-
async function
|
|
1950
|
-
return e.matches.some((e) => e.route.middleware) ?
|
|
2000
|
+
async function St(e) {
|
|
2001
|
+
return e.matches.some((e) => e.route.middleware) ? Ct(e, () => xt(e)) : xt(e);
|
|
1951
2002
|
}
|
|
1952
|
-
function
|
|
1953
|
-
return
|
|
1954
|
-
if (
|
|
2003
|
+
function Ct(e, t) {
|
|
2004
|
+
return wt(e, t, (e) => {
|
|
2005
|
+
if (an(e)) throw e;
|
|
1955
2006
|
return e;
|
|
1956
|
-
},
|
|
2007
|
+
}, Zt, n);
|
|
1957
2008
|
function n(t, n, r) {
|
|
1958
2009
|
if (r) return Promise.resolve(Object.assign(r.value, { [n]: {
|
|
1959
2010
|
type: "error",
|
|
1960
2011
|
result: t
|
|
1961
2012
|
} }));
|
|
1962
2013
|
{
|
|
1963
|
-
let { matches: r } = e, i =
|
|
2014
|
+
let { matches: r } = e, i = Gt(r, r[Math.min(Math.max(r.findIndex((e) => e.route.id === n), 0), Math.max(r.findIndex((e) => e.shouldCallHandler()), 0))].route.id).route.id;
|
|
1964
2015
|
return Promise.resolve({ [i]: {
|
|
1965
2016
|
type: "error",
|
|
1966
2017
|
result: t
|
|
@@ -1968,11 +2019,11 @@ function _t(e, t) {
|
|
|
1968
2019
|
}
|
|
1969
2020
|
}
|
|
1970
2021
|
}
|
|
1971
|
-
async function
|
|
2022
|
+
async function wt(e, t, n, r, i) {
|
|
1972
2023
|
let { matches: a, ...o } = e;
|
|
1973
|
-
return await
|
|
2024
|
+
return await Tt(o, a.flatMap((e) => e.route.middleware ? e.route.middleware.map((t) => [e.route.id, t]) : []), t, n, r, i);
|
|
1974
2025
|
}
|
|
1975
|
-
async function
|
|
2026
|
+
async function Tt(e, t, n, r, i, a, o = 0) {
|
|
1976
2027
|
let { request: s } = e;
|
|
1977
2028
|
if (s.signal.aborted) throw s.signal.reason ?? /* @__PURE__ */ Error(`Request aborted: ${s.method} ${s.url}`);
|
|
1978
2029
|
let c = t[o];
|
|
@@ -1980,7 +2031,7 @@ async function yt(e, t, n, r, i, a, o = 0) {
|
|
|
1980
2031
|
let [l, u] = c, d, f = async () => {
|
|
1981
2032
|
if (d) throw Error("You may only call `next()` once per middleware");
|
|
1982
2033
|
try {
|
|
1983
|
-
return d = { value: await
|
|
2034
|
+
return d = { value: await Tt(e, t, n, r, i, a, o + 1) }, d.value;
|
|
1984
2035
|
} catch (e) {
|
|
1985
2036
|
return d = { value: await a(e, l, d) }, d.value;
|
|
1986
2037
|
}
|
|
@@ -1992,38 +2043,38 @@ async function yt(e, t, n, r, i, a, o = 0) {
|
|
|
1992
2043
|
return await a(e, l, d);
|
|
1993
2044
|
}
|
|
1994
2045
|
}
|
|
1995
|
-
function
|
|
1996
|
-
let a =
|
|
2046
|
+
function Et(e, t, n, r, i) {
|
|
2047
|
+
let a = vt({
|
|
1997
2048
|
key: "middleware",
|
|
1998
2049
|
route: r.route,
|
|
1999
2050
|
manifest: t,
|
|
2000
2051
|
mapRouteProperties: e
|
|
2001
|
-
}), o =
|
|
2052
|
+
}), o = bt(r.route, Y(n.method) ? "action" : "loader", t, e, i);
|
|
2002
2053
|
return {
|
|
2003
2054
|
middleware: a,
|
|
2004
2055
|
route: o.lazyRoutePromise,
|
|
2005
2056
|
handler: o.lazyHandlerPromise
|
|
2006
2057
|
};
|
|
2007
2058
|
}
|
|
2008
|
-
function
|
|
2009
|
-
let d = !1, f =
|
|
2059
|
+
function Dt(e, t, n, r, i, a, o, s, c, l = null, u) {
|
|
2060
|
+
let d = !1, f = Et(e, t, n, a, o);
|
|
2010
2061
|
return {
|
|
2011
2062
|
...a,
|
|
2012
2063
|
_lazyPromises: f,
|
|
2013
2064
|
shouldLoad: c,
|
|
2014
2065
|
shouldRevalidateArgs: l,
|
|
2015
2066
|
shouldCallHandler(e) {
|
|
2016
|
-
return d = !0, l ? typeof u == "boolean" ?
|
|
2067
|
+
return d = !0, l ? typeof u == "boolean" ? mt(a, {
|
|
2017
2068
|
...l,
|
|
2018
2069
|
defaultShouldRevalidate: u
|
|
2019
|
-
}) : typeof e == "boolean" ?
|
|
2070
|
+
}) : typeof e == "boolean" ? mt(a, {
|
|
2020
2071
|
...l,
|
|
2021
2072
|
defaultShouldRevalidate: e
|
|
2022
|
-
}) :
|
|
2073
|
+
}) : mt(a, l) : c;
|
|
2023
2074
|
},
|
|
2024
2075
|
resolve(e) {
|
|
2025
|
-
let { lazy: t, loader: o, middleware: l } = a.route, u = d || c || e && !
|
|
2026
|
-
return u && (
|
|
2076
|
+
let { lazy: t, loader: o, middleware: l } = a.route, u = d || c || e && !Y(n.method) && (t || o), p = l && l.length > 0 && !o && !t;
|
|
2077
|
+
return u && (Y(n.method) || !p) ? At({
|
|
2027
2078
|
request: n,
|
|
2028
2079
|
path: r,
|
|
2029
2080
|
pattern: i,
|
|
@@ -2039,25 +2090,25 @@ function xt(e, t, n, r, i, a, o, s, c, l = null, u) {
|
|
|
2039
2090
|
}
|
|
2040
2091
|
};
|
|
2041
2092
|
}
|
|
2042
|
-
function
|
|
2043
|
-
return i.map((l) => l.route.id === a.route.id ?
|
|
2093
|
+
function Ot(e, t, n, r, i, a, o, s, c = null) {
|
|
2094
|
+
return i.map((l) => l.route.id === a.route.id ? Dt(e, t, n, r, we(i), l, o, s, !0, c) : {
|
|
2044
2095
|
...l,
|
|
2045
2096
|
shouldLoad: !1,
|
|
2046
2097
|
shouldRevalidateArgs: c,
|
|
2047
2098
|
shouldCallHandler: () => !1,
|
|
2048
|
-
_lazyPromises:
|
|
2099
|
+
_lazyPromises: Et(e, t, n, l, o),
|
|
2049
2100
|
resolve: () => Promise.resolve({
|
|
2050
2101
|
type: "data",
|
|
2051
2102
|
result: void 0
|
|
2052
2103
|
})
|
|
2053
2104
|
});
|
|
2054
2105
|
}
|
|
2055
|
-
async function
|
|
2106
|
+
async function kt(e, t, n, r, i, a, o) {
|
|
2056
2107
|
r.some((e) => e._lazyPromises?.middleware) && await Promise.all(r.map((e) => e._lazyPromises?.middleware));
|
|
2057
2108
|
let s = {
|
|
2058
2109
|
request: t,
|
|
2059
|
-
url:
|
|
2060
|
-
pattern:
|
|
2110
|
+
url: Rt(t, n),
|
|
2111
|
+
pattern: we(r),
|
|
2061
2112
|
params: r[0].params,
|
|
2062
2113
|
context: a,
|
|
2063
2114
|
matches: r
|
|
@@ -2065,7 +2116,7 @@ async function Ct(e, t, n, r, i, a, o) {
|
|
|
2065
2116
|
throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`");
|
|
2066
2117
|
} : (e) => {
|
|
2067
2118
|
let t = s;
|
|
2068
|
-
return
|
|
2119
|
+
return Ct(t, () => e({
|
|
2069
2120
|
...t,
|
|
2070
2121
|
fetcherKey: i,
|
|
2071
2122
|
runClientMiddleware: () => {
|
|
@@ -2082,13 +2133,13 @@ async function Ct(e, t, n, r, i, a, o) {
|
|
|
2082
2133
|
} catch {}
|
|
2083
2134
|
return l;
|
|
2084
2135
|
}
|
|
2085
|
-
async function
|
|
2086
|
-
let c, l, u =
|
|
2136
|
+
async function At({ request: e, path: t, pattern: n, match: r, lazyHandlerPromise: i, lazyRoutePromise: a, handlerOverride: o, scopedContext: s }) {
|
|
2137
|
+
let c, l, u = Y(e.method), d = u ? "action" : "loader", f = (i) => {
|
|
2087
2138
|
let a, c = new Promise((e, t) => a = t);
|
|
2088
2139
|
l = () => a(), e.signal.addEventListener("abort", l);
|
|
2089
2140
|
let u = (a) => typeof i == "function" ? i({
|
|
2090
2141
|
request: e,
|
|
2091
|
-
url:
|
|
2142
|
+
url: Rt(e, t),
|
|
2092
2143
|
pattern: n,
|
|
2093
2144
|
params: r.params,
|
|
2094
2145
|
context: s
|
|
@@ -2109,36 +2160,37 @@ async function wt({ request: e, path: t, pattern: n, match: r, lazyHandlerPromis
|
|
|
2109
2160
|
};
|
|
2110
2161
|
try {
|
|
2111
2162
|
let t = u ? r.route.action : r.route.loader;
|
|
2112
|
-
if (i || a)
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2163
|
+
if (i || a) {
|
|
2164
|
+
if (t) {
|
|
2165
|
+
let e, [n] = await Promise.all([
|
|
2166
|
+
f(t).catch((t) => {
|
|
2167
|
+
e = t;
|
|
2168
|
+
}),
|
|
2169
|
+
i,
|
|
2170
|
+
a
|
|
2171
|
+
]);
|
|
2172
|
+
if (e !== void 0) throw e;
|
|
2173
|
+
c = n;
|
|
2174
|
+
} else {
|
|
2175
|
+
await i;
|
|
2176
|
+
let t = u ? r.route.action : r.route.loader;
|
|
2177
|
+
if (t) [c] = await Promise.all([f(t), a]);
|
|
2178
|
+
else if (d === "action") {
|
|
2179
|
+
let t = new URL(e.url), n = t.pathname + t.search;
|
|
2180
|
+
throw q(405, {
|
|
2181
|
+
method: e.method,
|
|
2182
|
+
pathname: n,
|
|
2183
|
+
routeId: r.route.id
|
|
2184
|
+
});
|
|
2185
|
+
} else return {
|
|
2186
|
+
type: "data",
|
|
2187
|
+
result: void 0
|
|
2188
|
+
};
|
|
2189
|
+
}
|
|
2190
|
+
} else if (t) c = await f(t);
|
|
2139
2191
|
else {
|
|
2140
2192
|
let t = new URL(e.url);
|
|
2141
|
-
throw
|
|
2193
|
+
throw q(404, { pathname: t.pathname + t.search });
|
|
2142
2194
|
}
|
|
2143
2195
|
} catch (e) {
|
|
2144
2196
|
return {
|
|
@@ -2150,16 +2202,16 @@ async function wt({ request: e, path: t, pattern: n, match: r, lazyHandlerPromis
|
|
|
2150
2202
|
}
|
|
2151
2203
|
return c;
|
|
2152
2204
|
}
|
|
2153
|
-
async function
|
|
2205
|
+
async function jt(e) {
|
|
2154
2206
|
let t = e.headers.get("Content-Type");
|
|
2155
2207
|
return t && /\bapplication\/json\b/.test(t) ? e.body == null ? null : e.json() : e.text();
|
|
2156
2208
|
}
|
|
2157
|
-
async function
|
|
2209
|
+
async function Mt(e) {
|
|
2158
2210
|
let { result: t, type: n } = e;
|
|
2159
|
-
if (
|
|
2211
|
+
if (nn(t)) {
|
|
2160
2212
|
let e;
|
|
2161
2213
|
try {
|
|
2162
|
-
e = await
|
|
2214
|
+
e = await jt(t);
|
|
2163
2215
|
} catch (e) {
|
|
2164
2216
|
return {
|
|
2165
2217
|
type: "error",
|
|
@@ -2168,7 +2220,7 @@ async function Et(e) {
|
|
|
2168
2220
|
}
|
|
2169
2221
|
return n === "error" ? {
|
|
2170
2222
|
type: "error",
|
|
2171
|
-
error: new
|
|
2223
|
+
error: new Se(t.status, t.statusText, e),
|
|
2172
2224
|
statusCode: t.status,
|
|
2173
2225
|
headers: t.headers
|
|
2174
2226
|
} : {
|
|
@@ -2178,21 +2230,21 @@ async function Et(e) {
|
|
|
2178
2230
|
headers: t.headers
|
|
2179
2231
|
};
|
|
2180
2232
|
}
|
|
2181
|
-
return n === "error" ?
|
|
2233
|
+
return n === "error" ? tn(t) ? t.data instanceof Error ? {
|
|
2182
2234
|
type: "error",
|
|
2183
2235
|
error: t.data,
|
|
2184
2236
|
statusCode: t.init?.status,
|
|
2185
2237
|
headers: t.init?.headers ? new Headers(t.init.headers) : void 0
|
|
2186
2238
|
} : {
|
|
2187
2239
|
type: "error",
|
|
2188
|
-
error:
|
|
2189
|
-
statusCode:
|
|
2240
|
+
error: Xt(t),
|
|
2241
|
+
statusCode: Ce(t) ? t.status : void 0,
|
|
2190
2242
|
headers: t.init?.headers ? new Headers(t.init.headers) : void 0
|
|
2191
2243
|
} : {
|
|
2192
2244
|
type: "error",
|
|
2193
2245
|
error: t,
|
|
2194
|
-
statusCode:
|
|
2195
|
-
} :
|
|
2246
|
+
statusCode: Ce(t) ? t.status : void 0
|
|
2247
|
+
} : tn(t) ? {
|
|
2196
2248
|
type: "data",
|
|
2197
2249
|
data: t.data,
|
|
2198
2250
|
statusCode: t.init?.status,
|
|
@@ -2202,15 +2254,15 @@ async function Et(e) {
|
|
|
2202
2254
|
data: t
|
|
2203
2255
|
};
|
|
2204
2256
|
}
|
|
2205
|
-
function
|
|
2257
|
+
function Nt(e, t, n, r, i) {
|
|
2206
2258
|
let a = e.headers.get("Location");
|
|
2207
|
-
if (f(a, "Redirects returned/thrown from loaders/actions must have a Location header"), !
|
|
2259
|
+
if (f(a, "Redirects returned/thrown from loaders/actions must have a Location header"), !de(a)) {
|
|
2208
2260
|
let o = r.slice(0, r.findIndex((e) => e.route.id === n) + 1);
|
|
2209
|
-
a =
|
|
2261
|
+
a = st(new URL(t.url), o, i, a), e.headers.set("Location", a);
|
|
2210
2262
|
}
|
|
2211
2263
|
return e;
|
|
2212
2264
|
}
|
|
2213
|
-
var
|
|
2265
|
+
var Pt = [
|
|
2214
2266
|
"about:",
|
|
2215
2267
|
"blob:",
|
|
2216
2268
|
"chrome:",
|
|
@@ -2222,34 +2274,34 @@ var Ot = [
|
|
|
2222
2274
|
"filesystem:",
|
|
2223
2275
|
"javascript:"
|
|
2224
2276
|
];
|
|
2225
|
-
function
|
|
2277
|
+
function Ft(e) {
|
|
2226
2278
|
try {
|
|
2227
|
-
return
|
|
2279
|
+
return Pt.includes(new URL(e).protocol);
|
|
2228
2280
|
} catch {
|
|
2229
2281
|
return !1;
|
|
2230
2282
|
}
|
|
2231
2283
|
}
|
|
2232
|
-
function
|
|
2233
|
-
if (
|
|
2284
|
+
function It(e, t, n, r) {
|
|
2285
|
+
if (de(e)) {
|
|
2234
2286
|
let r = e, i = s.test(r) ? new URL(c(r, t.protocol)) : new URL(r);
|
|
2235
|
-
if (
|
|
2236
|
-
let a =
|
|
2237
|
-
if (i.origin === t.origin && a) return
|
|
2287
|
+
if (Ft(i.toString())) throw Error("Invalid redirect location");
|
|
2288
|
+
let a = H(i.pathname, n) != null;
|
|
2289
|
+
if (i.origin === t.origin && a) return _e(i.pathname) + i.search + i.hash;
|
|
2238
2290
|
}
|
|
2239
2291
|
try {
|
|
2240
|
-
if (
|
|
2292
|
+
if (Ft(r.createURL(e).toString())) throw Error("Invalid redirect location");
|
|
2241
2293
|
} catch {}
|
|
2242
2294
|
return e;
|
|
2243
2295
|
}
|
|
2244
|
-
function
|
|
2245
|
-
let i = e.createURL(
|
|
2246
|
-
if (r &&
|
|
2296
|
+
function Lt(e, t, n, r) {
|
|
2297
|
+
let i = e.createURL(Jt(t)).toString(), a = { signal: n };
|
|
2298
|
+
if (r && Y(r.formMethod)) {
|
|
2247
2299
|
let { formMethod: e, formEncType: t } = r;
|
|
2248
|
-
a.method = e.toUpperCase(), t === "application/json" ? (a.headers = new Headers({ "Content-Type": t }), a.body = JSON.stringify(r.json)) : t === "text/plain" ?
|
|
2300
|
+
a.method = e.toUpperCase(), t === "application/json" ? (a.headers = new Headers({ "Content-Type": t }), a.body = JSON.stringify(r.json)) : a.body = t === "text/plain" ? r.text : t === "application/x-www-form-urlencoded" && r.formData ? zt(r.formData) : r.formData;
|
|
2249
2301
|
}
|
|
2250
2302
|
return new Request(i, a);
|
|
2251
2303
|
}
|
|
2252
|
-
function
|
|
2304
|
+
function Rt(e, t) {
|
|
2253
2305
|
let n = new URL(e.url), r = typeof t == "string" ? v(t) : t;
|
|
2254
2306
|
if (n.pathname = r.pathname || "/", r.search) {
|
|
2255
2307
|
let e = new URLSearchParams(r.search), t = e.getAll("index");
|
|
@@ -2259,29 +2311,29 @@ function Mt(e, t) {
|
|
|
2259
2311
|
} else n.search = "";
|
|
2260
2312
|
return n.hash = r.hash || "", n;
|
|
2261
2313
|
}
|
|
2262
|
-
function
|
|
2314
|
+
function zt(e) {
|
|
2263
2315
|
let t = new URLSearchParams();
|
|
2264
2316
|
for (let [n, r] of e.entries()) t.append(n, typeof r == "string" ? r : r.name);
|
|
2265
2317
|
return t;
|
|
2266
2318
|
}
|
|
2267
|
-
function
|
|
2319
|
+
function Bt(e) {
|
|
2268
2320
|
let t = new FormData();
|
|
2269
2321
|
for (let [n, r] of e.entries()) t.append(n, r);
|
|
2270
2322
|
return t;
|
|
2271
2323
|
}
|
|
2272
|
-
function
|
|
2273
|
-
let a = {}, o = null, s, c = !1, l = {}, u = n &&
|
|
2324
|
+
function Vt(e, t, n, r = !1, i = !1) {
|
|
2325
|
+
let a = {}, o = null, s, c = !1, l = {}, u = n && J(n[1]) ? n[1].error : void 0;
|
|
2274
2326
|
return e.forEach((n) => {
|
|
2275
2327
|
if (!(n.route.id in t)) return;
|
|
2276
2328
|
let d = n.route.id, p = t[d];
|
|
2277
|
-
if (f(!
|
|
2329
|
+
if (f(!en(p), "Cannot handle redirect results in processLoaderData"), J(p)) {
|
|
2278
2330
|
let t = p.error;
|
|
2279
2331
|
if (u !== void 0 && (t = u, u = void 0), o ||= {}, i) o[d] = t;
|
|
2280
2332
|
else {
|
|
2281
|
-
let n =
|
|
2333
|
+
let n = Gt(e, d);
|
|
2282
2334
|
o[n.route.id] ?? (o[n.route.id] = t);
|
|
2283
2335
|
}
|
|
2284
|
-
r || (a[d] =
|
|
2336
|
+
r || (a[d] = $e), c || (c = !0, s = Ce(p.error) ? p.error.status : 500), p.headers && (l[d] = p.headers);
|
|
2285
2337
|
} else a[d] = p.data, p.statusCode && p.statusCode !== 200 && !c && (s = p.statusCode), p.headers && (l[d] = p.headers);
|
|
2286
2338
|
}), u !== void 0 && n && (o = { [n[0]]: u }, n[2] && (a[n[2]] = void 0)), {
|
|
2287
2339
|
loaderData: a,
|
|
@@ -2290,21 +2342,21 @@ function Ft(e, t, n, r = !1, i = !1) {
|
|
|
2290
2342
|
loaderHeaders: l
|
|
2291
2343
|
};
|
|
2292
2344
|
}
|
|
2293
|
-
function
|
|
2294
|
-
let { loaderData: s, errors: c } =
|
|
2345
|
+
function Ht(e, t, n, r, i, a, o) {
|
|
2346
|
+
let { loaderData: s, errors: c } = Vt(t, n, r);
|
|
2295
2347
|
return i.filter((e) => !e.matches || e.matches.some((e) => e.shouldLoad)).forEach((t) => {
|
|
2296
2348
|
let { key: n, match: r, controller: i } = t;
|
|
2297
2349
|
if (i && i.signal.aborted) return;
|
|
2298
2350
|
let s = a[n];
|
|
2299
|
-
if (f(s, "Did not find corresponding fetcher result"),
|
|
2300
|
-
let t =
|
|
2351
|
+
if (f(s, "Did not find corresponding fetcher result"), J(s)) {
|
|
2352
|
+
let t = Gt(e.matches, r?.route.id);
|
|
2301
2353
|
c && c[t.route.id] || (c = {
|
|
2302
2354
|
...c,
|
|
2303
2355
|
[t.route.id]: s.error
|
|
2304
2356
|
}), o.delete(n);
|
|
2305
|
-
} else if (
|
|
2357
|
+
} else if (en(s)) f(!1, "Unhandled fetcher revalidation redirect");
|
|
2306
2358
|
else {
|
|
2307
|
-
let e =
|
|
2359
|
+
let e = X(s.data);
|
|
2308
2360
|
o.set(n, e);
|
|
2309
2361
|
}
|
|
2310
2362
|
}), {
|
|
@@ -2312,21 +2364,21 @@ function It(e, t, n, r, i, a, o) {
|
|
|
2312
2364
|
errors: c
|
|
2313
2365
|
};
|
|
2314
2366
|
}
|
|
2315
|
-
function
|
|
2316
|
-
let i = Object.entries(t).filter(([, e]) => e !==
|
|
2367
|
+
function Ut(e, t, n, r) {
|
|
2368
|
+
let i = Object.entries(t).filter(([, e]) => e !== $e).reduce((e, [t, n]) => (e[t] = n, e), {});
|
|
2317
2369
|
for (let a of n) {
|
|
2318
2370
|
let n = a.route.id;
|
|
2319
2371
|
if (!t.hasOwnProperty(n) && e.hasOwnProperty(n) && a.route.loader && (i[n] = e[n]), r && r.hasOwnProperty(n)) break;
|
|
2320
2372
|
}
|
|
2321
2373
|
return i;
|
|
2322
2374
|
}
|
|
2323
|
-
function
|
|
2324
|
-
return e ?
|
|
2375
|
+
function Wt(e) {
|
|
2376
|
+
return e ? J(e[1]) ? { actionData: {} } : { actionData: { [e[0]]: e[1].data } } : {};
|
|
2325
2377
|
}
|
|
2326
|
-
function
|
|
2378
|
+
function Gt(e, t) {
|
|
2327
2379
|
return (t ? e.slice(0, e.findIndex((e) => e.route.id === t) + 1) : [...e]).reverse().find((e) => e.route.hasErrorBoundary === !0) || e[0];
|
|
2328
2380
|
}
|
|
2329
|
-
function
|
|
2381
|
+
function Kt(e) {
|
|
2330
2382
|
let t = e.length === 1 ? e[0] : e.find((e) => e.index || !e.path || e.path === "/") || { id: "__shim-error-route__" };
|
|
2331
2383
|
return {
|
|
2332
2384
|
matches: [{
|
|
@@ -2338,75 +2390,75 @@ function Bt(e) {
|
|
|
2338
2390
|
route: t
|
|
2339
2391
|
};
|
|
2340
2392
|
}
|
|
2341
|
-
function
|
|
2393
|
+
function q(e, { pathname: t, routeId: n, method: r, type: i, message: a } = {}) {
|
|
2342
2394
|
let o = "Unknown Server Error", s = "Unknown @remix-run/router error";
|
|
2343
|
-
return e === 400 ? (o = "Bad Request", r && t && n ? s = `You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.` : i === "invalid-body" && (s = "Unable to encode submission body")) : e === 403 ? (o = "Forbidden", s = `Route "${n}" does not match URL "${t}"`) : e === 404 ? (o = "Not Found", s = `No route matches URL "${t}"`) : e === 405 && (o = "Method Not Allowed", r && t && n ? s = `You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.` : r && (s = `Invalid request method "${r.toUpperCase()}"`)), new
|
|
2395
|
+
return e === 400 ? (o = "Bad Request", r && t && n ? s = `You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.` : i === "invalid-body" && (s = "Unable to encode submission body")) : e === 403 ? (o = "Forbidden", s = `Route "${n}" does not match URL "${t}"`) : e === 404 ? (o = "Not Found", s = `No route matches URL "${t}"`) : e === 405 && (o = "Method Not Allowed", r && t && n ? s = `You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.` : r && (s = `Invalid request method "${r.toUpperCase()}"`)), new Se(e || 500, o, Error(s), !0);
|
|
2344
2396
|
}
|
|
2345
|
-
function
|
|
2397
|
+
function qt(e) {
|
|
2346
2398
|
let t = Object.entries(e);
|
|
2347
2399
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
2348
2400
|
let [n, r] = t[e];
|
|
2349
|
-
if (
|
|
2401
|
+
if (en(r)) return {
|
|
2350
2402
|
key: n,
|
|
2351
2403
|
result: r
|
|
2352
2404
|
};
|
|
2353
2405
|
}
|
|
2354
2406
|
}
|
|
2355
|
-
function
|
|
2407
|
+
function Jt(e) {
|
|
2356
2408
|
return _({
|
|
2357
2409
|
...typeof e == "string" ? v(e) : e,
|
|
2358
2410
|
hash: ""
|
|
2359
2411
|
});
|
|
2360
2412
|
}
|
|
2361
|
-
function
|
|
2362
|
-
return e.pathname !== t.pathname || e.search !== t.search ? !1 : e.hash === "" ? t.hash !== "" : e.hash === t.hash
|
|
2413
|
+
function Yt(e, t) {
|
|
2414
|
+
return e.pathname !== t.pathname || e.search !== t.search ? !1 : e.hash === "" ? t.hash !== "" : e.hash === t.hash || t.hash !== "";
|
|
2363
2415
|
}
|
|
2364
|
-
function
|
|
2365
|
-
return new
|
|
2416
|
+
function Xt(e) {
|
|
2417
|
+
return new Se(e.init?.status ?? 500, e.init?.statusText ?? "Internal Server Error", e.data);
|
|
2366
2418
|
}
|
|
2367
|
-
function
|
|
2368
|
-
return typeof e == "object" && !!e && Object.entries(e).every(([e, t]) => typeof e == "string" &&
|
|
2419
|
+
function Zt(e) {
|
|
2420
|
+
return typeof e == "object" && !!e && Object.entries(e).every(([e, t]) => typeof e == "string" && Qt(t));
|
|
2369
2421
|
}
|
|
2370
|
-
function
|
|
2422
|
+
function Qt(e) {
|
|
2371
2423
|
return typeof e == "object" && !!e && "type" in e && "result" in e && (e.type === "data" || e.type === "error");
|
|
2372
2424
|
}
|
|
2373
|
-
function
|
|
2374
|
-
return
|
|
2425
|
+
function $t(e) {
|
|
2426
|
+
return nn(e.result) && Ke.has(e.result.status);
|
|
2375
2427
|
}
|
|
2376
|
-
function
|
|
2428
|
+
function J(e) {
|
|
2377
2429
|
return e.type === "error";
|
|
2378
2430
|
}
|
|
2379
|
-
function
|
|
2431
|
+
function en(e) {
|
|
2380
2432
|
return (e && e.type) === "redirect";
|
|
2381
2433
|
}
|
|
2382
|
-
function
|
|
2434
|
+
function tn(e) {
|
|
2383
2435
|
return typeof e == "object" && !!e && "type" in e && "data" in e && "init" in e && e.type === "DataWithResponseInit";
|
|
2384
2436
|
}
|
|
2385
|
-
function
|
|
2437
|
+
function nn(e) {
|
|
2386
2438
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.headers == "object" && e.body !== void 0;
|
|
2387
2439
|
}
|
|
2388
|
-
function
|
|
2389
|
-
return
|
|
2440
|
+
function rn(e) {
|
|
2441
|
+
return Ke.has(e);
|
|
2390
2442
|
}
|
|
2391
|
-
function
|
|
2392
|
-
return
|
|
2443
|
+
function an(e) {
|
|
2444
|
+
return nn(e) && rn(e.status) && e.headers.has("Location");
|
|
2393
2445
|
}
|
|
2394
|
-
function
|
|
2395
|
-
return
|
|
2446
|
+
function on(e) {
|
|
2447
|
+
return Ge.has(e.toUpperCase());
|
|
2396
2448
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return
|
|
2449
|
+
function Y(e) {
|
|
2450
|
+
return Ue.has(e.toUpperCase());
|
|
2399
2451
|
}
|
|
2400
|
-
function
|
|
2452
|
+
function sn(e) {
|
|
2401
2453
|
return new URLSearchParams(e).getAll("index").some((e) => e === "");
|
|
2402
2454
|
}
|
|
2403
|
-
function
|
|
2455
|
+
function cn(e, t) {
|
|
2404
2456
|
let n = typeof t == "string" ? v(t).search : t.search;
|
|
2405
|
-
if (e[e.length - 1].route.index &&
|
|
2406
|
-
let r =
|
|
2457
|
+
if (e[e.length - 1].route.index && sn(n || "")) return e[e.length - 1];
|
|
2458
|
+
let r = me(e);
|
|
2407
2459
|
return r[r.length - 1];
|
|
2408
2460
|
}
|
|
2409
|
-
function
|
|
2461
|
+
function ln(e) {
|
|
2410
2462
|
let { formMethod: t, formAction: n, formEncType: r, text: i, formData: a, json: o } = e;
|
|
2411
2463
|
if (!(!t || !n || !r)) {
|
|
2412
2464
|
if (i != null) return {
|
|
@@ -2435,7 +2487,7 @@ function nn(e) {
|
|
|
2435
2487
|
};
|
|
2436
2488
|
}
|
|
2437
2489
|
}
|
|
2438
|
-
function
|
|
2490
|
+
function un(e, t, n, r) {
|
|
2439
2491
|
return r ? {
|
|
2440
2492
|
state: "loading",
|
|
2441
2493
|
location: e,
|
|
@@ -2460,7 +2512,7 @@ function rn(e, t, n, r) {
|
|
|
2460
2512
|
text: void 0
|
|
2461
2513
|
};
|
|
2462
2514
|
}
|
|
2463
|
-
function
|
|
2515
|
+
function dn(e, t, n, r) {
|
|
2464
2516
|
return {
|
|
2465
2517
|
state: "submitting",
|
|
2466
2518
|
location: e,
|
|
@@ -2474,7 +2526,7 @@ function an(e, t, n, r) {
|
|
|
2474
2526
|
text: r.text
|
|
2475
2527
|
};
|
|
2476
2528
|
}
|
|
2477
|
-
function
|
|
2529
|
+
function fn(e, t) {
|
|
2478
2530
|
return e ? {
|
|
2479
2531
|
state: "loading",
|
|
2480
2532
|
formMethod: e.formMethod,
|
|
@@ -2495,7 +2547,7 @@ function on(e, t) {
|
|
|
2495
2547
|
data: t
|
|
2496
2548
|
};
|
|
2497
2549
|
}
|
|
2498
|
-
function
|
|
2550
|
+
function pn(e, t) {
|
|
2499
2551
|
return {
|
|
2500
2552
|
state: "submitting",
|
|
2501
2553
|
formMethod: e.formMethod,
|
|
@@ -2507,7 +2559,7 @@ function sn(e, t) {
|
|
|
2507
2559
|
data: t ? t.data : void 0
|
|
2508
2560
|
};
|
|
2509
2561
|
}
|
|
2510
|
-
function
|
|
2562
|
+
function X(e) {
|
|
2511
2563
|
return {
|
|
2512
2564
|
state: "idle",
|
|
2513
2565
|
formMethod: void 0,
|
|
@@ -2519,27 +2571,27 @@ function cn(e) {
|
|
|
2519
2571
|
data: e
|
|
2520
2572
|
};
|
|
2521
2573
|
}
|
|
2522
|
-
function
|
|
2574
|
+
function mn(e, t) {
|
|
2523
2575
|
try {
|
|
2524
|
-
let n = e.sessionStorage.getItem(
|
|
2576
|
+
let n = e.sessionStorage.getItem(Qe);
|
|
2525
2577
|
if (n) {
|
|
2526
2578
|
let e = JSON.parse(n);
|
|
2527
2579
|
for (let [n, r] of Object.entries(e || {})) r && Array.isArray(r) && t.set(n, new Set(r || []));
|
|
2528
2580
|
}
|
|
2529
2581
|
} catch {}
|
|
2530
2582
|
}
|
|
2531
|
-
function
|
|
2583
|
+
function hn(e, t) {
|
|
2532
2584
|
if (t.size > 0) {
|
|
2533
2585
|
let n = {};
|
|
2534
2586
|
for (let [e, r] of t) n[e] = [...r];
|
|
2535
2587
|
try {
|
|
2536
|
-
e.sessionStorage.setItem(
|
|
2588
|
+
e.sessionStorage.setItem(Qe, JSON.stringify(n));
|
|
2537
2589
|
} catch (e) {
|
|
2538
2590
|
p(!1, `Failed to save applied view transitions in sessionStorage (${e}).`);
|
|
2539
2591
|
}
|
|
2540
2592
|
}
|
|
2541
2593
|
}
|
|
2542
|
-
function
|
|
2594
|
+
function gn() {
|
|
2543
2595
|
let e, t, n = new Promise((r, i) => {
|
|
2544
2596
|
e = async (e) => {
|
|
2545
2597
|
r(e);
|
|
@@ -2559,86 +2611,86 @@ function dn() {
|
|
|
2559
2611
|
reject: t
|
|
2560
2612
|
};
|
|
2561
2613
|
}
|
|
2562
|
-
var
|
|
2563
|
-
|
|
2564
|
-
var pn = e.createContext(null);
|
|
2565
|
-
pn.displayName = "DataRouterState";
|
|
2566
|
-
var mn = e.createContext(!1);
|
|
2567
|
-
function hn() {
|
|
2568
|
-
return e.useContext(mn);
|
|
2569
|
-
}
|
|
2570
|
-
var gn = e.createContext({ isTransitioning: !1 });
|
|
2571
|
-
gn.displayName = "ViewTransition";
|
|
2572
|
-
var _n = e.createContext(/* @__PURE__ */ new Map());
|
|
2573
|
-
_n.displayName = "Fetchers";
|
|
2614
|
+
var _n = e.createContext(null);
|
|
2615
|
+
_n.displayName = "DataRouter";
|
|
2574
2616
|
var vn = e.createContext(null);
|
|
2575
|
-
vn.displayName = "
|
|
2617
|
+
vn.displayName = "DataRouterState";
|
|
2618
|
+
var yn = e.createContext(!1);
|
|
2619
|
+
function bn() {
|
|
2620
|
+
return e.useContext(yn);
|
|
2621
|
+
}
|
|
2622
|
+
var xn = e.createContext({ isTransitioning: !1 });
|
|
2623
|
+
xn.displayName = "ViewTransition";
|
|
2624
|
+
var Sn = e.createContext(/* @__PURE__ */ new Map());
|
|
2625
|
+
Sn.displayName = "Fetchers";
|
|
2626
|
+
var Cn = e.createContext(null);
|
|
2627
|
+
Cn.displayName = "Await";
|
|
2576
2628
|
var Z = e.createContext(null);
|
|
2577
2629
|
Z.displayName = "Navigation";
|
|
2578
|
-
var
|
|
2579
|
-
|
|
2630
|
+
var wn = e.createContext(null);
|
|
2631
|
+
wn.displayName = "Location";
|
|
2580
2632
|
var Q = e.createContext({
|
|
2581
2633
|
outlet: null,
|
|
2582
2634
|
matches: [],
|
|
2583
2635
|
isDataRoute: !1
|
|
2584
2636
|
});
|
|
2585
2637
|
Q.displayName = "Route";
|
|
2586
|
-
var
|
|
2587
|
-
|
|
2588
|
-
var
|
|
2589
|
-
function
|
|
2590
|
-
if (e.startsWith(`${
|
|
2638
|
+
var Tn = e.createContext(null);
|
|
2639
|
+
Tn.displayName = "RouteError";
|
|
2640
|
+
var En = "REACT_ROUTER_ERROR", Dn = "REDIRECT", On = "ROUTE_ERROR_RESPONSE";
|
|
2641
|
+
function kn(e) {
|
|
2642
|
+
if (e.startsWith(`${En}:${Dn}:{`)) try {
|
|
2591
2643
|
let t = JSON.parse(e.slice(28));
|
|
2592
2644
|
if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean") return t;
|
|
2593
2645
|
} catch {}
|
|
2594
2646
|
}
|
|
2595
|
-
function
|
|
2596
|
-
if (e.startsWith(`${
|
|
2647
|
+
function An(e) {
|
|
2648
|
+
if (e.startsWith(`${En}:${On}:{`)) try {
|
|
2597
2649
|
let t = JSON.parse(e.slice(40));
|
|
2598
|
-
if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string") return new
|
|
2650
|
+
if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string") return new Se(t.status, t.statusText, t.data);
|
|
2599
2651
|
} catch {}
|
|
2600
2652
|
}
|
|
2601
|
-
function
|
|
2602
|
-
f(
|
|
2603
|
-
let { basename: r, navigator: i } = e.useContext(Z), { hash: a, pathname: o, search: s } =
|
|
2604
|
-
return r !== "/" && (c = o === "/" ? r :
|
|
2653
|
+
function jn(t, { relative: n } = {}) {
|
|
2654
|
+
f(Mn(), "useHref() may be used only in the context of a <Router> component.");
|
|
2655
|
+
let { basename: r, navigator: i } = e.useContext(Z), { hash: a, pathname: o, search: s } = Vn(t, { relative: n }), c = o;
|
|
2656
|
+
return r !== "/" && (c = o === "/" ? r : W([r, o])), i.createHref({
|
|
2605
2657
|
pathname: c,
|
|
2606
2658
|
search: s,
|
|
2607
2659
|
hash: a
|
|
2608
2660
|
});
|
|
2609
2661
|
}
|
|
2610
|
-
function
|
|
2611
|
-
return e.useContext(
|
|
2662
|
+
function Mn() {
|
|
2663
|
+
return e.useContext(wn) != null;
|
|
2612
2664
|
}
|
|
2613
2665
|
function $() {
|
|
2614
|
-
return f(
|
|
2666
|
+
return f(Mn(), "useLocation() may be used only in the context of a <Router> component."), e.useContext(wn).location;
|
|
2615
2667
|
}
|
|
2616
|
-
function
|
|
2617
|
-
f(
|
|
2668
|
+
function Nn(t) {
|
|
2669
|
+
f(Mn(), "useMatch() may be used only in the context of a <Router> component.");
|
|
2618
2670
|
let { pathname: n } = $();
|
|
2619
|
-
return e.useMemo(() =>
|
|
2671
|
+
return e.useMemo(() => se(t, le(n)), [n, t]);
|
|
2620
2672
|
}
|
|
2621
|
-
var
|
|
2622
|
-
function
|
|
2673
|
+
var Pn = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
2674
|
+
function Fn(t) {
|
|
2623
2675
|
e.useContext(Z).static || e.useLayoutEffect(t);
|
|
2624
2676
|
}
|
|
2625
|
-
function
|
|
2677
|
+
function In() {
|
|
2626
2678
|
let { isDataRoute: t } = e.useContext(Q);
|
|
2627
|
-
return t ?
|
|
2679
|
+
return t ? ir() : Ln();
|
|
2628
2680
|
}
|
|
2629
|
-
function
|
|
2630
|
-
f(
|
|
2631
|
-
let t = e.useContext(
|
|
2632
|
-
return
|
|
2681
|
+
function Ln() {
|
|
2682
|
+
f(Mn(), "useNavigate() may be used only in the context of a <Router> component.");
|
|
2683
|
+
let t = e.useContext(_n), { basename: n, navigator: r } = e.useContext(Z), { matches: i } = e.useContext(Q), { pathname: a } = $(), o = JSON.stringify(he(i)), s = e.useRef(!1);
|
|
2684
|
+
return Fn(() => {
|
|
2633
2685
|
s.current = !0;
|
|
2634
2686
|
}), e.useCallback((e, i = {}) => {
|
|
2635
|
-
if (p(s.current,
|
|
2687
|
+
if (p(s.current, Pn), !s.current) return;
|
|
2636
2688
|
if (typeof e == "number") {
|
|
2637
2689
|
r.go(e);
|
|
2638
2690
|
return;
|
|
2639
2691
|
}
|
|
2640
|
-
let c =
|
|
2641
|
-
t == null && n !== "/" && (c.pathname = c.pathname === "/" ? n :
|
|
2692
|
+
let c = ge(e, JSON.parse(o), a, i.relative === "path");
|
|
2693
|
+
t == null && n !== "/" && (c.pathname = c.pathname === "/" ? n : W([n, c.pathname])), Ve(typeof e == "string" ? e : _(e), r.createHref(c), Re(r), "reject"), (i.replace ? r.replace : r.push)(c, i.state, i);
|
|
2642
2694
|
}, [
|
|
2643
2695
|
n,
|
|
2644
2696
|
r,
|
|
@@ -2647,30 +2699,30 @@ function Mn() {
|
|
|
2647
2699
|
t
|
|
2648
2700
|
]);
|
|
2649
2701
|
}
|
|
2650
|
-
var
|
|
2651
|
-
function
|
|
2702
|
+
var Rn = e.createContext(null);
|
|
2703
|
+
function zn(t) {
|
|
2652
2704
|
let n = e.useContext(Q).outlet;
|
|
2653
|
-
return e.useMemo(() => n && /* @__PURE__ */ e.createElement(
|
|
2705
|
+
return e.useMemo(() => n && /* @__PURE__ */ e.createElement(Rn.Provider, { value: t }, n), [n, t]);
|
|
2654
2706
|
}
|
|
2655
|
-
function
|
|
2707
|
+
function Bn() {
|
|
2656
2708
|
let { matches: t } = e.useContext(Q);
|
|
2657
2709
|
return t[t.length - 1]?.params ?? {};
|
|
2658
2710
|
}
|
|
2659
|
-
function
|
|
2660
|
-
let { matches: r } = e.useContext(Q), { pathname: i } = $(), a = JSON.stringify(
|
|
2661
|
-
return e.useMemo(() =>
|
|
2711
|
+
function Vn(t, { relative: n } = {}) {
|
|
2712
|
+
let { matches: r } = e.useContext(Q), { pathname: i } = $(), a = JSON.stringify(he(r));
|
|
2713
|
+
return e.useMemo(() => ge(t, JSON.parse(a), i, n === "path"), [
|
|
2662
2714
|
t,
|
|
2663
2715
|
a,
|
|
2664
2716
|
i,
|
|
2665
2717
|
n
|
|
2666
2718
|
]);
|
|
2667
2719
|
}
|
|
2668
|
-
function
|
|
2669
|
-
f(
|
|
2720
|
+
function Hn(t, n, r) {
|
|
2721
|
+
f(Mn(), "useRoutes() may be used only in the context of a <Router> component.");
|
|
2670
2722
|
let { navigator: i } = e.useContext(Z), { matches: a } = e.useContext(Q), o = a[a.length - 1], s = o ? o.params : {}, c = o ? o.pathname : "/", l = o ? o.pathnameBase : "/", u = o && o.route;
|
|
2671
2723
|
{
|
|
2672
2724
|
let e = u && u.path || "";
|
|
2673
|
-
|
|
2725
|
+
or(c, !u || e.endsWith("*") || e.endsWith("*?"), `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) 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.
|
|
2674
2726
|
|
|
2675
2727
|
Please change the parent <Route path="${e}"> to <Route path="${e === "/" ? "*" : `${e}/*`}">.`);
|
|
2676
2728
|
}
|
|
@@ -2686,12 +2738,12 @@ Please change the parent <Route path="${e}"> to <Route path="${e === "/" ? "*" :
|
|
|
2686
2738
|
}
|
|
2687
2739
|
let _ = r && r.state.matches.length ? r.state.matches.map((e) => Object.assign(e, { route: r.manifest[e.route.id] || e.route })) : j(t, { pathname: g });
|
|
2688
2740
|
p(u || _ != null, `No routes matched location "${m.pathname}${m.search}${m.hash}" `), p(_ == null || _[_.length - 1].route.element !== void 0 || _[_.length - 1].route.Component !== void 0 || _[_.length - 1].route.lazy !== void 0, `Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);
|
|
2689
|
-
let y =
|
|
2741
|
+
let y = Yn(_ && _.map((e) => Object.assign({}, e, {
|
|
2690
2742
|
params: Object.assign({}, s, e.params),
|
|
2691
|
-
pathname:
|
|
2692
|
-
pathnameBase: e.pathnameBase === "/" ? l :
|
|
2743
|
+
pathname: W([l, i.encodeLocation ? i.encodeLocation(e.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")).pathname : e.pathname]),
|
|
2744
|
+
pathnameBase: e.pathnameBase === "/" ? l : W([l, i.encodeLocation ? i.encodeLocation(e.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")).pathname : e.pathnameBase])
|
|
2693
2745
|
})), a, r);
|
|
2694
|
-
return n && y ? /* @__PURE__ */ e.createElement(
|
|
2746
|
+
return n && y ? /* @__PURE__ */ e.createElement(wn.Provider, { value: {
|
|
2695
2747
|
location: {
|
|
2696
2748
|
pathname: "/",
|
|
2697
2749
|
search: "",
|
|
@@ -2704,8 +2756,8 @@ Please change the parent <Route path="${e}"> to <Route path="${e === "/" ? "*" :
|
|
|
2704
2756
|
navigationType: "POP"
|
|
2705
2757
|
} }, y) : y;
|
|
2706
2758
|
}
|
|
2707
|
-
function
|
|
2708
|
-
let t =
|
|
2759
|
+
function Un() {
|
|
2760
|
+
let t = rr(), n = Ce(t) ? `${t.status} ${t.statusText}` : t instanceof Error ? t.message : JSON.stringify(t), r = t instanceof Error ? t.stack : null, i = "rgba(200,200,200, 0.5)", a = {
|
|
2709
2761
|
padding: "0.5rem",
|
|
2710
2762
|
backgroundColor: i
|
|
2711
2763
|
}, o = {
|
|
@@ -2714,7 +2766,7 @@ function Rn() {
|
|
|
2714
2766
|
}, s = null;
|
|
2715
2767
|
return console.error("Error handled by React Router default ErrorBoundary:", t), s = /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ e.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ e.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ e.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ e.createElement("h3", { style: { fontStyle: "italic" } }, n), r ? /* @__PURE__ */ e.createElement("pre", { style: a }, r) : null, s);
|
|
2716
2768
|
}
|
|
2717
|
-
var
|
|
2769
|
+
var Wn = /* @__PURE__ */ e.createElement(Un, null), Gn = class extends e.Component {
|
|
2718
2770
|
constructor(e) {
|
|
2719
2771
|
super(e), this.state = {
|
|
2720
2772
|
location: e.location,
|
|
@@ -2742,45 +2794,47 @@ var zn = /* @__PURE__ */ e.createElement(Rn, null), Bn = class extends e.Compone
|
|
|
2742
2794
|
render() {
|
|
2743
2795
|
let t = this.state.error;
|
|
2744
2796
|
if (this.context && typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
|
|
2745
|
-
let e =
|
|
2797
|
+
let e = An(t.digest);
|
|
2746
2798
|
e && (t = e);
|
|
2747
2799
|
}
|
|
2748
|
-
let n = t === void 0 ? this.props.children : /* @__PURE__ */ e.createElement(Q.Provider, { value: this.props.routeContext }, /* @__PURE__ */ e.createElement(
|
|
2800
|
+
let n = t === void 0 ? this.props.children : /* @__PURE__ */ e.createElement(Q.Provider, { value: this.props.routeContext }, /* @__PURE__ */ e.createElement(Tn.Provider, {
|
|
2749
2801
|
value: t,
|
|
2750
2802
|
children: this.props.component
|
|
2751
2803
|
}));
|
|
2752
|
-
return this.context ? /* @__PURE__ */ e.createElement(
|
|
2804
|
+
return this.context ? /* @__PURE__ */ e.createElement(qn, { error: t }, n) : n;
|
|
2753
2805
|
}
|
|
2754
2806
|
};
|
|
2755
|
-
|
|
2756
|
-
var
|
|
2757
|
-
function
|
|
2758
|
-
let { basename: r } = e.useContext(Z);
|
|
2807
|
+
Gn.contextType = yn;
|
|
2808
|
+
var Kn = /* @__PURE__ */ new WeakMap();
|
|
2809
|
+
function qn({ children: t, error: n }) {
|
|
2810
|
+
let { basename: r, navigator: i } = e.useContext(Z);
|
|
2759
2811
|
if (typeof n == "object" && n && "digest" in n && typeof n.digest == "string") {
|
|
2760
|
-
let t =
|
|
2812
|
+
let t = kn(n.digest);
|
|
2761
2813
|
if (t) {
|
|
2762
|
-
let
|
|
2763
|
-
if (
|
|
2764
|
-
let
|
|
2765
|
-
if (
|
|
2766
|
-
if (
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2814
|
+
let a = Kn.get(n);
|
|
2815
|
+
if (a) throw a;
|
|
2816
|
+
let o = Ee(t.location, r), s = o.absoluteURL || o.to;
|
|
2817
|
+
if (Ve(t.location, s, Re(i), "allow-explicit"), Ft(s)) throw Error("Invalid redirect location");
|
|
2818
|
+
if (Te && !Kn.get(n)) {
|
|
2819
|
+
if (o.isExternal || t.reloadDocument) window.location.href = s;
|
|
2820
|
+
else {
|
|
2821
|
+
let e = Promise.resolve().then(() => window.__reactRouterDataRouter.navigate(o.to, { replace: t.replace }));
|
|
2822
|
+
throw Kn.set(n, e), e;
|
|
2823
|
+
}
|
|
2770
2824
|
}
|
|
2771
2825
|
return /* @__PURE__ */ e.createElement("meta", {
|
|
2772
2826
|
httpEquiv: "refresh",
|
|
2773
|
-
content: `0;url=${
|
|
2827
|
+
content: `0;url=${s}`
|
|
2774
2828
|
});
|
|
2775
2829
|
}
|
|
2776
2830
|
}
|
|
2777
2831
|
return t;
|
|
2778
2832
|
}
|
|
2779
|
-
function
|
|
2780
|
-
let i = e.useContext(
|
|
2833
|
+
function Jn({ routeContext: t, match: n, children: r }) {
|
|
2834
|
+
let i = e.useContext(_n);
|
|
2781
2835
|
return i && i.static && i.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (i.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ e.createElement(Q.Provider, { value: t }, r);
|
|
2782
2836
|
}
|
|
2783
|
-
function
|
|
2837
|
+
function Yn(t, n = [], r) {
|
|
2784
2838
|
let i = r?.state;
|
|
2785
2839
|
if (t == null) {
|
|
2786
2840
|
if (!i) return null;
|
|
@@ -2811,16 +2865,16 @@ function Wn(t, n = [], r) {
|
|
|
2811
2865
|
l(e, {
|
|
2812
2866
|
location: i.location,
|
|
2813
2867
|
params: i.matches?.[0]?.params ?? {},
|
|
2814
|
-
pattern:
|
|
2868
|
+
pattern: we(i.matches),
|
|
2815
2869
|
errorInfo: t
|
|
2816
2870
|
});
|
|
2817
2871
|
} : void 0;
|
|
2818
2872
|
return a.reduceRight((t, r, l) => {
|
|
2819
2873
|
let d, f = !1, p = null, m = null;
|
|
2820
|
-
i && (d = o && r.route.id ? o[r.route.id] : void 0, p = r.route.errorElement ||
|
|
2874
|
+
i && (d = o && r.route.id ? o[r.route.id] : void 0, p = r.route.errorElement || Wn, s && (c < 0 && l === 0 ? (or("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), f = !0, m = null) : c === l && (f = !0, m = r.route.hydrateFallbackElement || null)));
|
|
2821
2875
|
let h = n.concat(a.slice(0, l + 1)), g = () => {
|
|
2822
2876
|
let n;
|
|
2823
|
-
return n = d ? p : f ? m : r.route.Component ? /* @__PURE__ */ e.createElement(r.route.Component, null) : r.route.element ? r.route.element : t, /* @__PURE__ */ e.createElement(
|
|
2877
|
+
return n = d ? p : f ? m : r.route.Component ? /* @__PURE__ */ e.createElement(r.route.Component, null) : r.route.element ? r.route.element : t, /* @__PURE__ */ e.createElement(Jn, {
|
|
2824
2878
|
match: r,
|
|
2825
2879
|
routeContext: {
|
|
2826
2880
|
outlet: t,
|
|
@@ -2830,7 +2884,7 @@ function Wn(t, n = [], r) {
|
|
|
2830
2884
|
children: n
|
|
2831
2885
|
});
|
|
2832
2886
|
};
|
|
2833
|
-
return i && (r.route.ErrorBoundary || r.route.errorElement || l === 0) ? /* @__PURE__ */ e.createElement(
|
|
2887
|
+
return i && (r.route.ErrorBoundary || r.route.errorElement || l === 0) ? /* @__PURE__ */ e.createElement(Gn, {
|
|
2834
2888
|
location: i.location,
|
|
2835
2889
|
revalidation: i.revalidation,
|
|
2836
2890
|
component: p,
|
|
@@ -2845,67 +2899,60 @@ function Wn(t, n = [], r) {
|
|
|
2845
2899
|
}) : g();
|
|
2846
2900
|
}, null);
|
|
2847
2901
|
}
|
|
2848
|
-
function
|
|
2902
|
+
function Xn(e) {
|
|
2849
2903
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
2850
2904
|
}
|
|
2851
|
-
function
|
|
2852
|
-
let n = e.useContext(
|
|
2853
|
-
return f(n,
|
|
2905
|
+
function Zn(t) {
|
|
2906
|
+
let n = e.useContext(_n);
|
|
2907
|
+
return f(n, Xn(t)), n;
|
|
2854
2908
|
}
|
|
2855
|
-
function
|
|
2856
|
-
let n = e.useContext(
|
|
2857
|
-
return f(n,
|
|
2909
|
+
function Qn(t) {
|
|
2910
|
+
let n = e.useContext(vn);
|
|
2911
|
+
return f(n, Xn(t)), n;
|
|
2858
2912
|
}
|
|
2859
|
-
function
|
|
2913
|
+
function $n(t) {
|
|
2860
2914
|
let n = e.useContext(Q);
|
|
2861
|
-
return f(n,
|
|
2915
|
+
return f(n, Xn(t)), n;
|
|
2862
2916
|
}
|
|
2863
|
-
function
|
|
2864
|
-
let t =
|
|
2917
|
+
function er(e) {
|
|
2918
|
+
let t = $n(e), n = t.matches[t.matches.length - 1];
|
|
2865
2919
|
return f(n.route.id, `${e} can only be used on routes that contain a unique "id"`), n.route.id;
|
|
2866
2920
|
}
|
|
2867
|
-
function
|
|
2868
|
-
return
|
|
2921
|
+
function tr() {
|
|
2922
|
+
return er("useRouteId");
|
|
2869
2923
|
}
|
|
2870
|
-
function
|
|
2871
|
-
let t =
|
|
2872
|
-
return e.useMemo(() => {
|
|
2873
|
-
let { matches: e, historyAction: n, ...r } = t.navigation;
|
|
2874
|
-
return r;
|
|
2875
|
-
}, [t.navigation]);
|
|
2876
|
-
}
|
|
2877
|
-
function Qn() {
|
|
2878
|
-
let { matches: t, loaderData: n } = qn("useMatches");
|
|
2924
|
+
function nr() {
|
|
2925
|
+
let { matches: t, loaderData: n } = Qn("useMatches");
|
|
2879
2926
|
return e.useMemo(() => t.map((e) => ee(e, n)), [t, n]);
|
|
2880
2927
|
}
|
|
2881
|
-
function
|
|
2882
|
-
let t = e.useContext(
|
|
2928
|
+
function rr() {
|
|
2929
|
+
let t = e.useContext(Tn), n = Qn("useRouteError"), r = er("useRouteError");
|
|
2883
2930
|
return t === void 0 ? n.errors?.[r] : t;
|
|
2884
2931
|
}
|
|
2885
|
-
function
|
|
2886
|
-
let { router: t } =
|
|
2887
|
-
return
|
|
2932
|
+
function ir() {
|
|
2933
|
+
let { router: t } = Zn("useNavigate"), n = er("useNavigate"), r = e.useRef(!1);
|
|
2934
|
+
return Fn(() => {
|
|
2888
2935
|
r.current = !0;
|
|
2889
2936
|
}), e.useCallback(async (e, i = {}) => {
|
|
2890
|
-
p(r.current,
|
|
2937
|
+
p(r.current, Pn), r.current && (typeof e == "number" ? await t.navigate(e) : await t.navigate(e, {
|
|
2891
2938
|
fromRouteId: n,
|
|
2892
2939
|
...i
|
|
2893
2940
|
}));
|
|
2894
2941
|
}, [t, n]);
|
|
2895
2942
|
}
|
|
2896
|
-
var
|
|
2897
|
-
function
|
|
2898
|
-
!t && !
|
|
2943
|
+
var ar = {};
|
|
2944
|
+
function or(e, t, n) {
|
|
2945
|
+
!t && !ar[e] && (ar[e] = !0, p(!1, n));
|
|
2899
2946
|
}
|
|
2900
|
-
var
|
|
2901
|
-
function
|
|
2902
|
-
!e && !
|
|
2947
|
+
var sr = {};
|
|
2948
|
+
function cr(e, t) {
|
|
2949
|
+
!e && !sr[t] && (sr[t] = !0, console.warn(t));
|
|
2903
2950
|
}
|
|
2904
|
-
var
|
|
2905
|
-
function
|
|
2906
|
-
return
|
|
2951
|
+
var lr = e.useOptimistic, ur = () => void 0;
|
|
2952
|
+
function dr(e) {
|
|
2953
|
+
return lr ? lr(e) : [e, ur];
|
|
2907
2954
|
}
|
|
2908
|
-
function
|
|
2955
|
+
function fr(t) {
|
|
2909
2956
|
let n = { hasErrorBoundary: t.hasErrorBoundary || t.ErrorBoundary != null || t.errorElement != null };
|
|
2910
2957
|
return t.Component && (t.element && p(!1, "You should not include both `Component` and `element` on your route - `Component` will be used."), Object.assign(n, {
|
|
2911
2958
|
element: e.createElement(t.Component),
|
|
@@ -2918,7 +2965,7 @@ function cr(t) {
|
|
|
2918
2965
|
ErrorBoundary: void 0
|
|
2919
2966
|
})), n;
|
|
2920
2967
|
}
|
|
2921
|
-
var
|
|
2968
|
+
var pr = ["HydrateFallback", "hydrateFallbackElement"], mr = class {
|
|
2922
2969
|
constructor() {
|
|
2923
2970
|
this.status = "pending", this.promise = new Promise((e, t) => {
|
|
2924
2971
|
this.resolve = (t) => {
|
|
@@ -2929,20 +2976,20 @@ var lr = ["HydrateFallback", "hydrateFallbackElement"], ur = class {
|
|
|
2929
2976
|
});
|
|
2930
2977
|
}
|
|
2931
2978
|
};
|
|
2932
|
-
function
|
|
2933
|
-
i =
|
|
2934
|
-
let [a, o] = e.useState(t.state), [s, c] =
|
|
2979
|
+
function hr({ router: t, flushSync: n, onError: r, useTransitions: i }) {
|
|
2980
|
+
i = bn() || i;
|
|
2981
|
+
let [a, o] = e.useState(t.state), [s, c] = dr(a), [l, u] = e.useState(), [d, f] = e.useState({ isTransitioning: !1 }), [p, m] = e.useState(), [h, g] = e.useState(), [_, v] = e.useState(), y = e.useRef(/* @__PURE__ */ new Map()), b = e.useCallback((a, { deletedFetchers: s, newErrors: l, flushSync: d, viewTransitionOpts: _ }) => {
|
|
2935
2982
|
l && r && Object.values(l).forEach((e) => r(e, {
|
|
2936
2983
|
location: a.location,
|
|
2937
2984
|
params: a.matches[0]?.params ?? {},
|
|
2938
|
-
pattern:
|
|
2985
|
+
pattern: we(a.matches)
|
|
2939
2986
|
})), a.fetchers.forEach((e, t) => {
|
|
2940
2987
|
e.data !== void 0 && y.current.set(t, e.data);
|
|
2941
|
-
}), s.forEach((e) => y.current.delete(e)),
|
|
2988
|
+
}), s.forEach((e) => y.current.delete(e)), cr(d === !1 || n != null, "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.");
|
|
2942
2989
|
let b = t.window != null && t.window.document != null && typeof t.window.document.startViewTransition == "function";
|
|
2943
|
-
if (
|
|
2990
|
+
if (cr(_ == null || b, "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."), !_ || !b) {
|
|
2944
2991
|
n && d ? n(() => o(a)) : i === !1 ? o(a) : e.startTransition(() => {
|
|
2945
|
-
i === !0 && c((e) =>
|
|
2992
|
+
i === !0 && c((e) => gr(e, a)), o(a);
|
|
2946
2993
|
});
|
|
2947
2994
|
return;
|
|
2948
2995
|
}
|
|
@@ -2985,12 +3032,12 @@ function dr({ router: t, flushSync: n, onError: r, useTransitions: i }) {
|
|
|
2985
3032
|
r
|
|
2986
3033
|
]);
|
|
2987
3034
|
e.useLayoutEffect(() => t.subscribe(b), [t, b]), e.useEffect(() => {
|
|
2988
|
-
d.isTransitioning && !d.flushSync && m(new
|
|
3035
|
+
d.isTransitioning && !d.flushSync && m(new mr());
|
|
2989
3036
|
}, [d]), e.useEffect(() => {
|
|
2990
3037
|
if (p && l && t.window) {
|
|
2991
3038
|
let n = l, r = p.promise, a = t.window.document.startViewTransition(async () => {
|
|
2992
3039
|
i === !1 ? o(n) : e.startTransition(() => {
|
|
2993
|
-
i === !0 && c((e) =>
|
|
3040
|
+
i === !0 && c((e) => gr(e, n)), o(n);
|
|
2994
3041
|
}), await r;
|
|
2995
3042
|
});
|
|
2996
3043
|
a.finished.finally(() => {
|
|
@@ -3020,6 +3067,7 @@ function dr({ router: t, flushSync: n, onError: r, useTransitions: i }) {
|
|
|
3020
3067
|
}, [d.isTransitioning, _]);
|
|
3021
3068
|
let x = e.useMemo(() => ({
|
|
3022
3069
|
createHref: t.createHref,
|
|
3070
|
+
createURL: t.createURL,
|
|
3023
3071
|
encodeLocation: t.encodeLocation,
|
|
3024
3072
|
go: (e) => t.navigate(e),
|
|
3025
3073
|
push: (e, n, r) => t.navigate(e, {
|
|
@@ -3043,13 +3091,13 @@ function dr({ router: t, flushSync: n, onError: r, useTransitions: i }) {
|
|
|
3043
3091
|
S,
|
|
3044
3092
|
r
|
|
3045
3093
|
]);
|
|
3046
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
3094
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(_n.Provider, { value: C }, /* @__PURE__ */ e.createElement(vn.Provider, { value: s }, /* @__PURE__ */ e.createElement(Sn.Provider, { value: y.current }, /* @__PURE__ */ e.createElement(xn.Provider, { value: d }, /* @__PURE__ */ e.createElement(br, {
|
|
3047
3095
|
basename: S,
|
|
3048
3096
|
location: s.location,
|
|
3049
3097
|
navigationType: s.historyAction,
|
|
3050
3098
|
navigator: x,
|
|
3051
3099
|
useTransitions: i
|
|
3052
|
-
}, /* @__PURE__ */ e.createElement(
|
|
3100
|
+
}, /* @__PURE__ */ e.createElement(_r, {
|
|
3053
3101
|
routes: t.routes,
|
|
3054
3102
|
manifest: t.manifest,
|
|
3055
3103
|
future: t.future,
|
|
@@ -3058,7 +3106,7 @@ function dr({ router: t, flushSync: n, onError: r, useTransitions: i }) {
|
|
|
3058
3106
|
onError: r
|
|
3059
3107
|
})))))), null);
|
|
3060
3108
|
}
|
|
3061
|
-
function
|
|
3109
|
+
function gr(e, t) {
|
|
3062
3110
|
return {
|
|
3063
3111
|
...e,
|
|
3064
3112
|
navigation: t.navigation.state === "idle" ? e.navigation : t.navigation,
|
|
@@ -3067,9 +3115,9 @@ function fr(e, t) {
|
|
|
3067
3115
|
fetchers: t.fetchers
|
|
3068
3116
|
};
|
|
3069
3117
|
}
|
|
3070
|
-
var
|
|
3071
|
-
function
|
|
3072
|
-
return
|
|
3118
|
+
var _r = e.memo(vr);
|
|
3119
|
+
function vr({ routes: e, manifest: t, future: n, state: r, isStatic: i, onError: a }) {
|
|
3120
|
+
return Hn(e, void 0, {
|
|
3073
3121
|
manifest: t,
|
|
3074
3122
|
state: r,
|
|
3075
3123
|
isStatic: i,
|
|
@@ -3077,11 +3125,11 @@ function mr({ routes: e, manifest: t, future: n, state: r, isStatic: i, onError:
|
|
|
3077
3125
|
future: n
|
|
3078
3126
|
});
|
|
3079
3127
|
}
|
|
3080
|
-
function
|
|
3081
|
-
return
|
|
3128
|
+
function yr(e) {
|
|
3129
|
+
return zn(e.context);
|
|
3082
3130
|
}
|
|
3083
|
-
function
|
|
3084
|
-
f(!
|
|
3131
|
+
function br({ basename: t = "/", children: n = null, location: r, navigationType: i = "POP", navigator: a, static: o = !1, useTransitions: s }) {
|
|
3132
|
+
f(!Mn(), "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");
|
|
3085
3133
|
let c = t.replace(/^\/*/, "/"), l = e.useMemo(() => ({
|
|
3086
3134
|
basename: c,
|
|
3087
3135
|
navigator: a,
|
|
@@ -3096,7 +3144,7 @@ function gr({ basename: t = "/", children: n = null, location: r, navigationType
|
|
|
3096
3144
|
]);
|
|
3097
3145
|
typeof r == "string" && (r = v(r));
|
|
3098
3146
|
let { pathname: u = "/", search: d = "", hash: m = "", state: h = null, key: g = "default", mask: _ } = r, y = e.useMemo(() => {
|
|
3099
|
-
let e =
|
|
3147
|
+
let e = H(u, c);
|
|
3100
3148
|
return e == null ? null : {
|
|
3101
3149
|
location: {
|
|
3102
3150
|
pathname: e,
|
|
@@ -3118,66 +3166,66 @@ function gr({ basename: t = "/", children: n = null, location: r, navigationType
|
|
|
3118
3166
|
i,
|
|
3119
3167
|
_
|
|
3120
3168
|
]);
|
|
3121
|
-
return p(y != null, `<Router basename="${c}"> is not able to match the URL "${u}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`), y == null ? null : /* @__PURE__ */ e.createElement(Z.Provider, { value: l }, /* @__PURE__ */ e.createElement(
|
|
3169
|
+
return p(y != null, `<Router basename="${c}"> is not able to match the URL "${u}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`), y == null ? null : /* @__PURE__ */ e.createElement(Z.Provider, { value: l }, /* @__PURE__ */ e.createElement(wn.Provider, {
|
|
3122
3170
|
children: n,
|
|
3123
3171
|
value: y
|
|
3124
3172
|
}));
|
|
3125
3173
|
}
|
|
3126
3174
|
e.Component;
|
|
3127
|
-
var
|
|
3128
|
-
function
|
|
3175
|
+
var xr = "get", Sr = "application/x-www-form-urlencoded";
|
|
3176
|
+
function Cr(e) {
|
|
3129
3177
|
return typeof HTMLElement < "u" && e instanceof HTMLElement;
|
|
3130
3178
|
}
|
|
3131
|
-
function
|
|
3132
|
-
return
|
|
3179
|
+
function wr(e) {
|
|
3180
|
+
return Cr(e) && e.tagName.toLowerCase() === "button";
|
|
3133
3181
|
}
|
|
3134
|
-
function
|
|
3135
|
-
return
|
|
3182
|
+
function Tr(e) {
|
|
3183
|
+
return Cr(e) && e.tagName.toLowerCase() === "form";
|
|
3136
3184
|
}
|
|
3137
|
-
function
|
|
3138
|
-
return
|
|
3185
|
+
function Er(e) {
|
|
3186
|
+
return Cr(e) && e.tagName.toLowerCase() === "input";
|
|
3139
3187
|
}
|
|
3140
|
-
function
|
|
3188
|
+
function Dr(e) {
|
|
3141
3189
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
3142
3190
|
}
|
|
3143
|
-
function
|
|
3144
|
-
return e.button === 0 && (!t || t === "_self") && !
|
|
3191
|
+
function Or(e, t) {
|
|
3192
|
+
return e.button === 0 && (!t || t === "_self") && !Dr(e);
|
|
3145
3193
|
}
|
|
3146
|
-
var
|
|
3147
|
-
function
|
|
3148
|
-
if (
|
|
3149
|
-
new FormData(document.createElement("form"), 0),
|
|
3194
|
+
var kr = null;
|
|
3195
|
+
function Ar() {
|
|
3196
|
+
if (kr === null) try {
|
|
3197
|
+
new FormData(document.createElement("form"), 0), kr = !1;
|
|
3150
3198
|
} catch {
|
|
3151
|
-
|
|
3199
|
+
kr = !0;
|
|
3152
3200
|
}
|
|
3153
|
-
return
|
|
3201
|
+
return kr;
|
|
3154
3202
|
}
|
|
3155
|
-
var
|
|
3203
|
+
var jr = /* @__PURE__ */ new Set([
|
|
3156
3204
|
"application/x-www-form-urlencoded",
|
|
3157
3205
|
"multipart/form-data",
|
|
3158
3206
|
"text/plain"
|
|
3159
3207
|
]);
|
|
3160
|
-
function
|
|
3161
|
-
return e != null && !
|
|
3208
|
+
function Mr(e) {
|
|
3209
|
+
return e != null && !jr.has(e) ? (p(!1, `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sr}"`), null) : e;
|
|
3162
3210
|
}
|
|
3163
|
-
function
|
|
3211
|
+
function Nr(e, t) {
|
|
3164
3212
|
let n, r, i, a, o;
|
|
3165
|
-
if (
|
|
3213
|
+
if (Tr(e)) {
|
|
3166
3214
|
let o = e.getAttribute("action");
|
|
3167
|
-
r = o ?
|
|
3168
|
-
} else if (
|
|
3215
|
+
r = o ? H(o, t) : null, n = e.getAttribute("method") || xr, i = Mr(e.getAttribute("enctype")) || Sr, a = new FormData(e);
|
|
3216
|
+
} else if (wr(e) || Er(e) && (e.type === "submit" || e.type === "image")) {
|
|
3169
3217
|
let o = e.form;
|
|
3170
3218
|
if (o == null) throw Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>");
|
|
3171
3219
|
let s = e.getAttribute("formaction") || o.getAttribute("action");
|
|
3172
|
-
if (r = s ?
|
|
3220
|
+
if (r = s ? H(s, t) : null, n = e.getAttribute("formmethod") || o.getAttribute("method") || xr, i = Mr(e.getAttribute("formenctype")) || Mr(o.getAttribute("enctype")) || Sr, a = new FormData(o, e), !Ar()) {
|
|
3173
3221
|
let { name: t, type: n, value: r } = e;
|
|
3174
3222
|
if (n === "image") {
|
|
3175
3223
|
let e = t ? `${t}.` : "";
|
|
3176
3224
|
a.append(`${e}x`, "0"), a.append(`${e}y`, "0");
|
|
3177
3225
|
} else t && a.append(t, r);
|
|
3178
3226
|
}
|
|
3179
|
-
} else if (
|
|
3180
|
-
else n =
|
|
3227
|
+
} else if (Cr(e)) throw Error("Cannot submit element that is not <form>, <button>, or <input type=\"submit|image\">");
|
|
3228
|
+
else n = xr, r = null, i = Sr, o = e;
|
|
3181
3229
|
return a && i === "text/plain" && (o = a, a = void 0), {
|
|
3182
3230
|
action: r,
|
|
3183
3231
|
method: n.toLowerCase(),
|
|
@@ -3187,24 +3235,14 @@ function kr(e, t) {
|
|
|
3187
3235
|
};
|
|
3188
3236
|
}
|
|
3189
3237
|
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
3190
|
-
|
|
3191
|
-
"&": "\\u0026",
|
|
3192
|
-
">": "\\u003e",
|
|
3193
|
-
"<": "\\u003c",
|
|
3194
|
-
"\u2028": "\\u2028",
|
|
3195
|
-
"\u2029": "\\u2029"
|
|
3196
|
-
}, jr = /[&><\u2028\u2029]/g;
|
|
3197
|
-
function Mr(e) {
|
|
3198
|
-
return e.replace(jr, (e) => Ar[e]);
|
|
3199
|
-
}
|
|
3200
|
-
function Nr(e, t) {
|
|
3238
|
+
function Pr(e, t) {
|
|
3201
3239
|
if (e === !1 || e == null) throw Error(t);
|
|
3202
3240
|
}
|
|
3203
|
-
function
|
|
3241
|
+
function Fr(e, t, n, r) {
|
|
3204
3242
|
let i = typeof e == "string" ? new URL(e, typeof window > "u" ? "server://singlefetch/" : window.location.origin) : e;
|
|
3205
|
-
return n ? i.pathname.endsWith("/") ?
|
|
3243
|
+
return i.pathname = n ? i.pathname.endsWith("/") ? `${i.pathname}_.${r}` : `${i.pathname}.${r}` : i.pathname === "/" ? `_root.${r}` : t && H(i.pathname, t) === "/" ? `${G(t)}/_root.${r}` : `${G(i.pathname)}.${r}`, i;
|
|
3206
3244
|
}
|
|
3207
|
-
async function
|
|
3245
|
+
async function Ir(e, t) {
|
|
3208
3246
|
if (e.id in t) return t[e.id];
|
|
3209
3247
|
try {
|
|
3210
3248
|
let n = await import(
|
|
@@ -3217,21 +3255,21 @@ async function Fr(e, t) {
|
|
|
3217
3255
|
return console.error(`Error loading route module \`${e.module}\`, reloading page...`), console.error(t), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {});
|
|
3218
3256
|
}
|
|
3219
3257
|
}
|
|
3220
|
-
function
|
|
3258
|
+
function Lr(e) {
|
|
3221
3259
|
return e != null && typeof e.page == "string";
|
|
3222
3260
|
}
|
|
3223
|
-
function
|
|
3261
|
+
function Rr(e) {
|
|
3224
3262
|
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";
|
|
3225
3263
|
}
|
|
3226
|
-
async function
|
|
3227
|
-
return
|
|
3264
|
+
async function zr(e, t, n) {
|
|
3265
|
+
return Wr((await Promise.all(e.map(async (e) => {
|
|
3228
3266
|
let r = t.routes[e.route.id];
|
|
3229
3267
|
if (r) {
|
|
3230
|
-
let e = await
|
|
3268
|
+
let e = await Ir(r, n);
|
|
3231
3269
|
return e.links ? e.links() : [];
|
|
3232
3270
|
}
|
|
3233
3271
|
return [];
|
|
3234
|
-
}))).flat(1).filter(
|
|
3272
|
+
}))).flat(1).filter(Rr).filter((e) => e.rel === "stylesheet" || e.rel === "preload").map((e) => e.rel === "stylesheet" ? {
|
|
3235
3273
|
...e,
|
|
3236
3274
|
rel: "prefetch",
|
|
3237
3275
|
as: "style"
|
|
@@ -3240,8 +3278,8 @@ async function Rr(e, t, n) {
|
|
|
3240
3278
|
rel: "prefetch"
|
|
3241
3279
|
}));
|
|
3242
3280
|
}
|
|
3243
|
-
function
|
|
3244
|
-
let o = (e, t) => n[t]
|
|
3281
|
+
function Br(e, t, n, r, i, a) {
|
|
3282
|
+
let o = (e, t) => !n[t] || e.route.id !== n[t].route.id, s = (e, t) => n[t].pathname !== e.pathname || n[t].route.path?.endsWith("*") && n[t].params["*"] !== e.params["*"];
|
|
3245
3283
|
return a === "assets" ? t.filter((e, t) => o(e, t) || s(e, t)) : a === "data" ? t.filter((t, a) => {
|
|
3246
3284
|
let c = r.routes[t.route.id];
|
|
3247
3285
|
if (!c || !c.hasLoader) return !1;
|
|
@@ -3259,49 +3297,49 @@ function zr(e, t, n, r, i, a) {
|
|
|
3259
3297
|
return !0;
|
|
3260
3298
|
}) : [];
|
|
3261
3299
|
}
|
|
3262
|
-
function
|
|
3263
|
-
return
|
|
3300
|
+
function Vr(e, t, { includeHydrateFallback: n } = {}) {
|
|
3301
|
+
return Hr(e.map((e) => {
|
|
3264
3302
|
let r = t.routes[e.route.id];
|
|
3265
3303
|
if (!r) return [];
|
|
3266
3304
|
let i = [r.module];
|
|
3267
3305
|
return r.clientActionModule && (i = i.concat(r.clientActionModule)), r.clientLoaderModule && (i = i.concat(r.clientLoaderModule)), n && r.hydrateFallbackModule && (i = i.concat(r.hydrateFallbackModule)), r.imports && (i = i.concat(r.imports)), i;
|
|
3268
3306
|
}).flat(1));
|
|
3269
3307
|
}
|
|
3270
|
-
function
|
|
3308
|
+
function Hr(e) {
|
|
3271
3309
|
return [...new Set(e)];
|
|
3272
3310
|
}
|
|
3273
|
-
function
|
|
3311
|
+
function Ur(e) {
|
|
3274
3312
|
let t = {}, n = Object.keys(e).sort();
|
|
3275
3313
|
for (let r of n) t[r] = e[r];
|
|
3276
3314
|
return t;
|
|
3277
3315
|
}
|
|
3278
|
-
function
|
|
3316
|
+
function Wr(e, t) {
|
|
3279
3317
|
let n = /* @__PURE__ */ new Set(), r = new Set(t);
|
|
3280
3318
|
return e.reduce((e, i) => {
|
|
3281
|
-
if (t && !
|
|
3282
|
-
let a = JSON.stringify(
|
|
3319
|
+
if (t && !Lr(i) && i.as === "script" && i.href && r.has(i.href)) return e;
|
|
3320
|
+
let a = JSON.stringify(Ur(i));
|
|
3283
3321
|
return n.has(a) || (n.add(a), e.push({
|
|
3284
3322
|
key: a,
|
|
3285
3323
|
link: i
|
|
3286
3324
|
})), e;
|
|
3287
3325
|
}, []);
|
|
3288
3326
|
}
|
|
3289
|
-
function Wr() {
|
|
3290
|
-
let t = e.useContext(fn);
|
|
3291
|
-
return Nr(t, "You must render this element inside a <DataRouterContext.Provider> element"), t;
|
|
3292
|
-
}
|
|
3293
3327
|
function Gr() {
|
|
3294
|
-
let t = e.useContext(
|
|
3295
|
-
return
|
|
3328
|
+
let t = e.useContext(_n);
|
|
3329
|
+
return Pr(t, "You must render this element inside a <DataRouterContext.Provider> element"), t;
|
|
3330
|
+
}
|
|
3331
|
+
function Kr() {
|
|
3332
|
+
let t = e.useContext(vn);
|
|
3333
|
+
return Pr(t, "You must render this element inside a <DataRouterStateContext.Provider> element"), t;
|
|
3296
3334
|
}
|
|
3297
|
-
var
|
|
3298
|
-
|
|
3299
|
-
function
|
|
3300
|
-
let t = e.useContext(
|
|
3301
|
-
return
|
|
3335
|
+
var qr = e.createContext(void 0);
|
|
3336
|
+
qr.displayName = "FrameworkContext";
|
|
3337
|
+
function Jr() {
|
|
3338
|
+
let t = e.useContext(qr);
|
|
3339
|
+
return Pr(t, "You must render this element inside a <HydratedRouter> element"), t;
|
|
3302
3340
|
}
|
|
3303
|
-
function
|
|
3304
|
-
let r = e.useContext(
|
|
3341
|
+
function Yr(t, n) {
|
|
3342
|
+
let r = e.useContext(qr), [i, a] = e.useState(!1), [o, s] = e.useState(!1), { onFocus: c, onBlur: l, onMouseEnter: u, onMouseLeave: d, onTouchStart: f } = n, p = e.useRef(null);
|
|
3305
3343
|
e.useEffect(() => {
|
|
3306
3344
|
if (t === "render" && s(!0), t === "viewport") {
|
|
3307
3345
|
let e = new IntersectionObserver((e) => {
|
|
@@ -3332,11 +3370,11 @@ function Jr(t, n) {
|
|
|
3332
3370
|
o,
|
|
3333
3371
|
p,
|
|
3334
3372
|
{
|
|
3335
|
-
onFocus:
|
|
3336
|
-
onBlur:
|
|
3337
|
-
onMouseEnter:
|
|
3338
|
-
onMouseLeave:
|
|
3339
|
-
onTouchStart:
|
|
3373
|
+
onFocus: Xr(c, m),
|
|
3374
|
+
onBlur: Xr(l, h),
|
|
3375
|
+
onMouseEnter: Xr(u, m),
|
|
3376
|
+
onMouseLeave: Xr(d, h),
|
|
3377
|
+
onTouchStart: Xr(f, m)
|
|
3340
3378
|
}
|
|
3341
3379
|
] : [
|
|
3342
3380
|
o,
|
|
@@ -3348,13 +3386,13 @@ function Jr(t, n) {
|
|
|
3348
3386
|
{}
|
|
3349
3387
|
];
|
|
3350
3388
|
}
|
|
3351
|
-
function
|
|
3389
|
+
function Xr(e, t) {
|
|
3352
3390
|
return (n) => {
|
|
3353
3391
|
e && e(n), n.defaultPrevented || t(n);
|
|
3354
3392
|
};
|
|
3355
3393
|
}
|
|
3356
|
-
function
|
|
3357
|
-
let r =
|
|
3394
|
+
function Zr({ page: t, ...n }) {
|
|
3395
|
+
let r = bn(), { nonce: i } = Jr(), { router: a } = Gr(), o = e.useMemo(() => j(a.routes, t, a.basename), [
|
|
3358
3396
|
a.routes,
|
|
3359
3397
|
t,
|
|
3360
3398
|
a.basename
|
|
@@ -3362,21 +3400,21 @@ function Xr({ page: t, ...n }) {
|
|
|
3362
3400
|
return o ? (n.nonce == null && i && (n = {
|
|
3363
3401
|
...n,
|
|
3364
3402
|
nonce: i
|
|
3365
|
-
}), r ? /* @__PURE__ */ e.createElement(
|
|
3403
|
+
}), r ? /* @__PURE__ */ e.createElement($r, {
|
|
3366
3404
|
page: t,
|
|
3367
3405
|
matches: o,
|
|
3368
3406
|
...n
|
|
3369
|
-
}) : /* @__PURE__ */ e.createElement(
|
|
3407
|
+
}) : /* @__PURE__ */ e.createElement(ei, {
|
|
3370
3408
|
page: t,
|
|
3371
3409
|
matches: o,
|
|
3372
3410
|
...n
|
|
3373
3411
|
})) : null;
|
|
3374
3412
|
}
|
|
3375
|
-
function
|
|
3376
|
-
let { manifest: n, routeModules: r } =
|
|
3413
|
+
function Qr(t) {
|
|
3414
|
+
let { manifest: n, routeModules: r } = Jr(), [i, a] = e.useState([]);
|
|
3377
3415
|
return e.useEffect(() => {
|
|
3378
3416
|
let e = !1;
|
|
3379
|
-
return
|
|
3417
|
+
return zr(t, n, r).then((t) => {
|
|
3380
3418
|
e || a(t);
|
|
3381
3419
|
}), () => {
|
|
3382
3420
|
e = !0;
|
|
@@ -3387,10 +3425,10 @@ function Zr(t) {
|
|
|
3387
3425
|
r
|
|
3388
3426
|
]), i;
|
|
3389
3427
|
}
|
|
3390
|
-
function
|
|
3391
|
-
let i = $(), { future: a } =
|
|
3428
|
+
function $r({ page: t, matches: n, ...r }) {
|
|
3429
|
+
let i = $(), { future: a } = Jr(), { basename: o } = Gr(), s = e.useMemo(() => {
|
|
3392
3430
|
if (t === i.pathname + i.search + i.hash) return [];
|
|
3393
|
-
let e =
|
|
3431
|
+
let e = Fr(t, o, a.v8_trailingSlashAwareDataRequests, "rsc"), r = !1, s = [];
|
|
3394
3432
|
for (let e of n) typeof e.route.shouldRevalidate == "function" ? r = !0 : s.push(e.route.id);
|
|
3395
3433
|
return r && s.length > 0 && e.searchParams.set("_routes", s.join(",")), [e.pathname + e.search];
|
|
3396
3434
|
}, [
|
|
@@ -3408,14 +3446,14 @@ function Qr({ page: t, matches: n, ...r }) {
|
|
|
3408
3446
|
...r
|
|
3409
3447
|
})));
|
|
3410
3448
|
}
|
|
3411
|
-
function
|
|
3412
|
-
let i = $(), { future: a, manifest: o, routeModules: s } =
|
|
3449
|
+
function ei({ page: t, matches: n, ...r }) {
|
|
3450
|
+
let i = $(), { future: a, manifest: o, routeModules: s } = Jr(), { basename: c } = Gr(), { loaderData: l, matches: u } = Kr(), d = e.useMemo(() => Br(t, n, u, o, i, "data"), [
|
|
3413
3451
|
t,
|
|
3414
3452
|
n,
|
|
3415
3453
|
u,
|
|
3416
3454
|
o,
|
|
3417
3455
|
i
|
|
3418
|
-
]), f = e.useMemo(() =>
|
|
3456
|
+
]), f = e.useMemo(() => Br(t, n, u, o, i, "assets"), [
|
|
3419
3457
|
t,
|
|
3420
3458
|
n,
|
|
3421
3459
|
u,
|
|
@@ -3428,7 +3466,7 @@ function $r({ page: t, matches: n, ...r }) {
|
|
|
3428
3466
|
let n = o.routes[t.route.id];
|
|
3429
3467
|
!n || !n.hasLoader || (!d.some((e) => e.route.id === t.route.id) && t.route.id in l && s[t.route.id]?.shouldRevalidate || n.hasClientLoader ? r = !0 : e.add(t.route.id));
|
|
3430
3468
|
}), e.size === 0) return [];
|
|
3431
|
-
let u =
|
|
3469
|
+
let u = Fr(t, c, a.v8_trailingSlashAwareDataRequests, "data");
|
|
3432
3470
|
return r && e.size > 0 && u.searchParams.set("_routes", n.filter((t) => e.has(t.route.id)).map((e) => e.route.id).join(",")), [u.pathname + u.search];
|
|
3433
3471
|
}, [
|
|
3434
3472
|
c,
|
|
@@ -3440,7 +3478,7 @@ function $r({ page: t, matches: n, ...r }) {
|
|
|
3440
3478
|
n,
|
|
3441
3479
|
t,
|
|
3442
3480
|
s
|
|
3443
|
-
]), m = e.useMemo(() =>
|
|
3481
|
+
]), m = e.useMemo(() => Vr(f, o), [f, o]), h = Qr(f);
|
|
3444
3482
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, p.map((t) => /* @__PURE__ */ e.createElement("link", {
|
|
3445
3483
|
key: t,
|
|
3446
3484
|
rel: "prefetch",
|
|
@@ -3459,7 +3497,7 @@ function $r({ page: t, matches: n, ...r }) {
|
|
|
3459
3497
|
crossOrigin: n.crossOrigin ?? r.crossOrigin
|
|
3460
3498
|
})));
|
|
3461
3499
|
}
|
|
3462
|
-
function
|
|
3500
|
+
function ti(...e) {
|
|
3463
3501
|
return (t) => {
|
|
3464
3502
|
e.forEach((e) => {
|
|
3465
3503
|
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
@@ -3467,39 +3505,39 @@ function ei(...e) {
|
|
|
3467
3505
|
};
|
|
3468
3506
|
}
|
|
3469
3507
|
e.Component;
|
|
3470
|
-
var
|
|
3508
|
+
var ni = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
|
|
3471
3509
|
try {
|
|
3472
|
-
|
|
3510
|
+
ni && (window.__reactRouterVersion = "7.18.3");
|
|
3473
3511
|
} catch {}
|
|
3474
|
-
function
|
|
3475
|
-
return
|
|
3512
|
+
function ri(e, t) {
|
|
3513
|
+
return at({
|
|
3476
3514
|
basename: t?.basename,
|
|
3477
3515
|
getContext: t?.getContext,
|
|
3478
3516
|
future: t?.future,
|
|
3479
3517
|
history: d({ window: t?.window }),
|
|
3480
|
-
hydrationData: t?.hydrationData ||
|
|
3518
|
+
hydrationData: t?.hydrationData || ii(),
|
|
3481
3519
|
routes: e,
|
|
3482
|
-
mapRouteProperties:
|
|
3483
|
-
hydrationRouteProperties:
|
|
3520
|
+
mapRouteProperties: fr,
|
|
3521
|
+
hydrationRouteProperties: pr,
|
|
3484
3522
|
dataStrategy: t?.dataStrategy,
|
|
3485
3523
|
patchRoutesOnNavigation: t?.patchRoutesOnNavigation,
|
|
3486
3524
|
window: t?.window,
|
|
3487
3525
|
instrumentations: t?.instrumentations
|
|
3488
3526
|
}).initialize();
|
|
3489
3527
|
}
|
|
3490
|
-
function
|
|
3528
|
+
function ii() {
|
|
3491
3529
|
let e = window?.__staticRouterHydrationData;
|
|
3492
3530
|
return e && e.errors && (e = {
|
|
3493
3531
|
...e,
|
|
3494
|
-
errors:
|
|
3532
|
+
errors: ai(e.errors)
|
|
3495
3533
|
}), e;
|
|
3496
3534
|
}
|
|
3497
|
-
function
|
|
3535
|
+
function ai(e) {
|
|
3498
3536
|
if (!e) return null;
|
|
3499
3537
|
let t = Object.entries(e), n = {};
|
|
3500
|
-
for (let [e, r] of t) if (r && r.__type === "RouteErrorResponse") n[e] = new
|
|
3538
|
+
for (let [e, r] of t) if (r && r.__type === "RouteErrorResponse") n[e] = new Se(r.status, r.statusText, r.data, r.internal === !0);
|
|
3501
3539
|
else if (r && r.__type === "Error") {
|
|
3502
|
-
if (typeof r.__subType == "string" &&
|
|
3540
|
+
if (typeof r.__subType == "string" && xe.includes(r.__subType)) {
|
|
3503
3541
|
let t = window[r.__subType];
|
|
3504
3542
|
if (typeof t == "function") try {
|
|
3505
3543
|
let i = new t(r.message);
|
|
@@ -3513,32 +3551,15 @@ function ii(e) {
|
|
|
3513
3551
|
} else n[e] = r;
|
|
3514
3552
|
return n;
|
|
3515
3553
|
}
|
|
3516
|
-
function ai({ basename: t, children: n, history: r, useTransitions: i }) {
|
|
3517
|
-
let [a, o] = e.useState({
|
|
3518
|
-
action: r.action,
|
|
3519
|
-
location: r.location
|
|
3520
|
-
}), s = e.useCallback((t) => {
|
|
3521
|
-
i === !1 ? o(t) : e.startTransition(() => o(t));
|
|
3522
|
-
}, [i]);
|
|
3523
|
-
return e.useLayoutEffect(() => r.listen(s), [r, s]), /* @__PURE__ */ e.createElement(gr, {
|
|
3524
|
-
basename: t,
|
|
3525
|
-
children: n,
|
|
3526
|
-
location: a.location,
|
|
3527
|
-
navigationType: a.action,
|
|
3528
|
-
navigator: r,
|
|
3529
|
-
useTransitions: i
|
|
3530
|
-
});
|
|
3531
|
-
}
|
|
3532
|
-
ai.displayName = "unstable_HistoryRouter";
|
|
3533
3554
|
var oi = e.forwardRef(function({ onClick: t, discover: n = "render", prefetch: r = "none", relative: i, reloadDocument: a, replace: s, mask: c, state: l, target: u, to: d, preventScrollReset: f, viewTransition: p, defaultShouldRevalidate: m, ...h }, g) {
|
|
3534
|
-
let { basename: _, navigator: v, useTransitions: y } = e.useContext(Z), b = typeof d == "string" && o.test(d), x =
|
|
3555
|
+
let { basename: _, navigator: v, useTransitions: y } = e.useContext(Z), b = typeof d == "string" && o.test(d), x = Ee(d, _);
|
|
3535
3556
|
d = x.to;
|
|
3536
|
-
let S =
|
|
3557
|
+
let S = jn(d, { relative: i }), C = $(), w = null;
|
|
3537
3558
|
if (c) {
|
|
3538
|
-
let e =
|
|
3539
|
-
_ !== "/" && (e.pathname = e.pathname === "/" ? _ :
|
|
3559
|
+
let e = ge(c, [], C.mask ? C.mask.pathname : "/", !0);
|
|
3560
|
+
_ !== "/" && (e.pathname = e.pathname === "/" ? _ : W([_, e.pathname])), w = v.createHref(e);
|
|
3540
3561
|
}
|
|
3541
|
-
let [T, E, D] =
|
|
3562
|
+
let [T, E, D] = Yr(r, h), O = di(d, {
|
|
3542
3563
|
replace: s,
|
|
3543
3564
|
mask: c,
|
|
3544
3565
|
state: l,
|
|
@@ -3557,16 +3578,16 @@ var oi = e.forwardRef(function({ onClick: t, discover: n = "render", prefetch: r
|
|
|
3557
3578
|
...D,
|
|
3558
3579
|
href: (A ? w : void 0) || x.absoluteURL || S,
|
|
3559
3580
|
onClick: A ? k : t,
|
|
3560
|
-
ref:
|
|
3581
|
+
ref: ti(g, E),
|
|
3561
3582
|
target: u,
|
|
3562
3583
|
"data-discover": !b && n === "render" ? "true" : void 0
|
|
3563
3584
|
});
|
|
3564
|
-
return T && !b ? /* @__PURE__ */ e.createElement(e.Fragment, null, j, /* @__PURE__ */ e.createElement(
|
|
3585
|
+
return T && !b ? /* @__PURE__ */ e.createElement(e.Fragment, null, j, /* @__PURE__ */ e.createElement(Zr, { page: S })) : j;
|
|
3565
3586
|
});
|
|
3566
3587
|
oi.displayName = "Link";
|
|
3567
3588
|
var si = e.forwardRef(function({ "aria-current": t = "page", caseSensitive: n = !1, className: r = "", end: i = !1, style: a, to: o, viewTransition: s, children: c, ...l }, u) {
|
|
3568
|
-
let d =
|
|
3569
|
-
n || (v = v.toLowerCase(), y = y ? y.toLowerCase() : null, _ = _.toLowerCase()), y && h && (y =
|
|
3589
|
+
let d = Vn(o, { relative: l.relative }), f = $(), p = e.useContext(vn), { navigator: m, basename: h } = e.useContext(Z), g = p != null && gi(d) && s === !0, _ = m.encodeLocation ? m.encodeLocation(d).pathname : d.pathname, v = f.pathname, y = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
|
|
3590
|
+
n || (v = v.toLowerCase(), y = y ? y.toLowerCase() : null, _ = _.toLowerCase()), y && h && (y = H(y, h) || y);
|
|
3570
3591
|
let b = _ !== "/" && _.endsWith("/") ? _.length - 1 : _.length, x = v === _ || !i && v.startsWith(_) && v.charAt(b) === "/", S = y != null && (y === _ || !i && y.startsWith(_) && y.charAt(_.length) === "/"), C = {
|
|
3571
3592
|
isActive: x,
|
|
3572
3593
|
isPending: S,
|
|
@@ -3590,8 +3611,8 @@ var si = e.forwardRef(function({ "aria-current": t = "page", caseSensitive: n =
|
|
|
3590
3611
|
}, typeof c == "function" ? c(C) : c);
|
|
3591
3612
|
});
|
|
3592
3613
|
si.displayName = "NavLink";
|
|
3593
|
-
var ci = e.forwardRef(({ discover: t = "render", fetcherKey: n, navigate: r, reloadDocument: i, replace: a, state: s, method: c =
|
|
3594
|
-
let { useTransitions: _ } = e.useContext(Z), v =
|
|
3614
|
+
var ci = e.forwardRef(({ discover: t = "render", fetcherKey: n, navigate: r, reloadDocument: i, replace: a, state: s, method: c = xr, action: l, onSubmit: u, relative: d, preventScrollReset: f, viewTransition: p, defaultShouldRevalidate: m, ...h }, g) => {
|
|
3615
|
+
let { useTransitions: _ } = e.useContext(Z), v = mi(), y = hi(l, { relative: d }), b = c.toLowerCase() === "get" ? "get" : "post", x = typeof l == "string" && o.test(l);
|
|
3595
3616
|
return /* @__PURE__ */ e.createElement("form", {
|
|
3596
3617
|
ref: g,
|
|
3597
3618
|
method: b,
|
|
@@ -3617,52 +3638,17 @@ var ci = e.forwardRef(({ discover: t = "render", fetcherKey: n, navigate: r, rel
|
|
|
3617
3638
|
});
|
|
3618
3639
|
});
|
|
3619
3640
|
ci.displayName = "Form";
|
|
3620
|
-
function li(
|
|
3621
|
-
let i = e.useContext(Kr), { basename: a } = e.useContext(Z), o = $(), s = Qn();
|
|
3622
|
-
xi({
|
|
3623
|
-
getKey: t,
|
|
3624
|
-
storageKey: n
|
|
3625
|
-
});
|
|
3626
|
-
let c = e.useMemo(() => {
|
|
3627
|
-
if (!i || !t) return null;
|
|
3628
|
-
let e = bi(o, s, a, t);
|
|
3629
|
-
return e === o.key ? null : e;
|
|
3630
|
-
}, []);
|
|
3631
|
-
if (!i || i.isSpaMode) return null;
|
|
3632
|
-
let l = ((e, t) => {
|
|
3633
|
-
if (!window.history.state || !window.history.state.key) {
|
|
3634
|
-
let e = Math.random().toString(32).slice(2);
|
|
3635
|
-
window.history.replaceState({ key: e }, "");
|
|
3636
|
-
}
|
|
3637
|
-
try {
|
|
3638
|
-
let n = JSON.parse(sessionStorage.getItem(e) || "{}")[t || window.history.state.key];
|
|
3639
|
-
typeof n == "number" && window.scrollTo(0, n);
|
|
3640
|
-
} catch (t) {
|
|
3641
|
-
console.error(t), sessionStorage.removeItem(e);
|
|
3642
|
-
}
|
|
3643
|
-
}).toString();
|
|
3644
|
-
return r.nonce == null && i?.nonce && (r.nonce = i.nonce), /* @__PURE__ */ e.createElement("script", {
|
|
3645
|
-
...r,
|
|
3646
|
-
suppressHydrationWarning: !0,
|
|
3647
|
-
dangerouslySetInnerHTML: { __html: `(${l})(${Mr(JSON.stringify(n || vi))}, ${Mr(JSON.stringify(c))})` }
|
|
3648
|
-
});
|
|
3649
|
-
}
|
|
3650
|
-
li.displayName = "ScrollRestoration";
|
|
3651
|
-
function ui(e) {
|
|
3641
|
+
function li(e) {
|
|
3652
3642
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
3653
3643
|
}
|
|
3654
|
-
function
|
|
3655
|
-
let n = e.useContext(
|
|
3656
|
-
return f(n,
|
|
3657
|
-
}
|
|
3658
|
-
function fi(t) {
|
|
3659
|
-
let n = e.useContext(pn);
|
|
3660
|
-
return f(n, ui(t)), n;
|
|
3644
|
+
function ui(t) {
|
|
3645
|
+
let n = e.useContext(_n);
|
|
3646
|
+
return f(n, li(t)), n;
|
|
3661
3647
|
}
|
|
3662
|
-
function
|
|
3663
|
-
let d =
|
|
3648
|
+
function di(t, { target: n, replace: r, mask: i, state: a, preventScrollReset: o, relative: s, viewTransition: c, defaultShouldRevalidate: l, useTransitions: u } = {}) {
|
|
3649
|
+
let d = In(), f = $(), p = Vn(t, { relative: s });
|
|
3664
3650
|
return e.useCallback((m) => {
|
|
3665
|
-
if (
|
|
3651
|
+
if (Or(m, n)) {
|
|
3666
3652
|
m.preventDefault();
|
|
3667
3653
|
let n = r === void 0 ? _(f) === _(p) : r, h = () => d(t, {
|
|
3668
3654
|
replace: n,
|
|
@@ -3691,20 +3677,23 @@ function pi(t, { target: n, replace: r, mask: i, state: a, preventScrollReset: o
|
|
|
3691
3677
|
u
|
|
3692
3678
|
]);
|
|
3693
3679
|
}
|
|
3694
|
-
var
|
|
3695
|
-
function
|
|
3696
|
-
let { router: t } =
|
|
3680
|
+
var fi = 0, pi = () => `__${String(++fi)}__`;
|
|
3681
|
+
function mi() {
|
|
3682
|
+
let { router: t } = ui("useSubmit"), { basename: n } = e.useContext(Z), r = tr(), i = t.fetch, a = t.navigate;
|
|
3697
3683
|
return e.useCallback(async (e, t = {}) => {
|
|
3698
|
-
let { action: o, method: s, encType: c, formData: l, body: u } =
|
|
3699
|
-
t.navigate === !1
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3684
|
+
let { action: o, method: s, encType: c, formData: l, body: u } = Nr(e, n);
|
|
3685
|
+
if (t.navigate === !1) {
|
|
3686
|
+
let e = t.fetcherKey || pi();
|
|
3687
|
+
await i(e, r, t.action || o, {
|
|
3688
|
+
defaultShouldRevalidate: t.defaultShouldRevalidate,
|
|
3689
|
+
preventScrollReset: t.preventScrollReset,
|
|
3690
|
+
formData: l,
|
|
3691
|
+
body: u,
|
|
3692
|
+
formMethod: t.method || s,
|
|
3693
|
+
formEncType: t.encType || c,
|
|
3694
|
+
flushSync: t.flushSync
|
|
3695
|
+
});
|
|
3696
|
+
} else await a(t.action || o, {
|
|
3708
3697
|
defaultShouldRevalidate: t.defaultShouldRevalidate,
|
|
3709
3698
|
preventScrollReset: t.preventScrollReset,
|
|
3710
3699
|
formData: l,
|
|
@@ -3724,10 +3713,10 @@ function gi() {
|
|
|
3724
3713
|
r
|
|
3725
3714
|
]);
|
|
3726
3715
|
}
|
|
3727
|
-
function
|
|
3716
|
+
function hi(t, { relative: n } = {}) {
|
|
3728
3717
|
let { basename: r } = e.useContext(Z), i = e.useContext(Q);
|
|
3729
3718
|
f(i, "useFormAction must be used inside a RouteContext");
|
|
3730
|
-
let [a] = i.matches.slice(-1), o = { ...
|
|
3719
|
+
let [a] = i.matches.slice(-1), o = { ...Vn(t || ".", { relative: n }) }, s = $();
|
|
3731
3720
|
if (t == null) {
|
|
3732
3721
|
o.search = s.search;
|
|
3733
3722
|
let e = new URLSearchParams(o.search), t = e.getAll("index");
|
|
@@ -3737,93 +3726,17 @@ function _i(t, { relative: n } = {}) {
|
|
|
3737
3726
|
o.search = n ? `?${n}` : "";
|
|
3738
3727
|
}
|
|
3739
3728
|
}
|
|
3740
|
-
return (!t || t === ".") && a.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (o.pathname = o.pathname === "/" ? r :
|
|
3741
|
-
}
|
|
3742
|
-
var vi = "react-router-scroll-positions", yi = {};
|
|
3743
|
-
function bi(e, t, n, r) {
|
|
3744
|
-
let i = null;
|
|
3745
|
-
return r && (i = r(n === "/" ? e : {
|
|
3746
|
-
...e,
|
|
3747
|
-
pathname: B(e.pathname, n) || e.pathname
|
|
3748
|
-
}, t)), i ??= e.key, i;
|
|
3749
|
-
}
|
|
3750
|
-
function xi({ getKey: t, storageKey: n } = {}) {
|
|
3751
|
-
let { router: r } = di("useScrollRestoration"), { restoreScrollPosition: i, preventScrollReset: a } = fi("useScrollRestoration"), { basename: o } = e.useContext(Z), s = $(), c = Qn(), l = Zn();
|
|
3752
|
-
e.useEffect(() => (window.history.scrollRestoration = "manual", () => {
|
|
3753
|
-
window.history.scrollRestoration = "auto";
|
|
3754
|
-
}), []), Si(e.useCallback(() => {
|
|
3755
|
-
if (l.state === "idle") {
|
|
3756
|
-
let e = bi(s, c, o, t);
|
|
3757
|
-
yi[e] = window.scrollY;
|
|
3758
|
-
}
|
|
3759
|
-
try {
|
|
3760
|
-
sessionStorage.setItem(n || vi, JSON.stringify(yi));
|
|
3761
|
-
} catch (e) {
|
|
3762
|
-
p(!1, `Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`);
|
|
3763
|
-
}
|
|
3764
|
-
window.history.scrollRestoration = "auto";
|
|
3765
|
-
}, [
|
|
3766
|
-
l.state,
|
|
3767
|
-
t,
|
|
3768
|
-
o,
|
|
3769
|
-
s,
|
|
3770
|
-
c,
|
|
3771
|
-
n
|
|
3772
|
-
])), typeof document < "u" && (e.useLayoutEffect(() => {
|
|
3773
|
-
try {
|
|
3774
|
-
let e = sessionStorage.getItem(n || vi);
|
|
3775
|
-
e && (yi = JSON.parse(e));
|
|
3776
|
-
} catch {}
|
|
3777
|
-
}, [n]), e.useLayoutEffect(() => {
|
|
3778
|
-
let e = r?.enableScrollRestoration(yi, () => window.scrollY, t ? (e, n) => bi(e, n, o, t) : void 0);
|
|
3779
|
-
return () => e && e();
|
|
3780
|
-
}, [
|
|
3781
|
-
r,
|
|
3782
|
-
o,
|
|
3783
|
-
t
|
|
3784
|
-
]), e.useLayoutEffect(() => {
|
|
3785
|
-
if (i !== !1) {
|
|
3786
|
-
if (typeof i == "number") {
|
|
3787
|
-
window.scrollTo(0, i);
|
|
3788
|
-
return;
|
|
3789
|
-
}
|
|
3790
|
-
try {
|
|
3791
|
-
if (s.hash) {
|
|
3792
|
-
let e = document.getElementById(decodeURIComponent(s.hash.slice(1)));
|
|
3793
|
-
if (e) {
|
|
3794
|
-
e.scrollIntoView();
|
|
3795
|
-
return;
|
|
3796
|
-
}
|
|
3797
|
-
}
|
|
3798
|
-
} catch {
|
|
3799
|
-
p(!1, `"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`);
|
|
3800
|
-
}
|
|
3801
|
-
a !== !0 && window.scrollTo(0, 0);
|
|
3802
|
-
}
|
|
3803
|
-
}, [
|
|
3804
|
-
s,
|
|
3805
|
-
i,
|
|
3806
|
-
a
|
|
3807
|
-
]));
|
|
3808
|
-
}
|
|
3809
|
-
function Si(t, n) {
|
|
3810
|
-
let { capture: r } = n || {};
|
|
3811
|
-
e.useEffect(() => {
|
|
3812
|
-
let e = r == null ? void 0 : { capture: r };
|
|
3813
|
-
return window.addEventListener("pagehide", t, e), () => {
|
|
3814
|
-
window.removeEventListener("pagehide", t, e);
|
|
3815
|
-
};
|
|
3816
|
-
}, [t, r]);
|
|
3729
|
+
return (!t || t === ".") && a.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (o.pathname = o.pathname === "/" ? r : W([r, o.pathname])), _(o);
|
|
3817
3730
|
}
|
|
3818
|
-
function
|
|
3819
|
-
let r = e.useContext(
|
|
3731
|
+
function gi(t, { relative: n } = {}) {
|
|
3732
|
+
let r = e.useContext(xn);
|
|
3820
3733
|
f(r != null, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");
|
|
3821
|
-
let { basename: i } =
|
|
3734
|
+
let { basename: i } = ui("useViewTransitionState"), a = Vn(t, { relative: n });
|
|
3822
3735
|
if (!r.isTransitioning) return !1;
|
|
3823
|
-
let o =
|
|
3824
|
-
return
|
|
3736
|
+
let o = H(r.currentLocation.pathname, i) || r.currentLocation.pathname, s = H(r.nextLocation.pathname, i) || r.nextLocation.pathname;
|
|
3737
|
+
return se(a.pathname, s) != null || se(a.pathname, o) != null;
|
|
3825
3738
|
}
|
|
3826
3739
|
//#endregion
|
|
3827
|
-
export { x as a, $ as c,
|
|
3740
|
+
export { x as a, $ as c, Bn as d, rr as f, ri as i, Nn as l, yr as n, Ce as o, hr as r, U as s, si as t, nr as u };
|
|
3828
3741
|
|
|
3829
|
-
//# sourceMappingURL=chunk-
|
|
3742
|
+
//# sourceMappingURL=chunk-BV7QT456.js.map
|