@peasant-labs/fairtrade 0.0.42 → 0.0.43

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.
package/dist/lib/graph.js CHANGED
@@ -1,20 +1,20 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, et as N, f as P, g as F, gt as ee, i as I, it as te, j as ne, k as re, l as ie, lt as ae, m as oe, n as se, o as ce, ot as le, pt as ue, q as de, r as fe, rt as pe, s as me, st as he, t as ge, tt as _e, v as ve, vt as ye, w as be, wt as xe, x as Se, y as Ce, z as we } from "./GraphLegend-CBKZsRta.js";
2
- import { p as Te } from "./time-CpVBzcqQ.js";
3
- import { a as Ee, n as De, r as Oe } from "./format-B3uT2wzU.js";
4
- import { memo as ke, useCallback as L, useEffect as R, useMemo as z, useRef as B, useState as V } from "react";
5
- import { Fragment as Ae, jsx as H, jsxs as U } from "react/jsx-runtime";
6
- import { Box as je, Check as Me, ChevronDown as Ne, ChevronRight as W, Coins as Pe, CornerDownRight as Fe, FileCode as Ie, FileDiff as Le, FileText as Re, Folder as ze, GitMerge as Be, Hash as Ve, Map as He, Maximize2 as Ue, MessageSquare as We, Minus as Ge, Plus as Ke, RotateCcw as qe, RotateCw as Je, Search as Ye, Share2 as Xe, Star as Ze, Tag as Qe, TriangleAlert as $e, X as et } from "lucide-react";
7
- import { AllChangeBindings as tt, AllDiffLineKinds as nt, AllEdgeViolationKinds as rt, AllFileChangeStatuses as it, AllInsightKinds as at, AllInsightProvenances as ot, AllMapNodeKinds as st, AllReadAttributionStates as ct, AllReadStateGrades as lt, ChangeBinding as ut, DiffLineKind as dt, EdgeViolationKind as ft, FileChangeStatus as pt, InsightKind as mt, InsightProvenance as ht, MapNodeKind as gt, ReadAttributionState as _t, ReadStateGrade as vt, isChangeBinding as yt, isDiffLineKind as bt, isEdgeViolationKind as xt, isFileChangeStatus as St, isInsightKind as Ct, isInsightProvenance as wt, isMapNodeKind as Tt, isReadAttributionState as Et, isReadStateGrade as Dt } from "@peasant-labs/schema";
8
- import { Background as Ot, BackgroundVariant as kt, Handle as G, MiniMap as At, Position as K, ReactFlow as jt, ReactFlowProvider as Mt, useEdgesState as Nt, useNodesState as Pt, useReactFlow as Ft } from "@xyflow/react";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, et as N, f as P, g as F, gt as I, i as L, it as ee, j as te, k as ne, l as re, lt as ie, m as ae, n as oe, o as se, ot as ce, pt as le, q as ue, r as de, rt as fe, s as pe, st as me, t as he, tt as ge, v as _e, vt as ve, w as ye, wt as be, x as xe, y as Se, z as Ce } from "./GraphLegend-e9x79JtU.js";
2
+ import { p as we } from "./time-CpVBzcqQ.js";
3
+ import { a as Te, n as Ee, r as De } from "./format-B3uT2wzU.js";
4
+ import { memo as Oe, useCallback as R, useEffect as z, useMemo as B, useRef as V, useState as H } from "react";
5
+ import { Fragment as ke, jsx as U, jsxs as W } from "react/jsx-runtime";
6
+ import { Box as Ae, Check as je, ChevronDown as Me, ChevronRight as G, Coins as Ne, CornerDownRight as Pe, FileCode as Fe, FileDiff as Ie, FileText as Le, Folder as Re, GitMerge as ze, Hash as Be, Map as Ve, Maximize2 as He, MessageSquare as Ue, Minus as We, Plus as Ge, RotateCcw as Ke, RotateCw as qe, Search as Je, Share2 as Ye, Star as Xe, Tag as Ze, TriangleAlert as Qe, X as $e } from "lucide-react";
7
+ import { AllChangeBindings as et, AllDiffLineKinds as tt, AllEdgeViolationKinds as nt, AllFileChangeStatuses as rt, AllInsightKinds as it, AllInsightProvenances as at, AllMapNodeKinds as ot, AllReadAttributionStates as st, AllReadStateGrades as ct, ChangeBinding as lt, DiffLineKind as ut, EdgeViolationKind as dt, FileChangeStatus as ft, InsightKind as pt, InsightProvenance as mt, MapNodeKind as ht, ReadAttributionState as gt, ReadStateGrade as _t, isChangeBinding as vt, isDiffLineKind as yt, isEdgeViolationKind as bt, isFileChangeStatus as xt, isInsightKind as St, isInsightProvenance as Ct, isMapNodeKind as wt, isReadAttributionState as Tt, isReadStateGrade as Et } from "@peasant-labs/schema";
8
+ import { Background as Dt, BackgroundVariant as Ot, Handle as K, MiniMap as kt, Position as q, ReactFlow as At, ReactFlowProvider as jt, useEdgesState as Mt, useNodesState as Nt, useReactFlow as Pt } from "@xyflow/react";
9
9
  //#region src/ui/graph/changeGraph.js
