@action-state-group/capsule-viewer 0.21.0 → 0.23.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.
@@ -17865,13 +17865,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
17865
17865
  }
17866
17866
  function builtCommit() {
17867
17867
  if (false) return void 0;
17868
- return commitPrefix("003fc8941d80de5d1753181aba7b524bd86a85a9");
17868
+ return commitPrefix("f991f55c1c01422d541007b2bb9beb568eac3e11");
17869
17869
  }
17870
17870
  var commit = builtCommit();
17871
17871
  var unreleased = false;
17872
17872
  var VIEWER_BUILD = {
17873
17873
  viewer: "@action-state-group/capsule-viewer",
17874
- viewerVersion: "0.21.0",
17874
+ viewerVersion: "0.23.0",
17875
17875
  verifier: "@action-state-group/agent-action-capsule",
17876
17876
  verifierVersion: "0.16.0",
17877
17877
  cllVersion: "0.4.0",
@@ -19730,7 +19730,15 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
19730
19730
  "generic.claim.unrecognized": "unrecognized claim type {type}",
19731
19731
  "generic.claim.contract": "Contract",
19732
19732
  "generic.claim.requirement": "Requirement",
19733
- "generic.claim.failure": "Why it failed verification"
19733
+ "generic.claim.failure": "Why it failed verification",
19734
+ "generic.receipt.open": "Open receipt",
19735
+ "generic.receipt.close": "Close receipt",
19736
+ "generic.receipt.not_carried": "Receipt not carried with this page.",
19737
+ "generic.receipt.no_module": "This page has no viewer for this kind of receipt, so it is not shown.",
19738
+ "generic.receipt.not_closed": "No receipt: this deal had not closed when this page was built.",
19739
+ "generic.receipt.withheld": "The holder's disclosure policy keeps this receipt off this page.",
19740
+ "generic.receipt.unreadable": "This receipt could not be read, so it is not shown. The rest of the report is unchanged.",
19741
+ "generic.receipt.unverified": "This receipt did not pass its checks, so it is not shown. The rest of the report is unchanged."
19734
19742
  }
19735
19743
  };
19736
19744
 
@@ -20204,6 +20212,17 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
20204
20212
  "generic.producer.note",
20205
20213
  "generic.later.note",
20206
20214
  "generic.claim.failure",
20215
+ // The deal receipt line under a claim (capsule-viewer#228): a pack cannot
20216
+ // make a receipt that is not carried read as "no record", or hide that a
20217
+ // carried receipt could not be read or did not pass its checks.
20218
+ "generic.receipt.open",
20219
+ "generic.receipt.close",
20220
+ "generic.receipt.not_carried",
20221
+ "generic.receipt.no_module",
20222
+ "generic.receipt.not_closed",
20223
+ "generic.receipt.withheld",
20224
+ "generic.receipt.unreadable",
20225
+ "generic.receipt.unverified",
20207
20226
  // The shared front (report-front.ts): the mock-judge line, what the
20208
20227
  // aggregate's unknown count is, what the page and the bundle carry, and
20209
20228
  // the producer's findings label.
@@ -20798,7 +20817,7 @@ ${key}`);
20798
20817
  var DEFAULT_PACK_SHA256 = Object.freeze({
20799
20818
  lines: "4a03428e884337321754bd6657df0ebb6d5441821378a3b1ff17f2a625021cc5",
20800
20819
  groups: "81aeee3abd2d336824d81e24c7f5fad87227ffb4ff8f247cad96c4c855912b9f",
20801
- generic: "9987467e7d99ff4680fa6d7e2d2d634455f729958bfbd53ebac86c14508b031d"
20820
+ generic: "85ca54a0cdbce6c6e27fe6350df6dcdfa53c5c85d17d4c8e8fef396afffbf096"
20802
20821
  });
20803
20822
  function fill(key, text2, vars) {
20804
20823
  return text2.replace(PLACEHOLDER, (whole, name) => {
@@ -24486,12 +24505,8 @@ ${key}`);
24486
24505
  renderReportProofs2(levels.L2, model, bundle, verified, w);
24487
24506
  }
24488
24507
 
