@superxd-studio/adptr 0.5.0 → 0.6.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 (43) hide show
  1. package/GENERATIVE.md +1 -1
  2. package/README.md +20 -11
  3. package/REUSE.md +11 -1
  4. package/REVIEW.md +2 -2
  5. package/THIRD-PARTY-NOTICES.md +1 -1
  6. package/chunks/{callout-DKMHSnjc.js → callout-B89MDU9m.js} +31 -35
  7. package/chunks/{canvas-BJ15-XxE.js → canvas-Dd78FPe0.js} +9 -9
  8. package/chunks/{text-field-BLtoaZFn.js → text-field-mMHllx03.js} +1 -1
  9. package/chunks/thinking-DlBmZsgc.js +13 -0
  10. package/chunks/{ui-9DyNsYXY.js → ui-WR0qTNm7.js} +309 -260
  11. package/generative/index.js +156 -155
  12. package/interactions/index.js +1073 -499
  13. package/package.json +2 -1
  14. package/source/components/icons.tsx +14 -0
  15. package/source/components/peek.tsx +113 -0
  16. package/source/components/thinking.tsx +13 -2
  17. package/source/reusable/generative/index.tsx +14 -9
  18. package/source/reusable/generative/vocabulary.tsx +4 -2
  19. package/source/reusable/interactions/context.tsx +4 -0
  20. package/source/reusable/interactions/copy.ts +39 -0
  21. package/source/reusable/interactions/gate.tsx +246 -0
  22. package/source/reusable/interactions/index.ts +14 -0
  23. package/source/reusable/interactions/presentation.tsx +4 -1
  24. package/source/reusable/interactions/progress.tsx +240 -0
  25. package/source/reusable/interactions/receipt.tsx +230 -0
  26. package/source/reusable/interactions/run.tsx +206 -0
  27. package/source/reusable/ui/index.ts +1 -0
  28. package/source/reusable/web/review/index.tsx +21 -10
  29. package/source/styles/library.css +56 -0
  30. package/styles.css +1 -1
  31. package/types/components/icons.d.ts +8 -0
  32. package/types/components/peek.d.ts +17 -0
  33. package/types/components/thinking.d.ts +3 -1
  34. package/types/reusable/interactions/context.d.ts +39 -0
  35. package/types/reusable/interactions/copy.d.ts +43 -0
  36. package/types/reusable/interactions/gate.d.ts +39 -0
  37. package/types/reusable/interactions/index.d.ts +8 -0
  38. package/types/reusable/interactions/progress.d.ts +45 -0
  39. package/types/reusable/interactions/receipt.d.ts +54 -0
  40. package/types/reusable/interactions/run.d.ts +83 -0
  41. package/types/reusable/ui/index.d.ts +1 -0
  42. package/ui/index.js +3 -3
  43. package/web/index.js +350 -353
package/web/index.js CHANGED
@@ -1,21 +1,13 @@
1
1
  "use client";
2
2
  import { i as e } from "../chunks/core-BCqVRLUy.js";
3
- import { D as t, O as n, S as r, _ as i, c as a, d as o, n as s, o as c, s as l, t as u, u as d, v as f, w as p, x as m } from "../chunks/callout-DKMHSnjc.js";
4
- import { c as h, d as g, f as _, h as v, l as y, m as b, n as x, p as S, r as C, u as w } from "../chunks/canvas-BJ15-XxE.js";
5
- import { ViewTransition as T, addTransitionType as E, createContext as D, startTransition as O, useEffect as k, useId as A, useLayoutEffect as ee, useRef as j, useState as M, useSyncExternalStore as N } from "react";
6
- import { Button as P, Checkbox as F, Disclosure as I, DisclosurePanel as L, FileTrigger as te, Label as ne, TextArea as re, TextField as ie } from "react-aria-components";
7
- import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
8
- //#region src/components/thinking.tsx
9
- function ae({ className: e }) {
10
- return /* @__PURE__ */ z("span", {
11
- "aria-hidden": "true",
12
- className: n("thinking-matrix", e),
13
- children: Array.from({ length: 9 }, (e, t) => /* @__PURE__ */ z("i", {}, t))
14
- });
15
- }
16
- //#endregion
3
+ import { E as t, M as n, N as r, O as i, T as a, b as o, c as s, l as c, m as l, n as u, o as d, p as f, t as p, u as m, x as h } from "../chunks/callout-B89MDU9m.js";
4
+ import { t as g } from "../chunks/thinking-DlBmZsgc.js";
5
+ import { c as _, d as v, f as y, h as b, l as x, m as S, n as C, p as w, r as T, u as E } from "../chunks/canvas-Dd78FPe0.js";
6
+ import { ViewTransition as D, addTransitionType as O, createContext as k, startTransition as ee, useEffect as A, useId as j, useLayoutEffect as te, useRef as M, useState as N, useSyncExternalStore as P } from "react";
7
+ import { Button as F, Checkbox as I, Disclosure as L, DisclosurePanel as R, FileTrigger as ne, Label as re, TextArea as ie, TextField as ae } from "react-aria-components";
8
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
17
9
  //#region src/reusable/web/attachments/copy.ts
