@gen-epix/ui-client-common 4.3.0 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/_chunks/Breadcrumbs.js +22 -22
  2. package/dist/_chunks/QueryClientProvider.js +1 -1
  3. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  4. package/dist/_chunks/QueryClientService.js +4 -5
  5. package/dist/_chunks/QueryClientService.js.map +1 -1
  6. package/dist/_chunks/Table.js +559 -3173
  7. package/dist/_chunks/Table.js.map +1 -1
  8. package/dist/_chunks/{oidc-client-ts.js → UserManagerUtil.js} +222 -198
  9. package/dist/_chunks/UserManagerUtil.js.map +1 -0
  10. package/dist/_chunks/middleware.js +1 -1
  11. package/dist/_chunks/middleware.js.map +1 -1
  12. package/dist/_chunks/omit.js +1 -1
  13. package/dist/_chunks/omit.js.map +1 -1
  14. package/dist/_chunks/query.js +7 -7
  15. package/dist/_chunks/query.js.map +1 -1
  16. package/dist/_chunks/react.js +1 -1
  17. package/dist/_chunks/react.js.map +1 -1
  18. package/dist/_chunks/useColumnsMenu.js +2 -2
  19. package/dist/_chunks/useColumnsMenu.js.map +1 -1
  20. package/dist/_chunks/useMutation.js +2 -2
  21. package/dist/_chunks/useMutation.js.map +1 -1
  22. package/dist/_chunks/useQueryMemo.js +6 -6
  23. package/dist/_chunks/useQueryMemo.js.map +1 -1
  24. package/dist/_chunks/vanilla.js +1 -1
  25. package/dist/_chunks/vanilla.js.map +1 -1
  26. package/dist/_chunks/yup.js +2 -2
  27. package/dist/_chunks/yup.js.map +1 -1
  28. package/dist/classes/services/LogService/index.js +1 -1
  29. package/dist/classes/services/LogService/index.js.map +1 -1
  30. package/dist/classes/services/RouterService/index.js +4 -4
  31. package/dist/components/app/App/App.d.ts +1 -1
  32. package/dist/components/app/App/index.js +35 -100
  33. package/dist/components/app/App/index.js.map +1 -1
  34. package/dist/components/app/AppRouterProvider/AppRouterProvider.d.ts +1 -1
  35. package/dist/components/app/AuthenticationWrapper/AuthenticationWrapper.d.ts +1 -1
  36. package/dist/components/app/AuthenticationWrapper/index.js +38 -38
  37. package/dist/components/app/AuthorizationWrapper/index.js +20 -20
  38. package/dist/components/app/RouterRoot/RouterRoot.d.ts +1 -1
  39. package/dist/components/app/RouterRoot/index.js +58 -59
  40. package/dist/components/app/RouterRoot/index.js.map +1 -1
  41. package/dist/components/filters/BooleanFilterField/BooleanFilterField.d.ts +1 -1
  42. package/dist/components/filters/DateFilterField/DateFilterField.d.ts +1 -1
  43. package/dist/components/filters/GeoFilterField/GeoFilterField.d.ts +1 -1
  44. package/dist/components/filters/MultiSelectFilterField/MultiSelectFilterField.d.ts +1 -1
  45. package/dist/components/filters/NumberRangeFilterField/NumberRangeFilterField.d.ts +1 -1
  46. package/dist/components/filters/TextFilterField/TextFilterField.d.ts +1 -1
  47. package/dist/components/ui/ApplicationBar/ApplicationBar.d.ts +1 -1
  48. package/dist/components/ui/ApplicationBar/ApplicationBarActions.d.ts +1 -1
  49. package/dist/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.d.ts +1 -1
  50. package/dist/components/ui/ApplicationBar/ApplicationBarActionsInfotem.d.ts +1 -1
  51. package/dist/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.d.ts +1 -1
  52. package/dist/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.d.ts +1 -1
  53. package/dist/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.d.ts +1 -1
  54. package/dist/components/ui/ApplicationBar/ApplicationBarActionsUserItem.d.ts +1 -1
  55. package/dist/components/ui/ApplicationBar/ApplicationBarNavigationMenu.d.ts +1 -1
  56. package/dist/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.d.ts +1 -1
  57. package/dist/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.d.ts +1 -1
  58. package/dist/components/ui/ApplicationBar/index.js +146 -146
  59. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  60. package/dist/components/ui/ApplicationFooter/ApplicationFooter.d.ts +1 -1
  61. package/dist/components/ui/ApplicationFooter/ApplicationFooterLink.d.ts +1 -1
  62. package/dist/components/ui/ApplicationFooter/ApplicationFooterLinkSection.d.ts +1 -1
  63. package/dist/components/ui/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  64. package/dist/components/ui/GenericErrorMessage/GenericErrorMessage.d.ts +1 -1
  65. package/dist/components/ui/GenericErrorMessage/index.js +34 -34
  66. package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
  67. package/dist/components/ui/NavLink/NavLink.d.ts +1 -1
  68. package/dist/components/ui/NavLink/index.js +8 -8
  69. package/dist/components/ui/Notifications/NotificationItem.d.ts +1 -1
  70. package/dist/components/ui/Notifications/NotificationsDrawer.d.ts +1 -1
  71. package/dist/components/ui/OutageList/OutageItem.d.ts +1 -1
  72. package/dist/components/ui/OutageList/OutageList.d.ts +1 -1
  73. package/dist/components/ui/OutageList/OutageSection.d.ts +1 -1
  74. package/dist/components/ui/PageContainer/index.js +1 -1
  75. package/dist/components/ui/PageContainer/index.js.map +1 -1
  76. package/dist/components/ui/Sidebar/SidebarItem.d.ts +1 -1
  77. package/dist/components/ui/Sidebar/SidebarMenu.d.ts +1 -1
  78. package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +1 -1
  79. package/dist/components/ui/SortableList/SortableList.d.ts +1 -1
  80. package/dist/components/ui/SortableList/SortableListItem.d.ts +1 -1
  81. package/dist/components/ui/SortableList/SortableListItemDragHandle.d.ts +1 -1
  82. package/dist/components/ui/SortableList/SortableOverlay.d.ts +1 -1
  83. package/dist/components/ui/SortableList/context/SortableListItemContextProvider.d.ts +1 -1
  84. package/dist/components/ui/Table/Table.d.ts +1 -1
  85. package/dist/components/ui/Table/TableActionsCell.d.ts +1 -1
  86. package/dist/components/ui/Table/TableCaption.d.ts +1 -1
  87. package/dist/components/ui/Table/TableCell.d.ts +1 -1
  88. package/dist/components/ui/Table/TableCellAsyncContent.d.ts +1 -1
  89. package/dist/components/ui/Table/TableCheckboxCell.d.ts +1 -1
  90. package/dist/components/ui/Table/TableCheckboxHeader.d.ts +1 -1
  91. package/dist/components/ui/Table/TableFilter.d.ts +1 -1
  92. package/dist/components/ui/Table/TableFiltersSidebarItem.d.ts +2 -2
  93. package/dist/components/ui/Table/TableHeader.d.ts +1 -1
  94. package/dist/components/ui/Table/TableHeaderCell.d.ts +1 -1
  95. package/dist/components/ui/Table/TableHeaderFilter.d.ts +1 -1
  96. package/dist/components/ui/Table/TableMenu.d.ts +1 -1
  97. package/dist/components/ui/Table/TableReadableIndexCell.d.ts +1 -1
  98. package/dist/components/ui/Table/TableSidebarMenu.d.ts +1 -1
  99. package/dist/components/ui/UserInactivityConfirmation/UserInactivityConfirmation.d.ts +1 -1
  100. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +1 -1
  101. package/dist/hoc/withPermissions/withPermissions.d.ts +1 -1
  102. package/dist/pages/AcceptInvitationPage/AcceptInvitationPage.d.ts +1 -1
  103. package/dist/pages/AcceptInvitationPage/index.js +28 -28
  104. package/dist/pages/AdminPage/AdminPage.d.ts +1 -1
  105. package/dist/pages/AdminPage/index.js +23 -23
  106. package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +1 -1
  107. package/dist/pages/CrudPage/CrudPage.d.ts +1 -1
  108. package/dist/pages/ErrorPage/ErrorPage.d.ts +1 -1
  109. package/dist/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.d.ts +1 -1
  110. package/dist/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.d.ts +1 -1
  111. package/dist/pages/OrganizationContactsAdminPage/OrganizationContactsAdminPage.d.ts +1 -1
  112. package/dist/pages/OrganizationContactsAdminPage/index.js +29 -29
  113. package/dist/pages/OrganizationSitesAdminPage/OrganizationSitesAdminPage.d.ts +1 -1
  114. package/dist/pages/OrganizationSitesAdminPage/index.js +25 -25
  115. package/dist/pages/OrganizationsAdminPage/OrganizationsAdminPage.d.ts +1 -1
  116. package/dist/pages/OutagesAdminPage/OutagesAdminPage.d.ts +1 -1
  117. package/dist/pages/PostLoginPage/PostLoginPage.d.ts +1 -1
  118. package/dist/pages/PostLoginPage/index.js +11 -11
  119. package/dist/pages/PostLogoutPage/PostLogoutPage.d.ts +1 -1
  120. package/dist/pages/RouterErrorPage/RouterErrorPage.d.ts +1 -1
  121. package/dist/pages/RouterErrorPage/index.js +10 -10
  122. package/dist/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.d.ts +1 -1
  123. package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +1 -1
  124. package/dist/stores/tableStore/TableStoreContextProvider.d.ts +1 -1
  125. package/dist/utils/UserManagerUtil/index.js +2 -31
  126. package/package.json +27 -22
  127. package/dist/_chunks/chunk-OB3PAWPO.js +0 -3742
  128. package/dist/_chunks/chunk-OB3PAWPO.js.map +0 -1
  129. package/dist/_chunks/oidc-client-ts.js.map +0 -1
  130. package/dist/_chunks/react-oidc-context.js +0 -201
  131. package/dist/_chunks/react-oidc-context.js.map +0 -1
  132. package/dist/utils/UserManagerUtil/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["createContext","y","f","d"],"sources":["../../../../../../node_modules/.pnpm/react-router@7.18.4_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/react-router/dist/development/dom-export.mjs","../../../../../../node_modules/.pnpm/react-error-boundary@6.1.5_@types+react@19.3.0_react@19.3.0/node_modules/react-error-boundary/dist/react-error-boundary.js","../../../../src/components/app/AppRouterProvider/AppRouterProvider.tsx","../../../../src/components/app/App/App.tsx"],"sourcesContent":["/**\n * react-router v7.18.4\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\n\"use client\";\nimport {\n RSCRouterGlobalErrorBoundary,\n getHydrationData,\n populateRSCRouteModules\n} from \"./chunk-H4DAEOV7.mjs\";\nimport {\n CRITICAL_CSS_DATA_ATTRIBUTE,\n ErrorResponseImpl,\n FrameworkContext,\n PROTOCOL_RELATIVE_URL_REGEX,\n RSCRouterContext,\n RemixErrorBoundary,\n RouterProvider,\n URL_LIMIT,\n createBrowserHistory,\n createClientRoutes,\n createClientRoutesWithHMRRevalidationOptOut,\n createContext,\n createRequestInit,\n createRouter,\n decodeViaTurboStream,\n getPatchRoutesOnNavigationFunction,\n getPathsWithAncestors,\n getSingleFetchDataStrategyImpl,\n getTurboStreamSingleFetchDataStrategy,\n hasInvalidProtocol,\n hydrationRouteProperties,\n invariant,\n isMutationMethod,\n mapRouteProperties,\n noActionDefinedError,\n resolvePath,\n setIsHydrated,\n shouldHydrateRouteLoader,\n singleFetchUrl,\n stripIndexParam,\n useFogOFWarDiscovery,\n validateNavigationTarget\n} from \"./chunk-OB3PAWPO.mjs\";\n\n// lib/dom-export/dom-router-provider.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nfunction RouterProvider2(props) {\n return /* @__PURE__ */ React.createElement(RouterProvider, { flushSync: ReactDOM.flushSync, ...props });\n}\n\n// lib/dom-export/hydrated-router.tsx\nimport * as React2 from \"react\";\nvar ssrInfo = null;\nvar router = null;\nfunction initSsrInfo() {\n if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {\n if (window.__reactRouterManifest.sri === true) {\n const importMap = document.querySelector(\"script[rr-importmap]\");\n if (importMap?.textContent) {\n try {\n window.__reactRouterManifest.sri = JSON.parse(\n importMap.textContent\n ).integrity;\n } catch (err) {\n console.error(\"Failed to parse import map\", err);\n }\n }\n }\n ssrInfo = {\n context: window.__reactRouterContext,\n manifest: window.__reactRouterManifest,\n routeModules: window.__reactRouterRouteModules,\n stateDecodingPromise: void 0,\n router: void 0,\n routerInitialized: false\n };\n }\n}\nfunction createHydratedRouter({\n getContext,\n instrumentations\n}) {\n initSsrInfo();\n if (!ssrInfo) {\n throw new Error(\n \"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`\"\n );\n }\n let localSsrInfo = ssrInfo;\n if (!ssrInfo.stateDecodingPromise) {\n let stream = ssrInfo.context.stream;\n invariant(stream, \"No stream found for single fetch decoding\");\n ssrInfo.context.stream = void 0;\n ssrInfo.stateDecodingPromise = decodeViaTurboStream(stream, window).then((value) => {\n ssrInfo.context.state = value.value;\n localSsrInfo.stateDecodingPromise.value = true;\n }).catch((e) => {\n localSsrInfo.stateDecodingPromise.error = e;\n });\n }\n if (ssrInfo.stateDecodingPromise.error) {\n throw ssrInfo.stateDecodingPromise.error;\n }\n if (!ssrInfo.stateDecodingPromise.value) {\n throw ssrInfo.stateDecodingPromise;\n }\n let routes = createClientRoutes(\n ssrInfo.manifest.routes,\n ssrInfo.routeModules,\n ssrInfo.context.state,\n ssrInfo.context.ssr,\n ssrInfo.context.isSpaMode\n );\n let hydrationData = void 0;\n if (ssrInfo.context.isSpaMode) {\n let { loaderData } = ssrInfo.context.state;\n if (ssrInfo.manifest.routes.root?.hasLoader && loaderData && \"root\" in loaderData) {\n hydrationData = {\n loaderData: {\n root: loaderData.root\n }\n };\n }\n } else {\n hydrationData = getHydrationData({\n state: ssrInfo.context.state,\n routes,\n getRouteInfo: (routeId) => ({\n clientLoader: ssrInfo.routeModules[routeId]?.clientLoader,\n hasLoader: ssrInfo.manifest.routes[routeId]?.hasLoader === true,\n hasHydrateFallback: ssrInfo.routeModules[routeId]?.HydrateFallback != null\n }),\n location: window.location,\n basename: window.__reactRouterContext?.basename,\n isSpaMode: ssrInfo.context.isSpaMode\n });\n }\n if (window.history.state && window.history.state.masked) {\n window.history.replaceState(\n { ...window.history.state, masked: void 0 },\n \"\"\n );\n }\n let router2 = createRouter({\n routes,\n history: createBrowserHistory(),\n basename: ssrInfo.context.basename,\n getContext,\n hydrationData,\n hydrationRouteProperties,\n instrumentations,\n mapRouteProperties,\n future: {\n v8_passThroughRequests: ssrInfo.context.future.v8_passThroughRequests\n },\n dataStrategy: getTurboStreamSingleFetchDataStrategy(\n () => router2,\n ssrInfo.manifest,\n ssrInfo.routeModules,\n ssrInfo.context.ssr,\n ssrInfo.context.basename,\n ssrInfo.context.future.v8_trailingSlashAwareDataRequests\n ),\n patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(\n () => router2,\n ssrInfo.manifest,\n ssrInfo.routeModules,\n ssrInfo.context.ssr,\n ssrInfo.context.routeDiscovery,\n ssrInfo.context.isSpaMode,\n ssrInfo.context.basename\n )\n });\n ssrInfo.router = router2;\n if (router2.state.initialized) {\n ssrInfo.routerInitialized = true;\n router2.initialize();\n }\n router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */\n createClientRoutesWithHMRRevalidationOptOut;\n window.__reactRouterDataRouter = router2;\n return router2;\n}\nfunction HydratedRouter(props) {\n if (!router) {\n router = createHydratedRouter({\n getContext: props.getContext,\n instrumentations: props.instrumentations\n });\n }\n let [criticalCss, setCriticalCss] = React2.useState(\n process.env.NODE_ENV === \"development\" ? ssrInfo?.context.criticalCss : void 0\n );\n React2.useEffect(() => {\n if (process.env.NODE_ENV === \"development\") {\n setCriticalCss(void 0);\n }\n }, []);\n React2.useEffect(() => {\n if (process.env.NODE_ENV === \"development\" && criticalCss === void 0) {\n document.querySelectorAll(`[${CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());\n }\n }, [criticalCss]);\n let [location2, setLocation] = React2.useState(router.state.location);\n React2.useLayoutEffect(() => {\n if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {\n ssrInfo.routerInitialized = true;\n ssrInfo.router.initialize();\n }\n }, []);\n React2.useLayoutEffect(() => {\n if (ssrInfo && ssrInfo.router) {\n return ssrInfo.router.subscribe((newState) => {\n if (newState.location !== location2) {\n setLocation(newState.location);\n }\n });\n }\n }, [location2]);\n invariant(ssrInfo, \"ssrInfo unavailable for HydratedRouter\");\n useFogOFWarDiscovery(\n router,\n ssrInfo.manifest,\n ssrInfo.routeModules,\n ssrInfo.context.ssr,\n ssrInfo.context.routeDiscovery,\n ssrInfo.context.isSpaMode\n );\n return (\n // This fragment is important to ensure we match the <ServerRouter> JSX\n // structure so that useId values hydrate correctly\n /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(\n FrameworkContext.Provider,\n {\n value: {\n manifest: ssrInfo.manifest,\n routeModules: ssrInfo.routeModules,\n future: ssrInfo.context.future,\n criticalCss,\n ssr: ssrInfo.context.ssr,\n isSpaMode: ssrInfo.context.isSpaMode,\n routeDiscovery: ssrInfo.context.routeDiscovery\n }\n },\n /* @__PURE__ */ React2.createElement(RemixErrorBoundary, { location: location2 }, /* @__PURE__ */ React2.createElement(\n RouterProvider2,\n {\n router,\n useTransitions: props.useTransitions,\n onError: props.onError\n }\n ))\n ), /* @__PURE__ */ React2.createElement(React2.Fragment, null))\n );\n}\n\n// lib/rsc/browser.tsx\nimport * as React3 from \"react\";\nimport * as ReactDOM2 from \"react-dom\";\nvar defaultManifestPath = \"/__manifest\";\nfunction createCallServer({\n createFromReadableStream,\n createTemporaryReferenceSet,\n encodeReply,\n fetch: fetchImplementation = fetch\n}) {\n const globalVar = window;\n let landedActionId = 0;\n return async (id, args) => {\n let actionId = globalVar.__routerActionID = (globalVar.__routerActionID ?? (globalVar.__routerActionID = 0)) + 1;\n const temporaryReferences = createTemporaryReferenceSet();\n const payloadPromise = fetchImplementation(\n new Request(location.href, {\n body: await encodeReply(args, { temporaryReferences }),\n method: \"POST\",\n headers: {\n Accept: \"text/x-component\",\n \"rsc-action-id\": id\n }\n })\n ).then((response) => {\n if (!response.body) {\n throw new Error(\"No response body\");\n }\n return createFromReadableStream(response.body, {\n temporaryReferences\n });\n });\n React3.startTransition(\n () => (\n // @ts-expect-error - Needs React 19 types\n Promise.resolve(payloadPromise).then(async (payload) => {\n if (payload.type === \"redirect\") {\n let location2 = normalizeRedirectLocation(payload.location);\n validateNavigationTarget(\n payload.location,\n location2,\n new URL(window.location.href),\n \"allow-explicit\"\n );\n if (payload.reload || isExternalLocation(location2)) {\n if (hasInvalidProtocol(location2)) {\n throw new Error(\"Invalid redirect location\");\n }\n window.location.href = location2;\n return;\n }\n React3.startTransition(() => {\n globalVar.__reactRouterDataRouter.navigate(location2, {\n replace: payload.replace\n });\n });\n return;\n }\n if (payload.type !== \"action\") {\n throw new Error(\"Unexpected payload type\");\n }\n const rerender = await payload.rerender;\n if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {\n if (rerender.type === \"redirect\") {\n let location2 = normalizeRedirectLocation(rerender.location);\n validateNavigationTarget(\n rerender.location,\n location2,\n new URL(window.location.href),\n \"allow-explicit\"\n );\n if (rerender.reload || isExternalLocation(location2)) {\n if (hasInvalidProtocol(location2)) {\n throw new Error(\"Invalid redirect location\");\n }\n window.location.href = location2;\n return;\n }\n React3.startTransition(() => {\n globalVar.__reactRouterDataRouter.navigate(location2, {\n replace: rerender.replace\n });\n });\n return;\n }\n React3.startTransition(() => {\n let lastMatch;\n for (const match of rerender.matches) {\n globalVar.__reactRouterDataRouter.patchRoutes(\n lastMatch?.id ?? null,\n [createRouteFromServerManifest(match)],\n true\n );\n lastMatch = match;\n }\n window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(\n {\n loaderData: Object.assign(\n {},\n globalVar.__reactRouterDataRouter.state.loaderData,\n rerender.loaderData\n ),\n errors: rerender.errors ? Object.assign(\n {},\n globalVar.__reactRouterDataRouter.state.errors,\n rerender.errors\n ) : null\n }\n );\n });\n }\n }).catch(() => {\n })\n )\n );\n return payloadPromise.then((payload) => {\n if (payload.type !== \"action\" && payload.type !== \"redirect\") {\n throw new Error(\"Unexpected payload type\");\n }\n return payload.actionResult;\n });\n };\n}\nfunction createRouterFromPayload({\n fetchImplementation,\n createFromReadableStream,\n getContext,\n payload\n}) {\n const globalVar = window;\n if (globalVar.__reactRouterDataRouter && globalVar.__reactRouterRouteModules)\n return {\n router: globalVar.__reactRouterDataRouter,\n routeModules: globalVar.__reactRouterRouteModules\n };\n if (payload.type !== \"render\") throw new Error(\"Invalid payload type\");\n globalVar.__reactRouterRouteModules = globalVar.__reactRouterRouteModules ?? {};\n populateRSCRouteModules(globalVar.__reactRouterRouteModules, payload.matches);\n let routes = payload.matches.reduceRight((previous, match) => {\n const route = createRouteFromServerManifest(\n match,\n payload\n );\n if (previous.length > 0) {\n route.children = previous;\n } else if (!route.index) {\n route.children = [];\n }\n return [route];\n }, []);\n let applyPatchesPromise;\n globalVar.__reactRouterDataRouter = createRouter({\n routes,\n getContext,\n basename: payload.basename,\n history: createBrowserHistory(),\n hydrationData: getHydrationData({\n state: {\n loaderData: payload.loaderData,\n actionData: payload.actionData,\n errors: payload.errors\n },\n routes,\n getRouteInfo: (routeId) => {\n let match = payload.matches.find((m) => m.id === routeId);\n invariant(match, \"Route not found in payload\");\n return {\n clientLoader: match.clientLoader,\n hasLoader: match.hasLoader,\n hasHydrateFallback: match.hydrateFallbackElement != null\n };\n },\n location: payload.location,\n basename: payload.basename,\n isSpaMode: false\n }),\n async patchRoutesOnNavigation({ path, signal }) {\n if (payload.routeDiscovery.mode === \"initial\") {\n if (!applyPatchesPromise) {\n applyPatchesPromise = (async () => {\n if (!payload.patches) return;\n let patches = await payload.patches;\n React3.startTransition(() => {\n patches.forEach((p) => {\n window.__reactRouterDataRouter.patchRoutes(p.parentId ?? null, [\n createRouteFromServerManifest(p)\n ]);\n });\n });\n })();\n }\n await applyPatchesPromise;\n return;\n }\n if (discoveredPaths.has(path)) {\n return;\n }\n await fetchAndApplyManifestPatches(\n [path],\n createFromReadableStream,\n fetchImplementation,\n signal\n );\n },\n // FIXME: Pass `build.ssr` into this function\n dataStrategy: getRSCSingleFetchDataStrategy(\n () => globalVar.__reactRouterDataRouter,\n true,\n payload.basename,\n createFromReadableStream,\n fetchImplementation\n )\n });\n if (globalVar.__reactRouterDataRouter.state.initialized) {\n globalVar.__routerInitialized = true;\n globalVar.__reactRouterDataRouter.initialize();\n } else {\n globalVar.__routerInitialized = false;\n }\n let lastLoaderData = void 0;\n globalVar.__reactRouterDataRouter.subscribe(({ loaderData, actionData }) => {\n if (lastLoaderData !== loaderData) {\n globalVar.__routerActionID = (globalVar.__routerActionID ?? (globalVar.__routerActionID = 0)) + 1;\n }\n });\n globalVar.__reactRouterDataRouter._updateRoutesForHMR = (routeUpdateByRouteId) => {\n const oldRoutes = window.__reactRouterDataRouter.routes;\n const newRoutes = [];\n function walkRoutes(routes2, parentId) {\n return routes2.map((route) => {\n const routeUpdate = routeUpdateByRouteId.get(route.id);\n if (routeUpdate) {\n const {\n routeModule,\n hasAction,\n hasComponent,\n hasErrorBoundary,\n hasLoader\n } = routeUpdate;\n const newRoute = createRouteFromServerManifest({\n clientAction: routeModule.clientAction,\n clientLoader: routeModule.clientLoader,\n element: route.element,\n errorElement: route.errorElement,\n handle: route.handle,\n hasAction,\n hasComponent,\n hasErrorBoundary,\n hasLoader,\n hydrateFallbackElement: route.hydrateFallbackElement,\n id: route.id,\n index: route.index,\n links: routeModule.links,\n meta: routeModule.meta,\n parentId,\n path: route.path,\n shouldRevalidate: routeModule.shouldRevalidate\n });\n if (route.children) {\n newRoute.children = walkRoutes(route.children, route.id);\n }\n return newRoute;\n }\n const updatedRoute = { ...route };\n if (route.children) {\n updatedRoute.children = walkRoutes(route.children, route.id);\n }\n return updatedRoute;\n });\n }\n newRoutes.push(\n ...walkRoutes(oldRoutes, void 0)\n );\n window.__reactRouterDataRouter._internalSetRoutes(newRoutes);\n };\n return {\n router: globalVar.__reactRouterDataRouter,\n routeModules: globalVar.__reactRouterRouteModules\n };\n}\nvar renderedRoutesContext = createContext();\nfunction getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {\n let dataStrategy = getSingleFetchDataStrategyImpl(\n getRouter,\n (match) => {\n let M = match;\n return {\n hasLoader: M.route.hasLoader,\n hasClientLoader: M.route.hasClientLoader,\n hasComponent: M.route.hasComponent,\n hasAction: M.route.hasAction,\n hasClientAction: M.route.hasClientAction\n };\n },\n // pass map into fetchAndDecode so it can add payloads\n getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation),\n ssr,\n basename,\n // .rsc requests are always trailing slash aware\n true,\n // If the route has a component but we don't have an element, we need to hit\n // the server loader flow regardless of whether the client loader calls\n // `serverLoader` or not, otherwise we'll have nothing to render.\n (match) => {\n let M = match;\n return M.route.hasComponent && !M.route.element;\n }\n );\n return async (args) => args.runClientMiddleware(async () => {\n let context = args.context;\n context.set(renderedRoutesContext, []);\n let results = await dataStrategy(args);\n const renderedRoutesById = /* @__PURE__ */ new Map();\n for (const route of context.get(renderedRoutesContext)) {\n if (!renderedRoutesById.has(route.id)) {\n renderedRoutesById.set(route.id, []);\n }\n renderedRoutesById.get(route.id).push(route);\n }\n React3.startTransition(() => {\n for (const match of args.matches) {\n const renderedRoutes = renderedRoutesById.get(match.route.id);\n if (renderedRoutes) {\n for (const rendered of renderedRoutes) {\n window.__reactRouterDataRouter.patchRoutes(\n rendered.parentId ?? null,\n [createRouteFromServerManifest(rendered)],\n true\n );\n }\n }\n }\n });\n return results;\n });\n}\nfunction getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {\n return async (args, basename, trailingSlashAware, targetRoutes) => {\n let { request, context } = args;\n let url = singleFetchUrl(request.url, basename, trailingSlashAware, \"rsc\");\n if (request.method === \"GET\") {\n url = stripIndexParam(url);\n if (targetRoutes) {\n url.searchParams.set(\"_routes\", targetRoutes.join(\",\"));\n }\n }\n let res = await fetchImplementation(\n new Request(url, await createRequestInit(request))\n );\n if (res.status >= 400 && !res.headers.has(\"X-Remix-Response\")) {\n throw new ErrorResponseImpl(res.status, res.statusText, await res.text());\n }\n invariant(res.body, \"No response body to decode\");\n try {\n const payload = await createFromReadableStream(res.body, {\n temporaryReferences: void 0\n });\n if (payload.type === \"redirect\") {\n return {\n status: res.status,\n data: {\n redirect: {\n redirect: payload.location,\n reload: payload.reload,\n replace: payload.replace,\n revalidate: false,\n status: payload.status\n }\n }\n };\n }\n if (payload.type !== \"render\") {\n throw new Error(\"Unexpected payload type\");\n }\n context.get(renderedRoutesContext).push(...payload.matches);\n let results = { routes: {} };\n const dataKey = isMutationMethod(request.method) ? \"actionData\" : \"loaderData\";\n for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {\n results.routes[routeId] = { data };\n }\n if (payload.errors) {\n for (let [routeId, error] of Object.entries(payload.errors)) {\n results.routes[routeId] = { error };\n }\n }\n return { status: res.status, data: results };\n } catch (cause) {\n throw new Error(\"Unable to decode RSC response\", { cause });\n }\n };\n}\nfunction RSCHydratedRouter({\n createFromReadableStream,\n fetch: fetchImplementation = fetch,\n payload,\n getContext\n}) {\n if (payload.type !== \"render\") throw new Error(\"Invalid payload type\");\n let { routeDiscovery } = payload;\n let { router: router2, routeModules } = React3.useMemo(\n () => createRouterFromPayload({\n payload,\n fetchImplementation,\n getContext,\n createFromReadableStream\n }),\n [createFromReadableStream, payload, fetchImplementation, getContext]\n );\n React3.useEffect(() => {\n setIsHydrated();\n }, []);\n React3.useLayoutEffect(() => {\n const globalVar = window;\n if (!globalVar.__routerInitialized) {\n globalVar.__routerInitialized = true;\n globalVar.__reactRouterDataRouter.initialize();\n }\n }, []);\n let [{ routes, state }, setState] = React3.useState(() => ({\n routes: cloneRoutes(router2.routes),\n state: router2.state\n }));\n React3.useLayoutEffect(\n () => router2.subscribe((newState) => {\n if (diffRoutes(router2.routes, routes))\n React3.startTransition(() => {\n setState({\n routes: cloneRoutes(router2.routes),\n state: newState\n });\n });\n }),\n [router2.subscribe, routes, router2]\n );\n const transitionEnabledRouter = React3.useMemo(\n () => ({\n ...router2,\n state,\n routes\n }),\n [router2, routes, state]\n );\n React3.useEffect(() => {\n if (routeDiscovery.mode === \"initial\" || // @ts-expect-error - TS doesn't know about this yet\n window.navigator?.connection?.saveData === true) {\n return;\n }\n function registerElement(el) {\n let path = el.tagName === \"FORM\" ? el.getAttribute(\"action\") : el.getAttribute(\"href\");\n if (!path) {\n return;\n }\n let pathname = el.tagName === \"A\" ? el.pathname : new URL(path, window.location.origin).pathname;\n if (!discoveredPaths.has(pathname)) {\n nextPaths.add(pathname);\n }\n }\n async function fetchPatches() {\n document.querySelectorAll(\"a[data-discover], form[data-discover]\").forEach(registerElement);\n let paths = Array.from(nextPaths.keys()).filter((path) => {\n if (discoveredPaths.has(path)) {\n nextPaths.delete(path);\n return false;\n }\n return true;\n });\n if (paths.length === 0) {\n return;\n }\n try {\n await fetchAndApplyManifestPatches(\n paths,\n createFromReadableStream,\n fetchImplementation\n );\n } catch (e) {\n console.error(\"Failed to fetch manifest patches\", e);\n }\n }\n let debouncedFetchPatches = debounce(fetchPatches, 100);\n fetchPatches();\n let observer = new MutationObserver(() => debouncedFetchPatches());\n observer.observe(document.documentElement, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"data-discover\", \"href\", \"action\"]\n });\n }, [routeDiscovery, createFromReadableStream, fetchImplementation]);\n const frameworkContext = {\n future: {\n // These flags have no runtime impact so can always be false. If we add\n // flags that drive runtime behavior they'll need to be proxied through.\n v8_middleware: false,\n v8_trailingSlashAwareDataRequests: true,\n // always on for RSC\n v8_passThroughRequests: true\n // always on for RSC\n },\n isSpaMode: false,\n ssr: true,\n criticalCss: \"\",\n manifest: {\n routes: {},\n version: \"1\",\n url: \"\",\n entry: {\n module: \"\",\n imports: []\n }\n },\n routeDiscovery: payload.routeDiscovery.mode === \"initial\" ? { mode: \"initial\", manifestPath: defaultManifestPath } : {\n mode: \"lazy\",\n manifestPath: payload.routeDiscovery.manifestPath || defaultManifestPath\n },\n routeModules\n };\n return /* @__PURE__ */ React3.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(\n RouterProvider,\n {\n router: transitionEnabledRouter,\n flushSync: ReactDOM2.flushSync\n }\n ))));\n}\nfunction createRouteFromServerManifest(match, payload) {\n let hasInitialData = payload && match.id in payload.loaderData;\n let initialData = payload?.loaderData[match.id];\n let hasInitialError = payload?.errors && match.id in payload.errors;\n let initialError = payload?.errors?.[match.id];\n let isHydrationRequest = match.clientLoader?.hydrate === true || !match.hasLoader || // If the route has a component but we don't have an element, we need to hit\n // the server loader flow regardless of whether the client loader calls\n // `serverLoader` or not, otherwise we'll have nothing to render.\n match.hasComponent && !match.element;\n invariant(window.__reactRouterRouteModules);\n populateRSCRouteModules(window.__reactRouterRouteModules, match);\n let dataRoute = {\n id: match.id,\n element: match.element,\n errorElement: match.errorElement,\n handle: match.handle,\n hasErrorBoundary: match.hasErrorBoundary,\n hydrateFallbackElement: match.hydrateFallbackElement,\n index: match.index,\n loader: match.clientLoader ? async (args, singleFetch) => {\n let _isHydrationRequest = isHydrationRequest;\n isHydrationRequest = false;\n let result = await match.clientLoader({\n ...args,\n serverLoader: () => {\n preventInvalidServerHandlerCall(\n \"loader\",\n match.id,\n match.hasLoader\n );\n if (_isHydrationRequest) {\n if (hasInitialData) {\n return initialData;\n }\n if (hasInitialError) {\n throw initialError;\n }\n }\n return callSingleFetch(singleFetch);\n }\n });\n return result;\n } : (\n // We always make the call in this RSC world since even if we don't\n // have a `loader` we may need to get the `element` implementation\n (_, singleFetch) => callSingleFetch(singleFetch)\n ),\n action: match.clientAction ? (args, singleFetch) => match.clientAction({\n ...args,\n serverAction: async () => {\n preventInvalidServerHandlerCall(\n \"action\",\n match.id,\n match.hasLoader\n );\n return await callSingleFetch(singleFetch);\n }\n }) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {\n throw noActionDefinedError(\"action\", match.id);\n },\n path: match.path,\n shouldRevalidate: match.shouldRevalidate,\n // We always have a \"loader\" in this RSC world since even if we don't\n // have a `loader` we may need to get the `element` implementation\n hasLoader: true,\n hasClientLoader: match.clientLoader != null,\n hasAction: match.hasAction,\n hasClientAction: match.clientAction != null\n };\n if (typeof dataRoute.loader === \"function\") {\n dataRoute.loader.hydrate = shouldHydrateRouteLoader(\n match.id,\n match.clientLoader,\n match.hasLoader,\n false\n );\n }\n return dataRoute;\n}\nfunction callSingleFetch(singleFetch) {\n invariant(typeof singleFetch === \"function\", \"Invalid singleFetch parameter\");\n return singleFetch();\n}\nfunction preventInvalidServerHandlerCall(type, routeId, hasHandler) {\n if (!hasHandler) {\n let fn = type === \"action\" ? \"serverAction()\" : \"serverLoader()\";\n let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: \"${routeId}\")`;\n console.error(msg);\n throw new ErrorResponseImpl(400, \"Bad Request\", new Error(msg), true);\n }\n}\nvar nextPaths = /* @__PURE__ */ new Set();\nvar discoveredPathsMaxSize = 1e3;\nvar discoveredPaths = /* @__PURE__ */ new Set();\nfunction getManifestUrl(paths) {\n if (paths.length === 0) {\n return null;\n }\n if (paths.length === 1) {\n return new URL(`${paths[0]}.manifest`, window.location.origin);\n }\n const globalVar = window;\n let basename = (globalVar.__reactRouterDataRouter.basename ?? \"\").replace(\n /^\\/|\\/$/g,\n \"\"\n );\n let url = new URL(`${basename}/.manifest`, window.location.origin);\n url.searchParams.set(\"paths\", paths.sort().join(\",\"));\n return url;\n}\nasync function fetchAndApplyManifestPatches(paths, createFromReadableStream, fetchImplementation, signal) {\n paths = getPathsWithAncestors(paths);\n let url = getManifestUrl(paths);\n if (url == null) {\n return;\n }\n if (url.toString().length > URL_LIMIT) {\n nextPaths.clear();\n return;\n }\n let response = await fetchImplementation(new Request(url, { signal }));\n if (!response.body || response.status < 200 || response.status >= 300) {\n throw new Error(\"Unable to fetch new route matches from the server\");\n }\n let payload = await createFromReadableStream(response.body, {\n temporaryReferences: void 0\n });\n if (payload.type !== \"manifest\") {\n throw new Error(\"Failed to patch routes\");\n }\n paths.forEach((p) => addToFifoQueue(p, discoveredPaths));\n let patches = await payload.patches;\n React3.startTransition(() => {\n patches.forEach((p) => {\n window.__reactRouterDataRouter.patchRoutes(\n p.parentId ?? null,\n [createRouteFromServerManifest(p)]\n );\n });\n });\n}\nfunction addToFifoQueue(path, queue) {\n if (queue.size >= discoveredPathsMaxSize) {\n let first = queue.values().next().value;\n if (typeof first === \"string\") queue.delete(first);\n }\n queue.add(path);\n}\nfunction debounce(callback, wait) {\n let timeoutId;\n return (...args) => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(() => callback(...args), wait);\n };\n}\nfunction isExternalLocation(location2) {\n const newLocation = new URL(location2, window.location.href);\n return newLocation.origin !== window.location.origin;\n}\nfunction normalizeRedirectLocation(location2) {\n if (PROTOCOL_RELATIVE_URL_REGEX.test(location2)) {\n let path = resolvePath(location2);\n return path.pathname + path.search + path.hash;\n }\n return location2;\n}\nfunction cloneRoutes(routes) {\n if (!routes) return void 0;\n return routes.map((route) => ({\n ...route,\n children: cloneRoutes(route.children)\n }));\n}\nfunction diffRoutes(a, b) {\n if (a.length !== b.length) return true;\n return a.some((route, index) => {\n if (route.element !== b[index].element) return true;\n if (route.errorElement !== b[index].errorElement)\n return true;\n if (route.hydrateFallbackElement !== b[index].hydrateFallbackElement)\n return true;\n if (route.hasErrorBoundary !== b[index].hasErrorBoundary)\n return true;\n if (route.hasLoader !== b[index].hasLoader) return true;\n if (route.hasClientLoader !== b[index].hasClientLoader)\n return true;\n if (route.hasAction !== b[index].hasAction) return true;\n if (route.hasClientAction !== b[index].hasClientAction)\n return true;\n return diffRoutes(route.children || [], b[index].children || []);\n });\n}\n\n// lib/rsc/html-stream/browser.ts\nfunction getRSCStream() {\n let encoder = new TextEncoder();\n let streamController = null;\n let rscStream = new ReadableStream({\n start(controller) {\n if (typeof window === \"undefined\") {\n return;\n }\n let handleChunk = (chunk) => {\n if (typeof chunk === \"string\") {\n controller.enqueue(encoder.encode(chunk));\n } else {\n controller.enqueue(chunk);\n }\n };\n window.__FLIGHT_DATA || (window.__FLIGHT_DATA = []);\n window.__FLIGHT_DATA.forEach(handleChunk);\n window.__FLIGHT_DATA.push = (chunk) => {\n handleChunk(chunk);\n return 0;\n };\n streamController = controller;\n }\n });\n if (typeof document !== \"undefined\" && document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n streamController?.close();\n });\n } else {\n streamController?.close();\n }\n return rscStream;\n}\nexport {\n HydratedRouter,\n RouterProvider2 as RouterProvider,\n RSCHydratedRouter as unstable_RSCHydratedRouter,\n createCallServer as unstable_createCallServer,\n getRSCStream as unstable_getRSCStream\n};\n","\"use client\";\nimport { createContext as y, Component as f, createElement as d, useContext as l, useState as p, useMemo as E, forwardRef as B } from \"react\";\nconst h = y(null), c = {\n didCatch: !1,\n error: null\n};\nclass m extends f {\n constructor(e) {\n super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = c;\n }\n static getDerivedStateFromError(e) {\n return { didCatch: !0, error: e };\n }\n resetErrorBoundary(...e) {\n const { didCatch: t } = this.state;\n t && (this.props.onReset?.({\n args: e,\n reason: \"imperative-api\"\n }), this.setState(c));\n }\n componentDidCatch(e, t) {\n this.props.onError?.(e, t);\n }\n componentDidUpdate(e, t) {\n const { didCatch: o } = this.state, { resetKeys: s } = this.props;\n o && t.didCatch && C(e.resetKeys, s) && (this.props.onReset?.({\n next: s,\n prev: e.resetKeys,\n reason: \"keys\"\n }), this.setState(c));\n }\n render() {\n const { children: e, fallbackRender: t, FallbackComponent: o, fallback: s } = this.props, { didCatch: n, error: a } = this.state;\n let i = e;\n if (n) {\n const u = {\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof t == \"function\")\n i = t(u);\n else if (o)\n i = d(o, u);\n else if (s !== void 0)\n i = s;\n else\n throw a;\n }\n return d(\n h.Provider,\n {\n value: {\n didCatch: n,\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n }\n },\n i\n );\n }\n}\nfunction C(r = [], e = []) {\n return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));\n}\nfunction g(r) {\n return r !== null && typeof r == \"object\" && \"didCatch\" in r && typeof r.didCatch == \"boolean\" && \"error\" in r && \"resetErrorBoundary\" in r && typeof r.resetErrorBoundary == \"function\";\n}\nfunction x(r) {\n if (!g(r))\n throw new Error(\"ErrorBoundaryContext not found\");\n}\nfunction k() {\n const r = l(h);\n x(r);\n const { error: e, resetErrorBoundary: t } = r, [o, s] = p({\n error: null,\n hasError: !1\n }), n = E(\n () => ({\n error: e,\n resetBoundary: () => {\n t(), s({ error: null, hasError: !1 });\n },\n showBoundary: (a) => s({\n error: a,\n hasError: !0\n })\n }),\n [e, t]\n );\n if (o.hasError)\n throw o.error;\n return n;\n}\nfunction S(r) {\n switch (typeof r) {\n case \"object\": {\n if (r !== null && \"message\" in r && typeof r.message == \"string\")\n return r.message;\n break;\n }\n case \"string\":\n return r;\n }\n}\nfunction w(r, e) {\n const t = B(\n (s, n) => d(\n m,\n e,\n d(r, { ...s, ref: n })\n )\n ), o = r.displayName || r.name || \"Unknown\";\n return t.displayName = `withErrorBoundary(${o})`, t;\n}\nexport {\n m as ErrorBoundary,\n h as ErrorBoundaryContext,\n S as getErrorMessage,\n k as useErrorBoundary,\n w as withErrorBoundary\n};\n//# sourceMappingURL=react-error-boundary.js.map\n","import { RouterProvider } from 'react-router-dom';\n\nimport { RouterService } from '../../../classes/services/RouterService';\n\nexport const AppRouterProvider = () => <RouterProvider router={RouterService.getInstance().router} />;\n","import { CacheProvider } from '@emotion/react';\nimport {\n CssBaseline,\n ThemeProvider,\n} from '@mui/material';\nimport { QueryClientProvider } from '@tanstack/react-query';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { useMemo } from 'react';\nimport { UiCoreComponentsContextProvider } from '@gen-epix/ui-core-components/context/uiCoreComponentsConfigContext';\nimport type { UiCoreComponentsConfig } from '@gen-epix/ui-core-components/context/uiCoreComponentsConfigContext';\n\nimport { BackendVersionService } from '../../../classes/services/BackendVersionService';\nimport { ConfigService } from '../../../classes/services/ConfigService';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { ErrorPage } from '../../../pages/ErrorPage';\nimport { EmotionCacheService } from '../../../classes/services/EmotionCacheService';\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { ApiService } from '../../../classes/services/ApiService';\nimport { ApplicationBootstrapWithoutAuthorization } from '../ApplicationBootstrapWithoutAuthorization';\nimport { AppRouterProvider } from '../AppRouterProvider/AppRouterProvider';\n\nexport const App = () => {\n const { config } = ConfigService.getInstance();\n\n const uiCoreComponentsConfig = useMemo<UiCoreComponentsConfig>(() => {\n const { DEFAULT_CIRCULAR_PROGRESS_SIZE, DEFAULT_TAKING_LONGER_TIMEOUT_MS } = config.spinner;\n\n return {\n spinner: {\n defaultCircularProgressSize: DEFAULT_CIRCULAR_PROGRESS_SIZE,\n defaultTakingLongerTimeoutMs: DEFAULT_TAKING_LONGER_TIMEOUT_MS,\n },\n };\n }, [config.spinner]);\n\n const authenticationService = AuthenticationService.getInstance();\n const logService = LogService.getInstance();\n\n const touchIconUrl = config.getTouchIconUrl();\n if (touchIconUrl) {\n\n document.querySelector('link[rel=\"icon\"]')?.setAttribute('href', touchIconUrl);\n }\n const apiService = ApiService.getInstance();\n apiService.api.baseUrl = config.getAPIBaseUrl();\n apiService.api.defaultRequestTimeout = config.defaultRequestTimeout;\n apiService.api.onRequest = [\n authenticationService.onRequest.bind(authenticationService),\n logService.onRequest.bind(logService),\n ];\n apiService.api.onResponseFulfilled = [\n logService.onResponseFulfilled.bind(logService),\n BackendVersionService.getInstance().onResponseFulfilled.bind(BackendVersionService.getInstance()),\n ];\n apiService.api.onResponseRejected = [\n logService.onResponseRejected.bind(logService),\n authenticationService.onResponseRejected.bind(authenticationService),\n ];\n\n const queryQueryManager = QueryClientService.getInstance();\n const emotionCacheService = EmotionCacheService.getInstance();\n\n return (\n <UiCoreComponentsContextProvider config={uiCoreComponentsConfig}>\n <QueryClientProvider client={queryQueryManager.queryClient}>\n <CacheProvider value={emotionCacheService.emotionCache}>\n <ThemeProvider theme={ConfigService.getInstance().config.theme}>\n <CssBaseline />\n <ErrorBoundary FallbackComponent={ErrorPage}>\n <ApplicationBootstrapWithoutAuthorization>\n <AppRouterProvider />\n </ApplicationBootstrapWithoutAuthorization>\n </ErrorBoundary>\n </ThemeProvider>\n </CacheProvider>\n </QueryClientProvider>\n </UiCoreComponentsContextProvider>\n );\n};\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;;;;;;AAsDA,SAAS,EAAgB,GAAO;CAC9B,OAAuB,kBAAM,cAAc,GAAgB;EAAE,WAAW,EAAS;EAAW,GAAG;CAAM,CAAC;AACxG;AAwe4BA,EAAc;;;AC9hB1C,IAAM,IAAIC,EAAE,IAAI,GAAG,IAAI;CACrB,UAAU,CAAC;CACX,OAAO;AACT,GACM,IAAN,cAAgBC,EAAE;CAChB,YAAY,GAAG;EACb,MAAM,CAAC,GAAG,KAAK,qBAAqB,KAAK,mBAAmB,KAAK,IAAI,GAAG,KAAK,QAAQ;CACvF;CACA,OAAO,yBAAyB,GAAG;EACjC,OAAO;GAAE,UAAU,CAAC;GAAG,OAAO;EAAE;CAClC;CACA,mBAAmB,GAAG,GAAG;EACvB,IAAM,EAAE,UAAU,MAAM,KAAK;EAC7B,MAAM,KAAK,MAAM,UAAU;GACzB,MAAM;GACN,QAAQ;EACV,CAAC,GAAG,KAAK,SAAS,CAAC;CACrB;CACA,kBAAkB,GAAG,GAAG;EACtB,KAAK,MAAM,UAAU,GAAG,CAAC;CAC3B;CACA,mBAAmB,GAAG,GAAG;EACvB,IAAM,EAAE,UAAU,MAAM,KAAK,OAAO,EAAE,WAAW,MAAM,KAAK;EAC5D,KAAK,EAAE,YAAY,EAAE,EAAE,WAAW,CAAC,MAAM,KAAK,MAAM,UAAU;GAC5D,MAAM;GACN,MAAM,EAAE;GACR,QAAQ;EACV,CAAC,GAAG,KAAK,SAAS,CAAC;CACrB;CACA,SAAS;EACP,IAAM,EAAE,UAAU,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,UAAU,MAAM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AW,oBAAoB,KAAK,CAAU,GAC9C,EAAsB,YAAY,CAAC,CAAC,oBAAoB,KAAK,EAAsB,YAAY,CAAC,CAClG,GACA,EAAW,IAAI,qBAAqB,CAClC,EAAW,mBAAmB,KAAK,CAAU,GAC7C,EAAsB,mBAAmB,KAAK,CAAqB,CACrE;CAEA,IAAM,IAAoB,EAAmB,YAAY,GACnD,IAAsB,EAAoB,YAAY;CAE5D,OACE,kBAAC,GAAD;EAAiC,QAAQ;EACvC,UAAA,kBAAC,GAAD;GAAqB,QAAQ,EAAkB;GAC7C,UAAA,kBAAC,GAAD;IAAe,OAAO,EAAoB;IACxC,UAAA,kBAAC,GAAD;KAAe,OAAO,EAAc,YAAY,CAAC,CAAC,OAAO;KAAzD,UAAA,CACE,kBAAC,GAAD,CAAc,CAAA,GACd,kBAAC,GAAD;MAAe,mBAAmB;MAChC,UAAA,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,CAAoB,CAAA,EACoB,CAAA;KAC7B,CAAA,CACF;;GACF,CAAA;EACI,CAAA;CACU,CAAA;AAErC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/app/AppRouterProvider/AppRouterProvider.tsx","../../../../src/components/app/App/App.tsx"],"sourcesContent":["import { RouterProvider } from 'react-router-dom';\n\nimport { RouterService } from '../../../classes/services/RouterService';\n\nexport const AppRouterProvider = () => <RouterProvider router={RouterService.getInstance().router} />;\n","import { CacheProvider } from '@emotion/react';\nimport {\n CssBaseline,\n ThemeProvider,\n} from '@mui/material';\nimport { QueryClientProvider } from '@tanstack/react-query';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { useMemo } from 'react';\nimport { UiCoreComponentsContextProvider } from '@gen-epix/ui-core-components/context/uiCoreComponentsConfigContext';\nimport type { UiCoreComponentsConfig } from '@gen-epix/ui-core-components/context/uiCoreComponentsConfigContext';\n\nimport { BackendVersionService } from '../../../classes/services/BackendVersionService';\nimport { ConfigService } from '../../../classes/services/ConfigService';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { ErrorPage } from '../../../pages/ErrorPage';\nimport { EmotionCacheService } from '../../../classes/services/EmotionCacheService';\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { ApiService } from '../../../classes/services/ApiService';\nimport { ApplicationBootstrapWithoutAuthorization } from '../ApplicationBootstrapWithoutAuthorization';\nimport { AppRouterProvider } from '../AppRouterProvider/AppRouterProvider';\n\nexport const App = () => {\n const { config } = ConfigService.getInstance();\n\n const uiCoreComponentsConfig = useMemo<UiCoreComponentsConfig>(() => {\n const { DEFAULT_CIRCULAR_PROGRESS_SIZE, DEFAULT_TAKING_LONGER_TIMEOUT_MS } = config.spinner;\n\n return {\n spinner: {\n defaultCircularProgressSize: DEFAULT_CIRCULAR_PROGRESS_SIZE,\n defaultTakingLongerTimeoutMs: DEFAULT_TAKING_LONGER_TIMEOUT_MS,\n },\n };\n }, [config.spinner]);\n\n const authenticationService = AuthenticationService.getInstance();\n const logService = LogService.getInstance();\n\n const touchIconUrl = config.getTouchIconUrl();\n if (touchIconUrl) {\n\n document.querySelector('link[rel=\"icon\"]')?.setAttribute('href', touchIconUrl);\n }\n const apiService = ApiService.getInstance();\n apiService.api.baseUrl = config.getAPIBaseUrl();\n apiService.api.defaultRequestTimeout = config.defaultRequestTimeout;\n apiService.api.onRequest = [\n authenticationService.onRequest.bind(authenticationService),\n logService.onRequest.bind(logService),\n ];\n apiService.api.onResponseFulfilled = [\n logService.onResponseFulfilled.bind(logService),\n BackendVersionService.getInstance().onResponseFulfilled.bind(BackendVersionService.getInstance()),\n ];\n apiService.api.onResponseRejected = [\n logService.onResponseRejected.bind(logService),\n authenticationService.onResponseRejected.bind(authenticationService),\n ];\n\n const queryQueryManager = QueryClientService.getInstance();\n const emotionCacheService = EmotionCacheService.getInstance();\n\n return (\n <UiCoreComponentsContextProvider config={uiCoreComponentsConfig}>\n <QueryClientProvider client={queryQueryManager.queryClient}>\n <CacheProvider value={emotionCacheService.emotionCache}>\n <ThemeProvider theme={ConfigService.getInstance().config.theme}>\n <CssBaseline />\n <ErrorBoundary FallbackComponent={ErrorPage}>\n <ApplicationBootstrapWithoutAuthorization>\n <AppRouterProvider />\n </ApplicationBootstrapWithoutAuthorization>\n </ErrorBoundary>\n </ThemeProvider>\n </CacheProvider>\n </QueryClientProvider>\n </UiCoreComponentsContextProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA,IAAa,UAA0B,kBAAC,GAAD,EAAgB,QAAQ,EAAc,YAAY,CAAC,CAAC,OAAS,CAAA,GCkBvF,UAAY;CACvB,IAAM,EAAE,cAAW,EAAc,YAAY,GAEvC,IAAyB,QAAsC;EACnE,IAAM,EAAE,mCAAgC,wCAAqC,EAAO;EAEpF,OAAO,EACL,SAAS;GACP,6BAA6B;GAC7B,8BAA8B;EAChC,EACF;CACF,GAAG,CAAC,EAAO,OAAO,CAAC,GAEb,IAAwB,EAAsB,YAAY,GAC1D,IAAa,EAAW,YAAY,GAEpC,IAAe,EAAO,gBAAgB;CAC5C,AAAI,KAEF,SAAS,cAAc,oBAAkB,CAAC,EAAE,aAAa,QAAQ,CAAY;CAE/E,IAAM,IAAa,EAAW,YAAY;CAW1C,AAVA,EAAW,IAAI,UAAU,EAAO,cAAc,GAC9C,EAAW,IAAI,wBAAwB,EAAO,uBAC9C,EAAW,IAAI,YAAY,CACzB,EAAsB,UAAU,KAAK,CAAqB,GAC1D,EAAW,UAAU,KAAK,CAAU,CACtC,GACA,EAAW,IAAI,sBAAsB,CACnC,EAAW,oBAAoB,KAAK,CAAU,GAC9C,EAAsB,YAAY,CAAC,CAAC,oBAAoB,KAAK,EAAsB,YAAY,CAAC,CAClG,GACA,EAAW,IAAI,qBAAqB,CAClC,EAAW,mBAAmB,KAAK,CAAU,GAC7C,EAAsB,mBAAmB,KAAK,CAAqB,CACrE;CAEA,IAAM,IAAoB,EAAmB,YAAY,GACnD,IAAsB,EAAoB,YAAY;CAE5D,OACE,kBAAC,GAAD;EAAiC,QAAQ;EACvC,UAAA,kBAAC,GAAD;GAAqB,QAAQ,EAAkB;GAC7C,UAAA,kBAAC,GAAD;IAAe,OAAO,EAAoB;IACxC,UAAA,kBAAC,GAAD;KAAe,OAAO,EAAc,YAAY,CAAC,CAAC,OAAO;KAAzD,UAAA,CACE,kBAAC,GAAD,CAAc,CAAA,GACd,kBAAC,GAAD;MAAe,mBAAmB;MAChC,UAAA,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,CAAoB,CAAA,EACoB,CAAA;KAC7B,CAAA,CACF;;GACF,CAAA;EACI,CAAA;CACU,CAAA;AAErC"}
