@adyen/lume 0.2.0 → 0.3.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.
@@ -0,0 +1,2843 @@
1
+ import q, { isRef as Kt, reactive as it, computed as d, ref as L, watch as R, defineComponent as k, toRefs as S, onMounted as H, onBeforeUnmount as Jt, watchEffect as Qt, useSlots as j, defineAsyncComponent as ht } from "vue";
2
+ import { sankeyLinkHorizontal as Oe, sankey as xe, sankeyJustify as Le } from "d3-sankey";
3
+ import { format as $e, ticks as ke, scaleBand as J, scaleLinear as Q, line as we, area as Se } from "d3";
4
+ import { createPopper as Ce } from "@popperjs/core";
5
+ function rt(e) {
6
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? rt = function(t) {
7
+ return typeof t;
8
+ } : rt = function(t) {
9
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
10
+ }, rt(e);
11
+ }
12
+ function Ie(e) {
13
+ return Re(e) || Pe(e) || De();
14
+ }
15
+ function Re(e) {
16
+ if (Array.isArray(e)) {
17
+ for (var t = 0, r = new Array(e.length); t < e.length; t++)
18
+ r[t] = e[t];
19
+ return r;
20
+ }
21
+ }
22
+ function Pe(e) {
23
+ if (Symbol.iterator in Object(e) || Object.prototype.toString.call(e) === "[object Arguments]")
24
+ return Array.from(e);
25
+ }
26
+ function De() {
27
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
28
+ }
29
+ var nt = typeof window < "u";
30
+ function Ee(e) {
31
+ return Array.isArray(e) || rt(e) === "object" ? Object.freeze(e) : e;
32
+ }
33
+ function Ne(e) {
34
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
35
+ return e.reduce(function(r, n) {
36
+ var a = n.passengers[0], o = typeof a == "function" ? a(t) : n.passengers;
37
+ return r.concat(o);
38
+ }, []);
39
+ }
40
+ function Be(e, t) {
41
+ return e.map(function(r, n) {
42
+ return [n, r];
43
+ }).sort(function(r, n) {
44
+ return t(r[1], n[1]) || r[0] - n[0];
45
+ }).map(function(r) {
46
+ return r[1];
47
+ });
48
+ }
49
+ function Nt(e, t) {
50
+ return t.reduce(function(r, n) {
51
+ return e.hasOwnProperty(n) && (r[n] = e[n]), r;
52
+ }, {});
53
+ }
54
+ var te = {}, He = {}, je = {}, Ve = q.extend({
55
+ data: function() {
56
+ return {
57
+ transports: te,
58
+ targets: He,
59
+ sources: je,
60
+ trackInstances: nt
61
+ };
62
+ },
63
+ methods: {
64
+ open: function(t) {
65
+ if (!!nt) {
66
+ var r = t.to, n = t.from, a = t.passengers, o = t.order, s = o === void 0 ? 1 / 0 : o;
67
+ if (!(!r || !n || !a)) {
68
+ var i = {
69
+ to: r,
70
+ from: n,
71
+ passengers: Ee(a),
72
+ order: s
73
+ }, l = Object.keys(this.transports);
74
+ l.indexOf(r) === -1 && q.set(this.transports, r, []);
75
+ var u = this.$_getTransportIndex(i), c = this.transports[r].slice(0);
76
+ u === -1 ? c.push(i) : c[u] = i, this.transports[r] = Be(c, function(f, _) {
77
+ return f.order - _.order;
78
+ });
79
+ }
80
+ }
81
+ },
82
+ close: function(t) {
83
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = t.to, a = t.from;
84
+ if (!(!n || !a && r === !1) && !!this.transports[n])
85
+ if (r)
86
+ this.transports[n] = [];
87
+ else {
88
+ var o = this.$_getTransportIndex(t);
89
+ if (o >= 0) {
90
+ var s = this.transports[n].slice(0);
91
+ s.splice(o, 1), this.transports[n] = s;
92
+ }
93
+ }
94
+ },
95
+ registerTarget: function(t, r, n) {
96
+ !nt || (this.trackInstances && !n && this.targets[t] && console.warn("[portal-vue]: Target ".concat(t, " already exists")), this.$set(this.targets, t, Object.freeze([r])));
97
+ },
98
+ unregisterTarget: function(t) {
99
+ this.$delete(this.targets, t);
100
+ },
101
+ registerSource: function(t, r, n) {
102
+ !nt || (this.trackInstances && !n && this.sources[t] && console.warn("[portal-vue]: source ".concat(t, " already exists")), this.$set(this.sources, t, Object.freeze([r])));
103
+ },
104
+ unregisterSource: function(t) {
105
+ this.$delete(this.sources, t);
106
+ },
107
+ hasTarget: function(t) {
108
+ return !!(this.targets[t] && this.targets[t][0]);
109
+ },
110
+ hasSource: function(t) {
111
+ return !!(this.sources[t] && this.sources[t][0]);
112
+ },
113
+ hasContentFor: function(t) {
114
+ return !!this.transports[t] && !!this.transports[t].length;
115
+ },
116
+ $_getTransportIndex: function(t) {
117
+ var r = t.to, n = t.from;
118
+ for (var a in this.transports[r])
119
+ if (this.transports[r][a].from === n)
120
+ return +a;
121
+ return -1;
122
+ }
123
+ }
124
+ }), I = new Ve(te), Fe = 1, Lt = q.extend({
125
+ name: "portal",
126
+ props: {
127
+ disabled: {
128
+ type: Boolean
129
+ },
130
+ name: {
131
+ type: String,
132
+ default: function() {
133
+ return String(Fe++);
134
+ }
135
+ },
136
+ order: {
137
+ type: Number,
138
+ default: 0
139
+ },
140
+ slim: {
141
+ type: Boolean
142
+ },
143
+ slotProps: {
144
+ type: Object,
145
+ default: function() {
146
+ return {};
147
+ }
148
+ },
149
+ tag: {
150
+ type: String,
151
+ default: "DIV"
152
+ },
153
+ to: {
154
+ type: String,
155
+ default: function() {
156
+ return String(Math.round(Math.random() * 1e7));
157
+ }
158
+ }
159
+ },
160
+ created: function() {
161
+ var t = this;
162
+ this.$nextTick(function() {
163
+ I.registerSource(t.name, t);
164
+ });
165
+ },
166
+ mounted: function() {
167
+ this.disabled || this.sendUpdate();
168
+ },
169
+ updated: function() {
170
+ this.disabled ? this.clear() : this.sendUpdate();
171
+ },
172
+ beforeDestroy: function() {
173
+ I.unregisterSource(this.name), this.clear();
174
+ },
175
+ watch: {
176
+ to: function(t, r) {
177
+ r && r !== t && this.clear(r), this.sendUpdate();
178
+ }
179
+ },
180
+ methods: {
181
+ clear: function(t) {
182
+ var r = {
183
+ from: this.name,
184
+ to: t || this.to
185
+ };
186
+ I.close(r);
187
+ },
188
+ normalizeSlots: function() {
189
+ return this.$scopedSlots.default ? [this.$scopedSlots.default] : this.$slots.default;
190
+ },
191
+ normalizeOwnChildren: function(t) {
192
+ return typeof t == "function" ? t(this.slotProps) : t;
193
+ },
194
+ sendUpdate: function() {
195
+ var t = this.normalizeSlots();
196
+ if (t) {
197
+ var r = {
198
+ from: this.name,
199
+ to: this.to,
200
+ passengers: Ie(t),
201
+ order: this.order
202
+ };
203
+ I.open(r);
204
+ } else
205
+ this.clear();
206
+ }
207
+ },
208
+ render: function(t) {
209
+ var r = this.$slots.default || this.$scopedSlots.default || [], n = this.tag;
210
+ return r && this.disabled ? r.length <= 1 && this.slim ? this.normalizeOwnChildren(r)[0] : t(n, [this.normalizeOwnChildren(r)]) : this.slim ? t() : t(n, {
211
+ class: {
212
+ "v-portal": !0
213
+ },
214
+ style: {
215
+ display: "none"
216
+ },
217
+ key: "v-portal-placeholder"
218
+ });
219
+ }
220
+ }), $t = q.extend({
221
+ name: "portalTarget",
222
+ props: {
223
+ multiple: {
224
+ type: Boolean,
225
+ default: !1
226
+ },
227
+ name: {
228
+ type: String,
229
+ required: !0
230
+ },
231
+ slim: {
232
+ type: Boolean,
233
+ default: !1
234
+ },
235
+ slotProps: {
236
+ type: Object,
237
+ default: function() {
238
+ return {};
239
+ }
240
+ },
241
+ tag: {
242
+ type: String,
243
+ default: "div"
244
+ },
245
+ transition: {
246
+ type: [String, Object, Function]
247
+ }
248
+ },
249
+ data: function() {
250
+ return {
251
+ transports: I.transports,
252
+ firstRender: !0
253
+ };
254
+ },
255
+ created: function() {
256
+ var t = this;
257
+ this.$nextTick(function() {
258
+ I.registerTarget(t.name, t);
259
+ });
260
+ },
261
+ watch: {
262
+ ownTransports: function() {
263
+ this.$emit("change", this.children().length > 0);
264
+ },
265
+ name: function(t, r) {
266
+ I.unregisterTarget(r), I.registerTarget(t, this);
267
+ }
268
+ },
269
+ mounted: function() {
270
+ var t = this;
271
+ this.transition && this.$nextTick(function() {
272
+ t.firstRender = !1;
273
+ });
274
+ },
275
+ beforeDestroy: function() {
276
+ I.unregisterTarget(this.name);
277
+ },
278
+ computed: {
279
+ ownTransports: function() {
280
+ var t = this.transports[this.name] || [];
281
+ return this.multiple ? t : t.length === 0 ? [] : [t[t.length - 1]];
282
+ },
283
+ passengers: function() {
284
+ return Ne(this.ownTransports, this.slotProps);
285
+ }
286
+ },
287
+ methods: {
288
+ children: function() {
289
+ return this.passengers.length !== 0 ? this.passengers : this.$scopedSlots.default ? this.$scopedSlots.default(this.slotProps) : this.$slots.default || [];
290
+ },
291
+ noWrapper: function() {
292
+ var t = this.slim && !this.transition;
293
+ return t && this.children().length > 1 && console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."), t;
294
+ }
295
+ },
296
+ render: function(t) {
297
+ var r = this.noWrapper(), n = this.children(), a = this.transition || this.tag;
298
+ return r ? n[0] : this.slim && !a ? t() : t(a, {
299
+ props: {
300
+ tag: this.transition && this.tag ? this.tag : void 0
301
+ },
302
+ class: {
303
+ "vue-portal-target": !0
304
+ }
305
+ }, n);
306
+ }
307
+ }), Ge = 0, Me = ["disabled", "name", "order", "slim", "slotProps", "tag", "to"], ze = ["multiple", "transition"];
308
+ q.extend({
309
+ name: "MountingPortal",
310
+ inheritAttrs: !1,
311
+ props: {
312
+ append: {
313
+ type: [Boolean, String]
314
+ },
315
+ bail: {
316
+ type: Boolean
317
+ },
318
+ mountTo: {
319
+ type: String,
320
+ required: !0
321
+ },
322
+ disabled: {
323
+ type: Boolean
324
+ },
325
+ name: {
326
+ type: String,
327
+ default: function() {
328
+ return "mounted_" + String(Ge++);
329
+ }
330
+ },
331
+ order: {
332
+ type: Number,
333
+ default: 0
334
+ },
335
+ slim: {
336
+ type: Boolean
337
+ },
338
+ slotProps: {
339
+ type: Object,
340
+ default: function() {
341
+ return {};
342
+ }
343
+ },
344
+ tag: {
345
+ type: String,
346
+ default: "DIV"
347
+ },
348
+ to: {
349
+ type: String,
350
+ default: function() {
351
+ return String(Math.round(Math.random() * 1e7));
352
+ }
353
+ },
354
+ multiple: {
355
+ type: Boolean,
356
+ default: !1
357
+ },
358
+ targetSlim: {
359
+ type: Boolean
360
+ },
361
+ targetSlotProps: {
362
+ type: Object,
363
+ default: function() {
364
+ return {};
365
+ }
366
+ },
367
+ targetTag: {
368
+ type: String,
369
+ default: "div"
370
+ },
371
+ transition: {
372
+ type: [String, Object, Function]
373
+ }
374
+ },
375
+ created: function() {
376
+ if (!(typeof document > "u")) {
377
+ var t = document.querySelector(this.mountTo);
378
+ if (!t) {
379
+ console.error("[portal-vue]: Mount Point '".concat(this.mountTo, "' not found in document"));
380
+ return;
381
+ }
382
+ var r = this.$props;
383
+ if (I.targets[r.name]) {
384
+ r.bail ? console.warn("[portal-vue]: Target ".concat(r.name, ` is already mounted.
385
+ Aborting because 'bail: true' is set`)) : this.portalTarget = I.targets[r.name];
386
+ return;
387
+ }
388
+ var n = r.append;
389
+ if (n) {
390
+ var a = typeof n == "string" ? n : "DIV", o = document.createElement(a);
391
+ t.appendChild(o), t = o;
392
+ }
393
+ var s = Nt(this.$props, ze);
394
+ s.slim = this.targetSlim, s.tag = this.targetTag, s.slotProps = this.targetSlotProps, s.name = this.to, this.portalTarget = new $t({
395
+ el: t,
396
+ parent: this.$parent || this,
397
+ propsData: s
398
+ });
399
+ }
400
+ },
401
+ beforeDestroy: function() {
402
+ var t = this.portalTarget;
403
+ if (this.append) {
404
+ var r = t.$el;
405
+ r.parentNode.removeChild(r);
406
+ }
407
+ t.$destroy();
408
+ },
409
+ render: function(t) {
410
+ if (!this.portalTarget)
411
+ return console.warn("[portal-vue] Target wasn't mounted"), t();
412
+ if (!this.$scopedSlots.manual) {
413
+ var r = Nt(this.$props, Me);
414
+ return t(Lt, {
415
+ props: r,
416
+ attrs: this.$attrs,
417
+ on: this.$listeners,
418
+ scopedSlots: this.$scopedSlots
419
+ }, this.$slots.default);
420
+ }
421
+ var n = this.$scopedSlots.manual({
422
+ to: this.to
423
+ });
424
+ return Array.isArray(n) && (n = n[0]), n || t();
425
+ }
426
+ });
427
+ var E = /* @__PURE__ */ ((e) => (e.Skyblue = "skyblue", e.Royalblue = "royalblue", e.Violet = "violet", e.Darkteal = "darkteal", e.Gold = "gold", e))(E || {}), kt = /* @__PURE__ */ ((e) => (e.SkyTeal = "skyblue-darkteal", e.VioletRoyal = "violet-royalblue", e.VioletTeal = "violet-darkteal", e.GoldTeal = "gold-darkteal", e.GoldRoyal = "gold-royalblue", e))(kt || {}), ee = /* @__PURE__ */ ((e) => (e.Grey = "grey", e.Green = "green", e.Orange = "orange", e.Red = "red", e))(ee || {}), wt = /* @__PURE__ */ ((e) => (e["01"] = "01", e["02"] = "02", e["03"] = "03", e["04"] = "04", e["05"] = "05", e["06"] = "06", e["07"] = "07", e["08"] = "08", e["09"] = "09", e))(wt || {});
428
+ const b = {
429
+ HORIZONTAL: "horizontal",
430
+ VERTICAL: "vertical"
431
+ }, We = {
432
+ SINGLE: "single",
433
+ GROUPED: "grouped",
434
+ STACKED: "stacked"
435
+ }, G = {
436
+ VERTICAL: {
437
+ top: 16,
438
+ right: 0,
439
+ bottom: 28,
440
+ left: 24
441
+ },
442
+ HORIZONTAL: {
443
+ top: 16,
444
+ right: 0,
445
+ bottom: 28,
446
+ left: 24
447
+ }
448
+ }, ne = "No data", Ze = 20, Xe = 0.33, Ue = 0.5, qe = 1, Ye = [
449
+ "auto",
450
+ "auto-start",
451
+ "auto-end",
452
+ "top",
453
+ "top-start",
454
+ "top-end",
455
+ "right",
456
+ "right-start",
457
+ "right-end",
458
+ "bottom",
459
+ "bottom-start",
460
+ "bottom-end",
461
+ "left",
462
+ "left-start",
463
+ "left-end"
464
+ ];
465
+ var F = /* @__PURE__ */ ((e) => (e.Categorical = "categorical", e.Sequential = "sequential", e.Divergent = "divergent", e))(F || {});
466
+ function re() {
467
+ return process.env.NODE_ENV === "production";
468
+ }
469
+ function ae(e) {
470
+ return (e == null ? void 0 : e.map(
471
+ (t) => t.values.map((r) => r == null ? void 0 : r.value).flat()
472
+ ).flat()) || [];
473
+ }
474
+ function St(e) {
475
+ return e.length === 1;
476
+ }
477
+ function mt(e) {
478
+ return !!e && typeof e == "object" && !Array.isArray(e);
479
+ }
480
+ function oe(e, t) {
481
+ const r = { ...e };
482
+ return Object.entries(t).forEach(([n, a]) => {
483
+ r[n] = mt(e[n]) && mt(a) ? oe(e[n], a) : a;
484
+ }), r;
485
+ }
486
+ function Ke(e) {
487
+ return e != null && mt(e) && "value" in e;
488
+ }
489
+ function M(e) {
490
+ return (e == null ? void 0 : e.bandwidth) !== void 0;
491
+ }
492
+ function Ct(e) {
493
+ return M(e) ? e.bandwidth() : Math.max(...e.range()) / Math.max(...e.domain());
494
+ }
495
+ const Je = (e, t) => {
496
+ if (!e)
497
+ throw new Error("Data is not a valid array");
498
+ if (e.length === 0)
499
+ throw new Error("Cannot get highest value from empty array");
500
+ e.forEach(({ values: r }) => {
501
+ if (r.length - 1 < t)
502
+ throw new Error("Index exceeds length of at least one of the datasets");
503
+ });
504
+ };
505
+ function Qe(e, t) {
506
+ var r;
507
+ return Je(e, t), ((r = e.reduce(
508
+ (n, a) => {
509
+ var o, s, i, l;
510
+ return ((s = (o = n.values[t]) == null ? void 0 : o.value) != null ? s : 0) > ((l = (i = a.values[t]) == null ? void 0 : i.value) != null ? l : 0) ? n : a;
511
+ }
512
+ ).values[t]) == null ? void 0 : r.value) || 0;
513
+ }
514
+ function gt(e) {
515
+ const t = Kt(e) ? e.value : e;
516
+ if (!t)
517
+ throw new Error("No empty array can be created from specified data value");
518
+ const r = Math.max(
519
+ ...t.map((n) => n.values.length),
520
+ 0
521
+ );
522
+ return Array(r).fill(null);
523
+ }
524
+ function tn(e) {
525
+ return M(e) ? e.domain().length : Math.max(...e.domain());
526
+ }
527
+ function en(e, t) {
528
+ return (r) => Math.round(e * (1 - r) + t * r);
529
+ }
530
+ function nn(e, t, r) {
531
+ const n = r ? e.length - t : t, a = e.slice(0, n);
532
+ return e.slice(n).concat(a);
533
+ }
534
+ function z(e) {
535
+ if (e.groups) {
536
+ const t = Object.keys(e);
537
+ return Object.assign(
538
+ {},
539
+ ...t.map((r) => r !== "groups" ? { [r]: e[r] } : {})
540
+ );
541
+ }
542
+ return e;
543
+ }
544
+ const rn = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce(
545
+ (t, r) => t += (r &= 63) < 36 ? r.toString(36) : r < 62 ? (r - 26).toString(36).toUpperCase() : r > 62 ? "-" : "_",
546
+ ""
547
+ );
548
+ var tt = /* @__PURE__ */ ((e) => (e.DatasetLength = `Our guidelines highly recommend not having more than 5 datasets in one chart.
549
+ Learn more: https://lume.design/guidelines/datasets`, e.ColorLoop = "Colors will loop around after the 5th dataset. You can prevent this by setting specific colors for your datasets.", e.InvalidFormat = "The string provided to format is invalid. Please refer to https://github.com/d3/d3-format for valid arguments.", e.NotContainedInSvg = "This component is an `SVGElement`, thus it is required to be inside an `<svg>` container.", e))(tt || {});
550
+ const an = "[lume] ";
551
+ function ut(e, t = !0) {
552
+ t && re() || console.warn(an + "Warning: " + e);
553
+ }
554
+ const on = F.Categorical, lt = E.Skyblue, sn = kt.SkyTeal;
555
+ function un(e) {
556
+ return e === F.Divergent ? sn : lt;
557
+ }
558
+ function ln(e) {
559
+ return Object.values(wt).includes(e);
560
+ }
561
+ function Bt(e, t) {
562
+ return t === F.Divergent ? Object.values(kt).includes(e) : Object.values({ ...E, ...ee, ...wt }).includes(
563
+ e
564
+ );
565
+ }
566
+ function cn(e, t) {
567
+ const r = Object.values(E).indexOf(e);
568
+ return nn(Object.values(E), r > -1 ? r : 0)[t];
569
+ }
570
+ function dn(e, t) {
571
+ const r = 50 + t * 10;
572
+ return `${e}-${r}`;
573
+ }
574
+ function pn(e, t) {
575
+ const r = (t + 1) * 10;
576
+ return `${e}-${r}`;
577
+ }
578
+ function Ht(e, t, r) {
579
+ switch (t) {
580
+ default:
581
+ case F.Categorical:
582
+ return ln(e) ? e : cn(e, r);
583
+ case F.Sequential:
584
+ return dn(e, r);
585
+ case F.Divergent:
586
+ return pn(e, r);
587
+ }
588
+ }
589
+ function fn(e, t, r = on, n) {
590
+ return Bt(e, r) ? e : (n > 4 && (ut(tt.ColorLoop), n = n % 5), Bt(t, r) ? Ht(t, r, n) : Ht(un(r), r, n));
591
+ }
592
+ function vn(e) {
593
+ return e.map((t) => Ke(t) ? t : { value: t });
594
+ }
595
+ function _n(e) {
596
+ return e.__internal === !0;
597
+ }
598
+ const se = (e = null) => ({
599
+ data: {
600
+ type: Array,
601
+ required: !0,
602
+ validator: e || void 0
603
+ },
604
+ labels: {
605
+ type: Array,
606
+ default: void 0
607
+ },
608
+ color: {
609
+ type: String,
610
+ default: E.Skyblue
611
+ }
612
+ });
613
+ function ct(e, t, r, n, a) {
614
+ const o = it({
615
+ width: 0,
616
+ height: 0
617
+ }), s = rn(12), i = d(() => {
618
+ var c;
619
+ return e.value.length > 5 && ut(tt.DatasetLength), (c = e.value) == null ? void 0 : c.map(
620
+ (f, _) => {
621
+ if (_n(f))
622
+ return f;
623
+ const m = vn(f.values), p = fn(
624
+ f.color,
625
+ r == null ? void 0 : r.value,
626
+ n == null ? void 0 : n.value.colorPalette,
627
+ _
628
+ );
629
+ return {
630
+ ...f,
631
+ values: m,
632
+ color: p,
633
+ __internal: !0
634
+ };
635
+ }
636
+ );
637
+ }), l = d(() => Array.isArray(t.value) ? t.value : gt(e.value).map((c, f) => f));
638
+ function u(c) {
639
+ const f = (a == null ? void 0 : a.value) === b.HORIZONTAL ? gt(e).length * (Ze * 2) : c.height;
640
+ o.width = c.width, o.height = f;
641
+ }
642
+ return {
643
+ chartID: s,
644
+ computedLabels: l,
645
+ containerSize: o,
646
+ internalData: i,
647
+ updateSize: u
648
+ };
649
+ }
650
+ const It = (e) => {
651
+ let t = null;
652
+ switch (typeof e) {
653
+ case "string":
654
+ try {
655
+ t = $e(e);
656
+ } catch {
657
+ ut(tt.InvalidFormat), t = null;
658
+ }
659
+ break;
660
+ case "function":
661
+ t = e;
662
+ break;
663
+ default:
664
+ t = null;
665
+ }
666
+ function r(n) {
667
+ return t ? t(n) : n;
668
+ }
669
+ return r;
670
+ }, dt = () => ({
671
+ options: {
672
+ type: Object,
673
+ default: () => ({})
674
+ }
675
+ });
676
+ function N(e, t) {
677
+ return { allOptions: d(() => {
678
+ const n = Kt(t) ? t == null ? void 0 : t.value : t;
679
+ return n ? oe(n, e.value) : e.value;
680
+ }) };
681
+ }
682
+ const hn = 0.15;
683
+ function mn(e, t, r) {
684
+ const n = L(), a = d(() => Math.max(...e.value.range())), o = d(() => t.value.length);
685
+ function s() {
686
+ if (!t.value)
687
+ return;
688
+ const l = t.value.reduce(
689
+ (c, f) => c + f.getBoundingClientRect().width,
690
+ 0
691
+ ), u = Math.ceil(l / o.value);
692
+ n.value = u + u * hn;
693
+ }
694
+ function i(l) {
695
+ if (!t.value)
696
+ return !0;
697
+ const u = t.value.length;
698
+ if (l === 0)
699
+ return !0;
700
+ const c = a.value / u, f = typeof r == "number" && r > 0 && r + 1 || Math.ceil(n.value / c);
701
+ return l % f === 0;
702
+ }
703
+ return R(t, s), { showTick: i };
704
+ }
705
+ function pt(e) {
706
+ e != null && e.closest("svg") || ut(tt.NotContainedInSvg);
707
+ }
708
+ const ie = {
709
+ gridLines: !1,
710
+ withTitle: !0,
711
+ showTicks: !0,
712
+ tickCount: 10,
713
+ tickFormat: null,
714
+ tickPadding: 8
715
+ }, gn = {
716
+ ...ie,
717
+ withTitle: !1,
718
+ skip: !0
719
+ }, yn = {
720
+ ...ie,
721
+ gridLines: !0
722
+ }, bn = 12, Tn = 8, An = function(e, t, r) {
723
+ const n = d(() => e.value.step() * e.value.paddingInner() / 2);
724
+ function a(l, u) {
725
+ var c;
726
+ return {
727
+ transform: `translate(${((c = e.value(u)) != null ? c : e.value(l)) - n.value}, 0)`
728
+ };
729
+ }
730
+ function o(l) {
731
+ const u = (l ? l.getComputedTextLength() : e.value.step()) + 20;
732
+ return {
733
+ x: -(u - e.value.step()) / 2,
734
+ width: u,
735
+ height: r.value.tickPadding + bn + Tn
736
+ };
737
+ }
738
+ function s() {
739
+ const l = e.value.step() / 2;
740
+ return {
741
+ x1: l,
742
+ x2: l,
743
+ y1: -t.value.height
744
+ };
745
+ }
746
+ function i() {
747
+ return {
748
+ x: e.value.step() / 2,
749
+ y: r.value.tickPadding,
750
+ dy: "0.8em",
751
+ "text-anchor": "middle"
752
+ };
753
+ }
754
+ return {
755
+ getGridLinesAttributes: s,
756
+ getTickGhostAttributes: o,
757
+ getTickGroupAttributes: a,
758
+ getTickLabelAttributes: i
759
+ };
760
+ }, On = function(e, t, r) {
761
+ const n = d(() => e.value.step() * e.value.paddingInner() / 2);
762
+ function a(l, u) {
763
+ var c;
764
+ return {
765
+ transform: `translate(0, ${((c = e.value(u)) != null ? c : e.value(l)) - n.value})`
766
+ };
767
+ }
768
+ function o() {
769
+ return {
770
+ x: -43,
771
+ width: 42,
772
+ height: e.value.step()
773
+ };
774
+ }
775
+ function s() {
776
+ const l = e.value.step() / 2;
777
+ return {
778
+ y1: l,
779
+ y2: l,
780
+ x1: t.value.width
781
+ };
782
+ }
783
+ function i() {
784
+ return {
785
+ x: -r.value.tickPadding,
786
+ y: e.value.step() / 2,
787
+ "text-anchor": "end",
788
+ "alignment-baseline": "middle"
789
+ };
790
+ }
791
+ return {
792
+ getGridLinesAttributes: s,
793
+ getTickGhostAttributes: o,
794
+ getTickGroupAttributes: a,
795
+ getTickLabelAttributes: i
796
+ };
797
+ }, xn = function(e, t, r) {
798
+ function n(i) {
799
+ return {
800
+ transform: `translate(${e.value(i)}, 0)`
801
+ };
802
+ }
803
+ function a() {
804
+ return {};
805
+ }
806
+ function o() {
807
+ return {
808
+ y1: -t.value.height
809
+ };
810
+ }
811
+ function s() {
812
+ return {
813
+ y: r.value.tickPadding,
814
+ dy: "0.8em",
815
+ "text-anchor": "middle"
816
+ };
817
+ }
818
+ return {
819
+ getGridLinesAttributes: o,
820
+ getTickGhostAttributes: a,
821
+ getTickGroupAttributes: n,
822
+ getTickLabelAttributes: s
823
+ };
824
+ }, Ln = function(e, t, r) {
825
+ function n(i) {
826
+ return {
827
+ transform: `translate(0, ${e.value(i)})`
828
+ };
829
+ }
830
+ function a() {
831
+ return {};
832
+ }
833
+ function o() {
834
+ return {
835
+ x1: t.value.width
836
+ };
837
+ }
838
+ function s() {
839
+ return {
840
+ x: -r.value.tickPadding,
841
+ dy: "0.4em",
842
+ "text-anchor": "end"
843
+ };
844
+ }
845
+ return {
846
+ getGridLinesAttributes: o,
847
+ getTickGhostAttributes: a,
848
+ getTickGroupAttributes: n,
849
+ getTickLabelAttributes: s
850
+ };
851
+ }, $n = {
852
+ "x-band-scale-axis": An,
853
+ "y-band-scale-axis": On,
854
+ "x-linear-scale-axis": xn,
855
+ "y-linear-scale-axis": Ln
856
+ };
857
+ var yt = /* @__PURE__ */ ((e) => (e.bandScale = "band-scale-axis", e.linearScale = "linear-scale-axis", e))(yt || {}), bt = /* @__PURE__ */ ((e) => (e.left = "left", e.bottom = "bottom", e))(bt || {}), at = /* @__PURE__ */ ((e) => (e.x = "bottom", e.y = "left", e))(at || {});
858
+ const kn = /* @__PURE__ */ k({
859
+ __name: "lume-axis",
860
+ props: {
861
+ scale: {
862
+ type: Function,
863
+ required: !0
864
+ },
865
+ type: {
866
+ type: String,
867
+ default: void 0,
868
+ validator: (e) => e in at
869
+ },
870
+ position: {
871
+ type: String,
872
+ default: void 0,
873
+ validator: (e) => e in bt
874
+ },
875
+ containerSize: {
876
+ type: Object,
877
+ default: () => ({ width: 0, height: 0 })
878
+ },
879
+ hoveredIndex: {
880
+ type: Number,
881
+ default: -1
882
+ },
883
+ orientation: {
884
+ type: String,
885
+ default: b.VERTICAL
886
+ },
887
+ ...dt()
888
+ },
889
+ emits: ["tick-mouseover"],
890
+ setup(e, { emit: t }) {
891
+ const r = e, { scale: n, containerSize: a, hoveredIndex: o, options: s, orientation: i } = S(r), l = it({}), u = L(null), c = L(null), f = L(null), { chartID: _ } = ct(), m = d(
892
+ () => r.type ? at[r.type] : r.position
893
+ ), p = d(
894
+ () => r.type || (m.value === "left" ? "y" : "x")
895
+ ), h = d(
896
+ () => p.value === "x" && i.value === b.VERTICAL || p.value === "y" && i.value === b.HORIZONTAL
897
+ ), { allOptions: g } = N(
898
+ s,
899
+ p.value === "x" ? gn : yn
900
+ ), { showTick: v } = mn(n, u, g.value.skip), y = d(
901
+ () => {
902
+ var x;
903
+ return `translate(0, ${p.value === "x" ? (x = a.value) == null ? void 0 : x.height : 0})`;
904
+ }
905
+ ), O = d(() => {
906
+ if (M(n.value))
907
+ return n.value.labels || n.value.domain();
908
+ const { tickCount: x } = g.value, [C, K] = n.value.domain();
909
+ return ke(C, K, x);
910
+ }), T = d(() => {
911
+ const { tickFormat: x } = g.value;
912
+ return It(x);
913
+ });
914
+ function $(x) {
915
+ const { showTicks: C } = g.value;
916
+ return C === !1 ? "" : T.value(x);
917
+ }
918
+ function P(x) {
919
+ h.value && t("tick-mouseover", x);
920
+ }
921
+ function D(x) {
922
+ return g.value.withHover && h.value && o.value === x;
923
+ }
924
+ function B(x) {
925
+ return `${_}-${p.value}-tick--${x}`;
926
+ }
927
+ function Z(x) {
928
+ if (!!u.value)
929
+ return u.value.find((C) => +C.dataset.index === x);
930
+ }
931
+ function V() {
932
+ f.value = O.value.map((x, C) => ({
933
+ value: x,
934
+ group: l.getTickGroupAttributes(x, C),
935
+ ghost: l.getTickGhostAttributes(Z(C)),
936
+ label: l.getTickLabelAttributes(),
937
+ gridLine: l.getGridLinesAttributes()
938
+ }));
939
+ }
940
+ function X() {
941
+ const x = n.value.step ? "bandScale" : "linearScale", C = $n[`${p.value}-${yt[x]}`];
942
+ Object.entries(C(n, a, g) || []).forEach(
943
+ ([K, vt]) => {
944
+ l[K] = vt;
945
+ }
946
+ );
947
+ }
948
+ return R(n, X, { flush: "sync", immediate: !0 }), R(
949
+ [
950
+ O,
951
+ u,
952
+ () => a.value.width,
953
+ () => a.value.height
954
+ ],
955
+ V,
956
+ { immediate: !0 }
957
+ ), H(() => pt(c.value)), { __sfc: !0, SCALE_MIXIN_MAP: yt, POSITIONS: bt, TYPES: at, props: r, emit: t, scale: n, containerSize: a, hoveredIndex: o, options: s, orientation: i, mixins: l, tickRefs: u, root: c, ticksWithAttributes: f, chartID: _, computedPosition: m, computedType: p, shouldHover: h, allOptions: g, showTick: v, axisTransform: y, ticks: O, tickFormatter: T, formatTick: $, onTickMouseover: P, isHovering: D, getTickId: B, getTextNode: Z, setTicks: V, init: X, VuePortal: Lt, VuePortalTarget: $t };
958
+ }
959
+ });
960
+ function w(e, t, r, n, a, o, s, i) {
961
+ var l = typeof e == "function" ? e.options : e;
962
+ t && (l.render = t, l.staticRenderFns = r, l._compiled = !0), n && (l.functional = !0), o && (l._scopeId = "data-v-" + o);
963
+ var u;
964
+ if (s ? (u = function(_) {
965
+ _ = _ || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !_ && typeof __VUE_SSR_CONTEXT__ < "u" && (_ = __VUE_SSR_CONTEXT__), a && a.call(this, _), _ && _._registeredComponents && _._registeredComponents.add(s);
966
+ }, l._ssrRegister = u) : a && (u = i ? function() {
967
+ a.call(
968
+ this,
969
+ (l.functional ? this.parent : this).$root.$options.shadowRoot
970
+ );
971
+ } : a), u)
972
+ if (l.functional) {
973
+ l._injectStyles = u;
974
+ var c = l.render;
975
+ l.render = function(m, p) {
976
+ return u.call(p), c(m, p);
977
+ };
978
+ } else {
979
+ var f = l.beforeCreate;
980
+ l.beforeCreate = f ? [].concat(f, u) : [u];
981
+ }
982
+ return {
983
+ exports: e,
984
+ options: l
985
+ };
986
+ }
987
+ var wn = function() {
988
+ var t = this, r = t._self._c, n = t._self._setupProxy;
989
+ return n.scale ? r("g", { ref: "root", staticClass: "axis", attrs: { transform: n.axisTransform, "data-j-axis": "" } }, [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) : t._e(), t._l(n.ticksWithAttributes, function(a, o) {
990
+ return r(n.VuePortal, { key: `${a.value}_${o}`, attrs: { slim: "", disabled: !n.isHovering(o), to: `${n.chartID}-${n.computedType}-hovered-portal` } }, [r("g", t._b({ staticClass: "axis__tick", class: {
991
+ "axis__tick--hovered": n.isHovering(o),
992
+ "axis__tick--hidden": n.allOptions.skip && !n.showTick(o)
993
+ }, attrs: { id: n.getTickId(o), "data-j-axis__tick": "" } }, "g", a.group, !1), [r("g", { staticClass: "axis__tick-label lume-typography--axis", attrs: { "pointer-events": "all", "data-j-axis__tick-label": "" }, on: { mouseover: function(s) {
994
+ return n.onTickMouseover(o);
995
+ } } }, [r("rect", t._b({ staticClass: "axis__ghost", attrs: { fill: "url(#lume-tick-gradient)" } }, "rect", a.ghost, !1)), r("text", t._b({ ref: "tickRefs", refInFor: !0, staticClass: "axis__label", attrs: { "data-index": o } }, "text", a.label, !1), [t._v(" " + t._s(n.formatTick(a.value)) + " ")])]), n.allOptions.gridLines ? r("line", t._b({ staticClass: "axis__grid-line" }, "line", a.gridLine, !1)) : t._e()])]);
996
+ }), r(n.VuePortalTarget, { attrs: { name: `${n.chartID}-${n.computedType}-hovered-portal`, slim: "" } })], 2) : t._e();
997
+ }, Sn = [], Cn = /* @__PURE__ */ w(
998
+ kn,
999
+ wn,
1000
+ Sn,
1001
+ !1,
1002
+ null,
1003
+ "44f74829",
1004
+ null,
1005
+ null
1006
+ );
1007
+ const In = Cn.exports;
1008
+ function Rn() {
1009
+ const e = L(), t = it({
1010
+ dimensions: {}
1011
+ }), r = new ResizeObserver((n) => {
1012
+ n.forEach((a) => {
1013
+ t.dimensions = a.contentRect;
1014
+ });
1015
+ });
1016
+ return H(() => {
1017
+ r.observe(e.value);
1018
+ }), Jt(() => {
1019
+ r.unobserve(e.value);
1020
+ }), { resizeState: t, resizeRef: e };
1021
+ }
1022
+ const Pn = /* @__PURE__ */ k({
1023
+ __name: "lume-chart-container",
1024
+ props: {
1025
+ margins: {
1026
+ type: Object,
1027
+ default: () => ({})
1028
+ },
1029
+ containerSize: {
1030
+ type: Object,
1031
+ default: () => ({ width: 0, height: 0 })
1032
+ },
1033
+ transparentBackground: {
1034
+ type: Boolean,
1035
+ default: !1
1036
+ },
1037
+ noMinSize: {
1038
+ type: Boolean,
1039
+ default: !1
1040
+ }
1041
+ },
1042
+ emits: ["resize"],
1043
+ setup(e, { emit: t }) {
1044
+ const r = e, n = {
1045
+ left: 0,
1046
+ right: 0,
1047
+ top: 0,
1048
+ bottom: 0
1049
+ }, { margins: a, containerSize: o } = S(r), s = L(null), { resizeRef: i, resizeState: l } = Rn(), u = d(() => ({
1050
+ ...n,
1051
+ ...a.value
1052
+ })), c = d(
1053
+ () => o.value.height + u.value.top + u.value.bottom
1054
+ );
1055
+ return Qt(() => {
1056
+ if (!s.value)
1057
+ return;
1058
+ const { width: f } = l.dimensions, { height: _ } = s.value.getBoundingClientRect();
1059
+ if (!f || !_)
1060
+ return;
1061
+ const m = f - u.value.left - u.value.right, p = _ - u.value.top - u.value.bottom, h = {
1062
+ width: m > 0 ? m : 0,
1063
+ height: p > 0 ? p : 0,
1064
+ outerWidth: f,
1065
+ outerHeight: _
1066
+ };
1067
+ t("resize", h);
1068
+ }), { __sfc: !0, BASE_MARGINS: n, props: r, emit: t, margins: a, containerSize: o, root: s, resizeRef: i, resizeState: l, computedMargins: u, svgHeight: c };
1069
+ }
1070
+ });
1071
+ var Dn = function() {
1072
+ var t = this, r = t._self._c, n = t._self._setupProxy;
1073
+ return r("div", { ref: "resizeRef", staticClass: "lume-chart-container", class: {
1074
+ "lume-chart-container--minimum": !t.noMinSize
1075
+ }, attrs: { "data-j-chart-container": "" } }, [t._t("header"), r("svg", { ref: "root", staticClass: "lume-chart-container__svg", class: {
1076
+ "lume-chart-container__svg--transparent": t.transparentBackground
1077
+ }, attrs: { height: n.svgHeight, "data-j-chart-container__root": "" }, on: { mouseleave: function(a) {
1078
+ return t.$emit("mouseleave", a);
1079
+ } } }, [r("g", { staticClass: "lume-chart-container__group", attrs: { transform: `translate(${n.computedMargins.left}, ${n.computedMargins.top})`, "data-j-chart-container__group": "" } }, [t._t("default")], 2)]), t._t("footer"), t._t("extra")], 2);
1080
+ }, En = [], Nn = /* @__PURE__ */ w(
1081
+ Pn,
1082
+ Dn,
1083
+ En,
1084
+ !1,
1085
+ null,
1086
+ "136a2456",
1087
+ null,
1088
+ null
1089
+ );
1090
+ const Bn = Nn.exports, Hn = /* @__PURE__ */ k({
1091
+ __name: "lume-chart-legend",
1092
+ props: {
1093
+ data: {
1094
+ type: Array,
1095
+ validator: (e) => !!e && e.every((t) => "color" in t && "label" in t),
1096
+ required: !0
1097
+ }
1098
+ },
1099
+ emits: ["click"],
1100
+ setup(e, { emit: t }) {
1101
+ return { __sfc: !0, emit: t };
1102
+ }
1103
+ });
1104
+ var jn = function() {
1105
+ var t = this, r = t._self._c, n = t._self._setupProxy;
1106
+ return r("div", { staticClass: "lume-chart-legend", attrs: { "data-j-chart-legend": "" } }, t._l(t.data, function(a, o) {
1107
+ return r("div", { key: `legend-item-${o}`, staticClass: "lume-chart-legend__item lume-typography--body", attrs: { tabindex: "0", "data-j-chart-legend__symbol-wrapper": "" }, on: { click: function(s) {
1108
+ return n.emit("click", o);
1109
+ } } }, [r("span", { staticClass: "lume-chart-legend__symbol", class: `lume-background-color--${a.color}`, attrs: { "data-j-chart-legend__symbol": "" } }), t._v(" " + t._s(a.label) + " ")]);
1110
+ }), 0);
1111
+ }, Vn = [], Fn = /* @__PURE__ */ w(
1112
+ Hn,
1113
+ jn,
1114
+ Vn,
1115
+ !1,
1116
+ null,
1117
+ "0cbb8403",
1118
+ null,
1119
+ null
1120
+ );
1121
+ const Gn = Fn.exports, Mn = /* @__PURE__ */ k({
1122
+ __name: "lume-tooltip",
1123
+ props: {
1124
+ targetElement: {
1125
+ type: Element,
1126
+ required: !0
1127
+ },
1128
+ items: {
1129
+ type: Array,
1130
+ required: !0
1131
+ },
1132
+ position: {
1133
+ type: String,
1134
+ default: "auto",
1135
+ validator: (e) => Ye.includes(e)
1136
+ },
1137
+ fixedPositioning: {
1138
+ type: Boolean,
1139
+ default: !1
1140
+ },
1141
+ modifiers: {
1142
+ type: Array,
1143
+ default: null
1144
+ },
1145
+ title: {
1146
+ type: [String, Number],
1147
+ default: null
1148
+ },
1149
+ summary: {
1150
+ type: String,
1151
+ default: null
1152
+ },
1153
+ ...dt()
1154
+ },
1155
+ setup(e) {
1156
+ const t = e, r = L(null), { items: n, options: a } = S(t), o = L(null), { allOptions: s } = N(a), i = d(
1157
+ () => {
1158
+ var g;
1159
+ return (g = s.value.fixedPositioning) != null ? g : t.fixedPositioning;
1160
+ }
1161
+ ), l = d(
1162
+ () => i.value ? "fixed" : "absolute"
1163
+ ), u = d(() => [
1164
+ {
1165
+ name: "computeStyles",
1166
+ options: {
1167
+ adaptive: !1
1168
+ }
1169
+ },
1170
+ {
1171
+ name: "offset",
1172
+ options: { offset: [0, s.value.offset || 8] }
1173
+ },
1174
+ ...t.modifiers || []
1175
+ ]), c = d(
1176
+ () => s.value.showTitle !== !1 && t.title != null
1177
+ ), f = d(() => It(s.value.valueFormat)), _ = d(
1178
+ () => {
1179
+ var g, v;
1180
+ return ((g = n.value) == null ? void 0 : g.find((y) => y.isSummary)) || {
1181
+ label: (v = s.value.summary) != null ? v : t.summary
1182
+ };
1183
+ }
1184
+ );
1185
+ function m() {
1186
+ t.targetElement && r.value && (o.value = Ce(t.targetElement, r.value, {
1187
+ placement: t.position,
1188
+ strategy: l.value,
1189
+ modifiers: u.value
1190
+ }));
1191
+ }
1192
+ function p() {
1193
+ o.value && o.value.destroy();
1194
+ }
1195
+ function h() {
1196
+ !o.value || (r.value.classList.add("lume-tooltip--animated"), t.targetElement ? function() {
1197
+ o.value.state.elements.reference = t.targetElement, o.value.update();
1198
+ }() : p());
1199
+ }
1200
+ return R(() => t.targetElement, h), H(m), Jt(p), { __sfc: !0, props: t, root: r, items: n, options: a, popper: o, allOptions: s, computedFixedPositioning: i, strategy: l, allModifiers: u, showTitle: c, formatValue: f, summaryItem: _, initPopper: m, destroyPopper: p, updatePopper: h };
1201
+ }
1202
+ });
1203
+ var zn = function() {
1204
+ var t = this, r = t._self._c, n = t._self._setupProxy;
1205
+ return r("div", { ref: "root", staticClass: "lume-tooltip lume-typography--caption", attrs: { "data-j-tooltip": "" } }, [t._t("default", function() {
1206
+ return [n.showTitle ? r("div", { staticClass: "lume-tooltip__title", attrs: { "data-j-tooltip__title": "" } }, [t._v(" " + t._s(t.title) + " ")]) : t._e(), r("ul", { staticClass: "lume-tooltip__items" }, [n.summaryItem.label ? [r("li", { staticClass: "lume-tooltip__item", attrs: { "data-j-tooltip__summary-item": "" } }, [r("span", [t._v(" " + t._s(n.summaryItem.label) + " ")]), n.summaryItem.value ? r("strong", { staticClass: "lume-tooltip__value" }, [t._v(" " + t._s(n.formatValue(n.summaryItem.value)) + " ")]) : t._e()]), t._m(0)] : t._e(), t._l(n.items, function(a) {
1207
+ return r("li", { key: a.label, staticClass: "lume-tooltip__item", attrs: { "data-j-tooltip__item": "" } }, [r("span", { staticClass: "lume-tooltip__symbol", class: [`lume-background-color--${a.color}`], attrs: { "data-j-tooltip__item__symbol": "" } }), r("span", { attrs: { "data-j-tooltip__item__label": "" } }, [t._v(" " + t._s(a.label) + " ")]), r("strong", { staticClass: "lume-tooltip__value", attrs: { "data-j-tooltip__item__value": "" } }, [t._v(" " + t._s(n.formatValue(a.value)) + " ")])]);
1208
+ })], 2)];
1209
+ })], 2);
1210
+ }, Wn = [function() {
1211
+ var e = this, t = e._self._c;
1212
+ return e._self._setupProxy, t("li", { staticClass: "lume-tooltip__break" }, [t("hr")]);
1213
+ }], Zn = /* @__PURE__ */ w(
1214
+ Mn,
1215
+ zn,
1216
+ Wn,
1217
+ !1,
1218
+ null,
1219
+ "f861f1d1",
1220
+ null,
1221
+ null
1222
+ );
1223
+ const Xn = Zn.exports;
1224
+ function Un(e, t, r, n) {
1225
+ const a = d(() => r.value > 0 && r.value < 1), o = d(
1226
+ () => n.value > 0 && n.value < 1
1227
+ ), s = d(
1228
+ () => a.value ? e.value - 0.5 : e.value
1229
+ ), i = d(
1230
+ () => o.value ? t.value - 0.5 : t.value
1231
+ );
1232
+ return { computedX: s, computedY: i, shouldHaveMinWidth: a, shouldHaveMinHeight: o };
1233
+ }
1234
+ function qn(e, t, r, n) {
1235
+ const a = L(0), o = L(0), s = d(() => `${e.value + r.value / 2}px ${t.value + n.value / 2}px`);
1236
+ return H(() => {
1237
+ a.value = r.value, o.value = n.value;
1238
+ }), R(r, (i) => a.value = i), R(n, (i) => o.value = i), { computedWidth: a, computedHeight: o, transformOrigin: s };
1239
+ }
1240
+ const Yn = /* @__PURE__ */ k({
1241
+ __name: "lume-bar",
1242
+ props: {
1243
+ x: {
1244
+ type: Number,
1245
+ default: 0
1246
+ },
1247
+ y: {
1248
+ type: Number,
1249
+ default: 0
1250
+ },
1251
+ width: {
1252
+ type: Number,
1253
+ required: !0
1254
+ },
1255
+ height: {
1256
+ type: Number,
1257
+ required: !0
1258
+ },
1259
+ classList: {
1260
+ type: [String, Array],
1261
+ default: ""
1262
+ },
1263
+ isFaded: {
1264
+ type: Boolean,
1265
+ default: !1
1266
+ },
1267
+ isNegative: {
1268
+ type: Boolean,
1269
+ default: !1
1270
+ },
1271
+ transition: {
1272
+ type: [String, Boolean],
1273
+ default: !1
1274
+ }
1275
+ },
1276
+ setup(e) {
1277
+ const t = e, { x: r, y: n, width: a, height: o, transition: s, classList: i } = S(t), l = L(null), u = d(
1278
+ () => typeof i.value == "string" ? [i.value] : i.value
1279
+ ), c = d(() => s.value === "width"), f = d(() => s.value === "height"), _ = qn(r, n, a, o), { computedX: m, computedY: p, shouldHaveMinWidth: h, shouldHaveMinHeight: g } = Un(r, n, a, o), v = d(() => h.value ? 1 : (c.value ? _.computedWidth : a).value), y = d(() => g.value ? 1 : (f.value ? _.computedHeight : o).value), O = c.value || f.value ? _.transformOrigin : null;
1280
+ return H(() => pt(l.value)), { __sfc: !0, props: t, x: r, y: n, width: a, height: o, transition: s, classList: i, root: l, computedClasses: u, shouldTransitionWidth: c, shouldTransitionHeight: f, transitionProps: _, computedX: m, computedY: p, shouldHaveMinWidth: h, shouldHaveMinHeight: g, computedWidth: v, computedHeight: y, transformOrigin: O };
1281
+ }
1282
+ });
1283
+ var Kn = function() {
1284
+ var t = this, r = t._self._c, n = t._self._setupProxy;
1285
+ return r("rect", { ref: "root", staticClass: "lume-bar", class: [
1286
+ {
1287
+ "lume-fill--faded": t.isFaded,
1288
+ "lume-bar--negative": t.isNegative,
1289
+ "lume-bar--transition-width": n.shouldTransitionWidth,
1290
+ "lume-bar--transition-height": n.shouldTransitionHeight
1291
+ },
1292
+ ...n.computedClasses
1293
+ ], style: { transformOrigin: n.transformOrigin }, attrs: { x: n.computedX, y: n.computedY, width: n.computedWidth, height: n.computedHeight, "data-j-bar": "" } });
1294
+ }, Jn = [], Qn = /* @__PURE__ */ w(
1295
+ Yn,
1296
+ Kn,
1297
+ Jn,
1298
+ !1,
1299
+ null,
1300
+ "08915152",
1301
+ null,
1302
+ null
1303
+ );
1304
+ const Rt = Qn.exports, jt = 2, tr = /* @__PURE__ */ k({
1305
+ __name: "lume-line",
1306
+ props: {
1307
+ pathDefinition: {
1308
+ type: String,
1309
+ required: !0
1310
+ },
1311
+ width: {
1312
+ type: Number,
1313
+ default: jt
1314
+ },
1315
+ color: {
1316
+ type: String,
1317
+ default: E.Skyblue
1318
+ },
1319
+ dashed: {
1320
+ type: Boolean,
1321
+ default: !1
1322
+ },
1323
+ transition: {
1324
+ type: Boolean,
1325
+ default: !0
1326
+ },
1327
+ animationDelay: {
1328
+ type: Number,
1329
+ default: 0
1330
+ },
1331
+ animationDuration: {
1332
+ type: Number,
1333
+ default: 0.2
1334
+ }
1335
+ },
1336
+ setup(e) {
1337
+ const t = L(null);
1338
+ return H(() => pt(t.value)), { __sfc: !0, DEFAULT_LINE_WIDTH: jt, root: t };
1339
+ }
1340
+ });
1341
+ var er = function() {
1342
+ var t = this, r = t._self._c;
1343
+ return t._self._setupProxy, r("path", { ref: "root", staticClass: "lume-line", class: {
1344
+ [`lume-stroke--${t.color}`]: !0,
1345
+ "lume-line--dashed": t.dashed,
1346
+ "lume-line--transition": t.transition
1347
+ }, style: {
1348
+ animationDelay: t.transition && t.animationDelay + "s",
1349
+ animationDuration: t.transition && t.animationDuration + "s"
1350
+ }, attrs: { d: t.pathDefinition, "stroke-width": t.width, "data-j-line": "" } });
1351
+ }, nr = [], rr = /* @__PURE__ */ w(
1352
+ tr,
1353
+ er,
1354
+ nr,
1355
+ !1,
1356
+ null,
1357
+ "00afaa24",
1358
+ null,
1359
+ null
1360
+ );
1361
+ const ar = rr.exports, Vt = 4, or = /* @__PURE__ */ k({
1362
+ __name: "lume-point",
1363
+ props: {
1364
+ x: { type: Number, required: !0 },
1365
+ y: { type: Number, required: !0 },
1366
+ color: {
1367
+ type: String,
1368
+ default: E.Skyblue
1369
+ },
1370
+ radius: {
1371
+ type: Number,
1372
+ default: Vt
1373
+ },
1374
+ active: {
1375
+ type: Boolean,
1376
+ default: !1
1377
+ }
1378
+ },
1379
+ setup(e) {
1380
+ const t = e, r = L(null), n = d(() => t.radius / 2);
1381
+ return H(() => pt(r.value)), { __sfc: !0, DEFAULT_RADIUS: Vt, props: t, root: r, strokeWidth: n };
1382
+ }
1383
+ });
1384
+ var sr = function() {
1385
+ var t = this, r = t._self._c, n = t._self._setupProxy;
1386
+ return r("circle", { ref: "root", staticClass: "lume-point", class: `lume-stroke--${t.color}`, attrs: { cx: t.x, cy: t.y, r: t.active ? t.radius : 0, "stroke-width": n.strokeWidth, "data-j-point": "" } });
1387
+ }, ir = [], ur = /* @__PURE__ */ w(
1388
+ or,
1389
+ sr,
1390
+ ir,
1391
+ !1,
1392
+ null,
1393
+ "5a728c02",
1394
+ null,
1395
+ null
1396
+ );
1397
+ const lr = ur.exports, cr = () => ({
1398
+ xScale: {
1399
+ type: Function,
1400
+ default: null
1401
+ },
1402
+ yScale: {
1403
+ type: Function,
1404
+ default: null
1405
+ }
1406
+ });
1407
+ function dr(e, t, r, n, a) {
1408
+ const o = L(null), s = L(null);
1409
+ function i() {
1410
+ const { width: l, height: u } = r;
1411
+ !l && !u || !t.value || !e.value || (n.value === b.HORIZONTAL ? (o.value = Gt(
1412
+ e.value,
1413
+ l,
1414
+ n.value,
1415
+ a.value.startOnZero
1416
+ ), s.value = Ft(t.value, u)) : (o.value = Ft(t.value, l), s.value = Gt(
1417
+ e.value,
1418
+ u,
1419
+ n.value,
1420
+ a.value.startOnZero
1421
+ )));
1422
+ }
1423
+ return Qt(i), { xScale: o, yScale: s };
1424
+ }
1425
+ function Ft(e, t) {
1426
+ const r = [0, t];
1427
+ return Object.assign(
1428
+ J().range(r).domain(e.map((n, a) => a)),
1429
+ { labels: e }
1430
+ );
1431
+ }
1432
+ function Gt(e, t, r, n) {
1433
+ const a = ae(e).filter((c) => c != null), o = [0, t];
1434
+ if (a.length === 0)
1435
+ return Q().range(o).domain([0, 0]).nice();
1436
+ const s = Math.min(...a), i = n && s > 0 ? 0 : s, l = Math.max(...a), u = r === b.HORIZONTAL ? [i, l] : [l, i];
1437
+ return Q().range(o).domain(u).nice();
1438
+ }
1439
+ function Mt(e) {
1440
+ return (e == null ? void 0 : e.range) !== void 0 || (e == null ? void 0 : e.copy) !== void 0;
1441
+ }
1442
+ function Tt(e, t) {
1443
+ return M(e) ? e.bandwidth() / 2 + e(e.domain()[t]) : e(t);
1444
+ }
1445
+ function ot(e, t, {
1446
+ padding: r,
1447
+ paddingInner: n,
1448
+ paddingOuter: a
1449
+ } = {}) {
1450
+ const o = r != null ? r : t === b.HORIZONTAL ? Ue : Xe;
1451
+ return e.copy().paddingInner(n != null ? n : o).paddingOuter(a != null ? a : o / 2);
1452
+ }
1453
+ function ue(e) {
1454
+ return Object.values(b).includes(e);
1455
+ }
1456
+ const W = (e, t = !0, r = !0) => ({
1457
+ ...se(e),
1458
+ ...r ? cr() : {},
1459
+ ...dt(),
1460
+ title: {
1461
+ type: String,
1462
+ default: null
1463
+ },
1464
+ ...t ? {
1465
+ orientation: {
1466
+ type: String,
1467
+ default: b.VERTICAL,
1468
+ validator: ue
1469
+ }
1470
+ } : {},
1471
+ classList: {
1472
+ type: [String, Array],
1473
+ default: () => []
1474
+ }
1475
+ }), ft = () => ({
1476
+ data: {
1477
+ type: Array,
1478
+ required: !0
1479
+ },
1480
+ labels: {
1481
+ type: Array,
1482
+ default: () => []
1483
+ },
1484
+ options: {
1485
+ type: Object,
1486
+ default: () => ({})
1487
+ },
1488
+ orientation: {
1489
+ type: String,
1490
+ default: b.VERTICAL,
1491
+ validator: ue
1492
+ },
1493
+ xScale: {
1494
+ type: Function,
1495
+ default: () => null
1496
+ },
1497
+ yScale: {
1498
+ type: Function,
1499
+ default: () => null
1500
+ },
1501
+ hoveredIndex: {
1502
+ type: Number,
1503
+ default: -1
1504
+ },
1505
+ containerSize: {
1506
+ type: Object,
1507
+ default: () => ({ width: 0, height: 0 })
1508
+ },
1509
+ transition: {
1510
+ type: Boolean,
1511
+ default: !0
1512
+ },
1513
+ classList: {
1514
+ type: [String, Array],
1515
+ default: () => []
1516
+ }
1517
+ }), pr = /* @__PURE__ */ k({
1518
+ __name: "lume-overlay-group",
1519
+ props: {
1520
+ ...ft(),
1521
+ orientation: {
1522
+ type: String,
1523
+ default: b.VERTICAL
1524
+ }
1525
+ },
1526
+ emits: ["mouseover"],
1527
+ setup(e, { emit: t }) {
1528
+ const r = e, { data: n, orientation: a, xScale: o, yScale: s } = S(r), i = d(() => gt(n));
1529
+ function l(u) {
1530
+ const c = a.value === b.HORIZONTAL ? s.value : o.value, f = c.domain(), _ = Ct(c), m = M(c) ? c(f[u]) : c(u) - _ / 2;
1531
+ return a.value === b.HORIZONTAL ? {
1532
+ width: Math.max(...o.value.range()),
1533
+ height: _,
1534
+ transform: `translate(0, ${m})`
1535
+ } : {
1536
+ width: _,
1537
+ height: Math.max(...s.value.range()),
1538
+ transform: `translate(${m}, 0)`
1539
+ };
1540
+ }
1541
+ return { __sfc: !0, props: r, emit: t, data: n, orientation: a, xScale: o, yScale: s, overlayData: i, getOverlayBarAttributes: l, LumeBar: Rt };
1542
+ }
1543
+ });
1544
+ var fr = function() {
1545
+ var t = this, r = t._self._c, n = t._self._setupProxy;
1546
+ return r("g", { staticClass: "lume-overlay-group" }, t._l(n.overlayData, function(a, o) {
1547
+ return r(n.LumeBar, t._b({ key: `overlay-${o}`, attrs: { "data-j-lume-overlay-group": o, transition: !1, "class-list": "lume-fill--transparent" }, nativeOn: { mouseover: function(s) {
1548
+ return n.emit("mouseover", o);
1549
+ } } }, "lume-bar", n.getOverlayBarAttributes(o), !1));
1550
+ }), 1);
1551
+ }, vr = [], _r = /* @__PURE__ */ w(
1552
+ pr,
1553
+ fr,
1554
+ vr,
1555
+ !1,
1556
+ null,
1557
+ null,
1558
+ null,
1559
+ null
1560
+ );
1561
+ const hr = _r.exports;
1562
+ function mr(e) {
1563
+ return { hasNegativeValues: d(
1564
+ () => ae(e.value).some((r) => r < 0)
1565
+ ) };
1566
+ }
1567
+ function gr(e, t, r, n) {
1568
+ const a = d(
1569
+ () => n.value === b.HORIZONTAL
1570
+ ), o = d(
1571
+ () => {
1572
+ var u;
1573
+ return e.height - (a != null && a.value ? 0 : ((u = r.value) == null ? void 0 : u.call(r, 0)) || 0);
1574
+ }
1575
+ ), s = d(
1576
+ () => {
1577
+ var u;
1578
+ return a != null && a.value ? ((u = t.value) == null ? void 0 : u.call(t, 0)) || 0 : e.width;
1579
+ }
1580
+ ), i = d(
1581
+ () => {
1582
+ var u;
1583
+ return a != null && a.value ? "translate(0, 0)" : `translate(0, ${((u = r.value) == null ? void 0 : u.call(r, 0)) || 0})`;
1584
+ }
1585
+ );
1586
+ return { negativeBarAttributes: d(() => ({
1587
+ width: s.value,
1588
+ height: o.value,
1589
+ transform: i.value
1590
+ })) };
1591
+ }
1592
+ function yr(e) {
1593
+ return e.reduce((t, r) => r.values.map((n, a) => {
1594
+ var o;
1595
+ return t[a] ? n.value > t[a] ? n.value : t[a] : (o = n.value) != null ? o : 0;
1596
+ }), []);
1597
+ }
1598
+ function br(e) {
1599
+ return e.reduce((t, r) => r.values.map((n, a) => {
1600
+ var o;
1601
+ return t[a] ? n.value + t[a] : (o = n.value) != null ? o : 0;
1602
+ }), []);
1603
+ }
1604
+ const zt = {
1605
+ "stacked-bar": br
1606
+ }, Wt = L(null);
1607
+ function le(e, t, r, n, a) {
1608
+ function o(s) {
1609
+ const i = (a == null ? void 0 : a.value) && zt[a.value] ? zt[a.value](s) : yr(s);
1610
+ Wt.value = i.map((l, u) => ({
1611
+ cx: (r == null ? void 0 : r.value) === b.HORIZONTAL ? e.value(l) : Tt(e.value, u),
1612
+ cy: (r == null ? void 0 : r.value) === b.HORIZONTAL ? Tt(t.value, u) : t.value(l)
1613
+ }));
1614
+ }
1615
+ return R(
1616
+ [e, t],
1617
+ () => {
1618
+ e.value && t.value && (n == null ? void 0 : n.value) && o(n.value);
1619
+ },
1620
+ { immediate: !0 }
1621
+ ), { tooltipAnchorAttributes: Wt, updateTooltipAnchorAttributes: o };
1622
+ }
1623
+ function Tr() {
1624
+ const e = it({
1625
+ opened: !1,
1626
+ targetElement: null
1627
+ });
1628
+ return { tooltipConfig: e, showTooltip: (n) => {
1629
+ e.opened = !0, e.targetElement = n;
1630
+ }, hideTooltip: () => {
1631
+ e.opened = !1, e.targetElement = null;
1632
+ } };
1633
+ }
1634
+ function Ar(e) {
1635
+ return { getTooltipItems: d(
1636
+ () => (r) => e.value.map(({ color: n, label: a, values: o }) => {
1637
+ var s, i, l, u, c;
1638
+ return {
1639
+ color: ((s = o[r]) == null ? void 0 : s.color) || n,
1640
+ label: a,
1641
+ value: (c = (u = (i = o[r]) == null ? void 0 : i.label) != null ? u : (l = o[r]) == null ? void 0 : l.value) != null ? c : ne
1642
+ };
1643
+ })
1644
+ ) };
1645
+ }
1646
+ const Or = /* @__PURE__ */ k({
1647
+ __name: "lume-chart",
1648
+ props: {
1649
+ ...W(),
1650
+ chartType: {
1651
+ type: String,
1652
+ default: null
1653
+ }
1654
+ },
1655
+ emits: ["click"],
1656
+ setup(e, { emit: t }) {
1657
+ const r = e, n = j(), a = qe, { data: o, labels: s, color: i, options: l, orientation: u, chartType: c } = S(r), f = L(-1), _ = L(null), m = L(null), { allOptions: p } = N(l), { internalData: h, computedLabels: g, containerSize: v, updateSize: y, chartID: O } = ct(o, s, i, p, u), { xScale: T, yScale: $ } = dr(
1658
+ h,
1659
+ g,
1660
+ v,
1661
+ u,
1662
+ p
1663
+ ), P = d(() => {
1664
+ var A;
1665
+ return r.xScale ? Mt(r.xScale) ? r.xScale : (A = r.xScale) == null ? void 0 : A.call(r, h.value, s.value, v) : T.value;
1666
+ }), D = d(() => {
1667
+ var A;
1668
+ return r.yScale ? Mt(r.yScale) ? r.yScale : (A = r.yScale) == null ? void 0 : A.call(r, h.value, s.value, v) : $.value;
1669
+ }), B = d(() => ({
1670
+ ...p.value.xAxisOptions,
1671
+ withHover: u.value === b.VERTICAL
1672
+ })), Z = d(() => ({
1673
+ ...p.value.yAxisOptions,
1674
+ withHover: u.value === b.HORIZONTAL
1675
+ })), V = d(() => {
1676
+ var A;
1677
+ return (A = p.value.xAxisOptions) == null ? void 0 : A.title;
1678
+ }), X = d(() => {
1679
+ var A;
1680
+ return (A = p.value.yAxisOptions) == null ? void 0 : A.title;
1681
+ }), x = d(() => {
1682
+ var A;
1683
+ return ((A = p.value.xAxisOptions) == null ? void 0 : A.withTitle) !== !1 && V.value;
1684
+ }), C = d(() => {
1685
+ var A;
1686
+ return ((A = p.value.yAxisOptions) == null ? void 0 : A.withTitle) !== !1 && X.value;
1687
+ }), K = d(
1688
+ () => {
1689
+ var A;
1690
+ return p.value.withTooltip !== !1 && !((A = p.value.tooltipOptions) != null && A.targetElement);
1691
+ }
1692
+ ), vt = d(() => {
1693
+ const A = [], { noBaseScales: et } = p.value;
1694
+ return et || A.push(() => !!(P.value && D.value)), A.every((_t) => _t() === !0);
1695
+ }), { hasNegativeValues: _e } = mr(h), { negativeBarAttributes: he } = gr(
1696
+ v,
1697
+ P,
1698
+ D,
1699
+ u
1700
+ ), { tooltipAnchorAttributes: me } = le(
1701
+ P,
1702
+ D,
1703
+ u,
1704
+ h,
1705
+ c
1706
+ ), { tooltipConfig: ge, showTooltip: Dt, hideTooltip: Et } = Tr(), { getTooltipItems: ye } = Ar(h), be = d(
1707
+ () => {
1708
+ var A;
1709
+ return ((A = p.value.tooltipOptions) == null ? void 0 : A.position) || "top";
1710
+ }
1711
+ );
1712
+ function Te(A) {
1713
+ var et;
1714
+ if (p.value.withHover !== !1 && (f.value = A), p.value.withTooltip !== !1) {
1715
+ const _t = (et = p.value.tooltipOptions) != null && et.targetElement ? p.value.tooltipOptions.targetElement === "self" ? m.value.$el : p.value.tooltipOptions.targetElement : _.value[A];
1716
+ Dt(_t);
1717
+ }
1718
+ }
1719
+ function Ae() {
1720
+ Et(), f.value = -1;
1721
+ }
1722
+ return H(() => {
1723
+ var A;
1724
+ (A = n.groups) != null && A.call(n) || console.error('"groups" `<slot>` must have content.');
1725
+ }), { __sfc: !0, props: r, slots: n, emit: t, tooltipAnchorRadius: a, data: o, labels: s, color: i, options: l, orientation: u, chartType: c, hoveredIndex: f, tooltipAnchor: _, chartContainer: m, allOptions: p, internalData: h, computedLabels: g, containerSize: v, updateSize: y, chartID: O, xScale: T, yScale: $, computedXScale: P, computedYScale: D, computedXAxisOptions: B, computedYAxisOptions: Z, xAxisTitle: V, yAxisTitle: X, showXAxisTitle: x, showYAxisTitle: C, shouldGenerateTooltipAnchors: K, isReady: vt, hasNegativeValues: _e, negativeBarAttributes: he, tooltipAnchorAttributes: me, tooltipConfig: ge, showTooltip: Dt, hideTooltip: Et, getTooltipItems: ye, tooltipPosition: be, mouseOverHandler: Te, handleMouseleave: Ae, VuePortal: Lt, VuePortalTarget: $t, LumeAxis: In, LumeBar: Rt, LumeChartContainer: Bn, LumeChartLegend: Gn, LumeTooltip: Xn, LumeOverlayGroup: hr };
1726
+ }
1727
+ });
1728
+ var xr = function() {
1729
+ var t = this, r = t._self._c, n = t._self._setupProxy;
1730
+ return r(n.LumeChartContainer, { ref: "chartContainer", attrs: { margins: n.allOptions.margins, "container-size": n.containerSize, "no-min-size": n.allOptions.noMinSize, "transparent-background": n.allOptions.transparentBackground, "data-j-lume-chart": "" }, on: { resize: n.updateSize, mouseleave: n.handleMouseleave }, scopedSlots: t._u([{ key: "header", fn: function() {
1731
+ return [r("div", { staticClass: "lume-chart__header" }, [r("div", { staticClass: "lume-chart__header-section" }, [t.title ? r("h1", { staticClass: "lume-chart__title lume-chart-title lume-typography--display" }, [t._v(" " + t._s(t.title) + " ")]) : t._e(), r("div", { staticClass: "lume-chart__controls" }, [t._t("controls")], 2)]), r("div", { staticClass: "lume-chart__header-section" }, [n.showYAxisTitle ? r("h3", { staticClass: "lume-chart__axis-title lume-axis-title lume-typography--body" }, [t._v(" " + t._s(n.yAxisTitle) + " ")]) : t._e(), n.allOptions.withLegend !== !1 ? r(n.VuePortal, { attrs: { disabled: n.allOptions.legendPosition !== "bottom", to: `legend-bottom-${n.chartID}`, slim: "" } }, [r(n.LumeChartLegend, { staticClass: "lume-chart__legend", attrs: { data: n.internalData, "data-j-lume-chart__legend": "" }, on: { click: function(a) {
1732
+ return n.emit("click", a);
1733
+ } } })], 1) : t._e()], 1)])];
1734
+ }, proxy: !0 }, { key: "footer", fn: function() {
1735
+ return [n.showXAxisTitle ? r("h3", { staticClass: "lume-chart__axis-title lume-chart__axis-title--centered lume-axis-title" }, [t._v(" " + t._s(n.xAxisTitle) + " ")]) : t._e(), r(n.VuePortalTarget, { attrs: { name: `legend-bottom-${n.chartID}`, slim: "" } })];
1736
+ }, proxy: !0 }, { key: "extra", fn: function() {
1737
+ return [t._t("tooltip", function() {
1738
+ return [n.allOptions.withTooltip !== !1 && n.tooltipConfig.opened ? r(n.LumeTooltip, t._b({ attrs: { position: n.tooltipPosition, title: n.computedLabels[n.hoveredIndex], items: n.getTooltipItems(n.hoveredIndex), options: n.allOptions.tooltipOptions, "data-j-lume-chart__tooltip": "" } }, "lume-tooltip", n.tooltipConfig, !1), [t._t("tooltip-content", null, { data: n.internalData, labels: n.computedLabels, hoveredIndex: n.hoveredIndex })], 2) : t._e()];
1739
+ }, { data: n.internalData, labels: n.computedLabels, withTooltip: n.allOptions.withTooltip !== !1, hoveredIndex: n.hoveredIndex, options: n.allOptions.tooltipOptions }, n.tooltipConfig)];
1740
+ }, proxy: !0 }], null, !0) }, [n.isReady ? [n.hasNegativeValues ? r(n.LumeBar, t._b({ attrs: { "class-list": "lume-fill--negative", transition: !1, "data-j-lume-chart__negative-values": "" } }, "lume-bar", n.negativeBarAttributes, !1)) : t._e(), n.allOptions.withAxes !== !1 ? t._t("axes", function() {
1741
+ return [r(n.LumeAxis, { attrs: { type: "x", scale: n.computedXScale, "container-size": n.containerSize, options: n.computedXAxisOptions, "hovered-index": n.hoveredIndex, orientation: n.orientation, "data-j-lume-chart__x-axis": "" }, on: { "tick-mouseover": function(a) {
1742
+ return n.mouseOverHandler(a);
1743
+ } } }), r(n.LumeAxis, { attrs: { type: "y", scale: n.computedYScale, "container-size": n.containerSize, options: n.computedYAxisOptions, "hovered-index": n.hoveredIndex, orientation: n.orientation, "data-j-lume-chart__y-axis": "" }, on: { "tick-mouseover": function(a) {
1744
+ return n.mouseOverHandler(a);
1745
+ } } })];
1746
+ }, { xScale: n.computedXScale, yScale: n.computedYScale, containerSize: n.containerSize, options: n.allOptions, hoveredIndex: n.hoveredIndex }) : t._e(), t._t("groups", null, { data: n.internalData, labels: n.computedLabels, options: n.allOptions, orientation: n.orientation, xScale: n.computedXScale, yScale: n.computedYScale, hoveredIndex: n.hoveredIndex, containerSize: n.containerSize, transition: n.allOptions.withTransition !== !1, classList: t.classList }), 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: { mouseover: n.mouseOverHandler } }) : t._e(), n.shouldGenerateTooltipAnchors ? r("g", t._l(n.tooltipAnchorAttributes, function(a) {
1747
+ return r("circle", t._b({ key: `anchor-${a.cx}`, ref: "tooltipAnchor", refInFor: !0, staticClass: "lume-fill--transparent", attrs: { r: n.tooltipAnchorRadius } }, "circle", a, !1));
1748
+ }), 0) : t._e()] : t._e()], 2);
1749
+ }, Lr = [], $r = /* @__PURE__ */ w(
1750
+ Or,
1751
+ xr,
1752
+ Lr,
1753
+ !1,
1754
+ null,
1755
+ "72738e5f",
1756
+ null,
1757
+ null
1758
+ );
1759
+ const Y = $r.exports;
1760
+ function Zt(e, t) {
1761
+ return {
1762
+ x0: 0 + (t ? t.left : 0),
1763
+ y0: 0 + (t ? t.top : 0),
1764
+ x1: e.width - (t ? t.right : 0),
1765
+ y1: e.height - (t ? t.bottom : 0)
1766
+ };
1767
+ }
1768
+ function kr(e) {
1769
+ const t = L(Zt(e));
1770
+ function r(n) {
1771
+ t.value = Zt(e, n);
1772
+ }
1773
+ return { extents: t, updateExtents: r };
1774
+ }
1775
+ var ce = /* @__PURE__ */ ((e) => (e.GraphProblem = "There was an issue generating your alluvial graph.", e))(ce || {});
1776
+ const wr = "[lume] ";
1777
+ function Sr(e, t, r = !0) {
1778
+ r && re() || console.error(wr + "Error: " + e, t);
1779
+ }
1780
+ const Xt = 8, Cr = 8, Ir = 200;
1781
+ function U(e) {
1782
+ var t;
1783
+ return typeof e == "string" || typeof e == "number" ? e : (t = e.id) != null ? t : e.label;
1784
+ }
1785
+ function st(e) {
1786
+ return e.source.id + ":" + e.target.id;
1787
+ }
1788
+ function de(e) {
1789
+ return Boolean(
1790
+ e.sourceLinks && e.targetLinks
1791
+ );
1792
+ }
1793
+ function Rr(e, t) {
1794
+ if (!t)
1795
+ return;
1796
+ const r = e.nodes.filter((s) => s.targetLinks.length === 0).map((s) => `${s.id}`), n = e.nodes.filter((s) => s.sourceLinks.length === 0).map((s) => `${s.id}`), a = t.filter((s) => r.includes(s.dataset.id)).reduce(
1797
+ (s, i) => Math.max(s, i.getBBox().width),
1798
+ -1 / 0
1799
+ ), o = t.filter((s) => n.includes(s.dataset.id)).reduce(
1800
+ (s, i) => Math.max(s, i.getBBox().width),
1801
+ -1 / 0
1802
+ );
1803
+ return {
1804
+ left: a,
1805
+ top: 0,
1806
+ right: o,
1807
+ bottom: 0
1808
+ };
1809
+ }
1810
+ function Pr(e) {
1811
+ return e.map((t) => ({
1812
+ x: t.x0,
1813
+ y: t.y0,
1814
+ width: t.x1 - t.x0,
1815
+ height: t.y1 - t.y0,
1816
+ textTransform: {
1817
+ x: t.depth > 0 ? t.x1 + Xt : t.x0 - Xt,
1818
+ y: (t.y1 + t.y0) / 2
1819
+ },
1820
+ node: t
1821
+ }));
1822
+ }
1823
+ function Dr(e) {
1824
+ const t = Oe();
1825
+ return e.map((r) => {
1826
+ var n;
1827
+ return {
1828
+ id: st(r),
1829
+ color: r.color || ((n = r.source) == null ? void 0 : n.color) || lt,
1830
+ d: t(r),
1831
+ strokeWidth: Math.max(1, r.width),
1832
+ link: r
1833
+ };
1834
+ });
1835
+ }
1836
+ function Ut(e, t, r) {
1837
+ const n = Date.now(), a = en(t, r), o = () => {
1838
+ let i = (Date.now() - n) / Ir;
1839
+ i > 1 && (i = 1), q.set(e.node, "transitionValue", a(i)), i < 1 && requestAnimationFrame(o);
1840
+ };
1841
+ requestAnimationFrame(o);
1842
+ }
1843
+ const Er = {
1844
+ nodes: [],
1845
+ links: []
1846
+ };
1847
+ function Nr(e, t, r) {
1848
+ const n = L(null), a = d(() => {
1849
+ var i;
1850
+ return (i = e.value) == null ? void 0 : i[0].values.map(({ label: l, color: u, value: c }) => ({
1851
+ label: l || c.toString(),
1852
+ color: u,
1853
+ id: c
1854
+ }));
1855
+ }), o = d(() => {
1856
+ var i;
1857
+ return (i = e.value) == null ? void 0 : i[0].values.map(
1858
+ (l) => {
1859
+ var u;
1860
+ return (u = l.targets) == null ? void 0 : u.map(({ node: c, value: f, color: _ }) => {
1861
+ var m;
1862
+ return {
1863
+ color: _,
1864
+ source: (m = l.value) != null ? m : l.label,
1865
+ target: c,
1866
+ value: f
1867
+ };
1868
+ });
1869
+ }
1870
+ ).filter(Boolean).flat();
1871
+ }), s = d(() => xe().nodeId(U).nodeAlign(t.value.nodeAlign).nodePadding(t.value.nodePadding).nodeSort(t.value.nodeSort).nodeWidth(t.value.nodeWidth));
1872
+ return R([s, r], () => {
1873
+ try {
1874
+ const { x0: i, y0: l, x1: u, y1: c } = r.value;
1875
+ n.value = s.value.extent([
1876
+ [i, l],
1877
+ [u, c]
1878
+ ])({ nodes: a.value, links: o.value });
1879
+ } catch (i) {
1880
+ Sr(ce.GraphProblem, i), n.value = Er;
1881
+ }
1882
+ }), { graph: n };
1883
+ }
1884
+ function At(e, t) {
1885
+ return t || (t = {}), e.targetLinks && e.targetLinks.forEach(({ source: r, value: n }) => {
1886
+ t[r.id] = n, At(r, t);
1887
+ }), t;
1888
+ }
1889
+ function Ot(e, t) {
1890
+ return t || (t = {}), e.sourceLinks && e.sourceLinks.forEach(({ target: r, value: n }) => {
1891
+ t[r.id] = n, Ot(r, t);
1892
+ }), t;
1893
+ }
1894
+ function Br(e, t) {
1895
+ return t.links.reduce((r, n) => (n.source.id in e && n.target.id in e && r.push(st(n)), r), []);
1896
+ }
1897
+ const Hr = (e, t) => {
1898
+ let r;
1899
+ de(e) ? r = {
1900
+ [e.id]: e.value,
1901
+ ...At(e),
1902
+ ...Ot(e)
1903
+ } : r = {
1904
+ [e.source.id]: e.source.value,
1905
+ [e.target.id]: e.target.value,
1906
+ ...At(e.source),
1907
+ ...Ot(e.target)
1908
+ };
1909
+ const n = Br(r, t);
1910
+ return { nodes: r, links: n };
1911
+ }, jr = (e) => {
1912
+ if (de(e)) {
1913
+ const t = [...e.sourceLinks, ...e.targetLinks];
1914
+ return {
1915
+ nodes: t.reduce(
1916
+ (r, { source: n, target: a, value: o }) => n === e ? { ...r, [U(a)]: o } : { ...r, [U(n)]: o },
1917
+ { [U(e)]: e.value }
1918
+ ),
1919
+ links: t.map((r) => st(r))
1920
+ };
1921
+ }
1922
+ return {
1923
+ nodes: {
1924
+ [U(e.target)]: e.value,
1925
+ [U(e.source)]: e.source.value
1926
+ },
1927
+ links: [st(e)]
1928
+ };
1929
+ };
1930
+ function Vr(e, t, r) {
1931
+ const n = L(null), a = d(() => n.value ? typeof t.value.highlightedElements == "function" ? t.value.highlightedElements(
1932
+ n.value,
1933
+ r.value
1934
+ ) : t.value.highlightedElements === "closest" ? jr(n.value, r.value) : Hr(n.value, r.value) : { nodes: {}, links: [] });
1935
+ return R(a, (o, s) => {
1936
+ if (o.links.length === 0 && Object.keys(o.nodes).length === 0) {
1937
+ e.value.forEach((i) => {
1938
+ i.node.id in s.nodes && Ut(
1939
+ i,
1940
+ s.nodes[i.node.id],
1941
+ i.node.value
1942
+ );
1943
+ });
1944
+ return;
1945
+ }
1946
+ e.value.forEach((i) => {
1947
+ i.node.id in o.nodes && Ut(
1948
+ i,
1949
+ i.node.value,
1950
+ o.nodes[i.node.id]
1951
+ );
1952
+ });
1953
+ }), { highlightedElements: a, hoveredElement: n };
1954
+ }
1955
+ const Fr = /* @__PURE__ */ k({
1956
+ __name: "lume-alluvial-group",
1957
+ props: {
1958
+ ...ft()
1959
+ },
1960
+ setup(e) {
1961
+ const t = e, { data: r, options: n } = S(t), a = L([]), o = L([]), s = L(null), { extents: i, updateExtents: l } = kr(t.containerSize), { graph: u } = Nr(r, n, i), { hoveredElement: c, highlightedElements: f } = Vr(
1962
+ a,
1963
+ n,
1964
+ u
1965
+ ), _ = d(() => It(n.value.valueFormat)), m = d(
1966
+ () => Object.keys(f.value.nodes)
1967
+ );
1968
+ function p(g) {
1969
+ return m.value.length > 0 && !m.value.includes(g.toString());
1970
+ }
1971
+ function h(g) {
1972
+ return f.value.links.length > 0 && !f.value.links.includes(g);
1973
+ }
1974
+ return R(u, (g) => {
1975
+ a.value = Pr(g.nodes), o.value = Dr(g.links);
1976
+ }), R([t.containerSize, s], () => {
1977
+ if (t.containerSize.width && t.containerSize.height) {
1978
+ const g = Rr(u.value, s.value);
1979
+ l(g);
1980
+ }
1981
+ }), { __sfc: !0, props: t, data: r, options: n, nodeBlocks: a, linkPaths: o, nodeTextRefs: s, extents: i, updateExtents: l, graph: u, hoveredElement: c, highlightedElements: f, formatValue: _, hoveredNodeIds: m, isNodeFaded: p, isLinkFaded: h, GHOST_STROKE_WIDTH_OFFSET: Cr, DEFAULT_COLOR: lt };
1982
+ }
1983
+ });
1984
+ var Gr = function() {
1985
+ var t = this, r = t._self._c, n = t._self._setupProxy;
1986
+ return r("g", { staticClass: "lume-alluvial-group", attrs: { "data-j-alluvial-group": "" } }, [t._l(n.nodeBlocks, function(a, o) {
1987
+ return r("g", { key: `node-block_${o}`, staticClass: "lume-alluvial-group__node", class: {
1988
+ "lume-alluvial-group__node--faded": n.isNodeFaded(a.node.id)
1989
+ }, attrs: { "data-j-alluvial-group__node-block": "" } }, [r("g", { on: { mouseover: function(s) {
1990
+ n.hoveredElement = a.node;
1991
+ }, mouseout: function(s) {
1992
+ n.hoveredElement = null;
1993
+ } } }, [r("rect", { class: `lume-alluvial-group__node-block--${a.node.color || n.DEFAULT_COLOR}`, attrs: { x: a.x, y: a.y, height: a.height, width: a.width } }), r("text", { ref: "nodeTextRefs", refInFor: !0, staticClass: "lume-alluvial-group__node-text lume-typography--caption", class: {
1994
+ "lume-alluvial-group__node-text--right": a.node.depth === 0
1995
+ }, attrs: { transform: `translate(${a.textTransform.x},${a.textTransform.y})`, "data-id": a.node.id } }, [r("tspan", { staticClass: "lume-alluvial-group__node-title", domProps: { textContent: t._s(a.node.label) } }), r("tspan", { staticClass: "lume-alluvial-group__node-value", attrs: { x: "0", dy: "1.2em" }, domProps: { textContent: t._s(
1996
+ n.formatValue(
1997
+ a.node.transitionValue || a.node.value
1998
+ )
1999
+ ) } })])])]);
2000
+ }), r("g", { staticClass: "lume-alluvial-link-group", on: { mouseleave: function(a) {
2001
+ n.hoveredElement = null;
2002
+ } } }, [t._l(n.linkPaths, function(a) {
2003
+ return r("path", { key: `link-ghost_${a.id}`, staticClass: "lume-alluvial-group__link", class: [
2004
+ "lume-stroke--transparent",
2005
+ "lume-alluvial-group__link--ghost"
2006
+ ], attrs: { d: a.d, "stroke-width": a.strokeWidth + n.GHOST_STROKE_WIDTH_OFFSET, "data-j-alluvial-ghost": "" }, on: { mouseover: function(o) {
2007
+ n.hoveredElement = a.link;
2008
+ } } });
2009
+ }), t._l(n.linkPaths, function(a) {
2010
+ return r("path", { key: `link_${a.id}`, staticClass: "lume-alluvial-group__link", class: {
2011
+ [`lume-stroke--${a.color}`]: a.color,
2012
+ "lume-alluvial-group__link--faded": n.isLinkFaded(a.id)
2013
+ }, attrs: { d: a.d, "stroke-dasharray": t.containerSize.width, "stroke-dashoffset": t.containerSize.width, "stroke-width": a.strokeWidth, "data-j-alluvial-path": "" }, on: { mouseover: function(o) {
2014
+ n.hoveredElement = a.link;
2015
+ } } });
2016
+ })], 2)], 2);
2017
+ }, Mr = [], zr = /* @__PURE__ */ w(
2018
+ Fr,
2019
+ Gr,
2020
+ Mr,
2021
+ !1,
2022
+ null,
2023
+ "5377a0bf",
2024
+ null,
2025
+ null
2026
+ );
2027
+ const Wr = zr.exports, Zr = {
2028
+ margins: {
2029
+ top: 0,
2030
+ right: 0,
2031
+ bottom: 0,
2032
+ left: 0
2033
+ },
2034
+ withAxes: !1,
2035
+ withTooltip: !1,
2036
+ withHover: !1,
2037
+ withLegend: !1,
2038
+ highlightedElements: "full",
2039
+ nodePadding: 16,
2040
+ nodeWidth: 16,
2041
+ nodeAlign: Le,
2042
+ valueFormat: (e) => String(e)
2043
+ }, Xr = /* @__PURE__ */ k({
2044
+ __name: "lume-alluvial-diagram",
2045
+ props: {
2046
+ ...W(
2047
+ St,
2048
+ !1,
2049
+ !1
2050
+ )
2051
+ },
2052
+ setup(e) {
2053
+ const t = e, r = z(j()), { options: n } = S(t), { allOptions: a } = N(n, Zr);
2054
+ function o(s) {
2055
+ return {
2056
+ ...s,
2057
+ noBaseScales: !0
2058
+ };
2059
+ }
2060
+ return { __sfc: !0, props: t, slots: r, options: n, allOptions: a, getAlluvialDiagramOptions: o, LumeChart: Y, LumeAlluvialGroup: Wr };
2061
+ }
2062
+ });
2063
+ var Ur = function() {
2064
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2065
+ return r(n.LumeChart, t._b({ attrs: { options: n.getAlluvialDiagramOptions(n.allOptions), "data-j-alluvial-diagram": "" }, scopedSlots: t._u([{ key: "groups", fn: function(a) {
2066
+ return [r(n.LumeAlluvialGroup, t._b({}, "lume-alluvial-group", a, !1))];
2067
+ } }, t._l(n.slots, function(a, o) {
2068
+ return { key: o, fn: function(s) {
2069
+ return [t._t(o, null, null, s || {})];
2070
+ } };
2071
+ })], null, !0) }, "lume-chart", n.props, !1));
2072
+ }, qr = [], Yr = /* @__PURE__ */ w(
2073
+ Xr,
2074
+ Ur,
2075
+ qr,
2076
+ !1,
2077
+ null,
2078
+ null,
2079
+ null,
2080
+ null
2081
+ );
2082
+ const Ka = Yr.exports;
2083
+ var xt = /* @__PURE__ */ ((e) => (e.grouped = "grouped", e.stacked = "stacked", e))(xt || {});
2084
+ const Kr = /* @__PURE__ */ k({
2085
+ __name: "lume-bar-chart",
2086
+ props: {
2087
+ ...W(),
2088
+ type: {
2089
+ type: String,
2090
+ default: null,
2091
+ validator: (e) => e in xt || e == null
2092
+ }
2093
+ },
2094
+ setup(e) {
2095
+ const t = e, r = ht(
2096
+ () => import("./89f42264.js")
2097
+ ), n = ht(
2098
+ () => import("./da580106.js")
2099
+ ), a = ht(
2100
+ () => import("./7ec9527d.js")
2101
+ ), o = /* @__PURE__ */ new Map([
2102
+ ["single", r],
2103
+ ["grouped", n],
2104
+ ["stacked", a]
2105
+ ]), s = z(j());
2106
+ function i(u) {
2107
+ return {
2108
+ ...u,
2109
+ startOnZero: !0,
2110
+ tooltipOptions: {
2111
+ ...(u == null ? void 0 : u.tooltipOptions) || {},
2112
+ position: t.orientation === b.HORIZONTAL && "right"
2113
+ }
2114
+ };
2115
+ }
2116
+ const l = d(() => {
2117
+ if (!!t.data) {
2118
+ if (St(t.data))
2119
+ return o.get("single");
2120
+ if (!t.type)
2121
+ throw new Error("Bar chart needs a type when there's multiple datasets.");
2122
+ return o.get(t.type);
2123
+ }
2124
+ });
2125
+ return { __sfc: !0, TYPES: xt, LumeSingleBarChart: r, LumeGroupedBarChart: n, LumeStackedBarChart: a, COMPONENT_MAP: o, props: t, slots: s, getBarChartOptions: i, component: l };
2126
+ }
2127
+ });
2128
+ var Jr = function() {
2129
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2130
+ return r(n.component, t._b({ tag: "component", attrs: { options: n.getBarChartOptions(t.options) }, scopedSlots: t._u([t._l(n.slots, function(a, o) {
2131
+ return { key: o, fn: function(s) {
2132
+ return [t._t(o, null, null, s || {})];
2133
+ } };
2134
+ })], null, !0) }, "component", { ...n.props, ...t.$attrs }, !1));
2135
+ }, Qr = [], ta = /* @__PURE__ */ w(
2136
+ Kr,
2137
+ Jr,
2138
+ Qr,
2139
+ !1,
2140
+ null,
2141
+ null,
2142
+ null,
2143
+ null
2144
+ );
2145
+ const Ja = ta.exports;
2146
+ function ea(e) {
2147
+ return Object.values(We).includes(e) || e == null;
2148
+ }
2149
+ function na(e) {
2150
+ return Object.values(b).includes(e);
2151
+ }
2152
+ const ra = (e = !1) => ({
2153
+ type: {
2154
+ type: String,
2155
+ default: null,
2156
+ validator: ea
2157
+ },
2158
+ ...e ? {
2159
+ orientation: {
2160
+ type: String,
2161
+ default: b.VERTICAL,
2162
+ validator: na
2163
+ }
2164
+ } : {}
2165
+ });
2166
+ function pe(e) {
2167
+ const t = d(() => e.value.map((n) => ({
2168
+ ...n,
2169
+ values: n.values.map((a) => ({
2170
+ ...a,
2171
+ value: (a == null ? void 0 : a.value) || 0
2172
+ }))
2173
+ }))), r = d(() => {
2174
+ var n;
2175
+ return (n = t.value) == null ? void 0 : n.reduce((a, o) => (o.values.forEach((s, i) => {
2176
+ a[i] ? a[i].push(s) : a[i] = [s];
2177
+ }), a), []);
2178
+ });
2179
+ return { multiBarData: t, groupedData: r };
2180
+ }
2181
+ function aa(e, t) {
2182
+ return e.value.length === 1 ? "single" : t.value;
2183
+ }
2184
+ function oa(e, t, r, n) {
2185
+ const a = d(
2186
+ () => n.value === b.HORIZONTAL
2187
+ );
2188
+ function o(l) {
2189
+ Math.min(...l.domain()) > 0 && console.error("Bar linear scale domain cannot start above 0!");
2190
+ }
2191
+ const s = d(() => {
2192
+ const { padding: l, paddingInner: u, paddingOuter: c } = r.value;
2193
+ return a.value ? (() => (o(e.value), e.value))() : ot(
2194
+ e.value,
2195
+ n.value,
2196
+ { padding: l, paddingInner: u, paddingOuter: c }
2197
+ );
2198
+ }), i = d(() => {
2199
+ const { padding: l, paddingInner: u, paddingOuter: c } = r.value;
2200
+ return a.value ? ot(
2201
+ t.value,
2202
+ n.value,
2203
+ { padding: l, paddingInner: u, paddingOuter: c }
2204
+ ) : (() => (o(t.value), t.value))();
2205
+ });
2206
+ return { barXScale: s, barYScale: i };
2207
+ }
2208
+ function sa(e, t, r, n, a, o) {
2209
+ const s = d(
2210
+ () => n.value === b.HORIZONTAL
2211
+ );
2212
+ function i(f, _) {
2213
+ let m, p;
2214
+ return s.value ? (m = f >= 0 ? t.value(0) : t.value(f), p = r.value(r.value.domain()[_])) : (m = t.value(t.value.domain()[_]), p = f < 0 ? r.value(0) : r.value(f)), { x: m, y: p };
2215
+ }
2216
+ function l(f) {
2217
+ return s.value ? f < 0 ? t.value(0) - t.value(f) : t.value(f) - t.value(0) : t.value.bandwidth();
2218
+ }
2219
+ function u(f) {
2220
+ return s.value ? r.value.bandwidth() : f < 0 ? r.value(f) - r.value(0) : r.value(0) - r.value(f);
2221
+ }
2222
+ function c(f, _, m) {
2223
+ var $;
2224
+ const { value: p, color: h } = f, g = ($ = h != null ? h : e.value[_].color) != null ? $ : lt, { x: v, y } = i(p, m), O = l(p), T = u(p);
2225
+ return {
2226
+ classList: [`lume-fill--${g}`, ...o],
2227
+ x: v,
2228
+ y,
2229
+ width: O,
2230
+ height: T,
2231
+ isFaded: a.value !== -1 && a.value !== m,
2232
+ isNegative: p < 0
2233
+ };
2234
+ }
2235
+ return { barAttributeGenerator: c };
2236
+ }
2237
+ function ia(e, t, r, n, a, o) {
2238
+ const s = d(
2239
+ () => n.value === b.HORIZONTAL
2240
+ ), i = d(() => J().domain(e.value.map((p, h) => h)).range([0, t.value.bandwidth()]).padding(0)), l = d(() => J().domain(e.value.map((p, h) => h)).range([0, r.value.bandwidth()]).padding(0));
2241
+ function u(p, h, g) {
2242
+ if (s.value)
2243
+ return p >= 0 ? t.value(0) : t.value(p);
2244
+ const v = t.value.domain();
2245
+ return t.value(v[h]) + i.value(g);
2246
+ }
2247
+ function c(p, h, g) {
2248
+ if (s.value) {
2249
+ const v = r.value.domain();
2250
+ return r.value(v[h]) + l.value(g);
2251
+ }
2252
+ return p < 0 ? r.value(0) : r.value(p);
2253
+ }
2254
+ function f(p) {
2255
+ return s.value ? p < 0 ? t.value(0) - t.value(p) : t.value(p) - t.value(0) : i.value.bandwidth();
2256
+ }
2257
+ function _(p) {
2258
+ return s.value ? l.value.bandwidth() : p < 0 ? r.value(p) - r.value(0) : r.value(0) - r.value(p);
2259
+ }
2260
+ function m(p, h, g) {
2261
+ var B;
2262
+ const { value: v, color: y } = p, O = (B = y != null ? y : e.value[h].color) != null ? B : Object.values(E)[h], T = u(v, g, h), $ = c(v, g, h), P = f(v), D = _(v);
2263
+ return {
2264
+ classList: [`lume-fill--${O}`, ...o],
2265
+ x: T,
2266
+ y: $,
2267
+ width: P,
2268
+ height: D,
2269
+ isFaded: a.value !== -1 && a.value !== g,
2270
+ isNegative: v < 0
2271
+ };
2272
+ }
2273
+ return { barAttributeGenerator: m };
2274
+ }
2275
+ function ua(e, t) {
2276
+ const r = d(
2277
+ () => t.value === b.HORIZONTAL
2278
+ ), n = d(() => {
2279
+ const i = e.value.map(
2280
+ (l) => l.filter((u) => u.value < 0).reduce((u, c) => u + c.value, 0)
2281
+ );
2282
+ return Math.min(...i);
2283
+ }), a = d(() => {
2284
+ const i = e.value.map(
2285
+ (l) => l.reduce(
2286
+ (u, c) => c.value >= 0 ? u + c.value : u,
2287
+ 0
2288
+ )
2289
+ );
2290
+ return Math.max(...i);
2291
+ });
2292
+ function o(i, l, u) {
2293
+ return r.value ? Q().domain([n.value, a.value]).range([0, u.width]) : Object.assign(
2294
+ ot(
2295
+ J().domain(l.map((c, f) => f)).range([0, u.width])
2296
+ ),
2297
+ { labels: l }
2298
+ );
2299
+ }
2300
+ function s(i, l, u) {
2301
+ return r.value ? Object.assign(
2302
+ ot(
2303
+ J().domain(l.map((c, f) => f)).range([0, u.height])
2304
+ ),
2305
+ { labels: l }
2306
+ ) : Q().domain([a.value, n.value]).range([0, u.height]);
2307
+ }
2308
+ return { stackedXScaleGenerator: o, stackedYScaleGenerator: s };
2309
+ }
2310
+ function la(e, t, r, n, a, o) {
2311
+ const s = d(
2312
+ () => n.value === b.HORIZONTAL
2313
+ ), i = d(
2314
+ () => s.value ? r.value.domain() : t.value.domain()
2315
+ ), l = d(
2316
+ () => e.value.map((v) => v.values.map((y) => y == null ? void 0 : y.value))
2317
+ );
2318
+ function u(v, y, O) {
2319
+ let T, $;
2320
+ return s.value ? (T = t.value(v >= 0 ? 0 + O : v + O), $ = r.value(i.value[y])) : (T = t.value(i.value[y]), $ = r.value(v >= 0 ? v + O : 0 + O)), { x: T, y: $ };
2321
+ }
2322
+ function c(v) {
2323
+ return s.value ? t.value(v) - t.value(0) : t.value.bandwidth();
2324
+ }
2325
+ function f(v) {
2326
+ return s.value ? t.value(0) - t.value(v) : t.value.bandwidth();
2327
+ }
2328
+ function _(v) {
2329
+ return s.value ? r.value.bandwidth() : r.value(0) - r.value(v);
2330
+ }
2331
+ function m(v) {
2332
+ return s.value ? r.value.bandwidth() : r.value(v) - r.value(0);
2333
+ }
2334
+ function p(v, y) {
2335
+ return v ? l.value.reduce((O, T, $) => ($ < v && T[y] >= 0 && (O += T[y]), O), 0) : 0;
2336
+ }
2337
+ function h(v, y) {
2338
+ return v ? l.value.reduce((O, T, $) => ($ < v && T[y] < 0 && (O += T[y]), O), 0) : 0;
2339
+ }
2340
+ function g(v, y, O) {
2341
+ var x;
2342
+ const { value: T, color: $ } = v, P = T >= 0 ? c(T) : f(T), D = T >= 0 ? _(T) : m(T), B = T >= 0 ? p(y, O) : h(y, O), { x: Z, y: V } = u(T, O, B);
2343
+ return {
2344
+ classList: [`lume-fill--${(x = $ != null ? $ : e.value[y].color) != null ? x : Object.values(E)[y]}`, ...o],
2345
+ width: P,
2346
+ height: D,
2347
+ x: Z,
2348
+ y: V,
2349
+ isFaded: a.value !== -1 && a.value !== O,
2350
+ isNegative: T < 0
2351
+ };
2352
+ }
2353
+ return { barAttributeGenerator: g };
2354
+ }
2355
+ const qt = {
2356
+ single: sa,
2357
+ grouped: ia,
2358
+ stacked: la
2359
+ }, ca = /* @__PURE__ */ k({
2360
+ __name: "lume-bar-group",
2361
+ props: {
2362
+ ...ft(),
2363
+ classList: {
2364
+ type: [String, Array],
2365
+ default: () => []
2366
+ },
2367
+ ...ra(!0),
2368
+ transition: {
2369
+ type: Boolean,
2370
+ default: !0
2371
+ }
2372
+ },
2373
+ setup(e) {
2374
+ const t = e, {
2375
+ data: r,
2376
+ hoveredIndex: n,
2377
+ options: a,
2378
+ orientation: o,
2379
+ transition: s,
2380
+ type: i,
2381
+ xScale: l,
2382
+ yScale: u,
2383
+ classList: c
2384
+ } = S(t), { groupedData: f } = pe(r), { barXScale: _, barYScale: m } = oa(
2385
+ l,
2386
+ u,
2387
+ a,
2388
+ o
2389
+ ), p = d(() => typeof c.value == "string" ? [c.value] : c.value), h = d(() => {
2390
+ const v = aa(r, i), { barAttributeGenerator: y } = qt[v](
2391
+ r,
2392
+ _,
2393
+ m,
2394
+ o,
2395
+ n,
2396
+ p.value
2397
+ );
2398
+ return y;
2399
+ }), g = d(() => {
2400
+ if (!!s.value)
2401
+ return o.value === b.HORIZONTAL ? "width" : "height";
2402
+ });
2403
+ return { __sfc: !0, MIXIN_MAP: qt, props: t, data: r, hoveredIndex: n, options: a, orientation: o, transition: s, type: i, xScale: l, yScale: u, classList: c, groupedData: f, barXScale: _, barYScale: m, computedClasses: p, getBarAttributes: h, computedTransition: g, LumeBar: Rt };
2404
+ }
2405
+ });
2406
+ var da = function() {
2407
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2408
+ return r("g", { staticClass: "lume-bar-group", attrs: { "data-j-bars-group": "" } }, t._l(n.groupedData, function(a, o) {
2409
+ return r("g", { key: o }, t._l(a, function(s, i) {
2410
+ return r(n.LumeBar, t._b({ key: `bar-${i}`, attrs: { transition: n.computedTransition, "data-j-lume-bar": "" } }, "lume-bar", n.getBarAttributes(s, i, o, a), !1));
2411
+ }), 1);
2412
+ }), 0);
2413
+ }, pa = [], fa = /* @__PURE__ */ w(
2414
+ ca,
2415
+ da,
2416
+ pa,
2417
+ !1,
2418
+ null,
2419
+ null,
2420
+ null,
2421
+ null
2422
+ );
2423
+ const Pt = fa.exports, va = {
2424
+ [b.VERTICAL]: {
2425
+ withTooltip: !0,
2426
+ xAxisOptions: {},
2427
+ yAxisOptions: { gridLines: !0 },
2428
+ margins: G.VERTICAL
2429
+ },
2430
+ [b.HORIZONTAL]: {
2431
+ withTooltip: !0,
2432
+ xAxisOptions: { gridLines: !0 },
2433
+ yAxisOptions: { gridLines: !1 },
2434
+ margins: G.HORIZONTAL
2435
+ }
2436
+ }, _a = /* @__PURE__ */ k({
2437
+ __name: "lume-single-bar-chart",
2438
+ props: {
2439
+ ...W(St)
2440
+ },
2441
+ setup(e) {
2442
+ const t = e, r = z(j()), { orientation: n, options: a } = S(t), o = d(
2443
+ () => va[n.value || b.VERTICAL]
2444
+ ), { allOptions: s } = N(a, o);
2445
+ return { __sfc: !0, props: t, slots: r, orientation: n, options: a, baseOptions: o, allOptions: s, LumeChart: Y, LumeBarGroup: Pt };
2446
+ }
2447
+ });
2448
+ var ha = function() {
2449
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2450
+ return r(n.LumeChart, t._b({ attrs: { "chart-type": "single-bar", options: n.allOptions, "data-j-single-bar-chart": "" }, scopedSlots: t._u([{ key: "groups", fn: function(a) {
2451
+ return [r(n.LumeBarGroup, t._b({ attrs: { orientation: n.orientation } }, "lume-bar-group", a, !1))];
2452
+ } }, t._l(n.slots, function(a, o) {
2453
+ return { key: o, fn: function(s) {
2454
+ return [t._t(o, null, null, s || {})];
2455
+ } };
2456
+ })], null, !0) }, "lume-chart", n.props, !1));
2457
+ }, ma = [], ga = /* @__PURE__ */ w(
2458
+ _a,
2459
+ ha,
2460
+ ma,
2461
+ !1,
2462
+ null,
2463
+ null,
2464
+ null,
2465
+ null
2466
+ );
2467
+ const Qa = ga.exports, ya = {
2468
+ [b.VERTICAL]: {
2469
+ withTooltip: !0,
2470
+ xAxisOptions: {},
2471
+ yAxisOptions: { gridLines: !0 },
2472
+ margins: G.VERTICAL
2473
+ },
2474
+ [b.HORIZONTAL]: {
2475
+ withTooltip: !0,
2476
+ xAxisOptions: { gridLines: !0 },
2477
+ yAxisOptions: { gridLines: !1 },
2478
+ margins: G.HORIZONTAL,
2479
+ tooltipOptions: { position: "right" }
2480
+ }
2481
+ }, ba = /* @__PURE__ */ k({
2482
+ __name: "lume-grouped-bar-chart",
2483
+ props: {
2484
+ ...W()
2485
+ },
2486
+ setup(e) {
2487
+ const t = e, r = z(j()), { orientation: n, options: a } = S(t), o = d(
2488
+ () => ya[n.value || b.VERTICAL]
2489
+ ), { allOptions: s } = N(a, o);
2490
+ return { __sfc: !0, props: t, slots: r, orientation: n, options: a, baseOptions: o, allOptions: s, LumeChart: Y, LumeBarGroup: Pt };
2491
+ }
2492
+ });
2493
+ var Ta = function() {
2494
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2495
+ return r(n.LumeChart, t._b({ attrs: { "chart-type": "grouped-bar", options: n.allOptions, "data-j-grouped-bar-chart": "" }, scopedSlots: t._u([{ key: "groups", fn: function(a) {
2496
+ return [r(n.LumeBarGroup, t._b({ attrs: { type: "grouped" } }, "lume-bar-group", a, !1))];
2497
+ } }, t._l(n.slots, function(a, o) {
2498
+ return { key: o, fn: function(s) {
2499
+ return [t._t(o, null, null, s || {})];
2500
+ } };
2501
+ })], null, !0) }, "lume-chart", n.props, !1));
2502
+ }, Aa = [], Oa = /* @__PURE__ */ w(
2503
+ ba,
2504
+ Ta,
2505
+ Aa,
2506
+ !1,
2507
+ null,
2508
+ null,
2509
+ null,
2510
+ null
2511
+ );
2512
+ const to = Oa.exports, xa = {
2513
+ [b.VERTICAL]: {
2514
+ withTooltip: !0,
2515
+ xAxisOptions: {},
2516
+ yAxisOptions: { gridLines: !0 },
2517
+ margins: G.VERTICAL
2518
+ },
2519
+ [b.HORIZONTAL]: {
2520
+ withTooltip: !0,
2521
+ xAxisOptions: { gridLines: !0 },
2522
+ yAxisOptions: { gridLines: !1 },
2523
+ margins: G.HORIZONTAL,
2524
+ tooltipOptions: { position: "right" }
2525
+ }
2526
+ }, La = /* @__PURE__ */ k({
2527
+ __name: "lume-stacked-bar-chart",
2528
+ props: {
2529
+ ...W()
2530
+ },
2531
+ setup(e) {
2532
+ const t = e, r = z(j()), { data: n, orientation: a, options: o } = S(t), s = d(
2533
+ () => xa[a.value || b.VERTICAL]
2534
+ ), { allOptions: i } = N(o, s), { internalData: l } = ct(n), { groupedData: u } = pe(l), { stackedXScaleGenerator: c, stackedYScaleGenerator: f } = ua(
2535
+ u,
2536
+ a
2537
+ );
2538
+ return { __sfc: !0, props: t, slots: r, data: n, orientation: a, options: o, baseOptions: s, allOptions: i, internalData: l, groupedData: u, stackedXScaleGenerator: c, stackedYScaleGenerator: f, LumeChart: Y, LumeBarGroup: Pt };
2539
+ }
2540
+ });
2541
+ var $a = function() {
2542
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2543
+ return r(n.LumeChart, t._b({ attrs: { "chart-type": "stacked-bar", options: n.allOptions, "x-scale": n.stackedXScaleGenerator, "y-scale": n.stackedYScaleGenerator, "data-j-stacked-bar-chart": "" }, scopedSlots: t._u([{ key: "groups", fn: function(a) {
2544
+ return [r(n.LumeBarGroup, t._b({ attrs: { type: "stacked" } }, "lume-bar-group", a, !1))];
2545
+ } }, t._l(n.slots, function(a, o) {
2546
+ return { key: o, fn: function(s) {
2547
+ return [t._t(o, null, null, s || {})];
2548
+ } };
2549
+ })], null, !0) }, "lume-chart", n.props, !1));
2550
+ }, ka = [], wa = /* @__PURE__ */ w(
2551
+ La,
2552
+ $a,
2553
+ ka,
2554
+ !1,
2555
+ null,
2556
+ null,
2557
+ null,
2558
+ null
2559
+ );
2560
+ const eo = wa.exports;
2561
+ function fe(e) {
2562
+ function t(o) {
2563
+ let s = null;
2564
+ return o == null ? void 0 : o.reduce((i, l, u) => (l == null || l.value == null ? (s ? s.push(u) : s = [u], u === (o == null ? void 0 : o.length) - 1 && i.push(s)) : s && (i.push(s), s = null), i), []);
2565
+ }
2566
+ function r(o, s, i, l) {
2567
+ const f = Math.abs(o - s) / (i + 1) * (l + 1);
2568
+ return o > s ? o - f : o + f;
2569
+ }
2570
+ function n(o) {
2571
+ return function(i) {
2572
+ return !!o.find(
2573
+ (l) => l.includes(i) || l.includes(i - 1)
2574
+ );
2575
+ };
2576
+ }
2577
+ return { computedLineData: d(() => e.value.map((o) => {
2578
+ const s = t(o.values);
2579
+ return {
2580
+ ...o,
2581
+ isDashed: n(s),
2582
+ values: o.values.map((i, l) => {
2583
+ var c, f;
2584
+ const u = s.find(
2585
+ (_) => _.includes(l)
2586
+ );
2587
+ if (u) {
2588
+ const _ = u[0] - 1, m = u[u.length - 1] + 1;
2589
+ let p = (c = o.values[_]) == null ? void 0 : c.value, h = (f = o.values[m]) == null ? void 0 : f.value;
2590
+ return p == null && (p = h), h == null && (h = p), {
2591
+ value: r(
2592
+ p,
2593
+ h,
2594
+ u.length,
2595
+ u.indexOf(l)
2596
+ ),
2597
+ label: ne
2598
+ };
2599
+ }
2600
+ return i;
2601
+ })
2602
+ };
2603
+ })) };
2604
+ }
2605
+ function Sa(e, t) {
2606
+ const r = Ct(e) / 2;
2607
+ return (n, a) => e(e.domain()[t + (a - 1)]) + r;
2608
+ }
2609
+ function Ca(e, t) {
2610
+ return (r, n) => e(t + (n - 1));
2611
+ }
2612
+ function Ia(e, t, r, n) {
2613
+ return we().x(
2614
+ M(r) ? Sa(r, e) : Ca(r, e)
2615
+ ).y((o) => n(o))(t);
2616
+ }
2617
+ const Yt = 1, Ra = /* @__PURE__ */ k({
2618
+ __name: "lume-line-group",
2619
+ props: {
2620
+ ...ft(),
2621
+ withPoints: {
2622
+ type: Boolean,
2623
+ default: !0
2624
+ },
2625
+ transition: {
2626
+ type: Boolean,
2627
+ default: !0
2628
+ }
2629
+ },
2630
+ setup(e) {
2631
+ const t = e, { data: r, options: n, xScale: a, yScale: o } = S(t), s = d(() => {
2632
+ if (r.value.every((y) => y.isDashed))
2633
+ return r.value;
2634
+ const { computedLineData: v } = fe(r);
2635
+ if (n.value.withTooltip !== !1) {
2636
+ const { updateTooltipAnchorAttributes: y } = le(a, o);
2637
+ y(v.value);
2638
+ }
2639
+ return v.value;
2640
+ }), i = d(() => {
2641
+ if (t.hoveredIndex === -1)
2642
+ return;
2643
+ const v = Qe(
2644
+ s.value,
2645
+ t.hoveredIndex
2646
+ );
2647
+ return {
2648
+ d: `M ${Tt(a.value, t.hoveredIndex)},${o.value.range()[1]}
2649
+ V ${o.value(v)}`
2650
+ };
2651
+ }), l = d(
2652
+ () => a.value && Yt / (tn(a.value) - 1)
2653
+ ), u = d(
2654
+ () => {
2655
+ var v;
2656
+ return ((v = n.value) == null ? void 0 : v.lineWidth) * 2 || void 0;
2657
+ }
2658
+ ), c = d(() => Ct(a.value) / 2), f = d(() => a.value.domain());
2659
+ function _(v) {
2660
+ return s.value[v].values;
2661
+ }
2662
+ function m(v, y) {
2663
+ var T, $;
2664
+ const O = v === 0 ? [] : [
2665
+ (T = _(y)[v - 1]) == null ? void 0 : T.value,
2666
+ ($ = _(y)[v]) == null ? void 0 : $.value
2667
+ ];
2668
+ return Ia(
2669
+ v,
2670
+ O,
2671
+ a.value,
2672
+ o.value
2673
+ ) || "";
2674
+ }
2675
+ function p(v) {
2676
+ return {
2677
+ animationDelay: v < 2 ? 0 : (v - 1) * l.value,
2678
+ animationDuration: l.value
2679
+ };
2680
+ }
2681
+ function h(v, y) {
2682
+ var T;
2683
+ const O = (T = _(y)[v]) == null ? void 0 : T.value;
2684
+ return {
2685
+ x: M(a.value) ? t.xScale(f.value[v]) + c.value : t.xScale(v),
2686
+ y: o.value(O)
2687
+ };
2688
+ }
2689
+ function g(v) {
2690
+ return t.hoveredIndex === v;
2691
+ }
2692
+ return { __sfc: !0, LUME_TRANSITION_TIME_FULL: Yt, props: t, data: r, options: n, xScale: a, yScale: o, computedGroupData: s, overlayLineAttributes: i, animationDuration: l, pointRadius: u, xAxisOffset: c, domain: f, getValuesFromDataset: _, getPathDefinition: m, getLineTransitionParams: p, getPointPosition: h, isPointActive: g, LumeLine: ar, LumePoint: lr };
2693
+ }
2694
+ });
2695
+ var Pa = function() {
2696
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2697
+ return r("g", { staticClass: "lume-line-group", attrs: { "data-j-lume-line-group": "" } }, [r("path", t._b({ staticClass: "lume-line-group__overlay-line", attrs: { "data-j-lume-line-group__overlay-line": "" } }, "path", n.overlayLineAttributes, !1)), t._l(n.computedGroupData, function(a, o) {
2698
+ return r("g", { key: a.label, staticClass: "lume-line-group__group" }, [r("g", { staticClass: "lume-line-group__lines" }, t._l(a.values, function(s, i) {
2699
+ return r(n.LumeLine, t._b({ key: `line-${i}`, attrs: { color: a.color, dashed: a.isDashed(i), "path-definition": n.getPathDefinition(i, o), transition: t.transition, width: n.options.lineWidth } }, "lume-line", n.getLineTransitionParams(i), !1));
2700
+ }), 1), t.withPoints ? r("g", { staticClass: "lume-line-group__points", attrs: { "data-j-lume-line-group__points": "" } }, t._l(a.values, function(s, i) {
2701
+ return r(n.LumePoint, t._b({ key: `point-${i}`, attrs: { active: n.isPointActive(i), color: a.color, index: i, radius: n.pointRadius } }, "lume-point", n.getPointPosition(i, o), !1));
2702
+ }), 1) : t._e()]);
2703
+ })], 2);
2704
+ }, Da = [], Ea = /* @__PURE__ */ w(
2705
+ Ra,
2706
+ Pa,
2707
+ Da,
2708
+ !1,
2709
+ null,
2710
+ "d5c53b3e",
2711
+ null,
2712
+ null
2713
+ );
2714
+ const ve = Ea.exports, Na = {
2715
+ margins: G.VERTICAL,
2716
+ startOnZero: !0,
2717
+ withTooltip: !0,
2718
+ xAxisOptions: {},
2719
+ yAxisOptions: { gridLines: !0 }
2720
+ }, Ba = /* @__PURE__ */ k({
2721
+ __name: "lume-line-chart",
2722
+ props: {
2723
+ ...W(null, !1)
2724
+ },
2725
+ setup(e) {
2726
+ const t = e, r = z(j()), { options: n } = S(t), { allOptions: a } = N(n, Na);
2727
+ return { __sfc: !0, props: t, slots: r, options: n, allOptions: a, LumeChart: Y, LumeLineGroup: ve };
2728
+ }
2729
+ });
2730
+ var Ha = function() {
2731
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2732
+ return r(n.LumeChart, t._b({ attrs: { "chart-type": "line", options: n.allOptions, "data-j-lume-line-chart": "" }, scopedSlots: t._u([{ key: "groups", fn: function(a) {
2733
+ return [r(n.LumeLineGroup, t._b({}, "lume-line-group", a, !1))];
2734
+ } }, t._l(n.slots, function(a, o) {
2735
+ return { key: o, fn: function(s) {
2736
+ return [t._t(o, null, null, s || {})];
2737
+ } };
2738
+ })], null, !0) }, "lume-chart", n.props, !1));
2739
+ }, ja = [], Va = /* @__PURE__ */ w(
2740
+ Ba,
2741
+ Ha,
2742
+ ja,
2743
+ !1,
2744
+ null,
2745
+ null,
2746
+ null,
2747
+ null
2748
+ );
2749
+ const no = Va.exports;
2750
+ function Fa(e) {
2751
+ return { areaPathDefinition: d(
2752
+ () => function(r, n) {
2753
+ if (!r || !n)
2754
+ return;
2755
+ const a = e.value[0].values;
2756
+ return Se().x((o, s) => r(s)).y0(n(Math.min(...n.domain()))).y1((o) => n(o.value))(a);
2757
+ }
2758
+ ) };
2759
+ }
2760
+ const Ga = {
2761
+ margins: {
2762
+ top: 0,
2763
+ right: 0,
2764
+ bottom: 0,
2765
+ left: 0
2766
+ },
2767
+ withAxes: !1,
2768
+ showArea: !0,
2769
+ startOnZero: !0,
2770
+ withLegend: !1,
2771
+ tooltipOptions: {
2772
+ showTitle: !1
2773
+ }
2774
+ }, Ma = /* @__PURE__ */ k({
2775
+ __name: "lume-sparkline-chart",
2776
+ props: {
2777
+ ...se(null),
2778
+ ...dt()
2779
+ },
2780
+ setup(e, { expose: t }) {
2781
+ const r = e, n = z(j()), { data: a, options: o } = S(r), { internalData: s } = ct(a), { allOptions: i } = N(o, Ga), { computedLineData: l } = fe(s), { areaPathDefinition: u } = Fa(l), c = d(() => s.value[0].color), f = d(
2782
+ () => a.value[0].areaColor || c.value
2783
+ );
2784
+ function _(p) {
2785
+ return {
2786
+ ...p,
2787
+ noMinSize: !0
2788
+ };
2789
+ }
2790
+ function m(p, h, g) {
2791
+ return Q().range([0, g.width]).domain([0, p[0].values.length - 1]);
2792
+ }
2793
+ return t({
2794
+ areaPathDefinition: u
2795
+ }), { __sfc: !0, props: r, slots: n, data: a, options: o, internalData: s, allOptions: i, computedLineData: l, areaPathDefinition: u, computedColor: c, areaColor: f, getSparklineOptions: _, xScaleGenerator: m, LumeChart: Y, LumeLineGroup: ve };
2796
+ }
2797
+ });
2798
+ var za = function() {
2799
+ var t = this, r = t._self._c, n = t._self._setupProxy;
2800
+ return r(n.LumeChart, t._b({ attrs: { "chart-type": "line", options: n.getSparklineOptions(n.allOptions), "x-scale": n.xScaleGenerator }, scopedSlots: t._u([{ key: "groups", fn: function(a) {
2801
+ return [n.allOptions.showArea ? r("path", { class: [
2802
+ "sparkline-chart__area",
2803
+ `lume-fill--${n.areaColor || n.computedColor}`,
2804
+ "lume-fill--faded"
2805
+ ], attrs: { d: n.areaPathDefinition(a.xScale, a.yScale), "data-j-sparkline__area": "" } }) : t._e(), r(n.LumeLineGroup, t._b({ attrs: { "with-points": !1 } }, "lume-line-group", a, !1))];
2806
+ } }, t._l(n.slots, function(a, o) {
2807
+ return { key: o, fn: function(s) {
2808
+ return [t._t(o, null, null, s || {})];
2809
+ } };
2810
+ })], null, !0) }, "lume-chart", n.props, !1));
2811
+ }, Wa = [], Za = /* @__PURE__ */ w(
2812
+ Ma,
2813
+ za,
2814
+ Wa,
2815
+ !1,
2816
+ null,
2817
+ "6d7c407a",
2818
+ null,
2819
+ null
2820
+ );
2821
+ const ro = Za.exports;
2822
+ export {
2823
+ In as L,
2824
+ Ja as a,
2825
+ Qa as b,
2826
+ to as c,
2827
+ eo as d,
2828
+ no as e,
2829
+ ro as f,
2830
+ Y as g,
2831
+ Bn as h,
2832
+ Gn as i,
2833
+ Xn as j,
2834
+ Rt as k,
2835
+ Ka as l,
2836
+ ar as m,
2837
+ lr as n,
2838
+ Wr as o,
2839
+ Pt as p,
2840
+ ve as q,
2841
+ hr as r
2842
+ };
2843
+ //# sourceMappingURL=c4b54d0a.js.map