18
- var V = {
10
+ var H = {
19
11
  label: "Attachments",
20
12
  add: "Add files",
21
13
  empty: "No files attached",
@@ -39,41 +31,41 @@ var V = {
39
31
  };
40
32
  //#endregion
41
33
  //#region src/reusable/web/attachments/index.tsx
42
- function H(e) {
43
- return N(e.subscribe, e.getSnapshot, e.getSnapshot);
34
+ function U(e) {
35
+ return P(e.subscribe, e.getSnapshot, e.getSnapshot);
44
36
  }
45
- function U({ items: i, variant: a = "list", className: o, copy: l = V, previewImages: u = !1, onRemove: d, onRetry: p, onCancel: m }) {
46
- return i.length ? /* @__PURE__ */ z("ul", {
47
- "aria-label": l.label,
48
- className: n("min-w-0 list-none p-0", a === "grid" ? "flex flex-wrap gap-3" : a === "inline" ? "flex flex-wrap gap-2" : "flex flex-col gap-2", o),
37
+ function W({ items: i, variant: a = "list", className: o, copy: s = H, previewImages: c = !1, onRemove: l, onRetry: f, onCancel: p }) {
38
+ return i.length ? /* @__PURE__ */ B("ul", {
39
+ "aria-label": s.label,
40
+ className: r("min-w-0 list-none p-0", a === "grid" ? "flex flex-wrap gap-3" : a === "inline" ? "flex flex-wrap gap-2" : "flex flex-col gap-2", o),
49
41
  children: i.map((i) => {
50
- let o = ["image/png", "image/jpeg"].includes(i.mediaType), h;
51
- if (u && o && i.file) try {
52
- h = e(i.file).url;
42
+ let o = ["image/png", "image/jpeg"].includes(i.mediaType), m;
43
+ if (c && o && i.file) try {
44
+ m = e(i.file).url;
53
45
  } catch {}
54
- let g = o ? l.image : ["application/pdf", "text/plain"].includes(i.mediaType) ? l.document : l.file, _ = i.size < 1e3 ? `${i.size} B` : i.size < 1e6 ? `${Math.ceil(i.size / 1e3)} KB` : `${(i.size / 1e6).toFixed(1)} MB`;
55
- return /* @__PURE__ */ B("li", {
56
- className: n("flex min-w-0 flex-wrap gap-3 rounded-control border bg-surface px-control-md-x py-control-y", a === "inline" && "max-w-full", a === "grid" && "max-w-full grow basis-64 flex-col flex-nowrap", ["error", "rejected"].includes(i.status) ? "border-error-line" : "border-line-subtle"),
46
+ let g = o ? s.image : ["application/pdf", "text/plain"].includes(i.mediaType) ? s.document : s.file, _ = i.size < 1e3 ? `${i.size} B` : i.size < 1e6 ? `${Math.ceil(i.size / 1e3)} KB` : `${(i.size / 1e6).toFixed(1)} MB`;
47
+ return /* @__PURE__ */ V("li", {
48
+ className: r("flex min-w-0 flex-wrap gap-3 rounded-control border bg-surface px-control-md-x py-control-y", a === "inline" && "max-w-full", a === "grid" && "max-w-full grow basis-64 flex-col flex-nowrap", ["error", "rejected"].includes(i.status) ? "border-error-line" : "border-line-subtle"),
57
49
  children: [
58
- h ? /* @__PURE__ */ z("img", {
59
- src: h,
50
+ m ? /* @__PURE__ */ B("img", {
51
+ src: m,
60
52
  alt: "",
61
53
  loading: "lazy",
62
54
  referrerPolicy: "no-referrer",
63
- className: n("size-12 shrink-0 rounded-cell object-cover", a === "grid" && "h-32 w-full")
64
- }) : /* @__PURE__ */ z("span", {
55
+ className: r("size-12 shrink-0 rounded-cell object-cover", a === "grid" && "h-32 w-full")
56
+ }) : /* @__PURE__ */ B("span", {
65
57
  className: "flex size-control-sm shrink-0 items-center justify-center rounded-cell bg-surface-muted text-fg-subtle",
66
- children: /* @__PURE__ */ z(f, {})
58
+ children: /* @__PURE__ */ B(h, {})
67
59
  }),
68
- /* @__PURE__ */ B("div", {
69
- className: n("flex min-w-32 flex-1 flex-col gap-1", a === "grid" && "w-full min-w-0"),
60
+ /* @__PURE__ */ V("div", {
61
+ className: r("flex min-w-32 flex-1 flex-col gap-1", a === "grid" && "w-full min-w-0"),
70
62
  children: [
71
- /* @__PURE__ */ z("p", {
63
+ /* @__PURE__ */ B("p", {
72
64
  title: i.name,
73
65
  className: "truncate type-label text-fg-emphasis",
74
66
  children: i.name
75
67
  }),
76
- /* @__PURE__ */ B("p", {
68
+ /* @__PURE__ */ V("p", {
77
69
  className: "type-caption text-fg-subtle",
78
70
  children: [
79
71
  g,
@@ -81,58 +73,58 @@ function U({ items: i, variant: a = "list", className: o, copy: l = V, previewIm
81
73
  _
82
74
  ]
83
75
  }),
84
- /* @__PURE__ */ B("p", {
76
+ /* @__PURE__ */ V("p", {
85
77
  className: "flex items-center gap-2 type-caption text-fg-subtle",
86
- children: [i.status === "uploading" ? /* @__PURE__ */ z(c, {}) : null, l[i.status]]
78
+ children: [i.status === "uploading" ? /* @__PURE__ */ B(d, {}) : null, s[i.status]]
87
79
  }),
88
- i.issue ? /* @__PURE__ */ z("p", {
80
+ i.issue ? /* @__PURE__ */ B("p", {
89
81
  className: "type-caption wrap-anywhere text-error",
90
- children: l[i.issue]
82
+ children: s[i.issue]
91
83
  }) : null
92
84
  ]
93
85
  }),
94
- d || p && ["error", "cancelled"].includes(i.status) || m && i.status === "uploading" ? /* @__PURE__ */ B("div", {
86
+ l || f && ["error", "cancelled"].includes(i.status) || p && i.status === "uploading" ? /* @__PURE__ */ V("div", {
95
87
  className: "ml-auto flex shrink-0 items-start gap-1",
96
88
  children: [
97
- m && i.status === "uploading" ? /* @__PURE__ */ z(s, {
89
+ p && i.status === "uploading" ? /* @__PURE__ */ B(u, {
98
90
  size: "sm",
99
91
  variant: "ghost",
100
- "aria-label": `${l.cancel}: ${i.name}`,
101
- onPress: () => m(i.id),
102
- children: l.cancel
92
+ "aria-label": `${s.cancel}: ${i.name}`,
93
+ onPress: () => p(i.id),
94
+ children: s.cancel
103
95
  }) : null,
104
- p && ["error", "cancelled"].includes(i.status) ? /* @__PURE__ */ z(s, {
96
+ f && ["error", "cancelled"].includes(i.status) ? /* @__PURE__ */ B(u, {
105
97
  size: "icon-sm",
106
98
  variant: "ghost",
107
- "aria-label": `${l.retry}: ${i.name}`,
108
- onPress: () => p(i.id),
109
- children: /* @__PURE__ */ z(r, {})
99
+ "aria-label": `${s.retry}: ${i.name}`,
100
+ onPress: () => f(i.id),
101
+ children: /* @__PURE__ */ B(t, {})
110
102
  }) : null,
111
- d ? /* @__PURE__ */ z(s, {
103
+ l ? /* @__PURE__ */ B(u, {
112
104
  size: "icon-sm",
113
105
  variant: "ghost",
114
- "aria-label": `${l.remove}: ${i.name}`,
115
- onPress: () => d(i.id),
116
- children: /* @__PURE__ */ z(t, {})
106
+ "aria-label": `${s.remove}: ${i.name}`,
107
+ onPress: () => l(i.id),
108
+ children: /* @__PURE__ */ B(n, {})
117
109
  }) : null
118
110
  ]
119
111
  }) : null
120
112
  ]
121
113
  }, i.id);
122
114
  })
123
- }) : /* @__PURE__ */ z("p", {
124
- className: n("type-caption text-fg-subtle", o),
125
- children: l.empty
115
+ }) : /* @__PURE__ */ B("p", {
116
+ className: r("type-caption text-fg-subtle", o),
117
+ children: s.empty
126
118
  });
127
119
  }
128
- function W({ controller: e, isDisabled: t, description: r, copy: i = V, className: a }) {
129
- let o = H(e), c = j(null);
130
- return /* @__PURE__ */ B("div", {
131
- className: n("flex min-w-0 flex-col gap-3", a),
120
+ function oe({ controller: e, isDisabled: t, description: n, copy: i = H, className: o }) {
121
+ let s = U(e), c = M(null);
122
+ return /* @__PURE__ */ V("div", {
123
+ className: r("flex min-w-0 flex-col gap-3", o),
132
124
  children: [
133
- /* @__PURE__ */ B("div", {
125
+ /* @__PURE__ */ V("div", {
134
126
  className: "flex flex-wrap items-center gap-3",
135
- children: [/* @__PURE__ */ z(te, {
127
+ children: [/* @__PURE__ */ B(ne, {
136
128
  acceptedFileTypes: [...e.policy.mediaTypes],
137
129
  allowsMultiple: !0,
138
130
  onSelect: (n) => {
@@ -143,19 +135,19 @@ function W({ controller: e, isDisabled: t, description: r, copy: i = V, classNam
143
135
  data: e
144
136
  })));
145
137
  },
146
- children: /* @__PURE__ */ B(s, {
138
+ children: /* @__PURE__ */ V(u, {
147
139
  ref: c,
148
140
  size: "sm",
149
141
  isDisabled: t,
150
- children: [/* @__PURE__ */ z(m, {}), i.add]
142
+ children: [/* @__PURE__ */ B(a, {}), i.add]
151
143
  })
152
- }), /* @__PURE__ */ z("p", {
144
+ }), /* @__PURE__ */ B("p", {
153
145
  className: "type-caption text-fg-subtle",
154
- children: r
146
+ children: n
155
147
  })]
156
148
  }),
157
- o.items.length ? /* @__PURE__ */ z(U, {
158
- items: o.items,
149
+ s.items.length ? /* @__PURE__ */ B(W, {
150
+ items: s.items,
159
151
  onRemove: (t) => {
160
152
  e.remove(t), c.current?.focus();
161
153
  },
@@ -166,18 +158,18 @@ function W({ controller: e, isDisabled: t, description: r, copy: i = V, classNam
166
158
  e.cancel(t), c.current?.focus();
167
159
  }
168
160
  }) : null,
169
- /* @__PURE__ */ z("p", {
161
+ /* @__PURE__ */ B("p", {
170
162
  role: "status",
171
163
  "aria-live": "polite",
172
- className: n("type-caption text-error", !o.issue && "sr-only"),
173
- children: o.issue ? i[o.issue] : o.items.length ? `${o.items.length} ${i.selected}. ${o.items.map((e) => `${e.name}: ${i[e.status]}`).join(". ")}` : ""
164
+ className: r("type-caption text-error", !s.issue && "sr-only"),
165
+ children: s.issue ? i[s.issue] : s.items.length ? `${s.items.length} ${i.selected}. ${s.items.map((e) => `${e.name}: ${i[e.status]}`).join(". ")}` : ""
174
166
  })
175
167
  ]
176
168
  });
177
169
  }
178
170
  //#endregion
179
171
  //#region src/reusable/web/copy.ts
180
- var oe = {
172
+ var se = {
181
173
  label: "Conversation",
182
174
  emptyTitle: "What are you working on?",
183
175
  emptyNote: "Start with a question, an idea or something you want to make clearer.",
@@ -205,10 +197,10 @@ var oe = {
205
197
  function K(e, t) {
206
198
  return t > e ? G.forward : t < e ? G.back : null;
207
199
  }
208
- function q(e, t, n = O) {
200
+ function q(e, t, n = ee) {
209
201
  if (!e) return t();
210
202
  n(() => {
211
- E(e), t();
203
+ O(e), t();
212
204
  });
213
205
  }
214
206
  var J = (e, t) => ({
@@ -218,21 +210,21 @@ var J = (e, t) => ({
218
210
  default: "none"
219
211
  });
220
212
  function Y({ children: e }) {
221
- return /* @__PURE__ */ z(T, {
213
+ return /* @__PURE__ */ B(D, {
222
214
  default: "none",
223
215
  update: J("flow-card", "flow-card"),
224
216
  children: e
225
217
  });
226
218
  }
227
219
  function X({ children: e }) {
228
- return /* @__PURE__ */ z(T, {
220
+ return /* @__PURE__ */ B(D, {
229
221
  default: "none",
230
222
  enter: J("flow-in", "flow-in-swap"),
231
223
  exit: J("flow-out", "flow-out-swap"),
232
224
  children: e
233
225
  });
234
226
  }
235
- D(null);
227
+ k(null);
236
228
  //#endregion
237
229
  //#region src/reusable/web/review/copy.ts
238
230
  var Z = {
@@ -321,59 +313,59 @@ var Z = {
321
313
  "complete",
322
314
  "denied"
323
315
  ]);
324
- function se(e, t) {
316
+ function ce(e, t) {
325
317
  return $.has(t) ? K(Q[e], Q[t]) : null;
326
318
  }
327
319
  //#endregion
328
320
  //#region src/reusable/web/review/index.tsx
329
- function ce({ change: e, isSelected: t = !1, onSelectionChange: r, isDisabled: i = !1, isApplied: a = !1, isExpanded: s = !0, onExpandedChange: c, comparison: l = "stacked", copy: u = Z }) {
330
- return /* @__PURE__ */ B(I, {
331
- isExpanded: s,
332
- onExpandedChange: c,
333
- className: n("min-w-0 overflow-hidden rounded-surface border bg-surface shadow-control", t ? "border-line-emphasis" : "border-line-subtle"),
334
- children: [/* @__PURE__ */ B("div", {
321
+ function le({ change: e, isSelected: t = !1, onSelectionChange: n, isDisabled: i = !1, isApplied: a = !1, isExpanded: o = !0, onExpandedChange: s, comparison: c = "stacked", copy: u = Z }) {
322
+ return /* @__PURE__ */ V(L, {
323
+ isExpanded: o,
324
+ onExpandedChange: s,
325
+ className: r("min-w-0 overflow-hidden rounded-surface border bg-surface shadow-control", t ? "border-line-emphasis" : "border-line-subtle"),
326
+ children: [/* @__PURE__ */ V("div", {
335
327
  className: "flex min-w-0 items-center gap-3 px-5 py-4",
336
328
  children: [
337
- /* @__PURE__ */ B(F, {
329
+ /* @__PURE__ */ V(I, {
338
330
  isSelected: a || t,
339
- onChange: r,
340
- isDisabled: i || a || !r,
331
+ onChange: n,
332
+ isDisabled: i || a || !n,
341
333
  "aria-label": u.selectChange(e.title),
342
334
  className: "group flex min-h-control-md min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-control type-label text-fg-emphasis outline-none data-disabled:cursor-default data-focus-visible:focus-ring",
343
- children: [/* @__PURE__ */ z("span", {
344
- className: n("grid size-5 shrink-0 place-items-center rounded-control border", t ? "border-brand bg-brand text-on-brand" : "border-line-emphasis bg-surface", a && "border-success-line bg-success-subtle text-success"),
345
- children: a || t ? /* @__PURE__ */ z(d, { className: "size-3.5" }) : null
346
- }), /* @__PURE__ */ z("span", {
335
+ children: [/* @__PURE__ */ B("span", {
336
+ className: r("grid size-5 shrink-0 place-items-center rounded-control border", t ? "border-brand bg-brand text-on-brand" : "border-line-emphasis bg-surface", a && "border-success-line bg-success-subtle text-success"),
337
+ children: a || t ? /* @__PURE__ */ B(f, { className: "size-3.5" }) : null
338
+ }), /* @__PURE__ */ B("span", {
347
339
  className: "min-w-0 break-words",
348
340
  children: e.title
349
341
  })]
350
342
  }),
351
- a ? /* @__PURE__ */ z("span", {
343
+ a ? /* @__PURE__ */ B("span", {
352
344
  className: "rounded-pill bg-success-subtle px-2.5 py-1 type-caption text-success",
353
345
  children: u.applied
354
346
  }) : null,
355
- /* @__PURE__ */ z(P, {
347
+ /* @__PURE__ */ B(F, {
356
348
  slot: "trigger",
357
349
  "aria-label": u.viewChange(e.title),
358
350
  className: "grid size-control-md shrink-0 place-items-center rounded-control text-fg-subtle outline-none data-focus-visible:focus-ring data-hovered:bg-surface-muted",
359
- children: /* @__PURE__ */ z(o, { className: n("transition-transform duration-(--duration-fast) ease-standard", s && "rotate-180") })
351
+ children: /* @__PURE__ */ B(l, { className: r("transition-transform duration-(--duration-fast) ease-standard", o && "rotate-180") })
360
352
  })
361
353
  ]
362
- }), /* @__PURE__ */ B(L, {
354
+ }), /* @__PURE__ */ V(R, {
363
355
  className: "border-t border-line-subtle",
364
- children: [/* @__PURE__ */ B("div", {
365
- className: n("grid min-w-0", l === "columns" && "grid-cols-2"),
366
- children: [/* @__PURE__ */ z(le, {
356
+ children: [/* @__PURE__ */ V("div", {
357
+ className: r("grid min-w-0", c === "columns" && "grid-cols-2"),
358
+ children: [/* @__PURE__ */ B(ue, {
367
359
  label: u.before,
368
360
  muted: !0,
369
361
  children: e.before
370
- }), /* @__PURE__ */ z(le, {
362
+ }), /* @__PURE__ */ B(ue, {
371
363
  label: u.after,
372
364
  children: e.after
373
365
  })]
374
- }), /* @__PURE__ */ B("p", {
366
+ }), /* @__PURE__ */ V("p", {
375
367
  className: "border-t border-line-subtle px-5 py-3 type-caption text-fg-subtle",
376
- children: [/* @__PURE__ */ B("span", {
368
+ children: [/* @__PURE__ */ V("span", {
377
369
  className: "sr-only",
378
370
  children: [u.reason, ": "]
379
371
  }), e.reason]
@@ -381,293 +373,298 @@ function ce({ change: e, isSelected: t = !1, onSelectionChange: r, isDisabled: i
381
373
  })]
382
374
  });
383
375
  }
384
- function le({ label: e, children: t, muted: r = !1 }) {
385
- return /* @__PURE__ */ B("div", {
386
- className: n("min-w-0 px-5 py-4", r ? "bg-surface-muted" : "bg-surface"),
387
- children: [/* @__PURE__ */ z("p", {
376
+ function ue({ label: e, children: t, muted: n = !1 }) {
377
+ return /* @__PURE__ */ V("div", {
378
+ className: r("min-w-0 px-5 py-4", n ? "bg-surface-muted" : "bg-surface"),
379
+ children: [/* @__PURE__ */ B("p", {
388
380
  className: "mb-2 font-mono type-caption text-fg-subtle",
389
381
  children: e
390
- }), /* @__PURE__ */ z("p", {
382
+ }), /* @__PURE__ */ B("p", {
391
383
  className: "type-body break-words text-fg",
392
384
  children: t
393
385
  })]
394
386
  });
395
387
  }
396
- function ue({ snapshot: e, headingLevel: t = 2, onReview: n, onDecline: r, onConfirm: i, onBack: a, onRecover: o, onReload: c, copy: l = Z }) {
397
- let f = t === 2 ? "h2" : "h3", { record: p, decision: m, status: h } = e, g = m?.changeIds ?? e.selectedIds, _ = p?.remainingIds.length ?? 0, v = h === "confirming" || h === "submitting", y = m?.choice === "deny", b = v ? y ? p?.appliedIds.length ? l.declineRemainingTitle : l.denyConfirm : l.confirm : h === "complete" ? l.complete(p?.appliedIds.length ?? 0) : h === "denied" ? l.denied : l.summary, x = h === "ready" || h === "partial", S = h === "complete", C = v ? "confirm" : S || h === "denied" ? "outcome" : "choose";
398
- return /* @__PURE__ */ z(Y, { children: /* @__PURE__ */ z("section", {
388
+ function de({ snapshot: e, headingLevel: t = 2, onReview: n, onDecline: r, onConfirm: i, onBack: a, onRecover: o, onReload: s, copy: l = Z }) {
389
+ let d = t === 2 ? "h2" : "h3", { record: m, decision: h, status: g } = e, _ = h?.changeIds ?? e.selectedIds, v = m?.remainingIds.length ?? 0, y = g === "confirming" || g === "submitting", b = h?.choice === "deny", x = y ? b ? m?.appliedIds.length ? l.declineRemainingTitle : l.denyConfirm : l.confirm : g === "complete" ? l.complete(m?.appliedIds.length ?? 0) : g === "denied" ? l.denied : l.summary, S = g === "ready" || g === "partial", C = g === "complete", w = y ? "confirm" : C || g === "denied" ? "outcome" : "choose";
390
+ return /* @__PURE__ */ B(Y, { children: /* @__PURE__ */ B("section", {
399
391
  "aria-label": l.summary,
400
392
  className: "min-w-0 rounded-surface border border-line-subtle bg-surface p-5",
401
- children: /* @__PURE__ */ z(X, { children: /* @__PURE__ */ B("div", {
393
+ children: /* @__PURE__ */ B(X, { children: /* @__PURE__ */ V("div", {
402
394
  className: "flex min-w-0 flex-col gap-5",
403
395
  children: [
404
- /* @__PURE__ */ B("div", {
396
+ /* @__PURE__ */ V("div", {
405
397
  className: "flex items-center gap-3",
406
- children: [S ? /* @__PURE__ */ z("span", {
398
+ children: [C ? /* @__PURE__ */ B("span", {
407
399
  className: "flex size-8 shrink-0 animate-done-in items-center justify-center rounded-pill bg-done text-on-done",
408
- children: /* @__PURE__ */ z(d, { className: "animate-done-in [animation-delay:var(--duration-pop)]" })
409
- }) : null, /* @__PURE__ */ z(f, {
400
+ children: /* @__PURE__ */ B(f, { className: "animate-done-in [animation-delay:var(--duration-pop)]" })
401
+ }) : null, /* @__PURE__ */ B(d, {
410
402
  tabIndex: -1,
411
403
  "data-review-focus": !0,
412
404
  className: "type-heading text-fg-emphasis outline-none",
413
- children: b
405
+ children: x
414
406
  })]
415
407
  }),
416
- p && !["complete", "denied"].includes(h) ? /* @__PURE__ */ B("div", {
408
+ m && !["complete", "denied"].includes(g) ? /* @__PURE__ */ V("div", {
417
409
  className: "flex min-w-0 flex-col gap-1",
418
- children: [/* @__PURE__ */ z("p", {
410
+ children: [/* @__PURE__ */ B("p", {
419
411
  className: "font-mono type-caption text-fg-subtle",
420
412
  children: l.target
421
- }), /* @__PURE__ */ z("p", {
413
+ }), /* @__PURE__ */ B("p", {
422
414
  className: "type-label break-words text-fg-emphasis",
423
- children: p.proposal.destination
415
+ children: m.proposal.destination
424
416
  })]
425
417
  }) : null,
426
- x || v && !y ? /* @__PURE__ */ B("div", {
418
+ S || y && !b ? /* @__PURE__ */ V("div", {
427
419
  className: "flex flex-col gap-3",
428
420
  children: [
429
- /* @__PURE__ */ z("p", {
421
+ /* @__PURE__ */ B("p", {
430
422
  className: "type-label text-fg-emphasis",
431
- children: l.selected(g.length, _)
423
+ children: l.selected(_.length, v)
432
424
  }),
433
- g.length ? /* @__PURE__ */ z("ul", {
425
+ _.length ? /* @__PURE__ */ B("ul", {
434
426
  className: "flex flex-col gap-2 type-body text-fg",
435
- children: p?.proposal.changes.filter((e) => g.includes(e.id)).map((e) => /* @__PURE__ */ B("li", {
427
+ children: m?.proposal.changes.filter((e) => _.includes(e.id)).map((e) => /* @__PURE__ */ V("li", {
436
428
  className: "flex items-start gap-2",
437
- children: [/* @__PURE__ */ z(d, { className: "mt-0.5" }), /* @__PURE__ */ z("span", {
429
+ children: [/* @__PURE__ */ B(f, { className: "mt-0.5" }), /* @__PURE__ */ B("span", {
438
430
  className: "min-w-0 break-words",
439
431
  children: e.title
440
432
  })]
441
433
  }, e.id))
442
- }) : /* @__PURE__ */ z("p", {
434
+ }) : /* @__PURE__ */ B("p", {
443
435
  className: "type-body text-fg-subtle",
444
436
  children: l.noSelection
445
437
  }),
446
- v ? /* @__PURE__ */ z("p", {
438
+ y ? /* @__PURE__ */ B("p", {
447
439
  className: "type-body text-fg-subtle",
448
440
  children: l.approvalNote
449
441
  }) : null
450
442
  ]
451
443
  }) : null,
452
- v && y ? /* @__PURE__ */ z("p", {
444
+ y && b ? /* @__PURE__ */ B("p", {
453
445
  className: "type-body text-fg-subtle",
454
- children: p?.appliedIds.length ? l.declineRemainingNote : l.denyNote
446
+ children: m?.appliedIds.length ? l.declineRemainingNote : l.denyNote
455
447
  }) : null,
456
- e.issue === "not-applied" ? /* @__PURE__ */ z(u, {
448
+ e.issue === "not-applied" ? /* @__PURE__ */ B(p, {
457
449
  tone: "attention",
458
450
  title: l.notApplied,
459
451
  children: l.notAppliedNote
460
452
  }) : null,
461
- h === "uncertain" || h === "checking" ? /* @__PURE__ */ z(u, {
453
+ g === "uncertain" || g === "checking" ? /* @__PURE__ */ B(p, {
462
454
  tone: "attention",
463
455
  title: l.uncertain,
464
456
  children: l.uncertainNote
465
457
  }) : null,
466
- h === "conflict" ? /* @__PURE__ */ z(u, {
458
+ g === "conflict" ? /* @__PURE__ */ B(p, {
467
459
  tone: "attention",
468
460
  title: l.conflict,
469
461
  children: l.conflictNote
470
462
  }) : null,
471
- h === "blocked" ? /* @__PURE__ */ z(u, {
463
+ g === "blocked" ? /* @__PURE__ */ B(p, {
472
464
  title: l.blocked,
473
465
  children: l.blockedNote
474
466
  }) : null,
475
- h === "partial" ? /* @__PURE__ */ z(u, {
467
+ g === "partial" ? /* @__PURE__ */ B(p, {
476
468
  tone: "attention",
477
- title: l.partial(p?.appliedIds.length ?? 0, _),
469
+ title: l.partial(m?.appliedIds.length ?? 0, v),
478
470
  children: l.partialNote
479
471
  }) : null,
480
- h === "complete" ? /* @__PURE__ */ z(u, {
472
+ g === "complete" ? /* @__PURE__ */ B(p, {
481
473
  tone: "success",
482
- children: l.kept((p?.proposal.changes.length ?? 0) - (p?.appliedIds.length ?? 0))
474
+ children: l.kept((m?.proposal.changes.length ?? 0) - (m?.appliedIds.length ?? 0))
483
475
  }) : null,
484
- h === "denied" ? /* @__PURE__ */ z("p", {
476
+ g === "denied" ? /* @__PURE__ */ B("p", {
485
477
  className: "type-body text-fg-subtle",
486
478
  children: l.deniedNote
487
479
  }) : null,
488
- /* @__PURE__ */ B("div", {
489
- className: "flex flex-col gap-2",
480
+ /* @__PURE__ */ V("div", {
481
+ className: "flex flex-wrap items-center justify-end gap-2",
490
482
  children: [
491
- x ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(s, {
483
+ S ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(u, {
484
+ variant: "secondary",
485
+ onPress: r,
486
+ children: m?.appliedIds.length ? l.declineRemaining : l.deny
487
+ }), /* @__PURE__ */ B(u, {
492
488
  variant: "primary",
493
489
  isDisabled: !e.selectedIds.length,
494
490
  onPress: n,
495
491
  children: l.review(e.selectedIds.length)
496
- }), /* @__PURE__ */ z(s, {
497
- variant: "ghost",
498
- onPress: r,
499
- children: p?.appliedIds.length ? l.declineRemaining : l.deny
500
- })] }) : null,
501
- v ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(s, {
502
- variant: "primary",
503
- isPending: h === "submitting",
504
- pendingLabel: l.applying,
505
- onPress: i,
506
- children: y ? l.denyAction : l.apply(g.length)
507
- }), e.issue === "not-applied" ? /* @__PURE__ */ z(s, {
508
- variant: "secondary",
509
- onPress: o,
510
- children: l.check
511
- }) : /* @__PURE__ */ z(s, {
512
- variant: "ghost",
513
- isDisabled: h === "submitting",
514
- onPress: a,
515
- children: l.back
516
492
  })] }) : null,
517
- h === "uncertain" || h === "checking" ? /* @__PURE__ */ z(s, {
518
- isPending: h === "checking",
493
+ y ? /* @__PURE__ */ V(z, { children: [
494
+ e.issue === "not-applied" ? null : /* @__PURE__ */ V(u, {
495
+ variant: "secondary",
496
+ isDisabled: g === "submitting",
497
+ onPress: a,
498
+ children: [/* @__PURE__ */ B(c, {}), l.back]
499
+ }),
500
+ /* @__PURE__ */ B(u, {
501
+ variant: "primary",
502
+ className: "ml-auto",
503
+ isPending: g === "submitting",
504
+ pendingLabel: l.applying,
505
+ onPress: i,
506
+ children: b ? l.denyAction : l.apply(_.length)
507
+ }),
508
+ e.issue === "not-applied" ? /* @__PURE__ */ B(u, {
509
+ variant: "secondary",
510
+ onPress: o,
511
+ children: l.check
512
+ }) : null
513
+ ] }) : null,
514
+ g === "uncertain" || g === "checking" ? /* @__PURE__ */ B(u, {
515
+ isPending: g === "checking",
519
516
  pendingLabel: l.checking,
520
517
  onPress: o,
521
518
  children: l.check
522
519
  }) : null,
523
- h === "conflict" ? /* @__PURE__ */ z(s, {
524
- onPress: c,
520
+ g === "conflict" ? /* @__PURE__ */ B(u, {
521
+ onPress: s,
525
522
  children: l.reload
526
523
  }) : null
527
524
  ]
528
525
  })
529
526
  ]
530
- }) }, C)
527
+ }) }, w)
531
528
  }) });
532
529
  }
533
- function de(e) {
534
- let t = N(e.subscribe, e.getSnapshot, e.getSnapshot);
535
- return k(() => {
530
+ function fe(e) {
531
+ let t = P(e.subscribe, e.getSnapshot, e.getSnapshot);
532
+ return A(() => {
536
533
  e.load();
537
534
  }, [e]), t;
538
535
  }
539
- function fe(e) {
540
- let [t, n] = M(e.getSnapshot);
541
- return k(() => {
536
+ function pe(e) {
537
+ let [t, n] = N(e.getSnapshot);
538
+ return A(() => {
542
539
  let t = e.getSnapshot(), r = () => {
543
- let r = e.getSnapshot(), i = se(t.status, r.status);
540
+ let r = e.getSnapshot(), i = ce(t.status, r.status);
544
541
  t = r, q(i, () => n(r));
545
542
  }, i = e.subscribe(r);
546
543
  return r(), e.load(), i;
547
544
  }, [e]), t;
548
545
  }
549
- function pe(e) {
550
- return /* @__PURE__ */ z(x, { children: /* @__PURE__ */ z(me, { ...e }) });
546
+ function me(e) {
547
+ return /* @__PURE__ */ B(C, { children: /* @__PURE__ */ B(he, { ...e }) });
551
548
  }
552
- function me({ controller: e, copy: t = Z, className: r }) {
553
- let i = fe(e), a = j(null), o = j(!1), [l, d] = M(!1), [f, p] = M({}), m = A();
554
- k(() => {
549
+ function he({ controller: e, copy: t = Z, className: n }) {
550
+ let i = pe(e), a = M(null), o = M(!1), [s, c] = N(!1), [l, f] = N({}), m = j();
551
+ A(() => {
555
552
  if (!a.current) return;
556
553
  let e = a.current, t = new ResizeObserver(([t]) => {
557
554
  let n = Number.parseFloat(getComputedStyle(document.documentElement).fontSize), r = Number.parseFloat(getComputedStyle(e).getPropertyValue("--breakpoint-md")) || 48;
558
- d((t?.contentRect.width ?? 0) >= r * n);
555
+ c((t?.contentRect.width ?? 0) >= r * n);
559
556
  });
560
557
  return t.observe(e), () => t.disconnect();
561
- }, []), ee(() => {
558
+ }, []), te(() => {
562
559
  o.current && ![
563
560
  "submitting",
564
561
  "checking",
565
562
  "loading"
566
563
  ].includes(i.status) && ((a.current?.contains(document.activeElement) || document.activeElement === document.body) && a.current?.querySelector("[data-review-focus]")?.focus(), o.current = !1);
567
564
  }, [i.status]);
568
- function g(e) {
565
+ function h(e) {
569
566
  e() && (o.current = !0);
570
567
  }
571
- let { record: _, status: v } = i, y = v === "idle" || v === "loading" ? "loading" : v === "load-error" ? "error" : "review", b = [
568
+ let { record: g, status: v } = i, y = v === "idle" || v === "loading" ? "loading" : v === "load-error" ? "error" : "review", b = [
572
569
  "idle",
573
570
  "loading",
574
571
  "submitting",
575
572
  "checking"
576
573
  ].includes(v), x = {
577
- idle: h.loading,
578
- loading: h.loading,
579
- ready: h.review,
580
- confirming: h.confirm,
581
- submitting: h.applying,
582
- checking: h.checking,
583
- "load-error": h.failed,
584
- uncertain: h.uncertain,
585
- conflict: h.conflict,
586
- blocked: h.blocked,
587
- partial: h.partial,
588
- complete: h.complete,
589
- denied: h.denied
574
+ idle: _.loading,
575
+ loading: _.loading,
576
+ ready: _.review,
577
+ confirming: _.confirm,
578
+ submitting: _.applying,
579
+ checking: _.checking,
580
+ "load-error": _.failed,
581
+ uncertain: _.uncertain,
582
+ conflict: _.conflict,
583
+ blocked: _.blocked,
584
+ partial: _.partial,
585
+ complete: _.complete,
586
+ denied: _.denied
590
587
  }[v];
591
- return /* @__PURE__ */ z(C, {
588
+ return /* @__PURE__ */ B(T, {
592
589
  phase: `review-${v}-${i.issue ?? ""}`,
593
- frameClassName: r,
590
+ frameClassName: n,
594
591
  label: x,
595
592
  terminal: v === "complete" || v === "denied",
596
- children: /* @__PURE__ */ B("div", {
593
+ children: /* @__PURE__ */ V("div", {
597
594
  ref: a,
598
- className: n("@container w-full min-w-0 text-fg", r),
595
+ className: r("@container w-full min-w-0 text-fg", n),
599
596
  "aria-busy": b,
600
597
  "data-review-status": v,
601
598
  children: [
602
- /* @__PURE__ */ z("p", {
599
+ /* @__PURE__ */ B("p", {
603
600
  className: "sr-only",
604
601
  role: "status",
605
602
  "aria-live": "polite",
606
603
  children: t.announcement[v]
607
604
  }),
608
- /* @__PURE__ */ B("header", {
605
+ /* @__PURE__ */ V("header", {
609
606
  className: "mb-6 flex flex-col gap-2",
610
- children: [/* @__PURE__ */ z("p", {
607
+ children: [/* @__PURE__ */ B("p", {
611
608
  className: "font-mono type-caption text-fg-subtle",
612
609
  children: t.proposed
613
- }), /* @__PURE__ */ z("h2", {
610
+ }), /* @__PURE__ */ B("h2", {
614
611
  id: m,
615
612
  className: "type-title text-fg-emphasis",
616
- children: _?.proposal.title ?? t.loading
613
+ children: g?.proposal.title ?? t.loading
617
614
  })]
618
615
  }),
619
- /* @__PURE__ */ z(X, { children: /* @__PURE__ */ z("div", {
616
+ /* @__PURE__ */ B(X, { children: /* @__PURE__ */ B("div", {
620
617
  className: "min-w-0",
621
- children: v === "idle" || v === "loading" ? /* @__PURE__ */ B("div", {
618
+ children: v === "idle" || v === "loading" ? /* @__PURE__ */ V("div", {
622
619
  className: "flex min-h-64 items-center justify-center gap-3 rounded-surface border border-line-subtle bg-surface",
623
- children: [/* @__PURE__ */ z(c, {}), /* @__PURE__ */ z("p", {
620
+ children: [/* @__PURE__ */ B(d, {}), /* @__PURE__ */ B("p", {
624
621
  className: "type-body text-fg-subtle",
625
622
  children: t.loadingNote
626
623
  })]
627
- }) : v === "load-error" ? /* @__PURE__ */ z(u, {
624
+ }) : v === "load-error" ? /* @__PURE__ */ B(p, {
628
625
  tone: "error",
629
626
  title: t.loadError,
630
- actions: /* @__PURE__ */ z(s, {
631
- onPress: () => g(e.load),
627
+ actions: /* @__PURE__ */ B(u, {
628
+ onPress: () => h(e.load),
632
629
  children: t.retry
633
630
  }),
634
631
  children: t.loadErrorNote
635
- }) : _ && !_.proposal.changes.length ? /* @__PURE__ */ z(u, {
632
+ }) : g && !g.proposal.changes.length ? /* @__PURE__ */ B(p, {
636
633
  title: t.empty,
637
634
  children: t.emptyNote
638
- }) : /* @__PURE__ */ B("div", {
635
+ }) : /* @__PURE__ */ V("div", {
639
636
  className: "grid min-w-0 items-start gap-6 @3xl:grid-cols-3",
640
- children: [/* @__PURE__ */ z("div", {
637
+ children: [/* @__PURE__ */ B("div", {
641
638
  className: "flex min-w-0 flex-col gap-3 @3xl:col-span-2",
642
- children: /* @__PURE__ */ z("ul", {
639
+ children: /* @__PURE__ */ B("ul", {
643
640
  "aria-labelledby": m,
644
641
  className: "flex min-w-0 flex-col gap-3",
645
- children: _?.proposal.changes.map((n) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ z(ce, {
642
+ children: g?.proposal.changes.map((n) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(le, {
646
643
  change: n,
647
644
  isSelected: i.selectedIds.includes(n.id),
648
- isApplied: _.appliedIds.includes(n.id),
649
- isDisabled: !["ready", "partial"].includes(v) || !_.remainingIds.includes(n.id),
645
+ isApplied: g.appliedIds.includes(n.id),
646
+ isDisabled: !["ready", "partial"].includes(v) || !g.remainingIds.includes(n.id),
650
647
  onSelectionChange: (t) => e.select(n.id, t),
651
- isExpanded: f[n.id] ?? !0,
652
- onExpandedChange: (e) => p((t) => ({
648
+ isExpanded: l[n.id] ?? !0,
649
+ onExpandedChange: (e) => f((t) => ({
653
650
  ...t,
654
651
  [n.id]: e
655
652
  })),
656
- comparison: l ? "columns" : "stacked",
653
+ comparison: s ? "columns" : "stacked",
657
654
  copy: t
658
- }) }, `${_.proposal.id}-${n.id}`))
655
+ }) }, `${g.proposal.id}-${n.id}`))
659
656
  })
660
- }), /* @__PURE__ */ z("div", {
657
+ }), /* @__PURE__ */ B("div", {
661
658
  className: "min-w-0 @3xl:sticky @3xl:top-6",
662
- children: /* @__PURE__ */ z(ue, {
659
+ children: /* @__PURE__ */ B(de, {
663
660
  snapshot: i,
664
661
  headingLevel: 3,
665
- onReview: () => g(() => e.prepare("approve")),
666
- onDecline: () => g(() => e.prepare("deny")),
667
- onConfirm: () => g(e.submit),
668
- onBack: () => g(e.back),
669
- onRecover: () => g(e.recover),
670
- onReload: () => g(e.load),
662
+ onReview: () => h(() => e.prepare("approve")),
663
+ onDecline: () => h(() => e.prepare("deny")),
664
+ onConfirm: () => h(e.submit),
665
+ onBack: () => h(e.back),
666
+ onRecover: () => h(e.recover),
667
+ onReload: () => h(e.load),
671
668
  copy: t
672
669
  })
673
670
  })]
@@ -679,88 +676,88 @@ function me({ controller: e, copy: t = Z, className: r }) {
679
676
  }
680
677
  //#endregion
681
678
  //#region src/reusable/web/index.tsx
682
- function he(e) {
683
- return N(e.subscribe, e.getSnapshot, e.getSnapshot);
679
+ function ge(e) {
680
+ return P(e.subscribe, e.getSnapshot, e.getSnapshot);
684
681
  }
685
- function ge({ snapshot: e, actions: t, copy: o = oe, className: c, renderMessage: d, footer: f, attachmentPicker: m, draftFiles: h = [], isAttachmentBlocked: x = !1, onSent: C, messageCopy: w = v, writeText: T, scrollable: E = !1, autoScroll: D = !0, suggestions: O = [], defaultDraft: k = "", defaultEditing: N }) {
686
- let [P, F] = M(k), [I, L] = M(N), [te, R] = M(!1), V = j(null), H = j(null), W = j(D), [G, K] = M(!1);
687
- ee(() => {
688
- E && D && W.current && H.current && (H.current.scrollTop = H.current.scrollHeight);
682
+ function _e({ snapshot: e, actions: n, copy: a = se, className: c, renderMessage: l, footer: d, attachmentPicker: f, draftFiles: h = [], isAttachmentBlocked: _ = !1, onSent: C, messageCopy: T = b, writeText: E, scrollable: D = !1, autoScroll: O = !0, suggestions: k = [], defaultDraft: ee = "", defaultEditing: A }) {
683
+ let [P, F] = N(ee), [I, L] = N(A), [R, ne] = N(!1), z = M(null), H = M(null), U = M(O), [oe, G] = N(!1);
684
+ te(() => {
685
+ D && O && U.current && H.current && (H.current.scrollTop = H.current.scrollHeight);
689
686
  }, [
690
687
  e.messages,
691
688
  e.status,
692
- E,
693
- D
689
+ D,
690
+ O
694
691
  ]);
695
- let q = () => {
696
- W.current = !0, K(!1), H.current && (H.current.scrollTop = H.current.scrollHeight);
697
- }, J = () => V.current?.querySelector("[data-chat-composer] textarea")?.focus({ preventScroll: !0 }), Y = () => {
698
- L(void 0), window.requestAnimationFrame(J);
699
- }, X = A(), Z = A(), Q = e.status === "waiting" || e.status === "streaming", $ = [
692
+ let K = () => {
693
+ U.current = !0, G(!1), H.current && (H.current.scrollTop = H.current.scrollHeight);
694
+ }, q = () => z.current?.querySelector("[data-chat-composer] textarea")?.focus({ preventScroll: !0 }), J = () => {
695
+ L(void 0), window.requestAnimationFrame(q);
696
+ }, Y = j(), X = j(), Z = e.status === "waiting" || e.status === "streaming", Q = [
700
697
  "error",
701
698
  "interrupted",
702
699
  "cancelled"
703
- ].includes(e.status), se = () => {
704
- x || Q || t.send(P, h) && (F(""), q(), C?.());
700
+ ].includes(e.status), $ = () => {
701
+ _ || Z || n.send(P, h) && (F(""), K(), C?.());
705
702
  };
706
- return /* @__PURE__ */ B("section", {
707
- ref: V,
708
- "aria-labelledby": X,
709
- className: n("relative flex min-w-0 flex-col gap-6 rounded-surface bg-surface p-4 sm:p-6", E && "h-conversation", c),
703
+ return /* @__PURE__ */ V("section", {
704
+ ref: z,
705
+ "aria-labelledby": Y,
706
+ className: r("relative flex min-w-0 flex-col gap-6 rounded-surface bg-surface p-4 sm:p-6", D && "h-conversation", c),
710
707
  children: [
711
- /* @__PURE__ */ z("h2", {
712
- id: X,
708
+ /* @__PURE__ */ B("h2", {
709
+ id: Y,
713
710
  className: "sr-only",
714
- children: o.label
711
+ children: a.label
715
712
  }),
716
- /* @__PURE__ */ z("div", {
713
+ /* @__PURE__ */ B("div", {
717
714
  ref: H,
718
- role: E ? "region" : void 0,
719
- "aria-label": E ? `${w.transcript}: ${o.label}` : void 0,
720
- tabIndex: E ? 0 : void 0,
715
+ role: D ? "region" : void 0,
716
+ "aria-label": D ? `${T.transcript}: ${a.label}` : void 0,
717
+ tabIndex: D ? 0 : void 0,
721
718
  onScroll: () => {
722
719
  let e = H.current;
723
720
  if (!e) return;
724
721
  let t = e.scrollHeight - e.scrollTop - e.clientHeight < 24;
725
- W.current = t, K(!t);
722
+ U.current = t, G(!t);
726
723
  },
727
- className: n("min-w-0", E && "min-h-0 flex-1 overflow-x-hidden overflow-y-auto rounded-cell outline-none focus-visible:focus-ring"),
728
- children: e.messages.length ? /* @__PURE__ */ z("ol", {
724
+ className: r("min-w-0", D && "min-h-0 flex-1 overflow-x-hidden overflow-y-auto rounded-cell outline-none focus-visible:focus-ring"),
725
+ children: e.messages.length ? /* @__PURE__ */ B("ol", {
729
726
  className: "flex min-w-0 list-none flex-col gap-6 p-0",
730
- children: e.messages.map((a, c) => /* @__PURE__ */ B("li", {
731
- "aria-label": a.role === "user" ? o.user : o.assistant,
727
+ children: e.messages.map((i, s) => /* @__PURE__ */ V("li", {
728
+ "aria-label": i.role === "user" ? a.user : a.assistant,
732
729
  className: "flex min-w-0 flex-col gap-2",
733
730
  children: [
734
- /* @__PURE__ */ z("p", {
731
+ /* @__PURE__ */ B("p", {
735
732
  className: "font-mono type-caption text-fg-subtle",
736
- children: a.role === "user" ? o.user : o.assistant
733
+ children: i.role === "user" ? a.user : a.assistant
737
734
  }),
738
- I === a.id && t.edit ? /* @__PURE__ */ z(_, {
739
- autoFocus: te,
740
- text: a.text,
741
- hasFiles: !!a.files?.length,
742
- isDisabled: Q,
743
- onCancel: Y,
744
- copy: w,
735
+ I === i.id && n.edit ? /* @__PURE__ */ B(y, {
736
+ autoFocus: R,
737
+ text: i.text,
738
+ hasFiles: !!i.files?.length,
739
+ isDisabled: Z,
740
+ onCancel: J,
741
+ copy: T,
745
742
  onSave: (e) => {
746
- let n = t.edit?.(a.id, e) ?? !1;
747
- return n && (Y(), q()), n;
743
+ let t = n.edit?.(i.id, e) ?? !1;
744
+ return t && (J(), K()), t;
748
745
  }
749
- }) : /* @__PURE__ */ B("div", {
750
- className: n("min-w-0 type-body wrap-anywhere whitespace-pre-wrap text-fg-emphasis", a.role === "user" && "self-end rounded-surface bg-surface-muted px-control-md-x py-control-y"),
751
- children: [d ? d(a) : a.role === "assistant" && e.status === "streaming" && c === e.messages.length - 1 ? /* @__PURE__ */ z(b, {
752
- text: a.text,
753
- copy: w,
754
- writeText: T
755
- }) : a.role === "assistant" ? /* @__PURE__ */ z(S, {
756
- text: a.text,
757
- isStreaming: Q,
758
- copy: w,
759
- writeText: T
760
- }) : a.text, a.role === "assistant" && !a.text && Q ? /* @__PURE__ */ z(ae, {}) : null]
746
+ }) : /* @__PURE__ */ V("div", {
747
+ className: r("min-w-0 type-body wrap-anywhere whitespace-pre-wrap text-fg-emphasis", i.role === "user" && "self-end rounded-surface bg-surface-muted px-control-md-x py-control-y"),
748
+ children: [l ? l(i) : i.role === "assistant" && e.status === "streaming" && s === e.messages.length - 1 ? /* @__PURE__ */ B(S, {
749
+ text: i.text,
750
+ copy: T,
751
+ writeText: E
752
+ }) : i.role === "assistant" ? /* @__PURE__ */ B(w, {
753
+ text: i.text,
754
+ isStreaming: Z,
755
+ copy: T,
756
+ writeText: E
757
+ }) : i.text, i.role === "assistant" && !i.text && Z ? /* @__PURE__ */ B(g, {}) : null]
761
758
  }),
762
- a.files?.length ? /* @__PURE__ */ z(U, {
763
- items: a.files.map((e) => ({
759
+ i.files?.length ? /* @__PURE__ */ B(W, {
760
+ items: i.files.map((e) => ({
764
761
  id: e.id,
765
762
  name: e.name,
766
763
  mediaType: e.mediaType,
@@ -770,73 +767,73 @@ function ge({ snapshot: e, actions: t, copy: o = oe, className: c, renderMessage
770
767
  })),
771
768
  variant: "inline"
772
769
  }) : null,
773
- I === a.id ? null : /* @__PURE__ */ B("div", {
770
+ I === i.id ? null : /* @__PURE__ */ V("div", {
774
771
  className: "flex min-w-0 flex-wrap items-center gap-1",
775
772
  children: [
776
- a.role === "assistant" && a.text ? /* @__PURE__ */ z(g, {
777
- text: a.text,
773
+ i.role === "assistant" && i.text ? /* @__PURE__ */ B(v, {
774
+ text: i.text,
778
775
  iconOnly: !0,
779
- isDisabled: Q,
780
- copy: w,
781
- writeText: T
776
+ isDisabled: Z,
777
+ copy: T,
778
+ writeText: E
782
779
  }) : null,
783
- a.role === "user" && e.capabilities.edit && t.edit ? /* @__PURE__ */ z(s, {
780
+ i.role === "user" && e.capabilities.edit && n.edit ? /* @__PURE__ */ B(u, {
784
781
  size: "icon-sm",
785
782
  variant: "ghost",
786
- "aria-label": w.edit,
787
- isDisabled: Q,
783
+ "aria-label": T.edit,
784
+ isDisabled: Z,
788
785
  onPress: () => {
789
- R(!0), L(a.id);
786
+ ne(!0), L(i.id);
790
787
  },
791
- children: /* @__PURE__ */ z(i, {})
788
+ children: /* @__PURE__ */ B(o, {})
792
789
  }) : null,
793
- a.role === "assistant" && e.capabilities.regenerate && t.regenerate ? /* @__PURE__ */ z(s, {
790
+ i.role === "assistant" && e.capabilities.regenerate && n.regenerate ? /* @__PURE__ */ B(u, {
794
791
  size: "icon-sm",
795
792
  variant: "ghost",
796
- "aria-label": w.regenerate,
797
- isDisabled: Q,
793
+ "aria-label": T.regenerate,
794
+ isDisabled: Z,
798
795
  onPress: () => {
799
- t.regenerate?.(a.id) && (J(), q());
796
+ n.regenerate?.(i.id) && (q(), K());
800
797
  },
801
- children: /* @__PURE__ */ z(r, {})
798
+ children: /* @__PURE__ */ B(t, {})
802
799
  }) : null,
803
- e.capabilities.branches && e.branches?.[a.id] && t.selectBranch ? /* @__PURE__ */ z(y, {
804
- branch: e.branches[a.id] ?? {
800
+ e.capabilities.branches && e.branches?.[i.id] && n.selectBranch ? /* @__PURE__ */ B(x, {
801
+ branch: e.branches[i.id] ?? {
805
802
  index: 0,
806
803
  count: 0
807
804
  },
808
- isDisabled: Q,
809
- copy: w,
805
+ isDisabled: Z,
806
+ copy: T,
810
807
  onPrevious: () => {
811
- t.selectBranch?.(a.id, "previous") && J();
808
+ n.selectBranch?.(i.id, "previous") && q();
812
809
  },
813
810
  onNext: () => {
814
- t.selectBranch?.(a.id, "next") && J();
811
+ n.selectBranch?.(i.id, "next") && q();
815
812
  }
816
813
  }) : null
817
814
  ]
818
815
  })
819
816
  ]
820
- }, a.id))
821
- }) : /* @__PURE__ */ B("div", {
817
+ }, i.id))
818
+ }) : /* @__PURE__ */ V("div", {
822
819
  className: "flex min-h-48 flex-col items-center justify-center gap-2 text-center",
823
820
  children: [
824
- /* @__PURE__ */ z("h3", {
821
+ /* @__PURE__ */ B("h3", {
825
822
  className: "type-heading text-fg-emphasis",
826
- children: o.emptyTitle
823
+ children: a.emptyTitle
827
824
  }),
828
- /* @__PURE__ */ z("p", {
825
+ /* @__PURE__ */ B("p", {
829
826
  className: "max-w-sm type-body text-fg-subtle",
830
- children: o.emptyNote
827
+ children: a.emptyNote
831
828
  }),
832
- O.length ? /* @__PURE__ */ z("div", {
829
+ k.length ? /* @__PURE__ */ B("div", {
833
830
  className: "mt-3 flex flex-wrap justify-center gap-2",
834
- children: O.map((t) => /* @__PURE__ */ z(s, {
831
+ children: k.map((t) => /* @__PURE__ */ B(u, {
835
832
  size: "sm",
836
833
  isDisabled: !e.capabilities.send,
837
834
  className: "h-auto min-h-control-sm max-w-full py-2 whitespace-normal",
838
835
  onPress: () => {
839
- F(t), window.requestAnimationFrame(J);
836
+ F(t), window.requestAnimationFrame(q);
840
837
  },
841
838
  children: t
842
839
  }, t))
@@ -844,88 +841,88 @@ function ge({ snapshot: e, actions: t, copy: o = oe, className: c, renderMessage
844
841
  ]
845
842
  })
846
843
  }),
847
- E && G ? /* @__PURE__ */ B(s, {
844
+ D && oe ? /* @__PURE__ */ V(u, {
848
845
  size: "sm",
849
846
  className: "self-center shadow-control",
850
847
  onPress: () => {
851
- q(), J();
848
+ K(), q();
852
849
  },
853
- children: [/* @__PURE__ */ z(l, {}), w.latest]
850
+ children: [/* @__PURE__ */ B(s, {}), T.latest]
854
851
  }) : null,
855
- /* @__PURE__ */ B("p", {
852
+ /* @__PURE__ */ V("p", {
856
853
  role: "status",
857
854
  "aria-live": "polite",
858
- className: n("flex items-center gap-2 font-mono type-caption text-fg-subtle", $ && "sr-only"),
859
- children: [e.status === "complete" ? /* @__PURE__ */ z("span", {
855
+ className: r("flex items-center gap-2 font-mono type-caption text-fg-subtle", Q && "sr-only"),
856
+ children: [e.status === "complete" ? /* @__PURE__ */ B("span", {
860
857
  "aria-hidden": "true",
861
858
  className: "size-1.5 shrink-0 rounded-pill bg-done"
862
- }) : null, o[e.status]]
859
+ }) : null, a[e.status]]
863
860
  }),
864
- e.capabilities.attachments ? m : null,
865
- $ ? /* @__PURE__ */ z(u, {
861
+ e.capabilities.attachments ? f : null,
862
+ Q ? /* @__PURE__ */ B(p, {
866
863
  tone: e.status === "cancelled" ? "neutral" : "attention",
867
- actions: e.capabilities.retry ? /* @__PURE__ */ z(s, {
864
+ actions: e.capabilities.retry ? /* @__PURE__ */ B(u, {
868
865
  size: "sm",
869
866
  onPress: () => {
870
- t.retry() && J();
867
+ n.retry() && q();
871
868
  },
872
- children: o.retry
869
+ children: a.retry
873
870
  }) : void 0,
874
- children: o[e.status]
871
+ children: a[e.status]
875
872
  }) : null,
876
- /* @__PURE__ */ B("div", {
873
+ /* @__PURE__ */ V("div", {
877
874
  "data-chat-composer": !0,
878
875
  className: "conversation-composer min-w-0 rounded-surface border border-line-input bg-surface shadow-control focus-within:border-line-emphasis has-data-focus-visible:border-focus has-data-focus-visible:ring-2 has-data-focus-visible:ring-focus/15",
879
- children: [/* @__PURE__ */ B(ie, {
876
+ children: [/* @__PURE__ */ V(ae, {
880
877
  value: P,
881
878
  onChange: F,
882
879
  isDisabled: !e.capabilities.send || !!I,
883
880
  className: "min-w-0",
884
- children: [/* @__PURE__ */ z(ne, {
881
+ children: [/* @__PURE__ */ B(re, {
885
882
  className: "sr-only",
886
- children: o.input
887
- }), /* @__PURE__ */ z(re, {
883
+ children: a.input
884
+ }), /* @__PURE__ */ B(ie, {
888
885
  rows: 3,
889
886
  maxLength: 2e4,
890
- "aria-describedby": Z,
891
- placeholder: o.placeholder,
887
+ "aria-describedby": X,
888
+ placeholder: a.placeholder,
892
889
  className: "max-h-48 min-h-24 w-full resize-none rounded-surface bg-transparent px-control-md-x pt-control-y pb-2 type-body text-fg-emphasis outline-none placeholder:text-fg-subtle",
893
890
  onKeyDown: (e) => {
894
- e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && !window.matchMedia("(pointer: coarse)").matches && (e.preventDefault(), !Q && !I && se());
891
+ e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && !window.matchMedia("(pointer: coarse)").matches && (e.preventDefault(), !Z && !I && $());
895
892
  }
896
893
  })]
897
- }), /* @__PURE__ */ B("div", {
894
+ }), /* @__PURE__ */ V("div", {
898
895
  className: "flex flex-wrap items-center justify-between gap-3 px-3 pb-3",
899
- children: [/* @__PURE__ */ B("p", {
900
- id: Z,
896
+ children: [/* @__PURE__ */ V("p", {
897
+ id: X,
901
898
  className: "conversation-key-hint type-caption text-fg-subtle",
902
- children: [/* @__PURE__ */ z("span", {
899
+ children: [/* @__PURE__ */ B("span", {
903
900
  className: "conversation-desktop-hint",
904
- children: o.hint
905
- }), /* @__PURE__ */ z("span", {
901
+ children: a.hint
902
+ }), /* @__PURE__ */ B("span", {
906
903
  className: "conversation-touch-hint",
907
- children: o.touchHint
904
+ children: a.touchHint
908
905
  })]
909
- }), Q && e.capabilities.cancel ? /* @__PURE__ */ B(s, {
906
+ }), Z && e.capabilities.cancel ? /* @__PURE__ */ V(u, {
910
907
  size: "sm",
911
908
  className: "ml-auto",
912
909
  onPress: () => {
913
- t.cancel(), J();
910
+ n.cancel(), q();
914
911
  },
915
- children: [/* @__PURE__ */ z(p, {}), o.stop]
916
- }) : /* @__PURE__ */ B(s, {
912
+ children: [/* @__PURE__ */ B(i, {}), a.stop]
913
+ }) : /* @__PURE__ */ V(u, {
917
914
  variant: "primary",
918
915
  className: "ml-auto",
919
916
  size: "sm",
920
- isDisabled: Q || !!I || x || !P.trim() && !h.length || !e.capabilities.send,
921
- onPress: se,
922
- children: [/* @__PURE__ */ z(a, {}), o.send]
917
+ isDisabled: Z || !!I || _ || !P.trim() && !h.length || !e.capabilities.send,
918
+ onPress: $,
919
+ children: [/* @__PURE__ */ B(m, {}), a.send]
923
920
  })]
924
921
  })]
925
922
  }),
926
- f
923
+ d
927
924
  ]
928
925
  });
929
926
  }
930
927
  //#endregion
931
- export { U as AttachmentList, W as AttachmentPicker, y as BranchPicker, ge as Chat, w as CodeBlock, g as CopyButton, pe as DraftReview, _ as MessageEditor, S as MessageMarkdown, ce as ReviewChangeCard, ue as ReviewDecisionPanel, b as StreamingMessage, V as attachmentCopy, v as messageCopy, Z as reviewCopy, H as useAttachments, he as useChatController, de as useReview };
928
+ export { W as AttachmentList, oe as AttachmentPicker, x as BranchPicker, _e as Chat, E as CodeBlock, v as CopyButton, me as DraftReview, y as MessageEditor, w as MessageMarkdown, le as ReviewChangeCard, de as ReviewDecisionPanel, S as StreamingMessage, H as attachmentCopy, b as messageCopy, Z as reviewCopy, U as useAttachments, ge as useChatController, fe as useReview };