@iota-uz/sdk 0.15.0 → 0.17.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 (55) hide show
  1. package/dist/client-host/identity.d.ts +4 -4
  2. package/dist/client-host/identity.js +2 -2
  3. package/dist/lens/{CascadePanel-jtC2EUUS.js → CascadePanel-Sd2OKQx-.js} +15 -15
  4. package/dist/lens/{ChartDataEquivalent-BFDdHoQn.js → ChartDataEquivalent-DgCAb4Ov.js} +14 -13
  5. package/dist/lens/ChartPanel-CiAahY9O.js +709 -0
  6. package/dist/lens/{CoveragePanel-5LWQwFMZ.js → CoveragePanel-DeeKg8gF.js} +10 -10
  7. package/dist/lens/{GaugePanel-eVYvp3Hk.js → GaugePanel-8rsf_XHS.js} +8 -8
  8. package/dist/lens/{MapPanel-CzpZKz1Y.js → MapPanel-Bq0mfVCB.js} +14 -14
  9. package/dist/lens/{MetricFlowPanel-CG2Bj7s6.js → MetricFlowPanel-ZBJqPFpc.js} +2 -2
  10. package/dist/lens/{MetricHierarchyPanel-Difdcafn.js → MetricHierarchyPanel-DStGwvVU.js} +2 -2
  11. package/dist/lens/{MetricRelationshipPanel-Cq1dFTeY.js → MetricRelationshipPanel-D6ItmGCS.js} +2 -2
  12. package/dist/lens/{PrintReport-BiUdo8XG.js → PrintReport-Dr-6xXVr.js} +413 -397
  13. package/dist/lens/{TablePanel-_6j7epQg.js → TablePanel-CzLP8gG0.js} +1 -1
  14. package/dist/lens/{adapter-DRShqW45.js → adapter-BwEwcw2W.js} +4960 -4956
  15. package/dist/lens/adapter-CgoRd_uP.js +6 -0
  16. package/dist/lens/charts/adapter.d.ts +1 -0
  17. package/dist/lens/charts/adapter.d.ts.map +1 -1
  18. package/dist/lens/charts/echarts/options.d.ts.map +1 -1
  19. package/dist/lens/charts/keys.d.ts +2 -0
  20. package/dist/lens/charts/keys.d.ts.map +1 -1
  21. package/dist/lens/contract/schemas.d.ts.map +1 -1
  22. package/dist/lens/contract/types.d.ts +1 -0
  23. package/dist/lens/contract/types.d.ts.map +1 -1
  24. package/dist/lens/{index-CmXDbBaF.js → index-B6anZ5Pr.js} +1 -1
  25. package/dist/lens/{index-BBtBPnTb.js → index-R9mnOHaj.js} +684 -667
  26. package/dist/lens/index.js +1 -1
  27. package/dist/lens/{install-ByIx15ES.js → install-CsNOaFxV.js} +1 -1
  28. package/dist/lens/{install-DKwCLbtk.js → install-CumkiUJn.js} +1 -1
  29. package/dist/lens/{install-ByEamXef.js → install-D5OiGDnd.js} +1 -1
  30. package/dist/lens/{install-DIbrzh5h.js → install-VEXJv-Wi.js} +1 -1
  31. package/dist/lens/keys-6_gqLhcv.js +78 -0
  32. package/dist/lens/{metricViews-IoSavtwn.js → metricViews-De-9pff-.js} +1 -1
  33. package/dist/lens/panels/ChartPanel.d.ts.map +1 -1
  34. package/dist/lens/panels/data.d.ts +2 -0
  35. package/dist/lens/panels/data.d.ts.map +1 -1
  36. package/dist/lens/{prefetch-CrMQhAEy.js → prefetch-C_qYKOTU.js} +2 -2
  37. package/dist/lens/{prefetchPanels-BbWAAYrz.js → prefetchPanels-CD4C-A5q.js} +1 -1
  38. package/dist/lens/print/PrintReport.d.ts.map +1 -1
  39. package/dist/lens/{print-CLo-mTEP.js → print-Iu804kRb.js} +18 -18
  40. package/dist/lens/{scales-CChHRiVq.js → scales-CWTA0tSQ.js} +53 -53
  41. package/dist/sdk-identity.cjs +3 -3
  42. package/dist/sdk-identity.js +3 -3
  43. package/dist/sdk-identity.json +2 -2
  44. package/dist/testing/driver.d.ts +19 -0
  45. package/dist/testing/driver.js +103 -30
  46. package/dist/testing/fixtures.d.ts +27 -0
  47. package/dist/testing/fixtures.js +19 -4
  48. package/dist/testing/index.d.ts +3 -2
  49. package/dist/testing/index.js +6 -30
  50. package/dist/testing/lease.d.ts +11 -0
  51. package/dist/testing/lease.js +44 -0
  52. package/package.json +1 -1
  53. package/dist/lens/ChartHost-DTnhnwkn.js +0 -68
  54. package/dist/lens/ChartPanel-_S4IVYdJ.js +0 -730
  55. package/dist/lens/keys-DenV5HsJ.js +0 -12
@@ -1,18 +1,18 @@
1
1
  import { jsx as s, jsxs as u } from "react/jsx-runtime";
2
- import { useMemo as A, createContext as pe, useCallback as G, useContext as he, Fragment as fe } from "react";
3
- import { createPortal as ge } from "react-dom";
4
- import { W as be, b as ve, a as ye } from "./CascadePanel-jtC2EUUS.js";
5
- import { C as ke } from "./ChartHost-DTnhnwkn.js";
6
- import { u as T, r as Ne, f as M, b as we, a as xe, c as Fe, d as te, e as $e, g as ne, s as Se, h as Me } from "./index-BBtBPnTb.js";
2
+ import { useMemo as A, createContext as Me, useCallback as ae, useContext as Se, Fragment as Ce } from "react";
3
+ import { createPortal as De } from "react-dom";
4
+ import { W as Te, b as Pe, a as Ke } from "./CascadePanel-Sd2OKQx-.js";
5
+ import { C as Ae, m as H, f as Re } from "./keys-6_gqLhcv.js";
6
+ import { u as P, r as Le, f as D, b as Ve, a as qe, c as Ie, d as de, e as Ee, g as ue, h as me, i as pe, j as he } from "./index-R9mnOHaj.js";
7
7
  import "@iota-uz/sdk/client-host";
