@hachej/boring-workspace 0.1.46 → 0.1.48

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.
@@ -2,9 +2,9 @@ var $o = Object.defineProperty;
2
2
  var Lo = (e, t, n) => t in e ? $o(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Q = (e, t, n) => Lo(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as Oo from "react/jsx-runtime";
5
- import { jsx as u, jsxs as S, Fragment as Me } from "react/jsx-runtime";
5
+ import { jsx as u, jsxs as x, Fragment as Me } from "react/jsx-runtime";
6
6
  import * as Mo from "react";
7
- import { useRef as $, useMemo as Y, useContext as pe, createContext as Ce, useSyncExternalStore as ot, useState as B, useCallback as E, Component as Wo, useEffect as j, createElement as ve, Suspense as Dt, Fragment as gr, lazy as ft, useLayoutEffect as zo } from "react";
7
+ import { useRef as D, useMemo as Y, useContext as pe, createContext as Ce, useSyncExternalStore as ot, useState as j, useCallback as E, Component as Wo, useEffect as M, createElement as ve, Suspense as Dt, Fragment as gr, lazy as ft, useLayoutEffect as zo } from "react";
8
8
  import { AlertTriangleIcon as jo, ImageIcon as Ge, FileTextIcon as Re, FileJsonIcon as Cn, FileCodeIcon as de, FileIcon as _t, X as ln, RefreshCw as Bo, Download as Uo, RefreshCcw as qo, ExternalLink as vr, FolderTree as Ho, TerminalIcon as un, ClockIcon as Vo, ArrowUp as Go, ArrowDown as Ko, CornerDownLeft as Jo, GripVertical as Yo, Plus as Xo, ChevronLeft as Qo, ChevronRight as yr, Pin as Zo, Menu as Rt, Search as En } from "lucide-react";
9
9
  import { Notice as br, IconButton as xe, LoadingState as ei, Input as wr, toast as _e, ErrorState as rt, Skeleton as ti, Spinner as Ft, Button as Oe, AlertDialog as ni, AlertDialogContent as ri, AlertDialogHeader as oi, AlertDialogTitle as ii, AlertDialogDescription as si, AlertDialogFooter as ai, AlertDialogCancel as ci, AlertDialogAction as li, EmptyState as Sr, Kbd as nt, TooltipProvider as ui, Tooltip as di, TooltipTrigger as fi, TooltipContent as pi, Dialog as hi, DialogContent as mi, DialogHeader as gi, DialogTitle as vi, DialogDescription as yi, Command as bi, CommandList as wi, CommandEmpty as Si, CommandInput as xi, CommandGroup as dn, CommandItem as $t, CommandShortcut as ki, Toaster as Pi } from "@hachej/boring-ui-kit";
10
10
  import { useStore as Ue, create as Ci } from "zustand";
@@ -369,7 +369,7 @@ function Bi({
369
369
  surfaceResolverRegistry: r,
370
370
  children: o
371
371
  }) {
372
- const i = $(null), a = $(null);
372
+ const i = D(null), a = D(null);
373
373
  i.current || (i.current = new Er()), a.current || (a.current = new Ir());
374
374
  const l = n ?? i.current, s = r ?? a.current, f = Y(
375
375
  () => ({
@@ -417,8 +417,8 @@ function Hi({ pluginId: e, message: t, kind: n }) {
417
417
  tone: "error",
418
418
  icon: /* @__PURE__ */ u(jo, { className: "size-4" }),
419
419
  className: "py-2",
420
- description: /* @__PURE__ */ S("span", { className: "block min-w-0 truncate", children: [
421
- /* @__PURE__ */ S("span", { className: "font-medium", children: [
420
+ description: /* @__PURE__ */ x("span", { className: "block min-w-0 truncate", children: [
421
+ /* @__PURE__ */ x("span", { className: "font-medium", children: [
422
422
  "[",
423
423
  e,
424
424
  "]"
@@ -433,7 +433,7 @@ function Hi({ pluginId: e, message: t, kind: n }) {
433
433
  }
434
434
  const pn = Ce(null);
435
435
  function Vi({ children: e }) {
436
- const [t, n] = B([]), r = E((i) => {
436
+ const [t, n] = j([]), r = E((i) => {
437
437
  n((a) => [...a, i]);
438
438
  }, []), o = Y(
439
439
  () => ({ errors: t, reportPluginError: r }),
@@ -703,40 +703,40 @@ function cs(e) {
703
703
  onVersionMismatch: s,
704
704
  onConnectionChange: f
705
705
  } = e;
706
- let c = null, d = null, p = null, m = null, g = !1, v = !1, N = 0;
707
- function x(z) {
708
- v || g !== z && (g = z, f == null || f(z));
706
+ let c = null, d = null, p = null, m = null, g = !1, v = !1, k = 0;
707
+ function b(O) {
708
+ v || g !== O && (g = O, f == null || f(O));
709
709
  }
710
- async function _(z) {
710
+ async function _(O) {
711
711
  if (v) return;
712
- const M = as(r, z);
712
+ const $ = as(r, O);
713
713
  try {
714
714
  const I = await fetch(`${t}/api/v1/ui/state`, {
715
715
  method: "PUT",
716
716
  headers: Tn(o),
717
- body: JSON.stringify(M)
717
+ body: JSON.stringify($)
718
718
  });
719
719
  if (v) return;
720
720
  (I.status === 401 || I.status === 403) && (l == null || l(I.status));
721
721
  } catch {
722
722
  }
723
723
  }
724
- function P(z) {
724
+ function W(O) {
725
725
  p !== null && clearTimeout(p), p = setTimeout(() => {
726
- p = null, _(z);
726
+ p = null, _(O);
727
727
  }, is);
728
728
  }
729
- function L(z, M) {
729
+ function B(O, $) {
730
730
  if (!v)
731
- switch (z) {
731
+ switch (O) {
732
732
  case "init": {
733
- x(!0), _("restore");
733
+ b(!0), _("restore");
734
734
  break;
735
735
  }
736
736
  case "command": {
737
737
  let I;
738
738
  try {
739
- I = JSON.parse(M);
739
+ I = JSON.parse($);
740
740
  } catch {
741
741
  return;
742
742
  }
@@ -744,15 +744,15 @@ function cs(e) {
744
744
  s == null || s(I.v);
745
745
  return;
746
746
  }
747
- N++, Rn(n, I.kind, I.params).finally(() => {
748
- N--;
747
+ k++, Rn(n, I.kind, I.params).finally(() => {
748
+ k--;
749
749
  });
750
750
  break;
751
751
  }
752
752
  case "error": {
753
753
  let I;
754
754
  try {
755
- I = JSON.parse(M);
755
+ I = JSON.parse($);
756
756
  } catch {
757
757
  return;
758
758
  }
@@ -765,64 +765,64 @@ function cs(e) {
765
765
  }
766
766
  }
767
767
  }
768
- function A() {
769
- const z = `${t}/api/v1/ui/commands/next`, M = new EventSource(z, { withCredentials: !0 });
770
- M.addEventListener("init", (I) => {
771
- L("init", I.data);
772
- }), M.addEventListener("command", (I) => {
773
- L("command", I.data);
774
- }), M.addEventListener("error", (I) => {
775
- I.data ? L("error", I.data) : x(!1);
776
- }), M.addEventListener("heartbeat", (I) => {
777
- L("heartbeat", I.data);
778
- }), c = M;
768
+ function z() {
769
+ const O = `${t}/api/v1/ui/commands/next`, $ = new EventSource(O, { withCredentials: !0 });
770
+ $.addEventListener("init", (I) => {
771
+ B("init", I.data);
772
+ }), $.addEventListener("command", (I) => {
773
+ B("command", I.data);
774
+ }), $.addEventListener("error", (I) => {
775
+ I.data ? B("error", I.data) : b(!1);
776
+ }), $.addEventListener("heartbeat", (I) => {
777
+ B("heartbeat", I.data);
778
+ }), c = $;
779
779
  }
780
780
  async function h() {
781
781
  if (!v)
782
782
  try {
783
- const z = `${t}/api/v1/ui/commands/next?poll=true`, M = await fetch(z, { headers: Tn(o) });
783
+ const O = `${t}/api/v1/ui/commands/next?poll=true`, $ = await fetch(O, { headers: Tn(o) });
784
784
  if (v) return;
785
- if (M.status === 401 || M.status === 403) {
786
- l == null || l(M.status);
785
+ if ($.status === 401 || $.status === 403) {
786
+ l == null || l($.status);
787
787
  return;
788
788
  }
789
- if (!M.ok) return;
790
- const I = await M.json();
789
+ if (!$.ok) return;
790
+ const I = await $.json();
791
791
  if (!Array.isArray(I)) return;
792
- for (const W of I) {
792
+ for (const L of I) {
793
793
  if (v) return;
794
- if (W.v !== 1) {
795
- s == null || s(W.v);
794
+ if (L.v !== 1) {
795
+ s == null || s(L.v);
796
796
  continue;
797
797
  }
798
- N++;
798
+ k++;
799
799
  try {
800
- await Rn(n, W.kind, W.params);
800
+ await Rn(n, L.kind, L.params);
801
801
  } finally {
802
- N--;
802
+ k--;
803
803
  }
804
804
  }
805
- x(!0);
805
+ b(!0);
806
806
  } catch {
807
- x(!1);
807
+ b(!1);
808
808
  }
809
809
  }
810
810
  function C() {
811
811
  m = r.subscribe(() => {
812
812
  if (v) return;
813
- const z = N > 0 ? "agent" : "user";
814
- P(z);
813
+ const O = k > 0 ? "agent" : "user";
814
+ W(O);
815
815
  });
816
816
  }
817
817
  return {
818
818
  connect() {
819
- v = !1, !i && typeof EventSource < "u" ? A() : (h(), d = setInterval(h, a)), C();
819
+ v = !1, !i && typeof EventSource < "u" ? z() : (h(), d = setInterval(h, a)), C();
820
820
  },
821
821
  disconnect() {
822
- c && (c.close(), c = null), d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), m && (m(), m = null), x(!1), v = !0;
822
+ c && (c.close(), c = null), d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), m && (m(), m = null), b(!1), v = !0;
823
823
  },
824
- pushState(z) {
825
- _(z);
824
+ pushState(O) {
825
+ _(O);
826
826
  }
827
827
  };
828
828
  }
@@ -855,12 +855,19 @@ function ds(e) {
855
855
  }
856
856
  const fs = 60;
857
857
  function Le(e, t, n = fs) {
858
+ var o;
858
859
  const r = e.surface();
859
860
  if (r) {
860
861
  t(r);
861
862
  return;
862
863
  }
863
- !e.isWorkbenchOpen() || n <= 0 || requestAnimationFrame(() => Le(e, t, n - 1));
864
+ if (e.isWorkbenchOpen()) {
865
+ if (n <= 0) {
866
+ (o = e.enqueue) == null || o.call(e, t);
867
+ return;
868
+ }
869
+ requestAnimationFrame(() => Le(e, t, n - 1));
870
+ }
864
871
  }
865
872
  function tn(e, t) {
866
873
  var n, r;
@@ -999,8 +1006,8 @@ function et(e) {
999
1006
  return { cause: "remote", toolCallId: e, ts: Date.now() };
1000
1007
  }
1001
1008
  function nn(e, t) {
1002
- const n = $(t);
1003
- n.current = t, j(() => K.on(e, (r) => n.current(r)), [e]);
1009
+ const n = D(t);
1010
+ n.current = t, M(() => K.on(e, (r) => n.current(r)), [e]);
1004
1011
  }
1005
1012
  function Ss(e) {
1006
1013
  K.emit(Ee.agentData, { ts: Date.now(), part: e });
@@ -1021,44 +1028,44 @@ function Nn(e, t) {
1021
1028
  function Es(e) {
1022
1029
  const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), i = e.fetcher ?? (typeof fetch < "u" ? fetch : null), a = e.reconnectDelayMs ?? Ps, l = e.maxReconnects ?? Cs, s = e.pollIntervalMs ?? ks;
1023
1030
  let f = !1, c = null, d = null, p = null, m = null, g = 0, v = !1;
1024
- function N(P) {
1025
- P && typeof P == "object" && typeof P.kind == "string" && tn(P, n);
1031
+ function k(W) {
1032
+ W && typeof W == "object" && typeof W.kind == "string" && tn(W, n);
1026
1033
  }
1027
- function x() {
1034
+ function b() {
1028
1035
  if (f || v || !i) return;
1029
1036
  v = !0;
1030
- const P = async () => {
1037
+ const W = async () => {
1031
1038
  if (!f) {
1032
1039
  p = new AbortController();
1033
1040
  try {
1034
- const L = await i(Nn(`${t}/api/v1/ui/commands/next?poll=true`, r), {
1041
+ const B = await i(Nn(`${t}/api/v1/ui/commands/next?poll=true`, r), {
1035
1042
  signal: p.signal
1036
1043
  });
1037
1044
  if (f) return;
1038
- if (L.ok) {
1039
- const A = await L.json();
1040
- if (Array.isArray(A)) for (const h of A) N(h);
1045
+ if (B.ok) {
1046
+ const z = await B.json();
1047
+ if (Array.isArray(z)) for (const h of z) k(h);
1041
1048
  }
1042
1049
  } catch {
1043
1050
  } finally {
1044
1051
  p = null;
1045
1052
  }
1046
- f || (d = setTimeout(P, s));
1053
+ f || (d = setTimeout(W, s));
1047
1054
  }
1048
1055
  };
1049
- P();
1056
+ W();
1050
1057
  }
1051
1058
  function _() {
1052
1059
  if (!f) {
1053
1060
  if (!o) {
1054
- x();
1061
+ b();
1055
1062
  return;
1056
1063
  }
1057
- c = new o(Nn(`${t}/api/v1/ui/commands/next`, r)), c.addEventListener("command", (P) => {
1058
- const L = P.data;
1059
- if (!(typeof L != "string" || L.length === 0))
1064
+ c = new o(Nn(`${t}/api/v1/ui/commands/next`, r)), c.addEventListener("command", (W) => {
1065
+ const B = W.data;
1066
+ if (!(typeof B != "string" || B.length === 0))
1060
1067
  try {
1061
- N(JSON.parse(L));
1068
+ k(JSON.parse(B));
1062
1069
  } catch {
1063
1070
  }
1064
1071
  }), c.addEventListener("init", () => {
@@ -1066,7 +1073,7 @@ function Es(e) {
1066
1073
  }), c.addEventListener("error", () => {
1067
1074
  if (!f) {
1068
1075
  if (c == null || c.close(), c = null, g += 1, g > l) {
1069
- x();
1076
+ b();
1070
1077
  return;
1071
1078
  }
1072
1079
  m = setTimeout(_, a * g);
@@ -1123,11 +1130,11 @@ class As {
1123
1130
  continue;
1124
1131
  }
1125
1132
  if (!v.ok) {
1126
- const N = await Ds(v);
1133
+ const k = await Ds(v);
1127
1134
  throw new Je(
1128
1135
  v.status,
1129
1136
  `HTTP ${v.status}: ${v.statusText}`,
1130
- N
1137
+ k
1131
1138
  );
1132
1139
  }
1133
1140
  return await v.json();
@@ -1174,14 +1181,21 @@ class As {
1174
1181
  * `FileConflictError` so the editor can ask the user to reload or
1175
1182
  * force-overwrite. The returned `mtimeMs` is the server's stat
1176
1183
  * after the write; callers use it as the OCC baseline for the
1177
- * next save.
1184
+ * next save. Set `returnMtimeMs: false` only for writes that do
1185
+ * not need a fresh OCC baseline (for example, creating an empty
1186
+ * file before immediately opening/refetching it). That lets remote
1187
+ * sandboxes skip an expensive post-write stat.
1178
1188
  */
1179
1189
  async writeFile(t, n, r) {
1180
1190
  try {
1181
- return { mtimeMs: (await this.request(
1191
+ const o = {
1192
+ path: t,
1193
+ content: n
1194
+ };
1195
+ return (r == null ? void 0 : r.expectedMtimeMs) != null && (o.expectedMtimeMs = r.expectedMtimeMs), (r == null ? void 0 : r.returnMtimeMs) === !1 && (o.returnMtimeMs = !1), { mtimeMs: (await this.request(
1182
1196
  "POST",
1183
1197
  "/api/v1/files",
1184
- (r == null ? void 0 : r.expectedMtimeMs) != null ? { path: t, content: n, expectedMtimeMs: r.expectedMtimeMs } : { path: t, content: n }
1198
+ o
1185
1199
  )).mtimeMs };
1186
1200
  } catch (o) {
1187
1201
  throw o instanceof Je && o.status === 409 ? ut.from(o, t) : o;
@@ -1303,7 +1317,7 @@ function Or(e, t, n) {
1303
1317
  }
1304
1318
  function Ws() {
1305
1319
  const e = xr(), t = Xe(), n = Qe();
1306
- j(() => {
1320
+ M(() => {
1307
1321
  const r = Bs(e), o = /* @__PURE__ */ new Set(), i = (c) => {
1308
1322
  const d = setTimeout(() => {
1309
1323
  o.delete(d), c();
@@ -1406,7 +1420,7 @@ function $n(e, t, n) {
1406
1420
  }
1407
1421
  function Hs() {
1408
1422
  const e = Xe(), t = Qe(), n = xr();
1409
- j(() => {
1423
+ M(() => {
1410
1424
  if (typeof window > "u" || typeof EventSource > "u") return;
1411
1425
  const r = Js(Ks(e, "/api/v1/fs/events"), t);
1412
1426
  let o, i = !1;
@@ -1503,7 +1517,7 @@ function Ys({
1503
1517
  client: o,
1504
1518
  children: i
1505
1519
  }) {
1506
- const a = $(null);
1520
+ const a = D(null);
1507
1521
  a.current || (a.current = new Ii({
1508
1522
  defaultOptions: {
1509
1523
  queries: {
@@ -1516,7 +1530,7 @@ function Ys({
1516
1530
  () => o ?? new As({ apiBaseUrl: e, authHeaders: t, onAuthError: n, timeout: r }),
1517
1531
  [o, e, t, n, r]
1518
1532
  ), s = (t == null ? void 0 : t["x-boring-workspace-id"]) ?? (t == null ? void 0 : t["X-Boring-Workspace-Id"]) ?? null;
1519
- return /* @__PURE__ */ u(Ti, { client: a.current, children: /* @__PURE__ */ u(Mr.Provider, { value: e, children: /* @__PURE__ */ u(Wr.Provider, { value: s, children: /* @__PURE__ */ S(gn.Provider, { value: l, children: [
1533
+ return /* @__PURE__ */ u(Ti, { client: a.current, children: /* @__PURE__ */ u(Mr.Provider, { value: e, children: /* @__PURE__ */ u(Wr.Provider, { value: s, children: /* @__PURE__ */ x(gn.Provider, { value: l, children: [
1520
1534
  /* @__PURE__ */ u(Xs, {}),
1521
1535
  i
1522
1536
  ] }) }) }) });
@@ -1578,8 +1592,8 @@ function ra(e) {
1578
1592
  });
1579
1593
  }
1580
1594
  function oa(e, t) {
1581
- const n = We(), r = Xe(), o = Qe(), [i, a] = B(e), l = $(void 0);
1582
- return j(() => (clearTimeout(l.current), l.current = setTimeout(() => a(e), 300), () => clearTimeout(l.current)), [e]), Lt({
1595
+ const n = We(), r = Xe(), o = Qe(), [i, a] = j(e), l = D(void 0);
1596
+ return M(() => (clearTimeout(l.current), l.current = setTimeout(() => a(e), 300), () => clearTimeout(l.current)), [e]), Lt({
1583
1597
  queryKey: [r, o, "search", i, t],
1584
1598
  queryFn: ({ signal: s }) => n.search(i, t, s),
1585
1599
  enabled: i.length > 0,
@@ -1589,7 +1603,13 @@ function oa(e, t) {
1589
1603
  function Ur() {
1590
1604
  const e = We();
1591
1605
  return Ot({
1592
- mutationFn: ({ path: t, content: n, expectedMtimeMs: r }) => e.writeFile(t, n, r != null ? { expectedMtimeMs: r } : void 0),
1606
+ mutationFn: ({ path: t, content: n, expectedMtimeMs: r, returnMtimeMs: o }) => {
1607
+ const i = {
1608
+ ...r != null ? { expectedMtimeMs: r } : {},
1609
+ ...o === !1 ? { returnMtimeMs: !1 } : {}
1610
+ };
1611
+ return e.writeFile(t, n, Object.keys(i).length > 0 ? i : void 0);
1612
+ },
1593
1613
  onSuccess: (t, { path: n }) => {
1594
1614
  K.emit(ee.changed, { ...it(), path: n });
1595
1615
  }
@@ -1644,12 +1664,12 @@ function da(e) {
1644
1664
  return ve(qr.Provider, { value: { report: t } }, e.children);
1645
1665
  }
1646
1666
  function fa(e) {
1647
- return j(() => {
1667
+ return M(() => {
1648
1668
  e.onReady();
1649
1669
  }, [e.onReady]), ve(gr, null, e.children);
1650
1670
  }
1651
1671
  function pa(e) {
1652
- return j(() => {
1672
+ return M(() => {
1653
1673
  e.onLoading();
1654
1674
  }, [e.onLoading]), ve(
1655
1675
  "div",
@@ -1671,7 +1691,7 @@ function ha(e) {
1671
1691
  ...a ? { error: a } : {}
1672
1692
  });
1673
1693
  }, [n, e.panelId, e.pluginId, e.revision, t]);
1674
- j(() => () => r("missing"), [r]);
1694
+ M(() => () => r("missing"), [r]);
1675
1695
  const o = E((i) => {
1676
1696
  r("error", { code: "PLUGIN_PANEL_RENDER_ERROR", message: i.message });
1677
1697
  }, [r]);
@@ -1987,45 +2007,45 @@ function Pa() {
1987
2007
  );
1988
2008
  }
1989
2009
  function Ca(e) {
1990
- const { api: t } = e, n = e.tabLocation === "headerOverflow", [r, o] = B(t.title ?? t.id), [i, a] = B(null), l = $(null);
1991
- j(() => {
1992
- var O;
2010
+ const { api: t } = e, n = e.tabLocation === "headerOverflow", [r, o] = j(t.title ?? t.id), [i, a] = j(null), l = D(null);
2011
+ M(() => {
2012
+ var F;
1993
2013
  const h = () => o(t.title ?? t.id);
1994
2014
  h();
1995
- const C = (O = t.onDidTitleChange) == null ? void 0 : O.call(t, h);
2015
+ const C = (F = t.onDidTitleChange) == null ? void 0 : F.call(t, h);
1996
2016
  return () => {
1997
- var z;
1998
- return (z = C == null ? void 0 : C.dispose) == null ? void 0 : z.call(C);
2017
+ var O;
2018
+ return (O = C == null ? void 0 : C.dispose) == null ? void 0 : O.call(C);
1999
2019
  };
2000
- }, [t]), j(() => {
2020
+ }, [t]), M(() => {
2001
2021
  if (!i) return;
2002
2022
  function h(C) {
2003
2023
  l.current && !l.current.contains(C.target) && a(null);
2004
2024
  }
2005
2025
  return document.addEventListener("pointerdown", h), () => document.removeEventListener("pointerdown", h);
2006
2026
  }, [i]);
2007
- const s = r.endsWith(" ●"), f = s ? r.slice(0, -2) : r, c = ga(f), d = Sa(e.params, "path") ?? xa(t.id), p = wa(e).map(ba).filter((h) => h.close), m = p.filter((h) => h.id !== t.id), [g, v] = B(!1);
2027
+ const s = r.endsWith(" ●"), f = s ? r.slice(0, -2) : r, c = ga(f), d = Sa(e.params, "path") ?? xa(t.id), p = wa(e).map(ba).filter((h) => h.close), m = p.filter((h) => h.id !== t.id), [g, v] = j(!1);
2008
2028
  nn(Ee.editorSaveStart, (h) => {
2009
2029
  h.panelId === t.id && v(!0);
2010
2030
  }), nn(Ee.editorSaveEnd, (h) => {
2011
2031
  h.panelId === t.id && v(!1);
2012
2032
  });
2013
- const N = (h) => {
2033
+ const k = (h) => {
2014
2034
  h.preventDefault(), h.stopPropagation(), n && h.nativeEvent.stopImmediatePropagation(), t.close(), n && Pa();
2015
- }, x = (h) => {
2035
+ }, b = (h) => {
2016
2036
  !d && m.length === 0 || (h.preventDefault(), h.stopPropagation(), a({ x: h.clientX, y: h.clientY }));
2017
2037
  }, _ = (h) => {
2018
2038
  a(null), ka(h);
2019
- }, P = () => {
2039
+ }, W = () => {
2020
2040
  var h, C;
2021
2041
  a(null), (h = t.setActive) == null || h.call(t);
2022
- for (const O of m) (C = O.close) == null || C.call(O);
2023
- }, L = () => {
2042
+ for (const F of m) (C = F.close) == null || C.call(F);
2043
+ }, B = () => {
2024
2044
  var h, C;
2025
2045
  a(null), (h = t.setActive) == null || h.call(t);
2026
- for (const O of p) (C = O.close) == null || C.call(O);
2027
- }, A = i && typeof document < "u" ? kr(
2028
- /* @__PURE__ */ S(
2046
+ for (const F of p) (C = F.close) == null || C.call(F);
2047
+ }, z = i && typeof document < "u" ? kr(
2048
+ /* @__PURE__ */ x(
2029
2049
  "div",
2030
2050
  {
2031
2051
  ref: l,
@@ -2053,7 +2073,7 @@ function Ca(e) {
2053
2073
  type: "button",
2054
2074
  role: "menuitem",
2055
2075
  className: "flex w-full items-center rounded-sm px-2 py-1.5 text-left text-xs hover:bg-accent hover:text-accent-foreground",
2056
- onClick: P,
2076
+ onClick: W,
2057
2077
  children: "Close other tabs"
2058
2078
  }
2059
2079
  ) : null,
@@ -2063,7 +2083,7 @@ function Ca(e) {
2063
2083
  type: "button",
2064
2084
  role: "menuitem",
2065
2085
  className: "flex w-full items-center rounded-sm px-2 py-1.5 text-left text-xs hover:bg-accent hover:text-accent-foreground",
2066
- onClick: L,
2086
+ onClick: B,
2067
2087
  children: "Close all"
2068
2088
  }
2069
2089
  ) : null
@@ -2072,8 +2092,8 @@ function Ca(e) {
2072
2092
  ),
2073
2093
  document.body
2074
2094
  ) : null;
2075
- return /* @__PURE__ */ S(gr, { children: [
2076
- /* @__PURE__ */ S(
2095
+ return /* @__PURE__ */ x(gr, { children: [
2096
+ /* @__PURE__ */ x(
2077
2097
  "div",
2078
2098
  {
2079
2099
  className: oe(
@@ -2083,9 +2103,9 @@ function Ca(e) {
2083
2103
  ),
2084
2104
  title: s ? `${f} (unsaved changes)` : f,
2085
2105
  onPointerDown: (h) => {
2086
- h.button === 2 && x(h);
2106
+ h.button === 2 && b(h);
2087
2107
  },
2088
- onContextMenu: x,
2108
+ onContextMenu: b,
2089
2109
  children: [
2090
2110
  /* @__PURE__ */ u(
2091
2111
  c,
@@ -2098,7 +2118,7 @@ function Ca(e) {
2098
2118
  }
2099
2119
  ),
2100
2120
  /* @__PURE__ */ u("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: f }),
2101
- /* @__PURE__ */ S("div", { className: "flex shrink-0 items-center gap-1", children: [
2121
+ /* @__PURE__ */ x("div", { className: "flex shrink-0 items-center gap-1", children: [
2102
2122
  s || g ? /* @__PURE__ */ u(
2103
2123
  "span",
2104
2124
  {
@@ -2125,8 +2145,8 @@ function Ca(e) {
2125
2145
  ...n ? (
2126
2146
  // In the overflow popover, intercept on capture so we run before
2127
2147
  // dockview's native row click listener (see handleClose).
2128
- { onClickCapture: N }
2129
- ) : { onClick: N },
2148
+ { onClickCapture: k }
2149
+ ) : { onClick: k },
2130
2150
  "aria-label": `Close ${f}`,
2131
2151
  children: /* @__PURE__ */ u(ln, { className: "h-3 w-3", strokeWidth: 2.25 })
2132
2152
  }
@@ -2135,7 +2155,7 @@ function Ca(e) {
2135
2155
  ]
2136
2156
  }
2137
2157
  ),
2138
- A
2158
+ z
2139
2159
  ] });
2140
2160
  }
2141
2161
  const Ea = 300, Vr = Ce(null);
@@ -2337,72 +2357,72 @@ function Da({
2337
2357
  rightHeaderActions: l,
2338
2358
  watermarkComponent: s
2339
2359
  }) {
2340
- const f = Mt(), c = ot(f.subscribe, f.getSnapshot, f.getSnapshot), d = va(), p = $(null), m = $(null), g = $(void 0), v = $(null), N = Y(() => {
2341
- const L = f.getComponents(), A = o ? Object.fromEntries(Object.entries(L).filter(([C]) => o.includes(C))) : L, h = v.current;
2360
+ const f = Mt(), c = ot(f.subscribe, f.getSnapshot, f.getSnapshot), d = va(), p = D(null), m = D(null), g = D(void 0), v = D(null), k = Y(() => {
2361
+ const B = f.getComponents(), z = o ? Object.fromEntries(Object.entries(B).filter(([C]) => o.includes(C))) : B, h = v.current;
2342
2362
  if (h) {
2343
- const C = Object.keys(h), O = Object.keys(A);
2344
- if (C.length === O.length && O.every((z) => h[z] === A[z]))
2363
+ const C = Object.keys(h), F = Object.keys(z);
2364
+ if (C.length === F.length && F.every((O) => h[O] === z[O]))
2345
2365
  return h;
2346
2366
  }
2347
- return v.current = A, A;
2348
- }, [f, c, o]), x = Y(() => Ra(p), []), _ = E(
2349
- (L) => {
2350
- var A;
2351
- (A = g.current) == null || A.call(g), g.current = Aa(
2352
- L,
2367
+ return v.current = z, z;
2368
+ }, [f, c, o]), b = Y(() => Ra(p), []), _ = E(
2369
+ (B) => {
2370
+ var z;
2371
+ (z = g.current) == null || z.call(g), g.current = Aa(
2372
+ B,
2353
2373
  e,
2354
2374
  t,
2355
2375
  f,
2356
2376
  r,
2357
2377
  p
2358
- ), n == null || n(L.api);
2378
+ ), n == null || n(B.api);
2359
2379
  },
2360
2380
  [e, t, f, r, n]
2361
2381
  );
2362
- j(() => () => {
2363
- var L;
2364
- return (L = g.current) == null ? void 0 : L.call(g);
2365
- }, []), j(() => {
2366
- const L = K.on(Ee.panelUpdate, ({ match: h, params: C, title: O }) => {
2367
- const z = p.current;
2368
- if (z)
2369
- for (const M of On(z, h))
2370
- C && M.api.updateParameters({
2371
- ...M.params ?? {},
2382
+ M(() => () => {
2383
+ var B;
2384
+ return (B = g.current) == null ? void 0 : B.call(g);
2385
+ }, []), M(() => {
2386
+ const B = K.on(Ee.panelUpdate, ({ match: h, params: C, title: F }) => {
2387
+ const O = p.current;
2388
+ if (O)
2389
+ for (const $ of On(O, h))
2390
+ C && $.api.updateParameters({
2391
+ ...$.params ?? {},
2372
2392
  ...C
2373
- }), O && M.api.setTitle(O);
2374
- }), A = K.on(Ee.panelClose, ({ match: h }) => {
2393
+ }), F && $.api.setTitle(F);
2394
+ }), z = K.on(Ee.panelClose, ({ match: h }) => {
2375
2395
  const C = p.current;
2376
2396
  if (C)
2377
- for (const O of On(C, h))
2378
- C.removePanel(O);
2397
+ for (const F of On(C, h))
2398
+ C.removePanel(F);
2379
2399
  });
2380
2400
  return () => {
2381
- L(), A();
2401
+ B(), z();
2382
2402
  };
2383
2403
  }, []);
2384
- const P = E(
2385
- (L) => {
2404
+ const W = E(
2405
+ (B) => {
2386
2406
  if (!d) {
2387
- m.current = L;
2407
+ m.current = B;
2388
2408
  return;
2389
2409
  }
2390
- _(L);
2410
+ _(B);
2391
2411
  },
2392
2412
  [d, _]
2393
2413
  );
2394
- return j(() => {
2414
+ return M(() => {
2395
2415
  d && m.current && (_(m.current), m.current = null);
2396
- }, [d, _]), d ? /* @__PURE__ */ u(Vr.Provider, { value: x, children: /* @__PURE__ */ u(
2416
+ }, [d, _]), d ? /* @__PURE__ */ u(Vr.Provider, { value: b, children: /* @__PURE__ */ u(
2397
2417
  Pr,
2398
2418
  {
2399
2419
  className: `dv-shell ${i ?? ""}`,
2400
- components: N,
2420
+ components: k,
2401
2421
  defaultTabComponent: Ca,
2402
2422
  prefixHeaderActionsComponent: a,
2403
2423
  rightHeaderActionsComponent: l,
2404
2424
  watermarkComponent: s,
2405
- onReady: P
2425
+ onReady: W
2406
2426
  }
2407
2427
  ) }) : /* @__PURE__ */ u(_a, {});
2408
2428
  }
@@ -2442,8 +2462,8 @@ function $a({
2442
2462
  return Y(
2443
2463
  () => i ? Fa(i) : null,
2444
2464
  [i]
2445
- ), /* @__PURE__ */ S("div", { className: oe("flex h-full flex-col overflow-hidden", o), children: [
2446
- /* @__PURE__ */ S("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
2465
+ ), /* @__PURE__ */ x("div", { className: oe("flex h-full flex-col overflow-hidden", o), children: [
2466
+ /* @__PURE__ */ x("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
2447
2467
  t && /* @__PURE__ */ u(t, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
2448
2468
  /* @__PURE__ */ u("span", { className: "truncate text-sm font-medium", children: e }),
2449
2469
  /* @__PURE__ */ u("div", { className: "flex-1" }),
@@ -2548,7 +2568,7 @@ async function Wn(e) {
2548
2568
  }
2549
2569
  if (!n) throw new Error("Clipboard not available");
2550
2570
  }
2551
- const Kr = () => import("./FileTree-DKzSeYJX.js").then((e) => ({ default: e.FileTree }));
2571
+ const Kr = () => import("./FileTree-CoZWkHqn.js").then((e) => ({ default: e.FileTree }));
2552
2572
  function Wa() {
2553
2573
  Kr();
2554
2574
  }
@@ -2590,58 +2610,58 @@ function jn({
2590
2610
  className: i
2591
2611
  }) {
2592
2612
  var Pn;
2593
- const a = We(), { data: l, error: s, isLoading: f } = Br(e), [c, d] = B(/* @__PURE__ */ new Map()), [p, m] = B(/* @__PURE__ */ new Set()), g = qt(e), v = Y(
2613
+ const a = We(), { data: l, error: s, isLoading: f } = Br(e), [c, d] = j(/* @__PURE__ */ new Map()), [p, m] = j(/* @__PURE__ */ new Set()), g = qt(e), v = Y(
2594
2614
  () => Vt(Ht(l, c.get(g)), p),
2595
2615
  [l, c, g, p]
2596
- ), N = Y(
2616
+ ), k = Y(
2597
2617
  () => Oa(v, o),
2598
2618
  [v, o]
2599
- ), { mutateAsync: x } = Ur(), { mutateAsync: _ } = ia(), { mutateAsync: P } = sa(), { mutateAsync: L } = aa(), [A, h] = B(/* @__PURE__ */ new Map()), C = Y(() => {
2600
- if (c.size === 0 && p.size === 0) return A;
2619
+ ), { mutateAsync: b } = Ur(), { mutateAsync: _ } = ia(), { mutateAsync: W } = sa(), { mutateAsync: B } = aa(), [z, h] = j(/* @__PURE__ */ new Map()), C = Y(() => {
2620
+ if (c.size === 0 && p.size === 0) return z;
2601
2621
  const y = /* @__PURE__ */ new Map();
2602
- for (const [b, k] of A)
2603
- y.set(b, Vt(k, p) ?? k);
2604
- for (const [b, k] of c) {
2605
- if (b === g) continue;
2606
- const V = Vt(Ht(y.get(b), k), p);
2607
- V && y.set(b, V);
2622
+ for (const [w, P] of z)
2623
+ y.set(w, Vt(P, p) ?? P);
2624
+ for (const [w, P] of c) {
2625
+ if (w === g) continue;
2626
+ const V = Vt(Ht(y.get(w), P), p);
2627
+ V && y.set(w, V);
2608
2628
  }
2609
2629
  return y;
2610
- }, [A, c, g, p]), O = $(null), [z, M] = B(400), [I, W] = B(null), T = I && !I.isBackground && I.node.kind === "file" ? I.node.path : null, { data: F } = ra(T), [J, H] = B(null), te = $(null), [X, ae] = B(
2630
+ }, [z, c, g, p]), F = D(null), [O, $] = j(400), [I, L] = j(null), T = I && !I.isBackground && I.node.kind === "file" ? I.node.path : null, { data: A } = ra(T), [J, H] = j(null), te = D(null), [X, ae] = j(
2611
2631
  ((Pn = n == null ? void 0 : n.getActiveFile) == null ? void 0 : Pn.call(n)) ?? null
2612
- ), [ue, q] = B(null), [ce, fe] = B(null), ke = $(0), Pe = $(0), He = $(0), Ve = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Ie } = oa(
2632
+ ), [ue, q] = j(null), [ce, fe] = j(null), ke = D(0), Pe = D(0), He = D(0), Ve = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Ie } = oa(
2613
2633
  Ve ? Gr(t ?? "") : "",
2614
2634
  50
2615
2635
  );
2616
- j(() => {
2636
+ M(() => {
2617
2637
  if (!I) return;
2618
- function y(b) {
2619
- te.current && !te.current.contains(b.target) && W(null);
2638
+ function y(w) {
2639
+ te.current && !te.current.contains(w.target) && L(null);
2620
2640
  }
2621
2641
  return document.addEventListener("pointerdown", y), () => document.removeEventListener("pointerdown", y);
2622
2642
  }, [I]), zo(() => {
2623
2643
  if (!I || !te.current) return;
2624
- const { x: y, y: b } = Ba(
2644
+ const { x: y, y: w } = Ba(
2625
2645
  I.x,
2626
2646
  I.y,
2627
2647
  te.current.getBoundingClientRect(),
2628
2648
  window.innerWidth,
2629
2649
  window.innerHeight
2630
2650
  );
2631
- y === I.x && b === I.y || W((k) => !k || k.x === y && k.y === b ? k : { ...k, x: y, y: b });
2632
- }, [I]), j(() => {
2633
- const y = O.current;
2651
+ y === I.x && w === I.y || L((P) => !P || P.x === y && P.y === w ? P : { ...P, x: y, y: w });
2652
+ }, [I]), M(() => {
2653
+ const y = F.current;
2634
2654
  if (!y) return;
2635
- const b = new ResizeObserver(([k]) => {
2636
- k && M(Math.floor(k.contentRect.height));
2655
+ const w = new ResizeObserver(([P]) => {
2656
+ P && $(Math.floor(P.contentRect.height));
2637
2657
  });
2638
- return b.observe(y), () => b.disconnect();
2658
+ return w.observe(y), () => w.disconnect();
2639
2659
  }, []);
2640
2660
  const me = (Ve && Ie ? Ie.map((y) => ({
2641
2661
  name: y.split("/").pop() ?? y,
2642
2662
  kind: "file",
2643
2663
  path: y
2644
- })) : void 0) ?? Lr(N ?? [], C), Ne = Or(me, ue, e), Te = E(
2664
+ })) : void 0) ?? Lr(k ?? [], C), Ne = Or(me, ue, e), Te = E(
2645
2665
  (y) => {
2646
2666
  ae(y), n == null || n.openFile(y, { mode: "edit" });
2647
2667
  },
@@ -2649,20 +2669,20 @@ function jn({
2649
2669
  ), Ze = E(
2650
2670
  async (y) => {
2651
2671
  try {
2652
- const b = await a.getTree(y), k = o.length === 0 ? b : b.filter((V) => !an(V.name, o));
2653
- h((V) => new Map(V).set(y, k));
2672
+ const w = await a.getTree(y), P = o.length === 0 ? w : w.filter((V) => !an(V.name, o));
2673
+ h((V) => new Map(V).set(y, P));
2654
2674
  } catch {
2655
2675
  }
2656
2676
  },
2657
2677
  [a, o]
2658
2678
  ), he = E(
2659
- async (y, b) => {
2660
- const k = Array.from(new Set(y)).filter(
2679
+ async (y, w) => {
2680
+ const P = Array.from(new Set(y)).filter(
2661
2681
  (U) => U && U !== e && U !== "."
2662
2682
  );
2663
- if (k.length === 0) return;
2683
+ if (P.length === 0) return;
2664
2684
  const V = await Promise.all(
2665
- k.map(async (U) => {
2685
+ P.map(async (U) => {
2666
2686
  try {
2667
2687
  const ne = await a.getTree(U), re = o.length === 0 ? ne : ne.filter((we) => !an(we.name, o));
2668
2688
  return [U, re];
@@ -2676,17 +2696,17 @@ function jn({
2676
2696
  for (const re of V) {
2677
2697
  if (!re) continue;
2678
2698
  const [we, De] = re;
2679
- (b != null && b.force || ne.has(we)) && ne.set(we, De);
2699
+ (w != null && w.force || ne.has(we)) && ne.set(we, De);
2680
2700
  }
2681
2701
  return ne;
2682
2702
  });
2683
2703
  },
2684
2704
  [a, e, o]
2685
- ), ze = $(/* @__PURE__ */ new Set());
2686
- j(() => {
2687
- ze.current = new Set(A.keys());
2688
- }, [A]), j(() => {
2689
- const y = /* @__PURE__ */ new Set(), b = (re) => Array.from(new Set(re.map(Se))).filter((we) => ze.current.has(we)), k = (re) => {
2705
+ ), ze = D(/* @__PURE__ */ new Set());
2706
+ M(() => {
2707
+ ze.current = new Set(z.keys());
2708
+ }, [z]), M(() => {
2709
+ const y = /* @__PURE__ */ new Set(), w = (re) => Array.from(new Set(re.map(Se))).filter((we) => ze.current.has(we)), P = (re) => {
2690
2710
  if (!re.length) return;
2691
2711
  he(re);
2692
2712
  const we = setTimeout(() => {
@@ -2694,11 +2714,11 @@ function jn({
2694
2714
  }, ja);
2695
2715
  y.add(we);
2696
2716
  }, V = K.on(ee.created, (re) => {
2697
- re.cause !== "user" && k(b([re.path]));
2717
+ re.cause !== "user" && P(w([re.path]));
2698
2718
  }), U = K.on(ee.deleted, (re) => {
2699
- re.cause !== "user" && k(b([re.path]));
2719
+ re.cause !== "user" && P(w([re.path]));
2700
2720
  }), ne = K.on(ee.moved, (re) => {
2701
- re.cause !== "user" && k(b([re.from, re.to]));
2721
+ re.cause !== "user" && P(w([re.from, re.to]));
2702
2722
  });
2703
2723
  return () => {
2704
2724
  V(), U(), ne();
@@ -2707,105 +2727,105 @@ function jn({
2707
2727
  };
2708
2728
  }, [he]);
2709
2729
  const Ae = E(
2710
- async (y, b) => {
2730
+ async (y, w) => {
2711
2731
  if (!y) return;
2712
- const k = Jr(y), V = ++ke.current;
2713
- ae(k);
2714
- const U = b != null && b.refreshTargetDir ? [...zn(k), k] : zn(k);
2715
- await he([...new Set(U)], { force: !0 }), ke.current === V && fe(k);
2732
+ const P = Jr(y), V = ++ke.current;
2733
+ ae(P);
2734
+ const U = w != null && w.refreshTargetDir ? [...zn(P), P] : zn(P);
2735
+ await he([...new Set(U)], { force: !0 }), ke.current === V && fe(P);
2716
2736
  },
2717
2737
  [he]
2718
2738
  ), st = E((y) => {
2719
- fe((b) => b === y ? null : b);
2720
- }, []), w = E(
2739
+ fe((w) => w === y ? null : w);
2740
+ }, []), S = E(
2721
2741
  async (y) => {
2722
- const b = ++Pe.current;
2742
+ const w = ++Pe.current;
2723
2743
  try {
2724
2744
  await Ae(y, { refreshTargetDir: !0 });
2725
2745
  } finally {
2726
- Pe.current === b && (Pe.current = 0);
2746
+ Pe.current === w && (Pe.current = 0);
2727
2747
  }
2728
2748
  },
2729
2749
  [Ae]
2730
2750
  );
2731
- j(() => {
2732
- r && w(r.path);
2733
- }, [r, w]), j(() => {
2734
- var k;
2735
- const y = ((k = n == null ? void 0 : n.getActiveFile) == null ? void 0 : k.call(n)) ?? null;
2751
+ M(() => {
2752
+ r && S(r.path);
2753
+ }, [r, S]), M(() => {
2754
+ var P;
2755
+ const y = ((P = n == null ? void 0 : n.getActiveFile) == null ? void 0 : P.call(n)) ?? null;
2736
2756
  y && Pe.current === 0 && Ae(y);
2737
- const b = [];
2738
- return n != null && n.select && b.push(
2757
+ const w = [];
2758
+ return n != null && n.select && w.push(
2739
2759
  n.select((V) => V.activeFile, (V) => {
2740
2760
  V ? Pe.current === 0 && Ae(V) : ae(null);
2741
2761
  })
2742
- ), n != null && n.subscribe && b.push(
2762
+ ), n != null && n.subscribe && w.push(
2743
2763
  n.subscribe("tree:expand", ({ path: V }) => {
2744
- w(V);
2764
+ S(V);
2745
2765
  })
2746
2766
  ), () => {
2747
- for (const V of b) V();
2767
+ for (const V of w) V();
2748
2768
  };
2749
- }, [n, w, Ae]);
2750
- const D = E((y, b) => {
2751
- d((k) => {
2752
- const V = qt(y), U = new Map(k), ne = Ht(U.get(V), [b]) ?? [b];
2769
+ }, [n, S, Ae]);
2770
+ const N = E((y, w) => {
2771
+ d((P) => {
2772
+ const V = qt(y), U = new Map(P), ne = Ht(U.get(V), [w]) ?? [w];
2753
2773
  return U.set(V, ne), U;
2754
2774
  });
2755
- }, []), R = E((y, b) => {
2756
- d((k) => {
2757
- const V = qt(y), U = k.get(V);
2758
- if (!(U != null && U.length)) return k;
2759
- const ne = U.filter((we) => we.path !== b), re = new Map(k);
2775
+ }, []), R = E((y, w) => {
2776
+ d((P) => {
2777
+ const V = qt(y), U = P.get(V);
2778
+ if (!(U != null && U.length)) return P;
2779
+ const ne = U.filter((we) => we.path !== w), re = new Map(P);
2760
2780
  return ne.length > 0 ? re.set(V, ne) : re.delete(V), re;
2761
2781
  });
2762
2782
  }, []), G = E((y) => {
2763
- m((b) => {
2764
- if (b.has(y)) return b;
2765
- const k = new Set(b);
2766
- return k.add(y), k;
2783
+ m((w) => {
2784
+ if (w.has(y)) return w;
2785
+ const P = new Set(w);
2786
+ return P.add(y), P;
2767
2787
  });
2768
2788
  }, []), ie = E((y) => {
2769
- m((b) => {
2770
- if (!b.has(y)) return b;
2771
- const k = new Set(b);
2772
- return k.delete(y), k;
2789
+ m((w) => {
2790
+ if (!w.has(y)) return w;
2791
+ const P = new Set(w);
2792
+ return P.delete(y), P;
2773
2793
  });
2774
2794
  }, []);
2775
- j(() => {
2776
- const y = (U) => U === g || ze.current.has(U), b = K.on(ee.created, (U) => {
2795
+ M(() => {
2796
+ const y = (U) => U === g || ze.current.has(U), w = K.on(ee.created, (U) => {
2777
2797
  if (ie(U.path), U.cause === "user") return;
2778
2798
  const ne = Se(U.path);
2779
- y(ne) && D(ne, { name: Ua(U.path), kind: U.kind, path: U.path });
2780
- }), k = K.on(ee.deleted, (U) => {
2799
+ y(ne) && N(ne, { name: Ua(U.path), kind: U.kind, path: U.path });
2800
+ }), P = K.on(ee.deleted, (U) => {
2781
2801
  U.cause !== "user" && (G(U.path), R(Se(U.path), U.path));
2782
2802
  }), V = K.on(ee.moved, (U) => {
2783
2803
  U.cause !== "user" && (G(U.from), ie(U.to), R(Se(U.from), U.from));
2784
2804
  });
2785
2805
  return () => {
2786
- b(), k(), V();
2806
+ w(), P(), V();
2787
2807
  };
2788
- }, [D, G, R, g, ie]);
2789
- const [ye, be] = B(/* @__PURE__ */ new Set()), se = E((y) => {
2790
- be((b) => {
2791
- const k = new Set(b);
2792
- return k.add(y), k;
2808
+ }, [N, G, R, g, ie]);
2809
+ const [ye, be] = j(/* @__PURE__ */ new Set()), se = E((y) => {
2810
+ be((w) => {
2811
+ const P = new Set(w);
2812
+ return P.add(y), P;
2793
2813
  });
2794
2814
  }, []), ge = E((y) => {
2795
- be((b) => {
2796
- if (!b.has(y)) return b;
2797
- const k = new Set(b);
2798
- return k.delete(y), k;
2815
+ be((w) => {
2816
+ if (!w.has(y)) return w;
2817
+ const P = new Set(w);
2818
+ return P.delete(y), P;
2799
2819
  });
2800
2820
  }, []), ht = E(
2801
- (y, b) => {
2802
- W({ node: b, x: y.clientX, y: y.clientY });
2821
+ (y, w) => {
2822
+ L({ node: w, x: y.clientX, y: y.clientY });
2803
2823
  },
2804
2824
  []
2805
2825
  ), mt = E(
2806
2826
  (y) => {
2807
- const b = y.target;
2808
- b.closest("[role=treeitem]") || b.closest("[data-path]") || (y.preventDefault(), W({
2827
+ const w = y.target;
2828
+ w.closest("[role=treeitem]") || w.closest("[data-path]") || (y.preventDefault(), L({
2809
2829
  node: { name: e, kind: "dir", path: e },
2810
2830
  x: y.clientX,
2811
2831
  y: y.clientY,
@@ -2814,12 +2834,12 @@ function jn({
2814
2834
  },
2815
2835
  [e]
2816
2836
  ), Ut = E(
2817
- async (y, b) => {
2818
- const k = y.split("/").pop() ?? y, V = b === "." ? e : b, U = V === "." ? k : `${V}/${k}`;
2837
+ async (y, w) => {
2838
+ const P = y.split("/").pop() ?? y, V = w === "." ? e : w, U = V === "." ? P : `${V}/${P}`;
2819
2839
  if (U !== y) {
2820
2840
  se(y);
2821
2841
  try {
2822
- await P({ from: y, to: U }), await he([Se(y), Se(U)]), _e.success({ title: "Moved", description: `${y} → ${U}` });
2842
+ await W({ from: y, to: U }), await he([Se(y), Se(U)]), _e.success({ title: "Moved", description: `${y} → ${U}` });
2823
2843
  } catch (ne) {
2824
2844
  _e.error({
2825
2845
  title: "Move failed",
@@ -2830,53 +2850,53 @@ function jn({
2830
2850
  }
2831
2851
  }
2832
2852
  },
2833
- [P, he, e, se, ge]
2853
+ [W, he, e, se, ge]
2834
2854
  );
2835
2855
  function gt(y) {
2836
2856
  return () => {
2837
- W(null), (async () => {
2857
+ L(null), (async () => {
2838
2858
  try {
2839
2859
  await y();
2840
- } catch (b) {
2860
+ } catch (w) {
2841
2861
  _e.error({
2842
2862
  title: "Action failed",
2843
- description: b instanceof Error ? b.message : String(b)
2863
+ description: w instanceof Error ? w.message : String(w)
2844
2864
  });
2845
2865
  }
2846
2866
  })();
2847
2867
  };
2848
2868
  }
2849
2869
  const kn = (y) => {
2850
- const b = I == null ? void 0 : I.node;
2851
- W(null);
2852
- const k = (b == null ? void 0 : b.kind) === "dir" ? b.path : b ? Se(b.path) : e, V = `__draft__:${++He.current}`;
2853
- q({ kind: y, parentDir: k, path: V });
2870
+ const w = I == null ? void 0 : I.node;
2871
+ L(null);
2872
+ const P = (w == null ? void 0 : w.kind) === "dir" ? w.path : w ? Se(w.path) : e, V = `__draft__:${++He.current}`;
2873
+ q({ kind: y, parentDir: P, path: V });
2854
2874
  }, Eo = () => kn("create-file"), Io = () => kn("create-folder"), To = () => {
2855
2875
  const y = I == null ? void 0 : I.node;
2856
- W(null), y && q({ kind: "rename", path: y.path, initialValue: y.name });
2876
+ L(null), y && q({ kind: "rename", path: y.path, initialValue: y.name });
2857
2877
  }, Ro = E(
2858
- async (y, b) => {
2859
- const k = ue;
2860
- if (q(null), !k) return;
2861
- const V = b.trim();
2878
+ async (y, w) => {
2879
+ const P = ue;
2880
+ if (q(null), !P) return;
2881
+ const V = w.trim();
2862
2882
  if (!V) return;
2863
- const U = k.kind === "rename" ? Se(k.path) : k.parentDir, ne = k.kind === "rename" ? k.path : U === "." || U === "" ? V : `${U}/${V}`, re = k.kind === "rename" ? k.path : ne;
2883
+ const U = P.kind === "rename" ? Se(P.path) : P.parentDir, ne = P.kind === "rename" ? P.path : U === "." || U === "" ? V : `${U}/${V}`, re = P.kind === "rename" ? P.path : ne;
2864
2884
  se(re);
2865
2885
  let we = null;
2866
2886
  try {
2867
- if (k.kind === "rename") {
2868
- if (V === k.initialValue) return;
2869
- const De = k.path.split("/");
2887
+ if (P.kind === "rename") {
2888
+ if (V === P.initialValue) return;
2889
+ const De = P.path.split("/");
2870
2890
  De[De.length - 1] = V;
2871
2891
  const vt = De.join("/");
2872
- await P({ from: k.path, to: vt }), await he([Se(k.path)]), _e.success({ title: "Renamed", description: `${k.path} → ${vt}` });
2892
+ await W({ from: P.path, to: vt }), await he([Se(P.path)]), _e.success({ title: "Renamed", description: `${P.path} → ${vt}` });
2873
2893
  } else {
2874
2894
  const De = {
2875
2895
  name: V,
2876
- kind: k.kind === "create-file" ? "file" : "dir",
2896
+ kind: P.kind === "create-file" ? "file" : "dir",
2877
2897
  path: ne
2878
2898
  };
2879
- D(U, De), we = ne, k.kind === "create-file" ? (await x({ path: ne, content: "" }), K.emit(ee.created, {
2899
+ N(U, De), we = ne, P.kind === "create-file" ? (await b({ path: ne, content: "", returnMtimeMs: !1 }), K.emit(ee.created, {
2880
2900
  ...it(),
2881
2901
  path: ne,
2882
2902
  kind: "file"
@@ -2886,7 +2906,7 @@ function jn({
2886
2906
  we && R(U, we);
2887
2907
  const vt = De instanceof Error ? De.message : String(De);
2888
2908
  _e.error({
2889
- title: k.kind === "rename" ? "Rename failed" : k.kind === "create-file" ? "Create file failed" : "Create folder failed",
2909
+ title: P.kind === "rename" ? "Rename failed" : P.kind === "create-file" ? "Create file failed" : "Create folder failed",
2890
2910
  description: vt
2891
2911
  });
2892
2912
  } finally {
@@ -2895,13 +2915,13 @@ function jn({
2895
2915
  },
2896
2916
  [
2897
2917
  ue,
2898
- P,
2899
- x,
2918
+ W,
2919
+ b,
2900
2920
  _,
2901
2921
  he,
2902
2922
  se,
2903
2923
  ge,
2904
- D,
2924
+ N,
2905
2925
  R,
2906
2926
  Te
2907
2927
  ]
@@ -2910,37 +2930,37 @@ function jn({
2910
2930
  }, []), Ao = gt(async () => {
2911
2931
  I != null && I.node && (await Wn(I.node.path), _e.success({ title: "Path copied", description: I.node.path }));
2912
2932
  }), Do = gt(async () => {
2913
- if (!(F != null && F.enabled) || !F.url)
2914
- throw new Error((F == null ? void 0 : F.reason) ?? "Git URL unavailable");
2915
- await Wn(F.url), _e.success({ title: "Git URL copied", description: F.url });
2933
+ if (!(A != null && A.enabled) || !A.url)
2934
+ throw new Error((A == null ? void 0 : A.reason) ?? "Git URL unavailable");
2935
+ await Wn(A.url), _e.success({ title: "Git URL copied", description: A.url });
2916
2936
  }), _o = E(async () => {
2917
2937
  if (!J) return;
2918
2938
  const y = J;
2919
2939
  H(null), se(y.path);
2920
2940
  try {
2921
- await L({ path: y.path }), R(Se(y.path), y.path), y.kind === "dir" && h((b) => {
2922
- const k = new Map(b);
2923
- for (const V of k.keys())
2924
- (V === y.path || V.startsWith(`${y.path}/`)) && k.delete(V);
2925
- return k;
2941
+ await B({ path: y.path }), R(Se(y.path), y.path), y.kind === "dir" && h((w) => {
2942
+ const P = new Map(w);
2943
+ for (const V of P.keys())
2944
+ (V === y.path || V.startsWith(`${y.path}/`)) && P.delete(V);
2945
+ return P;
2926
2946
  }), await he([Se(y.path)]), _e.success({ title: "Deleted", description: y.path });
2927
- } catch (b) {
2947
+ } catch (w) {
2928
2948
  _e.error({
2929
2949
  title: "Delete failed",
2930
- description: b instanceof Error ? b.message : String(b)
2950
+ description: w instanceof Error ? w.message : String(w)
2931
2951
  });
2932
2952
  } finally {
2933
2953
  ge(y.path);
2934
2954
  }
2935
2955
  }, [
2936
2956
  J,
2937
- L,
2957
+ B,
2938
2958
  he,
2939
2959
  se,
2940
2960
  ge,
2941
2961
  R
2942
2962
  ]), Fo = !Ve && ((t == null ? void 0 : t.length) ?? 0) > 0 ? t : void 0;
2943
- return /* @__PURE__ */ S("div", { className: "flex h-full min-h-0 flex-col", children: [
2963
+ return /* @__PURE__ */ x("div", { className: "flex h-full min-h-0 flex-col", children: [
2944
2964
  s && /* @__PURE__ */ u(
2945
2965
  rt,
2946
2966
  {
@@ -2952,20 +2972,20 @@ function jn({
2952
2972
  /* @__PURE__ */ u(
2953
2973
  "div",
2954
2974
  {
2955
- ref: O,
2975
+ ref: F,
2956
2976
  className: "min-h-0 flex-1 overflow-hidden",
2957
2977
  onContextMenu: mt,
2958
- children: f ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((y, b) => /* @__PURE__ */ u(
2978
+ children: f ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((y, w) => /* @__PURE__ */ u(
2959
2979
  ti,
2960
2980
  {
2961
2981
  className: "h-5",
2962
- style: { width: `${60 + b * 13 % 30}%` }
2982
+ style: { width: `${60 + w * 13 % 30}%` }
2963
2983
  },
2964
- b
2984
+ w
2965
2985
  )) }) : /* @__PURE__ */ u(
2966
2986
  Dt,
2967
2987
  {
2968
- fallback: /* @__PURE__ */ S("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
2988
+ fallback: /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
2969
2989
  /* @__PURE__ */ u(Ft, { className: "size-3.5" }),
2970
2990
  /* @__PURE__ */ u("span", { children: "Loading..." })
2971
2991
  ] }),
@@ -2989,7 +3009,7 @@ function jn({
2989
3009
  onSubmitEdit: Ro,
2990
3010
  onCancelEdit: No,
2991
3011
  onDragDrop: Ut,
2992
- height: z,
3012
+ height: O,
2993
3013
  className: oe(i)
2994
3014
  }
2995
3015
  )
@@ -2998,7 +3018,7 @@ function jn({
2998
3018
  }
2999
3019
  ),
3000
3020
  I && kr(
3001
- /* @__PURE__ */ S(
3021
+ /* @__PURE__ */ x(
3002
3022
  "div",
3003
3023
  {
3004
3024
  ref: te,
@@ -3008,7 +3028,7 @@ function jn({
3008
3028
  children: [
3009
3029
  /* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Eo, children: "New file" }),
3010
3030
  /* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Io, children: "New folder" }),
3011
- !I.isBackground && /* @__PURE__ */ S(Me, { children: [
3031
+ !I.isBackground && /* @__PURE__ */ x(Me, { children: [
3012
3032
  /* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: To, children: "Rename" }),
3013
3033
  /* @__PURE__ */ u(
3014
3034
  Oe,
@@ -3019,13 +3039,13 @@ function jn({
3019
3039
  size: "sm",
3020
3040
  className: "w-full justify-start text-destructive hover:bg-destructive/10 hover:text-destructive",
3021
3041
  onClick: () => {
3022
- H(I.node), W(null);
3042
+ H(I.node), L(null);
3023
3043
  },
3024
3044
  children: "Delete"
3025
3045
  }
3026
3046
  ),
3027
3047
  /* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Ao, children: "Copy path" }),
3028
- F != null && F.enabled ? /* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Do, children: "Copy Git URL" }) : F != null && F.reason ? /* @__PURE__ */ u("div", { className: "px-2 py-1 text-xs text-muted-foreground", "aria-live": "polite", children: F.reason }) : null
3048
+ A != null && A.enabled ? /* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Do, children: "Copy Git URL" }) : A != null && A.reason ? /* @__PURE__ */ u("div", { className: "px-2 py-1 text-xs text-muted-foreground", "aria-live": "polite", children: A.reason }) : null
3029
3049
  ] })
3030
3050
  ]
3031
3051
  }
@@ -3043,16 +3063,16 @@ function jn({
3043
3063
  onOpenChange: (y) => {
3044
3064
  y || H(null);
3045
3065
  },
3046
- children: /* @__PURE__ */ S(ri, { children: [
3047
- /* @__PURE__ */ S(oi, { children: [
3048
- /* @__PURE__ */ S(ii, { children: [
3066
+ children: /* @__PURE__ */ x(ri, { children: [
3067
+ /* @__PURE__ */ x(oi, { children: [
3068
+ /* @__PURE__ */ x(ii, { children: [
3049
3069
  "Delete ",
3050
3070
  J == null ? void 0 : J.name,
3051
3071
  "?"
3052
3072
  ] }),
3053
3073
  /* @__PURE__ */ u(si, { children: "This action cannot be undone." })
3054
3074
  ] }),
3055
- /* @__PURE__ */ S(ai, { children: [
3075
+ /* @__PURE__ */ x(ai, { children: [
3056
3076
  /* @__PURE__ */ u(ci, { children: "Cancel" }),
3057
3077
  /* @__PURE__ */ u(li, { onClick: _o, children: "Delete" })
3058
3078
  ] })
@@ -3071,25 +3091,25 @@ function qa({
3071
3091
  chromeless: a = !1,
3072
3092
  className: l
3073
3093
  }) {
3074
- const s = (e == null ? void 0 : e.rootDir) ?? t, f = (e == null ? void 0 : e.bridge) ?? o, c = (e == null ? void 0 : e.chromeless) ?? a, d = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, m = r ?? i, [g, v] = B(""), [N, x] = B(""), _ = $(void 0);
3075
- j(() => (clearTimeout(_.current), _.current = setTimeout(() => x(g), 200), () => clearTimeout(_.current)), [g]);
3076
- const P = p !== void 0 ? p || void 0 : N || void 0;
3094
+ const s = (e == null ? void 0 : e.rootDir) ?? t, f = (e == null ? void 0 : e.bridge) ?? o, c = (e == null ? void 0 : e.chromeless) ?? a, d = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, m = r ?? i, [g, v] = j(""), [k, b] = j(""), _ = D(void 0);
3095
+ M(() => (clearTimeout(_.current), _.current = setTimeout(() => b(g), 200), () => clearTimeout(_.current)), [g]);
3096
+ const W = p !== void 0 ? p || void 0 : k || void 0;
3077
3097
  return c ? /* @__PURE__ */ u(
3078
3098
  jn,
3079
3099
  {
3080
3100
  rootDir: s,
3081
- searchQuery: P,
3101
+ searchQuery: W,
3082
3102
  bridge: f,
3083
3103
  revealFileTreeRequest: d,
3084
3104
  className: oe("px-1 pt-1 [&_[role=treeitem]]:!indent-0", l)
3085
3105
  }
3086
- ) : /* @__PURE__ */ u($a, { title: "Files", panelApi: m, children: /* @__PURE__ */ S("div", { className: "flex h-full flex-col", children: [
3106
+ ) : /* @__PURE__ */ u($a, { title: "Files", panelApi: m, children: /* @__PURE__ */ x("div", { className: "flex h-full flex-col", children: [
3087
3107
  /* @__PURE__ */ u("div", { className: "border-b border-border px-2 py-1.5", children: /* @__PURE__ */ u(
3088
3108
  wr,
3089
3109
  {
3090
3110
  placeholder: "Search files...",
3091
3111
  value: p ?? g,
3092
- onChange: (L) => v(L.target.value),
3112
+ onChange: (B) => v(B.target.value),
3093
3113
  className: "h-7 text-xs",
3094
3114
  "aria-label": "Search files"
3095
3115
  }
@@ -3098,7 +3118,7 @@ function qa({
3098
3118
  jn,
3099
3119
  {
3100
3120
  rootDir: s,
3101
- searchQuery: P,
3121
+ searchQuery: W,
3102
3122
  bridge: f,
3103
3123
  revealFileTreeRequest: d,
3104
3124
  className: l
@@ -3110,7 +3130,7 @@ function Ha(e) {
3110
3130
  return e.split("/").pop() ?? e;
3111
3131
  }
3112
3132
  function Va() {
3113
- return j(() => {
3133
+ return M(() => {
3114
3134
  const e = K.on(ee.moved, ({ from: n, to: r, ...o }) => {
3115
3135
  K.emit(Ee.panelUpdate, {
3116
3136
  ...o,
@@ -3189,7 +3209,7 @@ function od(e) {
3189
3209
  return K.on(ee.changed, e);
3190
3210
  }
3191
3211
  function Xa() {
3192
- return j(() => K.on(Ee.agentData, ({ part: e }) => {
3212
+ return M(() => K.on(Ee.agentData, ({ part: e }) => {
3193
3213
  Ja(e);
3194
3214
  }), []), Ya((e) => {
3195
3215
  Nr({ kind: "openFile", params: { path: e } });
@@ -3197,15 +3217,15 @@ function Xa() {
3197
3217
  }
3198
3218
  const Qa = 250, Za = 3e3, ec = 3e4;
3199
3219
  function tc(e, t) {
3200
- const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [a, l] = B(!1), [s, f] = B(!1), [c, d] = B(null), [p, m] = B(!1), [g, v] = B(!1), N = $(void 0), x = $(null), _ = $(0), P = $(null), L = $(0), A = $(void 0), h = $(o);
3220
+ const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [a, l] = j(!1), [s, f] = j(!1), [c, d] = j(null), [p, m] = j(!1), [g, v] = j(!1), k = D(void 0), b = D(null), _ = D(0), W = D(null), B = D(0), z = D(void 0), h = D(o);
3201
3221
  h.current = o;
3202
- const C = $(n);
3222
+ const C = D(n);
3203
3223
  C.current = n;
3204
- const O = E(async () => {
3224
+ const F = E(async () => {
3205
3225
  const H = C.current;
3206
3226
  if (!H || !e || !H.isDirty()) return;
3207
- if (x.current) return x.current;
3208
- const te = L.current;
3227
+ if (b.current) return b.current;
3228
+ const te = B.current;
3209
3229
  let X = null;
3210
3230
  return X = (async () => {
3211
3231
  var q;
@@ -3219,62 +3239,62 @@ function tc(e, t) {
3219
3239
  H.save().then(() => "saved"),
3220
3240
  ue
3221
3241
  ]);
3222
- if (L.current !== te) return;
3242
+ if (B.current !== te) return;
3223
3243
  ce === "saved" && (_.current = Date.now(), d(Date.now()), l(!1), (q = h.current) == null || q.call(h, e, !1));
3224
3244
  } catch {
3225
- if (L.current !== te) return;
3245
+ if (B.current !== te) return;
3226
3246
  } finally {
3227
- if (ae && clearTimeout(ae), x.current === X && (x.current = null), L.current !== te) return;
3247
+ if (ae && clearTimeout(ae), b.current === X && (b.current = null), B.current !== te) return;
3228
3248
  K.emit(Ee.editorSaveEnd, { panelId: r }), f(!1);
3229
3249
  }
3230
- })(), x.current = X, X;
3231
- }, [e, r]), z = E(() => {
3232
- clearTimeout(N.current), N.current = setTimeout(O, Qa);
3233
- }, [O]), M = E(() => {
3250
+ })(), b.current = X, X;
3251
+ }, [e, r]), O = E(() => {
3252
+ clearTimeout(k.current), k.current = setTimeout(F, Qa);
3253
+ }, [F]), $ = E(() => {
3234
3254
  var H;
3235
- e && (l(!0), (H = h.current) == null || H.call(h, e, !0), z());
3236
- }, [e, z]), I = E(() => {
3255
+ e && (l(!0), (H = h.current) == null || H.call(h, e, !0), O());
3256
+ }, [e, O]), I = E(() => {
3237
3257
  var H;
3238
- clearTimeout(N.current), l(!1), v(!1), e && ((H = h.current) == null || H.call(h, e, !1));
3239
- }, [e]), W = E(async () => {
3258
+ clearTimeout(k.current), l(!1), v(!1), e && ((H = h.current) == null || H.call(h, e, !1));
3259
+ }, [e]), L = E(async () => {
3240
3260
  var H;
3241
- if (clearTimeout(N.current), x.current) return x.current;
3261
+ if (clearTimeout(k.current), b.current) return b.current;
3242
3262
  if ((H = C.current) != null && H.isDirty())
3243
- return O();
3244
- }, [O]), T = E(() => m(!1), []), F = E(() => v(!1), []), J = E((H) => {
3245
- P.current = H, v(!1);
3263
+ return F();
3264
+ }, [F]), T = E(() => m(!1), []), A = E(() => v(!1), []), J = E((H) => {
3265
+ W.current = H, v(!1);
3246
3266
  }, []);
3247
- return j(() => {
3267
+ return M(() => {
3248
3268
  if (!(i == null || !e)) {
3249
- if (P.current === null) {
3250
- P.current = i;
3269
+ if (W.current === null) {
3270
+ W.current = i;
3251
3271
  return;
3252
3272
  }
3253
- if (i !== P.current) {
3273
+ if (i !== W.current) {
3254
3274
  if (Date.now() - _.current < Za) {
3255
- P.current = i;
3275
+ W.current = i;
3256
3276
  return;
3257
3277
  }
3258
- P.current = i, a ? v(!0) : m(!0);
3278
+ W.current = i, a ? v(!0) : m(!0);
3259
3279
  }
3260
3280
  }
3261
- }, [i, e, a]), j(() => {
3262
- if (A.current === void 0) {
3263
- A.current = e;
3281
+ }, [i, e, a]), M(() => {
3282
+ if (z.current === void 0) {
3283
+ z.current = e;
3264
3284
  return;
3265
3285
  }
3266
- A.current !== e && (A.current = e, L.current += 1, clearTimeout(N.current), x.current && K.emit(Ee.editorSaveEnd, { panelId: r }), x.current = null, P.current = null, _.current = 0, l(!1), f(!1), m(!1), v(!1));
3267
- }, [e]), j(() => () => clearTimeout(N.current), []), {
3286
+ z.current !== e && (z.current = e, B.current += 1, clearTimeout(k.current), b.current && K.emit(Ee.editorSaveEnd, { panelId: r }), b.current = null, W.current = null, _.current = 0, l(!1), f(!1), m(!1), v(!1));
3287
+ }, [e]), M(() => () => clearTimeout(k.current), []), {
3268
3288
  isDirty: a,
3269
3289
  isSaving: s,
3270
3290
  lastSavedAt: c,
3271
- markDirty: M,
3291
+ markDirty: $,
3272
3292
  markClean: I,
3273
- flushSave: W,
3293
+ flushSave: L,
3274
3294
  shouldSync: p,
3275
3295
  ackSync: T,
3276
3296
  externalChangeWhileDirty: g,
3277
- ackExternalChange: F,
3297
+ ackExternalChange: A,
3278
3298
  notifySaved: J
3279
3299
  };
3280
3300
  }
@@ -3288,8 +3308,8 @@ function rc(e) {
3288
3308
  return e instanceof HTMLElement ? e.isContentEditable || e.closest("[contenteditable='true'], [contenteditable=''], [contenteditable='plaintext-only']") || e.closest("[role='textbox'], [role='searchbox'], [role='combobox']") ? !0 : !!e.closest("input, textarea, select") : !1;
3289
3309
  }
3290
3310
  function Yr({ shortcuts: e, enabled: t = !0 }) {
3291
- const n = $(e);
3292
- n.current = e, j(() => {
3311
+ const n = D(e);
3312
+ n.current = e, M(() => {
3293
3313
  if (!t) return;
3294
3314
  function r(o) {
3295
3315
  const i = rc(o.target);
@@ -3310,27 +3330,27 @@ function id(e) {
3310
3330
  }
3311
3331
  let oc = 0;
3312
3332
  function Xr(e) {
3313
- const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, i = $(n ?? `file-pane:${oc++}`), a = n ?? i.current, { data: l, isLoading: s, error: f, refetch: c } = na(o), { mutateAsync: d } = Ur(), [p, m] = B(r), g = $(""), v = $(!1), N = $(null), x = $(null), _ = $(null), P = $(0), [L, A] = B(null);
3314
- j(() => {
3315
- N.current !== t && (m(r), g.current = r ?? "", v.current = !1, x.current = null, P.current += 1, A(null), N.current = t);
3316
- }, [t, r]), j(() => {
3317
- (l == null ? void 0 : l.content) != null && p === null && (m(l.content), g.current = l.content, x.current = l.mtimeMs ?? null);
3333
+ const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, i = D(n ?? `file-pane:${oc++}`), a = n ?? i.current, { data: l, isLoading: s, error: f, refetch: c } = na(o), { mutateAsync: d } = Ur(), [p, m] = j(r), g = D(""), v = D(!1), k = D(null), b = D(null), _ = D(null), W = D(0), [B, z] = j(null);
3334
+ M(() => {
3335
+ k.current !== t && (m(r), g.current = r ?? "", v.current = !1, b.current = null, W.current += 1, z(null), k.current = t);
3336
+ }, [t, r]), M(() => {
3337
+ (l == null ? void 0 : l.content) != null && p === null && (m(l.content), g.current = l.content, b.current = l.mtimeMs ?? null);
3318
3338
  }, [l, p]);
3319
3339
  const h = o && p != null ? {
3320
3340
  isDirty: () => v.current,
3321
3341
  save: async () => {
3322
3342
  var te;
3323
- const H = ++P.current;
3343
+ const H = ++W.current;
3324
3344
  try {
3325
3345
  const X = await d({
3326
3346
  path: o,
3327
3347
  content: g.current,
3328
- expectedMtimeMs: x.current ?? void 0
3348
+ expectedMtimeMs: b.current ?? void 0
3329
3349
  });
3330
- if (P.current !== H) return;
3331
- typeof X.mtimeMs == "number" && (x.current = X.mtimeMs, (te = _.current) == null || te.call(_, X.mtimeMs)), v.current = !1, A(null);
3350
+ if (W.current !== H) return;
3351
+ typeof X.mtimeMs == "number" && (b.current = X.mtimeMs, (te = _.current) == null || te.call(_, X.mtimeMs)), v.current = !1, z(null);
3332
3352
  } catch (X) {
3333
- throw P.current !== H || X instanceof ut && (typeof X.currentMtimeMs == "number" && (x.current = X.currentMtimeMs), A(X)), X;
3353
+ throw W.current !== H || X instanceof ut && (typeof X.currentMtimeMs == "number" && (b.current = X.currentMtimeMs), z(X)), X;
3334
3354
  }
3335
3355
  },
3336
3356
  getContent: () => g.current
@@ -3339,42 +3359,42 @@ function Xr(e) {
3339
3359
  panelId: a,
3340
3360
  serverMtime: (l == null ? void 0 : l.mtimeMs) ?? null
3341
3361
  });
3342
- _.current = C.notifySaved, j(() => {
3362
+ _.current = C.notifySaved, M(() => {
3343
3363
  if (!(!C.shouldSync || (l == null ? void 0 : l.content) == null)) {
3344
3364
  if (v.current) {
3345
3365
  C.ackSync();
3346
3366
  return;
3347
3367
  }
3348
- m(l.content), g.current = l.content, x.current = l.mtimeMs ?? null, v.current = !1, C.ackSync();
3368
+ m(l.content), g.current = l.content, b.current = l.mtimeMs ?? null, v.current = !1, C.ackSync();
3349
3369
  }
3350
- }, [C.shouldSync, C, l, m]), j(() => {
3351
- !C.externalChangeWhileDirty || (l == null ? void 0 : l.mtimeMs) == null || (A(new ut(o ?? t, l.mtimeMs, x.current)), x.current = l.mtimeMs, C.ackExternalChange());
3370
+ }, [C.shouldSync, C, l, m]), M(() => {
3371
+ !C.externalChangeWhileDirty || (l == null ? void 0 : l.mtimeMs) == null || (z(new ut(o ?? t, l.mtimeMs, b.current)), b.current = l.mtimeMs, C.ackExternalChange());
3352
3372
  }, [o, C.externalChangeWhileDirty, C, l, t]);
3353
- const O = o ? o.split("/").pop() ?? o : "", [z, M] = B("");
3354
- j(() => {
3355
- const H = O ? C.isDirty ? `${O} ●` : O : "";
3356
- M(H);
3357
- }, [O, C.isDirty]);
3373
+ const F = o ? o.split("/").pop() ?? o : "", [O, $] = j("");
3374
+ M(() => {
3375
+ const H = F ? C.isDirty ? `${F} ●` : F : "";
3376
+ $(H);
3377
+ }, [F, C.isDirty]);
3358
3378
  const I = E((H) => {
3359
3379
  m(H), g.current = H, v.current = !0, C.markDirty();
3360
- }, [m, C]), W = E(async () => {
3380
+ }, [m, C]), L = E(async () => {
3361
3381
  var X;
3362
3382
  if (!o) return;
3363
3383
  const H = await c();
3364
3384
  if (H.status !== "success" || H.data == null) return;
3365
3385
  const te = H.data;
3366
- m(te.content), g.current = te.content, x.current = te.mtimeMs ?? null, v.current = !1, C.markClean(), typeof te.mtimeMs == "number" && ((X = _.current) == null || X.call(_, te.mtimeMs)), A(null);
3386
+ m(te.content), g.current = te.content, b.current = te.mtimeMs ?? null, v.current = !1, C.markClean(), typeof te.mtimeMs == "number" && ((X = _.current) == null || X.call(_, te.mtimeMs)), z(null);
3367
3387
  }, [o, C, c, m]), T = E(async () => {
3368
3388
  var te;
3369
- const H = ++P.current;
3389
+ const H = ++W.current;
3370
3390
  try {
3371
3391
  if (!o) return;
3372
3392
  const X = g.current, ae = await d({ path: o, content: X });
3373
- if (P.current !== H) return;
3374
- typeof ae.mtimeMs == "number" && (x.current = ae.mtimeMs, (te = _.current) == null || te.call(_, ae.mtimeMs)), v.current = !1, A(null);
3393
+ if (W.current !== H) return;
3394
+ typeof ae.mtimeMs == "number" && (b.current = ae.mtimeMs, (te = _.current) == null || te.call(_, ae.mtimeMs)), v.current = !1, z(null);
3375
3395
  } catch {
3376
3396
  }
3377
- }, [o, d]), F = E(async () => {
3397
+ }, [o, d]), A = E(async () => {
3378
3398
  !h || !v.current || await h.save();
3379
3399
  }, [h]), J = E(async () => {
3380
3400
  await C.flushSave();
@@ -3384,14 +3404,14 @@ function Xr(e) {
3384
3404
  error: f,
3385
3405
  content: p,
3386
3406
  isDirty: C.isDirty,
3387
- conflict: L,
3388
- onReloadFromServer: W,
3407
+ conflict: B,
3408
+ onReloadFromServer: L,
3389
3409
  onOverwrite: T,
3390
3410
  setContent: I,
3391
- save: F,
3411
+ save: A,
3392
3412
  flushSave: J,
3393
- fileName: O,
3394
- tabTitle: z
3413
+ fileName: F,
3414
+ tabTitle: O
3395
3415
  };
3396
3416
  }
3397
3417
  function ic({ conflict: e, onReload: t, onOverwrite: n }) {
@@ -3402,7 +3422,7 @@ function ic({ conflict: e, onReload: t, onOverwrite: n }) {
3402
3422
  tone: "accent",
3403
3423
  className: "rounded-none border-x-0 border-t-0",
3404
3424
  description: /* @__PURE__ */ u(Me, { children: "This file has been modified outside the editor. Your unsaved changes will be lost if you reload, or will overwrite the latest version on disk if you save." }),
3405
- actions: /* @__PURE__ */ S(Me, { children: [
3425
+ actions: /* @__PURE__ */ x(Me, { children: [
3406
3426
  /* @__PURE__ */ u(Oe, { type: "button", variant: "outline", size: "xs", onClick: () => void t(), children: "Reload" }),
3407
3427
  /* @__PURE__ */ u(
3408
3428
  Oe,
@@ -3438,11 +3458,11 @@ function Qr({
3438
3458
  return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(Sr, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
3439
3459
  if (r)
3440
3460
  return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load file", description: d ?? r.message }) });
3441
- const m = c ?? /* @__PURE__ */ S("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3461
+ const m = c ?? /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3442
3462
  /* @__PURE__ */ u(Ft, { className: "size-3.5" }),
3443
3463
  /* @__PURE__ */ u("span", { children: "Loading file..." })
3444
3464
  ] });
3445
- return /* @__PURE__ */ S("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
3465
+ return /* @__PURE__ */ x("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
3446
3466
  o && /* @__PURE__ */ u(
3447
3467
  ic,
3448
3468
  {
@@ -3520,7 +3540,7 @@ function Bn({ params: e, api: t, className: n }) {
3520
3540
  );
3521
3541
  }
3522
3542
  const cc = ft(
3523
- () => import("./MarkdownEditor-FJtYn6Xx.js").then((e) => ({ default: e.MarkdownEditor }))
3543
+ () => import("./MarkdownEditor-DOZy49fg.js").then((e) => ({ default: e.MarkdownEditor }))
3524
3544
  );
3525
3545
  function lc({ params: e, api: t, className: n }) {
3526
3546
  const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", {
@@ -3556,34 +3576,34 @@ function tt(e) {
3556
3576
  return e.split("/").pop() ?? e;
3557
3577
  }
3558
3578
  function dc({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
3559
- const i = Xe(), a = Qe(), [l, s] = B(null), [f, c] = B(null), [d, p] = B(!0), m = Y(() => {
3579
+ const i = Xe(), a = Qe(), [l, s] = j(null), [f, c] = j(null), [d, p] = j(!0), m = Y(() => {
3560
3580
  const g = new URLSearchParams({ path: e });
3561
3581
  return n > 0 && g.set("reload", String(n)), uc(i, `/api/v1/files/raw?${g.toString()}`);
3562
3582
  }, [i, e, n]);
3563
- return j(() => {
3583
+ return M(() => {
3564
3584
  const g = new AbortController();
3565
3585
  let v = null;
3566
3586
  p(!0), c(null), s(null);
3567
- const N = {};
3568
- return a && (N["x-boring-workspace-id"] = a), fetch(m, {
3587
+ const k = {};
3588
+ return a && (k["x-boring-workspace-id"] = a), fetch(m, {
3569
3589
  credentials: "include",
3570
- headers: N,
3590
+ headers: k,
3571
3591
  signal: g.signal
3572
- }).then(async (x) => {
3573
- if (!x.ok) throw new Error(`HTTP ${x.status}`);
3574
- const _ = await x.blob();
3592
+ }).then(async (b) => {
3593
+ if (!b.ok) throw new Error(`HTTP ${b.status}`);
3594
+ const _ = await b.blob();
3575
3595
  v = URL.createObjectURL(_), s(v);
3576
- }).catch((x) => {
3577
- g.signal.aborted || c(x instanceof Error ? x.message : "Failed to load preview");
3596
+ }).catch((b) => {
3597
+ g.signal.aborted || c(b instanceof Error ? b.message : "Failed to load preview");
3578
3598
  }).finally(() => {
3579
3599
  g.signal.aborted || p(!1);
3580
3600
  }), () => {
3581
3601
  g.abort(), v && URL.revokeObjectURL(v);
3582
3602
  };
3583
- }, [m, a]), e ? /* @__PURE__ */ S("div", { className: oe("flex h-full min-h-0 flex-col bg-background", o), children: [
3584
- /* @__PURE__ */ S("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3603
+ }, [m, a]), e ? /* @__PURE__ */ x("div", { className: oe("flex h-full min-h-0 flex-col bg-background", o), children: [
3604
+ /* @__PURE__ */ x("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3585
3605
  /* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: tt(e) }),
3586
- /* @__PURE__ */ S("div", { className: "flex items-center gap-1", children: [
3606
+ /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
3587
3607
  /* @__PURE__ */ u(
3588
3608
  "button",
3589
3609
  {
@@ -3609,7 +3629,7 @@ function dc({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
3609
3629
  ) : null
3610
3630
  ] })
3611
3631
  ] }),
3612
- /* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: d ? /* @__PURE__ */ S("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3632
+ /* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: d ? /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3613
3633
  /* @__PURE__ */ u(Ft, { className: "size-3.5" }),
3614
3634
  /* @__PURE__ */ u("span", { children: "Loading preview..." })
3615
3635
  ] }) : f || !l ? /* @__PURE__ */ u(rt, { title: "Failed to load preview", description: f ?? "Preview unavailable." }) : t === "image" ? /* @__PURE__ */ u(
@@ -3630,10 +3650,10 @@ function dc({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
3630
3650
  ] }) : /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "No file selected", description: "Choose an image or PDF from the file tree." }) });
3631
3651
  }
3632
3652
  function fc({ path: e }) {
3633
- const [t, n] = B(0), r = E(() => {
3653
+ const [t, n] = j(0), r = E(() => {
3634
3654
  n((o) => o + 1);
3635
3655
  }, []);
3636
- return j(() => {
3656
+ return M(() => {
3637
3657
  if (!e) return;
3638
3658
  const o = K.on(ee.changed, (l) => {
3639
3659
  l.path === e && r();
@@ -3775,35 +3795,35 @@ async function bc(e) {
3775
3795
  ${l.documentElement.outerHTML}`;
3776
3796
  }
3777
3797
  function wc({ path: e, className: t }) {
3778
- const n = Xe(), r = Qe(), [o, i] = B(null), [a, l] = B(null), [s, f] = B(!0), c = Y(
3798
+ const n = Xe(), r = Qe(), [o, i] = j(null), [a, l] = j(null), [s, f] = j(!0), c = Y(
3779
3799
  () => yn(n, e, r),
3780
3800
  [n, e, r]
3781
- ), [d, p] = B(0), m = E(() => {
3801
+ ), [d, p] = j(0), m = E(() => {
3782
3802
  p((g) => g + 1);
3783
3803
  }, []);
3784
- return j(() => {
3804
+ return M(() => {
3785
3805
  const g = new AbortController();
3786
3806
  f(!0), l(null), i(null);
3787
3807
  const v = {};
3788
- return r && (v["x-boring-workspace-id"] = r), to(c, v, g.signal).then(async (N) => {
3808
+ return r && (v["x-boring-workspace-id"] = r), to(c, v, g.signal).then(async (k) => {
3789
3809
  i(await bc({
3790
- html: N,
3810
+ html: k,
3791
3811
  path: e,
3792
3812
  apiBaseUrl: n,
3793
3813
  headers: v,
3794
3814
  workspaceRequestId: r,
3795
3815
  signal: g.signal
3796
3816
  }));
3797
- }).catch((N) => {
3798
- g.signal.aborted || l(N instanceof Error ? N.message : "Failed to load HTML preview");
3817
+ }).catch((k) => {
3818
+ g.signal.aborted || l(k instanceof Error ? k.message : "Failed to load HTML preview");
3799
3819
  }).finally(() => {
3800
3820
  g.signal.aborted || f(!1);
3801
3821
  }), () => g.abort();
3802
- }, [n, e, c, r, d]), e ? s ? /* @__PURE__ */ S("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3822
+ }, [n, e, c, r, d]), e ? s ? /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3803
3823
  /* @__PURE__ */ u(Ft, { className: "size-3.5" }),
3804
3824
  /* @__PURE__ */ u("span", { children: "Loading HTML preview..." })
3805
- ] }) : a || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load HTML preview", description: a ?? "Preview unavailable." }) }) : /* @__PURE__ */ S("div", { className: oe("flex h-full min-h-0 flex-col bg-background", t), children: [
3806
- /* @__PURE__ */ u("div", { className: "flex shrink-0 items-center justify-end gap-3 border-b border-border/60 px-3 py-2", children: /* @__PURE__ */ S("div", { className: "flex items-center gap-1", children: [
3825
+ ] }) : a || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load HTML preview", description: a ?? "Preview unavailable." }) }) : /* @__PURE__ */ x("div", { className: oe("flex h-full min-h-0 flex-col bg-background", t), children: [
3826
+ /* @__PURE__ */ u("div", { className: "flex shrink-0 items-center justify-end gap-3 border-b border-border/60 px-3 py-2", children: /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
3807
3827
  /* @__PURE__ */ u(
3808
3828
  xe,
3809
3829
  {
@@ -4023,13 +4043,13 @@ function Nc({
4023
4043
  );
4024
4044
  }
4025
4045
  function Ac() {
4026
- return j(() => {
4046
+ return M(() => {
4027
4047
  Wa();
4028
4048
  }, []), Br("."), null;
4029
4049
  }
4030
4050
  function Dc() {
4031
4051
  const e = We(), t = Wt();
4032
- return j(() => {
4052
+ return M(() => {
4033
4053
  const n = t.get(Ct);
4034
4054
  if (n && n.pluginId !== Pt) return;
4035
4055
  const r = Rc({
@@ -4197,9 +4217,9 @@ function Fe({
4197
4217
  side: n = "top",
4198
4218
  children: r
4199
4219
  }) {
4200
- return /* @__PURE__ */ u(ui, { delayDuration: 0, skipDelayDuration: 300, children: /* @__PURE__ */ S(di, { children: [
4220
+ return /* @__PURE__ */ u(ui, { delayDuration: 0, skipDelayDuration: 300, children: /* @__PURE__ */ x(di, { children: [
4201
4221
  /* @__PURE__ */ u(fi, { asChild: !0, children: r }),
4202
- /* @__PURE__ */ S(pi, { side: n, children: [
4222
+ /* @__PURE__ */ x(pi, { side: n, children: [
4203
4223
  e,
4204
4224
  t ? /* @__PURE__ */ u("span", { className: "ml-1.5 opacity-60", children: t }) : null
4205
4225
  ] })
@@ -4527,16 +4547,16 @@ function el({
4527
4547
  setMode: r,
4528
4548
  setQuery: o
4529
4549
  }) {
4530
- const i = $(null), a = $(null), l = $(!1);
4531
- j(() => {
4550
+ const i = D(null), a = D(null), l = D(!1);
4551
+ M(() => {
4532
4552
  if (!e) return;
4533
4553
  const p = (g) => {
4534
4554
  g.key === "Escape" && (g.preventDefault(), g.stopPropagation(), t(!1));
4535
4555
  }, m = (g) => {
4536
4556
  const v = g.target;
4537
4557
  if (!v) return;
4538
- const N = document.querySelector('[data-slot="dialog-content"]');
4539
- N && !N.contains(v) && (g.preventDefault(), g.stopPropagation(), t(!1));
4558
+ const k = document.querySelector('[data-slot="dialog-content"]');
4559
+ k && !k.contains(v) && (g.preventDefault(), g.stopPropagation(), t(!1));
4540
4560
  };
4541
4561
  return window.addEventListener("keydown", p, { capture: !0 }), window.addEventListener("pointerdown", m, { capture: !0 }), () => {
4542
4562
  window.removeEventListener("keydown", p, { capture: !0 }), window.removeEventListener("pointerdown", m, { capture: !0 });
@@ -4553,7 +4573,7 @@ function el({
4553
4573
  ],
4554
4574
  [s]
4555
4575
  )
4556
- }), j(() => {
4576
+ }), M(() => {
4557
4577
  if (e)
4558
4578
  o(""), r("catalogs"), requestAnimationFrame(() => {
4559
4579
  var p;
@@ -4586,15 +4606,15 @@ function tl({
4586
4606
  isCommandMode: t,
4587
4607
  searchQuery: n
4588
4608
  }) {
4589
- const [r, o] = B(""), [i, a] = B([]);
4590
- return j(() => {
4609
+ const [r, o] = j(""), [i, a] = j([]);
4610
+ return M(() => {
4591
4611
  if (t) {
4592
4612
  o("");
4593
4613
  return;
4594
4614
  }
4595
4615
  const l = setTimeout(() => o(n), 180);
4596
4616
  return () => clearTimeout(l);
4597
- }, [t, n]), j(() => {
4617
+ }, [t, n]), M(() => {
4598
4618
  if (t || !r) {
4599
4619
  a([]);
4600
4620
  return;
@@ -4655,31 +4675,31 @@ function tl({
4655
4675
  }, [e, r, t]), i;
4656
4676
  }
4657
4677
  function nl(e) {
4658
- const [t, n] = B(!1), [r, o] = B(""), [i, a] = B("catalogs"), l = qi(), s = Ui(), f = Eu(), c = Y(() => {
4678
+ const [t, n] = j(!1), [r, o] = j(""), [i, a] = j("catalogs"), l = qi(), s = Ui(), f = Eu(), c = Y(() => {
4659
4679
  const C = {};
4660
- for (const O of (f == null ? void 0 : f.registeredPlugins) ?? [])
4661
- O.label && (C[O.id] = O.label);
4680
+ for (const F of (f == null ? void 0 : f.registeredPlugins) ?? [])
4681
+ F.label && (C[F.id] = F.label);
4662
4682
  return C;
4663
4683
  }, [f == null ? void 0 : f.registeredPlugins]), d = i === "commands", p = r.trim(), m = tl({
4664
4684
  catalogs: l,
4665
4685
  isCommandMode: d,
4666
4686
  searchQuery: p
4667
- }), { inputRef: g, switchMode: v, handleInputKeyDown: N } = el({
4687
+ }), { inputRef: g, switchMode: v, handleInputKeyDown: k } = el({
4668
4688
  open: t,
4669
4689
  setOpen: n,
4670
4690
  mode: i,
4671
4691
  setMode: a,
4672
4692
  setQuery: o
4673
- }), x = E((C) => {
4693
+ }), b = E((C) => {
4674
4694
  if (C.startsWith(">")) {
4675
4695
  a("commands"), o(C.slice(1));
4676
4696
  return;
4677
4697
  }
4678
4698
  o(C);
4679
4699
  }, []), _ = Y(() => d ? Yc(s, p) : [], [s, d, p]), {
4680
- recentEntries: P,
4681
- handleCatalogSelect: L,
4682
- handleCommandSelect: A,
4700
+ recentEntries: W,
4701
+ handleCatalogSelect: B,
4702
+ handleCommandSelect: z,
4683
4703
  handleRecentSelect: h
4684
4704
  } = Zc({
4685
4705
  catalogs: l,
@@ -4688,7 +4708,7 @@ function nl(e) {
4688
4708
  searchQuery: p,
4689
4709
  close: () => n(!1)
4690
4710
  });
4691
- return /* @__PURE__ */ u(hi, { open: t, onOpenChange: n, children: /* @__PURE__ */ S(
4711
+ return /* @__PURE__ */ u(hi, { open: t, onOpenChange: n, children: /* @__PURE__ */ x(
4692
4712
  mi,
4693
4713
  {
4694
4714
  className: "cmdk-shell flex flex-col gap-0 overflow-hidden border-border/60 p-0 shadow-2xl backdrop-blur-md [&>button.dialog-close]:hidden",
@@ -4697,24 +4717,24 @@ function nl(e) {
4697
4717
  onPointerDownOutside: () => n(!1),
4698
4718
  onEscapeKeyDown: () => n(!1),
4699
4719
  children: [
4700
- /* @__PURE__ */ S(gi, { className: "sr-only", children: [
4720
+ /* @__PURE__ */ x(gi, { className: "sr-only", children: [
4701
4721
  /* @__PURE__ */ u(vi, { children: "Command Palette" }),
4702
4722
  /* @__PURE__ */ u(yi, { children: "Search catalogs or switch to commands" })
4703
4723
  ] }),
4704
- /* @__PURE__ */ S(bi, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
4724
+ /* @__PURE__ */ x(bi, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
4705
4725
  /* @__PURE__ */ u(
4706
4726
  rl,
4707
4727
  {
4708
4728
  inputRef: g,
4709
4729
  isCommandMode: d,
4710
4730
  query: r,
4711
- onQueryChange: x,
4712
- onInputKeyDown: N,
4731
+ onQueryChange: b,
4732
+ onInputKeyDown: k,
4713
4733
  onSwitchMode: v,
4714
4734
  loading: !d && m.some((C) => C.loading)
4715
4735
  }
4716
4736
  ),
4717
- /* @__PURE__ */ S(
4737
+ /* @__PURE__ */ x(
4718
4738
  wi,
4719
4739
  {
4720
4740
  className: "min-h-0 flex-1 overflow-y-auto py-1",
@@ -4725,7 +4745,7 @@ function nl(e) {
4725
4745
  ol,
4726
4746
  {
4727
4747
  isCommandMode: d,
4728
- recentEntries: P,
4748
+ recentEntries: W,
4729
4749
  searchQuery: p,
4730
4750
  onRecentSelect: h
4731
4751
  }
@@ -4735,7 +4755,7 @@ function nl(e) {
4735
4755
  {
4736
4756
  catalogGroups: m,
4737
4757
  isCommandMode: d,
4738
- onCatalogSelect: L
4758
+ onCatalogSelect: B
4739
4759
  }
4740
4760
  ),
4741
4761
  /* @__PURE__ */ u(
@@ -4744,7 +4764,7 @@ function nl(e) {
4744
4764
  commandResults: _,
4745
4765
  isCommandMode: d,
4746
4766
  pluginLabelMap: c,
4747
- onCommandSelect: A
4767
+ onCommandSelect: z
4748
4768
  }
4749
4769
  )
4750
4770
  ]
@@ -4765,9 +4785,9 @@ function rl({
4765
4785
  onSwitchMode: i,
4766
4786
  loading: a
4767
4787
  }) {
4768
- return /* @__PURE__ */ S("div", { className: "relative shrink-0", children: [
4769
- /* @__PURE__ */ S("div", { className: "relative flex items-stretch [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:h-auto", children: [
4770
- /* @__PURE__ */ S(
4788
+ return /* @__PURE__ */ x("div", { className: "relative shrink-0", children: [
4789
+ /* @__PURE__ */ x("div", { className: "relative flex items-stretch [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:h-auto", children: [
4790
+ /* @__PURE__ */ x(
4771
4791
  "div",
4772
4792
  {
4773
4793
  role: "group",
@@ -4830,10 +4850,10 @@ function ol({
4830
4850
  value: i,
4831
4851
  onSelect: () => r(o),
4832
4852
  className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
4833
- children: o.type === "catalog" ? /* @__PURE__ */ S(Me, { children: [
4853
+ children: o.type === "catalog" ? /* @__PURE__ */ x(Me, { children: [
4834
4854
  /* @__PURE__ */ u(Vo, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4835
4855
  /* @__PURE__ */ u(uo, { row: o.rowSnapshot })
4836
- ] }) : /* @__PURE__ */ S(Me, { children: [
4856
+ ] }) : /* @__PURE__ */ x(Me, { children: [
4837
4857
  /* @__PURE__ */ u(un, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4838
4858
  /* @__PURE__ */ u("span", { className: "flex-1 truncate", children: o.titleSnapshot }),
4839
4859
  /* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "command" })
@@ -4848,7 +4868,7 @@ function il({
4848
4868
  isCommandMode: t,
4849
4869
  onCatalogSelect: n
4850
4870
  }) {
4851
- return t ? null : /* @__PURE__ */ u(Me, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ S(dn, { heading: r.catalog.label, children: [
4871
+ return t ? null : /* @__PURE__ */ u(Me, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ x(dn, { heading: r.catalog.label, children: [
4852
4872
  r.error ? /* @__PURE__ */ u(sl, { catalogId: r.catalog.id, error: r.error }) : null,
4853
4873
  r.rows.map((o) => /* @__PURE__ */ u(
4854
4874
  $t,
@@ -4856,7 +4876,7 @@ function il({
4856
4876
  value: `${r.catalog.id}:${o.id}`,
4857
4877
  onSelect: () => n(r.catalog, o),
4858
4878
  className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
4859
- children: /* @__PURE__ */ S(
4879
+ children: /* @__PURE__ */ x(
4860
4880
  zt,
4861
4881
  {
4862
4882
  pluginId: r.catalog.pluginId ?? r.catalog.id,
@@ -4874,7 +4894,7 @@ function il({
4874
4894
  ] }, r.catalog.id)) });
4875
4895
  }
4876
4896
  function sl({ catalogId: e, error: t }) {
4877
- return /* @__PURE__ */ S(
4897
+ return /* @__PURE__ */ x(
4878
4898
  $t,
4879
4899
  {
4880
4900
  value: `${e}:error`,
@@ -4893,7 +4913,7 @@ function al({
4893
4913
  pluginLabelMap: n,
4894
4914
  onCommandSelect: r
4895
4915
  }) {
4896
- return !t || e.length === 0 ? null : /* @__PURE__ */ u(dn, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ S(
4916
+ return !t || e.length === 0 ? null : /* @__PURE__ */ u(dn, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ x(
4897
4917
  $t,
4898
4918
  {
4899
4919
  value: o.title,
@@ -4910,23 +4930,23 @@ function al({
4910
4930
  )) });
4911
4931
  }
4912
4932
  function cl({ isCommandMode: e }) {
4913
- return /* @__PURE__ */ S("div", { className: "flex items-center justify-between border-t border-border/50 bg-muted/30 px-3 py-2 text-[11px] text-muted-foreground", children: [
4933
+ return /* @__PURE__ */ x("div", { className: "flex items-center justify-between border-t border-border/50 bg-muted/30 px-3 py-2 text-[11px] text-muted-foreground", children: [
4914
4934
  /* @__PURE__ */ u("span", { className: "font-medium tracking-wide uppercase", children: e ? "Commands" : io }),
4915
- /* @__PURE__ */ S("div", { className: "flex items-center gap-3", children: [
4916
- /* @__PURE__ */ S("span", { className: "flex items-center gap-1", children: [
4935
+ /* @__PURE__ */ x("div", { className: "flex items-center gap-3", children: [
4936
+ /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
4917
4937
  /* @__PURE__ */ u(nt, { children: "tab" }),
4918
4938
  /* @__PURE__ */ u("span", { children: "switch" })
4919
4939
  ] }),
4920
- /* @__PURE__ */ S("span", { className: "flex items-center gap-1", children: [
4940
+ /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
4921
4941
  /* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u(Go, { className: "size-3" }) }),
4922
4942
  /* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u(Ko, { className: "size-3" }) }),
4923
4943
  /* @__PURE__ */ u("span", { children: "navigate" })
4924
4944
  ] }),
4925
- /* @__PURE__ */ S("span", { className: "flex items-center gap-1", children: [
4945
+ /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
4926
4946
  /* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u(Jo, { className: "size-3" }) }),
4927
4947
  /* @__PURE__ */ u("span", { children: "open" })
4928
4948
  ] }),
4929
- /* @__PURE__ */ S("span", { className: "flex items-center gap-1", children: [
4949
+ /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
4930
4950
  /* @__PURE__ */ u(nt, { children: "esc" }),
4931
4951
  /* @__PURE__ */ u("span", { children: "close" })
4932
4952
  ] })
@@ -4939,7 +4959,7 @@ function er({
4939
4959
  label: n,
4940
4960
  onClick: r
4941
4961
  }) {
4942
- return /* @__PURE__ */ S(
4962
+ return /* @__PURE__ */ x(
4943
4963
  Oe,
4944
4964
  {
4945
4965
  type: "button",
@@ -4959,7 +4979,7 @@ function er({
4959
4979
  );
4960
4980
  }
4961
4981
  function uo({ row: e }) {
4962
- return /* @__PURE__ */ S("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
4982
+ return /* @__PURE__ */ x("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
4963
4983
  /* @__PURE__ */ u("span", { className: "truncate font-medium text-foreground", children: e.title }),
4964
4984
  e.subtitle ? /* @__PURE__ */ u("span", { className: "truncate text-xs text-muted-foreground/70", children: e.subtitle }) : null,
4965
4985
  e.meta ? /* @__PURE__ */ u("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground/70", children: e.meta }) : null
@@ -5093,68 +5113,55 @@ function ml(e) {
5093
5113
  }
5094
5114
  function gl(e) {
5095
5115
  const t = Iu(), { blockers: n } = po(), {
5096
- getSurface: r,
5097
- isWorkbenchOpen: o,
5098
- openWorkbench: i,
5099
- openWorkbenchSources: a,
5100
- closeWorkbench: l,
5101
- bridgeEndpoint: s,
5102
- ...f
5103
- } = e, c = $(null), d = rr(s) ?? "", p = nr(f.requestHeaders);
5104
- j(() => {
5105
- let P = !1;
5106
- const L = p ? { "x-boring-workspace-id": p } : {};
5107
- return fetch(`${d}/api/v1/workspace/meta`, { headers: L }).then((A) => A.ok ? A.json() : null).then((A) => {
5108
- P || A && typeof A.workspaceRoot == "string" && (c.current = A.workspaceRoot);
5116
+ surfaceDispatch: r,
5117
+ bridgeEndpoint: o,
5118
+ ...i
5119
+ } = e, a = D(null), l = rr(o) ?? "", s = nr(i.requestHeaders);
5120
+ M(() => {
5121
+ let v = !1;
5122
+ const k = s ? { "x-boring-workspace-id": s } : {};
5123
+ return fetch(`${l}/api/v1/workspace/meta`, { headers: k }).then((b) => b.ok ? b.json() : null).then((b) => {
5124
+ v || b && typeof b.workspaceRoot == "string" && (a.current = b.workspaceRoot);
5109
5125
  }).catch(() => {
5110
5126
  }), () => {
5111
- P = !0;
5127
+ v = !0;
5112
5128
  };
5113
- }, [d, p]);
5114
- const m = E(
5115
- (P) => {
5116
- var A;
5117
- const L = ul(P, c.current);
5118
- r && o && i && tn(
5119
- { kind: "openFile", params: { path: L } },
5120
- { surface: r, isWorkbenchOpen: o, openWorkbench: i, openWorkbenchSources: a, closeWorkbench: l }
5121
- ), (A = e.onOpenArtifact) == null || A.call(e, L);
5129
+ }, [l, s]);
5130
+ const f = E(
5131
+ (v) => {
5132
+ var b;
5133
+ const k = ul(v, a.current);
5134
+ r && tn({ kind: "openFile", params: { path: k } }, r), (b = e.onOpenArtifact) == null || b.call(e, k);
5122
5135
  },
5123
- [r, o, i, a, l, e.onOpenArtifact]
5124
- ), g = nr(f.requestHeaders), v = n.filter((P) => !P.sessionId || P.sessionId === f.sessionId);
5125
- j(() => {
5126
- if (!(s === null || !r || !o || !i))
5136
+ [r, e.onOpenArtifact]
5137
+ ), c = nr(i.requestHeaders), d = n.filter((v) => !v.sessionId || v.sessionId === i.sessionId);
5138
+ M(() => {
5139
+ if (!(o === null || !r))
5127
5140
  return Es({
5128
- endpoint: rr(s),
5129
- query: g ? { workspaceId: g } : void 0,
5130
- ctx: {
5131
- surface: r,
5132
- isWorkbenchOpen: o,
5133
- openWorkbench: i,
5134
- openWorkbenchSources: a,
5135
- closeWorkbench: l
5136
- }
5141
+ endpoint: rr(o),
5142
+ query: c ? { workspaceId: c } : void 0,
5143
+ ctx: r
5137
5144
  });
5138
- }, [s, r, o, i, a, l, g]);
5139
- const N = E(() => {
5140
- var P;
5141
- window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: f.sessionId } })), (P = e.onComposerStop) == null || P.call(e);
5142
- }, [f.sessionId, e.onComposerStop]), x = E(
5143
- (P, L) => {
5144
- if (L === "cancel") {
5145
- window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: f.sessionId } }));
5145
+ }, [o, r, c]);
5146
+ const p = E(() => {
5147
+ var v;
5148
+ window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: i.sessionId } })), (v = e.onComposerStop) == null || v.call(e);
5149
+ }, [i.sessionId, e.onComposerStop]), m = E(
5150
+ (v, k) => {
5151
+ if (k === "cancel") {
5152
+ window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: i.sessionId } }));
5146
5153
  return;
5147
5154
  }
5148
- L !== "open" || !P.surfaceKind || r && o && i && tn(
5149
- { kind: "openSurface", params: { kind: P.surfaceKind, target: P.target, meta: {} } },
5150
- { surface: r, isWorkbenchOpen: o, openWorkbench: i, openWorkbenchSources: a, closeWorkbench: l }
5155
+ k !== "open" || !v.surfaceKind || r && tn(
5156
+ { kind: "openSurface", params: { kind: v.surfaceKind, target: v.target, meta: {} } },
5157
+ r
5151
5158
  );
5152
5159
  },
5153
- [f.sessionId, l, r, o, i, a]
5154
- ), _ = E(
5155
- (P) => {
5156
- var L;
5157
- Ss(ml(P)), (L = e.onData) == null || L.call(e, P);
5160
+ [i.sessionId, r]
5161
+ ), g = E(
5162
+ (v) => {
5163
+ var k;
5164
+ Ss(ml(v)), (k = e.onData) == null || k.call(e, v);
5158
5165
  },
5159
5166
  [e.onData]
5160
5167
  );
@@ -5162,12 +5169,12 @@ function gl(e) {
5162
5169
  t,
5163
5170
  {
5164
5171
  chrome: !1,
5165
- ...f,
5166
- onOpenArtifact: m,
5167
- onData: _,
5168
- composerBlockers: v,
5169
- onComposerStop: N,
5170
- onComposerBlockerAction: x
5172
+ ...i,
5173
+ onOpenArtifact: f,
5174
+ onData: g,
5175
+ composerBlockers: d,
5176
+ onComposerStop: p,
5177
+ onComposerBlockerAction: m
5171
5178
  }
5172
5179
  );
5173
5180
  }
@@ -5193,7 +5200,7 @@ function po() {
5193
5200
  return pe(fo) ?? bl;
5194
5201
  }
5195
5202
  function wl({ children: e }) {
5196
- const [t, n] = B([]), r = E((a) => {
5203
+ const [t, n] = j([]), r = E((a) => {
5197
5204
  n((l) => [...l.filter((s) => s.id !== a.id), a]);
5198
5205
  }, []), o = E((a) => {
5199
5206
  n((l) => l.filter((s) => s.id !== a));
@@ -5295,73 +5302,73 @@ function El({
5295
5302
  storageKey: a,
5296
5303
  onDropSession: l
5297
5304
  }) {
5298
- var N;
5299
- const s = $(null), f = $(!1), c = $(null), d = $(/* @__PURE__ */ new Map()), p = $({ panes: e, activePaneId: t ?? null, onActivePaneChange: r, onDropSession: l, storageKey: a });
5305
+ var k;
5306
+ const s = D(null), f = D(!1), c = D(null), d = D(/* @__PURE__ */ new Map()), p = D({ panes: e, activePaneId: t ?? null, onActivePaneChange: r, onDropSession: l, storageKey: a });
5300
5307
  p.current = { panes: e, activePaneId: t ?? null, onActivePaneChange: r, onDropSession: l, storageKey: a };
5301
- const m = t ?? ((N = e[0]) == null ? void 0 : N.id) ?? null, g = Y(() => ({
5308
+ const m = t ?? ((k = e[0]) == null ? void 0 : k.id) ?? null, g = Y(() => ({
5302
5309
  panes: e,
5303
5310
  activePaneId: m,
5304
5311
  flashPaneId: i ?? null,
5305
5312
  renderPane: n,
5306
5313
  onActivePaneChange: r,
5307
5314
  onClosePane: e.length > 1 ? o : void 0
5308
- }), [e, m, i, n, r, o]), v = E((x) => {
5309
- const _ = x.api;
5315
+ }), [e, m, i, n, r, o]), v = E((b) => {
5316
+ const _ = b.api;
5310
5317
  s.current = _;
5311
- const { panes: P, activePaneId: L, storageKey: A } = p.current;
5318
+ const { panes: W, activePaneId: B, storageKey: z } = p.current;
5312
5319
  f.current = !0;
5313
5320
  try {
5314
- const W = A ? Pl(A, P.map((T) => T.id)) : null;
5315
- if (W)
5321
+ const L = z ? Pl(z, W.map((T) => T.id)) : null;
5322
+ if (L)
5316
5323
  try {
5317
- _.fromJSON(W);
5324
+ _.fromJSON(L);
5318
5325
  } catch {
5319
5326
  }
5320
- ir(_, P, L, d.current);
5327
+ ir(_, W, B, d.current);
5321
5328
  } finally {
5322
5329
  f.current = !1;
5323
5330
  }
5324
- const h = _.onDidActivePanelChange((W) => {
5325
- var F, J;
5331
+ const h = _.onDidActivePanelChange((L) => {
5332
+ var A, J;
5326
5333
  if (f.current) return;
5327
- const T = W == null ? void 0 : W.id;
5328
- T && T !== p.current.activePaneId && ((J = (F = p.current).onActivePaneChange) == null || J.call(F, T));
5329
- }), C = _.onWillShowOverlay((W) => {
5330
- if (W.kind === "tab" || W.kind === "header_space") {
5331
- W.preventDefault();
5334
+ const T = L == null ? void 0 : L.id;
5335
+ T && T !== p.current.activePaneId && ((J = (A = p.current).onActivePaneChange) == null || J.call(A, T));
5336
+ }), C = _.onWillShowOverlay((L) => {
5337
+ if (L.kind === "tab" || L.kind === "header_space") {
5338
+ L.preventDefault();
5332
5339
  return;
5333
5340
  }
5334
- W.kind === "content" && W.position === "center" && W.preventDefault();
5335
- }), O = _.onUnhandledDragOverEvent((W) => {
5336
- var F;
5337
- const T = (F = W.nativeEvent.dataTransfer) == null ? void 0 : F.types;
5338
- T && Array.from(T).includes(cn) && W.accept();
5339
- }), z = _.onDidDrop((W) => {
5340
- var F, J, H, te, X;
5341
- const T = (F = W.nativeEvent.dataTransfer) == null ? void 0 : F.getData(cn);
5341
+ L.kind === "content" && L.position === "center" && L.preventDefault();
5342
+ }), F = _.onUnhandledDragOverEvent((L) => {
5343
+ var A;
5344
+ const T = (A = L.nativeEvent.dataTransfer) == null ? void 0 : A.types;
5345
+ T && Array.from(T).includes(cn) && L.accept();
5346
+ }), O = _.onDidDrop((L) => {
5347
+ var A, J, H, te, X;
5348
+ const T = (A = L.nativeEvent.dataTransfer) == null ? void 0 : A.getData(cn);
5342
5349
  T && (d.current.set(T, {
5343
- referencePanelId: ((H = (J = W.group) == null ? void 0 : J.activePanel) == null ? void 0 : H.id) ?? null,
5344
- direction: kl(W.position)
5350
+ referencePanelId: ((H = (J = L.group) == null ? void 0 : J.activePanel) == null ? void 0 : H.id) ?? null,
5351
+ direction: kl(L.position)
5345
5352
  }), (X = (te = p.current).onDropSession) == null || X.call(te, T));
5346
5353
  });
5347
- let M = null;
5354
+ let $ = null;
5348
5355
  const I = _.onDidLayoutChange(() => {
5349
- const W = p.current.storageKey;
5350
- W && (M && clearTimeout(M), M = setTimeout(() => Cl(W, _.toJSON()), xl));
5356
+ const L = p.current.storageKey;
5357
+ L && ($ && clearTimeout($), $ = setTimeout(() => Cl(L, _.toJSON()), xl));
5351
5358
  });
5352
5359
  c.current = () => {
5353
- M && clearTimeout(M), h.dispose(), C.dispose(), O.dispose(), z.dispose(), I.dispose();
5360
+ $ && clearTimeout($), h.dispose(), C.dispose(), F.dispose(), O.dispose(), I.dispose();
5354
5361
  };
5355
5362
  }, []);
5356
- return j(() => () => {
5357
- var x;
5358
- return (x = c.current) == null ? void 0 : x.call(c);
5359
- }, []), j(() => {
5360
- const x = s.current;
5361
- if (x) {
5363
+ return M(() => () => {
5364
+ var b;
5365
+ return (b = c.current) == null ? void 0 : b.call(c);
5366
+ }, []), M(() => {
5367
+ const b = s.current;
5368
+ if (b) {
5362
5369
  f.current = !0;
5363
5370
  try {
5364
- ir(x, e, m, d.current);
5371
+ ir(b, e, m, d.current);
5365
5372
  } finally {
5366
5373
  f.current = !1;
5367
5374
  }
@@ -5396,7 +5403,7 @@ function Il(e) {
5396
5403
  const t = vo(), n = typeof ((a = e.params) == null ? void 0 : a.paneId) == "string" ? e.params.paneId : e.api.id, r = t.panes.find((l) => l.id === n);
5397
5404
  if (!r) return null;
5398
5405
  const o = n === t.activePaneId, i = n === t.flashPaneId;
5399
- return /* @__PURE__ */ S(
5406
+ return /* @__PURE__ */ x(
5400
5407
  "div",
5401
5408
  {
5402
5409
  "data-boring-workspace-part": "chat-pane",
@@ -5424,8 +5431,8 @@ const Tl = {
5424
5431
  [ho]: Il
5425
5432
  };
5426
5433
  function Rl(e) {
5427
- const t = vo(), { api: n } = e, [r, o] = B(n.title ?? n.id);
5428
- j(() => {
5434
+ const t = vo(), { api: n } = e, [r, o] = j(n.title ?? n.id);
5435
+ M(() => {
5429
5436
  var f;
5430
5437
  const l = () => o(n.title ?? n.id);
5431
5438
  l();
@@ -5436,7 +5443,7 @@ function Rl(e) {
5436
5443
  };
5437
5444
  }, [n]);
5438
5445
  const i = t.panes.length > 1, a = !!t.onClosePane;
5439
- return /* @__PURE__ */ S(
5446
+ return /* @__PURE__ */ x(
5440
5447
  "div",
5441
5448
  {
5442
5449
  className: oe(
@@ -5501,8 +5508,8 @@ function Nl({ dimmed: e, flash: t }) {
5501
5508
  }
5502
5509
  const sr = "boring:chat-session-status";
5503
5510
  function Al() {
5504
- const [e, t] = B(() => /* @__PURE__ */ new Set());
5505
- return j(() => {
5511
+ const [e, t] = j(() => /* @__PURE__ */ new Set());
5512
+ return M(() => {
5506
5513
  const n = (r) => {
5507
5514
  const o = r.detail;
5508
5515
  if (typeof (o == null ? void 0 : o.sessionId) != "string") return;
@@ -5538,9 +5545,9 @@ function Dl(e) {
5538
5545
  g >= n ? i.push(p) : g >= r ? a.push(p) : g >= o ? l.push(p) : s.push(p);
5539
5546
  }
5540
5547
  const c = (p, m) => {
5541
- var N, x;
5542
- const g = ((N = It(p.updatedAt)) == null ? void 0 : N.getTime()) ?? 0;
5543
- return (((x = It(m.updatedAt)) == null ? void 0 : x.getTime()) ?? 0) - g;
5548
+ var k, b;
5549
+ const g = ((k = It(p.updatedAt)) == null ? void 0 : k.getTime()) ?? 0;
5550
+ return (((b = It(m.updatedAt)) == null ? void 0 : b.getTime()) ?? 0) - g;
5544
5551
  }, d = [];
5545
5552
  return i.length && d.push({ key: "today", label: "Today", items: i.sort(c) }), a.length && d.push({ key: "yesterday", label: "Yesterday", items: a.sort(c) }), l.length && d.push({ key: "week", label: "This week", items: l.sort(c) }), s.length && d.push({ key: "earlier", label: "Earlier", items: s.sort(c) }), f.length && d.push({ key: "undated", label: "Other", items: f }), d;
5546
5553
  }
@@ -5576,24 +5583,24 @@ function Fl({
5576
5583
  onClose: p,
5577
5584
  className: m
5578
5585
  }) {
5579
- const g = Y(() => new Set(n ?? []), [n]), v = Y(() => new Set(r ?? []), [r]), N = Y(
5580
- () => (r ?? []).map((T) => e.find((F) => F.id === T)).filter((T) => !!T),
5586
+ const g = Y(() => new Set(n ?? []), [n]), v = Y(() => new Set(r ?? []), [r]), k = Y(
5587
+ () => (r ?? []).map((T) => e.find((A) => A.id === T)).filter((T) => !!T),
5581
5588
  [r, e]
5582
- ), x = Y(
5583
- () => (n ?? []).filter((T) => !v.has(T)).map((T) => e.find((F) => F.id === T)).filter((T) => !!T),
5589
+ ), b = Y(
5590
+ () => (n ?? []).filter((T) => !v.has(T)).map((T) => e.find((A) => A.id === T)).filter((T) => !!T),
5584
5591
  [n, v, e]
5585
5592
  ), _ = Y(
5586
5593
  () => g.size > 0 || v.size > 0 ? e.filter((T) => !g.has(T.id) && !v.has(T.id)) : e,
5587
5594
  [g, v, e]
5588
- ), P = Y(() => Dl(_), [_]), [L, A] = B(!1), [h, C] = B(!1), [O, z] = B(
5595
+ ), W = Y(() => Dl(_), [_]), [B, z] = j(!1), [h, C] = j(!1), [F, O] = j(
5589
5596
  () => ((n == null ? void 0 : n.length) ?? 0) > 0 || ((r == null ? void 0 : r.length) ?? 0) > 0
5590
- ), M = Al(), { blockers: I } = po(), W = Y(() => {
5597
+ ), $ = Al(), { blockers: I } = po(), L = Y(() => {
5591
5598
  const T = /* @__PURE__ */ new Set();
5592
- for (const F of I)
5593
- F.reason === "waiting_for_user_input" && F.sessionId && T.add(F.sessionId);
5599
+ for (const A of I)
5600
+ A.reason === "waiting_for_user_input" && A.sessionId && T.add(A.sessionId);
5594
5601
  return T;
5595
5602
  }, [I]);
5596
- return /* @__PURE__ */ S(
5603
+ return /* @__PURE__ */ x(
5597
5604
  "div",
5598
5605
  {
5599
5606
  "data-boring-workspace-part": "session-list",
@@ -5604,38 +5611,38 @@ function Fl({
5604
5611
  role: "navigation",
5605
5612
  "aria-label": "Session history",
5606
5613
  children: [
5607
- /* @__PURE__ */ S("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
5614
+ /* @__PURE__ */ x("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
5608
5615
  /* @__PURE__ */ u("span", { className: "text-[12px] font-medium tracking-tight text-foreground/70", children: "Sessions" }),
5609
- /* @__PURE__ */ S("div", { className: "flex items-center gap-0.5", children: [
5616
+ /* @__PURE__ */ x("div", { className: "flex items-center gap-0.5", children: [
5610
5617
  l && /* @__PURE__ */ u(Fe, { label: "New chat", side: "bottom", children: /* @__PURE__ */ u(xe, { type: "button", variant: "ghost", size: "icon-xs", onClick: l, "aria-label": "New session", children: /* @__PURE__ */ u(Xo, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }) }),
5611
5618
  p && /* @__PURE__ */ u(Fe, { label: "Close sessions", hint: "⌘1", side: "bottom", children: /* @__PURE__ */ u(xe, { type: "button", variant: "ghost", size: "icon-xs", onClick: p, "aria-label": "Close sessions", children: /* @__PURE__ */ u(Qo, { className: "h-4 w-4", strokeWidth: 1.75 }) }) })
5612
5619
  ] })
5613
5620
  ] }),
5614
- /* @__PURE__ */ S("div", { className: "boring-scrollbar-discreet flex-1 overflow-y-auto py-2.5", children: [
5615
- e.length === 0 && /* @__PURE__ */ S("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
5621
+ /* @__PURE__ */ x("div", { className: "boring-scrollbar-discreet flex-1 overflow-y-auto py-2.5", children: [
5622
+ e.length === 0 && /* @__PURE__ */ x("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
5616
5623
  "No sessions yet.",
5617
5624
  /* @__PURE__ */ u("br", {}),
5618
5625
  "Start a new chat to begin."
5619
5626
  ] }),
5620
- N.length > 0 && /* @__PURE__ */ S("section", { "data-boring-workspace-part": "session-pinned-section", children: [
5627
+ k.length > 0 && /* @__PURE__ */ x("section", { "data-boring-workspace-part": "session-pinned-section", children: [
5621
5628
  /* @__PURE__ */ u(
5622
5629
  Jt,
5623
5630
  {
5624
5631
  label: "Pinned",
5625
- count: N.length,
5626
- collapsed: L,
5627
- onToggle: () => A((T) => !T)
5632
+ count: k.length,
5633
+ collapsed: B,
5634
+ onToggle: () => z((T) => !T)
5628
5635
  }
5629
5636
  ),
5630
- !L && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: N.map((T) => /* @__PURE__ */ u(
5637
+ !B && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: k.map((T) => /* @__PURE__ */ u(
5631
5638
  Yt,
5632
5639
  {
5633
5640
  session: T,
5634
5641
  active: T.id === t,
5635
5642
  open: g.has(T.id),
5636
5643
  pinned: !0,
5637
- working: M.has(T.id),
5638
- needsInput: W.has(T.id),
5644
+ working: $.has(T.id),
5645
+ needsInput: L.has(T.id),
5639
5646
  onSwitch: i,
5640
5647
  onOpenAsTab: a,
5641
5648
  onTogglePin: o,
@@ -5644,25 +5651,25 @@ function Fl({
5644
5651
  T.id
5645
5652
  )) })
5646
5653
  ] }),
5647
- x.length > 0 && /* @__PURE__ */ S("section", { "data-boring-workspace-part": "session-active-section", className: oe(N.length > 0 && "mt-3"), children: [
5654
+ b.length > 0 && /* @__PURE__ */ x("section", { "data-boring-workspace-part": "session-active-section", className: oe(k.length > 0 && "mt-3"), children: [
5648
5655
  /* @__PURE__ */ u(
5649
5656
  Jt,
5650
5657
  {
5651
5658
  label: "Active",
5652
- count: x.length,
5659
+ count: b.length,
5653
5660
  collapsed: h,
5654
5661
  onToggle: () => C((T) => !T)
5655
5662
  }
5656
5663
  ),
5657
- !h && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: x.map((T) => /* @__PURE__ */ u(
5664
+ !h && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: b.map((T) => /* @__PURE__ */ u(
5658
5665
  Yt,
5659
5666
  {
5660
5667
  session: T,
5661
5668
  active: T.id === t,
5662
5669
  open: !0,
5663
5670
  pinned: v.has(T.id),
5664
- working: M.has(T.id),
5665
- needsInput: W.has(T.id),
5671
+ working: $.has(T.id),
5672
+ needsInput: L.has(T.id),
5666
5673
  onSwitch: i,
5667
5674
  onOpenAsTab: a,
5668
5675
  onTogglePin: o,
@@ -5671,24 +5678,24 @@ function Fl({
5671
5678
  T.id
5672
5679
  )) })
5673
5680
  ] }),
5674
- P.length > 0 && /* @__PURE__ */ S(
5681
+ W.length > 0 && /* @__PURE__ */ x(
5675
5682
  "section",
5676
5683
  {
5677
5684
  "data-boring-workspace-part": "session-history-section",
5678
- className: oe(x.length > 0 && "mt-3"),
5685
+ className: oe(b.length > 0 && "mt-3"),
5679
5686
  children: [
5680
5687
  /* @__PURE__ */ u(
5681
5688
  Jt,
5682
5689
  {
5683
5690
  label: "History",
5684
5691
  count: _.length,
5685
- collapsed: O,
5686
- onToggle: () => z((T) => !T)
5692
+ collapsed: F,
5693
+ onToggle: () => O((T) => !T)
5687
5694
  }
5688
5695
  ),
5689
- !O && /* @__PURE__ */ S(Me, { children: [
5690
- P.map((T, F) => /* @__PURE__ */ S("section", { className: oe(F > 0 && "mt-2"), children: [
5691
- /* @__PURE__ */ S("div", { className: "flex items-baseline justify-between gap-2 px-5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/60", children: [
5696
+ !F && /* @__PURE__ */ x(Me, { children: [
5697
+ W.map((T, A) => /* @__PURE__ */ x("section", { className: oe(A > 0 && "mt-2"), children: [
5698
+ /* @__PURE__ */ x("div", { className: "flex items-baseline justify-between gap-2 px-5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/60", children: [
5692
5699
  /* @__PURE__ */ u("span", { children: T.label }),
5693
5700
  /* @__PURE__ */ u("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: T.items.length })
5694
5701
  ] }),
@@ -5699,8 +5706,8 @@ function Fl({
5699
5706
  active: J.id === t,
5700
5707
  open: !1,
5701
5708
  pinned: v.has(J.id),
5702
- working: M.has(J.id),
5703
- needsInput: W.has(J.id),
5709
+ working: $.has(J.id),
5710
+ needsInput: L.has(J.id),
5704
5711
  onSwitch: i,
5705
5712
  onOpenAsTab: a,
5706
5713
  onTogglePin: o,
@@ -5734,7 +5741,7 @@ function Jt({
5734
5741
  collapsed: n,
5735
5742
  onToggle: r
5736
5743
  }) {
5737
- return /* @__PURE__ */ S(
5744
+ return /* @__PURE__ */ x(
5738
5745
  "button",
5739
5746
  {
5740
5747
  type: "button",
@@ -5743,7 +5750,7 @@ function Jt({
5743
5750
  "data-boring-workspace-part": "session-section-toggle",
5744
5751
  className: "flex w-full items-baseline justify-between gap-2 px-3.5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/75 transition-colors hover:text-foreground/80",
5745
5752
  children: [
5746
- /* @__PURE__ */ S("span", { className: "flex items-center gap-1", children: [
5753
+ /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
5747
5754
  /* @__PURE__ */ u(
5748
5755
  yr,
5749
5756
  {
@@ -5772,7 +5779,7 @@ function Yt({
5772
5779
  onDelete: f
5773
5780
  }) {
5774
5781
  const c = _l(e.updatedAt);
5775
- return /* @__PURE__ */ S(
5782
+ return /* @__PURE__ */ x(
5776
5783
  "li",
5777
5784
  {
5778
5785
  role: "listitem",
@@ -5800,7 +5807,7 @@ function Yt({
5800
5807
  )
5801
5808
  }
5802
5809
  ),
5803
- /* @__PURE__ */ S("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: [
5810
+ /* @__PURE__ */ x("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: [
5804
5811
  /* @__PURE__ */ u("span", { className: oe(t ? "font-medium text-foreground" : "text-foreground/90"), children: e.title || "Untitled" }),
5805
5812
  c && /* @__PURE__ */ u(
5806
5813
  "span",
@@ -5813,7 +5820,7 @@ function Yt({
5813
5820
  }
5814
5821
  )
5815
5822
  ] }),
5816
- i ? /* @__PURE__ */ S(
5823
+ i ? /* @__PURE__ */ x(
5817
5824
  "span",
5818
5825
  {
5819
5826
  "data-boring-workspace-part": "session-badge",
@@ -5824,7 +5831,7 @@ function Yt({
5824
5831
  "needs input"
5825
5832
  ]
5826
5833
  }
5827
- ) : o ? /* @__PURE__ */ S(
5834
+ ) : o ? /* @__PURE__ */ x(
5828
5835
  "span",
5829
5836
  {
5830
5837
  "data-boring-workspace-part": "session-badge",
@@ -5947,18 +5954,18 @@ function yo({
5947
5954
  });
5948
5955
  }
5949
5956
  return q;
5950
- }, [c]), [p, m] = B(n ?? ""), g = d.some((q) => q.id === p) ? p : ((ae = d[0]) == null ? void 0 : ae.id) ?? "", [v, N] = B(!1), [x, _] = B(""), [P, L] = B(""), A = $(null), [h, C] = B(null), O = E((q) => {
5957
+ }, [c]), [p, m] = j(n ?? ""), g = d.some((q) => q.id === p) ? p : ((ae = d[0]) == null ? void 0 : ae.id) ?? "", [v, k] = j(!1), [b, _] = j(""), [W, B] = j(""), z = D(null), [h, C] = j(null), F = E((q) => {
5951
5958
  C(q);
5952
- }, []), z = $(void 0);
5953
- j(() => (clearTimeout(z.current), z.current = setTimeout(() => L(x), 180), () => clearTimeout(z.current)), [x]), j(() => {
5959
+ }, []), O = D(void 0);
5960
+ M(() => (clearTimeout(O.current), O.current = setTimeout(() => B(b), 180), () => clearTimeout(O.current)), [b]), M(() => {
5954
5961
  var q;
5955
- v && ((q = A.current) == null || q.focus());
5956
- }, [v]), j(() => {
5962
+ v && ((q = z.current) == null || q.focus());
5963
+ }, [v]), M(() => {
5957
5964
  d.length > 0 && !d.some((q) => q.id === p) && m(d[0].id);
5958
- }, [p, d]), j(() => {
5965
+ }, [p, d]), M(() => {
5959
5966
  r && d.some((q) => q.id === lr) && m(lr);
5960
5967
  }, [r, d]);
5961
- const M = E((q) => {
5968
+ const $ = E((q) => {
5962
5969
  var ke;
5963
5970
  const ce = (ke = q.panel) == null ? void 0 : ke.defaultPanelId;
5964
5971
  if (!ce || !o) return;
@@ -5969,23 +5976,23 @@ function yo({
5969
5976
  title: fe.title
5970
5977
  });
5971
5978
  }, [o, f]), I = E((q) => {
5972
- m(q.id), M(q);
5973
- }, [M]), W = E(() => {
5974
- N((q) => (q && _(""), !q));
5979
+ m(q.id), $(q);
5980
+ }, [$]), L = E(() => {
5981
+ k((q) => (q && _(""), !q));
5975
5982
  }, []), T = E((q) => {
5976
- q.key === "Escape" && (q.preventDefault(), N(!1), _(""));
5977
- }, []), F = d.find((q) => q.id === g), J = !!((ue = F == null ? void 0 : F.panel) != null && ue.chromeless), H = !J, te = Y(
5983
+ q.key === "Escape" && (q.preventDefault(), k(!1), _(""));
5984
+ }, []), A = d.find((q) => q.id === g), J = !!((ue = A == null ? void 0 : A.panel) != null && ue.chromeless), H = !J, te = Y(
5978
5985
  () => ({
5979
5986
  rootDir: e,
5980
5987
  bridge: t,
5981
- query: P,
5982
- searchQuery: P || void 0,
5988
+ query: W,
5989
+ searchQuery: W || void 0,
5983
5990
  chromeless: !0,
5984
5991
  chromeActionsElement: h,
5985
5992
  revealFileTreeRequest: r
5986
5993
  }),
5987
- [t, h, P, r, e]
5988
- ), X = /* @__PURE__ */ S(
5994
+ [t, h, W, r, e]
5995
+ ), X = /* @__PURE__ */ x(
5989
5996
  "nav",
5990
5997
  {
5991
5998
  className: "flex w-11 shrink-0 flex-col items-center gap-1 bg-muted/35 px-1.5 py-2",
@@ -6024,13 +6031,13 @@ function yo({
6024
6031
  ]
6025
6032
  }
6026
6033
  );
6027
- return /* @__PURE__ */ S("div", { "data-boring-workspace-part": "workbench-left", className: oe("workbench-left-root flex h-full min-h-0", l), children: [
6034
+ return /* @__PURE__ */ x("div", { "data-boring-workspace-part": "workbench-left", className: oe("workbench-left-root flex h-full min-h-0", l), children: [
6028
6035
  X,
6029
- /* @__PURE__ */ S("div", { className: "flex h-full min-w-0 flex-1 flex-col bg-muted/35", children: [
6030
- !J && /* @__PURE__ */ S("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 bg-muted/35 px-2.5", children: [
6031
- /* @__PURE__ */ S("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
6032
- /* @__PURE__ */ u("span", { className: "shrink-0 text-foreground/80", children: F == null ? void 0 : F.icon }),
6033
- /* @__PURE__ */ u("div", { className: "truncate text-[14px] font-medium tracking-tight text-foreground", children: (F == null ? void 0 : F.title) ?? "Sources" })
6036
+ /* @__PURE__ */ x("div", { className: "flex h-full min-w-0 flex-1 flex-col bg-muted/35", children: [
6037
+ !J && /* @__PURE__ */ x("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 bg-muted/35 px-2.5", children: [
6038
+ /* @__PURE__ */ x("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
6039
+ /* @__PURE__ */ u("span", { className: "shrink-0 text-foreground/80", children: A == null ? void 0 : A.icon }),
6040
+ /* @__PURE__ */ u("div", { className: "truncate text-[14px] font-medium tracking-tight text-foreground", children: (A == null ? void 0 : A.title) ?? "Sources" })
6034
6041
  ] }),
6035
6042
  H && /* @__PURE__ */ u(Fe, { label: "Search", side: "bottom", children: /* @__PURE__ */ u(
6036
6043
  xe,
@@ -6038,7 +6045,7 @@ function yo({
6038
6045
  type: "button",
6039
6046
  variant: "ghost",
6040
6047
  size: "icon-xs",
6041
- onClick: W,
6048
+ onClick: L,
6042
6049
  className: oe(v && "bg-foreground/5 text-foreground"),
6043
6050
  "aria-label": "Search",
6044
6051
  children: /* @__PURE__ */ u(En, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
@@ -6047,27 +6054,27 @@ function yo({
6047
6054
  /* @__PURE__ */ u(
6048
6055
  "div",
6049
6056
  {
6050
- ref: O,
6057
+ ref: F,
6051
6058
  className: "flex shrink-0 items-center gap-1",
6052
6059
  "data-boring-workspace-part": "left-tab-chrome-actions"
6053
6060
  }
6054
6061
  )
6055
6062
  ] }),
6056
- !J && H && v && /* @__PURE__ */ S("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
6063
+ !J && H && v && /* @__PURE__ */ x("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
6057
6064
  /* @__PURE__ */ u(En, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
6058
6065
  /* @__PURE__ */ u(
6059
6066
  wr,
6060
6067
  {
6061
- ref: A,
6068
+ ref: z,
6062
6069
  type: "text",
6063
- value: x,
6070
+ value: b,
6064
6071
  onChange: (q) => _(q.target.value),
6065
6072
  onKeyDown: T,
6066
- placeholder: `Search ${((F == null ? void 0 : F.title) ?? "sources").toLowerCase()}...`,
6073
+ placeholder: `Search ${((A == null ? void 0 : A.title) ?? "sources").toLowerCase()}...`,
6067
6074
  className: "h-7 flex-1 border-0 bg-transparent px-0 py-0 text-xs shadow-none focus-visible:ring-0 dark:bg-transparent"
6068
6075
  }
6069
6076
  ),
6070
- x && /* @__PURE__ */ u(
6077
+ b && /* @__PURE__ */ u(
6071
6078
  xe,
6072
6079
  {
6073
6080
  type: "button",
@@ -6079,7 +6086,7 @@ function yo({
6079
6086
  }
6080
6087
  )
6081
6088
  ] }),
6082
- /* @__PURE__ */ u("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ u(jl, { panel: F == null ? void 0 : F.panel, params: te, onOpenPanel: o }) })
6089
+ /* @__PURE__ */ u("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ u(jl, { panel: A == null ? void 0 : A.panel, params: te, onOpenPanel: o }) })
6083
6090
  ] })
6084
6091
  ] });
6085
6092
  }
@@ -6291,53 +6298,53 @@ function Kl({
6291
6298
  initialPanels: d,
6292
6299
  className: p
6293
6300
  }) {
6294
- const [m, g] = B(() => {
6301
+ const [m, g] = j(() => {
6295
6302
  if (!o) return !1;
6296
6303
  try {
6297
6304
  return localStorage.getItem(`${o}:sidebarCollapsed`) === "1";
6298
6305
  } catch {
6299
6306
  return !1;
6300
6307
  }
6301
- }), [v, N] = B(() => {
6308
+ }), [v, k] = j(() => {
6302
6309
  if (!o) return t;
6303
6310
  try {
6304
- const w = localStorage.getItem(`${o}:sidebarWidth`);
6305
- if (!w) return t;
6306
- const D = Number(w);
6307
- return Number.isFinite(D) ? Math.max(n, Math.min(r, D)) : t;
6311
+ const S = localStorage.getItem(`${o}:sidebarWidth`);
6312
+ if (!S) return t;
6313
+ const N = Number(S);
6314
+ return Number.isFinite(N) ? Math.max(n, Math.min(r, N)) : t;
6308
6315
  } catch {
6309
6316
  return t;
6310
6317
  }
6311
- }), x = $(null), _ = $(null), P = $(null), [L, A] = B(null), [h, C] = B(null), O = $(i);
6312
- O.current = i;
6313
- const z = $(a);
6314
- z.current = a;
6315
- const M = $(l);
6316
- M.current = l;
6317
- const I = $(/* @__PURE__ */ new Set()), W = $(/* @__PURE__ */ new Set()), T = $(null), F = $(
6318
+ }), b = D(null), _ = D(null), W = D(null), [B, z] = j(null), [h, C] = j(null), F = D(i);
6319
+ F.current = i;
6320
+ const O = D(a);
6321
+ O.current = a;
6322
+ const $ = D(l);
6323
+ $.current = l;
6324
+ const I = D(/* @__PURE__ */ new Set()), L = D(/* @__PURE__ */ new Set()), T = D(null), A = D(
6318
6325
  /* @__PURE__ */ new Map()
6319
6326
  ), J = Mt(), H = ot(
6320
6327
  J.subscribe,
6321
6328
  J.getSnapshot,
6322
6329
  J.getSnapshot
6323
- ), te = Tr(), X = $(J);
6330
+ ), te = Tr(), X = D(J);
6324
6331
  X.current = J;
6325
- const ae = $(te);
6332
+ const ae = D(te);
6326
6333
  ae.current = te;
6327
6334
  const ue = Y(() => {
6328
- const w = /* @__PURE__ */ new Set();
6329
- for (const D of H)
6330
- D.placement === "center" && w.add(D.id);
6331
- for (const D of s ?? [])
6332
- w.add(D);
6333
- return [...w];
6334
- }, [s, H]), q = E((w) => {
6335
- const D = x.current;
6336
- if (!D) {
6335
+ const S = /* @__PURE__ */ new Set();
6336
+ for (const N of H)
6337
+ N.placement === "center" && S.add(N.id);
6338
+ for (const N of s ?? [])
6339
+ S.add(N);
6340
+ return [...S];
6341
+ }, [s, H]), q = E((S) => {
6342
+ const N = b.current;
6343
+ if (!N) {
6337
6344
  console.warn("[SurfaceShell] openFile: surface not ready (dockview not initialized)");
6338
6345
  return;
6339
6346
  }
6340
- const R = Tt(w), G = {
6347
+ const R = Tt(S), G = {
6341
6348
  kind: Ye,
6342
6349
  target: R
6343
6350
  }, ie = ae.current.resolve(G);
@@ -6347,13 +6354,13 @@ function Kl({
6347
6354
  return;
6348
6355
  }
6349
6356
  const be = Xt(G, ie);
6350
- W.current.add(be);
6351
- const se = D.getPanel(be), ge = Qt(ie.params, R);
6357
+ L.current.add(be);
6358
+ const se = N.getPanel(be), ge = Qt(ie.params, R);
6352
6359
  if (se) {
6353
6360
  se.api.updateParameters(ge), se.api.setActive();
6354
6361
  return;
6355
6362
  }
6356
- D.addPanel({
6363
+ N.addPanel({
6357
6364
  id: be,
6358
6365
  component: ie.component,
6359
6366
  title: ie.title ?? R.split("/").pop() ?? R,
@@ -6361,27 +6368,27 @@ function Kl({
6361
6368
  });
6362
6369
  return;
6363
6370
  }
6364
- const ye = ur(D, R);
6371
+ const ye = ur(N, R);
6365
6372
  if (ye) {
6366
6373
  ye.api.setActive();
6367
6374
  return;
6368
6375
  }
6369
6376
  console.warn(`[SurfaceShell] openFile: no surface resolver matched "${R}"`);
6370
- }, []), ce = E((w) => {
6377
+ }, []), ce = E((S) => {
6371
6378
  var mt;
6372
- const D = x.current;
6373
- if (!D) {
6379
+ const N = b.current;
6380
+ if (!N) {
6374
6381
  console.warn("[SurfaceShell] openSurface: surface not ready (dockview not initialized)");
6375
6382
  return;
6376
6383
  }
6377
- const R = Gl(w), G = ae.current.resolve(R);
6384
+ const R = Gl(S), G = ae.current.resolve(R);
6378
6385
  if (!G) {
6379
6386
  console.warn(`[SurfaceShell] openSurface: no resolver matched kind="${R.kind}" target="${R.target}"`);
6380
6387
  return;
6381
6388
  }
6382
6389
  const ie = Xt(R, G);
6383
- R.kind === Ye && W.current.add(ie);
6384
- const ye = D.getPanel(ie), be = ((mt = R.meta) == null ? void 0 : mt.closeWorkbenchOnDone) === !0, se = R.kind === Ye ? Qt(G.params, R.target) : G.params, ge = be && M.current ? { ...se ?? {}, __closeWorkbenchOnDone: M.current } : se;
6390
+ R.kind === Ye && L.current.add(ie);
6391
+ const ye = N.getPanel(ie), be = ((mt = R.meta) == null ? void 0 : mt.closeWorkbenchOnDone) === !0, se = R.kind === Ye ? Qt(G.params, R.target) : G.params, ge = be && $.current ? { ...se ?? {}, __closeWorkbenchOnDone: $.current } : se;
6385
6392
  if (ye) {
6386
6393
  ge && ye.api.updateParameters(ge), ye.api.setActive();
6387
6394
  return;
@@ -6393,50 +6400,50 @@ function Kl({
6393
6400
  `openSurface: unknown component "${G.component}". Registered panels: [${Ut}]. Register the component through a panel output before resolving to it.`
6394
6401
  );
6395
6402
  }
6396
- D.addPanel({
6403
+ N.addPanel({
6397
6404
  id: ie,
6398
6405
  component: G.component,
6399
6406
  title: G.title ?? R.target,
6400
6407
  params: ge
6401
6408
  });
6402
- }, []), fe = E((w) => {
6403
- const D = x.current;
6404
- if (!D) return;
6405
- const R = D.getPanel(w.id);
6409
+ }, []), fe = E((S) => {
6410
+ const N = b.current;
6411
+ if (!N) return;
6412
+ const R = N.getPanel(S.id);
6406
6413
  if (R) {
6407
- w.params && R.api.updateParameters(w.params), R.api.setActive();
6414
+ S.params && R.api.updateParameters(S.params), R.api.setActive();
6408
6415
  return;
6409
6416
  }
6410
6417
  const G = X.current;
6411
- if (!G.has(w.component)) {
6418
+ if (!G.has(S.component)) {
6412
6419
  const ie = G.list().map((ye) => ye.id).join(", ");
6413
6420
  throw new Error(
6414
- `openPanel: unknown component "${w.component}". Registered panels: [${ie}]. Add the component to WorkspaceProvider's "panels" prop, or pick one of the registered ids.`
6421
+ `openPanel: unknown component "${S.component}". Registered panels: [${ie}]. Add the component to WorkspaceProvider's "panels" prop, or pick one of the registered ids.`
6415
6422
  );
6416
6423
  }
6417
- D.addPanel({
6418
- id: w.id,
6419
- component: w.component,
6420
- title: w.title ?? w.id,
6421
- params: w.params
6424
+ N.addPanel({
6425
+ id: S.id,
6426
+ component: S.component,
6427
+ title: S.title ?? S.id,
6428
+ params: S.params
6422
6429
  });
6423
6430
  }, []), ke = E(() => {
6424
6431
  var R;
6425
- const w = x.current;
6426
- return w ? { openTabs: w.panels.map((G) => ({
6432
+ const S = b.current;
6433
+ return S ? { openTabs: S.panels.map((G) => ({
6427
6434
  id: G.id,
6428
6435
  title: G.title ?? G.id,
6429
6436
  params: G.params ?? void 0
6430
- })), activeTab: ((R = w.activePanel) == null ? void 0 : R.id) ?? null } : { openTabs: [], activeTab: null };
6431
- }, []), Pe = E((w, D) => {
6432
- const R = F.current.get(w);
6437
+ })), activeTab: ((R = S.activePanel) == null ? void 0 : R.id) ?? null } : { openTabs: [], activeTab: null };
6438
+ }, []), Pe = E((S, N) => {
6439
+ const R = A.current.get(S);
6433
6440
  if (!R || R.size === 0) return !1;
6434
6441
  for (const G of [...R])
6435
- G(D);
6442
+ G(N);
6436
6443
  return !0;
6437
- }, []), He = E((w) => {
6438
- const D = Tt(w);
6439
- T.current = D, C((R) => ({ path: D, seq: ((R == null ? void 0 : R.seq) ?? 0) + 1 })), g(!1), Pe("tree:expand", { path: D }) && (T.current = null);
6444
+ }, []), He = E((S) => {
6445
+ const N = Tt(S);
6446
+ T.current = N, C((R) => ({ path: N, seq: ((R == null ? void 0 : R.seq) ?? 0) + 1 })), g(!1), Pe("tree:expand", { path: N }) && (T.current = null);
6440
6447
  }, [Pe]), Ve = Y(() => ({
6441
6448
  openFile: q,
6442
6449
  openSurface: ce,
@@ -6446,47 +6453,47 @@ function Kl({
6446
6453
  getSnapshot: ke
6447
6454
  }), [He, ke, q, fe, ce]), Ie = E(() => {
6448
6455
  var be;
6449
- const w = x.current, D = w ? w.panels.map((se) => ({
6456
+ const S = b.current, N = S ? S.panels.map((se) => ({
6450
6457
  id: se.id,
6451
6458
  component: String(se.component ?? ""),
6452
6459
  params: se.params ?? void 0
6453
- })) : [], R = ((be = w == null ? void 0 : w.activePanel) == null ? void 0 : be.id) ?? null, G = W.current, ie = D.find((se) => se.id === R), ye = dr(ie, G);
6460
+ })) : [], R = ((be = S == null ? void 0 : S.activePanel) == null ? void 0 : be.id) ?? null, G = L.current, ie = N.find((se) => se.id === R), ye = dr(ie, G);
6454
6461
  return {
6455
6462
  hydrationComplete: !0,
6456
6463
  layout: null,
6457
6464
  sidebar: { collapsed: !1, width: t },
6458
6465
  panelSizes: {},
6459
6466
  preferences: { theme: "dark" },
6460
- panels: D,
6467
+ panels: N,
6461
6468
  activePanel: R,
6462
6469
  activeFile: ye,
6463
- visibleFiles: D.map((se) => dr(se, G)).filter((se) => se !== null),
6470
+ visibleFiles: N.map((se) => dr(se, G)).filter((se) => se !== null),
6464
6471
  dirtyFiles: {},
6465
6472
  notifications: []
6466
6473
  };
6467
6474
  }, [t]), le = E(() => {
6468
- const w = Ie();
6469
- for (const D of I.current)
6470
- D(w);
6471
- }, [Ie]), me = $(!1), Ne = E((w) => {
6475
+ const S = Ie();
6476
+ for (const N of I.current)
6477
+ N(S);
6478
+ }, [Ie]), me = D(!1), Ne = E((S) => {
6472
6479
  var R;
6473
- if (x.current = w, A(w), !me.current) {
6480
+ if (b.current = S, z(S), !me.current) {
6474
6481
  me.current = !0;
6475
6482
  for (const G of d ?? [])
6476
- w.getPanel(G.id) || w.addPanel({ id: G.id, component: G.component, title: G.title, params: G.params });
6483
+ S.getPanel(G.id) || S.addPanel({ id: G.id, component: G.component, title: G.title, params: G.params });
6477
6484
  }
6478
- (R = O.current) == null || R.call(O, Ve);
6479
- const D = () => {
6485
+ (R = F.current) == null || R.call(F, Ve);
6486
+ const N = () => {
6480
6487
  var G;
6481
- (G = z.current) == null || G.call(z, ke()), le();
6488
+ (G = O.current) == null || G.call(O, ke()), le();
6482
6489
  };
6483
- w.onDidAddPanel(D), w.onDidRemovePanel(D), w.onDidActivePanelChange(D), D();
6490
+ S.onDidAddPanel(N), S.onDidRemovePanel(N), S.onDidActivePanelChange(N), N();
6484
6491
  }, [Ve, ke, le]), Te = E(
6485
- async (w) => {
6492
+ async (S) => {
6486
6493
  try {
6487
- const D = x.current;
6488
- if (!D) return St("not-ready", "surface not ready");
6489
- const R = Tt(w), G = {
6494
+ const N = b.current;
6495
+ if (!N) return St("not-ready", "surface not ready");
6496
+ const R = Tt(S), G = {
6490
6497
  kind: Ye,
6491
6498
  target: R
6492
6499
  }, ie = ae.current.resolve(G);
@@ -6497,21 +6504,21 @@ function Kl({
6497
6504
  `surface resolver "${G.kind}" returned unknown panel "${ie.component}"`
6498
6505
  );
6499
6506
  const be = Xt(G, ie);
6500
- W.current.add(be);
6501
- const se = Qt(ie.params, R), ge = D.getPanel(be);
6502
- return ge ? (ge.api.updateParameters(se), ge.api.setActive(), je()) : (D.addPanel({
6507
+ L.current.add(be);
6508
+ const se = Qt(ie.params, R), ge = N.getPanel(be);
6509
+ return ge ? (ge.api.updateParameters(se), ge.api.setActive(), je()) : (N.addPanel({
6503
6510
  id: be,
6504
6511
  component: ie.component,
6505
6512
  title: ie.title ?? R.split("/").pop() ?? R,
6506
6513
  params: se
6507
6514
  }), je());
6508
6515
  }
6509
- const ye = ur(D, R);
6516
+ const ye = ur(N, R);
6510
6517
  return ye ? (ye.api.setActive(), je()) : St("NO_SURFACE_RESOLVER", `no registered surface resolver handles ${R}`);
6511
- } catch (D) {
6518
+ } catch (N) {
6512
6519
  return St(
6513
6520
  "INVALID_SURFACE_PATH",
6514
- D instanceof Error ? D.message : "failed to open file"
6521
+ N instanceof Error ? N.message : "failed to open file"
6515
6522
  );
6516
6523
  }
6517
6524
  },
@@ -6527,60 +6534,60 @@ function Kl({
6527
6534
  closeWorkbenchLeftPane: async () => (g(!0), je()),
6528
6535
  showNotification: async () => je(),
6529
6536
  navigateToLine: async () => je(),
6530
- expandToFile: async (w) => (He(w), je()),
6537
+ expandToFile: async (S) => (He(S), je()),
6531
6538
  markDirty: () => {
6532
6539
  },
6533
6540
  markClean: () => {
6534
6541
  },
6535
- subscribe: (w, D) => {
6536
- let R = F.current.get(w);
6537
- return R || (R = /* @__PURE__ */ new Set(), F.current.set(w, R)), R.add(D), w === "tree:expand" && T.current && (D({ path: T.current }), T.current = null), () => {
6538
- R == null || R.delete(D);
6542
+ subscribe: (S, N) => {
6543
+ let R = A.current.get(S);
6544
+ return R || (R = /* @__PURE__ */ new Set(), A.current.set(S, R)), R.add(N), S === "tree:expand" && T.current && (N({ path: T.current }), T.current = null), () => {
6545
+ R == null || R.delete(N);
6539
6546
  };
6540
6547
  },
6541
- select: (w, D) => {
6542
- const R = (G) => D(w(G));
6548
+ select: (S, N) => {
6549
+ const R = (G) => N(S(G));
6543
6550
  return I.current.add(R), R(Ie()), () => {
6544
6551
  I.current.delete(R);
6545
6552
  };
6546
6553
  }
6547
6554
  }), [He, Te, Ie]), he = E(
6548
- (w) => {
6555
+ (S) => {
6549
6556
  if (m) return;
6550
- w.preventDefault(), w.currentTarget.setPointerCapture(w.pointerId), P.current = { startX: w.clientX, startWidth: v };
6557
+ S.preventDefault(), S.currentTarget.setPointerCapture(S.pointerId), W.current = { startX: S.clientX, startWidth: v };
6551
6558
  },
6552
6559
  [m, v]
6553
6560
  ), ze = E(
6554
- (w) => {
6555
- const D = P.current;
6556
- if (!D) return;
6557
- const R = w.clientX - D.startX, G = Math.max(n, Math.min(r, D.startWidth + R));
6558
- N(G);
6561
+ (S) => {
6562
+ const N = W.current;
6563
+ if (!N) return;
6564
+ const R = S.clientX - N.startX, G = Math.max(n, Math.min(r, N.startWidth + R));
6565
+ k(G);
6559
6566
  },
6560
6567
  [n, r]
6561
- ), Ae = E((w) => {
6562
- P.current && (P.current = null, w.currentTarget.releasePointerCapture(w.pointerId));
6568
+ ), Ae = E((S) => {
6569
+ W.current && (W.current = null, S.currentTarget.releasePointerCapture(S.pointerId));
6563
6570
  }, []), st = E(
6564
- (w) => {
6571
+ (S) => {
6565
6572
  if (m) return;
6566
- const D = w.shiftKey ? 32 : 16;
6567
- w.key === "ArrowLeft" ? (w.preventDefault(), N((R) => Math.max(n, R - D))) : w.key === "ArrowRight" ? (w.preventDefault(), N((R) => Math.min(r, R + D))) : w.key === "Home" ? (w.preventDefault(), N(n)) : w.key === "End" && (w.preventDefault(), N(r));
6573
+ const N = S.shiftKey ? 32 : 16;
6574
+ S.key === "ArrowLeft" ? (S.preventDefault(), k((R) => Math.max(n, R - N))) : S.key === "ArrowRight" ? (S.preventDefault(), k((R) => Math.min(r, R + N))) : S.key === "Home" ? (S.preventDefault(), k(n)) : S.key === "End" && (S.preventDefault(), k(r));
6568
6575
  },
6569
6576
  [m, n, r]
6570
6577
  );
6571
- return j(() => {
6578
+ return M(() => {
6572
6579
  if (o)
6573
6580
  try {
6574
6581
  localStorage.setItem(`${o}:sidebarWidth`, String(v));
6575
6582
  } catch {
6576
6583
  }
6577
- }, [o, v]), j(() => {
6584
+ }, [o, v]), M(() => {
6578
6585
  if (o)
6579
6586
  try {
6580
6587
  localStorage.setItem(`${o}:sidebarCollapsed`, m ? "1" : "0");
6581
6588
  } catch {
6582
6589
  }
6583
- }, [o, m]), /* @__PURE__ */ S(
6590
+ }, [o, m]), /* @__PURE__ */ x(
6584
6591
  "div",
6585
6592
  {
6586
6593
  ref: _,
@@ -6588,7 +6595,7 @@ function Kl({
6588
6595
  className: oe("flex h-full min-h-0 w-full bg-background", p),
6589
6596
  "data-testid": "surface-shell",
6590
6597
  children: [
6591
- m ? null : /* @__PURE__ */ S(Me, { children: [
6598
+ m ? null : /* @__PURE__ */ x(Me, { children: [
6592
6599
  /* @__PURE__ */ u(
6593
6600
  "aside",
6594
6601
  {
@@ -6631,7 +6638,7 @@ function Kl({
6631
6638
  }
6632
6639
  )
6633
6640
  ] }),
6634
- /* @__PURE__ */ S("div", { className: "relative min-w-0 flex-1", children: [
6641
+ /* @__PURE__ */ x("div", { className: "relative min-w-0 flex-1", children: [
6635
6642
  /* @__PURE__ */ u(
6636
6643
  "div",
6637
6644
  {
@@ -6649,7 +6656,7 @@ function Kl({
6649
6656
  )
6650
6657
  }
6651
6658
  ),
6652
- /* @__PURE__ */ S(
6659
+ /* @__PURE__ */ x(
6653
6660
  "div",
6654
6661
  {
6655
6662
  className: "pointer-events-none absolute inset-x-0 top-0 flex items-center justify-between",
@@ -6674,7 +6681,7 @@ function Kl({
6674
6681
  /* @__PURE__ */ u(
6675
6682
  Yl,
6676
6683
  {
6677
- api: L,
6684
+ api: B,
6678
6685
  collapsed: m,
6679
6686
  onExpandFiles: () => g(!1)
6680
6687
  }
@@ -6704,8 +6711,8 @@ function Yl({
6704
6711
  collapsed: t,
6705
6712
  onExpandFiles: n
6706
6713
  }) {
6707
- const [r, o] = B(!0);
6708
- return j(() => {
6714
+ const [r, o] = j(!0);
6715
+ return M(() => {
6709
6716
  if (!e) return;
6710
6717
  const i = () => o(e.panels.length === 0);
6711
6718
  i();
@@ -6713,8 +6720,8 @@ function Yl({
6713
6720
  return () => {
6714
6721
  a.dispose(), l.dispose();
6715
6722
  };
6716
- }, [e]), r ? /* @__PURE__ */ S(Me, { children: [
6717
- /* @__PURE__ */ S("div", { className: "pointer-events-none absolute inset-x-0 top-0 flex items-center gap-0.5 border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)] bg-background px-1", style: { height: 44 }, children: [
6723
+ }, [e]), r ? /* @__PURE__ */ x(Me, { children: [
6724
+ /* @__PURE__ */ x("div", { className: "pointer-events-none absolute inset-x-0 top-0 flex items-center gap-0.5 border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)] bg-background px-1", style: { height: 44 }, children: [
6718
6725
  t && /* @__PURE__ */ u(Fe, { label: "Show workspace menu", side: "right", children: /* @__PURE__ */ u(
6719
6726
  xe,
6720
6727
  {
@@ -6729,14 +6736,14 @@ function Yl({
6729
6736
  ) }),
6730
6737
  /* @__PURE__ */ u("div", { className: "flex-1" })
6731
6738
  ] }),
6732
- /* @__PURE__ */ S("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
6733
- /* @__PURE__ */ S("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
6739
+ /* @__PURE__ */ x("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
6740
+ /* @__PURE__ */ x("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
6734
6741
  /* @__PURE__ */ u("span", { className: "inline-block h-px w-3 bg-[color:var(--accent)]", "aria-hidden": "true" }),
6735
6742
  "Workbench"
6736
6743
  ] }),
6737
6744
  /* @__PURE__ */ u("div", { className: "text-[15px] font-medium tracking-tight text-foreground", children: "Nothing open yet" }),
6738
6745
  /* @__PURE__ */ u("p", { className: "max-w-[280px] text-[12.5px] leading-relaxed text-muted-foreground/85", children: "Open a source item, or let the agent produce an artifact here." }),
6739
- t && /* @__PURE__ */ S(
6746
+ t && /* @__PURE__ */ x(
6740
6747
  Oe,
6741
6748
  {
6742
6749
  type: "button",
@@ -6991,15 +6998,15 @@ function bu(e) {
6991
6998
  return typeof t != "string" || !t.startsWith("boring.plugin.");
6992
6999
  }
6993
7000
  function wu(e) {
6994
- const t = Mt(), n = fn(), r = Wt(), o = Tr(), i = $(/* @__PURE__ */ new Map()), a = $(/* @__PURE__ */ new Map()), l = $(/* @__PURE__ */ new Set()), s = $(/* @__PURE__ */ new Set()), [f, c] = B(0), d = $(!1);
6995
- j(() => {
7001
+ const t = Mt(), n = fn(), r = Wt(), o = Tr(), i = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Set()), s = D(/* @__PURE__ */ new Set()), [f, c] = j(0), d = D(!1);
7002
+ M(() => {
6996
7003
  if (e.enabled === !1 || typeof EventSource > "u") return;
6997
7004
  const p = (m) => {
6998
7005
  const g = m.detail;
6999
7006
  bu(g) && (d.current = !0, c((v) => v + 1));
7000
7007
  };
7001
7008
  return window.addEventListener($e, p), () => window.removeEventListener($e, p);
7002
- }, [e.enabled]), j(() => {
7009
+ }, [e.enabled]), M(() => {
7003
7010
  if (e.enabled === !1 || typeof EventSource > "u") return;
7004
7011
  const p = d.current;
7005
7012
  if (d.current = !1, su(e.authHeaders)) {
@@ -7009,15 +7016,15 @@ function wu(e) {
7009
7016
  return;
7010
7017
  }
7011
7018
  let m = !1;
7012
- const g = ou(t, n, r, o), v = ko(wn(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), N = new EventSource(v, { withCredentials: !0 }), x = (A) => {
7019
+ const g = ou(t, n, r, o), v = ko(wn(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), k = new EventSource(v, { withCredentials: !0 }), b = (z) => {
7013
7020
  (async () => {
7014
- var O, z;
7021
+ var F, O;
7015
7022
  let h, C = !1;
7016
7023
  try {
7017
- if (h = JSON.parse(A.data), m || h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
7024
+ if (h = JSON.parse(z.data), m || h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
7018
7025
  h.replay && l.current.add(h.id);
7019
- const M = p && h.replay === !0, I = i.current.get(h.id) ?? 0, W = a.current.get(h.id) ?? 0;
7020
- if (!M && h.revision <= Math.max(I, W)) return;
7026
+ const $ = p && h.replay === !0, I = i.current.get(h.id) ?? 0, L = a.current.get(h.id) ?? 0;
7027
+ if (!$ && h.revision <= Math.max(I, L)) return;
7021
7028
  a.current.set(h.id, h.revision);
7022
7029
  const T = fr(h, e.apiBaseUrl);
7023
7030
  T && (C = !0, window.dispatchEvent(new CustomEvent($e, {
@@ -7029,16 +7036,16 @@ function wu(e) {
7029
7036
  replay: h.replay
7030
7037
  }
7031
7038
  })));
7032
- let F = null;
7039
+ let A = null;
7033
7040
  try {
7034
- F = T ? await pu({
7041
+ A = T ? await pu({
7035
7042
  pluginId: h.id,
7036
7043
  frontEntryUrl: T,
7037
7044
  revision: h.revision,
7038
7045
  importFront: e.importFront,
7039
7046
  isStale: () => m || a.current.get(h.id) !== h.revision,
7040
- ...((O = e.frontImportRetry) == null ? void 0 : O.attempts) !== void 0 ? { attempts: e.frontImportRetry.attempts } : {},
7041
- ...((z = e.frontImportRetry) == null ? void 0 : z.delayMs) !== void 0 ? { delayMs: e.frontImportRetry.delayMs } : {}
7047
+ ...((F = e.frontImportRetry) == null ? void 0 : F.attempts) !== void 0 ? { attempts: e.frontImportRetry.attempts } : {},
7048
+ ...((O = e.frontImportRetry) == null ? void 0 : O.delayMs) !== void 0 ? { delayMs: e.frontImportRetry.delayMs } : {}
7042
7049
  }) : null;
7043
7050
  } catch (J) {
7044
7051
  throw {
@@ -7046,13 +7053,13 @@ function wu(e) {
7046
7053
  error: J
7047
7054
  };
7048
7055
  }
7049
- if (m || a.current.get(h.id) !== h.revision || !M && h.revision <= (i.current.get(h.id) ?? 0)) return;
7050
- if (!F) {
7056
+ if (m || a.current.get(h.id) !== h.revision || !$ && h.revision <= (i.current.get(h.id) ?? 0)) return;
7057
+ if (!A) {
7051
7058
  s.current.has(h.id) && (kt(h.id, g), s.current.delete(h.id)), i.current.set(h.id, h.revision);
7052
7059
  return;
7053
7060
  }
7054
7061
  try {
7055
- yu(h.id, h.revision, F, g);
7062
+ yu(h.id, h.revision, A, g);
7056
7063
  } catch (J) {
7057
7064
  throw {
7058
7065
  stage: "register",
@@ -7060,16 +7067,16 @@ function wu(e) {
7060
7067
  };
7061
7068
  }
7062
7069
  s.current.add(h.id), i.current.set(h.id, h.revision), window.dispatchEvent(new CustomEvent($e, { detail: h }));
7063
- } catch (M) {
7070
+ } catch ($) {
7064
7071
  h && a.current.get(h.id) === h.revision && a.current.delete(h.id);
7065
- const I = typeof M == "object" && M && "stage" in M && M.stage === "register" ? "register" : "import", W = typeof M == "object" && M && "error" in M ? M.error : M;
7072
+ const I = typeof $ == "object" && $ && "stage" in $ && $.stage === "register" ? "register" : "import", L = typeof $ == "object" && $ && "error" in $ ? $.error : $;
7066
7073
  if (m) return;
7067
- const T = (h == null ? void 0 : h.id) ?? "<malformed>", F = W instanceof Error ? W.message : String(W);
7068
- if (console.error(`[boring-ui] failed to load plugin ${T}; keeping previous version`, W), h) {
7074
+ const T = (h == null ? void 0 : h.id) ?? "<malformed>", A = L instanceof Error ? L.message : String(L);
7075
+ if (console.error(`[boring-ui] failed to load plugin ${T}; keeping previous version`, L), h) {
7069
7076
  const J = fr(h, e.apiBaseUrl), H = {
7070
7077
  pluginId: h.id,
7071
7078
  revision: h.revision,
7072
- message: F,
7079
+ message: A,
7073
7080
  ...J ? { url: J } : {}
7074
7081
  };
7075
7082
  e.reportFrontError ? e.reportFrontError(H) : nu(e, H), window.dispatchEvent(new CustomEvent($e, {
@@ -7078,7 +7085,7 @@ function wu(e) {
7078
7085
  id: h.id,
7079
7086
  revision: h.revision,
7080
7087
  workspaceId: h.workspaceId ?? e.workspaceId,
7081
- message: F,
7088
+ message: A,
7082
7089
  code: eu,
7083
7090
  stage: I,
7084
7091
  replay: h.replay
@@ -7097,21 +7104,21 @@ function wu(e) {
7097
7104
  }));
7098
7105
  }
7099
7106
  })();
7100
- }, _ = (A) => {
7107
+ }, _ = (z) => {
7101
7108
  if (!m)
7102
7109
  try {
7103
- const h = JSON.parse(A.data);
7110
+ const h = JSON.parse(z.data);
7104
7111
  if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
7105
- const C = i.current.get(h.id) ?? 0, O = a.current.get(h.id) ?? 0;
7106
- if (h.revision <= Math.max(C, O)) return;
7112
+ const C = i.current.get(h.id) ?? 0, F = a.current.get(h.id) ?? 0;
7113
+ if (h.revision <= Math.max(C, F)) return;
7107
7114
  a.current.set(h.id, h.revision), s.current.has(h.id) && (kt(h.id, g), s.current.delete(h.id)), i.current.set(h.id, h.revision), window.dispatchEvent(new CustomEvent($e, { detail: h }));
7108
7115
  } catch (h) {
7109
7116
  console.error("[boring-ui] failed to process plugin unload event", h);
7110
7117
  }
7111
- }, P = (A) => {
7118
+ }, W = (z) => {
7112
7119
  if (!m)
7113
7120
  try {
7114
- const h = JSON.parse(A.data);
7121
+ const h = JSON.parse(z.data);
7115
7122
  if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
7116
7123
  console.error(`[boring-ui] plugin ${h.id} failed to reload: ${h.message}`), window.dispatchEvent(new CustomEvent($e, {
7117
7124
  detail: {
@@ -7125,18 +7132,18 @@ function wu(e) {
7125
7132
  } catch (h) {
7126
7133
  console.error("[boring-ui] failed to process plugin error event", h);
7127
7134
  }
7128
- }, L = (A) => {
7135
+ }, B = (z) => {
7129
7136
  if (!m)
7130
7137
  try {
7131
- const h = JSON.parse(A.data);
7138
+ const h = JSON.parse(z.data);
7132
7139
  if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
7133
7140
  const C = l.current;
7134
- for (const [O, z] of i.current.entries())
7135
- C.has(O) || (s.current.has(O) && (kt(O, g), s.current.delete(O)), i.current.delete(O), a.current.delete(O), window.dispatchEvent(new CustomEvent($e, {
7141
+ for (const [F, O] of i.current.entries())
7142
+ C.has(F) || (s.current.has(F) && (kt(F, g), s.current.delete(F)), i.current.delete(F), a.current.delete(F), window.dispatchEvent(new CustomEvent($e, {
7136
7143
  detail: {
7137
7144
  type: "boring.plugin.unload",
7138
- id: O,
7139
- revision: z + 1,
7145
+ id: F,
7146
+ revision: O + 1,
7140
7147
  workspaceId: h.workspaceId ?? e.workspaceId,
7141
7148
  replay: !0
7142
7149
  }
@@ -7146,12 +7153,12 @@ function wu(e) {
7146
7153
  console.error("[boring-ui] failed to process plugin replay-complete event", h);
7147
7154
  }
7148
7155
  };
7149
- return N.addEventListener("boring.plugin.load", x), N.addEventListener("boring.plugin.unload", _), N.addEventListener("boring.plugin.error", P), N.addEventListener("boring.plugin.replay-complete", L), () => {
7156
+ return k.addEventListener("boring.plugin.load", b), k.addEventListener("boring.plugin.unload", _), k.addEventListener("boring.plugin.error", W), k.addEventListener("boring.plugin.replay-complete", B), () => {
7150
7157
  if (m = !0, !d.current) {
7151
- for (const A of s.current) kt(A, g);
7158
+ for (const z of s.current) kt(z, g);
7152
7159
  s.current.clear(), i.current.clear(), a.current.clear(), l.current.clear();
7153
7160
  }
7154
- N.close();
7161
+ k.close();
7155
7162
  };
7156
7163
  }, [e.apiBaseUrl, e.workspaceId, e.enabled, e.authHeaders, e.importFront, e.frontImportRetry, t, n, r, o, f]);
7157
7164
  }
@@ -7187,7 +7194,7 @@ function Sd() {
7187
7194
  return { theme: vn(), setTheme: e.setTheme, toggleTheme: e.toggleTheme };
7188
7195
  }
7189
7196
  function xd({ children: e, defaultTheme: t, onThemeChange: n }) {
7190
- const r = $(null);
7197
+ const r = D(null);
7191
7198
  if (!r.current) {
7192
7199
  const f = oo({ persistenceEnabled: !1 });
7193
7200
  Hr(f);
@@ -7203,7 +7210,7 @@ function xd({ children: e, defaultTheme: t, onThemeChange: n }) {
7203
7210
  const f = o.getState().preferences.theme === "light" ? "dark" : "light";
7204
7211
  i(f);
7205
7212
  }, [o, i]), l = vn();
7206
- j(() => (document.documentElement.setAttribute("data-theme", l), () => {
7213
+ M(() => (document.documentElement.setAttribute("data-theme", l), () => {
7207
7214
  document.documentElement.removeAttribute("data-theme");
7208
7215
  }), [l]);
7209
7216
  const s = Y(() => ({ setTheme: i, toggleTheme: a }), [i, a]);
@@ -7266,7 +7273,7 @@ function Tu({
7266
7273
  }
7267
7274
  function Ru({ commands: e }) {
7268
7275
  const t = fn();
7269
- return j(() => {
7276
+ return M(() => {
7270
7277
  if (!(e != null && e.length)) return;
7271
7278
  const n = e.map((r) => r.id);
7272
7279
  for (const r of n) t.unregisterCommand(r);
@@ -7281,7 +7288,7 @@ function Nu({
7281
7288
  catalogs: e
7282
7289
  }) {
7283
7290
  const t = Wt();
7284
- return j(() => {
7291
+ return M(() => {
7285
7292
  if (e != null && e.length) {
7286
7293
  for (const n of e)
7287
7294
  t.register(n, mr);
@@ -7325,7 +7332,7 @@ function Du({
7325
7332
  }, i);
7326
7333
  }
7327
7334
  function _u({ onOpenFile: e }) {
7328
- return j(() => {
7335
+ return M(() => {
7329
7336
  if (e)
7330
7337
  return K.on(Ee.uiCommand, ({ command: t }) => {
7331
7338
  if (t.kind !== "openFile") return;
@@ -7354,55 +7361,55 @@ function Pd({
7354
7361
  workspaceId: m,
7355
7362
  workspaceLabel: g,
7356
7363
  storageKey: v,
7357
- persistenceEnabled: N = !0,
7358
- manageDocumentTitle: x = !0,
7364
+ persistenceEnabled: k = !0,
7365
+ manageDocumentTitle: b = !0,
7359
7366
  bridgeEndpoint: _,
7360
- onAuthError: P,
7361
- onOpenFile: L,
7362
- debug: A = !1,
7367
+ onAuthError: W,
7368
+ onOpenFile: B,
7369
+ debug: z = !1,
7363
7370
  frontPluginHotReload: h = !1,
7364
7371
  fullPageBasePath: C
7365
7372
  }) {
7366
- const O = $(null);
7367
- if (!O.current) {
7373
+ const F = D(null);
7374
+ if (!F.current) {
7368
7375
  const le = oo({
7369
7376
  workspaceId: m,
7370
7377
  storageKey: v,
7371
- persistenceEnabled: N
7378
+ persistenceEnabled: k
7372
7379
  });
7373
7380
  Hr(le);
7374
7381
  const me = d ?? Po();
7375
- me !== "light" && !N ? le.getState().setTheme(me) : me !== "light" && (typeof localStorage < "u" && localStorage.getItem("boring-ui-v2:preferences") !== null || le.getState().setTheme(me)), O.current = le;
7382
+ me !== "light" && !k ? le.getState().setTheme(me) : me !== "light" && (typeof localStorage < "u" && localStorage.getItem("boring-ui-v2:preferences") !== null || le.getState().setTheme(me)), F.current = le;
7376
7383
  }
7377
- const z = O.current, M = $(null), I = $(f);
7384
+ const O = F.current, $ = D(null), I = D(f);
7378
7385
  I.current = f;
7379
- const W = $(P);
7380
- W.current = P, j(() => () => {
7386
+ const L = D(W);
7387
+ L.current = W, M(() => () => {
7381
7388
  var le;
7382
- (le = M.current) == null || le.disconnect(), M.current = null, z.cleanup();
7383
- }, [z]), j(() => {
7389
+ (le = $.current) == null || le.disconnect(), $.current = null, O.cleanup();
7390
+ }, [O]), M(() => {
7384
7391
  var Te, Ze;
7385
- if (M.current && (M.current.disconnect(), M.current = null), !_) return;
7386
- const le = os(z), me = (Ze = (Te = I.current) == null ? void 0 : Te.Authorization) == null ? void 0 : Ze.replace(/^Bearer\s+/i, ""), Ne = cs({
7392
+ if ($.current && ($.current.disconnect(), $.current = null), !_) return;
7393
+ const le = os(O), me = (Ze = (Te = I.current) == null ? void 0 : Te.Authorization) == null ? void 0 : Ze.replace(/^Bearer\s+/i, ""), Ne = cs({
7387
7394
  endpoint: _,
7388
7395
  bridge: le,
7389
- store: z,
7396
+ store: O,
7390
7397
  authToken: me,
7391
7398
  onAuthError: (he) => {
7392
7399
  var ze;
7393
- return (ze = W.current) == null ? void 0 : ze.call(W, he);
7400
+ return (ze = L.current) == null ? void 0 : ze.call(L, he);
7394
7401
  },
7395
7402
  onConnectionChange: He
7396
7403
  });
7397
- return Ne.connect(), M.current = Ne, () => {
7398
- Ne.disconnect(), M.current = null;
7404
+ return Ne.connect(), $.current = Ne, () => {
7405
+ Ne.disconnect(), $.current = null;
7399
7406
  };
7400
- }, [_, z]);
7401
- const { panelRegistry: T, commandRegistry: F, catalogRegistry: J, surfaceResolverRegistry: H, pluginMetas: te, pluginsWithBindings: X } = Y(() => {
7407
+ }, [_, O]);
7408
+ const { panelRegistry: T, commandRegistry: A, catalogRegistry: J, surfaceResolverRegistry: H, pluginMetas: te, pluginsWithBindings: X } = Y(() => {
7402
7409
  const le = new ma(l), me = new Fc(), Ne = new Er(), Te = new Ir();
7403
- for (const w of Zl) {
7404
- const { id: D, ...R } = w;
7405
- le.register(D, R);
7410
+ for (const S of Zl) {
7411
+ const { id: N, ...R } = S;
7412
+ le.register(N, R);
7406
7413
  }
7407
7414
  const he = new Set(r ?? []).has(Vn.pluginId) ? [] : [Vn], Ae = zi({
7408
7415
  chatPanel: t ?? xu,
@@ -7413,15 +7420,15 @@ function Pd({
7413
7420
  }), st = [
7414
7421
  { id: "workspace:chat-layout", label: "Layout" },
7415
7422
  { id: "agent:chat-layout", label: "Layout" },
7416
- ...Ae.plugins.map((w) => ({
7417
- id: w.id,
7418
- label: w.label
7423
+ ...Ae.plugins.map((S) => ({
7424
+ id: S.id,
7425
+ label: S.label
7419
7426
  }))
7420
7427
  ];
7421
7428
  if (o)
7422
- for (const w of o) {
7423
- const { id: D, ...R } = w;
7424
- le.register(D, R);
7429
+ for (const S of o) {
7430
+ const { id: N, ...R } = S;
7431
+ le.register(N, R);
7425
7432
  }
7426
7433
  return {
7427
7434
  panelRegistry: le,
@@ -7431,19 +7438,19 @@ function Pd({
7431
7438
  pluginMetas: st,
7432
7439
  pluginsWithBindings: Ae.plugins
7433
7440
  };
7434
- }, [l, t, n, r, o]), ae = $(p);
7441
+ }, [l, t, n, r, o]), ae = D(p);
7435
7442
  ae.current = p;
7436
7443
  const ue = E(
7437
7444
  (le) => {
7438
7445
  var me;
7439
- z.getState().setTheme(le), (me = ae.current) == null || me.call(ae, le);
7446
+ O.getState().setTheme(le), (me = ae.current) == null || me.call(ae, le);
7440
7447
  },
7441
- [z]
7448
+ [O]
7442
7449
  ), q = E(() => {
7443
- const le = z.getState().preferences.theme === "light" ? "dark" : "light";
7450
+ const le = O.getState().preferences.theme === "light" ? "dark" : "light";
7444
7451
  ue(le);
7445
- }, [z, ue]), ce = vn();
7446
- j(() => (document.documentElement.setAttribute("data-theme", ce), () => {
7452
+ }, [O, ue]), ce = vn();
7453
+ M(() => (document.documentElement.setAttribute("data-theme", ce), () => {
7447
7454
  document.documentElement.removeAttribute("data-theme");
7448
7455
  }), [ce]);
7449
7456
  const fe = Y(
@@ -7453,35 +7460,35 @@ function Pd({
7453
7460
  () => Fu(m, f),
7454
7461
  [f, m]
7455
7462
  );
7456
- j(() => {
7457
- x && (document.title = Su({ workspaceLabel: g, workspaceId: m }));
7458
- }, [x, m, g]);
7459
- const [Pe, He] = B(!1), Ve = Y(
7463
+ M(() => {
7464
+ b && (document.title = Su({ workspaceLabel: g, workspaceId: m }));
7465
+ }, [b, m, g]);
7466
+ const [Pe, He] = j(!1), Ve = Y(
7460
7467
  () => ({ connected: Pe }),
7461
7468
  [Pe]
7462
7469
  ), Ie = Y(
7463
- () => ({ chatPanel: t ?? null, registeredPlugins: te, debug: A }),
7464
- [t, te, A]
7470
+ () => ({ chatPanel: t ?? null, registeredPlugins: te, debug: z }),
7471
+ [t, te, z]
7465
7472
  );
7466
7473
  return /* @__PURE__ */ u(xn.Provider, { value: Ie, children: /* @__PURE__ */ u(Sn.Provider, { value: fe, children: /* @__PURE__ */ u(Co.Provider, { value: Ve, children: /* @__PURE__ */ u($c, { basePath: C, children: /* @__PURE__ */ u(wl, { children: /* @__PURE__ */ u(Vi, { children: /* @__PURE__ */ u(
7467
7474
  Bi,
7468
7475
  {
7469
7476
  panelRegistry: T,
7470
- commandRegistry: F,
7477
+ commandRegistry: A,
7471
7478
  catalogRegistry: J,
7472
7479
  surfaceResolverRegistry: H,
7473
- children: /* @__PURE__ */ u(da, { apiBaseUrl: s, workspaceId: m, authHeaders: ke, children: /* @__PURE__ */ S(
7480
+ children: /* @__PURE__ */ u(da, { apiBaseUrl: s, workspaceId: m, authHeaders: ke, children: /* @__PURE__ */ x(
7474
7481
  Du,
7475
7482
  {
7476
7483
  plugins: X,
7477
7484
  apiBaseUrl: s,
7478
7485
  authHeaders: ke,
7479
- onAuthError: P,
7486
+ onAuthError: W,
7480
7487
  apiTimeout: c,
7481
7488
  children: [
7482
7489
  /* @__PURE__ */ u(Au, { plugins: X }),
7483
7490
  /* @__PURE__ */ u(ku, { apiBaseUrl: s, workspaceId: m, mode: h, authHeaders: ke }),
7484
- /* @__PURE__ */ u(_u, { onOpenFile: L }),
7491
+ /* @__PURE__ */ u(_u, { onOpenFile: B }),
7485
7492
  /* @__PURE__ */ u(Ru, { commands: i }),
7486
7493
  /* @__PURE__ */ u(
7487
7494
  Nu,
@@ -7489,7 +7496,7 @@ function Pd({
7489
7496
  catalogs: a
7490
7497
  }
7491
7498
  ),
7492
- /* @__PURE__ */ u(Tu, { store: z }),
7499
+ /* @__PURE__ */ u(Tu, { store: O }),
7493
7500
  /* @__PURE__ */ u(nl, {}),
7494
7501
  /* @__PURE__ */ u(Pi, {}),
7495
7502
  e,
@@ -7544,9 +7551,9 @@ export {
7544
7551
  fd as aB,
7545
7552
  yd as aC,
7546
7553
  vd as aD,
7547
- Fi as aE,
7548
- $e as aF,
7549
- tn as aG,
7554
+ tn as aE,
7555
+ Fi as aF,
7556
+ $e as aG,
7550
7557
  dl as aH,
7551
7558
  sd as aI,
7552
7559
  wd as aJ,