@umriss-ui/calculation 0.6.0 → 0.7.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.
- package/CHANGELOG.md +30 -0
- package/README.md +4 -0
- package/dist/calculation.css +1 -1
- package/dist/calculation.js +392 -391
- package/dist/index.d.ts +6 -1
- package/docs/llms-full.md +117 -39
- package/package.json +3 -3
package/dist/calculation.js
CHANGED
|
@@ -1,242 +1,242 @@
|
|
|
1
1
|
import "./calculation.css";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Children as
|
|
4
|
-
import { assess as
|
|
5
|
-
function
|
|
2
|
+
import { jsx as b, jsxs as R } from "react/jsx-runtime";
|
|
3
|
+
import { Children as ke, isValidElement as K, Fragment as Me, useId as Te, useState as re, useRef as Ee, useCallback as Ae, useLayoutEffect as Re, useEffect as De } from "react";
|
|
4
|
+
import { assess as Ie, verdictWeight as oe, useDensityFor as Pe, useFormats as Oe, useWording as Se, VisuallyHidden as je, AngleGlyph as Be, Badge as le, useFreshness as Le, Tooltip as Fe } from "@umriss-ui/core";
|
|
5
|
+
function We(t) {
|
|
6
6
|
return t.decimals !== void 0 ? t.decimals : t.format === "percent" ? 1 : t.given ? void 0 : 2;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Ue(t, e) {
|
|
9
9
|
return e === void 0 ? t : Math.sign(t) * Number(Math.abs(t).toFixed(e)) || 0;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function se(t, e) {
|
|
12
|
+
return Ue(t.format === "percent" ? e * 100 : e, We(t));
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
function
|
|
16
|
-
const [
|
|
14
|
+
const Qe = (t, e) => t.format === "percent" ? e / 100 : e;
|
|
15
|
+
function ge(t, e, p) {
|
|
16
|
+
const [o, ...i] = e;
|
|
17
17
|
switch (t) {
|
|
18
18
|
case "sum":
|
|
19
|
-
return e.reduce((
|
|
19
|
+
return e.reduce((n, c, S) => p[S] ? n - c : n + c, 0);
|
|
20
20
|
case "difference":
|
|
21
|
-
return
|
|
21
|
+
return i.reduce((n, c) => n - c, o);
|
|
22
22
|
case "product":
|
|
23
|
-
return
|
|
23
|
+
return i.reduce((n, c) => n * c, o);
|
|
24
24
|
case "quotient":
|
|
25
|
-
return
|
|
25
|
+
return o / i[0];
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
function
|
|
30
|
-
const e = /* @__PURE__ */ new Map(), p = (
|
|
31
|
-
var
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
let
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
typeof
|
|
28
|
+
const be = (t, e) => e === void 0 || t !== void 0 && oe(t) >= oe(e) ? t : e;
|
|
29
|
+
function ze(t) {
|
|
30
|
+
const e = /* @__PURE__ */ new Map(), p = (o) => {
|
|
31
|
+
var r, u, $;
|
|
32
|
+
const i = e.get(o);
|
|
33
|
+
if (i) return i;
|
|
34
|
+
const n = t.quantities.get(o);
|
|
35
|
+
let c = null, S, l = !1, y;
|
|
36
|
+
if (n.given) {
|
|
37
|
+
const s = n.given.value;
|
|
38
|
+
typeof s == "number" && Number.isFinite(s) ? c = s : S = { kind: "missing", label: n.label };
|
|
39
39
|
} else {
|
|
40
|
-
const
|
|
41
|
-
for (const { operand:
|
|
42
|
-
const x =
|
|
43
|
-
|
|
40
|
+
const s = n.operands.map((v) => ({ operand: v, ...p(v.key) }));
|
|
41
|
+
for (const { operand: v, verdict: k, worst: M } of s) {
|
|
42
|
+
const x = v.reference ? k : be(k, M);
|
|
43
|
+
y = be(y, x);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
S = (r = s.find((v) => v.absence)) == null ? void 0 : r.absence;
|
|
46
|
+
const w = s[1];
|
|
47
|
+
if (!S && n.operator === "quotient" && w.value === 0 && (S = { kind: "zero", label: t.quantities.get(w.operand.key).label }), !S) {
|
|
48
|
+
const v = n.operands.map((M) => M.negated === !0);
|
|
49
|
+
c = ge(n.operator, s.map((M) => M.value), v);
|
|
50
|
+
const k = ge(
|
|
51
|
+
n.operator,
|
|
52
|
+
s.map((M) => Qe(t.quantities.get(M.operand.key), M.shown)),
|
|
53
|
+
v
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
l = se(n, k) !== se(n, c);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
value:
|
|
60
|
-
absence:
|
|
61
|
-
shown:
|
|
62
|
-
approximate:
|
|
63
|
-
assessment:
|
|
64
|
-
verdict:
|
|
65
|
-
worst:
|
|
58
|
+
const A = { target: n.target, limits: n.limits }, L = n.target !== void 0 || (((u = n.limits) == null ? void 0 : u.length) ?? 0) > 0 ? Ie(c, A) : void 0, z = ((($ = n.limits) == null ? void 0 : $.length) ?? 0) > 0 ? L.verdict : c === null ? "unknown" : void 0, F = {
|
|
59
|
+
value: c,
|
|
60
|
+
absence: S,
|
|
61
|
+
shown: c === null ? null : se(n, c),
|
|
62
|
+
approximate: l,
|
|
63
|
+
assessment: L,
|
|
64
|
+
verdict: z,
|
|
65
|
+
worst: y
|
|
66
66
|
};
|
|
67
|
-
return e.set(
|
|
67
|
+
return e.set(o, F), F;
|
|
68
68
|
};
|
|
69
|
-
for (const
|
|
69
|
+
for (const o of t.quantities.keys()) p(o);
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
72
|
-
const
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[
|
|
77
|
-
]),
|
|
72
|
+
const Ve = () => null, Ge = () => null, He = () => null, Ke = () => null, Ye = () => null, $e = () => null, Je = () => null, Ze = () => null, Xe = () => null, et = () => null, tt = () => null, ce = () => null, nt = /* @__PURE__ */ new Map([
|
|
73
|
+
[Ge, "sum"],
|
|
74
|
+
[He, "difference"],
|
|
75
|
+
[Ke, "product"],
|
|
76
|
+
[Ye, "quotient"]
|
|
77
|
+
]), _e = {
|
|
78
78
|
sum: "Sum",
|
|
79
79
|
difference: "Difference",
|
|
80
80
|
product: "Product",
|
|
81
81
|
quotient: "Quotient"
|
|
82
82
|
}, ue = /* @__PURE__ */ new Map([
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
86
|
-
[
|
|
87
|
-
]), de = "<Given>, <Sum>, <Difference>, <Product>, <Quotient> or <Chain>",
|
|
88
|
-
function
|
|
83
|
+
[Ze, { name: "Plus", operator: "sum" }],
|
|
84
|
+
[Xe, { name: "Minus", operator: "sum", negated: !0 }],
|
|
85
|
+
[et, { name: "Times", operator: "product" }],
|
|
86
|
+
[tt, { name: "DividedBy", operator: "quotient" }]
|
|
87
|
+
]), de = "<Given>, <Sum>, <Difference>, <Product>, <Quotient> or <Chain>", ye = "a calculation with metrics only adds and subtracts - <Sum>, <Difference>, <Plus>, <Minus>.", st = ["unit", "format", "decimals"];
|
|
88
|
+
function O(t) {
|
|
89
89
|
throw new Error(`@umriss-ui/calculation: ${t}`);
|
|
90
90
|
}
|
|
91
91
|
function ee(t) {
|
|
92
|
-
return
|
|
93
|
-
(e) =>
|
|
92
|
+
return ke.toArray(t).flatMap(
|
|
93
|
+
(e) => K(e) && e.type === Me ? ee(e.props.children) : [e]
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
function ne(t) {
|
|
97
|
-
if (!
|
|
97
|
+
if (!K(t)) return JSON.stringify(t);
|
|
98
98
|
const e = t.type;
|
|
99
99
|
return typeof e == "string" ? `<${e}>` : `<${e.displayName ?? e.name ?? "anonymous"}>`;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
function
|
|
101
|
+
const fe = (t, e, p) => `${t}/${K(e) && e.key || p}`;
|
|
102
|
+
function at(t, e) {
|
|
103
103
|
const p = ee(t);
|
|
104
|
-
if (p.length !== 1 &&
|
|
105
|
-
e.length === 0 &&
|
|
106
|
-
const
|
|
107
|
-
for (const { id:
|
|
108
|
-
|
|
104
|
+
if (p.length !== 1 && O(`<Calculation> takes exactly one child, the result; it was given ${p.length}.`), e !== void 0) {
|
|
105
|
+
e.length === 0 && O("<Calculation>: metrics is empty; leave it out for a calculation with one number per quantity.");
|
|
106
|
+
const r = /* @__PURE__ */ new Set();
|
|
107
|
+
for (const { id: u } of e)
|
|
108
|
+
r.has(u) && O(`<Calculation>: the metric id "${u}" is used twice.`), r.add(u);
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
const $ = typeof
|
|
110
|
+
const o = e == null ? void 0 : e.map((r) => `"${r.id}"`).join(", "), i = (r, u) => {
|
|
111
|
+
const $ = typeof r == "object" && r !== null;
|
|
112
112
|
if (e === void 0) {
|
|
113
|
-
$ &&
|
|
113
|
+
$ && O(`${u}: value is an object by metric, but the calculation has no metrics.`);
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
$ ||
|
|
117
|
-
for (const { id:
|
|
118
|
-
|
|
119
|
-
for (const
|
|
120
|
-
e.some((
|
|
121
|
-
},
|
|
122
|
-
const { id:
|
|
116
|
+
$ || O(`${u}: with metrics, value is an object with a number for each metric - ${o}.`);
|
|
117
|
+
for (const { id: s } of e)
|
|
118
|
+
s in r || O(`${u}: value has no number for the metric "${s}"; write null where it is absent. The metrics: ${o}.`);
|
|
119
|
+
for (const s of Object.keys(r))
|
|
120
|
+
e.some((w) => w.id === s) || O(`${u}: value has a number for "${s}", which is no metric. The metrics: ${o}.`);
|
|
121
|
+
}, n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), S = [], l = (r, u, $) => {
|
|
122
|
+
const { id: s, ...w } = u;
|
|
123
123
|
if (e !== void 0) {
|
|
124
|
-
for (const
|
|
125
|
-
|
|
126
|
-
(
|
|
124
|
+
for (const k of st)
|
|
125
|
+
u[k] !== void 0 && O(`${$}: ${k} belongs to the metric once the calculation has metrics, not to a quantity.`);
|
|
126
|
+
(u.target !== void 0 || u.limits !== void 0) && O(`${$}: target and limits are not assessed in a calculation with metrics.`);
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
return
|
|
131
|
-
},
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
134
|
-
return
|
|
128
|
+
s !== void 0 && (c.has(s) && O(`${$}: the id "${s}" is used twice.`), c.set(s, r));
|
|
129
|
+
const v = { ...w, key: r, id: s, operands: [] };
|
|
130
|
+
return n.set(r, v), v;
|
|
131
|
+
}, y = (r, u, $) => {
|
|
132
|
+
if (K(r) && r.type === $e) {
|
|
133
|
+
const s = { key: "", reference: !0 };
|
|
134
|
+
return S.push({ operand: s, to: r.props.to, where: $ }), s;
|
|
135
135
|
}
|
|
136
|
-
return { key:
|
|
137
|
-
},
|
|
138
|
-
if ((!
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
`${$}: ${ne(
|
|
136
|
+
return { key: A(r, u, $), reference: !1 };
|
|
137
|
+
}, A = (r, u, $) => {
|
|
138
|
+
if ((!K(r) || r.type === $e || ue.has(r.type) || r.type === ce) && O(`${$}: ${ne(r)} cannot stand here; a quantity must be ${de}.`), r.type === Je) return L(r.props.children, u, $);
|
|
139
|
+
const s = nt.get(r.type);
|
|
140
|
+
r.type !== Ve && s === void 0 && O(
|
|
141
|
+
`${$}: ${ne(r)} is not an element of the calculation. A calculation reads its children's props and cannot look inside a component of your own; write ${de} or <Ref> directly, or return them from .map.`
|
|
142
142
|
);
|
|
143
|
-
const { children:
|
|
144
|
-
e !== void 0 && (
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
return (
|
|
151
|
-
`${
|
|
152
|
-
),
|
|
153
|
-
},
|
|
154
|
-
const
|
|
155
|
-
(
|
|
156
|
-
let
|
|
157
|
-
return
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
x.length === 0 &&
|
|
162
|
-
const
|
|
163
|
-
|
|
143
|
+
const { children: w, value: v, source: k, asOf: M, ages: x, ...D } = r.props, g = `${$} › ${D.label}`;
|
|
144
|
+
e !== void 0 && (s === "product" || s === "quotient") && O(`${g}: <${_e[s]}> - ${ye}`);
|
|
145
|
+
const C = l(u, D, g);
|
|
146
|
+
if (s === void 0)
|
|
147
|
+
return i(v, g), C.given = { value: v, source: k, asOf: M, ages: x }, u;
|
|
148
|
+
C.operator = s;
|
|
149
|
+
const _ = ee(w), N = _.length;
|
|
150
|
+
return (s === "quotient" ? N !== 2 : s !== "sum" && N < 2) && O(
|
|
151
|
+
`${g}: <${_e[s]}> takes ${s === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${N}.`
|
|
152
|
+
), C.operands = _.map((a, d) => y(a, fe(u, a, d), g)), u;
|
|
153
|
+
}, L = (r, u, $) => {
|
|
154
|
+
const s = `${$} › <Chain>`, [w, ...v] = ee(r);
|
|
155
|
+
(w === void 0 || K(w) && (ue.has(w.type) || w.type === ce)) && O(`${s}: a chain starts with a quantity that has no operator - ${de} or <Ref>.`);
|
|
156
|
+
let k = y(w, fe(u, w, 0), s), M = ne(w), x = [], D;
|
|
157
|
+
return v.forEach((g, C) => {
|
|
158
|
+
const _ = fe(u, g, C + 1);
|
|
159
|
+
if (K(g) && g.type === ce) {
|
|
160
|
+
const U = g.props, G = `${s} › ${U.label}`;
|
|
161
|
+
x.length === 0 && O(`${G}: an <Interim> needs an operand since the named value before it, ${M}.`);
|
|
162
|
+
const H = l(_, U, G);
|
|
163
|
+
H.interim = !0, H.operator = x[0].line.operator, H.operands = [k, ...x.map((te) => te.operand)], k = { key: _, reference: !1, previous: !0 }, M = `<Interim label="${U.label}">`, x = [], D = _;
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
(
|
|
170
|
-
`${
|
|
166
|
+
const N = K(g) ? ue.get(g.type) : void 0;
|
|
167
|
+
N === void 0 && O(`${s}: ${ne(g)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`), e !== void 0 && N.operator !== "sum" && O(`${s}: <${N.name}> - ${ye}`);
|
|
168
|
+
const a = N.operator !== "sum", d = x.find((U) => U.line.operator !== "sum");
|
|
169
|
+
(a && x.length > 0 || d) && O(
|
|
170
|
+
`${s}: <${(d ?? { line: N }).line.name}> stands alone between two named values - directly after the first quantity or an <Interim>, and directly before an <Interim>.`
|
|
171
171
|
);
|
|
172
|
-
const { children:
|
|
173
|
-
if (
|
|
174
|
-
(
|
|
175
|
-
const
|
|
176
|
-
|
|
172
|
+
const { children: h, ...T } = g.props, f = ee(h), I = () => O(`${s}: <${N.name}> takes either a label and a value, or exactly one quantity as its child.`);
|
|
173
|
+
if (f.length > 0) {
|
|
174
|
+
(f.length > 1 || Object.values(T).some((G) => G !== void 0)) && I();
|
|
175
|
+
const U = y(f[0], _, s);
|
|
176
|
+
U.negated = N.negated, x.push({ operand: U, line: N });
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
|
-
T.label === void 0 &&
|
|
180
|
-
const { value:
|
|
181
|
-
|
|
182
|
-
}), (x.length > 0 ||
|
|
183
|
-
},
|
|
184
|
-
(
|
|
185
|
-
for (const { operand:
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
189
|
-
|
|
179
|
+
T.label === void 0 && I();
|
|
180
|
+
const { value: P, source: E, asOf: j, ages: Y, ...V } = T, B = `${s} › ${T.label}`, W = l(_, { ...V, label: T.label }, B);
|
|
181
|
+
i(P, B), W.given = { value: P, source: E, asOf: j, ages: Y }, x.push({ operand: { key: _, reference: !1, negated: N.negated }, line: N });
|
|
182
|
+
}), (x.length > 0 || D === void 0) && O(`${s}: a chain ends with an <Interim>, which names its value.`), D;
|
|
183
|
+
}, z = A(p[0], "0", "<Calculation>"), F = n.get(z);
|
|
184
|
+
(F.emphasis !== void 0 || F.rule !== void 0) && O(`<Calculation> › ${F.label}: emphasis and rule do not stand on the Result, which is already the heaviest line.`);
|
|
185
|
+
for (const { operand: r, to: u, where: $ } of S) {
|
|
186
|
+
const s = c.get(u);
|
|
187
|
+
if (s === void 0) {
|
|
188
|
+
const w = [...c.keys()].map((v) => `"${v}"`).join(", ");
|
|
189
|
+
O(`${$}: <Ref to="${u}"> names no quantity. ${w ? `The ids that exist: ${w}.` : "No quantity has an id."}`);
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
r.key = s;
|
|
192
192
|
}
|
|
193
|
-
return
|
|
193
|
+
return it(n), { result: z, quantities: n, metrics: e };
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function ot(t) {
|
|
196
196
|
return t.metrics ? t.metrics.map((e) => {
|
|
197
197
|
const p = /* @__PURE__ */ new Map();
|
|
198
|
-
for (const [
|
|
199
|
-
const
|
|
200
|
-
p.set(
|
|
198
|
+
for (const [o, i] of t.quantities) {
|
|
199
|
+
const n = i.given && { ...i.given, value: i.given.value[e.id] };
|
|
200
|
+
p.set(o, { ...i, unit: e.unit, decimals: e.decimals, given: n });
|
|
201
201
|
}
|
|
202
202
|
return { result: t.result, quantities: p };
|
|
203
203
|
}) : [t];
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
const e = /* @__PURE__ */ new Set(), p = [],
|
|
207
|
-
if (e.has(
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
const
|
|
211
|
-
|
|
205
|
+
function it(t) {
|
|
206
|
+
const e = /* @__PURE__ */ new Set(), p = [], o = (i) => {
|
|
207
|
+
if (e.has(i)) return;
|
|
208
|
+
const n = p.indexOf(i);
|
|
209
|
+
if (n !== -1) {
|
|
210
|
+
const c = [...p.slice(n), i].map((S) => t.get(S).label);
|
|
211
|
+
O(`the calculation goes round in a circle through references: ${c.join(" → ")}.`);
|
|
212
212
|
}
|
|
213
|
-
p.push(
|
|
214
|
-
for (const
|
|
215
|
-
p.pop(), e.add(
|
|
213
|
+
p.push(i);
|
|
214
|
+
for (const c of t.get(i).operands) o(c.key);
|
|
215
|
+
p.pop(), e.add(i);
|
|
216
216
|
};
|
|
217
|
-
for (const
|
|
217
|
+
for (const i of t.keys()) o(i);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
function
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
226
|
-
return
|
|
219
|
+
const we = 4;
|
|
220
|
+
function rt(t, e, p) {
|
|
221
|
+
const o = t.operands[e];
|
|
222
|
+
if (o.previous) return;
|
|
223
|
+
const i = t.operator, n = e === 0;
|
|
224
|
+
if (i !== "sum" && i !== "difference") return n ? void 0 : { operator: i, negated: !1 };
|
|
225
|
+
const c = i === "difference" ? !n : o.negated === !0, S = new Set(p.filter((y) => y !== null && y !== 0).map(Math.sign)), l = S.size === 1 ? { operator: "sum", negated: c !== S.has(-1), unsigned: !0 } : { operator: "sum", negated: c };
|
|
226
|
+
return n && !l.negated ? void 0 : l;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
228
|
+
const lt = {
|
|
229
229
|
sum: "calculationSumSymbol",
|
|
230
230
|
difference: "calculationDifferenceSymbol",
|
|
231
231
|
product: "calculationProductSymbol",
|
|
232
232
|
quotient: "calculationQuotientSymbol"
|
|
233
|
-
},
|
|
233
|
+
}, ct = {
|
|
234
234
|
sum: "calculationSumWord",
|
|
235
235
|
difference: "calculationDifferenceWord",
|
|
236
236
|
product: "calculationProductWord",
|
|
237
237
|
quotient: "calculationQuotientWord"
|
|
238
238
|
};
|
|
239
|
-
function
|
|
239
|
+
function ae(t, e) {
|
|
240
240
|
switch (t) {
|
|
241
241
|
case "alarm":
|
|
242
242
|
return e.verdictAlarm;
|
|
@@ -249,310 +249,311 @@ function oe(t, e) {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
function ie(t, e, p) {
|
|
252
|
-
const
|
|
253
|
-
return p[(e ?
|
|
252
|
+
const o = t.negated ? "difference" : t.operator;
|
|
253
|
+
return p[(e ? ct : lt)[o]];
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function ut(t, e) {
|
|
256
256
|
return t.kind === "missing" ? e.calculationMissing(t.label) : e.calculationDivisionByZero(t.label);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
const
|
|
260
|
-
return
|
|
258
|
+
function Ne(t, e, p, o) {
|
|
259
|
+
const i = t.format === "percent" ? o : t.unit, n = p.number(e, t.decimals);
|
|
260
|
+
return i ? `${n} ${i}` : n;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function dt(t, e, p, o, i, n, c, S = () => {
|
|
263
263
|
}) {
|
|
264
|
-
const
|
|
265
|
-
const
|
|
266
|
-
return
|
|
267
|
-
},
|
|
268
|
-
if (
|
|
269
|
-
if (
|
|
270
|
-
if (!
|
|
271
|
-
return { names:
|
|
272
|
-
const
|
|
273
|
-
const
|
|
274
|
-
return
|
|
264
|
+
const l = t.quantities.get(p), y = e.get(p), A = (g, C) => g.shown !== null && (C != null && C.unsigned) ? Math.abs(g.shown) : g.shown, L = (g, C, _, N) => {
|
|
265
|
+
const a = A(C, N);
|
|
266
|
+
return a === null ? _ ? n.verdictUnknown : n.statAbsentValue : Ne(g, a, i, _ ? n.calculationPercent : "%");
|
|
267
|
+
}, z = (g) => {
|
|
268
|
+
if (o || !l.operator) return {};
|
|
269
|
+
if (l.operands.length === 0) return { names: n.calculationNoOperands };
|
|
270
|
+
if (!g && l.operands.length > we)
|
|
271
|
+
return { names: n.calculationOperandCount(l.operands.length) };
|
|
272
|
+
const C = (_) => l.operands.map((N, a) => {
|
|
273
|
+
const d = t.quantities.get(N.key), h = S(a);
|
|
274
|
+
return h ? `${ie(h, g, n)} ${_(d, h)}` : _(d);
|
|
275
275
|
}).join(" ");
|
|
276
276
|
return {
|
|
277
|
-
names:
|
|
278
|
-
numbers:
|
|
277
|
+
names: C((_) => _.label),
|
|
278
|
+
numbers: C((_, N) => L(_, e.get(_.key), g, N))
|
|
279
279
|
};
|
|
280
|
-
},
|
|
281
|
-
var
|
|
282
|
-
const
|
|
283
|
-
if (
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
},
|
|
287
|
-
(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
].filter(Boolean).join(", "), x =
|
|
292
|
-
return { amount:
|
|
280
|
+
}, F = (g) => {
|
|
281
|
+
var N;
|
|
282
|
+
const C = (N = y.assessment) == null ? void 0 : N.deviation;
|
|
283
|
+
if (C === void 0 || l.target === void 0) return;
|
|
284
|
+
const _ = Ne(l, se(l, l.target), i, g ? n.calculationPercent : "%");
|
|
285
|
+
return C > 0 ? n.calculationAboveTarget(_) : C < 0 ? n.calculationBelowTarget(_) : n.calculationOnTarget(_);
|
|
286
|
+
}, r = z(!1).names, u = r === void 0 || l.operands.length === 0 || l.operands.length > we ? r : `= ${r}`, $ = z(!0), s = y.absence ? ut(y.absence, n) : void 0, w = ` ${n.calculationEquals} `, v = y.approximate ? `${n.calculationApproximately} ${L(l, y, !0, c)}` : L(l, y, !0, c), M = [
|
|
287
|
+
(c ? `${ie(c, !0, n)} ` : "") + l.label + w + [$.names, $.numbers, v].filter(Boolean).join(`,${w}`),
|
|
288
|
+
y.verdict !== void 0 && y.verdict !== "unknown" ? ae(y.verdict, n) : void 0,
|
|
289
|
+
F(!0),
|
|
290
|
+
s
|
|
291
|
+
].filter(Boolean).join(", "), x = y.shown === null ? void 0 : l.format === "percent" ? "%" : l.unit, D = (g) => g === null ? n.statAbsentValue : i.number(g, l.decimals);
|
|
292
|
+
return { amount: D(A(y, c)), ownAmount: D(y.shown), unit: x, names: u, target: F(!1), reason: s, sentence: M, spokenNames: $.names, spokenNumber: v };
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
const
|
|
296
|
-
(
|
|
294
|
+
function ft(t, e, p, o, i) {
|
|
295
|
+
const n = i ? `${ie(i, !0, o)} ` : "", c = e[0].spokenNames, S = n + t + (c === void 0 ? "" : ` ${o.calculationEquals} ${c}`), l = p.map(
|
|
296
|
+
(y, A) => [`${y.label} ${e[A].spokenNumber}`, e[A].reason].filter(Boolean).join(", ")
|
|
297
297
|
);
|
|
298
|
-
return `${
|
|
298
|
+
return `${S}: ${l.join("; ")}`;
|
|
299
299
|
}
|
|
300
|
-
const
|
|
301
|
-
frame:
|
|
302
|
-
calculation:
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
label:
|
|
315
|
-
approximate:
|
|
316
|
-
target:
|
|
317
|
-
worst:
|
|
318
|
-
head:
|
|
319
|
-
headCell:
|
|
320
|
-
headUnit:
|
|
321
|
-
notes:
|
|
322
|
-
freshness:
|
|
323
|
-
headLabel:
|
|
324
|
-
},
|
|
325
|
-
function
|
|
326
|
-
const p =
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
|
|
329
|
-
|
|
300
|
+
const pt = "_frame_is340_24 _text_r8i8z_23", mt = "_calculation_is340_51", ht = "_line_is340_86", vt = "_assessment_is340_98", gt = "_disclosure_is340_107", bt = "_amount_is340_90", $t = "_list_is340_128", _t = "_item_is340_129", yt = "_derivation_is340_130", wt = "_labelCell_is340_90", Nt = "_names_is340_90", Ot = "_operator_is340_90", St = "_unit_is340_90", Ct = "_label_is340_90", qt = "_approximate_is340_345", xt = "_target_is340_102", kt = "_worst_is340_102", Mt = "_head_is340_497", Tt = "_headCell_is340_504", Et = "_headUnit_is340_517", At = "_notes_is340_524", Rt = "_freshness_is340_538", Dt = "_headLabel_is340_568", m = {
|
|
301
|
+
frame: pt,
|
|
302
|
+
calculation: mt,
|
|
303
|
+
line: ht,
|
|
304
|
+
assessment: vt,
|
|
305
|
+
disclosure: gt,
|
|
306
|
+
amount: bt,
|
|
307
|
+
list: $t,
|
|
308
|
+
item: _t,
|
|
309
|
+
derivation: yt,
|
|
310
|
+
labelCell: wt,
|
|
311
|
+
names: Nt,
|
|
312
|
+
operator: Ot,
|
|
313
|
+
unit: St,
|
|
314
|
+
label: Ct,
|
|
315
|
+
approximate: qt,
|
|
316
|
+
target: xt,
|
|
317
|
+
worst: kt,
|
|
318
|
+
head: Mt,
|
|
319
|
+
headCell: Tt,
|
|
320
|
+
headUnit: Et,
|
|
321
|
+
notes: At,
|
|
322
|
+
freshness: Rt,
|
|
323
|
+
headLabel: Dt
|
|
324
|
+
}, It = 10, X = (t) => 4 + 2 * t, Pt = (t) => 5 + 2 * t, jt = { ok: "success", unknown: "neutral", warning: "warning", alarm: "danger" }, Bt = (...t) => t.filter(Boolean).join(" ");
|
|
325
|
+
function Lt({ asOf: t, ages: e }) {
|
|
326
|
+
const p = Oe(), o = Se(), i = Le(t, e), n = i.freshness === "lost" ? o.freshnessDisconnected : i.freshness === "stale" ? o.freshnessStale : o.freshnessFresh;
|
|
327
|
+
return /* @__PURE__ */ R("span", { className: m.freshness, "data-freshness": i.freshness, children: [
|
|
328
|
+
n,
|
|
329
|
+
i.age !== null && ` · ${p.relative(i.age)}`
|
|
330
330
|
] });
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
const
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
336
|
-
|
|
332
|
+
function Qt({ children: t, className: e, style: p, metrics: o, density: i, ...n }) {
|
|
333
|
+
const c = Pe(i, "regular") === "compact", S = Oe(), l = Se(), y = Te(), A = at(t, o), L = ot(A).map((a) => ({ view: a, results: ze(a) })), [z, F] = re(() => /* @__PURE__ */ new Set()), [r, u] = re(null), $ = Ee(null), [s, w] = re(!1), v = (o == null ? void 0 : o.length) ?? 0, k = Ae(() => {
|
|
334
|
+
const a = $.current, d = a && v > 0 ? getComputedStyle(a.firstElementChild).gridTemplateColumns.split(" ").map(parseFloat) : [], h = X(v) - 1;
|
|
335
|
+
if (!a || d.length <= h || d.some((E) => !Number.isFinite(E))) {
|
|
336
|
+
w(!1);
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
let
|
|
341
|
-
const
|
|
342
|
-
for (const
|
|
343
|
-
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
346
|
-
const
|
|
347
|
-
|
|
339
|
+
const T = d.slice(2, h).reduce((E, j) => E + j, 0);
|
|
340
|
+
let f = 0;
|
|
341
|
+
const I = document.createRange();
|
|
342
|
+
for (const E of a.querySelectorAll(`.${m.label}`)) {
|
|
343
|
+
I.selectNodeContents(E);
|
|
344
|
+
const j = [...I.getClientRects()].reduce((B, W) => B + W.width, 0);
|
|
345
|
+
if (j === 0) continue;
|
|
346
|
+
const Y = E.parentElement, V = E.getBoundingClientRect().left - Y.getBoundingClientRect().left;
|
|
347
|
+
f = Math.max(f, V + j + parseFloat(getComputedStyle(Y).paddingRight));
|
|
348
348
|
}
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
}, [
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
if (!
|
|
355
|
-
const
|
|
356
|
-
return
|
|
357
|
-
}, [
|
|
358
|
-
const
|
|
359
|
-
const
|
|
360
|
-
return
|
|
361
|
-
}),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
349
|
+
const P = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
350
|
+
w(a.clientWidth - T < Math.min(f, It * P));
|
|
351
|
+
}, [v]);
|
|
352
|
+
Re(() => k()), De(() => {
|
|
353
|
+
const a = $.current;
|
|
354
|
+
if (!a || v === 0) return;
|
|
355
|
+
const d = new ResizeObserver(() => k());
|
|
356
|
+
return d.observe(a), () => d.disconnect();
|
|
357
|
+
}, [k, v]);
|
|
358
|
+
const M = (a) => F((d) => {
|
|
359
|
+
const h = new Set(d);
|
|
360
|
+
return h.delete(a) || h.add(a), h;
|
|
361
|
+
}), x = (a, d) => rt(
|
|
362
|
+
a,
|
|
363
|
+
d,
|
|
364
|
+
L.map(({ results: h }) => h.get(a.operands[d].key).shown)
|
|
365
365
|
);
|
|
366
|
-
let
|
|
367
|
-
const
|
|
368
|
-
/* @__PURE__ */
|
|
366
|
+
let D = !1;
|
|
367
|
+
const g = (a, d) => a.map(({ own: h, text: T }, f) => [
|
|
368
|
+
/* @__PURE__ */ R(
|
|
369
369
|
"span",
|
|
370
370
|
{
|
|
371
|
-
className:
|
|
371
|
+
className: m.amount,
|
|
372
372
|
"aria-hidden": "true",
|
|
373
|
-
"data-verdict":
|
|
374
|
-
"data-later":
|
|
375
|
-
style:
|
|
373
|
+
"data-verdict": h.verdict,
|
|
374
|
+
"data-later": f > 0 ? "" : void 0,
|
|
375
|
+
style: o ? { "--column": X(f) } : void 0,
|
|
376
376
|
children: [
|
|
377
|
-
|
|
378
|
-
|
|
377
|
+
h.approximate && /* @__PURE__ */ b(Fe, { content: l.calculationApproximateNote, children: /* @__PURE__ */ b("span", { className: m.approximate, children: "≈" }) }),
|
|
378
|
+
d ? T.ownAmount : T.amount
|
|
379
379
|
]
|
|
380
380
|
},
|
|
381
|
-
`amount-${
|
|
381
|
+
`amount-${f}`
|
|
382
382
|
),
|
|
383
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ b(
|
|
384
384
|
"span",
|
|
385
385
|
{
|
|
386
|
-
className:
|
|
386
|
+
className: m.unit,
|
|
387
387
|
"aria-hidden": "true",
|
|
388
|
-
style:
|
|
389
|
-
"data-last":
|
|
390
|
-
children:
|
|
388
|
+
style: o ? { "--column": Pt(f) } : void 0,
|
|
389
|
+
"data-last": o && f === a.length - 1 ? "" : void 0,
|
|
390
|
+
children: o && !d ? void 0 : T.unit
|
|
391
391
|
},
|
|
392
|
-
`unit-${
|
|
392
|
+
`unit-${f}`
|
|
393
393
|
)
|
|
394
|
-
]),
|
|
395
|
-
const
|
|
396
|
-
own:
|
|
397
|
-
text:
|
|
398
|
-
})), { own:
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
(
|
|
402
|
-
) : [], Z =
|
|
403
|
-
!
|
|
404
|
-
(
|
|
405
|
-
(
|
|
406
|
-
!
|
|
407
|
-
].filter(Boolean),
|
|
394
|
+
]), C = (a, d) => r === null ? void 0 : a === r ? "use" : d === r ? "operand" : void 0, _ = (a, d, h, T) => {
|
|
395
|
+
const f = A.quantities.get(a), I = L.map(({ view: q, results: J }) => ({
|
|
396
|
+
own: J.get(a),
|
|
397
|
+
text: dt(q, J, a, d, S, l, h.position, (xe) => x(f, xe))
|
|
398
|
+
})), { own: P, text: E } = I[0], j = f.operator !== void 0 && !d, Y = a === A.result && !d, V = j && f.operands.length > 0 && (f.interim ? h.flat : Y), B = j && !V && f.operands.length > 0, W = B && z.has(a);
|
|
399
|
+
D || (D = B);
|
|
400
|
+
const U = `${y}-${a}`, G = { depth: V ? h.depth : h.depth + 1, flat: !1, parent: a }, H = j ? f.operands.find((q) => q.previous) : void 0, te = H && h.flat ? _(H.key, !1, { ...h, parent: a, position: void 0 }, `${T}-c`) : [], Ce = H && !h.flat ? _(H.key, !1, { ...G, flat: !0 }, `${T}-c`) : [], pe = j ? f.operands.map(
|
|
401
|
+
(q, J) => q.previous ? null : _(q.key, q.reference, { ...G, position: x(f, J) }, `${T}-${J}`)
|
|
402
|
+
) : [], Z = B && !W && P.worst !== void 0 && oe(P.worst) > oe(P.verdict ?? "ok") ? P.worst : void 0, Q = d ? void 0 : f.given, qe = h.position ? ie(h.position, !1, l) : void 0, me = [
|
|
403
|
+
!d && f.explanation !== void 0 && /* @__PURE__ */ b("span", { children: f.explanation }, "explanation"),
|
|
404
|
+
(Q == null ? void 0 : Q.source) !== void 0 && /* @__PURE__ */ b("span", { children: l.calculationSource(Q.source) }, "source"),
|
|
405
|
+
(Q == null ? void 0 : Q.asOf) !== void 0 && (Q.ages !== void 0 ? /* @__PURE__ */ b(Lt, { asOf: Q.asOf, ages: Q.ages }, "asOf") : /* @__PURE__ */ b("span", { children: l.asOfAgo(S.dateTime(new Date(Q.asOf), !1)) }, "asOf")),
|
|
406
|
+
!d && f.aside !== void 0 && /* @__PURE__ */ b("span", { children: f.aside }, "aside")
|
|
407
|
+
].filter(Boolean), he = Y ? "result" : f.interim && !d && h.flat ? "interim" : void 0, ve = /* @__PURE__ */ R(
|
|
408
408
|
"div",
|
|
409
409
|
{
|
|
410
|
-
className:
|
|
411
|
-
style: { "--depth":
|
|
412
|
-
"data-inner":
|
|
413
|
-
"data-kind":
|
|
414
|
-
"data-foldable":
|
|
415
|
-
"data-reference":
|
|
416
|
-
"data-emphasis":
|
|
417
|
-
"data-rule": !
|
|
418
|
-
"data-mark":
|
|
419
|
-
onPointerEnter: () =>
|
|
420
|
-
onPointerLeave: () =>
|
|
421
|
-
onFocus: () =>
|
|
422
|
-
onBlur: () =>
|
|
423
|
-
onClick:
|
|
424
|
-
var
|
|
425
|
-
(
|
|
410
|
+
className: m.line,
|
|
411
|
+
style: { "--depth": h.depth },
|
|
412
|
+
"data-inner": h.depth > 0 ? "" : void 0,
|
|
413
|
+
"data-kind": he,
|
|
414
|
+
"data-foldable": B ? "" : void 0,
|
|
415
|
+
"data-reference": d ? "" : void 0,
|
|
416
|
+
"data-emphasis": d ? void 0 : f.emphasis,
|
|
417
|
+
"data-rule": !d && f.rule ? "" : void 0,
|
|
418
|
+
"data-mark": C(a, h.parent),
|
|
419
|
+
onPointerEnter: () => u(a),
|
|
420
|
+
onPointerLeave: () => u(null),
|
|
421
|
+
onFocus: () => u(a),
|
|
422
|
+
onBlur: () => u(null),
|
|
423
|
+
onClick: B ? () => {
|
|
424
|
+
var q;
|
|
425
|
+
(q = window.getSelection()) != null && q.toString() || M(a);
|
|
426
426
|
} : void 0,
|
|
427
427
|
children: [
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
Z !== void 0 &&
|
|
428
|
+
/* @__PURE__ */ b(je, { children: [
|
|
429
|
+
o ? ft(f.label, I.map((q) => q.text), o, l, h.position) : E.sentence,
|
|
430
|
+
I.some((q) => q.own.approximate) && l.calculationApproximateNote,
|
|
431
|
+
Z !== void 0 && l.calculationWorstInside(ae(Z, l))
|
|
432
432
|
].filter(Boolean).join(". ") }),
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
|
|
433
|
+
/* @__PURE__ */ R("span", { className: m.labelCell, children: [
|
|
434
|
+
B ? /* @__PURE__ */ b(
|
|
435
435
|
"button",
|
|
436
436
|
{
|
|
437
437
|
type: "button",
|
|
438
|
-
className:
|
|
438
|
+
className: m.disclosure,
|
|
439
439
|
"aria-expanded": W,
|
|
440
|
-
"aria-controls":
|
|
441
|
-
"aria-label": (W ?
|
|
442
|
-
children: /* @__PURE__ */
|
|
440
|
+
"aria-controls": U,
|
|
441
|
+
"aria-label": (W ? l.calculationHideDerivation : l.calculationShowDerivation)(f.label),
|
|
442
|
+
children: /* @__PURE__ */ b(Be, { "data-open": W ? "" : void 0 })
|
|
443
443
|
}
|
|
444
|
-
) : /* @__PURE__ */
|
|
445
|
-
/* @__PURE__ */
|
|
444
|
+
) : /* @__PURE__ */ b("span", { className: m.disclosure, "aria-hidden": "true" }),
|
|
445
|
+
/* @__PURE__ */ b("span", { className: m.label, "aria-hidden": "true", children: f.label })
|
|
446
446
|
] }),
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
|
|
447
|
+
/* @__PURE__ */ b("span", { className: m.names, "aria-hidden": "true", children: j && !V && !W ? E.names : void 0 }),
|
|
448
|
+
/* @__PURE__ */ b("span", { className: m.operator, "aria-hidden": "true", children: qe }),
|
|
449
|
+
g(I, he !== void 0),
|
|
450
|
+
/* @__PURE__ */ R("span", { className: m.assessment, "aria-hidden": "true", children: [
|
|
451
|
+
o ? (
|
|
452
452
|
/* Short: which metric. The sentence carries the full reason. */
|
|
453
|
-
|
|
454
|
-
(
|
|
453
|
+
o.map(
|
|
454
|
+
(q, J) => I[J].own.absence && /* @__PURE__ */ b(le, { children: l.calculationMissing(q.unit ?? q.label) }, q.id)
|
|
455
455
|
)
|
|
456
|
-
) :
|
|
457
|
-
|
|
458
|
-
Z !== void 0 && /* @__PURE__ */
|
|
456
|
+
) : E.reason !== void 0 ? /* @__PURE__ */ b(le, { children: E.reason }) : P.verdict !== void 0 && /* @__PURE__ */ b(le, { tone: jt[P.verdict], children: ae(P.verdict, l) }),
|
|
457
|
+
E.target !== void 0 && /* @__PURE__ */ b("span", { className: m.target, children: E.target }),
|
|
458
|
+
Z !== void 0 && /* @__PURE__ */ b("span", { className: m.worst, "data-verdict": Z, children: l.calculationWorstInside(ae(Z, l)) })
|
|
459
459
|
] }),
|
|
460
|
-
|
|
460
|
+
me.length > 0 && /* A click here - on a link in the aside, on a sparkline - is the
|
|
461
461
|
caller's, not a fold. */
|
|
462
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ b("span", { className: m.notes, onClick: (q) => q.stopPropagation(), children: me })
|
|
463
463
|
]
|
|
464
464
|
}
|
|
465
465
|
);
|
|
466
|
-
return
|
|
467
|
-
...
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
-
|
|
471
|
-
] },
|
|
466
|
+
return V ? [
|
|
467
|
+
...te,
|
|
468
|
+
/* @__PURE__ */ R("li", { className: m.item, children: [
|
|
469
|
+
/* @__PURE__ */ b("ul", { className: m.list, children: pe }),
|
|
470
|
+
ve
|
|
471
|
+
] }, T)
|
|
472
472
|
] : [
|
|
473
|
-
...
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
/* @__PURE__ */
|
|
473
|
+
...te,
|
|
474
|
+
/* @__PURE__ */ R("li", { className: m.item, "data-open": W ? "" : void 0, style: { "--depth": h.depth }, children: [
|
|
475
|
+
ve,
|
|
476
|
+
B && /* @__PURE__ */ R("ul", { id: U, className: m.derivation, hidden: !W, children: [
|
|
477
|
+
Ce,
|
|
478
|
+
pe,
|
|
479
|
+
/* @__PURE__ */ b("li", { className: m.item, "aria-hidden": "true", children: /* @__PURE__ */ R(
|
|
480
480
|
"div",
|
|
481
481
|
{
|
|
482
|
-
className:
|
|
483
|
-
style: { "--depth":
|
|
482
|
+
className: m.line,
|
|
483
|
+
style: { "--depth": G.depth },
|
|
484
484
|
"data-inner": "",
|
|
485
485
|
"data-closing": "",
|
|
486
|
-
"data-mark":
|
|
486
|
+
"data-mark": r === a ? "use" : void 0,
|
|
487
487
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ R("span", { className: m.labelCell, children: [
|
|
489
|
+
/* @__PURE__ */ b("span", { className: m.disclosure }),
|
|
490
|
+
/* @__PURE__ */ R("span", { className: m.label, children: [
|
|
491
491
|
"= ",
|
|
492
|
-
|
|
492
|
+
f.label
|
|
493
493
|
] })
|
|
494
494
|
] }),
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
|
|
495
|
+
/* @__PURE__ */ b("span", { className: m.names }),
|
|
496
|
+
/* @__PURE__ */ b("span", { className: m.operator }),
|
|
497
|
+
g(I, !0)
|
|
498
498
|
]
|
|
499
499
|
}
|
|
500
500
|
) })
|
|
501
501
|
] })
|
|
502
|
-
] },
|
|
502
|
+
] }, T)
|
|
503
503
|
];
|
|
504
|
-
},
|
|
504
|
+
}, N = _(A.result, !1, { depth: 0, flat: !0, parent: null }, "r");
|
|
505
505
|
return (
|
|
506
506
|
/* The frame is the surface and the container the layout measures itself
|
|
507
507
|
against; the list inside it is the statement. */
|
|
508
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ b(
|
|
509
509
|
"div",
|
|
510
510
|
{
|
|
511
|
-
ref:
|
|
512
|
-
className:
|
|
513
|
-
style:
|
|
514
|
-
"--figure-tracks": Array(
|
|
515
|
-
"--figures-end": X(
|
|
516
|
-
"--assessment-column": X(
|
|
511
|
+
ref: $,
|
|
512
|
+
className: Bt(m.frame, e),
|
|
513
|
+
style: o ? {
|
|
514
|
+
"--figure-tracks": Array(v * 2).fill("auto").join(" "),
|
|
515
|
+
"--figures-end": X(v),
|
|
516
|
+
"--assessment-column": X(v),
|
|
517
517
|
...p
|
|
518
518
|
} : p,
|
|
519
|
-
"data-still":
|
|
520
|
-
"data-metrics":
|
|
521
|
-
"data-two-lines":
|
|
522
|
-
|
|
523
|
-
|
|
519
|
+
"data-still": D ? void 0 : "",
|
|
520
|
+
"data-metrics": o ? v : void 0,
|
|
521
|
+
"data-two-lines": s ? "" : void 0,
|
|
522
|
+
"data-compact": c ? "" : void 0,
|
|
523
|
+
children: /* @__PURE__ */ R("ul", { className: m.calculation, ...n, children: [
|
|
524
|
+
o && /* The head names each metric and its unit above its column. Every
|
|
524
525
|
row's sentence names them too, so the head is for the eye. */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ b("li", { className: m.item, "aria-hidden": "true", children: /* @__PURE__ */ b("div", { className: m.head, children: o.map((a, d) => /* @__PURE__ */ R(
|
|
526
527
|
"span",
|
|
527
528
|
{
|
|
528
|
-
className:
|
|
529
|
-
"data-unit":
|
|
530
|
-
style: { "--column": X(
|
|
529
|
+
className: m.headCell,
|
|
530
|
+
"data-unit": a.unit === void 0 ? void 0 : "",
|
|
531
|
+
style: { "--column": X(d) },
|
|
531
532
|
children: [
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
|
|
533
|
+
/* @__PURE__ */ b("span", { className: m.headLabel, children: a.label }),
|
|
534
|
+
a.unit !== void 0 && /* @__PURE__ */ b("span", { className: m.headUnit, children: a.unit })
|
|
534
535
|
]
|
|
535
536
|
},
|
|
536
|
-
|
|
537
|
+
a.id
|
|
537
538
|
)) }) }),
|
|
538
|
-
|
|
539
|
+
N
|
|
539
540
|
] })
|
|
540
541
|
}
|
|
541
542
|
)
|
|
542
543
|
);
|
|
543
544
|
}
|
|
544
545
|
export {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
546
|
+
Qt as Calculation,
|
|
547
|
+
Je as Chain,
|
|
548
|
+
He as Difference,
|
|
549
|
+
tt as DividedBy,
|
|
550
|
+
Ve as Given,
|
|
550
551
|
ce as Interim,
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
552
|
+
Xe as Minus,
|
|
553
|
+
Ze as Plus,
|
|
554
|
+
Ke as Product,
|
|
555
|
+
Ye as Quotient,
|
|
556
|
+
$e as Ref,
|
|
557
|
+
Ge as Sum,
|
|
558
|
+
et as Times
|
|
558
559
|
};
|