@cfasim-ui/charts 0.5.1 → 0.6.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.
package/dist/index.js CHANGED
@@ -1,32 +1,51 @@
1
1
  import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, toDisplayString as x, toHandlers as ee, toRaw as S, unref as C, useSlots as w, useTemplateRef as T, watch as E, withCtx as D } from "vue";
2
2
  import { formatNumber as te } from "@cfasim-ui/shared";
3
- import { DropdownMenuContent as O, DropdownMenuItem as k, DropdownMenuPortal as ne, DropdownMenuRoot as A, DropdownMenuTrigger as j, PopoverAnchor as re, PopoverContent as M, PopoverPortal as ie, PopoverRoot as N } from "reka-ui";
3
+ import { DropdownMenuContent as O, DropdownMenuItem as k, DropdownMenuPortal as ne, DropdownMenuRoot as A, DropdownMenuTrigger as j, PopoverAnchor as M, PopoverContent as re, PopoverPortal as ie, PopoverRoot as N } from "reka-ui";
4
4
  import { geoAlbersUsa as ae, geoPath as P } from "d3-geo";
5
5
  import { zoom as oe, zoomIdentity as se } from "d3-zoom";
6
6
  import { select as ce } from "d3-selection";
7
7
  import "d3-transition";
8
8
  import { feature as F, merge as le, mesh as ue } from "topojson-client";
9
9
  //#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