24489
- // src/generic-report-view.ts
24490
- var GENERIC_FRAME = {
24491
- tag: "div",
24492
- className: "gr",
24493
- page: "contract-report",
24494
- css: `
24508
+ // src/generic-report-styles.ts
24509
+ var GENERIC_REPORT_CSS = `
24495
24510
  .gr{${COMPLIANCE_FRAME_VARS}
24496
24511
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}
24497
24512
  .gr *{box-sizing:border-box}
@@ -24509,7 +24524,18 @@ ${key}`);
24509
24524
  .gr .rreason{margin:4px 0 6px 22px}
24510
24525
  .gr .rreason[data-tone="warn"],.gr .rflag[data-tone="warn"]{background:var(--bad-l);color:var(--bad);font-weight:700}
24511
24526
  .gr .tier-note{font-size:12.5px;color:var(--slate)}
24512
- ` + levelCss("gr") + frontCss(".gr")
24527
+ .gr .rcpt{margin:6px 0 6px 22px;font-size:13px}
24528
+ .gr .rcpt button{font:inherit;color:var(--navy);background:#fff;border:1px solid var(--navy);border-radius:6px;padding:2px 10px;cursor:pointer}
24529
+ .gr .rcpt-note{color:var(--slate);margin:0}
24530
+ .gr .rcpt-panel{margin-top:8px;border-top:1px solid #D9DDE3;padding-top:8px}
24531
+ ` + levelCss("gr") + frontCss(".gr");
24532
+
24533
+ // src/generic-report-view.ts
24534
+ var GENERIC_FRAME = {
24535
+ tag: "div",
24536
+ className: "gr",
24537
+ page: "contract-report",
24538
+ css: GENERIC_REPORT_CSS
24513
24539
  };
24514
24540
  var VERDICT_TONE = {
24515
24541
  met: "ok",
@@ -24628,7 +24654,77 @@ ${key}`);
24628
24654
  );
24629
24655
  return [line];
24630
24656
  }
