@peripheries/core 0.1.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/README.md +9 -0
- package/index.css +1 -0
- package/index.d.ts +1 -0
- package/index.js +2213 -0
- package/package.json +24 -0
- package/types/core/Box/Box.d.ts +7 -0
- package/types/core/Center/Center.d.ts +8 -0
- package/types/core/Container/Container.d.ts +8 -0
- package/types/core/Divider/Divider.d.ts +8 -0
- package/types/core/Hide/Hide.d.ts +7 -0
- package/types/core/Inline/Inline.d.ts +12 -0
- package/types/core/Show/Show.d.ts +7 -0
- package/types/core/Spacer/Spacer.d.ts +7 -0
- package/types/core/Stack/Stack.d.ts +10 -0
- package/types/core/_shared/formatters.d.ts +15 -0
- package/types/core/_shared/props.d.ts +8 -0
- package/types/core/_shared/warn-once.d.ts +2 -0
- package/types/core/display/DataTable/DataTable.d.ts +32 -0
- package/types/core/display/DisclaimerBlock/DisclaimerBlock.d.ts +9 -0
- package/types/core/display/Eyebrow/Eyebrow.d.ts +18 -0
- package/types/core/display/HighlightBox/HighlightBox.d.ts +13 -0
- package/types/core/display/KpiCardGrid/KpiCardGrid.d.ts +32 -0
- package/types/core/display/OptionCard/OptionCard.d.ts +29 -0
- package/types/core/display/ProfileCard/ProfileCard.d.ts +23 -0
- package/types/core/display/SectionHeader/SectionHeader.d.ts +11 -0
- package/types/core/display/Stat/Stat.d.ts +26 -0
- package/types/core/display/StatStrip/StatStrip.d.ts +16 -0
- package/types/core/display/_shared/Reveal.d.ts +13 -0
- package/types/core/display/_shared/ValueBadge.d.ts +8 -0
- package/types/core/display/_shared/tone.d.ts +4 -0
- package/types/core/document/AnswerRows/AnswerRows.d.ts +18 -0
- package/types/core/document/Aside/Aside.d.ts +13 -0
- package/types/core/document/ComparisonBars/ComparisonBars.d.ts +19 -0
- package/types/core/document/Contents/Contents.d.ts +19 -0
- package/types/core/document/Definition/Definition.d.ts +16 -0
- package/types/core/document/DocumentBlocks/DocumentBlocks.d.ts +17 -0
- package/types/core/document/DocumentLabel/DocumentLabel.d.ts +12 -0
- package/types/core/document/DocumentSection/DocumentSection.d.ts +28 -0
- package/types/core/document/DocumentShell/DocumentShell.d.ts +11 -0
- package/types/core/document/DocumentTable/DocumentTable.d.ts +17 -0
- package/types/core/document/ExecutionBlock/ExecutionBlock.d.ts +21 -0
- package/types/core/document/Figure/Figure.d.ts +11 -0
- package/types/core/document/Footnote/Footnote.d.ts +5 -0
- package/types/core/document/Masthead/Masthead.d.ts +12 -0
- package/types/core/document/Math/Math.d.ts +7 -0
- package/types/core/document/MetaRail/MetaRail.d.ts +14 -0
- package/types/core/document/NextSteps/NextSteps.d.ts +15 -0
- package/types/core/document/Notes/Notes.d.ts +12 -0
- package/types/core/document/PageBreak/PageBreak.d.ts +5 -0
- package/types/core/document/Prose/Prose.d.ts +11 -0
- package/types/core/document/Quote/Quote.d.ts +8 -0
- package/types/core/document/Reference/Reference.d.ts +18 -0
- package/types/core/document/RowList/RowList.d.ts +19 -0
- package/types/core/document/RunningFooter/RunningFooter.d.ts +12 -0
- package/types/core/document/SkippedSection/SkippedSection.d.ts +11 -0
- package/types/core/document/TalkItThrough/TalkItThrough.d.ts +18 -0
- package/types/core/document/WriteInField/WriteInField.d.ts +13 -0
- package/types/core/document/_shared/block-schemas.d.ts +3 -0
- package/types/core/document/_shared/blocks.d.ts +88 -0
- package/types/core/document/_shared/footnote-context.d.ts +19 -0
- package/types/core/document/_shared/host.d.ts +15 -0
- package/types/core/document/_shared/ordinal-format.d.ts +7 -0
- package/types/core/document/_shared/profile.d.ts +15 -0
- package/types/core/document/_shared/section-anchors.d.ts +1 -0
- package/types/core/document/profiles/builtin.d.ts +5 -0
- package/types/core/document/profiles/profile.d.ts +68 -0
- package/types/core/document/profiles/registry.d.ts +9 -0
- package/types/core/document/profiles/tokens.d.ts +3 -0
- package/types/index.core.d.ts +54 -0
package/index.js
ADDED
|
@@ -0,0 +1,2213 @@
|
|
|
1
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as r, isValidElement as i, useCallback as a, useContext as o, useEffect as s, useId as c, useMemo as l, useReducer as u, useRef as d, useState as f } from "react";
|
|
3
|
+
//#region src/core/_shared/props.ts
|
|
4
|
+
var p = /* @__PURE__ */ new Set([
|
|
5
|
+
"baseProps",
|
|
6
|
+
"data",
|
|
7
|
+
"status",
|
|
8
|
+
"actions",
|
|
9
|
+
"_traversal",
|
|
10
|
+
"isLoading",
|
|
11
|
+
"error",
|
|
12
|
+
"navigate",
|
|
13
|
+
"onNavigate",
|
|
14
|
+
"size",
|
|
15
|
+
"store"
|
|
16
|
+
]);
|
|
17
|
+
function m(e) {
|
|
18
|
+
let t = {};
|
|
19
|
+
for (let n in e) p.has(n) || (t[n] = e[n]);
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
var h = (...e) => e.filter(Boolean).join(" ") || void 0, g = (e) => e === void 0 ? void 0 : typeof e == "number" ? `${e}px` : e;
|
|
23
|
+
function _(e, t) {
|
|
24
|
+
let n = Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
25
|
+
return Object.keys(n).length || t ? {
|
|
26
|
+
...n,
|
|
27
|
+
...t
|
|
28
|
+
} : void 0;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/core/Box/Box.tsx
|
|
32
|
+
function v({ as: e, className: n, children: r, ...i }) {
|
|
33
|
+
return /* @__PURE__ */ t(e ?? "div", {
|
|
34
|
+
className: h("core-box", n),
|
|
35
|
+
...m(i),
|
|
36
|
+
children: r
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/core/Center/Center.tsx
|
|
41
|
+
function y({ minHeight: e, className: n, style: r, children: i, ...a }) {
|
|
42
|
+
return /* @__PURE__ */ t(v, {
|
|
43
|
+
...a,
|
|
44
|
+
className: h("core-center", n),
|
|
45
|
+
style: _({ "--core-center-min-height": g(e) }, r),
|
|
46
|
+
children: i
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/core/Container/Container.tsx
|
|
51
|
+
function b({ name: e, className: n, style: r, children: i, ...a }) {
|
|
52
|
+
return /* @__PURE__ */ t(v, {
|
|
53
|
+
...a,
|
|
54
|
+
className: h("core-container", n),
|
|
55
|
+
style: _({ "--core-container-name": e }, r),
|
|
56
|
+
children: i
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/core/Divider/Divider.tsx
|
|
61
|
+
function x({ orientation: e = "horizontal", weight: n = "subtle", spacing: r, className: i, style: a, ref: o, ...s }) {
|
|
62
|
+
let c = {
|
|
63
|
+
className: h("core-divider", i),
|
|
64
|
+
"data-weight": n,
|
|
65
|
+
"data-orientation": e,
|
|
66
|
+
style: _({ "--core-divider-spacing": g(r) }, a)
|
|
67
|
+
};
|
|
68
|
+
return e === "vertical" ? /* @__PURE__ */ t("span", {
|
|
69
|
+
role: "separator",
|
|
70
|
+
"aria-orientation": "vertical",
|
|
71
|
+
...c
|
|
72
|
+
}) : /* @__PURE__ */ t("hr", {
|
|
73
|
+
ref: o,
|
|
74
|
+
...m(s),
|
|
75
|
+
...c
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/core/Hide/Hide.tsx
|
|
80
|
+
function S({ when: e, children: n, as: r = "span" }) {
|
|
81
|
+
return /* @__PURE__ */ t(r, {
|
|
82
|
+
className: "core-hide",
|
|
83
|
+
"data-when": e,
|
|
84
|
+
children: n
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/core/Inline/Inline.tsx
|
|
89
|
+
function C({ gap: e, align: n = "center", justify: r = "start", wrap: i = !0, stackWhen: a, className: o, style: s, children: c, ...l }) {
|
|
90
|
+
return /* @__PURE__ */ t(v, {
|
|
91
|
+
...l,
|
|
92
|
+
className: h("core-inline", o),
|
|
93
|
+
"data-align": n,
|
|
94
|
+
"data-justify": r,
|
|
95
|
+
"data-wrap": i ? "true" : "false",
|
|
96
|
+
"data-stack-when": a,
|
|
97
|
+
style: _({ "--core-inline-gap": g(e) }, s),
|
|
98
|
+
children: c
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/core/Show/Show.tsx
|
|
103
|
+
function w({ when: e, children: n, as: r = "span" }) {
|
|
104
|
+
return /* @__PURE__ */ t(r, {
|
|
105
|
+
className: "core-show",
|
|
106
|
+
"data-when": e,
|
|
107
|
+
children: n
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/core/Spacer/Spacer.tsx
|
|
112
|
+
function T({ size: e, className: n, style: r }) {
|
|
113
|
+
return /* @__PURE__ */ t("span", {
|
|
114
|
+
"aria-hidden": !0,
|
|
115
|
+
className: h("core-spacer", n),
|
|
116
|
+
style: _({ "--core-spacer-size": g(e) }, r)
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/core/Stack/Stack.tsx
|
|
121
|
+
function ee({ gap: e, align: n = "stretch", justify: r = "start", className: i, style: a, children: o, ...s }) {
|
|
122
|
+
return /* @__PURE__ */ t(v, {
|
|
123
|
+
...s,
|
|
124
|
+
className: h("core-stack", i),
|
|
125
|
+
"data-align": n,
|
|
126
|
+
"data-justify": r,
|
|
127
|
+
style: _({ "--core-stack-gap": g(e) }, a),
|
|
128
|
+
children: o
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/core/_shared/warn-once.ts
|
|
133
|
+
var E = /* @__PURE__ */ new Set();
|
|
134
|
+
function D(e, t) {
|
|
135
|
+
E.has(e) || (E.add(e), typeof console < "u" && console.warn(t));
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/core/document/profiles/profile.ts
|
|
139
|
+
var O = [
|
|
140
|
+
"page-x-of-y",
|
|
141
|
+
"page-number",
|
|
142
|
+
"page-count"
|
|
143
|
+
], k = {
|
|
144
|
+
display: {
|
|
145
|
+
size: 46,
|
|
146
|
+
lineHeight: .98,
|
|
147
|
+
weight: 500,
|
|
148
|
+
tracking: "-0.032em"
|
|
149
|
+
},
|
|
150
|
+
heading: {
|
|
151
|
+
size: 28,
|
|
152
|
+
lineHeight: 1.05,
|
|
153
|
+
weight: 500,
|
|
154
|
+
tracking: "-0.03em"
|
|
155
|
+
},
|
|
156
|
+
subhead: {
|
|
157
|
+
size: 20,
|
|
158
|
+
lineHeight: 1.15,
|
|
159
|
+
weight: 500,
|
|
160
|
+
tracking: "-0.02em"
|
|
161
|
+
},
|
|
162
|
+
title: {
|
|
163
|
+
size: 17,
|
|
164
|
+
lineHeight: 1.3,
|
|
165
|
+
weight: 500,
|
|
166
|
+
tracking: "-0.018em"
|
|
167
|
+
},
|
|
168
|
+
body: {
|
|
169
|
+
size: 15,
|
|
170
|
+
lineHeight: 1.65,
|
|
171
|
+
weight: 400,
|
|
172
|
+
tracking: "-0.012em"
|
|
173
|
+
},
|
|
174
|
+
bodySmall: {
|
|
175
|
+
size: 13,
|
|
176
|
+
lineHeight: 1.65,
|
|
177
|
+
weight: 400,
|
|
178
|
+
tracking: "-0.012em"
|
|
179
|
+
},
|
|
180
|
+
label: {
|
|
181
|
+
size: 13,
|
|
182
|
+
lineHeight: 1.4,
|
|
183
|
+
weight: 500,
|
|
184
|
+
tracking: "-0.015em"
|
|
185
|
+
},
|
|
186
|
+
note: {
|
|
187
|
+
size: 12,
|
|
188
|
+
lineHeight: 1.7,
|
|
189
|
+
weight: 400,
|
|
190
|
+
tracking: "-0.012em"
|
|
191
|
+
},
|
|
192
|
+
eyebrow: {
|
|
193
|
+
size: 11,
|
|
194
|
+
lineHeight: 1,
|
|
195
|
+
weight: 600,
|
|
196
|
+
tracking: "0.14em",
|
|
197
|
+
uppercase: !0
|
|
198
|
+
}
|
|
199
|
+
}, A = {
|
|
200
|
+
full: "var(--color-text)",
|
|
201
|
+
muted: "var(--color-text-muted)",
|
|
202
|
+
subtle: "var(--color-text-subtle)",
|
|
203
|
+
border: "var(--color-border)",
|
|
204
|
+
accent: "var(--color-accent)",
|
|
205
|
+
accentText: "var(--color-link)",
|
|
206
|
+
sunken: "var(--color-surface-sunken)"
|
|
207
|
+
}, j = [
|
|
208
|
+
"cover",
|
|
209
|
+
"what-this-is",
|
|
210
|
+
"told-us",
|
|
211
|
+
"meaning",
|
|
212
|
+
"next-steps",
|
|
213
|
+
"talk-it-through",
|
|
214
|
+
"notes",
|
|
215
|
+
"footer"
|
|
216
|
+
], te = [
|
|
217
|
+
{
|
|
218
|
+
id: "workbook",
|
|
219
|
+
label: "Workbook",
|
|
220
|
+
sheet: {
|
|
221
|
+
width: "8.5in",
|
|
222
|
+
height: "11in"
|
|
223
|
+
},
|
|
224
|
+
margins: {
|
|
225
|
+
top: "0.60in",
|
|
226
|
+
right: "0.70in",
|
|
227
|
+
bottom: "0.55in",
|
|
228
|
+
left: "0.95in"
|
|
229
|
+
},
|
|
230
|
+
measure: "6.85in",
|
|
231
|
+
bodyMeasureCh: 64,
|
|
232
|
+
rail: { placement: "strip" },
|
|
233
|
+
ink: A,
|
|
234
|
+
rules: {
|
|
235
|
+
head: "2px",
|
|
236
|
+
structural: "1px",
|
|
237
|
+
row: "1px",
|
|
238
|
+
hairline: "1px"
|
|
239
|
+
},
|
|
240
|
+
type: k,
|
|
241
|
+
floorPx: 11,
|
|
242
|
+
depth: {
|
|
243
|
+
max: 1,
|
|
244
|
+
indent: ["0"],
|
|
245
|
+
numbering: "none"
|
|
246
|
+
},
|
|
247
|
+
fills: !0,
|
|
248
|
+
regions: { "page-footer": {
|
|
249
|
+
left: "member-ref",
|
|
250
|
+
centre: "document-id",
|
|
251
|
+
right: "page-x-of-y"
|
|
252
|
+
} },
|
|
253
|
+
sections: {
|
|
254
|
+
known: j,
|
|
255
|
+
required: ["next-steps", "talk-it-through"]
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: "report",
|
|
260
|
+
extends: "workbook",
|
|
261
|
+
label: "Report",
|
|
262
|
+
regions: { "page-footer": { right: "page-x-of-y" } },
|
|
263
|
+
requiredBindings: [],
|
|
264
|
+
sections: {
|
|
265
|
+
known: j,
|
|
266
|
+
required: ["next-steps", "talk-it-through"]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
id: "instrument",
|
|
271
|
+
extends: "workbook",
|
|
272
|
+
label: "Instrument",
|
|
273
|
+
sheet: {
|
|
274
|
+
width: "8.5in",
|
|
275
|
+
height: "11in"
|
|
276
|
+
},
|
|
277
|
+
margins: {
|
|
278
|
+
top: "1.00in",
|
|
279
|
+
right: "1.00in",
|
|
280
|
+
bottom: "1.00in",
|
|
281
|
+
left: "1.25in"
|
|
282
|
+
},
|
|
283
|
+
measure: "4.50in",
|
|
284
|
+
bodyMeasureCh: void 0,
|
|
285
|
+
rail: {
|
|
286
|
+
placement: "column",
|
|
287
|
+
axis: "4.75in",
|
|
288
|
+
width: "1.50in",
|
|
289
|
+
gutter: "0.25in"
|
|
290
|
+
},
|
|
291
|
+
ink: {
|
|
292
|
+
full: "#000000",
|
|
293
|
+
muted: "rgba(0,0,0,0.70)",
|
|
294
|
+
subtle: "rgba(0,0,0,0.45)",
|
|
295
|
+
border: "rgba(0,0,0,0.45)",
|
|
296
|
+
accent: "#000000",
|
|
297
|
+
accentText: "#000000",
|
|
298
|
+
sunken: "transparent"
|
|
299
|
+
},
|
|
300
|
+
rules: {
|
|
301
|
+
structural: "0.75pt",
|
|
302
|
+
hairline: "0.25pt"
|
|
303
|
+
},
|
|
304
|
+
type: {
|
|
305
|
+
...k,
|
|
306
|
+
eyebrow: {
|
|
307
|
+
...k.eyebrow,
|
|
308
|
+
tracking: "0.08em"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
depth: {
|
|
312
|
+
max: 3,
|
|
313
|
+
indent: [
|
|
314
|
+
"0",
|
|
315
|
+
"0.375in",
|
|
316
|
+
"0.75in"
|
|
317
|
+
],
|
|
318
|
+
numbering: "ladder"
|
|
319
|
+
},
|
|
320
|
+
fills: !1,
|
|
321
|
+
regions: { "page-footer": {
|
|
322
|
+
left: "execution-state",
|
|
323
|
+
right: "page-x-of-y"
|
|
324
|
+
} },
|
|
325
|
+
requiredBindings: ["execution-state"],
|
|
326
|
+
sections: { required: [] }
|
|
327
|
+
}
|
|
328
|
+
], M = /* @__PURE__ */ new Map();
|
|
329
|
+
function ne(e) {
|
|
330
|
+
M.set(e.id, e);
|
|
331
|
+
}
|
|
332
|
+
for (let e of te) ne(e);
|
|
333
|
+
function N() {
|
|
334
|
+
return [...M.keys()].sort();
|
|
335
|
+
}
|
|
336
|
+
function P(e) {
|
|
337
|
+
let t = M.get(e);
|
|
338
|
+
if (!t) throw Error(`[document-profile] unknown profile "${e}". Registered: ${N().join(", ")}`);
|
|
339
|
+
if (!t.extends) return t;
|
|
340
|
+
let n = M.get(t.extends);
|
|
341
|
+
if (!n) throw Error(`[document-profile] "${e}" extends unknown profile "${t.extends}"`);
|
|
342
|
+
if (n.extends) throw Error(`[document-profile] "${e}" extends "${n.id}", which extends "${n.extends}": inheritance is one level deep.`);
|
|
343
|
+
return {
|
|
344
|
+
...n,
|
|
345
|
+
...t,
|
|
346
|
+
id: t.id,
|
|
347
|
+
extends: t.extends
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function re() {
|
|
351
|
+
let e = {};
|
|
352
|
+
for (let t of N()) try {
|
|
353
|
+
e[t] = P(t);
|
|
354
|
+
} catch (e) {
|
|
355
|
+
console.warn(`[document-profile] skipping "${t}": ${e instanceof Error ? e.message : String(e)}`);
|
|
356
|
+
}
|
|
357
|
+
return e;
|
|
358
|
+
}
|
|
359
|
+
var ie = Object.freeze(re()), F = "workbook";
|
|
360
|
+
function ae(e, t) {
|
|
361
|
+
try {
|
|
362
|
+
return P(e);
|
|
363
|
+
} catch {
|
|
364
|
+
return D(`unknown-profile:${e}`, `[document-profile] unknown profile "${e}" (first seen in ${t}): rendering with fallback values.`), null;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function I(e, t) {
|
|
368
|
+
return e === void 0 ? (D("no-profile", `[document-profile] no profileId supplied (first seen in ${t}): falling back to "${F}". If this document is an instrument, its numbering and depth are being dropped.`), ae(F, t)) : ae(e, t);
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/core/document/profiles/tokens.ts
|
|
372
|
+
var oe = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), se = [
|
|
373
|
+
"full",
|
|
374
|
+
"muted",
|
|
375
|
+
"subtle",
|
|
376
|
+
"border",
|
|
377
|
+
"accent",
|
|
378
|
+
"accentText",
|
|
379
|
+
"sunken"
|
|
380
|
+
], ce = [
|
|
381
|
+
"structural",
|
|
382
|
+
"hairline",
|
|
383
|
+
"head",
|
|
384
|
+
"row"
|
|
385
|
+
], le = [
|
|
386
|
+
"display",
|
|
387
|
+
"heading",
|
|
388
|
+
"subhead",
|
|
389
|
+
"title",
|
|
390
|
+
"body",
|
|
391
|
+
"bodySmall",
|
|
392
|
+
"label",
|
|
393
|
+
"note",
|
|
394
|
+
"eyebrow"
|
|
395
|
+
], ue = 3, L = "initial";
|
|
396
|
+
function de(e) {
|
|
397
|
+
let t = {
|
|
398
|
+
"--doc-sheet-width": e.sheet.width,
|
|
399
|
+
"--doc-sheet-height": e.sheet.height,
|
|
400
|
+
"--doc-margin-top": e.margins.top,
|
|
401
|
+
"--doc-margin-right": e.margins.right,
|
|
402
|
+
"--doc-margin-bottom": e.margins.bottom,
|
|
403
|
+
"--doc-margin-left": e.margins.left,
|
|
404
|
+
"--doc-measure": e.measure,
|
|
405
|
+
"--doc-body-measure": e.bodyMeasureCh ? `${e.bodyMeasureCh}ch` : "none",
|
|
406
|
+
"--doc-rail-axis": e.rail.axis ?? L,
|
|
407
|
+
"--doc-rail-width": e.rail.width ?? L,
|
|
408
|
+
"--doc-rail-gutter": e.rail.gutter ?? L,
|
|
409
|
+
"--doc-floor": `${e.floorPx}px`
|
|
410
|
+
};
|
|
411
|
+
for (let n of se) t[`--doc-ink-${oe(n)}`] = e.ink[n];
|
|
412
|
+
for (let n of ce) t[`--doc-rule-${n}`] = e.rules[n] ?? L;
|
|
413
|
+
for (let n of le) {
|
|
414
|
+
let r = e.type[n], i = `--doc-type-${oe(n)}`;
|
|
415
|
+
t[`${i}-size`] = `${r.size}px`, t[`${i}-leading`] = String(r.lineHeight), t[`${i}-weight`] = String(r.weight), t[`${i}-tracking`] = r.tracking, t[`${i}-case`] = r.uppercase ? "uppercase" : "none";
|
|
416
|
+
}
|
|
417
|
+
for (let n = 1; n <= ue; n++) t[`--doc-indent-${n}`] = e.depth.indent[n - 1] ?? L;
|
|
418
|
+
return t;
|
|
419
|
+
}
|
|
420
|
+
var fe = (e, t) => `${e} {\n${Object.entries(t).map(([e, t]) => ` ${e}: ${t};`).join("\n")}\n}`;
|
|
421
|
+
function pe(e, t) {
|
|
422
|
+
return e.map((e) => fe(e.id === t ? `:root,\n[data-profile='${e.id}']` : `[data-profile='${e.id}']`, de(e))).join("\n\n");
|
|
423
|
+
}
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region src/core/document/_shared/blocks.ts
|
|
426
|
+
var me = [
|
|
427
|
+
"prose",
|
|
428
|
+
"clause",
|
|
429
|
+
"definitions",
|
|
430
|
+
"table",
|
|
431
|
+
"notice",
|
|
432
|
+
"figure",
|
|
433
|
+
"execution"
|
|
434
|
+
], he = /\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g, R = "[a-z0-9][a-z0-9_-]*", ge = RegExp(`^(?:(${R}):)?(${R}(?:\\.${R})*)(?:#(${R}))?$`);
|
|
435
|
+
RegExp(`^${R}$`);
|
|
436
|
+
function _e(e, t) {
|
|
437
|
+
let n = e.trim(), r = ge.exec(n);
|
|
438
|
+
return r ? {
|
|
439
|
+
key: n,
|
|
440
|
+
...r[1] ? { doc: r[1] } : {},
|
|
441
|
+
unit: r[2],
|
|
442
|
+
...r[3] ? { element: r[3] } : {},
|
|
443
|
+
...t ? { form: t } : {}
|
|
444
|
+
} : null;
|
|
445
|
+
}
|
|
446
|
+
function ve(e) {
|
|
447
|
+
let t = e.lastIndexOf(".");
|
|
448
|
+
return t < 0 ? e : e.slice(t + 1);
|
|
449
|
+
}
|
|
450
|
+
function ye(e) {
|
|
451
|
+
let t = [], n = 0;
|
|
452
|
+
for (let r of e.matchAll(new RegExp(he.source, "g"))) {
|
|
453
|
+
let i = _e(r[1], r[2]);
|
|
454
|
+
i && (r.index > n && t.push({
|
|
455
|
+
kind: "text",
|
|
456
|
+
text: e.slice(n, r.index)
|
|
457
|
+
}), t.push({
|
|
458
|
+
kind: "ref",
|
|
459
|
+
...i
|
|
460
|
+
}), n = r.index + r[0].length);
|
|
461
|
+
}
|
|
462
|
+
return n < e.length && t.push({
|
|
463
|
+
kind: "text",
|
|
464
|
+
text: e.slice(n)
|
|
465
|
+
}), t;
|
|
466
|
+
}
|
|
467
|
+
function be(e) {
|
|
468
|
+
return e.includes("{{ref:");
|
|
469
|
+
}
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region src/core/document/_shared/profile.ts
|
|
472
|
+
var z = (e) => e ? { "data-profile": e } : {}, xe = (e) => e?.fills === !1 ? { "data-fills": "none" } : {}, Se = {
|
|
473
|
+
note: "ⓘ",
|
|
474
|
+
tip: "💡",
|
|
475
|
+
warning: "⚠️",
|
|
476
|
+
important: "❗"
|
|
477
|
+
};
|
|
478
|
+
function Ce({ children: e, tone: r = "note", title: i, profileId: a, profile: o, className: s, style: c }) {
|
|
479
|
+
let l = o ?? I(a, "Aside"), u = l?.fills === !1;
|
|
480
|
+
return /* @__PURE__ */ n("aside", {
|
|
481
|
+
className: h("core-aside", s),
|
|
482
|
+
"data-tone": r,
|
|
483
|
+
...z(o?.id ?? a),
|
|
484
|
+
...xe(l),
|
|
485
|
+
style: c,
|
|
486
|
+
children: [u ? null : /* @__PURE__ */ t("span", {
|
|
487
|
+
className: "core-aside__icon",
|
|
488
|
+
"aria-hidden": !0,
|
|
489
|
+
children: Se[r]
|
|
490
|
+
}), /* @__PURE__ */ n("div", {
|
|
491
|
+
className: "core-aside__body",
|
|
492
|
+
children: [i && /* @__PURE__ */ t("div", {
|
|
493
|
+
className: "core-aside__title",
|
|
494
|
+
children: i
|
|
495
|
+
}), /* @__PURE__ */ t("div", {
|
|
496
|
+
className: "core-aside__text",
|
|
497
|
+
children: e
|
|
498
|
+
})]
|
|
499
|
+
})]
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/core/document/Prose/Prose.tsx
|
|
504
|
+
function we({ children: e, profileId: n, profile: r, full: i = !1, className: a, style: o }) {
|
|
505
|
+
return r || I(n, "Prose"), /* @__PURE__ */ t("div", {
|
|
506
|
+
className: h("core-prose", a),
|
|
507
|
+
"data-full": i ? "" : void 0,
|
|
508
|
+
...z(r?.id ?? n),
|
|
509
|
+
style: o,
|
|
510
|
+
children: e
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region src/core/document/Quote/Quote.tsx
|
|
515
|
+
function Te({ children: e, citation: r, className: i, style: a }) {
|
|
516
|
+
return /* @__PURE__ */ n("figure", {
|
|
517
|
+
className: h("core-quote", i),
|
|
518
|
+
style: a,
|
|
519
|
+
children: [/* @__PURE__ */ t("blockquote", {
|
|
520
|
+
className: "core-quote__body",
|
|
521
|
+
children: e
|
|
522
|
+
}), r && /* @__PURE__ */ n("figcaption", {
|
|
523
|
+
className: "core-quote__citation",
|
|
524
|
+
children: ["— ", r]
|
|
525
|
+
})]
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/core/document/Definition/Definition.tsx
|
|
530
|
+
function Ee({ term: e, description: r, pairs: i, profileId: a, profile: o, className: s, style: c }) {
|
|
531
|
+
o || I(a, "Definition");
|
|
532
|
+
let l = i ?? (e === void 0 ? [] : [{
|
|
533
|
+
term: e,
|
|
534
|
+
description: r
|
|
535
|
+
}]);
|
|
536
|
+
return /* @__PURE__ */ t("dl", {
|
|
537
|
+
className: h("core-definition", s),
|
|
538
|
+
...z(o?.id ?? a),
|
|
539
|
+
style: c,
|
|
540
|
+
children: l.map((e, r) => /* @__PURE__ */ n("div", {
|
|
541
|
+
className: "core-definition__item",
|
|
542
|
+
children: [/* @__PURE__ */ t("dt", {
|
|
543
|
+
className: "core-definition__term",
|
|
544
|
+
children: e.term
|
|
545
|
+
}), /* @__PURE__ */ t("dd", {
|
|
546
|
+
className: "core-definition__description",
|
|
547
|
+
children: e.description
|
|
548
|
+
})]
|
|
549
|
+
}, r))
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
//#endregion
|
|
553
|
+
//#region src/core/document/Math/Math.tsx
|
|
554
|
+
var B = "katex";
|
|
555
|
+
function De(e) {
|
|
556
|
+
if (typeof document > "u") return !1;
|
|
557
|
+
for (let t of document.querySelectorAll("script[type=\"importmap\"]")) try {
|
|
558
|
+
if (JSON.parse(t.textContent ?? "").imports?.[e]) return !0;
|
|
559
|
+
} catch {}
|
|
560
|
+
return !1;
|
|
561
|
+
}
|
|
562
|
+
var Oe = (e) => import(
|
|
563
|
+
/* @vite-ignore */
|
|
564
|
+
e
|
|
565
|
+
), V;
|
|
566
|
+
function ke() {
|
|
567
|
+
return V ??= De(B) ? Oe(B).then((e) => {
|
|
568
|
+
let t = e, n = t.default ?? t;
|
|
569
|
+
return typeof n.render == "function" ? n : null;
|
|
570
|
+
}, () => null) : Promise.resolve(null), V;
|
|
571
|
+
}
|
|
572
|
+
function Ae({ children: e = "", mode: n = "inline", className: r }) {
|
|
573
|
+
let i = d(null), [a, o] = f(null), [c, l] = f(null), u = `${n}:${e}`;
|
|
574
|
+
return s(() => {
|
|
575
|
+
let e = !0;
|
|
576
|
+
return ke().then((t) => {
|
|
577
|
+
e && t && o(() => t);
|
|
578
|
+
}), () => {
|
|
579
|
+
e = !1;
|
|
580
|
+
};
|
|
581
|
+
}, []), s(() => {
|
|
582
|
+
if (a && i.current && c !== u) try {
|
|
583
|
+
a.render(e, i.current, {
|
|
584
|
+
displayMode: n === "block",
|
|
585
|
+
throwOnError: !1
|
|
586
|
+
});
|
|
587
|
+
} catch {
|
|
588
|
+
l(u);
|
|
589
|
+
}
|
|
590
|
+
}, [
|
|
591
|
+
a,
|
|
592
|
+
e,
|
|
593
|
+
n,
|
|
594
|
+
u,
|
|
595
|
+
c
|
|
596
|
+
]), !a || c === u ? /* @__PURE__ */ t("span", {
|
|
597
|
+
className: h("core-math", r),
|
|
598
|
+
"data-mode": n,
|
|
599
|
+
"data-fallback": "",
|
|
600
|
+
title: "KaTeX not available — showing TeX source",
|
|
601
|
+
children: e
|
|
602
|
+
}) : /* @__PURE__ */ t("span", {
|
|
603
|
+
ref: i,
|
|
604
|
+
className: h("core-math", r),
|
|
605
|
+
"data-mode": n
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
//#endregion
|
|
609
|
+
//#region src/core/document/_shared/footnote-context.tsx
|
|
610
|
+
function je(e, t) {
|
|
611
|
+
switch (t.type) {
|
|
612
|
+
case "register": return e.footnotes.some((e) => e.id === t.entry.id) ? e : { footnotes: [...e.footnotes, t.entry] };
|
|
613
|
+
case "unregister": return { footnotes: e.footnotes.filter((e) => e.id !== t.id) };
|
|
614
|
+
default: return e;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
var H = r(null);
|
|
618
|
+
function Me() {
|
|
619
|
+
return o(H);
|
|
620
|
+
}
|
|
621
|
+
function Ne({ children: e }) {
|
|
622
|
+
let [n, r] = u(je, { footnotes: [] }), i = d(0), o = a((e) => {
|
|
623
|
+
i.current += 1;
|
|
624
|
+
let t = i.current;
|
|
625
|
+
return r({
|
|
626
|
+
type: "register",
|
|
627
|
+
entry: {
|
|
628
|
+
...e,
|
|
629
|
+
number: t
|
|
630
|
+
}
|
|
631
|
+
}), t;
|
|
632
|
+
}, []), s = a((e) => r({
|
|
633
|
+
type: "unregister",
|
|
634
|
+
id: e
|
|
635
|
+
}), []), c = l(() => ({
|
|
636
|
+
state: n,
|
|
637
|
+
registerFootnote: o,
|
|
638
|
+
unregisterFootnote: s
|
|
639
|
+
}), [
|
|
640
|
+
n,
|
|
641
|
+
o,
|
|
642
|
+
s
|
|
643
|
+
]);
|
|
644
|
+
return /* @__PURE__ */ t(H.Provider, {
|
|
645
|
+
value: c,
|
|
646
|
+
children: e
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
//#endregion
|
|
650
|
+
//#region src/core/document/Footnote/Footnote.tsx
|
|
651
|
+
function Pe({ children: e }) {
|
|
652
|
+
let r = c(), i = Me(), [a, o] = f(null);
|
|
653
|
+
return s(() => {
|
|
654
|
+
if (!i) return;
|
|
655
|
+
let t = i.registerFootnote({
|
|
656
|
+
id: r,
|
|
657
|
+
content: e
|
|
658
|
+
});
|
|
659
|
+
return o(t), () => i.unregisterFootnote(r);
|
|
660
|
+
}, [r]), i ? a === null ? null : /* @__PURE__ */ t("sup", {
|
|
661
|
+
id: `core-footnote-ref-${a}`,
|
|
662
|
+
className: "core-footnote",
|
|
663
|
+
children: /* @__PURE__ */ n("a", {
|
|
664
|
+
href: `#core-footnote-${a}`,
|
|
665
|
+
className: "core-footnote__link",
|
|
666
|
+
children: [
|
|
667
|
+
"[",
|
|
668
|
+
a,
|
|
669
|
+
"]"
|
|
670
|
+
]
|
|
671
|
+
})
|
|
672
|
+
}) : /* @__PURE__ */ n("span", {
|
|
673
|
+
className: "core-footnote",
|
|
674
|
+
"data-fallback": "",
|
|
675
|
+
children: [
|
|
676
|
+
" ",
|
|
677
|
+
"(",
|
|
678
|
+
e,
|
|
679
|
+
")"
|
|
680
|
+
]
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region src/core/document/Figure/Figure.tsx
|
|
685
|
+
function U({ children: e, caption: r, profileId: i, profile: a, className: o, style: s }) {
|
|
686
|
+
return a || I(i, "Figure"), /* @__PURE__ */ n("figure", {
|
|
687
|
+
className: h("core-figure", o),
|
|
688
|
+
...z(a?.id ?? i),
|
|
689
|
+
style: s,
|
|
690
|
+
children: [/* @__PURE__ */ t("div", {
|
|
691
|
+
className: "core-figure__body",
|
|
692
|
+
children: e
|
|
693
|
+
}), r && /* @__PURE__ */ t("figcaption", {
|
|
694
|
+
className: "core-figure__caption",
|
|
695
|
+
children: r
|
|
696
|
+
})]
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
//#endregion
|
|
700
|
+
//#region src/core/document/PageBreak/PageBreak.tsx
|
|
701
|
+
function Fe({ className: e }) {
|
|
702
|
+
return /* @__PURE__ */ t("div", {
|
|
703
|
+
className: h("core-page-break", e),
|
|
704
|
+
"aria-hidden": !0
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region src/core/document/DocumentLabel/DocumentLabel.tsx
|
|
709
|
+
function Ie({ children: e, as: n = "div", profileId: r, profile: i, tone: a = "subtle", className: o, style: s }) {
|
|
710
|
+
return i || I(r, "DocumentLabel"), /* @__PURE__ */ t(n, {
|
|
711
|
+
className: h("core-document-label", o),
|
|
712
|
+
"data-tone": a,
|
|
713
|
+
...z(i?.id ?? r),
|
|
714
|
+
style: s,
|
|
715
|
+
children: e
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region src/core/document/_shared/ordinal-format.ts
|
|
720
|
+
var Le = [
|
|
721
|
+
"one",
|
|
722
|
+
"two",
|
|
723
|
+
"three",
|
|
724
|
+
"four",
|
|
725
|
+
"five",
|
|
726
|
+
"six",
|
|
727
|
+
"seven",
|
|
728
|
+
"eight",
|
|
729
|
+
"nine",
|
|
730
|
+
"ten"
|
|
731
|
+
];
|
|
732
|
+
function Re(e) {
|
|
733
|
+
if (e.length !== 1) return null;
|
|
734
|
+
let t = e[0], n = Le[t - 1];
|
|
735
|
+
return n ? `Article ${n}` : `Article ${t}`;
|
|
736
|
+
}
|
|
737
|
+
function ze(e) {
|
|
738
|
+
return e.length === 0 ? null : e.length === 1 ? `Article ${e[0]}` : e.join(".");
|
|
739
|
+
}
|
|
740
|
+
function Be(e, t, n) {
|
|
741
|
+
let r = n === "ladder" && e !== void 0 && e.length > 0, i = [];
|
|
742
|
+
return t.map(({ level: t, marker: n }) => {
|
|
743
|
+
let a = Math.min(Number.isInteger(t) && t >= 1 ? t : 1, i.length + 1);
|
|
744
|
+
return i.length = a, i[a - 1] = (i[a - 1] ?? 0) + 1, n === void 0 ? r ? [...e, ...i].join(".") : void 0 : n;
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
//#endregion
|
|
748
|
+
//#region src/core/document/_shared/section-anchors.ts
|
|
749
|
+
function Ve(e, t) {
|
|
750
|
+
return e?.[t] ?? t;
|
|
751
|
+
}
|
|
752
|
+
//#endregion
|
|
753
|
+
//#region src/core/document/Reference/Reference.tsx
|
|
754
|
+
function He({ target: e, form: n, sectionReferences: r, sectionNumbers: i, sectionTitles: a, sectionAnchors: o, profileId: s, profile: c, className: l, style: u }) {
|
|
755
|
+
let d = c ?? I(s, "Reference"), f = _e(e), p = r?.[e], m = p?.openable === !1, g = f !== null && f.doc === void 0, _ = f ? ve(f.unit) : e, v = p?.number ?? (g && f.element === void 0 ? i?.[_] : void 0), y = p?.title ?? (g && f.element === void 0 ? a?.[_] : void 0), b = null;
|
|
756
|
+
if (f?.element !== void 0) {
|
|
757
|
+
let e = p?.element;
|
|
758
|
+
b = e ? Be(p.number, e.shape, d?.depth.numbering)[e.index] ?? null : null;
|
|
759
|
+
} else v && (b = ze(v));
|
|
760
|
+
let x = n === "full" || f?.doc !== void 0 && n !== "title", S;
|
|
761
|
+
S = m ? null : n === "title" ? y ?? b : x && b && y && f?.element === void 0 ? `${b} (${y})` : b ?? y ?? null;
|
|
762
|
+
let C = S !== null, w = C ? p ? p.href : `#${Ve(o, _)}` : void 0, T = {
|
|
763
|
+
className: h("core-reference", l),
|
|
764
|
+
"data-target": e,
|
|
765
|
+
"data-unresolved": C || m ? void 0 : "",
|
|
766
|
+
"data-closed": m ? "" : void 0,
|
|
767
|
+
...z(c?.id ?? s),
|
|
768
|
+
style: u
|
|
769
|
+
};
|
|
770
|
+
return w ? /* @__PURE__ */ t("a", {
|
|
771
|
+
href: w,
|
|
772
|
+
...T,
|
|
773
|
+
children: S
|
|
774
|
+
}) : /* @__PURE__ */ t("span", {
|
|
775
|
+
...T,
|
|
776
|
+
children: S ?? e
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
//#endregion
|
|
780
|
+
//#region src/core/document/DocumentTable/DocumentTable.tsx
|
|
781
|
+
function Ue({ columns: e, rows: r, caption: i, profileId: a, profile: o, className: s, style: c }) {
|
|
782
|
+
return o || I(a, "DocumentTable"), e.length === 0 ? null : /* @__PURE__ */ n("div", {
|
|
783
|
+
className: h("core-document-table", s),
|
|
784
|
+
...z(o?.id ?? a),
|
|
785
|
+
style: c,
|
|
786
|
+
children: [i === void 0 ? null : /* @__PURE__ */ t("div", {
|
|
787
|
+
className: "core-document-table__caption",
|
|
788
|
+
children: i
|
|
789
|
+
}), /* @__PURE__ */ n("table", {
|
|
790
|
+
className: "core-document-table__table",
|
|
791
|
+
children: [/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: e.map((e, n) => /* @__PURE__ */ t("th", {
|
|
792
|
+
scope: "col",
|
|
793
|
+
className: "core-document-table__head",
|
|
794
|
+
"data-align": e.align ?? "left",
|
|
795
|
+
children: e.header
|
|
796
|
+
}, n)) }) }), /* @__PURE__ */ t("tbody", { children: r.map((n, r) => /* @__PURE__ */ t("tr", { children: e.map((e, r) => /* @__PURE__ */ t("td", {
|
|
797
|
+
className: "core-document-table__cell",
|
|
798
|
+
"data-align": e.align ?? "left",
|
|
799
|
+
children: n[r] ?? null
|
|
800
|
+
}, r)) }, r)) })]
|
|
801
|
+
})]
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
//#endregion
|
|
805
|
+
//#region src/core/document/RowList/RowList.tsx
|
|
806
|
+
function W({ items: e, profileId: r, profile: i, markerWidth: a = 44, secondaryWidth: o = 190, missingLabel: s = "Not answered yet", className: c, style: l }) {
|
|
807
|
+
return i || I(r, "RowList"), e.length === 0 ? null : /* @__PURE__ */ t("div", {
|
|
808
|
+
className: h("core-row-list", c),
|
|
809
|
+
...z(i?.id ?? r),
|
|
810
|
+
style: _({
|
|
811
|
+
"--core-row-list-marker-width": g(a),
|
|
812
|
+
"--core-row-list-secondary-width": g(o)
|
|
813
|
+
}, l),
|
|
814
|
+
children: e.map((e, r) => /* @__PURE__ */ n("div", {
|
|
815
|
+
className: "core-row-list__row",
|
|
816
|
+
children: [
|
|
817
|
+
e.marker !== void 0 && /* @__PURE__ */ t("div", {
|
|
818
|
+
className: "core-row-list__marker",
|
|
819
|
+
children: e.marker
|
|
820
|
+
}),
|
|
821
|
+
/* @__PURE__ */ t("div", {
|
|
822
|
+
className: "core-row-list__primary",
|
|
823
|
+
children: e.primary
|
|
824
|
+
}),
|
|
825
|
+
(e.secondary !== void 0 || e.missing) && /* @__PURE__ */ t("div", {
|
|
826
|
+
className: "core-row-list__secondary",
|
|
827
|
+
"data-missing": e.missing ? "" : void 0,
|
|
828
|
+
children: e.missing ? s : e.secondary
|
|
829
|
+
})
|
|
830
|
+
]
|
|
831
|
+
}, r))
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
//#endregion
|
|
835
|
+
//#region src/core/document/AnswerRows/AnswerRows.tsx
|
|
836
|
+
var We = 190;
|
|
837
|
+
function Ge({ items: e, profileId: n, profile: r, missingLabel: i = "Not answered yet", answerWidth: a = 190, className: o, style: s }) {
|
|
838
|
+
let c = e.map((e) => {
|
|
839
|
+
let t = typeof e.answer == "string" && e.answer.trim().length > 0;
|
|
840
|
+
return {
|
|
841
|
+
marker: e.reference,
|
|
842
|
+
primary: e.question,
|
|
843
|
+
secondary: t ? e.answer : void 0,
|
|
844
|
+
missing: !t
|
|
845
|
+
};
|
|
846
|
+
});
|
|
847
|
+
return /* @__PURE__ */ t("div", {
|
|
848
|
+
className: h("core-answer-rows", o),
|
|
849
|
+
...z(r?.id ?? n),
|
|
850
|
+
style: s,
|
|
851
|
+
children: /* @__PURE__ */ t(W, {
|
|
852
|
+
items: c,
|
|
853
|
+
profileId: n,
|
|
854
|
+
profile: r,
|
|
855
|
+
secondaryWidth: a,
|
|
856
|
+
missingLabel: i
|
|
857
|
+
})
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
//#endregion
|
|
861
|
+
//#region src/core/_shared/formatters.ts
|
|
862
|
+
function G(e) {
|
|
863
|
+
if (e == null) return "";
|
|
864
|
+
if (typeof e == "string") return e;
|
|
865
|
+
let t = e.precision ?? (e.format === "number" ? Ke(e.value) : void 0), n = qe(e.format, e.value, {
|
|
866
|
+
precision: t,
|
|
867
|
+
signed: e.signed
|
|
868
|
+
});
|
|
869
|
+
return e.unit && n !== "—" ? `${n}\u00a0${e.unit}` : n;
|
|
870
|
+
}
|
|
871
|
+
function Ke(e) {
|
|
872
|
+
if (typeof e != "number" || !Number.isFinite(e)) return 0;
|
|
873
|
+
let t = String(Number(e.toFixed(3))), n = t.indexOf(".");
|
|
874
|
+
return n === -1 || t.includes("e") ? 0 : t.length - n - 1;
|
|
875
|
+
}
|
|
876
|
+
function qe(e, t, n = {}) {
|
|
877
|
+
if (!Number.isFinite(t)) return "—";
|
|
878
|
+
let r = n.signed === !0, i = t < 0, a = Math.abs(t), o = i ? "-" : r ? "+" : "";
|
|
879
|
+
switch (e) {
|
|
880
|
+
case "currency": {
|
|
881
|
+
let e = n.precision ?? 0;
|
|
882
|
+
return `${o}$${a.toLocaleString("en-CA", {
|
|
883
|
+
minimumFractionDigits: e,
|
|
884
|
+
maximumFractionDigits: e
|
|
885
|
+
})}`;
|
|
886
|
+
}
|
|
887
|
+
case "currency-k": {
|
|
888
|
+
let e = n.precision ?? 0;
|
|
889
|
+
return a >= 1e3 ? `${o}$${(a / 1e3).toFixed(e)}k` : `${o}$${a.toFixed(0)}`;
|
|
890
|
+
}
|
|
891
|
+
case "currency-m": {
|
|
892
|
+
let e = n.precision ?? 1;
|
|
893
|
+
return a >= 1e6 ? `${o}$${(a / 1e6).toFixed(e)}M` : a >= 1e3 ? `${o}$${(a / 1e3).toFixed(0)}k` : `${o}$${a.toFixed(0)}`;
|
|
894
|
+
}
|
|
895
|
+
case "currency-compact": {
|
|
896
|
+
if (a >= 1e9) {
|
|
897
|
+
let e = n.precision ?? 1;
|
|
898
|
+
return `${o}$${(a / 1e9).toFixed(e)}B`;
|
|
899
|
+
}
|
|
900
|
+
if (a >= 1e6) {
|
|
901
|
+
let e = n.precision ?? 1;
|
|
902
|
+
return `${o}$${(a / 1e6).toFixed(e)}M`;
|
|
903
|
+
}
|
|
904
|
+
if (a >= 1e3) {
|
|
905
|
+
let e = n.precision ?? 1;
|
|
906
|
+
return `${o}$${(a / 1e3).toFixed(e)}k`;
|
|
907
|
+
}
|
|
908
|
+
let e = n.precision ?? 0;
|
|
909
|
+
return `${o}$${a.toFixed(e)}`;
|
|
910
|
+
}
|
|
911
|
+
case "currency-monthly": {
|
|
912
|
+
let e = n.precision ?? 0;
|
|
913
|
+
return `${o}$${a.toLocaleString("en-CA", {
|
|
914
|
+
minimumFractionDigits: e,
|
|
915
|
+
maximumFractionDigits: e
|
|
916
|
+
})}/mo`;
|
|
917
|
+
}
|
|
918
|
+
case "percent": {
|
|
919
|
+
let e = n.precision ?? 1;
|
|
920
|
+
return `${o}${a.toFixed(e)}%`;
|
|
921
|
+
}
|
|
922
|
+
case "age": return `Age ${Math.round(t)}`;
|
|
923
|
+
case "years": {
|
|
924
|
+
let e = n.precision ?? 0;
|
|
925
|
+
return `${o}${a.toFixed(e)} yrs`;
|
|
926
|
+
}
|
|
927
|
+
case "number": {
|
|
928
|
+
let e = n.precision ?? 0;
|
|
929
|
+
return `${o}${a.toLocaleString("en-CA", {
|
|
930
|
+
minimumFractionDigits: e,
|
|
931
|
+
maximumFractionDigits: e
|
|
932
|
+
})}`;
|
|
933
|
+
}
|
|
934
|
+
default: {
|
|
935
|
+
let e = n.precision ?? 0;
|
|
936
|
+
return `${o}$${(a / 1e3).toFixed(e)}k`;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
//#endregion
|
|
941
|
+
//#region src/core/document/ComparisonBars/ComparisonBars.tsx
|
|
942
|
+
var Je = 40;
|
|
943
|
+
function Ye({ bars: e, target: r, targetLabel: i, max: a, profileId: o, profile: s, className: c, style: l }) {
|
|
944
|
+
let u = s ?? I(o, "ComparisonBars");
|
|
945
|
+
if (e.length === 0) return null;
|
|
946
|
+
let d = e.map((e) => e.value), f = a ?? Math.max(...d, r ?? 0);
|
|
947
|
+
if (!Number.isFinite(f) || f <= 0) return D("ComparisonBars:no-scale", "[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."), null;
|
|
948
|
+
let p = r !== void 0 && r > 0 && r <= f ? r / f * 100 : void 0;
|
|
949
|
+
return /* @__PURE__ */ n("figure", {
|
|
950
|
+
className: h("core-comparison-bars", c),
|
|
951
|
+
...z(s?.id ?? o),
|
|
952
|
+
...xe(u),
|
|
953
|
+
style: l,
|
|
954
|
+
children: [e.map((e) => {
|
|
955
|
+
let r = Math.max(0, Math.min(100, e.value / f * 100));
|
|
956
|
+
return /* @__PURE__ */ n("div", {
|
|
957
|
+
className: "core-comparison-bars__bar",
|
|
958
|
+
style: _({ "--core-comparison-bars-value": `${r}%` }),
|
|
959
|
+
children: [/* @__PURE__ */ t("div", {
|
|
960
|
+
className: "core-comparison-bars__label",
|
|
961
|
+
children: e.label
|
|
962
|
+
}), /* @__PURE__ */ n("div", {
|
|
963
|
+
className: "core-comparison-bars__track",
|
|
964
|
+
style: _({ "--core-comparison-bars-target": p === void 0 ? void 0 : `${p}%` }),
|
|
965
|
+
children: [
|
|
966
|
+
/* @__PURE__ */ t("div", { className: "core-comparison-bars__fill" }),
|
|
967
|
+
/* @__PURE__ */ t("span", {
|
|
968
|
+
className: "core-comparison-bars__value",
|
|
969
|
+
"data-placement": r > Je ? "inside" : "outside",
|
|
970
|
+
children: G(e.display)
|
|
971
|
+
}),
|
|
972
|
+
p !== void 0 && /* @__PURE__ */ t("div", {
|
|
973
|
+
className: "core-comparison-bars__target",
|
|
974
|
+
"aria-hidden": "true"
|
|
975
|
+
})
|
|
976
|
+
]
|
|
977
|
+
})]
|
|
978
|
+
}, e.label);
|
|
979
|
+
}), r !== void 0 && i && /* @__PURE__ */ t("figcaption", {
|
|
980
|
+
className: "core-comparison-bars__target-label",
|
|
981
|
+
children: i
|
|
982
|
+
})]
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region src/core/document/NextSteps/NextSteps.tsx
|
|
987
|
+
var Xe = 3, Ze = 5;
|
|
988
|
+
function Qe({ items: e, profileId: r, profile: i, checkboxes: a = !0, className: o, style: s }) {
|
|
989
|
+
return i || I(r, "NextSteps"), e.length === 0 ? null : ((e.length < Xe || e.length > Ze) && D(`NextSteps:count:${e.length}`, `[NextSteps] ${e.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`), /* @__PURE__ */ t("ol", {
|
|
990
|
+
className: h("core-next-steps", o),
|
|
991
|
+
...z(i?.id ?? r),
|
|
992
|
+
style: s,
|
|
993
|
+
children: e.map((e, r) => /* @__PURE__ */ n("li", {
|
|
994
|
+
className: "core-next-steps__step",
|
|
995
|
+
children: [
|
|
996
|
+
/* @__PURE__ */ t("span", {
|
|
997
|
+
className: "core-next-steps__marker",
|
|
998
|
+
children: e.marker ?? String(r + 1).padStart(2, "0")
|
|
999
|
+
}),
|
|
1000
|
+
a && /* @__PURE__ */ t("span", {
|
|
1001
|
+
className: "core-next-steps__box",
|
|
1002
|
+
"aria-hidden": "true"
|
|
1003
|
+
}),
|
|
1004
|
+
/* @__PURE__ */ t("span", {
|
|
1005
|
+
className: "core-next-steps__body",
|
|
1006
|
+
children: e.body
|
|
1007
|
+
})
|
|
1008
|
+
]
|
|
1009
|
+
}, r))
|
|
1010
|
+
}));
|
|
1011
|
+
}
|
|
1012
|
+
//#endregion
|
|
1013
|
+
//#region src/core/document/Notes/Notes.tsx
|
|
1014
|
+
var $e = 38;
|
|
1015
|
+
function et({ title: e = "Notes", lines: r = 4, profileId: i, profile: a, className: o, style: s }) {
|
|
1016
|
+
return a || I(i, "Notes"), r < 1 ? null : /* @__PURE__ */ n("section", {
|
|
1017
|
+
className: h("core-notes", o),
|
|
1018
|
+
...z(a?.id ?? i),
|
|
1019
|
+
style: s,
|
|
1020
|
+
children: [/* @__PURE__ */ t("div", {
|
|
1021
|
+
className: "core-notes__title",
|
|
1022
|
+
children: e
|
|
1023
|
+
}), /* @__PURE__ */ t("div", {
|
|
1024
|
+
className: "core-notes__lines",
|
|
1025
|
+
"aria-hidden": "true",
|
|
1026
|
+
children: Array.from({ length: r }, (e, n) => /* @__PURE__ */ t("div", { className: "core-notes__line" }, n))
|
|
1027
|
+
})]
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
//#endregion
|
|
1031
|
+
//#region src/core/document/SkippedSection/SkippedSection.tsx
|
|
1032
|
+
var tt = "You left this section open, so it is not covered here.";
|
|
1033
|
+
function nt({ wouldTell: e, openingLine: r = tt, profileId: i, profile: a, className: o, style: s }) {
|
|
1034
|
+
return a || I(i, "SkippedSection"), /* @__PURE__ */ n("div", {
|
|
1035
|
+
className: h("core-skipped-section", o),
|
|
1036
|
+
...z(a?.id ?? i),
|
|
1037
|
+
style: s,
|
|
1038
|
+
children: [
|
|
1039
|
+
/* @__PURE__ */ t("span", {
|
|
1040
|
+
className: "core-skipped-section__standard",
|
|
1041
|
+
children: r
|
|
1042
|
+
}),
|
|
1043
|
+
" ",
|
|
1044
|
+
/* @__PURE__ */ t("span", {
|
|
1045
|
+
className: "core-skipped-section__would-tell",
|
|
1046
|
+
children: e
|
|
1047
|
+
})
|
|
1048
|
+
]
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
//#endregion
|
|
1052
|
+
//#region src/core/document/TalkItThrough/TalkItThrough.tsx
|
|
1053
|
+
var rt = "Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";
|
|
1054
|
+
function it({ advisor: e, title: r = "Talk it through", invitation: i = rt, profileId: a, profile: o, className: s, style: c }) {
|
|
1055
|
+
if (o || I(a, "TalkItThrough"), !e?.name?.trim()) return D("TalkItThrough:no-advisor", "[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."), null;
|
|
1056
|
+
let l = [e.phone, e.email].filter((e) => typeof e == "string" && e.trim().length > 0);
|
|
1057
|
+
return l.length === 0 && D("TalkItThrough:no-contact", `[TalkItThrough] "${e.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`), /* @__PURE__ */ n("section", {
|
|
1058
|
+
className: h("core-talk-it-through", s),
|
|
1059
|
+
...z(o?.id ?? a),
|
|
1060
|
+
style: c,
|
|
1061
|
+
children: [
|
|
1062
|
+
/* @__PURE__ */ t("h3", {
|
|
1063
|
+
className: "core-talk-it-through__title",
|
|
1064
|
+
children: r
|
|
1065
|
+
}),
|
|
1066
|
+
/* @__PURE__ */ t("p", {
|
|
1067
|
+
className: "core-talk-it-through__invitation",
|
|
1068
|
+
children: i
|
|
1069
|
+
}),
|
|
1070
|
+
/* @__PURE__ */ n("div", {
|
|
1071
|
+
className: "core-talk-it-through__advisor",
|
|
1072
|
+
children: [
|
|
1073
|
+
/* @__PURE__ */ t("div", {
|
|
1074
|
+
className: "core-talk-it-through__name",
|
|
1075
|
+
children: e.name
|
|
1076
|
+
}),
|
|
1077
|
+
e.role && /* @__PURE__ */ t("div", {
|
|
1078
|
+
className: "core-talk-it-through__role",
|
|
1079
|
+
children: e.role
|
|
1080
|
+
}),
|
|
1081
|
+
l.length > 0 && /* @__PURE__ */ t("div", {
|
|
1082
|
+
className: "core-talk-it-through__contact",
|
|
1083
|
+
children: l.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
|
|
1084
|
+
})
|
|
1085
|
+
]
|
|
1086
|
+
})
|
|
1087
|
+
]
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
//#endregion
|
|
1091
|
+
//#region src/core/document/WriteInField/WriteInField.tsx
|
|
1092
|
+
var at = 38;
|
|
1093
|
+
function ot({ question: e, answer: r, lines: i = 1, profileId: a, profile: o, className: s, style: c }) {
|
|
1094
|
+
o || I(a, "WriteInField");
|
|
1095
|
+
let l = typeof r == "string" && r.trim().length > 0, u = Math.max(1, i);
|
|
1096
|
+
return /* @__PURE__ */ n("div", {
|
|
1097
|
+
className: h("core-write-in-field", s),
|
|
1098
|
+
"data-answered": l ? "" : void 0,
|
|
1099
|
+
...z(o?.id ?? a),
|
|
1100
|
+
style: c,
|
|
1101
|
+
children: [e && /* @__PURE__ */ t("div", {
|
|
1102
|
+
className: "core-write-in-field__question",
|
|
1103
|
+
children: e
|
|
1104
|
+
}), l ? /* @__PURE__ */ t("div", {
|
|
1105
|
+
className: "core-write-in-field__answer",
|
|
1106
|
+
children: r
|
|
1107
|
+
}) : Array.from({ length: u }, (e, n) => /* @__PURE__ */ t("div", {
|
|
1108
|
+
className: "core-write-in-field__line",
|
|
1109
|
+
"aria-hidden": "true"
|
|
1110
|
+
}, n))]
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
//#endregion
|
|
1114
|
+
//#region src/core/document/Masthead/Masthead.tsx
|
|
1115
|
+
function st({ mark: e, identity: r, codes: i, profileId: a, profile: o, className: s, style: c }) {
|
|
1116
|
+
return o || I(a, "Masthead"), e === void 0 && r === void 0 && i === void 0 ? null : /* @__PURE__ */ n("header", {
|
|
1117
|
+
className: h("core-masthead", s),
|
|
1118
|
+
"data-page-region": "page-header",
|
|
1119
|
+
...z(o?.id ?? a),
|
|
1120
|
+
style: c,
|
|
1121
|
+
children: [
|
|
1122
|
+
e !== void 0 && /* @__PURE__ */ t("div", {
|
|
1123
|
+
className: "core-masthead__mark",
|
|
1124
|
+
"data-slot": "mark",
|
|
1125
|
+
children: e
|
|
1126
|
+
}),
|
|
1127
|
+
r !== void 0 && /* @__PURE__ */ t("div", {
|
|
1128
|
+
className: "core-masthead__identity",
|
|
1129
|
+
"data-slot": "identity",
|
|
1130
|
+
children: r
|
|
1131
|
+
}),
|
|
1132
|
+
i !== void 0 && /* @__PURE__ */ t("div", {
|
|
1133
|
+
className: "core-masthead__codes",
|
|
1134
|
+
"data-slot": "codes",
|
|
1135
|
+
children: i
|
|
1136
|
+
})
|
|
1137
|
+
]
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
//#endregion
|
|
1141
|
+
//#region src/core/document/MetaRail/MetaRail.tsx
|
|
1142
|
+
var ct = 4;
|
|
1143
|
+
function lt({ fields: e, profileId: r, profile: i, className: a, style: o }) {
|
|
1144
|
+
let s = (i ?? I(r, "MetaRail"))?.rail.placement ?? "strip";
|
|
1145
|
+
return s === "none" || e.length === 0 ? null : (s !== "column" && e.length > ct && typeof console < "u" && console.warn(`[MetaRail] ${e.length} fields in a strip; the spec allows ${ct}. Rendering all of them — check the layout.`), /* @__PURE__ */ t("div", {
|
|
1146
|
+
className: h("core-meta-rail", a),
|
|
1147
|
+
"data-placement": s,
|
|
1148
|
+
...z(i?.id ?? r),
|
|
1149
|
+
style: o,
|
|
1150
|
+
children: e.map((e) => /* @__PURE__ */ n("div", {
|
|
1151
|
+
className: "core-meta-rail__field",
|
|
1152
|
+
children: [/* @__PURE__ */ t("div", {
|
|
1153
|
+
className: "core-meta-rail__label",
|
|
1154
|
+
children: e.label
|
|
1155
|
+
}), /* @__PURE__ */ t("div", {
|
|
1156
|
+
className: "core-meta-rail__value",
|
|
1157
|
+
children: e.value
|
|
1158
|
+
})]
|
|
1159
|
+
}, `${e.label}:${e.value}`))
|
|
1160
|
+
}));
|
|
1161
|
+
}
|
|
1162
|
+
//#endregion
|
|
1163
|
+
//#region src/core/document/RunningFooter/RunningFooter.tsx
|
|
1164
|
+
var ut = {
|
|
1165
|
+
left: "bottom-left",
|
|
1166
|
+
centre: "bottom-center",
|
|
1167
|
+
right: "bottom-right"
|
|
1168
|
+
};
|
|
1169
|
+
function dt({ left: e, centre: n, right: r, profileId: i, profile: a, className: o, style: s }) {
|
|
1170
|
+
a || I(i, "RunningFooter");
|
|
1171
|
+
let c = [
|
|
1172
|
+
["left", e],
|
|
1173
|
+
["centre", n],
|
|
1174
|
+
["right", r]
|
|
1175
|
+
].filter(([, e]) => e != null);
|
|
1176
|
+
return c.length === 0 ? null : /* @__PURE__ */ t("footer", {
|
|
1177
|
+
className: h("core-running-footer", o),
|
|
1178
|
+
"data-page-region": "page-footer",
|
|
1179
|
+
...z(a?.id ?? i),
|
|
1180
|
+
style: s,
|
|
1181
|
+
children: c.map(([e, n]) => /* @__PURE__ */ t("span", {
|
|
1182
|
+
className: "core-running-footer__slot",
|
|
1183
|
+
"data-region-slot": e,
|
|
1184
|
+
"data-margin-box": ut[e],
|
|
1185
|
+
children: n
|
|
1186
|
+
}, e))
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
//#endregion
|
|
1190
|
+
//#region src/core/document/DocumentShell/DocumentShell.tsx
|
|
1191
|
+
function ft({ children: r, rail: i, profileId: a, profile: o, className: s, style: c }) {
|
|
1192
|
+
let l = o ?? I(a, "DocumentShell"), u = l?.rail.placement === "column" && i !== void 0;
|
|
1193
|
+
return /* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ n("div", {
|
|
1194
|
+
className: h("core-document-shell", s),
|
|
1195
|
+
...z(l?.id ?? a),
|
|
1196
|
+
"data-has-rail": u ? "" : void 0,
|
|
1197
|
+
style: c,
|
|
1198
|
+
children: [/* @__PURE__ */ t("div", {
|
|
1199
|
+
className: "core-document-shell__body",
|
|
1200
|
+
children: r
|
|
1201
|
+
}), u && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
|
|
1202
|
+
className: "core-document-shell__gutter",
|
|
1203
|
+
"aria-hidden": !0
|
|
1204
|
+
}), /* @__PURE__ */ t("aside", {
|
|
1205
|
+
className: "core-document-shell__rail",
|
|
1206
|
+
children: i
|
|
1207
|
+
})] })]
|
|
1208
|
+
}) });
|
|
1209
|
+
}
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region src/core/document/Contents/Contents.tsx
|
|
1212
|
+
function pt(e, t) {
|
|
1213
|
+
return !e || e.length === 0 ? null : t === 0 ? String(e[0]).padStart(2, "0") : e.join(".");
|
|
1214
|
+
}
|
|
1215
|
+
function mt({ entries: e, depth: r, title: i, profileId: a, profile: o, className: s, style: c }) {
|
|
1216
|
+
let l = o ?? I(a, "Contents"), u = l?.depth.max ?? Infinity, d = r === void 0 ? e : e.filter((e) => e.level < r);
|
|
1217
|
+
if (d.length === 0) return null;
|
|
1218
|
+
let f = l?.depth.numbering ?? "none", p = d.some((e) => e.page !== void 0);
|
|
1219
|
+
return /* @__PURE__ */ n("nav", {
|
|
1220
|
+
"aria-label": "Table of contents",
|
|
1221
|
+
className: h("core-contents", s),
|
|
1222
|
+
...z(o?.id ?? a),
|
|
1223
|
+
style: c,
|
|
1224
|
+
children: [i && /* @__PURE__ */ t("div", {
|
|
1225
|
+
className: "core-contents__title",
|
|
1226
|
+
children: i
|
|
1227
|
+
}), /* @__PURE__ */ t("ol", {
|
|
1228
|
+
className: "core-contents__list",
|
|
1229
|
+
children: d.map((e) => {
|
|
1230
|
+
let r = f === "none" ? null : pt(e.ordinal, e.level);
|
|
1231
|
+
return /* @__PURE__ */ n("li", {
|
|
1232
|
+
className: "core-contents__entry",
|
|
1233
|
+
"data-level": e.level,
|
|
1234
|
+
"data-overdeep": e.level >= u ? "" : void 0,
|
|
1235
|
+
style: _({ "--core-contents-level": String(e.level) }),
|
|
1236
|
+
children: [
|
|
1237
|
+
r && /* @__PURE__ */ t("span", {
|
|
1238
|
+
className: "core-contents__ordinal",
|
|
1239
|
+
children: r
|
|
1240
|
+
}),
|
|
1241
|
+
/* @__PURE__ */ t("a", {
|
|
1242
|
+
href: `#${e.id}`,
|
|
1243
|
+
className: "core-contents__link",
|
|
1244
|
+
children: e.title
|
|
1245
|
+
}),
|
|
1246
|
+
p && /* @__PURE__ */ t("span", {
|
|
1247
|
+
className: "core-contents__page",
|
|
1248
|
+
children: e.page ?? ""
|
|
1249
|
+
})
|
|
1250
|
+
]
|
|
1251
|
+
}, e.id);
|
|
1252
|
+
})
|
|
1253
|
+
})]
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
//#endregion
|
|
1257
|
+
//#region src/core/document/ExecutionBlock/ExecutionBlock.tsx
|
|
1258
|
+
function ht({ s: e, dated: r }) {
|
|
1259
|
+
return /* @__PURE__ */ n("div", {
|
|
1260
|
+
className: "core-execution-block__signature",
|
|
1261
|
+
children: [/* @__PURE__ */ n("div", {
|
|
1262
|
+
className: "core-execution-block__lines",
|
|
1263
|
+
children: [/* @__PURE__ */ t("div", {
|
|
1264
|
+
className: "core-execution-block__line",
|
|
1265
|
+
"data-line": "sign"
|
|
1266
|
+
}), r ? /* @__PURE__ */ t("div", {
|
|
1267
|
+
className: "core-execution-block__line",
|
|
1268
|
+
"data-line": "date"
|
|
1269
|
+
}) : null]
|
|
1270
|
+
}), /* @__PURE__ */ n("div", {
|
|
1271
|
+
className: "core-execution-block__captions",
|
|
1272
|
+
children: [/* @__PURE__ */ n("div", {
|
|
1273
|
+
className: "core-execution-block__party",
|
|
1274
|
+
children: [
|
|
1275
|
+
e.role ? /* @__PURE__ */ t("div", {
|
|
1276
|
+
className: "core-execution-block__role",
|
|
1277
|
+
children: e.role
|
|
1278
|
+
}) : null,
|
|
1279
|
+
e.name ? /* @__PURE__ */ t("div", {
|
|
1280
|
+
className: "core-execution-block__name",
|
|
1281
|
+
children: e.name
|
|
1282
|
+
}) : null,
|
|
1283
|
+
e.detail ? /* @__PURE__ */ t("div", {
|
|
1284
|
+
className: "core-execution-block__detail",
|
|
1285
|
+
children: e.detail
|
|
1286
|
+
}) : null
|
|
1287
|
+
]
|
|
1288
|
+
}), r ? /* @__PURE__ */ t("div", {
|
|
1289
|
+
className: "core-execution-block__date-label",
|
|
1290
|
+
children: "Date"
|
|
1291
|
+
}) : null]
|
|
1292
|
+
})]
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
function gt({ attestation: e, label: r, signatories: i, columns: a = 1, note: o, profileId: s, profile: c, className: l, style: u }) {
|
|
1296
|
+
c || I(s, "ExecutionBlock");
|
|
1297
|
+
let d = Array.isArray(i) ? i : [];
|
|
1298
|
+
return /* @__PURE__ */ n("section", {
|
|
1299
|
+
className: h("core-execution-block", l),
|
|
1300
|
+
...z(c?.id ?? s),
|
|
1301
|
+
style: u,
|
|
1302
|
+
children: [
|
|
1303
|
+
r ? /* @__PURE__ */ t("div", {
|
|
1304
|
+
className: "core-execution-block__label",
|
|
1305
|
+
children: r
|
|
1306
|
+
}) : null,
|
|
1307
|
+
e ? /* @__PURE__ */ t("div", {
|
|
1308
|
+
className: "core-execution-block__attestation",
|
|
1309
|
+
children: e
|
|
1310
|
+
}) : null,
|
|
1311
|
+
/* @__PURE__ */ t("div", {
|
|
1312
|
+
className: "core-execution-block__signatories",
|
|
1313
|
+
"data-columns": a,
|
|
1314
|
+
children: d.map((e, n) => /* @__PURE__ */ t(ht, {
|
|
1315
|
+
s: e,
|
|
1316
|
+
dated: e.dated === !0
|
|
1317
|
+
}, n))
|
|
1318
|
+
}),
|
|
1319
|
+
o ? /* @__PURE__ */ t("div", {
|
|
1320
|
+
className: "core-execution-block__note",
|
|
1321
|
+
children: o
|
|
1322
|
+
}) : null
|
|
1323
|
+
]
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
//#endregion
|
|
1327
|
+
//#region src/core/document/DocumentBlocks/DocumentBlocks.tsx
|
|
1328
|
+
function _t({ kind: e }) {
|
|
1329
|
+
return /* @__PURE__ */ n("div", {
|
|
1330
|
+
className: "core-document-blocks__unrenderable",
|
|
1331
|
+
"data-unrenderable-block": e,
|
|
1332
|
+
role: "alert",
|
|
1333
|
+
children: [
|
|
1334
|
+
/* @__PURE__ */ t("strong", { children: "This provision could not be rendered." }),
|
|
1335
|
+
" The document contains a block of type “",
|
|
1336
|
+
e,
|
|
1337
|
+
"”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."
|
|
1338
|
+
]
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
function vt({ blocks: e, profileId: n, sectionNumbers: r, sectionAnchors: i, sectionTitles: a, sectionReferences: o, sectionOrdinal: s, className: c, style: l }) {
|
|
1342
|
+
let u = I(n, "DocumentBlocks");
|
|
1343
|
+
if (e.length === 0) return null;
|
|
1344
|
+
let d = Be(s, e.flatMap((e) => e.kind === "clause" ? e.items : []), u?.depth.numbering), f = 0, p = (e, s) => be(e) ? ye(e).map((e, c) => e.kind === "text" ? e.text : /* @__PURE__ */ t(He, {
|
|
1345
|
+
target: e.key,
|
|
1346
|
+
form: e.form,
|
|
1347
|
+
sectionReferences: o,
|
|
1348
|
+
sectionNumbers: r,
|
|
1349
|
+
sectionTitles: a,
|
|
1350
|
+
sectionAnchors: i,
|
|
1351
|
+
profileId: n
|
|
1352
|
+
}, `${s}-ref-${c}`)) : e, m = e.some((e) => e.kind === "execution");
|
|
1353
|
+
return /* @__PURE__ */ t("div", {
|
|
1354
|
+
className: h("core-document-blocks", c),
|
|
1355
|
+
"data-pinned": m ? "execution" : void 0,
|
|
1356
|
+
...z(n),
|
|
1357
|
+
style: l,
|
|
1358
|
+
children: e.map((e, r) => {
|
|
1359
|
+
let i = `${e.kind}-${r}`;
|
|
1360
|
+
switch (e.kind) {
|
|
1361
|
+
case "prose": return /* @__PURE__ */ t(we, {
|
|
1362
|
+
profileId: n,
|
|
1363
|
+
full: e.full,
|
|
1364
|
+
children: p(e.text, i)
|
|
1365
|
+
}, i);
|
|
1366
|
+
case "clause": return /* @__PURE__ */ t(W, {
|
|
1367
|
+
profileId: n,
|
|
1368
|
+
items: e.items.map((e, t) => ({
|
|
1369
|
+
marker: d[f++],
|
|
1370
|
+
primary: p(e.text, `${i}-${t}`),
|
|
1371
|
+
secondary: e.note ? p(e.note, `${i}-${t}-n`) : void 0,
|
|
1372
|
+
missing: e.missing
|
|
1373
|
+
}))
|
|
1374
|
+
}, i);
|
|
1375
|
+
case "definitions": return /* @__PURE__ */ t(Ee, {
|
|
1376
|
+
profileId: n,
|
|
1377
|
+
pairs: e.pairs.map((e, t) => ({
|
|
1378
|
+
term: e.term,
|
|
1379
|
+
description: p(e.description, `${i}-${t}`)
|
|
1380
|
+
}))
|
|
1381
|
+
}, i);
|
|
1382
|
+
case "table": return /* @__PURE__ */ t(Ue, {
|
|
1383
|
+
profileId: n,
|
|
1384
|
+
caption: e.caption ? p(e.caption, `${i}-cap`) : void 0,
|
|
1385
|
+
columns: e.columns,
|
|
1386
|
+
rows: e.rows.map((e, t) => e.map((e, n) => p(e, `${i}-${t}-${n}`)))
|
|
1387
|
+
}, i);
|
|
1388
|
+
case "notice": return /* @__PURE__ */ t(Ce, {
|
|
1389
|
+
profileId: n,
|
|
1390
|
+
tone: e.tone,
|
|
1391
|
+
title: e.title,
|
|
1392
|
+
children: p(e.text, i)
|
|
1393
|
+
}, i);
|
|
1394
|
+
case "figure": return /* @__PURE__ */ t(U, {
|
|
1395
|
+
profileId: n,
|
|
1396
|
+
caption: p(e.caption, i),
|
|
1397
|
+
children: e.placeholder ?? null
|
|
1398
|
+
}, i);
|
|
1399
|
+
case "execution": return /* @__PURE__ */ t(gt, {
|
|
1400
|
+
profileId: n,
|
|
1401
|
+
label: e.label,
|
|
1402
|
+
attestation: e.attestation,
|
|
1403
|
+
signatories: e.signatories,
|
|
1404
|
+
columns: e.columns,
|
|
1405
|
+
note: e.note
|
|
1406
|
+
}, i);
|
|
1407
|
+
default: return /* @__PURE__ */ t(_t, { kind: String(e.kind) }, i);
|
|
1408
|
+
}
|
|
1409
|
+
})
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
//#endregion
|
|
1413
|
+
//#region src/core/document/DocumentSection/DocumentSection.tsx
|
|
1414
|
+
var yt = [
|
|
1415
|
+
"h2",
|
|
1416
|
+
"h3",
|
|
1417
|
+
"h4",
|
|
1418
|
+
"h5",
|
|
1419
|
+
"h6"
|
|
1420
|
+
];
|
|
1421
|
+
function bt({ sectionId: e, title: r, level: i = 0, ordinal: a, sectionNumbers: o, sectionAnchors: s, sectionTitles: c, sectionReferences: l, sectionLevels: u, continued: d = !1, continuedCount: f, children: p, blocks: m, profileId: g, profile: v, className: y, style: b }) {
|
|
1422
|
+
let x = v ?? I(g, "DocumentSection"), S = o?.[e], C = u?.[e], w = S ?? a, T = C === void 0 ? i : Math.max(0, C - 1), ee = T >= (x?.depth.max ?? Infinity), E = Math.min(T, (x?.depth.indent.length ?? 1) - 1) + 1, D = x?.depth.numbering === "ladder" && w !== void 0 && w.length > 0, O = D ? Re(w) : null, k = yt[Math.min(T, yt.length - 1)], A = Ve(s, e), j = `${A}-doc-heading`;
|
|
1423
|
+
return /* @__PURE__ */ n("section", {
|
|
1424
|
+
id: A,
|
|
1425
|
+
className: h("core-document-section", y),
|
|
1426
|
+
"data-level": T,
|
|
1427
|
+
"data-ordinal-source": w ? S ? "derived" : "baked" : void 0,
|
|
1428
|
+
"data-overdeep": ee ? "" : void 0,
|
|
1429
|
+
"aria-labelledby": j,
|
|
1430
|
+
...z(v?.id ?? g),
|
|
1431
|
+
style: _({ "--core-document-section-indent": `var(--doc-indent-${E}, 0)` }, b),
|
|
1432
|
+
children: [
|
|
1433
|
+
O && /* @__PURE__ */ t("div", {
|
|
1434
|
+
className: "core-document-section__article",
|
|
1435
|
+
children: O
|
|
1436
|
+
}),
|
|
1437
|
+
/* @__PURE__ */ n(k, {
|
|
1438
|
+
id: j,
|
|
1439
|
+
className: "core-document-section__heading",
|
|
1440
|
+
children: [
|
|
1441
|
+
D && !O && /* @__PURE__ */ t("span", {
|
|
1442
|
+
className: "core-document-section__ordinal",
|
|
1443
|
+
children: w.join(".")
|
|
1444
|
+
}),
|
|
1445
|
+
r,
|
|
1446
|
+
d && /* @__PURE__ */ t("span", {
|
|
1447
|
+
className: "core-document-section__continued",
|
|
1448
|
+
children: "continued"
|
|
1449
|
+
})
|
|
1450
|
+
]
|
|
1451
|
+
}),
|
|
1452
|
+
d && f && /* @__PURE__ */ t("div", {
|
|
1453
|
+
className: "core-document-section__count",
|
|
1454
|
+
children: `Items ${f.from} to ${f.to} of ${f.of}`
|
|
1455
|
+
}),
|
|
1456
|
+
/* @__PURE__ */ t("div", {
|
|
1457
|
+
className: "core-document-section__body",
|
|
1458
|
+
children: p ?? (m ? /* @__PURE__ */ t(vt, {
|
|
1459
|
+
blocks: m,
|
|
1460
|
+
profileId: g,
|
|
1461
|
+
sectionNumbers: o,
|
|
1462
|
+
sectionAnchors: s,
|
|
1463
|
+
sectionTitles: c,
|
|
1464
|
+
sectionReferences: l,
|
|
1465
|
+
sectionOrdinal: D ? w : void 0
|
|
1466
|
+
}) : null)
|
|
1467
|
+
})
|
|
1468
|
+
]
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
var xt = {
|
|
1472
|
+
prose: {
|
|
1473
|
+
type: "object",
|
|
1474
|
+
required: ["kind", "text"],
|
|
1475
|
+
additionalProperties: !1,
|
|
1476
|
+
properties: {
|
|
1477
|
+
kind: { const: "prose" },
|
|
1478
|
+
text: {
|
|
1479
|
+
type: "string",
|
|
1480
|
+
description: "ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."
|
|
1481
|
+
},
|
|
1482
|
+
full: {
|
|
1483
|
+
type: "boolean",
|
|
1484
|
+
description: "Fill the measure rather than the reading-width cap. For a caption or text beside a table."
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
},
|
|
1488
|
+
clause: {
|
|
1489
|
+
type: "object",
|
|
1490
|
+
required: ["kind", "items"],
|
|
1491
|
+
additionalProperties: !1,
|
|
1492
|
+
properties: {
|
|
1493
|
+
kind: { const: "clause" },
|
|
1494
|
+
items: {
|
|
1495
|
+
type: "array",
|
|
1496
|
+
minItems: 1,
|
|
1497
|
+
items: {
|
|
1498
|
+
type: "object",
|
|
1499
|
+
required: ["text"],
|
|
1500
|
+
additionalProperties: !1,
|
|
1501
|
+
properties: {
|
|
1502
|
+
marker: {
|
|
1503
|
+
type: "string",
|
|
1504
|
+
description: "An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article (\"6.3\")."
|
|
1505
|
+
},
|
|
1506
|
+
level: {
|
|
1507
|
+
type: "integer",
|
|
1508
|
+
minimum: 1,
|
|
1509
|
+
description: "Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."
|
|
1510
|
+
},
|
|
1511
|
+
id: {
|
|
1512
|
+
type: "string",
|
|
1513
|
+
pattern: "^[a-z0-9][a-z0-9_-]*$",
|
|
1514
|
+
description: "A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."
|
|
1515
|
+
},
|
|
1516
|
+
text: { type: "string" },
|
|
1517
|
+
note: {
|
|
1518
|
+
type: "string",
|
|
1519
|
+
description: "A parenthetical, cross-reference or jurisdictional note set beside the text."
|
|
1520
|
+
},
|
|
1521
|
+
missing: {
|
|
1522
|
+
type: "boolean",
|
|
1523
|
+
description: "The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
definitions: {
|
|
1531
|
+
type: "object",
|
|
1532
|
+
required: ["kind", "pairs"],
|
|
1533
|
+
additionalProperties: !1,
|
|
1534
|
+
properties: {
|
|
1535
|
+
kind: { const: "definitions" },
|
|
1536
|
+
pairs: {
|
|
1537
|
+
type: "array",
|
|
1538
|
+
minItems: 1,
|
|
1539
|
+
items: {
|
|
1540
|
+
type: "object",
|
|
1541
|
+
required: ["term", "description"],
|
|
1542
|
+
additionalProperties: !1,
|
|
1543
|
+
properties: {
|
|
1544
|
+
term: { type: "string" },
|
|
1545
|
+
description: { type: "string" }
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
},
|
|
1551
|
+
table: {
|
|
1552
|
+
type: "object",
|
|
1553
|
+
required: [
|
|
1554
|
+
"kind",
|
|
1555
|
+
"columns",
|
|
1556
|
+
"rows"
|
|
1557
|
+
],
|
|
1558
|
+
additionalProperties: !1,
|
|
1559
|
+
properties: {
|
|
1560
|
+
kind: { const: "table" },
|
|
1561
|
+
caption: { type: "string" },
|
|
1562
|
+
columns: {
|
|
1563
|
+
type: "array",
|
|
1564
|
+
minItems: 1,
|
|
1565
|
+
items: {
|
|
1566
|
+
type: "object",
|
|
1567
|
+
required: ["header"],
|
|
1568
|
+
additionalProperties: !1,
|
|
1569
|
+
properties: {
|
|
1570
|
+
header: { type: "string" },
|
|
1571
|
+
align: {
|
|
1572
|
+
enum: [
|
|
1573
|
+
"left",
|
|
1574
|
+
"right",
|
|
1575
|
+
"center"
|
|
1576
|
+
],
|
|
1577
|
+
description: "Right-align money and any other figure column."
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
},
|
|
1582
|
+
rows: {
|
|
1583
|
+
type: "array",
|
|
1584
|
+
items: {
|
|
1585
|
+
type: "array",
|
|
1586
|
+
items: { type: "string" }
|
|
1587
|
+
},
|
|
1588
|
+
description: "One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
notice: {
|
|
1593
|
+
type: "object",
|
|
1594
|
+
required: [
|
|
1595
|
+
"kind",
|
|
1596
|
+
"tone",
|
|
1597
|
+
"text"
|
|
1598
|
+
],
|
|
1599
|
+
additionalProperties: !1,
|
|
1600
|
+
properties: {
|
|
1601
|
+
kind: { const: "notice" },
|
|
1602
|
+
tone: { enum: [
|
|
1603
|
+
"note",
|
|
1604
|
+
"warning",
|
|
1605
|
+
"important"
|
|
1606
|
+
] },
|
|
1607
|
+
title: { type: "string" },
|
|
1608
|
+
text: { type: "string" }
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
figure: {
|
|
1612
|
+
type: "object",
|
|
1613
|
+
required: ["kind", "caption"],
|
|
1614
|
+
additionalProperties: !1,
|
|
1615
|
+
properties: {
|
|
1616
|
+
kind: { const: "figure" },
|
|
1617
|
+
caption: {
|
|
1618
|
+
type: "string",
|
|
1619
|
+
description: "Required. An uncaptioned exhibit cannot be cited from the text that relies on it."
|
|
1620
|
+
},
|
|
1621
|
+
src: {
|
|
1622
|
+
type: "string",
|
|
1623
|
+
description: "Reference the host resolves. Never a data URI."
|
|
1624
|
+
},
|
|
1625
|
+
placeholder: {
|
|
1626
|
+
type: "string",
|
|
1627
|
+
description: "Text stand-in when src is absent, so a figure never renders empty."
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
},
|
|
1631
|
+
execution: {
|
|
1632
|
+
type: "object",
|
|
1633
|
+
required: ["kind", "signatories"],
|
|
1634
|
+
additionalProperties: !1,
|
|
1635
|
+
properties: {
|
|
1636
|
+
kind: { const: "execution" },
|
|
1637
|
+
label: { type: "string" },
|
|
1638
|
+
attestation: {
|
|
1639
|
+
type: "string",
|
|
1640
|
+
description: "The attestation clause, as running text."
|
|
1641
|
+
},
|
|
1642
|
+
signatories: {
|
|
1643
|
+
type: "array",
|
|
1644
|
+
minItems: 1,
|
|
1645
|
+
items: {
|
|
1646
|
+
type: "object",
|
|
1647
|
+
required: ["role"],
|
|
1648
|
+
additionalProperties: !1,
|
|
1649
|
+
properties: {
|
|
1650
|
+
role: {
|
|
1651
|
+
type: "string",
|
|
1652
|
+
description: "Capacity: \"Testator\", \"Witness\", \"Grantor\"."
|
|
1653
|
+
},
|
|
1654
|
+
name: {
|
|
1655
|
+
type: "string",
|
|
1656
|
+
description: "Printed BELOW the signing rule, never on it."
|
|
1657
|
+
},
|
|
1658
|
+
detail: { type: "string" },
|
|
1659
|
+
dated: {
|
|
1660
|
+
type: "boolean",
|
|
1661
|
+
description: "Add a second, shorter rule for the date."
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
},
|
|
1666
|
+
columns: { enum: [1, 2] },
|
|
1667
|
+
note: { type: "string" }
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
}, K = [
|
|
1671
|
+
"neutral",
|
|
1672
|
+
"strong",
|
|
1673
|
+
"accent",
|
|
1674
|
+
"info",
|
|
1675
|
+
"success",
|
|
1676
|
+
"warning",
|
|
1677
|
+
"danger"
|
|
1678
|
+
], St = {
|
|
1679
|
+
amber: "accent",
|
|
1680
|
+
blue: "info",
|
|
1681
|
+
green: "success",
|
|
1682
|
+
red: "danger",
|
|
1683
|
+
orange: "warning",
|
|
1684
|
+
dark: "strong",
|
|
1685
|
+
muted: "neutral",
|
|
1686
|
+
none: "neutral",
|
|
1687
|
+
default: "neutral",
|
|
1688
|
+
primary: "accent",
|
|
1689
|
+
secondary: "info"
|
|
1690
|
+
};
|
|
1691
|
+
function q(e, t = "neutral") {
|
|
1692
|
+
return typeof e == "string" ? K.includes(e) ? e : St[e] ?? t : t;
|
|
1693
|
+
}
|
|
1694
|
+
var Ct = (e) => typeof e == "string" && e in St, wt = [
|
|
1695
|
+
"subtle",
|
|
1696
|
+
"on-dark",
|
|
1697
|
+
"inherit"
|
|
1698
|
+
], Tt = {
|
|
1699
|
+
ink: "strong",
|
|
1700
|
+
faint: "subtle"
|
|
1701
|
+
};
|
|
1702
|
+
function J(e, t) {
|
|
1703
|
+
return typeof e == "string" ? wt.includes(e) ? e : e in Tt ? Tt[e] : K.includes(e) || Ct(e) ? q(e) : t : t;
|
|
1704
|
+
}
|
|
1705
|
+
function Et(e) {
|
|
1706
|
+
return {
|
|
1707
|
+
"data-tone": e,
|
|
1708
|
+
toned: !wt.includes(e)
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
function Y({ children: e, as: n = "span", tone: r, tabular: i = !1, className: a, style: o }) {
|
|
1712
|
+
let { toned: s, ...c } = Et(J(r, "subtle"));
|
|
1713
|
+
return /* @__PURE__ */ t(n, {
|
|
1714
|
+
className: h("core-eyebrow", s && "core-toned", a),
|
|
1715
|
+
...c,
|
|
1716
|
+
"data-tabular": i ? "true" : void 0,
|
|
1717
|
+
style: o,
|
|
1718
|
+
children: e
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
//#endregion
|
|
1722
|
+
//#region src/core/display/Stat/Stat.tsx
|
|
1723
|
+
var X = [
|
|
1724
|
+
"md",
|
|
1725
|
+
"lg",
|
|
1726
|
+
"xl"
|
|
1727
|
+
], Dt = 5;
|
|
1728
|
+
function Ot(e) {
|
|
1729
|
+
let t = X.indexOf(e);
|
|
1730
|
+
return t > 0 ? X[t - 1] : e;
|
|
1731
|
+
}
|
|
1732
|
+
var kt = (e) => typeof e == "object" && !!e && "format" in e && "value" in e;
|
|
1733
|
+
function At(e) {
|
|
1734
|
+
let t = Number(e);
|
|
1735
|
+
return Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0;
|
|
1736
|
+
}
|
|
1737
|
+
function jt({ value: e, label: r, size: i = "lg", tone: a, progress: o, progressLabel: s, autoStepDown: c = !0, className: l, style: u }) {
|
|
1738
|
+
let d = kt(e) ? G(e) : e, f = typeof d == "string" || typeof d == "number" ? String(d).length : 0, p = c && f > Dt ? Ot(i) : i, m = J(a, "strong"), { toned: g, ...v } = Et(m), y = o == null ? null : At(o);
|
|
1739
|
+
return /* @__PURE__ */ n("div", {
|
|
1740
|
+
className: h("core-stat", g && "core-toned", l),
|
|
1741
|
+
...v,
|
|
1742
|
+
"data-size": p,
|
|
1743
|
+
style: u,
|
|
1744
|
+
children: [
|
|
1745
|
+
/* @__PURE__ */ t("div", {
|
|
1746
|
+
className: "core-stat__value",
|
|
1747
|
+
children: d
|
|
1748
|
+
}),
|
|
1749
|
+
r != null && /* @__PURE__ */ t(Y, {
|
|
1750
|
+
className: "core-stat__label",
|
|
1751
|
+
tone: m === "on-dark" || m === "inherit" ? m : "subtle",
|
|
1752
|
+
children: r
|
|
1753
|
+
}),
|
|
1754
|
+
y !== null && /* @__PURE__ */ t("div", {
|
|
1755
|
+
className: "core-stat__progress",
|
|
1756
|
+
role: "progressbar",
|
|
1757
|
+
"aria-label": s ?? (typeof r == "string" ? r : "Progress"),
|
|
1758
|
+
"aria-valuemin": 0,
|
|
1759
|
+
"aria-valuemax": 100,
|
|
1760
|
+
"aria-valuenow": y,
|
|
1761
|
+
style: _({ "--core-stat-progress": `${y}%` }),
|
|
1762
|
+
children: /* @__PURE__ */ t("div", { className: "core-stat__progress-fill" })
|
|
1763
|
+
})
|
|
1764
|
+
]
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
function Mt({ children: e, minColumnWidth: n = 200, maxColumns: r = 4, gap: i = 32, className: a, style: o }) {
|
|
1768
|
+
return /* @__PURE__ */ t("div", {
|
|
1769
|
+
className: h("core-stat-group", a),
|
|
1770
|
+
style: _({
|
|
1771
|
+
"--core-stat-group-min": `${n}px`,
|
|
1772
|
+
"--core-stat-group-max": String(Math.max(1, r)),
|
|
1773
|
+
"--core-stat-group-gap": `${i}px`
|
|
1774
|
+
}, o),
|
|
1775
|
+
children: e
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
//#endregion
|
|
1779
|
+
//#region src/core/display/_shared/Reveal.tsx
|
|
1780
|
+
var Nt = {
|
|
1781
|
+
up: [0, 28],
|
|
1782
|
+
left: [-40, 0],
|
|
1783
|
+
right: [40, 0],
|
|
1784
|
+
none: [0, 0]
|
|
1785
|
+
};
|
|
1786
|
+
function Z({ direction: e = "up", delay: n = 0, duration: r = .5, threshold: i = .15, once: a = !0, className: o, style: c, children: l }) {
|
|
1787
|
+
let u = d(null), [p, m] = f(!1);
|
|
1788
|
+
s(() => {
|
|
1789
|
+
let e = u.current;
|
|
1790
|
+
if (!e) return;
|
|
1791
|
+
if (typeof IntersectionObserver > "u") {
|
|
1792
|
+
m(!0);
|
|
1793
|
+
return;
|
|
1794
|
+
}
|
|
1795
|
+
let t = new IntersectionObserver((e) => {
|
|
1796
|
+
let n = e[e.length - 1];
|
|
1797
|
+
n && (n.isIntersecting ? (m(!0), a && t.disconnect()) : a || m(!1));
|
|
1798
|
+
}, { threshold: Math.min(1, Math.max(0, i)) });
|
|
1799
|
+
return t.observe(e), () => t.disconnect();
|
|
1800
|
+
}, [a, i]);
|
|
1801
|
+
let [g, v] = Nt[e];
|
|
1802
|
+
return /* @__PURE__ */ t("div", {
|
|
1803
|
+
ref: u,
|
|
1804
|
+
className: h("core-reveal", o),
|
|
1805
|
+
"data-revealed": p ? "true" : "false",
|
|
1806
|
+
style: _({
|
|
1807
|
+
"--core-reveal-x": `${g}px`,
|
|
1808
|
+
"--core-reveal-y": `${v}px`,
|
|
1809
|
+
"--core-reveal-duration": `${r}s`,
|
|
1810
|
+
"--core-reveal-delay": `${n}s`
|
|
1811
|
+
}, c),
|
|
1812
|
+
children: l
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
//#endregion
|
|
1816
|
+
//#region src/core/display/SectionHeader/SectionHeader.tsx
|
|
1817
|
+
function Pt({ eyebrow: e, title: r, description: i, trailing: a, revealDelay: o = 0, className: s, style: c }) {
|
|
1818
|
+
return /* @__PURE__ */ t(Z, {
|
|
1819
|
+
direction: "up",
|
|
1820
|
+
delay: o,
|
|
1821
|
+
className: h("core-section-header", s),
|
|
1822
|
+
style: c,
|
|
1823
|
+
children: /* @__PURE__ */ n("div", {
|
|
1824
|
+
className: "core-section-header__inner",
|
|
1825
|
+
"data-described": i ? "true" : void 0,
|
|
1826
|
+
children: [/* @__PURE__ */ n("div", {
|
|
1827
|
+
className: "core-section-header__text",
|
|
1828
|
+
children: [
|
|
1829
|
+
e ? /* @__PURE__ */ t(Y, {
|
|
1830
|
+
className: "core-section-header__eyebrow",
|
|
1831
|
+
children: e
|
|
1832
|
+
}) : null,
|
|
1833
|
+
/* @__PURE__ */ t("h2", {
|
|
1834
|
+
className: "core-section-header__title",
|
|
1835
|
+
children: r
|
|
1836
|
+
}),
|
|
1837
|
+
i ? /* @__PURE__ */ t("p", {
|
|
1838
|
+
className: "core-section-header__description",
|
|
1839
|
+
children: i
|
|
1840
|
+
}) : null
|
|
1841
|
+
]
|
|
1842
|
+
}), a != null && a !== "" ? /* @__PURE__ */ t("div", {
|
|
1843
|
+
className: "core-section-header__trailing",
|
|
1844
|
+
children: a
|
|
1845
|
+
}) : null]
|
|
1846
|
+
})
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
//#endregion
|
|
1850
|
+
//#region src/core/display/HighlightBox/HighlightBox.tsx
|
|
1851
|
+
function Ft({ tone: e, variant: r, label: i, headline: a, children: o, trailing: s, className: c, style: l }) {
|
|
1852
|
+
let u = q(e ?? r, "accent"), d = s != null && s !== "";
|
|
1853
|
+
return /* @__PURE__ */ n("div", {
|
|
1854
|
+
className: h("core-highlight-box", "core-toned", c),
|
|
1855
|
+
"data-tone": u,
|
|
1856
|
+
style: l,
|
|
1857
|
+
children: [/* @__PURE__ */ n("div", {
|
|
1858
|
+
className: "core-highlight-box__text",
|
|
1859
|
+
children: [
|
|
1860
|
+
i ? /* @__PURE__ */ t("div", {
|
|
1861
|
+
className: "core-highlight-box__label",
|
|
1862
|
+
children: i
|
|
1863
|
+
}) : null,
|
|
1864
|
+
a ? /* @__PURE__ */ t("div", {
|
|
1865
|
+
className: "core-highlight-box__headline",
|
|
1866
|
+
children: a
|
|
1867
|
+
}) : null,
|
|
1868
|
+
o != null && o !== "" ? /* @__PURE__ */ t("div", {
|
|
1869
|
+
className: "core-highlight-box__body",
|
|
1870
|
+
children: o
|
|
1871
|
+
}) : null
|
|
1872
|
+
]
|
|
1873
|
+
}), d ? /* @__PURE__ */ t("div", {
|
|
1874
|
+
className: "core-highlight-box__trailing",
|
|
1875
|
+
children: s
|
|
1876
|
+
}) : null]
|
|
1877
|
+
});
|
|
1878
|
+
}
|
|
1879
|
+
//#endregion
|
|
1880
|
+
//#region src/core/display/DisclaimerBlock/DisclaimerBlock.tsx
|
|
1881
|
+
function It({ label: r, leadIn: i, children: a, className: o, style: s }) {
|
|
1882
|
+
let c = r ?? i;
|
|
1883
|
+
return /* @__PURE__ */ n("div", {
|
|
1884
|
+
className: h("core-disclaimer-block", o),
|
|
1885
|
+
style: s,
|
|
1886
|
+
children: [c ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", {
|
|
1887
|
+
className: "core-disclaimer-block__label",
|
|
1888
|
+
children: c
|
|
1889
|
+
}), " "] }) : null, a]
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
//#endregion
|
|
1893
|
+
//#region src/core/display/StatStrip/StatStrip.tsx
|
|
1894
|
+
function Lt(e) {
|
|
1895
|
+
let t = Number(e);
|
|
1896
|
+
return Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0;
|
|
1897
|
+
}
|
|
1898
|
+
function Rt({ label: e, value: r, fillPercent: i, subtitle: a, tone: o, accentColor: s, accent: c, caption: l, className: u, style: d }) {
|
|
1899
|
+
let f = o ?? s ?? c, p = a ?? l, m = Lt(i);
|
|
1900
|
+
return /* @__PURE__ */ n("div", {
|
|
1901
|
+
className: h("core-stat-strip", "core-toned", u),
|
|
1902
|
+
"data-tone": q(f, "info"),
|
|
1903
|
+
"data-fill": f === "none" ? "none" : void 0,
|
|
1904
|
+
style: _({ "--core-stat-strip-fill": `${m}%` }, d),
|
|
1905
|
+
children: [
|
|
1906
|
+
/* @__PURE__ */ n("div", {
|
|
1907
|
+
className: "core-stat-strip__row",
|
|
1908
|
+
children: [/* @__PURE__ */ t("span", {
|
|
1909
|
+
className: "core-stat-strip__label",
|
|
1910
|
+
children: e
|
|
1911
|
+
}), /* @__PURE__ */ t("span", {
|
|
1912
|
+
className: "core-stat-strip__value",
|
|
1913
|
+
children: G(r)
|
|
1914
|
+
})]
|
|
1915
|
+
}),
|
|
1916
|
+
/* @__PURE__ */ t("div", {
|
|
1917
|
+
className: "core-stat-strip__track",
|
|
1918
|
+
children: /* @__PURE__ */ t("div", { className: "core-stat-strip__fill" })
|
|
1919
|
+
}),
|
|
1920
|
+
p ? /* @__PURE__ */ t("div", {
|
|
1921
|
+
className: "core-stat-strip__subtitle",
|
|
1922
|
+
children: G(p)
|
|
1923
|
+
}) : null
|
|
1924
|
+
]
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
//#endregion
|
|
1928
|
+
//#region src/core/display/_shared/ValueBadge.tsx
|
|
1929
|
+
function Q({ text: e, tone: n, className: r }) {
|
|
1930
|
+
return /* @__PURE__ */ t("span", {
|
|
1931
|
+
className: h("core-value-badge", "core-toned", r),
|
|
1932
|
+
"data-tone": q(n),
|
|
1933
|
+
children: G(e)
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
//#endregion
|
|
1937
|
+
//#region src/core/display/OptionCard/OptionCard.tsx
|
|
1938
|
+
var zt = 8, Bt = {
|
|
1939
|
+
good: "success",
|
|
1940
|
+
warn: "warning",
|
|
1941
|
+
critical: "danger"
|
|
1942
|
+
};
|
|
1943
|
+
function Vt(e, t, n) {
|
|
1944
|
+
let r = { series: String(n % zt + 1) }, i = e ?? t;
|
|
1945
|
+
if (typeof i != "string" || i === "") return r;
|
|
1946
|
+
if (i === "muted") return { series: "muted" };
|
|
1947
|
+
let a = /^series-([1-9]\d*)$/.exec(i);
|
|
1948
|
+
if (a) return { series: String((Number(a[1]) - 1) % zt + 1) };
|
|
1949
|
+
let o = Bt[i];
|
|
1950
|
+
return o ? { tone: o } : K.includes(i) || Ct(i) ? { tone: q(i) } : (D("OptionCard:colour", `[OptionCard] bar fill "${i}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`), r);
|
|
1951
|
+
}
|
|
1952
|
+
function Ht(e) {
|
|
1953
|
+
return typeof e == "number" && Number.isFinite(e) ? {
|
|
1954
|
+
text: String(e).padStart(2, "0"),
|
|
1955
|
+
kind: "numeral"
|
|
1956
|
+
} : typeof e != "string" || e.trim() === "" ? null : /^\d+$/.test(e.trim()) ? {
|
|
1957
|
+
text: e.trim().padStart(2, "0"),
|
|
1958
|
+
kind: "numeral"
|
|
1959
|
+
} : {
|
|
1960
|
+
text: e,
|
|
1961
|
+
kind: "label"
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
function Ut(e) {
|
|
1965
|
+
let { number: r, description: i, bars: a, isSelected: o = !1, className: s, style: c } = e, l = e.title ?? e.name, u = e.badgeText ?? e.badge, d = e.badgeTone ?? e.badgeVariant, f = e.tone ?? e.accent, p = Array.isArray(a) ? a : [], m = Ht(r);
|
|
1966
|
+
return /* @__PURE__ */ n("div", {
|
|
1967
|
+
className: h("core-option-card", s),
|
|
1968
|
+
"data-selected": o ? "true" : void 0,
|
|
1969
|
+
"data-described": i ? "true" : void 0,
|
|
1970
|
+
style: c,
|
|
1971
|
+
children: [
|
|
1972
|
+
/* @__PURE__ */ n("div", {
|
|
1973
|
+
className: "core-option-card__head",
|
|
1974
|
+
children: [m ? /* @__PURE__ */ t("div", {
|
|
1975
|
+
className: "core-option-card__number",
|
|
1976
|
+
"data-kind": m.kind,
|
|
1977
|
+
children: m.text
|
|
1978
|
+
}) : /* @__PURE__ */ t("span", {}), u != null && u !== "" ? /* @__PURE__ */ t(Q, {
|
|
1979
|
+
text: u,
|
|
1980
|
+
tone: q(d)
|
|
1981
|
+
}) : null]
|
|
1982
|
+
}),
|
|
1983
|
+
l ? /* @__PURE__ */ t("div", {
|
|
1984
|
+
className: "core-option-card__title",
|
|
1985
|
+
children: l
|
|
1986
|
+
}) : null,
|
|
1987
|
+
i ? /* @__PURE__ */ t("p", {
|
|
1988
|
+
className: "core-option-card__description",
|
|
1989
|
+
children: i
|
|
1990
|
+
}) : null,
|
|
1991
|
+
p.map((e, r) => {
|
|
1992
|
+
let i = Vt(e.tone ?? e.color ?? e.accent, f, r), a = Math.min(100, Math.max(0, Number(e.fillPercent) || 0)), o = e.valueTone === void 0 || e.valueTone === "default" ? void 0 : q(e.valueTone);
|
|
1993
|
+
return /* @__PURE__ */ n("div", {
|
|
1994
|
+
className: "core-option-card__bar",
|
|
1995
|
+
children: [/* @__PURE__ */ n("div", {
|
|
1996
|
+
className: "core-option-card__bar-head",
|
|
1997
|
+
children: [/* @__PURE__ */ t("span", {
|
|
1998
|
+
className: "core-option-card__bar-label",
|
|
1999
|
+
children: e.label
|
|
2000
|
+
}), /* @__PURE__ */ t("span", {
|
|
2001
|
+
className: h("core-option-card__bar-value", o && "core-toned"),
|
|
2002
|
+
"data-tone": o,
|
|
2003
|
+
children: G(e.value)
|
|
2004
|
+
})]
|
|
2005
|
+
}), /* @__PURE__ */ t("div", {
|
|
2006
|
+
className: "core-option-card__track",
|
|
2007
|
+
children: /* @__PURE__ */ t("div", {
|
|
2008
|
+
className: h("core-option-card__fill", "tone" in i && "core-toned"),
|
|
2009
|
+
"data-tone": "tone" in i ? i.tone : void 0,
|
|
2010
|
+
"data-series": "series" in i ? i.series : void 0,
|
|
2011
|
+
style: _({ "--core-option-card-fill": `${a}%` })
|
|
2012
|
+
})
|
|
2013
|
+
})]
|
|
2014
|
+
}, r);
|
|
2015
|
+
})
|
|
2016
|
+
]
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
//#endregion
|
|
2020
|
+
//#region src/core/display/ProfileCard/ProfileCard.tsx
|
|
2021
|
+
function Wt(e) {
|
|
2022
|
+
let { title: r, subtitle: i, rows: a, className: o, style: s } = e, c = e.tone ?? e.headerAccent ?? "info", l = c === "none", u = Array.isArray(a) ? a : [];
|
|
2023
|
+
return /* @__PURE__ */ n("div", {
|
|
2024
|
+
className: h("core-profile-card", !l && "core-toned", o),
|
|
2025
|
+
"data-tone": l ? void 0 : q(c, "info"),
|
|
2026
|
+
"data-marker": l ? "none" : void 0,
|
|
2027
|
+
style: s,
|
|
2028
|
+
children: [/* @__PURE__ */ n("div", {
|
|
2029
|
+
className: "core-profile-card__head",
|
|
2030
|
+
children: [/* @__PURE__ */ t("div", {
|
|
2031
|
+
className: "core-profile-card__title",
|
|
2032
|
+
children: r
|
|
2033
|
+
}), i ? /* @__PURE__ */ t("div", {
|
|
2034
|
+
className: "core-profile-card__subtitle",
|
|
2035
|
+
children: i
|
|
2036
|
+
}) : null]
|
|
2037
|
+
}), u.map((e, r) => /* @__PURE__ */ n("div", {
|
|
2038
|
+
className: "core-profile-card__row",
|
|
2039
|
+
children: [/* @__PURE__ */ t("span", {
|
|
2040
|
+
className: "core-profile-card__label",
|
|
2041
|
+
children: e.label
|
|
2042
|
+
}), /* @__PURE__ */ n("div", {
|
|
2043
|
+
className: "core-profile-card__end",
|
|
2044
|
+
children: [/* @__PURE__ */ t("span", {
|
|
2045
|
+
className: "core-profile-card__value",
|
|
2046
|
+
children: G(e.value)
|
|
2047
|
+
}), e.badge ? /* @__PURE__ */ t(Q, {
|
|
2048
|
+
text: e.badge.text,
|
|
2049
|
+
tone: q(e.badge.tone ?? e.badge.variant)
|
|
2050
|
+
}) : null]
|
|
2051
|
+
})]
|
|
2052
|
+
}, r))]
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
//#endregion
|
|
2056
|
+
//#region src/core/display/KpiCardGrid/KpiCardGrid.tsx
|
|
2057
|
+
function Gt(e) {
|
|
2058
|
+
if (typeof e == "string") {
|
|
2059
|
+
let t = e.trim();
|
|
2060
|
+
return t.startsWith("+") ? "up" : t.startsWith("-") || t.startsWith("−") ? "down" : "flat";
|
|
2061
|
+
}
|
|
2062
|
+
return e && typeof e == "object" && typeof e.value == "number" ? e.value > 0 ? "up" : e.value < 0 ? "down" : "flat" : "flat";
|
|
2063
|
+
}
|
|
2064
|
+
var Kt = {
|
|
2065
|
+
up: "▲",
|
|
2066
|
+
down: "▼",
|
|
2067
|
+
flat: "—"
|
|
2068
|
+
}, qt = {
|
|
2069
|
+
up: "success",
|
|
2070
|
+
down: "danger",
|
|
2071
|
+
flat: void 0
|
|
2072
|
+
}, $ = (e) => e != null && e !== "";
|
|
2073
|
+
function Jt(e) {
|
|
2074
|
+
let { columns: r = 4, gap: i = "tight", minColumnWidth: a, className: o, style: s } = e, c = e.cards ?? e.items, l = Array.isArray(c) ? c : [], u = Math.max(1, Math.min(6, Math.round(Number(r)) || 4));
|
|
2075
|
+
return /* @__PURE__ */ t("div", {
|
|
2076
|
+
className: h("core-kpi-card-grid", o),
|
|
2077
|
+
"data-gap": i === "normal" ? "normal" : "tight",
|
|
2078
|
+
style: _({
|
|
2079
|
+
"--core-kpi-card-grid-columns": String(u),
|
|
2080
|
+
"--core-kpi-card-grid-min": typeof a == "number" && a > 0 ? `${a}px` : void 0
|
|
2081
|
+
}, s),
|
|
2082
|
+
children: l.map((e, r) => {
|
|
2083
|
+
let i = e.subtitle ?? e.caption, a = e.tone ?? e.borderColor, o = $(a) ? q(a) : void 0, s = e.badge ?? (e.tag ? {
|
|
2084
|
+
text: e.tag.label,
|
|
2085
|
+
tone: e.tag.tone
|
|
2086
|
+
} : void 0), c = $(e.delta) ? Gt(e.delta) : void 0, l = c ? qt[c] : void 0;
|
|
2087
|
+
return /* @__PURE__ */ t(Z, {
|
|
2088
|
+
direction: "up",
|
|
2089
|
+
delay: r * .06,
|
|
2090
|
+
className: "core-kpi-card-grid__item",
|
|
2091
|
+
children: /* @__PURE__ */ n("div", {
|
|
2092
|
+
className: h("core-kpi-card-grid__card", o && "core-toned"),
|
|
2093
|
+
"data-tone": o,
|
|
2094
|
+
children: [
|
|
2095
|
+
/* @__PURE__ */ n("div", {
|
|
2096
|
+
className: "core-kpi-card-grid__head",
|
|
2097
|
+
children: [/* @__PURE__ */ t("div", {
|
|
2098
|
+
className: "core-kpi-card-grid__label",
|
|
2099
|
+
children: e.label
|
|
2100
|
+
}), s && $(s.text) ? /* @__PURE__ */ t(Q, {
|
|
2101
|
+
text: s.text,
|
|
2102
|
+
tone: q(s.tone)
|
|
2103
|
+
}) : null]
|
|
2104
|
+
}),
|
|
2105
|
+
/* @__PURE__ */ t("div", {
|
|
2106
|
+
className: "core-kpi-card-grid__value",
|
|
2107
|
+
children: G(e.value)
|
|
2108
|
+
}),
|
|
2109
|
+
c ? /* @__PURE__ */ n("div", {
|
|
2110
|
+
className: h("core-kpi-card-grid__delta", l && "core-toned"),
|
|
2111
|
+
"data-tone": l,
|
|
2112
|
+
"data-direction": c,
|
|
2113
|
+
children: [
|
|
2114
|
+
/* @__PURE__ */ t("span", {
|
|
2115
|
+
"aria-hidden": "true",
|
|
2116
|
+
children: Kt[c]
|
|
2117
|
+
}),
|
|
2118
|
+
" ",
|
|
2119
|
+
G(e.delta)
|
|
2120
|
+
]
|
|
2121
|
+
}) : null,
|
|
2122
|
+
$(i) ? /* @__PURE__ */ t("div", {
|
|
2123
|
+
className: "core-kpi-card-grid__subtitle",
|
|
2124
|
+
children: G(i)
|
|
2125
|
+
}) : null
|
|
2126
|
+
]
|
|
2127
|
+
})
|
|
2128
|
+
}, r);
|
|
2129
|
+
})
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
var Yt = Jt, Xt = {
|
|
2133
|
+
pos: "success",
|
|
2134
|
+
positive: "success",
|
|
2135
|
+
neg: "danger",
|
|
2136
|
+
negative: "danger"
|
|
2137
|
+
};
|
|
2138
|
+
function Zt(e) {
|
|
2139
|
+
if (typeof e == "string" && e !== "" && e !== "default") return Xt[e] ?? q(e);
|
|
2140
|
+
}
|
|
2141
|
+
var Qt = (e) => !!(e && typeof e == "object" && "value" in e && "format" in e), $t = (e) => !!(e && typeof e == "object" && !Array.isArray(e) && !i(e) && "value" in e && !("format" in e));
|
|
2142
|
+
function en(e) {
|
|
2143
|
+
return $t(e) ? e : { value: e };
|
|
2144
|
+
}
|
|
2145
|
+
function tn(e) {
|
|
2146
|
+
return typeof e == "string" || Qt(e) ? G(e) : typeof e == "number" ? String(e) : i(e) ? e : null;
|
|
2147
|
+
}
|
|
2148
|
+
function nn({ title: e, subtitle: r, columns: i, rows: a, className: o, style: s }) {
|
|
2149
|
+
let l = `${c()}-title`, u = Array.isArray(i) ? i : [], d = Array.isArray(a) ? a : [], f = (e) => u[e]?.align ?? (e === 0 ? "left" : "right");
|
|
2150
|
+
return /* @__PURE__ */ t(Z, {
|
|
2151
|
+
direction: "up",
|
|
2152
|
+
children: /* @__PURE__ */ n("div", {
|
|
2153
|
+
className: h("core-data-table", o),
|
|
2154
|
+
style: s,
|
|
2155
|
+
children: [e || r ? /* @__PURE__ */ n("div", {
|
|
2156
|
+
className: "core-data-table__head",
|
|
2157
|
+
children: [e ? /* @__PURE__ */ t("div", {
|
|
2158
|
+
id: l,
|
|
2159
|
+
className: "core-data-table__title",
|
|
2160
|
+
children: e
|
|
2161
|
+
}) : null, r ? /* @__PURE__ */ t("div", {
|
|
2162
|
+
className: "core-data-table__subtitle",
|
|
2163
|
+
children: r
|
|
2164
|
+
}) : null]
|
|
2165
|
+
}) : null, /* @__PURE__ */ t("div", {
|
|
2166
|
+
className: "core-data-table__scroll",
|
|
2167
|
+
role: "region",
|
|
2168
|
+
"aria-label": e ? void 0 : "Data table, scrollable",
|
|
2169
|
+
"aria-labelledby": e ? l : void 0,
|
|
2170
|
+
tabIndex: 0,
|
|
2171
|
+
children: /* @__PURE__ */ n("table", {
|
|
2172
|
+
className: "core-data-table__table",
|
|
2173
|
+
children: [/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: u.map((e, r) => /* @__PURE__ */ n("th", {
|
|
2174
|
+
scope: "col",
|
|
2175
|
+
className: "core-data-table__col",
|
|
2176
|
+
"data-align": f(r),
|
|
2177
|
+
style: _({ "--core-data-table-min": typeof e.minWidth == "number" && e.minWidth > 0 ? `${e.minWidth}px` : void 0 }),
|
|
2178
|
+
children: [e.header ?? e.label, e.sublabel ? /* @__PURE__ */ t("span", {
|
|
2179
|
+
className: "core-data-table__sublabel",
|
|
2180
|
+
children: e.sublabel
|
|
2181
|
+
}) : null]
|
|
2182
|
+
}, r)) }) }), /* @__PURE__ */ t("tbody", { children: d.map((e, n) => {
|
|
2183
|
+
let r = e.highlighted ?? e.tone === "highlight", i = e.total ?? e.tone === "total", a = e.cells, o = Array.isArray(a) ? a : a && typeof a == "object" ? u.map((e) => a[e.key]) : [];
|
|
2184
|
+
return /* @__PURE__ */ t("tr", {
|
|
2185
|
+
className: "core-data-table__row",
|
|
2186
|
+
"data-highlighted": r ? "true" : void 0,
|
|
2187
|
+
"data-total": i ? "true" : void 0,
|
|
2188
|
+
children: o.map((e, n) => {
|
|
2189
|
+
let r = en(e), i = Zt(r.tone), a = {
|
|
2190
|
+
className: h("core-data-table__cell", i && "core-toned"),
|
|
2191
|
+
"data-align": f(n),
|
|
2192
|
+
"data-tone": i
|
|
2193
|
+
};
|
|
2194
|
+
return n === 0 ? /* @__PURE__ */ t("th", {
|
|
2195
|
+
scope: "row",
|
|
2196
|
+
...a,
|
|
2197
|
+
children: tn(r.value)
|
|
2198
|
+
}, n) : /* @__PURE__ */ t("td", {
|
|
2199
|
+
...a,
|
|
2200
|
+
children: tn(r.value)
|
|
2201
|
+
}, n);
|
|
2202
|
+
})
|
|
2203
|
+
}, n);
|
|
2204
|
+
}) })]
|
|
2205
|
+
})
|
|
2206
|
+
})]
|
|
2207
|
+
})
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
//#endregion
|
|
2211
|
+
export { We as ANSWER_COLUMN_PX, Ge as AnswerRows, Ce as Aside, me as BLOCK_KINDS, xt as BLOCK_SCHEMAS, v as Box, y as Center, Ye as ComparisonBars, b as Container, mt as Contents, F as DEFAULT_PROFILE_ID, nn as DataTable, Ee as Definition, It as DisclaimerBlock, x as Divider, vt as DocumentBlocks, Ie as DocumentLabel, bt as DocumentSection, ft as DocumentShell, Ue as DocumentTable, gt as ExecutionBlock, Y as Eyebrow, U as Figure, Pe as Footnote, S as Hide, Ft as HighlightBox, C as Inline, Jt as KpiCardGrid, Yt as KpiGrid, st as Masthead, Ae as Math, lt as MetaRail, Qe as NextSteps, et as Notes, Ut as OptionCard, O as PAGINATOR_BINDINGS, Fe as PageBreak, Wt as ProfileCard, we as Prose, Te as Quote, He as Reference, W as RowList, dt as RunningFooter, Pt as SectionHeader, w as Show, nt as SkippedSection, T as Spacer, ee as Stack, jt as Stat, Mt as StatGroup, Rt as StatStrip, K as TONES, it as TalkItThrough, at as WRITE_HEIGHT_PX, $e as WRITE_LINE_HEIGHT_PX, ot as WriteInField, h as cx, ie as documentProfiles, qe as formatValue, J as inkToneOf, g as length, pe as profileCss, N as profileIds, de as profileTokens, ne as registerProfile, G as renderFormatted, P as resolveProfile, re as resolvedProfiles, q as toneOf, _ as vars };
|
|
2212
|
+
|
|
2213
|
+
//# sourceMappingURL=index.js.map
|