10
- var I = { class: "chart-menu-trigger-area" }, de = ["aria-label"], fe = /* @__PURE__ */ l({
10
+ var de = ["aria-label"], I = /* @__PURE__ */ l({
11
11
  __name: "ChartMenu",
12
12
  props: {
13
13
  items: {},
14
14
  forceDropdown: {
15
15
  type: Boolean,
16
16
  default: !1
17
+ },
18
+ isFullscreen: {
19
+ type: Boolean,
20
+ default: !1
17
21
  }
18
22
  },
19
- setup(t) {
20
- let n = t, i = () => n.forceDropdown || n.items.length > 1;
21
- return (n, l) => (_(), a("div", I, [i() ? (_(), r(C(A), {
22
- key: 1,
23
+ emits: ["close"],
24
+ setup(t, { emit: n }) {
25
+ let i = t, l = n, u = () => i.forceDropdown || i.items.length > 1;
26
+ return (n, i) => (_(), a("div", { class: f(["chart-menu-trigger-area", { "chart-menu-trigger-area--expanded": t.isFullscreen }]) }, [t.isFullscreen ? (_(), a("button", {
27
+ key: 0,
28
+ class: "chart-menu-button chart-close-button",
29
+ "aria-label": "Collapse",
30
+ onClick: i[0] ||= (e) => l("close")
31
+ }, [...i[2] ||= [o("svg", {
32
+ width: "16",
33
+ height: "16",
34
+ viewBox: "0 0 16 16",
35
+ fill: "none",
36
+ stroke: "currentColor",
37
+ "stroke-width": "1.75",
38
+ "stroke-linecap": "round",
39
+ "aria-hidden": "true"
40
+ }, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(C(A), {
41
+ key: 2,
23
42
  modal: !1
24
43
  }, {
25
44
  default: D(() => [c(C(j), {
26
45
  class: "chart-menu-button",
27
46
  "aria-label": "Chart options"
28
47
  }, {
29
- default: D(() => [...l[2] ||= [o("svg", {
48
+ default: D(() => [...i[4] ||= [o("svg", {
30
49
  width: "16",
31
50
  height: "16",
32
51
  viewBox: "0 0 16 16",
@@ -71,11 +90,11 @@ var I = { class: "chart-menu-trigger-area" }, de = ["aria-label"], fe = /* @__PU
71
90
  })]),
72
91
  _: 1
73
92
  })) : (_(), a("button", {
74
- key: 0,
93
+ key: 1,
75
94
  class: "chart-menu-button chart-menu-single",
76
95
  "aria-label": t.items[0].label,
77
- onClick: l[0] ||= (...e) => t.items[0].action && t.items[0].action(...e)
78
- }, [...l[1] ||= [o("svg", {
96
+ onClick: i[1] ||= (...e) => t.items[0].action && t.items[0].action(...e)
97
+ }, [...i[3] ||= [o("svg", {
79
98
  width: "14",
80
99
  height: "14",
81
100
  viewBox: "0 0 14 14",
@@ -85,44 +104,44 @@ var I = { class: "chart-menu-trigger-area" }, de = ["aria-label"], fe = /* @__PU
85
104
  "stroke-linecap": "round",
86
105
  "stroke-linejoin": "round",
87
106
  "aria-hidden": "true"
88
- }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, de))]));
107
+ }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, de))], 2));
89
108
  }
90
109
  }), L = (e, t) => {
91
110
  let n = e.__vccOpts || e;
92
111
  for (let [e, r] of t) n[e] = r;
93
112
  return n;
94
- }, pe = /* @__PURE__ */ L(fe, [["__scopeId", "data-v-c74e2889"]]);
113
+ }, fe = /* @__PURE__ */ L(I, [["__scopeId", "data-v-f5743494"]]);
95
114
  //#endregion
96
115
  //#region src/_shared/axes.ts
97
116
  function R(e) {
98
117
  return Math.round(e) + .5;
99
118
  }
100
- function me(e, t) {
119
+ function z(e, t) {
101
120
  let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
102
121
  return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
103
122
  }
104
- function he(e, t, n) {
123
+ function B(e, t, n) {
105
124
  if (!(n > 0) || !isFinite(n)) return [];
106
125
  let r = [], i = Math.ceil(e / n) * n;
107
126
  for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
108
127
  return r;
109
128
  }
110
- var ge = new Intl.NumberFormat();
111
- function _e(e) {
112
- return Math.abs(e) >= 1e3 ? ge.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
129
+ var pe = new Intl.NumberFormat();
130
+ function me(e) {
131
+ return Math.abs(e) >= 1e3 ? pe.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
113
132
  }
114
133
  //#endregion
115
134
  //#region src/_shared/computeTicks.ts
116
- function ve(e) {
135
+ function he(e) {
117
136
  let { min: t, max: n, ticks: r } = e;
118
137
  if (t === n) return [];
119
138
  let i = e.displayOffset ?? 0;
120
139
  if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
121
- if (typeof r == "number") return he(t + i, n + i, r).map((e) => e - i);
122
- let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = me(n - t, a);
123
- return he(t + i, n + i, o).map((e) => e - i);
140
+ if (typeof r == "number") return B(t + i, n + i, r).map((e) => e - i);
141
+ let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = z(n - t, a);
142
+ return B(t + i, n + i, o).map((e) => e - i);
124
143
  }
125
- function ye(e, t, n, r) {
144
+ function ge(e, t, n, r) {
126
145
  if (r === "log") {
127
146
  let r = Math.log10(t), i = Math.log10(n) - r || 1;
128
147
  return (Math.log10(e > 0 ? e : t) - r) / i;
@@ -130,7 +149,7 @@ function ye(e, t, n, r) {
130
149
  let i = n - t || 1;
131
150
  return (e - t) / i;
132
151
  }
133
- function be(e, t, n, r) {
152
+ function _e(e, t, n, r) {
134
153
  if (n !== "log") return {
135
154
  min: e,
136
155
  max: t
@@ -141,7 +160,7 @@ function be(e, t, n, r) {
141
160
  max: t > 0 ? Math.max(t, i) : i
142
161
  };
143
162
  }
144
- function z(e) {
163
+ function ve(e) {
145
164
  let { min: t, max: n, ticks: r } = e;
146
165
  if (!(t > 0) || !(n > 0) || t === n) return [];
147
166
  if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
@@ -154,7 +173,7 @@ function z(e) {
154
173
  }
155
174
  //#endregion
156
175
  //#region src/_shared/useChartSize.ts
157
- function xe(e = {}) {
176
+ function ye(e = {}) {
158
177
  let t = v(null), n = v(0), r = v(0), i = null, a = null;
159
178
  return h(() => {
160
179
  t.value && (n.value = t.value.clientWidth, r.value = t.value.clientHeight, i = new ResizeObserver((t) => {
@@ -173,8 +192,8 @@ function xe(e = {}) {
173
192
  measuredHeight: r
174
193
  };
175
194
  }
176
- var Se = .6, B = 8;
177
- function V(e, t) {
195
+ var V = .6, be = 8;
196
+ function xe(e, t) {
178
197
  return {
179
198
  fontSize: e?.fontSize ?? t.fontSize,
180
199
  fill: e?.color ?? "currentColor",
@@ -182,8 +201,8 @@ function V(e, t) {
182
201
  fillOpacity: e?.color == null ? t.fillOpacity : void 0
183
202
  };
184
203
  }
185
- var Ce = 7, we = 18, Te = 16;
186
- function Ee(e) {
204
+ var Se = 7, Ce = 18, we = 16;
205
+ function Te(e) {
187
206
  return e == null ? {
188
207
  top: 0,
189
208
  right: 0,
@@ -201,12 +220,12 @@ function Ee(e) {
201
220
  left: e.left ?? 0
202
221
  };
203
222
  }
204
- function De(e) {
205
- return we + e.length * Ce;
223
+ function Ee(e) {
224
+ return Ce + e.length * Se;
206
225
  }
207
- function Oe(e) {
226
+ function De(e) {
208
227
  let t = n(() => {
209
- let t = Ee(e.extraPadding?.());
228
+ let t = Te(e.extraPadding?.());
210
229
  return {
211
230
  left: (e.yLabel() ? 56 : 50) + t.left,
212
231
  right: 10 + t.right
@@ -219,11 +238,11 @@ function Oe(e) {
219
238
  };
220
239
  let n = Math.max(0, r.value), i = [], a = 0, o = 0;
221
240
  for (let e of t) {
222
- let t = De(e);
241
+ let t = Ee(e);
223
242
  o > 0 && o + t > n && (a++, o = 0), i.push({
224
243
  x: o,
225
244
  row: a
226
- }), o += t + Te;
245
+ }), o += t + we;
227
246
  }
228
247
  return {
229
248
  positions: i,
@@ -233,9 +252,9 @@ function Oe(e) {
233
252
  let t = e.title();
234
253
  if (!t) return 10;
235
254
  let n = e.titleStyle?.()?.lineHeight ?? 18;
236
- return t.split("\n").length * n + B;
255
+ return t.split("\n").length * n + be;
237
256
  }), o = n(() => {
238
- let n = Ee(e.extraPadding?.()), r = i.value.rowCount;
257
+ let n = Te(e.extraPadding?.()), r = i.value.rowCount;
239
258
  return {
240
259
  top: a.value + r * 20 + n.top,
241
260
  bottom: (e.xLabel() ? 38 : 30) + n.bottom,
@@ -264,10 +283,10 @@ function Oe(e) {
264
283
  }
265
284
  //#endregion
266
285
  //#region src/tooltip-position.ts
267
- var ke = 16, Ae = 8;
268
- function H(e, t, n, r, i, a) {
286
+ var Oe = 16, ke = 8;
287
+ function Ae(e, t, n, r, i, a) {
269
288
  if (i === "none") return {
270
- left: e + ke,
289
+ left: e + Oe,
271
290
  top: t
272
291
  };
273
292
  let o = i === "chart" && a ? {
@@ -280,21 +299,21 @@ function H(e, t, n, r, i, a) {
280
299
  right: window.innerWidth,
281
300
  top: 0,
282
301
  bottom: window.innerHeight
283
- }, s = e + ke + n > o.right - Ae ? e - ke - n : e + ke, c = r / 2;
302
+ }, s = e + Oe + n > o.right - ke ? e - Oe - n : e + Oe, c = r / 2;
284
303
  return {
285
304
  left: s,
286
- top: Math.min(Math.max(t, o.top + Ae + c), o.bottom - Ae - c)
305
+ top: Math.min(Math.max(t, o.top + ke + c), o.bottom - ke - c)
287
306
  };
288
307
  }
289
308
  //#endregion
290
309
  //#region src/_shared/useChartTooltip.ts
291
- function je(e) {
292
- let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null);
293
- function s(e) {
310
+ function H(e) {
311
+ let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null), s = null, c = "pending";
312
+ function l(e) {
294
313
  return "touches" in e ? e.touches[0] ?? null : e;
295
314
  }
296
- function c(t) {
297
- let r = s(t);
315
+ function u(t) {
316
+ let r = l(t);
298
317
  if (!r) return;
299
318
  let i = e.pointerToIndex(r.clientX, r.clientY);
300
319
  i !== null && (n.value = i, a.value = {
@@ -309,33 +328,54 @@ function je(e) {
309
328
  }
310
329
  let s = i.value, c = e.containerRef.value;
311
330
  if (!s || !c) return;
312
- let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = H(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
331
+ let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = Ae(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
313
332
  o.value = {
314
333
  left: f - l.left,
315
334
  top: p - l.top
316
335
  };
317
336
  }, { flush: "post" });
318
- function l(t) {
319
- e.enabled() && c(t);
337
+ function d(t) {
338
+ e.enabled() && u(t);
320
339
  }
321
- function u() {
340
+ function f() {
322
341
  e.enabled() && e.trigger?.() !== "click" && (n.value = null, e.onHover?.(null));
323
342
  }
324
- function d(t) {
343
+ function p(t) {
325
344
  if (!e.enabled() || e.trigger?.() !== "click") return;
326
- let r = s(t);
345
+ let r = l(t);
327
346
  if (!r) return;
328
347
  let i = e.pointerToIndex(r.clientX, r.clientY);
329
348
  i !== null && (n.value = n.value === i ? null : i, e.onHover?.(n.value === null ? null : { index: i }));
330
349
  }
331
- function f(t) {
332
- e.enabled() && (t.preventDefault(), r.value = !0, c(t));
350
+ function m(t) {
351
+ if (!e.enabled()) return;
352
+ let n = l(t);
353
+ n && (s = {
354
+ x: n.clientX,
355
+ y: n.clientY
356
+ }, c = "pending", r.value = !0, u(t));
333
357
  }
334
- function p(t) {
335
- e.enabled() && (t.preventDefault(), c(t));
358
+ function h(t) {
359
+ if (e.enabled() && c !== "scroll") {
360
+ if (c === "pending") {
361
+ let r = l(t);
362
+ if (!r || !s) return;
363
+ let i = Math.abs(r.clientX - s.x), a = Math.abs(r.clientY - s.y);
364
+ if (i + a < 10) {
365
+ u(t);
366
+ return;
367
+ }
368
+ if (!((e.scrubAxis?.() ?? "x") === "x" ? i >= a : a >= i)) {
369
+ c = "scroll", n.value = null, e.onHover?.(null);
370
+ return;
371
+ }
372
+ c = "scrub";
373
+ }
374
+ t.preventDefault(), u(t);
375
+ }
336
376
  }
337
- function m() {
338
- e.enabled() && (r.value = !1, n.value = null, e.onHover?.(null));
377
+ function g() {
378
+ e.enabled() && (r.value = !1, s = null, c = "pending", n.value = null, e.onHover?.(null));
339
379
  }
340
380
  return {
341
381
  hoverIndex: n,
@@ -344,114 +384,127 @@ function je(e) {
344
384
  tooltipRef: i,
345
385
  tooltipPos: o,
346
386
  handlers: {
347
- mousemove: l,
348
- mouseleave: u,
349
- click: d,
350
- touchstart: f,
351
- touchmove: p,
352
- touchend: m
387
+ mousemove: d,
388
+ mouseleave: f,
389
+ click: p,
390
+ touchstart: m,
391
+ touchmove: h,
392
+ touchend: g
353
393
  }
354
394
  };
355
395
  }
356
396
  //#endregion
357
397
  //#region src/ChartMenu/download.ts
358
- function Me(e, t) {
398
+ function je(e, t) {
359
399
  let n = URL.createObjectURL(e), r = document.createElement("a");
360
400
  r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
361
401
  }
362
- var U = [
402
+ var Me = [
363
403
  "color",
364
404
  "font-family",
365
405
  "font-size",
366
406
  "font-weight"
367
- ], W = ["fill", "stroke"];
368
- function Ne(e) {
407
+ ], U = ["fill", "stroke"];
408
+ function W(e) {
369
409
  let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
370
410
  if (!t) return e;
371
411
  let [, n, r] = t;
372
412
  return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
373
413
  }
374
- function G(e) {
414
+ function Ne(e) {
375
415
  let t = e.cloneNode(!0);
376
416
  t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
377
417
  let n = window.getComputedStyle(e), r = [];
378
- for (let e of U) {
418
+ for (let e of Me) {
379
419
  let t = n.getPropertyValue(e);
380
420
  t && r.push(`${e}: ${t}`);
381
421
  }
382
422
  let i = t.getAttribute("style") ?? "";
383
423
  t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
384
- for (let e of t.querySelectorAll("*")) for (let t of W) {
424
+ for (let e of t.querySelectorAll("*")) for (let t of U) {
385
425
  let n = e.getAttribute(t);
386
- !n || !n.includes("var(") || e.setAttribute(t, Ne(n));
426
+ !n || !n.includes("var(") || e.setAttribute(t, W(n));
387
427
  }
388
428
  return t;
389
429
  }
390
- function K(e, t) {
391
- let n = G(e), r = new XMLSerializer().serializeToString(n);
392
- Me(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
430
+ function G(e, t) {
431
+ let n = Ne(e), r = new XMLSerializer().serializeToString(n);
432
+ je(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
393
433
  }
394
- function Pe(e, t) {
395
- let n = G(e), r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
434
+ function K(e, t) {
435
+ let n = Ne(e), r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
396
436
  o.onload = () => {
397
437
  let e = document.createElement("canvas");
398
438
  e.width = s * 2, e.height = c * 2;
399
439
  let n = e.getContext("2d");
400
440
  n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
401
- e && Me(e, `${t}.png`);
441
+ e && je(e, `${t}.png`);
402
442
  }), URL.revokeObjectURL(a);
403
443
  }, o.src = a;
404
444
  }
405
- function Fe(e, t) {
406
- Me(new Blob([e], { type: "text/csv" }), `${t}.csv`);
445
+ function Pe(e, t) {
446
+ je(new Blob([e], { type: "text/csv" }), `${t}.csv`);
407
447
  }
408
448
  //#endregion
409
449
  //#region src/_shared/useChartFullscreen.ts
410
- var Ie = 0, Le = "";
411
- function Re() {
412
- typeof document > "u" || (Ie === 0 && (Le = document.body.style.overflow, document.body.style.overflow = "hidden"), Ie++);
450
+ var q = 0, Fe = "";
451
+ function Ie() {
452
+ typeof document > "u" || (q === 0 && (Fe = document.body.style.overflow, document.body.style.overflow = "hidden"), q++);
413
453
  }
414
- function ze() {
415
- typeof document > "u" || Ie !== 0 && (Ie--, Ie === 0 && (document.body.style.overflow = Le));
454
+ function Le() {
455
+ typeof document > "u" || q !== 0 && (q--, q === 0 && (document.body.style.overflow = Fe));
416
456
  }
417
- function Be() {
418
- let e = v(!1), t = !1;
419
- function r(n) {
420
- n !== e.value && (e.value = n, n && !t ? (Re(), t = !0) : !n && t && (ze(), t = !1));
421
- }
422
- function i(t) {
423
- if (t.key !== "Escape" || !e.value) return;
424
- let n = t.target;
425
- n instanceof Element && n.closest("[role=\"menu\"], [role=\"dialog\"]") || r(!1);
457
+ function Re(e = {}) {
458
+ let t = v(!1), r = !1;
459
+ function i(e) {
460
+ e !== t.value && (t.value = e, e && !r ? (Ie(), r = !0) : !e && r && (Le(), r = !1));
426
461
  }
427
- function a() {
428
- r(!0);
462
+ function a(e) {
463
+ if (e.key !== "Escape" || !t.value) return;
464
+ let n = e.target;
465
+ n instanceof Element && n.closest("[role=\"menu\"], [role=\"dialog\"]") || i(!1);
429
466
  }
430
467
  function o() {
431
- r(!1);
468
+ i(!0);
432
469
  }
433
470
  function s() {
434
- r(!e.value);
471
+ i(!1);
472
+ }
473
+ function c() {
474
+ i(!t.value);
435
475
  }
436
476
  return h(() => {
437
- typeof document > "u" || document.addEventListener("keydown", i);
477
+ typeof document > "u" || document.addEventListener("keydown", a);
438
478
  }), g(() => {
439
- typeof document > "u" || (document.removeEventListener("keydown", i), t &&= (ze(), !1));
479
+ typeof document > "u" || (document.removeEventListener("keydown", a), r &&= (Le(), !1));
440
480
  }), {
441
- isFullscreen: e,
442
- toggle: s,
443
- enter: a,
444
- exit: o,
481
+ isFullscreen: t,
482
+ toggle: c,
483
+ enter: o,
484
+ exit: s,
445
485
  menuItem: n(() => ({
446
- label: e.value ? "Collapse" : "Expand",
447
- action: s,
448
- ariaPressed: e.value
449
- }))
486
+ label: t.value ? "Collapse" : "Fullscreen",
487
+ action: c,
488
+ ariaPressed: t.value
489
+ })),
490
+ fullscreenStyle: n(() => t.value ? {
491
+ position: "fixed",
492
+ inset: "0",
493
+ "z-index": "var(--cfasim-z-fullscreen, 1000)",
494
+ background: "var(--color-bg-0, #fff)",
495
+ color: "var(--color-text, inherit)",
496
+ padding: "2em",
497
+ "box-sizing": "border-box",
498
+ display: "flex",
499
+ "flex-direction": "column",
500
+ "justify-content": "center"
501
+ } : void 0),
502
+ teleportTarget: n(() => e.target?.() || "body")
450
503
  };
451
504
  }
452
505
  //#endregion
453
506
  //#region src/_shared/useChartMenu.ts
454
- function Ve(e) {
507
+ function ze(e) {
455
508
  let t = v(null);
456
509
  function r() {
457
510
  let t = e.filename();
@@ -459,23 +512,23 @@ function Ve(e) {
459
512
  let n = e.legacyMenuLabel();
460
513
  return typeof n == "string" ? n : "chart";
461
514
  }
462
- let i = e.fullscreen ? Be() : null, a = n(() => {
515
+ let i = e.fullscreen ? Re({ target: e.fullscreenTarget }) : null, a = n(() => {
463
516
  let n = r(), a = [];
464
517
  i && a.push(i.menuItem.value), a.push({
465
518
  label: "Save as SVG",
466
519
  action: () => {
467
- t.value && K(t.value, n);
520
+ t.value && G(t.value, n);
468
521
  }
469
522
  }, {
470
523
  label: "Save as PNG",
471
524
  action: () => {
472
- t.value && Pe(t.value, n);
525
+ t.value && K(t.value, n);
473
526
  }
474
527
  });
475
528
  let o = e.downloadButton?.();
476
529
  return !e.downloadLink() && !o && a.push({
477
530
  label: "Download CSV",
478
- action: () => Fe(e.getCsv(), n)
531
+ action: () => Pe(e.getCsv(), n)
479
532
  }), a;
480
533
  }), o = n(() => {
481
534
  if (e.downloadButton?.()) return null;
@@ -486,7 +539,7 @@ function Ve(e) {
486
539
  return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
487
540
  });
488
541
  function l() {
489
- Fe(e.getCsv(), r());
542
+ Pe(e.getCsv(), r());
490
543
  }
491
544
  return {
492
545
  svgRef: t,
@@ -496,12 +549,15 @@ function Ve(e) {
496
549
  downloadButtonText: c,
497
550
  triggerCsvDownload: l,
498
551
  resolvedFilename: r,
499
- isFullscreen: i?.isFullscreen ?? v(!1)
552
+ isFullscreen: i?.isFullscreen ?? v(!1),
553
+ fullscreenStyle: i?.fullscreenStyle ?? n(() => void 0),
554
+ teleportTarget: i?.teleportTarget ?? n(() => "body"),
555
+ exitFullscreen: i?.exit ?? (() => {})
500
556
  };
501
557
  }
502
558
  //#endregion
503
559
  //#region src/_shared/seriesCsv.ts
504
- function He(e) {
560
+ function Be(e) {
505
561
  if (e.length === 0) return "";
506
562
  let t = 0;
507
563
  for (let n of e) n.data.length > t && (t = n.data.length);
@@ -513,43 +569,43 @@ function He(e) {
513
569
  }
514
570
  return i.join("\n");
515
571
  }
516
- function Ue(e, t, n = "category") {
572
+ function Ve(e, t, n = "category") {
517
573
  if (t.length === 0 || e.length === 0) return "";
518
574
  let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
519
575
  for (let n = 0; n < e.length; n++) {
520
- let i = [q(e[n])];
576
+ let i = [He(e[n])];
521
577
  for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
522
578
  r.push(i.join(","));
523
579
  }
524
580
  return r.join("\n");
525
581
  }
526
- function q(e) {
582
+ function He(e) {
527
583
  return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
528
584
  }
529
585
  //#endregion
530
586
  //#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
531
- var J = {
587
+ var Ue = {
532
588
  class: "chart-annotations",
533
589
  "pointer-events": "none"
534
590
  }, We = ["stroke", "stroke-width"], Ge = [
535
591
  "d",
536
592
  "stroke",
537
593
  "stroke-width"
538
- ], Y = [
594
+ ], Ke = [
539
595
  "fill",
540
596
  "stroke",
541
597
  "stroke-width",
542
598
  "transform"
543
- ], Ke = [
599
+ ], J = [
544
600
  "stroke",
545
601
  "stroke-width",
546
602
  "stroke-dasharray"
547
- ], X = [
603
+ ], qe = [
548
604
  "d",
549
605
  "stroke",
550
606
  "stroke-width",
551
607
  "stroke-dasharray"
552
- ], qe = ["fill", "transform"], Je = [
608
+ ], Y = ["fill", "transform"], X = [
553
609
  "x",
554
610
  "y",
555
611
  "text-anchor",
@@ -558,7 +614,7 @@ var J = {
558
614
  "fill",
559
615
  "stroke",
560
616
  "stroke-width"
561
- ], Ye = ["x", "dy"], Xe = ["font-weight", "font-style"], Ze = 13, Qe = "normal", $e = 700, et = "var(--color-bg-0, #fff)", tt = 3, nt = 1, rt = 4, it = 6, at = 1.2, ot = .35, st = /* @__PURE__ */ l({
617
+ ], Je = ["x", "dy"], Z = ["font-weight", "font-style"], Q = 13, Ye = "normal", Xe = 700, Ze = "var(--color-bg-0, #fff)", Qe = 3, $e = 1, et = 4, tt = 6, nt = 1.2, rt = .35, it = /* @__PURE__ */ l({
562
618
  __name: "ChartAnnotations",
563
619
  props: {
564
620
  annotations: { default: () => [] },
@@ -595,7 +651,7 @@ var J = {
595
651
  if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
596
652
  let i = t.pointer ?? "curved", a = i.startsWith("rule");
597
653
  if (a && !r.bounds) continue;
598
- let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? Ze, g = t.fontWeight ?? Qe, _ = t.outlineColor ?? et, v = t.outlineWidth ?? tt, y = t.lineColor ?? m, b = t.lineWidth ?? nt, x = s(t.lineDash), ee = {
654
+ let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? Q, g = t.fontWeight ?? Ye, _ = t.outlineColor ?? Ze, v = t.outlineWidth ?? Qe, y = t.lineColor ?? m, b = t.lineWidth ?? $e, x = s(t.lineDash), ee = {
599
655
  left: "start",
600
656
  center: "middle",
601
657
  right: "end"
@@ -610,7 +666,7 @@ var J = {
610
666
  textX: d,
611
667
  textY: p,
612
668
  textAnchor: ee,
613
- dy: h * at,
669
+ dy: h * nt,
614
670
  fontSize: h,
615
671
  fontWeight: g,
616
672
  color: m,
@@ -676,11 +732,11 @@ var J = {
676
732
  }
677
733
  function f(e, t, n, r, i, a) {
678
734
  if (a === "none") return { path: "" };
679
- let o = n - e, s = r - t, c = r - i * ot;
735
+ let o = n - e, s = r - t, c = r - i * rt;
680
736
  if (o === 0 || s === 0 || a === "straight") {
681
737
  let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
682
738
  if (l <= 10) return { path: "" };
683
- let u = a / l, d = o / l, f = e + u * rt, p = t + d * rt, m = n - u * it, h = i - d * it, g = Math.atan2(-d, -u) * 180 / Math.PI;
739
+ let u = a / l, d = o / l, f = e + u * et, p = t + d * et, m = n - u * tt, h = i - d * tt, g = Math.atan2(-d, -u) * 180 / Math.PI;
684
740
  return {
685
741
  path: `M${f},${p} L${m},${h}`,
686
742
  arrow: {
@@ -691,8 +747,8 @@ var J = {
691
747
  };
692
748
  }
693
749
  let l = c - t;
694
- if (Math.abs(l) <= rt || Math.abs(o) <= it) return { path: "" };
695
- let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * rt, m = n - u * it, h = c, g = d > 0 ? -90 : 90;
750
+ if (Math.abs(l) <= et || Math.abs(o) <= tt) return { path: "" };
751
+ let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * et, m = n - u * tt, h = c, g = d > 0 ? -90 : 90;
696
752
  return {
697
753
  path: `M${f},${p} Q${f},${c} ${m},${h}`,
698
754
  arrow: {
@@ -702,7 +758,7 @@ var J = {
702
758
  }
703
759
  };
704
760
  }
705
- return (t, n) => (_(), a("g", J, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
761
+ return (t, n) => (_(), a("g", Ue, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
706
762
  t.rule && t.outlineWidth > 0 ? (_(), a("line", d({
707
763
  key: 0,
708
764
  ref_for: !0
@@ -730,7 +786,7 @@ var J = {
730
786
  "stroke-width": t.outlineWidth,
731
787
  "stroke-linejoin": "round",
732
788
  transform: t.arrowTransform
733
- }, null, 8, Y)) : i("", !0),
789
+ }, null, 8, Ke)) : i("", !0),
734
790
  t.rule ? (_(), a("line", d({
735
791
  key: 3,
736
792
  ref_for: !0
@@ -739,7 +795,7 @@ var J = {
739
795
  "stroke-width": t.lineWidth,
740
796
  "stroke-dasharray": t.lineDash,
741
797
  "stroke-linecap": "round"
742
- }), null, 16, Ke)) : i("", !0),
798
+ }), null, 16, J)) : i("", !0),
743
799
  t.pointerPath ? (_(), a("path", {
744
800
  key: 4,
745
801
  d: t.pointerPath,
@@ -748,13 +804,13 @@ var J = {
748
804
  "stroke-width": t.lineWidth,
749
805
  "stroke-dasharray": t.lineDash,
750
806
  "stroke-linecap": "round"
751
- }, null, 8, X)) : i("", !0),
807
+ }, null, 8, qe)) : i("", !0),
752
808
  t.arrowTip ? (_(), a("polygon", {
753
809
  key: 5,
754
810
  points: "0,0 -6,-3 -6,3",
755
811
  fill: t.lineColor,
756
812
  transform: t.arrowTransform
757
- }, null, 8, qe)) : i("", !0),
813
+ }, null, 8, Y)) : i("", !0),
758
814
  o("text", {
759
815
  x: t.textX,
760
816
  y: t.textY,
@@ -772,58 +828,60 @@ var J = {
772
828
  dy: r === 0 ? 0 : t.dy
773
829
  }, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
774
830
  key: t,
775
- "font-weight": e.bold ? $e : void 0,
831
+ "font-weight": e.bold ? Xe : void 0,
776
832
  "font-style": e.italic ? "italic" : void 0
777
- }, x(e.text), 9, Xe))), 128))], 8, Ye))), 128))], 8, Je)
833
+ }, x(e.text), 9, Z))), 128))], 8, Je))), 128))], 8, X)
778
834
  ], 64))), 128))]));
779
835
  }
780
- }), ct = 400, lt = 200;
781
- function ut(e) {
782
- let { containerRef: t, measuredWidth: r, measuredHeight: i } = xe({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, downloadButtonText: l, triggerCsvDownload: u, resolvedFilename: d, isFullscreen: f } = Ve({
836
+ }), at = 400, ot = 200;
837
+ function st(e) {
838
+ let { containerRef: t, measuredWidth: r, measuredHeight: i } = ye({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, downloadButtonText: l, triggerCsvDownload: u, resolvedFilename: d, isFullscreen: f, fullscreenStyle: p, teleportTarget: m, exitFullscreen: h } = ze({
783
839
  filename: e.filename,
784
840
  legacyMenuLabel: e.menu,
785
841
  getCsv: e.getCsv,
786
842
  downloadLink: e.downloadLink,
787
843
  downloadButton: e.downloadButton,
788
- fullscreen: !0
789
- }), p = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || ct)), m = n(() => {
844
+ fullscreen: !0,
845
+ fullscreenTarget: e.fullscreenTarget
846
+ }), g = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || at)), _ = n(() => {
790
847
  if (f.value && i.value > 0) {
791
848
  let t = e.extraBelowHeight?.() ?? 0;
792
849
  return i.value - t;
793
850
  }
794
- return e.height() ?? lt;
795
- }), { padding: h, legendY: g, inlineLegendLayout: _, innerW: v, innerH: y, bounds: b } = Oe({
851
+ return e.height() ?? ot;
852
+ }), { padding: v, legendY: y, inlineLegendLayout: b, innerW: x, innerH: ee, bounds: S } = De({
796
853
  title: e.title,
797
854
  titleStyle: e.titleStyle,
798
855
  xLabel: e.xLabel,
799
856
  yLabel: e.yLabel,
800
857
  inlineLegendLabels: e.inlineLegendLabels,
801
- width: () => p.value,
802
- height: () => m.value,
858
+ width: () => g.value,
859
+ height: () => _.value,
803
860
  extraPadding: e.chartPadding
804
- }), { hoverIndex: x, tooltipRef: ee, tooltipPos: S, handlers: C } = je({
861
+ }), { hoverIndex: C, tooltipRef: w, tooltipPos: T, handlers: E } = H({
805
862
  enabled: e.hasTooltipSlot,
806
863
  trigger: e.tooltipTrigger,
807
864
  clamp: () => e.tooltipClamp() ?? "chart",
808
865
  pointerToIndex: e.pointerToIndex,
809
866
  containerRef: t,
867
+ scrubAxis: e.scrubAxis,
810
868
  onHover: e.onHover
811
869
  });
812
870
  return {
813
871
  containerRef: t,
814
872
  svgRef: a,
815
- width: p,
816
- height: m,
817
- padding: h,
818
- legendY: g,
819
- inlineLegendLayout: _,
820
- innerW: v,
821
- innerH: y,
822
- bounds: b,
823
- hoverIndex: x,
824
- tooltipRef: ee,
825
- tooltipPos: S,
826
- tooltipHandlers: C,
873
+ width: g,
874
+ height: _,
875
+ padding: v,
876
+ legendY: y,
877
+ inlineLegendLayout: b,
878
+ innerW: x,
879
+ innerH: ee,
880
+ bounds: S,
881
+ hoverIndex: C,
882
+ tooltipRef: w,
883
+ tooltipPos: T,
884
+ tooltipHandlers: E,
827
885
  menuItems: o,
828
886
  downloadLinkText: s,
829
887
  csvHref: c,
@@ -831,20 +889,23 @@ function ut(e) {
831
889
  triggerCsvDownload: u,
832
890
  menuFilename: d,
833
891
  isFullscreen: f,
892
+ fullscreenStyle: p,
893
+ teleportTarget: m,
894
+ exitFullscreen: h,
834
895
  measuredHeight: i
835
896
  };
836
897
  }
837
- function dt(e, t) {
898
+ function ct(e, t) {
838
899
  return (n) => {
839
900
  let r = e();
840
901
  if (r !== void 0) return te(n, r);
841
902
  let i = t();
842
- return i === void 0 ? _e(n) : te(n, i);
903
+ return i === void 0 ? me(n) : te(n, i);
843
904
  };
844
905
  }
845
906
  //#endregion
846
907
  //#region src/_shared/contrast.ts
847
- function ft(e) {
908
+ function lt(e) {
848
909
  let t = e.trim();
849
910
  if (t.startsWith("#")) {
850
911
  let e = t.slice(1);
@@ -871,201 +932,201 @@ function ft(e) {
871
932
  }
872
933
  return null;
873
934
  }
874
- function pt([e, t, n]) {
935
+ function ut([e, t, n]) {
875
936
  let r = (e) => {
876
937
  let t = e / 255;
877
938
  return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
878
939
  };
879
940
  return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
880
941
  }
881
- var mt = null, ht = /* @__PURE__ */ new Map();
882
- function gt(e) {
883
- let t = ft(e);
942
+ var dt = null, ft = /* @__PURE__ */ new Map();
943
+ function pt(e) {
944
+ let t = lt(e);
884
945
  if (t) return t;
885
- if (ht.has(e)) return ht.get(e) ?? null;
946
+ if (ft.has(e)) return ft.get(e) ?? null;
886
947
  if (typeof document > "u") return null;
887
- mt || (mt = document.createElement("span"), mt.style.cssText = "position:absolute;width:0;height:0;visibility:hidden;pointer-events:none", document.body.appendChild(mt)), mt.style.color = "", mt.style.color = e;
888
- let n = getComputedStyle(mt).color, r = ft(n);
889
- return ht.set(e, r), r;
948
+ dt || (dt = document.createElement("span"), dt.style.cssText = "position:absolute;width:0;height:0;visibility:hidden;pointer-events:none", document.body.appendChild(dt)), dt.style.color = "", dt.style.color = e;
949
+ let n = getComputedStyle(dt).color, r = lt(n);
950
+ return ft.set(e, r), r;
890
951
  }
891
- function _t(e, t = "#ffffff", n = "#1a1a1a") {
892
- let r = gt(e);
893
- return r && pt(r) > .179 ? n : t;
952
+ function mt(e, t = "#ffffff", n = "#1a1a1a") {
953
+ let r = pt(e);
954
+ return r && ut(r) > .179 ? n : t;
894
955
  }
895
956
  //#endregion
896
957
  //#region src/_shared/dateAxis.ts
897
- var vt = /^(\d{4})-(\d{2})-(\d{2})$/, yt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, Z = 1e3, Q = 60 * Z, bt = 60 * Q, xt = 24 * bt, St = 7 * xt, Ct = 30 * xt, wt = 365 * xt, Tt = [
958
+ var ht = /^(\d{4})-(\d{2})-(\d{2})$/, gt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, _t = 1e3, vt = 60 * _t, yt = 60 * vt, bt = 24 * yt, xt = 7 * bt, St = 30 * bt, Ct = 365 * bt, wt = [
898
959
  {
899
960
  unit: "second",
900
961
  step: 1,
901
- ms: 1 * Z
962
+ ms: 1 * _t
902
963
  },
903
964
  {
904
965
  unit: "second",
905
966
  step: 5,
906
- ms: 5 * Z
967
+ ms: 5 * _t
907
968
  },
908
969
  {
909
970
  unit: "second",
910
971
  step: 15,
911
- ms: 15 * Z
972
+ ms: 15 * _t
912
973
  },
913
974
  {
914
975
  unit: "second",
915
976
  step: 30,
916
- ms: 30 * Z
977
+ ms: 30 * _t
917
978
  },
918
979
  {
919
980
  unit: "minute",
920
981
  step: 1,
921
- ms: 1 * Q
982
+ ms: 1 * vt
922
983
  },
923
984
  {
924
985
  unit: "minute",
925
986
  step: 5,
926
- ms: 5 * Q
987
+ ms: 5 * vt
927
988
  },
928
989
  {
929
990
  unit: "minute",
930
991
  step: 15,
931
- ms: 15 * Q
992
+ ms: 15 * vt
932
993
  },
933
994
  {
934
995
  unit: "minute",
935
996
  step: 30,
936
- ms: 30 * Q
997
+ ms: 30 * vt
937
998
  },
938
999
  {
939
1000
  unit: "hour",
940
1001
  step: 1,
941
- ms: 1 * bt
1002
+ ms: 1 * yt
942
1003
  },
943
1004
  {
944
1005
  unit: "hour",
945
1006
  step: 3,
946
- ms: 3 * bt
1007
+ ms: 3 * yt
947
1008
  },
948
1009
  {
949
1010
  unit: "hour",
950
1011
  step: 6,
951
- ms: 6 * bt
1012
+ ms: 6 * yt
952
1013
  },
953
1014
  {
954
1015
  unit: "hour",
955
1016
  step: 12,
956
- ms: 12 * bt
1017
+ ms: 12 * yt
957
1018
  },
958
1019
  {
959
1020
  unit: "day",
960
1021
  step: 1,
961
- ms: 1 * xt
1022
+ ms: 1 * bt
962
1023
  },
963
1024
  {
964
1025
  unit: "day",
965
1026
  step: 2,
966
- ms: 2 * xt
1027
+ ms: 2 * bt
967
1028
  },
968
1029
  {
969
1030
  unit: "week",
970
1031
  step: 1,
971
- ms: 1 * St
1032
+ ms: 1 * xt
972
1033
  },
973
1034
  {
974
1035
  unit: "month",
975
1036
  step: 1,
976
- ms: 1 * Ct
1037
+ ms: 1 * St
977
1038
  },
978
1039
  {
979
1040
  unit: "month",
980
1041
  step: 3,
981
- ms: 3 * Ct
1042
+ ms: 3 * St
982
1043
  },
983
1044
  {
984
1045
  unit: "month",
985
1046
  step: 6,
986
- ms: 6 * Ct
1047
+ ms: 6 * St
987
1048
  },
988
1049
  {
989
1050
  unit: "year",
990
1051
  step: 1,
991
- ms: 1 * wt
1052
+ ms: 1 * Ct
992
1053
  },
993
1054
  {
994
1055
  unit: "year",
995
1056
  step: 2,
996
- ms: 2 * wt
1057
+ ms: 2 * Ct
997
1058
  },
998
1059
  {
999
1060
  unit: "year",
1000
1061
  step: 5,
1001
- ms: 5 * wt
1062
+ ms: 5 * Ct
1002
1063
  },
1003
1064
  {
1004
1065
  unit: "year",
1005
1066
  step: 10,
1006
- ms: 10 * wt
1067
+ ms: 10 * Ct
1007
1068
  },
1008
1069
  {
1009
1070
  unit: "year",
1010
1071
  step: 25,
1011
- ms: 25 * wt
1072
+ ms: 25 * Ct
1012
1073
  },
1013
1074
  {
1014
1075
  unit: "year",
1015
1076
  step: 50,
1016
- ms: 50 * wt
1077
+ ms: 50 * Ct
1017
1078
  },
1018
1079
  {
1019
1080
  unit: "year",
1020
1081
  step: 100,
1021
- ms: 100 * wt
1082
+ ms: 100 * Ct
1022
1083
  }
1023
- ], Et = 1e3;
1024
- function Dt(e, t) {
1084
+ ], Tt = 1e3;
1085
+ function Et(e, t) {
1025
1086
  if (e instanceof Date) {
1026
1087
  let t = e.getTime();
1027
1088
  return Number.isFinite(t) ? t : null;
1028
1089
  }
1029
1090
  if (typeof e != "string") return null;
1030
- let n = vt.exec(e);
1091
+ let n = ht.exec(e);
1031
1092
  if (n) {
1032
1093
  let e = +n[1], r = n[2] - 1, i = +n[3];
1033
1094
  return t === "utc" ? Date.UTC(e, r, i) : new Date(e, r, i).getTime();
1034
1095
  }
1035
- let r = yt.exec(e);
1096
+ let r = gt.exec(e);
1036
1097
  if (r) {
1037
1098
  let e = +r[1], n = r[2] - 1, i = +r[3], a = +r[4], o = +r[5], s = r[6] ? +r[6] : 0, c = r[7] ? Number("0." + r[7]) * 1e3 : 0, l = r[8];
1038
1099
  if (l) {
1039
1100
  if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
1040
- let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * Q;
1101
+ let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * vt;
1041
1102
  return Date.UTC(e, n, i, a, o, s, c) - d;
1042
1103
  }
1043
1104
  return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
1044
1105
  }
1045
1106
  return null;
1046
1107
  }
1047
- function Ot(e) {
1048
- return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? vt.test(e) || yt.test(e) : !1;
1108
+ function Dt(e) {
1109
+ return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? ht.test(e) || gt.test(e) : !1;
1049
1110
  }
1050
- function kt(e, t) {
1111
+ function Ot(e, t) {
1051
1112
  if (e.length === 0) return !1;
1052
1113
  for (let n = 0; n < e.length; n++) {
1053
1114
  let r = e[n];
1054
- if (!Ot(r) || Dt(r, t) === null) return !1;
1115
+ if (!Dt(r) || Et(r, t) === null) return !1;
1055
1116
  }
1056
1117
  return !0;
1057
1118
  }
1058
- function At(e, t) {
1119
+ function kt(e, t) {
1059
1120
  let n = e / Math.max(1, t);
1060
- for (let e of Tt) if (n <= e.ms) return e;
1061
- return Tt[Tt.length - 1];
1121
+ for (let e of wt) if (n <= e.ms) return e;
1122
+ return wt[wt.length - 1];
1062
1123
  }
1063
- function jt(e, t, n) {
1124
+ function At(e, t, n) {
1064
1125
  let r = new Date(e);
1065
1126
  if (n === "utc") switch (t) {
1066
- case "second": return Math.floor(e / Z) * Z;
1067
- case "minute": return Math.floor(e / Q) * Q;
1068
- case "hour": return Math.floor(e / bt) * bt;
1127
+ case "second": return Math.floor(e / _t) * _t;
1128
+ case "minute": return Math.floor(e / vt) * vt;
1129
+ case "hour": return Math.floor(e / yt) * yt;
1069
1130
  case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
1070
1131
  case "week": {
1071
1132
  let e = (r.getUTCDay() + 6) % 7;
@@ -1075,8 +1136,8 @@ function jt(e, t, n) {
1075
1136
  case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
1076
1137
  }
1077
1138
  switch (t) {
1078
- case "second": return Math.floor(e / Z) * Z;
1079
- case "minute": return Math.floor(e / Q) * Q;
1139
+ case "second": return Math.floor(e / _t) * _t;
1140
+ case "minute": return Math.floor(e / vt) * vt;
1080
1141
  case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
1081
1142
  case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
1082
1143
  case "week": {
@@ -1087,11 +1148,11 @@ function jt(e, t, n) {
1087
1148
  case "year": return new Date(r.getFullYear(), 0, 1).getTime();
1088
1149
  }
1089
1150
  }
1090
- function Mt(e, t, n, r) {
1091
- if (t === "second") return e + n * Z;
1092
- if (t === "minute") return e + n * Q;
1093
- if (t === "hour" && r === "utc") return e + n * bt;
1094
- if (t === "week" && r === "utc") return e + n * St;
1151
+ function jt(e, t, n, r) {
1152
+ if (t === "second") return e + n * _t;
1153
+ if (t === "minute") return e + n * vt;
1154
+ if (t === "hour" && r === "utc") return e + n * yt;
1155
+ if (t === "week" && r === "utc") return e + n * xt;
1095
1156
  let i = new Date(e);
1096
1157
  if (r === "utc") switch (t) {
1097
1158
  case "day": return Date.UTC(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate() + n, i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds());
@@ -1107,21 +1168,21 @@ function Mt(e, t, n, r) {
1107
1168
  }
1108
1169
  return e;
1109
1170
  }
1110
- function Nt(e, t, n, r) {
1171
+ function Mt(e, t, n, r) {
1111
1172
  if (!Number.isFinite(e) || !Number.isFinite(t) || e >= t || n < 1) return {
1112
1173
  values: [],
1113
1174
  unit: "day"
1114
1175
  };
1115
- let { unit: i, step: a } = At(t - e, n), o = jt(e, i, r), s = 0;
1116
- for (; o < e && s < Et;) o = Mt(o, i, a, r), s++;
1176
+ let { unit: i, step: a } = kt(t - e, n), o = At(e, i, r), s = 0;
1177
+ for (; o < e && s < Tt;) o = jt(o, i, a, r), s++;
1117
1178
  let c = [];
1118
- for (let e = 0; e < Et && o <= t; e++) c.push(o), o = Mt(o, i, a, r);
1179
+ for (let e = 0; e < Tt && o <= t; e++) c.push(o), o = jt(o, i, a, r);
1119
1180
  return {
1120
1181
  values: c,
1121
1182
  unit: i
1122
1183
  };
1123
1184
  }
1124
- var Pt = {
1185
+ var Nt = {
1125
1186
  iso: {
1126
1187
  year: "numeric",
1127
1188
  month: "2-digit",
@@ -1159,7 +1220,7 @@ var Pt = {
1159
1220
  hourCycle: "h23"
1160
1221
  },
1161
1222
  medium: { dateStyle: "medium" }
1162
- }, Ft = {
1223
+ }, Pt = {
1163
1224
  year: "year",
1164
1225
  month: "month-year",
1165
1226
  week: "month-day",
@@ -1171,27 +1232,27 @@ var Pt = {
1171
1232
  function $(e) {
1172
1233
  return e < 10 ? "0" + e : String(e);
1173
1234
  }
1174
- function It(e, t) {
1235
+ function Ft(e, t) {
1175
1236
  let n = new Date(e);
1176
1237
  return t === "utc" ? `${n.getUTCFullYear()}-${$(n.getUTCMonth() + 1)}-${$(n.getUTCDate())}` : `${n.getFullYear()}-${$(n.getMonth() + 1)}-${$(n.getDate())}`;
1177
1238
  }
1178
- function Lt(e, t) {
1239
+ function It(e, t) {
1179
1240
  let n = new Date(e);
1180
1241
  return t === "utc" ? `${n.getUTCFullYear()}-${$(n.getUTCMonth() + 1)}-${$(n.getUTCDate())}T${$(n.getUTCHours())}:${$(n.getUTCMinutes())}:${$(n.getUTCSeconds())}Z` : `${n.getFullYear()}-${$(n.getMonth() + 1)}-${$(n.getDate())}T${$(n.getHours())}:${$(n.getMinutes())}:${$(n.getSeconds())}`;
1181
1242
  }
1182
- function Rt(e) {
1183
- return e in Pt;
1243
+ function Lt(e) {
1244
+ return e in Nt;
1184
1245
  }
1185
- function zt(e, t, n, r) {
1246
+ function Rt(e, t, n, r) {
1186
1247
  if (typeof t == "function") return t(e, r);
1187
1248
  let i = null, a;
1188
- if (t === void 0) i = r ? Ft[r] : "iso", a = Pt[i];
1249
+ if (t === void 0) i = r ? Pt[r] : "iso", a = Nt[i];
1189
1250
  else if (typeof t == "string") {
1190
- if (!Rt(t)) throw Error(`Unknown date format preset: "${t}"`);
1191
- i = t, a = Pt[i];
1251
+ if (!Lt(t)) throw Error(`Unknown date format preset: "${t}"`);
1252
+ i = t, a = Nt[i];
1192
1253
  } else a = t;
1193
- if (i === "iso") return It(e, n);
1194
- if (i === "iso-datetime") return Lt(e, n);
1254
+ if (i === "iso") return Ft(e, n);
1255
+ if (i === "iso-datetime") return It(e, n);
1195
1256
  let o = n === "utc" ? {
1196
1257
  ...a,
1197
1258
  timeZone: "UTC"
@@ -1200,68 +1261,68 @@ function zt(e, t, n, r) {
1200
1261
  }
1201
1262
  //#endregion
1202
1263
  //#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
1203
- var Bt = {
1264
+ var zt = {
1204
1265
  class: "chart-sr-only",
1205
1266
  "aria-live": "polite"
1206
- }, Vt = ["width", "height"], Ht = [
1267
+ }, Bt = ["width", "height"], Vt = [
1207
1268
  "x",
1208
1269
  "y",
1209
1270
  "text-anchor",
1210
1271
  "font-size",
1211
1272
  "font-weight",
1212
1273
  "fill"
1213
- ], Ut = ["x", "dy"], Wt = { key: 1 }, Gt = [
1274
+ ], Ht = ["x", "dy"], Ut = { key: 1 }, Wt = [
1214
1275
  "x1",
1215
1276
  "y1",
1216
1277
  "x2",
1217
1278
  "y2",
1218
1279
  "stroke",
1219
1280
  "stroke-dasharray"
1220
- ], Kt = [
1281
+ ], Gt = [
1221
1282
  "cx",
1222
1283
  "cy",
1223
1284
  "fill",
1224
1285
  "fill-opacity",
1225
1286
  "stroke"
1226
- ], qt = [
1287
+ ], Kt = [
1227
1288
  "x",
1228
1289
  "y",
1229
1290
  "font-size",
1230
1291
  "fill",
1231
1292
  "font-weight"
1232
- ], Jt = [
1293
+ ], qt = [
1233
1294
  "x1",
1234
1295
  "y1",
1235
1296
  "x2",
1236
1297
  "y2"
1237
- ], Yt = [
1298
+ ], Jt = [
1238
1299
  "x1",
1239
1300
  "y1",
1240
1301
  "x2",
1241
1302
  "y2"
1242
- ], Xt = [
1303
+ ], Yt = [
1243
1304
  "x1",
1244
1305
  "y1",
1245
1306
  "x2",
1246
1307
  "y2"
1247
- ], Zt = [
1308
+ ], Xt = [
1248
1309
  "x1",
1249
1310
  "y1",
1250
1311
  "x2",
1251
1312
  "y2"
1252
- ], Qt = [
1313
+ ], Zt = [
1253
1314
  "x",
1254
1315
  "y",
1255
1316
  "font-size",
1256
1317
  "fill",
1257
1318
  "font-weight",
1258
1319
  "fill-opacity"
1259
- ], $t = [
1320
+ ], Qt = [
1260
1321
  "transform",
1261
1322
  "font-size",
1262
1323
  "fill",
1263
1324
  "font-weight"
1264
- ], en = [
1325
+ ], $t = [
1265
1326
  "x",
1266
1327
  "y",
1267
1328
  "text-anchor",
@@ -1269,39 +1330,43 @@ var Bt = {
1269
1330
  "fill",
1270
1331
  "font-weight",
1271
1332
  "fill-opacity"
1272
- ], tn = [
1333
+ ], en = [
1273
1334
  "x",
1274
1335
  "y",
1275
1336
  "font-size",
1276
1337
  "fill",
1277
1338
  "font-weight"
1278
- ], nn = [
1339
+ ], tn = [
1279
1340
  "d",
1280
1341
  "fill",
1281
1342
  "fill-opacity"
1282
- ], rn = ["d", "stroke-width"], an = [
1343
+ ], nn = [
1344
+ "d",
1345
+ "stroke",
1346
+ "stroke-width"
1347
+ ], rn = [
1283
1348
  "d",
1284
1349
  "stroke",
1285
1350
  "stroke-width",
1286
1351
  "stroke-opacity",
1287
1352
  "stroke-dasharray"
1288
- ], on = [
1353
+ ], an = [
1289
1354
  "cx",
1290
1355
  "cy",
1291
1356
  "r",
1292
1357
  "fill",
1293
1358
  "fill-opacity",
1294
1359
  "stroke"
1295
- ], sn = [
1360
+ ], on = [
1296
1361
  "d",
1297
1362
  "fill",
1298
1363
  "fill-opacity"
1299
- ], cn = [
1364
+ ], sn = [
1300
1365
  "d",
1301
1366
  "stroke",
1302
1367
  "stroke-width",
1303
1368
  "stroke-dasharray"
1304
- ], ln = [
1369
+ ], cn = [
1305
1370
  "x1",
1306
1371
  "y1",
1307
1372
  "x2",
@@ -1309,7 +1374,7 @@ var Bt = {
1309
1374
  "stroke",
1310
1375
  "stroke-width",
1311
1376
  "stroke-dasharray"
1312
- ], un = [
1377
+ ], ln = [
1313
1378
  "x1",
1314
1379
  "y1",
1315
1380
  "x2",
@@ -1317,53 +1382,54 @@ var Bt = {
1317
1382
  "stroke",
1318
1383
  "stroke-width",
1319
1384
  "stroke-dasharray"
1320
- ], dn = [
1385
+ ], un = [
1321
1386
  "x1",
1322
1387
  "y1",
1323
1388
  "x2",
1324
1389
  "y2"
1325
- ], fn = [
1390
+ ], dn = [
1326
1391
  "x1",
1327
1392
  "y1",
1328
1393
  "x2",
1329
1394
  "y2"
1330
- ], pn = [
1395
+ ], fn = [
1331
1396
  "x1",
1332
1397
  "y1",
1333
1398
  "x2",
1334
1399
  "y2"
1335
- ], mn = [
1400
+ ], pn = [
1336
1401
  "cx",
1337
1402
  "cy",
1338
1403
  "fill"
1339
- ], hn = [
1404
+ ], mn = [
1340
1405
  "x",
1341
1406
  "y",
1342
1407
  "width",
1343
1408
  "height"
1344
- ], gn = [
1409
+ ], hn = [
1345
1410
  "cx",
1346
1411
  "cy",
1347
1412
  "fill",
1348
1413
  "fill-opacity",
1349
1414
  "stroke"
1350
- ], _n = [
1415
+ ], gn = [
1351
1416
  "x",
1352
1417
  "y",
1353
1418
  "font-size",
1354
1419
  "font-weight",
1355
1420
  "fill"
1356
- ], vn = [
1421
+ ], _n = [
1357
1422
  "x",
1358
1423
  "y",
1359
1424
  "font-size",
1360
1425
  "font-weight",
1361
1426
  "fill",
1362
1427
  "fill-opacity"
1363
- ], yn = { class: "line-chart-tooltip" }, bn = {
1428
+ ], vn = { class: "line-chart-tooltip" }, yn = {
1364
1429
  key: 0,
1365
1430
  class: "line-chart-tooltip-label"
1366
- }, xn = ["href", "download"], Sn = 36, Cn = 12, wn = 7, Tn = 16, En = /* @__PURE__ */ L(/* @__PURE__ */ l({
1431
+ }, bn = ["href", "download"], xn = 36, Sn = 12, Cn = 7, wn = 16, Tn = /* @__PURE__ */ L(/* @__PURE__ */ l({
1432
+ inheritAttrs: !1,
1367
1433
  __name: "LineChart",
1368
1434
  props: {
1369
1435
  y: {},
@@ -1406,12 +1472,13 @@ var Bt = {
1406
1472
  filename: {},
1407
1473
  downloadLink: { type: [Boolean, String] },
1408
1474
  downloadButton: { type: [Boolean, String] },
1475
+ fullscreenTarget: {},
1409
1476
  annotations: {},
1410
1477
  chartPadding: {}
1411
1478
  },
1412
1479
  emits: ["hover"],
1413
- setup(t, { emit: c }) {
1414
- let l = t, h = c, g = [];
1480
+ setup(c, { emit: l }) {
1481
+ let f = c, h = l, g = [];
1415
1482
  function* v(e) {
1416
1483
  if (e.x && e.x.length > 0 && (yield e.x), e.series) for (let t of e.series) t.x && t.x.length > 0 && (yield t.x);
1417
1484
  if (e.areas) for (let t of e.areas) t.x && t.x.length > 0 && (yield t.x);
@@ -1420,30 +1487,30 @@ var Bt = {
1420
1487
  if (!e) return;
1421
1488
  if (!t) return e;
1422
1489
  let r = new Float64Array(e.length);
1423
- for (let t = 0; t < e.length; t++) r[t] = Dt(e[t], n) ?? NaN;
1490
+ for (let t = 0; t < e.length; t++) r[t] = Et(e[t], n) ?? NaN;
1424
1491
  return r;
1425
1492
  }
1426
- let w = dt(() => l.tooltipValueFormat, () => l.yTickFormat), T = n(() => l.timezone ?? "utc"), E = n(() => {
1493
+ let w = ct(() => f.tooltipValueFormat, () => f.yTickFormat), T = n(() => f.timezone ?? "utc"), E = n(() => {
1427
1494
  let e = T.value, t = !1, n = !1;
1428
- for (let r of v(l)) {
1429
- if (n = !0, !kt(r, e)) {
1495
+ for (let r of v(f)) {
1496
+ if (n = !0, !Ot(r, e)) {
1430
1497
  t = !1;
1431
1498
  break;
1432
1499
  }
1433
1500
  t = !0;
1434
1501
  }
1435
1502
  n || (t = !1);
1436
- let r = l.series && l.series.length > 0 ? l.series.map((n) => ({
1503
+ let r = f.series && f.series.length > 0 ? f.series.map((n) => ({
1437
1504
  ...n,
1438
1505
  data: n.y ?? n.data ?? g,
1439
1506
  x: S(n.x, t, e)
1440
1507
  })) : (() => {
1441
- let n = l.y ?? l.data;
1508
+ let n = f.y ?? f.data;
1442
1509
  return n ? [{
1443
1510
  data: n,
1444
- x: S(l.x, t, e)
1511
+ x: S(f.x, t, e)
1445
1512
  }] : [];
1446
- })(), i = (l.areas ?? []).map((n) => ({
1513
+ })(), i = (f.areas ?? []).map((n) => ({
1447
1514
  ...n,
1448
1515
  x: S(n.x, t, e)
1449
1516
  }));
@@ -1461,10 +1528,10 @@ var Bt = {
1461
1528
  function j(e, t) {
1462
1529
  return e.x ? Number(e.x[t]) : t;
1463
1530
  }
1464
- function re(e, t) {
1531
+ function M(e, t) {
1465
1532
  return e.x ? Number(e.x[t]) : t;
1466
1533
  }
1467
- let M = n(() => A.value ? 0 : l.xMin ?? 0), ie = n(() => {
1534
+ let re = n(() => A.value ? 0 : f.xMin ?? 0), ie = n(() => {
1468
1535
  let e = Infinity, t = -Infinity;
1469
1536
  for (let n of O.value) for (let r = 0; r < n.data.length; r++) {
1470
1537
  let i = j(n, r);
@@ -1473,7 +1540,7 @@ var Bt = {
1473
1540
  for (let n of k.value) {
1474
1541
  let r = Math.max(n.upper.length, n.lower.length);
1475
1542
  for (let i = 0; i < r; i++) {
1476
- let r = re(n, i);
1543
+ let r = M(n, i);
1477
1544
  isFinite(r) && (r < e && (e = r), r > t && (t = r));
1478
1545
  }
1479
1546
  }
@@ -1503,8 +1570,8 @@ var Bt = {
1503
1570
  max: 0,
1504
1571
  range: 1
1505
1572
  };
1506
- l.yMin != null && l.yMin < e && (e = l.yMin);
1507
- let i = be(e, t, l.yScaleType, n);
1573
+ f.yMin != null && f.yMin < e && (e = f.yMin);
1574
+ let i = _e(e, t, f.yScaleType, n);
1508
1575
  return {
1509
1576
  min: i.min,
1510
1577
  max: i.max,
@@ -1513,7 +1580,7 @@ var Bt = {
1513
1580
  });
1514
1581
  function P(e) {
1515
1582
  let { min: t, max: n } = ae.value;
1516
- return U.value.top + K.value - ye(e, t, n, l.yScaleType) * K.value;
1583
+ return U.value.top + K.value - ge(e, t, n, f.yScaleType) * K.value;
1517
1584
  }
1518
1585
  function oe(e) {
1519
1586
  let t = e.data;
@@ -1545,13 +1612,13 @@ var Bt = {
1545
1612
  let t = Math.min(e.upper.length, e.lower.length);
1546
1613
  if (t === 0) return "";
1547
1614
  let n = [], r = [];
1548
- for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(re(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
1615
+ for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(M(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
1549
1616
  r.length && n.push(r);
1550
1617
  let i = "";
1551
1618
  for (let t of n) {
1552
- i += `M${N(re(e, t[0]))},${P(e.upper[t[0]])}`;
1553
- for (let n = 1; n < t.length; n++) i += `L${N(re(e, t[n]))},${P(e.upper[t[n]])}`;
1554
- for (let n = t.length - 1; n >= 0; n--) i += `L${N(re(e, t[n]))},${P(e.lower[t[n]])}`;
1619
+ i += `M${N(M(e, t[0]))},${P(e.upper[t[0]])}`;
1620
+ for (let n = 1; n < t.length; n++) i += `L${N(M(e, t[n]))},${P(e.upper[t[n]])}`;
1621
+ for (let n = t.length - 1; n >= 0; n--) i += `L${N(M(e, t[n]))},${P(e.lower[t[n]])}`;
1555
1622
  i += "Z";
1556
1623
  }
1557
1624
  return i;
@@ -1575,7 +1642,7 @@ var Bt = {
1575
1642
  return t && (o += `L${N(j(r, a))},${n}`, o += `L${N(j(r, i))},${n}`, o += "Z"), o;
1576
1643
  }
1577
1644
  let ue = n(() => {
1578
- let e = l.areaSections;
1645
+ let e = f.areaSections;
1579
1646
  if (!e?.length) return {
1580
1647
  labels: [],
1581
1648
  extraHeight: 0
@@ -1583,11 +1650,11 @@ var Bt = {
1583
1650
  let t = [], n = U.value.left + G.value;
1584
1651
  for (let r of e) {
1585
1652
  if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
1586
- let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * wn, o = F(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor"), u = V({
1653
+ let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Cn, o = F(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor"), u = xe({
1587
1654
  color: l,
1588
1655
  fontWeight: 600,
1589
1656
  ...r.inlineLabelStyle
1590
- }, { fontSize: 11 }), d = V(r.inlineDescriptionStyle, {
1657
+ }, { fontSize: 11 }), d = xe(r.inlineDescriptionStyle, {
1591
1658
  fontSize: 11,
1592
1659
  fillOpacity: .6
1593
1660
  });
@@ -1607,7 +1674,7 @@ var Bt = {
1607
1674
  let r = [];
1608
1675
  for (let e of t) {
1609
1676
  let t = e.cx - e.textWidth / 2, n = 0;
1610
- for (; n < r.length && !(t >= r[n] + Tn);) n++;
1677
+ for (; n < r.length && !(t >= r[n] + wn);) n++;
1611
1678
  e.row = n;
1612
1679
  let i = e.cx + e.textWidth / 2;
1613
1680
  r[n] = Math.max(r[n] ?? -Infinity, i);
@@ -1617,9 +1684,9 @@ var Bt = {
1617
1684
  extraHeight: 0
1618
1685
  } : {
1619
1686
  labels: t,
1620
- extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Sn + Cn
1687
+ extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * xn + Sn
1621
1688
  };
1622
- }), I = n(() => {
1689
+ }), de = n(() => {
1623
1690
  let e = [];
1624
1691
  for (let t of O.value) !t.legend || t.showInLegend === !1 || e.push({
1625
1692
  label: t.legend,
@@ -1627,7 +1694,7 @@ var Bt = {
1627
1694
  type: "series",
1628
1695
  dashed: t.dashed
1629
1696
  });
1630
- let t = l.areaSections;
1697
+ let t = f.areaSections;
1631
1698
  if (t) for (let n of t) {
1632
1699
  if (n.legend !== "inline" || !n.label && !n.description) continue;
1633
1700
  let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : O.value[n.seriesIndex]?.color ?? "currentColor");
@@ -1639,68 +1706,68 @@ var Bt = {
1639
1706
  });
1640
1707
  }
1641
1708
  return e;
1642
- }), de = n(() => I.value.map((e) => e.label)), fe = n(() => Me.value + ue.value.extraHeight), L = n(() => U.value.top + K.value + U.value.bottom + Cn), me = n(() => {
1643
- let { min: e, max: t } = ae.value, n = (e) => l.yTickFormat === void 0 ? _e(e) : te(e, l.yTickFormat);
1709
+ }), I = n(() => de.value.map((e) => e.label)), L = n(() => Me.value + ue.value.extraHeight), z = n(() => U.value.top + K.value + U.value.bottom + Sn), B = n(() => {
1710
+ let { min: e, max: t } = ae.value, n = (e) => f.yTickFormat === void 0 ? me(e) : te(e, f.yTickFormat);
1644
1711
  return e === t ? [{
1645
1712
  value: n(e),
1646
1713
  y: R(U.value.top + K.value / 2)
1647
- }] : (l.yScaleType === "log" ? z({
1714
+ }] : (f.yScaleType === "log" ? ve({
1648
1715
  min: e,
1649
1716
  max: t,
1650
- ticks: l.yTicks
1651
- }) : ve({
1717
+ ticks: f.yTicks
1718
+ }) : he({
1652
1719
  min: e,
1653
1720
  max: t,
1654
- ticks: l.yTicks,
1721
+ ticks: f.yTicks,
1655
1722
  targetTickCount: K.value / 50
1656
1723
  })).map((e) => ({
1657
1724
  value: n(e),
1658
1725
  y: R(P(e))
1659
1726
  }));
1660
1727
  });
1661
- function he(e, t, n) {
1662
- let r = l.xTickFormat;
1663
- if (D.value) return typeof r == "function" ? r(e, t) : zt(e, r, T.value, n);
1664
- let i = e + M.value;
1665
- return r === void 0 ? !A.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : _e(i) : typeof r == "function" ? r(i, t) : te(i, r);
1728
+ function pe(e, t, n) {
1729
+ let r = f.xTickFormat;
1730
+ if (D.value) return typeof r == "function" ? r(e, t) : Rt(e, r, T.value, n);
1731
+ let i = e + re.value;
1732
+ return r === void 0 ? !A.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] : me(i) : typeof r == "function" ? r(i, t) : te(i, r);
1666
1733
  }
1667
- let ge = n(() => {
1734
+ let ye = n(() => {
1668
1735
  let { min: e, max: t } = ie.value;
1669
1736
  if (e === t) return [];
1670
- let n = D.value, r = n ? 0 : M.value, i = ne.value, a = G.value / 80, o, s;
1737
+ let n = D.value, r = n ? 0 : re.value, i = ne.value, a = G.value / 80, o, s;
1671
1738
  if (n) {
1672
- let n = Nt(e, t, a, T.value);
1673
- s = n.unit, o = ve({
1739
+ let n = Mt(e, t, a, T.value);
1740
+ s = n.unit, o = he({
1674
1741
  min: e,
1675
1742
  max: t,
1676
1743
  ticks: n.values
1677
1744
  });
1678
- } else if (l.xTicks == null && !A.value && l.xLabels && l.xLabels.length === i) {
1745
+ } else if (f.xTicks == null && !A.value && f.xLabels && f.xLabels.length === i) {
1679
1746
  let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
1680
1747
  o = [];
1681
1748
  for (let e = 0; e < i; e += t) o.push(e);
1682
- } else o = ve({
1749
+ } else o = he({
1683
1750
  min: e,
1684
1751
  max: t,
1685
- ticks: l.xTicks,
1752
+ ticks: f.xTicks,
1686
1753
  targetTickCount: a,
1687
1754
  displayOffset: r
1688
1755
  });
1689
- let c = U.value.left, u = U.value.left + G.value;
1756
+ let c = U.value.left, l = U.value.left + G.value;
1690
1757
  return o.map((e, t) => {
1691
1758
  let n = R(N(e)), r = "middle";
1692
- return n - c <= 1 ? r = "start" : u - n <= 1 && (r = "end"), {
1693
- value: he(e, t, s),
1759
+ return n - c <= 1 ? r = "start" : l - n <= 1 && (r = "end"), {
1760
+ value: pe(e, t, s),
1694
1761
  x: n,
1695
1762
  anchor: r
1696
1763
  };
1697
1764
  });
1698
1765
  });
1699
- function xe() {
1700
- return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : He(O.value);
1766
+ function be() {
1767
+ return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : Be(O.value);
1701
1768
  }
1702
- let B = n(() => !!l.tooltipData || !!l.tooltipTrigger), Ce = n(() => {
1703
- let e = Fe.value, t = O.value[0];
1769
+ let Se = n(() => !!f.tooltipData || !!f.tooltipTrigger), Ce = n(() => {
1770
+ let e = q.value, t = O.value[0];
1704
1771
  return e === null || !t ? null : j(t, e);
1705
1772
  }), we = n(() => Ce.value === null ? 0 : N(Ce.value));
1706
1773
  function Te(e, t) {
@@ -1732,9 +1799,9 @@ var Bt = {
1732
1799
  }
1733
1800
  return t;
1734
1801
  }), De = n(() => {
1735
- let e = Fe.value, t = Ce.value;
1802
+ let e = q.value, t = Ce.value;
1736
1803
  if (e === null || t === null) return null;
1737
- let n = he(t, e), r = O.value, i = [];
1804
+ let n = pe(t, e), r = O.value, i = [];
1738
1805
  for (let e = 0; e < r.length; e++) {
1739
1806
  let n = r[e];
1740
1807
  if (n.showInTooltip === !1) continue;
@@ -1749,12 +1816,12 @@ var Bt = {
1749
1816
  index: e,
1750
1817
  xLabel: n,
1751
1818
  values: i,
1752
- data: l.tooltipData?.[e] ?? null
1819
+ data: f.tooltipData?.[e] ?? null
1753
1820
  };
1754
1821
  });
1755
1822
  function Oe(e, t) {
1756
1823
  return !isFinite(e) || !isFinite(t) ? null : {
1757
- x: N(e - M.value),
1824
+ x: N(e - re.value),
1758
1825
  y: P(t)
1759
1826
  };
1760
1827
  }
@@ -1766,34 +1833,35 @@ var Bt = {
1766
1833
  let { min: r, max: i } = ie.value, a = i - r || 1;
1767
1834
  return Te(n, r + (e - t.left - U.value.left) / G.value * a);
1768
1835
  }
1769
- let { containerRef: Ae, svgRef: H, width: je, height: Me, padding: U, legendY: W, inlineLegendLayout: Ne, innerW: G, innerH: K, bounds: Pe, hoverIndex: Fe, tooltipRef: Ie, tooltipPos: Le, tooltipHandlers: Re, menuItems: ze, downloadLinkText: Be, csvHref: Ve, downloadButtonText: Ue, triggerCsvDownload: q, menuFilename: J, isFullscreen: We } = ut({
1770
- width: () => l.width,
1771
- height: () => l.height,
1772
- title: () => l.title,
1773
- titleStyle: () => l.titleStyle,
1774
- xLabel: () => l.xLabel,
1775
- yLabel: () => l.yLabel,
1776
- debounce: () => l.debounce,
1777
- menu: () => l.menu,
1778
- tooltipTrigger: () => l.tooltipTrigger,
1779
- tooltipClamp: () => l.tooltipClamp,
1780
- filename: () => l.filename,
1781
- downloadLink: () => l.downloadLink,
1782
- downloadButton: () => l.downloadButton,
1783
- chartPadding: () => l.chartPadding,
1784
- inlineLegendLabels: () => de.value,
1785
- hasTooltipSlot: () => B.value,
1786
- getCsv: xe,
1836
+ let { containerRef: Ae, svgRef: H, width: je, height: Me, padding: U, legendY: W, inlineLegendLayout: Ne, innerW: G, innerH: K, bounds: Pe, hoverIndex: q, tooltipRef: Fe, tooltipPos: Ie, tooltipHandlers: Le, menuItems: Re, downloadLinkText: ze, csvHref: Ve, downloadButtonText: He, triggerCsvDownload: Ue, menuFilename: We, isFullscreen: Ge, fullscreenStyle: Ke, teleportTarget: J, exitFullscreen: qe } = st({
1837
+ width: () => f.width,
1838
+ height: () => f.height,
1839
+ title: () => f.title,
1840
+ titleStyle: () => f.titleStyle,
1841
+ xLabel: () => f.xLabel,
1842
+ yLabel: () => f.yLabel,
1843
+ debounce: () => f.debounce,
1844
+ menu: () => f.menu,
1845
+ tooltipTrigger: () => f.tooltipTrigger,
1846
+ tooltipClamp: () => f.tooltipClamp,
1847
+ filename: () => f.filename,
1848
+ downloadLink: () => f.downloadLink,
1849
+ downloadButton: () => f.downloadButton,
1850
+ fullscreenTarget: () => f.fullscreenTarget,
1851
+ chartPadding: () => f.chartPadding,
1852
+ inlineLegendLabels: () => I.value,
1853
+ hasTooltipSlot: () => Se.value,
1854
+ getCsv: be,
1787
1855
  pointerToIndex: ke,
1788
1856
  onHover: (e) => h("hover", e),
1789
1857
  extraBelowHeight: () => ue.value.extraHeight
1790
- }), Ge = n(() => V(l.axisLabelStyle, { fontSize: 13 })), Y = n(() => V(l.tickLabelStyle, {
1858
+ }), Y = n(() => xe(f.axisLabelStyle, { fontSize: 13 })), X = n(() => xe(f.tickLabelStyle, {
1791
1859
  fontSize: 10,
1792
- fillOpacity: Se
1793
- })), Ke = n(() => V(l.legendStyle, { fontSize: 11 })), X = n(() => {
1794
- let e = l.titleStyle, t = e?.align ?? "left", n = Pe.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
1860
+ fillOpacity: V
1861
+ })), Je = n(() => xe(f.legendStyle, { fontSize: 11 })), Z = n(() => {
1862
+ let e = f.titleStyle, t = e?.align ?? "left", n = Pe.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
1795
1863
  return {
1796
- lines: (l.title ?? "").split("\n"),
1864
+ lines: (f.title ?? "").split("\n"),
1797
1865
  fontSize: e?.fontSize ?? 14,
1798
1866
  lineHeight: e?.lineHeight ?? 18,
1799
1867
  fontWeight: e?.fontWeight ?? 600,
@@ -1801,9 +1869,9 @@ var Bt = {
1801
1869
  x: r,
1802
1870
  anchor: i
1803
1871
  };
1804
- }), qe = n(() => {
1872
+ }), Q = n(() => {
1805
1873
  let e = Ne.value.positions, t = U.value.left, n = W.value;
1806
- return I.value.map((r, i) => {
1874
+ return de.value.map((r, i) => {
1807
1875
  let a = e[i];
1808
1876
  return {
1809
1877
  ...r,
@@ -1812,36 +1880,47 @@ var Bt = {
1812
1880
  };
1813
1881
  });
1814
1882
  });
1815
- return (n, c) => (_(), a("div", {
1883
+ return (n, l) => (_(), r(t, {
1884
+ to: C(J),
1885
+ disabled: !C(Ge)
1886
+ }, [o("div", d({
1816
1887
  ref_key: "containerRef",
1817
- ref: Ae,
1818
- class: f(["line-chart-wrapper", { "is-fullscreen": C(We) }])
1819
- }, [
1820
- t.menu ? (_(), r(pe, {
1888
+ ref: Ae
1889
+ }, n.$attrs, {
1890
+ class: ["line-chart-wrapper", { "is-fullscreen": C(Ge) }],
1891
+ style: C(Ke)
1892
+ }), [
1893
+ c.menu ? (_(), r(fe, {
1821
1894
  key: 0,
1822
- items: C(ze)
1823
- }, null, 8, ["items"])) : i("", !0),
1824
- o("div", Bt, x(C(We) ? "Chart expanded to fill window" : ""), 1),
1895
+ items: C(Re),
1896
+ "is-fullscreen": C(Ge),
1897
+ onClose: C(qe)
1898
+ }, null, 8, [
1899
+ "items",
1900
+ "is-fullscreen",
1901
+ "onClose"
1902
+ ])) : i("", !0),
1903
+ o("div", zt, x(C(Ge) ? "Chart expanded to fill window" : ""), 1),
1825
1904
  (_(), a("svg", {
1826
1905
  ref_key: "svgRef",
1827
1906
  ref: H,
1828
1907
  width: C(je),
1829
- height: fe.value
1908
+ height: L.value
1830
1909
  }, [
1831
- t.title ? (_(), a("text", {
1910
+ c.title ? (_(), a("text", {
1832
1911
  key: 0,
1833
- x: X.value.x,
1834
- y: X.value.lineHeight,
1835
- "text-anchor": X.value.anchor,
1836
- "font-size": X.value.fontSize,
1837
- "font-weight": X.value.fontWeight,
1838
- fill: X.value.color
1839
- }, [(_(!0), a(e, null, y(X.value.lines, (e, t) => (_(), a("tspan", {
1912
+ x: Z.value.x,
1913
+ y: Z.value.lineHeight,
1914
+ "text-anchor": Z.value.anchor,
1915
+ "font-size": Z.value.fontSize,
1916
+ "font-weight": Z.value.fontWeight,
1917
+ fill: Z.value.color
1918
+ }, [(_(!0), a(e, null, y(Z.value.lines, (e, t) => (_(), a("tspan", {
1840
1919
  key: t,
1841
- x: X.value.x,
1842
- dy: t === 0 ? 0 : X.value.lineHeight
1843
- }, x(e), 9, Ut))), 128))], 8, Ht)) : i("", !0),
1844
- qe.value.length > 0 ? (_(), a("g", Wt, [(_(!0), a(e, null, y(qe.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
1920
+ x: Z.value.x,
1921
+ dy: t === 0 ? 0 : Z.value.lineHeight
1922
+ }, x(e), 9, Ht))), 128))], 8, Vt)) : i("", !0),
1923
+ Q.value.length > 0 ? (_(), a("g", Ut, [(_(!0), a(e, null, y(Q.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
1845
1924
  key: 0,
1846
1925
  x1: t.x,
1847
1926
  y1: t.y,
@@ -1850,7 +1929,7 @@ var Bt = {
1850
1929
  stroke: t.color,
1851
1930
  "stroke-width": "2",
1852
1931
  "stroke-dasharray": t.dashed ? "4 2" : void 0
1853
- }, null, 8, Gt)) : (_(), a("circle", {
1932
+ }, null, 8, Wt)) : (_(), a("circle", {
1854
1933
  key: 1,
1855
1934
  cx: t.x + 4,
1856
1935
  cy: t.y,
@@ -1859,13 +1938,13 @@ var Bt = {
1859
1938
  "fill-opacity": t.fillOpacity,
1860
1939
  stroke: t.color,
1861
1940
  "stroke-width": "1.5"
1862
- }, null, 8, Kt)), o("text", {
1941
+ }, null, 8, Gt)), o("text", {
1863
1942
  x: t.x + 18,
1864
1943
  y: t.y + 4,
1865
- "font-size": Ke.value.fontSize,
1866
- fill: Ke.value.fill,
1867
- "font-weight": Ke.value.fontWeight
1868
- }, x(t.label), 9, qt)], 64))), 128))])) : i("", !0),
1944
+ "font-size": Je.value.fontSize,
1945
+ fill: Je.value.fill,
1946
+ "font-weight": Je.value.fontWeight
1947
+ }, x(t.label), 9, Kt)], 64))), 128))])) : i("", !0),
1869
1948
  o("line", {
1870
1949
  x1: C(R)(C(U).left),
1871
1950
  y1: C(R)(C(U).top),
@@ -1873,7 +1952,7 @@ var Bt = {
1873
1952
  y2: C(R)(C(U).top + C(K)),
1874
1953
  stroke: "currentColor",
1875
1954
  "stroke-opacity": "0.3"
1876
- }, null, 8, Jt),
1955
+ }, null, 8, qt),
1877
1956
  o("line", {
1878
1957
  x1: C(R)(C(U).left),
1879
1958
  y1: C(R)(C(U).top + C(K)),
@@ -1881,8 +1960,8 @@ var Bt = {
1881
1960
  y2: C(R)(C(U).top + C(K)),
1882
1961
  stroke: "currentColor",
1883
1962
  "stroke-opacity": "0.3"
1884
- }, null, 8, Yt),
1885
- t.yGrid ? (_(!0), a(e, { key: 2 }, y(me.value, (e, t) => (_(), a("line", {
1963
+ }, null, 8, Jt),
1964
+ c.yGrid ? (_(!0), a(e, { key: 2 }, y(B.value, (e, t) => (_(), a("line", {
1886
1965
  key: "yg" + t,
1887
1966
  x1: C(U).left,
1888
1967
  y1: e.y,
@@ -1890,8 +1969,8 @@ var Bt = {
1890
1969
  y2: e.y,
1891
1970
  stroke: "currentColor",
1892
1971
  "stroke-opacity": "0.1"
1893
- }, null, 8, Xt))), 128)) : i("", !0),
1894
- t.xGrid ? (_(!0), a(e, { key: 3 }, y(ge.value, (e, t) => (_(), a("line", {
1972
+ }, null, 8, Yt))), 128)) : i("", !0),
1973
+ c.xGrid ? (_(!0), a(e, { key: 3 }, y(ye.value, (e, t) => (_(), a("line", {
1895
1974
  key: "xg" + t,
1896
1975
  x1: e.x,
1897
1976
  y1: C(U).top,
@@ -1899,95 +1978,96 @@ var Bt = {
1899
1978
  y2: C(U).top + C(K),
1900
1979
  stroke: "currentColor",
1901
1980
  "stroke-opacity": "0.1"
1902
- }, null, 8, Zt))), 128)) : i("", !0),
1903
- (_(!0), a(e, null, y(me.value, (e, t) => (_(), a("text", {
1981
+ }, null, 8, Xt))), 128)) : i("", !0),
1982
+ (_(!0), a(e, null, y(B.value, (e, t) => (_(), a("text", {
1904
1983
  key: "y" + t,
1905
1984
  "data-testid": "y-tick",
1906
1985
  x: C(U).left - 6,
1907
1986
  y: e.y,
1908
1987
  "text-anchor": "end",
1909
1988
  "dominant-baseline": "middle",
1910
- "font-size": Y.value.fontSize,
1911
- fill: Y.value.fill,
1912
- "font-weight": Y.value.fontWeight,
1913
- "fill-opacity": Y.value.fillOpacity
1914
- }, x(e.value), 9, Qt))), 128)),
1915
- t.yLabel ? (_(), a("text", {
1989
+ "font-size": X.value.fontSize,
1990
+ fill: X.value.fill,
1991
+ "font-weight": X.value.fontWeight,
1992
+ "fill-opacity": X.value.fillOpacity
1993
+ }, x(e.value), 9, Zt))), 128)),
1994
+ c.yLabel ? (_(), a("text", {
1916
1995
  key: 4,
1917
1996
  x: 0,
1918
1997
  y: 0,
1919
1998
  transform: `translate(14, ${C(U).top + C(K) / 2}) rotate(-90)`,
1920
1999
  "text-anchor": "middle",
1921
- "font-size": Ge.value.fontSize,
1922
- fill: Ge.value.fill,
1923
- "font-weight": Ge.value.fontWeight
1924
- }, x(t.yLabel), 9, $t)) : i("", !0),
1925
- (_(!0), a(e, null, y(ge.value, (e, t) => (_(), a("text", {
2000
+ "font-size": Y.value.fontSize,
2001
+ fill: Y.value.fill,
2002
+ "font-weight": Y.value.fontWeight
2003
+ }, x(c.yLabel), 9, Qt)) : i("", !0),
2004
+ (_(!0), a(e, null, y(ye.value, (e, t) => (_(), a("text", {
1926
2005
  key: "x" + t,
1927
2006
  "data-testid": "x-tick",
1928
2007
  x: e.x,
1929
2008
  y: C(U).top + C(K) + 16,
1930
2009
  "text-anchor": e.anchor,
1931
- "font-size": Y.value.fontSize,
1932
- fill: Y.value.fill,
1933
- "font-weight": Y.value.fontWeight,
1934
- "fill-opacity": Y.value.fillOpacity
1935
- }, x(e.value), 9, en))), 128)),
1936
- t.xLabel ? (_(), a("text", {
2010
+ "font-size": X.value.fontSize,
2011
+ fill: X.value.fill,
2012
+ "font-weight": X.value.fontWeight,
2013
+ "fill-opacity": X.value.fillOpacity
2014
+ }, x(e.value), 9, $t))), 128)),
2015
+ c.xLabel ? (_(), a("text", {
1937
2016
  key: 5,
1938
2017
  x: C(U).left + C(G) / 2,
1939
2018
  y: C(Me) - 4,
1940
2019
  "text-anchor": "middle",
1941
- "font-size": Ge.value.fontSize,
1942
- fill: Ge.value.fill,
1943
- "font-weight": Ge.value.fontWeight
1944
- }, x(t.xLabel), 9, tn)) : i("", !0),
2020
+ "font-size": Y.value.fontSize,
2021
+ fill: Y.value.fill,
2022
+ "font-weight": Y.value.fontWeight
2023
+ }, x(c.xLabel), 9, en)) : i("", !0),
1945
2024
  (_(!0), a(e, null, y(k.value, (e, t) => (_(), a("path", {
1946
2025
  key: "area" + t,
1947
2026
  d: ce(e),
1948
2027
  fill: e.color ?? "currentColor",
1949
2028
  "fill-opacity": e.opacity ?? .2,
1950
- stroke: "none"
1951
- }, null, 8, nn))), 128)),
1952
- (_(!0), a(e, null, y(O.value, (n, r) => (_(), a(e, { key: r }, [
1953
- n.line !== !1 && n.outline ? (_(), a("path", {
2029
+ stroke: "none",
2030
+ style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
2031
+ }, null, 12, tn))), 128)),
2032
+ (_(!0), a(e, null, y(O.value, (t, n) => (_(), a(e, { key: n }, [
2033
+ t.line !== !1 && t.outline ? (_(), a("path", {
1954
2034
  key: 0,
1955
- d: oe(n),
2035
+ d: oe(t),
1956
2036
  fill: "none",
1957
- stroke: "var(--color-bg-0, #fff)",
1958
- "stroke-width": (n.strokeWidth ?? 1.5) + 4,
2037
+ stroke: t.outlineColor ?? "var(--color-bg-0, #fff)",
2038
+ "stroke-width": (t.strokeWidth ?? 1.5) + (t.outlineWidth ?? 4),
1959
2039
  "stroke-linecap": "round",
1960
2040
  "stroke-linejoin": "round",
1961
2041
  "data-testid": "line-outline"
1962
- }, null, 8, rn)) : i("", !0),
1963
- n.line === !1 ? i("", !0) : (_(), a("path", {
2042
+ }, null, 8, nn)) : i("", !0),
2043
+ t.line === !1 ? i("", !0) : (_(), a("path", {
1964
2044
  key: 1,
1965
- d: oe(n),
2045
+ d: oe(t),
1966
2046
  fill: "none",
1967
- stroke: n.color ?? "currentColor",
1968
- "stroke-width": n.strokeWidth ?? 1.5,
1969
- "stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
1970
- "stroke-dasharray": n.dashed ? "6 3" : void 0,
1971
- style: m(n.blendMode ? { mixBlendMode: n.blendMode } : void 0)
1972
- }, null, 12, an)),
1973
- n.dots ? (_(!0), a(e, { key: 2 }, y(se(n), (e, r) => (_(), a("circle", {
1974
- key: r,
2047
+ stroke: t.color ?? "currentColor",
2048
+ "stroke-width": t.strokeWidth ?? 1.5,
2049
+ "stroke-opacity": t.lineOpacity ?? t.opacity ?? c.lineOpacity,
2050
+ "stroke-dasharray": t.dashed ? "6 3" : void 0,
2051
+ style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
2052
+ }, null, 12, rn)),
2053
+ t.dots ? (_(!0), a(e, { key: 2 }, y(se(t), (e, n) => (_(), a("circle", {
2054
+ key: n,
1975
2055
  cx: e.x,
1976
2056
  cy: e.y,
1977
- r: n.dotRadius ?? (n.strokeWidth ?? 1.5) + 1,
1978
- fill: n.dotFill ?? n.color ?? "currentColor",
1979
- "fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
1980
- stroke: n.dotStroke ?? "none",
1981
- style: m(n.blendMode ? { mixBlendMode: n.blendMode } : void 0)
1982
- }, null, 12, on))), 128)) : i("", !0)
2057
+ r: t.dotRadius ?? (t.strokeWidth ?? 1.5) + 1,
2058
+ fill: t.dotFill ?? t.color ?? "currentColor",
2059
+ "fill-opacity": t.dotOpacity ?? t.opacity ?? c.lineOpacity,
2060
+ stroke: t.dotStroke ?? "none",
2061
+ style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
2062
+ }, null, 12, an))), 128)) : i("", !0)
1983
2063
  ], 64))), 128)),
1984
- (_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
2064
+ (_(!0), a(e, null, y(c.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
1985
2065
  o("path", {
1986
2066
  d: le(t),
1987
2067
  fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
1988
2068
  "fill-opacity": t.opacity ?? .15,
1989
2069
  stroke: "none"
1990
- }, null, 8, sn),
2070
+ }, null, 8, on),
1991
2071
  t.seriesIndex == null ? i("", !0) : (_(), a("path", {
1992
2072
  key: 0,
1993
2073
  d: le(t, !1),
@@ -1995,7 +2075,7 @@ var Bt = {
1995
2075
  stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
1996
2076
  "stroke-width": t.strokeWidth ?? 2,
1997
2077
  "stroke-dasharray": t.dashed ? "6 3" : void 0
1998
- }, null, 8, cn)),
2078
+ }, null, 8, sn)),
1999
2079
  t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
2000
2080
  x1: C(R)(F(t, "start")),
2001
2081
  y1: C(U).top,
@@ -2004,7 +2084,7 @@ var Bt = {
2004
2084
  stroke: t.color ?? "#999",
2005
2085
  "stroke-width": t.strokeWidth ?? 2,
2006
2086
  "stroke-dasharray": t.dashed ? "6 3" : void 0
2007
- }, null, 8, ln), o("line", {
2087
+ }, null, 8, cn), o("line", {
2008
2088
  x1: C(R)(F(t, "end")),
2009
2089
  y1: C(U).top,
2010
2090
  x2: C(R)(F(t, "end")),
@@ -2012,7 +2092,7 @@ var Bt = {
2012
2092
  stroke: t.color ?? "#999",
2013
2093
  "stroke-width": t.strokeWidth ?? 2,
2014
2094
  "stroke-dasharray": t.dashed ? "6 3" : void 0
2015
- }, null, 8, un)], 64)) : i("", !0),
2095
+ }, null, 8, ln)], 64)) : i("", !0),
2016
2096
  o("line", {
2017
2097
  x1: C(R)(F(t, "start")),
2018
2098
  y1: C(U).top + C(K) - 4,
@@ -2020,7 +2100,7 @@ var Bt = {
2020
2100
  y2: C(U).top + C(K) + 4,
2021
2101
  stroke: "currentColor",
2022
2102
  "stroke-opacity": "0.4"
2023
- }, null, 8, dn),
2103
+ }, null, 8, un),
2024
2104
  o("line", {
2025
2105
  x1: C(R)(F(t, "end")),
2026
2106
  y1: C(U).top + C(K) - 4,
@@ -2028,9 +2108,9 @@ var Bt = {
2028
2108
  y2: C(U).top + C(K) + 4,
2029
2109
  stroke: "currentColor",
2030
2110
  "stroke-opacity": "0.4"
2031
- }, null, 8, fn)
2111
+ }, null, 8, dn)
2032
2112
  ], 64))), 128)),
2033
- B.value && C(Fe) !== null ? (_(), a("line", {
2113
+ Se.value && C(q) !== null ? (_(), a("line", {
2034
2114
  key: 6,
2035
2115
  x1: C(R)(we.value),
2036
2116
  y1: C(U).top,
@@ -2040,7 +2120,7 @@ var Bt = {
2040
2120
  "stroke-opacity": "0.3",
2041
2121
  "stroke-dasharray": "4 2",
2042
2122
  "pointer-events": "none"
2043
- }, null, 8, pn)) : i("", !0),
2123
+ }, null, 8, fn)) : i("", !0),
2044
2124
  (_(!0), a(e, null, y(Ee.value, (e, t) => (_(), a("circle", {
2045
2125
  key: "hd" + t,
2046
2126
  cx: e.x,
@@ -2050,8 +2130,8 @@ var Bt = {
2050
2130
  stroke: "var(--color-bg-0, #fff)",
2051
2131
  "stroke-width": "2",
2052
2132
  "pointer-events": "none"
2053
- }, null, 8, mn))), 128)),
2054
- B.value ? (_(), a("rect", d({
2133
+ }, null, 8, pn))), 128)),
2134
+ Se.value ? (_(), a("rect", d({
2055
2135
  key: 7,
2056
2136
  x: C(U).left,
2057
2137
  y: C(U).top,
@@ -2060,152 +2140,152 @@ var Bt = {
2060
2140
  fill: "transparent",
2061
2141
  style: {
2062
2142
  cursor: "crosshair",
2063
- "touch-action": "none"
2143
+ "touch-action": "pan-y"
2064
2144
  }
2065
- }, ee(C(Re), !0)), null, 16, hn)) : i("", !0),
2066
- t.annotations && t.annotations.length > 0 ? (_(), r(C(st), {
2145
+ }, ee(C(Le), !0)), null, 16, mn)) : i("", !0),
2146
+ c.annotations && c.annotations.length > 0 ? (_(), r(C(it), {
2067
2147
  key: 8,
2068
- annotations: t.annotations,
2148
+ annotations: c.annotations,
2069
2149
  project: Oe,
2070
2150
  bounds: C(Pe)
2071
2151
  }, null, 8, ["annotations", "bounds"])) : i("", !0),
2072
2152
  (_(!0), a(e, null, y(ue.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
2073
2153
  o("circle", {
2074
2154
  cx: e.cx - e.textWidth / 2 - 2,
2075
- cy: L.value + e.row * Sn + 4,
2155
+ cy: z.value + e.row * xn + 4,
2076
2156
  r: "4",
2077
2157
  fill: e.color,
2078
2158
  "fill-opacity": e.fillOpacity,
2079
2159
  stroke: e.color,
2080
2160
  "stroke-width": "1.5"
2081
- }, null, 8, gn),
2161
+ }, null, 8, hn),
2082
2162
  e.labelText ? (_(), a("text", {
2083
2163
  key: 0,
2084
2164
  x: e.cx - e.textWidth / 2 + 8,
2085
- y: L.value + e.row * Sn + 8,
2165
+ y: z.value + e.row * xn + 8,
2086
2166
  "font-size": e.labelStyle.fontSize,
2087
2167
  "font-weight": e.labelStyle.fontWeight,
2088
2168
  fill: e.labelStyle.fill
2089
- }, x(e.labelText), 9, _n)) : i("", !0),
2169
+ }, x(e.labelText), 9, gn)) : i("", !0),
2090
2170
  e.descText ? (_(), a("text", {
2091
2171
  key: 1,
2092
2172
  x: e.cx - e.textWidth / 2 + 8,
2093
- y: L.value + e.row * Sn + 22,
2173
+ y: z.value + e.row * xn + 22,
2094
2174
  "font-size": e.descStyle.fontSize,
2095
2175
  "font-weight": e.descStyle.fontWeight,
2096
2176
  fill: e.descStyle.fill,
2097
2177
  "fill-opacity": e.descStyle.fillOpacity
2098
- }, x(e.descText), 9, vn)) : i("", !0)
2178
+ }, x(e.descText), 9, _n)) : i("", !0)
2099
2179
  ]))), 128))
2100
- ], 8, Vt)),
2101
- B.value && C(Fe) !== null && De.value ? (_(), a("div", {
2180
+ ], 8, Bt)),
2181
+ Se.value && C(q) !== null && De.value ? (_(), a("div", {
2102
2182
  key: 1,
2103
2183
  ref_key: "tooltipRef",
2104
- ref: Ie,
2184
+ ref: Fe,
2105
2185
  class: "chart-tooltip-content",
2106
2186
  style: m({
2107
2187
  position: "absolute",
2108
2188
  top: "0",
2109
2189
  left: "0",
2110
2190
  willChange: "transform",
2111
- transform: C(Le) ? `translate3d(${C(Le).left}px, ${C(Le).top}px, 0) translateY(-50%)` : "translateY(-50%)",
2112
- visibility: C(Le) ? "visible" : "hidden"
2191
+ transform: C(Ie) ? `translate3d(${C(Ie).left}px, ${C(Ie).top}px, 0) translateY(-50%)` : "translateY(-50%)",
2192
+ visibility: C(Ie) ? "visible" : "hidden"
2113
2193
  })
2114
- }, [b(n.$slots, "tooltip", p(u(De.value)), () => [o("div", yn, [De.value.xLabel ? (_(), a("div", bn, x(De.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(De.value.values, (e) => (_(), a("div", {
2194
+ }, [b(n.$slots, "tooltip", p(u(De.value)), () => [o("div", vn, [De.value.xLabel ? (_(), a("div", yn, x(De.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(De.value.values, (e) => (_(), a("div", {
2115
2195
  key: e.seriesIndex,
2116
2196
  class: "line-chart-tooltip-row"
2117
2197
  }, [o("span", {
2118
2198
  class: "line-chart-tooltip-swatch",
2119
2199
  style: m({ background: e.color })
2120
2200
  }, null, 4), s(" " + x(isFinite(e.value) ? C(w)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
2121
- C(Be) ? (_(), a("a", {
2201
+ C(ze) ? (_(), a("a", {
2122
2202
  key: 2,
2123
2203
  class: "line-chart-download-link",
2124
2204
  href: C(Ve),
2125
- download: `${C(J)()}.csv`
2126
- }, x(C(Be)), 9, xn)) : i("", !0),
2127
- C(Ue) ? (_(), a("button", {
2205
+ download: `${C(We)()}.csv`
2206
+ }, x(C(ze)), 9, bn)) : i("", !0),
2207
+ C(He) ? (_(), a("button", {
2128
2208
  key: 3,
2129
2209
  type: "button",
2130
2210
  class: "line-chart-download-button",
2131
- onClick: c[0] ||= (...e) => C(q) && C(q)(...e)
2132
- }, x(C(Ue)), 1)) : i("", !0)
2133
- ], 2));
2211
+ onClick: l[0] ||= (...e) => C(Ue) && C(Ue)(...e)
2212
+ }, x(C(He)), 1)) : i("", !0)
2213
+ ], 16)], 8, ["to", "disabled"]));
2134
2214
  }
2135
- }), [["__scopeId", "data-v-0d24242d"]]), Dn = {
2215
+ }), [["__scopeId", "data-v-e96123bd"]]), En = {
2136
2216
  class: "chart-sr-only",
2137
2217
  "aria-live": "polite"
2138
- }, On = ["width", "height"], kn = [
2218
+ }, Dn = ["width", "height"], On = [
2139
2219
  "x",
2140
2220
  "y",
2141
2221
  "text-anchor",
2142
2222
  "font-size",
2143
2223
  "font-weight",
2144
2224
  "fill"
2145
- ], An = ["x", "dy"], jn = [
2225
+ ], kn = ["x", "dy"], An = [
2146
2226
  "data-testid",
2147
2227
  "x",
2148
2228
  "y",
2149
2229
  "text-anchor",
2150
2230
  "font-size",
2151
2231
  "fill"
2152
- ], Mn = { key: 1 }, Nn = [
2232
+ ], jn = { key: 1 }, Mn = [
2153
2233
  "x",
2154
2234
  "y",
2155
2235
  "fill"
2156
- ], Pn = [
2236
+ ], Nn = [
2157
2237
  "x1",
2158
2238
  "y1",
2159
2239
  "x2",
2160
2240
  "y2",
2161
2241
  "stroke",
2162
2242
  "stroke-dasharray"
2163
- ], Fn = [
2243
+ ], Pn = [
2164
2244
  "x",
2165
2245
  "y",
2166
2246
  "font-size",
2167
2247
  "fill",
2168
2248
  "font-weight"
2169
- ], In = [
2249
+ ], Fn = [
2170
2250
  "x1",
2171
2251
  "y1",
2172
2252
  "x2",
2173
2253
  "y2"
2174
- ], Ln = [
2254
+ ], In = [
2175
2255
  "x1",
2176
2256
  "y1",
2177
2257
  "x2",
2178
2258
  "y2"
2179
- ], Rn = [
2259
+ ], Ln = [
2180
2260
  "x1",
2181
2261
  "y1",
2182
2262
  "x2",
2183
2263
  "y2"
2184
- ], zn = [
2264
+ ], Rn = [
2185
2265
  "x",
2186
2266
  "y",
2187
2267
  "width",
2188
2268
  "height"
2189
- ], Bn = [
2269
+ ], zn = [
2190
2270
  "x",
2191
2271
  "y",
2192
2272
  "font-size",
2193
2273
  "fill",
2194
2274
  "font-weight",
2195
2275
  "fill-opacity"
2196
- ], Vn = [
2276
+ ], Bn = [
2197
2277
  "x",
2198
2278
  "y",
2199
2279
  "font-size",
2200
2280
  "fill",
2201
2281
  "font-weight",
2202
2282
  "fill-opacity"
2203
- ], Hn = [
2283
+ ], Vn = [
2204
2284
  "transform",
2205
2285
  "font-size",
2206
2286
  "fill",
2207
2287
  "font-weight"
2208
- ], Un = [
2288
+ ], Hn = [
2209
2289
  "x",
2210
2290
  "y",
2211
2291
  "text-anchor",
@@ -2213,7 +2293,7 @@ var Bt = {
2213
2293
  "fill",
2214
2294
  "font-weight",
2215
2295
  "fill-opacity"
2216
- ], Wn = [
2296
+ ], Un = [
2217
2297
  "x",
2218
2298
  "y",
2219
2299
  "text-anchor",
@@ -2221,13 +2301,13 @@ var Bt = {
2221
2301
  "fill",
2222
2302
  "font-weight",
2223
2303
  "fill-opacity"
2224
- ], Gn = [
2304
+ ], Wn = [
2225
2305
  "x",
2226
2306
  "y",
2227
2307
  "font-size",
2228
2308
  "fill",
2229
2309
  "font-weight"
2230
- ], Kn = [
2310
+ ], Gn = [
2231
2311
  "data-category",
2232
2312
  "data-series",
2233
2313
  "x",
@@ -2236,34 +2316,35 @@ var Bt = {
2236
2316
  "height",
2237
2317
  "fill",
2238
2318
  "fill-opacity"
2239
- ], qn = [
2319
+ ], Kn = [
2240
2320
  "x",
2241
2321
  "y",
2242
2322
  "text-anchor",
2243
2323
  "font-size",
2244
2324
  "font-weight",
2245
2325
  "fill"
2246
- ], Jn = [
2326
+ ], qn = [
2247
2327
  "d",
2248
2328
  "stroke",
2249
2329
  "stroke-width",
2250
2330
  "stroke-opacity",
2251
2331
  "stroke-dasharray"
2252
- ], Yn = [
2332
+ ], Jn = [
2253
2333
  "cx",
2254
2334
  "cy",
2255
2335
  "r",
2256
2336
  "fill",
2257
2337
  "fill-opacity"
2258
- ], Xn = [
2338
+ ], Yn = [
2259
2339
  "x",
2260
2340
  "y",
2261
2341
  "width",
2262
2342
  "height"
2263
- ], Zn = { class: "bar-chart-tooltip" }, Qn = {
2343
+ ], Xn = { class: "bar-chart-tooltip" }, Zn = {
2264
2344
  key: 0,
2265
2345
  class: "bar-chart-tooltip-label"
2266
- }, $n = ["href", "download"], er = 22, tr = 2, nr = 11, rr = .6, ir = 4, ar = 4, or = /* @__PURE__ */ L(/* @__PURE__ */ l({
2346
+ }, Qn = ["href", "download"], $n = 22, er = 2, tr = 11, nr = .6, rr = 4, ir = 4, ar = /* @__PURE__ */ L(/* @__PURE__ */ l({
2347
+ inheritAttrs: !1,
2267
2348
  __name: "BarChart",
2268
2349
  props: {
2269
2350
  data: {},
@@ -2315,12 +2396,13 @@ var Bt = {
2315
2396
  filename: {},
2316
2397
  downloadLink: { type: [Boolean, String] },
2317
2398
  downloadButton: { type: [Boolean, String] },
2399
+ fullscreenTarget: {},
2318
2400
  annotations: {},
2319
2401
  chartPadding: {}
2320
2402
  },
2321
2403
  emits: ["hover"],
2322
- setup(t, { emit: c }) {
2323
- let l = t, h = c, g = [];
2404
+ setup(c, { emit: l }) {
2405
+ let f = c, h = l, g = [];
2324
2406
  function v(e) {
2325
2407
  return {
2326
2408
  data: e.y ?? e.data ?? g,
@@ -2333,31 +2415,31 @@ var Bt = {
2333
2415
  };
2334
2416
  }
2335
2417
  let S = n(() => {
2336
- if (l.series && l.series.length > 0) return l.series.map(v);
2337
- let e = l.y ?? l.data;
2418
+ if (f.series && f.series.length > 0) return f.series.map(v);
2419
+ let e = f.y ?? f.data;
2338
2420
  return e ? [{ data: e }] : [];
2339
2421
  }), w = n(() => {
2340
- let e = l.categories?.length ?? 0;
2422
+ let e = f.categories?.length ?? 0;
2341
2423
  for (let t of S.value) t.data.length > e && (e = t.data.length);
2342
2424
  return e;
2343
2425
  }), T = n(() => {
2344
2426
  let e = w.value, t = Array(e);
2345
2427
  for (let n = 0; n < e; n++) {
2346
- let e = l.categories?.[n];
2428
+ let e = f.categories?.[n];
2347
2429
  e instanceof Date ? t[n] = e.toISOString().slice(0, 10) : t[n] = e ?? String(n);
2348
2430
  }
2349
2431
  return t;
2350
2432
  }), E = n(() => {
2351
- let e = l.categories;
2352
- if (!e || e.length === 0 || !kt(e, "utc")) return null;
2433
+ let e = f.categories;
2434
+ if (!e || e.length === 0 || !Ot(e, "utc")) return null;
2353
2435
  let t = Array(e.length);
2354
- for (let n = 0; n < e.length; n++) t[n] = Dt(e[n], "utc") ?? NaN;
2436
+ for (let n = 0; n < e.length; n++) t[n] = Et(e[n], "utc") ?? NaN;
2355
2437
  return t;
2356
- }), D = n(() => l.orientation === "vertical"), O = n(() => {
2438
+ }), D = n(() => f.orientation === "vertical"), O = n(() => {
2357
2439
  let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
2358
2440
  e > 0 && e < n && (n = e);
2359
2441
  };
2360
- if (l.layout === "stacked") {
2442
+ if (f.layout === "stacked") {
2361
2443
  let n = w.value;
2362
2444
  for (let i = 0; i < n; i++) {
2363
2445
  let n = 0, a = 0;
@@ -2373,9 +2455,9 @@ var Bt = {
2373
2455
  isFinite(n) && (r(n), n < e && (e = n), n > t && (t = n));
2374
2456
  }
2375
2457
  isFinite(e) || (e = 0), isFinite(t) || (t = 0);
2376
- let i = l.valueMin ?? 0;
2377
- l.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
2378
- let a = be(e, t, l.valueScaleType, n);
2458
+ let i = f.valueMin ?? 0;
2459
+ f.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
2460
+ let a = _e(e, t, f.valueScaleType, n);
2379
2461
  return {
2380
2462
  min: a.min,
2381
2463
  max: a.max,
@@ -2384,22 +2466,22 @@ var Bt = {
2384
2466
  }), k = n(() => D.value ? U.value : W.value), ne = n(() => D.value ? W.value : U.value), A = n(() => {
2385
2467
  let e = w.value;
2386
2468
  return e > 0 ? k.value / e : 0;
2387
- }), j = n(() => A.value * (1 - l.barPadding)), re = n(() => {
2469
+ }), j = n(() => A.value * (1 - f.barPadding)), M = n(() => {
2388
2470
  let e = S.value.length;
2389
2471
  if (e === 0) return 0;
2390
- if (l.layout === "stacked" || e === 1) return j.value;
2391
- let t = l.groupGap * (e - 1);
2472
+ if (f.layout === "stacked" || e === 1) return j.value;
2473
+ let t = f.groupGap * (e - 1);
2392
2474
  return Math.max(1, (j.value - t) / e);
2393
2475
  });
2394
- function M(e) {
2476
+ function re(e) {
2395
2477
  return (D.value ? H.value.left : H.value.top) + e * A.value;
2396
2478
  }
2397
2479
  let ie = n(() => {
2398
- let { min: e, max: t } = O.value, n = l.valueMin ?? 0;
2480
+ let { min: e, max: t } = O.value, n = f.valueMin ?? 0;
2399
2481
  return N(Math.max(e, Math.min(t, n)));
2400
2482
  });
2401
2483
  function N(e) {
2402
- let { min: t, max: n } = O.value, r = ye(e, t, n, l.valueScaleType);
2484
+ let { min: t, max: n } = O.value, r = ge(e, t, n, f.valueScaleType);
2403
2485
  return D.value ? H.value.top + W.value - r * W.value : H.value.left + r * U.value;
2404
2486
  }
2405
2487
  function ae(e, t, n, r, i, a, o, s, c, l) {
@@ -2431,26 +2513,26 @@ var Bt = {
2431
2513
  let P = n(() => {
2432
2514
  let e = [], t = S.value, n = t.length;
2433
2515
  if (n === 0) return e;
2434
- let r = w.value, i = A.value, a = j.value, o = re.value, s = (i - a) / 2, c = ie.value;
2516
+ let r = w.value, i = A.value, a = j.value, o = M.value, s = (i - a) / 2, c = ie.value;
2435
2517
  for (let i = 0; i < r; i++) {
2436
- let r = M(i) + s;
2437
- if (l.layout === "stacked") {
2518
+ let r = re(i) + s;
2519
+ if (f.layout === "stacked") {
2438
2520
  let o = 0, s = 0;
2439
2521
  for (let c = 0; c < n; c++) {
2440
2522
  let n = t[c], l = Number(n.data[i] ?? NaN);
2441
2523
  if (!isFinite(l)) continue;
2442
2524
  let u = l >= 0 ? o : s, d = u + l;
2443
- e.push(ae(N(u), N(d), r, a, n.color ?? de(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
2525
+ e.push(ae(N(u), N(d), r, a, n.color ?? I(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
2444
2526
  }
2445
- } else if (l.layout === "overlay") for (let o = 0; o < n; o++) {
2527
+ } else if (f.layout === "overlay") for (let o = 0; o < n; o++) {
2446
2528
  let n = t[o], s = Number(n.data[i] ?? NaN);
2447
- isFinite(s) && e.push(ae(c, N(s), r, a, n.color ?? de(o), n.opacity ?? 1, n.blendMode, s, i, o));
2529
+ isFinite(s) && e.push(ae(c, N(s), r, a, n.color ?? I(o), n.opacity ?? 1, n.blendMode, s, i, o));
2448
2530
  }
2449
2531
  else for (let a = 0; a < n; a++) {
2450
- let s = t[a], u = Number(s.data[i] ?? NaN);
2451
- if (!isFinite(u)) continue;
2452
- let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
2453
- e.push(ae(c, N(u), d, o, s.color ?? de(a), s.opacity ?? 1, s.blendMode, u, i, a));
2532
+ let s = t[a], l = Number(s.data[i] ?? NaN);
2533
+ if (!isFinite(l)) continue;
2534
+ let u = r + (n === 1 ? 0 : a * (o + f.groupGap));
2535
+ e.push(ae(c, N(l), u, o, s.color ?? I(a), s.opacity ?? 1, s.blendMode, l, i, a));
2454
2536
  }
2455
2537
  }
2456
2538
  return e;
@@ -2477,7 +2559,7 @@ var Bt = {
2477
2559
  };
2478
2560
  }
2479
2561
  let ce = n(() => {
2480
- let e = l.summaryLines;
2562
+ let e = f.summaryLines;
2481
2563
  return !e || e.length === 0 ? [] : e.map((e, t) => ({
2482
2564
  data: e.data ?? g,
2483
2565
  x: e.x,
@@ -2517,7 +2599,7 @@ var Bt = {
2517
2599
  function ue(e) {
2518
2600
  return le[e % le.length];
2519
2601
  }
2520
- let I = [
2602
+ let de = [
2521
2603
  "var(--color-primary, #3b82f6)",
2522
2604
  "var(--color-accent, #f59e0b)",
2523
2605
  "var(--color-success, #10b981)",
@@ -2525,36 +2607,36 @@ var Bt = {
2525
2607
  "var(--color-info, #6366f1)",
2526
2608
  "var(--color-warning, #d97706)"
2527
2609
  ];
2528
- function de(e) {
2529
- return I[e % I.length];
2610
+ function I(e) {
2611
+ return de[e % de.length];
2530
2612
  }
2531
- let fe = dt(() => l.tooltipValueFormat, () => l.valueTickFormat), L = n(() => {
2532
- let { min: e, max: t } = O.value, n = (e) => l.valueTickFormat === void 0 ? _e(e) : te(e, l.valueTickFormat);
2613
+ let L = ct(() => f.tooltipValueFormat, () => f.valueTickFormat), z = n(() => {
2614
+ let { min: e, max: t } = O.value, n = (e) => f.valueTickFormat === void 0 ? me(e) : te(e, f.valueTickFormat);
2533
2615
  if (e === t) return [{
2534
2616
  value: n(e),
2535
2617
  pos: R(N(e))
2536
2618
  }];
2537
2619
  let r = D.value ? 50 : 80;
2538
- return (l.valueScaleType === "log" ? z({
2620
+ return (f.valueScaleType === "log" ? ve({
2539
2621
  min: e,
2540
2622
  max: t,
2541
- ticks: l.valueTicks
2542
- }) : ve({
2623
+ ticks: f.valueTicks
2624
+ }) : he({
2543
2625
  min: e,
2544
2626
  max: t,
2545
- ticks: l.valueTicks,
2627
+ ticks: f.valueTicks,
2546
2628
  targetTickCount: ne.value / r
2547
2629
  })).map((e) => ({
2548
2630
  value: n(e),
2549
2631
  pos: R(N(e))
2550
2632
  }));
2551
- }), me = n(() => {
2633
+ }), B = n(() => {
2552
2634
  let e = w.value, t = E.value;
2553
2635
  if (t && t.length > 0) {
2554
2636
  let e = Infinity, n = -Infinity;
2555
2637
  for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
2556
2638
  if (!Number.isFinite(e) || e === n) return [];
2557
- let r = D.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a = Nt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
2639
+ let r = D.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a = Mt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
2558
2640
  for (let e of a.values) {
2559
2641
  let n = -1, r = Infinity;
2560
2642
  for (let i = 0; i < t.length; i++) {
@@ -2563,7 +2645,7 @@ var Bt = {
2563
2645
  }
2564
2646
  if (n < 0 || c.has(n)) continue;
2565
2647
  c.add(n);
2566
- let i = M(n) + A.value / 2, a = l.categoryFormat ? l.categoryFormat(T.value[n], n) : zt(t[n], l.dateFormat, "utc", o);
2648
+ let i = re(n) + A.value / 2, a = f.categoryFormat ? f.categoryFormat(T.value[n], n) : Rt(t[n], f.dateFormat, "utc", o);
2567
2649
  s.push({
2568
2650
  label: a,
2569
2651
  pos: i,
@@ -2572,11 +2654,11 @@ var Bt = {
2572
2654
  }
2573
2655
  return s;
2574
2656
  }
2575
- let n = [], r = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e, i = Array(e), a = 0;
2657
+ let n = [], r = (e, t) => f.categoryFormat ? f.categoryFormat(e, t) : e, i = Array(e), a = 0;
2576
2658
  for (let t = 0; t < e; t++) i[t] = r(T.value[t], t), i[t].length > a && (a = i[t].length);
2577
- let o = l.tickLabelStyle?.fontSize ?? 10, s = D.value ? a * o * .6 + 8 : o * 1.2 + 8, c = A.value > 0 ? Math.max(1, Math.ceil(s / A.value)) : 1;
2659
+ let o = f.tickLabelStyle?.fontSize ?? 10, s = D.value ? a * o * .6 + 8 : o * 1.2 + 8, c = A.value > 0 ? Math.max(1, Math.ceil(s / A.value)) : 1;
2578
2660
  for (let t = 0; t < e; t += c) {
2579
- let e = M(t) + A.value / 2;
2661
+ let e = re(t) + A.value / 2;
2580
2662
  n.push({
2581
2663
  label: i[t],
2582
2664
  pos: e,
@@ -2584,12 +2666,12 @@ var Bt = {
2584
2666
  });
2585
2667
  }
2586
2668
  return n;
2587
- }), he = n(() => {
2669
+ }), pe = n(() => {
2588
2670
  let e = [];
2589
2671
  return S.value.forEach((t, n) => {
2590
2672
  !t.legend || t.showInLegend === !1 || e.push({
2591
2673
  label: t.legend,
2592
- color: t.color ?? de(n),
2674
+ color: t.color ?? I(n),
2593
2675
  kind: "bar"
2594
2676
  });
2595
2677
  }), ce.value.forEach((t) => {
@@ -2600,17 +2682,17 @@ var Bt = {
2600
2682
  dashed: t.dashed
2601
2683
  });
2602
2684
  }), e;
2603
- }), ge = n(() => he.value.map((e) => e.label));
2604
- function xe() {
2605
- if (typeof l.csv == "function") return l.csv();
2606
- if (typeof l.csv == "string") return l.csv;
2685
+ }), ye = n(() => pe.value.map((e) => e.label));
2686
+ function be() {
2687
+ if (typeof f.csv == "function") return f.csv();
2688
+ if (typeof f.csv == "string") return f.csv;
2607
2689
  let e = S.value.map((e) => ({
2608
2690
  label: e.legend,
2609
2691
  data: e.data
2610
2692
  }));
2611
- return Ue(T.value, e);
2693
+ return Ve(T.value, e);
2612
2694
  }
2613
- let B = n(() => !!l.tooltipData || !!l.tooltipTrigger);
2695
+ let Se = n(() => !!f.tooltipData || !!f.tooltipTrigger);
2614
2696
  function Ce(e, t) {
2615
2697
  if (!isFinite(e) || !isFinite(t) || A.value === 0) return null;
2616
2698
  let n = (D.value ? H.value.left : H.value.top) + (e + .5) * A.value, r = N(t);
@@ -2630,8 +2712,8 @@ var Bt = {
2630
2712
  let i = D.value ? e - n.left - H.value.left : t - n.top - H.value.top;
2631
2713
  return Math.max(0, Math.min(r - 1, Math.floor(i / A.value)));
2632
2714
  }
2633
- let Te = n(() => !!(l.categoryHeader || l.valueHeader)), Ee = n(() => {
2634
- let e = Te.value ? er : 0, t = l.chartPadding;
2715
+ let Te = n(() => !!(f.categoryHeader || f.valueHeader)), Ee = n(() => {
2716
+ let e = Te.value ? $n : 0, t = f.chartPadding;
2635
2717
  return e ? t == null ? { top: e } : typeof t == "number" ? {
2636
2718
  top: t + e,
2637
2719
  right: t,
@@ -2641,33 +2723,35 @@ var Bt = {
2641
2723
  ...t,
2642
2724
  top: (t.top ?? 0) + e
2643
2725
  } : t;
2644
- }), { containerRef: De, svgRef: Oe, width: ke, height: Ae, padding: H, legendY: je, inlineLegendLayout: Me, innerW: U, innerH: W, bounds: Ne, hoverIndex: G, tooltipRef: K, tooltipPos: Pe, tooltipHandlers: Fe, menuItems: Ie, downloadLinkText: Le, csvHref: Re, downloadButtonText: ze, triggerCsvDownload: Be, menuFilename: Ve, isFullscreen: He } = ut({
2645
- width: () => l.width,
2646
- height: () => l.height,
2647
- title: () => l.title,
2648
- titleStyle: () => l.titleStyle,
2649
- xLabel: () => l.xLabel,
2650
- yLabel: () => l.yLabel,
2651
- debounce: () => l.debounce,
2652
- menu: () => l.menu,
2653
- tooltipTrigger: () => l.tooltipTrigger,
2654
- tooltipClamp: () => l.tooltipClamp,
2655
- filename: () => l.filename,
2656
- downloadLink: () => l.downloadLink,
2657
- downloadButton: () => l.downloadButton,
2726
+ }), { containerRef: De, svgRef: Oe, width: ke, height: Ae, padding: H, legendY: je, inlineLegendLayout: Me, innerW: U, innerH: W, bounds: Ne, hoverIndex: G, tooltipRef: K, tooltipPos: Pe, tooltipHandlers: q, menuItems: Fe, downloadLinkText: Ie, csvHref: Le, downloadButtonText: Re, triggerCsvDownload: ze, menuFilename: Be, isFullscreen: He, fullscreenStyle: Ue, teleportTarget: We, exitFullscreen: Ge } = st({
2727
+ width: () => f.width,
2728
+ height: () => f.height,
2729
+ title: () => f.title,
2730
+ titleStyle: () => f.titleStyle,
2731
+ xLabel: () => f.xLabel,
2732
+ yLabel: () => f.yLabel,
2733
+ debounce: () => f.debounce,
2734
+ menu: () => f.menu,
2735
+ tooltipTrigger: () => f.tooltipTrigger,
2736
+ tooltipClamp: () => f.tooltipClamp,
2737
+ filename: () => f.filename,
2738
+ downloadLink: () => f.downloadLink,
2739
+ downloadButton: () => f.downloadButton,
2740
+ fullscreenTarget: () => f.fullscreenTarget,
2658
2741
  chartPadding: () => Ee.value,
2659
- inlineLegendLabels: () => ge.value,
2660
- hasTooltipSlot: () => B.value,
2661
- getCsv: xe,
2742
+ inlineLegendLabels: () => ye.value,
2743
+ hasTooltipSlot: () => Se.value,
2744
+ getCsv: be,
2662
2745
  pointerToIndex: we,
2746
+ scrubAxis: () => D.value ? "x" : "y",
2663
2747
  onHover: (e) => h("hover", e)
2664
- }), q = n(() => V(l.axisLabelStyle, { fontSize: 13 })), J = n(() => V(l.tickLabelStyle, {
2748
+ }), Ke = n(() => xe(f.axisLabelStyle, { fontSize: 13 })), J = n(() => xe(f.tickLabelStyle, {
2665
2749
  fontSize: 10,
2666
- fillOpacity: Se
2667
- })), We = n(() => V(l.legendStyle, { fontSize: 11 })), Ge = n(() => l.categoryAlign === "start" && !D.value ? tr : H.value.left), Y = n(() => {
2668
- let e = l.titleStyle, t = e?.align ?? "left", n = Ne.value, r = t === "left" ? Ge.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
2750
+ fillOpacity: V
2751
+ })), qe = n(() => xe(f.legendStyle, { fontSize: 11 })), Y = n(() => f.categoryAlign === "start" && !D.value ? er : H.value.left), X = n(() => {
2752
+ let e = f.titleStyle, t = e?.align ?? "left", n = Ne.value, r = t === "left" ? Y.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
2669
2753
  return {
2670
- lines: (l.title ?? "").split("\n"),
2754
+ lines: (f.title ?? "").split("\n"),
2671
2755
  fontSize: e?.fontSize ?? 14,
2672
2756
  lineHeight: e?.lineHeight ?? 18,
2673
2757
  fontWeight: e?.fontWeight ?? 600,
@@ -2675,12 +2759,12 @@ var Bt = {
2675
2759
  x: r,
2676
2760
  anchor: i
2677
2761
  };
2678
- }), Ke = n(() => {
2762
+ }), Je = n(() => {
2679
2763
  let e = G.value;
2680
2764
  if (e === null) return;
2681
2765
  let t = E.value;
2682
- return t && Number.isFinite(t[e]) ? zt(t[e], l.dateFormat, "utc") : T.value[e];
2683
- }), X = n(() => {
2766
+ return t && Number.isFinite(t[e]) ? Rt(t[e], f.dateFormat, "utc") : T.value[e];
2767
+ }), Z = n(() => {
2684
2768
  let e = G.value;
2685
2769
  if (e === null) return null;
2686
2770
  let t = S.value, n = [];
@@ -2688,7 +2772,7 @@ var Bt = {
2688
2772
  let i = t[r];
2689
2773
  i.showInTooltip !== !1 && n.push({
2690
2774
  value: Number(i.data[e] ?? NaN),
2691
- color: i.color ?? de(r),
2775
+ color: i.color ?? I(r),
2692
2776
  seriesIndex: r
2693
2777
  });
2694
2778
  }
@@ -2696,12 +2780,12 @@ var Bt = {
2696
2780
  index: e,
2697
2781
  category: T.value[e] ?? String(e),
2698
2782
  values: n,
2699
- data: l.tooltipData?.[e] ?? null
2783
+ data: f.tooltipData?.[e] ?? null
2700
2784
  };
2701
- }), qe = n(() => {
2785
+ }), Q = n(() => {
2702
2786
  let e = G.value;
2703
2787
  if (e === null) return null;
2704
- let t = M(e);
2788
+ let t = re(e);
2705
2789
  return D.value ? {
2706
2790
  x: t,
2707
2791
  y: H.value.top,
@@ -2713,9 +2797,9 @@ var Bt = {
2713
2797
  w: U.value,
2714
2798
  h: A.value
2715
2799
  };
2716
- }), Je = n(() => {
2717
- let e = Me.value.positions, t = Ge.value, n = je.value;
2718
- return he.value.map((r, i) => {
2800
+ }), Ye = n(() => {
2801
+ let e = Me.value.positions, t = Y.value, n = je.value;
2802
+ return pe.value.map((r, i) => {
2719
2803
  let a = e[i];
2720
2804
  return {
2721
2805
  ...r,
@@ -2723,8 +2807,8 @@ var Bt = {
2723
2807
  y: n + a.row * 20
2724
2808
  };
2725
2809
  });
2726
- }), Ye = n(() => {
2727
- let e = l.barLabels;
2810
+ }), Xe = n(() => {
2811
+ let e = f.barLabels;
2728
2812
  if (!e) return null;
2729
2813
  let t = e === !0 ? {} : e;
2730
2814
  return {
@@ -2734,37 +2818,37 @@ var Bt = {
2734
2818
  align: t.align ?? "center",
2735
2819
  overlap: t.overlap ?? "shift",
2736
2820
  minSize: t.minSize ?? 0,
2737
- fontSize: t.fontSize ?? nr,
2821
+ fontSize: t.fontSize ?? tr,
2738
2822
  fontWeight: t.fontWeight
2739
2823
  };
2740
2824
  });
2741
- function Xe(e, t) {
2742
- let n = Ye.value?.format;
2743
- return typeof n == "function" ? n(e, t) : n === void 0 ? l.valueTickFormat === void 0 ? _e(e) : te(e, l.valueTickFormat) : te(e, n);
2825
+ function Ze(e, t) {
2826
+ let n = Xe.value?.format;
2827
+ return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ? me(e) : te(e, f.valueTickFormat) : te(e, n);
2744
2828
  }
2745
- function Ze(e, t, n) {
2829
+ function Qe(e, t, n) {
2746
2830
  for (let r = P.value.length - 1; r >= 0; r--) {
2747
2831
  let i = P.value[r];
2748
2832
  if (i.categoryIndex === e && t >= i.x && t <= i.x + i.w && n >= i.y && n <= i.y + i.h) return i.color;
2749
2833
  }
2750
2834
  return null;
2751
2835
  }
2752
- let Qe = n(() => {
2753
- let e = Ye.value;
2836
+ let $e = n(() => {
2837
+ let e = Xe.value;
2754
2838
  if (!e) return [];
2755
2839
  let t = D.value, n = e.fontSize, r = [];
2756
2840
  for (let i of P.value) {
2757
- let a = Xe(i.value, {
2841
+ let a = Ze(i.value, {
2758
2842
  value: i.value,
2759
2843
  categoryIndex: i.categoryIndex,
2760
2844
  seriesIndex: i.seriesIndex,
2761
2845
  category: T.value[i.categoryIndex] ?? String(i.categoryIndex)
2762
2846
  });
2763
2847
  if (!a) continue;
2764
- let o = t ? i.h : i.w, s = a.length * n * rr, c = o >= s + 2 * ir && o >= e.minSize, l = e.placement === "inside" ? !0 : e.placement === "outside" ? !1 : c, u, d, f, p = "middle", m = t ? -i.y : i.x + i.w, h = t ? -(i.y + i.h) : i.x, g = t ? n : s;
2765
- if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m + ir, d = u + g, p = "start";
2766
- else if (e.align === "start") u = h + ir, d = u + g, p = "start";
2767
- else if (e.align === "end") d = m - ir, u = d - g, p = "end";
2848
+ let o = t ? i.h : i.w, s = a.length * n * nr, c = o >= s + 2 * rr && o >= e.minSize, l = e.placement === "inside" ? !0 : e.placement === "outside" ? !1 : c, u, d, f, p = "middle", m = t ? -i.y : i.x + i.w, h = t ? -(i.y + i.h) : i.x, g = t ? n : s;
2849
+ if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m + rr, d = u + g, p = "start";
2850
+ else if (e.align === "start") u = h + rr, d = u + g, p = "start";
2851
+ else if (e.align === "end") d = m - rr, u = d - g, p = "end";
2768
2852
  else {
2769
2853
  let e = (m + h) / 2;
2770
2854
  u = e - g / 2, d = e + g / 2, p = "middle";
@@ -2790,12 +2874,12 @@ var Bt = {
2790
2874
  t.sort((e, t) => e.lo - t.lo);
2791
2875
  let n = -Infinity;
2792
2876
  for (let r of t) {
2793
- if (r.lo < n + ar) {
2877
+ if (r.lo < n + ir) {
2794
2878
  if (e.overlap === "hide") {
2795
2879
  r.hidden = !0;
2796
2880
  continue;
2797
2881
  }
2798
- let t = n + ar - r.lo;
2882
+ let t = n + ir - r.lo;
2799
2883
  r.lo += t, r.hi += t, r.inside = !1, r.svgAnchor = "start";
2800
2884
  }
2801
2885
  if (r.hi > i) {
@@ -2812,10 +2896,10 @@ var Bt = {
2812
2896
  t ? (r = i.cross, a = -((i.lo + i.hi) / 2), c = "middle") : (c = i.svgAnchor, r = c === "start" ? i.lo : c === "end" ? i.hi : (i.lo + i.hi) / 2, a = i.cross);
2813
2897
  let l;
2814
2898
  if (!o) l = e.color;
2815
- else if (i.inside) l = _t(i.bar.color);
2899
+ else if (i.inside) l = mt(i.bar.color);
2816
2900
  else {
2817
- let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r = Ze(i.bar.categoryIndex, e, n);
2818
- l = r ? _t(r) : "currentColor";
2901
+ let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r = Qe(i.bar.categoryIndex, e, n);
2902
+ l = r ? mt(r) : "currentColor";
2819
2903
  }
2820
2904
  s.push({
2821
2905
  key: `${i.bar.categoryIndex}-${i.bar.seriesIndex}`,
@@ -2829,35 +2913,35 @@ var Bt = {
2829
2913
  });
2830
2914
  }
2831
2915
  return s;
2832
- }), $e = n(() => {
2916
+ }), et = n(() => {
2833
2917
  let e = H.value.left - 6;
2834
- switch (l.categoryAlign ?? "end") {
2918
+ switch (f.categoryAlign ?? "end") {
2835
2919
  case "start": return {
2836
2920
  anchor: "start",
2837
- x: tr
2921
+ x: er
2838
2922
  };
2839
2923
  case "center": return {
2840
2924
  anchor: "middle",
2841
- x: (tr + e) / 2
2925
+ x: (er + e) / 2
2842
2926
  };
2843
2927
  default: return {
2844
2928
  anchor: "end",
2845
2929
  x: e
2846
2930
  };
2847
2931
  }
2848
- }), et = n(() => {
2932
+ }), tt = n(() => {
2849
2933
  let e = [], t = H.value.top - 7;
2850
- if (l.valueHeader && e.push({
2934
+ if (f.valueHeader && e.push({
2851
2935
  key: "vh",
2852
- text: l.valueHeader,
2936
+ text: f.valueHeader,
2853
2937
  x: H.value.left,
2854
2938
  y: t,
2855
2939
  anchor: "start"
2856
- }), l.categoryHeader) {
2857
- let n = !D.value, r = $e.value;
2940
+ }), f.categoryHeader) {
2941
+ let n = !D.value, r = et.value;
2858
2942
  e.push({
2859
2943
  key: "ch",
2860
- text: l.categoryHeader,
2944
+ text: f.categoryHeader,
2861
2945
  x: n ? r.x : H.value.left,
2862
2946
  y: t,
2863
2947
  anchor: n ? r.anchor : "start"
@@ -2865,53 +2949,64 @@ var Bt = {
2865
2949
  }
2866
2950
  return e;
2867
2951
  });
2868
- return (n, c) => (_(), a("div", {
2952
+ return (n, l) => (_(), r(t, {
2953
+ to: C(We),
2954
+ disabled: !C(He)
2955
+ }, [o("div", d({
2869
2956
  ref_key: "containerRef",
2870
- ref: De,
2871
- class: f(["bar-chart-wrapper", { "is-fullscreen": C(He) }])
2872
- }, [
2873
- t.menu ? (_(), r(pe, {
2957
+ ref: De
2958
+ }, n.$attrs, {
2959
+ class: ["bar-chart-wrapper", { "is-fullscreen": C(He) }],
2960
+ style: C(Ue)
2961
+ }), [
2962
+ c.menu ? (_(), r(fe, {
2874
2963
  key: 0,
2875
- items: C(Ie)
2876
- }, null, 8, ["items"])) : i("", !0),
2877
- o("div", Dn, x(C(He) ? "Chart expanded to fill window" : ""), 1),
2964
+ items: C(Fe),
2965
+ "is-fullscreen": C(He),
2966
+ onClose: C(Ge)
2967
+ }, null, 8, [
2968
+ "items",
2969
+ "is-fullscreen",
2970
+ "onClose"
2971
+ ])) : i("", !0),
2972
+ o("div", En, x(C(He) ? "Chart expanded to fill window" : ""), 1),
2878
2973
  (_(), a("svg", {
2879
2974
  ref_key: "svgRef",
2880
2975
  ref: Oe,
2881
2976
  width: C(ke),
2882
2977
  height: C(Ae)
2883
2978
  }, [
2884
- t.title ? (_(), a("text", {
2979
+ c.title ? (_(), a("text", {
2885
2980
  key: 0,
2886
- x: Y.value.x,
2887
- y: Y.value.lineHeight,
2888
- "text-anchor": Y.value.anchor,
2889
- "font-size": Y.value.fontSize,
2890
- "font-weight": Y.value.fontWeight,
2891
- fill: Y.value.color
2892
- }, [(_(!0), a(e, null, y(Y.value.lines, (e, t) => (_(), a("tspan", {
2981
+ x: X.value.x,
2982
+ y: X.value.lineHeight,
2983
+ "text-anchor": X.value.anchor,
2984
+ "font-size": X.value.fontSize,
2985
+ "font-weight": X.value.fontWeight,
2986
+ fill: X.value.color
2987
+ }, [(_(!0), a(e, null, y(X.value.lines, (e, t) => (_(), a("tspan", {
2893
2988
  key: t,
2894
- x: Y.value.x,
2895
- dy: t === 0 ? 0 : Y.value.lineHeight
2896
- }, x(e), 9, An))), 128))], 8, kn)) : i("", !0),
2897
- (_(!0), a(e, null, y(et.value, (e) => (_(), a("text", {
2989
+ x: X.value.x,
2990
+ dy: t === 0 ? 0 : X.value.lineHeight
2991
+ }, x(e), 9, kn))), 128))], 8, On)) : i("", !0),
2992
+ (_(!0), a(e, null, y(tt.value, (e) => (_(), a("text", {
2898
2993
  key: e.key,
2899
2994
  "data-testid": e.key === "ch" ? "category-header" : "value-header",
2900
2995
  x: e.x,
2901
2996
  y: e.y,
2902
2997
  "text-anchor": e.anchor,
2903
- "font-size": q.value.fontSize,
2904
- fill: q.value.fill,
2998
+ "font-size": Ke.value.fontSize,
2999
+ fill: Ke.value.fill,
2905
3000
  "font-weight": "600"
2906
- }, x(e.text), 9, jn))), 128)),
2907
- Je.value.length > 0 ? (_(), a("g", Mn, [(_(!0), a(e, null, y(Je.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
3001
+ }, x(e.text), 9, An))), 128)),
3002
+ Ye.value.length > 0 ? (_(), a("g", jn, [(_(!0), a(e, null, y(Ye.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
2908
3003
  key: 0,
2909
3004
  x: t.x,
2910
3005
  y: t.y - 5,
2911
3006
  width: "12",
2912
3007
  height: "10",
2913
3008
  fill: t.color
2914
- }, null, 8, Nn)) : (_(), a("line", {
3009
+ }, null, 8, Mn)) : (_(), a("line", {
2915
3010
  key: 1,
2916
3011
  x1: t.x,
2917
3012
  y1: t.y,
@@ -2920,14 +3015,14 @@ var Bt = {
2920
3015
  stroke: t.color,
2921
3016
  "stroke-width": "2",
2922
3017
  "stroke-dasharray": t.dashed ? "4 2" : void 0
2923
- }, null, 8, Pn)), o("text", {
3018
+ }, null, 8, Nn)), o("text", {
2924
3019
  x: t.x + 18,
2925
3020
  y: t.y + 4,
2926
- "font-size": We.value.fontSize,
2927
- fill: We.value.fill,
2928
- "font-weight": We.value.fontWeight
2929
- }, x(t.label), 9, Fn)], 64))), 128))])) : i("", !0),
2930
- !D.value || t.valueAxis ? (_(), a("line", {
3021
+ "font-size": qe.value.fontSize,
3022
+ fill: qe.value.fill,
3023
+ "font-weight": qe.value.fontWeight
3024
+ }, x(t.label), 9, Pn)], 64))), 128))])) : i("", !0),
3025
+ !D.value || c.valueAxis ? (_(), a("line", {
2931
3026
  key: 2,
2932
3027
  x1: C(R)(C(H).left),
2933
3028
  y1: C(R)(C(H).top),
@@ -2935,8 +3030,8 @@ var Bt = {
2935
3030
  y2: C(R)(C(H).top + C(W)),
2936
3031
  stroke: "currentColor",
2937
3032
  "stroke-opacity": "0.3"
2938
- }, null, 8, In)) : i("", !0),
2939
- D.value || t.valueAxis ? (_(), a("line", {
3033
+ }, null, 8, Fn)) : i("", !0),
3034
+ D.value || c.valueAxis ? (_(), a("line", {
2940
3035
  key: 3,
2941
3036
  x1: C(R)(C(H).left),
2942
3037
  y1: C(R)(C(H).top + C(W)),
@@ -2944,8 +3039,8 @@ var Bt = {
2944
3039
  y2: C(R)(C(H).top + C(W)),
2945
3040
  stroke: "currentColor",
2946
3041
  "stroke-opacity": "0.3"
2947
- }, null, 8, Ln)) : i("", !0),
2948
- t.valueGrid && t.valueAxis ? (_(!0), a(e, { key: 4 }, y(L.value, (e, t) => (_(), a("line", {
3042
+ }, null, 8, In)) : i("", !0),
3043
+ c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(z.value, (e, t) => (_(), a("line", {
2949
3044
  key: "vg" + t,
2950
3045
  x1: D.value ? C(H).left : e.pos,
2951
3046
  y1: D.value ? e.pos : C(H).top,
@@ -2953,18 +3048,18 @@ var Bt = {
2953
3048
  y2: D.value ? e.pos : C(H).top + C(W),
2954
3049
  stroke: "currentColor",
2955
3050
  "stroke-opacity": "0.1"
2956
- }, null, 8, Rn))), 128)) : i("", !0),
2957
- qe.value && B.value ? (_(), a("rect", {
3051
+ }, null, 8, Ln))), 128)) : i("", !0),
3052
+ Q.value && Se.value ? (_(), a("rect", {
2958
3053
  key: 5,
2959
- x: qe.value.x,
2960
- y: qe.value.y,
2961
- width: qe.value.w,
2962
- height: qe.value.h,
3054
+ x: Q.value.x,
3055
+ y: Q.value.y,
3056
+ width: Q.value.w,
3057
+ height: Q.value.h,
2963
3058
  fill: "currentColor",
2964
3059
  "fill-opacity": "0.06",
2965
3060
  "pointer-events": "none"
2966
- }, null, 8, zn)) : i("", !0),
2967
- t.valueAxis && D.value ? (_(!0), a(e, { key: 6 }, y(L.value, (e, t) => (_(), a("text", {
3061
+ }, null, 8, Rn)) : i("", !0),
3062
+ c.valueAxis && D.value ? (_(!0), a(e, { key: 6 }, y(z.value, (e, t) => (_(), a("text", {
2968
3063
  key: "vt" + t,
2969
3064
  "data-testid": "value-tick",
2970
3065
  x: C(H).left - 6,
@@ -2975,7 +3070,7 @@ var Bt = {
2975
3070
  fill: J.value.fill,
2976
3071
  "font-weight": J.value.fontWeight,
2977
3072
  "fill-opacity": J.value.fillOpacity
2978
- }, x(e.value), 9, Bn))), 128)) : t.valueAxis ? (_(!0), a(e, { key: 7 }, y(L.value, (e, t) => (_(), a("text", {
3073
+ }, x(e.value), 9, zn))), 128)) : c.valueAxis ? (_(!0), a(e, { key: 7 }, y(z.value, (e, t) => (_(), a("text", {
2979
3074
  key: "vt" + t,
2980
3075
  "data-testid": "value-tick",
2981
3076
  x: e.pos,
@@ -2985,18 +3080,18 @@ var Bt = {
2985
3080
  fill: J.value.fill,
2986
3081
  "font-weight": J.value.fontWeight,
2987
3082
  "fill-opacity": J.value.fillOpacity
2988
- }, x(e.value), 9, Vn))), 128)) : i("", !0),
2989
- t.yLabel ? (_(), a("text", {
3083
+ }, x(e.value), 9, Bn))), 128)) : i("", !0),
3084
+ c.yLabel ? (_(), a("text", {
2990
3085
  key: 8,
2991
3086
  x: 0,
2992
3087
  y: 0,
2993
3088
  transform: `translate(14, ${C(H).top + C(W) / 2}) rotate(-90)`,
2994
3089
  "text-anchor": "middle",
2995
- "font-size": q.value.fontSize,
2996
- fill: q.value.fill,
2997
- "font-weight": q.value.fontWeight
2998
- }, x(t.yLabel), 9, Hn)) : i("", !0),
2999
- D.value ? (_(!0), a(e, { key: 9 }, y(me.value, (e, t) => (_(), a("text", {
3090
+ "font-size": Ke.value.fontSize,
3091
+ fill: Ke.value.fill,
3092
+ "font-weight": Ke.value.fontWeight
3093
+ }, x(c.yLabel), 9, Vn)) : i("", !0),
3094
+ D.value ? (_(!0), a(e, { key: 9 }, y(B.value, (e, t) => (_(), a("text", {
3000
3095
  key: "ct" + t,
3001
3096
  "data-testid": "category-tick",
3002
3097
  x: e.pos,
@@ -3006,27 +3101,27 @@ var Bt = {
3006
3101
  fill: J.value.fill,
3007
3102
  "font-weight": J.value.fontWeight,
3008
3103
  "fill-opacity": J.value.fillOpacity
3009
- }, x(e.label), 9, Un))), 128)) : (_(!0), a(e, { key: 10 }, y(me.value, (e, t) => (_(), a("text", {
3104
+ }, x(e.label), 9, Hn))), 128)) : (_(!0), a(e, { key: 10 }, y(B.value, (e, t) => (_(), a("text", {
3010
3105
  key: "ct" + t,
3011
3106
  "data-testid": "category-tick",
3012
- x: $e.value.x,
3107
+ x: et.value.x,
3013
3108
  y: e.pos,
3014
- "text-anchor": $e.value.anchor,
3109
+ "text-anchor": et.value.anchor,
3015
3110
  "dominant-baseline": "middle",
3016
3111
  "font-size": J.value.fontSize,
3017
3112
  fill: J.value.fill,
3018
3113
  "font-weight": J.value.fontWeight,
3019
3114
  "fill-opacity": J.value.fillOpacity
3020
- }, x(e.label), 9, Wn))), 128)),
3021
- t.xLabel ? (_(), a("text", {
3115
+ }, x(e.label), 9, Un))), 128)),
3116
+ c.xLabel ? (_(), a("text", {
3022
3117
  key: 11,
3023
3118
  x: C(H).left + C(U) / 2,
3024
3119
  y: C(Ae) - 4,
3025
3120
  "text-anchor": "middle",
3026
- "font-size": q.value.fontSize,
3027
- fill: q.value.fill,
3028
- "font-weight": q.value.fontWeight
3029
- }, x(t.xLabel), 9, Gn)) : i("", !0),
3121
+ "font-size": Ke.value.fontSize,
3122
+ fill: Ke.value.fill,
3123
+ "font-weight": Ke.value.fontWeight
3124
+ }, x(c.xLabel), 9, Wn)) : i("", !0),
3030
3125
  (_(!0), a(e, null, y(P.value, (e, t) => (_(), a("rect", {
3031
3126
  key: "bar" + t,
3032
3127
  "data-testid": "bar",
@@ -3039,8 +3134,8 @@ var Bt = {
3039
3134
  fill: e.color,
3040
3135
  "fill-opacity": e.opacity,
3041
3136
  style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
3042
- }, null, 12, Kn))), 128)),
3043
- (_(!0), a(e, null, y(Qe.value, (e) => (_(), a("text", {
3137
+ }, null, 12, Gn))), 128)),
3138
+ (_(!0), a(e, null, y($e.value, (e) => (_(), a("text", {
3044
3139
  key: "blbl" + e.key,
3045
3140
  "data-testid": "bar-label",
3046
3141
  x: e.x,
@@ -3051,7 +3146,7 @@ var Bt = {
3051
3146
  "font-weight": e.fontWeight,
3052
3147
  fill: e.fill,
3053
3148
  "pointer-events": "none"
3054
- }, x(e.text), 9, qn))), 128)),
3149
+ }, x(e.text), 9, Kn))), 128)),
3055
3150
  (_(!0), a(e, null, y(F.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
3056
3151
  key: 0,
3057
3152
  "data-testid": "summary-line",
@@ -3064,7 +3159,7 @@ var Bt = {
3064
3159
  "stroke-linecap": "round",
3065
3160
  "stroke-linejoin": "round",
3066
3161
  style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
3067
- }, null, 12, Jn)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
3162
+ }, null, 12, qn)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
3068
3163
  key: "sld" + n + "-" + r,
3069
3164
  cx: e.x,
3070
3165
  cy: e.y,
@@ -3072,27 +3167,24 @@ var Bt = {
3072
3167
  fill: t.color,
3073
3168
  "fill-opacity": t.opacity,
3074
3169
  style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
3075
- }, null, 12, Yn))), 128)) : i("", !0)], 64))), 128)),
3076
- B.value ? (_(), a("rect", d({
3170
+ }, null, 12, Jn))), 128)) : i("", !0)], 64))), 128)),
3171
+ Se.value ? (_(), a("rect", d({
3077
3172
  key: 12,
3078
3173
  x: C(H).left,
3079
3174
  y: C(H).top,
3080
3175
  width: C(U),
3081
3176
  height: C(W),
3082
3177
  fill: "transparent",
3083
- style: {
3084
- cursor: "crosshair",
3085
- "touch-action": "none"
3086
- }
3087
- }, ee(C(Fe), !0)), null, 16, Xn)) : i("", !0),
3088
- t.annotations && t.annotations.length > 0 ? (_(), r(C(st), {
3178
+ style: `cursor: crosshair; touch-action: ${D.value ? "pan-y" : "pan-x"}`
3179
+ }, ee(C(q), !0)), null, 16, Yn)) : i("", !0),
3180
+ c.annotations && c.annotations.length > 0 ? (_(), r(C(it), {
3089
3181
  key: 13,
3090
- annotations: t.annotations,
3182
+ annotations: c.annotations,
3091
3183
  project: Ce,
3092
3184
  bounds: C(Ne)
3093
3185
  }, null, 8, ["annotations", "bounds"])) : i("", !0)
3094
- ], 8, On)),
3095
- B.value && C(G) !== null && X.value ? (_(), a("div", {
3186
+ ], 8, Dn)),
3187
+ Se.value && C(G) !== null && Z.value ? (_(), a("div", {
3096
3188
  key: 1,
3097
3189
  ref_key: "tooltipRef",
3098
3190
  ref: K,
@@ -3105,28 +3197,28 @@ var Bt = {
3105
3197
  transform: C(Pe) ? `translate3d(${C(Pe).left}px, ${C(Pe).top}px, 0) translateY(-50%)` : "translateY(-50%)",
3106
3198
  visibility: C(Pe) ? "visible" : "hidden"
3107
3199
  })
3108
- }, [b(n.$slots, "tooltip", p(u(X.value)), () => [o("div", Zn, [Ke.value ? (_(), a("div", Qn, x(Ke.value), 1)) : i("", !0), (_(!0), a(e, null, y(X.value.values, (e) => (_(), a("div", {
3200
+ }, [b(n.$slots, "tooltip", p(u(Z.value)), () => [o("div", Xn, [Je.value ? (_(), a("div", Zn, x(Je.value), 1)) : i("", !0), (_(!0), a(e, null, y(Z.value.values, (e) => (_(), a("div", {
3109
3201
  key: e.seriesIndex,
3110
3202
  class: "bar-chart-tooltip-row"
3111
3203
  }, [o("span", {
3112
3204
  class: "bar-chart-tooltip-swatch",
3113
3205
  style: m({ background: e.color })
3114
- }, null, 4), s(" " + x(isFinite(e.value) ? C(fe)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
3115
- C(Le) ? (_(), a("a", {
3206
+ }, null, 4), s(" " + x(isFinite(e.value) ? C(L)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
3207
+ C(Ie) ? (_(), a("a", {
3116
3208
  key: 2,
3117
3209
  class: "bar-chart-download-link",
3118
- href: C(Re),
3119
- download: `${C(Ve)()}.csv`
3120
- }, x(C(Le)), 9, $n)) : i("", !0),
3121
- C(ze) ? (_(), a("button", {
3210
+ href: C(Le),
3211
+ download: `${C(Be)()}.csv`
3212
+ }, x(C(Ie)), 9, Qn)) : i("", !0),
3213
+ C(Re) ? (_(), a("button", {
3122
3214
  key: 3,
3123
3215
  type: "button",
3124
3216
  class: "bar-chart-download-button",
3125
- onClick: c[0] ||= (...e) => C(Be) && C(Be)(...e)
3126
- }, x(C(ze)), 1)) : i("", !0)
3127
- ], 2));
3217
+ onClick: l[0] ||= (...e) => C(ze) && C(ze)(...e)
3218
+ }, x(C(Re)), 1)) : i("", !0)
3219
+ ], 16)], 8, ["to", "disabled"]));
3128
3220
  }
3129
- }), [["__scopeId", "data-v-59c746d2"]]), sr = {
3221
+ }), [["__scopeId", "data-v-67594e38"]]), or = {
3130
3222
  ref: "root",
3131
3223
  class: "chart-tooltip-content",
3132
3224
  style: {
@@ -3138,7 +3230,7 @@ var Bt = {
3138
3230
  "pointer-events": "none",
3139
3231
  transform: "translateY(-50%)"
3140
3232
  }
3141
- }, cr = /* @__PURE__ */ l({
3233
+ }, sr = /* @__PURE__ */ l({
3142
3234
  __name: "ChoroplethTooltip",
3143
3235
  setup(e, { expose: n }) {
3144
3236
  let a = v(null), s = T("root");
@@ -3149,21 +3241,22 @@ var Bt = {
3149
3241
  getEl() {
3150
3242
  return s.value;
3151
3243
  }
3152
- }), (e, n) => (_(), r(t, { to: "body" }, [o("div", sr, [a.value ? b(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
3244
+ }), (e, n) => (_(), r(t, { to: "body" }, [o("div", or, [a.value ? b(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
3153
3245
  }
3154
- }), lr = {
3246
+ }), cr = {
3155
3247
  class: "chart-sr-only",
3156
3248
  "aria-live": "polite"
3157
- }, ur = {
3249
+ }, lr = {
3158
3250
  key: 1,
3159
3251
  class: "choropleth-header"
3160
- }, dr = {
3252
+ }, ur = {
3161
3253
  key: 0,
3162
3254
  class: "choropleth-legend-title"
3163
- }, fr = {
3255
+ }, dr = {
3164
3256
  key: 2,
3165
3257
  class: "choropleth-legend-continuous"
3166
- }, pr = { class: "choropleth-legend-ticks" }, mr = ["viewBox"], hr = ["innerHTML"], gr = "http://www.w3.org/2000/svg", _r = 450, vr = 1e3, yr = /* @__PURE__ */ L(/* @__PURE__ */ l({
3258
+ }, fr = { class: "choropleth-legend-ticks" }, pr = ["viewBox"], mr = ["innerHTML"], hr = "http://www.w3.org/2000/svg", gr = 10, _r = 600, vr = 450, yr = 1e3, br = /* @__PURE__ */ L(/* @__PURE__ */ l({
3259
+ inheritAttrs: !1,
3167
3260
  __name: "ChoroplethMap",
3168
3261
  props: {
3169
3262
  topology: {},
@@ -3201,19 +3294,20 @@ var Bt = {
3201
3294
  tooltipValueFormat: {},
3202
3295
  tooltipClamp: { default: "chart" },
3203
3296
  focus: {},
3204
- focusZoomLevel: { default: 4 }
3297
+ focusZoomLevel: { default: 4 },
3298
+ fullscreenTarget: {}
3205
3299
  },
3206
3300
  emits: [
3207
3301
  "stateClick",
3208
3302
  "stateHover",
3209
3303
  "update:focus"
3210
3304
  ],
3211
- setup(t, { emit: c }) {
3212
- let l = t, d = c, ee = (e) => e, T = v(null), O = v(null), k = v(null), ne = v(null), A = v(null), j = v(null), re = w(), M = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!re.tooltip), ie = n(() => {
3213
- let e = l.legendStyle, t = {};
3305
+ setup(c, { emit: l }) {
3306
+ let f = c, ee = l, T = (e) => e, O = v(null), k = v(null), ne = v(null), A = v(null), j = v(null), M = v(null), re = w(), ie = n(() => !!f.tooltipTrigger || !!f.tooltipFormat || !!re.tooltip), N = n(() => {
3307
+ let e = f.legendStyle, t = {};
3214
3308
  return e?.fontSize != null && (t["font-size"] = `${e.fontSize}px`), e?.fontWeight != null && (t["font-weight"] = String(e.fontWeight)), e?.color != null && (t.color = e.color), t;
3215
- }), N = n(() => {
3216
- let e = l.titleStyle, t = {
3309
+ }), de = n(() => {
3310
+ let e = f.titleStyle, t = {
3217
3311
  "font-size": `${e?.fontSize ?? 14}px`,
3218
3312
  "line-height": `${e?.lineHeight ?? 18}px`,
3219
3313
  "font-weight": String(e?.fontWeight ?? 600),
@@ -3221,58 +3315,57 @@ var Bt = {
3221
3315
  width: "100%"
3222
3316
  };
3223
3317
  return e?.color && (t.color = e.color), t;
3224
- }), I = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new Map(), fe = null, L = null, R = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), he = !1, ge = typeof window < "u" && "ontouchstart" in window, _e = null, ve = {
3318
+ }), I = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map(), R = null, z = null, B = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map(), me = !1, he = typeof window < "u" && "ontouchstart" in window, ge = null, _e = {
3225
3319
  width: 0,
3226
3320
  height: 0
3227
- }, ye = null, be = !1, z = null, xe = v(!1), Se = 0, B = 0, V = 0;
3228
- function Ce() {
3229
- if (ge) return;
3230
- let e = k.value;
3231
- e && (e.addEventListener("click", vt), e.addEventListener("mouseover", vt), e.addEventListener("mousemove", yt), e.addEventListener("mouseout", Z));
3321
+ }, ve = null, ye = !1, V = null, be = v(!1), xe = 0, Se = 0, Ce = 0, we = null;
3322
+ function Te() {
3323
+ let e = ne.value;
3324
+ e && (e.addEventListener("touchstart", St, { passive: !0 }), e.addEventListener("touchend", Ct), e.addEventListener("touchcancel", wt, { passive: !0 }), !he && (e.addEventListener("click", yt), e.addEventListener("mouseover", yt), e.addEventListener("mousemove", bt), e.addEventListener("mouseout", xt)));
3232
3325
  }
3233
- function we() {
3234
- let e = k.value;
3235
- e && (e.removeEventListener("click", vt), e.removeEventListener("mouseover", vt), e.removeEventListener("mousemove", yt), e.removeEventListener("mouseout", Z));
3326
+ function Ee() {
3327
+ let e = ne.value;
3328
+ e && (e.removeEventListener("touchstart", St), e.removeEventListener("touchend", Ct), e.removeEventListener("touchcancel", wt), e.removeEventListener("click", yt), e.removeEventListener("mouseover", yt), e.removeEventListener("mousemove", bt), e.removeEventListener("mouseout", xt));
3236
3329
  }
3237
- function Te() {
3330
+ function De() {
3238
3331
  gt();
3239
3332
  }
3240
3333
  h(() => {
3241
- Ee(), Ce(), bt(), je(), st(), window.addEventListener("scroll", Te, {
3334
+ Oe(), Te(), Et(), U(), st(), window.addEventListener("scroll", De, {
3242
3335
  passive: !0,
3243
3336
  capture: !0
3244
- }), window.addEventListener("resize", Te, { passive: !0 });
3337
+ }), window.addEventListener("resize", De, { passive: !0 });
3245
3338
  }), g(() => {
3246
- _e?.disconnect(), V && cancelAnimationFrame(V), De(), we(), window.removeEventListener("scroll", Te, { capture: !0 }), window.removeEventListener("resize", Te);
3339
+ ge?.disconnect(), Ce && cancelAnimationFrame(Ce), ke(), Ee(), window.removeEventListener("scroll", De, { capture: !0 }), window.removeEventListener("resize", De);
3247
3340
  });
3248
- function Ee() {
3249
- if (!O.value || !k.value) return;
3250
- let e = ce(O.value), t = Math.max(12, l.focusZoomLevel);
3251
- z = oe().scaleExtent([1, t]).on("start", () => {
3252
- he = !0, gt();
3341
+ function Oe() {
3342
+ if (!k.value || !ne.value) return;
3343
+ let e = ce(k.value), t = Math.max(12, f.focusZoomLevel);
3344
+ V = oe().scaleExtent([1, t]).on("start", () => {
3345
+ me = !0, gt();
3253
3346
  }).on("zoom", (e) => {
3254
- k.value && k.value.setAttribute("transform", e.transform);
3347
+ ne.value && ne.value.setAttribute("transform", e.transform);
3255
3348
  let t = e.transform;
3256
- xe.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
3349
+ be.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
3257
3350
  }).on("end", () => {
3258
- he = !1;
3259
- }), z.filter((e) => {
3260
- let t = Y.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
3351
+ me = !1;
3352
+ }), V.filter((e) => {
3353
+ let t = Y.value.length > 0, n = !!f.zoom || t, r = !!f.pan || t;
3261
3354
  if (e.type === "wheel" || e.type === "dblclick") {
3262
3355
  if (!n) return !1;
3263
3356
  } else if (e.type === "mousedown" || e.type === "touchstart") {
3264
3357
  if (!r) return !1;
3265
3358
  } else if (!n && !r) return !1;
3266
3359
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
3267
- }), e.call(z);
3360
+ }), e.call(V);
3268
3361
  }
3269
- function De() {
3270
- O.value && z && (ce(O.value).on(".zoom", null), z = null);
3362
+ function ke() {
3363
+ k.value && V && (ce(k.value).on(".zoom", null), V = null);
3271
3364
  }
3272
- function Oe(e) {
3273
- let t = Ke.value, n = J.value, r = [];
3365
+ function H(e) {
3366
+ let t = X.value, n = Ke.value, r = [];
3274
3367
  for (let i of e) {
3275
- let e = i.geoType ?? l.geoType, a = t.get(e);
3368
+ let e = i.geoType ?? f.geoType, a = t.get(e);
3276
3369
  if (!a) continue;
3277
3370
  let o = a.get(i.id);
3278
3371
  if (!o) {
@@ -3288,81 +3381,81 @@ var Bt = {
3288
3381
  }
3289
3382
  return r;
3290
3383
  }
3291
- function ke(e) {
3384
+ function je(e) {
3292
3385
  let t = /* @__PURE__ */ new Set();
3293
- for (let n of Oe(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
3386
+ for (let n of H(e)) n.geoType === f.geoType && t.add(String(n.feature.id));
3294
3387
  return t;
3295
3388
  }
3296
- let Ae = !1;
3297
- function je() {
3298
- if (!O.value || !z) return;
3299
- let e = Oe(Y.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
3389
+ let Me = !1;
3390
+ function U() {
3391
+ if (!k.value || !V) return;
3392
+ let e = H(Y.value), t = e.filter((e) => e.geoType === f.geoType), n = e.filter((e) => e.geoType !== f.geoType), r = /* @__PURE__ */ new Map();
3300
3393
  for (let e of t) {
3301
3394
  let t = I.get(String(e.feature.id));
3302
3395
  t && r.set(t, e.item.style ?? "solid");
3303
3396
  }
3304
- for (let [e] of R) r.has(e) || e === L || mt(e);
3305
- for (let [e, t] of r) R.get(e) === t && e !== L || e !== L && pt(e, t);
3306
- R.clear();
3307
- for (let [e, t] of r) R.set(e, t);
3308
- if (Me(n), e.length === 0) {
3309
- Ae = !0, gt();
3397
+ for (let [e] of B) r.has(e) || e === z || mt(e);
3398
+ for (let [e, t] of r) B.get(e) === t && e !== z || e !== z && pt(e, t);
3399
+ B.clear();
3400
+ for (let [e, t] of r) B.set(e, t);
3401
+ if (W(n), e.length === 0) {
3402
+ Me = !0, gt();
3310
3403
  return;
3311
3404
  }
3312
- let i = ce(O.value);
3405
+ let i = ce(k.value);
3313
3406
  i.interrupt();
3314
- let a = Ae;
3315
- Ae = !0;
3316
- let [[o, s], [c, u]] = Ue.value.bounds({
3407
+ let a = Me;
3408
+ Me = !0;
3409
+ let [[o, s], [c, l]] = We.value.bounds({
3317
3410
  type: "FeatureCollection",
3318
3411
  features: e.map((e) => e.feature)
3319
- }), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = se.translate(Ne.value / 2 - p * d, G.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
3320
- if (!M.value || !h) return;
3412
+ }), u = (o + c) / 2, d = (s + l) / 2, p = f.focusZoomLevel, m = se.translate(q.value / 2 - p * u, Fe.value / 2 - p * d).scale(p), h = t[0]?.feature ?? null, g = () => {
3413
+ if (!ie.value || !h) return;
3321
3414
  let e = String(h.id), t = I.get(e);
3322
3415
  if (!t) return;
3323
3416
  let n = t.getBoundingClientRect();
3324
3417
  lt(e, n.left + n.width / 2, n.top + n.height / 2);
3325
3418
  };
3326
- a ? (dt(), i.transition().duration(_r).call(z.transform, m).on("end", g)) : (z.transform(i, m), g());
3419
+ a ? (dt(), i.transition().duration(vr).call(V.transform, m).on("end", g)) : (V.transform(i, m), g());
3327
3420
  }
3328
- function Me(e) {
3329
- let t = A.value;
3421
+ function W(e) {
3422
+ let t = j.value;
3330
3423
  if (!t) return;
3331
3424
  let n = new Set(e.map((e) => e.key));
3332
- for (let [e, t] of me) n.has(e) || (t.remove(), me.delete(e));
3333
- let r = Ue.value, i = q.value + 1.5;
3425
+ for (let [e, t] of pe) n.has(e) || (t.remove(), pe.delete(e));
3426
+ let r = We.value, i = Ge.value + 1.5;
3334
3427
  for (let { item: n, feature: a, key: o } of e) {
3335
- let e = me.get(o);
3336
- e || (e = document.createElementNS(gr, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), me.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), ft(e, n.style);
3428
+ let e = pe.get(o);
3429
+ e || (e = document.createElementNS(hr, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), pe.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), ft(e, n.style);
3337
3430
  }
3338
3431
  }
3339
- function U() {
3340
- if (!O.value || !z) return;
3341
- Y.value.length > 0 && d("update:focus", null);
3342
- let e = ce(O.value);
3343
- e.interrupt(), dt(), e.transition().duration(_r).call(z.transform, se);
3432
+ function Ne() {
3433
+ if (!k.value || !V) return;
3434
+ Y.value.length > 0 && ee("update:focus", null);
3435
+ let e = ce(k.value);
3436
+ e.interrupt(), dt(), e.transition().duration(vr).call(V.transform, se);
3344
3437
  }
3345
- E(() => l.focusZoomLevel, () => {
3346
- z && z.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), je();
3438
+ E(() => f.focusZoomLevel, () => {
3439
+ V && V.scaleExtent([1, Math.max(12, f.focusZoomLevel)]), U();
3347
3440
  });
3348
- let W = n(() => l.width && l.height ? l.height / l.width : .625), Ne = n(() => vr), G = n(() => vr * W.value), Fe = v(null), Ie = null;
3349
- function Le() {
3350
- return Ie ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (Fe.value = e, e)), Ie;
3441
+ let Pe = n(() => f.width && f.height ? f.height / f.width : .625), q = n(() => yr), Fe = n(() => yr * Pe.value), Ie = v(null), Le = null;
3442
+ function ze() {
3443
+ return Le ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (Ie.value = e, e)), Le;
3351
3444
  }
3352
3445
  E(() => {
3353
- if (l.geoType === "hsas" || l.dataGeoType === "hsas") return !0;
3354
- let e = l.focus;
3446
+ if (f.geoType === "hsas" || f.dataGeoType === "hsas") return !0;
3447
+ let e = f.focus;
3355
3448
  return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
3356
3449
  }, (e) => {
3357
- e && Le();
3450
+ e && ze();
3358
3451
  }, { immediate: !0 });
3359
- let Re = n(() => {
3360
- let e = Fe.value;
3452
+ let Be = n(() => {
3453
+ let e = Ie.value;
3361
3454
  if (!e) return {
3362
3455
  type: "FeatureCollection",
3363
3456
  features: []
3364
3457
  };
3365
- let { fipsToHsa: t, hsaNames: n } = e, r = S(l.topology), i = r.objects.counties.geometries, a = /* @__PURE__ */ new Map();
3458
+ let { fipsToHsa: t, hsaNames: n } = e, r = S(f.topology), i = r.objects.counties.geometries, a = /* @__PURE__ */ new Map();
3366
3459
  for (let e of i) {
3367
3460
  let n = t[String(e.id).padStart(5, "0")];
3368
3461
  n && (a.has(n) || a.set(n, []), a.get(n).push(e));
@@ -3378,44 +3471,44 @@ var Bt = {
3378
3471
  type: "FeatureCollection",
3379
3472
  features: o
3380
3473
  };
3381
- }), ze = n(() => {
3382
- if (l.geoType === "hsas") return Re.value;
3383
- if (l.geoType === "counties") {
3384
- let e = S(l.topology);
3474
+ }), Ve = n(() => {
3475
+ if (f.geoType === "hsas") return Be.value;
3476
+ if (f.geoType === "counties") {
3477
+ let e = S(f.topology);
3385
3478
  return F(e, e.objects.counties);
3386
3479
  }
3387
- let e = S(l.topology);
3480
+ let e = S(f.topology);
3388
3481
  return F(e, e.objects.states);
3389
- }), Ve = n(() => {
3390
- if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
3391
- let e = S(l.topology);
3482
+ }), He = n(() => {
3483
+ if (f.geoType !== "counties" && f.geoType !== "hsas") return null;
3484
+ let e = S(f.topology);
3392
3485
  return ue(e, e.objects.states, (e, t) => e !== t);
3393
- }), He = n(() => ae().fitExtent([[0, 0], [Ne.value, G.value]], ze.value)), Ue = n(() => P(He.value)), q = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), J = n(() => {
3486
+ }), Ue = n(() => ae().fitExtent([[0, 0], [q.value, Fe.value]], Ve.value)), We = n(() => P(Ue.value)), Ge = n(() => f.geoType === "counties" || f.geoType === "hsas" ? f.strokeWidth * .5 : f.strokeWidth), Ke = n(() => {
3394
3487
  let e = /* @__PURE__ */ new Map();
3395
- for (let [t, n] of Ke.value) {
3488
+ for (let [t, n] of X.value) {
3396
3489
  let r = /* @__PURE__ */ new Map();
3397
3490
  for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
3398
3491
  e.set(t, r);
3399
3492
  }
3400
3493
  return e;
3401
3494
  });
3402
- function We(e) {
3403
- let t = l.dataGeoType;
3404
- if (!t || t === l.geoType) return e;
3405
- if (l.geoType === "counties" && t === "hsas") return Fe.value?.fipsToHsa[e];
3406
- if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
3495
+ function J(e) {
3496
+ let t = f.dataGeoType;
3497
+ if (!t || t === f.geoType) return e;
3498
+ if (f.geoType === "counties" && t === "hsas") return Ie.value?.fipsToHsa[e];
3499
+ if (f.geoType === "counties" && t === "states" || f.geoType === "hsas" && t === "states") return e.slice(0, 2);
3407
3500
  }
3408
- let Ge = n(() => {
3501
+ let qe = n(() => {
3409
3502
  let e = /* @__PURE__ */ new Map();
3410
- for (let t of ze.value.features) t.id != null && e.set(String(t.id), t);
3503
+ for (let t of Ve.value.features) t.id != null && e.set(String(t.id), t);
3411
3504
  return e;
3412
3505
  }), Y = n(() => {
3413
- let e = l.focus;
3506
+ let e = f.focus;
3414
3507
  return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
3415
- }), Ke = n(() => {
3508
+ }), X = n(() => {
3416
3509
  let e = /* @__PURE__ */ new Map();
3417
- e.set(l.geoType, Ge.value);
3418
- let t = S(l.topology), n = t?.objects;
3510
+ e.set(f.geoType, qe.value);
3511
+ let t = S(f.topology), n = t?.objects;
3419
3512
  if (!n) return e;
3420
3513
  let r = (e) => {
3421
3514
  let t = /* @__PURE__ */ new Map();
@@ -3430,24 +3523,24 @@ var Bt = {
3430
3523
  let i = F(t, n.counties);
3431
3524
  e.set("counties", r(i.features));
3432
3525
  }
3433
- return !e.has("hsas") && n.counties && e.set("hsas", r(Re.value.features)), e;
3434
- }), X = n(() => {
3526
+ return !e.has("hsas") && n.counties && e.set("hsas", r(Be.value.features)), e;
3527
+ }), Je = n(() => {
3435
3528
  let e = /* @__PURE__ */ new Map();
3436
- if (!l.data) return e;
3437
- let t = l.dataGeoType ?? l.geoType, n = J.value.get(t);
3438
- for (let t of l.data) {
3529
+ if (!f.data) return e;
3530
+ let t = f.dataGeoType ?? f.geoType, n = Ke.value.get(t);
3531
+ for (let t of f.data) {
3439
3532
  e.set(t.id, t.value);
3440
3533
  let r = n?.get(t.id);
3441
3534
  r && e.set(r, t.value);
3442
3535
  }
3443
3536
  return e;
3444
- }), qe = n(() => {
3445
- if (!l.data || l.data.length === 0) return {
3537
+ }), Z = n(() => {
3538
+ if (!f.data || f.data.length === 0) return {
3446
3539
  min: 0,
3447
3540
  max: 1
3448
3541
  };
3449
3542
  let e = Infinity, t = -Infinity;
3450
- for (let n of l.data) typeof n.value == "number" && (n.value < e && (e = n.value), n.value > t && (t = n.value));
3543
+ for (let n of f.data) typeof n.value == "number" && (n.value < e && (e = n.value), n.value > t && (t = n.value));
3451
3544
  return isFinite(e) ? e === t ? {
3452
3545
  min: e,
3453
3546
  max: e + 1
@@ -3458,7 +3551,7 @@ var Bt = {
3458
3551
  min: 0,
3459
3552
  max: 1
3460
3553
  };
3461
- }), Je = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Ye = n(() => Array.isArray(l.colorScale) && !Je.value), Xe = n(() => Ye.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Ze = n(() => Ye.value ? "" : l.colorScale?.max ?? "#08519c");
3554
+ }), Q = n(() => Array.isArray(f.colorScale) && f.colorScale.length > 0 && "value" in f.colorScale[0]), Ye = n(() => Array.isArray(f.colorScale) && !Q.value), Xe = n(() => Ye.value ? "" : f.colorScale?.min ?? "#e5f0fa"), Ze = n(() => Ye.value ? "" : f.colorScale?.max ?? "#08519c");
3462
3555
  function Qe(e) {
3463
3556
  let t = e.replace("#", "");
3464
3557
  return [
@@ -3471,18 +3564,18 @@ var Bt = {
3471
3564
  let [t, n, r] = Qe(Xe.value), [i, a, o] = Qe(Ze.value);
3472
3565
  return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
3473
3566
  }
3474
- let et = n(() => Ye.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), tt = n(() => {
3475
- if (!Je.value) return null;
3567
+ let et = n(() => Ye.value ? f.colorScale.slice().sort((e, t) => t.min - e.min) : null), tt = n(() => {
3568
+ if (!Q.value) return null;
3476
3569
  let e = /* @__PURE__ */ new Map();
3477
- for (let t of l.colorScale) e.set(t.value, t.color);
3570
+ for (let t of f.colorScale) e.set(t.value, t.color);
3478
3571
  return e;
3479
3572
  });
3480
3573
  function nt(e) {
3481
- let t = We(e);
3482
- return t == null ? void 0 : X.value.get(t);
3574
+ let t = J(e);
3575
+ return t == null ? void 0 : Je.value.get(t);
3483
3576
  }
3484
3577
  function rt(e) {
3485
- let t = nt(e), n = l.noDataColor;
3578
+ let t = nt(e), n = f.noDataColor;
3486
3579
  if (t == null) return n;
3487
3580
  let r = tt.value;
3488
3581
  if (r) return r.get(String(t)) ?? n;
@@ -3492,73 +3585,73 @@ var Bt = {
3492
3585
  for (let t of i) if (e >= t.min) return t.color;
3493
3586
  return n;
3494
3587
  }
3495
- let { min: a, max: o } = qe.value;
3588
+ let { min: a, max: o } = Z.value;
3496
3589
  return $e((t - a) / (o - a));
3497
3590
  }
3498
3591
  let it = (e) => e.properties?.name ?? String(e.id);
3499
3592
  function at(e) {
3500
- return e == null ? "" : typeof e == "number" && l.tooltipValueFormat !== void 0 ? te(e, l.tooltipValueFormat) : String(e);
3593
+ return e == null ? "" : typeof e == "number" && f.tooltipValueFormat !== void 0 ? te(e, f.tooltipValueFormat) : String(e);
3501
3594
  }
3502
3595
  function ot(e, t) {
3503
3596
  return t == null ? e : `${e}: ${at(t)}`;
3504
3597
  }
3505
3598
  function st() {
3506
- let e = j.value?.getEl();
3599
+ let e = M.value?.getEl();
3507
3600
  if (!e) return;
3508
- _e?.disconnect();
3601
+ ge?.disconnect();
3509
3602
  let t = !1;
3510
- _e = new ResizeObserver((e) => {
3603
+ ge = new ResizeObserver((e) => {
3511
3604
  let n = e[0]?.contentRect;
3512
- n && (ve.width = n.width, ve.height = n.height, !t && be && ye ? (t = !0, ct(ye.x, ye.y)) : t = !0);
3513
- }), _e.observe(e);
3605
+ n && (_e.width = n.width, _e.height = n.height, !t && ye && ve ? (t = !0, ct(ve.x, ve.y)) : t = !0);
3606
+ }), ge.observe(e);
3514
3607
  }
3515
3608
  function ct(e, t) {
3516
- let n = j.value?.getEl();
3609
+ let n = M.value?.getEl();
3517
3610
  if (!n) return;
3518
- let r = T.value?.getBoundingClientRect(), { left: i, top: a } = H(e, t, ve.width, ve.height, l.tooltipClamp, r);
3611
+ let r = O.value?.getBoundingClientRect(), { left: i, top: a } = Ae(e, t, _e.width, _e.height, f.tooltipClamp, r);
3519
3612
  n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
3520
3613
  }
3521
3614
  function lt(e, t, n) {
3522
- let r = de.get(e);
3615
+ let r = L.get(e);
3523
3616
  if (!r) return;
3524
- let i = j.value, a = i?.getEl();
3525
- !i || !a || (i.setData(r), ye = {
3617
+ let i = M.value, a = i?.getEl();
3618
+ !i || !a || (i.setData(r), ve = {
3526
3619
  x: t,
3527
3620
  y: n
3528
- }, be = !0, ct(t, n), a.style.visibility = "visible");
3621
+ }, ye = !0, ct(t, n), a.style.visibility = "visible");
3529
3622
  }
3530
3623
  function ut(e, t) {
3531
- be && (Se = e, B = t, !V && (V = requestAnimationFrame(() => {
3532
- V = 0;
3533
- let e = j.value?.getEl();
3534
- !e || !be || (ye = {
3535
- x: Se,
3536
- y: B
3537
- }, e.style.transform = `translate3d(${Se + 16}px, ${B}px, 0) translateY(-50%)`);
3624
+ ye && (xe = e, Se = t, !Ce && (Ce = requestAnimationFrame(() => {
3625
+ Ce = 0;
3626
+ let e = M.value?.getEl();
3627
+ !e || !ye || (ve = {
3628
+ x: xe,
3629
+ y: Se
3630
+ }, e.style.transform = `translate3d(${xe + 16}px, ${Se}px, 0) translateY(-50%)`);
3538
3631
  })));
3539
3632
  }
3540
3633
  function dt() {
3541
- if (!be) return;
3542
- be = !1, ye = null;
3543
- let e = j.value?.getEl();
3634
+ if (!ye) return;
3635
+ ye = !1, ve = null;
3636
+ let e = M.value?.getEl();
3544
3637
  e && (e.style.visibility = "hidden");
3545
3638
  }
3546
3639
  function ft(e, t) {
3547
3640
  t === "dashed" ? (e.setAttribute("stroke-dasharray", "8 4"), e.removeAttribute("stroke-linecap")) : t === "dotted" ? (e.setAttribute("stroke-dasharray", "0 5"), e.setAttribute("stroke-linecap", "round")) : (e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap"));
3548
3641
  }
3549
3642
  function pt(e, t = "solid") {
3550
- e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(q.value + 1)), e.setAttribute("stroke", "#555"), ft(e, t);
3643
+ e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Ge.value + 1)), e.setAttribute("stroke", "#555"), ft(e, t);
3551
3644
  }
3552
3645
  function mt(e) {
3553
- e.setAttribute("stroke-width", String(q.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
3646
+ e.setAttribute("stroke-width", String(Ge.value)), e.setAttribute("stroke", f.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
3554
3647
  }
3555
3648
  function ht(e) {
3556
- L !== e && (L && !R.has(L) && mt(L), L = e, pt(e, R.get(e) ?? "solid"));
3649
+ z !== e && (z && !B.has(z) && mt(z), z = e, pt(e, B.get(e) ?? "solid"));
3557
3650
  }
3558
3651
  function gt() {
3559
- if (L) {
3560
- let e = R.get(L);
3561
- e == null ? mt(L) : pt(L, e), L = null, d("stateHover", null);
3652
+ if (z) {
3653
+ let e = B.get(z);
3654
+ e == null ? mt(z) : pt(z, e), z = null, ee("stateHover", null);
3562
3655
  }
3563
3656
  dt();
3564
3657
  }
@@ -3568,74 +3661,105 @@ var Bt = {
3568
3661
  return t ? t.dataset.featId ?? null : null;
3569
3662
  }
3570
3663
  function vt(e) {
3571
- if (he) return;
3664
+ ee("stateClick", {
3665
+ id: e.id,
3666
+ name: e.name,
3667
+ value: e.value
3668
+ }), ee("update:focus", je(Y.value).has(e.id) ? null : e.id);
3669
+ }
3670
+ function yt(e) {
3671
+ if (me) return;
3572
3672
  let t = e, n = _t(t.target);
3573
3673
  if (!n) return;
3574
- let r = de.get(n);
3674
+ let r = L.get(n);
3575
3675
  if (!r) return;
3576
3676
  let i = {
3577
3677
  id: r.id,
3578
3678
  name: r.name,
3579
3679
  value: r.value
3580
3680
  };
3581
- e.type === "click" ? (d("stateClick", i), d("update:focus", ke(Y.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (ht(I.get(n)), M.value && lt(n, t.clientX, t.clientY), d("stateHover", i));
3681
+ e.type === "click" ? vt(r) : e.type === "mouseover" && (ht(I.get(n)), ie.value && lt(n, t.clientX, t.clientY), ee("stateHover", i));
3582
3682
  }
3583
- function yt(e) {
3584
- he || ut(e.clientX, e.clientY);
3683
+ function bt(e) {
3684
+ me || ut(e.clientX, e.clientY);
3585
3685
  }
3586
- function Z(e) {
3686
+ function xt(e) {
3587
3687
  let t = e.relatedTarget;
3588
- t && k.value?.contains(t) || gt();
3688
+ t && ne.value?.contains(t) || gt();
3689
+ }
3690
+ function St(e) {
3691
+ if (e.touches.length !== 1) {
3692
+ we = null;
3693
+ return;
3694
+ }
3695
+ let t = e.touches[0];
3696
+ we = {
3697
+ x: t.clientX,
3698
+ y: t.clientY,
3699
+ time: e.timeStamp,
3700
+ featId: _t(e.target)
3701
+ };
3702
+ }
3703
+ function Ct(e) {
3704
+ let t = we;
3705
+ if (we = null, !t || !t.featId || e.touches.length > 0) return;
3706
+ let n = e.changedTouches[0];
3707
+ if (!n || Math.abs(n.clientX - t.x) > gr || Math.abs(n.clientY - t.y) > gr || e.timeStamp - t.time > _r) return;
3708
+ let r = L.get(t.featId);
3709
+ r && (e.preventDefault(), vt(r));
3589
3710
  }
3590
- function Q(e) {
3591
- let t = document.createElementNS(gr, "path");
3711
+ function wt() {
3712
+ we = null;
3713
+ }
3714
+ function Tt(e) {
3715
+ let t = document.createElementNS(hr, "path");
3592
3716
  return e && t.setAttribute("d", e), t;
3593
3717
  }
3594
- function bt() {
3595
- let e = ne.value, t = A.value;
3718
+ function Et() {
3719
+ let e = A.value, t = j.value;
3596
3720
  if (!e || !t) return;
3597
3721
  for (; e.firstChild;) e.removeChild(e.firstChild);
3598
3722
  for (; t.firstChild;) t.removeChild(t.firstChild);
3599
- I.clear(), de.clear(), fe = null, L = null, R.clear(), me.clear();
3600
- let n = Ue.value, r = ze.value.features, i = l.strokeColor, a = String(q.value), o = !M.value, s = document.createDocumentFragment();
3723
+ I.clear(), L.clear(), R = null, z = null, B.clear(), pe.clear();
3724
+ let n = We.value, r = Ve.value.features, i = f.strokeColor, a = String(Ge.value), o = !ie.value, s = document.createDocumentFragment();
3601
3725
  for (let e of r) {
3602
- let t = String(e.id), r = it(e), c = nt(t), l = Q(n(e));
3726
+ let t = String(e.id), r = it(e), c = nt(t), l = Tt(n(e));
3603
3727
  if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", rt(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
3604
- let e = document.createElementNS(gr, "title");
3728
+ let e = document.createElementNS(hr, "title");
3605
3729
  e.textContent = ot(r, c), l.appendChild(e);
3606
3730
  }
3607
- s.appendChild(l), I.set(t, l), de.set(t, {
3731
+ s.appendChild(l), I.set(t, l), L.set(t, {
3608
3732
  id: t,
3609
3733
  name: r,
3610
3734
  value: c,
3611
3735
  feature: e
3612
3736
  });
3613
3737
  }
3614
- let c = Ve.value;
3738
+ let c = He.value;
3615
3739
  if (c) {
3616
- let e = Q(n(c));
3617
- e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), fe = e;
3740
+ let e = Tt(n(c));
3741
+ e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), R = e;
3618
3742
  }
3619
3743
  e.appendChild(s);
3620
3744
  }
3621
- function xt() {
3622
- let e = !M.value;
3745
+ function Dt() {
3746
+ let e = !ie.value;
3623
3747
  for (let [t, n] of I) {
3624
- let r = nt(t), i = de.get(t);
3748
+ let r = nt(t), i = L.get(t);
3625
3749
  if (n.setAttribute("fill", rt(t)), i && (i.value = r), e && i) {
3626
3750
  let e = n.firstElementChild;
3627
3751
  e && (e.textContent = ot(i.name, r));
3628
3752
  }
3629
3753
  }
3630
3754
  }
3631
- function St() {
3632
- for (let e of I.values()) e === L || R.has(e) || mt(e);
3633
- fe && fe.setAttribute("stroke", l.strokeColor);
3755
+ function Ot() {
3756
+ for (let e of I.values()) e === z || B.has(e) || mt(e);
3757
+ R && R.setAttribute("stroke", f.strokeColor);
3634
3758
  }
3635
- function Ct() {
3636
- return typeof l.menu == "string" ? l.menu : "choropleth";
3759
+ function kt() {
3760
+ return typeof f.menu == "string" ? f.menu : "choropleth";
3637
3761
  }
3638
- let wt = n(() => l.legend && (Je.value || Ye.value || l.data)), Tt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), Et = n(() => {
3762
+ let At = n(() => f.legend && (Q.value || Ye.value || f.data)), jt = n(() => f.colorScale.slice().sort((e, t) => e.min - t.min)), Mt = n(() => {
3639
3763
  let e = [];
3640
3764
  for (let t = 0; t <= 10; t++) {
3641
3765
  let n = t / 10;
@@ -3645,129 +3769,140 @@ var Bt = {
3645
3769
  });
3646
3770
  }
3647
3771
  return e;
3648
- }), Dt = new Intl.NumberFormat("en-US", {
3772
+ }), Nt = new Intl.NumberFormat("en-US", {
3649
3773
  notation: "compact",
3650
3774
  maximumFractionDigits: 1
3651
- }), Ot = n(() => {
3652
- let { min: e, max: t } = qe.value, n = t - e, r = [];
3775
+ }), Pt = n(() => {
3776
+ let { min: e, max: t } = Z.value, n = t - e, r = [];
3653
3777
  for (let t = 1; t <= 3; t++) {
3654
- let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? Dt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
3778
+ let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? Nt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
3655
3779
  r.push({
3656
3780
  value: o,
3657
3781
  pct: i * 100
3658
3782
  });
3659
3783
  }
3660
3784
  return r;
3661
- }), kt = n(() => {
3785
+ }), $ = n(() => {
3662
3786
  let e = [];
3663
- if (Je.value) for (let t of l.colorScale) e.push({
3787
+ if (Q.value) for (let t of f.colorScale) e.push({
3664
3788
  key: t.value,
3665
3789
  color: t.color,
3666
3790
  label: t.value
3667
3791
  });
3668
- else if (Ye.value) for (let t of Tt.value) e.push({
3792
+ else if (Ye.value) for (let t of jt.value) e.push({
3669
3793
  key: String(t.min),
3670
3794
  color: t.color,
3671
3795
  label: t.label ?? String(t.min)
3672
3796
  });
3673
3797
  return e;
3674
- }), At = n(() => `linear-gradient(to right, ${Et.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), jt = Be(), Mt = n(() => {
3675
- let e = Ct();
3798
+ }), Ft = n(() => `linear-gradient(to right, ${Mt.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), It = Re({ target: () => f.fullscreenTarget }), Lt = n(() => {
3799
+ let e = kt();
3676
3800
  return [
3677
- jt.menuItem.value,
3801
+ It.menuItem.value,
3678
3802
  {
3679
3803
  label: "Save as SVG",
3680
3804
  action: () => {
3681
- O.value && K(O.value, e);
3805
+ k.value && G(k.value, e);
3682
3806
  }
3683
3807
  },
3684
3808
  {
3685
3809
  label: "Save as PNG",
3686
3810
  action: () => {
3687
- O.value && Pe(O.value, e);
3811
+ k.value && K(k.value, e);
3688
3812
  }
3689
3813
  }
3690
3814
  ];
3691
3815
  });
3692
- return E(() => [Ue.value, M.value], () => bt()), E(() => [
3693
- X.value,
3694
- l.colorScale,
3695
- l.noDataColor,
3696
- l.dataGeoType
3697
- ], () => xt()), E(() => [l.strokeColor, q.value], () => St()), E(() => [
3816
+ return E(() => [We.value, ie.value], () => Et()), E(() => [
3817
+ Je.value,
3818
+ f.colorScale,
3819
+ f.noDataColor,
3820
+ f.dataGeoType
3821
+ ], () => Dt()), E(() => [f.strokeColor, Ge.value], () => Ot()), E(() => [
3698
3822
  Y.value,
3699
- Ue.value,
3700
- Fe.value
3701
- ], () => je(), { flush: "post" }), (n, c) => (_(), a("div", {
3823
+ We.value,
3824
+ Ie.value
3825
+ ], () => U(), { flush: "post" }), (n, l) => (_(), r(t, {
3826
+ to: C(It).teleportTarget.value,
3827
+ disabled: !C(It).isFullscreen.value
3828
+ }, [o("div", d({
3702
3829
  ref_key: "containerRef",
3703
- ref: T,
3704
- class: f(["choropleth-wrapper", {
3705
- pannable: t.pan,
3706
- "is-fullscreen": C(jt).isFullscreen.value
3707
- }])
3708
- }, [
3709
- t.menu ? (_(), r(pe, {
3830
+ ref: O
3831
+ }, n.$attrs, {
3832
+ class: ["choropleth-wrapper", {
3833
+ pannable: c.pan,
3834
+ "is-fullscreen": C(It).isFullscreen.value
3835
+ }],
3836
+ style: C(It).fullscreenStyle.value
3837
+ }), [
3838
+ c.menu ? (_(), r(fe, {
3710
3839
  key: 0,
3711
- items: Mt.value
3712
- }, null, 8, ["items"])) : i("", !0),
3713
- o("div", lr, x(C(jt).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
3714
- t.title || wt.value ? (_(), a("div", ur, [t.title ? (_(), a("div", {
3840
+ items: Lt.value,
3841
+ "is-fullscreen": C(It).isFullscreen.value,
3842
+ onClose: C(It).exit
3843
+ }, null, 8, [
3844
+ "items",
3845
+ "is-fullscreen",
3846
+ "onClose"
3847
+ ])) : i("", !0),
3848
+ o("div", cr, x(C(It).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
3849
+ c.title || At.value ? (_(), a("div", lr, [c.title ? (_(), a("div", {
3715
3850
  key: 0,
3716
3851
  class: "choropleth-title",
3717
- style: m(N.value)
3718
- }, x(t.title), 5)) : i("", !0), wt.value ? (_(), a("div", {
3852
+ style: m(de.value)
3853
+ }, x(c.title), 5)) : i("", !0), At.value ? (_(), a("div", {
3719
3854
  key: 1,
3720
3855
  class: "choropleth-legend",
3721
- style: m(ie.value)
3722
- }, [t.legendTitle ? (_(), a("span", dr, x(t.legendTitle), 1)) : i("", !0), Je.value || Ye.value ? (_(!0), a(e, { key: 1 }, y(kt.value, (e) => (_(), a("span", {
3856
+ style: m(N.value)
3857
+ }, [c.legendTitle ? (_(), a("span", ur, x(c.legendTitle), 1)) : i("", !0), Q.value || Ye.value ? (_(!0), a(e, { key: 1 }, y($.value, (e) => (_(), a("span", {
3723
3858
  key: e.key,
3724
3859
  class: "choropleth-legend-item"
3725
3860
  }, [o("span", {
3726
3861
  class: "choropleth-legend-swatch",
3727
3862
  style: m({ background: e.color })
3728
- }, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div", fr, [o("div", {
3863
+ }, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div", dr, [o("div", {
3729
3864
  class: "choropleth-legend-gradient",
3730
- style: m({ background: At.value })
3731
- }, null, 4), o("div", pr, [(_(!0), a(e, null, y(Ot.value, (e) => (_(), a("span", {
3865
+ style: m({ background: Ft.value })
3866
+ }, null, 4), o("div", fr, [(_(!0), a(e, null, y(Pt.value, (e) => (_(), a("span", {
3732
3867
  key: e.value,
3733
3868
  style: m({ left: e.pct + "%" })
3734
3869
  }, x(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
3735
3870
  (_(), a("svg", {
3736
3871
  ref_key: "svgRef",
3737
- ref: O,
3738
- viewBox: `0 0 ${Ne.value} ${G.value}`,
3872
+ ref: k,
3873
+ viewBox: `0 0 ${q.value} ${Fe.value}`,
3739
3874
  preserveAspectRatio: "xMidYMid meet"
3740
3875
  }, [o("g", {
3741
3876
  ref_key: "mapGroupRef",
3742
- ref: k
3877
+ ref: ne
3743
3878
  }, [o("g", {
3744
3879
  ref_key: "baseGroupRef",
3745
- ref: ne
3880
+ ref: A
3746
3881
  }, null, 512), o("g", {
3747
3882
  ref_key: "overlayGroupRef",
3748
- ref: A
3749
- }, null, 512)], 512)], 8, mr)),
3750
- xe.value ? (_(), a("button", {
3883
+ ref: j
3884
+ }, null, 512)], 512)], 8, pr)),
3885
+ be.value ? (_(), a("button", {
3751
3886
  key: 2,
3752
3887
  type: "button",
3753
3888
  class: "choropleth-reset",
3754
3889
  "aria-label": "Reset zoom",
3755
- onClick: U
3890
+ onClick: Ne
3756
3891
  }, " Reset ")) : i("", !0),
3757
- M.value ? (_(), r(cr, {
3892
+ ie.value ? (_(), r(sr, {
3758
3893
  key: 3,
3759
3894
  ref_key: "tooltipChildRef",
3760
- ref: j
3895
+ ref: M
3761
3896
  }, {
3762
- default: D((r) => [b(n.$slots, "tooltip", p(u(ee(r))), () => [t.tooltipFormat ? (_(), a("span", {
3897
+ default: D((t) => [b(n.$slots, "tooltip", p(u(T(t))), () => [c.tooltipFormat ? (_(), a("span", {
3763
3898
  key: 0,
3764
- innerHTML: t.tooltipFormat(r)
3765
- }, null, 8, hr)) : r.value == null ? (_(), a(e, { key: 1 }, [s(x(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(x(r.name) + ": " + x(at(r.value)), 1)], 64))], !0)]),
3899
+ innerHTML: c.tooltipFormat(t)
3900
+ }, null, 8, mr)) : t.value == null ? (_(), a(e, { key: 1 }, [s(x(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(x(t.name) + ": " + x(at(t.value)), 1)], 64))], !0)]),
3766
3901
  _: 3
3767
3902
  }, 512)) : i("", !0)
3768
- ], 2));
3903
+ ], 16)], 8, ["to", "disabled"]));
3769
3904
  }
3770
- }), [["__scopeId", "data-v-b11a80ed"]]), br = /* @__PURE__ */ L(/* @__PURE__ */ l({
3905
+ }), [["__scopeId", "data-v-96a5f36e"]]), xr = /* @__PURE__ */ L(/* @__PURE__ */ l({
3771
3906
  __name: "ChartTooltip",
3772
3907
  props: {
3773
3908
  x: {},
@@ -3791,7 +3926,7 @@ var Bt = {
3791
3926
  key: 1,
3792
3927
  open: e.open
3793
3928
  }, {
3794
- default: D(() => [c(C(re), { "as-child": "" }, {
3929
+ default: D(() => [c(C(M), { "as-child": "" }, {
3795
3930
  default: D(() => [o("div", {
3796
3931
  class: "chart-tooltip-anchor",
3797
3932
  style: m({
@@ -3801,7 +3936,7 @@ var Bt = {
3801
3936
  }, null, 4)]),
3802
3937
  _: 1
3803
3938
  }), c(C(ie), null, {
3804
- default: D(() => [e.open ? (_(), r(C(M), {
3939
+ default: D(() => [e.open ? (_(), r(C(re), {
3805
3940
  key: 0,
3806
3941
  class: "chart-tooltip-content",
3807
3942
  side: "right",
@@ -3818,7 +3953,7 @@ var Bt = {
3818
3953
  _: 3
3819
3954
  }, 8, ["open"])) : i("", !0);
3820
3955
  }
3821
- }), [["__scopeId", "data-v-44377f70"]]), xr = { class: "TableWrapper" }, Sr = ["href", "download"], Cr = /* @__PURE__ */ L(/* @__PURE__ */ l({
3956
+ }), [["__scopeId", "data-v-44377f70"]]), Sr = { class: "TableWrapper" }, Cr = ["href", "download"], wr = /* @__PURE__ */ L(/* @__PURE__ */ l({
3822
3957
  __name: "DataTable",
3823
3958
  props: {
3824
3959
  data: {},
@@ -3923,7 +4058,7 @@ var Bt = {
3923
4058
  return n.join("\n");
3924
4059
  }
3925
4060
  function E() {
3926
- Fe(T(), C());
4061
+ Pe(T(), C());
3927
4062
  }
3928
4063
  let D = n(() => c.downloadButton || c.downloadLink ? [] : [{
3929
4064
  label: c.downloadMenuLink,
@@ -3937,12 +4072,12 @@ var Bt = {
3937
4072
  "full-width": t.fullWidth,
3938
4073
  "has-menu": ne.value
3939
4074
  }]) }, [
3940
- ne.value ? (_(), r(pe, {
4075
+ ne.value ? (_(), r(fe, {
3941
4076
  key: 0,
3942
4077
  items: D.value,
3943
4078
  "force-dropdown": ""
3944
4079
  }, null, 8, ["items"])) : i("", !0),
3945
- o("div", xr, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
4080
+ o("div", Sr, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
3946
4081
  o("colgroup", null, [(_(!0), a(e, null, y(b.value, (e) => (_(), a("col", {
3947
4082
  key: e.name,
3948
4083
  style: m(u(e.name))
@@ -3968,9 +4103,9 @@ var Bt = {
3968
4103
  class: "data-table-download-link",
3969
4104
  href: k.value,
3970
4105
  download: `${C()}.csv`
3971
- }, x(O.value), 9, Sr)) : i("", !0)
4106
+ }, x(O.value), 9, Cr)) : i("", !0)
3972
4107
  ], 2));
3973
4108
  }
3974
4109
  }), [["__scopeId", "data-v-21721f41"]]);
3975
4110
  //#endregion
3976
- export { or as BarChart, br as ChartTooltip, yr as ChoroplethMap, Cr as DataTable, En as LineChart };
4111
+ export { ar as BarChart, xr as ChartTooltip, br as ChoroplethMap, wr as DataTable, Tn as LineChart };