@graphysdk/viz-engine 1.9.0-beta.1790865062136 → 1.9.0-beta.1790931976211

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.
@@ -1,22 +1,22 @@
1
- import { $n as Jt, $t as wr, An as Cr, Bn as pe, C as B, Ct as Vr, D as Ir, Dn as Qt, E as ft, F as re, Gn as Er, In as Zt, Ir as en, Jt as fe, Kn as S, L as Xe, Lr as Y, M as Mr, Mn as x, Mr as Lr, Nn as w, On as kr, Ot as _r, P as tn, Pn as Dr, Pt as Rr, Qt as Nr, Rr as k, S as Or, T as oe, Un as se, Vn as nn, Xn as ie, Xt as Pr, Yn as gt, Yt as $r, Z as Br, Zn as C, Zt as Fr, _ as Ur, _r as I, _t as Gr, an as Yr, ar as jr, at as rn, b as zr, bn as Re, br as ge, bt as sn, c as ht, cn as Je, ct as an, d as Kr, dn as on, dr as Wr, fn as ue, fr as Ve, g as we, gn as qr, gr as cn, h as Hr, hn as Xr, hr as h, it as Jr, jn as ce, k as Qr, kn as Zr, kt as ln, l as es, ln as ts, lr as Ue, lt as yt, m as un, mn as W, mt as ns, nt as rs, o as ss, on as dn, or as as, p as mn, pn as os, pr as M, qn as g, r as vt, rn as Qe, sn as E, sr as bt, t as he, tn as Le, tr as is, u as St, un as Ze, ur as pn, v as Ne, vr as cs, vt as j, w as Ae, wn as ls, x as us, xn as le, xr as ds, xt as fn, y as ms, yn as ps, yr as et, yt as Ge, zn as fs } from "./annotations-Pi6ciSyn.js";
2
- import { clamp as gs, merge as tt } from "lodash-es";
3
- import { utcDay as hs, utcHour as ys, utcMonday as vs, utcMonth as bs, utcYear as Ss } from "d3-time";
4
- import { differenceInDays as As } from "date-fns/differenceInDays";
5
- import { regressionExp as Ts, regressionLinear as xs, regressionLoess as ws, regressionLog as Cs, regressionPoly as Vs, regressionPow as Is, regressionQuad as Es } from "d3-regression";
6
- import { scaleBand as gn, scaleLinear as Oe, scaleLog as Ms, scaleOrdinal as hn, scaleSqrt as Ls, scaleUtc as ks } from "d3-scale";
7
- import { interpolateHcl as _s, interpolateHsl as Ds, interpolateLab as Rs, interpolateRgb as Ns, piecewise as At } from "d3-interpolate";
8
- import { interpolateBlues as Os, interpolateBrBG as Ps, interpolateCividis as $s, interpolateGreens as Bs, interpolateGreys as Fs, interpolateInferno as Us, interpolateMagma as Gs, interpolateOranges as Ys, interpolatePlasma as js, interpolatePuOr as zs, interpolatePurples as Ks, interpolateRdBu as Ws, interpolateReds as qs, interpolateSpectral as Hs, interpolateTurbo as Xs, interpolateViridis as Js } from "d3-scale-chromatic";
9
- import Qs from "lodash-es/clamp";
10
- import Zs from "lodash-es/merge";
1
+ import { $n as Jt, $t as Vr, An as Ir, Bn as fe, C as B, Ct as Er, D as Mr, Dn as Qt, E as ft, F as re, Gn as Zt, In as en, Ir as tn, Jt as ge, Kn as S, L as Xe, Lr as Y, M as Lr, Mn as x, Mr as kr, Nn as w, On as _r, Ot as Dr, P as nn, Pn as Rr, Pt as Nr, Qt as Or, Rr as k, S as Pr, T as oe, Un as se, Vn as rn, Xn as ie, Xt as $r, Yn as gt, Yt as Br, Z as Fr, Zn as C, Zt as Ur, _ as Gr, _r as I, _t as Yr, an as jr, ar as zr, at as sn, b as Kr, bn as Re, br as he, bt as an, c as ht, cn as Je, ct as on, d as Wr, dn as cn, dr as qr, fn as ue, fr as de, g as Ce, gn as Hr, gr as ln, h as Xr, hn as Jr, hr as h, it as Qr, jn as ce, k as Zr, kn as es, kt as un, l as ts, ln as ns, lr as Ue, lt as yt, m as dn, mn as W, mt as rs, nt as ss, o as as, on as mn, or as os, p as pn, pn as is, pr as M, qn as g, r as vt, rn as Qe, sn as E, sr as bt, t as ye, tn as Le, tr as cs, u as St, un as Ze, ur as fn, v as Ne, vr as ls, vt as j, w as Te, wn as us, x as ds, xn as le, xr as ms, xt as gn, y as ps, yn as fs, yr as et, yt as Ge, zn as gs } from "./annotations-Pi6ciSyn.js";
2
+ import { clamp as hs, merge as tt } from "lodash-es";
3
+ import { utcDay as ys, utcHour as vs, utcMonday as bs, utcMonth as Ss, utcYear as As } from "d3-time";
4
+ import { differenceInDays as Ts } from "date-fns/differenceInDays";
5
+ import { regressionExp as xs, regressionLinear as ws, regressionLoess as Cs, regressionLog as Vs, regressionPoly as Is, regressionPow as Es, regressionQuad as Ms } from "d3-regression";
6
+ import { scaleBand as hn, scaleLinear as Oe, scaleLog as Ls, scaleOrdinal as yn, scaleSqrt as ks, scaleUtc as _s } from "d3-scale";
7
+ import { interpolateHcl as Ds, interpolateHsl as Rs, interpolateLab as Ns, interpolateRgb as Os, piecewise as At } from "d3-interpolate";
8
+ import { interpolateBlues as Ps, interpolateBrBG as $s, interpolateCividis as Bs, interpolateGreens as Fs, interpolateGreys as Us, interpolateInferno as Gs, interpolateMagma as Ys, interpolateOranges as js, interpolatePlasma as zs, interpolatePuOr as Ks, interpolatePurples as Ws, interpolateRdBu as qs, interpolateReds as Hs, interpolateSpectral as Xs, interpolateTurbo as Js, interpolateViridis as Qs } from "d3-scale-chromatic";
9
+ import Zs from "lodash-es/clamp";
10
+ import ea from "lodash-es/merge";
11
11
  var P = (e, t) => {
12
12
  const n = se(t);
13
13
  if (n !== void 0) return () => n;
14
14
  const r = S(t);
15
15
  return g(r) ? (s) => {
16
16
  const a = s[r];
17
- return a === void 0 ? null : yn(a, e.getType(r));
17
+ return a === void 0 ? null : vn(a, e.getType(r));
18
18
  } : () => null;
19
- }, ea = (e, t) => {
19
+ }, ta = (e, t) => {
20
20
  const n = se(t);
21
21
  if (n !== void 0) return () => n;
22
22
  const r = S(t);
@@ -24,14 +24,14 @@ var P = (e, t) => {
24
24
  const s = e.getValues(r), a = e.getType(r);
25
25
  return (o) => {
26
26
  const i = s[o];
27
- return i === void 0 ? null : yn(i, a);
27
+ return i === void 0 ? null : vn(i, a);
28
28
  };
29
- }, pd = (e, t) => P(e, t.x), fd = (e, t) => P(e, t.y), gd = (e, t) => P(e, t.label), hd = (e, t) => P(e, t.color), yd = (e, t) => P(e, t.size), vd = (e, t) => P(e, t.alpha), bd = (e, t) => P(e, t.group), Sd = (e, t) => P(e, t.strokeWidth), yn = (e, t) => {
29
+ }, fd = (e, t) => P(e, t.x), gd = (e, t) => P(e, t.y), hd = (e, t) => P(e, t.label), yd = (e, t) => P(e, t.color), vd = (e, t) => P(e, t.size), bd = (e, t) => P(e, t.alpha), Sd = (e, t) => P(e, t.group), Ad = (e, t) => P(e, t.strokeWidth), vn = (e, t) => {
30
30
  switch (t) {
31
31
  case "numeric":
32
32
  return Y(e) ? e : null;
33
33
  case "categorical":
34
- return en(e) ? e : null;
34
+ return tn(e) ? e : null;
35
35
  case "temporal":
36
36
  return k(e) ? e : null;
37
37
  default:
@@ -39,19 +39,19 @@ var P = (e, t) => {
39
39
  }
40
40
  }, Tt = { variable: h.yRaw };
41
41
  function nt(e, t) {
42
- return pe(e) ? Tt : t.y ?? Tt;
42
+ return fe(e) ? Tt : t.y ?? Tt;
43
43
  }
44
- function vn(e) {
44
+ function bn(e) {
45
45
  return P(e.data, nt(e.position, e.mapping));
46
46
  }
47
- function ta(e) {
48
- return ea(e.data, nt(e.position, e.mapping));
47
+ function na(e) {
48
+ return ta(e.data, nt(e.position, e.mapping));
49
49
  }
50
50
  var rt = (e) => {
51
51
  const t = S(e.mapping.x);
52
- return t !== null && t !== Ve.x ? t : M.group;
53
- }, bn = (e) => na(e) ? S(e.mapping.y) : null, Sn = (e) => bn(e) === null ? null : vn(e), An = (e) => e.spatialKind !== "cells", na = (e) => e.spatialKind === "points" || e.spatialKind === "cells", ra = (e, t) => e.yScaleType === t.yScaleType && Ye(e.valueFormat) === Ye(t.valueFormat), xt = (e) => `${e.yScaleType} y axis, ${Ye(e.valueFormat)}`, Ye = (e) => e.type === "currency" ? `${e.type}:${e.iso}` : e.type, sa = (e, t) => {
54
- const n = ce(e.data.getValueFormat(rt(e))), r = bn(e);
52
+ return t !== null && t !== de.x ? t : M.group;
53
+ }, Sn = (e) => ra(e) ? S(e.mapping.y) : null, An = (e) => Sn(e) === null ? null : bn(e), Tn = (e) => e.spatialKind !== "cells", ra = (e) => e.spatialKind === "points" || e.spatialKind === "cells", sa = (e, t) => e.yScaleType === t.yScaleType && Ye(e.valueFormat) === Ye(t.valueFormat), xt = (e) => `${e.yScaleType} y axis, ${Ye(e.valueFormat)}`, Ye = (e) => e.type === "currency" ? `${e.type}:${e.iso}` : e.type, aa = (e, t) => {
54
+ const n = ce(e.data.getValueFormat(rt(e))), r = Sn(e);
55
55
  return (s) => ({
56
56
  ...s,
57
57
  anchorValue: le(s.anchorValue, n, t),
@@ -59,8 +59,8 @@ var rt = (e) => {
59
59
  ...s.crossValue !== void 0 && r !== null && { crossValue: le(s.crossValue, ce(e.data.getValueFormat(r)), t) }
60
60
  });
61
61
  };
62
- function aa(e) {
63
- return e instanceof Dr ? {
62
+ function oa(e) {
63
+ return e instanceof Rr ? {
64
64
  severity: "error",
65
65
  kind: e.kind,
66
66
  code: e.code,
@@ -74,10 +74,10 @@ function aa(e) {
74
74
  message: e instanceof Error ? e.message : String(e)
75
75
  };
76
76
  }
77
- function Ad(e, t) {
78
- return xn(e, t);
77
+ function Td(e, t) {
78
+ return wn(e, t);
79
79
  }
80
- function Te(e, t) {
80
+ function xe(e, t) {
81
81
  for (const n of Object.keys(t)) {
82
82
  const r = t[n];
83
83
  if (r !== void 0 && r !== e[n]) return {
@@ -87,12 +87,12 @@ function Te(e, t) {
87
87
  }
88
88
  return e;
89
89
  }
90
- function Td(e, t, n) {
90
+ function xd(e, t, n) {
91
91
  if (e[t] === n) return e;
92
92
  const r = [...e];
93
93
  return r[t] = n, r;
94
94
  }
95
- function Tn(e, t) {
95
+ function xn(e, t) {
96
96
  let n = null;
97
97
  for (const [r, s] of e.entries()) {
98
98
  const a = t(s, r);
@@ -104,13 +104,13 @@ function Tn(e, t) {
104
104
  }
105
105
  return n ?? e;
106
106
  }
107
- function xn(e, t) {
107
+ function wn(e, t) {
108
108
  let n = !1;
109
109
  const r = { ...e };
110
110
  for (const [s, a] of Object.entries(t)) {
111
111
  const o = e[s];
112
112
  if (gt(a) && gt(o)) {
113
- const i = xn(o, a);
113
+ const i = wn(o, a);
114
114
  i !== o && (r[s] = i, n = !0);
115
115
  } else a !== void 0 && a !== o && (r[s] = a, n = !0);
116
116
  }
@@ -128,11 +128,11 @@ function st(e) {
128
128
  result: () => e
129
129
  };
130
130
  }
131
- var oa = (e, t) => {
132
- if (!kr(e)) return e;
131
+ var ia = (e, t) => {
132
+ if (!_r(e)) return e;
133
133
  const n = t[e.byVariable];
134
134
  return n === void 0 ? e.fallback : e.cases[C(n)] ?? e.fallback;
135
- }, ia = (e) => e.type === "polar" ? "disk" : "panel", ca = (e, t) => {
135
+ }, ca = (e) => e.type === "polar" ? "disk" : "panel", la = (e, t) => {
136
136
  if (e !== "disk") return {
137
137
  x: 0,
138
138
  y: 0,
@@ -146,7 +146,7 @@ var oa = (e, t) => {
146
146
  width: n,
147
147
  height: n
148
148
  };
149
- }, xd = (e, t) => {
149
+ }, wd = (e, t) => {
150
150
  if (e.space !== "disk") return {
151
151
  x: e.x,
152
152
  y: e.y
@@ -155,22 +155,22 @@ var oa = (e, t) => {
155
155
  x: 0,
156
156
  y: 0
157
157
  };
158
- const n = ca(e.space, t), r = n.y + (1 - e.y) * n.height;
158
+ const n = la(e.space, t), r = n.y + (1 - e.y) * n.height;
159
159
  return {
160
160
  x: (n.x + e.x * n.width) / t.width,
161
161
  y: 1 - r / t.height
162
162
  };
163
163
  };
164
- function la(e, t) {
164
+ function ua(e, t) {
165
165
  return e === "x" ? t.x : t.y;
166
166
  }
167
- function ua(e, t) {
167
+ function da(e, t) {
168
168
  return e === "x" ? t.y : t.x;
169
169
  }
170
- function wd(e, t) {
170
+ function Cd(e, t) {
171
171
  return {
172
- main: la(e, t),
173
- cross: ua(e, t)
172
+ main: ua(e, t),
173
+ cross: da(e, t)
174
174
  };
175
175
  }
176
176
  function wt(e, t) {
@@ -182,14 +182,14 @@ function wt(e, t) {
182
182
  y: t.main
183
183
  };
184
184
  }
185
- function da(e) {
185
+ function ma(e) {
186
186
  return e.type === "cartesian" ? e.mainAxis : "x";
187
187
  }
188
- function Cd(e) {
188
+ function Vd(e) {
189
189
  return e.type === "cartesian";
190
190
  }
191
- var ke = (e) => e[M.group], ma = (e) => {
192
- const t = rt(e), n = Sn(e), r = An(e) && t !== M.group;
191
+ var ke = (e) => e[M.group], pa = (e) => {
192
+ const t = rt(e), n = An(e), r = Tn(e) && t !== M.group;
193
193
  return (s) => {
194
194
  const a = s[t] ?? null;
195
195
  if (a === null) return null;
@@ -203,21 +203,21 @@ var ke = (e) => e[M.group], ma = (e) => {
203
203
  ...i !== null && { groupValue: i }
204
204
  };
205
205
  };
206
- }, pa = { type: "decimal" };
207
- function wn(e) {
206
+ }, fa = { type: "decimal" };
207
+ function Cn(e) {
208
208
  return e.length > 0 && e.every((t) => t.data.size() === 0);
209
209
  }
210
- function Cn(e, t) {
211
- return t !== null && e.data.hasVariable(t) ? e.data.getValueFormat(t) : pa;
210
+ function Vn(e, t) {
211
+ return t !== null && e.data.hasVariable(t) ? e.data.getValueFormat(t) : fa;
212
212
  }
213
- function Vd(e) {
214
- return Cn(e, S(e.mapping.y));
213
+ function Id(e) {
214
+ return Vn(e, S(e.mapping.y));
215
215
  }
216
- function Vn({ geom: e, position: t, mapping: n, purpose: r }) {
216
+ function In({ geom: e, position: t, mapping: n, purpose: r }) {
217
217
  return e.resolveValueSource?.(n, r) ?? nt(t, n);
218
218
  }
219
- function fa(e, t) {
220
- const n = Vn({
219
+ function ga(e, t) {
220
+ const n = In({
221
221
  geom: t,
222
222
  position: e.position,
223
223
  mapping: e.mapping,
@@ -225,27 +225,27 @@ function fa(e, t) {
225
225
  }), r = S(n), s = r === h.yRaw ? S(e.mapping.y) : r;
226
226
  return {
227
227
  read: P(e.data, n),
228
- valueFormat: Cn(e, s)
228
+ valueFormat: Vn(e, s)
229
229
  };
230
230
  }
231
- var ga = (e) => {
232
- const t = rt(e), n = Sn(e), r = An(e);
231
+ var ha = (e) => {
232
+ const t = rt(e), n = An(e), r = Tn(e);
233
233
  return (s, a) => !ie(s[t] ?? null, a.anchorValue) || !(n === null || a.crossValue === void 0 || ie(n(s), a.crossValue)) ? !1 : !r || a.groupValue === void 0 ? !0 : ie(ke(s), a.groupValue);
234
- }, ha = (e) => {
235
- const t = S(e.mapping.y), n = vn(e);
234
+ }, ya = (e) => {
235
+ const t = S(e.mapping.y), n = bn(e);
236
236
  return (r, s) => t !== null && s === t ? n(r) : r[s] ?? null;
237
- }, ya = (e) => (t) => {
238
- if (t === S(e.mapping.y)) return ta(e);
237
+ }, va = (e) => (t) => {
238
+ if (t === S(e.mapping.y)) return na(e);
239
239
  const n = e.data.hasVariable(t) ? e.data.getValues(t) : null;
240
240
  return (r) => n?.[r] ?? null;
241
241
  };
242
- var va = [
242
+ var ba = [
243
243
  "lt",
244
244
  "lte",
245
245
  "gt",
246
246
  "gte",
247
247
  "range"
248
- ], ba = {
248
+ ], Sa = {
249
249
  highlight: {
250
250
  subject: "Highlight predicate",
251
251
  effect: "dropping this highlight"
@@ -260,16 +260,16 @@ var va = [
260
260
  }
261
261
  }, F = () => !1, J = () => !0;
262
262
  function at(e, t) {
263
- const n = ha(e);
263
+ const n = ya(e);
264
264
  return {
265
- ...In(e, t),
265
+ ...En(e, t),
266
266
  createValueReader: (r) => (s) => n(s, r)
267
267
  };
268
268
  }
269
- function Id(e, t) {
269
+ function Ed(e, t) {
270
270
  return {
271
- ...In(e, t),
272
- createValueReader: ya(e)
271
+ ...En(e, t),
272
+ createValueReader: va(e)
273
273
  };
274
274
  }
275
275
  function Pe(e) {
@@ -294,12 +294,12 @@ function ee(e, t) {
294
294
  const n = ee(e.not, t);
295
295
  return n === F ? J : n === J ? F : (r) => !n(r);
296
296
  }
297
- return Aa(e, t);
297
+ return Ta(e, t);
298
298
  }
299
299
  function te(e, t, n = "highlight") {
300
- return "and" in e ? e.and.flatMap((r) => te(r, t, n)) : "or" in e ? e.or.flatMap((r) => te(r, t, n)) : "not" in e ? te(e.not, t, n) : Sa(e, t, n);
300
+ return "and" in e ? e.and.flatMap((r) => te(r, t, n)) : "or" in e ? e.or.flatMap((r) => te(r, t, n)) : "not" in e ? te(e.not, t, n) : Aa(e, t, n);
301
301
  }
302
- function In(e, t) {
302
+ function En(e, t) {
303
303
  return {
304
304
  hasVariable: (n) => e.data.hasVariable(n),
305
305
  getType: (n) => e.data.getType(n),
@@ -307,15 +307,15 @@ function In(e, t) {
307
307
  parsingLocale: t
308
308
  };
309
309
  }
310
- function Sa(e, t, n) {
311
- const { subject: r, effect: s } = ba[n];
310
+ function Aa(e, t, n) {
311
+ const { subject: r, effect: s } = Sa[n];
312
312
  if (!t.hasVariable(e.variable)) return [{
313
313
  code: "UNKNOWN_VARIABLE",
314
314
  message: `${r} references unknown variable '${e.variable}' — ${s}.`,
315
315
  context: { variableName: e.variable },
316
316
  suggestion: `Map '${e.variable}' in the layer or correct the variable name in the predicate.`
317
317
  }];
318
- const a = Ta(e);
318
+ const a = xa(e);
319
319
  return a !== null && t.getType(e.variable) === "categorical" ? [{
320
320
  code: "INVALID_PREDICATE_OPERATOR",
321
321
  message: `${r} uses ordering operator '${a}' on categorical variable '${e.variable}' — ${s}. Use 'eq' or 'oneOf' instead.`,
@@ -323,7 +323,7 @@ function Sa(e, t, n) {
323
323
  suggestion: "Use 'eq' or 'oneOf' for categorical variables."
324
324
  }] : [];
325
325
  }
326
- function Aa(e, t) {
326
+ function Ta(e, t) {
327
327
  if (!t.hasVariable(e.variable)) return F;
328
328
  const n = t.createValueReader(e.variable), r = ce(t.getValueFormat(e.variable)), s = (a) => le(a, r, t.parsingLocale);
329
329
  if ("eq" in e) {
@@ -377,8 +377,8 @@ function Aa(e, t) {
377
377
  }
378
378
  return F;
379
379
  }
380
- function Ta(e) {
381
- for (const t of va) if (t in e) return t;
380
+ function xa(e) {
381
+ for (const t of ba) if (t in e) return t;
382
382
  return null;
383
383
  }
384
384
  function Q(e, t) {
@@ -389,10 +389,10 @@ function Q(e, t) {
389
389
  }
390
390
  return Y(e) && Y(t) ? e < t ? "less" : e > t ? "greater" : "equal" : "incomparable";
391
391
  }
392
- var xa = (e, t, n, r, s, a, o) => {
393
- const i = Mn(e, t, n.predicate, r, s, a, o);
392
+ var wa = (e, t, n, r, s, a, o) => {
393
+ const i = Ln(e, t, n.predicate, r, s, a, o);
394
394
  if (i === null) return null;
395
- const c = En(n.padding), l = c === null ? Va(i, n.padding) : i, u = {
395
+ const c = Mn(n.padding), l = c === null ? Ia(i, n.padding) : i, u = {
396
396
  x: l.xMin,
397
397
  y: l.yMin,
398
398
  width: Math.max(0, l.xMax - l.xMin),
@@ -403,17 +403,17 @@ var xa = (e, t, n, r, s, a, o) => {
403
403
  ...u,
404
404
  defer: c
405
405
  };
406
- }, wa = (e, t, n, r, s, a, o) => {
407
- const i = Mn(e, t, n.predicate, r, s, a, o);
406
+ }, Ca = (e, t, n, r, s, a, o) => {
407
+ const i = Ln(e, t, n.predicate, r, s, a, o);
408
408
  return i === null ? null : {
409
409
  ...Jt(i, n.align),
410
410
  space: i.space
411
411
  };
412
- }, En = (e) => e === void 0 || typeof e == "number" || e.unit !== "px" ? null : {
412
+ }, Mn = (e) => e === void 0 || typeof e == "number" || e.unit !== "px" ? null : {
413
413
  type: "px-offset",
414
414
  x: e.x ?? 0,
415
415
  y: e.y ?? 0
416
- }, Mn = (e, t, n, r, s, a, o) => {
416
+ }, Ln = (e, t, n, r, s, a, o) => {
417
417
  if (t.has(n)) return t.get(n) ?? null;
418
418
  let i = null, c = !1;
419
419
  const l = /* @__PURE__ */ new Map();
@@ -429,19 +429,19 @@ var xa = (e, t, n, r, s, a, o) => {
429
429
  if (m !== F)
430
430
  for (const f of u.data) {
431
431
  if (!m(f)) continue;
432
- const p = is(f, s);
433
- p !== null && (i = i === null ? p : Ca(i, p));
432
+ const p = cs(f, s);
433
+ p !== null && (i = i === null ? p : Va(i, p));
434
434
  }
435
435
  }
436
436
  if (!c) for (const u of l.values()) o ? o.push(u) : e.diagnostics.addWarning(u);
437
437
  return t.set(n, i), i;
438
- }, Ca = (e, t) => ({
438
+ }, Va = (e, t) => ({
439
439
  space: e.space,
440
440
  xMin: Math.min(e.xMin, t.xMin),
441
441
  xMax: Math.max(e.xMax, t.xMax),
442
442
  yMin: Math.min(e.yMin, t.yMin),
443
443
  yMax: Math.max(e.yMax, t.yMax)
444
- }), Va = (e, t) => {
444
+ }), Ia = (e, t) => {
445
445
  if (t === void 0) return e;
446
446
  const { x: n = 0, y: r = 0 } = typeof t == "number" ? {
447
447
  x: t,
@@ -455,9 +455,9 @@ var xa = (e, t, n, r, s, a, o) => {
455
455
  yMax: e.yMax + r
456
456
  };
457
457
  }, Ie = (e, t, n) => {
458
- const r = Ma(e, t, n);
459
- return r === null ? null : r.defer?.type === "annotation-ref" ? r : La(r, t.offset, e.coordSystem);
460
- }, Ln = (e, t) => t.anchorType === "selection" ? xa(e.container, e.selectionBoxCache, t, e.layers, e.coordSystem, e.parsingLocale, e.warnings) : t.anchorType === "annotation" ? {
458
+ const r = La(e, t, n);
459
+ return r === null ? null : r.defer?.type === "annotation-ref" ? r : ka(r, t.offset, e.coordSystem);
460
+ }, kn = (e, t) => t.anchorType === "selection" ? wa(e.container, e.selectionBoxCache, t, e.layers, e.coordSystem, e.parsingLocale, e.warnings) : t.anchorType === "annotation" ? {
461
461
  x: 0,
462
462
  y: 0,
463
463
  width: 0,
@@ -476,7 +476,7 @@ var xa = (e, t, n, r, s, a, o) => {
476
476
  for (const o of t) {
477
477
  const i = e.geomRegistry.get(o.geom), { resolveAnchorPosition: c } = i;
478
478
  if (c === void 0 || s.layerId !== void 0 && o.id !== s.layerId || s.layerId === void 0 && !o.interactive) continue;
479
- const l = fa(o, i), u = ga(o), d = ma(o), m = sa(o, r)(s);
479
+ const l = ga(o, i), u = ha(o), d = pa(o), m = aa(o, r)(s);
480
480
  let f = -1;
481
481
  for (const p of o.data) {
482
482
  if (f += 1, !u(p, m)) continue;
@@ -487,7 +487,7 @@ var xa = (e, t, n, r, s, a, o) => {
487
487
  align: s.align
488
488
  });
489
489
  if (b === null) continue;
490
- const v = Ea(o, p, l);
490
+ const v = Ma(o, p, l);
491
491
  if (v === null) continue;
492
492
  const y = d(p);
493
493
  if (y !== null)
@@ -495,7 +495,7 @@ var xa = (e, t, n, r, s, a, o) => {
495
495
  point: {
496
496
  ...b,
497
497
  ...v,
498
- space: ia(n),
498
+ space: ca(n),
499
499
  observationIndex: f,
500
500
  anchor: s.align === void 0 ? y : {
501
501
  ...y,
@@ -507,7 +507,7 @@ var xa = (e, t, n, r, s, a, o) => {
507
507
  }
508
508
  }
509
509
  return null;
510
- }, Ia = (e, t) => {
510
+ }, Ea = (e, t) => {
511
511
  const { layers: n, coordSystem: r, scales: s, parsingLocale: a } = e;
512
512
  if (r.type !== "cartesian") return null;
513
513
  const o = s.x, i = s.y;
@@ -515,8 +515,8 @@ var xa = (e, t, n, r, s, a, o) => {
515
515
  const c = Vt(t.x, "x", n, a), l = Vt(t.y, "y", n, a);
516
516
  if (c === null || l === null) return null;
517
517
  const u = o.map(c), d = i.map(l);
518
- if (!os(u, d)) return null;
519
- const m = Ct(u, o, ka(e)), f = Ct(d, i), p = wt(r.mainAxis, {
518
+ if (!is(u, d)) return null;
519
+ const m = Ct(u, o, _a(e)), f = Ct(d, i), p = wt(r.mainAxis, {
520
520
  main: m.min,
521
521
  cross: f.min
522
522
  }), b = wt(r.mainAxis, {
@@ -529,15 +529,15 @@ var xa = (e, t, n, r, s, a, o) => {
529
529
  yMin: p.y,
530
530
  yMax: b.y
531
531
  }, t.align ?? "center");
532
- }, Ea = (e, t, n) => {
532
+ }, Ma = (e, t, n) => {
533
533
  const r = n.read(t);
534
534
  return Y(r) ? {
535
535
  geom: e.geom,
536
536
  measurementValue: r,
537
- valueFormat: oa(n.valueFormat, t),
537
+ valueFormat: ia(n.valueFormat, t),
538
538
  yScaleType: e.yScaleType
539
539
  } : null;
540
- }, Ma = (e, t, n) => {
540
+ }, La = (e, t, n) => {
541
541
  switch (t.anchorType) {
542
542
  case "panel":
543
543
  return {
@@ -545,9 +545,9 @@ var xa = (e, t, n, r, s, a, o) => {
545
545
  y: 1 - t.y
546
546
  };
547
547
  case "axis":
548
- return Ia(e, t);
548
+ return Ea(e, t);
549
549
  case "selection":
550
- return wa(e.container, e.selectionBoxCache, t, e.layers, e.coordSystem, e.parsingLocale, e.warnings);
550
+ return Ca(e.container, e.selectionBoxCache, t, e.layers, e.coordSystem, e.parsingLocale, e.warnings);
551
551
  case "annotation":
552
552
  return {
553
553
  x: 0,
@@ -560,11 +560,11 @@ var xa = (e, t, n, r, s, a, o) => {
560
560
  }
561
561
  };
562
562
  case "observation":
563
- return ot(e, _a(t), n);
563
+ return ot(e, Da(t), n);
564
564
  }
565
- }, La = (e, t, n) => {
565
+ }, ka = (e, t, n) => {
566
566
  if (t === void 0 || n.type === "polar") return e;
567
- const r = En(t);
567
+ const r = Mn(t);
568
568
  return r !== null ? {
569
569
  ...e,
570
570
  defer: r
@@ -584,14 +584,14 @@ var xa = (e, t, n, r, s, a, o) => {
584
584
  min: e - s,
585
585
  max: e + s
586
586
  };
587
- }, ka = ({ container: e, layers: t, coordSystem: n }) => {
587
+ }, _a = ({ container: e, layers: t, coordSystem: n }) => {
588
588
  let r = 0;
589
589
  for (const s of t) {
590
590
  const a = e.geomRegistry.get(s.geom).resolveBandFraction?.(s.params, n);
591
591
  a !== void 0 && (r = Math.max(r, a));
592
592
  }
593
593
  return r > 0 ? r : 1;
594
- }, _a = (e) => ({
594
+ }, Da = (e) => ({
595
595
  layerId: e.layerId,
596
596
  anchorValue: e.anchorValue,
597
597
  groupValue: e.groupValue,
@@ -600,11 +600,11 @@ var xa = (e, t, n, r, s, a, o) => {
600
600
  }), Vt = (e, t, n, r) => {
601
601
  for (const s of n) {
602
602
  const a = S(s.mapping[t]);
603
- if (!(a === null || a === Ve.x))
603
+ if (!(a === null || a === de.x))
604
604
  return le(e, ce(s.data.getValueFormat(a)), r);
605
605
  }
606
606
  return e;
607
- }, Da = class extends W {
607
+ }, Ra = class extends W {
608
608
  constructor(e) {
609
609
  super(), this.container = e, this.warningsByOutput = /* @__PURE__ */ new WeakMap();
610
610
  }
@@ -633,16 +633,16 @@ var xa = (e, t, n, r, s, a, o) => {
633
633
  selectionBoxCache: /* @__PURE__ */ new Map(),
634
634
  parsingLocale: a.parsingLocale
635
635
  }, c = {
636
- differenceArrows: ja(i, t.differenceArrows),
637
- shapes: Pa(i, t.shapes),
638
- arrows: Ba(i, t.arrows),
639
- textAnnotations: Fa(i, t.textAnnotations),
640
- images: $a(i, t.images),
641
- stickers: Ua(i, t.stickers),
642
- pinnedNumbers: Ga(i, t.pinnedNumbers),
643
- comments: Ya(i, t.comments)
636
+ differenceArrows: za(i, t.differenceArrows),
637
+ shapes: $a(i, t.shapes),
638
+ arrows: Fa(i, t.arrows),
639
+ textAnnotations: Ua(i, t.textAnnotations),
640
+ images: Ba(i, t.images),
641
+ stickers: Ga(i, t.stickers),
642
+ pinnedNumbers: Ya(i, t.pinnedNumbers),
643
+ comments: ja(i, t.comments)
644
644
  };
645
- return Ra(o, c), Na(o, c), this.warningsByOutput.set(c, o), c;
645
+ return Na(o, c), Oa(o, c), this.warningsByOutput.set(c, o), c;
646
646
  }
647
647
  }, O = (e, t, n, r) => {
648
648
  e.push({
@@ -654,7 +654,7 @@ var xa = (e, t, n, r, s, a, o) => {
654
654
  },
655
655
  suggestion: "Check that the anchor points at data, an axis value or a panel position that exists."
656
656
  });
657
- }, Ra = (e, t) => {
657
+ }, Na = (e, t) => {
658
658
  const n = /* @__PURE__ */ new Set();
659
659
  for (const r of Object.values(t)) for (const { id: s } of r) {
660
660
  if (n.has(s)) {
@@ -668,10 +668,10 @@ var xa = (e, t, n, r, s, a, o) => {
668
668
  }
669
669
  n.add(s);
670
670
  }
671
- }, Na = (e, t) => {
671
+ }, Oa = (e, t) => {
672
672
  const n = /* @__PURE__ */ new Set();
673
673
  for (const r of Object.values(t)) for (const s of r) n.add(s.id);
674
- for (const { id: r, ref: s } of Oa(t))
674
+ for (const { id: r, ref: s } of Pa(t))
675
675
  n.has(s) || e.push({
676
676
  code: "ANNOTATION_REF_NOT_FOUND",
677
677
  message: `Annotation "${r}" references id "${s}", whose annotation could not be anchored and was dropped.`,
@@ -681,7 +681,7 @@ var xa = (e, t, n, r, s, a, o) => {
681
681
  },
682
682
  suggestion: "Fix the anchor on the target annotation or point this reference at one that resolves."
683
683
  });
684
- }, Oa = (e) => {
684
+ }, Pa = (e) => {
685
685
  const t = [], n = (r, s) => {
686
686
  s.defer?.type === "annotation-ref" && t.push({
687
687
  id: r,
@@ -695,10 +695,10 @@ var xa = (e, t, n, r, s, a, o) => {
695
695
  for (const r of e.textAnnotations) n(r.id, r.at);
696
696
  for (const r of e.stickers) n(r.id, r.at);
697
697
  return t;
698
- }, Pa = (e, t) => {
698
+ }, $a = (e, t) => {
699
699
  const n = [];
700
700
  for (const r of t) {
701
- const s = Ln(e, r.region);
701
+ const s = kn(e, r.region);
702
702
  if (s === null) {
703
703
  O(e.warnings, "shape", r.id, "has a region anchor that resolves to nothing");
704
704
  continue;
@@ -711,10 +711,10 @@ var xa = (e, t, n, r, s, a, o) => {
711
711
  });
712
712
  }
713
713
  return n;
714
- }, $a = (e, t) => {
714
+ }, Ba = (e, t) => {
715
715
  const n = [];
716
716
  for (const r of t) {
717
- const s = Ln(e, r.region);
717
+ const s = kn(e, r.region);
718
718
  if (s === null) {
719
719
  O(e.warnings, "image", r.id, "has a region anchor that resolves to nothing");
720
720
  continue;
@@ -728,12 +728,12 @@ var xa = (e, t, n, r, s, a, o) => {
728
728
  });
729
729
  }
730
730
  return n;
731
- }, Ba = (e, t) => {
731
+ }, Fa = (e, t) => {
732
732
  const n = [];
733
733
  for (const r of t) {
734
734
  const s = Ie(e, r.start, "pin"), a = Ie(e, r.end, "pin");
735
735
  if (s === null || a === null) {
736
- O(e.warnings, "arrow", r.id, `has ${kn(s, a)} resolving to nothing`);
736
+ O(e.warnings, "arrow", r.id, `has ${_n(s, a)} resolving to nothing`);
737
737
  continue;
738
738
  }
739
739
  n.push({
@@ -745,7 +745,7 @@ var xa = (e, t, n, r, s, a, o) => {
745
745
  });
746
746
  }
747
747
  return n;
748
- }, Fa = (e, t) => {
748
+ }, Ua = (e, t) => {
749
749
  const n = [];
750
750
  for (const r of t) {
751
751
  const s = Ie(e, r.at, "pin");
@@ -762,7 +762,7 @@ var xa = (e, t, n, r, s, a, o) => {
762
762
  });
763
763
  }
764
764
  return n;
765
- }, Ua = (e, t) => {
765
+ }, Ga = (e, t) => {
766
766
  const n = [];
767
767
  for (const r of t) {
768
768
  const s = Ie(e, r.at, "pin");
@@ -777,7 +777,7 @@ var xa = (e, t, n, r, s, a, o) => {
777
777
  });
778
778
  }
779
779
  return n;
780
- }, Ga = (e, t) => {
780
+ }, Ya = (e, t) => {
781
781
  const n = [];
782
782
  for (const r of t) {
783
783
  const s = ot(e, r.at, "pin");
@@ -791,7 +791,7 @@ var xa = (e, t, n, r, s, a, o) => {
791
791
  });
792
792
  }
793
793
  return n;
794
- }, Ya = (e, t) => {
794
+ }, ja = (e, t) => {
795
795
  const n = [];
796
796
  for (const r of t) {
797
797
  const s = ot(e, r.at, "pin");
@@ -806,7 +806,7 @@ var xa = (e, t, n, r, s, a, o) => {
806
806
  });
807
807
  }
808
808
  return n;
809
- }, ja = (e, t) => {
809
+ }, za = (e, t) => {
810
810
  if (e.coordSystem.type !== "cartesian") {
811
811
  for (const r of t) O(e.warnings, "differenceArrow", r.id, "needs a cartesian coord system");
812
812
  return [];
@@ -815,14 +815,14 @@ var xa = (e, t, n, r, s, a, o) => {
815
815
  for (const r of t) {
816
816
  const s = je(e, r.start, "value"), a = je(e, r.end, "value");
817
817
  if (s === null || a === null) {
818
- O(e.warnings, "differenceArrow", r.id, `has ${kn(s, a)} matching no observation`);
818
+ O(e.warnings, "differenceArrow", r.id, `has ${_n(s, a)} matching no observation`);
819
819
  continue;
820
820
  }
821
821
  if (s.layerId === a.layerId && s.point.observationIndex === a.point.observationIndex) {
822
822
  O(e.warnings, "differenceArrow", r.id, "has both ends on the same observation");
823
823
  continue;
824
824
  }
825
- za(e, r, s.point, a.point), n.push({
825
+ Ka(e, r, s.point, a.point), n.push({
826
826
  id: r.id,
827
827
  start: s.point,
828
828
  end: a.point,
@@ -831,8 +831,8 @@ var xa = (e, t, n, r, s, a, o) => {
831
831
  });
832
832
  }
833
833
  return n;
834
- }, kn = (e, t) => e === null && t === null ? "start and end anchors" : e === null ? "a start anchor" : "an end anchor", za = (e, t, n, r) => {
835
- ra(n, r) || e.warnings.push({
834
+ }, _n = (e, t) => e === null && t === null ? "start and end anchors" : e === null ? "a start anchor" : "an end anchor", Ka = (e, t, n, r) => {
835
+ sa(n, r) || e.warnings.push({
836
836
  code: "INCOMPARABLE_ARROW_ENDPOINTS",
837
837
  message: `Difference arrow "${t.id}" measures between endpoints on different bases, so its label reports a quantity that does not exist.`,
838
838
  context: {
@@ -843,41 +843,41 @@ var xa = (e, t, n, r, s, a, o) => {
843
843
  suggestion: "Point both ends at observations sharing one y scale and one unit, or label the arrow as a proportion."
844
844
  });
845
845
  };
846
- function Ed(e, t = "kind") {
846
+ function Md(e, t = "kind") {
847
847
  const n = /* @__PURE__ */ new Map();
848
848
  n.set(t, []);
849
849
  for (const s of e) for (const a of s.observations) for (const o of Object.keys(a)) n.has(o) || n.set(o, []);
850
850
  for (const s of e) for (const a of s.observations) for (const [o, i] of n) i.push(o === t ? s.kind : a[o] ?? null);
851
851
  const r = {};
852
852
  for (const [s, a] of n) r[s] = {
853
- type: _n(a),
853
+ type: Dn(a),
854
854
  values: a
855
855
  };
856
856
  return new Qe(r);
857
857
  }
858
- function _n(e) {
858
+ function Dn(e) {
859
859
  const t = Array.isArray(e) ? e : [e];
860
860
  for (const n of t)
861
861
  if (n !== null)
862
862
  return typeof n == "number" ? "numeric" : n instanceof Date ? "temporal" : "categorical";
863
863
  return "categorical";
864
864
  }
865
- var Ka = class extends W {
865
+ var Wa = class extends W {
866
866
  dependencies(e) {
867
867
  return [e.data, e.mapping];
868
868
  }
869
869
  run(e) {
870
870
  let t = e.data, n = e.mapping;
871
- n.x === "" && (t = t.addConstantVariable(Ve.x, "categorical", ""), n = {
871
+ n.x === "" && (t = t.addConstantVariable(de.x, "categorical", ""), n = {
872
872
  ...n,
873
- x: Ve.x
873
+ x: de.x
874
874
  });
875
875
  for (const r of Object.keys(n)) {
876
876
  if (Ze(r)) continue;
877
877
  const s = se(n[r]);
878
878
  if (s === void 0) continue;
879
- const a = ge(`const_${r}`);
880
- t = t.addConstantVariable(a, _n(s), s), n = {
879
+ const a = he(`const_${r}`);
880
+ t = t.addConstantVariable(a, Dn(s), s), n = {
881
881
  ...n,
882
882
  [r]: a
883
883
  };
@@ -889,16 +889,16 @@ var Ka = class extends W {
889
889
  }
890
890
  }, q = class {
891
891
  constructor() {
892
- this.perLayerMemo = Xr(), this.listMemo = qr();
892
+ this.perLayerMemo = Jr(), this.listMemo = Hr();
893
893
  }
894
894
  get stats() {
895
- return ps(this.perLayerMemo.stats, this.listMemo.stats);
895
+ return fs(this.perLayerMemo.stats, this.listMemo.stats);
896
896
  }
897
897
  compile(e) {
898
898
  const t = this.dependencies(e), n = e.layers.map((r) => this.perLayerMemo(r, t, () => this.compileLayer(r, e)));
899
899
  return this.listMemo(n, () => n);
900
900
  }
901
- }, Wa = class extends W {
901
+ }, qa = class extends W {
902
902
  constructor(e) {
903
903
  super(), this.registry = e;
904
904
  }
@@ -912,7 +912,7 @@ var Ka = class extends W {
912
912
  run(e) {
913
913
  return this.registry.get(e.coordSpec.coordType).setup(e);
914
914
  }
915
- }, qa = class extends q {
915
+ }, Ha = class extends q {
916
916
  constructor(e) {
917
917
  super(), this.registry = e;
918
918
  }
@@ -928,9 +928,9 @@ var Ka = class extends W {
928
928
  if (!n) throw new x({ message: `CoordCompiler: strategy '${t.coordSpec.coordType}' did not return a transformed layer` });
929
929
  return n;
930
930
  }
931
- }, Ha = class {
931
+ }, Xa = class {
932
932
  constructor(e) {
933
- this.setupStage = new Wa(e), this.transformStage = new qa(e);
933
+ this.setupStage = new qa(e), this.transformStage = new Ha(e);
934
934
  }
935
935
  get setupStats() {
936
936
  return this.setupStage.stats;
@@ -944,7 +944,7 @@ var Ka = class extends W {
944
944
  transform(e) {
945
945
  return this.transformStage.compile(e);
946
946
  }
947
- }, Xa = class {
947
+ }, Ja = class {
948
948
  constructor() {
949
949
  this.coordType = "cartesian";
950
950
  }
@@ -971,7 +971,7 @@ var Ka = class extends W {
971
971
  transform(e) {
972
972
  return e.layers;
973
973
  }
974
- }, Ja = class {
974
+ }, Qa = class {
975
975
  constructor() {
976
976
  this.coordType = "flip";
977
977
  }
@@ -992,21 +992,21 @@ var Ka = class extends W {
992
992
  }
993
993
  }
994
994
  },
995
- scales: Za(e.scales, e.layers)
995
+ scales: eo(e.scales, e.layers)
996
996
  };
997
997
  }
998
998
  transform(e) {
999
- return e.layers.map((t) => to(t));
999
+ return e.layers.map((t) => no(t));
1000
1000
  }
1001
- }, Qa = [
1001
+ }, Za = [
1002
1002
  [h.x, h.y],
1003
1003
  [h.xMin, h.yMin],
1004
1004
  [h.xMax, h.yMax],
1005
1005
  [h.xBand, h.yBand]
1006
- ], It = ge("flipSwap"), Za = (e, t) => eo(t) ? e.map((n) => n.scaledAesthetic !== "x" || n.scaleType !== "continuous" && n.scaleType !== "datetime" && n.scaleType !== "discrete" ? n : {
1006
+ ], It = he("flipSwap"), eo = (e, t) => to(t) ? e.map((n) => n.scaledAesthetic !== "x" || n.scaleType !== "continuous" && n.scaleType !== "datetime" && n.scaleType !== "discrete" ? n : {
1007
1007
  ...n,
1008
1008
  reverse: !n.reverse
1009
- }) : e, eo = (e) => {
1009
+ }) : e, to = (e) => {
1010
1010
  for (const t of e) {
1011
1011
  const n = S(t.mapping.x);
1012
1012
  if (!n || !t.data.hasVariable(n)) continue;
@@ -1014,9 +1014,9 @@ var Ka = class extends W {
1014
1014
  if (r === "categorical" || r === "temporal") return !0;
1015
1015
  }
1016
1016
  return !1;
1017
- }, to = (e) => {
1017
+ }, no = (e) => {
1018
1018
  let t = e.data;
1019
- for (const [n, r] of Qa) {
1019
+ for (const [n, r] of Za) {
1020
1020
  const s = t.hasVariable(n), a = t.hasVariable(r);
1021
1021
  s && a ? t = t.renameVariable(n, It).renameVariable(r, n).renameVariable(It, r) : s ? t = t.renameVariable(n, r) : a && (t = t.renameVariable(r, n));
1022
1022
  }
@@ -1025,7 +1025,7 @@ var Ka = class extends W {
1025
1025
  data: t
1026
1026
  };
1027
1027
  };
1028
- function Dn(e) {
1028
+ function Rn(e) {
1029
1029
  const t = /* @__PURE__ */ new Set(), n = [];
1030
1030
  for (const r of e) {
1031
1031
  const s = r instanceof Date ? r.getTime() : String(r);
@@ -1033,7 +1033,10 @@ function Dn(e) {
1033
1033
  }
1034
1034
  return n;
1035
1035
  }
1036
- var Rn = (e, t) => Dn(t.domain !== null && t.domain.length > 0 ? t.domain : e), no = (e) => {
1036
+ var Nn = (e, t) => Rn(t.domain !== null && t.domain.length > 0 ? t.domain : e), On = (e, t) => e.scaledAesthetic === "x" && t.some((n) => S(n.mapping.x) === de.x) && t.every((n) => Zt(n.mapping) === "") ? {
1037
+ ...e,
1038
+ domain: null
1039
+ } : e, ro = (e) => {
1037
1040
  const t = e.length - 1, n = e[t];
1038
1041
  if (n === void 0 || t < 1) return null;
1039
1042
  const r = [];
@@ -1044,13 +1047,13 @@ var Rn = (e, t) => Dn(t.domain !== null && t.domain.length > 0 ? t.domain : e),
1044
1047
  r.sort((a, o) => a - o);
1045
1048
  const s = r[r.length - 1 >> 1];
1046
1049
  return s === void 0 ? null : n + s;
1047
- }, ro = (e) => [...new Set(e)].sort((t, n) => t - n), so = class {
1050
+ }, so = (e) => [...new Set(e)].sort((t, n) => t - n), ao = class {
1048
1051
  constructor() {
1049
1052
  this.coordType = "polar";
1050
1053
  }
1051
1054
  setup(e) {
1052
1055
  if (e.coordSpec.coordType !== "polar") throw new x({ message: `Invalid coordinate type: ${e.coordSpec.coordType}` });
1053
- const { params: t } = e.coordSpec, n = t.startAngle * (Math.PI / 180), r = lo(t, e.scales, e.layers), s = mo(t, e.scales, e.layers);
1056
+ const { params: t } = e.coordSpec, n = t.startAngle * (Math.PI / 180), r = uo(t, e.scales, e.layers), s = po(t, e.scales, e.layers);
1054
1057
  return {
1055
1058
  coordSystem: {
1056
1059
  type: "polar",
@@ -1078,28 +1081,28 @@ var Rn = (e, t) => Dn(t.domain !== null && t.domain.length > 0 ? t.domain : e),
1078
1081
  spokeRotation: r,
1079
1082
  bandAxis: s
1080
1083
  },
1081
- scales: io(t, e.scales, e.layers)
1084
+ scales: co(t, e.scales, e.layers)
1082
1085
  };
1083
1086
  }
1084
1087
  transform(e) {
1085
1088
  if (e.coordSpec.coordType !== "polar") throw new x({ message: `Invalid coordinate type: ${e.coordSpec.coordType}` });
1086
1089
  if (e.coordSystem.type !== "polar") throw new x({ message: "PolarCoord.transform received a non-polar coord system" });
1087
- const { params: t } = e.coordSpec, { startAngle: n, spokeRotation: r } = e.coordSystem, s = oo(n, r), a = po(t);
1088
- return e.layers.map((o) => fo(t.theta === "y" ? go(o) : o, s, a));
1090
+ const { params: t } = e.coordSpec, { startAngle: n, spokeRotation: r } = e.coordSystem, s = io(n, r), a = fo(t);
1091
+ return e.layers.map((o) => go(t.theta === "y" ? ho(o) : o, s, a));
1089
1092
  }
1090
- }, ao = [
1093
+ }, oo = [
1091
1094
  [h.x, h.y],
1092
1095
  [h.xMin, h.yMin],
1093
1096
  [h.xMax, h.yMax],
1094
1097
  [h.xBand, h.yBand]
1095
- ], Et = ge("polarSwap");
1096
- function oo(e, t) {
1097
- return (n) => Lr(n, e, t);
1098
+ ], Et = he("polarSwap");
1099
+ function io(e, t) {
1100
+ return (n) => kr(n, e, t);
1098
1101
  }
1099
- function io(e, t, n) {
1102
+ function co(e, t, n) {
1100
1103
  return e.theta !== "x" ? t : t.map((r) => {
1101
1104
  if (r.scaledAesthetic !== "x" || r.scaleType !== "continuous" && r.scaleType !== "datetime" || r.scaleType === "continuous" && r.transform !== "linear" || r.domainMax !== null) return r;
1102
- const s = co(e, n), a = no(s), o = s[0];
1105
+ const s = lo(e, n), a = ro(s), o = s[0];
1103
1106
  return a === null || o === void 0 ? r : {
1104
1107
  ...r,
1105
1108
  domainMin: r.domainMin ?? o,
@@ -1107,40 +1110,40 @@ function io(e, t, n) {
1107
1110
  };
1108
1111
  });
1109
1112
  }
1110
- function co(e, t) {
1113
+ function lo(e, t) {
1111
1114
  const n = [];
1112
1115
  for (const r of t) {
1113
1116
  const s = S(r.mapping[e.theta]);
1114
1117
  if (!(s === null || !r.data.hasVariable(s)))
1115
1118
  for (const a of r.data.getValues(s)) a instanceof Date ? n.push(a.getTime()) : typeof a == "number" && n.push(a);
1116
1119
  }
1117
- return ro(n);
1120
+ return so(n);
1118
1121
  }
1119
- function lo(e, t, n) {
1122
+ function uo(e, t, n) {
1120
1123
  const r = t.find((a) => a.scaledAesthetic === e.theta);
1121
1124
  if (r === void 0 || r.scaleType !== "discrete") return 0;
1122
- const s = uo(r, e, n);
1125
+ const s = mo(r, e, n);
1123
1126
  return s === 0 ? 0 : -Math.PI / s;
1124
1127
  }
1125
- function uo(e, t, n) {
1128
+ function mo(e, t, n) {
1126
1129
  const r = [];
1127
1130
  for (const s of n) {
1128
1131
  const a = S(s.mapping[t.theta]);
1129
1132
  if (!(a === null || !s.data.hasVariable(a)))
1130
1133
  for (const o of s.data.getValues(a)) r.push(o);
1131
1134
  }
1132
- return Rn(r, e).length;
1135
+ return Nn(r, On(e, n)).length;
1133
1136
  }
1134
- function mo(e, t, n) {
1137
+ function po(e, t, n) {
1135
1138
  if (e.theta === "x") return "x";
1136
1139
  const r = t.find((a) => a.scaledAesthetic === "x")?.scaleType === "discrete", s = n.some((a) => a.position === "fill");
1137
1140
  return r && !s ? "y" : null;
1138
1141
  }
1139
- function po(e) {
1142
+ function fo(e) {
1140
1143
  const { innerRadius: t } = e;
1141
1144
  return (n) => t + n * (1 - t);
1142
1145
  }
1143
- function fo(e, t, n) {
1146
+ function go(e, t, n) {
1144
1147
  let r = e.data;
1145
1148
  return r = U(r, h.x, t), r = U(r, h.xMin, t), r = U(r, h.xMax, t), r = U(r, h.xBand, t), r = U(r, h.y, n), r = U(r, h.yMin, n), r = U(r, h.yMax, n), r = U(r, h.yBand, n), {
1146
1149
  ...e,
@@ -1152,9 +1155,9 @@ function U(e, t, n) {
1152
1155
  const r = e.getValues(t, { type: "numeric" }).map((s) => s === null ? null : n(s));
1153
1156
  return e.addVariable(t, "numeric", r);
1154
1157
  }
1155
- function go(e) {
1158
+ function ho(e) {
1156
1159
  let t = e.data;
1157
- for (const [n, r] of ao) {
1160
+ for (const [n, r] of oo) {
1158
1161
  const s = t.hasVariable(n), a = t.hasVariable(r);
1159
1162
  s && a ? t = t.renameVariable(n, Et).renameVariable(r, n).renameVariable(Et, r) : s ? t = t.renameVariable(n, r) : a && (t = t.renameVariable(r, n));
1160
1163
  }
@@ -1163,11 +1166,11 @@ function go(e) {
1163
1166
  data: t
1164
1167
  };
1165
1168
  }
1166
- var ho = class extends Le {
1169
+ var yo = class extends Le {
1167
1170
  constructor() {
1168
- super("coord"), this.register("cartesian", new Xa()), this.register("flip", new Ja()), this.register("polar", new so());
1171
+ super("coord"), this.register("cartesian", new Ja()), this.register("flip", new Qa()), this.register("polar", new ao());
1169
1172
  }
1170
- }, yo = class {
1173
+ }, vo = class {
1171
1174
  constructor(e) {
1172
1175
  this.container = e;
1173
1176
  }
@@ -1178,30 +1181,30 @@ var ho = class extends Le {
1178
1181
  };
1179
1182
  return {
1180
1183
  ...r,
1181
- data: Nr(r.data, n.positionRoles, s)
1184
+ data: Or(r.data, n.positionRoles, s)
1182
1185
  };
1183
1186
  }
1184
- }, vo = class {
1187
+ }, bo = class {
1185
1188
  compute({ data: e, mapping: t }) {
1186
- const n = fe(e, t);
1189
+ const n = ge(e, t);
1187
1190
  if (n.length === 0) return { data: e.addConstantVariable(M.group, "categorical", null) };
1188
1191
  const r = e.size(), s = n.map((o) => e.getValues(o)), a = new Array(r);
1189
1192
  for (let o = 0; o < r; o++) a[o] = C(s.map((i) => i[o]));
1190
1193
  return { data: e.addVariable(M.group, "categorical", a) };
1191
1194
  }
1192
- }, bo = (e) => {
1195
+ }, So = (e) => {
1193
1196
  if (e === void 0) return {};
1194
1197
  const t = {};
1195
1198
  for (const n of e.columns) n.label !== void 0 && (t[n.key] = n.label);
1196
1199
  return t;
1197
- }, So = (e, t, n) => {
1200
+ }, Ao = (e, t, n) => {
1198
1201
  const r = z(t, "color");
1199
1202
  return r === null ? {} : (e?.columns ?? []).some((s) => s.key === r) ? {} : n;
1200
1203
  };
1201
1204
  function z(e, t) {
1202
1205
  const n = E(t);
1203
1206
  let r = null;
1204
- for (const s of On(t, e)) {
1207
+ for (const s of $n(t, e)) {
1205
1208
  const a = S(s.mapping[n]);
1206
1209
  if (g(a)) {
1207
1210
  if (et(a)) {
@@ -1213,16 +1216,16 @@ function z(e, t) {
1213
1216
  }
1214
1217
  return r;
1215
1218
  }
1216
- var Nn = (e, t) => e === null ? null : t[e] ?? e, Ao = (e, t) => e === null ? null : t[String(e)] ?? null, K = ({ layers: e, scaleType: t, variableName: n }) => {
1219
+ var Pn = (e, t) => e === null ? null : t[e] ?? e, To = (e, t) => e === null ? null : t[String(e)] ?? null, K = ({ layers: e, scaleType: t, variableName: n }) => {
1217
1220
  if (n === null) return $e(t);
1218
1221
  for (const r of e) {
1219
1222
  if (!r.data.hasVariable(n)) continue;
1220
1223
  const s = r.data.getValueFormat(n), a = s.type === "lookup" ? s.fallback : s;
1221
- return xo(a, t) ? a : $e(t);
1224
+ return wo(a, t) ? a : $e(t);
1222
1225
  }
1223
1226
  return $e(t);
1224
- }, To = (e, t) => t !== "y" && t !== "ySecondary" ? !1 : On(t, e).some((n) => n.position === "fill");
1225
- function On(e, t) {
1227
+ }, xo = (e, t) => t !== "y" && t !== "ySecondary" ? !1 : $n(t, e).some((n) => n.position === "fill");
1228
+ function $n(e, t) {
1226
1229
  return e === "ySecondary" ? t.filter((n) => n.yScaleType === "secondary") : e === "y" ? t.filter((n) => n.yScaleType === "primary") : t;
1227
1230
  }
1228
1231
  var $e = (e) => {
@@ -1236,18 +1239,18 @@ var $e = (e) => {
1236
1239
  case "identity":
1237
1240
  return { type: "text" };
1238
1241
  }
1239
- }, xo = (e, t) => {
1242
+ }, wo = (e, t) => {
1240
1243
  switch (t) {
1241
1244
  case "continuous":
1242
- return Zr(e);
1245
+ return es(e);
1243
1246
  case "datetime":
1244
- return Cr(e);
1247
+ return Ir(e);
1245
1248
  case "discrete":
1246
1249
  case "palette":
1247
1250
  case "identity":
1248
1251
  return !0;
1249
1252
  }
1250
- }, wo = [
1253
+ }, Co = [
1251
1254
  {
1252
1255
  unit: "year",
1253
1256
  step: 1e3
@@ -1331,11 +1334,11 @@ var $e = (e) => {
1331
1334
  week: 3,
1332
1335
  day: 4,
1333
1336
  hour: 5
1334
- }, Z = 40, Co = (e, t, n) => {
1337
+ }, Z = 40, Vo = (e, t, n) => {
1335
1338
  const r = n.unit === "quarter" ? n.step * 3 : n.step;
1336
- return Mo(n.unit).range(e, new Date(t.valueOf() + 1), r);
1337
- }, Vo = ({ unit: e, step: t, start: n, stop: r }) => {
1338
- const s = As(r, n);
1339
+ return Lo(n.unit).range(e, new Date(t.valueOf() + 1), r);
1340
+ }, Io = ({ unit: e, step: t, start: n, stop: r }) => {
1341
+ const s = Ts(r, n);
1339
1342
  switch (e) {
1340
1343
  case "hour":
1341
1344
  return 24 * s / t > Z;
@@ -1350,7 +1353,7 @@ var $e = (e) => {
1350
1353
  case "year":
1351
1354
  return s / (365 * t) > Z;
1352
1355
  }
1353
- }, Io = (e, t) => {
1356
+ }, Eo = (e, t) => {
1354
1357
  const n = !Qt(t);
1355
1358
  switch (e.unit) {
1356
1359
  case "year":
@@ -1366,24 +1369,24 @@ var $e = (e) => {
1366
1369
  case "hour":
1367
1370
  return n ? { type: "datetime" } : { type: "time" };
1368
1371
  }
1369
- }, Eo = (e, t) => {
1370
- const n = Lo(t);
1372
+ }, Mo = (e, t) => {
1373
+ const n = ko(t);
1371
1374
  return n === null ? !1 : Mt[e] > Mt[n];
1372
- }, Mo = (e) => {
1375
+ }, Lo = (e) => {
1373
1376
  switch (e) {
1374
1377
  case "hour":
1375
- return ys;
1378
+ return vs;
1376
1379
  case "day":
1377
- return hs;
1380
+ return ys;
1378
1381
  case "week":
1379
- return vs;
1382
+ return bs;
1380
1383
  case "month":
1381
1384
  case "quarter":
1382
- return bs;
1383
- case "year":
1384
1385
  return Ss;
1386
+ case "year":
1387
+ return As;
1385
1388
  }
1386
- }, Lo = (e) => {
1389
+ }, ko = (e) => {
1387
1390
  switch (e.type) {
1388
1391
  case "year":
1389
1392
  return "year";
@@ -1404,25 +1407,25 @@ var $e = (e) => {
1404
1407
  default:
1405
1408
  return null;
1406
1409
  }
1407
- }, Pn = {
1410
+ }, Bn = {
1408
1411
  left: "right",
1409
1412
  right: "left",
1410
1413
  top: "bottom",
1411
1414
  bottom: "top"
1412
- }, ko = {
1415
+ }, _o = {
1413
1416
  x: !0,
1414
1417
  y: !0,
1415
1418
  ySecondary: !1
1416
- }, _o = 20, Lt = /* @__PURE__ */ new Set(["top", "bottom"]), Do = { type: "percentage" };
1417
- function Ro(e, t) {
1419
+ }, Do = 20, Lt = /* @__PURE__ */ new Set(["top", "bottom"]), Ro = { type: "percentage" };
1420
+ function No(e, t) {
1418
1421
  const { scales: n, config: r, layers: s, coordSystem: a, variableLabels: o, geomRegistry: i } = e;
1419
- if (wn(s)) return [];
1422
+ if (Cn(s)) return [];
1420
1423
  if (a.type === "polar" && a.bandAxis === null) return [];
1421
- const c = Po(i, s, a.type, r), l = new Set(t.map((m) => m.position)), u = Bo($n(r.axes.y.position, a.axisMapping.y.position), l), d = [];
1422
- for (const m of Yr) {
1424
+ const c = $o(i, s, a.type, r), l = new Set(t.map((m) => m.position)), u = Fo(Fn(r.axes.y.position, a.axisMapping.y.position), l), d = [];
1425
+ for (const m of jr) {
1423
1426
  const f = n[m];
1424
1427
  if (!g(f) || f.kind !== "position") continue;
1425
- const p = No({
1428
+ const p = Oo({
1426
1429
  scaleAestheticKey: m,
1427
1430
  scale: f,
1428
1431
  config: r,
@@ -1436,8 +1439,8 @@ function Ro(e, t) {
1436
1439
  }
1437
1440
  return d;
1438
1441
  }
1439
- function No(e) {
1440
- const { scaleAestheticKey: t, scale: n, config: r, layers: s, axisMapping: a, resolvedYPosition: o, gridOverrides: i, variableLabels: c } = e, { axisConfig: l, position: u, geometry: d } = $o(t, r, a, o), m = z(s, t), f = To(s, t) ? Do : K({
1442
+ function Oo(e) {
1443
+ const { scaleAestheticKey: t, scale: n, config: r, layers: s, axisMapping: a, resolvedYPosition: o, gridOverrides: i, variableLabels: c } = e, { axisConfig: l, position: u, geometry: d } = Bo(t, r, a, o), m = z(s, t), f = xo(s, t) ? Ro : K({
1441
1444
  layers: s,
1442
1445
  scaleType: n.spec.scaleType,
1443
1446
  variableName: m
@@ -1446,21 +1449,21 @@ function No(e) {
1446
1449
  scaleAestheticKey: t,
1447
1450
  position: u,
1448
1451
  geometry: d,
1449
- label: Oo(l, m, c),
1452
+ label: Po(l, m, c),
1450
1453
  isVisible: l.isVisible,
1451
- tickCandidates: Uo(n, f, l.ticks.mode),
1454
+ tickCandidates: Go(n, f, l.ticks.mode),
1452
1455
  valueFormat: f,
1453
1456
  tickMode: l.ticks.mode,
1454
1457
  ticksVisible: l.ticks.isVisible,
1455
- gridVisible: Fo(l, i, t),
1458
+ gridVisible: Uo(l, i, t),
1456
1459
  scaleType: n.spec.scaleType,
1457
1460
  bandwidth: n.bandwidth ?? void 0
1458
1461
  };
1459
1462
  }
1460
- function Oo(e, t, n) {
1463
+ function Po(e, t, n) {
1461
1464
  return e.label ? e.label : t ? n[t] ?? null : null;
1462
1465
  }
1463
- function Po(e, t, n, r) {
1466
+ function $o(e, t, n, r) {
1464
1467
  const s = t.flatMap((i) => {
1465
1468
  const c = e.get(i.geom).grid[n];
1466
1469
  return c ? [c] : [];
@@ -1474,12 +1477,12 @@ function kt(e, t) {
1474
1477
  if (e && t === null)
1475
1478
  return !1;
1476
1479
  }
1477
- function $o(e, t, n, r) {
1480
+ function Bo(e, t, n, r) {
1478
1481
  switch (e) {
1479
1482
  case "x":
1480
1483
  return {
1481
1484
  axisConfig: t.axes[e],
1482
- position: $n(t.axes[e].position, n[e].position),
1485
+ position: Fn(t.axes[e].position, n[e].position),
1483
1486
  geometry: n.x.geometry
1484
1487
  };
1485
1488
  case "y":
@@ -1489,7 +1492,7 @@ function $o(e, t, n, r) {
1489
1492
  geometry: n.y.geometry
1490
1493
  };
1491
1494
  case "ySecondary": {
1492
- const s = Pn[r], a = tt({
1495
+ const s = Bn[r], a = tt({
1493
1496
  isVisible: t.axes.y.isVisible,
1494
1497
  label: null,
1495
1498
  position: s,
@@ -1504,32 +1507,32 @@ function $o(e, t, n, r) {
1504
1507
  }
1505
1508
  }
1506
1509
  }
1507
- function $n(e, t) {
1510
+ function Fn(e, t) {
1508
1511
  return Lt.has(e) === Lt.has(t) ? e : t;
1509
1512
  }
1510
- function Bo(e, t) {
1511
- return t.has(e) ? Pn[e] : e;
1513
+ function Fo(e, t) {
1514
+ return t.has(e) ? Bn[e] : e;
1512
1515
  }
1513
- function Fo(e, t, n) {
1516
+ function Uo(e, t, n) {
1514
1517
  const { gridVisible: r } = n === "x" ? t.x : t.y;
1515
- return r ?? e.grid.isVisible ?? ko[n];
1518
+ return r ?? e.grid.isVisible ?? _o[n];
1516
1519
  }
1517
- var Uo = (e, t, n) => {
1520
+ var Go = (e, t, n) => {
1518
1521
  const r = e.spec.scaleType === "continuous" || e.spec.scaleType === "datetime";
1519
1522
  if (n === "edges" && r) {
1520
- const s = Yo(e);
1523
+ const s = jo(e);
1521
1524
  if (s) return [s];
1522
1525
  }
1523
1526
  if (e.spec.scaleType === "continuous") {
1524
1527
  const s = /* @__PURE__ */ new Set(), a = [];
1525
- for (let o = 1; o <= _o; o++) {
1528
+ for (let o = 1; o <= Do; o++) {
1526
1529
  const i = e.generateTicks({ count: o }), c = C(i);
1527
1530
  s.has(c) || (s.add(c), a.push({ ticks: i.map((l) => ne(e, l)) }));
1528
1531
  }
1529
1532
  return a;
1530
1533
  }
1531
- return e.spec.scaleType === "datetime" ? Go(e, t) : [{ ticks: e.generateTicks().map((s) => ne(e, s)) }];
1532
- }, Go = (e, t) => {
1534
+ return e.spec.scaleType === "datetime" ? Yo(e, t) : [{ ticks: e.generateTicks().map((s) => ne(e, s)) }];
1535
+ }, Yo = (e, t) => {
1533
1536
  const [n, r] = e.domain;
1534
1537
  if (!k(n) || !k(r)) return [{ ticks: e.generateTicks().map((i) => ne(e, i)) }];
1535
1538
  const s = /* @__PURE__ */ new Set(), a = [], o = (i, c) => {
@@ -1540,25 +1543,25 @@ var Uo = (e, t, n) => {
1540
1543
  valueFormat: c
1541
1544
  }));
1542
1545
  };
1543
- for (const i of wo)
1544
- Vo({
1546
+ for (const i of Co)
1547
+ Io({
1545
1548
  ...i,
1546
1549
  start: n,
1547
1550
  stop: r
1548
- }) || Eo(i.unit, t) || o(e.generateTicks({ interval: i }), Io(i, t));
1551
+ }) || Mo(i.unit, t) || o(e.generateTicks({ interval: i }), Eo(i, t));
1549
1552
  return o(e.generateTicks({ atInputs: !0 })), a.sort((i, c) => i.ticks.length - c.ticks.length), a;
1550
- }, Yo = (e) => {
1553
+ }, jo = (e) => {
1551
1554
  const { domain: t } = e, n = t[0], r = t.at(-1);
1552
1555
  return !g(n) || !g(r) || C([n]) === C([r]) ? null : { ticks: [ne(e, n), ne(e, r)] };
1553
1556
  }, ne = (e, t) => ({
1554
1557
  value: t,
1555
1558
  position: e.map(t)
1556
1559
  });
1557
- function Bn({ scale: e, aesthetics: t, layers: n }) {
1558
- const r = jo({
1560
+ function Un({ scale: e, aesthetics: t, layers: n }) {
1561
+ const r = zo({
1559
1562
  layers: n,
1560
1563
  aesthetics: t
1561
- }), s = Fn({
1564
+ }), s = Gn({
1562
1565
  layers: n,
1563
1566
  aesthetics: t
1564
1567
  });
@@ -1568,8 +1571,8 @@ function Bn({ scale: e, aesthetics: t, layers: n }) {
1568
1571
  owner: s(a)
1569
1572
  }));
1570
1573
  }
1571
- function jo({ layers: e, aesthetics: t }) {
1572
- const n = Fn({
1574
+ function zo({ layers: e, aesthetics: t }) {
1575
+ const n = Gn({
1573
1576
  layers: e,
1574
1577
  aesthetics: t
1575
1578
  }), r = e.find((a) => t.some((o) => g(a.mapping[o]))), s = r ? r.geom : "bar";
@@ -1578,7 +1581,7 @@ function jo({ layers: e, aesthetics: t }) {
1578
1581
  return o ? o.layer.geom : s;
1579
1582
  };
1580
1583
  }
1581
- function Fn({ layers: e, aesthetics: t, layerFilter: n }) {
1584
+ function Gn({ layers: e, aesthetics: t, layerFilter: n }) {
1582
1585
  const r = /* @__PURE__ */ new Map();
1583
1586
  for (const [s, a] of e.entries()) {
1584
1587
  if (n && !n(a)) continue;
@@ -1601,19 +1604,19 @@ var it = (e) => {
1601
1604
  const t = e.spec.scaleType;
1602
1605
  return t !== "continuous" && t !== "datetime";
1603
1606
  };
1604
- function zo({ scales: e, layers: t, valueLabels: n }) {
1607
+ function Ko({ scales: e, layers: t, valueLabels: n }) {
1605
1608
  const r = e.color;
1606
1609
  if (r === void 0 || !it(r)) return [];
1607
1610
  if (!t.some((i) => g(i.mapping.color))) return [];
1608
1611
  const s = z(t, "color");
1609
- if (Un({
1612
+ if (Yn({
1610
1613
  colorVariableName: s,
1611
1614
  xVariableName: z(t, "x"),
1612
- mapsColorAcrossMultipleLayers: Wo(t) > 1,
1613
- isMergedWithAnotherAesthetic: Ko(e, t, s)
1615
+ mapsColorAcrossMultipleLayers: qo(t) > 1,
1616
+ isMergedWithAnotherAesthetic: Wo(e, t, s)
1614
1617
  })) return [];
1615
1618
  const a = r.spec.scaleType, o = t.findIndex((i) => g(i.mapping.color));
1616
- return Bn({
1619
+ return Un({
1617
1620
  scale: r,
1618
1621
  aesthetics: ["color"],
1619
1622
  layers: t
@@ -1629,14 +1632,14 @@ function zo({ scales: e, layers: t, valueLabels: n }) {
1629
1632
  scaleType: a,
1630
1633
  variableName: m
1631
1634
  }),
1632
- label: Ao(i, n)
1635
+ label: To(i, n)
1633
1636
  };
1634
1637
  });
1635
1638
  }
1636
- var Un = ({ colorVariableName: e, xVariableName: t, mapsColorAcrossMultipleLayers: n, isMergedWithAnotherAesthetic: r }) => r ? !1 : e === null || et(e) ? !n : t !== null && e === t;
1637
- function Ko(e, t, n) {
1639
+ var Yn = ({ colorVariableName: e, xVariableName: t, mapsColorAcrossMultipleLayers: n, isMergedWithAnotherAesthetic: r }) => r ? !1 : e === null || et(e) ? !n : t !== null && e === t;
1640
+ function Wo(e, t, n) {
1638
1641
  if (n === null) return !1;
1639
- for (const r of dn) {
1642
+ for (const r of mn) {
1640
1643
  if (r === "color") continue;
1641
1644
  const s = e[r];
1642
1645
  if (!(s === void 0 || !it(s)) && z(t, r) === n)
@@ -1644,18 +1647,18 @@ function Ko(e, t, n) {
1644
1647
  }
1645
1648
  return !1;
1646
1649
  }
1647
- var Wo = (e) => e.filter((t) => g(t.mapping.color)).length;
1648
- function Gn(e, t) {
1650
+ var qo = (e) => e.filter((t) => g(t.mapping.color)).length;
1651
+ function jn(e, t) {
1649
1652
  return e.get(t.geom).summaries.perGroupHeadline === !0;
1650
1653
  }
1651
- function qo(e, t, n, r) {
1652
- const s = n.findIndex((a) => Gn(e, a));
1654
+ function Ho(e, t, n, r) {
1655
+ const s = n.findIndex((a) => jn(e, a));
1653
1656
  return s === -1 ? [] : t.length < 2 ? [{
1654
1657
  value: null,
1655
1658
  swatch: null,
1656
1659
  layerIndex: s,
1657
1660
  groupLabelFormat: { type: "text" },
1658
- label: Nn(S(n[s]?.mapping.y), r)
1661
+ label: Pn(S(n[s]?.mapping.y), r)
1659
1662
  }] : t.map((a) => ({
1660
1663
  value: a.value,
1661
1664
  swatch: {
@@ -1674,7 +1677,7 @@ function _t(e, t, n) {
1674
1677
  const r = C(n);
1675
1678
  return e.filter((s, a) => C(t[a] ?? null) === r);
1676
1679
  }
1677
- var Ho = (e) => e === "none" ? "first" : e, Xo = (e, t) => {
1680
+ var Xo = (e) => e === "none" ? "first" : e, Jo = (e, t) => {
1678
1681
  switch (t) {
1679
1682
  case "total": {
1680
1683
  const { sum: n, count: r } = Dt(e);
@@ -1687,7 +1690,7 @@ var Ho = (e) => e === "none" ? "first" : e, Xo = (e, t) => {
1687
1690
  case "current":
1688
1691
  return e.at(-1) ?? null;
1689
1692
  }
1690
- }, Jo = (e, t) => {
1693
+ }, Qo = (e, t) => {
1691
1694
  if (e.length < 2) return null;
1692
1695
  const n = e.at(-1), r = t === "previous" ? e.at(-2) : e.at(0);
1693
1696
  return n === void 0 || r === void 0 || n.cross === null || r.cross === null || r.cross === 0 ? null : {
@@ -1701,11 +1704,11 @@ var Ho = (e) => e === "none" ? "first" : e, Xo = (e, t) => {
1701
1704
  sum: 0,
1702
1705
  count: 0
1703
1706
  });
1704
- function Qo(e) {
1707
+ function Zo(e) {
1705
1708
  const { config: t, coordSystem: n } = e, r = t.headline.show;
1706
- return r === "none" || r === "conversion" ? null : n.type === "polar" ? Zo(e, r) : ei(e, r);
1709
+ return r === "none" || r === "conversion" ? null : n.type === "polar" ? ei(e, r) : ti(e, r);
1707
1710
  }
1708
- function Zo(e, t) {
1711
+ function ei(e, t) {
1709
1712
  if (t !== "total") return null;
1710
1713
  const { scales: n, layers: r } = e, s = r.find((i) => i.summary.grandTotal !== void 0);
1711
1714
  if (s === void 0) return null;
@@ -1722,12 +1725,12 @@ function Zo(e, t) {
1722
1725
  })
1723
1726
  };
1724
1727
  }
1725
- function ei(e, t) {
1728
+ function ti(e, t) {
1726
1729
  const { config: n, scales: r, layers: s, variableLabels: a, colorGroups: o, geomRegistry: i } = e;
1727
- if (!s.some((u) => Gn(i, u))) return null;
1728
- const c = qo(i, o, s, a);
1730
+ if (!s.some((u) => jn(i, u))) return null;
1731
+ const c = Ho(i, o, s, a);
1729
1732
  if (c.length === 0) return null;
1730
- const l = c.map((u) => ti({
1733
+ const l = c.map((u) => ni({
1731
1734
  group: u,
1732
1735
  show: t,
1733
1736
  compareWith: n.headline.compareWith,
@@ -1739,7 +1742,7 @@ function ei(e, t) {
1739
1742
  items: l
1740
1743
  };
1741
1744
  }
1742
- function ti({ group: e, show: t, compareWith: n, layers: r, scales: s }) {
1745
+ function ni({ group: e, show: t, compareWith: n, layers: r, scales: s }) {
1743
1746
  const a = r[e.layerIndex];
1744
1747
  if (a === void 0) return null;
1745
1748
  const o = S(a.mapping.y);
@@ -1748,24 +1751,24 @@ function ti({ group: e, show: t, compareWith: n, layers: r, scales: s }) {
1748
1751
  layers: [a],
1749
1752
  scaleType: l?.spec.scaleType ?? "continuous",
1750
1753
  variableName: o
1751
- }), d = si(a.data, i), m = K({
1754
+ }), d = ai(a.data, i), m = K({
1752
1755
  layers: [a],
1753
1756
  scaleType: d ? "datetime" : s.x?.spec.scaleType ?? "discrete",
1754
1757
  variableName: i
1755
- }), f = ai(a.data, i), p = f.getValues(o, { type: "numeric" }), b = i !== null ? f.getValues(i) : [], v = c !== null ? f.getValues(c) : null, y = _t(p, v, e.value), A = _t(b, v, e.value);
1758
+ }), f = oi(a.data, i), p = f.getValues(o, { type: "numeric" }), b = i !== null ? f.getValues(i) : [], v = c !== null ? f.getValues(c) : null, y = _t(p, v, e.value), A = _t(b, v, e.value);
1756
1759
  return {
1757
1760
  value: e.value,
1758
1761
  swatch: e.swatch,
1759
- aggregate: Xo(y, t),
1762
+ aggregate: Jo(y, t),
1760
1763
  valueFormat: u,
1761
1764
  groupLabelFormat: e.groupLabelFormat,
1762
1765
  mainValueFormat: m,
1763
1766
  label: e.label,
1764
- caption: ni(t, d, A),
1765
- comparison: ri(t, n, d, A, y)
1767
+ caption: ri(t, d, A),
1768
+ comparison: si(t, n, d, A, y)
1766
1769
  };
1767
1770
  }
1768
- function ni(e, t, n) {
1771
+ function ri(e, t, n) {
1769
1772
  if (e === "current") {
1770
1773
  const a = n.at(-1);
1771
1774
  return a === void 0 ? null : {
@@ -1781,57 +1784,57 @@ function ni(e, t, n) {
1781
1784
  to: s
1782
1785
  };
1783
1786
  }
1784
- function ri(e, t, n, r, s) {
1785
- return e !== "current" || !n ? null : Jo(r.map((a, o) => ({
1787
+ function si(e, t, n, r, s) {
1788
+ return e !== "current" || !n ? null : Qo(r.map((a, o) => ({
1786
1789
  main: a,
1787
1790
  cross: s[o] ?? null
1788
- })), Ho(t));
1791
+ })), Xo(t));
1789
1792
  }
1790
- function si(e, t) {
1793
+ function ai(e, t) {
1791
1794
  return t !== null && e.hasVariable(t) && e.getType(t) === "temporal";
1792
1795
  }
1793
- function ai(e, t) {
1796
+ function oi(e, t) {
1794
1797
  return t === null || !["numeric", "temporal"].includes(e.getType(t)) ? e : e.orderBy(t);
1795
1798
  }
1796
- function Md(e, ...t) {
1799
+ function Ld(e, ...t) {
1797
1800
  return e ? t.includes(e.geom) : !1;
1798
1801
  }
1799
- function Ld(e, t) {
1802
+ function kd(e, t) {
1800
1803
  return e.find((n) => n.id === t);
1801
1804
  }
1802
- function kd(e, ...t) {
1805
+ function _d(e, ...t) {
1803
1806
  return e.find((n) => t.includes(n.geom));
1804
1807
  }
1805
- function _d(e, ...t) {
1808
+ function Dd(e, ...t) {
1806
1809
  return e.filter((n) => t.includes(n.geom));
1807
1810
  }
1808
- function oi(e, t) {
1809
- return e.interactive ? !1 : t.some((n) => n !== e && nn(n.mapping, e.mapping));
1811
+ function ii(e, t) {
1812
+ return e.interactive ? !1 : t.some((n) => n !== e && rn(n.mapping, e.mapping));
1810
1813
  }
1811
- function Dd(e, t) {
1812
- return t.filter((n) => n !== e && !n.interactive && nn(e.mapping, n.mapping));
1814
+ function Rd(e, t) {
1815
+ return t.filter((n) => n !== e && !n.interactive && rn(e.mapping, n.mapping));
1813
1816
  }
1814
- function Yn(e) {
1815
- const t = e.filter((n) => !oi(n, e));
1817
+ function zn(e) {
1818
+ const t = e.filter((n) => !ii(n, e));
1816
1819
  return t.length > 0 ? t : e;
1817
1820
  }
1818
- function ii({ legendPosition: e, coordSystem: t, layers: n }) {
1821
+ function ci({ legendPosition: e, coordSystem: t, layers: n }) {
1819
1822
  if (e !== "right" || t.type !== "cartesian" || t.mainAxis !== "x") return !1;
1820
- const r = Yn(n);
1823
+ const r = zn(n);
1821
1824
  return r.length === 1 && r[0]?.supportsDirectLabels === !0;
1822
1825
  }
1823
- var ci = 3;
1824
- function li({ scales: e, config: t, layers: n, coordSystem: r, variableLabels: s, colorGroups: a, geomRegistry: o }) {
1826
+ var li = 3;
1827
+ function ui({ scales: e, config: t, layers: n, coordSystem: r, variableLabels: s, colorGroups: a, geomRegistry: o }) {
1825
1828
  if (t.legend.position === "none") return {
1826
1829
  drawn: [],
1827
1830
  position: "none"
1828
1831
  };
1829
- const i = new Map(a.map((v) => [C(v.value), v])), c = yi(pi({
1832
+ const i = new Map(a.map((v) => [C(v.value), v])), c = vi(fi({
1830
1833
  scales: e,
1831
1834
  layers: n
1832
1835
  })), l = z(n, "x"), u = c.map((v) => {
1833
- if (gi(v, l, n)) return null;
1834
- const y = bi({
1836
+ if (hi(v, l, n)) return null;
1837
+ const y = Si({
1835
1838
  group: v,
1836
1839
  variableLabels: s,
1837
1840
  layers: n,
@@ -1841,22 +1844,22 @@ function li({ scales: e, config: t, layers: n, coordSystem: r, variableLabels: s
1841
1844
  group: v,
1842
1845
  built: y
1843
1846
  };
1844
- }).filter(g), d = ui(u), m = Yn(n), f = Ci(o, t.legend.position, d, m, r);
1847
+ }).filter(g), d = di(u), m = zn(n), f = Vi(o, t.legend.position, d, m, r);
1845
1848
  if (u.length === 0) return {
1846
1849
  drawn: [],
1847
1850
  position: f
1848
1851
  };
1849
- if (t.legend.position === "auto" && wi(o, d, m, r)) return {
1852
+ if (t.legend.position === "auto" && Ci(o, d, m, r)) return {
1850
1853
  drawn: [],
1851
1854
  position: f
1852
1855
  };
1853
- const p = Vi(t.legend.display, {
1856
+ const p = Ii(t.legend.display, {
1854
1857
  legendPosition: f,
1855
1858
  coordSystem: r,
1856
1859
  layers: n
1857
- }), b = p === "direct" ? Li(m[0]) : null;
1860
+ }), b = p === "direct" ? ki(m[0]) : null;
1858
1861
  return {
1859
- drawn: u.map(({ built: v }) => di(v, {
1862
+ drawn: u.map(({ built: v }) => mi(v, {
1860
1863
  position: f,
1861
1864
  display: p,
1862
1865
  align: t.legend.align
@@ -1864,11 +1867,11 @@ function li({ scales: e, config: t, layers: n, coordSystem: r, variableLabels: s
1864
1867
  position: f
1865
1868
  };
1866
1869
  }
1867
- function ui(e) {
1870
+ function di(e) {
1868
1871
  return e.reduce((t, { group: n, built: r }) => t + (n.some((s) => s.guideType !== "discrete") ? 1 : r.items.length), 0);
1869
1872
  }
1870
- function di(e, t, n) {
1871
- const { position: r, display: s } = t, a = mi(t.align, r);
1873
+ function mi(e, t, n) {
1874
+ const { position: r, display: s } = t, a = pi(t.align, r);
1872
1875
  return s !== "direct" || n === null ? {
1873
1876
  ...e,
1874
1877
  position: r,
@@ -1885,15 +1888,15 @@ function di(e, t, n) {
1885
1888
  }))
1886
1889
  };
1887
1890
  }
1888
- function mi(e, t) {
1891
+ function pi(e, t) {
1889
1892
  return e !== "auto" ? e : t === "top" || t === "bottom" ? "start" : "center";
1890
1893
  }
1891
- function pi(e) {
1894
+ function fi(e) {
1892
1895
  const { scales: t, layers: n } = e, r = [];
1893
- for (const s of dn) {
1896
+ for (const s of mn) {
1894
1897
  const a = t[s];
1895
- if (a === void 0 || a.kind === "identity" || !fi(s, n)) continue;
1896
- const o = z(n, s), i = Mi(s, a);
1898
+ if (a === void 0 || a.kind === "identity" || !gi(s, n)) continue;
1899
+ const o = z(n, s), i = Li(s, a);
1897
1900
  r.push({
1898
1901
  scaleAestheticKey: s,
1899
1902
  scale: a,
@@ -1903,32 +1906,32 @@ function pi(e) {
1903
1906
  }
1904
1907
  return r;
1905
1908
  }
1906
- function fi(e, t) {
1909
+ function gi(e, t) {
1907
1910
  const n = E(e);
1908
1911
  return t.some((r) => g(r.mapping[n]));
1909
1912
  }
1910
- function gi(e, t, n) {
1913
+ function hi(e, t, n) {
1911
1914
  const [r] = e;
1912
- return r.scaleAestheticKey !== "color" ? !1 : Un({
1915
+ return r.scaleAestheticKey !== "color" ? !1 : Yn({
1913
1916
  colorVariableName: r.variableName,
1914
1917
  xVariableName: t,
1915
- mapsColorAcrossMultipleLayers: hi(r.scaleAestheticKey, n),
1918
+ mapsColorAcrossMultipleLayers: yi(r.scaleAestheticKey, n),
1916
1919
  isMergedWithAnotherAesthetic: e.length > 1
1917
1920
  });
1918
1921
  }
1919
- function hi(e, t) {
1922
+ function yi(e, t) {
1920
1923
  const n = E(e);
1921
1924
  return t.filter((r) => g(r.mapping[n])).length > 1;
1922
1925
  }
1923
- function yi(e) {
1926
+ function vi(e) {
1924
1927
  const t = /* @__PURE__ */ new Map();
1925
1928
  for (const n of e) {
1926
- const r = Ei(n), s = t.get(r);
1929
+ const r = Mi(n), s = t.get(r);
1927
1930
  s ? s.push(n) : t.set(r, [n]);
1928
1931
  }
1929
1932
  return [...t.values()];
1930
1933
  }
1931
- function vi(e, t, n) {
1934
+ function bi(e, t, n) {
1932
1935
  if (t === "lineType") {
1933
1936
  e.lineType = n;
1934
1937
  return;
@@ -1939,8 +1942,8 @@ function vi(e, t, n) {
1939
1942
  }
1940
1943
  e[t] = n;
1941
1944
  }
1942
- function bi({ group: e, variableLabels: t, layers: n, colorGroupsByValue: r }) {
1943
- const s = e[0], a = e.map((l) => E(l.scaleAestheticKey)), o = Bn({
1945
+ function Si({ group: e, variableLabels: t, layers: n, colorGroupsByValue: r }) {
1946
+ const s = e[0], a = e.map((l) => E(l.scaleAestheticKey)), o = Un({
1944
1947
  scale: s.scale,
1945
1948
  aesthetics: a,
1946
1949
  layers: n
@@ -1951,21 +1954,21 @@ function bi({ group: e, variableLabels: t, layers: n, colorGroupsByValue: r }) {
1951
1954
  }), c = n.find((l) => a.some((u) => g(l.mapping[u])))?.id;
1952
1955
  return {
1953
1956
  aesthetics: e.map((l) => l.scaleAestheticKey),
1954
- title: Nn(s.variableName, t),
1955
- items: o.map((l) => Si(l, e, a, i, r, c))
1957
+ title: Pn(s.variableName, t),
1958
+ items: o.map((l) => Ai(l, e, a, i, r, c))
1956
1959
  };
1957
1960
  }
1958
- function Si(e, t, n, r, s, a) {
1961
+ function Ai(e, t, n, r, s, a) {
1959
1962
  const o = {};
1960
- for (const c of t) vi(o, c.scaleAestheticKey, c.scale.map(e.value));
1961
- if (o.color === void 0 && n.includes("size") && (o.color = an), o.lineType === void 0) {
1963
+ for (const c of t) bi(o, c.scaleAestheticKey, c.scale.map(e.value));
1964
+ if (o.color === void 0 && n.includes("size") && (o.color = on), o.lineType === void 0) {
1962
1965
  const c = se(e.owner?.layer.mapping.lineType);
1963
- fs(c) && (o.lineType = c);
1966
+ gs(c) && (o.lineType = c);
1964
1967
  }
1965
- const i = Ti(e, t, n, r, s);
1968
+ const i = xi(e, t, n, r, s);
1966
1969
  return {
1967
1970
  value: e.value,
1968
- label: Ai(t, e, s),
1971
+ label: Ti(t, e, s),
1969
1972
  visual: o,
1970
1973
  normalizedY: null,
1971
1974
  geom: e.geom,
@@ -1973,19 +1976,19 @@ function Si(e, t, n, r, s, a) {
1973
1976
  layerId: e.owner?.layer.id ?? a
1974
1977
  };
1975
1978
  }
1976
- function Ai(e, t, n) {
1979
+ function Ti(e, t, n) {
1977
1980
  return e[0].scaleAestheticKey !== "color" ? null : n.get(C(t.value))?.label ?? null;
1978
1981
  }
1979
- function Ti(e, t, n, r, s) {
1982
+ function xi(e, t, n, r, s) {
1980
1983
  if (t[0].scaleAestheticKey === "color") return s.get(C(e.value))?.valueFormat ?? r;
1981
- const a = e.owner?.layer, o = xi(a, n);
1984
+ const a = e.owner?.layer, o = wi(a, n);
1982
1985
  return a === void 0 || o === null ? r : K({
1983
1986
  layers: [a],
1984
1987
  scaleType: t[0].scale.spec.scaleType,
1985
1988
  variableName: o
1986
1989
  });
1987
1990
  }
1988
- function xi(e, t) {
1991
+ function wi(e, t) {
1989
1992
  if (e === void 0) return null;
1990
1993
  for (const n of t) {
1991
1994
  const r = e.mapping[n];
@@ -1995,29 +1998,29 @@ function xi(e, t) {
1995
1998
  }
1996
1999
  return null;
1997
2000
  }
1998
- function wi(e, t, n, r) {
2001
+ function Ci(e, t, n, r) {
1999
2002
  if (t > 1) return !1;
2000
2003
  const s = r.type === "polar";
2001
2004
  return n.some((a) => e.get(a.geom).legend.suppressWhenSingleItem || s);
2002
2005
  }
2003
- function Ci(e, t, n, r, s) {
2006
+ function Vi(e, t, n, r, s) {
2004
2007
  if (t !== "auto") return t;
2005
2008
  if (s.type === "polar") return "top";
2006
2009
  let a = !1, o = !1, i = !1;
2007
2010
  for (const l of r) {
2008
2011
  const { sidePlacement: u } = e.get(l.geom).legend;
2009
- u === "whenCrowded" && (a = !0), u === "whenStackedVertical" && (o = !0, pe(l.position) && (i = !0));
2012
+ u === "whenCrowded" && (a = !0), u === "whenStackedVertical" && (o = !0, fe(l.position) && (i = !0));
2010
2013
  }
2011
- const c = n >= ci;
2012
- return a && o ? "top" : a ? c ? "right" : "top" : i ? Ii(s) ? "top" : c ? "right" : "top" : "top";
2014
+ const c = n >= li;
2015
+ return a && o ? "top" : a ? c ? "right" : "top" : i ? Ei(s) ? "top" : c ? "right" : "top" : "top";
2013
2016
  }
2014
- function Vi(e, t) {
2015
- return e === "pill" ? "pill" : ii(t) ? "direct" : "pill";
2017
+ function Ii(e, t) {
2018
+ return e === "pill" ? "pill" : ci(t) ? "direct" : "pill";
2016
2019
  }
2017
- function Ii(e) {
2020
+ function Ei(e) {
2018
2021
  return e.type === "cartesian" && e.mainAxis === "y";
2019
2022
  }
2020
- function Ei(e) {
2023
+ function Mi(e) {
2021
2024
  const t = e.scale.domain.map(C);
2022
2025
  return JSON.stringify([
2023
2026
  e.variableName,
@@ -2025,10 +2028,10 @@ function Ei(e) {
2025
2028
  ...t
2026
2029
  ]);
2027
2030
  }
2028
- function Mi(e, t) {
2031
+ function Li(e, t) {
2029
2032
  return it(t) ? "discrete" : `continuous:${e}`;
2030
2033
  }
2031
- function Li(e) {
2034
+ function ki(e) {
2032
2035
  if (!e) return /* @__PURE__ */ new Map();
2033
2036
  const t = /* @__PURE__ */ new Map();
2034
2037
  return e.data.groupBy(M.group).forEach((n) => {
@@ -2036,13 +2039,13 @@ function Li(e) {
2036
2039
  if (!r) return;
2037
2040
  const s = ke(r);
2038
2041
  if (!g(s)) return;
2039
- const a = pn(r), o = Ue(r) ?? bt(r);
2042
+ const a = fn(r), o = Ue(r) ?? bt(r);
2040
2043
  if (!g(o)) return;
2041
2044
  const i = g(a) ? (a + o) / 2 : o;
2042
2045
  t.set(String(s), i);
2043
2046
  }), t;
2044
2047
  }
2045
- var ki = class extends W {
2048
+ var _i = class extends W {
2046
2049
  constructor(e) {
2047
2050
  super(), this.container = e;
2048
2051
  }
@@ -2058,10 +2061,10 @@ var ki = class extends W {
2058
2061
  ];
2059
2062
  }
2060
2063
  run(e) {
2061
- const t = bo(e.originalData), n = zo({
2064
+ const t = So(e.originalData), n = Ko({
2062
2065
  scales: e.scales,
2063
2066
  layers: e.layers,
2064
- valueLabels: So(e.originalData, e.layers, t)
2067
+ valueLabels: Ao(e.originalData, e.layers, t)
2065
2068
  }), r = {
2066
2069
  scales: e.scales,
2067
2070
  config: e.config,
@@ -2070,43 +2073,43 @@ var ki = class extends W {
2070
2073
  variableLabels: t,
2071
2074
  colorGroups: n,
2072
2075
  geomRegistry: this.container.geomRegistry
2073
- }, s = Qo(r), a = li(r), o = {
2076
+ }, s = Zo(r), a = ui(r), o = {
2074
2077
  ...a,
2075
- drawn: _i(s, a.drawn)
2078
+ drawn: Di(s, a.drawn)
2076
2079
  };
2077
2080
  return {
2078
- axes: Ro(r, o.drawn),
2081
+ axes: No(r, o.drawn),
2079
2082
  legends: o,
2080
2083
  headline: s,
2081
2084
  colorGroups: n,
2082
2085
  variableLabels: t
2083
2086
  };
2084
2087
  }
2085
- }, _i = (e, t) => e?.kind !== "perGroup" || t.some((n) => n.display === "direct") ? t : [], Rt = (e, t, n) => {
2088
+ }, Di = (e, t) => e?.kind !== "perGroup" || t.some((n) => n.display === "direct") ? t : [], Rt = (e, t, n) => {
2086
2089
  switch (e) {
2087
2090
  case "series":
2088
- return Ri(t);
2091
+ return Ni(t);
2089
2092
  case "x-value":
2090
- return jn(t, n);
2093
+ return Kn(t, n);
2091
2094
  }
2092
- }, Di = (e) => {
2093
- const t = Er(e);
2095
+ }, Ri = (e) => {
2096
+ const t = Zt(e);
2094
2097
  return t === "" ? null : t;
2095
- }, Ri = (e) => C([ke(e)]), jn = (e, t) => C([t !== null ? e[t] ?? null : null]);
2096
- function Ni(e) {
2098
+ }, Ni = (e) => C([ke(e)]), Kn = (e, t) => C([t !== null ? e[t] ?? null : null]);
2099
+ function Oi(e) {
2097
2100
  return e === null ? null : {
2098
2101
  strategy: e,
2099
- composition: zn()
2102
+ composition: Wn()
2100
2103
  };
2101
2104
  }
2102
- function zn() {
2105
+ function Wn() {
2103
2106
  return {
2104
2107
  isDimmed: !1,
2105
2108
  matchedLayer: null,
2106
2109
  overlayCandidates: []
2107
2110
  };
2108
2111
  }
2109
- var Oi = class extends q {
2112
+ var Pi = class extends q {
2110
2113
  constructor(e) {
2111
2114
  super(), this.container = e, this.warningsByLayer = /* @__PURE__ */ new WeakMap();
2112
2115
  }
@@ -2123,7 +2126,7 @@ var Oi = class extends q {
2123
2126
  if (n === null) return e;
2124
2127
  const r = t.highlights.filter(({ layerId: i }) => i === void 0 || i === e.id);
2125
2128
  if (r.length === 0) return e;
2126
- const s = [], a = Pi({
2129
+ const s = [], a = $i({
2127
2130
  layer: e,
2128
2131
  highlights: r,
2129
2132
  parsingLocale: t.config.parsingLocale,
@@ -2139,7 +2142,7 @@ var Oi = class extends q {
2139
2142
  return this.warningsByLayer.set(o, s), o;
2140
2143
  }
2141
2144
  };
2142
- function Pi({ layer: e, highlights: t, parsingLocale: n, strategy: r, warnings: s }) {
2145
+ function $i({ layer: e, highlights: t, parsingLocale: n, strategy: r, warnings: s }) {
2143
2146
  const a = t.filter((T) => {
2144
2147
  const D = te(T.predicate, e.data);
2145
2148
  for (const R of D) s.push({
@@ -2147,7 +2150,7 @@ function Pi({ layer: e, highlights: t, parsingLocale: n, strategy: r, warnings:
2147
2150
  message: `${R.message} Dropping this highlight.`
2148
2151
  });
2149
2152
  return D.length === 0;
2150
- }), o = Di(e.mapping), i = at(e, n), c = a.map((T) => ({
2153
+ }), o = Ri(e.mapping), i = at(e, n), c = a.map((T) => ({
2151
2154
  predicate: ee(T.predicate, i),
2152
2155
  scope: T.scope
2153
2156
  })), l = c.some(({ scope: T }) => T === "series"), u = c.some(({ scope: T }) => T === "x-value"), d = r === "overlay-anchor", m = e.data.size(), f = l ? new Array(m) : null, p = u ? new Array(m) : null, b = d ? new Array(m) : null, v = new Uint8Array(m), y = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set();
@@ -2155,9 +2158,9 @@ function Pi({ layer: e, highlights: t, parsingLocale: n, strategy: r, warnings:
2155
2158
  for (const T of e.data) {
2156
2159
  let D, R;
2157
2160
  f !== null && (D = Rt("series", T, o), f[V] = D), p !== null && (R = Rt("x-value", T, o), p[V] = R), b !== null && (b[V] = T);
2158
- for (const { predicate: be, scope: Se } of c)
2159
- if (be(T))
2160
- switch (Se) {
2161
+ for (const { predicate: Se, scope: Ae } of c)
2162
+ if (Se(T))
2163
+ switch (Ae) {
2161
2164
  case "series":
2162
2165
  D !== void 0 && y.add(D);
2163
2166
  break;
@@ -2170,16 +2173,16 @@ function Pi({ layer: e, highlights: t, parsingLocale: n, strategy: r, warnings:
2170
2173
  }
2171
2174
  V++;
2172
2175
  }
2173
- if (y.size === 0 && A.size === 0 && !$) return zn();
2176
+ if (y.size === 0 && A.size === 0 && !$) return Wn();
2174
2177
  const L = new Uint8Array(m), ae = [];
2175
2178
  let H = 0;
2176
2179
  for (let T = 0; T < m; T++) {
2177
- const D = f?.[T], R = p?.[T], be = D !== void 0 && y.has(D), Se = R !== void 0 && A.has(R), mt = v[T] === 1;
2180
+ const D = f?.[T], R = p?.[T], Se = D !== void 0 && y.has(D), Ae = R !== void 0 && A.has(R), mt = v[T] === 1;
2178
2181
  if (r === "observation-rerender")
2179
- (be || mt || Se) && (L[T] = 1, H++);
2180
- else if (be)
2182
+ (Se || mt || Ae) && (L[T] = 1, H++);
2183
+ else if (Se)
2181
2184
  L[T] = 1, H++;
2182
- else if (mt || Se) {
2185
+ else if (mt || Ae) {
2183
2186
  const pt = b?.[T];
2184
2187
  pt !== void 0 && ae.push({
2185
2188
  observation: pt,
@@ -2197,8 +2200,8 @@ function Pi({ layer: e, highlights: t, parsingLocale: n, strategy: r, warnings:
2197
2200
  overlayCandidates: ae
2198
2201
  };
2199
2202
  }
2200
- var $i = ge("__ungrouped__");
2201
- function Bi(e) {
2203
+ var Bi = he("__ungrouped__");
2204
+ function Fi(e) {
2202
2205
  const t = e.getVariableNames().filter((s) => e.getType(s) === "temporal" && Qt(e.getValueFormat(s)));
2203
2206
  if (t.length === 0) return e;
2204
2207
  const n = e.getValues(M.group, { type: "categorical" });
@@ -2206,15 +2209,15 @@ function Bi(e) {
2206
2209
  for (const s of t) {
2207
2210
  const a = r.getValues(s, { type: "temporal" }), o = /* @__PURE__ */ new Map(), i = a.map((c, l) => {
2208
2211
  if (c === null) return null;
2209
- const u = n[l] ?? $i;
2212
+ const u = n[l] ?? Bi;
2210
2213
  let d = o.get(u);
2211
- return d || (d = new ls(), o.set(u, d)), d.incrementYearIfNeeded(c);
2214
+ return d || (d = new us(), o.set(u, d)), d.incrementYearIfNeeded(c);
2212
2215
  });
2213
2216
  r = r.addVariable(s, "temporal", i);
2214
2217
  }
2215
2218
  return r;
2216
2219
  }
2217
- var Fi = () => ({
2220
+ var Ui = () => ({
2218
2221
  defaults: [],
2219
2222
  overrides: [],
2220
2223
  warnings: [],
@@ -2222,9 +2225,9 @@ var Fi = () => ({
2222
2225
  vocabulary: j.geom.vocabulary,
2223
2226
  aesthetics: j.geom.aesthetics
2224
2227
  },
2225
- dashPresets: Zt.line,
2228
+ dashPresets: en.line,
2226
2229
  parts: {}
2227
- }), Ui = class extends q {
2230
+ }), Gi = class extends q {
2228
2231
  constructor(e, t, n, r, s, a) {
2229
2232
  super(), this.container = e, this.transformCompiler = t, this.statCompiler = n, this.groupCompiler = r, this.geomCompiler = s, this.positionAdjusterCompiler = a;
2230
2233
  }
@@ -2261,7 +2264,7 @@ var Fi = () => ({
2261
2264
  mapping: c,
2262
2265
  xScaleIsDiscrete: r,
2263
2266
  params: { ...e.params },
2264
- requiredAesthetics: rn(this.container.geomRegistry.get(e.geom))
2267
+ requiredAesthetics: sn(this.container.geomRegistry.get(e.geom))
2265
2268
  });
2266
2269
  return {
2267
2270
  data: l.data,
@@ -2274,7 +2277,7 @@ var Fi = () => ({
2274
2277
  }).data,
2275
2278
  mapping: c
2276
2279
  })).pipe(({ data: i, mapping: c }) => ({
2277
- data: Bi(i),
2280
+ data: Fi(i),
2278
2281
  mapping: c
2279
2282
  })).pipe(({ data: i, mapping: c }) => {
2280
2283
  const l = this.geomCompiler.compile(e.geom, {
@@ -2319,46 +2322,46 @@ var Fi = () => ({
2319
2322
  tooltip: o.tooltip,
2320
2323
  scaleConstraints: o.scaleConstraints,
2321
2324
  supportsDirectLabels: o.legend.directLabelSupport?.[e.position] === !0,
2322
- highlight: Ni(o.highlightStrategy),
2323
- styles: Fi()
2325
+ highlight: Oi(o.highlightStrategy),
2326
+ styles: Ui()
2324
2327
  };
2325
2328
  }
2326
2329
  };
2327
2330
  function Nt(e) {
2328
2331
  return e.scales.some((t) => t.scaledAesthetic === "x" && t.scaleType === "discrete");
2329
2332
  }
2330
- function Kn(e, t) {
2333
+ function qn(e, t) {
2331
2334
  const [n] = t;
2332
2335
  if (n) {
2333
2336
  for (const r of t) e.addError(r);
2334
2337
  throw new w(n);
2335
2338
  }
2336
2339
  }
2337
- function Wn(e, t) {
2340
+ function Hn(e, t) {
2338
2341
  return t.map((n) => ({
2339
2342
  ...n,
2340
2343
  scaleConstraints: e.has(n.geom) ? e.get(n.geom).scaleConstraints : void 0
2341
2344
  }));
2342
2345
  }
2343
- function Gi(e) {
2344
- return e.some((t) => pe(t.position) || t.scaleConstraints?.bandPadding === 0);
2346
+ function Yi(e) {
2347
+ return e.some((t) => fe(t.position) || t.scaleConstraints?.bandPadding === 0);
2345
2348
  }
2346
- function qn(e) {
2347
- const t = Hn(e), n = {};
2349
+ function Xn(e) {
2350
+ const t = Jn(e), n = {};
2348
2351
  for (const { layer: s, scaleConstraints: a, crossAxis: o } of t)
2349
2352
  a.zeroBaseline === !0 && (n[o] = { nice: (n[o]?.nice ?? !0) && s.position !== "fill" });
2350
2353
  const r = t.find(({ scaleConstraints: s }) => s.discreteCrossAxis === !0);
2351
2354
  return {
2352
2355
  discreteAxis: t.some(({ scaleConstraints: s }) => s.discreteMainAxis === !0) ? "x" : null,
2353
2356
  discreteCrossAxis: r?.crossAxis ?? null,
2354
- bandedAxes: ji(t),
2357
+ bandedAxes: zi(t),
2355
2358
  zeroAxes: n,
2356
- bandPadding: zi(t),
2359
+ bandPadding: Ki(t),
2357
2360
  inferredColor: t.some(({ scaleConstraints: s }) => s.inferredColor === !0)
2358
2361
  };
2359
2362
  }
2360
- function Yi(e) {
2361
- const t = Hn(e);
2363
+ function ji(e) {
2364
+ const t = Jn(e);
2362
2365
  for (const n of t) {
2363
2366
  if (n.scaleConstraints.discreteCrossAxis !== !0) continue;
2364
2367
  const r = t.find((s) => s.scaleConstraints.zeroBaseline === !0 && s.crossAxis === n.crossAxis);
@@ -2376,7 +2379,7 @@ var Ot = ({ layer: e, index: t }) => ({
2376
2379
  layerIndex: t,
2377
2380
  geom: e.geom
2378
2381
  });
2379
- function Hn(e) {
2382
+ function Jn(e) {
2380
2383
  const t = [];
2381
2384
  return e.forEach((n, r) => {
2382
2385
  const { scaleConstraints: s, yScaleType: a } = n;
@@ -2388,28 +2391,28 @@ function Hn(e) {
2388
2391
  });
2389
2392
  }), t;
2390
2393
  }
2391
- function ji(e) {
2394
+ function zi(e) {
2392
2395
  const t = /* @__PURE__ */ new Set();
2393
2396
  for (const { scaleConstraints: n, crossAxis: r } of e)
2394
2397
  n.discreteMainAxis === !0 && t.add("x"), n.discreteCrossAxis === !0 && t.add(r);
2395
2398
  return [...t];
2396
2399
  }
2397
- function zi(e) {
2400
+ function Ki(e) {
2398
2401
  const t = {};
2399
2402
  for (const n of e) {
2400
2403
  const r = n.scaleConstraints.bandPadding;
2401
2404
  if (r !== void 0)
2402
- for (const s of Ki(n)) {
2405
+ for (const s of Wi(n)) {
2403
2406
  const a = t[s];
2404
2407
  t[s] = a === void 0 ? r : Math.min(a, r);
2405
2408
  }
2406
2409
  }
2407
2410
  return t;
2408
2411
  }
2409
- function Ki({ scaleConstraints: e, crossAxis: t }) {
2412
+ function Wi({ scaleConstraints: e, crossAxis: t }) {
2410
2413
  return e.discreteCrossAxis !== !0 ? ["x"] : e.discreteMainAxis === !0 ? ["x", t] : [t];
2411
2414
  }
2412
- var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2415
+ var qi = /* @__PURE__ */ new Set(["label", "group"]), Hi = class {
2413
2416
  constructor(e, t, n, r) {
2414
2417
  this.container = e, this.transformCompiler = t, this.statRegistry = n, this.layerCompiler = r;
2415
2418
  }
@@ -2445,10 +2448,10 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2445
2448
  t.push(...this.validateLayer(o));
2446
2449
  const i = [...this.collectUndeclaredAesthetics(o), ...this.collectPanelJustifyWarnings(o)];
2447
2450
  for (const c of i) this.container.diagnostics.addWarning(c);
2448
- }), t.push(...this.validateSharedScaleDemands(e.layers)), Kn(this.container.diagnostics, t);
2451
+ }), t.push(...this.validateSharedScaleDemands(e.layers)), qn(this.container.diagnostics, t);
2449
2452
  }
2450
2453
  checkPostCompile(e) {
2451
- wn(e) && this.container.diagnostics.addWarning({
2454
+ Cn(e) && this.container.diagnostics.addWarning({
2452
2455
  code: "EMPTY_DATASET",
2453
2456
  message: "No data to plot — every layer resolved to zero observations.",
2454
2457
  suggestion: "Check the dataset has rows and that transforms (filters, joins) are not removing them all."
@@ -2468,7 +2471,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2468
2471
  const { justify: o, showDataLabels: i } = a;
2469
2472
  if (!i || o !== "panel-start" && o !== "panel-end") return [];
2470
2473
  if (s === "polar" || !this.container.geomRegistry.get(e).isComposite) return [];
2471
- if (!$r(n, t)) return [];
2474
+ if (!Br(n, t)) return [];
2472
2475
  const c = o === "panel-end" ? "end" : "start";
2473
2476
  return [{
2474
2477
  code: "DATA_LABEL_PLACEMENT_COERCED",
@@ -2482,7 +2485,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2482
2485
  }];
2483
2486
  }
2484
2487
  validateRequiredAesthetics({ layerId: e, layerIndex: t, geom: n, stat: r, params: s, effectiveMapping: a }) {
2485
- const o = [], i = rn(this.container.geomRegistry.get(n)), c = this.resolveComputedVariables(r, s);
2488
+ const o = [], i = sn(this.container.geomRegistry.get(n)), c = this.resolveComputedVariables(r, s);
2486
2489
  for (const l of i)
2487
2490
  c.has(l) || g(a[l]) || o.push({
2488
2491
  code: "MISSING_AESTHETIC",
@@ -2514,7 +2517,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2514
2517
  validatePositionalAestheticTypes({ layerId: e, layerIndex: t, geom: n, stat: r, params: s, effectiveMapping: a, data: o }) {
2515
2518
  const { positionRoles: i } = this.container.geomRegistry.get(n), c = this.resolveComputedVariables(r, s), l = [];
2516
2519
  for (const u of i) {
2517
- if (!Pr.has(u.role) || !g(u.aes) || c.has(u.aes) || u.role === "scalar" && u.aes === u.axis) continue;
2520
+ if (!$r.has(u.role) || !g(u.aes) || c.has(u.aes) || u.role === "scalar" && u.aes === u.axis) continue;
2518
2521
  const d = S(a[u.aes]);
2519
2522
  if (d === null || !o.hasVariable(d) || o.size() === 0) continue;
2520
2523
  const m = o.getType(d);
@@ -2558,7 +2561,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2558
2561
  return this.statRegistry.get(e.type).resolveComputedVariables(e, t);
2559
2562
  }
2560
2563
  validateSharedScaleDemands(e) {
2561
- const t = Yi(Wn(this.container.geomRegistry, e));
2564
+ const t = ji(Hn(this.container.geomRegistry, e));
2562
2565
  if (t === null) return [];
2563
2566
  const { crossAxis: n, banded: r, zeroAnchored: s } = t;
2564
2567
  return [{
@@ -2590,7 +2593,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2590
2593
  }];
2591
2594
  }
2592
2595
  collectUndeclaredAesthetics({ layerId: e, layerIndex: t, geom: n, stat: r, params: s, effectiveMapping: a }) {
2593
- const { positionRoles: o, aesthetics: i } = this.container.geomRegistry.get(n), c = this.resolveComputedVariables(r, s), l = /* @__PURE__ */ new Set([...Fr(o), ...i.map((m) => m.name)]), u = Wi, d = [];
2596
+ const { positionRoles: o, aesthetics: i } = this.container.geomRegistry.get(n), c = this.resolveComputedVariables(r, s), l = /* @__PURE__ */ new Set([...Ur(o), ...i.map((m) => m.name)]), u = qi, d = [];
2594
2597
  for (const m of Object.keys(a))
2595
2598
  g(a[m]) && (l.has(m) || u.has(m) || c.has(m) || d.push({
2596
2599
  code: "UNDECLARED_AESTHETIC",
@@ -2602,7 +2605,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2602
2605
  }));
2603
2606
  return d;
2604
2607
  }
2605
- }, Hi = class extends re {
2608
+ }, Xi = class extends re {
2606
2609
  constructor(...e) {
2607
2610
  super(...e), this.type = "count", this.computedVariables = /* @__PURE__ */ new Set(["y"]);
2608
2611
  }
@@ -2620,7 +2623,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2620
2623
  context: { aesthetic: "y" },
2621
2624
  suggestion: "Remove the 'y' mapping; the 'count' stat computes it."
2622
2625
  });
2623
- const r = [.../* @__PURE__ */ new Set([n, ...fe(e, t)])];
2626
+ const r = [.../* @__PURE__ */ new Set([n, ...ge(e, t)])];
2624
2627
  return {
2625
2628
  data: e.groupBy(...r).rollup({ [I.count]: {
2626
2629
  variableName: n,
@@ -2629,7 +2632,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2629
2632
  mapping: { y: I.count }
2630
2633
  };
2631
2634
  }
2632
- }, Xi = class extends re {
2635
+ }, Ji = class extends re {
2633
2636
  constructor(...e) {
2634
2637
  super(...e), this.type = "identity", this.computedVariables = /* @__PURE__ */ new Set();
2635
2638
  }
@@ -2639,7 +2642,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2639
2642
  mapping: {}
2640
2643
  };
2641
2644
  }
2642
- }, Ji = class extends re {
2645
+ }, Qi = class extends re {
2643
2646
  constructor(...e) {
2644
2647
  super(...e), this.type = "mean", this.computedVariables = /* @__PURE__ */ new Set(["y"]);
2645
2648
  }
@@ -2675,7 +2678,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2675
2678
  mapping: { y: I.mean }
2676
2679
  };
2677
2680
  }
2678
- }, Qi = 2, Xn = 1440 * 60 * 1e3, Zi = class extends re {
2681
+ }, Zi = 2, Qn = 1440 * 60 * 1e3, ec = class extends re {
2679
2682
  constructor(...e) {
2680
2683
  super(...e), this.type = "smooth", this.computedVariables = /* @__PURE__ */ new Set();
2681
2684
  }
@@ -2704,7 +2707,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2704
2707
  variableType: i
2705
2708
  }
2706
2709
  });
2707
- const c = fe(e, t), l = oc(s, o, a, c, e);
2710
+ const c = ge(e, t), l = ic(s, o, a, c, e);
2708
2711
  return c.length === 0 ? Pt({
2709
2712
  data: e,
2710
2713
  xVariable: s,
@@ -2715,7 +2718,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2715
2718
  groupObservation: {},
2716
2719
  xScaleIsDiscrete: r
2717
2720
  }) : e.groupBy(...c).forEach((u) => {
2718
- const d = ic(u, c);
2721
+ const d = cc(u, c);
2719
2722
  Pt({
2720
2723
  data: u,
2721
2724
  xVariable: s,
@@ -2732,18 +2735,18 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2732
2735
  };
2733
2736
  }
2734
2737
  }, Pt = ({ data: e, xVariable: t, xType: n, yVariable: r, spec: s, output: a, groupObservation: o, xScaleIsDiscrete: i }) => {
2735
- const { observations: c, temporalOrigin: l } = ec({
2738
+ const { observations: c, temporalOrigin: l } = tc({
2736
2739
  data: e,
2737
2740
  xVariable: t,
2738
2741
  yVariable: r,
2739
2742
  xType: n
2740
2743
  });
2741
- c.length < Qi || (i ? ac({
2744
+ c.length < Zi || (i ? oc({
2742
2745
  observations: c,
2743
2746
  spec: s,
2744
2747
  output: a,
2745
2748
  groupObservation: o
2746
- }) : rc({
2749
+ }) : sc({
2747
2750
  observations: c,
2748
2751
  xType: n,
2749
2752
  temporalOrigin: l,
@@ -2751,12 +2754,12 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2751
2754
  output: a,
2752
2755
  groupObservation: o
2753
2756
  }));
2754
- }, ec = ({ data: e, xVariable: t, yVariable: n, xType: r }) => {
2755
- const s = e.getValues(t), a = e.getValues(n, { type: "numeric" }), o = r === "temporal" ? tc(s) : null, i = [], c = /* @__PURE__ */ new Map();
2757
+ }, tc = ({ data: e, xVariable: t, yVariable: n, xType: r }) => {
2758
+ const s = e.getValues(t), a = e.getValues(n, { type: "numeric" }), o = r === "temporal" ? nc(s) : null, i = [], c = /* @__PURE__ */ new Map();
2756
2759
  for (let l = 0; l < s.length; l++) {
2757
2760
  const u = s[l], d = a[l];
2758
2761
  if (!g(u) || !g(d) || !Number.isFinite(d)) continue;
2759
- const m = nc({
2762
+ const m = rc({
2760
2763
  xValue: u,
2761
2764
  xType: r,
2762
2765
  categoryRank: c,
@@ -2772,7 +2775,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2772
2775
  observations: i,
2773
2776
  temporalOrigin: o
2774
2777
  };
2775
- }, tc = (e) => {
2778
+ }, nc = (e) => {
2776
2779
  let t = null;
2777
2780
  for (const n of e) {
2778
2781
  if (!k(n)) continue;
@@ -2780,17 +2783,17 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2780
2783
  (t === null || r < t) && (t = r);
2781
2784
  }
2782
2785
  return t;
2783
- }, nc = ({ xValue: e, xType: t, categoryRank: n, temporalOrigin: r }) => {
2786
+ }, rc = ({ xValue: e, xType: t, categoryRank: n, temporalOrigin: r }) => {
2784
2787
  switch (t) {
2785
2788
  case "numeric":
2786
2789
  return !Y(e) || !Number.isFinite(e) ? null : e;
2787
2790
  case "temporal": {
2788
2791
  if (!k(e)) return null;
2789
2792
  const s = e.getTime();
2790
- return r === null ? s : (s - r) / Xn + 1;
2793
+ return r === null ? s : (s - r) / Qn + 1;
2791
2794
  }
2792
2795
  case "categorical": {
2793
- if (!en(e)) return null;
2796
+ if (!tn(e)) return null;
2794
2797
  const s = n.get(e);
2795
2798
  if (s !== void 0) return s;
2796
2799
  const a = n.size + 1;
@@ -2799,23 +2802,23 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2799
2802
  default:
2800
2803
  throw new x({ message: `Unexpected xType: ${t}` });
2801
2804
  }
2802
- }, rc = ({ observations: e, xType: t, temporalOrigin: n, spec: r, output: s, groupObservation: a }) => {
2803
- const o = Jn(r, e);
2805
+ }, sc = ({ observations: e, xType: t, temporalOrigin: n, spec: r, output: s, groupObservation: a }) => {
2806
+ const o = Zn(r, e);
2804
2807
  for (const [i, c] of o) {
2805
2808
  if (!Number.isFinite(i) || !Number.isFinite(c)) continue;
2806
- const l = t === "temporal" ? sc(i, n) : i;
2809
+ const l = t === "temporal" ? ac(i, n) : i;
2807
2810
  s.push({
2808
2811
  x: l,
2809
2812
  y: c,
2810
2813
  groupObservation: a
2811
2814
  });
2812
2815
  }
2813
- }, sc = (e, t) => t === null ? new Date(e) : new Date((e - 1) * Xn + t), ac = ({ observations: e, spec: t, output: n, groupObservation: r }) => {
2816
+ }, ac = (e, t) => t === null ? new Date(e) : new Date((e - 1) * Qn + t), oc = ({ observations: e, spec: t, output: n, groupObservation: r }) => {
2814
2817
  const s = /* @__PURE__ */ new Map();
2815
2818
  for (const i of e) s.has(i.x) || s.set(i.x, i.originalX);
2816
2819
  const a = [...s.keys()].sort((i, c) => i - c);
2817
2820
  if (t.method === "loess") {
2818
- const i = Jn(t, e), c = /* @__PURE__ */ new Map();
2821
+ const i = Zn(t, e), c = /* @__PURE__ */ new Map();
2819
2822
  for (const [l, u] of i)
2820
2823
  Number.isFinite(u) && (c.has(l) || c.set(l, u));
2821
2824
  for (const l of a) {
@@ -2828,7 +2831,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2828
2831
  }
2829
2832
  return;
2830
2833
  }
2831
- const o = Qn(t, e);
2834
+ const o = er(t, e);
2832
2835
  for (const i of a) {
2833
2836
  const c = s.get(i), l = o.predict(i);
2834
2837
  c === void 0 || !Number.isFinite(l) || n.push({
@@ -2837,25 +2840,25 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2837
2840
  groupObservation: r
2838
2841
  });
2839
2842
  }
2840
- }, Jn = (e, t) => e.method === "loess" ? ws().x((n) => n.x).y((n) => n.y).bandwidth(e.bandwidth)(t) : Qn(e, t), Qn = (e, t) => {
2843
+ }, Zn = (e, t) => e.method === "loess" ? Cs().x((n) => n.x).y((n) => n.y).bandwidth(e.bandwidth)(t) : er(e, t), er = (e, t) => {
2841
2844
  const n = (s) => s.x, r = (s) => s.y;
2842
2845
  switch (e.method) {
2843
2846
  case "linear":
2844
- return xs().x(n).y(r)(t);
2847
+ return ws().x(n).y(r)(t);
2845
2848
  case "exponential":
2846
- return Ts().x(n).y(r)(t);
2849
+ return xs().x(n).y(r)(t);
2847
2850
  case "logarithmic":
2848
- return Cs().x(n).y(r)(t);
2851
+ return Vs().x(n).y(r)(t);
2849
2852
  case "quadratic":
2850
- return Es().x(n).y(r)(t);
2853
+ return Ms().x(n).y(r)(t);
2851
2854
  case "power":
2852
- return Is().x(n).y(r)(t);
2855
+ return Es().x(n).y(r)(t);
2853
2856
  case "polynomial":
2854
- return Vs().x(n).y(r).order(e.order)(t);
2857
+ return Is().x(n).y(r).order(e.order)(t);
2855
2858
  case "loess":
2856
2859
  throw new x({ message: "'loess' does not expose a 'predict' function" });
2857
2860
  }
2858
- }, oc = (e, t, n, r, s) => {
2861
+ }, ic = (e, t, n, r, s) => {
2859
2862
  const a = [], o = [], i = Object.fromEntries(r.map((c) => [c, []]));
2860
2863
  return {
2861
2864
  push: ({ x: c, y: l, groupObservation: u }) => {
@@ -2883,11 +2886,11 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2883
2886
  return new Qe(c);
2884
2887
  }
2885
2888
  };
2886
- }, ic = (e, t) => {
2889
+ }, cc = (e, t) => {
2887
2890
  const n = {};
2888
2891
  for (const r of t) n[r] = e.getValues(r)[0] ?? null;
2889
2892
  return n;
2890
- }, cc = class extends re {
2893
+ }, lc = class extends re {
2891
2894
  constructor(...e) {
2892
2895
  super(...e), this.type = "sum", this.computedVariables = /* @__PURE__ */ new Set(["y"]);
2893
2896
  }
@@ -2912,7 +2915,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2912
2915
  suggestion: "Map a numeric variable to 'y' when using the 'sum' stat."
2913
2916
  });
2914
2917
  }
2915
- const r = S(t.x), s = [.../* @__PURE__ */ new Set([...r === null ? [] : [r], ...fe(e, t)])];
2918
+ const r = S(t.x), s = [.../* @__PURE__ */ new Set([...r === null ? [] : [r], ...ge(e, t)])];
2916
2919
  return {
2917
2920
  data: e.groupBy(...s).rollup({ [I.sum]: {
2918
2921
  variableName: n,
@@ -2921,7 +2924,7 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2921
2924
  mapping: { y: I.sum }
2922
2925
  };
2923
2926
  }
2924
- }, lc = 7, Be = [
2927
+ }, uc = 7, Be = [
2925
2928
  0.9999999999998099,
2926
2929
  676.5203681218851,
2927
2930
  -1259.1392167224028,
@@ -2931,26 +2934,26 @@ var Wi = /* @__PURE__ */ new Set(["label", "group"]), qi = class {
2931
2934
  -0.13857109526572012,
2932
2935
  9984369578019572e-21,
2933
2936
  15056327351493116e-23
2934
- ], uc = 300, dc = 1e-14, N = 1e-300, mc = 200;
2935
- function Zn(e, t) {
2937
+ ], dc = 300, mc = 1e-14, N = 1e-300, pc = 200;
2938
+ function tr(e, t) {
2936
2939
  if (e === 0.5) return 0;
2937
- if (e < 0.5) return -Zn(1 - e, t);
2940
+ if (e < 0.5) return -tr(1 - e, t);
2938
2941
  let n = 0, r = 1;
2939
2942
  for (; Bt(r, t) < e; )
2940
2943
  n = r, r *= 2;
2941
- for (let s = 0; s < mc; s++) {
2944
+ for (let s = 0; s < pc; s++) {
2942
2945
  const a = (n + r) / 2;
2943
2946
  if (a === n || a === r) break;
2944
2947
  Bt(a, t) < e ? n = a : r = a;
2945
2948
  }
2946
2949
  return (n + r) / 2;
2947
2950
  }
2948
- function Ce(e) {
2949
- if (e < 0.5) return Math.log(Math.PI / Math.sin(Math.PI * e)) - Ce(1 - e);
2951
+ function Ve(e) {
2952
+ if (e < 0.5) return Math.log(Math.PI / Math.sin(Math.PI * e)) - Ve(1 - e);
2950
2953
  const t = e - 1;
2951
2954
  let n = Be[0] ?? 0;
2952
2955
  for (let s = 1; s < Be.length; s++) n += (Be[s] ?? 0) / (t + s);
2953
- const r = t + lc + 0.5;
2956
+ const r = t + uc + 0.5;
2954
2957
  return 0.5 * Math.log(2 * Math.PI) + (t + 0.5) * Math.log(r) - r + Math.log(n);
2955
2958
  }
2956
2959
  function $t(e, t, n) {
@@ -2958,52 +2961,52 @@ function $t(e, t, n) {
2958
2961
  let s = 1, a = 1 - r * e / (t + 1);
2959
2962
  Math.abs(a) < N && (a = N), a = 1 / a;
2960
2963
  let o = a;
2961
- for (let i = 1; i <= uc; i++) {
2964
+ for (let i = 1; i <= dc; i++) {
2962
2965
  const c = 2 * i;
2963
2966
  let l = i * (n - i) * e / ((t + c - 1) * (t + c));
2964
2967
  a = 1 + l * a, Math.abs(a) < N && (a = N), s = 1 + l / s, Math.abs(s) < N && (s = N), a = 1 / a, o *= a * s, l = -((t + i) * (r + i) * e) / ((t + c) * (t + c + 1)), a = 1 + l * a, Math.abs(a) < N && (a = N), s = 1 + l / s, Math.abs(s) < N && (s = N), a = 1 / a;
2965
2968
  const u = a * s;
2966
- if (o *= u, Math.abs(u - 1) < dc) break;
2969
+ if (o *= u, Math.abs(u - 1) < mc) break;
2967
2970
  }
2968
2971
  return o;
2969
2972
  }
2970
- function pc(e, t, n) {
2973
+ function fc(e, t, n) {
2971
2974
  if (e <= 0) return 0;
2972
2975
  if (e >= 1) return 1;
2973
- const r = Ce(t + n) - Ce(t) - Ce(n) + t * Math.log(e) + n * Math.log(1 - e), s = Math.exp(r);
2976
+ const r = Ve(t + n) - Ve(t) - Ve(n) + t * Math.log(e) + n * Math.log(1 - e), s = Math.exp(r);
2974
2977
  return e < (t + 1) / (t + n + 2) ? s * $t(e, t, n) / t : 1 - s * $t(1 - e, n, t) / n;
2975
2978
  }
2976
2979
  function Bt(e, t) {
2977
- const n = 0.5 * pc(t / (t + e * e), t / 2, 0.5);
2980
+ const n = 0.5 * fc(t / (t + e * e), t / 2, 0.5);
2978
2981
  return e >= 0 ? 1 - n : n;
2979
2982
  }
2980
- var fc = /* @__PURE__ */ new Set(["mean", "median"]), gc = /* @__PURE__ */ new Set([
2983
+ var gc = /* @__PURE__ */ new Set(["mean", "median"]), hc = /* @__PURE__ */ new Set([
2981
2984
  "stderr",
2982
2985
  "stdev",
2983
2986
  "ci",
2984
2987
  "iqr",
2985
2988
  "range"
2986
- ]), hc = /* @__PURE__ */ new Set([
2989
+ ]), yc = /* @__PURE__ */ new Set([
2987
2990
  "stderr",
2988
2991
  "stdev",
2989
2992
  "ci"
2990
- ]), yc = /* @__PURE__ */ new Set(["iqr"]), vc = /* @__PURE__ */ new Set(["y"]), Ft = /* @__PURE__ */ new Set([
2993
+ ]), vc = /* @__PURE__ */ new Set(["iqr"]), bc = /* @__PURE__ */ new Set(["y"]), Ft = /* @__PURE__ */ new Set([
2991
2994
  "y",
2992
2995
  "lower",
2993
2996
  "upper"
2994
- ]), er = {
2997
+ ]), nr = {
2995
2998
  lower: null,
2996
2999
  upper: null
2997
- }, bc = class extends re {
3000
+ }, Sc = class extends re {
2998
3001
  constructor(...e) {
2999
3002
  super(...e), this.type = "summary", this.computedVariables = Ft;
3000
3003
  }
3001
3004
  resolveComputedVariables(e) {
3002
- return e.type === "summary" && e.interval === void 0 ? vc : Ft;
3005
+ return e.type === "summary" && e.interval === void 0 ? bc : Ft;
3003
3006
  }
3004
3007
  computeStat({ data: e, mapping: t, spec: n }) {
3005
3008
  if (n.type !== "summary") throw new x({ message: `SummaryStat received a spec of type '${n.type}'` });
3006
- Sc(n);
3009
+ Ac(n);
3007
3010
  const r = S(t.y);
3008
3011
  if (!g(r)) throw new w({
3009
3012
  code: "MISSING_STAT_VARIABLE",
@@ -3024,10 +3027,10 @@ var fc = /* @__PURE__ */ new Set(["mean", "median"]), gc = /* @__PURE__ */ new S
3024
3027
  suggestion: "Map a numeric variable to 'y' when using the 'summary' stat."
3025
3028
  });
3026
3029
  }
3027
- const s = S(t.x), a = [.../* @__PURE__ */ new Set([...s === null ? [] : [s], ...fe(e, t)])], o = e.groupBy(...a), i = Cc(n.level), c = [], l = [];
3030
+ const s = S(t.x), a = [.../* @__PURE__ */ new Set([...s === null ? [] : [s], ...ge(e, t)])], o = e.groupBy(...a), i = Vc(n.level), c = [], l = [];
3028
3031
  o.forEach((f) => {
3029
- const p = Ac(f, r);
3030
- c.push(Tc(p, n.estimate)), l.push(n.interval === void 0 ? er : xc(p, n, n.interval, i));
3032
+ const p = Tc(f, r);
3033
+ c.push(xc(p, n.estimate)), l.push(n.interval === void 0 ? nr : wc(p, n, n.interval, i));
3031
3034
  });
3032
3035
  const u = e.getValueFormat(r), d = o.rollup({}).addVariable(I.summaryEstimate, "numeric", c, u);
3033
3036
  if (n.interval === void 0) return {
@@ -3045,9 +3048,9 @@ var fc = /* @__PURE__ */ new Set(["mean", "median"]), gc = /* @__PURE__ */ new S
3045
3048
  };
3046
3049
  }
3047
3050
  };
3048
- function Sc({ estimate: e, interval: t, level: n, mult: r }) {
3049
- if (fc.has(e) || xe("estimate", "'mean' or 'median'", e), t !== void 0) {
3050
- if (gc.has(t) || xe("interval", "'stderr', 'stdev', 'ci', 'iqr' or 'range'", t), e === "median" && hc.has(t)) throw new w({
3051
+ function Ac({ estimate: e, interval: t, level: n, mult: r }) {
3052
+ if (gc.has(e) || we("estimate", "'mean' or 'median'", e), t !== void 0) {
3053
+ if (hc.has(t) || we("interval", "'stderr', 'stdev', 'ci', 'iqr' or 'range'", t), e === "median" && yc.has(t)) throw new w({
3051
3054
  code: "INVALID_STAT_PARAM",
3052
3055
  message: `'summary' stat's '${t}' interval describes a mean, so it cannot surround a median`,
3053
3056
  context: {
@@ -3058,7 +3061,7 @@ function Sc({ estimate: e, interval: t, level: n, mult: r }) {
3058
3061
  },
3059
3062
  suggestion: "Use estimate 'mean' with this interval, or interval 'iqr' or 'range' with a median."
3060
3063
  });
3061
- if (e === "mean" && yc.has(t)) throw new w({
3064
+ if (e === "mean" && vc.has(t)) throw new w({
3062
3065
  code: "INVALID_STAT_PARAM",
3063
3066
  message: `'summary' stat's '${t}' interval describes a median, so it cannot surround a mean`,
3064
3067
  context: {
@@ -3069,10 +3072,10 @@ function Sc({ estimate: e, interval: t, level: n, mult: r }) {
3069
3072
  },
3070
3073
  suggestion: "Use estimate 'median' with this interval, or interval 'stderr', 'stdev', 'ci' or 'range' with a mean."
3071
3074
  });
3072
- t === "ci" && !(Number.isFinite(n) && n > 0 && n < 1) && xe("level", "a number between 0 and 1", n), (t === "stderr" || t === "stdev") && !(Number.isFinite(r) && r > 0) && xe("mult", "a number greater than 0", r);
3075
+ t === "ci" && !(Number.isFinite(n) && n > 0 && n < 1) && we("level", "a number between 0 and 1", n), (t === "stderr" || t === "stdev") && !(Number.isFinite(r) && r > 0) && we("mult", "a number greater than 0", r);
3073
3076
  }
3074
3077
  }
3075
- function xe(e, t, n) {
3078
+ function we(e, t, n) {
3076
3079
  throw new w({
3077
3080
  code: "INVALID_STAT_PARAM",
3078
3081
  message: `'summary' stat's '${e}' must be ${t}, got ${String(n)}`,
@@ -3085,20 +3088,20 @@ function xe(e, t, n) {
3085
3088
  suggestion: `Set '${e}' to ${t}.`
3086
3089
  });
3087
3090
  }
3088
- function Ac(e, t) {
3091
+ function Tc(e, t) {
3089
3092
  return e.getValues(t).filter((n) => Y(n) && Number.isFinite(n));
3090
3093
  }
3091
- function Tc(e, t) {
3092
- return e.length === 0 ? null : t === "mean" ? tr(e) : ze([...e].sort((n, r) => n - r), 0.5);
3094
+ function xc(e, t) {
3095
+ return e.length === 0 ? null : t === "mean" ? rr(e) : ze([...e].sort((n, r) => n - r), 0.5);
3093
3096
  }
3094
- function xc(e, t, n, r) {
3095
- const s = e.length, a = Ic(e);
3096
- if (s < 2 || a.lower === a.upper) return er;
3097
+ function wc(e, t, n, r) {
3098
+ const s = e.length, a = Ec(e);
3099
+ if (s < 2 || a.lower === a.upper) return nr;
3097
3100
  switch (n) {
3098
3101
  case "stderr":
3099
3102
  case "stdev":
3100
3103
  case "ci": {
3101
- const o = tr(e), i = wc(n, Vc(e, o), s, t.mult, r);
3104
+ const o = rr(e), i = Cc(n, Ic(e, o), s, t.mult, r);
3102
3105
  return {
3103
3106
  lower: o - i,
3104
3107
  upper: o + i
@@ -3117,30 +3120,30 @@ function xc(e, t, n, r) {
3117
3120
  throw new x({ message: `Unexpected summary interval: ${String(n)}` });
3118
3121
  }
3119
3122
  }
3120
- function wc(e, t, n, r, s) {
3123
+ function Cc(e, t, n, r, s) {
3121
3124
  const a = t / Math.sqrt(n);
3122
3125
  return e === "stdev" ? r * t : e === "stderr" ? r * a : s(n - 1) * a;
3123
3126
  }
3124
- function Cc(e) {
3127
+ function Vc(e) {
3125
3128
  const t = /* @__PURE__ */ new Map();
3126
3129
  return (n) => {
3127
3130
  const r = t.get(n);
3128
3131
  if (r !== void 0) return r;
3129
- const s = Zn(1 - (1 - e) / 2, n);
3132
+ const s = tr(1 - (1 - e) / 2, n);
3130
3133
  return t.set(n, s), s;
3131
3134
  };
3132
3135
  }
3133
- function tr(e) {
3136
+ function rr(e) {
3134
3137
  let t = 0;
3135
3138
  for (const n of e) t += n;
3136
3139
  return t / e.length;
3137
3140
  }
3138
- function Vc(e, t) {
3141
+ function Ic(e, t) {
3139
3142
  let n = 0;
3140
3143
  for (const r of e) n += (r - t) ** 2;
3141
3144
  return Math.sqrt(n / (e.length - 1));
3142
3145
  }
3143
- function Ic(e) {
3146
+ function Ec(e) {
3144
3147
  let t = 1 / 0, n = -1 / 0;
3145
3148
  for (const r of e)
3146
3149
  r < t && (t = r), r > n && (n = r);
@@ -3153,21 +3156,21 @@ function ze(e, t) {
3153
3156
  const n = (e.length - 1) * t, r = Math.floor(n), s = e[r] ?? 0;
3154
3157
  return s + ((e[Math.min(r + 1, e.length - 1)] ?? s) - s) * (n - r);
3155
3158
  }
3156
- var Ec = [
3157
- new Xi(),
3158
- new Hi(),
3159
- new Zi(),
3159
+ var Mc = [
3160
3160
  new Ji(),
3161
- new cc(),
3162
- new bc()
3163
- ], Mc = class extends Le {
3161
+ new Xi(),
3162
+ new ec(),
3163
+ new Qi(),
3164
+ new lc(),
3165
+ new Sc()
3166
+ ], Lc = class extends Le {
3164
3167
  constructor() {
3165
3168
  super("stat");
3166
- for (const e of Ec) this.register(e.type, e);
3169
+ for (const e of Mc) this.register(e.type, e);
3167
3170
  }
3168
3171
  };
3169
- function Lc({ geoms: e, stats: t, transforms: n }) {
3170
- const r = new Xe(), s = new Mc(), a = new tn();
3172
+ function kc({ geoms: e, stats: t, transforms: n }) {
3173
+ const r = new Xe(), s = new Lc(), a = new nn();
3171
3174
  for (const o of e) r.register(o.type, o);
3172
3175
  for (const o of t) s.register(o.type, o);
3173
3176
  for (const o of n) a.register(o.transformType, o);
@@ -3177,7 +3180,7 @@ function Lc({ geoms: e, stats: t, transforms: n }) {
3177
3180
  transformRegistry: a
3178
3181
  };
3179
3182
  }
3180
- var kc = class {
3183
+ var _c = class {
3181
3184
  constructor(e) {
3182
3185
  this.registry = e;
3183
3186
  }
@@ -3185,7 +3188,7 @@ var kc = class {
3185
3188
  return this.registry.get(e).adjust(t);
3186
3189
  }
3187
3190
  }, _e = class {
3188
- }, _c = class extends _e {
3191
+ }, Dc = class extends _e {
3189
3192
  constructor(...e) {
3190
3193
  super(...e), this.type = "dodge";
3191
3194
  }
@@ -3203,7 +3206,7 @@ var kc = class {
3203
3206
  data: e,
3204
3207
  mapping: {}
3205
3208
  };
3206
- const r = e.size(), s = e.getValues(M.group, { type: "categorical" }), a = Dc(e) ?? [-0.7 / 2, 0.7 / 2], o = n.length > 1 ? Br : 0, i = gn().domain(n.map(String)).range(a).paddingInner(o).paddingOuter(0), c = i.bandwidth(), l = new Array(r).fill(null), u = new Array(r).fill(null);
3209
+ const r = e.size(), s = e.getValues(M.group, { type: "categorical" }), a = Rc(e) ?? [-0.7 / 2, 0.7 / 2], o = n.length > 1 ? Fr : 0, i = hn().domain(n.map(String)).range(a).paddingInner(o).paddingOuter(0), c = i.bandwidth(), l = new Array(r).fill(null), u = new Array(r).fill(null);
3207
3210
  for (let d = 0; d < r; d++) {
3208
3211
  const m = s[d];
3209
3212
  if (!g(m)) continue;
@@ -3215,10 +3218,10 @@ var kc = class {
3215
3218
  mapping: {}
3216
3219
  };
3217
3220
  }
3218
- }, Dc = (e) => {
3221
+ }, Rc = (e) => {
3219
3222
  const t = e.getConstant(h.xMin)?.value, n = e.getConstant(h.xMax)?.value;
3220
3223
  return typeof t != "number" || typeof n != "number" ? null : [t, n];
3221
- }, Ut = ge("__ungrouped__"), nr = (e, t) => {
3224
+ }, Ut = he("__ungrouped__"), sr = (e, t) => {
3222
3225
  const n = S(t.x), r = S(t.y);
3223
3226
  if (!n || !r) return null;
3224
3227
  const s = e.getValues(M.group, {
@@ -3240,7 +3243,7 @@ var kc = class {
3240
3243
  uniqueGroupKeys: o,
3241
3244
  observationCount: u
3242
3245
  };
3243
- }, rr = (e, t, n, r) => {
3246
+ }, ar = (e, t, n, r) => {
3244
3247
  const s = new Array(r).fill(null);
3245
3248
  for (const [, a] of n) {
3246
3249
  const o = [];
@@ -3249,15 +3252,15 @@ var kc = class {
3249
3252
  const b = e[p], v = t[p];
3250
3253
  !g(b) || !g(v) || (o.push(p), (b < c || b === c && v > l) && (i = p, c = b, l = v), (v > m || v === m && b < d) && (u = p, d = b, m = v));
3251
3254
  }
3252
- for (const f of o) s[f] = Rc(f === i, f === u);
3255
+ for (const f of o) s[f] = Nc(f === i, f === u);
3253
3256
  }
3254
3257
  return s;
3255
- }, Rc = (e, t) => e && t ? "solo" : e ? "floor" : t ? "ceiling" : "middle", Nc = class extends _e {
3258
+ }, Nc = (e, t) => e && t ? "solo" : e ? "floor" : t ? "ceiling" : "middle", Oc = class extends _e {
3256
3259
  constructor(...e) {
3257
3260
  super(...e), this.type = "fill";
3258
3261
  }
3259
3262
  adjust({ data: e, mapping: t }) {
3260
- const n = nr(e, t);
3263
+ const n = sr(e, t);
3261
3264
  if (n === null) return {
3262
3265
  data: e,
3263
3266
  mapping: {}
@@ -3294,13 +3297,13 @@ var kc = class {
3294
3297
  }
3295
3298
  }
3296
3299
  }
3297
- const l = rr(c, i, s, o);
3300
+ const l = ar(c, i, s, o);
3298
3301
  return {
3299
- data: e.addVariable(h.yMin, "numeric", c).addVariable(h.yMax, "numeric", i).addVariable(h.yRaw, "numeric", r).addVariable(cn.role, "categorical", l),
3302
+ data: e.addVariable(h.yMin, "numeric", c).addVariable(h.yMax, "numeric", i).addVariable(h.yRaw, "numeric", r).addVariable(ln.role, "categorical", l),
3300
3303
  mapping: {}
3301
3304
  };
3302
3305
  }
3303
- }, Oc = class extends _e {
3306
+ }, Pc = class extends _e {
3304
3307
  constructor(...e) {
3305
3308
  super(...e), this.type = "identity";
3306
3309
  }
@@ -3310,12 +3313,12 @@ var kc = class {
3310
3313
  mapping: {}
3311
3314
  };
3312
3315
  }
3313
- }, Pc = class extends _e {
3316
+ }, $c = class extends _e {
3314
3317
  constructor(...e) {
3315
3318
  super(...e), this.type = "stack";
3316
3319
  }
3317
3320
  adjust({ data: e, mapping: t }) {
3318
- const n = nr(e, t);
3321
+ const n = sr(e, t);
3319
3322
  if (n === null) return {
3320
3323
  data: e,
3321
3324
  mapping: {}
@@ -3338,19 +3341,19 @@ var kc = class {
3338
3341
  }
3339
3342
  }
3340
3343
  }
3341
- const l = rr(c, i, s, o);
3342
- let u = e.addVariable(h.yMin, "numeric", c).addVariable(h.yMax, "numeric", i).addVariable(h.yRaw, "numeric", r).addVariable(cn.role, "categorical", l);
3344
+ const l = ar(c, i, s, o);
3345
+ let u = e.addVariable(h.yMin, "numeric", c).addVariable(h.yMax, "numeric", i).addVariable(h.yRaw, "numeric", r).addVariable(ln.role, "categorical", l);
3343
3346
  const d = S(t.y);
3344
3347
  return d !== null && (u = u.addVariable(d, "numeric", i)), {
3345
3348
  data: u,
3346
3349
  mapping: {}
3347
3350
  };
3348
3351
  }
3349
- }, $c = class extends Le {
3352
+ }, Bc = class extends Le {
3350
3353
  constructor() {
3351
- super("position"), this.register("identity", new Oc()), this.register("stack", new Pc()), this.register("fill", new Nc()), this.register("dodge", new _c());
3354
+ super("position"), this.register("identity", new Pc()), this.register("stack", new $c()), this.register("fill", new Oc()), this.register("dodge", new Dc());
3352
3355
  }
3353
- }, Bc = class {
3356
+ }, Fc = class {
3354
3357
  map({ data: e, layer: t, getPositionScale: n }) {
3355
3358
  if (t.position !== "dodge" || !g(n("x")?.bandwidth) || !e.hasVariable(h.xMin) || !e.hasVariable(h.xMax)) return e;
3356
3359
  const r = e.getValues(h.x, { type: "numeric" }), s = e.getValues(h.xMin, { type: "numeric" }), a = e.getValues(h.xMax, { type: "numeric" }), o = r.map((i, c) => {
@@ -3359,7 +3362,7 @@ var kc = class {
3359
3362
  });
3360
3363
  return e.addVariable(h.xBand, "numeric", r).addVariable(h.x, "numeric", o);
3361
3364
  }
3362
- }, Fc = class {
3365
+ }, Uc = class {
3363
3366
  map({ data: e, layer: t, getPositionScale: n, geomRegistry: r }) {
3364
3367
  let s = e;
3365
3368
  const a = r.get(t.geom);
@@ -3367,101 +3370,101 @@ var kc = class {
3367
3370
  if (o.role !== "scalar" || !g(o.aes) || Ze(o.aes)) continue;
3368
3371
  const i = S(t.mapping[o.aes]);
3369
3372
  if (!g(i) || !s.hasVariable(i)) continue;
3370
- const c = n(on(o.axis, t.yScaleType));
3373
+ const c = n(cn(o.axis, t.yScaleType));
3371
3374
  if (!c) continue;
3372
3375
  const l = s.getValues(i, { type: "numeric" }).map((u) => g(u) ? c.map(u) : null);
3373
- s = s.addVariable(ds(o.aes), "numeric", l);
3376
+ s = s.addVariable(ms(o.aes), "numeric", l);
3374
3377
  }
3375
3378
  return s;
3376
3379
  }
3377
- }, Uc = class {
3380
+ }, Gc = class {
3378
3381
  map({ data: e, layer: t, getPositionScale: n }) {
3379
3382
  const r = S(t.mapping.x), s = n("x");
3380
3383
  if (!r || !s) return e;
3381
3384
  const a = e.getValues(r).map((o) => g(o) ? s.map(o) : null);
3382
3385
  return e.addVariable(h.x, "numeric", a);
3383
3386
  }
3384
- }, Gc = class {
3387
+ }, Yc = class {
3385
3388
  map({ data: e, getPositionScale: t }) {
3386
3389
  const n = t("x");
3387
3390
  if (!n || !e.hasVariable(h.xMin) || !e.hasVariable(h.xMax)) return e;
3388
- const r = n.bandwidth, s = g(r) && e.hasVariable(h.x) ? Yc(e, n, r) : jc(e, n);
3391
+ const r = n.bandwidth, s = g(r) && e.hasVariable(h.x) ? jc(e, n, r) : zc(e, n);
3389
3392
  return e.addVariable(h.xMin, "numeric", s.min).addVariable(h.xMax, "numeric", s.max);
3390
3393
  }
3391
3394
  };
3392
- function Yc(e, t, n) {
3393
- const r = e.getValues(h.x, { type: "numeric" }), s = e.getValues(h.xMin, { type: "numeric" }), a = e.getValues(h.xMax, { type: "numeric" }), o = "reverse" in t.spec && t.spec.reverse === !0, i = e.size(), c = sr(i);
3395
+ function jc(e, t, n) {
3396
+ const r = e.getValues(h.x, { type: "numeric" }), s = e.getValues(h.xMin, { type: "numeric" }), a = e.getValues(h.xMax, { type: "numeric" }), o = "reverse" in t.spec && t.spec.reverse === !0, i = e.size(), c = or(i);
3394
3397
  for (let l = 0; l < i; l++) {
3395
3398
  const u = r[l], d = s[l], m = a[l];
3396
3399
  !g(u) || !g(d) || !g(m) || (c.min[l] = u + (o ? -m : d) * n, c.max[l] = u + (o ? -d : m) * n);
3397
3400
  }
3398
3401
  return c;
3399
3402
  }
3400
- function jc(e, t) {
3401
- const n = e.getValues(h.xMin, { type: "numeric" }), r = e.getValues(h.xMax, { type: "numeric" }), s = e.size(), a = sr(s);
3403
+ function zc(e, t) {
3404
+ const n = e.getValues(h.xMin, { type: "numeric" }), r = e.getValues(h.xMax, { type: "numeric" }), s = e.size(), a = or(s);
3402
3405
  for (let o = 0; o < s; o++) {
3403
3406
  const i = n[o], c = r[o];
3404
3407
  !g(i) || !g(c) || (a.min[o] = t.map(i), a.max[o] = t.map(c));
3405
3408
  }
3406
3409
  return a;
3407
3410
  }
3408
- function sr(e) {
3411
+ function or(e) {
3409
3412
  return {
3410
3413
  min: new Array(e).fill(null),
3411
3414
  max: new Array(e).fill(null)
3412
3415
  };
3413
3416
  }
3414
- var zc = class {
3417
+ var Kc = class {
3415
3418
  map({ data: e, layer: t, getPositionScale: n }) {
3416
3419
  const r = S(t.mapping.y), s = n(ue(t.yScaleType));
3417
3420
  if (!r || !s) return e;
3418
3421
  const a = e.getValues(r).map((o) => g(o) ? s.map(o) : null);
3419
3422
  return e.addVariable(h.y, "numeric", a);
3420
3423
  }
3421
- }, Kc = class {
3424
+ }, Wc = class {
3422
3425
  map({ data: e, layer: t, getPositionScale: n }) {
3423
3426
  const r = n(ue(t.yScaleType));
3424
3427
  if (!r || !e.hasVariable(h.yMin) || !e.hasVariable(h.yMax)) return e;
3425
- const s = r.bandwidth, a = g(s) && e.hasVariable(h.y) ? Wc(e, r, s) : qc(e, r);
3428
+ const s = r.bandwidth, a = g(s) && e.hasVariable(h.y) ? qc(e, r, s) : Hc(e, r);
3426
3429
  return e.addVariable(h.yMin, "numeric", a.min).addVariable(h.yMax, "numeric", a.max);
3427
3430
  }
3428
3431
  };
3429
- function Wc(e, t, n) {
3430
- const r = e.getValues(h.y, { type: "numeric" }), s = e.getValues(h.yMin, { type: "numeric" }), a = e.getValues(h.yMax, { type: "numeric" }), o = "reverse" in t.spec && t.spec.reverse === !0, i = e.size(), c = ar(i);
3432
+ function qc(e, t, n) {
3433
+ const r = e.getValues(h.y, { type: "numeric" }), s = e.getValues(h.yMin, { type: "numeric" }), a = e.getValues(h.yMax, { type: "numeric" }), o = "reverse" in t.spec && t.spec.reverse === !0, i = e.size(), c = ir(i);
3431
3434
  for (let l = 0; l < i; l++) {
3432
3435
  const u = r[l], d = s[l], m = a[l];
3433
3436
  !g(u) || !g(d) || !g(m) || (c.min[l] = u + (o ? -m : d) * n, c.max[l] = u + (o ? -d : m) * n);
3434
3437
  }
3435
3438
  return c;
3436
3439
  }
3437
- function qc(e, t) {
3438
- const n = e.getValues(h.yMin, { type: "numeric" }), r = e.getValues(h.yMax, { type: "numeric" }), s = e.size(), a = ar(s);
3440
+ function Hc(e, t) {
3441
+ const n = e.getValues(h.yMin, { type: "numeric" }), r = e.getValues(h.yMax, { type: "numeric" }), s = e.size(), a = ir(s);
3439
3442
  for (let o = 0; o < s; o++) {
3440
3443
  const i = n[o], c = r[o];
3441
3444
  !g(i) || !g(c) || (a.min[o] = t.map(i), a.max[o] = t.map(c));
3442
3445
  }
3443
3446
  return a;
3444
3447
  }
3445
- function ar(e) {
3448
+ function ir(e) {
3446
3449
  return {
3447
3450
  min: new Array(e).fill(null),
3448
3451
  max: new Array(e).fill(null)
3449
3452
  };
3450
3453
  }
3451
- var Hc = [
3452
- new Uc(),
3453
- new zc(),
3454
+ var Xc = [
3454
3455
  new Gc(),
3455
3456
  new Kc(),
3456
- new Bc(),
3457
- new Fc()
3457
+ new Yc(),
3458
+ new Wc(),
3459
+ new Fc(),
3460
+ new Uc()
3458
3461
  ];
3459
- function Xc(e, t) {
3462
+ function Jc(e, t) {
3460
3463
  const n = e[t];
3461
3464
  return n?.kind === "position" ? n : null;
3462
3465
  }
3463
- var Jc = class extends q {
3464
- constructor(e, t = Hc) {
3466
+ var Qc = class extends q {
3467
+ constructor(e, t = Xc) {
3465
3468
  super(), this.container = e, this.mappers = t;
3466
3469
  }
3467
3470
  dependencies(e) {
@@ -3472,7 +3475,7 @@ var Jc = class extends q {
3472
3475
  ];
3473
3476
  }
3474
3477
  compileLayer(e, t) {
3475
- const n = (s) => Xc(t.scales, s);
3478
+ const n = (s) => Jc(t.scales, s);
3476
3479
  let r = e.data;
3477
3480
  for (const s of this.mappers) r = s.map({
3478
3481
  data: r,
@@ -3485,7 +3488,7 @@ var Jc = class extends q {
3485
3488
  data: r
3486
3489
  };
3487
3490
  }
3488
- }, Qc = class extends W {
3491
+ }, Zc = class extends W {
3489
3492
  constructor(e, t) {
3490
3493
  super(), this.container = e, this.registry = t;
3491
3494
  }
@@ -3502,12 +3505,12 @@ var Jc = class extends q {
3502
3505
  for (const a of e.scales) t.set(a.scaledAesthetic, a);
3503
3506
  const n = this.collectValues(e.layers, t), r = {
3504
3507
  colorScheme: e.colorScheme,
3505
- hasTouchingGeoms: Gi(e.layers),
3506
- zeroAxes: qn(e.layers).zeroAxes
3508
+ hasTouchingGeoms: Yi(e.layers),
3509
+ zeroAxes: Xn(e.layers).zeroAxes
3507
3510
  }, s = {};
3508
3511
  for (const [a, o] of t) {
3509
- const i = n.get(a) ?? [];
3510
- s[a] = this.registry.get(o.scaleType).compile(o, i, r);
3512
+ const i = n.get(a) ?? [], c = o.scaleType === "discrete" ? On(o, e.layers) : o;
3513
+ s[a] = this.registry.get(c.scaleType).compile(c, i, r);
3511
3514
  }
3512
3515
  return s;
3513
3516
  }
@@ -3550,7 +3553,7 @@ var Jc = class extends q {
3550
3553
  }
3551
3554
  }
3552
3555
  }
3553
- Kn(this.container.diagnostics, t);
3556
+ qn(this.container.diagnostics, t);
3554
3557
  }
3555
3558
  collectValues(e, t) {
3556
3559
  const n = /* @__PURE__ */ new Map();
@@ -3558,7 +3561,7 @@ var Jc = class extends q {
3558
3561
  const s = this.resolveCustomPositionalAxes(r);
3559
3562
  for (const [a, o] of Object.entries(r.mapping)) {
3560
3563
  if (!g(o)) continue;
3561
- const i = a === "y" ? ue(r.yScaleType) : a, c = s.get(a) ?? (ts(i) ? i : void 0);
3564
+ const i = a === "y" ? ue(r.yScaleType) : a, c = s.get(a) ?? (ns(i) ? i : void 0);
3562
3565
  if (!g(c) || !t.has(c)) continue;
3563
3566
  const l = t.get(c)?.scaleType, u = this.resolveVariables(a, o, r.data, l);
3564
3567
  this.collectFromVariables(r.data, u, c, n);
@@ -3569,7 +3572,7 @@ var Jc = class extends q {
3569
3572
  resolveCustomPositionalAxes(e) {
3570
3573
  const t = /* @__PURE__ */ new Map(), n = this.container.geomRegistry.get(e.geom);
3571
3574
  for (const r of n.positionRoles)
3572
- r.role !== "scalar" || !g(r.aes) || Ze(r.aes) || t.set(r.aes, on(r.axis, e.yScaleType));
3575
+ r.role !== "scalar" || !g(r.aes) || Ze(r.aes) || t.set(r.aes, cn(r.axis, e.yScaleType));
3573
3576
  return t;
3574
3577
  }
3575
3578
  resolveVariables(e, t, n, r) {
@@ -3587,12 +3590,12 @@ var Jc = class extends q {
3587
3590
  const a = r.get(n);
3588
3591
  r.set(n, a ? a.concat(s) : s);
3589
3592
  }
3590
- }, Rd = [
3593
+ }, Nd = [
3591
3594
  "rgb",
3592
3595
  "lab",
3593
3596
  "hcl",
3594
3597
  "hsl"
3595
- ], Nd = [
3598
+ ], Od = [
3596
3599
  "viridis",
3597
3600
  "magma",
3598
3601
  "inferno",
@@ -3605,53 +3608,53 @@ var Jc = class extends q {
3605
3608
  "Oranges",
3606
3609
  "Purples",
3607
3610
  "Reds"
3608
- ], Zc = [
3611
+ ], el = [
3609
3612
  "RdBu",
3610
3613
  "BrBG",
3611
3614
  "PuOr",
3612
3615
  "Spectral"
3613
- ], el = {
3616
+ ], tl = {
3614
3617
  "red-blue": "RdBu",
3615
3618
  "brown-teal": "BrBG",
3616
3619
  "purple-orange": "PuOr",
3617
3620
  spectral: "Spectral"
3618
- }, tl = new Set(Zc.map((e) => e.toLowerCase()));
3619
- function or(e) {
3620
- const t = e.toLowerCase(), n = el[t];
3621
+ }, nl = new Set(el.map((e) => e.toLowerCase()));
3622
+ function cr(e) {
3623
+ const t = e.toLowerCase(), n = tl[t];
3621
3624
  return n ? n.toLowerCase() : t;
3622
3625
  }
3623
- function nl(e) {
3624
- return tl.has(or(e));
3625
- }
3626
- var rl = {
3627
- rgb: Ns,
3628
- lab: Rs,
3629
- hcl: _s,
3630
- hsl: Ds
3631
- }, sl = {
3632
- viridis: Js,
3633
- magma: Gs,
3634
- inferno: Us,
3635
- plasma: js,
3636
- cividis: $s,
3637
- turbo: Xs,
3638
- blues: Os,
3639
- greens: Bs,
3640
- greys: Fs,
3641
- oranges: Ys,
3642
- purples: Ks,
3643
- reds: qs,
3644
- rdbu: Ws,
3645
- brbg: Ps,
3646
- puor: zs,
3647
- spectral: Hs
3626
+ function rl(e) {
3627
+ return nl.has(cr(e));
3628
+ }
3629
+ var sl = {
3630
+ rgb: Os,
3631
+ lab: Ns,
3632
+ hcl: Ds,
3633
+ hsl: Rs
3634
+ }, al = {
3635
+ viridis: Qs,
3636
+ magma: Ys,
3637
+ inferno: Gs,
3638
+ plasma: zs,
3639
+ cividis: Bs,
3640
+ turbo: Js,
3641
+ blues: Ps,
3642
+ greens: Fs,
3643
+ greys: Us,
3644
+ oranges: js,
3645
+ purples: Ws,
3646
+ reds: Hs,
3647
+ rdbu: qs,
3648
+ brbg: $s,
3649
+ puor: Ks,
3650
+ spectral: Xs
3648
3651
  };
3649
- function ir(e) {
3650
- const t = al(e);
3652
+ function lr(e) {
3653
+ const t = ol(e);
3651
3654
  return e.reverse ? (n) => t(1 - n) : t;
3652
3655
  }
3653
- function Od(e = {}, t = 2) {
3654
- const n = ir({
3656
+ function Pd(e = {}, t = 2) {
3657
+ const n = lr({
3655
3658
  range: e.range ?? null,
3656
3659
  scheme: e.scheme ?? null,
3657
3660
  interpolate: e.interpolate ?? B.interpolate,
@@ -3659,16 +3662,16 @@ function Od(e = {}, t = 2) {
3659
3662
  });
3660
3663
  return t < 2 ? t === 1 ? [n(0)] : [] : Array.from({ length: t }, (r, s) => n(s / (t - 1)));
3661
3664
  }
3662
- function al(e) {
3663
- const t = rl[e.interpolate];
3665
+ function ol(e) {
3666
+ const t = sl[e.interpolate];
3664
3667
  if (e.range && e.range.length >= 2) return At(t, e.range.map((n) => String(n)));
3665
3668
  if (e.scheme) {
3666
- const n = sl[or(e.scheme)];
3669
+ const n = al[cr(e.scheme)];
3667
3670
  if (n) return n;
3668
3671
  }
3669
- return At(t, [...Qr]);
3672
+ return At(t, [...Zr]);
3670
3673
  }
3671
- var ye = class {
3674
+ var ve = class {
3672
3675
  createPositionScale(e, t) {
3673
3676
  return {
3674
3677
  kind: "position",
@@ -3701,7 +3704,7 @@ var ye = class {
3701
3704
  pinnedHigh: n !== null
3702
3705
  };
3703
3706
  };
3704
- function ol(e) {
3707
+ function il(e) {
3705
3708
  const [t, n] = e.domain;
3706
3709
  return t > 0 ? {
3707
3710
  ...e,
@@ -3716,7 +3719,7 @@ function ol(e) {
3716
3719
  function We(e, t) {
3717
3720
  return [t.pinnedLow ? t.domain[0] : e[0], t.pinnedHigh ? t.domain[1] : e[1]];
3718
3721
  }
3719
- var il = class extends ye {
3722
+ var cl = class extends ve {
3720
3723
  constructor(e) {
3721
3724
  super(), this.container = e, this.compatibleDataTypes = ["numeric"];
3722
3725
  }
@@ -3732,12 +3735,12 @@ var il = class extends ye {
3732
3735
  return t === 1 / 0 ? [0, 0] : [t, n];
3733
3736
  }
3734
3737
  createD3Scale(e, t, n, r = !1) {
3735
- const s = Ke(e, n.domainMin, n.domainMax), a = r ? ol(s) : s;
3738
+ const s = Ke(e, n.domainMin, n.domainMax), a = r ? il(s) : s;
3736
3739
  let o = a.domain;
3737
- r && cl(s, a) && this.warnIncompatibleDomain(n, s.domain, `'${n.scaledAesthetic}' holds zero for the geom drawn on it, so the pin at [${s.domain[0]}, ${s.domain[1]}] gives way to [${o[0]}, ${o[1]}].`, `Pin '${n.scaledAesthetic}' at or past zero, or drop the pin.`);
3738
- const i = n.transform === "log" && ll(o);
3740
+ r && ll(s, a) && this.warnIncompatibleDomain(n, s.domain, `'${n.scaledAesthetic}' holds zero for the geom drawn on it, so the pin at [${s.domain[0]}, ${s.domain[1]}] gives way to [${o[0]}, ${o[1]}].`, `Pin '${n.scaledAesthetic}' at or past zero, or drop the pin.`);
3741
+ const i = n.transform === "log" && ul(o);
3739
3742
  n.transform === "log" && !i && this.warnIncompatibleDomain(n, o, `Log scale on '${n.scaledAesthetic}' needs a strictly positive or negative domain, but the domain is [${o[0]}, ${o[1]}] — rendering a linear scale instead.`, r ? `'${n.scaledAesthetic}' holds zero for the geom drawn on it; use a linear or sqrt transform.` : "Filter out non-positive values or set a positive domainMin so the log scale can apply.");
3740
- const c = i ? Ms() : n.transform === "sqrt" ? Ls() : Oe();
3743
+ const c = i ? Ls() : n.transform === "sqrt" ? ks() : Oe();
3741
3744
  return n.nice && !i && (o = We(c.copy().domain(o).nice().domain(), a)), c.domain(o).range(t).clamp(n.clamp);
3742
3745
  }
3743
3746
  warnIncompatibleDomain(e, t, n, r) {
@@ -3762,7 +3765,7 @@ var il = class extends ye {
3762
3765
  });
3763
3766
  }
3764
3767
  buildVisualScale(e, t) {
3765
- const n = ul(t.range) ?? [0, 1], r = t.reverse ? [n[1], n[0]] : n, s = this.createD3Scale(e, r, t);
3768
+ const n = dl(t.range) ?? [0, 1], r = t.reverse ? [n[1], n[0]] : n, s = this.createD3Scale(e, r, t);
3766
3769
  return this.createVisualScale(t, {
3767
3770
  map: s,
3768
3771
  domain: s.domain(),
@@ -3770,7 +3773,7 @@ var il = class extends ye {
3770
3773
  });
3771
3774
  }
3772
3775
  buildColorScale(e, t) {
3773
- const n = ir(t), r = t.domainMid;
3776
+ const n = lr(t), r = t.domainMid;
3774
3777
  if (r !== null) {
3775
3778
  const s = this.resolveColorDomain(e, t), [a, o] = s.domain;
3776
3779
  if (r > a && r < o) {
@@ -3819,16 +3822,16 @@ var il = class extends ye {
3819
3822
  const o = Math.max(Math.abs(r[0] - n), Math.abs(r[1] - n));
3820
3823
  return [s ? r[0] : n - o, a ? r[1] : n + o];
3821
3824
  }
3822
- }, cl = (e, t) => e.pinnedLow && e.domain[0] !== t.domain[0] || e.pinnedHigh && e.domain[1] !== t.domain[1], ll = (e) => {
3825
+ }, ll = (e, t) => e.pinnedLow && e.domain[0] !== t.domain[0] || e.pinnedHigh && e.domain[1] !== t.domain[1], ul = (e) => {
3823
3826
  const [t, n] = e;
3824
3827
  return t > 0 && n > 0 || t < 0 && n < 0;
3825
3828
  };
3826
- function ul(e) {
3829
+ function dl(e) {
3827
3830
  if (!e) return null;
3828
3831
  const [t, n] = e;
3829
3832
  return typeof t == "number" && typeof n == "number" ? [t, n] : null;
3830
3833
  }
3831
- var dl = class extends ye {
3834
+ var ml = class extends ve {
3832
3835
  constructor(...e) {
3833
3836
  super(...e), this.compatibleDataTypes = ["temporal"];
3834
3837
  }
@@ -3862,8 +3865,8 @@ var dl = class extends ye {
3862
3865
  return t === 1 / 0 ? [] : [new Date(t), new Date(n)];
3863
3866
  }
3864
3867
  createD3Scale(e, t, n) {
3865
- const r = ks().range(t).clamp(n.clamp);
3866
- if (!ml(e)) return r.domain([]);
3868
+ const r = _s().range(t).clamp(n.clamp);
3869
+ if (!pl(e)) return r.domain([]);
3867
3870
  const s = Ke([e[0].getTime(), e[1].getTime()], n.domainMin, n.domainMax);
3868
3871
  if (r.domain(s.domain), n.nice) {
3869
3872
  const [a, o] = r.nice().domain();
@@ -3877,10 +3880,10 @@ var dl = class extends ye {
3877
3880
  map: s,
3878
3881
  domain: s.domain(),
3879
3882
  bandwidth: null,
3880
- generateTicks: (c) => c && "atInputs" in c ? i : c && "interval" in c ? a && o ? Co(a, o, c.interval) : [] : s.ticks(c?.count)
3883
+ generateTicks: (c) => c && "atInputs" in c ? i : c && "interval" in c ? a && o ? Vo(a, o, c.interval) : [] : s.ticks(c?.count)
3881
3884
  });
3882
3885
  }
3883
- }, ml = (e) => e.length === 2 && k(e[0]) && k(e[1]), pl = class extends ye {
3886
+ }, pl = (e) => e.length === 2 && k(e[0]) && k(e[1]), fl = class extends ve {
3884
3887
  constructor(...e) {
3885
3888
  super(...e), this.compatibleDataTypes = [
3886
3889
  "categorical",
@@ -3890,11 +3893,11 @@ var dl = class extends ye {
3890
3893
  }
3891
3894
  compile(e, t) {
3892
3895
  if (e.scaleType !== "discrete") throw new x({ message: "DiscreteScale.compile received non-discrete spec" });
3893
- const n = Je(e.scaledAesthetic), r = Rn(t, e);
3896
+ const n = Je(e.scaledAesthetic), r = Nn(t, e);
3894
3897
  return n ? this.buildPositionScale(r, e) : this.buildVisualScale(r, e);
3895
3898
  }
3896
3899
  buildPositionScale(e, t) {
3897
- const n = e.map(String), r = t.padding ?? oe.padding, s = t.reverse ? [1, 0] : [0, 1], a = gn().domain(n).range(s).paddingInner(r).paddingOuter(r / 2), o = a.bandwidth() / 2;
3900
+ const n = e.map(String), r = t.padding ?? oe.padding, s = t.reverse ? [1, 0] : [0, 1], a = hn().domain(n).range(s).paddingInner(r).paddingOuter(r / 2), o = a.bandwidth() / 2;
3898
3901
  return this.createPositionScale(t, {
3899
3902
  map: (i) => (a(String(i)) ?? NaN) + o,
3900
3903
  domain: e,
@@ -3903,7 +3906,7 @@ var dl = class extends ye {
3903
3906
  });
3904
3907
  }
3905
3908
  buildVisualScale(e, t) {
3906
- const n = e.map(String), r = t.range && t.range.length > 0 ? hn().domain(n).range(t.range).unknown(t.range[0]) : null;
3909
+ const n = e.map(String), r = t.range && t.range.length > 0 ? yn().domain(n).range(t.range).unknown(t.range[0]) : null;
3907
3910
  return this.createVisualScale(t, {
3908
3911
  map: (s) => {
3909
3912
  const a = String(s);
@@ -3913,7 +3916,7 @@ var dl = class extends ye {
3913
3916
  generateTicks: () => e
3914
3917
  });
3915
3918
  }
3916
- }, fl = class extends ye {
3919
+ }, gl = class extends ve {
3917
3920
  constructor(...e) {
3918
3921
  super(...e), this.compatibleDataTypes = [
3919
3922
  "numeric",
@@ -3932,7 +3935,7 @@ var dl = class extends ye {
3932
3935
  generateTicks: () => []
3933
3936
  };
3934
3937
  }
3935
- }, gl = class extends ye {
3938
+ }, hl = class extends ve {
3936
3939
  constructor(...e) {
3937
3940
  super(...e), this.compatibleDataTypes = [
3938
3941
  "categorical",
@@ -3942,21 +3945,21 @@ var dl = class extends ye {
3942
3945
  }
3943
3946
  compile(e, t, n) {
3944
3947
  if (e.scaleType !== "palette") throw new x({ message: "PaletteScale.compile received non-palette spec" });
3945
- const r = Dn(t), s = Or(e.palette, {
3948
+ const r = Rn(t), s = Pr(e.palette, {
3946
3949
  groupCount: r.length,
3947
3950
  ...n
3948
- }), a = ms(s.length > 0 ? s : [...Ir], e.overrides), o = hn().domain(r.map(String)).range(a).unknown(a[0]);
3951
+ }), a = ps(s.length > 0 ? s : [...Mr], e.overrides), o = yn().domain(r.map(String)).range(a).unknown(a[0]);
3949
3952
  return this.createVisualScale(e, {
3950
3953
  map: (i) => o(String(i)),
3951
3954
  domain: r,
3952
3955
  generateTicks: () => r
3953
3956
  });
3954
3957
  }
3955
- }, hl = class extends Le {
3958
+ }, yl = class extends Le {
3956
3959
  constructor(e) {
3957
- super("scale"), this.register("continuous", new il(e)), this.register("discrete", new pl()), this.register("datetime", new dl()), this.register("identity", new fl()), this.register("palette", new gl());
3960
+ super("scale"), this.register("continuous", new cl(e)), this.register("discrete", new fl()), this.register("datetime", new ml()), this.register("identity", new gl()), this.register("palette", new hl());
3958
3961
  }
3959
- }, cr = {
3962
+ }, ur = {
3960
3963
  x: "position",
3961
3964
  y: "position",
3962
3965
  ySecondary: "position",
@@ -3965,7 +3968,7 @@ var dl = class extends ye {
3965
3968
  alpha: "continuous-range",
3966
3969
  strokeWidth: "continuous-range",
3967
3970
  lineType: "discrete-only"
3968
- }, yl = {
3971
+ }, vl = {
3969
3972
  numeric: {
3970
3973
  position: "continuous",
3971
3974
  "color-range": "continuous",
@@ -3985,7 +3988,7 @@ var dl = class extends ye {
3985
3988
  "discrete-only": "discrete"
3986
3989
  }
3987
3990
  };
3988
- function lr(e, t) {
3991
+ function dr(e, t) {
3989
3992
  const { data: n, layers: r, mapping: s, customPalettes: a } = t;
3990
3993
  return {
3991
3994
  container: e,
@@ -3993,18 +3996,18 @@ function lr(e, t) {
3993
3996
  layers: r,
3994
3997
  mapping: s,
3995
3998
  customPalettes: a,
3996
- demands: qn(Wn(e.geomRegistry, r))
3999
+ demands: Xn(Hn(e.geomRegistry, r))
3997
4000
  };
3998
4001
  }
3999
4002
  function ct(e, t) {
4000
4003
  switch (t.scaleType) {
4001
4004
  case "inferred":
4002
4005
  return {
4003
- ...ct(e, Tl(e, t)),
4006
+ ...ct(e, xl(e, t)),
4004
4007
  inferredFrom: t
4005
4008
  };
4006
4009
  case "continuous": {
4007
- const n = cr[t.scaledAesthetic], r = n === "continuous-range" && t.scaledAesthetic in ft ? ft[t.scaledAesthetic] : null, s = t.scaledAesthetic === "size" && n === "continuous-range" ? "sqrt" : B.transform;
4010
+ const n = ur[t.scaledAesthetic], r = n === "continuous-range" && t.scaledAesthetic in ft ? ft[t.scaledAesthetic] : null, s = t.scaledAesthetic === "size" && n === "continuous-range" ? "sqrt" : B.transform;
4008
4011
  return {
4009
4012
  type: t.type,
4010
4013
  scaledAesthetic: t.scaledAesthetic,
@@ -4016,7 +4019,7 @@ function ct(e, t) {
4016
4019
  domainMin: t.domainMin ?? B.domainMin,
4017
4020
  domainMax: t.domainMax ?? B.domainMax,
4018
4021
  range: t.range ?? r ?? null,
4019
- scheme: xl(e.container, t),
4022
+ scheme: wl(e.container, t),
4020
4023
  interpolate: t.interpolate ?? B.interpolate,
4021
4024
  domainMid: t.domainMid ?? B.domainMid,
4022
4025
  symmetric: t.symmetric ?? g(t.domainMid)
@@ -4027,21 +4030,21 @@ function ct(e, t) {
4027
4030
  type: t.type,
4028
4031
  scaledAesthetic: t.scaledAesthetic,
4029
4032
  scaleType: t.scaleType,
4030
- domainMin: t.domainMin ?? Ae.domainMin,
4031
- domainMax: t.domainMax ?? Ae.domainMax,
4032
- nice: t.nice ?? Ae.nice,
4033
- reverse: t.reverse ?? Ae.reverse,
4033
+ domainMin: t.domainMin ?? Te.domainMin,
4034
+ domainMax: t.domainMax ?? Te.domainMax,
4035
+ nice: t.nice ?? Te.nice,
4036
+ reverse: t.reverse ?? Te.reverse,
4034
4037
  clamp: t.clamp ?? !1
4035
4038
  };
4036
4039
  case "discrete":
4037
- return bl(t, e.demands);
4040
+ return Sl(t, e.demands);
4038
4041
  case "palette":
4039
4042
  return {
4040
4043
  type: t.type,
4041
4044
  scaledAesthetic: t.scaledAesthetic,
4042
4045
  scaleType: t.scaleType,
4043
- palette: zr(e.container, t.palette, e.customPalettes),
4044
- overrides: us(e.container, t.overrides, t.palette, e.customPalettes)
4046
+ palette: Kr(e.container, t.palette, e.customPalettes),
4047
+ overrides: ds(e.container, t.overrides, t.palette, e.customPalettes)
4045
4048
  };
4046
4049
  case "identity":
4047
4050
  return {
@@ -4053,16 +4056,16 @@ function ct(e, t) {
4053
4056
  throw new x({ message: `Unknown scale type: ${t.scaleType}` });
4054
4057
  }
4055
4058
  }
4056
- function vl(e, t) {
4057
- const { scales: n, layers: r, coords: s } = t, a = lr(e, t), o = Il(Vl(n, r), a.demands), i = /* @__PURE__ */ new Map();
4059
+ function bl(e, t) {
4060
+ const { scales: n, layers: r, coords: s } = t, a = dr(e, t), o = El(Il(n, r), a.demands), i = /* @__PURE__ */ new Map();
4058
4061
  for (const l of o) i.set(l.scaledAesthetic, l);
4059
4062
  const c = [...i.values()].map((l) => {
4060
- const u = Sl(a, l);
4063
+ const u = Al(a, l);
4061
4064
  return ct(a, u);
4062
4065
  });
4063
- return s.coordType === "polar" ? c.map(ur) : c;
4066
+ return s.coordType === "polar" ? c.map(mr) : c;
4064
4067
  }
4065
- function bl(e, t) {
4068
+ function Sl(e, t) {
4066
4069
  const n = t?.bandPadding[e.scaledAesthetic];
4067
4070
  return {
4068
4071
  type: e.type,
@@ -4071,14 +4074,14 @@ function bl(e, t) {
4071
4074
  range: e.range ?? oe.range,
4072
4075
  domain: e.domain ?? oe.domain,
4073
4076
  padding: e.padding ?? n ?? oe.padding,
4074
- reverse: e.reverse ?? Al(e.scaledAesthetic, t)
4077
+ reverse: e.reverse ?? Tl(e.scaledAesthetic, t)
4075
4078
  };
4076
4079
  }
4077
- var ur = (e) => e.scaleType === "discrete" ? {
4080
+ var mr = (e) => e.scaleType === "discrete" ? {
4078
4081
  ...e,
4079
4082
  padding: 0
4080
4083
  } : e;
4081
- function Sl(e, t) {
4084
+ function Al(e, t) {
4082
4085
  return t.scaleType === "inferred" || t.scaleType === "discrete" || !e.demands.bandedAxes.includes(t.scaledAesthetic) ? t : (e.container.diagnostics.addWarning({
4083
4086
  code: "UNSUPPORTED_SCALE_TYPE",
4084
4087
  message: `A geom drawn on '${t.scaledAesthetic}' needs it to be a band scale, but the spec declares a '${t.scaleType}' one; the band wins.`,
@@ -4087,15 +4090,15 @@ function Sl(e, t) {
4087
4090
  scaleType: t.scaleType
4088
4091
  },
4089
4092
  suggestion: `Declare '${t.scaledAesthetic}' as a discrete scale, or omit it and let the geom's band be inferred.`
4090
- }), we(t.scaledAesthetic, { ..."reverse" in t && t.reverse !== void 0 && { reverse: t.reverse } }));
4093
+ }), Ce(t.scaledAesthetic, { ..."reverse" in t && t.reverse !== void 0 && { reverse: t.reverse } }));
4091
4094
  }
4092
- function Al(e, t) {
4095
+ function Tl(e, t) {
4093
4096
  return e === t?.discreteCrossAxis ? !0 : oe.reverse;
4094
4097
  }
4095
- function Tl({ data: e, layers: t, mapping: n, demands: r }, s) {
4096
- const a = wl(t, n, s.scaledAesthetic);
4097
- if (s.scaledAesthetic === r.discreteAxis) return we(s.scaledAesthetic, s.options);
4098
- if (s.scaledAesthetic === r.discreteCrossAxis) return we(s.scaledAesthetic, s.options);
4098
+ function xl({ data: e, layers: t, mapping: n, demands: r }, s) {
4099
+ const a = Cl(t, n, s.scaledAesthetic);
4100
+ if (s.scaledAesthetic === r.discreteAxis) return Ce(s.scaledAesthetic, s.options);
4101
+ if (s.scaledAesthetic === r.discreteCrossAxis) return Ce(s.scaledAesthetic, s.options);
4099
4102
  const o = r.zeroAxes[s.scaledAesthetic];
4100
4103
  if (o !== void 0) {
4101
4104
  const u = s.options;
@@ -4106,21 +4109,21 @@ function Tl({ data: e, layers: t, mapping: n, demands: r }, s) {
4106
4109
  }
4107
4110
  const i = S(a);
4108
4111
  if (!g(i) || !e.hasVariable(i) || e.size() === 0) return Ne(s.scaledAesthetic, s.options);
4109
- const c = e.getType(i), l = cr[s.scaledAesthetic];
4110
- switch (yl[c][l]) {
4112
+ const c = e.getType(i), l = ur[s.scaledAesthetic];
4113
+ switch (vl[c][l]) {
4111
4114
  case "discrete":
4112
- return we(s.scaledAesthetic, s.options);
4115
+ return Ce(s.scaledAesthetic, s.options);
4113
4116
  case "palette":
4114
- return mn(s.scaledAesthetic);
4117
+ return pn(s.scaledAesthetic);
4115
4118
  case "datetime":
4116
- return Ur(s.scaledAesthetic, s.options);
4119
+ return Gr(s.scaledAesthetic, s.options);
4117
4120
  case "continuous":
4118
4121
  return Ne(s.scaledAesthetic, s.options);
4119
4122
  default:
4120
- return Hr(s.scaledAesthetic);
4123
+ return Xr(s.scaledAesthetic);
4121
4124
  }
4122
4125
  }
4123
- function xl(e, t) {
4126
+ function wl(e, t) {
4124
4127
  const n = t.scheme ?? B.scheme;
4125
4128
  return n === null ? null : g(t.range) ? (e.diagnostics.addWarning({
4126
4129
  code: "CONFLICTING_COLOR_RAMP",
@@ -4130,7 +4133,7 @@ function xl(e, t) {
4130
4133
  scaleType: t.scaleType
4131
4134
  },
4132
4135
  suggestion: "Set either a scheme or a range, not both."
4133
- }), null) : (!g(t.domainMid) && nl(n) && e.diagnostics.addWarning({
4136
+ }), null) : (!g(t.domainMid) && rl(n) && e.diagnostics.addWarning({
4134
4137
  code: "DIVERGING_SCHEME_WITHOUT_MIDPOINT",
4135
4138
  message: `The color scale uses a diverging scheme ('${n}') without 'domainMid', so its neutral colour lands at the data midpoint rather than a meaningful centre.`,
4136
4139
  context: {
@@ -4141,24 +4144,24 @@ function xl(e, t) {
4141
4144
  suggestion: "Set 'domainMid' (e.g. 0) to centre the neutral colour."
4142
4145
  }), n);
4143
4146
  }
4144
- function wl(e, t, n) {
4147
+ function Cl(e, t, n) {
4145
4148
  const r = E(n);
4146
- for (const s of Cl(n, e)) {
4149
+ for (const s of Vl(n, e)) {
4147
4150
  const a = s.mapping[r] ?? t[r];
4148
4151
  if (g(S(a))) return a;
4149
4152
  }
4150
4153
  return t[r];
4151
4154
  }
4152
- function Cl(e, t) {
4153
- return e === "ySecondary" ? t.filter((n) => n.yScaleType === "secondary") : e === "y" ? t.filter((n) => n.yScaleType === "primary") : t;
4154
- }
4155
4155
  function Vl(e, t) {
4156
- return !t.some((n) => n.yScaleType === "secondary") || e.some((n) => n.scaledAesthetic === "ySecondary") ? e : [...e, un("ySecondary")];
4156
+ return e === "ySecondary" ? t.filter((n) => n.yScaleType === "secondary") : e === "y" ? t.filter((n) => n.yScaleType === "primary") : t;
4157
4157
  }
4158
4158
  function Il(e, t) {
4159
- return e.some((n) => n.scaledAesthetic === "color") ? e : [...e, t.inferredColor ? un("color") : mn("color")];
4159
+ return !t.some((n) => n.yScaleType === "secondary") || e.some((n) => n.scaledAesthetic === "ySecondary") ? e : [...e, dn("ySecondary")];
4160
4160
  }
4161
- var dr = class extends W {
4161
+ function El(e, t) {
4162
+ return e.some((n) => n.scaledAesthetic === "color") ? e : [...e, t.inferredColor ? dn("color") : pn("color")];
4163
+ }
4164
+ var pr = class extends W {
4162
4165
  constructor(e) {
4163
4166
  super(), this.registry = e;
4164
4167
  }
@@ -4171,9 +4174,9 @@ var dr = class extends W {
4171
4174
  run(e) {
4172
4175
  return e.transforms.reduce((t, n) => this.registry.get(n.transformType).apply(t, n), e.data);
4173
4176
  }
4174
- }, mr = new tn(), El = new dr(mr), Ml = (e, t) => {
4175
- const n = t.every((r) => mr.has(r.transformType));
4176
- return t.length === 0 || !n ? e : El.compile({
4177
+ }, fr = new nn(), Ml = new pr(fr), Ll = (e, t) => {
4178
+ const n = t.every((r) => fr.has(r.transformType));
4179
+ return t.length === 0 || !n ? e : Ml.compile({
4177
4180
  data: e,
4178
4181
  transforms: t
4179
4182
  });
@@ -4181,7 +4184,7 @@ var dr = class extends W {
4181
4184
  function _() {
4182
4185
  return Gt += 1, `${Math.random().toString(36).slice(2, 6)}${Gt.toString(36)}`;
4183
4186
  }
4184
- var Ll = {
4187
+ var kl = {
4185
4188
  top: {
4186
4189
  x: 0,
4187
4190
  y: -1
@@ -4214,21 +4217,21 @@ var Ll = {
4214
4217
  x: 1,
4215
4218
  y: 1
4216
4219
  }
4217
- }, kl = (e, t, n) => {
4218
- const r = _l(e, t), s = Nl(r);
4220
+ }, _l = (e, t, n) => {
4221
+ const r = Dl(e, t), s = Ol(r);
4219
4222
  return {
4220
- differenceArrows: (r.differenceArrows ?? []).map((a) => Pl(e, a, n)).filter(g),
4221
- shapes: (r.shapes ?? []).map((a) => Ul(e, a, s)).filter(g),
4222
- arrows: (r.arrows ?? []).map((a) => jl(e, a, n, s)).filter(g),
4223
- textAnnotations: (r.textAnnotations ?? []).map((a) => Ol(e, a, n, s)).filter(g),
4224
- stickers: (r.stickers ?? []).map((a) => $l(e, a, n, s)).filter(g),
4225
- images: (r.images ?? []).map((a) => Gl(e, a, s)).filter(g),
4226
- pinnedNumbers: (r.pinnedNumbers ?? []).map((a) => Bl(e, a, n)).filter(g),
4227
- comments: (r.comments ?? []).map((a) => Fl(e, a, n)).filter(g)
4223
+ differenceArrows: (r.differenceArrows ?? []).map((a) => $l(e, a, n)).filter(g),
4224
+ shapes: (r.shapes ?? []).map((a) => Gl(e, a, s)).filter(g),
4225
+ arrows: (r.arrows ?? []).map((a) => zl(e, a, n, s)).filter(g),
4226
+ textAnnotations: (r.textAnnotations ?? []).map((a) => Pl(e, a, n, s)).filter(g),
4227
+ stickers: (r.stickers ?? []).map((a) => Bl(e, a, n, s)).filter(g),
4228
+ images: (r.images ?? []).map((a) => Yl(e, a, s)).filter(g),
4229
+ pinnedNumbers: (r.pinnedNumbers ?? []).map((a) => Fl(e, a, n)).filter(g),
4230
+ comments: (r.comments ?? []).map((a) => Ul(e, a, n)).filter(g)
4228
4231
  };
4229
- }, _l = (e, t) => {
4232
+ }, Dl = (e, t) => {
4230
4233
  if (t === void 0) return {};
4231
- if (!Dl(t)) return t;
4234
+ if (!Rl(t)) return t;
4232
4235
  const n = /* @__PURE__ */ new Set(), r = (s) => s.id === void 0 ? s : n.has(s.id) ? (e.diagnostics.addWarning({
4233
4236
  code: "ANNOTATION_DUPLICATE_ID",
4234
4237
  message: `More than one annotation declares id "${s.id}" — giving this one a generated id, so references to "${s.id}" point at the first.`,
@@ -4248,15 +4251,15 @@ var Ll = {
4248
4251
  pinnedNumbers: t.pinnedNumbers?.map((s) => r(s)),
4249
4252
  comments: t.comments?.map((s) => r(s))
4250
4253
  };
4251
- }, Dl = (e) => {
4254
+ }, Rl = (e) => {
4252
4255
  const t = /* @__PURE__ */ new Set();
4253
- for (const n of Rl(e))
4256
+ for (const n of Nl(e))
4254
4257
  if (n.id !== void 0) {
4255
4258
  if (t.has(n.id)) return !0;
4256
4259
  t.add(n.id);
4257
4260
  }
4258
4261
  return !1;
4259
- }, Rl = (e) => [
4262
+ }, Nl = (e) => [
4260
4263
  ...e.differenceArrows ?? [],
4261
4264
  ...e.shapes ?? [],
4262
4265
  ...e.arrows ?? [],
@@ -4265,7 +4268,7 @@ var Ll = {
4265
4268
  ...e.stickers ?? [],
4266
4269
  ...e.pinnedNumbers ?? [],
4267
4270
  ...e.comments ?? []
4268
- ], Nl = (e) => {
4271
+ ], Ol = (e) => {
4269
4272
  const t = /* @__PURE__ */ new Set(), n = [
4270
4273
  e.differenceArrows,
4271
4274
  e.shapes,
@@ -4290,25 +4293,25 @@ var Ll = {
4290
4293
  },
4291
4294
  suggestion: "Reference the explicit id of another annotation in the same spec, or set an id on the target."
4292
4295
  }), !1;
4293
- }, Ol = (e, t, n, r) => {
4296
+ }, Pl = (e, t, n, r) => {
4294
4297
  const s = Ee(e, t.at, n, r, t.id);
4295
4298
  return s === null ? null : {
4296
4299
  id: t.id ?? _(),
4297
4300
  content: t.content,
4298
4301
  at: s,
4299
4302
  width: t.width,
4300
- align: t.align ?? Kr.align
4303
+ align: t.align ?? Wr.align
4301
4304
  };
4302
- }, Pl = (e, t, n) => {
4303
- const r = de(e, t.start, n), s = de(e, t.end, n);
4305
+ }, $l = (e, t, n) => {
4306
+ const r = me(e, t.start, n), s = me(e, t.end, n);
4304
4307
  return r === null || s === null ? null : {
4305
4308
  id: t.id ?? _(),
4306
4309
  start: r,
4307
4310
  end: s,
4308
4311
  label: t.label,
4309
- labelCrossPosition: t.labelCrossPosition ?? ss.labelCrossPosition
4312
+ labelCrossPosition: t.labelCrossPosition ?? as.labelCrossPosition
4310
4313
  };
4311
- }, de = (e, t, n) => {
4314
+ }, me = (e, t, n) => {
4312
4315
  const r = t.align !== void 0 ? { align: t.align } : {};
4313
4316
  return t.layerId === void 0 ? {
4314
4317
  anchorValue: t.anchorValue,
@@ -4333,49 +4336,49 @@ var Ll = {
4333
4336
  }, Ee = (e, t, n, r, s) => {
4334
4337
  if (t.anchorType === "annotation") return lt(e, t.ref, r, s) ? t : null;
4335
4338
  if (t.anchorType === "panel" || t.anchorType === "axis" || t.anchorType === "selection") return t;
4336
- const a = de(e, t, n);
4339
+ const a = me(e, t, n);
4337
4340
  return a === null ? null : {
4338
4341
  anchorType: "observation",
4339
4342
  ...a,
4340
4343
  ...t.offset !== void 0 ? { offset: t.offset } : {}
4341
4344
  };
4342
- }, $l = (e, t, n, r) => {
4345
+ }, Bl = (e, t, n, r) => {
4343
4346
  const s = Ee(e, t.at, n, r, t.id);
4344
4347
  return s === null ? null : {
4345
4348
  id: t.id ?? _(),
4346
4349
  at: s,
4347
4350
  sticker: t.sticker
4348
4351
  };
4349
- }, Bl = (e, t, n) => {
4350
- const r = de(e, t.at, n);
4352
+ }, Fl = (e, t, n) => {
4353
+ const r = me(e, t.at, n);
4351
4354
  return r === null ? null : {
4352
4355
  id: t.id ?? _(),
4353
4356
  at: r
4354
4357
  };
4355
- }, Fl = (e, t, n) => {
4356
- const r = de(e, t.at, n);
4358
+ }, Ul = (e, t, n) => {
4359
+ const r = me(e, t.at, n);
4357
4360
  return r === null ? null : {
4358
4361
  id: t.id ?? _(),
4359
4362
  at: r,
4360
4363
  content: t.content
4361
4364
  };
4362
- }, Ul = (e, t, n) => t.region.anchorType === "annotation" && !lt(e, t.region.ref, n, t.id) ? null : {
4365
+ }, Gl = (e, t, n) => t.region.anchorType === "annotation" && !lt(e, t.region.ref, n, t.id) ? null : {
4363
4366
  id: t.id ?? _(),
4364
4367
  kind: t.kind ?? St.kind,
4365
4368
  zOrder: t.zOrder ?? St.zOrder,
4366
- region: Yl(t.region)
4367
- }, Gl = (e, t, n) => t.region.anchorType === "annotation" && !lt(e, t.region.ref, n, t.id) ? null : {
4369
+ region: jl(t.region)
4370
+ }, Yl = (e, t, n) => t.region.anchorType === "annotation" && !lt(e, t.region.ref, n, t.id) ? null : {
4368
4371
  id: t.id ?? _(),
4369
4372
  src: t.src,
4370
4373
  zOrder: t.zOrder ?? ht.zOrder,
4371
4374
  region: t.region,
4372
4375
  fit: t.fit ?? ht.fit
4373
- }, Yl = (e) => e.anchorType !== "selection" || e.padding !== void 0 ? e : {
4376
+ }, jl = (e) => e.anchorType !== "selection" || e.padding !== void 0 ? e : {
4374
4377
  ...e,
4375
- padding: es
4378
+ padding: ts
4376
4379
  }, Yt = (e) => {
4377
4380
  if (e.anchorType === "panel" || e.anchorType === "axis" || e.offset !== void 0 || e.align === void 0) return e;
4378
- const t = Ll[e.align];
4381
+ const t = kl[e.align];
4379
4382
  return t === void 0 ? e : {
4380
4383
  ...e,
4381
4384
  offset: {
@@ -4384,7 +4387,7 @@ var Ll = {
4384
4387
  unit: "px"
4385
4388
  }
4386
4389
  };
4387
- }, jl = (e, t, n, r) => {
4390
+ }, zl = (e, t, n, r) => {
4388
4391
  const s = Ee(e, t.start, n, r, t.id), a = Ee(e, t.end, n, r, t.id);
4389
4392
  return s === null || a === null ? null : {
4390
4393
  id: t.id ?? _(),
@@ -4393,7 +4396,7 @@ var Ll = {
4393
4396
  startArrowheadStyle: t.startArrowheadStyle ?? vt.startArrowheadStyle,
4394
4397
  endArrowheadStyle: t.endArrowheadStyle ?? vt.endArrowheadStyle
4395
4398
  };
4396
- }, zl = {
4399
+ }, Kl = {
4397
4400
  parsingLocale: "en-US",
4398
4401
  legend: {
4399
4402
  position: "auto",
@@ -4459,11 +4462,11 @@ var Ll = {
4459
4462
  isBrandMarkVisible: !1
4460
4463
  }
4461
4464
  };
4462
- function Kl(e) {
4463
- const t = tt({}, zl, e);
4464
- return t.content = Wl(t.content, e?.content), t;
4465
+ function Wl(e) {
4466
+ const t = tt({}, Kl, e);
4467
+ return t.content = ql(t.content, e?.content), t;
4465
4468
  }
4466
- var Wl = (e, t) => {
4469
+ var ql = (e, t) => {
4467
4470
  const n = t?.brandMark?.enabled ?? t?.isBrandMarkVisible ?? e.brandMark.enabled, r = {
4468
4471
  ...e.brandMark,
4469
4472
  enabled: n
@@ -4473,7 +4476,7 @@ var Wl = (e, t) => {
4473
4476
  brandMark: r,
4474
4477
  isBrandMarkVisible: n
4475
4478
  };
4476
- }, ql = {
4479
+ }, Hl = {
4477
4480
  xLimits: null,
4478
4481
  yLimits: null
4479
4482
  }, Fe = {
@@ -4481,11 +4484,11 @@ var Wl = (e, t) => {
4481
4484
  startAngle: 0,
4482
4485
  innerRadius: 0
4483
4486
  };
4484
- function Hl(e) {
4487
+ function Xl(e) {
4485
4488
  const t = e ?? {
4486
4489
  type: "coord",
4487
4490
  coordType: "cartesian"
4488
- }, n = Zs({}, ql, t.params ?? {});
4491
+ }, n = ea({}, Hl, t.params ?? {});
4489
4492
  switch (t.coordType) {
4490
4493
  case "cartesian":
4491
4494
  case "flip":
@@ -4500,12 +4503,12 @@ function Hl(e) {
4500
4503
  ...n,
4501
4504
  theta: t.params?.theta ?? Fe.theta,
4502
4505
  startAngle: t.params?.startAngle ?? Fe.startAngle,
4503
- innerRadius: Qs(t.params?.innerRadius ?? Fe.innerRadius, 0, 1)
4506
+ innerRadius: Zs(t.params?.innerRadius ?? Fe.innerRadius, 0, 1)
4504
4507
  }
4505
4508
  };
4506
4509
  }
4507
4510
  }
4508
- function Xl(e, t, n) {
4511
+ function Jl(e, t, n) {
4509
4512
  const r = [];
4510
4513
  for (const s of t) {
4511
4514
  if (s.layerId !== void 0 && !n.some((a) => a.id === s.layerId)) {
@@ -4530,7 +4533,7 @@ function Xl(e, t, n) {
4530
4533
  }
4531
4534
  return r;
4532
4535
  }
4533
- var Jl = class {
4536
+ var Ql = class {
4534
4537
  constructor() {
4535
4538
  this.diagnostics = [], this.persistent = [];
4536
4539
  }
@@ -4564,7 +4567,7 @@ var Jl = class {
4564
4567
  warnings: n
4565
4568
  };
4566
4569
  }
4567
- }, Ql = class {
4570
+ }, Zl = class {
4568
4571
  constructor(e, t) {
4569
4572
  this.sink = e, this.baseContext = t;
4570
4573
  }
@@ -4592,7 +4595,7 @@ function jt(e) {
4592
4595
  return t.has(r) ? !1 : (t.add(r), !0);
4593
4596
  });
4594
4597
  }
4595
- var Zl = {
4598
+ var eu = {
4596
4599
  showDataLabels: !1,
4597
4600
  format: "absolute",
4598
4601
  showStackTotals: !1,
@@ -4606,39 +4609,39 @@ var Zl = {
4606
4609
  categoryJustify: "start",
4607
4610
  categoryAlign: "center",
4608
4611
  categoryOffset: 4
4609
- }, Pd = {
4612
+ }, $d = {
4610
4613
  stat: { type: "identity" },
4611
4614
  position: "identity",
4612
4615
  params: {}
4613
- }, $d = {
4616
+ }, Bd = {
4614
4617
  stat: { type: "identity" },
4615
4618
  position: "identity",
4616
4619
  params: {
4617
4620
  curve: "linear",
4618
4621
  missingValues: "gap"
4619
4622
  }
4620
- }, Bd = {
4623
+ }, Fd = {
4621
4624
  stat: { type: "identity" },
4622
4625
  position: "stack",
4623
4626
  params: {
4624
4627
  curve: "linear",
4625
4628
  missingValues: "zero"
4626
4629
  }
4627
- }, Fd = {
4630
+ }, Ud = {
4628
4631
  stat: { type: "identity" },
4629
4632
  position: "dodge",
4630
4633
  params: {}
4631
- }, Ud = {
4634
+ }, Gd = {
4632
4635
  stat: { type: "identity" },
4633
4636
  position: "identity",
4634
4637
  interactive: !1,
4635
4638
  params: { labelPosition: "start" }
4636
- }, Gd = {
4639
+ }, Yd = {
4637
4640
  stat: { type: "identity" },
4638
4641
  position: "identity",
4639
4642
  params: {}
4640
4643
  };
4641
- function eu(e, t) {
4644
+ function tu(e, t) {
4642
4645
  const n = e ?? (typeof t == "string" ? t : t.type), r = typeof n == "string" ? n : n.type;
4643
4646
  if (r === "smooth") {
4644
4647
  const s = typeof n == "string" ? void 0 : n;
@@ -4661,15 +4664,15 @@ function eu(e, t) {
4661
4664
  }
4662
4665
  return { type: r };
4663
4666
  }
4664
- function tu(e, t, n, r, s, a) {
4665
- const o = s !== void 0 && a !== void 0 ? new Ql(s, { layerIndex: a }) : s, i = e.get(r.geom), c = r.position ?? i.defaultPosition, l = ou({
4666
- dataLabels: cu(e, t, r, c, n),
4667
+ function nu(e, t, n, r, s, a) {
4668
+ const o = s !== void 0 && a !== void 0 ? new Zl(s, { layerIndex: a }) : s, i = e.get(r.geom), c = r.position ?? i.defaultPosition, l = iu({
4669
+ dataLabels: lu(e, t, r, c, n),
4667
4670
  geom: i,
4668
4671
  position: c,
4669
4672
  coordType: n,
4670
4673
  diagnostics: o
4671
4674
  });
4672
- return au({
4675
+ return ou({
4673
4676
  diagnostics: o,
4674
4677
  coordType: n,
4675
4678
  geom: i,
@@ -4680,7 +4683,7 @@ function tu(e, t, n, r, s, a) {
4680
4683
  type: r.type,
4681
4684
  geom: r.geom,
4682
4685
  mapping: r.mapping ?? {},
4683
- stat: eu(r.stat, i.defaultStat ?? "identity"),
4686
+ stat: tu(r.stat, i.defaultStat ?? "identity"),
4684
4687
  position: c,
4685
4688
  yScaleType: r.yScaleType ?? "primary",
4686
4689
  params: i.resolveParams({
@@ -4692,23 +4695,23 @@ function tu(e, t, n, r, s, a) {
4692
4695
  dataLabels: l
4693
4696
  };
4694
4697
  }
4695
- function nu(e, t, n, r, s) {
4696
- const a = r.map((o, i) => tu(e, t, n, o, s, i));
4697
- return su(e, a);
4698
+ function ru(e, t, n, r, s) {
4699
+ const a = r.map((o, i) => nu(e, t, n, o, s, i));
4700
+ return au(e, a);
4698
4701
  }
4699
- var ru = (e, t, n, r) => r.label !== void 0 ? r.label : Vn({
4702
+ var su = (e, t, n, r) => r.label !== void 0 ? r.label : In({
4700
4703
  geom: e.get(t),
4701
4704
  position: n,
4702
4705
  mapping: r,
4703
4706
  purpose: "label"
4704
- }), su = (e, t) => {
4707
+ }), au = (e, t) => {
4705
4708
  const n = /* @__PURE__ */ new Set();
4706
4709
  for (const r of t) r.position === "fill" && n.add(r.yScaleType);
4707
- return n.size === 0 ? t : Tn(t, (r) => {
4710
+ return n.size === 0 ? t : xn(t, (r) => {
4708
4711
  if (!n.has(r.yScaleType) || !e.has(r.geom) || !e.get(r.geom).positionRoles.some((o) => o.axis === "y" && o.role === "scalar")) return r;
4709
4712
  const s = se(r.mapping.y);
4710
4713
  if (!Y(s)) return r;
4711
- const a = gs(s, 0, 1);
4714
+ const a = hs(s, 0, 1);
4712
4715
  return a === s ? r : {
4713
4716
  ...r,
4714
4717
  mapping: {
@@ -4717,7 +4720,7 @@ var ru = (e, t, n, r) => r.label !== void 0 ? r.label : Vn({
4717
4720
  }
4718
4721
  };
4719
4722
  });
4720
- }, au = ({ diagnostics: e, coordType: t, geom: n, position: r, dataLabels: s }) => {
4723
+ }, ou = ({ diagnostics: e, coordType: t, geom: n, position: r, dataLabels: s }) => {
4721
4724
  if (e === void 0) return;
4722
4725
  const a = n.type === "bar" && t !== "polar";
4723
4726
  if (s.showDataLabels && !n.dataLabelCoordTypes.includes(t)) {
@@ -4728,7 +4731,7 @@ var ru = (e, t, n, r) => r.label !== void 0 ? r.label : Vn({
4728
4731
  });
4729
4732
  return;
4730
4733
  }
4731
- s.showDataLabels && s.position === "outside" && a && pe(r) && e.addWarning({
4734
+ s.showDataLabels && s.position === "outside" && a && fe(r) && e.addWarning({
4732
4735
  code: "DATA_LABEL_PLACEMENT_COERCED",
4733
4736
  message: "Stacked bar segments only place data labels inside; position 'outside' will render as 'inside'.",
4734
4737
  context: {
@@ -4741,10 +4744,10 @@ var ru = (e, t, n, r) => r.label !== void 0 ? r.label : Vn({
4741
4744
  message: "showStackTotals only applies to stacked cartesian bars; it will be ignored.",
4742
4745
  suggestion: "Turn off showStackTotals, or use a bar geom with position 'stack'."
4743
4746
  });
4744
- }, ou = ({ dataLabels: e, geom: t, position: n, coordType: r, diagnostics: s }) => {
4747
+ }, iu = ({ dataLabels: e, geom: t, position: n, coordType: r, diagnostics: s }) => {
4745
4748
  const { justify: a, showDataLabels: o } = e;
4746
4749
  if (a !== "panel-start" && a !== "panel-end") return e;
4747
- const i = iu(t, n, r);
4750
+ const i = cu(t, n, r);
4748
4751
  if (i === null) return e;
4749
4752
  const c = a === "panel-end" ? "end" : "start";
4750
4753
  return o && s?.addWarning({
@@ -4759,25 +4762,25 @@ var ru = (e, t, n, r) => r.label !== void 0 ? r.label : Vn({
4759
4762
  ...e,
4760
4763
  justify: c
4761
4764
  };
4762
- }, iu = (e, t, n) => n === "polar" ? "Panel-edge anchors do not apply under polar coords" : e.type === "bar" && pe(t) ? "Stacked bar segments would all pin their labels to the same panel edge" : null, cu = (e, t, n, r, s) => {
4765
+ }, cu = (e, t, n) => n === "polar" ? "Panel-edge anchors do not apply under polar coords" : e.type === "bar" && fe(t) ? "Stacked bar segments would all pin their labels to the same panel edge" : null, lu = (e, t, n, r, s) => {
4763
4766
  const a = {
4764
4767
  ...t,
4765
4768
  ...n.mapping
4766
- }, o = ru(e, n.geom, r, a), i = e.get(n.geom);
4769
+ }, o = su(e, n.geom, r, a), i = e.get(n.geom);
4767
4770
  return {
4768
- ...tt({}, Zl, i.resolveDataLabelDefaults?.(r) ?? {}, i.dataLabels?.[s] ?? {}, n.dataLabels ?? {}),
4771
+ ...tt({}, eu, i.resolveDataLabelDefaults?.(r) ?? {}, i.dataLabels?.[s] ?? {}, n.dataLabels ?? {}),
4769
4772
  labelSource: o
4770
4773
  };
4771
- }, lu = (e) => {
4774
+ }, uu = (e) => {
4772
4775
  const t = {
4773
4776
  tokens: {},
4774
4777
  defaults: [],
4775
4778
  overrides: []
4776
4779
  };
4777
- for (const n of uu(e))
4780
+ for (const n of du(e))
4778
4781
  Object.assign(t.tokens, n.tokens), t.defaults.push(...n.defaults ?? []), t.overrides.push(...n.overrides ?? []);
4779
4782
  return t;
4780
- }, uu = (e) => {
4783
+ }, du = (e) => {
4781
4784
  const t = [], n = /* @__PURE__ */ new Set(), r = e === void 0 ? [] : [e];
4782
4785
  for (; r.length > 0; ) {
4783
4786
  const s = r.pop();
@@ -4788,15 +4791,15 @@ var ru = (e, t, n, r) => r.label !== void 0 ? r.label : Vn({
4788
4791
  }
4789
4792
  return t.reverse();
4790
4793
  };
4791
- function du(e, t, n) {
4792
- const r = Hl(t.coords), s = nu(e.geomRegistry, t.mapping, r.coordType, t.layers, e.diagnostics), a = vl(e, {
4793
- data: Ml(t.data, t.transforms),
4794
+ function mu(e, t, n) {
4795
+ const r = Xl(t.coords), s = ru(e.geomRegistry, t.mapping, r.coordType, t.layers, e.diagnostics), a = bl(e, {
4796
+ data: Ll(t.data, t.transforms),
4794
4797
  scales: t.scales,
4795
4798
  layers: s,
4796
4799
  mapping: t.mapping,
4797
4800
  coords: r,
4798
4801
  customPalettes: n
4799
- }), o = Kl(t.config), i = Xl(e, t.highlights, s), c = kl(e, t.annotations, s), l = lu(t.styles);
4802
+ }), o = Wl(t.config), i = Jl(e, t.highlights, s), c = _l(e, t.annotations, s), l = uu(t.styles);
4800
4803
  return {
4801
4804
  data: t.data,
4802
4805
  mapping: t.mapping,
@@ -4810,17 +4813,17 @@ function du(e, t, n) {
4810
4813
  config: o
4811
4814
  };
4812
4815
  }
4813
- var mu = class {
4816
+ var pu = class {
4814
4817
  constructor(e) {
4815
4818
  this.container = e;
4816
4819
  }
4817
4820
  compile({ spec: e, dataset: t, customPalettes: n }) {
4818
- return du(this.container, {
4821
+ return mu(this.container, {
4819
4822
  ...e,
4820
4823
  data: t
4821
4824
  }, n);
4822
4825
  }
4823
- }, pu = () => {
4826
+ }, fu = () => {
4824
4827
  let e = {}, t = null;
4825
4828
  return {
4826
4829
  reset: () => {
@@ -4839,7 +4842,7 @@ var mu = class {
4839
4842
  }
4840
4843
  }
4841
4844
  };
4842
- }, fu = class {
4845
+ }, gu = class {
4843
4846
  constructor(e) {
4844
4847
  this.registry = e;
4845
4848
  }
@@ -4851,16 +4854,16 @@ var mu = class {
4851
4854
  xScaleIsDiscrete: t.xScaleIsDiscrete,
4852
4855
  params: t.params
4853
4856
  });
4854
- return hu(n, n.resolveComputedVariables(e, t.params), r, t.requiredAesthetics), {
4857
+ return yu(n, n.resolveComputedVariables(e, t.params), r, t.requiredAesthetics), {
4855
4858
  data: r.data,
4856
4859
  mapping: {
4857
- ...gu(t, r.data),
4860
+ ...hu(t, r.data),
4858
4861
  ...r.mapping
4859
4862
  }
4860
4863
  };
4861
4864
  }
4862
4865
  };
4863
- function gu({ data: e, mapping: t }, n) {
4866
+ function hu({ data: e, mapping: t }, n) {
4864
4867
  const r = {};
4865
4868
  for (const [s, a] of Object.entries(t)) {
4866
4869
  const o = S(a);
@@ -4868,7 +4871,7 @@ function gu({ data: e, mapping: t }, n) {
4868
4871
  }
4869
4872
  return r;
4870
4873
  }
4871
- function hu(e, t, { data: n, mapping: r }, s) {
4874
+ function yu(e, t, { data: n, mapping: r }, s) {
4872
4875
  for (const a of s) {
4873
4876
  if (!t.has(a)) continue;
4874
4877
  const o = r[a], i = S(o);
@@ -4884,20 +4887,20 @@ function hu(e, t, { data: n, mapping: r }, s) {
4884
4887
  });
4885
4888
  }
4886
4889
  }
4887
- var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
4888
- for (const n of pr) {
4889
- const r = vu(e, n, t);
4890
+ var gr = Object.keys(ye), jd = (e) => Object.hasOwn(ye, e), zd = (e, t) => {
4891
+ for (const n of gr) {
4892
+ const r = bu(e, n, t);
4890
4893
  if (r) return r;
4891
4894
  }
4892
4895
  return null;
4893
- }, fr = (e, t) => e[he[t]], yu = (e, t, n) => ({
4896
+ }, hr = (e, t) => e[ye[t]], vu = (e, t, n) => ({
4894
4897
  ...e,
4895
- [he[t]]: n
4896
- }), zd = (e, t) => {
4897
- const n = fr(e, t.kind);
4898
- return yu(e, t.kind, [...n.slice(0, t.index), ...n.slice(t.index + 1)]);
4899
- }, vu = (e, t, n) => {
4900
- const r = fr(e, t), s = r.findIndex((o) => o.id === n), a = r[s];
4898
+ [ye[t]]: n
4899
+ }), Kd = (e, t) => {
4900
+ const n = hr(e, t.kind);
4901
+ return vu(e, t.kind, [...n.slice(0, t.index), ...n.slice(t.index + 1)]);
4902
+ }, bu = (e, t, n) => {
4903
+ const r = hr(e, t), s = r.findIndex((o) => o.id === n), a = r[s];
4901
4904
  return a === void 0 ? null : {
4902
4905
  kind: t,
4903
4906
  index: s,
@@ -4906,13 +4909,13 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
4906
4909
  }, zt = Object.freeze({
4907
4910
  light: "#898373",
4908
4911
  dark: "#9F9886"
4909
- }), bu = {
4912
+ }), Su = {
4910
4913
  graphBackground: yt,
4911
4914
  graphBorder: Object.freeze({
4912
4915
  light: "rgba(58, 56, 51, 0.15)",
4913
4916
  dark: "rgba(237, 231, 218, 0.15)"
4914
4917
  }),
4915
- geom: an,
4918
+ geom: on,
4916
4919
  geomBorder: Object.freeze({
4917
4920
  light: "rgba(58, 56, 51, 0.55)",
4918
4921
  dark: "rgba(237, 231, 218, 0.55)"
@@ -4930,7 +4933,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
4930
4933
  light: "#E1DAC9",
4931
4934
  dark: "#373531"
4932
4935
  }),
4933
- hoverAffordance: ns,
4936
+ hoverAffordance: rs,
4934
4937
  hoverGuideFill: Object.freeze({
4935
4938
  light: "#E7E1D2",
4936
4939
  dark: "#2B2A27"
@@ -4977,21 +4980,21 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
4977
4980
  dark: "#CB3333"
4978
4981
  },
4979
4982
  trendNeutral: zt
4980
- }, Su = sn(fn()), Me = Object.freeze({
4981
- tokens: Object.freeze(bu),
4982
- defaults: Object.freeze(Su),
4983
+ }, Au = an(gn()), Me = Object.freeze({
4984
+ tokens: Object.freeze(Su),
4985
+ defaults: Object.freeze(Au),
4983
4986
  overrides: Object.freeze([])
4984
- }), Au = class extends q {
4987
+ }), Tu = class extends q {
4985
4988
  constructor(e) {
4986
4989
  super(), this.container = e;
4987
4990
  }
4988
4991
  compile(e) {
4989
4992
  const t = super.compile(e);
4990
- for (const r of Uu(e.styles, t)) this.container.diagnostics.addWarning(r);
4991
- for (const r of Yu(e.styles)) this.container.diagnostics.addWarning(r);
4992
- const n = Ku(this.container.geomRegistry);
4993
+ for (const r of Gu(e.styles, t)) this.container.diagnostics.addWarning(r);
4994
+ for (const r of ju(e.styles)) this.container.diagnostics.addWarning(r);
4995
+ const n = Wu(this.container.geomRegistry);
4993
4996
  for (const r of n(e.styles)) this.container.diagnostics.addWarning(r);
4994
- for (const r of Wu(e.styles)) this.container.diagnostics.addWarning(r);
4997
+ for (const r of qu(e.styles)) this.container.diagnostics.addWarning(r);
4995
4998
  for (const r of t) for (const s of r.styles.warnings) this.container.diagnostics.addWarning(s);
4996
4999
  return t;
4997
5000
  }
@@ -4999,25 +5002,25 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
4999
5002
  return [e.styles, e.config.parsingLocale];
5000
5003
  }
5001
5004
  compileLayer(e, t) {
5002
- const n = Iu({
5005
+ const n = Eu({
5003
5006
  layer: e,
5004
5007
  layerIndex: t.layers.indexOf(e),
5005
5008
  styles: t.styles,
5006
5009
  parsingLocale: t.config.parsingLocale,
5007
- styleTarget: gr(this.container.geomRegistry, e.geom)
5010
+ styleTarget: yr(this.container.geomRegistry, e.geom)
5008
5011
  });
5009
5012
  return {
5010
5013
  ...e,
5011
5014
  styles: n
5012
5015
  };
5013
5016
  }
5014
- }, Tu = class extends W {
5017
+ }, xu = class extends W {
5015
5018
  constructor(e) {
5016
5019
  super(), this.container = e;
5017
5020
  }
5018
5021
  compile(e) {
5019
5022
  const t = super.compile(e);
5020
- for (const n of Gu(e.styles, e.annotations)) this.container.diagnostics.addWarning(n);
5023
+ for (const n of Yu(e.styles, e.annotations)) this.container.diagnostics.addWarning(n);
5021
5024
  for (const n of t.warnings) this.container.diagnostics.addWarning(n);
5022
5025
  return t;
5023
5026
  }
@@ -5025,22 +5028,22 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5025
5028
  return [e.styles];
5026
5029
  }
5027
5030
  run(e) {
5028
- return Vu(e.styles);
5031
+ return Iu(e.styles);
5029
5032
  }
5030
- }, qe = new Xe(), xu = new Set(_r), wu = /* @__PURE__ */ new WeakMap(), Cu = /* @__PURE__ */ new WeakMap(), Kt = {
5033
+ }, qe = new Xe(), wu = new Set(Dr), Cu = /* @__PURE__ */ new WeakMap(), Vu = /* @__PURE__ */ new WeakMap(), Kt = {
5031
5034
  stateless: 0,
5032
5035
  dimmed: 1,
5033
5036
  hovered: 2
5034
- }, Vu = (e) => {
5037
+ }, Iu = (e) => {
5035
5038
  const t = [], n = {
5036
5039
  ...Me.tokens,
5037
5040
  ...e.tokens
5038
5041
  }, r = {
5039
- ...Lu(),
5042
+ ...ku(),
5040
5043
  warnings: t
5041
5044
  }, s = (a, o, i, c) => {
5042
- if (ve(a)) return;
5043
- const l = a.id === void 0 ? {} : { styleEntryId: a.id }, u = a.select.target, d = ku(a.select);
5045
+ if (be(a)) return;
5046
+ const l = a.id === void 0 ? {} : { styleEntryId: a.id }, u = a.select.target, d = _u(a.select);
5044
5047
  if (d.status === "unknown-target") {
5045
5048
  t.push({
5046
5049
  code: "INVALID_STYLE_RULE",
@@ -5137,7 +5140,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5137
5140
  return;
5138
5141
  }
5139
5142
  }
5140
- const b = xr({
5143
+ const b = Cr({
5141
5144
  declarations: a.declarations,
5142
5145
  vocabulary: m.vocabulary,
5143
5146
  tokens: n,
@@ -5148,7 +5151,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5148
5151
  });
5149
5152
  if (Object.keys(b).length === 0) return;
5150
5153
  const v = m.select.target;
5151
- hr(v) && r[v][o].push({
5154
+ vr(v) && r[v][o].push({
5152
5155
  select: a.select,
5153
5156
  declarations: b,
5154
5157
  origin: c
@@ -5169,20 +5172,20 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5169
5172
  ...a.id === void 0 ? {} : { id: a.id }
5170
5173
  });
5171
5174
  }), r;
5172
- }, Kd = (e) => qe.has(e) ? qe.get(e).styleTarget : void 0, Iu = (e) => {
5175
+ }, Wd = (e) => qe.has(e) ? qe.get(e).styleTarget : void 0, Eu = (e) => {
5173
5176
  const { layer: t, layerIndex: n, styles: r, parsingLocale: s, styleTarget: a } = e, o = at(t, s), i = [], c = {
5174
5177
  ...Me.tokens,
5175
5178
  ...r.tokens
5176
5179
  }, l = (d) => d === t.geom ? a : void 0, u = (d, m) => {
5177
5180
  const f = [];
5178
5181
  return d.forEach((p, b) => {
5179
- if (!ve(p)) return;
5182
+ if (!be(p)) return;
5180
5183
  const v = p.select.kind;
5181
5184
  if (v !== void 0 && v !== t.geom || p.select.layer !== void 0 && p.select.layer !== t.id) return;
5182
5185
  const y = `${m}[${b}]`;
5183
- if (Tr(p, y, l) !== void 0) return;
5186
+ if (wr(p, y, l) !== void 0) return;
5184
5187
  const A = p.when?.state;
5185
- if (A !== void 0 && !Ar(A)) return;
5188
+ if (A !== void 0 && !xr(A)) return;
5186
5189
  const $ = p.id === void 0 ? {} : { styleEntryId: p.id }, V = {
5187
5190
  list: m,
5188
5191
  index: b,
@@ -5204,7 +5207,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5204
5207
  return;
5205
5208
  }
5206
5209
  }
5207
- const ae = Sr({
5210
+ const ae = Tr({
5208
5211
  select: p.select,
5209
5212
  declarations: p.declarations,
5210
5213
  layerGeom: t.geom,
@@ -5229,23 +5232,23 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5229
5232
  }), f;
5230
5233
  };
5231
5234
  return {
5232
- defaults: [...Fu(t.geom, a, c, i), ...u(r.defaults, "defaults")],
5235
+ defaults: [...Uu(t.geom, a, c, i), ...u(r.defaults, "defaults")],
5233
5236
  overrides: u(r.overrides, "overrides"),
5234
5237
  warnings: i,
5235
- ...Nu(t.geom, a),
5236
- dashPresets: a?.observation?.dashPresets ?? Zt.line
5238
+ ...Ou(t.geom, a),
5239
+ dashPresets: a?.observation?.dashPresets ?? en.line
5237
5240
  };
5238
- }, gr = (e, t) => e.has(t) ? e.get(t).styleTarget : void 0, Eu = (e) => (t) => gr(e, t), Mu = () => {
5241
+ }, yr = (e, t) => e.has(t) ? e.get(t).styleTarget : void 0, Mu = (e) => (t) => yr(e, t), Lu = () => {
5239
5242
  const e = /* @__PURE__ */ new Set(), t = (n) => {
5240
5243
  if (e.add(n.select.target), n.children !== void 0)
5241
5244
  for (const r of Object.values(n.children)) t(r);
5242
5245
  };
5243
5246
  for (const n of Object.values(j)) t(n);
5244
5247
  return e;
5245
- }, ut = Mu(), hr = (e) => e !== "geom" && ut.has(e), Lu = () => {
5248
+ }, ut = Lu(), vr = (e) => e !== "geom" && ut.has(e), ku = () => {
5246
5249
  const e = {};
5247
5250
  for (const t of ut)
5248
- hr(t) && (e[t] = {
5251
+ vr(t) && (e[t] = {
5249
5252
  defaults: [],
5250
5253
  overrides: []
5251
5254
  });
@@ -5258,7 +5261,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5258
5261
  s !== void 0 && n.push(s);
5259
5262
  }
5260
5263
  return n;
5261
- }, Wt = (e) => Object.keys(e.vocabulary).length === 0 && e.children !== void 0, ku = (e) => {
5264
+ }, Wt = (e) => Object.keys(e.vocabulary).length === 0 && e.children !== void 0, _u = (e) => {
5262
5265
  const t = Ge(e);
5263
5266
  if (t !== void 0) return Wt(t) ? {
5264
5267
  status: "namespace",
@@ -5270,7 +5273,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5270
5273
  const n = Ge({ target: e.target });
5271
5274
  if (n === void 0) return { status: "unknown-target" };
5272
5275
  let r = n;
5273
- for (const s of Gr) {
5276
+ for (const s of Yr) {
5274
5277
  const a = e[s];
5275
5278
  if (a === void 0) continue;
5276
5279
  const o = r.children === void 0 ? void 0 : Object.values(r.children).find((i) => i.select[s] === a);
@@ -5292,17 +5295,17 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5292
5295
  }, dt = (e) => {
5293
5296
  const t = e.options ?? [];
5294
5297
  return t.includes("where") || t.includes("state");
5295
- }, _u = (e, t) => {
5296
- const n = e === "geom" ? qe.getAll().find((r) => r.styleTarget !== void 0 && Jr(r.styleTarget)[t] !== void 0)?.type : e === "annotation" ? Object.entries(j.annotation.children).find(([, r]) => r.vocabulary[t] !== void 0)?.[0] : void 0;
5298
+ }, Du = (e, t) => {
5299
+ const n = e === "geom" ? qe.getAll().find((r) => r.styleTarget !== void 0 && Qr(r.styleTarget)[t] !== void 0)?.type : e === "annotation" ? Object.entries(j.annotation.children).find(([, r]) => r.vocabulary[t] !== void 0)?.[0] : void 0;
5297
5300
  return n === void 0 ? void 0 : `style.${e}.${n}`;
5298
- }, ve = (e) => e.select.target === "geom", Du = (e, t) => e !== void 0 && Object.hasOwn(e, t) ? e[t] : void 0, yr = (e, t, n, r) => {
5301
+ }, be = (e) => e.select.target === "geom", Ru = (e, t) => e !== void 0 && Object.hasOwn(e, t) ? e[t] : void 0, br = (e, t, n, r) => {
5299
5302
  const s = e.get(n) ?? /* @__PURE__ */ new Map();
5300
5303
  e.set(n, s);
5301
5304
  const a = s.get(t);
5302
5305
  if (a !== void 0) return a;
5303
5306
  const o = r();
5304
5307
  return s.set(t, o), o;
5305
- }, vr = (e, t) => yr(wu, e, t, () => rs(e, t)), me = (e, t) => {
5308
+ }, Sr = (e, t) => br(Cu, e, t, () => ss(e, t)), pe = (e, t) => {
5306
5309
  const { kind: n, part: r } = e;
5307
5310
  if (n === void 0) return Ge({
5308
5311
  target: "geom",
@@ -5310,13 +5313,13 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5310
5313
  });
5311
5314
  const s = t(n);
5312
5315
  if (s === void 0) return;
5313
- const a = vr(n, s);
5314
- return r === void 0 ? a : Du(a.children, r);
5315
- }, Ru = (e, t) => {
5316
- const n = me(e, () => t);
5316
+ const a = Sr(n, s);
5317
+ return r === void 0 ? a : Ru(a.children, r);
5318
+ }, Nu = (e, t) => {
5319
+ const n = pe(e, () => t);
5317
5320
  return n === void 0 || dt(n);
5318
- }, br = (e, t) => [e, t].filter((n) => n !== void 0).join(" "), Nu = (e, t) => {
5319
- const n = me({ kind: e }, () => t), r = {};
5321
+ }, Ar = (e, t) => [e, t].filter((n) => n !== void 0).join(" "), Ou = (e, t) => {
5322
+ const n = pe({ kind: e }, () => t), r = {};
5320
5323
  for (const s of Object.values(n?.children ?? {})) s.select.part !== void 0 && (r[s.select.part] = {
5321
5324
  vocabulary: s.vocabulary,
5322
5325
  aesthetics: s.aesthetics ?? {}
@@ -5328,15 +5331,15 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5328
5331
  },
5329
5332
  parts: r
5330
5333
  };
5331
- }, qt = (e, t) => me(e, () => t)?.vocabulary ?? j.geom.vocabulary, Ou = (e, t) => {
5334
+ }, qt = (e, t) => pe(e, () => t)?.vocabulary ?? j.geom.vocabulary, Pu = (e, t) => {
5332
5335
  const n = {};
5333
5336
  for (const r of Object.keys(e)) {
5334
5337
  const s = e[r];
5335
5338
  s === void 0 || t[r] === void 0 || (n[r] = s);
5336
5339
  }
5337
5340
  return n;
5338
- }, Sr = (e) => {
5339
- const t = xr({
5341
+ }, Tr = (e) => {
5342
+ const t = Cr({
5340
5343
  declarations: e.declarations,
5341
5344
  vocabulary: qt(e.select, e.styleTarget),
5342
5345
  tokens: e.tokens,
@@ -5345,12 +5348,12 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5345
5348
  warnings: e.warnings,
5346
5349
  entryTarget: "geom"
5347
5350
  });
5348
- return e.select.part !== void 0 ? t : Ou(t, qt({ kind: e.layerGeom }, e.styleTarget));
5349
- }, Pu = (e, t) => yr(Cu, e, t, () => sn(fn([vr(e, t)]))), $u = (e, t) => Kt[e.state ?? "stateless"] - Kt[t.state ?? "stateless"], Bu = (e, t) => t === void 0 ? `builtin ${e}` : `builtin ${e}.${t}`, Fu = (e, t, n, r) => {
5351
+ return e.select.part !== void 0 ? t : Pu(t, qt({ kind: e.layerGeom }, e.styleTarget));
5352
+ }, $u = (e, t) => br(Vu, e, t, () => an(gn([Sr(e, t)]))), Bu = (e, t) => Kt[e.state ?? "stateless"] - Kt[t.state ?? "stateless"], Fu = (e, t) => t === void 0 ? `builtin ${e}` : `builtin ${e}.${t}`, Uu = (e, t, n, r) => {
5350
5353
  const s = [], a = { list: "builtin" }, o = (i, c, l, u) => {
5351
5354
  if (i.kind !== void 0 && i.kind !== e) return;
5352
- if (l !== void 0 && !Ru(i, t)) {
5353
- const f = br(e, i.part);
5355
+ if (l !== void 0 && !Nu(i, t)) {
5356
+ const f = Ar(e, i.part);
5354
5357
  r.push({
5355
5358
  code: "INVALID_STYLE_RULE",
5356
5359
  message: `Style ${u} ignored: a ${f} entry takes no conditions.`,
@@ -5362,7 +5365,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5362
5365
  });
5363
5366
  return;
5364
5367
  }
5365
- const d = Sr({
5368
+ const d = Tr({
5366
5369
  select: i,
5367
5370
  declarations: c,
5368
5371
  layerGeom: e,
@@ -5382,13 +5385,13 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5382
5385
  });
5383
5386
  };
5384
5387
  if (Me.defaults.forEach((i, c) => {
5385
- ve(i) && o(i.select, i.declarations, i.when?.state, `builtin[${c}]`);
5388
+ be(i) && o(i.select, i.declarations, i.when?.state, `builtin[${c}]`);
5386
5389
  }), t === void 0) return s;
5387
- for (const i of Pu(e, t)) o(i.select, i.declarations, i.when?.state, Bu(e, i.select.part));
5388
- return s.sort($u);
5390
+ for (const i of $u(e, t)) o(i.select, i.declarations, i.when?.state, Fu(e, i.select.part));
5391
+ return s.sort(Bu);
5389
5392
  }, De = (e, t) => {
5390
5393
  e.defaults.forEach((n, r) => t(n, "defaults", r)), e.overrides.forEach((n, r) => t(n, "overrides", r));
5391
- }, Uu = (e, t) => {
5394
+ }, Gu = (e, t) => {
5392
5395
  const n = new Set(t.map((s) => s.id)), r = [];
5393
5396
  return De(e, (s, a, o) => {
5394
5397
  const i = s.select;
@@ -5405,8 +5408,8 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5405
5408
  suggestion: "Set 'layer' to the id of a layer in the spec."
5406
5409
  });
5407
5410
  }), r;
5408
- }, Gu = (e, t) => {
5409
- const n = new Map(pr.flatMap((s) => t[he[s]].map((a) => [a.id, s]))), r = [];
5411
+ }, Yu = (e, t) => {
5412
+ const n = new Map(gr.flatMap((s) => t[ye[s]].map((a) => [a.id, s]))), r = [];
5410
5413
  return De(e, (s, a, o) => {
5411
5414
  const i = s.select;
5412
5415
  if (i.target !== "annotation") return;
@@ -5443,12 +5446,12 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5443
5446
  suggestion: `Set 'kind' to '${u}', or omit it to address the annotation with the shared vocabulary.`
5444
5447
  });
5445
5448
  }), r;
5446
- }, Yu = (e) => {
5449
+ }, ju = (e) => {
5447
5450
  const t = [];
5448
5451
  return De(e, (n, r, s) => {
5449
- if (!ve(n)) return;
5452
+ if (!be(n)) return;
5450
5453
  const a = n.when?.state;
5451
- a === void 0 || Ar(a) || t.push({
5454
+ a === void 0 || xr(a) || t.push({
5452
5455
  code: "INVALID_STYLE_RULE",
5453
5456
  message: `Style ${r}[${s}] scopes to unknown state '${a}'.`,
5454
5457
  context: {
@@ -5456,18 +5459,18 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5456
5459
  actual: String(a),
5457
5460
  ...n.id === void 0 ? {} : { styleEntryId: n.id }
5458
5461
  },
5459
- suggestion: `Set 'state' to one of ${ln.map((o) => `'${o}'`).join(", ")}.`
5462
+ suggestion: `Set 'state' to one of ${un.map((o) => `'${o}'`).join(", ")}.`
5460
5463
  });
5461
5464
  }), t;
5462
- }, Ar = (e) => ln.includes(e), ju = (e, t, n) => e === void 0 ? `Set 'kind' to the geom declaring '${t}' — a part is addressed on the kind that has it.` : n.length === 0 ? `Remove 'part' — ${e} has none.` : `Set 'part' to one of ${n.map((r) => `'${r}'`).join(", ")}, or omit it.`, Tr = (e, t, n) => {
5465
+ }, xr = (e) => un.includes(e), zu = (e, t, n) => e === void 0 ? `Set 'kind' to the geom declaring '${t}' — a part is addressed on the kind that has it.` : n.length === 0 ? `Remove 'part' — ${e} has none.` : `Set 'part' to one of ${n.map((r) => `'${r}'`).join(", ")}, or omit it.`, wr = (e, t, n) => {
5463
5466
  const { kind: r, part: s } = e.select;
5464
5467
  if (s === void 0) return;
5465
- const a = e.id === void 0 ? {} : { styleEntryId: e.id }, o = me({
5468
+ const a = e.id === void 0 ? {} : { styleEntryId: e.id }, o = pe({
5466
5469
  kind: r,
5467
5470
  part: s
5468
5471
  }, n);
5469
5472
  if (o === void 0) {
5470
- const i = me({ kind: r }, n), c = i === void 0 ? [] : He(i, "part");
5473
+ const i = pe({ kind: r }, n), c = i === void 0 ? [] : He(i, "part");
5471
5474
  return {
5472
5475
  code: "INVALID_STYLE_RULE",
5473
5476
  message: `Style ${t} addresses unknown part '${s}'.`,
@@ -5476,11 +5479,11 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5476
5479
  actual: s,
5477
5480
  ...a
5478
5481
  },
5479
- suggestion: ju(r, s, c)
5482
+ suggestion: zu(r, s, c)
5480
5483
  };
5481
5484
  }
5482
5485
  if (e.when !== void 0 && !dt(o)) {
5483
- const i = br(r, s);
5486
+ const i = Ar(r, s);
5484
5487
  return {
5485
5488
  code: "INVALID_STYLE_RULE",
5486
5489
  message: `Style ${t} ignored: a ${i} entry takes no conditions.`,
@@ -5491,7 +5494,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5491
5494
  suggestion: `Remove the 'when' clause — the ${i} is styled as a whole.`
5492
5495
  };
5493
5496
  }
5494
- }, zu = (e, t, n) => {
5497
+ }, Ku = (e, t, n) => {
5495
5498
  const { kind: r } = e.select;
5496
5499
  if (r === void 0 || n.has(r)) return;
5497
5500
  const s = n.getAll().map((a) => `'${a.type}'`);
@@ -5505,20 +5508,20 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5505
5508
  },
5506
5509
  suggestion: `Set 'kind' to one of ${s.join(", ")}, or omit it to reach every geom.`
5507
5510
  };
5508
- }, Ku = (e) => {
5509
- const t = Eu(e);
5511
+ }, Wu = (e) => {
5512
+ const t = Mu(e);
5510
5513
  return (n) => {
5511
5514
  const r = [];
5512
5515
  return De(n, (s, a, o) => {
5513
- if (!ve(s)) return;
5514
- const i = `${a}[${o}]`, c = zu(s, i, e) ?? Tr(s, i, t);
5516
+ if (!be(s)) return;
5517
+ const i = `${a}[${o}]`, c = Ku(s, i, e) ?? wr(s, i, t);
5515
5518
  c !== void 0 && r.push(c);
5516
5519
  }), r;
5517
5520
  };
5518
- }, Wu = (e) => {
5521
+ }, qu = (e) => {
5519
5522
  const t = [];
5520
5523
  for (const [n, r] of Object.entries(e.tokens))
5521
- Rr(r) || t.push({
5524
+ Nr(r) || t.push({
5522
5525
  code: "INVALID_STYLE_RULE",
5523
5526
  message: `Style token '${n}' has an invalid value: ${G(r)}.`,
5524
5527
  context: {
@@ -5528,7 +5531,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5528
5531
  suggestion: `Set '${n}' to a non-empty color string or a { light, dark } pair of colors.`
5529
5532
  });
5530
5533
  return t;
5531
- }, G = (e) => typeof e == "object" && e !== null ? JSON.stringify(e) : String(e), xr = (e) => {
5534
+ }, G = (e) => typeof e == "object" && e !== null ? JSON.stringify(e) : String(e), Cr = (e) => {
5532
5535
  const { declarations: t, vocabulary: n, tokens: r, location: s, origin: a, warnings: o, entryTarget: i } = e, c = {}, l = a.list === "builtin" || a.id === void 0 ? {} : { styleEntryId: a.id }, u = (p, b) => {
5533
5536
  c[p] = b;
5534
5537
  }, d = (p, b, v) => {
@@ -5555,7 +5558,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5555
5558
  suggestion: `Declare '${b}' in the stylesheet's tokens.`
5556
5559
  });
5557
5560
  }, f = (p) => {
5558
- const b = xu.has(p), v = _u(i, p), y = v === void 0 ? `Declare '${p}' on a target whose vocabulary carries it.` : `Declare '${p}' on an entry whose kind supports it (e.g. ${v}).`;
5561
+ const b = wu.has(p), v = Du(i, p), y = v === void 0 ? `Declare '${p}' on a target whose vocabulary carries it.` : `Declare '${p}' on an entry whose kind supports it (e.g. ${v}).`;
5559
5562
  o.push({
5560
5563
  code: "INVALID_STYLE_RULE",
5561
5564
  message: `Style ${s} declaration '${p}' ignored: ${b ? "not in this entry's vocabulary" : "not a style property"}.`,
@@ -5574,7 +5577,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5574
5577
  f(p);
5575
5578
  continue;
5576
5579
  }
5577
- const y = Vr[v](b, r);
5580
+ const y = Er[v](b, r);
5578
5581
  switch (y.status) {
5579
5582
  case "accepted":
5580
5583
  u(p, y.value);
@@ -5592,7 +5595,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5592
5595
  }
5593
5596
  }
5594
5597
  return c;
5595
- }, qu = ({ layer: e }) => {
5598
+ }, Hu = ({ layer: e }) => {
5596
5599
  if (e.position === "stack") return;
5597
5600
  const t = S(e.mapping.y);
5598
5601
  if (t === null) return;
@@ -5605,17 +5608,17 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5605
5608
  grandTotal: n,
5606
5609
  absoluteGrandTotal: r
5607
5610
  };
5608
- }, Hu = ({ layer: e, mainAxis: t }) => {
5611
+ }, Xu = ({ layer: e, mainAxis: t }) => {
5609
5612
  if (e.position !== "stack") return;
5610
5613
  const n = S(e.mapping.x);
5611
5614
  if (n === null || !e.data.hasVariable(h.yMin) || !e.data.hasVariable(h.yMax)) return;
5612
5615
  const r = (i) => t === "y" ? i.xMax : i.yMax, s = (i) => t === "y" ? i.xMin : i.yMin, a = /* @__PURE__ */ new Map();
5613
5616
  for (const i of e.data) {
5614
- const c = i[n], l = pn(i), u = Ue(i), d = as(i), m = jr(i), f = Wr(i);
5617
+ const c = i[n], l = fn(i), u = Ue(i), d = os(i), m = zr(i), f = qr(i);
5615
5618
  if (!g(c) || !g(l) || !g(u) || !g(d) || !g(m) || !g(f)) continue;
5616
5619
  const p = f >= 0;
5617
5620
  if (Math.abs(f) === 0) continue;
5618
- const b = jn(i, n), v = {
5621
+ const b = Kn(i, n), v = {
5619
5622
  xMin: d,
5620
5623
  xMax: m,
5621
5624
  yMin: l,
@@ -5647,7 +5650,7 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5647
5650
  });
5648
5651
  }
5649
5652
  return o;
5650
- }, Xu = class extends q {
5653
+ }, Ju = class extends q {
5651
5654
  constructor(e) {
5652
5655
  super(), this.container = e;
5653
5656
  }
@@ -5655,16 +5658,16 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5655
5658
  return [e.coordSystem];
5656
5659
  }
5657
5660
  compileLayer(e, t) {
5658
- const n = this.container.geomRegistry.get(e.geom), r = {}, s = da(t.coordSystem);
5661
+ const n = this.container.geomRegistry.get(e.geom), r = {}, s = ma(t.coordSystem);
5659
5662
  if (n.summaries.stackTotals) {
5660
- const a = Hu({
5663
+ const a = Xu({
5661
5664
  layer: e,
5662
5665
  mainAxis: s
5663
5666
  });
5664
5667
  a !== void 0 && (r.stackTotals = a);
5665
5668
  }
5666
5669
  if (n.summaries.grandTotal) {
5667
- const a = qu({ layer: e });
5670
+ const a = Hu({ layer: e });
5668
5671
  a !== void 0 && (r.grandTotal = a.grandTotal, r.absoluteGrandTotal = a.absoluteGrandTotal);
5669
5672
  }
5670
5673
  return {
@@ -5678,19 +5681,19 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5678
5681
  alpha: "numeric",
5679
5682
  strokeWidth: "numeric",
5680
5683
  lineType: "categorical"
5681
- }, Ju = [
5684
+ }, Qu = [
5682
5685
  "color",
5683
5686
  "size",
5684
5687
  "alpha",
5685
5688
  "strokeWidth",
5686
5689
  "lineType"
5687
- ], Qu = class extends q {
5690
+ ], Zu = class extends q {
5688
5691
  dependencies(e) {
5689
- return Ju.map((t) => e.scales[t]);
5692
+ return Qu.map((t) => e.scales[t]);
5690
5693
  }
5691
5694
  compileLayer(e, t) {
5692
5695
  let n = e.data;
5693
- const r = Object.entries(cs);
5696
+ const r = Object.entries(ls);
5694
5697
  for (const [s, a] of r) {
5695
5698
  const o = se(e.mapping[s]);
5696
5699
  if (o !== void 0) {
@@ -5698,23 +5701,23 @@ var pr = Object.keys(he), Yd = (e) => Object.hasOwn(he, e), jd = (e, t) => {
5698
5701
  continue;
5699
5702
  }
5700
5703
  const i = S(e.mapping[s]), c = t.scales[s];
5701
- !i || !c || c.kind !== "visual" || (n = n.deriveVariableFrom(i, a, Ht[s], Zu(c)));
5704
+ !i || !c || c.kind !== "visual" || (n = n.deriveVariableFrom(i, a, Ht[s], ed(c)));
5702
5705
  }
5703
5706
  return {
5704
5707
  ...e,
5705
5708
  data: n
5706
5709
  };
5707
5710
  }
5708
- }, Zu = (e) => (t) => g(t) ? e.map(t) : null;
5709
- function ed(e = new Xe()) {
5711
+ }, ed = (e) => (t) => g(t) ? e.map(t) : null;
5712
+ function td(e = new Xe()) {
5710
5713
  return {
5711
- diagnostics: new Jl(),
5714
+ diagnostics: new Ql(),
5712
5715
  geomRegistry: e
5713
5716
  };
5714
5717
  }
5715
- var td = class {
5718
+ var nd = class {
5716
5719
  constructor(e, t, n, r, s, a, o, i, c, l, u, d, m, f, p, b) {
5717
- this.container = e, this.dataCompiler = t, this.specCompiler = n, this.transformCompiler = r, this.constantMappingCompiler = s, this.layerPhasedCompiler = a, this.scaleCompiler = o, this.coordCompiler = i, this.positionMapperCompiler = c, this.visualMapperCompiler = l, this.guideCompiler = u, this.summarizeCompiler = d, this.stylesCompiler = m, this.chromeStylesCompiler = f, this.highlightsCompiler = p, this.annotationsCompiler = b, this.stageTimer = Re ? pu() : null, this.lastCompile = null, this.lastDiagnostics = null, this.lastData = void 0, this.lastCustomPalettes = {}, this.stages = [
5720
+ this.container = e, this.dataCompiler = t, this.specCompiler = n, this.transformCompiler = r, this.constantMappingCompiler = s, this.layerPhasedCompiler = a, this.scaleCompiler = o, this.coordCompiler = i, this.positionMapperCompiler = c, this.visualMapperCompiler = l, this.guideCompiler = u, this.summarizeCompiler = d, this.stylesCompiler = m, this.chromeStylesCompiler = f, this.highlightsCompiler = p, this.annotationsCompiler = b, this.stageTimer = Re ? fu() : null, this.lastCompile = null, this.lastDiagnostics = null, this.lastData = void 0, this.lastCustomPalettes = {}, this.stages = [
5718
5721
  {
5719
5722
  name: "data",
5720
5723
  getStats: () => this.dataCompiler.stats
@@ -5801,7 +5804,7 @@ var td = class {
5801
5804
  colorScheme: n
5802
5805
  });
5803
5806
  this.lastData = e.data;
5804
- const r = this.dataCompiler.compile(e.data), s = this.reResolveInferredScalesIfNeeded(e.spec.data, Te(e.spec, { data: r }));
5807
+ const r = this.dataCompiler.compile(e.data), s = this.reResolveInferredScalesIfNeeded(e.spec.data, xe(e.spec, { data: r }));
5805
5808
  return this.runPipeline({
5806
5809
  spec: s,
5807
5810
  colorScheme: n
@@ -5825,17 +5828,17 @@ var td = class {
5825
5828
  }
5826
5829
  reResolveInferredScalesIfNeeded(e, t) {
5827
5830
  if (e.size() !== 0 || t.data.size() === 0 || t.scales.filter((r) => r.inferredFrom !== void 0).length === 0) return t;
5828
- const n = lr(this.container, {
5831
+ const n = dr(this.container, {
5829
5832
  data: t.data,
5830
5833
  layers: t.layers,
5831
5834
  mapping: t.mapping,
5832
5835
  customPalettes: this.lastCustomPalettes
5833
5836
  });
5834
- return Te(t, { scales: Tn(t.scales, (r) => {
5837
+ return xe(t, { scales: xn(t.scales, (r) => {
5835
5838
  const s = r.inferredFrom;
5836
5839
  if (s === void 0) return r;
5837
5840
  const a = ct(n, s);
5838
- return t.coords.coordType === "polar" ? ur(a) : a;
5841
+ return t.coords.coordType === "polar" ? mr(a) : a;
5839
5842
  }) });
5840
5843
  }
5841
5844
  runCompile(e) {
@@ -5854,7 +5857,7 @@ var td = class {
5854
5857
  const t = this.container.diagnostics.drain();
5855
5858
  return this.lastDiagnostics = t, {
5856
5859
  ok: !1,
5857
- errors: t.errors.length > 0 ? t.errors : [aa(e)],
5860
+ errors: t.errors.length > 0 ? t.errors : [oa(e)],
5858
5861
  warnings: t.warnings
5859
5862
  };
5860
5863
  }
@@ -5885,7 +5888,7 @@ var td = class {
5885
5888
  }
5886
5889
  runPipeline({ spec: e, colorScheme: t }) {
5887
5890
  return {
5888
- ...st({ spec: e }).pipe(({ spec: n }) => ({ spec: Te(n, { data: this.transformCompiler.compile({
5891
+ ...st({ spec: e }).pipe(({ spec: n }) => ({ spec: xe(n, { data: this.transformCompiler.compile({
5889
5892
  data: n.data,
5890
5893
  transforms: n.transforms
5891
5894
  }) }) })).pipe(({ spec: n }) => {
@@ -5893,7 +5896,7 @@ var td = class {
5893
5896
  data: n.data,
5894
5897
  mapping: n.mapping
5895
5898
  });
5896
- return { spec: Te(n, {
5899
+ return { spec: xe(n, {
5897
5900
  data: r.data,
5898
5901
  mapping: r.mapping
5899
5902
  }) };
@@ -5951,7 +5954,7 @@ var td = class {
5951
5954
  spec: e
5952
5955
  };
5953
5956
  }
5954
- }, Wd = [
5957
+ }, qd = [
5955
5958
  "data",
5956
5959
  "transform",
5957
5960
  "constantMapping",
@@ -5967,113 +5970,113 @@ var td = class {
5967
5970
  "chromeStyles",
5968
5971
  "highlights",
5969
5972
  "annotations"
5970
- ], Xt = "light", qd = ({ plugins: e = [] } = {}) => {
5971
- const t = Mr(e), { geomRegistry: n, statRegistry: r, transformRegistry: s } = Lc(t), a = ed(n), o = new hl(a), i = new dr(s);
5973
+ ], Xt = "light", Hd = ({ plugins: e = [] } = {}) => {
5974
+ const t = Lr(e), { geomRegistry: n, statRegistry: r, transformRegistry: s } = kc(t), a = td(n), o = new yl(a), i = new pr(s);
5972
5975
  for (const c of t.warnings) a.diagnostics.addWarning(c, { persistent: !0 });
5973
- return new td(a, new wr(), new mu(a), i, new Ka(), new qi(a, i, r, new Ui(a, i, new fu(r), new vo(), new yo(a), new kc(new $c()))), new Qc(a, o), new Ha(new ho()), new Jc(a), new Qu(), new ki(a), new Xu(a), new Au(a), new Tu(a), new Oi(a), new Da(a));
5976
+ return new nd(a, new Vr(), new pu(a), i, new Wa(), new Hi(a, i, r, new Gi(a, i, new gu(r), new bo(), new vo(a), new _c(new Bc()))), new Zc(a, o), new Xa(new yo()), new Qc(a), new Zu(), new _i(a), new Ju(a), new Tu(a), new xu(a), new Pi(a), new Ra(a));
5974
5977
  };
5975
5978
  export {
5976
- Ld as $,
5977
- dr as A,
5978
- Td as At,
5979
- Nd as B,
5979
+ kd as $,
5980
+ pr as A,
5981
+ xd as At,
5982
+ Od as B,
5980
5983
  nt as Bt,
5981
- Pd as C,
5982
- da as Ct,
5984
+ $d as C,
5985
+ ma as Ct,
5983
5986
  Fe as D,
5984
5987
  st as Dt,
5985
- Hl as E,
5986
- xd as Et,
5987
- ir as F,
5988
+ Xl as E,
5989
+ wd as Et,
5990
+ lr as F,
5988
5991
  xt as Ft,
5989
- jn as G,
5992
+ Kn as G,
5990
5993
  P as Gt,
5991
- qn as H,
5992
- hd as Ht,
5993
- Od as I,
5994
+ Xn as H,
5995
+ yd as Ht,
5996
+ Pd as I,
5994
5997
  rt as It,
5995
- ii as J,
5996
- pd as Jt,
5998
+ ci as J,
5999
+ fd as Jt,
5997
6000
  Rt as K,
5998
- yd as Kt,
5999
- Rd as L,
6000
- bn as Lt,
6001
- ur as M,
6002
- aa as Mt,
6003
- bl as N,
6004
- sa as Nt,
6001
+ vd as Kt,
6002
+ Nd as L,
6003
+ Sn as Lt,
6004
+ mr as M,
6005
+ oa as Mt,
6006
+ Sl as N,
6007
+ aa as Nt,
6005
6008
  _ as O,
6006
- Tn as Ot,
6009
+ xn as Ot,
6007
6010
  ct as P,
6008
- ra as Pt,
6009
- kd as Q,
6010
- Zc as R,
6011
- An as Rt,
6012
- $d as S,
6013
- Cd as St,
6014
- Gd as T,
6015
- ia as Tt,
6016
- Fi as U,
6017
- bd as Ut,
6018
- Wn as V,
6019
- vd as Vt,
6020
- Ni as W,
6021
- gd as Wt,
6022
- Dd as X,
6023
- _d as Y,
6024
- fd as Yt,
6025
- Yn as Z,
6026
- tu as _,
6011
+ sa as Pt,
6012
+ _d as Q,
6013
+ el as R,
6014
+ Tn as Rt,
6015
+ Bd as S,
6016
+ Vd as St,
6017
+ Yd as T,
6018
+ ca as Tt,
6019
+ Ui as U,
6020
+ Sd as Ut,
6021
+ Hn as V,
6022
+ bd as Vt,
6023
+ Oi as W,
6024
+ hd as Wt,
6025
+ Rd as X,
6026
+ Dd as Y,
6027
+ gd as Yt,
6028
+ zn as Z,
6029
+ nu as _,
6027
6030
  ke as _t,
6028
- Vu as a,
6029
- Ea as at,
6030
- Fd as b,
6031
- ua as bt,
6031
+ Iu as a,
6032
+ Ma as at,
6033
+ Ud as b,
6034
+ da as bt,
6032
6035
  Me as c,
6033
- Id as ct,
6034
- fr as d,
6035
- ha as dt,
6036
- oi as et,
6037
- zd as f,
6038
- ga as ft,
6039
- ru as g,
6040
- ma as gt,
6041
- su as h,
6042
- Vd as ht,
6043
- ed as i,
6044
- Ed as it,
6045
- lr as j,
6046
- Ad as jt,
6047
- Ml as k,
6048
- Te as kt,
6049
- jd as l,
6036
+ Ed as ct,
6037
+ hr as d,
6038
+ ya as dt,
6039
+ ii as et,
6040
+ Kd as f,
6041
+ ha as ft,
6042
+ su as g,
6043
+ pa as gt,
6044
+ au as h,
6045
+ Id as ht,
6046
+ td as i,
6047
+ Md as it,
6048
+ dr as j,
6049
+ Td as jt,
6050
+ Ll as k,
6051
+ xe as kt,
6052
+ zd as l,
6050
6053
  te as lt,
6051
- mu as m,
6052
- Cn as mt,
6053
- td as n,
6054
- Ho as nt,
6055
- Iu as o,
6054
+ pu as m,
6055
+ Vn as mt,
6056
+ nd as n,
6057
+ Xo as nt,
6058
+ Eu as o,
6056
6059
  ee as ot,
6057
- yu as p,
6058
- fa as pt,
6059
- Di as q,
6060
- Sd as qt,
6061
- qd as r,
6062
- Nn as rt,
6063
- Kd as s,
6060
+ vu as p,
6061
+ ga as pt,
6062
+ Ri as q,
6063
+ Ad as qt,
6064
+ Hd as r,
6065
+ Pn as rt,
6066
+ Wd as s,
6064
6067
  at as st,
6065
- Wd as t,
6066
- Md as tt,
6067
- Yd as u,
6068
+ qd as t,
6069
+ Ld as tt,
6070
+ jd as u,
6068
6071
  Pe as ut,
6069
- eu as v,
6072
+ tu as v,
6070
6073
  wt as vt,
6071
- Ud as w,
6072
- ca as wt,
6073
- Zl as x,
6074
- la as xt,
6075
- Bd as y,
6076
- wd as yt,
6077
- el as z,
6078
- vn as zt
6074
+ Gd as w,
6075
+ la as wt,
6076
+ eu as x,
6077
+ ua as xt,
6078
+ Fd as y,
6079
+ Cd as yt,
6080
+ tl as z,
6081
+ bn as zt
6079
6082
  };