24631
- function claimItem(claim, w, reasons) {
24657
+ function dealIdOf(claimId) {
24658
+ const at = claimId.indexOf("::");
24659
+ return at > 0 ? claimId.slice(0, at) : void 0;
24660
+ }
24661
+ function receiptLine(claim, w, receipts3) {
24662
+ const deal = dealIdOf(claim.id);
24663
+ if (deal === void 0) return [];
24664
+ const line = el10("div", "rcpt");
24665
+ line.dataset.receiptDeal = deal;
24666
+ const text2 = Object.prototype.hasOwnProperty.call(receipts3.texts, deal) ? receipts3.texts[deal] : void 0;
24667
+ if (typeof text2 !== "string") {
24668
+ const kind = text2 === null ? "withheld" : text2 !== void 0 && text2.state === "not-closed" ? "not-closed" : "not-carried";
24669
+ const note = el10(
24670
+ "p",
24671
+ "rcpt-note",
24672
+ w.t(
24673
+ kind === "withheld" ? "generic.receipt.withheld" : kind === "not-closed" ? "generic.receipt.not_closed" : "generic.receipt.not_carried"
24674
+ )
24675
+ );
24676
+ note.dataset.receipt = kind;
24677
+ line.append(note);
24678
+ return [line];
24679
+ }
24680
+ const button = el10(
24681
+ "button",
24682
+ "",
24683
+ w.t("generic.receipt.open")
24684
+ );
24685
+ button.setAttribute("type", "button");
24686
+ button.setAttribute("aria-expanded", "false");
24687
+ button.dataset.receipt = "open";
24688
+ const panel = el10("div", "rcpt-panel");
24689
+ panel.hidden = true;
24690
+ let state = "closed";
24691
+ button.addEventListener("click", () => {
24692
+ if (state === "shown") {
24693
+ panel.hidden = true;
24694
+ state = "hidden";
24695
+ button.setAttribute("aria-expanded", "false");
24696
+ button.textContent = w.t("generic.receipt.open");
24697
+ return;
24698
+ }
24699
+ panel.hidden = false;
24700
+ button.setAttribute("aria-expanded", "true");
24701
+ button.textContent = w.t("generic.receipt.close");
24702
+ if (state === "hidden") {
24703
+ state = "shown";
24704
+ return;
24705
+ }
24706
+ state = "shown";
24707
+ button.disabled = true;
24708
+ const showOutcome = (outcome) => {
24709
+ button.disabled = false;
24710
+ panel.dataset.receiptState = outcome;
24711
+ if (outcome === "opened") return;
24712
+ panel.replaceChildren(
24713
+ el10(
24714
+ "p",
24715
+ "rcpt-note",
24716
+ w.t(
24717
+ outcome === "no-module" ? "generic.receipt.no_module" : outcome === "unverified" ? "generic.receipt.unverified" : "generic.receipt.unreadable"
24718
+ )
24719
+ )
24720
+ );
24721
+ };
24722
+ receipts3.open(text2, panel).then(showOutcome, () => showOutcome("unreadable"));
24723
+ });
24724
+ line.append(button, panel);
24725
+ return [line];
24726
+ }
24727
+ function claimItem(claim, w, reasons, receipts3) {
24632
24728
  const item = el10("li", "");
24633
24729
  item.dataset.claimRef = claim.id;
24634
24730
  const head2 = el10("span", "");
@@ -24636,11 +24732,12 @@ ${key}`);
24636
24732
  head2.append(id, " ", verdictPill(shownVerdict(claim), w));
24637
24733
  item.append(
24638
24734
  levelToggle(2, head2, () => claimProofs(claim, w), { className: "claim" }),
24639
- ...reasonLines(claim, w, reasons)
24735
+ ...reasonLines(claim, w, reasons),
24736
+ ...receipts3 === void 0 ? [] : receiptLine(claim, w, receipts3)
24640
24737
  );
24641
24738
  return item;
24642
24739
  }
24643
- function rowItem(row2, w, later, tierOf, reasons) {
24740
+ function rowItem(row2, w, later, tierOf, reasons, receipts3) {
24644
24741
  const label = w.row(row2.requirementRef, "label");
24645
24742
  const name = el10("span", "rname");
24646
24743
  if (label !== void 0)
@@ -24683,7 +24780,8 @@ ${key}`);
24683
24780
  ))
24684
24781
  body.append(el10("p", "rnote", w.t("generic.later.note", { date })));
24685
24782
  const list2 = el10("ul", "claims");
24686
- for (const claim of row2.claims) list2.append(claimItem(claim, w, reasons));
24783
+ for (const claim of row2.claims)
24784
+ list2.append(claimItem(claim, w, reasons, receipts3));
24687
24785
  body.append(el10("h3", "", w.t("generic.claims.h")), list2);
24688
24786
  return body;
24689
24787
  },
@@ -24693,7 +24791,7 @@ ${key}`);
24693
24791
  toggle.dataset.contract = row2.contractRef;
24694
24792
  return toggle;
24695
24793
  }
24696
- function groupedRows(rows, w, later, tierOf, reasons) {
24794
+ function groupedRows(rows, w, later, tierOf, reasons, receipts3) {
24697
24795
  const box = el10("div", "groups");
24698
24796
  const order = [];
24699
24797
  const byGroup = /* @__PURE__ */ new Map();
@@ -24718,7 +24816,7 @@ ${key}`);
24718
24816
  part.append(heading);
24719
24817
  }
24720
24818
  for (const row2 of byGroup.get(group))
24721
- part.append(rowItem(row2, w, later, tierOf, reasons));
24819
+ part.append(rowItem(row2, w, later, tierOf, reasons, receipts3));
24722
24820
  box.append(part);
24723
24821
  }
24724
24822
  return box;
@@ -24728,10 +24826,10 @@ ${key}`);
24728
24826
  heading.append(" ", tagSource(el10("code", "", contract), "producer"));
24729
24827
  return heading;
24730
24828
  }
24731
- function byContract(rows, w, later, tierOf, reasons) {
24829
+ function byContract(rows, w, later, tierOf, reasons, receipts3) {
24732
24830
  const contracts = [...new Set(rows.map((row2) => row2.contractRef))];
24733
24831
  if (contracts.length <= 1)
24734
- return groupedRows(rows, w, later, tierOf, reasons);
24832
+ return groupedRows(rows, w, later, tierOf, reasons, receipts3);
24735
24833
  const box = el10("div", "contracts");
24736
24834
  for (const contract of contracts) {
24737
24835
  const part = el10("div", "contract");
@@ -24743,14 +24841,15 @@ ${key}`);
24743
24841
  w,