@@ -1 +1 @@
1
- export declare const AppRouterProvider: () => import("react").JSX.Element;
1
+ export declare const AppRouterProvider: () => import('react').JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { PropsWithChildren } from 'react';
2
- export declare const AuthenticationWrapper: ({ children }: PropsWithChildren) => import("react").JSX.Element;
2
+ export declare const AuthenticationWrapper: ({ children }: PropsWithChildren) => import('react').JSX.Element;
@@ -2,50 +2,50 @@ import { ConfigService as e } from "../../../classes/services/ConfigService/inde
2
2
  import { PageContainer as t } from "../../ui/PageContainer/index.js";
3
3
  import { AuthenticationService as n } from "../../../classes/services/AuthenticationService/index.js";
4
4
  import { LogService as r } from "../../../classes/services/LogService/index.js";
5
- import { n as i } from "../../../_chunks/react-oidc-context.js";
6
- import { ConsentDialog as a } from "../../ui/ConsentDialog/index.js";
7
- import { WindowService as o } from "@gen-epix/ui-core/classes/services/WindowService";
8
- import { CommonDbLogLevel as s } from "@gen-epix/api-commondb";
9
- import { Box as c, Button as l, Typography as u } from "@mui/material";
10
- import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
11
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
12
- import { useTranslation as y } from "react-i18next";
13
- import { TestIdUtil as b } from "@gen-epix/ui-core/utils/TestIdUtil";
14
- import { useSubscribable as x } from "@gen-epix/ui-core/hooks/useSubscribable";
15
- import { Spinner as S } from "@gen-epix/ui-core-components/components/Spinner";
5
+ import { ConsentDialog as i } from "../../ui/ConsentDialog/index.js";
6
+ import { WindowService as a } from "@gen-epix/ui-core/classes/services/WindowService";
7
+ import { CommonDbLogLevel as o } from "@gen-epix/api-commondb";
8
+ import { Box as s, Button as c, Typography as l } from "@mui/material";
9
+ import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
10
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
11
+ import { useTranslation as v } from "react-i18next";
12
+ import { TestIdUtil as y } from "@gen-epix/ui-core/utils/TestIdUtil";
13
+ import { useSubscribable as b } from "@gen-epix/ui-core/hooks/useSubscribable";
14
+ import { Spinner as x } from "@gen-epix/ui-core-components/components/Spinner";
15
+ import { useAuth as S } from "react-oidc-context";
16
16
  //#region src/components/app/AuthenticationWrapper/AuthenticationWrapper.tsx
