@action-state-group/capsule-viewer 0.1.0 → 0.4.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 (102) hide show
  1. package/README.md +74 -2
  2. package/dist/alias-interpreters.d.ts +18 -0
  3. package/dist/alias-interpreters.js +50 -0
  4. package/dist/alias-interpreters.js.map +1 -0
  5. package/dist/browser.d.ts +5 -2
  6. package/dist/browser.js +19 -5
  7. package/dist/browser.js.map +1 -1
  8. package/dist/builtin-manifests.d.ts +51 -0
  9. package/dist/builtin-manifests.js +196 -0
  10. package/dist/builtin-manifests.js.map +1 -0
  11. package/dist/chart-dataset.d.ts +23 -0
  12. package/dist/chart-dataset.js +191 -0
  13. package/dist/chart-dataset.js.map +1 -0
  14. package/dist/chart-spec.d.ts +130 -0
  15. package/dist/chart-spec.js +638 -0
  16. package/dist/chart-spec.js.map +1 -0
  17. package/dist/chart-view.d.ts +27 -0
  18. package/dist/chart-view.js +374 -0
  19. package/dist/chart-view.js.map +1 -0
  20. package/dist/compliance-styles.d.ts +1 -8
  21. package/dist/compliance-styles.js +40 -3
  22. package/dist/compliance-styles.js.map +1 -1
  23. package/dist/compliance-view.d.ts +41 -1
  24. package/dist/compliance-view.js +773 -303
  25. package/dist/compliance-view.js.map +1 -1
  26. package/dist/compliance.d.ts +33 -4
  27. package/dist/compliance.js +92 -13
  28. package/dist/compliance.js.map +1 -1
  29. package/dist/composed-styles.d.ts +12 -0
  30. package/dist/composed-styles.js +20 -0
  31. package/dist/composed-styles.js.map +1 -0
  32. package/dist/composed-view.d.ts +1 -1
  33. package/dist/composed-view.js +9 -2
  34. package/dist/composed-view.js.map +1 -1
  35. package/dist/contract-report-wording.d.ts +195 -0
  36. package/dist/contract-report-wording.js +1177 -0
  37. package/dist/contract-report-wording.js.map +1 -0
  38. package/dist/contract-report.d.ts +92 -0
  39. package/dist/contract-report.js +63 -0
  40. package/dist/contract-report.js.map +1 -0
  41. package/dist/core-strip.d.ts +38 -0
  42. package/dist/core-strip.js +183 -0
  43. package/dist/core-strip.js.map +1 -0
  44. package/dist/emitter-shell.html +181 -3
  45. package/dist/emitter.d.ts +36 -0
  46. package/dist/emitter.js +77 -4
  47. package/dist/emitter.js.map +1 -1
  48. package/dist/evidence-graph-view.d.ts +66 -7
  49. package/dist/evidence-graph-view.js +1483 -127
  50. package/dist/evidence-graph-view.js.map +1 -1
  51. package/dist/evidence-graph.iife.js +17741 -6812
  52. package/dist/frame-tokens.generated.d.ts +3 -0
  53. package/dist/frame-tokens.generated.js +5 -0
  54. package/dist/frame-tokens.generated.js.map +1 -0
  55. package/dist/index.d.ts +3 -0
  56. package/dist/index.js +5 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/outcome-report-presentation.d.ts +48 -0
  59. package/dist/outcome-report-presentation.js +90 -0
  60. package/dist/outcome-report-presentation.js.map +1 -0
  61. package/dist/outcome-report-styles.d.ts +1 -16
  62. package/dist/outcome-report-styles.js +48 -45
  63. package/dist/outcome-report-styles.js.map +1 -1
  64. package/dist/outcome-report-view.d.ts +75 -2
  65. package/dist/outcome-report-view.js +1063 -436
  66. package/dist/outcome-report-view.js.map +1 -1
  67. package/dist/presentation-builder.d.ts +70 -6
  68. package/dist/presentation-builder.js +198 -70
  69. package/dist/presentation-builder.js.map +1 -1
  70. package/dist/presentation-fragment.d.ts +129 -0
  71. package/dist/presentation-fragment.js +213 -0
  72. package/dist/presentation-fragment.js.map +1 -0
  73. package/dist/presentation-mount.d.ts +4 -2
  74. package/dist/presentation-mount.js +2 -1
  75. package/dist/presentation-mount.js.map +1 -1
  76. package/dist/presentation-registry.d.ts +277 -0
  77. package/dist/presentation-registry.js +416 -0
  78. package/dist/presentation-registry.js.map +1 -0
  79. package/dist/record-content.d.ts +68 -0
  80. package/dist/record-content.js +153 -0
  81. package/dist/record-content.js.map +1 -0
  82. package/dist/record-dating.d.ts +10 -0
  83. package/dist/record-dating.js +76 -0
  84. package/dist/record-dating.js.map +1 -0
  85. package/dist/report-front-styles.d.ts +9 -0
  86. package/dist/report-front-styles.js +43 -0
  87. package/dist/report-front-styles.js.map +1 -0
  88. package/dist/report-front.d.ts +56 -0
  89. package/dist/report-front.js +140 -0
  90. package/dist/report-front.js.map +1 -0
  91. package/dist/report-levels.d.ts +238 -0
  92. package/dist/report-levels.js +874 -0
  93. package/dist/report-levels.js.map +1 -0
  94. package/dist/report-provenance.d.ts +111 -0
  95. package/dist/report-provenance.js +535 -0
  96. package/dist/report-provenance.js.map +1 -0
  97. package/dist/viewer-build.d.ts +37 -0
  98. package/dist/viewer-build.js +29 -0
  99. package/dist/viewer-build.js.map +1 -0
  100. package/dist/wording/contract-report-eu-ai-act.en.json +319 -0
  101. package/dist/wording/contract-report-outcomes.en.json +418 -0
  102. package/package.json +6 -3
