@mechane-ai/elements 0.67.0 → 0.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/ai.js +225 -224
  2. package/dist/{article-anMy8fA5.js → article-Ni152e-v.js} +104 -89
  3. package/dist/article.js +1 -1
  4. package/dist/catalog.json +71 -1
  5. package/dist/{categorical-values-Bh7ZkEQn.js → categorical-values-6Iz03F1i.js} +1 -1
  6. package/dist/{cells-X8SVrZBc.js → cells-BRI8LpMU.js} +1 -1
  7. package/dist/charts/cartesian.js +1 -1
  8. package/dist/charts/cells.js +1 -1
  9. package/dist/charts/comparison.js +1 -1
  10. package/dist/charts/distribution.js +1 -1
  11. package/dist/charts/figure.js +12 -12
  12. package/dist/charts/graph.js +1 -1
  13. package/dist/charts/hierarchy.js +1 -1
  14. package/dist/charts/image.js +1 -1
  15. package/dist/charts/matrix.js +2 -2
  16. package/dist/charts/plot.js +16 -15
  17. package/dist/charts/relationship.js +1 -1
  18. package/dist/charts/text.js +1 -1
  19. package/dist/charts/timeline.js +2 -2
  20. package/dist/charts/trend.js +1 -1
  21. package/dist/charts.js +3 -3
  22. package/dist/{color-legend-CIo7DhXB.js → color-legend-4As8881l.js} +1 -1
  23. package/dist/content/markdown.js +1 -1
  24. package/dist/{dumbbell-plot-BQDGe0sQ.js → dumbbell-plot-jaQvOctJ.js} +4 -4
  25. package/dist/{embedding-map-DmmknG7A.js → embedding-map-DnZL1kvY.js} +5 -5
  26. package/dist/figure-format-BVb7yFCA.js +46 -0
  27. package/dist/{figure-frame-DlyNTDzh.js → figure-frame-96zFqsWz.js} +1 -1
  28. package/dist/{image-grid-CxEAQvTf.js → image-grid-B6fdmE9c.js} +3 -3
  29. package/dist/kits/evaluation.js +5 -5
  30. package/dist/kits/interpretability.js +8 -8
  31. package/dist/kits/operations.js +4 -4
  32. package/dist/kits/research.js +641 -229
  33. package/dist/kits/training.js +4 -4
  34. package/dist/lesson.js +3 -3
  35. package/dist/markdown-JeuBeMDZ.js +293 -0
  36. package/dist/mdx.js +4 -4
  37. package/dist/packages/charts/src/plot/index.d.ts +2 -0
  38. package/dist/packages/charts/src/plot/plot-layout.d.ts +2 -2
  39. package/dist/packages/charts/src/plot/spatial-layer.d.ts +32 -0
  40. package/dist/packages/charts/src/plot/ticks.d.ts +2 -2
  41. package/dist/packages/foundations/src/visible-motion.d.ts +1 -1
  42. package/dist/packages/kits/src/research/index.d.ts +7 -0
  43. package/dist/packages/kits/src/research/motion-clip.d.ts +41 -0
  44. package/dist/packages/kits/src/research/motion-error.d.ts +8 -0
  45. package/dist/packages/kits/src/research/motion-figure.d.ts +9 -0
  46. package/dist/packages/kits/src/research/motion-frame.d.ts +22 -0
  47. package/dist/packages/kits/src/research/motion-scene.d.ts +22 -0
  48. package/dist/packages/teaching/src/article/uncover.d.ts +2 -0
  49. package/dist/{param-CKr8EYxF.js → param-Dk92C-K1.js} +1 -1
  50. package/dist/plot-CpTwLIYN.js +101 -0
  51. package/dist/{plot-layout-CVzSbcU7.js → plot-layout-1MG72ZWn.js} +151 -101
  52. package/dist/{plot-surface-CBhI1alw.js → plot-surface-8-FZI94y.js} +1 -1
  53. package/dist/{reference-lines-C970JwWZ.js → reference-lines-C18o1yEY.js} +1 -1
  54. package/dist/{scene-C3dCxckI.js → scene-B8dppj5V.js} +7 -7
  55. package/dist/scene.js +1 -1
  56. package/dist/{slope-chart-DekEJxsy.js → slope-chart-CELflRJd.js} +5 -5
  57. package/dist/styles2.css +12 -0
  58. package/dist/{time-series-BSNnijxf.js → time-series-DtAtGoT_.js} +6 -6
  59. package/dist/{timeline-CnxfYSIg.js → timeline-CzianQir.js} +4 -4
  60. package/dist/{token-heatmap-CJaXo56P.js → token-heatmap-m6oaMwkK.js} +273 -288
  61. package/dist/{token-predictions-Bi7aKPnh.js → token-predictions-CpGVjOIs.js} +4 -4
  62. package/dist/{transport-CXj0DV6o.js → transport-DQ1yzsQl.js} +2 -2
  63. package/dist/{tree-diagram-BxOZsjr1.js → tree-diagram-D9ekymCQ.js} +4 -4
  64. package/dist/{treemap-B2yOAetT.js → treemap-DT8q65LQ.js} +5 -5
  65. package/dist/{use-tween-C1TWJwce.js → use-tween-DbXVZBR8.js} +1 -1
  66. package/dist/{violin-plot-W2L_2JRo.js → violin-plot-83HSjnQM.js} +4 -4
  67. package/dist/visible-motion-D6NwjGNz.js +24 -0
  68. package/dist/{waterfall-Bt73N2Ng.js → waterfall-DmApvdrY.js} +4 -4
  69. package/package.json +1 -1
  70. package/recipes/recorded-motion.tsx +14 -0
  71. package/skills/review-elements/SKILL.md +4 -0
  72. package/skills/review-explainer/SKILL.md +4 -0
  73. package/skills/use-elements/SKILL.md +2 -0
  74. package/skills/use-elements/references/kits.md +23 -0
  75. package/skills/write-explainer/SKILL.md +5 -0
  76. package/dist/figure-format-B8kRZMlo.js +0 -36
  77. package/dist/markdown-Diffqqm7.js +0 -313
@@ -1,17 +1,21 @@
1
- import { r as e } from "../figure-format-B8kRZMlo.js";
1
+ import { r as e } from "../figure-format-BVb7yFCA.js";
2
2
  import { d as t, h as n, n as r, o as i } from "../src-Dc1t1ugL.js";
3
- import { c as a, f as o, h as s, m as c, o as l, p as u, r as d, t as f, v as p } from "../src-Bkov5TTa.js";
4
- import { n as m } from "../src-na2DdkKI.js";
5
- import { a as h, t as g } from "../tree-diagram-BxOZsjr1.js";
6
- import { p as _, s as v } from "../src-CIyuaSCi.js";
7
- import { u as y } from "../src-DceyVyL0.js";
8
- import { f as b } from "../time-series-BSNnijxf.js";
9
- import { i as x } from "../src-BsqbWDxS.js";
3
+ import { E as a, c as o, f as s, h as c, m as l, o as u, p as d, r as f, t as p, v as m } from "../src-Bkov5TTa.js";
4
+ import { n as h } from "../src-na2DdkKI.js";
5
+ import { a as g, t as _ } from "../tree-diagram-D9ekymCQ.js";
6
+ import { p as v, s as y } from "../src-CIyuaSCi.js";
7
+ import { p as b, u as x } from "../src-DceyVyL0.js";
8
+ import { f as S } from "../time-series-DtAtGoT_.js";
9
+ import { i as C, l as w, r as ee } from "../src-BsqbWDxS.js";
10
+ import { n as T, r as E } from "../figure-frame-96zFqsWz.js";
11
+ import { r as D } from "../tone-scope-DKiSw-JR.js";
12
+ import { t as O } from "../plot-CpTwLIYN.js";
13
+ import { t as te } from "../visible-motion-D6NwjGNz.js";
10
14
  import "@stylexjs/stylex";
11
- import { useState as S } from "react";
12
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
15
+ import { useEffect as ne, useEffectEvent as k, useMemo as re, useState as A } from "react";
16
+ import { Fragment as ie, jsx as j, jsxs as M } from "react/jsx-runtime";
13
17
  // packages/kits/src/research/finding-card.tsx
