@declarion/react 0.87.0 → 0.88.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist-lib/app.js +28 -28
  2. package/dist-lib/components/actions/ActionButton.js +86 -85
  3. package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
  4. package/dist-lib/components/actions/ActionRunner.js +47 -47
  5. package/dist-lib/components/actions/ObjectActionBar.js +9 -9
  6. package/dist-lib/components/actions/RowActionsKebab.js +19 -19
  7. package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
  8. package/dist-lib/components/chrome/AssociationTabs.js +21 -21
  9. package/dist-lib/components/chrome/RecordHeader.js +33 -40
  10. package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
  11. package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
  12. package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
  13. package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
  14. package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
  15. package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
  16. package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
  17. package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
  18. package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
  19. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
  20. package/dist-lib/components/fields/FileReferenceField.js +9 -9
  21. package/dist-lib/components/fields/StructureField.js +57 -47
  22. package/dist-lib/components/fields/TimestampField.js +59 -54
  23. package/dist-lib/components/fields/cells/factories/money.js +14 -23
  24. package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
  25. package/dist-lib/components/fields/cells/factories/text.js +18 -3
  26. package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
  27. package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
  28. package/dist-lib/components/layout/Layout.js +306 -361
  29. package/dist-lib/components/layout/Rail.js +42 -41
  30. package/dist-lib/components/layout/Sidebar.js +132 -117
  31. package/dist-lib/components/layout/TabStrip.js +116 -115
  32. package/dist-lib/components/layout/TenantChip.js +47 -54
  33. package/dist-lib/components/layout/TopBar.js +108 -105
  34. package/dist-lib/components/list/InlineEditCell.js +23 -23
  35. package/dist-lib/components/list/QuickPeek.js +65 -66
  36. package/dist-lib/components/pages/DocumentsMenu.js +42 -42
  37. package/dist-lib/components/pages/ExportMenu.js +25 -25
  38. package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
  39. package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
  40. package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
  41. package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
  42. package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
  43. package/dist-lib/components/pages/auth/AuthShell.js +73 -73
  44. package/dist-lib/components/pages/auth/SignIn.js +32 -32
  45. package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
  46. package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
  47. package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
  48. package/dist-lib/components/pages/list/ListHeader.js +19 -19
  49. package/dist-lib/components/pages/list/ListNoRows.js +15 -15
  50. package/dist-lib/components/pages/list/ListToolbar.js +145 -145
  51. package/dist-lib/components/pages/list/useActiveView.js +14 -5
  52. package/dist-lib/components/pages/list/useListQuery.js +121 -81
  53. package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
  54. package/dist-lib/components/pages/list/useRowMenu.js +7 -7
  55. package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
  56. package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
  57. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
  58. package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
  59. package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
  60. package/dist-lib/hooks/useAuth.js +11 -11
  61. package/dist-lib/hooks/useBranding.js +4 -4
  62. package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
  63. package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
  64. package/dist-lib/hooks/useImpersonation.js +6 -6
  65. package/dist-lib/hooks/useMutations.js +23 -23
  66. package/dist-lib/hooks/useObjectStatus.js +5 -5
  67. package/dist-lib/hooks/useParams.js +59 -51
  68. package/dist-lib/hooks/useProperties.js +8 -8
  69. package/dist-lib/hooks/useRowTenant.js +18 -6
  70. package/dist-lib/hooks/useText.js +9 -7
  71. package/dist-lib/hooks/useUiPreferences.js +71 -0
  72. package/dist-lib/index.d.ts +22 -6
  73. package/dist-lib/index.js +127 -126
  74. package/dist-lib/lib/actions.js +116 -84
  75. package/dist-lib/lib/child-config.js +10 -1
  76. package/dist-lib/lib/format-count.js +16 -1
  77. package/dist-lib/lib/language.js +23 -21
  78. package/dist-lib/lib/money-text.js +29 -0
  79. package/dist-lib/lib/profile.js +4 -0
  80. package/dist-lib/lib/role-label.js +8 -0
  81. package/dist-lib/lib/schema-routing.js +34 -14
  82. package/dist-lib/lib/shortcut.js +10 -0
  83. package/dist-lib/lib/timestamp.js +93 -31
  84. package/dist-lib/stores/auth.js +9 -8
  85. package/dist-lib/stores/preferences.js +56 -17
  86. package/dist-lib/testing.d.ts +1 -1
  87. package/dist-lib/testing.js +25 -28
  88. package/dist-lib/types/schema.js +33 -27
  89. package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
  90. package/package.json +1 -1
@@ -1,126 +1,134 @@
1
1
  import { loginPathForRedirectPath as e } from "../../api/auth-redirect.js";
2
2
  import { useEmbed as t } from "../../embed/EmbedContext.js";
3
- import { useAuthStore as n } from "../../stores/auth.js";
4
- import { useSchema as r } from "../../hooks/useSchema.js";
5
- import { Icon as i } from "../primitives/Icons.js";
6
- import { IconBtn as a } from "../primitives/IconBtn.js";
7
- import { useText as o } from "../../hooks/useText.js";
8
- import { useResponsiveMode as s } from "../../hooks/useResponsiveMode.js";
9
- import { Rail as c } from "./Rail.js";
10
- import { useBranding as l, useBrandingIdentity as u } from "../../hooks/useBranding.js";
11
- import { usePreferencesStore as d } from "../../stores/preferences.js";
12
- import { useTabStore as f } from "../../stores/tabs.js";
13
- import { EmbedResizeReporter as p } from "../../embed/EmbedResizeReporter.js";
3
+ import { UI_PREFERENCES_PARAM_CODE as n, usePreferencesStore as r } from "../../stores/preferences.js";
4
+ import { useAuthStore as i } from "../../stores/auth.js";
5
+ import { useSchema as a } from "../../hooks/useSchema.js";
6
+ import { Icon as o } from "../primitives/Icons.js";
7
+ import { IconBtn as s } from "../primitives/IconBtn.js";
8
+ import { useText as c } from "../../hooks/useText.js";
9
+ import { useResponsiveMode as l } from "../../hooks/useResponsiveMode.js";
10
+ import { useEffectiveParam as u } from "../../hooks/useParams.js";
11
+ import { useUiPreferences as d } from "../../hooks/useUiPreferences.js";
12
+ import { Rail as f } from "./Rail.js";
13
+ import { useBrandingIdentity as p } from "../../hooks/useBranding.js";
14
+ import { useTabStore as m } from "../../stores/tabs.js";
15
+ import { EmbedResizeReporter as h } from "../../embed/EmbedResizeReporter.js";
14
16
  import { EmbedDirtyReporter as ee } from "../../embed/EmbedDirtyReporter.js";
