@adyen/lume 1.12.3 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-expandable-nodes.d.ts +46 -0
  3. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-expandable-nodes.d.ts.map +1 -0
  4. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-graph.d.ts +2 -0
  5. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-graph.d.ts.map +1 -1
  6. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-hover.d.ts +22 -0
  7. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-hover.d.ts.map +1 -1
  8. package/dist/@types/components/groups/lume-alluvial-group/constants.d.ts +2 -0
  9. package/dist/@types/components/groups/lume-alluvial-group/constants.d.ts.map +1 -1
  10. package/dist/@types/components/groups/lume-alluvial-group/lume-alluvial-group.vue.d.ts +10 -0
  11. package/dist/@types/components/groups/lume-alluvial-group/lume-alluvial-group.vue.d.ts.map +1 -1
  12. package/dist/@types/docs/storybook-data/alluvial-data.d.ts +11 -0
  13. package/dist/@types/docs/storybook-data/alluvial-data.d.ts.map +1 -1
  14. package/dist/@types/types/alluvial.d.ts +4 -0
  15. package/dist/@types/types/alluvial.d.ts.map +1 -1
  16. package/dist/@types/types/events.d.ts +1 -1
  17. package/dist/@types/types/events.d.ts.map +1 -1
  18. package/dist/common/Aka2OjK8.js +5 -0
  19. package/dist/common/Aka2OjK8.js.map +1 -0
  20. package/dist/common/BAc0dIxQ.js +5 -0
  21. package/dist/common/BAc0dIxQ.js.map +1 -0
  22. package/dist/common/BkCJnqDA.js +5 -0
  23. package/dist/common/BkCJnqDA.js.map +1 -0
  24. package/dist/common/vDk1lu85.js +3425 -0
  25. package/dist/common/vDk1lu85.js.map +1 -0
  26. package/dist/index.js +1 -1
  27. package/dist/plugin.js +7 -7
  28. package/dist/scss/_utilities.scss +2 -2
  29. package/dist/scss/components/lume-alluvial-group.scss +24 -1
  30. package/dist/scss/main.scss +1 -1
  31. package/dist/styles/main.css +1 -1
  32. package/package.json +4 -4
  33. package/dist/common/BCtqE1q7.js +0 -5
  34. package/dist/common/BCtqE1q7.js.map +0 -1
  35. package/dist/common/BlUo1XWc.js +0 -5
  36. package/dist/common/BlUo1XWc.js.map +0 -1
  37. package/dist/common/DOtUyFcQ.js +0 -5
  38. package/dist/common/DOtUyFcQ.js.map +0 -1
  39. package/dist/common/DhrWnQlK.js +0 -3125
  40. package/dist/common/DhrWnQlK.js.map +0 -1
