@techzyapp/ui-library 1.0.13 → 1.0.15

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 (41) hide show
  1. package/dist/{AdminRoot-BuB92RpF.cjs → AdminRoot-BXfZnH5R.cjs} +2 -2
  2. package/dist/{AdminRoot-BuB92RpF.cjs.map → AdminRoot-BXfZnH5R.cjs.map} +1 -1
  3. package/dist/{AdminRoot-TCS_blQB.js → AdminRoot-Ca30MPHn.js} +2 -2
  4. package/dist/{AdminRoot-TCS_blQB.js.map → AdminRoot-Ca30MPHn.js.map} +1 -1
  5. package/dist/{Breadcrumbs-DvgctFLS.js → Breadcrumbs-CtljA45l.js} +2 -2
  6. package/dist/{Breadcrumbs-DvgctFLS.js.map → Breadcrumbs-CtljA45l.js.map} +1 -1
  7. package/dist/{Breadcrumbs-BnxhmyK5.cjs → Breadcrumbs-D8hvHveR.cjs} +2 -2
  8. package/dist/{Breadcrumbs-BnxhmyK5.cjs.map → Breadcrumbs-D8hvHveR.cjs.map} +1 -1
  9. package/dist/{PageNotFound-CxLUFoJa.cjs → PageNotFound-BFAhRHpY.cjs} +2 -2
  10. package/dist/{PageNotFound-CxLUFoJa.cjs.map → PageNotFound-BFAhRHpY.cjs.map} +1 -1
  11. package/dist/{PageNotFound-CmT-Wr9m.js → PageNotFound-UNkPJi-L.js} +2 -2
  12. package/dist/{PageNotFound-CmT-Wr9m.js.map → PageNotFound-UNkPJi-L.js.map} +1 -1
  13. package/dist/{RootLayout-CxMadTU1.cjs → RootLayout-CCQBRBxR.cjs} +2 -2
  14. package/dist/{RootLayout-CxMadTU1.cjs.map → RootLayout-CCQBRBxR.cjs.map} +1 -1
  15. package/dist/{RootLayout-CqQZ6h5c.js → RootLayout-DPS3gG53.js} +3 -3
  16. package/dist/{RootLayout-CqQZ6h5c.js.map → RootLayout-DPS3gG53.js.map} +1 -1
  17. package/dist/Sidebar-DXX-89d1.cjs +2 -0
  18. package/dist/Sidebar-DXX-89d1.cjs.map +1 -0
  19. package/dist/Sidebar-nnHriNtf.js +456 -0
  20. package/dist/Sidebar-nnHriNtf.js.map +1 -0
  21. package/dist/components/Breadcrumbs/index.cjs +1 -1
  22. package/dist/components/Breadcrumbs/index.js +1 -1
  23. package/dist/components/PageNotFound/index.cjs +1 -1
  24. package/dist/components/PageNotFound/index.js +1 -1
  25. package/dist/components/RootLayout/index.cjs +1 -1
  26. package/dist/components/RootLayout/index.js +1 -1
  27. package/dist/components/Sidebar/Sidebar.d.cts +33 -6
  28. package/dist/components/Sidebar/Sidebar.d.ts +33 -6
  29. package/dist/components/Sidebar/index.cjs +1 -1
  30. package/dist/components/Sidebar/index.js +1 -1
  31. package/dist/entries/app.cjs +1 -1
  32. package/dist/entries/app.js +1 -1
  33. package/dist/entries/components.cjs +1 -1
  34. package/dist/entries/components.js +4 -4
  35. package/dist/index.cjs +1 -1
  36. package/dist/index.js +5 -5
  37. package/package.json +1 -1
  38. package/dist/Sidebar-CT_NUo_7.cjs +0 -2
  39. package/dist/Sidebar-CT_NUo_7.cjs.map +0 -1
  40. package/dist/Sidebar-Csd3iKbS.js +0 -424
  41. package/dist/Sidebar-Csd3iKbS.js.map +0 -1
