@plumile/backoffice-react 0.1.152 → 0.1.154

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.
@@ -1,244 +1,262 @@
1
1
  import { useBackofficeReactTranslation as e } from "../i18n/useBackofficeReactTranslation.js";
2
2
  import { resolveMutationOutcome as t } from "../relay/mutationResult.js";
3
3
  import { useBackofficeConfig as n } from "../provider/BackofficeConfigContext.js";
4
- import { resolveToastSpec as r, resolveToastViewActions as i } from "../components/backoffice/actions/toastViewAction.js";
5
- import { LazyBackofficeEntityActionFormDialog as a } from "../components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js";
6
- import { buildDataTableColumns as o } from "../components/backoffice/columns/buildDataTableColumns.js";
7
- import { BackofficeDetailBadgeRow as s } from "../components/backoffice/detail/BackofficeDetailBadgeRow.js";
8
- import { BackofficeDetailFlagTag as c } from "../components/backoffice/detail/BackofficeDetailFlagTag.js";
9
- import { BackofficeDetailTaggedValue as l } from "../components/backoffice/detail/BackofficeDetailTaggedValue.js";
10
- import { BackofficeLifecycleTimelineSection as u } from "../components/backoffice/detail/BackofficeLifecycleTimelineSection.js";
11
- import { BackofficeRelationsSummaryGrid as d } from "../components/backoffice/detail/BackofficeRelationsSummaryGrid.js";
4
+ import { BackofficeErrorBoundary as r } from "../components/backoffice/errors/BackofficeErrorBoundary.js";
5
+ import { resolveToastSpec as i, resolveToastViewActions as a } from "../components/backoffice/actions/toastViewAction.js";
6
+ import { LazyBackofficeEntityActionFormDialog as o } from "../components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js";
7
+ import { buildDataTableColumns as s } from "../components/backoffice/columns/buildDataTableColumns.js";
8
+ import { BackofficeDetailBadgeRow as c } from "../components/backoffice/detail/BackofficeDetailBadgeRow.js";
9
+ import { BackofficeDetailFlagTag as l } from "../components/backoffice/detail/BackofficeDetailFlagTag.js";
10
+ import { BackofficeDetailTaggedValue as u } from "../components/backoffice/detail/BackofficeDetailTaggedValue.js";
11
+ import { BackofficeLifecycleTimelineSection as d } from "../components/backoffice/detail/BackofficeLifecycleTimelineSection.js";
12
+ import { BackofficeRelationsSummaryGrid as f } from "../components/backoffice/detail/BackofficeRelationsSummaryGrid.js";
12
13
  import { BackofficeRightPageLayout as ee } from "../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js";
13
14
  import { buildEntityDetailBreadcrumb as te } from "../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js";
