@plumile/backoffice-react 0.1.134 → 0.1.142

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 (294) hide show
  1. package/README.md +46 -2
  2. package/lib/esm/auth/AuthRefreshNotice.js +20 -29
  3. package/lib/esm/auth/AuthRefreshNotice.js.map +1 -1
  4. package/lib/esm/auth/authRefreshNotice.css.js +2 -3
  5. package/lib/esm/auth/authRefreshNotice.css.js.map +1 -1
  6. package/lib/esm/auth/login/loginPage.css.js +1 -0
  7. package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +164 -164
  8. package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
  9. package/lib/esm/components/backoffice/detail/BackofficeDetailErrorList.js +35 -32
  10. package/lib/esm/components/backoffice/detail/BackofficeDetailErrorList.js.map +1 -1
  11. package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.js +9 -20
  12. package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.js.map +1 -1
  13. package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js +19 -19
  14. package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js.map +1 -1
  15. package/lib/esm/components/backoffice/detail/BackofficeDetailTaggedValue.js +7 -13
  16. package/lib/esm/components/backoffice/detail/BackofficeDetailTaggedValue.js.map +1 -1
  17. package/lib/esm/components/backoffice/detail/BackofficeEnumLabel.js +9 -4
  18. package/lib/esm/components/backoffice/detail/BackofficeEnumLabel.js.map +1 -1
  19. package/lib/esm/components/backoffice/detail/BackofficeLifecycleTimelineSection.js +22 -30
  20. package/lib/esm/components/backoffice/detail/BackofficeLifecycleTimelineSection.js.map +1 -1
  21. package/lib/esm/components/backoffice/detail/BackofficeReferenceValue.js +10 -15
  22. package/lib/esm/components/backoffice/detail/BackofficeReferenceValue.js.map +1 -1
  23. package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +20 -20
  24. package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js.map +1 -1
  25. package/lib/esm/components/backoffice/detail/BackofficeStatusGroup.js +4 -4
  26. package/lib/esm/components/backoffice/detail/BackofficeStatusGroup.js.map +1 -1
  27. package/lib/esm/components/backoffice/detail/BackofficeStatusMetaBadge.js +9 -20
  28. package/lib/esm/components/backoffice/detail/BackofficeStatusMetaBadge.js.map +1 -1
  29. package/lib/esm/components/backoffice/detail/BackofficeTokenUsageBreakdown.js +28 -18
  30. package/lib/esm/components/backoffice/detail/BackofficeTokenUsageBreakdown.js.map +1 -1
  31. package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js +57 -46
  32. package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js.map +1 -1
  33. package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +0 -1
  34. package/lib/esm/components/backoffice/detail/detailPayloadUtils.js +1 -10
  35. package/lib/esm/components/backoffice/detail/detailPayloadUtils.js.map +1 -1
  36. package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +1 -1
  37. package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js.map +1 -1
  38. package/lib/esm/components/backoffice/layout/buildSidebarSections.js.map +1 -1
  39. package/lib/esm/components/backoffice/layout/mapViewerToSidebarProfileView.js.map +1 -1
  40. package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +46 -43
  41. package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
  42. package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +2 -2
  43. package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js.map +1 -1
  44. package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js +1 -0
  45. package/lib/esm/components/backoffice/routing/BackofficeContentError.js +6 -6
  46. package/lib/esm/components/backoffice/routing/BackofficeContentError.js.map +1 -1
  47. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +48 -44
  48. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
  49. package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js +12 -8
  50. package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js.map +1 -1
  51. package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js +13 -11
  52. package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js.map +1 -1
  53. package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js +8 -8
  54. package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js.map +1 -1
  55. package/lib/esm/components/backoffice/tools/BackofficeToolsQueryBoundary.js +16 -16
  56. package/lib/esm/components/backoffice/tools/BackofficeToolsQueryBoundary.js.map +1 -1
  57. package/lib/esm/i18n/locales/en/backofficeReact.js +0 -9
  58. package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
  59. package/lib/esm/i18n/locales/fr/backofficeReact.js +0 -9
  60. package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
  61. package/lib/esm/index.js +72 -89
  62. package/lib/esm/pages/BackofficeDashboardPage.js +95 -95
  63. package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
  64. package/lib/esm/pages/BackofficeEntityDetailPage.js +223 -204
  65. package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
  66. package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +23 -21
  67. package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
  68. package/lib/esm/pages/BackofficeEntityListPage.js +34 -34
  69. package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
  70. package/lib/esm/pages/BackofficeHubPage.js +4 -4
  71. package/lib/esm/pages/BackofficeLayoutPage.js +58 -56
  72. package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
  73. package/lib/esm/pages/detail/buildTabsItems.js.map +1 -1
  74. package/lib/esm/provider/BackofficeProvider.js +58 -58
  75. package/lib/esm/provider/BackofficeProvider.js.map +1 -1
  76. package/lib/esm/style.css +1 -1
  77. package/lib/types/auth/AuthRefreshNotice.d.ts.map +1 -1
  78. package/lib/types/auth/authRefreshNotice.css.d.ts +0 -2
  79. package/lib/types/auth/authRefreshNotice.css.d.ts.map +1 -1
  80. package/lib/types/components/backoffice/detail/BackofficeDetailErrorList.d.ts.map +1 -1
  81. package/lib/types/components/backoffice/detail/BackofficeDetailFlagTag.d.ts +2 -1
  82. package/lib/types/components/backoffice/detail/BackofficeDetailFlagTag.d.ts.map +1 -1
  83. package/lib/types/components/backoffice/detail/BackofficeDetailPrimitives.stories.d.ts.map +1 -1
  84. package/lib/types/components/backoffice/detail/BackofficeDetailTaggedValue.d.ts +2 -1
  85. package/lib/types/components/backoffice/detail/BackofficeDetailTaggedValue.d.ts.map +1 -1
  86. package/lib/types/components/backoffice/detail/BackofficeEnumLabel.d.ts.map +1 -1
  87. package/lib/types/components/backoffice/detail/BackofficeLifecycleTimelineSection.d.ts.map +1 -1
  88. package/lib/types/components/backoffice/detail/BackofficeReferenceValue.d.ts +2 -1
  89. package/lib/types/components/backoffice/detail/BackofficeReferenceValue.d.ts.map +1 -1
  90. package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts +2 -2
  91. package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts.map +1 -1
  92. package/lib/types/components/backoffice/detail/BackofficeStatusGroup.d.ts.map +1 -1
  93. package/lib/types/components/backoffice/detail/BackofficeStatusMetaBadge.d.ts +4 -6
  94. package/lib/types/components/backoffice/detail/BackofficeStatusMetaBadge.d.ts.map +1 -1
  95. package/lib/types/components/backoffice/detail/BackofficeTokenUsageBreakdown.d.ts.map +1 -1
  96. package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts +10 -2
  97. package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts.map +1 -1
  98. package/lib/types/components/backoffice/detail/detailPayloadUtils.d.ts +0 -1
  99. package/lib/types/components/backoffice/detail/detailPayloadUtils.d.ts.map +1 -1
  100. package/lib/types/components/backoffice/layout/backofficeSidebarActions.css.d.ts.map +1 -1
  101. package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts +2 -2
  102. package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts.map +1 -1
  103. package/lib/types/components/backoffice/layout/mapViewerToSidebarProfileView.d.ts +2 -2
  104. package/lib/types/components/backoffice/layout/mapViewerToSidebarProfileView.d.ts.map +1 -1
  105. package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
  106. package/lib/types/components/backoffice/pickers/entityIdPickerDialog.css.d.ts +0 -8
  107. package/lib/types/components/backoffice/pickers/entityIdPickerDialog.css.d.ts.map +1 -1
  108. package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
  109. package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts +2 -2
  110. package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts.map +1 -1
  111. package/lib/types/components/backoffice/tools/BackofficeToolsErrorFallback.d.ts.map +1 -1
  112. package/lib/types/i18n/resources.d.ts +0 -22
  113. package/lib/types/i18n/resources.d.ts.map +1 -1
  114. package/lib/types/index.d.ts +2 -25
  115. package/lib/types/index.d.ts.map +1 -1
  116. package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
  117. package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
  118. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +12 -0
  119. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
  120. package/lib/types/pages/BackofficeLayoutPage.d.ts.map +1 -1
  121. package/lib/types/pages/detail/buildTabsItems.d.ts +4 -4
  122. package/lib/types/pages/detail/buildTabsItems.d.ts.map +1 -1
  123. package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
  124. package/package.json +11 -11
  125. package/lib/esm/components/backoffice/detail/BackofficeAuditMetadataPanel.js +0 -31
  126. package/lib/esm/components/backoffice/detail/BackofficeAuditMetadataPanel.js.map +0 -1
  127. package/lib/esm/components/backoffice/detail/BackofficeCopyButton.js +0 -15
  128. package/lib/esm/components/backoffice/detail/BackofficeCopyButton.js.map +0 -1
  129. package/lib/esm/components/backoffice/detail/BackofficeDetailActionBar.js +0 -11
  130. package/lib/esm/components/backoffice/detail/BackofficeDetailActionBar.js.map +0 -1
  131. package/lib/esm/components/backoffice/detail/BackofficeDetailBlock.js +0 -7
  132. package/lib/esm/components/backoffice/detail/BackofficeDetailBlock.js.map +0 -1
  133. package/lib/esm/components/backoffice/detail/BackofficeDetailField.js +0 -31
  134. package/lib/esm/components/backoffice/detail/BackofficeDetailField.js.map +0 -1
  135. package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.css.js +0 -7
  136. package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.css.js.map +0 -1
  137. package/lib/esm/components/backoffice/detail/BackofficeDetailHeader.js +0 -15
  138. package/lib/esm/components/backoffice/detail/BackofficeDetailHeader.js.map +0 -1
  139. package/lib/esm/components/backoffice/detail/BackofficeDetailLayout.js +0 -20
  140. package/lib/esm/components/backoffice/detail/BackofficeDetailLayout.js.map +0 -1
  141. package/lib/esm/components/backoffice/detail/BackofficeDetailPage.js +0 -19
  142. package/lib/esm/components/backoffice/detail/BackofficeDetailPage.js.map +0 -1
  143. package/lib/esm/components/backoffice/detail/BackofficeDetailPayload.js +0 -18
  144. package/lib/esm/components/backoffice/detail/BackofficeDetailPayload.js.map +0 -1
  145. package/lib/esm/components/backoffice/detail/BackofficeDetailSection.js +0 -36
  146. package/lib/esm/components/backoffice/detail/BackofficeDetailSection.js.map +0 -1
  147. package/lib/esm/components/backoffice/detail/BackofficeDetailTable.js +0 -8
  148. package/lib/esm/components/backoffice/detail/BackofficeDetailTable.js.map +0 -1
  149. package/lib/esm/components/backoffice/detail/BackofficeEmptyValue.js +0 -7
  150. package/lib/esm/components/backoffice/detail/BackofficeEmptyValue.js.map +0 -1
  151. package/lib/esm/components/backoffice/detail/BackofficeEntityRefLink.js +0 -17
  152. package/lib/esm/components/backoffice/detail/BackofficeEntityRefLink.js.map +0 -1
  153. package/lib/esm/components/backoffice/detail/BackofficeKpiStrip.js +0 -38
  154. package/lib/esm/components/backoffice/detail/BackofficeKpiStrip.js.map +0 -1
  155. package/lib/esm/components/backoffice/detail/BackofficePayloadInspectorSection.js +0 -36
  156. package/lib/esm/components/backoffice/detail/BackofficePayloadInspectorSection.js.map +0 -1
  157. package/lib/esm/components/backoffice/detail/BackofficeScopeStack.js +0 -28
  158. package/lib/esm/components/backoffice/detail/BackofficeScopeStack.js.map +0 -1
  159. package/lib/esm/components/backoffice/detail/BackofficeTechnicalFacts.js +0 -2
  160. package/lib/esm/components/backoffice/detail/backofficeAuditMetadataPanel.css.js +0 -7
  161. package/lib/esm/components/backoffice/detail/backofficeAuditMetadataPanel.css.js.map +0 -1
  162. package/lib/esm/components/backoffice/detail/backofficeDetailField.css.js +0 -15
  163. package/lib/esm/components/backoffice/detail/backofficeDetailField.css.js.map +0 -1
  164. package/lib/esm/components/backoffice/detail/backofficeDetailSection.css.js +0 -7
  165. package/lib/esm/components/backoffice/detail/backofficeDetailSection.css.js.map +0 -1
  166. package/lib/esm/components/backoffice/detail/backofficeDetailTaggedValue.css.js +0 -7
  167. package/lib/esm/components/backoffice/detail/backofficeDetailTaggedValue.css.js.map +0 -1
  168. package/lib/esm/components/backoffice/detail/backofficeKpiStrip.css.js +0 -19
  169. package/lib/esm/components/backoffice/detail/backofficeKpiStrip.css.js.map +0 -1
  170. package/lib/esm/components/backoffice/detail/backofficeLifecycleTimelineSection.css.js +0 -7
  171. package/lib/esm/components/backoffice/detail/backofficeLifecycleTimelineSection.css.js.map +0 -1
  172. package/lib/esm/components/backoffice/detail/backofficePayloadInspectorSection.css.js +0 -7
  173. package/lib/esm/components/backoffice/detail/backofficePayloadInspectorSection.css.js.map +0 -1
  174. package/lib/esm/components/backoffice/detail/backofficeReferenceValue.css.js +0 -7
  175. package/lib/esm/components/backoffice/detail/backofficeReferenceValue.css.js.map +0 -1
  176. package/lib/esm/components/backoffice/detail/backofficeScopeStack.css.js +0 -7
  177. package/lib/esm/components/backoffice/detail/backofficeScopeStack.css.js.map +0 -1
  178. package/lib/esm/components/backoffice/detail/backofficeStatusMetaBadge.css.js +0 -7
  179. package/lib/esm/components/backoffice/detail/backofficeStatusMetaBadge.css.js.map +0 -1
  180. package/lib/esm/components/backoffice/lists/BackofficeListToolbar.js +0 -33
  181. package/lib/esm/components/backoffice/lists/BackofficeListToolbar.js.map +0 -1
  182. package/lib/esm/components/backoffice/lists/backofficeListToolbar.css.js +0 -13
  183. package/lib/esm/components/backoffice/lists/backofficeListToolbar.css.js.map +0 -1
  184. package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js +0 -33
  185. package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js.map +0 -1
  186. package/lib/esm/components/backoffice/pickers/shared/EntityPickerRowBase.js +0 -23
  187. package/lib/esm/components/backoffice/pickers/shared/EntityPickerRowBase.js.map +0 -1
  188. package/lib/esm/components/backoffice/pickers/shared/EntityPickerShell.js +0 -28
  189. package/lib/esm/components/backoffice/pickers/shared/EntityPickerShell.js.map +0 -1
  190. package/lib/esm/components/backoffice/pickers/types.js +0 -0
  191. package/lib/esm/pages/dashboard/DashboardMetricGroup.js +0 -26
  192. package/lib/esm/pages/dashboard/DashboardMetricGroup.js.map +0 -1
  193. package/lib/esm/pages/dashboard/DashboardPanel.js +0 -15
  194. package/lib/esm/pages/dashboard/DashboardPanel.js.map +0 -1
  195. package/lib/esm/pages/dashboard/DashboardQuickActions.js +0 -27
  196. package/lib/esm/pages/dashboard/DashboardQuickActions.js.map +0 -1
  197. package/lib/esm/pages/dashboard/DashboardStatusList.js +0 -28
  198. package/lib/esm/pages/dashboard/DashboardStatusList.js.map +0 -1
  199. package/lib/esm/pages/dashboard/dashboardMetricGroup.css.js +0 -8
  200. package/lib/esm/pages/dashboard/dashboardMetricGroup.css.js.map +0 -1
  201. package/lib/esm/pages/dashboard/dashboardPanel.css.js +0 -7
  202. package/lib/esm/pages/dashboard/dashboardPanel.css.js.map +0 -1
  203. package/lib/esm/pages/dashboard/dashboardQuickActions.css.js +0 -7
  204. package/lib/esm/pages/dashboard/dashboardQuickActions.css.js.map +0 -1
  205. package/lib/esm/pages/dashboard/dashboardStatusList.css.js +0 -7
  206. package/lib/esm/pages/dashboard/dashboardStatusList.css.js.map +0 -1
  207. package/lib/types/components/backoffice/detail/BackofficeAuditMetadataPanel.d.ts +0 -19
  208. package/lib/types/components/backoffice/detail/BackofficeAuditMetadataPanel.d.ts.map +0 -1
  209. package/lib/types/components/backoffice/detail/BackofficeCopyButton.d.ts +0 -8
  210. package/lib/types/components/backoffice/detail/BackofficeCopyButton.d.ts.map +0 -1
  211. package/lib/types/components/backoffice/detail/BackofficeDetailActionBar.d.ts +0 -9
  212. package/lib/types/components/backoffice/detail/BackofficeDetailActionBar.d.ts.map +0 -1
  213. package/lib/types/components/backoffice/detail/BackofficeDetailBlock.d.ts +0 -7
  214. package/lib/types/components/backoffice/detail/BackofficeDetailBlock.d.ts.map +0 -1
  215. package/lib/types/components/backoffice/detail/BackofficeDetailField.d.ts +0 -13
  216. package/lib/types/components/backoffice/detail/BackofficeDetailField.d.ts.map +0 -1
  217. package/lib/types/components/backoffice/detail/BackofficeDetailFlagTag.css.d.ts +0 -4
  218. package/lib/types/components/backoffice/detail/BackofficeDetailFlagTag.css.d.ts.map +0 -1
  219. package/lib/types/components/backoffice/detail/BackofficeDetailHeader.d.ts +0 -12
  220. package/lib/types/components/backoffice/detail/BackofficeDetailHeader.d.ts.map +0 -1
  221. package/lib/types/components/backoffice/detail/BackofficeDetailLayout.d.ts +0 -8
  222. package/lib/types/components/backoffice/detail/BackofficeDetailLayout.d.ts.map +0 -1
  223. package/lib/types/components/backoffice/detail/BackofficeDetailPage.d.ts +0 -16
  224. package/lib/types/components/backoffice/detail/BackofficeDetailPage.d.ts.map +0 -1
  225. package/lib/types/components/backoffice/detail/BackofficeDetailPage.stories.d.ts +0 -11
  226. package/lib/types/components/backoffice/detail/BackofficeDetailPage.stories.d.ts.map +0 -1
  227. package/lib/types/components/backoffice/detail/BackofficeDetailPayload.d.ts +0 -10
  228. package/lib/types/components/backoffice/detail/BackofficeDetailPayload.d.ts.map +0 -1
  229. package/lib/types/components/backoffice/detail/BackofficeDetailSection.d.ts +0 -11
  230. package/lib/types/components/backoffice/detail/BackofficeDetailSection.d.ts.map +0 -1
  231. package/lib/types/components/backoffice/detail/BackofficeDetailTable.d.ts +0 -6
  232. package/lib/types/components/backoffice/detail/BackofficeDetailTable.d.ts.map +0 -1
  233. package/lib/types/components/backoffice/detail/BackofficeEmptyValue.d.ts +0 -7
  234. package/lib/types/components/backoffice/detail/BackofficeEmptyValue.d.ts.map +0 -1
  235. package/lib/types/components/backoffice/detail/BackofficeEntityRefLink.d.ts +0 -15
  236. package/lib/types/components/backoffice/detail/BackofficeEntityRefLink.d.ts.map +0 -1
  237. package/lib/types/components/backoffice/detail/BackofficeKpiStrip.d.ts +0 -17
  238. package/lib/types/components/backoffice/detail/BackofficeKpiStrip.d.ts.map +0 -1
  239. package/lib/types/components/backoffice/detail/BackofficePayloadInspectorSection.d.ts +0 -15
  240. package/lib/types/components/backoffice/detail/BackofficePayloadInspectorSection.d.ts.map +0 -1
  241. package/lib/types/components/backoffice/detail/BackofficeScopeStack.d.ts +0 -13
  242. package/lib/types/components/backoffice/detail/BackofficeScopeStack.d.ts.map +0 -1
  243. package/lib/types/components/backoffice/detail/BackofficeTechnicalFacts.d.ts +0 -2
  244. package/lib/types/components/backoffice/detail/BackofficeTechnicalFacts.d.ts.map +0 -1
  245. package/lib/types/components/backoffice/detail/backofficeAuditMetadataPanel.css.d.ts +0 -5
  246. package/lib/types/components/backoffice/detail/backofficeAuditMetadataPanel.css.d.ts.map +0 -1
  247. package/lib/types/components/backoffice/detail/backofficeDetailField.css.d.ts +0 -14
  248. package/lib/types/components/backoffice/detail/backofficeDetailField.css.d.ts.map +0 -1
  249. package/lib/types/components/backoffice/detail/backofficeDetailSection.css.d.ts +0 -6
  250. package/lib/types/components/backoffice/detail/backofficeDetailSection.css.d.ts.map +0 -1
  251. package/lib/types/components/backoffice/detail/backofficeDetailTaggedValue.css.d.ts +0 -3
  252. package/lib/types/components/backoffice/detail/backofficeDetailTaggedValue.css.d.ts.map +0 -1
  253. package/lib/types/components/backoffice/detail/backofficeKpiStrip.css.d.ts +0 -29
  254. package/lib/types/components/backoffice/detail/backofficeKpiStrip.css.d.ts.map +0 -1
  255. package/lib/types/components/backoffice/detail/backofficeLifecycleTimelineSection.css.d.ts +0 -3
  256. package/lib/types/components/backoffice/detail/backofficeLifecycleTimelineSection.css.d.ts.map +0 -1
  257. package/lib/types/components/backoffice/detail/backofficePayloadInspectorSection.css.d.ts +0 -4
  258. package/lib/types/components/backoffice/detail/backofficePayloadInspectorSection.css.d.ts.map +0 -1
  259. package/lib/types/components/backoffice/detail/backofficeReferenceValue.css.d.ts +0 -3
  260. package/lib/types/components/backoffice/detail/backofficeReferenceValue.css.d.ts.map +0 -1
  261. package/lib/types/components/backoffice/detail/backofficeScopeStack.css.d.ts +0 -5
  262. package/lib/types/components/backoffice/detail/backofficeScopeStack.css.d.ts.map +0 -1
  263. package/lib/types/components/backoffice/detail/backofficeStatusMetaBadge.css.d.ts +0 -2
  264. package/lib/types/components/backoffice/detail/backofficeStatusMetaBadge.css.d.ts.map +0 -1
  265. package/lib/types/components/backoffice/lists/BackofficeListToolbar.d.ts +0 -16
  266. package/lib/types/components/backoffice/lists/BackofficeListToolbar.d.ts.map +0 -1
  267. package/lib/types/components/backoffice/lists/BackofficeListToolbar.stories.d.ts +0 -13
  268. package/lib/types/components/backoffice/lists/BackofficeListToolbar.stories.d.ts.map +0 -1
  269. package/lib/types/components/backoffice/lists/backofficeListToolbar.css.d.ts +0 -16
  270. package/lib/types/components/backoffice/lists/backofficeListToolbar.css.d.ts.map +0 -1
  271. package/lib/types/components/backoffice/pickers/shared/EntityPickerList.d.ts +0 -10
  272. package/lib/types/components/backoffice/pickers/shared/EntityPickerList.d.ts.map +0 -1
  273. package/lib/types/components/backoffice/pickers/shared/EntityPickerRowBase.d.ts +0 -8
  274. package/lib/types/components/backoffice/pickers/shared/EntityPickerRowBase.d.ts.map +0 -1
  275. package/lib/types/components/backoffice/pickers/shared/EntityPickerShell.d.ts +0 -11
  276. package/lib/types/components/backoffice/pickers/shared/EntityPickerShell.d.ts.map +0 -1
  277. package/lib/types/components/backoffice/pickers/types.d.ts +0 -14
  278. package/lib/types/components/backoffice/pickers/types.d.ts.map +0 -1
  279. package/lib/types/pages/dashboard/DashboardMetricGroup.d.ts +0 -14
  280. package/lib/types/pages/dashboard/DashboardMetricGroup.d.ts.map +0 -1
  281. package/lib/types/pages/dashboard/DashboardPanel.d.ts +0 -9
  282. package/lib/types/pages/dashboard/DashboardPanel.d.ts.map +0 -1
  283. package/lib/types/pages/dashboard/DashboardQuickActions.d.ts +0 -13
  284. package/lib/types/pages/dashboard/DashboardQuickActions.d.ts.map +0 -1
  285. package/lib/types/pages/dashboard/DashboardStatusList.d.ts +0 -13
  286. package/lib/types/pages/dashboard/DashboardStatusList.d.ts.map +0 -1
  287. package/lib/types/pages/dashboard/dashboardMetricGroup.css.d.ts +0 -4
  288. package/lib/types/pages/dashboard/dashboardMetricGroup.css.d.ts.map +0 -1
  289. package/lib/types/pages/dashboard/dashboardPanel.css.d.ts +0 -2
  290. package/lib/types/pages/dashboard/dashboardPanel.css.d.ts.map +0 -1
  291. package/lib/types/pages/dashboard/dashboardQuickActions.css.d.ts +0 -5
  292. package/lib/types/pages/dashboard/dashboardQuickActions.css.d.ts.map +0 -1
  293. package/lib/types/pages/dashboard/dashboardStatusList.css.d.ts +0 -6
  294. package/lib/types/pages/dashboard/dashboardStatusList.css.d.ts.map +0 -1