15
- import { EmbedHistoryTracker as m } from "../../embed/EmbedHistoryTracker.js";
16
- import { useGlobalLinkInterceptor as te } from "../../embed/useGlobalLinkInterceptor.js";
17
- import { EmbedLocationReporter as ne } from "../../embed/EmbedLocationReporter.js";
18
- import { EmbedUnsavedGuard as re } from "../../embed/EmbedUnsavedGuard.js";
19
- import { useTabNavigate as ie } from "../../hooks/useTabNavigate.js";
20
- import { Sidebar as ae, buildSections as h } from "./Sidebar.js";
21
- import { useImpersonation as oe } from "../../hooks/useImpersonation.js";
22
- import { TopBar as se } from "./TopBar.js";
23
- import { builtInPageTitle as g, useTabTitle as _ } from "../../hooks/useTabTitle.js";
24
- import { TabStrip as ce } from "./TabStrip.js";
25
- import { DirtyTabsCloseDialog as le } from "./DirtyTabsCloseDialog.js";
26
- import { ImpersonationBanner as ue } from "./ImpersonationBanner.js";
27
- import { ImpersonationFrame as de } from "./ImpersonationFrame.js";
28
- import { buildPendingTabClose as fe, tabCloseRoute as pe } from "./tab-close.js";
29
- import { CommandPalette as me } from "./CommandPalette.js";
30
- import { AgentChatPanel as he } from "../agents/AgentChatPanel.js";
31
- import { useSSE as ge } from "../../hooks/useSSE.js";
32
- import { ActionRunnerProvider as _e } from "../actions/ActionRunner.js";
33
- import { startListLayoutCrossTabSync as ve, useListLayoutStore as ye } from "../../stores/list-layout.js";
34
- import { usePageStateRuntime as be } from "../../hooks/usePageStateRuntime.js";
35
- import { AgentOpenFollower as xe } from "../agents/AgentOpenFollower.js";
36
- import { useCurrentLocation as Se } from "../../hooks/useCurrentLocation.js";
37
- import { useBrandingShell as Ce } from "../../hooks/useBrandingChrome.js";
38
- import { useActiveTabFollowsRoute as we } from "../../hooks/useActiveTabFollowsRoute.js";
39
- import { useDocumentTitle as Te } from "../../hooks/useDocumentTitle.js";
40
- import { useCallback as v, useEffect as y, useMemo as Ee, useRef as b, useState as x } from "react";
41
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
42
- import { Outlet as De, useLocation as Oe, useNavigate as ke } from "react-router";
17
+ import { EmbedHistoryTracker as te } from "../../embed/EmbedHistoryTracker.js";
18
+ import { useGlobalLinkInterceptor as ne } from "../../embed/useGlobalLinkInterceptor.js";
19
+ import { EmbedLocationReporter as re } from "../../embed/EmbedLocationReporter.js";
20
+ import { EmbedUnsavedGuard as ie } from "../../embed/EmbedUnsavedGuard.js";
21
+ import { useTabNavigate as ae } from "../../hooks/useTabNavigate.js";
22
+ import { areaRoute as oe, findNavMatch as se } from "../../lib/schema-routing.js";
23
+ import { Sidebar as ce, buildSections as g } from "./Sidebar.js";
24
+ import { useImpersonation as le } from "../../hooks/useImpersonation.js";
25
+ import { TopBar as ue } from "./TopBar.js";
26
+ import { builtInPageTitle as _, useTabTitle as v } from "../../hooks/useTabTitle.js";
27
+ import { TabStrip as de } from "./TabStrip.js";
28
+ import { DirtyTabsCloseDialog as fe } from "./DirtyTabsCloseDialog.js";
29
+ import { ImpersonationBanner as pe } from "./ImpersonationBanner.js";
30
+ import { ImpersonationFrame as me } from "./ImpersonationFrame.js";
31
+ import { buildPendingTabClose as he, tabCloseRoute as ge } from "./tab-close.js";
32
+ import { CommandPalette as _e } from "./CommandPalette.js";
33
+ import { AgentChatPanel as ve } from "../agents/AgentChatPanel.js";
34
+ import { useSSE as ye } from "../../hooks/useSSE.js";
35
+ import { ActionRunnerProvider as be } from "../actions/ActionRunner.js";
36
+ import { startListLayoutCrossTabSync as xe, useListLayoutStore as Se } from "../../stores/list-layout.js";
37
+ import { usePageStateRuntime as Ce } from "../../hooks/usePageStateRuntime.js";
38
+ import { AgentOpenFollower as we } from "../agents/AgentOpenFollower.js";
39
+ import { useCurrentLocation as Te } from "../../hooks/useCurrentLocation.js";
40
+ import { useBrandingShell as Ee } from "../../hooks/useBrandingChrome.js";
41
+ import { useActiveTabFollowsRoute as De } from "../../hooks/useActiveTabFollowsRoute.js";
42
+ import { useDocumentTitle as Oe } from "../../hooks/useDocumentTitle.js";
43
+ import { useCallback as y, useEffect as b, useMemo as ke, useRef as x, useState as S } from "react";
44
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
45
+ import { Outlet as Ae, useLocation as je, useNavigate as Me } from "react-router";
43
46
  //#region src/components/layout/Layout.tsx
