@gen-epix/ui-client-common 4.3.2 → 4.4.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.
Files changed (361) hide show
  1. package/README.md +9 -10
  2. package/dist/@types/mui.d.ts +1 -1
  3. package/dist/_chunks/ApplicationFooter.js +49 -49
  4. package/dist/_chunks/ApplicationFooter.js.map +1 -1
  5. package/dist/_chunks/Breadcrumbs.js +23 -22
  6. package/dist/_chunks/Breadcrumbs.js.map +1 -1
  7. package/dist/_chunks/CrudPage.js +211 -210
  8. package/dist/_chunks/CrudPage.js.map +1 -1
  9. package/dist/_chunks/GeoFilter.js.map +1 -1
  10. package/dist/_chunks/Notifications.js +67 -66
  11. package/dist/_chunks/Notifications.js.map +1 -1
  12. package/dist/_chunks/OutageList.js +30 -30
  13. package/dist/_chunks/OutageList.js.map +1 -1
  14. package/dist/_chunks/OutageUtil.js +2 -2
  15. package/dist/_chunks/OutageUtil.js.map +1 -1
  16. package/dist/_chunks/QueryClientProvider.js +1 -1
  17. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  18. package/dist/_chunks/QueryClientService.js +405 -115
  19. package/dist/_chunks/QueryClientService.js.map +1 -1
  20. package/dist/_chunks/Reflect.js +642 -0
  21. package/dist/_chunks/Reflect.js.map +1 -0
  22. package/dist/_chunks/Table.js +572 -574
  23. package/dist/_chunks/Table.js.map +1 -1
  24. package/dist/_chunks/TableUtil.js +5 -5
  25. package/dist/_chunks/TableUtil.js.map +1 -1
  26. package/dist/_chunks/TextFilter.js +1 -1
  27. package/dist/_chunks/TextFilter.js.map +1 -1
  28. package/dist/_chunks/UserInvitationsAdminPage.js +109 -107
  29. package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
  30. package/dist/_chunks/UserManagerUtil.js +7 -15
  31. package/dist/_chunks/UserManagerUtil.js.map +1 -1
  32. package/dist/_chunks/_baseAssignValue.js.map +1 -1
  33. package/dist/_chunks/_baseFlatten.js +8 -8
  34. package/dist/_chunks/_baseFlatten.js.map +1 -1
  35. package/dist/_chunks/_baseUnset.js +299 -22
  36. package/dist/_chunks/_baseUnset.js.map +1 -1
  37. package/dist/_chunks/_cacheHas.js.map +1 -1
  38. package/dist/_chunks/_setToString.js.map +1 -1
  39. package/dist/_chunks/decorate.js +9 -0
  40. package/dist/_chunks/decorateParam.js +8 -0
  41. package/dist/_chunks/format.js.map +1 -1
  42. package/dist/_chunks/isArrayLike.js.map +1 -1
  43. package/dist/_chunks/isObject.js.map +1 -1
  44. package/dist/_chunks/isSymbol.js.map +1 -1
  45. package/dist/_chunks/middleware.js +1 -1
  46. package/dist/_chunks/middleware.js.map +1 -1
  47. package/dist/_chunks/omit.js +39 -40
  48. package/dist/_chunks/omit.js.map +1 -1
  49. package/dist/_chunks/query.js +13 -17
  50. package/dist/_chunks/query.js.map +1 -1
  51. package/dist/_chunks/react.js +1 -1
  52. package/dist/_chunks/react.js.map +1 -1
  53. package/dist/_chunks/tableStore.js +40 -54
  54. package/dist/_chunks/tableStore.js.map +1 -1
  55. package/dist/_chunks/toDate.js.map +1 -1
  56. package/dist/_chunks/useColumnsMenu.js +2 -2
  57. package/dist/_chunks/useColumnsMenu.js.map +1 -1
  58. package/dist/_chunks/useMutation.js +31 -30
  59. package/dist/_chunks/useMutation.js.map +1 -1
  60. package/dist/_chunks/useQueryMemo.js +5 -5
  61. package/dist/_chunks/useQueryMemo.js.map +1 -1
  62. package/dist/_chunks/vanilla.js +1 -1
  63. package/dist/_chunks/vanilla.js.map +1 -1
  64. package/dist/_chunks/yup.js +2 -2
  65. package/dist/_chunks/yup.js.map +1 -1
  66. package/dist/classes/TableEventBus/TableEventBus.d.ts +1 -1
  67. package/dist/classes/TableEventBus/index.js.map +1 -1
  68. package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
  69. package/dist/classes/containers/UiClientCommonContainer/UiClientCommonContainer.d.ts +5 -0
  70. package/dist/classes/containers/UiClientCommonContainer/index.d.ts +1 -0
  71. package/dist/classes/containers/UiClientCommonContainer/index.js +17 -0
  72. package/dist/classes/containers/UiClientCommonContainer/index.js.map +1 -0
  73. package/dist/classes/filters/BooleanFilter.d.ts +1 -1
  74. package/dist/classes/filters/DateFilter.d.ts +2 -2
  75. package/dist/classes/filters/GeoFilter.d.ts +2 -2
  76. package/dist/classes/filters/MultiSelectFilter.d.ts +2 -2
  77. package/dist/classes/filters/NumberRangeFilter.d.ts +1 -1
  78. package/dist/classes/filters/TextFilter.d.ts +1 -1
  79. package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +5 -3
  80. package/dist/classes/services/AuthenticationService/index.js +34 -661
  81. package/dist/classes/services/AuthenticationService/index.js.map +1 -1
  82. package/dist/classes/services/AuthorizationService/AuthorizationService.d.ts +4 -4
  83. package/dist/classes/services/AuthorizationService/index.js +12 -10
  84. package/dist/classes/services/AuthorizationService/index.js.map +1 -1
  85. package/dist/classes/services/BackendVersionService/BackendVersionService.d.ts +0 -3
  86. package/dist/classes/services/BackendVersionService/index.js +5 -8
  87. package/dist/classes/services/BackendVersionService/index.js.map +1 -1
  88. package/dist/classes/services/BreadcrumbService/BreadcrumbService.d.ts +1 -3
  89. package/dist/classes/services/BreadcrumbService/index.js +19 -21
  90. package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
  91. package/dist/classes/services/EmotionCacheService/EmotionCacheService.d.ts +4 -4
  92. package/dist/classes/services/EmotionCacheService/index.js +17 -14
  93. package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
  94. package/dist/classes/services/FeatureFlagsService/FeatureFlagsService.d.ts +0 -3
  95. package/dist/classes/services/FeatureFlagsService/index.js +5 -8
  96. package/dist/classes/services/FeatureFlagsService/index.js.map +1 -1
  97. package/dist/classes/services/I18nService/I18nService.d.ts +3 -3
  98. package/dist/classes/services/I18nService/index.js +25 -29
  99. package/dist/classes/services/I18nService/index.js.map +1 -1
  100. package/dist/classes/services/InactivityService/InactivityService.d.ts +6 -3
  101. package/dist/classes/services/InactivityService/index.js +42 -36
  102. package/dist/classes/services/InactivityService/index.js.map +1 -1
  103. package/dist/classes/services/LogService/LogService.d.ts +7 -4
  104. package/dist/classes/services/LogService/index.js +39 -32
  105. package/dist/classes/services/LogService/index.js.map +1 -1
  106. package/dist/classes/services/NavigationHistoryService/NavigationHistoryService.d.ts +0 -3
  107. package/dist/classes/services/NavigationHistoryService/index.js +5 -8
  108. package/dist/classes/services/NavigationHistoryService/index.js.map +1 -1
  109. package/dist/classes/services/NotificationService/NotificationService.d.ts +4 -4
  110. package/dist/classes/services/NotificationService/index.js +21 -21
  111. package/dist/classes/services/NotificationService/index.js.map +1 -1
  112. package/dist/classes/services/PageEventBusService/PageEventBusService.d.ts +4 -3
  113. package/dist/classes/services/PageEventBusService/index.js +18 -15
  114. package/dist/classes/services/PageEventBusService/index.js.map +1 -1
  115. package/dist/classes/services/QueryClientService/QueryClientService.d.ts +6 -7
  116. package/dist/classes/services/QueryClientService/index.js +1 -2
  117. package/dist/classes/services/RouterService/RouterService.d.ts +6 -9
  118. package/dist/classes/services/RouterService/index.js +8 -12
  119. package/dist/classes/services/RouterService/index.js.map +1 -1
  120. package/dist/classes/services/UserSettingsService/UserSettingsService.d.ts +0 -3
  121. package/dist/classes/services/UserSettingsService/index.js +5 -8
  122. package/dist/classes/services/UserSettingsService/index.js.map +1 -1
  123. package/dist/components/app/App/App.d.ts +5 -1
  124. package/dist/components/app/App/index.js +31 -37
  125. package/dist/components/app/App/index.js.map +1 -1
  126. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +50 -49
  127. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  128. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +42 -41
  129. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
  130. package/dist/components/app/AuthenticationWrapper/index.js +68 -67
  131. package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
  132. package/dist/components/app/AuthorizationWrapper/index.js +33 -32
  133. package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
  134. package/dist/components/app/RouterRoot/index.js +62 -61
  135. package/dist/components/app/RouterRoot/index.js.map +1 -1
  136. package/dist/components/epi/EpiContactDetailsDialog/index.js +38 -37
  137. package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
  138. package/dist/components/filters/BooleanFilterField/index.js +5 -5
  139. package/dist/components/filters/BooleanFilterField/index.js.map +1 -1
  140. package/dist/components/filters/DateFilterField/index.js +3 -3
  141. package/dist/components/filters/DateFilterField/index.js.map +1 -1
  142. package/dist/components/filters/GeoFilterField/index.js +4 -4
  143. package/dist/components/filters/GeoFilterField/index.js.map +1 -1
  144. package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
  145. package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -1
  146. package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
  147. package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -1
  148. package/dist/components/filters/TextFilterField/index.js +3 -3
  149. package/dist/components/filters/TextFilterField/index.js.map +1 -1
  150. package/dist/components/ui/ApplicationBar/index.js +242 -241
  151. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  152. package/dist/components/ui/ApplicationFooter/index.js +1 -2
  153. package/dist/components/ui/Breadcrumbs/Breadcrumb.d.ts +1 -1
  154. package/dist/components/ui/Breadcrumbs/index.js +1 -2
  155. package/dist/components/ui/ConsentDialog/index.js +11 -6
  156. package/dist/components/ui/ConsentDialog/index.js.map +1 -1
  157. package/dist/components/ui/GenericErrorMessage/index.js +51 -50
  158. package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
  159. package/dist/components/ui/LicensesDialog/index.js +66 -69
  160. package/dist/components/ui/LicensesDialog/index.js.map +1 -1
  161. package/dist/components/ui/MyPermissionsDialog/index.js +26 -25
  162. package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
  163. package/dist/components/ui/NavLink/index.js +6 -6
  164. package/dist/components/ui/NavLink/index.js.map +1 -1
  165. package/dist/components/ui/Notifications/NotificationItem.d.ts +1 -1
  166. package/dist/components/ui/Notifications/index.js +1 -2
  167. package/dist/components/ui/OrganizationSwitcherDialog/index.js +69 -76
  168. package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
  169. package/dist/components/ui/OutageList/index.js +1 -2
  170. package/dist/components/ui/OutagesDialog/index.js.map +1 -1
  171. package/dist/components/ui/PageContainer/PageContainer.d.ts +1 -1
  172. package/dist/components/ui/PageContainer/index.js +57 -52
  173. package/dist/components/ui/PageContainer/index.js.map +1 -1
  174. package/dist/components/ui/ResponseHandler/ResponseHandler.d.ts +1 -1
  175. package/dist/components/ui/ResponseHandler/index.js.map +1 -1
  176. package/dist/components/ui/Sidebar/SidebarItem.d.ts +1 -1
  177. package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +1 -1
  178. package/dist/components/ui/Sidebar/index.js +45 -45
  179. package/dist/components/ui/Sidebar/index.js.map +1 -1
  180. package/dist/components/ui/Table/Table.d.ts +1 -1
  181. package/dist/components/ui/Table/TableActionsCell.d.ts +1 -1
  182. package/dist/components/ui/Table/TableCell.d.ts +1 -1
  183. package/dist/components/ui/Table/TableCheckboxCell.d.ts +1 -1
  184. package/dist/components/ui/Table/TableCheckboxHeader.d.ts +1 -1
  185. package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +1 -1
  186. package/dist/components/ui/Table/TableFilter.d.ts +2 -2
  187. package/dist/components/ui/Table/TableHeaderCell.d.ts +1 -1
  188. package/dist/components/ui/Table/TableHeaderFilter.d.ts +2 -2
  189. package/dist/components/ui/Table/TableReadableIndexCell.d.ts +1 -1
  190. package/dist/components/ui/Table/index.js +1 -2
  191. package/dist/components/ui/UserFeedbackDialog/index.js +65 -64
  192. package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
  193. package/dist/components/ui/UserInactivityConfirmation/index.js +26 -25
  194. package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
  195. package/dist/constants/config.constants.d.ts +5 -0
  196. package/dist/constants/config.constants.js +6 -0
  197. package/dist/constants/config.constants.js.map +1 -0
  198. package/dist/constants/{query.js → query.constants.js} +2 -2
  199. package/dist/constants/query.constants.js.map +1 -0
  200. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +6 -2
  201. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +2 -2
  202. package/dist/context/uiClientCommonConfigContext/index.js +28 -12
  203. package/dist/context/uiClientCommonConfigContext/index.js.map +1 -1
  204. package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +2 -1
  205. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +17 -16
  206. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
  207. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/useIdentifierIssuerOwnOrganizationQuery.d.ts +1 -1
  208. package/dist/dataHooks/useIdentifierIssuerQuery/index.js +18 -17
  209. package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
  210. package/dist/dataHooks/useIdentifierIssuerQuery/useIdentifierIssuerQuery.d.ts +1 -1
  211. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +11 -10
  212. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
  213. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +22 -21
  214. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
  215. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/useOrganizationAdminPoliciesQuery.d.ts +1 -1
  216. package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +8 -7
  217. package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
  218. package/dist/dataHooks/useOrganizationsQuery/index.js +17 -16
  219. package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
  220. package/dist/dataHooks/useOrganizationsQuery/useOrganizationsQuery.d.ts +1 -1
  221. package/dist/dataHooks/useUsersQuery/index.js +18 -17
  222. package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
  223. package/dist/dataHooks/useUsersQuery/useUsersQuery.d.ts +1 -1
  224. package/dist/hoc/withPermissions/index.js +12 -11
  225. package/dist/hoc/withPermissions/index.js.map +1 -1
  226. package/dist/hooks/useColumnsMenu/index.js +1 -2
  227. package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +2 -2
  228. package/dist/hooks/useConfig/index.d.ts +1 -0
  229. package/dist/hooks/useConfig/index.js +7 -0
  230. package/dist/hooks/useConfig/index.js.map +1 -0
  231. package/dist/hooks/useConfig/useConfig.d.ts +2 -0
  232. package/dist/hooks/useCreateMutation/index.js +25 -24
  233. package/dist/hooks/useCreateMutation/index.js.map +1 -1
  234. package/dist/hooks/useCreateMutation/useCreateMutation.d.ts +1 -1
  235. package/dist/hooks/useDeleteMutation/index.js +24 -23
  236. package/dist/hooks/useDeleteMutation/index.js.map +1 -1
  237. package/dist/hooks/useDeleteMutation/useDeleteMutation.d.ts +1 -1
  238. package/dist/hooks/useEditMutation/index.js +33 -32
  239. package/dist/hooks/useEditMutation/index.js.map +1 -1
  240. package/dist/hooks/useEditMutation/useEditMutation.d.ts +1 -1
  241. package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
  242. package/dist/hooks/useInitializeTableStore/useInitializeTableStore.d.ts +1 -1
  243. package/dist/hooks/useItemQuery/index.js +36 -35
  244. package/dist/hooks/useItemQuery/index.js.map +1 -1
  245. package/dist/hooks/useItemQuery/useItemQuery.d.ts +1 -1
  246. package/dist/hooks/useQueryMemo/index.js +1 -2
  247. package/dist/hooks/useUpdateBreadcrumb/index.js +10 -9
  248. package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
  249. package/dist/hooks/useUpdateDocumentTitle/index.js +4 -3
  250. package/dist/hooks/useUpdateDocumentTitle/index.js.map +1 -1
  251. package/dist/models/{admin.js → admin.models.js} +2 -2
  252. package/dist/models/admin.models.js.map +1 -0
  253. package/dist/models/api.models.d.ts +16 -0
  254. package/dist/models/api.models.js +6 -0
  255. package/dist/models/api.models.js.map +1 -0
  256. package/dist/models/{dataHooks.d.ts → data-hooks.models.d.ts} +1 -1
  257. package/dist/models/{table.d.ts → table.models.d.ts} +2 -2
  258. package/dist/models/{table.js → table.models.js} +2 -2
  259. package/dist/models/table.models.js.map +1 -0
  260. package/dist/pages/AcceptInvitationPage/index.js +40 -39
  261. package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
  262. package/dist/pages/AdminPage/index.js +39 -38
  263. package/dist/pages/AdminPage/index.js.map +1 -1
  264. package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +1 -1
  265. package/dist/pages/ChooseIdentityProviderPage/index.js +38 -37
  266. package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
  267. package/dist/pages/CrudPage/CrudPage.d.ts +6 -6
  268. package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +1 -1
  269. package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +2 -2
  270. package/dist/pages/CrudPage/index.js +1 -2
  271. package/dist/pages/ErrorPage/index.js.map +1 -1
  272. package/dist/pages/IdentifierIssuersAdminPage/index.js +41 -40
  273. package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
  274. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +58 -57
  275. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
  276. package/dist/pages/OrganizationContactsAdminPage/index.js +49 -48
  277. package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
  278. package/dist/pages/OrganizationSitesAdminPage/index.js +44 -43
  279. package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
  280. package/dist/pages/OrganizationsAdminPage/index.js +57 -56
  281. package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
  282. package/dist/pages/OutagesAdminPage/index.js +63 -62
  283. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  284. package/dist/pages/PostLoginPage/index.js +14 -13
  285. package/dist/pages/PostLoginPage/index.js.map +1 -1
  286. package/dist/pages/PostLogoutPage/index.js +19 -18
  287. package/dist/pages/PostLogoutPage/index.js.map +1 -1
  288. package/dist/pages/RouterErrorPage/index.js.map +1 -1
  289. package/dist/pages/UserInvitationsAdminPage/index.js +1 -2
  290. package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +1 -1
  291. package/dist/pages/UsersAdminPage/index.js +110 -109
  292. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  293. package/dist/routes/adminRoutes.d.ts +1 -1
  294. package/dist/routes/index.js +1 -1
  295. package/dist/routes/index.js.map +1 -1
  296. package/dist/routes/routes.d.ts +1 -1
  297. package/dist/setup/setup.js.map +1 -1
  298. package/dist/stores/oidcStore/index.js.map +1 -1
  299. package/dist/stores/outagesStore/index.js.map +1 -1
  300. package/dist/stores/outagesStore/outagesStore.d.ts +1 -1
  301. package/dist/stores/tableStore/index.js +1 -2
  302. package/dist/stores/tableStore/tableStore.d.ts +2 -2
  303. package/dist/theme/demoTheme/index.js.map +1 -1
  304. package/dist/utils/AxiosUtil/index.js.map +1 -1
  305. package/dist/utils/DataHookUtil/DataHookUtil.d.ts +1 -1
  306. package/dist/utils/DataHookUtil/index.js.map +1 -1
  307. package/dist/utils/LoadableUtil/LoadableUtil.d.ts +1 -1
  308. package/dist/utils/LoadableUtil/index.js.map +1 -1
  309. package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +1 -1
  310. package/dist/utils/MenuDataUtil/index.js.map +1 -1
  311. package/dist/utils/NotificationUtil/index.js.map +1 -1
  312. package/dist/utils/OutageUtil/OutageUtil.d.ts +1 -1
  313. package/dist/utils/OutageUtil/index.js +1 -2
  314. package/dist/utils/StandardConfigUtil/StandardConfigUtil.d.ts +1 -1
  315. package/dist/utils/StandardConfigUtil/index.js.map +1 -1
  316. package/dist/utils/TableUtil/TableUtil.d.ts +4 -4
  317. package/dist/utils/TableUtil/index.js +1 -2
  318. package/dist/utils/TimeUtil/index.js.map +1 -1
  319. package/dist/utils/UserManagerUtil/index.js +1 -2
  320. package/dist/utils/UserUtil/index.js.map +1 -1
  321. package/package.json +92 -86
  322. package/dist/_chunks/_baseGet.js +0 -280
  323. package/dist/_chunks/_baseGet.js.map +0 -1
  324. package/dist/_chunks/_baseIteratee.js +0 -274
  325. package/dist/_chunks/_baseIteratee.js.map +0 -1
  326. package/dist/_chunks/last.js +0 -13
  327. package/dist/_chunks/last.js.map +0 -1
  328. package/dist/_chunks/uniq.js +0 -44
  329. package/dist/_chunks/uniq.js.map +0 -1
  330. package/dist/classes/services/ApiService/ApiService.d.ts +0 -19
  331. package/dist/classes/services/ApiService/index.d.ts +0 -1
  332. package/dist/classes/services/ApiService/index.js +0 -21
  333. package/dist/classes/services/ApiService/index.js.map +0 -1
  334. package/dist/classes/services/ConfigService/ConfigService.d.ts +0 -9
  335. package/dist/classes/services/ConfigService/index.d.ts +0 -1
  336. package/dist/classes/services/ConfigService/index.js +0 -21
  337. package/dist/classes/services/ConfigService/index.js.map +0 -1
  338. package/dist/constants/query.js.map +0 -1
  339. package/dist/models/admin.js.map +0 -1
  340. package/dist/models/api.d.ts +0 -9
  341. package/dist/models/table.js.map +0 -1
  342. package/dist/models/theme.js +0 -0
  343. /package/dist/constants/{query.d.ts → query.constants.d.ts} +0 -0
  344. /package/dist/models/{admin.d.ts → admin.models.d.ts} +0 -0
  345. /package/dist/models/{auth.d.ts → auth.models.d.ts} +0 -0
  346. /package/dist/models/{api.js → auth.models.js} +0 -0
  347. /package/dist/models/{config.d.ts → config.models.d.ts} +0 -0
  348. /package/dist/models/{auth.js → config.models.js} +0 -0
  349. /package/dist/models/{config.js → data-hooks.models.js} +0 -0
  350. /package/dist/models/{data.d.ts → data.models.d.ts} +0 -0
  351. /package/dist/models/{data.js → data.models.js} +0 -0
  352. /package/dist/models/{filter.d.ts → filter.models.d.ts} +0 -0
  353. /package/dist/models/{dataHooks.js → filter.models.js} +0 -0
  354. /package/dist/models/{notification.d.ts → notification.models.d.ts} +0 -0
  355. /package/dist/models/{filter.js → notification.models.js} +0 -0
  356. /package/dist/models/{outage.d.ts → outage.models.d.ts} +0 -0
  357. /package/dist/models/{notification.js → outage.models.js} +0 -0
  358. /package/dist/models/{reactRouter.d.ts → react-router.models.d.ts} +0 -0
  359. /package/dist/models/{outage.js → react-router.models.js} +0 -0
  360. /package/dist/models/{theme.d.ts → theme.models.d.ts} +0 -0
  361. /package/dist/models/{reactRouter.js → theme.models.js} +0 -0