@@ -19,11 +19,11 @@ import { ToastProvider as pe } from "@plumile/ui/atomic/molecules/toast/ToastPro
19
19
  import me from "@plumile/router/routing/RoutingContext.js";
20
20
  import { GlobalSearchInput as he } from "@plumile/ui/backoffice/molecules/global_search_input/GlobalSearchInput.js";
21
21
  import ge from "@plumile/router/routing/useLocation.js";
22
- import { AdminShellLayout as _e } from "@plumile/ui/admin/templates/admin_shell_layout/AdminShellLayout.js";
23
- import { EnvironmentBadge as d } from "@plumile/ui/backoffice/atoms/environment_badge/EnvironmentBadge.js";
24
- import { BackofficeSidebarProfileMenu as f } from "@plumile/ui/backoffice/molecules/sidebar_profile_menu/BackofficeSidebarProfileMenu.js";
22
+ import { AdminShellLayout as d } from "@plumile/ui/admin/templates/admin_shell_layout/AdminShellLayout.js";
23
+ import { EnvironmentBadge as f } from "@plumile/ui/backoffice/atoms/environment_badge/EnvironmentBadge.js";
24
+ import { SidebarProfileMenu as p } from "@plumile/ui/components/navigation/sidebar/SidebarProfileMenu.js";
25
25
  //#region src/pages/BackofficeLayoutPage.tsx