14
- import { BackofficeEntityDetailScaffold as ne } from "../components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js";
15
- import { useBackofficeFormats as f } from "../i18n/useBackofficeFormats.js";
16
- import { useRelayEnvironment as re } from "../relay/useRelayEnvironment.js";
17
- import { resolveVisibleDetailPages as p } from "./detail/pageResolution.js";
18
- import { useBackofficeEntityDetailLayoutContext as m } from "./detail/BackofficeEntityDetailLayoutContext.js";
19
- import { BackofficeRedirect as h } from "./BackofficeRedirect.js";
20
- import { extractMutationPayload as ie, isFormMutationAction as g, isMutationAction as ae, isRouteAction as oe, resolveLabel as _ } from "./BackofficeEntityDetailPage.helpers.js";
21
- import { headerActions as se, headerBlock as ce, headerMeta as le, headerMetaList as ue } from "./backofficeEntityDetailPage.css.js";
22
- import { buildTabsItems as de } from "./detail/buildTabsItems.js";
23
- import { buildFieldItems as fe, renderBlocks as pe, resolveHeaderItems as me } from "./BackofficeEntityDetailPage.view-helpers.js";
24
- import { useContext as v, useMemo as y, useState as b } from "react";
25
- import { Fragment as he, jsx as x, jsxs as S } from "react/jsx-runtime";
26
- import { useTranslation as C } from "react-i18next";
27
- import { Button as w } from "@plumile/ui/atomic/atoms/button/Button.js";
28
- import { commitMutation as ge, useFragment as T, usePreloadedQuery as E } from "react-relay";
29
- import { useToast as D } from "@plumile/ui/atomic/molecules/toast/ToastProvider.js";
30
- import O from "@plumile/router/routing/RoutingContext.js";
31
- import { FormattedDate as k } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
32
- import { BACKOFFICE_DATE_TIME_OPTIONS as A } from "@plumile/backoffice-core/constants.js";
33
- import j from "@plumile/router/routing/Link.js";
34
- import { Tag as M } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
35
- import { buildBackofficeFallbackListHref as _e, buildBackofficeListHref as ve, buildBackofficeListLink as ye } from "@plumile/backoffice-core/state/buildListHref.js";
36
- import { BackofficeDetailSection as N } from "@plumile/ui/backoffice/molecules/backoffice_detail_section/BackofficeDetailSection.js";
37
- import { BackofficePayloadViewer as be } from "@plumile/ui/backoffice/molecules/backoffice_payload_viewer/BackofficePayloadViewer.js";
38
- import { setWhereValue as xe } from "@plumile/backoffice-core/filters/where.js";
39
- import { BackofficePageHeader as Se } from "@plumile/ui/backoffice/molecules/backoffice_page_header/BackofficePageHeader.js";
40
- import { AuditTimeline as Ce } from "@plumile/ui/backoffice/organisms/audit_timeline/AuditTimeline.js";
41
- import { MetricCard as we } from "@plumile/ui/components/dashboard/metric_card/MetricCard.js";
42
- import { MetricTileGroup as Te } from "@plumile/ui/components/dashboard/metric_tile_group/MetricTileGroup.js";
43
- import { Tabs as Ee } from "@plumile/ui/atomic/molecules/tabs/Tabs.js";
44
- import { DetailPageTemplate as De } from "@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js";
45
- import { DataTable as Oe } from "@plumile/ui/components/data-table/DataTable.js";
46
- import { LinkButton as ke } from "@plumile/ui/atomic/atoms/button/LinkButton.js";
47
- import { BackofficeKeyValueList as P } from "@plumile/ui/backoffice/molecules/backoffice_key_value_list/BackofficeKeyValueList.js";
48
- import { BackofficeRelationsMenu as Ae } from "@plumile/ui/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js";
49
- import { BackofficeScopeStack as je } from "@plumile/ui/backoffice/molecules/backoffice_scope_stack/BackofficeScopeStack.js";
50
- import { ChatCheckSvg as F } from "@plumile/ui/icons/ChatCheckSvg.js";
51
- import { KeyOffSvg as I } from "@plumile/ui/icons/KeyOffSvg.js";
52
- import { KeySvg as L } from "@plumile/ui/icons/KeySvg.js";
53
- import { LockOpenSvg as R } from "@plumile/ui/icons/LockOpenSvg.js";
54
- import { LockSvg as z } from "@plumile/ui/icons/LockSvg.js";
55
- import { RobotCheckSvg as B } from "@plumile/ui/icons/RobotCheckSvg.js";
56
- import { RobotXSvg as V } from "@plumile/ui/icons/RobotXSvg.js";
57
- import { RocketOffSvg as H } from "@plumile/ui/icons/RocketOffSvg.js";
58
- import { RocketSvg as U } from "@plumile/ui/icons/RocketSvg.js";
59
- import { SettingsCheckSvg as W } from "@plumile/ui/icons/SettingsCheckSvg.js";
15
+ import { BackofficeEntityDetailScaffold as p } from "../components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js";
16
+ import { useBackofficeFormats as m } from "../i18n/useBackofficeFormats.js";
17
+ import { useRelayEnvironment as ne } from "../relay/useRelayEnvironment.js";
18
+ import { resolveVisibleDetailPages as h } from "./detail/pageResolution.js";
19
+ import { useBackofficeEntityDetailLayoutContext as g } from "./detail/BackofficeEntityDetailLayoutContext.js";
20
+ import { BackofficeRedirect as _ } from "./BackofficeRedirect.js";
21
+ import { extractMutationPayload as re, isFormMutationAction as v, isMutationAction as ie, isRouteAction as ae, resolveLabel as y } from "./BackofficeEntityDetailPage.helpers.js";
22
+ import { headerActions as oe, headerBlock as se, headerMeta as ce, headerMetaList as le } from "./backofficeEntityDetailPage.css.js";
23
+ import { buildTabsItems as ue } from "./detail/buildTabsItems.js";
24
+ import { buildFieldItems as de, renderBlocks as fe, resolveHeaderItems as pe } from "./BackofficeEntityDetailPage.view-helpers.js";
25
+ import { Suspense as b, useContext as x, useMemo as S, useState as C } from "react";
26
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
27
+ import { useTranslation as D } from "react-i18next";
28
+ import { Button as O } from "@plumile/ui/atomic/atoms/button/Button.js";
29
+ import { commitMutation as me, useFragment as k, useLazyLoadQuery as A, usePreloadedQuery as j } from "react-relay";
30
+ import { useToast as M } from "@plumile/ui/atomic/molecules/toast/ToastProvider.js";
31
+ import N from "@plumile/router/routing/RoutingContext.js";
32
+ import { FormattedDate as P } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
33
+ import { BACKOFFICE_DATE_TIME_OPTIONS as F } from "@plumile/backoffice-core/constants.js";
34
+ import I from "@plumile/router/routing/Link.js";
35
+ import { Tag as L } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
36
+ import { buildBackofficeFallbackListHref as he, buildBackofficeListHref as ge, buildBackofficeListLink as _e } from "@plumile/backoffice-core/state/buildListHref.js";
37
+ import { BackofficeDetailSection as R } from "@plumile/ui/backoffice/molecules/backoffice_detail_section/BackofficeDetailSection.js";
38
+ import { BackofficePayloadViewer as ve } from "@plumile/ui/backoffice/molecules/backoffice_payload_viewer/BackofficePayloadViewer.js";
39
+ import { setWhereValue as ye } from "@plumile/backoffice-core/filters/where.js";
40
+ import { BackofficePageHeader as be } from "@plumile/ui/backoffice/molecules/backoffice_page_header/BackofficePageHeader.js";
41
+ import { AuditTimeline as xe } from "@plumile/ui/backoffice/organisms/audit_timeline/AuditTimeline.js";
42
+ import { MetricCard as Se } from "@plumile/ui/components/dashboard/metric_card/MetricCard.js";
43
+ import { MetricTileGroup as Ce } from "@plumile/ui/components/dashboard/metric_tile_group/MetricTileGroup.js";
44
+ import { Tabs as we } from "@plumile/ui/atomic/molecules/tabs/Tabs.js";
45
+ import { DetailPageTemplate as Te } from "@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js";
46
+ import { DataTable as Ee } from "@plumile/ui/components/data-table/DataTable.js";
47
+ import { LinkButton as De } from "@plumile/ui/atomic/atoms/button/LinkButton.js";
48
+ import { BackofficeKeyValueList as z } from "@plumile/ui/backoffice/molecules/backoffice_key_value_list/BackofficeKeyValueList.js";
49
+ import { BackofficeRelationsMenu as Oe } from "@plumile/ui/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js";
50
+ import { BackofficeScopeStack as ke } from "@plumile/ui/backoffice/molecules/backoffice_scope_stack/BackofficeScopeStack.js";
51
+ import { ChatCheckSvg as B } from "@plumile/ui/icons/ChatCheckSvg.js";
52
+ import { KeyOffSvg as Ae } from "@plumile/ui/icons/KeyOffSvg.js";
53
+ import { KeySvg as je } from "@plumile/ui/icons/KeySvg.js";
54
+ import { LockOpenSvg as Me } from "@plumile/ui/icons/LockOpenSvg.js";
55
+ import { LockSvg as Ne } from "@plumile/ui/icons/LockSvg.js";
56
+ import { RobotCheckSvg as V } from "@plumile/ui/icons/RobotCheckSvg.js";
57
+ import { RobotXSvg as H } from "@plumile/ui/icons/RobotXSvg.js";
58
+ import { RocketOffSvg as U } from "@plumile/ui/icons/RocketOffSvg.js";
59
+ import { RocketSvg as W } from "@plumile/ui/icons/RocketSvg.js";
60
+ import { SettingsCheckSvg as Pe } from "@plumile/ui/icons/SettingsCheckSvg.js";
60
61
  import { SettingsXSvg as G } from "@plumile/ui/icons/SettingsXSvg.js";
