@pstdio/ui 0.45.0 → 0.46.0-nightly.20261024001730

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 (77) hide show
  1. package/dist/{MermaidComponent--W7gDFCk.js → MermaidComponent-BTJWjd_T.js} +3 -3
  2. package/dist/{MermaidComponent--W7gDFCk.js.map → MermaidComponent-BTJWjd_T.js.map} +1 -1
  3. package/dist/chat-ui.d.ts +2 -2
  4. package/dist/chat-ui.js +924 -934
  5. package/dist/chat-ui.js.map +1 -1
  6. package/dist/{collection-view-grouping-BHuFPVAV.js → collection-page-C3j-h1JH.js} +23 -3
  7. package/dist/collection-page-C3j-h1JH.js.map +1 -0
  8. package/dist/{collection-view-search-CLvyY0cg.js → collection-view-search-DiSUDYU2.js} +47 -44
  9. package/dist/collection-view-search-DiSUDYU2.js.map +1 -0
  10. package/dist/collection-view.d.ts +3 -76
  11. package/dist/collection-view.js +2 -2
  12. package/dist/data-table.d.ts +4 -1
  13. package/dist/data-table.js +616 -565
  14. package/dist/data-table.js.map +1 -1
  15. package/dist/{diff-drawer-COlghuX8.js → diff-drawer-IV-OiDxD.js} +2 -2
  16. package/dist/{diff-drawer-COlghuX8.js.map → diff-drawer-IV-OiDxD.js.map} +1 -1
  17. package/dist/{diff-viewer-nCYtig03.js → diff-viewer-Ck7aEJ4M.js} +5 -5
  18. package/dist/{diff-viewer-nCYtig03.js.map → diff-viewer-Ck7aEJ4M.js.map} +1 -1
  19. package/dist/diff.js +2 -2
  20. package/dist/{display-sort-control-DXXkOgUC.js → display-sort-control-BD0Zyiag.js} +6 -6
  21. package/dist/{display-sort-control-DXXkOgUC.js.map → display-sort-control-BD0Zyiag.js.map} +1 -1
  22. package/dist/{edit-mode-data-table-lvGsQ1Da.js → edit-mode-data-table-B1I-A3MA.js} +535 -521
  23. package/dist/edit-mode-data-table-B1I-A3MA.js.map +1 -0
  24. package/dist/{index-DYCXgPCg.d.ts → index-BFMTwV4o.d.ts} +28 -4
  25. package/dist/index-Bk6mxsH4.d.ts +77 -0
  26. package/dist/{index-DzVOXj8n.d.ts → index-CngCuhvm.d.ts} +1 -0
  27. package/dist/index.d.ts +24 -2
  28. package/dist/index.js +478 -502
  29. package/dist/index.js.map +1 -1
  30. package/dist/kanban-renderer.d.ts +1 -1
  31. package/dist/kanban-renderer.js +707 -620
  32. package/dist/kanban-renderer.js.map +1 -1
  33. package/dist/{list-row-Dqb5Xfjf.js → list-row-kLM6WuQG.js} +449 -351
  34. package/dist/list-row-kLM6WuQG.js.map +1 -0
  35. package/dist/{markdown-editor-D419iTD2.js → markdown-editor-BdLGFMwE.js} +6 -6
  36. package/dist/{markdown-editor-D419iTD2.js.map → markdown-editor-BdLGFMwE.js.map} +1 -1
  37. package/dist/{mermaid-renderer-B8LpF3rD.js → mermaid-renderer-BRlf9f7T.js} +2 -2
  38. package/dist/{mermaid-renderer-B8LpF3rD.js.map → mermaid-renderer-BRlf9f7T.js.map} +1 -1
  39. package/dist/mermaid.js +1 -1
  40. package/dist/{number-input-DzRvKj64.js → number-input-BDNXzwm4.js} +2 -2
  41. package/dist/{number-input-DzRvKj64.js.map → number-input-BDNXzwm4.js.map} +1 -1
  42. package/dist/{param-editor-DyIO1rSf.js → param-editor-DjiG9M21.js} +2 -2
  43. package/dist/{param-editor-DyIO1rSf.js.map → param-editor-DjiG9M21.js.map} +1 -1
  44. package/dist/{param-editor-field-Bt7NP9OH.js → param-editor-field-A7rxJt6F.js} +5 -5
  45. package/dist/{param-editor-field-Bt7NP9OH.js.map → param-editor-field-A7rxJt6F.js.map} +1 -1
  46. package/dist/param-editor.js +3 -3
  47. package/dist/prism-JmhzmG59.js +428 -0
  48. package/dist/prism-JmhzmG59.js.map +1 -0
  49. package/dist/{rich-text-DBpBdWtn.js → rich-text-Chu0mWpT.js} +11 -14
  50. package/dist/rich-text-Chu0mWpT.js.map +1 -0
  51. package/dist/rich-text.d.ts +1 -1
  52. package/dist/rich-text.js +3 -3
  53. package/dist/scroll-area-BEKr-RLs.js +117 -0
  54. package/dist/scroll-area-BEKr-RLs.js.map +1 -0
  55. package/dist/terminal.js +1 -1
  56. package/dist/{theme-rmCwx-aG.js → theme-DOfFdMxV.js} +41 -11
  57. package/dist/theme-DOfFdMxV.js.map +1 -0
  58. package/dist/theme.js +1 -1
  59. package/dist/{tree-list-Bg8U7ZYc.js → tree-list-UO26kzU6.js} +493 -390
  60. package/dist/tree-list-UO26kzU6.js.map +1 -0
  61. package/dist/{workspace-badge-Dqi-Sh_Q.js → workspace-badge-dFFG6MXy.js} +2 -2
  62. package/dist/{workspace-badge-Dqi-Sh_Q.js.map → workspace-badge-dFFG6MXy.js.map} +1 -1
  63. package/examples/performance/README.md +11 -0
  64. package/examples/performance/extension.ts +18 -0
  65. package/examples/performance/view.tsx +57 -0
  66. package/package.json +4 -3
  67. package/dist/collection-view-grouping-BHuFPVAV.js.map +0 -1
  68. package/dist/collection-view-search-CLvyY0cg.js.map +0 -1
  69. package/dist/edit-mode-data-table-lvGsQ1Da.js.map +0 -1
  70. package/dist/list-row-Dqb5Xfjf.js.map +0 -1
  71. package/dist/prism-CQBZiF5P.js +0 -391
  72. package/dist/prism-CQBZiF5P.js.map +0 -1
  73. package/dist/rich-text-DBpBdWtn.js.map +0 -1
  74. package/dist/scroll-area-BfAlvhjh.js +0 -102
  75. package/dist/scroll-area-BfAlvhjh.js.map +0 -1
  76. package/dist/theme-rmCwx-aG.js.map +0 -1
  77. package/dist/tree-list-Bg8U7ZYc.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { c as e, l as t, n, s as r, t as i } from "./list-row-Dqb5Xfjf.js";
1
+ import { c as e, l as t, n, s as r, t as i } from "./list-row-kLM6WuQG.js";
2
2
  import { t as a } from "./use-virtualizer-B6ABIiNI.js";
3
3
  import { t as o } from "./split-panel-motion-context-B8QvAyTv.js";
4
4
  import { t as s } from "./drop-indicator-66rhST1K.js";
@@ -64,11 +64,11 @@ var U = {
64
64
  size: r ? 0 : q(n, e.minSize, e.maxSize),
65
65
  collapsed: r
66
66
  };
67
- }, Q = 250, te = [
67
+ }, te = 250, Q = [
68
68
  0,
69
69
  1,
70
70
  2
71
- ], ne = (e) => e ? {
71
+ ], $ = (e) => e ? {
72
72
  hitArea: {
73
73
  top: 0,
74
74
  bottom: 0,
@@ -96,9 +96,9 @@ var U = {
96
96
  h: "0.5",
97
97
  transform: "translateY(-50%)"
98
98
  }
99
- }, re = (e) => {
99
+ }, ne = (e) => {
100
100
  let t = _(4), { active: n, layout: r } = e, i = r.gripDirection, a = +!n, o;
101
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = te.map(oe), t[0] = o) : o = t[0];
101
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = Q.map(ae), t[0] = o) : o = t[0];
102
102
  let s;
