@mechane-ai/elements 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/ai.js +4 -4
  2. package/dist/chart-frame-C0UBu4ku.js +213 -0
  3. package/dist/{chart-input-CN8PMrni.js → chart-input-Ccr2NJ6J.js} +2 -2
  4. package/dist/{categorical-values-DpnNvPkc.js → chart-theme-Bwr9YSP1.js} +56 -5
  5. package/dist/charts/cartesian.js +617 -623
  6. package/dist/charts/distribution.js +77 -76
  7. package/dist/charts/graph.js +29 -28
  8. package/dist/charts/hierarchy.js +32 -31
  9. package/dist/charts/matrix.js +48 -47
  10. package/dist/charts/timeline.js +2 -2
  11. package/dist/charts.js +3 -1
  12. package/dist/collections.js +314 -267
  13. package/dist/elements.css +14 -0
  14. package/dist/feedback.js +1 -1
  15. package/dist/forms/dates.js +86 -63
  16. package/dist/forms.js +2 -2
  17. package/dist/packages/charts/src/cartesian/bar-data.d.ts +1 -1
  18. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +1 -1
  19. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +1 -1
  20. package/dist/packages/charts/src/categorical-values.d.ts +1 -1
  21. package/dist/packages/charts/src/chart-series-marker.d.ts +7 -0
  22. package/dist/packages/charts/src/chart-theme.d.ts +1 -2
  23. package/dist/packages/charts/src/distribution/ecdf.d.ts +1 -1
  24. package/dist/packages/charts/src/distribution/histogram.d.ts +1 -1
  25. package/dist/packages/charts/src/distribution/interval-plot.d.ts +1 -1
  26. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +1 -1
  27. package/dist/packages/charts/src/graph/relation-graph.d.ts +1 -1
  28. package/dist/packages/charts/src/index.d.ts +4 -2
  29. package/dist/packages/collections/src/data-table.d.ts +6 -4
  30. package/dist/packages/feedback/src/progress.d.ts +8 -2
  31. package/dist/packages/forms/src/dates/civil.d.ts +6 -4
  32. package/dist/packages/forms/src/dates/index.d.ts +1 -0
  33. package/dist/packages/forms/src/index.d.ts +2 -0
  34. package/dist/packages/forms/src/select-control.d.ts +26 -0
  35. package/dist/packages/foundations/src/chart-tones.d.ts +2 -0
  36. package/dist/{src-BYKjPC-0.js → src-CoFxE4Cj.js} +282 -227
  37. package/dist/{src-BHllGfI8.js → src-DXdsMc_Z.js} +415 -307
  38. package/package.json +1 -1
  39. package/dist/chart-frame-BV0IPZtQ.js +0 -270
@@ -1,29 +1,29 @@
1
- import { d as e, u as t } from "../src-BHllGfI8.js";
2
- import { i as n, n as r, r as i, t as a } from "../categorical-values-DpnNvPkc.js";
3
- import { t as o } from "../accessibility-C-aIZ1Yx.js";
4
- import { a as s, n as c, o as l, r as u, s as d, t as f } from "../chart-frame-BV0IPZtQ.js";
5
- import { n as p, r as m, t as h } from "../chart-input-CN8PMrni.js";
6
- import { r as g } from "../tokens.stylex-CJbIDPB9.js";
7
- import { t as _ } from "../plot-width--OgdohB5.js";
8
- import { D as v } from "../src-C-Sx37kz.js";
9
- import { p as y } from "../src-BYKjPC-0.js";
10
- import * as b from "@stylexjs/stylex";
11
- import { useEffect as x, useId as S, useMemo as C, useRef as ee, useState as w } from "react";
12
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
13
- import { scaleBand as O, scaleLinear as k } from "@visx/scale";
14
- import { AreaClosed as te, Bar as A, LinePath as j } from "@visx/shape";
1
+ import { c as e, d as t, f as n } from "../src-DXdsMc_Z.js";
2
+ import { a as r, i, n as a, r as o, t as s } from "../chart-theme-Bwr9YSP1.js";
3
+ import { t as c } from "../accessibility-C-aIZ1Yx.js";
4
+ import { a as l, n as u, o as d, r as f, t as p } from "../chart-frame-C0UBu4ku.js";
5
+ import { n as m, r as h, t as g } from "../chart-input-Ccr2NJ6J.js";
6
+ import { r as _ } from "../tokens.stylex-CJbIDPB9.js";
7
+ import { t as v } from "../plot-width--OgdohB5.js";
8
+ import { D as y } from "../src-C-Sx37kz.js";
9
+ import { m as b } from "../src-CoFxE4Cj.js";
10
+ import * as x from "@stylexjs/stylex";
11
+ import { useEffect as ee, useId as S, useMemo as te, useRef as ne, useState as C } from "react";
12
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
13
+ import { scaleBand as D, scaleLinear as O } from "@visx/scale";
14
+ import { AreaClosed as re, Bar as k, LinePath as A } from "@visx/shape";
15
15
  // packages/charts/src/chart-cursor.tsx
