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