103
103
  return t[1] !== r.gripDirection || t[2] !== a ? (s = /* @__PURE__ */ y(l, {
104
104
  "data-part": "grip",
@@ -108,7 +108,7 @@ var U = {
108
108
  transition: "opacity 120ms ease",
109
109
  children: o
110
110
  }), t[1] = r.gripDirection, t[2] = a, t[3] = s) : s = t[3], s;
111
- }, ie = (e) => {
111
+ }, re = (e) => {
112
112
  let t = _(3), { active: n, layout: r } = e, i = +!!n, a;
113
113
  return t[0] !== r.bar || t[1] !== i ? (a = /* @__PURE__ */ y(c, {
114
114
  "data-part": "bar",
@@ -120,9 +120,9 @@ var U = {
120
120
  pointerEvents: "none",
121
121
  ...r.bar
122
122
  }), t[0] = r.bar, t[1] = i, t[2] = a) : a = t[2], a;
123
- }, ae = (e) => {
123
+ }, ie = (e) => {
124
124
  let t = _(44), { css: n, axis: r, bounds: i, collapsed: a, collapsible: o, contentPanelId: s, dragging: l, resizablePanelId: u, resizeLabel: d, resolvedPanelSize: f, separator: p, separatorRef: m, onCollapse: h, onResizeKeyDown: g, onResizeStart: v } = e, x = p === "line", S = r.separatorOrientation === "vertical", C;
125
- t[0] === S ? C = t[1] : (C = ne(S), t[0] = S, t[1] = C);
125
+ t[0] === S ? C = t[1] : (C = $(S), t[0] = S, t[1] = C);
126
126
  let T = C, [O, k] = D(!1), A = E(0), j = O || l, M;
127
127
  t[2] === a ? M = t[3] : (M = a ? {
128
128
  "aria-hidden": !0,
@@ -132,7 +132,7 @@ var U = {
132
132
  t[4] === Symbol.for("react.memo_cache_sentinel") ? (P = () => () => window.clearTimeout(A.current), F = [], t[4] = P, t[5] = F) : (P = t[4], F = t[5]), w(P, F);
133
133
  let I;
134
134
  t[6] === Symbol.for("react.memo_cache_sentinel") ? (I = () => {
135
- A.current = window.setTimeout(() => k(!0), Q);
135
+ A.current = window.setTimeout(() => k(!0), te);
136
136
  }, t[6] = I) : I = t[6];
137
137
  let L = I, R;
138
138
  t[7] === Symbol.for("react.memo_cache_sentinel") ? (R = () => {
@@ -156,12 +156,12 @@ var U = {
156
156
  "& [data-part=grip]": { opacity: 0 }
157
157
  }, t[17] = q) : q = t[17];
158
158
  let J = o ? h : void 0, Y;
159
- t[18] !== j || t[19] !== T || t[20] !== x ? (Y = x ? null : /* @__PURE__ */ y(re, {
159
+ t[18] !== j || t[19] !== T || t[20] !== x ? (Y = x ? null : /* @__PURE__ */ y(ne, {
160
160
  active: j,
161
161
  layout: T
162
162
  }), t[18] = j, t[19] = T, t[20] = x, t[21] = Y) : Y = t[21];
163
163
  let X;
164
- t[22] !== j || t[23] !== T ? (X = /* @__PURE__ */ y(ie, {
164
+ t[22] !== j || t[23] !== T ? (X = /* @__PURE__ */ y(re, {
165
165
  active: j,
166
166
  layout: T
167
167
  }), t[22] = j, t[23] = T, t[24] = X) : X = t[24];
@@ -198,7 +198,7 @@ var U = {
198
198
  children: [Y, X]
199
199
  }), t[25] = r.cursor, t[26] = r.separatorOrientation, t[27] = a, t[28] = n, t[29] = g, t[30] = v, t[31] = d, t[32] = m, t[33] = U, t[34] = W, t[35] = G, t[36] = K, t[37] = J, t[38] = Y, t[39] = X, t[40] = V, t[41] = H, t[42] = N, t[43] = Z) : Z = t[43], Z;
200
200
  };
201
- function oe(e) {
201
+ function ae(e) {
202
202
  return /* @__PURE__ */ y(c, {
203
203
  boxSize: "0.5",
204
204
  borderRadius: "full",
@@ -206,7 +206,7 @@ function oe(e) {
206
206
  }, e);
207
207
  }
208
208
  // src/components/layout/resizable-split-layout.panels.tsx
209
- var se = (e) => {
209
+ var oe = (e) => {
210
210
  let t = _(43), { styles: n, axis: r, bounds: i, collapsed: a, collapsible: s, resizable: l, contentPanel: u, contentPanelId: d, contentPanelRef: f, resizablePanel: p, resizablePanelId: m, resizablePanelRef: h, rootRef: g, dragging: x, resizeLabel: S, resolvedPanelSize: C, separator: w, separatorRef: T, onCollapse: E, onResizeKeyDown: D, onResizeStart: O } = e, k = a ? !0 : void 0, A;
211
211
  t[0] !== p || t[1] !== g ? (A = /* @__PURE__ */ y(o, {
212
212
  value: g,
@@ -236,7 +236,7 @@ var se = (e) => {
236
236
  children: u
237
237
  }, "content-panel"), t[13] = u, t[14] = d, t[15] = f, t[16] = n.contentPanel, t[17] = P) : P = t[17];
238
238
  let F = P, I;
239
- t[18] !== r || t[19] !== i || t[20] !== a || t[21] !== s || t[22] !== d || t[23] !== x || t[24] !== E || t[25] !== D || t[26] !== O || t[27] !== l || t[28] !== m || t[29] !== S || t[30] !== C || t[31] !== w || t[32] !== T || t[33] !== n.separator ? (I = l ? /* @__PURE__ */ y(ae, {
239
+ t[18] !== r || t[19] !== i || t[20] !== a || t[21] !== s || t[22] !== d || t[23] !== x || t[24] !== E || t[25] !== D || t[26] !== O || t[27] !== l || t[28] !== m || t[29] !== S || t[30] !== C || t[31] !== w || t[32] !== T || t[33] !== n.separator ? (I = l ? /* @__PURE__ */ y(ie, {
240
240
  css: n.separator,
241
241
  axis: r,
242
242
  bounds: i,
@@ -271,7 +271,7 @@ var se = (e) => {
271
271
  L,
272
272
  N
273
273
  ] }), t[39] = F, t[40] = N, t[41] = L, t[42] = R) : R = t[42], R;
274
- }, ce = (e, t, n) => {
274
+ }, se = (e, t, n) => {
275
275
  let r = _(6), i;
276
276
  r[0] === Symbol.for("react.memo_cache_sentinel") ? (i = {
277
277
  rootSize: 0,
@@ -297,19 +297,19 @@ var se = (e) => {
297
297
  t,
298
298
  n
299
299
  ], r[1] = n, r[2] = e, r[3] = t, r[4] = s, r[5] = c) : (s = r[4], c = r[5]), w(s, c), a;
300
- }, le = (e, t, n) => Math.min(Math.max(e, t), n), ue = (e, t) => e?.getBoundingClientRect()[t] ?? 0, de = (e) => {
300
+ }, ce = (e, t, n) => Math.min(Math.max(e, t), n), le = (e, t) => e?.getBoundingClientRect()[t] ?? 0, ue = (e) => {
301
301
  let { axis: t, resizableSide: n, collapsed: r, collapsible: i, resolvedPanelSize: a, minSizePx: o, maxSizePx: s, contentMinSizePx: c, rootRef: l, resizablePanelRef: u, contentPanelRef: d, separatorRef: f, cleanupDragRef: p, lastSizeRef: m, applyPanelSize: h, commitPanelSize: g, setCollapsed: _, setDragging: v } = e;
302
302
  return (e) => {
303
303
  if (e.button !== 0 || r && !i) return;
304
304
  e.preventDefault(), p.current();
305
305
  let y = e.currentTarget, b = X({
306
- rootSize: ue(l.current, t.dimension),
306
+ rootSize: le(l.current, t.dimension),
307
307
  fallbackRootSize: U[t.dimension],
308
308
  minSize: o,
309
309
  maxSize: s,
310
310
  contentMinSize: c,
311
- separatorSize: ue(f.current, t.dimension)
312
- }), x = e[t.pointerCoordinate], S = r ? 0 : ue(u.current, t.dimension) || m.current, C = document.body.style.cursor, w = document.body.style.userSelect, T = S === 0 ? 0 : le(S, b.minSize, b.maxSize), E = r, D = 0, O = !1, A = (e) => {
311
+ separatorSize: le(f.current, t.dimension)
312
+ }), x = e[t.pointerCoordinate], S = r ? 0 : le(u.current, t.dimension) || m.current, C = document.body.style.cursor, w = document.body.style.userSelect, T = S === 0 ? 0 : ce(S, b.minSize, b.maxSize), E = r, D = 0, O = !1, A = (e) => {
313
313
  u.current && (u.current.style.pointerEvents = e), d.current && (d.current.style.pointerEvents = e);
314
314
  }, j = () => {
315
315
  D ||= window.requestAnimationFrame(() => {
@@ -331,25 +331,25 @@ var se = (e) => {
331
331
  };
332
332
  p.current = N, y.setPointerCapture(e.pointerId), document.body.style.cursor = t.cursor, document.body.style.userSelect = "none", A("none"), l.current?.style.setProperty("--split-size", `${S}px`), v(!0), window.addEventListener("pointermove", M), window.addEventListener("pointerup", N, { once: !0 }), window.addEventListener("pointercancel", N, { once: !0 }), window.addEventListener("blur", N, { once: !0 });
333
333
  };
334
- }, fe = (e) => (t) => {
334
+ }, de = (e) => (t) => {
335
335
  let { dimension: n, deltaDirection: r, collapsed: i, collapsible: a, minSize: o, maxSize: s, getSize: c, setCollapsed: l, commitSize: u } = e, d = n === "width" ? "ArrowLeft" : "ArrowUp", f = n === "width" ? "ArrowRight" : "ArrowDown", p = c();
336
336
  i && (t.key === d || t.key === f || t.key === "End") ? (t.preventDefault(), l(!1), u(p)) : t.key === d ? (t.preventDefault(), u(p - 24 * r)) : t.key === f ? (t.preventDefault(), u(p + 24 * r)) : t.key === "Home" ? (t.preventDefault(), a ? l(!0) : u(o)) : t.key === "End" && (t.preventDefault(), u(s));
337
- }, pe = (e, t, n) => Math.min(Math.max(e, t), n), me = (e, t) => e?.getBoundingClientRect()[t] ?? 0, he = (e) => {
337
+ }, fe = (e, t, n) => Math.min(Math.max(e, t), n), pe = (e, t) => e?.getBoundingClientRect()[t] ?? 0, me = (e) => {
338
338
  let { resizablePanel: t, contentPanel: n, resizableSide: r = "left", defaultSizePx: i = 240, minSizePx: a = 200, maxSizePx: o, contentMinSizePx: s = 0, collapsed: c, collapsible: u = !0, resizable: d = !0, resizeLabel: f = "Resize panel", separator: p = "gap", layout: m = "split", onSizeChange: h, onCollapsedChange: _, ...v } = e, b = Y(r), x = b.dimension === "width" ? "horizontal" : "vertical", S = g({ key: "resizableSplitLayout" })({
339
339
  orientation: x,
340
340
  layout: m,
341
341
  separator: p
342
- }), C = T(), O = E(null), k = E(null), A = E(null), j = E(null), M = E(() => void 0), { rootSize: N, separatorSize: P } = ce(O, j, b.dimension), F = E(i), [I, L] = D(i), [R, z] = D(!1), [B, V] = D(!1), H = c ?? R, W = X({
342
+ }), C = T(), O = E(null), k = E(null), A = E(null), j = E(null), M = E(() => void 0), { rootSize: N, separatorSize: P } = se(O, j, b.dimension), F = E(i), [I, L] = D(i), [R, z] = D(!1), [B, V] = D(!1), H = c ?? R, W = X({
343
343
  rootSize: N,
344
344
  fallbackRootSize: U[b.dimension],
345
345
  minSize: a,
346
346
  maxSize: o,
347
347
  contentMinSize: s,
348
348
  separatorSize: P
349
- }), G = H ? 0 : pe(I, W.minSize, W.maxSize), K = `${C}-content`, q = `${C}-resizable`, J = {
349
+ }), G = H ? 0 : fe(I, W.minSize, W.maxSize), K = `${C}-content`, q = `${C}-resizable`, J = {
350
350
  ...v.style,
351
351
  "--split-size": `${G}px`,
352
- "--split-stored-size": `${pe(I, W.minSize, W.maxSize)}px`
352
+ "--split-stored-size": `${fe(I, W.minSize, W.maxSize)}px`
353
353
  };
354
354
  w(() => {
355
355
  F.current = i, L(i);
@@ -358,17 +358,17 @@ var se = (e) => {
358
358
  O.current?.style.setProperty("--split-size", `${e}px`);
359
359
  }, ee = (e) => {
360
360
  let t = X({
361
- rootSize: me(O.current, b.dimension),
361
+ rootSize: pe(O.current, b.dimension),
362
362
  fallbackRootSize: U[b.dimension],
363
363
  minSize: a,
364
364
  maxSize: o,
365
365
  contentMinSize: s,
366
- separatorSize: me(j.current, b.dimension)
367
- }), n = pe(e, t.minSize, t.maxSize);
366
+ separatorSize: pe(j.current, b.dimension)
367
+ }), n = fe(e, t.minSize, t.maxSize);
368
368
  F.current = n, L(n), Z(n), h?.(n);
369
- }, Q = (e) => {
369
+ }, te = (e) => {
370
370
  c === void 0 && z(e), _?.(e);
371
- }, te = de({
371
+ }, Q = ue({
372
372
  axis: b,
373
373
  resizableSide: r,
374
374
  collapsed: H,
@@ -385,11 +385,11 @@ var se = (e) => {
385
385
  lastSizeRef: F,
386
386
  applyPanelSize: Z,
387
387
  commitPanelSize: ee,
388
- setCollapsed: Q,
388
+ setCollapsed: te,
389
389
  setDragging: V
390
- }), ne = () => {
391
- u && Q(!0);
392
- }, re = fe({
390
+ }), $ = () => {
391
+ u && te(!0);
392
+ }, ne = de({
393
393
  dimension: b.dimension,
394
394
  deltaDirection: b.deltaDirection,
395
395
  collapsed: H,
@@ -397,7 +397,7 @@ var se = (e) => {
397
397
  minSize: W.minSize,
398
398
  maxSize: W.maxSize,
399
399
  getSize: () => F.current,
400
- setCollapsed: Q,
400
+ setCollapsed: te,
401
401
  commitSize: ee
402
402
  });
403
403
  return /* @__PURE__ */ y(l, {
@@ -407,7 +407,7 @@ var se = (e) => {
407
407
  style: J,
408
408
  "data-collapsed": H,
409
409
  "data-dragging": B,
410
- children: /* @__PURE__ */ y(se, {
410
+ children: /* @__PURE__ */ y(oe, {
411
411
  resizable: d,
412
412
  styles: S,
413
413
  axis: b,
@@ -426,12 +426,12 @@ var se = (e) => {
426
426
  resolvedPanelSize: G,
427
427
  separator: p,
428
428
  separatorRef: j,
429
- onCollapse: ne,
430
- onResizeKeyDown: re,
431
- onResizeStart: te
429
+ onCollapse: $,
430
+ onResizeKeyDown: ne,
431
+ onResizeStart: Q
432
432
  })
433
433
  });
434
- }, ge = (e) => {
434
+ }, he = (e) => {
435
435
  let n = _(8), { actions: r, children: i } = e, a;
436
436
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ y(c, {
437
437
  position: "absolute",
@@ -465,7 +465,7 @@ var se = (e) => {
465
465
  maxW: "full",
466
466
  children: [o, s]
467
467
  }), n[5] = o, n[6] = s, n[7] = l) : l = n[7], l;
468
- }, _e = (e, t) => t.includes(e), ve = (e, t) => Array.isArray(t) ? t.includes(e) : t === e, ye = (e) => e.isNavigable || e.navigationIntent !== void 0, be = (e) => e.children ?? [], xe = (e) => be(e).length > 0 || e.isContainer === !0, Se = (e) => {
468
+ }, ge = (e, t) => t.includes(e), _e = (e, t) => Array.isArray(t) ? t.includes(e) : t === e, ve = (e) => e.isNavigable || e.navigationIntent !== void 0, ye = (e) => e.children ?? [], be = (e) => ye(e).length > 0 || e.isContainer === !0, xe = (e) => {
469
469
  let { rows: t, sectionId: n, nodes: r, expandedNodeIds: i, level: a, parentNodeId: o } = e;
470
470
  for (let e of r) {
471
471
  t.push({
@@ -476,8 +476,8 @@ var se = (e) => {
476
476
  level: a,
477
477
  parentNodeId: o
478
478
  });
479
- let r = be(e);
480
- r.length !== 0 && _e(e.id, i) && Se({
479
+ let r = ye(e);
480
+ r.length !== 0 && ge(e.id, i) && xe({
481
481
  rows: t,
482
482
  sectionId: n,
483
483
  nodes: r,
@@ -486,10 +486,10 @@ var se = (e) => {
486
486
  parentNodeId: e.id
487
487
  });
488
488
  }
489
- }, Ce = (e, t, n) => {
489
+ }, Se = (e, t, n) => {
490
490
  let r = [];
491
491
  for (let i of e) {
492
- let e = i.collapsible !== !1 && i.label !== void 0, a = !e || _e(i.id, t);
492
+ let e = i.collapsible !== !1 && i.label !== void 0, a = !e || ge(i.id, t);
493
493
  i.label && r.push({
494
494
  kind: "section-header",
495
495
  key: `header:${i.id}`,
@@ -502,7 +502,7 @@ var se = (e) => {
502
502
  key: `empty:${i.id}`,
503
503
  sectionId: i.id,
504
504
  emptyState: i.emptyState
505
- }) : Se({
505
+ }) : xe({
506
506
  rows: r,
507
507
  sectionId: i.id,
508
508
  nodes: i.nodes,
@@ -511,14 +511,14 @@ var se = (e) => {
511
511
  }));
512
512
  }
513
513
  return r;
514
- }, we = (e) => e.kind === "node" ? e.node.id : e.key, Te = (e) => e.kind === "node" ? e.node.disabled !== !0 : e.kind === "section-header" && e.collapsible, Ee = (e) => e.filter(Te), De = (e, t, n) => {
515
- let r = Ee(n), i = new Set(r.map(we));
514
+ }, Ce = (e) => e.kind === "node" ? e.node.id : e.key, we = (e) => e.kind === "node" ? e.node.disabled !== !0 : e.kind === "section-header" && e.collapsible, Te = (e) => e.filter(we), Ee = (e, t, n) => {
515
+ let r = Te(n), i = new Set(r.map(Ce));
516
516
  if (e && i.has(e)) return e;
517
517
  let a = (t ? [t].flat() : []).find((e) => i.has(e));
518
518
  if (a) return a;
519
519
  let o = r[0];
520
- return o ? we(o) : void 0;
521
- }, Oe = (e) => {
520
+ return o ? Ce(o) : void 0;
521
+ }, De = (e) => {
522
522
  let { row: t, focusableRows: n, currentIndex: r, key: i } = e;
523
523
  if (i === "Enter" || i === " ") return {
524
524
  type: "toggle-section",
@@ -539,8 +539,8 @@ var se = (e) => {
539
539
  type: "toggle-section",
540
540
  sectionId: t.sectionId
541
541
  } : null;
542
- }, ke = (e) => {
543
- let { row: t, focusableRows: n, currentIndex: r, expandedNodeIds: i, key: a } = e, o = _e(t.node.id, i), s = xe(t.node);
542
+ }, Oe = (e) => {
543
+ let { row: t, focusableRows: n, currentIndex: r, expandedNodeIds: i, key: a } = e, o = ge(t.node.id, i), s = be(t.node);
544
544
  if (a === "ArrowRight") {
545
545
  if (!s) return null;
546
546
  if (!o) return {
@@ -564,33 +564,33 @@ var se = (e) => {
564
564
  };
565
565
  }
566
566
  return null;
567
- }, Ae = (e) => {
568
- let { rows: t, focusedRowId: n, activeNodeId: r, expandedNodeIds: i, key: a } = e, o = Ee(t);
567
+ }, ke = (e) => {
568
+ let { rows: t, focusedRowId: n, activeNodeId: r, expandedNodeIds: i, key: a } = e, o = Te(t);
569
569
  if (o.length === 0) return null;
570
- let s = De(n, r, t), c = Math.max(0, o.findIndex((e) => we(e) === s)), l = o[c];
570
+ let s = Ee(n, r, t), c = Math.max(0, o.findIndex((e) => Ce(e) === s)), l = o[c];
571
571
  if (!l) return null;
572
572
  let u = (e) => {
573
573
  let t = Math.min(Math.max(e, 0), o.length - 1);
574
574
  return {
575
575
  type: "focus",
576
- rowId: we(o[t])
576
+ rowId: Ce(o[t])
577
577
  };
578
578
  };
579
- return a === "ArrowDown" ? u(c + 1) : a === "ArrowUp" ? u(c - 1) : a === "Home" ? u(0) : a === "End" ? u(o.length - 1) : l.kind === "section-header" ? Oe({
579
+ return a === "ArrowDown" ? u(c + 1) : a === "ArrowUp" ? u(c - 1) : a === "Home" ? u(0) : a === "End" ? u(o.length - 1) : l.kind === "section-header" ? De({
580
580
  row: l,
581
581
  focusableRows: o,
582
582
  currentIndex: c,
583
583
  key: a
584
- }) : ke({
584
+ }) : Oe({
585
585
  row: l,
586
586
  focusableRows: o,
587
587
  currentIndex: c,
588
588
  expandedNodeIds: i,
589
589
  key: a
590
590
  });
591
- }, je = "application/x-pstdio-tree-node", Me = (e, t) => {
592
- e.setData(je, t);
593
- }, Ne = (e) => e.getData(je) || void 0, Pe = (e) => {
591
+ }, Ae = "application/x-pstdio-tree-node", je = (e, t) => {
592
+ e.setData(Ae, t);
593
+ }, Me = (e) => e.getData(Ae) || void 0, Ne = (e) => {
594
594
  let t = _(8), { children: n, onMoveNode: r } = e, i;
595
595
  t[0] === r ? i = t[1] : (i = (e) => {
596
596
  r && (e.preventDefault(), e.dataTransfer.dropEffect = "move");
@@ -599,7 +599,7 @@ var se = (e) => {
599
599
  t[2] === r ? o = t[3] : (o = (e) => {
600
600
  if (!r) return;
601
601
  e.preventDefault();
602
- let t = Ne(e.dataTransfer);
602
+ let t = Me(e.dataTransfer);
603
603
  t && r(t, void 0, "inside");
604
604
  }, t[2] = r, t[3] = o);
605
605
  let s = o, l;
@@ -614,7 +614,7 @@ var se = (e) => {
614
614
  onDrop: s,
615
615
  children: n
616
616
  }), t[4] = n, t[5] = a, t[6] = s, t[7] = l) : l = t[7], l;
617
- }, Fe = (e) => e <= 0 ? "sm" : `calc(var(--chakra-spacing-1) + ${e} * 12px)`, Ie = (e) => {
617
+ }, Pe = (e) => e <= 0 ? "sm" : `calc(var(--chakra-spacing-1) + ${e} * 12px)`, Fe = (e) => {
618
618
  let { input: t, icon: n, level: r } = e, [i, a] = D(t.defaultValue ?? ""), [o, s] = D(), u = E(null), d = E(!1), p = async () => {
619
619
  if (!d.current) {
620
620
  d.current = !0, s(void 0);
@@ -634,7 +634,7 @@ var se = (e) => {
634
634
  alignItems: "center",
635
635
  gap: "1",
636
636
  pr: "sm",
637
- pl: Fe(r),
637
+ pl: Pe(r),
638
638
  onMouseDown: (e) => e.stopPropagation(),
639
639
  children: [n ? /* @__PURE__ */ y(c, {
640
640
  boxSize: "16px",
@@ -666,104 +666,162 @@ var se = (e) => {
666
666
  }
667
667
  })]
668
668
  });
669
- }, Le = (e) => {
670
- let t = _(78), { sectionId: n, node: r, level: a, expandedNodeIds: o, activeNodeId: c, rowVariant: l, nodeGap: u, linkComponent: d, tabIndex: f, onFocus: m, onNavigate: h, onToggleNode: g, onMoveNode: v } = e, [x, S] = D(null);
669
+ }, Ie = (e, t, n, r, i) => {
670
+ if (i.shiftKey && r && e.includes(r)) {
671
+ let t = e.indexOf(r), i = e.indexOf(n);
672
+ return e.slice(Math.min(t, i), Math.max(t, i) + 1);
673
+ }
674
+ return i.ctrlKey || i.metaKey ? t.includes(n) ? t.filter((e) => e !== n) : [...t, n] : [n];
675
+ }, Le = (e, t, n, r = []) => {
676
+ let i = (e) => {
677
+ if (e.some((e) => e.id === t)) return e;
678
+ for (let t of e) {
679
+ let e = i(t.children ?? []);
680
+ if (e) return e;
681
+ }
682
+ };
683
+ for (let a of e) {
684
+ let e = i(a.nodes)?.filter((e) => !e.disabled);
685
+ if (!e) continue;
686
+ let o = e.findIndex((e) => e.id === t), s = e[o], c = e.flatMap((e, t) => r.includes(e.id) ? [t] : []), l = o;
687
+ r.includes(t) && c.length && (l = n === -1 ? Math.min(...c) : Math.max(...c));
688
+ let u = e[l + n];
689
+ return !s?.canDrag || !u?.canDrop ? void 0 : {
690
+ source: t,
691
+ target: u.id,
692
+ position: n === -1 ? "before" : "after"
693
+ };
694
+ }
695
+ }, Re = S(void 0), ze = S(void 0), Be = (e) => {
696
+ let { tree: t, children: n } = e, r = E(void 0), i = [t.activeNodeId ?? []].flat(), a = Se(t.sections, t.expandedSectionIds ?? [], t.expandedNodeIds ?? []).flatMap((e) => e.kind === "node" && !e.node.disabled ? [e.node.id] : []), o = (e, n, o) => {
697
+ n.preventDefault(), n.shiftKey ? r.current ??= i[0] ?? o ?? e : r.current = e, t.onSelectionChange?.(Ie(a, i, e, r.current, n));
698
+ };
699
+ return /* @__PURE__ */ y(ze, {
700
+ value: t.onMoveNode ? (e, n) => {
701
+ if (n.target === n.currentTarget && n.altKey && (n.key === "ArrowUp" || n.key === "ArrowDown")) {
702
+ n.preventDefault(), n.stopPropagation();
703
+ let r = Le(t.sections, e, n.key === "ArrowUp" ? -1 : 1, t.moveSelection ? i : []);
704
+ r && t.onMoveNode?.(r.source, r.target, r.position);
705
+ }
706
+ } : void 0,
707
+ children: /* @__PURE__ */ y(Re, {
708
+ value: t.onSelectionChange ? {
709
+ select: o,
710
+ keyDown: (e, t) => {
711
+ t.target === t.currentTarget && (t.key === " " || t.key === "Enter") && o(e, t);
712
+ }
713
+ } : void 0,
714
+ children: n
715
+ })
716
+ });
717
+ }, Ve = (e) => {
718
+ let t = _(90), { sectionId: n, node: r, level: a, expandedNodeIds: o, activeNodeId: c, rowVariant: l, nodeGap: u, linkComponent: d, tabIndex: f, onFocus: m, onNavigate: h, onToggleNode: g, onMoveNode: v } = e, [x, S] = D(null), w = C(Re), T = C(ze);
671
719
  if (r.inlineInput) {
672
720
  let e;
673
- return t[0] !== a || t[1] !== r.icon || t[2] !== r.inlineInput ? (e = /* @__PURE__ */ y(Ie, {
721
+ return t[0] !== a || t[1] !== r.icon || t[2] !== r.inlineInput ? (e = /* @__PURE__ */ y(Fe, {
674
722
  input: r.inlineInput,
675
723
  icon: r.icon,
676
724
  level: a
677
725
  }), t[0] = a, t[1] = r.icon, t[2] = r.inlineInput, t[3] = e) : e = t[3], e;
678
726
  }
679
- let C;
680
- t[4] === r ? C = t[5] : (C = xe(r), t[4] = r, t[5] = C);
681
- let w = C, T;
682
- t[6] !== o || t[7] !== w || t[8] !== r.id ? (T = w && _e(r.id, o), t[6] = o, t[7] = w, t[8] = r.id, t[9] = T) : T = t[9];
683
- let E = T, O;
684
- t[10] !== c || t[11] !== r.id ? (O = ve(r.id, c), t[10] = c, t[11] = r.id, t[12] = O) : O = t[12];
685
- let k = O, A = r.disabled === !0, j;
686
- t[13] === r ? j = t[14] : (j = ye(r), t[13] = r, t[14] = j);
687
- let M = j, N = !!(d && r.href && M && !w && !A), P;
688
- t[15] !== w || t[16] !== A || t[17] !== M || t[18] !== r || t[19] !== h || t[20] !== g || t[21] !== n ? (P = () => {
689
- A || (w ? g?.(r.id) : M && h ? h({
727
+ let E;
728
+ t[4] === r ? E = t[5] : (E = be(r), t[4] = r, t[5] = E);
729
+ let O = E, k;
730
+ t[6] !== o || t[7] !== O || t[8] !== r.id ? (k = O && ge(r.id, o), t[6] = o, t[7] = O, t[8] = r.id, t[9] = k) : k = t[9];
731
+ let A = k, j;
732
+ t[10] !== c || t[11] !== r.id ? (j = _e(r.id, c), t[10] = c, t[11] = r.id, t[12] = j) : j = t[12];
733
+ let M = j, N = r.disabled === !0, P;
734
+ t[13] === r ? P = t[14] : (P = ve(r), t[13] = r, t[14] = P);
735
+ let F = P, I = !!(d && r.href && F && !O && !N), L;
736
+ t[15] !== O || t[16] !== N || t[17] !== F || t[18] !== r || t[19] !== h || t[20] !== g || t[21] !== n ? (L = () => {
737
+ N || (O ? g?.(r.id) : F && h ? h({
690
738
  sectionId: n,
691
739
  nodeId: r.id,
692
740
  node: r,
693
741
  intent: r.navigationIntent
694
742
  }) : r.onActivate?.());
695
- }, t[15] = w, t[16] = A, t[17] = M, t[18] = r, t[19] = h, t[20] = g, t[21] = n, t[22] = P) : P = t[22];
696
- let F = P, I;
697
- t[23] === r.id ? I = t[24] : (I = (e) => {
698
- Me(e.dataTransfer, r.id), e.dataTransfer.effectAllowed = "move";
699
- }, t[23] = r.id, t[24] = I);
700
- let L = I, R;
701
- t[25] === w ? R = t[26] : (R = (e) => {
702
- if (w) return "inside";
703
- let t = e.currentTarget.getBoundingClientRect();
704
- return e.clientY < t.top + t.height / 2 ? "before" : "after";
705
- }, t[25] = w, t[26] = R);
706
- let z = R, B;
707
- t[27] !== r.canDrop || t[28] !== v || t[29] !== z ? (B = (e) => {
708
- v && (e.stopPropagation(), r.canDrop && (e.preventDefault(), e.dataTransfer.dropEffect = "move", S(z(e))));
709
- }, t[27] = r.canDrop, t[28] = v, t[29] = z, t[30] = B) : B = t[30];
710
- let V = B, H;
711
- t[31] !== r.canDrop || t[32] !== r.id || t[33] !== v || t[34] !== z ? (H = (e) => {
743
+ }, t[15] = O, t[16] = N, t[17] = F, t[18] = r, t[19] = h, t[20] = g, t[21] = n, t[22] = L) : L = t[22];
744
+ let R = L, z;
745
+ t[23] === r.id ? z = t[24] : (z = (e) => {
746
+ je(e.dataTransfer, r.id), e.dataTransfer.effectAllowed = "move";
747
+ }, t[23] = r.id, t[24] = z);
748
+ let B = z, V;
749
+ t[25] === O ? V = t[26] : (V = (e) => {
750
+ let t = e.currentTarget.getBoundingClientRect(), n = (e.clientY - t.top) / t.height;
751
+ return O && n > .3 && n < .7 ? "inside" : e.clientY < t.top + t.height / 2 ? "before" : "after";
752
+ }, t[25] = O, t[26] = V);
753
+ let H = V, U;
754
+ t[27] !== r.canDrop || t[28] !== v || t[29] !== H ? (U = (e) => {
755
+ v && (e.stopPropagation(), r.canDrop && (e.preventDefault(), e.dataTransfer.dropEffect = "move", S(H(e))));
756
+ }, t[27] = r.canDrop, t[28] = v, t[29] = H, t[30] = U) : U = t[30];
757
+ let W = U, G;
758
+ t[31] !== r.canDrop || t[32] !== r.id || t[33] !== v || t[34] !== H ? (G = (e) => {
712
759
  if (!v || (e.stopPropagation(), !r.canDrop)) return;
713
760
  e.preventDefault(), S(null);
714
- let t = Ne(e.dataTransfer);
715
- t && t !== r.id && v(t, r.id, z(e));
716
- }, t[31] = r.canDrop, t[32] = r.id, t[33] = v, t[34] = z, t[35] = H) : H = t[35];
717
- let U = H, W;
718
- t[36] !== r.actions || t[37] !== r.id || t[38] !== n ? (W = r.actions?.map((e) => ({
761
+ let t = Me(e.dataTransfer);
762
+ t && t !== r.id && v(t, r.id, H(e));
763
+ }, t[31] = r.canDrop, t[32] = r.id, t[33] = v, t[34] = H, t[35] = G) : G = t[35];
764
+ let K = G, q;
765
+ t[36] !== r.actions || t[37] !== r.id || t[38] !== n ? (q = r.actions?.map((e) => ({
719
766
  ...e,
720
767
  onAction: e.onAction ? (t) => e.onAction?.({
721
768
  sectionId: n,
722
769
  nodeId: r.id,
723
770
  ...t
724
771
  }) : void 0
725
- })), t[36] = r.actions, t[37] = r.id, t[38] = n, t[39] = W) : W = t[39];
726
- let G, K;
727
- if (t[40] !== r || t[41] !== W) {
772
+ })), t[36] = r.actions, t[37] = r.id, t[38] = n, t[39] = q) : q = t[39];
773
+ let J, Y;
774
+ if (t[40] !== r || t[41] !== q) {
728
775
  let { inlineInput: e, rowVariant: n, ...i } = {
729
776
  ...r,
730
- actions: W
777
+ actions: q
731
778
  };
732
- K = n, G = i, t[40] = r, t[41] = W, t[42] = G, t[43] = K;
733
- } else G = t[42], K = t[43];
734
- let q = K ?? l, J = a + 1, Y = w ? E : void 0, X;
735
- t[44] !== r.id || t[45] !== g ? (X = () => g?.(r.id), t[44] = r.id, t[45] = g, t[46] = X) : X = t[46];
736
- let Z;
737
- t[47] !== E || t[48] !== F || t[49] !== w || t[50] !== k || t[51] !== a || t[52] !== G || t[53] !== r.id || t[54] !== m || t[55] !== q || t[56] !== J || t[57] !== Y || t[58] !== X || t[59] !== f ? (Z = {
738
- ...G,
779
+ Y = n, J = i, t[40] = r, t[41] = q, t[42] = J, t[43] = Y;
780
+ } else J = t[42], Y = t[43];
781
+ let X = Y ?? l, Z = !w, ee = a + 1, te = O ? A : void 0, Q;
782
+ t[44] !== N || t[45] !== r.id || t[46] !== w ? (Q = w ? (e) => {
783
+ N || w.select(r.id, e);
784
+ } : void 0, t[44] = N, t[45] = r.id, t[46] = w, t[47] = Q) : Q = t[47];
785
+ let $;
786
+ t[48] !== N || t[49] !== T || t[50] !== r.id || t[51] !== w ? ($ = w || T ? (e) => {
787
+ N || (T?.(r.id, e), e.defaultPrevented || w?.keyDown(r.id, e));
788
+ } : void 0, t[48] = N, t[49] = T, t[50] = r.id, t[51] = w, t[52] = $) : $ = t[52];
789
+ let ne;
790
+ t[53] !== r.id || t[54] !== g ? (ne = () => g?.(r.id), t[53] = r.id, t[54] = g, t[55] = ne) : ne = t[55];
791
+ let re;
792
+ t[56] !== A || t[57] !== R || t[58] !== O || t[59] !== M || t[60] !== a || t[61] !== J || t[62] !== r.id || t[63] !== m || t[64] !== X || t[65] !== Z || t[66] !== ee || t[67] !== te || t[68] !== Q || t[69] !== $ || t[70] !== ne || t[71] !== f ? (re = {
793
+ ...J,
739
794
  depth: a,
740
- variant: q,
741
- isSelected: k,
742
- isExpanded: E,
743
- showExpandToggle: w,
795
+ variant: X,
796
+ isSelected: M,
797
+ isExpanded: A,
798
+ showExpandToggle: O,
799
+ expandOnClick: Z,
744
800
  tabIndex: f,
745
801
  "data-tree-list-focus-id": r.id,
746
- "aria-level": J,
747
- "aria-expanded": Y,
802
+ "aria-level": ee,
803
+ "aria-expanded": te,
748
804
  "data-tree-list-node-id": r.id,
749
805
  onFocus: m,
750
- onActivate: F,
751
- onToggleExpand: X
752
- }, t[47] = E, t[48] = F, t[49] = w, t[50] = k, t[51] = a, t[52] = G, t[53] = r.id, t[54] = m, t[55] = q, t[56] = J, t[57] = Y, t[58] = X, t[59] = f, t[60] = Z) : Z = t[60];
753
- let ee = Z, Q;
754
- t[61] !== d || t[62] !== N || t[63] !== r.href || t[64] !== ee ? (Q = N && d && r.href ? /* @__PURE__ */ y(d, {
806
+ onClick: Q,
807
+ onKeyDown: $,
808
+ onActivate: R,
809
+ onToggleExpand: ne
810
+ }, t[56] = A, t[57] = R, t[58] = O, t[59] = M, t[60] = a, t[61] = J, t[62] = r.id, t[63] = m, t[64] = X, t[65] = Z, t[66] = ee, t[67] = te, t[68] = Q, t[69] = $, t[70] = ne, t[71] = f, t[72] = re) : re = t[72];
811
+ let ie = re, ae;
812
+ t[73] !== d || t[74] !== I || t[75] !== r.href || t[76] !== ie ? (ae = I && d && r.href ? /* @__PURE__ */ y(d, {
755
813
  to: r.href,
756
814
  children: /* @__PURE__ */ y(i, {
757
- ...ee,
815
+ ...ie,
758
816
  asChild: !0
759
817
  })
760
- }) : /* @__PURE__ */ y(i, { ...ee }), t[61] = d, t[62] = N, t[63] = r.href, t[64] = ee, t[65] = Q) : Q = t[65];
761
- let te = Q, ne = x === "inside" ? "bg.accent-subtle" : void 0, re = !!(v && r.canDrag), ie = r.canDrag ? L : void 0, ae = v ? V : void 0, oe = v ? U : void 0, se;
762
- t[66] === Symbol.for("react.memo_cache_sentinel") ? (se = (e) => {
818
+ }) : /* @__PURE__ */ y(i, { ...ie }), t[73] = d, t[74] = I, t[75] = r.href, t[76] = ie, t[77] = ae) : ae = t[77];
819
+ let oe = ae, se = x === "inside" ? "bg.accent-subtle" : void 0, ce = !!(v && r.canDrag), le = r.canDrag ? B : void 0, ue = v ? W : void 0, de = v ? K : void 0, fe;
820
+ t[78] === Symbol.for("react.memo_cache_sentinel") ? (fe = (e) => {
763
821
  e.relatedTarget instanceof Node && e.currentTarget.contains(e.relatedTarget) || S(null);
764
- }, t[66] = se) : se = t[66];
765
- let ce;
766
- t[67] === x ? ce = t[68] : (ce = x === "before" || x === "after" ? /* @__PURE__ */ y(s, {
822
+ }, t[78] = fe) : fe = t[78];
823
+ let pe;
824
+ t[79] === x ? pe = t[80] : (pe = x === "before" || x === "after" ? /* @__PURE__ */ y(s, {
767
825
  "data-tree-list-drop-indicator": x,
768
826
  ...x === "before" ? {
769
827
  top: "0",
@@ -772,23 +830,23 @@ var se = (e) => {
772
830
  bottom: "0",
773
831
  transform: "translateY(50%)"
774
832
  }
775
- }) : null, t[67] = x, t[68] = ce);
776
- let le;
777
- return t[69] !== u || t[70] !== te || t[71] !== ne || t[72] !== re || t[73] !== ie || t[74] !== ae || t[75] !== oe || t[76] !== ce ? (le = /* @__PURE__ */ b(p, {
833
+ }) : null, t[79] = x, t[80] = pe);
834
+ let me;
835
+ return t[81] !== u || t[82] !== oe || t[83] !== se || t[84] !== ce || t[85] !== le || t[86] !== ue || t[87] !== de || t[88] !== pe ? (me = /* @__PURE__ */ b(p, {
778
836
  gap: u,
779
837
  w: "full",
780
838
  minW: "0",
781
839
  maxW: "full",
782
840
  position: "relative",
783
- bg: ne,
784
- draggable: re,
785
- onDragStart: ie,
786
- onDragOver: ae,
787
- onDrop: oe,
788
- onDragLeave: se,
789
- children: [te, ce]
790
- }), t[69] = u, t[70] = te, t[71] = ne, t[72] = re, t[73] = ie, t[74] = ae, t[75] = oe, t[76] = ce, t[77] = le) : le = t[77], le;
791
- }, Re = (e) => {
841
+ bg: se,
842
+ draggable: ce,
843
+ onDragStart: le,
844
+ onDragOver: ue,
845
+ onDrop: de,
846
+ onDragLeave: fe,
847
+ children: [oe, pe]
848
+ }), t[81] = u, t[82] = oe, t[83] = se, t[84] = ce, t[85] = le, t[86] = ue, t[87] = de, t[88] = pe, t[89] = me) : me = t[89], me;
849
+ }, He = (e) => {
792
850
  let t = _(11), { open: n, children: r } = e, i;
793
851
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = { key: "treeReveal" }, t[0] = i) : i = t[0];
794
852
  let a = h(i), o;
@@ -804,10 +862,10 @@ var se = (e) => {
804
862
  "aria-hidden": l,
805
863
  children: u
806
864
  }), t[5] = n, t[6] = o, t[7] = s, t[8] = l, t[9] = u, t[10] = d) : d = t[10], d;
807
- }, ze = "section:", $ = (e) => `${ze}${e}`, Be = (e) => e.startsWith(ze), Ve = (e) => e.slice(8), He = "after-section:", Ue = (e) => `${He}${e}`, We = (e) => e.startsWith(He), Ge = (e) => e.slice(14), Ke = (e) => {
808
- if (Be(e)) return Ve(e);
809
- if (We(e)) return Ge(e);
810
- }, qe = (e, t) => {
865
+ }, Ue = "section:", We = (e) => `${Ue}${e}`, Ge = (e) => e.startsWith(Ue), Ke = (e) => e.slice(8), qe = "after-section:", Je = (e) => `${qe}${e}`, Ye = (e) => e.startsWith(qe), Xe = (e) => e.slice(14), Ze = (e) => {
866
+ if (Ge(e)) return Ke(e);
867
+ if (Ye(e)) return Xe(e);
868
+ }, Qe = (e, t) => {
811
869
  for (let n of e) {
812
870
  let e = n.nodes.findIndex((e) => e.id === t);
813
871
  if (e >= 0) return {
@@ -816,13 +874,13 @@ var se = (e) => {
816
874
  node: n.nodes[e]
817
875
  };
818
876
  }
819
- }, Je = (e, t) => t?.(e) ?? !0, Ye = (e, t, n, r) => {
877
+ }, $e = (e, t) => t?.(e) ?? !0, et = (e, t, n, r) => {
820
878
  if (t === n) return !0;
821
- let i = Ke(n);
822
- if (Be(t)) {
879
+ let i = Ze(n);
880
+ if (Ge(t)) {
823
881
  if (i === void 0) return !1;
824
- let n = e.find((e) => e.id === Ve(t)), a = e.find((e) => e.id === i);
825
- return !n || !a || n.canReorder === !1 || a.canReorder === !1 ? !1 : Je({
882
+ let n = e.find((e) => e.id === Ke(t)), a = e.find((e) => e.id === i);
883
+ return !n || !a || n.canReorder === !1 || a.canReorder === !1 ? !1 : $e({
826
884
  source: {
827
885
  kind: "section",
828
886
  sectionId: n.id,
@@ -837,10 +895,10 @@ var se = (e) => {
837
895
  }
838
896
  }, r);
839
897
  }
840
- let a = qe(e, t);
898
+ let a = Qe(e, t);
841
899
  if (!a || a.node.canReorder === !1) return !1;
842
- let o = i === void 0 ? void 0 : e.find((e) => e.id === i), s = i === void 0 ? qe(e, n) : void 0, c = o ?? s?.section;
843
- return !c || c.canReorder === !1 || s?.node.canReorder === !1 ? !1 : Je({
900
+ let o = i === void 0 ? void 0 : e.find((e) => e.id === i), s = i === void 0 ? Qe(e, n) : void 0, c = o ?? s?.section;
901
+ return !c || c.canReorder === !1 || s?.node.canReorder === !1 ? !1 : $e({
844
902
  source: {
845
903
  kind: "node",
846
904
  sectionId: a.section.id,
@@ -859,7 +917,7 @@ var se = (e) => {
859
917
  moveScope: c.moveScope
860
918
  }
861
919
  }, r);
862
- }, Xe = {
920
+ }, tt = {
863
921
  modifiers: [({ transform: e }) => ({
864
922
  ...e,
865
923
  x: 0
@@ -869,7 +927,7 @@ var se = (e) => {
869
927
  y: .2
870
928
  } },
871
929
  measuring: { droppable: { strategy: j.Always } }
872
- }, Ze = {
930
+ }, nt = {
873
931
  before: {
874
932
  top: "0",
875
933
  transform: "translateY(-50%)"
@@ -882,13 +940,17 @@ var se = (e) => {
882
940
  top: "50%",
883
941
  transform: "translateY(-50%)"
884
942
  }
885
- }, Qe = (e) => {
886
- let t = _(3), { edge: n } = e, r = Ze[n], i;
943
+ }, rt = (e) => {
944
+ if (!(e instanceof Element)) return !0;
945
+ let t = e.closest("button, a, input, textarea, select, [role=button]");
946
+ return !t || t.hasAttribute("data-tree-list-focus-id");
947
+ }, it = (e) => {
948
+ let t = _(3), { edge: n } = e, r = nt[n], i;
887
949
  return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ y(s, {
888
950
  "data-tree-list-drop-indicator": n,
889
951
  ...r
890
952
  }), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
891
- }, $e = (e) => {
953
+ }, at = (e) => {
892
954
  let { id: t, disabled: n, indicator: r, handle: i, liftedBg: a, highlighted: o, children: s } = e, l = V({
893
955
  id: t,
894
956
  disabled: n
@@ -902,11 +964,13 @@ var se = (e) => {
902
964
  opacity: l.isDragging ? .5 : 1,
903
965
  bg: o ? "bg.accent-subtle" : d,
904
966
  "data-tree-list-drop-group": o ? "" : void 0,
905
- onPointerDownCapture: i === "self" ? (e) => l.listeners?.onPointerDown?.(e) : void 0,
906
- children: [s(l.listeners), u ? /* @__PURE__ */ y(Qe, { edge: u }) : null]
967
+ onPointerDownCapture: i === "self" ? (e) => {
968
+ rt(e.target) && l.listeners?.onPointerDown?.(e);
969
+ } : void 0,
970
+ children: [s(l.listeners), u ? /* @__PURE__ */ y(it, { edge: u }) : null]
907
971
  });
908
- }, et = (e) => {
909
- let { sectionId: t, nextSectionId: n, gap: r, indicator: i } = e, a = Ue(t), o = L({
972
+ }, ot = (e) => {
973
+ let { sectionId: t, nextSectionId: n, gap: r, indicator: i } = e, a = Je(t), o = L({
910
974
  id: a,
911
975
  data: { nextSectionId: n }
912
976
  });
@@ -917,22 +981,22 @@ var se = (e) => {
917
981
  w: "full",
918
982
  pt: n ? r : "xs",
919
983
  flexShrink: 0,
920
- children: i?.lineId === a ? /* @__PURE__ */ y(Qe, { edge: "middle" }) : null
984
+ children: i?.lineId === a ? /* @__PURE__ */ y(it, { edge: "middle" }) : null
921
985
  });
922
- }, tt = (e) => {
986
+ }, st = (e) => {
923
987
  let t = _(46), n, r, i, a, o, s, l;
924
988
  if (t[0] !== e) {
925
989
  let { node: c, nodes: u, level: d, focusRowId: f, onRowFocus: p, sortable: m, indicator: h, ...g } = e;
926
990
  r = c, s = d, n = f, i = p, o = m, l = h, a = g, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s, t[7] = l;
927
991
  } else n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6], l = t[7];
928
992
  let u = s === void 0 ? 0 : s, d = l === void 0 ? null : l, f;
929
- t[8] === r ? f = t[9] : (f = be(r), t[8] = r, t[9] = f);
993
+ t[8] === r ? f = t[9] : (f = ye(r), t[8] = r, t[9] = f);
930
994
  let p = f, m;
931
995
  n !== void 0 && (m = r.id === n ? 0 : -1);
932
996
  let h;
933
997
  t[10] !== r.id || t[11] !== i ? (h = () => i?.(r.id), t[10] = r.id, t[11] = i, t[12] = h) : h = t[12];
934
998
  let g;
935
- t[13] !== u || t[14] !== r || t[15] !== a || t[16] !== h || t[17] !== m ? (g = /* @__PURE__ */ y(Le, {
999
+ t[13] !== u || t[14] !== r || t[15] !== a || t[16] !== h || t[17] !== m ? (g = /* @__PURE__ */ y(Ve, {
936
1000
  ...a,
937
1001
  node: r,
938
1002
  level: u,
@@ -940,11 +1004,11 @@ var se = (e) => {
940
1004
  onFocus: h
941
1005
  }), t[13] = u, t[14] = r, t[15] = a, t[16] = h, t[17] = m, t[18] = g) : g = t[18];
942
1006
  let v = g, x;
943
- t[19] !== p || t[20] !== u || t[21] !== r.id || t[22] !== e || t[23] !== a ? (x = p.length ? /* @__PURE__ */ y(Re, {
1007
+ t[19] !== p || t[20] !== u || t[21] !== r.id || t[22] !== e || t[23] !== a ? (x = p.length ? /* @__PURE__ */ y(He, {
944
1008
  open: a.expandedNodeIds.includes(r.id),
945
1009
  children: /* @__PURE__ */ y(c, {
946
1010
  pt: a.nodeGap,
947
- children: /* @__PURE__ */ y(nt, {
1011
+ children: /* @__PURE__ */ y(ct, {
948
1012
  ...e,
949
1013
  nodes: p,
950
1014
  level: u + 1
@@ -955,11 +1019,13 @@ var se = (e) => {
955
1019
  if (o && u === 0) {
956
1020
  let e = r.canReorder === !1, n = d?.edge === "after" ? null : d, i;
957
1021
  t[25] === v ? i = t[26] : (i = (e) => /* @__PURE__ */ y(c, {
958
- onPointerDownCapture: (t) => e?.onPointerDown?.(t),
1022
+ onPointerDownCapture: (t) => {
1023
+ rt(t.target) && e?.onPointerDown?.(t);
1024
+ },
959
1025
  children: v
960
1026
  }), t[25] = v, t[26] = i);
961
1027
  let a;
962
- t[27] !== r.id || t[28] !== e || t[29] !== n || t[30] !== i ? (a = /* @__PURE__ */ y($e, {
1028
+ t[27] !== r.id || t[28] !== e || t[29] !== n || t[30] !== i ? (a = /* @__PURE__ */ y(at, {
963
1029
  id: r.id,
964
1030
  disabled: e,
965
1031
  indicator: n,
@@ -968,7 +1034,7 @@ var se = (e) => {
968
1034
  children: i
969
1035
  }), t[27] = r.id, t[28] = e, t[29] = n, t[30] = i, t[31] = a) : a = t[31];
970
1036
  let o;
971
- t[32] !== d || t[33] !== r.id ? (o = d?.lineId === r.id && d.edge === "after" ? /* @__PURE__ */ y(Qe, { edge: "after" }) : null, t[32] = d, t[33] = r.id, t[34] = o) : o = t[34];
1037
+ t[32] !== d || t[33] !== r.id ? (o = d?.lineId === r.id && d.edge === "after" ? /* @__PURE__ */ y(it, { edge: "after" }) : null, t[32] = d, t[33] = r.id, t[34] = o) : o = t[34];
972
1038
  let s;
973
1039
  return t[35] !== S || t[36] !== o || t[37] !== a ? (s = /* @__PURE__ */ b(c, {
974
1040
  position: "relative",
@@ -981,7 +1047,7 @@ var se = (e) => {
981
1047
  }), t[35] = S, t[36] = o, t[37] = a, t[38] = s) : s = t[38], s;
982
1048
  }
983
1049
  let C;
984
- t[39] !== d || t[40] !== r.id ? (C = d?.lineId === r.id ? /* @__PURE__ */ y(Qe, { edge: d.edge }) : null, t[39] = d, t[40] = r.id, t[41] = C) : C = t[41];
1050
+ t[39] !== d || t[40] !== r.id ? (C = d?.lineId === r.id ? /* @__PURE__ */ y(it, { edge: d.edge }) : null, t[39] = d, t[40] = r.id, t[41] = C) : C = t[41];
985
1051
  let w;
986
1052
  return t[42] !== S || t[43] !== v || t[44] !== C ? (w = /* @__PURE__ */ b(c, {
987
1053
  position: "relative",
@@ -992,11 +1058,11 @@ var se = (e) => {
992
1058
  C
993
1059
  ]
994
1060
  }), t[42] = S, t[43] = v, t[44] = C, t[45] = w) : w = t[45], w;
995
- }, nt = (e) => {
1061
+ }, ct = (e) => {
996
1062
  let t = _(8), { nodes: n, nodeGap: r } = e, i;
997
1063
  if (t[0] !== n || t[1] !== e) {
998
1064
  let r;
999
- t[3] === e ? r = t[4] : (r = (t) => /* @__PURE__ */ y(tt, {
1065
+ t[3] === e ? r = t[4] : (r = (t) => /* @__PURE__ */ y(st, {
1000
1066
  ...e,
1001
1067
  node: t
1002
1068
  }, t.id), t[3] = e, t[4] = r), i = n.map(r), t[0] = n, t[1] = e, t[2] = i;
@@ -1008,7 +1074,7 @@ var se = (e) => {
1008
1074
  minW: "0",
1009
1075
  children: i
1010
1076
  }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
1011
- }, rt = (t) => {
1077
+ }, lt = (t) => {
1012
1078
  let i = _(11), { sectionId: a, actions: o } = t, s;
1013
1079
  i[0] === Symbol.for("react.memo_cache_sentinel") ? (s = { key: "listRowAccessory" }, i[0] = s) : s = i[0];
1014
1080
  let c = h(s);
@@ -1040,16 +1106,16 @@ var se = (e) => {
1040
1106
  return i[8] !== l || i[9] !== f ? (p = /* @__PURE__ */ y(u, {
1041
1107
  gap: "0",
1042
1108
  css: l,
1043
- onClick: at,
1109
+ onClick: dt,
1044
1110
  children: f
1045
1111
  }), i[8] = l, i[9] = f, i[10] = p) : p = i[10], p;
1046
- }, it = (e) => {
1112
+ }, ut = (e) => {
1047
1113
  let n = _(43), { section: i, collapsible: a, expanded: o, focusId: s, tabIndex: l, onFocus: d, onToggle: f, onContextMenu: p } = e, g;
1048
1114
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (g = { key: "treeChevron" }, n[0] = g) : g = n[0];
1049
1115
  let v = h(g);
1050
1116
  if (i.inlineInput) {
1051
1117
  let e;
1052
- return n[1] === i.inlineInput ? e = n[2] : (e = /* @__PURE__ */ y(Ie, {
1118
+ return n[1] === i.inlineInput ? e = n[2] : (e = /* @__PURE__ */ y(Fe, {
1053
1119
  input: i.inlineInput,
1054
1120
  level: 0
1055
1121
  }), n[1] = i.inlineInput, n[2] = e), e;
@@ -1096,7 +1162,7 @@ var se = (e) => {
1096
1162
  let L;
1097
1163
  n[23] === i.actions ? L = n[24] : (L = i.actions ?? [], n[23] = i.actions, n[24] = L);
1098
1164
  let R;
1099
- n[25] !== i.id || n[26] !== L ? (R = /* @__PURE__ */ y(rt, {
1165
+ n[25] !== i.id || n[26] !== L ? (R = /* @__PURE__ */ y(lt, {
1100
1166
  sectionId: i.id,
1101
1167
  actions: L
1102
1168
  }), n[25] = i.id, n[26] = L, n[27] = R) : R = n[27];
@@ -1128,11 +1194,11 @@ var se = (e) => {
1128
1194
  children: z
1129
1195
  }), n[40] = C, n[41] = z, n[42] = B) : B = n[42], B;
1130
1196
  };
1131
- function at(e) {
1197
+ function dt(e) {
1132
1198
  return e.stopPropagation();
1133
1199
  }
1134
1200
  // src/components/tree-list/tree-list-row.tsx
1135
- var ot = (e) => {
1201
+ var ft = (e) => {
1136
1202
  let t = _(32), { row: n, expandedNodeIds: r, activeNodeId: i, focusRowId: a, rowVariant: o, nodeGap: s, linkComponent: c, onRowFocus: l, onNavigate: u, onToggleSection: d, onToggleNode: f, onSectionContextMenu: p, onMoveNode: m } = e;
1137
1203
  if (n.kind === "section-header") {
1138
1204
  let e = n.key === a ? 0 : -1, r;
@@ -1140,7 +1206,7 @@ var ot = (e) => {
1140
1206
  let i;
1141
1207
  t[3] !== d || t[4] !== n.sectionId ? (i = () => d?.(n.sectionId), t[3] = d, t[4] = n.sectionId, t[5] = i) : i = t[5];
1142
1208
  let o;
1143
- return t[6] !== p || t[7] !== n.collapsible || t[8] !== n.expanded || t[9] !== n.key || t[10] !== n.section || t[11] !== e || t[12] !== r || t[13] !== i ? (o = /* @__PURE__ */ y(it, {
1209
+ return t[6] !== p || t[7] !== n.collapsible || t[8] !== n.expanded || t[9] !== n.key || t[10] !== n.section || t[11] !== e || t[12] !== r || t[13] !== i ? (o = /* @__PURE__ */ y(ut, {
1144
1210
  section: n.section,
1145
1211
  collapsible: n.collapsible,
1146
1212
  expanded: n.expanded,
@@ -1155,7 +1221,7 @@ var ot = (e) => {
1155
1221
  let h = n.node.id === a ? 0 : -1, g;
1156
1222
  t[15] !== l || t[16] !== n.node.id ? (g = () => l(n.node.id), t[15] = l, t[16] = n.node.id, t[17] = g) : g = t[17];
1157
1223
  let v;
1158
- return t[18] !== i || t[19] !== r || t[20] !== c || t[21] !== s || t[22] !== m || t[23] !== u || t[24] !== f || t[25] !== n.level || t[26] !== n.node || t[27] !== n.sectionId || t[28] !== o || t[29] !== h || t[30] !== g ? (v = /* @__PURE__ */ y(Le, {
1224
+ return t[18] !== i || t[19] !== r || t[20] !== c || t[21] !== s || t[22] !== m || t[23] !== u || t[24] !== f || t[25] !== n.level || t[26] !== n.node || t[27] !== n.sectionId || t[28] !== o || t[29] !== h || t[30] !== g ? (v = /* @__PURE__ */ y(Ve, {
1159
1225
  sectionId: n.sectionId,
1160
1226
  node: n.node,
1161
1227
  level: n.level,
@@ -1170,34 +1236,34 @@ var ot = (e) => {
1170
1236
  onToggleNode: f,
1171
1237
  onMoveNode: m
1172
1238
  }), t[18] = i, t[19] = r, t[20] = c, t[21] = s, t[22] = m, t[23] = u, t[24] = f, t[25] = n.level, t[26] = n.node, t[27] = n.sectionId, t[28] = o, t[29] = h, t[30] = g, t[31] = v) : v = t[31], v;
1173
- }, st = (e, t, n, r) => {
1239
+ }, pt = (e, t, n, r) => {
1174
1240
  if (e === t) return null;
1175
1241
  let i = n ? "before" : "after";
1176
- return We(t) ? {
1242
+ return Ye(t) ? {
1177
1243
  kind: "section",
1178
- id: Ge(t),
1244
+ id: Xe(t),
1179
1245
  edge: "after",
1180
1246
  nextSectionId: r
1181
- } : Be(t) ? {
1247
+ } : Ge(t) ? {
1182
1248
  kind: "section",
1183
- id: Ve(t),
1184
- edge: Be(e) ? i : "inside"
1185
- } : Be(e) ? null : {
1249
+ id: Ke(t),
1250
+ edge: Ge(e) ? i : "inside"
1251
+ } : Ge(e) ? null : {
1186
1252
  kind: "node",
1187
1253
  id: t,
1188
1254
  edge: i
1189
1255
  };
1190
- }, ct = (e, t, n, r) => {
1191
- let i = Ve(t);
1192
- if (n.kind !== "section" || n.edge === "inside" || n.id === i || !Ye(e, t, $(n.id), r)) return null;
1256
+ }, mt = (e, t, n, r) => {
1257
+ let i = Ke(t);
1258
+ if (n.kind !== "section" || n.edge === "inside" || n.id === i || !et(e, t, We(n.id), r)) return null;
1193
1259
  let a = e.map((e) => e.id), o = a.filter((e) => e !== i);
1194
1260
  return o.splice(o.indexOf(n.id) + +(n.edge === "after"), 0, i), o.every((e, t) => e === a[t]) ? null : {
1195
1261
  kind: "section",
1196
1262
  nextSectionIds: o
1197
1263
  };
1198
- }, lt = (e, t, n, r) => {
1264
+ }, ht = (e, t, n, r) => {
1199
1265
  if (n.kind === "node") {
1200
- let t = qe(e, n.id);
1266
+ let t = Qe(e, n.id);
1201
1267
  return t ? {
1202
1268
  sectionId: t.section.id,
1203
1269
  index: t.index + +(n.edge === "after")
@@ -1210,15 +1276,15 @@ var ot = (e) => {
1210
1276
  index: i.nodes.length
1211
1277
  };
1212
1278
  let a = e.find((e) => e.id === n.nextSectionId);
1213
- return a && !a.label && a.canReorder !== !1 && Ye(e, t, $(a.id), r) ? {
1279
+ return a && !a.label && a.canReorder !== !1 && et(e, t, We(a.id), r) ? {
1214
1280
  sectionId: a.id,
1215
1281
  index: 0
1216
1282
  } : void 0;
1217
- }, ut = (e, t, n, r, i) => {
1218
- if (Be(t)) return ct(e, t, n, r);
1219
- let a = qe(e, t);
1220
- if (!a || a.node.canReorder === !1 || !Ye(e, t, n.kind === "node" ? n.id : Ue(n.id), r)) return null;
1221
- let o = lt(e, t, n, r);
1283
+ }, gt = (e, t, n, r, i) => {
1284
+ if (Ge(t)) return mt(e, t, n, r);
1285
+ let a = Qe(e, t);
1286
+ if (!a || a.node.canReorder === !1 || !et(e, t, n.kind === "node" ? n.id : Je(n.id), r)) return null;
1287
+ let o = ht(e, t, n, r);
1222
1288
  if (o === null) return null;
1223
1289
  let s = a.section.nodes.map((e) => e.id).filter((e) => e !== t);
1224
1290
  if (!o) {
@@ -1252,41 +1318,41 @@ var ot = (e) => {
1252
1318
  [o.sectionId]: c
1253
1319
  }
1254
1320
  };
1255
- }, dt = (e) => Be(e) ? 2 : +!!We(e), ft = (e, t) => (n) => {
1256
- let r = String(n.active.id), i = (n) => Ye(e, r, String(n.id), t), a = n.pointerCoordinates && {
1321
+ }, _t = (e) => Ge(e) ? 2 : +!!Ye(e), vt = (e, t) => (n) => {
1322
+ let r = String(n.active.id), i = (n) => et(e, r, String(n.id), t), a = n.pointerCoordinates && {
1257
1323
  x: n.collisionRect.left + n.collisionRect.width / 2,
1258
1324
  y: n.pointerCoordinates.y
1259
1325
  }, o = a ? P({
1260
1326
  ...n,
1261
1327
  pointerCoordinates: a
1262
1328
  }).filter(i) : [];
1263
- return o.length === 0 ? N(n).filter(i) : o.sort((e, t) => dt(String(e.id)) - dt(String(t.id)));
1264
- }, pt = (e, t) => (e instanceof MouseEvent ? e.clientY : 0) + t, mt = (e, t, n) => t ? st(e, String(t.id), n < t.rect.top + t.rect.height / 2, t.data.current?.nextSectionId) : null, ht = () => `tree-list-loose:${crypto.randomUUID()}`, gt = (e) => (t) => {
1265
- let n = String(t.active.id), r = mt(n, t.over, pt(t.activatorEvent, t.delta.y));
1329
+ return o.length === 0 ? N(n).filter(i) : o.sort((e, t) => _t(String(e.id)) - _t(String(t.id)));
1330
+ }, yt = (e, t) => (e instanceof MouseEvent ? e.clientY : 0) + t, bt = (e, t, n) => t ? pt(e, String(t.id), n < t.rect.top + t.rect.height / 2, t.data.current?.nextSectionId) : null, xt = () => `tree-list-loose:${crypto.randomUUID()}`, St = (e) => (t) => {
1331
+ let n = String(t.active.id), r = bt(n, t.over, yt(t.activatorEvent, t.delta.y));
1266
1332
  if (!r) return;
1267
- let i = ut(e.sections, n, r, e.canMove, ht());
1333
+ let i = gt(e.sections, n, r, e.canMove, xt());
1268
1334
  if (!i) return;
1269
1335
  if (i.kind === "section") {
1270
- e.onReorderSections?.(i.nextSectionIds, Ve(n), r.id);
1336
+ e.onReorderSections?.(i.nextSectionIds, Ke(n), r.id);
1271
1337
  return;
1272
1338
  }
1273
1339
  let a = i.looseSection;
1274
1340
  a && e.onReorderSections?.(a.nextSectionIds, a.id, a.afterSectionId);
1275
1341
  for (let [t, n] of Object.entries(i.orders)) e.onReorderNodes?.(t, n);
1276
- }, _t = S(!1), vt = (e) => {
1342
+ }, Ct = S(!1), wt = (e) => {
1277
1343
  let t = _(16), { sections: n, canMove: r, onReorderSections: i, onReorderNodes: a, children: o } = e, s;
1278
1344
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = { activationConstraint: { distance: 4 } }, t[0] = s) : s = t[0];
1279
1345
  let c = z(R(M, s)), l;
1280
- t[1] !== r || t[2] !== n ? (l = ft(n, r), t[1] = r, t[2] = n, t[3] = l) : l = t[3];
1346
+ t[1] !== r || t[2] !== n ? (l = vt(n, r), t[1] = r, t[2] = n, t[3] = l) : l = t[3];
1281
1347
  let u = l, d;
1282
- t[4] !== r || t[5] !== a || t[6] !== i || t[7] !== n ? (d = gt({
1348
+ t[4] !== r || t[5] !== a || t[6] !== i || t[7] !== n ? (d = St({
1283
1349
  sections: n,
1284
1350
  canMove: r,
1285
1351
  onReorderSections: i,
1286
1352
  onReorderNodes: a
1287
1353
  }), t[4] = r, t[5] = a, t[6] = i, t[7] = n, t[8] = d) : d = t[8];
1288
1354
  let f = d, p;
1289
- t[9] === o ? p = t[10] : (p = /* @__PURE__ */ y(_t.Provider, {
1355
+ t[9] === o ? p = t[10] : (p = /* @__PURE__ */ y(Ct.Provider, {
1290
1356
  value: !0,
1291
1357
  children: o
1292
1358
  }), t[9] = o, t[10] = p);
@@ -1295,21 +1361,21 @@ var ot = (e) => {
1295
1361
  sensors: c,
1296
1362
  collisionDetection: u,
1297
1363
  onDragEnd: f,
1298
- ...Xe,
1364
+ ...tt,
1299
1365
  children: p
1300
1366
  }), t[11] = u, t[12] = f, t[13] = c, t[14] = p, t[15] = m) : m = t[15], m;
1301
- }, yt = (e) => e?.label ? e.id : void 0, bt = (e, t, n = []) => {
1367
+ }, Tt = (e) => e?.label ? e.id : void 0, Et = (e, t, n = []) => {
1302
1368
  if (!t) return null;
1303
1369
  let r = (e) => {
1304
1370
  let t = e.children, i = n.includes(e.id) ? t?.at(-1) : void 0;
1305
1371
  return i ? r(i) : e;
1306
1372
  };
1307
1373
  if (t.kind === "node") {
1308
- let n = qe(e, t.id);
1374
+ let n = Qe(e, t.id);
1309
1375
  return n ? {
1310
1376
  lineId: t.edge === "after" ? r(n.node).id : t.id,
1311
1377
  edge: t.edge,
1312
- groupId: yt(n.section)
1378
+ groupId: Tt(n.section)
1313
1379
  } : null;
1314
1380
  }
1315
1381
  let i = e.find((e) => e.id === t.id);
@@ -1317,82 +1383,109 @@ var ot = (e) => {
1317
1383
  if (t.edge === "inside") {
1318
1384
  let e = i.nodes.at(-1);
1319
1385
  return {
1320
- lineId: e ? r(e).id : $(i.id),
1386
+ lineId: e ? r(e).id : We(i.id),
1321
1387
  edge: "after",
1322
- groupId: yt(i)
1388
+ groupId: Tt(i)
1323
1389
  };
1324
1390
  }
1325
1391
  return t.edge === "after" ? {
1326
- lineId: Ue(i.id),
1392
+ lineId: Je(i.id),
1327
1393
  edge: "middle"
1328
1394
  } : {
1329
- lineId: $(i.id),
1395
+ lineId: We(i.id),
1330
1396
  edge: "before"
1331
1397
  };
1332
- }, xt = (e, t) => e ? [...e.querySelectorAll("[data-tree-list-focus-id]")].find((e) => e.dataset.treeListFocusId === t) ?? null : null, St = (e, t) => {
1398
+ }, Dt = (e, t) => e ? [...e.querySelectorAll("[data-tree-list-focus-id]")].find((e) => e.dataset.treeListFocusId === t) ?? null : null, Ot = (e, t) => {
1333
1399
  if (e && t instanceof HTMLElement && e.contains(t)) return t.closest("[data-tree-list-focus-id]")?.dataset.treeListFocusId;
1334
- }, Ct = (e) => e instanceof HTMLElement ? e.isContentEditable ? !0 : [
1400
+ }, kt = (e) => e instanceof HTMLElement ? e.isContentEditable ? !0 : [
1335
1401
  "INPUT",
1336
1402
  "TEXTAREA",
1337
1403
  "SELECT"
1338
- ].includes(e.tagName) : !1, wt = (e, t) => e.findIndex((e) => Te(e) && we(e) === t), Tt = (e) => {
1339
- let t = _(28), { rows: n, activeNodeId: r, expandedNodeIds: i, onToggleNode: a, onToggleSection: o, scrollToRow: s } = e, c = E(null), [l, u] = D(), [d, f] = D(), p;
1340
- t[0] !== r || t[1] !== l || t[2] !== n ? (p = De(l, r, n), t[0] = r, t[1] = l, t[2] = n, t[3] = p) : p = t[3];
1341
- let m = p, h;
1342
- t[4] === n ? h = t[5] : (h = Ee(n).map(we).join("\0"), t[4] = n, t[5] = h);
1343
- let g = h, v, y;
1344
- t[6] !== g || t[7] !== l ? (v = () => {
1345
- l && (g.split("\0").includes(l) || u(void 0));
1346
- }, y = [l, g], t[6] = g, t[7] = l, t[8] = v, t[9] = y) : (v = t[8], y = t[9]), w(v, y);
1347
- let b, x;
1348
- t[10] === d ? (b = t[11], x = t[12]) : (b = () => {
1404
+ ].includes(e.tagName) : !1, At = (e, t) => e.findIndex((e) => we(e) && Ce(e) === t), jt = (e) => e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey && (e.key === "ArrowUp" || e.key === "ArrowDown"), Mt = (e, t, n) => {
1405
+ let r = e.flatMap((e) => e.kind === "node" && !e.node.disabled ? [e.node.id] : []);
1406
+ return r[r.indexOf(t ?? "") + (n === "ArrowUp" ? -1 : 1)];
1407
+ }, Nt = (e) => {
1408
+ let t = _(29), { rows: n, activeNodeId: r, expandedNodeIds: i, onToggleNode: a, onToggleSection: o, scrollToRow: s } = e, c = C(Re), l = E(null), u = E(null), [d, f] = D(), [p, m] = D(), h;
1409
+ t[0] !== r || t[1] !== d || t[2] !== n ? (h = Ee(d, r, n), t[0] = r, t[1] = d, t[2] = n, t[3] = h) : h = t[3];
1410
+ let g = h, v;
1411
+ t[4] === n ? v = t[5] : (v = JSON.stringify(Te(n).map(Pt)), t[4] = n, t[5] = v);
1412
+ let y = v, b, x;
1413
+ t[6] !== y || t[7] !== d ? (b = () => {
1349
1414
  if (!d) return;
1415
+ if (!JSON.parse(y).some((e) => e.id === d)) {
1416
+ f(void 0);
1417
+ return;
1418
+ }
1419
+ let e = u.current;
1420
+ e && !e.isConnected && (u.current = null, e.ownerDocument.hasFocus() && e.ownerDocument.activeElement === e.ownerDocument.body && Dt(l.current, d)?.focus());
1421
+ }, x = [d, y], t[6] = y, t[7] = d, t[8] = b, t[9] = x) : (b = t[8], x = t[9]), w(b, x);
1422
+ let S, T;
1423
+ t[10] === p ? (S = t[11], T = t[12]) : (S = () => {
1424
+ if (!p) return;
1350
1425
  let e = requestAnimationFrame(() => {
1351
1426
  requestAnimationFrame(() => {
1352
- let e = xt(c.current, d);
1353
- e && (e.focus(), f(void 0));
1427
+ let e = Dt(l.current, p);
1428
+ e && (e.focus(), m(void 0));
1354
1429
  });
1355
1430
  });
1356
1431
  return () => cancelAnimationFrame(e);
1357
- }, x = [d], t[10] = d, t[11] = b, t[12] = x), w(b, x);
1358
- let S;
1359
- t[13] !== n || t[14] !== s ? (S = (e) => {
1360
- u(e);
1361
- let t = xt(c.current, e);
1432
+ }, T = [p], t[10] = p, t[11] = S, t[12] = T), w(S, T);
1433
+ let O;
1434
+ t[13] !== n || t[14] !== s ? (O = (e) => {
1435
+ f(e);
1436
+ let t = Dt(l.current, e);
1362
1437
  if (t) {
1363
1438
  t.focus();
1364
1439
  return;
1365
1440
  }
1366
- let r = wt(n, e);
1367
- r !== -1 && (s?.(r), f(e));
1368
- }, t[13] = n, t[14] = s, t[15] = S) : S = t[15];
1369
- let C = S, T;
1370
- t[16] !== r || t[17] !== i || t[18] !== C || t[19] !== m || t[20] !== a || t[21] !== o || t[22] !== n ? (T = (e) => {
1371
- if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || Ct(e.target)) return;
1372
- let t = Ae({
1441
+ let r = At(n, e);
1442
+ r !== -1 && (s?.(r), m(e));
1443
+ }, t[13] = n, t[14] = s, t[15] = O) : O = t[15];
1444
+ let k = O, A;
1445
+ t[16] !== r || t[17] !== i || t[18] !== k || t[19] !== g || t[20] !== a || t[21] !== o || t[22] !== n || t[23] !== c ? (A = (e) => {
1446
+ if (e.defaultPrevented || kt(e.target)) return;
1447
+ if (c && jt(e)) {
1448
+ let t = Ot(l.current, e.target) ?? g, r = Mt(n, t, e.key);
1449
+ r && (c.select(r, e, t), k(r));
1450
+ return;
1451
+ }
1452
+ if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
1453
+ let t = ke({
1373
1454
  rows: n,
1374
- focusedRowId: St(c.current, e.target) ?? m,
1455
+ focusedRowId: Ot(l.current, e.target) ?? g,
1375
1456
  activeNodeId: r,
1376
1457
  expandedNodeIds: i,
1377
1458
  key: e.key
1378
1459
  });
1379
- t && (e.preventDefault(), t.type === "toggle-node" ? a?.(t.nodeId) : t.type === "toggle-section" ? o?.(t.sectionId) : C(t.rowId));
1380
- }, t[16] = r, t[17] = i, t[18] = C, t[19] = m, t[20] = a, t[21] = o, t[22] = n, t[23] = T) : T = t[23];
1381
- let O = T, k;
1382
- t[24] === Symbol.for("react.memo_cache_sentinel") ? (k = (e) => u(e), t[24] = k) : k = t[24];
1383
- let A;
1384
- return t[25] !== m || t[26] !== O ? (A = {
1385
- focusRowId: m,
1386
- rootRef: c,
1387
- handleKeyDown: O,
1388
- onRowFocus: k
1389
- }, t[25] = m, t[26] = O, t[27] = A) : A = t[27], A;
1390
- }, Et = 32, Dt = 4, Ot = (e) => {
1460
+ t && (e.preventDefault(), t.type === "toggle-node" ? a?.(t.nodeId) : t.type === "toggle-section" ? o?.(t.sectionId) : k(t.rowId));
1461
+ }, t[16] = r, t[17] = i, t[18] = k, t[19] = g, t[20] = a, t[21] = o, t[22] = n, t[23] = c, t[24] = A) : A = t[24];
1462
+ let j = A, M;
1463
+ t[25] === Symbol.for("react.memo_cache_sentinel") ? (M = (e) => {
1464
+ u.current = l.current?.ownerDocument.activeElement, f(e);
1465
+ }, t[25] = M) : M = t[25];
1466
+ let N;
1467
+ return t[26] !== g || t[27] !== j ? (N = {
1468
+ focusRowId: g,
1469
+ rootRef: l,
1470
+ handleKeyDown: j,
1471
+ onRowFocus: M
1472
+ }, t[26] = g, t[27] = j, t[28] = N) : N = t[28], N;
1473
+ };
1474
+ function Pt(e) {
1475
+ return {
1476
+ id: Ce(e),
1477
+ section: e.sectionId,
1478
+ level: e.kind === "node" ? e.level : 0,
1479
+ parent: e.kind === "node" ? e.parentNodeId : void 0
1480
+ };
1481
+ }
1482
+ // src/components/tree-list/tree-list-virtual.tsx
1483
+ var Ft = 32, It = 4, Lt = (e) => {
1391
1484
  let t = _(18), { sortable: n, row: r, indicator: i, children: a } = e;
1392
1485
  if (!n || r.kind === "section-empty") return a;
1393
1486
  if (r.kind === "node" && r.level > 0) {
1394
1487
  let e;
1395
- t[0] !== i || t[1] !== r.node.id ? (e = i?.lineId === r.node.id ? /* @__PURE__ */ y(Qe, { edge: i.edge }) : null, t[0] = i, t[1] = r.node.id, t[2] = e) : e = t[2];
1488
+ t[0] !== i || t[1] !== r.node.id ? (e = i?.lineId === r.node.id ? /* @__PURE__ */ y(it, { edge: i.edge }) : null, t[0] = i, t[1] = r.node.id, t[2] = e) : e = t[2];
1396
1489
  let n;
1397
1490
  return t[3] !== a || t[4] !== e ? (n = /* @__PURE__ */ b(c, {
1398
1491
  position: "relative",
@@ -1401,11 +1494,11 @@ var ot = (e) => {
1401
1494
  }), t[3] = a, t[4] = e, t[5] = n) : n = t[5], n;
1402
1495
  }
1403
1496
  let o;
1404
- t[6] !== r.kind || t[7] !== r.node || t[8] !== r.sectionId ? (o = r.kind === "node" ? r.node.id : $(r.sectionId), t[6] = r.kind, t[7] = r.node, t[8] = r.sectionId, t[9] = o) : o = t[9];
1497
+ t[6] !== r.kind || t[7] !== r.node || t[8] !== r.sectionId ? (o = r.kind === "node" ? r.node.id : We(r.sectionId), t[6] = r.kind, t[7] = r.node, t[8] = r.sectionId, t[9] = o) : o = t[9];
1405
1498
  let s = o, l = r.kind === "node" ? r.node.canReorder === !1 : r.section.canReorder === !1, u = r.kind === "section-header" && i?.groupId === r.sectionId, d;
1406
1499
  t[10] === a ? d = t[11] : (d = () => a, t[10] = a, t[11] = d);
1407
1500
  let f;
1408
- return t[12] !== l || t[13] !== s || t[14] !== i || t[15] !== u || t[16] !== d ? (f = /* @__PURE__ */ y($e, {
1501
+ return t[12] !== l || t[13] !== s || t[14] !== i || t[15] !== u || t[16] !== d ? (f = /* @__PURE__ */ y(at, {
1409
1502
  id: s,
1410
1503
  disabled: l,
1411
1504
  indicator: i,
@@ -1414,89 +1507,92 @@ var ot = (e) => {
1414
1507
  highlighted: u,
1415
1508
  children: d
1416
1509
  }), t[12] = l, t[13] = s, t[14] = i, t[15] = u, t[16] = d, t[17] = f) : f = t[17], f;
1417
- }, kt = (e) => {
1418
- let { rows: t, expandedNodeIds: n = [], activeNodeId: r, rowVariant: i = "tree", nodeGap: o = "0", linkComponent: s, onNavigate: l, onToggleSection: u, onToggleNode: d, onSectionContextMenu: f, onMoveNode: p, scrollRef: m, sortable: h = !1, indicator: g = null, sectionGap: _ = "0" } = e, { virtualizer: v, virtualItems: x, totalSize: S } = a({
1419
- count: t.length,
1420
- getScrollElement: () => m.current,
1421
- estimateSize: () => Et,
1422
- overscan: Dt,
1423
- getItemKey: (e) => t[e]?.key ?? e
1424
- }), C = Tt({
1425
- rows: t,
1426
- activeNodeId: r,
1427
- expandedNodeIds: n,
1428
- onToggleNode: d,
1429
- onToggleSection: u,
1430
- scrollToRow: (e) => v.scrollToIndex(e, { align: "auto" })
1431
- }), w = /* @__PURE__ */ y(c, {
1432
- ref: C.rootRef,
1510
+ }, Rt = (e) => {
1511
+ let t = C(Re), { rows: n, expandedNodeIds: r = [], activeNodeId: i, rowVariant: o = "tree", nodeGap: s = "0", linkComponent: l, onNavigate: u, onToggleSection: d, onToggleNode: f, onSectionContextMenu: p, onMoveNode: m, scrollRef: h, sortable: g = !1, indicator: _ = null, sectionGap: v = "0" } = e, { virtualizer: x, virtualItems: S, totalSize: w } = a({
1512
+ count: n.length,
1513
+ getScrollElement: () => h.current,
1514
+ estimateSize: () => Ft,
1515
+ overscan: It,
1516
+ getItemKey: (e) => n[e]?.key ?? e
1517
+ }), T = Nt({
1518
+ rows: n,
1519
+ activeNodeId: i,
1520
+ expandedNodeIds: r,
1521
+ onToggleNode: f,
1522
+ onToggleSection: d,
1523
+ scrollToRow: (e) => x.scrollToIndex(e, { align: "auto" })
1524
+ }), E = /* @__PURE__ */ y(c, {
1525
+ ref: T.rootRef,
1433
1526
  "data-tree-list-virtual": "",
1434
1527
  role: "listbox",
1528
+ "aria-multiselectable": !!t || void 0,
1435
1529
  w: "full",
1436
1530
  minW: "0",
1437
1531
  maxW: "full",
1438
1532
  position: "relative",
1439
- style: { height: S },
1440
- onKeyDown: C.handleKeyDown,
1441
- children: x.map((e) => {
1442
- let a = t[e.index];
1443
- return a ? /* @__PURE__ */ b(c, {
1444
- ref: v.measureElement,
1533
+ style: { height: w },
1534
+ onKeyDown: T.handleKeyDown,
1535
+ children: S.map((e) => {
1536
+ let t = n[e.index];
1537
+ return t ? /* @__PURE__ */ b(c, {
1538
+ ref: x.measureElement,
1445
1539
  "data-index": e.index,
1446
- "data-tree-list-row": a.kind,
1540
+ "data-tree-list-row": t.kind,
1447
1541
  position: "absolute",
1448
1542
  top: "0",
1449
1543
  left: "0",
1450
1544
  w: "full",
1451
- pb: e.index === t.length - 1 || h && a.sectionId !== t[e.index + 1]?.sectionId ? "0" : o,
1545
+ pb: e.index === n.length - 1 || g && t.sectionId !== n[e.index + 1]?.sectionId ? "0" : s,
1452
1546
  style: { transform: `translateY(${e.start}px)` },
1453
- children: [/* @__PURE__ */ y(Ot, {
1454
- sortable: h,
1455
- row: a,
1456
- indicator: g,
1457
- children: /* @__PURE__ */ y(ot, {
1458
- row: a,
1459
- expandedNodeIds: n,
1460
- activeNodeId: r,
1461
- focusRowId: C.focusRowId,
1462
- rowVariant: i,
1463
- nodeGap: o,
1464
- linkComponent: s,
1465
- onRowFocus: C.onRowFocus,
1466
- onNavigate: l,
1467
- onToggleSection: u,
1468
- onToggleNode: d,
1469
- onSectionContextMenu: f,
1470
- onMoveNode: p
1547
+ children: [/* @__PURE__ */ y(Lt, {
1548
+ sortable: g,
1549
+ row: t,
1550
+ indicator: _,
1551
+ children: /* @__PURE__ */ y(ft, {
1552
+ row: t,
1553
+ expandedNodeIds: r,
1554
+ activeNodeId: i,
1555
+ focusRowId: T.focusRowId,
1556
+ rowVariant: o,
1557
+ nodeGap: s,
1558
+ linkComponent: l,
1559
+ onRowFocus: T.onRowFocus,
1560
+ onNavigate: u,
1561
+ onToggleSection: d,
1562
+ onToggleNode: f,
1563
+ onSectionContextMenu: p,
1564
+ onMoveNode: m
1471
1565
  })
1472
- }), h && a.sectionId !== t[e.index + 1]?.sectionId ? /* @__PURE__ */ y(et, {
1473
- sectionId: a.sectionId,
1474
- nextSectionId: t[e.index + 1]?.sectionId,
1475
- gap: _,
1476
- indicator: g
1566
+ }), g && t.sectionId !== n[e.index + 1]?.sectionId ? /* @__PURE__ */ y(ot, {
1567
+ sectionId: t.sectionId,
1568
+ nextSectionId: n[e.index + 1]?.sectionId,
1569
+ gap: v,
1570
+ indicator: _
1477
1571
  }) : null]
1478
1572
  }, e.key) : null;
1479
1573
  })
1480
1574
  });
1481
- return h ? /* @__PURE__ */ y(B, {
1482
- items: t.flatMap((e) => e.kind === "section-header" ? [$(e.sectionId)] : e.kind === "node" && e.level === 0 ? [e.node.id] : []),
1575
+ return g ? /* @__PURE__ */ y(B, {
1576
+ items: n.flatMap((e) => e.kind === "section-header" ? [We(e.sectionId)] : e.kind === "node" && e.level === 0 ? [e.node.id] : []),
1483
1577
  strategy: H,
1484
- children: w
1485
- }) : w;
1486
- }, At = (e) => {
1578
+ children: E
1579
+ }) : E;
1580
+ }, zt = (e) => {
1487
1581
  let t = _(35), { section: n, sectionRows: r, expandedNodeIds: i, activeNodeId: a, rowVariant: o, nodeGap: s, linkComponent: l, onNavigate: u, onToggleSection: d, onToggleNode: f, onMoveNode: p, onSectionContextMenu: m, indicator: h, dragging: g, focusRowId: x, onRowFocus: S } = e, C;
1488
- t[0] === r ? C = t[1] : (C = r.find(Nt), t[0] = r, t[1] = C);
1582
+ t[0] === r ? C = t[1] : (C = r.find(Ht), t[0] = r, t[1] = C);
1489
1583
  let w = C, T;
1490
- t[2] === r ? T = t[3] : (T = r.filter(Pt), t[2] = r, t[3] = T);
1584
+ t[2] === r ? T = t[3] : (T = r.filter(Ut), t[2] = r, t[3] = T);
1491
1585
  let E = T, D;
1492
- t[4] === n.nodes ? D = t[5] : (D = n.nodes.map(Ft), t[4] = n.nodes, t[5] = D);
1586
+ t[4] === n.nodes ? D = t[5] : (D = n.nodes.map(Wt), t[4] = n.nodes, t[5] = D);
1493
1587
  let O = D, k;
1494
- t[6] === n.id ? k = t[7] : (k = $(n.id), t[6] = n.id, t[7] = k);
1588
+ t[6] === n.id ? k = t[7] : (k = We(n.id), t[6] = n.id, t[7] = k);
1495
1589
  let A = n.canReorder === !1, j = h?.groupId === n.id, M;
1496
1590
  t[8] !== a || t[9] !== g || t[10] !== i || t[11] !== x || t[12] !== w || t[13] !== h || t[14] !== l || t[15] !== s || t[16] !== E || t[17] !== p || t[18] !== u || t[19] !== S || t[20] !== m || t[21] !== f || t[22] !== d || t[23] !== o || t[24] !== n.emptyState || t[25] !== n.id || t[26] !== n.nodes || t[27] !== O ? (M = (e) => /* @__PURE__ */ b(v, { children: [
1497
1591
  w && w.kind === "section-header" ? /* @__PURE__ */ y(c, {
1498
- onPointerDownCapture: (t) => e?.onPointerDown?.(t),
1499
- children: /* @__PURE__ */ y(it, {
1592
+ onPointerDownCapture: (t) => {
1593
+ rt(t.target) && e?.onPointerDown?.(t);
1594
+ },
1595
+ children: /* @__PURE__ */ y(ut, {
1500
1596
  section: w.section,
1501
1597
  collapsible: w.collapsible,
1502
1598
  expanded: w.expanded,
@@ -1511,12 +1607,12 @@ var ot = (e) => {
1511
1607
  h: "tree-empty-drop-zone",
1512
1608
  "data-tree-list-empty-drop-zone": ""
1513
1609
  }) : null,
1514
- /* @__PURE__ */ y(Re, {
1610
+ /* @__PURE__ */ y(He, {
1515
1611
  open: !w || w.kind === "section-header" && w.expanded,
1516
1612
  children: /* @__PURE__ */ b(B, {
1517
1613
  items: O,
1518
1614
  strategy: H,
1519
- children: [/* @__PURE__ */ y(nt, {
1615
+ children: [/* @__PURE__ */ y(ct, {
1520
1616
  sectionId: n.id,
1521
1617
  nodes: n.nodes,
1522
1618
  expandedNodeIds: i,
@@ -1536,7 +1632,7 @@ var ot = (e) => {
1536
1632
  })
1537
1633
  ] }), t[8] = a, t[9] = g, t[10] = i, t[11] = x, t[12] = w, t[13] = h, t[14] = l, t[15] = s, t[16] = E, t[17] = p, t[18] = u, t[19] = S, t[20] = m, t[21] = f, t[22] = d, t[23] = o, t[24] = n.emptyState, t[25] = n.id, t[26] = n.nodes, t[27] = O, t[28] = M) : M = t[28];
1538
1634
  let N;
1539
- return t[29] !== h || t[30] !== k || t[31] !== A || t[32] !== j || t[33] !== M ? (N = /* @__PURE__ */ y($e, {
1635
+ return t[29] !== h || t[30] !== k || t[31] !== A || t[32] !== j || t[33] !== M ? (N = /* @__PURE__ */ y(at, {
1540
1636
  id: k,
1541
1637
  disabled: A,
1542
1638
  indicator: h,
@@ -1544,83 +1640,84 @@ var ot = (e) => {
1544
1640
  highlighted: j,
1545
1641
  children: M
1546
1642
  }), t[29] = h, t[30] = k, t[31] = A, t[32] = j, t[33] = M, t[34] = N) : N = t[34], N;
1547
- }, jt = (e) => {
1548
- let { sections: t, expandedSectionIds: n, expandedNodeIds: r, sectionGap: i, ...a } = e, { active: o, over: s } = F(), [c, l] = D(null);
1643
+ }, Bt = (e) => {
1644
+ let t = C(Re), { sections: n, expandedSectionIds: r, expandedNodeIds: i, sectionGap: a, ...o } = e, { active: s, over: c } = F(), [l, u] = D(null);
1549
1645
  I({
1550
- onDragMove: (e) => l(pt(e.activatorEvent, e.delta.y)),
1551
- onDragEnd: () => l(null),
1552
- onDragCancel: () => l(null)
1646
+ onDragMove: (e) => u(yt(e.activatorEvent, e.delta.y)),
1647
+ onDragEnd: () => u(null),
1648
+ onDragCancel: () => u(null)
1553
1649
  });
1554
- let u = bt(t, o && c !== null ? mt(String(o.id), s, c) : null, r), d = Ce(t, n, r), f = Tt({
1555
- rows: d,
1556
- activeNodeId: a.activeNodeId,
1557
- expandedNodeIds: r,
1558
- onToggleNode: a.onToggleNode,
1559
- onToggleSection: a.onToggleSection
1650
+ let d = Et(n, s && l !== null ? bt(String(s.id), c, l) : null, i), f = Se(n, r, i), m = Nt({
1651
+ rows: f,
1652
+ activeNodeId: o.activeNodeId,
1653
+ expandedNodeIds: i,
1654
+ onToggleNode: o.onToggleNode,
1655
+ onToggleSection: o.onToggleSection
1560
1656
  });
1561
- return e.virtualize && e.scrollRef ? /* @__PURE__ */ y(kt, {
1657
+ return e.virtualize && e.scrollRef ? /* @__PURE__ */ y(Rt, {
1562
1658
  ...e,
1563
- rows: d,
1659
+ rows: f,
1564
1660
  scrollRef: e.scrollRef,
1565
1661
  sortable: !0,
1566
- indicator: u
1662
+ indicator: d
1567
1663
  }) : /* @__PURE__ */ y(B, {
1568
- items: t.map((e) => $(e.id)),
1664
+ items: n.map((e) => We(e.id)),
1569
1665
  strategy: H,
1570
1666
  children: /* @__PURE__ */ y(p, {
1571
- ref: f.rootRef,
1667
+ ref: m.rootRef,
1572
1668
  role: "listbox",
1573
- onKeyDown: f.handleKeyDown,
1669
+ "aria-multiselectable": !!t || void 0,
1670
+ onKeyDown: m.handleKeyDown,
1574
1671
  gap: "0",
1575
1672
  w: "full",
1576
1673
  minW: "0",
1577
1674
  maxW: "full",
1578
1675
  position: "relative",
1579
- children: t.map((e, n) => /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ y(At, {
1676
+ children: n.map((e, t) => /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ y(zt, {
1580
1677
  section: e,
1581
- sectionRows: d.filter((t) => t.sectionId === e.id),
1582
- expandedNodeIds: r,
1583
- rowVariant: a.rowVariant ?? "tree",
1584
- nodeGap: a.nodeGap,
1585
- activeNodeId: a.activeNodeId,
1586
- linkComponent: a.linkComponent,
1587
- onNavigate: a.onNavigate,
1588
- onToggleSection: a.onToggleSection,
1589
- onToggleNode: a.onToggleNode,
1590
- onMoveNode: a.onMoveNode,
1591
- onSectionContextMenu: a.onSectionContextMenu,
1592
- indicator: u,
1593
- dragging: !!o,
1594
- focusRowId: f.focusRowId,
1595
- onRowFocus: f.onRowFocus
1596
- }), /* @__PURE__ */ y(et, {
1678
+ sectionRows: f.filter((t) => t.sectionId === e.id),
1679
+ expandedNodeIds: i,
1680
+ rowVariant: o.rowVariant ?? "tree",
1681
+ nodeGap: o.nodeGap,
1682
+ activeNodeId: o.activeNodeId,
1683
+ linkComponent: o.linkComponent,
1684
+ onNavigate: o.onNavigate,
1685
+ onToggleSection: o.onToggleSection,
1686
+ onToggleNode: o.onToggleNode,
1687
+ onMoveNode: o.onMoveNode,
1688
+ onSectionContextMenu: o.onSectionContextMenu,
1689
+ indicator: d,
1690
+ dragging: !!s,
1691
+ focusRowId: m.focusRowId,
1692
+ onRowFocus: m.onRowFocus
1693
+ }), /* @__PURE__ */ y(ot, {
1597
1694
  sectionId: e.id,
1598
- nextSectionId: t[n + 1]?.id,
1599
- gap: i,
1600
- indicator: u
1695
+ nextSectionId: n[t + 1]?.id,
1696
+ gap: a,
1697
+ indicator: d
1601
1698
  })] }, e.id))
1602
1699
  })
1603
1700
  });
1604
- }, Mt = (e) => {
1701
+ }, Vt = (e) => {
1605
1702
  let t = _(36), { sections: n, expandedSectionIds: r, expandedNodeIds: i, activeNodeId: a, rowVariant: o, sectionGap: s, nodeGap: c, linkComponent: l, onNavigate: u, onToggleSection: d, onToggleNode: f, onMoveNode: p, onSectionContextMenu: m, onReorderSections: h, onReorderNodes: g, canMove: v } = e, b;
1606
1703
  t[0] === r ? b = t[1] : (b = r === void 0 ? [] : r, t[0] = r, t[1] = b);
1607
1704
  let x = b, S;
1608
1705
  t[2] === i ? S = t[3] : (S = i === void 0 ? [] : i, t[2] = i, t[3] = S);
1609
1706
  let w = S, T = o === void 0 ? "tree" : o, E = s === void 0 ? "0" : s, D = c === void 0 ? "0" : c, O;
1610
1707
  t[4] === Symbol.for("react.memo_cache_sentinel") ? (O = { activationConstraint: { distance: 4 } }, t[4] = O) : O = t[4];
1611
- let k = z(R(M, O)), j = C(_t), N;
1612
- t[5] !== v || t[6] !== n ? (N = ft(n, v), t[5] = v, t[6] = n, t[7] = N) : N = t[7];
1708
+ let k = z(R(M, O)), j = C(Ct), N;
1709
+ t[5] !== v || t[6] !== n ? (N = vt(n, v), t[5] = v, t[6] = n, t[7] = N) : N = t[7];
1613
1710
  let P = N, F;
1614
1711
  t[8] === h ? F = t[9] : (F = (e) => h?.(e), t[8] = h, t[9] = F);
1615
1712
  let I;
1616
- t[10] !== v || t[11] !== g || t[12] !== n || t[13] !== F ? (I = gt({
1713
+ t[10] !== v || t[11] !== g || t[12] !== n || t[13] !== F ? (I = St({
1617
1714
  sections: n,
1618
1715
  canMove: v,
1619
1716
  onReorderSections: F,
1620
1717
  onReorderNodes: g
1621
1718
  }), t[10] = v, t[11] = g, t[12] = n, t[13] = F, t[14] = I) : I = t[14];
1622
1719
  let L = I, B;
1623
- t[15] !== a || t[16] !== w || t[17] !== x || t[18] !== l || t[19] !== D || t[20] !== p || t[21] !== u || t[22] !== m || t[23] !== f || t[24] !== d || t[25] !== e.scrollRef || t[26] !== e.virtualize || t[27] !== T || t[28] !== E || t[29] !== n ? (B = /* @__PURE__ */ y(jt, {
1720
+ t[15] !== a || t[16] !== w || t[17] !== x || t[18] !== l || t[19] !== D || t[20] !== p || t[21] !== u || t[22] !== m || t[23] !== f || t[24] !== d || t[25] !== e.scrollRef || t[26] !== e.virtualize || t[27] !== T || t[28] !== E || t[29] !== n ? (B = /* @__PURE__ */ y(Bt, {
1624
1721
  sections: n,
1625
1722
  expandedSectionIds: x,
1626
1723
  expandedNodeIds: w,
@@ -1644,35 +1741,36 @@ var ot = (e) => {
1644
1741
  sensors: k,
1645
1742
  collisionDetection: P,
1646
1743
  onDragEnd: L,
1647
- ...Xe,
1744
+ ...tt,
1648
1745
  children: V
1649
1746
  }), t[31] = P, t[32] = V, t[33] = L, t[34] = k, t[35] = H) : H = t[35], H;
1650
1747
  };
1651
- function Nt(e) {
1748
+ function Ht(e) {
1652
1749
  return e.kind === "section-header";
1653
1750
  }
1654
- function Pt(e) {
1751
+ function Ut(e) {
1655
1752
  return e.kind === "node";
1656
1753
  }
1657
- function Ft(e) {
1754
+ function Wt(e) {
1658
1755
  return e.id;
1659
1756
  }
1660
1757
  // src/components/tree-list/tree-list.tsx
1661
- var It = (e) => {
1662
- let { sections: t, expandedSectionIds: n = [], expandedNodeIds: r = [], activeNodeId: i, rowVariant: a = "tree", sectionGap: o = "0", nodeGap: s = "0", linkComponent: l, onNavigate: u, onToggleSection: d, onToggleNode: f, onSectionContextMenu: m, onMoveNode: h, virtualize: g, scrollRef: _ } = e, v = Ce(t, n, r), x = Tt({
1758
+ var Gt = (e) => {
1759
+ let { sections: t, expandedSectionIds: n = [], expandedNodeIds: r = [], activeNodeId: i, rowVariant: a = "tree", sectionGap: o = "0", nodeGap: s = "0", linkComponent: l, onNavigate: u, onToggleSection: d, onToggleNode: f, onSectionContextMenu: m, onMoveNode: h, virtualize: g, scrollRef: _ } = e, v = Se(t, n, r), x = Nt({
1663
1760
  rows: v,
1664
1761
  activeNodeId: i,
1665
1762
  expandedNodeIds: r,
1666
1763
  onToggleNode: f,
1667
1764
  onToggleSection: d
1668
1765
  });
1669
- return g && _ ? /* @__PURE__ */ y(kt, {
1766
+ return g && _ ? /* @__PURE__ */ y(Rt, {
1670
1767
  ...e,
1671
1768
  rows: v,
1672
1769
  scrollRef: _
1673
1770
  }) : /* @__PURE__ */ y(p, {
1674
1771
  ref: x.rootRef,
1675
1772
  role: "listbox",
1773
+ "aria-multiselectable": !!e.onSelectionChange || void 0,
1676
1774
  gap: o,
1677
1775
  w: "full",
1678
1776
  minW: "0",
@@ -1690,7 +1788,7 @@ var It = (e) => {
1690
1788
  children: [t.filter((e) => e.kind === "section-header").map((e) => /* @__PURE__ */ y(c, {
1691
1789
  w: "full",
1692
1790
  minW: "0",
1693
- children: /* @__PURE__ */ y(ot, {
1791
+ children: /* @__PURE__ */ y(ft, {
1694
1792
  row: e,
1695
1793
  expandedNodeIds: r,
1696
1794
  activeNodeId: i,
@@ -1705,9 +1803,9 @@ var It = (e) => {
1705
1803
  onSectionContextMenu: m,
1706
1804
  onMoveNode: h
1707
1805
  })
1708
- }, e.key)), /* @__PURE__ */ b(Re, {
1806
+ }, e.key)), /* @__PURE__ */ b(He, {
1709
1807
  open: e.collapsible === !1 || e.label === void 0 || n.includes(e.id),
1710
- children: [/* @__PURE__ */ y(nt, {
1808
+ children: [/* @__PURE__ */ y(ct, {
1711
1809
  sectionId: e.id,
1712
1810
  nodes: e.nodes,
1713
1811
  expandedNodeIds: r,
@@ -1725,9 +1823,9 @@ var It = (e) => {
1725
1823
  }, e.id);
1726
1824
  })
1727
1825
  });
1728
- }, Lt = (e) => {
1729
- let t = _(8), n;
1730
- t[0] === e ? n = t[1] : (n = e.draggable ? /* @__PURE__ */ y(Mt, {
1826
+ }, Kt = (e) => {
1827
+ let t = _(12), n;
1828
+ t[0] === e ? n = t[1] : (n = e.draggable ? /* @__PURE__ */ y(Vt, {
1731
1829
  virtualize: e.virtualize,
1732
1830
  scrollRef: e.scrollRef,
1733
1831
  sections: e.sections,
@@ -1746,20 +1844,25 @@ var It = (e) => {
1746
1844
  onReorderNodes: e.onReorderNodes,
1747
1845
  onMoveNode: e.onMoveNode,
1748
1846
  canMove: e.canMove
1749
- }) : /* @__PURE__ */ y(It, { ...e }), t[0] = e, t[1] = n);
1847
+ }) : /* @__PURE__ */ y(Gt, { ...e }), t[0] = e, t[1] = n);
1750
1848
  let r = n, i;
1751
- t[2] !== r || t[3] !== e.onMoveNode ? (i = /* @__PURE__ */ y(Pe, {
1849
+ t[2] !== r || t[3] !== e.leadingContent || t[4] !== e.onMoveNode ? (i = /* @__PURE__ */ b(Ne, {
1752
1850
  onMoveNode: e.onMoveNode,
1753
- children: r
1754
- }), t[2] = r, t[3] = e.onMoveNode, t[4] = i) : i = t[4];
1755
- let a = i;
1756
- if (!e.backgroundContextActions || e.backgroundContextActions.length === 0) return a;
1757
- let o;
1758
- return t[5] !== a || t[6] !== e.backgroundContextActions ? (o = /* @__PURE__ */ y(ge, {
1851
+ children: [e.leadingContent, r]
1852
+ }), t[2] = r, t[3] = e.leadingContent, t[4] = e.onMoveNode, t[5] = i) : i = t[5];
1853
+ let a;
1854
+ t[6] !== e || t[7] !== i ? (a = /* @__PURE__ */ y(Be, {
1855
+ tree: e,
1856
+ children: i
1857
+ }), t[6] = e, t[7] = i, t[8] = a) : a = t[8];
1858
+ let o = a;
1859
+ if (!e.backgroundContextActions || e.backgroundContextActions.length === 0) return o;
1860
+ let s;
1861
+ return t[9] !== o || t[10] !== e.backgroundContextActions ? (s = /* @__PURE__ */ y(he, {
1759
1862
  actions: e.backgroundContextActions,
1760
- children: a
1761
- }), t[5] = a, t[6] = e.backgroundContextActions, t[7] = o) : o = t[7], o;
1863
+ children: o
1864
+ }), t[9] = o, t[10] = e.backgroundContextActions, t[11] = s) : s = t[11], s;
1762
1865
  };
1763
- export { vt as n, he as r, Lt as t };
1866
+ export { wt as n, me as r, Kt as t };
1764
1867
 
1765
- //# sourceMappingURL=tree-list-Bg8U7ZYc.js.map
1868
+ //# sourceMappingURL=tree-list-UO26kzU6.js.map