@lilt-ui/charts 0.7.0 → 0.7.1

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.
@@ -3758,30 +3758,53 @@ function hr(e, t, n, r, i, { label: a, release: o } = {}) {
3758
3758
  ]);
3759
3759
  }
3760
3760
  //#endregion
3761
+ //#region src/use-chart-width.ts
3762
+ function gr(e) {
3763
+ let t = e.getBoundingClientRect(), n = (e, t) => e > 0 && Math.abs(e - t) > 1;
3764
+ return {
3765
+ width: n(e.offsetWidth, t.width) ? e.offsetWidth : t.width,
3766
+ height: n(e.offsetHeight, t.height) ? e.offsetHeight : t.height
3767
+ };
3768
+ }
3769
+ function _r() {
3770
+ let e = O(null), [t, n] = k(0);
3771
+ return E(() => {
3772
+ let t = e.current;
3773
+ if (!t) return;
3774
+ let r = () => n(gr(t).width);
3775
+ r();
3776
+ let i = new ResizeObserver(r);
3777
+ return i.observe(t), () => i.disconnect();
3778
+ }, []), {
3779
+ ref: e,
3780
+ width: t
3781
+ };
3782
+ }
3783
+ //#endregion
3761
3784
  //#region src/chart.tsx
3762
- var gr = 14, _r = {}, vr = [], yr = {
3785
+ var vr = 14, yr = {}, br = [], xr = {
3763
3786
  inspection: null,
3764
3787
  comparison: null,
3765
3788
  focus: null
3766
- }, br = () => () => void 0, xr = () => yr;
3767
- function Sr(e) {
3789
+ }, Sr = () => () => void 0, Cr = () => xr;
3790
+ function wr(e) {
3768
3791
  return {
3769
3792
  ...zt,
3770
3793
  ...e
3771
3794
  };
3772
3795
  }
3773
- function Cr(e, t) {
3796
+ function Tr(e, t) {
3774
3797
  let n = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]);
3775
3798
  for (let r of n) if ((e?.[r] ?? null) !== (t?.[r] ?? null)) return !1;
3776
3799
  return !0;
3777
3800
  }