@@ -0,0 +1,3425 @@
1
+ import { defineComponent as R, ref as I, isRef as Lt, computed as f, watch as H, toRefs as F, inject as Ee, reactive as $e, onMounted as ae, watchEffect as Tt, onBeforeUnmount as Ot, useSlots as X, nextTick as Pe, provide as De, defineAsyncComponent as He } from "vue";
2
+ import { sankeyLinkHorizontal as Zt, sankey as Xt, sankeyJustify as Yt } from "d3-sankey";
3
+ import { format as Kt, ticks as Jt, scaleLinear as ge, scaleBand as ye, link as Qt, line as qt, area as en } from "d3";
4
+ import { createPopper as tn } from "@popperjs/core";
5
+ const nn = /* @__PURE__ */ R({
6
+ __name: "lume-tick",
7
+ props: {
8
+ value: {
9
+ type: [String, Number],
10
+ required: !0
11
+ },
12
+ group: {
13
+ type: Object,
14
+ required: !0
15
+ },
16
+ ghost: {
17
+ type: Object,
18
+ required: !0
19
+ },
20
+ label: {
21
+ type: Object,
22
+ required: !0
23
+ },
24
+ gridline: {
25
+ type: Object,
26
+ required: !0
27
+ },
28
+ isHovered: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ isHidden: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ withGridlines: {
37
+ type: Boolean,
38
+ default: !0
39
+ }
40
+ },
41
+ emits: ["click", "mouseenter"],
42
+ setup(t, { expose: e, emit: r }) {
43
+ const n = I(null);
44
+ return e({ ref: n }), { __sfc: !0, emit: r, labelRef: n };
45
+ }
46
+ });
47
+ function D(t, e, r, n, a, u, o, i) {
48
+ var l = typeof t == "function" ? t.options : t;
49
+ return e && (l.render = e, l.staticRenderFns = r, l._compiled = !0), u && (l._scopeId = "data-v-" + u), {
50
+ exports: t,
51
+ options: l
52
+ };
53
+ }
54
+ var rn = function() {
55
+ var e = this, r = e._self._c, n = e._self._setupProxy;
56
+ return r("g", e._b({ staticClass: "axis__tick", class: {
57
+ "axis__tick--hovered": e.isHovered,
58
+ "axis__tick--hidden": e.isHidden
59
+ }, attrs: { "data-j-axis__tick": "" }, on: { mouseenter: function(a) {
60
+ return n.emit("mouseenter", a);
61
+ }, click: function(a) {
62
+ return n.emit("click", a);
63
+ } } }, "g", e.group, !1), [r("g", { staticClass: "axis__tick-label lume-typography--axis", attrs: { "pointer-events": "all", "data-j-axis__tick-label": "" } }, [r("rect", e._b({ staticClass: "axis__ghost", attrs: { fill: "url(#lume-tick-gradient)" } }, "rect", e.ghost, !1)), r("text", e._b({ ref: "labelRef", staticClass: "axis__label" }, "text", e.label, !1), [e._v(" " + e._s(e.value) + " ")])]), e.withGridlines ? r("line", e._b({ staticClass: "axis__grid-line" }, "line", e.gridline, !1)) : e._e()]);
64
+ }, an = [], on = /* @__PURE__ */ D(
65
+ nn,
66
+ rn,
67
+ an,
68
+ !1,
69
+ null,
70
+ "59ddc0a6"
71
+ );
72
+ const un = on.exports, ln = [
73
+ "controls",
74
+ "legend",
75
+ "axes",
76
+ "groups",
77
+ "tooltip",
78
+ "tooltip-content"
79
+ ];
80
+ function It() {
81
+ return process.env.NODE_ENV === "production";
82
+ }
83
+ function Et(t) {
84
+ return (t == null ? void 0 : t.map(
85
+ (e) => e.values.map((r) => r == null ? void 0 : r.value).flat()
86
+ ).flat()) || [];
87
+ }
88
+ function Ze(t) {
89
+ return t.length === 1;
90
+ }
91
+ function sn(t) {
92
+ return !!t && t.every(
93
+ (e) => "color" in e
94
+ );
95
+ }
96
+ function Re(t) {
97
+ return !!t && typeof t == "object" && !Array.isArray(t);
98
+ }
99
+ function $t(t, e) {
100
+ const r = { ...t };
101
+ return Object.entries(e).forEach(([n, a]) => {
102
+ r[n] = Re(t[n]) && Re(a) ? $t(t[n], a) : a;
103
+ }), r;
104
+ }
105
+ function cn(t) {
106
+ return t != null && Re(t) && "value" in t;
107
+ }
108
+ function K(t) {
109
+ return (t == null ? void 0 : t.bandwidth) !== void 0;
110
+ }
111
+ function dn(t) {
112
+ return K(t) ? t.step() : Math.max(...t.range()) / Math.max(...t.domain());
113
+ }
114
+ function vn(t) {
115
+ const [e, r] = t.domain();
116
+ return e == null || r == null || e === 0 && r === 0;
117
+ }
118
+ const fn = (t, e) => {
119
+ if (!t)
120
+ throw new Error("Data is not a valid array");
121
+ if (t.length === 0)
122
+ throw new Error("Cannot get highest value from empty array");
123
+ t.some(
124
+ ({ values: n }) => n.length - 1 >= e
125
+ ) || re(J.IndexExceedsLengthOfDataSets);
126
+ };
127
+ function pn(t, e) {
128
+ var r;
129
+ return fn(t, e), ((r = t.reduce(
130
+ (n, a) => {
131
+ var u, o;
132
+ return (((u = n.values[e]) == null ? void 0 : u.value) ?? 0) > (((o = a.values[e]) == null ? void 0 : o.value) ?? 0) ? n : a;
133
+ }
134
+ ).values[e]) == null ? void 0 : r.value) || 0;
135
+ }
136
+ function Nt(t) {
137
+ const e = Lt(t) ? t.value : t;
138
+ if (!e)
139
+ throw new Error("No empty array can be created from specified data value");
140
+ const r = Math.max(
141
+ ...e.map((n) => n.values.length),
142
+ 0
143
+ );
144
+ return Array(r).fill(null);
145
+ }
146
+ function mn(t) {
147
+ return K(t) ? t.domain().length : Math.max(...t.domain());
148
+ }
149
+ function _n(t, e) {
150
+ return (r) => Math.round(t * (1 - r) + e * r);
151
+ }
152
+ function hn(t, e, r) {
153
+ const n = e, a = t.slice(0, n);
154
+ return t.slice(n).concat(a);
155
+ }
156
+ function ce(t) {
157
+ if (t.groups) {
158
+ const e = Object.keys(t);
159
+ return Object.assign(
160
+ {},
161
+ ...e.map((r) => r !== "groups" ? { [r]: t[r] } : {})
162
+ );
163
+ }
164
+ return t;
165
+ }
166
+ function gn(t) {
167
+ return Object.assign(
168
+ {},
169
+ ...Object.keys(t).map(
170
+ (e) => ln.includes(e) ? {} : { [e]: t[e] }
171
+ )
172
+ );
173
+ }
174
+ function Xe(t, e) {
175
+ const r = e - t.length;
176
+ return r > 0 ? [...t, ...Array(r).fill({ value: null })] : t;
177
+ }
178
+ var J = /* @__PURE__ */ ((t) => (t.DatasetLength = `Our guidelines highly recommend not having more than 5 datasets in one chart.
179
+ Learn more: https://lume.design/guidelines/datasets`, t.ColorLoop = "Colors will loop around after the 5th dataset. You can prevent this by setting specific colors for your datasets.", t.Empty = "The dataset(s) provided are empty.", t.InvalidFormat = "The string provided to format is invalid. Please refer to https://github.com/d3/d3-format for valid arguments.", t.NotContainedInSvg = "This component is an `SVGElement`, thus it is required to be inside an `<svg>` container.", t.InvalidHoveredIndex = "The provided hovered index is not valid for the data of this chart.", t.InvalidHoveredElement = "The provided hovered element is not valid for the data of this diagram.", t.IndexExceedsLengthOfDataSets = "Index exceeds length of all of the datasets", t))(J || {});
180
+ const yn = "[lume] ";
181
+ function re(t, e = !0) {
182
+ e && It() || console.warn(yn + "Warning: " + t);
183
+ }
184
+ const Oe = (t) => {
185
+ let e = null;
186
+ switch (typeof t) {
187
+ case "string":
188
+ try {
189
+ e = Kt(t);
190
+ } catch {
191
+ re(J.InvalidFormat), e = null;
192
+ }
193
+ break;
194
+ case "function":
195
+ e = t;
196
+ break;
197
+ default:
198
+ e = null;
199
+ }
200
+ function r(...n) {
201
+ return e ? e(...n) : n[0];
202
+ }
203
+ return r;
204
+ }, be = () => ({
205
+ options: {
206
+ type: Object,
207
+ default: () => ({})
208
+ }
209
+ });
210
+ function Q(t, e) {
211
+ return { allOptions: f(() => {
212
+ const n = Lt(e) ? e == null ? void 0 : e.value : e;
213
+ return n ? $t(n, t.value) : t.value;
214
+ }) };
215
+ }
216
+ const bn = 0.2;
217
+ function kn(t, e, r) {
218
+ const n = I(), a = f(() => Math.max(...t.value.range())), u = f(() => e.value.length);
219
+ function o() {
220
+ if (!e.value) return;
221
+ const l = e.value.reduce(
222
+ (s, v) => s + v.ref.getBoundingClientRect().width,
223
+ 0
224
+ ), c = Math.ceil(l / u.value);
225
+ n.value = c + c * bn;
226
+ }
227
+ function i(l) {
228
+ if (!e.value) return !0;
229
+ const c = r.value.skip, s = e.value.length;
230
+ if (l === 0) return !0;
231
+ const v = a.value / s, m = typeof c == "number" && c > 0 && c + 1 || Math.ceil(n.value / v);
232
+ return l % m === 0;
233
+ }
234
+ return H(e, o), { showTick: i };
235
+ }
236
+ const O = {
237
+ HORIZONTAL: "horizontal",
238
+ VERTICAL: "vertical"
239
+ }, xn = {
240
+ SINGLE: "single",
241
+ GROUPED: "grouped",
242
+ STACKED: "stacked"
243
+ }, wt = "No data", ot = 20, Dt = 0.33, Ht = 0.5, Pt = 12, ke = 8, An = 1, Ln = [
244
+ "auto",
245
+ "auto-start",
246
+ "auto-end",
247
+ "top",
248
+ "top-start",
249
+ "top-end",
250
+ "right",
251
+ "right-start",
252
+ "right-end",
253
+ "bottom",
254
+ "bottom-start",
255
+ "bottom-end",
256
+ "left",
257
+ "left-start",
258
+ "left-end"
259
+ ];
260
+ function Ne(t) {
261
+ t != null && t.closest("svg") || re(J.NotContainedInSvg);
262
+ }
263
+ const Rt = {
264
+ /** Displays a line for each tick. */
265
+ gridLines: !1,
266
+ /** Displays the axis title. */
267
+ withTitle: !0,
268
+ //
269
+ //// Tick settings
270
+ //
271
+ /** Controls if the tick labels should be displayed. */
272
+ showTicks: !0,
273
+ /** Amount of ticks to display in the axis. */
274
+ tickCount: 10,
275
+ /** Formatting string/function for the tick label. */
276
+ tickFormat: null,
277
+ /** Space between the tick label and the axis line. */
278
+ tickPadding: 12
279
+ }, Tn = {
280
+ ...Rt,
281
+ withTitle: !1,
282
+ skip: !0
283
+ }, On = {
284
+ ...Rt,
285
+ gridLines: !0
286
+ }, In = function(t, e, r) {
287
+ const n = f(() => t.value.step() * t.value.paddingInner() / 2);
288
+ function a(l, c) {
289
+ return {
290
+ transform: `translate(${(t.value(c) ?? t.value(l)) - n.value}, 0)`
291
+ };
292
+ }
293
+ function u(l) {
294
+ var s;
295
+ const c = Math.max(
296
+ t.value.step(),
297
+ (l ? (s = l.getComputedTextLength) == null ? void 0 : s.call(l) : t.value.step()) + 20
298
+ );
299
+ return {
300
+ x: -(c - t.value.step()) / 2,
301
+ width: c,
302
+ height: r.value.tickPadding + Pt + ke
303
+ };
304
+ }
305
+ function o() {
306
+ const l = t.value.step() / 2;
307
+ return {
308
+ x1: l,
309
+ x2: l,
310
+ y1: -e.value.height
311
+ // Negative height means it goes from bottom to top
312
+ };
313
+ }
314
+ function i() {
315
+ return {
316
+ x: t.value.step() / 2,
317
+ y: r.value.tickPadding,
318
+ dy: "0.8em",
319
+ "text-anchor": "middle"
320
+ };
321
+ }
322
+ return {
323
+ getGridLinesAttributes: o,
324
+ getTickGhostAttributes: u,
325
+ getTickGroupAttributes: a,
326
+ getTickLabelAttributes: i
327
+ };
328
+ }, En = function(t, e, r) {
329
+ const n = f(() => t.value.step() * t.value.paddingInner() / 2);
330
+ function a(l, c) {
331
+ return {
332
+ transform: `translate(0, ${(t.value(c) ?? t.value(l)) - n.value})`
333
+ };
334
+ }
335
+ function u(l) {
336
+ var s;
337
+ const c = (l ? (s = l.getComputedTextLength) == null ? void 0 : s.call(l) : 42) + r.value.tickPadding + ke;
338
+ return {
339
+ x: -c,
340
+ width: c,
341
+ height: t.value.step()
342
+ };
343
+ }
344
+ function o() {
345
+ const l = t.value.step() / 2;
346
+ return {
347
+ y1: l,
348
+ y2: l,
349
+ x1: e.value.width
350
+ };
351
+ }
352
+ function i() {
353
+ return {
354
+ x: -r.value.tickPadding,
355
+ y: t.value.step() / 2,
356
+ "text-anchor": "end",
357
+ "alignment-baseline": "middle"
358
+ };
359
+ }
360
+ return {
361
+ getGridLinesAttributes: o,
362
+ getTickGhostAttributes: u,
363
+ getTickGroupAttributes: a,
364
+ getTickLabelAttributes: i
365
+ };
366
+ }, $n = function(t, e, r) {
367
+ const n = f(() => {
368
+ const l = t.value.ticks();
369
+ return l.length > 1 ? t.value(l[1]) - t.value(l[0]) : 0;
370
+ });
371
+ function a(l) {
372
+ return {
373
+ transform: `translate(${t.value(l)}, 0)`
374
+ };
375
+ }
376
+ function u() {
377
+ return {
378
+ height: r.value.tickPadding + Pt + ke,
379
+ width: n.value,
380
+ x: -(n.value / 2)
381
+ };
382
+ }
383
+ function o() {
384
+ return {
385
+ y1: -e.value.height
386
+ };
387
+ }
388
+ function i() {
389
+ return {
390
+ y: r.value.tickPadding,
391
+ dy: "0.8em",
392
+ "text-anchor": "middle"
393
+ };
394
+ }
395
+ return {
396
+ getGridLinesAttributes: o,
397
+ getTickGhostAttributes: u,
398
+ getTickGroupAttributes: a,
399
+ getTickLabelAttributes: i
400
+ };
401
+ }, Nn = function(t, e, r) {
402
+ const n = f(() => {
403
+ const l = t.value.ticks();
404
+ return l.length > 1 ? t.value(l[1]) - t.value(l[0]) : 0;
405
+ });
406
+ function a(l) {
407
+ return {
408
+ transform: `translate(0, ${t.value(l)})`
409
+ };
410
+ }
411
+ function u(l) {
412
+ var s;
413
+ const c = (((s = l == null ? void 0 : l.getComputedTextLength) == null ? void 0 : s.call(l)) || 0) + r.value.tickPadding + ke;
414
+ return {
415
+ width: c,
416
+ height: n.value,
417
+ x: -c,
418
+ y: -(n.value / 2)
419
+ };
420
+ }
421
+ function o() {
422
+ return {
423
+ x1: e.value.width
424
+ };
425
+ }
426
+ function i() {
427
+ return {
428
+ x: -r.value.tickPadding,
429
+ dy: "0.4em",
430
+ "text-anchor": "end"
431
+ };
432
+ }
433
+ return {
434
+ getGridLinesAttributes: o,
435
+ getTickGhostAttributes: u,
436
+ getTickGroupAttributes: a,
437
+ getTickLabelAttributes: i
438
+ };
439
+ }, wn = {
440
+ "x-band-scale-axis": In,
441
+ "y-band-scale-axis": En,
442
+ "x-linear-scale-axis": $n,
443
+ "y-linear-scale-axis": Nn
444
+ };
445
+ var Se = /* @__PURE__ */ ((t) => (t.bandScale = "band-scale-axis", t.linearScale = "linear-scale-axis", t))(Se || {}), Ce = /* @__PURE__ */ ((t) => (t.left = "left", t.bottom = "bottom", t))(Ce || {}), Te = /* @__PURE__ */ ((t) => (t.x = "bottom", t.y = "left", t))(Te || {});
446
+ const Dn = /* @__PURE__ */ R({
447
+ __name: "lume-axis",
448
+ props: {
449
+ scale: {
450
+ type: Function,
451
+ default: null
452
+ },
453
+ type: {
454
+ type: String,
455
+ default: void 0,
456
+ validator: (t) => t in Te
457
+ },
458
+ position: {
459
+ type: String,
460
+ default: void 0,
461
+ validator: (t) => t in Ce
462
+ },
463
+ containerSize: {
464
+ type: Object,
465
+ default: () => ({ width: 0, height: 0 })
466
+ },
467
+ hoveredIndex: {
468
+ type: Number,
469
+ default: -1
470
+ },
471
+ orientation: {
472
+ type: String,
473
+ default: O.VERTICAL
474
+ },
475
+ ...be()
476
+ },
477
+ emits: ["mouseenter", "click", "mouseleave", "lume__internal--axis-size"],
478
+ setup(t, { emit: e }) {
479
+ const r = t, n = 16, { scale: a, containerSize: u, hoveredIndex: o, options: i, orientation: l } = F(r), c = Ee("isEmpty", I(!1)), s = $e({}), v = I(null), m = I(null), g = I(null), h = f(
480
+ () => r.type ? Te[r.type] : r.position
481
+ ), _ = f(
482
+ () => r.type || (h.value === "left" ? "y" : "x")
483
+ ), x = f(
484
+ () => _.value === "x" && l.value === O.VERTICAL || _.value === "y" && l.value === O.HORIZONTAL
485
+ ), { allOptions: d } = Q(
486
+ i,
487
+ _.value === "x" ? Tn : On
488
+ ), { showTick: p } = kn(a, v, d), y = f(
489
+ () => c.value || !a.value || vn(a.value)
490
+ ), b = f(() => {
491
+ var E, w, P, ne;
492
+ return _.value === "y" && y.value ? `translate(0, ${((E = u.value) == null ? void 0 : E.height) / 2})` : _.value === "x" && y.value ? `translate(-${((w = u.value) == null ? void 0 : w.width) / 2}, ${(P = u.value) == null ? void 0 : P.height})` : `translate(0, ${_.value === "x" ? (ne = u.value) == null ? void 0 : ne.height : 0})`;
493
+ }), A = f(() => {
494
+ if (!a.value) return [];
495
+ if (K(a.value))
496
+ return a.value.labels || a.value.domain();
497
+ const { tickCount: E } = d.value, [w, P] = a.value.domain();
498
+ return Jt(w, P, E);
499
+ }), $ = f(() => {
500
+ const { tickFormat: E } = d.value;
501
+ return Oe(E);
502
+ }), T = f(
503
+ () => d.value.withHover && x.value && o.value > -1
504
+ ), N = f(
505
+ () => d.value.tickPadding + ke || n
506
+ ), S = f(() => _.value === "x" ? (
507
+ // If x axis, get the tick height
508
+ Math.max(
509
+ ...(v.value || []).map(
510
+ (E) => {
511
+ var w, P;
512
+ return ((P = (w = E.ref).getBBox) == null ? void 0 : P.call(w).height) + N.value;
513
+ }
514
+ )
515
+ )
516
+ ) : (
517
+ // If y axis, get the tick width
518
+ Math.max(
519
+ ...(v.value || []).map(
520
+ (E) => {
521
+ var w, P;
522
+ return ((P = (w = E.ref).getBBox) == null ? void 0 : P.call(w).width) + N.value;
523
+ }
524
+ )
525
+ )
526
+ ));
527
+ function j(E) {
528
+ const { showTicks: w } = d.value;
529
+ return w === !1 ? "" : $.value(E);
530
+ }
531
+ function V(E, w, P) {
532
+ e("mouseenter", { index: x.value ? E : null, value: w, event: P });
533
+ }
534
+ function ee(E, w, P) {
535
+ e("click", { index: E, value: w, event: P });
536
+ }
537
+ function de(E) {
538
+ var w;
539
+ if (!(!v.value || !v.value.length))
540
+ return (w = v.value[E]) == null ? void 0 : w.ref;
541
+ }
542
+ function oe() {
543
+ g.value = A.value.map(
544
+ (E, w) => ({
545
+ value: j(E),
546
+ group: s.getTickGroupAttributes(E, w),
547
+ ghost: s.getTickGhostAttributes(de(w)),
548
+ label: s.getTickLabelAttributes(),
549
+ gridline: s.getGridLinesAttributes()
550
+ })
551
+ );
552
+ }
553
+ function te() {
554
+ g.value && g.value.map((E) => (E.gridline = s.getGridLinesAttributes(), E));
555
+ }
556
+ function ue() {
557
+ if (!a.value) return;
558
+ const E = a.value.step ? "bandScale" : "linearScale", w = wn[`${_.value}-${Se[E]}`];
559
+ Object.entries(w(a, u, d) || []).forEach(
560
+ ([P, ne]) => {
561
+ s[P] = ne;
562
+ }
563
+ );
564
+ }
565
+ return H(a, ue, { flush: "sync", immediate: !0 }), H(a, oe, { immediate: !0 }), H(v, oe), H(S, (E) => e("lume__internal--axis-size", E)), H(r.containerSize, te), ae(() => Ne(m.value)), { __sfc: !0, SCALE_MIXIN_MAP: Se, POSITIONS: Ce, TYPES: Te, AXIS_LABEL_OFFSET: n, props: r, emit: e, scale: a, containerSize: u, hoveredIndex: o, options: i, orientation: l, isEmpty: c, mixins: s, tickRefs: v, root: m, ticksWithAttributes: g, computedPosition: h, computedType: _, shouldHover: x, allOptions: d, showTick: p, alignAxisBaseline: y, axisTransform: b, ticks: A, tickFormatter: $, isHovering: T, axisLabelOffset: N, axisSize: S, formatTick: j, handleTickMouseenter: V, handleTickClick: ee, getTextNode: de, setTicks: oe, updateGridlines: te, init: ue, LumeTick: un };
566
+ }
567
+ });
568
+ var Hn = function() {
569
+ var e = this, r = e._self._c, n = e._self._setupProxy;
570
+ return n.scale ? r("g", { ref: "root", staticClass: "axis", attrs: { transform: n.axisTransform, "data-j-axis": "" }, on: { mouseleave: function(a) {
571
+ return n.emit("mouseleave", a);
572
+ } } }, [n.computedType === "x" ? r("defs", [r("linearGradient", { attrs: { id: "lume-tick-gradient" } }, [r("stop", { attrs: { offset: "0%", "stop-color": "rgba(255,255,255,0)" } }), r("stop", { attrs: { offset: "10%", "stop-color": "var(--lume-chart-background-color)" } }), r("stop", { attrs: { offset: "90%", "stop-color": "var(--lume-chart-background-color)" } }), r("stop", { attrs: { offset: "100%", "stop-color": "rgba(255,255,255,0)" } })], 1)], 1) : e._e(), e._l(n.ticksWithAttributes, function(a, u) {
573
+ return r(n.LumeTick, e._b({ key: `${a.value}_${u}`, ref: "tickRefs", refInFor: !0, attrs: { "is-hidden": n.allOptions.skip && !n.showTick(u), "with-gridlines": n.allOptions.gridLines }, on: { mouseenter: function(o) {
574
+ return n.handleTickMouseenter(u, a.value, o);
575
+ }, click: function(o) {
576
+ return n.handleTickClick(u, a.value, o);
577
+ } } }, "lume-tick", a, !1));
578
+ }), n.isHovering ? r(n.LumeTick, e._b({ attrs: { "with-gridlines": !1, "is-hovered": "" }, on: { click: function(a) {
579
+ return n.handleTickClick(
580
+ n.hoveredIndex,
581
+ n.ticksWithAttributes[n.hoveredIndex].value,
582
+ a
583
+ );
584
+ } } }, "lume-tick", n.ticksWithAttributes[n.hoveredIndex], !1)) : e._e()], 2) : e._e();
585
+ }, Pn = [], Rn = /* @__PURE__ */ D(
586
+ Dn,
587
+ Hn,
588
+ Pn,
589
+ !1,
590
+ null,
591
+ null
592
+ );
593
+ const Sn = Rn.exports;
594
+ function Cn(t, e, r, n) {
595
+ const a = f(() => r.value > 0 && r.value < 1), u = f(
596
+ () => n.value > 0 && n.value < 1
597
+ ), o = f(
598
+ () => a.value ? t.value - 0.5 : t.value
599
+ // draws the 1px bar closer to the axis
600
+ ), i = f(
601
+ () => u.value ? e.value - 0.5 : e.value
602
+ // draws the 1px bar closer to the axis
603
+ );
604
+ return { computedX: o, computedY: i, shouldHaveMinWidth: a, shouldHaveMinHeight: u };
605
+ }
606
+ function Bn(t, e, r, n) {
607
+ const a = I(0), u = I(0), o = f(() => `${t.value + r.value / 2}px ${e.value + n.value / 2}px`);
608
+ return ae(() => {
609
+ a.value = r.value, u.value = n.value;
610
+ }), H(r, (i) => a.value = i), H(n, (i) => u.value = i), { computedWidth: a, computedHeight: u, transformOrigin: o };
611
+ }
612
+ const Gn = /* @__PURE__ */ R({
613
+ __name: "lume-bar",
614
+ props: {
615
+ x: {
616
+ type: Number,
617
+ default: 0
618
+ },
619
+ y: {
620
+ type: Number,
621
+ default: 0
622
+ },
623
+ width: {
624
+ type: Number,
625
+ required: !0
626
+ },
627
+ height: {
628
+ type: Number,
629
+ required: !0
630
+ },
631
+ classList: {
632
+ type: [String, Array],
633
+ default: ""
634
+ },
635
+ isFaded: {
636
+ type: Boolean,
637
+ default: !1
638
+ },
639
+ isNegative: {
640
+ type: Boolean,
641
+ default: !1
642
+ },
643
+ transition: {
644
+ type: [String, Boolean],
645
+ default: !1
646
+ }
647
+ },
648
+ emits: ["click", "mouseover", "mouseleave"],
649
+ setup(t, { emit: e }) {
650
+ const r = t, { x: n, y: a, width: u, height: o, transition: i, classList: l } = F(r), c = I(null), s = f(
651
+ () => typeof l.value == "string" ? [l.value] : l.value
652
+ ), v = f(() => i.value === "width"), m = f(() => i.value === "height"), g = Bn(n, a, u, o), { computedX: h, computedY: _, shouldHaveMinWidth: x, shouldHaveMinHeight: d } = Cn(n, a, u, o), p = f(() => x.value ? 1 : (v.value ? g.computedWidth : u).value), y = f(() => d.value ? 1 : (m.value ? g.computedHeight : o).value), b = v.value || m.value ? g.transformOrigin : null;
653
+ return ae(() => Ne(c.value)), { __sfc: !0, props: r, emit: e, x: n, y: a, width: u, height: o, transition: i, classList: l, root: c, computedClasses: s, shouldTransitionWidth: v, shouldTransitionHeight: m, transitionProps: g, computedX: h, computedY: _, shouldHaveMinWidth: x, shouldHaveMinHeight: d, computedWidth: p, computedHeight: y, transformOrigin: b };
654
+ }
655
+ });
656
+ var Fn = function() {
657
+ var e = this, r = e._self._c, n = e._self._setupProxy;
658
+ return r("rect", { ref: "root", staticClass: "lume-bar", class: [
659
+ {
660
+ "lume-fill--faded": e.isFaded,
661
+ "lume-bar--negative": e.isNegative,
662
+ "lume-bar--transition-width": n.shouldTransitionWidth,
663
+ "lume-bar--transition-height": n.shouldTransitionHeight
664
+ },
665
+ ...n.computedClasses
666
+ ], style: { transformOrigin: n.transformOrigin }, attrs: { x: n.computedX, y: n.computedY, width: n.computedWidth, height: n.computedHeight, "data-j-bar": "" }, on: { click: function(a) {
667
+ return n.emit("click", a);
668
+ }, mouseover: function(a) {
669
+ return n.emit("mouseover", a);
670
+ }, mouseleave: function(a) {
671
+ return n.emit("mouseleave", a);
672
+ } } });
673
+ }, jn = [], Vn = /* @__PURE__ */ D(
674
+ Gn,
675
+ Fn,
676
+ jn,
677
+ !1,
678
+ null,
679
+ "8e8f732a"
680
+ );
681
+ const Ye = Vn.exports;
682
+ var ie = /* @__PURE__ */ ((t) => (t.Categorical = "categorical", t.Sequential = "sequential", t.Divergent = "divergent", t))(ie || {}), Y = /* @__PURE__ */ ((t) => (t.Skyblue = "skyblue", t.Royalblue = "royalblue", t.Violet = "violet", t.Darkteal = "darkteal", t.Gold = "gold", t))(Y || {}), St = /* @__PURE__ */ ((t) => (t.Skyblue10 = "skyblue-10", t.Skyblue20 = "skyblue-20", t.Skyblue30 = "skyblue-30", t.Skyblue40 = "skyblue-40", t.Skyblue50 = "skyblue-50", t.Skyblue60 = "skyblue-60", t.Skyblue70 = "skyblue-70", t.Skyblue80 = "skyblue-80", t.Skyblue90 = "skyblue-90", t.Skyblue100 = "skyblue-100", t.Royalblue10 = "royalblue-10", t.Royalblue20 = "royalblue-20", t.Royalblue30 = "royalblue-30", t.Royalblue40 = "royalblue-40", t.Royalblue50 = "royalblue-50", t.Royalblue60 = "royalblue-60", t.Royalblue70 = "royalblue-70", t.Royalblue80 = "royalblue-80", t.Royalblue90 = "royalblue-90", t.Royalblue100 = "royalblue-100", t.Violet10 = "violet-10", t.Violet20 = "violet-20", t.Violet30 = "violet-30", t.Violet40 = "violet-40", t.Violet50 = "violet-50", t.Violet60 = "violet-60", t.Violet70 = "violet-70", t.Violet80 = "violet-80", t.Violet90 = "violet-90", t.Violet100 = "violet-100", t.Darkteal10 = "darkteal-10", t.Darkteal20 = "darkteal-20", t.Darkteal30 = "darkteal-30", t.Darkteal40 = "darkteal-40", t.Darkteal50 = "darkteal-50", t.Darkteal60 = "darkteal-60", t.Darkteal70 = "darkteal-70", t.Darkteal80 = "darkteal-80", t.Darkteal90 = "darkteal-90", t.Darkteal100 = "darkteal-100", t.Gold10 = "gold-10", t.Gold20 = "gold-20", t.Gold30 = "gold-30", t.Gold40 = "gold-40", t.Gold50 = "gold-50", t.Gold60 = "gold-60", t.Gold70 = "gold-70", t.Gold80 = "gold-80", t.Gold90 = "gold-90", t.Gold100 = "gold-100", t))(St || {}), Ke = /* @__PURE__ */ ((t) => (t.SkyTeal = "skyblue-darkteal", t.VioletRoyal = "violet-royalblue", t.VioletTeal = "violet-darkteal", t.GoldTeal = "gold-darkteal", t.GoldRoyal = "gold-royalblue", t))(Ke || {}), Je = /* @__PURE__ */ ((t) => (t.White = "white", t.Black = "black", t.Green = "green", t.Orange = "orange", t.Red = "red", t.Grey = "grey", t.Grey10 = "grey-10", t.Grey20 = "grey-20", t.Grey30 = "grey-30", t.Grey40 = "grey-40", t.Grey50 = "grey-50", t.Grey60 = "grey-60", t.Grey70 = "grey-70", t.Grey80 = "grey-80", t.Grey90 = "grey-90", t.Grey100 = "grey-100", t))(Je || {}), Qe = /* @__PURE__ */ ((t) => (t["01"] = "01", t["02"] = "02", t["03"] = "03", t["04"] = "04", t["05"] = "05", t["06"] = "06", t["07"] = "07", t["08"] = "08", t["09"] = "09", t))(Qe || {});
683
+ const Mn = ie.Categorical, xe = Y.Skyblue, zn = Ke.SkyTeal;
684
+ function Wn(t) {
685
+ return t === ie.Divergent ? zn : xe;
686
+ }
687
+ function Un(t) {
688
+ return Object.values(Qe).includes(t);
689
+ }
690
+ function ut(t, e) {
691
+ return e === ie.Divergent ? Object.values(Ke).includes(t) : Object.values({
692
+ ...Y,
693
+ ...St,
694
+ ...Je,
695
+ ...Qe
696
+ }).includes(t);
697
+ }
698
+ function Zn(t, e) {
699
+ const r = Object.values(Y).indexOf(t);
700
+ return hn(Object.values(Y), r > -1 ? r : 0)[e];
701
+ }
702
+ function Xn(t, e) {
703
+ const r = 50 + e * 10;
704
+ return `${t}-${r}`;
705
+ }
706
+ function Yn(t, e) {
707
+ const r = (e + 1) * 10;
708
+ return `${t}-${r}`;
709
+ }
710
+ function lt(t, e, r) {
711
+ switch (e) {
712
+ default:
713
+ case ie.Categorical:
714
+ return Un(t) ? t : Zn(t, r);
715
+ case ie.Sequential:
716
+ return Xn(t, r);
717
+ case ie.Divergent:
718
+ return Yn(t, r);
719
+ }
720
+ }
721
+ function Kn(t, e, r = Mn, n) {
722
+ return ut(t, r) ? t : (n > 4 && (re(J.ColorLoop), n = n % 5), ut(e, r) ? lt(e, r, n) : lt(Wn(r), r, n));
723
+ }
724
+ function Jn(t) {
725
+ return t.map((e) => cn(e) ? e : { value: e });
726
+ }
727
+ function Qn(t) {
728
+ return t.__internal === !0;
729
+ }
730
+ const qe = (t = null) => ({
731
+ data: {
732
+ type: Array,
733
+ required: !0,
734
+ validator: t || void 0
735
+ },
736
+ labels: {
737
+ type: Array,
738
+ default: void 0
739
+ },
740
+ color: {
741
+ type: String,
742
+ default: Y.Skyblue
743
+ },
744
+ title: {
745
+ type: String,
746
+ default: null
747
+ }
748
+ });
749
+ function et(t, e, r, n, a) {
750
+ const u = $e({
751
+ width: 0,
752
+ height: 0
753
+ }), o = crypto.randomUUID(), i = f(() => {
754
+ var s;
755
+ return t.value.length > 5 && re(J.DatasetLength), (s = t.value) == null ? void 0 : s.map(
756
+ (v, m) => {
757
+ if (Qn(v)) return v;
758
+ const g = Jn(v.values), h = Kn(
759
+ v.color,
760
+ r == null ? void 0 : r.value,
761
+ n == null ? void 0 : n.value.colorPalette,
762
+ m
763
+ );
764
+ return {
765
+ ...v,
766
+ values: g,
767
+ color: h,
768
+ __internal: !0
769
+ };
770
+ }
771
+ );
772
+ }), l = f(() => Array.isArray(e.value) ? e.value : Nt(t.value).map((s, v) => v));
773
+ function c(s) {
774
+ const v = (a == null ? void 0 : a.value) === O.HORIZONTAL && l.value.length * (((n == null ? void 0 : n.value.barHeight) || ot) * 2) + ((n == null ? void 0 : n.value.barHeight) || ot) || s.height;
775
+ u.width = s.width, u.height = v;
776
+ }
777
+ return {
778
+ chartID: o,
779
+ computedLabels: l,
780
+ containerSize: u,
781
+ internalData: i,
782
+ updateSize: c
783
+ };
784
+ }
785
+ const qn = () => ({
786
+ xScale: {
787
+ type: Function,
788
+ default: null
789
+ },
790
+ yScale: {
791
+ type: Function,
792
+ default: null
793
+ }
794
+ });
795
+ function er(t, e, r, n, a) {
796
+ const u = I(null), o = I(null);
797
+ function i() {
798
+ var s, v, m, g;
799
+ const { width: l, height: c } = r;
800
+ !l && !c || (n.value === O.HORIZONTAL ? (u.value = (s = t.value) != null && s.length ? st(
801
+ t.value,
802
+ l,
803
+ n.value,
804
+ a.value.startOnZero
805
+ ) : null, o.value = (v = e.value) != null && v.length ? it(
806
+ e.value,
807
+ c,
808
+ n.value,
809
+ a.value
810
+ ) : null) : (u.value = (m = e.value) != null && m.length ? it(
811
+ e.value,
812
+ l,
813
+ n.value,
814
+ a.value
815
+ ) : null, o.value = (g = t.value) != null && g.length ? st(
816
+ t.value,
817
+ c,
818
+ n.value,
819
+ a.value.startOnZero
820
+ ) : null));
821
+ }
822
+ return Tt(i), { xScale: u, yScale: o };
823
+ }
824
+ function it(t, e, r, n) {
825
+ const a = [0, e], { padding: u, paddingInner: o, paddingOuter: i } = n, l = u ?? (r === O.HORIZONTAL ? Ht : Dt);
826
+ return Object.assign(
827
+ ye().range(a).paddingInner(o ?? l).paddingOuter(i ?? l).domain(t.map((c, s) => s)),
828
+ { labels: t }
829
+ );
830
+ }
831
+ function st(t, e, r, n) {
832
+ const a = Et(t).filter((s) => s != null), u = [0, e];
833
+ if (a.length === 0)
834
+ return ge().range(u).domain([0, 0]).nice();
835
+ const o = Math.min(...a), i = n && o > 0 ? 0 : o;
836
+ let l = Math.max(...a);
837
+ n && l < 0 && (l = 0);
838
+ const c = r === O.HORIZONTAL ? [i, l] : [l, i];
839
+ return ge().range(u).domain(c).nice();
840
+ }
841
+ function ct(t) {
842
+ return (t == null ? void 0 : t.range) !== void 0 || (t == null ? void 0 : t.copy) !== void 0;
843
+ }
844
+ function Be(t, e) {
845
+ return K(t) ? t.bandwidth() / 2 + t(t.domain()[e]) : t(e);
846
+ }
847
+ function dt(t, e, {
848
+ padding: r,
849
+ paddingInner: n,
850
+ paddingOuter: a
851
+ } = {}) {
852
+ const u = r ?? (e === O.HORIZONTAL ? Ht : Dt);
853
+ return t.copy().paddingInner(n ?? u).paddingOuter(a ?? u);
854
+ }
855
+ function tt(t) {
856
+ return Object.values(O).includes(t);
857
+ }
858
+ const me = (t, e = !0) => ({
859
+ ...qe(t),
860
+ ...qn(),
861
+ ...be(),
862
+ classList: {
863
+ type: [String, Array],
864
+ default: () => []
865
+ },
866
+ hoveredIndex: {
867
+ type: Number,
868
+ default: null
869
+ },
870
+ ...e ? {
871
+ orientation: {
872
+ type: String,
873
+ default: O.VERTICAL,
874
+ validator: tt
875
+ }
876
+ } : {}
877
+ }), tr = (t) => ({
878
+ ...qe(t),
879
+ ...be(),
880
+ hoveredElement: {
881
+ type: [Number, String],
882
+ default: null
883
+ }
884
+ });
885
+ function nr() {
886
+ const t = I(), e = $e({
887
+ dimensions: {}
888
+ }), r = new ResizeObserver((n) => {
889
+ n.forEach((a) => {
890
+ e.dimensions = a.contentRect;
891
+ });
892
+ });
893
+ return ae(() => {
894
+ r.observe(t.value);
895
+ }), Ot(() => {
896
+ r.unobserve(t.value);
897
+ }), { resizeState: e, resizeRef: t };
898
+ }
899
+ const rr = /* @__PURE__ */ R({
900
+ __name: "lume-chart-container",
901
+ props: {
902
+ margins: {
903
+ type: Object,
904
+ required: !0
905
+ },
906
+ containerSize: {
907
+ type: Object,
908
+ default: () => ({ width: 0, height: 0 })
909
+ },
910
+ transparentBackground: {
911
+ type: Boolean,
912
+ default: !1
913
+ },
914
+ noMinSize: {
915
+ type: Boolean,
916
+ default: !1
917
+ },
918
+ orientation: {
919
+ type: String,
920
+ default: O.VERTICAL,
921
+ validator: tt
922
+ }
923
+ },
924
+ emits: ["click", "mouseenter", "mouseleave", "resize"],
925
+ setup(t, { emit: e }) {
926
+ const r = t, { margins: n, containerSize: a } = F(r), u = I(null), { resizeRef: o, resizeState: i } = nr(), l = f(
927
+ () => a.value.height + n.value.top + n.value.bottom
928
+ );
929
+ return Tt(() => {
930
+ if (!u.value) return;
931
+ const { width: c } = i.dimensions, { height: s } = u.value.getBoundingClientRect();
932
+ if (!c || r.orientation === O.VERTICAL && !s)
933
+ return;
934
+ const v = c - n.value.left - n.value.right, m = s - n.value.top - n.value.bottom, g = {
935
+ width: v > 0 ? v : 0,
936
+ height: m > 0 ? m : 0,
937
+ outerWidth: c,
938
+ outerHeight: s
939
+ };
940
+ e("resize", g);
941
+ }), { __sfc: !0, props: r, emit: e, margins: n, containerSize: a, root: u, resizeRef: o, resizeState: i, svgHeight: l };
942
+ }
943
+ });
944
+ var ar = function() {
945
+ var e = this, r = e._self._c, n = e._self._setupProxy;
946
+ return r("div", { ref: "resizeRef", staticClass: "lume-chart-container", class: {
947
+ "lume-chart-container--minimum": !e.noMinSize
948
+ }, attrs: { "data-j-chart-container": "" } }, [e._t("header"), r("svg", { ref: "root", staticClass: "lume-chart-container__svg", class: {
949
+ "lume-chart-container__svg--transparent": e.transparentBackground
950
+ }, attrs: { height: n.svgHeight, "data-j-chart-container__root": "" }, on: { click: function(a) {
951
+ return n.emit("click", a);
952
+ }, mouseenter: function(a) {
953
+ return n.emit("mouseenter", a);
954
+ }, mouseleave: function(a) {
955
+ return n.emit("mouseleave", a);
956
+ } } }, [r("g", { staticClass: "lume-chart-container__group", attrs: { transform: `translate(${n.margins.left}, ${n.margins.top})`, "data-j-chart-container__group": "" } }, [e._t("default")], 2)]), e._t("footer"), e._t("extra")], 2);
957
+ }, or = [], ur = /* @__PURE__ */ D(
958
+ rr,
959
+ ar,
960
+ or,
961
+ !1,
962
+ null,
963
+ "d53cdc3e"
964
+ );
965
+ const lr = ur.exports, ir = /* @__PURE__ */ R({
966
+ __name: "lume-chart-legend",
967
+ props: {
968
+ data: {
969
+ type: Array,
970
+ validator: sn,
971
+ required: !0
972
+ }
973
+ },
974
+ emits: ["click", "mouseenter", "mouseleave"],
975
+ setup(t, { emit: e }) {
976
+ return { __sfc: !0, emit: e };
977
+ }
978
+ });
979
+ var sr = function() {
980
+ var e = this, r = e._self._c, n = e._self._setupProxy;
981
+ return r("div", { staticClass: "lume-chart-legend", attrs: { "data-j-chart-legend": "" }, on: { mouseleave: function(a) {
982
+ return n.emit("mouseleave");
983
+ } } }, e._l(e.data, function(a, u) {
984
+ return r("div", { key: `legend-item-${u}`, staticClass: "lume-chart-legend__item lume-typography--caption", attrs: { tabindex: "0", "data-j-chart-legend__symbol-wrapper": "" }, on: { click: function(o) {
985
+ return n.emit("click", { index: u, dataset: a, event: o });
986
+ }, mouseenter: function(o) {
987
+ return n.emit("mouseenter", { index: u, dataset: a, event: o });
988
+ } } }, [r("span", { staticClass: "lume-chart-legend__symbol", class: `lume-background-color--${a.color}`, attrs: { "data-j-chart-legend__symbol": "" } }), e._v(" " + e._s(a.label || u) + " ")]);
989
+ }), 0);
990
+ }, cr = [], dr = /* @__PURE__ */ D(
991
+ ir,
992
+ sr,
993
+ cr,
994
+ !1,
995
+ null,
996
+ "6f1d1c44"
997
+ );
998
+ const vr = dr.exports, fr = {};
999
+ var pr = function() {
1000
+ var e = this, r = e._self._c;
1001
+ return r("div", { staticClass: "lume-tooltip__title", attrs: { "data-j-tooltip__title": "" } }, [e._t("default")], 2);
1002
+ }, mr = [], _r = /* @__PURE__ */ D(
1003
+ fr,
1004
+ pr,
1005
+ mr,
1006
+ !1,
1007
+ null,
1008
+ "8af3fac6"
1009
+ );
1010
+ const hr = _r.exports, gr = {};
1011
+ var yr = function() {
1012
+ var e = this, r = e._self._c;
1013
+ return r("li", { staticClass: "lume-tooltip__item", attrs: { "data-j-tooltip__summary-item": "" } }, [r("span", [e._t("default")], 2), r("strong", { staticClass: "lume-tooltip__value" }, [e._t("value")], 2)]);
1014
+ }, br = [], kr = /* @__PURE__ */ D(
1015
+ gr,
1016
+ yr,
1017
+ br,
1018
+ !1,
1019
+ null,
1020
+ "4ed7ec1b"
1021
+ );
1022
+ const xr = kr.exports, Ar = /* @__PURE__ */ R({
1023
+ __name: "lume-tooltip-item",
1024
+ props: {
1025
+ color: {
1026
+ type: String,
1027
+ default: null
1028
+ }
1029
+ },
1030
+ setup(t) {
1031
+ return { __sfc: !0 };
1032
+ }
1033
+ });
1034
+ var Lr = function() {
1035
+ var e = this, r = e._self._c;
1036
+ return e._self._setupProxy, r("li", { staticClass: "lume-tooltip__item", attrs: { "data-j-tooltip__item": "" } }, [e.color ? r("span", { staticClass: "lume-tooltip__symbol", class: [`lume-background-color--${e.color}`], attrs: { "data-j-tooltip__item__symbol": "" } }) : e._e(), r("span", { attrs: { "data-j-tooltip__item__label": "" } }, [e._t("label")], 2), r("strong", { staticClass: "lume-tooltip__value", attrs: { "data-j-tooltip__item__value": "" } }, [e._t("value")], 2)]);
1037
+ }, Tr = [], Or = /* @__PURE__ */ D(
1038
+ Ar,
1039
+ Lr,
1040
+ Tr,
1041
+ !1,
1042
+ null,
1043
+ "4f995c3c"
1044
+ );
1045
+ const Ir = Or.exports, Er = /* @__PURE__ */ R({
1046
+ __name: "lume-tooltip",
1047
+ props: {
1048
+ opened: {
1049
+ type: Boolean,
1050
+ default: !1
1051
+ },
1052
+ targetElement: {
1053
+ type: Element,
1054
+ default: null
1055
+ },
1056
+ items: {
1057
+ type: Array,
1058
+ required: !0
1059
+ },
1060
+ position: {
1061
+ type: String,
1062
+ default: "auto",
1063
+ validator: (t) => Ln.includes(t)
1064
+ },
1065
+ fixedPositioning: {
1066
+ type: Boolean,
1067
+ default: !1
1068
+ },
1069
+ inverse: {
1070
+ type: Boolean,
1071
+ default: !1
1072
+ },
1073
+ modifiers: {
1074
+ type: Array,
1075
+ default: null
1076
+ },
1077
+ title: {
1078
+ type: [String, Number],
1079
+ default: null
1080
+ },
1081
+ summary: {
1082
+ type: String,
1083
+ default: null
1084
+ },
1085
+ ...be()
1086
+ },
1087
+ emits: ["opened", "moved", "closed", "tooltip-mouseenter", "tooltip-mouseleave"],
1088
+ setup(t, { emit: e }) {
1089
+ const r = t, n = I(null), { items: a, options: u } = F(r), o = X(), i = I(null), { allOptions: l } = Q(u), c = f(
1090
+ () => l.value.fixedPositioning ?? r.fixedPositioning
1091
+ ), s = f(
1092
+ () => c.value ? "fixed" : "absolute"
1093
+ ), v = f(() => [
1094
+ {
1095
+ name: "computeStyles",
1096
+ options: {
1097
+ adaptive: !1
1098
+ // so that we can have smooth transitions
1099
+ }
1100
+ },
1101
+ {
1102
+ name: "offset",
1103
+ options: { offset: [0, l.value.offset || 8] }
1104
+ },
1105
+ ...r.modifiers || []
1106
+ ]), m = f(
1107
+ () => l.value.showTitle !== !1 && r.title != null
1108
+ ), g = f(() => Oe(l.value.valueFormat)), h = f(() => Oe(l.value.titleFormat)), _ = f(
1109
+ () => {
1110
+ var A;
1111
+ return ((A = a.value) == null ? void 0 : A.find(($) => $.isSummary)) || {
1112
+ label: l.value.summary ?? r.summary
1113
+ };
1114
+ }
1115
+ ), x = f(() => o.summary || _.value.label), d = f(() => r.inverse || l.value.inverse ? [...a.value].reverse() : a.value);
1116
+ function p() {
1117
+ r.targetElement && n.value && (i.value = tn(r.targetElement, n.value, {
1118
+ placement: r.position,
1119
+ strategy: s.value,
1120
+ modifiers: v.value
1121
+ }), e("opened", r.targetElement));
1122
+ }
1123
+ function y() {
1124
+ i.value && (i.value.destroy(), e("closed"), n.value && n.value.classList.remove("lume-tooltip--animated"));
1125
+ }
1126
+ function b() {
1127
+ i.value && (l.value.withAnimation !== !1 && n.value && n.value.classList.add("lume-tooltip--animated"), r.targetElement ? (function() {
1128
+ i.value.state.elements.reference = r.targetElement, i.value.update(), e("moved", r.targetElement);
1129
+ })() : y());
1130
+ }
1131
+ return H(
1132
+ () => r.targetElement,
1133
+ async (A, $) => {
1134
+ !$ && A ? (await Pe(), p()) : b();
1135
+ }
1136
+ ), ae(p), Ot(y), { __sfc: !0, props: r, emit: e, root: n, items: a, options: u, slots: o, popper: i, allOptions: l, computedFixedPositioning: c, strategy: s, allModifiers: v, showTitle: m, formatValue: g, formatTitle: h, summaryItem: _, hasSummary: x, computedItems: d, initPopper: p, destroyPopper: y, updatePopper: b, LumeTooltipTitle: hr, LumeTooltipSummary: xr, LumeTooltipItem: Ir };
1137
+ }
1138
+ });
1139
+ var $r = function() {
1140
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1141
+ return e.opened && e.targetElement ? r("div", { ref: "root", staticClass: "lume-tooltip lume-typography--caption", class: {
1142
+ "lume-tooltip--pointer-events": n.options.withPointerEvents
1143
+ }, attrs: { "data-j-tooltip": "" }, on: { mouseenter: function(a) {
1144
+ return n.emit("tooltip-mouseenter");
1145
+ }, mouseleave: function(a) {
1146
+ return n.emit("tooltip-mouseleave");
1147
+ } } }, [e._t("default", function() {
1148
+ return [e._t("title", function() {
1149
+ return [n.showTitle ? r(n.LumeTooltipTitle, [e._v(" " + e._s(n.formatTitle(e.title)) + " ")]) : e._e()];
1150
+ }), r("ul", { staticClass: "lume-tooltip__items" }, [e._t("summary", function() {
1151
+ return [n.hasSummary ? r(n.LumeTooltipSummary, { scopedSlots: e._u([n.summaryItem.value ? { key: "value", fn: function() {
1152
+ return [e._v(" " + e._s(n.formatValue(n.summaryItem.value)) + " ")];
1153
+ }, proxy: !0 } : null], null, !0) }, [e._v(" " + e._s(n.summaryItem.label) + " ")]) : e._e()];
1154
+ }), n.hasSummary ? r("li", { staticClass: "lume-tooltip__break" }, [r("hr")]) : e._e(), e._t("items", function() {
1155
+ return e._l(n.computedItems, function(a) {
1156
+ return r(n.LumeTooltipItem, { key: a.label, attrs: { color: a.color }, scopedSlots: e._u([{ key: "label", fn: function() {
1157
+ return [e._v(" " + e._s(a.label) + " ")];
1158
+ }, proxy: !0 }, { key: "value", fn: function() {
1159
+ return [e._v(" " + e._s(n.formatValue(a.value)) + " ")];
1160
+ }, proxy: !0 }], null, !0) });
1161
+ });
1162
+ })], 2)];
1163
+ })], 2) : e._e();
1164
+ }, Nr = [], wr = /* @__PURE__ */ D(
1165
+ Er,
1166
+ $r,
1167
+ Nr,
1168
+ !1,
1169
+ null,
1170
+ "6f13599d"
1171
+ );
1172
+ const Dr = wr.exports, we = () => ({
1173
+ data: {
1174
+ type: Array,
1175
+ required: !0
1176
+ },
1177
+ labels: {
1178
+ type: Array,
1179
+ default: () => []
1180
+ },
1181
+ options: {
1182
+ type: Object,
1183
+ default: () => ({})
1184
+ },
1185
+ orientation: {
1186
+ type: String,
1187
+ default: O.VERTICAL,
1188
+ validator: tt
1189
+ },
1190
+ xScale: {
1191
+ type: Function,
1192
+ default: () => null
1193
+ },
1194
+ yScale: {
1195
+ type: Function,
1196
+ default: () => null
1197
+ },
1198
+ hoveredIndex: {
1199
+ type: Number,
1200
+ default: -1
1201
+ },
1202
+ containerSize: {
1203
+ type: Object,
1204
+ default: () => ({ width: 0, height: 0 })
1205
+ },
1206
+ transition: {
1207
+ type: Boolean,
1208
+ default: !0
1209
+ },
1210
+ classList: {
1211
+ type: [String, Array],
1212
+ default: () => []
1213
+ }
1214
+ }), Hr = /* @__PURE__ */ R({
1215
+ __name: "lume-overlay-group",
1216
+ props: {
1217
+ ...we(),
1218
+ orientation: {
1219
+ type: String,
1220
+ default: O.VERTICAL
1221
+ }
1222
+ },
1223
+ emits: ["click", "lume__internal--hover", "mouseover"],
1224
+ setup(t, { emit: e }) {
1225
+ const r = t, { data: n, orientation: a, xScale: u, yScale: o } = F(r), i = f(() => Nt(n));
1226
+ function l(c) {
1227
+ var x;
1228
+ const s = a.value === O.HORIZONTAL ? o.value : u.value, v = s.domain(), m = dn(s), g = ((x = s.paddingInner) == null ? void 0 : x.call(s)) ?? 0, h = m * g, _ = K(s) ? s(v[c]) - h / 2 : s(c) - m / 2;
1229
+ return a.value === O.HORIZONTAL ? {
1230
+ width: Math.max(...u.value.range()),
1231
+ height: m,
1232
+ transform: `translate(0, ${_})`
1233
+ } : {
1234
+ width: m,
1235
+ height: Math.max(...o.value.range()),
1236
+ transform: `translate(${_}, 0)`
1237
+ };
1238
+ }
1239
+ return { __sfc: !0, props: r, emit: e, data: n, orientation: a, xScale: u, yScale: o, overlayData: i, getOverlayBarAttributes: l, LumeBar: Ye };
1240
+ }
1241
+ });
1242
+ var Pr = function() {
1243
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1244
+ return r("g", { staticClass: "lume-overlay-group" }, e._l(n.overlayData, function(a, u) {
1245
+ return r(n.LumeBar, e._b({ key: `overlay-${u}`, attrs: { "data-j-lume-overlay-group": u, transition: !1, "class-list": "lume-fill--transparent" }, on: { mouseover: function(o) {
1246
+ return n.emit("lume__internal--hover", u);
1247
+ }, click: function(o) {
1248
+ return n.emit("click", { index: u, event: o });
1249
+ } } }, "lume-bar", n.getOverlayBarAttributes(u), !1));
1250
+ }), 1);
1251
+ }, Rr = [], Sr = /* @__PURE__ */ D(
1252
+ Hr,
1253
+ Pr,
1254
+ Rr,
1255
+ !1,
1256
+ null,
1257
+ null
1258
+ );
1259
+ const Cr = Sr.exports, Br = [
1260
+ "axis-click",
1261
+ "axis-mouseenter",
1262
+ "axis-mouseleave",
1263
+ "rendered",
1264
+ "resize",
1265
+ "data-changed",
1266
+ "labels-changed",
1267
+ "chart-click",
1268
+ "chart-mouseenter",
1269
+ "chart-mouseleave",
1270
+ "legend-click",
1271
+ "legend-mouseenter",
1272
+ "legend-mouseleave",
1273
+ "bar-click",
1274
+ "line-click",
1275
+ "point-click",
1276
+ "node-click",
1277
+ "node-mouseenter",
1278
+ "node-mouseleave",
1279
+ "link-click",
1280
+ "link-mouseenter",
1281
+ "link-mouseleave",
1282
+ "tooltip-opened",
1283
+ "tooltip-moved",
1284
+ "tooltip-closed",
1285
+ "hovered-index-changed",
1286
+ "update:hoveredIndex"
1287
+ ], q = (t, e) => {
1288
+ function r(u, ...o) {
1289
+ document.dispatchEvent(
1290
+ new CustomEvent(`${e}_${u}`, {
1291
+ detail: [...o]
1292
+ })
1293
+ );
1294
+ }
1295
+ function n(u, o) {
1296
+ document.addEventListener(
1297
+ `${e}_${u}`,
1298
+ (i) => o(...i.detail)
1299
+ );
1300
+ }
1301
+ return { componentEventPropagator: Br.reduce((u, o) => (u[o] = (i) => t(o, i), u), {}), emitInternalEvent: r, listenInternalEvent: n };
1302
+ };
1303
+ function Gr(t) {
1304
+ return { hasNegativeValues: f(
1305
+ () => Et(t.value).some((r) => r < 0)
1306
+ ) };
1307
+ }
1308
+ function Fr(t, e, r, n) {
1309
+ const a = f(
1310
+ () => n.value === O.HORIZONTAL
1311
+ ), u = f(
1312
+ () => {
1313
+ var c;
1314
+ return t.height - (a != null && a.value ? 0 : ((c = r.value) == null ? void 0 : c.call(r, 0)) || 0);
1315
+ }
1316
+ ), o = f(
1317
+ () => {
1318
+ var c;
1319
+ return a != null && a.value ? ((c = e.value) == null ? void 0 : c.call(e, 0)) || 0 : t.width;
1320
+ }
1321
+ ), i = f(
1322
+ () => {
1323
+ var c;
1324
+ return a != null && a.value ? "translate(0, 0)" : `translate(0, ${((c = r.value) == null ? void 0 : c.call(r, 0)) || 0})`;
1325
+ }
1326
+ );
1327
+ return { negativeBarAttributes: f(() => ({
1328
+ width: o.value,
1329
+ height: u.value,
1330
+ transform: i.value
1331
+ })) };
1332
+ }
1333
+ function jr(t, e) {
1334
+ return t.reduce((r, n) => Xe(n.values, e).map(
1335
+ (a, u) => r[u] ? a.value > r[u] ? a.value : r[u] : a.value ?? 0
1336
+ ), []);
1337
+ }
1338
+ function Vr(t, e) {
1339
+ return t.reduce((r, n) => Xe(n.values, e).map(
1340
+ (a, u) => {
1341
+ const o = a.value == null || a.value < 0 ? 0 : a.value;
1342
+ return r[u] ? r[u] + o : o;
1343
+ }
1344
+ ), []);
1345
+ }
1346
+ const vt = {
1347
+ "stacked-bar": Vr
1348
+ };
1349
+ function Ct(t, e, r, n, a, u, o, i) {
1350
+ const l = f(
1351
+ () => {
1352
+ var s;
1353
+ return e.value.withTooltip !== !1 && !((s = e.value.tooltipOptions) != null && s.targetElement);
1354
+ }
1355
+ );
1356
+ function c(s) {
1357
+ var g;
1358
+ const v = ((g = a == null ? void 0 : a.value) == null ? void 0 : g.length) ?? 0, m = i != null && i.value && vt[i.value] ? vt[i.value](
1359
+ s,
1360
+ v
1361
+ ) : jr(s, v);
1362
+ t.value = m.map((h, _) => ({
1363
+ cx: (u == null ? void 0 : u.value) === O.HORIZONTAL ? r.value(h) : Be(r.value, _),
1364
+ cy: (u == null ? void 0 : u.value) === O.HORIZONTAL ? Be(n.value, _) : n.value(h)
1365
+ }));
1366
+ }
1367
+ return H(
1368
+ [r, n],
1369
+ () => {
1370
+ r.value && n.value && (o != null && o.value) && l.value && c(o.value);
1371
+ },
1372
+ { immediate: !0 }
1373
+ ), { shouldGenerateTooltipAnchors: l, updateTooltipAnchorAttributes: c };
1374
+ }
1375
+ function Mr() {
1376
+ const t = $e({
1377
+ opened: !1,
1378
+ targetElement: null
1379
+ });
1380
+ return { tooltipConfig: t, showTooltip: (n) => {
1381
+ t.opened = !0, t.targetElement = n;
1382
+ }, hideTooltip: () => {
1383
+ t.opened = !1, t.targetElement = null;
1384
+ } };
1385
+ }
1386
+ function zr(t) {
1387
+ return { getTooltipItems: f(
1388
+ () => (r) => t.value.map(({ color: n, label: a, values: u }) => {
1389
+ var o, i, l;
1390
+ return {
1391
+ color: ((o = u[r]) == null ? void 0 : o.color) || n,
1392
+ label: a,
1393
+ value: ((i = u[r]) == null ? void 0 : i.label) ?? ((l = u[r]) == null ? void 0 : l.value) ?? wt
1394
+ };
1395
+ })
1396
+ ) };
1397
+ }
1398
+ const Ge = 16, Fe = 8, je = 28, Ve = 24, se = {
1399
+ VERTICAL: {
1400
+ top: Ge,
1401
+ right: Fe,
1402
+ bottom: je,
1403
+ left: Ve
1404
+ },
1405
+ HORIZONTAL: {
1406
+ top: Ge,
1407
+ right: Fe,
1408
+ bottom: je,
1409
+ left: Ve
1410
+ }
1411
+ };
1412
+ function Wr(t) {
1413
+ return !t || t === "auto" || t.top == null || t.top === "auto" ? Ge : t.top;
1414
+ }
1415
+ function Ur(t) {
1416
+ return !t || t === "auto" || t.right == null || t.right === "auto" ? Fe : t.right;
1417
+ }
1418
+ function Zr(t, e) {
1419
+ return !t || t === "auto" || t.bottom == null || t.bottom === "auto" ? e || je : t.bottom;
1420
+ }
1421
+ function Xr(t, e) {
1422
+ return !t || t === "auto" || t.left == null || t.left === "auto" ? e || Ve : t.left;
1423
+ }
1424
+ const Yr = /* @__PURE__ */ R({
1425
+ __name: "lume-chart",
1426
+ props: {
1427
+ ...me(),
1428
+ chartType: {
1429
+ type: String,
1430
+ default: null
1431
+ }
1432
+ },
1433
+ setup(t, { emit: e }) {
1434
+ const r = t, n = X(), { data: a, labels: u, color: o, options: i, orientation: l, chartType: c } = F(r), s = I(-1), v = I(null), m = I(null), g = I([]), h = I(null), _ = I(0), x = I(0), { allOptions: d } = Q(i), { internalData: p, computedLabels: y, containerSize: b, updateSize: A, chartID: $ } = et(a, u, o, d, l), { listenInternalEvent: T } = q(e, $), { xScale: N, yScale: S } = er(
1435
+ p,
1436
+ y,
1437
+ b,
1438
+ l,
1439
+ d
1440
+ ), j = f(() => ({
1441
+ top: Wr(d.value.margins),
1442
+ right: Ur(d.value.margins),
1443
+ bottom: Zr(d.value.margins, _.value),
1444
+ left: Xr(d.value.margins, x.value)
1445
+ })), V = f(() => {
1446
+ var k;
1447
+ return r.xScale ? ct(r.xScale) ? r.xScale : (k = r.xScale) == null ? void 0 : k.call(r, p.value, u.value, b) : N.value;
1448
+ }), ee = f(() => {
1449
+ var k;
1450
+ return r.yScale ? ct(r.yScale) ? r.yScale : (k = r.yScale) == null ? void 0 : k.call(r, p.value, u.value, b) : S.value;
1451
+ }), de = f(() => ({
1452
+ ...d.value.xAxisOptions,
1453
+ withHover: l.value === O.VERTICAL
1454
+ })), oe = f(() => ({
1455
+ ...d.value.yAxisOptions,
1456
+ withHover: l.value === O.HORIZONTAL
1457
+ })), te = f(() => {
1458
+ var k;
1459
+ return (k = d.value.xAxisOptions) == null ? void 0 : k.title;
1460
+ }), ue = f(() => {
1461
+ var k;
1462
+ return (k = d.value.yAxisOptions) == null ? void 0 : k.title;
1463
+ }), E = f(() => {
1464
+ var k;
1465
+ return ((k = d.value.xAxisOptions) == null ? void 0 : k.withTitle) !== !1 && te.value;
1466
+ }), w = f(() => {
1467
+ var k;
1468
+ return ((k = d.value.yAxisOptions) == null ? void 0 : k.withTitle) !== !1 && ue.value;
1469
+ }), P = f(
1470
+ () => a.value.every((k) => !k.values.length) || a.value.every((k) => k.values.every((G) => G === null))
1471
+ ), ne = f(() => {
1472
+ const k = [], { noBaseScales: G } = d.value;
1473
+ return G || k.push(() => !!(V.value && ee.value)), k.every((Z) => Z() === !0);
1474
+ }), { hasNegativeValues: Ae } = Gr(p), { negativeBarAttributes: L } = Fr(
1475
+ b,
1476
+ V,
1477
+ ee,
1478
+ l
1479
+ ), { shouldGenerateTooltipAnchors: C } = Ct(
1480
+ g,
1481
+ d,
1482
+ V,
1483
+ ee,
1484
+ u,
1485
+ l,
1486
+ p,
1487
+ c
1488
+ ), { tooltipConfig: B, showTooltip: W, hideTooltip: U } = Mr(), { getTooltipItems: z } = zr(p), at = f(
1489
+ () => {
1490
+ var k;
1491
+ return ((k = d.value.tooltipOptions) == null ? void 0 : k.position) || "top";
1492
+ }
1493
+ ), Le = f(() => {
1494
+ var G;
1495
+ const k = (G = d.value.tooltipOptions) == null ? void 0 : G.withPointerEvents;
1496
+ return B.opened && (!k || k && h.value === !1);
1497
+ });
1498
+ function ve(k) {
1499
+ var Z;
1500
+ if (d.value.withHover === !1 || k === s.value) return;
1501
+ const G = s.value;
1502
+ if (s.value = k, d.value.withTooltip !== !1) {
1503
+ const Ut = (Z = d.value.tooltipOptions) != null && Z.targetElement ? d.value.tooltipOptions.targetElement === "self" ? m.value.$el : d.value.tooltipOptions.targetElement : v.value[k];
1504
+ W(Ut);
1505
+ }
1506
+ e("hovered-index-changed", { newIndex: k, oldIndex: G }), e("update:hoveredIndex", k);
1507
+ }
1508
+ function le() {
1509
+ U(), s.value = -1, e("update:hoveredIndex", -1);
1510
+ }
1511
+ function fe(k) {
1512
+ if (!a.value.some(
1513
+ ({ values: Z }) => k <= Z.length - 1
1514
+ )) {
1515
+ re(J.InvalidHoveredIndex);
1516
+ return;
1517
+ }
1518
+ k == null || k === -1 ? le() : ve(k);
1519
+ }
1520
+ function pe() {
1521
+ setTimeout(() => {
1522
+ Le.value && le(), e("chart-mouseleave");
1523
+ }, 0);
1524
+ }
1525
+ function Mt(k) {
1526
+ A(k), e("resize", k);
1527
+ }
1528
+ function zt({ index: k, value: G, event: Z }) {
1529
+ k !== null && ve(k), e("axis-mouseenter", { index: k, value: G, event: Z });
1530
+ }
1531
+ function Wt({ index: k, value: G, event: Z }) {
1532
+ e("axis-click", { index: k, value: G, event: Z });
1533
+ }
1534
+ return H(
1535
+ a,
1536
+ (k, G) => e("data-changed", { newValue: k, oldValue: G })
1537
+ ), H(
1538
+ u,
1539
+ (k, G) => e("labels-changed", { newValue: k, oldValue: G })
1540
+ ), H(P, (k) => k && re(J.Empty), { immediate: !0 }), H(() => r.hoveredIndex, fe), H(
1541
+ g,
1542
+ (k) => {
1543
+ k && r.hoveredIndex != null && s.value === -1 && fe(r.hoveredIndex);
1544
+ },
1545
+ { flush: "post" }
1546
+ ), H(h, (k) => {
1547
+ k === !1 && B.opened && le();
1548
+ }), ae(async () => {
1549
+ e("rendered"), n.groups || console.error('"groups" `<slot>` must have content.'), T("lume__internal--hover", ve);
1550
+ }), De("chartID", $), De("isEmpty", P), De("tooltipAnchorAttributes", g), { __sfc: !0, props: r, slots: n, emit: e, data: a, labels: u, color: o, options: i, orientation: l, chartType: c, internalHoveredIndex: s, tooltipAnchor: v, chartContainer: m, tooltipAnchorAttributes: g, isHoveringTooltip: h, xAxisHeight: _, yAxisWidth: x, allOptions: d, internalData: p, computedLabels: y, containerSize: b, updateSize: A, chartID: $, listenInternalEvent: T, xScale: N, yScale: S, computedMargins: j, computedXScale: V, computedYScale: ee, computedXAxisOptions: de, computedYAxisOptions: oe, xAxisTitle: te, yAxisTitle: ue, showXAxisTitle: E, showYAxisTitle: w, isEmpty: P, isReady: ne, hasNegativeValues: Ae, negativeBarAttributes: L, shouldGenerateTooltipAnchors: C, tooltipConfig: B, showTooltip: W, hideTooltip: U, getTooltipItems: z, tooltipPosition: at, shouldHideTooltip: Le, handleInternalHover: ve, handleHideTooltip: le, handleExternalHover: fe, handleMouseleave: pe, handleResize: Mt, handleAxisMouseenter: zt, handleAxisClick: Wt, LumeAxis: Sn, LumeBar: Ye, LumeChartContainer: lr, LumeChartLegend: vr, LumeTooltip: Dr, LumeOverlayGroup: Cr, TOOLTIP_ANCHOR_RADIUS: An };
1551
+ }
1552
+ });
1553
+ var Kr = function() {
1554
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1555
+ return r(n.LumeChartContainer, { ref: "chartContainer", attrs: { id: `lume-chart_${n.chartID}`, margins: n.computedMargins, "container-size": n.containerSize, "no-min-size": n.allOptions.noMinSize, "transparent-background": n.allOptions.transparentBackground, orientation: n.orientation, "data-j-lume-chart": "" }, on: { resize: n.handleResize, click: function(a) {
1556
+ return n.emit("chart-click", a);
1557
+ }, mouseenter: function(a) {
1558
+ return n.emit("chart-mouseenter", a);
1559
+ }, mouseleave: n.handleMouseleave }, scopedSlots: e._u([{ key: "header", fn: function() {
1560
+ return [r("div", { staticClass: "lume-chart__header" }, [r("div", { staticClass: "lume-chart__header-section" }, [e.title ? r("h1", { staticClass: "lume-chart__title lume-chart-title lume-typography--display" }, [e._v(" " + e._s(e.title) + " ")]) : e._e(), r("div", { staticClass: "lume-chart__controls" }, [e._t("controls")], 2)]), r("div", { staticClass: "lume-chart__header-section" }, [n.showYAxisTitle ? r("h3", { staticClass: "lume-chart__axis-title lume-axis-title lume-typography--caption" }, [e._v(" " + e._s(n.yAxisTitle) + " ")]) : e._e(), e._t("legend", function() {
1561
+ return [n.allOptions.withLegend !== !1 && n.allOptions.legendPosition !== "bottom" ? r(n.LumeChartLegend, { staticClass: "lume-chart__legend", attrs: { data: n.internalData, "data-j-lume-chart__legend": "" }, on: { click: function(a) {
1562
+ return n.emit("legend-click", a);
1563
+ }, mouseenter: function(a) {
1564
+ return n.emit("legend-mouseenter", a);
1565
+ }, mouseleave: function(a) {
1566
+ return n.emit("legend-mouseleave");
1567
+ } } }) : e._e()];
1568
+ }, { data: n.internalData })], 2)])];
1569
+ }, proxy: !0 }, { key: "footer", fn: function() {
1570
+ return [n.showXAxisTitle ? r("h3", { staticClass: "lume-chart__axis-title lume-chart__axis-title--centered lume-axis-title lume-typography--body" }, [e._v(" " + e._s(n.xAxisTitle) + " ")]) : e._e(), n.allOptions.withLegend !== !1 && n.allOptions.legendPosition == "bottom" ? r(n.LumeChartLegend, { staticClass: "lume-chart__legend lume-chart__legend--bottom", attrs: { data: n.internalData, "data-j-lume-chart__legend": "" }, on: { click: function(a) {
1571
+ return n.emit("legend-click", a);
1572
+ }, mouseenter: function(a) {
1573
+ return n.emit("legend-mouseenter", a);
1574
+ }, mouseleave: function(a) {
1575
+ return n.emit("legend-mouseleave");
1576
+ } } }) : e._e()];
1577
+ }, proxy: !0 }, { key: "extra", fn: function() {
1578
+ return [e._t("tooltip", function() {
1579
+ return [n.allOptions.withTooltip !== !1 ? r(n.LumeTooltip, e._b({ attrs: { position: n.tooltipPosition, title: n.computedLabels[n.internalHoveredIndex], items: n.getTooltipItems(n.internalHoveredIndex), options: n.allOptions.tooltipOptions, "data-j-lume-chart__tooltip": "" }, on: { opened: function(a) {
1580
+ return n.emit("tooltip-opened", {
1581
+ index: n.internalHoveredIndex,
1582
+ targetElement: a
1583
+ });
1584
+ }, moved: function(a) {
1585
+ return n.emit("tooltip-moved", {
1586
+ index: n.internalHoveredIndex,
1587
+ targetElement: a
1588
+ });
1589
+ }, closed: function(a) {
1590
+ return n.emit("tooltip-closed");
1591
+ }, "tooltip-mouseenter": function(a) {
1592
+ n.isHoveringTooltip = !0;
1593
+ }, "tooltip-mouseleave": function(a) {
1594
+ n.isHoveringTooltip = !1;
1595
+ } } }, "lume-tooltip", n.tooltipConfig, !1), [e._t("tooltip-content", null, { data: n.internalData, labels: n.computedLabels, hoveredIndex: n.internalHoveredIndex })], 2) : e._e()];
1596
+ }, { data: n.internalData, labels: n.computedLabels, title: n.computedLabels[n.internalHoveredIndex], items: n.getTooltipItems(n.internalHoveredIndex), position: n.tooltipPosition, withTooltip: n.allOptions.withTooltip !== !1, hoveredIndex: n.internalHoveredIndex, handleMouseEnter: () => n.isHoveringTooltip = !0, handleMouseLeave: () => n.isHoveringTooltip = !1, options: n.allOptions.tooltipOptions }, n.tooltipConfig)];
1597
+ }, proxy: !0 }], null, !0) }, [n.isReady ? [n.hasNegativeValues ? r(n.LumeBar, e._b({ attrs: { "class-list": "lume-fill--negative", transition: !1, "data-j-lume-chart__negative-values": "" } }, "lume-bar", n.negativeBarAttributes, !1)) : e._e(), n.allOptions.withAxes !== !1 ? e._t("axes", function() {
1598
+ return [r(n.LumeAxis, { attrs: { type: "x", scale: n.computedXScale, "container-size": n.containerSize, options: n.computedXAxisOptions, "hovered-index": n.internalHoveredIndex, orientation: n.orientation, "data-j-lume-chart__x-axis": "" }, on: { click: n.handleAxisClick, mouseenter: n.handleAxisMouseenter, mouseleave: function(a) {
1599
+ return n.emit("axis-mouseleave");
1600
+ }, "lume__internal--axis-size": function(a) {
1601
+ n.xAxisHeight = a;
1602
+ } } }), r(n.LumeAxis, { attrs: { type: "y", scale: n.computedYScale, "container-size": n.containerSize, options: n.computedYAxisOptions, "hovered-index": n.internalHoveredIndex, orientation: n.orientation, "data-j-lume-chart__y-axis": "" }, on: { click: n.handleAxisClick, mouseenter: n.handleAxisMouseenter, mouseleave: function(a) {
1603
+ return n.emit("axis-mouseleave");
1604
+ }, "lume__internal--axis-size": function(a) {
1605
+ n.yAxisWidth = a;
1606
+ } } })];
1607
+ }, { xScale: n.computedXScale, yScale: n.computedYScale, containerSize: n.containerSize, options: n.allOptions, hoveredIndex: n.internalHoveredIndex }) : e._e(), n.allOptions.withHover !== !1 ? r(n.LumeOverlayGroup, { attrs: { data: n.internalData, orientation: n.orientation, "x-scale": n.computedXScale, "y-scale": n.computedYScale, "data-j-lume-chart__overlay-group": "" }, on: { "lume__internal--hover": n.handleInternalHover } }) : e._e(), n.shouldGenerateTooltipAnchors ? r("g", e._l(n.tooltipAnchorAttributes, function(a, u) {
1608
+ return r("circle", e._b({ key: `anchor_${u}`, ref: "tooltipAnchor", refInFor: !0, staticClass: "lume-fill--transparent", attrs: { r: n.TOOLTIP_ANCHOR_RADIUS } }, "circle", a, !1));
1609
+ }), 0) : e._e(), e._t("groups", null, { data: n.internalData, labels: n.computedLabels, options: n.allOptions, orientation: n.orientation, xScale: n.computedXScale, yScale: n.computedYScale, hoveredIndex: n.internalHoveredIndex, containerSize: n.containerSize, transition: n.allOptions.withTransition !== !1, classList: e.classList })] : e._e()], 2);
1610
+ }, Jr = [], Qr = /* @__PURE__ */ D(
1611
+ Yr,
1612
+ Kr,
1613
+ Jr,
1614
+ !1,
1615
+ null,
1616
+ "17c48844"
1617
+ );
1618
+ const _e = Qr.exports, ft = 8, qr = 8, ea = 20, he = 2, ta = 3, na = 4, pt = 2, ra = /* @__PURE__ */ R({
1619
+ __name: "lume-alluvial-node-label",
1620
+ props: {
1621
+ bottom: { type: Boolean, default: !1 },
1622
+ left: { type: Boolean, default: !1 },
1623
+ maxWidth: { type: Number, default: 0 }
1624
+ },
1625
+ emits: ["lume__internal--node-resize"],
1626
+ setup(t, { emit: e }) {
1627
+ const r = t, n = I(null), a = I(r.maxWidth), u = I(1);
1628
+ return H(
1629
+ [n, () => r.maxWidth],
1630
+ async ([o, i]) => {
1631
+ if (o && i) {
1632
+ a.value = i, await Pe();
1633
+ const { width: l, height: c } = o.getBoundingClientRect();
1634
+ a.value = l + pt > i ? i : l + pt, u.value = Math.ceil(c);
1635
+ }
1636
+ },
1637
+ { immediate: !0 }
1638
+ ), H(a, async (o) => {
1639
+ o !== r.maxWidth && (await Pe(), e("lume__internal--node-resize"));
1640
+ }), { __sfc: !0, props: r, emit: e, text: n, foreignObjectWidth: a, foreignObjectHeight: u };
1641
+ }
1642
+ });
1643
+ var aa = function() {
1644
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1645
+ return e.maxWidth ? r("foreignObject", { staticClass: "lume-alluvial-group__node-foreign", attrs: { y: e.bottom ? "0.1em" : -n.foreignObjectHeight + 1, x: e.left ? -n.foreignObjectWidth : 0, width: n.foreignObjectWidth, height: n.foreignObjectHeight } }, [r("div", { staticClass: "lume-alluvial-group__label-wrapper" }, [r("span", { ref: "text", staticClass: "lume-alluvial-group__node-label" }, [e._t("default")], 2)])]) : r("text", { staticClass: "lume-alluvial-group__node-label", attrs: { dy: e.bottom ? ".2em" : "-.2em", "dominant-baseline": e.bottom ? "hanging" : "auto" } }, [e._t("default")], 2);
1646
+ }, oa = [], ua = /* @__PURE__ */ D(
1647
+ ra,
1648
+ aa,
1649
+ oa,
1650
+ !1,
1651
+ null,
1652
+ "7126dfdb"
1653
+ );
1654
+ const la = ua.exports, ia = /* @__PURE__ */ R({
1655
+ __name: "lume-alluvial-node-value",
1656
+ props: {
1657
+ bottom: { type: Boolean, default: !0 }
1658
+ },
1659
+ setup(t) {
1660
+ return { __sfc: !0 };
1661
+ }
1662
+ });
1663
+ var sa = function() {
1664
+ var e = this, r = e._self._c;
1665
+ return e._self._setupProxy, r("text", { staticClass: "lume-alluvial-group__node-value", attrs: { y: e.bottom ? ".2em" : "-.2em", "dominant-baseline": e.bottom ? "hanging" : "auto" } }, [e._t("default")], 2);
1666
+ }, ca = [], da = /* @__PURE__ */ D(
1667
+ ia,
1668
+ sa,
1669
+ ca,
1670
+ !1,
1671
+ null,
1672
+ "b4fc758b"
1673
+ );
1674
+ const va = da.exports, fa = /* @__PURE__ */ R({
1675
+ __name: "lume-alluvial-node-header",
1676
+ props: {
1677
+ x: { type: Number, required: !0 },
1678
+ y: { type: Number, required: !0 }
1679
+ },
1680
+ setup(t) {
1681
+ const e = I(null), r = f(
1682
+ () => e.value && `translate(${-e.value.getBBox().width / 2}, 0)`
1683
+ ), n = f(
1684
+ () => e.value && `translate(${e.value.getBBox().width / 2}, 0)`
1685
+ );
1686
+ return { __sfc: !0, textRef: e, beforeTransform: r, afterTransform: n };
1687
+ }
1688
+ });
1689
+ var pa = function() {
1690
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1691
+ return r("g", { attrs: { transform: `translate(${e.x}, ${e.y})` } }, [r("g", { attrs: { transform: n.beforeTransform } }, [e._t("before")], 2), r("text", { ref: "textRef", staticClass: "lume-alluvial-group__node-header lume-typography--caption" }, [e._t("default")], 2), r("g", { attrs: { transform: n.afterTransform } }, [e._t("after")], 2)]);
1692
+ }, ma = [], _a = /* @__PURE__ */ D(
1693
+ fa,
1694
+ pa,
1695
+ ma,
1696
+ !1,
1697
+ null,
1698
+ "0e483453"
1699
+ );
1700
+ const ha = _a.exports;
1701
+ function mt(t, e) {
1702
+ return {
1703
+ x0: 0 + (e ? e.left : 0),
1704
+ y0: 0 + (e ? e.top : 0),
1705
+ x1: t.width - (e ? e.right : 0),
1706
+ y1: t.height - (e ? e.bottom : 0)
1707
+ };
1708
+ }
1709
+ function ga(t) {
1710
+ const e = I(mt(t));
1711
+ function r(n) {
1712
+ e.value = mt(t, n);
1713
+ }
1714
+ return { extents: e, updateExtents: r };
1715
+ }
1716
+ var Ie = /* @__PURE__ */ ((t) => (t.GraphProblem = "There was an issue generating your alluvial graph.", t.BarScaleDomainAbove0 = "Bar linear scale domain cannot start above 0!", t.BarScaleNull = "Bar linear scale cannot be `null`", t))(Ie || {});
1717
+ const ya = "[lume] ";
1718
+ function Me(t, e, r = !0) {
1719
+ r && It() || console.error(ya + "Error: " + t, e);
1720
+ }
1721
+ const ba = 200;
1722
+ function M(t) {
1723
+ return typeof t == "string" || typeof t == "number" ? t : t.id ?? t.label;
1724
+ }
1725
+ function ka(t, e) {
1726
+ return e.nodes.find((r) => r.id === t);
1727
+ }
1728
+ function xa(t, e) {
1729
+ return e.links.find((r) => r.id === t);
1730
+ }
1731
+ function Bt(t) {
1732
+ return !!(t.sourceLinks && t.targetLinks);
1733
+ }
1734
+ function Aa(t, e) {
1735
+ if (!e) return;
1736
+ const r = t.nodes.filter((o) => o.targetLinks.length === 0).map((o) => `${o.id}`), n = t.nodes.filter((o) => o.sourceLinks.length === 0).map((o) => `${o.id}`), a = e.filter((o) => r.includes(o.dataset.id)).reduce(
1737
+ (o, i) => Math.max(o, i.getBBox().width),
1738
+ -1 / 0
1739
+ ), u = e.filter((o) => n.includes(o.dataset.id)).reduce(
1740
+ (o, i) => Math.max(o, i.getBBox().width),
1741
+ -1 / 0
1742
+ );
1743
+ return {
1744
+ left: a,
1745
+ top: 0,
1746
+ right: u,
1747
+ bottom: 0
1748
+ };
1749
+ }
1750
+ function La(t) {
1751
+ return t.map((e) => {
1752
+ const r = e.y1 - e.y0 < he;
1753
+ return {
1754
+ x: e.x0,
1755
+ y: e.y0 - (r ? he / 2 : 0),
1756
+ // Negative offset to account for the min. height
1757
+ width: e.x1 - e.x0,
1758
+ height: r ? he : e.y1 - e.y0,
1759
+ textTransform: {
1760
+ x: e.depth > 0 ? e.x1 + ft : e.x0 - ft,
1761
+ y: (e.y1 + e.y0) / 2
1762
+ },
1763
+ node: e
1764
+ };
1765
+ });
1766
+ }
1767
+ function Ta(t) {
1768
+ return [t.source.x1, t.y0];
1769
+ }
1770
+ function Oa(t) {
1771
+ return [t.target.x0, t.y1];
1772
+ }
1773
+ function Ia(t) {
1774
+ return t.curveFunction ? Qt(t.curveFunction).source(Ta).target(Oa) : Zt();
1775
+ }
1776
+ function Ea(t) {
1777
+ return t.map((e) => {
1778
+ var r;
1779
+ return {
1780
+ id: e.id,
1781
+ color: e.color || ((r = e.source) == null ? void 0 : r.color) || xe,
1782
+ d: Ia(e)(e),
1783
+ strokeWidth: Math.max(1, e.width),
1784
+ link: e
1785
+ };
1786
+ });
1787
+ }
1788
+ function _t(t, e, r, n, a) {
1789
+ if (n === !1) {
1790
+ t.node = {
1791
+ ...t.node,
1792
+ transitionValue: a ? void 0 : r
1793
+ };
1794
+ return;
1795
+ }
1796
+ const u = Date.now(), o = _n(e, r), i = () => {
1797
+ let c = (Date.now() - u) / ba;
1798
+ c > 1 && (c = 1), t.node = {
1799
+ ...t.node,
1800
+ transitionValue: a && c === 1 ? void 0 : o(c)
1801
+ }, c < 1 && requestAnimationFrame(i);
1802
+ };
1803
+ requestAnimationFrame(i);
1804
+ }
1805
+ const $a = ":aggregated";
1806
+ function Na(t) {
1807
+ const e = I([]), r = f(() => {
1808
+ var c, s;
1809
+ const l = /* @__PURE__ */ new Map();
1810
+ return (s = (c = t.value) == null ? void 0 : c[0]) == null || s.values.forEach(({ value: v, expandableNodes: m }) => {
1811
+ m != null && m.length && l.set(v, [...m]);
1812
+ }), l;
1813
+ }), n = f(
1814
+ () => {
1815
+ const l = /* @__PURE__ */ new Map();
1816
+ return r.value.forEach((c, s) => {
1817
+ c.forEach((v) => l.set(v, s));
1818
+ }), l;
1819
+ }
1820
+ );
1821
+ function a(l) {
1822
+ return r.value.has(l);
1823
+ }
1824
+ function u(l) {
1825
+ return n.value.has(l);
1826
+ }
1827
+ function o(l) {
1828
+ return e.value.includes(l);
1829
+ }
1830
+ function i(l) {
1831
+ a(l) && (e.value = o(l) ? e.value.filter((c) => c !== l) : [...e.value, l]);
1832
+ }
1833
+ return H(t, () => e.value = []), {
1834
+ childIdsByParentId: r,
1835
+ expandedNodeIds: e,
1836
+ isExpandableNode: a,
1837
+ isExpandedNode: o,
1838
+ isSubNode: u,
1839
+ parentIdByChildId: n,
1840
+ toggleNodeExpansion: i
1841
+ };
1842
+ }
1843
+ function wa(t, e, r, n) {
1844
+ if (!t || !e || n.size === 0)
1845
+ return { nodes: t, links: e };
1846
+ const a = e.filter(
1847
+ (o) => !n.has(M(o.source)) && !n.has(M(o.target))
1848
+ ), u = new Set(a.map(({ id: o }) => o));
1849
+ return r.forEach((o, i) => {
1850
+ const l = /* @__PURE__ */ new Map();
1851
+ o.forEach((c) => {
1852
+ Gt(e, c).forEach((s) => {
1853
+ const v = M(s.target), m = l.get(v);
1854
+ if (m) {
1855
+ m.value += s.value;
1856
+ return;
1857
+ }
1858
+ const g = `${i}:${v}`;
1859
+ l.set(v, {
1860
+ id: u.has(g) ? `${g}${$a}` : g,
1861
+ aggregatedFrom: i,
1862
+ color: s.color,
1863
+ curveFunction: s.curveFunction,
1864
+ source: i,
1865
+ target: v,
1866
+ value: s.value
1867
+ });
1868
+ });
1869
+ }), a.push(...l.values());
1870
+ }), {
1871
+ nodes: t.filter((o) => !n.has(o.id)),
1872
+ links: a
1873
+ };
1874
+ }
1875
+ function Da({
1876
+ graph: t,
1877
+ nodes: e,
1878
+ linkDefinitions: r,
1879
+ expandedNodeIds: n,
1880
+ childIdsByParentId: a,
1881
+ options: u,
1882
+ extents: o
1883
+ }) {
1884
+ var i;
1885
+ (i = t == null ? void 0 : t.nodes) != null && i.length && n.forEach((l) => {
1886
+ const c = t.nodes.find((v) => v.id === l), s = (a.get(l) ?? []).map((v) => e.find((m) => m.id === v)).filter(Boolean);
1887
+ !c || !s.length || Ha({ graph: t, parent: c, children: s, linkDefinitions: r, options: u, extents: o });
1888
+ });
1889
+ }
1890
+ function Ha({
1891
+ graph: t,
1892
+ parent: e,
1893
+ children: r,
1894
+ linkDefinitions: n,
1895
+ options: a,
1896
+ extents: u
1897
+ }) {
1898
+ const o = r.map(
1899
+ (s) => Fa(n, e, s)
1900
+ ), i = o.reduce((s, v) => s + v, 0);
1901
+ if (!i) return;
1902
+ const l = (e.y1 - e.y0) / i;
1903
+ Pa({
1904
+ parent: e,
1905
+ children: r,
1906
+ childValues: o,
1907
+ scale: l,
1908
+ graph: t,
1909
+ options: a,
1910
+ extents: u
1911
+ });
1912
+ const c = Ca({
1913
+ parent: e,
1914
+ children: r,
1915
+ childValues: o,
1916
+ scale: l,
1917
+ linkDefinitions: n
1918
+ });
1919
+ Ga(t, e).forEach((s) => {
1920
+ const v = Ba({
1921
+ children: r,
1922
+ aggregatedLink: s,
1923
+ scale: l,
1924
+ linkDefinitions: n
1925
+ });
1926
+ ht(t.links, s, v), ht(
1927
+ s.target.targetLinks,
1928
+ s,
1929
+ v
1930
+ );
1931
+ }), e.sourceLinks = [
1932
+ ...e.sourceLinks.filter(
1933
+ (s) => s.aggregatedFrom !== e.id
1934
+ ),
1935
+ ...c
1936
+ ], t.links.push(...c), t.nodes.push(...r);
1937
+ }
1938
+ function Pa({
1939
+ parent: t,
1940
+ children: e,
1941
+ childValues: r,
1942
+ scale: n,
1943
+ graph: a,
1944
+ options: u,
1945
+ extents: o
1946
+ }) {
1947
+ const i = t.x1 - t.x0, l = t.x1, c = ja(a, t) ?? o.x1, s = Math.max(l, l + (c - l - i) / 2), v = r.map((_) => _ * n), m = Ra(e, u.nodePadding ?? 0), g = [...v, ...m].reduce(
1948
+ (_, x) => _ + x,
1949
+ 0
1950
+ );
1951
+ let h = Sa({ parent: t, children: e, totalHeight: g, extents: o });
1952
+ e.forEach((_, x) => {
1953
+ h += m[x], _.x0 = s, _.x1 = s + i, _.y0 = h, _.y1 = h + v[x], _.depth = t.depth + 0.5, _.layer = t.layer + 0.5, _.parentNodeId = t.id, _.value = r[x], _.sourceLinks = [], _.targetLinks = [], h = _.y1;
1954
+ });
1955
+ }
1956
+ function Ra(t, e) {
1957
+ return t.map(({ offset: r }, n) => n === 0 ? 0 : typeof r == "number" ? r : e);
1958
+ }
1959
+ function Sa({
1960
+ parent: t,
1961
+ children: e,
1962
+ totalHeight: r,
1963
+ extents: n
1964
+ }) {
1965
+ const { offset: a } = e[0];
1966
+ return typeof a == "number" ? t.y0 + a : Va(
1967
+ (t.y0 + t.y1) / 2 - r / 2,
1968
+ n.y0,
1969
+ Math.max(n.y0, n.y1 - r)
1970
+ );
1971
+ }
1972
+ function Ca({
1973
+ parent: t,
1974
+ children: e,
1975
+ childValues: r,
1976
+ scale: n,
1977
+ linkDefinitions: a
1978
+ }) {
1979
+ let u = t.y0;
1980
+ return e.map((o, i) => {
1981
+ const l = nt(a, t.id, o.id), c = r[i] * n, s = {
1982
+ id: (l == null ? void 0 : l.id) ?? `${t.id}:${o.id}`,
1983
+ color: l == null ? void 0 : l.color,
1984
+ curveFunction: l == null ? void 0 : l.curveFunction,
1985
+ source: t,
1986
+ target: o,
1987
+ value: r[i],
1988
+ width: c,
1989
+ y0: u + c / 2,
1990
+ y1: (o.y0 + o.y1) / 2
1991
+ };
1992
+ return u += c, o.targetLinks.push(s), s;
1993
+ });
1994
+ }
1995
+ function Ba({
1996
+ children: t,
1997
+ aggregatedLink: e,
1998
+ scale: r,
1999
+ linkDefinitions: n
2000
+ }) {
2001
+ const a = e.target;
2002
+ let u = e.y1 - e.width / 2;
2003
+ return t.reduce((o, i) => {
2004
+ const l = nt(n, i.id, a.id);
2005
+ if (!l) return o;
2006
+ const c = l.value * r, s = i.sourceLinks.reduce(
2007
+ (m, { width: g }) => m + g,
2008
+ i.y0
2009
+ ), v = {
2010
+ id: l.id,
2011
+ color: l.color,
2012
+ curveFunction: l.curveFunction,
2013
+ source: i,
2014
+ target: a,
2015
+ value: l.value,
2016
+ width: c,
2017
+ y0: s + c / 2,
2018
+ y1: u + c / 2
2019
+ };
2020
+ return u += c, i.sourceLinks.push(v), o.push(v), o;
2021
+ }, []);
2022
+ }
2023
+ function Ga(t, e) {
2024
+ return t.links.filter(
2025
+ (r) => r.aggregatedFrom === e.id
2026
+ );
2027
+ }
2028
+ function Gt(t, e) {
2029
+ return t.filter(
2030
+ (r) => M(r.source) === e
2031
+ );
2032
+ }
2033
+ function nt(t, e, r) {
2034
+ return t.find(
2035
+ (n) => M(n.source) === e && M(n.target) === r
2036
+ );
2037
+ }
2038
+ function Fa(t, e, r) {
2039
+ const n = nt(t, e.id, r.id);
2040
+ return n ? n.value : Gt(t, r.id).reduce(
2041
+ (a, { value: u }) => a + u,
2042
+ 0
2043
+ );
2044
+ }
2045
+ function ja(t, e) {
2046
+ const r = t.nodes.filter(
2047
+ (n) => n.layer === e.layer + 1
2048
+ );
2049
+ return r.length ? Math.min(...r.map(({ x0: n }) => n)) : null;
2050
+ }
2051
+ function ht(t, e, r) {
2052
+ const n = t.indexOf(e);
2053
+ if (n === -1) {
2054
+ t.push(...r);
2055
+ return;
2056
+ }
2057
+ t.splice(n, 1, ...r);
2058
+ }
2059
+ function Va(t, e, r) {
2060
+ return Math.max(e, Math.min(t, r));
2061
+ }
2062
+ const Ma = {
2063
+ nodes: [],
2064
+ links: []
2065
+ };
2066
+ function gt(t, e) {
2067
+ return e.find((r) => r.every((n) => n.layer === t.layer));
2068
+ }
2069
+ function za(t, e, r) {
2070
+ const n = I(null), {
2071
+ childIdsByParentId: a,
2072
+ expandedNodeIds: u,
2073
+ isExpandableNode: o,
2074
+ isSubNode: i,
2075
+ parentIdByChildId: l,
2076
+ toggleNodeExpansion: c
2077
+ } = Na(t), s = f(() => {
2078
+ var d, p;
2079
+ return (p = (d = t.value) == null ? void 0 : d[0]) == null ? void 0 : p.values.map(
2080
+ ({
2081
+ label: y,
2082
+ color: b,
2083
+ value: A,
2084
+ deriveColorFromIncomingLinks: $,
2085
+ expandableNodes: T,
2086
+ offset: N
2087
+ }) => ({
2088
+ label: y || A.toString(),
2089
+ color: b,
2090
+ fallbackColor: b || xe,
2091
+ id: A,
2092
+ deriveColorFromIncomingLinks: $,
2093
+ expandableNodes: T,
2094
+ offset: N
2095
+ })
2096
+ );
2097
+ }), v = f(
2098
+ () => {
2099
+ var d, p;
2100
+ return (p = (d = t.value) == null ? void 0 : d[0]) == null ? void 0 : p.values.map(
2101
+ (y) => {
2102
+ var b;
2103
+ return (b = y.targets) == null ? void 0 : b.map(
2104
+ ({ node: A, value: $, color: T, curveFunction: N }) => ({
2105
+ id: `${y.value}:${A}`,
2106
+ color: T,
2107
+ curveFunction: N,
2108
+ source: y.value ?? y.label,
2109
+ target: A,
2110
+ value: $
2111
+ })
2112
+ );
2113
+ }
2114
+ ).filter(Boolean).flat();
2115
+ }
2116
+ ), m = f(() => Xt().nodeId(M).nodeAlign(e.value.nodeAlign).nodePadding(e.value.nodePadding).nodeSort(e.value.nodeSort).nodeWidth(e.value.nodeWidth).linkSort(e.value.linkSort).iterations(e.value.iterations)), g = f(() => {
2117
+ var d;
2118
+ return (d = n.value) == null ? void 0 : d.nodes.filter((p) => p.parentNodeId == null).reduce((p, y) => {
2119
+ const b = gt(y, p);
2120
+ return b ? (b.push(y), b.sort((A, $) => (A._y0 || A.y0) - ($._y0 || $.y0))) : p.push([y]), p;
2121
+ }, []).sort((p, y) => p[0].layer - y[0].layer);
2122
+ });
2123
+ function h(d) {
2124
+ const { offset: p } = d, y = gt(d, g.value);
2125
+ if (!y) return;
2126
+ const b = y[y.findIndex(($) => $.id === d.id) - 1], A = b && y.length !== 1 ? b.y1 + p : p;
2127
+ d._y0 = d.y0, d._y1 = d.y1, d.y0 = A, d.y1 = d.y0 + (d._y1 - d._y0);
2128
+ }
2129
+ function _(d, p) {
2130
+ const { id: y, _y0: b, y0: A } = d, $ = p.links.filter(
2131
+ (S) => S.source.id === y
2132
+ ), T = p.links.filter(
2133
+ (S) => S.target.id === y
2134
+ ), N = A - b;
2135
+ $.forEach((S) => S.y0 += N), T.forEach((S) => S.y1 += N);
2136
+ }
2137
+ const x = f(() => {
2138
+ var d;
2139
+ return n.value && ((d = s.value) == null || d.forEach((p) => {
2140
+ p.value === 0 && (p.fallbackColor = Je.Grey), typeof p.offset == "number" && !i(p.id) && (h(p), _(p, n.value));
2141
+ })), n.value;
2142
+ });
2143
+ return H([m, r, u], () => {
2144
+ try {
2145
+ const { x0: d, y0: p, x1: y, y1: b } = r.value, A = m.value.extent([
2146
+ [d, p],
2147
+ [y, b]
2148
+ ])(
2149
+ wa(
2150
+ s.value,
2151
+ v.value,
2152
+ a.value,
2153
+ l.value
2154
+ )
2155
+ );
2156
+ Da({
2157
+ graph: A,
2158
+ nodes: s.value,
2159
+ linkDefinitions: v.value,
2160
+ expandedNodeIds: u.value,
2161
+ childIdsByParentId: a.value,
2162
+ options: e.value,
2163
+ extents: r.value
2164
+ }), n.value = A;
2165
+ } catch (d) {
2166
+ Me(Ie.GraphProblem, d), n.value = Ma;
2167
+ }
2168
+ }), { columns: g, graph: x, isExpandableNode: o, toggleNodeExpansion: c };
2169
+ }
2170
+ function ze(t, e) {
2171
+ return e || (e = {}), t.targetLinks && t.targetLinks.forEach(({ source: r, value: n }) => {
2172
+ e[r.id] = n, ze(
2173
+ r,
2174
+ e
2175
+ );
2176
+ }), e;
2177
+ }
2178
+ function We(t, e) {
2179
+ return e || (e = {}), t.sourceLinks && t.sourceLinks.forEach(({ target: r, value: n }) => {
2180
+ e[r.id] = n, We(
2181
+ r,
2182
+ e
2183
+ );
2184
+ }), e;
2185
+ }
2186
+ function Wa(t, e) {
2187
+ return e.links.reduce((r, n) => (n.source.id in t && n.target.id in t && r.push(n.id), r), []);
2188
+ }
2189
+ const Ua = (t, e) => {
2190
+ let r;
2191
+ Bt(t) ? r = {
2192
+ [t.id]: t.value,
2193
+ ...ze(t),
2194
+ ...We(t)
2195
+ } : r = {
2196
+ [t.source.id]: t.source.value,
2197
+ [t.target.id]: t.target.value,
2198
+ ...ze(t.source),
2199
+ ...We(t.target)
2200
+ };
2201
+ const n = Wa(r, e);
2202
+ return { nodes: r, links: n };
2203
+ }, Za = (t) => {
2204
+ if (Bt(t)) {
2205
+ const e = [...t.sourceLinks, ...t.targetLinks];
2206
+ return {
2207
+ nodes: e.reduce(
2208
+ (r, { source: n, target: a, value: u }) => n === t ? { ...r, [M(a)]: u } : { ...r, [M(n)]: u },
2209
+ { [M(t)]: t.value }
2210
+ ),
2211
+ links: e.map(({ id: r }) => r)
2212
+ };
2213
+ }
2214
+ return {
2215
+ nodes: {
2216
+ [M(t.target)]: t.value,
2217
+ [M(t.source)]: t.source.value
2218
+ },
2219
+ links: [t.id]
2220
+ };
2221
+ };
2222
+ function Xa(t, e, r) {
2223
+ const n = I(null), a = f(() => n.value ? typeof e.value.highlightedElements == "function" ? e.value.highlightedElements(
2224
+ n.value,
2225
+ r.value
2226
+ ) : e.value.highlightedElements === "closest" ? Za(n.value, r.value) : Ua(n.value, r.value) : { nodes: {}, links: [] });
2227
+ return H(a, (u, o) => {
2228
+ if (u.links.length === 0 && Object.keys(u.nodes).length === 0) {
2229
+ t.value.forEach((i) => {
2230
+ i.node.id in o.nodes && _t(
2231
+ i,
2232
+ o.nodes[i.node.id],
2233
+ i.node.value,
2234
+ e.value.withTransition,
2235
+ !0
2236
+ );
2237
+ });
2238
+ return;
2239
+ }
2240
+ t.value.forEach((i) => {
2241
+ i.node.id in u.nodes && _t(
2242
+ i,
2243
+ i.node.value,
2244
+ u.nodes[i.node.id],
2245
+ e.value.withTransition
2246
+ );
2247
+ });
2248
+ }), { highlightedElements: a, hoveredElement: n };
2249
+ }
2250
+ const Ya = /* @__PURE__ */ R({
2251
+ __name: "lume-alluvial-group",
2252
+ props: {
2253
+ ...we(),
2254
+ hoveredElementId: {
2255
+ type: [Number, String],
2256
+ default: null
2257
+ }
2258
+ },
2259
+ emits: ["node-click", "node-mouseenter", "node-mouseleave", "link-click", "link-mouseenter", "link-mouseleave"],
2260
+ setup(t, { emit: e }) {
2261
+ const r = t, n = Ee("chartID"), { data: a, options: u } = F(r), o = I([]), i = I([]), l = I(null), c = I(null), s = I(null), { extents: v, updateExtents: m } = ga(r.containerSize), { columns: g, graph: h, isExpandableNode: _, toggleNodeExpansion: x } = za(a, u, v), { hoveredElement: d, highlightedElements: p } = Xa(
2262
+ o,
2263
+ u,
2264
+ h
2265
+ ), y = f(() => Oe(u.value.valueFormat)), b = f(
2266
+ () => Object.keys(p.value.nodes)
2267
+ ), A = f(() => g.value ? g.value.map(
2268
+ (L) => L[0].x0 + u.value.nodeWidth / 2
2269
+ ) : []), $ = f(() => {
2270
+ if (!(!u.value.nodeHeaders || !u.value.nodeHeaders.length))
2271
+ return u.value.nodeHeaders.slice(0, A.value.length).map((L, C) => ({
2272
+ label: L,
2273
+ x: A.value[C]
2274
+ }));
2275
+ }), T = f(
2276
+ () => u.value.nodeHeaderPadding ?? ea
2277
+ ), N = f(() => {
2278
+ if (!(!u.value.gradient || !h.value))
2279
+ return h.value.links.reduce((L, C) => {
2280
+ const { source: B, target: W } = C, U = B.color || B.fallbackColor, z = W.deriveColorFromIncomingLinks ? U : W.color || W.fallbackColor;
2281
+ return L[C.id] = {
2282
+ source: U,
2283
+ target: z,
2284
+ x1: B.x1,
2285
+ x2: W.x0
2286
+ }, L;
2287
+ }, {});
2288
+ }), S = f(() => {
2289
+ const L = o.value.filter(
2290
+ (B) => te(B)
2291
+ ), C = [];
2292
+ return L.forEach((B) => {
2293
+ const W = [];
2294
+ i.value.filter(({ link: U }) => U.target.id === B.node.id).reverse().reduce((U, z, at, Le) => {
2295
+ const ve = z.link.target.y1 - z.link.target.y0 > he;
2296
+ let le, fe, pe;
2297
+ return ve ? (le = z.link.target.y1 - z.link.target.y0, fe = z.link.value / B.node.value, pe = fe * le) : pe = he / Le.length, W.push({
2298
+ x: B.x,
2299
+ y: B.y + U,
2300
+ height: pe,
2301
+ width: B.width,
2302
+ key: `node-block-${B.node.id}-source-link-${z.link.source.id}`,
2303
+ class: `lume-alluvial-group__node-block lume-fill--${z.link.source.color || xe}`
2304
+ }), U + pe;
2305
+ }, 0), C.push({
2306
+ id: B.node.id,
2307
+ subNodes: W
2308
+ });
2309
+ }), C;
2310
+ });
2311
+ function j(L) {
2312
+ return u.value.gradient && `url('#${n}_${L.id}')`;
2313
+ }
2314
+ function V(L) {
2315
+ return b.value.length > 0 && !b.value.includes(L.toString());
2316
+ }
2317
+ function ee(L) {
2318
+ return b.value.length > 0 && b.value.includes(L.toString());
2319
+ }
2320
+ function de(L) {
2321
+ return p.value.links.length > 0 && !p.value.links.includes(L);
2322
+ }
2323
+ function oe(L) {
2324
+ return p.value.links.length > 0 && p.value.links.includes(L);
2325
+ }
2326
+ function te(L) {
2327
+ return !L.node.color && L.node.deriveColorFromIncomingLinks;
2328
+ }
2329
+ function ue(L, C) {
2330
+ _(L.id) && x(L.id), e("node-click", { node: L, event: C });
2331
+ }
2332
+ function E(L, C) {
2333
+ L !== d.value && (d.value = L, e("link-mouseenter", { link: L, event: C }));
2334
+ }
2335
+ function w(L) {
2336
+ const C = d.value;
2337
+ d.value = null, e("link-mouseleave", { link: C, event: L });
2338
+ }
2339
+ function P(L) {
2340
+ if (L == null) {
2341
+ d.value = null;
2342
+ return;
2343
+ }
2344
+ const C = ka(L, h.value) || xa(L, h.value);
2345
+ if (!C) {
2346
+ re(J.InvalidHoveredElement);
2347
+ return;
2348
+ }
2349
+ d.value = C;
2350
+ }
2351
+ function ne(L) {
2352
+ var C;
2353
+ return ((C = S.value.find(({ id: B }) => L === B)) == null ? void 0 : C.subNodes) ?? [];
2354
+ }
2355
+ function Ae() {
2356
+ const L = Aa(h.value, l.value);
2357
+ m(L);
2358
+ }
2359
+ return H(h, (L) => {
2360
+ o.value = La(L.nodes), i.value = Ea(L.links).reverse(), d.value == null && r.hoveredElementId != null && P(r.hoveredElementId);
2361
+ }), H([c, s], () => {
2362
+ d.value = c.value ?? s.value;
2363
+ }), H([r.containerSize, l], () => {
2364
+ r.containerSize.width && r.containerSize.height && Ae();
2365
+ }), H(() => r.hoveredElementId, P), { __sfc: !0, props: r, emit: e, chartID: n, data: a, options: u, nodeBlocks: o, linkPaths: i, nodeTextRefs: l, pointedNode: c, focusedNode: s, extents: v, updateExtents: m, columns: g, graph: h, isExpandableNode: _, toggleNodeExpansion: x, hoveredElement: d, highlightedElements: p, formatValue: y, hoveredNodeIds: b, nodeColumnPositions: A, nodeHeaders: $, computedNodeHeaderPadding: T, gradients: N, nodesDerivingColorFromIncomingLinks: S, getLinkStroke: j, isNodeFaded: V, isNodeFocused: ee, isLinkFaded: de, isLinkFocused: oe, shouldDeriveNodeColorFromIncomingLinks: te, handleNodeClick: ue, handleLinkMouseover: E, handleLinkMouseleave: w, handleExternalHover: P, getSubNodesDerivingColorFromIncomingLinks: ne, updateMargins: Ae, LumeAlluvialNodeLabel: la, LumeAlluvialNodeValue: va, LumeAlluvialNodeHeader: ha, GHOST_STROKE_WIDTH_OFFSET: qr, NODE_OUTLINE_PADDING: ta, NODE_OUTLINE_RADIUS: na };
2366
+ }
2367
+ });
2368
+ var Ka = function() {
2369
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2370
+ return r("g", { staticClass: "lume-alluvial-group", attrs: { "data-j-alluvial-group": "" } }, [n.nodeHeaders ? r("g", [e._l(n.nodeHeaders, function(a, u) {
2371
+ return [e._t(`node-header-${u}`, function() {
2372
+ return [r(n.LumeAlluvialNodeHeader, { key: `header_${a.x}`, attrs: { x: a.x, y: -n.computedNodeHeaderPadding } }, [e._v(" " + e._s(a.label) + " ")])];
2373
+ }, { x: a.x, y: -n.computedNodeHeaderPadding })];
2374
+ })], 2) : e._e(), r("g", { staticClass: "lume-alluvial-link-group", on: { mouseleave: n.handleLinkMouseleave } }, [n.options.gradient ? r("defs", e._l(n.gradients, function(a, u) {
2375
+ return r("linearGradient", { key: u, attrs: { id: `${n.chartID}_${u}`, gradientUnits: "userSpaceOnUse", x1: a.x1, x2: a.x2 } }, [r("stop", { attrs: { offset: "0%", "stop-color": `var(--lume-color--${a.source})` } }), r("stop", { attrs: { offset: "100%", "stop-color": `var(--lume-color--${a.target})` } })], 1);
2376
+ }), 1) : e._e(), e._l(n.linkPaths, function(a) {
2377
+ return r("path", { key: `link-ghost_${a.id}`, staticClass: "lume-alluvial-group__link", class: [
2378
+ "lume-stroke--transparent",
2379
+ "lume-alluvial-group__link--ghost"
2380
+ ], attrs: { d: a.d, "stroke-width": a.strokeWidth + n.GHOST_STROKE_WIDTH_OFFSET, "data-j-alluvial-ghost": "" }, on: { click: function(u) {
2381
+ return n.emit("link-click", { link: a.link, event: u });
2382
+ }, mouseover: function(u) {
2383
+ return n.handleLinkMouseover(a.link, u);
2384
+ } } });
2385
+ }), e._l(n.linkPaths, function(a) {
2386
+ return r("path", { key: `link_${a.id}`, staticClass: "lume-alluvial-group__link", class: {
2387
+ [`lume-stroke--${a.color}`]: !n.options.gradient && a.color,
2388
+ "lume-alluvial-group__link--faded": n.isLinkFaded(a.id),
2389
+ "lume-alluvial-group__link--focused": n.isLinkFocused(a.id)
2390
+ }, attrs: { d: a.d, stroke: n.getLinkStroke(a.link), "stroke-dasharray": e.containerSize.width, "stroke-dashoffset": e.containerSize.width, "stroke-width": a.strokeWidth, "data-j-alluvial-path": "", "data-id": a.id }, on: { click: function(u) {
2391
+ return n.emit("link-click", { link: a.link, event: u });
2392
+ }, mouseover: function(u) {
2393
+ return n.handleLinkMouseover(a.link, u);
2394
+ } } });
2395
+ })], 2), e._l(n.nodeBlocks, function(a, u) {
2396
+ return r("g", { key: `node-block_${u}`, staticClass: "lume-alluvial-group__node", class: {
2397
+ "lume-alluvial-group__node--expandable": n.isExpandableNode(
2398
+ a.node.id
2399
+ ),
2400
+ "lume-alluvial-group__node--faded": n.isNodeFaded(a.node.id),
2401
+ "lume-alluvial-group__node--focused": n.isNodeFocused(a.node.id)
2402
+ }, attrs: { "data-j-alluvial-group__node-block": "" } }, [r("g", { attrs: { tabindex: n.isExpandableNode(a.node.id) ? "0" : null }, on: { click: function(o) {
2403
+ return n.handleNodeClick(a.node, o);
2404
+ }, keydown: [function(o) {
2405
+ return !o.type.indexOf("key") && e._k(o.keyCode, "enter", 13, o.key, "Enter") ? null : (o.preventDefault(), n.handleNodeClick(a.node, o));
2406
+ }, function(o) {
2407
+ return !o.type.indexOf("key") && e._k(o.keyCode, "space", 32, o.key, [" ", "Spacebar"]) ? null : (o.preventDefault(), n.handleNodeClick(a.node, o));
2408
+ }], mouseenter: function(o) {
2409
+ return n.emit("node-mouseenter", { node: a.node, event: o });
2410
+ }, mouseleave: function(o) {
2411
+ return n.emit("node-mouseleave", { node: a.node, event: o });
2412
+ }, mouseover: function(o) {
2413
+ n.pointedNode = a.node;
2414
+ }, mouseout: function(o) {
2415
+ n.pointedNode = null;
2416
+ }, focus: function(o) {
2417
+ n.focusedNode = a.node;
2418
+ }, blur: function(o) {
2419
+ n.focusedNode = null;
2420
+ } } }, [n.shouldDeriveNodeColorFromIncomingLinks(a) ? e._l(n.getSubNodesDerivingColorFromIncomingLinks(
2421
+ a.node.id
2422
+ ), function(o) {
2423
+ return r("rect", e._b({ key: o.key, attrs: { "data-j-alluvial-sub-nodes": "" } }, "rect", o, !1));
2424
+ }) : r("rect", { staticClass: "lume-alluvial-group__node-block", class: `lume-fill--${a.node.color || a.node.fallbackColor}`, attrs: { x: a.x, y: a.y, height: a.height, width: a.width } }), n.isExpandableNode(a.node.id) ? r("rect", { staticClass: "lume-alluvial-group__node-outline", class: `lume-stroke--${a.node.color || a.node.fallbackColor}`, attrs: { x: a.x - n.NODE_OUTLINE_PADDING, y: a.y - n.NODE_OUTLINE_PADDING, height: a.height + n.NODE_OUTLINE_PADDING * 2, width: a.width + n.NODE_OUTLINE_PADDING * 2, rx: n.NODE_OUTLINE_RADIUS, "data-j-alluvial-node-outline": "" } }) : e._e(), r("g", { ref: "nodeTextRefs", refInFor: !0, staticClass: "lume-alluvial-group__node-text lume-typography--caption", class: {
2425
+ "lume-alluvial-group__node-text--left": a.node.depth === 0
2426
+ }, attrs: { transform: `translate(${a.textTransform.x},${a.textTransform.y})`, "data-id": a.node.id, width: n.options.nodeLabelMaxWidth } }, [e._t(`node-text-${a.node.id}`, function() {
2427
+ return [r(n.LumeAlluvialNodeLabel, { attrs: { bottom: n.options.switchText, left: a.node.depth === 0, "max-width": n.options.nodeLabelMaxWidth }, on: { "lume__internal--node-resize": n.updateMargins } }, [e._v(" " + e._s(a.node.label) + " ")]), r(n.LumeAlluvialNodeValue, { attrs: { bottom: !n.options.switchText } }, [e._v(" " + e._s(n.formatValue(a.node.transitionValue || a.node.value, a.node.value)) + " ")])];
2428
+ }, { node: a.node, value: n.formatValue(
2429
+ a.node.transitionValue || a.node.value,
2430
+ a.node.value
2431
+ ) })], 2)], 2)]);
2432
+ })], 2);
2433
+ }, Ja = [], Qa = /* @__PURE__ */ D(
2434
+ Ya,
2435
+ Ka,
2436
+ Ja,
2437
+ !1,
2438
+ null,
2439
+ "a9818a4f"
2440
+ );
2441
+ const qa = Qa.exports, eo = {
2442
+ margins: {
2443
+ top: 0,
2444
+ right: 0,
2445
+ bottom: 0,
2446
+ left: 0
2447
+ },
2448
+ withAxes: !1,
2449
+ withTooltip: !1,
2450
+ withHover: !1,
2451
+ withLegend: !1,
2452
+ // Alluvial options
2453
+ gradient: !1,
2454
+ highlightedElements: "closest",
2455
+ nodePadding: 16,
2456
+ nodeWidth: 16,
2457
+ nodeAlign: Yt,
2458
+ valueFormat: (t) => String(t),
2459
+ iterations: 6
2460
+ }, to = /* @__PURE__ */ R({
2461
+ __name: "lume-alluvial-diagram",
2462
+ props: {
2463
+ ...tr(Ze)
2464
+ },
2465
+ setup(t, { emit: e }) {
2466
+ const r = t, { componentEventPropagator: n } = q(e), a = ce(X()), u = gn(X()), { options: o } = F(r), { allOptions: i } = Q(o, eo);
2467
+ function l(c) {
2468
+ return {
2469
+ ...c,
2470
+ noBaseScales: !0
2471
+ // Alluvial chart never uses base scales
2472
+ };
2473
+ }
2474
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, groupSlots: u, options: o, allOptions: i, getAlluvialDiagramOptions: l, LumeChart: _e, LumeAlluvialGroup: qa };
2475
+ }
2476
+ });
2477
+ var no = function() {
2478
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2479
+ return r(n.LumeChart, e._g(e._b({ attrs: { options: n.getAlluvialDiagramOptions(n.allOptions), "data-j-alluvial-diagram": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
2480
+ return [r(n.LumeAlluvialGroup, e._g(e._b({ attrs: { "hovered-element-id": e.hoveredElement }, scopedSlots: e._u([e._l(n.groupSlots, function(u, o) {
2481
+ return { key: o, fn: function(i) {
2482
+ return [e._t(o, null, null, i || {})];
2483
+ } };
2484
+ })], null, !0) }, "lume-alluvial-group", a, !1), n.componentEventPropagator))];
2485
+ } }, e._l(n.slots, function(a, u) {
2486
+ return { key: u, fn: function(o) {
2487
+ return [e._t(u, null, null, o || {})];
2488
+ } };
2489
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2490
+ }, ro = [], ao = /* @__PURE__ */ D(
2491
+ to,
2492
+ no,
2493
+ ro,
2494
+ !1,
2495
+ null,
2496
+ null
2497
+ );
2498
+ const gu = ao.exports;
2499
+ var Ue = /* @__PURE__ */ ((t) => (t.grouped = "grouped", t.stacked = "stacked", t))(Ue || {});
2500
+ const oo = /* @__PURE__ */ R({
2501
+ __name: "lume-bar-chart",
2502
+ props: {
2503
+ ...me(),
2504
+ type: {
2505
+ type: String,
2506
+ default: null,
2507
+ validator: (t) => t in Ue || t == null
2508
+ }
2509
+ },
2510
+ setup(t, { emit: e }) {
2511
+ const r = t, n = He(
2512
+ () => import("./Aka2OjK8.js")
2513
+ ), a = He(
2514
+ () => import("./BkCJnqDA.js")
2515
+ ), u = He(
2516
+ () => import("./BAc0dIxQ.js")
2517
+ ), o = /* @__PURE__ */ new Map([
2518
+ ["single", n],
2519
+ ["grouped", a],
2520
+ ["stacked", u]
2521
+ ]), { componentEventPropagator: i } = q(e), l = ce(X());
2522
+ function c(v) {
2523
+ return {
2524
+ ...v,
2525
+ startOnZero: !0,
2526
+ // Bar chart always starts on zero,
2527
+ tooltipOptions: {
2528
+ ...(v == null ? void 0 : v.tooltipOptions) || {},
2529
+ position: r.orientation === O.HORIZONTAL ? "right" : void 0
2530
+ }
2531
+ };
2532
+ }
2533
+ const s = f(() => {
2534
+ if (Ze(r.data)) return o.get("single");
2535
+ if (!r.type)
2536
+ throw new Error("Bar chart needs a type when there's multiple datasets.");
2537
+ return o.get(r.type);
2538
+ });
2539
+ return { __sfc: !0, TYPES: Ue, LumeSingleBarChart: n, LumeGroupedBarChart: a, LumeStackedBarChart: u, COMPONENT_MAP: o, props: r, emit: e, componentEventPropagator: i, slots: l, getBarChartOptions: c, component: s };
2540
+ }
2541
+ });
2542
+ var uo = function() {
2543
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2544
+ return r(n.component, e._g(e._b({ tag: "component", attrs: { options: n.getBarChartOptions(e.options) }, scopedSlots: e._u([e._l(n.slots, function(a, u) {
2545
+ return { key: u, fn: function(o) {
2546
+ return [e._t(u, null, null, o || {})];
2547
+ } };
2548
+ })], null, !0) }, "component", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2549
+ }, lo = [], io = /* @__PURE__ */ D(
2550
+ oo,
2551
+ uo,
2552
+ lo,
2553
+ !1,
2554
+ null,
2555
+ null
2556
+ );
2557
+ const yu = io.exports;
2558
+ function so(t) {
2559
+ return Object.values(xn).includes(t) || t == null;
2560
+ }
2561
+ function co(t) {
2562
+ return Object.values(O).includes(t);
2563
+ }
2564
+ const vo = (t = !1) => ({
2565
+ type: {
2566
+ type: String,
2567
+ default: null,
2568
+ validator: so
2569
+ },
2570
+ ...t ? {
2571
+ orientation: {
2572
+ type: String,
2573
+ default: O.VERTICAL,
2574
+ validator: co
2575
+ }
2576
+ } : {}
2577
+ });
2578
+ function Ft(t, e) {
2579
+ const r = f(() => t.value.map((a) => {
2580
+ var u;
2581
+ return {
2582
+ ...a,
2583
+ values: Xe(
2584
+ a.values,
2585
+ ((u = e == null ? void 0 : e.value) == null ? void 0 : u.length) ?? 0
2586
+ ).map((o) => ({
2587
+ ...o,
2588
+ value: (o == null ? void 0 : o.value) || 0
2589
+ }))
2590
+ };
2591
+ })), n = f(() => {
2592
+ var a;
2593
+ return (a = r.value) == null ? void 0 : a.reduce((u, o) => (o.values.forEach((i, l) => {
2594
+ u[l] ? u[l].push(i) : u[l] = [i];
2595
+ }), u), []);
2596
+ });
2597
+ return { multiBarData: r, groupedData: n };
2598
+ }
2599
+ function fo(t, e) {
2600
+ return t.value.length === 1 ? "single" : e.value;
2601
+ }
2602
+ function po(t, e, r) {
2603
+ const n = f(
2604
+ () => r.value === O.HORIZONTAL
2605
+ );
2606
+ function a(i) {
2607
+ i || Me(Ie.BarScaleNull), Math.min(...i.domain()) > 0 && Me(Ie.BarScaleDomainAbove0);
2608
+ }
2609
+ const u = f(() => n.value ? (a(t.value), t.value) : t.value), o = f(() => n.value ? e.value : (a(e.value), e.value));
2610
+ return { barXScale: u, barYScale: o };
2611
+ }
2612
+ const mo = {
2613
+ x: 0,
2614
+ y: 0,
2615
+ width: 0,
2616
+ height: 0
2617
+ };
2618
+ function _o(t, e, r, n, a, u) {
2619
+ const o = f(
2620
+ () => n.value === O.HORIZONTAL
2621
+ );
2622
+ function i(v, m) {
2623
+ let g, h;
2624
+ return o.value ? (g = v >= 0 ? e.value(0) : e.value(v), h = r.value(r.value.domain()[m])) : (g = e.value(e.value.domain()[m]), h = v < 0 ? r.value(0) : r.value(v)), { x: g, y: h };
2625
+ }
2626
+ function l(v) {
2627
+ return o.value ? v < 0 ? e.value(0) - e.value(v) : e.value(v) - e.value(0) : e.value.bandwidth();
2628
+ }
2629
+ function c(v) {
2630
+ return o.value ? r.value.bandwidth() : v < 0 ? r.value(v) - r.value(0) : r.value(0) - r.value(v);
2631
+ }
2632
+ function s(v, m, g) {
2633
+ if (!(e.value && r.value)) return mo;
2634
+ const { value: _, color: x } = v, d = x ?? t.value[m].color ?? xe, { x: p, y } = i(_, g), b = l(_), A = c(_);
2635
+ return {
2636
+ classList: [`lume-fill--${d}`, ...u],
2637
+ x: p,
2638
+ y,
2639
+ width: b,
2640
+ height: A,
2641
+ isFaded: a.value !== -1 && a.value !== g,
2642
+ isNegative: _ < 0
2643
+ };
2644
+ }
2645
+ return { barAttributeGenerator: s };
2646
+ }
2647
+ const ho = {
2648
+ x: 0,
2649
+ y: 0,
2650
+ width: 0,
2651
+ height: 0
2652
+ };
2653
+ function go(t, e, r, n, a, u) {
2654
+ const o = f(
2655
+ () => n.value === O.HORIZONTAL
2656
+ ), i = f(() => ye().domain(t.value.map((h, _) => _)).range([0, e.value.bandwidth()]).padding(0)), l = f(() => ye().domain(t.value.map((h, _) => _)).range([0, r.value.bandwidth()]).padding(0));
2657
+ function c(h, _, x) {
2658
+ if (o.value)
2659
+ return h >= 0 ? e.value(0) : e.value(h);
2660
+ const d = e.value.domain();
2661
+ return e.value(d[_]) + i.value(x);
2662
+ }
2663
+ function s(h, _, x) {
2664
+ if (o.value) {
2665
+ const d = r.value.domain();
2666
+ return r.value(d[_]) + l.value(x);
2667
+ }
2668
+ return h < 0 ? r.value(0) : r.value(h);
2669
+ }
2670
+ function v(h) {
2671
+ return o.value ? h < 0 ? e.value(0) - e.value(h) : e.value(h) - e.value(0) : i.value.bandwidth();
2672
+ }
2673
+ function m(h) {
2674
+ return o.value ? l.value.bandwidth() : h < 0 ? r.value(h) - r.value(0) : r.value(0) - r.value(h);
2675
+ }
2676
+ function g(h, _, x) {
2677
+ if (!(e.value && r.value)) return ho;
2678
+ const { value: p, color: y } = h, b = y ?? t.value[_].color ?? Object.values(Y)[_], A = c(p, x, _), $ = s(p, x, _), T = v(p), N = m(p);
2679
+ return {
2680
+ classList: [`lume-fill--${b}`, ...u],
2681
+ x: A,
2682
+ y: $,
2683
+ width: T,
2684
+ height: N,
2685
+ isFaded: a.value !== -1 && a.value !== x,
2686
+ isNegative: p < 0
2687
+ };
2688
+ }
2689
+ return { barAttributeGenerator: g };
2690
+ }
2691
+ function yo(t, e, r) {
2692
+ const n = f(
2693
+ () => e.value === O.HORIZONTAL
2694
+ ), a = f(() => {
2695
+ const l = t.value.map(
2696
+ (c) => c.filter((s) => s.value < 0).reduce((s, v) => s + v.value, 0)
2697
+ );
2698
+ return Math.min(...l);
2699
+ }), u = f(() => {
2700
+ const l = t.value.map(
2701
+ (c) => c.reduce(
2702
+ (s, v) => v.value >= 0 ? s + v.value : s,
2703
+ 0
2704
+ )
2705
+ );
2706
+ return Math.max(...l);
2707
+ });
2708
+ function o(l, c, s) {
2709
+ return c.length ? n.value ? ge().domain([a.value, u.value]).range([0, s.width]) : Object.assign(
2710
+ dt(
2711
+ ye().domain(c.map((v, m) => m)).range([0, s.width]),
2712
+ e.value,
2713
+ r.value
2714
+ ),
2715
+ { labels: c }
2716
+ ) : null;
2717
+ }
2718
+ function i(l, c, s) {
2719
+ return c.length ? n.value ? Object.assign(
2720
+ dt(
2721
+ ye().domain(c.map((v, m) => m)).range([0, s.height]),
2722
+ e.value,
2723
+ r.value
2724
+ ),
2725
+ { labels: c }
2726
+ ) : ge().domain([u.value, a.value]).range([0, s.height]) : null;
2727
+ }
2728
+ return { stackedXScaleGenerator: o, stackedYScaleGenerator: i };
2729
+ }
2730
+ function bo(t, e, r, n, a, u) {
2731
+ const o = f(
2732
+ () => n.value === O.HORIZONTAL
2733
+ ), i = f(
2734
+ () => o.value ? r.value.domain() : e.value.domain()
2735
+ ), l = f(
2736
+ () => t.value.map((d) => d.values.map((p) => p == null ? void 0 : p.value))
2737
+ );
2738
+ function c(d, p, y) {
2739
+ let b, A;
2740
+ return o.value ? (b = e.value(d >= 0 ? 0 + y : d + y), A = r.value(i.value[p])) : (b = e.value(i.value[p]), A = r.value(d >= 0 ? d + y : 0 + y)), { x: b, y: A };
2741
+ }
2742
+ function s(d) {
2743
+ return o.value ? e.value(d) - e.value(0) : e.value.bandwidth();
2744
+ }
2745
+ function v(d) {
2746
+ return o.value ? e.value(0) - e.value(d) : e.value.bandwidth();
2747
+ }
2748
+ function m(d) {
2749
+ return o.value ? r.value.bandwidth() : r.value(0) - r.value(d);
2750
+ }
2751
+ function g(d) {
2752
+ return o.value ? r.value.bandwidth() : r.value(d) - r.value(0);
2753
+ }
2754
+ function h(d, p) {
2755
+ return d ? l.value.reduce((y, b, A) => (A < d && b[p] >= 0 && (y += b[p]), y), 0) : 0;
2756
+ }
2757
+ function _(d, p) {
2758
+ return d ? l.value.reduce((y, b, A) => (A < d && b[p] < 0 && (y += b[p]), y), 0) : 0;
2759
+ }
2760
+ function x(d, p, y) {
2761
+ const { value: b, color: A } = d, $ = b >= 0 ? s(b) : v(b), T = b >= 0 ? m(b) : g(b), N = b >= 0 ? h(p, y) : _(p, y), { x: S, y: j } = c(b, y, N);
2762
+ return {
2763
+ classList: [`lume-fill--${A ?? t.value[p].color ?? Object.values(Y)[p]}`, ...u],
2764
+ width: $,
2765
+ height: T,
2766
+ x: S,
2767
+ y: j,
2768
+ isFaded: a.value !== -1 && a.value !== y,
2769
+ isNegative: b < 0
2770
+ };
2771
+ }
2772
+ return { barAttributeGenerator: x };
2773
+ }
2774
+ const yt = {
2775
+ single: _o,
2776
+ grouped: go,
2777
+ stacked: bo
2778
+ }, ko = /* @__PURE__ */ R({
2779
+ __name: "lume-bar-group",
2780
+ props: {
2781
+ ...we(),
2782
+ classList: {
2783
+ type: [String, Array],
2784
+ default: () => []
2785
+ },
2786
+ ...vo(!0),
2787
+ transition: {
2788
+ type: Boolean,
2789
+ default: !0
2790
+ }
2791
+ },
2792
+ emits: ["bar-click", "lume__internal--hover"],
2793
+ setup(t, { emit: e }) {
2794
+ const r = t, {
2795
+ data: n,
2796
+ hoveredIndex: a,
2797
+ orientation: u,
2798
+ transition: o,
2799
+ type: i,
2800
+ xScale: l,
2801
+ yScale: c,
2802
+ classList: s,
2803
+ labels: v
2804
+ } = F(r), m = Ee("chartID"), { emitInternalEvent: g } = q(e, m), { groupedData: h } = Ft(n, v), { barXScale: _, barYScale: x } = po(l, c, u), d = f(() => typeof s.value == "string" ? [s.value] : s.value), p = f(() => {
2805
+ const A = fo(n, i), { barAttributeGenerator: $ } = yt[A](
2806
+ n,
2807
+ _,
2808
+ x,
2809
+ u,
2810
+ a,
2811
+ d.value
2812
+ );
2813
+ return $;
2814
+ }), y = f(() => {
2815
+ if (o.value)
2816
+ return u.value === O.HORIZONTAL ? "width" : "height";
2817
+ });
2818
+ async function b(A) {
2819
+ e("lume__internal--hover", A), g("lume__internal--hover", A);
2820
+ }
2821
+ return { __sfc: !0, MIXIN_MAP: yt, props: r, emit: e, data: n, hoveredIndex: a, orientation: u, transition: o, type: i, xScale: l, yScale: c, classList: s, labels: v, chartID: m, emitInternalEvent: g, groupedData: h, barXScale: _, barYScale: x, computedClasses: d, getBarAttributes: p, computedTransition: y, handleInternalHover: b, LumeBar: Ye };
2822
+ }
2823
+ });
2824
+ var xo = function() {
2825
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2826
+ return r("g", { staticClass: "lume-bar-group", attrs: { "data-j-bars-group": "" } }, e._l(n.groupedData, function(a, u) {
2827
+ return r("g", { key: u, on: { mouseenter: function(o) {
2828
+ return n.handleInternalHover(u);
2829
+ } } }, e._l(a, function(o, i) {
2830
+ return r(n.LumeBar, e._b({ key: `bar-${i}`, attrs: { transition: n.computedTransition, "data-j-lume-bar": "" }, on: { click: function(l) {
2831
+ return n.emit("bar-click", {
2832
+ index: u,
2833
+ datasetIndex: i,
2834
+ event: l
2835
+ });
2836
+ } } }, "lume-bar", n.getBarAttributes(o, i, u, a), !1));
2837
+ }), 1);
2838
+ }), 0);
2839
+ }, Ao = [], Lo = /* @__PURE__ */ D(
2840
+ ko,
2841
+ xo,
2842
+ Ao,
2843
+ !1,
2844
+ null,
2845
+ null
2846
+ );
2847
+ const rt = Lo.exports, To = {
2848
+ [O.VERTICAL]: {
2849
+ withTooltip: !0,
2850
+ xAxisOptions: {},
2851
+ yAxisOptions: { gridLines: !0 },
2852
+ margins: se.VERTICAL
2853
+ },
2854
+ [O.HORIZONTAL]: {
2855
+ withTooltip: !0,
2856
+ xAxisOptions: { gridLines: !0 },
2857
+ yAxisOptions: { gridLines: !1 },
2858
+ margins: se.HORIZONTAL
2859
+ }
2860
+ }, Oo = /* @__PURE__ */ R({
2861
+ __name: "lume-single-bar-chart",
2862
+ props: {
2863
+ ...me(Ze)
2864
+ },
2865
+ setup(t, { emit: e }) {
2866
+ const r = t, { componentEventPropagator: n } = q(e), a = ce(X()), { orientation: u, options: o } = F(r), i = f(
2867
+ () => To[u.value || O.VERTICAL]
2868
+ // needs to be computed so that default options are reactive
2869
+ ), { allOptions: l } = Q(o, i);
2870
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, orientation: u, options: o, baseOptions: i, allOptions: l, LumeChart: _e, LumeBarGroup: rt };
2871
+ }
2872
+ });
2873
+ var Io = function() {
2874
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2875
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "single-bar", options: n.allOptions, "data-j-single-bar-chart": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
2876
+ return [r(n.LumeBarGroup, e._g(e._b({ attrs: { orientation: n.orientation } }, "lume-bar-group", a, !1), n.componentEventPropagator))];
2877
+ } }, e._l(n.slots, function(a, u) {
2878
+ return { key: u, fn: function(o) {
2879
+ return [e._t(u, null, null, o || {})];
2880
+ } };
2881
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2882
+ }, Eo = [], $o = /* @__PURE__ */ D(
2883
+ Oo,
2884
+ Io,
2885
+ Eo,
2886
+ !1,
2887
+ null,
2888
+ null
2889
+ );
2890
+ const bu = $o.exports, No = {
2891
+ [O.VERTICAL]: {
2892
+ withTooltip: !0,
2893
+ xAxisOptions: {},
2894
+ yAxisOptions: { gridLines: !0 },
2895
+ margins: se.VERTICAL
2896
+ },
2897
+ [O.HORIZONTAL]: {
2898
+ withTooltip: !0,
2899
+ xAxisOptions: { gridLines: !0 },
2900
+ yAxisOptions: { gridLines: !1 },
2901
+ margins: se.HORIZONTAL,
2902
+ tooltipOptions: { position: "right" }
2903
+ }
2904
+ }, wo = /* @__PURE__ */ R({
2905
+ __name: "lume-grouped-bar-chart",
2906
+ props: {
2907
+ ...me()
2908
+ },
2909
+ setup(t, { emit: e }) {
2910
+ const r = t, { componentEventPropagator: n } = q(e), a = ce(X()), { orientation: u, options: o } = F(r), i = f(
2911
+ () => No[u.value || O.VERTICAL]
2912
+ // needs to be computed so that default options are reactive
2913
+ ), { allOptions: l } = Q(
2914
+ o,
2915
+ i
2916
+ );
2917
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, orientation: u, options: o, baseOptions: i, allOptions: l, LumeChart: _e, LumeBarGroup: rt };
2918
+ }
2919
+ });
2920
+ var Do = function() {
2921
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2922
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "grouped-bar", options: n.allOptions, "data-j-grouped-bar-chart": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
2923
+ return [r(n.LumeBarGroup, e._g(e._b({ attrs: { type: "grouped" } }, "lume-bar-group", a, !1), n.componentEventPropagator))];
2924
+ } }, e._l(n.slots, function(a, u) {
2925
+ return { key: u, fn: function(o) {
2926
+ return [e._t(u, null, null, o || {})];
2927
+ } };
2928
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2929
+ }, Ho = [], Po = /* @__PURE__ */ D(
2930
+ wo,
2931
+ Do,
2932
+ Ho,
2933
+ !1,
2934
+ null,
2935
+ null
2936
+ );
2937
+ const ku = Po.exports, Ro = {
2938
+ [O.VERTICAL]: {
2939
+ withTooltip: !0,
2940
+ xAxisOptions: {},
2941
+ yAxisOptions: { gridLines: !0 },
2942
+ margins: se.VERTICAL,
2943
+ tooltipOptions: { inverse: !0 }
2944
+ },
2945
+ [O.HORIZONTAL]: {
2946
+ withTooltip: !0,
2947
+ xAxisOptions: { gridLines: !0 },
2948
+ yAxisOptions: { gridLines: !1 },
2949
+ margins: se.HORIZONTAL,
2950
+ tooltipOptions: { position: "right" }
2951
+ }
2952
+ }, So = /* @__PURE__ */ R({
2953
+ __name: "lume-stacked-bar-chart",
2954
+ props: {
2955
+ ...me()
2956
+ },
2957
+ setup(t, { emit: e }) {
2958
+ const r = t, { componentEventPropagator: n } = q(e), a = ce(X()), { data: u, orientation: o, options: i, labels: l } = F(r), c = f(
2959
+ () => Ro[o.value || O.VERTICAL]
2960
+ // needs to be computed so that default options are reactive
2961
+ ), { allOptions: s } = Q(
2962
+ i,
2963
+ c
2964
+ ), { internalData: v } = et(u), { groupedData: m } = Ft(v, l), { stackedXScaleGenerator: g, stackedYScaleGenerator: h } = yo(
2965
+ m,
2966
+ o,
2967
+ i
2968
+ ), _ = f(() => r.xScale || g), x = f(() => r.yScale || h);
2969
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, data: u, orientation: o, options: i, labels: l, baseOptions: c, allOptions: s, internalData: v, groupedData: m, stackedXScaleGenerator: g, stackedYScaleGenerator: h, xScale: _, yScale: x, LumeChart: _e, LumeBarGroup: rt };
2970
+ }
2971
+ });
2972
+ var Co = function() {
2973
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2974
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "stacked-bar", options: n.allOptions, "x-scale": n.xScale, "y-scale": n.yScale, "data-j-stacked-bar-chart": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
2975
+ return [r(n.LumeBarGroup, e._g(e._b({ attrs: { type: "stacked" } }, "lume-bar-group", a, !1), n.componentEventPropagator))];
2976
+ } }, e._l(n.slots, function(a, u) {
2977
+ return { key: u, fn: function(o) {
2978
+ return [e._t(u, null, null, o || {})];
2979
+ } };
2980
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2981
+ }, Bo = [], Go = /* @__PURE__ */ D(
2982
+ So,
2983
+ Co,
2984
+ Bo,
2985
+ !1,
2986
+ null,
2987
+ null
2988
+ );
2989
+ const xu = Go.exports, bt = 2, Fo = /* @__PURE__ */ R({
2990
+ __name: "lume-line",
2991
+ props: {
2992
+ pathDefinition: {
2993
+ type: String,
2994
+ required: !0
2995
+ },
2996
+ width: {
2997
+ type: Number,
2998
+ default: bt
2999
+ },
3000
+ color: {
3001
+ type: String,
3002
+ default: Y.Skyblue
3003
+ },
3004
+ dashed: {
3005
+ type: Boolean,
3006
+ default: !1
3007
+ },
3008
+ transition: {
3009
+ type: Boolean,
3010
+ default: !0
3011
+ },
3012
+ animationDelay: {
3013
+ type: Number,
3014
+ default: 0
3015
+ },
3016
+ animationDuration: {
3017
+ type: Number,
3018
+ default: 0.2
3019
+ }
3020
+ },
3021
+ emits: ["click"],
3022
+ setup(t, { emit: e }) {
3023
+ const r = I(null);
3024
+ return ae(() => Ne(r.value)), { __sfc: !0, DEFAULT_LINE_WIDTH: bt, emit: e, root: r };
3025
+ }
3026
+ });
3027
+ var jo = function() {
3028
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3029
+ return r("path", { ref: "root", staticClass: "lume-line", class: {
3030
+ [`lume-stroke--${e.color}`]: !0,
3031
+ "lume-line--dashed": e.dashed,
3032
+ "lume-line--transition": e.transition
3033
+ }, style: {
3034
+ animationDelay: e.transition && e.animationDelay + "s",
3035
+ animationDuration: e.transition && e.animationDuration + "s"
3036
+ }, attrs: { d: e.pathDefinition, "stroke-width": e.width, "data-j-line": "" }, on: { click: function(a) {
3037
+ return n.emit("click", a);
3038
+ } } });
3039
+ }, Vo = [], Mo = /* @__PURE__ */ D(
3040
+ Fo,
3041
+ jo,
3042
+ Vo,
3043
+ !1,
3044
+ null,
3045
+ "59449838"
3046
+ );
3047
+ const zo = Mo.exports, kt = 4, xt = 3, Wo = /* @__PURE__ */ R({
3048
+ __name: "lume-point",
3049
+ props: {
3050
+ x: null,
3051
+ y: null,
3052
+ color: { default: Y.Skyblue },
3053
+ radius: { default: kt },
3054
+ active: { type: Boolean, default: !1 },
3055
+ visible: { type: Boolean, default: !1 }
3056
+ },
3057
+ emits: ["click"],
3058
+ setup(t, { emit: e }) {
3059
+ const r = t, n = I(null), a = f(() => r.radius / 2), u = f(() => r.active ? r.radius : r.visible ? xt : 0);
3060
+ return ae(() => Ne(n.value)), { __sfc: !0, DEFAULT_RADIUS: kt, DEFAULT_VISIBLE_RADIUS: xt, props: r, emit: e, root: n, strokeWidth: a, computedRadius: u };
3061
+ }
3062
+ });
3063
+ var Uo = function() {
3064
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3065
+ return r("circle", { ref: "root", staticClass: "lume-point", class: {
3066
+ [`lume-stroke--${e.color}`]: !0,
3067
+ "lume-point--active": e.active,
3068
+ [`lume-point--visible lume-fill--${e.color}`]: e.visible
3069
+ }, attrs: { cx: e.x, cy: e.y, r: n.computedRadius, "stroke-width": n.strokeWidth, "data-j-point": "" }, on: { click: function(a) {
3070
+ return n.emit("click", a);
3071
+ } } });
3072
+ }, Zo = [], Xo = /* @__PURE__ */ D(
3073
+ Wo,
3074
+ Uo,
3075
+ Zo,
3076
+ !1,
3077
+ null,
3078
+ "080270c0"
3079
+ );
3080
+ const Yo = Xo.exports;
3081
+ function jt(t, e) {
3082
+ function r(o) {
3083
+ let i = null;
3084
+ return o == null ? void 0 : o.reduce((l, c, s) => (c == null || c.value == null ? (i ? i.push(s) : i = [s], s === (o == null ? void 0 : o.length) - 1 && l.push(i)) : i && (l.push(i), i = null), l), []);
3085
+ }
3086
+ function n(o, i, l, c) {
3087
+ const m = Math.abs(o - i) / (l + 1) * (c + 1);
3088
+ return o == null && i == null ? null : o > i ? o - m : o + m;
3089
+ }
3090
+ function a(o) {
3091
+ return function(l) {
3092
+ return !!o.find(
3093
+ (c) => c.includes(l) || c.includes(l - 1)
3094
+ );
3095
+ };
3096
+ }
3097
+ return { computedLineData: f(
3098
+ () => t.value.map((o) => {
3099
+ const i = r(o.values);
3100
+ return {
3101
+ ...o,
3102
+ isDashed: a(i),
3103
+ values: o.values.map((l, c) => {
3104
+ var v, m, g, h;
3105
+ const s = i.find(
3106
+ (_) => _.includes(c)
3107
+ );
3108
+ if (s) {
3109
+ const _ = s[0] - 1, x = s[s.length - 1] + 1;
3110
+ let d = (v = o.values[_]) == null ? void 0 : v.value, p = (m = o.values[x]) == null ? void 0 : m.value;
3111
+ if (d == null) {
3112
+ const y = (h = (g = e == null ? void 0 : e.value) == null ? void 0 : g.domain) == null ? void 0 : h.call(g);
3113
+ d = (y == null ? void 0 : y[1]) ?? 0, p = d;
3114
+ } else p == null && (p = d);
3115
+ return {
3116
+ value: n(
3117
+ d,
3118
+ p,
3119
+ s.length,
3120
+ s.indexOf(c)
3121
+ ),
3122
+ label: wt,
3123
+ isNull: !0
3124
+ };
3125
+ }
3126
+ return l;
3127
+ })
3128
+ };
3129
+ })
3130
+ ) };
3131
+ }
3132
+ function Ko(t, e) {
3133
+ const r = t.bandwidth() / 2;
3134
+ return (n, a) => t(t.domain()[e + (a - 1)]) + r;
3135
+ }
3136
+ function Jo(t, e) {
3137
+ return (r, n) => t(e + (n - 1));
3138
+ }
3139
+ function Qo(t, e, r, n) {
3140
+ const a = qt().x(
3141
+ K(r) ? Ko(r, t) : Jo(r, t)
3142
+ ).y((u) => n(u));
3143
+ return e.every((u) => u == null) ? null : a(e);
3144
+ }
3145
+ const At = 1, qo = /* @__PURE__ */ R({
3146
+ __name: "lume-line-group",
3147
+ props: {
3148
+ ...we(),
3149
+ withPoints: {
3150
+ type: [Boolean, String],
3151
+ default: !0
3152
+ },
3153
+ transition: {
3154
+ type: Boolean,
3155
+ default: !0
3156
+ }
3157
+ },
3158
+ emits: ["line-click", "point-click", "lume__internal--hover"],
3159
+ setup(t, { emit: e }) {
3160
+ const r = t, { data: n, options: a, xScale: u, yScale: o, labels: i } = F(r), l = Ee(
3161
+ "tooltipAnchorAttributes",
3162
+ null
3163
+ ), { updateTooltipAnchorAttributes: c } = Ct(
3164
+ l,
3165
+ a,
3166
+ u,
3167
+ o,
3168
+ i
3169
+ ), s = f(() => {
3170
+ if (n.value.every((N) => N.isDashed))
3171
+ return n.value;
3172
+ const { computedLineData: T } = jt(
3173
+ n,
3174
+ o
3175
+ );
3176
+ return a.value.withTooltip !== !1 && (l != null && l.value) && c(T.value), T.value;
3177
+ }), v = f(() => {
3178
+ if (r.hoveredIndex === -1) return;
3179
+ const T = pn(
3180
+ s.value,
3181
+ r.hoveredIndex
3182
+ );
3183
+ return {
3184
+ d: `M ${Be(u.value, r.hoveredIndex)},${o.value.range()[1]}
3185
+ V ${o.value(T)}`
3186
+ // Move to X index, Vertical line to the highest point
3187
+ };
3188
+ }), m = f(
3189
+ () => u.value && At / (mn(u.value) - 1)
3190
+ // Subtracting the first line (read below)
3191
+ ), g = f(
3192
+ () => {
3193
+ var T;
3194
+ return ((T = a.value) == null ? void 0 : T.lineWidth) * 2 || void 0;
3195
+ }
3196
+ // If no `lineWidth`, returns NaN which needs to be undefined
3197
+ ), h = f(
3198
+ () => u.value.bandwidth() / 2
3199
+ ), _ = f(() => u.value.domain()), x = f(
3200
+ () => a.value.withPoints ?? r.withPoints
3201
+ ), d = f(
3202
+ () => a.value.withPoints === "visible" || r.withPoints === "visible"
3203
+ );
3204
+ function p(T) {
3205
+ return s.value[T].values;
3206
+ }
3207
+ function y(T, N) {
3208
+ var j, V;
3209
+ const S = T === 0 ? [] : [
3210
+ (j = p(N)[T - 1]) == null ? void 0 : j.value,
3211
+ (V = p(N)[T]) == null ? void 0 : V.value
3212
+ ];
3213
+ return Qo(
3214
+ T,
3215
+ S,
3216
+ u.value,
3217
+ o.value
3218
+ ) || "";
3219
+ }
3220
+ function b(T) {
3221
+ return {
3222
+ animationDelay: T < 2 ? 0 : (T - 1) * m.value,
3223
+ animationDuration: m.value
3224
+ };
3225
+ }
3226
+ function A(T, N) {
3227
+ var j;
3228
+ const S = (j = p(N)[T]) == null ? void 0 : j.value;
3229
+ return {
3230
+ x: K(u.value) ? r.xScale(_.value[T]) + h.value : r.xScale(T),
3231
+ y: S === null ? o.value(o.value.domain()[1]) : o.value(S)
3232
+ };
3233
+ }
3234
+ function $(T) {
3235
+ return r.hoveredIndex === T;
3236
+ }
3237
+ return { __sfc: !0, LUME_TRANSITION_TIME_FULL: At, props: r, emit: e, data: n, options: a, xScale: u, yScale: o, labels: i, tooltipAnchorAttributes: l, updateTooltipAnchorAttributes: c, computedGroupData: s, overlayLineAttributes: v, animationDuration: m, pointRadius: g, xAxisOffset: h, domain: _, computedWithPoints: x, computedVisiblePoints: d, getValuesFromDataset: p, getPathDefinition: y, getLineTransitionParams: b, getPointPosition: A, isPointActive: $, LumeLine: zo, LumePoint: Yo };
3238
+ }
3239
+ });
3240
+ var eu = function() {
3241
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3242
+ return r("g", { staticClass: "lume-line-group", attrs: { "data-j-lume-line-group": "" } }, [r("path", e._b({ staticClass: "lume-line-group__overlay-line", attrs: { "data-j-lume-line-group__overlay-line": "" } }, "path", n.overlayLineAttributes, !1)), e._l(n.computedGroupData, function(a, u) {
3243
+ return r("g", { key: a.label, staticClass: "lume-line-group__group" }, [r("g", { staticClass: "lume-line-group__lines" }, e._l(a.values, function(o, i) {
3244
+ return r(n.LumeLine, e._b({ key: `line-${i}`, attrs: { color: a.color, dashed: a.isDashed(i), "path-definition": n.getPathDefinition(i, u), transition: e.transition, width: n.options.lineWidth }, on: { click: function(l) {
3245
+ return n.emit("line-click", { index: i, datasetIndex: u, event: l });
3246
+ } } }, "lume-line", n.getLineTransitionParams(i), !1));
3247
+ }), 1), n.computedWithPoints ? r("g", { staticClass: "lume-line-group__points", attrs: { "data-j-lume-line-group__points": "" } }, [e._l(a.values, function(o, i) {
3248
+ return [o.isNull ? e._e() : r(n.LumePoint, e._b({ attrs: { active: n.isPointActive(i), color: a.color, index: i, radius: n.pointRadius, visible: n.computedVisiblePoints }, on: { click: function(l) {
3249
+ return n.emit("point-click", { index: i, datasetIndex: u, event: l });
3250
+ } } }, "lume-point", n.getPointPosition(i, u), !1))];
3251
+ })], 2) : e._e()]);
3252
+ })], 2);
3253
+ }, tu = [], nu = /* @__PURE__ */ D(
3254
+ qo,
3255
+ eu,
3256
+ tu,
3257
+ !1,
3258
+ null,
3259
+ "898c2e7a"
3260
+ );
3261
+ const Vt = nu.exports, ru = {
3262
+ margins: se.VERTICAL,
3263
+ startOnZero: !0,
3264
+ withTooltip: !0,
3265
+ xAxisOptions: {},
3266
+ yAxisOptions: { gridLines: !0 }
3267
+ }, au = /* @__PURE__ */ R({
3268
+ __name: "lume-line-chart",
3269
+ props: {
3270
+ ...me(null, !1)
3271
+ },
3272
+ setup(t, { emit: e }) {
3273
+ const r = t, { componentEventPropagator: n } = q(e), a = ce(X()), { options: u } = F(r), { allOptions: o } = Q(u, ru);
3274
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, options: u, allOptions: o, LumeChart: _e, LumeLineGroup: Vt };
3275
+ }
3276
+ });
3277
+ var ou = function() {
3278
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3279
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "line", options: n.allOptions, "data-j-lume-line-chart": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
3280
+ return [r(n.LumeLineGroup, e._g(e._b({}, "lume-line-group", a, !1), n.componentEventPropagator))];
3281
+ } }, e._l(n.slots, function(a, u) {
3282
+ return { key: u, fn: function(o) {
3283
+ return [e._t(u, null, null, o || {})];
3284
+ } };
3285
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
3286
+ }, uu = [], lu = /* @__PURE__ */ D(
3287
+ au,
3288
+ ou,
3289
+ uu,
3290
+ !1,
3291
+ null,
3292
+ null
3293
+ );
3294
+ const Au = lu.exports;
3295
+ function iu(t) {
3296
+ return { areaPathDefinition: f(
3297
+ () => function(r, n) {
3298
+ if (!r || !n || K(r) || K(n))
3299
+ return;
3300
+ const a = t.value[0].values;
3301
+ return en().x((u, o) => r(o)).y0(n(Math.min(...n.domain()))).y1((u) => n(u.value))(a);
3302
+ }
3303
+ ) };
3304
+ }
3305
+ const su = {
3306
+ margins: {
3307
+ top: 0,
3308
+ right: 0,
3309
+ bottom: 0,
3310
+ left: 0
3311
+ },
3312
+ withAxes: !1,
3313
+ showArea: !0,
3314
+ startOnZero: !0,
3315
+ withLegend: !1,
3316
+ tooltipOptions: {
3317
+ showTitle: !1
3318
+ }
3319
+ }, cu = /* @__PURE__ */ R({
3320
+ __name: "lume-sparkline-chart",
3321
+ props: {
3322
+ ...qe(null),
3323
+ ...be()
3324
+ },
3325
+ setup(t, { expose: e, emit: r }) {
3326
+ const n = t, { componentEventPropagator: a } = q(r), u = ce(X()), { data: o, options: i } = F(n), { internalData: l } = et(o), { allOptions: c } = Q(i, su), { computedLineData: s } = jt(l), { areaPathDefinition: v } = iu(s), m = f(() => {
3327
+ var x, d;
3328
+ return (d = (x = l.value) == null ? void 0 : x[0]) == null ? void 0 : d.color;
3329
+ }), g = f(
3330
+ () => {
3331
+ var x, d;
3332
+ return ((d = (x = o.value) == null ? void 0 : x[0]) == null ? void 0 : d.areaColor) || m.value;
3333
+ }
3334
+ );
3335
+ function h(x) {
3336
+ return {
3337
+ ...x,
3338
+ noMinSize: !0
3339
+ };
3340
+ }
3341
+ function _(x, d, p) {
3342
+ if (x.length)
3343
+ return ge().range([0, p.width]).domain([0, x[0].values.length - 1]);
3344
+ }
3345
+ return e({
3346
+ areaPathDefinition: v
3347
+ }), { __sfc: !0, props: n, emit: r, componentEventPropagator: a, slots: u, data: o, options: i, internalData: l, allOptions: c, computedLineData: s, areaPathDefinition: v, computedColor: m, areaColor: g, getSparklineOptions: h, xScaleGenerator: _, LumeChart: _e, LumeLineGroup: Vt };
3348
+ }
3349
+ });
3350
+ var du = function() {
3351
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3352
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "line", options: n.getSparklineOptions(n.allOptions), "x-scale": n.xScaleGenerator }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
3353
+ return [n.allOptions.showArea ? r("path", { class: [
3354
+ "sparkline-chart__area",
3355
+ n.options.withTransition !== !1 ? "sparkline-chart__area--transition" : "",
3356
+ `lume-fill--${n.areaColor || n.computedColor}`,
3357
+ "lume-fill--faded"
3358
+ ], attrs: { d: n.areaPathDefinition(a.xScale, a.yScale), "data-j-sparkline__area": "" } }) : e._e(), r(n.LumeLineGroup, e._g(e._b({ attrs: { "with-points": !1 } }, "lume-line-group", a, !1), n.componentEventPropagator))];
3359
+ } }, e._l(n.slots, function(a, u) {
3360
+ return { key: u, fn: function(o) {
3361
+ return [e._t(u, null, null, o || {})];
3362
+ } };
3363
+ })], null, !0) }, "lume-chart", n.props, !1), n.componentEventPropagator));
3364
+ }, vu = [], fu = /* @__PURE__ */ D(
3365
+ cu,
3366
+ du,
3367
+ vu,
3368
+ !1,
3369
+ null,
3370
+ "579f7e32"
3371
+ );
3372
+ const Lu = fu.exports;
3373
+ export {
3374
+ Gr as A,
3375
+ dt as B,
3376
+ ie as C,
3377
+ Ke as D,
3378
+ Be as E,
3379
+ ct as F,
3380
+ tt as G,
3381
+ et as H,
3382
+ er as I,
3383
+ jt as J,
3384
+ Fr as K,
3385
+ Qe as L,
3386
+ Q as M,
3387
+ nr as N,
3388
+ Je as O,
3389
+ Mr as P,
3390
+ Ct as Q,
3391
+ zr as R,
3392
+ St as S,
3393
+ qe as T,
3394
+ me as U,
3395
+ tr as V,
3396
+ be as W,
3397
+ qn as X,
3398
+ Y as a,
3399
+ qa as b,
3400
+ ha as c,
3401
+ la as d,
3402
+ va as e,
3403
+ Sn as f,
3404
+ Ye as g,
3405
+ yu as h,
3406
+ rt as i,
3407
+ _e as j,
3408
+ lr as k,
3409
+ gu as l,
3410
+ vr as m,
3411
+ ku as n,
3412
+ zo as o,
3413
+ Au as p,
3414
+ Vt as q,
3415
+ Cr as r,
3416
+ Yo as s,
3417
+ bu as t,
3418
+ Lu as u,
3419
+ xu as v,
3420
+ Dr as w,
3421
+ Ir as x,
3422
+ xr as y,
3423
+ hr as z
3424
+ };
3425
+ //# sourceMappingURL=vDk1lu85.js.map