17
17
  var C = ({ children: C }) => {
18
- let { t: w } = y(), T = i(), E = m(null), [D, O] = h(!e.getInstance().config.consentDialog?.getShouldShow()), k = x(n.getInstance()), A = e.getInstance().config.login?.AfterLoginElement;
19
- f(() => {
18
+ let { t: w } = v(), T = S(), E = p(null), [D, O] = m(!e.getInstance().config.consentDialog?.getShouldShow()), k = b(n.getInstance()), A = e.getInstance().config.login?.AfterLoginElement;
19
+ d(() => {
20
20
  n.getInstance().authContextProps = T;
21
- }, [T]), f(() => {
21
+ }, [T]), d(() => {
22
22
  T.isAuthenticated && !D && E.current.open();
23
23
  }, [T.isAuthenticated, D]);
24
- let j = d(() => {
24
+ let j = u(() => {
25
25
  r.getInstance().log([{
26
- level: s.INFO,
26
+ level: o.INFO,
27
27
  topic: "CONSENT"
28
28
  }]), O(!0), E.current.close();
29
- }, []), M = d(() => {
29
+ }, []), M = u(() => {
30
30
  (async () => {
31
- let { hash: e, pathname: t, search: n } = o.getInstance().window.location, r = { preLoginLocation: {
31
+ let { hash: e, pathname: t, search: n } = a.getInstance().window.location, r = { preLoginLocation: {
32
32
  hash: e,
33
33
  pathname: t,
34
34
  search: n
35
35
  } };
36
36
  await T.signinRedirect({ state: r });
37
37
  })();
38
- }, [T]), N = d(() => {
38
+ }, [T]), N = u(() => {
39
39
  M();
40
- }, [M]), P = d(() => {
40
+ }, [M]), P = u(() => {
41
41
  n.clearStaleState(), n.getInstance().next(void 0);
42
- }, []), F = p(() => (/* @__PURE__ */ new Date()).getTime(), []), I = p(() => /* @__PURE__ */ v(g, { children: [
43
- /* @__PURE__ */ _(c, {
42
+ }, []), F = f(() => (/* @__PURE__ */ new Date()).getTime(), []), I = f(() => /* @__PURE__ */ _(h, { children: [
43
+ /* @__PURE__ */ g(s, {
44
44
  sx: {
45
45
  marginY: 2,
46
46
  textAlign: "center"
47
47
  },
48
- children: /* @__PURE__ */ _(l, {
48
+ children: /* @__PURE__ */ g(c, {
49
49
  color: "primary",
50
50
  "data-name": k.name,
51
51
  onClick: N,
@@ -53,19 +53,19 @@ var C = ({ children: C }) => {
53
53
  children: k.label
54
54
  })
55
55
  }),
56
- /* @__PURE__ */ _(c, {
56
+ /* @__PURE__ */ g(s, {
57
57
  sx: {
58
58
  marginY: 2,
59
59
  textAlign: "center"
60
60
  },
61
- children: /* @__PURE__ */ _(l, {
61
+ children: /* @__PURE__ */ g(c, {
62
62
  color: "primary",
63
63
  onClick: P,
64
64
  variant: "outlined",
65
65
  children: w`Choose a different identity provider`
66
66
  })
67
67
  }),
68
- A && /* @__PURE__ */ _(A, {})
68
+ A && /* @__PURE__ */ g(A, {})
69
69
  ] }), [
70
70
  k,
71
71
  P,
@@ -73,22 +73,22 @@ var C = ({ children: C }) => {
73
73
  w,
74
74
  A
75
75
  ]);
76
- if (T.activeNavigator || T.isLoading) return /* @__PURE__ */ _(t, {
76
+ if (T.activeNavigator || T.isLoading) return /* @__PURE__ */ g(t, {
77
77
  ignorePageEvent: !0,
78
78
  singleAction: !0,
79
- testIdAttributes: b.createAttributes("RedirectingPage"),
79
+ testIdAttributes: y.createAttributes("RedirectingPage"),
80
80
  title: w`Redirecting`,
81
- children: /* @__PURE__ */ _(S, { label: w`Redirecting` })
81
+ children: /* @__PURE__ */ g(x, { label: w`Redirecting` })
82
82
  });
83
83
  if (T.error) return n.clearStaleState(), r.getInstance().log([{
84
84
  detail: { error: T.error },
85
- level: s.ERROR,
85
+ level: o.ERROR,
86
86
  topic: "Authentication Error"
87
- }]), /* @__PURE__ */ v(t, {
87
+ }]), /* @__PURE__ */ _(t, {
88
88
  singleAction: !0,
89
- testIdAttributes: b.createAttributes("LoginPageSessionExpired"),
89
+ testIdAttributes: y.createAttributes("LoginPageSessionExpired"),
90
90
  title: w`Login`,
91
- children: [/* @__PURE__ */ _(u, {
91
+ children: [/* @__PURE__ */ g(l, {
92
92
  component: "p",
93
93
  sx: { textAlign: "center" },
94
94
  children: w`We could not log you in, or your session has expired.`
@@ -99,23 +99,23 @@ var C = ({ children: C }) => {
99
99
  M();
100
100
  return;
101
101
  }
102
- return /* @__PURE__ */ v(t, {
102
+ return /* @__PURE__ */ _(t, {
103
103
  singleAction: !0,
104
- testIdAttributes: b.createAttributes("LoginPage"),
104
+ testIdAttributes: y.createAttributes("LoginPage"),
105
105
  title: w`Login`,
106
- children: [/* @__PURE__ */ _(c, {
106
+ children: [/* @__PURE__ */ g(s, {
107
107
  sx: {
108
108
  marginY: 2,
109
109
  textAlign: "center"
110
110
  },
111
- children: /* @__PURE__ */ _(u, {
111
+ children: /* @__PURE__ */ g(l, {
112
112
  component: "p",
113
113
  children: w`You need to login to access this application.`
114
114
  })
115
115
  }), I]
116
116
  });
117
117
  }
118
- return /* @__PURE__ */ v(g, { children: [C, e.getInstance().config.consentDialog?.getShouldShow() && /* @__PURE__ */ _(a, {
118
+ return /* @__PURE__ */ _(h, { children: [C, e.getInstance().config.consentDialog?.getShouldShow() && /* @__PURE__ */ g(i, {
119
119
  onConsent: j,
120
120
  ref: E
121
121
  })] });
@@ -2,39 +2,39 @@ import { n as e } from "../../../_chunks/rolldown-runtime.js";
2
2
  import { LoadableUtil as t } from "../../../utils/LoadableUtil/index.js";
3
3
  import { t as n } from "../../../_chunks/last.js";
4
4
  import { AuthorizationService as r } from "../../../classes/services/AuthorizationService/index.js";
5
- import { u as i } from "../../../_chunks/chunk-OB3PAWPO.js";
6
- import { PageContainer as a } from "../../ui/PageContainer/index.js";
7
- import { ApiService as o } from "../../../classes/services/ApiService/index.js";
8
- import { ResponseHandler as s } from "../../ui/ResponseHandler/index.js";
9
- import { t as c } from "../../../_chunks/useQueryMemo.js";
10
- import { t as l } from "../../../_chunks/QueryClientService.js";
11
- import { COMMON_QUERY_KEY as u } from "../../../constants/query.js";
12
- import { useMemo as d } from "react";
13
- import { jsx as f } from "react/jsx-runtime";
14
- import { useTranslation as p } from "react-i18next";
15
- import { TestIdUtil as m } from "@gen-epix/ui-core/utils/TestIdUtil";
5
+ import { PageContainer as i } from "../../ui/PageContainer/index.js";
6
+ import { ApiService as a } from "../../../classes/services/ApiService/index.js";
7
+ import { ResponseHandler as o } from "../../ui/ResponseHandler/index.js";
8
+ import { t as s } from "../../../_chunks/useQueryMemo.js";
9
+ import { t as c } from "../../../_chunks/QueryClientService.js";
10
+ import { COMMON_QUERY_KEY as l } from "../../../constants/query.js";
11
+ import { useMemo as u } from "react";
12
+ import { jsx as d } from "react/jsx-runtime";
13
+ import { useTranslation as f } from "react-i18next";
14
+ import { TestIdUtil as p } from "@gen-epix/ui-core/utils/TestIdUtil";
15
+ import { useMatches as m } from "react-router-dom";
16
16
  import { useArray as h } from "@gen-epix/ui-core/hooks/useArray";
17
17
  //#region src/components/app/AuthorizationWrapper/AuthorizationWrapper.tsx
18
18
  var g = /* @__PURE__ */ e(n(), 1), _ = ({ children: e }) => {
19
- let { t: n } = p(), _ = i(), v = d(() => (0, g.default)(_).handle.requiresUserProfile, [_]), y = c({
19
+ let { t: n } = f(), _ = m(), v = u(() => (0, g.default)(_).handle.requiresUserProfile, [_]), y = s({
20
20
  enabled: v,
21
21
  gcTime: Infinity,
22
- queryFn: async ({ signal: e }) => (await o.getInstance().organizationApi.userMeGetOne({ signal: e })).data,
23
- queryKey: l.getInstance().getGenericKey(u.USER_ME),
22
+ queryFn: async ({ signal: e }) => (await a.getInstance().organizationApi.userMeGetOne({ signal: e })).data,
23
+ queryKey: c.getInstance().getGenericKey(l.USER_ME),
24
24
  staleTime: Infinity
25
- }), b = c({
25
+ }), b = s({
26
26
  enabled: v,
27
27
  gcTime: Infinity,
28
- queryFn: async ({ signal: e }) => (await o.getInstance().organizationApi.userMeRetrievePermissions({ signal: e })).data,
29
- queryKey: l.getInstance().getGenericKey(u.USER_PERMISSIONS),
28
+ queryFn: async ({ signal: e }) => (await a.getInstance().organizationApi.userMeRetrievePermissions({ signal: e })).data,
29
+ queryKey: c.getInstance().getGenericKey(l.USER_PERMISSIONS),
30
30
  staleTime: Infinity
31
31
  }), x = h([y, b]);
32
- return y.data && (r.getInstance().user = y.data), b.data && (r.getInstance().apiPermissions = b.data), v && (t.isSomeLoading(x) || t.hasSomeError(x)) ? /* @__PURE__ */ f(a, {
32
+ return y.data && (r.getInstance().user = y.data), b.data && (r.getInstance().apiPermissions = b.data), v && (t.isSomeLoading(x) || t.hasSomeError(x)) ? /* @__PURE__ */ d(i, {
33
33
  ignorePageEvent: !0,
34
34
  singleAction: !0,
35
- testIdAttributes: m.createAttributes("LoadingUserDataPage"),
35
+ testIdAttributes: p.createAttributes("LoadingUserDataPage"),
36
36
  title: n`Loading user data`,
37
- children: /* @__PURE__ */ f(s, {
37
+ children: /* @__PURE__ */ d(o, {
38
38
  loadables: x,
39
39
  loadingMessage: n`Loading user data`
40
40
  })
@@ -1 +1 @@
1
- export declare const RouterRoot: () => import("react").JSX.Element;
1
+ export declare const RouterRoot: () => import('react').JSX.Element;
@@ -1,43 +1,42 @@
1
- import { t as e } from "../../../_chunks/oidc-client-ts.js";
2
- import { UserManagerUtil as t } from "../../../utils/UserManagerUtil/index.js";
1
+ import { n as e, t } from "../../../_chunks/UserManagerUtil.js";
3
2
  import { ConfigService as n } from "../../../classes/services/ConfigService/index.js";
4
- import { c as r, n as i } from "../../../_chunks/chunk-OB3PAWPO.js";
5
- import { RouterService as a } from "../../../classes/services/RouterService/index.js";
6
- import { PageContainer as o } from "../../ui/PageContainer/index.js";
7
- import { AuthenticationService as s } from "../../../classes/services/AuthenticationService/index.js";
8
- import { ApiService as c } from "../../../classes/services/ApiService/index.js";
9
- import { LogService as l } from "../../../classes/services/LogService/index.js";
10
- import { t as u } from "../../../_chunks/useQueryMemo.js";
11
- import { t as d } from "../../../_chunks/QueryClientService.js";
12
- import { COMMON_QUERY_KEY as f } from "../../../constants/query.js";
13
- import { t as p } from "../../../_chunks/react-oidc-context.js";
14
- import { NavigationHistoryService as m } from "../../../classes/services/NavigationHistoryService/index.js";
15
- import { ChooseIdentityProviderPage as h } from "../../../pages/ChooseIdentityProviderPage/index.js";
16
- import { t as g } from "../../../_chunks/Notifications.js";
17
- import { UserInactivityConfirmation as _ } from "../../ui/UserInactivityConfirmation/index.js";
18
- import { ApplicationBootstrapWithAuthentication as v } from "../ApplicationBootstrapWithAuthentication/index.js";
19
- import { AuthenticationWrapper as y } from "../AuthenticationWrapper/index.js";
20
- import { AuthorizationWrapper as b } from "../AuthorizationWrapper/index.js";
21
- import { WindowService as x } from "@gen-epix/ui-core/classes/services/WindowService";
22
- import { CommonDbLogLevel as S } from "@gen-epix/api-commondb";
23
- import C from "axios";
24
- import { Box as w, Button as T, Typography as E } from "@mui/material";
25
- import { StrictMode as D, useCallback as O, useEffect as k, useMemo as A } from "react";
26
- import { jsx as j, jsxs as M } from "react/jsx-runtime";
27
- import { useTranslation as N } from "react-i18next";
28
- import { TestIdUtil as P } from "@gen-epix/ui-core/utils/TestIdUtil";
29
- import { useSubscribable as F } from "@gen-epix/ui-core/hooks/useSubscribable";
30
- import { Spinner as I } from "@gen-epix/ui-core-components/components/Spinner";
3
+ import { RouterService as r } from "../../../classes/services/RouterService/index.js";
4
+ import { PageContainer as i } from "../../ui/PageContainer/index.js";
5
+ import { AuthenticationService as a } from "../../../classes/services/AuthenticationService/index.js";
6
+ import { ApiService as o } from "../../../classes/services/ApiService/index.js";
7
+ import { LogService as s } from "../../../classes/services/LogService/index.js";
8
+ import { t as c } from "../../../_chunks/useQueryMemo.js";
9
+ import { t as l } from "../../../_chunks/QueryClientService.js";
10
+ import { COMMON_QUERY_KEY as u } from "../../../constants/query.js";
11
+ import { NavigationHistoryService as d } from "../../../classes/services/NavigationHistoryService/index.js";
12
+ import { ChooseIdentityProviderPage as f } from "../../../pages/ChooseIdentityProviderPage/index.js";
13
+ import { t as p } from "../../../_chunks/Notifications.js";
14
+ import { UserInactivityConfirmation as m } from "../../ui/UserInactivityConfirmation/index.js";
15
+ import { ApplicationBootstrapWithAuthentication as h } from "../ApplicationBootstrapWithAuthentication/index.js";
16
+ import { AuthenticationWrapper as g } from "../AuthenticationWrapper/index.js";
17
+ import { AuthorizationWrapper as _ } from "../AuthorizationWrapper/index.js";
18
+ import { WindowService as v } from "@gen-epix/ui-core/classes/services/WindowService";
19
+ import { CommonDbLogLevel as y } from "@gen-epix/api-commondb";
20
+ import b from "axios";
21
+ import { Box as x, Button as S, Typography as C } from "@mui/material";
22
+ import { StrictMode as w, useCallback as T, useEffect as E, useMemo as D } from "react";
23
+ import { jsx as O, jsxs as k } from "react/jsx-runtime";
24
+ import { useTranslation as A } from "react-i18next";
25
+ import { TestIdUtil as j } from "@gen-epix/ui-core/utils/TestIdUtil";
26
+ import { Outlet as M, useLocation as N } from "react-router-dom";
27
+ import { useSubscribable as P } from "@gen-epix/ui-core/hooks/useSubscribable";
28
+ import { Spinner as F } from "@gen-epix/ui-core-components/components/Spinner";
29
+ import { AuthProvider as I } from "react-oidc-context";
31
30
  //#region src/components/app/RouterRoot/RouterRoot.tsx
32
31
  var L = () => {
33
- let { t: L } = N(), R = r(), z = F(s.getInstance()), { data: B, error: V, isLoading: H } = u({
32
+ let { t: L } = A(), R = N(), z = P(a.getInstance()), { data: B, error: V, isLoading: H } = c({
34
33
  gcTime: Infinity,
35
34
  queryFn: async ({ signal: e }) => {
36
- let t = (await c.getInstance().authApi.identityProvidersGetAll({ signal: e })).data;
35
+ let t = (await o.getInstance().authApi.identityProvidersGetAll({ signal: e })).data;
37
36
  if (!Array.isArray(t)) throw Error("Invalid response for identity providers. Backend is most likely misconfigured.");
38
37
  let n = [];
39
38
  for (let r of t) try {
40
- await C.get(r.discovery_url, {
39
+ await b.get(r.discovery_url, {
41
40
  signal: e,
42
41
  timeout: 3e3
43
42
  }), n.push({
@@ -45,54 +44,54 @@ var L = () => {
45
44
  provider: r
46
45
  });
47
46
  } catch (e) {
48
- console.error(`Identity provider ${r.name} is not available`, e), z?.name === r.name && s.getInstance().next(void 0), n.push({
47
+ console.error(`Identity provider ${r.name} is not available`, e), z?.name === r.name && a.getInstance().next(void 0), n.push({
49
48
  isAvailable: !1,
50
49
  provider: r
51
50
  });
52
51
  }
53
52
  return n;
54
53
  },
55
- queryKey: d.getInstance().getGenericKey(f.IDENTITY_PROVIDERS),
54
+ queryKey: l.getInstance().getGenericKey(u.IDENTITY_PROVIDERS),
56
55
  staleTime: Infinity
57
- }), U = A(() => B?.filter((e) => e.isAvailable) ?? [], [B]);
58
- k(() => {
59
- m.getInstance().navigationHistory.push(R.pathname), l.getInstance().log([{
56
+ }), U = D(() => B?.filter((e) => e.isAvailable) ?? [], [B]);
57
+ E(() => {
58
+ d.getInstance().navigationHistory.push(R.pathname), s.getInstance().log([{
60
59
  detail: { pathname: R.pathname },
61
- level: S.INFO,
60
+ level: y.INFO,
62
61
  topic: "USER_NAVIGATION"
63
62
  }]);
64
- }, [R.pathname]), k(() => {
65
- B?.length === 1 && U.length === 1 && s.getInstance().next(B[0].provider);
63
+ }, [R.pathname]), E(() => {
64
+ B?.length === 1 && U.length === 1 && a.getInstance().next(B[0].provider);
66
65
  }, [U.length, B]);
67
- let W = A(() => {
66
+ let W = D(() => {
68
67
  if (!z || !U?.length) return null;
69
68
  let n = B.find((e) => e.provider.name === z.name)?.provider;
70
- return !n || JSON.stringify(z) !== JSON.stringify(n) ? (s.getInstance().next(void 0), null) : (x.getInstance().window.userManager = new e(t.getSettings(z)), x.getInstance().window.userManager);
69
+ return !n || JSON.stringify(z) !== JSON.stringify(n) ? (a.getInstance().next(void 0), null) : (v.getInstance().window.userManager = new e(t.getSettings(z)), v.getInstance().window.userManager);
71
70
  }, [
72
71
  U,
73
72
  B,
74
73
  z
75
- ]), G = O(() => {
76
- l.getInstance().log([{
77
- level: S.INFO,
74
+ ]), G = T(() => {
75
+ s.getInstance().log([{
76
+ level: y.INFO,
78
77
  topic: "USER_LOGIN"
79
78
  }]);
80
- }, []), K = O(() => {
79
+ }, []), K = T(() => {
81
80
  window.location.reload();
82
81
  }, []);
83
- if (H) return /* @__PURE__ */ j(I, {});
84
- if (V) return /* @__PURE__ */ j(o, {
82
+ if (H) return /* @__PURE__ */ O(F, {});
83
+ if (V) return /* @__PURE__ */ O(i, {
85
84
  singleAction: !0,
86
- testIdAttributes: P.createAttributes("ErrorPage"),
85
+ testIdAttributes: j.createAttributes("ErrorPage"),
87
86
  title: L("Error"),
88
- children: /* @__PURE__ */ M(w, {
87
+ children: /* @__PURE__ */ k(x, {
89
88
  sx: {
90
89
  marginY: 2,
91
90
  textAlign: "center"
92
91
  },
93
- children: [/* @__PURE__ */ j(E, { children: L("{{applicationName}} is currently unavailable. Please try again later.", { applicationName: n.getInstance().config.applicationName }) }), /* @__PURE__ */ j(w, {
92
+ children: [/* @__PURE__ */ O(C, { children: L("{{applicationName}} is currently unavailable. Please try again later.", { applicationName: n.getInstance().config.applicationName }) }), /* @__PURE__ */ O(x, {
94
93
  sx: { marginTop: 2 },
95
- children: /* @__PURE__ */ j(T, {
94
+ children: /* @__PURE__ */ O(S, {
96
95
  onClick: K,
97
96
  variant: "outlined",
98
97
  children: L`Try again`
@@ -100,15 +99,15 @@ var L = () => {
100
99
  })]
101
100
  })
102
101
  });
103
- if (!z) return /* @__PURE__ */ j(h, { identityProvidersWithAvailability: B });
104
- let q = a.getInstance().homePageComponent;
105
- return /* @__PURE__ */ j(p, {
102
+ if (!z) return /* @__PURE__ */ O(f, { identityProvidersWithAvailability: B });
103
+ let q = r.getInstance().homePageComponent;
104
+ return /* @__PURE__ */ O(I, {
106
105
  onSigninCallback: G,
107
106
  userManager: W,
108
- children: /* @__PURE__ */ j(y, { children: /* @__PURE__ */ j(v, { children: /* @__PURE__ */ M(b, { children: [
109
- /* @__PURE__ */ j(_, {}),
110
- /* @__PURE__ */ j(g, {}),
111
- /* @__PURE__ */ j(D, { children: R?.pathname === "/" ? /* @__PURE__ */ j(q, {}) : /* @__PURE__ */ j(i, {}) })
107
+ children: /* @__PURE__ */ O(g, { children: /* @__PURE__ */ O(h, { children: /* @__PURE__ */ k(_, { children: [
108
+ /* @__PURE__ */ O(m, {}),
109
+ /* @__PURE__ */ O(p, {}),
110
+ /* @__PURE__ */ O(w, { children: R?.pathname === "/" ? /* @__PURE__ */ O(q, {}) : /* @__PURE__ */ O(M, {}) })
112
111
  ] }) }) })
113
112
  });
114
113
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/app/RouterRoot/RouterRoot.tsx"],"sourcesContent":["import {\n StrictMode,\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n Outlet,\n useLocation,\n} from 'react-router-dom';\nimport { AuthProvider } from 'react-oidc-context';\nimport { UserManager } from 'oidc-client-ts';\nimport axios from 'axios';\nimport {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\n\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { NavigationHistoryService } from '../../../classes/services/NavigationHistoryService';\nimport { ChooseIdentityProviderPage } from '../../../pages/ChooseIdentityProviderPage';\nimport { UserManagerUtil } from '../../../utils/UserManagerUtil';\nimport { NotificationsStack } from '../../ui/Notifications';\nimport { UserInactivityConfirmation } from '../../ui/UserInactivityConfirmation';\nimport type { IdentityProviderWithAvailability } from '../../../models/auth';\nimport { ConfigService } from '../../../classes/services/ConfigService';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { ApplicationBootstrapWithAuthentication } from '../ApplicationBootstrapWithAuthentication';\nimport { AuthenticationWrapper } from '../AuthenticationWrapper';\nimport { AuthorizationWrapper } from '../AuthorizationWrapper';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../../constants/query';\nimport { RouterService } from '../../../classes/services/RouterService';\nimport { ApiService } from '../../../classes/services/ApiService';\n\n\nexport const RouterRoot = () => {\n const { t } = useTranslation();\n const location = useLocation();\n\n const oidcConfiguration = useSubscribable(AuthenticationService.getInstance());\n\n const { data: identityProvidersWithAvailability, error: identityProvidersError, isLoading: isIdentityProvidersLoading } = useQueryMemo<IdentityProviderWithAvailability[], Error, IdentityProviderWithAvailability[]>({\n gcTime: Infinity,\n queryFn: async ({ signal }) => {\n const providers = (await ApiService.getInstance().authApi.identityProvidersGetAll({ signal })).data;\n if (!Array.isArray(providers)) {\n throw new Error('Invalid response for identity providers. Backend is most likely misconfigured.');\n }\n\n const providersWithAvailability: IdentityProviderWithAvailability[] = [];\n for (const provider of providers) {\n try {\n await axios.get(provider.discovery_url, {\n signal,\n timeout: 3000,\n });\n providersWithAvailability.push({\n isAvailable: true,\n provider,\n });\n } catch (error: unknown) {\n console.error(`Identity provider ${provider.name} is not available`, error);\n if (oidcConfiguration?.name === provider.name) {\n AuthenticationService.getInstance().next(undefined);\n }\n providersWithAvailability.push({\n isAvailable: false,\n provider,\n });\n }\n }\n return providersWithAvailability;\n },\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.IDENTITY_PROVIDERS),\n staleTime: Infinity,\n });\n\n const availableIdentityProviders = useMemo<IdentityProviderWithAvailability[]>(() => {\n return identityProvidersWithAvailability?.filter(x => x.isAvailable) ?? [];\n }, [identityProvidersWithAvailability]);\n\n useEffect(() => {\n NavigationHistoryService.getInstance().navigationHistory.push(location.pathname);\n LogService.getInstance().log([{\n detail: {\n pathname: location.pathname,\n },\n level: CommonDbLogLevel.INFO,\n topic: 'USER_NAVIGATION',\n }]);\n }, [location.pathname]);\n\n useEffect(() => {\n if (identityProvidersWithAvailability?.length === 1 && availableIdentityProviders.length === 1) {\n AuthenticationService.getInstance().next(identityProvidersWithAvailability[0].provider);\n }\n }, [availableIdentityProviders.length, identityProvidersWithAvailability]);\n\n const userManager = useMemo<UserManager>(() => {\n if (!oidcConfiguration || !availableIdentityProviders?.length) {\n return null;\n }\n\n // Validate the storage\n const identityProvider = identityProvidersWithAvailability.find(x => x.provider.name === oidcConfiguration.name)?.provider;\n if (!identityProvider || JSON.stringify(oidcConfiguration) !== JSON.stringify(identityProvider)) {\n AuthenticationService.getInstance().next(undefined);\n return null;\n }\n WindowService.getInstance().window.userManager = new UserManager(UserManagerUtil.getSettings(oidcConfiguration));\n return WindowService.getInstance().window.userManager;\n }, [availableIdentityProviders, identityProvidersWithAvailability, oidcConfiguration]);\n\n const onSignin = useCallback(() => {\n LogService.getInstance().log([{\n level: CommonDbLogLevel.INFO,\n topic: 'USER_LOGIN',\n }]);\n }, []);\n\n const onTryAgainButtonClick = useCallback(() => {\n window.location.reload();\n }, []);\n\n if (isIdentityProvidersLoading) {\n return <Spinner />;\n }\n\n if (identityProvidersError) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('ErrorPage')}\n title={t('Error')}\n >\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Typography>\n {t('{{applicationName}} is currently unavailable. Please try again later.', { applicationName: ConfigService.getInstance().config.applicationName })}\n </Typography>\n <Box sx={{ marginTop: 2 }}>\n <Button\n onClick={onTryAgainButtonClick}\n variant={'outlined'}\n >\n {t`Try again`}\n </Button>\n </Box>\n </Box>\n </PageContainer>\n );\n }\n\n if (!oidcConfiguration) {\n return (\n <ChooseIdentityProviderPage identityProvidersWithAvailability={identityProvidersWithAvailability} />\n );\n }\n\n const HomePage = RouterService.getInstance().homePageComponent;\n\n return (\n <AuthProvider\n onSigninCallback={onSignin}\n userManager={userManager}\n >\n <AuthenticationWrapper>\n <ApplicationBootstrapWithAuthentication>\n <AuthorizationWrapper>\n <UserInactivityConfirmation />\n <NotificationsStack />\n <StrictMode>\n {location?.pathname === '/' ? <HomePage /> : <Outlet />}\n </StrictMode>\n </AuthorizationWrapper>\n </ApplicationBootstrapWithAuthentication>\n </AuthenticationWrapper>\n </AuthProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAa,UAAmB;CAC9B,IAAM,EAAE,SAAM,EAAe,GACvB,IAAW,EAAY,GAEvB,IAAoB,EAAgB,EAAsB,YAAY,CAAC,GAEvE,EAAE,MAAM,GAAmC,OAAO,GAAwB,WAAW,MAA+B,EAA4F;EACpN,QAAQ;EACR,SAAS,OAAO,EAAE,gBAAa;GAC7B,IAAM,KAAa,MAAM,EAAW,YAAY,CAAC,CAAC,QAAQ,wBAAwB,EAAE,UAAO,CAAC,EAAA,CAAG;GAC/F,IAAI,CAAC,MAAM,QAAQ,CAAS,GAC1B,MAAU,MAAM,gFAAgF;GAGlG,IAAM,IAAgE,CAAC;GACvE,KAAK,IAAM,KAAY,GACrB,IAAI;IAKF,AAJA,MAAM,EAAM,IAAI,EAAS,eAAe;KACtC;KACA,SAAS;IACX,CAAC,GACD,EAA0B,KAAK;KAC7B,aAAa;KACb;IACF,CAAC;GACH,SAAS,GAAgB;IAKvB,AAJA,QAAQ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oot.tsx"],"sourcesContent":["import {\n StrictMode,\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n Outlet,\n useLocation,\n} from 'react-router-dom';\nimport { AuthProvider } from 'react-oidc-context';\nimport { UserManager } from 'oidc-client-ts';\nimport axios from 'axios';\nimport {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\n\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { NavigationHistoryService } from '../../../classes/services/NavigationHistoryService';\nimport { ChooseIdentityProviderPage } from '../../../pages/ChooseIdentityProviderPage';\nimport { UserManagerUtil } from '../../../utils/UserManagerUtil';\nimport { NotificationsStack } from '../../ui/Notifications';\nimport { UserInactivityConfirmation } from '../../ui/UserInactivityConfirmation';\nimport type { IdentityProviderWithAvailability } from '../../../models/auth';\nimport { ConfigService } from '../../../classes/services/ConfigService';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { ApplicationBootstrapWithAuthentication } from '../ApplicationBootstrapWithAuthentication';\nimport { AuthenticationWrapper } from '../AuthenticationWrapper';\nimport { AuthorizationWrapper } from '../AuthorizationWrapper';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../../constants/query';\nimport { RouterService } from '../../../classes/services/RouterService';\nimport { ApiService } from '../../../classes/services/ApiService';\n\n\nexport const RouterRoot = () => {\n const { t } = useTranslation();\n const location = useLocation();\n\n const oidcConfiguration = useSubscribable(AuthenticationService.getInstance());\n\n const { data: identityProvidersWithAvailability, error: identityProvidersError, isLoading: isIdentityProvidersLoading } = useQueryMemo<IdentityProviderWithAvailability[], Error, IdentityProviderWithAvailability[]>({\n gcTime: Infinity,\n queryFn: async ({ signal }) => {\n const providers = (await ApiService.getInstance().authApi.identityProvidersGetAll({ signal })).data;\n if (!Array.isArray(providers)) {\n throw new Error('Invalid response for identity providers. Backend is most likely misconfigured.');\n }\n\n const providersWithAvailability: IdentityProviderWithAvailability[] = [];\n for (const provider of providers) {\n try {\n await axios.get(provider.discovery_url, {\n signal,\n timeout: 3000,\n });\n providersWithAvailability.push({\n isAvailable: true,\n provider,\n });\n } catch (error: unknown) {\n console.error(`Identity provider ${provider.name} is not available`, error);\n if (oidcConfiguration?.name === provider.name) {\n AuthenticationService.getInstance().next(undefined);\n }\n providersWithAvailability.push({\n isAvailable: false,\n provider,\n });\n }\n }\n return providersWithAvailability;\n },\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.IDENTITY_PROVIDERS),\n staleTime: Infinity,\n });\n\n const availableIdentityProviders = useMemo<IdentityProviderWithAvailability[]>(() => {\n return identityProvidersWithAvailability?.filter(x => x.isAvailable) ?? [];\n }, [identityProvidersWithAvailability]);\n\n useEffect(() => {\n NavigationHistoryService.getInstance().navigationHistory.push(location.pathname);\n LogService.getInstance().log([{\n detail: {\n pathname: location.pathname,\n },\n level: CommonDbLogLevel.INFO,\n topic: 'USER_NAVIGATION',\n }]);\n }, [location.pathname]);\n\n useEffect(() => {\n if (identityProvidersWithAvailability?.length === 1 && availableIdentityProviders.length === 1) {\n AuthenticationService.getInstance().next(identityProvidersWithAvailability[0].provider);\n }\n }, [availableIdentityProviders.length, identityProvidersWithAvailability]);\n\n const userManager = useMemo<UserManager>(() => {\n if (!oidcConfiguration || !availableIdentityProviders?.length) {\n return null;\n }\n\n // Validate the storage\n const identityProvider = identityProvidersWithAvailability.find(x => x.provider.name === oidcConfiguration.name)?.provider;\n if (!identityProvider || JSON.stringify(oidcConfiguration) !== JSON.stringify(identityProvider)) {\n AuthenticationService.getInstance().next(undefined);\n return null;\n }\n WindowService.getInstance().window.userManager = new UserManager(UserManagerUtil.getSettings(oidcConfiguration));\n return WindowService.getInstance().window.userManager;\n }, [availableIdentityProviders, identityProvidersWithAvailability, oidcConfiguration]);\n\n const onSignin = useCallback(() => {\n LogService.getInstance().log([{\n level: CommonDbLogLevel.INFO,\n topic: 'USER_LOGIN',\n }]);\n }, []);\n\n const onTryAgainButtonClick = useCallback(() => {\n window.location.reload();\n }, []);\n\n if (isIdentityProvidersLoading) {\n return <Spinner />;\n }\n\n if (identityProvidersError) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('ErrorPage')}\n title={t('Error')}\n >\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Typography>\n {t('{{applicationName}} is currently unavailable. Please try again later.', { applicationName: ConfigService.getInstance().config.applicationName })}\n </Typography>\n <Box sx={{ marginTop: 2 }}>\n <Button\n onClick={onTryAgainButtonClick}\n variant={'outlined'}\n >\n {t`Try again`}\n </Button>\n </Box>\n </Box>\n </PageContainer>\n );\n }\n\n if (!oidcConfiguration) {\n return (\n <ChooseIdentityProviderPage identityProvidersWithAvailability={identityProvidersWithAvailability} />\n );\n }\n\n const HomePage = RouterService.getInstance().homePageComponent;\n\n return (\n <AuthProvider\n onSigninCallback={onSignin}\n userManager={userManager}\n >\n <AuthenticationWrapper>\n <ApplicationBootstrapWithAuthentication>\n <AuthorizationWrapper>\n <UserInactivityConfirmation />\n <NotificationsStack />\n <StrictMode>\n {location?.pathname === '/' ? <HomePage /> : <Outlet />}\n </StrictMode>\n </AuthorizationWrapper>\n </ApplicationBootstrapWithAuthentication>\n </AuthenticationWrapper>\n </AuthProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAa,UAAmB;CAC9B,IAAM,EAAE,SAAM,EAAe,GACvB,IAAW,EAAY,GAEvB,IAAoB,EAAgB,EAAsB,YAAY,CAAC,G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CAAA;CAIvG,IAAM,IAAW,EAAc,YAAY,CAAC,CAAC;CAE7C,OACE,kBAAC,GAAD;EACE,kBAAkB;EACL;EAEb,UAAA,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD,CAA6B,CAAA;GAC7B,kBAAC,GAAD,CAAqB,CAAA;GACrB,kBAAC,GAAD,EAAA,UACG,GAAU,aAAa,MAAM,kBAAC,GAAD,CAAW,CAAA,IAAI,kBAAC,GAAD,CAAS,CAAA,EAC5C,CAAA;EACQ,EAAA,CAAA,EACgB,CAAA,EACnB,CAAA;CACX,CAAA;AAElB"}
@@ -2,4 +2,4 @@ import { BooleanFilter } from '../../../classes/filters/BooleanFilter';
2
2
  export type BooleanFilterFieldProps = {
3
3
  readonly filter: BooleanFilter;
4
4
  };
5
- export declare const BooleanFilterField: ({ filter }: BooleanFilterFieldProps) => import("react").JSX.Element;
5
+ export declare const BooleanFilterField: ({ filter }: BooleanFilterFieldProps) => import('react').JSX.Element;
@@ -2,4 +2,4 @@ import { DateFilter } from '../../../classes/filters/DateFilter';
2
2
  export type DateFilterFieldProps = {
3
3
  readonly filter: DateFilter;
4
4
  };
5
- export declare const DateFilterField: ({ filter }: DateFilterFieldProps) => import("react").JSX.Element;
5
+ export declare const DateFilterField: ({ filter }: DateFilterFieldProps) => import('react').JSX.Element;