@plumile/backoffice-react 0.1.107 → 0.1.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/auth/TotpQrCode.js +1 -1
- package/lib/esm/auth/TotpQrCode.js.map +1 -1
- package/lib/esm/auth/login/EmailCapturePanel.js +27 -23
- package/lib/esm/auth/login/EmailCapturePanel.js.map +1 -1
- package/lib/esm/auth/login/MfaChallengeForm.js +38 -36
- package/lib/esm/auth/login/MfaChallengeForm.js.map +1 -1
- package/lib/esm/auth/login/PasskeyLoginForm.js +40 -37
- package/lib/esm/auth/login/PasskeyLoginForm.js.map +1 -1
- package/lib/esm/auth/pages/AcceptInvitationScreen.js +63 -62
- package/lib/esm/auth/pages/AcceptInvitationScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js +56 -55
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js +45 -45
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js.map +1 -1
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +1 -0
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +44 -39
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeCopyButton.js +15 -0
- package/lib/esm/components/backoffice/detail/BackofficeCopyButton.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailActionBar.js +11 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailActionBar.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailBlock.js +7 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailBlock.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailHeader.js +15 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailHeader.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailPage.js +19 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailPage.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationLink.js +47 -40
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationLink.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js +83 -90
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailTable.js +8 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailTable.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeEmptyValue.js +7 -0
- package/lib/esm/components/backoffice/detail/BackofficeEmptyValue.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeStatusGroup.js +8 -0
- package/lib/esm/components/backoffice/detail/BackofficeStatusGroup.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeTechnicalFacts.js +2 -0
- package/lib/esm/components/backoffice/filters/EntityFilterValue.js +16 -8
- package/lib/esm/components/backoffice/filters/EntityFilterValue.js.map +1 -1
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js +85 -53
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js.map +1 -1
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js +2 -2
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +53 -48
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js +2 -2
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.js +15 -11
- package/lib/esm/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js +50 -23
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js.map +1 -1
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js +69 -69
- package/lib/esm/components/backoffice/layout/sidebarUtils.js +16 -16
- package/lib/esm/components/backoffice/layout/sidebarUtils.js.map +1 -1
- package/lib/esm/components/backoffice/links/BackofficeInlineLink.js +29 -0
- package/lib/esm/components/backoffice/links/BackofficeInlineLink.js.map +1 -0
- package/lib/esm/components/backoffice/links/BackofficeLink.js +21 -0
- package/lib/esm/components/backoffice/links/BackofficeLink.js.map +1 -0
- package/lib/esm/components/backoffice/links/BackofficeLinkContent.js +26 -0
- package/lib/esm/components/backoffice/links/BackofficeLinkContent.js.map +1 -0
- package/lib/esm/components/backoffice/links/BackofficeLinkLabel.js +19 -0
- package/lib/esm/components/backoffice/links/BackofficeLinkLabel.js.map +1 -0
- package/lib/esm/components/backoffice/links/backofficeLink.css.js +7 -0
- package/lib/esm/components/backoffice/links/backofficeLink.css.js.map +1 -0
- package/lib/esm/components/backoffice/links/resolveBackofficeLink.js +81 -0
- package/lib/esm/components/backoffice/links/resolveBackofficeLink.js.map +1 -0
- package/lib/esm/components/backoffice/links/resolveBackofficeTargetIcon.js +50 -0
- package/lib/esm/components/backoffice/links/resolveBackofficeTargetIcon.js.map +1 -0
- package/lib/esm/components/backoffice/links/types.js +0 -0
- package/lib/esm/components/backoffice/links/useBackofficeLink.js +21 -0
- package/lib/esm/components/backoffice/links/useBackofficeLink.js.map +1 -0
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +1 -0
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +2 -2
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js +27 -21
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js.map +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeEntityIdRef.js +27 -27
- package/lib/esm/components/backoffice/refs/BackofficeEntityIdRef.js.map +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js +24 -21
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js.map +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeRelatedCountLink.js +45 -44
- package/lib/esm/components/backoffice/refs/BackofficeRelatedCountLink.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +277 -227
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js +25 -30
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js.map +1 -1
- package/lib/esm/i18n/locales/en/backofficeReact.js +8 -0
- package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
- package/lib/esm/i18n/locales/fr/backofficeReact.js +8 -0
- package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
- package/lib/esm/index.js +88 -73
- package/lib/esm/pages/BackofficeDashboardPage.js +1 -5
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +231 -222
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +170 -54
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.js +196 -207
- package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
- package/lib/esm/pages/BackofficeHubPage.js +21 -21
- package/lib/esm/pages/BackofficeLayoutPage.js +7 -7
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/router/createBackofficeRoutes.js +132 -126
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/esm/style.css +1 -1
- package/lib/types/auth/login/EmailCapturePanel.d.ts.map +1 -1
- package/lib/types/auth/login/MfaChallengeForm.d.ts.map +1 -1
- package/lib/types/auth/login/PasskeyLoginForm.d.ts.map +1 -1
- package/lib/types/auth/pages/AcceptInvitationScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/PasswordResetCompleteScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/PasswordResetRequestScreen.d.ts.map +1 -1
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts +0 -1
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeCopyButton.d.ts +8 -0
- package/lib/types/components/backoffice/detail/BackofficeCopyButton.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailActionBar.d.ts +9 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailActionBar.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailBlock.d.ts +7 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailBlock.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailHeader.d.ts +12 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailHeader.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailPage.d.ts +16 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailPage.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailPage.stories.d.ts +11 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailPage.stories.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailRelationLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailRelationListBlock.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailTable.d.ts +6 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailTable.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeEmptyValue.d.ts +7 -0
- package/lib/types/components/backoffice/detail/BackofficeEmptyValue.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeStatusGroup.d.ts +8 -0
- package/lib/types/components/backoffice/detail/BackofficeStatusGroup.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeTechnicalFacts.d.ts +2 -0
- package/lib/types/components/backoffice/detail/BackofficeTechnicalFacts.d.ts.map +1 -0
- package/lib/types/components/backoffice/filters/EntityFilterValue.d.ts +5 -1
- package/lib/types/components/backoffice/filters/EntityFilterValue.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/EntityIdFilterField.d.ts +1 -0
- package/lib/types/components/backoffice/filters/EntityIdFilterField.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts +5 -2
- package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.d.ts +1 -0
- package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts +10 -8
- package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/types.d.ts +10 -5
- package/lib/types/components/backoffice/layout/breadcrumb/types.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/sidebarUtils.d.ts +6 -2
- package/lib/types/components/backoffice/layout/sidebarUtils.d.ts.map +1 -1
- package/lib/types/components/backoffice/links/BackofficeInlineLink.d.ts +18 -0
- package/lib/types/components/backoffice/links/BackofficeInlineLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/BackofficeLink.d.ts +13 -0
- package/lib/types/components/backoffice/links/BackofficeLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/BackofficeLinkContent.d.ts +10 -0
- package/lib/types/components/backoffice/links/BackofficeLinkContent.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/BackofficeLinkLabel.d.ts +12 -0
- package/lib/types/components/backoffice/links/BackofficeLinkLabel.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/backofficeLink.css.d.ts +4 -0
- package/lib/types/components/backoffice/links/backofficeLink.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/resolveBackofficeLink.d.ts +15 -0
- package/lib/types/components/backoffice/links/resolveBackofficeLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/resolveBackofficeTargetIcon.d.ts +8 -0
- package/lib/types/components/backoffice/links/resolveBackofficeTargetIcon.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/types.d.ts +45 -0
- package/lib/types/components/backoffice/links/types.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/useBackofficeLink.d.ts +7 -0
- package/lib/types/components/backoffice/links/useBackofficeLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/pickers/entityIdPickerDialog.css.d.ts +2 -0
- package/lib/types/components/backoffice/pickers/entityIdPickerDialog.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/pickers/shared/EntityPickerList.d.ts.map +1 -1
- package/lib/types/components/backoffice/refs/BackofficeEntityLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/refs/BackofficeRelatedCountLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
- package/lib/types/components/backoffice/shared/BackofficeFilterableCell.d.ts +6 -3
- package/lib/types/components/backoffice/shared/BackofficeFilterableCell.d.ts.map +1 -1
- package/lib/types/i18n/resources.d.ts +16 -0
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/lib/types/index.d.ts +24 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +49 -22
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
- package/lib/types/provider/types.d.ts +26 -22
- package/lib/types/provider/types.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts +36 -1
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
import { buildEntityGroupLookup as e, resolveSidebarGroups as t, resolveSidebarHubEntries as n } from "../components/backoffice/layout/sidebarUtils.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
2
|
+
import { useContext as r, useEffect as i } from "react";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
import * as o from "react-relay";
|
|
5
|
+
import { HttpRedirect as s, RoutingContext as c, getResourcePage as l, r as u } from "@plumile/router";
|
|
6
|
+
import { BACKOFFICE_LIST_DEFAULTS as d } from "@plumile/backoffice-core/constants.js";
|
|
6
7
|
//#region src/router/createBackofficeRoutes.tsx
|
|
7
|
-
var { loadQuery:
|
|
8
|
-
|
|
8
|
+
var { loadQuery: f, usePreloadedQuery: p } = o, m = l("WrapperPage", async () => ({ default: (await import("@plumile/ui")).WrapperPage })), h = l("BackofficeLayoutPage", async () => import("../pages/BackofficeLayoutPage.js")), g = l("BackofficeEntityListPage", async () => import("../pages/BackofficeEntityListPage.js")), _ = l("BackofficeEntityDetailPage", async () => import("../pages/BackofficeEntityDetailPage.js")), v = l("BackofficeEntityDetailLayoutPage", async () => import("../pages/BackofficeEntityDetailLayoutPage.js")), y = l("BackofficeEntityDetailUnknownPageRedirect", async () => import("../pages/BackofficeEntityDetailUnknownPageRedirect.js")), b = l("BackofficeDashboardPage", async () => import("../pages/BackofficeDashboardPage.js")), x = l("BackofficeHubPage", async () => import("../pages/BackofficeHubPage.js")), S = l("BackofficeLoginPage", async () => import("../pages/BackofficeLoginPage.js")), C = l("BackofficePasswordResetRequestPage", async () => import("../pages/BackofficePasswordResetRequestPage.js")), w = l("BackofficePasswordResetCompletePage", async () => import("../pages/BackofficePasswordResetCompletePage.js")), T = l("BackofficeVerifyEmailPage", async () => import("../pages/BackofficeVerifyEmailPage.js")), E = l("BackofficeAcceptInvitationPage", async () => import("../pages/BackofficeAcceptInvitationPage.js")), D = ({ loginRedirectPath: e }) => {
|
|
9
|
+
let t = r(c);
|
|
10
|
+
return i(() => {
|
|
11
|
+
t?.history.set({ pathname: e });
|
|
12
|
+
}, [e, t]), null;
|
|
13
|
+
}, O = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i }) => /* @__PURE__ */ a(t, {
|
|
14
|
+
permissionsQuery: r,
|
|
9
15
|
prepared: n?.permissionsQuery ?? null,
|
|
10
16
|
authStatus: null,
|
|
11
|
-
activeGroupId:
|
|
17
|
+
activeGroupId: i,
|
|
12
18
|
children: e
|
|
13
|
-
}),
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
permissionsQuery: i,
|
|
19
|
+
}), k = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i, authStatusQuery: o, authStatusPrepared: s, loginRedirectPath: c }) => {
|
|
20
|
+
let l = p(o, s);
|
|
21
|
+
return l?.isLoggedIn === !0 ? /* @__PURE__ */ a(t, {
|
|
22
|
+
permissionsQuery: r,
|
|
18
23
|
prepared: n?.permissionsQuery ?? null,
|
|
19
|
-
authStatus:
|
|
20
|
-
activeGroupId:
|
|
24
|
+
authStatus: l,
|
|
25
|
+
activeGroupId: i,
|
|
21
26
|
children: e
|
|
22
|
-
});
|
|
23
|
-
},
|
|
27
|
+
}) : /* @__PURE__ */ a(D, { loginRedirectPath: c });
|
|
28
|
+
}, A = (e) => {
|
|
24
29
|
let t = e.trim();
|
|
25
30
|
return t === "" || t === "/" ? "" : t.replace(/^\/+|\/+$/g, "");
|
|
26
|
-
},
|
|
31
|
+
}, j = (e) => {
|
|
27
32
|
let t = e.trim();
|
|
28
33
|
return t === "" ? "/" : `/${t}`.replace(/\/+/g, "/");
|
|
29
|
-
},
|
|
34
|
+
}, M = (e, t) => {
|
|
30
35
|
let n = t.replace(/^\/+|\/+$/g, "");
|
|
31
36
|
return e === "" ? n : n === "" ? e : `${e}/${n}`;
|
|
32
|
-
},
|
|
33
|
-
let n =
|
|
37
|
+
}, N = (e, t) => j(M(e, t)), P = (e, t) => {
|
|
38
|
+
let n = j(e), r = t === "" ? "" : `/${t}`;
|
|
34
39
|
return r !== "" && n.startsWith(r) ? n.slice(r.length).replace(/^\/+/, "") : n.replace(/^\/+/, "");
|
|
35
|
-
},
|
|
40
|
+
}, F = (e, t) => {
|
|
36
41
|
if (e?.routes == null) return null;
|
|
37
42
|
for (let n = e.routes.length - 1; n >= 0; --n) {
|
|
38
43
|
let r = e.routes[n];
|
|
@@ -42,7 +47,7 @@ var { loadQuery: l, usePreloadedQuery: u } = i, d = o("WrapperPage", async () =>
|
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
49
|
return null;
|
|
45
|
-
},
|
|
50
|
+
}, I = (e) => {
|
|
46
51
|
let t = new URLSearchParams();
|
|
47
52
|
return Object.entries(e).forEach(([e, n]) => {
|
|
48
53
|
if (n != null) {
|
|
@@ -55,55 +60,55 @@ var { loadQuery: l, usePreloadedQuery: u } = i, d = o("WrapperPage", async () =>
|
|
|
55
60
|
t.set(e, String(n));
|
|
56
61
|
}
|
|
57
62
|
}), t;
|
|
58
|
-
},
|
|
59
|
-
function
|
|
60
|
-
let { basePath:
|
|
63
|
+
}, L = u;
|
|
64
|
+
function R(r) {
|
|
65
|
+
let { basePath: i, entityManifest: o, entityRegistry: c, sidebar: l, auth: u, dashboard: p } = r, D = A(i), j = M(D, "login"), R = M(D, "login/reset"), z = M(D, "login/reset/complete"), B = M(D, "verify-email"), V = M(D, "accept-invitation"), H = N(D, "login"), U = t(o, l), W = n(U, l), G = e(U, l), K = /* @__PURE__ */ new Map();
|
|
61
66
|
G.forEach((e, t) => {
|
|
62
67
|
K.set(t, e.groupId);
|
|
63
68
|
});
|
|
64
|
-
let q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y =
|
|
65
|
-
let t = await
|
|
69
|
+
let q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = l?.permissionsQuery, X = async ({ context: e }) => {
|
|
70
|
+
let t = await u.session.load();
|
|
66
71
|
return {
|
|
67
|
-
permissionsQuery: Y == null ? null :
|
|
68
|
-
authStatusQuery: t.authStatusQuery == null ? null :
|
|
72
|
+
permissionsQuery: Y == null ? null : f(e.relayEnvironment, Y, {}),
|
|
73
|
+
authStatusQuery: t.authStatusQuery == null ? null : f(e.relayEnvironment, t.authStatusQuery, {}, { fetchPolicy: "network-only" })
|
|
69
74
|
};
|
|
70
|
-
}, Z =
|
|
75
|
+
}, Z = L({
|
|
71
76
|
path: "",
|
|
72
|
-
resourcePage:
|
|
73
|
-
prepare: async () => (
|
|
74
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
75
|
-
}), Q =
|
|
77
|
+
resourcePage: b,
|
|
78
|
+
prepare: async () => (p == null || await p.load(), null),
|
|
79
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ a(e, {})
|
|
80
|
+
}), Q = L({
|
|
76
81
|
path: "dashboard",
|
|
77
|
-
resourcePage:
|
|
78
|
-
prepare: async () => (
|
|
79
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
80
|
-
}), ee = Object.values(
|
|
81
|
-
let t =
|
|
82
|
-
path:
|
|
83
|
-
resourcePage:
|
|
82
|
+
resourcePage: b,
|
|
83
|
+
prepare: async () => (p == null || await p.load(), null),
|
|
84
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ a(e, {})
|
|
85
|
+
}), ee = Object.values(o).filter((e) => e.kind === "list-detail"), te = W.map((e) => {
|
|
86
|
+
let t = L({
|
|
87
|
+
path: P(e.hub.href, D),
|
|
88
|
+
resourcePage: x,
|
|
84
89
|
prepare: () => ({
|
|
85
90
|
hubId: e.hub.id,
|
|
86
91
|
hub: e.hub
|
|
87
92
|
}),
|
|
88
|
-
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */
|
|
93
|
+
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ a(t, { prepared: e })
|
|
89
94
|
});
|
|
90
95
|
return e.groupId != null && J.set(t, e.groupId), t;
|
|
91
96
|
}), ne = ee.map((e) => {
|
|
92
|
-
let t = e.routes.list, n =
|
|
97
|
+
let t = e.routes.list, n = P(t, D), r = [];
|
|
93
98
|
if (e.hasList) {
|
|
94
|
-
let t =
|
|
99
|
+
let t = L({
|
|
95
100
|
path: "",
|
|
96
|
-
resourcePage:
|
|
101
|
+
resourcePage: g,
|
|
97
102
|
prepareSearchBehavior: "path",
|
|
98
103
|
prepare: async ({ context: t, query: n }) => {
|
|
99
|
-
let { config: r } = await
|
|
104
|
+
let { config: r } = await c.loadListEntity(e.id), { list: i, listUrlCodec: a, listDefaults: o } = r;
|
|
100
105
|
if (a == null || o == null) throw Error(`Backoffice entity ${e.id} does not expose a list configuration.`);
|
|
101
|
-
let s =
|
|
102
|
-
where:
|
|
103
|
-
sort:
|
|
104
|
-
count:
|
|
106
|
+
let s = I(n), l = a.parse(s), { pageSize: u } = d, p = {
|
|
107
|
+
where: l.where,
|
|
108
|
+
sort: l.sort ?? o.sort,
|
|
109
|
+
count: u,
|
|
105
110
|
cursor: null
|
|
106
|
-
}, m = i.buildQueryVariables(p), h =
|
|
111
|
+
}, m = i.buildQueryVariables(p), h = f(t.relayEnvironment, i.query, m);
|
|
107
112
|
return {
|
|
108
113
|
entityId: e.id,
|
|
109
114
|
entityManifest: e,
|
|
@@ -114,20 +119,20 @@ function P(i) {
|
|
|
114
119
|
render: ({ prepared: e, Component: t }) => {
|
|
115
120
|
if (t == null) return null;
|
|
116
121
|
let n = e;
|
|
117
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ a(t, {
|
|
118
123
|
entityManifest: n.entityManifest,
|
|
119
124
|
config: n.entityConfig,
|
|
120
125
|
prepared: n
|
|
121
126
|
});
|
|
122
127
|
}
|
|
123
128
|
});
|
|
124
|
-
q.set(t, e.id),
|
|
129
|
+
q.set(t, e.id), r.push(t);
|
|
125
130
|
}
|
|
126
|
-
let
|
|
131
|
+
let i = L({
|
|
127
132
|
path: ":id",
|
|
128
|
-
resourcePage:
|
|
133
|
+
resourcePage: v,
|
|
129
134
|
prepare: async ({ context: t, variables: n }) => {
|
|
130
|
-
let { config: r } = await
|
|
135
|
+
let { config: r } = await c.loadDetailLayoutEntity(e.id), i = String(n.id ?? ""), a = r.layoutPage.buildVariables == null ? { variables: { id: i } } : r.layoutPage.buildVariables({ id: i }), o = f(t.relayEnvironment, r.layoutPage.query, a.variables);
|
|
131
136
|
return {
|
|
132
137
|
entityId: e.id,
|
|
133
138
|
entityManifest: e,
|
|
@@ -138,18 +143,18 @@ function P(i) {
|
|
|
138
143
|
},
|
|
139
144
|
render: ({ children: e, prepared: t, Component: n }) => {
|
|
140
145
|
if (n == null) return null;
|
|
141
|
-
let
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
-
entityManifest:
|
|
144
|
-
config:
|
|
145
|
-
prepared:
|
|
146
|
+
let r = t;
|
|
147
|
+
return /* @__PURE__ */ a(n, {
|
|
148
|
+
entityManifest: r.entityManifest,
|
|
149
|
+
config: r.entityConfig,
|
|
150
|
+
prepared: r,
|
|
146
151
|
children: e
|
|
147
152
|
});
|
|
148
153
|
},
|
|
149
154
|
children: [
|
|
150
|
-
|
|
155
|
+
L({
|
|
151
156
|
path: "",
|
|
152
|
-
resourcePage:
|
|
157
|
+
resourcePage: m,
|
|
153
158
|
prepare: ({ variables: t }) => {
|
|
154
159
|
let n = String(t.id ?? "").trim();
|
|
155
160
|
return { redirectTo: n === "" ? null : e.routes.detailPage(n, e.defaultDetailPageId ?? "overview") };
|
|
@@ -157,14 +162,14 @@ function P(i) {
|
|
|
157
162
|
render: ({ prepared: e }) => {
|
|
158
163
|
let t = e.redirectTo ?? null;
|
|
159
164
|
if (t == null) return null;
|
|
160
|
-
throw new
|
|
165
|
+
throw new s(t);
|
|
161
166
|
}
|
|
162
167
|
}),
|
|
163
|
-
...(e.detailPages ?? []).map((t) =>
|
|
168
|
+
...(e.detailPages ?? []).map((t) => L({
|
|
164
169
|
path: t.pathSegment,
|
|
165
|
-
resourcePage:
|
|
170
|
+
resourcePage: _,
|
|
166
171
|
prepare: async ({ context: n, variables: r }) => {
|
|
167
|
-
let i = String(r.id ?? ""), a = await
|
|
172
|
+
let i = String(r.id ?? ""), a = await c.loadDetailPageEntity(e.id, t.id), o = a.config.page.buildVariables == null ? { variables: { id: i } } : a.config.page.buildVariables({ id: i }), s = f(n.relayEnvironment, a.config.page.query, o.variables);
|
|
168
173
|
return {
|
|
169
174
|
entityId: e.id,
|
|
170
175
|
entityManifest: e,
|
|
@@ -180,18 +185,18 @@ function P(i) {
|
|
|
180
185
|
render: ({ prepared: e, Component: t }) => {
|
|
181
186
|
if (t == null) return null;
|
|
182
187
|
let n = e;
|
|
183
|
-
return /* @__PURE__ */
|
|
188
|
+
return /* @__PURE__ */ a(t, {
|
|
184
189
|
entityManifest: n.entityManifest,
|
|
185
190
|
config: n.entityConfig,
|
|
186
191
|
prepared: n
|
|
187
192
|
});
|
|
188
193
|
}
|
|
189
194
|
})),
|
|
190
|
-
|
|
195
|
+
L({
|
|
191
196
|
path: ":pagePath",
|
|
192
|
-
resourcePage:
|
|
197
|
+
resourcePage: y,
|
|
193
198
|
prepare: async ({ variables: t }) => {
|
|
194
|
-
let n = await
|
|
199
|
+
let n = await c.loadDetailLayoutEntity(e.id), r = String(t.id ?? ""), i = String(t.pagePath ?? "");
|
|
195
200
|
return {
|
|
196
201
|
entityManifest: e,
|
|
197
202
|
entityConfig: n.config,
|
|
@@ -202,7 +207,7 @@ function P(i) {
|
|
|
202
207
|
render: ({ prepared: e, Component: t }) => {
|
|
203
208
|
if (t == null) return null;
|
|
204
209
|
let n = e;
|
|
205
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ a(t, {
|
|
206
211
|
entityManifest: n.entityManifest,
|
|
207
212
|
config: n.entityConfig,
|
|
208
213
|
prepared: n
|
|
@@ -211,17 +216,17 @@ function P(i) {
|
|
|
211
216
|
})
|
|
212
217
|
]
|
|
213
218
|
});
|
|
214
|
-
return q.set(
|
|
219
|
+
return q.set(i, e.id), r.push(i), L({
|
|
215
220
|
path: n,
|
|
216
|
-
children:
|
|
217
|
-
resourcePage:
|
|
221
|
+
children: r,
|
|
222
|
+
resourcePage: m
|
|
218
223
|
});
|
|
219
|
-
}), re = Object.values(
|
|
220
|
-
let t =
|
|
221
|
-
path:
|
|
222
|
-
resourcePage:
|
|
224
|
+
}), re = Object.values(o).filter((e) => e.kind === "tool").map((e) => {
|
|
225
|
+
let t = L({
|
|
226
|
+
path: P(e.routes.list, D),
|
|
227
|
+
resourcePage: r.toolsOperationPage ?? null,
|
|
223
228
|
prepare: async () => {
|
|
224
|
-
let t = await
|
|
229
|
+
let t = await c.loadToolEntity(e.id);
|
|
225
230
|
return {
|
|
226
231
|
entityId: e.id,
|
|
227
232
|
entityManifest: e,
|
|
@@ -231,7 +236,7 @@ function P(i) {
|
|
|
231
236
|
render: ({ prepared: e, Component: t }) => {
|
|
232
237
|
if (t == null) return null;
|
|
233
238
|
let n = e;
|
|
234
|
-
return /* @__PURE__ */
|
|
239
|
+
return /* @__PURE__ */ a(t, {
|
|
235
240
|
entityManifest: n.entityManifest,
|
|
236
241
|
operation: n.entityConfig.tool.operation,
|
|
237
242
|
toolId: n.entityConfig.id
|
|
@@ -239,27 +244,27 @@ function P(i) {
|
|
|
239
244
|
}
|
|
240
245
|
});
|
|
241
246
|
return q.set(t, e.id), t;
|
|
242
|
-
}), ie =
|
|
243
|
-
path:
|
|
244
|
-
resourcePage:
|
|
247
|
+
}), ie = L({
|
|
248
|
+
path: D,
|
|
249
|
+
resourcePage: h,
|
|
245
250
|
prepareSearchBehavior: "path",
|
|
246
251
|
prepare: X,
|
|
247
|
-
render: ({ children: e, prepared: t, route: n, Component:
|
|
248
|
-
if (
|
|
249
|
-
let
|
|
250
|
-
return
|
|
252
|
+
render: ({ children: e, prepared: t, route: n, Component: r }) => {
|
|
253
|
+
if (r == null) return null;
|
|
254
|
+
let i = t, o = F(n, q), s = o == null ? F(n, J) : K.get(o) ?? null, c = r, d = u.session.get()?.authStatusQuery ?? null;
|
|
255
|
+
return d != null && i?.authStatusQuery != null ? /* @__PURE__ */ a(k, {
|
|
251
256
|
Component: c,
|
|
252
|
-
preparedLayout:
|
|
253
|
-
permissionsQuery:
|
|
257
|
+
preparedLayout: i,
|
|
258
|
+
permissionsQuery: l?.permissionsQuery,
|
|
254
259
|
activeGroupId: s,
|
|
255
|
-
authStatusQuery:
|
|
256
|
-
authStatusPrepared:
|
|
260
|
+
authStatusQuery: d,
|
|
261
|
+
authStatusPrepared: i.authStatusQuery,
|
|
257
262
|
loginRedirectPath: H,
|
|
258
263
|
children: e
|
|
259
|
-
}) : /* @__PURE__ */
|
|
264
|
+
}) : /* @__PURE__ */ a(O, {
|
|
260
265
|
Component: c,
|
|
261
|
-
preparedLayout:
|
|
262
|
-
permissionsQuery:
|
|
266
|
+
preparedLayout: i,
|
|
267
|
+
permissionsQuery: l?.permissionsQuery,
|
|
263
268
|
activeGroupId: s,
|
|
264
269
|
children: e
|
|
265
270
|
});
|
|
@@ -272,51 +277,52 @@ function P(i) {
|
|
|
272
277
|
Q
|
|
273
278
|
]
|
|
274
279
|
}), $ = [
|
|
275
|
-
|
|
276
|
-
path:
|
|
277
|
-
resourcePage:
|
|
280
|
+
L({
|
|
281
|
+
path: j,
|
|
282
|
+
resourcePage: S,
|
|
278
283
|
prepare: async ({ context: e }) => {
|
|
279
|
-
let t = await
|
|
280
|
-
return { query:
|
|
284
|
+
let t = await u.login.load();
|
|
285
|
+
return { query: f(e.relayEnvironment, t.loginQuery, {}) };
|
|
281
286
|
},
|
|
282
|
-
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */
|
|
287
|
+
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ a(t, { prepared: e })
|
|
283
288
|
}),
|
|
284
|
-
|
|
289
|
+
L({
|
|
285
290
|
path: R,
|
|
286
|
-
resourcePage:
|
|
287
|
-
prepare: async () => (await
|
|
288
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
291
|
+
resourcePage: C,
|
|
292
|
+
prepare: async () => (await u.passwordResetRequest.load(), null),
|
|
293
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ a(e, {})
|
|
289
294
|
}),
|
|
290
|
-
|
|
295
|
+
L({
|
|
291
296
|
path: z,
|
|
292
|
-
resourcePage:
|
|
293
|
-
prepare: async () => (await
|
|
294
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
297
|
+
resourcePage: w,
|
|
298
|
+
prepare: async () => (await u.passwordResetComplete.load(), null),
|
|
299
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ a(e, {})
|
|
295
300
|
}),
|
|
296
|
-
|
|
301
|
+
L({
|
|
297
302
|
path: B,
|
|
298
|
-
resourcePage:
|
|
299
|
-
prepare: async () => (await
|
|
300
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
303
|
+
resourcePage: T,
|
|
304
|
+
prepare: async () => (await u.verifyEmail.load(), null),
|
|
305
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ a(e, {})
|
|
301
306
|
})
|
|
302
307
|
];
|
|
303
|
-
return (
|
|
308
|
+
return (u.hasAcceptInvitation === !0 || u.acceptInvitation != null) && $.push(L({
|
|
304
309
|
path: V,
|
|
305
|
-
resourcePage:
|
|
306
|
-
prepare: async () => (await
|
|
307
|
-
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */
|
|
310
|
+
resourcePage: E,
|
|
311
|
+
prepare: async () => (await u.acceptInvitation?.load(), null),
|
|
312
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ a(e, {})
|
|
308
313
|
})), $.push(ie), $;
|
|
309
314
|
}
|
|
310
|
-
var
|
|
311
|
-
normalizeBaseSegment:
|
|
312
|
-
normalizePath:
|
|
313
|
-
buildScopedPath:
|
|
314
|
-
buildScopedAbsolutePath:
|
|
315
|
-
buildRelativePath:
|
|
316
|
-
resolveActiveEntityIdFromRoute:
|
|
317
|
-
toSearchParams:
|
|
315
|
+
var z = {
|
|
316
|
+
normalizeBaseSegment: A,
|
|
317
|
+
normalizePath: j,
|
|
318
|
+
buildScopedPath: M,
|
|
319
|
+
buildScopedAbsolutePath: N,
|
|
320
|
+
buildRelativePath: P,
|
|
321
|
+
resolveActiveEntityIdFromRoute: F,
|
|
322
|
+
toSearchParams: I,
|
|
323
|
+
BackofficeLayoutRouteWithAuthStatus: k
|
|
318
324
|
};
|
|
319
325
|
//#endregion
|
|
320
|
-
export {
|
|
326
|
+
export { E as BackofficeAcceptInvitationPageResource, b as BackofficeDashboardPageResource, v as BackofficeEntityDetailLayoutPageResource, _ as BackofficeEntityDetailPageResource, y as BackofficeEntityDetailUnknownPageRedirectResource, g as BackofficeEntityListPageResource, x as BackofficeHubPageResource, h as BackofficeLayoutPageResource, S as BackofficeLoginPageResource, w as BackofficePasswordResetCompletePageResource, C as BackofficePasswordResetRequestPageResource, T as BackofficeVerifyEmailPageResource, m as WrapperPageResource, z as __test, R as createBackofficeRoutes, R as default };
|
|
321
327
|
|
|
322
328
|
//# sourceMappingURL=createBackofficeRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBackofficeRoutes.js","names":[],"sources":["../../../src/router/createBackofficeRoutes.tsx"],"sourcesContent":["/* eslint-disable no-ternary */\nimport { type ComponentType, type JSX, type ReactNode } from 'react';\nimport {\n getResourcePage,\n HttpRedirect,\n r,\n type AnyRoute,\n type ResourcePage,\n type Route,\n} from '@plumile/router';\nimport * as ReactRelay from 'react-relay';\nimport type { PreloadedQuery } from 'react-relay';\nimport type {\n Environment,\n GraphQLTaggedNode,\n OperationType,\n} from 'relay-runtime';\n\nimport { BACKOFFICE_LIST_DEFAULTS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeEntityManifestMap,\n BackofficePreparedDetailLayoutRoute,\n BackofficePreparedDetailPageRoute,\n BackofficePreparedListRoute,\n BackofficePreparedToolRoute,\n BackofficeResolvedDetailLayoutFacetConfigBase,\n} from '@plumile/backoffice-core/types.js';\n\nimport type {\n BackofficeAuthConfig,\n BackofficeDashboardModule,\n BackofficeResolvedSidebarHubConfig,\n BackofficeSidebarConfig,\n} from '../provider/types.js';\nimport {\n buildEntityGroupLookup,\n resolveSidebarHubEntries,\n resolveSidebarGroups,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport type { BackofficeEntityRegistry } from '../provider/entityRegistry.js';\n\nconst { loadQuery, usePreloadedQuery } = ReactRelay;\n\nexport type CreateBackofficeRoutesInput = {\n basePath: string;\n entityManifest: BackofficeEntityManifestMap;\n entityRegistry: BackofficeEntityRegistry;\n sidebar?: BackofficeSidebarConfig;\n auth: BackofficeAuthConfig;\n dashboard?: BackofficeDashboardModule;\n toolsOperationPage?: ResourcePage | null;\n};\n\nexport type BackofficeRouterContext = {\n relayEnvironment: Environment;\n};\n\nexport const WrapperPageResource: ResourcePage | null = getResourcePage(\n 'WrapperPage',\n // eslint-disable-next-line arrow-body-style\n async () => ({\n default: (await import('@plumile/ui')).WrapperPage,\n }),\n);\n\nexport const BackofficeLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLayoutPage.js'),\n );\n\nexport const BackofficeEntityListPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListPage.js'),\n );\n\nexport const BackofficeEntityDetailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPage.js'),\n );\n\nexport const BackofficeEntityDetailLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailLayoutPage.js'),\n );\n\nexport const BackofficeEntityDetailUnknownPageRedirectResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailUnknownPageRedirect',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailUnknownPageRedirect.js'),\n );\n\nexport const BackofficeDashboardPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardPage.js'),\n );\n\nexport const BackofficeHubPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeHubPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeHubPage.js'),\n);\n\nexport const BackofficeLoginPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeLoginPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLoginPage.js'),\n);\n\nexport const BackofficePasswordResetRequestPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetRequestPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetRequestPage.js'),\n );\n\nexport const BackofficePasswordResetCompletePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetCompletePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetCompletePage.js'),\n );\n\nexport const BackofficeVerifyEmailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeVerifyEmailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeVerifyEmailPage.js'),\n );\n\nexport const BackofficeAcceptInvitationPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeAcceptInvitationPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeAcceptInvitationPage.js'),\n );\n\ntype PreparedDetailUnknownPage = {\n id: string;\n pagePath: string;\n entityManifest: BackofficeEntityManifestMap[string];\n entityConfig: BackofficeResolvedDetailLayoutFacetConfigBase;\n};\n\ntype PreparedLayout = {\n permissionsQuery: PreloadedQuery<OperationType> | null;\n authStatusQuery: PreloadedQuery<OperationType> | null;\n};\n\ntype LayoutAuthStatus = {\n isLoggedIn?: boolean | null;\n me?: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n initials: string;\n } | null;\n} | null;\n\ntype LayoutRouteComponent = ComponentType<{\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: LayoutAuthStatus;\n activeGroupId?: string | null;\n}>;\n\ntype LayoutRouteRenderProps = {\n children: ReactNode;\n Component: LayoutRouteComponent;\n preparedLayout: PreparedLayout | undefined;\n permissionsQuery: GraphQLTaggedNode | undefined;\n activeGroupId: string | null;\n};\n\nconst BackofficeLayoutRouteWithoutAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n}: LayoutRouteRenderProps): JSX.Element => {\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={null}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nconst BackofficeLayoutRouteWithAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n authStatusQuery,\n authStatusPrepared,\n loginRedirectPath,\n}: LayoutRouteRenderProps & {\n authStatusQuery: GraphQLTaggedNode;\n authStatusPrepared: PreloadedQuery<OperationType>;\n loginRedirectPath: string;\n}): JSX.Element => {\n const data = usePreloadedQuery(authStatusQuery, authStatusPrepared);\n const authStatus = data as LayoutAuthStatus;\n\n if (authStatus?.isLoggedIn !== true) {\n throw new HttpRedirect(loginRedirectPath);\n }\n\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nexport type BackofficePreparedHubRoute = {\n hubId: string;\n hub: BackofficeResolvedSidebarHubConfig;\n};\n\nconst normalizeBaseSegment = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '' || trimmed === '/') {\n return '';\n }\n return trimmed.replace(/^\\/+|\\/+$/g, '');\n};\n\nconst normalizePath = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '') {\n return '/';\n }\n return `/${trimmed}`.replace(/\\/+/g, '/');\n};\n\nconst buildScopedPath = (baseSegment: string, path: string): string => {\n const normalizedPath = path.replace(/^\\/+|\\/+$/g, '');\n if (baseSegment === '') {\n return normalizedPath;\n }\n if (normalizedPath === '') {\n return baseSegment;\n }\n return `${baseSegment}/${normalizedPath}`;\n};\n\nconst buildScopedAbsolutePath = (baseSegment: string, path: string): string => {\n return normalizePath(buildScopedPath(baseSegment, path));\n};\n\nconst buildRelativePath = (\n absolutePath: string,\n baseSegment: string,\n): string => {\n const normalized = normalizePath(absolutePath);\n const basePrefix = baseSegment === '' ? '' : `/${baseSegment}`;\n if (basePrefix !== '' && normalized.startsWith(basePrefix)) {\n return normalized.slice(basePrefix.length).replace(/^\\/+/, '');\n }\n return normalized.replace(/^\\/+/, '');\n};\n\nconst resolveActiveEntityIdFromRoute = (\n route: { routes: AnyRoute[] } | null,\n routeEntityIdMap: WeakMap<AnyRoute, string>,\n): string | null => {\n if (route?.routes == null) {\n return null;\n }\n for (let index = route.routes.length - 1; index >= 0; index -= 1) {\n const routeEntry = route.routes[index];\n if (routeEntry != null) {\n const entityId = routeEntityIdMap.get(routeEntry);\n if (entityId != null) {\n return entityId;\n }\n }\n }\n return null;\n};\n\nconst toSearchParams = (query: Record<string, unknown>): URLSearchParams => {\n const params = new URLSearchParams();\n Object.entries(query).forEach(([key, value]) => {\n if (value == null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry) => {\n if (entry == null) {\n return;\n }\n params.append(key, String(entry));\n });\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n params.set(key, String(value));\n });\n return params;\n};\n\nconst rBackoffice = r<BackofficeRouterContext>;\n\n/**\n * Creates backoffice routes based on the provided configuration\n */\nexport function createBackofficeRoutes(\n input: CreateBackofficeRoutesInput,\n): Route<BackofficeRouterContext, any>[] {\n const { basePath, entityManifest, entityRegistry, sidebar, auth, dashboard } =\n input;\n const baseSegment = normalizeBaseSegment(basePath);\n const loginPath = buildScopedPath(baseSegment, 'login');\n const passwordResetRequestPath = buildScopedPath(baseSegment, 'login/reset');\n const passwordResetCompletePath = buildScopedPath(\n baseSegment,\n 'login/reset/complete',\n );\n const verifyEmailPath = buildScopedPath(baseSegment, 'verify-email');\n const acceptInvitationPath = buildScopedPath(\n baseSegment,\n 'accept-invitation',\n );\n const loginRedirectPath = buildScopedAbsolutePath(baseSegment, 'login');\n const entities = entityManifest;\n const groups = resolveSidebarGroups(entities, sidebar);\n const hubEntries = resolveSidebarHubEntries(groups, sidebar);\n const entityGroupLookup = buildEntityGroupLookup(groups, sidebar);\n const entityIdToGroupId = new Map<string, string>();\n entityGroupLookup.forEach((value, entityId) => {\n entityIdToGroupId.set(entityId, value.groupId);\n });\n const routeEntityIdMap = new WeakMap<AnyRoute, string>();\n const routeGroupIdMap = new WeakMap<AnyRoute, string>();\n\n const permissionsQuery = sidebar?.permissionsQuery;\n const layoutPrepare = async ({\n context,\n }: {\n context: BackofficeRouterContext;\n }) => {\n const sessionAuth = await auth.session.load();\n const permissionsQueryRef =\n permissionsQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n permissionsQuery,\n {},\n )\n : null;\n const authStatusQueryRef =\n sessionAuth.authStatusQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n sessionAuth.authStatusQuery,\n {},\n { fetchPolicy: 'network-only' },\n )\n : null;\n return {\n permissionsQuery: permissionsQueryRef,\n authStatusQuery: authStatusQueryRef,\n };\n };\n\n const dashboardRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n if (dashboard == null) {\n return null;\n }\n await dashboard.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n });\n const dashboardAliasRoute = rBackoffice({\n path: 'dashboard',\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n if (dashboard == null) {\n return null;\n }\n await dashboard.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n });\n\n const listEntityEntries = Object.values(entityManifest).filter((entity) => {\n return entity.kind === 'list-detail';\n });\n\n const hubRoutes = hubEntries.map((entry) => {\n const hubRelative = buildRelativePath(entry.hub.href, baseSegment);\n const hubRoute = rBackoffice({\n path: hubRelative,\n resourcePage: BackofficeHubPageResource,\n prepare: () => {\n return {\n hubId: entry.hub.id,\n hub: entry.hub,\n } satisfies BackofficePreparedHubRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n });\n if (entry.groupId != null) {\n routeGroupIdMap.set(hubRoute, entry.groupId);\n }\n return hubRoute;\n });\n\n const entityRoutes = listEntityEntries.map((entityManifestItem) => {\n const listPath = entityManifestItem.routes.list;\n const listRelative = buildRelativePath(listPath, baseSegment);\n const children: Route<any, any>[] = [];\n\n if (entityManifestItem.hasList) {\n const listRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListPageResource,\n prepareSearchBehavior: 'path',\n prepare: async ({ context, query }) => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const { list, listUrlCodec, listDefaults } = config;\n if (listUrlCodec == null || listDefaults == null) {\n throw new Error(\n `Backoffice entity ${entityManifestItem.id} does not expose a list configuration.`,\n );\n }\n const params = toSearchParams(query);\n const state = listUrlCodec.parse(params);\n const { pageSize } = BACKOFFICE_LIST_DEFAULTS;\n const variablesBase = {\n where: state.where,\n sort: state.sort ?? listDefaults.sort,\n count: pageSize,\n cursor: null,\n };\n const variables = list.buildQueryVariables(variablesBase);\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n list.query,\n variables,\n );\n const prepared: BackofficePreparedListRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n query: queryRef,\n };\n return prepared;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n routeEntityIdMap.set(listRoute, entityManifestItem.id);\n children.push(listRoute);\n }\n\n const detailLayoutRoute = rBackoffice({\n path: ':id',\n resourcePage: BackofficeEntityDetailLayoutPageResource,\n prepare: async ({ context, variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const rawId = String(variables.id ?? '');\n const layoutBuildResult =\n config.layoutPage.buildVariables != null\n ? config.layoutPage.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const layoutQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n config.layoutPage.query,\n layoutBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n layoutQuery: layoutQueryRef,\n id: rawId,\n } satisfies BackofficePreparedDetailLayoutRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailLayoutRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [\n rBackoffice({\n path: '',\n resourcePage: WrapperPageResource,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '').trim();\n return {\n redirectTo:\n rawId === ''\n ? null\n : entityManifestItem.routes.detailPage(\n rawId,\n entityManifestItem.defaultDetailPageId ?? 'overview',\n ),\n };\n },\n render: ({ prepared }) => {\n const redirectTo =\n (prepared as { redirectTo?: string | null }).redirectTo ?? null;\n if (redirectTo == null) {\n return null;\n }\n throw new HttpRedirect(redirectTo);\n },\n }),\n ...(entityManifestItem.detailPages ?? []).map((pageManifest) => {\n return rBackoffice({\n path: pageManifest.pathSegment,\n resourcePage: BackofficeEntityDetailPageResource,\n prepare: async ({ context, variables }) => {\n const rawId = String(variables.id ?? '');\n const pageModule = await entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n );\n const pageBuildResult =\n pageModule.config.page.buildVariables != null\n ? pageModule.config.page.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const pageQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n pageModule.config.page.query,\n pageBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig:\n pageModule.config as unknown as BackofficeResolvedDetailLayoutFacetConfigBase,\n detailId: pageBuildResult.detailId,\n id: rawId,\n pageConfig: pageModule.config,\n pageQuery: pageQueryRef,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n }),\n rBackoffice({\n path: ':pagePath',\n resourcePage: BackofficeEntityDetailUnknownPageRedirectResource,\n prepare: async ({ variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const rawId = String(variables.id ?? '');\n const rawPagePath = String(variables.pagePath ?? '');\n return {\n entityManifest: entityManifestItem,\n entityConfig: entityModule.config,\n id: rawId,\n pagePath: rawPagePath,\n };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedDetail = prepared as PreparedDetailUnknownPage;\n return (\n <Component\n entityManifest={preparedDetail.entityManifest}\n config={preparedDetail.entityConfig}\n prepared={preparedDetail}\n />\n );\n },\n }),\n ],\n });\n routeEntityIdMap.set(detailLayoutRoute, entityManifestItem.id);\n children.push(detailLayoutRoute);\n\n return rBackoffice({\n path: listRelative,\n children,\n resourcePage: WrapperPageResource,\n });\n });\n\n const toolsRoutes = Object.values(entityManifest)\n .filter((entity) => {\n return entity.kind === 'tool';\n })\n .map((toolManifest) => {\n const toolRelative = buildRelativePath(\n toolManifest.routes.list,\n baseSegment,\n );\n const toolRoute = rBackoffice({\n path: toolRelative,\n resourcePage: input.toolsOperationPage ?? null,\n prepare: async () => {\n const toolModule = await entityRegistry.loadToolEntity(\n toolManifest.id,\n );\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n entityConfig: toolModule.config,\n } satisfies BackofficePreparedToolRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n operation={preparedTool.entityConfig.tool.operation}\n toolId={preparedTool.entityConfig.id}\n />\n );\n },\n });\n routeEntityIdMap.set(toolRoute, toolManifest.id);\n return toolRoute;\n });\n\n const layoutRoute = rBackoffice({\n path: baseSegment,\n resourcePage: BackofficeLayoutPageResource,\n prepareSearchBehavior: 'path',\n prepare: layoutPrepare,\n render: ({ children, prepared, route, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedLayout = prepared as PreparedLayout | undefined;\n const activeEntityId = resolveActiveEntityIdFromRoute(\n route,\n routeEntityIdMap,\n );\n const activeGroupId =\n activeEntityId != null\n ? (entityIdToGroupId.get(activeEntityId) ?? null)\n : resolveActiveEntityIdFromRoute(route, routeGroupIdMap);\n const LayoutComponent = Component as LayoutRouteComponent;\n const authStatusQuery = auth.session.get()?.authStatusQuery ?? null;\n if (authStatusQuery != null && preparedLayout?.authStatusQuery != null) {\n return (\n <BackofficeLayoutRouteWithAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n authStatusQuery={authStatusQuery}\n authStatusPrepared={preparedLayout.authStatusQuery}\n loginRedirectPath={loginRedirectPath}\n >\n {children}\n </BackofficeLayoutRouteWithAuthStatus>\n );\n }\n return (\n <BackofficeLayoutRouteWithoutAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutRouteWithoutAuthStatus>\n );\n },\n children: [\n dashboardRoute,\n ...hubRoutes,\n ...entityRoutes,\n ...toolsRoutes,\n dashboardAliasRoute,\n ],\n });\n\n const routes: Route<BackofficeRouterContext, any>[] = [\n rBackoffice({\n path: loginPath,\n resourcePage: BackofficeLoginPageResource,\n prepare: async ({ context }) => {\n const loginAuth = await auth.login.load();\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n loginAuth.loginQuery,\n {},\n );\n return { query: queryRef };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n }),\n rBackoffice({\n path: passwordResetRequestPath,\n resourcePage: BackofficePasswordResetRequestPageResource,\n prepare: async () => {\n await auth.passwordResetRequest.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: passwordResetCompletePath,\n resourcePage: BackofficePasswordResetCompletePageResource,\n prepare: async () => {\n await auth.passwordResetComplete.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: verifyEmailPath,\n resourcePage: BackofficeVerifyEmailPageResource,\n prepare: async () => {\n await auth.verifyEmail.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n ];\n\n if (auth.hasAcceptInvitation === true || auth.acceptInvitation != null) {\n routes.push(\n rBackoffice({\n path: acceptInvitationPath,\n resourcePage: BackofficeAcceptInvitationPageResource,\n prepare: async () => {\n await auth.acceptInvitation?.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n );\n }\n\n routes.push(layoutRoute);\n\n return routes;\n}\n\nexport const __test = {\n normalizeBaseSegment,\n normalizePath,\n buildScopedPath,\n buildScopedAbsolutePath,\n buildRelativePath,\n resolveActiveEntityIdFromRoute,\n toSearchParams,\n} as const;\n\nexport default createBackofficeRoutes;\n"],"mappings":";;;;;;AAyCA,IAAM,EAAE,WAAA,GAAW,mBAAA,MAAsB,GAgB5B,IAA2C,EACtD,eAEA,aAAa,EACX,UAAU,MAAM,OAAO,gBAAgB,aACxC,EACF,EAEY,IACX,EACE,wBAEA,YAAY,OAAO,oCACpB,EAEU,IACX,EACE,4BAEA,YAAY,OAAO,wCACpB,EAEU,IACX,EACE,8BAEA,YAAY,OAAO,0CACpB,EAEU,IACX,EACE,oCAEA,YAAY,OAAO,gDACpB,EAEU,IACX,EACE,6CAEA,YAAY,OAAO,yDACpB,EAEU,IACX,EACE,2BAEA,YAAY,OAAO,uCACpB,EAEU,IAAiD,EAC5D,qBAEA,YAAY,OAAO,iCACpB,EAEY,IAAmD,EAC9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ACd,SAAS,aACP,MAAM,EAAK,YAAY,MAAM,EACtB;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,EAAa,CAAA;GAEvB,CAAC;EACH;CAuBD,QArBI,EAAK,wBAAwB,MAAQ,EAAK,oBAAoB,SAChE,EAAO,KACL,EAAY;EACV,MAAM;EACN,cAAc;EACd,SAAS,aACP,MAAM,EAAK,kBAAkB,MAAM,EAC5B;EAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,EAAa,CAAA;EAEvB,CAAC,CACH,EAGH,EAAO,KAAK,GAAY,EAEjB;;AAGT,IAAa,IAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
1
|
+
{"version":3,"file":"createBackofficeRoutes.js","names":[],"sources":["../../../src/router/createBackofficeRoutes.tsx"],"sourcesContent":["/* eslint-disable no-ternary */\nimport {\n useContext,\n useEffect,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\nimport {\n getResourcePage,\n HttpRedirect,\n r,\n RoutingContext,\n type AnyRoute,\n type ResourcePage,\n type Route,\n} from '@plumile/router';\nimport * as ReactRelay from 'react-relay';\nimport type { PreloadedQuery } from 'react-relay';\nimport type {\n Environment,\n GraphQLTaggedNode,\n OperationType,\n} from 'relay-runtime';\n\nimport { BACKOFFICE_LIST_DEFAULTS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeEntityManifestMap,\n BackofficePreparedDetailLayoutRoute,\n BackofficePreparedDetailPageRoute,\n BackofficePreparedListRoute,\n BackofficePreparedToolRoute,\n BackofficeResolvedDetailLayoutFacetConfigBase,\n} from '@plumile/backoffice-core/types.js';\n\nimport type {\n BackofficeAuthConfig,\n BackofficeDashboardModule,\n BackofficeResolvedSidebarHubConfig,\n BackofficeSidebarConfig,\n} from '../provider/types.js';\nimport {\n buildEntityGroupLookup,\n resolveSidebarHubEntries,\n resolveSidebarGroups,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport type { BackofficeEntityRegistry } from '../provider/entityRegistry.js';\n\nconst { loadQuery, usePreloadedQuery } = ReactRelay;\n\nexport type CreateBackofficeRoutesInput = {\n basePath: string;\n entityManifest: BackofficeEntityManifestMap;\n entityRegistry: BackofficeEntityRegistry;\n sidebar?: BackofficeSidebarConfig;\n auth: BackofficeAuthConfig;\n dashboard?: BackofficeDashboardModule;\n toolsOperationPage?: ResourcePage | null;\n};\n\nexport type BackofficeRouterContext = {\n relayEnvironment: Environment;\n};\n\nexport const WrapperPageResource: ResourcePage | null = getResourcePage(\n 'WrapperPage',\n // eslint-disable-next-line arrow-body-style\n async () => ({\n default: (await import('@plumile/ui')).WrapperPage,\n }),\n);\n\nexport const BackofficeLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLayoutPage.js'),\n );\n\nexport const BackofficeEntityListPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListPage.js'),\n );\n\nexport const BackofficeEntityDetailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPage.js'),\n );\n\nexport const BackofficeEntityDetailLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailLayoutPage.js'),\n );\n\nexport const BackofficeEntityDetailUnknownPageRedirectResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailUnknownPageRedirect',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailUnknownPageRedirect.js'),\n );\n\nexport const BackofficeDashboardPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardPage.js'),\n );\n\nexport const BackofficeHubPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeHubPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeHubPage.js'),\n);\n\nexport const BackofficeLoginPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeLoginPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLoginPage.js'),\n);\n\nexport const BackofficePasswordResetRequestPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetRequestPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetRequestPage.js'),\n );\n\nexport const BackofficePasswordResetCompletePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetCompletePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetCompletePage.js'),\n );\n\nexport const BackofficeVerifyEmailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeVerifyEmailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeVerifyEmailPage.js'),\n );\n\nexport const BackofficeAcceptInvitationPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeAcceptInvitationPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeAcceptInvitationPage.js'),\n );\n\ntype PreparedDetailUnknownPage = {\n id: string;\n pagePath: string;\n entityManifest: BackofficeEntityManifestMap[string];\n entityConfig: BackofficeResolvedDetailLayoutFacetConfigBase;\n};\n\ntype PreparedLayout = {\n permissionsQuery: PreloadedQuery<OperationType> | null;\n authStatusQuery: PreloadedQuery<OperationType> | null;\n};\n\ntype LayoutAuthStatus = {\n isLoggedIn?: boolean | null;\n me?: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n initials: string;\n } | null;\n} | null;\n\ntype LayoutRouteComponent = ComponentType<{\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: LayoutAuthStatus;\n activeGroupId?: string | null;\n}>;\n\ntype LayoutRouteRenderProps = {\n children: ReactNode;\n Component: LayoutRouteComponent;\n preparedLayout: PreparedLayout | undefined;\n permissionsQuery: GraphQLTaggedNode | undefined;\n activeGroupId: string | null;\n};\n\nconst BackofficeLoginRedirect = ({\n loginRedirectPath,\n}: {\n loginRedirectPath: string;\n}): null => {\n const router = useContext(RoutingContext);\n\n useEffect(() => {\n router?.history.set({\n pathname: loginRedirectPath,\n });\n }, [loginRedirectPath, router]);\n\n return null;\n};\n\nconst BackofficeLayoutRouteWithoutAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n}: LayoutRouteRenderProps): JSX.Element => {\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={null}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nconst BackofficeLayoutRouteWithAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n authStatusQuery,\n authStatusPrepared,\n loginRedirectPath,\n}: LayoutRouteRenderProps & {\n authStatusQuery: GraphQLTaggedNode;\n authStatusPrepared: PreloadedQuery<OperationType>;\n loginRedirectPath: string;\n}): JSX.Element => {\n const data = usePreloadedQuery(authStatusQuery, authStatusPrepared);\n const authStatus = data as LayoutAuthStatus;\n\n if (authStatus?.isLoggedIn !== true) {\n return <BackofficeLoginRedirect loginRedirectPath={loginRedirectPath} />;\n }\n\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nexport type BackofficePreparedHubRoute = {\n hubId: string;\n hub: BackofficeResolvedSidebarHubConfig;\n};\n\nconst normalizeBaseSegment = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '' || trimmed === '/') {\n return '';\n }\n return trimmed.replace(/^\\/+|\\/+$/g, '');\n};\n\nconst normalizePath = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '') {\n return '/';\n }\n return `/${trimmed}`.replace(/\\/+/g, '/');\n};\n\nconst buildScopedPath = (baseSegment: string, path: string): string => {\n const normalizedPath = path.replace(/^\\/+|\\/+$/g, '');\n if (baseSegment === '') {\n return normalizedPath;\n }\n if (normalizedPath === '') {\n return baseSegment;\n }\n return `${baseSegment}/${normalizedPath}`;\n};\n\nconst buildScopedAbsolutePath = (baseSegment: string, path: string): string => {\n return normalizePath(buildScopedPath(baseSegment, path));\n};\n\nconst buildRelativePath = (\n absolutePath: string,\n baseSegment: string,\n): string => {\n const normalized = normalizePath(absolutePath);\n const basePrefix = baseSegment === '' ? '' : `/${baseSegment}`;\n if (basePrefix !== '' && normalized.startsWith(basePrefix)) {\n return normalized.slice(basePrefix.length).replace(/^\\/+/, '');\n }\n return normalized.replace(/^\\/+/, '');\n};\n\nconst resolveActiveEntityIdFromRoute = (\n route: { routes: AnyRoute[] } | null,\n routeEntityIdMap: WeakMap<AnyRoute, string>,\n): string | null => {\n if (route?.routes == null) {\n return null;\n }\n for (let index = route.routes.length - 1; index >= 0; index -= 1) {\n const routeEntry = route.routes[index];\n if (routeEntry != null) {\n const entityId = routeEntityIdMap.get(routeEntry);\n if (entityId != null) {\n return entityId;\n }\n }\n }\n return null;\n};\n\nconst toSearchParams = (query: Record<string, unknown>): URLSearchParams => {\n const params = new URLSearchParams();\n Object.entries(query).forEach(([key, value]) => {\n if (value == null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry) => {\n if (entry == null) {\n return;\n }\n params.append(key, String(entry));\n });\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n params.set(key, String(value));\n });\n return params;\n};\n\nconst rBackoffice = r<BackofficeRouterContext>;\n\n/**\n * Creates backoffice routes based on the provided configuration\n */\nexport function createBackofficeRoutes(\n input: CreateBackofficeRoutesInput,\n): Route<BackofficeRouterContext, any>[] {\n const { basePath, entityManifest, entityRegistry, sidebar, auth, dashboard } =\n input;\n const baseSegment = normalizeBaseSegment(basePath);\n const loginPath = buildScopedPath(baseSegment, 'login');\n const passwordResetRequestPath = buildScopedPath(baseSegment, 'login/reset');\n const passwordResetCompletePath = buildScopedPath(\n baseSegment,\n 'login/reset/complete',\n );\n const verifyEmailPath = buildScopedPath(baseSegment, 'verify-email');\n const acceptInvitationPath = buildScopedPath(\n baseSegment,\n 'accept-invitation',\n );\n const loginRedirectPath = buildScopedAbsolutePath(baseSegment, 'login');\n const entities = entityManifest;\n const groups = resolveSidebarGroups(entities, sidebar);\n const hubEntries = resolveSidebarHubEntries(groups, sidebar);\n const entityGroupLookup = buildEntityGroupLookup(groups, sidebar);\n const entityIdToGroupId = new Map<string, string>();\n entityGroupLookup.forEach((value, entityId) => {\n entityIdToGroupId.set(entityId, value.groupId);\n });\n const routeEntityIdMap = new WeakMap<AnyRoute, string>();\n const routeGroupIdMap = new WeakMap<AnyRoute, string>();\n\n const permissionsQuery = sidebar?.permissionsQuery;\n const layoutPrepare = async ({\n context,\n }: {\n context: BackofficeRouterContext;\n }) => {\n const sessionAuth = await auth.session.load();\n const permissionsQueryRef =\n permissionsQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n permissionsQuery,\n {},\n )\n : null;\n const authStatusQueryRef =\n sessionAuth.authStatusQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n sessionAuth.authStatusQuery,\n {},\n { fetchPolicy: 'network-only' },\n )\n : null;\n return {\n permissionsQuery: permissionsQueryRef,\n authStatusQuery: authStatusQueryRef,\n };\n };\n\n const dashboardRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n if (dashboard == null) {\n return null;\n }\n await dashboard.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n });\n const dashboardAliasRoute = rBackoffice({\n path: 'dashboard',\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n if (dashboard == null) {\n return null;\n }\n await dashboard.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n });\n\n const listEntityEntries = Object.values(entityManifest).filter((entity) => {\n return entity.kind === 'list-detail';\n });\n\n const hubRoutes = hubEntries.map((entry) => {\n const hubRelative = buildRelativePath(entry.hub.href, baseSegment);\n const hubRoute = rBackoffice({\n path: hubRelative,\n resourcePage: BackofficeHubPageResource,\n prepare: () => {\n return {\n hubId: entry.hub.id,\n hub: entry.hub,\n } satisfies BackofficePreparedHubRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n });\n if (entry.groupId != null) {\n routeGroupIdMap.set(hubRoute, entry.groupId);\n }\n return hubRoute;\n });\n\n const entityRoutes = listEntityEntries.map((entityManifestItem) => {\n const listPath = entityManifestItem.routes.list;\n const listRelative = buildRelativePath(listPath, baseSegment);\n const children: Route<any, any>[] = [];\n\n if (entityManifestItem.hasList) {\n const listRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListPageResource,\n prepareSearchBehavior: 'path',\n prepare: async ({ context, query }) => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const { list, listUrlCodec, listDefaults } = config;\n if (listUrlCodec == null || listDefaults == null) {\n throw new Error(\n `Backoffice entity ${entityManifestItem.id} does not expose a list configuration.`,\n );\n }\n const params = toSearchParams(query);\n const state = listUrlCodec.parse(params);\n const { pageSize } = BACKOFFICE_LIST_DEFAULTS;\n const variablesBase = {\n where: state.where,\n sort: state.sort ?? listDefaults.sort,\n count: pageSize,\n cursor: null,\n };\n const variables = list.buildQueryVariables(variablesBase);\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n list.query,\n variables,\n );\n const prepared: BackofficePreparedListRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n query: queryRef,\n };\n return prepared;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n routeEntityIdMap.set(listRoute, entityManifestItem.id);\n children.push(listRoute);\n }\n\n const detailLayoutRoute = rBackoffice({\n path: ':id',\n resourcePage: BackofficeEntityDetailLayoutPageResource,\n prepare: async ({ context, variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const rawId = String(variables.id ?? '');\n const layoutBuildResult =\n config.layoutPage.buildVariables != null\n ? config.layoutPage.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const layoutQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n config.layoutPage.query,\n layoutBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n layoutQuery: layoutQueryRef,\n id: rawId,\n } satisfies BackofficePreparedDetailLayoutRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailLayoutRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [\n rBackoffice({\n path: '',\n resourcePage: WrapperPageResource,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '').trim();\n return {\n redirectTo:\n rawId === ''\n ? null\n : entityManifestItem.routes.detailPage(\n rawId,\n entityManifestItem.defaultDetailPageId ?? 'overview',\n ),\n };\n },\n render: ({ prepared }) => {\n const redirectTo =\n (prepared as { redirectTo?: string | null }).redirectTo ?? null;\n if (redirectTo == null) {\n return null;\n }\n throw new HttpRedirect(redirectTo);\n },\n }),\n ...(entityManifestItem.detailPages ?? []).map((pageManifest) => {\n return rBackoffice({\n path: pageManifest.pathSegment,\n resourcePage: BackofficeEntityDetailPageResource,\n prepare: async ({ context, variables }) => {\n const rawId = String(variables.id ?? '');\n const pageModule = await entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n );\n const pageBuildResult =\n pageModule.config.page.buildVariables != null\n ? pageModule.config.page.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const pageQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n pageModule.config.page.query,\n pageBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig:\n pageModule.config as unknown as BackofficeResolvedDetailLayoutFacetConfigBase,\n detailId: pageBuildResult.detailId,\n id: rawId,\n pageConfig: pageModule.config,\n pageQuery: pageQueryRef,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n }),\n rBackoffice({\n path: ':pagePath',\n resourcePage: BackofficeEntityDetailUnknownPageRedirectResource,\n prepare: async ({ variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const rawId = String(variables.id ?? '');\n const rawPagePath = String(variables.pagePath ?? '');\n return {\n entityManifest: entityManifestItem,\n entityConfig: entityModule.config,\n id: rawId,\n pagePath: rawPagePath,\n };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedDetail = prepared as PreparedDetailUnknownPage;\n return (\n <Component\n entityManifest={preparedDetail.entityManifest}\n config={preparedDetail.entityConfig}\n prepared={preparedDetail}\n />\n );\n },\n }),\n ],\n });\n routeEntityIdMap.set(detailLayoutRoute, entityManifestItem.id);\n children.push(detailLayoutRoute);\n\n return rBackoffice({\n path: listRelative,\n children,\n resourcePage: WrapperPageResource,\n });\n });\n\n const toolsRoutes = Object.values(entityManifest)\n .filter((entity) => {\n return entity.kind === 'tool';\n })\n .map((toolManifest) => {\n const toolRelative = buildRelativePath(\n toolManifest.routes.list,\n baseSegment,\n );\n const toolRoute = rBackoffice({\n path: toolRelative,\n resourcePage: input.toolsOperationPage ?? null,\n prepare: async () => {\n const toolModule = await entityRegistry.loadToolEntity(\n toolManifest.id,\n );\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n entityConfig: toolModule.config,\n } satisfies BackofficePreparedToolRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n operation={preparedTool.entityConfig.tool.operation}\n toolId={preparedTool.entityConfig.id}\n />\n );\n },\n });\n routeEntityIdMap.set(toolRoute, toolManifest.id);\n return toolRoute;\n });\n\n const layoutRoute = rBackoffice({\n path: baseSegment,\n resourcePage: BackofficeLayoutPageResource,\n prepareSearchBehavior: 'path',\n prepare: layoutPrepare,\n render: ({ children, prepared, route, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedLayout = prepared as PreparedLayout | undefined;\n const activeEntityId = resolveActiveEntityIdFromRoute(\n route,\n routeEntityIdMap,\n );\n const activeGroupId =\n activeEntityId != null\n ? (entityIdToGroupId.get(activeEntityId) ?? null)\n : resolveActiveEntityIdFromRoute(route, routeGroupIdMap);\n const LayoutComponent = Component as LayoutRouteComponent;\n const authStatusQuery = auth.session.get()?.authStatusQuery ?? null;\n if (authStatusQuery != null && preparedLayout?.authStatusQuery != null) {\n return (\n <BackofficeLayoutRouteWithAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n authStatusQuery={authStatusQuery}\n authStatusPrepared={preparedLayout.authStatusQuery}\n loginRedirectPath={loginRedirectPath}\n >\n {children}\n </BackofficeLayoutRouteWithAuthStatus>\n );\n }\n return (\n <BackofficeLayoutRouteWithoutAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutRouteWithoutAuthStatus>\n );\n },\n children: [\n dashboardRoute,\n ...hubRoutes,\n ...entityRoutes,\n ...toolsRoutes,\n dashboardAliasRoute,\n ],\n });\n\n const routes: Route<BackofficeRouterContext, any>[] = [\n rBackoffice({\n path: loginPath,\n resourcePage: BackofficeLoginPageResource,\n prepare: async ({ context }) => {\n const loginAuth = await auth.login.load();\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n loginAuth.loginQuery,\n {},\n );\n return { query: queryRef };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n }),\n rBackoffice({\n path: passwordResetRequestPath,\n resourcePage: BackofficePasswordResetRequestPageResource,\n prepare: async () => {\n await auth.passwordResetRequest.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: passwordResetCompletePath,\n resourcePage: BackofficePasswordResetCompletePageResource,\n prepare: async () => {\n await auth.passwordResetComplete.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: verifyEmailPath,\n resourcePage: BackofficeVerifyEmailPageResource,\n prepare: async () => {\n await auth.verifyEmail.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n ];\n\n if (auth.hasAcceptInvitation === true || auth.acceptInvitation != null) {\n routes.push(\n rBackoffice({\n path: acceptInvitationPath,\n resourcePage: BackofficeAcceptInvitationPageResource,\n prepare: async () => {\n await auth.acceptInvitation?.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n );\n }\n\n routes.push(layoutRoute);\n\n return routes;\n}\n\nexport const __test = {\n normalizeBaseSegment,\n normalizePath,\n buildScopedPath,\n buildScopedAbsolutePath,\n buildRelativePath,\n resolveActiveEntityIdFromRoute,\n toSearchParams,\n BackofficeLayoutRouteWithAuthStatus,\n} as const;\n\nexport default createBackofficeRoutes;\n"],"mappings":";;;;;;;AAgDA,IAAM,EAAE,WAAA,GAAW,mBAAA,MAAsB,GAgB5B,IAA2C,EACtD,eAEA,aAAa,EACX,UAAU,MAAM,OAAO,gBAAgB,aACxC,EACF,EAEY,IACX,EACE,wBAEA,YAAY,OAAO,oCACpB,EAEU,IACX,EACE,4BAEA,YAAY,OAAO,wCACpB,EAEU,IACX,EACE,8BAEA,YAAY,OAAO,0CACpB,EAEU,IACX,EACE,oCAEA,YAAY,OAAO,gDACpB,EAEU,IACX,EACE,6CAEA,YAAY,OAAO,yDACpB,EAEU,IACX,EACE,2BAEA,YAAY,OAAO,uCACpB,EAEU,IAAiD,EAC5D,qBAEA,YAAY,OAAO,iCACpB,EAEY,IAAmD,EAC9D,uBAEA,YAAY,OAAO,mCACpB,EAEY,IACX,EACE,sCAEA,YAAY,OAAO,kDACpB,EAEU,IACX,EACE,uCAEA,YAAY,OAAO,mDACpB,EAEU,IACX,EACE,6BAEA,YAAY,OAAO,yCACpB,EAEU,IACX,EACE,kCAEA,YAAY,OAAO,8CACpB,EAyCG,KAA2B,EAC/B,2BAGU;CACV,IAAM,IAAS,EAAW,EAAe;CAQzC,OANA,QAAgB;EACd,GAAQ,QAAQ,IAAI,EAClB,UAAU,GACX,CAAC;IACD,CAAC,GAAmB,EAAO,CAAC,EAExB;GAGH,KAA0C,EAC9C,aACA,cACA,mBACA,qBACA,uBAGE,kBAAC,GAAD;CACoB;CAClB,UAAU,GAAgB,oBAAoB;CAC9C,YAAY;CACG;CAEd;CACS,CAAA,EAIV,KAAuC,EAC3C,aACA,cACA,mBACA,qBACA,kBACA,oBACA,uBACA,2BAKi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