26
- var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye = (e) => {
26
+ var _e = "plumile:backoffice:recent-items", ve = "plumile:backoffice:sidebar", ye = (e) => {
27
27
  if (typeof window > "u") return [];
28
28
  try {
29
29
  let t = window.localStorage.getItem(e);
@@ -42,14 +42,14 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
42
42
  window.localStorage.setItem(e, JSON.stringify(t));
43
43
  } catch {}
44
44
  }, m = ({ children: u, permissions: m, authStatus: h, activeGroupId: g }) => {
45
- let { t: _ } = de(), { t: v } = e(), { pathname: y } = ge(), b = ue(me), x = ae(), { auth: S, basePath: C, dashboards: w, entities: T, sidebar: E } = t(), [D, xe] = c(""), O = E?.preferences?.storageKey ?? p, k = E?.preferences?.persistCollapsed === !0, [A, j] = c(() => {
45
+ let { t: _ } = de(), { t: v } = e(), { pathname: y } = ge(), b = ue(me), x = ae(), { auth: S, basePath: C, dashboards: w, entities: T, sidebar: E } = t(), [D, xe] = c(""), O = E?.preferences?.storageKey ?? ve, k = E?.preferences?.persistCollapsed === !0, [A, Se] = c(() => {
46
46
  if (!k || typeof window > "u") return !1;
47
47
  try {
48
48
  return window.localStorage.getItem(`${O}:collapsed`) === "true";
49
49
  } catch {
50
50
  return !1;
51
51
  }
52
- }), [M, N] = c(!1), [P, Se] = c(null), F = E?.recentItems, I = F?.enabled === !0, L = F?.storageKey ?? ve, R = F?.maxItems ?? 8, [z, Ce] = c(() => I ? ye(L) : []);
52
+ }), [j, M] = c(!1), [N, Ce] = c(null), P = E?.recentItems, F = P?.enabled === !0, I = P?.storageKey ?? _e, L = P?.maxItems ?? 8, [R, we] = c(() => F ? ye(I) : []);
53
53
  o(() => {
54
54
  if (!(!k || typeof window > "u")) try {
55
55
  window.localStorage.setItem(`${O}:collapsed`, String(A));
@@ -59,50 +59,52 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
59
59
  k,
60
60
  O
61
61
  ]);
62
- let B = s(() => i(T, E), [T, E]), we = s(() => Object.keys(B), [B]), Te = s(() => Object.fromEntries(Object.entries(B).map(([e, t]) => [e, t.behavior?.defaultCollapsed ?? !0])), [B]), Ee = s(() => ee(B, T, E, m), [
62
+ let z = s(() => i(T, E), [T, E]), Te = s(() => Object.keys(z), [z]), Ee = s(() => Object.fromEntries(Object.entries(z).map(([e, t]) => [e, t.behavior?.defaultCollapsed ?? !0])), [z]), De = s(() => ee(z, T, E, m), [
63
63
  T,
64
- B,
64
+ z,
65
65
  m,
66
66
  E
67
- ]), V = s(() => r(y, T), [T, y]);
67
+ ]), B = s(() => r(y, T), [T, y]);
68
68
  o(() => {
69
- if (!I || V == null) return;
70
- let e = T[V];
69
+ if (!F || B == null) return;
70
+ let e = T[B];
71
71
  if (e == null || e.kind !== "tool" && !e.hasList) return;
72
72
  let t = e.routes.list, n = "entity";
73
73
  e.kind === "tool" && (n = "tool");
74
74
  let r = {
75
75
  kind: n,
76
- id: V,
76
+ id: B,
77
77
  label: e.label(_),
78
78
  href: t,
79
79
  visitedAt: Date.now()
80
80
  };
81
- Ce((e) => {
82
- let t = [r, ...e.filter((e) => e.id !== r.id || e.kind !== r.kind)].slice(0, R);
83
- return be(L, t), t;
81
+ we((e) => {
82
+ let t = [r, ...e.filter((e) => e.id !== r.id || e.kind !== r.kind)].slice(0, L);
83
+ return be(I, t), t;
84
84
  });
85
85
  }, [
86
- V,
86
+ B,
87
87
  T,
88
- I,
89
- R,
88
+ F,
90
89
  L,
90
+ I,
91
91
  _
92
92
  ]);
93
- let { pins: H, toggle: U, reorder: W } = oe({
94
- enabled: E?.pinnedItems?.enabled === !0,
93
+ let V = E?.pinnedItems?.enabled === !0, { pins: Oe, toggle: ke, reorder: Ae } = oe({
94
+ enabled: V,
95
95
  storageKey: E?.pinnedItems?.storageKey,
96
- visibleEntityIds: Ee
97
- }), G;
96
+ visibleEntityIds: De
97
+ }), H, U, W;
98
+ V && (H = Oe, U = ke, W = Ae);
99
+ let G;
98
100
  E?.preferences?.storageKey != null && (G = `${E.preferences.storageKey}:groups`);
99
101
  let { collapsedByGroupId: K, setCollapsed: q } = se({
100
- groupIds: we,
102
+ groupIds: Te,
101
103
  activeGroupId: g,
102
- defaultCollapsedByGroupId: Te,
104
+ defaultCollapsedByGroupId: Ee,
103
105
  persist: E?.preferences?.persistGroups === !0,
104
106
  storageKey: G
105
- }), De = s(() => a({
107
+ }), je = s(() => a({
106
108
  basePath: C,
107
109
  pathname: y,
108
110
  entities: T,
@@ -113,7 +115,7 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
113
115
  tApp: _,
114
116
  t: v,
115
117
  pinnedEntityIds: H,
116
- recentItems: z,
118
+ recentItems: R,
117
119
  onTogglePin: U,
118
120
  onReorderPin: W,
119
121
  collapsedByGroupId: K,
@@ -126,16 +128,16 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
126
128
  w,
127
129
  y,
128
130
  m,
129
- H,
130
- z,
131
- W,
131
+ R,
132
132
  q,
133
133
  E,
134
+ H,
134
135
  D,
136
+ W,
137
+ U,
135
138
  v,
136
- _,
137
- U
138
- ]), Oe = s(() => a({
139
+ _
140
+ ]), Me = s(() => a({
139
141
  basePath: C,
140
142
  pathname: y,
141
143
  entities: T,
@@ -146,7 +148,7 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
146
148
  tApp: _,
147
149
  t: v,
148
150
  pinnedEntityIds: H,
149
- recentItems: z,
151
+ recentItems: R,
150
152
  onTogglePin: U,
151
153
  onReorderPin: W,
152
154
  collapsedByGroupId: K,
@@ -159,17 +161,17 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
159
161
  w,
160
162
  y,
161
163
  m,
162
- H,
163
- z,
164
- W,
164
+ R,
165
165
  q,
166
166
  E,
167
+ H,
167
168
  D,
169
+ W,
170
+ U,
168
171
  v,
169
- _,
170
- U
172
+ _
171
173
  ]), J = s(() => import.meta.env?.DEV === !0 ? "dev" : "prod", []), Y = le(() => {
172
- M || (N(!0), (async () => {
174
+ j || (M(!0), (async () => {
173
175
  try {
174
176
  let e = await S.logout.load();
175
177
  await new Promise((t, n) => {
@@ -185,19 +187,19 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
185
187
  });
186
188
  }), localStorage.removeItem("auth_token"), localStorage.removeItem("remember_me"), ie(), b?.history.push({ pathname: ce(C) });
187
189
  } finally {
188
- N(!1);
190
+ M(!1);
189
191
  }
190
192
  })().catch(() => {}));
191
193
  }, [
192
194
  S.logout,
193
195
  C,
194
- M,
196
+ j,
195
197
  x,
196
198
  b
197
199
  ]), X = h?.me ?? null, Z = s(() => ne({
198
200
  viewer: X,
199
201
  unknownUserLabel: v("sidebar.profile.unknownUser")
200
- }), [v, X]), ke = /* @__PURE__ */ l(f, {
202
+ }), [v, X]), Ne = /* @__PURE__ */ l(p, {
201
203
  collapsed: !1,
202
204
  viewer: Z,
203
205
  labels: {
@@ -206,8 +208,8 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
206
208
  signOut: v("sidebar.profile.actions.signOut")
207
209
  },
208
210
  onSignOut: Y,
209
- isSigningOut: M
210
- }), Ae = /* @__PURE__ */ l(f, {
211
+ isSigningOut: j
212
+ }), Pe = /* @__PURE__ */ l(p, {
211
213
  collapsed: !1,
212
214
  viewer: Z,
213
215
  labels: {
@@ -216,43 +218,43 @@ var ve = "plumile:backoffice:recent-items", p = "plumile:backoffice:sidebar", ye
216
218
  signOut: v("sidebar.profile.actions.signOut")
217
219
  },
218
220
  onSignOut: Y,
219
- isSigningOut: M
221
+ isSigningOut: j
220
222
  }), Q = null;
221
- P != null && (Q = /* @__PURE__ */ l(re, { children: u }));
223
+ N != null && (Q = /* @__PURE__ */ l(re, { children: u }));
222
224
  let $ = /* @__PURE__ */ l(he, {
223
225
  value: D,
224
226
  onChange: xe,
225
227
  placeholder: v("sidebar.search.placeholder"),
226
228
  ariaLabel: v("sidebar.search.placeholder")
227
229
  });
228
- return /* @__PURE__ */ l(pe, { children: /* @__PURE__ */ l(_e, {
230
+ return /* @__PURE__ */ l(pe, { children: /* @__PURE__ */ l(d, {
229
231
  sidebar: {
230
- sections: De,
231
- header: /* @__PURE__ */ l(d, { environment: J }),
232
+ sections: je,
233
+ header: /* @__PURE__ */ l(f, { environment: J }),
232
234
  search: $,
233
- footer: ke,
235
+ footer: Ne,
234
236
  isCollapsed: A,
235
- onCollapsedChange: j,
237
+ onCollapsedChange: Se,
236
238
  collapseToggleLabel: v("sidebar.actions.collapseSidebar"),
237
239
  expandToggleLabel: v("sidebar.actions.expandSidebar"),
238
240
  navigationAriaLabel: v("sidebar.navigationAriaLabel")
239
241
  },
240
242
  mobileSidebar: {
241
- sections: Oe,
242
- header: /* @__PURE__ */ l(d, { environment: J }),
243
+ sections: Me,
244
+ header: /* @__PURE__ */ l(f, { environment: J }),
243
245
  search: $,
244
- footer: Ae,
246
+ footer: Pe,
245
247
  isCollapsed: !1,
246
248
  hideCollapseToggle: !0,
247
249
  navigationAriaLabel: v("sidebar.navigationAriaLabel")
248
250
  },
249
- topbar: { breadcrumb: /* @__PURE__ */ l("div", { ref: Se }) },
251
+ topbar: { breadcrumb: /* @__PURE__ */ l("div", { ref: Ce }) },
250
252
  contentScrollMode: "contained",
251
253
  children: /* @__PURE__ */ l(te, {
252
254
  permissions: m,
253
255
  children: /* @__PURE__ */ l(n, {
254
256
  value: {
255
- target: P,
257
+ target: N,
256
258
  dashboardHref: C,
257
259
  dashboardLabel: v("sidebar.items.dashboard")
258
260
  },
@@ -1 +1 @@
1
- {"version":3,"file":"BackofficeLayoutPage.js","names":[],"sources":["../../../src/pages/BackofficeLayoutPage.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type JSX,\n type ReactNode,\n useCallback,\n useContext,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n commitMutation,\n usePreloadedQuery,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n GraphQLTaggedNode,\n MutationParameters,\n OperationType,\n} from 'relay-runtime';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\n\nimport { AdminShellLayout } from '@plumile/ui/admin/templates/admin_shell_layout/AdminShellLayout.js';\nimport { ToastProvider } from '@plumile/ui/atomic/molecules/toast/ToastProvider.js';\nimport { EnvironmentBadge } from '@plumile/ui/backoffice/atoms/environment_badge/EnvironmentBadge.js';\nimport { GlobalSearchInput } from '@plumile/ui/backoffice/molecules/global_search_input/GlobalSearchInput.js';\nimport { BackofficeSidebarProfileMenu } from '@plumile/ui/backoffice/molecules/sidebar_profile_menu/BackofficeSidebarProfileMenu.js';\n\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { LogoutResponse, LogoutVariables } from '../hooks/useAuth.js';\nimport { useBackofficeSidebarPins } from '../hooks/useBackofficeSidebarPins.js';\nimport { useSidebarGroupCollapse } from '../hooks/useSidebarGroupCollapse.js';\nimport { buildSidebarSections } from '../components/backoffice/layout/buildSidebarSections.js';\nimport { BackofficeContentBoundary } from '../components/backoffice/routing/BackofficeContentBoundary.js';\nimport {\n resolveActiveEntityId,\n resolveSidebarGroups,\n resolveVisibleEntityIds,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport { BackofficeTopbarPortalContextProvider } from '../components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js';\nimport { BackofficePermissionsProvider } from '../components/backoffice/layout/BackofficePermissionsContext.js';\nimport {\n mapViewerToSidebarProfileView,\n type BackofficeViewerIdentity,\n} from '../components/backoffice/layout/mapViewerToSidebarProfileView.js';\nimport { resetRelayStore } from '../relay/environment.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { getBackofficeLoginPath } from '../router/backofficeAuthPaths.js';\nimport type { BackofficeSidebarRecentItem } from '../provider/types.js';\n\nexport type BackofficeLayoutPageProps = {\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\ntype LayoutShellProps = {\n children: ReactNode;\n permissions: unknown;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst DEFAULT_RECENT_ITEMS_STORAGE_KEY = 'plumile:backoffice:recent-items';\nconst DEFAULT_SIDEBAR_PREFS_STORAGE_KEY = 'plumile:backoffice:sidebar';\n\nconst readRecentItems = (\n storageKey: string,\n): readonly BackofficeSidebarRecentItem[] => {\n if (typeof window === 'undefined') {\n return [];\n }\n try {\n const raw = window.localStorage.getItem(storageKey);\n if (raw == null) {\n return [];\n }\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed)) {\n return [];\n }\n return parsed.filter((item): item is BackofficeSidebarRecentItem => {\n if (item == null || typeof item !== 'object') {\n return false;\n }\n const candidate = item as Partial<BackofficeSidebarRecentItem>;\n return (\n (candidate.kind === 'entity' || candidate.kind === 'tool') &&\n typeof candidate.id === 'string' &&\n typeof candidate.label === 'string' &&\n typeof candidate.href === 'string' &&\n typeof candidate.visitedAt === 'number'\n );\n });\n } catch {\n return [];\n }\n};\n\nconst writeRecentItems = (\n storageKey: string,\n items: readonly BackofficeSidebarRecentItem[],\n): void => {\n if (typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(storageKey, JSON.stringify(items));\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n};\n\nconst BackofficeLayoutShell = ({\n children,\n permissions,\n authStatus,\n activeGroupId,\n}: LayoutShellProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { pathname } = useLocation();\n const routing = useContext(RoutingContext);\n const relayEnvironment = useRelayEnvironment();\n const {\n auth: authConfig,\n basePath,\n dashboards,\n entities,\n sidebar,\n } = useBackofficeConfig();\n const [sidebarQuery, setSidebarQuery] = useState('');\n const sidebarPreferencesStorageKey =\n sidebar?.preferences?.storageKey ?? DEFAULT_SIDEBAR_PREFS_STORAGE_KEY;\n const persistSidebarCollapsed =\n sidebar?.preferences?.persistCollapsed === true;\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return false;\n }\n try {\n return (\n window.localStorage.getItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n ) === 'true'\n );\n } catch {\n return false;\n }\n });\n const [isSigningOut, setIsSigningOut] = useState(false);\n const [topbarTarget, setTopbarTarget] = useState<HTMLDivElement | null>(null);\n const recentItemsConfig = sidebar?.recentItems;\n const recentItemsEnabled = recentItemsConfig?.enabled === true;\n const recentItemsStorageKey =\n recentItemsConfig?.storageKey ?? DEFAULT_RECENT_ITEMS_STORAGE_KEY;\n const recentItemsMaxItems = recentItemsConfig?.maxItems ?? 8;\n const [recentItems, setRecentItems] = useState<\n readonly BackofficeSidebarRecentItem[]\n >(() => {\n if (!recentItemsEnabled) {\n return [];\n }\n return readRecentItems(recentItemsStorageKey);\n });\n\n useEffect(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n String(isSidebarCollapsed),\n );\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n }, [\n isSidebarCollapsed,\n persistSidebarCollapsed,\n sidebarPreferencesStorageKey,\n ]);\n\n const groups = useMemo(() => {\n return resolveSidebarGroups(entities, sidebar);\n }, [entities, sidebar]);\n\n const groupIds = useMemo(() => {\n return Object.keys(groups);\n }, [groups]);\n\n const defaultCollapsedByGroupId = useMemo(() => {\n return Object.fromEntries(\n Object.entries(groups).map(([groupId, group]) => {\n return [groupId, group.behavior?.defaultCollapsed ?? true];\n }),\n );\n }, [groups]);\n\n const visibleEntityIds = useMemo(() => {\n return resolveVisibleEntityIds(groups, entities, sidebar, permissions);\n }, [entities, groups, permissions, sidebar]);\n\n const activeEntityId = useMemo(() => {\n return resolveActiveEntityId(pathname, entities);\n }, [entities, pathname]);\n\n useEffect(() => {\n if (!recentItemsEnabled || activeEntityId == null) {\n return;\n }\n const config = entities[activeEntityId];\n if (config == null) {\n return;\n }\n if (config.kind !== 'tool' && !config.hasList) {\n return;\n }\n const href = config.routes.list;\n let kind: BackofficeSidebarRecentItem['kind'] = 'entity';\n if (config.kind === 'tool') {\n kind = 'tool';\n }\n const item: BackofficeSidebarRecentItem = {\n kind,\n id: activeEntityId,\n label: config.label(tApp),\n href,\n visitedAt: Date.now(),\n };\n setRecentItems((prev) => {\n const next = [\n item,\n ...prev.filter((entry) => {\n return entry.id !== item.id || entry.kind !== item.kind;\n }),\n ].slice(0, recentItemsMaxItems);\n writeRecentItems(recentItemsStorageKey, next);\n return next;\n });\n }, [\n activeEntityId,\n entities,\n recentItemsEnabled,\n recentItemsMaxItems,\n recentItemsStorageKey,\n tApp,\n ]);\n\n const {\n pins,\n toggle: togglePin,\n reorder: reorderPin,\n } = useBackofficeSidebarPins({\n enabled: sidebar?.pinnedItems?.enabled === true,\n storageKey: sidebar?.pinnedItems?.storageKey,\n visibleEntityIds,\n });\n\n let groupCollapseStorageKey: string | undefined;\n if (sidebar?.preferences?.storageKey != null) {\n groupCollapseStorageKey = `${sidebar.preferences.storageKey}:groups`;\n }\n\n const { collapsedByGroupId, setCollapsed } = useSidebarGroupCollapse({\n groupIds,\n activeGroupId,\n defaultCollapsedByGroupId,\n persist: sidebar?.preferences?.persistGroups === true,\n storageKey: groupCollapseStorageKey,\n });\n\n const sections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: pins,\n recentItems,\n onTogglePin: togglePin,\n onReorderPin: reorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n pins,\n recentItems,\n reorderPin,\n setCollapsed,\n sidebar,\n sidebarQuery,\n t,\n tApp,\n togglePin,\n ]);\n\n const mobileSections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: pins,\n recentItems,\n onTogglePin: togglePin,\n onReorderPin: reorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n pins,\n recentItems,\n reorderPin,\n setCollapsed,\n sidebar,\n sidebarQuery,\n t,\n tApp,\n togglePin,\n ]);\n\n const environment = useMemo(() => {\n const meta = import.meta as unknown as { env?: Record<string, unknown> };\n if (meta.env?.DEV === true) {\n return 'dev' as const;\n }\n return 'prod' as const;\n }, []);\n\n const handleSignOut = useCallback(() => {\n if (isSigningOut) {\n return;\n }\n\n type LogoutMutation = MutationParameters & {\n response: LogoutResponse;\n variables: LogoutVariables;\n };\n\n setIsSigningOut(true);\n\n const runSignOut = async (): Promise<void> => {\n try {\n const config = await authConfig.logout.load();\n await new Promise<void>((resolve, reject) => {\n commitMutation<LogoutMutation>(relayEnvironment, {\n mutation: config.logoutMutation,\n variables: {},\n onCompleted: () => {\n resolve();\n },\n onError: (error) => {\n reject(error);\n },\n });\n });\n localStorage.removeItem('auth_token');\n localStorage.removeItem('remember_me');\n resetRelayStore();\n routing?.history.push({ pathname: getBackofficeLoginPath(basePath) });\n } finally {\n setIsSigningOut(false);\n }\n };\n\n runSignOut().catch(() => {\n /* noop */\n });\n }, [authConfig.logout, basePath, isSigningOut, relayEnvironment, routing]);\n\n const viewer = authStatus?.me ?? null;\n const sidebarProfile = useMemo(() => {\n return mapViewerToSidebarProfileView({\n viewer,\n unknownUserLabel: t('sidebar.profile.unknownUser'),\n });\n }, [t, viewer]);\n\n const sidebarFooter = (\n <BackofficeSidebarProfileMenu\n collapsed={false}\n viewer={sidebarProfile}\n labels={{\n sectionTitle: t('sidebar.profile.title'),\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n signOut: t('sidebar.profile.actions.signOut'),\n }}\n onSignOut={handleSignOut}\n isSigningOut={isSigningOut}\n />\n );\n\n const mobileSidebarFooter = (\n <BackofficeSidebarProfileMenu\n collapsed={false}\n viewer={sidebarProfile}\n labels={{\n sectionTitle: t('sidebar.profile.title'),\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n signOut: t('sidebar.profile.actions.signOut'),\n }}\n onSignOut={handleSignOut}\n isSigningOut={isSigningOut}\n />\n );\n\n let contentNode: JSX.Element | null = null;\n if (topbarTarget != null) {\n contentNode = (\n <BackofficeContentBoundary>{children}</BackofficeContentBoundary>\n );\n }\n\n const sidebarSearchNode = (\n <GlobalSearchInput\n value={sidebarQuery}\n onChange={setSidebarQuery}\n placeholder={t('sidebar.search.placeholder')}\n ariaLabel={t('sidebar.search.placeholder')}\n />\n );\n\n return (\n <ToastProvider>\n <AdminShellLayout\n sidebar={{\n sections,\n header: <EnvironmentBadge environment={environment} />,\n search: sidebarSearchNode,\n footer: sidebarFooter,\n isCollapsed: isSidebarCollapsed,\n onCollapsedChange: setIsSidebarCollapsed,\n collapseToggleLabel: t('sidebar.actions.collapseSidebar'),\n expandToggleLabel: t('sidebar.actions.expandSidebar'),\n navigationAriaLabel: t('sidebar.navigationAriaLabel'),\n }}\n mobileSidebar={{\n sections: mobileSections,\n header: <EnvironmentBadge environment={environment} />,\n search: sidebarSearchNode,\n footer: mobileSidebarFooter,\n isCollapsed: false,\n hideCollapseToggle: true,\n navigationAriaLabel: t('sidebar.navigationAriaLabel'),\n }}\n topbar={{\n breadcrumb: <div ref={setTopbarTarget} />,\n }}\n contentScrollMode=\"contained\"\n >\n <BackofficePermissionsProvider permissions={permissions}>\n <BackofficeTopbarPortalContextProvider\n value={{\n target: topbarTarget,\n dashboardHref: basePath,\n dashboardLabel: t('sidebar.items.dashboard'),\n }}\n >\n {contentNode}\n </BackofficeTopbarPortalContextProvider>\n </BackofficePermissionsProvider>\n </AdminShellLayout>\n </ToastProvider>\n );\n};\n\ntype LayoutWithPermissionsProps = {\n children: ReactNode;\n permissionsQuery: GraphQLTaggedNode;\n prepared: PreloadedQuery<OperationType>;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst LayoutWithPermissions = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: LayoutWithPermissionsProps): JSX.Element => {\n const permissions = usePreloadedQuery(permissionsQuery, prepared);\n\n return (\n <BackofficeLayoutShell\n permissions={permissions}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport const BackofficeLayoutPage = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: BackofficeLayoutPageProps): JSX.Element => {\n if (permissionsQuery != null && prepared != null) {\n return (\n <LayoutWithPermissions\n permissionsQuery={permissionsQuery}\n prepared={prepared}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </LayoutWithPermissions>\n );\n }\n\n return (\n <BackofficeLayoutShell\n permissions={null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport default BackofficeLayoutPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,IAAM,KAAmC,mCACnC,IAAoC,8BAEpC,MACJ,MAC2C;CAC3C,IAAI,OAAO,SAAW,KACpB,OAAO,EAAE;CAEX,IAAI;EACF,IAAM,IAAM,OAAO,aAAa,QAAQ,EAAW;EACnD,IAAI,KAAO,MACT,OAAO,EAAE;EAEX,IAAM,IAAS,KAAK,MAAM,EAAI;EAI9B,OAHK,MAAM,QAAQ,EAAO,GAGnB,EAAO,QAAQ,MAA8C;GAClE,IAAoB,OAAO,KAAS,aAAhC,GACF,OAAO;GAET,IAAM,IAAY;GAClB,QACG,EAAU,SAAS,YAAY,EAAU,SAAS,WACnD,OAAO,EAAU,MAAO,YACxB,OAAO,EAAU,SAAU,YAC3B,OAAO,EAAU,QAAS,YAC1B,OAAO,EAAU,aAAc;IAEjC,GAdO,EAAE;SAeL;EACN,OAAO,EAAE;;GAIP,MACJ,GACA,MACS;CACL,aAAO,SAAW,MAGtB,IAAI;EACF,OAAO,aAAa,QAAQ,GAAY,KAAK,UAAU,EAAM,CAAC;SACxD;GAKJ,KAAyB,EAC7B,aACA,gBACA,eACA,uBACmC;CACnC,IAAM,EAAE,GAAG,MAAS,IAAgB,EAC9B,EAAE,SAAM,GAA+B,EACvC,EAAE,gBAAa,IAAa,EAC5B,IAAU,GAAW,GA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AA4B,aAAqC,CAAA;CAIrE,IAAM,IACJ,kBAAC,IAAD;EACE,OAAO;EACP,UAAU;EACV,aAAa,EAAE,6BAA6B;EAC5C,WAAW,EAAE,6BAA6B;EAC1C,CAAA;CAGJ,OACE,kBAAC,IAAD,EAAA,UACE,kBAAC,IAAD;EACE,SAAS;GACP;GACA,QAAQ,kBAAC,GAAD,EAA+B,gBAAe,CAAA;GACtD,QAAQ;GACR,QAAQ;GACR,aAAa;GACb,mBAAmB;GACnB,qBAAqB,EAAE,kCAAkC;GACzD,mBAAmB,EAAE,gCAAgC;GACrD,qBAAqB,EAAE,8BAA8B;GACtD;EACD,eAAe;GACb,UAAU;GACV,QAAQ,kBAAC,GAAD,EAA+B,gBAAe,CAAA;GACtD,QAAQ;GACR,QAAQ;GACR,aAAa;GACb,oBAAoB;GACpB,qBAAqB,EAAE,8BAA8B;GACtD;EACD,QAAQ,EACN,YAAY,kBAAC,OAAD,EAAK,KAAK,IAAmB,CAAA,EAC1C;EACD,mBAAkB;YAElB,kBAAC,IAAD;GAA4C;aAC1C,kBAAC,GAAD;IACE,OAAO;KACL,QAAQ;KACR,eAAe;KACf,gBAAgB,EAAE,0BAA0B;KAC7C;cAEA;IACqC,CAAA;GACV,CAAA;EACf,CAAA,EACL,CAAA;GAed,KAAyB,EAC7B,aACA,qBACA,aACA,eACA,uBAKE,kBAAC,GAAD;CACe,aAJG,EAAkB,GAAkB,EAIvC;CACD;CACG;CAEd;CACqB,CAAA,EAIf,KAAwB,EACnC,aACA,qBACA,aACA,eACA,uBAEI,KAAoB,QAAQ,KAAY,OAExC,kBAAC,GAAD;CACoB;CACR;CACE;CACG;CAEd;CACqB,CAAA,GAK1B,kBAAC,GAAD;CACE,aAAa;CACD;CACG;CAEd;CACqB,CAAA"}
1
+ {"version":3,"file":"BackofficeLayoutPage.js","names":[],"sources":["../../../src/pages/BackofficeLayoutPage.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type JSX,\n type ReactNode,\n useCallback,\n useContext,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n commitMutation,\n usePreloadedQuery,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n GraphQLTaggedNode,\n MutationParameters,\n OperationType,\n} from 'relay-runtime';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\n\nimport { AdminShellLayout } from '@plumile/ui/admin/templates/admin_shell_layout/AdminShellLayout.js';\nimport { ToastProvider } from '@plumile/ui/atomic/molecules/toast/ToastProvider.js';\nimport { EnvironmentBadge } from '@plumile/ui/backoffice/atoms/environment_badge/EnvironmentBadge.js';\nimport { GlobalSearchInput } from '@plumile/ui/backoffice/molecules/global_search_input/GlobalSearchInput.js';\nimport { SidebarProfileMenu } from '@plumile/ui/components/navigation/sidebar/SidebarProfileMenu.js';\n\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { LogoutResponse, LogoutVariables } from '../hooks/useAuth.js';\nimport { useBackofficeSidebarPins } from '../hooks/useBackofficeSidebarPins.js';\nimport { useSidebarGroupCollapse } from '../hooks/useSidebarGroupCollapse.js';\nimport { buildSidebarSections } from '../components/backoffice/layout/buildSidebarSections.js';\nimport { BackofficeContentBoundary } from '../components/backoffice/routing/BackofficeContentBoundary.js';\nimport {\n resolveActiveEntityId,\n resolveSidebarGroups,\n resolveVisibleEntityIds,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport { BackofficeTopbarPortalContextProvider } from '../components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js';\nimport { BackofficePermissionsProvider } from '../components/backoffice/layout/BackofficePermissionsContext.js';\nimport {\n mapViewerToSidebarProfileView,\n type BackofficeViewerIdentity,\n} from '../components/backoffice/layout/mapViewerToSidebarProfileView.js';\nimport { resetRelayStore } from '../relay/environment.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { getBackofficeLoginPath } from '../router/backofficeAuthPaths.js';\nimport type { BackofficeSidebarRecentItem } from '../provider/types.js';\n\nexport type BackofficeLayoutPageProps = {\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\ntype LayoutShellProps = {\n children: ReactNode;\n permissions: unknown;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst DEFAULT_RECENT_ITEMS_STORAGE_KEY = 'plumile:backoffice:recent-items';\nconst DEFAULT_SIDEBAR_PREFS_STORAGE_KEY = 'plumile:backoffice:sidebar';\n\nconst readRecentItems = (\n storageKey: string,\n): readonly BackofficeSidebarRecentItem[] => {\n if (typeof window === 'undefined') {\n return [];\n }\n try {\n const raw = window.localStorage.getItem(storageKey);\n if (raw == null) {\n return [];\n }\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed)) {\n return [];\n }\n return parsed.filter((item): item is BackofficeSidebarRecentItem => {\n if (item == null || typeof item !== 'object') {\n return false;\n }\n const candidate = item as Partial<BackofficeSidebarRecentItem>;\n return (\n (candidate.kind === 'entity' || candidate.kind === 'tool') &&\n typeof candidate.id === 'string' &&\n typeof candidate.label === 'string' &&\n typeof candidate.href === 'string' &&\n typeof candidate.visitedAt === 'number'\n );\n });\n } catch {\n return [];\n }\n};\n\nconst writeRecentItems = (\n storageKey: string,\n items: readonly BackofficeSidebarRecentItem[],\n): void => {\n if (typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(storageKey, JSON.stringify(items));\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n};\n\nconst BackofficeLayoutShell = ({\n children,\n permissions,\n authStatus,\n activeGroupId,\n}: LayoutShellProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { pathname } = useLocation();\n const routing = useContext(RoutingContext);\n const relayEnvironment = useRelayEnvironment();\n const {\n auth: authConfig,\n basePath,\n dashboards,\n entities,\n sidebar,\n } = useBackofficeConfig();\n const [sidebarQuery, setSidebarQuery] = useState('');\n const sidebarPreferencesStorageKey =\n sidebar?.preferences?.storageKey ?? DEFAULT_SIDEBAR_PREFS_STORAGE_KEY;\n const persistSidebarCollapsed =\n sidebar?.preferences?.persistCollapsed === true;\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return false;\n }\n try {\n return (\n window.localStorage.getItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n ) === 'true'\n );\n } catch {\n return false;\n }\n });\n const [isSigningOut, setIsSigningOut] = useState(false);\n const [topbarTarget, setTopbarTarget] = useState<HTMLDivElement | null>(null);\n const recentItemsConfig = sidebar?.recentItems;\n const recentItemsEnabled = recentItemsConfig?.enabled === true;\n const recentItemsStorageKey =\n recentItemsConfig?.storageKey ?? DEFAULT_RECENT_ITEMS_STORAGE_KEY;\n const recentItemsMaxItems = recentItemsConfig?.maxItems ?? 8;\n const [recentItems, setRecentItems] = useState<\n readonly BackofficeSidebarRecentItem[]\n >(() => {\n if (!recentItemsEnabled) {\n return [];\n }\n return readRecentItems(recentItemsStorageKey);\n });\n\n useEffect(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n String(isSidebarCollapsed),\n );\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n }, [\n isSidebarCollapsed,\n persistSidebarCollapsed,\n sidebarPreferencesStorageKey,\n ]);\n\n const groups = useMemo(() => {\n return resolveSidebarGroups(entities, sidebar);\n }, [entities, sidebar]);\n\n const groupIds = useMemo(() => {\n return Object.keys(groups);\n }, [groups]);\n\n const defaultCollapsedByGroupId = useMemo(() => {\n return Object.fromEntries(\n Object.entries(groups).map(([groupId, group]) => {\n return [groupId, group.behavior?.defaultCollapsed ?? true];\n }),\n );\n }, [groups]);\n\n const visibleEntityIds = useMemo(() => {\n return resolveVisibleEntityIds(groups, entities, sidebar, permissions);\n }, [entities, groups, permissions, sidebar]);\n\n const activeEntityId = useMemo(() => {\n return resolveActiveEntityId(pathname, entities);\n }, [entities, pathname]);\n\n useEffect(() => {\n if (!recentItemsEnabled || activeEntityId == null) {\n return;\n }\n const config = entities[activeEntityId];\n if (config == null) {\n return;\n }\n if (config.kind !== 'tool' && !config.hasList) {\n return;\n }\n const href = config.routes.list;\n let kind: BackofficeSidebarRecentItem['kind'] = 'entity';\n if (config.kind === 'tool') {\n kind = 'tool';\n }\n const item: BackofficeSidebarRecentItem = {\n kind,\n id: activeEntityId,\n label: config.label(tApp),\n href,\n visitedAt: Date.now(),\n };\n setRecentItems((prev) => {\n const next = [\n item,\n ...prev.filter((entry) => {\n return entry.id !== item.id || entry.kind !== item.kind;\n }),\n ].slice(0, recentItemsMaxItems);\n writeRecentItems(recentItemsStorageKey, next);\n return next;\n });\n }, [\n activeEntityId,\n entities,\n recentItemsEnabled,\n recentItemsMaxItems,\n recentItemsStorageKey,\n tApp,\n ]);\n\n const pinningEnabled = sidebar?.pinnedItems?.enabled === true;\n\n const {\n pins,\n toggle: togglePin,\n reorder: reorderPin,\n } = useBackofficeSidebarPins({\n enabled: pinningEnabled,\n storageKey: sidebar?.pinnedItems?.storageKey,\n visibleEntityIds,\n });\n\n let sidebarPinnedEntityIds: readonly string[] | undefined;\n let sidebarTogglePin: ((entityId: string) => void) | undefined;\n let sidebarReorderPin: ((fromId: string, toId: string) => void) | undefined;\n if (pinningEnabled) {\n sidebarPinnedEntityIds = pins;\n sidebarTogglePin = togglePin;\n sidebarReorderPin = reorderPin;\n }\n\n let groupCollapseStorageKey: string | undefined;\n if (sidebar?.preferences?.storageKey != null) {\n groupCollapseStorageKey = `${sidebar.preferences.storageKey}:groups`;\n }\n\n const { collapsedByGroupId, setCollapsed } = useSidebarGroupCollapse({\n groupIds,\n activeGroupId,\n defaultCollapsedByGroupId,\n persist: sidebar?.preferences?.persistGroups === true,\n storageKey: groupCollapseStorageKey,\n });\n\n const sections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const mobileSections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const environment = useMemo(() => {\n const meta = import.meta as unknown as { env?: Record<string, unknown> };\n if (meta.env?.DEV === true) {\n return 'dev' as const;\n }\n return 'prod' as const;\n }, []);\n\n const handleSignOut = useCallback(() => {\n if (isSigningOut) {\n return;\n }\n\n type LogoutMutation = MutationParameters & {\n response: LogoutResponse;\n variables: LogoutVariables;\n };\n\n setIsSigningOut(true);\n\n const runSignOut = async (): Promise<void> => {\n try {\n const config = await authConfig.logout.load();\n await new Promise<void>((resolve, reject) => {\n commitMutation<LogoutMutation>(relayEnvironment, {\n mutation: config.logoutMutation,\n variables: {},\n onCompleted: () => {\n resolve();\n },\n onError: (error) => {\n reject(error);\n },\n });\n });\n localStorage.removeItem('auth_token');\n localStorage.removeItem('remember_me');\n resetRelayStore();\n routing?.history.push({ pathname: getBackofficeLoginPath(basePath) });\n } finally {\n setIsSigningOut(false);\n }\n };\n\n runSignOut().catch(() => {\n /* noop */\n });\n }, [authConfig.logout, basePath, isSigningOut, relayEnvironment, routing]);\n\n const viewer = authStatus?.me ?? null;\n const sidebarProfile = useMemo(() => {\n return mapViewerToSidebarProfileView({\n viewer,\n unknownUserLabel: t('sidebar.profile.unknownUser'),\n });\n }, [t, viewer]);\n\n const sidebarFooter = (\n <SidebarProfileMenu\n collapsed={false}\n viewer={sidebarProfile}\n labels={{\n sectionTitle: t('sidebar.profile.title'),\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n signOut: t('sidebar.profile.actions.signOut'),\n }}\n onSignOut={handleSignOut}\n isSigningOut={isSigningOut}\n />\n );\n\n const mobileSidebarFooter = (\n <SidebarProfileMenu\n collapsed={false}\n viewer={sidebarProfile}\n labels={{\n sectionTitle: t('sidebar.profile.title'),\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n signOut: t('sidebar.profile.actions.signOut'),\n }}\n onSignOut={handleSignOut}\n isSigningOut={isSigningOut}\n />\n );\n\n let contentNode: JSX.Element | null = null;\n if (topbarTarget != null) {\n contentNode = (\n <BackofficeContentBoundary>{children}</BackofficeContentBoundary>\n );\n }\n\n const sidebarSearchNode = (\n <GlobalSearchInput\n value={sidebarQuery}\n onChange={setSidebarQuery}\n placeholder={t('sidebar.search.placeholder')}\n ariaLabel={t('sidebar.search.placeholder')}\n />\n );\n\n return (\n <ToastProvider>\n <AdminShellLayout\n sidebar={{\n sections,\n header: <EnvironmentBadge environment={environment} />,\n search: sidebarSearchNode,\n footer: sidebarFooter,\n isCollapsed: isSidebarCollapsed,\n onCollapsedChange: setIsSidebarCollapsed,\n collapseToggleLabel: t('sidebar.actions.collapseSidebar'),\n expandToggleLabel: t('sidebar.actions.expandSidebar'),\n navigationAriaLabel: t('sidebar.navigationAriaLabel'),\n }}\n mobileSidebar={{\n sections: mobileSections,\n header: <EnvironmentBadge environment={environment} />,\n search: sidebarSearchNode,\n footer: mobileSidebarFooter,\n isCollapsed: false,\n hideCollapseToggle: true,\n navigationAriaLabel: t('sidebar.navigationAriaLabel'),\n }}\n topbar={{\n breadcrumb: <div ref={setTopbarTarget} />,\n }}\n contentScrollMode=\"contained\"\n >\n <BackofficePermissionsProvider permissions={permissions}>\n <BackofficeTopbarPortalContextProvider\n value={{\n target: topbarTarget,\n dashboardHref: basePath,\n dashboardLabel: t('sidebar.items.dashboard'),\n }}\n >\n {contentNode}\n </BackofficeTopbarPortalContextProvider>\n </BackofficePermissionsProvider>\n </AdminShellLayout>\n </ToastProvider>\n );\n};\n\ntype LayoutWithPermissionsProps = {\n children: ReactNode;\n permissionsQuery: GraphQLTaggedNode;\n prepared: PreloadedQuery<OperationType>;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst LayoutWithPermissions = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: LayoutWithPermissionsProps): JSX.Element => {\n const permissions = usePreloadedQuery(permissionsQuery, prepared);\n\n return (\n <BackofficeLayoutShell\n permissions={permissions}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport const BackofficeLayoutPage = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: BackofficeLayoutPageProps): JSX.Element => {\n if (permissionsQuery != null && prepared != null) {\n return (\n <LayoutWithPermissions\n permissionsQuery={permissionsQuery}\n prepared={prepared}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </LayoutWithPermissions>\n );\n }\n\n return (\n <BackofficeLayoutShell\n permissions={null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport default BackofficeLayoutPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,IAAM,KAAmC,mCACnC,KAAoC,8BAEpC,MACJ,MAC2C;CAC3C,IAAI,OAAO,SAAW,KACpB,OAAO,EAAE;CAEX,IAAI;EACF,IAAM,IAAM,OAAO,aAAa,QAAQ,EAAW;EACnD,IAAI,KAAO,MACT,OAAO,EAAE;EAEX,IAAM,IAAS,KAAK,MAAM,EAAI;EAI9B,OAHK,MAAM,QAAQ,EAAO,GAGnB,EAAO,QAAQ,MAA8C;GAClE,IAAoB,OAAO,KAAS,aAAhC,GACF,OAAO;GAET,IAAM,IAAY;GAClB,QACG,EAAU,SAAS,YAAY,EAAU,SAAS,WACnD,OAAO,EAAU,MAAO,YACxB,OAAO,EAAU,SAAU,YAC3B,OAAO,EAAU,QAAS,YAC1B,OAAO,EAAU,aAAc;IAEjC,GAdO,EAAE;SAeL;EACN,OAAO,EAAE;;GAIP,MACJ,GACA,MACS;CACL,aAAO,SAAW,MAGtB,IAAI;EACF,OAAO,aAAa,QAAQ,GAAY,KAAK,UAAU,EAAM,CAAC;SACxD;GAKJ,KAAyB,EAC7B,aACA,gBACA,eACA,uBACmC;CACnC,IAAM,EAAE,GAAG,MAAS,IAAgB,EAC9B,EAAE,SAAM,GAA+B,EACvC,EAAE,gBAAa,IAAa,EAC5B,IAAU,GAAW,GAAe,EACpC,IAAmB,IAAqB,EACxC,EACJ,MAAM,GACN,aACA,eACA,aACA,eACE,GAAqB,EACnB,CAAC,GAAc,MAAmB,EAAS,GAAG,EAC9C,IACJ,GAAS,aAAa,cAAc,IAChC,IACJ,GAAS,aAAa,qBAAqB,IACvC,CAAC,GAAoB,MAAyB,QAAe;EACjE,IAAI,CAAC,KAA2B,OAA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AO,MAAM,EAAK;GACzB;GACA,WAAW,KAAK,KAAK;GACtB;EACD,IAAgB,MAAS;GACvB,IAAM,IAAO,CACX,GACA,GAAG,EAAK,QAAQ,MACP,EAAM,OAAO,EAAK,MAAM,EAAM,SAAS,EAAK,KACnD,CACH,CAAC,MAAM,GAAG,EAAoB;GAE/B,OADA,GAAiB,GAAuB,EAAK,EACtC;IACP;IACD;EACD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,IAAM,IAAiB,GAAS,aAAa,YAAY,IAEnD,EACJ,UACA,QAAQ,IACR,SAAS,OACP,GAAyB;EAC3B,SAAS;EACT,YAAY,GAAS,aAAa;EAClC;EACD,CAAC,EAEE,GACA,GACA;CACJ,AAAI,MACF,IAAyB,IACzB,IAAmB,IACnB,IAAoB;CAGtB,IAAI;CACJ,AAAI,GAAS,aAAa,cAAc,SACtC,IAA0B,GAAG,EAAQ,YAAY,WAAW;CAG9D,IAAM,EAAE,uBAAoB,oBAAiB,GAAwB;EACnE;EACA;EACA;EACA,SAAS,GAAS,aAAa,kBAAkB;EACjD,YAAY;EACb,CAAC,EAEI,KAAW,QACR,EAAqB;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;EACb;EACA;EACA,iBAAiB;EACjB;EACA,aAAa;EACb,cAAc;EACd;EACA,wBAAwB;EACxB,kBAAkB;EACnB,CAAC,EACD;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,EAEI,KAAiB,QACd,EAAqB;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;EACb;EACA;EACA,iBAAiB;EACjB;EACA,aAAa;EACb,cAAc;EACd;EACA,wBAAwB;EACxB,kBAAkB;EACnB,CAAC,EACD;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,EAEI,IAAc,QAEd,OADgB,KACX,KAAK,QAAQ,KACb,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,kBAAC,IAAD,EAAA,UACE,kBAAC,GAAD;EACE,SAAS;GACP;GACA,QAAQ,kBAAC,GAAD,EAA+B,gBAAe,CAAA;GACtD,QAAQ;GACR,QAAQ;GACR,aAAa;GACb,mBAAmB;GACnB,qBAAqB,EAAE,kCAAkC;GACzD,mBAAmB,EAAE,gCAAgC;GACrD,qBAAqB,EAAE,8BAA8B;GACtD;EACD,eAAe;GACb,UAAU;GACV,QAAQ,kBAAC,GAAD,EAA+B,gBAAe,CAAA;GACtD,QAAQ;GACR,QAAQ;GACR,aAAa;GACb,oBAAoB;GACpB,qBAAqB,EAAE,8BAA8B;GACtD;EACD,QAAQ,EACN,YAAY,kBAAC,OAAD,EAAK,KAAK,IAAmB,CAAA,EAC1C;EACD,mBAAkB;YAElB,kBAAC,IAAD;GAA4C;aAC1C,kBAAC,GAAD;IACE,OAAO;KACL,QAAQ;KACR,eAAe;KACf,gBAAgB,EAAE,0BAA0B;KAC7C;cAEA;IACqC,CAAA;GACV,CAAA;EACf,CAAA,EACL,CAAA;GAed,KAAyB,EAC7B,aACA,qBACA,aACA,eACA,uBAKE,kBAAC,GAAD;CACe,aAJG,EAAkB,GAAkB,EAIvC;CACD;CACG;CAEd;CACqB,CAAA,EAIf,KAAwB,EACnC,aACA,qBACA,aACA,eACA,uBAEI,KAAoB,QAAQ,KAAY,OAExC,kBAAC,GAAD;CACoB;CACR;CACE;CACG;CAEd;CACqB,CAAA,GAK1B,kBAAC,GAAD;CACE,aAAa;CACD;CACG;CAEd;CACqB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"buildTabsItems.js","names":[],"sources":["../../../../src/pages/detail/buildTabsItems.ts"],"sourcesContent":["import type { BackofficeDetailPageRouteSpec } from '@plumile/backoffice-core/types.js';\nimport type { BackofficeTabItem } from '@plumile/ui/backoffice/molecules/backoffice_tabs/BackofficeTabs.js';\nimport type { TFunction } from 'i18next';\n\ntype DetailPage<Node> = BackofficeDetailPageRouteSpec<Node>;\n\nexport const buildTabsItems = <Node>(input: {\n pages: readonly DetailPage<Node>[];\n id: string;\n tApp: TFunction;\n detailPageHref: (id: string, pageId: string) => string;\n}): readonly BackofficeTabItem[] => {\n return input.pages.map((page) => {\n return {\n id: page.id,\n label: page.label(input.tApp),\n to: input.detailPageHref(input.id, page.id),\n };\n });\n};\n"],"mappings":";AAMA,IAAa,KAAwB,MAM5B,EAAM,MAAM,KAAK,OACf;CACL,IAAI,EAAK;CACT,OAAO,EAAK,MAAM,EAAM,KAAK;CAC7B,IAAI,EAAM,eAAe,EAAM,IAAI,EAAK,GAAG;CAC5C,EACD"}
1
+ {"version":3,"file":"buildTabsItems.js","names":[],"sources":["../../../../src/pages/detail/buildTabsItems.ts"],"sourcesContent":["import type { BackofficeDetailPageRouteSpec } from '@plumile/backoffice-core/types.js';\nimport type { TabItem } from '@plumile/ui/atomic/molecules/tabs/Tabs.js';\nimport type { TFunction } from 'i18next';\n\ntype DetailRoutePage<Node> = BackofficeDetailPageRouteSpec<Node>;\n\nexport const buildTabsItems = <Node>(input: {\n pages: readonly DetailRoutePage<Node>[];\n id: string;\n tApp: TFunction;\n detailPageHref: (id: string, pageId: string) => string;\n}): readonly TabItem[] => {\n return input.pages.map((page) => {\n return {\n id: page.id,\n label: page.label(input.tApp),\n to: input.detailPageHref(input.id, page.id),\n };\n });\n};\n"],"mappings":";AAMA,IAAa,KAAwB,MAM5B,EAAM,MAAM,KAAK,OACf;CACL,IAAI,EAAK;CACT,OAAO,EAAK,MAAM,EAAM,KAAK;CAC7B,IAAI,EAAM,eAAe,EAAM,IAAI,EAAK,GAAG;CAC5C,EACD"}
@@ -9,90 +9,90 @@ import { withBackofficeReactI18nResources as c } from "../i18n/resources.js";
9
9
  import { RelayProvider as l } from "../relay/RelayProvider.js";
10
10
  import { createBackofficeRoutes as u } from "../router/createBackofficeRoutes.js";
11
11
  import { createBackofficeEntityRegistry as d } from "./entityRegistry.js";
12
- import { StrictMode as f, useEffect as p, useMemo as m, useState as h } from "react";
13
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
- import { I18nextProvider as v } from "react-i18next";
15
- import y from "@plumile/router/routing/RoutingContext.js";
16
- import { createInstance as b } from "i18next";
17
- import x from "@plumile/router/routing/createRouter.js";
18
- import S from "@plumile/router/routing/RouterRenderer.js";
19
- import { BackofficeThemeProvider as C } from "@plumile/ui/admin/theme/BackofficeThemeProvider.js";
12
+ import { StrictMode as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
13
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
14
+ import { I18nextProvider as y } from "react-i18next";
15
+ import b from "@plumile/router/routing/RoutingContext.js";
16
+ import { createInstance as x } from "i18next";
17
+ import S from "@plumile/router/routing/createRouter.js";
18
+ import C from "@plumile/router/routing/RouterRenderer.js";
19
+ import { BackofficeThemeProvider as w } from "@plumile/ui/admin/theme/BackofficeThemeProvider.js";
20
20
  //#region src/provider/BackofficeProvider.tsx
21
- var w = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWith("/") ? e.slice(0, -1) : e : `/${e}`, T = (e, t) => {
22
- let n = w(t), r = w(e);
21
+ var T = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWith("/") ? e.slice(0, -1) : e : `/${e}`, E = (e, t) => {
22
+ let n = T(t), r = T(e);
23
23
  return r === "/" || n === r || n.startsWith(`${r}/`) ? n : n === "/" ? r : `${r}${n}`;
24
- }, E = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => [e, {
24
+ }, D = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => [e, {
25
25
  ...n,
26
26
  routes: {
27
- list: T(t, n.routes.list),
28
- detail: (e) => T(t, n.routes.detail(e)),
29
- detailPage: (e, r) => T(t, n.routes.detailPage(e, r))
27
+ list: E(t, n.routes.list),
28
+ detail: (e) => E(t, n.routes.detail(e)),
29
+ detailPage: (e, r) => E(t, n.routes.detailPage(e, r))
30
30
  }
31
- }])), D = ({ routes: e, context: t, instrumentations: n }) => {
32
- let [r, i] = h(null);
31
+ }])), O = ({ routes: e, context: t, instrumentations: n }) => {
32
+ let [r, i] = g(null), a = h(null);
33
33
  return p(() => {
34
- let r = x(e, {
34
+ let r = S(e, {
35
35
  context: t,
36
36
  instrumentations: n
37
37
  });
38
- return i(r), () => {
39
- r.cleanup();
38
+ return a.current = r, i(r), () => {
39
+ a.current === r && (a.current = null), r.cleanup();
40
40
  };
41
41
  }, [
42
42
  t,
43
43
  n,
44
44
  e
45
45
  ]), r;
46
- }, O = ({ routes: e, instrumentations: t }) => {
47
- let r = o(), a = D({
46
+ }, k = ({ routes: e, instrumentations: t }) => {
47
+ let r = o(), a = O({
48
48
  routes: e,
49
49
  context: m(() => ({ relayEnvironment: r }), [r]),
50
50
  instrumentations: t
51
51
  });
52
- return a == null ? /* @__PURE__ */ g(n, {}) : /* @__PURE__ */ g(y.Provider, {
52
+ return a == null ? /* @__PURE__ */ _(n, {}) : /* @__PURE__ */ _(b.Provider, {
53
53
  value: a.context,
54
- children: /* @__PURE__ */ g(S, {
54
+ children: /* @__PURE__ */ _(C, {
55
55
  enableTransition: !0,
56
- fallback: /* @__PURE__ */ g(n, {}),
57
- pending: /* @__PURE__ */ g(i, {})
56
+ fallback: /* @__PURE__ */ _(n, {}),
57
+ pending: /* @__PURE__ */ _(i, {})
58
58
  })
59
59
  });
60
- }, k = (n) => {
61
- let i = w(n.basePath ?? "/"), o = m(() => E(n.entityManifest, i), [i, n.entityManifest]), y = m(() => d(o, { basePath: i }), [i, o]), x = n.graphql, S = m(() => t(n.dashboards), [n.dashboards]);
60
+ }, A = (n) => {
61
+ let i = T(n.basePath ?? "/"), o = m(() => D(n.entityManifest, i), [i, n.entityManifest]), h = m(() => d(o, { basePath: i }), [i, o]), b = n.graphql, S = m(() => t(n.dashboards), [n.dashboards]);
62
62
  p(() => {
63
63
  a({
64
- httpUrl: x.httpUrl ?? x.endpoint,
65
- wsUrl: x.wsUrl ?? x.wsEndpoint,
66
- getDataId: x.getDataId,
67
- logEvents: x.logEvents,
68
- getAuthHeaders: x.getAuthHeaders
64
+ httpUrl: b.httpUrl ?? b.endpoint,
65
+ wsUrl: b.wsUrl ?? b.wsEndpoint,
66
+ getDataId: b.getDataId,
67
+ logEvents: b.logEvents,
68
+ getAuthHeaders: b.getAuthHeaders
69
69
  });
70
70
  }, [
71
- x.endpoint,
72
- x.getAuthHeaders,
73
- x.getDataId,
74
- x.httpUrl,
75
- x.logEvents,
76
- x.wsEndpoint,
77
- x.wsUrl
71
+ b.endpoint,
72
+ b.getAuthHeaders,
73
+ b.getDataId,
74
+ b.httpUrl,
75
+ b.logEvents,
76
+ b.wsEndpoint,
77
+ b.wsUrl
78
78
  ]);
79
- let T = m(() => c(n.i18n?.resources ?? {}), [n.i18n?.resources]), D = m(() => n.i18n?.instance ?? b(), [n.i18n?.instance]), [k, A] = h(D.isInitialized);
79
+ let C = m(() => c(n.i18n?.resources ?? {}), [n.i18n?.resources]), E = m(() => n.i18n?.instance ?? x(), [n.i18n?.instance]), [O, A] = g(E.isInitialized);
80
80
  p(() => {
81
81
  let e = !0, t = () => {
82
82
  e && A(!0);
83
83
  };
84
- if (D.on("initialized", t), D.isInitialized) return t(), () => {
85
- e = !1, D.off("initialized", t);
84
+ if (E.on("initialized", t), E.isInitialized) return t(), () => {
85
+ e = !1, E.off("initialized", t);
86
86
  };
87
87
  let r = globalThis.setTimeout(() => {
88
- D.isInitialized && t();
88
+ E.isInitialized && t();
89
89
  }, 0), i = n.i18n?.initOptions ?? {}, a = i.defaultNS ?? "translations", o = i.ns ?? [
90
90
  "backofficeReact",
91
91
  "translations",
92
92
  "ui"
93
93
  ];
94
94
  return s({
95
- resources: T,
95
+ resources: C,
96
96
  lng: n.i18n?.lng,
97
97
  fallbackLng: n.i18n?.fallbackLng,
98
98
  initOptions: {
@@ -104,17 +104,17 @@ var w = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
104
104
  ...i.react
105
105
  }
106
106
  },
107
- instance: D,
107
+ instance: E,
108
108
  useLanguageDetector: n.i18n?.useLanguageDetector,
109
109
  detection: n.i18n?.detection
110
110
  }).then(t).catch((e) => {
111
111
  t(), console.error(e);
112
112
  }), () => {
113
- e = !1, globalThis.clearTimeout(r), D.off("initialized", t);
113
+ e = !1, globalThis.clearTimeout(r), E.off("initialized", t);
114
114
  };
115
115
  }, [
116
- D,
117
- T,
116
+ E,
117
+ C,
118
118
  n.i18n?.initOptions,
119
119
  n.i18n?.detection,
120
120
  n.i18n?.fallbackLng,
@@ -125,7 +125,7 @@ var w = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
125
125
  basePath: i,
126
126
  entities: o,
127
127
  entityManifest: o,
128
- entityRegistry: y,
128
+ entityRegistry: h,
129
129
  filterColumnAliases: n.filterColumnAliases,
130
130
  sidebar: n.sidebar,
131
131
  dashboard: n.dashboard,
@@ -138,14 +138,14 @@ var w = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
138
138
  n.dashboard,
139
139
  S,
140
140
  o,
141
- y,
141
+ h,
142
142
  n.filterColumnAliases,
143
143
  n.graphql,
144
144
  n.sidebar
145
145
  ]), M = m(() => u({
146
146
  basePath: i,
147
147
  entityManifest: o,
148
- entityRegistry: y,
148
+ entityRegistry: h,
149
149
  sidebar: n.sidebar,
150
150
  auth: n.auth,
151
151
  dashboard: n.dashboard,
@@ -154,25 +154,25 @@ var w = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
154
154
  }), [
155
155
  i,
156
156
  o,
157
- y,
157
+ h,
158
158
  n.auth,
159
159
  n.dashboard,
160
160
  S,
161
161
  n.toolsOperationPage,
162
162
  n.sidebar
163
- ]), N = /* @__PURE__ */ g(r, { label: "Loading..." });
164
- return k && (N = /* @__PURE__ */ g(C, { children: /* @__PURE__ */ g(l, { children: /* @__PURE__ */ _(e, {
163
+ ]), N = /* @__PURE__ */ _(r, { label: "Loading..." });
164
+ return O && (N = /* @__PURE__ */ _(w, { children: /* @__PURE__ */ _(l, { children: /* @__PURE__ */ v(e, {
165
165
  value: j,
166
- children: [n.overlay, /* @__PURE__ */ g(O, {
166
+ children: [n.overlay, /* @__PURE__ */ _(k, {
167
167
  routes: M,
168
168
  instrumentations: n.instrumentations
169
169
  })]
170
- }) }) })), /* @__PURE__ */ g(f, { children: /* @__PURE__ */ g(v, {
171
- i18n: D,
170
+ }) }) })), /* @__PURE__ */ _(f, { children: /* @__PURE__ */ _(y, {
171
+ i18n: E,
172
172
  children: N
173
173
  }) });
174
174
  };
175
175
  //#endregion
176
- export { k as BackofficeProvider, k as default };
176
+ export { A as BackofficeProvider, A as default };
177
177
 
178
178
  //# sourceMappingURL=BackofficeProvider.js.map