8
- import { r as B, a as Q, c as Ce, b as De, f as J, d as Te, h as Pe } from "./metricViews-IoSavtwn.js";
9
- import { relationshipSentence as Ae } from "./MetricRelationshipPanel-Cq1dFTeY.js";
10
- function Ke(e, t) {
11
- const n = B(e);
8
+ import { r as _, a as re, c as Be, b as _e, f as ie, d as Oe, h as je } from "./metricViews-De-9pff-.js";
9
+ import { relationshipSentence as Ue } from "./MetricRelationshipPanel-D6ItmGCS.js";
10
+ function We(e, t) {
11
+ const n = _(e);
12
12
  return n ? t(n.meta.labelKey, n.meta.fallback) : void 0;
13
13
  }
14
- function Re(e, t) {
15
- const n = B(e);
14
+ function ze(e, t) {
15
+ const n = _(e);
16
16
  if (n) {
17
17
  if (n.axis === "availability")
18
18
  return t(
@@ -31,7 +31,7 @@ function Re(e, t) {
31
31
  );
32
32
  }
33
33
  }
34
- const Y = {
34
+ const se = {
35
35
  verified: {
36
36
  labelKey: "print.defVerified",
37
37
  fallback: "Verified — the figure is taken from the accounting system as recorded, without derivation."
@@ -60,41 +60,41 @@ const Y = {
60
60
  labelKey: "print.defUnavailable",
61
61
  fallback: "Unavailable — the figure could not be produced, and is shown as a dash rather than as a zero."
62
62
  }
63
- }, Le = /* @__PURE__ */ new Set(["config_required", "empty_source", "unavailable"]);
64
- function Ve(e, t) {
65
- const n = /* @__PURE__ */ new Set(), a = Object.keys(Y);
63
+ }, He = /* @__PURE__ */ new Set(["config_required", "empty_source", "unavailable"]);
64
+ function Ge(e, t) {
65
+ const n = /* @__PURE__ */ new Set(), a = Object.keys(se);
66
66
  for (const r of e) {
67
- const i = B(r);
67
+ const i = _(r);
68
68
  i && n.add(i.value);
69
69
  }
70
70
  return a.filter((r) => n.has(r)).map((r) => {
71
- const i = Y[r], o = Le.has(r) ? { availability: r } : { confidence: r };
71
+ const i = se[r], o = He.has(r) ? { availability: r } : { confidence: r };
72
72
  return {
73
73
  value: r,
74
- label: Ke(o, t) ?? r,
74
+ label: We(o, t) ?? r,
75
75
  definition: t(i.labelKey, i.fallback)
76
76
  };
77
77
  });
78
78
  }
79
- function E({ confidence: e, availability: t }) {
80
- const n = T(), a = B({ confidence: e, availability: t });
79
+ function O({ confidence: e, availability: t }) {
80
+ const n = P(), a = _({ confidence: e, availability: t });
81
81
  return a ? /* @__PURE__ */ s("span", { className: "lens-print-chip", "data-quality": a.value, children: n(a.meta.labelKey, a.meta.fallback) }) : null;
82
82
  }
83
- const ae = /* @__PURE__ */ new Set(["pie", "donut", "radial", "bar", "hbar", "line", "area"]), re = /* @__PURE__ */ new Set(["metric_flow", "metric_hierarchy", "metric_relationship"]);
84
- function q(e) {
83
+ const fe = /* @__PURE__ */ new Set(["pie", "donut", "radial", "bar", "hbar", "line", "area"]), ge = /* @__PURE__ */ new Set(["metric_flow", "metric_hierarchy", "metric_relationship"]);
84
+ function E(e) {
85
85
  if (typeof e == "number" && Number.isFinite(e)) return e;
86
86
  if (typeof e == "string" && e.trim() !== "") {
87
87
  const t = Number(e);
88
88
  if (Number.isFinite(t)) return t;
89
89
  }
90
90
  }
91
- function R(e) {
91
+ function V(e) {
92
92
  return e == null ? "—" : typeof e == "string" ? e || "—" : typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? String(e) : "—";
93
93
  }
94
94
  function C(e, t) {
95
95
  return t ? e.columns.findIndex(({ name: n }) => n === t) : -1;
96
96
  }
97
- function qe(e, t) {
97
+ function Qe(e, t) {
98
98
  const n = { ...e.format };
99
99
  for (const [a, r] of Object.entries(t)) {
100
100
  const i = e.encoding[a];
@@ -102,58 +102,58 @@ function qe(e, t) {
102
102
  }
103
103
  return n;
104
104
  }
105
- function Ie(e, t) {
105
+ function Je(e, t) {
106
106
  return e === "partition" ? ["pie", "donut", "bar", "hbar"].includes(t) ? t : "donut" : e === "reconciliation" ? "cascade" : e === "series" ? "line" : "table";
107
107
  }
108
- function D(e) {
108
+ function T(e) {
109
109
  var i;
110
- const t = ((i = e.perspective) == null ? void 0 : i.semantics) ?? e.panel.semantics, n = e.level.encoding ?? e.panel.encoding, r = e.root || e.path.length === 0 ? e.panel.kind : e.level.view ?? Ie(t, e.panel.kind);
110
+ const t = ((i = e.perspective) == null ? void 0 : i.semantics) ?? e.panel.semantics, n = e.level.encoding ?? e.panel.encoding, r = e.root || e.path.length === 0 ? e.panel.kind : e.level.view ?? Je(t, e.panel.kind);
111
111
  return {
112
- ...Ne(e.panel, r),
112
+ ...Le(e.panel, r),
113
113
  title: e.level.label.trim() || e.panel.title,
114
114
  semantics: t,
115
115
  encoding: n,
116
- format: qe(e.panel, n),
116
+ format: Qe(e.panel, n),
117
117
  presentation: e.level.presentation ?? e.panel.presentation
118
118
  };
119
119
  }
120
- function Be(e) {
120
+ function Ye(e) {
121
121
  if (!(!e || e.rows.length === 0))
122
122
  return JSON.stringify([e.columns.map(({ name: t }) => t), e.rows]);
123
123
  }
124
- function Ee(e) {
124
+ function Xe(e) {
125
125
  var a, r;
126
- const t = D(e.section), n = [t];
126
+ const t = T(e.section), n = [t];
127
127
  for (const i of ((a = t.metricFlow) == null ? void 0 : a.stages) ?? []) n.push(i);
128
128
  for (const i of ((r = t.metricHierarchy) == null ? void 0 : r.rows) ?? []) n.push(i);
129
129
  return t.metricRelationship && n.push(t.metricRelationship.source, t.metricRelationship.target), n;
130
130
  }
131
- function _e(e) {
131
+ function Ze(e) {
132
132
  var r;
133
- const t = D(e.section), n = e.section.frame;
133
+ const t = T(e.section), n = e.section.frame;
134
134
  if (!n || !((r = t.columns) != null && r.length)) return [];
135
135
  const a = [];
136
136
  for (const i of t.columns) {
137
137
  const o = C(n, i.badgeField);
138
138
  if (!(o < 0))
139
139
  for (const l of n.rows) {
140
- const d = R(l[o]).trim();
140
+ const d = V(l[o]).trim();
141
141
  d && d !== "—" && a.push(d);
142
142
  }
143
143
  }
144
144
  return a;
145
145
  }
146
- function Oe(e, t) {
146
+ function et(e, t) {
147
147
  var r;
148
148
  const n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
149
149
  for (const i of e) {
150
- const o = D(i.section), l = [], d = (r = o.info) == null ? void 0 : r.trim();
150
+ const o = T(i.section), l = [], d = (r = o.info) == null ? void 0 : r.trim();
151
151
  d && l.push(d);
152
- for (const p of Ee(i)) {
153
- const h = Re(p, t);
152
+ for (const p of Xe(i)) {
153
+ const h = ze(p, t);
154
154
  h && l.push(h);
155
155
  }
156
- l.push(..._e(i));
156
+ l.push(...Ze(i));
157
157
  const c = { markers: [], notes: [] };
158
158
  for (const p of l) {
159
159
  const h = n.get(p);
@@ -161,26 +161,26 @@ function Oe(e, t) {
161
161
  c.markers.includes(h) || c.markers.push(h);
162
162
  continue;
163
163
  }
164
- const y = n.size + 1;
165
- n.set(p, y), c.markers.push(y), c.notes.push({ number: y, text: p });
164
+ const k = n.size + 1;
165
+ n.set(p, k), c.markers.push(k), c.notes.push({ number: k, text: p });
166
166
  }
167
167
  c.markers.length > 0 && a.set(i.section.id, c);
168
168
  }
169
169
  return a;
170
170
  }
171
- const je = 1e4, Ue = [1e9, 1e6, 1e3];
172
- function U(e, t) {
171
+ const tt = 1e4, nt = [1e9, 1e6, 1e3];
172
+ function G(e, t) {
173
173
  if (e == null || e === "") return;
174
174
  const n = typeof e == "number" ? e : Number(e);
175
175
  if (Number.isFinite(n))
176
176
  return t.minorUnits && t.kind === "money" ? n / 100 : n;
177
177
  }
178
- function We(e, t) {
178
+ function at(e, t) {
179
179
  var r;
180
180
  return ((r = new Intl.NumberFormat(t, { notation: "compact", compactDisplay: "short" }).formatToParts(e).find((i) => i.type === "compact")) == null ? void 0 : r.value.trim()) || void 0;
181
181
  }
182
- function ze(e, t, n, a) {
183
- return M(e, {
182
+ function rt(e, t, n, a) {
183
+ return D(e, {
184
184
  ...n,
185
185
  kind: "number",
186
186
  minorUnits: !1,
@@ -190,23 +190,23 @@ function ze(e, t, n, a) {
190
190
  precision: a
191
191
  }, t);
192
192
  }
193
- function j(e, t, n) {
194
- const a = { format: (h) => M(h, t, n) };
193
+ function W(e, t, n) {
194
+ const a = { format: (h) => D(h, t, n) };
195
195
  if (!t || t.kind !== "money" && t.kind !== "number") return a;
196
- const r = e.map((h) => U(h, t)).filter((h) => h !== void 0 && h !== 0);
196
+ const r = e.map((h) => G(h, t)).filter((h) => h !== void 0 && h !== 0);
197
197
  if (r.length === 0) return a;
198
- const i = t.kind === "money" ? (t.currency ?? "").trim() : "", o = r.map((h) => Math.abs(h)), l = Math.max(...o), d = Math.min(...o), c = l / d <= je ? Ue.find((h) => l >= h) : void 0, p = c ? We(c, n) : void 0;
198
+ const i = t.kind === "money" ? (t.currency ?? "").trim() : "", o = r.map((h) => Math.abs(h)), l = Math.max(...o), d = Math.min(...o), c = l / d <= tt ? nt.find((h) => l >= h) : void 0, p = c ? at(c, n) : void 0;
199
199
  return c && p ? {
200
200
  note: [p, i].filter(Boolean).join(" "),
201
201
  format: (h) => {
202
- const y = U(h, t);
203
- return y === void 0 ? M(h, t, n) : ze(y / c, n, t, 2);
202
+ const k = G(h, t);
203
+ return k === void 0 ? D(h, t, n) : rt(k / c, n, t, 2);
204
204
  }
205
205
  } : i ? {
206
206
  note: i,
207
207
  format: (h) => {
208
- const y = U(h, t);
209
- return y === void 0 ? M(h, t, n) : M(y, {
208
+ const k = G(h, t);
209
+ return k === void 0 ? D(h, t, n) : D(k, {
210
210
  ...t,
211
211
  kind: "number",
212
212
  minorUnits: !1,
@@ -216,28 +216,28 @@ function j(e, t, n) {
216
216
  }
217
217
  } : a;
218
218
  }
219
- function He(e, t) {
220
- const n = T();
219
+ function it(e, t) {
220
+ const n = P();
221
221
  return A(() => {
222
222
  if (t.frame)
223
- return we(e, t.frame, {
223
+ return Ve(e, t.frame, {
224
224
  missingColumn: (a) => n("panel.missingColumn", "Panel data is missing the “{column}” column.", { column: a }),
225
225
  duplicateKey: (a) => n("panel.duplicateKey", "Panel data has a duplicate key “{key}”.", { key: a })
226
226
  });
227
227
  }, [e, t.frame, n]);
228
228
  }
229
- function O(e, t, n = "value") {
229
+ function U(e, t, n = "value") {
230
230
  const a = e.encoding[n];
231
231
  return A(
232
- () => (r) => M(r, a ? e.format[a] : void 0, t),
232
+ () => (r) => D(r, a ? e.format[a] : void 0, t),
233
233
  [a, t, e.format]
234
234
  );
235
235
  }
236
- function Ge({ join: e, panel: t, locale: n }) {
237
- const a = T(), r = O(t, n), i = A(() => {
236
+ function st({ join: e, panel: t, locale: n }) {
237
+ const a = P(), r = U(t, n), i = A(() => {
238
238
  const d = [];
239
- return J(t, e, (c) => (d.push(c), "")), j(d, t.encoding.value ? t.format[t.encoding.value] : void 0, n);
240
- }, [e, n, t]), o = J(t, e, (d) => i.format(d)), l = Te(t, e);
239
+ return ie(t, e, (c) => (d.push(c), "")), W(d, t.encoding.value ? t.format[t.encoding.value] : void 0, n);
240
+ }, [e, n, t]), o = ie(t, e, (d) => i.format(d)), l = Oe(t, e);
241
241
  return o.length === 0 ? null : /* @__PURE__ */ u("div", { className: "lens-print-formula", children: [
242
242
  i.note && /* @__PURE__ */ s("p", { className: "lens-print-formula-unit", children: i.note }),
243
243
  /* @__PURE__ */ s("ol", { className: "lens-print-flow", children: o.map((d, c) => /* @__PURE__ */ u(
@@ -253,7 +253,7 @@ function Ge({ join: e, panel: t, locale: n }) {
253
253
  ] }),
254
254
  /* @__PURE__ */ u("span", { className: "lens-print-flow-value", children: [
255
255
  d.showDash ? "—" : d.text,
256
- /* @__PURE__ */ s(E, { confidence: d.confidence, availability: d.availability })
256
+ /* @__PURE__ */ s(O, { confidence: d.confidence, availability: d.availability })
257
257
  ] })
258
258
  ]
259
259
  },
@@ -262,8 +262,8 @@ function Ge({ join: e, panel: t, locale: n }) {
262
262
  l !== void 0 && /* @__PURE__ */ s("p", { className: "lens-print-formula-note", children: a("flow.difference", "Difference: {delta}", { delta: r(l) }) })
263
263
  ] });
264
264
  }
265
- function Qe({ join: e, panel: t, locale: n }) {
266
- const a = T(), r = O(t, n), i = O(t, n, "share"), o = Pe(t, e, r, i);
265
+ function lt({ join: e, panel: t, locale: n }) {
266
+ const a = P(), r = U(t, n), i = U(t, n, "share"), o = je(t, e, r, i);
267
267
  return o.length === 0 ? null : /* @__PURE__ */ s("div", { className: "lens-print-formula", children: /* @__PURE__ */ s("ul", { className: "lens-print-hierarchy", children: o.map((l) => /* @__PURE__ */ u(
268
268
  "li",
269
269
  {
@@ -278,7 +278,7 @@ function Qe({ join: e, panel: t, locale: n }) {
278
278
  ] }),
279
279
  /* @__PURE__ */ u("span", { className: "lens-print-hierarchy-value", children: [
280
280
  l.showDash ? "—" : l.valueText,
281
- /* @__PURE__ */ s(E, { confidence: l.confidence, availability: l.availability })
281
+ /* @__PURE__ */ s(O, { confidence: l.confidence, availability: l.availability })
282
282
  ] }),
283
283
  /* @__PURE__ */ s("span", { className: "lens-print-hierarchy-share", children: l.shareText ?? "" }),
284
284
  l.reconcile && /* @__PURE__ */ s("span", { className: "lens-print-hierarchy-reconcile", children: l.reconcile.balanced ? a("hierarchy.allocated", "Allocated 100%") : a("hierarchy.difference", "Difference: {delta}", {
@@ -289,54 +289,54 @@ function Qe({ join: e, panel: t, locale: n }) {
289
289
  l.row.key
290
290
  )) }) });
291
291
  }
292
- function Je({ join: e, panel: t, locale: n }) {
293
- const a = T(), r = O(t, n), i = t.metricRelationship;
292
+ function ot({ join: e, panel: t, locale: n }) {
293
+ const a = P(), r = U(t, n), i = t.metricRelationship;
294
294
  if (!i) return null;
295
- const o = Q(t, e, i.source, r), l = Q(t, e, i.target, r), d = Ce(i).horizontal;
295
+ const o = re(t, e, i.source, r), l = re(t, e, i.target, r), d = Be(i).horizontal;
296
296
  return /* @__PURE__ */ u("div", { className: "lens-print-formula lens-print-relationship", children: [
297
- /* @__PURE__ */ s("p", { className: "lens-print-relationship-claim", children: Ae(a, i, (o == null ? void 0 : o.end.label) ?? "", (l == null ? void 0 : l.end.label) ?? "") }),
297
+ /* @__PURE__ */ s("p", { className: "lens-print-relationship-claim", children: Ue(a, i, (o == null ? void 0 : o.end.label) ?? "", (l == null ? void 0 : l.end.label) ?? "") }),
298
298
  /* @__PURE__ */ s("div", { className: "lens-print-relationship-ends", children: [o, l].map((c, p) => /* @__PURE__ */ u("div", { className: "lens-print-relationship-end", children: [
299
299
  /* @__PURE__ */ s("span", { className: "lens-print-relationship-label", children: (c == null ? void 0 : c.end.label) ?? "—" }),
300
300
  /* @__PURE__ */ u("span", { className: "lens-print-relationship-value", children: [
301
301
  !c || c.showDash ? "—" : c.valueText,
302
- /* @__PURE__ */ s(E, { confidence: c == null ? void 0 : c.confidence, availability: c == null ? void 0 : c.availability })
302
+ /* @__PURE__ */ s(O, { confidence: c == null ? void 0 : c.confidence, availability: c == null ? void 0 : c.availability })
303
303
  ] }),
304
304
  p === 0 && /* @__PURE__ */ s("span", { "aria-hidden": "true", className: "lens-print-relationship-glyph", children: d })
305
305
  ] }, (c == null ? void 0 : c.end.key) ?? p)) }),
306
306
  /* @__PURE__ */ u("p", { className: "lens-print-formula-note", children: [
307
- a(`relationship.type.${i.type}`, De[i.type]),
307
+ a(`relationship.type.${i.type}`, _e[i.type]),
308
308
  i.note ? ` · ${i.note}` : ""
309
309
  ] })
310
310
  ] });
311
311
  }
312
- function ie({ section: e }) {
313
- const t = A(() => D(e), [e]), n = He(t, e), a = e.document.meta.locale;
314
- return t.kind === "metric_relationship" ? /* @__PURE__ */ s(Je, { join: n, locale: a, panel: t }) : !n || n.kind !== "ok" ? null : t.kind === "metric_flow" ? /* @__PURE__ */ s(Ge, { join: n, locale: a, panel: t }) : t.kind === "metric_hierarchy" ? /* @__PURE__ */ s(Qe, { join: n, locale: a, panel: t }) : null;
312
+ function be({ section: e }) {
313
+ const t = A(() => T(e), [e]), n = it(t, e), a = e.document.meta.locale;
314
+ return t.kind === "metric_relationship" ? /* @__PURE__ */ s(ot, { join: n, locale: a, panel: t }) : !n || n.kind !== "ok" ? null : t.kind === "metric_flow" ? /* @__PURE__ */ s(st, { join: n, locale: a, panel: t }) : t.kind === "metric_hierarchy" ? /* @__PURE__ */ s(lt, { join: n, locale: a, panel: t }) : null;
315
315
  }
316
- function _(e, t, n) {
316
+ function j(e, t, n) {
317
317
  const a = C(t, e.encoding.label ?? e.encoding.category ?? e.encoding.id), r = C(t, e.encoding.value), i = C(t, e.encoding.series);
318
318
  if (r < 0) return [];
319
319
  const o = e.encoding.value ? e.format[e.encoding.value] : void 0, l = [];
320
320
  return t.rows.forEach((d, c) => {
321
- const p = q(d[r]);
321
+ const p = E(d[r]);
322
322
  p !== void 0 && l.push({
323
323
  row: c,
324
- group: i >= 0 ? R(d[i]) : "",
325
- label: a >= 0 ? R(d[a]) : R(d[r]),
324
+ group: i >= 0 ? V(d[i]) : "",
325
+ label: a >= 0 ? V(d[a]) : V(d[r]),
326
326
  value: p,
327
- formatted: M(d[r], o, n)
327
+ formatted: D(d[r], o, n)
328
328
  });
329
329
  }), l;
330
330
  }
331
- function V(e, t) {
331
+ function I(e, t) {
332
332
  return new Intl.NumberFormat(e, {
333
333
  style: "percent",
334
334
  minimumFractionDigits: t >= 0.1 ? 0 : 1,
335
335
  maximumFractionDigits: 1
336
336
  }).format(t);
337
337
  }
338
- function Ye(e, t, n) {
339
- const a = _(e, t, n).filter(({ value: p }) => p > 0);
338
+ function ct(e, t, n) {
339
+ const a = j(e, t, n).filter(({ value: p }) => p > 0);
340
340
  if (a.length < 2) return;
341
341
  const r = [...a].sort((p, h) => h.value - p.value)[0], i = a.filter(({ group: p }) => p === r.group);
342
342
  if (i.length < 2) return;
@@ -349,7 +349,7 @@ function Ye(e, t, n) {
349
349
  fallback: "{label} carries {share} of the total; the remainder is {rest}.",
350
350
  vars: {
351
351
  label: d.label,
352
- share: V(n, d.value / o),
352
+ share: I(n, d.value / o),
353
353
  rest: l[1].label
354
354
  }
355
355
  };
@@ -359,38 +359,38 @@ function Ye(e, t, n) {
359
359
  fallback: "{label} is the largest of the three at {share}; together they make the whole.",
360
360
  vars: {
361
361
  label: d.label,
362
- share: V(n, d.value / o)
362
+ share: I(n, d.value / o)
363
363
  }
364
364
  } : {
365
365
  labelKey: "print.factPartition",
366
366
  fallback: "{label} is the largest share at {share}; the three largest together make {top}, ahead of {rest} smaller categories.",
367
367
  vars: {
368
368
  label: d.label,
369
- share: V(n, d.value / o),
370
- top: V(n, c / o),
369
+ share: I(n, d.value / o),
370
+ top: I(n, c / o),
371
371
  rest: l.length - 3
372
372
  }
373
373
  };
374
374
  }
375
- function Xe(e, t, n) {
375
+ function dt(e, t, n) {
376
376
  var l;
377
377
  const a = (l = e.radial) == null ? void 0 : l.max;
378
378
  if (!a || a <= 0) return;
379
- const i = _(e, t, n).reduce((d, { value: c }) => d + Math.max(0, c), 0);
379
+ const i = j(e, t, n).reduce((d, { value: c }) => d + Math.max(0, c), 0);
380
380
  if (i <= 0) return;
381
381
  const o = e.encoding.value ? e.format[e.encoding.value] : void 0;
382
382
  return {
383
383
  labelKey: "print.factProgress",
384
384
  fallback: "{value} of {max} — {share} covered.",
385
385
  vars: {
386
- value: M(i, o, n),
387
- max: M(a, o, n),
388
- share: V(n, Math.min(i / a, 1))
386
+ value: D(i, o, n),
387
+ max: D(a, o, n),
388
+ share: I(n, Math.min(i / a, 1))
389
389
  }
390
390
  };
391
391
  }
392
- function Ze(e, t, n) {
393
- const a = _(e, t, n);
392
+ function ut(e, t, n) {
393
+ const a = j(e, t, n);
394
394
  if (a.length < 2) return;
395
395
  const r = C(t, e.encoding.final), i = a[0], o = a.find(({ row: c }) => {
396
396
  var p;
@@ -415,11 +415,11 @@ function Ze(e, t, n) {
415
415
  } : {
416
416
  labelKey: "print.factBridge",
417
417
  fallback: "{start} becomes {end}; the largest deduction is {label} at {amount} — {share} of the opening amount.",
418
- vars: { ...d, share: V(n, Math.abs(l.value) / i.value) }
418
+ vars: { ...d, share: I(n, Math.abs(l.value) / i.value) }
419
419
  };
420
420
  }
421
- function et(e, t, n) {
422
- const a = _(e, t, n);
421
+ function mt(e, t, n) {
422
+ const a = j(e, t, n);
423
423
  if (a.length < 2) return;
424
424
  const r = a[0], i = a[a.length - 1], o = [...a].sort((c, p) => p.value - c.value)[0], l = {
425
425
  first: r.formatted,
@@ -439,12 +439,12 @@ function et(e, t, n) {
439
439
  return {
440
440
  labelKey: "print.factSeries",
441
441
  fallback: "{first} at {firstLabel} to {last} at {lastLabel} ({change}); the peak is {peak} at {peakLabel}.",
442
- vars: { ...l, change: `${d >= 0 ? "+" : "−"}${V(n, Math.abs(d))}` }
442
+ vars: { ...l, change: `${d >= 0 ? "+" : "−"}${I(n, Math.abs(d))}` }
443
443
  };
444
444
  }
445
- function tt(e, t, n) {
445
+ function pt(e, t, n) {
446
446
  if (t.rows.length < 2) return;
447
- const r = [..._(e, t, n)].sort((i, o) => o.value - i.value)[0];
447
+ const r = [...j(e, t, n)].sort((i, o) => o.value - i.value)[0];
448
448
  return r ? {
449
449
  labelKey: "print.factTable",
450
450
  fallback: "{rows} rows; the largest is {label} at {value}.",
@@ -455,22 +455,22 @@ function tt(e, t, n) {
455
455
  vars: { rows: t.rows.length }
456
456
  };
457
457
  }
458
- function nt(e, t, n = 4) {
458
+ function ht(e, t, n = 4) {
459
459
  var r;
460
460
  const a = [];
461
461
  for (const i of e) {
462
462
  if (a.length >= n) break;
463
- const { panel: o, frame: l } = i, d = o.encoding.value, c = d ? o.format[d] : void 0, p = l ? C(l, d) : -1, h = (l == null ? void 0 : l.rows.length) === 1 && p >= 0 ? (r = l.rows[0]) == null ? void 0 : r[p] : void 0, y = h !== void 0 ? M(h, c, t) : o.total !== void 0 ? M(o.total, c, t) : void 0;
464
- y && a.push({ id: i.id, label: o.title, value: y });
463
+ const { panel: o, frame: l } = i, d = o.encoding.value, c = d ? o.format[d] : void 0, p = l ? C(l, d) : -1, h = (l == null ? void 0 : l.rows.length) === 1 && p >= 0 ? (r = l.rows[0]) == null ? void 0 : r[p] : void 0, k = h !== void 0 ? D(h, c, t) : o.total !== void 0 ? D(o.total, c, t) : void 0;
464
+ k && a.push({ id: i.id, label: o.title, value: k });
465
465
  }
466
466
  return a.length >= 2 ? a : [];
467
467
  }
468
- function at(e, t, n) {
468
+ function ft(e, t, n) {
469
469
  var a;
470
470
  if (!(!t || t.rows.length === 0))
471
- return ((a = e.radial) == null ? void 0 : a.mode) === "progress" ? Xe(e, t, n) : e.semantics === "partition" ? Ye(e, t, n) : e.semantics === "reconciliation" ? Ze(e, t, n) : e.semantics === "series" && (e.kind === "line" || e.kind === "area") ? et(e, t, n) : tt(e, t, n);
471
+ return ((a = e.radial) == null ? void 0 : a.mode) === "progress" ? dt(e, t, n) : e.semantics === "partition" ? ct(e, t, n) : e.semantics === "reconciliation" ? ut(e, t, n) : e.semantics === "series" && (e.kind === "line" || e.kind === "area") ? mt(e, t, n) : pt(e, t, n);
472
472
  }
473
- function rt(e) {
473
+ function gt(e) {
474
474
  var n, a;
475
475
  const t = [];
476
476
  for (const r of e.panels) {
@@ -481,122 +481,122 @@ function rt(e) {
481
481
  }
482
482
  return t;
483
483
  }
484
- const it = /* @__PURE__ */ new Set(["stat", "metric_relationship"]);
485
- function st(e) {
484
+ const bt = /* @__PURE__ */ new Set(["stat", "metric_relationship"]);
485
+ function vt(e) {
486
486
  return e.kind === "stat" || e.kind === "metric_relationship" || e.kind === "pie" || e.kind === "donut" || e.kind === "radial" ? "half" : "full";
487
487
  }
488
- function lt(e) {
488
+ function yt(e) {
489
489
  return [...e.groups ?? []].reverse().find((t) => t.label || t.caption);
490
490
  }
491
- function ot(e, t, n) {
491
+ function kt(e, t, n) {
492
492
  const a = t == null ? void 0 : t.trim();
493
493
  return a || (e === 0 ? n : "");
494
494
  }
495
- function ct(e, t, n) {
495
+ function Nt(e, t, n) {
496
496
  const a = e.document, r = [], i = [], o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
497
497
  let d = 0;
498
498
  const c = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
499
499
  for (const m of e.sections) {
500
500
  if (m.owner) {
501
- const v = h.get(m.owner) ?? [];
502
- v.push(m), h.set(m.owner, v);
501
+ const y = h.get(m.owner) ?? [];
502
+ y.push(m), h.set(m.owner, y);
503
503
  continue;
504
504
  }
505
- const f = m.root ? c : p, g = f.get(m.panel.id) ?? [];
506
- g.push(m), f.set(m.panel.id, g);
505
+ const g = m.root ? c : p, b = g.get(m.panel.id) ?? [];
506
+ b.push(m), g.set(m.panel.id, b);
507
507
  }
508
- const y = (m, f) => {
509
- const g = D(m), v = Be(m.frame);
510
- if (!v)
511
- return i.push(g.title), !1;
512
- if (f === "owned") return !0;
513
- const F = o.get(v);
514
- return F !== void 0 && (f === "detail" || F === m.panel.id) ? !1 : (F === void 0 && o.set(v, m.panel.id), !0);
515
- }, b = (m, f) => {
516
- const g = r[r.length - 1];
517
- if (!m && g) return g;
518
- if (g && g.title === m)
519
- return !g.caption && f && (g.caption = f), g;
520
- const v = {
508
+ const k = (m, g) => {
509
+ const b = T(m), y = Ye(m.frame);
510
+ if (!y)
511
+ return i.push(b.title), !1;
512
+ if (g === "owned") return !0;
513
+ const f = o.get(y);
514
+ return f !== void 0 && (g === "detail" || f === m.panel.id) ? !1 : (f === void 0 && o.set(y, m.panel.id), !0);
515
+ }, v = (m, g) => {
516
+ const b = r[r.length - 1];
517
+ if (!m && b) return b;
518
+ if (b && b.title === m)
519
+ return !b.caption && g && (b.caption = g), b;
520
+ const y = {
521
521
  id: `chapter-${r.length + 1}`,
522
522
  number: r.length + 1,
523
523
  title: m,
524
- ...f ? { caption: f } : {},
524
+ ...g ? { caption: g } : {},
525
525
  figures: [],
526
526
  details: []
527
527
  };
528
- return r.push(v), v;
529
- }, k = (m, f, g) => {
530
- var L;
531
- if (!y(f, "figure")) return;
532
- const v = D(f), F = (((L = f.frame) == null ? void 0 : L.rows.length) ?? 0) <= 1, K = (h.get(f.panel.id) ?? []).filter((I) => y(I, "owned") ? (l.add(I), !0) : !1);
528
+ return r.push(y), y;
529
+ }, N = (m, g, b) => {
530
+ var S;
531
+ if (!k(g, "figure")) return;
532
+ const y = T(g), f = (((S = g.frame) == null ? void 0 : S.rows.length) ?? 0) <= 1, w = (h.get(g.panel.id) ?? []).filter((R) => k(R, "owned") ? (l.add(R), !0) : !1);
533
533
  m.figures.push({
534
- section: f,
534
+ section: g,
535
535
  number: `${m.number}.${m.figures.length + 1}`,
536
- chart: ae.has(v.kind) && !F,
537
- metric: F,
536
+ chart: fe.has(y.kind) && !f,
537
+ metric: f,
538
538
  // A reading that prints its calculation needs the width to hold it; half
539
539
  // a page beside another figure is where the two collide.
540
- width: K.length > 0 ? "full" : F ? "half" : st(v),
541
- ...g && (g.label || g.caption) ? { group: { id: g.id, ...g.label ? { label: g.label } : {}, ...g.caption ? { caption: g.caption } : {} } } : {},
540
+ width: w.length > 0 ? "full" : f ? "half" : vt(y),
541
+ ...b && (b.label || b.caption) ? { group: { id: b.id, ...b.label ? { label: b.label } : {}, ...b.caption ? { caption: b.caption } : {} } } : {},
542
542
  // The opening chapter's single-value readings are the dashboard's
543
543
  // headline; the cover carries them so page one is already informative.
544
- kpi: m.number === 1 && F && it.has(v.kind) && d++ < 6,
545
- breakdown: K
544
+ kpi: m.number === 1 && f && bt.has(y.kind) && d++ < 6,
545
+ breakdown: w
546
546
  });
547
- }, P = (m, f) => {
548
- y(f, "detail") && m.details.push({
549
- section: f,
547
+ }, K = (m, g) => {
548
+ k(g, "detail") && m.details.push({
549
+ section: g,
550
550
  number: `A${m.number}.${m.details.length + 1}`,
551
551
  // The first segments of the trail repeat the appendix group's own title
552
552
  // on every one of its nine details. What locates a detail is where it
553
553
  // ends, not the path it shares with its neighbours.
554
- trail: f.breadcrumb.filter((g, v, F) => g && g !== F[v - 1]).slice(-2).join(" › ")
554
+ trail: g.breadcrumb.filter((b, y, f) => b && b !== f[y - 1]).slice(-2).join(" › ")
555
555
  });
556
- }, N = (m, f, g) => {
557
- for (const v of c.get(f) ?? [])
558
- l.add(v), k(m, v, g);
559
- for (const v of p.get(f) ?? [])
560
- l.add(v), P(m, v);
556
+ }, x = (m, g, b) => {
557
+ for (const y of c.get(g) ?? [])
558
+ l.add(y), N(m, y, b);
559
+ for (const y of p.get(g) ?? [])
560
+ l.add(y), K(m, y);
561
561
  };
562
562
  for (const m of a.layout.rows) {
563
- const f = ot(r.length, m.heading, t), g = m.panels.flatMap((F) => F.groups ?? []).map((F) => {
564
- var K;
565
- return (K = F.caption) == null ? void 0 : K.trim();
566
- }).find((F) => !!F), v = b(f, g);
567
- for (const F of m.panels) N(v, F.panelId, lt(F));
563
+ const g = kt(r.length, m.heading, t), b = m.panels.flatMap((f) => f.groups ?? []).map((f) => {
564
+ var w;
565
+ return (w = f.caption) == null ? void 0 : w.trim();
566
+ }).find((f) => !!f), y = v(g, b);
567
+ for (const f of m.panels) x(y, f.panelId, yt(f));
568
568
  }
569
- const S = e.sections.filter((m) => !l.has(m));
570
- if (S.length > 0) {
571
- const m = b(n, void 0);
572
- for (const f of S)
573
- f.root ? k(m, f) : P(m, f);
569
+ const $ = e.sections.filter((m) => !l.has(m));
570
+ if ($.length > 0) {
571
+ const m = v(n, void 0);
572
+ for (const g of $)
573
+ g.root ? N(m, g) : K(m, g);
574
574
  }
575
- const w = r.flatMap((m) => m.figures.filter(({ kpi: f }) => f)), $ = r.map((m) => ({ ...m, figures: m.figures.filter(({ kpi: f }) => !f) })).filter((m) => m.figures.length > 0 || m.details.length > 0);
576
- $.forEach((m, f) => {
577
- m.number = f + 1, m.figures.forEach((g, v) => {
578
- g.number = `${m.number}.${v + 1}`;
579
- }), m.details.forEach((g, v) => {
580
- g.number = `A${m.number}.${v + 1}`;
575
+ const F = r.flatMap((m) => m.figures.filter(({ kpi: g }) => g)), M = r.map((m) => ({ ...m, figures: m.figures.filter(({ kpi: g }) => !g) })).filter((m) => m.figures.length > 0 || m.details.length > 0);
576
+ M.forEach((m, g) => {
577
+ m.number = g + 1, m.figures.forEach((b, y) => {
578
+ b.number = `${m.number}.${y + 1}`;
579
+ }), m.details.forEach((b, y) => {
580
+ b.number = `A${m.number}.${y + 1}`;
581
581
  });
582
582
  });
583
- const x = [...w, ...$.flatMap((m) => m.figures)].filter(({ section: m }) => {
584
- const f = D(m), g = B(f);
585
- return g !== void 0 && g.value !== "verified";
583
+ const L = [...F, ...M.flatMap((m) => m.figures)].filter(({ section: m }) => {
584
+ const g = T(m), b = _(g);
585
+ return b !== void 0 && b.value !== "verified";
586
586
  });
587
587
  return {
588
- chapters: $,
589
- appendix: $.filter((m) => m.details.length > 0),
590
- kpis: w,
591
- notes: dt(a),
588
+ chapters: M,
589
+ appendix: M.filter((m) => m.details.length > 0),
590
+ kpis: F,
591
+ notes: wt(a),
592
592
  missing: i,
593
- estimated: x.length,
594
- qualities: rt(a),
595
- figureCount: $.reduce((m, f) => m + f.figures.length, 0),
596
- detailCount: $.reduce((m, f) => m + f.details.length, 0)
593
+ estimated: L.length,
594
+ qualities: gt(a),
595
+ figureCount: M.reduce((m, g) => m + g.figures.length, 0),
596
+ detailCount: M.reduce((m, g) => m + g.details.length, 0)
597
597
  };
598
598
  }
599
- function dt(e) {
599
+ function wt(e) {
600
600
  var r, i, o;
601
601
  const t = [], n = /* @__PURE__ */ new Set(), a = (l, d) => {
602
602
  const c = `${l}::${d ?? ""}`;
@@ -609,12 +609,12 @@ function dt(e) {
609
609
  }
610
610
  return t;
611
611
  }
612
- function ut(e) {
612
+ function xt(e) {
613
613
  const t = e.document.theme, n = Object.values(t.palette).filter((i) => i.trim() !== ""), a = /* @__PURE__ */ new Map();
614
614
  if (n.length === 0) return a;
615
615
  let r = 0;
616
616
  for (const i of e.sections)
617
- for (const o of mt(i)) {
617
+ for (const o of Ft(i)) {
618
618
  if (!o || a.has(o)) continue;
619
619
  const l = t.series[o];
620
620
  if (l) {
@@ -625,13 +625,13 @@ function ut(e) {
625
625
  }
626
626
  return a;
627
627
  }
628
- function mt(e) {
628
+ function Ft(e) {
629
629
  const t = e.frame;
630
630
  if (!t) return [];
631
- const n = D(e), a = C(t, n.encoding.label ?? n.encoding.category ?? n.encoding.id);
632
- return a < 0 ? [] : t.rows.map((r) => R(r[a]).trim());
631
+ const n = T(e), a = C(t, n.encoding.label ?? n.encoding.category ?? n.encoding.id);
632
+ return a < 0 ? [] : t.rows.map((r) => V(r[a]).trim());
633
633
  }
634
- function pt(e, t) {
634
+ function $t(e, t) {
635
635
  if (t.size === 0) return e;
636
636
  const n = {};
637
637
  for (const [a, r] of Object.entries(e.series))
@@ -639,61 +639,70 @@ function pt(e, t) {
639
639
  for (const [a, r] of t) n[a] = r;
640
640
  return { ...e, series: n };
641
641
  }
642
- const se = pe(/* @__PURE__ */ new Map());
643
- function le(e) {
644
- const t = he(se);
645
- return A(() => pt(e.document.theme, t), [t, e.document.theme]);
642
+ const ve = Me(/* @__PURE__ */ new Map());
643
+ function ye(e) {
644
+ const t = Se(ve);
645
+ return A(() => $t(e.document.theme, t), [t, e.document.theme]);
646
646
  }
647
- function ht(e, t, n) {
648
- var $;
647
+ function Mt(e, t, n) {
648
+ var y;
649
649
  const a = e.frame;
650
650
  if (!a) return { rows: [] };
651
- const r = D(e), i = C(a, r.encoding.label ?? r.encoding.category ?? r.encoding.id), o = C(a, r.encoding.value), l = C(a, r.encoding.series), d = C(a, r.encoding.id), c = r.encoding.value, p = c ? r.format[c] : void 0, h = a.rows.map((x) => q(x[o])), y = /* @__PURE__ */ new Map(), b = r.encoding.series ? r.format[r.encoding.series] : void 0;
652
- a.rows.forEach((x, m) => {
653
- const f = l >= 0 ? R(x[l]) : "", g = h[m];
654
- g !== void 0 && g >= 0 && y.set(f, (y.get(f) ?? 0) + g);
651
+ const r = T(e), i = C(a, r.encoding.label ?? r.encoding.category ?? r.encoding.id), o = C(a, r.encoding.value), l = C(a, r.encoding.series), d = C(a, r.encoding.id), c = r.encoding.value, p = c ? r.format[c] : void 0, h = a.rows.map((f) => E(f[o])), k = /* @__PURE__ */ new Map(), v = r.encoding.series ? r.format[r.encoding.series] : void 0;
652
+ a.rows.forEach((f, w) => {
653
+ const S = l >= 0 ? V(f[l]) : "", R = h[w];
654
+ R !== void 0 && R >= 0 && k.set(S, (k.get(S) ?? 0) + R);
655
655
  });
656
- for (const x of (($ = r.radial) == null ? void 0 : $.mode) === "partition" ? r.radial.rings ?? [] : [])
657
- y.has(x.key) && y.set(x.key, x.total);
658
- const k = r.semantics === "reconciliation" && C(a, r.encoding.cut) >= 0, P = C(a, r.encoding.final), N = (x, m) => {
659
- const f = o >= 0 ? x[o] : void 0;
660
- if (!k || m === 0 || P >= 0 && x[P] === !0) return f;
661
- const g = h[m], v = h[m - 1];
662
- return g === void 0 || v === void 0 ? f : g - v;
663
- }, S = Se(n, r, { positional: e.root, labels: Me(a, r) }), w = j(a.rows.map((x, m) => N(x, m)), p, t);
664
- return { unit: w.note, rows: a.rows.map((x, m) => {
665
- var I, H;
666
- const f = N(x, m), g = h[m], v = l >= 0 ? R(x[l]) : "", F = ((I = r.radial) == null ? void 0 : I.mode) === "progress" ? r.radial.max : y.get(v), K = (r.semantics === "partition" || ((H = r.radial) == null ? void 0 : H.mode) === "progress") && g !== void 0 && g >= 0 && F && F > 0 ? g / F : void 0, L = i >= 0 ? R(x[i]) : R(x[d]);
656
+ for (const f of ((y = r.radial) == null ? void 0 : y.mode) === "partition" ? r.radial.rings ?? [] : [])
657
+ k.has(f.key) && k.set(f.key, f.total);
658
+ const N = r.semantics === "reconciliation" && C(a, r.encoding.cut) >= 0, K = C(a, r.encoding.final), x = (f, w) => {
659
+ const S = o >= 0 ? f[o] : void 0;
660
+ if (!N || w === 0 || K >= 0 && f[K] === !0) return S;
661
+ const R = h[w], q = h[w - 1];
662
+ return R === void 0 || q === void 0 ? S : R - q;
663
+ }, $ = C(a, r.encoding.category), F = r.kind === "pie" || r.kind === "donut" || r.kind === "radial", M = a.rows.map((f) => {
664
+ var q;
665
+ const w = H(f[$ >= 0 ? $ : i]), S = d >= 0 ? H(f[d]) : "", R = l >= 0 ? H(f[l]) : "";
666
+ return { category: w, nodeKey: S || Re(w, ((q = r.radial) == null ? void 0 : q.mode) === "partition" ? "" : R) };
667
+ }), L = /* @__PURE__ */ new Map();
668
+ M.forEach(({ nodeKey: f, category: w }) => {
669
+ const S = f ?? w;
670
+ L.has(S) || L.set(S, L.size);
671
+ });
672
+ const m = pe(n, r, a, e.root), g = ue(n, r, { colors: a.colors, positional: e.root, labels: me(a, r) }), b = W(a.rows.map((f, w) => x(f, w)), p, t);
673
+ return { unit: b.note, rows: a.rows.map((f, w) => {
674
+ var ee, te, ne;
675
+ const S = x(f, w), R = h[w], q = l >= 0 ? V(f[l]) : "", z = ((ee = r.radial) == null ? void 0 : ee.mode) === "progress" ? r.radial.max : k.get(q), B = (r.semantics === "partition" || ((te = r.radial) == null ? void 0 : te.mode) === "progress") && R !== void 0 && R >= 0 && z && z > 0 ? R / z : void 0, Y = i >= 0 ? V(f[i]) : V(f[d]), { category: X, nodeKey: Z } = M[w], $e = ((ne = r.radial) == null ? void 0 : ne.mode) === "partition" ? L.get(Z ?? X) : w;
667
676
  return {
668
- key: `${v}:${d >= 0 ? R(x[d]) : m}`,
669
- ...v && b ? { series: M(x[l], b, t) } : {},
670
- label: L,
671
- value: o >= 0 ? w.format(f) : "—",
672
- exact: o >= 0 ? ne(f, p, t) : void 0,
673
- ...K === void 0 ? {} : {
674
- ratio: K,
677
+ key: `${q}:${d >= 0 ? V(f[d]) : w}`,
678
+ ...q && v ? { series: D(f[l], v, t) } : {},
679
+ label: Y,
680
+ value: o >= 0 ? b.format(S) : "—",
681
+ exact: o >= 0 ? he(S, p, t) : void 0,
682
+ ...B === void 0 ? {} : {
683
+ ratio: B,
675
684
  // A row worth 1.5 million printed as «0,0 %» reads as nothing at all.
676
685
  // Below the resolution of the column, the share says it is below it.
677
- share: K > 0 && K < 1e-3 ? `< ${new Intl.NumberFormat(t, { style: "percent", minimumFractionDigits: 1 }).format(1e-3)}` : new Intl.NumberFormat(t, {
686
+ share: B > 0 && B < 1e-3 ? `< ${new Intl.NumberFormat(t, { style: "percent", minimumFractionDigits: 1 }).format(1e-3)}` : new Intl.NumberFormat(t, {
678
687
  style: "percent",
679
688
  minimumFractionDigits: 1,
680
689
  maximumFractionDigits: 1
681
- }).format(K)
690
+ }).format(B)
682
691
  },
683
- color: S(L, m)
692
+ color: F ? g(X, $e, Z) : l >= 0 ? m(q, w) : g(Y, w)
684
693
  };
685
694
  }) };
686
695
  }
687
- function oe({ section: e, height: t }) {
696
+ function ke({ section: e, height: t }) {
688
697
  var l;
689
- const n = A(() => D(e), [e]), a = le(e), r = G(
690
- (d, c) => M(c, n.format[d], e.document.meta.locale),
698
+ const n = A(() => T(e), [e]), a = ye(e), r = ae(
699
+ (d, c) => D(c, n.format[d], e.document.meta.locale),
691
700
  [n.format, e.document.meta.locale]
692
- ), i = G(
693
- (d, c) => $e(c, n.format[d], e.document.meta.locale),
701
+ ), i = ae(
702
+ (d, c) => Ee(c, n.format[d], e.document.meta.locale),
694
703
  [n.format, e.document.meta.locale]
695
704
  );
696
- if (!e.frame || e.frame.rows.length <= 1 || !ae.has(n.kind)) return null;
705
+ if (!e.frame || e.frame.rows.length <= 1 || !fe.has(n.kind)) return null;
697
706
  const o = n.kind === "pie" || n.kind === "donut" || n.kind === "radial" ? {
698
707
  ...n.presentation,
699
708
  sliceLabels: ((l = n.presentation) == null ? void 0 : l.sliceLabels) ?? "percent",
@@ -702,12 +711,19 @@ function oe({ section: e, height: t }) {
702
711
  fill: !0
703
712
  } : n.presentation;
704
713
  return /* @__PURE__ */ s("div", { className: "lens-print-chart", style: { height: t }, children: /* @__PURE__ */ s(
705
- ke,
714
+ Ae,
706
715
  {
707
716
  input: {
708
717
  kind: n.kind,
709
718
  frame: e.frame,
710
719
  encoding: n.encoding,
720
+ seriesColor: pe(a, n, e.frame, e.root),
721
+ rowColor: ue(a, n, { colors: e.frame.colors, positional: e.root, labels: me(e.frame, n) }),
722
+ labels: {
723
+ noData: e.document.i18n["panel.empty"] ?? "No data",
724
+ current: e.document.i18n["chart.series.current"] ?? "Current period",
725
+ previous: e.document.i18n["chart.series.previous"] ?? "Previous"
726
+ },
711
727
  format: r,
712
728
  formatAxis: i,
713
729
  locale: e.document.meta.locale,
@@ -720,20 +736,20 @@ function oe({ section: e, height: t }) {
720
736
  }
721
737
  ) });
722
738
  }
723
- function ce(e) {
724
- const t = D(e), n = e.document.meta.locale;
739
+ function Ne(e) {
740
+ const t = T(e), n = e.document.meta.locale;
725
741
  return A(() => {
726
742
  if (!e.frame) return;
727
- const a = t.encoding.value ?? "value", r = t.encoding.cut ?? "cut", i = (l) => M(l, t.format[a], n), o = (l) => M(
743
+ const a = t.encoding.value ?? "value", r = t.encoding.cut ?? "cut", i = (l) => D(l, t.format[a], n), o = (l) => D(
728
744
  l,
729
745
  t.format[r] ?? t.format[a],
730
746
  n
731
747
  );
732
- return ve(ye(t, e.frame, i, o), i);
748
+ return Pe(Ke(t, e.frame, i, o), i);
733
749
  }, [n, t, e.frame]);
734
750
  }
735
- function ft({ section: e }) {
736
- const t = T(), n = D(e), a = ce(e), r = e.document.meta.locale, i = A(() => {
751
+ function St({ section: e }) {
752
+ const t = P(), n = T(e), a = Ne(e), r = e.document.meta.locale, i = A(() => {
737
753
  if (!a) return;
738
754
  const l = a.ticks.length > 5 ? a.ticks.filter((c, p) => p % 2 === 0) : a.ticks, d = new Intl.NumberFormat(r, { notation: "compact", maximumFractionDigits: 1 });
739
755
  return {
@@ -745,16 +761,16 @@ function ft({ section: e }) {
745
761
  [i]
746
762
  );
747
763
  return !i || i.items.length === 0 ? null : /* @__PURE__ */ u("div", { className: "lens-print-chart lens-print-chart-waterfall", children: [
748
- /* @__PURE__ */ s(be, { label: n.title, model: i, splitCallout: "always" }),
764
+ /* @__PURE__ */ s(Te, { label: n.title, model: i, splitCallout: "always" }),
749
765
  o.length > 1 && /* @__PURE__ */ s("p", { className: "lens-print-tone-key", children: o.map((l) => /* @__PURE__ */ u("span", { children: [
750
766
  /* @__PURE__ */ s("i", { "aria-hidden": "true", "data-tone": l }),
751
767
  l === "positive" ? t("print.toneFavourable", "favourable") : l === "negative" ? t("print.toneAdverse", "adverse") : t("print.toneNeutral", "neutral")
752
768
  ] }, l)) })
753
769
  ] });
754
770
  }
755
- function gt({ section: e }) {
756
- const t = T(), n = D(e), a = ce(e), r = A(
757
- () => j(
771
+ function Ct({ section: e }) {
772
+ const t = P(), n = T(e), a = Ne(e), r = A(
773
+ () => W(
758
774
  ((a == null ? void 0 : a.items) ?? []).map((i) => i.value),
759
775
  n.encoding.value ? n.format[n.encoding.value] : void 0,
760
776
  e.document.meta.locale
@@ -769,7 +785,7 @@ function gt({ section: e }) {
769
785
  r.note && /* @__PURE__ */ s("small", { children: r.note })
770
786
  ] })
771
787
  ] }) }),
772
- /* @__PURE__ */ s("tbody", { children: a.items.map((i, o) => /* @__PURE__ */ u(fe, { children: [
788
+ /* @__PURE__ */ s("tbody", { children: a.items.map((i, o) => /* @__PURE__ */ u(Ce, { children: [
773
789
  /* @__PURE__ */ u("tr", { "data-role": i.kind, children: [
774
790
  /* @__PURE__ */ s("td", { children: i.label }),
775
791
  /* @__PURE__ */ s("td", { "data-align": "right", children: r.format(i.value) })
@@ -781,76 +797,76 @@ function gt({ section: e }) {
781
797
  ] }, `${i.label}:${o}`)) })
782
798
  ] });
783
799
  }
784
- function bt(e, t) {
800
+ function Dt(e, t) {
785
801
  return e.kind === "cascade" && !!t.frame && C(t.frame, e.encoding.cut) >= 0;
786
802
  }
787
- function z({ section: e, dense: t, exact: n }) {
803
+ function J({ section: e, dense: t, exact: n }) {
788
804
  var d;
789
- const a = T(), r = le(e), i = A(
790
- () => ht(e, e.document.meta.locale, r),
805
+ const a = P(), r = ye(e), i = A(
806
+ () => Mt(e, e.document.meta.locale, r),
791
807
  [e, r]
792
808
  );
793
809
  if (!e.frame) return /* @__PURE__ */ s("p", { className: "lens-print-empty", children: a("print.noData", "No data") });
794
- const o = D(e);
810
+ const o = T(e);
795
811
  if (o.kind === "table" && ((d = o.columns) != null && d.length)) {
796
- const c = e.frame, p = o.columns, h = p.map(({ field: N }) => C(c, N)), y = e.document.meta.locale, b = p.map((N, S) => {
797
- const w = h[S];
798
- return j(
799
- w >= 0 ? c.rows.map(($) => $[w]) : [],
800
- o.format[N.field],
801
- y
812
+ const c = e.frame, p = o.columns, h = p.map(({ field: x }) => C(c, x)), k = e.document.meta.locale, v = p.map((x, $) => {
813
+ const F = h[$];
814
+ return W(
815
+ F >= 0 ? c.rows.map((M) => M[F]) : [],
816
+ o.format[x.field],
817
+ k
802
818
  );
803
- }), k = p.map((N) => {
804
- var w;
805
- if (N.align) return N.align;
806
- const S = (w = o.format[N.field]) == null ? void 0 : w.kind;
807
- return S === "money" || S === "number" || S === "percent" ? "right" : "left";
808
- }), P = /* @__PURE__ */ new Map();
809
- return p.forEach((N, S) => {
810
- if (N.cell.kind !== "bar") return;
811
- const w = h[S];
812
- w < 0 || P.set(N.field, c.rows.reduce(($, x) => {
813
- const m = q(x[w]);
814
- return m === void 0 ? $ : Math.max($, Math.abs(m));
819
+ }), N = p.map((x) => {
820
+ var F;
821
+ if (x.align) return x.align;
822
+ const $ = (F = o.format[x.field]) == null ? void 0 : F.kind;
823
+ return $ === "money" || $ === "number" || $ === "percent" ? "right" : "left";
824
+ }), K = /* @__PURE__ */ new Map();
825
+ return p.forEach((x, $) => {
826
+ if (x.cell.kind !== "bar") return;
827
+ const F = h[$];
828
+ F < 0 || K.set(x.field, c.rows.reduce((M, L) => {
829
+ const m = E(L[F]);
830
+ return m === void 0 ? M : Math.max(M, Math.abs(m));
815
831
  }, 0));
816
832
  }), /* @__PURE__ */ u("table", { className: "lens-print-data lens-print-data-wide", children: [
817
- /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: p.map((N, S) => {
818
- var w, $;
819
- return /* @__PURE__ */ u("th", { "data-align": k[S], children: [
820
- N.label,
821
- ((w = b[S]) == null ? void 0 : w.note) && /* @__PURE__ */ s("small", { children: ($ = b[S]) == null ? void 0 : $.note })
822
- ] }, N.field);
833
+ /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: p.map((x, $) => {
834
+ var F, M;
835
+ return /* @__PURE__ */ u("th", { "data-align": N[$], children: [
836
+ x.label,
837
+ ((F = v[$]) == null ? void 0 : F.note) && /* @__PURE__ */ s("small", { children: (M = v[$]) == null ? void 0 : M.note })
838
+ ] }, x.field);
823
839
  }) }) }),
824
- /* @__PURE__ */ s("tbody", { children: c.rows.map((N, S) => /* @__PURE__ */ s("tr", { children: p.map((w, $) => {
825
- const x = h[$] >= 0 ? N[h[$]] : void 0, m = b[$].format(x), f = n ? ne(x, o.format[w.field], y) : void 0, g = q(x), v = R(N[C(c, w.cell.toneField)]), F = P.get(w.field), K = C(c, w.cell.secondaryField), L = K >= 0 ? q(N[K]) : void 0;
840
+ /* @__PURE__ */ s("tbody", { children: c.rows.map((x, $) => /* @__PURE__ */ s("tr", { children: p.map((F, M) => {
841
+ const L = h[M] >= 0 ? x[h[M]] : void 0, m = v[M].format(L), g = n ? he(L, o.format[F.field], k) : void 0, b = E(L), y = V(x[C(c, F.cell.toneField)]), f = K.get(F.field), w = C(c, F.cell.secondaryField), S = w >= 0 ? E(x[w]) : void 0;
826
842
  return /* @__PURE__ */ u(
827
843
  "td",
828
844
  {
829
- "data-align": k[$],
830
- "data-negative": g !== void 0 && g < 0 ? "" : void 0,
831
- "data-tone": v === "pos" || v === "warn" || v === "neg" ? v : void 0,
845
+ "data-align": N[M],
846
+ "data-negative": b !== void 0 && b < 0 ? "" : void 0,
847
+ "data-tone": y === "pos" || y === "warn" || y === "neg" ? y : void 0,
832
848
  children: [
833
849
  m,
834
- L !== void 0 && /* @__PURE__ */ s("em", { className: "lens-print-cell-secondary", "data-negative": L < 0 ? "" : void 0, children: te(L) ?? `${L > 0 ? "+" : ""}${M(
835
- N[K],
836
- w.cell.secondaryField ? o.format[w.cell.secondaryField] : void 0,
837
- y
850
+ S !== void 0 && /* @__PURE__ */ s("em", { className: "lens-print-cell-secondary", "data-negative": S < 0 ? "" : void 0, children: de(S) ?? `${S > 0 ? "+" : ""}${D(
851
+ x[w],
852
+ F.cell.secondaryField ? o.format[F.cell.secondaryField] : void 0,
853
+ k
838
854
  )}` }),
839
- F !== void 0 && F > 0 && g !== void 0 && /* @__PURE__ */ s(
855
+ f !== void 0 && f > 0 && b !== void 0 && /* @__PURE__ */ s(
840
856
  "span",
841
857
  {
842
858
  "aria-hidden": "true",
843
859
  className: "lens-print-cell-bar",
844
- "data-negative": g < 0 ? "" : void 0,
845
- style: { width: `${Math.min(100, Math.round(Math.abs(g) / F * 100))}%` }
860
+ "data-negative": b < 0 ? "" : void 0,
861
+ style: { width: `${Math.min(100, Math.round(Math.abs(b) / f * 100))}%` }
846
862
  }
847
863
  ),
848
- f && f !== m && /* @__PURE__ */ s("small", { children: f })
864
+ g && g !== m && /* @__PURE__ */ s("small", { children: g })
849
865
  ]
850
866
  },
851
- w.field
867
+ F.field
852
868
  );
853
- }) }, S)) })
869
+ }) }, $)) })
854
870
  ] });
855
871
  }
856
872
  const l = i.rows.some(({ share: c }) => c !== void 0);
@@ -890,16 +906,16 @@ function z({ section: e, dense: t, exact: n }) {
890
906
  ] }, c.key)) })
891
907
  ] });
892
908
  }
893
- function de({ section: e }) {
894
- const t = T();
909
+ function we({ section: e }) {
910
+ const t = P();
895
911
  return !e.hasMore || !e.frame ? null : /* @__PURE__ */ s("p", { className: "lens-print-truncated", children: t("print.truncated", "First {rows} rows shown; the level continues in the dashboard.", {
896
912
  rows: e.frame.rows.length
897
913
  }) });
898
914
  }
899
- function vt({ section: e }) {
915
+ function Tt({ section: e }) {
900
916
  var i;
901
- const t = T(), n = D(e), a = (i = n.caption) == null ? void 0 : i.trim(), r = A(
902
- () => at(n, e.frame, e.document.meta.locale),
917
+ const t = P(), n = T(e), a = (i = n.caption) == null ? void 0 : i.trim(), r = A(
918
+ () => ft(n, e.frame, e.document.meta.locale),
903
919
  [n, e.document.meta.locale, e.frame]
904
920
  );
905
921
  return !a && !r ? null : /* @__PURE__ */ u("p", { className: "lens-print-figure-note", children: [
@@ -907,10 +923,10 @@ function vt({ section: e }) {
907
923
  r && /* @__PURE__ */ s("span", { children: t(r.labelKey, r.fallback, r.vars) })
908
924
  ] });
909
925
  }
910
- function ue({ footnotes: e }) {
926
+ function xe({ footnotes: e }) {
911
927
  return !e || e.markers.length === 0 ? null : /* @__PURE__ */ s("sup", { className: "lens-print-footnote-marker", children: e.markers.join(", ") });
912
928
  }
913
- function X({ footnotes: e }) {
929
+ function le({ footnotes: e }) {
914
930
  return !e || e.notes.length === 0 ? null : /* @__PURE__ */ s("ol", { className: "lens-print-footnotes", children: e.notes.map((t) => (
915
931
  // The number is drawn rather than left to the list marker: a marker is
916
932
  // the one glyph a print engine feels free to drop, and a note nobody
@@ -921,63 +937,63 @@ function X({ footnotes: e }) {
921
937
  ] }, t.number)
922
938
  )) });
923
939
  }
924
- const W = 8;
925
- function Z({ sections: e }) {
926
- const t = T();
940
+ const Q = 8;
941
+ function oe({ sections: e }) {
942
+ const t = P();
927
943
  return e.length === 0 ? null : /* @__PURE__ */ u("div", { className: "lens-print-breakdown", children: [
928
944
  /* @__PURE__ */ s("p", { className: "lens-print-breakdown-head", children: t("print.breakdown", "How it is calculated") }),
929
945
  e.map((n) => {
930
- var h, y, b, k, P, N;
931
- const a = D(n), r = n.frame, i = a.kind === "table" && ((h = a.columns) != null && h.length) ? a.columns.length : (r == null ? void 0 : r.columns.length) ?? 0;
946
+ var h, k, v, N, K, x;
947
+ const a = T(n), r = n.frame, i = a.kind === "table" && ((h = a.columns) != null && h.length) ? a.columns.length : (r == null ? void 0 : r.columns.length) ?? 0;
932
948
  if (r && i <= 1) return null;
933
- if (re.has(a.kind))
934
- return /* @__PURE__ */ s(ie, { section: n }, n.id);
949
+ if (ge.has(a.kind))
950
+ return /* @__PURE__ */ s(be, { section: n }, n.id);
935
951
  const o = r ? C(r, a.encoding.value) : -1;
936
952
  if (r && r.rows.length === 1 && o >= 0)
937
953
  return /* @__PURE__ */ u("p", { className: "lens-print-breakdown-term", children: [
938
954
  /* @__PURE__ */ s("span", { children: a.title }),
939
- /* @__PURE__ */ s("span", { children: M(
940
- (y = r.rows[0]) == null ? void 0 : y[o],
955
+ /* @__PURE__ */ s("span", { children: D(
956
+ (k = r.rows[0]) == null ? void 0 : k[o],
941
957
  a.encoding.value ? a.format[a.encoding.value] : void 0,
942
958
  n.document.meta.locale
943
959
  ) })
944
960
  ] }, n.id);
945
- const l = r && r.rows.length > W, d = l && r ? { ...n, frame: { ...r, rows: r.rows.slice(0, W) } } : n, c = ((b = n.perspective) == null ? void 0 : b.label.trim()) || a.title, p = ((N = (P = (k = a.columns) == null ? void 0 : k[0]) == null ? void 0 : P.label) == null ? void 0 : N.trim().toLowerCase()) === c.trim().toLowerCase();
961
+ const l = r && r.rows.length > Q, d = l && r ? { ...n, frame: { ...r, rows: r.rows.slice(0, Q) } } : n, c = ((v = n.perspective) == null ? void 0 : v.label.trim()) || a.title, p = ((x = (K = (N = a.columns) == null ? void 0 : N[0]) == null ? void 0 : K.label) == null ? void 0 : x.trim().toLowerCase()) === c.trim().toLowerCase();
946
962
  return /* @__PURE__ */ u("div", { className: "lens-print-breakdown-part", children: [
947
963
  !p && /* @__PURE__ */ s("p", { className: "lens-print-breakdown-title", children: c }),
948
- /* @__PURE__ */ s(z, { dense: !0, section: d }),
964
+ /* @__PURE__ */ s(J, { dense: !0, section: d }),
949
965
  l && r && // Here the whole term is in hand, so the reader is told what
950
966
  // share of it the page keeps rather than merely that it was cut.
951
967
  /* @__PURE__ */ s("p", { className: "lens-print-truncated", children: t("print.truncatedOf", "{rows} of {total} rows shown.", {
952
- rows: W,
968
+ rows: Q,
953
969
  total: r.rows.length
954
970
  }) })
955
971
  ] }, n.id);
956
972
  })
957
973
  ] });
958
974
  }
959
- function yt({ figure: e, footnotes: t }) {
975
+ function Pt({ figure: e, footnotes: t }) {
960
976
  var d;
961
- const n = T(), { section: a } = e, r = D(a), i = bt(r, a), o = re.has(r.kind);
977
+ const n = P(), { section: a } = e, r = T(a), i = Dt(r, a), o = ge.has(r.kind);
962
978
  if (e.metric)
963
979
  return /* @__PURE__ */ u("figure", { className: `lens-print-figure lens-print-figure-${e.width} lens-print-figure-metric`, children: [
964
- /* @__PURE__ */ s(me, { figure: e, footnotes: t, numbered: !0 }),
965
- /* @__PURE__ */ s(Z, { sections: e.breakdown }),
966
- /* @__PURE__ */ s(X, { footnotes: t })
980
+ /* @__PURE__ */ s(Fe, { figure: e, footnotes: t, numbered: !0 }),
981
+ /* @__PURE__ */ s(oe, { sections: e.breakdown }),
982
+ /* @__PURE__ */ s(le, { footnotes: t })
967
983
  ] });
968
- const l = r.total !== void 0 && r.encoding.value ? M(r.total, r.format[r.encoding.value], a.document.meta.locale) : void 0;
984
+ const l = r.total !== void 0 && r.encoding.value ? D(r.total, r.format[r.encoding.value], a.document.meta.locale) : void 0;
969
985
  return /* @__PURE__ */ u("figure", { className: `lens-print-figure lens-print-figure-${i || o ? "full" : e.width}`, children: [
970
986
  /* @__PURE__ */ u("figcaption", { className: "lens-print-figure-head", children: [
971
987
  /* @__PURE__ */ u("p", { className: "lens-print-figure-title", children: [
972
988
  /* @__PURE__ */ s("span", { className: "lens-print-figure-number", children: n("print.figure", "Fig. {number}", { number: e.number }) }),
973
989
  /* @__PURE__ */ u("h3", { children: [
974
990
  r.title,
975
- /* @__PURE__ */ s(ue, { footnotes: t })
991
+ /* @__PURE__ */ s(xe, { footnotes: t })
976
992
  ] })
977
993
  ] }),
978
994
  /* @__PURE__ */ u("p", { className: "lens-print-figure-meta", children: [
979
995
  ((d = r.status) == null ? void 0 : d.label) && /* @__PURE__ */ s("span", { className: "lens-print-chip", "data-tone": r.status.tone ?? "neutral", children: r.status.label }),
980
- /* @__PURE__ */ s(E, { availability: r.availability, confidence: r.confidence }),
996
+ /* @__PURE__ */ s(O, { availability: r.availability, confidence: r.confidence }),
981
997
  a.perspective && /* @__PURE__ */ u("span", { className: "lens-print-chip", "data-tone": "neutral", children: [
982
998
  n("print.view", "View"),
983
999
  ": ",
@@ -990,56 +1006,56 @@ function yt({ figure: e, footnotes: t }) {
990
1006
  ] })
991
1007
  ] })
992
1008
  ] }),
993
- o ? /* @__PURE__ */ s(ie, { section: a }) : i ? /* @__PURE__ */ s(ft, { section: a }) : e.chart && /* @__PURE__ */ s(oe, { height: e.width === "half" ? 225 : 235, section: a }),
994
- /* @__PURE__ */ s(vt, { section: a }),
995
- !o && (i ? /* @__PURE__ */ s(gt, { section: a }) : /* @__PURE__ */ s(z, { section: a })),
996
- /* @__PURE__ */ s(de, { section: a }),
997
- /* @__PURE__ */ s(Z, { sections: e.breakdown }),
998
- /* @__PURE__ */ s(X, { footnotes: t })
1009
+ o ? /* @__PURE__ */ s(be, { section: a }) : i ? /* @__PURE__ */ s(St, { section: a }) : e.chart && /* @__PURE__ */ s(ke, { height: e.width === "half" ? 225 : 235, section: a }),
1010
+ /* @__PURE__ */ s(Tt, { section: a }),
1011
+ !o && (i ? /* @__PURE__ */ s(Ct, { section: a }) : /* @__PURE__ */ s(J, { section: a })),
1012
+ /* @__PURE__ */ s(we, { section: a }),
1013
+ /* @__PURE__ */ s(oe, { sections: e.breakdown }),
1014
+ /* @__PURE__ */ s(le, { footnotes: t })
999
1015
  ] });
1000
1016
  }
1001
- function kt({ values: e }) {
1017
+ function Kt({ values: e }) {
1002
1018
  const t = e.filter((l) => Number.isFinite(l));
1003
1019
  if (t.length < 2) return null;
1004
1020
  const n = Math.min(...t), r = Math.max(...t) - n || 1, i = 100 / (t.length - 1), o = t.map((l, d) => `${(d * i).toFixed(2)},${(24 - (l - n) / r * 22).toFixed(2)}`).join(" ");
1005
1021
  return /* @__PURE__ */ s("svg", { "aria-hidden": "true", className: "lens-print-sparkline", preserveAspectRatio: "none", viewBox: "0 0 100 26", children: /* @__PURE__ */ s("polyline", { fill: "none", points: o, strokeLinecap: "round", strokeLinejoin: "round" }) });
1006
1022
  }
1007
- function me({ figure: e, footnotes: t, numbered: n }) {
1008
- var N, S, w;
1009
- const a = T(), { section: r } = e, i = D(r), o = r.document.meta.locale, l = r.frame, d = l ? C(l, i.encoding.value) : -1, c = l && d >= 0 ? (N = l.rows[0]) == null ? void 0 : N[d] : void 0, p = i.encoding.value ? i.format[i.encoding.value] : void 0, h = l ? C(l, i.encoding.final) : -1, y = l && h >= 0 ? (S = l.rows[0]) == null ? void 0 : S[h] : void 0, b = q(y), k = i.encoding.final ? i.format[i.encoding.final] : p, P = i.target;
1023
+ function Fe({ figure: e, footnotes: t, numbered: n }) {
1024
+ var x, $, F;
1025
+ const a = P(), { section: r } = e, i = T(r), o = r.document.meta.locale, l = r.frame, d = l ? C(l, i.encoding.value) : -1, c = l && d >= 0 ? (x = l.rows[0]) == null ? void 0 : x[d] : void 0, p = i.encoding.value ? i.format[i.encoding.value] : void 0, h = l ? C(l, i.encoding.final) : -1, k = l && h >= 0 ? ($ = l.rows[0]) == null ? void 0 : $[h] : void 0, v = E(k), N = i.encoding.final ? i.format[i.encoding.final] : p, K = i.target;
1010
1026
  return /* @__PURE__ */ u("div", { className: "lens-print-kpi", children: [
1011
1027
  /* @__PURE__ */ u("p", { className: "lens-print-kpi-label", children: [
1012
1028
  n && /* @__PURE__ */ s("span", { className: "lens-print-figure-number", children: a("print.figure", "Fig. {number}", { number: e.number }) }),
1013
1029
  i.title,
1014
- /* @__PURE__ */ s(ue, { footnotes: t })
1030
+ /* @__PURE__ */ s(xe, { footnotes: t })
1015
1031
  ] }),
1016
1032
  /* @__PURE__ */ u("p", { className: "lens-print-kpi-value", children: [
1017
- M(c, p, o),
1018
- b !== void 0 && /* @__PURE__ */ u("span", { className: "lens-print-kpi-delta", "data-negative": b < 0 ? "" : void 0, children: [
1019
- b > 0 ? "+" : "",
1020
- M(y, k, o)
1033
+ D(c, p, o),
1034
+ v !== void 0 && /* @__PURE__ */ u("span", { className: "lens-print-kpi-delta", "data-negative": v < 0 ? "" : void 0, children: [
1035
+ v > 0 ? "+" : "",
1036
+ D(k, N, o)
1021
1037
  ] })
1022
1038
  ] }),
1023
- i.sparkline && /* @__PURE__ */ s(kt, { values: i.sparkline.values }),
1039
+ i.sparkline && /* @__PURE__ */ s(Kt, { values: i.sparkline.values }),
1024
1040
  i.trend && /* @__PURE__ */ u("p", { className: "lens-print-kpi-trend", "data-negative": i.trend.percent < 0 ? "" : void 0, children: [
1025
1041
  i.trend.percent > 0 ? "+" : "",
1026
- te(i.trend.percent) ?? `${new Intl.NumberFormat(o, { maximumFractionDigits: 1 }).format(i.trend.percent)}%`,
1042
+ de(i.trend.percent) ?? `${new Intl.NumberFormat(o, { maximumFractionDigits: 1 }).format(i.trend.percent)}%`,
1027
1043
  i.trend.label ? ` ${i.trend.label}` : ""
1028
1044
  ] }),
1029
- P && /* @__PURE__ */ u("p", { className: "lens-print-kpi-target", children: [
1045
+ K && /* @__PURE__ */ u("p", { className: "lens-print-kpi-target", children: [
1030
1046
  a("print.target", "Target"),
1031
1047
  ": ",
1032
- M(P.value, p, o),
1033
- P.label ? ` · ${P.label}` : ""
1048
+ D(K.value, p, o),
1049
+ K.label ? ` · ${K.label}` : ""
1034
1050
  ] }),
1035
1051
  i.caption && /* @__PURE__ */ s("p", { className: "lens-print-kpi-caption", children: i.caption }),
1036
1052
  /* @__PURE__ */ u("p", { className: "lens-print-kpi-chips", children: [
1037
- ((w = i.status) == null ? void 0 : w.label) && /* @__PURE__ */ s("span", { className: "lens-print-chip", "data-tone": i.status.tone ?? "neutral", children: i.status.label }),
1038
- /* @__PURE__ */ s(E, { availability: i.availability, confidence: i.confidence })
1053
+ ((F = i.status) == null ? void 0 : F.label) && /* @__PURE__ */ s("span", { className: "lens-print-chip", "data-tone": i.status.tone ?? "neutral", children: i.status.label }),
1054
+ /* @__PURE__ */ s(O, { availability: i.availability, confidence: i.confidence })
1039
1055
  ] })
1040
1056
  ] });
1041
1057
  }
1042
- function Nt(e, t) {
1058
+ function At(e, t) {
1043
1059
  var o, l;
1044
1060
  const n = (l = (o = e.filters) == null ? void 0 : o.find((d) => d.kind === "period")) == null ? void 0 : l.period;
1045
1061
  if (!n) return;
@@ -1051,13 +1067,13 @@ function Nt(e, t) {
1051
1067
  };
1052
1068
  return a && r ? `${i(a)} — ${i(r)}` : i(a || r);
1053
1069
  }
1054
- function wt({
1070
+ function Rt({
1055
1071
  document: e,
1056
1072
  outline: t,
1057
1073
  report: n
1058
1074
  }) {
1059
1075
  var o, l;
1060
- const a = T(), r = t.kpis, i = Nt(e, a("filter.period.allTime", "All time"));
1076
+ const a = P(), r = t.kpis, i = At(e, a("filter.period.allTime", "All time"));
1061
1077
  return /* @__PURE__ */ u("header", { className: "lens-print-cover", children: [
1062
1078
  /* @__PURE__ */ u("div", { className: "lens-print-cover-head", children: [
1063
1079
  /* @__PURE__ */ s("p", { className: "lens-print-kicker", children: a("print.kicker", "Management audit report") }),
@@ -1088,15 +1104,15 @@ function wt({
1088
1104
  }) })
1089
1105
  ] })
1090
1106
  ] }),
1091
- r.length > 0 && /* @__PURE__ */ s("div", { className: "lens-print-kpis", children: r.map((d) => /* @__PURE__ */ s(me, { figure: d }, d.section.id)) }),
1107
+ r.length > 0 && /* @__PURE__ */ s("div", { className: "lens-print-kpis", children: r.map((d) => /* @__PURE__ */ s(Fe, { figure: d }, d.section.id)) }),
1092
1108
  (n.truncated || n.warnings.length > 0 || t.missing.length > 0) && /* @__PURE__ */ s("p", { className: "lens-print-cover-flag", children: a(
1093
1109
  "print.limitationsFlag",
1094
1110
  "This report discloses gaps in its data; see the closing appendix."
1095
1111
  ) })
1096
1112
  ] });
1097
1113
  }
1098
- function xt({ outline: e }) {
1099
- const t = T();
1114
+ function Lt({ outline: e }) {
1115
+ const t = P();
1100
1116
  return /* @__PURE__ */ u("section", { className: "lens-print-contents", children: [
1101
1117
  /* @__PURE__ */ s("h2", { children: t("print.contents", "Contents") }),
1102
1118
  /* @__PURE__ */ u("ol", { children: [
@@ -1120,61 +1136,61 @@ function xt({ outline: e }) {
1120
1136
  ) })
1121
1137
  ] });
1122
1138
  }
1123
- function Ft({ chapter: e, title: t }) {
1124
- const n = T(), a = A(
1139
+ function Vt({ chapter: e, title: t }) {
1140
+ const n = P(), a = A(
1125
1141
  () => {
1126
- var b;
1127
- return nt(
1128
- e.figures.map((k) => ({
1129
- id: k.section.id,
1130
- panel: D(k.section),
1131
- frame: k.section.frame
1142
+ var v;
1143
+ return ht(
1144
+ e.figures.map((N) => ({
1145
+ id: N.section.id,
1146
+ panel: T(N.section),
1147
+ frame: N.section.frame
1132
1148
  })),
1133
- ((b = e.figures[0]) == null ? void 0 : b.section.document.meta.locale) ?? "en"
1149
+ ((v = e.figures[0]) == null ? void 0 : v.section.document.meta.locale) ?? "en"
1134
1150
  );
1135
1151
  },
1136
1152
  [e.figures]
1137
- ), r = Oe(e.figures, n);
1153
+ ), r = et(e.figures, n);
1138
1154
  if (e.figures.length === 0) return null;
1139
1155
  const i = /* @__PURE__ */ new Set([e.caption ?? ""]), o = [];
1140
1156
  let l, d;
1141
- const c = (b) => /* @__PURE__ */ s(yt, { figure: b, footnotes: r.get(b.section.id) }, b.section.id), p = (b) => {
1157
+ const c = (v) => /* @__PURE__ */ s(Pt, { figure: v, footnotes: r.get(v.section.id) }, v.section.id), p = (v) => {
1142
1158
  if (!d) {
1143
- o.push(b);
1159
+ o.push(v);
1144
1160
  return;
1145
1161
  }
1146
- const k = d;
1162
+ const N = d;
1147
1163
  d = void 0, o.push(
1148
1164
  /* @__PURE__ */ u("div", { className: "lens-print-lead-group", children: [
1149
- k,
1150
- b
1151
- ] }, `lead-${b.key}`)
1165
+ N,
1166
+ v
1167
+ ] }, `lead-${v.key}`)
1152
1168
  );
1153
1169
  }, h = () => {
1154
1170
  l && (p(c(l)), l = void 0);
1155
- }, y = (b) => {
1156
- if (b.width !== "half") {
1157
- h(), p(c(b));
1171
+ }, k = (v) => {
1172
+ if (v.width !== "half") {
1173
+ h(), p(c(v));
1158
1174
  return;
1159
1175
  }
1160
1176
  if (!l) {
1161
- l = b;
1177
+ l = v;
1162
1178
  return;
1163
1179
  }
1164
- const k = l;
1180
+ const N = l;
1165
1181
  l = void 0, p(
1166
1182
  /* @__PURE__ */ u("div", { className: "lens-print-pair", children: [
1167
- c(k),
1168
- c(b)
1169
- ] }, `pair-${k.section.id}`)
1183
+ c(N),
1184
+ c(v)
1185
+ ] }, `pair-${N.section.id}`)
1170
1186
  );
1171
1187
  };
1172
- for (const b of e.figures) {
1173
- const k = b.group, P = `${(k == null ? void 0 : k.label) ?? ""}::${(k == null ? void 0 : k.caption) ?? ""}`;
1174
- k && !i.has(P) && (i.add(P), h(), d = /* @__PURE__ */ u("div", { className: "lens-print-strip", children: [
1175
- k.label && /* @__PURE__ */ s("h3", { children: k.label }),
1176
- k.caption && k.caption !== e.caption && /* @__PURE__ */ s("p", { children: k.caption })
1177
- ] }, `strip-${b.section.id}`)), y(b);
1188
+ for (const v of e.figures) {
1189
+ const N = v.group, K = `${(N == null ? void 0 : N.label) ?? ""}::${(N == null ? void 0 : N.caption) ?? ""}`;
1190
+ N && !i.has(K) && (i.add(K), h(), d = /* @__PURE__ */ u("div", { className: "lens-print-strip", children: [
1191
+ N.label && /* @__PURE__ */ s("h3", { children: N.label }),
1192
+ N.caption && N.caption !== e.caption && /* @__PURE__ */ s("p", { children: N.caption })
1193
+ ] }, `strip-${v.section.id}`)), k(v);
1178
1194
  }
1179
1195
  return h(), d && o.push(d), /* @__PURE__ */ u("section", { className: "lens-print-chapter", children: [
1180
1196
  /* @__PURE__ */ u("header", { className: "lens-print-chapter-head", children: [
@@ -1190,20 +1206,20 @@ function Ft({ chapter: e, title: t }) {
1190
1206
  e.title
1191
1207
  ] }),
1192
1208
  e.caption && /* @__PURE__ */ s("p", { className: "lens-print-lead", children: e.caption }),
1193
- a.length > 0 && /* @__PURE__ */ s("p", { className: "lens-print-chapter-headline", children: a.map((b) => /* @__PURE__ */ u("span", { children: [
1194
- /* @__PURE__ */ s("span", { className: "lens-print-chapter-headline-label", children: b.label }),
1195
- b.value
1196
- ] }, b.id)) })
1209
+ a.length > 0 && /* @__PURE__ */ s("p", { className: "lens-print-chapter-headline", children: a.map((v) => /* @__PURE__ */ u("span", { children: [
1210
+ /* @__PURE__ */ s("span", { className: "lens-print-chapter-headline-label", children: v.label }),
1211
+ v.value
1212
+ ] }, v.id)) })
1197
1213
  ] }),
1198
1214
  /* @__PURE__ */ s("div", { className: "lens-print-grid", children: o })
1199
1215
  ] });
1200
1216
  }
1201
- const $t = 12, ee = 8;
1202
- function St({ detail: e }) {
1217
+ const qt = 12, ce = 8;
1218
+ function It({ detail: e }) {
1203
1219
  var o;
1204
- const t = T(), n = D(e.section), a = ((o = e.section.frame) == null ? void 0 : o.rows.length) ?? 0, r = n.semantics === "series" && a > $t, i = r && e.section.frame ? {
1220
+ const t = P(), n = T(e.section), a = ((o = e.section.frame) == null ? void 0 : o.rows.length) ?? 0, r = n.semantics === "series" && a > qt, i = r && e.section.frame ? {
1205
1221
  ...e.section,
1206
- frame: { ...e.section.frame, rows: e.section.frame.rows.slice(-ee) }
1222
+ frame: { ...e.section.frame, rows: e.section.frame.rows.slice(-ce) }
1207
1223
  } : e.section;
1208
1224
  return /* @__PURE__ */ u("article", { className: "lens-print-detail", children: [
1209
1225
  /* @__PURE__ */ u("header", { children: [
@@ -1211,17 +1227,17 @@ function St({ detail: e }) {
1211
1227
  /* @__PURE__ */ s("h4", { children: n.title }),
1212
1228
  /* @__PURE__ */ s("p", { className: "lens-print-detail-trail", children: e.trail })
1213
1229
  ] }),
1214
- r && /* @__PURE__ */ s(oe, { height: 110, section: e.section }),
1215
- /* @__PURE__ */ s(z, { dense: !0, exact: !0, section: i }),
1216
- /* @__PURE__ */ s(de, { section: e.section }),
1230
+ r && /* @__PURE__ */ s(ke, { height: 110, section: e.section }),
1231
+ /* @__PURE__ */ s(J, { dense: !0, exact: !0, section: i }),
1232
+ /* @__PURE__ */ s(we, { section: e.section }),
1217
1233
  r && /* @__PURE__ */ s("p", { className: "lens-print-detail-note", children: t("print.seriesTail", "The chart carries all {rows} periods; the table keeps the most recent {kept}.", {
1218
1234
  rows: a,
1219
- kept: ee
1235
+ kept: ce
1220
1236
  }) })
1221
1237
  ] });
1222
1238
  }
1223
- function Mt({ outline: e, title: t }) {
1224
- const n = T();
1239
+ function Et({ outline: e, title: t }) {
1240
+ const n = P();
1225
1241
  return e.appendix.length === 0 ? null : /* @__PURE__ */ u("section", { className: "lens-print-appendix", children: [
1226
1242
  /* @__PURE__ */ u("header", { className: "lens-print-chapter-head", children: [
1227
1243
  /* @__PURE__ */ u("p", { className: "lens-print-runninghead", children: [
@@ -1245,18 +1261,18 @@ function Mt({ outline: e, title: t }) {
1245
1261
  ". ",
1246
1262
  a.title
1247
1263
  ] }),
1248
- /* @__PURE__ */ s("div", { className: "lens-print-grid lens-print-grid-dense", children: a.details.map((r) => /* @__PURE__ */ s(St, { detail: r }, r.section.id)) })
1264
+ /* @__PURE__ */ s("div", { className: "lens-print-grid lens-print-grid-dense", children: a.details.map((r) => /* @__PURE__ */ s(It, { detail: r }, r.section.id)) })
1249
1265
  ] }, a.id))
1250
1266
  ] });
1251
1267
  }
1252
- function Ct({
1268
+ function Bt({
1253
1269
  document: e,
1254
1270
  outline: t,
1255
1271
  report: n,
1256
1272
  title: a
1257
1273
  }) {
1258
- const r = T(), i = A(
1259
- () => Ve(t.qualities, r),
1274
+ const r = P(), i = A(
1275
+ () => Ge(t.qualities, r),
1260
1276
  [t.qualities, r]
1261
1277
  );
1262
1278
  return /* @__PURE__ */ u("section", { className: "lens-print-method", children: [
@@ -1308,29 +1324,29 @@ function Ct({
1308
1324
  ] })
1309
1325
  ] });
1310
1326
  }
1311
- function Dt({ report: e }) {
1327
+ function _t({ report: e }) {
1312
1328
  var o;
1313
- const t = T(), n = e.document, a = ((o = n.header) == null ? void 0 : o.title) || n.meta.title, r = A(() => ut(e), [e]), i = A(
1314
- () => ct(
1329
+ const t = P(), n = e.document, a = ((o = n.header) == null ? void 0 : o.title) || n.meta.title, r = A(() => xt(e), [e]), i = A(
1330
+ () => Nt(
1315
1331
  e,
1316
1332
  t("print.summary", "Summary"),
1317
1333
  t("print.other", "Other readings")
1318
1334
  ),
1319
1335
  [e, t]
1320
1336
  );
1321
- return /* @__PURE__ */ u(se.Provider, { value: r, children: [
1322
- /* @__PURE__ */ s(wt, { document: n, outline: i, report: e }),
1323
- /* @__PURE__ */ s(xt, { outline: i }),
1324
- i.chapters.map((l) => /* @__PURE__ */ s(Ft, { chapter: l, title: a }, l.id)),
1325
- /* @__PURE__ */ s(Mt, { outline: i, title: a }),
1326
- /* @__PURE__ */ s(Ct, { document: n, outline: i, report: e, title: a })
1337
+ return /* @__PURE__ */ u(ve.Provider, { value: r, children: [
1338
+ /* @__PURE__ */ s(Rt, { document: n, outline: i, report: e }),
1339
+ /* @__PURE__ */ s(Lt, { outline: i }),
1340
+ i.chapters.map((l) => /* @__PURE__ */ s(Vt, { chapter: l, title: a }, l.id)),
1341
+ /* @__PURE__ */ s(Et, { outline: i, title: a }),
1342
+ /* @__PURE__ */ s(Bt, { document: n, outline: i, report: e, title: a })
1327
1343
  ] });
1328
1344
  }
1329
- function Bt() {
1330
- const { document: e } = xe(), t = Fe();
1345
+ function Yt() {
1346
+ const { document: e } = qe(), t = Ie();
1331
1347
  if (!t.report || typeof globalThis.document > "u") return null;
1332
1348
  const n = e.theme.palette.accent ?? e.theme.palette.primary;
1333
- return ge(
1349
+ return De(
1334
1350
  /* @__PURE__ */ s(
1335
1351
  "article",
1336
1352
  {
@@ -1339,13 +1355,13 @@ function Bt() {
1339
1355
  "data-preview": t.preview ? "true" : void 0,
1340
1356
  lang: e.meta.locale,
1341
1357
  style: n ? { "--lens-accent-500": n } : void 0,
1342
- children: /* @__PURE__ */ s(Dt, { report: t.report })
1358
+ children: /* @__PURE__ */ s(_t, { report: t.report })
1343
1359
  }
1344
1360
  ),
1345
1361
  globalThis.document.body
1346
1362
  );
1347
1363
  }
1348
1364
  export {
1349
- Bt as PrintReport,
1350
- Dt as PrintReportView
1365
+ Yt as PrintReport,
1366
+ _t as PrintReportView
1351
1367
  };