24744
24842
  later,
24745
24843
  tierOf,
24746
- reasons
24844
+ reasons,
24845
+ receipts3
24747
24846
  )
24748
24847
  );
24749
24848
  box.append(part);
24750
24849
  }
24751
24850
  return box;
24752
24851
  }
24753
- async function drawGeneric(levels, result3, bundle, verified, w, tierOf, reasons) {
24852
+ async function drawGeneric(levels, result3, bundle, verified, w, tierOf, reasons, receipts3) {
24754
24853
  const tierFor = (claim) => tierOf === void 0 ? "unstated" : tierOf(claim.contractRef, claim.requirementRef);
24755
24854
  const inForce = result3.claims.filter((claim) => !claim.later);
24756
24855
  const later = result3.claims.filter((claim) => claim.later);
@@ -24776,7 +24875,7 @@ ${key}`);
24776
24875
  section.dataset.section = "rows";
24777
24876
  const rows = rowsOf(inForce);
24778
24877
  if (tierOf === void 0)
24779
- section.append(byContract(rows, w, false, void 0, reasons));
24878
+ section.append(byContract(rows, w, false, void 0, reasons, receipts3));
24780
24879
  else
24781
24880
  for (const tier of ROW_TIERS) {
24782
24881
  const inTier = rows.filter(
@@ -24794,7 +24893,7 @@ ${key}`);
24794
24893
  })
24795
24894
  ),
24796
24895
  el10("p", "rnote", w.t(`generic.rtier.${tier}.note`)),
24797
- byContract(inTier, w, false, tierOf, reasons)
24896
+ byContract(inTier, w, false, tierOf, reasons, receipts3)
24798
24897
  );
24799
24898
  section.append(part);
24800
24899
  }
@@ -24808,7 +24907,7 @@ ${key}`);
24808
24907
  "",
24809
24908
  w.t("generic.later.title", { n: later.length.toLocaleString() })
24810
24909
  ),
24811
- byContract(laterRows, w, true, tierOf, reasons)
24910
+ byContract(laterRows, w, true, tierOf, reasons, receipts3)
24812
24911
  );
24813
24912
  section.append(part);
24814
24913
  }
@@ -24863,7 +24962,7 @@ ${key}`);
24863
24962
  function citesOneContract(result3) {
24864
24963
  return new Set(result3.claims.map((claim) => claim.contractRef)).size <= 1;
24865
24964
  }