@@ -1 +1 @@
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
+ {"version":3,"file":"index.js","names":["rootContainer","container","rootContainer","QueryClientService","AppRouterProvider","RouterProvider","container","RouterService","App","container$1","config","resolveConfig","authenticationService","AuthenticationService","logService","LogService","touchIconUrl","api","API_BASE_TOKEN","BackendVersionService","queryClientService","emotionCache","EmotionCacheService","UiClientCommonConfigContextProvider","QueryClientProvider","CacheProvider","ThemeProvider","CssBaseline","ErrorBoundary","ErrorPage","ApplicationBootstrapWithoutAuthorization"],"sources":["../../../../src/components/app/AppRouterProvider/AppRouterProvider.tsx","../../../../src/components/app/App/App.tsx"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport { RouterProvider } from 'react-router-dom';\n\nimport { RouterService } from '../../../classes/services/RouterService';\n\nexport const AppRouterProvider = () => <RouterProvider router={rootContainer.resolve(RouterService).router} />;\n","import { container as rootContainer } from 'tsyringe';\nimport { 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';\n\nimport { API_BASE_TOKEN } from '../../../models/api.models';\nimport { BackendVersionService } from '../../../classes/services/BackendVersionService';\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 { ApplicationBootstrapWithoutAuthorization } from '../ApplicationBootstrapWithoutAuthorization';\nimport { AppRouterProvider } from '../AppRouterProvider/AppRouterProvider';\nimport { UiClientCommonConfigContextProvider } from '../../../context/uiClientCommonConfigContext';\nimport type { UiClientCommonContainer } from '../../../classes/containers/UiClientCommonContainer';\nimport { resolveConfig } from '../../../classes/containers/UiClientCommonContainer';\nimport type { ConfigBase } from '../../../models/config.models';\n\nexport type AppProps = {\n readonly container: UiClientCommonContainer;\n};\n\nexport const App = ({ container }: AppProps) => {\n const config = resolveConfig<ConfigBase>(container);\n\n const authenticationService = rootContainer.resolve(AuthenticationService);\n const logService = rootContainer.resolve(LogService);\n const touchIconUrl = config.getTouchIconUrl();\n if (touchIconUrl) {\n document.querySelector('link[rel=\"icon\"]')?.setAttribute('href', touchIconUrl);\n }\n const api = rootContainer.resolve(API_BASE_TOKEN);\n api.baseUrl = config.getAPIBaseUrl();\n api.defaultRequestTimeout = config.defaultRequestTimeout;\n api.onRequest = [\n authenticationService.onRequest.bind(authenticationService),\n logService.onRequest.bind(logService),\n ];\n api.onResponseFulfilled = [\n logService.onResponseFulfilled.bind(logService),\n rootContainer.resolve(BackendVersionService).onResponseFulfilled.bind(rootContainer.resolve(BackendVersionService)),\n ];\n api.onResponseRejected = [\n logService.onResponseRejected.bind(logService),\n authenticationService.onResponseRejected.bind(authenticationService),\n ];\n\n const queryClientService = container.resolve(QueryClientService);\n const emotionCache = container.resolve(EmotionCacheService).emotionCache;\n\n return (\n <UiClientCommonConfigContextProvider container={container}>\n <QueryClientProvider client={queryClientService.queryClient}>\n <CacheProvider value={emotionCache}>\n <ThemeProvider theme={config.theme}>\n <CssBaseline />\n <ErrorBoundary FallbackComponent={ErrorPage}>\n <ApplicationBootstrapWithoutAuthorization>\n <AppRouterProvider />\n </ApplicationBootstrapWithoutAuthorization>\n </ErrorBoundary>\n </ThemeProvider>\n </CacheProvider>\n </QueryClientProvider>\n </UiClientCommonConfigContextProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,IAAaI,UAA0B,kBAACC,GAAD,EAAgB,QAAQL,EAAc,QAAQO,CAAa,CAAC,CAAC,OAAS,CAAA,GCsBhGC,KAAO,EAAE,WAAAC,QAA0B;CAC9C,IAAMC,IAASC,EAA0BV,CAAS,GAE5CW,IAAwBV,EAAc,QAAQW,CAAqB,GACnEC,IAAaZ,EAAc,QAAQa,CAAU,GAC7CC,IAAeN,EAAO,gBAAgB;CAC5C,AAAIM,KACF,SAAS,cAAc,oBAAkB,CAAC,EAAE,aAAa,QAAQA,CAAY;CAE/E,IAAMC,IAAMf,EAAc,QAAQgB,CAAc;CAWhD,AAVA,EAAI,UAAUR,EAAO,cAAc,GACnC,EAAI,wBAAwBA,EAAO,uBACnC,EAAI,YAAY,CACdE,EAAsB,UAAU,KAAKA,CAAqB,GAC1DE,EAAW,UAAU,KAAKA,CAAU,CACtC,GACA,EAAI,sBAAsB,CACxBA,EAAW,oBAAoB,KAAKA,CAAU,GAC9CZ,EAAc,QAAQiB,CAAqB,CAAC,CAAC,oBAAoB,KAAKjB,EAAc,QAAQiB,CAAqB,CAAC,CACpH,GACA,EAAI,qBAAqB,CACvBL,EAAW,mBAAmB,KAAKA,CAAU,GAC7CF,EAAsB,mBAAmB,KAAKA,CAAqB,CACrE;CAEA,IAAMQ,IAAqBnB,EAAU,QAAQE,CAAkB,GACzDkB,IAAepB,EAAU,QAAQqB,CAAmB,CAAC,CAAC;CAE5D,OACE,kBAACC,GAAD;EAAgD,WAAAd;EAC9C,UAAA,kBAACe,GAAD;GAAqB,QAAQJ,EAAmB;GAC9C,UAAA,kBAACK,GAAD;IAAe,OAAOJ;IACpB,UAAA,kBAACK,GAAD;KAAe,OAAOhB,EAAO;KAA7B,UAAA,CACE,kBAACiB,GAAD,CAAc,CAAA,GACd,kBAACC,GAAD;MAAe,mBAAmBC;MAChC,UAAA,kBAACC,GAAD,EAAA,UACE,kBAAC1B,GAAD,CAAoB,CAAA,EACoB,CAAA;KAC7B,CAAA,CACF;;GACF,CAAA;EACI,CAAA;CACc,CAAA;AAEzC"}
@@ -1,81 +1,82 @@
1
1
  import { t as e } from "../../../_chunks/OutageUtil.js";
2
- import { t } from "../../../_chunks/react.js";
3
- import { outagesStore as n } from "../../../stores/outagesStore/index.js";
4
- import { PageContainer as r } from "../../ui/PageContainer/index.js";
5
- import { ApiService as i } from "../../../classes/services/ApiService/index.js";
6
- import { ResponseHandler as a } from "../../ui/ResponseHandler/index.js";
7
- import { t as o } from "../../../_chunks/useQueryMemo.js";
8
- import { t as s } from "../../../_chunks/QueryClientService.js";
9
- import { COMMON_QUERY_KEY as c } from "../../../constants/query.js";
2
+ import { t } from "../../../_chunks/QueryClientService.js";
3
+ import { t as n } from "../../../_chunks/useQueryMemo.js";
4
+ import { t as r } from "../../../_chunks/react.js";
5
+ import { outagesStore as i } from "../../../stores/outagesStore/index.js";
6
+ import { API_SYSTEM_TOKEN as a } from "../../../models/api.models.js";
7
+ import { PageContainer as o } from "../../ui/PageContainer/index.js";
8
+ import { ResponseHandler as s } from "../../ui/ResponseHandler/index.js";
9
+ import { COMMON_QUERY_KEY as c } from "../../../constants/query.constants.js";
10
10
  import { t as l } from "../../../_chunks/OutageList.js";
11
11
  import "../../ui/OutageList/index.js";
12
12
  import { WindowService as u } from "@gen-epix/ui-core/classes/services/WindowService";
13
- import { Box as d, Button as f } from "@mui/material";
14
- import { useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
15
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
16
- import { useTranslation as y } from "react-i18next";
17
- import { TestIdUtil as b } from "@gen-epix/ui-core/utils/TestIdUtil";
18
- import { useArray as x } from "@gen-epix/ui-core/hooks/useArray";
13
+ import { container as d } from "tsyringe";
14
+ import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
15
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
16
+ import { Box as v, Button as y } from "@mui/material";
17
+ import { useTranslation as b } from "react-i18next";
18
+ import { TestIdUtil as x } from "@gen-epix/ui-core/utils/TestIdUtil";
19
+ import { useArray as S } from "@gen-epix/ui-core/hooks/useArray";
19
20
  //#region src/components/app/ApplicationBootstrapWithAuthentication/ApplicationBootstrapWithAuthentication.tsx
20
- var S = ({ children: S }) => {
21
- let { t: C } = y(), w = t(n, (e) => e.setCategorizedOutages), [T, E] = g(!1), [D, O] = g(!1), k = o({
21
+ var C = ({ children: C }) => {
22
+ let { t: w } = b(), T = r(i, (e) => e.setCategorizedOutages), [E, D] = h(!1), [O, k] = h(!1), A = n({
22
23
  gcTime: Infinity,
23
- queryFn: async ({ signal: e }) => (await i.getInstance().systemApi.retrieveOutages({ signal: e })).data,
24
- queryKey: s.getInstance().getGenericKey(c.OUTAGES),
24
+ queryFn: async ({ signal: e }) => (await d.resolve(a).retrieveOutages({ signal: e })).data,
25
+ queryKey: d.resolve(t).getGenericKey(c.OUTAGES),
25
26
  refetchInterval: 3e5,
26
27
  staleTime: Infinity
27
- }), A = x([k]), j = h(() => e.getCategorizedOutages(k.data ?? []), [k.data]), M = p(() => {
28
+ }), j = S([A]), M = m(() => e.getCategorizedOutages(A.data ?? []), [A.data]), N = f(() => {
28
29
  u.getInstance().window.location.reload();
29
- }, []), N = p(() => {
30
- E(!0);
30
+ }, []), P = f(() => {
31
+ D(!0);
31
32
  }, []);
32
- return m(() => {
33
- j && w(j);
33
+ return p(() => {
34
+ M && T(M);
34
35
  let e = u.getInstance().window.setTimeout(() => {
35
- O(!0);
36
+ k(!0);
36
37
  }, 5e3);
37
38
  return () => {
38
39
  u.getInstance().window.clearTimeout(e);
39
40
  };
40
- }, [j, w]), !T && !k.isLoading && !k.error && j.activeOutages?.length > 0 ? /* @__PURE__ */ v(r, {
41
+ }, [M, T]), !E && !A.isLoading && !A.error && M.activeOutages?.length > 0 ? /* @__PURE__ */ _(o, {
41
42
  singleAction: !0,
42
- testIdAttributes: b.createAttributes("OutagePage"),
43
- title: C`Outages`,
44
- children: [/* @__PURE__ */ _(l, {
45
- activeOutages: j.activeOutages,
46
- soonActiveOutages: j.soonActiveOutages,
47
- visibleOutages: j.visibleOutages
48
- }), /* @__PURE__ */ v(d, {
43
+ testIdAttributes: x.createAttributes("OutagePage"),
44
+ title: w`Outages`,
45
+ children: [/* @__PURE__ */ g(l, {
46
+ activeOutages: M.activeOutages,
47
+ soonActiveOutages: M.soonActiveOutages,
48
+ visibleOutages: M.visibleOutages
49
+ }), /* @__PURE__ */ _(v, {
49
50
  sx: {
50
51
  display: "flex",
51
52
  gap: 1,
52
53
  justifyContent: "flex-end"
53
54
  },
54
- children: [/* @__PURE__ */ _(f, {
55
- disabled: !D,
56
- onClick: N,
55
+ children: [/* @__PURE__ */ g(y, {
56
+ disabled: !O,
57
+ onClick: P,
57
58
  variant: "outlined",
58
- children: C`Continue anyway`
59
- }), /* @__PURE__ */ _(f, {
60
- disabled: !D,
61
- onClick: M,
59
+ children: w`Continue anyway`
60
+ }), /* @__PURE__ */ g(y, {
61
+ disabled: !O,
62
+ onClick: N,
62
63
  variant: "contained",
63
- children: C`Retry`
64
+ children: w`Retry`
64
65
  })]
65
66
  })]
66
- }) : k.error || k.isLoading ? /* @__PURE__ */ _(r, {
67
+ }) : A.error || A.isLoading ? /* @__PURE__ */ g(o, {
67
68
  ignorePageEvent: !0,
68
69
  singleAction: !0,
69
- testIdAttributes: b.createAttributes("OutagesLoadingPage"),
70
- title: C`Outages`,
71
- children: /* @__PURE__ */ _(a, {
72
- loadables: A,
73
- loadingMessage: C`Loading`,
74
- children: S
70
+ testIdAttributes: x.createAttributes("OutagesLoadingPage"),
71
+ title: w`Outages`,
72
+ children: /* @__PURE__ */ g(s, {
73
+ loadables: j,
74
+ loadingMessage: w`Loading`,
75
+ children: C
75
76
  })
76
- }) : S;
77
+ }) : C;
77
78
  };
78
79
  //#endregion
79
- export { S as ApplicationBootstrapWithAuthentication };
80
+ export { C as ApplicationBootstrapWithAuthentication };
80
81
 
81
82
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/app/ApplicationBootstrapWithAuthentication/ApplicationBootstrapWithAuthentication.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport type {\n PropsWithChildren,\n ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\nimport {\n Box,\n Button,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\n\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { outagesStore } from '../../../stores/outagesStore';\nimport { OutageUtil } from '../../../utils/OutageUtil';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { OutageList } from '../../ui/OutageList';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { ResponseHandler } from '../../ui/ResponseHandler';\nimport { COMMON_QUERY_KEY } from '../../../constants/query';\nimport { ApiService } from '../../../classes/services/ApiService';\n\n\nexport const ApplicationBootstrapWithAuthentication = ({ children }: PropsWithChildren): ReactNode => {\n const { t } = useTranslation();\n\n const setCategorizedOutages = useStore(outagesStore, (state) => state.setCategorizedOutages);\n const [shouldContinue, setShouldContinue] = useState(false);\n const [buttonsEnabled, setButtonsEnabled] = useState(false);\n\n const outagesQuery = useQueryMemo({\n gcTime: Infinity,\n queryFn: async ({ signal }) => (await ApiService.getInstance().systemApi.retrieveOutages({ signal })).data,\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.OUTAGES),\n refetchInterval: 5 * 60 * 1000,\n staleTime: Infinity,\n });\n\n const outagesLoadables = useArray([outagesQuery]);\n\n const categorizedOutages = useMemo(() => {\n return OutageUtil.getCategorizedOutages(outagesQuery.data ?? []);\n }, [outagesQuery.data]);\n\n const onRetryButtonClick = useCallback(() => {\n WindowService.getInstance().window.location.reload();\n }, []);\n\n const onContinuButtonClick = useCallback(() => {\n setShouldContinue(true);\n }, []);\n\n useEffect(() => {\n if (categorizedOutages) {\n setCategorizedOutages(categorizedOutages);\n }\n\n const timeout = WindowService.getInstance().window.setTimeout(() => {\n setButtonsEnabled(true);\n }, 5000);\n\n return () => {\n WindowService.getInstance().window.clearTimeout(timeout);\n };\n }, [categorizedOutages, setCategorizedOutages]);\n\n const shouldShowOutagePage = !shouldContinue && !outagesQuery.isLoading && !outagesQuery.error && categorizedOutages.activeOutages?.length > 0;\n\n if (shouldShowOutagePage) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('OutagePage')}\n title={t`Outages`}\n >\n <OutageList\n activeOutages={categorizedOutages.activeOutages}\n soonActiveOutages={categorizedOutages.soonActiveOutages}\n visibleOutages={categorizedOutages.visibleOutages}\n />\n <Box\n sx={{\n display: 'flex',\n gap: 1,\n justifyContent: 'flex-end',\n }}\n >\n <Button\n disabled={!buttonsEnabled}\n onClick={onContinuButtonClick}\n variant={'outlined'}\n >\n {t`Continue anyway`}\n </Button>\n <Button\n disabled={!buttonsEnabled}\n onClick={onRetryButtonClick}\n variant={'contained'}\n >\n {t`Retry`}\n </Button>\n </Box>\n </PageContainer>\n );\n }\n if (outagesQuery.error || outagesQuery.isLoading) {\n return (\n <PageContainer\n ignorePageEvent\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('OutagesLoadingPage')}\n title={t`Outages`}\n >\n <ResponseHandler\n loadables={outagesLoadables}\n loadingMessage={t`Loading`}\n >\n {children}\n </ResponseHandler>\n </PageContainer>\n );\n\n }\n\n return children;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,IAAa,KAA0C,EAAE,kBAA6C;CACpG,IAAM,EAAE,SAAM,EAAe,GAEvB,IAAwB,EAAS,IAAe,MAAU,EAAM,qBAAqB,GACrF,CAAC,GAAgB,KAAqB,EAAS,EAAK,GACpD,CAAC,GAAgB,KAAqB,EAAS,EAAK,GAEpD,IAAe,EAAa;EAChC,QAAQ;EACR,SAAS,OAAO,EAAE,iBAAc,MAAM,EAAW,YAAY,CAAC,CAAC,UAAU,gBAAgB,EAAE,UAAO,CAAC,EAAA,CAAG;EACtG,UAAU,EAAmB,YAAY,CAAC,CAAC,cAAc,EAAiB,OAAO;EACjF,iBAAiB;EACjB,WAAW;CACb,CAAC,GAEK,IAAmB,EAAS,CAAC,CAAY,CAAC,GAE1C,IAAqB,QAClB,EAAW,sBAAsB,EAAa,QAAQ,CAAC,CAAC,GAC9D,CAAC,EAAa,IAAI,CAAC,GAEhB,IAAqB,QAAkB;EAC3C,EAAc,YAAY,CAAC,CAAC,OAAO,SAAS,OAAO;CACrD,GAAG,CAAC,CAAC,GAEC,IAAuB,QAAkB;EAC7C,EAAkB,EAAI;CACxB,GAAG,CAAC,CAAC;CA0EL,OAxEA,QAAgB;EACd,AAAI,KACF,EAAsB,CAAkB;EAG1C,IAAM,IAAU,EAAc,YAAY,CAAC,CAAC,OAAO,iBAAiB;GAClE,EAAkB,EAAI;EACxB,GAAG,GAAI;EAEP,aAAa;GACX,EAAc,YAAY,CAAC,CAAC,OAAO,aAAa,CAAO;EACzD;CACF,GAAG,CAAC,GAAoB,CAAqB,CAAC,GAEjB,CAAC,KAAkB,CAAC,EAAa,aAAa,CAAC,EAAa,SAAS,EAAmB,eAAe,SAAS,IAIzI,kBAAC,GAAD;EACE,cAAA;EACA,kBAAkB,EAAW,iBAAiB,YAAY;EAC1D,OAAO,CAAC;EAHV,UAAA,CAKE,kBAAC,GAAD;GACE,eAAe,EAAmB;GAClC,mBAAmB,EAAmB;GACtC,gBAAgB,EAAmB;EACpC,CAAA,GACD,kBAAC,GAAD;GACE,IAAI;IACF,SAAS;IACT,KAAK;IACL,gBAAgB;GAClB;GALF,UAAA,CAOE,kBAAC,GAAD;IACE,UAAU,CAAC;IACX,SAAS;IACT,SAAS;IAER,UAAA,CAAC;GACI,CAAA,GACR,kBAAC,GAAD;IACE,UAAU,CAAC;IACX,SAAS;IACT,SAAS;IAER,UAAA,CAAC;GACI,CAAA,CACL;EACQ,CAAA,CAAA;MAGf,EAAa,SAAS,EAAa,YAEnC,kBAAC,GAAD;EACE,iBAAA;EACA,cAAA;EACA,kBAAkB,EAAW,iBAAiB,oBAAoB;EAClE,OAAO,CAAC;EAER,UAAA,kBAAC,GAAD;GACE,WAAW;GACX,gBAAgB,CAAC;GAEhB;EACc,CAAA;CACJ,CAAA,IAKZ;AACT"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","OutageUtil","useQueryMemo","useStore","OutageList","ApplicationBootstrapWithAuthentication","useTranslation","setCategorizedOutages","outagesStore","state","shouldContinue","setShouldContinue","useState","buttonsEnabled","setButtonsEnabled","outagesQuery","container","API_SYSTEM_TOKEN","QueryClientService","COMMON_QUERY_KEY","outagesLoadables","useArray","categorizedOutages","useMemo","onRetryButtonClick","useCallback","onContinuButtonClick","useEffect","timeout","WindowService","PageContainer","TestIdUtil","Box","Button","ResponseHandler","children"],"sources":["../../../../src/components/app/ApplicationBootstrapWithAuthentication/ApplicationBootstrapWithAuthentication.tsx"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport type {\n PropsWithChildren,\n ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\nimport {\n Box,\n Button,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\n\nimport { API_SYSTEM_TOKEN } from '../../../models/api.models';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { outagesStore } from '../../../stores/outagesStore';\nimport { OutageUtil } from '../../../utils/OutageUtil';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { OutageList } from '../../ui/OutageList';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { ResponseHandler } from '../../ui/ResponseHandler';\nimport { COMMON_QUERY_KEY } from '../../../constants/query.constants';\n\n\nexport const ApplicationBootstrapWithAuthentication = ({ children }: PropsWithChildren): ReactNode => {\n const { t } = useTranslation();\n\n const setCategorizedOutages = useStore(outagesStore, (state) => state.setCategorizedOutages);\n const [shouldContinue, setShouldContinue] = useState(false);\n const [buttonsEnabled, setButtonsEnabled] = useState(false);\n\n const outagesQuery = useQueryMemo({\n gcTime: Infinity,\n queryFn: async ({ signal }) => (await rootContainer.resolve(API_SYSTEM_TOKEN).retrieveOutages({ signal })).data,\n queryKey: rootContainer.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.OUTAGES),\n refetchInterval: 5 * 60 * 1000,\n staleTime: Infinity,\n });\n\n const outagesLoadables = useArray([outagesQuery]);\n\n const categorizedOutages = useMemo(() => {\n return OutageUtil.getCategorizedOutages(outagesQuery.data ?? []);\n }, [outagesQuery.data]);\n\n const onRetryButtonClick = useCallback(() => {\n WindowService.getInstance().window.location.reload();\n }, []);\n\n const onContinuButtonClick = useCallback(() => {\n setShouldContinue(true);\n }, []);\n\n useEffect(() => {\n if (categorizedOutages) {\n setCategorizedOutages(categorizedOutages);\n }\n\n const timeout = WindowService.getInstance().window.setTimeout(() => {\n setButtonsEnabled(true);\n }, 5000);\n\n return () => {\n WindowService.getInstance().window.clearTimeout(timeout);\n };\n }, [categorizedOutages, setCategorizedOutages]);\n\n const shouldShowOutagePage = !shouldContinue && !outagesQuery.isLoading && !outagesQuery.error && categorizedOutages.activeOutages?.length > 0;\n\n if (shouldShowOutagePage) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('OutagePage')}\n title={t`Outages`}\n >\n <OutageList\n activeOutages={categorizedOutages.activeOutages}\n soonActiveOutages={categorizedOutages.soonActiveOutages}\n visibleOutages={categorizedOutages.visibleOutages}\n />\n <Box\n sx={{\n display: 'flex',\n gap: 1,\n justifyContent: 'flex-end',\n }}\n >\n <Button\n disabled={!buttonsEnabled}\n onClick={onContinuButtonClick}\n variant={'outlined'}\n >\n {t`Continue anyway`}\n </Button>\n <Button\n disabled={!buttonsEnabled}\n onClick={onRetryButtonClick}\n variant={'contained'}\n >\n {t`Retry`}\n </Button>\n </Box>\n </PageContainer>\n );\n }\n if (outagesQuery.error || outagesQuery.isLoading) {\n return (\n <PageContainer\n ignorePageEvent\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('OutagesLoadingPage')}\n title={t`Outages`}\n >\n <ResponseHandler\n loadables={outagesLoadables}\n loadingMessage={t`Loading`}\n >\n {children}\n </ResponseHandler>\n </PageContainer>\n );\n\n }\n\n return children;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA,IAAaK,KAA0C,EAAE,kBAA6C;CACpG,IAAM,EAAE,SAAMC,EAAe,GAEvBC,IAAwBJ,EAASK,IAAe,MAAUC,EAAM,qBAAqB,GACrF,CAACC,GAAgBC,KAAqBC,EAAS,EAAK,GACpD,CAACC,GAAgBC,KAAqBF,EAAS,EAAK,GAEpDG,IAAeb,EAAa;EAChC,QAAQ;EACR,SAAS,OAAO,EAAE,iBAAc,MAAMF,EAAc,QAAQiB,CAAgB,CAAC,CAAC,gBAAgB,EAAE,UAAO,CAAC,EAAA,CAAG;EAC3G,UAAUjB,EAAc,QAAQkB,CAAkB,CAAC,CAAC,cAAcC,EAAiB,OAAO;EAC1F,iBAAiB;EACjB,WAAW;CACb,CAAC,GAEKC,IAAmBC,EAAS,CAACN,CAAY,CAAC,GAE1CO,IAAqBC,QAClBtB,EAAW,sBAAsBc,EAAa,QAAQ,CAAC,CAAC,GAC9D,CAACA,EAAa,IAAI,CAAC,GAEhBS,IAAqBC,QAAkB;EAC3C,EAAc,YAAY,CAAC,CAAC,OAAO,SAAS,OAAO;CACrD,GAAG,CAAC,CAAC,GAECC,IAAuBD,QAAkB;EAC7C,EAAkB,EAAI;CACxB,GAAG,CAAC,CAAC;CA0EL,OAxEAE,QAAgB;EACd,AAAIL,KACFf,EAAsBe,CAAkB;EAG1C,IAAMM,IAAUC,EAAc,YAAY,CAAC,CAAC,OAAO,iBAAiB;GAClE,EAAkB,EAAI;EACxB,GAAG,GAAI;EAEP,aAAa;GACX,EAAc,YAAY,CAAC,CAAC,OAAO,aAAaD,CAAO;EACzD;CACF,GAAG,CAACN,GAAoBf,CAAqB,CAAC,GAEjB,CAACG,KAAkB,CAACK,EAAa,aAAa,CAACA,EAAa,SAASO,EAAmB,eAAe,SAAS,IAIzI,kBAACQ,GAAD;EACE,cAAA;EACA,kBAAkBC,EAAW,iBAAiB,YAAY;EAC1D,OAAO,CAAC;EAHV,UAAA,CAKE,kBAAC3B,GAAD;GACE,eAAekB,EAAmB;GAClC,mBAAmBA,EAAmB;GACtC,gBAAgBA,EAAmB;EACpC,CAAA,GACD,kBAACU,GAAD;GACE,IAAI;IACF,SAAS;IACT,KAAK;IACL,gBAAgB;GAClB;GALF,UAAA,CAOE,kBAACC,GAAD;IACE,UAAU,CAACpB;IACX,SAASa;IACT,SAAS;IAER,UAAA,CAAC;GACI,CAAA,GACR,kBAACO,GAAD;IACE,UAAU,CAACpB;IACX,SAASW;IACT,SAAS;IAER,UAAA,CAAC;GACI,CAAA,CACL;EACQ,CAAA,CAAA;MAGfT,EAAa,SAASA,EAAa,YAEnC,kBAACe,GAAD;EACE,iBAAA;EACA,cAAA;EACA,kBAAkBC,EAAW,iBAAiB,oBAAoB;EAClE,OAAO,CAAC;EAER,UAAA,kBAACG,GAAD;GACE,WAAWd;GACX,gBAAgB,CAAC;GAEhB;EACc,CAAA;CACJ,CAAA,IAKZe;AACT"}
@@ -1,63 +1,64 @@
1
- import { PageContainer as e } from "../../ui/PageContainer/index.js";
2
- import { ApiService as t } from "../../../classes/services/ApiService/index.js";
3
- import { ResponseHandler as n } from "../../ui/ResponseHandler/index.js";
4
- import { t as r } from "../../../_chunks/useQueryMemo.js";
5
- import { t as i } from "../../../_chunks/QueryClientService.js";
6
- import { COMMON_QUERY_KEY as a } from "../../../constants/query.js";
1
+ import { t as e } from "../../../_chunks/QueryClientService.js";
2
+ import { t } from "../../../_chunks/useQueryMemo.js";
3
+ import { API_SYSTEM_TOKEN as n } from "../../../models/api.models.js";
4
+ import { PageContainer as r } from "../../ui/PageContainer/index.js";
5
+ import { ResponseHandler as i } from "../../ui/ResponseHandler/index.js";
6
+ import { COMMON_QUERY_KEY as a } from "../../../constants/query.constants.js";
7
7
  import { FeatureFlagsService as o } from "../../../classes/services/FeatureFlagsService/index.js";
8
8
  import { I18nService as s } from "../../../classes/services/I18nService/index.js";
9
9
  import { WindowService as c } from "@gen-epix/ui-core/classes/services/WindowService";
10
- import { useCallback as l, useEffect as u, useRef as d, useState as f } from "react";
11
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
12
- import { useTranslation as h } from "react-i18next";
13
- import { TestIdUtil as g } from "@gen-epix/ui-core/utils/TestIdUtil";
14
- import { Spinner as _ } from "@gen-epix/ui-core-components/components/Spinner";
15
- import { useArray as v } from "@gen-epix/ui-core/hooks/useArray";
16
- import { Confirmation as y } from "@gen-epix/ui-core-components/components/Confirmation";
10
+ import { container as l } from "tsyringe";
11
+ import { useCallback as u, useEffect as d, useRef as f, useState as p } from "react";
12
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
13
+ import { useTranslation as g } from "react-i18next";
14
+ import { TestIdUtil as _ } from "@gen-epix/ui-core/utils/TestIdUtil";
15
+ import { Spinner as v } from "@gen-epix/ui-core-components/components/Spinner";
16
+ import { useArray as y } from "@gen-epix/ui-core/hooks/useArray";
17
+ import { Confirmation as b } from "@gen-epix/ui-core-components/components/Confirmation";
17
18
  //#region src/components/app/ApplicationBootstrapWithoutAuthorization/ApplicationBootstrapWithoutAuthorization.tsx
18
- var b = ({ children: b }) => {
19
- let { t: x } = h(), S = d(null), C = d(null), [w, T] = f(!1);
20
- u(() => {
21
- let e = s.getInstance(), t = (e) => {
22
- C.current = e, S.current?.open();
19
+ var x = ({ children: x }) => {
20
+ let { t: S } = g(), C = f(null), w = f(null), [T, E] = p(!1);
21
+ d(() => {
22
+ let e = l.resolve(s), t = (e) => {
23
+ w.current = e, C.current?.open();
23
24
  };
24
25
  return e.addEventListener("onUserLanguageChange", t), () => {
25
26
  e.removeEventListener("onUserLanguageChange", t);
26
27
  };
27
28
  }, []);
28
- let E = l(async () => {
29
- C.current && (T(!0), await s.getInstance().switchLanguageConfig(C.current), c.getInstance().window.location.reload());
30
- }, []), D = r({
29
+ let D = u(async () => {
30
+ w.current && (E(!0), await l.resolve(s).switchLanguageConfig(w.current), c.getInstance().window.location.reload());
31
+ }, []), O = t({
31
32
  gcTime: Infinity,
32
- queryFn: async ({ signal: e }) => (await t.getInstance().systemApi.retrieveFeatureFlags({ signal: e })).data,
33
- queryKey: i.getInstance().getGenericKey(a.FEATURE_FLAGS),
33
+ queryFn: async ({ signal: e }) => (await l.resolve(n).retrieveFeatureFlags({ signal: e })).data,
34
+ queryKey: l.resolve(e).getGenericKey(a.FEATURE_FLAGS),
34
35
  staleTime: Infinity
35
36
  });
36
- D.data && (o.getInstance().featureFlags = D.data.feature_flags);
37
- let O = v([D]);
38
- return w ? /* @__PURE__ */ p(e, {
37
+ O.data && (l.resolve(o).featureFlags = O.data.feature_flags);
38
+ let k = y([O]);
39
+ return T ? /* @__PURE__ */ m(r, {
39
40
  singleAction: !0,
40
- testIdAttributes: g.createAttributes("LanguageChangingPage"),
41
- title: x`Changing language`,
42
- children: /* @__PURE__ */ p(_, {
41
+ testIdAttributes: _.createAttributes("LanguageChangingPage"),
42
+ title: S`Changing language`,
43
+ children: /* @__PURE__ */ m(v, {
43
44
  inline: !0,
44
- label: x`Changing language...`
45
+ label: S`Changing language...`
45
46
  })
46
- }) : /* @__PURE__ */ m(n, {
47
- loadables: O,
48
- loadingMessage: x`Loading`,
49
- children: [b, /* @__PURE__ */ p(y, {
50
- body: x`Changing language will reload the application. Do you want to continue?`,
51
- cancelLabel: x`Cancel`,
52
- confirmLabel: x`Change language`,
47
+ }) : /* @__PURE__ */ h(i, {
48
+ loadables: k,
49
+ loadingMessage: S`Loading`,
50
+ children: [x, /* @__PURE__ */ m(b, {
51
+ body: S`Changing language will reload the application. Do you want to continue?`,
52
+ cancelLabel: S`Cancel`,
53
+ confirmLabel: S`Change language`,
53
54
  maxWidth: "xs",
54
- onConfirm: E,
55
- ref: S,
56
- title: x`Are you sure?`
55
+ onConfirm: D,
56
+ ref: C,
57
+ title: S`Are you sure?`
57
58
  })]
58
59
  });
59
60
  };
60
61
  //#endregion
61
- export { b as ApplicationBootstrapWithoutAuthorization };
62
+ export { x as ApplicationBootstrapWithoutAuthorization };
62
63
 
63
64
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/app/ApplicationBootstrapWithoutAuthorization/ApplicationBootstrapWithoutAuthorization.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport type {\n PropsWithChildren,\n ReactNode,\n} from 'react';\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 { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\n\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { FeatureFlagsService } from '../../../classes/services/FeatureFlagsService';\nimport { I18nService } from '../../../classes/services/I18nService';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { ResponseHandler } from '../../ui/ResponseHandler';\nimport { COMMON_QUERY_KEY } from '../../../constants/query';\nimport { ApiService } from '../../../classes/services/ApiService';\n\n\nexport const ApplicationBootstrapWithoutAuthorization = ({ children }: PropsWithChildren): ReactNode => {\n const { t } = useTranslation();\n\n const confirmationRef = useRef<ConfirmationRefMethods>(null);\n const newLanguageCodeRef = useRef<string>(null);\n const [isLanguageChanging, setIsLanguageChanging] = useState(false);\n\n useEffect(() => {\n const i18nService = I18nService.getInstance();\n const callback = (code: string) => {\n newLanguageCodeRef.current = code;\n confirmationRef.current?.open();\n };\n i18nService.addEventListener('onUserLanguageChange', callback);\n return () => {\n i18nService.removeEventListener('onUserLanguageChange', callback);\n };\n }, []);\n\n const onLanguageChangeConfirm = useCallback(async () => {\n if (newLanguageCodeRef.current) {\n setIsLanguageChanging(true);\n await I18nService.getInstance().switchLanguageConfig(newLanguageCodeRef.current);\n WindowService.getInstance().window.location.reload();\n }\n }, []);\n\n const featureFlagsQuery = useQueryMemo({\n gcTime: Infinity,\n queryFn: async ({ signal }) => (await ApiService.getInstance().systemApi.retrieveFeatureFlags({ signal })).data,\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.FEATURE_FLAGS),\n staleTime: Infinity,\n });\n\n if (featureFlagsQuery.data) {\n FeatureFlagsService.getInstance().featureFlags = featureFlagsQuery.data.feature_flags;\n }\n\n const loadables = useArray([featureFlagsQuery]);\n\n if (isLanguageChanging) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('LanguageChangingPage')}\n title={t`Changing language`}\n >\n <Spinner\n inline\n label={t`Changing language...`}\n />\n </PageContainer>\n );\n }\n\n\n return (\n <ResponseHandler\n loadables={loadables}\n loadingMessage={t`Loading`}\n >\n {children}\n <Confirmation\n body={t`Changing language will reload the application. Do you want to continue?`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Change language`}\n maxWidth={'xs'}\n onConfirm={onLanguageChangeConfirm}\n ref={confirmationRef}\n title={t`Are you sure?`}\n />\n </ResponseHandler>\n );\n\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,IAAa,KAA4C,EAAE,kBAA6C;CACtG,IAAM,EAAE,SAAM,EAAe,GAEvB,IAAkB,EAA+B,IAAI,GACrD,IAAqB,EAAe,IAAI,GACxC,CAAC,GAAoB,KAAyB,EAAS,EAAK;CAElE,QAAgB;EACd,IAAM,IAAc,EAAY,YAAY,GACtC,KAAY,MAAiB;GAEjC,AADA,EAAmB,UAAU,GAC7B,EAAgB,SAAS,KAAK;EAChC;EAEA,OADA,EAAY,iBAAiB,wBAAwB,CAAQ,SAChD;GACX,EAAY,oBAAoB,wBAAwB,CAAQ;EAClE;CACF,GAAG,CAAC,CAAC;CAEL,IAAM,IAA0B,EAAY,YAAY;EACtD,AAAI,EAAmB,YACrB,EAAsB,EAAI,GAC1B,MAAM,EAAY,YAAY,CAAC,CAAC,qBAAqB,EAAmB,OAAO,GAC/E,EAAc,YAAY,CAAC,CAAC,OAAO,SAAS,OAAO;CAEvD,GAAG,CAAC,CAAC,GAEC,IAAoB,EAAa;EACrC,QAAQ;EACR,SAAS,OAAO,EAAE,iBAAc,MAAM,EAAW,YAAY,CAAC,CAAC,UAAU,qBAAqB,EAAE,UAAO,CAAC,EAAA,CAAG;EAC3G,UAAU,EAAmB,YAAY,CAAC,CAAC,cAAc,EAAiB,aAAa;EACvF,WAAW;CACb,CAAC;CAED,AAAI,EAAkB,SACpB,EAAoB,YAAY,CAAC,CAAC,eAAe,EAAkB,KAAK;CAG1E,IAAM,IAAY,EAAS,CAAC,CAAiB,CAAC;CAkB9C,OAhBI,IAEA,kBAAC,GAAD;EACE,cAAA;EACA,kBAAkB,EAAW,iBAAiB,sBAAsB;EACpE,OAAO,CAAC;EAER,UAAA,kBAAC,GAAD;GACE,QAAA;GACA,OAAO,CAAC;EACT,CAAA;CACY,CAAA,IAMjB,kBAAC,GAAD;EACa;EACX,gBAAgB,CAAC;EAFnB,UAAA,CAIG,GACD,kBAAC,GAAD;GACE,MAAM,CAAC;GACP,aAAa,CAAC;GACd,cAAc,CAAC;GACf,UAAU;GACV,WAAW;GACX,KAAK;GACL,OAAO,CAAC;EACT,CAAA,CACc;;AAGrB"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","QueryClientService","ApplicationBootstrapWithoutAuthorization","useTranslation","confirmationRef","useRef","newLanguageCodeRef","isLanguageChanging","setIsLanguageChanging","useState","i18nService","container","I18nService","callback","code","onLanguageChangeConfirm","useCallback","WindowService","featureFlagsQuery","useQueryMemo","API_SYSTEM_TOKEN","COMMON_QUERY_KEY","FeatureFlagsService","loadables","useArray","PageContainer","TestIdUtil","Spinner","ResponseHandler","children","Confirmation"],"sources":["../../../../src/components/app/ApplicationBootstrapWithoutAuthorization/ApplicationBootstrapWithoutAuthorization.tsx"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport {\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport type {\n PropsWithChildren,\n ReactNode,\n} from 'react';\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 { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\n\nimport { API_SYSTEM_TOKEN } from '../../../models/api.models';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { FeatureFlagsService } from '../../../classes/services/FeatureFlagsService';\nimport { I18nService } from '../../../classes/services/I18nService';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { ResponseHandler } from '../../ui/ResponseHandler';\nimport { COMMON_QUERY_KEY } from '../../../constants/query.constants';\n\n\nexport const ApplicationBootstrapWithoutAuthorization = ({ children }: PropsWithChildren): ReactNode => {\n const { t } = useTranslation();\n\n const confirmationRef = useRef<ConfirmationRefMethods>(null);\n const newLanguageCodeRef = useRef<string>(null);\n const [isLanguageChanging, setIsLanguageChanging] = useState(false);\n\n useEffect(() => {\n const i18nService = rootContainer.resolve(I18nService);\n const callback = (code: string) => {\n newLanguageCodeRef.current = code;\n confirmationRef.current?.open();\n };\n i18nService.addEventListener('onUserLanguageChange', callback);\n return () => {\n i18nService.removeEventListener('onUserLanguageChange', callback);\n };\n }, []);\n\n const onLanguageChangeConfirm = useCallback(async () => {\n if (newLanguageCodeRef.current) {\n setIsLanguageChanging(true);\n await rootContainer.resolve(I18nService).switchLanguageConfig(newLanguageCodeRef.current);\n WindowService.getInstance().window.location.reload();\n }\n }, []);\n\n const featureFlagsQuery = useQueryMemo({\n gcTime: Infinity,\n queryFn: async ({ signal }) => (await rootContainer.resolve(API_SYSTEM_TOKEN).retrieveFeatureFlags({ signal })).data,\n queryKey: rootContainer.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.FEATURE_FLAGS),\n staleTime: Infinity,\n });\n\n if (featureFlagsQuery.data) {\n rootContainer.resolve(FeatureFlagsService).featureFlags = featureFlagsQuery.data.feature_flags;\n }\n\n const loadables = useArray([featureFlagsQuery]);\n\n if (isLanguageChanging) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('LanguageChangingPage')}\n title={t`Changing language`}\n >\n <Spinner\n inline\n label={t`Changing language...`}\n />\n </PageContainer>\n );\n }\n\n\n return (\n <ResponseHandler\n loadables={loadables}\n loadingMessage={t`Loading`}\n >\n {children}\n <Confirmation\n body={t`Changing language will reload the application. Do you want to continue?`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Change language`}\n maxWidth={'xs'}\n onConfirm={onLanguageChangeConfirm}\n ref={confirmationRef}\n title={t`Are you sure?`}\n />\n </ResponseHandler>\n );\n\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,IAAaE,KAA4C,EAAE,kBAA6C;CACtG,IAAM,EAAE,SAAMC,EAAe,GAEvBC,IAAkBC,EAA+B,IAAI,GACrDC,IAAqBD,EAAe,IAAI,GACxC,CAACE,GAAoBC,KAAyBC,EAAS,EAAK;CAElE,QAAgB;EACd,IAAMC,IAAcV,EAAc,QAAQY,CAAW,GAC/CC,KAAY,MAAiB;GAEjC,AADA,EAAmB,UAAUC,GAC7BV,EAAgB,SAAS,KAAK;EAChC;EAEA,OADAM,EAAY,iBAAiB,wBAAwBG,CAAQ,SAChD;GACX,EAAY,oBAAoB,wBAAwBA,CAAQ;EAClE;CACF,GAAG,CAAC,CAAC;CAEL,IAAME,IAA0BC,EAAY,YAAY;EACtD,AAAIV,EAAmB,YACrBE,EAAsB,EAAI,GAC1B,MAAMR,EAAc,QAAQY,CAAW,CAAC,CAAC,qBAAqBN,EAAmB,OAAO,GACxFW,EAAc,YAAY,CAAC,CAAC,OAAO,SAAS,OAAO;CAEvD,GAAG,CAAC,CAAC,GAECC,IAAoBC,EAAa;EACrC,QAAQ;EACR,SAAS,OAAO,EAAE,iBAAc,MAAMnB,EAAc,QAAQoB,CAAgB,CAAC,CAAC,qBAAqB,EAAE,UAAO,CAAC,EAAA,CAAG;EAChH,UAAUpB,EAAc,QAAQC,CAAkB,CAAC,CAAC,cAAcoB,EAAiB,aAAa;EAChG,WAAW;CACb,CAAC;CAED,AAAIH,EAAkB,SACpB,EAAc,QAAQI,CAAmB,CAAC,CAAC,eAAeJ,EAAkB,KAAK;CAGnF,IAAMK,IAAYC,EAAS,CAACN,CAAiB,CAAC;CAkB9C,OAhBIX,IAEA,kBAACkB,GAAD;EACE,cAAA;EACA,kBAAkBC,EAAW,iBAAiB,sBAAsB;EACpE,OAAO,CAAC;EAER,UAAA,kBAACC,GAAD;GACE,QAAA;GACA,OAAO,CAAC;EACT,CAAA;CACY,CAAA,IAMjB,kBAACC,GAAD;EACa;EACX,gBAAgB,CAAC;EAFnB,UAAA,CAIGC,GACD,kBAACC,GAAD;GACE,MAAM,CAAC;GACP,aAAa,CAAC;GACd,cAAc,CAAC;GACf,UAAU;GACV,WAAWf;GACX,KAAKX;GACL,OAAO,CAAC;EACT,CAAA,CACc;;AAGrB"}
@@ -1,126 +1,127 @@
1
- import { ConfigService as e } from "../../../classes/services/ConfigService/index.js";
1
+ import { useConfig as e } from "../../../hooks/useConfig/index.js";
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
5
  import { ConsentDialog as i } from "../../ui/ConsentDialog/index.js";
6
6
  import { WindowService as a } from "@gen-epix/ui-core/classes/services/WindowService";
7
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";
8
+ import { container as s } from "tsyringe";
9
+ import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
10
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
11
+ import { Box as g, Button as _, Typography as v } from "@mui/material";
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";
16
+ import { useAuth as C } from "react-oidc-context";
16
17
  //#region src/components/app/AuthenticationWrapper/AuthenticationWrapper.tsx
17
- var C = ({ children: C }) => {
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
- n.getInstance().authContextProps = T;
21
- }, [T]), d(() => {
22
- T.isAuthenticated && !D && E.current.open();
23
- }, [T.isAuthenticated, D]);
24
- let j = u(() => {
25
- r.getInstance().log([{
18
+ var w = ({ children: w }) => {
19
+ let { t: T } = y(), E = C(), D = e(), O = d(null), [k, A] = f(!D.consentDialog?.getShouldShow()), j = x(s.resolve(n)), M = D.login?.AfterLoginElement;
20
+ l(() => {
21
+ s.resolve(n).authContextProps = E;
22
+ }, [E]), l(() => {
23
+ E.isAuthenticated && !k && O.current.open();
24
+ }, [E.isAuthenticated, k]);
25
+ let N = c(() => {
26
+ s.resolve(r).log([{
26
27
  level: o.INFO,
27
28
  topic: "CONSENT"
28
- }]), O(!0), E.current.close();
29
- }, []), M = u(() => {
29
+ }]), A(!0), O.current.close();
30
+ }, []), P = c(() => {
30
31
  (async () => {
31
32
  let { hash: e, pathname: t, search: n } = a.getInstance().window.location, r = { preLoginLocation: {
32
33
  hash: e,
33
34
  pathname: t,
34
35
  search: n
35
36
  } };
36
- await T.signinRedirect({ state: r });
37
+ await E.signinRedirect({ state: r });
37
38
  })();
38
- }, [T]), N = u(() => {
39
- M();
40
- }, [M]), P = u(() => {
41
- n.clearStaleState(), n.getInstance().next(void 0);
42
- }, []), F = f(() => (/* @__PURE__ */ new Date()).getTime(), []), I = f(() => /* @__PURE__ */ _(h, { children: [
43
- /* @__PURE__ */ g(s, {
39
+ }, [E]), F = c(() => {
40
+ P();
41
+ }, [P]), I = c(() => {
42
+ n.clearStaleState(), s.resolve(n).next(void 0);
43
+ }, []), L = u(() => (/* @__PURE__ */ new Date()).getTime(), []), R = u(() => /* @__PURE__ */ h(p, { children: [
44
+ /* @__PURE__ */ m(g, {
44
45
  sx: {
45
46
  marginY: 2,
46
47
  textAlign: "center"
47
48
  },
48
- children: /* @__PURE__ */ g(c, {
49
+ children: /* @__PURE__ */ m(_, {
49
50
  color: "primary",
50
- "data-name": k.name,
51
- onClick: N,
51
+ "data-name": j.name,
52
+ onClick: F,
52
53
  variant: "contained",
53
- children: k.label
54
+ children: j.label
54
55
  })
55
56
  }),
56
- /* @__PURE__ */ g(s, {
57
+ /* @__PURE__ */ m(g, {
57
58
  sx: {
58
59
  marginY: 2,
59
60
  textAlign: "center"
60
61
  },
61
- children: /* @__PURE__ */ g(c, {
62
+ children: /* @__PURE__ */ m(_, {
62
63
  color: "primary",
63
- onClick: P,
64
+ onClick: I,
64
65
  variant: "outlined",
65
- children: w`Choose a different identity provider`
66
+ children: T`Choose a different identity provider`
66
67
  })
67
68
  }),
68
- A && /* @__PURE__ */ g(A, {})
69
+ M && /* @__PURE__ */ m(M, {})
69
70
  ] }), [
70
- k,
71
- P,
72
- N,
73
- w,
74
- A
71
+ j,
72
+ I,
73
+ F,
74
+ T,
75
+ M
75
76
  ]);
76
- if (T.activeNavigator || T.isLoading) return /* @__PURE__ */ g(t, {
77
+ if (E.activeNavigator || E.isLoading) return /* @__PURE__ */ m(t, {
77
78
  ignorePageEvent: !0,
78
79
  singleAction: !0,
79
- testIdAttributes: y.createAttributes("RedirectingPage"),
80
- title: w`Redirecting`,
81
- children: /* @__PURE__ */ g(x, { label: w`Redirecting` })
80
+ testIdAttributes: b.createAttributes("RedirectingPage"),
81
+ title: T`Redirecting`,
82
+ children: /* @__PURE__ */ m(S, { label: T`Redirecting` })
82
83
  });
83
- if (T.error) return n.clearStaleState(), r.getInstance().log([{
84
- detail: { error: T.error },
84
+ if (E.error) return n.clearStaleState(), s.resolve(r).log([{
85
+ detail: { error: E.error },
85
86
  level: o.ERROR,
86
87
  topic: "Authentication Error"
87
- }]), /* @__PURE__ */ _(t, {
88
+ }]), /* @__PURE__ */ h(t, {
88
89
  singleAction: !0,
89
- testIdAttributes: y.createAttributes("LoginPageSessionExpired"),
90
- title: w`Login`,
91
- children: [/* @__PURE__ */ g(l, {
90
+ testIdAttributes: b.createAttributes("LoginPageSessionExpired"),
91
+ title: T`Login`,
92
+ children: [/* @__PURE__ */ m(v, {
92
93
  component: "p",
93
94
  sx: { textAlign: "center" },
94
- children: w`We could not log you in, or your session has expired.`
95
- }), I]
95
+ children: T`We could not log you in, or your session has expired.`
96
+ }), R]
96
97
  });
97
- if (!T.isAuthenticated) {
98
- if (n.getInstance().getUserManagerSettingsCreatedAt() && F - n.getInstance().getUserManagerSettingsCreatedAt() < n.autoLoginSkew) {
99
- M();
98
+ if (!E.isAuthenticated) {
99
+ if (s.resolve(n).getUserManagerSettingsCreatedAt() && L - s.resolve(n).getUserManagerSettingsCreatedAt() < n.autoLoginSkew) {
100
+ P();
100
101
  return;
101
102
  }
102
- return /* @__PURE__ */ _(t, {
103
+ return /* @__PURE__ */ h(t, {
103
104
  singleAction: !0,
104
- testIdAttributes: y.createAttributes("LoginPage"),
105
- title: w`Login`,
106
- children: [/* @__PURE__ */ g(s, {
105
+ testIdAttributes: b.createAttributes("LoginPage"),
106
+ title: T`Login`,
107
+ children: [/* @__PURE__ */ m(g, {
107
108
  sx: {
108
109
  marginY: 2,
109
110
  textAlign: "center"
110
111
  },
111
- children: /* @__PURE__ */ g(l, {
112
+ children: /* @__PURE__ */ m(v, {
112
113
  component: "p",
113
- children: w`You need to login to access this application.`
114
+ children: T`You need to login to access this application.`
114
115
  })
115
- }), I]
116
+ }), R]
116
117
  });
117
118
  }
118
- return /* @__PURE__ */ _(h, { children: [C, e.getInstance().config.consentDialog?.getShouldShow() && /* @__PURE__ */ g(i, {
119
- onConsent: j,
120
- ref: E
119
+ return /* @__PURE__ */ h(p, { children: [w, D.consentDialog?.getShouldShow() && /* @__PURE__ */ m(i, {
120
+ onConsent: N,
121
+ ref: O
121
122
  })] });
122
123
  };
123
124
  //#endregion
124
- export { C as AuthenticationWrapper };
125
+ export { w as AuthenticationWrapper };
125
126
 
126
127
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/app/AuthenticationWrapper/AuthenticationWrapper.tsx"],"sourcesContent":["import {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { PropsWithChildren } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useAuth } from 'react-oidc-context';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\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 { ConfigService } from '../../../classes/services/ConfigService';\nimport { LogService } from '../../../classes/services/LogService';\nimport type { AuthState } from '../../../models/auth';\nimport type { ConsentDialogRefMethods } from '../../ui/ConsentDialog';\nimport { ConsentDialog } from '../../ui/ConsentDialog';\nimport { PageContainer } from '../../ui/PageContainer';\n\nexport const AuthenticationWrapper = ({ children }: PropsWithChildren) => {\n const { t } = useTranslation();\n const auth = useAuth();\n const consentDialogRef = useRef<ConsentDialogRefMethods>(null);\n const [hasGivenConsent, setHasGivenConsent] = useState<boolean>(\n !ConfigService.getInstance().config.consentDialog?.getShouldShow(),\n );\n\n const oidcConfiguration = useSubscribable(AuthenticationService.getInstance());\n const AfterLoginElement =\n ConfigService.getInstance().config.login?.AfterLoginElement;\n\n useEffect(() => {\n AuthenticationService.getInstance().authContextProps = auth;\n }, [auth]);\n\n useEffect(() => {\n if (auth.isAuthenticated && !hasGivenConsent) {\n consentDialogRef.current.open();\n }\n }, [auth.isAuthenticated, hasGivenConsent]);\n\n const onConsentDialogConsent = useCallback(() => {\n LogService.getInstance().log([\n {\n level: CommonDbLogLevel.INFO,\n topic: 'CONSENT',\n },\n ]);\n setHasGivenConsent(true);\n consentDialogRef.current.close();\n }, []);\n\n const login = useCallback(() => {\n const perform = async () => {\n const { hash, pathname, search } = WindowService.getInstance().window.location;\n\n const state: AuthState = {\n preLoginLocation: {\n hash,\n pathname,\n search,\n },\n };\n await auth.signinRedirect({\n state,\n });\n };\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n perform();\n }, [auth]);\n\n const onLoginButtonClick = useCallback(() => {\n login();\n }, [login]);\n\n const onChangeLoginProviderButtonClick = useCallback(() => {\n AuthenticationService.clearStaleState();\n AuthenticationService.getInstance().next(undefined);\n }, []);\n\n const now = useMemo(() => new Date().getTime(), []);\n\n const loginElement = useMemo(\n () => (\n <>\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Button\n color={'primary'}\n data-name={oidcConfiguration.name}\n onClick={onLoginButtonClick}\n variant={'contained'}\n >\n {oidcConfiguration.label}\n </Button>\n </Box>\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Button\n color={'primary'}\n onClick={onChangeLoginProviderButtonClick}\n variant={'outlined'}\n >\n {t`Choose a different identity provider`}\n </Button>\n </Box>\n {AfterLoginElement && <AfterLoginElement />}\n </>\n ), [oidcConfiguration, onChangeLoginProviderButtonClick, onLoginButtonClick, t, AfterLoginElement],\n );\n\n if (auth.activeNavigator || auth.isLoading) {\n return (\n <PageContainer\n ignorePageEvent\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('RedirectingPage')}\n title={t`Redirecting`}\n >\n <Spinner label={t`Redirecting`} />\n </PageContainer>\n );\n }\n\n if (auth.error) {\n AuthenticationService.clearStaleState();\n LogService.getInstance().log([\n {\n detail: {\n error: auth.error,\n },\n level: CommonDbLogLevel.ERROR,\n topic: 'Authentication Error',\n },\n ]);\n\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes(\n 'LoginPageSessionExpired',\n )}\n title={t`Login`}\n >\n <Typography\n component={'p'}\n sx={{ textAlign: 'center' }}\n >\n {t`We could not log you in, or your session has expired.`}\n </Typography>\n {loginElement}\n </PageContainer>\n );\n }\n\n if (!auth.isAuthenticated) {\n if (\n AuthenticationService.getInstance().getUserManagerSettingsCreatedAt() &&\n now -\n AuthenticationService.getInstance().getUserManagerSettingsCreatedAt() <\n AuthenticationService.autoLoginSkew\n ) {\n login();\n return;\n }\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('LoginPage')}\n title={t`Login`}\n >\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Typography component={'p'}>\n {t`You need to login to access this application.`}\n </Typography>\n </Box>\n {loginElement}\n </PageContainer>\n );\n }\n\n return (\n <>\n {children}\n {ConfigService.getInstance().config.consentDialog?.getShouldShow() && (\n <ConsentDialog\n onConsent={onConsentDialogConsent}\n ref={consentDialogRef}\n />\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA6BA,IAAa,KAAyB,EAAE,kBAAkC;CACxE,IAAM,EAAE,SAAM,EAAe,GACvB,IAAO,EAAQ,GACf,IAAmB,EAAgC,IAAI,GACvD,CAAC,GAAiB,KAAsB,EAC5C,CAAC,EAAc,YAAY,CAAC,CAAC,OAAO,eAAe,cAAc,CACnE,GAEM,IAAoB,EAAgB,EAAsB,YAAY,CAAC,GACvE,IACJ,EAAc,YAAY,CAAC,CAAC,OAAO,OAAO;CAM5C,AAJA,QAAgB;EACd,EAAsB,YAAY,CAAC,CAAC,mBAAmB;CACzD,GAAG,CAAC,CAAI,CAAC,GAET,QAAgB;EACd,AAAI,EAAK,mBAAmB,CAAC,KAC3B,EAAiB,QAAQ,KAAK;CAElC,GAAG,CAAC,EAAK,iBAAiB,CAAe,CAAC;CAE1C,IAAM,IAAyB,QAAkB;EAQ/C,AAPA,EAAW,YAAY,CAAC,CAAC,IAAI,CAC3B;GACE,OAAO,EAAiB;GACxB,OAAO;EACT,CACF,CAAC,GACD,EAAmB,EAAI,GACvB,EAAiB,QAAQ,MAAM;CACjC,GAAG,CAAC,CAAC,GAEC,IAAQ,QAAkB;EAgB9B,aAf4B;GAC1B,IAAM,EAAE,SAAM,aAAU,cAAW,EAAc,YAAY,CAAC,CAAC,OAAO,UAEhE,IAAmB,EACvB,kBAAkB;IAChB;IACA;IACA;GACF,EACF;GACA,MAAM,EAAK,eAAe,EACxB,SACF,CAAC;EACH,EAEA,CAAQ;CACV,GAAG,CAAC,CAAI,CAAC,GAEH,IAAqB,QAAkB;EAC3C,EAAM;CACR,GAAG,CAAC,CAAK,CAAC,GAEJ,IAAmC,QAAkB;EAEzD,AADA,EAAsB,gBAAgB,GACtC,EAAsB,YAAY,CAAC,CAAC,KAAK,KAAA,CAAS;CACpD,GAAG,CAAC,CAAC,GAEC,IAAM,yBAAc,IAAI,KAAK,EAAA,CAAE,QAAQ,GAAG,CAAC,CAAC,GAE5C,IAAe,QAEjB,kBAAA,GAAA,EAAA,UAAA;EACE,kBAAC,GAAD;GACE,IAAI;IACF,SAAS;IACT,WAAW;GACb;GAEA,UAAA,kBAAC,GAAD;IACE,OAAO;IACP,aAAW,EAAkB;IAC7B,SAAS;IACT,SAAS;IAER,UAAA,EAAkB;GACb,CAAA;EACL,CAAA;EACL,kBAAC,GAAD;GACE,IAAI;IACF,SAAS;IACT,WAAW;GACb;GAEA,UAAA,kBAAC,GAAD;IACE,OAAO;IACP,SAAS;IACT,SAAS;IAER,UAAA,CAAC;GACI,CAAA;EACL,CAAA;EACJ,KAAqB,kBAAC,GAAD,CAAoB,CAAA;CAC1C,EAAA,CAAA,GACD;EAAC;EAAmB;EAAkC;EAAoB;EAAG;CAAiB,CACnG;CAEA,IAAI,EAAK,mBAAmB,EAAK,WAC/B,OACE,kBAAC,GAAD;EACE,iBAAA;EACA,cAAA;EACA,kBAAkB,EAAW,iBAAiB,iBAAiB;EAC/D,OAAO,CAAC;EAER,UAAA,kBAAC,GAAD,EAAS,OAAO,CAAC,cAAgB,CAAA;CACpB,CAAA;CAInB,IAAI,EAAK,OAYP,OAXA,EAAsB,gBAAgB,GACtC,EAAW,YAAY,CAAC,CAAC,IAAI,CAC3B;EACE,QAAQ,EACN,OAAO,EAAK,MACd;EACA,OAAO,EAAiB;EACxB,OAAO;CACT,CACF,CAAC,GAGC,kBAAC,GAAD;EACE,cAAA;EACA,kBAAkB,EAAW,iBAC3B,yBACF;EACA,OAAO,CAAC;EALV,UAAA,CAOE,kBAAC,GAAD;GACE,WAAW;GACX,IAAI,EAAE,WAAW,SAAS;GAEzB,UAAA,CAAC;EACQ,CAAA,GACX,CACY;;CAInB,IAAI,CAAC,EAAK,iBAAiB;EACzB,IACE,EAAsB,YAAY,CAAC,CAAC,gCAAgC,KACpE,IACE,EAAsB,YAAY,CAAC,CAAC,gCAAgC,IACpE,EAAsB,eACxB;GACA,EAAM;GACN;EACF;EACA,OACE,kBAAC,GAAD;GACE,cAAA;GACA,kBAAkB,EAAW,iBAAiB,WAAW;GACzD,OAAO,CAAC;GAHV,UAAA,CAKE,kBAAC,GAAD;IACE,IAAI;KACF,SAAS;KACT,WAAW;IACb;IAEA,UAAA,kBAAC,GAAD;KAAY,WAAW;KACpB,UAAA,CAAC;IACQ,CAAA;GACT,CAAA,GACJ,CACY;;CAEnB;CAEA,OACE,kBAAA,GAAA,EAAA,UAAA,CACG,GACA,EAAc,YAAY,CAAC,CAAC,OAAO,eAAe,cAAc,KAC/D,kBAAC,GAAD;EACE,WAAW;EACX,KAAK;CACN,CAAA,CAEH,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","_Fragment","Fragment$1","AuthenticationWrapper","useTranslation","auth","useAuth","config","useConfig","consentDialogRef","useRef","hasGivenConsent","setHasGivenConsent","useState","oidcConfiguration","useSubscribable","container","AuthenticationService","AfterLoginElement","useEffect","onConsentDialogConsent","useCallback","LogService","CommonDbLogLevel","login","WindowService","state","onLoginButtonClick","onChangeLoginProviderButtonClick","now","useMemo","loginElement","Box","Button","t","PageContainer","TestIdUtil","Spinner","Typography","children","ConsentDialog"],"sources":["../../../../src/components/app/AuthenticationWrapper/AuthenticationWrapper.tsx"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { PropsWithChildren } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useAuth } from 'react-oidc-context';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\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 { useConfig } from '../../../hooks/useConfig';\nimport type { AuthState } from '../../../models/auth.models';\nimport type { ConsentDialogRefMethods } from '../../ui/ConsentDialog';\nimport { ConsentDialog } from '../../ui/ConsentDialog';\nimport { PageContainer } from '../../ui/PageContainer';\n\nexport const AuthenticationWrapper = ({ children }: PropsWithChildren) => {\n const { t } = useTranslation();\n const auth = useAuth();\n const config = useConfig();\n const consentDialogRef = useRef<ConsentDialogRefMethods>(null);\n const [hasGivenConsent, setHasGivenConsent] = useState<boolean>(\n !config.consentDialog?.getShouldShow(),\n );\n\n const oidcConfiguration = useSubscribable(rootContainer.resolve(AuthenticationService));\n const AfterLoginElement = config.login?.AfterLoginElement;\n\n useEffect(() => {\n rootContainer.resolve(AuthenticationService).authContextProps = auth;\n }, [auth]);\n\n useEffect(() => {\n if (auth.isAuthenticated && !hasGivenConsent) {\n consentDialogRef.current.open();\n }\n }, [auth.isAuthenticated, hasGivenConsent]);\n\n const onConsentDialogConsent = useCallback(() => {\n rootContainer.resolve(LogService).log([\n {\n level: CommonDbLogLevel.INFO,\n topic: 'CONSENT',\n },\n ]);\n setHasGivenConsent(true);\n consentDialogRef.current.close();\n }, []);\n\n const login = useCallback(() => {\n const perform = async () => {\n const { hash, pathname, search } = WindowService.getInstance().window.location;\n\n const state: AuthState = {\n preLoginLocation: {\n hash,\n pathname,\n search,\n },\n };\n await auth.signinRedirect({\n state,\n });\n };\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n perform();\n }, [auth]);\n\n const onLoginButtonClick = useCallback(() => {\n login();\n }, [login]);\n\n const onChangeLoginProviderButtonClick = useCallback(() => {\n AuthenticationService.clearStaleState();\n rootContainer.resolve(AuthenticationService).next(undefined);\n }, []);\n\n const now = useMemo(() => new Date().getTime(), []);\n\n const loginElement = useMemo(\n () => (\n <>\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Button\n color={'primary'}\n data-name={oidcConfiguration.name}\n onClick={onLoginButtonClick}\n variant={'contained'}\n >\n {oidcConfiguration.label}\n </Button>\n </Box>\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Button\n color={'primary'}\n onClick={onChangeLoginProviderButtonClick}\n variant={'outlined'}\n >\n {t`Choose a different identity provider`}\n </Button>\n </Box>\n {AfterLoginElement && <AfterLoginElement />}\n </>\n ), [oidcConfiguration, onChangeLoginProviderButtonClick, onLoginButtonClick, t, AfterLoginElement],\n );\n\n if (auth.activeNavigator || auth.isLoading) {\n return (\n <PageContainer\n ignorePageEvent\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('RedirectingPage')}\n title={t`Redirecting`}\n >\n <Spinner label={t`Redirecting`} />\n </PageContainer>\n );\n }\n\n if (auth.error) {\n AuthenticationService.clearStaleState();\n rootContainer.resolve(LogService).log([\n {\n detail: {\n error: auth.error,\n },\n level: CommonDbLogLevel.ERROR,\n topic: 'Authentication Error',\n },\n ]);\n\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes(\n 'LoginPageSessionExpired',\n )}\n title={t`Login`}\n >\n <Typography\n component={'p'}\n sx={{ textAlign: 'center' }}\n >\n {t`We could not log you in, or your session has expired.`}\n </Typography>\n {loginElement}\n </PageContainer>\n );\n }\n\n if (!auth.isAuthenticated) {\n if (\n rootContainer.resolve(AuthenticationService).getUserManagerSettingsCreatedAt() &&\n now -\n rootContainer.resolve(AuthenticationService).getUserManagerSettingsCreatedAt() <\n AuthenticationService.autoLoginSkew\n ) {\n login();\n return;\n }\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('LoginPage')}\n title={t`Login`}\n >\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Typography component={'p'}>\n {t`You need to login to access this application.`}\n </Typography>\n </Box>\n {loginElement}\n </PageContainer>\n );\n }\n\n return (\n <>\n {children}\n {config.consentDialog?.getShouldShow() && (\n <ConsentDialog\n onConsent={onConsentDialogConsent}\n ref={consentDialogRef}\n />\n )}\n </>\n );\n};\n"],"mappings":"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"}