61
- import { ShieldLockSvg as K } from "@plumile/ui/icons/ShieldLockSvg.js";
62
- import { ShieldOffSvg as Me } from "@plumile/ui/icons/ShieldOffSvg.js";
63
- import { XBadgeSvg as q } from "@plumile/ui/icons/XBadgeSvg.js";
62
+ import { ShieldLockSvg as Fe } from "@plumile/ui/icons/ShieldLockSvg.js";
63
+ import { ShieldOffSvg as K } from "@plumile/ui/icons/ShieldOffSvg.js";
64
+ import { XBadgeSvg as Ie } from "@plumile/ui/icons/XBadgeSvg.js";
64
65
  //#region src/pages/BackofficeEntityDetailPage.tsx
65
- var Ne = (e) => {
66
+ var q = "store-or-network", J = ({ count: e, node: t, relationValue: n }) => {
67
+ let r = A(e.query, e.getVariables(t, n), { fetchPolicy: q }), i = e.getCount(r);
68
+ return i == null ? null : /* @__PURE__ */ T(w, { children: i });
69
+ }, Le = ({ count: e, node: t, relationValue: n }) => e == null ? null : /* @__PURE__ */ T(r, {
70
+ fallback: () => null,
71
+ children: /* @__PURE__ */ T(b, {
72
+ fallback: null,
73
+ children: /* @__PURE__ */ T(J, {
74
+ count: e,
75
+ node: t,
76
+ relationValue: n
77
+ })
78
+ })
79
+ }), Re = (e) => {
66
80
  switch (e) {
67
- case "shield-lock": return /* @__PURE__ */ x(K, {
81
+ case "shield-lock": return /* @__PURE__ */ T(Fe, {
68
82
  width: 14,
69
83
  height: 14,
70
84
  "aria-hidden": "true"
71
85
  });
72
- case "shield-off": return /* @__PURE__ */ x(Me, {
86
+ case "shield-off": return /* @__PURE__ */ T(K, {
73
87
  width: 14,
74
88
  height: 14,
75
89
  "aria-hidden": "true"
76
90
  });
77
- case "settings-check": return /* @__PURE__ */ x(W, {
91
+ case "settings-check": return /* @__PURE__ */ T(Pe, {
78
92
  width: 14,
79
93
  height: 14,
80
94
  "aria-hidden": "true"
81
95
  });
82
- case "settings-x": return /* @__PURE__ */ x(G, {
96
+ case "settings-x": return /* @__PURE__ */ T(G, {
83
97
  width: 14,
84
98
  height: 14,
85
99
  "aria-hidden": "true"
86
100
  });
87
- case "x-badge": return /* @__PURE__ */ x(q, {
101
+ case "x-badge": return /* @__PURE__ */ T(Ie, {
88
102
  width: 14,
89
103
  height: 14,
90
104
  "aria-hidden": "true"
91
105
  });
92
- case "chat-check": return /* @__PURE__ */ x(F, {
106
+ case "chat-check": return /* @__PURE__ */ T(B, {
93
107
  width: 14,
94
108
  height: 14,
95
109
  "aria-hidden": "true"
96
110
  });
97
- case "key": return /* @__PURE__ */ x(L, {
111
+ case "key": return /* @__PURE__ */ T(je, {
98
112
  width: 14,
99
113
  height: 14,
100
114
  "aria-hidden": "true"
101
115
  });
102
- case "key-off": return /* @__PURE__ */ x(I, {
116
+ case "key-off": return /* @__PURE__ */ T(Ae, {
103
117
  width: 14,
104
118
  height: 14,
105
119
  "aria-hidden": "true"
106
120
  });
107
- case "lock": return /* @__PURE__ */ x(z, {
121
+ case "lock": return /* @__PURE__ */ T(Ne, {
108
122
  width: 14,
109
123
  height: 14,
110
124
  "aria-hidden": "true"
111
125
  });
112
- case "lock-open": return /* @__PURE__ */ x(R, {
126
+ case "lock-open": return /* @__PURE__ */ T(Me, {
113
127
  width: 14,
114
128
  height: 14,
115
129
  "aria-hidden": "true"
116
130
  });
117
- case "robot-check": return /* @__PURE__ */ x(B, {
131
+ case "robot-check": return /* @__PURE__ */ T(V, {
118
132
  width: 14,
119
133
  height: 14,
120
134
  "aria-hidden": "true"
121
135
  });
122
- case "robot-x": return /* @__PURE__ */ x(V, {
136
+ case "robot-x": return /* @__PURE__ */ T(H, {
123
137
  width: 14,
124
138
  height: 14,
125
139
  "aria-hidden": "true"
126
140
  });
127
- case "rocket": return /* @__PURE__ */ x(U, {
141
+ case "rocket": return /* @__PURE__ */ T(W, {
128
142
  width: 14,
129
143
  height: 14,
130
144
  "aria-hidden": "true"
131
145
  });
132
- case "rocket-off": return /* @__PURE__ */ x(H, {
146
+ case "rocket-off": return /* @__PURE__ */ T(U, {
133
147
  width: 14,
134
148
  height: 14,
135
149
  "aria-hidden": "true"
136
150
  });
137
151
  default: throw Error(`Unsupported flag icon: ${String(e)}`);
138
152
  }
139
- }, Pe = (e) => {
153
+ }, ze = (e) => {
140
154
  if (e.presentation?.desktop === "secondary" || e.presentation?.group === "scope" || e.presentation?.group === "status") return "secondary";
141
155
  let t = e.fields?.map((e) => e.presentation?.group) ?? [];
142
156
  return t.length > 0 && t.every((e) => e === "scope" || e === "status") || e.placement === "side" || e.placement === "secondary" ? "secondary" : "primary";
143
- }, Fe = ({ config: F, prepared: I }) => {
144
- let { t: L } = C(), { t: R } = e(), { formatNumber: z, formatCurrency: B, formatCurrencyTitle: V, formatPercent: H } = f(), { entities: U, entityRegistry: W } = n(), { layoutView: G } = m(), K = v(O), Me = re(), q = D(), [Fe, J] = b({}), [Ie, Le] = b(null), Y = p({
145
- mainPage: F.pages.mainPage,
146
- subPages: F.pages.subPages,
147
- activePagePath: I.pagePath,
148
- node: G
149
- }), X = Y.activePage ?? F.pages.mainPage, Re = Y.pages.length > 0 ? Y.pages : [F.pages.mainPage], Z = (e, t) => {
150
- J((n) => n[e] === t ? n : {
157
+ }, Y = ({ config: r, prepared: b }) => {
158
+ let { t: A } = D(), { t: B } = e(), { formatNumber: Ae, formatCurrency: je, formatCurrencyTitle: Me, formatPercent: Ne } = m(), { entities: V, entityRegistry: H } = n(), { layoutView: U } = g(), W = x(N), Pe = ne(), G = M(), [Fe, K] = C({}), [Ie, q] = C(null), J = h({
159
+ mainPage: r.pages.mainPage,
160
+ subPages: r.pages.subPages,
161
+ activePagePath: b.pagePath,
162
+ node: U
163
+ }), Y = J.activePage ?? r.pages.mainPage, X = J.pages.length > 0 ? J.pages : [r.pages.mainPage], Z = (e, t) => {
164
+ K((n) => n[e] === t ? n : {
151
165
  ...n,
152
166
  [e]: t
153
167
  });
154
- }, { page: Q } = F, ze = E(Q.query, I.pageQuery), $ = Q.resolveNode(ze, {
155
- id: I.id,
156
- detailId: I.detailId
157
- }), Be = $ != null, Ve = T(Q.fragment, $), He = y(() => Object.fromEntries(Q.content.flatMap((e) => e.kind === "fieldSet" ? e.fields.flatMap((e) => e.type === "relation" ? [e.relation.target] : []) : []).flatMap((e) => {
158
- let t = U[e];
168
+ }, { page: Q } = r, Be = j(Q.query, b.pageQuery), $ = Q.resolveNode(Be, {
169
+ id: b.id,
170
+ detailId: b.detailId
171
+ }), Ve = $ != null, He = k(Q.fragment, $), Ue = S(() => Object.fromEntries(Q.content.flatMap((e) => e.kind === "fieldSet" ? e.fields.flatMap((e) => e.type === "relation" ? [e.relation.target] : []) : []).flatMap((e) => {
172
+ let t = V[e];
159
173
  return t?.hasList === !0 ? [[e, t.routes.list]] : [];
160
- })), [U, Q.content]);
161
- return Be ? /* @__PURE__ */ x(ne, {
162
- node: Ve,
174
+ })), [V, Q.content]);
175
+ return Ve ? /* @__PURE__ */ T(p, {
176
+ node: He,
163
177
  render: (e) => {
164
- let n = Q.toView(e), ne = de({
165
- pages: Re,
166
- id: I.id,
167
- tApp: L,
168
- detailPageHref: F.routes.detailPage
169
- }), f = (e, t) => {
170
- let n = U[e];
178
+ let n = Q.toView(e), p = ue({
179
+ pages: X,
180
+ id: b.id,
181
+ tApp: A,
182
+ detailPageHref: r.routes.detailPage
183
+ }), m = (e, t) => {
184
+ let n = V[e];
171
185
  return n == null ? null : n.routes.detail(t);
172
- }, re = ({ id: e, label: t, count: n, relation: r, listRoute: i, value: a, where: o }) => {
173
- let { target: s, filterId: c, whereKey: l, path: u } = r, d = W.getLoadedListEntity(s);
186
+ }, ne = ({ id: e, label: t, count: r, relation: i, listRoute: a, value: o, where: s }) => {
187
+ let { target: c, filterId: l, whereKey: u, path: d } = i, f = H.getLoadedListEntity(c);
174
188
  return {
175
189
  id: e,
176
190
  label: t,
177
- count: n,
178
- href: d == null ? _e(i, o, [{
179
- id: c ?? (u == null ? l : `${l}.${u.join(".")}`),
180
- value: a
181
- }]) : ve(d.config, { where: o }),
191
+ count: Le({
192
+ count: r,
193
+ node: n,
194
+ relationValue: o
195
+ }),
196
+ href: f == null ? he(a, s, [{
197
+ id: l ?? (d == null ? u : `${u}.${d.join(".")}`),
198
+ value: o
199
+ }]) : ge(f.config, { where: s }),
182
200
  onClick: async (e) => {
183
- if (K == null || e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
201
+ if (W == null || e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
184
202
  e.preventDefault();
185
- let t = ye((await W.loadListEntity(s)).config, { where: o });
186
- K.history.push({
203
+ let t = _e((await H.loadListEntity(c)).config, { where: s });
204
+ W.history.push({
187
205
  pathname: t.pathname,
188
206
  search: t.search === "" ? "" : `?${t.search}`,
189
207
  hash: ""
190
208
  });
191
209
  }
192
210
  };
193
- }, p = me(F.header, G, {
194
- tApp: L,
195
- t: R,
196
- resolveEntityHref: f,
197
- renderLink: (e, t) => /* @__PURE__ */ x(j, {
211
+ }, h = pe(r.header, U, {
212
+ tApp: A,
213
+ t: B,
214
+ resolveEntityHref: m,
215
+ renderLink: (e, t) => /* @__PURE__ */ T(I, {
198
216
  to: e,
199
217
  children: t
200
218
  }),
201
- renderDate: (e, t) => /* @__PURE__ */ x(k, {
219
+ renderDate: (e, t) => /* @__PURE__ */ T(P, {
202
220
  value: e,
203
- options: A,
221
+ options: F,
204
222
  fallback: t
205
223
  }),
206
- renderTag: (e, t) => /* @__PURE__ */ x(M, {
224
+ renderTag: (e, t) => /* @__PURE__ */ T(L, {
207
225
  tone: e,
208
226
  children: t
209
227
  }),
210
- renderBadgeRow: (e) => /* @__PURE__ */ x(s, { items: e })
211
- }), m = te({
212
- config: F,
213
- tApp: L,
214
- entityId: I.id,
215
- layoutView: G,
216
- pageLabel: X.label(L),
217
- pageId: X.id
218
- }), h = Q.actions ?? [], v = [];
219
- if (h.length > 0) {
220
- let e = h.filter((e) => e.isVisible == null ? !0 : e.isVisible(n));
221
- e.length > 0 && (v = e.map((e) => {
222
- let a = _(e.label, L), o = e.ariaLabel == null ? a : _(e.ariaLabel, L), s = e.variant ?? "secondary", c = e.size ?? "small", l = Fe[e.id] ?? !1, u = l || e.isDisabled?.(n) === !0;
223
- return oe(e) ? /* @__PURE__ */ x(ke, {
228
+ renderBadgeRow: (e) => /* @__PURE__ */ T(c, { items: e })
229
+ }), g = te({
230
+ config: r,
231
+ tApp: A,
232
+ entityId: b.id,
233
+ layoutView: U,
234
+ pageLabel: Y.label(A),
235
+ pageId: Y.id
236
+ }), _ = Q.actions ?? [], x = [];
237
+ if (_.length > 0) {
238
+ let e = _.filter((e) => e.isVisible == null ? !0 : e.isVisible(n));
239
+ e.length > 0 && (x = e.map((e) => {
240
+ let r = y(e.label, A), o = e.ariaLabel == null ? r : y(e.ariaLabel, A), s = e.variant ?? "secondary", c = e.size ?? "small", l = Fe[e.id] ?? !1, u = l || e.isDisabled?.(n) === !0;
241
+ return ae(e) ? /* @__PURE__ */ T(De, {
224
242
  to: e.to(n),
225
243
  variant: s,
226
244
  size: c,
227
245
  isDisabled: u,
228
246
  "aria-label": o,
229
- children: a
230
- }, e.id) : g(e) ? /* @__PURE__ */ x(w, {
247
+ children: r
248
+ }, e.id) : v(e) ? /* @__PURE__ */ T(O, {
231
249
  type: "button",
232
250
  variant: s,
233
251
  size: c,
234
252
  isLoading: !1,
235
253
  disabled: u,
236
254
  onClick: () => {
237
- Le(e.id);
255
+ q(e.id);
238
256
  },
239
257
  "aria-label": o,
240
- children: a
241
- }, e.id) : ae(e) ? /* @__PURE__ */ x(w, {
258
+ children: r
259
+ }, e.id) : ie(e) ? /* @__PURE__ */ T(O, {
242
260
  type: "button",
243
261
  variant: s,
244
262
  size: c,
@@ -246,48 +264,48 @@ var Ne = (e) => {
246
264
  disabled: u,
247
265
  onClick: () => {
248
266
  if (l) return;
249
- let a = e.getVariables(n);
250
- Z(e.id, !0), ge(Me, {
267
+ let r = e.getVariables(n);
268
+ Z(e.id, !0), me(Pe, {
251
269
  mutation: e.mutation,
252
- variables: a,
270
+ variables: r,
253
271
  updater: (t) => {
254
272
  e.updater?.(t, n);
255
273
  },
256
- onCompleted: (a) => {
274
+ onCompleted: (r) => {
257
275
  Z(e.id, !1);
258
- let o = ie(a);
276
+ let o = re(r);
259
277
  if (o != null) {
260
- let i = R("actions.form.errors.invalidPayload");
261
- e.toasts?.error?.message == null ? e.toasts?.error?.title != null && (i = _(e.toasts.error.title, L)) : i = _(e.toasts.error.message, L);
278
+ let r = B("actions.form.errors.invalidPayload");
279
+ e.toasts?.error?.message == null ? e.toasts?.error?.title != null && (r = y(e.toasts.error.title, A)) : r = y(e.toasts.error.message, A);
262
280
  let a = t(o, {
263
- defaultErrorMessage: i,
281
+ defaultErrorMessage: r,
264
282
  mapReason: (t) => {
265
283
  let r = e.mapErrorReason?.(t, n);
266
- return r == null ? null : typeof r == "function" ? _(r, L) : String(r);
284
+ return r == null ? null : typeof r == "function" ? y(r, A) : String(r);
267
285
  }
268
286
  });
269
287
  if (!a.ok) {
270
288
  let t = Error(a.message);
271
289
  if (e.onError?.(t, n), e.toasts?.error != null) {
272
- let t = r(e.toasts.error, L);
273
- q.error(t.title, t.message);
290
+ let t = i(e.toasts.error, A);
291
+ G.error(t.title, t.message);
274
292
  }
275
293
  return;
276
294
  }
277
295
  }
278
- if (e.onCompleted?.(a, n), e.toasts?.success != null) {
279
- let t = r(e.toasts.success, L), o = i({
296
+ if (e.onCompleted?.(r, n), e.toasts?.success != null) {
297
+ let t = i(e.toasts.success, A), o = a({
280
298
  toast: e.toasts.success,
281
- response: a,
299
+ response: r,
282
300
  node: n,
283
- tApp: L,
284
- entities: U,
285
- defaultLabel: R("actions.view"),
301
+ tApp: A,
302
+ entities: V,
303
+ defaultLabel: B("actions.view"),
286
304
  navigateTo: (e) => {
287
- K?.history.push({ pathname: e });
305
+ W?.history.push({ pathname: e });
288
306
  }
289
307
  });
290
- q.push({
308
+ G.push({
291
309
  kind: "info",
292
310
  title: t.title,
293
311
  message: t.message,
@@ -297,61 +315,61 @@ var Ne = (e) => {
297
315
  },
298
316
  onError: (t) => {
299
317
  if (Z(e.id, !1), e.onError?.(t, n), e.toasts?.error != null) {
300
- let t = r(e.toasts.error, L);
301
- q.error(t.title, t.message);
318
+ let t = i(e.toasts.error, A);
319
+ G.error(t.title, t.message);
302
320
  }
303
321
  }
304
322
  });
305
323
  },
306
324
  "aria-label": o,
307
- children: a
325
+ children: r
308
326
  }, e.id) : null;
309
327
  }));
310
328
  }
311
- let y = h.find((e) => e.id === Ie), { content: b } = Q, C = [], T = [], E = [];
312
- b.forEach((e, t) => {
313
- let r = Pe(e) === "secondary" ? T : C;
329
+ let S = _.find((e) => e.id === Ie), { content: C } = Q, D = [], k = [], j = [];
330
+ C.forEach((e, t) => {
331
+ let r = ze(e) === "secondary" ? k : D;
314
332
  if (e.kind === "fieldSet") {
315
- let i = _(e.title, L), a = e.description == null ? void 0 : _(e.description, L), { items: o, relationItems: u, customNodes: d } = fe(e.fields, n, {
316
- tApp: L,
317
- t: R,
318
- resolveEntityHref: f,
319
- formatNumber: z,
320
- formatCurrency: B,
321
- formatCurrencyTitle: V,
322
- formatPercent: H,
323
- relationEntityListRoutes: He,
324
- resolveRelationItem: re,
325
- setWhereValue: xe,
326
- renderTag: (e, t) => /* @__PURE__ */ x(M, {
333
+ let i = y(e.title, A), a = e.description == null ? void 0 : y(e.description, A), { items: o, relationItems: s, customNodes: d } = de(e.fields, n, {
334
+ tApp: A,
335
+ t: B,
336
+ resolveEntityHref: m,
337
+ formatNumber: Ae,
338
+ formatCurrency: je,
339
+ formatCurrencyTitle: Me,
340
+ formatPercent: Ne,
341
+ relationEntityListRoutes: Ue,
342
+ resolveRelationItem: ne,
343
+ setWhereValue: ye,
344
+ renderTag: (e, t) => /* @__PURE__ */ T(L, {
327
345
  tone: e,
328
346
  children: t
329
347
  }),
330
- renderBadgeRow: (e) => /* @__PURE__ */ x(s, { items: e }),
331
- renderDate: (e, t) => /* @__PURE__ */ x(k, {
348
+ renderBadgeRow: (e) => /* @__PURE__ */ T(c, { items: e }),
349
+ renderDate: (e, t) => /* @__PURE__ */ T(P, {
332
350
  value: e,
333
- options: A,
351
+ options: F,
334
352
  fallback: t
335
353
  }),
336
- renderFlagTag: (e) => /* @__PURE__ */ x(c, {
354
+ renderFlagTag: (e) => /* @__PURE__ */ T(l, {
337
355
  tone: e.tone,
338
- icon: e.iconName == null ? void 0 : Ne(e.iconName),
356
+ icon: e.iconName == null ? void 0 : Re(e.iconName),
339
357
  label: e.label
340
358
  }),
341
- renderLink: (e, t) => /* @__PURE__ */ x(j, {
359
+ renderLink: (e, t) => /* @__PURE__ */ T(I, {
342
360
  to: e,
343
361
  children: t
344
362
  }),
345
- renderTaggedValue: (e, t) => /* @__PURE__ */ x(l, {
363
+ renderTaggedValue: (e, t) => /* @__PURE__ */ T(u, {
346
364
  tag: e,
347
365
  value: t
348
366
  }),
349
- wrapCustomNode: (e, t) => /* @__PURE__ */ x("div", { children: t }, e)
367
+ wrapCustomNode: (e, t) => /* @__PURE__ */ T("div", { children: t }, e)
350
368
  });
351
- if (u.forEach((e) => {
352
- E.some((t) => t.id === e.id) || E.push(e);
369
+ if (s.forEach((e) => {
370
+ j.some((t) => t.id === e.id) || j.push(e);
353
371
  }), !(o.length > 0 || d.length > 0)) return;
354
- r.push(/* @__PURE__ */ x(N, {
372
+ r.push(/* @__PURE__ */ T(R, {
355
373
  title: i,
356
374
  description: a,
357
375
  items: o.length > 0 ? o : void 0,
@@ -359,73 +377,73 @@ var Ne = (e) => {
359
377
  }, `${i}-${t}`));
360
378
  return;
361
379
  }
362
- let i = pe([e], n, {
363
- tApp: L,
364
- t: R,
365
- resolveEntityHref: f,
380
+ let i = fe([e], n, {
381
+ tApp: A,
382
+ t: B,
383
+ resolveEntityHref: m,
366
384
  keyPrefix: String(t),
367
- renderLink: (e, t) => /* @__PURE__ */ x(j, {
385
+ renderLink: (e, t) => /* @__PURE__ */ T(I, {
368
386
  to: e,
369
387
  children: t
370
388
  }),
371
- renderDate: (e, t) => /* @__PURE__ */ x(k, {
389
+ renderDate: (e, t) => /* @__PURE__ */ T(P, {
372
390
  value: e,
373
- options: A,
391
+ options: F,
374
392
  fallback: t
375
393
  }),
376
- renderTag: (e, t) => /* @__PURE__ */ x(M, {
394
+ renderTag: (e, t) => /* @__PURE__ */ T(L, {
377
395
  tone: e,
378
396
  children: t
379
397
  }),
380
- renderMetricGroup: ({ key: e, title: t, description: n, density: r, items: i }) => /* @__PURE__ */ x(N, {
398
+ renderMetricGroup: ({ key: e, title: t, description: n, density: r, items: i }) => /* @__PURE__ */ T(R, {
381
399
  title: t,
382
400
  description: n,
383
- children: i.length > 0 && /* @__PURE__ */ x(Te, {
401
+ children: i.length > 0 && /* @__PURE__ */ T(Ce, {
384
402
  density: r ?? "comfortable",
385
403
  minColumn: "180",
386
- children: i.map((e) => /* @__PURE__ */ x(we, {
404
+ children: i.map((e) => /* @__PURE__ */ T(Se, {
387
405
  label: e.label,
388
406
  value: e.value,
389
407
  hint: e.hint,
390
408
  tone: e.tone ?? "neutral",
391
409
  density: r ?? "comfortable",
392
410
  copyValue: e.copyValue,
393
- copyLabel: R("common.actions.copy"),
394
- copiedLabel: R("common.actions.copied")
411
+ copyLabel: B("common.actions.copy"),
412
+ copiedLabel: B("common.actions.copied")
395
413
  }, e.id))
396
414
  })
397
415
  }, e),
398
- renderTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ x(u, {
416
+ renderTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ T(d, {
399
417
  title: t,
400
418
  description: n,
401
419
  events: r
402
420
  }, e),
403
- renderAuditTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ x(N, {
421
+ renderAuditTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ T(R, {
404
422
  title: t,
405
423
  description: n,
406
- children: /* @__PURE__ */ x(Ce, { events: r })
424
+ children: /* @__PURE__ */ T(xe, { events: r })
407
425
  }, e),
408
- renderRelations: ({ key: e, title: t, items: n }) => /* @__PURE__ */ x(d, {
426
+ renderRelations: ({ key: e, title: t, items: n }) => /* @__PURE__ */ T(f, {
409
427
  title: t,
410
428
  items: n
411
429
  }, e),
412
- renderContextStack: ({ key: e, title: t, items: n }) => /* @__PURE__ */ x(je, {
430
+ renderContextStack: ({ key: e, title: t, items: n }) => /* @__PURE__ */ T(ke, {
413
431
  title: t,
414
432
  items: n
415
433
  }, e),
416
- renderCustomSection: (e, t, n) => /* @__PURE__ */ x(N, {
434
+ renderCustomSection: (e, t, n) => /* @__PURE__ */ T(R, {
417
435
  title: t,
418
436
  children: n
419
437
  }, e),
420
- wrapCustomNode: (e, t) => /* @__PURE__ */ x("div", { children: t }, e),
421
- resolveTableColumns: (e) => o(e, {
422
- tApp: L,
423
- t: R
438
+ wrapCustomNode: (e, t) => /* @__PURE__ */ T("div", { children: t }, e),
439
+ resolveTableColumns: (e) => s(e, {
440
+ tApp: A,
441
+ t: B
424
442
  }),
425
- renderTable: ({ key: e, title: t, description: n, columns: r, rows: i }) => /* @__PURE__ */ x(N, {
443
+ renderTable: ({ key: e, title: t, description: n, columns: r, rows: i }) => /* @__PURE__ */ T(R, {
426
444
  title: t,
427
445
  description: n,
428
- children: /* @__PURE__ */ x(Oe, {
446
+ children: /* @__PURE__ */ T(Ee, {
429
447
  columns: r,
430
448
  rows: i,
431
449
  getRowId: (e, t) => {
@@ -437,87 +455,87 @@ var Ne = (e) => {
437
455
  }
438
456
  })
439
457
  }, e),
440
- renderPayload: ({ key: e, title: t, description: n, content: r, format: i }) => /* @__PURE__ */ x(N, {
458
+ renderPayload: ({ key: e, title: t, description: n, content: r, format: i }) => /* @__PURE__ */ T(R, {
441
459
  title: t,
442
460
  description: n,
443
- children: /* @__PURE__ */ x(be, {
461
+ children: /* @__PURE__ */ T(ve, {
444
462
  content: r,
445
463
  format: i,
446
- emptyState: R("common.notAvailable")
464
+ emptyState: B("common.notAvailable")
447
465
  })
448
466
  }, e),
449
- renderKeyValueListSection: ({ key: e, title: t, description: n, items: r }) => /* @__PURE__ */ x(N, {
467
+ renderKeyValueListSection: ({ key: e, title: t, description: n, items: r }) => /* @__PURE__ */ T(R, {
450
468
  title: t,
451
469
  description: n,
452
- children: /* @__PURE__ */ x(P, { items: r })
470
+ children: /* @__PURE__ */ T(z, { items: r })
453
471
  }, e)
454
472
  })[0];
455
473
  i != null && r.push(i);
456
474
  });
457
- let D = E.length > 0 ? /* @__PURE__ */ x(Ae, {
458
- label: R("relations.menu.label"),
459
- items: E
460
- }) : null, O = v.length > 0 || D != null ? /* @__PURE__ */ S("div", {
461
- className: se,
462
- children: [v.length > 0 && /* @__PURE__ */ x("div", {
475
+ let M = j.length > 0 ? /* @__PURE__ */ T(Oe, {
476
+ label: B("relations.menu.label"),
477
+ items: j
478
+ }) : null, N = x.length > 0 || M != null ? /* @__PURE__ */ E("div", {
479
+ className: oe,
480
+ children: [x.length > 0 && /* @__PURE__ */ T("div", {
463
481
  className: "txvbqbfpn txvbqbey txvbqblsh txvbqbhdl txvbqbh7g",
464
- children: v
465
- }), D != null && /* @__PURE__ */ x("div", {
482
+ children: x
483
+ }), M != null && /* @__PURE__ */ T("div", {
466
484
  className: "txvbqbfpn txvbqbey txvbqb10mr txvbqbb49 txvbqbbkc txvbqb2sj txvbqb7tt",
467
- children: D
485
+ children: M
468
486
  })]
469
- }) : void 0, J = p.status != null || p.badges != null ? /* @__PURE__ */ S("div", {
487
+ }) : void 0, K = h.status != null || h.badges != null ? /* @__PURE__ */ E("div", {
488
+ className: ce,
489
+ children: [h.status, h.badges]
490
+ }) : void 0, J = h.items != null && h.items.length > 0 ? /* @__PURE__ */ T("div", {
470
491
  className: le,
471
- children: [p.status, p.badges]
472
- }) : void 0, Y = p.items != null && p.items.length > 0 ? /* @__PURE__ */ x("div", {
473
- className: ue,
474
- children: /* @__PURE__ */ x(P, { items: p.items })
475
- }) : null, ze = T.length > 0, $ = null;
476
- return Re.length > 1 && ($ = /* @__PURE__ */ x(Ee, {
477
- items: ne,
478
- activeId: X.id,
492
+ children: /* @__PURE__ */ T(z, { items: h.items })
493
+ }) : null, Be = k.length > 0, $ = null;
494
+ return X.length > 1 && ($ = /* @__PURE__ */ T(we, {
495
+ items: p,
496
+ activeId: Y.id,
479
497
  variant: "underline"
480
- })), /* @__PURE__ */ S(ee, {
481
- breadcrumb: m,
482
- children: [/* @__PURE__ */ x(De, {
483
- headerNode: /* @__PURE__ */ S("div", {
484
- className: ce,
485
- children: [/* @__PURE__ */ x(Se, {
486
- title: p.title,
487
- subtitle: p.subtitle,
488
- actions: O,
489
- meta: J
490
- }), Y]
498
+ })), /* @__PURE__ */ E(ee, {
499
+ breadcrumb: g,
500
+ children: [/* @__PURE__ */ T(Te, {
501
+ headerNode: /* @__PURE__ */ E("div", {
502
+ className: se,
503
+ children: [/* @__PURE__ */ T(be, {
504
+ title: h.title,
505
+ subtitle: h.subtitle,
506
+ actions: N,
507
+ meta: K
508
+ }), J]
491
509
  }),
492
510
  tabsNode: $,
493
- sidePanel: ze ? /* @__PURE__ */ x(he, { children: T }) : void 0,
511
+ sidePanel: Be ? /* @__PURE__ */ T(w, { children: k }) : void 0,
494
512
  sidePanelVariant: "plain",
495
513
  headerDensity: "compact",
496
- children: /* @__PURE__ */ x(he, { children: C })
497
- }), y != null && g(y) && /* @__PURE__ */ x(a, {
514
+ children: /* @__PURE__ */ T(w, { children: D })
515
+ }), S != null && v(S) && /* @__PURE__ */ T(o, {
498
516
  isOpen: !0,
499
- action: y,
517
+ action: S,
500
518
  node: n,
501
519
  onClose: () => {
502
- Le(null);
520
+ q(null);
503
521
  }
504
522
  })]
505
523
  });
506
524
  }
507
- }) : /* @__PURE__ */ x(h, { to: F.routes.list });
508
- }, J = ({ config: e, prepared: t }) => {
509
- let { layoutView: n } = m(), r = p({
525
+ }) : /* @__PURE__ */ T(_, { to: r.routes.list });
526
+ }, X = ({ config: e, prepared: t }) => {
527
+ let { layoutView: n } = g(), r = h({
510
528
  mainPage: e.pages.mainPage,
511
529
  subPages: e.pages.subPages,
512
530
  activePagePath: t.pagePath,
513
531
  node: n
514
532
  });
515
- return !r.hasVisiblePages || r.activePage == null ? /* @__PURE__ */ x(h, { to: e.routes.list }) : r.activePage.id === t.pageId ? /* @__PURE__ */ x(Fe, {
533
+ return !r.hasVisiblePages || r.activePage == null ? /* @__PURE__ */ T(_, { to: e.routes.list }) : r.activePage.id === t.pageId ? /* @__PURE__ */ T(Y, {
516
534
  config: t.pageConfig,
517
535
  prepared: t
518
- }) : /* @__PURE__ */ x(h, { to: e.routes.detailPage(t.id, r.activePage.id) });
536
+ }) : /* @__PURE__ */ T(_, { to: e.routes.detailPage(t.id, r.activePage.id) });
519
537
  };
520
538
  //#endregion
521
- export { J as BackofficeEntityDetailPage, J as default };
539
+ export { X as BackofficeEntityDetailPage, X as default };
522
540
 
523
541
  //# sourceMappingURL=BackofficeEntityDetailPage.js.map