44
- var T = "default";
45
- function E() {
46
- let i = o();
47
- te(), be();
48
- let { isAuthenticated: a, isLoading: h, user: g, activeTenant: _ } = n(), S = t(), E = ke(), D = ie(), O = v((e) => D(e, { topLevel: !0 }), [D]), k = Oe(), { data: A } = r(), Le = s(), j = d((e) => e.sidebar), Re = d((e) => e.tabsPosition), M = d((e) => e.aiSurface), ze = d((e) => e.colorScheme), N = d((e) => e.set), Be = d((e) => e.hydrateFromBranding), { branding: Ve } = l(), P = Ce(), F = f((e) => e.tabs), He = f((e) => e.activeTabId), Ue = f((e) => e.closeTabs), We = f((e) => e.switchTab), [I, L] = x(T), [Ge, R] = x(!1), [Ke, qe] = x("default"), [z, B] = x(!1), [Je, V] = x(), [Ye, H] = x(!1), [Xe, U] = x(!1), Ze = b(null), Qe = b(null), [W, G] = x(null), K = M !== "off" && P.isVisible("show_command_palette"), q = M === "panel" || M === "both", $e = M === "command" || M === "both", et = u(), tt = et?.ai_name?.trim() ?? "", J = Le.category === "phone" || Le.category === "tablet", Y = P.isVisible("show_topbar"), nt = !J && P.isVisible("show_rail"), rt = !J && P.isVisible("show_sidebar"), it = !J && P.isVisible("show_tabs"), at = J && P.isVisible("show_sidebar"), ot = J && P.isVisible("show_tabs"), st = Ae(!J && q && z), ct = P.isVisible("show_tenant_switcher"), lt = P.isVisible("show_breadcrumbs"), ut = P.isVisible("show_theme_toggle"), X = v((e = "default") => {
49
- K && (qe(e), R(!0));
50
- }, [K]), Z = v((e) => {
47
+ var E = "default";
48
+ function D() {
49
+ let o = c();
50
+ ne(), Ce();
51
+ let { isAuthenticated: s, isLoading: g, user: _, activeTenant: v } = i(), C = t(), D = Me(), O = ae(), k = y((e) => O(e, { topLevel: !0 }), [O]), A = je(), { data: j } = a(), Re = l(), M = r((e) => e.sidebar), ze = r((e) => e.tabsPosition), N = r((e) => e.aiSurface), Be = r((e) => e.colorScheme), { set: P } = d(), Ve = r((e) => e.hydrateFromParameter), F = u(n), He = F.source && F.source !== "public" ? _?.id : void 0, I = Ee(), L = m((e) => e.tabs), Ue = m((e) => e.activeTabId), We = m((e) => e.closeTabs), Ge = m((e) => e.switchTab), [R, z] = S(E), [Ke, B] = S(!1), [qe, Je] = S("default"), [V, H] = S(!1), [Ye, U] = S(), [Xe, W] = S(!1), [Ze, G] = S(!1), Qe = x(null), $e = x(null), [K, q] = S(null), J = N !== "off" && I.isVisible("show_command_palette"), Y = N === "panel" || N === "both", et = N === "command" || N === "both", tt = p(), nt = tt?.ai_name?.trim() ?? "", X = Re.category === "phone" || Re.category === "tablet", rt = I.isVisible("show_topbar"), it = !X && I.isVisible("show_rail"), at = !X && I.isVisible("show_sidebar"), ot = !X && I.isVisible("show_tabs"), st = X && I.isVisible("show_sidebar"), ct = X && I.isVisible("show_tabs"), lt = Ne(!X && Y && V), ut = I.isVisible("show_tenant_switcher"), dt = I.isVisible("show_breadcrumbs"), ft = I.isVisible("show_theme_toggle"), Z = y((e = "default") => {
52
+ J && (Je(e), B(!0));
53
+ }, [J]), Q = y((e) => {
51
54
  if (e.length === 0) return;
52
- let t = f.getState(), n = !t.activeTabId || e.includes(t.activeTabId), r = Ue(e);
55
+ let t = m.getState(), n = !t.activeTabId || e.includes(t.activeTabId), r = We(e);
53
56
  if (!n) return;
54
- let i = pe(r);
55
- E({
57
+ let i = ge(r);
58
+ D({
56
59
  pathname: i.pathname,
57
60
  search: i.search
58
61
  }, { replace: i.replace });
59
- }, [Ue, E]), Q = v((e, t) => {
60
- let n = f.getState(), r = fe(n.tabs, n.activeTabId, e, t);
61
- r && (r.dirtyTabs.length > 0 ? G(r) : Z(r.ids));
62
- }, [Z]), dt = v(() => {
63
- G(null);
64
- }, []), ft = v(() => {
65
- W && (G(null), Z(W.cleanIds));
66
- }, [W, Z]), pt = v(() => {
67
- W && (G(null), Z(W.ids));
68
- }, [W, Z]);
69
- ge();
70
- let mt = Se(), { isImpersonating: $ } = oe();
71
- y(() => {
72
- S.enabled || !h && !a && E(e(`${k.pathname}${k.search}${k.hash}`), { replace: !0 });
62
+ }, [We, D]), $ = y((e, t) => {
63
+ let n = m.getState(), r = he(n.tabs, n.activeTabId, e, t);
64
+ r && (r.dirtyTabs.length > 0 ? q(r) : Q(r.ids));
65
+ }, [Q]), pt = y(() => {
66
+ q(null);
67
+ }, []), mt = y(() => {
68
+ K && (q(null), Q(K.cleanIds));
69
+ }, [K, Q]), ht = y(() => {
70
+ K && (q(null), Q(K.ids));
71
+ }, [K, Q]);
72
+ ye();
73
+ let gt = Te(), { isImpersonating: _t } = le();
74
+ b(() => {
75
+ C.enabled || !g && !s && D(e(`${A.pathname}${A.search}${A.hash}`), { replace: !0 });
73
76
  }, [
74
- S.enabled,
75
- h,
76
- a,
77
- E,
78
- k.hash,
79
- k.pathname,
80
- k.search
81
- ]), y(() => {
82
- let e = g?.id || null, t = _?.id || null;
83
- f.getState().setScope(t, e), ye.getState().setScope(t, e), e && t && (f.getState().hydrate(), ye.getState().hydrate(), ve());
84
- }, [g?.id, _?.id]), we(), Te(), y(() => {
85
- Be(Ve?.preferences);
86
- }, [Ve, Be]), y(() => {
87
- if (!A) return;
88
- let e = Fe(A.navigation, A.screens, k.pathname);
77
+ C.enabled,
78
+ g,
79
+ s,
80
+ D,
81
+ A.hash,
82
+ A.pathname,
83
+ A.search
84
+ ]), b(() => {
85
+ let e = _?.id || null, t = v?.id || null;
86
+ m.getState().setScope(t, e), Se.getState().setScope(t, e), e && t && (m.getState().hydrate(), Se.getState().hydrate(), xe());
87
+ }, [_?.id, v?.id]), De(), Oe(), b(() => {
88
+ Ve(F.value, He);
89
+ }, [
90
+ F.value,
91
+ He,
92
+ _?.id,
93
+ Ve
94
+ ]), b(() => {
95
+ if (!j) return;
96
+ let e = se(j.navigation, j.screens, A.pathname)?.area;
89
97
  if (e) {
90
- L(e);
98
+ z(e);
91
99
  return;
92
100
  }
93
- let t = I;
94
- if ((A.navigation ?? []).some((e) => (e.area || T) === t)) return;
95
- let n = (A.navigation ?? [])[0]?.area || T;
96
- n !== t && L(n);
101
+ let t = R;
102
+ if ((j.navigation ?? []).some((e) => (e.area || E) === t)) return;
103
+ let n = (j.navigation ?? [])[0]?.area || E;
104
+ n !== t && z(n);
97
105
  }, [
98
- A,
99
- k.pathname,
100
- I
101
- ]), y(() => {
102
- H(!1), U(!1);
103
- }, [k.pathname, k.search]), y(() => {
106
+ j,
107
+ A.pathname,
108
+ R
109
+ ]), b(() => {
110
+ W(!1), G(!1);
111
+ }, [A.pathname, A.search]), b(() => {
104
112
  let e = (e) => {
105
113
  let t = document.activeElement, n = !!t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable), r = e.metaKey || e.ctrlKey;
106
- r && e.key.toLowerCase() === "k" ? (e.preventDefault(), X("default")) : r && e.key.toLowerCase() === "t" ? (e.preventDefault(), X("new")) : r && e.key.toLowerCase() === "b" ? (e.preventDefault(), N("sidebar", j === "collapsed" ? "wide" : "collapsed")) : r && e.key.toLowerCase() === "w" ? (e.preventDefault(), Q("current")) : r && e.key === "/" ? (e.preventDefault(), q && B((e) => !e)) : e.key === "/" && !n ? (e.preventDefault(), X("default")) : e.key === "Escape" && R(!1);
114
+ r && e.key.toLowerCase() === "k" ? (e.preventDefault(), Z("default")) : r && e.key.toLowerCase() === "t" ? (e.preventDefault(), Z("new")) : r && e.key.toLowerCase() === "b" ? (e.preventDefault(), P("sidebar", M === "collapsed" ? "wide" : "collapsed")) : r && e.key.toLowerCase() === "w" ? (e.preventDefault(), $("current")) : r && e.key === "/" ? (e.preventDefault(), Y && H((e) => !e)) : e.key === "/" && !n ? (e.preventDefault(), Z("default")) : e.key === "Escape" && B(!1);
107
115
  };
108
116
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
109
117
  }, [
110
- X,
111
- Q,
112
- N,
113
- j,
114
- q
118
+ Z,
119
+ $,
120
+ P,
121
+ M,
122
+ Y
115
123
  ]);
116
- let ht = Ee(() => A ? Ie(i, A.navigation, A.screens, k.pathname, F, O) : [], [
117
- i,
118
- A,
119
- k.pathname,
120
- F,
121
- O
124
+ let vt = ke(() => j ? Le(o, j.navigation, j.screens, A.pathname, L, k) : [], [
125
+ o,
126
+ j,
127
+ A.pathname,
128
+ L,
129
+ k
122
130
  ]);
123
- if (h) return /* @__PURE__ */ C("div", {
131
+ if (g) return /* @__PURE__ */ w("div", {
124
132
  style: {
125
133
  display: "flex",
126
134
  height: "var(--app-height)",
@@ -129,94 +137,94 @@ function E() {
129
137
  background: "var(--background)",
130
138
  color: "var(--text-3)"
131
139
  },
132
- children: i("shell.loading", "Loading…")
140
+ children: o("shell.loading", "Loading…")
133
141
  });
134
- if (!a) return null;
135
- let gt = (e) => {
136
- L(e);
137
- let t = Pe(e, A);
138
- t && O(t);
139
- }, _t = (e) => {
142
+ if (!s) return null;
143
+ let yt = (e) => {
144
+ z(e);
145
+ let t = j ? oe(j, e) ?? void 0 : void 0;
146
+ t && k(t);
147
+ }, bt = (e) => {
140
148
  switch (e.type) {
141
149
  case "nav":
142
- e.route && O(e.route);
150
+ e.route && k(e.route);
143
151
  break;
144
152
  case "new":
145
- e.route && O(e.route + "/new");
153
+ e.route && k(e.route + "/new");
146
154
  break;
147
155
  case "open":
148
- e.route && O(e.route);
156
+ e.route && k(e.route);
149
157
  break;
150
158
  case "ai":
151
- q && (V(e.q), B(!0));
159
+ Y && (U(e.q), H(!0));
152
160
  break;
153
161
  case "ai-panel":
154
- q && (V(void 0), B(!0));
162
+ Y && (U(void 0), H(!0));
155
163
  break;
156
164
  case "theme":
157
- N("colorScheme", ze === "dark" ? "light" : "dark");
165
+ P("colorScheme", Be === "dark" ? "light" : "dark");
158
166
  break;
159
- case "tab-close": e.tabCloseScope && Q(e.tabCloseScope);
167
+ case "tab-close": e.tabCloseScope && $(e.tabCloseScope);
160
168
  }
161
169
  };
162
- return S.enabled ? /* @__PURE__ */ w(_e, { children: [
163
- /* @__PURE__ */ C(ne, {}),
164
- /* @__PURE__ */ C(m, {}),
165
- /* @__PURE__ */ C(re, {}),
166
- /* @__PURE__ */ C(ee, {}),
167
- /* @__PURE__ */ C(p, {}),
168
- /* @__PURE__ */ C("div", {
170
+ return C.enabled ? /* @__PURE__ */ T(be, { children: [
171
+ /* @__PURE__ */ w(re, {}),
172
+ /* @__PURE__ */ w(te, {}),
173
+ /* @__PURE__ */ w(ie, {}),
174
+ /* @__PURE__ */ w(ee, {}),
175
+ /* @__PURE__ */ w(h, {}),
176
+ /* @__PURE__ */ w("div", {
169
177
  id: "app-embed",
170
178
  className: "flex min-h-0 flex-col overflow-auto",
171
179
  style: { height: "var(--app-height)" },
172
- children: /* @__PURE__ */ C(De, {})
180
+ children: /* @__PURE__ */ w(Ae, {})
173
181
  })
174
- ] }) : /* @__PURE__ */ C(_e, { children: /* @__PURE__ */ w("div", {
182
+ ] }) : /* @__PURE__ */ w(be, { children: /* @__PURE__ */ T("div", {
175
183
  id: "app",
176
- "data-sidebar": j,
177
- "data-mobile-shell": J ? "true" : void 0,
178
- style: je({
179
- mobileShell: J,
180
- showBanner: $,
181
- showTopbar: Y,
182
- showRail: nt,
183
- showSidebar: rt,
184
- sidebarMode: j,
185
- showAssistant: st
184
+ "data-sidebar": M,
185
+ "data-mobile-shell": X ? "true" : void 0,
186
+ style: Pe({
187
+ mobileShell: X,
188
+ showBanner: _t,
189
+ showTopbar: rt,
190
+ showRail: it,
191
+ showSidebar: at,
192
+ sidebarMode: M,
193
+ showAssistant: lt
186
194
  }),
187
195
  children: [
188
- $ && /* @__PURE__ */ C(ue, {}),
189
- /* @__PURE__ */ C(de, {}),
190
- Y && /* @__PURE__ */ C(se, {
191
- breadcrumbs: ht,
196
+ _t && /* @__PURE__ */ w(pe, {}),
197
+ /* @__PURE__ */ w(me, {}),
198
+ rt && /* @__PURE__ */ w(ue, {
199
+ breadcrumbs: vt,
192
200
  onCrumbClick: (e) => e.onClick && e.onClick(),
193
- showNavButton: at,
194
- navButtonRef: Ze,
195
- onOpenNav: () => H(!0),
196
- showTabsButton: ot,
197
- tabsButtonRef: Qe,
198
- onOpenTabs: () => U(!0),
199
- mobileTabCount: F.length,
200
- onCmdK: () => X("default"),
201
- onToggleAI: () => q && B((e) => !e),
202
- aiOpen: z,
203
- onOpenProfile: () => O("/profile"),
204
- onOpenPrefs: () => O("/preferences"),
205
- showTenantSwitcher: ct,
206
- showBreadcrumbs: lt,
207
- showThemeToggle: ut
201
+ showNavButton: st,
202
+ navButtonRef: Qe,
203
+ onOpenNav: () => W(!0),
204
+ showTabsButton: ct,
205
+ tabsButtonRef: $e,
206
+ onOpenTabs: () => G(!0),
207
+ mobileTabCount: L.length,
208
+ onCmdK: () => Z("default"),
209
+ onToggleAI: () => Y && H((e) => !e),
210
+ aiOpen: V,
211
+ onOpenProfile: () => k("/profile"),
212
+ onOpenPrefs: () => k("/preferences"),
213
+ showTenantSwitcher: ut,
214
+ showBreadcrumbs: dt,
215
+ showThemeToggle: ft
208
216
  }),
209
- nt && /* @__PURE__ */ C(c, {
210
- activeArea: I,
211
- onPick: gt,
212
- onToggleAI: () => q && B((e) => !e),
213
- aiOpen: z,
214
- onCmdK: () => X("default"),
215
- areas: A?.areas,
216
- branding: et
217
+ it && /* @__PURE__ */ w(f, {
218
+ activeArea: R,
219
+ onPick: yt,
220
+ onToggleAI: () => Y && H((e) => !e),
221
+ aiOpen: V,
222
+ onCmdK: () => Z("default"),
223
+ areas: j?.areas,
224
+ branding: tt
217
225
  }),
218
- rt && /* @__PURE__ */ C(ae, { activeArea: I }),
219
- /* @__PURE__ */ w("main", {
226
+ at && /* @__PURE__ */ w(ce, { activeArea: R }),
227
+ /* @__PURE__ */ T("main", {
220
228
  style: {
221
229
  gridArea: "main",
222
230
  overflow: "hidden",
@@ -225,11 +233,11 @@ function E() {
225
233
  minWidth: 0
226
234
  },
227
235
  children: [
228
- it && Re === "top" && /* @__PURE__ */ C(ce, {
229
- onNew: () => X("new"),
230
- onCloseRequest: Q
236
+ ot && ze === "top" && /* @__PURE__ */ w(de, {
237
+ onNew: () => Z("new"),
238
+ onCloseRequest: $
231
239
  }),
232
- /* @__PURE__ */ C("div", {
240
+ /* @__PURE__ */ w("div", {
233
241
  style: {
234
242
  flex: 1,
235
243
  overflow: "auto",
@@ -237,74 +245,74 @@ function E() {
237
245
  display: "flex",
238
246
  flexDirection: "column"
239
247
  },
240
- children: /* @__PURE__ */ C(De, {})
248
+ children: /* @__PURE__ */ w(Ae, {})
241
249
  }),
242
- it && Re === "bottom" && /* @__PURE__ */ C(ce, {
243
- onNew: () => X("new"),
244
- onCloseRequest: Q
250
+ ot && ze === "bottom" && /* @__PURE__ */ w(de, {
251
+ onNew: () => Z("new"),
252
+ onCloseRequest: $
245
253
  })
246
254
  ]
247
255
  }),
248
- K && /* @__PURE__ */ C(me, {
249
- open: Ge,
250
- mode: Ke,
251
- onClose: () => R(!1),
252
- onAction: (e) => _t(e),
253
- schema: A,
254
- includeAI: $e,
255
- aiName: tt
256
+ J && /* @__PURE__ */ w(_e, {
257
+ open: Ke,
258
+ mode: qe,
259
+ onClose: () => B(!1),
260
+ onAction: (e) => bt(e),
261
+ schema: j,
262
+ includeAI: et,
263
+ aiName: nt
256
264
  }),
257
- /* @__PURE__ */ C(xe, {}),
258
- q && z && /* @__PURE__ */ C(he, {
259
- open: z,
260
- docked: st,
265
+ /* @__PURE__ */ w(we, {}),
266
+ Y && V && /* @__PURE__ */ w(ve, {
267
+ open: V,
268
+ docked: lt,
261
269
  onClose: () => {
262
- B(!1), V(void 0);
270
+ H(!1), U(void 0);
263
271
  },
264
- title: tt,
265
- askOnOpen: Je,
266
- context: mt ?? void 0
272
+ title: nt,
273
+ askOnOpen: Ye,
274
+ context: gt ?? void 0
267
275
  }),
268
- at && /* @__PURE__ */ C(Me, {
269
- open: Ye,
270
- activeArea: I,
271
- schema: A,
272
- returnFocusRef: Ze,
273
- onClose: () => H(!1),
274
- onNavigate: O
275
- }),
276
- ot && /* @__PURE__ */ C(Ne, {
276
+ st && /* @__PURE__ */ w(Fe, {
277
277
  open: Xe,
278
- tabs: F,
279
- activeTabId: He,
278
+ activeArea: R,
279
+ schema: j,
280
280
  returnFocusRef: Qe,
281
- onClose: () => U(!1),
281
+ onClose: () => W(!1),
282
+ onNavigate: k
283
+ }),
284
+ ct && /* @__PURE__ */ w(Ie, {
285
+ open: Ze,
286
+ tabs: L,
287
+ activeTabId: Ue,
288
+ returnFocusRef: $e,
289
+ onClose: () => G(!1),
282
290
  onSwitch: (e) => {
283
- We(e.id), E({
291
+ Ge(e.id), D({
284
292
  pathname: e.pathname,
285
293
  search: e.search
286
- }, { replace: !1 }), U(!1);
294
+ }, { replace: !1 }), G(!1);
287
295
  },
288
- onCloseTab: (e) => Q("current", e)
296
+ onCloseTab: (e) => $("current", e)
289
297
  }),
290
- /* @__PURE__ */ C(le, {
291
- pending: W,
292
- onCancel: dt,
293
- onCloseClean: ft,
294
- onDiscardAll: pt
298
+ /* @__PURE__ */ w(fe, {
299
+ pending: K,
300
+ onCancel: pt,
301
+ onCloseClean: mt,
302
+ onDiscardAll: ht
295
303
  })
296
304
  ]
297
305
  }) });
298
306
  }
299
- function Ae(e) {
300
- return y(() => {
307
+ function Ne(e) {
308
+ return b(() => {
301
309
  let t = document.documentElement.style;
302
310
  return t.setProperty("--assistant-open-w", e ? "var(--assistant-w)" : "0px"), () => {
303
311
  t.removeProperty("--assistant-open-w");
304
312
  };
305
313
  }, [e]), e;
306
314
  }
307
- function je({ mobileShell: e, showBanner: t, showTopbar: n, showRail: r, showSidebar: i, sidebarMode: a, showAssistant: o }) {
315
+ function Pe({ mobileShell: e, showBanner: t, showTopbar: n, showRail: r, showSidebar: i, sidebarMode: a, showAssistant: o }) {
308
316
  let s = [
309
317
  ...t ? ["auto"] : [],
310
318
  ...n ? ["var(--topbar-h)"] : [],
@@ -335,7 +343,7 @@ function je({ mobileShell: e, showBanner: t, showTopbar: n, showRail: r, showSid
335
343
  overflow: "hidden"
336
344
  };
337
345
  }
338
- var D = [
346
+ var O = [
339
347
  "a[href]",
340
348
  "button:not([disabled])",
341
349
  "input:not([disabled])",
@@ -343,14 +351,14 @@ var D = [
343
351
  "textarea:not([disabled])",
344
352
  "[tabindex]:not([tabindex='-1'])"
345
353
  ].join(",");
346
- function O(e) {
347
- return e ? Array.from(e.querySelectorAll(D)).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true") : [];
348
- }
349
354
  function k(e) {
350
- O(e)[0]?.focus();
355
+ return e ? Array.from(e.querySelectorAll(O)).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true") : [];
356
+ }
357
+ function A(e) {
358
+ k(e)[0]?.focus();
351
359
  }
352
- function A(e, t) {
353
- let n = O(e);
360
+ function j(e, t) {
361
+ let n = k(e);
354
362
  if (n.length === 0) {
355
363
  t.preventDefault();
356
364
  return;
@@ -358,42 +366,42 @@ function A(e, t) {
358
366
  let r = n[0], i = n[n.length - 1], a = document.activeElement;
359
367
  t.shiftKey && a === r ? (t.preventDefault(), i.focus()) : !t.shiftKey && a === i && (t.preventDefault(), r.focus());
360
368
  }
361
- function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s, onNavigate: c }) {
362
- let l = o(), [u, d] = x(t), f = b(null);
363
- if (y(() => {
369
+ function Fe({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: i, onNavigate: a }) {
370
+ let l = c(), [u, d] = S(t), f = x(null);
371
+ if (b(() => {
364
372
  e && d(t);
365
- }, [e, t]), y(() => {
373
+ }, [e, t]), b(() => {
366
374
  if (!e) return;
367
375
  let t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = r.current;
368
- requestAnimationFrame(() => k(f.current));
369
- let i = (e) => {
370
- e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" && A(f.current, e);
376
+ requestAnimationFrame(() => A(f.current));
377
+ let a = (e) => {
378
+ e.key === "Escape" ? (e.preventDefault(), i()) : e.key === "Tab" && j(f.current, e);
371
379
  };
372
- return window.addEventListener("keydown", i), () => {
373
- window.removeEventListener("keydown", i), (n ?? t)?.focus();
380
+ return window.addEventListener("keydown", a), () => {
381
+ window.removeEventListener("keydown", a), (n ?? t)?.focus();
374
382
  };
375
383
  }, [
376
384
  e,
377
- s,
385
+ i,
378
386
  r
379
387
  ]), !e || !n) return null;
380
- let p = Array.from(new Set((n.navigation ?? []).map((e) => e.area || T)));
381
- p.length === 0 && p.push(T);
382
- let ee = (e) => {
388
+ let p = Array.from(new Set((n.navigation ?? []).map((e) => e.area || E)));
389
+ p.length === 0 && p.push(E);
390
+ let m = (e) => {
383
391
  let t = n.areas?.find((t) => t.code === e);
384
- return l(t?.name) || (e === T ? l("shell.nav.title", "Navigation") : e);
385
- }, m = (e, t) => {
386
- let r = e.screen ? n.screens[e.screen] : void 0, i = [...e.items ?? [], ...e.children ?? []], a = l(e.name) || (r ? l(r.display?.name) : "");
387
- return /* @__PURE__ */ w("div", {
392
+ return l(t?.name) || (e === E ? l("shell.nav.title", "Navigation") : e);
393
+ }, h = (e, t) => {
394
+ let r = e.screen ? n.screens[e.screen] : void 0, o = [...e.items ?? [], ...e.children ?? []], s = l(e.name) || (r ? l(r.display?.name) : "");
395
+ return /* @__PURE__ */ T("div", {
388
396
  style: {
389
397
  display: "flex",
390
398
  flexDirection: "column",
391
399
  gap: 2
392
400
  },
393
- children: [r?.route ? /* @__PURE__ */ w("button", {
401
+ children: [r?.route ? /* @__PURE__ */ T("button", {
394
402
  type: "button",
395
403
  onClick: () => {
396
- c(r.route), s();
404
+ a(r.route), i();
397
405
  },
398
406
  style: {
399
407
  minHeight: 40,
@@ -409,16 +417,16 @@ function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
409
417
  textAlign: "left",
410
418
  cursor: "pointer"
411
419
  },
412
- children: [/* @__PURE__ */ C("span", { style: { width: 12 } }), /* @__PURE__ */ C("span", {
420
+ children: [/* @__PURE__ */ w("span", { style: { width: 12 } }), /* @__PURE__ */ w("span", {
413
421
  style: {
414
422
  minWidth: 0,
415
423
  overflow: "hidden",
416
424
  textOverflow: "ellipsis",
417
425
  whiteSpace: "nowrap"
418
426
  },
419
- children: a || r.route
427
+ children: s || r.route
420
428
  })]
421
- }) : a ? /* @__PURE__ */ C("div", {
429
+ }) : s ? /* @__PURE__ */ w("div", {
422
430
  style: {
423
431
  padding: `7px 10px 5px ${10 + t * 14}px`,
424
432
  color: "var(--text-3)",
@@ -427,20 +435,20 @@ function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
427
435
  letterSpacing: "0.08em",
428
436
  textTransform: "uppercase"
429
437
  },
430
- children: a
431
- }) : null, i.map((e) => m(e, t + 1))]
432
- }, `${t}-${e.screen ?? a}`);
438
+ children: s
439
+ }) : null, o.map((e) => h(e, t + 1))]
440
+ }, `${t}-${e.screen ?? s}`);
433
441
  };
434
- return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("div", {
442
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", {
435
443
  "data-testid": "mobile-nav-backdrop",
436
- onClick: s,
444
+ onClick: i,
437
445
  style: {
438
446
  position: "fixed",
439
447
  inset: 0,
440
448
  background: "var(--scrim-lite)",
441
449
  zIndex: 120
442
450
  }
443
- }), /* @__PURE__ */ w("aside", {
451
+ }), /* @__PURE__ */ T("aside", {
444
452
  ref: f,
445
453
  role: "dialog",
446
454
  "aria-modal": "true",
@@ -464,7 +472,7 @@ function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
464
472
  boxSizing: "border-box",
465
473
  overflow: "hidden"
466
474
  },
467
- children: [/* @__PURE__ */ w("div", {
475
+ children: [/* @__PURE__ */ T("div", {
468
476
  style: {
469
477
  display: "flex",
470
478
  alignItems: "center",
@@ -472,18 +480,18 @@ function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
472
480
  minHeight: 36,
473
481
  padding: "0 2px 8px"
474
482
  },
475
- children: [/* @__PURE__ */ C("strong", {
483
+ children: [/* @__PURE__ */ w("strong", {
476
484
  style: {
477
485
  fontSize: 13,
478
486
  flex: 1
479
487
  },
480
488
  children: l("shell.nav.title", "Navigation")
481
- }), /* @__PURE__ */ C(a, {
482
- icon: /* @__PURE__ */ C(i.x, { size: 15 }),
489
+ }), /* @__PURE__ */ w(s, {
490
+ icon: /* @__PURE__ */ w(o.x, { size: 15 }),
483
491
  title: l("shell.nav.close", "Close navigation"),
484
- onClick: s
492
+ onClick: i
485
493
  })]
486
- }), /* @__PURE__ */ C("nav", {
494
+ }), /* @__PURE__ */ w("nav", {
487
495
  style: {
488
496
  overflowY: "auto",
489
497
  overscrollBehavior: "contain",
@@ -492,8 +500,8 @@ function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
492
500
  gap: 6
493
501
  },
494
502
  children: p.map((e) => {
495
- let r = u === e, a = h(l, n.navigation ?? [], e);
496
- return /* @__PURE__ */ w("section", { children: [/* @__PURE__ */ w("button", {
503
+ let r = u === e, i = g(l, n.navigation ?? [], e);
504
+ return /* @__PURE__ */ T("section", { children: [/* @__PURE__ */ T("button", {
497
505
  type: "button",
498
506
  onClick: () => d(r ? "" : e),
499
507
  style: {
@@ -512,16 +520,16 @@ function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
512
520
  cursor: "pointer"
513
521
  },
514
522
  "aria-expanded": r,
515
- children: [/* @__PURE__ */ C("span", {
523
+ children: [/* @__PURE__ */ w("span", {
516
524
  style: {
517
525
  flex: 1,
518
526
  textAlign: "left"
519
527
  },
520
- children: ee(e)
521
- }), C(r ? i.down : i.right, { size: 13 })]
522
- }), r && /* @__PURE__ */ C("div", {
528
+ children: m(e)
529
+ }), w(r ? o.down : o.right, { size: 13 })]
530
+ }), r && /* @__PURE__ */ w("div", {
523
531
  style: { padding: "6px 0 4px" },
524
- children: a.flatMap((t) => [t.title ? /* @__PURE__ */ C("div", {
532
+ children: i.flatMap((t) => [t.title ? /* @__PURE__ */ w("div", {
525
533
  style: {
526
534
  padding: "8px 10px 4px",
527
535
  color: "var(--text-3)",
@@ -531,38 +539,38 @@ function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
531
539
  textTransform: "uppercase"
532
540
  },
533
541
  children: t.title
534
- }, `${e}-${t.title}`) : null, ...t.items.map((e) => m(e, 0))])
542
+ }, `${e}-${t.title}`) : null, ...t.items.map((e) => h(e, 0))])
535
543
  })] }, e);
536
544
  })
537
545
  })]
538
546
  })] });
539
547
  }
540
- function Ne({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, onSwitch: c, onCloseTab: l }) {
541
- let u = o(), d = _(), f = b(null);
542
- return y(() => {
548
+ function Ie({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: i, onSwitch: a, onCloseTab: l }) {
549
+ let u = c(), d = v(), f = x(null);
550
+ return b(() => {
543
551
  if (!e) return;
544
552
  let t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = r.current;
545
- requestAnimationFrame(() => k(f.current));
546
- let i = (e) => {
547
- e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" && A(f.current, e);
553
+ requestAnimationFrame(() => A(f.current));
554
+ let a = (e) => {
555
+ e.key === "Escape" ? (e.preventDefault(), i()) : e.key === "Tab" && j(f.current, e);
548
556
  };
549
- return window.addEventListener("keydown", i), () => {
550
- window.removeEventListener("keydown", i), (n ?? t)?.focus();
557
+ return window.addEventListener("keydown", a), () => {
558
+ window.removeEventListener("keydown", a), (n ?? t)?.focus();
551
559
  };
552
560
  }, [
553
561
  e,
554
- s,
562
+ i,
555
563
  r
556
- ]), e ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("div", {
564
+ ]), e ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", {
557
565
  "data-testid": "mobile-tabs-backdrop",
558
- onClick: s,
566
+ onClick: i,
559
567
  style: {
560
568
  position: "fixed",
561
569
  inset: 0,
562
570
  background: "var(--scrim-lite)",
563
571
  zIndex: 122
564
572
  }
565
- }), /* @__PURE__ */ w("section", {
573
+ }), /* @__PURE__ */ T("section", {
566
574
  ref: f,
567
575
  role: "dialog",
568
576
  "aria-modal": "true",
@@ -585,32 +593,32 @@ function Ne({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
585
593
  padding: 6,
586
594
  boxSizing: "border-box"
587
595
  },
588
- children: [/* @__PURE__ */ w("div", {
596
+ children: [/* @__PURE__ */ T("div", {
589
597
  style: {
590
598
  display: "flex",
591
599
  alignItems: "center",
592
600
  gap: 8,
593
601
  padding: "4px 4px 8px"
594
602
  },
595
- children: [/* @__PURE__ */ C("strong", {
603
+ children: [/* @__PURE__ */ w("strong", {
596
604
  style: {
597
605
  flex: 1,
598
606
  fontSize: 13
599
607
  },
600
608
  children: u("shell.tabs.open_tabs", "Open tabs")
601
- }), /* @__PURE__ */ C(a, {
602
- icon: /* @__PURE__ */ C(i.x, { size: 14 }),
609
+ }), /* @__PURE__ */ w(s, {
610
+ icon: /* @__PURE__ */ w(o.x, { size: 14 }),
603
611
  title: u("shell.tabs.close_menu", "Close tabs menu"),
604
- onClick: s
612
+ onClick: i
605
613
  })]
606
- }), t.length === 0 ? /* @__PURE__ */ C("div", {
614
+ }), t.length === 0 ? /* @__PURE__ */ w("div", {
607
615
  style: {
608
616
  padding: 10,
609
617
  color: "var(--text-3)",
610
618
  fontSize: 12
611
619
  },
612
620
  children: u("shell.tabs.none_open", "No open tabs")
613
- }) : t.map((e) => /* @__PURE__ */ w("div", {
621
+ }) : t.map((e) => /* @__PURE__ */ T("div", {
614
622
  style: {
615
623
  display: "grid",
616
624
  gridTemplateColumns: "minmax(0, 1fr) auto",
@@ -619,9 +627,9 @@ function Ne({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
619
627
  borderRadius: "var(--radius-md)",
620
628
  background: e.id === n ? "var(--surface-3)" : "transparent"
621
629
  },
622
- children: [/* @__PURE__ */ w("button", {
630
+ children: [/* @__PURE__ */ T("button", {
623
631
  type: "button",
624
- onClick: () => c(e),
632
+ onClick: () => a(e),
625
633
  style: {
626
634
  minHeight: 38,
627
635
  border: 0,
@@ -635,7 +643,7 @@ function Ne({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
635
643
  textAlign: "left",
636
644
  cursor: "pointer"
637
645
  },
638
- children: [/* @__PURE__ */ C(i.layers, { size: 13 }), /* @__PURE__ */ C("span", {
646
+ children: [/* @__PURE__ */ w(o.layers, { size: 13 }), /* @__PURE__ */ w("span", {
639
647
  style: {
640
648
  overflow: "hidden",
641
649
  textOverflow: "ellipsis",
@@ -643,114 +651,51 @@ function Ne({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
643
651
  },
644
652
  children: d(e)
645
653
  })]
646
- }), e.closable && /* @__PURE__ */ C(a, {
647
- icon: /* @__PURE__ */ C(i.x, { size: 12 }),
654
+ }), e.closable && /* @__PURE__ */ w(s, {
655
+ icon: /* @__PURE__ */ w(o.x, { size: 12 }),
648
656
  title: u("shell.tabs.close_named", "Close {title}", { title: d(e) }),
649
657
  onClick: () => l(e.id)
650
658
  })]
651
659
  }, e.id))]
652
660
  })] }) : null;
653
661
  }
654
- function Pe(e, t) {
655
- if (!t) return;
656
- let n = t.areas?.find((t) => t.code === e);
657
- if (n?.home_screen) {
658
- let e = t.screens[n.home_screen];
659
- if (e?.route) return e.route;
660
- }
661
- let r = (e) => {
662
- if (e.screen) {
663
- let n = t.screens[e.screen];
664
- if (n?.route) return n.route;
665
- }
666
- for (let t of e.items || []) {
667
- let e = r(t);
668
- if (e) return e;
669
- }
670
- for (let t of e.children || []) {
671
- let e = r(t);
672
- if (e) return e;
673
- }
674
- };
675
- for (let n of t.navigation ?? []) {
676
- if ((n.area || T) !== e) continue;
677
- let t = r(n);
678
- if (t) return t;
679
- }
680
- }
681
- function Fe(e, t, n) {
682
- let r = (e) => {
683
- if (!e.screen) return !1;
684
- let r = t[e.screen];
685
- return !!r && (r.route === n || n.startsWith(r.route + "/"));
686
- }, i = (e, t) => {
687
- if (r(e)) return t;
688
- for (let n of e.items || []) {
689
- let e = i(n, t);
690
- if (e) return e;
691
- }
692
- for (let n of e.children || []) {
693
- let e = i(n, t);
694
- if (e) return e;
695
- }
696
- };
697
- for (let t of e ?? []) {
698
- let e = i(t, t.area || T);
699
- if (e) return e;
700
- }
701
- }
702
- function Ie(e, t, n, r, i, a) {
703
- let o = (e, t) => {
704
- if (e.screen) {
705
- let i = n[e.screen];
706
- if (i && (i.route === r || r.startsWith(i.route + "/"))) return [...t, e];
707
- }
708
- for (let n of e.items || []) {
709
- let r = o(n, [...t, e]);
710
- if (r) return r;
711
- }
712
- for (let n of e.children || []) {
713
- let r = o(n, [...t, e]);
714
- if (r) return r;
715
- }
716
- return null;
717
- }, s = null;
718
- for (let e of t ?? []) if (s = o(e, []), s) break;
719
- if (!s || s.length === 0) {
662
+ function Le(e, t, n, r, i, a) {
663
+ let o = se(t, n, r)?.chain;
664
+ if (!o || o.length === 0) {
720
665
  let t = Object.values(n).find((e) => e.route === r);
721
666
  if (t?.display?.name) return [{
722
667
  label: e(t.display.name),
723
668
  icon: t.display.icon,
724
669
  isLast: !0
725
670
  }];
726
- let i = g(e, r);
671
+ let i = _(e, r);
727
672
  return i ? [{
728
673
  label: i,
729
674
  isLast: !0
730
675
  }] : [];
731
676
  }
732
- let c = [];
733
- for (let t = 0; t < s.length; t++) {
734
- let i = s[t], o = t === s.length - 1, l = i.screen ? n[i.screen] : void 0;
735
- c.push({
677
+ let s = [];
678
+ for (let t = 0; t < o.length; t++) {
679
+ let i = o[t], c = t === o.length - 1, l = i.screen ? n[i.screen] : void 0;
680
+ s.push({
736
681
  label: e(i.name) || i.screen || "",
737
682
  icon: i.icon,
738
683
  onClick: l ? () => {
739
684
  a(l.route);
740
685
  } : void 0,
741
- isLast: o && (!l || l.route === r)
686
+ isLast: c && (!l || l.route === r)
742
687
  });
743
688
  }
744
- let l = s[s.length - 1], u = l.screen ? n[l.screen] : void 0;
745
- if (u && r !== u.route && r.startsWith(u.route + "/")) {
689
+ let c = o[o.length - 1], l = c.screen ? n[c.screen] : void 0;
690
+ if (l && r !== l.route && r.startsWith(l.route + "/")) {
746
691
  let t = i.find((e) => e.pathname === r);
747
- c.push({
692
+ s.push({
748
693
  label: t?.title || e("shell.crumbs.record", "Record"),
749
694
  icon: "file",
750
695
  isLast: !0
751
696
  });
752
697
  }
753
- return c;
698
+ return s;
754
699
  }
755
700
  //#endregion
756
- export { E as Layout, Ie as buildCrumbs };
701
+ export { D as Layout, Le as buildCrumbs };