@@ -0,0 +1,874 @@
1
+ // SPDX-License-Identifier: BSD-3-Clause
2
+ import { parseJudgeProbabilities, } from "@action-state-group/agent-action-capsule";
3
+ /**
4
+ * The two levels every human-facing report card has, and nothing deeper:
5
+ *
6
+ * summary -- what was checked and the result per rule, in plain words
7
+ * level 1 -- toggle: the conversations behind a line, listed in place,
8
+ * each one readable as it stands (its result, what the user
9
+ * and the agent said, which tools it called); a conversation
10
+ * is never a toggle of its own
11
+ * level 2 -- toggle: the proofs for one conversation (record ids,
12
+ * digests, judge pin, how to recompute)
13
+ *
14
+ * There is no third level: a reader toggles once to see the conversations
15
+ * and the tools, toggles again for one conversation's proofs, and that is
16
+ * all. No <details> ever sits inside more than one other <details>, and a
17
+ * level-1 toggle never holds another level-1 toggle.
18
+ *
19
+ * Shared by both groupings of the contract-report module (contract-report.ts:
20
+ * outcome-report-view.ts and compliance-view.ts). Everything here draws only
21
+ * from values the callers already read from the verified bundle; it reads
22
+ * nothing itself. Its words come from the card's wording pack (`Words`).
23
+ * Toggles are native <details> (keyboard-accessible, no script-driven modal);
24
+ * a toggle's body is built the first time it is opened, and inside an open
25
+ * level-1 toggle each conversation's body is built when it scrolls near the
26
+ * view (`lazyBody`), so a month of conversations does not multiply the
27
+ * page's DOM for content nobody read. A page that runs no script has every
28
+ * body built before it is written (`fillForNoScript`).
29
+ */
30
+ function element(tag, text) {
31
+ const value = document.createElement(tag);
32
+ if (text !== undefined)
33
+ value.textContent = text;
34
+ return value;
35
+ }
36
+ function el(tag, className, text) {
37
+ const value = element(tag, text);
38
+ value.className = className;
39
+ return value;
40
+ }
41
+ // ---------------------------------------------------------------------------
42
+ // Toggles
43
+ // ---------------------------------------------------------------------------
44
+ /**
45
+ * A level-1 or level-2 toggle. `summary` is what the closed toggle says;
46
+ * `build` makes the body on first open (or at once with `eager`).
47
+ */
48
+ export function levelToggle(level, summary, build, options = {}) {
49
+ const details = document.createElement("details");
50
+ details.className = `lv lv${level}${options.className === undefined ? "" : ` ${options.className}`}`;
51
+ details.dataset.level = String(level);
52
+ const head = document.createElement("summary");
53
+ if (typeof summary === "string")
54
+ head.textContent = summary;
55
+ else
56
+ head.append(summary);
57
+ details.append(head);
58
+ deferBody(details, build, options.eager === true);
59
+ return details;
60
+ }
61
+ /**
62
+ * A <details> whose body is built the first time it opens, or at once with
63
+ * `eager`, into the toggle itself or into `into` (a table row's detail cell). Until then it is marked `data-body="pending"`, and
64
+ * `fillPendingBodies` can build it without opening it.
65
+ */
66
+ export function deferBody(details, build, eager = false, into = details) {
67
+ const fill = () => {
68
+ if (details.dataset.body !== "pending")
69
+ return;
70
+ pendingToggles.delete(details);
71
+ details.dataset.body = "built";
72
+ into.append(build());
73
+ openBuiltToDepth(into);
74
+ };
75
+ details.dataset.body = "pending";
76
+ if (eager) {
77
+ fill();
78
+ return;
79
+ }
80
+ pendingToggles.set(details, fill);
81
+ details.addEventListener("toggle", () => {
82
+ if (details.open)
83
+ fill();
84
+ });
85
+ }
86
+ /** Each toggle's pending fill, keyed weakly by the toggle. */
87
+ const pendingToggles = new WeakMap();
88
+ /**
89
+ * Builds every body under `root` that `selector` names and is still
90
+ * pending -- toggle bodies and conversation bodies alike, and the ones those
91
+ * bodies bring -- leaving every toggle open or closed as it was. The static
92
+ * package builds every body this way (`fillForNoScript`), so a toggle a
93
+ * reader opens on a page that runs no script is not empty. Returns how
94
+ * many bodies it built.
95
+ */
96
+ export function fillPendingBodies(root, selector = '[data-body="pending"]') {
97
+ let built = 0;
98
+ for (;;) {
99
+ const pending = [...root.querySelectorAll(selector)];
100
+ const fills = pending
101
+ .map((host) => host.localName === "details"
102
+ ? pendingToggles.get(host)
103
+ : pendingBodies.get(host))
104
+ .filter((fill) => fill !== undefined);
105
+ if (fills.length === 0)
106
+ return built;
107
+ for (const fill of fills)
108
+ fill();
109
+ built += fills.length;
110
+ }
111
+ }
112
+ /**
113
+ * For a page that runs no script (the static package,
114
+ * presentation-builder.ts): builds every body still pending under `root`,
115
+ * and the ones those bodies bring, so opening any toggle shows what it
116
+ * shows where script runs (capsule-viewer#67). Each conversation is kept
117
+ * once, in the core's records section: a card's conversation becomes a
118
+ * link to it (`linkConversations`), including the conversations a body
119
+ * brings when it is built. Every toggle stays open or closed as it was,
120
+ * except where the host opened a region to L2, as on the scripted page.
121
+ * Returns how many bodies it built; a body with no fill registered here
122
+ * stays pending, for the caller to report.
123
+ */
124
+ export function fillForNoScript(root) {
125
+ let built = 0;
126
+ for (;;) {
127
+ linkConversations(root);
128
+ const more = fillPendingBodies(root, '[data-body="pending"]:not([data-section="conversation"])');
129
+ if (more === 0)
130
+ return built;
131
+ built += more;
132
+ }
133
+ }
134
+ /**
135
+ * The one nesting rule for every report page (SEAMS ruling 11): a level-2
136
+ * toggle may sit inside a level-1 toggle, and nothing deeper. Returns every
137
+ * breach in `root`, by the summary text of the offending toggle: a toggle
138
+ * inside two others, a level-1 toggle inside another toggle, or a level-2
139
+ * toggle inside anything but a level-1 toggle (another level 2, say).
140
+ * Empty when the page keeps the rule. Run it over a page with every toggle
141
+ * opened, so lazily built bodies are counted.
142
+ */
143
+ export function nestingProblems(root) {
144
+ const problems = [];
145
+ for (const details of root.querySelectorAll("details")) {
146
+ const outer = [];
147
+ for (let at = details.parentElement?.closest("details"); at !== null && at !== undefined; at = at.parentElement?.closest("details"))
148
+ outer.push(at);
149
+ const name = JSON.stringify(details.querySelector(":scope > summary")?.textContent ?? "");
150
+ if (outer.length > 1)
151
+ problems.push(`${name} is nested ${outer.length + 1} toggles deep`);
152
+ else if (outer.length === 1 && outer[0].dataset.level !== undefined) {
153
+ if (details.dataset.level !== "2")
154
+ problems.push(`${name} is not level 2 but sits inside a toggle`);
155
+ else if (outer[0].dataset.level !== "1")
156
+ problems.push(`${name} is level 2 but sits inside a level-${outer[0].dataset.level} toggle, not a level-1 one`);
157
+ }
158
+ }
159
+ return problems;
160
+ }
161
+ /**
162
+ * At depth L2 everything is open (presentation contract section 9.1),
163
+ * including the toggles a body holds when it is built after the page was
164
+ * drawn: inside a region the host opened to L2 (`data-open-all`), a newly
165
+ * built body's toggles open too.
166
+ */
167
+ export function openBuiltToDepth(body) {
168
+ if (body.closest("[data-open-all]") === null)
169
+ return;
170
+ for (const toggle of body.querySelectorAll("details.lv"))
171
+ if (!toggle.open)
172
+ openToggle(toggle);
173
+ }
174
+ /** Opens a toggle and builds its body now (tests, print). */
175
+ export function openToggle(details) {
176
+ details.open = true;
177
+ // The event of the element's own window: a static page is drawn into a
178
+ // document that is not the global one.
179
+ const view = details.ownerDocument.defaultView;
180
+ details.dispatchEvent(new (view === null ? Event : view.Event)("toggle"));
181
+ }
182
+ /**
183
+ * A conversation's body inside an open level-1 toggle, in place (never a
184
+ * toggle). Built when it comes within a screen or so of the view; where the
185
+ * browser has no IntersectionObserver it is built at once. `beforeprint`
186
+ * builds every pending body so a printed page is whole.
187
+ */
188
+ export function lazyBody(host, build) {
189
+ host.dataset.body = "pending";
190
+ const Observer = globalThis.IntersectionObserver;
191
+ let observer;
192
+ const fill = () => {
193
+ if (host.dataset.body !== "pending")
194
+ return;
195
+ observer?.disconnect();
196
+ pendingBodies.delete(host);
197
+ host.dataset.body = "built";
198
+ host.append(build());
199
+ openBuiltToDepth(host);
200
+ };
201
+ if (Observer === undefined) {
202
+ fill();
203
+ return;
204
+ }
205
+ observer = new Observer((entries) => {
206
+ if (entries.some((e) => e.isIntersecting))
207
+ fill();
208
+ }, { rootMargin: "1200px 0px" });
209
+ observer.observe(host);
210
+ // No listener per body: one `beforeprint` listener for the whole page
211
+ // fills the bodies still pending in the document. A body that was built,
212
+ // or whose card a host has since unmounted, holds no listener, so nothing
213
+ // keeps an old card's model alive.
214
+ pendingBodies.set(host, fill);
215
+ watchPrint(host.ownerDocument);
216
+ }
217
+ /** Each pending body's fill, keyed weakly by its host, so a host dropped from the page is collected with its model. */
218
+ const pendingBodies = new WeakMap();
219
+ const printWatched = new WeakSet();
220
+ /** One `beforeprint` listener per document: builds every body still pending in it, and only those still in the page. */
221
+ function watchPrint(doc) {
222
+ const view = doc.defaultView;
223
+ if (view === null || printWatched.has(doc))
224
+ return;
225
+ printWatched.add(doc);
226
+ view.addEventListener("beforeprint", () => {
227
+ for (const host of doc.querySelectorAll('[data-body="pending"]'))
228
+ pendingBodies.get(host)?.();
229
+ });
230
+ }
231
+ export function judgedOf(reportState, judgePinDigest) {
232
+ if (reportState === "withheld")
233
+ return "withheld";
234
+ if (reportState !== "disclosed")
235
+ return "unknown";
236
+ return judgePinDigest === undefined ? "no" : "yes";
237
+ }
238
+ /**
239
+ * One rule's result in words, from the card's own grouping prefix
240
+ * (`lines.verdict.*` or `groups.verdict.*`: the bare `verdict.*` namespace
241
+ * stays contract-report/v1 §3's). `judged` picks among the pack's four
242
+ * words for a rule nobody could decide: a judge ran and could not decide
243
+ * (`.not_evaluable.judged`), none ran (`.unjudged`), the bundle
244
+ * withholds the report that would say which (`.withheld`), or a judge's
245
+ * report is cited but this bundle does not carry a readable copy of it --
246
+ * mismatched, unreadable, invalid, or simply not carried (`.unavailable`),
247
+ * never `.withheld`, which would claim more than those states show. A
248
+ * failed or unsupported claim failed verification, or its evidence is
249
+ * missing; it is never "not checked".
250
+ */
251
+ export function ruleWord(verdict, judged, w) {
252
+ const v = (key) => w.t(`${w.grouping}.verdict.${key}`);
253
+ switch (verdict) {
254
+ case "failed":
255
+ return { word: v("failed"), tone: "ne" };
256
+ case "unsupported":
257
+ return { word: v("unsupported"), tone: "ne" };
258
+ case "met":
259
+ return { word: v("met"), tone: "ok" };
260
+ case "not_met":
261
+ return { word: v("not_met"), tone: "bad" };
262
+ case "not_applicable":
263
+ return { word: v("not_applicable"), tone: "na" };
264
+ case "out_of_scope":
265
+ return { word: v("out_of_scope"), tone: "na" };
266
+ case "not_yet_in_force":
267
+ return { word: v("not_yet_in_force"), tone: "na" };
268
+ case "not_evaluable":
269
+ return {
270
+ word: v(judged === "yes"
271
+ ? "not_evaluable.judged"
272
+ : judged === "no"
273
+ ? "not_evaluable.unjudged"
274
+ : judged === "withheld"
275
+ ? "not_evaluable.withheld"
276
+ : "not_evaluable.unavailable"),
277
+ tone: "ne",
278
+ };
279
+ }
280
+ }
281
+ /**
282
+ * The judge's note in plain words. A sealed rationale that is the judge
283
+ * backend's own synthesized line ("jev choice: not_met (probabilities={...},
284
+ * confidence=...)") reads "The judge was 78% sure." (`judge.note.sure`); any
285
+ * other rationale (a recomputed check's own explanation) is shown as sealed.
286
+ * Display only: the proofs always carry the rationale exactly as sealed.
287
+ */
288
+ export function judgeNote(rationale, verdict, w) {
289
+ if (!/^jev choice:/u.test(rationale))
290
+ return rationale;
291
+ // The same parse the model uses for P (anchored on the probabilities
292
+ // block, a value only in [0, 1]), so the note and the proofs agree.
293
+ const probabilities = parseJudgeProbabilities(rationale).probabilities ?? {};
294
+ const p = Object.hasOwn(probabilities, verdict)
295
+ ? probabilities[verdict]
296
+ : undefined;
297
+ return p === undefined || !Number.isFinite(p) || p < 0 || p > 1
298
+ ? rationale
299
+ : w.t("judge.note.sure", { p: Math.round(p * 100) });
300
+ }
301
+ export function wordPill(worded, key) {
302
+ const pill = el("span", `pill ${worded.tone}`, worded.word);
303
+ pill.dataset.pill = key;
304
+ return pill;
305
+ }
306
+ /**
307
+ * `tau2:airline:<model>:task-20:trial-1` reads "task 20, trial 1" with the
308
+ * model beside it; the older `tau2:airline:task-20:trial-0` reads "task 20,
309
+ * trial 0"; any other id is shown whole.
310
+ */
311
+ export function caseParts(conversationId, w) {
312
+ const parts = conversationId.split(":");
313
+ const at = parts.findIndex((p) => /^task-[0-9]+$/u.test(p));
314
+ if (at === -1)
315
+ return { label: conversationId };
316
+ const task = parts[at].slice("task-".length);
317
+ const trial = /^trial-([0-9]+)$/u.exec(parts[at + 1] ?? "")?.[1];
318
+ const model = at > 2 ? parts.slice(2, at).join(":") : undefined;
319
+ return {
320
+ label: trial === undefined
321
+ ? w.t("case.label", { task })
322
+ : w.t("case.label.trial", { task, trial }),
323
+ ...(model === undefined || model.length === 0 ? {} : { model }),
324
+ };
325
+ }
326
+ // ---------------------------------------------------------------------------
327
+ // The conversation, readable
328
+ // ---------------------------------------------------------------------------
329
+ /** The pack's label for a transcript role; an unknown role is shown as the transcript names it. */
330
+ function roleLabel(role, w) {
331
+ return role === "user" ||
332
+ role === "assistant" ||
333
+ role === "tool" ||
334
+ role === "system"
335
+ ? w.t(`chat.role.${role}`)
336
+ : role;
337
+ }
338
+ /** The text with every whitespace character outside JSON strings removed. */
339
+ function jsonWithoutSpace(text) {
340
+ let out = "";
341
+ let inString = false;
342
+ let escaped = false;
343
+ for (const ch of text) {
344
+ if (inString) {
345
+ out += ch;
346
+ if (escaped)
347
+ escaped = false;
348
+ else if (ch === "\\")
349
+ escaped = true;
350
+ else if (ch === '"')
351
+ inString = false;
352
+ }
353
+ else if (ch === '"') {
354
+ inString = true;
355
+ out += ch;
356
+ }
357
+ else if (!/\s/u.test(ch))
358
+ out += ch;
359
+ }
360
+ return out;
361
+ }
362
+ /**
363
+ * A sealed tool result, shown verbatim. It is indented for
364
+ * reading only when doing so changes nothing but whitespace: JSON.parse then
365
+ * JSON.stringify must give back exactly the original once whitespace outside
366
+ * strings is set aside. A number JSON cannot hold exactly
367
+ * (`{"id":12345678901234567890}`), a duplicate key, an escape written
368
+ * differently: any of these, and the original text is shown as it is.
369
+ */
370
+ export function exactText(text) {
371
+ const trimmed = text.trim();
372
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) {
373
+ return { text, indented: false };
374
+ }
375
+ let value;
376
+ try {
377
+ value = JSON.parse(trimmed);
378
+ }
379
+ catch {
380
+ return { text, indented: false };
381
+ }
382
+ if (JSON.stringify(value) !== jsonWithoutSpace(trimmed))
383
+ return { text, indented: false };
384
+ return { text: JSON.stringify(value, null, 2), indented: true };
385
+ }
386
+ /**
387
+ * The conversation as a chat: who said what, and each tool the agent called
388
+ * with its arguments. The words come from the transcript the caller has
389
+ * already tied to the judged case by digest (`verified`), or to the case
390
+ * every claim cites when the reports are withheld (`cited`, said as such);
391
+ * nothing is reworded. Returns the "not in this bundle" note otherwise.
392
+ */
393
+ export function renderChat(transcript, caseRecord, w) {
394
+ const wrap = el("div", "chat");
395
+ wrap.dataset.transcript = transcript.state;
396
+ if (transcript.state !== "verified" && transcript.state !== "cited") {
397
+ wrap.append(el("p", "absent", transcript.state === "absent"
398
+ ? w.t("chat.absent", {
399
+ record: caseRecord ?? w.t("chat.record.not-stated"),
400
+ })
401
+ : w.t("chat.not-shown", {
402
+ reason: transcript.reason ?? w.t("chat.not-shown.default-reason"),
403
+ })));
404
+ return wrap;
405
+ }
406
+ const turns = transcript.turns ?? [];
407
+ const calls = turns.reduce((n, t) => n + t.toolCalls.length, 0);
408
+ wrap.append(el("p", "chat-k", w.t("chat.lede", {
409
+ messages: String(turns.length),
410
+ calls: w.p("chat.calls", calls, { n: String(calls) }),
411
+ state: w.t(transcript.state === "cited"
412
+ ? "chat.state.cited"
413
+ : "chat.state.verified"),
414
+ })));
415
+ wrap.append(renderTurns(turns, w));
416
+ return wrap;
417
+ }
418
+ /**
419
+ * The turns of a conversation as a chat, and nothing else: who said what,
420
+ * each tool call with its arguments, each tool result as sealed. It states
421
+ * nothing about where the turns came from or what was checked; its caller
422
+ * does (renderChat for a card, the core's record entry for a record).
423
+ */
424
+ export function renderTurns(turns, w) {
425
+ const list = el("ol", "turns");
426
+ turns.forEach((turn, index) => {
427
+ const role = turn.role === "user" ||
428
+ turn.role === "assistant" ||
429
+ turn.role === "tool" ||
430
+ turn.role === "system"
431
+ ? turn.role
432
+ : "other";
433
+ const item = el("li", `turn ${role}`);
434
+ item.dataset.turn = String(index);
435
+ item.dataset.role = turn.role;
436
+ item.append(el("div", "who", roleLabel(turn.role, w)));
437
+ if (turn.content !== undefined && turn.content.length > 0) {
438
+ if (role === "tool") {
439
+ const shown = exactText(turn.content);
440
+ const pre = el("pre", "say", shown.text);
441
+ pre.dataset.exact = shown.indented ? "indented" : "verbatim";
442
+ item.append(pre);
443
+ }
444
+ else
445
+ item.append(el("div", "say", turn.content));
446
+ }
447
+ for (const call of turn.toolCalls) {
448
+ const line = el("div", "call");
449
+ line.dataset.toolCall = call.name;
450
+ line.append(el("span", "call-k", w.t("chat.called")));
451
+ line.append(el("b", "", call.name));
452
+ // The arguments as the outcome report model hands them over. At
453
+ // agent-action-capsule 0.5.0 `transcriptTurns` re-serialises them
454
+ // with JSON.stringify, so they are not the sealed bytes: a number
455
+ // JSON cannot hold exactly is already rounded there. Never claimed
456
+ // verbatim; this page rewords nothing further.
457
+ if (call.arguments.length > 0) {
458
+ const args = el("code", "call-a", call.arguments);
459
+ args.dataset.exact = "as-modelled";
460
+ line.append(" ", args);
461
+ }
462
+ item.append(line);
463
+ }
464
+ list.append(item);
465
+ });
466
+ return list;
467
+ }
468
+ /** The address of a record in the core's records section (evidence-graph-view.ts). */
469
+ export function recordAddress(recordId) {
470
+ return `record-${recordId}`;
471
+ }
472
+ // ---------------------------------------------------------------------------
473
+ // Show evidence (capsule-viewer#83)
474
+ // ---------------------------------------------------------------------------
475
+ /** The address of a number on the page, beside `recordAddress`: the core's "Cited by" links point here. */
476
+ export function numberAddress(key) {
477
+ return `n-${key.replace(/[^A-Za-z0-9_.:-]/gu, "_")}`;
478
+ }
479
+ function showEvidenceComponent() {
480
+ const found = globalThis
481
+ .CapsuleViewerShowEvidence;
482
+ return typeof found?.resolve === "function" &&
483
+ typeof found.render === "function"
484
+ ? found
485
+ : undefined;
486
+ }
487
+ /**
488
+ * Show evidence for one number: what a count counts, as records.
489
+ * `counted` holds one entry per thing the number counts: the claim behind
490
+ * it, or undefined where the page counted it with no claim (a conversation
491
+ * no claim judged on this rule). Every cited digest comes from the claims'
492
+ * own `evidence[]` as agent-action-capsule's Result reader resolved it; this
493
+ * page infers no citation.
494
+ *
495
+ * - A number that counts nothing draws nothing: there is nothing to show.
496
+ * - A number whose claims cite at least one record in this bundle draws a
497
+ * `<details>` at the number's address (`numberAddress`): "Show evidence"
498
+ * (or `summary`, where one cell holds more than one number), and under it the cited records, each a link to its entry in the core's
499
+ * records section, then each cited digest the bundle does not carry, said
500
+ * so, how many were counted from a claim that cites nothing, and how many
501
+ * with no claim. The list is built at once,
502
+ * so a page that runs no script (the static package) carries it as it is.
503
+ * Where a host loaded the Show-evidence component, opening the toggle also
504
+ * draws each claim side by side under the list.
505
+ * - A number with no record to show draws a label instead: "unsupported"
506
+ * when it counts claims whose evidence is not disclosed in this bundle, or
507
+ * that cite none,
508
+ * "interpretation" when no claim stands behind it at all.
509
+ *
510
+ * The toggle counts as level 2 (the proofs' level) and holds no other
511
+ * toggle. It is not an `lv` toggle, so depth L1 leaves it closed; depth L2
512
+ * opens it with everything else (report-front.ts `applyDepth`). The core's "Cited by"
513
+ * lists (evidence-graph-view.ts) read `data-cites` and `data-evidence-name`
514
+ * back from it.
515
+ */
516
+ export function evidenceAction(key, name, counted, result, w, summary = w.t("evidence.show")) {
517
+ if (counted.length === 0)
518
+ return undefined;
519
+ const claims = counted.filter((c) => c !== undefined);
520
+ const cited = new Set();
521
+ const missing = new Set();
522
+ for (const claim of claims)
523
+ for (const ref of claim.evidence)
524
+ (ref.resolved ? cited : missing).add(ref.digest);
525
+ // Claims that cite nothing at all (AAC reads them unsupported): counted
526
+ // apart, so a list's parts add up to the number it stands under.
527
+ const citeNothing = claims.filter((c) => c.evidence.length === 0).length;
528
+ if (cited.size === 0) {
529
+ const kind = claims.length > 0 ? "unsupported" : "interpretation";
530
+ const key2 = kind === "interpretation"
531
+ ? "evidence.label.interpretation"
532
+ : missing.size === 0
533
+ ? "evidence.label.no-evidence"
534
+ : "evidence.label.unsupported";
535
+ const label = el("span", "cv-ev-label", w.t(key2));
536
+ label.dataset.evidenceLabel = kind;
537
+ if (key2 === "evidence.label.no-evidence")
538
+ label.dataset.evidenceReason = "no-evidence";
539
+ label.dataset.evidenceFor = key;
540
+ return label;
541
+ }
542
+ const details = document.createElement("details");
543
+ details.className = "cv-ev";
544
+ details.dataset.level = "2";
545
+ details.id = numberAddress(key);
546
+ details.dataset.evidenceFor = key;
547
+ details.dataset.evidenceName = name;
548
+ details.dataset.cites = [...cited].join(" ");
549
+ details.append(element("summary", summary));
550
+ const body = el("div", "cv-ev-body");
551
+ body.append(el("p", "cv-ev-k", w.t("evidence.records")));
552
+ const list = el("ul", "cv-ev-list");
553
+ for (const digest of cited) {
554
+ const item = element("li");
555
+ item.dataset.cited = digest;
556
+ const link = element("a");
557
+ link.setAttribute("href", `#${recordAddress(digest)}`);
558
+ link.append(element("code", digest));
559
+ item.append(link);
560
+ list.append(item);
561
+ }
562
+ for (const digest of missing) {
563
+ const item = element("li");
564
+ item.dataset.missing = digest;
565
+ item.append(element("code", digest), ` ${w.t("evidence.not-in-bundle")}`);
566
+ list.append(item);
567
+ }
568
+ if (citeNothing > 0) {
569
+ const item = element("li", w.p("evidence.no-evidence", citeNothing));
570
+ item.dataset.noEvidence = String(citeNothing);
571
+ list.append(item);
572
+ }
573
+ const uncited = counted.length - claims.length;
574
+ if (uncited > 0) {
575
+ const item = element("li", w.p("evidence.uncited", uncited));
576
+ item.dataset.uncited = String(uncited);
577
+ list.append(item);
578
+ }
579
+ body.append(list);
580
+ details.append(body);
581
+ // Where script runs and a host loaded the component, each claim side by
582
+ // side, drawn the first time the toggle opens; a static page has none.
583
+ details.addEventListener("toggle", () => {
584
+ const component = showEvidenceComponent();
585
+ if (!details.open || component === undefined)
586
+ return;
587
+ if (body.querySelector(":scope > .cv-ev-sides") !== null)
588
+ return;
589
+ const sides = el("div", "cv-ev-sides");
590
+ for (const claim of new Set(claims))
591
+ sides.append(component.render(component.resolve(result, claim), details.ownerDocument));
592
+ body.append(sides);
593
+ });
594
+ return details;
595
+ }
596
+ /**
597
+ * A conversation in place in its card: a level-2 toggle whose body is the
598
+ * chat, built when it opens, with a close control and a link to the record
599
+ * in the core's records section above and below it. The in-place copy
600
+ * carries no address; only the records section's entry does.
601
+ *
602
+ * Beside the toggle sits the same link worded for a page that runs no
603
+ * script, hidden: the static package (presentation-builder.ts) keeps one
604
+ * copy of each conversation, in the records section, and swaps the toggle
605
+ * for that link when the record is there (`linkConversations`).
606
+ */
607
+ export function conversationFold(transcript, caseRecord, w) {
608
+ const wrap = el("div", "chat-fold");
609
+ const record = (transcript.state === "verified" || transcript.state === "cited") &&
610
+ transcript.transcriptRecordId !== undefined
611
+ ? transcript.transcriptRecordId
612
+ : undefined;
613
+ let toggle;
614
+ const bar = () => {
615
+ const line = el("div", "chat-bar");
616
+ // A link, not a button: the card stays a page of links and native
617
+ // toggles. With script it closes the conversation; a page that runs no
618
+ // script drops it (linkConversations).
619
+ const close = el("a", "chat-close", w.t("chat.close"));
620
+ close.setAttribute("href", "#");
621
+ close.setAttribute("role", "button");
622
+ close.addEventListener("click", (event) => {
623
+ event.preventDefault();
624
+ toggle.open = false;
625
+ toggle.querySelector(":scope > summary")?.scrollIntoView?.({
626
+ block: "nearest",
627
+ });
628
+ });
629
+ line.append(close);
630
+ if (record !== undefined) {
631
+ const link = el("a", "chat-records", w.t("chat.in-records"));
632
+ link.setAttribute("href", `#${recordAddress(record)}`);
633
+ link.addEventListener("click", () => revealRecord(link, record));
634
+ line.append(link);
635
+ }
636
+ return line;
637
+ };
638
+ toggle = levelToggle(2, w.t("card.h.conversation"), () => {
639
+ const body = el("div", "chat-body");
640
+ body.append(bar(), renderChat(transcript, caseRecord, w), bar());
641
+ return body;
642
+ });
643
+ toggle.dataset.section = "conversation";
644
+ if (record !== undefined) {
645
+ toggle.dataset.record = record;
646
+ const link = el("a", "chat-static", w.t("chat.read"));
647
+ link.setAttribute("href", `#${recordAddress(record)}`);
648
+ link.hidden = true;
649
+ wrap.append(link);
650
+ }
651
+ wrap.append(toggle);
652
+ return wrap;
653
+ }
654
+ /**
655
+ * Opens a record's entry in the core's records section, and every toggle
656
+ * around it, so the link's target is in view when the browser scrolls to
657
+ * it. A browser that opens a closed <details> for a fragment does the same
658
+ * on a page that runs no script.
659
+ */
660
+ export function revealRecord(from, recordId) {
661
+ const doc = from.nodeType === 9 ? from : from.ownerDocument;
662
+ const target = doc.getElementById(recordAddress(recordId));
663
+ if (target === null)
664
+ return;
665
+ for (let at = target.parentElement?.closest("details") ?? null; at !== null; at = at.parentElement?.closest("details") ?? null)
666
+ if (!at.open)
667
+ openToggle(at);
668
+ target.scrollIntoView?.();
669
+ }
670
+ const hashWatched = new WeakSet();
671
+ /**
672
+ * Where script runs: a page opened at a record's address (`#record-<id>`),
673
+ * or whose address changes to one, opens that record's entry and every
674
+ * fold around it, as a link to it does (`revealRecord`). One listener per
675
+ * document.
676
+ */
677
+ export function revealRecordsByHash(doc) {
678
+ const view = doc.defaultView;
679
+ if (view === null)
680
+ return;
681
+ const go = () => {
682
+ const hash = view.location.hash;
683
+ if (!hash.startsWith("#record-"))
684
+ return;
685
+ let id;
686
+ try {
687
+ id = decodeURIComponent(hash.slice("#record-".length));
688
+ }
689
+ catch {
690
+ // A fragment that does not decode names no record.
691
+ return;
692
+ }
693
+ revealRecord(doc, id);
694
+ };
695
+ go();
696
+ if (hashWatched.has(doc))
697
+ return;
698
+ hashWatched.add(doc);
699
+ view.addEventListener("hashchange", go);
700
+ }
701
+ /**
702
+ * For a page that runs no script: every in-place conversation whose record
703
+ * the core's records section holds becomes a link to it, so the page keeps
704
+ * one copy of each conversation however many cards cite it, built or not.
705
+ * A conversation whose record is not there (none is stated, or its
706
+ * transcript is absent or does not check) keeps its toggle and its state
707
+ * note. Returns how many it linked.
708
+ */
709
+ export function linkConversations(root) {
710
+ let linked = 0;
711
+ const ids = new Set([
712
+ ...root.querySelectorAll("details.cv-record > .cv-record-anchor[id]"),
713
+ ].map((e) => e.id));
714
+ for (const toggle of root.querySelectorAll('details[data-section="conversation"][data-record]')) {
715
+ const link = toggle.parentElement?.querySelector(":scope > a.chat-static");
716
+ if (!ids.has(recordAddress(toggle.dataset.record)) || link == null)
717
+ continue;
718
+ link.hidden = false;
719
+ toggle.remove();
720
+ linked++;
721
+ }
722
+ // A conversation kept in place (no record to link to) shows its state
723
+ // note: the page runs no script, so its body is built now.
724
+ for (const toggle of root.querySelectorAll('details[data-section="conversation"][data-body="pending"]'))
725
+ pendingToggles.get(toggle)?.();
726
+ // A page that runs no script cannot close a toggle from a control.
727
+ for (const close of root.querySelectorAll(".chat-close"))
728
+ close.remove();
729
+ return linked;
730
+ }
731
+ // ---------------------------------------------------------------------------
732
+ // contract-report/v1 section 3 words shared by both groupings
733
+ // ---------------------------------------------------------------------------
734
+ /**
735
+ * The pack's `report.summary` line under the card's title, or nothing: the
736
+ * module has no summary of its own, so a pack that sets none shows none.
737
+ */
738
+ export function reportSummary(w) {
739
+ const text = w.section3("report.summary");
740
+ if (text === undefined)
741
+ return undefined;
742
+ const p = el("p", "rsum", text);
743
+ p.dataset.reportSummary = "";
744
+ return p;
745
+ }
746
+ /**
747
+ * One claim's assurance, as sealed on it (contract-report/v1 section 2:
748
+ * assurance stays on the claim): its tier, grade, sufficiency and carrier
749
+ * status, each in the layered section 3 word, or its raw value when no layer
750
+ * has one. The raw values ride on the element as data.
751
+ */
752
+ export function assuranceRow(claim, w) {
753
+ return [
754
+ w.t("card.pf.assurance"),
755
+ w.t("card.pf.assurance.line", {
756
+ tier: w.enumWord("tier", claim.tier),
757
+ grade: w.enumWord("grade", claim.grade),
758
+ sufficiency: w.enumWord("sufficiency", claim.sufficiency),
759
+ status: w.enumWord("status", claim.presentation.status),
760
+ }),
761
+ {
762
+ tier: claim.tier,
763
+ grade: claim.grade,
764
+ sufficiency: claim.sufficiency,
765
+ status: claim.presentation.status,
766
+ },
767
+ ];
768
+ }
769
+ /**
770
+ * A wording layer the host supplied was refused (contract-report/v1 section
771
+ * 3): one line at the top of the card, so a reader never takes the default
772
+ * words for the ones the page was built to show.
773
+ */
774
+ export function refusedWordingNotice(w) {
775
+ if (w.source.refused === undefined)
776
+ return undefined;
777
+ const p = el("p", "wref", w.t("card.wording.refused"));
778
+ p.dataset.wording = "refused";
779
+ p.dataset.refusal = w.source.refused.reason;
780
+ return p;
781
+ }
782
+ // ---------------------------------------------------------------------------
783
+ // Proofs: one definition list, ids in monospace
784
+ // ---------------------------------------------------------------------------
785
+ export function proofList(rows) {
786
+ const dl = el("dl", "pf");
787
+ for (const [k, v, data] of rows) {
788
+ const dd = element("dd", v);
789
+ for (const [key, value] of Object.entries(data ?? {}))
790
+ dd.dataset[key] = value;
791
+ dl.append(element("dt", k), dd);
792
+ }
793
+ return dl;
794
+ }
795
+ /** The toggles', chat's and proofs' styles, scoped under the card's class. */
796
+ export function levelCss(scope) {
797
+ const s = `.${scope}`;
798
+ return `
799
+ ${s} details.lv{border:1px solid var(--line);border-radius:10px;background:#fff;margin-top:8px;padding:0}
800
+ ${s} details.lv > summary{cursor:pointer;list-style:none;padding:8px 12px;font-size:13.5px;font-weight:600;color:var(--navy)}
801
+ ${s} details.lv > summary::-webkit-details-marker{display:none}
802
+ ${s} details.lv > summary:before{content:"";display:inline-block;width:0;height:0;border-left:5px solid var(--navy);border-top:4px solid transparent;border-bottom:4px solid transparent;margin-right:8px;vertical-align:1px;transition:transform .1s}
803
+ ${s} details.lv[open] > summary:before{transform:rotate(90deg)}
804
+ ${s} details.lv1.line{border:0;background:transparent;margin-top:4px}
805
+ ${s} details.lv1.line > summary{padding:2px 0;font-size:13px}
806
+ ${s} details.lv1.line > .convs,${s} details.lv1.line > .why-missed{margin-top:8px}
807
+ ${s} tr.drill-row > td{padding:0 10px 12px;border-bottom:1px solid var(--line)}
808
+ ${s} details.cv-ev{display:block;margin-top:2px;font-weight:400;text-align:left}
809
+ ${s} details.cv-ev > summary{cursor:pointer;font-size:11.5px;font-weight:600;color:var(--navy);white-space:nowrap}
810
+ ${s} details.cv-ev > .cv-ev-body{white-space:normal;margin:6px 0;padding:8px 10px;border:1px dashed #BFC4CC;border-radius:8px;background:#FAF8F4;font-size:12px;min-width:16em}
811
+ ${s} .cv-ev-k{margin:0 0 4px;color:var(--slate)}
812
+ ${s} ul.cv-ev-list{margin:0;padding-left:16px;display:grid;gap:2px}
813
+ ${s} ul.cv-ev-list code{font-family:ui-monospace,Menlo,monospace;font-size:11px;word-break:break-all}
814
+ ${s} .cv-ev-label{white-space:normal;display:block;margin-top:2px;font-size:11px;font-weight:400;color:var(--slate);text-align:left}
815
+ ${s} .cv-ev-sides{display:grid;gap:10px;margin-top:8px}
816
+ ${s} .cv-side-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(14em,1fr));gap:10px}
817
+ ${s} .cv-side-producer i{color:var(--slate)}
818
+ ${s} .cv-side-payload{margin:4px 0;font-family:ui-monospace,Menlo,monospace;font-size:11px;word-break:break-word}
819
+ ${s} details.lv2{background:#FAF8F4;border-style:dashed}
820
+ ${s} details.lv2 > summary{color:var(--slate);font-weight:600}
821
+ ${s} details.lv2 > .pf-b{padding:4px 14px 14px;font-size:12.5px}
822
+ ${s} .convs{display:grid;gap:12px}
823
+ ${s} .conv{border:1px solid var(--line);border-radius:10px;background:#fff}
824
+ ${s} .conv-h{display:grid;grid-template-columns:110px auto 1fr auto;gap:10px;align-items:center;padding:8px 12px;font-size:13.5px;background:#FAF8F4;border-bottom:1px solid var(--line);border-radius:10px 10px 0 0}
825
+ ${s} .conv-h .cid{font-weight:700;color:var(--navy)}
826
+ ${s} .conv-h .cwhy{color:var(--slate)}
827
+ ${s} .conv-h .cmodel{color:var(--slate);font-family:ui-monospace,Menlo,monospace;font-size:11.5px;white-space:nowrap}
828
+ ${s} .conv > [data-body="pending"]{min-height:160px}
829
+ ${s} .conv-b{padding:4px 16px 16px;font-size:13.5px;font-weight:400;color:var(--ink)}
830
+ ${s} .conv-b h4{font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--slate);margin:16px 0 6px}
831
+ ${s} .conv-b .small{font-size:12.5px;color:var(--slate);margin:6px 0}
832
+ ${s} .conv-b .muted{color:var(--slate)}
833
+ ${s} .why-missed h5{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--slate);margin:14px 0 6px}
834
+ ${s} .why-missed table{border-collapse:collapse;font-size:13px;margin:0 0 8px}
835
+ ${s} .why-missed td{padding:3px 12px 3px 0;border-bottom:1px solid var(--line)}
836
+ ${s} .why-missed td.n{text-align:right;font-variant-numeric:tabular-nums;font-weight:700;color:var(--bad)}
837
+ ${s} .why-missed .rsn-h{margin:16px 0 6px;font-size:13.5px;font-weight:700;color:var(--navy)}
838
+ ${s} .chat .absent{margin:0;padding:10px 12px;border:1px dashed #BFC4CC;border-radius:10px;background:#FAF8F4;color:var(--slate);word-break:break-word;font-size:13px}
839
+ ${s} .chat .chat-k{font-size:12.5px;color:var(--slate);margin:4px 0 6px}
840
+ ${s} .chat ol.turns{list-style:none;margin:0;padding:10px;display:grid;gap:6px;max-height:620px;overflow:auto;border:1px solid var(--line);border-radius:10px;background:#FAF8F4}
841
+ ${s} .chat li.turn{border-radius:10px;padding:6px 10px;max-width:86%;background:#fff;border:1px solid var(--line);font-size:13.5px}
842
+ ${s} .chat li.turn.user{justify-self:end;background:var(--person-l);border-color:transparent}
843
+ ${s} .chat li.turn.assistant{justify-self:start}
844
+ ${s} .chat li.turn.tool,${s} .chat li.turn.system{justify-self:center;max-width:96%;border-style:dashed;background:#fff}
845
+ ${s} .chat li.turn .who{font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--slate);margin-bottom:2px}
846
+ ${s} .chat-body{padding:4px 12px 12px}
847
+ ${s} .chat-bar{display:flex;align-items:center;gap:12px;margin:6px 0;font-size:13px}
848
+ ${s} .chat-bar .chat-close{font-weight:600}
849
+ ${s} .chat-bar .chat-records{margin-left:auto}
850
+ ${s} a.chat-static:not([hidden]){display:inline-block;margin-top:8px;font-size:13.5px;font-weight:600}
851
+ ${s} .chat li.turn .say{white-space:pre-wrap;word-break:break-word}
852
+ ${s} .chat li.turn pre.say{margin:0;font-family:ui-monospace,Menlo,monospace;font-size:11.5px;max-height:180px;overflow:auto;color:var(--slate)}
853
+ ${s} .chat li.turn.system .say{max-height:120px;overflow:auto;font-size:12px;color:var(--slate)}
854
+ ${s} .chat .call{margin-top:4px;font-size:12.5px;background:var(--gold-l);border-radius:6px;padding:3px 8px;word-break:break-word}
855
+ ${s} .chat .call .call-k{color:var(--slate)}
856
+ ${s} .chat .call b{font-family:ui-monospace,Menlo,monospace;color:var(--navy);font-size:12px}
857
+ ${s} .chat .call .call-a{font-family:ui-monospace,Menlo,monospace;font-size:11.5px;color:var(--ink);white-space:pre-wrap;word-break:break-all}
858
+ ${s} dl.pf{display:grid;grid-template-columns:200px 1fr;gap:4px 12px;margin:6px 0;font-size:12px}
859
+ ${s} dl.pf dt{color:var(--slate)}
860
+ ${s} dl.pf dd{margin:0;font-family:ui-monospace,Menlo,monospace;word-break:break-all;color:var(--navy)}
861
+ ${s} .pf-b p{margin:8px 0;color:var(--slate)}
862
+ ${s} .pf-b h5{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--slate);margin:14px 0 4px}
863
+ ${s} .pill{display:inline-block;padding:1px 9px;border-radius:99px;font-size:12px;font-weight:700;white-space:nowrap;text-align:center}
864
+ ${s} .pill.ok{background:var(--ok-l);color:var(--ok)}
865
+ ${s} .pill.bad{background:var(--bad-l);color:var(--bad)}
866
+ ${s} .pill.na{background:#EEF0F3;color:var(--slate);border:1px dashed #BFC4CC}
867
+ ${s} .pill.ne{background:var(--gold-l);color:#8A5A12}
868
+ ${s} dl.prov{display:grid;grid-template-columns:110px 1fr;gap:4px 12px;margin:14px 0 0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:12.5px}
869
+ ${s} dl.prov dt{color:var(--slate);font-weight:600}
870
+ ${s} dl.prov dd{margin:0;color:var(--ink);word-break:break-word}
871
+ @media (max-width:760px){${s} dl.pf,${s} dl.prov{grid-template-columns:1fr}${s} .chat li.turn{max-width:100%}${s} .conv-h{grid-template-columns:1fr auto}${s} .conv-h .cmodel{display:none}}
872
+ `;
873
+ }
874
+ //# sourceMappingURL=report-levels.js.map