14
- var E = {
18
+ var N = {
15
19
  limitation: "Limitation",
16
20
  details: "Full notes & evidence",
17
21
  sources: "Sources",
@@ -21,58 +25,58 @@ var E = {
21
25
  falsified: "Falsified",
22
26
  open: "Open"
23
27
  }
24
- }, D = {
28
+ }, P = {
25
29
  supported: "positive",
26
30
  mixed: "warning",
27
31
  falsified: "negative",
28
32
  open: "neutral"
29
33
  };
30
- function O({ title: t, claim: n, locale: i, status: o, index: l, limitation: h, metrics: g = [], sources: _ = [], author: v, recordedAt: y, recordedLabel: b, details: x, actions: S, labels: C }) {
31
- let O = {
32
- ...E,
34
+ function ae({ title: t, claim: n, locale: i, status: a, index: s, limitation: u, metrics: g = [], sources: _ = [], author: v, recordedAt: y, recordedLabel: b, details: x, actions: S, labels: C }) {
35
+ let w = {
36
+ ...N,
33
37
  ...C,
34
38
  statusLabels: {
35
- ...E.statusLabels,
39
+ ...N.statusLabels,
36
40
  ...C?.statusLabels
37
41
  }
38
42
  };
39
- return /* @__PURE__ */ w(u, {
43
+ return /* @__PURE__ */ j(d, {
40
44
  title: t,
41
- index: l,
42
- meta: /* @__PURE__ */ T(c, { children: [/* @__PURE__ */ w(f, {
43
- tone: D[o],
44
- children: O.statusLabels[o]
45
+ index: s,
46
+ meta: /* @__PURE__ */ M(l, { children: [/* @__PURE__ */ j(p, {
47
+ tone: P[a],
48
+ children: w.statusLabels[a]
45
49
  }), S] }),
46
- footer: v !== void 0 || y !== void 0 || _.length > 0 ? /* @__PURE__ */ T(c, {
50
+ footer: v !== void 0 || y !== void 0 || _.length > 0 ? /* @__PURE__ */ M(l, {
47
51
  shouldSpaceBetween: !0,
48
- children: [/* @__PURE__ */ T(c, { children: [v !== void 0 && /* @__PURE__ */ w(a, {
52
+ children: [/* @__PURE__ */ M(l, { children: [v !== void 0 && /* @__PURE__ */ j(o, {
49
53
  variant: "caption",
50
54
  tone: "muted",
51
55
  children: v
52
- }), y !== void 0 && /* @__PURE__ */ w(r, {
56
+ }), y !== void 0 && /* @__PURE__ */ j(r, {
53
57
  dateTime: y,
54
58
  label: b ?? y
55
- })] }), _.length > 0 && /* @__PURE__ */ T(c, { children: [/* @__PURE__ */ T(a, {
59
+ })] }), _.length > 0 && /* @__PURE__ */ M(l, { children: [/* @__PURE__ */ M(o, {
56
60
  variant: "caption",
57
61
  tone: "muted",
58
- children: [O.sources, ":"]
59
- }), _.map((e) => e.summary !== void 0 && e.href !== void 0 ? /* @__PURE__ */ T(m.Root, { children: [/* @__PURE__ */ w(m.Trigger, {
62
+ children: [w.sources, ":"]
63
+ }), _.map((e) => e.summary !== void 0 && e.href !== void 0 ? /* @__PURE__ */ M(h.Root, { children: [/* @__PURE__ */ j(h.Trigger, {
60
64
  href: e.href,
61
- children: /* @__PURE__ */ w(d, { children: e.label })
62
- }), /* @__PURE__ */ w(m.Popup, { children: /* @__PURE__ */ T(s, {
65
+ children: /* @__PURE__ */ j(f, { children: e.label })
66
+ }), /* @__PURE__ */ j(h.Popup, { children: /* @__PURE__ */ M(c, {
63
67
  isCompact: !0,
64
- children: [/* @__PURE__ */ w(a, { children: e.label }), /* @__PURE__ */ w(a, {
68
+ children: [/* @__PURE__ */ j(o, { children: e.label }), /* @__PURE__ */ j(o, {
65
69
  variant: "caption",
66
70
  tone: "muted",
67
71
  children: e.summary
68
72
  })]
69
- }) })] }, e.id) : /* @__PURE__ */ w(d, { children: e.label }, e.id))] })]
73
+ }) })] }, e.id) : /* @__PURE__ */ j(f, { children: e.label }, e.id))] })]
70
74
  }) : void 0,
71
- children: /* @__PURE__ */ T(s, {
75
+ children: /* @__PURE__ */ M(c, {
72
76
  isCompact: !0,
73
77
  children: [
74
- /* @__PURE__ */ w(a, { children: n }),
75
- g.length > 0 && /* @__PURE__ */ w(c, { children: g.map((t) => /* @__PURE__ */ T(f, {
78
+ /* @__PURE__ */ j(o, { children: n }),
79
+ g.length > 0 && /* @__PURE__ */ j(l, { children: g.map((t) => /* @__PURE__ */ M(p, {
76
80
  tone: t.tone ?? "neutral",
77
81
  children: [
78
82
  t.label,
@@ -84,37 +88,37 @@ function O({ title: t, claim: n, locale: i, status: o, index: l, limitation: h,
84
88
  })
85
89
  ]
86
90
  }, t.label)) }),
87
- h !== void 0 && /* @__PURE__ */ T(a, {
91
+ u !== void 0 && /* @__PURE__ */ M(o, {
88
92
  variant: "caption",
89
93
  tone: "muted",
90
94
  children: [
91
- O.limitation,
95
+ w.limitation,
92
96
  ": ",
93
- h
97
+ u
94
98
  ]
95
99
  }),
96
- x !== void 0 && /* @__PURE__ */ T(p.Root, { children: [/* @__PURE__ */ w(p.Trigger, {
100
+ x !== void 0 && /* @__PURE__ */ M(m.Root, { children: [/* @__PURE__ */ j(m.Trigger, {
97
101
  variant: "inline",
98
- children: O.details
99
- }), /* @__PURE__ */ w(p.Panel, { children: x })] })
102
+ children: w.details
103
+ }), /* @__PURE__ */ j(m.Panel, { children: x })] })
100
104
  ]
101
105
  })
102
106
  });
103
107
  }
104
108
  // packages/kits/src/research/lineage-graph.tsx
105
- var k = 152, A = 56, j = 32, M = 12, N = 16, P = 32, F = 16, I = 16, L = 12, R = 640, z = 240, B = 64, V = "General", H = {
109
+ var oe = 152, se = 56, ce = 32, F = 12, I = 16, L = 32, le = 16, ue = 16, R = 12, de = 640, z = 240, fe = 64, B = "General", pe = {
106
110
  baseline: "series5",
107
111
  milestone: "positive",
108
112
  branch: "series1",
109
113
  merge: "series3",
110
114
  killed: "negative"
111
- }, U = {
115
+ }, me = {
112
116
  baseline: "neutral",
113
117
  milestone: "positive",
114
118
  branch: "neutral",
115
119
  merge: "warning",
116
120
  killed: "negative"
117
- }, W = {
121
+ }, V = {
118
122
  frontier: "Frontier",
119
123
  all: "All",
120
124
  metric: "Score",
@@ -131,7 +135,7 @@ var k = 152, A = 56, j = 32, M = 12, N = 16, P = 32, F = 16, I = 16, L = 12, R =
131
135
  killed: "Killed"
132
136
  }
133
137
  };
134
- function G(e, t, n) {
138
+ function he(e, t, n) {
135
139
  let r = t.get(e.id) ?? 0;
136
140
  for (let i of e.parentIds) if (n.has(i)) {
137
141
  let e = (t.get(i) ?? 0) + 1;
@@ -139,13 +143,13 @@ function G(e, t, n) {
139
143
  }
140
144
  return r;
141
145
  }
142
- function K(e) {
146
+ function ge(e) {
143
147
  let t = /* @__PURE__ */ new Map(), n = new Set(e.map((e) => e.id));
144
148
  for (let n of e) t.set(n.id, 0);
145
- for (let r = 0; r < B; r += 1) {
149
+ for (let r = 0; r < fe; r += 1) {
146
150
  let r = [];
147
151
  for (let i of e) {
148
- let e = G(i, t, n);
152
+ let e = he(i, t, n);
149
153
  e !== t.get(i.id) && r.push([i.id, e]);
150
154
  }
151
155
  if (r.length === 0) break;
@@ -153,7 +157,7 @@ function K(e) {
153
157
  }
154
158
  return t;
155
159
  }
156
- function q(e) {
160
+ function _e(e) {
157
161
  let t = /* @__PURE__ */ new Set(), n = new Map(e.map((e) => [e.id, e]));
158
162
  function r(e) {
159
163
  if (t.has(e)) return;
@@ -164,7 +168,7 @@ function q(e) {
164
168
  for (let t of e) t.kind !== "killed" && r(t.id);
165
169
  return e.filter((e) => t.has(e.id));
166
170
  }
167
- function J({ node: t, locale: n, valueFormat: r, deltaFormat: i }) {
171
+ function ve({ node: t, locale: n, valueFormat: r, deltaFormat: i }) {
168
172
  let a = [];
169
173
  if (t.metric !== null && t.metric !== void 0 && a.push(r === void 0 ? String(t.metric) : e({
170
174
  value: t.metric,
@@ -180,34 +184,34 @@ function J({ node: t, locale: n, valueFormat: r, deltaFormat: i }) {
180
184
  }
181
185
  return t.caption === void 0 ? a.length > 0 ? a.join(" · ") : t.summary : t.caption;
182
186
  }
183
- function Y(e) {
184
- let t = K(e), n = /* @__PURE__ */ new Map();
187
+ function ye(e) {
188
+ let t = ge(e), n = /* @__PURE__ */ new Map();
185
189
  for (let r of e) n.set(r.id, r.column ?? t.get(r.id) ?? 0);
186
190
  return n;
187
191
  }
188
- function X({ nodes: e, locale: t, valueFormat: n, deltaFormat: r }) {
189
- let i = Y(e), a = Math.max(0, ...Array.from(i.values())), o = e.some((e) => e.lane !== void 0), s = [];
192
+ function be({ nodes: e, locale: t, valueFormat: n, deltaFormat: r }) {
193
+ let i = ye(e), a = Math.max(0, ...Array.from(i.values())), o = e.some((e) => e.lane !== void 0), s = [];
190
194
  if (o) for (let t of e) {
191
- let e = t.lane ?? V;
195
+ let e = t.lane ?? B;
192
196
  s.includes(e) || s.push(e);
193
197
  }
194
- else s.push(V);
195
- let c = (a + 1) * k + a * j, l = [], u = [], d = N;
198
+ else s.push(B);
199
+ let c = (a + 1) * oe + a * ce, l = [], u = [], d = I;
196
200
  for (let a of s) {
197
- let s = o ? e.filter((e) => (e.lane ?? V) === a) : e, f = /* @__PURE__ */ new Map();
201
+ let s = o ? e.filter((e) => (e.lane ?? B) === a) : e, f = /* @__PURE__ */ new Map();
198
202
  for (let e of s) {
199
203
  let t = i.get(e.id) ?? 0, n = f.get(t) ?? [];
200
204
  n.push(e), f.set(t, n);
201
205
  }
202
- let p = Math.max(1, ...Array.from(f.values(), (e) => e.length)), m = p * A + (p - 1) * M, h = d, g = o ? h + P : h, _ = o ? P + m + F : m;
206
+ let p = Math.max(1, ...Array.from(f.values(), (e) => e.length)), m = p * se + (p - 1) * F, h = d, g = o ? h + L : h, _ = o ? L + m + le : m;
203
207
  for (let [e, i] of f.entries()) {
204
- let a = N + (o ? I : 0) + e * 184;
208
+ let a = I + (o ? ue : 0) + e * 184;
205
209
  for (let [e, o] of i.entries()) {
206
210
  let i = g + e * 68;
207
211
  l.push({
208
212
  id: o.id,
209
213
  label: o.label,
210
- description: J({
214
+ description: ve({
211
215
  node: o,
212
216
  locale: t,
213
217
  valueFormat: n,
@@ -215,21 +219,21 @@ function X({ nodes: e, locale: t, valueFormat: n, deltaFormat: r }) {
215
219
  }),
216
220
  x: a,
217
221
  y: i,
218
- width: k,
219
- height: A,
220
- tone: H[o.kind]
222
+ width: oe,
223
+ height: se,
224
+ tone: pe[o.kind]
221
225
  });
222
226
  }
223
227
  }
224
228
  o && u.push({
225
229
  id: `lane:${a}`,
226
230
  label: a,
227
- x: N,
231
+ x: I,
228
232
  y: h,
229
233
  width: c + 32,
230
234
  height: _,
231
235
  nodeIds: s.map((e) => e.id)
232
- }), d = h + _ + (o ? L : M);
236
+ }), d = h + _ + (o ? R : F);
233
237
  }
234
238
  let f = new Set(e.map((e) => e.id)), p = [];
235
239
  for (let t of e) for (let e of t.parentIds) f.has(e) && p.push({
@@ -244,138 +248,138 @@ function X({ nodes: e, locale: t, valueFormat: n, deltaFormat: r }) {
244
248
  relationEdges: p,
245
249
  relationGroups: u,
246
250
  width: c + 32 + (o ? 32 : 0),
247
- height: Math.max(z, d + N - (o ? L : M))
251
+ height: Math.max(z, d + I - (o ? R : F))
248
252
  };
249
253
  }
250
- function ee({ node: e, labels: t, detailItems: n }) {
251
- return /* @__PURE__ */ T(s, {
254
+ function xe({ node: e, labels: t, detailItems: n }) {
255
+ return /* @__PURE__ */ M(c, {
252
256
  isCompact: !0,
253
257
  children: [
254
- /* @__PURE__ */ w(o, {}),
255
- /* @__PURE__ */ T(c, {
258
+ /* @__PURE__ */ j(s, {}),
259
+ /* @__PURE__ */ M(l, {
256
260
  shouldSpaceBetween: !0,
257
- children: [/* @__PURE__ */ T(c, { children: [/* @__PURE__ */ w(a, { children: /* @__PURE__ */ w("strong", { children: e.label }) }), e.timestamp === void 0 ? null : /* @__PURE__ */ w(f, {
261
+ children: [/* @__PURE__ */ M(l, { children: [/* @__PURE__ */ j(o, { children: /* @__PURE__ */ j("strong", { children: e.label }) }), e.timestamp === void 0 ? null : /* @__PURE__ */ j(p, {
258
262
  tone: "neutral",
259
263
  children: e.timestamp
260
- })] }), /* @__PURE__ */ w(f, {
261
- tone: U[e.kind],
264
+ })] }), /* @__PURE__ */ j(p, {
265
+ tone: me[e.kind],
262
266
  children: t.kinds[e.kind]
263
267
  })]
264
268
  }),
265
- e.summary === void 0 ? null : /* @__PURE__ */ w(a, { children: e.summary }),
266
- e.detail === void 0 ? null : /* @__PURE__ */ w(a, {
269
+ e.summary === void 0 ? null : /* @__PURE__ */ j(o, { children: e.summary }),
270
+ e.detail === void 0 ? null : /* @__PURE__ */ j(o, {
267
271
  tone: "muted",
268
272
  children: e.detail
269
273
  }),
270
- n.length === 0 ? null : /* @__PURE__ */ w(i, { items: n })
274
+ n.length === 0 ? null : /* @__PURE__ */ j(i, { items: n })
271
275
  ]
272
276
  });
273
277
  }
274
- function te({ nodes: t, valueLabel: n, valueFormat: r, deltaFormat: i, defaultScope: a = "frontier", selected: o, onSelectedChange: c, labels: u, actions: d, ...f }) {
275
- let [p, m] = S(a), [g, v] = S(null), b = {
276
- ...W,
277
- ...u,
278
+ function Se({ nodes: t, valueLabel: n, valueFormat: r, deltaFormat: i, defaultScope: a = "frontier", selected: o, onSelectedChange: s, labels: l, actions: d, ...f }) {
279
+ let [p, m] = A(a), [h, _] = A(null), y = {
280
+ ...V,
281
+ ...l,
278
282
  kinds: {
279
- ...W.kinds,
280
- ...u?.kinds
283
+ ...V.kinds,
284
+ ...l?.kinds
281
285
  }
282
286
  };
283
- if (f.status === "loading") return /* @__PURE__ */ w(h, {
287
+ if (f.status === "loading") return /* @__PURE__ */ j(g, {
284
288
  ...f,
285
289
  nodes: [],
286
290
  edges: [],
287
- width: R,
291
+ width: de,
288
292
  height: z
289
293
  });
290
- if (t.length === 0) return /* @__PURE__ */ w(_, {
294
+ if (t.length === 0) return /* @__PURE__ */ j(v, {
291
295
  title: f.title,
292
- children: b.empty
296
+ children: y.empty
293
297
  });
294
- if (new Set(t.map((e) => e.id)).size !== t.length) return /* @__PURE__ */ w(l, {
298
+ if (new Set(t.map((e) => e.id)).size !== t.length) return /* @__PURE__ */ j(u, {
295
299
  tone: "negative",
296
300
  role: "alert",
297
301
  children: "Lineage nodes must have unique identifiers."
298
302
  });
299
- let x = q(t), E = x.length < t.length, D = p === "frontier" && E ? x : t, O = o === void 0 ? g : o;
300
- function k(e, t) {
301
- o === void 0 && v(e), c?.(e, t);
303
+ let b = _e(t), S = b.length < t.length, C = p === "frontier" && S ? b : t, w = o === void 0 ? h : o;
304
+ function ee(e, t) {
305
+ o === void 0 && _(e), s?.(e, t);
302
306
  }
303
- let A = X({
304
- nodes: D,
307
+ let T = be({
308
+ nodes: C,
305
309
  locale: f.locale,
306
310
  valueFormat: r,
307
311
  deltaFormat: i
308
- }), j = O === null ? void 0 : D.find((e) => e.id === O), M = new Map(t.map((e) => [e.id, e])), N = E ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T(y.Root, {
312
+ }), E = w === null ? void 0 : C.find((e) => e.id === w), D = new Map(t.map((e) => [e.id, e])), O = S ? /* @__PURE__ */ M(ie, { children: [/* @__PURE__ */ M(x.Root, {
309
313
  "aria-label": `${f.title} scope`,
310
314
  value: p,
311
315
  onValueChange: (e) => m(e === "all" ? "all" : "frontier"),
312
- children: [/* @__PURE__ */ w(y.Item, {
316
+ children: [/* @__PURE__ */ j(x.Item, {
313
317
  value: "frontier",
314
- children: `${b.frontier} (${x.length})`
315
- }), /* @__PURE__ */ w(y.Item, {
318
+ children: `${y.frontier} (${b.length})`
319
+ }), /* @__PURE__ */ j(x.Item, {
316
320
  value: "all",
317
- children: `${b.all} (${t.length})`
321
+ children: `${y.all} (${t.length})`
318
322
  })]
319
- }), d] }) : d, P = j === void 0 ? [] : [
320
- ...j.lane === void 0 ? [] : [{
321
- label: b.lane,
322
- value: j.lane
323
+ }), d] }) : d, te = E === void 0 ? [] : [
324
+ ...E.lane === void 0 ? [] : [{
325
+ label: y.lane,
326
+ value: E.lane
323
327
  }],
324
- ...j.metric === null || j.metric === void 0 ? [] : [{
325
- label: n ?? b.metric,
326
- value: r === void 0 ? String(j.metric) : e({
327
- value: j.metric,
328
+ ...E.metric === null || E.metric === void 0 ? [] : [{
329
+ label: n ?? y.metric,
330
+ value: r === void 0 ? String(E.metric) : e({
331
+ value: E.metric,
328
332
  locale: f.locale,
329
333
  format: r
330
334
  })
331
335
  }],
332
- ...j.delta === null || j.delta === void 0 ? [] : [{
333
- label: b.delta,
334
- value: (i ?? r) === void 0 ? j.delta > 0 ? `+${j.delta}` : String(j.delta) : e({
335
- value: j.delta,
336
+ ...E.delta === null || E.delta === void 0 ? [] : [{
337
+ label: y.delta,
338
+ value: (i ?? r) === void 0 ? E.delta > 0 ? `+${E.delta}` : String(E.delta) : e({
339
+ value: E.delta,
336
340
  locale: f.locale,
337
341
  format: i ?? r ?? { style: "decimal" }
338
342
  })
339
343
  }],
340
- ...j.parentIds.length === 0 ? [] : [{
341
- label: b.parents,
342
- value: j.parentIds.map((e) => M.get(e)?.label ?? e).join(", ")
344
+ ...E.parentIds.length === 0 ? [] : [{
345
+ label: y.parents,
346
+ value: E.parentIds.map((e) => D.get(e)?.label ?? e).join(", ")
343
347
  }],
344
- ...j.source === void 0 ? [] : [{
345
- label: b.source,
346
- value: j.source
348
+ ...E.source === void 0 ? [] : [{
349
+ label: y.source,
350
+ value: E.source
347
351
  }]
348
352
  ];
349
- return /* @__PURE__ */ T(s, { children: [/* @__PURE__ */ w(h, {
353
+ return /* @__PURE__ */ M(c, { children: [/* @__PURE__ */ j(g, {
350
354
  ...f,
351
- actions: N,
352
- nodes: A.relationNodes,
353
- edges: A.relationEdges,
354
- groups: A.relationGroups.length > 0 ? A.relationGroups : void 0,
355
- width: A.width,
356
- height: A.height,
357
- selected: O,
358
- onSelectedChange: k
359
- }), j === void 0 ? null : /* @__PURE__ */ w(ee, {
360
- node: j,
361
- labels: b,
362
- detailItems: P
355
+ actions: O,
356
+ nodes: T.relationNodes,
357
+ edges: T.relationEdges,
358
+ groups: T.relationGroups.length > 0 ? T.relationGroups : void 0,
359
+ width: T.width,
360
+ height: T.height,
361
+ selected: w,
362
+ onSelectedChange: ee
363
+ }), E === void 0 ? null : /* @__PURE__ */ j(xe, {
364
+ node: E,
365
+ labels: y,
366
+ detailItems: te
363
367
  })] });
364
368
  }
365
369
  // packages/kits/src/research/milestone-path.tsx
366
- var Z = {
370
+ var H = {
367
371
  baseline: "series5",
368
372
  result: "series1",
369
373
  breakthrough: "positive",
370
374
  counterexample: "negative",
371
375
  decision: "series3"
372
- }, ne = {
376
+ }, Ce = {
373
377
  baseline: "neutral",
374
378
  result: "neutral",
375
379
  breakthrough: "positive",
376
380
  counterexample: "negative",
377
381
  decision: "warning"
378
- }, Q = {
382
+ }, we = {
379
383
  metric: "Score",
380
384
  delta: "Change",
381
385
  limitation: "Limitation",
@@ -389,16 +393,16 @@ var Z = {
389
393
  decision: "Decision"
390
394
  }
391
395
  };
392
- function re({ milestones: t, valueLabel: n, valueFormat: r, deltaFormat: u, selected: d, onSelectedChange: p, labels: m, ...h }) {
393
- let v = {
394
- ...Q,
396
+ function Te({ milestones: t, valueLabel: n, valueFormat: r, deltaFormat: a, selected: d, onSelectedChange: f, labels: m, ...h }) {
397
+ let g = {
398
+ ...we,
395
399
  ...m,
396
400
  kinds: {
397
- ...Q.kinds,
401
+ ...we.kinds,
398
402
  ...m?.kinds
399
403
  }
400
404
  };
401
- if (h.status === "loading") return /* @__PURE__ */ w(g, {
405
+ if (h.status === "loading") return /* @__PURE__ */ j(_, {
402
406
  ...h,
403
407
  nodes: [],
404
408
  direction: "right",
@@ -406,16 +410,16 @@ function re({ milestones: t, valueLabel: n, valueFormat: r, deltaFormat: u, sele
406
410
  valueLabel: n,
407
411
  valueFormat: r
408
412
  });
409
- if (t.length === 0) return /* @__PURE__ */ w(_, {
413
+ if (t.length === 0) return /* @__PURE__ */ j(v, {
410
414
  title: h.title,
411
- children: v.empty
415
+ children: g.empty
412
416
  });
413
- if (new Set(t.map((e) => e.id)).size !== t.length) return /* @__PURE__ */ w(l, {
417
+ if (new Set(t.map((e) => e.id)).size !== t.length) return /* @__PURE__ */ j(u, {
414
418
  tone: "negative",
415
419
  role: "alert",
416
420
  children: "Milestones must have unique identifiers."
417
421
  });
418
- if (t.filter((e) => e.parentId === null).length !== 1) return /* @__PURE__ */ w(l, {
422
+ if (t.filter((e) => e.parentId === null).length !== 1) return /* @__PURE__ */ j(u, {
419
423
  tone: "negative",
420
424
  role: "alert",
421
425
  children: "MilestonePath requires exactly one root milestone (parentId: null)."
@@ -424,15 +428,15 @@ function re({ milestones: t, valueLabel: n, valueFormat: r, deltaFormat: u, sele
424
428
  id: e.id,
425
429
  parentId: e.parentId,
426
430
  label: e.label,
427
- detail: e.wave === void 0 ? v.kinds[e.kind] : `${e.wave} · ${v.kinds[e.kind]}`,
431
+ detail: e.wave === void 0 ? g.kinds[e.kind] : `${e.wave} · ${g.kinds[e.kind]}`,
428
432
  value: e.metric ?? null,
429
- tone: Z[e.kind]
433
+ tone: H[e.kind]
430
434
  })), b = Array.from(new Set(t.map((e) => e.kind))).map((e) => ({
431
435
  id: e,
432
- label: v.kinds[e],
433
- tone: Z[e]
436
+ label: g.kinds[e],
437
+ tone: H[e]
434
438
  })), x = t.find((e) => e.id === d) ?? null;
435
- return /* @__PURE__ */ T(s, { children: [/* @__PURE__ */ w(g, {
439
+ return /* @__PURE__ */ M(c, { children: [/* @__PURE__ */ j(_, {
436
440
  ...h,
437
441
  nodes: y,
438
442
  direction: "right",
@@ -441,28 +445,28 @@ function re({ milestones: t, valueLabel: n, valueFormat: r, deltaFormat: u, sele
441
445
  valueFormat: r,
442
446
  toneLegend: b,
443
447
  selected: d,
444
- onSelectedChange: p
445
- }), x !== null && /* @__PURE__ */ T(s, {
448
+ onSelectedChange: f
449
+ }), x !== null && /* @__PURE__ */ M(c, {
446
450
  isCompact: !0,
447
451
  children: [
448
- /* @__PURE__ */ w(o, {}),
449
- /* @__PURE__ */ T(c, {
452
+ /* @__PURE__ */ j(s, {}),
453
+ /* @__PURE__ */ M(l, {
450
454
  shouldSpaceBetween: !0,
451
- children: [/* @__PURE__ */ T(c, { children: [x.wave !== void 0 && /* @__PURE__ */ w(f, {
455
+ children: [/* @__PURE__ */ M(l, { children: [x.wave !== void 0 && /* @__PURE__ */ j(p, {
452
456
  tone: "neutral",
453
457
  children: x.wave
454
- }), /* @__PURE__ */ w(a, { children: /* @__PURE__ */ w("strong", { children: x.label }) })] }), /* @__PURE__ */ w(f, {
455
- tone: ne[x.kind],
456
- children: v.kinds[x.kind]
458
+ }), /* @__PURE__ */ j(o, { children: /* @__PURE__ */ j("strong", { children: x.label }) })] }), /* @__PURE__ */ j(p, {
459
+ tone: Ce[x.kind],
460
+ children: g.kinds[x.kind]
457
461
  })]
458
462
  }),
459
- /* @__PURE__ */ w(a, {
463
+ /* @__PURE__ */ j(o, {
460
464
  tone: "muted",
461
465
  children: x.claim
462
466
  }),
463
- /* @__PURE__ */ w(i, { items: [
467
+ /* @__PURE__ */ j(i, { items: [
464
468
  ...x.metric === void 0 ? [] : [{
465
- label: v.metric,
469
+ label: g.metric,
466
470
  value: e({
467
471
  value: x.metric,
468
472
  locale: h.locale,
@@ -470,19 +474,19 @@ function re({ milestones: t, valueLabel: n, valueFormat: r, deltaFormat: u, sele
470
474
  })
471
475
  }],
472
476
  ...x.delta === void 0 ? [] : [{
473
- label: v.delta,
477
+ label: g.delta,
474
478
  value: e({
475
479
  value: x.delta,
476
480
  locale: h.locale,
477
- format: u ?? r
481
+ format: a ?? r
478
482
  })
479
483
  }],
480
484
  ...x.limitation === void 0 ? [] : [{
481
- label: v.limitation,
485
+ label: g.limitation,
482
486
  value: x.limitation
483
487
  }],
484
488
  ...x.source === void 0 ? [] : [{
485
- label: v.source,
489
+ label: g.source,
486
490
  value: x.source
487
491
  }]
488
492
  ] })
@@ -490,7 +494,7 @@ function re({ milestones: t, valueLabel: n, valueFormat: r, deltaFormat: u, sele
490
494
  })] });
491
495
  }
492
496
  // packages/kits/src/research/specimen-diff.tsx
493
- var ie = {
497
+ var Ee = {
494
498
  breakdownTitle: "Paired outcome flips",
495
499
  all: "All",
496
500
  gained: "Gained",
@@ -503,27 +507,27 @@ var ie = {
503
507
  candidate: "Candidate",
504
508
  outcome: "Outcome",
505
509
  empty: "No paired specimens available for these two runs."
506
- }, ae = {
510
+ }, De = {
507
511
  gained: "positive",
508
512
  regressed: "negative",
509
513
  both_pass: "neutral",
510
514
  both_fail: "neutral"
511
- }, oe = /* @__PURE__ */ new Set([
515
+ }, Oe = /* @__PURE__ */ new Set([
512
516
  "gained",
513
517
  "regressed",
514
518
  "both_pass",
515
519
  "both_fail"
516
520
  ]);
517
- function se(e) {
518
- return e !== null && oe.has(e);
521
+ function ke(e) {
522
+ return e !== null && Oe.has(e);
519
523
  }
520
- function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterChange: c, onSelectRow: l, labels: u, ...p }) {
524
+ function Ae({ rows: e, baselineLabel: r, candidateLabel: i, filter: a, onFilterChange: s, onSelectRow: l, labels: u, ...d }) {
521
525
  let m = {
522
- ...ie,
526
+ ...Ee,
523
527
  ...u
524
528
  };
525
- if (e.length === 0) return /* @__PURE__ */ w(_, {
526
- title: p.title,
529
+ if (e.length === 0) return /* @__PURE__ */ j(v, {
530
+ title: d.title,
527
531
  children: m.empty
528
532
  });
529
533
  let h = {
@@ -533,17 +537,17 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
533
537
  both_fail: 0
534
538
  };
535
539
  for (let t of e) h[t.outcome] += 1;
536
- let g = o === "all" ? e : e.filter((e) => e.outcome === o), v = {
540
+ let g = a === "all" ? e : e.filter((e) => e.outcome === a), _ = {
537
541
  gained: m.gained,
538
542
  regressed: m.regressed,
539
543
  both_pass: m.bothPass,
540
544
  both_fail: m.bothFail
541
- }, S = [
545
+ }, y = [
542
546
  {
543
547
  id: "specimen",
544
548
  label: m.specimen,
545
549
  role: "primary",
546
- cell: (e) => /* @__PURE__ */ w(t, {
550
+ cell: (e) => /* @__PURE__ */ j(t, {
547
551
  secondary: e.family,
548
552
  children: e.prompt
549
553
  })
@@ -552,16 +556,16 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
552
556
  id: "expected",
553
557
  label: m.expected,
554
558
  role: "text",
555
- cell: (e) => /* @__PURE__ */ w(d, { children: e.expected })
559
+ cell: (e) => /* @__PURE__ */ j(f, { children: e.expected })
556
560
  },
557
561
  {
558
562
  id: "baseline",
559
563
  label: r.trim() === "" ? m.baseline : r,
560
564
  role: "text",
561
565
  isSecondary: !0,
562
- cell: (e) => /* @__PURE__ */ w(a, {
566
+ cell: (e) => /* @__PURE__ */ j(o, {
563
567
  variant: "mono",
564
- children: /* @__PURE__ */ w(x, {
568
+ children: /* @__PURE__ */ j(C, {
565
569
  text: e.baselineOutput,
566
570
  query: e.expected,
567
571
  tone: "accent"
@@ -572,9 +576,9 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
572
576
  id: "candidate",
573
577
  label: i.trim() === "" ? m.candidate : i,
574
578
  role: "text",
575
- cell: (e) => /* @__PURE__ */ w(a, {
579
+ cell: (e) => /* @__PURE__ */ j(o, {
576
580
  variant: "mono",
577
- children: /* @__PURE__ */ w(x, {
581
+ children: /* @__PURE__ */ j(C, {
578
582
  text: e.candidateOutput,
579
583
  query: e.expected,
580
584
  tone: "accent"
@@ -585,21 +589,21 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
585
589
  id: "outcome",
586
590
  label: m.outcome,
587
591
  role: "status",
588
- cell: (e) => /* @__PURE__ */ w(f, {
589
- tone: ae[e.outcome],
590
- children: v[e.outcome]
592
+ cell: (e) => /* @__PURE__ */ j(p, {
593
+ tone: De[e.outcome],
594
+ children: _[e.outcome]
591
595
  })
592
596
  }
593
597
  ];
594
- return /* @__PURE__ */ T(s, {
598
+ return /* @__PURE__ */ M(c, {
595
599
  isCompact: !0,
596
600
  children: [
597
- /* @__PURE__ */ w(b, {
601
+ /* @__PURE__ */ j(S, {
598
602
  title: m.breakdownTitle,
599
- description: p.description,
600
- locale: p.locale,
601
- status: p.status,
602
- source: p.source,
603
+ description: d.description,
604
+ locale: d.locale,
605
+ status: d.status,
606
+ source: d.source,
603
607
  total: e.length,
604
608
  valueFormat: { maximumFractionDigits: 0 },
605
609
  items: [
@@ -628,19 +632,19 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
628
632
  tone: "series5"
629
633
  }
630
634
  ],
631
- selected: o === "all" ? null : o,
635
+ selected: a === "all" ? null : a,
632
636
  onSelectedChange: (e) => {
633
- se(e) ? c(e === o ? "all" : e) : c("all");
637
+ ke(e) ? s(e === a ? "all" : e) : s("all");
634
638
  }
635
639
  }),
636
- /* @__PURE__ */ T(y.Root, {
640
+ /* @__PURE__ */ M(x.Root, {
637
641
  "aria-label": m.outcome,
638
- value: o,
642
+ value: a,
639
643
  onValueChange: (e) => {
640
- c(e);
644
+ s(e);
641
645
  },
642
646
  children: [
643
- /* @__PURE__ */ T(y.Item, {
647
+ /* @__PURE__ */ M(x.Item, {
644
648
  value: "all",
645
649
  children: [
646
650
  m.all,
@@ -649,7 +653,7 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
649
653
  ")"
650
654
  ]
651
655
  }),
652
- /* @__PURE__ */ T(y.Item, {
656
+ /* @__PURE__ */ M(x.Item, {
653
657
  value: "gained",
654
658
  children: [
655
659
  m.gained,
@@ -658,7 +662,7 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
658
662
  ")"
659
663
  ]
660
664
  }),
661
- /* @__PURE__ */ T(y.Item, {
665
+ /* @__PURE__ */ M(x.Item, {
662
666
  value: "regressed",
663
667
  children: [
664
668
  m.regressed,
@@ -667,7 +671,7 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
667
671
  ")"
668
672
  ]
669
673
  }),
670
- /* @__PURE__ */ T(y.Item, {
674
+ /* @__PURE__ */ M(x.Item, {
671
675
  value: "both_pass",
672
676
  children: [
673
677
  m.bothPass,
@@ -676,7 +680,7 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
676
680
  ")"
677
681
  ]
678
682
  }),
679
- /* @__PURE__ */ T(y.Item, {
683
+ /* @__PURE__ */ M(x.Item, {
680
684
  value: "both_fail",
681
685
  children: [
682
686
  m.bothFail,
@@ -687,10 +691,10 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
687
691
  })
688
692
  ]
689
693
  }),
690
- /* @__PURE__ */ w(n, {
691
- caption: p.title,
694
+ /* @__PURE__ */ j(n, {
695
+ caption: d.title,
692
696
  hideCaption: !0,
693
- columns: S,
697
+ columns: y,
694
698
  rows: g,
695
699
  getRowId: (e) => e.id,
696
700
  ...l !== void 0 && { rowAction: {
@@ -713,7 +717,7 @@ function ce({ rows: e, baselineLabel: r, candidateLabel: i, filter: o, onFilterC
713
717
  });
714
718
  }
715
719
  // packages/kits/src/research/work-heartbeat.tsx
716
- var $ = {
720
+ var je = {
717
721
  title: "Active work reports",
718
722
  empty: "No active or recent work reports.",
719
723
  nextCheckpoint: "Next checkpoint",
@@ -724,54 +728,54 @@ var $ = {
724
728
  overdue: "Update overdue",
725
729
  stopped: "Stopped"
726
730
  }
727
- }, le = {
731
+ }, Me = {
728
732
  running: "positive",
729
733
  completed: "neutral",
730
734
  blocked: "negative",
731
735
  overdue: "warning",
732
736
  stopped: "neutral"
733
737
  };
734
- function ue(e) {
738
+ function Ne(e) {
735
739
  return e === void 0 ? null : Number.isFinite(e.completed) && Number.isFinite(e.total) && e.total > 0 ? e : null;
736
740
  }
737
- function de({ reports: t, locale: n, labels: i }) {
738
- let o = {
739
- ...$,
741
+ function Pe({ reports: t, locale: n, labels: i }) {
742
+ let a = {
743
+ ...je,
740
744
  ...i,
741
745
  states: {
742
- ...$.states,
746
+ ...je.states,
743
747
  ...i?.states
744
748
  }
745
749
  };
746
- return t.length === 0 ? /* @__PURE__ */ w("div", {
750
+ return t.length === 0 ? /* @__PURE__ */ j("div", {
747
751
  className: "x1qokhjc",
748
- children: /* @__PURE__ */ w(a, {
752
+ children: /* @__PURE__ */ j(o, {
749
753
  variant: "caption",
750
754
  tone: "muted",
751
- children: o.empty
755
+ children: a.empty
752
756
  })
753
- }) : /* @__PURE__ */ w("ul", {
757
+ }) : /* @__PURE__ */ j("ul", {
754
758
  className: "xe8uvvx x1ghz6dp x1717udv x178xt8z x13fuv20 xhjagg4",
755
759
  children: t.map((t) => {
756
- let i = ue(t.progress), u = i === null ? null : Math.max(0, Math.min(100, i.completed / i.total * 100)), p = t.nextCheckpoint !== void 0 || t.executionRef !== void 0;
757
- return /* @__PURE__ */ T("li", {
760
+ let i = Ne(t.progress), s = i === null ? null : Math.max(0, Math.min(100, i.completed / i.total * 100)), d = t.nextCheckpoint !== void 0 || t.executionRef !== void 0;
761
+ return /* @__PURE__ */ M("li", {
758
762
  className: "x78zum5 xdt5ytf x1hnptsi x1qokhjc xso031l x1q0q8m5 x1qndepd",
759
763
  children: [
760
- /* @__PURE__ */ T(c, {
764
+ /* @__PURE__ */ M(l, {
761
765
  shouldSpaceBetween: !0,
762
- children: [/* @__PURE__ */ w(a, { children: /* @__PURE__ */ w("strong", { children: t.title }) }), /* @__PURE__ */ T(c, { children: [/* @__PURE__ */ w(l, {
763
- tone: le[t.state],
764
- children: o.states[t.state]
765
- }), /* @__PURE__ */ w(r, {
766
+ children: [/* @__PURE__ */ j(o, { children: /* @__PURE__ */ j("strong", { children: t.title }) }), /* @__PURE__ */ M(l, { children: [/* @__PURE__ */ j(u, {
767
+ tone: Me[t.state],
768
+ children: a.states[t.state]
769
+ }), /* @__PURE__ */ j(r, {
766
770
  dateTime: t.observedAt,
767
771
  label: t.observedLabel
768
772
  })] })]
769
773
  }),
770
- i !== null && u !== null && /* @__PURE__ */ T(s, {
774
+ i !== null && s !== null && /* @__PURE__ */ M(c, {
771
775
  isCompact: !0,
772
- children: [/* @__PURE__ */ T(c, {
776
+ children: [/* @__PURE__ */ M(l, {
773
777
  shouldSpaceBetween: !0,
774
- children: [/* @__PURE__ */ T(a, {
778
+ children: [/* @__PURE__ */ M(o, {
775
779
  variant: "caption",
776
780
  tone: "muted",
777
781
  children: [
@@ -790,10 +794,10 @@ function de({ reports: t, locale: n, labels: i }) {
790
794
  " ",
791
795
  i.unit
792
796
  ]
793
- }), /* @__PURE__ */ w(f, {
797
+ }), /* @__PURE__ */ j(p, {
794
798
  tone: "neutral",
795
799
  children: e({
796
- value: u / 100,
800
+ value: s / 100,
797
801
  locale: n,
798
802
  format: {
799
803
  style: "percent",
@@ -801,12 +805,12 @@ function de({ reports: t, locale: n, labels: i }) {
801
805
  }
802
806
  })
803
807
  })]
804
- }), /* @__PURE__ */ w(v, {
808
+ }), /* @__PURE__ */ j(y, {
805
809
  label: t.title,
806
810
  value: i.completed,
807
811
  max: i.total,
808
812
  valueLabel: e({
809
- value: u / 100,
813
+ value: s / 100,
810
814
  locale: n,
811
815
  format: {
812
816
  style: "percent",
@@ -815,21 +819,429 @@ function de({ reports: t, locale: n, labels: i }) {
815
819
  })
816
820
  })]
817
821
  }),
818
- p && /* @__PURE__ */ T(c, {
822
+ d && /* @__PURE__ */ M(l, {
819
823
  shouldSpaceBetween: !0,
820
- children: [t.nextCheckpoint === void 0 ? /* @__PURE__ */ w("span", {}) : /* @__PURE__ */ T(a, {
824
+ children: [t.nextCheckpoint === void 0 ? /* @__PURE__ */ j("span", {}) : /* @__PURE__ */ M(o, {
821
825
  variant: "caption",
822
826
  tone: "muted",
823
827
  children: [
824
- o.nextCheckpoint,
828
+ a.nextCheckpoint,
825
829
  ": ",
826
830
  t.nextCheckpoint
827
831
  ]
828
- }), t.executionRef !== void 0 && /* @__PURE__ */ w(d, { children: t.executionRef })]
832
+ }), t.executionRef !== void 0 && /* @__PURE__ */ j(f, { children: t.executionRef })]
829
833
  })
830
834
  ]
831
835
  }, t.id);
832
836
  })
833
837
  });
834
838
  }
835
- export { O as FindingCard, te as LineageGraph, re as MilestonePath, ce as SpecimenDiff, de as WorkHeartbeat };
839
+ // packages/kits/src/research/motion-error.tsx
840
+ function U(e) {
841
+ throw Error(e);
842
+ }
843
+ function Fe({ title: e, locale: t, first: n, last: r }) {
844
+ return /* @__PURE__ */ j(E, {
845
+ title: e,
846
+ locale: t,
847
+ message: `Choose an integer tick from ${n} through ${r}.`
848
+ });
849
+ }
850
+ // packages/kits/src/research/motion-clip.ts
851
+ var W = {
852
+ text: 4096,
853
+ span: 1e-9,
854
+ rate: 1e9,
855
+ samples: 1e6,
856
+ tracks: 4096,
857
+ regions: 64,
858
+ metrics: 64,
859
+ moments: 512,
860
+ arms: 8
861
+ }, G = {
862
+ bounds: 4,
863
+ point: 3,
864
+ pair: 2
865
+ };
866
+ function K(e, t) {
867
+ e || U(t);
868
+ }
869
+ function q(e) {
870
+ return typeof e != "object" || !e || Array.isArray(e) ? U("Expected a motion record.") : Object.fromEntries(Object.entries(e));
871
+ }
872
+ function J(e, t, n = 0) {
873
+ return !Array.isArray(e) || e.length < n || e.length > t ? U(`Expected between ${n} and ${t} motion items.`) : e;
874
+ }
875
+ function Y(e) {
876
+ return typeof e != "string" || e.length > W.text || e.trim().length === 0 ? U("Expected a nonempty motion label or ID.") : e;
877
+ }
878
+ function X(e) {
879
+ return typeof e != "number" || !Number.isFinite(e) || Math.abs(e) > 2 ** 53 - 1 ? U("Expected a finite motion value in range.") : e;
880
+ }
881
+ function Ie(e) {
882
+ let [t, n, r, i] = J(e, G.bounds, G.bounds), a = [
883
+ X(t),
884
+ X(n),
885
+ X(r),
886
+ X(i)
887
+ ];
888
+ return K(a[2] - a[0] >= W.span && a[3] - a[1] >= W.span, "Motion bounds must increase along both axes."), a;
889
+ }
890
+ function Z(e) {
891
+ let t = X(e);
892
+ return K(Number.isSafeInteger(t), "Motion ticks must be integers."), t;
893
+ }
894
+ function Le(e) {
895
+ let t = q(e);
896
+ K(t.version === 1, "Unsupported motion clip version.");
897
+ let n = Z(t.first), r = Z(t.last);
898
+ K(r >= n && Number.isSafeInteger(r - n), "Invalid motion tick range.");
899
+ let i = X(t.hz), a = X(t.speed);
900
+ K(i > 0 && a > 0 && i * a <= W.rate, "Expected a positive motion tick rate and speed in range.");
901
+ function o(e) {
902
+ let t = Z(e);
903
+ return K(t >= n && t <= r, "Tick outside the motion window."), t;
904
+ }
905
+ let s = { remaining: W.samples };
906
+ function c(e, t, n) {
907
+ let r = J(e, s.remaining, 1);
908
+ s.remaining -= r.length;
909
+ let i = -Infinity;
910
+ return r.map((e) => {
911
+ let r = J(e, t, t), a = o(r[0]);
912
+ return K(a > i, "Sample ticks must increase within each series."), i = a, n(a, r);
913
+ });
914
+ }
915
+ function l(e) {
916
+ let t = q(e), r = J(t.tracks, W.tracks).map((e) => {
917
+ let t = q(e), r = c(t.points, G.point, (e, t) => [
918
+ e,
919
+ X(t[1]),
920
+ X(t[2])
921
+ ]), i = o(t.end);
922
+ K(i >= (r.at(-1)?.[0] ?? n), "Track ends before its last sample.");
923
+ let a = t.notes === void 0 ? [] : c(t.notes, G.pair, (e, t) => [e, Y(t[1])]);
924
+ return {
925
+ id: Y(t.id),
926
+ label: Y(t.label),
927
+ points: r,
928
+ end: i,
929
+ notes: a
930
+ };
931
+ }), i = r.toSorted((e, t) => e.id === t.id ? e.end - t.end : e.id > t.id ? 1 : -1);
932
+ K(i.every((e, t) => {
933
+ let r = i[t - 1];
934
+ return r === void 0 || r.id !== e.id || r.end < (e.points[0]?.[0] ?? n);
935
+ }), "Segments of the same track overlap.");
936
+ let a = J(t.regions === void 0 ? [] : t.regions, W.regions).map((e) => {
937
+ let t = q(e);
938
+ return {
939
+ label: Y(t.label),
940
+ bounds: Ie(t.bounds)
941
+ };
942
+ }), s = J(t.metrics === void 0 ? [] : t.metrics, W.metrics).map((e) => {
943
+ let t = q(e);
944
+ return {
945
+ label: Y(t.label),
946
+ values: c(t.values, G.pair, (e, t) => [e, X(t[1])])
947
+ };
948
+ });
949
+ return {
950
+ label: Y(t.label),
951
+ tracks: r,
952
+ regions: a,
953
+ metrics: s
954
+ };
955
+ }
956
+ let u = J(t.moments, W.moments).map((e) => {
957
+ let t = q(e), n = t.detail;
958
+ return {
959
+ id: Y(t.id),
960
+ label: Y(t.label),
961
+ tick: o(t.tick),
962
+ ...n === void 0 ? {} : { detail: Y(n) }
963
+ };
964
+ });
965
+ return K(new Set(u.map((e) => e.id)).size === u.length, "Motion moment IDs must be unique."), {
966
+ version: 1,
967
+ title: Y(t.title),
968
+ first: n,
969
+ last: r,
970
+ hz: i,
971
+ speed: a,
972
+ bounds: Ie(t.bounds),
973
+ arms: J(t.arms, W.arms, 1).map(l),
974
+ moments: u,
975
+ source: t.source
976
+ };
977
+ }
978
+ // packages/kits/src/research/motion-frame.ts
979
+ var Re = 2, ze = 12;
980
+ function Q(e, t) {
981
+ let n = 0, r = e.length;
982
+ for (; n < r;) {
983
+ let i = Math.floor((n + r) / Re);
984
+ (e[i]?.[0] ?? Infinity) <= t ? n = i + 1 : r = i;
985
+ }
986
+ return n - 1;
987
+ }
988
+ function Be(e, t) {
989
+ let n = Q(e, t), r = e[n];
990
+ if (r === void 0) return null;
991
+ let i = e[n + 1] ?? r, a = i === r ? 0 : (t - r[0]) / (i[0] - r[0]);
992
+ return {
993
+ x: r[1] + a * (i[1] - r[1]),
994
+ y: r[2] + a * (i[2] - r[2]),
995
+ sampled: r[0] === t
996
+ };
997
+ }
998
+ function Ve(e, t, n) {
999
+ return e.flatMap(({ id: e, label: r, points: i, end: a, notes: o = [] }) => {
1000
+ if (t > a) return [];
1001
+ let s = Be(i, t);
1002
+ if (s === null) return [];
1003
+ let c = Math.max(i[0]?.[0] ?? t, t - n), l = Array.from({ length: 13 }, (e, n) => Be(i, c + (t - c) * n / ze)), u = l.flatMap((e, t) => {
1004
+ let n = l[t - 1];
1005
+ return e === null || n?.x === e.x && n.y === e.y ? [] : [[e.x, e.y]];
1006
+ });
1007
+ return [{
1008
+ id: e,
1009
+ label: r,
1010
+ ...s,
1011
+ trail: u,
1012
+ note: o[Q(o, t)]
1013
+ }];
1014
+ });
1015
+ }
1016
+ function He(e, t) {
1017
+ return !Number.isSafeInteger(t) || t < e.first || t > e.last ? U("Choose an integer tick inside the motion window.") : e.arms.map((n) => ({
1018
+ label: n.label,
1019
+ regions: n.regions ?? [],
1020
+ actors: Ve(n.tracks, t, e.hz),
1021
+ metrics: (n.metrics ?? []).map(({ label: e, values: n }) => ({
1022
+ label: e,
1023
+ value: n[Q(n, t)]?.[1] ?? null
1024
+ }))
1025
+ }));
1026
+ }
1027
+ // packages/kits/src/research/motion-scene.tsx
1028
+ var Ue = {
1029
+ tick: "Tick",
1030
+ start: "Start",
1031
+ moment: "Jump to moment",
1032
+ actor: "Inspect actor",
1033
+ sampled: "Recorded",
1034
+ interpolated: "Estimated",
1035
+ absent: "No position recorded"
1036
+ };
1037
+ function We({ frame: e, arm: t, isCompact: n, index: r, bounds: i, isInspecting: a, format: s, labels: u }) {
1038
+ let [d, f] = A(null), p = a ? d : null, m = e.actors.find((e) => e.id === p), h = t.tracks.length === 1 ? t.tracks[0]?.points[0] : void 0, g = m?.note === void 0 ? null : /* @__PURE__ */ M(o, {
1039
+ variant: "caption",
1040
+ children: [
1041
+ s.format(m.note[0]),
1042
+ " · ",
1043
+ m.note[1]
1044
+ ]
1045
+ }), _ = a && t.tracks.length > 0, v = [
1046
+ e.label,
1047
+ ...e.regions.map((e) => e.label),
1048
+ ...e.actors.map((e) => `${e.label} (${s.format(e.x)}, ${s.format(e.y)})`)
1049
+ ].join(", ");
1050
+ return /* @__PURE__ */ M(c, {
1051
+ isCompact: !0,
1052
+ children: [
1053
+ /* @__PURE__ */ M(l, {
1054
+ shouldSpaceBetween: !0,
1055
+ children: [/* @__PURE__ */ j(o, { children: /* @__PURE__ */ j("strong", { children: e.label }) }), e.metrics.map(({ label: e, value: t }) => /* @__PURE__ */ M(o, { children: [
1056
+ e,
1057
+ " ",
1058
+ /* @__PURE__ */ j("strong", { children: t === null ? "—" : s.format(t) })
1059
+ ] }, e))]
1060
+ }),
1061
+ /* @__PURE__ */ j(O, {
1062
+ isCompact: n,
1063
+ origin: h === void 0 ? void 0 : {
1064
+ x: h[1],
1065
+ y: h[2],
1066
+ label: u.start
1067
+ },
1068
+ locale: s.resolvedOptions().locale,
1069
+ isDense: t.tracks.length > 6,
1070
+ bounds: i,
1071
+ label: v,
1072
+ regions: e.regions,
1073
+ points: e.actors,
1074
+ tone: D(r),
1075
+ shape: r % 2 == 0 ? "circle" : "diamond",
1076
+ selected: p
1077
+ }),
1078
+ _ && /* @__PURE__ */ M(l, { children: [
1079
+ /* @__PURE__ */ j(b, {
1080
+ label: u.actor,
1081
+ placeholder: u.actor,
1082
+ items: Array.from(new Map(t.tracks.map((e) => [e.id, e.label])), ([e, t]) => ({
1083
+ value: e,
1084
+ label: `${t} · ${e}`
1085
+ })),
1086
+ value: p,
1087
+ onValueChange: f
1088
+ }),
1089
+ p !== null && /* @__PURE__ */ j(o, {
1090
+ variant: "caption",
1091
+ children: m === void 0 ? u.absent : `${m.sampled ? u.sampled : u.interpolated} · ${s.format(m.x)}, ${s.format(m.y)}`
1092
+ }),
1093
+ g
1094
+ ] })
1095
+ ]
1096
+ });
1097
+ }
1098
+ function $({ clip: e, tick: t, isInspecting: n = !1, isGuided: r = !1, locale: i = "en-US", labels: a }) {
1099
+ let s = {
1100
+ ...Ue,
1101
+ ...a
1102
+ }, c = new Intl.NumberFormat(i, { maximumFractionDigits: 6 });
1103
+ if (!Number.isSafeInteger(t) || t < e.first || t > e.last) return /* @__PURE__ */ j(Fe, {
1104
+ title: e.title,
1105
+ locale: i,
1106
+ first: e.first,
1107
+ last: e.last
1108
+ });
1109
+ let l = He(e, t);
1110
+ return /* @__PURE__ */ j(T, {
1111
+ title: e.title,
1112
+ locale: i,
1113
+ actions: /* @__PURE__ */ M(o, {
1114
+ variant: "caption",
1115
+ children: [
1116
+ s.tick,
1117
+ " ",
1118
+ c.format(t)
1119
+ ]
1120
+ }),
1121
+ children: /* @__PURE__ */ j("div", {
1122
+ ...{
1123
+ 0: { className: "xrvj5dj x1yqo59v x1j825kq xeuugli" },
1124
+ 1: { className: "xrvj5dj xeuugli xnby9oq x1j825kq" }
1125
+ }[!!(r && e.arms.length === 2) | 0],
1126
+ children: e.arms.map((t, i) => {
1127
+ let a = l[i];
1128
+ return a === void 0 ? null : /* @__PURE__ */ j(We, {
1129
+ isCompact: r,
1130
+ arm: t,
1131
+ index: i,
1132
+ bounds: e.bounds,
1133
+ frame: a,
1134
+ isInspecting: n,
1135
+ format: c,
1136
+ labels: s
1137
+ }, t.label);
1138
+ })
1139
+ })
1140
+ });
1141
+ }
1142
+ // packages/kits/src/research/motion-figure.tsx
1143
+ function Ge({ clip: e, tick: t, onTickChange: n, isPlaying: r, onPlayingChange: i, isInspecting: s = !1, isGuided: u = !1, locale: d = "en-US", labels: f }) {
1144
+ let p = {
1145
+ ...Ue,
1146
+ ...f
1147
+ }, [m, h] = A(!1), [g, _] = A(e.speed), v = r ?? m, { ref: y, isActive: x } = te(v, !0), S = re(() => e.moments.map(({ id: e, label: t, tick: n }) => ({
1148
+ id: e,
1149
+ label: t,
1150
+ position: n
1151
+ })), [e]), C = re(() => new Intl.NumberFormat(d), [d]);
1152
+ function T(a) {
1153
+ a && t === e.last && n(e.first), r === void 0 && h(a), i?.(a);
1154
+ }
1155
+ function E(t) {
1156
+ T(!1), n(Math.min(e.last, Math.max(e.first, t)));
1157
+ }
1158
+ let D = k(() => T(!1));
1159
+ ne(() => {
1160
+ let e = matchMedia("(prefers-reduced-motion: reduce)");
1161
+ function t() {
1162
+ e.matches && D();
1163
+ }
1164
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
1165
+ }, []);
1166
+ let O = k(() => t), ie = k((r) => {
1167
+ r !== t && n(r), r === e.last && T(!1);
1168
+ });
1169
+ ne(() => {
1170
+ if (!x) return;
1171
+ let t = performance.now(), n = O(), r = requestAnimationFrame(i);
1172
+ function i(a) {
1173
+ let o = Math.max(0, a - t), s = Math.floor(o * e.hz * g / 1e3), c = Math.min(e.last, n + s);
1174
+ ie(c), c !== e.last && (r = requestAnimationFrame(i));
1175
+ }
1176
+ return () => cancelAnimationFrame(r);
1177
+ }, [
1178
+ e.hz,
1179
+ e.last,
1180
+ x,
1181
+ g
1182
+ ]);
1183
+ let N = e.moments.find((e) => e.tick === t), P = e.moments.filter((e) => e.tick <= t).toSorted((e, t) => t.tick - e.tick)[0];
1184
+ return /* @__PURE__ */ j("div", {
1185
+ ref: y,
1186
+ children: /* @__PURE__ */ M(c, {
1187
+ isCompact: !0,
1188
+ children: [
1189
+ /* @__PURE__ */ j($, {
1190
+ isGuided: u,
1191
+ clip: e,
1192
+ tick: t,
1193
+ isInspecting: s,
1194
+ locale: d,
1195
+ labels: p
1196
+ }),
1197
+ /* @__PURE__ */ j(ee, {
1198
+ label: p.tick,
1199
+ min: e.first,
1200
+ max: e.last,
1201
+ value: t,
1202
+ markers: S,
1203
+ onValueChange: E,
1204
+ onScrubStart: () => T(!1),
1205
+ onMarkerSelect: () => T(!1),
1206
+ formatValue: (e) => C.format(e)
1207
+ }),
1208
+ /* @__PURE__ */ j(w, {
1209
+ isPlaying: v,
1210
+ onPlayingChange: T,
1211
+ speed: g,
1212
+ onSpeedChange: _,
1213
+ onStepBackward: () => E(t - 1),
1214
+ onStepForward: () => E(t + 1),
1215
+ isDisabled: e.first === e.last
1216
+ }),
1217
+ u || e.moments.length === 0 ? null : e.moments.length <= 5 ? /* @__PURE__ */ j(l, { children: e.moments.map((e) => /* @__PURE__ */ j(a, {
1218
+ variant: e === N ? "outline" : "ghost",
1219
+ onClick: () => E(e.tick),
1220
+ children: e.label
1221
+ }, e.id)) }) : /* @__PURE__ */ j(b, {
1222
+ label: p.moment,
1223
+ placeholder: p.moment,
1224
+ items: e.moments.map(({ id: e, label: t, tick: n }) => ({
1225
+ value: e,
1226
+ label: `${C.format(n)} · ${t}`
1227
+ })),
1228
+ value: N?.id ?? null,
1229
+ onValueChange: (t) => {
1230
+ let n = e.moments.find((e) => e.id === t);
1231
+ n !== void 0 && E(n.tick);
1232
+ }
1233
+ }),
1234
+ s && P !== void 0 && /* @__PURE__ */ M(o, {
1235
+ variant: "caption",
1236
+ children: [
1237
+ C.format(P.tick),
1238
+ " · ",
1239
+ P.label,
1240
+ P.detail === void 0 ? "" : ` · ${P.detail}`
1241
+ ]
1242
+ })
1243
+ ]
1244
+ })
1245
+ });
1246
+ }
1247
+ export { ae as FindingCard, Se as LineageGraph, Te as MilestonePath, Ge as MotionFigure, $ as MotionScene, Ae as SpecimenDiff, Pe as WorkHeartbeat, He as motionSceneAt, Le as parseMotionClip };