10
- var It = 6e4, Lt = 60 * It, Rt = 24 * Lt, zt = 7 * Rt;
11
- function q(e, t) {
10
+ var Ft = 6e4, It = 60 * Ft, Lt = 24 * It, Rt = 7 * Lt;
11
+ function J(e, t) {
12
12
  if (e == null) return "";
13
13
  let n = Math.max(0, t - e);
14
- return n < Lt ? `${Math.max(1, Math.floor(n / It))}m ago` : n < Rt ? `${Math.floor(n / Lt)}h ago` : n < zt ? `${Math.floor(n / Rt)}d ago` : `${Math.floor(n / zt)}wk ago`;
14
+ return n < It ? `${Math.max(1, Math.floor(n / Ft))}m ago` : n < Lt ? `${Math.floor(n / It)}h ago` : n < Rt ? `${Math.floor(n / Lt)}d ago` : `${Math.floor(n / Rt)}wk ago`;
15
15
  }
16
- function Bt(e, { nowMs: t }) {
17
- let n = e.recentCommits ?? [], r = e.changes ?? [], i = e.defaultBranch, a = e.sessions ?? [], o = new Map(a.map((e) => [e.sessionId, e])), s = new Set(n.flatMap((e) => e.sessionIds ?? [])), c = r.filter((e) => !e.merged).slice().sort((e, t) => Vt(t) - Vt(e) || e.branch.localeCompare(t.branch)), l = r.filter((e) => e.merged && !e.reverted), u = r.filter((e) => e.merged && e.reverted), d = new Map(l.filter((e) => e.mergeCommitHash).map((e) => [e.mergeCommitHash, e])), f = c.map((e, t) => ({
16
+ function zt(e, { nowMs: t }) {
17
+ let n = e.recentCommits ?? [], r = e.changes ?? [], i = e.defaultBranch, a = e.sessions ?? [], o = new Map(a.map((e) => [e.sessionId, e])), s = new Set(n.flatMap((e) => e.sessionIds ?? [])), c = r.filter((e) => !e.merged).slice().sort((e, t) => Bt(t) - Bt(e) || e.branch.localeCompare(t.branch)), l = r.filter((e) => e.merged && !e.reverted), u = r.filter((e) => e.merged && e.reverted), d = new Map(l.filter((e) => e.mergeCommitHash).map((e) => [e.mergeCommitHash, e])), f = c.map((e, t) => ({
18
18
  change: e,
19
19
  lane: t + 1,
20
20
  baseHash: e.baseHash,
@@ -34,7 +34,7 @@ function Bt(e, { nowMs: t }) {
34
34
  branch: i.branch,
35
35
  session: (i.sessionCount ?? 0) > 0,
36
36
  tip: !0,
37
- time: q(n.tipMs, t)
37
+ time: J(n.tipMs, t)
38
38
  });
39
39
  }
40
40
  };
@@ -53,13 +53,13 @@ function Bt(e, { nowMs: t }) {
53
53
  return t ? [t] : [];
54
54
  }),
55
55
  merged: c ? !0 : void 0,
56
- time: q(e.timeMs, t)
56
+ time: J(e.timeMs, t)
57
57
  });
58
58
  }), h(-Infinity);
59
59
  let g = u.map((e) => ({
60
60
  branch: e.branch,
61
61
  mergedAtMs: e.mergedAtMs ?? null,
62
- when: q(e.mergedAtMs, t)
62
+ when: J(e.mergedAtMs, t)
63
63
  })), _ = a.filter((e) => e.hasCommitBinding === !0 && !s.has(e.sessionId));
64
64
  return {
65
65
  commits: p,
@@ -70,33 +70,33 @@ function Bt(e, { nowMs: t }) {
70
70
  outsideWindowSessions: _
71
71
  };
72
72
  }
73
- function Vt(e) {
73
+ function Bt(e) {
74
74
  return e.tipCommitMs ?? Infinity;
75
75
  }
76
76
  //#endregion
77
77
  //#region src/ui/graph/Changes.jsx
78
- function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelectChange: i, onOpenMap: a, hasMore: o = !1, onShowOlder: s, onOpenSession: c, nowMs: l, headerActions: u }) {
79
- let d = l ?? Date.now(), { commits: f, reverted: p, unlinkedSessions: m, outsideWindowSessions: h, openCount: g, mergedCount: _ } = z(() => Bt(e, { nowMs: d }), [e, d]), v = e.defaultBranch, y = z(() => new Set(f.filter((e) => (e.sessionRefs?.length ?? 0) > 2).map((e) => e.id)), [f]), [b, x] = V([]);
80
- R(() => {
78
+ function Vt({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelectChange: i, onOpenMap: a, hasMore: o = !1, onShowOlder: s, onOpenSession: c, nowMs: l, headerActions: u }) {
79
+ let d = l ?? Date.now(), { commits: f, reverted: p, unlinkedSessions: m, outsideWindowSessions: h, openCount: g, mergedCount: _ } = B(() => zt(e, { nowMs: d }), [e, d]), v = e.defaultBranch, y = B(() => new Set(f.filter((e) => (e.sessionRefs?.length ?? 0) > 2).map((e) => e.id)), [f]), [b, x] = H([]);
80
+ z(() => {
81
81
  x((e) => {
82
82
  let t = e.filter((e) => y.has(e));
83
83
  return t.length === e.length ? e : t;
84
84
  });
85
85
  }, [y]);
86
- let S = L((e) => {
86
+ let S = R((e) => {
87
87
  y.has(e) && x((t) => {
88
88
  let n = new Set(t);
89
89
  return n.has(e) ? n.delete(e) : n.add(e), [...n];
90
90
  });
91
91
  }, [y]);
92
- return /* @__PURE__ */ U("div", {
92
+ return /* @__PURE__ */ W("div", {
93
93
  className: "gmp-root gmp-changes-root",
94
- children: [/* @__PURE__ */ U("div", {
94
+ children: [/* @__PURE__ */ W("div", {
95
95
  className: "gmp-changes-head",
96
- children: [/* @__PURE__ */ U("div", { children: [t && /* @__PURE__ */ U("span", {
96
+ children: [/* @__PURE__ */ W("div", { children: [t && /* @__PURE__ */ W("span", {
97
97
  className: "label",
98
98
  children: ["lines of work, ", t]
99
- }), /* @__PURE__ */ U("div", {
99
+ }), /* @__PURE__ */ W("div", {
100
100
  className: "gmp-changes-sub mono",
101
101
  children: [
102
102
  v ? `default branch ${v}, ` : "",
@@ -105,24 +105,24 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
105
105
  _,
106
106
  " merged"
107
107
  ]
108
- })] }), /* @__PURE__ */ U("div", {
108
+ })] }), /* @__PURE__ */ W("div", {
109
109
  className: "gmp-head-actions",
110
- children: [u, /* @__PURE__ */ U("button", {
110
+ children: [u, /* @__PURE__ */ W("button", {
111
111
  type: "button",
112
112
  className: "btn btn-secondary btn-sm",
113
113
  onClick: () => {
114
114
  r ? r({ type: "open-map" }) : a?.();
115
115
  },
116
- children: [/* @__PURE__ */ H(je, {
116
+ children: [/* @__PURE__ */ U(Ae, {
117
117
  size: 14,
118
118
  "aria-hidden": "true"
119
119
  }), " open the map"]
120
120
  })]
121
121
  })]
122
- }), /* @__PURE__ */ U("div", {
122
+ }), /* @__PURE__ */ W("div", {
123
123
  className: "gmp-changes-body",
124
124
  children: [
125
- /* @__PURE__ */ H(pe, {
125
+ /* @__PURE__ */ U(fe, {
126
126
  className: "gmp-cg",
127
127
  commits: f,
128
128
  selectedId: n,
@@ -135,16 +135,16 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
135
135
  expandedCommitSessions: b,
136
136
  onToggleCommitSessions: S
137
137
  }),
138
- m.length > 0 && /* @__PURE__ */ U("section", {
138
+ m.length > 0 && /* @__PURE__ */ W("section", {
139
139
  className: "gmp-unlinked-sessions",
140
140
  "aria-labelledby": "gmp-unlinked-sessions-heading",
141
- children: [/* @__PURE__ */ H("h2", {
141
+ children: [/* @__PURE__ */ U("h2", {
142
142
  id: "gmp-unlinked-sessions-heading",
143
143
  className: "sb-head gmp-unlinked-sessions-head",
144
144
  children: "sessions not linked to a commit"
145
- }), /* @__PURE__ */ H("div", {
145
+ }), /* @__PURE__ */ U("div", {
146
146
  className: "gmp-unlinked-sessions-list",
147
- children: m.map((e) => /* @__PURE__ */ U("button", {
147
+ children: m.map((e) => /* @__PURE__ */ W("button", {
148
148
  type: "button",
149
149
  className: "gmp-unlinked-session",
150
150
  onClick: () => {
@@ -154,20 +154,20 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
154
154
  source: { kind: "unlinked" }
155
155
  }) : c?.(e.sessionId);
156
156
  },
157
- children: [/* @__PURE__ */ H(ue, { harness: e.harness }), /* @__PURE__ */ H("span", { children: e.title || e.sessionId })]
157
+ children: [/* @__PURE__ */ U(le, { harness: e.harness }), /* @__PURE__ */ U("span", { children: e.title || e.sessionId })]
158
158
  }, e.sessionId))
159
159
  })]
160
160
  }),
161
- h.length > 0 && /* @__PURE__ */ U("section", {
161
+ h.length > 0 && /* @__PURE__ */ W("section", {
162
162
  className: "gmp-unlinked-sessions",
163
163
  "aria-labelledby": "gmp-outside-window-sessions-heading",
164
- children: [/* @__PURE__ */ H("h2", {
164
+ children: [/* @__PURE__ */ U("h2", {
165
165
  id: "gmp-outside-window-sessions-heading",
166
166
  className: "sb-head gmp-unlinked-sessions-head",
167
167
  children: "sessions linked outside this visible commit window"
168
- }), /* @__PURE__ */ H("div", {
168
+ }), /* @__PURE__ */ U("div", {
169
169
  className: "gmp-unlinked-sessions-list",
170
- children: h.map((e) => /* @__PURE__ */ U("button", {
170
+ children: h.map((e) => /* @__PURE__ */ W("button", {
171
171
  type: "button",
172
172
  className: "gmp-unlinked-session",
173
173
  onClick: () => {
@@ -177,18 +177,18 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
177
177
  source: { kind: "outside-window" }
178
178
  }) : c?.(e.sessionId);
179
179
  },
180
- children: [/* @__PURE__ */ H(ue, { harness: e.harness }), /* @__PURE__ */ H("span", { children: e.title || e.sessionId })]
180
+ children: [/* @__PURE__ */ U(le, { harness: e.harness }), /* @__PURE__ */ U("span", { children: e.title || e.sessionId })]
181
181
  }, e.sessionId))
182
182
  })]
183
183
  }),
184
- p.length > 0 && /* @__PURE__ */ U("div", {
184
+ p.length > 0 && /* @__PURE__ */ W("div", {
185
185
  className: "gmp-merged-sec",
186
- children: [/* @__PURE__ */ H("div", {
186
+ children: [/* @__PURE__ */ U("div", {
187
187
  className: "sb-head gmp-merged-head",
188
188
  children: "already merged in"
189
- }), /* @__PURE__ */ H("div", {
189
+ }), /* @__PURE__ */ U("div", {
190
190
  className: "gmp-merged-list",
191
- children: p.map((e) => /* @__PURE__ */ U("button", {
191
+ children: p.map((e) => /* @__PURE__ */ W("button", {
192
192
  type: "button",
193
193
  className: "gmp-merged-chip gmp-merged-revert",
194
194
  onClick: () => {
@@ -205,7 +205,7 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
205
205
  }) : i?.(t);
206
206
  },
207
207
  children: [
208
- /* @__PURE__ */ H(Be, {
208
+ /* @__PURE__ */ U(ze, {
209
209
  size: 14,
210
210
  "aria-hidden": "true"
211
211
  }),
@@ -217,23 +217,23 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
217
217
  }, e.branch))
218
218
  })]
219
219
  }),
220
- /* @__PURE__ */ U("div", {
220
+ /* @__PURE__ */ W("div", {
221
221
  className: "gmp-changes-legend",
222
222
  children: [
223
- /* @__PURE__ */ U("span", {
223
+ /* @__PURE__ */ W("span", {
224
224
  className: "gmp-legend-item",
225
- children: [/* @__PURE__ */ H("span", {
225
+ children: [/* @__PURE__ */ U("span", {
226
226
  className: "cg-dot cg-dot-filled",
227
227
  "aria-hidden": "true",
228
- children: /* @__PURE__ */ H(Ze, {
228
+ children: /* @__PURE__ */ U(Xe, {
229
229
  className: "cg-spark",
230
230
  "aria-hidden": "true"
231
231
  })
232
232
  }), " commit with a recorded session"]
233
233
  }),
234
- /* @__PURE__ */ U("span", {
234
+ /* @__PURE__ */ W("span", {
235
235
  className: "gmp-legend-item",
236
- children: [/* @__PURE__ */ H("span", {
236
+ children: [/* @__PURE__ */ U("span", {
237
237
  className: "cg-dot cg-dot-hollow",
238
238
  style: {
239
239
  width: 9,
@@ -242,7 +242,7 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
242
242
  "aria-hidden": "true"
243
243
  }), " no session captured"]
244
244
  }),
245
- /* @__PURE__ */ H("span", {
245
+ /* @__PURE__ */ U("span", {
246
246
  className: "gmp-legend-item gmp-legend-dim",
247
247
  children: "a star marks a recorded session, select a commit to open it"
248
248
  })
@@ -254,29 +254,29 @@ function Ht({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
254
254
  }
255
255
  //#endregion
256
256
  //#region src/ui/graph/ChangeDetail.jsx
257
- var Ut = {
257
+ var Ht = {
258
258
  M: "changed",
259
259
  A: "added",
260
260
  D: "deleted",
261
261
  R: "renamed"
262
- }, Wt = {
262
+ }, Ut = {
263
263
  A: "chip-ok",
264
264
  M: "",
265
265
  D: "chip-err",
266
266
  R: "chip-warn"
267
- }, Gt = {
267
+ }, Wt = {
268
268
  context: "ctx",
269
269
  add: "add",
270
270
  del: "del"
271
271
  };
272
- function Kt(e) {
272
+ function Gt(e) {
273
273
  let t = (e.split("/").pop() ?? e).replace(/[-_]+/g, " ").trim();
274
274
  return t.charAt(0).toUpperCase() + t.slice(1);
275
275
  }
276
- var qt = (e) => e >= 1e3 ? `≈${Oe(e)}` : Oe(e);
277
- function Jt(e) {
276
+ var Kt = (e) => e >= 1e3 ? `≈${De(e)}` : De(e);
277
+ function qt(e) {
278
278
  let t = e.oldStart, n = e.newStart, r = e.lines.map((e) => {
279
- let r = Gt[e.kind] ?? "ctx";
279
+ let r = Wt[e.kind] ?? "ctx";
280
280
  return r === "add" ? {
281
281
  type: r,
282
282
  newNo: n++,
@@ -297,99 +297,99 @@ function Jt(e) {
297
297
  lines: r
298
298
  };
299
299
  }
300
- function Yt({ file: t, diff: n, open: r, onToggle: i }) {
300
+ function Jt({ file: t, diff: n, open: r, onToggle: i }) {
301
301
  n && e(n);
302
302
  let a = t.status, o = n ? new Set(n.hunks.map((e) => e.sessionId).filter(Boolean)).size : null;
303
- return /* @__PURE__ */ U("div", {
303
+ return /* @__PURE__ */ W("div", {
304
304
  className: "gmp-file",
305
- children: [/* @__PURE__ */ U("button", {
305
+ children: [/* @__PURE__ */ W("button", {
306
306
  type: "button",
307
307
  className: "gmp-file-head",
308
308
  "aria-expanded": r,
309
309
  onClick: i,
310
310
  children: [
311
- H(r ? Ne : W, {
311
+ U(r ? Me : G, {
312
312
  size: 14,
313
313
  "aria-hidden": "true"
314
314
  }),
315
- /* @__PURE__ */ H("span", {
315
+ /* @__PURE__ */ U("span", {
316
316
  className: "mono gmp-file-path",
317
317
  children: t.path
318
318
  }),
319
- /* @__PURE__ */ H("span", {
320
- className: "chip gmp-file-status " + (Wt[a] ?? ""),
321
- children: Ut[a] ?? a
319
+ /* @__PURE__ */ U("span", {
320
+ className: "chip gmp-file-status " + (Ut[a] ?? ""),
321
+ children: Ht[a] ?? a
322
322
  }),
323
- o != null && o > 0 && /* @__PURE__ */ U("span", {
323
+ o != null && o > 0 && /* @__PURE__ */ W("span", {
324
324
  className: "gmp-file-convos metaitem",
325
325
  children: [
326
- /* @__PURE__ */ H(We, {
326
+ /* @__PURE__ */ U(Ue, {
327
327
  size: 14,
328
328
  "aria-hidden": "true"
329
329
  }),
330
330
  " ",
331
- /* @__PURE__ */ H("span", {
331
+ /* @__PURE__ */ U("span", {
332
332
  className: "tnum",
333
333
  children: o
334
334
  })
335
335
  ]
336
336
  })
337
337
  ]
338
- }), r && /* @__PURE__ */ H("div", {
338
+ }), r && /* @__PURE__ */ U("div", {
339
339
  className: "gmp-file-body",
340
- children: n ? n.error ? /* @__PURE__ */ H("p", {
340
+ children: n ? n.error ? /* @__PURE__ */ U("p", {
341
341
  className: "gmp-diff-state gmp-diff-error mono",
342
342
  children: n.error
343
- }) : n.binary ? /* @__PURE__ */ H("p", {
343
+ }) : n.binary ? /* @__PURE__ */ U("p", {
344
344
  className: "gmp-diff-state mono",
345
345
  children: "binary file — no textual diff."
346
- }) : n.hunks.length === 0 ? /* @__PURE__ */ H("p", {
346
+ }) : n.hunks.length === 0 ? /* @__PURE__ */ U("p", {
347
347
  className: "gmp-diff-state mono",
348
348
  children: "no line changes."
349
- }) : n.hunks.map((e, t) => /* @__PURE__ */ U("div", {
349
+ }) : n.hunks.map((e, t) => /* @__PURE__ */ W("div", {
350
350
  className: "gmp-hunk",
351
351
  children: [
352
- e.sessionTitle && /* @__PURE__ */ U("div", {
352
+ e.sessionTitle && /* @__PURE__ */ W("div", {
353
353
  className: "gmp-hunk-attrib",
354
354
  children: [
355
- /* @__PURE__ */ H(Fe, {
355
+ /* @__PURE__ */ U(Pe, {
356
356
  size: 14,
357
357
  "aria-hidden": "true"
358
358
  }),
359
- /* @__PURE__ */ H("span", {
359
+ /* @__PURE__ */ U("span", {
360
360
  className: "gmp-hunk-from",
361
361
  children: "from"
362
362
  }),
363
- /* @__PURE__ */ H("span", {
363
+ /* @__PURE__ */ U("span", {
364
364
  className: "gmp-hunk-link",
365
365
  children: e.sessionTitle
366
366
  }),
367
- e.sessionId && /* @__PURE__ */ H("span", {
367
+ e.sessionId && /* @__PURE__ */ U("span", {
368
368
  className: "mono gmp-hunk-hash",
369
369
  children: e.sessionId.slice(0, 7)
370
370
  })
371
371
  ]
372
372
  }),
373
- /* @__PURE__ */ H(_e, {
373
+ /* @__PURE__ */ U(ge, {
374
374
  file: "",
375
- hunks: [Jt(e)],
375
+ hunks: [qt(e)],
376
376
  className: "gmp-hunk-diff"
377
377
  }),
378
- n.truncated && t === n.hunks.length - 1 && /* @__PURE__ */ H("p", {
378
+ n.truncated && t === n.hunks.length - 1 && /* @__PURE__ */ U("p", {
379
379
  className: "gmp-diff-state mono",
380
380
  children: "diff truncated (file exceeds the size cap)."
381
381
  })
382
382
  ]
383
- }, t)) : /* @__PURE__ */ H("p", {
383
+ }, t)) : /* @__PURE__ */ U("p", {
384
384
  className: "gmp-diff-state mono",
385
385
  children: "loading diff…"
386
386
  })
387
387
  })]
388
388
  });
389
389
  }
390
- function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnotation: i, onRemoveAnnotation: a, onOpenMap: o, onShare: s, onCopyRecap: c, initialOpenFiles: l = {}, headerActions: u }) {
390
+ function Yt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnotation: i, onRemoveAnnotation: a, onOpenMap: o, onShare: s, onCopyRecap: c, initialOpenFiles: l = {}, headerActions: u }) {
391
391
  _(e);
392
- let [d, f] = V(l), [p, m] = V(null), [h, g] = V(!1), [v, y] = V(""), b = B({}), x = B(null), S = n ?? Kt(e.branch), C = e.work.length, w = e.newEdges.length, T = e.removedEdges.length, E = (e) => f((t) => ({
392
+ let [d, f] = H(l), [p, m] = H(null), [h, g] = H(!1), [v, y] = H(""), b = V({}), x = V(null), S = n ?? Gt(e.branch), C = e.work.length, w = e.newEdges.length, T = e.removedEdges.length, E = (e) => f((t) => ({
393
393
  ...t,
394
394
  [e]: !t[e]
395
395
  }));
@@ -415,51 +415,51 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
415
415
  t && i?.(t), g(!1), y("");
416
416
  }
417
417
  let k = e.files[0]?.path;
418
- return /* @__PURE__ */ U("div", {
418
+ return /* @__PURE__ */ W("div", {
419
419
  className: "gmp-root gmp-detail-root",
420
420
  ref: x,
421
421
  children: [
422
- /* @__PURE__ */ U("div", {
422
+ /* @__PURE__ */ W("div", {
423
423
  className: "gmp-detail-head",
424
424
  children: [
425
- /* @__PURE__ */ U("div", {
425
+ /* @__PURE__ */ W("div", {
426
426
  className: "gmp-head-row",
427
- children: [/* @__PURE__ */ U("div", {
427
+ children: [/* @__PURE__ */ W("div", {
428
428
  className: "crumb",
429
429
  children: [
430
430
  "review ",
431
- /* @__PURE__ */ H(W, {
431
+ /* @__PURE__ */ U(G, {
432
432
  size: 14,
433
433
  "aria-hidden": "true"
434
434
  }),
435
435
  " ",
436
436
  e.defaultBranch,
437
437
  " ",
438
- /* @__PURE__ */ H(W, {
438
+ /* @__PURE__ */ U(G, {
439
439
  size: 14,
440
440
  "aria-hidden": "true"
441
441
  }),
442
442
  " ",
443
- /* @__PURE__ */ H("span", {
443
+ /* @__PURE__ */ U("span", {
444
444
  className: "cur",
445
445
  children: e.branch
446
446
  })
447
447
  ]
448
- }), u ? /* @__PURE__ */ H("div", {
448
+ }), u ? /* @__PURE__ */ U("div", {
449
449
  className: "gmp-head-actions",
450
450
  children: u
451
451
  }) : null]
452
452
  }),
453
- /* @__PURE__ */ H("div", {
453
+ /* @__PURE__ */ U("div", {
454
454
  className: "gmp-detail-title",
455
455
  children: S
456
456
  }),
457
- /* @__PURE__ */ U("p", {
457
+ /* @__PURE__ */ W("p", {
458
458
  className: "gmp-caption",
459
459
  children: [
460
460
  "this line of work touched",
461
461
  " ",
462
- /* @__PURE__ */ U("button", {
462
+ /* @__PURE__ */ W("button", {
463
463
  type: "button",
464
464
  className: "gmp-frag" + (p === "files" ? " gmp-frag-on" : ""),
465
465
  onClick: () => D("files", k),
@@ -468,7 +468,7 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
468
468
  " ",
469
469
  "across",
470
470
  " ",
471
- /* @__PURE__ */ U("button", {
471
+ /* @__PURE__ */ W("button", {
472
472
  type: "button",
473
473
  className: "gmp-frag" + (p === "conversations" ? " gmp-frag-on" : ""),
474
474
  onClick: () => D("conversations"),
@@ -476,7 +476,7 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
476
476
  }),
477
477
  ", reshaping",
478
478
  " ",
479
- /* @__PURE__ */ U("button", {
479
+ /* @__PURE__ */ W("button", {
480
480
  type: "button",
481
481
  className: "gmp-frag" + (p === "conn" ? " gmp-frag-on" : ""),
482
482
  onClick: () => D("conn"),
@@ -491,30 +491,30 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
491
491
  "."
492
492
  ]
493
493
  }),
494
- /* @__PURE__ */ H("span", {
494
+ /* @__PURE__ */ U("span", {
495
495
  className: "gmp-caption-hint mono",
496
496
  children: "click any number to jump to its proof"
497
497
  })
498
498
  ]
499
499
  }),
500
- (e.frictions.length > 0 || e.violations.length > 0) && /* @__PURE__ */ U("div", {
500
+ (e.frictions.length > 0 || e.violations.length > 0) && /* @__PURE__ */ W("div", {
501
501
  className: "gmp-signals",
502
- children: [e.frictions.map((e, t) => /* @__PURE__ */ U("span", {
502
+ children: [e.frictions.map((e, t) => /* @__PURE__ */ W("span", {
503
503
  className: "gmp-signal",
504
504
  children: [
505
- /* @__PURE__ */ H(Je, {
505
+ /* @__PURE__ */ U(qe, {
506
506
  size: 14,
507
507
  "aria-hidden": "true"
508
508
  }),
509
509
  " ",
510
510
  e.label,
511
511
  ", ",
512
- /* @__PURE__ */ H("span", {
512
+ /* @__PURE__ */ U("span", {
513
513
  className: "mono",
514
514
  children: e.file
515
515
  }),
516
516
  " ",
517
- /* @__PURE__ */ U("b", {
517
+ /* @__PURE__ */ W("b", {
518
518
  className: "tnum",
519
519
  children: [e.count, "×"]
520
520
  }),
@@ -522,15 +522,15 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
522
522
  e.sessions,
523
523
  " conversations"
524
524
  ]
525
- }, t)), e.violations.length > 0 && /* @__PURE__ */ U("span", {
525
+ }, t)), e.violations.length > 0 && /* @__PURE__ */ W("span", {
526
526
  className: "gmp-signal gmp-signal-warn",
527
527
  children: [
528
- /* @__PURE__ */ H($e, {
528
+ /* @__PURE__ */ U(Qe, {
529
529
  size: 14,
530
530
  "aria-hidden": "true"
531
531
  }),
532
532
  " ",
533
- /* @__PURE__ */ H("b", {
533
+ /* @__PURE__ */ U("b", {
534
534
  className: "tnum",
535
535
  children: e.violations.length
536
536
  }),
@@ -538,13 +538,13 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
538
538
  ]
539
539
  })]
540
540
  }),
541
- /* @__PURE__ */ U("div", {
541
+ /* @__PURE__ */ W("div", {
542
542
  className: "gmp-totals",
543
543
  children: [
544
- /* @__PURE__ */ U("span", {
544
+ /* @__PURE__ */ W("span", {
545
545
  className: "metaitem tnum",
546
546
  children: [
547
- /* @__PURE__ */ H(Le, {
547
+ /* @__PURE__ */ U(Ie, {
548
548
  size: 14,
549
549
  "aria-hidden": "true"
550
550
  }),
@@ -553,58 +553,58 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
553
553
  " files touched"
554
554
  ]
555
555
  }),
556
- /* @__PURE__ */ U("span", {
556
+ /* @__PURE__ */ W("span", {
557
557
  className: "metaitem tnum",
558
558
  children: [
559
- /* @__PURE__ */ U("span", {
559
+ /* @__PURE__ */ W("span", {
560
560
  className: "gmp-add",
561
561
  children: ["+", w]
562
562
  }),
563
563
  "/",
564
- /* @__PURE__ */ U("span", {
564
+ /* @__PURE__ */ W("span", {
565
565
  className: "gmp-del",
566
566
  children: ["−", T]
567
567
  }),
568
568
  " connections"
569
569
  ]
570
570
  }),
571
- /* @__PURE__ */ U("span", {
571
+ /* @__PURE__ */ W("span", {
572
572
  className: "metaitem tnum",
573
573
  children: [
574
- /* @__PURE__ */ H(Ve, {
574
+ /* @__PURE__ */ U(Be, {
575
575
  size: 14,
576
576
  "aria-hidden": "true"
577
577
  }),
578
578
  " ai wrote ",
579
- qt(Number(e.outputTokens)),
579
+ Kt(Number(e.outputTokens)),
580
580
  " tokens"
581
581
  ]
582
582
  }),
583
- e.costUsd != null && /* @__PURE__ */ U("span", {
583
+ e.costUsd != null && /* @__PURE__ */ W("span", {
584
584
  className: "metaitem tnum",
585
585
  children: [
586
- /* @__PURE__ */ H(Pe, {
586
+ /* @__PURE__ */ U(Ne, {
587
587
  size: 14,
588
588
  "aria-hidden": "true"
589
589
  }),
590
590
  " est. spend ",
591
- De(e.costUsd)
591
+ Ee(e.costUsd)
592
592
  ]
593
593
  })
594
594
  ]
595
595
  }),
596
- /* @__PURE__ */ U("div", {
596
+ /* @__PURE__ */ W("div", {
597
597
  className: "gmp-detail-sec",
598
- children: [/* @__PURE__ */ H("div", {
598
+ children: [/* @__PURE__ */ U("div", {
599
599
  className: "sb-head gmp-detail-sechead",
600
600
  children: "files changed, click a path to open its diff"
601
- }), /* @__PURE__ */ H("div", {
601
+ }), /* @__PURE__ */ U("div", {
602
602
  className: "gmp-files",
603
- children: e.files.map((e) => /* @__PURE__ */ H("div", {
603
+ children: e.files.map((e) => /* @__PURE__ */ U("div", {
604
604
  ref: (t) => {
605
605
  b.current[e.path] = t;
606
606
  },
607
- children: /* @__PURE__ */ H(Yt, {
607
+ children: /* @__PURE__ */ U(Jt, {
608
608
  file: e,
609
609
  diff: d[e.path] ? t?.(e) : void 0,
610
610
  open: !!d[e.path],
@@ -613,42 +613,42 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
613
613
  }, e.path))
614
614
  })]
615
615
  }),
616
- /* @__PURE__ */ U("div", {
616
+ /* @__PURE__ */ W("div", {
617
617
  className: "gmp-detail-sec",
618
- children: [/* @__PURE__ */ H("div", {
618
+ children: [/* @__PURE__ */ U("div", {
619
619
  className: "sb-head gmp-detail-sechead",
620
620
  children: "your annotation"
621
- }), /* @__PURE__ */ U("div", {
621
+ }), /* @__PURE__ */ W("div", {
622
622
  className: "gmp-annot",
623
623
  children: [
624
- r && /* @__PURE__ */ U("span", {
624
+ r && /* @__PURE__ */ W("span", {
625
625
  className: "gmp-label-chip gmp-annot-chip",
626
626
  children: [
627
- /* @__PURE__ */ H(Qe, {
627
+ /* @__PURE__ */ U(Ze, {
628
628
  size: 14,
629
629
  "aria-hidden": "true"
630
630
  }),
631
631
  " ",
632
632
  r,
633
- /* @__PURE__ */ H("button", {
633
+ /* @__PURE__ */ U("button", {
634
634
  type: "button",
635
635
  className: "gmp-annot-x",
636
636
  "aria-label": "remove annotation",
637
637
  onClick: () => a?.(),
638
- children: /* @__PURE__ */ H(et, {
638
+ children: /* @__PURE__ */ U($e, {
639
639
  size: 14,
640
640
  "aria-hidden": "true"
641
641
  })
642
642
  })
643
643
  ]
644
644
  }),
645
- /* @__PURE__ */ U("button", {
645
+ /* @__PURE__ */ W("button", {
646
646
  type: "button",
647
647
  className: "gmp-annot-add",
648
648
  "aria-expanded": h,
649
649
  onClick: () => g((e) => !e),
650
650
  children: [
651
- /* @__PURE__ */ H(Qe, {
651
+ /* @__PURE__ */ U(Ze, {
652
652
  size: 14,
653
653
  "aria-hidden": "true"
654
654
  }),
@@ -656,15 +656,15 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
656
656
  r ? "change label" : "add a label"
657
657
  ]
658
658
  }),
659
- h && /* @__PURE__ */ U("form", {
659
+ h && /* @__PURE__ */ W("form", {
660
660
  className: "gmp-annot-pop",
661
661
  onSubmit: O,
662
662
  children: [
663
- /* @__PURE__ */ H("span", {
663
+ /* @__PURE__ */ U("span", {
664
664
  className: "label",
665
665
  children: "user.custom_label"
666
666
  }),
667
- /* @__PURE__ */ H("input", {
667
+ /* @__PURE__ */ U("input", {
668
668
  className: "input",
669
669
  type: "text",
670
670
  autoFocus: !0,
@@ -673,17 +673,17 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
673
673
  placeholder: "e.g. good handoff",
674
674
  "aria-label": "annotation value"
675
675
  }),
676
- /* @__PURE__ */ U("div", {
676
+ /* @__PURE__ */ W("div", {
677
677
  className: "gmp-annot-pop-foot",
678
- children: [/* @__PURE__ */ H("button", {
678
+ children: [/* @__PURE__ */ U("button", {
679
679
  type: "button",
680
680
  className: "btn btn-ghost btn-sm",
681
681
  onClick: () => g(!1),
682
682
  children: "cancel"
683
- }), /* @__PURE__ */ U("button", {
683
+ }), /* @__PURE__ */ W("button", {
684
684
  type: "submit",
685
685
  className: "btn btn-primary btn-sm",
686
- children: [/* @__PURE__ */ H(Me, {
686
+ children: [/* @__PURE__ */ U(je, {
687
687
  size: 14,
688
688
  "aria-hidden": "true"
689
689
  }), " save"]
@@ -694,24 +694,24 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
694
694
  ]
695
695
  })]
696
696
  }),
697
- /* @__PURE__ */ U("div", {
697
+ /* @__PURE__ */ W("div", {
698
698
  className: "gmp-exits",
699
699
  children: [
700
- /* @__PURE__ */ U("button", {
700
+ /* @__PURE__ */ W("button", {
701
701
  type: "button",
702
702
  className: "btn btn-secondary btn-sm",
703
703
  onClick: () => o?.(),
704
- children: [/* @__PURE__ */ H(je, {
704
+ children: [/* @__PURE__ */ U(Ae, {
705
705
  size: 14,
706
706
  "aria-hidden": "true"
707
707
  }), " see this work on the code map"]
708
708
  }),
709
- /* @__PURE__ */ U("button", {
709
+ /* @__PURE__ */ W("button", {
710
710
  type: "button",
711
711
  className: "btn btn-secondary btn-sm",
712
712
  onClick: () => s?.(),
713
713
  children: [
714
- /* @__PURE__ */ H(Xe, {
714
+ /* @__PURE__ */ U(Ye, {
715
715
  size: 14,
716
716
  "aria-hidden": "true"
717
717
  }),
@@ -720,16 +720,16 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
720
720
  " conversations…"
721
721
  ]
722
722
  }),
723
- /* @__PURE__ */ U("button", {
723
+ /* @__PURE__ */ W("button", {
724
724
  type: "button",
725
725
  className: "btn btn-secondary btn-sm",
726
726
  onClick: () => c?.(),
727
- children: [/* @__PURE__ */ H(Re, {
727
+ children: [/* @__PURE__ */ U(Le, {
728
728
  size: 14,
729
729
  "aria-hidden": "true"
730
730
  }), " copy recap"]
731
731
  }),
732
- /* @__PURE__ */ U("code", {
732
+ /* @__PURE__ */ W("code", {
733
733
  className: "gmp-gitdiff mono",
734
734
  children: [
735
735
  "git diff ",
@@ -740,7 +740,7 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
740
740
  })
741
741
  ]
742
742
  }),
743
- /* @__PURE__ */ H("p", {
743
+ /* @__PURE__ */ U("p", {
744
744
  className: "gmp-boundary mono",
745
745
  children: "shows what changed and the recorded work behind it, not whether the change is correct or secure."
746
746
  })
@@ -749,31 +749,31 @@ function Xt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
749
749
  }
750
750
  //#endregion
751
751
  //#region src/ui/graph/CodeMap.jsx
752
- var Zt = Object.freeze({
752
+ var Xt = Object.freeze({
753
753
  project: "overview",
754
754
  package: "folders",
755
755
  file: "files"
756
- }), Qt = Object.freeze({
756
+ }), Zt = Object.freeze({
757
757
  overview: "project",
758
758
  folders: "package",
759
759
  files: "file"
760
760
  });
761
- function $t({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 520, ariaLabel: u = "code map", className: d = "", viewport: f, onViewportChange: p, state: m, onStateChange: h }) {
762
- let g = z(() => {
761
+ function Qt({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 520, ariaLabel: u = "code map", className: d = "", viewport: f, onViewportChange: p, state: m, onStateChange: h }) {
762
+ let g = B(() => {
763
763
  let t = /* @__PURE__ */ new Map();
764
764
  for (let n of e?.nodes ?? []) t.set(n.id, n);
765
765
  return t;
766
- }, [e?.nodes]), _ = z(() => m === void 0 ? null : A(m), [m]), v = z(() => _ ? Se(e, _) : null, [e, _]), y = z(() => en(e && {
766
+ }, [e?.nodes]), _ = B(() => m === void 0 ? null : A(m), [m]), v = B(() => _ ? xe(e, _) : null, [e, _]), y = B(() => $t(e && {
767
767
  ...e,
768
768
  nodes: v?.canvas.allNodes ?? e.nodes
769
- }), [e, v?.canvas.allNodes]), b = v ? Zt[v.canvas.grain] ?? "folders" : Zt[t?.level ?? "package"], x = v?.canvas.expandedIds ?? t?.expanded, S = B(b);
769
+ }), [e, v?.canvas.allNodes]), b = v ? Xt[v.canvas.grain] ?? "folders" : Xt[t?.level ?? "package"], x = v?.canvas.expandedIds ?? t?.expanded, S = V(b);
770
770
  S.current = b;
771
771
  function C(e) {
772
772
  if (!_) return;
773
- let t = be(_, e);
774
- Ce(_, t) || h?.(t);
773
+ let t = ye(_, e);
774
+ Se(_, t) || h?.(t);
775
775
  }
776
- return /* @__PURE__ */ H(F, {
776
+ return /* @__PURE__ */ U(F, {
777
777
  data: y,
778
778
  grain: b,
779
779
  expandedIds: x,
@@ -789,13 +789,13 @@ function $t({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
789
789
  onExpand: a,
790
790
  onGrainChange: (e) => {
791
791
  S.current = e, n?.({
792
- level: Qt[e] ?? "package",
792
+ level: Zt[e] ?? "package",
793
793
  expanded: []
794
794
  });
795
795
  },
796
796
  onExpandedIdsChange: (e) => {
797
797
  n?.({
798
- level: Qt[S.current] ?? "package",
798
+ level: Zt[S.current] ?? "package",
799
799
  expanded: e
800
800
  });
801
801
  },
@@ -810,16 +810,16 @@ function $t({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
810
810
  canonicalControlled: _ !== null
811
811
  });
812
812
  }
813
- function en(e) {
813
+ function $t(e) {
814
814
  e && N(e);
815
- let t = e?.nodes ?? [], n = nn(e?.violations ?? []);
815
+ let t = e?.nodes ?? [], n = tn(e?.violations ?? []);
816
816
  return {
817
817
  nodes: t.map((e) => ({
818
818
  id: e.id,
819
819
  label: e.name || e.id,
820
820
  kind: e.kind === "file" ? "file" : "folder",
821
821
  loc: e.loc ?? 0,
822
- coverage: tn(e.recordedFiles, e.totalFiles),
822
+ coverage: en(e.recordedFiles, e.totalFiles),
823
823
  parent: e.parent || void 0,
824
824
  violations: n.get(e.id) ?? 0,
825
825
  layer: e.layer,
@@ -833,90 +833,113 @@ function en(e) {
833
833
  }))
834
834
  };
835
835
  }
836
- function tn(e, t) {
836
+ function en(e, t) {
837
837
  let n = Number(t) || 0;
838
838
  if (n <= 0) return 0;
839
839
  let r = Math.max(0, Math.min(1, (Number(e) || 0) / n));
840
840
  return Math.max(0, Math.min(4, Math.round(r * 4)));
841
841
  }
842
- function nn(e) {
842
+ function tn(e) {
843
843
  let t = /* @__PURE__ */ new Map();
844
- for (let n of e) rn(t, n.from), rn(t, n.to);
844
+ for (let n of e) nn(t, n.from), nn(t, n.to);
845
845
  return t;
846
846
  }
847
- function rn(e, t) {
847
+ function nn(e, t) {
848
848
  t && e.set(t, (e.get(t) ?? 0) + 1);
849
849
  }
850
850
  //#endregion
851
851
  //#region src/ui/graph/CodeMapNavigator.jsx
852
- function an({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsChange: r, selectedId: i = null, onSelect: a, focusedId: o, onFocusChange: s, filter: c = "", onFilterChange: l, onOpenMap: u, onStateAction: d, ariaLabel: f = "code map navigator", lineCounts: p = "measured" }) {
853
- let [m, h] = V(() => /* @__PURE__ */ new Set()), [g, _] = V(null), v = n === void 0 ? m : new Set(n), y = o === void 0 ? g : o, b = B(/* @__PURE__ */ new Map()), x = z(() => Se(e, A({
852
+ function rn({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsChange: r, selectedId: i = null, onSelect: a, focusedId: o, onFocusChange: s, filter: c = "", onFilterChange: l, onOpenMap: u, onStateAction: d, ariaLabel: f = "code map navigator", lineCounts: p = "measured" }) {
853
+ let [m, h] = H(() => /* @__PURE__ */ new Set()), [g, _] = H(null), [v, y] = H(() => /* @__PURE__ */ new Set()), b = n === void 0 ? m : new Set(n), x = o === void 0 ? g : o, S = V(/* @__PURE__ */ new Map()), C = B(() => xe(e, A({
854
854
  grain: t,
855
- expandedIds: Array.from(v),
855
+ expandedIds: Array.from(b),
856
856
  selectedId: i,
857
- navigatorFocusedId: y,
857
+ navigatorFocusedId: x,
858
858
  navigatorFilter: c
859
859
  })), [
860
860
  e,
861
861
  t,
862
- sn(v),
862
+ on(b),
863
863
  i,
864
- y,
864
+ x,
865
865
  c
866
- ]), S = x.rows, C = x.focusedId, w = x.selected, T = w ? S.find((e) => e.node.id === w.id) : null, E = !!T?.canExpand && !T.forcedOpen;
867
- function D(e) {
866
+ ]), w = c.trim() !== "", T = B(() => {
867
+ if (w || v.size === 0) return C.rows;
868
+ let e = [], t = null;
869
+ for (let n of C.rows) {
870
+ if (t !== null && n.depth > t) continue;
871
+ t = null;
872
+ let r = n.openByGrain && v.has(n.node.id);
873
+ e.push(r ? {
874
+ ...n,
875
+ expanded: !1
876
+ } : n), r && (t = n.depth);
877
+ }
878
+ return e;
879
+ }, [
880
+ C.rows,
881
+ v,
882
+ w
883
+ ]), E = T.some((e) => e.node.id === C.focusedId) ? C.focusedId : T[0]?.node.id ?? null, D = C.selected, O = D ? T.find((e) => e.node.id === D.id) : null, k = (e) => !w && e.hasChildren, j = !!O && k(O);
884
+ function M(e) {
868
885
  n === void 0 && h(e), d?.({
869
886
  type: "set-expanded",
870
887
  ids: Array.from(e)
871
888
  }), r?.(Array.from(e));
872
889
  }
873
- function O(e) {
874
- let t = new Set(v);
875
- t.has(e) ? t.delete(e) : t.add(e), D(t);
890
+ function N(e) {
891
+ let t = new Set(b);
892
+ t.has(e) ? t.delete(e) : t.add(e), M(t);
893
+ }
894
+ function P(e) {
895
+ e.openByGrain && !w ? y((t) => {
896
+ let n = new Set(t);
897
+ return n.has(e.node.id) ? n.delete(e.node.id) : n.add(e.node.id), n;
898
+ }) : N(e.node.id);
876
899
  }
877
- function k(e) {
900
+ function F(e) {
878
901
  o === void 0 && _(e), d?.({
879
902
  type: "focus",
880
903
  id: e
881
- }), s?.(e), b.current.get(e)?.focus();
904
+ }), s?.(e), S.current.get(e)?.focus();
882
905
  }
883
- function j(e) {
884
- o === void 0 && _(e.id), b.current.get(e.id)?.focus(), d?.({
906
+ function I(e) {
907
+ o === void 0 && _(e.id), S.current.get(e.id)?.focus(), d?.({
885
908
  type: "select",
886
909
  id: e.id
887
910
  }), s?.(e.id), a?.(e.id, e);
888
911
  }
889
- function M(e, t) {
890
- let n = S[t];
912
+ function L(e, t) {
913
+ let n = T[t];
891
914
  if (!n) return;
892
915
  let { node: r } = n, i = null;
893
- if (e.key === "ArrowDown") i = S[Math.min(t + 1, S.length - 1)]?.node.id;
894
- else if (e.key === "ArrowUp") i = S[Math.max(t - 1, 0)]?.node.id;
895
- else if (e.key === "Home") i = S[0]?.node.id;
896
- else if (e.key === "End") i = S[S.length - 1]?.node.id;
897
- else if (e.key === "ArrowRight" && (n.canExpand || n.forcedOpen)) n.forcedOpen || n.expanded ? i = n.childIds[0] ?? null : v.has(r.id) || O(r.id);
898
- else if (e.key === "ArrowLeft") !n.forcedOpen && n.canExpand && n.expanded ? O(r.id) : i = n.parentId;
916
+ if (e.key === "ArrowDown") i = T[Math.min(t + 1, T.length - 1)]?.node.id;
917
+ else if (e.key === "ArrowUp") i = T[Math.max(t - 1, 0)]?.node.id;
918
+ else if (e.key === "Home") i = T[0]?.node.id;
919
+ else if (e.key === "End") i = T[T.length - 1]?.node.id;
920
+ else if (e.key === "ArrowRight" && (n.forcedOpen || k(n))) n.expanded ? i = n.childIds[0] ?? null : P(n);
921
+ else if (e.key === "ArrowLeft") k(n) && n.expanded ? P(n) : i = n.parentId;
899
922
  else if (e.key === "Enter" || e.key === " ") {
900
- j(r), e.preventDefault();
923
+ I(r), e.preventDefault();
901
924
  return;
902
925
  } else return;
903
- e.preventDefault(), i && k(i);
926
+ e.preventDefault(), i && F(i);
904
927
  }
905
- return /* @__PURE__ */ U("section", {
928
+ return /* @__PURE__ */ W("section", {
906
929
  className: "gmp-navigator",
907
930
  "aria-label": f,
908
931
  children: [
909
- /* @__PURE__ */ H("header", {
932
+ /* @__PURE__ */ U("header", {
910
933
  className: "gmp-navigator-head",
911
- children: /* @__PURE__ */ U("label", {
934
+ children: /* @__PURE__ */ W("label", {
912
935
  className: "gmp-navigator-search",
913
936
  children: [
914
- /* @__PURE__ */ H(Ye, { "aria-hidden": "true" }),
915
- /* @__PURE__ */ H("span", {
937
+ /* @__PURE__ */ U(Je, { "aria-hidden": "true" }),
938
+ /* @__PURE__ */ U("span", {
916
939
  className: "gmp-sr",
917
940
  children: "filter code areas"
918
941
  }),
919
- /* @__PURE__ */ H("input", {
942
+ /* @__PURE__ */ U("input", {
920
943
  value: c,
921
944
  onChange: (e) => {
922
945
  d?.({
@@ -929,13 +952,13 @@ function an({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
929
952
  ]
930
953
  })
931
954
  }),
932
- x.staleSelectedId ? /* @__PURE__ */ U("p", {
955
+ C.staleSelectedId ? /* @__PURE__ */ W("p", {
933
956
  className: "gmp-navigator-missing",
934
957
  role: "status",
935
958
  children: [
936
959
  "the selected code area is not present in this map.",
937
960
  " ",
938
- /* @__PURE__ */ H("button", {
961
+ /* @__PURE__ */ U("button", {
939
962
  type: "button",
940
963
  onClick: () => {
941
964
  d?.({ type: "clear-selection" }), a?.(null, null);
@@ -944,69 +967,67 @@ function an({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
944
967
  })
945
968
  ]
946
969
  }) : null,
947
- /* @__PURE__ */ U("div", {
970
+ /* @__PURE__ */ W("div", {
948
971
  className: "gmp-navigator-body",
949
- children: [/* @__PURE__ */ H("div", {
950
- role: S.length ? "tree" : void 0,
972
+ children: [/* @__PURE__ */ U("div", {
973
+ role: T.length ? "tree" : void 0,
951
974
  "aria-label": "code areas",
952
975
  className: "gmp-navigator-tree",
953
976
  "data-grain": t,
954
- children: S.length === 0 ? /* @__PURE__ */ H("p", {
977
+ children: T.length === 0 ? /* @__PURE__ */ U("p", {
955
978
  className: "gmp-navigator-empty",
956
979
  role: "status",
957
980
  children: "no code areas match this filter"
958
- }) : S.map((e, t) => {
959
- let n = e.canExpand || e.forcedOpen, r = e.expanded, a = C === e.node.id;
960
- return /* @__PURE__ */ H(on, {
981
+ }) : T.map((e, t) => {
982
+ let n = k(e), r = e.expanded, a = E === e.node.id;
983
+ return /* @__PURE__ */ U(an, {
961
984
  row: e,
962
- hasChildren: n,
985
+ hasDisclosure: n,
963
986
  isExpanded: r,
964
987
  selected: i === e.node.id,
965
988
  tabbable: a,
966
989
  setRef: (t) => {
967
- t ? b.current.set(e.node.id, t) : b.current.delete(e.node.id);
990
+ t ? S.current.set(e.node.id, t) : S.current.delete(e.node.id);
968
991
  },
969
992
  onFocus: () => {
970
993
  o === void 0 && _(e.node.id);
971
994
  },
972
- onSelect: () => j(e.node),
973
- onToggle: () => {
974
- e.forcedOpen || O(e.node.id);
975
- },
976
- onKeyDown: (e) => M(e, t),
995
+ onSelect: () => I(e.node),
996
+ onToggle: () => P(e),
997
+ onKeyDown: (e) => L(e, t),
977
998
  lineCounts: p
978
999
  }, e.node.id);
979
1000
  })
980
- }), /* @__PURE__ */ H("aside", {
1001
+ }), /* @__PURE__ */ U("aside", {
981
1002
  className: "gmp-navigator-actions",
982
1003
  "aria-label": "selected code area",
983
- children: w ? /* @__PURE__ */ U(Ae, { children: [
984
- /* @__PURE__ */ H("p", {
1004
+ children: D ? /* @__PURE__ */ W(ke, { children: [
1005
+ /* @__PURE__ */ U("p", {
985
1006
  className: "gmp-navigator-selected",
986
- children: w.name || w.id
1007
+ children: D.name || D.id
987
1008
  }),
988
- /* @__PURE__ */ H("p", {
1009
+ /* @__PURE__ */ U("p", {
989
1010
  className: "gmp-navigator-selected-path",
990
- children: w.id
1011
+ children: D.id
991
1012
  }),
992
- E ? /* @__PURE__ */ U("button", {
1013
+ j ? /* @__PURE__ */ W("button", {
993
1014
  type: "button",
994
1015
  className: "gmp-navigator-action",
995
- onClick: () => O(w.id),
996
- children: [/* @__PURE__ */ H(W, { "aria-hidden": "true" }), v.has(w.id) ? "hide children" : "show children"]
1016
+ onClick: () => P(O),
1017
+ children: [/* @__PURE__ */ U(G, { "aria-hidden": "true" }), O.expanded ? "hide children" : "show children"]
997
1018
  }) : null,
998
- /* @__PURE__ */ U("button", {
1019
+ /* @__PURE__ */ W("button", {
999
1020
  type: "button",
1000
1021
  className: "gmp-navigator-action gmp-navigator-action--primary",
1001
1022
  onClick: () => {
1002
1023
  d?.({
1003
1024
  type: "open-in-map",
1004
- id: w.id
1005
- }), u?.(w.id);
1025
+ id: D.id
1026
+ }), u?.(D.id);
1006
1027
  },
1007
- children: [/* @__PURE__ */ H(He, { "aria-hidden": "true" }), " open in map"]
1028
+ children: [/* @__PURE__ */ U(Ve, { "aria-hidden": "true" }), " open in map"]
1008
1029
  })
1009
- ] }) : /* @__PURE__ */ H("p", {
1030
+ ] }) : /* @__PURE__ */ U("p", {
1010
1031
  className: "gmp-navigator-empty",
1011
1032
  children: "select an area to see its recorded work and map context"
1012
1033
  })
@@ -1015,107 +1036,106 @@ function an({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
1015
1036
  ]
1016
1037
  });
1017
1038
  }
1018
- function on({ row: e, hasChildren: t, isExpanded: n, selected: r, tabbable: i, setRef: a, onFocus: o, onSelect: s, onToggle: c, onKeyDown: l, lineCounts: u }) {
1019
- return /* @__PURE__ */ U("div", {
1039
+ function an({ row: e, hasDisclosure: t, isExpanded: n, selected: r, tabbable: i, setRef: a, onFocus: o, onSelect: s, onToggle: c, onKeyDown: l, lineCounts: u }) {
1040
+ return /* @__PURE__ */ W("div", {
1020
1041
  role: "none",
1021
1042
  className: "gmp-navigator-row-wrap",
1022
1043
  "data-selected": r,
1023
1044
  style: { "--gmp-tree-depth": e.depth },
1024
- children: [t ? /* @__PURE__ */ H("button", {
1045
+ children: [t ? /* @__PURE__ */ U("button", {
1025
1046
  type: "button",
1026
1047
  className: "gmp-navigator-disclosure",
1027
1048
  tabIndex: -1,
1028
1049
  "aria-hidden": "true",
1029
1050
  "aria-label": `${n ? "hide" : "show"} children for ${e.node.name || e.node.id}`,
1030
1051
  "aria-expanded": n,
1031
- "aria-disabled": e.forcedOpen ? "true" : void 0,
1032
1052
  onKeyDown: (e) => e.stopPropagation(),
1033
- onClick: (t) => {
1034
- t.stopPropagation(), e.forcedOpen || c();
1053
+ onClick: (e) => {
1054
+ e.stopPropagation(), c();
1035
1055
  },
1036
- children: /* @__PURE__ */ H(W, {
1056
+ children: /* @__PURE__ */ U(G, {
1037
1057
  className: "gmp-navigator-chevron",
1038
1058
  "aria-hidden": "true"
1039
1059
  })
1040
- }) : /* @__PURE__ */ H("span", {
1060
+ }) : /* @__PURE__ */ U("span", {
1041
1061
  className: "gmp-navigator-disclosure-placeholder",
1042
1062
  "aria-hidden": "true"
1043
- }), /* @__PURE__ */ U("div", {
1063
+ }), /* @__PURE__ */ W("div", {
1044
1064
  ref: a,
1045
1065
  role: "treeitem",
1046
1066
  "aria-level": e.depth + 1,
1047
1067
  "aria-selected": r,
1048
- "aria-expanded": t ? n : void 0,
1068
+ "aria-expanded": t || e.forcedOpen ? n : void 0,
1049
1069
  tabIndex: i ? 0 : -1,
1050
1070
  className: "gmp-navigator-row",
1051
1071
  onFocus: o,
1052
1072
  onClick: s,
1053
1073
  onDoubleClick: () => {
1054
- t && !e.forcedOpen && c();
1074
+ t && c();
1055
1075
  },
1056
1076
  onKeyDown: l,
1057
1077
  children: [
1058
- e.node.kind === "file" ? /* @__PURE__ */ H(Ie, { "aria-hidden": "true" }) : /* @__PURE__ */ H(ze, { "aria-hidden": "true" }),
1059
- /* @__PURE__ */ H("span", {
1078
+ e.node.kind === "file" ? /* @__PURE__ */ U(Fe, { "aria-hidden": "true" }) : /* @__PURE__ */ U(Re, { "aria-hidden": "true" }),
1079
+ /* @__PURE__ */ U("span", {
1060
1080
  className: "gmp-navigator-path",
1061
1081
  children: e.node.name || e.node.id
1062
1082
  }),
1063
- /* @__PURE__ */ U("span", {
1083
+ /* @__PURE__ */ W("span", {
1064
1084
  className: "gmp-navigator-meta",
1065
- children: [u === "unknown" ? null : /* @__PURE__ */ U("span", { children: [cn(e.node.loc ?? 0), " lines"] }), /* @__PURE__ */ H("span", { children: ln(e.node.recordedFiles, e.node.totalFiles) })]
1085
+ children: [u === "unknown" ? null : /* @__PURE__ */ W("span", { children: [sn(e.node.loc ?? 0), " lines"] }), /* @__PURE__ */ U("span", { children: cn(e.node.recordedFiles, e.node.totalFiles) })]
1066
1086
  })
1067
1087
  ]
1068
1088
  })]
1069
1089
  });
1070
1090
  }
1071
- function sn(e) {
1091
+ function on(e) {
1072
1092
  return Array.from(e).sort().join("\0");
1073
1093
  }
1074
- function cn(e) {
1075
- return Oe(Number(e) || 0);
1094
+ function sn(e) {
1095
+ return De(Number(e) || 0);
1076
1096
  }
1077
- function ln(e, t) {
1097
+ function cn(e, t) {
1078
1098
  let n = Number(t) || 0;
1079
1099
  return n <= 0 ? "no coverage data" : `${Math.round((Number(e) || 0) / n * 100)}% recorded`;
1080
1100
  }
1081
1101
  //#endregion
1082
1102
  //#region src/ui/graph/CodeMapComposition.jsx
1083
- function un({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 480, ariaLabel: u = "code map", canvasSlot: d, rail: f, toolbar: p, sheetTitle: m = "code area", sheetMeta: h, railSide: g = "right", legend: _, canvasWrapperClassName: v = "", canvasWrapperStyle: y, className: b = "", presentation: x = "canvas", navigatorSlot: S, onPresentationChange: C, viewport: w, onViewportChange: T, state: E, defaultState: D, onStateChange: O, lineCounts: k = "measured" }) {
1084
- let j = E !== void 0 || D !== void 0, [M, N] = V(() => A(D)), P = z(() => j ? A(E ?? M) : null, [
1103
+ function ln({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 480, ariaLabel: u = "code map", canvasSlot: d, rail: f, toolbar: p, sheetTitle: m = "code area", sheetMeta: h, railSide: g = "right", legend: _, canvasWrapperClassName: v = "", canvasWrapperStyle: y, className: b = "", presentation: x = "canvas", navigatorSlot: S, onPresentationChange: C, viewport: w, onViewportChange: T, state: E, defaultState: D, onStateChange: O, lineCounts: k = "measured" }) {
1104
+ let j = E !== void 0 || D !== void 0, [M, N] = H(() => A(D)), P = B(() => j ? A(E ?? M) : null, [
1085
1105
  j,
1086
1106
  E,
1087
1107
  M
1088
1108
  ]), F = P?.presentation ?? x;
1089
- function ee(e, t) {
1109
+ function I(e, t) {
1090
1110
  E === void 0 && N(e), O?.(e), t?.(e);
1091
1111
  }
1092
- function I(e, t) {
1112
+ function L(e, t) {
1093
1113
  if (!P) return;
1094
- let n = be(P, e);
1095
- Ce(P, n) || ee(n, t);
1114
+ let n = ye(P, e);
1115
+ Se(P, n) || I(n, t);
1096
1116
  }
1097
- let te = j || C ? /* @__PURE__ */ U(Ae, { children: [/* @__PURE__ */ U("div", {
1117
+ let ee = j || C ? /* @__PURE__ */ W(ke, { children: [/* @__PURE__ */ W("div", {
1098
1118
  className: "gmp-presentation-switch",
1099
1119
  role: "group",
1100
1120
  "aria-label": "code map view",
1101
- children: [/* @__PURE__ */ H("button", {
1121
+ children: [/* @__PURE__ */ U("button", {
1102
1122
  type: "button",
1103
1123
  "aria-pressed": F === "navigator",
1104
- onClick: () => j ? I({
1124
+ onClick: () => j ? L({
1105
1125
  type: "set-presentation",
1106
1126
  presentation: "navigator"
1107
1127
  }, () => C?.("navigator")) : C?.("navigator"),
1108
1128
  children: F === "canvas" ? "back to browse" : "browse"
1109
- }), /* @__PURE__ */ H("button", {
1129
+ }), /* @__PURE__ */ U("button", {
1110
1130
  type: "button",
1111
1131
  "aria-pressed": F === "canvas",
1112
- onClick: () => j ? I({
1132
+ onClick: () => j ? L({
1113
1133
  type: "set-presentation",
1114
1134
  presentation: "canvas"
1115
1135
  }, () => C?.("canvas")) : C?.("canvas"),
1116
1136
  children: "spatial map"
1117
1137
  })]
1118
- }), p] }) : p, ne = d ?? /* @__PURE__ */ H($t, {
1138
+ }), p] }) : p, te = d ?? /* @__PURE__ */ U(Qt, {
1119
1139
  payload: e,
1120
1140
  zoom: P ? {
1121
1141
  level: P.grain,
@@ -1133,8 +1153,8 @@ function un({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
1133
1153
  viewport: P ? P.viewport ?? void 0 : w,
1134
1154
  onViewportChange: T,
1135
1155
  state: P ?? void 0,
1136
- onStateChange: P ? (e) => ee(e) : void 0
1137
- }), re = S ?? (P && e ? /* @__PURE__ */ H(an, {
1156
+ onStateChange: P ? (e) => I(e) : void 0
1157
+ }), ne = S ?? (P && e ? /* @__PURE__ */ U(rn, {
1138
1158
  payload: e,
1139
1159
  lineCounts: k,
1140
1160
  grain: P.grain,
@@ -1142,65 +1162,65 @@ function un({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
1142
1162
  selectedId: P.selectedId,
1143
1163
  focusedId: P.navigatorFocusedId,
1144
1164
  filter: P.navigatorFilter,
1145
- onStateAction: (t) => I(t, () => {
1165
+ onStateAction: (t) => L(t, () => {
1146
1166
  t.type === "select" ? i?.(t.id, e.nodes.find((e) => e.id === t.id) ?? null) : t.type === "clear-selection" ? i?.(null, null) : t.type === "set-expanded" ? n?.({
1147
1167
  level: P.grain,
1148
1168
  expanded: Array.from(t.ids)
1149
1169
  }) : t.type === "open-in-map" && (i?.(t.id, e.nodes.find((e) => e.id === t.id) ?? null), C?.("canvas"));
1150
1170
  }),
1151
1171
  ariaLabel: `browse ${u}`
1152
- }) : null), ie = F === "navigator" && re !== null;
1153
- return /* @__PURE__ */ H("div", {
1172
+ }) : null), re = F === "navigator" && ne !== null;
1173
+ return /* @__PURE__ */ U("div", {
1154
1174
  className: ["gmp-root", b].filter(Boolean).join(" "),
1155
- children: /* @__PURE__ */ U(oe, {
1156
- toolbar: te,
1175
+ children: /* @__PURE__ */ W(ae, {
1176
+ toolbar: ee,
1157
1177
  rail: f,
1158
1178
  sheetTitle: m,
1159
1179
  sheetMeta: h,
1160
1180
  railSide: g,
1161
- children: [/* @__PURE__ */ H("div", {
1181
+ children: [/* @__PURE__ */ U("div", {
1162
1182
  className: ["gmp-map-canvas-region", v].filter(Boolean).join(" "),
1163
1183
  style: y,
1164
1184
  "data-testid": "gmp-map-canvas-region",
1165
- children: ie ? re : ne
1166
- }), !ie && _ !== !1 && (_ ?? /* @__PURE__ */ H(dn, {}))]
1185
+ children: re ? ne : te
1186
+ }), !re && _ !== !1 && (_ ?? /* @__PURE__ */ U(un, {}))]
1167
1187
  })
1168
1188
  });
1169
1189
  }
1170
- function dn() {
1171
- return /* @__PURE__ */ U("p", {
1190
+ function un() {
1191
+ return /* @__PURE__ */ W("p", {
1172
1192
  className: "gmp-map-legend",
1173
1193
  children: [
1174
- /* @__PURE__ */ U("span", {
1194
+ /* @__PURE__ */ W("span", {
1175
1195
  className: "gmp-legend-item",
1176
- children: [/* @__PURE__ */ H("span", {
1196
+ children: [/* @__PURE__ */ U("span", {
1177
1197
  className: "gmp-map-swatch",
1178
1198
  "aria-hidden": "true"
1179
1199
  }), " code area (folder or file)"]
1180
1200
  }),
1181
- /* @__PURE__ */ U("span", {
1201
+ /* @__PURE__ */ W("span", {
1182
1202
  className: "gmp-legend-item gmp-legend-dim",
1183
- children: [/* @__PURE__ */ H("span", {
1203
+ children: [/* @__PURE__ */ U("span", {
1184
1204
  className: "gmp-map-swatch gmp-map-swatch--empty",
1185
1205
  "aria-hidden": "true"
1186
1206
  }), " no saved conversation behind it"]
1187
1207
  }),
1188
- /* @__PURE__ */ H("span", {
1208
+ /* @__PURE__ */ U("span", {
1189
1209
  className: "gmp-legend-item gmp-legend-dim",
1190
1210
  children: "brighter = more of it built with AI on record"
1191
1211
  }),
1192
- /* @__PURE__ */ U("span", {
1212
+ /* @__PURE__ */ W("span", {
1193
1213
  className: "gmp-legend-item gmp-legend-dim",
1194
- children: [/* @__PURE__ */ H("span", {
1214
+ children: [/* @__PURE__ */ U("span", {
1195
1215
  className: "gmp-map-swatch gmp-map-swatch--edge",
1196
1216
  "aria-hidden": "true"
1197
1217
  }), " one area uses another"]
1198
1218
  }),
1199
- /* @__PURE__ */ H("span", {
1219
+ /* @__PURE__ */ U("span", {
1200
1220
  className: "gmp-legend-item gmp-map-legend-danger",
1201
1221
  children: "⚠ tangle — two areas that depend on each other"
1202
1222
  }),
1203
- /* @__PURE__ */ H("span", {
1223
+ /* @__PURE__ */ U("span", {
1204
1224
  className: "gmp-legend-item gmp-legend-dim",
1205
1225
  children: "double-click a folder to open its files"
1206
1226
  })
@@ -1209,26 +1229,26 @@ function dn() {
1209
1229
  }
1210
1230
  //#endregion
1211
1231
  //#region src/ui/graph/timelineNavigation.js
1212
- function J(e) {
1232
+ function Y(e) {
1213
1233
  return typeof e == "object" && !!e && !Array.isArray(e);
1214
1234
  }
1215
- function Y(e, t) {
1235
+ function X(e, t) {
1216
1236
  let n = Object.keys(e).sort();
1217
1237
  return n.length === t.length && t.slice().sort().every((e, t) => e === n[t]);
1218
1238
  }
1219
- function X(e) {
1239
+ function dn(e) {
1220
1240
  return typeof e == "string" && e.length > 0;
1221
1241
  }
1222
1242
  function fn(e) {
1223
- return e === null || X(e);
1243
+ return e === null || dn(e);
1224
1244
  }
1225
1245
  function pn(e) {
1226
1246
  let t = !1;
1227
- if (J(e) && typeof e.type == "string" && (e.type === "open-change" && Y(e, ["type", "change"]) && J(e.change) ? t = Y(e.change, ["id", "branch"]) && X(e.change.id) && fn(e.change.branch) : e.type === "open-session" && Y(e, [
1247
+ if (Y(e) && typeof e.type == "string" && (e.type === "open-change" && X(e, ["type", "change"]) && Y(e.change) ? t = X(e.change, ["id", "branch"]) && dn(e.change.id) && fn(e.change.branch) : e.type === "open-session" && X(e, [
1228
1248
  "type",
1229
1249
  "sessionId",
1230
1250
  "source"
1231
- ]) && X(e.sessionId) && J(e.source) ? e.source.kind === "commit" && Y(e.source, ["kind", "commit"]) && J(e.source.commit) ? t = Y(e.source.commit, ["id", "branch"]) && X(e.source.commit.id) && fn(e.source.commit.branch) : (e.source.kind === "unlinked" || e.source.kind === "outside-window") && Y(e.source, ["kind"]) && (t = !0) : (e.type === "open-map" || e.type === "show-older") && Y(e, ["type"]) && (t = !0)), !t) throw TypeError([
1251
+ ]) && dn(e.sessionId) && Y(e.source) ? e.source.kind === "commit" && X(e.source, ["kind", "commit"]) && Y(e.source.commit) ? t = X(e.source.commit, ["id", "branch"]) && dn(e.source.commit.id) && fn(e.source.commit.branch) : (e.source.kind === "unlinked" || e.source.kind === "outside-window") && X(e.source, ["kind"]) && (t = !0) : (e.type === "open-map" || e.type === "show-older") && X(e, ["type"]) && (t = !0)), !t) throw TypeError([
1232
1252
  "Timeline navigation action rejected.",
1233
1253
  "What went wrong: the value is not an exact supported TimelineNavigationAction.",
1234
1254
  "Why it happened: an untyped caller supplied an unknown action, missing context, or extra fields.",
@@ -1243,18 +1263,18 @@ function pn(e) {
1243
1263
  function mn({ tag: e, hoverText: t, active: n = !1, onToggle: r, className: i = "", ...a }) {
1244
1264
  if (!p.includes(e)) throw Error(`ScentTag render failed: what went wrong: unknown scent tag ${JSON.stringify(e)}; why: the value is not a member of the closed SCENT_TAGS set; where: src/ui/graph/ScentTag.jsx; when: rendering a ranked-list row; what it means: an upstream ranking derivation produced a value outside the frozen vocabulary; how to fix: only pass one of ${p.join(", ")}.`);
1245
1265
  if (!r) {
1246
- let n = /* @__PURE__ */ H("span", {
1266
+ let n = /* @__PURE__ */ U("span", {
1247
1267
  className: `tlp-scent${i ? ` ${i}` : ""}`,
1248
1268
  tabIndex: t ? 0 : void 0,
1249
1269
  ...a,
1250
1270
  children: e
1251
1271
  });
1252
- return t ? /* @__PURE__ */ H(xe, {
1272
+ return t ? /* @__PURE__ */ U(be, {
1253
1273
  content: t,
1254
1274
  children: n
1255
1275
  }) : n;
1256
1276
  }
1257
- let o = /* @__PURE__ */ H("button", {
1277
+ let o = /* @__PURE__ */ U("button", {
1258
1278
  type: "button",
1259
1279
  className: `tlp-scent tlp-scent-filter${n ? " tlp-scent-filter-active" : ""}${i ? ` ${i}` : ""}`,
1260
1280
  "aria-pressed": n,
@@ -1262,7 +1282,7 @@ function mn({ tag: e, hoverText: t, active: n = !1, onToggle: r, className: i =
1262
1282
  ...a,
1263
1283
  children: e
1264
1284
  });
1265
- return t ? /* @__PURE__ */ H(xe, {
1285
+ return t ? /* @__PURE__ */ U(be, {
1266
1286
  content: t,
1267
1287
  children: o
1268
1288
  }) : o;
@@ -1270,7 +1290,7 @@ function mn({ tag: e, hoverText: t, active: n = !1, onToggle: r, className: i =
1270
1290
  //#endregion
1271
1291
  //#region src/ui/graph/RankedRow.jsx
1272
1292
  function hn({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i = "", ...a }) {
1273
- return /* @__PURE__ */ U("button", {
1293
+ return /* @__PURE__ */ W("button", {
1274
1294
  type: "button",
1275
1295
  className: [
1276
1296
  "tlp-ranked-row",
@@ -1281,9 +1301,9 @@ function hn({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i =
1281
1301
  onClick: () => r?.(e.id),
1282
1302
  ...a,
1283
1303
  children: [
1284
- /* @__PURE__ */ H(ee, {
1304
+ /* @__PURE__ */ U(I, {
1285
1305
  className: "tlp-ranked-doi-scope",
1286
- children: /* @__PURE__ */ H(ye, {
1306
+ children: /* @__PURE__ */ U(ve, {
1287
1307
  label: e.name,
1288
1308
  loc: t,
1289
1309
  recorded: Math.round(e.doi * 100) / 100,
@@ -1293,23 +1313,23 @@ function hn({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i =
1293
1313
  className: "tlp-ranked-doi"
1294
1314
  })
1295
1315
  }),
1296
- /* @__PURE__ */ H("span", {
1316
+ /* @__PURE__ */ U("span", {
1297
1317
  className: "tlp-ranked-name",
1298
1318
  title: e.name,
1299
1319
  children: e.name
1300
1320
  }),
1301
- /* @__PURE__ */ H("span", {
1321
+ /* @__PURE__ */ U("span", {
1302
1322
  className: "tlp-ranked-tags",
1303
1323
  "aria-label": "comprehension signals",
1304
- children: e.scentTags.map((t) => /* @__PURE__ */ H(mn, {
1324
+ children: e.scentTags.map((t) => /* @__PURE__ */ U(mn, {
1305
1325
  tag: t,
1306
1326
  hoverText: t.startsWith("agent wrote:") ? e.hoverText ?? void 0 : void 0
1307
1327
  }, t))
1308
1328
  }),
1309
- /* @__PURE__ */ H("span", {
1329
+ /* @__PURE__ */ U("span", {
1310
1330
  className: "tlp-ranked-doi-val tnum",
1311
1331
  "aria-hidden": "true",
1312
- children: Ee(e.doi, 2)
1332
+ children: Te(e.doi, 2)
1313
1333
  })
1314
1334
  ]
1315
1335
  });
@@ -1322,7 +1342,7 @@ var Z = [
1322
1342
  "churn"
1323
1343
  ];
1324
1344
  function gn({ rankMode: e, onChange: t, className: n = "", ...r }) {
1325
- let i = B([]), a = (e) => {
1345
+ let i = V([]), a = (e) => {
1326
1346
  let n = Z[e];
1327
1347
  n && (t(n), i.current[e]?.focus());
1328
1348
  }, o = (e, t) => {
@@ -1346,12 +1366,12 @@ function gn({ rankMode: e, onChange: t, className: n = "", ...r }) {
1346
1366
  }
1347
1367
  e.preventDefault(), a(n);
1348
1368
  };
1349
- return /* @__PURE__ */ H("span", {
1369
+ return /* @__PURE__ */ U("span", {
1350
1370
  className: `tlp-rank-mode${n ? ` ${n}` : ""}`,
1351
1371
  role: "radiogroup",
1352
1372
  "aria-label": "rank mode",
1353
1373
  ...r,
1354
- children: Z.map((n, r) => /* @__PURE__ */ H("button", {
1374
+ children: Z.map((n, r) => /* @__PURE__ */ U("button", {
1355
1375
  type: "button",
1356
1376
  role: "radio",
1357
1377
  "aria-checked": e === n,
@@ -1369,7 +1389,7 @@ function gn({ rankMode: e, onChange: t, className: n = "", ...r }) {
1369
1389
  //#endregion
1370
1390
  //#region src/ui/graph/InsightPanel.jsx
1371
1391
  function _n({ insights: e, onOpenEvidence: t, className: n = "", ...r }) {
1372
- if (d(e), e.length === 0) return /* @__PURE__ */ H("p", {
1392
+ if (d(e), e.length === 0) return /* @__PURE__ */ U("p", {
1373
1393
  className: `tlp-insight-empty${n ? ` ${n}` : ""}`,
1374
1394
  ...r,
1375
1395
  children: "no insights recorded for this node yet."
@@ -1379,35 +1399,35 @@ function _n({ insights: e, onOpenEvidence: t, className: n = "", ...r }) {
1379
1399
  let e = i.get(t.kind) ?? [];
1380
1400
  e.push(t), i.set(t.kind, e);
1381
1401
  }
1382
- return /* @__PURE__ */ H("div", {
1402
+ return /* @__PURE__ */ U("div", {
1383
1403
  className: `tlp-insight-panel${n ? ` ${n}` : ""}`,
1384
1404
  ...r,
1385
- children: [...i.entries()].map(([e, n]) => /* @__PURE__ */ U("section", {
1405
+ children: [...i.entries()].map(([e, n]) => /* @__PURE__ */ W("section", {
1386
1406
  className: "tlp-insight-group",
1387
1407
  "aria-label": C[e],
1388
- children: [/* @__PURE__ */ H("p", {
1408
+ children: [/* @__PURE__ */ U("p", {
1389
1409
  className: "tlp-insight-group-title",
1390
1410
  children: C[e]
1391
- }), /* @__PURE__ */ H("ul", {
1411
+ }), /* @__PURE__ */ U("ul", {
1392
1412
  className: "tlp-insight-list",
1393
- children: n.map((e, n) => /* @__PURE__ */ U("li", {
1413
+ children: n.map((e, n) => /* @__PURE__ */ W("li", {
1394
1414
  className: "tlp-insight-item",
1395
1415
  children: [
1396
- /* @__PURE__ */ H("span", {
1416
+ /* @__PURE__ */ U("span", {
1397
1417
  className: `tlp-insight-provenance ${s[e.provenance].markerClass}`,
1398
1418
  "aria-hidden": "true"
1399
1419
  }),
1400
- /* @__PURE__ */ H("span", {
1420
+ /* @__PURE__ */ U("span", {
1401
1421
  className: "tlp-insight-title",
1402
1422
  children: e.title
1403
1423
  }),
1404
- e.summary && /* @__PURE__ */ H("span", {
1424
+ e.summary && /* @__PURE__ */ U("span", {
1405
1425
  className: "tlp-insight-summary",
1406
1426
  children: e.summary
1407
1427
  }),
1408
- /* @__PURE__ */ H("span", {
1428
+ /* @__PURE__ */ U("span", {
1409
1429
  className: "tlp-insight-evidence",
1410
- children: e.evidence.map((e, n) => /* @__PURE__ */ H("button", {
1430
+ children: e.evidence.map((e, n) => /* @__PURE__ */ U("button", {
1411
1431
  type: "button",
1412
1432
  className: "tlp-insight-evidence-link",
1413
1433
  onClick: () => t?.(e.sessionId),
@@ -1593,9 +1613,9 @@ function Sn(e) {
1593
1613
  //#endregion
1594
1614
  //#region src/ui/transcript/graph/engine/useCanvasSync.js
1595
1615
  function Cn(e, t, n) {
1596
- let r = Ft();
1616
+ let r = Pt();
1597
1617
  return {
1598
- focusPhase: L((i) => {
1618
+ focusPhase: R((i) => {
1599
1619
  let a = e[i];
1600
1620
  if (!a) return;
1601
1621
  let o = /* @__PURE__ */ new Set();
@@ -1623,7 +1643,7 @@ function Cn(e, t, n) {
1623
1643
  r,
1624
1644
  n
1625
1645
  ]),
1626
- focusTurn: L((e) => {
1646
+ focusTurn: R((e) => {
1627
1647
  let n = t[e]?.index ?? e, i = r.getNodes().find((e) => e.type === "turn" && e.data.turn.index === n);
1628
1648
  i && r.setCenter(i.position.x + Q.turnWidth / 2, i.position.y + Q.turnBaseHeight / 2, {
1629
1649
  zoom: 1,
@@ -1641,17 +1661,17 @@ function wn(e, t) {
1641
1661
  }
1642
1662
  function Tn({ data: e, selected: t }) {
1643
1663
  let { turn: n, annotations: r, isSearchMatch: i, isFilteredOut: a, isSelected: o, turnNumber: s, provider: c } = e, l = n.depth ?? 0, u = n.role === "assistant" && l > 0, d = r.some((e) => e.type === "error"), f = r.some((e) => e.type === "retry"), p = r.some((e) => e.type === "revert");
1644
- return /* @__PURE__ */ U("div", {
1664
+ return /* @__PURE__ */ W("div", {
1645
1665
  "data-turn-index": n.index,
1646
1666
  "data-harness": u ? void 0 : n.role === "assistant" ? c : void 0,
1647
1667
  style: { width: Q.turnWidth },
1648
1668
  children: [
1649
- /* @__PURE__ */ H(G, {
1669
+ /* @__PURE__ */ U(K, {
1650
1670
  type: "target",
1651
- position: K.Top,
1671
+ position: q.Top,
1652
1672
  className: "tb-gnode-handle tb-gnode-handle-top"
1653
1673
  }),
1654
- /* @__PURE__ */ H(O, {
1674
+ /* @__PURE__ */ U(O, {
1655
1675
  role: n.role,
1656
1676
  agentName: u ? n.agentName : void 0,
1657
1677
  turnNumber: s,
@@ -1668,21 +1688,21 @@ function Tn({ data: e, selected: t }) {
1668
1688
  isSelected: t || o,
1669
1689
  provider: c
1670
1690
  }),
1671
- /* @__PURE__ */ H(G, {
1691
+ /* @__PURE__ */ U(K, {
1672
1692
  type: "source",
1673
- position: K.Bottom,
1693
+ position: q.Bottom,
1674
1694
  className: "tb-gnode-handle tb-gnode-handle-bottom"
1675
1695
  }),
1676
- /* @__PURE__ */ H(G, {
1696
+ /* @__PURE__ */ U(K, {
1677
1697
  type: "source",
1678
1698
  id: "tool-source",
1679
- position: K.Right,
1699
+ position: q.Right,
1680
1700
  className: "tb-gnode-handle tb-gnode-handle-right"
1681
1701
  })
1682
1702
  ]
1683
1703
  });
1684
1704
  }
1685
- var En = ke(Tn);
1705
+ var En = Oe(Tn);
1686
1706
  //#endregion
1687
1707
  //#region src/ui/transcript/graph/engine/nodes/ToolPillNode.jsx
1688
1708
  function Dn({ data: e }) {
@@ -1695,14 +1715,14 @@ function Dn({ data: e }) {
1695
1715
  exitCode: e.exitCode ?? void 0,
1696
1716
  preview: n[e.id] ?? ""
1697
1717
  }));
1698
- return /* @__PURE__ */ U("div", {
1718
+ return /* @__PURE__ */ W("div", {
1699
1719
  style: { width: Q.toolCallWidth },
1700
- children: [/* @__PURE__ */ H(G, {
1720
+ children: [/* @__PURE__ */ U(K, {
1701
1721
  type: "target",
1702
1722
  id: "tool-target",
1703
- position: K.Left,
1723
+ position: q.Left,
1704
1724
  className: "tb-gnode-handle tb-gnode-handle-left"
1705
- }), /* @__PURE__ */ H(I, {
1725
+ }), /* @__PURE__ */ U(L, {
1706
1726
  tools: o,
1707
1727
  totalDurationMs: r,
1708
1728
  hasError: i,
@@ -1710,59 +1730,59 @@ function Dn({ data: e }) {
1710
1730
  })]
1711
1731
  });
1712
1732
  }
1713
- var On = ke(Dn);
1733
+ var On = Oe(Dn);
1714
1734
  //#endregion
1715
1735
  //#region src/ui/transcript/graph/engine/nodes/SubagentBranchNode.jsx
1716
1736
  function kn({ data: e }) {
1717
1737
  let { agentName: t, depth: n } = e;
1718
- return /* @__PURE__ */ H(fe, {
1738
+ return /* @__PURE__ */ U(de, {
1719
1739
  agentName: t,
1720
1740
  depth: n
1721
1741
  });
1722
1742
  }
1723
- var An = ke(kn);
1743
+ var An = Oe(kn);
1724
1744
  //#endregion
1725
1745
  //#region src/ui/transcript/graph/engine/GraphControls.jsx
1726
1746
  function jn({ className: e = "" }) {
1727
- let t = Ft();
1728
- return /* @__PURE__ */ U("div", {
1747
+ let t = Pt();
1748
+ return /* @__PURE__ */ W("div", {
1729
1749
  className: ["tb-graph-controls", e].filter(Boolean).join(" "),
1730
1750
  children: [
1731
- /* @__PURE__ */ H(Mn, {
1751
+ /* @__PURE__ */ U(Mn, {
1732
1752
  label: "zoom in",
1733
1753
  onClick: () => t.zoomIn({ duration: 150 }),
1734
- children: /* @__PURE__ */ H(Ke, {
1754
+ children: /* @__PURE__ */ U(Ge, {
1735
1755
  size: 14,
1736
1756
  strokeWidth: 2
1737
1757
  })
1738
1758
  }),
1739
- /* @__PURE__ */ H(Mn, {
1759
+ /* @__PURE__ */ U(Mn, {
1740
1760
  label: "zoom out",
1741
1761
  onClick: () => t.zoomOut({ duration: 150 }),
1742
- children: /* @__PURE__ */ H(Ge, {
1762
+ children: /* @__PURE__ */ U(We, {
1743
1763
  size: 14,
1744
1764
  strokeWidth: 2
1745
1765
  })
1746
1766
  }),
1747
- /* @__PURE__ */ H(Mn, {
1767
+ /* @__PURE__ */ U(Mn, {
1748
1768
  label: "fit view",
1749
1769
  onClick: () => t.fitView({
1750
1770
  padding: .1,
1751
1771
  duration: 250
1752
1772
  }),
1753
- children: /* @__PURE__ */ H(Ue, {
1773
+ children: /* @__PURE__ */ U(He, {
1754
1774
  size: 14,
1755
1775
  strokeWidth: 1.75
1756
1776
  })
1757
1777
  }),
1758
- /* @__PURE__ */ H(Mn, {
1778
+ /* @__PURE__ */ U(Mn, {
1759
1779
  label: "reset",
1760
1780
  onClick: () => t.setViewport({
1761
1781
  x: 0,
1762
1782
  y: 0,
1763
1783
  zoom: 1
1764
1784
  }, { duration: 200 }),
1765
- children: /* @__PURE__ */ H(qe, {
1785
+ children: /* @__PURE__ */ U(Ke, {
1766
1786
  size: 14,
1767
1787
  strokeWidth: 1.75
1768
1788
  })
@@ -1771,7 +1791,7 @@ function jn({ className: e = "" }) {
1771
1791
  });
1772
1792
  }
1773
1793
  function Mn({ label: e, onClick: t, children: n }) {
1774
- return /* @__PURE__ */ H("button", {
1794
+ return /* @__PURE__ */ U("button", {
1775
1795
  type: "button",
1776
1796
  onClick: t,
1777
1797
  "aria-label": e,
@@ -1783,8 +1803,8 @@ function Mn({ label: e, onClick: t, children: n }) {
1783
1803
  //#endregion
1784
1804
  //#region src/ui/transcript/graph/engine/TrajectoryGraphLegend.jsx
1785
1805
  function Nn({ provider: e, className: t = "" }) {
1786
- let n = e && Te(e).toLocaleLowerCase("en-US") || "agent";
1787
- return /* @__PURE__ */ H(se, {
1806
+ let n = e && we(e).toLocaleLowerCase("en-US") || "agent";
1807
+ return /* @__PURE__ */ U(oe, {
1788
1808
  className: ["tb-graph-legend", t].filter(Boolean).join(" "),
1789
1809
  items: [
1790
1810
  {
@@ -1819,15 +1839,15 @@ var Pn = {
1819
1839
  subagentLane: An
1820
1840
  };
1821
1841
  function Fn(e) {
1822
- return /* @__PURE__ */ H(Mt, { children: /* @__PURE__ */ H(In, { ...e }) });
1842
+ return /* @__PURE__ */ U(jt, { children: /* @__PURE__ */ U(In, { ...e }) });
1823
1843
  }
1824
1844
  function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotations: i, searchMatches: a, searchQuery: o, activeMatchIndex: s, focusTurn: c, focusPhase: l, onPhaseActivate: u, onViewportChange: d, selectedTurns: f, provider: p, className: m = "" }) {
1825
- let h = Ft(), { focusTurn: g, focusPhase: _ } = Cn(r, e, u), v = z(() => {
1845
+ let h = Pt(), { focusTurn: g, focusPhase: _ } = Cn(r, e, u), v = B(() => {
1826
1846
  if (n.length === e.length) return /* @__PURE__ */ new Set();
1827
1847
  let t = new Set(n), r = /* @__PURE__ */ new Set();
1828
1848
  for (let n = 0; n < e.length; n++) t.has(e[n]) && r.add(n);
1829
1849
  return r;
1830
- }, [e, n]), y = z(() => xn({
1850
+ }, [e, n]), y = B(() => xn({
1831
1851
  turns: e,
1832
1852
  toolVMsByTurn: t,
1833
1853
  phases: r,
@@ -1845,13 +1865,13 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1845
1865
  v,
1846
1866
  o,
1847
1867
  f
1848
- ]), b = z(() => y.nodes.map((e) => e.type === "turn" ? {
1868
+ ]), b = B(() => y.nodes.map((e) => e.type === "turn" ? {
1849
1869
  ...e,
1850
1870
  data: {
1851
1871
  ...e.data,
1852
1872
  provider: p
1853
1873
  }
1854
- } : e), [y.nodes, p]), x = z(() => Sn(b), [b]), S = z(() => y.edges.map((e) => {
1874
+ } : e), [y.nodes, p]), x = B(() => Sn(b), [b]), S = B(() => y.edges.map((e) => {
1855
1875
  let t = e.sourceHandle === "tool-source";
1856
1876
  return {
1857
1877
  ...e,
@@ -1864,8 +1884,8 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1864
1884
  },
1865
1885
  animated: t ? !1 : e.animated
1866
1886
  };
1867
- }), [y.edges]), C = z(() => [...x, ...b], [x, b]), [w, T, E] = Pt(C), [D, O, k] = Nt(S), A = B(e.length), j = B(o), M = B(n.length);
1868
- R(() => {
1887
+ }), [y.edges]), C = B(() => [...x, ...b], [x, b]), [w, T, E] = Nt(C), [D, O, k] = Mt(S), A = V(e.length), j = V(o), M = V(n.length);
1888
+ z(() => {
1869
1889
  (e.length !== A.current || o !== j.current || n.length !== M.current) && (T(C), O(S), A.current = e.length, j.current = o, M.current = n.length);
1870
1890
  }, [
1871
1891
  C,
@@ -1875,7 +1895,7 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1875
1895
  n.length,
1876
1896
  T,
1877
1897
  O
1878
- ]), R(() => {
1898
+ ]), z(() => {
1879
1899
  if (s === void 0) return;
1880
1900
  let t = e[s]?.index;
1881
1901
  if (t === void 0) return;
@@ -1890,16 +1910,16 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1890
1910
  h,
1891
1911
  e
1892
1912
  ]);
1893
- let N = B(-1);
1894
- R(() => {
1913
+ let N = V(-1);
1914
+ z(() => {
1895
1915
  !c || c.seq === N.current || (N.current = c.seq, g(c.target));
1896
1916
  }, [c, g]);
1897
- let P = B(-1);
1898
- R(() => {
1917
+ let P = V(-1);
1918
+ z(() => {
1899
1919
  !l || l.seq === P.current || (P.current = l.seq, _(l.target));
1900
1920
  }, [l, _]);
1901
- let F = B(!1);
1902
- R(() => {
1921
+ let F = V(!1);
1922
+ z(() => {
1903
1923
  w.length > 0 && !F.current && (F.current = !0, setTimeout(() => {
1904
1924
  let e = w.find((e) => e.type === "turn");
1905
1925
  e ? h.setCenter(e.position.x + Q.turnWidth / 2, e.position.y + Q.turnBaseHeight, {
@@ -1915,13 +1935,13 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1915
1935
  h,
1916
1936
  w
1917
1937
  ]);
1918
- let ee = L((e) => {
1938
+ let I = R((e) => {
1919
1939
  if (e.type === "turn") {
1920
1940
  let t = e.data;
1921
1941
  return t.annotations?.some?.((e) => e.type === "error") ? "var(--danger)" : t.isFilteredOut ? "var(--rule)" : t.turn.role === "user" ? "var(--teal)" : t.turn.role === "assistant" ? "var(--amber)" : "var(--ink-2)";
1922
1942
  }
1923
1943
  return e.type === "toolCall" ? "var(--ink-3)" : "var(--rule)";
1924
- }, []), I = L((e, t) => {
1944
+ }, []), L = R((e, t) => {
1925
1945
  if (t.type !== "turn") return;
1926
1946
  let n = t.data;
1927
1947
  d?.({
@@ -1929,21 +1949,21 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1929
1949
  end: n.turn.index
1930
1950
  });
1931
1951
  }, [d]);
1932
- return /* @__PURE__ */ H("div", {
1952
+ return /* @__PURE__ */ U("div", {
1933
1953
  className: [
1934
1954
  "tb-root",
1935
1955
  "tb-graph",
1936
1956
  m
1937
1957
  ].filter(Boolean).join(" "),
1938
- children: /* @__PURE__ */ U("div", {
1958
+ children: /* @__PURE__ */ W("div", {
1939
1959
  className: "tb-graph-flow",
1940
1960
  children: [
1941
- /* @__PURE__ */ U(jt, {
1961
+ /* @__PURE__ */ W(At, {
1942
1962
  nodes: w,
1943
1963
  edges: D,
1944
1964
  onNodesChange: E,
1945
1965
  onEdgesChange: k,
1946
- onNodeClick: I,
1966
+ onNodeClick: L,
1947
1967
  nodeTypes: Pn,
1948
1968
  fitView: !1,
1949
1969
  minZoom: .2,
@@ -1960,26 +1980,26 @@ function In({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotatio
1960
1980
  panOnDrag: !0,
1961
1981
  panOnScroll: !0,
1962
1982
  zoomOnScroll: !0,
1963
- children: [/* @__PURE__ */ H(Ot, {
1964
- variant: kt.Dots,
1983
+ children: [/* @__PURE__ */ U(Dt, {
1984
+ variant: Ot.Dots,
1965
1985
  gap: 20,
1966
1986
  size: 1,
1967
1987
  color: "var(--rule)"
1968
- }), /* @__PURE__ */ H(At, {
1988
+ }), /* @__PURE__ */ U(kt, {
1969
1989
  zoomable: !0,
1970
1990
  pannable: !0,
1971
- nodeColor: ee,
1991
+ nodeColor: I,
1972
1992
  nodeStrokeColor: "var(--rule)",
1973
1993
  nodeBorderRadius: 0,
1974
1994
  maskColor: "color-mix(in srgb, var(--canvas) 70%, transparent)",
1975
1995
  className: "tb-graph-minimap"
1976
1996
  })]
1977
1997
  }),
1978
- /* @__PURE__ */ H(jn, {}),
1979
- /* @__PURE__ */ H(Nn, { provider: p })
1998
+ /* @__PURE__ */ U(jn, {}),
1999
+ /* @__PURE__ */ U(Nn, { provider: p })
1980
2000
  ]
1981
2001
  })
1982
2002
  });
1983
2003
  }
1984
2004
  //#endregion
1985
- export { tt as AllChangeBindings, nt as AllDiffLineKinds, rt as AllEdgeViolationKinds, it as AllFileChangeStatuses, at as AllInsightKinds, ot as AllInsightProvenances, st as AllMapNodeKinds, ct as AllReadAttributionStates, lt as AllReadStateGrades, de as CHANGE_BINDINGS, D as CODE_MAP_STATE_VERSION, ve as CODE_MAP_VIEWPORT_SCALE, a as COVERAGE_CAP, ut as ChangeBinding, Xt as ChangeDetail, Ht as Changes, $t as CodeMap, un as CodeMapComposition, an as CodeMapNavigator, i as DEBT_VIEWED, u as DIFF_LINE_KINDS, h as DOI_WEIGHTS, dn as DefaultMapLegend, dt as DiffLineKind, $ as EDGE_DEFAULTS, T as EDGE_VIOLATION_KINDS, ft as EdgeViolationKind, w as FILE_CHANGE_STATUSES, pt as FileChangeStatus, me as GRAPH_APP_SECTIONS, ge as GRAPH_LEGEND_ITEMS, ae as GhostCommitNode, he as GhostGroup, j as GraphAppShell, jn as GraphControls, se as GraphLegend, ie as GraphSectionNav, fe as GraphSubagentBranch, I as GraphToolNode, O as GraphTurnNode, k as HighlightEdge, mt as InsightKind, _n as InsightPanel, ht as InsightProvenance, P as LOCAL_APP_SECTIONS, E as MAP_NODE_KINDS, gt as MapNodeKind, Q as NODE_DIMENSIONS, re as RANK_CAP, t as RANK_FLOOR, ne as RECENCY_HALF_LIFE_DAYS, gn as RankModeControl, hn as RankedRow, _t as ReadAttributionState, vt as ReadStateGrade, p as SCENT_TAGS, mn as ScentTag, M as SessionLane, le as SessionOverflowDisclosure, An as SubagentBranchNode, On as ToolPillNode, te as TouchedFileCluster, Fn as TrajectoryGraph, Nn as TrajectoryGraphLegend, En as TurnCardNode, ce as VillageObservations, _ as assertChangeDetailPayloadEnums, e as assertChangeDiffPayloadEnums, N as assertCodeMapPayloadEnums, pn as assertTimelineNavigationAction, Bt as buildChangesGraph, en as codeMapPayloadToMapData, Ce as codeMapStatesEqual, Sn as computeLaneHeaders, m as coverage, A as createCodeMapState, g as debt, o as debtHoverText, l as debtState, Se as deriveCodeMapView, f as deriveRankedRows, y as deriveTimelineHighlight, v as gateRankedRows, q as humanizeAge, we as hunkClears, yt as isChangeBinding, r as isCodeMapViewportScale, bt as isDiffLineKind, xt as isEdgeViolationKind, St as isFileChangeStatus, Ct as isInsightKind, wt as isInsightProvenance, Tt as isMapNodeKind, Et as isReadAttributionState, Dt as isReadStateGrade, n as partialReadHoverText, S as rankMapNodes, c as rankMapNodesIntrinsic, be as reduceCodeMapState, b as resolveEscapeAction, x as scentTagsFor, xn as turnsToFlow, Cn as useCanvasSync };
2005
+ export { et as AllChangeBindings, tt as AllDiffLineKinds, nt as AllEdgeViolationKinds, rt as AllFileChangeStatuses, it as AllInsightKinds, at as AllInsightProvenances, ot as AllMapNodeKinds, st as AllReadAttributionStates, ct as AllReadStateGrades, ue as CHANGE_BINDINGS, D as CODE_MAP_STATE_VERSION, _e as CODE_MAP_VIEWPORT_SCALE, a as COVERAGE_CAP, lt as ChangeBinding, Yt as ChangeDetail, Vt as Changes, Qt as CodeMap, ln as CodeMapComposition, rn as CodeMapNavigator, i as DEBT_VIEWED, u as DIFF_LINE_KINDS, h as DOI_WEIGHTS, un as DefaultMapLegend, ut as DiffLineKind, $ as EDGE_DEFAULTS, T as EDGE_VIOLATION_KINDS, dt as EdgeViolationKind, w as FILE_CHANGE_STATUSES, ft as FileChangeStatus, pe as GRAPH_APP_SECTIONS, he as GRAPH_LEGEND_ITEMS, ie as GhostCommitNode, me as GhostGroup, j as GraphAppShell, jn as GraphControls, oe as GraphLegend, re as GraphSectionNav, de as GraphSubagentBranch, L as GraphToolNode, O as GraphTurnNode, k as HighlightEdge, pt as InsightKind, _n as InsightPanel, mt as InsightProvenance, P as LOCAL_APP_SECTIONS, E as MAP_NODE_KINDS, ht as MapNodeKind, Q as NODE_DIMENSIONS, ne as RANK_CAP, t as RANK_FLOOR, te as RECENCY_HALF_LIFE_DAYS, gn as RankModeControl, hn as RankedRow, gt as ReadAttributionState, _t as ReadStateGrade, p as SCENT_TAGS, mn as ScentTag, M as SessionLane, ce as SessionOverflowDisclosure, An as SubagentBranchNode, On as ToolPillNode, ee as TouchedFileCluster, Fn as TrajectoryGraph, Nn as TrajectoryGraphLegend, En as TurnCardNode, se as VillageObservations, _ as assertChangeDetailPayloadEnums, e as assertChangeDiffPayloadEnums, N as assertCodeMapPayloadEnums, pn as assertTimelineNavigationAction, zt as buildChangesGraph, $t as codeMapPayloadToMapData, Se as codeMapStatesEqual, Sn as computeLaneHeaders, m as coverage, A as createCodeMapState, g as debt, o as debtHoverText, l as debtState, xe as deriveCodeMapView, f as deriveRankedRows, y as deriveTimelineHighlight, v as gateRankedRows, J as humanizeAge, Ce as hunkClears, vt as isChangeBinding, r as isCodeMapViewportScale, yt as isDiffLineKind, bt as isEdgeViolationKind, xt as isFileChangeStatus, St as isInsightKind, Ct as isInsightProvenance, wt as isMapNodeKind, Tt as isReadAttributionState, Et as isReadStateGrade, n as partialReadHoverText, S as rankMapNodes, c as rankMapNodesIntrinsic, ye as reduceCodeMapState, b as resolveEscapeAction, x as scentTagsFor, xn as turnsToFlow, Cn as useCanvasSync };