@@ -0,0 +1,456 @@
1
+ import { jsx as i, jsxs as I, Fragment as M } from "react/jsx-runtime";
2
+ import { useMemo as T, useState as D, useRef as K, useEffect as C } from "react";
3
+ import { Navigate as V, useRouterState as $, Link as k, useNavigate as Y, useRouter as E } from "@tanstack/react-router";
4
+ import { clsx as U } from "clsx";
5
+ import { I as A } from "./Icon-CophpkHo.js";
6
+ import { L as y } from "./List-LqbfF6gU.js";
7
+ import { L as B } from "./ListItem-B4Upc0Hy.js";
8
+ import { T as W } from "./TextField-Bg4TwkVD.js";
9
+ import { u as q, h as H } from "./access-Db4knwyR.js";
10
+ import { a as G } from "./ConfigProvider-BYruQYHC.js";
11
+ const Q = "_nav_a1zzi_4", X = "_module_a1zzi_17", J = "_search_a1zzi_25", Z = "_searchPanel_a1zzi_31", ee = "_moduleLabel_a1zzi_46", te = "_leaves_a1zzi_61", oe = "_navBadge_a1zzi_66", ne = "_navDot_a1zzi_78", ae = "_leafDot_a1zzi_86", se = "_collapsible_a1zzi_95", le = "_collapsibleClosed_a1zzi_100", ce = "_collapsibleInner_a1zzi_103", re = "_chevron_a1zzi_109", ie = "_chevronButton_a1zzi_119", h = {
12
+ nav: Q,
13
+ module: X,
14
+ search: J,
15
+ searchPanel: Z,
16
+ moduleLabel: ee,
17
+ leaves: te,
18
+ navBadge: oe,
19
+ navDot: ne,
20
+ leafDot: ae,
21
+ collapsible: se,
22
+ collapsibleClosed: le,
23
+ collapsibleInner: ce,
24
+ chevron: re,
25
+ chevronButton: ie
26
+ }, w = B, de = (e) => e.split("-").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" "), F = (e) => e.replace(/^\/+|\/+$/g, ""), S = (e) => e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, P = (e, n) => e.order - n.order || e.label.localeCompare(n.label);
27
+ function ue(e) {
28
+ const n = [];
29
+ for (const a of e) {
30
+ const l = a.staticData, s = F(a.fullPath);
31
+ !(l != null && l.name) || !s || n.push({ path: s, name: l.name, sd: l });
32
+ }
33
+ const o = new Map(n.map((a) => [a.path, a])), t = n.map((a) => a.path), c = (a) => t.some((l) => l !== a && l.startsWith(`${a}/`)), d = new Set(e.map((a) => a.fullPath)), b = (a) => d.has(`/${a}/`), m = (a, l) => {
34
+ const s = o.get(a);
35
+ return {
36
+ label: (s == null ? void 0 : s.name) ?? de(l),
37
+ icon: s == null ? void 0 : s.sd.icon,
38
+ badge: s == null ? void 0 : s.sd.badge,
39
+ dot: s == null ? void 0 : s.sd.dot,
40
+ order: (s == null ? void 0 : s.sd.order) ?? Number.POSITIVE_INFINITY
41
+ };
42
+ }, p = /* @__PURE__ */ new Map(), f = (a) => {
43
+ let l = p.get(a);
44
+ if (!l) {
45
+ const s = m(a, a);
46
+ l = { label: s.label, icon: s.icon, order: s.order, groups: /* @__PURE__ */ new Map() }, p.set(a, l);
47
+ }
48
+ return l;
49
+ }, g = [];
50
+ for (const { path: a, name: l, sd: s } of n) {
51
+ const _ = a.split("/");
52
+ if (_.length <= 2 && c(a) || s.hidden) continue;
53
+ if (_.length === 1) {
54
+ g.push({
55
+ label: l,
56
+ to: `/${a}`,
57
+ icon: s.icon,
58
+ badge: s.badge,
59
+ dot: s.dot,
60
+ order: s.order ?? Number.POSITIVE_INFINITY
61
+ });
62
+ continue;
63
+ }
64
+ const r = f(_[0]);
65
+ if (_.length === 2)
66
+ r.groups.set(a, {
67
+ label: l,
68
+ icon: s.icon,
69
+ to: `/${a}`,
70
+ badge: s.badge,
71
+ dot: s.dot,
72
+ order: s.order ?? Number.POSITIVE_INFINITY,
73
+ leaves: [],
74
+ isContainer: !1
75
+ });
76
+ else {
77
+ const u = _.slice(0, 2).join("/");
78
+ let v = r.groups.get(u);
79
+ if (!v) {
80
+ const N = m(u, _[1]);
81
+ v = {
82
+ label: N.label,
83
+ icon: N.icon,
84
+ badge: N.badge,
85
+ dot: N.dot,
86
+ order: N.order,
87
+ to: b(u) ? `/${u}` : void 0,
88
+ leaves: [],
89
+ isContainer: !0
90
+ }, r.groups.set(u, v);
91
+ }
92
+ v.leaves.push({
93
+ label: l,
94
+ to: `/${a}`,
95
+ icon: s.icon,
96
+ badge: s.badge,
97
+ dot: s.dot,
98
+ order: s.order ?? Number.POSITIVE_INFINITY
99
+ });
100
+ }
101
+ }
102
+ return {
103
+ links: g.sort(P).map((a) => ({ label: a.label, to: a.to, icon: a.icon, badge: a.badge, dot: a.dot })),
104
+ modules: [...p.values()].sort(P).map(
105
+ (a) => ({
106
+ module: a.label,
107
+ icon: a.icon,
108
+ groups: [...a.groups.values()].sort(P).map(
109
+ (l) => ({
110
+ label: l.label,
111
+ icon: l.icon,
112
+ to: l.to,
113
+ badge: l.badge,
114
+ dot: l.dot,
115
+ children: l.isContainer ? l.leaves.sort(P).map((s) => ({
116
+ label: s.label,
117
+ to: s.to,
118
+ icon: s.icon,
119
+ badge: s.badge,
120
+ dot: s.dot
121
+ })) : void 0
122
+ })
123
+ )
124
+ })
125
+ )
126
+ };
127
+ }
128
+ function x() {
129
+ const e = E(), n = q();
130
+ return T(
131
+ () => ue(
132
+ Object.values(e.looseRoutesById).map((o) => {
133
+ var t;
134
+ return {
135
+ fullPath: o.fullPath,
136
+ staticData: (t = o.options) == null ? void 0 : t.staticData
137
+ };
138
+ }).filter((o) => {
139
+ var t;
140
+ return H((t = o.staticData) == null ? void 0 : t.roles);
141
+ })
142
+ ),
143
+ [e, n]
144
+ );
145
+ }
146
+ function O(e) {
147
+ var n;
148
+ if (e.links[0]) return e.links[0].to;
149
+ for (const o of e.modules)
150
+ for (const t of o.groups) {
151
+ if (t.to) return t.to;
152
+ const c = (n = t.children) == null ? void 0 : n[0];
153
+ if (c) return c.to;
154
+ }
155
+ }
156
+ function fe() {
157
+ return O(x());
158
+ }
159
+ function me(e) {
160
+ var o;
161
+ const n = /* @__PURE__ */ new Map();
162
+ for (const t of e) {
163
+ const c = (o = t.staticData) == null ? void 0 : o.name;
164
+ if (!c) continue;
165
+ const d = S(t.fullPath);
166
+ n.has(d) || n.set(d, c);
167
+ }
168
+ return n;
169
+ }
170
+ function R(e, n) {
171
+ const o = [];
172
+ let t = "";
173
+ for (const c of F(e).split("/").filter(Boolean)) {
174
+ t += `/${c}`;
175
+ const d = n.get(t);
176
+ d && o.push({ name: d, to: t });
177
+ }
178
+ return o;
179
+ }
180
+ function j() {
181
+ const e = E();
182
+ return T(
183
+ () => me(
184
+ Object.values(e.looseRoutesById).map((n) => {
185
+ var o;
186
+ return {
187
+ fullPath: n.fullPath,
188
+ staticData: (o = n.options) == null ? void 0 : o.staticData
189
+ };
190
+ })
191
+ ),
192
+ [e]
193
+ );
194
+ }
195
+ function xe() {
196
+ const e = j(), n = $({ select: (t) => t.location.pathname }), o = R(n, e);
197
+ return o.length > 0 ? o[o.length - 1].name : void 0;
198
+ }
199
+ function he(e) {
200
+ const n = /* @__PURE__ */ new Set();
201
+ for (const o of e.links) n.add(o.to);
202
+ for (const o of e.modules)
203
+ for (const t of o.groups) {
204
+ t.to && n.add(t.to);
205
+ for (const c of t.children ?? []) n.add(c.to);
206
+ }
207
+ return n;
208
+ }
209
+ function Se() {
210
+ const e = x(), n = j(), o = $({ select: (b) => b.location.pathname }), t = O(e), c = he(e), d = R(o, n).map(({ name: b, to: m }) => ({
211
+ label: b,
212
+ to: c.has(m) ? m : void 0
213
+ }));
214
+ return d.length > 0 && (d[d.length - 1] = { label: d[d.length - 1].label }), { homeTo: t, items: d };
215
+ }
216
+ function $e() {
217
+ const e = fe();
218
+ return e ? /* @__PURE__ */ i(V, { to: e }) : null;
219
+ }
220
+ function Be() {
221
+ const { links: e, modules: n } = x(), o = $({ select: (t) => t.location.pathname });
222
+ return /* @__PURE__ */ I("nav", { className: h.nav, children: [
223
+ e.length > 0 ? /* @__PURE__ */ i(y, { children: e.map((t) => /* @__PURE__ */ i(
224
+ w,
225
+ {
226
+ as: k,
227
+ to: t.to,
228
+ icon: t.icon,
229
+ selected: L(o, t.to),
230
+ clickable: !0,
231
+ trailing: z(t.badge, t.dot),
232
+ children: t.label
233
+ },
234
+ t.to
235
+ )) }) : null,
236
+ n.map((t) => /* @__PURE__ */ I("div", { className: h.module, children: [
237
+ /* @__PURE__ */ i("div", { className: h.moduleLabel, children: t.module }),
238
+ /* @__PURE__ */ i(y, { children: t.groups.map((c) => /* @__PURE__ */ i(Ne, { group: c, pathname: o }, c.label)) })
239
+ ] }, t.module))
240
+ ] });
241
+ }
242
+ function be(e) {
243
+ const n = [];
244
+ for (const o of e.links) n.push({ label: o.label, to: o.to });
245
+ for (const o of e.modules)
246
+ for (const t of o.groups) {
247
+ t.to && n.push({ label: t.label, to: t.to, context: o.module });
248
+ for (const c of t.children ?? [])
249
+ n.push({
250
+ label: c.label,
251
+ to: c.to,
252
+ context: `${o.module} · ${t.label}`
253
+ });
254
+ }
255
+ return n;
256
+ }
257
+ const pe = 8;
258
+ function Me() {
259
+ const e = G(), n = x(), o = Y(), t = T(() => be(n), [n]), [c, d] = D(""), [b, m] = D(!1), [p, f] = D(0), g = K(null), a = T(() => {
260
+ const r = c.trim().toLowerCase();
261
+ return r ? t.filter(
262
+ (u) => {
263
+ var v;
264
+ return u.label.toLowerCase().includes(r) || (((v = u.context) == null ? void 0 : v.toLowerCase().includes(r)) ?? !1);
265
+ }
266
+ ).slice(0, pe) : [];
267
+ }, [t, c]), l = b && a.length > 0;
268
+ C(() => f(0), [c]), C(() => {
269
+ f((r) => r > a.length - 1 ? Math.max(0, a.length - 1) : r);
270
+ }, [a.length]), C(() => {
271
+ if (!b) return;
272
+ const r = (u) => {
273
+ g.current && !g.current.contains(u.target) && m(!1);
274
+ };
275
+ return document.addEventListener("pointerdown", r), () => document.removeEventListener("pointerdown", r);
276
+ }, [b]);
277
+ const s = (r) => {
278
+ o({ to: r }), d(""), m(!1);
279
+ }, _ = (r) => {
280
+ if (l)
281
+ if (r.key === "ArrowDown")
282
+ r.preventDefault(), f((u) => (u + 1) % a.length);
283
+ else if (r.key === "ArrowUp")
284
+ r.preventDefault(), f((u) => (u - 1 + a.length) % a.length);
285
+ else if (r.key === "Enter") {
286
+ r.preventDefault();
287
+ const u = a[p];
288
+ u && s(u.to);
289
+ } else r.key === "Escape" && m(!1);
290
+ };
291
+ return /* @__PURE__ */ I(
292
+ "div",
293
+ {
294
+ ref: g,
295
+ className: h.search,
296
+ role: "combobox",
297
+ "aria-expanded": l,
298
+ "aria-haspopup": "listbox",
299
+ children: [
300
+ /* @__PURE__ */ i(
301
+ W,
302
+ {
303
+ value: c,
304
+ onChange: (r) => {
305
+ d(r.target.value), m(!0);
306
+ },
307
+ onFocus: () => m(!0),
308
+ onKeyDown: _,
309
+ adornment: /* @__PURE__ */ i(A, { name: "SearchNormal" }),
310
+ placeholder: e("sidebar.searchPages"),
311
+ "aria-label": e("sidebar.searchPages"),
312
+ autoComplete: "off"
313
+ }
314
+ ),
315
+ l ? /* @__PURE__ */ i("div", { className: h.searchPanel, children: /* @__PURE__ */ i(y, { role: "listbox", children: a.map((r, u) => /* @__PURE__ */ i(
316
+ B,
317
+ {
318
+ description: r.context,
319
+ clickable: !0,
320
+ selected: u === p,
321
+ onMouseDown: (v) => v.preventDefault(),
322
+ onMouseEnter: () => f(u),
323
+ onClick: () => s(r.to),
324
+ children: r.label
325
+ },
326
+ r.to
327
+ )) }) }) : null
328
+ ]
329
+ }
330
+ );
331
+ }
332
+ function L(e, n) {
333
+ const o = S(e), t = S(n);
334
+ return t === "/" ? o === "/" : o === t || o.startsWith(t + "/");
335
+ }
336
+ function ve(e, n) {
337
+ var o;
338
+ return e.to && L(n, e.to) ? !0 : ((o = e.children) == null ? void 0 : o.some((t) => L(n, t.to))) ?? !1;
339
+ }
340
+ function ge(e) {
341
+ return e ? /* @__PURE__ */ i("span", { className: h.navBadge, children: e }) : null;
342
+ }
343
+ function _e(e) {
344
+ return e ? /* @__PURE__ */ i("span", { className: h.navDot, style: { background: `var(--tz-color-${e})` } }) : null;
345
+ }
346
+ function z(e, n, o) {
347
+ if (!(e == null && n == null && o == null))
348
+ return /* @__PURE__ */ I(M, { children: [
349
+ ge(e),
350
+ _e(n),
351
+ o
352
+ ] });
353
+ }
354
+ function Ne({ group: e, pathname: n }) {
355
+ var m, p;
356
+ const o = ve(e, n), t = !!((m = e.children) != null && m.length), [c, d] = D(o);
357
+ if (C(() => {
358
+ o && d(!0);
359
+ }, [o]), !t && e.to)
360
+ return /* @__PURE__ */ i(
361
+ w,
362
+ {
363
+ as: k,
364
+ to: e.to,
365
+ icon: e.icon,
366
+ selected: o,
367
+ clickable: !0,
368
+ trailing: z(e.badge, e.dot),
369
+ children: e.label
370
+ }
371
+ );
372
+ const b = /* @__PURE__ */ i(
373
+ A,
374
+ {
375
+ name: "ArrowDown4",
376
+ size: "sm",
377
+ className: h.chevron,
378
+ "data-open": c ? "true" : "false"
379
+ }
380
+ );
381
+ return /* @__PURE__ */ I(M, { children: [
382
+ t && e.to ? (
383
+ // "Case B": the row navigates (and expands); a separate chevron only toggles.
384
+ /* @__PURE__ */ i(
385
+ w,
386
+ {
387
+ as: k,
388
+ to: e.to,
389
+ icon: e.icon,
390
+ selected: o,
391
+ clickable: !0,
392
+ onClick: () => d(!0),
393
+ trailing: z(
394
+ e.badge,
395
+ e.dot,
396
+ /* @__PURE__ */ i(
397
+ "button",
398
+ {
399
+ type: "button",
400
+ className: h.chevronButton,
401
+ "aria-label": `${c ? "Collapse" : "Expand"} ${e.label}`,
402
+ "aria-expanded": c,
403
+ onClick: (f) => {
404
+ f.preventDefault(), f.stopPropagation(), d((g) => !g);
405
+ },
406
+ children: b
407
+ }
408
+ )
409
+ ),
410
+ children: e.label
411
+ }
412
+ )
413
+ ) : (
414
+ // a pure container — the whole row toggles its children
415
+ /* @__PURE__ */ i(
416
+ B,
417
+ {
418
+ icon: e.icon,
419
+ selected: o,
420
+ clickable: !0,
421
+ "aria-expanded": c,
422
+ onClick: () => d((f) => !f),
423
+ trailing: z(e.badge, e.dot, b),
424
+ children: e.label
425
+ }
426
+ )
427
+ ),
428
+ t ? (
429
+ // smooth collapse, same grid-template-rows technique as Card
430
+ /* @__PURE__ */ i("div", { className: U(h.collapsible, !c && h.collapsibleClosed), children: /* @__PURE__ */ i("div", { className: h.collapsibleInner, children: /* @__PURE__ */ i(y, { className: h.leaves, children: (p = e.children) == null ? void 0 : p.map((f) => /* @__PURE__ */ i(
431
+ w,
432
+ {
433
+ as: k,
434
+ to: f.to,
435
+ icon: /* @__PURE__ */ i("span", { className: h.leafDot }),
436
+ selected: L(n, f.to),
437
+ size: "md",
438
+ clickable: !0,
439
+ trailing: z(f.badge, f.dot),
440
+ children: f.label
441
+ },
442
+ f.to
443
+ )) }) }) })
444
+ ) : null
445
+ ] });
446
+ }
447
+ export {
448
+ $e as F,
449
+ Me as N,
450
+ Be as S,
451
+ xe as a,
452
+ ue as b,
453
+ O as f,
454
+ Se as u
455
+ };
456
+ //# sourceMappingURL=Sidebar-nnHriNtf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar-nnHriNtf.js","sources":["../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport {\n Link,\n Navigate,\n useNavigate,\n useRouter,\n useRouterState,\n type LinkProps,\n type StaticDataRouteOption,\n} from '@tanstack/react-router'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { List, ListItem, type ListItemProps } from '../List'\nimport { TextField } from '../TextField'\nimport { useT, type ThemeColor } from '../../theme'\nimport type { IconName } from '../../icons/names'\nimport { hasAccess, useAccessKeys } from '../../helpers/access'\nimport styles from './Sidebar.module.css'\n\n// `ListItem` rendered as a TanStack `Link` — it forwards unrecognized props (like `to`) to the\n// element, so this typed alias lets us pass `to` while keeping `ListItem`'s look + behavior.\nconst NavLink = ListItem as unknown as (props: ListItemProps & { to: string }) => ReactNode\n\nexport type { IconName }\n\n// Typed `staticData` for consumers — every route describes its own menu entry.\ndeclare module '@tanstack/react-router' {\n interface StaticDataRouteOption {\n /** Menu label. A route with no `name` never appears in the menu. */\n name?: string\n /** Optional menu icon (the library's `IconName` union). */\n icon?: IconName\n /** Sort order within the parent (ascending); falls back to alphabetical. */\n order?: number\n /** Routed but hidden from the menu. */\n hidden?: boolean\n /** Allowed accessKeys (OR — user needs any one). Omitted/empty = public. */\n roles?: string[]\n /** Small text label (e.g. `\"New\"`) shown as a pill on the menu row. */\n badge?: string\n /** Theme color of a small dot indicator on the menu row (e.g. `\"error\"`). */\n dot?: ThemeColor\n }\n}\n\nexport interface NavLeaf {\n label: string\n to: string\n icon?: IconName\n badge?: string\n dot?: ThemeColor\n}\nexport interface NavGroup {\n label: string\n icon?: IconName\n to?: string\n badge?: string\n dot?: ThemeColor\n children?: NavLeaf[]\n}\nexport interface NavModule {\n module: string\n icon?: IconName\n groups: NavGroup[]\n}\n\nconst prettify = (seg: string) =>\n seg\n .split('-')\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(' ')\nconst trimSlashes = (p: string) => p.replace(/^\\/+|\\/+$/g, '')\n/** Normalize a pathname for comparison — drop a single trailing slash (but keep the root `/`). */\nconst normalizePath = (p: string) => (p.length > 1 && p.endsWith('/') ? p.slice(0, -1) : p)\nconst byOrderThenLabel = (\n a: { order: number; label: string },\n b: { order: number; label: string },\n) => a.order - b.order || a.label.localeCompare(b.label)\n\ninterface LeafAcc {\n label: string\n to: string\n icon?: IconName\n badge?: string\n dot?: ThemeColor\n order: number\n}\ninterface GroupAcc {\n label: string\n icon?: IconName\n to?: string\n badge?: string\n dot?: ThemeColor\n order: number\n leaves: LeafAcc[]\n isContainer: boolean\n}\ninterface ModuleAcc {\n label: string\n icon?: IconName\n order: number\n groups: Map<string, GroupAcc>\n}\n\n/** A single route, reduced to what the menu needs. */\nexport interface NavRoute {\n fullPath: string\n staticData?: StaticDataRouteOption\n}\n\n/**\n * Pure menu builder — derives the 3-level nav tree (module → group → page) from a flat route list.\n * Kept router-free so it's unit-testable; `useNavTree` feeds it the live routes.\n */\nexport function buildNavTree(routes: NavRoute[]): { links: NavLeaf[]; modules: NavModule[] } {\n const entries: Array<{ path: string; name: string; sd: StaticDataRouteOption }> = []\n for (const route of routes) {\n const sd = route.staticData\n const path = trimSlashes(route.fullPath)\n if (!sd?.name || !path) continue\n entries.push({ path, name: sd.name, sd })\n }\n\n const metaByPath = new Map(entries.map((e) => [e.path, e]))\n const paths = entries.map((e) => e.path)\n const isContainer = (p: string) => paths.some((o) => o !== p && o.startsWith(`${p}/`))\n const rawFullPaths = new Set(routes.map((r) => r.fullPath))\n const groupHasOwnPage = (groupKey: string) => rawFullPaths.has(`/${groupKey}/`)\n\n const chrome = (key: string, seg: string) => {\n const e = metaByPath.get(key)\n return {\n label: e?.name ?? prettify(seg),\n icon: e?.sd.icon,\n badge: e?.sd.badge,\n dot: e?.sd.dot,\n order: e?.sd.order ?? Number.POSITIVE_INFINITY,\n }\n }\n\n const modules = new Map<string, ModuleAcc>()\n const getModule = (seg: string) => {\n let mod = modules.get(seg)\n if (!mod) {\n const c = chrome(seg, seg)\n mod = { label: c.label, icon: c.icon, order: c.order, groups: new Map() }\n modules.set(seg, mod)\n }\n return mod\n }\n\n const topLinks: LeafAcc[] = []\n for (const { path, name, sd } of entries) {\n const segs = path.split('/')\n // The menu is 3 levels deep by design (module → group → page). A path only counts as a\n // \"container\" (holds children instead of being its own row) at the module/group levels; a\n // depth-3+ route is always a leaf, so a named page with even-deeper children isn't dropped.\n // Routes deeper than 3 segments still appear — flattened as leaves under their depth-2 group\n // (their `to` stays correct) — the nav just can't nest beyond level 3.\n if ((segs.length <= 2 && isContainer(path)) || sd.hidden) continue\n if (segs.length === 1) {\n topLinks.push({\n label: name,\n to: `/${path}`,\n icon: sd.icon,\n badge: sd.badge,\n dot: sd.dot,\n order: sd.order ?? Number.POSITIVE_INFINITY,\n })\n continue\n }\n const mod = getModule(segs[0])\n if (segs.length === 2) {\n mod.groups.set(path, {\n label: name,\n icon: sd.icon,\n to: `/${path}`,\n badge: sd.badge,\n dot: sd.dot,\n order: sd.order ?? Number.POSITIVE_INFINITY,\n leaves: [],\n isContainer: false,\n })\n } else {\n const groupKey = segs.slice(0, 2).join('/')\n let group = mod.groups.get(groupKey)\n if (!group) {\n const c = chrome(groupKey, segs[1])\n group = {\n label: c.label,\n icon: c.icon,\n badge: c.badge,\n dot: c.dot,\n order: c.order,\n to: groupHasOwnPage(groupKey) ? `/${groupKey}` : undefined,\n leaves: [],\n isContainer: true,\n }\n mod.groups.set(groupKey, group)\n }\n group.leaves.push({\n label: name,\n to: `/${path}`,\n icon: sd.icon,\n badge: sd.badge,\n dot: sd.dot,\n order: sd.order ?? Number.POSITIVE_INFINITY,\n })\n }\n }\n\n return {\n links: topLinks\n .sort(byOrderThenLabel)\n .map((l) => ({ label: l.label, to: l.to, icon: l.icon, badge: l.badge, dot: l.dot })),\n modules: [...modules.values()].sort(byOrderThenLabel).map(\n (mod): NavModule => ({\n module: mod.label,\n icon: mod.icon,\n groups: [...mod.groups.values()].sort(byOrderThenLabel).map(\n (g): NavGroup => ({\n label: g.label,\n icon: g.icon,\n to: g.to,\n badge: g.badge,\n dot: g.dot,\n children: g.isContainer\n ? g.leaves.sort(byOrderThenLabel).map((l) => ({\n label: l.label,\n to: l.to,\n icon: l.icon,\n badge: l.badge,\n dot: l.dot,\n }))\n : undefined,\n }),\n ),\n }),\n ),\n }\n}\n\nfunction useNavTree(): { links: NavLeaf[]; modules: NavModule[] } {\n const router = useRouter()\n const accessKeys = useAccessKeys() // re-render the menu when the user's roles change (login/logout)\n return useMemo(\n () =>\n buildNavTree(\n Object.values(router.looseRoutesById)\n .map((route) => ({\n fullPath: route.fullPath,\n staticData: route.options?.staticData,\n }))\n // Drop pages the current user can't access — empty groups/modules then vanish on their own.\n .filter((route) => hasAccess(route.staticData?.roles)),\n ),\n [router, accessKeys],\n )\n}\n\n/** The first menu destination (top link, else first group/leaf) — used by `FirstRouteRedirect`. */\nexport function firstNavTo(tree: { links: NavLeaf[]; modules: NavModule[] }): string | undefined {\n if (tree.links[0]) return tree.links[0].to\n for (const mod of tree.modules)\n for (const group of mod.groups) {\n if (group.to) return group.to\n const firstChild = group.children?.[0]\n if (firstChild) return firstChild.to\n }\n return undefined\n}\n\nfunction useFirstNavTo() {\n return firstNavTo(useNavTree())\n}\n\n/**\n * A `normalized fullPath → staticData.name` map from **all** routes (index routes included), the same\n * route source the `Sidebar` walks. The key drops a single trailing slash (`/core/list/` → `/core/list`),\n * so a list's **index route** (which carries the name) resolves under the plain path too. A named route\n * never loses its slot to an unnamed one. Pure + router-free, so it's unit-testable.\n */\nexport function buildNameMap(routes: NavRoute[]): Map<string, string> {\n const map = new Map<string, string>()\n for (const route of routes) {\n const name = route.staticData?.name\n if (!name) continue\n const key = normalizePath(route.fullPath)\n if (!map.has(key)) map.set(key, name)\n }\n return map\n}\n\n/**\n * Resolve a pathname's name crumbs from its **cumulative path prefixes** (not the matched-route chain),\n * so a dynamic/detail leaf (e.g. `/core/list/$id`) inherits its named ancestors. Each prefix is looked\n * up in `nameMap` (trailing slashes already normalized on both sides); a prefix with no name is simply\n * **skipped** — it never breaks the chain. Returns the recognized crumbs in order, each with its `to`.\n */\nexport function resolvePathNames(\n pathname: string,\n nameMap: Map<string, string>,\n): Array<{ name: string; to: string }> {\n const out: Array<{ name: string; to: string }> = []\n let prefix = ''\n for (const seg of trimSlashes(pathname).split('/').filter(Boolean)) {\n prefix += `/${seg}` // accumulates `/core`, `/core/list`, … — never trailing-slashed\n const name = nameMap.get(prefix)\n if (name) out.push({ name, to: prefix })\n }\n return out\n}\n\nfunction useNameMap(): Map<string, string> {\n const router = useRouter()\n return useMemo(\n () =>\n buildNameMap(\n Object.values(router.looseRoutesById).map((route) => ({\n fullPath: route.fullPath,\n staticData: route.options?.staticData,\n })),\n ),\n [router],\n )\n}\n\n/**\n * The current page's title — the **last** recognized name along the current pathname's cumulative\n * prefixes (see `resolvePathNames`), so a dynamic detail route inherits its parent list's name instead\n * of falling back to the nearest named ancestor. Used by `RootLayout` to label the header automatically.\n */\nexport function usePageTitle(): string | undefined {\n const nameMap = useNameMap()\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n const names = resolvePathNames(pathname, nameMap)\n return names.length > 0 ? names[names.length - 1].name : undefined\n}\n\n/** One breadcrumb. `to` is set only when the crumb points at a real, navigable menu page. */\nexport interface Breadcrumb {\n label: string\n to?: string\n}\n\n/** Every `to` that the menu actually navigates to (top links, group pages, leaves). */\nfunction navigablePaths(tree: { links: NavLeaf[]; modules: NavModule[] }): Set<string> {\n const set = new Set<string>()\n for (const link of tree.links) set.add(link.to)\n for (const mod of tree.modules)\n for (const group of mod.groups) {\n if (group.to) set.add(group.to)\n for (const leaf of group.children ?? []) set.add(leaf.to)\n }\n return set\n}\n\n/**\n * Breadcrumb trail for the current route, derived from the current pathname's **cumulative prefixes**\n * (via `resolvePathNames`) rather than the matched-route chain — so a dynamic/detail route (e.g.\n * `/core/list/$id`) still shows its named ancestors (Core › List) instead of collapsing to the nearest\n * named one. `homeTo` is the first allowed menu page (same target as `FirstRouteRedirect`). Intermediate\n * crumbs link only when they map to a real navigable page; the last crumb (the current page) is always\n * plain text.\n */\nexport function useBreadcrumbs(): { homeTo?: string; items: Breadcrumb[] } {\n const tree = useNavTree()\n const nameMap = useNameMap()\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n const homeTo = firstNavTo(tree)\n const navigable = navigablePaths(tree)\n\n const items: Breadcrumb[] = resolvePathNames(pathname, nameMap).map(({ name, to }) => ({\n label: name,\n to: navigable.has(to) ? to : undefined,\n }))\n // The current page is where you already are — never a link.\n if (items.length > 0) items[items.length - 1] = { label: items[items.length - 1].label }\n return { homeTo, items }\n}\n\n/** Drop-in component for the `/` route: forwards to whatever sits FIRST in the menu. */\nexport function FirstRouteRedirect() {\n const to = useFirstNavTo()\n return to ? <Navigate to={to as LinkProps['to']} /> : null\n}\n\n/** Auto-generated navigation, derived from the routes' `staticData`. Rendered inside `RootLayout`. */\nexport function Sidebar() {\n const { links, modules } = useNavTree()\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n\n return (\n <nav className={styles.nav}>\n {links.length > 0 ? (\n <List>\n {links.map((link) => (\n <NavLink\n key={link.to}\n as={Link}\n to={link.to}\n icon={link.icon}\n selected={isActivePath(pathname, link.to)}\n clickable\n trailing={navTrailing(link.badge, link.dot)}\n >\n {link.label}\n </NavLink>\n ))}\n </List>\n ) : null}\n {modules.map((mod) => (\n <div className={styles.module} key={mod.module}>\n <div className={styles.moduleLabel}>{mod.module}</div>\n <List>\n {mod.groups.map((group) => (\n <NavGroupItem key={group.label} group={group} pathname={pathname} />\n ))}\n </List>\n </div>\n ))}\n </nav>\n )\n}\n\n/** A single searchable destination — a nav page flattened out of the tree, with a breadcrumb context. */\ninterface NavPage {\n label: string\n to: string\n /** Where it lives — e.g. `\"Components · Forms\"` — shown as the muted second line. */\n context?: string\n}\n\n/** Flatten the nav tree into every navigable page (top links + group pages + leaves). */\nfunction flattenPages(tree: { links: NavLeaf[]; modules: NavModule[] }): NavPage[] {\n const pages: NavPage[] = []\n for (const link of tree.links) pages.push({ label: link.label, to: link.to })\n for (const mod of tree.modules)\n for (const group of mod.groups) {\n if (group.to) pages.push({ label: group.label, to: group.to, context: mod.module })\n for (const leaf of group.children ?? [])\n pages.push({\n label: leaf.label,\n to: leaf.to,\n context: `${mod.module} · ${group.label}`,\n })\n }\n return pages\n}\n\nconst MAX_SEARCH_RESULTS = 8\n\n/**\n * Header search over the sidebar's pages — type to filter the nav (by page name or its section) and\n * pick a suggestion to jump there. Data comes from the same `useNavTree` the sidebar uses (so it\n * respects RBAC). Keyboard: Up/Down move, Enter opens, Escape closes. Rendered by `RootLayout`'s header.\n */\nexport function NavSearch() {\n const t = useT()\n const tree = useNavTree()\n const navigate = useNavigate()\n const pages = useMemo(() => flattenPages(tree), [tree])\n\n const [query, setQuery] = useState('')\n const [open, setOpen] = useState(false)\n const [active, setActive] = useState(0)\n const rootRef = useRef<HTMLDivElement | null>(null)\n\n const results = useMemo(() => {\n const q = query.trim().toLowerCase()\n if (!q) return []\n return pages\n .filter(\n (p) => p.label.toLowerCase().includes(q) || (p.context?.toLowerCase().includes(q) ?? false),\n )\n .slice(0, MAX_SEARCH_RESULTS)\n }, [pages, query])\n\n const showList = open && results.length > 0\n\n // reset the highlighted row whenever the query changes\n useEffect(() => setActive(0), [query])\n\n // clamp the highlight if the result set shrinks without a query change (e.g. RBAC pages update)\n useEffect(() => {\n setActive((a) => (a > results.length - 1 ? Math.max(0, results.length - 1) : a))\n }, [results.length])\n\n // close the suggestions on an outside pointerdown\n useEffect(() => {\n if (!open) return\n const onDown = (event: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(event.target as Node)) setOpen(false)\n }\n document.addEventListener('pointerdown', onDown)\n return () => document.removeEventListener('pointerdown', onDown)\n }, [open])\n\n const go = (to: string) => {\n navigate({ to: to as LinkProps['to'] })\n setQuery('')\n setOpen(false)\n }\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (!showList) return\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setActive((i) => (i + 1) % results.length)\n } else if (event.key === 'ArrowUp') {\n event.preventDefault()\n setActive((i) => (i - 1 + results.length) % results.length)\n } else if (event.key === 'Enter') {\n event.preventDefault()\n const hit = results[active]\n if (hit) go(hit.to)\n } else if (event.key === 'Escape') {\n setOpen(false)\n }\n }\n\n return (\n <div\n ref={rootRef}\n className={styles.search}\n role=\"combobox\"\n aria-expanded={showList}\n aria-haspopup=\"listbox\"\n >\n <TextField\n value={query}\n onChange={(event: ChangeEvent<HTMLInputElement>) => {\n setQuery(event.target.value)\n setOpen(true)\n }}\n onFocus={() => setOpen(true)}\n onKeyDown={onKeyDown}\n adornment={<Icon name=\"SearchNormal\" />}\n placeholder={t('sidebar.searchPages')}\n aria-label={t('sidebar.searchPages')}\n autoComplete=\"off\"\n />\n {showList ? (\n <div className={styles.searchPanel}>\n <List role=\"listbox\">\n {results.map((page, i) => (\n <ListItem\n key={page.to}\n description={page.context}\n clickable\n selected={i === active}\n // keep the input focused through the click so blur doesn't close the list first\n onMouseDown={(event: MouseEvent) => event.preventDefault()}\n onMouseEnter={() => setActive(i)}\n onClick={() => go(page.to)}\n >\n {page.label}\n </ListItem>\n ))}\n </List>\n </div>\n ) : null}\n </div>\n )\n}\n\n/**\n * Is `to` the active nav target for `currentPath`? True on an **exact** match or when `currentPath` is a\n * **descendant** of `to` (so a parent row highlights for its child routes, e.g. `/core/page` stays active\n * on `/core/page/edit`). Trailing slashes are normalized on both sides (`/x/` === `/x`). The root `/`\n * matches **only exactly** — otherwise every route would count as its descendant.\n */\nexport function isActivePath(currentPath: string, to: string): boolean {\n const a = normalizePath(currentPath)\n const b = normalizePath(to)\n if (b === '/') return a === '/'\n return a === b || a.startsWith(b + '/')\n}\n\nfunction groupIsActive(group: NavGroup, pathname: string): boolean {\n if (group.to && isActivePath(pathname, group.to)) return true\n return group.children?.some((leaf) => isActivePath(pathname, leaf.to)) ?? false\n}\n\n/** A small \"New\"-style pill rendered on a menu row from `staticData.badge`. */\nfunction navBadge(text?: string) {\n return text ? <span className={styles.navBadge}>{text}</span> : null\n}\n\n/** A small colored dot indicator on a menu row from `staticData.dot`. */\nfunction navDot(color?: ThemeColor) {\n return color ? (\n <span className={styles.navDot} style={{ background: `var(--tz-color-${color})` }} />\n ) : null\n}\n\n/** The menu row's trailing slot: dot + badge + an optional chevron (omitted entirely when empty). */\nfunction navTrailing(badge?: string, dot?: ThemeColor, chevron?: ReactNode): ReactNode {\n if (badge == null && dot == null && chevron == null) return undefined\n return (\n <>\n {navBadge(badge)}\n {navDot(dot)}\n {chevron}\n </>\n )\n}\n\nfunction NavGroupItem({ group, pathname }: { group: NavGroup; pathname: string }) {\n const active = groupIsActive(group, pathname)\n const hasChildren = !!group.children?.length\n const [open, setOpen] = useState(active)\n\n // re-open when navigation makes this group active via a path the mount-time seed missed\n // (NavSearch, Breadcrumbs, back/forward) — collapsing an active group hides the current page\n useEffect(() => {\n if (active) setOpen(true)\n }, [active])\n\n // a plain level-2 page (no children) — just a link row\n if (!hasChildren && group.to) {\n return (\n <NavLink\n as={Link}\n to={group.to}\n icon={group.icon}\n selected={active}\n clickable\n trailing={navTrailing(group.badge, group.dot)}\n >\n {group.label}\n </NavLink>\n )\n }\n\n const chevron = (\n <Icon\n name=\"ArrowDown4\"\n size=\"sm\"\n className={styles.chevron}\n data-open={open ? 'true' : 'false'}\n />\n )\n\n return (\n <>\n {hasChildren && group.to ? (\n // \"Case B\": the row navigates (and expands); a separate chevron only toggles.\n <NavLink\n as={Link}\n to={group.to}\n icon={group.icon}\n selected={active}\n clickable\n onClick={() => setOpen(true)}\n trailing={navTrailing(\n group.badge,\n group.dot,\n <button\n type=\"button\"\n className={styles.chevronButton}\n aria-label={`${open ? 'Collapse' : 'Expand'} ${group.label}`}\n aria-expanded={open}\n onClick={(event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n setOpen((o) => !o)\n }}\n >\n {chevron}\n </button>,\n )}\n >\n {group.label}\n </NavLink>\n ) : (\n // a pure container — the whole row toggles its children\n <ListItem\n icon={group.icon}\n selected={active}\n clickable\n aria-expanded={open}\n onClick={() => setOpen((o) => !o)}\n trailing={navTrailing(group.badge, group.dot, chevron)}\n >\n {group.label}\n </ListItem>\n )}\n {hasChildren ? (\n // smooth collapse, same grid-template-rows technique as Card\n <div className={clsx(styles.collapsible, !open && styles.collapsibleClosed)}>\n <div className={styles.collapsibleInner}>\n <List className={styles.leaves}>\n {group.children?.map((leaf) => (\n <NavLink\n key={leaf.to}\n as={Link}\n to={leaf.to}\n icon={<span className={styles.leafDot} />}\n selected={isActivePath(pathname, leaf.to)}\n size=\"md\"\n clickable\n trailing={navTrailing(leaf.badge, leaf.dot)}\n >\n {leaf.label}\n </NavLink>\n ))}\n </List>\n </div>\n </div>\n ) : null}\n </>\n )\n}\n"],"names":["NavLink","ListItem","prettify","seg","w","trimSlashes","p","normalizePath","byOrderThenLabel","a","b","buildNavTree","routes","entries","route","sd","path","metaByPath","e","paths","isContainer","o","rawFullPaths","r","groupHasOwnPage","groupKey","chrome","key","modules","getModule","mod","c","topLinks","name","segs","group","l","g","useNavTree","router","useRouter","accessKeys","useAccessKeys","useMemo","_a","hasAccess","firstNavTo","tree","firstChild","useFirstNavTo","buildNameMap","map","resolvePathNames","pathname","nameMap","out","prefix","useNameMap","usePageTitle","useRouterState","s","names","navigablePaths","set","link","leaf","useBreadcrumbs","homeTo","navigable","items","to","FirstRouteRedirect","jsx","Navigate","Sidebar","links","jsxs","styles","List","Link","isActivePath","navTrailing","NavGroupItem","flattenPages","pages","MAX_SEARCH_RESULTS","NavSearch","t","useT","navigate","useNavigate","query","setQuery","useState","open","setOpen","active","setActive","rootRef","useRef","results","q","showList","useEffect","onDown","event","go","onKeyDown","i","hit","TextField","Icon","page","currentPath","groupIsActive","navBadge","text","navDot","color","badge","dot","chevron","Fragment","hasChildren","clsx","_b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;GA8BMA,IAAUC,GA6CVC,KAAW,CAACC,MAChBA,EACG,MAAM,GAAG,EACT,IAAI,CAACC,MAAMA,EAAE,OAAO,CAAC,EAAE,gBAAgBA,EAAE,MAAM,CAAC,CAAC,EACjD,KAAK,GAAG,GACPC,IAAc,CAACC,MAAcA,EAAE,QAAQ,cAAc,EAAE,GAEvDC,IAAgB,CAACD,MAAeA,EAAE,SAAS,KAAKA,EAAE,SAAS,GAAG,IAAIA,EAAE,MAAM,GAAG,EAAE,IAAIA,GACnFE,IAAmB,CACvBC,GACAC,MACGD,EAAE,QAAQC,EAAE,SAASD,EAAE,MAAM,cAAcC,EAAE,KAAK;AAqChD,SAASC,GAAaC,GAAgE;AAC3F,QAAMC,IAA4E,CAAA;AAClF,aAAWC,KAASF,GAAQ;AAC1B,UAAMG,IAAKD,EAAM,YACXE,IAAOX,EAAYS,EAAM,QAAQ;AACvC,IAAI,EAACC,KAAA,QAAAA,EAAI,SAAQ,CAACC,KAClBH,EAAQ,KAAK,EAAE,MAAAG,GAAM,MAAMD,EAAG,MAAM,IAAAA,GAAI;AAAA,EAC1C;AAEA,QAAME,IAAa,IAAI,IAAIJ,EAAQ,IAAI,CAACK,MAAM,CAACA,EAAE,MAAMA,CAAC,CAAC,CAAC,GACpDC,IAAQN,EAAQ,IAAI,CAACK,MAAMA,EAAE,IAAI,GACjCE,IAAc,CAACd,MAAca,EAAM,KAAK,CAACE,MAAMA,MAAMf,KAAKe,EAAE,WAAW,GAAGf,CAAC,GAAG,CAAC,GAC/EgB,IAAe,IAAI,IAAIV,EAAO,IAAI,CAACW,MAAMA,EAAE,QAAQ,CAAC,GACpDC,IAAkB,CAACC,MAAqBH,EAAa,IAAI,IAAIG,CAAQ,GAAG,GAExEC,IAAS,CAACC,GAAaxB,MAAgB;AAC3C,U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AAM,gBAAAO,EAAC,QAAA,EAAK,WAAWK,EAAO,SAAS;AAAA,UACvC,UAAUG,EAAa3B,GAAUY,EAAK,EAAE;AAAA,UACxC,MAAK;AAAA,UACL,WAAS;AAAA,UACT,UAAUgB,EAAYhB,EAAK,OAAOA,EAAK,GAAG;AAAA,UAEzC,UAAAA,EAAK;AAAA,QAAA;AAAA,QATDA,EAAK;AAAA,MAAA,GAWb,CACH,EAAA,CACF,EAAA,CACF;AAAA,QACE;AAAA,EAAA,GACN;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../Breadcrumbs-BnxhmyK5.cjs");exports.Breadcrumbs=e.Breadcrumbs;exports.default=e.Breadcrumbs;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../Breadcrumbs-D8hvHveR.cjs");exports.Breadcrumbs=e.Breadcrumbs;exports.default=e.Breadcrumbs;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { B as e, B as s } from "../../Breadcrumbs-DvgctFLS.js";
1
+ import { B as e, B as s } from "../../Breadcrumbs-CtljA45l.js";
2
2
  export {
3
3
  e as Breadcrumbs,
4
4
  s as default
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../PageNotFound-CxLUFoJa.cjs");exports.PageNotFound=e.PageNotFound;exports.default=e.PageNotFound;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../PageNotFound-BFAhRHpY.cjs");exports.PageNotFound=e.PageNotFound;exports.default=e.PageNotFound;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { P as e, P as t } from "../../PageNotFound-CmT-Wr9m.js";
1
+ import { P as e, P as t } from "../../PageNotFound-UNkPJi-L.js";
2
2
  export {
3
3
  e as PageNotFound,
4
4
  t as default
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../RootLayout-CxMadTU1.cjs");exports.RootLayout=o.RootLayout;exports.default=o.RootLayout;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../RootLayout-CCQBRBxR.cjs");exports.RootLayout=o.RootLayout;exports.default=o.RootLayout;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { R as t, R } from "../../RootLayout-CqQZ6h5c.js";
1
+ import { R as t, R } from "../../RootLayout-DPS3gG53.js";
2
2
  export {
3
3
  t as RootLayout,
4
4
  R as default
@@ -59,8 +59,26 @@ export declare function firstNavTo(tree: {
59
59
  modules: NavModule[];
60
60
  }): string | undefined;
61
61
  /**
62
- * The current page's title — the `staticData.name` of the deepest matched route that declares one.
63
- * Used by `RootLayout` to label the header automatically (e.g. "Dashboard").
62
+ * A `normalized fullPath staticData.name` map from **all** routes (index routes included), the same
63
+ * route source the `Sidebar` walks. The key drops a single trailing slash (`/core/list/` → `/core/list`),
64
+ * so a list's **index route** (which carries the name) resolves under the plain path too. A named route
65
+ * never loses its slot to an unnamed one. Pure + router-free, so it's unit-testable.
66
+ */
67
+ export declare function buildNameMap(routes: NavRoute[]): Map<string, string>;
68
+ /**
69
+ * Resolve a pathname's name crumbs from its **cumulative path prefixes** (not the matched-route chain),
70
+ * so a dynamic/detail leaf (e.g. `/core/list/$id`) inherits its named ancestors. Each prefix is looked
71
+ * up in `nameMap` (trailing slashes already normalized on both sides); a prefix with no name is simply
72
+ * **skipped** — it never breaks the chain. Returns the recognized crumbs in order, each with its `to`.
73
+ */
74
+ export declare function resolvePathNames(pathname: string, nameMap: Map<string, string>): Array<{
75
+ name: string;
76
+ to: string;
77
+ }>;
78
+ /**
79
+ * The current page's title — the **last** recognized name along the current pathname's cumulative
80
+ * prefixes (see `resolvePathNames`), so a dynamic detail route inherits its parent list's name instead
81
+ * of falling back to the nearest named ancestor. Used by `RootLayout` to label the header automatically.
64
82
  */
65
83
  export declare function usePageTitle(): string | undefined;
66
84
  /** One breadcrumb. `to` is set only when the crumb points at a real, navigable menu page. */
@@ -69,10 +87,12 @@ export interface Breadcrumb {
69
87
  to?: string;
70
88
  }
71
89
  /**
72
- * Breadcrumb trail for the current route, derived from the active match chain: one crumb per matched
73
- * route that declares a `staticData.name` (module group page). `homeTo` is the first allowed menu
74
- * page (same target as `FirstRouteRedirect`). Intermediate crumbs link only when they map to a real
75
- * navigable page; the last crumb (the current page) is always plain text.
90
+ * Breadcrumb trail for the current route, derived from the current pathname's **cumulative prefixes**
91
+ * (via `resolvePathNames`) rather than the matched-route chain so a dynamic/detail route (e.g.
92
+ * `/core/list/$id`) still shows its named ancestors (Core List) instead of collapsing to the nearest
93
+ * named one. `homeTo` is the first allowed menu page (same target as `FirstRouteRedirect`). Intermediate
94
+ * crumbs link only when they map to a real navigable page; the last crumb (the current page) is always
95
+ * plain text.
76
96
  */
77
97
  export declare function useBreadcrumbs(): {
78
98
  homeTo?: string;
@@ -88,3 +108,10 @@ export declare function Sidebar(): import("react/jsx-runtime").JSX.Element;
88
108
  * respects RBAC). Keyboard: Up/Down move, Enter opens, Escape closes. Rendered by `RootLayout`'s header.
89
109
  */
90
110
  export declare function NavSearch(): import("react/jsx-runtime").JSX.Element;
111
+ /**
112
+ * Is `to` the active nav target for `currentPath`? True on an **exact** match or when `currentPath` is a
113
+ * **descendant** of `to` (so a parent row highlights for its child routes, e.g. `/core/page` stays active
114
+ * on `/core/page/edit`). Trailing slashes are normalized on both sides (`/x/` === `/x`). The root `/`
115
+ * matches **only exactly** — otherwise every route would count as its descendant.
116
+ */
117
+ export declare function isActivePath(currentPath: string, to: string): boolean;