3778
- function wr(e, t) {
3801
+ function Er(e, t) {
3779
3802
  return !e || !t || e.rows.length !== t.rows.length || e.series.length !== t.series.length || e.series.some((e, n) => e.id !== t.series[n]?.id) ? !1 : e.rows.every((n, r) => {
3780
3803
  let i = t.rows[r];
3781
- return !!(i && n.x === i.x && n.categoryId === i.categoryId && e.series.every((e) => n.values[e.id] === i.values[e.id] && n.statuses[e.id] === i.statuses[e.id] && Cr(n.fields[e.id], i.fields[e.id])));
3804
+ return !!(i && n.x === i.x && n.categoryId === i.categoryId && e.series.every((e) => n.values[e.id] === i.values[e.id] && n.statuses[e.id] === i.statuses[e.id] && Tr(n.fields[e.id], i.fields[e.id])));
3782
3805
  });
3783
3806
  }
3784
- function Tr(e, t, n) {
3807
+ function Dr(e, t, n) {
3785
3808
  return n >= 1 ? t : {
3786
3809
  ...t,
3787
3810
  rows: t.rows.map((r, i) => {
@@ -3796,10 +3819,10 @@ function Tr(e, t, n) {
3796
3819
  })
3797
3820
  };
3798
3821
  }
3799
- function Er(e) {
3822
+ function Or(e) {
3800
3823
  return 1 - (1 - e) ** 4;
3801
3824
  }
3802
- function Dr(e, t, n = !1) {
3825
+ function kr(e, t, n = !1) {
3803
3826
  let [r, i] = k({
3804
3827
  width: 0,
3805
3828
  height: t
@@ -3808,7 +3831,7 @@ function Dr(e, t, n = !1) {
3808
3831
  let r = e.current;
3809
3832
  if (!r) return;
3810
3833
  let a = () => {
3811
- let e = r.getBoundingClientRect();
3834
+ let e = gr(r);
3812
3835
  i((r) => {
3813
3836
  let i = {
3814
3837
  width: e.width > 0 ? e.width : r.width,
@@ -3826,7 +3849,7 @@ function Dr(e, t, n = !1) {
3826
3849
  e
3827
3850
  ]), r;
3828
3851
  }
3829
- function Or(e, t, n, r) {
3852
+ function Ar(e, t, n, r) {
3830
3853
  return D(() => {
3831
3854
  try {
3832
3855
  let i = je(e, t, n);
@@ -3847,7 +3870,7 @@ function Or(e, t, n, r) {
3847
3870
  r
3848
3871
  ]);
3849
3872
  }
3850
- function kr(e, t, n, r, i, a, o, s, c, l = Bt, u, d = {}, f = 0, p = !0) {
3873
+ function jr(e, t, n, r, i, a, o, s, c, l = Bt, u, d = {}, f = 0, p = !0) {
3851
3874
  if (!e || e.rows.length === 0 || !Me(e)) return null;
3852
3875
  try {
3853
3876
  return q(e, t, n, r, i, a.width, a.height, o, s, c, l, u, d, f, p);
@@ -3855,7 +3878,7 @@ function kr(e, t, n, r, i, a, o, s, c, l = Bt, u, d = {}, f = 0, p = !0) {
3855
3878
  return null;
3856
3879
  }
3857
3880
  }
3858
- function Ar(e, t, n) {
3881
+ function Mr(e, t, n) {
3859
3882
  return {
3860
3883
  snapshot: e,
3861
3884
  previousSnapshot: t,
@@ -3879,17 +3902,17 @@ function Ar(e, t, n) {
3879
3902
  visibleSeries: n.visibleSeries
3880
3903
  };
3881
3904
  }
3882
- function jr(e) {
3905
+ function Nr(e) {
3883
3906
  return e.replace(/[^a-zA-Z0-9_-]/g, "-");
3884
3907
  }
3885
- function Mr(e, t, n) {
3908
+ function Pr(e, t, n) {
3886
3909
  let r = e.accessor(t);
3887
3910
  return r === null ? "No data" : e.formatValue?.(r) ?? n(r);
3888
3911
  }
3889
- function Nr(e, t) {
3912
+ function Fr(e, t) {
3890
3913
  return e.data.rows.findIndex((e) => e.sourceIndex === t);
3891
3914
  }
3892
- function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeight: o, margins: s, arrangement: c = Bt, marks: l = vr, barLayout: u, compact: d = !1, tooltipNode: f, inspectionSeries: p, className: m, style: h, "aria-label": g, children: _, status: v = "ready", loadingStyle: y, interactive: b = !0, error: x, renderRetry: C, motion: N = "auto", animateIn: ne = !0, resetKey: ie, onSelectionChange: F, controller: I, linkedSelection: ae = "exact", selectedCategoryId: oe, onSelectedCategoryIdChange: L, compare: se = !1, focus: ce = !1, live: R = !1, brush: le = !1, visibleSeries: ue, onVisibleSeriesChange: de, toolkit: fe, model: z, controllerLinked: pe = !1, axis: B = "minimal", pill: me = "soft", pillSeries: he = "nearest", pillValue: ge = "series", pillPosition: _e = "auto", axisInset: ve = 0, decimate: ye = !0, runoff: be = !1, labelOverhang: xe = 0 }) {
3915
+ function Ir({ data: e, x: n, y: r = yr, series: i, height: a = 340, compactHeight: o, margins: s, arrangement: c = Bt, marks: l = br, barLayout: u, compact: d = !1, tooltipNode: f, inspectionSeries: p, className: m, style: h, "aria-label": g, children: _, status: v = "ready", loadingStyle: y, interactive: b = !0, error: x, renderRetry: C, motion: N = "auto", animateIn: ne = !0, resetKey: ie, onSelectionChange: F, controller: I, linkedSelection: ae = "exact", selectedCategoryId: oe, onSelectedCategoryIdChange: L, compare: se = !1, focus: ce = !1, live: R = !1, brush: le = !1, visibleSeries: ue, onVisibleSeriesChange: de, toolkit: fe, model: z, controllerLinked: pe = !1, axis: B = "minimal", pill: me = "soft", pillSeries: he = "nearest", pillValue: ge = "series", pillPosition: _e = "auto", axisInset: ve = 0, decimate: ye = !0, runoff: be = !1, labelOverhang: xe = 0 }) {
3893
3916
  let Se = me || "soft", Ce = JSON.stringify(B), we = D(() => st(B), [Ce]), Te = re(0), Ee = re(0), De = re(0), Oe = re(0), ke = D(() => ({
3894
3917
  x: Te,
3895
3918
  pointerX: Ee,
@@ -3912,7 +3935,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
3912
3935
  Se,
3913
3936
  Ee,
3914
3937
  be
3915
- ]), Ae = O(null), je = O(null), Pe = O(null), Re = D(() => Sr(s), [
3938
+ ]), Ae = O(null), je = O(null), Pe = O(null), Re = D(() => wr(s), [
3916
3939
  s?.top,
3917
3940
  s?.right,
3918
3941
  s?.bottom,
@@ -3925,7 +3948,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
3925
3948
  u?.width,
3926
3949
  u?.gap,
3927
3950
  u?.segmentGap
3928
- ]), He = a === "fill", Ue = a === "fill" ? 340 : a, We = Dr(Ae, Ue, He), Ge = We.width > 0 && We.width < 420, Ke = We.width > 0 && We.width < 240, V = D(() => ({
3951
+ ]), He = a === "fill", Ue = a === "fill" ? 340 : a, We = kr(Ae, Ue, He), Ge = We.width > 0 && We.width < 420, Ke = We.width > 0 && We.width < 240, V = D(() => ({
3929
3952
  width: We.width,
3930
3953
  height: He ? We.height : Ge && o ? o : Ue
3931
3954
  }), [
@@ -3949,7 +3972,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
3949
3972
  ...Re,
3950
3973
  left: Ge ? Math.min(65, Re.left) : Re.left,
3951
3974
  right: Ge ? Math.min(44, Re.right) : Re.right
3952
- }), [Re, Ge]), H = t(N), Ye = Or(e, i, n, c.stack), U = Ye.value, Xe = U !== null && U.rows.length > 0 && Me(U), W = jr(T()), $e = `${W}-reveal`, et = `${W}-grid-fade`, tt = S((e, t) => {
3975
+ }), [Re, Ge]), H = t(N), Ye = Ar(e, i, n, c.stack), U = Ye.value, Xe = U !== null && U.rows.length > 0 && Me(U), W = Nr(T()), $e = `${W}-reveal`, et = `${W}-grid-fade`, tt = S((e, t) => {
3953
3976
  let n = i.findIndex((t) => t.id === e);
3954
3977
  return Le(W, n, t);
3955
3978
  }, [W, i]), nt = `${W}-highlight-mask`, rt = `${W}-cross-fade`, at = O(nn()), ot = O(-Infinity), lt = v === "ready" && Xe, ut = O(void 0);
@@ -3966,7 +3989,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
3966
3989
  }, 750);
3967
3990
  }, []), Ft = O(null), It = O(null), Lt = `${W}-owner`;
3968
3991
  w(() => () => I?.releaseOwner(Lt), [Lt, I]);
3969
- let Rt = ee(I?.subscribe ?? br, I?.getSnapshot ?? xr, I?.getSnapshot ?? xr), zt = D(() => se === !0 ? {} : se || {}, [se]), Vt = D(() => ce === !0 ? {} : ce || {}, [ce]), Ut = D(() => R === !0 ? {} : R || {}, [R]), K = !!se, Wt = !!(ce || le), Gt = !!R, [Kt, qt] = k(() => z?.getSnapshot().visibleSeries ?? i.map((e) => e.id)), Jt = O(i.map((e) => e.id));
3992
+ let Rt = ee(I?.subscribe ?? Sr, I?.getSnapshot ?? Cr, I?.getSnapshot ?? Cr), zt = D(() => se === !0 ? {} : se || {}, [se]), Vt = D(() => ce === !0 ? {} : ce || {}, [ce]), Ut = D(() => R === !0 ? {} : R || {}, [R]), K = !!se, Wt = !!(ce || le), Gt = !!R, [Kt, qt] = k(() => z?.getSnapshot().visibleSeries ?? i.map((e) => e.id)), Jt = O(i.map((e) => e.id));
3970
3993
  w(() => {
3971
3994
  if (ue) return;
3972
3995
  let e = i.map((e) => e.id), t = Jt.current;
@@ -4038,7 +4061,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4038
4061
  Gn(U, Ct.current ? "handoff" : "initial", null), St(!1);
4039
4062
  return;
4040
4063
  }
4041
- if (wr(mt.current, U)) {
4064
+ if (Er(mt.current, U)) {
4042
4065
  mt.current !== U && (mt.current = U, pt(U));
4043
4066
  return;
4044
4067
  }
@@ -4081,7 +4104,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4081
4104
  H,
4082
4105
  G
4083
4106
  ]);
4084
- let X = ft ?? (v === "ready" && Xe ? U : null), qn = Er(gt), Jn = D(() => G?.kind === "matched-update" && G.from ? Tr(G.from, G.to, qn) : X, [
4107
+ let X = ft ?? (v === "ready" && Xe ? U : null), qn = Or(gt), Jn = D(() => G?.kind === "matched-update" && G.from ? Dr(G.from, G.to, qn) : X, [
4085
4108
  X,
4086
4109
  G,
4087
4110
  qn
@@ -4089,7 +4112,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4089
4112
  On,
4090
4113
  jn,
4091
4114
  Gt
4092
- ]), Xn = D(() => kr(G?.from ?? null, q, n, r, Je, V, G?.fromDomain, Yn, i, c, en, Ve, ve, ye), [
4115
+ ]), Xn = D(() => jr(G?.from ?? null, q, n, r, Je, V, G?.fromDomain, Yn, i, c, en, Ve, ve, ye), [
4093
4116
  q,
4094
4117
  Je,
4095
4118
  i,
@@ -4104,7 +4127,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4104
4127
  Ve,
4105
4128
  ve,
4106
4129
  ye
4107
- ]), Zn = D(() => kr(X, q, n, r, Je, V, void 0, Yn, i, c, en, Ve, ve, ye), [
4130
+ ]), Zn = D(() => jr(X, q, n, r, Je, V, void 0, Yn, i, c, en, Ve, ve, ye), [
4108
4131
  X,
4109
4132
  q,
4110
4133
  n,
@@ -4124,7 +4147,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4124
4147
  } : null, On ? `${On.startX}:${On.endX}` : "full", X, `${V.width}:${V.height}`, H), Z = D(() => {
4125
4148
  if (G?.kind !== "matched-update" && !Qn) return Zn;
4126
4149
  let e = Qn?.y ?? (Xn?.yDomain && Zn?.yDomain ? [Xn.yDomain[0] + (Zn.yDomain[0] - Xn.yDomain[0]) * qn, Xn.yDomain[1] + (Zn.yDomain[1] - Xn.yDomain[1]) * qn] : void 0);
4127
- return kr(Jn, q, n, r, Je, V, e, Qn?.x ?? Yn, i, c, en, Ve, ve, ye);
4150
+ return jr(Jn, q, n, r, Je, V, e, Qn?.x ?? Yn, i, c, en, Ve, ve, ye);
4128
4151
  }, [
4129
4152
  q,
4130
4153
  Zn,
@@ -4144,7 +4167,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4144
4167
  Ve,
4145
4168
  ve,
4146
4169
  ye
4147
- ]), er = D(() => Yn === null ? Zn : kr(X, q, n, r, Je, V, void 0, void 0, i, c, en, Ve, ve, ye), [
4170
+ ]), er = D(() => Yn === null ? Zn : jr(X, q, n, r, Je, V, void 0, void 0, i, c, en, Ve, ve, ye), [
4148
4171
  q,
4149
4172
  X,
4150
4173
  Zn,
@@ -4266,14 +4289,14 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4266
4289
  Z,
4267
4290
  n.type
4268
4291
  ]);
4269
- let yr = S((e, t = !1) => {
4292
+ let gr = S((e, t = !1) => {
4270
4293
  let n = Z, r = je.current;
4271
4294
  if (!n || !r || !n.data.rows.length) return null;
4272
4295
  let i = Pe.current ?? r.getBoundingClientRect();
4273
4296
  if (Pe.current = i, !i.width || !i.height) return null;
4274
4297
  let a = (e.clientX - i.left) / i.width * V.width;
4275
4298
  return !t && (a < n.plot.left - 8 || a > n.plot.right + 8) ? null : or(n.data.rows, n.xDomain, a, n.xToPixel);
4276
- }, [V.width, Z]), Cr = S((e) => {
4299
+ }, [V.width, Z]), _r = S((e) => {
4277
4300
  let t = Z?.data.rows[e];
4278
4301
  if (!Z || !t) return [];
4279
4302
  if (c.bars) {
@@ -4312,14 +4335,14 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4312
4335
  q,
4313
4336
  c,
4314
4337
  Z
4315
- ]), Pr = S((e, t, n) => {
4338
+ ]), xr = S((e, t, n) => {
4316
4339
  if (he !== "nearest" || q.length < 2) return;
4317
4340
  let r = je.current?.getBoundingClientRect();
4318
4341
  if (!r?.height || !r.width) return;
4319
4342
  Pe.current = r;
4320
- let i = (t - r.left) / r.width * V.width, a = (n - r.top) / r.height * V.height, o = Cr(e);
4343
+ let i = (t - r.left) / r.width * V.width, a = (n - r.top) / r.height * V.height, o = _r(e);
4321
4344
  if (!o.length) return;
4322
- let s = !(!c.bars || c.stack), l = s ? o.filter((e) => e.line && Math.abs(e.y - a) <= gr).sort((e, t) => Math.abs(e.y - a) - Math.abs(t.y - a))[0] : void 0, u = s ? l ? [l] : o.filter((e) => !e.line) : o;
4345
+ let s = !(!c.bars || c.stack), l = s ? o.filter((e) => e.line && Math.abs(e.y - a) <= vr).sort((e, t) => Math.abs(e.y - a) - Math.abs(t.y - a))[0] : void 0, u = s ? l ? [l] : o.filter((e) => !e.line) : o;
4323
4346
  if (!u.length) return;
4324
4347
  let d = u.map((e) => ({
4325
4348
  id: e.id,
@@ -4330,30 +4353,30 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4330
4353
  q.length,
4331
4354
  c,
4332
4355
  he,
4333
- Cr,
4356
+ _r,
4334
4357
  V.height,
4335
4358
  V.width
4336
- ]), Fr = S((e) => {
4359
+ ]), Tr = S((e) => {
4337
4360
  if (!(K && Y && !jt.current)) {
4338
4361
  if (Q.current?.pinned && e.pointerType !== "touch") {
4339
- Z && Pr(Nr(Z, Q.current.sourceIndex), e.clientX, e.clientY);
4362
+ Z && xr(Fr(Z, Q.current.sourceIndex), e.clientX, e.clientY);
4340
4363
  return;
4341
4364
  }
4342
4365
  kt.current = e, Ot.current === null && (Ot.current = window.requestAnimationFrame(() => {
4343
4366
  Ot.current = null;
4344
4367
  let e = kt.current;
4345
4368
  if (!e || Q.current?.pinned && e.pointerType !== "touch") return;
4346
- let t = yr(e);
4347
- t !== null && (hr(t, !1), Pr(t, e.clientX, e.clientY));
4369
+ let t = gr(e);
4370
+ t !== null && (hr(t, !1), xr(t, e.clientX, e.clientY));
4348
4371
  }));
4349
4372
  }
4350
4373
  }, [
4351
4374
  K,
4352
4375
  Y,
4353
- yr,
4376
+ gr,
4354
4377
  hr,
4355
4378
  Z,
4356
- Pr
4379
+ xr
4357
4380
  ]), Ir = O(!1);
4358
4381
  w(() => {
4359
4382
  let e = (e) => {
@@ -4492,7 +4515,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4492
4515
  It.current = null;
4493
4516
  let e = jt.current, t = Ft.current;
4494
4517
  if (!t) return;
4495
- let n = yr(t, !0), r = n === null ? void 0 : Z?.data.rows[n]?.x;
4518
+ let n = gr(t, !0), r = n === null ? void 0 : Z?.data.rows[n]?.x;
4496
4519
  if (r !== void 0) {
4497
4520
  if (bn.current) {
4498
4521
  yn((e) => e && e.probeX !== r ? {
@@ -4507,7 +4530,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4507
4530
  });
4508
4531
  }
4509
4532
  }));
4510
- }, [yr, Z]), Gr = S((e, t, n = !1, r = Lr) => {
4533
+ }, [gr, Z]), Gr = S((e, t, n = !1, r = Lr) => {
4511
4534
  zr({
4512
4535
  startX: n ? e : Math.min(e, t),
4513
4536
  endX: n ? t : Math.max(e, t),
@@ -4623,8 +4646,8 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4623
4646
  }, [ei, i]), ai = ["lilt-chart__plot-host", m].filter(Boolean).join(" "), oi = {
4624
4647
  ...h,
4625
4648
  "--lilt-chart-height": `${V.height || a}px`
4626
- }, si = !!(U && U.rows.length > 0 && !Me(U)), ci = yt === "empty" || v === "ready" && !!U && (U?.rows.length === 0 || si), li = Ye.error ?? (v === "error" ? x ?? "Could not load chart data." : null), ui = Kn ? null : G?.kind ?? (zn ? "matched-update" : null), di = Kn ? 0 : G?.duration ?? (zn ? 420 : 0), $ = ne && !H && (ui === "initial" || ui === "handoff"), fi = tn(Z?.plot.left ?? 0, Z?.plot.width ?? V.width, $ ? $t(gt * di, 0, di) : 1), pi = Xn ?? Ln, mi = !!((ui === "topology-update" || zn) && pi && Z), hi = O(/* @__PURE__ */ new Map()), gi = (e, t, a, o, s) => {
4627
- let c = !(!ir || Rr), l = q.some((e) => e.id === ln) ? ln : null, u = $ && !H ? gt : 1, d = [
4649
+ }, si = !!(U && U.rows.length > 0 && !Me(U)), ci = yt === "empty" || v === "ready" && !!U && (U?.rows.length === 0 || si), li = Ye.error ?? (v === "error" ? x ?? "Could not load chart data." : null), ui = Kn ? null : G?.kind ?? (zn ? "matched-update" : null), di = Kn ? 0 : G?.duration ?? (zn ? 420 : 0), fi = ne && !H && (ui === "initial" || ui === "handoff"), pi = tn(Z?.plot.left ?? 0, Z?.plot.width ?? V.width, fi ? $t(gt * di, 0, di) : 1), $ = Xn ?? Ln, mi = !!((ui === "topology-update" || zn) && $ && Z), hi = O(/* @__PURE__ */ new Map()), gi = (e, t, a, o, s) => {
4650
+ let c = !(!ir || Rr), l = q.some((e) => e.id === ln) ? ln : null, u = fi && !H ? gt : 1, d = [
4628
4651
  e,
4629
4652
  t,
4630
4653
  o,
@@ -4645,11 +4668,11 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4645
4668
  l,
4646
4669
  q,
4647
4670
  u,
4648
- $,
4671
+ fi,
4649
4672
  _
4650
4673
  ], f = hi.current.get(a);
4651
4674
  if (f && f.inputs.length === d.length && f.inputs.every((e, t) => Object.is(e, d[t]))) return f.element;
4652
- let p = Ar(e, t, {
4675
+ let p = Mr(e, t, {
4653
4676
  series: i,
4654
4677
  x: n,
4655
4678
  y: r,
@@ -4669,7 +4692,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4669
4692
  }), m = /* @__PURE__ */ j(P.g, {
4670
4693
  animate: { opacity: o ?? 1 },
4671
4694
  className: "lilt-chart__data-layer",
4672
- initial: s === void 0 ? o === void 0 && $ ? !1 : o === void 0 ? void 0 : { opacity: o } : { opacity: s },
4695
+ initial: s === void 0 ? o === void 0 && fi ? !1 : o === void 0 ? void 0 : { opacity: o } : { opacity: s },
4673
4696
  transition: { duration: H ? 0 : ui === "handoff" ? .1 : ui === "topology-update" || ui === "matched-update" ? di / 1e3 : .12 },
4674
4697
  children: /* @__PURE__ */ j(Ht, {
4675
4698
  value: p,
@@ -4680,7 +4703,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4680
4703
  inputs: d,
4681
4704
  element: m
4682
4705
  }), m;
4683
- }, _i = D(() => Z?.data.rows.filter((e) => e.x >= Z.xDomain[0] && e.x <= Z.xDomain[1]), [Z]), vi = _i?.[0], yi = _i?.at(-1), bi = vi && Z ? Nr(Z, vi.sourceIndex) : 0, xi = yi && Z ? Nr(Z, yi.sourceIndex) : 0, Si = ir && Z && ir.x >= Z.xDomain[0] && ir.x <= Z.xDomain[1] ? ir : null, Ci = Si && Z ? Nr(Z, Si.sourceIndex) : xi, wi = q.find((e) => e.id === Lr), Ti = Yt.length === 0, Ei = Si?.row ?? yi?.datum ?? null, Di = Si?.x ?? yi?.x, Oi = Ei && Di !== void 0 && Z ? `${Z.formatX(Di)} · ${q.map((e) => `${e.label} ${Mr(e, Ei, Z.formatValue)}`).join(" · ")}` : Ti ? "No series selected" : "No observation available", ki = Rt.inspection?.ownerId === ur, Ai = !(!Rt.inspection || Rt.inspection.ownerId === Lt || z && Rt.inspection.ownerId === "model"), ji = (J ? {
4706
+ }, _i = D(() => Z?.data.rows.filter((e) => e.x >= Z.xDomain[0] && e.x <= Z.xDomain[1]), [Z]), vi = _i?.[0], yi = _i?.at(-1), bi = vi && Z ? Fr(Z, vi.sourceIndex) : 0, xi = yi && Z ? Fr(Z, yi.sourceIndex) : 0, Si = ir && Z && ir.x >= Z.xDomain[0] && ir.x <= Z.xDomain[1] ? ir : null, Ci = Si && Z ? Fr(Z, Si.sourceIndex) : xi, wi = q.find((e) => e.id === Lr), Ti = Yt.length === 0, Ei = Si?.row ?? yi?.datum ?? null, Di = Si?.x ?? yi?.x, Oi = Ei && Di !== void 0 && Z ? `${Z.formatX(Di)} · ${q.map((e) => `${e.label} ${Pr(e, Ei, Z.formatValue)}`).join(" · ")}` : Ti ? "No series selected" : "No observation available", ki = Rt.inspection?.ownerId === ur, Ai = !(!Rt.inspection || Rt.inspection.ownerId === Lt || z && Rt.inspection.ownerId === "model"), ji = (J ? {
4684
4707
  startX: J.baselineX,
4685
4708
  endX: J.probeX
4686
4709
  } : gn ?? (mn !== null && ir ? {
@@ -4760,11 +4783,11 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4760
4783
  t.button === 0 && Y && (t.preventDefault(), t.stopPropagation(), t.currentTarget.focus(), Vr(e, t.pointerId), t.currentTarget.setPointerCapture(t.pointerId));
4761
4784
  }, Ki = (e, t) => {
4762
4785
  if (Cn.current?.pointerId !== t.pointerId) return;
4763
- let n = yr(t.nativeEvent, !0);
4786
+ let n = gr(t.nativeEvent, !0);
4764
4787
  n !== null && Hr(e, n);
4765
4788
  }, qi = (e, t) => {
4766
4789
  if (Cn.current?.pointerId !== t.pointerId) return;
4767
- let n = yr(t.nativeEvent, !0);
4790
+ let n = gr(t.nativeEvent, !0);
4768
4791
  n !== null && Hr(e, n), Ur();
4769
4792
  }, Ji = (e, t) => {
4770
4793
  if (t.key === "Escape") {
@@ -4827,7 +4850,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4827
4850
  onFocus: () => hr(Ci, ir?.pinned ?? !1),
4828
4851
  onKeyDown: (e) => {
4829
4852
  if (e.key === "Escape" && (e.preventDefault(), Xr()), (e.key === "ArrowUp" || e.key === "ArrowDown") && he === "nearest" && q.length > 1 && !J) {
4830
- let t = Cr(Number(e.currentTarget.value));
4853
+ let t = _r(Number(e.currentTarget.value));
4831
4854
  if (t.length > 1) {
4832
4855
  e.preventDefault();
4833
4856
  let n = t.findIndex((e) => e.id === pn), r = e.key === "ArrowUp" ? -1 : 1, i = Math.min(t.length - 1, Math.max(0, (n < 0 ? 0 : n) + r));
@@ -4908,7 +4931,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
4908
4931
  },
4909
4932
  onReleaseInspect: pr,
4910
4933
  onFocus: (e) => {
4911
- un(e), e && !Q.current?.pinned && !Q.current && yi && Z && hr(Nr(Z, yi.sourceIndex), !1), !e && !Q.current?.pinned && pr();
4934
+ un(e), e && !Q.current?.pinned && !Q.current && yi && Z && hr(Fr(Z, yi.sourceIndex), !1), !e && !Q.current?.pinned && pr();
4912
4935
  },
4913
4936
  onVisibleChange: ti,
4914
4937
  isolatedId: Xt?.id ?? null,
@@ -5069,7 +5092,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5069
5092
  "End"
5070
5093
  ].includes(e.key)) return;
5071
5094
  e.preventDefault();
5072
- let t = Q.current && Z ? Nr(Z, Q.current.sourceIndex) : xi, n = e.key === "Home" ? bi : e.key === "End" ? xi : Math.min(xi, Math.max(bi, t + (e.key === "ArrowRight" ? 1 : -1)));
5095
+ let t = Q.current && Z ? Fr(Z, Q.current.sourceIndex) : xi, n = e.key === "Home" ? bi : e.key === "End" ? xi : Math.min(xi, Math.max(bi, t + (e.key === "ArrowRight" ? 1 : -1)));
5073
5096
  hr(n, !1);
5074
5097
  },
5075
5098
  onClick: (e) => {
@@ -5078,7 +5101,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5078
5101
  Mt.current = !1;
5079
5102
  return;
5080
5103
  }
5081
- let t = yr(e.nativeEvent);
5104
+ let t = gr(e.nativeEvent);
5082
5105
  if (t === null) return;
5083
5106
  let n = Z?.data.rows[t]?.x;
5084
5107
  if (J && n !== void 0) {
@@ -5100,7 +5123,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5100
5123
  onPointerDown: (e) => {
5101
5124
  if (!J) {
5102
5125
  if (K && wi && e.button === 0) {
5103
- let t = yr(e.nativeEvent), n = t === null ? void 0 : Z?.data.rows[t]?.x;
5126
+ let t = gr(e.nativeEvent), n = t === null ? void 0 : Z?.data.rows[t]?.x;
5104
5127
  if (t !== null && n !== void 0) {
5105
5128
  let r = e.target.closest("[data-series]")?.getAttribute("data-series"), i = q.some((e) => e.id === r) ? r : wi.id;
5106
5129
  jt.current = {
@@ -5137,16 +5160,16 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5137
5160
  if (e.pointerType === "touch") {
5138
5161
  let t = At.current;
5139
5162
  if (!t) return;
5140
- !t.moved && Math.abs(e.clientX - t.x) > 8 && (t.moved = !0, e.currentTarget.setPointerCapture?.(e.pointerId)), t.moved && Fr(e.nativeEvent);
5163
+ !t.moved && Math.abs(e.clientX - t.x) > 8 && (t.moved = !0, e.currentTarget.setPointerCapture?.(e.pointerId)), t.moved && Tr(e.nativeEvent);
5141
5164
  return;
5142
5165
  }
5143
- Fr(e.nativeEvent);
5166
+ Tr(e.nativeEvent);
5144
5167
  }
5145
5168
  },
5146
5169
  onPointerUp: (e) => {
5147
5170
  if (J) {
5148
5171
  if (e.pointerType === "touch") {
5149
- let t = yr(e.nativeEvent), n = t === null ? void 0 : Z?.data.rows[t]?.x;
5172
+ let t = gr(e.nativeEvent), n = t === null ? void 0 : Z?.data.rows[t]?.x;
5150
5173
  n !== void 0 && n !== J.baselineX && Gr(J.baselineX, n, !0), Pt();
5151
5174
  }
5152
5175
  return;
@@ -5154,13 +5177,13 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5154
5177
  if (jt.current?.pointerId === e.pointerId) {
5155
5178
  let t = jt.current;
5156
5179
  if (jt.current = null, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), t.moved) {
5157
- let n = yr(e.nativeEvent, !0), r = n === null ? void 0 : Z?.data.rows[n]?.x;
5180
+ let n = gr(e.nativeEvent, !0), r = n === null ? void 0 : Z?.data.rows[n]?.x;
5158
5181
  r !== void 0 && r !== t.startX ? Gr(t.startX, r, !1, t.series) : hr(t.startIndex, !0), _n(null), Pt();
5159
5182
  }
5160
5183
  return;
5161
5184
  }
5162
5185
  if (e.pointerType !== "touch") return;
5163
- let t = yr(e.nativeEvent);
5186
+ let t = gr(e.nativeEvent);
5164
5187
  t !== null && (hr(t, !0, !1, dr.current), Pt()), At.current = null;
5165
5188
  },
5166
5189
  ref: je,
@@ -5181,8 +5204,8 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5181
5204
  /* @__PURE__ */ M("linearGradient", {
5182
5205
  id: `${$e}-edge`,
5183
5206
  gradientUnits: "userSpaceOnUse",
5184
- x1: fi.start,
5185
- x2: fi.end,
5207
+ x1: pi.start,
5208
+ x2: pi.end,
5186
5209
  y1: 0,
5187
5210
  y2: 0,
5188
5211
  children: [/* @__PURE__ */ j("stop", {
@@ -5204,7 +5227,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5204
5227
  children: /* @__PURE__ */ j("rect", {
5205
5228
  width: V.width,
5206
5229
  height: V.height,
5207
- fill: $ ? `url(#${$e}-edge)` : "white"
5230
+ fill: fi ? `url(#${$e}-edge)` : "white"
5208
5231
  })
5209
5232
  }),
5210
5233
  /* @__PURE__ */ M("linearGradient", {
@@ -5244,7 +5267,7 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5244
5267
  chartId: W,
5245
5268
  series: i
5246
5269
  })
5247
- ] }), mi && pi && Z ? /* @__PURE__ */ M(A, { children: [gi(pi, null, `old-${G?.id ?? 0}`, 0, 1), gi(Z, Xn, `new-${G?.id ?? 0}`, 1, 0)] }) : Z ? /* @__PURE__ */ j("g", { children: gi(Z, Xn ?? Ln, "current") }) : null]
5270
+ ] }), mi && $ && Z ? /* @__PURE__ */ M(A, { children: [gi($, null, `old-${G?.id ?? 0}`, 0, 1), gi(Z, Xn, `new-${G?.id ?? 0}`, 1, 0)] }) : Z ? /* @__PURE__ */ j("g", { children: gi(Z, Xn ?? Ln, "current") }) : null]
5248
5271
  }),
5249
5272
  Yi,
5250
5273
  xt || ui === "handoff" ? /* @__PURE__ */ j(P.div, {
@@ -5387,13 +5410,13 @@ function Pr({ data: e, x: n, y: r = _r, series: i, height: a = 340, compactHeigh
5387
5410
  }
5388
5411
  //#endregion
5389
5412
  //#region src/primitives/plot-background.tsx
5390
- var Fr = {
5413
+ var Lr = {
5391
5414
  dots: 12,
5392
5415
  grid: 16,
5393
5416
  lines: 20
5394
- }, Ir = 110;
5395
- function Lr({ kind: e, spotlight: t = !0 }) {
5396
- let n = `lilt-bg-${T().replaceAll(":", "")}`, { snapshot: r, revealProgress: i, transitionDuration: a, reducedMotion: o } = Ut(), s = at(), { left: c, top: l, width: u, height: d } = r.plot, f = Fr[e], p = i < 1 && !o ? $t(i * a, 0, 320) : 1, m = (t) => /* @__PURE__ */ j("g", {
5417
+ }, Rr = 110;
5418
+ function zr({ kind: e, spotlight: t = !0 }) {
5419
+ let n = `lilt-bg-${T().replaceAll(":", "")}`, { snapshot: r, revealProgress: i, transitionDuration: a, reducedMotion: o } = Ut(), s = at(), { left: c, top: l, width: u, height: d } = r.plot, f = Lr[e], p = i < 1 && !o ? $t(i * a, 0, 320) : 1, m = (t) => /* @__PURE__ */ j("g", {
5397
5420
  className: `lilt-chart__texture-${t}`,
5398
5421
  children: e === "dots" ? /* @__PURE__ */ j("circle", {
5399
5422
  cx: f / 2,
@@ -5467,8 +5490,8 @@ function Lr({ kind: e, spotlight: t = !0 }) {
5467
5490
  children: /* @__PURE__ */ j(P.ellipse, {
5468
5491
  cx: s.pointerX,
5469
5492
  cy: s.y,
5470
- rx: Ir,
5471
- ry: Ir,
5493
+ rx: Rr,
5494
+ ry: Rr,
5472
5495
  fill: `url(#${n}-spot-fade)`
5473
5496
  })
5474
5497
  })] }) : null
@@ -5497,7 +5520,7 @@ function Lr({ kind: e, spotlight: t = !0 }) {
5497
5520
  }
5498
5521
  //#endregion
5499
5522
  //#region src/interaction/comparison-tooltip.tsx
5500
- function Rr({ comparison: e, renderContent: t, startX: n, endX: r, top: i, width: a, height: o, className: s, ariaLabel: c }) {
5523
+ function Br({ comparison: e, renderContent: t, startX: n, endX: r, top: i, width: a, height: o, className: s, ariaLabel: c }) {
5501
5524
  let l = O(null), [u, d] = k(null);
5502
5525
  E(() => {
5503
5526
  let e = l.current;
@@ -5535,7 +5558,7 @@ function Rr({ comparison: e, renderContent: t, startX: n, endX: r, top: i, width
5535
5558
  }
5536
5559
  //#endregion
5537
5560
  //#region src/interaction/adaptive-readout.tsx
5538
- function zr({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned: a, onRelease: o, onCompareFromHere: s, renderContent: c, reducedMotion: l }) {
5561
+ function Vr({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned: a, onRelease: o, onCompareFromHere: s, renderContent: c, reducedMotion: l }) {
5539
5562
  let u = n ? e.data.rows.find((e) => e.x === n.x) : null, d = e.data.rows.at(-1), f = r === void 0 ? u ?? d : u, p = r ?? f?.x, m = p === void 0 ? "No observation" : e.formatX(p), h = r !== void 0 && f && f.x !== r, g = e.stack?.series ?? [], _ = g.length > 0, v = t.filter((e) => g.includes(e.id)).map((e) => f?.values[e.id] ?? null), y = _ && v.length > 0 && v.every((e) => e !== null) ? v.reduce((e, t) => e + (t ?? 0), 0) : null, b = l ? 0 : 150;
5540
5563
  return /* @__PURE__ */ M("div", {
5541
5564
  className: "lilt-chart__adaptive-readout",
@@ -5601,11 +5624,11 @@ function zr({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned:
5601
5624
  }
5602
5625
  //#endregion
5603
5626
  //#region src/interaction/tooltip.tsx
5604
- function Br(e = {}) {
5627
+ function Hr(e = {}) {
5605
5628
  let t = ir(), n = we();
5606
5629
  if (e.model && e.model !== n.model) throw Error("Lilt Tooltip model must be the model supplied to its Chart.");
5607
5630
  if (e.floating === !1) return null;
5608
- if (t.comparison) return e.renderComparison ? /* @__PURE__ */ j(Rr, {
5631
+ if (t.comparison) return e.renderComparison ? /* @__PURE__ */ j(Br, {
5609
5632
  comparison: t.comparison,
5610
5633
  renderContent: e.renderComparison,
5611
5634
  startX: t.compareStartX,
@@ -5616,7 +5639,7 @@ function Br(e = {}) {
5616
5639
  className: e.className,
5617
5640
  ariaLabel: e["aria-label"]
5618
5641
  }) : null;
5619
- if (e.adaptive !== !1 && !t.compact && (t.narrow || t.peer)) return t.adaptive ? /* @__PURE__ */ j(zr, {
5642
+ if (e.adaptive !== !1 && !t.compact && (t.narrow || t.peer)) return t.adaptive ? /* @__PURE__ */ j(Vr, {
5620
5643
  ...t.adaptive,
5621
5644
  renderContent: e.renderContent
5622
5645
  }) : null;
@@ -5723,11 +5746,11 @@ function Br(e = {}) {
5723
5746
  }
5724
5747
  //#endregion
5725
5748
  //#region src/marks/contract.ts
5726
- var Vr = /* @__PURE__ */ new WeakMap();
5727
- function Hr(e, t) {
5728
- return Vr.set(e, t), e;
5749
+ var Ur = /* @__PURE__ */ new WeakMap();
5750
+ function Wr(e, t) {
5751
+ return Ur.set(e, t), e;
5729
5752
  }
5730
- function Ur(e) {
5753
+ function Gr(e) {
5731
5754
  let t = [], n = (e) => {
5732
5755
  v.forEach(e, (e) => {
5733
5756
  if (!x(e)) return;
@@ -5736,7 +5759,7 @@ function Ur(e) {
5736
5759
  n(r.children);
5737
5760
  return;
5738
5761
  }
5739
- let i = typeof e.type == "function" ? Vr.get(e.type) : void 0;
5762
+ let i = typeof e.type == "function" ? Ur.get(e.type) : void 0;
5740
5763
  i && t.push({
5741
5764
  series: i.series(r),
5742
5765
  layout: i.layout,
@@ -5748,7 +5771,7 @@ function Ur(e) {
5748
5771
  };
5749
5772
  return n(e), t;
5750
5773
  }
5751
- function Wr(e, t, n, r) {
5774
+ function Kr(e, t, n, r) {
5752
5775
  let i = t.findIndex((e) => e.id === n), a = t[i];
5753
5776
  if (!a) throw Error(`Lilt ${e} references unknown series "${n}".`);
5754
5777
  let o = r.filter((e) => !a.fields?.[e]);
@@ -5758,7 +5781,7 @@ function Wr(e, t, n, r) {
5758
5781
  index: i
5759
5782
  };
5760
5783
  }
5761
- function Gr(e, t, n) {
5784
+ function qr(e, t, n) {
5762
5785
  let r = e.fields[t], i = [];
5763
5786
  for (let e of n) {
5764
5787
  let t = r?.[e];
@@ -5767,27 +5790,27 @@ function Gr(e, t, n) {
5767
5790
  }
5768
5791
  return i;
5769
5792
  }
5770
- function Kr(e, t, n) {
5793
+ function Jr(e, t, n) {
5771
5794
  return e.colorAt?.(t.datum) ?? n;
5772
5795
  }
5773
5796
  //#endregion
5774
5797
  //#region src/chart-plot.tsx
5775
- function qr(e, t) {
5798
+ function Yr(e, t) {
5776
5799
  if (!Number.isFinite(t) || t <= 0) throw Error(`Lilt ${e} must be a positive finite number; received ${t}.`);
5777
5800
  }
5778
- function Jr({ model: e, children: t, height: n = 340, compactHeight: r, margins: i, bars: a, stack: o, compact: s = !1, tooltip: c, inspectionSeries: l, className: u, style: d, axis: f, pill: p, pillSeries: m, pillValue: h, pillPosition: g, background: _ = "none", spotlight: v = !0, axisInset: y, runoff: b, labelOverhang: S, slots: C = !1, decimate: w }) {
5779
- n !== "fill" && qr("ChartPlot height", n), r !== void 0 && qr("ChartPlot compactHeight", r);
5801
+ function Xr({ model: e, children: t, height: n = 340, compactHeight: r, margins: i, bars: a, stack: o, compact: s = !1, tooltip: c, inspectionSeries: l, className: u, style: d, axis: f, pill: p, pillSeries: m, pillValue: h, pillPosition: g, background: _ = "none", spotlight: v = !0, axisInset: y, runoff: b, labelOverhang: S, slots: C = !1, decimate: w }) {
5802
+ n !== "fill" && Yr("ChartPlot height", n), r !== void 0 && Yr("ChartPlot compactHeight", r);
5780
5803
  let T = a === !0 ? {} : a;
5781
5804
  if (T) {
5782
- T.width !== void 0 && qr("ChartPlot bars.width", T.width);
5805
+ T.width !== void 0 && Yr("ChartPlot bars.width", T.width);
5783
5806
  for (let [e, t] of [["gap", T.gap], ["segmentGap", T.segmentGap]]) if (t !== void 0 && (!Number.isFinite(t) || t < 0)) throw Error(`Lilt ChartPlot bars.${e} must be a non-negative finite number; received ${t}.`);
5784
5807
  }
5785
- let E = we(), O = D(() => Ur(t), [t]);
5808
+ let E = we(), O = D(() => Gr(t), [t]);
5786
5809
  if (e && e !== E.model) throw Error("Lilt ChartPlot model must be the model supplied to its Chart.");
5787
- let k = Xr(E.props.series.map((e) => e.id), T, o, O, C);
5810
+ let k = Qr(E.props.series.map((e) => e.id), T, o, O, C);
5788
5811
  if (E.props.x.type === "category" && (E.linked || E.props.compare || E.props.focus || E.props.live || E.props.brush)) throw Error("Category plots support inspection and visibility; time-range comparison, focus, live, brush and linked controllers require numeric or time x.");
5789
- let ee = c === !1 || c === void 0 ? null : x(c) ? c : /* @__PURE__ */ j(Br, { ...c });
5790
- return /* @__PURE__ */ M(Pr, {
5812
+ let ee = c === !1 || c === void 0 ? null : x(c) ? c : /* @__PURE__ */ j(Hr, { ...c });
5813
+ return /* @__PURE__ */ M(Ir, {
5791
5814
  ...E.props,
5792
5815
  className: u,
5793
5816
  compactHeight: r,
@@ -5813,19 +5836,19 @@ function Jr({ model: e, children: t, height: n = 340, compactHeight: r, margins:
5813
5836
  runoff: b,
5814
5837
  labelOverhang: S,
5815
5838
  decimate: w,
5816
- children: [_ === "none" ? null : /* @__PURE__ */ j(Lr, {
5839
+ children: [_ === "none" ? null : /* @__PURE__ */ j(zr, {
5817
5840
  kind: _,
5818
5841
  spotlight: v
5819
5842
  }), t]
5820
5843
  });
5821
5844
  }
5822
- function Yr(e, t, n) {
5845
+ function Zr(e, t, n) {
5823
5846
  if (new Set(t).size !== t.length || t.some((e) => !n.includes(e))) throw Error(`Lilt ChartPlot ${e} must list unique IDs from the chart series.`);
5824
5847
  }
5825
- function Xr(e, t, n, r, i) {
5848
+ function Qr(e, t, n, r, i) {
5826
5849
  let a = n === void 0 ? void 0 : n === !0 ? {} : typeof n == "string" ? { mode: n } : n;
5827
- if (a?.series && (Yr("stack.series", a.series, e), !a.series.length)) throw Error("Lilt ChartPlot stack.series must not be empty.");
5828
- t?.series && Yr("bars.series", t.series, e);
5850
+ if (a?.series && (Zr("stack.series", a.series, e), !a.series.length)) throw Error("Lilt ChartPlot stack.series must not be empty.");
5851
+ t?.series && Zr("bars.series", t.series, e);
5829
5852
  let o = a ? e.filter((e) => !a.series || a.series.includes(e)) : null;
5830
5853
  if (o && t?.series && (t.series.length !== o.length || t.series.some((e) => !o.includes(e)))) throw Error("Lilt ChartPlot stacked bars draw exactly the stacked series; other series draw as lines.");
5831
5854
  let s = t ? o ?? e.filter((e) => !t.series || t.series.includes(e)) : null, c = [...new Set(r.filter((e) => e.layout === "column").map((e) => e.series))];
@@ -5846,8 +5869,8 @@ function Xr(e, t, n, r, i) {
5846
5869
  }
5847
5870
  //#endregion
5848
5871
  //#region src/primitives/runoff.tsx
5849
- var Zr = .32;
5850
- function Qr(e, t) {
5872
+ var $r = .32;
5873
+ function ei(e, t) {
5851
5874
  let { plot: n } = e, r = e.xToPixel(e.xDomain[0]), i = e.xToPixel(e.xDomain[1]), a = t.segments[0]?.points[0], o = t.segments.at(-1)?.points.at(-1), s = a && r - n.left > .5 && Math.abs(a.x - r) < .5, c = o && n.right - i > .5 && Math.abs(o.x - i) < .5;
5852
5875
  return !s && !c ? null : {
5853
5876
  left: s ? n.left : void 0,
@@ -5856,13 +5879,13 @@ function Qr(e, t) {
5856
5879
  dataEnd: i
5857
5880
  };
5858
5881
  }
5859
- function $r(e, t, n) {
5882
+ function ti(e, t, n) {
5860
5883
  return e ? {
5861
5884
  left: t === 0 ? e.left : void 0,
5862
5885
  right: t === n - 1 ? e.right : void 0
5863
5886
  } : {};
5864
5887
  }
5865
- function ei(e, t, n, r) {
5888
+ function ni(e, t, n, r) {
5866
5889
  let i = e.get(t);
5867
5890
  if (i && i.left === n.left && i.right === n.right) return i.path;
5868
5891
  let a = r(t, n);
@@ -5872,28 +5895,28 @@ function ei(e, t, n, r) {
5872
5895
  path: a
5873
5896
  }), a;
5874
5897
  }
5875
- var ti = /* @__PURE__ */ new WeakMap(), ni = /* @__PURE__ */ new WeakMap();
5876
- function ri(e, t) {
5877
- return ei(ti, e, t, ii);
5898
+ var ri = /* @__PURE__ */ new WeakMap(), ii = /* @__PURE__ */ new WeakMap();
5899
+ function ai(e, t) {
5900
+ return ni(ri, e, t, oi);
5878
5901
  }
5879
- function ii(e, { left: t, right: n }) {
5902
+ function oi(e, { left: t, right: n }) {
5880
5903
  let r = e.points[0], i = e.points.at(-1), a = e.path;
5881
5904
  return t !== void 0 && (a = `M${t},${r.y} L${a.slice(1)}`), n !== void 0 && (a = `${a} L${n},${i.y}`), a;
5882
5905
  }
5883
- var ai = /(-?[\d.e+-]+),(-?[\d.e+-]+)\s*Z\s*$/, oi = /^\s*L(-?[\d.e+-]+),(-?[\d.e+-]+)/;
5884
- function si(e, t) {
5885
- return ei(ni, e, t, ci);
5906
+ var si = /(-?[\d.e+-]+),(-?[\d.e+-]+)\s*Z\s*$/, ci = /^\s*L(-?[\d.e+-]+),(-?[\d.e+-]+)/;
5907
+ function li(e, t) {
5908
+ return ni(ii, e, t, ui);
5886
5909
  }
5887
- function ci(e, { left: t, right: n }) {
5910
+ function ui(e, { left: t, right: n }) {
5888
5911
  if (t === void 0 && n === void 0 || !e.areaPath.startsWith(e.path)) return e.areaPath;
5889
- let r = e.areaPath.slice(e.path.length), i = oi.exec(r), a = ai.exec(r);
5912
+ let r = e.areaPath.slice(e.path.length), i = ci.exec(r), a = si.exec(r);
5890
5913
  if (!i || !a) return e.areaPath;
5891
5914
  let o = e.points[0], s = e.points.at(-1), c = e.path;
5892
5915
  t !== void 0 && (c = `M${t},${o.y} L${c.slice(1)}`), n !== void 0 && (c = `${c} L${n},${s.y} L${n},${i[2]}`);
5893
5916
  let l = t === void 0 ? r : r.replace(/Z\s*$/, `L${t},${a[2]} Z`);
5894
5917
  return `${c} ${l.trim()}`;
5895
5918
  }
5896
- function li(e, t, n) {
5919
+ function di(e, t, n) {
5897
5920
  let { plot: r } = t;
5898
5921
  return [
5899
5922
  e,
@@ -5903,7 +5926,7 @@ function li(e, t, n) {
5903
5926
  n.dataEnd
5904
5927
  ].map((e) => typeof e == "number" ? Math.round(e * 10) : e).join("-");
5905
5928
  }
5906
- function ui({ id: e, snapshot: t, edges: n }) {
5929
+ function fi({ id: e, snapshot: t, edges: n }) {
5907
5930
  let { plot: r } = t, i = Math.max(1, r.right - r.left), a = (e) => Math.min(1, Math.max(0, (e - r.left) / i));
5908
5931
  return /* @__PURE__ */ M("defs", { children: [/* @__PURE__ */ M("linearGradient", {
5909
5932
  id: `${e}-ramp`,
@@ -5916,7 +5939,7 @@ function ui({ id: e, snapshot: t, edges: n }) {
5916
5939
  /* @__PURE__ */ j("stop", {
5917
5940
  offset: 0,
5918
5941
  stopColor: "white",
5919
- stopOpacity: n.left === void 0 ? 1 : Zr
5942
+ stopOpacity: n.left === void 0 ? 1 : $r
5920
5943
  }),
5921
5944
  /* @__PURE__ */ j("stop", {
5922
5945
  offset: a(n.dataStart),
@@ -5929,7 +5952,7 @@ function ui({ id: e, snapshot: t, edges: n }) {
5929
5952
  /* @__PURE__ */ j("stop", {
5930
5953
  offset: 1,
5931
5954
  stopColor: "white",
5932
- stopOpacity: n.right === void 0 ? 1 : Zr
5955
+ stopOpacity: n.right === void 0 ? 1 : $r
5933
5956
  })
5934
5957
  ]
5935
5958
  }), /* @__PURE__ */ j("mask", {
@@ -5946,7 +5969,7 @@ function ui({ id: e, snapshot: t, edges: n }) {
5946
5969
  }
5947
5970
  //#endregion
5948
5971
  //#region src/primitives/area.tsx
5949
- function di({ series: e, className: t, model: n }) {
5972
+ function pi({ series: e, className: t, model: n }) {
5950
5973
  let r = we(), { runoff: i } = at();
5951
5974
  if (n && n !== r.model) throw Error("Lilt Area model must be the model supplied to its Chart.");
5952
5975
  let { snapshot: a, series: o, reducedMotion: s, inspecting: c, paintId: l, focusedSeries: u, visibleSeries: d, revealProgress: f, transitionDuration: p, clipId: m } = Ut(), h = $t(f < 1 ? f * p : Infinity, 40, p * .65), g = (a.drawGeometry ?? a.geometry)?.series[e];
@@ -5956,7 +5979,7 @@ function di({ series: e, className: t, model: n }) {
5956
5979
  className: t,
5957
5980
  "data-series": e
5958
5981
  });
5959
- let T = i && !a.stack?.signed ? Qr(a, g) : null, E = T ? li(`${m}-runoff-area-${y}`, a, T) : "", D = T ? /* @__PURE__ */ j(ui, {
5982
+ let T = i && !a.stack?.signed ? ei(a, g) : null, E = T ? di(`${m}-runoff-area-${y}`, a, T) : "", D = T ? /* @__PURE__ */ j(fi, {
5960
5983
  id: E,
5961
5984
  snapshot: a,
5962
5985
  edges: T
@@ -5980,7 +6003,7 @@ function di({ series: e, className: t, model: n }) {
5980
6003
  children: g.segments.map((t, n) => {
5981
6004
  let r = t.status === "provisional" ? "hatch" : t.status === "forecast" ? "dots" : C, i = Re(x, S?.fill, r, l(e, r === "solid" ? "fade" : r));
5982
6005
  return /* @__PURE__ */ j("path", {
5983
- d: T ? si(t, $r(T, n, g.segments.length)) : t.areaPath,
6006
+ d: T ? li(t, ti(T, n, g.segments.length)) : t.areaPath,
5984
6007
  "data-lilt-status": t.status && t.status !== "observed" ? t.status : void 0,
5985
6008
  fill: i,
5986
6009
  mask: S?.fade ? `url(#${l(e, "fade")}-mask)` : void 0,
@@ -5997,12 +6020,12 @@ function di({ series: e, className: t, model: n }) {
5997
6020
  function $(e) {
5998
6021
  return Math.round(e * 100) / 100;
5999
6022
  }
6000
- function fi(e, t, n) {
6023
+ function mi(e, t, n) {
6001
6024
  return e.fields[t]?.[n] ?? null;
6002
6025
  }
6003
- function pi(e, t, n, r) {
6026
+ function hi(e, t, n, r) {
6004
6027
  for (let i of t) {
6005
- let t = r.map((e) => typeof e == "string" ? fi(i, n, e) : i.values[n] ?? null);
6028
+ let t = r.map((e) => typeof e == "string" ? mi(i, n, e) : i.values[n] ?? null);
6006
6029
  if (!t.some((e) => e === null)) {
6007
6030
  for (let a = 1; a < t.length; a += 1) if (t[a] < t[a - 1]) {
6008
6031
  let t = r.map((e) => typeof e == "string" ? e : "value").join(" ≤ ");
@@ -6011,7 +6034,7 @@ function pi(e, t, n, r) {
6011
6034
  }
6012
6035
  }
6013
6036
  }
6014
- function mi(e, t, n, r, i) {
6037
+ function gi(e, t, n, r, i) {
6015
6038
  let a = [], o = [], s = () => {
6016
6039
  if (o.length >= 2) {
6017
6040
  let e = o.map((e) => `${$(e.x)},${$(i.y(e.upper))}`), t = o.map((e) => `${$(e.x)},${$(i.y(e.lower))}`).reverse();
@@ -6020,7 +6043,7 @@ function mi(e, t, n, r, i) {
6020
6043
  o = [];
6021
6044
  };
6022
6045
  for (let a of e) {
6023
- let e = fi(a, t, n), c = fi(a, t, r);
6046
+ let e = mi(a, t, n), c = mi(a, t, r);
6024
6047
  a.x < i.xDomain[0] || a.x > i.xDomain[1] || e === null || c === null ? s() : o.push({
6025
6048
  x: i.x(a.x),
6026
6049
  lower: e,
@@ -6029,14 +6052,14 @@ function mi(e, t, n, r, i) {
6029
6052
  }
6030
6053
  return s(), a;
6031
6054
  }
6032
- function hi(e, t, n, r, i) {
6055
+ function _i(e, t, n, r, i) {
6033
6056
  let a = Math.max(0, Math.min(i, n / 2, r / 2));
6034
6057
  return a === 0 ? `M${$(e)},${$(t)}h${$(n)}v${$(r)}h${$(-n)}Z` : `M${$(e + a)},${$(t)}h${$(n - 2 * a)}a${a},${a} 0 0 1 ${a},${a}v${$(r - 2 * a)}a${a},${a} 0 0 1 ${-a},${a}h${$(-(n - 2 * a))}a${a},${a} 0 0 1 ${-a},${-a}v${$(-(r - 2 * a))}a${a},${a} 0 0 1 ${a},${-a}Z`;
6035
6058
  }
6036
- function gi(e, t, n) {
6059
+ function vi(e, t, n) {
6037
6060
  return `M${$(e - n)},${$(t)}a${n},${n} 0 1 0 ${n * 2},0a${n},${n} 0 1 0 ${-n * 2},0Z`;
6038
6061
  }
6039
- var _i = class {
6062
+ var yi = class {
6040
6063
  batches = /* @__PURE__ */ new Map();
6041
6064
  add(e, t) {
6042
6065
  let n = this.batches.get(e);
@@ -6048,22 +6071,22 @@ var _i = class {
6048
6071
  d: t.join("")
6049
6072
  }));
6050
6073
  }
6051
- }, vi = class {
6052
- sides = new _i();
6053
- tops = new _i();
6054
- fronts = new _i();
6074
+ }, bi = class {
6075
+ sides = new yi();
6076
+ tops = new yi();
6077
+ fronts = new yi();
6055
6078
  add(e, t) {
6056
6079
  this.sides.add(e, t.side), t.top && this.tops.add(e, t.top), this.fronts.add(e, t.front);
6057
6080
  }
6058
6081
  };
6059
- function yi(e) {
6082
+ function xi(e) {
6060
6083
  let t = Math.max(1, e.columnWidth);
6061
6084
  return {
6062
6085
  width: t,
6063
6086
  half: t / 2
6064
6087
  };
6065
6088
  }
6066
- function bi(e, t) {
6089
+ function Si(e, t) {
6067
6090
  let n = [];
6068
6091
  for (let r of e) r.x < t.xDomain[0] || r.x > t.xDomain[1] || n.push({
6069
6092
  row: r,
@@ -6071,46 +6094,46 @@ function bi(e, t) {
6071
6094
  });
6072
6095
  return n;
6073
6096
  }
6074
- function xi(e, t, n, r) {
6075
- let { width: i } = yi(r), a = r.y(Math.max(t, n)), o = Math.max(1, r.y(Math.min(t, n)) - a);
6097
+ function Ci(e, t, n, r) {
6098
+ let { width: i } = xi(r), a = r.y(Math.max(t, n)), o = Math.max(1, r.y(Math.min(t, n)) - a);
6076
6099
  return un(e, a - (o === 1 ? .5 : 0), i, o);
6077
6100
  }
6078
- function Si(e, t, n, r) {
6079
- let { width: i, half: a } = yi(r), o = r.y(Math.max(t, n)), s = r.y(Math.min(t, n)), c = Math.max(1, s - o);
6080
- return hi(e - a, o - (c === 1 ? .5 : 0), i, c, Math.min(4, a));
6101
+ function wi(e, t, n, r) {
6102
+ let { width: i, half: a } = xi(r), o = r.y(Math.max(t, n)), s = r.y(Math.min(t, n)), c = Math.max(1, s - o);
6103
+ return _i(e - a, o - (c === 1 ? .5 : 0), i, c, Math.min(4, a));
6081
6104
  }
6082
- function Ci(e) {
6083
- return Math.min(12, yi(e).width * .5) / 2;
6105
+ function Ti(e) {
6106
+ return Math.min(12, xi(e).width * .5) / 2;
6084
6107
  }
6085
- function wi(e, t, n, r) {
6108
+ function Ei(e, t, n, r) {
6086
6109
  let i = $(e), a = $(n);
6087
6110
  return `M${i},${$(t)}V${a}` + (r >= 1.5 ? `M${$(e - r)},${a}H${$(e + r)}` : "");
6088
6111
  }
6089
- function Ti(e, t, n, r) {
6090
- let i = Ci(r), a = $(r.y(n)), o = $(r.y(t)), s = i >= 1.5 ? `M${$(e - i)},${a}H${$(e + i)}M${$(e - i)},${o}H${$(e + i)}` : "";
6112
+ function Di(e, t, n, r) {
6113
+ let i = Ti(r), a = $(r.y(n)), o = $(r.y(t)), s = i >= 1.5 ? `M${$(e - i)},${a}H${$(e + i)}M${$(e - i)},${o}H${$(e + i)}` : "";
6091
6114
  return `M${$(e)},${a}V${o}${s}`;
6092
6115
  }
6093
- function Ei(e, t, n) {
6094
- let { width: r, half: i } = yi(n), a = Ci(n), o = n.y(t.q3), s = n.y(t.q1), c = $(n.y(t.median));
6116
+ function Oi(e, t, n) {
6117
+ let { width: r, half: i } = xi(n), a = Ti(n), o = n.y(t.q3), s = n.y(t.q1), c = $(n.y(t.median));
6095
6118
  return {
6096
- box: hi(e - i, o, r, Math.max(1, s - o), Math.min(3, i)),
6119
+ box: _i(e - i, o, r, Math.max(1, s - o), Math.min(3, i)),
6097
6120
  median: `M${$(e - i)},${c}H${$(e + i)}`,
6098
- whiskers: wi(e, o, n.y(t.max), a) + wi(e, s, n.y(t.min), a)
6121
+ whiskers: Ei(e, o, n.y(t.max), a) + Ei(e, s, n.y(t.min), a)
6099
6122
  };
6100
6123
  }
6101
- function Di(e, t, n) {
6102
- let { width: r, half: i } = yi(n), a = Ci(n), o = n.y(t.q3), s = n.y(t.q1), c = ln(e - i, o, r, Math.max(1, s - o)), l = c.rise / 2, u = e - i, d = u + c.frontWidth, f = n.y(t.median);
6124
+ function ki(e, t, n) {
6125
+ let { width: r, half: i } = xi(n), a = Ti(n), o = n.y(t.q3), s = n.y(t.q1), c = ln(e - i, o, r, Math.max(1, s - o)), l = c.rise / 2, u = e - i, d = u + c.frontWidth, f = n.y(t.median);
6103
6126
  return {
6104
6127
  faces: c,
6105
6128
  lift: l,
6106
6129
  median: `M${u},${f}H${d}L${d + c.depth},${f - c.rise}`,
6107
- lower: wi(e, s - l, n.y(t.min) - l, a),
6108
- upper: wi(e, o - l, n.y(t.max) - l, a)
6130
+ lower: Ei(e, s - l, n.y(t.min) - l, a),
6131
+ upper: Ei(e, o - l, n.y(t.max) - l, a)
6109
6132
  };
6110
6133
  }
6111
6134
  //#endregion
6112
6135
  //#region src/marks/use-range-mark.ts
6113
- function Oi(e, t) {
6136
+ function Ai(e, t) {
6114
6137
  return {
6115
6138
  x: e.xToPixel,
6116
6139
  y: e.yToPixelFor(t),
@@ -6118,10 +6141,10 @@ function Oi(e, t) {
6118
6141
  columnWidth: e.columnWidth
6119
6142
  };
6120
6143
  }
6121
- function ki(e, t, n, r) {
6122
- let i = Ut(), { snapshot: a, visibleSeries: o, focusedSeries: s, inspecting: c, revealProgress: l, clipId: u } = i, { descriptor: d, index: f } = Wr(e, i.series, t, n);
6144
+ function ji(e, t, n, r) {
6145
+ let i = Ut(), { snapshot: a, visibleSeries: o, focusedSeries: s, inspecting: c, revealProgress: l, clipId: u } = i, { descriptor: d, index: f } = Kr(e, i.series, t, n);
6123
6146
  if (a.bars?.includes(t) || a.stack?.series.includes(t)) throw Error(`Lilt ${e} draws its own series; do not also draw "${t}" as bars.`);
6124
- let p = D(() => Oi(a, t), [a, t]), m = o.includes(t) ? s && s !== t ? "var(--lilt-focus-muted-opacity, 0.18)" : c ? r === "column" ? "var(--lilt-bar-inspection-muted-opacity, 0.26)" : .3 : 1 : 0;
6147
+ let p = D(() => Ai(a, t), [a, t]), m = o.includes(t) ? s && s !== t ? "var(--lilt-focus-muted-opacity, 0.18)" : c ? r === "column" ? "var(--lilt-bar-inspection-muted-opacity, 0.26)" : .3 : 1 : 0;
6125
6148
  return {
6126
6149
  descriptor: d,
6127
6150
  color: Ie(d, f),
@@ -6143,10 +6166,10 @@ function ki(e, t, n, r) {
6143
6166
  }
6144
6167
  //#endregion
6145
6168
  //#region src/primitives/interval-band.tsx
6146
- var Ai = Hr(function({ series: e, lower: t, upper: n, className: r }) {
6147
- let { paintId: i } = Ut(), a = ki("IntervalBand", e, [t, n], "overlay"), o = a.snapshot.data.rows;
6148
- pi("IntervalBand", o, e, [t, n]);
6149
- let s = mi(o, e, t, n, a.scales), c = Re(a.color, void 0, "fade", i(e, "fade"));
6169
+ var Mi = Wr(function({ series: e, lower: t, upper: n, className: r }) {
6170
+ let { paintId: i } = Ut(), a = ji("IntervalBand", e, [t, n], "overlay"), o = a.snapshot.data.rows;
6171
+ hi("IntervalBand", o, e, [t, n]);
6172
+ let s = gi(o, e, t, n, a.scales), c = Re(a.color, void 0, "fade", i(e, "fade"));
6150
6173
  return /* @__PURE__ */ j("g", {
6151
6174
  "aria-hidden": "true",
6152
6175
  className: ["lilt-chart__interval-band", r].filter(Boolean).join(" "),
@@ -6166,7 +6189,7 @@ var Ai = Hr(function({ series: e, lower: t, upper: n, className: r }) {
6166
6189
  });
6167
6190
  //#endregion
6168
6191
  //#region src/primitives/line.tsx
6169
- function ji(e, t, n) {
6192
+ function Ni(e, t, n) {
6170
6193
  let r = t + 9, i = n - 5;
6171
6194
  if (i - r < (e.length - 1) * 17) return /* @__PURE__ */ new Map();
6172
6195
  let a = [];
@@ -6177,7 +6200,7 @@ function ji(e, t, n) {
6177
6200
  }
6178
6201
  return new Map(e.map((e, t) => [e.id, a[t]]));
6179
6202
  }
6180
- function Mi({ series: e, className: t, model: n }) {
6203
+ function Pi({ series: e, className: t, model: n }) {
6181
6204
  let r = we();
6182
6205
  if (n && n !== r.model) throw Error("Lilt Line model must be the model supplied to its Chart.");
6183
6206
  let { runoff: i } = at(), a = O(null), [o, s] = k(!1), { snapshot: c, width: l, series: u, reducedMotion: d, inspecting: f, focusedSeries: p, visibleSeries: m, revealProgress: h, transitionDuration: g, clipId: _ } = Ut(), v = $t(h < 1 ? h * g : Infinity, 0, 180), y = u.find((t) => t.id === e);
@@ -6192,7 +6215,7 @@ function Mi({ series: e, className: t, model: n }) {
6192
6215
  color: Ie(e, u.indexOf(e)),
6193
6216
  index: t
6194
6217
  } : null;
6195
- }).filter((e) => e !== null).sort((e, t) => e.y - t.y), D = ji(T, c.plot.top, c.plot.bottom), ee = T.find((t) => t.id === e)?.text, te = l - c.plot.right - 11, N = !!(S?.directLabel && ee && D.has(e) && c.plot.width >= 460 && l - c.plot.right >= 96);
6218
+ }).filter((e) => e !== null).sort((e, t) => e.y - t.y), D = Ni(T, c.plot.top, c.plot.bottom), ee = T.find((t) => t.id === e)?.text, te = l - c.plot.right - 11, N = !!(S?.directLabel && ee && D.has(e) && c.plot.width >= 460 && l - c.plot.right >= 96);
6196
6219
  E(() => {
6197
6220
  if (!N || !ee || !a.current) return;
6198
6221
  let e = a.current, t = !0, n = () => {
@@ -6216,7 +6239,7 @@ function Mi({ series: e, className: t, model: n }) {
6216
6239
  className: t,
6217
6240
  "data-series": e
6218
6241
  });
6219
- let re = S?.depth && !S.dasharray ? xn(typeof S.width == "number" ? S.width : 2) : 0, ie = i ? Qr(c, b) : null, F = ie ? li(`${_}-runoff-line-${u.indexOf(y)}`, c, ie) : "", I = ie ? /* @__PURE__ */ j(ui, {
6242
+ let re = S?.depth && !S.dasharray ? xn(typeof S.width == "number" ? S.width : 2) : 0, ie = i ? ei(c, b) : null, F = ie ? di(`${_}-runoff-line-${u.indexOf(y)}`, c, ie) : "", I = ie ? /* @__PURE__ */ j(fi, {
6220
6243
  id: F,
6221
6244
  snapshot: c,
6222
6245
  edges: ie
@@ -6261,7 +6284,7 @@ function Mi({ series: e, className: t, model: n }) {
6261
6284
  mask: ie ? `url(#${F})` : void 0,
6262
6285
  filter: re ? `url(#${_}-tube-${u.indexOf(y)})` : void 0,
6263
6286
  children: b.segments.map((t, n) => {
6264
- let r = ie ? ri(t, $r(ie, n, b.segments.length)) : t.path, i = t.status === "provisional" ? "5 4" : t.status === "forecast" ? "2 5" : S?.dasharray;
6287
+ let r = ie ? ai(t, ti(ie, n, b.segments.length)) : t.path, i = t.status === "provisional" ? "5 4" : t.status === "forecast" ? "2 5" : S?.dasharray;
6265
6288
  return re ? /* @__PURE__ */ j("g", {
6266
6289
  "data-lilt-path": e,
6267
6290
  "data-lilt-status": t.status && t.status !== "observed" ? t.status : void 0,
@@ -6327,7 +6350,7 @@ function Mi({ series: e, className: t, model: n }) {
6327
6350
  }
6328
6351
  //#endregion
6329
6352
  //#region src/primitives/bar.tsx
6330
- function Ni({ series: e, className: t, model: n }) {
6353
+ function Fi({ series: e, className: t, model: n }) {
6331
6354
  let r = we();
6332
6355
  if (n && n !== r.model) throw Error("Lilt Bar model must be the model supplied to its Chart.");
6333
6356
  let { snapshot: i, series: a, visibleSeries: o, inspecting: s, focusedSeries: c, reducedMotion: l, revealProgress: u, transitionDuration: d, clipId: f, paintId: p } = Ut(), m = a.find((t) => t.id === e);
@@ -6409,13 +6432,13 @@ function Ni({ series: e, className: t, model: n }) {
6409
6432
  }
6410
6433
  //#endregion
6411
6434
  //#region src/primitives/grid.tsx
6412
- var Pi = [
6435
+ var Ii = [
6413
6436
  .22,
6414
6437
  1,
6415
6438
  .36,
6416
6439
  1
6417
6440
  ];
6418
- function Fi({ className: e, pattern: t = "lines", color: n, opacity: r = 1, lineWidth: i, dotSpacing: a = 8, dotRadius: o = .6 } = {}) {
6441
+ function Li({ className: e, pattern: t = "lines", color: n, opacity: r = 1, lineWidth: i, dotSpacing: a = 8, dotRadius: o = .6 } = {}) {
6419
6442
  if (!Number.isFinite(r) || r < 0 || r > 1 || i !== void 0 && (!Number.isFinite(i) || i < 0) || !Number.isFinite(a) || a <= 0 || !Number.isFinite(o) || o < 0 || o > a / 2) throw Error("Lilt Grid requires opacity in [0, 1], non-negative lineWidth, positive dotSpacing, and dotRadius within half the spacing.");
6420
6443
  let s = `lilt-grid-${T().replaceAll(":", "")}`, { snapshot: c, previousSnapshot: l, axis: u, transitionDuration: d, reducedMotion: f, gridGradientId: p, revealProgress: m } = Ut(), h = at().axis.y, g = m < 1, _ = $t(g ? m * d : Infinity, 0, 240), v = f ? 0 : d / 1e3, y = new Map((l?.yTicks ?? []).map((e) => [e, l.yToPixel(e)]));
6421
6444
  if (t === "dots") return /* @__PURE__ */ M("g", {
@@ -6513,7 +6536,7 @@ function Fi({ className: e, pattern: t = "lines", color: n, opacity: r = 1, line
6513
6536
  },
6514
6537
  transition: {
6515
6538
  duration: g ? 0 : v,
6516
- ease: Pi
6539
+ ease: Ii
6517
6540
  },
6518
6541
  vectorEffect: "non-scaling-stroke",
6519
6542
  x1: c.plot.left,
@@ -6524,16 +6547,16 @@ function Fi({ className: e, pattern: t = "lines", color: n, opacity: r = 1, line
6524
6547
  }
6525
6548
  //#endregion
6526
6549
  //#region src/primitives/axis-segments.tsx
6527
- var Ii = 4, Li = 5;
6528
- function Ri({ from: e, to: t, cross: n, vertical: r, fill: i, cursor: a, active: o }) {
6529
- let s = F([a, o], ([n, r]) => .55 + (Number(n) >= Math.min(e, t) && Number(n) <= Math.max(e, t) ? Number(r) * .45 : 0)), c = Math.min(e, t) + Ii / 2, l = Math.max(0, Math.abs(t - e) - Ii);
6550
+ var Ri = 4, zi = 5;
6551
+ function Bi({ from: e, to: t, cross: n, vertical: r, fill: i, cursor: a, active: o }) {
6552
+ let s = F([a, o], ([n, r]) => .55 + (Number(n) >= Math.min(e, t) && Number(n) <= Math.max(e, t) ? Number(r) * .45 : 0)), c = Math.min(e, t) + Ri / 2, l = Math.max(0, Math.abs(t - e) - Ri);
6530
6553
  return /* @__PURE__ */ j(P.rect, {
6531
6554
  className: "lilt-chart__axis-segment",
6532
- x: r ? n - Li / 2 : c,
6533
- y: r ? c : n - Li / 2,
6534
- width: r ? Li : l,
6535
- height: r ? l : Li,
6536
- rx: Li / 2,
6555
+ x: r ? n - zi / 2 : c,
6556
+ y: r ? c : n - zi / 2,
6557
+ width: r ? zi : l,
6558
+ height: r ? l : zi,
6559
+ rx: zi / 2,
6537
6560
  fill: i,
6538
6561
  style: {
6539
6562
  opacity: s,
@@ -6541,7 +6564,7 @@ function Ri({ from: e, to: t, cross: n, vertical: r, fill: i, cursor: a, active:
6541
6564
  }
6542
6565
  });
6543
6566
  }
6544
- function zi({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a, opacity: o = 1 }) {
6567
+ function Vi({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a, opacity: o = 1 }) {
6545
6568
  let s = `lilt-axis-scale-${T().replace(/:/g, "")}`, c = [...new Set(e.map((e) => Math.round(e * 2) / 2))].sort((e, t) => e - t);
6546
6569
  if (c.length < 2) return null;
6547
6570
  let l = n ? c.at(-1) : c[0], u = n ? c[0] : c.at(-1);
@@ -6565,7 +6588,7 @@ function zi({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a
6565
6588
  stopOpacity: e.opacity ?? 1
6566
6589
  }
6567
6590
  }, t))
6568
- }) }) : null, c.slice(1).map((e, o) => /* @__PURE__ */ j(Ri, {
6591
+ }) }) : null, c.slice(1).map((e, o) => /* @__PURE__ */ j(Bi, {
6569
6592
  from: c[o],
6570
6593
  to: e,
6571
6594
  cross: t,
@@ -6578,13 +6601,13 @@ function zi({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a
6578
6601
  }
6579
6602
  //#endregion
6580
6603
  //#region src/primitives/axes.tsx
6581
- var Bi = [
6604
+ var Hi = [
6582
6605
  .22,
6583
6606
  1,
6584
6607
  .36,
6585
6608
  1
6586
- ], Vi = 64, Hi = 26, Ui = 160, Wi = 4, Gi = 6;
6587
- function Ki(e) {
6609
+ ], Ui = 64, Wi = 26, Gi = 160, Ki = 4, qi = 6;
6610
+ function Ji(e) {
6588
6611
  let { series: t, visibleSeries: n } = Ut();
6589
6612
  if (!e) return null;
6590
6613
  if (e !== !0) return e.map((e) => ({ color: e }));
@@ -6599,13 +6622,13 @@ function Ki(e) {
6599
6622
  opacity: 1
6600
6623
  }];
6601
6624
  }
6602
- function qi(e, t, n) {
6625
+ function Yi(e, t, n) {
6603
6626
  return t || n ? { duration: 0 } : {
6604
6627
  duration: Math.max(0, e) / 1e3,
6605
- ease: Bi
6628
+ ease: Hi
6606
6629
  };
6607
6630
  }
6608
- function Ji({ cursor: e, active: t, center: n, reach: r, children: i }) {
6631
+ function Xi({ cursor: e, active: t, center: n, reach: r, children: i }) {
6609
6632
  let a = F([e, t], ([e, t]) => ot(Number(e) - n, r, Number(t))), o = F(a, (e) => e > .995 ? "none" : `blur(${((1 - e) * 1.2).toFixed(2)}px)`);
6610
6633
  return /* @__PURE__ */ j(P.g, {
6611
6634
  style: {
@@ -6615,15 +6638,15 @@ function Ji({ cursor: e, active: t, center: n, reach: r, children: i }) {
6615
6638
  children: i
6616
6639
  });
6617
6640
  }
6618
- var Yi = {
6641
+ var Zi = {
6619
6642
  ticks: 4,
6620
6643
  dots: 7
6621
6644
  };
6622
- function Xi({ kind: e, x: t, baseline: n, reach: r, cursor: i, active: a }) {
6645
+ function Qi({ kind: e, x: t, baseline: n, reach: r, cursor: i, active: a }) {
6623
6646
  let o = F([i, a], ([e, n]) => {
6624
6647
  let i = Math.max(0, 1 - Math.abs(Number(e) - t) / r);
6625
6648
  return Number(n) * i * i * (3 - 2 * i);
6626
- }), s = F(o, (e) => .28 + e * .62), c = n + Yi[e], l = F(o, (e) => c + 4 + e * 5), u = F(o, (e) => 1.25 + e * 1.5);
6649
+ }), s = F(o, (e) => .28 + e * .62), c = n + Zi[e], l = F(o, (e) => c + 4 + e * 5), u = F(o, (e) => 1.25 + e * 1.5);
6627
6650
  return e === "dots" ? /* @__PURE__ */ j(P.circle, {
6628
6651
  className: "lilt-chart__ruler-dot",
6629
6652
  cx: t,
@@ -6640,8 +6663,8 @@ function Xi({ kind: e, x: t, baseline: n, reach: r, cursor: i, active: a }) {
6640
6663
  style: { opacity: s }
6641
6664
  });
6642
6665
  }
6643
- function Zi({ className: e, edgeInset: t, labels: n } = {}) {
6644
- let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = Ut(), u = at(), d = c === "initial" || c === "handoff", f = new Map((i?.xTicks ?? []).map((e) => [e, i.xToPixel(e)])), p = r.data.rows, m = u.axis.x, h = m === "segmented", g = Ki(u.axis.xGradient), _ = m === "minimal" || m === "dots", v = m === "ruler" ? "ticks" : m === "dots" ? "dots" : null, y = (n ?? (_ ? "ends" : "fit")) === "ends" && p.length ? [.../* @__PURE__ */ new Set([p[0].x, p.at(-1).x])] : null, b = y ?? r.xTicks, x = y ? y.map((e) => ({ value: e })) : a.x, S = new Set(b), C = Math.min(Math.max(0, t ?? 0), (r.plot.right - r.plot.left) / 4), w = Math.max(1, Math.ceil(p.length / Ui)), T = p.filter((e, t) => t % w === 0), E = T.length > 1 ? (r.plot.right - r.plot.left) / (T.length - 1) : 40, D = d && !s ? $t(l * o, 0, 320) : 1;
6666
+ function $i({ className: e, edgeInset: t, labels: n } = {}) {
6667
+ let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = Ut(), u = at(), d = c === "initial" || c === "handoff", f = new Map((i?.xTicks ?? []).map((e) => [e, i.xToPixel(e)])), p = r.data.rows, m = u.axis.x, h = m === "segmented", g = Ji(u.axis.xGradient), _ = m === "minimal" || m === "dots", v = m === "ruler" ? "ticks" : m === "dots" ? "dots" : null, y = (n ?? (_ ? "ends" : "fit")) === "ends" && p.length ? [.../* @__PURE__ */ new Set([p[0].x, p.at(-1).x])] : null, b = y ?? r.xTicks, x = y ? y.map((e) => ({ value: e })) : a.x, S = new Set(b), C = Math.min(Math.max(0, t ?? 0), (r.plot.right - r.plot.left) / 4), w = Math.max(1, Math.ceil(p.length / Gi)), T = p.filter((e, t) => t % w === 0), E = T.length > 1 ? (r.plot.right - r.plot.left) / (T.length - 1) : 40, D = d && !s ? $t(l * o, 0, 320) : 1;
6645
6668
  return /* @__PURE__ */ M("g", {
6646
6669
  "aria-hidden": "true",
6647
6670
  className: [
@@ -6657,13 +6680,13 @@ function Zi({ className: e, edgeInset: t, labels: n } = {}) {
6657
6680
  y1: r.plot.bottom,
6658
6681
  y2: r.plot.bottom
6659
6682
  }),
6660
- h ? /* @__PURE__ */ j(zi, {
6683
+ h ? /* @__PURE__ */ j(Vi, {
6661
6684
  stops: [
6662
6685
  r.plot.left,
6663
6686
  ...b.map((e) => r.xToPixel(e)),
6664
6687
  r.plot.right
6665
6688
  ],
6666
- cross: r.plot.bottom + Gi,
6689
+ cross: r.plot.bottom + qi,
6667
6690
  vertical: !1,
6668
6691
  gradient: g,
6669
6692
  cursor: u.pointerX,
@@ -6674,7 +6697,7 @@ function Zi({ className: e, edgeInset: t, labels: n } = {}) {
6674
6697
  className: "lilt-chart__ruler",
6675
6698
  "data-kind": v,
6676
6699
  opacity: D,
6677
- children: T.map((e) => /* @__PURE__ */ j(Xi, {
6700
+ children: T.map((e) => /* @__PURE__ */ j(Qi, {
6678
6701
  kind: v,
6679
6702
  x: r.xToPixel(e.x),
6680
6703
  baseline: r.plot.bottom,
@@ -6684,12 +6707,12 @@ function Zi({ className: e, edgeInset: t, labels: n } = {}) {
6684
6707
  }, `ruler-${e.x}`))
6685
6708
  }) : null,
6686
6709
  x.map((e, t) => {
6687
- let n = S.has(e.value), i = n ? r.xToPixel(e.value) : f.get(e.value) ?? r.xToPixel(e.value), a = f.get(e.value) ?? i, c = d && !s ? $t(l * o, 60 + en(t, x.length, 100), 320) : 1, p = b.indexOf(e.value), m = p < 0 ? t : p, h = r.formatX(e.value), g = h.length * 3.3, _ = m === 0, v = m === b.length - 1, y = Wi - u.overhang, w = _ && i - g < r.plot.left + y ? "start" : v && i + g > r.plot.right - y ? "end" : "middle", T = w === "start" ? C : w === "end" ? -C : 0, E = i + T + (w === "start" ? g : w === "end" ? -g : 0);
6688
- return /* @__PURE__ */ j(Ji, {
6710
+ let n = S.has(e.value), i = n ? r.xToPixel(e.value) : f.get(e.value) ?? r.xToPixel(e.value), a = f.get(e.value) ?? i, c = d && !s ? $t(l * o, 60 + en(t, x.length, 100), 320) : 1, p = b.indexOf(e.value), m = p < 0 ? t : p, h = r.formatX(e.value), g = h.length * 3.3, _ = m === 0, v = m === b.length - 1, y = Ki - u.overhang, w = _ && i - g < r.plot.left + y ? "start" : v && i + g > r.plot.right - y ? "end" : "middle", T = w === "start" ? C : w === "end" ? -C : 0, E = i + T + (w === "start" ? g : w === "end" ? -g : 0);
6711
+ return /* @__PURE__ */ j(Xi, {
6689
6712
  cursor: u.x,
6690
6713
  active: u.active,
6691
6714
  center: E,
6692
- reach: Vi,
6715
+ reach: Ui,
6693
6716
  children: /* @__PURE__ */ j(P.text, {
6694
6717
  animate: {
6695
6718
  opacity: n ? c : 0,
@@ -6704,7 +6727,7 @@ function Zi({ className: e, edgeInset: t, labels: n } = {}) {
6704
6727
  y: r.plot.bottom + 22 + 9
6705
6728
  },
6706
6729
  textAnchor: w,
6707
- transition: qi(o, s, d),
6730
+ transition: Yi(o, s, d),
6708
6731
  children: h
6709
6732
  })
6710
6733
  }, `x-${e.value}`);
@@ -6712,8 +6735,8 @@ function Zi({ className: e, edgeInset: t, labels: n } = {}) {
6712
6735
  ]
6713
6736
  });
6714
6737
  }
6715
- function Qi({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
6716
- let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = Ut(), u = at(), d = c === "initial" || c === "handoff", f = new Map((i?.yTicks ?? []).map((e) => [e, i.yToPixel(e)])), p = new Set(r.yTicks), m = u.axis.y, h = m === "segmented", g = Ki(u.axis.yGradient), _ = m !== "classic" && !h, v = h ? 16 : 12, y = n === "secondary", b = r.secondary, x = y ? _ ? r.plot.right - u.inset : r.plot.right + v : _ ? r.plot.left + u.inset : r.plot.left - v, S = y === _ ? "end" : "start", C = (e) => y && b ? b.format(e * b.factor) : r.formatY(e), w = _ ? -6 : 4, T = r.yTicks.length ? Math.min(...r.yTicks) : null;
6738
+ function ea({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
6739
+ let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = Ut(), u = at(), d = c === "initial" || c === "handoff", f = new Map((i?.yTicks ?? []).map((e) => [e, i.yToPixel(e)])), p = new Set(r.yTicks), m = u.axis.y, h = m === "segmented", g = Ji(u.axis.yGradient), _ = m !== "classic" && !h, v = h ? 16 : 12, y = n === "secondary", b = r.secondary, x = y ? _ ? r.plot.right - u.inset : r.plot.right + v : _ ? r.plot.left + u.inset : r.plot.left - v, S = y === _ ? "end" : "start", C = (e) => y && b ? b.format(e * b.factor) : r.formatY(e), w = _ ? -6 : 4, T = r.yTicks.length ? Math.min(...r.yTicks) : null;
6717
6740
  return y && !b ? null : /* @__PURE__ */ M("g", {
6718
6741
  "aria-hidden": "true",
6719
6742
  className: [
@@ -6723,13 +6746,13 @@ function Qi({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
6723
6746
  ].filter(Boolean).join(" "),
6724
6747
  "data-inline": _ || void 0,
6725
6748
  "data-scale": y ? "secondary" : void 0,
6726
- children: [h && !y ? /* @__PURE__ */ j(zi, {
6749
+ children: [h && !y ? /* @__PURE__ */ j(Vi, {
6727
6750
  stops: [
6728
6751
  r.plot.top,
6729
6752
  ...r.yTicks.map((e) => r.yToPixel(e)),
6730
6753
  r.plot.bottom
6731
6754
  ],
6732
- cross: r.plot.left - Gi,
6755
+ cross: r.plot.left - qi,
6733
6756
  vertical: !0,
6734
6757
  gradient: g,
6735
6758
  cursor: u.y,
@@ -6738,11 +6761,11 @@ function Qi({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
6738
6761
  }) : null, t && m !== "minimal" && m !== "dots" && a.y.map((e, t) => {
6739
6762
  if (_ && e.value === T) return null;
6740
6763
  let n = p.has(e.value), i = n ? r.yToPixel(e.value) : f.get(e.value) ?? r.yToPixel(e.value), c = f.get(e.value) ?? i + 6, m = d && !s ? $t(l * o, en(t, a.y.length, 80), 280) : 1;
6741
- return /* @__PURE__ */ j(Ji, {
6764
+ return /* @__PURE__ */ j(Xi, {
6742
6765
  cursor: u.y,
6743
6766
  active: u.active,
6744
6767
  center: i,
6745
- reach: Hi,
6768
+ reach: Wi,
6746
6769
  children: /* @__PURE__ */ j(P.text, {
6747
6770
  animate: {
6748
6771
  opacity: n ? m : 0,
@@ -6757,7 +6780,7 @@ function Qi({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
6757
6780
  y: c + w + 6
6758
6781
  },
6759
6782
  textAnchor: S,
6760
- transition: qi(o, s, d),
6783
+ transition: Yi(o, s, d),
6761
6784
  children: C(e.value)
6762
6785
  })
6763
6786
  }, `y-${e.value}`);
@@ -6766,11 +6789,11 @@ function Qi({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
6766
6789
  }
6767
6790
  //#endregion
6768
6791
  //#region src/interaction/legend-meter.tsx
6769
- function $i(e) {
6792
+ function ta(e) {
6770
6793
  let t = Math.max(0, ...e.map((e) => e !== null && e > 0 ? e : 0));
6771
6794
  return t > 0 ? t : null;
6772
6795
  }
6773
- function ea({ value: e, scale: t }) {
6796
+ function na({ value: e, scale: t }) {
6774
6797
  let n = e !== null && e > 0 && t ? Math.min(1, e / t) : 0;
6775
6798
  return /* @__PURE__ */ j("span", {
6776
6799
  className: "lilt-chart__legend-meter",
@@ -6780,11 +6803,11 @@ function ea({ value: e, scale: t }) {
6780
6803
  }
6781
6804
  //#endregion
6782
6805
  //#region src/interaction/value-legend.tsx
6783
- var ta = (e) => e === "tiles" ? "cards" : e;
6784
- function na({ items: e, variant: t = "cards", swatch: n = "square", activeId: r, selectedId: i, onHoverIdChange: a, onSelectedIdChange: o, hiddenIds: s = [], onHiddenIdsChange: c, renderLabel: l, renderValue: u, renderSwatch: d, renderItem: f, "aria-label": p = "Values", className: m, style: h }) {
6806
+ var ra = (e) => e === "tiles" ? "cards" : e;
6807
+ function ia({ items: e, variant: t = "cards", swatch: n = "square", activeId: r, selectedId: i, onHoverIdChange: a, onSelectedIdChange: o, hiddenIds: s = [], onHiddenIdsChange: c, renderLabel: l, renderValue: u, renderSwatch: d, renderItem: f, "aria-label": p = "Values", className: m, style: h }) {
6785
6808
  let g = !!c && e.length > 1, _ = !!(a || o || g), v = new Set(s), y = e.filter((e) => !v.has(e.id)).length, b = (e) => c?.(e), x = (e) => {
6786
6809
  v.has(e) ? b(s.filter((t) => t !== e)) : y > 1 && b([...s, e]);
6787
- }, S = $i(e.filter((e) => !v.has(e.id)).map((e) => e.value)), C = (t) => b(e.map((e) => e.id).filter((e) => e !== t));
6810
+ }, S = ta(e.filter((e) => !v.has(e.id)).map((e) => e.value)), C = (t) => b(e.map((e) => e.id).filter((e) => e !== t));
6788
6811
  return /* @__PURE__ */ j("div", {
6789
6812
  "data-lilt-chart": "",
6790
6813
  role: "group",
@@ -6813,7 +6836,7 @@ function na({ items: e, variant: t = "cards", swatch: n = "square", activeId: r,
6813
6836
  className: "lilt-chart__legend-value",
6814
6837
  children: u?.(e) ?? e.formattedValue
6815
6838
  }),
6816
- t === "bars" ? /* @__PURE__ */ j(ea, {
6839
+ t === "bars" ? /* @__PURE__ */ j(na, {
6817
6840
  value: e.value,
6818
6841
  scale: S
6819
6842
  }) : null
@@ -6877,15 +6900,15 @@ function na({ items: e, variant: t = "cards", swatch: n = "square", activeId: r,
6877
6900
  }
6878
6901
  //#endregion
6879
6902
  //#region src/primitives/annotations.tsx
6880
- function ra(e) {
6903
+ function aa(e) {
6881
6904
  return e instanceof Date ? e.getTime() : e;
6882
6905
  }
6883
- function ia({ items: e, onSelectionChange: t, className: n }) {
6906
+ function oa({ items: e, onSelectionChange: t, className: n }) {
6884
6907
  let { snapshot: r, reducedMotion: i } = Ut(), [a, o] = k(null), [s, c] = k(null);
6885
6908
  return /* @__PURE__ */ j("g", {
6886
6909
  className: ["lilt-chart__annotations", n].filter(Boolean).join(" "),
6887
6910
  children: e.map((e, n) => {
6888
- let l = ra(e.x);
6911
+ let l = aa(e.x);
6889
6912
  if (l < r.xDomain[0] || l > r.xDomain[1]) return null;
6890
6913
  let u = r.xToPixel(l), d = a === e.id || s === e.id;
6891
6914
  return /* @__PURE__ */ M("g", {
@@ -6971,10 +6994,10 @@ function ia({ items: e, onSelectionChange: t, className: n }) {
6971
6994
  })
6972
6995
  });
6973
6996
  }
6974
- function aa({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis: i = "x", className: a }) {
6997
+ function sa({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis: i = "x", className: a }) {
6975
6998
  let { snapshot: o } = Ut();
6976
6999
  if (i === "y") {
6977
- let i = o.yDomain, s = Math.max(i?.[0] ?? 0, Math.min(ra(e), ra(t))), c = Math.min(i?.[1] ?? 0, Math.max(ra(e), ra(t)));
7000
+ let i = o.yDomain, s = Math.max(i?.[0] ?? 0, Math.min(aa(e), aa(t))), c = Math.min(i?.[1] ?? 0, Math.max(aa(e), aa(t)));
6978
7001
  if (!i || s > c) return /* @__PURE__ */ j("g", {});
6979
7002
  let l = o.yToPixel(c), u = o.yToPixel(s);
6980
7003
  return /* @__PURE__ */ M("g", {
@@ -6996,7 +7019,7 @@ function aa({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis:
6996
7019
  }) : null]
6997
7020
  });
6998
7021
  }
6999
- let s = Math.min(ra(e), ra(t)), c = Math.max(ra(e), ra(t)), l = Math.max(o.xDomain[0], s), u = Math.min(o.xDomain[1], c);
7022
+ let s = Math.min(aa(e), aa(t)), c = Math.max(aa(e), aa(t)), l = Math.max(o.xDomain[0], s), u = Math.min(o.xDomain[1], c);
7000
7023
  if (l > u) return /* @__PURE__ */ j("g", {});
7001
7024
  let d = s === -Infinity ? o.plot.left : o.xToPixel(l), f = c === Infinity ? o.plot.right : o.xToPixel(u);
7002
7025
  return /* @__PURE__ */ M("g", {
@@ -7019,7 +7042,7 @@ function aa({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis:
7019
7042
  }
7020
7043
  //#endregion
7021
7044
  //#region src/primitives/reference-line.tsx
7022
- function oa({ value: e, label: t, color: n = "var(--lilt-muted)", className: r }) {
7045
+ function ca({ value: e, label: t, color: n = "var(--lilt-muted)", className: r }) {
7023
7046
  let { snapshot: i } = Ut(), a = i.yDomain;
7024
7047
  if (!a || !Number.isFinite(e) || e < a[0] || e > a[1]) return null;
7025
7048
  let o = i.yToPixel(e), { left: s, right: c, top: l } = i.plot, u = o - 6 < l + 10 ? o + 14 : o - 6;
@@ -7043,12 +7066,12 @@ function oa({ value: e, label: t, color: n = "var(--lilt-muted)", className: r }
7043
7066
  }
7044
7067
  //#endregion
7045
7068
  //#region src/cards/keys.ts
7046
- var sa = new Intl.DateTimeFormat("en-US", {
7069
+ var la = new Intl.DateTimeFormat("en-US", {
7047
7070
  month: "short",
7048
7071
  day: "numeric",
7049
7072
  timeZone: "UTC"
7050
- }), ca = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
7051
- function la(e, t, n, r) {
7073
+ }), ua = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
7074
+ function da(e, t, n, r) {
7052
7075
  let i = (e) => e[t], a = e.length > 0 ? i(e[0]) : void 0, o = n ?? (typeof a == "string" ? "category" : a instanceof Date ? "time" : "number");
7053
7076
  if (o === "category") {
7054
7077
  let t = /* @__PURE__ */ new Map();
@@ -7068,16 +7091,16 @@ function la(e, t, n, r) {
7068
7091
  let t = i(e);
7069
7092
  return t instanceof Date ? t.getTime() : Number(t);
7070
7093
  },
7071
- format: (e) => r ? r(new Date(e)) : sa.format(e)
7094
+ format: (e) => r ? r(new Date(e)) : la.format(e)
7072
7095
  } : {
7073
7096
  kind: o,
7074
7097
  position: (e) => Number(i(e)),
7075
- format: (e) => r ? r(e) : ca.format(e)
7098
+ format: (e) => r ? r(e) : ua.format(e)
7076
7099
  };
7077
7100
  }
7078
7101
  //#endregion
7079
7102
  //#region src/cards/format.ts
7080
- function ua(e, t) {
7103
+ function fa(e, t) {
7081
7104
  let n = [];
7082
7105
  for (let r of e) {
7083
7106
  let e = r[t];
@@ -7085,14 +7108,14 @@ function ua(e, t) {
7085
7108
  }
7086
7109
  return n;
7087
7110
  }
7088
- function da(e, t) {
7111
+ function pa(e, t) {
7089
7112
  if (!e.length) return null;
7090
7113
  if (t === "last") return e.at(-1);
7091
7114
  if (t === "max") return fe(e);
7092
7115
  let n = e.reduce((e, t) => e + t, 0);
7093
7116
  return t === "mean" ? n / e.length : n;
7094
7117
  }
7095
- function fa(e, t) {
7118
+ function ma(e, t) {
7096
7119
  let n = new Intl.NumberFormat(e, {
7097
7120
  maximumFractionDigits: Math.max(1, t?.minimumFractionDigits ?? 0),
7098
7121
  minimumFractionDigits: 0,
@@ -7109,8 +7132,8 @@ function fa(e, t) {
7109
7132
  plain: g(i)
7110
7133
  };
7111
7134
  }
7112
- function pa({ valueFormat: e, locale: t = "en-US", formatValue: n, formatAxisValue: r }) {
7113
- let i = JSON.stringify(e ?? null), a = D(() => fa(t, e), [t, i]), o = n ?? a.full, s = r ?? a.compact, c = O({
7135
+ function ha({ valueFormat: e, locale: t = "en-US", formatValue: n, formatAxisValue: r }) {
7136
+ let i = JSON.stringify(e ?? null), a = D(() => ma(t, e), [t, i]), o = n ?? a.full, s = r ?? a.compact, c = O({
7114
7137
  value: o,
7115
7138
  axis: s
7116
7139
  });
@@ -7127,12 +7150,12 @@ function pa({ valueFormat: e, locale: t = "en-US", formatValue: n, formatAxisVal
7127
7150
  key: `${t}|${i}`
7128
7151
  };
7129
7152
  }
7130
- function ma(e) {
7153
+ function ga(e) {
7131
7154
  return (t) => `${t < 0 ? "−" : "+"}${e(Math.abs(t))}`;
7132
7155
  }
7133
7156
  //#endregion
7134
7157
  //#region src/engine/composition.ts
7135
- function ha(e) {
7158
+ function _a(e) {
7136
7159
  if (!e.length) return [];
7137
7160
  if (e.some((e) => typeof e != "number" || !Number.isFinite(e) || e < 0)) return e.map(() => null);
7138
7161
  let t = e, n = t.reduce((e, t) => Math.max(e, t), 0);
@@ -7142,8 +7165,8 @@ function ha(e) {
7142
7165
  }
7143
7166
  //#endregion
7144
7167
  //#region src/watch/normal-layer.tsx
7145
- var ga = "normalLower", _a = "normalUpper", va = L().x((e) => e.x).y0((e) => e.lower).y1((e) => e.upper).curve(ce);
7146
- function ya({ series: e, flagged: t, part: n }) {
7168
+ var va = "normalLower", ya = "normalUpper", ba = L().x((e) => e.x).y0((e) => e.lower).y1((e) => e.upper).curve(ce);
7169
+ function xa({ series: e, flagged: t, part: n }) {
7147
7170
  let { snapshot: r, clipId: i, revealProgress: a, visibleSeries: o } = Ut(), s = r.yToPixelFor(e), [c, l] = r.xDomain, u = o.includes(e), d = r.data.rows;
7148
7171
  if (n === "band") {
7149
7172
  let t = [], n = [];
@@ -7163,7 +7186,7 @@ function ya({ series: e, flagged: t, part: n }) {
7163
7186
  style: { opacity: +!!u },
7164
7187
  children: t.map((e, t) => /* @__PURE__ */ j("path", {
7165
7188
  className: "lilt-chart__normal-band",
7166
- d: va(ba(e)) ?? ""
7189
+ d: ba(Sa(e)) ?? ""
7167
7190
  }, t))
7168
7191
  });
7169
7192
  }
@@ -7221,7 +7244,7 @@ function ya({ series: e, flagged: t, part: n }) {
7221
7244
  ]
7222
7245
  });
7223
7246
  }
7224
- function ba(e) {
7247
+ function Sa(e) {
7225
7248
  return e.map((t, n) => {
7226
7249
  let r = e.slice(Math.max(0, n - 1), n + 2);
7227
7250
  return {
@@ -7233,18 +7256,18 @@ function ba(e) {
7233
7256
  }
7234
7257
  //#endregion
7235
7258
  //#region src/cards/cartesian-card.tsx
7236
- function xa(e) {
7259
+ function Ca(e) {
7237
7260
  return e === !0 ? "sum" : e ?? !1;
7238
7261
  }
7239
- var Sa = [], Ca = (e) => e.acceptedRevision;
7240
- function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggregate: y = "sum", headlineSeries: b, delta: x, deltaTone: S, range: T, ranges: E, defaultRange: ee, tiles: te = !0, legend: N = "tiles", legendSwatch: P, depth: ne = !1, height: re = 240, valueFormat: ie, locale: F = "en-US", formatValue: I, formatAxisValue: ae, formatX: oe, xType: L, compare: se = !1, target: ce, forecast: R, sync: le, axis: ue = "minimal", hover: de = "pills", hoverStyle: fe = "soft", background: z = "dots", spotlight: pe = !0, decimate: B = !0, surface: me = "elevated", badge: he, numberStyle: ge, palette: _e, bleed: ve = e.kind !== "bar" && e.kind !== "marks", axisInset: ye, pillSeries: xe = "nearest", pillValue: Se = "series", pillPosition: Ce = "auto", tooltipIndicator: we = "square", loading: Te = !1, loadingStyle: Ee, motion: De, className: Oe, style: ke, panes: Ae, live: je = !1, heading: Me, restCaption: Ne, normal: Pe, onNormalChange: Fe }) {
7241
- let [Ie, Le] = k(ee ?? E?.[0]?.id), Re = E?.find((e) => e.id === Ie) ?? E?.[0], ze = Re?.data ?? r ?? Sa, Be = Re ? Re.delta : x, Ve = e.kind === "line" || e.kind === "marks" ? !1 : e.stack, He = Ve !== !1, Ue = Ve === "percent", We = Ue ? "last" : y, Ge = ve && e.kind !== "bar" && e.kind !== "marks", Ke = D(() => {
7262
+ var wa = [], Ta = (e) => e.acceptedRevision;
7263
+ function Ea({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggregate: y = "sum", headlineSeries: b, delta: x, deltaTone: S, range: T, ranges: E, defaultRange: ee, tiles: te = !0, legend: N = "tiles", legendSwatch: P, depth: ne = !1, height: re = 240, valueFormat: ie, locale: F = "en-US", formatValue: I, formatAxisValue: ae, formatX: oe, xType: L, compare: se = !1, target: ce, forecast: R, sync: le, axis: ue = "minimal", hover: de = "pills", hoverStyle: fe = "soft", background: z = "dots", spotlight: pe = !0, decimate: B = !0, surface: me = "elevated", badge: he, numberStyle: ge, palette: _e, bleed: ve = e.kind !== "bar" && e.kind !== "marks", axisInset: ye, pillSeries: xe = "nearest", pillValue: Se = "series", pillPosition: Ce = "auto", tooltipIndicator: we = "square", loading: Te = !1, loadingStyle: Ee, motion: De, className: Oe, style: ke, panes: Ae, live: je = !1, heading: Me, restCaption: Ne, normal: Pe, onNormalChange: Fe }) {
7264
+ let [Ie, Le] = k(ee ?? E?.[0]?.id), Re = E?.find((e) => e.id === Ie) ?? E?.[0], ze = Re?.data ?? r ?? wa, Be = Re ? Re.delta : x, Ve = e.kind === "line" || e.kind === "marks" ? !1 : e.stack, He = Ve !== !1, Ue = Ve === "percent", We = Ue ? "last" : y, Ge = ve && e.kind !== "bar" && e.kind !== "marks", Ke = D(() => {
7242
7265
  let e = new Intl.NumberFormat(F, {
7243
7266
  style: "percent",
7244
7267
  maximumFractionDigits: 1
7245
7268
  });
7246
7269
  return (t) => e.format(t / 100);
7247
- }, [F]), V = pa({
7270
+ }, [F]), V = ha({
7248
7271
  valueFormat: ie,
7249
7272
  locale: F,
7250
7273
  formatValue: Ue ? Ke : I,
@@ -7252,16 +7275,16 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7252
7275
  }), qe = V.value, Je = V.key, H = JSON.stringify(e), Ye = _.map((e) => `${e.key}|${e.label}|${e.color}|${e.dashed}|${e.as}|${e.scale}|${JSON.stringify(e.valueFormat ?? null)}`).join(), U = new Set(_.filter((e) => e.as === "line" || e.dashed).map((e) => e.key)), Xe = D(() => {
7253
7276
  if (!Ue) return null;
7254
7277
  let e = _.filter((e) => !U.has(e.key));
7255
- return new Map(ze.map((t) => [t, Object.fromEntries(ha(e.map((e) => t[e.key])).map((t, n) => [e[n].key, t]))]));
7278
+ return new Map(ze.map((t) => [t, Object.fromEntries(_a(e.map((e) => t[e.key])).map((t, n) => [e[n].key, t]))]));
7256
7279
  }, [
7257
7280
  Ue,
7258
7281
  ze,
7259
7282
  Ye
7260
- ]), Ze = D(() => new Map(_.flatMap((e) => e.valueFormat ? [[e.key, fa(F, e.valueFormat)]] : [])), [Ye, F]), Qe = (e) => Ze.get(e)?.full ?? qe, W = D(() => la(ze, g, L, oe), [
7283
+ ]), Ze = D(() => new Map(_.flatMap((e) => e.valueFormat ? [[e.key, ma(F, e.valueFormat)]] : [])), [Ye, F]), Qe = (e) => Ze.get(e)?.full ?? qe, W = D(() => da(ze, g, L, oe), [
7261
7284
  ze,
7262
7285
  g,
7263
7286
  L
7264
- ]), $e = R?.from instanceof Date ? R.from.getTime() : R?.from, nt = D(() => $e === void 0 ? null : Oa(ze, g, W, $e), [
7287
+ ]), $e = R?.from instanceof Date ? R.from.getTime() : R?.from, nt = D(() => $e === void 0 ? null : Aa(ze, g, W, $e), [
7265
7288
  ze,
7266
7289
  g,
7267
7290
  W,
@@ -7270,9 +7293,9 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7270
7293
  ze,
7271
7294
  nt,
7272
7295
  W
7273
- ]), it = R?.lower && R.upper && !He && e.kind !== "bar" && e.kind !== "marks" ? b ?? _.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, at = Pe && !He && (e.kind === "area" || e.kind === "line") ? Pe.series ?? b ?? _.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, ot = Pe ? Ta(Pe) : "", lt = D(() => {
7296
+ ]), it = R?.lower && R.upper && !He && e.kind !== "bar" && e.kind !== "marks" ? b ?? _.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, at = Pe && !He && (e.kind === "area" || e.kind === "line") ? Pe.series ?? b ?? _.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, ot = Pe ? Da(Pe) : "", lt = D(() => {
7274
7297
  if (!Pe || at === void 0) return null;
7275
- let { when: e, history: t = Sa, ...n } = Pe, r = t.length, i = r ? [...t, ...ze] : ze;
7298
+ let { when: e, history: t = wa, ...n } = Pe, r = t.length, i = r ? [...t, ...ze] : ze;
7276
7299
  return {
7277
7300
  combined: i,
7278
7301
  all: p({
@@ -7358,19 +7381,19 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7358
7381
  ...it === t.key && R?.lower && R.upper ? {
7359
7382
  lower: {
7360
7383
  label: `${R.label ?? "Forecast"} low`,
7361
- accessor: (e) => Da(e, R.lower)
7384
+ accessor: (e) => ka(e, R.lower)
7362
7385
  },
7363
7386
  upper: {
7364
7387
  label: `${R.label ?? "Forecast"} high`,
7365
- accessor: (e) => Da(e, R.upper)
7388
+ accessor: (e) => ka(e, R.upper)
7366
7389
  }
7367
7390
  } : {},
7368
7391
  ...at === t.key && dt ? {
7369
- [ga]: {
7392
+ [va]: {
7370
7393
  label: "Normal low",
7371
7394
  accessor: (e) => dt.get(e)?.lower ?? null
7372
7395
  },
7373
- [_a]: {
7396
+ [ya]: {
7374
7397
  label: "Normal high",
7375
7398
  accessor: (e) => dt.get(e)?.upper ?? null
7376
7399
  }
@@ -7477,10 +7500,10 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7477
7500
  hr(le, Ft.getController(), ze, g, W, {
7478
7501
  label: t,
7479
7502
  release: Ft.actions.release
7480
- }), tt(Ft, Ca);
7503
+ }), tt(Ft, Ta);
7481
7504
  let Lt = new Set(Ft.series.map((e) => e.id)), [Rt, zt] = k(null), [Bt, Vt] = k([]), Ht = new Set(Bt), Ut = D(() => St.map((e, t) => ({
7482
7505
  id: e.id,
7483
- total: Xe ? rt.length && !U.has(e.id) ? Xe.get(rt.at(-1))?.[e.id] ?? null : null : da(ua(rt, e.id), _[t]?.aggregate ?? We)
7506
+ total: Xe ? rt.length && !U.has(e.id) ? Xe.get(rt.at(-1))?.[e.id] ?? null : null : pa(fa(rt, e.id), _[t]?.aggregate ?? We)
7484
7507
  })), [
7485
7508
  St,
7486
7509
  rt,
@@ -7495,13 +7518,13 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7495
7518
  b,
7496
7519
  He,
7497
7520
  Bt
7498
- ]), Gt = Ue ? Ut.some((e) => K.has(e.id) && e.total === null) || !rt.length ? null : Ut.reduce((e, t) => e + (K.has(t.id) ? t.total ?? 0 : 0), 0) : Re?.headline ?? v ?? (K.size === 0 ? null : We === "sum" ? Ut.reduce((e, t) => e + (K.has(t.id) ? t.total ?? 0 : 0), 0) : da(Wt, We) ?? 0), Kt = de === "tooltip" ? null : It, qt = Kt ? new Map(Kt.series.map((e) => [e.id, e.value])) : null, Jt = tt(Ft, (e) => e.comparison), Yt = se === "badge", Xt = !Yt && !It && Jt?.phase === "complete" ? Jt : null, Zt = Yt ? Jt : null, q = Xt ? new Map(Xt.series.map((e) => [e.id, e.absoluteChange])) : null, Qt = (e) => e.series.filter((e) => K.has(e.id)).reduce((e, t) => ({
7521
+ ]), Gt = Ue ? Ut.some((e) => K.has(e.id) && e.total === null) || !rt.length ? null : Ut.reduce((e, t) => e + (K.has(t.id) ? t.total ?? 0 : 0), 0) : Re?.headline ?? v ?? (K.size === 0 ? null : We === "sum" ? Ut.reduce((e, t) => e + (K.has(t.id) ? t.total ?? 0 : 0), 0) : pa(Wt, We) ?? 0), Kt = de === "tooltip" ? null : It, qt = Kt ? new Map(Kt.series.map((e) => [e.id, e.value])) : null, Jt = tt(Ft, (e) => e.comparison), Yt = se === "badge", Xt = !Yt && !It && Jt?.phase === "complete" ? Jt : null, Zt = Yt ? Jt : null, q = Xt ? new Map(Xt.series.map((e) => [e.id, e.absoluteChange])) : null, Qt = (e) => e.series.filter((e) => K.has(e.id)).reduce((e, t) => ({
7499
7522
  start: e.start + (t.startValue ?? 0),
7500
7523
  end: e.end + (t.endValue ?? 0)
7501
7524
  }), {
7502
7525
  start: 0,
7503
7526
  end: 0
7504
- }), $t = Xt ? Qt(Xt) : void 0, en = Zt ? Qt(Zt) : void 0, tn = Ue ? (e) => `${new Intl.NumberFormat(F, { maximumFractionDigits: 1 }).format(e)} pp` : qe, nn = ma(tn), rn = jt === null ? null : Wt.filter((e) => S === "inverse" ? e <= jt : e >= jt).length, an = Ne && ze.length ? Ne(ze) : null, on = Kt && e.kind === "marks" ? e.describe?.(Kt) ?? null : null, sn = Kt && ut ? ut[Kt.sourceIndex] ?? null : null, cn = sn?.severity ? ht(Kt?.sourceIndex) ?? mt(sn.flags) : null, ln = !!(nt !== null && Kt?.series.some((e) => e.status === "forecast")), un = K.size === 0 || Ue && Xt?.series.some((e) => K.has(e.id) && (e.startValue === null || e.endValue === null)) ? null : qt ? Ue && [...K].some((e) => qt.get(e) == null) ? null : [...qt].reduce((e, [t, n]) => e + (K.has(t) ? n ?? 0 : 0), 0) : $t ? $t.end - $t.start : Gt, dn = (e) => {
7527
+ }), $t = Xt ? Qt(Xt) : void 0, en = Zt ? Qt(Zt) : void 0, tn = Ue ? (e) => `${new Intl.NumberFormat(F, { maximumFractionDigits: 1 }).format(e)} pp` : qe, nn = ga(tn), rn = jt === null ? null : Wt.filter((e) => S === "inverse" ? e <= jt : e >= jt).length, an = Ne && ze.length ? Ne(ze) : null, on = Kt && e.kind === "marks" ? e.describe?.(Kt) ?? null : null, sn = Kt && ut ? ut[Kt.sourceIndex] ?? null : null, cn = sn?.severity ? ht(Kt?.sourceIndex) ?? mt(sn.flags) : null, ln = !!(nt !== null && Kt?.series.some((e) => e.status === "forecast")), un = K.size === 0 || Ue && Xt?.series.some((e) => K.has(e.id) && (e.startValue === null || e.endValue === null)) ? null : qt ? Ue && [...K].some((e) => qt.get(e) == null) ? null : [...qt].reduce((e, [t, n]) => e + (K.has(t) ? n ?? 0 : 0), 0) : $t ? $t.end - $t.start : Gt, dn = (e) => {
7505
7528
  zt(e), Ft.actions.focusSeries(e);
7506
7529
  }, fn = (e) => {
7507
7530
  Vt(e), dn(null), Ft.actions.setVisibleSeries(St.map((e) => e.id).filter((t) => !e.includes(t)));
@@ -7510,56 +7533,56 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7510
7533
  right: mn && gn ? hn : _n,
7511
7534
  bottom: e.kind === "marks" && e.xAxis === !1 ? 6 : 28,
7512
7535
  left: mn ? hn : _n
7513
- }, J = ye ?? (ve ? 20 : 0), yn = St.filter((e) => !U.has(e.id)).map((e) => e.id), bn = St.filter((e) => Lt.has(e.id)), xn = rt.length ? W.position(rt.at(-1)) : null, Sn = ze.length ? W.position(ze.at(-1)) : null, Cn = nt === null || Sn === null || nt > Sn ? null : xn === null ? nt : e.kind === "bar" ? (xn + ka(ze, W, nt)) / 2 : xn, wn = /* @__PURE__ */ M(A, { children: [
7514
- /* @__PURE__ */ j(Fi, { pattern: "lines" }),
7515
- Cn === null ? null : /* @__PURE__ */ j(aa, {
7536
+ }, J = ye ?? (ve ? 20 : 0), yn = St.filter((e) => !U.has(e.id)).map((e) => e.id), bn = St.filter((e) => Lt.has(e.id)), xn = rt.length ? W.position(rt.at(-1)) : null, Sn = ze.length ? W.position(ze.at(-1)) : null, Cn = nt === null || Sn === null || nt > Sn ? null : xn === null ? nt : e.kind === "bar" ? (xn + ja(ze, W, nt)) / 2 : xn, wn = /* @__PURE__ */ M(A, { children: [
7537
+ /* @__PURE__ */ j(Li, { pattern: "lines" }),
7538
+ Cn === null ? null : /* @__PURE__ */ j(sa, {
7516
7539
  from: Cn,
7517
7540
  to: Infinity,
7518
7541
  label: R?.label ?? "Forecast",
7519
7542
  color: "var(--lilt-muted)",
7520
7543
  className: "lilt-card__forecast"
7521
7544
  }),
7522
- it && Lt.has(it) ? /* @__PURE__ */ j(Ai, {
7545
+ it && Lt.has(it) ? /* @__PURE__ */ j(Mi, {
7523
7546
  series: it,
7524
7547
  lower: "lower",
7525
7548
  upper: "upper"
7526
7549
  }) : null,
7527
- at && Lt.has(at) ? /* @__PURE__ */ j(ya, {
7550
+ at && Lt.has(at) ? /* @__PURE__ */ j(xa, {
7528
7551
  series: at,
7529
7552
  flagged: ft,
7530
7553
  part: "band"
7531
7554
  }) : null,
7532
- e.kind === "area" ? bn.map((e) => U.has(e.id) ? null : /* @__PURE__ */ j(di, {
7555
+ e.kind === "area" ? bn.map((e) => U.has(e.id) ? null : /* @__PURE__ */ j(pi, {
7533
7556
  model: Ft,
7534
7557
  series: e.id
7535
7558
  }, `area-${e.id}`)) : null,
7536
- e.kind === "bar" ? yn.filter((e) => Lt.has(e)).map((e) => /* @__PURE__ */ j(Ni, {
7559
+ e.kind === "bar" ? yn.filter((e) => Lt.has(e)).map((e) => /* @__PURE__ */ j(Fi, {
7537
7560
  model: Ft,
7538
7561
  series: e
7539
7562
  }, `bar-${e}`)) : null,
7540
7563
  e.kind === "marks" ? e.draw(yn.filter((e) => Lt.has(e))) : null,
7541
- bn.map((t) => (e.kind === "bar" || e.kind === "marks") && !U.has(t.id) ? null : /* @__PURE__ */ j(Mi, {
7564
+ bn.map((t) => (e.kind === "bar" || e.kind === "marks") && !U.has(t.id) ? null : /* @__PURE__ */ j(Pi, {
7542
7565
  model: Ft,
7543
7566
  series: t.id
7544
7567
  }, `line-${t.id}`)),
7545
- at && Lt.has(at) ? /* @__PURE__ */ j(ya, {
7568
+ at && Lt.has(at) ? /* @__PURE__ */ j(xa, {
7546
7569
  series: at,
7547
7570
  flagged: ft,
7548
7571
  part: "flags"
7549
7572
  }) : null,
7550
- Mt.map((e) => /* @__PURE__ */ j(oa, {
7573
+ Mt.map((e) => /* @__PURE__ */ j(ca, {
7551
7574
  value: e.value,
7552
7575
  label: `${e.label} ${V.axis(e.value)}`,
7553
7576
  className: "lilt-card__limit"
7554
7577
  }, e.id)),
7555
- jt === null ? null : /* @__PURE__ */ j(oa, {
7578
+ jt === null ? null : /* @__PURE__ */ j(ca, {
7556
7579
  value: jt,
7557
7580
  label: `${At.label} ${V.axis(jt)}`,
7558
7581
  className: "lilt-card__target"
7559
7582
  }),
7560
- e.kind !== "marks" || e.xAxis !== !1 ? /* @__PURE__ */ j(Zi, { labels: e.kind === "bar" || e.kind === "marks" ? "fit" : void 0 }) : null,
7561
- /* @__PURE__ */ j(Qi, {}),
7562
- gn ? /* @__PURE__ */ j(Qi, { scale: "secondary" }) : null
7583
+ e.kind !== "marks" || e.xAxis !== !1 ? /* @__PURE__ */ j($i, { labels: e.kind === "bar" || e.kind === "marks" ? "fit" : void 0 }) : null,
7584
+ /* @__PURE__ */ j(ea, {}),
7585
+ gn ? /* @__PURE__ */ j(ea, { scale: "secondary" }) : null
7563
7586
  ] }), Tn = {
7564
7587
  model: Ft,
7565
7588
  height: re,
@@ -7579,7 +7602,7 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7579
7602
  indicator: we,
7580
7603
  adaptive: !1
7581
7604
  } : void 0
7582
- }, Y = He && yn.length ? { series: yn } : void 0, En = /* @__PURE__ */ j(Jr, {
7605
+ }, Y = He && yn.length ? { series: yn } : void 0, En = /* @__PURE__ */ j(Xr, {
7583
7606
  ...Tn,
7584
7607
  bars: e.kind === "bar" ? He ? {
7585
7608
  segmentGap: 2,
@@ -7668,7 +7691,7 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7668
7691
  jt !== null && jt !== 0 && un !== null ? /* @__PURE__ */ j(a, {
7669
7692
  value: un / jt - 1,
7670
7693
  tone: S,
7671
- format: Ea
7694
+ format: Oa
7672
7695
  }) : null,
7673
7696
  /* @__PURE__ */ M(i, { children: [
7674
7697
  Kt.formattedX,
@@ -7741,9 +7764,9 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7741
7764
  formatValue: qe,
7742
7765
  formatAxis: V.axis
7743
7766
  }) : null,
7744
- te ? /* @__PURE__ */ j(na, {
7767
+ te ? /* @__PURE__ */ j(ia, {
7745
7768
  className: "lilt-card__tiles",
7746
- variant: ta(N),
7769
+ variant: ra(N),
7747
7770
  swatch: P,
7748
7771
  "aria-label": `${t} by series`,
7749
7772
  activeId: Rt ?? It?.activeSeriesId ?? null,
@@ -7758,22 +7781,22 @@ function wa({ shape: e, title: t, data: r, x: g, series: _, headline: v, aggrega
7758
7781
  label: e.label,
7759
7782
  color: e.color,
7760
7783
  value: t,
7761
- formattedValue: t === null ? "—" : q ? ma(Ue ? tn : Qe(e.id))(t) : Qe(e.id)(t)
7784
+ formattedValue: t === null ? "—" : q ? ga(Ue ? tn : Qe(e.id))(t) : Qe(e.id)(t)
7762
7785
  };
7763
7786
  })
7764
7787
  }) : null
7765
7788
  ]
7766
7789
  });
7767
7790
  }
7768
- function Ta({ history: e, ...t }) {
7791
+ function Da({ history: e, ...t }) {
7769
7792
  return JSON.stringify(t, (e, t) => typeof t == "function" ? String(t) : t);
7770
7793
  }
7771
- var Ea = (e) => `${e >= 0 ? "+" : "−"}${Math.abs(e * 100).toFixed(1)}% vs target`;
7772
- function Da(e, t) {
7794
+ var Oa = (e) => `${e >= 0 ? "+" : "−"}${Math.abs(e * 100).toFixed(1)}% vs target`;
7795
+ function ka(e, t) {
7773
7796
  let n = e[t];
7774
7797
  return typeof n == "number" && Number.isFinite(n) ? n : null;
7775
7798
  }
7776
- function Oa(e, t, n, r) {
7799
+ function Aa(e, t, n, r) {
7777
7800
  if (n.kind === "category") {
7778
7801
  let n = e.findIndex((e) => String(e[t]) === String(r));
7779
7802
  return n < 0 ? null : n;
@@ -7781,7 +7804,7 @@ function Oa(e, t, n, r) {
7781
7804
  let i = Number(r);
7782
7805
  return Number.isFinite(i) ? i : null;
7783
7806
  }
7784
- function ka(e, t, n) {
7807
+ function ja(e, t, n) {
7785
7808
  let r = Infinity;
7786
7809
  for (let i of e) {
7787
7810
  let e = t.position(i);
@@ -7791,7 +7814,7 @@ function ka(e, t, n) {
7791
7814
  }
7792
7815
  //#endregion
7793
7816
  //#region src/lifecycle/skeleton-block.tsx
7794
- function Aa({ width: e = "100%", height: t, step: n = 0 }) {
7817
+ function Ma({ width: e = "100%", height: t, step: n = 0 }) {
7795
7818
  return /* @__PURE__ */ j("span", {
7796
7819
  className: "lilt-skeleton__block",
7797
7820
  style: {
@@ -7802,4 +7825,4 @@ function Aa({ width: e = "100%", height: t, step: n = 0 }) {
7802
7825
  });
7803
7826
  }
7804
7827
  //#endregion
7805
- export { J as $, bi as A, Gr as B, Oi as C, pi as D, vi as E, Ti as F, Dn as G, hr as H, di as I, gn as J, _n as K, Jr as L, Si as M, xi as N, Di as O, hi as P, pn as Q, Hr as R, Ai as S, _i as T, pr as U, Br as V, Nn as W, hn as X, Sn as Y, mn as Z, Zi as _, B as _t, ma as a, Ct as at, Ni as b, ua as c, tt as ct, ia as d, W as dt, un as et, aa as f, je as ft, $i as g, Te as gt, ea as h, we as ht, fa as i, Ut as it, gi as j, Ei as k, la as l, $e as lt, ta as m, Ee as mt, wa as n, ln as nt, da as o, Et as ot, na as p, be as pt, yn as q, xa as r, en as rt, pa as s, nt as st, Aa as t, sn as tt, oa as u, et as ut, Qi as v, ki as w, Mi as x, Fi as y, Kr as z };
7828
+ export { mn as $, Si as A, qr as B, Ai as C, hi as D, bi as E, Di as F, pr as G, gr as H, pi as I, _n as J, Nn as K, Xr as L, wi as M, Ci as N, ki as O, _i as P, hn as Q, Wr as R, Mi as S, yi as T, _r as U, Hr as V, hr as W, gn as X, yn as Y, Sn as Z, $i as _, we as _t, ga as a, en as at, Fi as b, fa as c, Et as ct, oa as d, $e as dt, pn as et, sa as f, et as ft, ta as g, Ee as gt, na as h, be as ht, ma as i, ln as it, vi as j, Oi as k, da as l, nt as lt, ra as m, je as mt, Ea as n, un as nt, pa as o, Ut as ot, ia as p, W as pt, Dn as q, Ca as r, sn as rt, ha as s, Ct as st, Ma as t, J as tt, ca as u, tt as ut, ea as v, Te as vt, ji as w, Pi as x, Li as y, B as yt, Jr as z };