24866
- async function renderContractReport(result3, input, bundle, verified, host, wording, contract) {
24965
+ async function renderContractReport(result3, input, bundle, verified, host, wording, contract, receipts3) {
24867
24966
  const tierOf = tierReader(result3, contract);
24868
24967
  const w = await contractReportWords(input.grouping, wording, {
24869
24968
  singleContract: citesOneContract(result3)
@@ -24951,7 +25050,8 @@ ${key}`);
24951
25050
  tierOf,
24952
25051
  // The pack's `row.<ref>.reason.<code>` words apply only to a Result
24953
25052
  // citing one contract (the Words gate); the reason itself shows always.
24954
- input.reasons
25053
+ input.reasons,
25054
+ receipts3
24955
25055
  );
24956
25056
  regions.L0.append(levels.L0);
24957
25057
  regions.L1.append(levels.L1);
@@ -26728,9 +26828,10 @@ ${pad.repeat(depth)}`;
26728
26828
  }
26729
26829
  const link = element6("a", CHECKED_SECTION_TITLE);
26730
26830
  link.className = "cv-shell-link";
26731
- link.setAttribute("href", `#${CHECKED_SECTION_ID}`);
26831
+ const checkedId = checkedSectionId(root);
26832
+ link.setAttribute("href", `#${checkedId}`);
26732
26833
  link.addEventListener("click", () => {
26733
- const section = root.ownerDocument.getElementById(CHECKED_SECTION_ID);
26834
+ const section = root.ownerDocument.getElementById(checkedId);
26734
26835
  if (section instanceof root.ownerDocument.defaultView.HTMLDetailsElement)
26735
26836
  section.open = true;
26736
26837
  });
@@ -26847,6 +26948,24 @@ ${pad.repeat(depth)}`;
26847
26948
  ]);
26848
26949
  var CHECKED_SECTION_TITLE = "How this page was checked";
26849
26950
  var CHECKED_SECTION_ID = "cv-checked";
26951
+ var checkedIds = /* @__PURE__ */ new WeakMap();
26952
+ var renderRoots = /* @__PURE__ */ new WeakSet();
26953
+ var nestedRenders = 0;
26954
+ function checkedSectionId(root) {
26955
+ const known = checkedIds.get(root);
26956
+ if (known !== void 0) return known;
26957
+ let nested = false;
26958
+ for (let a = root.parentElement; a !== null; a = a.parentElement)
26959
+ if (renderRoots.has(a)) {
26960
+ nested = true;
26961
+ break;
26962
+ }
26963
+ renderRoots.add(root);
26964
+ nestedRenders += 1;
26965
+ const id = nested ? `${CHECKED_SECTION_ID}-${nestedRenders}` : CHECKED_SECTION_ID;
26966
+ checkedIds.set(root, id);
26967
+ return id;
26968
+ }
26850
26969
  function renderPresentationHeader(root, bundle) {
26851
26970
  const presentation = readPresentationBlock(bundle);
26852
26971
  if (presentation === void 0) return;
@@ -27269,7 +27388,7 @@ ${pad.repeat(depth)}`;
27269
27388
  scope.dataset.checks = "scope";
27270
27389
  host.append(scope);
27271
27390
  }
27272
- async function renderVerificationPage(root, context, styled, applied, refused, citedSigners, verifierHint, depth, stamps, charts, contract, l3) {
27391
+ async function renderVerificationPage(root, context, styled, applied, refused, citedSigners, verifierHint, depth, stamps, charts, contract, l3, checkedId) {
27273
27392
  const { bundle, verification: verified } = context;
27274
27393
  const section = element6("section");
27275
27394
  section.dataset.page = "verification";
@@ -27379,7 +27498,7 @@ ${pad.repeat(depth)}`;
27379
27498
  page.append(element6("p", model.verifyIndependentlyLine));
27380
27499
  const folded = document.createElement("details");
27381
27500
  folded.className = "cv-checked";
27382
- folded.id = CHECKED_SECTION_ID;
27501
+ folded.id = checkedId;
27383
27502
  folded.dataset.checked = "";
27384
27503
  folded.open = !bundleVerified(verified) || depth === "L2";
27385
27504
  const line = checkedSummaryLine(bundleVerified(verified), model);
@@ -28271,7 +28390,8 @@ ${pad.repeat(depth)}`;
28271
28390
  model.verification,
28272
28391
  { L0: host.L0, L1: host.L1, L2: host.L2, depth: host.depth },
28273
28392
  host.wording,
28274
- host.contract
28393
+ host.contract,
28394
+ host.receipts
28275
28395
  );
28276
28396
  }
28277
28397
  };
@@ -28679,6 +28799,33 @@ ${pad.repeat(depth)}`;
28679
28799
  }
28680
28800
  var SETTLE_MS = 100;
28681
28801
  var checkingRenders = /* @__PURE__ */ new WeakMap();
28802
+ var RECEIPT_MODULE_IDS = /* @__PURE__ */ new Set([
28803
+ "capsulectl.deal-view/v0",
28804
+ "capsulectl.deal-view-composed/v0"
28805
+ ]);
28806
+ async function openReceipt(text2, panel, options) {
28807
+ let bundle;
28808
+ try {
28809
+ bundle = JSON.parse(text2);
28810
+ } catch {
28811
+ return "unreadable";
28812
+ }
28813
+ const context = await buildVerifiedBundleContext(bundle);
28814
+ const registry = options.registry ?? defaultRegistry;
28815
+ const resolution = await registry.resolve(
28816
+ context,
28817
+ DEFAULT_AUDIENCE,
28818
+ DEFAULT_FORMAT
28819
+ );
28820
+ if (resolution.kind !== "module" || !RECEIPT_MODULE_IDS.has(resolution.module.manifest.id))
28821
+ return bundleVerified(context.verification) ? "no-module" : "unverified";
28822
+ await renderEvidenceGraph(context, panel, void 0, {
28823
+ audience: DEFAULT_AUDIENCE,
28824
+ format: DEFAULT_FORMAT,
28825
+ ...options.registry === void 0 ? {} : { registry: options.registry }
28826
+ });
28827
+ return "opened";
28828
+ }
28682
28829
  async function renderVerifiedContext(context, root, options) {
28683
28830
  const { bundle, verification } = context;
28684
28831
  const verified = bundleVerified(verification);
@@ -28965,6 +29112,12 @@ ${pad.repeat(depth)}`;
28965
29112
  depth,
28966
29113
  ...options.wording === void 0 ? {} : { wording: options.wording },
28967
29114
  ...contract.checked === void 0 ? {} : { contract: contract.checked },
29115
+ ...options.receipts === void 0 ? {} : {
29116
+ receipts: {
29117
+ texts: options.receipts,
29118
+ open: (text2, panel) => openReceipt(text2, panel, options)
29119
+ }
29120
+ },
28968
29121
  setChromeClass(name) {
28969
29122
  if (name !== OUTCOME_CHROME && name !== COMPLIANCE_CHROME)
28970
29123
  throw new Error(`unknown chrome class ${JSON.stringify(name)}`);
@@ -29063,7 +29216,8 @@ ${pad.repeat(depth)}`;
29063
29216
  options.wording
29064
29217
  ),
29065
29218
  voice: options.voice ?? "shared"
29066
- } : void 0
29219
+ } : void 0,
29220
+ checkedSectionId(root)
29067
29221
  );
29068
29222
  const summary = root.querySelector("[data-verify-summary]");
29069
29223
  if (summary !== null) summary.textContent = checkedLine;
@@ -0,0 +1 @@
1
+ export declare const GENERIC_REPORT_CSS: string;
@@ -0,0 +1,36 @@
1
+ // SPDX-License-Identifier: BSD-3-Clause
2
+ /**
3
+ * The generic contract-report view's own stylesheet, scoped under `.gr`. It is
4
+ * its own module, as the other cards' are, so the emitter can list its hash in
5
+ * the page's CSP (CORE_RUNTIME_STYLES): the view inserts it as a `<style>`
6
+ * element at render time.
7
+ */
8
+ import { COMPLIANCE_FRAME_VARS } from "./frame-tokens.generated.js";
9
+ import { levelCss } from "./report-levels.js";
10
+ import { frontCss } from "./report-front-styles.js";
11
+ export const GENERIC_REPORT_CSS = `
12
+ .gr{${COMPLIANCE_FRAME_VARS}
13
+ font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}
14
+ .gr *{box-sizing:border-box}
15
+ .gr h1,.gr h2,.gr h3{font-family:Georgia,"Iowan Old Style",Cambria,serif;color:var(--navy);margin:0}
16
+ .gr h1{font-size:28px;margin:6px 0 4px}
17
+ .gr h2{font-size:21px;margin:0 0 6px}
18
+ .gr h3{font-size:17px;margin:18px 0 6px}
19
+ .gr .rsum,.gr .counts{color:var(--slate);margin:0 0 8px}
20
+ .gr .rnote{font-size:12.5px;color:var(--slate);margin:2px 0 8px}
21
+ .gr .tally{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:13px;margin:4px 0}
22
+ .gr .rname{font-weight:600;color:var(--navy)}
23
+ .gr .rname code,.gr .cid{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;word-break:break-all}
24
+ .gr ul.claims{list-style:none;margin:6px 0 0;padding:0}
25
+ .gr .rreason,.gr .rflag{font-size:12.5px;border-radius:6px;padding:2px 8px;background:#EEF0F3;color:var(--slate)}
26
+ .gr .rreason{margin:4px 0 6px 22px}
27
+ .gr .rreason[data-tone="warn"],.gr .rflag[data-tone="warn"]{background:var(--bad-l);color:var(--bad);font-weight:700}
28
+ .gr .tier-note{font-size:12.5px;color:var(--slate)}
29
+ .gr .rcpt{margin:6px 0 6px 22px;font-size:13px}
30
+ .gr .rcpt button{font:inherit;color:var(--navy);background:#fff;border:1px solid var(--navy);border-radius:6px;padding:2px 10px;cursor:pointer}
31
+ .gr .rcpt-note{color:var(--slate);margin:0}
32
+ .gr .rcpt-panel{margin-top:8px;border-top:1px solid #D9DDE3;padding-top:8px}
33
+ ` +
34
+ levelCss("gr") +
35
+ frontCss(".gr");
36
+ //# sourceMappingURL=generic-report-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic-report-styles.js","sourceRoot":"","sources":["../src/generic-report-styles.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC;;;;;GAKG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAC7B;MACI,qBAAqB;;;;;;;;;;;;;;;;;;;;;CAqB1B;IACC,QAAQ,CAAC,IAAI,CAAC;IACd,QAAQ,CAAC,KAAK,CAAC,CAAC"}
@@ -28,6 +28,31 @@ export declare const GENERIC_FRAME: {
28
28
  };
29
29
  /** The reasons the Result's producer gives for claims, by claim id (claim-reasons.ts). */
30
30
  type ReasonsOf = ReadonlyMap<string, ClaimReason>;
31
+ /** What opening a carried receipt came to: drawn, no module for it, not readable, or read but not passing its checks. */
32
+ export type ReceiptOpen = "opened" | "no-module" | "unreadable" | "unverified";
33
+ /**
34
+ * A deal that had no settlement or delivery recorded when the page was built:
35
+ * it has no receipt yet, which is not a fault of the page and not a holder's
36
+ * choice (capsule-viewer#358, Sherlock2's what). Any other object is read as
37
+ * an entry nothing here understands, and reads as not carried.
38
+ */
39
+ export interface ReceiptNotClosed {
40
+ readonly state: "not-closed";
41
+ }
42
+ /** One deal's entry in the `receipts` option: a receipt bundle's JSON text, `null` (kept off the page by the holder's policy) or {@link ReceiptNotClosed}. */
43
+ export type DealReceiptEntry = string | null | ReceiptNotClosed;
44
+ /**
45
+ * The deal receipts a report page carries (the page's `receipts` option):
46
+ * each deal's receipt bundle as the JSON text the node served, by deal id, and
47
+ * the runtime's way to draw one into a panel. The page never reads a
48
+ * receipt's content itself; the receipt module the page also carries draws it.
49
+ */
50
+ export interface ReceiptsInput {
51
+ readonly texts: Readonly<Record<string, DealReceiptEntry>>;
52
+ readonly open: (text: string, panel: HTMLElement) => Promise<ReceiptOpen>;
53
+ }
54
+ /** The deal a claim belongs to: its id before the first `::`, as the inference-deals Result writes it, or none. */
55
+ export declare function dealIdOf(claimId: string): string | undefined;
31
56
  /**
32
57
  * Draw the `generic` grouping into the three region wrappers
33
58
  * (contract-report.ts made them and put the stylesheet in L0).
@@ -36,5 +61,5 @@ export declare function drawGeneric(levels: {
36
61
  readonly L0: HTMLElement;
37
62
  readonly L1: HTMLElement;
38
63
  readonly L2: HTMLElement;
39
- }, result: ResultRoot, bundle: unknown, verified: BundleVerificationResult, w: Words, tierOf?: TierOf, reasons?: ReasonsOf): Promise<void>;
64
+ }, result: ResultRoot, bundle: unknown, verified: BundleVerificationResult, w: Words, tierOf?: TierOf, reasons?: ReasonsOf, receipts?: ReceiptsInput): Promise<void>;
40
65
  export {};