@graphysdk/viz-engine 2.0.0-beta.1788534616557 → 2.0.0-beta.1788536263128

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,18 +1,18 @@
1
- import { differenceInDays as Ge, isBefore as Ke, isValid as h, isWithinInterval as Xe, parse as N } from "date-fns";
1
+ import { differenceInDays as He, isBefore as Ke, isValid as h, isWithinInterval as Xe, parse as C } from "date-fns";
2
2
  import { isEqual as qe, isInteger as Qe } from "lodash-es";
3
- var Xr = (e) => e.length > 0;
4
- function ye(e) {
3
+ var Gr = (e) => e.length > 0;
4
+ function pe(e) {
5
5
  return e != null;
6
6
  }
7
- function qr(e) {
7
+ function Hr(e) {
8
8
  if (e === null || typeof e != "object") return !1;
9
9
  const t = Object.getPrototypeOf(e);
10
10
  return t === Object.prototype || t === null;
11
11
  }
12
- var q = (e) => e instanceof Date && h(e), Qr = (e) => q(e) || e === null, Jr = (e) => typeof e == "string", Je = (e) => typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e), Zr = (e) => Je(e) || e === null, me = "\0graphy\0_", m = (e) => `${me}${e}`, pe = { x: m("constantX") }, ea = {
12
+ var Q = (e) => e instanceof Date && h(e), Kr = (e) => Q(e) || e === null, Xr = (e) => typeof e == "string", Je = (e) => typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e), qr = (e) => Je(e) || e === null, he = "\0graphy\0_", m = (e) => `${he}${e}`, be = { x: m("constantX") }, Qr = {
13
13
  bar: m("barSeriesLabel"),
14
14
  line: m("lineSeriesLabel")
15
- }, he = {
15
+ }, ve = {
16
16
  count: m("count"),
17
17
  mean: m("mean"),
18
18
  sum: m("sum")
@@ -33,65 +33,65 @@ var q = (e) => e instanceof Date && h(e), Qr = (e) => q(e) || e === null, Jr = (
33
33
  }, at = {
34
34
  y: m("ruleY"),
35
35
  x: m("ruleX")
36
- }, ta = {
37
- ...pe,
38
- ...he,
36
+ }, Jr = {
37
+ ...be,
38
+ ...ve,
39
39
  ...Ze,
40
40
  ...et,
41
41
  ...tt,
42
42
  ...rt,
43
43
  ...at
44
- }, nt = new Set(Object.values(he)), ra = (e) => m(`scaled_${e}`), aa = (e) => e.startsWith(me), na = (e) => nt.has(e);
45
- function oa(e) {
44
+ }, nt = new Set(Object.values(ve)), Zr = (e) => m(`scaled_${e}`), ea = (e) => e.startsWith(he), ta = (e) => nt.has(e);
45
+ function ra(e) {
46
46
  const { numeric: t, categorical: r, temporal: a } = e.groupVariableNamesByType();
47
47
  return a[0] ?? r[0] ?? t[0] ?? "";
48
48
  }
49
- function sa(e, t) {
49
+ function aa(e, t) {
50
50
  const { categorical: r, temporal: a } = e.groupVariableNamesByType(), n = [...r, ...a];
51
51
  return t === "" || n.includes(t) ? n : [t, ...n];
52
52
  }
53
- function ia(e) {
54
- const t = be(e.x);
55
- return t === null || t === pe.x ? "" : t;
53
+ function na(e) {
54
+ const t = Ae(e.x);
55
+ return t === null || t === be.x ? "" : t;
56
56
  }
57
- function be(e) {
58
- return ye(e) ? typeof e == "string" ? e : "variable" in e ? e.variable : null : null;
57
+ function Ae(e) {
58
+ return pe(e) ? typeof e == "string" ? e : "variable" in e ? e.variable : null : null;
59
59
  }
60
- function ot(e) {
61
- if (!(!ye(e) || typeof e == "string") && "value" in e)
60
+ function st(e) {
61
+ if (!(!pe(e) || typeof e == "string") && "value" in e)
62
62
  return e.value;
63
63
  }
64
- function la(e, t) {
65
- return [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].every((r) => re(e[r]) === re(t[r]));
64
+ function sa(e, t) {
65
+ return [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].every((r) => ae(e[r]) === ae(t[r]));
66
66
  }
67
- function re(e) {
68
- const t = be(e);
67
+ function ae(e) {
68
+ const t = Ae(e);
69
69
  if (t !== null) return `variable:${t}`;
70
- const r = ot(e);
70
+ const r = st(e);
71
71
  return r === void 0 ? "" : r === null ? "value:null" : r instanceof Date ? `value:date:${r.getTime()}` : `value:${typeof r}:${r}`;
72
72
  }
73
- var ve = "en-GB", Ae = class extends Error {
73
+ var Ee = "en-GB", Me = class extends Error {
74
74
  constructor(e) {
75
75
  super(e.message, e.cause !== void 0 ? { cause: e.cause } : void 0), this.name = new.target.name, this.code = e.code, this.context = e.context, this.suggestion = e.suggestion;
76
76
  }
77
- }, W = class extends Ae {
77
+ }, U = class extends Me {
78
78
  constructor(e) {
79
79
  super(e), this.kind = "user-input";
80
80
  }
81
- }, A = class extends Ae {
81
+ }, A = class extends Me {
82
82
  constructor(e) {
83
83
  super({
84
84
  ...e,
85
85
  code: e.code ?? "INTERNAL_INVARIANT"
86
86
  }), this.kind = "internal";
87
87
  }
88
- }, Ee = (e) => e.type === "lookup", st = (e) => e.type === "text", U = (e) => e.type === "date" || e.type === "datetime" || e.type === "year" || e.type === "month_year" || e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range" || e.type === "weekly_date_range_with_year" || e.type === "quarter" || e.type === "time", it = (e) => e.type === "decimal" || e.type === "integer" || e.type === "percentage" || e.type === "duration" || e.type === "currency", ca = (e) => e.type === "currency", da = (e) => e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range", Me = (e) => {
89
- if (Ee(e)) return Me(e.fallback);
90
- if (U(e)) return "temporal";
88
+ }, Te = (e) => e.type === "lookup", ot = (e) => e.type === "text", W = (e) => e.type === "date" || e.type === "datetime" || e.type === "year" || e.type === "month_year" || e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range" || e.type === "weekly_date_range_with_year" || e.type === "quarter" || e.type === "time", it = (e) => e.type === "decimal" || e.type === "integer" || e.type === "percentage" || e.type === "duration" || e.type === "currency", oa = (e) => e.type === "currency", ia = (e) => e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range", we = (e) => {
89
+ if (Te(e)) return we(e.fallback);
90
+ if (W(e)) return "temporal";
91
91
  if (it(e)) return "numeric";
92
- if (st(e)) return "categorical";
92
+ if (ot(e)) return "categorical";
93
93
  throw new A({ message: `No data type found for value format: ${e.type}` });
94
- }, ua = (e) => Ee(e) ? e.fallback : e, lt = class {
94
+ }, la = (e) => Te(e) ? e.fallback : e, lt = class {
95
95
  constructor() {
96
96
  this.currentYear = (/* @__PURE__ */ new Date()).getUTCFullYear(), this.previousDate = null, this.previousYear = null;
97
97
  }
@@ -105,12 +105,12 @@ var ve = "en-GB", Ae = class extends Error {
105
105
  m: 1e6,
106
106
  b: 1e9,
107
107
  t: 1e12
108
- }, te = [
108
+ }, re = [
109
109
  "k",
110
110
  "m",
111
111
  "b",
112
112
  "t"
113
- ], dt = new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${te.join("|")})?$`, "i"), ut = /^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/, D = (e) => e === null || e instanceof Date || Array.isArray(e) || typeof e == "boolean" ? !1 : typeof e == "string" ? dt.test(e) && !Number.isNaN(Number(e.replace(new RegExp(`[,${te.join("")}]`, "gi"), ""))) : !Number.isNaN(Number(e)), Te = (e) => D(e) ? !0 : typeof e == "string" ? ut.test(e) : !1, ft = /^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/, gt = /^\s*(19\d{2}|2[01]\d{2})\s*$/, yt = [
113
+ ], dt = new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${re.join("|")})?$`, "i"), ut = /^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/, k = (e) => e === null || e instanceof Date || Array.isArray(e) || typeof e == "boolean" ? !1 : typeof e == "string" ? dt.test(e) && !Number.isNaN(Number(e.replace(new RegExp(`[,${re.join("")}]`, "gi"), ""))) : !Number.isNaN(Number(e)), Fe = (e) => k(e) ? !0 : typeof e == "string" ? ut.test(e) : !1, ft = /^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/, yt = /^\s*(19\d{2}|2[01]\d{2})\s*$/, gt = [
114
114
  [/\bJan\b/i, "January"],
115
115
  [/\bFeb\b/i, "February"],
116
116
  [/\bMar\b/i, "March"],
@@ -127,12 +127,12 @@ var ve = "en-GB", Ae = class extends Error {
127
127
  "en-GB": "DMY",
128
128
  "pt-PT": "DMY",
129
129
  ar: "DMY"
130
- }, Fe = [
130
+ }, _e = [
131
131
  "/",
132
132
  "-",
133
133
  ".",
134
134
  " "
135
- ], ae = [
135
+ ], ne = [
136
136
  [
137
137
  "d",
138
138
  "M",
@@ -203,7 +203,7 @@ var ve = "en-GB", Ae = class extends Error {
203
203
  "MMMM",
204
204
  "yyyy"
205
205
  ]
206
- ], ne = [
206
+ ], se = [
207
207
  [
208
208
  "M",
209
209
  "d",
@@ -310,7 +310,7 @@ var ve = "en-GB", Ae = class extends Error {
310
310
  "MMMM",
311
311
  "do"
312
312
  ]
313
- ], we = [
313
+ ], De = [
314
314
  ["d", "MMMM"],
315
315
  ["dd", "MMMM"],
316
316
  ["do", "MMMM"],
@@ -334,72 +334,72 @@ var ve = "en-GB", Ae = class extends Error {
334
334
  dateFormat: "yyyy-MM",
335
335
  type: "month_year"
336
336
  }
337
- ], _e = 1900, Le = 2199, ht = 3, bt = 6, vt = 5, At = 1, Et = 28, Mt = /\s*[–—]\s*|\s-\s/, Tt = (e) => typeof e == "number" ? Number.isNaN(e) ? !1 : e >= _e && e <= Le : typeof e == "string" ? gt.test(e) : !1, ke = (e, t) => {
338
- const r = x(e);
339
- return !t && D(r) ? _t(r) : typeof r == "string" ? t ? h(N(r, t, /* @__PURE__ */ new Date())) : !!De(r) || z(r) && h(new Date(r)) : h(r);
340
- }, x = (e) => {
337
+ ], Le = 1900, Oe = 2199, ht = 3, bt = 6, vt = 5, At = 1, Et = 28, Mt = /\s*[–—]\s*|\s-\s/, Tt = (e) => typeof e == "number" ? Number.isNaN(e) ? !1 : e >= Le && e <= Oe : typeof e == "string" ? yt.test(e) : !1, ke = (e, t) => {
338
+ const r = B(e);
339
+ return !t && k(r) ? _t(r) : typeof r == "string" ? t ? h(C(r, t, /* @__PURE__ */ new Date())) : !!Se(r) || Y(r) && h(new Date(r)) : h(r);
340
+ }, B = (e) => {
341
341
  if (typeof e != "string") return e;
342
342
  let t = e;
343
- for (const [r, a] of yt) t = t.replace(r, a);
343
+ for (const [r, a] of gt) t = t.replace(r, a);
344
344
  return t;
345
- }, De = (e, t = ve) => {
346
- const r = x(e);
347
- return z(r) ? { type: "datetime" } : Se(t).find((a) => !U(a) || a.type === "month" && r.length < ht ? !1 : a.dateFormat && h(N(r, a.dateFormat, /* @__PURE__ */ new Date())));
348
- }, z = (e) => ft.test(e.trim()), fa = (e) => {
345
+ }, Se = (e, t = Ee) => {
346
+ const r = B(e);
347
+ return Y(r) ? { type: "datetime" } : Ne(t).find((a) => !W(a) || a.type === "month" && r.length < ht ? !1 : a.dateFormat && h(C(r, a.dateFormat, /* @__PURE__ */ new Date())));
348
+ }, Y = (e) => ft.test(e.trim()), ca = (e) => {
349
349
  if (e instanceof Date) return h(e) ? e : null;
350
- if (typeof e != "string" || !z(e)) return null;
350
+ if (typeof e != "string" || !Y(e)) return null;
351
351
  const t = new Date(e.trim());
352
352
  return h(t) ? t : null;
353
- }, Ft = (e, t = ve) => {
353
+ }, wt = (e, t = Ee) => {
354
354
  const [r, a] = e.split(Mt);
355
355
  if (!r || !a) return;
356
- const n = x(r).trim(), o = x(a).trim();
357
- return wt(t).find((s) => {
358
- if (!U(s) || !s.dateFormat) return !1;
359
- const i = N(n, s.dateFormat, /* @__PURE__ */ new Date()), c = N(o, s.dateFormat, /* @__PURE__ */ new Date());
356
+ const n = B(r).trim(), s = B(a).trim();
357
+ return Ft(t).find((o) => {
358
+ if (!W(o) || !o.dateFormat) return !1;
359
+ const i = C(n, o.dateFormat, /* @__PURE__ */ new Date()), c = C(s, o.dateFormat, /* @__PURE__ */ new Date());
360
360
  if (!h(i) || !h(c)) return !1;
361
- const f = new lt(), y = f.incrementYearIfNeeded(i), p = f.incrementYearIfNeeded(c), g = Ge(p, y);
362
- return Xe(new Date(y.getFullYear(), At, Et), {
363
- start: y,
361
+ const f = new lt(), g = f.incrementYearIfNeeded(i), p = f.incrementYearIfNeeded(c), y = He(p, g);
362
+ return Xe(new Date(g.getFullYear(), At, Et), {
363
+ start: g,
364
364
  end: p
365
- }) && g === vt ? !0 : g === bt;
365
+ }) && y === vt ? !0 : y === bt;
366
366
  });
367
- }, Se = (e) => {
367
+ }, Ne = (e) => {
368
368
  const t = {
369
- date: Ce(e),
369
+ date: Re(e),
370
370
  year: [["yyyy"]],
371
- day_month: we,
371
+ day_month: De,
372
372
  month_year: [["MMMM", "yyyy"], ["yyyy", "MMMM"]],
373
373
  month: [["MMMM"]],
374
374
  quarter: [["QQQ", "yyyy"], ["yyyy", "QQQ"]]
375
375
  };
376
- return [...pt, ...Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => Fe.map((o) => ({
377
- dateFormat: n.join(o),
376
+ return [...pt, ...Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => _e.map((s) => ({
377
+ dateFormat: n.join(s),
378
378
  type: r
379
379
  }))))];
380
- }, Ce = (e) => mt[e] === "MDY" ? [
380
+ }, Re = (e) => mt[e] === "MDY" ? [
381
+ ...se,
381
382
  ...ne,
382
- ...ae,
383
383
  ...oe
384
384
  ] : [
385
- ...ae,
386
385
  ...ne,
386
+ ...se,
387
387
  ...oe
388
- ], wt = (e) => {
388
+ ], Ft = (e) => {
389
389
  const t = {
390
- weekly_date_range: we,
391
- weekly_date_range_with_year: Ce(e)
390
+ weekly_date_range: De,
391
+ weekly_date_range_with_year: Re(e)
392
392
  };
393
- return Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => Fe.map((o) => ({
394
- dateFormat: n.join(o),
393
+ return Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => _e.map((s) => ({
394
+ dateFormat: n.join(s),
395
395
  type: r
396
396
  }))));
397
397
  }, _t = (e) => {
398
398
  const t = Number(e);
399
399
  if (!Qe(t)) return !1;
400
- const r = new Date(t), a = /* @__PURE__ */ new Date(t * 1e3), n = (o) => h(o) && o.getFullYear() >= _e && o.getFullYear() <= Le;
400
+ const r = new Date(t), a = /* @__PURE__ */ new Date(t * 1e3), n = (s) => h(s) && s.getFullYear() >= Le && s.getFullYear() <= Oe;
401
401
  return n(r) || n(a);
402
- }, Oe = {
402
+ }, Ce = {
403
403
  $: "usd",
404
404
  "£": "gbp",
405
405
  "€": "eur",
@@ -431,38 +431,38 @@ var ve = "en-GB", Ae = class extends Error {
431
431
  C$: "cad",
432
432
  NZ$: "nzd",
433
433
  MX$: "mxn"
434
- }, Ne = (e) => {
434
+ }, Ie = (e) => {
435
435
  if (typeof e == "string") {
436
- const t = Ie(e);
437
- return t.length ? D(t) : !1;
436
+ const t = xe(e);
437
+ return t.length ? k(t) : !1;
438
438
  }
439
- return D(e);
440
- }, Lt = (e) => {
441
- const t = Re(e), r = t ? Oe[t] : void 0;
439
+ return k(e);
440
+ }, Dt = (e) => {
441
+ const t = Be(e), r = t ? Ce[t] : void 0;
442
442
  if (!r) throw new A({ message: "Could not get currency ISO" });
443
443
  return r;
444
- }, Ie = (e) => {
445
- const t = Re(e);
444
+ }, xe = (e) => {
445
+ const t = Be(e);
446
446
  let r = e;
447
447
  if (t) {
448
448
  const a = e.indexOf(t);
449
449
  a === 0 ? r = e.slice(t.length) : a === e.length - t.length ? r = e.slice(0, e.length - t.length) : e[0] === "-" && a === 1 && (r = `-${e.slice(t.length + 1)}`);
450
450
  }
451
- return D(r) ? r.split(",").join("") : "";
452
- }, Re = (e) => Object.keys(Oe).sort((t, r) => r.length - t.length).find((t) => e.includes(t)), xe = (e) => {
451
+ return k(r) ? r.split(",").join("") : "";
452
+ }, Be = (e) => Object.keys(Ce).sort((t, r) => r.length - t.length).find((t) => e.includes(t)), Ve = (e) => {
453
453
  const t = Object.entries(e);
454
- return !t.length || !t.some(([, r]) => !B(r));
455
- }, B = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-", kt = /\s*[–—]\s*|\s-\s/, Dt = (e, t, r) => {
456
- if (B(e)) return null;
454
+ return !t.length || !t.some(([, r]) => !V(r));
455
+ }, V = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-", Lt = /\s*[–—]\s*|\s-\s/, Ot = (e, t, r) => {
456
+ if (V(e)) return null;
457
457
  switch (t.type) {
458
458
  case "decimal":
459
459
  case "integer":
460
460
  case "duration":
461
- return Ve(e);
461
+ return Pe(e);
462
462
  case "percentage":
463
- return St(e);
463
+ return kt(e);
464
464
  case "currency":
465
- return Ct(e);
465
+ return St(e);
466
466
  case "datetime":
467
467
  case "date":
468
468
  case "year":
@@ -471,122 +471,122 @@ var ve = "en-GB", Ae = class extends Error {
471
471
  case "day_month":
472
472
  case "quarter":
473
473
  case "time":
474
- return Be(e, t.dateFormat, r);
474
+ return je(e, t.dateFormat, r);
475
475
  case "weekly_date_range":
476
476
  case "weekly_date_range_with_year":
477
- return Ot(e, t.dateFormat, r);
477
+ return Nt(e, t.dateFormat, r);
478
478
  case "text":
479
- return Nt(e);
479
+ return Rt(e);
480
480
  case "lookup":
481
481
  throw new A({ message: "Cannot parse: lookup value formats are produced by transforms, not raw input" });
482
482
  default:
483
483
  throw new A({ message: `Unhandled value format: ${t.type}` });
484
484
  }
485
- }, Be = (e, t, r) => {
485
+ }, je = (e, t, r) => {
486
486
  if (e instanceof Date) return h(e) ? e : null;
487
- const a = x(String(e).trim());
487
+ const a = B(String(e).trim());
488
488
  if (a.length === 0) return null;
489
489
  const n = /* @__PURE__ */ new Date();
490
490
  if (t) {
491
- const s = N(a, t, n);
492
- return h(s) ? $(s) : null;
491
+ const o = C(a, t, n);
492
+ return h(o) ? G(o) : null;
493
493
  }
494
- for (const s of Se(r)) {
495
- if (!U(s) || !s.dateFormat) continue;
496
- const i = N(a, s.dateFormat, n);
497
- if (h(i)) return $(i);
494
+ for (const o of Ne(r)) {
495
+ if (!W(o) || !o.dateFormat) continue;
496
+ const i = C(a, o.dateFormat, n);
497
+ if (h(i)) return G(i);
498
498
  }
499
- const o = new Date(a);
500
- return ke(o) ? z(a) ? o : $(o) : null;
501
- }, Ve = (e) => {
499
+ const s = new Date(a);
500
+ return ke(s) ? Y(a) ? s : G(s) : null;
501
+ }, Pe = (e) => {
502
502
  if (typeof e == "number") return Number.isNaN(e) ? null : e;
503
503
  if (typeof e != "string") return null;
504
504
  let t = e.trim();
505
- if (!D(t)) return null;
505
+ if (!k(t)) return null;
506
506
  let r = 1;
507
- for (const a of te) if (new RegExp(`${a}$`, "i").test(t)) {
507
+ for (const a of re) if (new RegExp(`${a}$`, "i").test(t)) {
508
508
  r = ct[a], t = t.slice(0, -1);
509
509
  break;
510
510
  }
511
511
  return Number(t.split(",").join("")) * r;
512
- }, St = (e) => {
512
+ }, kt = (e) => {
513
513
  if (typeof e == "number") return Number.isNaN(e) ? null : e;
514
514
  if (typeof e != "string") return null;
515
515
  const t = e.trim();
516
- if (!Te(t)) return null;
516
+ if (!Fe(t)) return null;
517
517
  const r = Number(t.replace(/%/g, "").replace(/,/g, "")) / 100;
518
518
  return Number.isNaN(r) ? null : r;
519
- }, Ct = (e) => {
519
+ }, St = (e) => {
520
520
  if (typeof e == "number") return Number.isNaN(e) ? null : e;
521
521
  if (typeof e != "string") return null;
522
522
  const t = e.trim();
523
- return Ne(t) ? Ve(Ie(t)) : null;
524
- }, Ot = (e, t, r) => {
525
- const a = String(e).trim().split(kt), [n, o] = [a[0]?.trim(), a[1]?.trim()];
526
- return !n || !o ? null : Be(n, t, r);
527
- }, Nt = (e) => String(e).trim(), $ = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), O = process.env.NODE_ENV !== "production";
528
- var Y = !0, ga = (e) => {
529
- Y = e;
530
- }, ya = () => Y, ma = () => {
523
+ return Ie(t) ? Pe(xe(t)) : null;
524
+ }, Nt = (e, t, r) => {
525
+ const a = String(e).trim().split(Lt), [n, s] = [a[0]?.trim(), a[1]?.trim()];
526
+ return !n || !s ? null : je(n, t, r);
527
+ }, Rt = (e) => String(e).trim(), G = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), R = process.env.NODE_ENV !== "production";
528
+ var $ = !0, da = (e) => {
529
+ $ = e;
530
+ }, ua = () => $, fa = () => {
531
531
  let e = null;
532
532
  const t = {
533
533
  hits: 0,
534
534
  misses: 0
535
535
  };
536
536
  return Object.assign((a, n) => {
537
- if (!Y)
538
- return O && (t.misses += 1), n();
539
- if (e && Pe(e.args, a))
540
- return O && (t.hits += 1), e.out;
541
- O && (t.misses += 1);
542
- const o = n();
537
+ if (!$)
538
+ return R && (t.misses += 1), n();
539
+ if (e && ze(e.args, a))
540
+ return R && (t.hits += 1), e.out;
541
+ R && (t.misses += 1);
542
+ const s = n();
543
543
  return e = {
544
544
  args: a,
545
- out: o
546
- }, o;
545
+ out: s
546
+ }, s;
547
547
  }, {
548
548
  stats: t,
549
549
  reset: () => {
550
550
  e = null;
551
551
  }
552
552
  });
553
- }, It = () => {
553
+ }, Ct = () => {
554
554
  const e = /* @__PURE__ */ new WeakMap(), t = {
555
555
  hits: 0,
556
556
  misses: 0
557
557
  };
558
- return Object.assign((a, n, o) => {
559
- if (!Y)
560
- return O && (t.misses += 1), o();
561
- const s = e.get(a);
562
- if (s) for (let c = 0; c < s.length; c += 1) {
563
- const f = s[c];
564
- if (f && Pe(f.args, n))
565
- return O && (t.hits += 1), c > 0 && (s.splice(c, 1), s.unshift(f)), f.out;
558
+ return Object.assign((a, n, s) => {
559
+ if (!$)
560
+ return R && (t.misses += 1), s();
561
+ const o = e.get(a);
562
+ if (o) for (let c = 0; c < o.length; c += 1) {
563
+ const f = o[c];
564
+ if (f && ze(f.args, n))
565
+ return R && (t.hits += 1), c > 0 && (o.splice(c, 1), o.unshift(f)), f.out;
566
566
  }
567
- O && (t.misses += 1);
568
- const i = o();
569
- return s ? (s.unshift({
567
+ R && (t.misses += 1);
568
+ const i = s();
569
+ return o ? (o.unshift({
570
570
  args: n,
571
571
  out: i
572
- }), s.length > 16 && (s.length = 16)) : e.set(a, [{
572
+ }), o.length > 16 && (o.length = 16)) : e.set(a, [{
573
573
  args: n,
574
574
  out: i
575
575
  }]), i;
576
576
  }, { stats: t });
577
- }, pa = (...e) => e.reduce((t, r) => ({
577
+ }, ya = (...e) => e.reduce((t, r) => ({
578
578
  hits: t.hits + r.hits,
579
579
  misses: t.misses + r.misses
580
580
  }), {
581
581
  hits: 0,
582
582
  misses: 0
583
- }), Pe = (e, t) => {
583
+ }), ze = (e, t) => {
584
584
  if (e.length !== t.length) return !1;
585
585
  for (let r = 0; r < e.length; r += 1) if (e[r] !== t[r]) return !1;
586
586
  return !0;
587
- }, Rt = class {
587
+ }, It = class {
588
588
  constructor() {
589
- this.memo = It(), this.singletonKey = {};
589
+ this.memo = Ct(), this.singletonKey = {};
590
590
  }
591
591
  get stats() {
592
592
  return this.memo.stats;
@@ -597,63 +597,63 @@ var Y = !0, ga = (e) => {
597
597
  key(e) {
598
598
  return this.singletonKey;
599
599
  }
600
- }, Q = (e) => (Array.isArray(e) ? e : [e]).map((t) => t instanceof Date ? t.toISOString() : String(t ?? "<null>")).join("\0"), ha = (e, t) => e === t ? !0 : q(e) && q(t) ? e.getTime() === t.getTime() : !1, xt = /* @__PURE__ */ new Set([
600
+ }, J = (e) => (Array.isArray(e) ? e : [e]).map((t) => t instanceof Date ? t.toISOString() : String(t ?? "<null>")).join("\0"), ga = (e, t) => e === t ? !0 : Q(e) && Q(t) ? e.getTime() === t.getTime() : !1, xt = /* @__PURE__ */ new Set([
601
601
  "count",
602
602
  "sum",
603
603
  "mean",
604
604
  "median"
605
605
  ]);
606
- function je(e, t) {
606
+ function Ue(e, t) {
607
607
  return xt.has(e) ? "numeric" : t;
608
608
  }
609
609
  function We(e, t, r) {
610
610
  const a = r?.length ?? t.length;
611
611
  if (e === "count") return a;
612
612
  if (e === "median" || e === "mode") {
613
- const s = [];
613
+ const o = [];
614
614
  for (let i = 0; i < a; i++) {
615
615
  const c = H(t, r, i);
616
- G(c) && s.push(c);
616
+ K(c) && o.push(c);
617
617
  }
618
- return s.length === 0 ? null : e === "median" ? Pt(s) : jt(s);
618
+ return o.length === 0 ? null : e === "median" ? jt(o) : Pt(o);
619
619
  }
620
620
  if (e === "sum" || e === "mean") {
621
- let s = 0, i = 0;
621
+ let o = 0, i = 0;
622
622
  for (let c = 0; c < a; c++) {
623
623
  const f = H(t, r, c);
624
- G(f) && (s++, i += Number(f));
624
+ K(f) && (o++, i += Number(f));
625
625
  }
626
- return s === 0 ? null : e === "sum" ? i : i / s;
626
+ return o === 0 ? null : e === "sum" ? i : i / o;
627
627
  }
628
628
  const n = e === "min" ? -1 : 1;
629
- let o = null;
630
- for (let s = 0; s < a; s++) {
631
- const i = H(t, r, s);
632
- G(i) && (o === null || Bt(i, o) === n) && (o = i);
629
+ let s = null;
630
+ for (let o = 0; o < a; o++) {
631
+ const i = H(t, r, o);
632
+ K(i) && (s === null || Bt(i, s) === n) && (s = i);
633
633
  }
634
- return o;
634
+ return s;
635
635
  }
636
- var H = (e, t, r) => e[t?.[r] ?? r] ?? null, G = (e) => e !== null && !(typeof e == "number" && Number.isNaN(e)), Bt = (e, t) => e === null || t === null ? 0 : e < t ? -1 : e > t ? 1 : 0, Vt = (e) => e instanceof Date ? e.getTime() : e ?? null;
637
- function Pt(e) {
638
- const t = e.map(Number).sort((o, s) => o - s);
636
+ var H = (e, t, r) => e[t?.[r] ?? r] ?? null, K = (e) => e !== null && !(typeof e == "number" && Number.isNaN(e)), Bt = (e, t) => e === null || t === null ? 0 : e < t ? -1 : e > t ? 1 : 0, Vt = (e) => e instanceof Date ? e.getTime() : e ?? null;
637
+ function jt(e) {
638
+ const t = e.map(Number).sort((s, o) => s - o);
639
639
  if (t.length === 1) return t[0] ?? 0;
640
640
  const r = (t.length - 1) / 2, a = Math.floor(r), n = t[a] ?? 0;
641
641
  return n + ((t[a + 1] ?? n) - n) * (r - a);
642
642
  }
643
- function jt(e) {
643
+ function Pt(e) {
644
644
  const t = /* @__PURE__ */ new Map();
645
645
  for (const n of e) {
646
- const o = Vt(n), s = t.get(o);
647
- s === void 0 ? t.set(o, {
646
+ const s = Vt(n), o = t.get(s);
647
+ o === void 0 ? t.set(s, {
648
648
  value: n,
649
649
  count: 1
650
- }) : s.count++;
650
+ }) : o.count++;
651
651
  }
652
652
  let r = null, a = 0;
653
- for (const { value: n, count: o } of t.values()) o > a && (a = o, r = n);
653
+ for (const { value: n, count: s } of t.values()) s > a && (a = s, r = n);
654
654
  return r;
655
655
  }
656
- var Wt = (e) => e == null || typeof e == "number" && Number.isNaN(e), Ut = (e) => e instanceof Date ? e.getTime() : e ?? null, J = class L {
656
+ var zt = (e) => e == null || typeof e == "number" && Number.isNaN(e), Ut = (e) => e instanceof Date ? e.getTime() : e ?? null, Z = class L {
657
657
  constructor(t, r, a, n = null) {
658
658
  this.rowShape = null, this.names = t, this.columns = r, this.rowCount = a, this.source = n;
659
659
  }
@@ -676,31 +676,31 @@ var Wt = (e) => e == null || typeof e == "number" && Number.isNaN(e), Ut = (e) =
676
676
  if (this.source === null || !this.names.includes(t)) return;
677
677
  const a = this.source.table.values(t);
678
678
  if (a === void 0) return;
679
- const { indices: n } = this.source, o = new Array(n.length);
680
- for (let s = 0; s < n.length; s++) o[s] = a[n[s] ?? 0] ?? null;
681
- return this.columns.set(t, o), this.columns.size === this.names.length && (this.source = null), o;
679
+ const { indices: n } = this.source, s = new Array(n.length);
680
+ for (let o = 0; o < n.length; o++) s[o] = a[n[o] ?? 0] ?? null;
681
+ return this.columns.set(t, s), this.columns.size === this.names.length && (this.source = null), s;
682
682
  }
683
683
  assign(t, r) {
684
684
  const a = this.gathered(), n = new Map(a.columns);
685
685
  n.set(t, r);
686
- const o = a.names.includes(t) ? [...a.names] : [...a.names, t];
687
- return new L(o, n, a.names.length === 0 ? r.length : a.rowCount);
686
+ const s = a.names.includes(t) ? [...a.names] : [...a.names, t];
687
+ return new L(s, n, a.names.length === 0 ? r.length : a.rowCount);
688
688
  }
689
689
  select(t) {
690
690
  const r = t.filter((n) => this.names.includes(n)), a = /* @__PURE__ */ new Map();
691
691
  for (const n of r) {
692
- const o = this.columns.get(n);
693
- o !== void 0 && a.set(n, o);
692
+ const s = this.columns.get(n);
693
+ s !== void 0 && a.set(n, s);
694
694
  }
695
695
  return new L(r, a, this.rowCount, this.source);
696
696
  }
697
697
  rename(t, r) {
698
698
  const a = this.gathered(), n = /* @__PURE__ */ new Map();
699
- for (const o of a.names) {
700
- const s = a.columns.get(o);
701
- s !== void 0 && n.set(o === t ? r : o, s);
699
+ for (const s of a.names) {
700
+ const o = a.columns.get(s);
701
+ o !== void 0 && n.set(s === t ? r : s, o);
702
702
  }
703
- return new L(a.names.map((o) => o === t ? r : o), n, a.rowCount);
703
+ return new L(a.names.map((s) => s === t ? r : s), n, a.rowCount);
704
704
  }
705
705
  take(t) {
706
706
  const r = this.source === null ? {
@@ -715,58 +715,58 @@ var Wt = (e) => e == null || typeof e == "number" && Number.isNaN(e), Ut = (e) =
715
715
  sortedIndices(t, r) {
716
716
  const a = this.values(t);
717
717
  if (a === void 0) return Array.from({ length: this.rowCount }, (i, c) => c);
718
- const n = [], o = [];
719
- for (let i = 0; i < this.rowCount; i++) (Wt(a[i]) ? n : o).push(i);
720
- const s = r === "asc" ? 1 : -1;
721
- return o.sort((i, c) => {
722
- const f = a[i], y = a[c];
723
- return f < y ? -s : f > y ? s : 0;
724
- }), n.length === 0 ? o : r === "asc" ? [...n, ...o] : [...o, ...n];
718
+ const n = [], s = [];
719
+ for (let i = 0; i < this.rowCount; i++) (zt(a[i]) ? n : s).push(i);
720
+ const o = r === "asc" ? 1 : -1;
721
+ return s.sort((i, c) => {
722
+ const f = a[i], g = a[c];
723
+ return f < g ? -o : f > g ? o : 0;
724
+ }), n.length === 0 ? s : r === "asc" ? [...n, ...s] : [...s, ...n];
725
725
  }
726
726
  partition(t) {
727
- const r = t.map((o) => this.values(o)).filter((o) => o !== void 0), a = r.length === 1 ? r[0] : void 0, n = /* @__PURE__ */ new Map();
727
+ const r = t.map((s) => this.values(s)).filter((s) => s !== void 0), a = r.length === 1 ? r[0] : void 0, n = /* @__PURE__ */ new Map();
728
728
  if (a !== void 0) {
729
- for (let o = 0; o < this.rowCount; o++) {
730
- const s = Ut(a[o]), i = n.get(s);
731
- i === void 0 ? n.set(s, {
732
- key: Q(a[o] ?? null),
733
- indices: [o]
734
- }) : i.indices.push(o);
729
+ for (let s = 0; s < this.rowCount; s++) {
730
+ const o = Ut(a[s]), i = n.get(o);
731
+ i === void 0 ? n.set(o, {
732
+ key: J(a[s] ?? null),
733
+ indices: [s]
734
+ }) : i.indices.push(s);
735
735
  }
736
736
  return [...n.values()];
737
737
  }
738
- for (let o = 0; o < this.rowCount; o++) {
739
- const s = Q(r.map((c) => c[o])), i = n.get(s);
740
- i === void 0 ? n.set(s, {
741
- key: s,
742
- indices: [o]
743
- }) : i.indices.push(o);
738
+ for (let s = 0; s < this.rowCount; s++) {
739
+ const o = J(r.map((c) => c[s])), i = n.get(o);
740
+ i === void 0 ? n.set(o, {
741
+ key: o,
742
+ indices: [s]
743
+ }) : i.indices.push(s);
744
744
  }
745
745
  return [...n.values()];
746
746
  }
747
747
  fold(t, r, a) {
748
- const n = this.names.filter((g) => !t.includes(g)), o = this.rowCount * t.length, s = n.map((g) => ({
749
- name: g,
750
- source: this.values(g) ?? [],
751
- repeated: new Array(o)
752
- })), i = t.map((g) => this.values(g) ?? []), c = new Array(o), f = new Array(o);
753
- let y = 0;
754
- for (let g = 0; g < this.rowCount; g++) for (let M = 0; M < t.length; M++, y++) {
755
- for (const S of s) S.repeated[y] = S.source[g] ?? null;
756
- c[y] = t[M] ?? "", f[y] = i[M]?.[g] ?? null;
748
+ const n = this.names.filter((y) => !t.includes(y)), s = this.rowCount * t.length, o = n.map((y) => ({
749
+ name: y,
750
+ source: this.values(y) ?? [],
751
+ repeated: new Array(s)
752
+ })), i = t.map((y) => this.values(y) ?? []), c = new Array(s), f = new Array(s);
753
+ let g = 0;
754
+ for (let y = 0; y < this.rowCount; y++) for (let M = 0; M < t.length; M++, g++) {
755
+ for (const S of o) S.repeated[g] = S.source[y] ?? null;
756
+ c[g] = t[M] ?? "", f[g] = i[M]?.[y] ?? null;
757
757
  }
758
758
  const p = /* @__PURE__ */ new Map();
759
- for (const { name: g, repeated: M } of s) p.set(g, M);
759
+ for (const { name: y, repeated: M } of o) p.set(y, M);
760
760
  return p.set(r, c), p.set(a, f), new L([
761
761
  ...n,
762
762
  r,
763
763
  a
764
- ], p, o);
764
+ ], p, s);
765
765
  }
766
766
  objectAt(t) {
767
- const { names: r, arrays: a, template: n } = this.rowShape ?? this.resolveRowShape(), o = { ...n };
768
- for (let s = 0; s < r.length; s++) o[r[s] ?? ""] = a[s]?.[t] ?? null;
769
- return o;
767
+ const { names: r, arrays: a, template: n } = this.rowShape ?? this.resolveRowShape(), s = { ...n };
768
+ for (let o = 0; o < r.length; o++) s[r[o] ?? ""] = a[o]?.[t] ?? null;
769
+ return s;
770
770
  }
771
771
  *[Symbol.iterator]() {
772
772
  for (let t = 0; t < this.rowCount; t++) yield this.objectAt(t);
@@ -786,23 +786,23 @@ var Wt = (e) => e == null || typeof e == "number" && Number.isNaN(e), Ut = (e) =
786
786
  return new L(this.names, new Map(this.columns), this.rowCount);
787
787
  }
788
788
  };
789
- var zt = "value", R = {
789
+ var Wt = "value", x = {
790
790
  numeric: { type: "decimal" },
791
791
  categorical: { type: "text" },
792
792
  temporal: { type: "datetime" }
793
- }, se = {
793
+ }, ie = {
794
794
  eq: (e, t) => e === t,
795
795
  neq: (e, t) => e !== t,
796
796
  gt: (e, t) => e !== null && t !== null && e > t,
797
797
  gte: (e, t) => e !== null && t !== null && e >= t,
798
798
  lt: (e, t) => e !== null && t !== null && e < t,
799
799
  lte: (e, t) => e !== null && t !== null && e <= t
800
- }, ie = (e) => e === null ? null : e instanceof Date ? e.getTime() : new Date(e).getTime(), Ue = (e, t) => e === "count" ? { type: "integer" } : t, ze = (e, t, r) => {
800
+ }, le = (e) => e === null ? null : e instanceof Date ? e.getTime() : new Date(e).getTime(), Ye = (e, t) => e === "count" ? { type: "integer" } : t, $e = (e, t, r) => {
801
801
  const a = e.values(t);
802
802
  if (a !== void 0) return a;
803
803
  if (r === "count") return new Array(e.rowCount);
804
804
  throw new A({ message: `Variable '${t}' not defined` });
805
- }, Z = class v {
805
+ }, ee = class v {
806
806
  constructor(t = {}) {
807
807
  const { table: r, variableMetadata: a } = this.parseVariableMap(t);
808
808
  this.table = r, this.variableMetadata = a;
@@ -822,42 +822,42 @@ var zt = "value", R = {
822
822
  }
823
823
  addVariable(t, r, a, n) {
824
824
  if (this.table.columnCount > 0 && a.length !== this.size()) throw new A({ message: `Variable '${t}' has ${a.length} values, expected ${this.size()}` });
825
- const o = {
825
+ const s = {
826
826
  ...this.variableMetadata,
827
827
  [t]: {
828
828
  type: r,
829
829
  valueFormat: this.resolveAddedVariableFormat(t, r, n)
830
830
  }
831
- }, s = this.normalizeRawValues(r, a), i = this.table.assign(t, s);
832
- return v.fromTrusted(i, o);
831
+ }, o = this.normalizeRawValues(r, a), i = this.table.assign(t, o);
832
+ return v.fromTrusted(i, s);
833
833
  }
834
834
  addConstantVariable(t, r, a, n) {
835
- const o = {
835
+ const s = {
836
836
  ...this.variableMetadata,
837
837
  [t]: {
838
838
  type: r,
839
839
  valueFormat: this.resolveAddedVariableFormat(t, r, n),
840
840
  constant: { value: a }
841
841
  }
842
- }, [s = null] = this.normalizeRawValues(r, [a]), i = this.table.assign(t, new Array(this.size()).fill(s));
843
- return v.fromTrusted(i, o);
842
+ }, [o = null] = this.normalizeRawValues(r, [a]), i = this.table.assign(t, new Array(this.size()).fill(o));
843
+ return v.fromTrusted(i, s);
844
844
  }
845
845
  getConstant(t) {
846
846
  return this.variableMetadata[t]?.constant;
847
847
  }
848
848
  deriveVariable(t, r, a, n) {
849
- const o = Array.from({ length: this.size() }, (s, i) => a(this.table.objectAt(i)));
850
- return this.addVariable(t, r, o, n);
849
+ const s = Array.from({ length: this.size() }, (o, i) => a(this.table.objectAt(i)));
850
+ return this.addVariable(t, r, s, n);
851
851
  }
852
- deriveVariableFrom(t, r, a, n, o) {
853
- const s = this.hasVariable(t) ? this.getValues(t).map(n) : Array.from({ length: this.size() }, () => n(null));
854
- return this.addVariable(r, a, s, o);
852
+ deriveVariableFrom(t, r, a, n, s) {
853
+ const o = this.hasVariable(t) ? this.getValues(t).map(n) : Array.from({ length: this.size() }, () => n(null));
854
+ return this.addVariable(r, a, o, s);
855
855
  }
856
856
  renameVariable(t, r) {
857
857
  const a = this.variableMetadata[t];
858
858
  if (!a) throw new A({ message: `Variable ${t} not defined` });
859
- const n = this.table.rename(t, r), { [t]: o, ...s } = this.variableMetadata, i = {
860
- ...s,
859
+ const n = this.table.rename(t, r), { [t]: s, ...o } = this.variableMetadata, i = {
860
+ ...o,
861
861
  [r]: a
862
862
  };
863
863
  return v.fromTrusted(n, i);
@@ -894,9 +894,9 @@ var zt = "value", R = {
894
894
  }
895
895
  filter(t, r, a) {
896
896
  if (this.hasVariable(t) && this.getType(t) === "temporal") return this.filterByTimestamp(t, r, a);
897
- const n = se[r], o = this.table.values(t) ?? [], s = [];
898
- for (let i = 0; i < o.length; i++) n(o[i] ?? null, a) && s.push(i);
899
- return v.fromTrusted(this.table.take(s), this.variableMetadata);
897
+ const n = ie[r], s = this.table.values(t) ?? [], o = [];
898
+ for (let i = 0; i < s.length; i++) n(s[i] ?? null, a) && o.push(i);
899
+ return v.fromTrusted(this.table.take(o), this.variableMetadata);
900
900
  }
901
901
  filterByMask(t) {
902
902
  if (t.length !== this.size()) throw new A({ message: `Row mask length ${t.length} does not match dataset size ${this.size()}` });
@@ -928,50 +928,50 @@ var zt = "value", R = {
928
928
  return new Yt(t, this.table, this.variableMetadata);
929
929
  }
930
930
  rollup(t) {
931
- const r = J.from(Object.fromEntries(Object.entries(t).map(([n, { variableName: o, aggregation: s }]) => [n, [We(s, ze(this.table, o, s))]]))), a = {};
932
- for (const [n, { variableName: o, aggregation: s }] of Object.entries(t)) {
933
- const i = this.variableMetadata[o], c = i?.type ?? "numeric", f = i?.valueFormat ?? R[c];
931
+ const r = Z.from(Object.fromEntries(Object.entries(t).map(([n, { variableName: s, aggregation: o }]) => [n, [We(o, $e(this.table, s, o))]]))), a = {};
932
+ for (const [n, { variableName: s, aggregation: o }] of Object.entries(t)) {
933
+ const i = this.variableMetadata[s], c = i?.type ?? "numeric", f = i?.valueFormat ?? x[c];
934
934
  a[n] = {
935
- type: je(s, c),
936
- valueFormat: Ue(s, f)
935
+ type: Ue(o, c),
936
+ valueFormat: Ye(o, f)
937
937
  };
938
938
  }
939
939
  return v.fromTrusted(r, a);
940
940
  }
941
- reshapeFromWideToLong({ keep: t, reshape: r, keyName: a = "key", valueName: n = zt } = {}) {
942
- const { numeric: o, categorical: s, temporal: i } = this.groupVariableNamesByType(), c = t ?? [...s, ...i], f = r ?? o.filter((g) => !c.includes(g));
943
- if (c.includes(a) || c.includes(n)) throw new W({
941
+ reshapeFromWideToLong({ keep: t, reshape: r, keyName: a = "key", valueName: n = Wt } = {}) {
942
+ const { numeric: s, categorical: o, temporal: i } = this.groupVariableNamesByType(), c = t ?? [...o, ...i], f = r ?? s.filter((y) => !c.includes(y));
943
+ if (c.includes(a) || c.includes(n)) throw new U({
944
944
  code: "INVALID_DATA_SHAPE",
945
945
  message: `The variables to keep includes the variables '${a}' or '${n}' to create the key and value variables`
946
946
  });
947
947
  if (f.length === 0) {
948
- const g = {};
948
+ const y = {};
949
949
  for (const M of c) {
950
950
  const S = this.variableMetadata[M];
951
- S && (g[M] = {
951
+ S && (y[M] = {
952
952
  type: S.type,
953
953
  values: [],
954
954
  valueFormat: S.valueFormat
955
955
  });
956
956
  }
957
- return g[a] = {
957
+ return y[a] = {
958
958
  type: "categorical",
959
959
  values: [],
960
960
  valueFormat: { type: "text" }
961
- }, g[n] = {
961
+ }, y[n] = {
962
962
  type: "numeric",
963
963
  values: [],
964
964
  valueFormat: { type: "decimal" }
965
- }, new v(g);
965
+ }, new v(y);
966
966
  }
967
- if (f.filter((g) => this.variableMetadata[g]?.type !== "numeric").length > 0) throw new W({
967
+ if (f.filter((y) => this.variableMetadata[y]?.type !== "numeric").length > 0) throw new U({
968
968
  code: "INVALID_DATA_SHAPE",
969
969
  message: "Only numeric variables can be reshaped"
970
970
  });
971
- const y = this.table.select([...c, ...f]).fold(f, a, n), p = {};
972
- for (const g of c) {
973
- const M = this.variableMetadata[g];
974
- M && (p[g] = M);
971
+ const g = this.table.select([...c, ...f]).fold(f, a, n), p = {};
972
+ for (const y of c) {
973
+ const M = this.variableMetadata[y];
974
+ M && (p[y] = M);
975
975
  }
976
976
  return p[a] = {
977
977
  type: "categorical",
@@ -979,7 +979,7 @@ var zt = "value", R = {
979
979
  }, p[n] = {
980
980
  type: "numeric",
981
981
  valueFormat: $t(this.variableMetadata, f, a)
982
- }, v.fromTrusted(y, p);
982
+ }, v.fromTrusted(g, p);
983
983
  }
984
984
  print() {
985
985
  console.table(this.variableMetadata), console.table([...this.table]);
@@ -988,24 +988,24 @@ var zt = "value", R = {
988
988
  return this.table[Symbol.iterator]();
989
989
  }
990
990
  filterByTimestamp(t, r, a) {
991
- const n = se[r], o = ie(a), s = this.getValues(t, { type: "temporal" }), i = [];
992
- for (let c = 0; c < s.length; c++) n(ie(s[c] ?? null), o) && i.push(c);
991
+ const n = ie[r], s = le(a), o = this.getValues(t, { type: "temporal" }), i = [];
992
+ for (let c = 0; c < o.length; c++) n(le(o[c] ?? null), s) && i.push(c);
993
993
  return v.fromTrusted(this.table.take(i), this.variableMetadata);
994
994
  }
995
995
  resolveAddedVariableFormat(t, r, a) {
996
996
  if (a !== void 0) return a;
997
997
  const n = this.variableMetadata[t];
998
- return n ? n.valueFormat : R[r];
998
+ return n ? n.valueFormat : x[r];
999
999
  }
1000
1000
  parseVariableMap(t) {
1001
1001
  const r = {}, a = {};
1002
- for (const [n, { type: o, values: s, valueFormat: i }] of Object.entries(t))
1003
- r[n] = s, a[n] = {
1004
- type: o,
1005
- valueFormat: i ?? R[o]
1002
+ for (const [n, { type: s, values: o, valueFormat: i }] of Object.entries(t))
1003
+ r[n] = o, a[n] = {
1004
+ type: s,
1005
+ valueFormat: i ?? x[s]
1006
1006
  };
1007
1007
  return {
1008
- table: J.from(r),
1008
+ table: Z.from(r),
1009
1009
  variableMetadata: a
1010
1010
  };
1011
1011
  }
@@ -1025,12 +1025,12 @@ var zt = "value", R = {
1025
1025
  return t.filter((r) => r !== null);
1026
1026
  }
1027
1027
  getDistinctValues(t, r) {
1028
- const a = t === "temporal", n = /* @__PURE__ */ new Set(), o = [];
1029
- for (const s of r) {
1030
- const i = a && s instanceof Date ? s.getTime() : s;
1031
- n.has(i) || (n.add(i), o.push(s));
1028
+ const a = t === "temporal", n = /* @__PURE__ */ new Set(), s = [];
1029
+ for (const o of r) {
1030
+ const i = a && o instanceof Date ? o.getTime() : o;
1031
+ n.has(i) || (n.add(i), s.push(o));
1032
1032
  }
1033
- return o;
1033
+ return s;
1034
1034
  }
1035
1035
  }, Yt = class {
1036
1036
  constructor(e, t, r) {
@@ -1038,55 +1038,55 @@ var zt = "value", R = {
1038
1038
  }
1039
1039
  forEach(e) {
1040
1040
  this.table.partition(this.groupedBy).forEach(({ key: t, indices: r }, a) => {
1041
- e(Z.fromTrusted(this.table.take(r), this.variableMetadata), t, a);
1041
+ e(ee.fromTrusted(this.table.take(r), this.variableMetadata), t, a);
1042
1042
  });
1043
1043
  }
1044
1044
  rollup(e) {
1045
1045
  const t = this.table.partition(this.groupedBy), r = {};
1046
1046
  for (const n of this.groupedBy) {
1047
- const o = this.table.values(n) ?? [];
1048
- r[n] = t.map(({ indices: s }) => o[s[0] ?? 0] ?? null);
1047
+ const s = this.table.values(n) ?? [];
1048
+ r[n] = t.map(({ indices: o }) => s[o[0] ?? 0] ?? null);
1049
1049
  }
1050
1050
  const a = Object.fromEntries(this.groupedBy.map((n) => {
1051
- const o = this.variableMetadata[n], s = o?.type ?? "categorical";
1051
+ const s = this.variableMetadata[n], o = s?.type ?? "categorical";
1052
1052
  return [n, {
1053
- type: s,
1054
- valueFormat: o?.valueFormat ?? R[s]
1053
+ type: o,
1054
+ valueFormat: s?.valueFormat ?? x[o]
1055
1055
  }];
1056
1056
  }));
1057
- for (const [n, { variableName: o, aggregation: s }] of Object.entries(e)) {
1058
- const i = ze(this.table, o, s);
1059
- r[n] = t.map(({ indices: p }) => We(s, i, p));
1060
- const c = this.variableMetadata[o], f = c?.type ?? "numeric", y = c?.valueFormat ?? R[f];
1057
+ for (const [n, { variableName: s, aggregation: o }] of Object.entries(e)) {
1058
+ const i = $e(this.table, s, o);
1059
+ r[n] = t.map(({ indices: p }) => We(o, i, p));
1060
+ const c = this.variableMetadata[s], f = c?.type ?? "numeric", g = c?.valueFormat ?? x[f];
1061
1061
  a[n] = {
1062
- type: je(s, f),
1063
- valueFormat: Ue(s, y)
1062
+ type: Ue(o, f),
1063
+ valueFormat: Ye(o, g)
1064
1064
  };
1065
1065
  }
1066
- return Z.fromTrusted(J.from(r), a);
1066
+ return ee.fromTrusted(Z.from(r), a);
1067
1067
  }
1068
1068
  };
1069
1069
  function $t(e, t, r) {
1070
- const a = t.map((i) => e[i]?.valueFormat ?? { type: "decimal" }), [n, ...o] = a;
1070
+ const a = t.map((i) => e[i]?.valueFormat ?? { type: "decimal" }), [n, ...s] = a;
1071
1071
  if (!n) return { type: "decimal" };
1072
- for (const i of a) if (i.type === "lookup") throw new W({
1072
+ for (const i of a) if (i.type === "lookup") throw new U({
1073
1073
  code: "INVALID_DATA_SHAPE",
1074
1074
  message: "Cannot reshape: a source column has a lookup format and lookups cannot nest"
1075
1075
  });
1076
- if (o.every((i) => qe(i, n)) || n.type === "lookup") return n;
1077
- const s = {};
1076
+ if (s.every((i) => qe(i, n)) || n.type === "lookup") return n;
1077
+ const o = {};
1078
1078
  for (const [i, c] of t.entries()) {
1079
- const f = Q([c]), y = a[i];
1080
- y && y.type !== "lookup" && (s[f] = y);
1079
+ const f = J([c]), g = a[i];
1080
+ g && g.type !== "lookup" && (o[f] = g);
1081
1081
  }
1082
1082
  return {
1083
1083
  type: "lookup",
1084
1084
  byVariable: r,
1085
- cases: s,
1085
+ cases: o,
1086
1086
  fallback: n
1087
1087
  };
1088
1088
  }
1089
- var Ht = class {
1089
+ var Gt = class {
1090
1090
  constructor(e) {
1091
1091
  this.label = e, this.items = /* @__PURE__ */ new Map();
1092
1092
  }
@@ -1096,7 +1096,7 @@ var Ht = class {
1096
1096
  get(e) {
1097
1097
  if (!this.items.has(e)) {
1098
1098
  const t = [...this.items.keys()].map((r) => `'${r}'`).join(", ");
1099
- throw new W({
1099
+ throw new U({
1100
1100
  code: "UNKNOWN_REGISTERED_TYPE",
1101
1101
  message: `Unknown ${this.label}: '${e}' (available: ${t})`,
1102
1102
  context: {
@@ -1115,30 +1115,30 @@ var Ht = class {
1115
1115
  has(e) {
1116
1116
  return this.items.has(e);
1117
1117
  }
1118
- }, Gt = (e, t) => {
1118
+ }, Ht = (e, t) => {
1119
1119
  const r = typeof e == "string" ? e.trim() : e;
1120
- if (D(r)) return { type: "decimal" };
1121
- const a = typeof r == "string" && De(r, t);
1120
+ if (k(r)) return { type: "decimal" };
1121
+ const a = typeof r == "string" && Se(r, t);
1122
1122
  if (a) return a;
1123
- const n = typeof r == "string" && Ft(r, t);
1124
- return n || (ke(e) ? { type: "date" } : Te(e) ? { type: "percentage" } : Ne(e) && typeof e == "string" ? {
1123
+ const n = typeof r == "string" && wt(r, t);
1124
+ return n || (ke(e) ? { type: "date" } : Fe(e) ? { type: "percentage" } : Ie(e) && typeof e == "string" ? {
1125
1125
  type: "currency",
1126
- iso: Lt(e)
1126
+ iso: Dt(e)
1127
1127
  } : { type: "text" });
1128
1128
  }, Kt = {
1129
1129
  type: "year",
1130
1130
  dateFormat: "yyyy"
1131
1131
  }, Xt = (e) => {
1132
1132
  const t = e._metadata?.parsingLocale ?? "en-GB", r = {}, a = Jt(e), n = qt(e);
1133
- for (const [o, s] of e.columns.entries()) {
1134
- if (s._metadata?.isHidden) continue;
1135
- const i = a.get(s.key);
1136
- if (B(i)) continue;
1137
- const c = o === n ? Kt : Gt(i, t), f = Me(c);
1138
- r[s.key] = Qt(s.key, e.rows, c, f, t);
1139
- }
1140
- return new Z(r);
1141
- }, ba = class extends Rt {
1133
+ for (const [s, o] of e.columns.entries()) {
1134
+ if (o._metadata?.isHidden) continue;
1135
+ const i = a.get(o.key);
1136
+ if (V(i)) continue;
1137
+ const c = s === n ? Kt : Ht(i, t), f = we(c);
1138
+ r[o.key] = Qt(o.key, e.rows, c, f, t);
1139
+ }
1140
+ return new ee(r);
1141
+ }, ma = class extends It {
1142
1142
  dependencies(e) {
1143
1143
  return [e];
1144
1144
  }
@@ -1148,19 +1148,19 @@ var Ht = class {
1148
1148
  }, qt = (e) => {
1149
1149
  const t = Zt(e.rows, 5);
1150
1150
  return e.columns.findIndex((r) => {
1151
- const a = t.map((n) => n[r.key]).filter((n) => !B(n));
1151
+ const a = t.map((n) => n[r.key]).filter((n) => !V(n));
1152
1152
  return a.length >= 2 && a.every(Tt);
1153
1153
  });
1154
1154
  }, Qt = (e, t, r, a, n) => ({
1155
1155
  type: a,
1156
- values: t.reduce((o, s) => (xe(s) || o.push(Dt(s[e], r, n)), o), []),
1156
+ values: t.reduce((s, o) => (Ve(o) || s.push(Ot(o[e], r, n)), s), []),
1157
1157
  valueFormat: r
1158
1158
  }), Jt = (e) => {
1159
1159
  const t = /* @__PURE__ */ new Map(), r = new Set(e.columns.map((a) => a.key));
1160
1160
  for (const a of e.rows) {
1161
1161
  for (const n of r) {
1162
- const o = a[n];
1163
- B(o) || (t.set(n, o), r.delete(n));
1162
+ const s = a[n];
1163
+ V(s) || (t.set(n, s), r.delete(n));
1164
1164
  }
1165
1165
  if (r.size === 0) break;
1166
1166
  }
@@ -1168,7 +1168,7 @@ var Ht = class {
1168
1168
  }, Zt = (e, t) => {
1169
1169
  const r = [];
1170
1170
  for (const a of e)
1171
- if (xe(a) || r.push(a), r.length === t) return r;
1171
+ if (Ve(a) || r.push(a), r.length === t) return r;
1172
1172
  return r;
1173
1173
  }, er = class {
1174
1174
  constructor() {
@@ -1227,18 +1227,18 @@ var Ht = class {
1227
1227
  const { options: r } = t;
1228
1228
  return e.orderBy(r.variableName, r.direction ?? "asc");
1229
1229
  }
1230
- }, or = [
1230
+ }, sr = [
1231
1231
  new er(),
1232
1232
  new tr(),
1233
1233
  new rr(),
1234
1234
  new ar(),
1235
1235
  new nr()
1236
- ], va = class extends Ht {
1236
+ ], pa = class extends Gt {
1237
1237
  constructor() {
1238
1238
  super("transform");
1239
- for (const e of or) this.register(e.transformType, e);
1239
+ for (const e of sr) this.register(e.transformType, e);
1240
1240
  }
1241
- }, Aa = [
1241
+ }, ha = [
1242
1242
  "grey",
1243
1243
  "red",
1244
1244
  "orange",
@@ -1248,7 +1248,7 @@ var Ht = class {
1248
1248
  "blue",
1249
1249
  "purple",
1250
1250
  "pink"
1251
- ], Ea = [
1251
+ ], ba = [
1252
1252
  "cyan",
1253
1253
  "pink",
1254
1254
  "purple",
@@ -1257,7 +1257,7 @@ var Ht = class {
1257
1257
  "yellow",
1258
1258
  "green",
1259
1259
  "blue"
1260
- ], Ye = [
1260
+ ], or = [
1261
1261
  "#B399FE",
1262
1262
  "#FC7E91",
1263
1263
  "#33B6E0",
@@ -1270,7 +1270,7 @@ var Ht = class {
1270
1270
  "#58C8D8",
1271
1271
  "#F35074",
1272
1272
  "#6EA0DA"
1273
- ], T = {
1273
+ ], w = {
1274
1274
  red: "#E83562",
1275
1275
  orange: "#F38650",
1276
1276
  yellow: "#FBBC30",
@@ -1281,18 +1281,18 @@ var Ht = class {
1281
1281
  dark_purple: "#6D48D2",
1282
1282
  plum: "#C82184",
1283
1283
  pink: "#FC8497"
1284
- }, Ma = [T.purple, T.dark_purple], sr = [
1285
- T.purple,
1286
- T.pink,
1287
- T.yellow,
1288
- T.blue,
1289
- T.red,
1290
- T.cyan,
1291
- T.orange,
1292
- T.plum,
1293
- T.green,
1294
- T.dark_purple
1295
- ], w = {
1284
+ }, va = [w.purple, w.dark_purple], ir = [
1285
+ w.purple,
1286
+ w.pink,
1287
+ w.yellow,
1288
+ w.blue,
1289
+ w.red,
1290
+ w.cyan,
1291
+ w.orange,
1292
+ w.plum,
1293
+ w.green,
1294
+ w.dark_purple
1295
+ ], _ = {
1296
1296
  green: "#B2DDC9",
1297
1297
  cyan: "#A2D5E2",
1298
1298
  blue: "#AAC4FF",
@@ -1302,17 +1302,17 @@ var Ht = class {
1302
1302
  red: "#FFADAD",
1303
1303
  orange: "#FFDEB4",
1304
1304
  yellow: "#FDF7C3"
1305
- }, ir = [
1306
- w.green,
1307
- w.purple,
1308
- w.red,
1309
- w.cyan,
1310
- w.pink,
1311
- w.blue,
1312
- w.orange,
1313
- w.plum,
1314
- w.yellow
1315
- ], ee = {
1305
+ }, lr = [
1306
+ _.green,
1307
+ _.purple,
1308
+ _.red,
1309
+ _.cyan,
1310
+ _.pink,
1311
+ _.blue,
1312
+ _.orange,
1313
+ _.plum,
1314
+ _.yellow
1315
+ ], te = {
1316
1316
  grey900: "#1c1917",
1317
1317
  grey800: "#292524",
1318
1318
  grey700: "#44403c",
@@ -1403,12 +1403,12 @@ var Ht = class {
1403
1403
  pink200: "#FED0F3",
1404
1404
  pink100: "#FFE8F9",
1405
1405
  pink50: "#FFF4FC"
1406
- }, lr = [
1407
- ee.grey200,
1408
- w.green,
1409
- w.red,
1410
- ee.grey200
1411
- ], le = {
1406
+ }, cr = [
1407
+ te.grey200,
1408
+ _.green,
1409
+ _.red,
1410
+ te.grey200
1411
+ ], ce = {
1412
1412
  dark: {
1413
1413
  1: [500],
1414
1414
  2: [600, 400],
@@ -1516,7 +1516,7 @@ var Ht = class {
1516
1516
  yellow: "#FBFF00",
1517
1517
  green: "#06FF00",
1518
1518
  blue: "#0079FF"
1519
- }, V = [
1519
+ }, j = [
1520
1520
  E.cyan,
1521
1521
  E.pink,
1522
1522
  E.purple,
@@ -1525,7 +1525,7 @@ var Ht = class {
1525
1525
  E.yellow,
1526
1526
  E.green,
1527
1527
  E.blue
1528
- ], cr = [
1528
+ ], dr = [
1529
1529
  E.cyan,
1530
1530
  E.green,
1531
1531
  E.red,
@@ -1535,12 +1535,12 @@ var Ht = class {
1535
1535
  positive: "#84FC89",
1536
1536
  negative: "#FC8497",
1537
1537
  total: "#84D1FC"
1538
- }, dr = [
1538
+ }, ur = [
1539
1539
  P.start,
1540
1540
  P.positive,
1541
1541
  P.negative,
1542
1542
  P.total
1543
- ], Ta = {
1543
+ ], Aa = {
1544
1544
  transform: "linear",
1545
1545
  reverse: !1,
1546
1546
  nice: !0,
@@ -1552,83 +1552,83 @@ var Ht = class {
1552
1552
  interpolate: "lab",
1553
1553
  domainMid: null,
1554
1554
  symmetric: !1
1555
- }, Fa = {
1555
+ }, Ea = {
1556
1556
  size: [4, 20],
1557
1557
  alpha: [0.1, 1],
1558
1558
  strokeWidth: [1, 4]
1559
- }, wa = {
1559
+ }, Ma = {
1560
1560
  domainMin: null,
1561
1561
  domainMax: null,
1562
1562
  nice: !1,
1563
1563
  reverse: !1
1564
- }, _a = {
1564
+ }, Ta = {
1565
1565
  range: null,
1566
1566
  domain: null,
1567
1567
  padding: 0.1,
1568
1568
  reverse: !1
1569
- }, ce = { palette: { type: "default" } };
1570
- function ur(e, t = "light", r) {
1571
- return ((r !== void 0 ? le[t][r] : void 0) ?? le[t].default).map((a) => ee[`${e}${a}`]);
1569
+ }, de = { palette: { type: "default" } };
1570
+ function fr(e, t = "light", r) {
1571
+ return ((r !== void 0 ? ce[t][r] : void 0) ?? ce[t].default).map((a) => te[`${e}${a}`]);
1572
1572
  }
1573
- function fr(e) {
1574
- const t = V.indexOf(E[e]);
1575
- return t <= 0 ? V : [...V.slice(t), ...V.slice(0, t)];
1573
+ function yr(e) {
1574
+ const t = j.indexOf(E[e]);
1575
+ return t <= 0 ? j : [...j.slice(t), ...j.slice(0, t)];
1576
1576
  }
1577
- function La(e, t) {
1577
+ function wa(e, t) {
1578
1578
  switch (e.type) {
1579
1579
  case "default":
1580
- return Ye;
1580
+ return or;
1581
1581
  case "graphy":
1582
- return e.variant === "waterfall" ? dr : sr;
1582
+ return e.variant === "waterfall" ? ur : ir;
1583
1583
  case "pastel":
1584
- return e.variant === "waterfall" ? lr : ir;
1584
+ return e.variant === "waterfall" ? cr : lr;
1585
1585
  case "neon":
1586
- return e.variant === "waterfall" ? cr : fr(e.base);
1586
+ return e.variant === "waterfall" ? dr : yr(e.base);
1587
1587
  case "mono":
1588
- return ur(e.base, e.variant ?? "light", t);
1588
+ return fr(e.base, e.variant ?? "light", t);
1589
1589
  case "custom":
1590
1590
  return e.colors;
1591
1591
  }
1592
1592
  }
1593
- function ka(e, t) {
1593
+ function Fa(e, t) {
1594
1594
  if (!t) return e;
1595
1595
  const r = [...e];
1596
1596
  for (const [a, n] of Object.entries(t)) {
1597
- const o = Number(a);
1598
- if (!Number.isInteger(o) || o < 1) continue;
1599
- const s = o - 1;
1600
- s < r.length && (r[s] = n);
1597
+ const s = Number(a);
1598
+ if (!Number.isInteger(s) || s < 1) continue;
1599
+ const o = s - 1;
1600
+ o < r.length && (r[o] = n);
1601
1601
  }
1602
1602
  return r;
1603
1603
  }
1604
- function Da(e, t, r, a) {
1604
+ function _a(e, t, r, a) {
1605
1605
  if (!t) return;
1606
- const n = r?.type === "custom" ? a[r.id] : void 0, o = {};
1607
- for (const [s, i] of Object.entries(t)) {
1608
- const c = Number(s);
1606
+ const n = r?.type === "custom" ? a[r.id] : void 0, s = {};
1607
+ for (const [o, i] of Object.entries(t)) {
1608
+ const c = Number(o);
1609
1609
  if (!(!Number.isInteger(c) || c < 1)) {
1610
1610
  if (i.hex !== void 0) {
1611
- o[c] = i.hex;
1611
+ s[c] = i.hex;
1612
1612
  continue;
1613
1613
  }
1614
1614
  if (i.id !== void 0) {
1615
- const f = n?.find((y) => y.id === i.id)?.hex;
1616
- f !== void 0 ? o[c] = f : e.diagnostics.addWarning({
1615
+ const f = n?.find((g) => g.id === i.id)?.hex;
1616
+ f !== void 0 ? s[c] = f : e.diagnostics.addWarning({
1617
1617
  code: "PALETTE_NOT_FOUND",
1618
1618
  message: `Palette override at slot ${c} with id '${i.id}' did not resolve against the active palette — falling back to palette color.`,
1619
1619
  context: {
1620
1620
  requested: i.id,
1621
- available: n?.map((y) => y.id) ?? []
1621
+ available: n?.map((g) => g.id) ?? []
1622
1622
  },
1623
1623
  suggestion: "Define the override id in the active custom palette, or use a hex value instead."
1624
1624
  });
1625
1625
  }
1626
1626
  }
1627
1627
  }
1628
- return Object.keys(o).length > 0 ? o : void 0;
1628
+ return Object.keys(s).length > 0 ? s : void 0;
1629
1629
  }
1630
- function Sa(e, t, r) {
1631
- if (!t) return ce.palette;
1630
+ function Da(e, t, r) {
1631
+ if (!t) return de.palette;
1632
1632
  if (t.type === "custom") {
1633
1633
  const a = r[t.id];
1634
1634
  if (!a)
@@ -1640,8 +1640,8 @@ function Sa(e, t, r) {
1640
1640
  available: Object.keys(r)
1641
1641
  },
1642
1642
  suggestion: "Register the palette in customPalettes, or reference an existing palette id."
1643
- }), ce.palette;
1644
- const n = a.map((o) => o.hex);
1643
+ }), de.palette;
1644
+ const n = a.map((s) => s.hex);
1645
1645
  return {
1646
1646
  type: "custom",
1647
1647
  id: t.id,
@@ -1650,24 +1650,24 @@ function Sa(e, t, r) {
1650
1650
  }
1651
1651
  return t;
1652
1652
  }
1653
- var Ca = { labelCrossPosition: 0.5 }, Oa = {
1653
+ var La = { labelCrossPosition: 0.5 }, Oa = {
1654
1654
  kind: "rectangle",
1655
1655
  zOrder: "foreground"
1656
- }, Na = {
1656
+ }, ka = {
1657
1657
  zOrder: "foreground",
1658
1658
  fit: "contain"
1659
- }, Ia = {
1659
+ }, Sa = {
1660
1660
  x: 8,
1661
1661
  y: 8,
1662
1662
  unit: "px"
1663
- }, Ra = { align: "center" }, xa = {
1663
+ }, Na = { align: "center" }, Ra = {
1664
1664
  startArrowheadStyle: "none",
1665
1665
  endArrowheadStyle: "line-arrow"
1666
- }, Ba = {
1666
+ }, Ca = {
1667
1667
  thin: 2,
1668
1668
  medium: 4,
1669
1669
  thick: 8
1670
- }, Va = 0.5, Pa = {
1670
+ }, Ia = 0.5, xa = {
1671
1671
  borderWidth: 2,
1672
1672
  shadow: {
1673
1673
  offsetX: 0,
@@ -1675,7 +1675,7 @@ var Ca = { labelCrossPosition: 0.5 }, Oa = {
1675
1675
  blur: 1.15,
1676
1676
  color: "rgba(0, 0, 0, 0.16)"
1677
1677
  }
1678
- }, ja = {
1678
+ }, Ba = {
1679
1679
  small: {
1680
1680
  arrow: { strokeWidth: 2 },
1681
1681
  label: {
@@ -1727,7 +1727,7 @@ function b(e, t = {}) {
1727
1727
  symmetric: r.symmetric
1728
1728
  };
1729
1729
  }
1730
- function K(e, t = {}) {
1730
+ function X(e, t = {}) {
1731
1731
  return {
1732
1732
  type: "scale",
1733
1733
  scaledAesthetic: e,
@@ -1739,7 +1739,7 @@ function K(e, t = {}) {
1739
1739
  clamp: t.clamp
1740
1740
  };
1741
1741
  }
1742
- function _(e, t = {}) {
1742
+ function D(e, t = {}) {
1743
1743
  return {
1744
1744
  type: "scale",
1745
1745
  scaledAesthetic: e,
@@ -1750,14 +1750,14 @@ function _(e, t = {}) {
1750
1750
  reverse: t.reverse
1751
1751
  };
1752
1752
  }
1753
- function j(e, t = {}) {
1753
+ function z(e, t = {}) {
1754
1754
  return {
1755
1755
  type: "scale",
1756
1756
  scaledAesthetic: e,
1757
1757
  scaleType: "identity"
1758
1758
  };
1759
1759
  }
1760
- function X(e, t) {
1760
+ function q(e, t) {
1761
1761
  return {
1762
1762
  type: "scale",
1763
1763
  scaledAesthetic: e,
@@ -1774,7 +1774,7 @@ function gr(e, t = {}) {
1774
1774
  overrides: t.overrides
1775
1775
  };
1776
1776
  }
1777
- var yr = [
1777
+ var mr = [
1778
1778
  "none",
1779
1779
  "xs",
1780
1780
  "sm",
@@ -1782,14 +1782,14 @@ var yr = [
1782
1782
  "lg",
1783
1783
  "xl",
1784
1784
  "full"
1785
- ], Wa = {
1786
- point: mr,
1787
- line: pr,
1788
- area: hr,
1789
- bar: br,
1790
- rule: vr,
1791
- tile: Ar
1792
- }, Ua = (e) => typeof e == "string" && yr.includes(e);
1785
+ ], Va = {
1786
+ point: pr,
1787
+ line: hr,
1788
+ area: br,
1789
+ bar: vr,
1790
+ rule: Ar,
1791
+ tile: Er
1792
+ }, ja = (e) => typeof e == "string" && mr.includes(e);
1793
1793
  function I(e, t) {
1794
1794
  return {
1795
1795
  type: "layer",
@@ -1805,39 +1805,39 @@ function I(e, t) {
1805
1805
  dataLabels: t.dataLabels
1806
1806
  };
1807
1807
  }
1808
- function mr(e = {}) {
1808
+ function pr(e = {}) {
1809
1809
  return I("point", e);
1810
1810
  }
1811
- function pr(e = {}) {
1811
+ function hr(e = {}) {
1812
1812
  return I("line", e);
1813
1813
  }
1814
- function hr(e = {}) {
1814
+ function br(e = {}) {
1815
1815
  return I("area", e);
1816
1816
  }
1817
- function br(e = {}) {
1817
+ function vr(e = {}) {
1818
1818
  return I("bar", e);
1819
1819
  }
1820
- function vr(e = {}) {
1820
+ function Ar(e = {}) {
1821
1821
  return I("rule", e);
1822
1822
  }
1823
- function Ar(e = {}) {
1823
+ function Er(e = {}) {
1824
1824
  return I("tile", e);
1825
1825
  }
1826
- var za = [
1826
+ var Pa = [
1827
1827
  "observation",
1828
1828
  "category",
1829
1829
  "aggregate"
1830
- ], Ya = ["inside", "outside"], $a = [
1830
+ ], za = ["inside", "outside"], Ua = [
1831
1831
  "top",
1832
1832
  "right",
1833
1833
  "bottom",
1834
1834
  "left"
1835
- ], Ha = [
1835
+ ], Wa = [
1836
1836
  "heading",
1837
1837
  "label",
1838
1838
  "value",
1839
1839
  "primaryRow"
1840
- ], Ga = [
1840
+ ], Ya = [
1841
1841
  "number",
1842
1842
  "numberCenter",
1843
1843
  "caption",
@@ -1847,7 +1847,7 @@ var za = [
1847
1847
  "trendUp",
1848
1848
  "trendDown",
1849
1849
  "trendFlat"
1850
- ], Ka = ["swatch"], Xa = [
1850
+ ], $a = ["swatch"], Ga = [
1851
1851
  "shape",
1852
1852
  "arrow",
1853
1853
  "differenceArrow",
@@ -1855,12 +1855,12 @@ var za = [
1855
1855
  "image",
1856
1856
  "pinnedNumber",
1857
1857
  "comment"
1858
- ], qa = {
1858
+ ], Ha = {
1859
1859
  differenceArrow: ["label"],
1860
1860
  pinnedNumber: ["label"],
1861
1861
  comment: ["label"]
1862
- }, Qa = ["dimmed", "hovered"], Ja = (e) => typeof e == "object" && e !== null && typeof e.light == "string" && typeof e.dark == "string", Za = (e) => typeof e == "object" && e !== null && typeof e.token == "string";
1863
- function en(e) {
1862
+ }, Ka = ["dimmed", "hovered"], Xa = (e) => typeof e == "object" && e !== null && typeof e.light == "string" && typeof e.dark == "string", qa = (e) => typeof e == "object" && e !== null && typeof e.token == "string";
1863
+ function Qa(e) {
1864
1864
  return {
1865
1865
  type: "styles",
1866
1866
  ...e
@@ -1869,7 +1869,7 @@ function en(e) {
1869
1869
  function u(e) {
1870
1870
  return { token: e };
1871
1871
  }
1872
- var C = (e) => {
1872
+ var N = (e) => {
1873
1873
  const t = {
1874
1874
  ...e?.where === void 0 ? {} : { where: e.where },
1875
1875
  ...e?.state === void 0 ? {} : { state: e.state }
@@ -1878,64 +1878,64 @@ var C = (e) => {
1878
1878
  ...e?.id === void 0 ? {} : { id: e.id },
1879
1879
  ...Object.keys(t).length === 0 ? {} : { when: t }
1880
1880
  };
1881
- }, k = (e) => e?.layer === void 0 ? {} : { layer: e.layer }, l = (e) => e?.id === void 0 ? {} : { id: e.id }, F = (e) => e?.annotation === void 0 ? {} : { annotation: e.annotation }, d = {
1881
+ }, O = (e) => e?.layer === void 0 ? {} : { layer: e.layer }, l = (e) => e?.id === void 0 ? {} : { id: e.id }, F = (e) => e?.annotation === void 0 ? {} : { annotation: e.annotation }, d = {
1882
1882
  geom: Object.assign((e, t) => ({
1883
- ...C(t),
1883
+ ...N(t),
1884
1884
  select: {
1885
1885
  target: "geom",
1886
- ...k(t)
1886
+ ...O(t)
1887
1887
  },
1888
1888
  declarations: e
1889
1889
  }), {
1890
1890
  bar: (e, t) => ({
1891
- ...C(t),
1891
+ ...N(t),
1892
1892
  select: {
1893
1893
  target: "geom",
1894
1894
  kind: "bar",
1895
- ...k(t)
1895
+ ...O(t)
1896
1896
  },
1897
1897
  declarations: e
1898
1898
  }),
1899
1899
  line: (e, t) => ({
1900
- ...C(t),
1900
+ ...N(t),
1901
1901
  select: {
1902
1902
  target: "geom",
1903
1903
  kind: "line",
1904
- ...k(t)
1904
+ ...O(t)
1905
1905
  },
1906
1906
  declarations: e
1907
1907
  }),
1908
1908
  area: (e, t) => ({
1909
- ...C(t),
1909
+ ...N(t),
1910
1910
  select: {
1911
1911
  target: "geom",
1912
1912
  kind: "area",
1913
- ...k(t)
1913
+ ...O(t)
1914
1914
  },
1915
1915
  declarations: e
1916
1916
  }),
1917
1917
  point: (e, t) => ({
1918
- ...C(t),
1918
+ ...N(t),
1919
1919
  select: {
1920
1920
  target: "geom",
1921
1921
  kind: "point",
1922
- ...k(t)
1922
+ ...O(t)
1923
1923
  },
1924
1924
  declarations: e
1925
1925
  }),
1926
1926
  rule: Object.assign((e, t) => ({
1927
- ...C(t),
1927
+ ...N(t),
1928
1928
  select: {
1929
1929
  target: "geom",
1930
1930
  kind: "rule",
1931
- ...k(t)
1931
+ ...O(t)
1932
1932
  },
1933
1933
  declarations: e
1934
1934
  }), { label: (e, t) => ({
1935
1935
  ...l(t),
1936
1936
  select: {
1937
1937
  target: "ruleLabel",
1938
- ...k(t)
1938
+ ...O(t)
1939
1939
  },
1940
1940
  declarations: e
1941
1941
  }) })
@@ -2377,55 +2377,86 @@ var C = (e) => {
2377
2377
  declarations: e
2378
2378
  }) })
2379
2379
  })
2380
- }, Er = Ye[0], Mr = 0.4, Tr = Object.freeze({
2381
- light: "#FFFFFF",
2382
- dark: "#1A1A1A"
2383
- }), tn = "sm", rn = 2, an = 8, Fr = "#ffffff", de = 1, wr = 0.3, _r = Object.freeze({
2384
- light: "#1D2129",
2385
- dark: "#FFFFFF"
2386
- }), $e = Object.freeze({
2387
- light: "rgba(29, 33, 41, 0.1)",
2388
- dark: "rgba(255, 255, 255, 0.1)"
2389
- }), Lr = $e, kr = 6, Dr = Object.freeze({
2390
- light: "#000000",
2391
- dark: "#FFFFFF"
2392
- }), ue = Object.freeze({
2393
- light: "rgba(0, 0, 0, 0.6)",
2394
- dark: "rgba(255, 255, 255, 0.8)"
2395
- }), Sr = 10, Cr = 24, Or = 8, Nr = {
2396
- geomColor: Er,
2397
- ruleColor: _r,
2398
- pointBorderColor: "#ffffff",
2399
- hoverAffordanceColor: Fr,
2400
- gridLineColor: $e,
2401
- tickLineColor: Lr,
2402
- graphBackground: Tr,
2403
- textPrimary: Dr,
2404
- textSecondary: ue,
2405
- tooltipBackground: {
2406
- light: "#FFFFFF",
2407
- dark: "#353535"
2408
- },
2409
- tooltipBorderColor: {
2410
- light: "rgba(29, 33, 41, 0.1)",
2411
- dark: "#494949"
2380
+ }, Mr = "#B84737", Tr = 0.4, Ja = "sm", Za = 2, en = 8, wr = Object.freeze({
2381
+ light: "#F5F1E9",
2382
+ dark: "#1F1E1C"
2383
+ }), Fr = "#ffffff", tn = 1, ue = 1, _r = 0.3, Dr = 10, Lr = 24, Or = 8, fe = Object.freeze({
2384
+ light: "#898373",
2385
+ dark: "#9F9886"
2386
+ }), T = {
2387
+ label: {
2388
+ fontWeight: 500,
2389
+ fontSize: 11.5,
2390
+ lineHeight: 1
2412
2391
  },
2413
- tooltipPrimaryRow: {
2414
- light: "#F0F0F0",
2415
- dark: "#494949"
2392
+ dataLabelOutside: {
2393
+ fontWeight: 600,
2394
+ fontSize: 12.5,
2395
+ lineHeight: 1
2416
2396
  },
2417
- legendBorderColor: {
2418
- light: "rgba(29, 33, 41, 0.1)",
2419
- dark: "rgba(255, 255, 255, 0.1)"
2397
+ tooltipHeading: {
2398
+ fontSize: 12.5,
2399
+ fontWeight: 700,
2400
+ lineHeight: 1.3
2420
2401
  },
2421
- annotationShapeColor: {
2402
+ tooltipRow: {
2403
+ fontSize: 12.5,
2404
+ fontWeight: 500,
2405
+ lineHeight: 1.43
2406
+ }
2407
+ }, kr = {
2408
+ graphBackground: wr,
2409
+ graphBorder: Object.freeze({
2410
+ light: "rgba(58, 56, 51, 0.15)",
2411
+ dark: "rgba(237, 231, 218, 0.15)"
2412
+ }),
2413
+ geom: Mr,
2414
+ geomBorder: Object.freeze({
2415
+ light: "rgba(58, 56, 51, 0.55)",
2416
+ dark: "rgba(237, 231, 218, 0.55)"
2417
+ }),
2418
+ textPrimary: Object.freeze({
2419
+ light: "#3A3833",
2420
+ dark: "#EDE7DA"
2421
+ }),
2422
+ textSecondary: fe,
2423
+ ruleLine: Object.freeze({
2424
+ light: "#3A3833",
2425
+ dark: "#EDE7DA"
2426
+ }),
2427
+ gridLine: Object.freeze({
2428
+ light: "#E1DAC9",
2429
+ dark: "#373531"
2430
+ }),
2431
+ hoverAffordance: Fr,
2432
+ hoverGuideFill: Object.freeze({
2433
+ light: "#E7E1D2",
2434
+ dark: "#2B2A27"
2435
+ }),
2436
+ hoverGuideLine: Object.freeze({
2437
+ light: "#D5CDBA",
2438
+ dark: "#3B3934"
2439
+ }),
2440
+ tooltipBackground: Object.freeze({
2441
+ light: "#FCFCF9",
2442
+ dark: "#262522"
2443
+ }),
2444
+ tooltipBorder: Object.freeze({
2445
+ light: "rgba(58, 56, 51, 0.15)",
2446
+ dark: "rgba(237, 231, 218, 0.15)"
2447
+ }),
2448
+ tooltipPrimaryRow: Object.freeze({
2449
+ light: "#F5F1E9",
2450
+ dark: "#2E2C29"
2451
+ }),
2452
+ annotationShape: Object.freeze({
2422
2453
  light: "#3b82f6",
2423
2454
  dark: "#60a5fa"
2424
- },
2425
- annotationArrowColor: {
2426
- light: "#000000",
2427
- dark: "#ffffff"
2428
- },
2455
+ }),
2456
+ annotationArrow: Object.freeze({
2457
+ light: "#3A3833",
2458
+ dark: "#EDE7DA"
2459
+ }),
2429
2460
  trendPositive: {
2430
2461
  light: "#06B299",
2431
2462
  dark: "#0AC600"
@@ -2434,8 +2465,12 @@ var C = (e) => {
2434
2465
  light: "#E14B49",
2435
2466
  dark: "#CB3333"
2436
2467
  },
2437
- trendNeutral: ue
2438
- }, fe = {
2468
+ trendNeutral: fe
2469
+ }, ye = {
2470
+ color: u("gridLine"),
2471
+ strokeWidth: 1,
2472
+ lineType: "dashed"
2473
+ }, ge = {
2439
2474
  color: u("textPrimary"),
2440
2475
  size: 8,
2441
2476
  borderColor: u("tooltipBackground"),
@@ -2446,13 +2481,13 @@ var C = (e) => {
2446
2481
  blur: 1.5,
2447
2482
  color: "rgba(14, 14, 52, 0.18)"
2448
2483
  }
2449
- }, ge = {
2484
+ }, me = {
2450
2485
  fontSize: 12,
2451
2486
  fontWeight: 500,
2452
2487
  lineHeight: 1.3,
2453
2488
  textColor: u("textPrimary"),
2454
2489
  background: u("tooltipBackground"),
2455
- borderColor: u("tooltipBorderColor"),
2490
+ borderColor: u("tooltipBorder"),
2456
2491
  borderWidth: 1,
2457
2492
  borderRadius: 6,
2458
2493
  paddingInline: 7,
@@ -2463,113 +2498,79 @@ var C = (e) => {
2463
2498
  blur: 6,
2464
2499
  color: "rgba(0, 0, 0, 0.12)"
2465
2500
  }
2466
- }, He = [
2501
+ }, Ge = [
2467
2502
  d.geom({
2468
- color: u("geomColor"),
2503
+ color: u("geom"),
2469
2504
  alpha: 1
2470
2505
  }),
2471
2506
  d.geom.bar({
2472
2507
  borderRadius: "sm",
2473
- borderWidth: de
2508
+ borderWidth: ue,
2509
+ borderColor: u("geomBorder")
2474
2510
  }),
2475
2511
  d.geom.line({
2476
2512
  strokeWidth: 2,
2477
2513
  lineType: "solid"
2478
2514
  }),
2479
2515
  d.geom.area({
2480
- alpha: wr,
2516
+ alpha: _r,
2481
2517
  strokeWidth: 2,
2482
2518
  lineType: "solid",
2483
2519
  strokeAlpha: 1
2484
2520
  }),
2485
2521
  d.geom.point({
2486
2522
  size: 8,
2487
- borderColor: u("pointBorderColor"),
2488
- borderWidth: de
2523
+ borderColor: u("hoverAffordance"),
2524
+ borderWidth: ue
2489
2525
  }),
2490
2526
  d.geom.rule({
2491
- color: u("ruleColor"),
2527
+ color: u("ruleLine"),
2492
2528
  strokeWidth: 1,
2493
2529
  lineType: "dashed"
2494
2530
  }),
2495
- d.geom({ alpha: Mr }, { state: "dimmed" }),
2496
- d.geom.point({ borderColor: u("hoverAffordanceColor") }, { state: "hovered" }),
2497
- d.geom.bar({ borderColor: u("hoverAffordanceColor") }, { state: "hovered" }),
2498
- d.gridLine({
2499
- color: u("gridLineColor"),
2500
- strokeWidth: 1,
2501
- lineType: "dashed"
2531
+ d.geom({ alpha: Tr }, { state: "dimmed" }),
2532
+ d.geom.point({ borderColor: u("hoverAffordance") }, { state: "hovered" }),
2533
+ d.geom.bar({ borderColor: u("hoverAffordance") }, { state: "hovered" }),
2534
+ d.panelBorder({
2535
+ ...ye,
2536
+ borderRadius: 6
2502
2537
  }),
2538
+ d.gridLine.y({ ...ye }),
2503
2539
  d.tickLine({
2504
- color: u("tickLineColor"),
2505
- strokeWidth: 1,
2506
- lineType: "solid",
2507
- length: kr
2508
- }),
2509
- d.panelBorder({
2510
- color: u("gridLineColor"),
2511
- strokeWidth: 1,
2512
- lineType: "dashed",
2513
- borderRadius: 8
2540
+ strokeWidth: 0,
2541
+ length: 0
2514
2542
  }),
2515
2543
  d.graph({
2516
2544
  background: u("graphBackground"),
2517
- borderWidth: 0,
2545
+ borderWidth: 1,
2546
+ borderColor: u("graphBorder"),
2518
2547
  borderRadius: 8
2519
2548
  }),
2520
2549
  d.axisLabel({
2521
- fontSize: 12,
2522
- fontWeight: 500,
2523
- lineHeight: 1,
2550
+ ...T.label,
2524
2551
  textColor: u("textPrimary")
2525
2552
  }),
2526
2553
  d.tickLabel({
2527
- fontSize: 12,
2528
- fontWeight: 500,
2529
- lineHeight: 1,
2554
+ ...T.label,
2530
2555
  textColor: u("textSecondary"),
2531
- offset: Sr
2532
- }),
2533
- d.geom.rule.label({
2534
- fontSize: 11,
2535
- fontWeight: 500,
2536
- lineHeight: 1
2556
+ offset: Dr
2537
2557
  }),
2558
+ d.geom.rule.label({ ...T.label }),
2538
2559
  d.dataLabel({
2539
- fontSize: 11,
2540
- fontWeight: 500,
2541
- lineHeight: 1,
2560
+ ...T.label,
2542
2561
  textColor: u("textPrimary"),
2543
2562
  paddingInline: 6,
2544
2563
  paddingBlock: 2,
2545
2564
  borderRadius: 4
2546
2565
  }),
2547
- d.dataLabel.aggregate({
2548
- fontWeight: 600,
2549
- paddingInline: 4,
2550
- background: {
2551
- light: "#FFFFFF",
2552
- dark: "#000000"
2553
- },
2554
- borderColor: {
2555
- light: "#CCCCCC",
2556
- dark: "#494949"
2557
- },
2558
- borderWidth: 1
2559
- }),
2566
+ d.dataLabel.aggregate({ ...T.dataLabelOutside }),
2560
2567
  d.dataLabel.observation.inside({ textColor: "#FFFFFF" }),
2561
2568
  d.dataLabel.category.inside({ textColor: "#FFFFFF" }),
2562
- d.dataLabel.observation.outside({ background: {
2563
- light: "rgba(0, 0, 0, 0.1)",
2564
- dark: "rgba(255, 255, 255, 0.1)"
2565
- } }),
2566
- d.dataLabel.category.outside({ background: {
2567
- light: "rgba(0, 0, 0, 0.1)",
2568
- dark: "rgba(255, 255, 255, 0.1)"
2569
- } }),
2569
+ d.dataLabel.observation.outside({ ...T.dataLabelOutside }),
2570
+ d.dataLabel.category.outside({ ...T.dataLabelOutside }),
2570
2571
  d.tooltip({
2571
2572
  background: u("tooltipBackground"),
2572
- borderColor: u("tooltipBorderColor"),
2573
+ borderColor: u("tooltipBorder"),
2573
2574
  borderWidth: 1,
2574
2575
  borderRadius: 6,
2575
2576
  paddingBlock: 8,
@@ -2582,28 +2583,22 @@ var C = (e) => {
2582
2583
  }
2583
2584
  }),
2584
2585
  d.tooltip.heading({
2585
- fontSize: 12,
2586
- fontWeight: 500,
2587
- lineHeight: 1.3,
2586
+ ...T.tooltipHeading,
2588
2587
  textColor: u("textPrimary")
2589
2588
  }),
2590
2589
  d.tooltip.label({
2591
- fontSize: 14,
2592
- fontWeight: 500,
2593
- lineHeight: 1.43,
2594
- textColor: u("textSecondary")
2590
+ ...T.tooltipRow,
2591
+ textColor: u("textPrimary")
2595
2592
  }),
2596
2593
  d.tooltip.value({
2597
- fontSize: 14,
2598
- fontWeight: 500,
2599
- lineHeight: 1.43,
2600
- textColor: u("textPrimary")
2594
+ ...T.tooltipRow,
2595
+ textColor: u("textSecondary")
2601
2596
  }),
2602
2597
  d.tooltip.primaryRow({ background: u("tooltipPrimaryRow") }),
2603
- d.headline({ gap: Cr }),
2598
+ d.headline({ gap: Lr }),
2604
2599
  d.headlineItem.number({
2605
2600
  fontSize: 26,
2606
- fontWeight: 900,
2601
+ fontWeight: 700,
2607
2602
  lineHeight: 1.3,
2608
2603
  textColor: u("textPrimary")
2609
2604
  }),
@@ -2622,16 +2617,11 @@ var C = (e) => {
2622
2617
  d.headlineItem.trend.flat({ textColor: u("trendNeutral") }),
2623
2618
  d.legend({ gap: Or }),
2624
2619
  d.legendItem({
2625
- fontSize: 12,
2626
- fontWeight: 500,
2627
- lineHeight: 1.3,
2628
- textColor: u("textPrimary"),
2629
- background: u("graphBackground"),
2630
- borderColor: u("legendBorderColor"),
2631
- borderWidth: 1,
2632
- borderRadius: 9999,
2633
- paddingInline: 8,
2634
- paddingBlock: 2
2620
+ ...T.label,
2621
+ textColor: u("textSecondary"),
2622
+ borderWidth: 0,
2623
+ paddingInline: 2,
2624
+ paddingBlock: 4
2635
2625
  }),
2636
2626
  d.legendItem.swatch({
2637
2627
  size: 12,
@@ -2646,25 +2636,23 @@ var C = (e) => {
2646
2636
  lineType: "dashed"
2647
2637
  }),
2648
2638
  d.annotation.shape({
2649
- color: u("annotationShapeColor"),
2639
+ color: u("annotationShape"),
2650
2640
  alpha: 0.25,
2651
2641
  borderWidth: 1
2652
2642
  }),
2653
2643
  d.annotation.arrow({
2654
- color: u("annotationArrowColor"),
2644
+ color: u("annotationArrow"),
2655
2645
  strokeWidth: 4,
2656
2646
  lineType: "solid",
2657
2647
  borderWidth: 0,
2658
2648
  shadow: "none"
2659
2649
  }),
2660
2650
  d.annotation.differenceArrow({
2661
- color: u("annotationArrowColor"),
2651
+ color: u("annotationArrow"),
2662
2652
  strokeWidth: 2
2663
2653
  }),
2664
2654
  d.annotation.differenceArrow.label({
2665
- fontSize: 12,
2666
- fontWeight: 500,
2667
- lineHeight: 1,
2655
+ ...T.label,
2668
2656
  textColor: u("textPrimary"),
2669
2657
  background: u("graphBackground"),
2670
2658
  borderWidth: 1,
@@ -2688,29 +2676,29 @@ var C = (e) => {
2688
2676
  alpha: 1,
2689
2677
  borderRadius: 0
2690
2678
  }),
2691
- d.annotation.pinnedNumber(fe),
2692
- d.annotation.pinnedNumber.label(ge),
2693
- d.annotation.comment(fe),
2694
- d.annotation.comment.label(ge)
2679
+ d.annotation.pinnedNumber(ge),
2680
+ d.annotation.pinnedNumber.label(me),
2681
+ d.annotation.comment(ge),
2682
+ d.annotation.comment.label(me)
2695
2683
  ];
2696
- for (const e of He) {
2684
+ for (const e of Ge) {
2697
2685
  Object.freeze(e.select);
2698
2686
  for (const t of Object.values(e.declarations)) typeof t == "object" && Object.freeze(t);
2699
2687
  Object.freeze(e.declarations), e.when !== void 0 && Object.freeze(e.when), Object.freeze(e);
2700
2688
  }
2701
- var nn = Object.freeze({
2702
- tokens: Object.freeze(Nr),
2703
- defaults: Object.freeze(He),
2689
+ var rn = Object.freeze({
2690
+ tokens: Object.freeze(kr),
2691
+ defaults: Object.freeze(Ge),
2704
2692
  overrides: Object.freeze([])
2705
- }), Ir = [
2693
+ }), Sr = [
2706
2694
  "grouped-bars",
2707
2695
  "stacked-bars",
2708
2696
  "lines"
2709
- ], Rr = {
2697
+ ], Nr = {
2710
2698
  "grouped-bars": "dodge",
2711
2699
  "stacked-bars": "stack",
2712
2700
  lines: null
2713
- }, on = (e) => e === "identity" ? "grouped-bars" : Ir.find((t) => Rr[t] === e) ?? null, sn = {
2701
+ }, an = (e) => e === "identity" ? "grouped-bars" : Sr.find((t) => Nr[t] === e) ?? null, nn = {
2714
2702
  cartesian: (e = {}) => ({
2715
2703
  type: "coord",
2716
2704
  coordType: "cartesian",
@@ -2726,11 +2714,11 @@ var nn = Object.freeze({
2726
2714
  coordType: "polar",
2727
2715
  params: e
2728
2716
  })
2729
- }, ln = {
2730
- x: Object.assign((e) => X("x", e), {
2717
+ }, sn = {
2718
+ x: Object.assign((e) => q("x", e), {
2731
2719
  continuous: (e) => b("x", e),
2732
- discrete: (e) => _("x", e),
2733
- datetime: (e) => K("x", e),
2720
+ discrete: (e) => D("x", e),
2721
+ datetime: (e) => X("x", e),
2734
2722
  log: (e) => b("x", {
2735
2723
  ...e,
2736
2724
  transform: "log"
@@ -2740,10 +2728,10 @@ var nn = Object.freeze({
2740
2728
  transform: "sqrt"
2741
2729
  })
2742
2730
  }),
2743
- y: Object.assign((e) => X("y", e), {
2731
+ y: Object.assign((e) => q("y", e), {
2744
2732
  continuous: (e) => b("y", e),
2745
- discrete: (e) => _("y", e),
2746
- datetime: (e) => K("y", e),
2733
+ discrete: (e) => D("y", e),
2734
+ datetime: (e) => X("y", e),
2747
2735
  log: (e) => b("y", {
2748
2736
  ...e,
2749
2737
  transform: "log"
@@ -2753,10 +2741,10 @@ var nn = Object.freeze({
2753
2741
  transform: "sqrt"
2754
2742
  })
2755
2743
  }),
2756
- ySecondary: Object.assign((e) => X("ySecondary", e), {
2744
+ ySecondary: Object.assign((e) => q("ySecondary", e), {
2757
2745
  continuous: (e) => b("ySecondary", e),
2758
- discrete: (e) => _("ySecondary", e),
2759
- datetime: (e) => K("ySecondary", e),
2746
+ discrete: (e) => D("ySecondary", e),
2747
+ datetime: (e) => X("ySecondary", e),
2760
2748
  log: (e) => b("ySecondary", {
2761
2749
  ...e,
2762
2750
  transform: "log"
@@ -2768,36 +2756,36 @@ var nn = Object.freeze({
2768
2756
  }),
2769
2757
  color: {
2770
2758
  continuous: (e) => b("color", e),
2771
- discrete: (e) => _("color", e),
2759
+ discrete: (e) => D("color", e),
2772
2760
  palette: (e) => gr("color", e)
2773
2761
  },
2774
2762
  size: {
2775
2763
  continuous: (e) => b("size", e),
2776
- discrete: (e) => _("size", e),
2777
- identity: (e) => j("size", e)
2764
+ discrete: (e) => D("size", e),
2765
+ identity: (e) => z("size", e)
2778
2766
  },
2779
2767
  alpha: {
2780
2768
  continuous: (e) => b("alpha", e),
2781
- discrete: (e) => _("alpha", e),
2782
- identity: (e) => j("alpha", e)
2769
+ discrete: (e) => D("alpha", e),
2770
+ identity: (e) => z("alpha", e)
2783
2771
  },
2784
2772
  strokeWidth: {
2785
2773
  continuous: (e) => b("strokeWidth", e),
2786
- discrete: (e) => _("strokeWidth", e),
2787
- identity: (e) => j("strokeWidth", e)
2774
+ discrete: (e) => D("strokeWidth", e),
2775
+ identity: (e) => z("strokeWidth", e)
2788
2776
  },
2789
2777
  lineType: {
2790
- discrete: (e) => _("lineType", e),
2791
- identity: (e) => j("lineType", e)
2792
- }
2793
- }, cn = {
2794
- identity: Br,
2795
- count: Vr,
2796
- smooth: xr,
2797
- mean: Pr,
2798
- sum: jr
2778
+ discrete: (e) => D("lineType", e),
2779
+ identity: (e) => z("lineType", e)
2780
+ }
2781
+ }, on = {
2782
+ identity: Cr,
2783
+ count: Ir,
2784
+ smooth: Rr,
2785
+ mean: xr,
2786
+ sum: Br
2799
2787
  };
2800
- function xr(e) {
2788
+ function Rr(e) {
2801
2789
  return {
2802
2790
  type: "smooth",
2803
2791
  method: e.method,
@@ -2805,61 +2793,61 @@ function xr(e) {
2805
2793
  bandwidth: e.bandwidth
2806
2794
  };
2807
2795
  }
2808
- function Br() {
2796
+ function Cr() {
2809
2797
  return { type: "identity" };
2810
2798
  }
2811
- function Vr() {
2799
+ function Ir() {
2812
2800
  return { type: "count" };
2813
2801
  }
2814
- function Pr() {
2802
+ function xr() {
2815
2803
  return { type: "mean" };
2816
2804
  }
2817
- function jr() {
2805
+ function Br() {
2818
2806
  return { type: "sum" };
2819
2807
  }
2820
- var dn = {
2821
- reshape: Wr,
2822
- filter: Ur,
2823
- sort: zr,
2824
- aggregate: Yr,
2825
- constant: $r
2808
+ var ln = {
2809
+ reshape: Vr,
2810
+ filter: jr,
2811
+ sort: Pr,
2812
+ aggregate: zr,
2813
+ constant: Ur
2826
2814
  };
2827
- function Wr(e = {}) {
2815
+ function Vr(e = {}) {
2828
2816
  return {
2829
2817
  type: "transform",
2830
2818
  transformType: "reshape",
2831
2819
  options: e
2832
2820
  };
2833
2821
  }
2834
- function Ur(e) {
2822
+ function jr(e) {
2835
2823
  return {
2836
2824
  type: "transform",
2837
2825
  transformType: "filter",
2838
2826
  options: e
2839
2827
  };
2840
2828
  }
2841
- function zr(e) {
2829
+ function Pr(e) {
2842
2830
  return {
2843
2831
  type: "transform",
2844
2832
  transformType: "sort",
2845
2833
  options: e
2846
2834
  };
2847
2835
  }
2848
- function Yr(e) {
2836
+ function zr(e) {
2849
2837
  return {
2850
2838
  type: "transform",
2851
2839
  transformType: "aggregate",
2852
2840
  options: e
2853
2841
  };
2854
2842
  }
2855
- function $r(e) {
2843
+ function Ur(e) {
2856
2844
  return {
2857
2845
  type: "transform",
2858
2846
  transformType: "constant",
2859
2847
  options: e
2860
2848
  };
2861
2849
  }
2862
- function Hr(e) {
2850
+ function Wr(e) {
2863
2851
  const t = e.layout?.gaps;
2864
2852
  if (t === void 0) return e;
2865
2853
  const r = {};
@@ -2875,129 +2863,130 @@ function Hr(e) {
2875
2863
  }
2876
2864
  };
2877
2865
  }
2878
- function un(e) {
2866
+ function cn(e) {
2879
2867
  return {
2880
2868
  type: "config",
2881
- config: Hr(e)
2869
+ config: Wr(e)
2882
2870
  };
2883
2871
  }
2884
2872
  export {
2885
2873
  Da as $,
2886
- aa as $t,
2887
- u as A,
2888
- da as At,
2889
- b as B,
2890
- ot as Bt,
2874
+ rt as $t,
2875
+ Qa as A,
2876
+ oa as At,
2877
+ X as B,
2878
+ sa as Bt,
2891
2879
  $a as C,
2892
- O as Ct,
2893
- Za as D,
2894
- lt as Dt,
2895
- Ja as E,
2896
- ct as Et,
2897
- gr as F,
2898
- A as Ft,
2899
- ja as G,
2900
- pe as Gt,
2901
- Pa as H,
2902
- oa as Ht,
2903
- X as I,
2904
- W as It,
2905
- Oa as J,
2906
- et as Jt,
2907
- Na as K,
2908
- Ze as Kt,
2909
- j as L,
2910
- Ae as Lt,
2911
- I as M,
2912
- it as Mt,
2913
- Wa as N,
2914
- U as Nt,
2915
- d as O,
2916
- st as Ot,
2917
- Ua as P,
2918
- ua as Pt,
2919
- Sa as Q,
2920
- rt as Qt,
2921
- _ as R,
2922
- ve as Rt,
2923
- Ka as S,
2924
- pa as St,
2925
- Ha as T,
2926
- fa as Tt,
2927
- Ba as U,
2928
- sa as Ut,
2929
- xa as V,
2930
- be as Vt,
2880
+ ya as Ct,
2881
+ Xa as D,
2882
+ ct as Dt,
2883
+ Wa as E,
2884
+ ca as Et,
2885
+ ja as F,
2886
+ la as Ft,
2887
+ La as G,
2888
+ na as Gt,
2889
+ Ra as H,
2890
+ Ae as Ht,
2891
+ gr as I,
2892
+ A as It,
2893
+ Sa as J,
2894
+ Qr as Jt,
2895
+ Ba as K,
2896
+ be as Kt,
2897
+ q as L,
2898
+ U as Lt,
2899
+ mr as M,
2900
+ Te as Mt,
2901
+ I as N,
2902
+ it as Nt,
2903
+ qa as O,
2904
+ lt as Ot,
2905
+ Va as P,
2906
+ W as Pt,
2907
+ Fa as Q,
2908
+ ve as Qt,
2909
+ z as R,
2910
+ Me as Rt,
2911
+ Ya as S,
2912
+ da as St,
2913
+ Ka as T,
2914
+ Ot as Tt,
2915
+ xa as U,
2916
+ ra as Ut,
2917
+ b as V,
2918
+ st as Vt,
2931
2919
  Ca as W,
2932
- ia as Wt,
2933
- Va as X,
2934
- tt as Xt,
2935
- Ra as Y,
2936
- at as Yt,
2937
- ka as Z,
2938
- he as Zt,
2939
- qa as _,
2940
- Rt as _t,
2941
- sn as a,
2942
- Je as an,
2943
- Ye as at,
2920
+ aa as Wt,
2921
+ Na as X,
2922
+ at as Xt,
2923
+ Oa as Y,
2924
+ et as Yt,
2925
+ Ia as Z,
2926
+ tt as Zt,
2927
+ Za as _,
2928
+ J as _t,
2929
+ nn as a,
2930
+ Xr as an,
2931
+ Ea as at,
2944
2932
  za as b,
2945
- ya as bt,
2946
- on as c,
2947
- ye as cn,
2948
- Ea as ct,
2949
- Mr as d,
2950
- Xt as dt,
2951
- na as en,
2952
- La as et,
2953
- Er as f,
2954
- Ht as ft,
2955
- rn as g,
2956
- Q as gt,
2957
- an as h,
2958
- ha as ht,
2959
- ln as i,
2960
- Jr as in,
2961
- Fa as it,
2962
- yr as j,
2963
- Ee as jt,
2964
- en as k,
2965
- ca as kt,
2966
- nn as l,
2967
- Xr as ln,
2968
- va as lt,
2969
- Fr as m,
2970
- Z as mt,
2971
- dn as n,
2972
- ra as nn,
2973
- wa as nt,
2974
- Rr as o,
2975
- q as on,
2976
- Ma as ot,
2977
- Tr as p,
2978
- zt as pt,
2979
- Ia as q,
2980
- ea as qt,
2981
- cn as r,
2933
+ fa as bt,
2934
+ an as c,
2935
+ Kr as cn,
2936
+ ha as ct,
2937
+ Tr as d,
2938
+ Hr as dn,
2939
+ ma as dt,
2940
+ ea as en,
2941
+ _a as et,
2942
+ Mr as f,
2943
+ Xt as ft,
2944
+ en as g,
2945
+ ga as gt,
2946
+ Fr as h,
2947
+ ee as ht,
2948
+ sn as i,
2949
+ qr as in,
2950
+ Ta as it,
2951
+ u as j,
2952
+ ia as jt,
2953
+ d as k,
2954
+ ot as kt,
2955
+ rn as l,
2956
+ pe as ln,
2957
+ ba as lt,
2958
+ tn as m,
2959
+ Wt as mt,
2960
+ ln as n,
2961
+ m as nn,
2962
+ Aa as nt,
2963
+ Nr as o,
2964
+ Je as on,
2965
+ or as ot,
2966
+ wr as p,
2967
+ Gt as pt,
2968
+ ka as q,
2969
+ Ze as qt,
2970
+ on as r,
2982
2971
  Zr as rn,
2983
- _a as rt,
2984
- Ir as s,
2985
- Qr as sn,
2986
- Aa as st,
2987
- un as t,
2988
- m as tn,
2989
- Ta as tt,
2990
- tn as u,
2991
- qr as un,
2992
- ba as ut,
2993
- Xa as v,
2972
+ Ma as rt,
2973
+ Sr as s,
2974
+ Q as sn,
2975
+ va as st,
2976
+ cn as t,
2977
+ ta as tn,
2978
+ wa as tt,
2979
+ Ja as u,
2980
+ Gr as un,
2981
+ pa as ut,
2982
+ Ha as v,
2994
2983
  It as vt,
2995
- Qa as w,
2996
- Dt as wt,
2997
- Ga as x,
2998
- ga as xt,
2999
- Ya as y,
3000
- ma as yt,
3001
- K as z,
3002
- la as zt
2984
+ Ua as w,
2985
+ R as wt,
2986
+ Pa as x,
2987
+ ua as xt,
2988
+ Ga as y,
2989
+ Ct as yt,
2990
+ D as z,
2991
+ Ee as zt
3003
2992
  };