nexus-shell 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,28 @@
1
- var ht = Object.defineProperty;
2
- var gt = (e, t, r) => t in e ? ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var ee = (e, t, r) => gt(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { jsxs as x, jsx as o, Fragment as Ue } from "react/jsx-runtime";
5
- import he, { useMemo as B, useContext as xt, createContext as bt, useEffect as R, useState as P, useRef as _, forwardRef as yt, useCallback as Y, useImperativeHandle as vt } from "react";
6
- import { Model as G, Actions as ae, DockLocation as wt, Layout as Nt } from "flexlayout-react";
1
+ var gt = Object.defineProperty;
2
+ var xt = (e, t, r) => t in e ? gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var ee = (e, t, r) => xt(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { jsxs as x, jsx as o, Fragment as He } from "react/jsx-runtime";
5
+ import pe, { useMemo as B, useContext as bt, createContext as yt, useEffect as F, useState as A, useRef as _, forwardRef as vt, useCallback as Y, useImperativeHandle as wt } from "react";
6
+ import { Model as G, Actions as ae, DockLocation as Nt, Layout as kt } from "flexlayout-react";
7
7
  import "flexlayout-react/style/light.css";
8
- import { Settings as kt, ChevronRight as Be, X, GraduationCap as Me, Moon as Et, Sun as Tt, Palette as Dt, MessageCircle as Te, User as He, Terminal as De, Send as St, ChevronUp as je, Search as xe, Info as Lt, HelpCircle as It, AlertCircle as Mt, Check as Ct, Camera as At, Edit2 as Pt, Loader2 as We, ChevronsUpDown as $t, ChevronDown as Ge, Clock as Rt, Plus as Ft } from "lucide-react";
9
- import { clsx as zt } from "clsx";
10
- import { twMerge as Ot } from "tailwind-merge";
8
+ import { clsx as Et } from "clsx";
9
+ import { twMerge as Tt } from "tailwind-merge";
11
10
  import { create as Q } from "zustand";
12
- import { TableVirtuoso as _t, Virtuoso as Kt } from "react-virtuoso";
13
- function I(...e) {
14
- return Ot(zt(e));
11
+ import { ChevronRight as je, X, MessageCircle as Ee, User as We, Terminal as Te, Send as Dt, GraduationCap as Se, Moon as Lt, Sun as It, Palette as Pt, ChevronUp as Ge, Settings as St, Search as ge, Info as Mt, HelpCircle as Ct, AlertCircle as At, Check as $t, Camera as Rt, Edit2 as Ft, Loader2 as Ye, ChevronsUpDown as zt, ChevronDown as Je, Clock as Ot, Plus as _t } from "lucide-react";
12
+ import { TableVirtuoso as Kt, Virtuoso as Ut } from "react-virtuoso";
13
+ function P(...e) {
14
+ return Tt(Et(e));
15
15
  }
16
- const Ut = [
17
- { id: "settings", label: "Settings", icon: kt }
18
- ], Bt = ({
16
+ const Bt = ({
19
17
  items: e = [],
20
- bottomItems: t = Ut,
18
+ bottomItems: t = [],
21
19
  activeId: r = null,
22
20
  onSelect: n,
23
21
  side: s = "left",
24
22
  className: i,
25
23
  "aria-label": a = "Activity Bar"
26
24
  }) => {
27
- const u = ({ id: c, label: l, icon: f }) => /* @__PURE__ */ o(
25
+ const d = ({ id: c, label: l, icon: p }) => /* @__PURE__ */ o(
28
26
  "button",
29
27
  {
30
28
  type: "button",
@@ -32,7 +30,7 @@ const Ut = [
32
30
  "aria-label": l,
33
31
  title: l,
34
32
  "aria-pressed": r === c,
35
- className: I(
33
+ className: P(
36
34
  "p-2 cursor-pointer rounded text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
37
35
  r === c && [
38
36
  "text-foreground border-primary rounded-none",
@@ -40,7 +38,7 @@ const Ut = [
40
38
  s === "right" ? "border-r-2" : "border-l-2"
41
39
  ]
42
40
  ),
43
- children: /* @__PURE__ */ o(f, { size: 20 })
41
+ children: /* @__PURE__ */ o(p, { size: 20 })
44
42
  },
45
43
  c
46
44
  );
@@ -50,55 +48,57 @@ const Ut = [
50
48
  role: "navigation",
51
49
  "aria-label": a,
52
50
  "data-side": s,
53
- className: I(
51
+ className: P(
54
52
  "w-12 h-full bg-muted flex flex-col items-center py-2 select-none",
55
53
  s === "right" ? "border-l" : "border-r",
56
54
  i
57
55
  ),
58
56
  children: [
59
- /* @__PURE__ */ o("div", { className: "flex-1 flex flex-col space-y-4", children: e.map(u) }),
60
- t.length > 0 && /* @__PURE__ */ o("div", { className: "flex flex-col space-y-4", children: t.map(u) })
57
+ /* @__PURE__ */ o("div", { className: "flex-1 flex flex-col space-y-4", children: e.map(d) }),
58
+ t.length > 0 && /* @__PURE__ */ o("div", { className: "flex flex-col space-y-4", children: t.map(d) })
61
59
  ]
62
60
  }
63
61
  );
64
- }, Ye = "chat", Je = "terminal", Xe = (e) => Q((t) => {
62
+ }, Xe = "chat", qe = "terminal", Ht = "settings", De = (e) => Q((t) => {
65
63
  const r = (n) => (n === null ? localStorage.removeItem(e) : localStorage.setItem(e, n), n);
66
64
  return {
67
- activeSidebar: localStorage.getItem(e),
65
+ activePanel: localStorage.getItem(e),
68
66
  panels: [],
69
- setActiveSidebar: (n) => t({ activeSidebar: r(n) }),
70
- toggleSidebar: (n) => t((s) => ({
71
- activeSidebar: r(s.activeSidebar === n ? null : n)
67
+ setActivePanel: (n) => t({ activePanel: r(n) }),
68
+ togglePanel: (n) => t((s) => ({
69
+ activePanel: r(s.activePanel === n ? null : n)
72
70
  })),
73
71
  setPanels: (n) => t({ panels: n })
74
72
  };
75
- }), ce = Xe("nexus-shell-sidebar"), ie = Xe("nexus-shell-inspector"), qe = ({
76
- store: e,
77
- ...t
78
- }) => {
79
- const r = e((a) => a.panels), n = e((a) => a.activeSidebar), s = e((a) => a.toggleSidebar), i = B(
80
- () => r.map(({ id: a, label: u, icon: c }) => ({ id: a, label: u, icon: c })),
81
- [r]
82
- );
83
- return /* @__PURE__ */ o(
73
+ }), jt = De("nexus-shell-pane-left"), Wt = De("nexus-shell-pane-right"), Gt = De("nexus-shell-pane-bottom"), Yt = {
74
+ left: jt,
75
+ right: Wt,
76
+ bottom: Gt
77
+ }, ce = (e) => Yt[e], Ve = ["left", "right", "bottom"], Qe = (e) => {
78
+ Ve.forEach((t) => {
79
+ ce(t).getState().setPanels(e.filter((r) => (r.side ?? "left") === t));
80
+ });
81
+ }, Me = ({ side: e = "left", ...t }) => {
82
+ const r = ce(e), n = r((c) => c.panels), s = r((c) => c.activePanel), i = r((c) => c.togglePanel), [a, d] = B(() => {
83
+ const c = ({ id: l, label: p, icon: u }) => ({ id: l, label: p, icon: u });
84
+ return [
85
+ n.filter((l) => l.align !== "end").map(c),
86
+ n.filter((l) => l.align === "end").map(c)
87
+ ];
88
+ }, [n]);
89
+ return n.length === 0 ? null : /* @__PURE__ */ o(
84
90
  Bt,
85
91
  {
86
92
  ...t,
87
- items: i,
88
- activeId: n,
89
- onSelect: s
93
+ side: e,
94
+ items: a,
95
+ bottomItems: d,
96
+ activeId: s,
97
+ onSelect: i,
98
+ "aria-label": t["aria-label"] ?? (e === "right" ? "Inspector Bar" : "Activity Bar")
90
99
  }
91
100
  );
92
- }, Ht = (e) => /* @__PURE__ */ o(qe, { ...e, store: ce, side: e.side ?? "left" }), jt = (e) => ie((r) => r.panels).length === 0 ? null : /* @__PURE__ */ o(
93
- qe,
94
- {
95
- bottomItems: [],
96
- ...e,
97
- store: ie,
98
- side: e.side ?? "right",
99
- "aria-label": e["aria-label"] ?? "Inspector Bar"
100
- }
101
- ), Wt = ({
101
+ }, Jt = ({
102
102
  menus: e = {},
103
103
  onSelect: t,
104
104
  title: r,
@@ -106,7 +106,7 @@ const Ut = [
106
106
  right: s,
107
107
  className: i
108
108
  }) => {
109
- const a = (c) => c.keybinding ? /* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground opacity-60 ml-4", children: c.keybinding }) : null, u = (c) => /* @__PURE__ */ o(
109
+ const a = (c) => c.keybinding ? /* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground opacity-60 ml-4", children: c.keybinding }) : null, d = (c) => /* @__PURE__ */ o(
110
110
  "div",
111
111
  {
112
112
  role: "menu",
@@ -118,15 +118,15 @@ const Ut = [
118
118
  role: "menuitem",
119
119
  tabIndex: 0,
120
120
  onClick: () => !l.submenu && (t == null ? void 0 : t(l)),
121
- onKeyDown: (f) => {
122
- !l.submenu && (f.key === "Enter" || f.key === " ") && (f.preventDefault(), t == null || t(l));
121
+ onKeyDown: (p) => {
122
+ !l.submenu && (p.key === "Enter" || p.key === " ") && (p.preventDefault(), t == null || t(l));
123
123
  },
124
124
  className: "px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex justify-between items-center focus:outline-none focus:bg-accent",
125
125
  children: [
126
126
  /* @__PURE__ */ o("span", { children: l.label }),
127
127
  /* @__PURE__ */ x("div", { className: "flex items-center space-x-2", children: [
128
128
  a(l),
129
- l.submenu && /* @__PURE__ */ o(Be, { size: 10 })
129
+ l.submenu && /* @__PURE__ */ o(je, { size: 10 })
130
130
  ] })
131
131
  ]
132
132
  }
@@ -136,22 +136,22 @@ const Ut = [
136
136
  {
137
137
  role: "menu",
138
138
  className: "absolute left-full top-0 hidden group-hover/sub:block z-[60] min-w-[180px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 ml-[-2px]",
139
- children: l.submenu.map((f) => /* @__PURE__ */ x(
139
+ children: l.submenu.map((p) => /* @__PURE__ */ x(
140
140
  "div",
141
141
  {
142
142
  role: "menuitem",
143
143
  tabIndex: 0,
144
- onClick: () => t == null ? void 0 : t(f),
145
- onKeyDown: (d) => {
146
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), t == null || t(f));
144
+ onClick: () => t == null ? void 0 : t(p),
145
+ onKeyDown: (u) => {
146
+ (u.key === "Enter" || u.key === " ") && (u.preventDefault(), t == null || t(p));
147
147
  },
148
148
  className: "px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex justify-between items-center focus:outline-none focus:bg-accent",
149
149
  children: [
150
- /* @__PURE__ */ o("span", { children: f.label }),
151
- a(f)
150
+ /* @__PURE__ */ o("span", { children: p.label }),
151
+ a(p)
152
152
  ]
153
153
  },
154
- f.id
154
+ p.id
155
155
  ))
156
156
  }
157
157
  )
@@ -163,7 +163,7 @@ const Ut = [
163
163
  {
164
164
  role: "banner",
165
165
  "aria-label": "Application Header",
166
- className: I(
166
+ className: P(
167
167
  "bg-muted border-b flex items-center justify-between px-4 select-none shrink-0 transition-all z-50 relative",
168
168
  r !== void 0 ? "h-12 bg-card/65 backdrop-blur-sm" : "h-8",
169
169
  i
@@ -188,7 +188,7 @@ const Ut = [
188
188
  children: c
189
189
  }
190
190
  ),
191
- l.length > 0 && u(l)
191
+ l.length > 0 && d(l)
192
192
  ] }, c))
193
193
  }
194
194
  ),
@@ -199,7 +199,7 @@ const Ut = [
199
199
  }
200
200
  );
201
201
  };
202
- class Gt {
202
+ class Xt {
203
203
  constructor() {
204
204
  ee(this, "menus", /* @__PURE__ */ new Map());
205
205
  }
@@ -220,8 +220,8 @@ class Gt {
220
220
  }), t;
221
221
  }
222
222
  }
223
- const Se = new Gt();
224
- class Yt {
223
+ const Le = new Xt();
224
+ class qt {
225
225
  constructor() {
226
226
  ee(this, "commands", /* @__PURE__ */ new Map());
227
227
  }
@@ -243,57 +243,59 @@ class Yt {
243
243
  return Array.from(this.commands.values());
244
244
  }
245
245
  }
246
- const re = new Yt(), Ve = (e) => e.map((t) => {
246
+ const re = new qt(), Ze = (e) => e.map((t) => {
247
247
  var r;
248
248
  return {
249
249
  ...t,
250
250
  keybinding: t.keybinding ?? (t.commandId ? (r = re.getCommand(t.commandId)) == null ? void 0 : r.keybinding : void 0),
251
- submenu: t.submenu ? Ve(t.submenu) : void 0
251
+ submenu: t.submenu ? Ze(t.submenu) : void 0
252
252
  };
253
- }), Qe = (e, t) => {
253
+ }), et = (e, t) => {
254
254
  for (const r of e) {
255
255
  if (r.id === t) return r;
256
- const n = r.submenu && Qe(r.submenu, t);
256
+ const n = r.submenu && et(r.submenu, t);
257
257
  if (n) return n;
258
258
  }
259
- }, Jt = (e) => {
260
- const t = Se.getAllMenus(), r = Object.fromEntries(
261
- Object.entries(t).map(([s, i]) => [s, Ve(i)])
259
+ }, Vt = (e) => {
260
+ const t = Le.getAllMenus(), r = Object.fromEntries(
261
+ Object.entries(t).map(([s, i]) => [s, Ze(i)])
262
262
  );
263
- return /* @__PURE__ */ o(Wt, { ...e, menus: r, onSelect: (s) => {
263
+ return /* @__PURE__ */ o(Jt, { ...e, menus: r, onSelect: (s) => {
264
264
  for (const i of Object.values(t)) {
265
- const a = Qe(i, s.id);
265
+ const a = et(i, s.id);
266
266
  if (a != null && a.commandId) {
267
267
  re.executeCommand(a.commandId);
268
268
  return;
269
269
  }
270
270
  }
271
271
  } });
272
- }, Ze = bt(null), et = () => xt(Ze), tt = (e) => {
273
- const t = et();
272
+ }, tt = yt(null), rt = () => bt(tt), nt = (e) => {
273
+ const t = rt();
274
274
  return e !== void 0 ? e : !(t != null && t.chrome);
275
- }, rt = ({
275
+ }, ot = ({
276
276
  children: e,
277
277
  ...t
278
- }) => /* @__PURE__ */ o(Ze.Provider, { value: t, children: e }), be = ({
278
+ }) => /* @__PURE__ */ o(tt.Provider, { value: t, children: e }), Ce = ({
279
279
  title: e,
280
280
  children: t,
281
281
  onClose: r,
282
282
  width: n = "300px",
283
- side: s = "left",
284
- className: i
283
+ height: s = "240px",
284
+ side: i = "left",
285
+ className: a
285
286
  }) => /* @__PURE__ */ x(
286
287
  "aside",
287
288
  {
288
289
  role: "tabpanel",
289
290
  "aria-label": `${e} Panel`,
290
- "data-side": s,
291
- style: { width: n },
292
- className: I(
293
- "h-full bg-muted flex flex-col select-none shrink-0",
291
+ "data-side": i,
292
+ style: i === "bottom" ? { height: s } : { width: n },
293
+ className: P(
294
+ "bg-muted flex flex-col select-none shrink-0",
295
+ i === "bottom" ? "w-full" : "h-full",
294
296
  // The divider always faces the content it separates from.
295
- s === "right" ? "border-l" : "border-r",
296
- i
297
+ { left: "border-r", right: "border-l", bottom: "border-t" }[i],
298
+ a
297
299
  ),
298
300
  children: [
299
301
  /* @__PURE__ */ x("div", { className: "h-10 flex items-center justify-between px-4 text-[11px] font-bold text-muted-foreground uppercase tracking-widest", children: [
@@ -309,135 +311,41 @@ const re = new Yt(), Ve = (e) => e.map((t) => {
309
311
  }
310
312
  )
311
313
  ] }),
312
- /* @__PURE__ */ o("div", { className: "flex-1 min-h-0 overflow-auto border-t border-border/50 bg-background/50", children: /* @__PURE__ */ o(rt, { chrome: !0, placement: s, children: t }) })
314
+ /* @__PURE__ */ o("div", { className: "flex-1 min-h-0 overflow-auto border-t border-border/50 bg-background/50", children: /* @__PURE__ */ o(ot, { chrome: !0, placement: i, children: t }) })
313
315
  ]
314
316
  }
315
- ), ue = [
316
- {
317
- id: "light",
318
- label: "Light",
319
- shortLabel: "Light",
320
- description: "Neutral light theme. The default."
321
- },
322
- {
323
- id: "dark",
324
- label: "Dark",
325
- shortLabel: "Dark",
326
- description: "Low-glare dark theme on a soft grey base."
327
- },
328
- {
329
- id: "gt",
330
- label: "Georgia Tech",
331
- shortLabel: "GT",
332
- description: "Buzz Gold (#EAAA00) on Tech Tower White."
333
- },
334
- {
335
- id: "tamu",
336
- label: "Texas A&M",
337
- shortLabel: "TAMU",
338
- description: "Aggie Maroon (#500000) on white."
339
- }
340
- ], Xt = ue.map((e) => `theme-${e.id}`), qt = (e) => `theme-${e}`, Vt = {
341
- light: Tt,
342
- dark: Et,
343
- gt: Me,
344
- tamu: Me
345
- }, Qt = ue.map((e) => ({
346
- id: e.id,
347
- label: e.label,
348
- icon: Vt[e.id] ?? Dt
349
- })), Zt = ({
350
- theme: e,
351
- onThemeChange: t,
352
- themes: r = Qt,
353
- className: n
354
- }) => /* @__PURE__ */ o("div", { className: I("p-4 space-y-6", n), children: /* @__PURE__ */ x("section", { children: [
355
- /* @__PURE__ */ o("h3", { className: "text-[11px] font-bold text-muted-foreground uppercase mb-3", children: "Theme" }),
356
- /* @__PURE__ */ o(
357
- "div",
358
- {
359
- role: "radiogroup",
360
- "aria-label": "Theme",
361
- className: "grid grid-cols-1 gap-2",
362
- children: r.map(({ id: s, label: i, icon: a }) => /* @__PURE__ */ x(
363
- "button",
364
- {
365
- type: "button",
366
- role: "radio",
367
- "aria-checked": e === s,
368
- onClick: () => t(s),
369
- className: I(
370
- "flex items-center space-x-3 px-3 py-2 rounded-md border text-sm transition-all focus:outline-none focus:ring-2 focus:ring-ring",
371
- e === s ? "bg-primary text-primary-foreground border-primary" : "bg-background hover:bg-accent border-border"
372
- ),
373
- children: [
374
- /* @__PURE__ */ o(a, { size: 16 }),
375
- /* @__PURE__ */ o("span", { children: i })
376
- ]
377
- },
378
- s
379
- ))
380
- }
381
- )
382
- ] }) }), Ce = "nexus-shell-theme", Ae = (e) => {
383
- const t = window.document.documentElement, r = [
384
- ...Xt,
385
- ...Array.from(t.classList).filter((n) => n.startsWith("theme-"))
386
- ];
387
- t.classList.remove(...r), t.classList.add(qt(e));
388
- }, le = Q((e) => {
389
- const r = localStorage.getItem(Ce) || "light";
390
- return Ae(r), {
391
- theme: r,
392
- setTheme: (n) => {
393
- localStorage.setItem(Ce, n), Ae(n), e({ theme: n });
394
- }
395
- };
396
- }), nt = ({
397
- store: e,
398
- settings: t,
399
- ...r
400
- }) => {
401
- const n = e((d) => d.activeSidebar), s = e((d) => d.panels), i = e((d) => d.setActiveSidebar), a = le((d) => d.theme), u = le((d) => d.setTheme);
317
+ ), xe = ({ side: e = "left", ...t }) => {
318
+ const r = ce(e), n = r((l) => l.activePanel), s = r((l) => l.panels), i = r((l) => l.setActivePanel);
402
319
  if (!n) return null;
403
- const c = () => i(null);
404
- if (t && n === "settings")
405
- return /* @__PURE__ */ o(be, { ...r, title: "Settings", onClose: c, children: /* @__PURE__ */ o(
406
- Zt,
407
- {
408
- theme: a,
409
- onThemeChange: (d) => u(d)
410
- }
411
- ) });
412
- const l = s.find((d) => d.id === n);
413
- if (!l)
414
- return /* @__PURE__ */ o(be, { ...r, title: n, onClose: c, children: /* @__PURE__ */ o("div", { className: "p-4 text-sm italic text-muted-foreground", children: "Panel content not found." }) });
415
- const f = typeof l.component == "function" ? l.component : null;
416
- return /* @__PURE__ */ o(be, { ...r, title: l.label, onClose: c, children: f ? /* @__PURE__ */ o(f, {}) : l.component });
417
- }, er = (e) => /* @__PURE__ */ o(nt, { ...e, store: ce, settings: !0, side: e.side ?? "left" }), tr = (e) => /* @__PURE__ */ o(nt, { ...e, store: ie, side: e.side ?? "right" }), ye = (e, t) => (t.priority ?? 0) - (e.priority ?? 0), rr = ({
320
+ const a = () => i(null), d = s.find((l) => l.id === n);
321
+ if (!d)
322
+ return /* @__PURE__ */ o(Ce, { ...t, side: e, title: n, onClose: a, children: /* @__PURE__ */ o("div", { className: "p-4 text-sm italic text-muted-foreground", children: "Panel content not found." }) });
323
+ const c = typeof d.component == "function" ? d.component : null;
324
+ return /* @__PURE__ */ o(Ce, { ...t, side: e, title: d.label, onClose: a, children: c ? /* @__PURE__ */ o(c, {}) : d.component });
325
+ }, be = (e, t) => (t.priority ?? 0) - (e.priority ?? 0), Qt = ({
418
326
  widgets: e = [],
419
327
  className: t,
420
328
  "aria-label": r = "Status Bar"
421
329
  }) => {
422
330
  const n = {
423
- left: e.filter((i) => i.alignment === "left").sort(ye),
424
- center: e.filter((i) => i.alignment === "center").sort(ye),
425
- right: e.filter((i) => i.alignment === "right").sort(ye)
331
+ left: e.filter((i) => i.alignment === "left").sort(be),
332
+ center: e.filter((i) => i.alignment === "center").sort(be),
333
+ right: e.filter((i) => i.alignment === "right").sort(be)
426
334
  }, s = (i) => {
427
- const a = i.icon, u = !!i.onClick;
335
+ const a = i.icon, d = !!i.onClick;
428
336
  return /* @__PURE__ */ x(
429
337
  "div",
430
338
  {
431
339
  onClick: i.onClick,
432
- onKeyDown: u ? (c) => {
340
+ onKeyDown: d ? (c) => {
433
341
  var l;
434
342
  (c.key === "Enter" || c.key === " ") && (c.preventDefault(), (l = i.onClick) == null || l.call(i));
435
343
  } : void 0,
436
- role: u ? "button" : void 0,
437
- tabIndex: u ? 0 : void 0,
438
- className: I(
344
+ role: d ? "button" : void 0,
345
+ tabIndex: d ? 0 : void 0,
346
+ className: P(
439
347
  "flex items-center space-x-1.5 px-2 py-0.5 rounded transition-colors h-full focus:outline-none",
440
- u ? "cursor-pointer hover:bg-white/10 focus:ring-1 focus:ring-white" : "cursor-default",
348
+ d ? "cursor-pointer hover:bg-white/10 focus:ring-1 focus:ring-white" : "cursor-default",
441
349
  i.className
442
350
  ),
443
351
  children: [
@@ -453,7 +361,7 @@ const re = new Yt(), Ve = (e) => e.map((t) => {
453
361
  {
454
362
  role: "status",
455
363
  "aria-label": r,
456
- className: I(
364
+ className: P(
457
365
  "h-6 bg-primary text-primary-foreground text-[11px] flex items-center justify-between px-1 select-none shrink-0 border-t border-white/5",
458
366
  t
459
367
  ),
@@ -464,7 +372,7 @@ const re = new Yt(), Ve = (e) => e.map((t) => {
464
372
  ]
465
373
  }
466
374
  );
467
- }, Le = Q((e) => ({
375
+ }, Ie = Q((e) => ({
468
376
  widgets: [],
469
377
  setWidgets: (t) => e({ widgets: t }),
470
378
  addWidget: (t) => e((r) => ({
@@ -478,17 +386,17 @@ const re = new Yt(), Ve = (e) => e.map((t) => {
478
386
  updateWidget: (t, r) => e((n) => ({
479
387
  widgets: n.widgets.map((s) => s.id === t ? { ...s, ...r } : s)
480
388
  }))
481
- })), nr = (e) => {
482
- const t = Le((n) => n.widgets), r = B(
389
+ })), Zt = (e) => {
390
+ const t = Ie((n) => n.widgets), r = B(
483
391
  () => t.map(({ commandId: n, ...s }) => ({
484
392
  ...s,
485
393
  onClick: s.onClick ?? (n ? () => re.executeCommand(n) : void 0)
486
394
  })),
487
395
  [t]
488
396
  );
489
- return /* @__PURE__ */ o(rr, { ...e, widgets: r });
397
+ return /* @__PURE__ */ o(Qt, { ...e, widgets: r });
490
398
  };
491
- class or {
399
+ class er {
492
400
  constructor() {
493
401
  ee(this, "components", /* @__PURE__ */ new Map());
494
402
  }
@@ -512,14 +420,14 @@ class or {
512
420
  return Array.from(this.components.keys());
513
421
  }
514
422
  }
515
- const ot = new or();
516
- let sr = 0;
517
- const ar = () => `msg-${Date.now()}-${sr += 1}`, de = Q((e) => ({
423
+ const st = new er();
424
+ let tr = 0;
425
+ const rr = () => `msg-${Date.now()}-${tr += 1}`, le = Q((e) => ({
518
426
  messages: [],
519
427
  slashCommands: [],
520
428
  setMessages: (t) => e({ messages: t }),
521
429
  addMessage: (t) => e((r) => ({
522
- messages: [...r.messages, { ...t, id: t.id ?? ar() }]
430
+ messages: [...r.messages, { ...t, id: t.id ?? rr() }]
523
431
  })),
524
432
  clearMessages: () => e({ messages: [] }),
525
433
  setSlashCommands: (t) => e({ slashCommands: t }),
@@ -550,22 +458,22 @@ const ar = () => `msg-${Date.now()}-${sr += 1}`, de = Q((e) => ({
550
458
  }
551
459
  ]
552
460
  }
553
- }, Pe = "nexus-shell-layout", st = Q((e, t) => {
461
+ }, Ae = "nexus-shell-layout", at = Q((e, t) => {
554
462
  let r;
555
463
  if (typeof window < "u")
556
464
  try {
557
- const n = localStorage.getItem(Pe);
465
+ const n = localStorage.getItem(Ae);
558
466
  if (n) {
559
467
  const s = JSON.parse(n);
560
468
  r = G.fromJson(s);
561
469
  const i = /* @__PURE__ */ new Set(["dialogue-library", "argument-inspector"]), a = [];
562
- r.visitNodes((u) => {
563
- if (u.getType() === "tab") {
564
- const c = u;
470
+ r.visitNodes((d) => {
471
+ if (d.getType() === "tab") {
472
+ const c = d;
565
473
  i.has(c.getComponent()) && a.push(c.getId());
566
474
  }
567
- }), a.forEach((u) => {
568
- r.doAction(ae.deleteTab(u));
475
+ }), a.forEach((d) => {
476
+ r.doAction(ae.deleteTab(d));
569
477
  });
570
478
  } else
571
479
  r = G.fromJson(V);
@@ -577,7 +485,7 @@ const ar = () => `msg-${Date.now()}-${sr += 1}`, de = Q((e) => ({
577
485
  return {
578
486
  model: r,
579
487
  dirtyTabs: /* @__PURE__ */ new Set(),
580
- storageKey: Pe,
488
+ storageKey: Ae,
581
489
  disableLocalStorage: !1,
582
490
  initLayout: (n, s) => {
583
491
  let i;
@@ -622,65 +530,65 @@ const ar = () => `msg-${Date.now()}-${sr += 1}`, de = Q((e) => ({
622
530
  },
623
531
  isTabDirty: (n) => t().dirtyTabs.has(n),
624
532
  addTab: (n, s, i) => {
625
- const a = t().model, u = a.getActiveTabset();
626
- let c = u == null ? void 0 : u.getId();
533
+ const a = t().model, d = a.getActiveTabset();
534
+ let c = d == null ? void 0 : d.getId();
627
535
  if (!c)
628
536
  try {
629
- const d = a.getFirstTabSet();
630
- c = d == null ? void 0 : d.getId();
631
- } catch (d) {
632
- console.warn("Failed to get first tabset fallback", d);
537
+ const u = a.getFirstTabSet();
538
+ c = u == null ? void 0 : u.getId();
539
+ } catch (u) {
540
+ console.warn("Failed to get first tabset fallback", u);
633
541
  }
634
- const f = { ...{}, ...i };
542
+ const p = { ...{}, ...i };
635
543
  if (["nexus-dashboard", "nexus-docs"].includes(n)) {
636
- let d = null;
544
+ let u = null;
637
545
  if (a.visitNodes((m) => {
638
546
  if (m.getType() === "tab") {
639
- const w = m;
640
- w.getComponent() === n && (d = w.getId());
547
+ const v = m;
548
+ v.getComponent() === n && (u = v.getId());
641
549
  }
642
- }), d) {
643
- a.doAction(ae.selectTab(d));
550
+ }), u) {
551
+ a.doAction(ae.selectTab(u));
644
552
  return;
645
553
  }
646
554
  }
647
- if (f.mapId) {
648
- let d = null;
555
+ if (p.mapId) {
556
+ let u = null;
649
557
  if (a.visitNodes((m) => {
650
- var w;
558
+ var v;
651
559
  if (m.getType() === "tab") {
652
560
  const b = m;
653
- ((w = b.getConfig()) == null ? void 0 : w.mapId) === f.mapId && (d = b.getId());
561
+ ((v = b.getConfig()) == null ? void 0 : v.mapId) === p.mapId && (u = b.getId());
654
562
  }
655
- }), d) {
656
- a.doAction(ae.selectTab(d));
563
+ }), u) {
564
+ a.doAction(ae.selectTab(u));
657
565
  return;
658
566
  }
659
567
  }
660
- if (f.projectId) {
661
- let d = null;
568
+ if (p.projectId) {
569
+ let u = null;
662
570
  if (a.visitNodes((m) => {
663
- var w;
571
+ var v;
664
572
  if (m.getType() === "tab") {
665
573
  const b = m;
666
- ((w = b.getConfig()) == null ? void 0 : w.projectId) === f.projectId && (d = b.getId());
574
+ ((v = b.getConfig()) == null ? void 0 : v.projectId) === p.projectId && (u = b.getId());
667
575
  }
668
- }), d) {
669
- a.doAction(ae.selectTab(d));
576
+ }), u) {
577
+ a.doAction(ae.selectTab(u));
670
578
  return;
671
579
  }
672
580
  }
673
581
  c && a.doAction(
674
582
  ae.addNode(
675
- { type: "tab", component: n, name: s || n, config: f },
583
+ { type: "tab", component: n, name: s || n, config: p },
676
584
  c,
677
- wt.CENTER,
585
+ Nt.CENTER,
678
586
  -1
679
587
  )
680
588
  );
681
589
  }
682
590
  };
683
- }), at = Q((e, t) => ({
591
+ }), it = Q((e, t) => ({
684
592
  isOpen: !1,
685
593
  type: "alert",
686
594
  title: "",
@@ -700,120 +608,161 @@ const ar = () => `msg-${Date.now()}-${sr += 1}`, de = Q((e) => ({
700
608
  const { resolve: n } = t();
701
609
  n && n(r), e({ isOpen: !1, resolve: null });
702
610
  }
703
- })), hn = ({
611
+ })), de = [
612
+ {
613
+ id: "light",
614
+ label: "Light",
615
+ shortLabel: "Light",
616
+ description: "Neutral light theme. The default."
617
+ },
618
+ {
619
+ id: "dark",
620
+ label: "Dark",
621
+ shortLabel: "Dark",
622
+ description: "Low-glare dark theme on a soft grey base."
623
+ },
624
+ {
625
+ id: "gt",
626
+ label: "Georgia Tech",
627
+ shortLabel: "GT",
628
+ description: "Buzz Gold (#EAAA00) on Tech Tower White."
629
+ },
630
+ {
631
+ id: "tamu",
632
+ label: "Texas A&M",
633
+ shortLabel: "TAMU",
634
+ description: "Aggie Maroon (#500000) on white."
635
+ }
636
+ ], nr = de.map((e) => `theme-${e.id}`), or = (e) => `theme-${e}`, $e = "nexus-shell-theme", Re = (e) => {
637
+ const t = window.document.documentElement, r = [
638
+ ...nr,
639
+ ...Array.from(t.classList).filter((n) => n.startsWith("theme-"))
640
+ ];
641
+ t.classList.remove(...r), t.classList.add(or(e));
642
+ }, ie = Q((e) => {
643
+ const r = localStorage.getItem($e) || "light";
644
+ return Re(r), {
645
+ theme: r,
646
+ setTheme: (n) => {
647
+ localStorage.setItem($e, n), Re(n), e({ theme: n });
648
+ }
649
+ };
650
+ }), xn = ({
704
651
  panels: e,
705
- inspectorPanels: t,
706
- slashCommands: r,
707
- menuConfig: n,
708
- statusBarConfig: s,
709
- title: i,
710
- rightMenuBarContent: a,
711
- centerMenuBarContent: u,
712
- layoutModel: c,
713
- initialLayoutJson: l,
714
- disableLocalStorage: f = !1,
715
- onLayoutChange: d
652
+ slashCommands: t,
653
+ menuConfig: r,
654
+ statusBarConfig: n,
655
+ title: s,
656
+ rightMenuBarContent: i,
657
+ centerMenuBarContent: a,
658
+ layoutModel: d,
659
+ initialLayoutJson: c,
660
+ disableLocalStorage: l = !1,
661
+ onLayoutChange: p
716
662
  }) => {
717
- const { model: m, setModel: w, initLayout: b, isTabDirty: p, setTabDirty: h } = st(), y = le((k) => k.theme), E = ce((k) => k.setPanels), v = ie((k) => k.setPanels), N = de((k) => k.setSlashCommands), C = Le((k) => k.setWidgets);
718
- R(() => {
719
- e && E(e);
720
- }, [e, E]), R(() => {
721
- t && v(t);
722
- }, [t, v]), R(() => {
723
- r && N(r);
724
- }, [r, N]), R(() => {
725
- n && Se.setMenus(n);
726
- }, [n]), R(() => {
727
- s && C(s);
728
- }, [s, C]), R(() => {
729
- c || !l && !f || b(l, f);
663
+ const { model: u, setModel: m, initLayout: v, isTabDirty: b, setTabDirty: f } = at(), h = ie((L) => L.theme), y = le((L) => L.setSlashCommands), k = Ie((L) => L.setWidgets);
664
+ F(() => {
665
+ e && Qe(e);
666
+ }, [e]), F(() => {
667
+ t && y(t);
668
+ }, [t, y]), F(() => {
669
+ r && Le.setMenus(r);
670
+ }, [r]), F(() => {
671
+ n && k(n);
672
+ }, [n, k]), F(() => {
673
+ d || !c && !l || v(c, l);
730
674
  }, []);
731
- const L = (k) => {
675
+ const w = (L) => {
732
676
  try {
733
- const S = k.getComponent(), g = k.getConfig() || {}, T = S ? ot.get(S) : void 0;
734
- return T ? (
677
+ const T = L.getComponent(), M = L.getConfig() || {}, I = T ? st.get(T) : void 0;
678
+ return I ? (
735
679
  // The tab strip is the title bar, so a component that draws its own
736
680
  // — chat, terminal — omits it here.
737
- /* @__PURE__ */ o(rt, { chrome: !0, placement: "tab", children: /* @__PURE__ */ o(T, { node: k, ...g }) })
681
+ /* @__PURE__ */ o(ot, { chrome: !0, placement: "tab", children: /* @__PURE__ */ o(I, { node: L, ...M }) })
738
682
  ) : /* @__PURE__ */ x("div", { className: "p-4 text-sm", children: [
739
683
  "Unknown Component: ",
740
- S
684
+ T
741
685
  ] });
742
- } catch (S) {
743
- return console.error("Error in component factory:", S), /* @__PURE__ */ x("div", { className: "p-8 text-destructive bg-destructive/10 border border-destructive/20 h-full flex items-center justify-center", children: [
686
+ } catch (T) {
687
+ return console.error("Error in component factory:", T), /* @__PURE__ */ x("div", { className: "p-8 text-destructive bg-destructive/10 border border-destructive/20 h-full flex items-center justify-center", children: [
744
688
  "Error rendering component: ",
745
- S instanceof Error ? S.message : "Unknown error"
689
+ T instanceof Error ? T.message : "Unknown error"
746
690
  ] });
747
691
  }
748
- }, A = (k) => {
749
- if (k.type !== ae.DELETE_TAB) return k;
750
- const S = m.getNodeById(k.data.node);
751
- if (!S || !p(S.getId())) return k;
752
- at.getState().openConfirm(
753
- `Tab "${S.getName()}" has unsaved changes. Are you sure you want to close it?`
754
- ).then((g) => {
755
- g && (h(S.getId(), !1), m.doAction(k));
692
+ }, N = (L) => {
693
+ if (L.type !== ae.DELETE_TAB) return L;
694
+ const T = u.getNodeById(L.data.node);
695
+ if (!T || !b(T.getId())) return L;
696
+ it.getState().openConfirm(
697
+ `Tab "${T.getName()}" has unsaved changes. Are you sure you want to close it?`
698
+ ).then((M) => {
699
+ M && (f(T.getId(), !1), u.doAction(L));
756
700
  });
757
701
  };
758
702
  return /* @__PURE__ */ x(
759
703
  "div",
760
704
  {
761
- className: `flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${y}`,
705
+ className: `flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${h}`,
762
706
  children: [
763
707
  /* @__PURE__ */ o(
764
- Jt,
708
+ Vt,
765
709
  {
766
- title: i,
767
- center: u,
768
- right: a
710
+ title: s,
711
+ center: a,
712
+ right: i
769
713
  }
770
714
  ),
771
715
  /* @__PURE__ */ x("div", { className: "flex-1 flex overflow-hidden", children: [
772
- /* @__PURE__ */ o(Ht, {}),
773
- /* @__PURE__ */ o(er, {}),
774
- /* @__PURE__ */ o("div", { className: "flex-1 flex flex-col min-w-0 bg-card", children: /* @__PURE__ */ o("div", { className: "flex-1 relative h-full w-full", children: /* @__PURE__ */ o(
775
- Nt,
776
- {
777
- model: c || m,
778
- factory: L,
779
- onModelChange: (k) => {
780
- c || w(k), d == null || d(k.toJson());
781
- },
782
- onAction: A
783
- }
784
- ) }) }),
785
- /* @__PURE__ */ o(tr, {}),
786
- /* @__PURE__ */ o(jt, {})
716
+ /* @__PURE__ */ o(Me, { side: "left" }),
717
+ /* @__PURE__ */ o(xe, { side: "left" }),
718
+ /* @__PURE__ */ x("div", { className: "flex-1 flex flex-col min-w-0 bg-card", children: [
719
+ /* @__PURE__ */ o("div", { className: "flex-1 relative h-full w-full", children: /* @__PURE__ */ o(
720
+ kt,
721
+ {
722
+ model: d || u,
723
+ factory: w,
724
+ onModelChange: (L) => {
725
+ d || m(L), p == null || p(L.toJson());
726
+ },
727
+ onAction: N
728
+ }
729
+ ) }),
730
+ /* @__PURE__ */ o(xe, { side: "bottom" })
731
+ ] }),
732
+ /* @__PURE__ */ o(xe, { side: "right" }),
733
+ /* @__PURE__ */ o(Me, { side: "right" })
787
734
  ] }),
788
- /* @__PURE__ */ o(nr, {})
735
+ /* @__PURE__ */ o(Zt, {})
789
736
  ]
790
737
  }
791
738
  );
792
- }, it = ue.map((e) => ({
739
+ }, lt = de.map((e) => ({
793
740
  id: `theme.${e.id}`,
794
741
  label: `Preferences: ${e.label} Theme`,
795
- execute: () => le.getState().setTheme(e.id)
796
- })), gn = [
742
+ execute: () => ie.getState().setTheme(e.id)
743
+ })), bn = [
797
744
  "view.toggleTerminal",
798
745
  "view.toggleChat",
799
746
  "view.toggleSidebar",
800
- ...it.map((e) => e.id)
801
- ], $e = (e) => {
802
- for (const t of [ce, ie])
803
- if (t.getState().panels.some((r) => r.id === e))
804
- return t.getState().toggleSidebar(e), !0;
805
- return ot.get(e) ? (st.getState().addTab(e), !0) : !1;
806
- }, ir = [
747
+ ...lt.map((e) => e.id)
748
+ ], Fe = (e) => {
749
+ for (const t of Ve) {
750
+ const r = ce(t);
751
+ if (r.getState().panels.some((n) => n.id === e))
752
+ return r.getState().togglePanel(e), !0;
753
+ }
754
+ return st.get(e) ? (at.getState().addTab(e), !0) : !1;
755
+ }, sr = [
807
756
  {
808
757
  id: "view.toggleTerminal",
809
758
  label: "View: Toggle Terminal",
810
759
  keybinding: "Control+`",
811
- execute: () => $e(Je)
760
+ execute: () => Fe(qe)
812
761
  },
813
762
  {
814
763
  id: "view.toggleChat",
815
764
  label: "View: Toggle Chat",
816
- execute: () => $e(Ye)
765
+ execute: () => Fe(Xe)
817
766
  },
818
767
  {
819
768
  id: "view.toggleSidebar",
@@ -821,12 +770,12 @@ const ar = () => `msg-${Date.now()}-${sr += 1}`, de = Q((e) => ({
821
770
  keybinding: "Control+b",
822
771
  execute: () => {
823
772
  var n;
824
- const { activeSidebar: e, panels: t, setActiveSidebar: r } = ce.getState();
773
+ const { activePanel: e, panels: t, setActivePanel: r } = ce("left").getState();
825
774
  r(e ? null : ((n = t[0]) == null ? void 0 : n.id) ?? null);
826
775
  }
827
776
  },
828
- ...it
829
- ], lr = {
777
+ ...lt
778
+ ], ar = {
830
779
  View: [
831
780
  { id: "view.terminal", label: "Toggle Terminal", commandId: "view.toggleTerminal" },
832
781
  { id: "view.chat", label: "Toggle Chat", commandId: "view.toggleChat" },
@@ -834,32 +783,31 @@ const ar = () => `msg-${Date.now()}-${sr += 1}`, de = Q((e) => ({
834
783
  {
835
784
  id: "view.theme",
836
785
  label: "Theme",
837
- submenu: ue.map((e) => ({
786
+ submenu: de.map((e) => ({
838
787
  id: `view.theme.${e.id}`,
839
788
  label: e.label,
840
789
  commandId: `theme.${e.id}`
841
790
  }))
842
791
  }
843
792
  ]
844
- }, xn = (e = {}) => {
793
+ }, yn = (e = {}) => {
845
794
  const {
846
795
  panels: t,
847
- inspectorPanels: r,
848
- menus: n,
849
- commands: s,
850
- statusBar: i,
851
- slashCommands: a,
852
- defaultCommands: u = !0,
853
- defaultMenus: c = !0
796
+ menus: r,
797
+ commands: n,
798
+ statusBar: s,
799
+ slashCommands: i,
800
+ defaultCommands: a = !0,
801
+ defaultMenus: d = !0
854
802
  } = e;
855
- u && ir.forEach((f) => re.registerCommand(f)), s == null || s.forEach((f) => re.registerCommand(f));
856
- const l = {
857
- ...u && c ? lr : {},
858
- ...n ?? {}
803
+ a && sr.forEach((l) => re.registerCommand(l)), n == null || n.forEach((l) => re.registerCommand(l));
804
+ const c = {
805
+ ...a && d ? ar : {},
806
+ ...r ?? {}
859
807
  };
860
- Object.keys(l).length > 0 && Se.setMenus(l), t && ce.getState().setPanels(t), r && ie.getState().setPanels(r), i && Le.getState().setWidgets(i), a && de.getState().setSlashCommands(a);
808
+ Object.keys(c).length > 0 && Le.setMenus(c), t && Qe(t), s && Ie.getState().setWidgets(s), i && le.getState().setSlashCommands(i);
861
809
  };
862
- class cr {
810
+ class ir {
863
811
  constructor() {
864
812
  ee(this, "plugins", /* @__PURE__ */ new Map());
865
813
  ee(this, "loaders", /* @__PURE__ */ new Map());
@@ -922,25 +870,25 @@ class cr {
922
870
  return Array.from(this.plugins.values());
923
871
  }
924
872
  }
925
- const bn = new cr(), ve = Q((e) => ({
873
+ const vn = new ir(), ye = Q((e) => ({
926
874
  history: [
927
875
  "Welcome to Nexus Shell Terminal v0.1.0",
928
876
  'Type "help" for a list of commands.'
929
877
  ],
930
878
  addHistory: (t) => e((r) => ({ history: [...r.history, t] })),
931
879
  clearHistory: () => e({ history: [] })
932
- })), Re = "nexus-shell-user-profile", Fe = {
880
+ })), ze = "nexus-shell-user-profile", Oe = {
933
881
  name: "David Tech",
934
882
  role: "Shell Architect",
935
883
  email: "david@techmuch.io",
936
884
  avatarUrl: "",
937
885
  customAvatar: ""
938
886
  }, te = Q((e) => {
939
- let t = { ...Fe };
887
+ let t = { ...Oe };
940
888
  if (typeof window < "u")
941
889
  try {
942
- const n = localStorage.getItem(Re);
943
- n && (t = { ...Fe, ...JSON.parse(n) });
890
+ const n = localStorage.getItem(ze);
891
+ n && (t = { ...Oe, ...JSON.parse(n) });
944
892
  } catch (n) {
945
893
  console.error("Failed to parse saved user profile:", n);
946
894
  }
@@ -948,7 +896,7 @@ const bn = new cr(), ve = Q((e) => ({
948
896
  if (typeof window < "u")
949
897
  try {
950
898
  localStorage.setItem(
951
- Re,
899
+ ze,
952
900
  JSON.stringify({
953
901
  name: n.name,
954
902
  role: n.role,
@@ -976,12 +924,12 @@ const bn = new cr(), ve = Q((e) => ({
976
924
  return r(s), { customAvatar: "" };
977
925
  })
978
926
  };
979
- }), yn = () => {
980
- R(() => {
927
+ }), wn = () => {
928
+ F(() => {
981
929
  const e = (t) => {
982
930
  const r = re.getCommands();
983
931
  for (const n of r)
984
- if (n.keybinding && dr(t, n.keybinding)) {
932
+ if (n.keybinding && lr(t, n.keybinding)) {
985
933
  t.preventDefault(), n.execute();
986
934
  break;
987
935
  }
@@ -989,20 +937,20 @@ const bn = new cr(), ve = Q((e) => ({
989
937
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
990
938
  }, []);
991
939
  };
992
- function dr(e, t) {
940
+ function lr(e, t) {
993
941
  var m;
994
- const r = t.split("+"), n = (m = r.pop()) == null ? void 0 : m.toLowerCase(), s = r.includes("Control") || r.includes("Ctrl"), i = r.includes("Shift"), a = r.includes("Alt"), u = r.includes("Meta") || r.includes("Cmd"), c = e.ctrlKey, l = e.shiftKey, f = e.altKey, d = e.metaKey;
995
- return e.key.toLowerCase() === n && c === s && l === i && f === a && d === u;
942
+ const r = t.split("+"), n = (m = r.pop()) == null ? void 0 : m.toLowerCase(), s = r.includes("Control") || r.includes("Ctrl"), i = r.includes("Shift"), a = r.includes("Alt"), d = r.includes("Meta") || r.includes("Cmd"), c = e.ctrlKey, l = e.shiftKey, p = e.altKey, u = e.metaKey;
943
+ return e.key.toLowerCase() === n && c === s && l === i && p === a && u === d;
996
944
  }
997
- const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-center justify-center text-center px-6 text-muted-foreground", children: [
998
- /* @__PURE__ */ o(Te, { size: 28, className: "mb-3 opacity-40" }),
945
+ const cr = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-center justify-center text-center px-6 text-muted-foreground", children: [
946
+ /* @__PURE__ */ o(Ee, { size: 28, className: "mb-3 opacity-40" }),
999
947
  /* @__PURE__ */ o("p", { className: "text-xs", children: "No messages yet." }),
1000
948
  /* @__PURE__ */ x("p", { className: "text-[11px] mt-1 opacity-70", children: [
1001
949
  "Type a message, or ",
1002
950
  /* @__PURE__ */ o("span", { className: "font-mono", children: "/" }),
1003
951
  " for commands."
1004
952
  ] })
1005
- ] }), mr = ({
953
+ ] }), dr = ({
1006
954
  messages: e = [],
1007
955
  onSend: t,
1008
956
  slashCommands: r = [],
@@ -1010,47 +958,47 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1010
958
  onClose: s,
1011
959
  title: i = "Chat",
1012
960
  placeholder: a = "Send a message…",
1013
- emptyState: u = ur,
961
+ emptyState: d = cr,
1014
962
  chrome: c,
1015
963
  className: l
1016
964
  }) => {
1017
- const f = tt(c), [d, m] = P(""), [w, b] = P(0), p = _(null), h = _(null), y = d.startsWith("/") ? r.filter(
1018
- (L) => `/${L.command}`.startsWith(d.toLowerCase().split(" ")[0])
1019
- ) : [], E = y.length > 0;
1020
- R(() => {
965
+ const p = nt(c), [u, m] = A(""), [v, b] = A(0), f = _(null), h = _(null), y = u.startsWith("/") ? r.filter(
966
+ (T) => `/${T.command}`.startsWith(u.toLowerCase().split(" ")[0])
967
+ ) : [], k = y.length > 0;
968
+ F(() => {
1021
969
  h.current && (h.current.scrollTop = h.current.scrollHeight);
1022
- }, [e]), R(() => {
970
+ }, [e]), F(() => {
1023
971
  b(0);
1024
- }, [d]);
1025
- const v = () => {
1026
- const L = d.trim();
1027
- L && (t == null || t(L), m(""));
1028
- }, N = (L) => {
1029
- var A;
1030
- n == null || n(L), m(`/${L.command} `), (A = p.current) == null || A.focus();
1031
- }, C = (L) => {
1032
- if (E) {
1033
- if (L.key === "ArrowDown") {
1034
- L.preventDefault(), b((A) => (A + 1) % y.length);
972
+ }, [u]);
973
+ const w = () => {
974
+ const T = u.trim();
975
+ T && (t == null || t(T), m(""));
976
+ }, N = (T) => {
977
+ var M;
978
+ n == null || n(T), m(`/${T.command} `), (M = f.current) == null || M.focus();
979
+ }, L = (T) => {
980
+ if (k) {
981
+ if (T.key === "ArrowDown") {
982
+ T.preventDefault(), b((M) => (M + 1) % y.length);
1035
983
  return;
1036
984
  }
1037
- if (L.key === "ArrowUp") {
1038
- L.preventDefault(), b((A) => (A - 1 + y.length) % y.length);
985
+ if (T.key === "ArrowUp") {
986
+ T.preventDefault(), b((M) => (M - 1 + y.length) % y.length);
1039
987
  return;
1040
988
  }
1041
- if (L.key === "Tab" || L.key === "Enter" && !L.shiftKey) {
1042
- L.preventDefault(), N(y[w]);
989
+ if (T.key === "Tab" || T.key === "Enter" && !T.shiftKey) {
990
+ T.preventDefault(), N(y[v]);
1043
991
  return;
1044
992
  }
1045
993
  }
1046
- L.key === "Enter" && !L.shiftKey && (L.preventDefault(), v());
994
+ T.key === "Enter" && !T.shiftKey && (T.preventDefault(), w());
1047
995
  };
1048
996
  return /* @__PURE__ */ x(
1049
997
  "aside",
1050
998
  {
1051
999
  role: "complementary",
1052
1000
  "aria-label": i,
1053
- className: I(
1001
+ className: P(
1054
1002
  // Fills whatever hosts it — a side pane, a dockable tab, your own box.
1055
1003
  // It used to hardcode `w-[320px] border-l`, which is why it could only
1056
1004
  // ever live in one place.
@@ -1058,9 +1006,9 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1058
1006
  l
1059
1007
  ),
1060
1008
  children: [
1061
- f && /* @__PURE__ */ x("div", { className: "h-10 flex items-center justify-between px-4 shrink-0", children: [
1009
+ p && /* @__PURE__ */ x("div", { className: "h-10 flex items-center justify-between px-4 shrink-0", children: [
1062
1010
  /* @__PURE__ */ x("div", { className: "flex items-center space-x-2 text-muted-foreground", children: [
1063
- /* @__PURE__ */ o(Te, { size: 13 }),
1011
+ /* @__PURE__ */ o(Ee, { size: 13 }),
1064
1012
  /* @__PURE__ */ o("span", { className: "text-[11px] font-bold uppercase tracking-widest", children: i })
1065
1013
  ] }),
1066
1014
  s && /* @__PURE__ */ o(
@@ -1081,61 +1029,61 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1081
1029
  role: "log",
1082
1030
  "aria-label": `${i} transcript`,
1083
1031
  className: "flex-1 overflow-y-auto border-t border-border/50 bg-background/50 px-3 py-3 space-y-3",
1084
- children: e.length === 0 ? u : e.map((L) => {
1085
- const A = L.role === "user";
1032
+ children: e.length === 0 ? d : e.map((T) => {
1033
+ const M = T.role === "user";
1086
1034
  return /* @__PURE__ */ x(
1087
1035
  "div",
1088
1036
  {
1089
- className: I("flex flex-col", A ? "items-end" : "items-start"),
1037
+ className: P("flex flex-col", M ? "items-end" : "items-start"),
1090
1038
  children: [
1091
1039
  /* @__PURE__ */ x("div", { className: "flex items-center space-x-1 mb-1 text-[10px] uppercase tracking-wider text-muted-foreground font-bold", children: [
1092
- A ? /* @__PURE__ */ o(He, { size: 10 }) : /* @__PURE__ */ o(De, { size: 10 }),
1093
- /* @__PURE__ */ o("span", { children: L.author ?? (A ? "You" : "Assistant") })
1040
+ M ? /* @__PURE__ */ o(We, { size: 10 }) : /* @__PURE__ */ o(Te, { size: 10 }),
1041
+ /* @__PURE__ */ o("span", { children: T.author ?? (M ? "You" : "Assistant") })
1094
1042
  ] }),
1095
1043
  /* @__PURE__ */ o(
1096
1044
  "div",
1097
1045
  {
1098
- className: I(
1046
+ className: P(
1099
1047
  "max-w-[85%] rounded-lg px-3 py-2 text-xs whitespace-pre-wrap break-words",
1100
- A ? "bg-primary text-primary-foreground" : "bg-card border border-border text-foreground"
1048
+ M ? "bg-primary text-primary-foreground" : "bg-card border border-border text-foreground"
1101
1049
  ),
1102
- children: L.text
1050
+ children: T.text
1103
1051
  }
1104
1052
  )
1105
1053
  ]
1106
1054
  },
1107
- L.id
1055
+ T.id
1108
1056
  );
1109
1057
  })
1110
1058
  }
1111
1059
  ),
1112
1060
  /* @__PURE__ */ x("div", { className: "relative border-t border-border/50 p-2 shrink-0", children: [
1113
- E && /* @__PURE__ */ o(
1061
+ k && /* @__PURE__ */ o(
1114
1062
  "div",
1115
1063
  {
1116
1064
  role: "listbox",
1117
1065
  "aria-label": "Slash commands",
1118
1066
  className: "absolute bottom-full left-2 right-2 mb-1 bg-popover border border-border rounded-md shadow-lg overflow-hidden z-20",
1119
- children: y.map((L, A) => /* @__PURE__ */ x(
1067
+ children: y.map((T, M) => /* @__PURE__ */ x(
1120
1068
  "div",
1121
1069
  {
1122
1070
  role: "option",
1123
- "aria-selected": A === w,
1124
- onMouseEnter: () => b(A),
1125
- onClick: () => N(L),
1126
- className: I(
1071
+ "aria-selected": M === v,
1072
+ onMouseEnter: () => b(M),
1073
+ onClick: () => N(T),
1074
+ className: P(
1127
1075
  "px-3 py-1.5 text-xs cursor-pointer flex items-baseline justify-between gap-3",
1128
- A === w ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
1076
+ M === v ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
1129
1077
  ),
1130
1078
  children: [
1131
1079
  /* @__PURE__ */ x("span", { className: "font-mono", children: [
1132
1080
  "/",
1133
- L.command
1081
+ T.command
1134
1082
  ] }),
1135
- /* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground truncate", children: L.description })
1083
+ /* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground truncate", children: T.description })
1136
1084
  ]
1137
1085
  },
1138
- L.command
1086
+ T.command
1139
1087
  ))
1140
1088
  }
1141
1089
  ),
@@ -1143,13 +1091,13 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1143
1091
  /* @__PURE__ */ o(
1144
1092
  "textarea",
1145
1093
  {
1146
- ref: p,
1094
+ ref: f,
1147
1095
  rows: 1,
1148
- value: d,
1096
+ value: u,
1149
1097
  "aria-label": `${i} message`,
1150
1098
  placeholder: a,
1151
- onChange: (L) => m(L.target.value),
1152
- onKeyDown: C,
1099
+ onChange: (T) => m(T.target.value),
1100
+ onKeyDown: L,
1153
1101
  className: "flex-1 resize-none bg-background border border-border rounded-md px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50 max-h-32"
1154
1102
  }
1155
1103
  ),
@@ -1157,11 +1105,11 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1157
1105
  "button",
1158
1106
  {
1159
1107
  type: "button",
1160
- onClick: v,
1161
- disabled: !d.trim(),
1108
+ onClick: w,
1109
+ disabled: !u.trim(),
1162
1110
  "aria-label": "Send message",
1163
1111
  className: "p-2 rounded-md bg-primary text-primary-foreground disabled:opacity-40 disabled:cursor-not-allowed hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
1164
- children: /* @__PURE__ */ o(St, { size: 14 })
1112
+ children: /* @__PURE__ */ o(Dt, { size: 14 })
1165
1113
  }
1166
1114
  )
1167
1115
  ] })
@@ -1169,29 +1117,81 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1169
1117
  ]
1170
1118
  }
1171
1119
  );
1172
- }, fr = ({ onSend: e, ...t }) => {
1173
- const r = de((a) => a.messages), n = de((a) => a.slashCommands), s = de((a) => a.addMessage);
1120
+ }, ur = ({ onSend: e, ...t }) => {
1121
+ const r = le((a) => a.messages), n = le((a) => a.slashCommands), s = le((a) => a.addMessage);
1174
1122
  return /* @__PURE__ */ o(
1175
- mr,
1123
+ dr,
1176
1124
  {
1177
1125
  ...t,
1178
1126
  messages: r,
1179
1127
  slashCommands: n,
1180
1128
  onSend: (a) => {
1181
1129
  if (s({ role: "user", text: a }), a.startsWith("/")) {
1182
- const [u, ...c] = a.slice(1).split(/\s+/), l = n.find((f) => f.command === u);
1130
+ const [d, ...c] = a.slice(1).split(/\s+/), l = n.find((p) => p.command === d);
1183
1131
  if (l) {
1184
1132
  l.execute(c);
1185
1133
  return;
1186
1134
  }
1187
- s({ role: "assistant", text: `Unknown command: /${u}` });
1135
+ s({ role: "assistant", text: `Unknown command: /${d}` });
1188
1136
  return;
1189
1137
  }
1190
1138
  e == null || e(a);
1191
1139
  }
1192
1140
  }
1193
1141
  );
1194
- }, pr = ({
1142
+ }, mr = {
1143
+ light: It,
1144
+ dark: Lt,
1145
+ gt: Se,
1146
+ tamu: Se
1147
+ }, fr = de.map((e) => ({
1148
+ id: e.id,
1149
+ label: e.label,
1150
+ icon: mr[e.id] ?? Pt
1151
+ })), pr = ({
1152
+ theme: e,
1153
+ onThemeChange: t,
1154
+ themes: r = fr,
1155
+ className: n
1156
+ }) => /* @__PURE__ */ o("div", { className: P("p-4 space-y-6", n), children: /* @__PURE__ */ x("section", { children: [
1157
+ /* @__PURE__ */ o("h3", { className: "text-[11px] font-bold text-muted-foreground uppercase mb-3", children: "Theme" }),
1158
+ /* @__PURE__ */ o(
1159
+ "div",
1160
+ {
1161
+ role: "radiogroup",
1162
+ "aria-label": "Theme",
1163
+ className: "grid grid-cols-1 gap-2",
1164
+ children: r.map(({ id: s, label: i, icon: a }) => /* @__PURE__ */ x(
1165
+ "button",
1166
+ {
1167
+ type: "button",
1168
+ role: "radio",
1169
+ "aria-checked": e === s,
1170
+ onClick: () => t(s),
1171
+ className: P(
1172
+ "flex items-center space-x-3 px-3 py-2 rounded-md border text-sm transition-all focus:outline-none focus:ring-2 focus:ring-ring",
1173
+ e === s ? "bg-primary text-primary-foreground border-primary" : "bg-background hover:bg-accent border-border"
1174
+ ),
1175
+ children: [
1176
+ /* @__PURE__ */ o(a, { size: 16 }),
1177
+ /* @__PURE__ */ o("span", { children: i })
1178
+ ]
1179
+ },
1180
+ s
1181
+ ))
1182
+ }
1183
+ )
1184
+ ] }) }), hr = (e) => {
1185
+ const t = ie((n) => n.theme), r = ie((n) => n.setTheme);
1186
+ return /* @__PURE__ */ o(
1187
+ pr,
1188
+ {
1189
+ ...e,
1190
+ theme: t,
1191
+ onThemeChange: (n) => r(n)
1192
+ }
1193
+ );
1194
+ }, gr = ({
1195
1195
  history: e = [],
1196
1196
  onCommand: t,
1197
1197
  onClose: r,
@@ -1199,32 +1199,32 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1199
1199
  prompt: s = "$",
1200
1200
  title: i = "Terminal",
1201
1201
  chrome: a,
1202
- className: u
1202
+ className: d
1203
1203
  }) => {
1204
- const c = et(), l = tt(a), f = n ?? (c ? void 0 : "250px"), [d, m] = P(""), w = _(null), b = _(null);
1205
- R(() => {
1206
- w.current && (w.current.scrollTop = w.current.scrollHeight);
1204
+ const c = rt(), l = nt(a), p = n ?? (c ? void 0 : "250px"), [u, m] = A(""), v = _(null), b = _(null);
1205
+ F(() => {
1206
+ v.current && (v.current.scrollTop = v.current.scrollHeight);
1207
1207
  }, [e]);
1208
- const p = (h) => {
1208
+ const f = (h) => {
1209
1209
  if (h.key !== "Enter") return;
1210
- const y = d.trim();
1210
+ const y = u.trim();
1211
1211
  y && (t == null || t(y), m(""));
1212
1212
  };
1213
1213
  return /* @__PURE__ */ x(
1214
1214
  "div",
1215
1215
  {
1216
- style: { height: f },
1217
- className: I(
1216
+ style: { height: p },
1217
+ className: P(
1218
1218
  "bg-card flex flex-col font-mono text-xs",
1219
1219
  // Standalone it is a bottom-docked strip with its own top edge; hosted
1220
1220
  // it fills, and the host owns the edges.
1221
1221
  c ? "h-full w-full min-h-0" : "border-t border-border shrink-0",
1222
- u
1222
+ d
1223
1223
  ),
1224
1224
  children: [
1225
1225
  l && /* @__PURE__ */ x("div", { className: "h-8 flex items-center justify-between px-3 border-b border-border/50 shrink-0", children: [
1226
1226
  /* @__PURE__ */ x("div", { className: "flex items-center space-x-2 text-muted-foreground", children: [
1227
- /* @__PURE__ */ o(De, { size: 13 }),
1227
+ /* @__PURE__ */ o(Te, { size: 13 }),
1228
1228
  /* @__PURE__ */ o("span", { className: "text-[11px] font-bold uppercase tracking-widest", children: i })
1229
1229
  ] }),
1230
1230
  r && /* @__PURE__ */ x("div", { className: "flex items-center space-x-1", children: [
@@ -1235,7 +1235,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1235
1235
  onClick: r,
1236
1236
  "aria-label": "Collapse Terminal",
1237
1237
  className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
1238
- children: /* @__PURE__ */ o(je, { size: 14 })
1238
+ children: /* @__PURE__ */ o(Ge, { size: 14 })
1239
1239
  }
1240
1240
  ),
1241
1241
  /* @__PURE__ */ o(
@@ -1253,7 +1253,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1253
1253
  /* @__PURE__ */ o(
1254
1254
  "div",
1255
1255
  {
1256
- ref: w,
1256
+ ref: v,
1257
1257
  role: "log",
1258
1258
  "aria-label": `${i} output`,
1259
1259
  className: "flex-1 overflow-y-auto px-3 py-2 space-y-0.5",
@@ -1272,9 +1272,9 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1272
1272
  ref: b,
1273
1273
  type: "text",
1274
1274
  "aria-label": `${i} input`,
1275
- value: d,
1275
+ value: u,
1276
1276
  onChange: (h) => m(h.target.value),
1277
- onKeyDown: p,
1277
+ onKeyDown: f,
1278
1278
  spellCheck: !1,
1279
1279
  autoComplete: "off",
1280
1280
  className: "flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground"
@@ -1284,80 +1284,87 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1284
1284
  ]
1285
1285
  }
1286
1286
  );
1287
- }, hr = [
1287
+ }, xr = [
1288
1288
  "Available commands:",
1289
1289
  " help — show this message",
1290
1290
  " clear — clear the terminal"
1291
- ], gr = ({
1291
+ ], br = ({
1292
1292
  onCommand: e,
1293
1293
  ...t
1294
1294
  }) => {
1295
- const r = ve((a) => a.history), n = ve((a) => a.addHistory), s = ve((a) => a.clearHistory);
1295
+ const r = ye((a) => a.history), n = ye((a) => a.addHistory), s = ye((a) => a.clearHistory);
1296
1296
  return /* @__PURE__ */ o(
1297
- pr,
1297
+ gr,
1298
1298
  {
1299
1299
  ...t,
1300
1300
  history: r,
1301
1301
  onCommand: (a) => {
1302
1302
  n(`$ ${a}`);
1303
- const u = a.toLowerCase();
1304
- if (u === "clear") {
1303
+ const d = a.toLowerCase();
1304
+ if (d === "clear") {
1305
1305
  s();
1306
1306
  return;
1307
1307
  }
1308
- if (u === "help") {
1309
- hr.forEach(n);
1308
+ if (d === "help") {
1309
+ xr.forEach(n);
1310
1310
  return;
1311
1311
  }
1312
1312
  (e == null ? void 0 : e(a)) !== !0 && n(`command not found: ${a.split(" ")[0]}`);
1313
1313
  }
1314
1314
  }
1315
1315
  );
1316
- }, vn = (e = {}) => ({
1317
- id: Ye,
1316
+ }, Nn = (e = {}) => ({
1317
+ id: Xe,
1318
1318
  label: "Chat",
1319
- icon: Te,
1320
- component: fr,
1319
+ icon: Ee,
1320
+ component: ur,
1321
1321
  ...e
1322
- }), wn = (e = {}) => ({
1323
- id: Je,
1322
+ }), kn = (e = {}) => ({
1323
+ id: qe,
1324
1324
  label: "Terminal",
1325
- icon: De,
1326
- component: gr,
1325
+ icon: Te,
1326
+ component: br,
1327
1327
  ...e
1328
- }), xr = (e, t) => {
1328
+ }), En = (e = {}) => ({
1329
+ id: Ht,
1330
+ label: "Settings",
1331
+ icon: St,
1332
+ component: hr,
1333
+ align: "end",
1334
+ ...e
1335
+ }), yr = (e, t) => {
1329
1336
  const r = t.toLowerCase();
1330
1337
  return e.label.toLowerCase().includes(r) || e.id.toLowerCase().includes(r);
1331
- }, br = ({
1338
+ }, vr = ({
1332
1339
  open: e,
1333
1340
  commands: t,
1334
1341
  onSelect: r,
1335
1342
  onClose: n,
1336
1343
  inline: s = !1,
1337
1344
  placeholder: i = "Type a command to run…",
1338
- filter: a = xr,
1339
- className: u
1345
+ filter: a = yr,
1346
+ className: d
1340
1347
  }) => {
1341
- const [c, l] = P(""), [f, d] = P(0), m = _(null), w = B(
1342
- () => t.filter((p) => a(p, c)),
1348
+ const [c, l] = A(""), [p, u] = A(0), m = _(null), v = B(
1349
+ () => t.filter((f) => a(f, c)),
1343
1350
  [t, c, a]
1344
1351
  );
1345
- if (R(() => {
1346
- var p;
1347
- e && (l(""), d(0), (p = m.current) == null || p.focus());
1348
- }, [e]), R(() => {
1349
- d(0);
1352
+ if (F(() => {
1353
+ var f;
1354
+ e && (l(""), u(0), (f = m.current) == null || f.focus());
1355
+ }, [e]), F(() => {
1356
+ u(0);
1350
1357
  }, [c]), !e) return null;
1351
- const b = (p) => {
1352
- p.key === "ArrowDown" ? (p.preventDefault(), d((h) => w.length ? (h + 1) % w.length : 0)) : p.key === "ArrowUp" ? (p.preventDefault(), d(
1353
- (h) => w.length ? (h - 1 + w.length) % w.length : 0
1354
- )) : p.key === "Enter" ? (p.preventDefault(), w[f] && r(w[f])) : p.key === "Escape" && (p.preventDefault(), n == null || n());
1358
+ const b = (f) => {
1359
+ f.key === "ArrowDown" ? (f.preventDefault(), u((h) => v.length ? (h + 1) % v.length : 0)) : f.key === "ArrowUp" ? (f.preventDefault(), u(
1360
+ (h) => v.length ? (h - 1 + v.length) % v.length : 0
1361
+ )) : f.key === "Enter" ? (f.preventDefault(), v[p] && r(v[p])) : f.key === "Escape" && (f.preventDefault(), n == null || n());
1355
1362
  };
1356
1363
  return /* @__PURE__ */ o(
1357
1364
  "div",
1358
1365
  {
1359
1366
  onClick: s ? void 0 : n,
1360
- className: I(
1367
+ className: P(
1361
1368
  "z-[100] flex items-start justify-center",
1362
1369
  s ? "relative w-full max-w-xl" : "fixed inset-0 pt-[10vh] bg-black/50 backdrop-blur-sm"
1363
1370
  ),
@@ -1367,14 +1374,14 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1367
1374
  role: "dialog",
1368
1375
  "aria-modal": !s,
1369
1376
  "aria-label": "Command Palette",
1370
- onClick: (p) => p.stopPropagation(),
1371
- className: I(
1377
+ onClick: (f) => f.stopPropagation(),
1378
+ className: P(
1372
1379
  "w-full max-w-xl bg-popover text-popover-foreground border shadow-2xl rounded-xl overflow-hidden animate-in fade-in zoom-in duration-200",
1373
- u
1380
+ d
1374
1381
  ),
1375
1382
  children: [
1376
1383
  /* @__PURE__ */ x("div", { className: "flex items-center px-4 border-b", children: [
1377
- /* @__PURE__ */ o(xe, { size: 18, className: "text-muted-foreground mr-3" }),
1384
+ /* @__PURE__ */ o(ge, { size: 18, className: "text-muted-foreground mr-3" }),
1378
1385
  /* @__PURE__ */ o(
1379
1386
  "input",
1380
1387
  {
@@ -1386,7 +1393,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1386
1393
  "aria-label": "Command",
1387
1394
  placeholder: i,
1388
1395
  value: c,
1389
- onChange: (p) => l(p.target.value),
1396
+ onChange: (f) => l(f.target.value),
1390
1397
  onKeyDown: b,
1391
1398
  className: "flex-1 h-14 bg-transparent outline-none text-base text-foreground placeholder:text-muted-foreground"
1392
1399
  }
@@ -1398,23 +1405,23 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1398
1405
  id: "command-palette-list",
1399
1406
  role: "listbox",
1400
1407
  className: "max-h-[300px] overflow-y-auto py-2",
1401
- children: w.length === 0 ? /* @__PURE__ */ o("div", { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: c ? `No commands found matching "${c}"` : "No commands available." }) : w.map((p, h) => /* @__PURE__ */ x(
1408
+ children: v.length === 0 ? /* @__PURE__ */ o("div", { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: c ? `No commands found matching "${c}"` : "No commands available." }) : v.map((f, h) => /* @__PURE__ */ x(
1402
1409
  "div",
1403
1410
  {
1404
1411
  role: "option",
1405
- "aria-selected": h === f,
1406
- onClick: () => r(p),
1407
- onMouseEnter: () => d(h),
1408
- className: I(
1412
+ "aria-selected": h === p,
1413
+ onClick: () => r(f),
1414
+ onMouseEnter: () => u(h),
1415
+ className: P(
1409
1416
  "px-4 py-2 cursor-pointer flex justify-between items-center text-sm",
1410
- h === f ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
1417
+ h === p ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
1411
1418
  ),
1412
1419
  children: [
1413
- /* @__PURE__ */ o("span", { children: p.label }),
1414
- p.keybinding && /* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border/50", children: p.keybinding })
1420
+ /* @__PURE__ */ o("span", { children: f.label }),
1421
+ f.keybinding && /* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border/50", children: f.keybinding })
1415
1422
  ]
1416
1423
  },
1417
- p.id
1424
+ f.id
1418
1425
  ))
1419
1426
  }
1420
1427
  ),
@@ -1439,19 +1446,19 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1439
1446
  )
1440
1447
  }
1441
1448
  );
1442
- }, Nn = ({
1449
+ }, Tn = ({
1443
1450
  shortcutKey: e = "p",
1444
1451
  ...t
1445
1452
  }) => {
1446
- const [r, n] = P(!1);
1447
- return R(() => {
1453
+ const [r, n] = A(!1);
1454
+ return F(() => {
1448
1455
  if (e === null) return;
1449
1456
  const s = (i) => {
1450
1457
  (i.metaKey || i.ctrlKey) && i.shiftKey && i.key.toLowerCase() === e && (i.preventDefault(), n((a) => !a));
1451
1458
  };
1452
1459
  return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
1453
1460
  }, [e]), /* @__PURE__ */ o(
1454
- br,
1461
+ vr,
1455
1462
  {
1456
1463
  ...t,
1457
1464
  open: r,
@@ -1462,15 +1469,15 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1462
1469
  onClose: () => n(!1)
1463
1470
  }
1464
1471
  );
1465
- }, yr = {
1466
- alert: Mt,
1467
- confirm: It,
1468
- prompt: Lt
1469
- }, vr = {
1472
+ }, wr = {
1473
+ alert: At,
1474
+ confirm: Ct,
1475
+ prompt: Mt
1476
+ }, Nr = {
1470
1477
  alert: "text-destructive",
1471
1478
  confirm: "text-amber-500",
1472
1479
  prompt: "text-blue-500"
1473
- }, wr = ({
1480
+ }, kr = ({
1474
1481
  open: e,
1475
1482
  type: t = "alert",
1476
1483
  title: r,
@@ -1478,29 +1485,29 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1478
1485
  defaultValue: s = "",
1479
1486
  onConfirm: i,
1480
1487
  onCancel: a,
1481
- confirmLabel: u,
1488
+ confirmLabel: d,
1482
1489
  cancelLabel: c = "Cancel",
1483
1490
  placeholder: l = "Enter value…",
1484
- className: f
1491
+ className: p
1485
1492
  }) => {
1486
- const [d, m] = P(s), w = _(null);
1487
- if (R(() => {
1493
+ const [u, m] = A(s), v = _(null);
1494
+ if (F(() => {
1488
1495
  if (!e || (m(s), t !== "prompt")) return;
1489
1496
  const y = window.setTimeout(() => {
1490
- var E, v;
1491
- (E = w.current) == null || E.focus(), (v = w.current) == null || v.select();
1497
+ var k, w;
1498
+ (k = v.current) == null || k.focus(), (w = v.current) == null || w.select();
1492
1499
  }, 50);
1493
1500
  return () => window.clearTimeout(y);
1494
- }, [e, t, s]), R(() => {
1501
+ }, [e, t, s]), F(() => {
1495
1502
  if (!e) return;
1496
- const y = (E) => {
1497
- E.key === "Escape" && (E.preventDefault(), a == null || a());
1503
+ const y = (k) => {
1504
+ k.key === "Escape" && (k.preventDefault(), a == null || a());
1498
1505
  };
1499
1506
  return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
1500
1507
  }, [e, a]), !e) return null;
1501
- const b = () => i == null ? void 0 : i(t === "prompt" ? d : void 0), p = (y) => {
1508
+ const b = () => i == null ? void 0 : i(t === "prompt" ? u : void 0), f = (y) => {
1502
1509
  y.key === "Enter" && (y.preventDefault(), b());
1503
- }, h = yr[t];
1510
+ }, h = wr[t];
1504
1511
  return /* @__PURE__ */ o(
1505
1512
  "div",
1506
1513
  {
@@ -1513,10 +1520,10 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1513
1520
  "aria-modal": "true",
1514
1521
  "aria-label": r,
1515
1522
  onClick: (y) => y.stopPropagation(),
1516
- onKeyDown: p,
1517
- className: I(
1523
+ onKeyDown: f,
1524
+ className: P(
1518
1525
  "relative flex flex-col w-full max-w-md p-6 bg-card border border-border shadow-2xl rounded-2xl animate-in fade-in zoom-in-95 ring-1 ring-white/10",
1519
- f
1526
+ p
1520
1527
  ),
1521
1528
  children: [
1522
1529
  /* @__PURE__ */ o(
@@ -1530,7 +1537,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1530
1537
  }
1531
1538
  ),
1532
1539
  /* @__PURE__ */ x("div", { className: "flex items-start space-x-4 mb-4", children: [
1533
- /* @__PURE__ */ o("div", { className: I("p-2 bg-muted rounded-full shrink-0", vr[t]), children: /* @__PURE__ */ o(h, { size: 24 }) }),
1540
+ /* @__PURE__ */ o("div", { className: P("p-2 bg-muted rounded-full shrink-0", Nr[t]), children: /* @__PURE__ */ o(h, { size: 24 }) }),
1534
1541
  /* @__PURE__ */ x("div", { className: "flex-1 mt-1", children: [
1535
1542
  /* @__PURE__ */ o("h2", { className: "text-lg font-semibold tracking-tight pr-6", children: r }),
1536
1543
  n && /* @__PURE__ */ o("p", { className: "text-sm text-muted-foreground mt-1 whitespace-pre-wrap", children: n })
@@ -1539,10 +1546,10 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1539
1546
  t === "prompt" && /* @__PURE__ */ o("div", { className: "mt-2 mb-4", children: /* @__PURE__ */ o(
1540
1547
  "input",
1541
1548
  {
1542
- ref: w,
1549
+ ref: v,
1543
1550
  type: "text",
1544
1551
  "aria-label": r,
1545
- value: d,
1552
+ value: u,
1546
1553
  placeholder: l,
1547
1554
  onChange: (y) => m(y.target.value),
1548
1555
  className: "w-full bg-background border border-border rounded-lg px-4 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary/50 transition-all placeholder:text-muted-foreground/50"
@@ -1565,7 +1572,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1565
1572
  onClick: b,
1566
1573
  autoFocus: t !== "prompt",
1567
1574
  className: "px-4 py-2 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
1568
- children: u ?? (t === "alert" ? "OK" : "Confirm")
1575
+ children: d ?? (t === "alert" ? "OK" : "Confirm")
1569
1576
  }
1570
1577
  )
1571
1578
  ] })
@@ -1574,10 +1581,10 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1574
1581
  )
1575
1582
  }
1576
1583
  );
1577
- }, kn = (e) => {
1578
- const { isOpen: t, type: r, title: n, message: s, defaultValue: i, close: a } = at();
1584
+ }, Dn = (e) => {
1585
+ const { isOpen: t, type: r, title: n, message: s, defaultValue: i, close: a } = it();
1579
1586
  return /* @__PURE__ */ o(
1580
- wr,
1587
+ kr,
1581
1588
  {
1582
1589
  ...e,
1583
1590
  open: t,
@@ -1593,13 +1600,13 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1593
1600
  }
1594
1601
  }
1595
1602
  );
1596
- }, Nr = ue.map((e) => ({
1603
+ }, Er = de.map((e) => ({
1597
1604
  id: e.id,
1598
1605
  label: e.shortLabel
1599
- })), kr = ({
1606
+ })), Tr = ({
1600
1607
  value: e,
1601
1608
  onChange: t,
1602
- options: r = Nr,
1609
+ options: r = Er,
1603
1610
  className: n,
1604
1611
  "aria-label": s = "Theme"
1605
1612
  }) => /* @__PURE__ */ o(
@@ -1607,7 +1614,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1607
1614
  {
1608
1615
  role: "radiogroup",
1609
1616
  "aria-label": s,
1610
- className: I(
1617
+ className: P(
1611
1618
  "flex items-center border border-border rounded-lg p-0.5 bg-secondary/80 select-none",
1612
1619
  n
1613
1620
  ),
@@ -1617,7 +1624,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1617
1624
  role: "radio",
1618
1625
  "aria-checked": e === i.id,
1619
1626
  onClick: () => t(i.id),
1620
- className: I(
1627
+ className: P(
1621
1628
  "px-2.5 py-1 text-[9px] font-extrabold uppercase rounded-md transition-all font-mono cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-ring",
1622
1629
  e === i.id ? "bg-primary text-primary-foreground shadow" : "text-muted-foreground hover:bg-accent hover:text-foreground"
1623
1630
  ),
@@ -1626,10 +1633,10 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1626
1633
  i.id
1627
1634
  ))
1628
1635
  }
1629
- ), En = (e) => {
1630
- const t = le((n) => n.theme), r = le((n) => n.setTheme);
1631
- return /* @__PURE__ */ o(kr, { ...e, value: t, onChange: r });
1632
- }, Er = ({
1636
+ ), Ln = (e) => {
1637
+ const t = ie((n) => n.theme), r = ie((n) => n.setTheme);
1638
+ return /* @__PURE__ */ o(Tr, { ...e, value: t, onChange: r });
1639
+ }, Dr = ({
1633
1640
  profile: e,
1634
1641
  actions: t = [],
1635
1642
  onProfileChange: r,
@@ -1638,51 +1645,51 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1638
1645
  showName: i = !0,
1639
1646
  className: a
1640
1647
  }) => {
1641
- const { name: u, role: c, email: l, avatarUrl: f } = e, [d, m] = P(!1), [w, b] = P(!1), [p, h] = P(u), [y, E] = P(c ?? ""), v = _(null), N = _(null);
1642
- R(() => {
1643
- d && (h(u), E(c ?? ""), b(!1));
1644
- }, [d, u, c]), R(() => {
1645
- if (!d) return;
1646
- const k = (S) => {
1647
- v.current && !v.current.contains(S.target) && m(!1);
1648
+ const { name: d, role: c, email: l, avatarUrl: p } = e, [u, m] = A(!1), [v, b] = A(!1), [f, h] = A(d), [y, k] = A(c ?? ""), w = _(null), N = _(null);
1649
+ F(() => {
1650
+ u && (h(d), k(c ?? ""), b(!1));
1651
+ }, [u, d, c]), F(() => {
1652
+ if (!u) return;
1653
+ const I = (S) => {
1654
+ w.current && !w.current.contains(S.target) && m(!1);
1648
1655
  };
1649
- return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
1650
- }, [d]);
1651
- const C = (k) => {
1652
- k.preventDefault(), r == null || r({ name: p, role: y }), b(!1);
1653
- }, L = (k) => {
1656
+ return document.addEventListener("mousedown", I), () => document.removeEventListener("mousedown", I);
1657
+ }, [u]);
1658
+ const L = (I) => {
1659
+ I.preventDefault(), r == null || r({ name: f, role: y }), b(!1);
1660
+ }, T = (I) => {
1654
1661
  var g;
1655
- const S = (g = k.target.files) == null ? void 0 : g[0];
1656
- S && (n == null || n(S)), k.target.value = "";
1657
- }, A = (k) => f ? /* @__PURE__ */ o("img", { src: f, alt: u, className: "w-full h-full object-cover" }) : /* @__PURE__ */ o(He, { size: k, className: "text-muted-foreground" });
1658
- return /* @__PURE__ */ x("div", { ref: v, className: "relative inline-block text-left", children: [
1662
+ const S = (g = I.target.files) == null ? void 0 : g[0];
1663
+ S && (n == null || n(S)), I.target.value = "";
1664
+ }, M = (I) => p ? /* @__PURE__ */ o("img", { src: p, alt: d, className: "w-full h-full object-cover" }) : /* @__PURE__ */ o(We, { size: I, className: "text-muted-foreground" });
1665
+ return /* @__PURE__ */ x("div", { ref: w, className: "relative inline-block text-left", children: [
1659
1666
  /* @__PURE__ */ x(
1660
1667
  "button",
1661
1668
  {
1662
1669
  type: "button",
1663
- onClick: () => s ? s() : m((k) => !k),
1670
+ onClick: () => s ? s() : m((I) => !I),
1664
1671
  "aria-haspopup": s ? void 0 : "menu",
1665
- "aria-expanded": s ? void 0 : d,
1672
+ "aria-expanded": s ? void 0 : u,
1666
1673
  "aria-label": "User Profile Menu",
1667
- className: I(
1674
+ className: P(
1668
1675
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none transition-all duration-200 select-none",
1669
1676
  i ? "flex items-center space-x-2 px-2 py-1 rounded-md hover:bg-accent/50 hover:text-accent-foreground text-left cursor-pointer border border-transparent hover:border-border/30" : "w-7 h-7 rounded-full bg-secondary/80 border border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-secondary cursor-pointer",
1670
- d && (i ? "bg-accent/60 border-border/40" : "border-primary/50 text-foreground ring-1 ring-primary/20"),
1677
+ u && (i ? "bg-accent/60 border-border/40" : "border-primary/50 text-foreground ring-1 ring-primary/20"),
1671
1678
  a
1672
1679
  ),
1673
1680
  children: [
1674
1681
  /* @__PURE__ */ o(
1675
1682
  "div",
1676
1683
  {
1677
- className: I(
1684
+ className: P(
1678
1685
  "rounded-full overflow-hidden border border-border/50 bg-muted flex items-center justify-center shrink-0 shadow-sm",
1679
1686
  i ? "w-6 h-6" : "w-full h-full"
1680
1687
  ),
1681
- children: A(i ? 13 : 12)
1688
+ children: M(i ? 13 : 12)
1682
1689
  }
1683
1690
  ),
1684
1691
  i && /* @__PURE__ */ x("div", { className: "flex flex-col min-w-0 leading-tight pr-1", children: [
1685
- /* @__PURE__ */ o("span", { className: "text-[11px] font-semibold truncate text-foreground", children: u }),
1692
+ /* @__PURE__ */ o("span", { className: "text-[11px] font-semibold truncate text-foreground", children: d }),
1686
1693
  c && /* @__PURE__ */ o("span", { className: "text-[9px] text-muted-foreground/80 truncate font-medium", children: c })
1687
1694
  ] })
1688
1695
  ]
@@ -1693,21 +1700,21 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1693
1700
  {
1694
1701
  type: "file",
1695
1702
  ref: N,
1696
- onChange: L,
1703
+ onChange: T,
1697
1704
  accept: "image/*",
1698
1705
  "aria-label": "Upload avatar",
1699
1706
  className: "hidden"
1700
1707
  }
1701
1708
  ),
1702
- d && /* @__PURE__ */ o(
1709
+ u && /* @__PURE__ */ o(
1703
1710
  "div",
1704
1711
  {
1705
1712
  role: "menu",
1706
- className: I(
1713
+ className: P(
1707
1714
  "absolute z-50 w-64 rounded-lg border border-border/50 bg-card text-card-foreground shadow-lg backdrop-blur-md p-2 flex flex-col gap-1 mt-1.5 animate-in fade-in slide-in-from-top-2 duration-150 origin-top-right",
1708
1715
  i ? "left-0" : "right-0"
1709
1716
  ),
1710
- children: w ? /* @__PURE__ */ x("form", { onSubmit: C, className: "p-2 flex flex-col gap-2", children: [
1717
+ children: v ? /* @__PURE__ */ x("form", { onSubmit: L, className: "p-2 flex flex-col gap-2", children: [
1711
1718
  /* @__PURE__ */ o("span", { className: "text-[10px] font-bold uppercase tracking-wider text-muted-foreground", children: "Edit Profile" }),
1712
1719
  /* @__PURE__ */ x("div", { className: "flex flex-col gap-1", children: [
1713
1720
  /* @__PURE__ */ o("label", { htmlFor: "profile-name", className: "text-[9px] font-semibold text-muted-foreground", children: "Name" }),
@@ -1716,8 +1723,8 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1716
1723
  {
1717
1724
  id: "profile-name",
1718
1725
  type: "text",
1719
- value: p,
1720
- onChange: (k) => h(k.target.value),
1726
+ value: f,
1727
+ onChange: (I) => h(I.target.value),
1721
1728
  required: !0,
1722
1729
  className: "w-full px-2 py-1 text-xs border rounded bg-background focus:ring-1 focus:ring-primary focus:outline-none"
1723
1730
  }
@@ -1731,7 +1738,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1731
1738
  id: "profile-role",
1732
1739
  type: "text",
1733
1740
  value: y,
1734
- onChange: (k) => E(k.target.value),
1741
+ onChange: (I) => k(I.target.value),
1735
1742
  className: "w-full px-2 py-1 text-xs border rounded bg-background focus:ring-1 focus:ring-primary focus:outline-none"
1736
1743
  }
1737
1744
  )
@@ -1755,35 +1762,35 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1755
1762
  type: "submit",
1756
1763
  className: "px-2 py-1 text-[10px] rounded bg-primary text-primary-foreground hover:bg-primary/95 flex items-center gap-1 font-semibold",
1757
1764
  children: [
1758
- /* @__PURE__ */ o(Ct, { size: 10 }),
1765
+ /* @__PURE__ */ o($t, { size: 10 }),
1759
1766
  " Save"
1760
1767
  ]
1761
1768
  }
1762
1769
  )
1763
1770
  ] })
1764
- ] }) : /* @__PURE__ */ x(Ue, { children: [
1771
+ ] }) : /* @__PURE__ */ x(He, { children: [
1765
1772
  /* @__PURE__ */ x("div", { className: "p-2 flex items-center gap-3 border-b border-border/40 pb-2.5 mb-1", children: [
1766
1773
  /* @__PURE__ */ x(
1767
1774
  "div",
1768
1775
  {
1769
1776
  onClick: () => {
1770
- var k;
1771
- return n && ((k = N.current) == null ? void 0 : k.click());
1777
+ var I;
1778
+ return n && ((I = N.current) == null ? void 0 : I.click());
1772
1779
  },
1773
1780
  title: n ? "Upload avatar image" : void 0,
1774
- className: I(
1781
+ className: P(
1775
1782
  "group relative w-12 h-12 rounded-full overflow-hidden border border-border/80 bg-muted flex items-center justify-center shrink-0 shadow-inner",
1776
1783
  n && "cursor-pointer"
1777
1784
  ),
1778
1785
  children: [
1779
- A(24),
1780
- n && /* @__PURE__ */ o("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity", children: /* @__PURE__ */ o(At, { size: 14, className: "text-white" }) })
1786
+ M(24),
1787
+ n && /* @__PURE__ */ o("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity", children: /* @__PURE__ */ o(Rt, { size: 14, className: "text-white" }) })
1781
1788
  ]
1782
1789
  }
1783
1790
  ),
1784
1791
  /* @__PURE__ */ x("div", { className: "flex flex-col min-w-0 leading-normal flex-1", children: [
1785
1792
  /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
1786
- /* @__PURE__ */ o("span", { className: "text-xs font-bold truncate text-foreground", children: u }),
1793
+ /* @__PURE__ */ o("span", { className: "text-xs font-bold truncate text-foreground", children: d }),
1787
1794
  r && /* @__PURE__ */ o(
1788
1795
  "button",
1789
1796
  {
@@ -1792,7 +1799,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1792
1799
  title: "Edit Profile",
1793
1800
  "aria-label": "Edit Profile",
1794
1801
  className: "p-1 text-muted-foreground hover:text-foreground hover:bg-accent/40 rounded transition-colors",
1795
- children: /* @__PURE__ */ o(Pt, { size: 10 })
1802
+ children: /* @__PURE__ */ o(Ft, { size: 10 })
1796
1803
  }
1797
1804
  )
1798
1805
  ] }),
@@ -1800,65 +1807,65 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1800
1807
  l && /* @__PURE__ */ o("span", { className: "text-[9px] text-muted-foreground/60 truncate font-mono mt-0.5", children: l })
1801
1808
  ] })
1802
1809
  ] }),
1803
- t.map((k) => {
1804
- const S = k.icon;
1810
+ t.map((I) => {
1811
+ const S = I.icon;
1805
1812
  return /* @__PURE__ */ x(
1806
1813
  "button",
1807
1814
  {
1808
1815
  type: "button",
1809
1816
  role: "menuitem",
1810
1817
  onClick: () => {
1811
- k.onSelect(), m(!1);
1818
+ I.onSelect(), m(!1);
1812
1819
  },
1813
- className: I(
1820
+ className: P(
1814
1821
  "w-full px-2 py-1.5 text-left rounded-md text-[11px] font-medium flex items-center gap-2 cursor-pointer transition-colors",
1815
- k.destructive ? "text-destructive hover:bg-destructive/10" : "hover:bg-accent/60 hover:text-accent-foreground",
1816
- k.divider && "border-t border-border/20 pt-2 mt-1"
1822
+ I.destructive ? "text-destructive hover:bg-destructive/10" : "hover:bg-accent/60 hover:text-accent-foreground",
1823
+ I.divider && "border-t border-border/20 pt-2 mt-1"
1817
1824
  ),
1818
1825
  children: [
1819
1826
  S && /* @__PURE__ */ o(S, { size: 12, className: "opacity-70" }),
1820
- k.label
1827
+ I.label
1821
1828
  ]
1822
1829
  },
1823
- k.id
1830
+ I.id
1824
1831
  );
1825
1832
  })
1826
1833
  ] })
1827
1834
  }
1828
1835
  )
1829
1836
  ] });
1830
- }, Tn = (e) => {
1831
- const t = te((l) => l.name), r = te((l) => l.role), n = te((l) => l.email), s = te((l) => l.avatarUrl), i = te((l) => l.customAvatar), a = te((l) => l.updateProfile), u = te((l) => l.setCustomAvatar);
1837
+ }, In = (e) => {
1838
+ const t = te((l) => l.name), r = te((l) => l.role), n = te((l) => l.email), s = te((l) => l.avatarUrl), i = te((l) => l.customAvatar), a = te((l) => l.updateProfile), d = te((l) => l.setCustomAvatar);
1832
1839
  return /* @__PURE__ */ o(
1833
- Er,
1840
+ Dr,
1834
1841
  {
1835
1842
  ...e,
1836
1843
  profile: { name: t, role: r, email: n, avatarUrl: i || s },
1837
1844
  onProfileChange: a,
1838
1845
  onAvatarChange: (l) => {
1839
- const f = new FileReader();
1840
- f.onloadend = () => {
1841
- typeof f.result == "string" && u(f.result);
1842
- }, f.readAsDataURL(l);
1846
+ const p = new FileReader();
1847
+ p.onloadend = () => {
1848
+ typeof p.result == "string" && d(p.result);
1849
+ }, p.readAsDataURL(l);
1843
1850
  }
1844
1851
  }
1845
1852
  );
1846
- }, Dn = ({ title: e, subtitle: t, icon: r, className: n }) => /* @__PURE__ */ x("div", { className: I("flex items-center space-x-3 select-none", n), children: [
1853
+ }, Pn = ({ title: e, subtitle: t, icon: r, className: n }) => /* @__PURE__ */ x("div", { className: P("flex items-center space-x-3 select-none", n), children: [
1847
1854
  r && /* @__PURE__ */ o("div", { className: "w-8 h-8 rounded-lg bg-primary/10 border border-primary/30 flex items-center justify-center text-primary shadow-inner shrink-0", children: r }),
1848
1855
  /* @__PURE__ */ x("div", { className: "min-w-0", children: [
1849
1856
  /* @__PURE__ */ o("h1", { className: "text-xs font-black uppercase tracking-wider text-foreground font-mono truncate", children: e }),
1850
1857
  t && /* @__PURE__ */ o("p", { className: "text-[9px] text-muted-foreground font-semibold truncate", children: t })
1851
1858
  ] })
1852
- ] }), Tr = ({ x: e, y: t, items: r, onClose: n, className: s }) => {
1859
+ ] }), Lr = ({ x: e, y: t, items: r, onClose: n, className: s }) => {
1853
1860
  const i = _(null);
1854
- return R(() => {
1861
+ return F(() => {
1855
1862
  const a = (c) => {
1856
1863
  i.current && !i.current.contains(c.target) && n();
1857
- }, u = (c) => {
1864
+ }, d = (c) => {
1858
1865
  c.key === "Escape" && n();
1859
1866
  };
1860
- return document.addEventListener("mousedown", a), document.addEventListener("keydown", u), () => {
1861
- document.removeEventListener("mousedown", a), document.removeEventListener("keydown", u);
1867
+ return document.addEventListener("mousedown", a), document.addEventListener("keydown", d), () => {
1868
+ document.removeEventListener("mousedown", a), document.removeEventListener("keydown", d);
1862
1869
  };
1863
1870
  }, [n]), /* @__PURE__ */ o(
1864
1871
  "div",
@@ -1866,11 +1873,11 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1866
1873
  ref: i,
1867
1874
  role: "menu",
1868
1875
  style: { top: t, left: e },
1869
- className: I(
1876
+ className: P(
1870
1877
  "fixed z-[1000] min-w-[160px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 animate-in fade-in zoom-in-95 duration-100",
1871
1878
  s
1872
1879
  ),
1873
- children: r.map((a, u) => /* @__PURE__ */ x(he.Fragment, { children: [
1880
+ children: r.map((a, d) => /* @__PURE__ */ x(pe.Fragment, { children: [
1874
1881
  a.divider && /* @__PURE__ */ o("div", { className: "h-[1px] bg-border my-1" }),
1875
1882
  /* @__PURE__ */ x(
1876
1883
  "div",
@@ -1884,7 +1891,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1884
1891
  onKeyDown: (c) => {
1885
1892
  a.disabled || c.key !== "Enter" && c.key !== " " || (c.preventDefault(), a.onClick(), n());
1886
1893
  },
1887
- className: I(
1894
+ className: P(
1888
1895
  "px-3 py-1.5 text-xs flex items-center focus:outline-none",
1889
1896
  a.disabled ? "opacity-40 cursor-default" : "cursor-pointer hover:bg-accent hover:text-accent-foreground focus:bg-accent"
1890
1897
  ),
@@ -1894,7 +1901,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1894
1901
  ]
1895
1902
  }
1896
1903
  )
1897
- ] }, `${a.label}-${u}`))
1904
+ ] }, `${a.label}-${d}`))
1898
1905
  }
1899
1906
  );
1900
1907
  }, Sn = ({
@@ -1905,89 +1912,89 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1905
1912
  rowKey: s = "id",
1906
1913
  virtualized: i = !0,
1907
1914
  showFilter: a = !0,
1908
- loading: u = !1,
1915
+ loading: d = !1,
1909
1916
  placeholder: c = "No data available",
1910
1917
  className: l
1911
1918
  }) => {
1912
- const [f, d] = P(""), [m, w] = P(null), [b, p] = P(-1), h = _(null);
1913
- R(() => {
1914
- p(-1);
1915
- }, [f, m]);
1919
+ const [p, u] = A(""), [m, v] = A(null), [b, f] = A(-1), h = _(null);
1920
+ F(() => {
1921
+ f(-1);
1922
+ }, [p, m]);
1916
1923
  const y = B(() => {
1917
- if (!f) return t;
1918
- const g = f.toLowerCase();
1919
- return t.filter((T) => Object.values(T).some((M) => M == null ? !1 : String(M).toLowerCase().includes(g)));
1920
- }, [t, f]), E = B(() => {
1924
+ if (!p) return t;
1925
+ const g = p.toLowerCase();
1926
+ return t.filter((D) => Object.values(D).some((C) => C == null ? !1 : String(C).toLowerCase().includes(g)));
1927
+ }, [t, p]), k = B(() => {
1921
1928
  if (!m) return y;
1922
- const { key: g, direction: T } = m;
1923
- return [...y].sort((M, $) => {
1924
- const K = M[g], O = $[g];
1929
+ const { key: g, direction: D } = m;
1930
+ return [...y].sort((C, $) => {
1931
+ const K = C[g], O = $[g];
1925
1932
  if (K === O) return 0;
1926
1933
  if (K == null) return 1;
1927
1934
  if (O == null) return -1;
1928
- const H = Number(K), D = Number(O);
1929
- if (!isNaN(H) && !isNaN(D))
1930
- return T === "asc" ? H - D : D - H;
1931
- const z = String(K).toLowerCase(), F = String(O).toLowerCase();
1932
- return T === "asc" ? z.localeCompare(F) : F.localeCompare(z);
1935
+ const H = Number(K), E = Number(O);
1936
+ if (!isNaN(H) && !isNaN(E))
1937
+ return D === "asc" ? H - E : E - H;
1938
+ const z = String(K).toLowerCase(), R = String(O).toLowerCase();
1939
+ return D === "asc" ? z.localeCompare(R) : R.localeCompare(z);
1933
1940
  });
1934
- }, [y, m]), v = (g, T) => {
1935
- T !== !1 && w((M) => !M || M.key !== g ? { key: g, direction: "asc" } : M.direction === "asc" ? { key: g, direction: "desc" } : null);
1941
+ }, [y, m]), w = (g, D) => {
1942
+ D !== !1 && v((C) => !C || C.key !== g ? { key: g, direction: "asc" } : C.direction === "asc" ? { key: g, direction: "desc" } : null);
1936
1943
  }, N = (g) => {
1937
- if (!(E.length === 0 || u)) {
1944
+ if (!(k.length === 0 || d)) {
1938
1945
  if (g.key === "ArrowDown")
1939
- g.preventDefault(), p((T) => {
1940
- const M = T + 1;
1941
- return M >= E.length ? 0 : M;
1946
+ g.preventDefault(), f((D) => {
1947
+ const C = D + 1;
1948
+ return C >= k.length ? 0 : C;
1942
1949
  });
1943
1950
  else if (g.key === "ArrowUp")
1944
- g.preventDefault(), p((T) => {
1945
- const M = T - 1;
1946
- return M < 0 ? E.length - 1 : M;
1951
+ g.preventDefault(), f((D) => {
1952
+ const C = D - 1;
1953
+ return C < 0 ? k.length - 1 : C;
1947
1954
  });
1948
- else if ((g.key === "Enter" || g.key === " ") && (g.preventDefault(), b >= 0 && b < E.length)) {
1949
- const T = E[b];
1950
- r && r(T);
1955
+ else if ((g.key === "Enter" || g.key === " ") && (g.preventDefault(), b >= 0 && b < k.length)) {
1956
+ const D = k[b];
1957
+ r && r(D);
1951
1958
  }
1952
1959
  }
1953
- }, C = (g) => g.sortable === !1 ? null : (m == null ? void 0 : m.key) !== g.key ? /* @__PURE__ */ o($t, { size: 14, className: "text-muted-foreground/60 ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity" }) : m.direction === "asc" ? /* @__PURE__ */ o(je, { size: 14, className: "text-primary ml-1.5" }) : /* @__PURE__ */ o(Ge, { size: 14, className: "text-primary ml-1.5" }), L = () => /* @__PURE__ */ o("tr", { role: "row", className: "border-b border-border bg-muted/30 select-none", children: e.map((g) => /* @__PURE__ */ o(
1960
+ }, L = (g) => g.sortable === !1 ? null : (m == null ? void 0 : m.key) !== g.key ? /* @__PURE__ */ o(zt, { size: 14, className: "text-muted-foreground/60 ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity" }) : m.direction === "asc" ? /* @__PURE__ */ o(Ge, { size: 14, className: "text-primary ml-1.5" }) : /* @__PURE__ */ o(Je, { size: 14, className: "text-primary ml-1.5" }), T = () => /* @__PURE__ */ o("tr", { role: "row", className: "border-b border-border bg-muted/30 select-none", children: e.map((g) => /* @__PURE__ */ o(
1954
1961
  "th",
1955
1962
  {
1956
1963
  role: "columnheader",
1957
1964
  "aria-sort": (m == null ? void 0 : m.key) === g.key ? m.direction === "asc" ? "ascending" : "descending" : "none",
1958
- className: I(
1965
+ className: P(
1959
1966
  "p-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider text-left transition-colors",
1960
1967
  g.sortable !== !1 && "cursor-pointer hover:bg-accent/30 hover:text-foreground group"
1961
1968
  ),
1962
1969
  style: { width: g.width },
1963
- onClick: () => v(g.key, g.sortable),
1970
+ onClick: () => w(g.key, g.sortable),
1964
1971
  children: /* @__PURE__ */ x("div", { className: "flex items-center", children: [
1965
1972
  /* @__PURE__ */ o("span", { children: g.header }),
1966
- C(g)
1973
+ L(g)
1967
1974
  ] })
1968
1975
  },
1969
1976
  g.key
1970
- )) }), A = (g, T) => {
1971
- const M = n !== void 0 && g[s] === n;
1977
+ )) }), M = (g, D) => {
1978
+ const C = n !== void 0 && g[s] === n;
1972
1979
  return /* @__PURE__ */ o(
1973
1980
  "tr",
1974
1981
  {
1975
1982
  role: "row",
1976
- "aria-selected": M,
1983
+ "aria-selected": C,
1977
1984
  onClick: () => r && r(g),
1978
- className: I(
1985
+ className: P(
1979
1986
  "border-b border-border/40 hover:bg-accent/40 transition-colors cursor-pointer text-sm outline-none",
1980
- M && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
1981
- b === T && "bg-accent/60 ring-1 ring-inset ring-ring"
1987
+ C && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
1988
+ b === D && "bg-accent/60 ring-1 ring-inset ring-ring"
1982
1989
  ),
1983
1990
  children: e.map((K) => {
1984
1991
  const O = g[K.key];
1985
1992
  return /* @__PURE__ */ o("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: K.render ? K.render(O, g) : O != null ? String(O) : "" }, K.key);
1986
1993
  })
1987
1994
  },
1988
- String(g[s] || T)
1995
+ String(g[s] || D)
1989
1996
  );
1990
- }, k = B(() => ({
1997
+ }, I = B(() => ({
1991
1998
  Table: (g) => /* @__PURE__ */ o(
1992
1999
  "table",
1993
2000
  {
@@ -1996,20 +2003,20 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
1996
2003
  className: "w-full border-collapse text-left bg-background text-foreground"
1997
2004
  }
1998
2005
  ),
1999
- TableHead: he.forwardRef((g, T) => /* @__PURE__ */ o("thead", { ref: T, ...g, className: "sticky top-0 bg-background z-10 shadow-[0_1px_0_0_rgba(0,0,0,0.1)] dark:shadow-[0_1px_0_0_rgba(255,255,255,0.05)]" })),
2000
- TableBody: he.forwardRef((g, T) => /* @__PURE__ */ o("tbody", { ref: T, ...g })),
2001
- TableRow: ({ item: g, context: T, ...M }) => {
2002
- if (!T || !g) return /* @__PURE__ */ o("tr", { ...M });
2003
- const $ = T.selectedRowId !== void 0 && g[T.rowKey] === T.selectedRowId, K = T.focusedIndex === M["data-index"];
2006
+ TableHead: pe.forwardRef((g, D) => /* @__PURE__ */ o("thead", { ref: D, ...g, className: "sticky top-0 bg-background z-10 shadow-[0_1px_0_0_rgba(0,0,0,0.1)] dark:shadow-[0_1px_0_0_rgba(255,255,255,0.05)]" })),
2007
+ TableBody: pe.forwardRef((g, D) => /* @__PURE__ */ o("tbody", { ref: D, ...g })),
2008
+ TableRow: ({ item: g, context: D, ...C }) => {
2009
+ if (!D || !g) return /* @__PURE__ */ o("tr", { ...C });
2010
+ const $ = D.selectedRowId !== void 0 && g[D.rowKey] === D.selectedRowId, K = D.focusedIndex === C["data-index"];
2004
2011
  return /* @__PURE__ */ o(
2005
2012
  "tr",
2006
2013
  {
2007
- ...M,
2014
+ ...C,
2008
2015
  onClick: () => {
2009
2016
  var O;
2010
- return (O = T.onRowClick) == null ? void 0 : O.call(T, g);
2017
+ return (O = D.onRowClick) == null ? void 0 : O.call(D, g);
2011
2018
  },
2012
- className: I(
2019
+ className: P(
2013
2020
  "border-b border-border/40 hover:bg-accent/40 transition-colors cursor-pointer text-sm outline-none",
2014
2021
  $ && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
2015
2022
  K && "bg-accent/60 ring-1 ring-inset ring-ring"
@@ -2017,32 +2024,32 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2017
2024
  }
2018
2025
  );
2019
2026
  }
2020
- }), []), S = () => u ? /* @__PURE__ */ x("div", { className: "flex flex-col items-center justify-center h-64 space-y-3", children: [
2021
- /* @__PURE__ */ o(We, { className: "animate-spin text-primary", size: 24 }),
2027
+ }), []), S = () => d ? /* @__PURE__ */ x("div", { className: "flex flex-col items-center justify-center h-64 space-y-3", children: [
2028
+ /* @__PURE__ */ o(Ye, { className: "animate-spin text-primary", size: 24 }),
2022
2029
  /* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground", children: "Loading dataset..." })
2023
- ] }) : E.length === 0 ? /* @__PURE__ */ x("div", { className: "flex flex-col items-center justify-center h-48 text-center px-4", children: [
2030
+ ] }) : k.length === 0 ? /* @__PURE__ */ x("div", { className: "flex flex-col items-center justify-center h-48 text-center px-4", children: [
2024
2031
  /* @__PURE__ */ o("span", { className: "text-sm font-medium text-foreground", children: c }),
2025
2032
  /* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground mt-1", children: "No items matched your search query." })
2026
2033
  ] }) : i ? /* @__PURE__ */ o("div", { className: "flex-1 min-h-[300px] h-full relative", children: /* @__PURE__ */ o(
2027
- _t,
2034
+ Kt,
2028
2035
  {
2029
- data: E,
2036
+ data: k,
2030
2037
  context: {
2031
2038
  selectedRowId: n,
2032
2039
  focusedIndex: b,
2033
2040
  rowKey: s,
2034
2041
  onRowClick: r
2035
2042
  },
2036
- components: k,
2037
- fixedHeaderContent: L,
2038
- itemContent: (g, T) => /* @__PURE__ */ o(Ue, { children: e.map((M) => {
2039
- const $ = T[M.key];
2040
- return /* @__PURE__ */ o("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: M.render ? M.render($, T) : $ != null ? String($) : "" }, M.key);
2043
+ components: I,
2044
+ fixedHeaderContent: T,
2045
+ itemContent: (g, D) => /* @__PURE__ */ o(He, { children: e.map((C) => {
2046
+ const $ = D[C.key];
2047
+ return /* @__PURE__ */ o("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: C.render ? C.render($, D) : $ != null ? String($) : "" }, C.key);
2041
2048
  }) })
2042
2049
  }
2043
2050
  ) }) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ x("table", { role: "grid", className: "w-full border-collapse text-left bg-background text-foreground", children: [
2044
- /* @__PURE__ */ o("thead", { children: L() }),
2045
- /* @__PURE__ */ o("tbody", { children: E.map((g, T) => A(g, T)) })
2051
+ /* @__PURE__ */ o("thead", { children: T() }),
2052
+ /* @__PURE__ */ o("tbody", { children: k.map((g, D) => M(g, D)) })
2046
2053
  ] }) });
2047
2054
  return /* @__PURE__ */ x(
2048
2055
  "div",
@@ -2052,28 +2059,28 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2052
2059
  "aria-label": "Data Grid",
2053
2060
  tabIndex: 0,
2054
2061
  onKeyDown: N,
2055
- className: I(
2062
+ className: P(
2056
2063
  "flex flex-col h-full bg-background border border-border rounded-lg shadow-sm overflow-hidden focus:outline-none focus:ring-1 focus:ring-ring focus:border-transparent",
2057
2064
  l
2058
2065
  ),
2059
2066
  children: [
2060
2067
  a && /* @__PURE__ */ x("div", { className: "flex items-center justify-between p-3 border-b border-border bg-muted/20", children: [
2061
2068
  /* @__PURE__ */ x("div", { className: "relative flex-1 max-w-sm", children: [
2062
- /* @__PURE__ */ o(xe, { size: 14, className: "absolute left-2.5 top-2.5 text-muted-foreground" }),
2069
+ /* @__PURE__ */ o(ge, { size: 14, className: "absolute left-2.5 top-2.5 text-muted-foreground" }),
2063
2070
  /* @__PURE__ */ o(
2064
2071
  "input",
2065
2072
  {
2066
2073
  type: "text",
2067
2074
  placeholder: "Filter table rows...",
2068
2075
  className: "w-full bg-secondary/40 border border-border rounded-md pl-8 pr-7 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary focus:border-transparent transition-all",
2069
- value: f,
2070
- onChange: (g) => d(g.target.value)
2076
+ value: p,
2077
+ onChange: (g) => u(g.target.value)
2071
2078
  }
2072
2079
  ),
2073
- f && /* @__PURE__ */ o(
2080
+ p && /* @__PURE__ */ o(
2074
2081
  "button",
2075
2082
  {
2076
- onClick: () => d(""),
2083
+ onClick: () => u(""),
2077
2084
  className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
2078
2085
  "aria-label": "Clear filter",
2079
2086
  children: /* @__PURE__ */ o(X, { size: 12 })
@@ -2081,7 +2088,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2081
2088
  )
2082
2089
  ] }),
2083
2090
  /* @__PURE__ */ x("div", { className: "text-[11px] text-muted-foreground font-medium ml-4", children: [
2084
- E.length,
2091
+ k.length,
2085
2092
  " of ",
2086
2093
  t.length,
2087
2094
  " records"
@@ -2091,7 +2098,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2091
2098
  ]
2092
2099
  }
2093
2100
  );
2094
- }, Ln = ({
2101
+ }, Mn = ({
2095
2102
  results: e,
2096
2103
  onQueryChange: t,
2097
2104
  onSelect: r,
@@ -2100,38 +2107,38 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2100
2107
  debounceMs: i = 200,
2101
2108
  className: a
2102
2109
  }) => {
2103
- const [u, c] = P(""), [l, f] = P(!1), [d, m] = P(0), w = _(null), b = _(null), p = B(() => n || [...new Set(e.map((v) => v.category))], [n, e]), h = B(
2104
- () => p.flatMap((v) => e.filter((N) => N.category === v)),
2105
- [p, e]
2110
+ const [d, c] = A(""), [l, p] = A(!1), [u, m] = A(0), v = _(null), b = _(null), f = B(() => n || [...new Set(e.map((w) => w.category))], [n, e]), h = B(
2111
+ () => f.flatMap((w) => e.filter((N) => N.category === w)),
2112
+ [f, e]
2106
2113
  );
2107
- R(() => {
2108
- const v = (N) => {
2109
- w.current && !w.current.contains(N.target) && f(!1);
2114
+ F(() => {
2115
+ const w = (N) => {
2116
+ v.current && !v.current.contains(N.target) && p(!1);
2110
2117
  };
2111
- return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
2112
- }, []), R(() => {
2118
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
2119
+ }, []), F(() => {
2113
2120
  if (!t) return;
2114
- const v = window.setTimeout(() => t(u), i);
2115
- return () => window.clearTimeout(v);
2116
- }, [u, i, t]), R(() => {
2121
+ const w = window.setTimeout(() => t(d), i);
2122
+ return () => window.clearTimeout(w);
2123
+ }, [d, i, t]), F(() => {
2117
2124
  m(0);
2118
2125
  }, [e]);
2119
- const y = (v) => {
2120
- r(v), f(!1), c("");
2121
- }, E = (v) => {
2126
+ const y = (w) => {
2127
+ r(w), p(!1), c("");
2128
+ }, k = (w) => {
2122
2129
  var N;
2123
2130
  if (!l) {
2124
- (v.key === "ArrowDown" || v.key === "Enter") && f(!0);
2131
+ (w.key === "ArrowDown" || w.key === "Enter") && p(!0);
2125
2132
  return;
2126
2133
  }
2127
- v.key === "ArrowDown" ? (v.preventDefault(), m((C) => h.length ? (C + 1) % h.length : 0)) : v.key === "ArrowUp" ? (v.preventDefault(), m(
2128
- (C) => h.length ? (C - 1 + h.length) % h.length : 0
2129
- )) : v.key === "Enter" ? (v.preventDefault(), h[d] && y(h[d])) : v.key === "Escape" && (v.preventDefault(), f(!1), (N = b.current) == null || N.blur());
2134
+ w.key === "ArrowDown" ? (w.preventDefault(), m((L) => h.length ? (L + 1) % h.length : 0)) : w.key === "ArrowUp" ? (w.preventDefault(), m(
2135
+ (L) => h.length ? (L - 1 + h.length) % h.length : 0
2136
+ )) : w.key === "Enter" ? (w.preventDefault(), h[u] && y(h[u])) : w.key === "Escape" && (w.preventDefault(), p(!1), (N = b.current) == null || N.blur());
2130
2137
  };
2131
- return /* @__PURE__ */ x("div", { ref: w, className: I("relative w-full", a), children: [
2138
+ return /* @__PURE__ */ x("div", { ref: v, className: P("relative w-full", a), children: [
2132
2139
  /* @__PURE__ */ x("div", { className: "relative flex items-center", children: [
2133
2140
  /* @__PURE__ */ o(
2134
- xe,
2141
+ ge,
2135
2142
  {
2136
2143
  size: 13,
2137
2144
  className: "absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"
@@ -2145,23 +2152,23 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2145
2152
  role: "combobox",
2146
2153
  "aria-expanded": l,
2147
2154
  "aria-label": s,
2148
- value: u,
2155
+ value: d,
2149
2156
  placeholder: s,
2150
- onChange: (v) => {
2151
- c(v.target.value), f(!0);
2157
+ onChange: (w) => {
2158
+ c(w.target.value), p(!0);
2152
2159
  },
2153
- onFocus: () => f(!0),
2154
- onKeyDown: E,
2160
+ onFocus: () => p(!0),
2161
+ onKeyDown: k,
2155
2162
  className: "w-full h-7 pl-8 pr-7 bg-secondary/35 border border-border/40 rounded-md text-xs text-foreground placeholder:text-muted-foreground/75 focus:outline-none focus:ring-1 focus:ring-primary/40 focus:bg-background/95 focus:border-primary/50 transition-all font-sans"
2156
2163
  }
2157
2164
  ),
2158
- u && /* @__PURE__ */ o(
2165
+ d && /* @__PURE__ */ o(
2159
2166
  "button",
2160
2167
  {
2161
2168
  type: "button",
2162
2169
  onClick: () => {
2163
- var v;
2164
- c(""), (v = b.current) == null || v.focus();
2170
+ var w;
2171
+ c(""), (w = b.current) == null || w.focus();
2165
2172
  },
2166
2173
  "aria-label": "Clear search",
2167
2174
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
@@ -2169,7 +2176,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2169
2176
  }
2170
2177
  )
2171
2178
  ] }),
2172
- l && u.trim() && /* @__PURE__ */ x(
2179
+ l && d.trim() && /* @__PURE__ */ x(
2173
2180
  "div",
2174
2181
  {
2175
2182
  role: "listbox",
@@ -2177,46 +2184,46 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2177
2184
  children: [
2178
2185
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto py-1", children: h.length === 0 ? /* @__PURE__ */ x("div", { className: "px-4 py-6 text-center text-xs text-muted-foreground italic", children: [
2179
2186
  'No results found matching "',
2180
- u,
2187
+ d,
2181
2188
  '"'
2182
- ] }) : p.map((v) => {
2183
- const N = e.filter((C) => C.category === v);
2189
+ ] }) : f.map((w) => {
2190
+ const N = e.filter((L) => L.category === w);
2184
2191
  return N.length === 0 ? null : /* @__PURE__ */ x("div", { className: "flex flex-col", children: [
2185
- /* @__PURE__ */ o("div", { className: "px-3 py-1 text-[9px] font-bold uppercase tracking-wider text-muted-foreground/80 bg-muted/40 border-y border-border/20 first:border-t-0", children: v }),
2186
- N.map((C) => {
2187
- const L = C.icon, A = h.indexOf(C), k = A === d;
2192
+ /* @__PURE__ */ o("div", { className: "px-3 py-1 text-[9px] font-bold uppercase tracking-wider text-muted-foreground/80 bg-muted/40 border-y border-border/20 first:border-t-0", children: w }),
2193
+ N.map((L) => {
2194
+ const T = L.icon, M = h.indexOf(L), I = M === u;
2188
2195
  return /* @__PURE__ */ x(
2189
2196
  "div",
2190
2197
  {
2191
2198
  role: "option",
2192
- "aria-selected": k,
2193
- onClick: () => y(C),
2194
- onMouseEnter: () => m(A),
2195
- className: I(
2199
+ "aria-selected": I,
2200
+ onClick: () => y(L),
2201
+ onMouseEnter: () => m(M),
2202
+ className: P(
2196
2203
  "px-3 py-2 cursor-pointer flex items-start space-x-2.5 transition-colors border-l-2",
2197
- k ? "bg-accent text-accent-foreground border-primary" : "border-transparent hover:bg-accent/40"
2204
+ I ? "bg-accent text-accent-foreground border-primary" : "border-transparent hover:bg-accent/40"
2198
2205
  ),
2199
2206
  children: [
2200
- L && /* @__PURE__ */ o(
2207
+ T && /* @__PURE__ */ o(
2201
2208
  "div",
2202
2209
  {
2203
- className: I(
2210
+ className: P(
2204
2211
  "mt-0.5 p-1 rounded bg-muted/50",
2205
- k && "bg-background text-primary"
2212
+ I && "bg-background text-primary"
2206
2213
  ),
2207
- children: /* @__PURE__ */ o(L, { size: 12 })
2214
+ children: /* @__PURE__ */ o(T, { size: 12 })
2208
2215
  }
2209
2216
  ),
2210
2217
  /* @__PURE__ */ x("div", { className: "flex-1 min-w-0", children: [
2211
- /* @__PURE__ */ o("div", { className: "text-xs font-medium truncate", children: C.title }),
2212
- C.description && /* @__PURE__ */ o("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5", children: C.description })
2218
+ /* @__PURE__ */ o("div", { className: "text-xs font-medium truncate", children: L.title }),
2219
+ L.description && /* @__PURE__ */ o("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5", children: L.description })
2213
2220
  ] })
2214
2221
  ]
2215
2222
  },
2216
- `${C.category}-${C.id}`
2223
+ `${L.category}-${L.id}`
2217
2224
  );
2218
2225
  })
2219
- ] }, v);
2226
+ ] }, w);
2220
2227
  }) }),
2221
2228
  h.length > 0 && /* @__PURE__ */ x("div", { className: "px-3 py-1.5 border-t border-border bg-muted/20 flex items-center justify-between text-[9px] text-muted-foreground select-none shrink-0 font-mono", children: [
2222
2229
  /* @__PURE__ */ x("div", { className: "flex space-x-2", children: [
@@ -2237,7 +2244,7 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2237
2244
  }
2238
2245
  )
2239
2246
  ] });
2240
- }, In = ({
2247
+ }, Cn = ({
2241
2248
  placeholder: e = "Search...",
2242
2249
  onSearch: t,
2243
2250
  results: r,
@@ -2246,37 +2253,37 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2246
2253
  loading: i = !1,
2247
2254
  className: a
2248
2255
  }) => {
2249
- const [u, c] = P(""), [l, f] = P(!1), [d, m] = P(-1), w = _(null);
2250
- R(() => {
2256
+ const [d, c] = A(""), [l, p] = A(!1), [u, m] = A(-1), v = _(null);
2257
+ F(() => {
2251
2258
  const h = setTimeout(() => {
2252
- t(u);
2259
+ t(d);
2253
2260
  }, 300);
2254
2261
  return () => clearTimeout(h);
2255
- }, [u, t]);
2262
+ }, [d, t]);
2256
2263
  const b = s.filter(
2257
- (h) => h.toLowerCase().includes(u.toLowerCase()) && h.toLowerCase() !== u.toLowerCase()
2258
- ), p = (h) => {
2259
- l && b.length > 0 && (h.key === "ArrowDown" ? (h.preventDefault(), m((y) => (y + 1) % b.length)) : h.key === "ArrowUp" ? (h.preventDefault(), m((y) => (y - 1 + b.length) % b.length)) : h.key === "Enter" && d >= 0 && (h.preventDefault(), c(b[d]), f(!1)));
2264
+ (h) => h.toLowerCase().includes(d.toLowerCase()) && h.toLowerCase() !== d.toLowerCase()
2265
+ ), f = (h) => {
2266
+ l && b.length > 0 && (h.key === "ArrowDown" ? (h.preventDefault(), m((y) => (y + 1) % b.length)) : h.key === "ArrowUp" ? (h.preventDefault(), m((y) => (y - 1 + b.length) % b.length)) : h.key === "Enter" && u >= 0 && (h.preventDefault(), c(b[u]), p(!1)));
2260
2267
  };
2261
- return /* @__PURE__ */ x("div", { ref: w, className: I("flex flex-col h-full bg-background", a), children: [
2268
+ return /* @__PURE__ */ x("div", { ref: v, className: P("flex flex-col h-full bg-background", a), children: [
2262
2269
  /* @__PURE__ */ x("div", { className: "p-3 border-b border-border/50", children: [
2263
2270
  /* @__PURE__ */ x("div", { className: "relative", children: [
2264
- /* @__PURE__ */ o("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: i ? /* @__PURE__ */ o(We, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ o(xe, { size: 14 }) }),
2271
+ /* @__PURE__ */ o("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: i ? /* @__PURE__ */ o(Ye, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ o(ge, { size: 14 }) }),
2265
2272
  /* @__PURE__ */ o(
2266
2273
  "input",
2267
2274
  {
2268
2275
  type: "text",
2269
2276
  className: "w-full bg-secondary/50 border border-border rounded-md pl-9 pr-8 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all",
2270
2277
  placeholder: e,
2271
- value: u,
2278
+ value: d,
2272
2279
  onChange: (h) => {
2273
- c(h.target.value), f(!0), m(-1);
2280
+ c(h.target.value), p(!0), m(-1);
2274
2281
  },
2275
- onKeyDown: p,
2276
- onFocus: () => f(!0)
2282
+ onKeyDown: f,
2283
+ onFocus: () => p(!0)
2277
2284
  }
2278
2285
  ),
2279
- u && /* @__PURE__ */ o(
2286
+ d && /* @__PURE__ */ o(
2280
2287
  "button",
2281
2288
  {
2282
2289
  onClick: () => {
@@ -2290,22 +2297,22 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2290
2297
  l && b.length > 0 && /* @__PURE__ */ o("div", { className: "absolute left-3 right-3 mt-1 bg-popover border shadow-lg rounded-md z-50 py-1 overflow-hidden", children: b.map((h, y) => /* @__PURE__ */ x(
2291
2298
  "div",
2292
2299
  {
2293
- className: I(
2300
+ className: P(
2294
2301
  "px-3 py-1.5 text-xs cursor-pointer flex items-center space-x-2",
2295
- y === d ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
2302
+ y === u ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
2296
2303
  ),
2297
2304
  onClick: () => {
2298
- c(h), f(!1);
2305
+ c(h), p(!1);
2299
2306
  },
2300
2307
  children: [
2301
- /* @__PURE__ */ o(Rt, { size: 12, className: "text-muted-foreground" }),
2308
+ /* @__PURE__ */ o(Ot, { size: 12, className: "text-muted-foreground" }),
2302
2309
  /* @__PURE__ */ o("span", { children: h })
2303
2310
  ]
2304
2311
  },
2305
2312
  h
2306
2313
  )) })
2307
2314
  ] }),
2308
- /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto", children: r.length === 0 ? /* @__PURE__ */ o("div", { className: "p-8 text-center text-xs text-muted-foreground italic", children: u ? `No results found for "${u}"` : "Type to start searching..." }) : /* @__PURE__ */ o("div", { className: "py-2", children: r.map((h) => {
2315
+ /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto", children: r.length === 0 ? /* @__PURE__ */ o("div", { className: "p-8 text-center text-xs text-muted-foreground italic", children: d ? `No results found for "${d}"` : "Type to start searching..." }) : /* @__PURE__ */ o("div", { className: "py-2", children: r.map((h) => {
2309
2316
  const y = h.icon;
2310
2317
  return /* @__PURE__ */ o(
2311
2318
  "div",
@@ -2327,11 +2334,11 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2327
2334
  );
2328
2335
  }) }) })
2329
2336
  ] });
2330
- }, lt = (e, t = 0) => e.reduce((r, n) => (r.push({ ...n, level: t }), n.isOpen && n.children && r.push(...lt(n.children, t + 1)), r), []), Dr = (e) => {
2337
+ }, ct = (e, t = 0) => e.reduce((r, n) => (r.push({ ...n, level: t }), n.isOpen && n.children && r.push(...ct(n.children, t + 1)), r), []), Ir = (e) => {
2331
2338
  if (!e) return ["background"];
2332
2339
  const t = [e.isBranch ? "branch" : "leaf"];
2333
2340
  return e.kind && t.push(e.kind), t;
2334
- }, Mn = ({
2341
+ }, An = ({
2335
2342
  data: e,
2336
2343
  onToggle: t,
2337
2344
  onActivate: r,
@@ -2339,124 +2346,124 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2339
2346
  actions: s = [],
2340
2347
  indent: i = 12,
2341
2348
  virtualized: a = !0,
2342
- "aria-label": u = "Tree",
2349
+ "aria-label": d = "Tree",
2343
2350
  className: c
2344
2351
  }) => {
2345
- const [l, f] = P(null), [d, m] = P(null), w = B(() => lt(e), [e]);
2346
- R(() => {
2352
+ const [l, p] = A(null), [u, m] = A(null), v = B(() => ct(e), [e]);
2353
+ F(() => {
2347
2354
  m(null);
2348
2355
  }, [e]);
2349
2356
  const b = s.filter(
2350
- (y) => !y.showFor || l && y.showFor.some((E) => l.scopes.includes(E))
2357
+ (y) => !y.showFor || l && y.showFor.some((k) => l.scopes.includes(k))
2351
2358
  ).map((y) => ({
2352
2359
  label: y.label,
2353
2360
  icon: y.icon,
2354
2361
  divider: y.divider,
2355
2362
  onClick: () => l && y.onSelect(l.context)
2356
- })), p = (y, E) => {
2357
- s.length !== 0 && (y.preventDefault(), y.stopPropagation(), f({
2363
+ })), f = (y, k) => {
2364
+ s.length !== 0 && (y.preventDefault(), y.stopPropagation(), p({
2358
2365
  x: y.clientX,
2359
2366
  y: y.clientY,
2360
- scopes: Dr(E),
2361
- context: { nodeId: (E == null ? void 0 : E.id) ?? null, node: E }
2367
+ scopes: Ir(k),
2368
+ context: { nodeId: (k == null ? void 0 : k.id) ?? null, node: k }
2362
2369
  }));
2363
2370
  }, h = (y) => {
2364
- const E = w[y], v = !!E.isBranch;
2371
+ const k = v[y], w = !!k.isBranch;
2365
2372
  return /* @__PURE__ */ x(
2366
2373
  "div",
2367
2374
  {
2368
2375
  role: "treeitem",
2369
- "aria-expanded": v ? !!E.isOpen : void 0,
2370
- "aria-level": E.level + 1,
2376
+ "aria-expanded": w ? !!k.isOpen : void 0,
2377
+ "aria-level": k.level + 1,
2371
2378
  tabIndex: 0,
2372
2379
  draggable: !0,
2373
2380
  onDragStart: (N) => {
2374
- N.dataTransfer.setData("text/plain", E.id), N.dataTransfer.effectAllowed = "move";
2381
+ N.dataTransfer.setData("text/plain", k.id), N.dataTransfer.effectAllowed = "move";
2375
2382
  },
2376
2383
  onDragOver: (N) => {
2377
- v && (N.preventDefault(), m(E.id));
2384
+ w && (N.preventDefault(), m(k.id));
2378
2385
  },
2379
2386
  onDragLeave: () => m(null),
2380
2387
  onDrop: (N) => {
2381
2388
  N.preventDefault(), m(null);
2382
- const C = N.dataTransfer.getData("text/plain");
2383
- C && C !== E.id && v && (n == null || n(C, E.id));
2389
+ const L = N.dataTransfer.getData("text/plain");
2390
+ L && L !== k.id && w && (n == null || n(L, k.id));
2384
2391
  },
2385
- onClick: () => v && (t == null ? void 0 : t(E)),
2386
- onDoubleClick: () => r == null ? void 0 : r(E),
2392
+ onClick: () => w && (t == null ? void 0 : t(k)),
2393
+ onDoubleClick: () => r == null ? void 0 : r(k),
2387
2394
  onKeyDown: (N) => {
2388
- N.key === "Enter" && (N.preventDefault(), v ? t == null || t(E) : r == null || r(E));
2395
+ N.key === "Enter" && (N.preventDefault(), w ? t == null || t(k) : r == null || r(k));
2389
2396
  },
2390
- onContextMenu: (N) => p(N, E),
2391
- style: { paddingLeft: `${E.level * i + 8}px` },
2392
- className: I(
2397
+ onContextMenu: (N) => f(N, k),
2398
+ style: { paddingLeft: `${k.level * i + 8}px` },
2399
+ className: P(
2393
2400
  "flex items-center py-1 px-2 cursor-pointer hover:bg-accent hover:text-accent-foreground select-none text-xs",
2394
2401
  "transition-colors duration-150 relative focus:outline-none focus:ring-1 focus:ring-ring",
2395
- d === E.id && "bg-primary/20 ring-1 ring-primary/50 rounded-sm",
2396
- E.className
2402
+ u === k.id && "bg-primary/20 ring-1 ring-primary/50 rounded-sm",
2403
+ k.className
2397
2404
  ),
2398
2405
  children: [
2399
- /* @__PURE__ */ o("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children: v && (E.isOpen ? /* @__PURE__ */ o(Ge, { size: 14 }) : /* @__PURE__ */ o(Be, { size: 14 })) }),
2400
- E.icon && /* @__PURE__ */ o("div", { className: "mr-2 flex items-center shrink-0", children: E.icon }),
2401
- /* @__PURE__ */ o("span", { className: "truncate", children: E.label })
2406
+ /* @__PURE__ */ o("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children: w && (k.isOpen ? /* @__PURE__ */ o(Je, { size: 14 }) : /* @__PURE__ */ o(je, { size: 14 })) }),
2407
+ k.icon && /* @__PURE__ */ o("div", { className: "mr-2 flex items-center shrink-0", children: k.icon }),
2408
+ /* @__PURE__ */ o("span", { className: "truncate", children: k.label })
2402
2409
  ]
2403
2410
  },
2404
- E.id
2411
+ k.id
2405
2412
  );
2406
2413
  };
2407
2414
  return /* @__PURE__ */ x(
2408
2415
  "div",
2409
2416
  {
2410
2417
  role: "tree",
2411
- "aria-label": u,
2412
- className: I("h-full w-full bg-muted/30", c),
2413
- onContextMenu: (y) => p(y, null),
2418
+ "aria-label": d,
2419
+ className: P("h-full w-full bg-muted/30", c),
2420
+ onContextMenu: (y) => f(y, null),
2414
2421
  children: [
2415
2422
  a ? /* @__PURE__ */ o(
2416
- Kt,
2423
+ Ut,
2417
2424
  {
2418
2425
  style: { height: "100%" },
2419
- totalCount: w.length,
2426
+ totalCount: v.length,
2420
2427
  itemContent: h
2421
2428
  }
2422
- ) : /* @__PURE__ */ o("div", { className: "h-full overflow-auto", children: w.map((y, E) => h(E)) }),
2429
+ ) : /* @__PURE__ */ o("div", { className: "h-full overflow-auto", children: v.map((y, k) => h(k)) }),
2423
2430
  l && b.length > 0 && /* @__PURE__ */ o(
2424
- Tr,
2431
+ Lr,
2425
2432
  {
2426
2433
  x: l.x,
2427
2434
  y: l.y,
2428
2435
  items: b,
2429
- onClose: () => f(null)
2436
+ onClose: () => p(null)
2430
2437
  }
2431
2438
  )
2432
2439
  ]
2433
2440
  }
2434
2441
  );
2435
- }, ge = { width: 180, height: 72 }, ct = { x: 0, y: 0, scale: 1 }, j = (e) => {
2442
+ }, he = { width: 180, height: 72 }, dt = { x: 0, y: 0, scale: 1 }, j = (e) => {
2436
2443
  var t, r;
2437
2444
  return {
2438
2445
  x: e.position.x,
2439
2446
  y: e.position.y,
2440
- width: ((t = e.size) == null ? void 0 : t.width) ?? ge.width,
2441
- height: ((r = e.size) == null ? void 0 : r.height) ?? ge.height
2447
+ width: ((t = e.size) == null ? void 0 : t.width) ?? he.width,
2448
+ height: ((r = e.size) == null ? void 0 : r.height) ?? he.height
2442
2449
  };
2443
2450
  }, J = (e) => ({
2444
2451
  x: e.x + e.width / 2,
2445
2452
  y: e.y + e.height / 2
2446
- }), Ne = (e, t) => ({
2453
+ }), we = (e, t) => ({
2447
2454
  x: (e.x - t.x) / t.scale,
2448
2455
  y: (e.y - t.y) / t.scale
2449
- }), Cn = (e, t) => ({
2456
+ }), $n = (e, t) => ({
2450
2457
  x: e.x * t.scale + t.x,
2451
2458
  y: e.y * t.scale + t.y
2452
- }), ze = (e, t, r) => {
2453
- const n = Ne(t, e);
2459
+ }), _e = (e, t, r) => {
2460
+ const n = we(t, e);
2454
2461
  return {
2455
2462
  scale: r,
2456
2463
  x: t.x - n.x * r,
2457
2464
  y: t.y - n.y * r
2458
2465
  };
2459
- }, ke = (e, t = 0.1, r = 4) => Math.min(r, Math.max(t, e)), Oe = (e, t) => {
2466
+ }, Ne = (e, t = 0.1, r = 4) => Math.min(r, Math.max(t, e)), Ke = (e, t) => {
2460
2467
  const r = J(e);
2461
2468
  switch (t) {
2462
2469
  case "top":
@@ -2468,25 +2475,25 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2468
2475
  case "right":
2469
2476
  return { x: e.x + e.width, y: r.y };
2470
2477
  }
2471
- }, Sr = (e, t) => {
2478
+ }, Pr = (e, t) => {
2472
2479
  const r = J(e), n = J(t), s = n.x - r.x, i = n.y - r.y;
2473
2480
  return Math.abs(s) >= Math.abs(i) ? s >= 0 ? { source: "right", target: "left" } : { source: "left", target: "right" } : i >= 0 ? { source: "bottom", target: "top" } : { source: "top", target: "bottom" };
2474
- }, dt = (e) => {
2481
+ }, ut = (e) => {
2475
2482
  if (e.length === 0) return null;
2476
2483
  const t = e.map(j), r = Math.min(...t.map((a) => a.x)), n = Math.min(...t.map((a) => a.y)), s = Math.max(...t.map((a) => a.x + a.width)), i = Math.max(...t.map((a) => a.y + a.height));
2477
2484
  return { x: r, y: n, width: s - r, height: i - n };
2478
- }, Lr = (e, t) => ({
2485
+ }, Sr = (e, t) => ({
2479
2486
  // Written as a subtraction rather than `-viewport.x / scale` so a pan of zero
2480
2487
  // yields +0 rather than -0, which otherwise leaks into equality checks.
2481
2488
  x: (0 - e.x) / e.scale,
2482
2489
  y: (0 - e.y) / e.scale,
2483
2490
  width: t.width / e.scale,
2484
2491
  height: t.height / e.scale
2485
- }), _e = (e, t, r) => ({
2492
+ }), Ue = (e, t, r) => ({
2486
2493
  scale: r,
2487
2494
  x: t.width / 2 - e.x * r,
2488
2495
  y: t.height / 2 - e.y * r
2489
- }), Ir = (e, t) => {
2496
+ }), Mr = (e, t) => {
2490
2497
  const r = Math.min(e.x, t.x), n = Math.min(e.y, t.y);
2491
2498
  return {
2492
2499
  x: r,
@@ -2494,10 +2501,10 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2494
2501
  width: Math.max(e.x + e.width, t.x + t.width) - r,
2495
2502
  height: Math.max(e.y + e.height, t.y + t.height) - n
2496
2503
  };
2497
- }, Mr = (e, t, r = 48) => {
2498
- const n = dt(e);
2499
- if (!n || t.width === 0 || t.height === 0) return ct;
2500
- const s = ke(
2504
+ }, Cr = (e, t, r = 48) => {
2505
+ const n = ut(e);
2506
+ if (!n || t.width === 0 || t.height === 0) return dt;
2507
+ const s = Ne(
2501
2508
  Math.min(
2502
2509
  (t.width - r * 2) / Math.max(n.width, 1),
2503
2510
  (t.height - r * 2) / Math.max(n.height, 1)
@@ -2508,202 +2515,202 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2508
2515
  x: t.width / 2 - i.x * s,
2509
2516
  y: t.height / 2 - i.y * s
2510
2517
  };
2511
- }, ut = {
2518
+ }, mt = {
2512
2519
  up: { x: 0, y: -1 },
2513
2520
  down: { x: 0, y: 1 },
2514
2521
  left: { x: -1, y: 0 },
2515
2522
  right: { x: 1, y: 0 }
2516
- }, we = (e, t, r) => {
2517
- const n = e.find((u) => u.id === t);
2523
+ }, ve = (e, t, r) => {
2524
+ const n = e.find((d) => d.id === t);
2518
2525
  if (!n) return null;
2519
- const s = J(j(n)), i = ut[r];
2526
+ const s = J(j(n)), i = mt[r];
2520
2527
  let a = null;
2521
- for (const u of e) {
2522
- if (u.id === t) continue;
2523
- const c = J(j(u)), l = c.x - s.x, f = c.y - s.y, d = l * i.x + f * i.y;
2524
- if (d <= 0) continue;
2525
- const m = Math.abs(l * i.y - f * i.x);
2526
- if (m > d * 2) continue;
2527
- const w = d + m * 2;
2528
- (!a || w < a.score) && (a = { node: u, score: w });
2528
+ for (const d of e) {
2529
+ if (d.id === t) continue;
2530
+ const c = J(j(d)), l = c.x - s.x, p = c.y - s.y, u = l * i.x + p * i.y;
2531
+ if (u <= 0) continue;
2532
+ const m = Math.abs(l * i.y - p * i.x);
2533
+ if (m > u * 2) continue;
2534
+ const v = u + m * 2;
2535
+ (!a || v < a.score) && (a = { node: d, score: v });
2529
2536
  }
2530
2537
  return (a == null ? void 0 : a.node) ?? null;
2531
- }, Cr = (e, t, r, n = 64) => {
2538
+ }, Ar = (e, t, r, n = 64) => {
2532
2539
  const s = e.find((l) => l.id === t);
2533
2540
  if (!s) return { x: 0, y: 0 };
2534
- const i = j(s), a = ut[r], u = {
2541
+ const i = j(s), a = mt[r], d = {
2535
2542
  x: a.x * (i.width + n),
2536
2543
  y: a.y * (i.height + n)
2537
2544
  };
2538
- let c = { x: i.x + u.x, y: i.y + u.y };
2545
+ let c = { x: i.x + d.x, y: i.y + d.y };
2539
2546
  for (let l = 0; l < 24; l += 1) {
2540
- const f = { ...c, width: i.width, height: i.height };
2541
- if (!e.some((m) => Ar(j(m), f))) break;
2547
+ const p = { ...c, width: i.width, height: i.height };
2548
+ if (!e.some((m) => $r(j(m), p))) break;
2542
2549
  c = a.x !== 0 ? { x: c.x, y: c.y + i.height + n } : { x: c.x + i.width + n, y: c.y };
2543
2550
  }
2544
2551
  return c;
2545
- }, Ar = (e, t) => e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y, An = (e, t) => e.filter((r) => r.source === t || r.target === t), Pn = (e, t, r) => e.some(
2552
+ }, $r = (e, t) => e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y, Rn = (e, t) => e.filter((r) => r.source === t || r.target === t), Fn = (e, t, r) => e.some(
2546
2553
  (n) => n.source === t && n.target === r || n.source === r && n.target === t
2547
- ), $n = (e, t, r) => ({
2554
+ ), zn = (e, t, r) => ({
2548
2555
  nodes: e.filter((n) => n.id !== r),
2549
2556
  edges: t.filter((n) => n.source !== r && n.target !== r)
2550
- }), Rn = (e, t) => {
2557
+ }), On = (e, t) => {
2551
2558
  let r = t.length + 1;
2552
2559
  const n = new Set(t.map((s) => s.id));
2553
2560
  for (; n.has(`${e}-${r}`); ) r += 1;
2554
2561
  return `${e}-${r}`;
2555
- }, Pr = yt(
2562
+ }, Rr = vt(
2556
2563
  ({
2557
2564
  children: e,
2558
2565
  overlay: t,
2559
2566
  viewport: r,
2560
- defaultViewport: n = ct,
2567
+ defaultViewport: n = dt,
2561
2568
  onViewportChange: s,
2562
2569
  onSizeChange: i,
2563
2570
  onCanvasClick: a,
2564
- onCanvasDoubleClick: u,
2571
+ onCanvasDoubleClick: d,
2565
2572
  onCanvasContextMenu: c,
2566
2573
  onDrop: l,
2567
- grid: f = !0,
2568
- gridSize: d = 24,
2574
+ grid: p = !0,
2575
+ gridSize: u = 24,
2569
2576
  minScale: m = 0.1,
2570
- maxScale: w = 4,
2577
+ maxScale: v = 4,
2571
2578
  pannable: b = !0,
2572
- zoomable: p = !0,
2579
+ zoomable: f = !0,
2573
2580
  "aria-label": h = "Graph canvas",
2574
2581
  className: y
2575
- }, E) => {
2576
- const v = _(null), [N, C] = P(n), [L, A] = P(!1), [k, S] = P(!1), g = r ?? N, T = _(g);
2577
- T.current = g;
2578
- const M = Y(
2579
- (D) => {
2580
- r || C(D), s == null || s(D);
2582
+ }, k) => {
2583
+ const w = _(null), [N, L] = A(n), [T, M] = A(!1), [I, S] = A(!1), g = r ?? N, D = _(g);
2584
+ D.current = g;
2585
+ const C = Y(
2586
+ (E) => {
2587
+ r || L(E), s == null || s(E);
2581
2588
  },
2582
2589
  [r, s]
2583
- ), $ = Y((D) => {
2584
- var F;
2585
- const z = (F = v.current) == null ? void 0 : F.getBoundingClientRect();
2586
- return z ? { x: D.x - z.left, y: D.y - z.top } : D;
2590
+ ), $ = Y((E) => {
2591
+ var R;
2592
+ const z = (R = w.current) == null ? void 0 : R.getBoundingClientRect();
2593
+ return z ? { x: E.x - z.left, y: E.y - z.top } : E;
2587
2594
  }, []);
2588
- R(() => {
2589
- const D = v.current;
2590
- if (!D || !i) return;
2595
+ F(() => {
2596
+ const E = w.current;
2597
+ if (!E || !i) return;
2591
2598
  const z = () => {
2592
- const U = D.getBoundingClientRect();
2599
+ const U = E.getBoundingClientRect();
2593
2600
  i({ width: U.width, height: U.height });
2594
2601
  };
2595
2602
  z();
2596
- const F = new ResizeObserver(z);
2597
- return F.observe(D), () => F.disconnect();
2598
- }, [i]), R(() => {
2599
- const D = v.current;
2600
- if (!D || !p) return;
2601
- const z = (F) => {
2602
- F.preventDefault();
2603
- const U = T.current, W = $({ x: F.clientX, y: F.clientY }), me = F.ctrlKey ? 0.01 : 2e-3, fe = ke(
2604
- U.scale * Math.exp(-F.deltaY * me),
2603
+ const R = new ResizeObserver(z);
2604
+ return R.observe(E), () => R.disconnect();
2605
+ }, [i]), F(() => {
2606
+ const E = w.current;
2607
+ if (!E || !f) return;
2608
+ const z = (R) => {
2609
+ R.preventDefault();
2610
+ const U = D.current, W = $({ x: R.clientX, y: R.clientY }), ue = R.ctrlKey ? 0.01 : 2e-3, me = Ne(
2611
+ U.scale * Math.exp(-R.deltaY * ue),
2605
2612
  m,
2606
- w
2613
+ v
2607
2614
  );
2608
- M(ze(U, W, fe));
2615
+ C(_e(U, W, me));
2609
2616
  };
2610
- return D.addEventListener("wheel", z, { passive: !1 }), () => D.removeEventListener("wheel", z);
2611
- }, [p, m, w, M, $]), R(() => {
2617
+ return E.addEventListener("wheel", z, { passive: !1 }), () => E.removeEventListener("wheel", z);
2618
+ }, [f, m, v, C, $]), F(() => {
2612
2619
  if (!b) return;
2613
- const D = (F) => {
2620
+ const E = (R) => {
2614
2621
  var W;
2615
- if (F.code !== "Space") return;
2616
- const U = F.target;
2617
- U != null && U.closest('input, textarea, [contenteditable="true"]') || (W = v.current) != null && W.contains(document.activeElement) && (F.preventDefault(), S(!0));
2618
- }, z = (F) => {
2619
- F.code === "Space" && S(!1);
2622
+ if (R.code !== "Space") return;
2623
+ const U = R.target;
2624
+ U != null && U.closest('input, textarea, [contenteditable="true"]') || (W = w.current) != null && W.contains(document.activeElement) && (R.preventDefault(), S(!0));
2625
+ }, z = (R) => {
2626
+ R.code === "Space" && S(!1);
2620
2627
  };
2621
- return window.addEventListener("keydown", D), window.addEventListener("keyup", z), () => {
2622
- window.removeEventListener("keydown", D), window.removeEventListener("keyup", z);
2628
+ return window.addEventListener("keydown", E), window.addEventListener("keyup", z), () => {
2629
+ window.removeEventListener("keydown", E), window.removeEventListener("keyup", z);
2623
2630
  };
2624
2631
  }, [b]);
2625
- const K = (D) => {
2632
+ const K = (E) => {
2626
2633
  if (!b) return;
2627
- const z = D.target === D.currentTarget, F = D.button === 1;
2628
- if (!z && !F && !k || D.button !== 0 && !F) return;
2629
- D.preventDefault(), A(!0);
2630
- const U = { x: D.clientX, y: D.clientY }, W = { ...T.current }, me = (Ie) => {
2631
- M({
2634
+ const z = E.target === E.currentTarget, R = E.button === 1;
2635
+ if (!z && !R && !I || E.button !== 0 && !R) return;
2636
+ E.preventDefault(), M(!0);
2637
+ const U = { x: E.clientX, y: E.clientY }, W = { ...D.current }, ue = (Pe) => {
2638
+ C({
2632
2639
  ...W,
2633
- x: W.x + (Ie.clientX - U.x),
2634
- y: W.y + (Ie.clientY - U.y)
2640
+ x: W.x + (Pe.clientX - U.x),
2641
+ y: W.y + (Pe.clientY - U.y)
2635
2642
  });
2636
- }, fe = () => {
2637
- A(!1), window.removeEventListener("pointermove", me), window.removeEventListener("pointerup", fe);
2643
+ }, me = () => {
2644
+ M(!1), window.removeEventListener("pointermove", ue), window.removeEventListener("pointerup", me);
2638
2645
  };
2639
- window.addEventListener("pointermove", me), window.addEventListener("pointerup", fe);
2646
+ window.addEventListener("pointermove", ue), window.addEventListener("pointerup", me);
2640
2647
  };
2641
- vt(
2642
- E,
2648
+ wt(
2649
+ k,
2643
2650
  () => ({
2644
- getViewport: () => T.current,
2645
- setViewport: M,
2646
- fitTo: (D, z) => {
2651
+ getViewport: () => D.current,
2652
+ setViewport: C,
2653
+ fitTo: (E, z) => {
2647
2654
  var U;
2648
- const F = (U = v.current) == null ? void 0 : U.getBoundingClientRect();
2649
- F && M(Mr(D, { width: F.width, height: F.height }, z));
2655
+ const R = (U = w.current) == null ? void 0 : U.getBoundingClientRect();
2656
+ R && C(Cr(E, { width: R.width, height: R.height }, z));
2650
2657
  },
2651
- zoomBy: (D) => {
2658
+ zoomBy: (E) => {
2652
2659
  var W;
2653
- const z = (W = v.current) == null ? void 0 : W.getBoundingClientRect();
2660
+ const z = (W = w.current) == null ? void 0 : W.getBoundingClientRect();
2654
2661
  if (!z) return;
2655
- const F = { x: z.width / 2, y: z.height / 2 }, U = ke(
2656
- T.current.scale * D,
2662
+ const R = { x: z.width / 2, y: z.height / 2 }, U = Ne(
2663
+ D.current.scale * E,
2657
2664
  m,
2658
- w
2665
+ v
2659
2666
  );
2660
- M(ze(T.current, F, U));
2667
+ C(_e(D.current, R, U));
2661
2668
  },
2662
- clientToGraph: (D) => Ne($(D), T.current),
2669
+ clientToGraph: (E) => we($(E), D.current),
2663
2670
  getSize: () => {
2664
2671
  var z;
2665
- const D = (z = v.current) == null ? void 0 : z.getBoundingClientRect();
2666
- return { width: (D == null ? void 0 : D.width) ?? 0, height: (D == null ? void 0 : D.height) ?? 0 };
2672
+ const E = (z = w.current) == null ? void 0 : z.getBoundingClientRect();
2673
+ return { width: (E == null ? void 0 : E.width) ?? 0, height: (E == null ? void 0 : E.height) ?? 0 };
2667
2674
  },
2668
2675
  focus: () => {
2669
- var D;
2670
- return (D = v.current) == null ? void 0 : D.focus();
2676
+ var E;
2677
+ return (E = w.current) == null ? void 0 : E.focus();
2671
2678
  }
2672
2679
  }),
2673
- [M, m, w, $]
2680
+ [C, m, v, $]
2674
2681
  );
2675
- const O = (D) => Ne($({ x: D.clientX, y: D.clientY }), g), H = (D) => D.target === D.currentTarget;
2682
+ const O = (E) => we($({ x: E.clientX, y: E.clientY }), g), H = (E) => E.target === E.currentTarget;
2676
2683
  return /* @__PURE__ */ x(
2677
2684
  "div",
2678
2685
  {
2679
- ref: v,
2686
+ ref: w,
2680
2687
  role: "application",
2681
2688
  "aria-label": h,
2682
2689
  tabIndex: 0,
2683
2690
  onPointerDown: K,
2684
- onClick: (D) => H(D) && (a == null ? void 0 : a(O(D), D)),
2685
- onDoubleClick: (D) => H(D) && (u == null ? void 0 : u(O(D), D)),
2686
- onContextMenu: (D) => {
2687
- !c || !H(D) || (D.preventDefault(), c(O(D), D));
2691
+ onClick: (E) => H(E) && (a == null ? void 0 : a(O(E), E)),
2692
+ onDoubleClick: (E) => H(E) && (d == null ? void 0 : d(O(E), E)),
2693
+ onContextMenu: (E) => {
2694
+ !c || !H(E) || (E.preventDefault(), c(O(E), E));
2688
2695
  },
2689
- onDragOver: (D) => {
2690
- l && (D.preventDefault(), D.dataTransfer.dropEffect = "copy");
2696
+ onDragOver: (E) => {
2697
+ l && (E.preventDefault(), E.dataTransfer.dropEffect = "copy");
2691
2698
  },
2692
- onDrop: (D) => {
2693
- l && (D.preventDefault(), l(O(D), D));
2699
+ onDrop: (E) => {
2700
+ l && (E.preventDefault(), l(O(E), E));
2694
2701
  },
2695
- style: f ? {
2702
+ style: p ? {
2696
2703
  // The grid is painted on the element rather than inside the
2697
2704
  // transformed layer, so it can be infinite without needing a
2698
2705
  // giant element behind it.
2699
2706
  backgroundImage: "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)",
2700
- backgroundSize: `${d * g.scale}px ${d * g.scale}px`,
2707
+ backgroundSize: `${u * g.scale}px ${u * g.scale}px`,
2701
2708
  backgroundPosition: `${g.x}px ${g.y}px`
2702
2709
  } : void 0,
2703
- className: I(
2710
+ className: P(
2704
2711
  "relative w-full h-full overflow-hidden bg-background outline-none",
2705
2712
  "focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset",
2706
- k || L ? "cursor-grabbing" : "cursor-grab",
2713
+ I || T ? "cursor-grabbing" : "cursor-grab",
2707
2714
  y
2708
2715
  ),
2709
2716
  children: [
@@ -2725,13 +2732,13 @@ const ur = /* @__PURE__ */ x("div", { className: "h-full flex flex-col items-cen
2725
2732
  );
2726
2733
  }
2727
2734
  );
2728
- Pr.displayName = "GraphCanvas";
2729
- const $r = ["top", "right", "bottom", "left"], Rr = {
2735
+ Rr.displayName = "GraphCanvas";
2736
+ const Fr = ["top", "right", "bottom", "left"], zr = {
2730
2737
  top: "left-1/2 -translate-x-1/2 -top-1.5",
2731
2738
  bottom: "left-1/2 -translate-x-1/2 -bottom-1.5",
2732
2739
  left: "top-1/2 -translate-y-1/2 -left-1.5",
2733
2740
  right: "top-1/2 -translate-y-1/2 -right-1.5"
2734
- }, Fn = ({
2741
+ }, _n = ({
2735
2742
  node: e,
2736
2743
  children: t,
2737
2744
  onMove: r,
@@ -2739,25 +2746,25 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2739
2746
  onSelect: s,
2740
2747
  onActivate: i,
2741
2748
  onContextMenu: a,
2742
- onConnectStart: u,
2749
+ onConnectStart: d,
2743
2750
  onConnectEnd: c,
2744
2751
  selected: l = !1,
2745
- focused: f = !1,
2746
- ports: d = !0,
2752
+ focused: p = !1,
2753
+ ports: u = !0,
2747
2754
  draggable: m = !0,
2748
- className: w
2755
+ className: v
2749
2756
  }) => {
2750
- var E, v;
2751
- const b = _(!1), p = ((E = e.size) == null ? void 0 : E.width) ?? ge.width, h = ((v = e.size) == null ? void 0 : v.height) ?? ge.height, y = (N) => {
2757
+ var k, w;
2758
+ const b = _(!1), f = ((k = e.size) == null ? void 0 : k.width) ?? he.width, h = ((w = e.size) == null ? void 0 : w.height) ?? he.height, y = (N) => {
2752
2759
  if (!m || !r || N.button !== 0 || N.nativeEvent.shiftKey) return;
2753
2760
  N.stopPropagation(), b.current = !1;
2754
- const C = { x: N.clientX, y: N.clientY }, L = { ...e.position }, A = Fr(N.currentTarget);
2755
- let k = L;
2756
- const S = (T) => {
2757
- const M = (T.clientX - C.x) / A, $ = (T.clientY - C.y) / A;
2758
- (Math.abs(M) > 1 || Math.abs($) > 1) && (b.current = !0), k = { x: L.x + M, y: L.y + $ }, r(e.id, k);
2761
+ const L = { x: N.clientX, y: N.clientY }, T = { ...e.position }, M = Or(N.currentTarget);
2762
+ let I = T;
2763
+ const S = (D) => {
2764
+ const C = (D.clientX - L.x) / M, $ = (D.clientY - L.y) / M;
2765
+ (Math.abs(C) > 1 || Math.abs($) > 1) && (b.current = !0), I = { x: T.x + C, y: T.y + $ }, r(e.id, I);
2759
2766
  }, g = () => {
2760
- b.current && (n == null || n(e.id, k)), window.removeEventListener("pointermove", S), window.removeEventListener("pointerup", g);
2767
+ b.current && (n == null || n(e.id, I)), window.removeEventListener("pointermove", S), window.removeEventListener("pointerup", g);
2761
2768
  };
2762
2769
  window.addEventListener("pointermove", S), window.addEventListener("pointerup", g);
2763
2770
  };
@@ -2772,7 +2779,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2772
2779
  position: "absolute",
2773
2780
  left: e.position.x,
2774
2781
  top: e.position.y,
2775
- width: p,
2782
+ width: f,
2776
2783
  height: h
2777
2784
  },
2778
2785
  onPointerDown: y,
@@ -2786,32 +2793,32 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2786
2793
  a && (N.preventDefault(), N.stopPropagation(), a(e.id, { x: N.clientX, y: N.clientY }, N));
2787
2794
  },
2788
2795
  onPointerUp: () => c == null ? void 0 : c(e.id),
2789
- className: I(
2796
+ className: P(
2790
2797
  "group rounded-lg border bg-card text-card-foreground shadow-sm select-none",
2791
2798
  "flex flex-col overflow-hidden transition-shadow",
2792
2799
  m && r && "cursor-grab active:cursor-grabbing",
2793
2800
  l ? "border-primary shadow-md" : "border-border",
2794
2801
  // Focus is the keyboard cursor: it must be visible even when the node
2795
2802
  // is also selected, so it gets a ring rather than a border change.
2796
- f && "ring-2 ring-ring ring-offset-1 ring-offset-background",
2797
- w
2803
+ p && "ring-2 ring-ring ring-offset-1 ring-offset-background",
2804
+ v
2798
2805
  ),
2799
2806
  children: [
2800
2807
  t,
2801
- d && u && $r.map((N) => /* @__PURE__ */ o(
2808
+ u && d && Fr.map((N) => /* @__PURE__ */ o(
2802
2809
  "button",
2803
2810
  {
2804
2811
  type: "button",
2805
2812
  tabIndex: -1,
2806
2813
  "aria-label": `Connect from ${N}`,
2807
- onPointerDown: (C) => {
2808
- C.stopPropagation(), u(e.id, N);
2814
+ onPointerDown: (L) => {
2815
+ L.stopPropagation(), d(e.id, N);
2809
2816
  },
2810
- className: I(
2817
+ className: P(
2811
2818
  "absolute w-3 h-3 rounded-full border-2 border-background bg-primary",
2812
2819
  "opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-opacity",
2813
- f && "opacity-100",
2814
- Rr[N]
2820
+ p && "opacity-100",
2821
+ zr[N]
2815
2822
  )
2816
2823
  },
2817
2824
  N
@@ -2819,7 +2826,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2819
2826
  ]
2820
2827
  }
2821
2828
  );
2822
- }, Fr = (e) => {
2829
+ }, Or = (e) => {
2823
2830
  let t = e.parentElement;
2824
2831
  for (; t; ) {
2825
2832
  const r = window.getComputedStyle(t).transform;
@@ -2830,7 +2837,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2830
2837
  t = t.parentElement;
2831
2838
  }
2832
2839
  return 1;
2833
- }, zr = (e, t, r, n) => {
2840
+ }, _r = (e, t, r, n) => {
2834
2841
  if (n === "straight")
2835
2842
  return `M ${e.x} ${e.y} L ${t.x} ${t.y}`;
2836
2843
  const s = r === "left" || r === "right";
@@ -2838,9 +2845,9 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2838
2845
  const l = s ? (e.x + t.x) / 2 : (e.y + t.y) / 2;
2839
2846
  return s ? `M ${e.x} ${e.y} L ${l} ${e.y} L ${l} ${t.y} L ${t.x} ${t.y}` : `M ${e.x} ${e.y} L ${e.x} ${l} L ${t.x} ${l} L ${t.x} ${t.y}`;
2840
2847
  }
2841
- const i = Math.hypot(t.x - e.x, t.y - e.y), a = Math.min(Math.max(i / 2, 24), 160), u = s ? { x: e.x + (r === "right" ? a : -a), y: e.y } : { x: e.x, y: e.y + (r === "bottom" ? a : -a) }, c = s ? { x: t.x - (r === "right" ? a : -a), y: t.y } : { x: t.x, y: t.y - (r === "bottom" ? a : -a) };
2842
- return `M ${e.x} ${e.y} C ${u.x} ${u.y}, ${c.x} ${c.y}, ${t.x} ${t.y}`;
2843
- }, zn = ({
2848
+ const i = Math.hypot(t.x - e.x, t.y - e.y), a = Math.min(Math.max(i / 2, 24), 160), d = s ? { x: e.x + (r === "right" ? a : -a), y: e.y } : { x: e.x, y: e.y + (r === "bottom" ? a : -a) }, c = s ? { x: t.x - (r === "right" ? a : -a), y: t.y } : { x: t.x, y: t.y - (r === "bottom" ? a : -a) };
2849
+ return `M ${e.x} ${e.y} C ${d.x} ${d.y}, ${c.x} ${c.y}, ${t.x} ${t.y}`;
2850
+ }, Kn = ({
2844
2851
  edge: e,
2845
2852
  source: t,
2846
2853
  target: r,
@@ -2848,20 +2855,20 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2848
2855
  selected: s = !1,
2849
2856
  arrow: i = !0,
2850
2857
  onSelect: a,
2851
- onContextMenu: u,
2858
+ onContextMenu: d,
2852
2859
  className: c
2853
2860
  }) => {
2854
- const l = j(t), f = j(r), d = Sr(l, f), m = Oe(l, d.source), w = Oe(f, d.target), b = zr(m, w, d.source, n), p = { x: (m.x + w.x) / 2, y: (m.y + w.y) / 2 }, h = !!(a || u);
2861
+ const l = j(t), p = j(r), u = Pr(l, p), m = Ke(l, u.source), v = Ke(p, u.target), b = _r(m, v, u.source, n), f = { x: (m.x + v.x) / 2, y: (m.y + v.y) / 2 }, h = !!(a || d);
2855
2862
  return /* @__PURE__ */ x(
2856
2863
  "g",
2857
2864
  {
2858
2865
  "data-graph-edge": e.id,
2859
- className: I(h && "cursor-pointer"),
2866
+ className: P(h && "cursor-pointer"),
2860
2867
  onClick: (y) => {
2861
2868
  a && (y.stopPropagation(), a(e.id, y));
2862
2869
  },
2863
2870
  onContextMenu: (y) => {
2864
- u && (y.preventDefault(), y.stopPropagation(), u(e.id, { x: y.clientX, y: y.clientY }, y));
2871
+ d && (y.preventDefault(), y.stopPropagation(), d(e.id, { x: y.clientX, y: y.clientY }, y));
2865
2872
  },
2866
2873
  children: [
2867
2874
  h && /* @__PURE__ */ o("path", { d: b, fill: "none", stroke: "transparent", strokeWidth: 16 }),
@@ -2872,7 +2879,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2872
2879
  fill: "none",
2873
2880
  strokeWidth: s ? 2.5 : 1.5,
2874
2881
  markerEnd: i ? "url(#nexus-graph-arrow)" : void 0,
2875
- className: I(
2882
+ className: P(
2876
2883
  "transition-[stroke]",
2877
2884
  s ? "stroke-primary" : "stroke-border",
2878
2885
  c
@@ -2882,8 +2889,8 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2882
2889
  e.label && /* @__PURE__ */ o(
2883
2890
  "text",
2884
2891
  {
2885
- x: p.x,
2886
- y: p.y,
2892
+ x: f.x,
2893
+ y: f.y,
2887
2894
  textAnchor: "middle",
2888
2895
  dominantBaseline: "middle",
2889
2896
  className: "fill-muted-foreground text-[10px] font-medium select-none",
@@ -2894,14 +2901,14 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2894
2901
  ]
2895
2902
  }
2896
2903
  );
2897
- }, On = ({ children: e, className: t }) => /* @__PURE__ */ x(
2904
+ }, Un = ({ children: e, className: t }) => /* @__PURE__ */ x(
2898
2905
  "svg",
2899
2906
  {
2900
2907
  style: { position: "absolute", left: -5e4, top: -5e4, overflow: "visible" },
2901
2908
  width: 1e5,
2902
2909
  height: 1e5,
2903
2910
  viewBox: "-50000 -50000 100000 100000",
2904
- className: I("pointer-events-none [&_g]:pointer-events-auto", t),
2911
+ className: P("pointer-events-none [&_g]:pointer-events-auto", t),
2905
2912
  children: [
2906
2913
  /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(
2907
2914
  "marker",
@@ -2919,7 +2926,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2919
2926
  e
2920
2927
  ]
2921
2928
  }
2922
- ), _n = {
2929
+ ), Bn = {
2923
2930
  /** Move focus to the nearest node in a direction. */
2924
2931
  moveFocus: ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"],
2925
2932
  /** Create a connected node in a direction. */
@@ -2934,12 +2941,12 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2934
2941
  connect: "c",
2935
2942
  /** Nudge the focused node. Held with the arrow keys. */
2936
2943
  nudgeModifier: "shiftKey"
2937
- }, Or = {
2944
+ }, Kr = {
2938
2945
  ArrowUp: "up",
2939
2946
  ArrowDown: "down",
2940
2947
  ArrowLeft: "left",
2941
2948
  ArrowRight: "right"
2942
- }, Kn = ({
2949
+ }, Hn = ({
2943
2950
  nodes: e,
2944
2951
  edges: t,
2945
2952
  focusedId: r,
@@ -2947,145 +2954,145 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
2947
2954
  onFocusChange: s,
2948
2955
  targetRef: i,
2949
2956
  nudgeDistance: a = 16,
2950
- disabled: u = !1,
2957
+ disabled: d = !1,
2951
2958
  onCreateNode: c,
2952
2959
  onConnect: l,
2953
- onDeleteNode: f,
2954
- onMoveNode: d,
2960
+ onDeleteNode: p,
2961
+ onMoveNode: u,
2955
2962
  onEditNode: m
2956
2963
  }) => {
2957
- const [w, b] = P(
2964
+ const [v, b] = A(
2958
2965
  n
2959
- ), [p, h] = P(null), [y, E] = P(null), v = r !== void 0 ? r : w, N = Y(
2960
- (k) => {
2961
- r === void 0 && b(k), s == null || s(k);
2966
+ ), [f, h] = A(null), [y, k] = A(null), w = r !== void 0 ? r : v, N = Y(
2967
+ (I) => {
2968
+ r === void 0 && b(I), s == null || s(I);
2962
2969
  },
2963
2970
  [r, s]
2964
- ), C = _({
2971
+ ), L = _({
2965
2972
  nodes: e,
2966
2973
  edges: t,
2967
- focusedId: v,
2968
- editingId: p,
2974
+ focusedId: w,
2975
+ editingId: f,
2969
2976
  connectingFrom: y
2970
2977
  });
2971
- C.current = { nodes: e, edges: t, focusedId: v, editingId: p, connectingFrom: y };
2972
- const L = Y(
2973
- (k) => {
2974
- const { nodes: S, focusedId: g } = C.current;
2978
+ L.current = { nodes: e, edges: t, focusedId: w, editingId: f, connectingFrom: y };
2979
+ const T = Y(
2980
+ (I) => {
2981
+ const { nodes: S, focusedId: g } = L.current;
2975
2982
  if (S.length === 0) return;
2976
2983
  if (!g) {
2977
2984
  N(S[0].id);
2978
2985
  return;
2979
2986
  }
2980
- const T = we(S, g, k);
2981
- T && N(T.id);
2987
+ const D = ve(S, g, I);
2988
+ D && N(D.id);
2982
2989
  },
2983
2990
  [N]
2984
- ), A = Y(
2985
- (k = "right") => {
2986
- const { nodes: S, focusedId: g } = C.current;
2991
+ ), M = Y(
2992
+ (I = "right") => {
2993
+ const { nodes: S, focusedId: g } = L.current;
2987
2994
  if (!c) return;
2988
- const T = g ? Cr(S, g, k) : { x: 0, y: 0 }, M = c(T, { from: g ?? void 0, direction: k });
2989
- M && (g && (l == null || l(g, M)), N(M), h(M));
2995
+ const D = g ? Ar(S, g, I) : { x: 0, y: 0 }, C = c(D, { from: g ?? void 0, direction: I });
2996
+ C && (g && (l == null || l(g, C)), N(C), h(C));
2990
2997
  },
2991
2998
  [c, l, N]
2992
2999
  );
2993
- return R(() => {
2994
- if (u) return;
2995
- const k = i.current;
2996
- if (!k) return;
3000
+ return F(() => {
3001
+ if (d) return;
3002
+ const I = i.current;
3003
+ if (!I) return;
2997
3004
  const S = (g) => {
2998
- const { focusedId: T, editingId: M, connectingFrom: $ } = C.current;
2999
- if (M) {
3005
+ const { focusedId: D, editingId: C, connectingFrom: $ } = L.current;
3006
+ if (C) {
3000
3007
  g.key === "Escape" && (g.preventDefault(), h(null));
3001
3008
  return;
3002
3009
  }
3003
3010
  const K = g.target;
3004
3011
  if (K != null && K.closest('input, textarea, select, [contenteditable="true"]')) return;
3005
- const O = Or[g.key];
3012
+ const O = Kr[g.key];
3006
3013
  if (O) {
3007
3014
  g.preventDefault();
3008
- const H = C.current.nodes.find((D) => D.id === T);
3009
- if (g.shiftKey && H && d) {
3010
- const D = {
3015
+ const H = L.current.nodes.find((E) => E.id === D);
3016
+ if (g.shiftKey && H && u) {
3017
+ const E = {
3011
3018
  up: { x: 0, y: -a },
3012
3019
  down: { x: 0, y: a },
3013
3020
  left: { x: -a, y: 0 },
3014
3021
  right: { x: a, y: 0 }
3015
3022
  }[O];
3016
- d(H.id, {
3017
- x: H.position.x + D.x,
3018
- y: H.position.y + D.y
3023
+ u(H.id, {
3024
+ x: H.position.x + E.x,
3025
+ y: H.position.y + E.y
3019
3026
  });
3020
3027
  return;
3021
3028
  }
3022
- L(O);
3029
+ T(O);
3023
3030
  return;
3024
3031
  }
3025
3032
  switch (g.key) {
3026
3033
  case "Tab": {
3027
3034
  if (!c) return;
3028
- g.preventDefault(), A(g.shiftKey ? "left" : "right");
3035
+ g.preventDefault(), M(g.shiftKey ? "left" : "right");
3029
3036
  return;
3030
3037
  }
3031
3038
  case "Enter": {
3032
- if (!T) return;
3033
- if (g.preventDefault(), $ && $ !== T) {
3034
- l == null || l($, T), E(null);
3039
+ if (!D) return;
3040
+ if (g.preventDefault(), $ && $ !== D) {
3041
+ l == null || l($, D), k(null);
3035
3042
  return;
3036
3043
  }
3037
- m == null || m(T), h(T);
3044
+ m == null || m(D), h(D);
3038
3045
  return;
3039
3046
  }
3040
3047
  case "Escape": {
3041
- g.preventDefault(), $ ? E(null) : N(null);
3048
+ g.preventDefault(), $ ? k(null) : N(null);
3042
3049
  return;
3043
3050
  }
3044
3051
  case "Delete":
3045
3052
  case "Backspace": {
3046
- if (!T || !f) return;
3053
+ if (!D || !p) return;
3047
3054
  g.preventDefault();
3048
- const H = C.current.nodes.filter((z) => z.id !== T), D = we(C.current.nodes, T, "left") ?? we(C.current.nodes, T, "right") ?? H[0] ?? null;
3049
- f(T), N((D == null ? void 0 : D.id) ?? null);
3055
+ const H = L.current.nodes.filter((z) => z.id !== D), E = ve(L.current.nodes, D, "left") ?? ve(L.current.nodes, D, "right") ?? H[0] ?? null;
3056
+ p(D), N((E == null ? void 0 : E.id) ?? null);
3050
3057
  return;
3051
3058
  }
3052
3059
  case "c":
3053
3060
  case "C": {
3054
- if (!T || !l || g.metaKey || g.ctrlKey) return;
3055
- g.preventDefault(), E($ === T ? null : T);
3061
+ if (!D || !l || g.metaKey || g.ctrlKey) return;
3062
+ g.preventDefault(), k($ === D ? null : D);
3056
3063
  return;
3057
3064
  }
3058
3065
  }
3059
3066
  };
3060
- return k.addEventListener("keydown", S), () => k.removeEventListener("keydown", S);
3067
+ return I.addEventListener("keydown", S), () => I.removeEventListener("keydown", S);
3061
3068
  }, [
3062
- u,
3069
+ d,
3063
3070
  i,
3064
- L,
3065
- A,
3071
+ T,
3072
+ M,
3066
3073
  a,
3067
3074
  l,
3068
3075
  c,
3069
- f,
3076
+ p,
3070
3077
  m,
3071
- d,
3078
+ u,
3072
3079
  N
3073
- ]), R(() => {
3074
- v && !e.some((k) => k.id === v) && N(null), p && !e.some((k) => k.id === p) && h(null), y && !e.some((k) => k.id === y) && E(null);
3075
- }, [e, v, p, y, N]), B(
3080
+ ]), F(() => {
3081
+ w && !e.some((I) => I.id === w) && N(null), f && !e.some((I) => I.id === f) && h(null), y && !e.some((I) => I.id === y) && k(null);
3082
+ }, [e, w, f, y, N]), B(
3076
3083
  () => ({
3077
- focusedId: v,
3084
+ focusedId: w,
3078
3085
  setFocusedId: N,
3079
- editingId: p,
3086
+ editingId: f,
3080
3087
  setEditingId: h,
3081
3088
  connectingFrom: y,
3082
- setConnectingFrom: E,
3083
- moveFocus: L,
3084
- createConnected: A
3089
+ setConnectingFrom: k,
3090
+ moveFocus: T,
3091
+ createConnected: M
3085
3092
  }),
3086
- [v, N, p, y, L, A]
3093
+ [w, N, f, y, T, M]
3087
3094
  );
3088
- }, Un = ({
3095
+ }, jn = ({
3089
3096
  nodes: e,
3090
3097
  viewport: t,
3091
3098
  canvasSize: r,
@@ -3093,46 +3100,46 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3093
3100
  width: s = 180,
3094
3101
  height: i = 120,
3095
3102
  nodeColor: a,
3096
- highlightIds: u,
3103
+ highlightIds: d,
3097
3104
  padding: c = 8,
3098
3105
  panDistance: l = 80,
3099
- "aria-label": f = "Graph minimap",
3100
- className: d
3106
+ "aria-label": p = "Graph minimap",
3107
+ className: u
3101
3108
  }) => {
3102
- const m = _(null), w = B(() => new Set(u ?? []), [u]), b = Lr(t, r), p = B(() => {
3103
- const S = dt(e);
3104
- return S ? Ir(S, b) : b;
3109
+ const m = _(null), v = B(() => new Set(d ?? []), [d]), b = Sr(t, r), f = B(() => {
3110
+ const S = ut(e);
3111
+ return S ? Mr(S, b) : b;
3105
3112
  }, [e, b.x, b.y, b.width, b.height]), h = Math.min(
3106
- (s - c * 2) / Math.max(p.width, 1),
3107
- (i - c * 2) / Math.max(p.height, 1)
3113
+ (s - c * 2) / Math.max(f.width, 1),
3114
+ (i - c * 2) / Math.max(f.height, 1)
3108
3115
  ), y = {
3109
- x: (s - p.width * h) / 2 - p.x * h,
3110
- y: (i - p.height * h) / 2 - p.y * h
3111
- }, E = (S) => ({
3116
+ x: (s - f.width * h) / 2 - f.x * h,
3117
+ y: (i - f.height * h) / 2 - f.y * h
3118
+ }, k = (S) => ({
3112
3119
  x: S.x * h + y.x,
3113
3120
  y: S.y * h + y.y
3114
- }), v = (S) => ({
3121
+ }), w = (S) => ({
3115
3122
  x: (S.x - y.x) / h,
3116
3123
  y: (S.y - y.y) / h
3117
3124
  }), N = Y(
3118
3125
  (S) => {
3119
- var M;
3126
+ var C;
3120
3127
  if (!n) return;
3121
- const g = (M = m.current) == null ? void 0 : M.getBoundingClientRect();
3128
+ const g = (C = m.current) == null ? void 0 : C.getBoundingClientRect();
3122
3129
  if (!g) return;
3123
- const T = v({ x: S.x - g.left, y: S.y - g.top });
3124
- n(_e(T, r, t.scale));
3130
+ const D = w({ x: S.x - g.left, y: S.y - g.top });
3131
+ n(Ue(D, r, t.scale));
3125
3132
  },
3126
3133
  [n, r, t.scale, h, y.x, y.y]
3127
- ), C = (S) => {
3128
- var M;
3134
+ ), L = (S) => {
3135
+ var C;
3129
3136
  if (!n || S.button !== 0) return;
3130
- S.preventDefault(), (M = m.current) == null || M.focus(), N({ x: S.clientX, y: S.clientY });
3131
- const g = ($) => N({ x: $.clientX, y: $.clientY }), T = () => {
3132
- window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", T);
3137
+ S.preventDefault(), (C = m.current) == null || C.focus(), N({ x: S.clientX, y: S.clientY });
3138
+ const g = ($) => N({ x: $.clientX, y: $.clientY }), D = () => {
3139
+ window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", D);
3133
3140
  };
3134
- window.addEventListener("pointermove", g), window.addEventListener("pointerup", T);
3135
- }, L = (S) => {
3141
+ window.addEventListener("pointermove", g), window.addEventListener("pointerup", D);
3142
+ }, T = (S) => {
3136
3143
  if (!n) return;
3137
3144
  const g = {
3138
3145
  ArrowUp: { x: 0, y: -l },
@@ -3142,48 +3149,48 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3142
3149
  }[S.key];
3143
3150
  if (!g) return;
3144
3151
  S.preventDefault();
3145
- const T = J(b);
3152
+ const D = J(b);
3146
3153
  n(
3147
- _e({ x: T.x + g.x, y: T.y + g.y }, r, t.scale)
3154
+ Ue({ x: D.x + g.x, y: D.y + g.y }, r, t.scale)
3148
3155
  );
3149
- }, A = {
3150
- x: E(b).x,
3151
- y: E(b).y,
3156
+ }, M = {
3157
+ x: k(b).x,
3158
+ y: k(b).y,
3152
3159
  width: b.width * h,
3153
3160
  height: b.height * h
3154
- }, k = !!n;
3161
+ }, I = !!n;
3155
3162
  return /* @__PURE__ */ o(
3156
3163
  "div",
3157
3164
  {
3158
3165
  ref: m,
3159
- role: k ? "slider" : "img",
3160
- "aria-label": f,
3166
+ role: I ? "slider" : "img",
3167
+ "aria-label": p,
3161
3168
  "aria-valuetext": e.length === 0 ? "Empty graph" : `${e.length} nodes, viewing around ${Math.round(J(b).x)}, ${Math.round(J(b).y)}`,
3162
- tabIndex: k ? 0 : void 0,
3163
- onPointerDown: C,
3164
- onKeyDown: L,
3169
+ tabIndex: I ? 0 : void 0,
3170
+ onPointerDown: L,
3171
+ onKeyDown: T,
3165
3172
  style: { width: s, height: i },
3166
- className: I(
3173
+ className: P(
3167
3174
  "rounded-lg border border-border bg-card/90 backdrop-blur-sm shadow-sm overflow-hidden",
3168
3175
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3169
- k && "cursor-pointer",
3170
- d
3176
+ I && "cursor-pointer",
3177
+ u
3171
3178
  ),
3172
3179
  children: /* @__PURE__ */ x("svg", { width: s, height: i, className: "block", children: [
3173
3180
  e.map((S) => {
3174
- const g = j(S), T = E(g), M = w.has(S.id);
3181
+ const g = j(S), D = k(g), C = v.has(S.id);
3175
3182
  return /* @__PURE__ */ o(
3176
3183
  "rect",
3177
3184
  {
3178
- x: T.x,
3179
- y: T.y,
3185
+ x: D.x,
3186
+ y: D.y,
3180
3187
  width: Math.max(g.width * h, 2),
3181
3188
  height: Math.max(g.height * h, 2),
3182
3189
  rx: 1,
3183
- fill: M || a == null ? void 0 : a(S),
3184
- className: I(
3185
- !a && !M && "fill-muted-foreground/50",
3186
- M && "fill-primary"
3190
+ fill: C || a == null ? void 0 : a(S),
3191
+ className: P(
3192
+ !a && !C && "fill-muted-foreground/50",
3193
+ C && "fill-primary"
3187
3194
  )
3188
3195
  },
3189
3196
  S.id
@@ -3192,10 +3199,10 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3192
3199
  r.width > 0 && /* @__PURE__ */ o(
3193
3200
  "rect",
3194
3201
  {
3195
- x: A.x,
3196
- y: A.y,
3197
- width: Math.max(A.width, 4),
3198
- height: Math.max(A.height, 4),
3202
+ x: M.x,
3203
+ y: M.y,
3204
+ width: Math.max(M.width, 4),
3205
+ height: Math.max(M.height, 4),
3199
3206
  rx: 2,
3200
3207
  className: "fill-primary/10 stroke-primary",
3201
3208
  strokeWidth: 1.5
@@ -3204,32 +3211,32 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3204
3211
  ] })
3205
3212
  }
3206
3213
  );
3207
- }, _r = (e, t) => {
3214
+ }, Ur = (e, t) => {
3208
3215
  const r = new Set(e.map((l) => l.id)), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
3209
3216
  e.forEach((l) => {
3210
3217
  n.set(l.id, []), s.set(l.id, 0);
3211
3218
  }), t.forEach((l) => {
3212
3219
  !r.has(l.source) || !r.has(l.target) || (n.get(l.source).push(l.target), s.set(l.target, (s.get(l.target) ?? 0) + 1));
3213
3220
  });
3214
- const i = /* @__PURE__ */ new Map(), a = [], u = (l) => {
3221
+ const i = /* @__PURE__ */ new Map(), a = [], d = (l) => {
3215
3222
  i.set(l, 0), a.push(l);
3216
3223
  };
3217
3224
  e.forEach((l) => {
3218
- (s.get(l.id) ?? 0) === 0 && u(l.id);
3219
- }), a.length === 0 && e.length > 0 && u(e[0].id);
3225
+ (s.get(l.id) ?? 0) === 0 && d(l.id);
3226
+ }), a.length === 0 && e.length > 0 && d(e[0].id);
3220
3227
  let c = e.length * e.length + e.length;
3221
3228
  for (; a.length > 0 && c > 0; ) {
3222
3229
  c -= 1;
3223
- const l = a.shift(), f = i.get(l) ?? 0;
3224
- for (const d of n.get(l) ?? []) {
3225
- const m = i.get(d);
3226
- (m === void 0 || m < f + 1) && (i.set(d, f + 1), a.push(d));
3230
+ const l = a.shift(), p = i.get(l) ?? 0;
3231
+ for (const u of n.get(l) ?? []) {
3232
+ const m = i.get(u);
3233
+ (m === void 0 || m < p + 1) && (i.set(u, p + 1), a.push(u));
3227
3234
  }
3228
3235
  }
3229
3236
  return e.forEach((l) => {
3230
- i.has(l.id) || u(l.id);
3237
+ i.has(l.id) || d(l.id);
3231
3238
  }), i;
3232
- }, Ke = ({
3239
+ }, Be = ({
3233
3240
  direction: e = "down",
3234
3241
  nodeSpacing: t = 48,
3235
3242
  layerSpacing: r = 96,
@@ -3237,113 +3244,113 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3237
3244
  align: s = "center"
3238
3245
  } = {}) => (i, a) => {
3239
3246
  if (i.length === 0) return i;
3240
- const u = _r(i, a), c = e === "down" || e === "up", l = /* @__PURE__ */ new Map();
3241
- i.forEach((v) => {
3242
- const N = u.get(v.id) ?? 0, C = l.get(N) ?? [];
3243
- C.push(v), l.set(N, C);
3247
+ const d = Ur(i, a), c = e === "down" || e === "up", l = /* @__PURE__ */ new Map();
3248
+ i.forEach((w) => {
3249
+ const N = d.get(w.id) ?? 0, L = l.get(N) ?? [];
3250
+ L.push(w), l.set(N, L);
3244
3251
  });
3245
- const f = [...l.keys()].sort((v, N) => v - N), d = /* @__PURE__ */ new Map();
3246
- f.forEach((v) => {
3247
- const N = l.get(v), C = Math.max(
3248
- ...N.map((L) => {
3249
- const A = j(L);
3250
- return c ? A.height : A.width;
3252
+ const p = [...l.keys()].sort((w, N) => w - N), u = /* @__PURE__ */ new Map();
3253
+ p.forEach((w) => {
3254
+ const N = l.get(w), L = Math.max(
3255
+ ...N.map((T) => {
3256
+ const M = j(T);
3257
+ return c ? M.height : M.width;
3251
3258
  })
3252
3259
  );
3253
- d.set(v, C);
3260
+ u.set(w, L);
3254
3261
  });
3255
3262
  const m = /* @__PURE__ */ new Map();
3256
- let w = 0;
3257
- f.forEach((v) => {
3258
- m.set(v, w), w += (d.get(v) ?? 0) + r;
3263
+ let v = 0;
3264
+ p.forEach((w) => {
3265
+ m.set(w, v), v += (u.get(w) ?? 0) + r;
3259
3266
  });
3260
- const b = (v) => {
3261
- const N = l.get(v);
3262
- return N.map((L) => {
3263
- const A = j(L);
3264
- return c ? A.width : A.height;
3265
- }).reduce((L, A) => L + A, 0) + t * (N.length - 1);
3266
- }, p = Math.max(...f.map(b)), h = e === "up" || e === "left", y = w - r, E = /* @__PURE__ */ new Map();
3267
- return f.forEach((v) => {
3268
- const N = l.get(v), C = b(v);
3269
- let L = s === "center" ? (p - C) / 2 : 0;
3270
- const A = m.get(v) ?? 0, k = h ? y - A - (d.get(v) ?? 0) : A;
3267
+ const b = (w) => {
3268
+ const N = l.get(w);
3269
+ return N.map((T) => {
3270
+ const M = j(T);
3271
+ return c ? M.width : M.height;
3272
+ }).reduce((T, M) => T + M, 0) + t * (N.length - 1);
3273
+ }, f = Math.max(...p.map(b)), h = e === "up" || e === "left", y = v - r, k = /* @__PURE__ */ new Map();
3274
+ return p.forEach((w) => {
3275
+ const N = l.get(w), L = b(w);
3276
+ let T = s === "center" ? (f - L) / 2 : 0;
3277
+ const M = m.get(w) ?? 0, I = h ? y - M - (u.get(w) ?? 0) : M;
3271
3278
  N.forEach((S) => {
3272
- const g = j(S), T = c ? g.width : g.height, M = c ? g.height : g.width, $ = k + ((d.get(v) ?? 0) - M) / 2;
3273
- E.set(
3279
+ const g = j(S), D = c ? g.width : g.height, C = c ? g.height : g.width, $ = I + ((u.get(w) ?? 0) - C) / 2;
3280
+ k.set(
3274
3281
  S.id,
3275
- c ? { x: n.x + L, y: n.y + $ } : { x: n.x + $, y: n.y + L }
3276
- ), L += T + t;
3282
+ c ? { x: n.x + T, y: n.y + $ } : { x: n.x + $, y: n.y + T }
3283
+ ), T += D + t;
3277
3284
  });
3278
- }), i.map((v) => {
3279
- const N = E.get(v.id);
3280
- return N ? { ...v, position: N } : v;
3285
+ }), i.map((w) => {
3286
+ const N = k.get(w.id);
3287
+ return N ? { ...w, position: N } : w;
3281
3288
  });
3282
- }, Kr = ({
3289
+ }, Br = ({
3283
3290
  columns: e,
3284
3291
  spacingX: t = 48,
3285
3292
  spacingY: r = 48,
3286
3293
  origin: n = { x: 0, y: 0 }
3287
3294
  } = {}) => (s) => {
3288
3295
  if (s.length === 0) return s;
3289
- const i = Math.max(1, e ?? Math.ceil(Math.sqrt(s.length))), a = Math.ceil(s.length / i), u = Array.from(
3296
+ const i = Math.max(1, e ?? Math.ceil(Math.sqrt(s.length))), a = Math.ceil(s.length / i), d = Array.from(
3290
3297
  { length: i },
3291
- (d, m) => Math.max(
3292
- ...s.filter((w, b) => b % i === m).map((w) => j(w).width)
3298
+ (u, m) => Math.max(
3299
+ ...s.filter((v, b) => b % i === m).map((v) => j(v).width)
3293
3300
  )
3294
3301
  ), c = Array.from(
3295
3302
  { length: a },
3296
- (d, m) => Math.max(
3297
- ...s.filter((w, b) => Math.floor(b / i) === m).map((w) => j(w).height)
3303
+ (u, m) => Math.max(
3304
+ ...s.filter((v, b) => Math.floor(b / i) === m).map((v) => j(v).height)
3298
3305
  )
3299
3306
  ), l = [];
3300
- u.reduce((d, m, w) => (l[w] = d, d + m + t), 0);
3301
- const f = [];
3302
- return c.reduce((d, m, w) => (f[w] = d, d + m + r), 0), s.map((d, m) => ({
3303
- ...d,
3307
+ d.reduce((u, m, v) => (l[v] = u, u + m + t), 0);
3308
+ const p = [];
3309
+ return c.reduce((u, m, v) => (p[v] = u, u + m + r), 0), s.map((u, m) => ({
3310
+ ...u,
3304
3311
  position: {
3305
3312
  x: n.x + l[m % i],
3306
- y: n.y + f[Math.floor(m / i)]
3313
+ y: n.y + p[Math.floor(m / i)]
3307
3314
  }
3308
3315
  }));
3309
- }, Ur = {
3310
- vertical: Ke({ direction: "down" }),
3311
- horizontal: Ke({ direction: "right" }),
3312
- grid: Kr()
3313
- }, pe = "freeform", Bn = ({
3316
+ }, Hr = {
3317
+ vertical: Be({ direction: "down" }),
3318
+ horizontal: Be({ direction: "right" }),
3319
+ grid: Br()
3320
+ }, fe = "freeform", Wn = ({
3314
3321
  nodes: e,
3315
3322
  edges: t,
3316
- layouts: r = Ur,
3323
+ layouts: r = Hr,
3317
3324
  mode: n,
3318
- defaultMode: s = pe,
3325
+ defaultMode: s = fe,
3319
3326
  onModeChange: i,
3320
3327
  onNodeMove: a,
3321
- escapeOnDrag: u = !0
3328
+ escapeOnDrag: d = !0
3322
3329
  }) => {
3323
- const [c, l] = P(s), f = n ?? c, d = Y(
3324
- (E) => {
3325
- n === void 0 && l(E), i == null || i(E);
3330
+ const [c, l] = A(s), p = n ?? c, u = Y(
3331
+ (k) => {
3332
+ n === void 0 && l(k), i == null || i(k);
3326
3333
  },
3327
3334
  [n, i]
3328
- ), m = f === pe ? void 0 : r[f], w = !!m, b = B(
3335
+ ), m = p === fe ? void 0 : r[p], v = !!m, b = B(
3329
3336
  () => m ? m(e, t) : e,
3330
3337
  [m, e, t]
3331
- ), p = Y(
3332
- (E, v) => {
3333
- w && u && d(pe), a == null || a(E, v);
3338
+ ), f = Y(
3339
+ (k, w) => {
3340
+ v && d && u(fe), a == null || a(k, w);
3334
3341
  },
3335
- [w, u, d, a]
3342
+ [v, d, u, a]
3336
3343
  ), h = Y(() => b, [b]), y = B(
3337
3344
  // `freeform` is a mode, not a layout; registering one under that name would
3338
3345
  // shadow the escape hatch, so it never appears here.
3339
- () => Object.keys(r).filter((E) => E !== pe),
3346
+ () => Object.keys(r).filter((k) => k !== fe),
3340
3347
  [r]
3341
3348
  );
3342
3349
  return B(
3343
- () => ({ nodes: b, mode: f, setMode: d, available: y, isAuto: w, onMove: p, bake: h }),
3344
- [b, f, d, y, w, p, h]
3350
+ () => ({ nodes: b, mode: p, setMode: u, available: y, isAuto: v, onMove: f, bake: h }),
3351
+ [b, p, u, y, v, f, h]
3345
3352
  );
3346
- }, mt = "application/x-nexus-graph-node", Hn = ({
3353
+ }, ft = "application/x-nexus-graph-node", Gn = ({
3347
3354
  items: e,
3348
3355
  onSelect: t,
3349
3356
  onDragStart: r,
@@ -3351,60 +3358,60 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3351
3358
  onOrientationChange: s,
3352
3359
  iconOnly: i = !1,
3353
3360
  className: a,
3354
- "aria-label": u = "Node palette"
3361
+ "aria-label": d = "Node palette"
3355
3362
  }) => {
3356
- const c = _(null), [l, f] = P("horizontal"), d = n === "auto" ? l : n, m = _(s);
3363
+ const c = _(null), [l, p] = A("horizontal"), u = n === "auto" ? l : n, m = _(s);
3357
3364
  m.current = s;
3358
- const w = Y(() => {
3359
- const p = c.current;
3360
- if (!p) return;
3361
- const h = [...p.querySelectorAll("[data-palette-item]")];
3365
+ const v = Y(() => {
3366
+ const f = c.current;
3367
+ if (!f) return;
3368
+ const h = [...f.querySelectorAll("[data-palette-item]")];
3362
3369
  if (h.length === 0) return;
3363
- const y = window.getComputedStyle(p), E = parseFloat(y.gap) || 0, v = (parseFloat(y.paddingLeft) || 0) + (parseFloat(y.paddingRight) || 0), N = h.reduce((S, g) => S + g.offsetWidth, 0) + E * (h.length - 1) + v, C = h.reduce((S, g) => S + g.offsetHeight, 0) + E * (h.length - 1) + v, L = Br(p);
3364
- if (!L) return;
3365
- const A = 4, k = N <= L.width + A ? "horizontal" : C <= L.height + A ? "vertical" : "horizontal";
3366
- f((S) => {
3370
+ const y = window.getComputedStyle(f), k = parseFloat(y.gap) || 0, w = (parseFloat(y.paddingLeft) || 0) + (parseFloat(y.paddingRight) || 0), N = h.reduce((S, g) => S + g.offsetWidth, 0) + k * (h.length - 1) + w, L = h.reduce((S, g) => S + g.offsetHeight, 0) + k * (h.length - 1) + w, T = jr(f);
3371
+ if (!T) return;
3372
+ const M = 4, I = N <= T.width + M ? "horizontal" : L <= T.height + M ? "vertical" : "horizontal";
3373
+ p((S) => {
3367
3374
  var g;
3368
- return S === k ? S : ((g = m.current) == null || g.call(m, k), k);
3375
+ return S === I ? S : ((g = m.current) == null || g.call(m, I), I);
3369
3376
  });
3370
3377
  }, []);
3371
- R(() => {
3378
+ F(() => {
3372
3379
  if (n !== "auto") return;
3373
- const p = c.current;
3374
- if (!p) return;
3375
- w();
3376
- const h = new ResizeObserver(w);
3377
- h.observe(p);
3378
- const y = ft(p);
3379
- return y && y !== p && h.observe(y), () => h.disconnect();
3380
- }, [n, w, e.length]);
3381
- const b = d === "vertical";
3380
+ const f = c.current;
3381
+ if (!f) return;
3382
+ v();
3383
+ const h = new ResizeObserver(v);
3384
+ h.observe(f);
3385
+ const y = pt(f);
3386
+ return y && y !== f && h.observe(y), () => h.disconnect();
3387
+ }, [n, v, e.length]);
3388
+ const b = u === "vertical";
3382
3389
  return /* @__PURE__ */ o(
3383
3390
  "div",
3384
3391
  {
3385
3392
  ref: c,
3386
3393
  role: "toolbar",
3387
- "aria-label": u,
3388
- "aria-orientation": d,
3389
- "data-orientation": d,
3390
- className: I(
3394
+ "aria-label": d,
3395
+ "aria-orientation": u,
3396
+ "data-orientation": u,
3397
+ className: P(
3391
3398
  "flex gap-1.5 p-1.5 rounded-lg border border-border bg-card/90 backdrop-blur-sm shadow-sm",
3392
3399
  b ? "flex-col items-stretch" : "flex-wrap items-center",
3393
3400
  a
3394
3401
  ),
3395
- children: e.map((p) => /* @__PURE__ */ x(
3402
+ children: e.map((f) => /* @__PURE__ */ x(
3396
3403
  "button",
3397
3404
  {
3398
3405
  type: "button",
3399
3406
  "data-palette-item": !0,
3400
3407
  draggable: !0,
3401
- title: p.description ?? (i ? p.label : void 0),
3402
- "aria-label": i ? p.label : void 0,
3408
+ title: f.description ?? (i ? f.label : void 0),
3409
+ "aria-label": i ? f.label : void 0,
3403
3410
  onDragStart: (h) => {
3404
- h.dataTransfer.setData(mt, p.kind), h.dataTransfer.setData("text/plain", p.label), h.dataTransfer.effectAllowed = "copy", r == null || r(p);
3411
+ h.dataTransfer.setData(ft, f.kind), h.dataTransfer.setData("text/plain", f.label), h.dataTransfer.effectAllowed = "copy", r == null || r(f);
3405
3412
  },
3406
- onClick: () => t == null ? void 0 : t(p),
3407
- className: I(
3413
+ onClick: () => t == null ? void 0 : t(f),
3414
+ className: P(
3408
3415
  "flex items-center gap-1.5 rounded-md text-xs font-medium",
3409
3416
  "border border-border bg-background text-foreground",
3410
3417
  "hover:bg-accent hover:text-accent-foreground transition-colors",
@@ -3415,15 +3422,15 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3415
3422
  b && !i && "justify-start"
3416
3423
  ),
3417
3424
  children: [
3418
- p.icon,
3419
- !i && p.label
3425
+ f.icon,
3426
+ !i && f.label
3420
3427
  ]
3421
3428
  },
3422
- p.kind
3429
+ f.kind
3423
3430
  ))
3424
3431
  }
3425
3432
  );
3426
- }, ft = (e) => {
3433
+ }, pt = (e) => {
3427
3434
  let t = e.parentElement;
3428
3435
  for (let r = 0; t && r < 6; r += 1) {
3429
3436
  const n = t.getBoundingClientRect(), s = e.getBoundingClientRect();
@@ -3431,15 +3438,15 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3431
3438
  t = t.parentElement;
3432
3439
  }
3433
3440
  return null;
3434
- }, Br = (e) => {
3435
- const t = ft(e);
3441
+ }, jr = (e) => {
3442
+ const t = pt(e);
3436
3443
  if (!t) return null;
3437
3444
  const r = window.getComputedStyle(t), n = t.getBoundingClientRect();
3438
3445
  return {
3439
3446
  width: n.width - (parseFloat(r.paddingLeft) || 0) - (parseFloat(r.paddingRight) || 0),
3440
3447
  height: n.height - (parseFloat(r.paddingTop) || 0) - (parseFloat(r.paddingBottom) || 0)
3441
3448
  };
3442
- }, jn = (e) => e.dataTransfer.getData(mt) || null, q = ({
3449
+ }, Yn = (e) => e.dataTransfer.getData(ft) || null, q = ({
3443
3450
  label: e,
3444
3451
  htmlFor: t,
3445
3452
  description: r,
@@ -3447,8 +3454,8 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3447
3454
  mixed: s,
3448
3455
  children: i,
3449
3456
  inline: a = !1,
3450
- className: u
3451
- }) => /* @__PURE__ */ x("div", { className: I("flex flex-col gap-1.5", u), children: [
3457
+ className: d
3458
+ }) => /* @__PURE__ */ x("div", { className: P("flex flex-col gap-1.5", d), children: [
3452
3459
  !a && /* @__PURE__ */ x("div", { className: "flex items-baseline justify-between gap-2", children: [
3453
3460
  /* @__PURE__ */ o(
3454
3461
  "label",
@@ -3467,7 +3474,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3467
3474
  ] }) : i,
3468
3475
  r && !n && /* @__PURE__ */ o("p", { className: "text-[11px] text-muted-foreground/80 leading-snug", children: r }),
3469
3476
  n && /* @__PURE__ */ o("p", { className: "text-[11px] text-destructive leading-snug", children: n })
3470
- ] }), ne = "w-full rounded-md border bg-background px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/60 transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/50 disabled:opacity-50 disabled:cursor-not-allowed", oe = (e) => e ? "border-destructive" : "border-border", Z = (e, t = "") => `property-${e.toLowerCase().replace(/[^a-z0-9]+/g, "-")}${t}`, se = "Mixed values", Hr = ({
3477
+ ] }), ne = "w-full rounded-md border bg-background px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/60 transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/50 disabled:opacity-50 disabled:cursor-not-allowed", oe = (e) => e ? "border-destructive" : "border-border", Z = (e, t = "") => `property-${e.toLowerCase().replace(/[^a-z0-9]+/g, "-")}${t}`, se = "Mixed values", Wr = ({
3471
3478
  label: e,
3472
3479
  value: t,
3473
3480
  onChange: r,
@@ -3475,16 +3482,16 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3475
3482
  mixed: s,
3476
3483
  disabled: i,
3477
3484
  error: a,
3478
- placeholder: u,
3485
+ placeholder: d,
3479
3486
  inputType: c = "text",
3480
3487
  className: l
3481
3488
  }) => {
3482
- const f = Z(e);
3489
+ const p = Z(e);
3483
3490
  return /* @__PURE__ */ o(
3484
3491
  q,
3485
3492
  {
3486
3493
  label: e,
3487
- htmlFor: f,
3494
+ htmlFor: p,
3488
3495
  description: n,
3489
3496
  error: a,
3490
3497
  mixed: s,
@@ -3492,18 +3499,18 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3492
3499
  children: /* @__PURE__ */ o(
3493
3500
  "input",
3494
3501
  {
3495
- id: f,
3502
+ id: p,
3496
3503
  type: c,
3497
3504
  value: s ? "" : t ?? "",
3498
- placeholder: s ? se : u,
3505
+ placeholder: s ? se : d,
3499
3506
  disabled: i,
3500
- onChange: (d) => r == null ? void 0 : r(d.target.value),
3501
- className: I(ne, oe(a))
3507
+ onChange: (u) => r == null ? void 0 : r(u.target.value),
3508
+ className: P(ne, oe(a))
3502
3509
  }
3503
3510
  )
3504
3511
  }
3505
3512
  );
3506
- }, jr = ({
3513
+ }, Gr = ({
3507
3514
  label: e,
3508
3515
  value: t,
3509
3516
  onChange: r,
@@ -3511,16 +3518,16 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3511
3518
  mixed: s,
3512
3519
  disabled: i,
3513
3520
  error: a,
3514
- placeholder: u,
3521
+ placeholder: d,
3515
3522
  rows: c = 4,
3516
3523
  className: l
3517
3524
  }) => {
3518
- const f = Z(e);
3525
+ const p = Z(e);
3519
3526
  return /* @__PURE__ */ o(
3520
3527
  q,
3521
3528
  {
3522
3529
  label: e,
3523
- htmlFor: f,
3530
+ htmlFor: p,
3524
3531
  description: n,
3525
3532
  error: a,
3526
3533
  mixed: s,
@@ -3528,18 +3535,18 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3528
3535
  children: /* @__PURE__ */ o(
3529
3536
  "textarea",
3530
3537
  {
3531
- id: f,
3538
+ id: p,
3532
3539
  rows: c,
3533
3540
  value: s ? "" : t ?? "",
3534
- placeholder: s ? se : u,
3541
+ placeholder: s ? se : d,
3535
3542
  disabled: i,
3536
- onChange: (d) => r == null ? void 0 : r(d.target.value),
3537
- className: I(ne, oe(a), "resize-y leading-relaxed")
3543
+ onChange: (u) => r == null ? void 0 : r(u.target.value),
3544
+ className: P(ne, oe(a), "resize-y leading-relaxed")
3538
3545
  }
3539
3546
  )
3540
3547
  }
3541
3548
  );
3542
- }, Wr = ({
3549
+ }, Yr = ({
3543
3550
  label: e,
3544
3551
  value: t,
3545
3552
  onChange: r,
@@ -3547,16 +3554,16 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3547
3554
  mixed: s,
3548
3555
  disabled: i,
3549
3556
  error: a,
3550
- options: u,
3557
+ options: d,
3551
3558
  placeholder: c,
3552
3559
  className: l
3553
3560
  }) => {
3554
- const f = Z(e);
3561
+ const p = Z(e);
3555
3562
  return /* @__PURE__ */ o(
3556
3563
  q,
3557
3564
  {
3558
3565
  label: e,
3559
- htmlFor: f,
3566
+ htmlFor: p,
3560
3567
  description: n,
3561
3568
  error: a,
3562
3569
  mixed: s,
@@ -3564,20 +3571,20 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3564
3571
  children: /* @__PURE__ */ x(
3565
3572
  "select",
3566
3573
  {
3567
- id: f,
3574
+ id: p,
3568
3575
  value: s ? "" : t ?? "",
3569
3576
  disabled: i,
3570
- onChange: (d) => r == null ? void 0 : r(d.target.value),
3571
- className: I(ne, oe(a), "cursor-pointer"),
3577
+ onChange: (u) => r == null ? void 0 : r(u.target.value),
3578
+ className: P(ne, oe(a), "cursor-pointer"),
3572
3579
  children: [
3573
3580
  (s || c || t === void 0) && /* @__PURE__ */ o("option", { value: "", disabled: !c, children: s ? se : c ?? "—" }),
3574
- u.map((d) => /* @__PURE__ */ o("option", { value: d.value, disabled: d.disabled, children: d.label }, d.value))
3581
+ d.map((u) => /* @__PURE__ */ o("option", { value: u.value, disabled: u.disabled, children: u.label }, u.value))
3575
3582
  ]
3576
3583
  }
3577
3584
  )
3578
3585
  }
3579
3586
  );
3580
- }, Gr = ({
3587
+ }, Jr = ({
3581
3588
  label: e,
3582
3589
  value: t,
3583
3590
  onChange: r,
@@ -3585,7 +3592,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3585
3592
  mixed: s,
3586
3593
  disabled: i,
3587
3594
  error: a,
3588
- className: u
3595
+ className: d
3589
3596
  }) => {
3590
3597
  const c = Z(e);
3591
3598
  return /* @__PURE__ */ o(
@@ -3597,7 +3604,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3597
3604
  error: a,
3598
3605
  mixed: s,
3599
3606
  inline: !0,
3600
- className: u,
3607
+ className: d,
3601
3608
  children: /* @__PURE__ */ o(
3602
3609
  "input",
3603
3610
  {
@@ -3614,7 +3621,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3614
3621
  )
3615
3622
  }
3616
3623
  );
3617
- }, Yr = ({
3624
+ }, Xr = ({
3618
3625
  label: e,
3619
3626
  value: t,
3620
3627
  onChange: r,
@@ -3622,19 +3629,19 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3622
3629
  mixed: s,
3623
3630
  disabled: i,
3624
3631
  error: a,
3625
- min: u,
3632
+ min: d,
3626
3633
  max: c,
3627
3634
  step: l,
3628
- unit: f,
3629
- placeholder: d,
3635
+ unit: p,
3636
+ placeholder: u,
3630
3637
  className: m
3631
3638
  }) => {
3632
- const w = Z(e);
3639
+ const v = Z(e);
3633
3640
  return /* @__PURE__ */ o(
3634
3641
  q,
3635
3642
  {
3636
3643
  label: e,
3637
- htmlFor: w,
3644
+ htmlFor: v,
3638
3645
  description: n,
3639
3646
  error: a,
3640
3647
  mixed: s,
@@ -3643,27 +3650,27 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3643
3650
  /* @__PURE__ */ o(
3644
3651
  "input",
3645
3652
  {
3646
- id: w,
3653
+ id: v,
3647
3654
  type: "number",
3648
3655
  value: s || t === void 0 ? "" : t,
3649
- placeholder: s ? se : d,
3650
- min: u,
3656
+ placeholder: s ? se : u,
3657
+ min: d,
3651
3658
  max: c,
3652
3659
  step: l,
3653
3660
  disabled: i,
3654
3661
  onChange: (b) => {
3655
3662
  if (b.target.value === "") return;
3656
- const p = Number(b.target.value);
3657
- Number.isFinite(p) && (r == null || r(p));
3663
+ const f = Number(b.target.value);
3664
+ Number.isFinite(f) && (r == null || r(f));
3658
3665
  },
3659
- className: I(ne, oe(a), f && "pr-8")
3666
+ className: P(ne, oe(a), p && "pr-8")
3660
3667
  }
3661
3668
  ),
3662
- f && /* @__PURE__ */ o("span", { className: "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground", children: f })
3669
+ p && /* @__PURE__ */ o("span", { className: "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground", children: p })
3663
3670
  ] })
3664
3671
  }
3665
3672
  );
3666
- }, Jr = ({
3673
+ }, qr = ({
3667
3674
  label: e,
3668
3675
  value: t,
3669
3676
  onChange: r,
@@ -3671,7 +3678,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3671
3678
  mixed: s,
3672
3679
  disabled: i,
3673
3680
  error: a,
3674
- showValue: u = !0,
3681
+ showValue: d = !0,
3675
3682
  className: c
3676
3683
  }) => {
3677
3684
  const l = Z(e);
@@ -3692,11 +3699,11 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3692
3699
  type: "color",
3693
3700
  value: s ? "#888888" : t ?? "#000000",
3694
3701
  disabled: i,
3695
- onChange: (f) => r == null ? void 0 : r(f.target.value),
3702
+ onChange: (p) => r == null ? void 0 : r(p.target.value),
3696
3703
  className: "h-7 w-10 shrink-0 cursor-pointer rounded border border-border bg-background disabled:opacity-50"
3697
3704
  }
3698
3705
  ),
3699
- u && /* @__PURE__ */ o(
3706
+ d && /* @__PURE__ */ o(
3700
3707
  "input",
3701
3708
  {
3702
3709
  type: "text",
@@ -3704,14 +3711,14 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3704
3711
  value: s ? "" : t ?? "",
3705
3712
  placeholder: s ? se : "#000000",
3706
3713
  disabled: i,
3707
- onChange: (f) => r == null ? void 0 : r(f.target.value),
3708
- className: I(ne, oe(a), "font-mono")
3714
+ onChange: (p) => r == null ? void 0 : r(p.target.value),
3715
+ className: P(ne, oe(a), "font-mono")
3709
3716
  }
3710
3717
  )
3711
3718
  ] })
3712
3719
  }
3713
3720
  );
3714
- }, Xr = ({
3721
+ }, Vr = ({
3715
3722
  label: e,
3716
3723
  value: t,
3717
3724
  onChange: r,
@@ -3719,37 +3726,37 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3719
3726
  mixed: s,
3720
3727
  disabled: i,
3721
3728
  error: a,
3722
- withTime: u = !1,
3729
+ withTime: d = !1,
3723
3730
  min: c,
3724
3731
  max: l,
3725
- className: f
3732
+ className: p
3726
3733
  }) => {
3727
- const d = Z(e);
3734
+ const u = Z(e);
3728
3735
  return /* @__PURE__ */ o(
3729
3736
  q,
3730
3737
  {
3731
3738
  label: e,
3732
- htmlFor: d,
3739
+ htmlFor: u,
3733
3740
  description: n,
3734
3741
  error: a,
3735
3742
  mixed: s,
3736
- className: f,
3743
+ className: p,
3737
3744
  children: /* @__PURE__ */ o(
3738
3745
  "input",
3739
3746
  {
3740
- id: d,
3741
- type: u ? "datetime-local" : "date",
3747
+ id: u,
3748
+ type: d ? "datetime-local" : "date",
3742
3749
  value: s ? "" : t ?? "",
3743
3750
  min: c,
3744
3751
  max: l,
3745
3752
  disabled: i,
3746
3753
  onChange: (m) => r == null ? void 0 : r(m.target.value),
3747
- className: I(ne, oe(a))
3754
+ className: P(ne, oe(a))
3748
3755
  }
3749
3756
  )
3750
3757
  }
3751
3758
  );
3752
- }, qr = ({
3759
+ }, Qr = ({
3753
3760
  label: e,
3754
3761
  value: t,
3755
3762
  onChange: r,
@@ -3757,17 +3764,17 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3757
3764
  mixed: s,
3758
3765
  disabled: i,
3759
3766
  error: a,
3760
- placeholder: u = "Add and press Enter",
3767
+ placeholder: d = "Add and press Enter",
3761
3768
  suggestions: c,
3762
3769
  className: l
3763
3770
  }) => {
3764
- const [f, d] = P(""), m = Z(e), w = s ? [] : t ?? [], b = () => {
3765
- const p = f.trim();
3766
- if (!p || w.includes(p)) {
3767
- d("");
3771
+ const [p, u] = A(""), m = Z(e), v = s ? [] : t ?? [], b = () => {
3772
+ const f = p.trim();
3773
+ if (!f || v.includes(f)) {
3774
+ u("");
3768
3775
  return;
3769
3776
  }
3770
- r == null || r([...w, p]), d("");
3777
+ r == null || r([...v, f]), u("");
3771
3778
  };
3772
3779
  return /* @__PURE__ */ x(
3773
3780
  q,
@@ -3779,25 +3786,25 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3779
3786
  mixed: s,
3780
3787
  className: l,
3781
3788
  children: [
3782
- w.length > 0 && /* @__PURE__ */ o("div", { className: "flex flex-wrap gap-1", children: w.map((p) => /* @__PURE__ */ x(
3789
+ v.length > 0 && /* @__PURE__ */ o("div", { className: "flex flex-wrap gap-1", children: v.map((f) => /* @__PURE__ */ x(
3783
3790
  "span",
3784
3791
  {
3785
3792
  className: "flex items-center gap-1 rounded-md border border-border bg-secondary px-1.5 py-0.5 text-[11px] text-secondary-foreground",
3786
3793
  children: [
3787
- p,
3794
+ f,
3788
3795
  !i && /* @__PURE__ */ o(
3789
3796
  "button",
3790
3797
  {
3791
3798
  type: "button",
3792
- "aria-label": `Remove ${p}`,
3793
- onClick: () => r == null ? void 0 : r(w.filter((h) => h !== p)),
3799
+ "aria-label": `Remove ${f}`,
3800
+ onClick: () => r == null ? void 0 : r(v.filter((h) => h !== f)),
3794
3801
  className: "text-muted-foreground hover:text-destructive",
3795
3802
  children: /* @__PURE__ */ o(X, { size: 10 })
3796
3803
  }
3797
3804
  )
3798
3805
  ]
3799
3806
  },
3800
- p
3807
+ f
3801
3808
  )) }),
3802
3809
  /* @__PURE__ */ x("div", { className: "flex gap-1.5", children: [
3803
3810
  /* @__PURE__ */ o(
@@ -3806,14 +3813,14 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3806
3813
  id: m,
3807
3814
  type: "text",
3808
3815
  list: c ? `${m}-suggestions` : void 0,
3809
- value: f,
3810
- placeholder: s ? se : u,
3816
+ value: p,
3817
+ placeholder: s ? se : d,
3811
3818
  disabled: i,
3812
- onChange: (p) => d(p.target.value),
3813
- onKeyDown: (p) => {
3814
- p.key === "Enter" && (p.preventDefault(), b());
3819
+ onChange: (f) => u(f.target.value),
3820
+ onKeyDown: (f) => {
3821
+ f.key === "Enter" && (f.preventDefault(), b());
3815
3822
  },
3816
- className: I(ne, oe(a))
3823
+ className: P(ne, oe(a))
3817
3824
  }
3818
3825
  ),
3819
3826
  /* @__PURE__ */ o(
@@ -3821,18 +3828,18 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3821
3828
  {
3822
3829
  type: "button",
3823
3830
  "aria-label": `Add ${e}`,
3824
- disabled: i || !f.trim(),
3831
+ disabled: i || !p.trim(),
3825
3832
  onClick: b,
3826
3833
  className: "shrink-0 rounded-md border border-border px-2 text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40",
3827
- children: /* @__PURE__ */ o(Ft, { size: 13 })
3834
+ children: /* @__PURE__ */ o(_t, { size: 13 })
3828
3835
  }
3829
3836
  )
3830
3837
  ] }),
3831
- c && /* @__PURE__ */ o("datalist", { id: `${m}-suggestions`, children: c.map((p) => /* @__PURE__ */ o("option", { value: p }, p)) })
3838
+ c && /* @__PURE__ */ o("datalist", { id: `${m}-suggestions`, children: c.map((f) => /* @__PURE__ */ o("option", { value: f }, f)) })
3832
3839
  ]
3833
3840
  }
3834
3841
  );
3835
- }, Vr = ({
3842
+ }, Zr = ({
3836
3843
  label: e,
3837
3844
  value: t,
3838
3845
  description: r,
@@ -3842,39 +3849,39 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3842
3849
  }) => /* @__PURE__ */ o(q, { label: e, description: r, mixed: n, className: i, children: /* @__PURE__ */ o(
3843
3850
  "p",
3844
3851
  {
3845
- className: I(
3852
+ className: P(
3846
3853
  "break-words text-xs text-foreground",
3847
3854
  s && "font-mono text-[11px]",
3848
3855
  (n || t === void 0 || t === "") && "text-muted-foreground/60"
3849
3856
  ),
3850
3857
  children: n ? se : t ?? "—"
3851
3858
  }
3852
- ) }), Qr = (e, t) => {
3859
+ ) }), en = (e, t) => {
3853
3860
  if (e != null)
3854
3861
  return t.split(".").reduce(
3855
3862
  (r, n) => r == null ? void 0 : r[n],
3856
3863
  e
3857
3864
  );
3858
- }, pt = (e, t, r) => {
3865
+ }, ht = (e, t, r) => {
3859
3866
  const [n, ...s] = t.split(".");
3860
3867
  if (n === void 0) return e;
3861
3868
  const i = e ?? {};
3862
3869
  if (s.length === 0)
3863
3870
  return { ...i, [n]: r };
3864
- const a = i[n], u = a != null && typeof a == "object" ? a : {};
3871
+ const a = i[n], d = a != null && typeof a == "object" ? a : {};
3865
3872
  return {
3866
3873
  ...i,
3867
- [n]: pt(u, s.join("."), r)
3874
+ [n]: ht(d, s.join("."), r)
3868
3875
  };
3869
- }, Ee = (e, t) => t.get ? t.get(e) : Qr(e, t.key), Zr = (e, t, r) => t.set ? t.set(e, r) : pt(e, t.key, r), en = (e, t) => {
3876
+ }, ke = (e, t) => t.get ? t.get(e) : en(e, t.key), tn = (e, t, r) => t.set ? t.set(e, r) : ht(e, t.key, r), rn = (e, t) => {
3870
3877
  if (e.length === 0) return { value: void 0, mixed: !1 };
3871
- const r = Ee(e[0], t);
3872
- return e.every((s) => Object.is(Ee(s, t), r)) ? { value: r, mixed: !1 } : { value: void 0, mixed: !0 };
3873
- }, tn = (e, t, r) => e.map(
3874
- (n) => Object.is(Ee(n, t), r) ? n : Zr(n, t, r)
3875
- ), rn = {
3878
+ const r = ke(e[0], t);
3879
+ return e.every((s) => Object.is(ke(s, t), r)) ? { value: r, mixed: !1 } : { value: void 0, mixed: !0 };
3880
+ }, nn = (e, t, r) => e.map(
3881
+ (n) => Object.is(ke(n, t), r) ? n : tn(n, t, r)
3882
+ ), on = {
3876
3883
  text: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
3877
- Hr,
3884
+ Wr,
3878
3885
  {
3879
3886
  label: e.label,
3880
3887
  description: e.description,
@@ -3887,7 +3894,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3887
3894
  }
3888
3895
  ),
3889
3896
  textarea: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
3890
- jr,
3897
+ Gr,
3891
3898
  {
3892
3899
  label: e.label,
3893
3900
  description: e.description,
@@ -3902,7 +3909,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3902
3909
  select: ({ field: e, state: t, onChange: r, error: n }) => {
3903
3910
  var s;
3904
3911
  return /* @__PURE__ */ o(
3905
- Wr,
3912
+ Yr,
3906
3913
  {
3907
3914
  label: e.label,
3908
3915
  description: e.description,
@@ -3917,7 +3924,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3917
3924
  );
3918
3925
  },
3919
3926
  checkbox: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
3920
- Gr,
3927
+ Jr,
3921
3928
  {
3922
3929
  label: e.label,
3923
3930
  description: e.description,
@@ -3930,7 +3937,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3930
3937
  }
3931
3938
  ),
3932
3939
  number: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
3933
- Yr,
3940
+ Xr,
3934
3941
  {
3935
3942
  label: e.label,
3936
3943
  description: e.description,
@@ -3943,7 +3950,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3943
3950
  }
3944
3951
  ),
3945
3952
  color: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
3946
- Jr,
3953
+ qr,
3947
3954
  {
3948
3955
  label: e.label,
3949
3956
  description: e.description,
@@ -3956,7 +3963,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3956
3963
  }
3957
3964
  ),
3958
3965
  date: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
3959
- Xr,
3966
+ Vr,
3960
3967
  {
3961
3968
  label: e.label,
3962
3969
  description: e.description,
@@ -3969,7 +3976,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3969
3976
  }
3970
3977
  ),
3971
3978
  tags: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
3972
- qr,
3979
+ Qr,
3973
3980
  {
3974
3981
  label: e.label,
3975
3982
  description: e.description,
@@ -3982,7 +3989,7 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3982
3989
  }
3983
3990
  ),
3984
3991
  static: ({ field: e, state: t }) => /* @__PURE__ */ o(
3985
- Vr,
3992
+ Zr,
3986
3993
  {
3987
3994
  label: e.label,
3988
3995
  description: e.description,
@@ -3991,55 +3998,55 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
3991
3998
  ...e.props
3992
3999
  }
3993
4000
  )
3994
- }, nn = /* @__PURE__ */ o("div", { className: "grid h-full place-items-center px-6 py-10 text-center", children: /* @__PURE__ */ o("p", { className: "text-xs text-muted-foreground", children: "Nothing selected. Choose an item to see its properties." }) }), Wn = ({
4001
+ }, sn = /* @__PURE__ */ o("div", { className: "grid h-full place-items-center px-6 py-10 text-center", children: /* @__PURE__ */ o("p", { className: "text-xs text-muted-foreground", children: "Nothing selected. Choose an item to see its properties." }) }), Jn = ({
3995
4002
  subjects: e,
3996
4003
  fields: t,
3997
4004
  onChange: r,
3998
- fieldTypes: n = rn,
3999
- emptyState: s = nn,
4005
+ fieldTypes: n = on,
4006
+ emptyState: s = sn,
4000
4007
  title: i,
4001
4008
  groupOrder: a,
4002
- className: u,
4009
+ className: d,
4003
4010
  "aria-label": c = "Properties"
4004
4011
  }) => {
4005
4012
  const l = B(
4006
4013
  () => t.filter((m) => !m.when || m.when(e)),
4007
4014
  [t, e]
4008
- ), f = B(() => {
4015
+ ), p = B(() => {
4009
4016
  const m = /* @__PURE__ */ new Map();
4010
- l.forEach((p) => {
4011
- const h = p.group ?? "";
4012
- m.set(h, [...m.get(h) ?? [], p]);
4017
+ l.forEach((f) => {
4018
+ const h = f.group ?? "";
4019
+ m.set(h, [...m.get(h) ?? [], f]);
4013
4020
  });
4014
- const w = [...m.keys()];
4021
+ const v = [...m.keys()];
4015
4022
  return (a ? [
4016
4023
  // Ungrouped fields always lead — they are the identity of the thing.
4017
4024
  ...m.has("") ? [""] : [],
4018
- ...a.filter((p) => m.has(p)),
4019
- ...w.filter((p) => p !== "" && !a.includes(p))
4020
- ] : w).map((p) => ({ group: p, fields: m.get(p) }));
4025
+ ...a.filter((f) => m.has(f)),
4026
+ ...v.filter((f) => f !== "" && !a.includes(f))
4027
+ ] : v).map((f) => ({ group: f, fields: m.get(f) }));
4021
4028
  }, [l, a]);
4022
4029
  if (e.length === 0)
4023
- return /* @__PURE__ */ o("section", { "aria-label": c, className: I("h-full overflow-y-auto", u), children: s });
4024
- const d = typeof i == "function" ? i(e) : i;
4030
+ return /* @__PURE__ */ o("section", { "aria-label": c, className: P("h-full overflow-y-auto", d), children: s });
4031
+ const u = typeof i == "function" ? i(e) : i;
4025
4032
  return /* @__PURE__ */ x(
4026
4033
  "section",
4027
4034
  {
4028
4035
  "aria-label": c,
4029
- className: I("h-full overflow-y-auto", u),
4036
+ className: P("h-full overflow-y-auto", d),
4030
4037
  children: [
4031
- d != null && /* @__PURE__ */ o("header", { className: "sticky top-0 z-10 border-b border-border/60 bg-background/95 px-4 py-2.5 backdrop-blur-sm", children: /* @__PURE__ */ o("div", { className: "text-xs font-semibold text-foreground", children: d }) }),
4032
- /* @__PURE__ */ o("div", { className: "flex flex-col gap-5 p-4", children: f.map(({ group: m, fields: w }) => /* @__PURE__ */ x("div", { className: "flex flex-col gap-4", children: [
4038
+ u != null && /* @__PURE__ */ o("header", { className: "sticky top-0 z-10 border-b border-border/60 bg-background/95 px-4 py-2.5 backdrop-blur-sm", children: /* @__PURE__ */ o("div", { className: "text-xs font-semibold text-foreground", children: u }) }),
4039
+ /* @__PURE__ */ o("div", { className: "flex flex-col gap-5 p-4", children: p.map(({ group: m, fields: v }) => /* @__PURE__ */ x("div", { className: "flex flex-col gap-4", children: [
4033
4040
  m && /* @__PURE__ */ o("h3", { className: "border-b border-border/40 pb-1 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/70", children: m }),
4034
- w.map((b) => {
4041
+ v.map((b) => {
4035
4042
  var y;
4036
- const p = en(e, b), h = n[b.type ?? "text"];
4037
- return h ? /* @__PURE__ */ o(he.Fragment, { children: h({
4043
+ const f = rn(e, b), h = n[b.type ?? "text"];
4044
+ return h ? /* @__PURE__ */ o(pe.Fragment, { children: h({
4038
4045
  field: b,
4039
- state: p,
4046
+ state: f,
4040
4047
  subjects: e,
4041
- error: (y = b.validate) == null ? void 0 : y.call(b, p.value, e),
4042
- onChange: (E) => r == null ? void 0 : r(tn(e, b, E), b, E)
4048
+ error: (y = b.validate) == null ? void 0 : y.call(b, f.value, e),
4049
+ onChange: (k) => r == null ? void 0 : r(nn(e, b, k), b, k)
4043
4050
  }) }, b.key) : /* @__PURE__ */ x("p", { className: "text-[11px] text-destructive", children: [
4044
4051
  "No renderer registered for field type “",
4045
4052
  b.type,
@@ -4053,125 +4060,130 @@ const $r = ["top", "right", "bottom", "left"], Rr = {
4053
4060
  };
4054
4061
  export {
4055
4062
  Bt as ActivityBar,
4056
- Dn as AppTitle,
4057
- rn as BUILT_IN_FIELD_TYPES,
4058
- Ur as BUILT_IN_LAYOUTS,
4059
- ue as BUNDLED_THEMES,
4060
- Xt as BUNDLED_THEME_CLASSES,
4061
- Ye as CHAT_PANEL_ID,
4063
+ Pn as AppTitle,
4064
+ on as BUILT_IN_FIELD_TYPES,
4065
+ Hr as BUILT_IN_LAYOUTS,
4066
+ de as BUNDLED_THEMES,
4067
+ nr as BUNDLED_THEME_CLASSES,
4068
+ Xe as CHAT_PANEL_ID,
4062
4069
  ne as CONTROL_CLASS,
4063
- mr as ChatPane,
4064
- Gr as CheckboxField,
4065
- Jr as ColorField,
4066
- br as CommandPalette,
4067
- Yt as CommandRegistry,
4068
- Ht as ConnectedActivityBar,
4069
- fr as ConnectedChatPane,
4070
- Nn as ConnectedCommandPalette,
4071
- jt as ConnectedInspectorBar,
4072
- tr as ConnectedInspectorPane,
4073
- Jt as ConnectedMenuBar,
4074
- kn as ConnectedModal,
4075
- er as ConnectedSidebarPane,
4076
- nr as ConnectedStatusBar,
4077
- gr as ConnectedTerminalPane,
4078
- En as ConnectedThemeSwitcher,
4079
- Tn as ConnectedUserProfile,
4080
- Tr as ContextMenu,
4081
- gn as DEFAULT_COMMAND_IDS,
4082
- _n as DEFAULT_GRAPH_KEYS,
4083
- ge as DEFAULT_NODE_SIZE,
4084
- Qt as DEFAULT_SETTINGS_THEMES,
4085
- Nr as DEFAULT_THEME_OPTIONS,
4070
+ dr as ChatPane,
4071
+ Jr as CheckboxField,
4072
+ qr as ColorField,
4073
+ vr as CommandPalette,
4074
+ qt as CommandRegistry,
4075
+ ur as ConnectedChatPane,
4076
+ Tn as ConnectedCommandPalette,
4077
+ Vt as ConnectedMenuBar,
4078
+ Dn as ConnectedModal,
4079
+ xe as ConnectedPane,
4080
+ Me as ConnectedPaneRail,
4081
+ hr as ConnectedSettingsPanel,
4082
+ Zt as ConnectedStatusBar,
4083
+ br as ConnectedTerminalPane,
4084
+ Ln as ConnectedThemeSwitcher,
4085
+ In as ConnectedUserProfile,
4086
+ Lr as ContextMenu,
4087
+ bn as DEFAULT_COMMAND_IDS,
4088
+ Bn as DEFAULT_GRAPH_KEYS,
4089
+ he as DEFAULT_NODE_SIZE,
4090
+ fr as DEFAULT_SETTINGS_THEMES,
4091
+ Er as DEFAULT_THEME_OPTIONS,
4086
4092
  Sn as DataGrid,
4087
- Xr as DateField,
4088
- pe as FREEFORM,
4093
+ Vr as DateField,
4094
+ fe as FREEFORM,
4089
4095
  q as FieldShell,
4090
- mt as GRAPH_NODE_MIME,
4091
- Pr as GraphCanvas,
4092
- zn as GraphEdge,
4093
- On as GraphEdgeLayer,
4094
- Un as GraphMiniMap,
4095
- Fn as GraphNode,
4096
- ct as IDENTITY_VIEWPORT,
4097
- Wt as MenuBar,
4098
- Gt as MenuRegistry,
4099
- wr as Modal,
4100
- hn as NexusWorkspaceShell,
4101
- Hn as NodePalette,
4102
- Yr as NumberField,
4103
- rt as PaneHostProvider,
4104
- Wn as PropertyPanel,
4105
- Ln as QuickSearch,
4106
- In as SearchWidget,
4107
- Wr as SelectField,
4108
- Zt as SettingsPanel,
4109
- hn as ShellLayout,
4110
- be as SidebarPane,
4111
- Vr as StaticField,
4112
- rr as StatusBar,
4113
- Je as TERMINAL_PANEL_ID,
4114
- qr as TagField,
4115
- pr as TerminalPane,
4116
- jr as TextAreaField,
4117
- Hr as TextField,
4118
- kr as ThemeSwitcher,
4119
- Mn as TreeWidget,
4120
- Er as UserProfile,
4096
+ ft as GRAPH_NODE_MIME,
4097
+ Rr as GraphCanvas,
4098
+ Kn as GraphEdge,
4099
+ Un as GraphEdgeLayer,
4100
+ jn as GraphMiniMap,
4101
+ _n as GraphNode,
4102
+ dt as IDENTITY_VIEWPORT,
4103
+ Jt as MenuBar,
4104
+ Xt as MenuRegistry,
4105
+ kr as Modal,
4106
+ xn as NexusWorkspaceShell,
4107
+ Gn as NodePalette,
4108
+ Xr as NumberField,
4109
+ Ve as PANE_SIDES,
4110
+ ot as PaneHostProvider,
4111
+ Jn as PropertyPanel,
4112
+ Mn as QuickSearch,
4113
+ Ht as SETTINGS_PANEL_ID,
4114
+ Cn as SearchWidget,
4115
+ Yr as SelectField,
4116
+ pr as SettingsPanel,
4117
+ xn as ShellLayout,
4118
+ Ce as SidebarPane,
4119
+ Zr as StaticField,
4120
+ Qt as StatusBar,
4121
+ qe as TERMINAL_PANEL_ID,
4122
+ Qr as TagField,
4123
+ gr as TerminalPane,
4124
+ Gr as TextAreaField,
4125
+ Wr as TextField,
4126
+ Tr as ThemeSwitcher,
4127
+ An as TreeWidget,
4128
+ Dr as UserProfile,
4121
4129
  oe as borderClass,
4122
- _e as centerOn,
4123
- vn as chatPanel,
4124
- ke as clampScale,
4125
- I as cn,
4130
+ Ue as centerOn,
4131
+ Nn as chatPanel,
4132
+ Ne as clampScale,
4133
+ P as cn,
4126
4134
  re as commandRegistry,
4127
- ot as componentRegistry,
4128
- Xe as createSidebarStore,
4129
- zr as edgePath,
4130
- An as edgesOf,
4135
+ st as componentRegistry,
4136
+ De as createPaneStore,
4137
+ _r as edgePath,
4138
+ Rn as edgesOf,
4131
4139
  Z as fieldId,
4132
- we as findNeighbour,
4133
- Mr as fitViewport,
4134
- Qr as getPath,
4135
- dt as graphBounds,
4136
- Kr as gridLayout,
4137
- xn as initializeShell,
4138
- Pn as isConnected,
4139
- Ke as layeredLayout,
4140
- Se as menuRegistry,
4141
- Rn as nextId,
4140
+ ve as findNeighbour,
4141
+ Cr as fitViewport,
4142
+ en as getPath,
4143
+ ut as graphBounds,
4144
+ Br as gridLayout,
4145
+ yn as initializeShell,
4146
+ Fn as isConnected,
4147
+ Be as layeredLayout,
4148
+ Le as menuRegistry,
4149
+ On as nextId,
4142
4150
  j as nodeRect,
4143
- Cr as placeRelativeTo,
4144
- bn as pluginRegistry,
4145
- Oe as portPoint,
4146
- jn as readPaletteDrag,
4147
- Ee as readValue,
4148
- en as readValues,
4151
+ ce as paneStore,
4152
+ Ar as placeRelativeTo,
4153
+ vn as pluginRegistry,
4154
+ Ke as portPoint,
4155
+ Yn as readPaletteDrag,
4156
+ ke as readValue,
4157
+ rn as readValues,
4149
4158
  J as rectCenter,
4150
- $n as removeNode,
4151
- Sr as resolvePorts,
4152
- pt as setPath,
4153
- wn as terminalPanel,
4154
- qt as themeClass,
4155
- Ne as toGraphSpace,
4156
- Cn as toScreenSpace,
4157
- $e as togglePanel,
4158
- Ir as unionRect,
4159
- de as useChatStore,
4160
- Kn as useGraphKeyboard,
4161
- Bn as useGraphLayout,
4162
- tt as useHostChrome,
4163
- ie as useInspectorStore,
4164
- yn as useKeyboardShortcuts,
4165
- st as useLayoutStore,
4166
- at as useModalStore,
4167
- et as usePaneHost,
4168
- ce as useSidebarStore,
4169
- Le as useStatusBarStore,
4170
- ve as useTerminalStore,
4171
- le as useThemeStore,
4159
+ zn as removeNode,
4160
+ Pr as resolvePorts,
4161
+ Qe as setPanels,
4162
+ ht as setPath,
4163
+ En as settingsPanel,
4164
+ kn as terminalPanel,
4165
+ or as themeClass,
4166
+ we as toGraphSpace,
4167
+ $n as toScreenSpace,
4168
+ Fe as togglePanel,
4169
+ Mr as unionRect,
4170
+ Gt as useBottomPaneStore,
4171
+ le as useChatStore,
4172
+ Hn as useGraphKeyboard,
4173
+ Wn as useGraphLayout,
4174
+ nt as useHostChrome,
4175
+ wn as useKeyboardShortcuts,
4176
+ at as useLayoutStore,
4177
+ jt as useLeftPaneStore,
4178
+ it as useModalStore,
4179
+ rt as usePaneHost,
4180
+ Wt as useRightPaneStore,
4181
+ Ie as useStatusBarStore,
4182
+ ye as useTerminalStore,
4183
+ ie as useThemeStore,
4172
4184
  te as useUserProfileStore,
4173
- Lr as viewportRect,
4174
- Zr as writeValue,
4175
- tn as writeValues,
4176
- ze as zoomAt
4185
+ Sr as viewportRect,
4186
+ tn as writeValue,
4187
+ nn as writeValues,
4188
+ _e as zoomAt
4177
4189
  };