16
- function ne({ x: e, top: t, bottom: n, width: r }) {
17
- return /* @__PURE__ */ D("g", {
16
+ function ie({ x: e, top: t, bottom: n, width: r }) {
17
+ return /* @__PURE__ */ E("g", {
18
18
  "aria-hidden": !0,
19
19
  className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
20
- children: [/* @__PURE__ */ E("line", {
20
+ children: [/* @__PURE__ */ T("line", {
21
21
  x1: e,
22
22
  x2: e,
23
23
  y1: t,
24
24
  y2: n,
25
25
  className: "xnpr05h x1ntoi03 x13efnbd"
26
- }), /* @__PURE__ */ E("line", {
26
+ }), /* @__PURE__ */ T("line", {
27
27
  x1: e - r / 2,
28
28
  x2: e + r / 2,
29
29
  y1: n + 4,
@@ -33,21 +33,21 @@ function ne({ x: e, top: t, bottom: n, width: r }) {
33
33
  });
34
34
  }
35
35
  // packages/charts/src/chart-data.tsx
36
- function M({ children: e }) {
37
- return /* @__PURE__ */ E("div", {
38
- ...b.props(o.hidden),
36
+ function ae({ children: e }) {
37
+ return /* @__PURE__ */ T("div", {
38
+ ...x.props(c.hidden),
39
39
  children: e
40
40
  });
41
41
  }
42
42
  // packages/charts/src/chart-inspection.tsx
43
- var N = {
43
+ var oe = {
44
44
  kzqmXN: "x1xc55vz",
45
45
  kZKoxP: "xdk7pt",
46
46
  kmuXW: "x2lah0s",
47
47
  $$css: !0
48
- }, P = {
48
+ }, j = {
49
49
  swatch: (e) => [
50
- N,
50
+ oe,
51
51
  {
52
52
  kWkggS: e == null ? e : "xl8spv7",
53
53
  $$css: !0
@@ -87,78 +87,75 @@ var N = {
87
87
  "--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
88
88
  "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
89
89
  }]
90
- }, re = 4;
91
- function ie() {
92
- return /* @__PURE__ */ E("ul", {
90
+ }, M = 4;
91
+ function se() {
92
+ return /* @__PURE__ */ T("ul", {
93
93
  "aria-hidden": !0,
94
94
  inert: !0,
95
95
  className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k",
96
- children: Array.from({ length: re }, (t, n) => /* @__PURE__ */ D("li", {
96
+ children: Array.from({ length: M }, (e, t) => /* @__PURE__ */ E("li", {
97
97
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe x1f394nn x43dure",
98
- children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(g.line)) }), /* @__PURE__ */ D("span", {
98
+ children: [/* @__PURE__ */ T("span", { ...x.props(j.swatch(_.line)) }), /* @__PURE__ */ E("span", {
99
99
  className: "x1cqoux5 xeuugli",
100
100
  children: [
101
- /* @__PURE__ */ E(e, {}),
102
- /* @__PURE__ */ E("span", {
101
+ /* @__PURE__ */ T(n, {}),
102
+ /* @__PURE__ */ T("span", {
103
103
  className: "x1s85apg xannxpe",
104
- children: /* @__PURE__ */ E(e, {})
104
+ children: /* @__PURE__ */ T(n, {})
105
105
  }),
106
- /* @__PURE__ */ E("span", {
106
+ /* @__PURE__ */ T("span", {
107
107
  className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
108
- children: /* @__PURE__ */ E(e, {})
108
+ children: /* @__PURE__ */ T(n, {})
109
109
  })
110
110
  ]
111
111
  })]
112
- }, n))
112
+ }, t))
113
113
  });
114
114
  }
115
- function ae({ title: e, detail: t }) {
116
- return t === void 0 ? e : /* @__PURE__ */ D("span", {
115
+ function ce({ title: e, detail: t }) {
116
+ return t === void 0 ? e : /* @__PURE__ */ E("span", {
117
117
  "aria-label": e,
118
118
  className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
119
- children: [/* @__PURE__ */ E("span", {
119
+ children: [/* @__PURE__ */ T("span", {
120
120
  className: "xt0psk2 x1boff50",
121
121
  children: e
122
- }), /* @__PURE__ */ E("span", {
122
+ }), /* @__PURE__ */ T("span", {
123
123
  className: "x1s85apg xfodcyb",
124
124
  children: t
125
125
  })]
126
126
  });
127
127
  }
128
- function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [], hasSeriesSummary: f = !1 }) {
128
+ function le({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [], hasSeriesSummary: f = !1 }) {
129
129
  let p = Math.min(260, s), m = o > s / 2 ? o - p - c : o + c, h = Math.max(0, Math.min(s - p, m)), g = t === void 0 ? [] : [
130
130
  t,
131
131
  n,
132
132
  ...a.map((e) => `${e.label}: ${e.value}`),
133
133
  ...u
134
134
  ].filter((e) => e !== void 0);
135
- return /* @__PURE__ */ D("div", {
135
+ return /* @__PURE__ */ E("div", {
136
136
  className: "xeuugli",
137
137
  children: [
138
- !f && /* @__PURE__ */ D("div", {
138
+ !f && /* @__PURE__ */ E("div", {
139
139
  className: "xrvj5dj xeuugli",
140
- children: [i !== void 0 && /* @__PURE__ */ E("ul", {
140
+ children: [i !== void 0 && /* @__PURE__ */ T("ul", {
141
141
  "aria-hidden": !0,
142
142
  inert: !0,
143
143
  className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
144
- children: i.map((e) => /* @__PURE__ */ D("li", {
144
+ children: i.map((e) => /* @__PURE__ */ E("li", {
145
145
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
146
- children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(d[e.tone])) }), /* @__PURE__ */ D("span", {
146
+ children: [/* @__PURE__ */ T(d, { tone: e.tone }), /* @__PURE__ */ E("span", {
147
147
  className: "xeuugli",
148
- children: [e.label, /* @__PURE__ */ E("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
148
+ children: [e.label, /* @__PURE__ */ T("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
149
149
  })]
150
150
  }, e.id))
151
- }), /* @__PURE__ */ E("ul", {
151
+ }), /* @__PURE__ */ T("ul", {
152
152
  "aria-label": "Legend",
153
153
  className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc",
154
- children: r.map((e) => /* @__PURE__ */ D("li", {
154
+ children: r.map((e) => /* @__PURE__ */ E("li", {
155
155
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
156
- children: [/* @__PURE__ */ E("span", {
157
- "aria-hidden": !0,
158
- ...b.props(P.swatch(d[e.tone]))
159
- }), /* @__PURE__ */ D("span", {
156
+ children: [/* @__PURE__ */ T(d, { tone: e.tone }), /* @__PURE__ */ E("span", {
160
157
  className: "xeuugli",
161
- children: [e.label, /* @__PURE__ */ E("span", {
158
+ children: [e.label, /* @__PURE__ */ T("span", {
162
159
  className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
163
160
  children: t === void 0 ? "" : a.find((t) => t.id === e.id)?.value ?? "—"
164
161
  })]
@@ -166,36 +163,36 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
166
163
  }, e.id))
167
164
  })]
168
165
  }),
169
- /* @__PURE__ */ E("span", {
166
+ /* @__PURE__ */ T("span", {
170
167
  id: e,
171
168
  "aria-live": l === "keyboard" ? "polite" : "off",
172
169
  className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xb3r6kr x1hyvwdk xuxw1ft",
173
170
  children: g.join(" · ")
174
171
  }),
175
- t !== void 0 && /* @__PURE__ */ E("div", {
172
+ t !== void 0 && /* @__PURE__ */ T("div", {
176
173
  "aria-hidden": !0,
177
174
  className: "x1n2onr6 xqtp20y x1vjfegm",
178
- children: /* @__PURE__ */ D("div", {
179
- ...b.props(P.inspector, f && P.summaryInspector, P.position(h, p)),
175
+ children: /* @__PURE__ */ E("div", {
176
+ ...x.props(j.inspector, f && j.summaryInspector, j.position(h, p)),
180
177
  children: [
181
- /* @__PURE__ */ D("div", {
178
+ /* @__PURE__ */ E("div", {
182
179
  className: "x78zum5 x1qughib x1hnptsi xk4h15q",
183
- children: [/* @__PURE__ */ E("span", { children: t }), n !== void 0 && /* @__PURE__ */ E("span", { children: n })]
180
+ children: [/* @__PURE__ */ T("span", { children: t }), n !== void 0 && /* @__PURE__ */ T("span", { children: n })]
184
181
  }),
185
- /* @__PURE__ */ E("dl", {
182
+ /* @__PURE__ */ T("dl", {
186
183
  className: "xrvj5dj xunmzkg x1ghz6dp",
187
- children: a.map((e) => /* @__PURE__ */ D("div", {
184
+ children: a.map((e) => /* @__PURE__ */ E("div", {
188
185
  className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
189
- children: [/* @__PURE__ */ D("dt", {
186
+ children: [/* @__PURE__ */ E("dt", {
190
187
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
191
- children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(d[e.tone])) }), e.label]
192
- }), /* @__PURE__ */ E("dd", {
188
+ children: [/* @__PURE__ */ T(d, { tone: e.tone }), e.label]
189
+ }), /* @__PURE__ */ T("dd", {
193
190
  className: "x1ghz6dp xuxw1ft",
194
191
  children: e.value
195
192
  })]
196
193
  }, e.id))
197
194
  }),
198
- u.map((e) => /* @__PURE__ */ E("span", { children: e }, e))
195
+ u.map((e) => /* @__PURE__ */ T("span", { children: e }, e))
199
196
  ]
200
197
  })
201
198
  })
@@ -203,7 +200,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
203
200
  });
204
201
  }
205
202
  // packages/charts/src/cartesian/bar-data.ts
206
- function se({ composition: e, series: t, categoryIds: n, domain: r }) {
203
+ function ue({ composition: e, series: t, categoryIds: n, domain: r }) {
207
204
  if (e === void 0) return;
208
205
  if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
209
206
  let i = e.annotation;
@@ -221,52 +218,52 @@ function se({ composition: e, series: t, categoryIds: n, domain: r }) {
221
218
  }
222
219
  }
223
220
  // packages/charts/src/cartesian/composition-bars.tsx
224
- var ce = { mark: {
221
+ var N = { mark: {
225
222
  k3nNDw: "x1hj3fc7",
226
223
  k1ekBW: "xwcsmn1",
227
224
  kIyJzY: "xtitasy x12w9bfk",
228
225
  kAMwcw: "x1faw7qm",
229
226
  $$css: !0
230
227
  } };
231
- function le({ bucket: e, series: t, focusedSeries: n, index: r, x: a, width: o, y: s, isHighlighted: c, highlightedSeriesId: u }) {
232
- let f = n !== void 0, p = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
228
+ function de({ bucket: t, series: n, focusedSeries: r, index: a, x: o, width: c, y: l, isHighlighted: u, highlightedSeriesId: d }) {
229
+ let f = r !== void 0, p = r !== void 0 && !n.some((e) => e.id === r.id) ? [...n, r] : n;
233
230
  function m(e, t) {
234
- let n = s(t), r = s(t + e);
231
+ let n = l(t), r = l(t + e);
235
232
  return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
236
233
  }
237
- return /* @__PURE__ */ D(T, { children: [e.kind !== "gap" && /* @__PURE__ */ E("rect", {
238
- x: a,
234
+ return /* @__PURE__ */ E(w, { children: [t.kind !== "gap" && /* @__PURE__ */ T("rect", {
235
+ x: o,
239
236
  y: 0,
240
- width: o,
237
+ width: c,
241
238
  height: 1,
242
239
  vectorEffect: "non-scaling-stroke",
243
- fill: d.neutral,
244
- ...b.props(ce.mark, c && l.selected),
240
+ fill: e.neutral,
241
+ ...x.props(N.mark, u && s.selected),
245
242
  style: {
246
- transform: m(e.total, 0),
247
- opacity: f ? .18 : +(e.kind === "total")
243
+ transform: m(t.total, 0),
244
+ opacity: f ? .18 : +(t.kind === "total")
248
245
  }
249
- }), p.map((s, p) => {
250
- let h = s.values[r];
246
+ }), p.map((l, p) => {
247
+ let h = l.values[a];
251
248
  if (h == null) return null;
252
- let g = n?.id === s.id, _ = f ? 0 : t.slice(0, p).reduce((e, t) => e + (t.values[r] ?? 0), 0), v = f ? g : e.kind === "parts", y = !f && u !== void 0 && u !== s.id;
253
- return /* @__PURE__ */ E("rect", {
254
- x: a,
249
+ let g = r?.id === l.id, _ = f ? 0 : n.slice(0, p).reduce((e, t) => e + (t.values[a] ?? 0), 0), v = f ? g : t.kind === "parts", y = !f && d !== void 0 && d !== l.id;
250
+ return /* @__PURE__ */ T("rect", {
251
+ x: o,
255
252
  y: 0,
256
- width: o,
253
+ width: c,
257
254
  height: 1,
258
255
  vectorEffect: "non-scaling-stroke",
259
- fill: d[i(s.tone, p)],
260
- ...b.props(ce.mark, c && l.selected),
256
+ fill: e[i(l.tone, p)],
257
+ ...x.props(N.mark, u && s.selected),
261
258
  style: {
262
259
  transform: m(h, _),
263
260
  opacity: v ? y ? .3 : 1 : 0
264
261
  }
265
- }, s.id);
262
+ }, l.id);
266
263
  })] });
267
264
  }
268
265
  // packages/charts/src/cartesian/bar-chart.tsx
269
- var ue = {
266
+ var P = {
270
267
  plot: {
271
268
  kqGvvJ: "x1we84gm",
272
269
  $$css: !0
@@ -275,19 +272,19 @@ var ue = {
275
272
  kSiTet: "xuzhngd",
276
273
  $$css: !0
277
274
  }
278
- }, de = /* @__PURE__ */ new Set(["Enter", " "]), fe = 200;
279
- function F({ title: e, description: t, report: n, series: r, layoutSeries: a, children: o, inspectionId: s, label: c, detail: l, summary: d, rows: f = [], index: p = -1, formatValue: m = String, x: h = 0, width: g = 0, offset: _, source: v, data: y, isLoading: b = !1 }) {
275
+ }, fe = /* @__PURE__ */ new Set(["Enter", " "]), F = 200;
276
+ function I({ title: e, description: t, report: n, series: r, layoutSeries: a, children: o, inspectionId: s, label: c, detail: l, summary: u, rows: d = [], index: p = -1, formatValue: m = String, x: h = 0, width: g = 0, offset: _, source: v, data: y, isLoading: b = !1 }) {
280
277
  let x = r.map((e, t) => ({
281
278
  id: e.id,
282
279
  label: e.label,
283
280
  tone: i(e.tone, t)
284
- })), S = a?.map((e, t) => ({
281
+ })), ee = a?.map((e, t) => ({
285
282
  id: e.id,
286
283
  label: e.label,
287
284
  tone: i(e.tone, t)
288
- })), C = b && r.length === 0 && n?.seriesValues === void 0;
289
- return /* @__PURE__ */ D(u, {
290
- title: /* @__PURE__ */ E(ae, {
285
+ })), S = b && r.length === 0 && n?.seriesValues === void 0;
286
+ return /* @__PURE__ */ E(f, {
287
+ title: /* @__PURE__ */ T(ce, {
291
288
  title: e,
292
289
  detail: l
293
290
  }),
@@ -295,15 +292,15 @@ function F({ title: e, description: t, report: n, series: r, layoutSeries: a, ch
295
292
  report: n,
296
293
  series: x,
297
294
  children: [
298
- /* @__PURE__ */ E(M, { children: y }),
299
- C ? /* @__PURE__ */ E(ie, {}) : /* @__PURE__ */ E(oe, {
295
+ /* @__PURE__ */ T(ae, { children: y }),
296
+ S ? /* @__PURE__ */ T(se, {}) : /* @__PURE__ */ T(le, {
300
297
  id: s,
301
298
  label: c,
302
- summary: d,
299
+ summary: u,
303
300
  legend: x,
304
301
  hasSeriesSummary: n?.seriesValues !== void 0,
305
- layoutLegend: S,
306
- rows: f.map((e, t) => ({
302
+ layoutLegend: ee,
303
+ rows: d.map((e, t) => ({
307
304
  id: e.id,
308
305
  label: e.label,
309
306
  tone: i(e.tone, t),
@@ -318,173 +315,170 @@ function F({ title: e, description: t, report: n, series: r, layoutSeries: a, ch
318
315
  ]
319
316
  });
320
317
  }
321
- function I({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = fe }) {
322
- let o = L(a), s = S();
323
- return o === void 0 ? /* @__PURE__ */ E("div", {
318
+ function L({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = F }) {
319
+ let o = pe(a), c = S();
320
+ return o === void 0 ? /* @__PURE__ */ T("div", {
324
321
  "aria-hidden": !0,
325
322
  inert: !0,
326
- children: /* @__PURE__ */ E(F, {
323
+ children: /* @__PURE__ */ T(I, {
327
324
  title: e,
328
325
  description: n,
329
326
  report: r,
330
327
  series: i,
331
- inspectionId: s,
328
+ inspectionId: c,
332
329
  isLoading: !0,
333
- children: /* @__PURE__ */ E("div", {
334
- ...b.props(l.plot, ue.plot),
335
- children: /* @__PURE__ */ E(t, { height: a })
330
+ children: /* @__PURE__ */ T("div", {
331
+ ...x.props(s.plot, P.plot),
332
+ children: /* @__PURE__ */ T(t, { height: a })
336
333
  })
337
334
  })
338
- }) : /* @__PURE__ */ E(h, {
335
+ }) : /* @__PURE__ */ T(g, {
339
336
  title: e,
340
337
  description: n,
341
338
  report: r,
342
339
  message: o
343
340
  });
344
341
  }
345
- function L(e) {
342
+ function pe(e) {
346
343
  if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
347
344
  }
348
- function pe({ categories: e, series: t, domain: n, mode: i }) {
349
- if (e.length > r.items || t.length > r.series) return `Choose a window with at most ${r.items} categories and ${r.series} series.`;
350
- if (!m(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
351
- if (!p(e) || !p(t)) return "Bar categories and series require unique identifiers.";
352
- for (let r of t) {
353
- if (r.values.length !== e.length) return "Every series requires one explicit value per category.";
354
- for (let e of r.values) {
345
+ function me({ categories: e, series: t, domain: n, mode: r }) {
346
+ if (e.length > o.items || t.length > o.series) return `Choose a window with at most ${o.items} categories and ${o.series} series.`;
347
+ if (!h(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
348
+ if (!m(e) || !m(t)) return "Bar categories and series require unique identifiers.";
349
+ for (let i of t) {
350
+ if (i.values.length !== e.length) return "Every series requires one explicit value per category.";
351
+ for (let e of i.values) {
355
352
  if (e !== null && (!Number.isFinite(e) || e < n[0] || e > n[1])) return "Bar values must be finite and within the supplied domain.";
356
- if (i === "stacked" && (e === null || e < 0)) return "Stacked bars require present nonnegative values.";
353
+ if (r === "stacked" && (e === null || e < 0)) return "Stacked bars require present nonnegative values.";
357
354
  }
358
355
  }
359
- if (i === "stacked" && e.some((e, r) => t.reduce((e, t) => e + (t.values[r] ?? 0), 0) > n[1])) return "Stacked bar totals must fit the supplied domain.";
356
+ if (r === "stacked" && e.some((e, r) => t.reduce((e, t) => e + (t.values[r] ?? 0), 0) > n[1])) return "Stacked bar totals must fit the supplied domain.";
360
357
  }
361
- var me = {
358
+ var he = {
362
359
  "x-default-marker": "x-default-marker",
363
360
  $$css: !0
364
361
  };
365
- function he({ title: e, description: t, report: n, categories: r, series: o, domain: s, mode: c = "grouped", formatValue: u, formatTick: f = u, highlightedSeriesId: p, selection: m, height: g = fe, composition: v }) {
366
- let y = v?.focusedSeries, C = S(), ee = y === void 0 ? void 0 : pe({
367
- categories: r,
362
+ function R({ title: t, description: n, report: r, categories: o, series: c, domain: l, mode: u = "grouped", formatValue: d, formatTick: f = d, highlightedSeriesId: p, selection: m, height: h = F, composition: _ }) {
363
+ let y = _?.focusedSeries, b = S(), te = y === void 0 ? void 0 : me({
364
+ categories: o,
368
365
  series: [y],
369
- domain: s,
366
+ domain: l,
370
367
  mode: "grouped"
371
- }), T = pe({
372
- categories: r,
373
- series: o,
374
- domain: s,
375
- mode: c
376
- }) ?? ee, te = se({
377
- composition: v,
378
- series: o,
379
- categoryIds: r.map((e) => e.id),
380
- domain: s
381
- }) ?? L(g), j = T ?? te, M = v === void 0 ? void 0 : {
382
- id: C,
383
- label: v.contextLabel,
368
+ }), ne = me({
369
+ categories: o,
370
+ series: c,
371
+ domain: l,
372
+ mode: u
373
+ }) ?? te, w = ue({
374
+ composition: _,
375
+ series: c,
376
+ categoryIds: o.map((e) => e.id),
377
+ domain: l
378
+ }) ?? pe(h), re = ne ?? w, A = _ === void 0 ? void 0 : {
379
+ id: b,
380
+ label: _.contextLabel,
384
381
  tone: "neutral",
385
- values: v.buckets.map((e) => e.kind === "gap" ? null : e.total)
386
- }, N = M === void 0 ? o : [
387
- M,
388
- ...o,
389
- ...y === void 0 || o.some((e) => e.id === y.id) ? [] : [y]
390
- ], P = y !== void 0 && M !== void 0 ? [y, M] : o, { ref: re, width: ie, element: ae } = _(), oe = S(), [ce, I] = w(), [he, z] = w();
391
- x(() => {
382
+ values: _.buckets.map((e) => e.kind === "gap" ? null : e.total)
383
+ }, ae = A === void 0 ? c : [
384
+ A,
385
+ ...c,
386
+ ...y === void 0 || c.some((e) => e.id === y.id) ? [] : [y]
387
+ ], oe = y !== void 0 && A !== void 0 ? [y, A] : c, { ref: j, width: M, element: se } = v(), ce = S(), [le, N] = C(), [L, R] = C();
388
+ ee(() => {
392
389
  function e(e) {
393
- e.target instanceof Node && ae?.contains(e.target) !== !0 && I(void 0);
390
+ e.target instanceof Node && se?.contains(e.target) !== !0 && N(void 0);
394
391
  }
395
392
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
396
- }, [ae]);
397
- let B = r.findIndex((e) => e.id === ce?.id), V = r[B], H = r[r.findIndex((e) => e.id === m?.selectedId)], U = r.find((e) => e.id === he) ?? H ?? r[0], W = r.findIndex((e) => e.id === U?.id), G = V, ge = B, K = v?.buckets[ge], q = y !== void 0 && M !== void 0 ? [y, M] : M === void 0 || K?.kind === "parts" ? o : [], J = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : u(K.total);
398
- if (j !== void 0) return /* @__PURE__ */ E(h, {
399
- title: e,
400
- description: t,
401
- report: n,
402
- message: j
393
+ }, [se]);
394
+ let z = o.findIndex((e) => e.id === le?.id), B = o[z], V = o[o.findIndex((e) => e.id === m?.selectedId)], H = o.find((e) => e.id === L) ?? V ?? o[0], U = o.findIndex((e) => e.id === H?.id), W = B, G = z, K = _?.buckets[G], _e = y !== void 0 && A !== void 0 ? [y, A] : A === void 0 || K?.kind === "parts" ? c : [], q = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : d(K.total);
395
+ if (re !== void 0) return /* @__PURE__ */ T(g, {
396
+ title: t,
397
+ description: n,
398
+ report: r,
399
+ message: re
403
400
  });
404
- let Y = g - 28, X = k({
405
- domain: [...s],
406
- range: [Y, 12]
407
- }), Z = Math.max(44, ...X.ticks(3).map((e) => f(e).length * 7 + 12)), Q = Math.max(Z + 1, ie - 16), $ = O({
408
- domain: r.map((e) => e.id),
409
- range: [Z, Q],
410
- padding: .3
411
- }), _e = O({
401
+ let J = h - 28, Y = O({
402
+ domain: [...l],
403
+ range: [J, 12]
404
+ }), X = Math.max(44, ...Y.ticks(3).map((e) => f(e).length * 7 + 12)), Z = Math.max(X + 1, M - 16), Q = D({
412
405
  domain: o.map((e) => e.id),
413
- range: [0, $.bandwidth()],
406
+ range: [X, Z],
407
+ padding: .3
408
+ }), $ = D({
409
+ domain: c.map((e) => e.id),
410
+ range: [0, Q.bandwidth()],
414
411
  padding: .08
415
- }), ve = Math.min(120, Math.max(40, ...r.map((e) => (e.axisLabel ?? e.label).length * 7))), ye = Math.max(1, Math.ceil((ve + 16) / $.step())), be = Math.max(1, Math.floor(($.step() * ye - 16) / 7));
412
+ }), ve = Math.min(120, Math.max(40, ...o.map((e) => (e.axisLabel ?? e.label).length * 7))), ye = Math.max(1, Math.ceil((ve + 16) / Q.step())), be = Math.max(1, Math.floor((Q.step() * ye - 16) / 7));
416
413
  function xe(e) {
417
- let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * ie, i = Math.floor((n - Z) / $.step()), a = r[Math.max(0, Math.min(r.length - 1, i))];
418
- a !== void 0 && (e.type === "pointerdown" && z(a.id), I({
419
- id: a.id,
414
+ let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * M, r = Math.floor((n - X) / Q.step()), i = o[Math.max(0, Math.min(o.length - 1, r))];
415
+ i !== void 0 && (e.type === "pointerdown" && R(i.id), N({
416
+ id: i.id,
420
417
  source: "pointer"
421
418
  }));
422
419
  }
423
420
  function Se(e) {
424
421
  if (e.altKey || e.ctrlKey || e.metaKey) return;
425
422
  if (e.key === "Escape") {
426
- e.preventDefault(), e.stopPropagation(), I(void 0);
423
+ e.preventDefault(), e.stopPropagation(), N(void 0);
427
424
  return;
428
425
  }
429
- if (de.has(e.key)) {
430
- U !== void 0 && m !== void 0 && (e.preventDefault(), m.onSelect(U.id));
426
+ if (fe.has(e.key)) {
427
+ H !== void 0 && m !== void 0 && (e.preventDefault(), m.onSelect(H.id));
431
428
  return;
432
429
  }
433
430
  let t = {
434
- ArrowRight: Math.min(r.length - 1, W + 1),
435
- ArrowLeft: Math.max(0, W - 1),
431
+ ArrowRight: Math.min(o.length - 1, U + 1),
432
+ ArrowLeft: Math.max(0, U - 1),
436
433
  Home: 0,
437
- End: r.length - 1
438
- }[e.key], n = t === void 0 ? void 0 : r[t];
439
- n !== void 0 && (e.preventDefault(), z(n.id), I({
434
+ End: o.length - 1
435
+ }[e.key], n = t === void 0 ? void 0 : o[t];
436
+ n !== void 0 && (e.preventDefault(), R(n.id), N({
440
437
  id: n.id,
441
438
  source: "keyboard"
442
439
  }));
443
440
  }
444
- return /* @__PURE__ */ E(F, {
445
- title: e,
446
- description: t,
447
- report: n,
448
- series: P,
449
- layoutSeries: o,
450
- inspectionId: oe,
451
- label: G?.label,
452
- detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label, J].filter(Boolean).join(" · "),
453
- summary: J,
454
- rows: q,
455
- index: ge,
456
- formatValue: u,
457
- x: ($(G?.id ?? "") ?? Z) + $.bandwidth() / 2,
458
- width: ie,
459
- offset: $.bandwidth() / 2 + 8,
460
- source: ce?.source,
461
- data: /* @__PURE__ */ E(a, {
462
- items: r.map((e, t) => ({
463
- id: e.id,
464
- label: e.label,
465
- valueLabel: R(N, t, u),
466
- tone: "neutral"
467
- })),
468
- selection: m
469
- }),
470
- children: /* @__PURE__ */ E("div", {
471
- ref: re,
472
- ...b.props(l.plot, ue.plot),
473
- children: r.length === 0 || o.length === 0 && v === void 0 ? /* @__PURE__ */ E("p", {
441
+ return /* @__PURE__ */ T(I, {
442
+ title: t,
443
+ description: n,
444
+ report: r,
445
+ series: oe,
446
+ layoutSeries: c,
447
+ inspectionId: ce,
448
+ label: W?.label,
449
+ detail: W === void 0 ? void 0 : [W.axisLabel ?? W.label, q].filter(Boolean).join(" · "),
450
+ summary: q,
451
+ rows: _e,
452
+ index: G,
453
+ formatValue: d,
454
+ x: (Q(W?.id ?? "") ?? X) + Q.bandwidth() / 2,
455
+ width: M,
456
+ offset: Q.bandwidth() / 2 + 8,
457
+ source: le?.source,
458
+ data: /* @__PURE__ */ T(a, { items: o.map((e, t) => ({
459
+ id: e.id,
460
+ label: e.label,
461
+ valueLabel: ge(ae, t, d),
462
+ tone: "neutral"
463
+ })) }),
464
+ children: /* @__PURE__ */ T("div", {
465
+ ref: j,
466
+ ...x.props(s.plot, P.plot),
467
+ children: o.length === 0 || c.length === 0 && _ === void 0 ? /* @__PURE__ */ T("p", {
474
468
  className: "x153jb6y x1ghz6dp xy8obcc",
475
469
  children: "No categories"
476
- }) : /* @__PURE__ */ D("svg", {
470
+ }) : /* @__PURE__ */ E("svg", {
477
471
  role: "img",
478
- "aria-label": `${e}. Use arrow keys to inspect categories.${m === void 0 ? "" : " Press Enter to select."}`,
479
- "aria-describedby": oe,
472
+ "aria-label": `${t}. Use arrow keys to inspect categories.${m === void 0 ? "" : " Press Enter to select."}`,
473
+ "aria-describedby": ce,
480
474
  tabIndex: 0,
481
- viewBox: `0 0 ${ie} ${g}`,
482
- height: g,
475
+ viewBox: `0 0 ${M} ${h}`,
476
+ height: h,
483
477
  onKeyDown: Se,
484
478
  onFocus: (e) => {
485
479
  if (e.currentTarget.matches(":focus-visible")) {
486
- let e = H ?? r[0];
487
- z(e?.id), I(e === void 0 ? void 0 : {
480
+ let e = V ?? o[0];
481
+ R(e?.id), N(e === void 0 ? void 0 : {
488
482
  id: e.id,
489
483
  source: "keyboard"
490
484
  });
@@ -495,85 +489,85 @@ function he({ title: e, description: t, report: n, categories: r, series: o, dom
495
489
  },
496
490
  onPointerDown: xe,
497
491
  onPointerLeave: (e) => {
498
- e.pointerType === "mouse" && ce?.source === "pointer" && I(void 0);
492
+ e.pointerType === "mouse" && le?.source === "pointer" && N(void 0);
499
493
  },
500
- onBlur: () => I(void 0),
494
+ onBlur: () => N(void 0),
501
495
  onClick: () => {
502
- V !== void 0 && m?.onSelect(V.id);
496
+ B !== void 0 && m?.onSelect(B.id);
503
497
  },
504
- ...b.props(l.svg, l.inspectable, me),
498
+ ...x.props(s.svg, s.inspectable, he),
505
499
  children: [
506
- V !== void 0 && /* @__PURE__ */ E("rect", {
507
- x: ($(V.id) ?? Z) - ($.step() - $.bandwidth()) / 2,
500
+ B !== void 0 && /* @__PURE__ */ T("rect", {
501
+ x: (Q(B.id) ?? X) - (Q.step() - Q.bandwidth()) / 2,
508
502
  y: 12,
509
- width: $.step(),
510
- height: Y - 12,
503
+ width: Q.step(),
504
+ height: J - 12,
511
505
  className: "x2wnxhi"
512
506
  }),
513
- X.ticks(3).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
514
- x1: Z,
515
- x2: Q,
516
- y1: X(e),
517
- y2: X(e),
518
- ...b.props(l.grid)
519
- }), /* @__PURE__ */ E("text", {
520
- x: Z - 8,
521
- y: X(e),
507
+ Y.ticks(3).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
508
+ x1: X,
509
+ x2: Z,
510
+ y1: Y(e),
511
+ y2: Y(e),
512
+ ...x.props(s.grid)
513
+ }), /* @__PURE__ */ T("text", {
514
+ x: X - 8,
515
+ y: Y(e),
522
516
  textAnchor: "end",
523
517
  dominantBaseline: "middle",
524
- ...b.props(l.label),
518
+ ...x.props(s.label),
525
519
  children: f(e)
526
520
  })] }, e)),
527
- v?.annotation !== void 0 && r.some((e) => e.id === v.annotation?.categoryId) && /* @__PURE__ */ E("text", {
528
- x: $(v.annotation.categoryId),
529
- y: Math.max(12, X(v.annotation.value) - 8),
530
- ...b.props(l.label),
531
- children: v.annotation.label
521
+ _?.annotation !== void 0 && o.some((e) => e.id === _.annotation?.categoryId) && /* @__PURE__ */ T("text", {
522
+ x: Q(_.annotation.categoryId),
523
+ y: Math.max(12, Y(_.annotation.value) - 8),
524
+ ...x.props(s.label),
525
+ children: _.annotation.label
532
526
  }),
533
- r.map((e, t) => {
534
- let n = e.axisLabel ?? e.label, r = v?.buckets[t];
535
- return /* @__PURE__ */ D("g", { children: [r === void 0 ? o.map((n, r) => {
536
- let a = n.values[t];
537
- if (a == null) return null;
538
- let s = c === "stacked" ? o.slice(0, r).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, u = X(s), f = X(s + a), h = m?.selectedId === e.id || V?.id === e.id;
539
- return /* @__PURE__ */ E(A, {
540
- x: ($(e.id) ?? Z) + (c === "stacked" ? 0 : _e(n.id) ?? 0),
541
- y: Math.min(u, f),
542
- width: c === "stacked" ? $.bandwidth() : _e.bandwidth(),
543
- height: Math.max(+(a === 0), Math.abs(f - u)),
544
- fill: d[i(n.tone, r)],
545
- ...b.props(h && l.selected, p !== void 0 && p !== n.id && ue.mutedMark)
546
- }, n.id);
547
- }) : /* @__PURE__ */ E(le, {
548
- bucket: r,
549
- series: o,
527
+ o.map((t, n) => {
528
+ let r = t.axisLabel ?? t.label, a = _?.buckets[n];
529
+ return /* @__PURE__ */ E("g", { children: [a === void 0 ? c.map((r, a) => {
530
+ let o = r.values[n];
531
+ if (o == null) return null;
532
+ let l = u === "stacked" ? c.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, d = Y(l), f = Y(l + o), h = m?.selectedId === t.id || B?.id === t.id;
533
+ return /* @__PURE__ */ T(k, {
534
+ x: (Q(t.id) ?? X) + (u === "stacked" ? 0 : $(r.id) ?? 0),
535
+ y: Math.min(d, f),
536
+ width: u === "stacked" ? Q.bandwidth() : $.bandwidth(),
537
+ height: Math.max(+(o === 0), Math.abs(f - d)),
538
+ fill: e[i(r.tone, a)],
539
+ ...x.props(h && s.selected, p !== void 0 && p !== r.id && P.mutedMark)
540
+ }, r.id);
541
+ }) : /* @__PURE__ */ T(de, {
542
+ bucket: a,
543
+ series: c,
550
544
  focusedSeries: y,
551
- index: t,
552
- x: $(e.id) ?? Z,
553
- width: $.bandwidth(),
554
- y: X,
555
- isHighlighted: m?.selectedId === e.id || V?.id === e.id,
545
+ index: n,
546
+ x: Q(t.id) ?? X,
547
+ width: Q.bandwidth(),
548
+ y: Y,
549
+ isHighlighted: m?.selectedId === t.id || B?.id === t.id,
556
550
  highlightedSeriesId: p
557
- }), t % ye === 0 && /* @__PURE__ */ E("text", {
558
- x: ($(e.id) ?? Z) + $.bandwidth() / 2,
559
- y: g - 4,
551
+ }), n % ye === 0 && /* @__PURE__ */ T("text", {
552
+ x: (Q(t.id) ?? X) + Q.bandwidth() / 2,
553
+ y: h - 4,
560
554
  textAnchor: "middle",
561
- ...b.props(l.label),
562
- children: n.length > be ? `${n.slice(0, be - 1)}…` : n
563
- })] }, e.id);
555
+ ...x.props(s.label),
556
+ children: r.length > be ? `${r.slice(0, be - 1)}…` : r
557
+ })] }, t.id);
564
558
  }),
565
- U !== void 0 && /* @__PURE__ */ E(ne, {
566
- x: ($(U.id) ?? Z) + $.bandwidth() / 2,
559
+ H !== void 0 && /* @__PURE__ */ T(ie, {
560
+ x: (Q(H.id) ?? X) + Q.bandwidth() / 2,
567
561
  top: 12,
568
- bottom: Y,
569
- width: Math.max(8, $.bandwidth())
562
+ bottom: J,
563
+ width: Math.max(8, Q.bandwidth())
570
564
  })
571
565
  ]
572
566
  })
573
567
  })
574
568
  });
575
569
  }
576
- function R(e, t, n) {
570
+ function ge(e, t, n) {
577
571
  return e.map((e) => {
578
572
  let r = e.values[t];
579
573
  return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
@@ -595,54 +589,54 @@ var z = {
595
589
  "--x-backgroundColor": t ?? void 0
596
590
  }
597
591
  ] };
598
- function V({ title: e, report: t, description: r, items: o, total: s, formatValue: c, selection: l }) {
599
- let f = n(o), p = o.reduce((e, t) => e + (t.value ?? 0), 0), m = 2 ** -52 * Math.max(p, s, 1) * o.length;
600
- return f === void 0 ? !Number.isFinite(s) || s < 0 || p - s > m ? /* @__PURE__ */ E(h, {
601
- title: e,
602
- report: t,
603
- description: r,
592
+ function V({ title: t, report: n, description: o, items: s, total: c, formatValue: l, selection: u }) {
593
+ let d = r(s), p = s.reduce((e, t) => e + (t.value ?? 0), 0), m = 2 ** -52 * Math.max(p, c, 1) * s.length;
594
+ return d === void 0 ? !Number.isFinite(c) || c < 0 || p - c > m ? /* @__PURE__ */ T(g, {
595
+ title: t,
596
+ report: n,
597
+ description: o,
604
598
  message: "The total must be finite and at least the sum of recorded values."
605
- }) : /* @__PURE__ */ E(u, {
606
- title: e,
607
- report: t,
608
- description: r,
609
- children: o.length === 0 ? /* @__PURE__ */ E("p", {
599
+ }) : /* @__PURE__ */ T(f, {
600
+ title: t,
601
+ report: n,
602
+ description: o,
603
+ children: s.length === 0 ? /* @__PURE__ */ T("p", {
610
604
  className: "x153jb6y x1ghz6dp xy8obcc",
611
605
  children: "No values"
612
- }) : /* @__PURE__ */ D(T, { children: [
613
- /* @__PURE__ */ E("div", {
606
+ }) : /* @__PURE__ */ E(w, { children: [
607
+ /* @__PURE__ */ T("div", {
614
608
  "aria-hidden": !0,
615
609
  className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
616
- children: o.map((e, t) => e.value === null ? null : /* @__PURE__ */ E("span", { ...b.props(B.segment(s === 0 ? 0 : e.value / s * 100, d[i(e.tone, t)])) }, e.id))
610
+ children: s.map((t, n) => t.value === null ? null : /* @__PURE__ */ T("span", { ...x.props(B.segment(c === 0 ? 0 : t.value / c * 100, e[i(t.tone, n)])) }, t.id))
617
611
  }),
618
- /* @__PURE__ */ E(a, {
619
- items: o.map((e, t) => ({
612
+ /* @__PURE__ */ T(a, {
613
+ items: s.map((e, t) => ({
620
614
  id: e.id,
621
615
  label: e.label,
622
- valueLabel: e.value === null ? "Unavailable" : c(e.value),
616
+ valueLabel: e.value === null ? "Unavailable" : l(e.value),
623
617
  tone: i(e.tone, t)
624
618
  })),
625
- selection: l
619
+ selection: u
626
620
  }),
627
- s - p > m && /* @__PURE__ */ D("p", {
621
+ c - p > m && /* @__PURE__ */ E("p", {
628
622
  className: "x153jb6y x1ghz6dp xy8obcc",
629
623
  children: [
630
624
  "Unassigned portion: ",
631
- c(s - p),
625
+ l(c - p),
632
626
  " of ",
633
- c(s)
627
+ l(c)
634
628
  ]
635
629
  })
636
630
  ] })
637
- }) : /* @__PURE__ */ E(h, {
638
- title: e,
639
- report: t,
640
- description: r,
641
- message: f
631
+ }) : /* @__PURE__ */ T(g, {
632
+ title: t,
633
+ report: n,
634
+ description: o,
635
+ message: d
642
636
  });
643
637
  }
644
638
  // packages/charts/src/cartesian/scatter-plot.tsx
645
- var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
639
+ var H = 260, U = 56, W = 20, G = 12, K = 1e3, _e = {
646
640
  kzqmXN: "x1xc55vz",
647
641
  kZKoxP: "xdk7pt",
648
642
  kaIpWk: "x16rqkct",
@@ -685,7 +679,7 @@ var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
685
679
  "--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
686
680
  }],
687
681
  dot: (e) => [
688
- K,
682
+ _e,
689
683
  {
690
684
  kWkggS: e == null ? e : "xl8spv7",
691
685
  $$css: !0
@@ -700,95 +694,95 @@ var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
700
694
  $$css: !0
701
695
  }
702
696
  };
703
- function J(e) {
704
- let { title: t, report: n, description: r, points: i, xDomain: a, yDomain: o, xLabel: l, yLabel: p, formatX: m, formatY: g, selection: v, rangeSelection: y, emptyLabel: x } = e, { ref: S, width: C } = _(), ee = Z(e);
705
- if (ee !== null) return /* @__PURE__ */ E(h, {
706
- title: t,
707
- report: n,
708
- description: r,
709
- message: ee
697
+ function J(t) {
698
+ let { title: n, report: r, description: i, points: a, xDomain: o, yDomain: s, xLabel: c, yLabel: d, formatX: m, formatY: h, selection: _, rangeSelection: y, emptyLabel: b } = t, { ref: ee, width: S } = v(), te = Z(t);
699
+ if (te !== null) return /* @__PURE__ */ T(g, {
700
+ title: n,
701
+ report: r,
702
+ description: i,
703
+ message: te
710
704
  });
711
- let w = k({
712
- domain: [...a],
713
- range: [U, Math.max(U, C - W)]
714
- }), T = k({
705
+ let ne = O({
715
706
  domain: [...o],
707
+ range: [U, Math.max(U, S - W)]
708
+ }), C = O({
709
+ domain: [...s],
716
710
  range: [216, G]
717
- }), O = i.find((e) => e.id === v?.selectedId);
718
- return /* @__PURE__ */ D(u, {
719
- title: t,
720
- report: n,
721
- description: r,
722
- footer: v !== void 0 && i.length > 0 ? /* @__PURE__ */ E(s, { children: O === void 0 ? "Select a point to inspect its label and coordinates." : `${O.label}, ${l}: ${m(O.x)}, ${p}: ${g(O.y)}` }) : void 0,
711
+ }), w = a.find((e) => e.id === _?.selectedId);
712
+ return /* @__PURE__ */ E(f, {
713
+ title: n,
714
+ report: r,
715
+ description: i,
716
+ footer: _ !== void 0 && a.length > 0 ? /* @__PURE__ */ T(l, { children: w === void 0 ? "Select a point to inspect its label and coordinates." : `${w.label}, ${c}: ${m(w.x)}, ${d}: ${h(w.y)}` }) : void 0,
723
717
  children: [
724
- i.length === 0 ? /* @__PURE__ */ E("p", {
718
+ a.length === 0 ? /* @__PURE__ */ T("p", {
725
719
  className: "x1ghz6dp x153jb6y",
726
- children: x
727
- }) : /* @__PURE__ */ D("div", {
728
- ref: S,
720
+ children: b
721
+ }) : /* @__PURE__ */ E("div", {
722
+ ref: ee,
729
723
  className: "x1n2onr6 xeuugli",
730
- children: [/* @__PURE__ */ E(Y, {
731
- width: C,
732
- scaleX: w,
733
- scaleY: T,
734
- ...e
735
- }, `${a[0]}:${a[1]}:${o[0]}:${o[1]}:${C}`), v !== void 0 && /* @__PURE__ */ E("div", {
724
+ children: [/* @__PURE__ */ T(Y, {
725
+ width: S,
726
+ scaleX: ne,
727
+ scaleY: C,
728
+ ...t
729
+ }, `${o[0]}:${o[1]}:${s[0]}:${s[1]}:${S}`), _ !== void 0 && /* @__PURE__ */ T("div", {
736
730
  className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
737
- children: i.map((e) => /* @__PURE__ */ E("button", {
731
+ children: a.map((t) => /* @__PURE__ */ T("button", {
738
732
  type: "button",
739
- title: e.label,
740
- "aria-label": `${e.label}, ${l}: ${m(e.x)}, ${p}: ${g(e.y)}`,
741
- "aria-pressed": v.selectedId === e.id,
742
- onClick: () => v.onSelect(e.id),
743
- ...b.props(q.target, q.location(w(e.x), T(e.y))),
744
- children: /* @__PURE__ */ E("span", {
733
+ title: t.label,
734
+ "aria-label": `${t.label}, ${c}: ${m(t.x)}, ${d}: ${h(t.y)}`,
735
+ "aria-pressed": _.selectedId === t.id,
736
+ onClick: () => _.onSelect(t.id),
737
+ ...x.props(q.target, q.location(ne(t.x), C(t.y))),
738
+ children: /* @__PURE__ */ T("span", {
745
739
  "aria-hidden": !0,
746
- ...b.props(q.dot(d[e.tone]), v.selectedId === e.id && q.selected)
740
+ ...x.props(q.dot(e[t.tone]), _.selectedId === t.id && q.selected)
747
741
  })
748
- }, e.id))
742
+ }, t.id))
749
743
  })]
750
744
  }),
751
- y !== void 0 && /* @__PURE__ */ E(X, {
752
- ...e,
745
+ y !== void 0 && /* @__PURE__ */ T(X, {
746
+ ...t,
753
747
  rangeSelection: y
754
748
  }),
755
- i.length > 0 && /* @__PURE__ */ E(f, { children: i.map((e) => /* @__PURE__ */ D(c, {
756
- label: `${e.label}, ${l}: ${m(e.x)}, ${p}: ${g(e.y)}`,
757
- isSelected: v?.selectedId === e.id,
758
- onSelect: v === void 0 ? void 0 : () => v.onSelect(e.id),
759
- children: [/* @__PURE__ */ E("span", { children: e.label }), /* @__PURE__ */ D("span", {
749
+ a.length > 0 && /* @__PURE__ */ T(p, { children: a.map((e) => /* @__PURE__ */ E(u, {
750
+ label: `${e.label}, ${c}: ${m(e.x)}, ${d}: ${h(e.y)}`,
751
+ isSelected: _?.selectedId === e.id,
752
+ onSelect: _ === void 0 ? void 0 : () => _.onSelect(e.id),
753
+ children: [/* @__PURE__ */ T("span", { children: e.label }), /* @__PURE__ */ E("span", {
760
754
  className: "xeuugli xss6m8b xj0a0fe x153jb6y",
761
755
  children: [
762
756
  m(e.x),
763
757
  " · ",
764
- g(e.y)
758
+ h(e.y)
765
759
  ]
766
760
  })]
767
761
  }, e.id)) })
768
762
  ]
769
763
  });
770
764
  }
771
- function Y({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: c, rangeSelection: u }) {
772
- let f = S(), [p, m] = w(null), h = p === null ? u?.value : {
765
+ function Y({ width: t, scaleX: n, scaleY: r, points: i, xLabel: a, yLabel: o, formatX: c, formatY: l, selection: u, rangeSelection: d }) {
766
+ let f = S(), [p, m] = C(null), h = p === null ? d?.value : {
773
767
  x: [Math.min(p.start.x, p.end.x), Math.max(p.start.x, p.end.x)],
774
768
  y: [Math.min(p.start.y, p.end.y), Math.max(p.start.y, p.end.y)]
775
769
  };
776
- function g(r) {
777
- let i = r.currentTarget.getBoundingClientRect();
770
+ function g(e) {
771
+ let i = e.currentTarget.getBoundingClientRect();
778
772
  return {
779
- x: t.copy().clamp(!0).invert((r.clientX - i.left) / i.width * e),
780
- y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * H)
773
+ x: n.copy().clamp(!0).invert((e.clientX - i.left) / i.width * t),
774
+ y: r.copy().clamp(!0).invert((e.clientY - i.top) / i.height * H)
781
775
  };
782
776
  }
783
- function _(t) {
784
- if (u === void 0 || t.button !== 0 || t.pointerType === "touch") return;
785
- let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * H;
786
- if (r < U || r > e - W || i < G || i > 216) return;
787
- let a = g(t);
788
- t.currentTarget.setPointerCapture(t.pointerId), m({
777
+ function _(e) {
778
+ if (d === void 0 || e.button !== 0 || e.pointerType === "touch") return;
779
+ let n = e.currentTarget.getBoundingClientRect(), r = (e.clientX - n.left) / n.width * t, i = (e.clientY - n.top) / n.height * H;
780
+ if (r < U || r > t - W || i < G || i > 216) return;
781
+ let a = g(e);
782
+ e.currentTarget.setPointerCapture(e.pointerId), m({
789
783
  start: a,
790
784
  end: a,
791
- pointerId: t.pointerId
785
+ pointerId: e.pointerId
792
786
  });
793
787
  }
794
788
  function v(e) {
@@ -803,84 +797,84 @@ function Y({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
803
797
  x: [Math.min(p.start.x, t.x), Math.max(p.start.x, t.x)],
804
798
  y: [Math.min(p.start.y, t.y), Math.max(p.start.y, t.y)]
805
799
  };
806
- m(null), e.currentTarget.releasePointerCapture(e.pointerId), u?.onChange(n);
800
+ m(null), e.currentTarget.releasePointerCapture(e.pointerId), d?.onChange(n);
807
801
  }
808
- return /* @__PURE__ */ D("svg", {
809
- width: e,
802
+ return /* @__PURE__ */ E("svg", {
803
+ width: t,
810
804
  height: H,
811
- viewBox: `0 0 ${e} ${H}`,
805
+ viewBox: `0 0 ${t} ${H}`,
812
806
  "aria-hidden": !0,
813
807
  onPointerDown: _,
814
808
  onPointerMove: v,
815
809
  onPointerUp: y,
816
810
  onPointerCancel: () => m(null),
817
811
  onLostPointerCapture: () => m(null),
818
- ...b.props(l.svg, u !== void 0 && q.brush),
812
+ ...x.props(s.svg, d !== void 0 && q.brush),
819
813
  children: [
820
- /* @__PURE__ */ E("defs", { children: /* @__PURE__ */ E("clipPath", {
814
+ /* @__PURE__ */ T("defs", { children: /* @__PURE__ */ T("clipPath", {
821
815
  id: f,
822
- children: /* @__PURE__ */ E("rect", {
816
+ children: /* @__PURE__ */ T("rect", {
823
817
  x: U,
824
818
  y: G,
825
- width: Math.max(0, e - U - W),
819
+ width: Math.max(0, t - U - W),
826
820
  height: 204
827
821
  })
828
822
  }) }),
829
- t.ticks(5).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
830
- x1: t(e),
831
- x2: t(e),
823
+ n.ticks(5).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
824
+ x1: n(e),
825
+ x2: n(e),
832
826
  y1: G,
833
827
  y2: 216,
834
- ...b.props(l.grid)
835
- }), /* @__PURE__ */ E("text", {
836
- x: t(e),
828
+ ...x.props(s.grid)
829
+ }), /* @__PURE__ */ T("text", {
830
+ x: n(e),
837
831
  y: 234,
838
832
  textAnchor: "middle",
839
- ...b.props(l.label),
840
- children: o(e)
833
+ ...x.props(s.label),
834
+ children: c(e)
841
835
  })] }, e)),
842
- n.ticks(4).map((t) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
836
+ r.ticks(4).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
843
837
  x1: U,
844
- x2: e - W,
845
- y1: n(t),
846
- y2: n(t),
847
- ...b.props(l.grid)
848
- }), /* @__PURE__ */ E("text", {
838
+ x2: t - W,
839
+ y1: r(e),
840
+ y2: r(e),
841
+ ...x.props(s.grid)
842
+ }), /* @__PURE__ */ T("text", {
849
843
  x: 48,
850
- y: n(t) + 4,
844
+ y: r(e) + 4,
851
845
  textAnchor: "end",
852
- ...b.props(l.label),
853
- children: s(t)
854
- })] }, t)),
855
- /* @__PURE__ */ E("text", {
856
- x: (U + e - W) / 2,
846
+ ...x.props(s.label),
847
+ children: l(e)
848
+ })] }, e)),
849
+ /* @__PURE__ */ T("text", {
850
+ x: (U + t - W) / 2,
857
851
  y: 256,
858
852
  textAnchor: "middle",
859
- ...b.props(l.label),
860
- children: i
853
+ ...x.props(s.label),
854
+ children: a
861
855
  }),
862
- /* @__PURE__ */ E("text", {
856
+ /* @__PURE__ */ T("text", {
863
857
  x: 12,
864
858
  y: 108,
865
859
  textAnchor: "middle",
866
860
  transform: "rotate(-90 12 108)",
867
- ...b.props(l.label),
868
- children: a
861
+ ...x.props(s.label),
862
+ children: o
869
863
  }),
870
- /* @__PURE__ */ D("g", {
864
+ /* @__PURE__ */ E("g", {
871
865
  clipPath: `url(#${f})`,
872
- children: [h != null && /* @__PURE__ */ E("rect", {
873
- x: t(h.x[0]),
874
- y: n(h.y[1]),
875
- width: t(h.x[1]) - t(h.x[0]),
876
- height: n(h.y[0]) - n(h.y[1]),
866
+ children: [h != null && /* @__PURE__ */ T("rect", {
867
+ x: n(h.x[0]),
868
+ y: r(h.y[1]),
869
+ width: n(h.x[1]) - n(h.x[0]),
870
+ height: r(h.y[0]) - r(h.y[1]),
877
871
  className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
878
- }), c === void 0 && r.map((e) => /* @__PURE__ */ E("circle", {
879
- cx: t(e.x),
880
- cy: n(e.y),
872
+ }), u === void 0 && i.map((t) => /* @__PURE__ */ T("circle", {
873
+ cx: n(t.x),
874
+ cy: r(t.y),
881
875
  r: 4,
882
- fill: d[e.tone]
883
- }, e.id))]
876
+ fill: e[t.tone]
877
+ }, t.id))]
884
878
  })
885
879
  ]
886
880
  });
@@ -890,14 +884,14 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
890
884
  x: t,
891
885
  y: n
892
886
  };
893
- return /* @__PURE__ */ D("fieldset", {
887
+ return /* @__PURE__ */ E("fieldset", {
894
888
  className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
895
889
  children: [
896
- /* @__PURE__ */ E("legend", {
890
+ /* @__PURE__ */ T("legend", {
897
891
  className: "x153jb6y xy8obcc x1jfksii",
898
892
  children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
899
893
  }),
900
- /* @__PURE__ */ D(y.Root, {
894
+ /* @__PURE__ */ E(b.Root, {
901
895
  value: s.x,
902
896
  min: t[0],
903
897
  max: t[1],
@@ -908,28 +902,28 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
908
902
  x: t,
909
903
  y: s.y
910
904
  }),
911
- children: [/* @__PURE__ */ D("div", {
905
+ children: [/* @__PURE__ */ E("div", {
912
906
  className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
913
- children: [/* @__PURE__ */ E(y.Label, { children: r }), /* @__PURE__ */ D("span", { children: [
907
+ children: [/* @__PURE__ */ T(b.Label, { children: r }), /* @__PURE__ */ E("span", { children: [
914
908
  a(s.x[0]),
915
909
  " – ",
916
910
  a(s.x[1])
917
911
  ] })]
918
- }), /* @__PURE__ */ E(y.Control, { children: /* @__PURE__ */ D(y.Track, { children: [
919
- /* @__PURE__ */ E(y.Indicator, {}),
920
- /* @__PURE__ */ E(y.Thumb, {
912
+ }), /* @__PURE__ */ T(b.Control, { children: /* @__PURE__ */ E(b.Track, { children: [
913
+ /* @__PURE__ */ T(b.Indicator, {}),
914
+ /* @__PURE__ */ T(b.Thumb, {
921
915
  index: 0,
922
916
  "aria-label": `${r} minimum`,
923
917
  getAriaValueText: (e, t) => a(t)
924
918
  }),
925
- /* @__PURE__ */ E(y.Thumb, {
919
+ /* @__PURE__ */ T(b.Thumb, {
926
920
  index: 1,
927
921
  "aria-label": `${r} maximum`,
928
922
  getAriaValueText: (e, t) => a(t)
929
923
  })
930
924
  ] }) })]
931
925
  }),
932
- /* @__PURE__ */ D(y.Root, {
926
+ /* @__PURE__ */ E(b.Root, {
933
927
  value: s.y,
934
928
  min: n[0],
935
929
  max: n[1],
@@ -940,28 +934,28 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
940
934
  x: s.x,
941
935
  y: t
942
936
  }),
943
- children: [/* @__PURE__ */ D("div", {
937
+ children: [/* @__PURE__ */ E("div", {
944
938
  className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
945
- children: [/* @__PURE__ */ E(y.Label, { children: i }), /* @__PURE__ */ D("span", { children: [
939
+ children: [/* @__PURE__ */ T(b.Label, { children: i }), /* @__PURE__ */ E("span", { children: [
946
940
  o(s.y[0]),
947
941
  " – ",
948
942
  o(s.y[1])
949
943
  ] })]
950
- }), /* @__PURE__ */ E(y.Control, { children: /* @__PURE__ */ D(y.Track, { children: [
951
- /* @__PURE__ */ E(y.Indicator, {}),
952
- /* @__PURE__ */ E(y.Thumb, {
944
+ }), /* @__PURE__ */ T(b.Control, { children: /* @__PURE__ */ E(b.Track, { children: [
945
+ /* @__PURE__ */ T(b.Indicator, {}),
946
+ /* @__PURE__ */ T(b.Thumb, {
953
947
  index: 0,
954
948
  "aria-label": `${i} minimum`,
955
949
  getAriaValueText: (e, t) => o(t)
956
950
  }),
957
- /* @__PURE__ */ E(y.Thumb, {
951
+ /* @__PURE__ */ T(b.Thumb, {
958
952
  index: 1,
959
953
  "aria-label": `${i} maximum`,
960
954
  getAriaValueText: (e, t) => o(t)
961
955
  })
962
956
  ] }) })]
963
957
  }),
964
- /* @__PURE__ */ E(v, {
958
+ /* @__PURE__ */ T(y, {
965
959
  type: "button",
966
960
  disabled: e.value === null,
967
961
  onClick: () => e.onChange(null),
@@ -971,9 +965,9 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
971
965
  });
972
966
  }
973
967
  function Z({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
974
- if (!m(t) || !m(n)) return "Scatter domains must contain finite, increasing endpoints.";
975
- if (e.length > 1e3) return `This plot exceeds the ${ge}-point render limit. Supply a smaller, labelled sample.`;
976
- if (!p(e)) return "Scatter points must have unique identifiers.";
968
+ if (!h(t) || !h(n)) return "Scatter domains must contain finite, increasing endpoints.";
969
+ if (e.length > 1e3) return `This plot exceeds the ${K}-point render limit. Supply a smaller, labelled sample.`;
970
+ if (!m(e)) return "Scatter points must have unique identifiers.";
977
971
  if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
978
972
  if (e.some((e) => {
979
973
  let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
@@ -994,7 +988,7 @@ var $ = {
994
988
  pointsPerSeries: 2e3,
995
989
  markers: 200,
996
990
  panels: 12
997
- }, _e = .01, ve = [
991
+ }, ve = .01, ye = [
998
992
  "series1",
999
993
  "series2",
1000
994
  "series3",
@@ -1002,13 +996,13 @@ var $ = {
1002
996
  "series5",
1003
997
  "series6"
1004
998
  ];
1005
- function ye({ series: e, isStacked: t, markers: n }) {
999
+ function be({ series: e, isStacked: t, markers: n }) {
1006
1000
  let r = e[0]?.points.map((e) => e.timestamp) ?? [];
1007
1001
  if (e.length > $.series || r.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
1008
- if (!p(e) || !p(n)) return "Series and markers require unique identifiers.";
1002
+ if (!m(e) || !m(n)) return "Series and markers require unique identifiers.";
1009
1003
  for (let n of e) {
1010
1004
  if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
1011
- let e = Ce({
1005
+ let e = we({
1012
1006
  points: n.points,
1013
1007
  timestamps: r,
1014
1008
  isStacked: t
@@ -1026,7 +1020,7 @@ function ye({ series: e, isStacked: t, markers: n }) {
1026
1020
  if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
1027
1021
  if (t && r.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
1028
1022
  }
1029
- function be({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1023
+ function xe({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1030
1024
  return JSON.stringify([
1031
1025
  n,
1032
1026
  r,
@@ -1046,15 +1040,15 @@ function be({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1046
1040
  ])
1047
1041
  ]);
1048
1042
  }
1049
- function xe(e, t, n = !1) {
1043
+ function Se(e, t, n = !1) {
1050
1044
  if (e !== t) return [e, t];
1051
- let r = Math.max(1, Math.abs(e) * _e), i = n ? 0 : e - r, a = t + r;
1045
+ let r = Math.max(1, Math.abs(e) * ve), i = n ? 0 : e - r, a = t + r;
1052
1046
  return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
1053
1047
  }
1054
- function Se(e, t) {
1048
+ function Ce(e, t) {
1055
1049
  let n = e.filter((e) => e.tone === void 0);
1056
1050
  return e.map((r, i) => {
1057
- let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? ve[a % ve.length] ?? "series1", s = r.points.map((n, r) => {
1051
+ let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? ye[a % ye.length] ?? "series1", s = r.points.map((n, r) => {
1058
1052
  let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
1059
1053
  return {
1060
1054
  ...n,
@@ -1069,7 +1063,7 @@ function Se(e, t) {
1069
1063
  };
1070
1064
  });
1071
1065
  }
1072
- function Ce({ points: e, timestamps: t, isStacked: n }) {
1066
+ function we({ points: e, timestamps: t, isStacked: n }) {
1073
1067
  for (let [r, i] of e.entries()) {
1074
1068
  let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
1075
1069
  if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
@@ -1078,49 +1072,49 @@ function Ce({ points: e, timestamps: t, isStacked: n }) {
1078
1072
  }
1079
1073
  }
1080
1074
  // packages/charts/src/cartesian/time-series-line.tsx
1081
- function we({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
1082
- return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(j, {
1083
- data: [...e.points],
1075
+ function Te({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }) {
1076
+ return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(A, {
1077
+ data: [...t.points],
1084
1078
  defined: (e) => e.value !== null,
1085
- x: (e) => t(e.timestamp),
1086
- y: (e) => n((e.value ?? 0) + e.base),
1087
- stroke: d[e.tone],
1088
- ...b.props(l.mark)
1089
- }), e.points.filter((t, n) => {
1090
- if (t.value === null) return !1;
1091
- let i = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
1092
- return e.points.length === 1 || i || t.timestamp === r;
1093
- }).map((r) => /* @__PURE__ */ E("circle", {
1094
- cx: t(r.timestamp),
1095
- cy: n((r.value ?? 0) + r.base),
1096
- r: i,
1097
- fill: d[e.tone]
1098
- }, r.timestamp))] });
1079
+ x: (e) => n(e.timestamp),
1080
+ y: (e) => r((e.value ?? 0) + e.base),
1081
+ stroke: e[t.tone],
1082
+ ...x.props(s.mark)
1083
+ }), t.points.filter((e, n) => {
1084
+ if (e.value === null) return !1;
1085
+ let r = t.points[n - 1]?.value === null || t.points[n + 1]?.value === null;
1086
+ return t.points.length === 1 || r || e.timestamp === i;
1087
+ }).map((i) => /* @__PURE__ */ T("circle", {
1088
+ cx: n(i.timestamp),
1089
+ cy: r((i.value ?? 0) + i.base),
1090
+ r: a,
1091
+ fill: e[t.tone]
1092
+ }, i.timestamp))] });
1099
1093
  }
1100
1094
  // packages/charts/src/cartesian/sparkline.tsx
1101
- function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1102
- let o = S(), s = S(), c = Ee({
1095
+ function Ee({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1096
+ let o = S(), s = S(), c = De({
1103
1097
  title: e,
1104
1098
  summary: t,
1105
1099
  unit: n,
1106
1100
  series: i,
1107
1101
  valueDomain: a
1108
1102
  }), l = i.points.some((e) => e.value !== null);
1109
- if (c !== void 0 || !l) return /* @__PURE__ */ E("span", {
1103
+ if (c !== void 0 || !l) return /* @__PURE__ */ T("span", {
1110
1104
  role: "img",
1111
1105
  "aria-label": `${e}. ${t} Values in ${n}; timestamps in ${r}. ${c ?? "No recorded values. Missing observations remain unavailable."}`,
1112
1106
  title: c ?? "No recorded values",
1113
1107
  className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
1114
1108
  children: c === void 0 ? "No data" : "Invalid trend"
1115
1109
  });
1116
- let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = k({
1117
- domain: [...xe(u, d)],
1110
+ let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = O({
1111
+ domain: [...Se(u, d)],
1118
1112
  range: [3, 125]
1119
- }), p = k({
1113
+ }), p = O({
1120
1114
  domain: [...a],
1121
1115
  range: [29, 3]
1122
- }), m = Se([i], !1)[0];
1123
- return /* @__PURE__ */ D("svg", {
1116
+ }), m = Ce([i], !1)[0];
1117
+ return /* @__PURE__ */ E("svg", {
1124
1118
  role: "img",
1125
1119
  "aria-labelledby": o,
1126
1120
  "aria-describedby": s,
@@ -1130,11 +1124,11 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1130
1124
  height: 32,
1131
1125
  className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
1132
1126
  children: [
1133
- /* @__PURE__ */ E("title", {
1127
+ /* @__PURE__ */ T("title", {
1134
1128
  id: o,
1135
1129
  children: e
1136
1130
  }),
1137
- /* @__PURE__ */ D("desc", {
1131
+ /* @__PURE__ */ E("desc", {
1138
1132
  id: s,
1139
1133
  children: [
1140
1134
  t,
@@ -1152,7 +1146,7 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1152
1146
  "."
1153
1147
  ]
1154
1148
  }),
1155
- m !== void 0 && /* @__PURE__ */ E(we, {
1149
+ m !== void 0 && /* @__PURE__ */ T(Te, {
1156
1150
  series: m,
1157
1151
  x: f,
1158
1152
  y: p,
@@ -1161,10 +1155,10 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1161
1155
  ]
1162
1156
  });
1163
1157
  }
1164
- function Ee({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1158
+ function De({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1165
1159
  if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
1166
- if (!m(i)) return "The displayed value domain must have finite, increasing bounds.";
1167
- let a = ye({
1160
+ if (!h(i)) return "The displayed value domain must have finite, increasing bounds.";
1161
+ let a = be({
1168
1162
  series: [r],
1169
1163
  isStacked: !1,
1170
1164
  markers: []
@@ -1173,7 +1167,7 @@ function Ee({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1173
1167
  if (r.points.some((e) => e.value !== null && (e.value < i[0] || e.value > i[1]))) return "Every recorded value must be inside the declared value domain.";
1174
1168
  }
1175
1169
  // packages/charts/src/cartesian/time-series.tsx
1176
- var De = {
1170
+ var Oe = {
1177
1171
  timeAxis: {
1178
1172
  k1xSpc: "x78zum5",
1179
1173
  kjj79g: "x1qughib",
@@ -1194,109 +1188,109 @@ var De = {
1194
1188
  "--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
1195
1189
  }]
1196
1190
  };
1197
- function Oe(e) {
1198
- return /* @__PURE__ */ E(Fe, {
1191
+ function ke(e) {
1192
+ return /* @__PURE__ */ T(Ie, {
1199
1193
  ...e,
1200
1194
  kind: "line",
1201
1195
  isStacked: !1
1202
1196
  });
1203
1197
  }
1204
- function ke({ isStacked: e = !1, ...t }) {
1205
- return /* @__PURE__ */ E(Fe, {
1198
+ function Ae({ isStacked: e = !1, ...t }) {
1199
+ return /* @__PURE__ */ T(Ie, {
1206
1200
  ...t,
1207
1201
  kind: "area",
1208
1202
  isStacked: e
1209
1203
  });
1210
1204
  }
1211
- function Ae(e) {
1212
- return /* @__PURE__ */ E(je, { ...e });
1205
+ function je(e) {
1206
+ return /* @__PURE__ */ T(Me, { ...e });
1213
1207
  }
1214
- function je({ title: n, description: r, series: i, actions: a, report: o, height: s = 180, showTimeAxis: c = !0 }) {
1215
- let d = S(), f = Se(i.map((e) => ({
1208
+ function Me({ title: e, description: r, series: i, actions: a, report: o, height: c = 180, showTimeAxis: l = !0 }) {
1209
+ let u = S(), d = Ce(i.map((e) => ({
1216
1210
  ...e,
1217
1211
  points: []
1218
1212
  })), !1);
1219
- return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */ E(h, {
1220
- title: n,
1213
+ return !Number.isFinite(c) || c < 48 ? /* @__PURE__ */ T(g, {
1214
+ title: e,
1221
1215
  description: r,
1222
1216
  report: o,
1223
1217
  message: "Chart height must be at least 48 pixels."
1224
- }) : /* @__PURE__ */ E("div", {
1218
+ }) : /* @__PURE__ */ T("div", {
1225
1219
  "aria-hidden": !0,
1226
1220
  inert: !0,
1227
1221
  className: "xeuugli",
1228
- children: /* @__PURE__ */ E(u, {
1229
- title: n,
1222
+ children: /* @__PURE__ */ T(f, {
1223
+ title: e,
1230
1224
  description: r,
1231
1225
  report: o,
1232
- series: f,
1226
+ series: d,
1233
1227
  actions: a,
1234
- children: /* @__PURE__ */ D("div", {
1228
+ children: /* @__PURE__ */ E("div", {
1235
1229
  className: "xrvj5dj x1n8ia3y",
1236
- children: [/* @__PURE__ */ E(oe, {
1237
- id: d,
1230
+ children: [/* @__PURE__ */ T(le, {
1231
+ id: u,
1238
1232
  label: void 0,
1239
- legend: f,
1233
+ legend: d,
1240
1234
  rows: [],
1241
1235
  x: 0,
1242
1236
  width: 0,
1243
1237
  source: void 0,
1244
1238
  hasSeriesSummary: o?.seriesValues !== void 0
1245
- }), /* @__PURE__ */ D("div", {
1246
- ...b.props(l.plot),
1247
- children: [/* @__PURE__ */ E(t, { height: s - 16 }), c && /* @__PURE__ */ D("div", {
1239
+ }), /* @__PURE__ */ E("div", {
1240
+ ...x.props(s.plot),
1241
+ children: [/* @__PURE__ */ T(t, { height: c - 16 }), l && /* @__PURE__ */ E("div", {
1248
1242
  className: "x78zum5 x1qughib x8zbtdt x1c87qhr xy8obcc xas2l8k x153jb6y xss6m8b",
1249
- children: [/* @__PURE__ */ E(e, { width: "8ch" }), /* @__PURE__ */ E(e, { width: "8ch" })]
1243
+ children: [/* @__PURE__ */ T(n, { width: "8ch" }), /* @__PURE__ */ T(n, { width: "8ch" })]
1250
1244
  })]
1251
1245
  })]
1252
1246
  })
1253
1247
  })
1254
1248
  });
1255
1249
  }
1256
- function Me({ charts: e, ...t }) {
1257
- let n = ee(null), [r, i] = w(), a = JSON.stringify(e.map((e) => [
1250
+ function Ne({ charts: e, ...t }) {
1251
+ let n = ne(null), [r, i] = C(), a = JSON.stringify(e.map((e) => [
1258
1252
  e.id,
1259
1253
  e.title,
1260
- be({
1254
+ xe({
1261
1255
  series: e.series,
1262
1256
  markers: e.markers ?? [],
1263
1257
  timestampUnit: t.timestampUnit,
1264
1258
  isStacked: !1
1265
1259
  })
1266
1260
  ])), o = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), s = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === o);
1267
- if (r !== void 0 && r.signature !== a && i(void 0), x(() => {
1261
+ if (r !== void 0 && r.signature !== a && i(void 0), ee(() => {
1268
1262
  function e(e) {
1269
1263
  e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
1270
1264
  }
1271
1265
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1272
- }, []), !s || !p(e)) return /* @__PURE__ */ E(h, {
1266
+ }, []), !s || !m(e)) return /* @__PURE__ */ T(g, {
1273
1267
  title: "Small multiples",
1274
1268
  message: "Charts need unique identifiers and aligned observation timestamps."
1275
1269
  });
1276
- if (e.length > $.panels) return /* @__PURE__ */ E(h, {
1270
+ if (e.length > $.panels) return /* @__PURE__ */ T(g, {
1277
1271
  title: "Small multiples",
1278
1272
  message: `Choose at most ${$.panels} panels.`
1279
1273
  });
1280
- if (e.length === 0) return /* @__PURE__ */ E(u, {
1274
+ if (e.length === 0) return /* @__PURE__ */ T(f, {
1281
1275
  title: "Small multiples",
1282
- children: /* @__PURE__ */ E("p", {
1276
+ children: /* @__PURE__ */ T("p", {
1283
1277
  className: "x153jb6y",
1284
1278
  children: "No charts"
1285
1279
  })
1286
1280
  });
1287
1281
  let c = Math.max(52, ...e.flatMap((e) => e.series.flatMap((t) => t.points.flatMap((t) => t.value === null || !Number.isFinite(t.value) ? [] : [(e.formatTick ?? e.formatValue)(t.value).length * 7 + 12])))), l = e.every((e) => e.report !== void 0);
1288
- return /* @__PURE__ */ E("div", {
1282
+ return /* @__PURE__ */ T("div", {
1289
1283
  ref: n,
1290
1284
  ...{
1291
1285
  0: { className: "xrvj5dj x1j825kq" },
1292
1286
  1: { className: "xrvj5dj xxhr3t" }
1293
1287
  }[!!l | 0],
1294
- children: e.map((n, o) => /* @__PURE__ */ E("div", {
1288
+ children: e.map((n, o) => /* @__PURE__ */ T("div", {
1295
1289
  ...{
1296
1290
  0: {},
1297
1291
  1: { className: "x1y332i5" }
1298
1292
  }[!!(l && o > 0) | 0],
1299
- children: /* @__PURE__ */ E(Fe, {
1293
+ children: /* @__PURE__ */ T(Ie, {
1300
1294
  ...t,
1301
1295
  title: n.title,
1302
1296
  description: n.description,
@@ -1322,25 +1316,25 @@ function Me({ charts: e, ...t }) {
1322
1316
  }, n.id))
1323
1317
  });
1324
1318
  }
1325
- function Ne({ charts: e, height: t }) {
1326
- if (!p(e) || e.length > $.panels) return /* @__PURE__ */ E(h, {
1319
+ function Pe({ charts: e, height: t }) {
1320
+ if (!m(e) || e.length > $.panels) return /* @__PURE__ */ T(g, {
1327
1321
  title: "Small multiples",
1328
1322
  message: `Choose at most ${$.panels} panels with unique identifiers.`
1329
1323
  });
1330
1324
  let n = e.every((e) => e.report !== void 0);
1331
- return /* @__PURE__ */ E("div", {
1325
+ return /* @__PURE__ */ T("div", {
1332
1326
  "aria-hidden": !0,
1333
1327
  inert: !0,
1334
1328
  ...{
1335
1329
  0: { className: "xrvj5dj x1j825kq" },
1336
1330
  1: { className: "xrvj5dj xxhr3t" }
1337
1331
  }[!!n | 0],
1338
- children: e.map((r, i) => /* @__PURE__ */ E("div", {
1332
+ children: e.map((r, i) => /* @__PURE__ */ T("div", {
1339
1333
  ...{
1340
1334
  0: {},
1341
1335
  1: { className: "x1y332i5" }
1342
1336
  }[!!(n && i > 0) | 0],
1343
- children: /* @__PURE__ */ E(je, {
1337
+ children: /* @__PURE__ */ T(Me, {
1344
1338
  ...r,
1345
1339
  height: t,
1346
1340
  showTimeAxis: i === e.length - 1
@@ -1348,92 +1342,92 @@ function Ne({ charts: e, height: t }) {
1348
1342
  }, r.id))
1349
1343
  });
1350
1344
  }
1351
- var Pe = {
1345
+ var Fe = {
1352
1346
  "x-default-marker": "x-default-marker",
1353
1347
  $$css: !0
1354
1348
  };
1355
- function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, formatTick: o = a, markers: s = [], height: c = 180, actions: f, report: p, kind: m, isStacked: v, sharedInspection: y, axisWidth: T, showTimeAxis: O = !0 }) {
1356
- let A = !Number.isFinite(c) || c < 48 ? "Chart height must be at least 48 pixels." : ye({
1357
- series: n,
1358
- isStacked: v,
1359
- markers: s
1360
- }), j = C(() => A === void 0 ? Se(n, v) : [], [
1361
- n,
1362
- v,
1363
- A
1364
- ]), N = j[0]?.points ?? [], { ref: P, width: re, element: ie } = _(), se = ee(null), [ce, le] = w(), ue = N.find((e) => e.timestamp === ce) ?? N[0], [de, fe] = w(), F = be({
1365
- series: n,
1366
- markers: s,
1367
- timestampUnit: r,
1368
- isStacked: v
1369
- }), I = y === void 0 ? de?.signature === F ? de : void 0 : y.value, L = y === void 0 || y.isSource ? I : void 0, pe = p?.seriesValues !== void 0, me = S();
1370
- de !== void 0 && (de.signature !== F || A !== void 0) && fe(void 0);
1349
+ function Ie({ title: t, description: n, series: r, timestampUnit: i, formatTimestamp: a, formatValue: o, formatTick: c = o, markers: l = [], height: u = 180, actions: d, report: p, kind: m, isStacked: h, sharedInspection: y, axisWidth: b, showTimeAxis: w = !0 }) {
1350
+ let D = !Number.isFinite(u) || u < 48 ? "Chart height must be at least 48 pixels." : be({
1351
+ series: r,
1352
+ isStacked: h,
1353
+ markers: l
1354
+ }), k = te(() => D === void 0 ? Ce(r, h) : [], [
1355
+ r,
1356
+ h,
1357
+ D
1358
+ ]), A = k[0]?.points ?? [], { ref: oe, width: j, element: M } = v(), se = ne(null), [ue, N] = C(), de = A.find((e) => e.timestamp === ue) ?? A[0], [P, fe] = C(), F = xe({
1359
+ series: r,
1360
+ markers: l,
1361
+ timestampUnit: i,
1362
+ isStacked: h
1363
+ }), I = y === void 0 ? P?.signature === F ? P : void 0 : y.value, L = y === void 0 || y.isSource ? I : void 0, pe = p?.seriesValues !== void 0, me = S();
1364
+ P !== void 0 && (P.signature !== F || D !== void 0) && fe(void 0);
1371
1365
  let he = y !== void 0;
1372
- if (x(() => {
1366
+ if (ee(() => {
1373
1367
  if (he) return;
1374
1368
  function e(e) {
1375
1369
  e.target instanceof Node && se.current?.contains(e.target) !== !0 && fe(void 0);
1376
1370
  }
1377
1371
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1378
- }, [he]), A !== void 0) return /* @__PURE__ */ E(h, {
1379
- title: e,
1380
- description: t,
1372
+ }, [he]), D !== void 0) return /* @__PURE__ */ T(g, {
1373
+ title: t,
1374
+ description: n,
1381
1375
  report: p,
1382
- message: A
1376
+ message: D
1383
1377
  });
1384
- if (N.length === 0) return /* @__PURE__ */ E(u, {
1385
- title: e,
1386
- description: t,
1387
- actions: f,
1378
+ if (A.length === 0) return /* @__PURE__ */ T(f, {
1379
+ title: t,
1380
+ description: n,
1381
+ actions: d,
1388
1382
  report: p,
1389
- series: j,
1390
- children: /* @__PURE__ */ E("p", {
1383
+ series: k,
1384
+ children: /* @__PURE__ */ T("p", {
1391
1385
  className: "x153jb6y",
1392
1386
  children: "No observations"
1393
1387
  })
1394
1388
  });
1395
- let R = c - 28, z = R + 12, B = N[0]?.timestamp ?? 0, V = N.at(-1)?.timestamp ?? B, H = j.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), U = m === "area" ? Math.min(0, ...H) : Math.min(...H), W = m === "area" ? Math.max(0, ...H) : Math.max(...H), G = H.length === 0 ? 0 : U, ge = H.length === 0 ? 1 : W, K = k({
1396
- domain: [...xe(G, ge, m === "area")],
1389
+ let R = u - 28, ge = R + 12, z = A[0]?.timestamp ?? 0, B = A.at(-1)?.timestamp ?? z, V = k.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), H = m === "area" ? Math.min(0, ...V) : Math.min(...V), U = m === "area" ? Math.max(0, ...V) : Math.max(...V), W = V.length === 0 ? 0 : H, G = V.length === 0 ? 1 : U, K = O({
1390
+ domain: [...Se(W, G, m === "area")],
1397
1391
  range: [R, 12]
1398
- }), q = K.ticks(3), J = T ?? Math.max(44, ...q.map((e) => o(e).length * 7 + 12)), Y = Math.max(J + 1, re - 16), X = k({
1399
- domain: [...xe(B, V)],
1400
- range: [J, Y]
1392
+ }), _e = K.ticks(3), q = b ?? Math.max(44, ..._e.map((e) => c(e).length * 7 + 12)), J = Math.max(q + 1, j - 16), Y = O({
1393
+ domain: [...Se(z, B)],
1394
+ range: [q, J]
1401
1395
  });
1402
- function Z(e) {
1403
- let t = ie?.getBoundingClientRect();
1396
+ function X(e) {
1397
+ let t = M?.getBoundingClientRect();
1404
1398
  if (t === void 0) return;
1405
- let n = X.invert(e - t.left), r = N.find((e, t) => {
1406
- let r = N[t + 1];
1399
+ let n = Y.invert(e - t.left), r = A.find((e, t) => {
1400
+ let r = A[t + 1];
1407
1401
  return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
1408
1402
  });
1409
- r !== void 0 && Q({
1403
+ r !== void 0 && Z({
1410
1404
  signature: F,
1411
1405
  timestamp: r.timestamp,
1412
1406
  source: "pointer"
1413
1407
  });
1414
1408
  }
1415
- function Q(e) {
1409
+ function Z(e) {
1416
1410
  y === void 0 ? fe(e) : y.onChange(e);
1417
1411
  }
1418
- function $(e) {
1412
+ function Q(e) {
1419
1413
  if (e.altKey || e.ctrlKey || e.metaKey) return;
1420
- let t = N.findIndex((e) => e.timestamp === ue?.timestamp), n = {
1421
- ArrowRight: Math.min(N.length - 1, t + 1),
1414
+ let t = A.findIndex((e) => e.timestamp === de?.timestamp), n = {
1415
+ ArrowRight: Math.min(A.length - 1, t + 1),
1422
1416
  ArrowLeft: Math.max(0, t - 1),
1423
1417
  Home: 0,
1424
- End: N.length - 1
1418
+ End: A.length - 1
1425
1419
  };
1426
1420
  switch (e.key) {
1427
1421
  case "Escape":
1428
- e.preventDefault(), e.stopPropagation(), Q(void 0);
1422
+ e.preventDefault(), e.stopPropagation(), Z(void 0);
1429
1423
  break;
1430
1424
  case "ArrowRight":
1431
1425
  case "ArrowLeft":
1432
1426
  case "Home":
1433
1427
  case "End": {
1434
1428
  e.preventDefault();
1435
- let t = N[n[e.key]];
1436
- t !== void 0 && (le(t.timestamp), Q({
1429
+ let t = A[n[e.key]];
1430
+ t !== void 0 && (N(t.timestamp), Z({
1437
1431
  signature: F,
1438
1432
  timestamp: t.timestamp,
1439
1433
  source: "keyboard"
@@ -1442,85 +1436,85 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1442
1436
  }
1443
1437
  }
1444
1438
  }
1445
- return /* @__PURE__ */ E("div", {
1439
+ return /* @__PURE__ */ T("div", {
1446
1440
  ref: se,
1447
1441
  className: "xeuugli",
1448
- children: /* @__PURE__ */ D(u, {
1449
- title: pe ? e : /* @__PURE__ */ E(ae, {
1450
- title: e,
1451
- detail: L === void 0 ? void 0 : i(L.timestamp)
1442
+ children: /* @__PURE__ */ E(f, {
1443
+ title: pe ? t : /* @__PURE__ */ T(ce, {
1444
+ title: t,
1445
+ detail: L === void 0 ? void 0 : a(L.timestamp)
1452
1446
  }),
1453
- description: t,
1447
+ description: n,
1454
1448
  report: p,
1455
- series: j,
1456
- actions: f,
1457
- children: [/* @__PURE__ */ E(M, { children: /* @__PURE__ */ D("table", {
1449
+ series: k,
1450
+ actions: d,
1451
+ children: [/* @__PURE__ */ T(ae, { children: /* @__PURE__ */ E("table", {
1458
1452
  className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
1459
1453
  children: [
1460
- /* @__PURE__ */ D("caption", { children: [e, " observations"] }),
1461
- /* @__PURE__ */ E("thead", { children: /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ D("th", {
1454
+ /* @__PURE__ */ E("caption", { children: [t, " observations"] }),
1455
+ /* @__PURE__ */ T("thead", { children: /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ E("th", {
1462
1456
  scope: "col",
1463
1457
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1464
1458
  children: [
1465
1459
  "Time (",
1466
- r,
1460
+ i,
1467
1461
  ")"
1468
1462
  ]
1469
- }), j.map((e) => /* @__PURE__ */ E("th", {
1463
+ }), k.map((e) => /* @__PURE__ */ T("th", {
1470
1464
  scope: "col",
1471
1465
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1472
1466
  children: e.label
1473
1467
  }, e.id))] }) }),
1474
- /* @__PURE__ */ E("tbody", { children: N.map((e, t) => /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ E("th", {
1468
+ /* @__PURE__ */ T("tbody", { children: A.map((e, t) => /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ T("th", {
1475
1469
  scope: "row",
1476
1470
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1477
- children: i(e.timestamp)
1478
- }), j.map((e) => /* @__PURE__ */ E("td", {
1471
+ children: a(e.timestamp)
1472
+ }), k.map((e) => /* @__PURE__ */ T("td", {
1479
1473
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1480
- children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
1474
+ children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : o(e.points[t].value)
1481
1475
  }, e.id))] }, e.timestamp)) })
1482
1476
  ]
1483
- }) }), /* @__PURE__ */ D("div", {
1477
+ }) }), /* @__PURE__ */ E("div", {
1484
1478
  className: "xrvj5dj x1n8ia3y",
1485
1479
  children: [
1486
- /* @__PURE__ */ E(oe, {
1480
+ /* @__PURE__ */ T(le, {
1487
1481
  id: me,
1488
- label: L === void 0 ? void 0 : i(L.timestamp),
1489
- legend: j.map(({ id: e, label: t, tone: n }) => ({
1482
+ label: L === void 0 ? void 0 : a(L.timestamp),
1483
+ legend: k.map(({ id: e, label: t, tone: n }) => ({
1490
1484
  id: e,
1491
1485
  label: t,
1492
1486
  tone: n
1493
1487
  })),
1494
- rows: j.map((e) => {
1488
+ rows: k.map((e) => {
1495
1489
  let t = e.points.find((e) => e.timestamp === L?.timestamp);
1496
1490
  return {
1497
1491
  id: e.id,
1498
1492
  label: e.label,
1499
1493
  tone: e.tone,
1500
- value: t?.value === null || t === void 0 ? "Unavailable" : a(t.value)
1494
+ value: t?.value === null || t === void 0 ? "Unavailable" : o(t.value)
1501
1495
  };
1502
1496
  }),
1503
- x: X(I?.timestamp ?? B),
1504
- width: re,
1497
+ x: Y(I?.timestamp ?? z),
1498
+ width: j,
1505
1499
  source: L?.source,
1506
- notes: s.filter((e) => e.timestamp === L?.timestamp).map((e) => e.label),
1500
+ notes: l.filter((e) => e.timestamp === L?.timestamp).map((e) => e.label),
1507
1501
  hasSeriesSummary: pe
1508
1502
  }),
1509
- /* @__PURE__ */ D("div", {
1510
- ref: P,
1511
- ...b.props(l.plot),
1512
- children: [/* @__PURE__ */ D("svg", {
1503
+ /* @__PURE__ */ E("div", {
1504
+ ref: oe,
1505
+ ...x.props(s.plot),
1506
+ children: [/* @__PURE__ */ E("svg", {
1513
1507
  role: "img",
1514
- "aria-label": `${e}. Use arrow keys to inspect observations.`,
1508
+ "aria-label": `${t}. Use arrow keys to inspect observations.`,
1515
1509
  "aria-describedby": me,
1516
1510
  tabIndex: 0,
1517
- viewBox: `0 0 ${re} ${z}`,
1518
- height: z,
1519
- onKeyDown: $,
1511
+ viewBox: `0 0 ${j} ${ge}`,
1512
+ height: ge,
1513
+ onKeyDown: Q,
1520
1514
  onFocus: (e) => {
1521
1515
  if (e.currentTarget.matches(":focus-visible")) {
1522
- let e = I?.timestamp ?? B;
1523
- le(e), Q({
1516
+ let e = I?.timestamp ?? z;
1517
+ N(e), Z({
1524
1518
  signature: F,
1525
1519
  timestamp: e,
1526
1520
  source: "keyboard"
@@ -1528,90 +1522,90 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1528
1522
  }
1529
1523
  },
1530
1524
  onPointerMove: (e) => {
1531
- e.pointerType === "mouse" && Z(e.clientX);
1525
+ e.pointerType === "mouse" && X(e.clientX);
1532
1526
  },
1533
- onPointerDown: (e) => Z(e.clientX),
1527
+ onPointerDown: (e) => X(e.clientX),
1534
1528
  onPointerLeave: (e) => {
1535
- e.pointerType === "mouse" && I?.source === "pointer" && Q(void 0);
1529
+ e.pointerType === "mouse" && I?.source === "pointer" && Z(void 0);
1536
1530
  },
1537
- onBlur: () => Q(void 0),
1538
- ...b.props(l.svg, l.inspectable, Pe),
1531
+ onBlur: () => Z(void 0),
1532
+ ...x.props(s.svg, s.inspectable, Fe),
1539
1533
  children: [
1540
- q.map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
1541
- x1: J,
1542
- x2: Y,
1534
+ _e.map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
1535
+ x1: q,
1536
+ x2: J,
1543
1537
  y1: K(e),
1544
1538
  y2: K(e),
1545
- ...b.props(l.grid)
1546
- }), /* @__PURE__ */ E("text", {
1547
- x: J - 8,
1539
+ ...x.props(s.grid)
1540
+ }), /* @__PURE__ */ T("text", {
1541
+ x: q - 8,
1548
1542
  y: K(e),
1549
1543
  textAnchor: "end",
1550
1544
  dominantBaseline: "middle",
1551
- ...b.props(l.label),
1552
- children: o(e)
1545
+ ...x.props(s.label),
1546
+ children: c(e)
1553
1547
  })] }, e)),
1554
- j.map((e) => /* @__PURE__ */ D("g", { children: [m === "area" && /* @__PURE__ */ E(te, {
1555
- data: [...e.points],
1548
+ k.map((t) => /* @__PURE__ */ E("g", { children: [m === "area" && /* @__PURE__ */ T(re, {
1549
+ data: [...t.points],
1556
1550
  defined: (e) => e.value !== null,
1557
- x: (e) => X(e.timestamp),
1551
+ x: (e) => Y(e.timestamp),
1558
1552
  y0: (e) => K(e.base),
1559
1553
  y1: (e) => K((e.value ?? 0) + e.base),
1560
1554
  yScale: K,
1561
- fill: d[e.tone],
1562
- fillOpacity: v ? .65 : .15
1563
- }), /* @__PURE__ */ E(we, {
1564
- series: e,
1565
- x: X,
1555
+ fill: e[t.tone],
1556
+ fillOpacity: h ? .65 : .15
1557
+ }), /* @__PURE__ */ T(Te, {
1558
+ series: t,
1559
+ x: Y,
1566
1560
  y: K,
1567
1561
  inspectedTimestamp: I?.timestamp
1568
- })] }, e.id)),
1569
- s.map((e) => /* @__PURE__ */ D("g", { children: [e.kind === "time" ? /* @__PURE__ */ E("line", {
1570
- x1: X(e.timestamp),
1571
- x2: X(e.timestamp),
1562
+ })] }, t.id)),
1563
+ l.map((e) => /* @__PURE__ */ E("g", { children: [e.kind === "time" ? /* @__PURE__ */ T("line", {
1564
+ x1: Y(e.timestamp),
1565
+ x2: Y(e.timestamp),
1572
1566
  y1: 12,
1573
1567
  y2: R,
1574
1568
  className: "xhq4mlf x1ntoi03 x13efnbd"
1575
- }) : /* @__PURE__ */ E("circle", {
1576
- cx: X(e.timestamp),
1577
- cy: K(e.value + (j.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1569
+ }) : /* @__PURE__ */ T("circle", {
1570
+ cx: Y(e.timestamp),
1571
+ cy: K(e.value + (k.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1578
1572
  r: 4,
1579
- fill: g.surface,
1580
- ...b.props(l.selected)
1581
- }), /* @__PURE__ */ E("title", { children: e.kind === "point" ? `${e.label}: ${a(e.value)}` : e.label })] }, e.id)),
1582
- I !== void 0 && /* @__PURE__ */ E("line", {
1583
- x1: X(I.timestamp),
1584
- x2: X(I.timestamp),
1573
+ fill: _.surface,
1574
+ ...x.props(s.selected)
1575
+ }), /* @__PURE__ */ T("title", { children: e.kind === "point" ? `${e.label}: ${o(e.value)}` : e.label })] }, e.id)),
1576
+ I !== void 0 && /* @__PURE__ */ T("line", {
1577
+ x1: Y(I.timestamp),
1578
+ x2: Y(I.timestamp),
1585
1579
  y1: 12,
1586
1580
  y2: R,
1587
1581
  className: "xhq4mlf x1ntoi03 x13efnbd"
1588
1582
  }),
1589
- ue !== void 0 && /* @__PURE__ */ E(ne, {
1590
- x: X(ue.timestamp),
1583
+ de !== void 0 && /* @__PURE__ */ T(ie, {
1584
+ x: Y(de.timestamp),
1591
1585
  top: 12,
1592
1586
  bottom: R,
1593
- width: Math.min(16, (Y - J) / 2)
1587
+ width: Math.min(16, (J - q) / 2)
1594
1588
  })
1595
1589
  ]
1596
- }), O && /* @__PURE__ */ D("div", {
1590
+ }), w && /* @__PURE__ */ E("div", {
1597
1591
  "aria-hidden": !0,
1598
- ...b.props(De.timeAxis, De.timeAxisInset(J, Math.max(0, re - Y))),
1599
- children: [/* @__PURE__ */ E("span", {
1592
+ ...x.props(Oe.timeAxis, Oe.timeAxisInset(q, Math.max(0, j - J))),
1593
+ children: [/* @__PURE__ */ T("span", {
1600
1594
  className: "x1cqoux5 xeuugli xj0a0fe",
1601
- children: i(B)
1602
- }), V !== B && /* @__PURE__ */ E("span", {
1595
+ children: a(z)
1596
+ }), B !== z && /* @__PURE__ */ T("span", {
1603
1597
  className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
1604
- children: i(V)
1598
+ children: a(B)
1605
1599
  })]
1606
1600
  })]
1607
1601
  }),
1608
- s.length > 0 && /* @__PURE__ */ E("ul", {
1602
+ l.length > 0 && /* @__PURE__ */ T("ul", {
1609
1603
  className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
1610
- children: s.map((e) => /* @__PURE__ */ D("li", { children: [
1611
- i(e.timestamp),
1604
+ children: l.map((e) => /* @__PURE__ */ E("li", { children: [
1605
+ a(e.timestamp),
1612
1606
  " · ",
1613
1607
  e.label,
1614
- e.kind === "point" && ` · ${a(e.value)}`
1608
+ e.kind === "point" && ` · ${o(e.value)}`
1615
1609
  ] }, e.id))
1616
1610
  })
1617
1611
  ]
@@ -1619,4 +1613,4 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1619
1613
  })
1620
1614
  });
1621
1615
  }
1622
- export { ke as AreaChart, he as BarChart, I as BarChartPlaceholder, V as BreakdownBar, Oe as LineChart, ge as MAX_SCATTER_POINTS, J as ScatterPlot, Me as SmallMultiples, Ne as SmallMultiplesPlaceholder, Te as Sparkline, Ae as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };
1616
+ export { Ae as AreaChart, R as BarChart, L as BarChartPlaceholder, V as BreakdownBar, ke as LineChart, K as MAX_SCATTER_POINTS, J as ScatterPlot, Ne as SmallMultiples, Pe as SmallMultiplesPlaceholder, Ee as Sparkline, je as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };